From b16b9e4656e7199c2aec74a4c8ebc7a875d3ba73 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 2 Feb 2015 15:02:49 +0100 Subject: massive reduction of unneeded files --- nx-X11/programs/Xserver/GL/apple/Imakefile | 49 - nx-X11/programs/Xserver/GL/apple/aglGlx.c | 1355 ------------- nx-X11/programs/Xserver/GL/apple/indirect.c | 1380 ------------- nx-X11/programs/Xserver/GL/dri/Imakefile | 35 - .../programs/Xserver/GL/dri/Imakefile.NX.reference | 35 - .../Xserver/GL/dri/Imakefile.XF86.reference | 34 - nx-X11/programs/Xserver/GL/dri/dri-def.cpp | 50 - nx-X11/programs/Xserver/GL/dri/dri.c | 2109 -------------------- nx-X11/programs/Xserver/GL/dri/dri.h | 345 ---- nx-X11/programs/Xserver/GL/dri/drimodule.c | 127 -- nx-X11/programs/Xserver/GL/dri/dristruct.h | 105 - nx-X11/programs/Xserver/GL/dri/sarea.h | 94 - nx-X11/programs/Xserver/GL/dri/xf86dri.c | 649 ------ nx-X11/programs/Xserver/GL/windows/ChangeLog | 64 - nx-X11/programs/Xserver/GL/windows/Imakefile | 36 - nx-X11/programs/Xserver/GL/windows/glwindows.h | 64 - nx-X11/programs/Xserver/GL/windows/glwrap.c | 583 ------ nx-X11/programs/Xserver/GL/windows/indirect.c | 1605 --------------- 18 files changed, 8719 deletions(-) delete mode 100644 nx-X11/programs/Xserver/GL/apple/Imakefile delete mode 100644 nx-X11/programs/Xserver/GL/apple/aglGlx.c delete mode 100644 nx-X11/programs/Xserver/GL/apple/indirect.c delete mode 100644 nx-X11/programs/Xserver/GL/dri/Imakefile delete mode 100644 nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference delete mode 100644 nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference delete mode 100644 nx-X11/programs/Xserver/GL/dri/dri-def.cpp delete mode 100644 nx-X11/programs/Xserver/GL/dri/dri.c delete mode 100644 nx-X11/programs/Xserver/GL/dri/dri.h delete mode 100644 nx-X11/programs/Xserver/GL/dri/drimodule.c delete mode 100644 nx-X11/programs/Xserver/GL/dri/dristruct.h delete mode 100644 nx-X11/programs/Xserver/GL/dri/sarea.h delete mode 100644 nx-X11/programs/Xserver/GL/dri/xf86dri.c delete mode 100644 nx-X11/programs/Xserver/GL/windows/ChangeLog delete mode 100755 nx-X11/programs/Xserver/GL/windows/Imakefile delete mode 100644 nx-X11/programs/Xserver/GL/windows/glwindows.h delete mode 100755 nx-X11/programs/Xserver/GL/windows/glwrap.c delete mode 100755 nx-X11/programs/Xserver/GL/windows/indirect.c (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/apple/Imakefile b/nx-X11/programs/Xserver/GL/apple/Imakefile deleted file mode 100644 index 36b780c73..000000000 --- a/nx-X11/programs/Xserver/GL/apple/Imakefile +++ /dev/null @@ -1,49 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/apple/Imakefile,v 1.2 2003/09/16 00:36:11 torrey Exp $ - -#include - - XPRDIR = $(SERVERSRC)/hw/darwin/quartz/xpr - -LinkSourceFile(x-list.c,$(XPRDIR)) -LinkSourceFile(x-list.h,$(XPRDIR)) -LinkSourceFile(x-hash.c,$(XPRDIR)) -LinkSourceFile(x-hash.h,$(XPRDIR)) -LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) - - BASE_SRCS = compsize.c - BASE_OBJS = compsize.o - - AGL_SRCS = aglGlx.c - AGL_OBJS = aglGlx.o - -#if HasXplugin - GL_SRCS = indirect.c x-hash.c x-list.c - GL_OBJS = indirect.o x-hash.o x-list.o - - AS = /System/Library/Frameworks/ApplicationServices.framework - - GL_INCLUDES = -I$(LIBSRC)/GL/apple -I$(XPRDIR) -I$(XPINCDIR) \ - -F$(AS)/Frameworks -#endif - - SRCS = $(BASE_SRCS) $(AGL_SRCS) $(GL_SRCS) - OBJS = $(BASE_OBJS) $(AGL_OBJS) $(GL_OBJS) - - INCLUDES = -I. -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \ - -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(FONTINCSRC) \ - -I$(SERVERSRC)/render -I$(SERVERSRC)/GL/include \ - -I$(SERVERSRC)/GL/glx -I$(SERVERSRC)/hw/darwin/quartz/cr \ - -I$(SERVERSRC)/hw/darwin/quartz $(GL_INCLUDES) \ - -I$(MESASRCDIR)/include -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(XF86OSSRC) - - DEFINES = $(GLX_DEFINES) - -NormalLibraryTarget(AGLcore,$(AGL_OBJS) $(BASE_OBJS)) -#if HasXplugin -NormalLibraryTarget(CGLcore,$(GL_OBJS) $(BASE_OBJS)) -#endif -NormalLibraryObjectRule() - -DependTarget() diff --git a/nx-X11/programs/Xserver/GL/apple/aglGlx.c b/nx-X11/programs/Xserver/GL/apple/aglGlx.c deleted file mode 100644 index be846be83..000000000 --- a/nx-X11/programs/Xserver/GL/apple/aglGlx.c +++ /dev/null @@ -1,1355 +0,0 @@ -/* - * GLX implementation that uses Apple's AGL.framework for OpenGL - * - * FIXME: This file and indirect.c are very similar. The two should be - * merged by introducing suitable abstractions. - */ -/* - * Copyright (c) 2002 Greg Parker. All Rights Reserved. - * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. - * - * Large portions of this file are copied from Mesa's xf86glx.c, - * which contains the following copyright: - * - * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. - * 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 ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ -/* $XFree86: xc/programs/Xserver/GL/apple/aglGlx.c,v 1.2 2003/09/16 00:36:11 torrey Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "quartzCommon.h" -#include -#include "cr.h" - -// X11 and X11's glx -#undef BOOL -#define BOOL xBOOL -#include "quartz.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#undef BOOL - -#include "glcontextmodes.h" - -// ggs: needed to call back to glx with visual configs -extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs); - -// Write debugging output, or not -#ifdef GLAQUA_DEBUG -#define GLAQUA_DEBUG_MSG ErrorF -#else -#define GLAQUA_DEBUG_MSG(a, ...) -#endif - - -// The following GL functions don't have an EXT suffix in OpenGL.framework. -GLboolean glAreTexturesResidentEXT (GLsizei a, const GLuint *b, GLboolean *c) { - return glAreTexturesResident(a, b, c); -} -void glDeleteTexturesEXT (GLsizei d, const GLuint *e) { - glDeleteTextures(d, e); -} -void glGenTexturesEXT (GLsizei f, GLuint *g) { - glGenTextures(f, g); -} -GLboolean glIsTextureEXT (GLuint h) { - return glIsTexture(h); -} - - -// some prototypes -static Bool glAquaScreenProbe(int screen); -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB); -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates); -static __GLinterface *glAquaCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC); -static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv); -static void glAquaResetExtension(void); - - -/* - * This structure is statically allocated in the __glXScreens[] - * structure. This struct is not used anywhere other than in - * __glXScreenInit to initialize each of the active screens - * (__glXActiveScreens[]). Several of the fields must be initialized by - * the screenProbe routine before they are copied to the active screens - * struct. In particular, the contextCreate, modes, numVisuals, - * and numUsableVisuals fields must be initialized. - */ -static __GLXscreenInfo __glDDXScreenInfo = { - glAquaScreenProbe, /* Must be generic and handle all screens */ - glAquaCreateContext, /* Substitute screen's createContext routine */ - glAquaCreateBuffer, /* Substitute screen's createBuffer routine */ - NULL, /* Set up modes in probe */ - NULL, /* Set up pVisualPriv in probe */ - 0, /* Set up numVisuals in probe */ - 0, /* Set up numUsableVisuals in probe */ - "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ - "Version String", /* GLXversion is overwritten by __glXScreenInit */ - "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ - NULL /* WrappedPositionWindow is overwritten */ -}; - -void *__glXglDDXScreenInfo(void) { - return &__glDDXScreenInfo; -} - -static __GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_APPLE, - glAquaResetExtension, - glAquaInitVisuals, - glAquaSetVisualConfigs -}; - -void *__glXglDDXExtensionInfo(void) { - return &__glDDXExtensionInfo; -} - -// prototypes - -static GLboolean glAquaDestroyContext(__GLcontext *gc); -static GLboolean glAquaLoseCurrent(__GLcontext *gc); -static GLboolean glAquaMakeCurrent(__GLcontext *gc); -static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare); -static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask); -static GLboolean glAquaForceCurrent(__GLcontext *gc); - -/* Drawing surface notification callbacks */ -static GLboolean glAquaNotifyResize(__GLcontext *gc); -static void glAquaNotifyDestroy(__GLcontext *gc); -static void glAquaNotifySwapBuffers(__GLcontext *gc); - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc); -static void glAquaBeginDispatchOverride(__GLcontext *gc); -static void glAquaEndDispatchOverride(__GLcontext *gc); - - -static __GLexports glAquaExports = { - glAquaDestroyContext, - glAquaLoseCurrent, - glAquaMakeCurrent, - glAquaShareContext, - glAquaCopyContext, - glAquaForceCurrent, - - glAquaNotifyResize, - glAquaNotifyDestroy, - glAquaNotifySwapBuffers, - - glAquaDispatchExec, - glAquaBeginDispatchOverride, - glAquaEndDispatchOverride -}; - - -typedef struct { - int num_vis; - __GLcontextModes *modes; - void **priv; - - // wrapped screen functions - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; -} glAquaScreenRec; - -static glAquaScreenRec glAquaScreens[MAXSCREENS]; - - -// __GLdrawablePrivate->private -typedef struct { - GLboolean (*resize)(__GLdrawableBuffer *buf, GLint x, GLint y, - GLuint width, GLuint height, - __GLdrawablePrivate *glPriv, - GLuint bufferMask); -} GLAquaDrawableRec; - -struct __GLcontextRec { - struct __GLinterfaceRec interface; // required to be first - - AGLContext ctx; - AGLPixelFormat pixelFormat; - - Bool isAttached; // TRUE if ctx is really attached to a window -}; - - -// Context manipulation; return GL_FALSE on failure -static GLboolean glAquaDestroyContext(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n", gc->ctx); - - if (gc) { - if (gc->ctx) aglDestroyContext(gc->ctx); - if (gc->pixelFormat) aglDestroyPixelFormat(gc->pixelFormat); - free(gc); - } - - return GL_TRUE; -} - - -static GLboolean glAquaLoseCurrent(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", gc->ctx); - - aglSetCurrentContext(NULL); - __glXLastContext = NULL; // Mesa does this; why? - gc->isAttached = FALSE; - - return GL_TRUE; -} - - -/* - * Attach a GL context to a GL drawable - * If glPriv is NULL, the context is detached. - */ -static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv) -{ - __GLXdrawablePrivate *glxPriv; - - if (glPriv == NULL) { - // attaching to nothing - GLAQUA_DEBUG_MSG("unattaching\n"); - aglSetDrawable(gc->ctx, NULL); - gc->isAttached = FALSE; - return; - } - - // Note that when resizing, the X11 WindowPtr already has its - // new size and position, but the Aqua window does not. - - glxPriv = (__GLXdrawablePrivate *)glPriv->other; - - if (glxPriv->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr) glxPriv->pDraw; - WindowPtr topWin = quartzProcs->TopLevelParent(pWin); - CRWindowPtr crWinPtr; - AGLDrawable newPort; - - if (glPriv->width <= 0 || glPriv->height <= 0) { - // attach to zero size drawable - will really attach later - GLAQUA_DEBUG_MSG("couldn't attach to zero size drawable\n"); - aglSetDrawable(gc->ctx, NULL); - gc->isAttached = FALSE; - return; - } - - crWinPtr = (CRWindowPtr) quartzProcs->FrameForWindow(pWin, FALSE); - - if (crWinPtr) { - newPort = (AGLDrawable) crWinPtr->port; - } else { - newPort = NULL; - } - - if (newPort) { - // FIXME: won't be a CGrafPtr if currently offscreen or fullscreen - AGLDrawable oldPort = aglGetDrawable(gc->ctx); - // AGLDrawable newPort = GetWindowPort(window); - - // Frame is GLdrawable in X11 global coordinates - // FIXME: Does this work for multiple screens? - GLint frame[4] = {glPriv->xOrigin, glPriv->yOrigin, glPriv->width, glPriv->height}; - GLAQUA_DEBUG_MSG("global size %d %d %d %d\n", - frame[0], frame[1], frame[2], frame[3]); - - // Convert to window-local coordinates - frame[0] -= topWin->drawable.x - topWin->borderWidth; - frame[1] -= topWin->drawable.y - topWin->borderWidth; - - // AGL uses flipped coordinates - frame[1] = topWin->drawable.height + 2*topWin->borderWidth - - frame[1] - frame[3]; - - GLAQUA_DEBUG_MSG("local size %d %d %d %d\n", - frame[0], frame[1], frame[2], frame[3]); - - if (oldPort != newPort) { - // FIXME: retain/release windows - if (!aglSetDrawable(gc->ctx, newPort)) return; - } - if (!aglSetInteger(gc->ctx, AGL_BUFFER_RECT, frame)) return; - if (!aglEnable(gc->ctx, AGL_BUFFER_RECT)) return; - if (!aglSetInteger(gc->ctx, AGL_SWAP_RECT, frame)) return; - if (!aglEnable(gc->ctx, AGL_SWAP_RECT)) return; - if (!aglUpdateContext(gc->ctx)) return; - - gc->isAttached = TRUE; - GLAQUA_DEBUG_MSG("attached context 0x%x to window 0x%x\n", gc->ctx, - pWin->drawable.id); - } else { - // attach to not-yet-realized window - will really attach later - GLAQUA_DEBUG_MSG("couldn't attach to unrealized window\n"); - aglSetDrawable(gc->ctx, NULL); - gc->isAttached = FALSE; - } - } else { - GLAQUA_DEBUG_MSG("attach: attach to non-window unimplemented\n"); - aglSetDrawable(gc->ctx, NULL); - gc->isAttached = FALSE; - } -} - -static GLboolean glAquaMakeCurrent(__GLcontext *gc) -{ - __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc); - - GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", gc->ctx); - - if (!gc->isAttached) { - attach(gc, glPriv); - } - - return aglSetCurrentContext(gc->ctx); -} - -static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare) -{ - GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n"); - - return GL_TRUE; -} - - -static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask) -{ - GLAQUA_DEBUG_MSG("glAquaCopyContext\n"); - - return aglCopyContext(src->ctx, dst->ctx, mask); -} - -static GLboolean glAquaForceCurrent(__GLcontext *gc) -{ - // GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n", gc->ctx); - return aglSetCurrentContext(gc->ctx); -} - -/* Drawing surface notification callbacks */ - -static GLboolean glAquaNotifyResize(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize"); - return GL_TRUE; -} - -static void glAquaNotifyDestroy(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy"); -} - -static void glAquaNotifySwapBuffers(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers"); -} - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec"); - return NULL; -} - -static void glAquaBeginDispatchOverride(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride"); -} - -static void glAquaEndDispatchOverride(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride"); -} - - -static AGLPixelFormat makeFormat(__GLcontextModes *mode) -{ - int i; - GLint attr[64]; // currently uses max of 30 - AGLPixelFormat result; - - GLAQUA_DEBUG_MSG("makeFormat\n"); - - i = 0; - - // attr [i++] = AGL_ACCELERATED; // require hwaccel - BAD for multiscreen - // attr [i++] = AGL_NO_RECOVERY; // disable fallback renderers - BAD - - if (mode->stereoMode) { - attr[i++] = AGL_STEREO; - } - if (mode->doubleBufferMode) { - attr[i++] = AGL_DOUBLEBUFFER; - } - - if (mode->colorIndexMode) { - attr[i++] = AGL_BUFFER_SIZE; - attr[i++] = mode->indexBits; - } - - if (mode->rgbMode) { - attr[i++] = AGL_RGBA; - attr[i++] = AGL_RED_SIZE; - attr[i++] = mode->redBits; - attr[i++] = AGL_GREEN_SIZE; - attr[i++] = mode->greenBits; - attr[i++] = AGL_BLUE_SIZE; - attr[i++] = mode->blueBits; - attr[i++] = AGL_ALPHA_SIZE; - attr[i++] = mode->alphaBits; - } - - if (mode->haveAccumBuffer) { - attr[i++] = AGL_ACCUM_RED_SIZE; - attr[i++] = mode->accumRedBits; - attr[i++] = AGL_ACCUM_GREEN_SIZE; - attr[i++] = mode->accumGreenBits; - attr[i++] = AGL_ACCUM_BLUE_SIZE; - attr[i++] = mode->accumBlueBits; - attr[i++] = AGL_ACCUM_ALPHA_SIZE; - attr[i++] = mode->accumAlphaBits; - } - if (mode->haveDepthBuffer) { - attr[i++] = AGL_DEPTH_SIZE; - attr[i++] = mode->depthBits; - } - if (mode->haveStencilBuffer) { - attr[i++] = AGL_STENCIL_SIZE; - attr[i++] = mode->stencilBits; - } - - attr[i++] = AGL_AUX_BUFFERS; - attr[i++] = mode->numAuxBuffers; - - attr[i++] = AGL_LEVEL; - attr[i++] = mode->level; - - // mode->pixmapMode ? - - attr[i++] = AGL_NONE; // end of option list - - GLAQUA_DEBUG_MSG("makeFormat almost done\n"); - result = aglChoosePixelFormat(NULL, 0, attr); - GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", result); - return result; -} - -static __GLinterface *glAquaCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC) -{ - __GLcontext *result; - __GLcontext *sharectx = (__GLcontext *)shareGC; - - GLAQUA_DEBUG_MSG("glAquaCreateContext\n"); - - result = (__GLcontext *)calloc(1, sizeof(__GLcontext)); - if (!result) return NULL; - - result->interface.imports = *imports; - result->interface.exports = glAquaExports; - - result->pixelFormat = makeFormat(mode); - if (!result->pixelFormat) { - free(result); - return NULL; - } - - result->ctx = aglCreateContext(result->pixelFormat, - (sharectx && sharectx->ctx) ? sharectx->ctx : NULL); - - if (!result->ctx) { - aglDestroyPixelFormat(result->pixelFormat); - free(result); - return NULL; - } - - result->isAttached = FALSE; - - GLAQUA_DEBUG_MSG("glAquaCreateContext done\n"); - return (__GLinterface *)result; -} - - -Bool -glAquaRealizeWindow(WindowPtr pWin) -{ - // If this window has GL contexts, tell them to reattach - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n"); - - // Allow the window to be created (RootlessRealizeWindow is inside our wrap) - pScreen->RealizeWindow = screenPriv->RealizeWindow; - result = pScreen->RealizeWindow(pWin); - pScreen->RealizeWindow = glAquaRealizeWindow; - - // The Aqua window will already have been created (windows are - // realized from top down) - - // Re-attach this window's GL contexts, if any. - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n"); - - // GL contexts bound to this window for drawing - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->nextDrawPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - - // GL contexts bound to this window for reading - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->nextReadPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - } - - return result; -} - -Bool -glAquaUnrealizeWindow(WindowPtr pWin) -{ - // If this window has GL contexts, tell them to unattach - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n"); - - // The Aqua window may have already been destroyed (windows - // are unrealized from top down) - - // Unattach this window's GL contexts, if any. - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n"); - - // GL contexts bound to this window for drawing - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->nextDrawPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, NULL); - } - - // GL contexts bound to this window for reading - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->nextReadPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, NULL); - } - } - - pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow; - result = pScreen->UnrealizeWindow(pWin); - pScreen->UnrealizeWindow = glAquaUnrealizeWindow; - - return result; -} - - -// Originally copied from Mesa - -static int numConfigs = 0; -static __GLXvisualConfig *visualConfigs = NULL; -static void **visualPrivates = NULL; - -/* - * In the case the driver defines no GLX visuals we'll use these. - * Note that for TrueColor and DirectColor visuals, bufferSize is the - * sum of redSize, greenSize, blueSize and alphaSize, which may be larger - * than the nplanes/rootDepth of the server's X11 visuals - */ -#define NUM_FALLBACK_CONFIGS 5 -static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = { - /* [0] = RGB, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [1] = RGB, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 16, 16, 16, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [4] = CI, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - False, /* rgba? (false = color index) */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, -}; - -static __GLXvisualConfig NullConfig = { - -1, /* vid */ - -1, /* class */ - False, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ -}; - - -static int count_bits(unsigned int n) -{ - int bits = 0; - - while (n > 0) { - if (n & 1) bits++; - n >>= 1; - } - return bits; -} - - -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numRGBconfigs; - int numCIconfigs; - int numVisuals = *nvisualp; - int numNewVisuals; - int numNewConfigs; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLcontextModes *modes; - __GLXvisualConfig *pNewVisualConfigs = NULL; - void **glXVisualPriv; - void **pNewVisualPriv; - int found_default; - int i, j, k; - - GLAQUA_DEBUG_MSG("init_visuals\n"); - - if (numConfigs > 0) - numNewConfigs = numConfigs; - else - numNewConfigs = NUM_FALLBACK_CONFIGS; - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* - ** If SetVisualConfigs was not called, then use default GLX - ** visual configs. - */ - if (numConfigs == 0) { - memcpy(pNewVisualConfigs, FallbackConfigs, - NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig)); - memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *)); - } - else { - /* copy driver's visual config info */ - for (i = 0; i < numConfigs; i++) { - pNewVisualConfigs[i] = visualConfigs[i]; - pNewVisualPriv[i] = visualPrivates[i]; - } - } - - /* Count the number of RGB and CI visual configs */ - numRGBconfigs = 0; - numCIconfigs = 0; - for (i = 0; i < numNewConfigs; i++) { - if (pNewVisualConfigs[i].rgba) - numRGBconfigs++; - else - numCIconfigs++; - } - - /* Count the total number of visuals to compute */ - numNewVisuals = 0; - for (i = 0; i < numVisuals; i++) { - int count; - - count = ((pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor) - ? numRGBconfigs : numCIconfigs); - if (count == 0) - count = 1; /* preserve the existing visual */ - - numNewVisuals += count; - } - - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - __glXFree(glXVisualPriv); - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Initialize the new visuals */ - found_default = FALSE; - glAquaScreens[screenInfo.numScreens-1].modes = modes; - for (i = j = 0; i < numVisuals; i++) { - int is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - if (!is_rgb) - { - /* We don't support non-rgb visuals for GL. But we don't - want to remove them either, so just pass them through - with null glX configs */ - - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & NullConfig ); - modes->visualID = pVisualNew[j].vid; - - j++; - - continue; - } - - for (k = 0; k < numNewConfigs; k++) { - if (pNewVisualConfigs[k].rgba != is_rgb) - continue; - - assert( modes != NULL ); - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] ); - modes->visualID = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (modes->visualType == GLX_NONE) { - modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class ); - modes->redBits = count_bits(pVisual[i].redMask); - modes->greenBits = count_bits(pVisual[i].greenMask); - modes->blueBits = count_bits(pVisual[i].blueMask); - modes->alphaBits = modes->alphaBits; - modes->redMask = pVisual[i].redMask; - modes->greenMask = pVisual[i].greenMask; - modes->blueMask = pVisual[i].blueMask; - modes->alphaMask = modes->alphaMask; - modes->rgbBits = (is_rgb) - ? (modes->redBits + modes->greenBits + - modes->blueBits + modes->alphaBits) - : rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pNewVisualPriv[k]; - - j++; - modes = modes->next; - } - } - - assert(j <= numNewVisuals); - - /* Save the GLX visuals in the screen structure */ - glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; - glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } - - /* Update the X server's visuals */ - *nvisualp = numNewVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - __glXFree(pVisual); - - /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) - xfree(visualPrivates); - visualPrivates = NULL; - - return TRUE; -} - -/* based on code in i830_dri.c - This ends calling glAquaSetVisualConfigs to set the static - numconfigs, etc. */ -static void -glAquaInitVisualConfigs(void) -{ - int lclNumConfigs = 0; - __GLXvisualConfig *lclVisualConfigs = NULL; - void **lclVisualPrivates = NULL; - - int depth, aux, buffers, stencil, accum; - int i = 0; - - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs "); - - /* count num configs: - 2 Z buffer (0, 24 bit) - 2 AUX buffer (0, 2) - 2 buffers (single, double) - 2 stencil (0, 8 bit) - 2 accum (0, 64 bit) - = 32 configs */ - - lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ - - /* alloc */ - lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs); - lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs); - - /* fill in configs */ - if (NULL != lclVisualConfigs) { - i = 0; /* current buffer */ - for (depth = 0; depth < 2; depth++) { - for (aux = 0; aux < 2; aux++) { - for (buffers = 0; buffers < 2; buffers++) { - for (stencil = 0; stencil < 2; stencil++) { - for (accum = 0; accum < 2; accum++) { - lclVisualConfigs[i].vid = -1; - lclVisualConfigs[i].class = -1; - lclVisualConfigs[i].rgba = TRUE; - lclVisualConfigs[i].redSize = -1; - lclVisualConfigs[i].greenSize = -1; - lclVisualConfigs[i].blueSize = -1; - lclVisualConfigs[i].redMask = -1; - lclVisualConfigs[i].greenMask = -1; - lclVisualConfigs[i].blueMask = -1; - lclVisualConfigs[i].alphaMask = 0; - if (accum) { - lclVisualConfigs[i].accumRedSize = 16; - lclVisualConfigs[i].accumGreenSize = 16; - lclVisualConfigs[i].accumBlueSize = 16; - lclVisualConfigs[i].accumAlphaSize = 16; - } - else { - lclVisualConfigs[i].accumRedSize = 0; - lclVisualConfigs[i].accumGreenSize = 0; - lclVisualConfigs[i].accumBlueSize = 0; - lclVisualConfigs[i].accumAlphaSize = 0; - } - lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; - lclVisualConfigs[i].stereo = FALSE; - lclVisualConfigs[i].bufferSize = -1; - - lclVisualConfigs[i].depthSize = depth? 24 : 0; - lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; - lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; - lclVisualConfigs[i].level = 0; - lclVisualConfigs[i].visualRating = GLX_NONE_EXT; - lclVisualConfigs[i].transparentPixel = 0; - lclVisualConfigs[i].transparentRed = 0; - lclVisualConfigs[i].transparentGreen = 0; - lclVisualConfigs[i].transparentBlue = 0; - lclVisualConfigs[i].transparentAlpha = 0; - lclVisualConfigs[i].transparentIndex = 0; - i++; - } - } - } - } - } - } - if (i != lclNumConfigs) - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs"); - - GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates); -} - - -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n"); - - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB) -{ - GLAQUA_DEBUG_MSG("glAquaInitVisuals\n"); - - if (numConfigs == 0) /* if no configs */ - glAquaInitVisualConfigs(); /* ensure the visual configs are setup */ - - /* - * Setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} - - -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - glAquaScreenRec *pScr = &glAquaScreens[screen]; - int j; - __GLcontextModes *modes; - - GLAQUA_DEBUG_MSG("fixup_visuals\n"); - - for ( modes = pScr->modes ; modes != NULL ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes) { - - /* Fixup the masks */ - modes->redMask = pVis[j].redMask; - modes->greenMask = pVis[j].greenMask; - modes->blueMask = pVis[j].blueMask; - - /* Recalc the sizes */ - modes->redBits = count_bits(modes->redMask); - modes->greenBits = count_bits(modes->greenMask); - modes->blueBits = count_bits(modes->blueMask); - } - } - } -} - -static void init_screen_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __GLcontextModes *modes; - int *used; - int i, j; - - GLAQUA_DEBUG_MSG("init_screen_visuals\n"); - - /* FIXME: Change 'used' to be a array of bits (rather than of ints), - * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less - * FIXME: than 64 or 128 the stack array can be used instead of calling - * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to - * FIXME: array of bytes instead of ints! - */ - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; - for ( modes = glAquaScreens[screen].modes - ; modes != NULL - ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes && - pVis[j].redMask == modes->redMask && - pVis[j].greenMask == modes->greenMask && - pVis[j].blueMask == modes->blueMask && - !used[j]) { - - /* Set the VisualID */ - modes->visualID = pVis[j].vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - if ( j == pScreen->numVisuals ) { - ErrorF("No matching visual for __GLcontextMode with " - "visual class = %d (%d), nplanes = %u\n", - vis_class, - (int)modes->visualType, - (unsigned int)(modes->rgbBits - modes->alphaBits) ); - } - else if ( modes->visualID == -1 ) { - FatalError( "Matching visual found, but visualID still -1!\n" ); - } - - i++; - } - - __glXFree(used); -} - -static Bool glAquaScreenProbe(int screen) -{ - ScreenPtr pScreen; - glAquaScreenRec *screenPriv; - - GLAQUA_DEBUG_MSG("glAquaScreenProbe\n"); - - /* - * Set up the current screen's visuals. - */ - __glDDXScreenInfo.modes = glAquaScreens[screen].modes; - __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv; - __glDDXScreenInfo.numVisuals = - __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis; - - /* - * Set the current screen's createContext routine. This could be - * wrapped by a DDX GLX context creation routine. - */ - __glDDXScreenInfo.createContext = glAquaCreateContext; - - /* - * The ordering of the rgb compenents might have been changed by the - * driver after mi initialized them. - */ - fixup_visuals(screen); - - /* - * Find the GLX visuals that are supported by this screen and create - * XMesa's visuals. - */ - init_screen_visuals(screen); - - /* - * Wrap RealizeWindow and UnrealizeWindow on this screen - */ - pScreen = screenInfo.screens[screen]; - screenPriv = &glAquaScreens[screen]; - screenPriv->RealizeWindow = pScreen->RealizeWindow; - pScreen->RealizeWindow = glAquaRealizeWindow; - screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow; - pScreen->UnrealizeWindow = glAquaUnrealizeWindow; - - return TRUE; -} - - -static GLboolean glAquaResizeBuffers(__GLdrawableBuffer *buffer, - GLint x, GLint y, - GLuint width, GLuint height, - __GLdrawablePrivate *glPriv, - GLuint bufferMask) -{ - GLAquaDrawableRec *aquaPriv = (GLAquaDrawableRec *)glPriv->private; - __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other; - __GLXcontext *gx; - __GLcontext *gc; - - GLAQUA_DEBUG_MSG("glAquaResizeBuffers to (%d %d %d %d)\n", x, y, width, height); - - // update all contexts that point at this drawable for drawing (hack?) - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->nextDrawPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - - // update all contexts that point at this drawable for reading (hack?) - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->nextReadPriv) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - - return aquaPriv->resize(buffer, x, y, width, height, glPriv, bufferMask); -} - - -static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv) -{ - // fixme AGL software renderer will use properties of current QD port (bad) - - // swap buffers on only *one* of the contexts - // (e.g. the last one for drawing) - __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc; - if (gc && gc->ctx) aglSwapBuffers(gc->ctx); - - return GL_TRUE; -} - -static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv) -{ - GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n"); - - free(glPriv->private); - glPriv->private = NULL; -} - -static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv) -{ - GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec)); - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - - GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n"); - - // replace swapBuffers (original is never called) - glxPriv->swapBuffers = glAquaSwapBuffers; - - // wrap front buffer resize - aquaPriv->resize = glPriv->frontBuffer.resize; - glPriv->frontBuffer.resize = glAquaResizeBuffers; - - // stash private data - glPriv->private = aquaPriv; - glPriv->freePrivate = glAquaDestroyDrawablePrivate; -} - - -static void glAquaResetExtension(void) -{ - GLAQUA_DEBUG_MSG("glAquaResetExtension\n"); - aglResetLibrary(); -} - - - -// Extra goodies for glx - -GLuint __glFloorLog2(GLuint val) -{ - int c = 0; - - while (val > 1) { - c++; - val >>= 1; - } - return c; -} diff --git a/nx-X11/programs/Xserver/GL/apple/indirect.c b/nx-X11/programs/Xserver/GL/apple/indirect.c deleted file mode 100644 index 448b1f76a..000000000 --- a/nx-X11/programs/Xserver/GL/apple/indirect.c +++ /dev/null @@ -1,1380 +0,0 @@ -/* - * GLX implementation that uses Apple's OpenGL.framework - * (Indirect rendering path) - */ -/* - * Copyright (c) 2002 Greg Parker. All Rights Reserved. - * Copyright (c) 2002 Apple Computer, Inc. - * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. - * - * Portions of this file are copied from Mesa's xf86glx.c, - * which contains the following copyright: - * - * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. - * 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 ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ -/* $XFree86: xc/programs/Xserver/GL/apple/indirect.c,v 1.2 2003/09/16 00:36:11 torrey Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "dri.h" -#include "quartz.h" - -#include -#include -#include - -// X11 and X11's glx -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "x-hash.h" -#include "x-list.h" - -#include "glcontextmodes.h" - -// ggs: needed to call back to glx with visual configs -extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs); - - -// Write debugging output, or not -#ifdef GLAQUA_DEBUG -#define GLAQUA_DEBUG_MSG ErrorF -#else -#define GLAQUA_DEBUG_MSG(a, ...) -#endif - - -// The following GL functions don't have an EXT suffix in OpenGL.framework. -GLboolean glAreTexturesResidentEXT(GLsizei a, const GLuint *b, GLboolean *c) { - return glAreTexturesResident(a, b, c); -} -void glDeleteTexturesEXT(GLsizei d, const GLuint *e) { - glDeleteTextures(d, e); -} -void glGenTexturesEXT(GLsizei f, GLuint *g) { - glGenTextures(f, g); -} -GLboolean glIsTextureEXT(GLuint h) { - return glIsTexture(h); -} - -// some prototypes -static Bool glAquaScreenProbe(int screen); -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB); -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates); -static __GLinterface *glAquaCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC); -static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv); -static void glAquaResetExtension(void); - -/* - * This structure is statically allocated in the __glXScreens[] - * structure. This struct is not used anywhere other than in - * __glXScreenInit to initialize each of the active screens - * (__glXActiveScreens[]). Several of the fields must be initialized by - * the screenProbe routine before they are copied to the active screens - * struct. In particular, the contextCreate, modes, numVisuals, - * and numUsableVisuals fields must be initialized. - */ -static __GLXscreenInfo __glDDXScreenInfo = { - glAquaScreenProbe, /* Must be generic and handle all screens */ - glAquaCreateContext, /* Substitute screen's createContext routine */ - glAquaCreateBuffer, /* Substitute screen's createBuffer routine */ - NULL, /* Set up modes in probe */ - NULL, /* Set up pVisualPriv in probe */ - 0, /* Set up numVisuals in probe */ - 0, /* Set up numUsableVisuals in probe */ - "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ - "Version String", /* GLXversion is overwritten by __glXScreenInit */ - "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ - NULL /* WrappedPositionWindow is overwritten */ -}; - -void *__glXglDDXScreenInfo(void) { - return &__glDDXScreenInfo; -} - -static __GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_APPLE, - glAquaResetExtension, - glAquaInitVisuals, - glAquaSetVisualConfigs -}; - -void *__glXglDDXExtensionInfo(void) { - return &__glDDXExtensionInfo; -} - -// prototypes - -static GLboolean glAquaDestroyContext(__GLcontext *gc); -static GLboolean glAquaLoseCurrent(__GLcontext *gc); -static GLboolean glAquaMakeCurrent(__GLcontext *gc); -static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare); -static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask); -static GLboolean glAquaForceCurrent(__GLcontext *gc); - -/* Drawing surface notification callbacks */ -static GLboolean glAquaNotifyResize(__GLcontext *gc); -static void glAquaNotifyDestroy(__GLcontext *gc); -static void glAquaNotifySwapBuffers(__GLcontext *gc); - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc); -static void glAquaBeginDispatchOverride(__GLcontext *gc); -static void glAquaEndDispatchOverride(__GLcontext *gc); - -static __GLexports glAquaExports = { - glAquaDestroyContext, - glAquaLoseCurrent, - glAquaMakeCurrent, - glAquaShareContext, - glAquaCopyContext, - glAquaForceCurrent, - - glAquaNotifyResize, - glAquaNotifyDestroy, - glAquaNotifySwapBuffers, - - glAquaDispatchExec, - glAquaBeginDispatchOverride, - glAquaEndDispatchOverride -}; - -typedef struct { - int num_vis; - __GLcontextModes *modes; - void **priv; - - // wrapped screen functions - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; -} glAquaScreenRec; - -static glAquaScreenRec glAquaScreens[MAXSCREENS]; - -// __GLdrawablePrivate->private -typedef struct { - DrawablePtr pDraw; - xp_surface_id sid; -} GLAquaDrawableRec; - -struct __GLcontextRec { - struct __GLinterfaceRec interface; // required to be first - - CGLContextObj ctx; - CGLPixelFormatObj pixelFormat; - - /* set when attached */ - xp_surface_id sid; - - unsigned isAttached :1; -}; - -/* maps from surface id -> list of __GLcontext */ -static x_hash_table *surface_hash; - - -// Context manipulation; return GL_FALSE on failure -static GLboolean glAquaDestroyContext(__GLcontext *gc) -{ - x_list *lst; - - GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n", - (unsigned int) gc->ctx); - - if (gc != NULL) - { - if (gc->sid != 0 && surface_hash != NULL) - { - lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL); - lst = x_list_remove(lst, gc); - x_hash_table_insert(surface_hash, (void *) gc->sid, lst); - } - - if (gc->ctx != NULL) - CGLDestroyContext(gc->ctx); - - if (gc->pixelFormat != NULL) - CGLDestroyPixelFormat(gc->pixelFormat); - - free(gc); - } - - return GL_TRUE; -} - -static GLboolean glAquaLoseCurrent(__GLcontext *gc) -{ - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx); - - gl_err = CGLSetCurrentContext(NULL); - if (gl_err != 0) - ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); - - __glXLastContext = NULL; // Mesa does this; why? - - return GL_TRUE; -} - -/* Called when a surface is destroyed as a side effect of destroying - the window it's attached to. */ -static void surface_notify(void *_arg, void *data) -{ - DRISurfaceNotifyArg *arg = _arg; - GLAquaDrawableRec *aquaPriv = data; - __GLcontext *gc; - x_list *lst; - - switch (arg->kind) - { - case AppleDRISurfaceNotifyDestroyed: - if (surface_hash != NULL) - x_hash_table_remove(surface_hash, (void *) arg->id); - - aquaPriv->pDraw = NULL; - aquaPriv->sid = 0; - break; - - case AppleDRISurfaceNotifyChanged: - if (surface_hash != NULL) - { - lst = x_hash_table_lookup(surface_hash, (void *) arg->id, NULL); - for (; lst != NULL; lst = lst->next) - { - gc = lst->data; - xp_update_gl_context(gc->ctx); - } - } - break; - } -} - -static void unattach(__GLcontext *gc) -{ - x_list *lst; - - if (gc->isAttached) - { - GLAQUA_DEBUG_MSG("unattaching\n"); - - if (surface_hash != NULL) - { - lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL); - lst = x_list_remove(lst, gc); - x_hash_table_insert(surface_hash, (void *) gc->sid, lst); - } - - CGLClearDrawable(gc->ctx); - gc->isAttached = FALSE; - gc->sid = 0; - } -} - -static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv) -{ - __GLXdrawablePrivate *glxPriv; - GLAquaDrawableRec *aquaPriv; - DrawablePtr pDraw; - - glxPriv = (__GLXdrawablePrivate *)glPriv->other; - aquaPriv = (GLAquaDrawableRec *)glPriv->private; - pDraw = glxPriv->pDraw; - - if (aquaPriv->sid == 0) - { - if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw, - 0, &aquaPriv->sid, NULL, - surface_notify, aquaPriv)) - { - return; - } - aquaPriv->pDraw = pDraw; - } - - if (!gc->isAttached || gc->sid != aquaPriv->sid) - { - x_list *lst; - - if (xp_attach_gl_context(gc->ctx, aquaPriv->sid) != Success) - { - quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw, - surface_notify, aquaPriv); - if (surface_hash != NULL) - x_hash_table_remove(surface_hash, (void *) aquaPriv->sid); - - aquaPriv->sid = 0; - return; - } - - gc->isAttached = TRUE; - gc->sid = aquaPriv->sid; - - if (surface_hash == NULL) - surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL); - - lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL); - if (x_list_find(lst, gc) == NULL) - { - lst = x_list_prepend(lst, gc); - x_hash_table_insert(surface_hash, (void *) gc->sid, lst); - } - - GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int) pDraw->id, - (unsigned int) aquaPriv->sid); - } -} - -static GLboolean glAquaMakeCurrent(__GLcontext *gc) -{ - __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc); - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx); - - attach(gc, glPriv); - - gl_err = CGLSetCurrentContext(gc->ctx); - if (gl_err != 0) - ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); - - return gl_err == 0; -} - -static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare) -{ - GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n"); - - return GL_TRUE; -} - -static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask) -{ - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaCopyContext\n"); - - gl_err = CGLCopyContext(src->ctx, dst->ctx, mask); - if (gl_err != 0) - ErrorF("CGLCopyContext error: %s\n", CGLErrorString(gl_err)); - - return gl_err == 0; -} - -static GLboolean glAquaForceCurrent(__GLcontext *gc) -{ - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n", - (unsigned int) gc->ctx); - - gl_err = CGLSetCurrentContext(gc->ctx); - if (gl_err != 0) - ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); - - return gl_err == 0; -} - -/* Drawing surface notification callbacks */ - -static GLboolean glAquaNotifyResize(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize"); - return GL_TRUE; -} - -static void glAquaNotifyDestroy(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy"); -} - -static void glAquaNotifySwapBuffers(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers"); -} - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec"); - return NULL; -} - -static void glAquaBeginDispatchOverride(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride"); -} - -static void glAquaEndDispatchOverride(__GLcontext *gc) -{ - GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride"); -} - -static CGLPixelFormatObj makeFormat(__GLcontextModes *mode) -{ - int i; - CGLPixelFormatAttribute attr[64]; // currently uses max of 30 - CGLPixelFormatObj result; - long n_formats; - CGLError gl_err; - - GLAQUA_DEBUG_MSG("makeFormat\n"); - - if (!mode->rgbMode) - return NULL; - - i = 0; - - // attr [i++] = kCGLPFAAcelerated; // require hwaccel - BAD for multiscreen - // attr [i++] = kCGLPFANoRecovery; // disable fallback renderers - BAD - - if (mode->stereoMode) { - attr[i++] = kCGLPFAStereo; - } - if (mode->doubleBufferMode) { - attr[i++] = kCGLPFADoubleBuffer; - } - - if (mode->colorIndexMode) { - /* ignored */ - } - - if (mode->rgbMode) { - attr[i++] = kCGLPFAColorSize; - attr[i++] = mode->redBits + mode->greenBits + mode->blueBits; - attr[i++] = kCGLPFAAlphaSize; - attr[i++] = 1; /* FIXME: ignoring mode->alphaBits which is always 0 */ - } - - if (mode->haveAccumBuffer) { - attr[i++] = kCGLPFAAccumSize; - attr[i++] = mode->accumRedBits + mode->accumGreenBits - + mode->accumBlueBits + mode->accumAlphaBits; - } - if (mode->haveDepthBuffer) { - attr[i++] = kCGLPFADepthSize; - attr[i++] = mode->depthBits; - } - if (mode->haveStencilBuffer) { - attr[i++] = kCGLPFAStencilSize; - attr[i++] = mode->stencilBits; - } - - attr[i++] = kCGLPFAAuxBuffers; - attr[i++] = mode->numAuxBuffers; - - /* mode->level ignored */ - - /* mode->pixmapMode ? */ - - attr[i++] = 0; - - GLAQUA_DEBUG_MSG("makeFormat almost done\n"); - - result = NULL; - gl_err = CGLChoosePixelFormat(attr, &result, &n_formats); - if (gl_err != 0) - ErrorF("CGLChoosePixelFormat error: %s\n", CGLErrorString(gl_err)); - - GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", (unsigned int) result); - - return result; -} - -static __GLinterface *glAquaCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC) -{ - __GLcontext *result; - __GLcontext *sharectx = (__GLcontext *)shareGC; - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaCreateContext\n"); - - result = (__GLcontext *)calloc(1, sizeof(__GLcontext)); - if (!result) return NULL; - - result->interface.imports = *imports; - result->interface.exports = glAquaExports; - - result->pixelFormat = makeFormat(mode); - if (!result->pixelFormat) { - free(result); - return NULL; - } - - result->ctx = NULL; - gl_err = CGLCreateContext(result->pixelFormat, - sharectx ? sharectx->ctx : NULL, - &result->ctx); - - if (gl_err != 0) { - ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err)); - CGLDestroyPixelFormat(result->pixelFormat); - free(result); - return NULL; - } - - GLAQUA_DEBUG_MSG("glAquaCreateContext done\n"); - return (__GLinterface *)result; -} - -Bool -glAquaRealizeWindow(WindowPtr pWin) -{ - // If this window has GL contexts, tell them to reattach - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n"); - - // Allow the window to be created (RootlessRealizeWindow is inside our wrap) - pScreen->RealizeWindow = screenPriv->RealizeWindow; - result = pScreen->RealizeWindow(pWin); - pScreen->RealizeWindow = glAquaRealizeWindow; - - // The Aqua window will already have been created (windows are - // realized from top down) - - // Re-attach this window's GL contexts, if any. - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n"); - - // GL contexts bound to this window for drawing - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - - // GL contexts bound to this window for reading - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - attach(gc, glPriv); - } - } - - return result; -} - -Bool -glAquaUnrealizeWindow(WindowPtr pWin) -{ - // If this window has GL contexts, tell them to unattach - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n"); - - // The Aqua window may have already been destroyed (windows - // are unrealized from top down) - - // Unattach this window's GL contexts, if any. - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n"); - - // GL contexts bound to this window for drawing - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - unattach(gc); - } - - // GL contexts bound to this window for reading - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - unattach(gc); - } - } - - pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow; - result = pScreen->UnrealizeWindow(pWin); - pScreen->UnrealizeWindow = glAquaUnrealizeWindow; - - return result; -} - - -// Originally copied from Mesa - -static int numConfigs = 0; -static __GLXvisualConfig *visualConfigs = NULL; -static void **visualPrivates = NULL; - -/* - * In the case the driver defines no GLX visuals we'll use these. - * Note that for TrueColor and DirectColor visuals, bufferSize is the - * sum of redSize, greenSize, blueSize and alphaSize, which may be larger - * than the nplanes/rootDepth of the server's X11 visuals - */ -#define NUM_FALLBACK_CONFIGS 5 -static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = { - /* [0] = RGB, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [1] = RGB, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 16, 16, 16, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [4] = CI, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - False, /* rgba? (false = color index) */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, -}; - -static __GLXvisualConfig NullConfig = { - -1, /* vid */ - -1, /* class */ - False, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ -}; - - -static inline int count_bits(uint32_t x) -{ - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x = x + (x >> 8); - x = x + (x >> 16); - return x & 63; -} - - -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numRGBconfigs; - int numCIconfigs; - int numVisuals = *nvisualp; - int numNewVisuals; - int numNewConfigs; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLcontextModes *modes; - __GLXvisualConfig *pNewVisualConfigs = NULL; - void **glXVisualPriv; - void **pNewVisualPriv; - int found_default; - int i, j, k; - - GLAQUA_DEBUG_MSG("init_visuals\n"); - - if (numConfigs > 0) - numNewConfigs = numConfigs; - else - numNewConfigs = NUM_FALLBACK_CONFIGS; - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* - ** If SetVisualConfigs was not called, then use default GLX - ** visual configs. - */ - if (numConfigs == 0) { - memcpy(pNewVisualConfigs, FallbackConfigs, - NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig)); - memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *)); - } - else { - /* copy driver's visual config info */ - for (i = 0; i < numConfigs; i++) { - pNewVisualConfigs[i] = visualConfigs[i]; - pNewVisualPriv[i] = visualPrivates[i]; - } - } - - /* Count the number of RGB and CI visual configs */ - numRGBconfigs = 0; - numCIconfigs = 0; - for (i = 0; i < numNewConfigs; i++) { - if (pNewVisualConfigs[i].rgba) - numRGBconfigs++; - else - numCIconfigs++; - } - - /* Count the total number of visuals to compute */ - numNewVisuals = 0; - for (i = 0; i < numVisuals; i++) { - int count; - - count = ((pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor) - ? numRGBconfigs : numCIconfigs); - if (count == 0) - count = 1; /* preserve the existing visual */ - - numNewVisuals += count; - } - - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - __glXFree(glXVisualPriv); - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Initialize the new visuals */ - found_default = FALSE; - glAquaScreens[screenInfo.numScreens-1].modes = modes; - for (i = j = 0; i < numVisuals; i++) { - int is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - if (!is_rgb) - { - /* We don't support non-rgb visuals for GL. But we don't - want to remove them either, so just pass them through - with null glX configs */ - - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & NullConfig ); - modes->visualID = pVisualNew[j].vid; - - j++; - - continue; - } - - for (k = 0; k < numNewConfigs; k++) { - if (pNewVisualConfigs[k].rgba != is_rgb) - continue; - - assert( modes != NULL ); - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] ); - modes->visualID = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (modes->visualType == GLX_NONE) { - modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class ); - modes->redBits = count_bits(pVisual[i].redMask); - modes->greenBits = count_bits(pVisual[i].greenMask); - modes->blueBits = count_bits(pVisual[i].blueMask); - modes->alphaBits = modes->alphaBits; - modes->redMask = pVisual[i].redMask; - modes->greenMask = pVisual[i].greenMask; - modes->blueMask = pVisual[i].blueMask; - modes->alphaMask = modes->alphaMask; - modes->rgbBits = (is_rgb) - ? (modes->redBits + modes->greenBits + - modes->blueBits + modes->alphaBits) - : rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pNewVisualPriv[k]; - - j++; - modes = modes->next; - } - } - - assert(j <= numNewVisuals); - - /* Save the GLX visuals in the screen structure */ - glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; - glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } - - /* Update the X server's visuals */ - *nvisualp = numNewVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - __glXFree(pVisual); - - /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) - xfree(visualPrivates); - visualPrivates = NULL; - - return TRUE; -} - -/* based on code in i830_dri.c - This ends calling glAquaSetVisualConfigs to set the static - numconfigs, etc. */ -static void -glAquaInitVisualConfigs(void) -{ - int lclNumConfigs = 0; - __GLXvisualConfig *lclVisualConfigs = NULL; - void **lclVisualPrivates = NULL; - - int depth, aux, buffers, stencil, accum; - int i = 0; - - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs "); - - /* count num configs: - 2 Z buffer (0, 24 bit) - 2 AUX buffer (0, 2) - 2 buffers (single, double) - 2 stencil (0, 8 bit) - 2 accum (0, 64 bit) - = 32 configs */ - - lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ - - /* alloc */ - lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs); - lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs); - - /* fill in configs */ - if (NULL != lclVisualConfigs) { - i = 0; /* current buffer */ - for (depth = 0; depth < 2; depth++) { - for (aux = 0; aux < 2; aux++) { - for (buffers = 0; buffers < 2; buffers++) { - for (stencil = 0; stencil < 2; stencil++) { - for (accum = 0; accum < 2; accum++) { - lclVisualConfigs[i].vid = -1; - lclVisualConfigs[i].class = -1; - lclVisualConfigs[i].rgba = TRUE; - lclVisualConfigs[i].redSize = -1; - lclVisualConfigs[i].greenSize = -1; - lclVisualConfigs[i].blueSize = -1; - lclVisualConfigs[i].redMask = -1; - lclVisualConfigs[i].greenMask = -1; - lclVisualConfigs[i].blueMask = -1; - lclVisualConfigs[i].alphaMask = 0; - if (accum) { - lclVisualConfigs[i].accumRedSize = 16; - lclVisualConfigs[i].accumGreenSize = 16; - lclVisualConfigs[i].accumBlueSize = 16; - lclVisualConfigs[i].accumAlphaSize = 16; - } - else { - lclVisualConfigs[i].accumRedSize = 0; - lclVisualConfigs[i].accumGreenSize = 0; - lclVisualConfigs[i].accumBlueSize = 0; - lclVisualConfigs[i].accumAlphaSize = 0; - } - lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; - lclVisualConfigs[i].stereo = FALSE; - lclVisualConfigs[i].bufferSize = -1; - - lclVisualConfigs[i].depthSize = depth? 24 : 0; - lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; - lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; - lclVisualConfigs[i].level = 0; - lclVisualConfigs[i].visualRating = GLX_NONE_EXT; - lclVisualConfigs[i].transparentPixel = 0; - lclVisualConfigs[i].transparentRed = 0; - lclVisualConfigs[i].transparentGreen = 0; - lclVisualConfigs[i].transparentBlue = 0; - lclVisualConfigs[i].transparentAlpha = 0; - lclVisualConfigs[i].transparentIndex = 0; - i++; - } - } - } - } - } - } - if (i != lclNumConfigs) - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs"); - - GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates); -} - - -static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n"); - - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB) -{ - GLAQUA_DEBUG_MSG("glAquaInitVisuals\n"); - - if (numConfigs == 0) /* if no configs */ - glAquaInitVisualConfigs(); /* ensure the visual configs are setup */ - - /* - * Setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} - - -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - glAquaScreenRec *pScr = &glAquaScreens[screen]; - int j; - __GLcontextModes *modes; - - GLAQUA_DEBUG_MSG("fixup_visuals\n"); - - for ( modes = pScr->modes ; modes != NULL ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes) { - - /* Fixup the masks */ - modes->redMask = pVis[j].redMask; - modes->greenMask = pVis[j].greenMask; - modes->blueMask = pVis[j].blueMask; - - /* Recalc the sizes */ - modes->redBits = count_bits(modes->redMask); - modes->greenBits = count_bits(modes->greenMask); - modes->blueBits = count_bits(modes->blueMask); - } - } - } -} - -static void init_screen_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __GLcontextModes *modes; - int *used; - int i, j; - - GLAQUA_DEBUG_MSG("init_screen_visuals\n"); - - /* FIXME: Change 'used' to be a array of bits (rather than of ints), - * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less - * FIXME: than 64 or 128 the stack array can be used instead of calling - * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to - * FIXME: array of bytes instead of ints! - */ - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; - for ( modes = glAquaScreens[screen].modes - ; modes != NULL - ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes && - pVis[j].redMask == modes->redMask && - pVis[j].greenMask == modes->greenMask && - pVis[j].blueMask == modes->blueMask && - !used[j]) { - - /* Set the VisualID */ - modes->visualID = pVis[j].vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - if ( j == pScreen->numVisuals ) { - ErrorF("No matching visual for __GLcontextMode with " - "visual class = %d (%d), nplanes = %u\n", - vis_class, - (int)modes->visualType, - (unsigned int)(modes->rgbBits - modes->alphaBits) ); - } - else if ( modes->visualID == -1 ) { - FatalError( "Matching visual found, but visualID still -1!\n" ); - } - - i++; - } - - __glXFree(used); -} - -static Bool glAquaScreenProbe(int screen) -{ - ScreenPtr pScreen; - glAquaScreenRec *screenPriv; - - GLAQUA_DEBUG_MSG("glAquaScreenProbe\n"); - - /* - * Set up the current screen's visuals. - */ - __glDDXScreenInfo.modes = glAquaScreens[screen].modes; - __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv; - __glDDXScreenInfo.numVisuals = - __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis; - - /* - * Set the current screen's createContext routine. This could be - * wrapped by a DDX GLX context creation routine. - */ - __glDDXScreenInfo.createContext = glAquaCreateContext; - - /* - * The ordering of the rgb compenents might have been changed by the - * driver after mi initialized them. - */ - fixup_visuals(screen); - - /* - * Find the GLX visuals that are supported by this screen and create - * XMesa's visuals. - */ - init_screen_visuals(screen); - - /* - * Wrap RealizeWindow and UnrealizeWindow on this screen - */ - pScreen = screenInfo.screens[screen]; - screenPriv = &glAquaScreens[screen]; - screenPriv->RealizeWindow = pScreen->RealizeWindow; - pScreen->RealizeWindow = glAquaRealizeWindow; - screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow; - pScreen->UnrealizeWindow = glAquaUnrealizeWindow; - - return TRUE; -} - -static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv) -{ - // swap buffers on only *one* of the contexts - // (e.g. the last one for drawing) - __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc; - CGLError gl_err; - - GLAQUA_DEBUG_MSG("glAquaSwapBuffers\n"); - - if (gc != NULL && gc->ctx != NULL) - { - gl_err = CGLFlushDrawable(gc->ctx); - if (gl_err != 0) - ErrorF("CGLFlushDrawable error: %s\n", CGLErrorString(gl_err)); - } - - return GL_TRUE; -} - -static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv) -{ - GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n"); - - /* It doesn't work to call DRIDestroySurface here, the drawable's - already gone.. But dri.c notices the window destruction and - frees the surface itself. */ - - free(glPriv->private); - glPriv->private = NULL; -} - -static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv) -{ - GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec)); - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - - aquaPriv->sid = 0; - aquaPriv->pDraw = NULL; - - GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n"); - - // replace swapBuffers (original is never called) - glxPriv->swapBuffers = glAquaSwapBuffers; - - // stash private data - glPriv->private = aquaPriv; - glPriv->freePrivate = glAquaDestroyDrawablePrivate; -} - -static void glAquaResetExtension(void) -{ - GLAQUA_DEBUG_MSG("glAquaResetExtension\n"); - CGLSetOption(kCGLGOResetLibrary, GL_TRUE); -} - -// Extra goodies for glx - -GLuint __glFloorLog2(GLuint val) -{ - int c = 0; - - while (val > 1) { - c++; - val >>= 1; - } - return c; -} diff --git a/nx-X11/programs/Xserver/GL/dri/Imakefile b/nx-X11/programs/Xserver/GL/dri/Imakefile deleted file mode 100644 index 8ea938f8c..000000000 --- a/nx-X11/programs/Xserver/GL/dri/Imakefile +++ /dev/null @@ -1,35 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.6 2001/04/28 13:55:36 dawes Exp $ - -#define IHaveModules -#include - -#if DoLoadableServer -MSRC = drimodule.c -MOBJ = drimodule.o -#endif - - SRCS = xf86dri.c dri.c $(MSRC) - OBJS = xf86dri.o dri.o $(MOBJ) - - INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) -I$(MESASRCDIR)/include \ - -I$(XF86OSSRC) -I$(XF86COMSRC) \ - -I../include -I../glx -I$(LIBSRC)/GL/include \ - -I$(DRMSRCDIR)/shared-core \ - -I$(SERVERSRC)/mi -I$(FONTINCSRC) - DEFINES = $(GLX_DEFINES) - -LinkSourceFile(xf86dri.h,$(MESASRCDIR)/src/glx/x11) -LinkSourceFile(xf86dristr.h,$(MESASRCDIR)/src/glx/x11) - -ModuleObjectRule() -LibraryModuleTarget(dri,$(OBJS)) -InstallLibraryModule(dri,$(MODULEDIR),extensions) - -DependTarget() - -InstallDriverSDKLibraryModule(dri,$(DRIVERSDKMODULEDIR),extensions) - -InstallDriverSDKNonExecFile(dri.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(sarea.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xf86dri.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference b/nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference deleted file mode 100644 index 59fb0af84..000000000 --- a/nx-X11/programs/Xserver/GL/dri/Imakefile.NX.reference +++ /dev/null @@ -1,35 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.7 2003/02/11 21:34:04 tsi Exp $ - -#define IHaveModules -#include - -#if DoLoadableServer -MSRC = drimodule.c -MOBJ = drimodule.o -#endif - - SRCS = xf86dri.c dri.c $(MSRC) - OBJS = xf86dri.o dri.o $(MOBJ) - - INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) \ - -I$(XF86OSSRC) -I$(XF86COMSRC) \ - -I../include -I../glx -I$(LIBSRC)/GL/include \ - -I$(SERVERSRC)/mi -I$(FONTINCSRC) \ - -I../../hw/xfree86/os-support/bus - DEFINES = $(GLX_DEFINES) - -LinkSourceFile(xf86dri.h,$(LIBSRC)/GL/dri) -LinkSourceFile(xf86dristr.h,$(LIBSRC)/GL/dri) - -ModuleObjectRule() -LibraryModuleTarget(dri,$(OBJS)) -InstallLibraryModule(dri,$(MODULEDIR),extensions) - -DependTarget() - -InstallDriverSDKLibraryModule(dri,$(DRIVERSDKMODULEDIR),extensions) - -InstallDriverSDKNonExecFile(dri.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(sarea.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xf86dri.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference b/nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference deleted file mode 100644 index c8770f6d8..000000000 --- a/nx-X11/programs/Xserver/GL/dri/Imakefile.XF86.reference +++ /dev/null @@ -1,34 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.7 2003/02/11 21:34:04 tsi Exp $ - -#define IHaveModules -#include - -#if DoLoadableServer -MSRC = drimodule.c -MOBJ = drimodule.o -#endif - - SRCS = xf86dri.c dri.c $(MSRC) - OBJS = xf86dri.o dri.o $(MOBJ) - - INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) \ - -I$(XF86OSSRC) -I$(XF86COMSRC) \ - -I../include -I../glx -I$(LIBSRC)/GL/include \ - -I$(SERVERSRC)/mi -I$(FONTINCSRC) - DEFINES = $(GLX_DEFINES) - -LinkSourceFile(xf86dri.h,$(LIBSRC)/GL/dri) -LinkSourceFile(xf86dristr.h,$(LIBSRC)/GL/dri) - -ModuleObjectRule() -LibraryModuleTarget(dri,$(OBJS)) -InstallLibraryModule(dri,$(MODULEDIR),extensions) - -DependTarget() - -InstallDriverSDKLibraryModule(dri,$(DRIVERSDKMODULEDIR),extensions) - -InstallDriverSDKNonExecFile(dri.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(sarea.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xf86dri.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/GL/dri/dri-def.cpp b/nx-X11/programs/Xserver/GL/dri/dri-def.cpp deleted file mode 100644 index 0d1ab6872..000000000 --- a/nx-X11/programs/Xserver/GL/dri/dri-def.cpp +++ /dev/null @@ -1,50 +0,0 @@ -LIBRARY DRI -VERSION LIBRARY_VERSION -EXPORTS - -XFree86DRIExtensionInit -DRIAuthConnection -DRIBlockHandler -DRIClipNotify -DRICloseConnection -DRICloseScreen -DRIContextPrivDelete -DRICopyWindow -DRICreateContext -DRICreateContextPriv -DRICreateContextPrivFromHandle -DRICreateDrawable -DRICreateInfoRec -DRIDestroyContext -DRIDestroyContextPriv -DRIDestroyDrawable -DRIDestroyInfoRec -DRIDoBlockHandler -DRIDoWakeupHandler -DRIDrawablePrivDelete -DRIExtensionInit -DRIFinishScreenInit -DRIGetClientDriverName -DRIGetContext -DRIGetContextStore -DRIGetDeviceInfo -DRIGetDrawableIndex -DRIGetDrawableInfo -DRIGetDrawableStamp -DRIGetSAREAPrivate -DRIGetWrappedFuncs -DRILock -DRIOpenConnection -DRIPaintWindow -DRIPostValidateTree -DRIPrintDrawableLock -DRIQueryDirectRenderingCapable -DRIQueryVersion -DRIReset -DRIScreenInit -DRISwapContext -DRIUnlock -DRIValidateTree -DRIWakeupHandler - -/* $XFree86$ */ diff --git a/nx-X11/programs/Xserver/GL/dri/dri.c b/nx-X11/programs/Xserver/GL/dri/dri.c deleted file mode 100644 index 424a21c68..000000000 --- a/nx-X11/programs/Xserver/GL/dri/dri.c +++ /dev/null @@ -1,2109 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.39 2003/11/10 18:21:41 tsi Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Jens Owen - * Rickard E. (Rik) Faith - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#else -#include -#include -#endif - -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "servermd.h" -#define _XF86DRI_SERVER_ -#include "xf86dristr.h" -#include "swaprep.h" -#include "xf86str.h" -#include "dri.h" -#include "sarea.h" -#include "dristruct.h" -#include "xf86.h" -#include "xf86drm.h" -#include "glxserver.h" -#include "mi.h" -#include "mipointer.h" - -#if defined(XFree86LOADER) && !defined(PANORAMIX) -extern Bool noPanoramiXExtension; -#endif - -static int DRIScreenPrivIndex = -1; -static int DRIWindowPrivIndex = -1; -static unsigned long DRIGeneration = 0; -static unsigned int DRIDrawableValidationStamp = 0; - -static RESTYPE DRIDrawablePrivResType; -static RESTYPE DRIContextPrivResType; -static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv); - - /* Wrapper just like xf86DrvMsg, but - without the verbosity level checking. - This will make it easy to turn off some - messages later, based on verbosity - level. */ - -/* - * Since we're already referencing things from the XFree86 common layer in - * this file, we'd might as well just call xf86VDrvMsgVerb, and have - * consistent message formatting. The verbosity of these messages can be - * easily changed here. - */ -#define DRI_MSG_VERBOSITY 1 -static void -DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - xf86VDrvMsgVerb(scrnIndex, type, DRI_MSG_VERBOSITY, format, ap); - va_end(ap); -} - -Bool -DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) -{ - DRIScreenPrivPtr pDRIPriv; - drm_context_t * reserved; - int reserved_count; - int i, fd, drmWasAvailable; - Bool xineramaInCore = FALSE; - int err = 0; - char *openbusid; - drmVersionPtr drmlibv; - int drmlibmajor, drmlibminor, drmdimajor, drmdiminor; - - if (DRIGeneration != serverGeneration) { - if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - DRIGeneration = serverGeneration; - } - - /* If the DRI extension is disabled, do not initialize the DRI */ - if (noXFree86DRIExtension) { - DRIDrvMsg(pScreen->myNum, X_WARNING, - "Direct rendering has been disabled.\n"); - return FALSE; - } - - /* - * If Xinerama is on, don't allow DRI to initialise. It won't be usable - * anyway. - */ -#if defined(PANORAMIX) && !defined(XFree86LOADER) - xineramaInCore = TRUE; -#elif defined(XFree86LOADER) - if (xf86LoaderCheckSymbol("noPanoramiXExtension")) - xineramaInCore = TRUE; -#endif - -#if defined(PANORAMIX) || defined(XFree86LOADER) - if (xineramaInCore) { - if (!noPanoramiXExtension) { - DRIDrvMsg(pScreen->myNum, X_WARNING, - "Direct rendering is not supported when Xinerama is enabled\n"); - return FALSE; - } - } -#endif - - drmWasAvailable = drmAvailable(); - - /* Check the DRM lib version. - * drmGetLibVersion was not supported in version 1.0, so check for - * symbol first to avoid possible crash or hang. - */ - drmlibmajor = 1; - drmlibminor = 0; - if (xf86LoaderCheckSymbol("drmGetLibVersion")) { - drmlibv = drmGetLibVersion(-1); - if (drmlibv != NULL) { - drmlibmajor = drmlibv->version_major; - drmlibminor = drmlibv->version_minor; - drmFreeVersion(drmlibv); - } - } - - /* Check if the libdrm can handle falling back to loading based on name - * if a busid string is passed. - */ - if (drmlibmajor == 1 && drmlibminor >= 2) - openbusid = pDRIInfo->busIdString; - else - openbusid = NULL; - - /* Note that drmOpen will try to load the kernel module, if needed. */ - fd = drmOpen(pDRIInfo->drmDriverName, openbusid); - if (fd < 0) { - /* failed to open DRM */ - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmOpen failed\n"); - return FALSE; - } - - if (!drmWasAvailable) { - /* drmOpen loaded the kernel module, print a message to say so */ - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] loaded kernel module for \"%s\" driver\n", - pDRIInfo->drmDriverName); - } - - pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec)); - if (!pDRIPriv) { - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - return FALSE; - } - - pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv; - pDRIPriv->drmFD = fd; - pDRIPriv->directRenderingSupport = TRUE; - pDRIPriv->pDriverInfo = pDRIInfo; - pDRIPriv->nrWindows = 0; - pDRIPriv->fullscreen = NULL; - - pDRIPriv->createDummyCtx = pDRIInfo->createDummyCtx; - pDRIPriv->createDummyCtxPriv = pDRIInfo->createDummyCtxPriv; - - pDRIPriv->grabbedDRILock = FALSE; - pDRIPriv->drmSIGIOHandlerInstalled = FALSE; - - if (drmlibmajor == 1 && drmlibminor >= 2) { - drmSetVersion sv; - - /* Get the interface version, asking for 1.1. */ - sv.drm_di_major = 1; - sv.drm_di_minor = 1; - sv.drm_dd_major = -1; - err = drmSetInterfaceVersion(pDRIPriv->drmFD, &sv); - if (err == 0) { - drmdimajor = sv.drm_di_major; - drmdiminor = sv.drm_di_minor; - } else { - /* failure, so set it to 1.0.0. */ - drmdimajor = 1; - drmdiminor = 0; - } - } - else { - /* We can't check the DI DRM interface version, so set it to 1.0.0. */ - drmdimajor = 1; - drmdiminor = 0; - } - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] DRM interface version %d.%d\n", drmdimajor, drmdiminor); - - /* If the interface minor number is 1.1, then we've opened a DRM device - * that already had the busid set through drmOpen. - */ - if (drmdimajor == 1 && drmdiminor >= 1) - err = 0; - else - err = drmSetBusid(pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString); - - if (err < 0) { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmSetBusid failed (%d, %s), %s\n", - pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString, strerror(-err)); - return FALSE; - } - - *pDRMFD = pDRIPriv->drmFD; - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] created \"%s\" driver at busid \"%s\"\n", - pDRIPriv->pDriverInfo->drmDriverName, - pDRIPriv->pDriverInfo->busIdString); - - if (drmAddMap( pDRIPriv->drmFD, - 0, - pDRIPriv->pDriverInfo->SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &pDRIPriv->hSAREA) < 0) - { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmAddMap failed\n"); - return FALSE; - } - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] added %d byte SAREA at %p\n", - pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA); - - if (drmMap( pDRIPriv->drmFD, - pDRIPriv->hSAREA, - pDRIPriv->pDriverInfo->SAREASize, - (drmAddressPtr)(&pDRIPriv->pSAREA)) < 0) - { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmMap failed\n"); - return FALSE; - } - memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize); - DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n", - pDRIPriv->hSAREA, pDRIPriv->pSAREA); - - if (drmAddMap( pDRIPriv->drmFD, - (drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress, - pDRIPriv->pDriverInfo->frameBufferSize, - DRM_FRAME_BUFFER, - 0, - &pDRIPriv->hFrameBuffer) < 0) - { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize); - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmAddMap failed\n"); - return FALSE; - } - DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = %p\n", - pDRIPriv->hFrameBuffer); - - /* Add tags for reserved contexts */ - if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, - &reserved_count))) { - int i; - void *tag; - - for (i = 0; i < reserved_count; i++) { - tag = DRICreateContextPrivFromHandle(pScreen, - reserved[i], - DRI_CONTEXT_RESERVED); - drmAddContextTag(pDRIPriv->drmFD, reserved[i], tag); - } - drmFreeReservedContextList(reserved); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] added %d reserved context%s for kernel\n", - reserved_count, reserved_count > 1 ? "s" : ""); - } - - /* validate max drawable table entry set by driver */ - if ((pDRIPriv->pDriverInfo->maxDrawableTableEntry <= 0) || - (pDRIPriv->pDriverInfo->maxDrawableTableEntry > SAREA_MAX_DRAWABLES)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "Invalid max drawable table size set by driver: %d\n", - pDRIPriv->pDriverInfo->maxDrawableTableEntry); - } - - /* Initialize drawable tables (screen private and SAREA) */ - for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) { - pDRIPriv->DRIDrawables[i] = NULL; - pDRIPriv->pSAREA->drawableTable[i].stamp = 0; - pDRIPriv->pSAREA->drawableTable[i].flags = 0; - } - - return TRUE; -} - -Bool -DRIFinishScreenInit(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - DRIContextFlags flags = 0; - DRIContextPrivPtr pDRIContextPriv; - - /* Set up flags for DRICreateContextPriv */ - switch (pDRIInfo->driverSwapMethod) { - case DRI_KERNEL_SWAP: flags = DRI_CONTEXT_2DONLY; break; - case DRI_HIDE_X_CONTEXT: flags = DRI_CONTEXT_PRESERVED; break; - } - - if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, - &pDRIPriv->myContext, - flags))) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "failed to create server context\n"); - return FALSE; - } - pDRIPriv->myContextPriv = pDRIContextPriv; - - DRIDrvMsg(pScreen->myNum, X_INFO, - "X context handle = %p\n", pDRIPriv->myContext); - - /* Now that we have created the X server's context, we can grab the - * hardware lock for the X server. - */ - DRILock(pScreen, 0); - pDRIPriv->grabbedDRILock = TRUE; - - /* pointers so that we can prevent memory leaks later */ - pDRIPriv->hiddenContextStore = NULL; - pDRIPriv->partial3DContextStore = NULL; - - switch(pDRIInfo->driverSwapMethod) { - case DRI_HIDE_X_CONTEXT: - /* Server will handle 3D swaps, and hide 2D swaps from kernel. - * Register server context as a preserved context. - */ - - /* allocate memory for hidden context store */ - pDRIPriv->hiddenContextStore - = (void *)xcalloc(1, pDRIInfo->contextSize); - if (!pDRIPriv->hiddenContextStore) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "failed to allocate hidden context\n"); - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } - - /* allocate memory for partial 3D context store */ - pDRIPriv->partial3DContextStore - = (void *)xcalloc(1, pDRIInfo->contextSize); - if (!pDRIPriv->partial3DContextStore) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[DRI] failed to allocate partial 3D context\n"); - xfree(pDRIPriv->hiddenContextStore); - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } - - /* save initial context store */ - if (pDRIInfo->SwapContext) { - (*pDRIInfo->SwapContext)( - pScreen, - DRI_NO_SYNC, - DRI_2D_CONTEXT, - pDRIPriv->hiddenContextStore, - DRI_NO_CONTEXT, - NULL); - } - /* fall through */ - - case DRI_SERVER_SWAP: - /* For swap methods of DRI_SERVER_SWAP and DRI_HIDE_X_CONTEXT - * setup signal handler for receiving swap requests from kernel - */ - if (!(pDRIPriv->drmSIGIOHandlerInstalled = - drmInstallSIGIOHandler(pDRIPriv->drmFD, DRISwapContext))) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] failed to setup DRM signal handler\n"); - if (pDRIPriv->hiddenContextStore) - xfree(pDRIPriv->hiddenContextStore); - if (pDRIPriv->partial3DContextStore) - xfree(pDRIPriv->partial3DContextStore); - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } else { - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] installed DRM signal handler\n"); - } - - default: - break; - } - - /* Wrap DRI support */ - if (pDRIInfo->wrap.ValidateTree) { - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; - pScreen->ValidateTree = pDRIInfo->wrap.ValidateTree; - } - if (pDRIInfo->wrap.PostValidateTree) { - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; - pScreen->PostValidateTree = pDRIInfo->wrap.PostValidateTree; - } - if (pDRIInfo->wrap.WindowExposures) { - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures; - } - if (pDRIInfo->wrap.CopyWindow) { - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow; - } - if (pDRIInfo->wrap.ClipNotify) { - pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; - pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify; - } - if (pDRIInfo->wrap.AdjustFrame) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; - pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame; - } - pDRIPriv->wrapped = TRUE; - - DRIDrvMsg(pScreen->myNum, X_INFO, "[DRI] installation complete\n"); - - return TRUE; -} - -void -DRICloseScreen(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo; - drm_context_t * reserved; - int reserved_count; - - if (pDRIPriv && pDRIPriv->directRenderingSupport) { - - pDRIInfo = pDRIPriv->pDriverInfo; - - if (pDRIPriv->wrapped) { - /* Unwrap DRI Functions */ - if (pDRIInfo->wrap.ValidateTree) { - pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree; - pDRIPriv->wrap.ValidateTree = NULL; - } - if (pDRIInfo->wrap.PostValidateTree) { - pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree; - pDRIPriv->wrap.PostValidateTree = NULL; - } - if (pDRIInfo->wrap.WindowExposures) { - pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; - pDRIPriv->wrap.WindowExposures = NULL; - } - if (pDRIInfo->wrap.CopyWindow) { - pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; - pDRIPriv->wrap.CopyWindow = NULL; - } - if (pDRIInfo->wrap.ClipNotify) { - pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; - pDRIPriv->wrap.ClipNotify = NULL; - } - if (pDRIInfo->wrap.AdjustFrame) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; - pDRIPriv->wrap.AdjustFrame = NULL; - } - pDRIPriv->wrapped = FALSE; - } - - if (pDRIPriv->drmSIGIOHandlerInstalled) { - if (!drmRemoveSIGIOHandler(pDRIPriv->drmFD)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] failed to remove DRM signal handler\n"); - } - } - - if (pDRIPriv->dummyCtxPriv && pDRIPriv->createDummyCtx) { - DRIDestroyDummyContext(pScreen, pDRIPriv->createDummyCtxPriv); - } - - if (!DRIDestroyContextPriv(pDRIPriv->myContextPriv)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "failed to destroy server context\n"); - } - - /* Remove tags for reserved contexts */ - if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, - &reserved_count))) { - int i; - - for (i = 0; i < reserved_count; i++) { - DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD, - reserved[i])); - } - drmFreeReservedContextList(reserved); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] removed %d reserved context%s for kernel\n", - reserved_count, reserved_count > 1 ? "s" : ""); - } - - /* Make sure signals get unblocked etc. */ - drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext); - pDRIPriv->lockRefCount = 0; - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] unmapping %d bytes of SAREA %p at %p\n", - pDRIInfo->SAREASize, - pDRIPriv->hSAREA, - pDRIPriv->pSAREA); - if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] unable to unmap %d bytes" - " of SAREA %p at %p\n", - pDRIInfo->SAREASize, - pDRIPriv->hSAREA, - pDRIPriv->pSAREA); - } - - drmClose(pDRIPriv->drmFD); - - xfree(pDRIPriv); - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - } -} - -Bool -DRIExtensionInit(void) -{ - int i; - ScreenPtr pScreen; - - if (DRIScreenPrivIndex < 0) { - return FALSE; - } - - /* Allocate a window private index with a zero sized private area for - * each window, then should a window become a DRI window, we'll hang - * a DRIWindowPrivateRec off of this private index. - */ - if ((DRIWindowPrivIndex = AllocateWindowPrivateIndex()) < 0) - return FALSE; - - DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete); - DRIContextPrivResType = CreateNewResourceType(DRIContextPrivDelete); - - for (i = 0; i < screenInfo.numScreens; i++) - { - pScreen = screenInfo.screens[i]; - if (!AllocateWindowPrivate(pScreen, DRIWindowPrivIndex, 0)) - return FALSE; - } - - RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL); - - return TRUE; -} - -void -DRIReset(void) -{ - /* - * This stub routine is called when the X Server recycles, resources - * allocated by DRIExtensionInit need to be managed here. - * - * Currently this routine is a stub because all the interesting resources - * are managed via the screen init process. - */ -} - -Bool -DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv) - *isCapable = pDRIPriv->directRenderingSupport; - else - *isCapable = FALSE; - - return TRUE; -} - -Bool -DRIOpenConnection(ScreenPtr pScreen, drm_handle_t * hSAREA, char **busIdString) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - *hSAREA = pDRIPriv->hSAREA; - *busIdString = pDRIPriv->pDriverInfo->busIdString; - - return TRUE; -} - -Bool -DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE; - return TRUE; -} - -Bool -DRICloseConnection(ScreenPtr pScreen) -{ - return TRUE; -} - -Bool -DRIGetClientDriverName(ScreenPtr pScreen, - int *ddxDriverMajorVersion, - int *ddxDriverMinorVersion, - int *ddxDriverPatchVersion, - char **clientDriverName) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - *ddxDriverMajorVersion = pDRIPriv->pDriverInfo->ddxDriverMajorVersion; - *ddxDriverMinorVersion = pDRIPriv->pDriverInfo->ddxDriverMinorVersion; - *ddxDriverPatchVersion = pDRIPriv->pDriverInfo->ddxDriverPatchVersion; - *clientDriverName = pDRIPriv->pDriverInfo->clientDriverName; - - return TRUE; -} - -/* DRICreateContextPriv and DRICreateContextPrivFromHandle are helper - functions that layer on drmCreateContext and drmAddContextTag. - - DRICreateContextPriv always creates a kernel drm_context_t and then calls - DRICreateContextPrivFromHandle to create a DRIContextPriv structure for - DRI tracking. For the SIGIO handler, the drm_context_t is associated with - DRIContextPrivPtr. Any special flags are stored in the DRIContextPriv - area and are passed to the kernel (if necessary). - - DRICreateContextPriv returns a pointer to newly allocated - DRIContextPriv, and returns the kernel drm_context_t in pHWContext. */ - -DRIContextPrivPtr -DRICreateContextPriv(ScreenPtr pScreen, - drm_context_t * pHWContext, - DRIContextFlags flags) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (drmCreateContext(pDRIPriv->drmFD, pHWContext)) { - return NULL; - } - - return DRICreateContextPrivFromHandle(pScreen, *pHWContext, flags); -} - -DRIContextPrivPtr -DRICreateContextPrivFromHandle(ScreenPtr pScreen, - drm_context_t hHWContext, - DRIContextFlags flags) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIContextPrivPtr pDRIContextPriv; - int contextPrivSize; - - contextPrivSize = sizeof(DRIContextPrivRec) + - pDRIPriv->pDriverInfo->contextSize; - if (!(pDRIContextPriv = xcalloc(1, contextPrivSize))) { - return NULL; - } - pDRIContextPriv->pContextStore = (void *)(pDRIContextPriv + 1); - - drmAddContextTag(pDRIPriv->drmFD, hHWContext, pDRIContextPriv); - - pDRIContextPriv->hwContext = hHWContext; - pDRIContextPriv->pScreen = pScreen; - pDRIContextPriv->flags = flags; - pDRIContextPriv->valid3D = FALSE; - - if (flags & DRI_CONTEXT_2DONLY) { - if (drmSetContextFlags(pDRIPriv->drmFD, - hHWContext, - DRM_CONTEXT_2DONLY)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] failed to set 2D context flag\n"); - DRIDestroyContextPriv(pDRIContextPriv); - return NULL; - } - } - if (flags & DRI_CONTEXT_PRESERVED) { - if (drmSetContextFlags(pDRIPriv->drmFD, - hHWContext, - DRM_CONTEXT_PRESERVED)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] failed to set preserved flag\n"); - DRIDestroyContextPriv(pDRIContextPriv); - return NULL; - } - } - return pDRIContextPriv; -} - -Bool -DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv) -{ - DRIScreenPrivPtr pDRIPriv; - - if (!pDRIContextPriv) return TRUE; - - pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen); - - if (!(pDRIContextPriv->flags & DRI_CONTEXT_RESERVED)) { - /* Don't delete reserved contexts from - kernel area -- the kernel manages its - reserved contexts itself. */ - if (drmDestroyContext(pDRIPriv->drmFD, pDRIContextPriv->hwContext)) - return FALSE; - } - - /* Remove the tag last to prevent a race - condition where the context has pending - buffers. The context can't be re-used - while in this thread, but buffers can be - dispatched asynchronously. */ - drmDelContextTag(pDRIPriv->drmFD, pDRIContextPriv->hwContext); - xfree(pDRIContextPriv); - return TRUE; -} - -static Bool -DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - __GLXscreenInfo *pGLXScreen = __glXgetActiveScreen(pScreen->myNum); - __GLcontextModes *modes = pGLXScreen->modes; - void **pVisualConfigPriv = pGLXScreen->pVisualPriv; - DRIContextPrivPtr pDRIContextPriv; - void *contextStore; - VisualPtr visual; - int visNum; - - visual = pScreen->visuals; - - /* Find the X visual that corresponds the the first GLX visual */ - for (visNum = 0; - visNum < pScreen->numVisuals; - visNum++, visual++) { - if (modes->visualID == visual->vid) - break; - } - if (visNum == pScreen->numVisuals) return FALSE; - - if (!(pDRIContextPriv = - DRICreateContextPriv(pScreen, - &pDRIPriv->pSAREA->dummy_context, 0))) { - return FALSE; - } - - contextStore = DRIGetContextStore(pDRIContextPriv); - if (pDRIPriv->pDriverInfo->CreateContext && needCtxPriv) { - if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, visual, - pDRIPriv->pSAREA->dummy_context, - *pVisualConfigPriv, - (DRIContextType)(long)contextStore)) { - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } - } - - pDRIPriv->dummyCtxPriv = pDRIContextPriv; - return TRUE; -} - -static void -DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIContextPrivPtr pDRIContextPriv = pDRIPriv->dummyCtxPriv; - void *contextStore; - - if (!pDRIContextPriv) return; - if (pDRIPriv->pDriverInfo->DestroyContext && hasCtxPriv) { - contextStore = DRIGetContextStore(pDRIContextPriv); - pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen, - pDRIContextPriv->hwContext, - (DRIContextType)(long)contextStore); - } - - DRIDestroyContextPriv(pDRIPriv->dummyCtxPriv); - pDRIPriv->dummyCtxPriv = NULL; -} - -Bool -DRICreateContext(ScreenPtr pScreen, VisualPtr visual, - XID context, drm_context_t * pHWContext) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - __GLXscreenInfo *pGLXScreen = __glXgetActiveScreen(pScreen->myNum); - __GLcontextModes *modes = pGLXScreen->modes; - void **pVisualConfigPriv = pGLXScreen->pVisualPriv; - DRIContextPrivPtr pDRIContextPriv; - void *contextStore; - - if (pDRIPriv->createDummyCtx && !pDRIPriv->dummyCtxPriv) { - if (!DRICreateDummyContext(pScreen, pDRIPriv->createDummyCtxPriv)) { - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] Could not create dummy context\n"); - return FALSE; - } - } - - /* Find the GLX visual associated with the one requested */ - for (modes = pGLXScreen->modes; modes != NULL; modes = modes->next) { - if (modes->visualID == visual->vid) - break; - pVisualConfigPriv++; - } - - if (modes == NULL) { - /* No matching GLX visual found */ - return FALSE; - } - - if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, pHWContext, 0))) { - return FALSE; - } - - contextStore = DRIGetContextStore(pDRIContextPriv); - if (pDRIPriv->pDriverInfo->CreateContext) { - if (!((*pDRIPriv->pDriverInfo->CreateContext)(pScreen, visual, - *pHWContext, *pVisualConfigPriv, - (DRIContextType)(long)contextStore))) { - DRIDestroyContextPriv(pDRIContextPriv); - return FALSE; - } - } - - /* track this in case the client dies before cleanup */ - AddResource(context, DRIContextPrivResType, (pointer)pDRIContextPriv); - - return TRUE; -} - -Bool -DRIDestroyContext(ScreenPtr pScreen, XID context) -{ - FreeResourceByType(context, DRIContextPrivResType, FALSE); - - return TRUE; -} - -/* DRIContextPrivDelete is called by the resource manager. */ -Bool -DRIContextPrivDelete(pointer pResource, XID id) -{ - DRIContextPrivPtr pDRIContextPriv = (DRIContextPrivPtr)pResource; - DRIScreenPrivPtr pDRIPriv; - void *contextStore; - - pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen); - if (pDRIPriv->pDriverInfo->DestroyContext) { - contextStore = DRIGetContextStore(pDRIContextPriv); - pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen, - pDRIContextPriv->hwContext, - (DRIContextType)(long)contextStore); - } - return DRIDestroyContextPriv(pDRIContextPriv); -} - - -/* This walks the drawable timestamp array and invalidates all of them - * in the case of transition from private to shared backbuffers. It's - * not necessary for correctness, because DRIClipNotify gets called in - * time to prevent any conflict, but the transition from - * shared->private is sometimes missed if we don't do this. - */ -static void -DRIClipNotifyAllDrawables(ScreenPtr pScreen) -{ - int i; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) { - pDRIPriv->pSAREA->drawableTable[i].stamp = DRIDrawableValidationStamp++; - } -} - - -static void -DRITransitionToSharedBuffers(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - - DRIClipNotifyAllDrawables( pScreen ); - - if (pDRIInfo->TransitionSingleToMulti3D) - pDRIInfo->TransitionSingleToMulti3D( pScreen ); -} - - -static void -DRITransitionToPrivateBuffers(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - - DRIClipNotifyAllDrawables( pScreen ); - - if (pDRIInfo->TransitionMultiToSingle3D) - pDRIInfo->TransitionMultiToSingle3D( pScreen ); -} - - -static void -DRITransitionTo3d(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - - DRIClipNotifyAllDrawables( pScreen ); - - if (pDRIInfo->TransitionTo3d) - pDRIInfo->TransitionTo3d( pScreen ); -} - -static void -DRITransitionTo2d(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; - - DRIClipNotifyAllDrawables( pScreen ); - - if (pDRIInfo->TransitionTo2d) - pDRIInfo->TransitionTo2d( pScreen ); -} - - -Bool -DRICreateDrawable(ScreenPtr pScreen, Drawable id, - DrawablePtr pDrawable, drm_drawable_t * hHWDrawable) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; - WindowPtr pWin; - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin = (WindowPtr)pDrawable; - if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { - pDRIDrawablePriv->refCount++; - } - else { - /* allocate a DRI Window Private record */ - if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) { - return FALSE; - } - - /* Only create a drm_drawable_t once */ - if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) { - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* add it to the list of DRI drawables for this screen */ - pDRIDrawablePriv->hwDrawable = *hHWDrawable; - pDRIDrawablePriv->pScreen = pScreen; - pDRIDrawablePriv->refCount = 1; - pDRIDrawablePriv->drawableIndex = -1; - - /* save private off of preallocated index */ - pWin->devPrivates[DRIWindowPrivIndex].ptr = - (pointer)pDRIDrawablePriv; - - switch (++pDRIPriv->nrWindows) { - case 1: - DRITransitionTo3d( pScreen ); - break; - case 2: - DRITransitionToSharedBuffers( pScreen ); - break; - default: - break; - } - - /* track this in case this window is destroyed */ - AddResource(id, DRIDrawablePrivResType, (pointer)pWin); - } - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ - return FALSE; - } - - return TRUE; -} - -Bool -DRIDestroyDrawable(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable) -{ - DRIDrawablePrivPtr pDRIDrawablePriv; - WindowPtr pWin; - - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin = (WindowPtr)pDrawable; - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - pDRIDrawablePriv->refCount--; - if (pDRIDrawablePriv->refCount <= 0) { - /* This calls back DRIDrawablePrivDelete which frees private area */ - FreeResourceByType(id, DRIDrawablePrivResType, FALSE); - } - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ - return FALSE; - } - - return TRUE; -} - -Bool -DRIDrawablePrivDelete(pointer pResource, XID id) -{ - DrawablePtr pDrawable = (DrawablePtr)pResource; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; - WindowPtr pWin; - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin = (WindowPtr)pDrawable; - pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - - if (pDRIDrawablePriv->drawableIndex != -1) { - /* bump stamp to force outstanding 3D requests to resync */ - pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp - = DRIDrawableValidationStamp++; - - /* release drawable table entry */ - pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL; - } - - if (drmDestroyDrawable(pDRIPriv->drmFD, - pDRIDrawablePriv->hwDrawable)) { - return FALSE; - } - xfree(pDRIDrawablePriv); - pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL; - - switch (--pDRIPriv->nrWindows) { - case 0: - DRITransitionTo2d( pDrawable->pScreen ); - break; - case 1: - DRITransitionToPrivateBuffers( pDrawable->pScreen ); - break; - default: - break; - } - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ - return FALSE; - } - - return TRUE; -} - -Bool -DRIGetDrawableInfo(ScreenPtr pScreen, - DrawablePtr pDrawable, - unsigned int* index, - unsigned int* stamp, - int* X, - int* Y, - int* W, - int* H, - int* numClipRects, - drm_clip_rect_t ** pClipRects, - int* backX, - int* backY, - int* numBackClipRects, - drm_clip_rect_t ** pBackClipRects) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv, pOldDrawPriv; - WindowPtr pWin, pOldWin; - int i; - - printf("maxDrawableTableEntry = %d\n", pDRIPriv->pDriverInfo->maxDrawableTableEntry); - - if (pDrawable->type == DRAWABLE_WINDOW) { - pWin = (WindowPtr)pDrawable; - if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { - - /* Manage drawable table */ - if (pDRIDrawablePriv->drawableIndex == -1) { /* load SAREA table */ - - /* Search table for empty entry */ - i = 0; - while (i < pDRIPriv->pDriverInfo->maxDrawableTableEntry) { - if (!(pDRIPriv->DRIDrawables[i])) { - pDRIPriv->DRIDrawables[i] = pDrawable; - pDRIDrawablePriv->drawableIndex = i; - pDRIPriv->pSAREA->drawableTable[i].stamp = - DRIDrawableValidationStamp++; - break; - } - i++; - } - - /* Search table for oldest entry */ - if (i == pDRIPriv->pDriverInfo->maxDrawableTableEntry) { - unsigned int oldestStamp = ~0; - int oldestIndex = 0; - i = pDRIPriv->pDriverInfo->maxDrawableTableEntry; - while (i--) { - if (pDRIPriv->pSAREA->drawableTable[i].stamp < - oldestStamp) { - oldestIndex = i; - oldestStamp = - pDRIPriv->pSAREA->drawableTable[i].stamp; - } - } - pDRIDrawablePriv->drawableIndex = oldestIndex; - - /* release oldest drawable table entry */ - pOldWin = (WindowPtr)pDRIPriv->DRIDrawables[oldestIndex]; - pOldDrawPriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pOldWin); - pOldDrawPriv->drawableIndex = -1; - - /* claim drawable table entry */ - pDRIPriv->DRIDrawables[oldestIndex] = pDrawable; - - /* validate SAREA entry */ - pDRIPriv->pSAREA->drawableTable[oldestIndex].stamp = - DRIDrawableValidationStamp++; - - /* check for stamp wrap around */ - if (oldestStamp > DRIDrawableValidationStamp) { - - /* walk SAREA table and invalidate all drawables */ - for( i=0; - i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; - i++) { - pDRIPriv->pSAREA->drawableTable[i].stamp = - DRIDrawableValidationStamp++; - } - } - } - - /* If the driver wants to be notified when the index is - * set for a drawable, let it know now. - */ - if (pDRIPriv->pDriverInfo->SetDrawableIndex) - pDRIPriv->pDriverInfo->SetDrawableIndex(pWin, - pDRIDrawablePriv->drawableIndex); - - /* reinit drawable ID if window is visible */ - if ((pWin->viewable) && - (pDRIPriv->pDriverInfo->bufferRequests != DRI_NO_WINDOWS)) - { - (*pDRIPriv->pDriverInfo->InitBuffers)(pWin, - &pWin->clipList, pDRIDrawablePriv->drawableIndex); - } - } - - *index = pDRIDrawablePriv->drawableIndex; - *stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp; - *X = (int)(pWin->drawable.x); - *Y = (int)(pWin->drawable.y); -#if 0 - *W = (int)(pWin->winSize.extents.x2 - pWin->winSize.extents.x1); - *H = (int)(pWin->winSize.extents.y2 - pWin->winSize.extents.y1); -#endif - *W = (int)(pWin->drawable.width); - *H = (int)(pWin->drawable.height); - *numClipRects = REGION_NUM_RECTS(&pWin->clipList); - *pClipRects = (drm_clip_rect_t *)REGION_RECTS(&pWin->clipList); - - if (!*numClipRects && pDRIPriv->fullscreen) { - /* use fake full-screen clip rect */ - pDRIPriv->fullscreen_rect.x1 = *X; - pDRIPriv->fullscreen_rect.y1 = *Y; - pDRIPriv->fullscreen_rect.x2 = *X + *W; - pDRIPriv->fullscreen_rect.y2 = *Y + *H; - - *numClipRects = 1; - *pClipRects = &pDRIPriv->fullscreen_rect; - } - - *backX = *X; - *backY = *Y; - - if (pDRIPriv->nrWindows == 1 && *numClipRects) { - /* Use a single cliprect. */ - - int x0 = *X; - int y0 = *Y; - int x1 = x0 + *W; - int y1 = y0 + *H; - - if (x0 < 0) x0 = 0; - if (y0 < 0) y0 = 0; - if (x1 > pScreen->width) x1 = pScreen->width; - if (y1 > pScreen->height) y1 = pScreen->height; - - pDRIPriv->private_buffer_rect.x1 = x0; - pDRIPriv->private_buffer_rect.y1 = y0; - pDRIPriv->private_buffer_rect.x2 = x1; - pDRIPriv->private_buffer_rect.y2 = y1; - - *numBackClipRects = 1; - *pBackClipRects = &(pDRIPriv->private_buffer_rect); - } else { - /* Use the frontbuffer cliprects for back buffers. */ - *numBackClipRects = 0; - *pBackClipRects = 0; - } - } - else { - /* Not a DRIDrawable */ - return FALSE; - } - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ - return FALSE; - } - - return TRUE; -} - -Bool -DRIGetDeviceInfo(ScreenPtr pScreen, - drm_handle_t * hFrameBuffer, - int* fbOrigin, - int* fbSize, - int* fbStride, - int* devPrivateSize, - void** pDevPrivate) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - *hFrameBuffer = pDRIPriv->hFrameBuffer; - *fbOrigin = 0; - *fbSize = pDRIPriv->pDriverInfo->frameBufferSize; - *fbStride = pDRIPriv->pDriverInfo->frameBufferStride; - *devPrivateSize = pDRIPriv->pDriverInfo->devPrivateSize; - *pDevPrivate = pDRIPriv->pDriverInfo->devPrivate; - - return TRUE; -} - -DRIInfoPtr -DRICreateInfoRec(void) -{ - DRIInfoPtr inforec = (DRIInfoPtr)xcalloc(1, sizeof(DRIInfoRec)); - if (!inforec) return NULL; - - /* Initialize defaults */ - inforec->busIdString = NULL; - - /* Wrapped function defaults */ - inforec->wrap.WakeupHandler = DRIDoWakeupHandler; - inforec->wrap.BlockHandler = DRIDoBlockHandler; - inforec->wrap.WindowExposures = DRIWindowExposures; - inforec->wrap.CopyWindow = DRICopyWindow; - inforec->wrap.ValidateTree = DRIValidateTree; - inforec->wrap.PostValidateTree = DRIPostValidateTree; - inforec->wrap.ClipNotify = DRIClipNotify; - inforec->wrap.AdjustFrame = DRIAdjustFrame; - - inforec->TransitionTo2d = 0; - inforec->TransitionTo3d = 0; - inforec->SetDrawableIndex = 0; - - return inforec; -} - -void -DRIDestroyInfoRec(DRIInfoPtr DRIInfo) -{ - if (DRIInfo->busIdString) xfree(DRIInfo->busIdString); - xfree((char*)DRIInfo); -} - - -void -DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask) -{ - int i; - - for (i = 0; i < screenInfo.numScreens; i++) { - ScreenPtr pScreen = screenInfo.screens[i]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv && - pDRIPriv->pDriverInfo->wrap.WakeupHandler) - (*pDRIPriv->pDriverInfo->wrap.WakeupHandler)(i, wakeupData, - result, pReadmask); - } -} - -void -DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) -{ - int i; - - for (i = 0; i < screenInfo.numScreens; i++) { - ScreenPtr pScreen = screenInfo.screens[i]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv && - pDRIPriv->pDriverInfo->wrap.BlockHandler) - (*pDRIPriv->pDriverInfo->wrap.BlockHandler)(i, blockData, - pTimeout, pReadmask); - } -} - -void -DRIDoWakeupHandler(int screenNum, pointer wakeupData, - unsigned long result, pointer pReadmask) -{ - ScreenPtr pScreen = screenInfo.screens[screenNum]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - DRILock(pScreen, 0); - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - /* hide X context by swapping 2D component here */ - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_3D_SYNC, - DRI_2D_CONTEXT, - pDRIPriv->partial3DContextStore, - DRI_2D_CONTEXT, - pDRIPriv->hiddenContextStore); - } -} - -void -DRIDoBlockHandler(int screenNum, pointer blockData, - pointer pTimeout, pointer pReadmask) -{ - ScreenPtr pScreen = screenInfo.screens[screenNum]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - /* hide X context by swapping 2D component here */ - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_2D_SYNC, - DRI_NO_CONTEXT, - NULL, - DRI_2D_CONTEXT, - pDRIPriv->partial3DContextStore); - } - DRIUnlock(pScreen); -} - -void -DRISwapContext(int drmFD, void *oldctx, void *newctx) -{ - DRIContextPrivPtr oldContext = (DRIContextPrivPtr)oldctx; - DRIContextPrivPtr newContext = (DRIContextPrivPtr)newctx; - ScreenPtr pScreen = newContext->pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - void* oldContextStore = NULL; - DRIContextType oldContextType; - void* newContextStore = NULL; - DRIContextType newContextType; - DRISyncType syncType; -#ifdef DEBUG - static int count = 0; -#endif - - if (!newContext) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[DRI] Context Switch Error: oldContext=%x, newContext=%x\n", - oldContext, newContext); - return; - } - -#ifdef DEBUG - /* usefull for debugging, just print out after n context switches */ - if (!count || !(count % 1)) { - DRIDrvMsg(pScreen->myNum, X_INFO, - "[DRI] Context switch %5d from %p/0x%08x (%d)\n", - count, - oldContext, - oldContext ? oldContext->flags : 0, - oldContext ? oldContext->hwContext : -1); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[DRI] Context switch %5d to %p/0x%08x (%d)\n", - count, - newContext, - newContext ? newContext->flags : 0, - newContext ? newContext->hwContext : -1); - } - ++count; -#endif - - if (!pDRIPriv->pDriverInfo->SwapContext) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[DRI] DDX driver missing context swap call back\n"); - return; - } - - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - - /* only 3D contexts are swapped in this case */ - if (oldContext) { - oldContextStore = DRIGetContextStore(oldContext); - oldContext->valid3D = TRUE; - oldContextType = DRI_3D_CONTEXT; - } else { - oldContextType = DRI_NO_CONTEXT; - } - newContextStore = DRIGetContextStore(newContext); - if ((newContext->valid3D) && - (newContext->hwContext != pDRIPriv->myContext)) { - newContextType = DRI_3D_CONTEXT; - } - else { - newContextType = DRI_2D_CONTEXT; - } - syncType = DRI_3D_SYNC; - } - else /* default: driverSwapMethod == DRI_SERVER_SWAP */ { - - /* optimize 2D context swaps */ - - if (newContext->flags & DRI_CONTEXT_2DONLY) { - /* go from 3D context to 2D context and only save 2D - * subset of 3D state - */ - oldContextStore = DRIGetContextStore(oldContext); - oldContextType = DRI_2D_CONTEXT; - newContextStore = DRIGetContextStore(newContext); - newContextType = DRI_2D_CONTEXT; - syncType = DRI_3D_SYNC; - pDRIPriv->lastPartial3DContext = oldContext; - } - else if (oldContext->flags & DRI_CONTEXT_2DONLY) { - if (pDRIPriv->lastPartial3DContext == newContext) { - /* go from 2D context back to previous 3D context and - * only restore 2D subset of previous 3D state - */ - oldContextStore = DRIGetContextStore(oldContext); - oldContextType = DRI_2D_CONTEXT; - newContextStore = DRIGetContextStore(newContext); - newContextType = DRI_2D_CONTEXT; - syncType = DRI_2D_SYNC; - } - else { - /* go from 2D context to a different 3D context */ - - /* call DDX driver to do partial restore */ - oldContextStore = DRIGetContextStore(oldContext); - newContextStore = - DRIGetContextStore(pDRIPriv->lastPartial3DContext); - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_2D_SYNC, - DRI_2D_CONTEXT, - oldContextStore, - DRI_2D_CONTEXT, - newContextStore); - - /* now setup for a complete 3D swap */ - oldContextStore = newContextStore; - oldContext->valid3D = TRUE; - oldContextType = DRI_3D_CONTEXT; - newContextStore = DRIGetContextStore(newContext); - if ((newContext->valid3D) && - (newContext->hwContext != pDRIPriv->myContext)) { - newContextType = DRI_3D_CONTEXT; - } - else { - newContextType = DRI_2D_CONTEXT; - } - syncType = DRI_NO_SYNC; - } - } - else { - /* now setup for a complete 3D swap */ - oldContextStore = newContextStore; - oldContext->valid3D = TRUE; - oldContextType = DRI_3D_CONTEXT; - newContextStore = DRIGetContextStore(newContext); - if ((newContext->valid3D) && - (newContext->hwContext != pDRIPriv->myContext)) { - newContextType = DRI_3D_CONTEXT; - } - else { - newContextType = DRI_2D_CONTEXT; - } - syncType = DRI_3D_SYNC; - } - } - - /* call DDX driver to perform the swap */ - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - syncType, - oldContextType, - oldContextStore, - newContextType, - newContextStore); -} - -void* -DRIGetContextStore(DRIContextPrivPtr context) -{ - return((void *)context->pContextStore); -} - -void -DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - - if(pDRIDrawablePriv) { - (*pDRIPriv->pDriverInfo->InitBuffers)(pWin, prgn, - pDRIDrawablePriv->drawableIndex); - } - - /* call lower wrapped functions */ - if (pDRIPriv && pDRIPriv->wrap.WindowExposures) { - - /* unwrap */ - pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; - - /* call lower layers */ - (*pScreen->WindowExposures)(pWin, prgn, bsreg); - - /* rewrap */ - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = DRIWindowExposures; - } -} - - -static int -DRITreeTraversal(WindowPtr pWin, pointer data) -{ - DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - - if(pDRIDrawablePriv) { - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - RegionPtr reg = (RegionPtr)data; - - REGION_UNION(pScreen, reg, reg, &(pWin->clipList)); - - if(pDRIPriv->nrWindows == 1) - return WT_STOPWALKING; - } - return WT_WALKCHILDREN; -} - -void -DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if(!pDRIPriv) return; - - if(pDRIPriv->nrWindows > 0) { - RegionRec reg; - - REGION_NULL(pScreen, ®); - TraverseTree(pWin, DRITreeTraversal, (pointer)(®)); - - if(REGION_NOTEMPTY(pScreen, ®)) { - REGION_TRANSLATE(pScreen, ®, ptOldOrg.x - pWin->drawable.x, - ptOldOrg.y - pWin->drawable.y); - REGION_INTERSECT(pScreen, ®, ®, prgnSrc); - - /* The MoveBuffers interface is not ideal */ - (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, ®, - pDRIPriv->pDriverInfo->ddxDrawableTableEntry); - } - - REGION_UNINIT(pScreen, ®); - } - - /* call lower wrapped functions */ - if(pDRIPriv->wrap.CopyWindow) { - /* unwrap */ - pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; - - /* call lower layers */ - (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc); - - /* rewrap */ - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = DRICopyWindow; - } -} - -static void -DRIGetSecs(long *secs, long *usecs) -{ -#ifdef XFree86LOADER - getsecs(secs,usecs); -#else - struct timeval tv; - - gettimeofday(&tv, NULL); - - *secs = tv.tv_sec; - *usecs = tv.tv_usec; -#endif -} - -static unsigned long -DRIComputeMilliSeconds(unsigned long s_secs, unsigned long s_usecs, - unsigned long f_secs, unsigned long f_usecs) -{ - if (f_usecs < s_usecs) { - --f_secs; - f_usecs += 1000000; - } - return (f_secs - s_secs) * 1000 + (f_usecs - s_usecs) / 1000; -} - -static void -DRISpinLockTimeout(drmLock *lock, int val, unsigned long timeout /* in mS */) -{ - int count = 10000; -#if !defined(__alpha__) && !defined(__powerpc__) - char ret; -#else - int ret; -#endif - long s_secs, s_usecs; - long f_secs, f_usecs; - long msecs; - long prev = 0; - - DRIGetSecs(&s_secs, &s_usecs); - - do { - DRM_SPINLOCK_COUNT(lock, val, count, ret); - if (!ret) return; /* Got lock */ - DRIGetSecs(&f_secs, &f_usecs); - msecs = DRIComputeMilliSeconds(s_secs, s_usecs, f_secs, f_usecs); - if (msecs - prev < 250) count *= 2; /* Not more than 0.5S */ - } while (msecs < timeout); - - /* Didn't get lock, so take it. The worst - that can happen is that there is some - garbage written to the wrong part of the - framebuffer that a refresh will repair. - That's undesirable, but better than - locking the server. This should be a - very rare event. */ - DRM_SPINLOCK_TAKE(lock, val); -} - -static void -DRILockTree(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - if(!pDRIPriv) return; - - /* Restore the last known 3D context if the X context is hidden */ - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_2D_SYNC, - DRI_NO_CONTEXT, - NULL, - DRI_2D_CONTEXT, - pDRIPriv->partial3DContextStore); - } - - /* Call kernel to release lock */ - DRIUnlock(pScreen); - - /* Grab drawable spin lock: a time out between 10 and 30 seconds is - appropriate, since this should never time out except in the case of - client death while the lock is being held. The timeout must be - greater than any reasonable rendering time. */ - DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /*10 secs*/ - - /* Call kernel flush outstanding buffers and relock */ - DRILock(pScreen, DRM_LOCK_QUIESCENT|DRM_LOCK_FLUSH_ALL); - - /* Switch back to our 2D context if the X context is hidden */ - if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { - /* hide X context by swapping 2D component here */ - (*pDRIPriv->pDriverInfo->SwapContext)(pScreen, - DRI_3D_SYNC, - DRI_2D_CONTEXT, - pDRIPriv->partial3DContextStore, - DRI_2D_CONTEXT, - pDRIPriv->hiddenContextStore); - } -} - -/* It appears that somebody is relying on the lock being set even - if we aren't touching 3D windows */ - -#define DRI_BROKEN - -static Bool DRIWindowsTouched = FALSE; - -int -DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen = pParent->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - int returnValue = 1; /* always return 1, not checked by dix/window.c */ - - if(!pDRIPriv) return returnValue; - - DRIWindowsTouched = FALSE; - -#ifdef DRI_BROKEN - if(!DRIWindowsTouched) { - DRILockTree(pScreen); - DRIWindowsTouched = TRUE; - } -#endif - - /* call lower wrapped functions */ - if(pDRIPriv->wrap.ValidateTree) { - /* unwrap */ - pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree; - - /* call lower layers */ - returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind); - - /* rewrap */ - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; - pScreen->ValidateTree = DRIValidateTree; - } - - return returnValue; -} - -void -DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) -{ - ScreenPtr pScreen; - DRIScreenPrivPtr pDRIPriv; - - if (pParent) { - pScreen = pParent->drawable.pScreen; - } else { - pScreen = pChild->drawable.pScreen; - } - if(!(pDRIPriv = DRI_SCREEN_PRIV(pScreen))) return; - - if (pDRIPriv->wrap.PostValidateTree) { - /* unwrap */ - pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree; - - /* call lower layers */ - (*pScreen->PostValidateTree)(pParent, pChild, kind); - - /* rewrap */ - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; - pScreen->PostValidateTree = DRIPostValidateTree; - } - - if (DRIWindowsTouched) { - /* Release spin lock */ - DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1); - DRIWindowsTouched = FALSE; - } -} - -void -DRIClipNotify(WindowPtr pWin, int dx, int dy) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; - - if(!pDRIPriv) return; - - if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { - -#ifndef DRI_BROKEN - if(!DRIWindowsTouched) { - DRILockTree(pScreen); - DRIWindowsTouched = TRUE; - } -#endif - - pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp - = DRIDrawableValidationStamp++; - } - - /* call lower wrapped functions */ - if(pDRIPriv->wrap.ClipNotify) { - - /* unwrap */ - pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify; - - /* call lower layers */ - (*pScreen->ClipNotify)(pWin, dx, dy); - - /* rewrap */ - pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; - pScreen->ClipNotify = DRIClipNotify; - } -} - -CARD32 -DRIGetDrawableIndex(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - CARD32 index; - - if (pDRIDrawablePriv) { - index = pDRIDrawablePriv->drawableIndex; - } - else { - index = pDRIPriv->pDriverInfo->ddxDrawableTableEntry; - } - - return index; -} - -unsigned int -DRIGetDrawableStamp(ScreenPtr pScreen, CARD32 drawable_index) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - return pDRIPriv->pSAREA->drawableTable[drawable_index].stamp; -} - - -void -DRIPrintDrawableLock(ScreenPtr pScreen, char *msg) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - - ErrorF("%s: %d\n", msg, pDRIPriv->pSAREA->drawable_lock.lock); -} - -void -DRILock(ScreenPtr pScreen, int flags) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if(!pDRIPriv) return; - - if (!pDRIPriv->lockRefCount) - DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags); - pDRIPriv->lockRefCount++; -} - -void -DRIUnlock(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if(!pDRIPriv) return; - - if (pDRIPriv->lockRefCount > 0) { - pDRIPriv->lockRefCount--; - } - else { - ErrorF("DRIUnlock called when not locked\n"); - return; - } - if (!pDRIPriv->lockRefCount) - DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext); -} - -void * -DRIGetSAREAPrivate(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if (!pDRIPriv) return 0; - - return (void *)(((char*)pDRIPriv->pSAREA)+sizeof(XF86DRISAREARec)); -} - -drm_context_t -DRIGetContext(ScreenPtr pScreen) -{ - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if (!pDRIPriv) return 0; - - return pDRIPriv->myContext; -} - -/* This lets get at the unwrapped functions so that they can correctly - * call the lowerlevel functions, and choose whether they will be - * called at every level of recursion (eg in validatetree). - */ -DRIWrappedFuncsRec * -DRIGetWrappedFuncs(ScreenPtr pScreen) -{ - return &(DRI_SCREEN_PRIV(pScreen)->wrap); -} - -/* note that this returns the library version, not the protocol version */ -void -DRIQueryVersion(int *majorVersion, - int *minorVersion, - int *patchVersion) -{ - *majorVersion = DRIINFO_MAJOR_VERSION; - *minorVersion = DRIINFO_MINOR_VERSION; - *patchVersion = DRIINFO_PATCH_VERSION; -} - -static void -_DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y) -{ - pDRIPriv->pSAREA->frame.x = x; - pDRIPriv->pSAREA->frame.y = y; - pDRIPriv->pSAREA->frame.width = pScrn->frameX1 - x + 1; - pDRIPriv->pSAREA->frame.height = pScrn->frameY1 - y + 1; -} - -void -DRIAdjustFrame(int scrnIndex, int x, int y, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[scrnIndex]; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - int px, py; - - if (!pDRIPriv || !pDRIPriv->pSAREA) { - DRIDrvMsg(scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n", - pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL); - return; - } - - if (pDRIPriv->fullscreen) { - /* Fix up frame */ - pScrn->frameX0 = pDRIPriv->pSAREA->frame.x; - pScrn->frameY0 = pDRIPriv->pSAREA->frame.y; - pScrn->frameX1 = pScrn->frameX0 + pDRIPriv->pSAREA->frame.width - 1; - pScrn->frameY1 = pScrn->frameY0 + pDRIPriv->pSAREA->frame.height - 1; - - /* Fix up cursor */ - miPointerPosition(&px, &py); - if (px < pScrn->frameX0) px = pScrn->frameX0; - if (px > pScrn->frameX1) px = pScrn->frameX1; - if (py < pScrn->frameY0) py = pScrn->frameY0; - if (py > pScrn->frameY1) py = pScrn->frameY1; - pScreen->SetCursorPosition(pScreen, px, py, TRUE); - return; - } - - if (pDRIPriv->wrap.AdjustFrame) { - /* unwrap */ - pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; - /* call lower layers */ - (*pScrn->AdjustFrame)(scrnIndex, x, y, flags); - /* rewrap */ - pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; - pScrn->AdjustFrame = DRIAdjustFrame; - } - - _DRIAdjustFrame(pScrn, pDRIPriv, x, y); -} - -/* - * DRIMoveBuffersHelper swaps the regions rects in place leaving you - * a region with the rects in the order that you need to blit them, - * but it is possibly (likely) an invalid region afterwards. If you - * need to use the region again for anything you have to call - * REGION_VALIDATE on it, or better yet, save a copy first. - */ - -void -DRIMoveBuffersHelper( - ScreenPtr pScreen, - int dx, - int dy, - int *xdir, - int *ydir, - RegionPtr reg -) -{ - BoxPtr extents, pbox, firstBox, lastBox; - BoxRec tmpBox; - int y, nbox; - - extents = REGION_EXTENTS(pScreen, reg); - nbox = REGION_NUM_RECTS(reg); - pbox = REGION_RECTS(reg); - - if((dy > 0) && (dy < (extents->y2 - extents->y1))) { - *ydir = -1; - if(nbox > 1) { - firstBox = pbox; - lastBox = pbox + nbox - 1; - while((unsigned long)firstBox < (unsigned long)lastBox) { - tmpBox = *firstBox; - *firstBox = *lastBox; - *lastBox = tmpBox; - firstBox++; - lastBox--; - } - } - } else *ydir = 1; - - if((dx > 0) && (dx < (extents->x2 - extents->x1))) { - *xdir = -1; - if(nbox > 1) { - firstBox = lastBox = pbox; - y = pbox->y1; - while(--nbox) { - pbox++; - if(pbox->y1 == y) lastBox++; - else { - while((unsigned long)firstBox < (unsigned long)lastBox) { - tmpBox = *firstBox; - *firstBox = *lastBox; - *lastBox = tmpBox; - firstBox++; - lastBox--; - } - - firstBox = lastBox = pbox; - y = pbox->y1; - } - } - while((unsigned long)firstBox < (unsigned long)lastBox) { - tmpBox = *firstBox; - *firstBox = *lastBox; - *lastBox = tmpBox; - firstBox++; - lastBox--; - } - } - } else *xdir = 1; - -} - -char * -DRICreatePCIBusID(pciVideoPtr PciInfo) -{ - char *busID; - int domain; - PCITAG tag; - - busID = xalloc(20); - if (busID == NULL) - return NULL; - - tag = pciTag(PciInfo->bus, PciInfo->device, PciInfo->func); - domain = xf86GetPciDomain(tag); - snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, PciInfo->bus, - PciInfo->device, PciInfo->func); - return busID; -} diff --git a/nx-X11/programs/Xserver/GL/dri/dri.h b/nx-X11/programs/Xserver/GL/dri/dri.h deleted file mode 100644 index 312e8a8bb..000000000 --- a/nx-X11/programs/Xserver/GL/dri/dri.h +++ /dev/null @@ -1,345 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dri.h,v 1.18 2001/03/21 16:21:40 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Jens Owen - * - */ - -/* Prototypes for DRI functions */ - -#ifndef _DRI_H_ - -#include "scrnintstr.h" -#include "xf86dri.h" - -typedef int DRISyncType; - -#define DRI_NO_SYNC 0 -#define DRI_2D_SYNC 1 -#define DRI_3D_SYNC 2 - -typedef int DRIContextType; - -typedef struct _DRIContextPrivRec DRIContextPrivRec, *DRIContextPrivPtr; - -typedef enum _DRIContextFlags -{ - DRI_CONTEXT_2DONLY = 0x01, - DRI_CONTEXT_PRESERVED = 0x02, - DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */ -} DRIContextFlags; - -#define DRI_NO_CONTEXT 0 -#define DRI_2D_CONTEXT 1 -#define DRI_3D_CONTEXT 2 - -typedef int DRISwapMethod; - -#define DRI_HIDE_X_CONTEXT 0 -#define DRI_SERVER_SWAP 1 -#define DRI_KERNEL_SWAP 2 - -typedef int DRIWindowRequests; - -#define DRI_NO_WINDOWS 0 -#define DRI_3D_WINDOWS_ONLY 1 -#define DRI_ALL_WINDOWS 2 - - -typedef void (*ClipNotifyPtr)( WindowPtr, int, int ); -typedef void (*AdjustFramePtr)(int scrnIndex, int x, int y, int flags); - - -/* - * These functions can be wrapped by the DRI. Each of these have - * generic default funcs (initialized in DRICreateInfoRec) and can be - * overridden by the driver in its [driver]DRIScreenInit function. - */ -typedef struct { - ScreenWakeupHandlerProcPtr WakeupHandler; - ScreenBlockHandlerProcPtr BlockHandler; - WindowExposuresProcPtr WindowExposures; - CopyWindowProcPtr CopyWindow; - ValidateTreeProcPtr ValidateTree; - PostValidateTreeProcPtr PostValidateTree; - ClipNotifyProcPtr ClipNotify; - AdjustFramePtr AdjustFrame; -} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr; - - -/* - * Prior to Xorg 6.8.99.8, the DRIInfoRec structure was implicitly versioned - * by the XF86DRI_*_VERSION defines in xf86dristr.h. These numbers were also - * being used to version the XFree86-DRI protocol. Bugs #3066 and #3163 - * showed that this was inadequate. The DRIInfoRec structure is now versioned - * by the DRIINFO_*_VERSION defines in this file. - ajax, 2005-05-18. - * - * Revision history: - * 4.1.0 and earlier: DRIQueryVersion returns XF86DRI_*_VERSION. - * 4.2.0: DRIQueryVersion begins returning DRIINFO_*_VERSION. - * 5.0.0: frameBufferPhysicalAddress changed from CARD32 to pointer. - */ - -#define DRIINFO_MAJOR_VERSION 5 -#define DRIINFO_MINOR_VERSION 0 -#define DRIINFO_PATCH_VERSION 0 - -typedef struct { - /* driver call back functions - * - * New fields should be added at the end for backwards compatibility. - * Bump the DRIINFO patch number to indicate bugfixes. - * Bump the DRIINFO minor number to indicate new fields. - * Bump the DRIINFO major number to indicate binary-incompatible changes. - */ - Bool (*CreateContext)(ScreenPtr pScreen, - VisualPtr visual, - drm_context_t hHWContext, - void* pVisualConfigPriv, - DRIContextType context); - void (*DestroyContext)(ScreenPtr pScreen, - drm_context_t hHWContext, - DRIContextType context); - void (*SwapContext)(ScreenPtr pScreen, - DRISyncType syncType, - DRIContextType readContextType, - void* readContextStore, - DRIContextType writeContextType, - void* writeContextStore); - void (*InitBuffers)(WindowPtr pWin, - RegionPtr prgn, - CARD32 indx); - void (*MoveBuffers)(WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc, - CARD32 indx); - void (*TransitionTo3d)(ScreenPtr pScreen); - void (*TransitionTo2d)(ScreenPtr pScreen); - - void (*SetDrawableIndex)(WindowPtr pWin, CARD32 indx); - Bool (*OpenFullScreen)(ScreenPtr pScreen); - Bool (*CloseFullScreen)(ScreenPtr pScreen); - - /* wrapped functions */ - DRIWrappedFuncsRec wrap; - - /* device info */ - char* drmDriverName; - char* clientDriverName; - char* busIdString; - int ddxDriverMajorVersion; - int ddxDriverMinorVersion; - int ddxDriverPatchVersion; - pointer frameBufferPhysicalAddress; - long frameBufferSize; - long frameBufferStride; - long SAREASize; - int maxDrawableTableEntry; - int ddxDrawableTableEntry; - long contextSize; - DRISwapMethod driverSwapMethod; - DRIWindowRequests bufferRequests; - int devPrivateSize; - void* devPrivate; - Bool createDummyCtx; - Bool createDummyCtxPriv; - - /* New with DRI version 4.1.0 */ - void (*TransitionSingleToMulti3D)(ScreenPtr pScreen); - void (*TransitionMultiToSingle3D)(ScreenPtr pScreen); -} DRIInfoRec, *DRIInfoPtr; - - -extern Bool DRIScreenInit(ScreenPtr pScreen, - DRIInfoPtr pDRIInfo, - int *pDRMFD); - -extern void DRICloseScreen(ScreenPtr pScreen); - -extern Bool DRIExtensionInit(void); - -extern void DRIReset(void); - -extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen, - Bool *isCapable); - -extern Bool DRIOpenConnection(ScreenPtr pScreen, - drm_handle_t * hSAREA, - char **busIdString); - -extern Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic); - -extern Bool DRICloseConnection(ScreenPtr pScreen); - -extern Bool DRIGetClientDriverName(ScreenPtr pScreen, - int* ddxDriverMajorVersion, - int* ddxDriverMinorVersion, - int* ddxDriverPatchVersion, - char** clientDriverName); - -extern Bool DRICreateContext(ScreenPtr pScreen, - VisualPtr visual, - XID context, - drm_context_t * pHWContext); - -extern Bool DRIDestroyContext(ScreenPtr pScreen, XID context); - -extern Bool DRIContextPrivDelete(pointer pResource, XID id); - -extern Bool DRICreateDrawable(ScreenPtr pScreen, - Drawable id, - DrawablePtr pDrawable, - drm_drawable_t * hHWDrawable); - -extern Bool DRIDestroyDrawable(ScreenPtr pScreen, - Drawable id, - DrawablePtr pDrawable); - -extern Bool DRIDrawablePrivDelete(pointer pResource, - XID id); - -extern Bool DRIGetDrawableInfo(ScreenPtr pScreen, - DrawablePtr pDrawable, - unsigned int* indx, - unsigned int* stamp, - int* X, - int* Y, - int* W, - int* H, - int* numClipRects, - drm_clip_rect_t ** pClipRects, - int* backX, - int* backY, - int* numBackClipRects, - drm_clip_rect_t ** pBackClipRects); - -extern Bool DRIGetDeviceInfo(ScreenPtr pScreen, - drm_handle_t * hFrameBuffer, - int* fbOrigin, - int* fbSize, - int* fbStride, - int* devPrivateSize, - void** pDevPrivate); - -extern DRIInfoPtr DRICreateInfoRec(void); - -extern void DRIDestroyInfoRec(DRIInfoPtr DRIInfo); - -extern Bool DRIFinishScreenInit(ScreenPtr pScreen); - -extern void DRIWakeupHandler(pointer wakeupData, - int result, - pointer pReadmask); - -extern void DRIBlockHandler(pointer blockData, - OSTimePtr pTimeout, - pointer pReadmask); - -extern void DRIDoWakeupHandler(int screenNum, - pointer wakeupData, - unsigned long result, - pointer pReadmask); - -extern void DRIDoBlockHandler(int screenNum, - pointer blockData, - pointer pTimeout, - pointer pReadmask); - -extern void DRISwapContext(int drmFD, - void *oldctx, - void *newctx); - -extern void *DRIGetContextStore(DRIContextPrivPtr context); - -extern void DRIWindowExposures(WindowPtr pWin, - RegionPtr prgn, - RegionPtr bsreg); - -extern void DRICopyWindow(WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc); - -extern int DRIValidateTree(WindowPtr pParent, - WindowPtr pChild, - VTKind kind); - -extern void DRIPostValidateTree(WindowPtr pParent, - WindowPtr pChild, - VTKind kind); - -extern void DRIClipNotify(WindowPtr pWin, - int dx, - int dy); - -extern CARD32 DRIGetDrawableIndex(WindowPtr pWin); - -extern void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg); - -extern void DRILock(ScreenPtr pScreen, int flags); - -extern void DRIUnlock(ScreenPtr pScreen); - -extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen); - -extern void *DRIGetSAREAPrivate(ScreenPtr pScreen); - -extern unsigned int DRIGetDrawableStamp(ScreenPtr pScreen, - CARD32 drawable_index); - -extern DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen, - drm_context_t * pHWContext, - DRIContextFlags flags); - -extern DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen, - drm_context_t hHWContext, - DRIContextFlags flags); - -extern Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv); - -extern drm_context_t DRIGetContext(ScreenPtr pScreen); - -extern void DRIQueryVersion(int *majorVersion, - int *minorVersion, - int *patchVersion); - -extern void DRIAdjustFrame(int scrnIndex, int x, int y, int flags); - -extern void DRIMoveBuffersHelper(ScreenPtr pScreen, - int dx, - int dy, - int *xdir, - int *ydir, - RegionPtr reg); - -extern char *DRICreatePCIBusID(pciVideoPtr PciInfo); - -#define _DRI_H_ - -#endif diff --git a/nx-X11/programs/Xserver/GL/dri/drimodule.c b/nx-X11/programs/Xserver/GL/dri/drimodule.c deleted file mode 100644 index 922c6f40e..000000000 --- a/nx-X11/programs/Xserver/GL/dri/drimodule.c +++ /dev/null @@ -1,127 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/GL/dri/drimodule.c,v 1.6 2005/11/02 15:53:57 kem Exp $ */ -/************************************************************************** - -Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ -/* $XFree86: xc/programs/Xserver/GL/dri/drimodule.c,v 1.5 2001/06/15 21:22:39 dawes Exp $ */ - -/* - * Authors: - * Kevin E. Martin - * Rickard E. Faith - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" -#include "globals.h" - -static MODULESETUPPROTO(driSetup); - -static XF86ModuleVersionInfo VersRec = -{ - "dri", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} -}; - -extern void XFree86DRIExtensionInit(INITARGS); -#define _XF86DRI_SERVER_ -#include "xf86dristr.h" - -ExtensionModule XF86DRIExt = -{ - XFree86DRIExtensionInit, - XF86DRINAME, - &noXFree86DRIExtension, - NULL, - NULL -}; - -static const char *drmSymbols[] = { - "drmAddContextTag", - "drmAddMap", - "drmAuthMagic", - "drmAvailable", - "drmClose", - "drmCreateContext", - "drmCreateDrawable", - "drmDelContextTag", - "drmDestroyContext", - "drmDestroyDrawable", - "drmFreeReservedContextList", - "drmGetContextTag", - "drmGetLock", - "drmGetReservedContextList", - "drmInstallSIGIOHandler", - "drmMap", - "drmOpen", - "drmRemoveSIGIOHandler", - "drmSetBusid", - "drmSetContextFlags", - "drmUnlock", - "drmUnmap", - NULL -}; - -XF86ModuleData driModuleData = { &VersRec, driSetup, NULL }; - -static pointer -driSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - static Bool setupDone = FALSE; - pointer drm = NULL; - - if (!setupDone) { - setupDone = TRUE; - - drm = - LoadSubModule(module, "drm", NULL, NULL, NULL, NULL, errmaj, errmin); - - if (!drm) { - if (errmaj) *errmaj = LDR_NOSUBENT; - } - else { - LoaderReqSymLists(drmSymbols, NULL); - LoaderRefSymbols("noPanoramiXExtension", NULL); - LoadExtension(&XF86DRIExt, FALSE); - } - } else { - if (errmaj) *errmaj = LDR_ONCEONLY; - } - /* Need a non-NULL return value to indicate success */ - return drm; -} - diff --git a/nx-X11/programs/Xserver/GL/dri/dristruct.h b/nx-X11/programs/Xserver/GL/dri/dristruct.h deleted file mode 100644 index b47afba3a..000000000 --- a/nx-X11/programs/Xserver/GL/dri/dristruct.h +++ /dev/null @@ -1,105 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dristruct.h,v 1.12 2002/10/30 12:52:03 alanh Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Jens Owen - * - */ - -#ifndef DRI_STRUCT_H -#define DRI_STRUCT_H - -#include "xf86drm.h" - - -#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \ - ((DRIWindowPrivIndex < 0) ? \ - NULL : \ - ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr))) - -#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \ - ((DRIPixmapPrivIndex < 0) ? \ - NULL : \ - ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIWindowPrivIndex].ptr))) - -typedef struct _DRIDrawablePrivRec -{ - drm_drawable_t hwDrawable; - int drawableIndex; - ScreenPtr pScreen; - int refCount; -} DRIDrawablePrivRec, *DRIDrawablePrivPtr; - -struct _DRIContextPrivRec -{ - drm_context_t hwContext; - ScreenPtr pScreen; - Bool valid3D; - DRIContextFlags flags; - void** pContextStore; -}; - -#define DRI_SCREEN_PRIV(pScreen) \ - ((DRIScreenPrivIndex < 0) ? \ - NULL : \ - ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr))) - -#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \ - (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr)) - - -typedef struct _DRIScreenPrivRec -{ - Bool directRenderingSupport; - int drmFD; /* File descriptor for /dev/video/? */ - drm_handle_t hSAREA; /* Handle to SAREA, for mapping */ - XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */ - drm_handle_t hFrameBuffer; /* Handle to framebuffer, for mapping */ - drm_context_t myContext; /* DDX Driver's context */ - DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */ - DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */ - void** hiddenContextStore; /* hidden X context */ - void** partial3DContextStore; /* parital 3D context */ - DRIInfoPtr pDriverInfo; - int nrWindows; - drm_clip_rect_t private_buffer_rect; /* management of private buffers */ - DrawablePtr fullscreen; /* pointer to fullscreen drawable */ - drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */ - DRIWrappedFuncsRec wrap; - DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES]; - DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */ - Bool createDummyCtx; - Bool createDummyCtxPriv; - Bool grabbedDRILock; - Bool drmSIGIOHandlerInstalled; - Bool wrapped; - int lockRefCount; -} DRIScreenPrivRec, *DRIScreenPrivPtr; - -#endif /* DRI_STRUCT_H */ diff --git a/nx-X11/programs/Xserver/GL/dri/sarea.h b/nx-X11/programs/Xserver/GL/dri/sarea.h deleted file mode 100644 index 77c16e0ef..000000000 --- a/nx-X11/programs/Xserver/GL/dri/sarea.h +++ /dev/null @@ -1,94 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ -/** - * \file sarea.h - * SAREA definitions. - * - * \author Kevin E. Martin - * \author Jens Owen - * \author Rickard E. (Rik) Faith - */ - -/* - * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. - * Copyright 2000 VA Linux Systems, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, 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 NON-INFRINGEMENT. - * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - */ - -/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ - -#ifndef _SAREA_H_ -#define _SAREA_H_ - -#include "xf86drm.h" - -/* SAREA area needs to be at least a page */ -#if defined(__alpha__) -#define SAREA_MAX 0x2000 -#elif defined(__ia64__) -#define SAREA_MAX 0x10000 /* 64kB */ -#else -/* Intel 830M driver needs at least 8k SAREA */ -#define SAREA_MAX 0x2000 -#endif - -#define SAREA_MAX_DRAWABLES 256 - -#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 - -/** - * SAREA per drawable information. - * - * \sa _XF86DRISAREA. - */ -typedef struct _XF86DRISAREADrawable { - unsigned int stamp; - unsigned int flags; -} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr; - -/** - * SAREA frame information. - * - * \sa _XF86DRISAREA. - */ -typedef struct _XF86DRISAREAFrame { - unsigned int x; - unsigned int y; - unsigned int width; - unsigned int height; - unsigned int fullscreen; -} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr; - -/** - * SAREA definition. - */ -typedef struct _XF86DRISAREA { - /** first thing is always the DRM locking structure */ - drmLock lock; - /** \todo Use readers/writer lock for drawable_lock */ - drmLock drawable_lock; - XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES]; - XF86DRISAREAFrameRec frame; - drm_context_t dummy_context; -} XF86DRISAREARec, *XF86DRISAREAPtr; - -#endif diff --git a/nx-X11/programs/Xserver/GL/dri/xf86dri.c b/nx-X11/programs/Xserver/GL/dri/xf86dri.c deleted file mode 100644 index 273ccda1b..000000000 --- a/nx-X11/programs/Xserver/GL/dri/xf86dri.c +++ /dev/null @@ -1,649 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.12 2002/12/14 01:36:08 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Jens Owen - * Rickard E. (Rik) Faith - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#endif - -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "servermd.h" -#define _XF86DRI_SERVER_ -#include "xf86dristr.h" -#include "swaprep.h" -#include "xf86str.h" -#include "dri.h" -#include "sarea.h" -#include "dristruct.h" -#include "xf86.h" -#include "xf86drm.h" - -static int DRIErrorBase; - -static DISPATCH_PROC(ProcXF86DRIQueryVersion); -static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable); -static DISPATCH_PROC(ProcXF86DRIOpenConnection); -static DISPATCH_PROC(ProcXF86DRICloseConnection); -static DISPATCH_PROC(ProcXF86DRIGetClientDriverName); -static DISPATCH_PROC(ProcXF86DRICreateContext); -static DISPATCH_PROC(ProcXF86DRIDestroyContext); -static DISPATCH_PROC(ProcXF86DRICreateDrawable); -static DISPATCH_PROC(ProcXF86DRIDestroyDrawable); -static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo); -static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo); -static DISPATCH_PROC(ProcXF86DRIDispatch); -static DISPATCH_PROC(ProcXF86DRIAuthConnection); - -static DISPATCH_PROC(SProcXF86DRIQueryVersion); -static DISPATCH_PROC(SProcXF86DRIDispatch); - -static void XF86DRIResetProc(ExtensionEntry* extEntry); - -static unsigned char DRIReqCode = 0; - -extern void XFree86DRIExtensionInit(void); - -void -XFree86DRIExtensionInit(void) -{ - ExtensionEntry* extEntry; - -#ifdef XF86DRI_EVENTS - EventType = CreateNewResourceType(XF86DRIFreeEvents); -#endif - - if ( - DRIExtensionInit() && -#ifdef XF86DRI_EVENTS - EventType && ScreenPrivateIndex != -1 && -#endif - (extEntry = AddExtension(XF86DRINAME, - XF86DRINumberEvents, - XF86DRINumberErrors, - ProcXF86DRIDispatch, - SProcXF86DRIDispatch, - XF86DRIResetProc, - StandardMinorOpcode))) { - DRIReqCode = (unsigned char)extEntry->base; - DRIErrorBase = extEntry->errorBase; - } -} - -/*ARGSUSED*/ -static void -XF86DRIResetProc ( - ExtensionEntry* extEntry -) -{ - DRIReset(); -} - -static int -ProcXF86DRIQueryVersion( - register ClientPtr client -) -{ - xXF86DRIQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = XF86DRI_MAJOR_VERSION; - rep.minorVersion = XF86DRI_MINOR_VERSION; - rep.patchVersion = XF86DRI_PATCH_VERSION; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - } - WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRIQueryDirectRenderingCapable( - register ClientPtr client -) -{ - xXF86DRIQueryDirectRenderingCapableReply rep; - Bool isCapable; - - REQUEST(xXF86DRIQueryDirectRenderingCapableReq); - REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen], - &isCapable)) { - return BadValue; - } - rep.isCapable = isCapable; - - if (!LocalClient(client)) - rep.isCapable = 0; - - WriteToClient(client, - sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRIOpenConnection( - register ClientPtr client -) -{ - xXF86DRIOpenConnectionReply rep; - drm_handle_t hSAREA; - char* busIdString; - - REQUEST(xXF86DRIOpenConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!DRIOpenConnection( screenInfo.screens[stuff->screen], - &hSAREA, - &busIdString)) { - return BadValue; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.busIdStringLength = 0; - if (busIdString) - rep.busIdStringLength = strlen(busIdString); - rep.length = (SIZEOF(xXF86DRIOpenConnectionReply) - SIZEOF(xGenericReply) + - ((rep.busIdStringLength + 3) & ~3)) >> 2; - - rep.hSAREALow = (CARD32)(hSAREA & 0xffffffff); -#if defined(LONG64) && !defined(__linux__) - rep.hSAREAHigh = (CARD32)(hSAREA >> 32); -#else - rep.hSAREAHigh = 0; -#endif - - WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep); - if (rep.busIdStringLength) - WriteToClient(client, rep.busIdStringLength, busIdString); - return (client->noClientException); -} - -static int -ProcXF86DRIAuthConnection( - register ClientPtr client -) -{ - xXF86DRIAuthConnectionReply rep; - - REQUEST(xXF86DRIAuthConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.authenticated = 1; - - if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) { - ErrorF("Failed to authenticate %lu\n", (unsigned long)stuff->magic); - rep.authenticated = 0; - } - WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRICloseConnection( - register ClientPtr client -) -{ - REQUEST(xXF86DRICloseConnectionReq); - REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - DRICloseConnection( screenInfo.screens[stuff->screen]); - - return (client->noClientException); -} - -static int -ProcXF86DRIGetClientDriverName( - register ClientPtr client -) -{ - xXF86DRIGetClientDriverNameReply rep; - char* clientDriverName; - - REQUEST(xXF86DRIGetClientDriverNameReq); - REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - DRIGetClientDriverName( screenInfo.screens[stuff->screen], - (int *)&rep.ddxDriverMajorVersion, - (int *)&rep.ddxDriverMinorVersion, - (int *)&rep.ddxDriverPatchVersion, - &clientDriverName); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.clientDriverNameLength = 0; - if (clientDriverName) - rep.clientDriverNameLength = strlen(clientDriverName); - rep.length = (SIZEOF(xXF86DRIGetClientDriverNameReply) - - SIZEOF(xGenericReply) + - ((rep.clientDriverNameLength + 3) & ~3)) >> 2; - - WriteToClient(client, - sizeof(xXF86DRIGetClientDriverNameReply), (char *)&rep); - if (rep.clientDriverNameLength) - WriteToClient(client, - rep.clientDriverNameLength, - clientDriverName); - return (client->noClientException); -} - -static int -ProcXF86DRICreateContext( - register ClientPtr client -) -{ - xXF86DRICreateContextReply rep; - ScreenPtr pScreen; - VisualPtr visual; - int i; - - REQUEST(xXF86DRICreateContextReq); - REQUEST_SIZE_MATCH(xXF86DRICreateContextReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - pScreen = screenInfo.screens[stuff->screen]; - visual = pScreen->visuals; - - /* Find the requested X visual */ - for (i = 0; i < pScreen->numVisuals; i++, visual++) - if (visual->vid == stuff->visual) - break; - if (i == pScreen->numVisuals) { - /* No visual found */ - return BadValue; - } - - if (!DRICreateContext( pScreen, - visual, - stuff->context, - (drm_context_t *)&rep.hHWContext)) { - return BadValue; - } - - WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRIDestroyContext( - register ClientPtr client -) -{ - REQUEST(xXF86DRIDestroyContextReq); - REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!DRIDestroyContext( screenInfo.screens[stuff->screen], - stuff->context)) { - return BadValue; - } - - return (client->noClientException); -} - -static int -ProcXF86DRICreateDrawable( - ClientPtr client -) -{ - xXF86DRICreateDrawableReply rep; - DrawablePtr pDrawable; - - REQUEST(xXF86DRICreateDrawableReq); - REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( - (Drawable)stuff->drawable, - client, - SecurityReadAccess))) { - return BadValue; - } - - if (!DRICreateDrawable( screenInfo.screens[stuff->screen], - (Drawable)stuff->drawable, - pDrawable, - (drm_drawable_t *)&rep.hHWDrawable)) { - return BadValue; - } - - WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DRIDestroyDrawable( - register ClientPtr client -) -{ - REQUEST(xXF86DRIDestroyDrawableReq); - DrawablePtr pDrawable; - REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( - (Drawable)stuff->drawable, - client, - SecurityReadAccess))) { - return BadValue; - } - - if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen], - (Drawable)stuff->drawable, - pDrawable)) { - return BadValue; - } - - return (client->noClientException); -} - -static int -ProcXF86DRIGetDrawableInfo( - register ClientPtr client -) -{ - xXF86DRIGetDrawableInfoReply rep; - DrawablePtr pDrawable; - int X, Y, W, H; - drm_clip_rect_t * pClipRects; - drm_clip_rect_t * pBackClipRects; - int backX, backY; - - REQUEST(xXF86DRIGetDrawableInfoReq); - REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable( - (Drawable)stuff->drawable, - client, - SecurityReadAccess))) { - return BadValue; - } - - if (!DRIGetDrawableInfo( screenInfo.screens[stuff->screen], - pDrawable, - (unsigned int*)&rep.drawableTableIndex, - (unsigned int*)&rep.drawableTableStamp, - (int*)&X, - (int*)&Y, - (int*)&W, - (int*)&H, - (int*)&rep.numClipRects, - &pClipRects, - &backX, - &backY, - (int*)&rep.numBackClipRects, - &pBackClipRects)) { - return BadValue; - } - - rep.drawableX = X; - rep.drawableY = Y; - rep.drawableWidth = W; - rep.drawableHeight = H; - rep.length = (SIZEOF(xXF86DRIGetDrawableInfoReply) - - SIZEOF(xGenericReply)); - - rep.backX = backX; - rep.backY = backY; - - if (rep.numBackClipRects) - rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects; - - if (rep.numClipRects) - rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects; - - rep.length = ((rep.length + 3) & ~3) >> 2; - - WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *)&rep); - - if (rep.numClipRects) { - WriteToClient(client, - sizeof(drm_clip_rect_t) * rep.numClipRects, - (char *)pClipRects); - } - - if (rep.numBackClipRects) { - WriteToClient(client, - sizeof(drm_clip_rect_t) * rep.numBackClipRects, - (char *)pBackClipRects); - } - - return (client->noClientException); -} - -static int -ProcXF86DRIGetDeviceInfo( - register ClientPtr client -) -{ - xXF86DRIGetDeviceInfoReply rep; - drm_handle_t hFrameBuffer; - void *pDevPrivate; - - REQUEST(xXF86DRIGetDeviceInfoReq); - REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq); - if (stuff->screen >= screenInfo.numScreens) { - client->errorValue = stuff->screen; - return BadValue; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!DRIGetDeviceInfo( screenInfo.screens[stuff->screen], - &hFrameBuffer, - (int*)&rep.framebufferOrigin, - (int*)&rep.framebufferSize, - (int*)&rep.framebufferStride, - (int*)&rep.devPrivateSize, - &pDevPrivate)) { - return BadValue; - } - - rep.hFrameBufferLow = (CARD32)(hFrameBuffer & 0xffffffff); -#if defined(LONG64) && !defined(__linux__) - rep.hFrameBufferHigh = (CARD32)(hFrameBuffer >> 32); -#else - rep.hFrameBufferHigh = 0; -#endif - - rep.length = 0; - if (rep.devPrivateSize) { - rep.length = (SIZEOF(xXF86DRIGetDeviceInfoReply) - - SIZEOF(xGenericReply) + - ((rep.devPrivateSize + 3) & ~3)) >> 2; - } - - WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *)&rep); - if (rep.length) { - WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate); - } - return (client->noClientException); -} - -static int -ProcXF86DRIDispatch ( - register ClientPtr client -) -{ - REQUEST(xReq); - - switch (stuff->data) - { - case X_XF86DRIQueryVersion: - return ProcXF86DRIQueryVersion(client); - case X_XF86DRIQueryDirectRenderingCapable: - return ProcXF86DRIQueryDirectRenderingCapable(client); - } - - if (!LocalClient(client)) - return DRIErrorBase + XF86DRIClientNotLocal; - - switch (stuff->data) - { - case X_XF86DRIOpenConnection: - return ProcXF86DRIOpenConnection(client); - case X_XF86DRICloseConnection: - return ProcXF86DRICloseConnection(client); - case X_XF86DRIGetClientDriverName: - return ProcXF86DRIGetClientDriverName(client); - case X_XF86DRICreateContext: - return ProcXF86DRICreateContext(client); - case X_XF86DRIDestroyContext: - return ProcXF86DRIDestroyContext(client); - case X_XF86DRICreateDrawable: - return ProcXF86DRICreateDrawable(client); - case X_XF86DRIDestroyDrawable: - return ProcXF86DRIDestroyDrawable(client); - case X_XF86DRIGetDrawableInfo: - return ProcXF86DRIGetDrawableInfo(client); - case X_XF86DRIGetDeviceInfo: - return ProcXF86DRIGetDeviceInfo(client); - case X_XF86DRIAuthConnection: - return ProcXF86DRIAuthConnection(client); - /* {Open,Close}FullScreen are deprecated now */ - default: - return BadRequest; - } -} - -static int -SProcXF86DRIQueryVersion( - register ClientPtr client -) -{ - register int n; - REQUEST(xXF86DRIQueryVersionReq); - swaps(&stuff->length, n); - return ProcXF86DRIQueryVersion(client); -} - -static int -SProcXF86DRIDispatch ( - register ClientPtr client -) -{ - REQUEST(xReq); - - /* It is bound to be non-local when there is byte swapping */ - if (!LocalClient(client)) - return DRIErrorBase + XF86DRIClientNotLocal; - - /* only local clients are allowed DRI access */ - switch (stuff->data) - { - case X_XF86DRIQueryVersion: - return SProcXF86DRIQueryVersion(client); - default: - return BadRequest; - } -} diff --git a/nx-X11/programs/Xserver/GL/windows/ChangeLog b/nx-X11/programs/Xserver/GL/windows/ChangeLog deleted file mode 100644 index 43a817d6a..000000000 --- a/nx-X11/programs/Xserver/GL/windows/ChangeLog +++ /dev/null @@ -1,64 +0,0 @@ -2005-09-27 Ian Romanick - - * indirect.c: - Remove __glEvalComputeK. It is no longer used. - - -2005-04-09 Alexander Gottwald - - * indirect.c: - Fix passing of non-RGB visuals. The old code did not initialize the - structure properly which lead to a crash in 8bpp mode - -2005-03-01 Alexander Gottwald - - * indirect.c: - * glwindows.h: - If a context is already attached copy it instead of reattaching to keep - displaylists and share displaylists - Enable tracing of often called functions with GLWIN_ENABLE_TRACE - ForceCurrent is a no-op now - -2005-02-02 Alexander Gottwald - - * Imakefile: - Bugzilla #1866 (https://bugs.freedesktop.org/show_bug.cgi?id=1866) - attachment #1819 (https://bugs.freedesktop.org/attachment.cgi?id=1819): - Define APIENTRY on windows to prevent from loading - -2005-02-02 Alexander Gottwald - - * glwrap.c: - * glwindows.h: - Bugzilla #1866 (https://bugs.freedesktop.org/show_bug.cgi?id=1866) - attachment #1818 (https://bugs.freedesktop.org/attachment.cgi?id=1818): - Include Xwindows.h before GL/gl.h to prevent loading windows.h which - pollutes our namespace with some symbols. - -2005-01-27 Alexander Gottwald - - * glwrap.c: - Functions like glGenTextures and glBindTexture are in OpenGL 1.1 - and can be resolved at linktime. - -2004-11-15 Alexander Gottwald - - * indirect.c: - Bugzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 - Added mingw (Win32) port - -2004-08-13 Alexander Gottwald - - * Imakefile: Added $(MESASRCDIR)/src/mesa/glapi to INCLUDES. - Removed $(SERVERSRC)/mi from INCLUDES. - Rearranged INCLUDES for better readability. - * glwindows.h: Removed mipointrst.h and miscstruct.h from #include - since they are not used anymore. - -2004-05-27 Alexander Gottwald - - * glwindows.h: write current function and line in debug output - * indirect.c: moved actual setup and creation of windows GL context to - glWinCreateContextReal. - * indirect.c (glWinCreateContext): Deferred context creation to attach. - * indirect.c (glWinMakeCurrent): Check if context is NULL. Fixes segfault. diff --git a/nx-X11/programs/Xserver/GL/windows/Imakefile b/nx-X11/programs/Xserver/GL/windows/Imakefile deleted file mode 100755 index 2b3ddeb12..000000000 --- a/nx-X11/programs/Xserver/GL/windows/Imakefile +++ /dev/null @@ -1,36 +0,0 @@ -#include - -LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) - - SRCS = compsize.c indirect.c glwrap.c - OBJS = compsize.o indirect.o glwrap.o - - INCLUDES = -I. \ - -I$(INCLUDESRC) \ - -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) \ - -I$(SERVERSRC)/include \ - -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/hw/xwin \ - -I$(SERVERSRC)/GL/include \ - -I$(SERVERSRC)/GL/glx \ - -I$(LIBSRC)/GL/glx \ - -I$(LIBSRC)/GL/include \ - -I$(MESASRCDIR)/include \ - -I$(MESASRCDIR)/src \ - -I$(MESASRCDIR)/src/mesa/glapi \ - $(GL_INCLUDES) - -#if defined(GlxUseWindows) && GlxUseWindows - CYGWIN_GL_DEFINES = -DUSE_OPENGL32 -#endif -#if defined(Win32Architecture) -# undef __stdcall - APIENTRY_DEFS = -DAPIENTRY=__stdcall -#endif - DEFINES = $(GLX_DEFINES) $(CYGWIN_GL_DEFINES) $(APIENTRY_DEFS) - -NormalLibraryTarget(GLcore,$(OBJS)) -NormalLibraryObjectRule() - -DependTarget() diff --git a/nx-X11/programs/Xserver/GL/windows/glwindows.h b/nx-X11/programs/Xserver/GL/windows/glwindows.h deleted file mode 100644 index 74e81f24f..000000000 --- a/nx-X11/programs/Xserver/GL/windows/glwindows.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -typedef struct { - unsigned enableDebug : 1; - unsigned enableTrace : 1; - unsigned dumpPFD : 1; - unsigned dumpHWND : 1; - unsigned dumpDC : 1; -} glWinDebugSettingsRec, *glWinDebugSettingsPtr; -extern glWinDebugSettingsRec glWinDebugSettings; - -typedef struct { - int num_vis; - __GLcontextModes *modes; - void **priv; - - /* wrapped screen functions */ - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; - CopyWindowProcPtr CopyWindow; -} glWinScreenRec; - -extern glWinScreenRec glWinScreens[MAXSCREENS]; - -#define glWinGetScreenPriv(pScreen) &glWinScreens[pScreen->myNum] -#define glWinScreenPriv(pScreen) glWinScreenRec *pScreenPriv = glWinGetScreenPriv(pScreen); - -#if 1 -#define GLWIN_TRACE() if (glWinDebugSettings.enableTrace) ErrorF("%s:%d: Trace\n", __FUNCTION__, __LINE__ ) -#define GLWIN_TRACE_MSG(msg, args...) if (glWinDebugSettings.enableTrace) ErrorF("%s:%d: " msg, __FUNCTION__, __LINE__, ##args ) -#define GLWIN_DEBUG_MSG(msg, args...) if (glWinDebugSettings.enableDebug) ErrorF("%s:%d: " msg, __FUNCTION__, __LINE__, ##args ) -#define GLWIN_DEBUG_MSG2(msg, args...) if (glWinDebugSettings.enableDebug) ErrorF(msg, ##args ) -#else -#define GLWIN_TRACE() -#define GLWIN_TRACE_MSG(a, ...) -#define GLWIN_DEBUG_MSG(a, ...) -#define GLWIN_DEBUG_MSG2(a, ...) -#endif - diff --git a/nx-X11/programs/Xserver/GL/windows/glwrap.c b/nx-X11/programs/Xserver/GL/windows/glwrap.c deleted file mode 100755 index f0b38b228..000000000 --- a/nx-X11/programs/Xserver/GL/windows/glwrap.c +++ /dev/null @@ -1,583 +0,0 @@ -/* - * GLX implementation that uses Win32's OpenGL - * Wrapper functions for Win32's OpenGL - * - * Authors: Alexander Gottwald - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include - -#define RESOLVE_RET(procname, symbol, retval) \ - static Bool init = TRUE; \ - static procname proc = NULL; \ - if (init) { \ - proc = (procname)wglGetProcAddress(symbol); \ - init = FALSE; \ - if (proc == NULL) { \ - ErrorF("glwrap: Can't resolve \"%s\"\n", symbol); \ - } else \ - ErrorF("glwrap: resolved \"%s\"\n", symbol); \ - } \ - if (proc == NULL) { \ - __glXErrorCallBack(NULL, 0); \ - return retval; \ - } -#define RESOLVE(procname, symbol) RESOLVE_RET(procname, symbol,) - - -/* - * GL_ARB_imaging - */ - - -GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, - GLenum type, const GLvoid *table ) -{ - RESOLVE(PFNGLCOLORTABLEPROC, "glColorTable"); - proc(target, internalformat, width, format, type, table); -} - -GLAPI void GLAPIENTRY glColorSubTable( GLenum target, - GLsizei start, GLsizei count, - GLenum format, GLenum type, - const GLvoid *data ) -{ - RESOLVE(PFNGLCOLORSUBTABLEPROC, "glColorSubTable"); - proc(target, start, count, format, type, data); -} - -GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params) -{ - RESOLVE(PFNGLCOLORTABLEPARAMETERIVPROC, "glColorTableParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params) -{ - RESOLVE(PFNGLCOLORTABLEPARAMETERFVPROC, "glColorTableParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width ) -{ - RESOLVE(PFNGLCOPYCOLORSUBTABLEPROC, "glCopyColorSubTable"); - proc(target, start, x, y, width); -} - -GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width ) -{ - RESOLVE(PFNGLCOPYCOLORTABLEPROC, "glCopyColorTable"); - proc(target, internalformat, x, y, width); -} - - -GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ) -{ - RESOLVE(PFNGLGETCOLORTABLEPROC, "glGetColorTable"); - proc(target, format, type, table); -} - -GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, - GLfloat *params ) -{ - RESOLVE(PFNGLGETCOLORTABLEPARAMETERFVPROC, "glGetColorTableParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, - GLint *params ) -{ - RESOLVE(PFNGLGETCOLORTABLEPARAMETERIVPROC, "glGetColorTableParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ) -{ - RESOLVE(PFNGLBLENDEQUATIONPROC, "glBlendEquation"); - proc(mode); -} - -GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ) -{ - RESOLVE(PFNGLBLENDCOLORPROC, "glBlendColor"); - proc(red, green, blue, alpha); -} - -GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, - GLenum internalformat, GLboolean sink ) -{ - RESOLVE(PFNGLHISTOGRAMPROC, "glHistogram"); - proc(target, width, internalformat, sink); -} - -GLAPI void GLAPIENTRY glResetHistogram( GLenum target ) -{ - RESOLVE(PFNGLRESETHISTOGRAMPROC, "glResetHistogram"); - proc(target); -} - -GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, - GLenum format, GLenum type, - GLvoid *values ) -{ - RESOLVE(PFNGLGETHISTOGRAMPROC, "glGetHistogram"); - proc(target, reset, format, type, values); -}; - -GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, - GLfloat *params ) -{ - RESOLVE(PFNGLGETHISTOGRAMPARAMETERFVPROC, "glGetHistogramParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, - GLint *params ) -{ - RESOLVE(PFNGLGETHISTOGRAMPARAMETERIVPROC, "glGetHistogramParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, - GLboolean sink ) -{ - RESOLVE(PFNGLMINMAXPROC, "glMinmax"); - proc(target, internalformat, sink); -} - -GLAPI void GLAPIENTRY glResetMinmax( GLenum target ) -{ - RESOLVE(PFNGLRESETMINMAXPROC, "glResetMinmax"); - proc(target); -} - -GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, - GLenum format, GLenum types, - GLvoid *values ) -{ - RESOLVE(PFNGLGETMINMAXPROC, "glGetMinmax"); - proc(target, reset, format, types, values); -} - -GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, - GLfloat *params ) -{ - RESOLVE(PFNGLGETMINMAXPARAMETERFVPROC, "glGetMinmaxParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, - GLint *params ) -{ - RESOLVE(PFNGLGETMINMAXPARAMETERIVPROC, "glGetMinmaxParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, - GLenum internalformat, GLsizei width, GLenum format, GLenum type, - const GLvoid *image ) -{ - RESOLVE(PFNGLCONVOLUTIONFILTER1DPROC, "glConvolutionFilter1D"); - proc(target, internalformat, width, format, type, image); -} - -GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *image ) -{ - RESOLVE(PFNGLCONVOLUTIONFILTER2DPROC, "glConvolutionFilter2D"); - proc(target, internalformat, width, height, format, type, image); -} - -GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, - GLfloat params ) -{ - RESOLVE(PFNGLCONVOLUTIONPARAMETERFPROC, "glConvolutionParameterf"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, - const GLfloat *params ) -{ - RESOLVE(PFNGLCONVOLUTIONPARAMETERFVPROC, "glConvolutionParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, - GLint params ) -{ - RESOLVE(PFNGLCONVOLUTIONPARAMETERIPROC, "glConvolutionParameteri"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, - const GLint *params ) -{ - RESOLVE(PFNGLCONVOLUTIONPARAMETERIVPROC, "glConvolutionParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width ) -{ - RESOLVE(PFNGLCOPYCONVOLUTIONFILTER1DPROC, "glCopyConvolutionFilter1D"); - proc(target, internalformat, x, y, width); -} - -GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, - GLenum internalformat, GLint x, GLint y, GLsizei width, - GLsizei height) -{ - RESOLVE(PFNGLCOPYCONVOLUTIONFILTER2DPROC, "glCopyConvolutionFilter2D"); - proc(target, internalformat, x, y, width, height); -} - -GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, - GLenum type, GLvoid *image ) -{ - RESOLVE(PFNGLGETCONVOLUTIONFILTERPROC, "glGetConvolutionFilter"); - proc(target, format, type, image); -} - -GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, - GLfloat *params ) -{ - RESOLVE(PFNGLGETCONVOLUTIONPARAMETERFVPROC, "glGetConvolutionParameterfv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, - GLint *params ) -{ - RESOLVE(PFNGLGETCONVOLUTIONPARAMETERIVPROC, "glGetConvolutionParameteriv"); - proc(target, pname, params); -} - -GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, - GLenum internalformat, GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *row, const GLvoid *column ) -{ - RESOLVE(PFNGLSEPARABLEFILTER2DPROC, "glSeparableFilter2D"); - proc(target, internalformat, width, height, format, type, row, column); -} - -GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, - GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ) -{ - RESOLVE(PFNGLGETSEPARABLEFILTERPROC, "glGetSeparableFilter"); - proc(target, format, type, row, column, span); -} - -/* - * OpenGL 1.2 - */ - -GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ) -{ - RESOLVE(PFNGLTEXIMAGE3DPROC, "glTexImage3D"); - proc(target, level, internalFormat, width, height, depth, border, format, type, pixels); -} - -GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, - GLenum format, - GLenum type, const GLvoid *pixels) -{ - RESOLVE(PFNGLTEXSUBIMAGE3DPROC, "glTexSubImage3D"); - proc(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); -} - -GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLint x, - GLint y, GLsizei width, - GLsizei height ) -{ - RESOLVE(PFNGLCOPYTEXSUBIMAGE3DPROC, "glCopyTexSubImage3D"); - proc(target, level, xoffset, yoffset, zoffset, x, y, width, height); -} - - -/* - * 20. GL_EXT_texture_object - */ -GLAPI void GLAPIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures ) -{ - glGenTextures(n, textures); -} - -GLAPI void GLAPIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures) -{ - glDeleteTextures(n, textures); -} - -GLAPI void GLAPIENTRY glBindTextureEXT( GLenum target, GLuint texture ) -{ - glBindTexture(target, target); -} - -GLAPI void GLAPIENTRY glPrioritizeTexturesEXT( GLsizei n, const GLuint *textures, const GLclampf *priorities ) -{ - glPrioritizeTextures(n, textures, priorities); -} - -GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT( GLsizei n, const GLuint *textures, GLboolean *residences ) -{ - return glAreTexturesResident(n, textures, residences); -} - -GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture ) -{ - return glIsTexture(texture); -} - -/* - * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) - */ - -GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture) -{ - RESOLVE(PFNGLACTIVETEXTUREARBPROC, "glActiveTextureARB"); - proc(texture); -} - -GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1DVARBPROC, "glMultiTexCoord1dvARB"); - proc(target, v); -} - -GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1FVARBPROC, "glMultiTexCoord1fvARB"); - proc(target, v); -} - -GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1IVARBPROC, "glMultiTexCoord1ivARB"); - proc(target, v); -} - -GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v) -{ - RESOLVE(PFNGLMULTITEXCOORD2DVARBPROC, "glMultiTexCoord2dvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v) -{ - RESOLVE(PFNGLMULTITEXCOORD2FVARBPROC, "glMultiTexCoord2fvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v) -{ - RESOLVE(PFNGLMULTITEXCOORD2IVARBPROC, "glMultiTexCoord2ivARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v) -{ - RESOLVE(PFNGLMULTITEXCOORD3DVARBPROC, "glMultiTexCoord3dvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v) -{ - RESOLVE(PFNGLMULTITEXCOORD3FVARBPROC, "glMultiTexCoord3fvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v) -{ - RESOLVE(PFNGLMULTITEXCOORD3IVARBPROC, "glMultiTexCoord3ivARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v) -{ - RESOLVE(PFNGLMULTITEXCOORD4DVARBPROC, "glMultiTexCoord4dvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v) -{ - RESOLVE(PFNGLMULTITEXCOORD4FVARBPROC, "glMultiTexCoord4fvARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v) -{ - RESOLVE(PFNGLMULTITEXCOORD4IVARBPROC, "glMultiTexCoord4ivARB"); - proc(target, v); -} -GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v) -{ - RESOLVE(PFNGLMULTITEXCOORD1SVARBPROC, "glMultiTexCoord1svARB"); - proc(target, v); -} - - -GLAPI void GLAPIENTRY glActiveStencilFaceEXT(GLenum face) -{ - RESOLVE(PFNGLACTIVESTENCILFACEEXTPROC, "glActiveStencilFaceEXT"); - proc(face); -} - -GLAPI void APIENTRY glPointParameterfARB(GLenum pname, GLfloat param) -{ - RESOLVE(PFNGLPOINTPARAMETERFARBPROC, "glPointParameterfARB"); - proc(pname, param); -} - -GLAPI void APIENTRY glPointParameterfvARB(GLenum pname, const GLfloat *params) -{ - RESOLVE(PFNGLPOINTPARAMETERFVARBPROC, "glPointParameterfvARB"); - proc(pname, params); -} - - -GLAPI void APIENTRY glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z) -{ - RESOLVE(PFNGLWINDOWPOS3FARBPROC, "glWindowPos3fARB"); - proc(x, y, z); -} - -GLAPI void APIENTRY glPointParameteri(GLenum pname, GLint param) -{ - RESOLVE(PFNGLPOINTPARAMETERIPROC, "glPointParameteri"); - proc(pname, param); -} - -GLAPI void APIENTRY glPointParameteriv(GLenum pname, const GLint *params) -{ - RESOLVE(PFNGLPOINTPARAMETERIVPROC, "glPointParameteriv"); - proc(pname, params); -} - -GLAPI void APIENTRY glPointParameteriNV(GLenum pname, GLint param) -{ - RESOLVE(PFNGLPOINTPARAMETERINVPROC, "glPointParameteriNV"); - proc(pname, param); -} - -GLAPI void APIENTRY glPointParameterivNV(GLenum pname, const GLint *params) -{ - RESOLVE(PFNGLPOINTPARAMETERIVNVPROC, "glPointParameterivNV"); - proc(pname, params); -} - -GLAPI void APIENTRY glSecondaryColor3bv(const GLbyte *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3BVPROC, "glSecondaryColor3bv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3dv(const GLdouble *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3DVPROC, "glSecondaryColor3dv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3fv(const GLfloat *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3FVPROC, "glSecondaryColor3fv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3iv(const GLint *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3IVPROC, "glSecondaryColor3iv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3sv(const GLshort *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3SVPROC, "glSecondaryColor3sv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3ubv(const GLubyte *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3UBVPROC, "glSecondaryColor3ubv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3uiv(const GLuint *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3UIVPROC, "glSecondaryColor3uiv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColor3usv(const GLushort *v) -{ - RESOLVE(PFNGLSECONDARYCOLOR3USVPROC, "glSecondaryColor3usv"); - proc(v); -} -GLAPI void APIENTRY glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -{ - RESOLVE(PFNGLSECONDARYCOLORPOINTERPROC, "glSecondaryColorPointer"); - proc(size, type, stride, pointer); -} - - -GLAPI void APIENTRY glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - RESOLVE(PFNGLBLENDFUNCSEPARATEPROC, "glBlendFuncSeparate"); - proc(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); -} -GLAPI void APIENTRY glFogCoordfv(const GLfloat *coord) -{ - RESOLVE(PFNGLFOGCOORDFVPROC, "glFogCoordfv"); - proc(coord); -} -GLAPI void APIENTRY glFogCoorddv(const GLdouble *coord) -{ - RESOLVE(PFNGLFOGCOORDDVPROC, "glFogCoorddv"); - proc(coord); -} -GLAPI void APIENTRY glFogCoordPointer(GLenum type, GLsizei stride, const GLvoid *pointer) -{ - RESOLVE(PFNGLFOGCOORDPOINTERPROC, "glFogCoordPointer"); - proc(type, stride, pointer); -} - - -GLAPI void APIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert) -{ - RESOLVE(PFNGLSAMPLECOVERAGEARBPROC, "glSampleCoverageARB"); - proc(value, invert); -} -GLAPI void APIENTRY glSampleMaskSGIS(GLclampf value, GLboolean invert) -{ - RESOLVE(PFNGLSAMPLEMASKSGISPROC, "glSampleMaskSGIS"); - proc(value, invert); -} -GLAPI void APIENTRY glSamplePatternSGIS(GLenum pattern) -{ - RESOLVE(PFNGLSAMPLEPATTERNSGISPROC, "glSamplePatternSGIS"); - proc(pattern); -} diff --git a/nx-X11/programs/Xserver/GL/windows/indirect.c b/nx-X11/programs/Xserver/GL/windows/indirect.c deleted file mode 100755 index 5e12022f4..000000000 --- a/nx-X11/programs/Xserver/GL/windows/indirect.c +++ /dev/null @@ -1,1605 +0,0 @@ -/* - * GLX implementation that uses Windows OpenGL library - * (Indirect rendering path) - * - * Authors: Alexander Gottwald - */ -/* - * Portions of this file are copied from GL/apple/indirect.c, - * which contains the following copyright: - * - * Copyright (c) 2002 Greg Parker. All Rights Reserved. - * Copyright (c) 2002 Apple Computer, Inc. - * - * Portions of this file are copied from xf86glx.c, - * which contains the following copyright: - * - * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. - * 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 ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "glwindows.h" -#include -#include - -#include - -#define GLWIN_DEBUG_HWND(hwnd) \ - if (glWinDebugSettings.dumpHWND) { \ - char buffer[1024]; \ - if (GetWindowText(hwnd, buffer, sizeof(buffer))==0) *buffer=0; \ - GLWIN_DEBUG_MSG("Got HWND %s (%p)\n", buffer, hwnd); \ - } - - -/* ggs: needed to call back to glx with visual configs */ -extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs); - -glWinDebugSettingsRec glWinDebugSettings = { 1, 0, 0, 0, 0}; - -static void glWinInitDebugSettings(void) -{ - char *envptr; - - envptr = getenv("GLWIN_ENABLE_DEBUG"); - if (envptr != NULL) - glWinDebugSettings.enableDebug = (atoi(envptr) == 1); - - envptr = getenv("GLWIN_ENABLE_TRACE"); - if (envptr != NULL) - glWinDebugSettings.enableTrace = (atoi(envptr) == 1); - - envptr = getenv("GLWIN_DUMP_PFD"); - if (envptr != NULL) - glWinDebugSettings.dumpPFD = (atoi(envptr) == 1); - - envptr = getenv("GLWIN_DUMP_HWND"); - if (envptr != NULL) - glWinDebugSettings.dumpHWND = (atoi(envptr) == 1); - - envptr = getenv("GLWIN_DUMP_DC"); - if (envptr != NULL) - glWinDebugSettings.dumpDC = (atoi(envptr) == 1); -} - -static char errorbuffer[1024]; -const char *glWinErrorMessage(void) -{ - if (!FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &errorbuffer, - sizeof(errorbuffer), - NULL )) - { - snprintf(errorbuffer, sizeof(errorbuffer), "Unknown error in FormatMessage: %08x!\n", (unsigned)GetLastError()); - } - return errorbuffer; -} - -/* - * GLX implementation that uses Win32's OpenGL - */ - -/* - * Server-side GLX uses these functions which are normally defined - * in the OpenGL SI. - */ - -GLuint __glFloorLog2(GLuint val) -{ - int c = 0; - - while (val > 1) { - c++; - val >>= 1; - } - return c; -} - -/* some prototypes */ -static Bool glWinScreenProbe(int screen); -static Bool glWinInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB); -static void glWinSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates); -static __GLinterface *glWinCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC); -static void glWinCreateBuffer(__GLXdrawablePrivate *glxPriv); -static void glWinResetExtension(void); - -/* - * This structure is statically allocated in the __glXScreens[] - * structure. This struct is not used anywhere other than in - * __glXScreenInit to initialize each of the active screens - * (__glXActiveScreens[]). Several of the fields must be initialized by - * the screenProbe routine before they are copied to the active screens - * struct. In particular, the contextCreate, pGlxVisual, numVisuals, - * and numUsableVisuals fields must be initialized. - */ -static __GLXscreenInfo __glDDXScreenInfo = { - glWinScreenProbe, /* Must be generic and handle all screens */ - glWinCreateContext, /* Substitute screen's createContext routine */ - glWinCreateBuffer, /* Substitute screen's createBuffer routine */ - NULL, /* Set up pGlxVisual in probe */ - NULL, /* Set up pVisualPriv in probe */ - 0, /* Set up numVisuals in probe */ - 0, /* Set up numUsableVisuals in probe */ - "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ - "Version String", /* GLXversion is overwritten by __glXScreenInit */ - "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ - NULL /* WrappedPositionWindow is overwritten */ -}; - -void *__glXglDDXScreenInfo(void) { - return &__glDDXScreenInfo; -} - -static __GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_WINDOWS, - glWinResetExtension, - glWinInitVisuals, - glWinSetVisualConfigs -}; - -void *__glXglDDXExtensionInfo(void) { - return &__glDDXExtensionInfo; -} - -/* prototypes */ - -static GLboolean glWinDestroyContext(__GLcontext *gc); -static GLboolean glWinLoseCurrent(__GLcontext *gc); -static GLboolean glWinMakeCurrent(__GLcontext *gc); -static GLboolean glWinShareContext(__GLcontext *gc, __GLcontext *gcShare); -static GLboolean glWinCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask); -static GLboolean glWinForceCurrent(__GLcontext *gc); - -/* Drawing surface notification callbacks */ -static GLboolean glWinNotifyResize(__GLcontext *gc); -static void glWinNotifyDestroy(__GLcontext *gc); -static void glWinNotifySwapBuffers(__GLcontext *gc); - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glWinDispatchExec(__GLcontext *gc); -static void glWinBeginDispatchOverride(__GLcontext *gc); -static void glWinEndDispatchOverride(__GLcontext *gc); - -/* Debug output */ -static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd); - -static __GLexports glWinExports = { - glWinDestroyContext, - glWinLoseCurrent, - glWinMakeCurrent, - glWinShareContext, - glWinCopyContext, - glWinForceCurrent, - - glWinNotifyResize, - glWinNotifyDestroy, - glWinNotifySwapBuffers, - - glWinDispatchExec, - glWinBeginDispatchOverride, - glWinEndDispatchOverride -}; - -glWinScreenRec glWinScreens[MAXSCREENS]; - -/* __GLdrawablePrivate->private */ -typedef struct { - DrawablePtr pDraw; - /* xp_surface_id sid; */ -} GLWinDrawableRec; - -struct __GLcontextRec { - struct __GLinterfaceRec interface; /* required to be first */ - - HGLRC ctx; /* Windows GL Context */ - - HDC dc; /* Windows Device Context */ - winWindowInfoRec winInfo; /* Window info from XWin */ - - PIXELFORMATDESCRIPTOR pfd; /* Pixelformat flags */ - int pixelFormat; /* Pixelformat index */ - - unsigned isAttached :1; /* Flag to track if context is attached */ -}; - -static HDC glWinMakeDC(__GLcontext *gc) -{ - HDC dc; - - /*if (gc->winInfo.hrgn == NULL) - { - GLWIN_DEBUG_MSG("Creating region from RECT(%ld,%ld,%ld,%ld):", - gc->winInfo.rect.left, - gc->winInfo.rect.top, - gc->winInfo.rect.right, - gc->winInfo.rect.bottom); - gc->winInfo.hrgn = CreateRectRgnIndirect(&gc->winInfo.rect); - GLWIN_DEBUG_MSG2("%p\n", gc->winInfo.hrgn); - }*/ - - if (glWinDebugSettings.enableTrace) - GLWIN_DEBUG_HWND(gc->winInfo.hwnd); - - dc = GetDC(gc->winInfo.hwnd); - /*dc = GetDCEx(gc->winInfo.hwnd, gc->winInfo.hrgn, - DCX_WINDOW | DCX_NORESETATTRS ); */ - - if (dc == NULL) - ErrorF("GetDC error: %s\n", glWinErrorMessage()); - return dc; -} - -static void unattach(__GLcontext *gc) -{ - BOOL ret; - GLWIN_DEBUG_MSG("unattach (ctx %p)\n", gc->ctx); - if (!gc->isAttached) - { - ErrorF("called unattach on an unattached context\n"); - return; - } - - if (gc->ctx) - { - ret = wglDeleteContext(gc->ctx); - if (!ret) - ErrorF("wglDeleteContext error: %s\n", glWinErrorMessage()); - gc->ctx = NULL; - } - - if (gc->winInfo.hrgn) - { - ret = DeleteObject(gc->winInfo.hrgn); - if (!ret) - ErrorF("DeleteObject error: %s\n", glWinErrorMessage()); - gc->winInfo.hrgn = NULL; - } - - gc->isAttached = 0; -} - -static BOOL glWinAdjustHWND(__GLcontext *gc, WindowPtr pWin) -{ - HDC dc; - BOOL ret; - HGLRC newctx; - HWND oldhwnd; - - GLWIN_DEBUG_MSG("glWinAdjustHWND (ctx %p, pWin %p)\n", gc->ctx, pWin); - - if (pWin == NULL) - { - GLWIN_DEBUG_MSG("Deferring until window is created\n"); - return FALSE; - } - - oldhwnd = gc->winInfo.hwnd; - winGetWindowInfo(pWin, &gc->winInfo); - - GLWIN_DEBUG_HWND(gc->winInfo.hwnd); - if (gc->winInfo.hwnd == NULL) - { - GLWIN_DEBUG_MSG("Deferring until window is created\n"); - return FALSE; - } - - dc = glWinMakeDC(gc); - - if (glWinDebugSettings.dumpDC) - GLWIN_DEBUG_MSG("Got HDC %p\n", dc); - - gc->pixelFormat = ChoosePixelFormat(dc, &gc->pfd); - if (gc->pixelFormat == 0) - { - ErrorF("ChoosePixelFormat error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - ret = SetPixelFormat(dc, gc->pixelFormat, &gc->pfd); - if (!ret) { - ErrorF("SetPixelFormat error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - newctx = wglCreateContext(dc); - if (newctx == NULL) { - ErrorF("wglCreateContext error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - GLWIN_DEBUG_MSG("wglCreateContext (ctx %p)\n", newctx); - - if (!wglShareLists(gc->ctx, newctx)) - { - ErrorF("wglShareLists error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - if (oldhwnd != gc->winInfo.hwnd) - { - GLWIN_DEBUG_MSG("Trying wglCopyContext\n"); - if (!wglCopyContext(gc->ctx, newctx, GL_ALL_ATTRIB_BITS)) - { - ErrorF("wglCopyContext error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - } - - if (!wglDeleteContext(gc->ctx)) - { - ErrorF("wglDeleteContext error: %s\n", glWinErrorMessage()); - } - - gc->ctx = newctx; - - if (!wglMakeCurrent(dc, gc->ctx)) { - ErrorF("glMakeCurrent error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - ReleaseDC(gc->winInfo.hwnd, dc); - - return TRUE; -} - -static BOOL glWinCreateContextReal(__GLcontext *gc, WindowPtr pWin) -{ - HDC dc; - BOOL ret; - - GLWIN_DEBUG_MSG("glWinCreateContextReal (pWin %p)\n", pWin); - - if (pWin == NULL) - { - GLWIN_DEBUG_MSG("Deferring until window is created\n"); - return FALSE; - } - - winGetWindowInfo(pWin, &gc->winInfo); - - GLWIN_DEBUG_HWND(gc->winInfo.hwnd); - if (gc->winInfo.hwnd == NULL) - { - GLWIN_DEBUG_MSG("Deferring until window is created\n"); - return FALSE; - } - - - dc = glWinMakeDC(gc); - - if (glWinDebugSettings.dumpDC) - GLWIN_DEBUG_MSG("Got HDC %p\n", dc); - - gc->pixelFormat = ChoosePixelFormat(dc, &gc->pfd); - if (gc->pixelFormat == 0) - { - ErrorF("ChoosePixelFormat error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - ret = SetPixelFormat(dc, gc->pixelFormat, &gc->pfd); - if (!ret) { - ErrorF("SetPixelFormat error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - gc->ctx = wglCreateContext(dc); - if (gc->ctx == NULL) { - ErrorF("wglCreateContext error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - GLWIN_DEBUG_MSG("glWinCreateContextReal (ctx %p)\n", gc->ctx); - - if (!wglMakeCurrent(dc, gc->ctx)) { - ErrorF("glMakeCurrent error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - return FALSE; - } - - ReleaseDC(gc->winInfo.hwnd, dc); - - return TRUE; -} - -static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv) -{ - __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other; - - GLWIN_DEBUG_MSG("attach (ctx %p)\n", gc->ctx); - - if (gc->isAttached) - { - ErrorF("called attach on an attached context\n"); - return; - } - - if (glxPriv->type == DRAWABLE_WINDOW) - { - WindowPtr pWin = (WindowPtr) glxPriv->pDraw; - if (pWin == NULL) - { - GLWIN_DEBUG_MSG("Deferring ChoosePixelFormat until window is created\n"); - } else - { - if (glWinCreateContextReal(gc, pWin)) - { - gc->isAttached = TRUE; - GLWIN_DEBUG_MSG("attached\n"); - } - } - } -} - -static GLboolean glWinLoseCurrent(__GLcontext *gc) -{ - GLWIN_TRACE_MSG("glWinLoseCurrent (ctx %p)\n", gc->ctx); - - __glXLastContext = NULL; /* Mesa does this; why? */ - - return GL_TRUE; -} - -/* Context manipulation; return GL_FALSE on failure */ -static GLboolean glWinDestroyContext(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("glWinDestroyContext (ctx %p)\n", gc->ctx); - - if (gc != NULL) - { - if (gc->isAttached) - unattach(gc); - if (gc->dc != NULL) - DeleteDC(gc->dc); - free(gc); - } - - return GL_TRUE; -} - -static GLboolean glWinMakeCurrent(__GLcontext *gc) -{ - __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc); - BOOL ret; - HDC dc; - - GLWIN_TRACE_MSG(" (ctx %p)\n", gc->ctx); - - if (!gc->isAttached) - attach(gc, glPriv); - - if (gc->ctx == NULL) { - ErrorF("Context is NULL\n"); - return GL_FALSE; - } - - dc = glWinMakeDC(gc); - ret = wglMakeCurrent(dc, gc->ctx); - if (!ret) - ErrorF("glMakeCurrent error: %s\n", glWinErrorMessage()); - ReleaseDC(gc->winInfo.hwnd, dc); - - return ret?GL_TRUE:GL_FALSE; -} - -static GLboolean glWinShareContext(__GLcontext *gc, __GLcontext *gcShare) -{ - GLWIN_DEBUG_MSG("glWinShareContext unimplemented\n"); - - return GL_TRUE; -} - -static GLboolean glWinCopyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask) -{ - BOOL ret; - - GLWIN_DEBUG_MSG("glWinCopyContext\n"); - - ret = wglCopyContext(src->ctx, dst->ctx, mask); - if (!ret) - { - ErrorF("wglCopyContext error: %s\n", glWinErrorMessage()); - return GL_FALSE; - } - - return GL_TRUE; -} - -static GLboolean glWinForceCurrent(__GLcontext *gc) -{ - GLWIN_TRACE_MSG(" (ctx %p)\n", gc->ctx); - - return GL_TRUE; -} - -/* Drawing surface notification callbacks */ - -static GLboolean glWinNotifyResize(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinNotifyResize"); - return GL_TRUE; -} - -static void glWinNotifyDestroy(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinNotifyDestroy"); -} - -static void glWinNotifySwapBuffers(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinNotifySwapBuffers"); -} - -/* Dispatch table override control for external agents like libGLS */ -static struct __GLdispatchStateRec* glWinDispatchExec(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinDispatchExec"); - return NULL; -} - -static void glWinBeginDispatchOverride(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinBeginDispatchOverride"); -} - -static void glWinEndDispatchOverride(__GLcontext *gc) -{ - GLWIN_DEBUG_MSG("unimplemented glWinEndDispatchOverride"); -} - -#define DUMP_PFD_FLAG(flag) \ - if (pfd->dwFlags & flag) { \ - ErrorF("%s%s", pipesym, #flag); \ - pipesym = " | "; \ - } - -static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd) -{ - const char *pipesym = ""; /* will be set after first flag dump */ - ErrorF("PIXELFORMATDESCRIPTOR:\n"); - ErrorF("nSize = %u\n", pfd->nSize); - ErrorF("nVersion = %u\n", pfd->nVersion); - ErrorF("dwFlags = %lu = {", pfd->dwFlags); - DUMP_PFD_FLAG(PFD_MAIN_PLANE); - DUMP_PFD_FLAG(PFD_OVERLAY_PLANE); - DUMP_PFD_FLAG(PFD_UNDERLAY_PLANE); - DUMP_PFD_FLAG(PFD_DOUBLEBUFFER); - DUMP_PFD_FLAG(PFD_STEREO); - DUMP_PFD_FLAG(PFD_DRAW_TO_WINDOW); - DUMP_PFD_FLAG(PFD_DRAW_TO_BITMAP); - DUMP_PFD_FLAG(PFD_SUPPORT_GDI); - DUMP_PFD_FLAG(PFD_SUPPORT_OPENGL); - DUMP_PFD_FLAG(PFD_GENERIC_FORMAT); - DUMP_PFD_FLAG(PFD_NEED_PALETTE); - DUMP_PFD_FLAG(PFD_NEED_SYSTEM_PALETTE); - DUMP_PFD_FLAG(PFD_SWAP_EXCHANGE); - DUMP_PFD_FLAG(PFD_SWAP_COPY); - DUMP_PFD_FLAG(PFD_SWAP_LAYER_BUFFERS); - DUMP_PFD_FLAG(PFD_GENERIC_ACCELERATED); - DUMP_PFD_FLAG(PFD_DEPTH_DONTCARE); - DUMP_PFD_FLAG(PFD_DOUBLEBUFFER_DONTCARE); - DUMP_PFD_FLAG(PFD_STEREO_DONTCARE); - ErrorF("}\n"); - - ErrorF("iPixelType = %hu = %s\n", pfd->iPixelType, - (pfd->iPixelType == PFD_TYPE_RGBA ? "PFD_TYPE_RGBA" : "PFD_TYPE_COLORINDEX")); - ErrorF("cColorBits = %hhu\n", pfd->cColorBits); - ErrorF("cRedBits = %hhu\n", pfd->cRedBits); - ErrorF("cRedShift = %hhu\n", pfd->cRedShift); - ErrorF("cGreenBits = %hhu\n", pfd->cGreenBits); - ErrorF("cGreenShift = %hhu\n", pfd->cGreenShift); - ErrorF("cBlueBits = %hhu\n", pfd->cBlueBits); - ErrorF("cBlueShift = %hhu\n", pfd->cBlueShift); - ErrorF("cAlphaBits = %hhu\n", pfd->cAlphaBits); - ErrorF("cAlphaShift = %hhu\n", pfd->cAlphaShift); - ErrorF("cAccumBits = %hhu\n", pfd->cAccumBits); - ErrorF("cAccumRedBits = %hhu\n", pfd->cAccumRedBits); - ErrorF("cAccumGreenBits = %hhu\n", pfd->cAccumGreenBits); - ErrorF("cAccumBlueBits = %hhu\n", pfd->cAccumBlueBits); - ErrorF("cAccumAlphaBits = %hhu\n", pfd->cAccumAlphaBits); - ErrorF("cDepthBits = %hhu\n", pfd->cDepthBits); - ErrorF("cStencilBits = %hhu\n", pfd->cStencilBits); - ErrorF("cAuxBuffers = %hhu\n", pfd->cAuxBuffers); - ErrorF("iLayerType = %hhu\n", pfd->iLayerType); - ErrorF("bReserved = %hhu\n", pfd->bReserved); - ErrorF("dwLayerMask = %lu\n", pfd->dwLayerMask); - ErrorF("dwVisibleMask = %lu\n", pfd->dwVisibleMask); - ErrorF("dwDamageMask = %lu\n", pfd->dwDamageMask); - ErrorF("\n"); -} - -static int makeFormat(__GLcontextModes *mode, PIXELFORMATDESCRIPTOR *pfdret) -{ - PIXELFORMATDESCRIPTOR pfd = { - sizeof(PIXELFORMATDESCRIPTOR), /* size of this pfd */ - 1, /* version number */ - PFD_DRAW_TO_WINDOW | /* support window */ - PFD_SUPPORT_OPENGL, /* support OpenGL */ - PFD_TYPE_RGBA, /* RGBA type */ - 24, /* 24-bit color depth */ - 0, 0, 0, 0, 0, 0, /* color bits ignored */ - 0, /* no alpha buffer */ - 0, /* shift bit ignored */ - 0, /* no accumulation buffer */ - 0, 0, 0, 0, /* accum bits ignored */ - 0, /* 32-bit z-buffer */ - 0, /* no stencil buffer */ - 0, /* no auxiliary buffer */ - PFD_MAIN_PLANE, /* main layer */ - 0, /* reserved */ - 0, 0, 0 /* layer masks ignored */ - }, *result = &pfd; - - /* disable anything but rgba. must get rgba to work first */ - if (!mode->rgbMode) - return -1; - - if (mode->stereoMode) { - result->dwFlags |= PFD_STEREO; - } - if (mode->doubleBufferMode) { - result->dwFlags |= PFD_DOUBLEBUFFER; - } - - if (mode->colorIndexMode) { - /* ignored, see above */ - result->iPixelType = PFD_TYPE_COLORINDEX; - result->cColorBits = mode->redBits + mode->greenBits + mode->blueBits; - result->cRedBits = mode->redBits; - result->cRedShift = 0; /* FIXME */ - result->cGreenBits = mode->greenBits; - result->cGreenShift = 0; /* FIXME */ - result->cBlueBits = mode->blueBits; - result->cBlueShift = 0; /* FIXME */ - result->cAlphaBits = mode->alphaBits; - result->cAlphaShift = 0; /* FIXME */ - } - - if (mode->rgbMode) { - result->iPixelType = PFD_TYPE_RGBA; - result->cColorBits = mode->redBits + mode->greenBits + mode->blueBits; - result->cRedBits = mode->redBits; - result->cRedShift = 0; /* FIXME */ - result->cGreenBits = mode->greenBits; - result->cGreenShift = 0; /* FIXME */ - result->cBlueBits = mode->blueBits; - result->cBlueShift = 0; /* FIXME */ - result->cAlphaBits = mode->alphaBits; - result->cAlphaShift = 0; /* FIXME */ - } - - if (mode->haveAccumBuffer) { - result->cAccumBits = mode->accumRedBits + mode->accumGreenBits - + mode->accumBlueBits + mode->accumAlphaBits; - result->cAccumRedBits = mode->accumRedBits; - result->cAccumGreenBits = mode->accumGreenBits; - result->cAccumBlueBits = mode->accumBlueBits; - result->cAccumAlphaBits = mode->accumAlphaBits; - } - - if (mode->haveDepthBuffer) { - result->cDepthBits = mode->depthBits; - } - if (mode->haveStencilBuffer) { - result->cStencilBits = mode->stencilBits; - } - - /* result->cAuxBuffers = mode->numAuxBuffers; */ - - /* mode->level ignored */ - - /* mode->pixmapMode ? */ - - *pfdret = pfd; - - return 0; -} - -static __GLinterface *glWinCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC) -{ - __GLcontext *result; - - GLWIN_DEBUG_MSG("glWinCreateContext\n"); - - result = (__GLcontext *)calloc(1, sizeof(__GLcontext)); - if (!result) - return NULL; - - result->interface.imports = *imports; - result->interface.exports = glWinExports; - - if (makeFormat(mode, &result->pfd)) - { - ErrorF("makeFormat failed\n"); - free(result); - return NULL; - } - - if (glWinDebugSettings.dumpPFD) - pfdOut(&result->pfd); - - GLWIN_DEBUG_MSG("glWinCreateContext done\n"); - return (__GLinterface *)result; -} - -Bool -glWinRealizeWindow(WindowPtr pWin) -{ - /* If this window has GL contexts, tell them to reattach */ - /* reattaching is bad: display lists and parameters get lost */ - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLWIN_DEBUG_MSG("glWinRealizeWindow\n"); - - /* Allow the window to be created (RootlessRealizeWindow is inside our wrap) */ - pScreen->RealizeWindow = screenPriv->RealizeWindow; - result = pScreen->RealizeWindow(pWin); - pScreen->RealizeWindow = glWinRealizeWindow; - - /* Re-attach this window's GL contexts, if any. */ - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - GLWIN_DEBUG_MSG("glWinRealizeWindow is GL drawable!\n"); - - /* GL contexts bound to this window for drawing */ - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - if (gc->isAttached) -#if 1 - { - GLWIN_DEBUG_MSG("context is already bound! Adjusting HWND.\n"); - glWinAdjustHWND(gc, pWin); - continue; - } -#else - unattach(gc); -#endif - attach(gc, glPriv); - } - - /* GL contexts bound to this window for reading */ - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - if (gc->isAttached) -#if 1 - { - GLWIN_DEBUG_MSG("context is already bound! Adjusting HWND.\n"); - glWinAdjustHWND(gc, pWin); - continue; - } -#else - unattach(gc); -#endif - attach(gc, glPriv); - } - } - - return result; -} - - -void -glWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLWIN_TRACE_MSG(" (pWindow %p)\n", pWindow); - - /* Check if the window is attached and discard any drawing request */ - glxPriv = __glXFindDrawablePrivate(pWindow->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - - /* GL contexts bound to this window for drawing */ - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { -/* - GLWIN_DEBUG_MSG("glWinCopyWindow - calling glDrawBuffer\n"); - glDrawBuffer(GL_FRONT); - */ - - return; - } - - /* GL contexts bound to this window for reading */ - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - return; - } - } - - GLWIN_DEBUG_MSG("glWinCopyWindow - passing to hw layer\n"); - - pScreen->CopyWindow = screenPriv->CopyWindow; - pScreen->CopyWindow(pWindow, ptOldOrg, prgnSrc); - pScreen->CopyWindow = glWinCopyWindow; -} - -Bool -glWinUnrealizeWindow(WindowPtr pWin) -{ - /* If this window has GL contexts, tell them to unattach */ - Bool result; - ScreenPtr pScreen = pWin->drawable.pScreen; - glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum]; - __GLXdrawablePrivate *glxPriv; - - GLWIN_DEBUG_MSG("glWinUnrealizeWindow\n"); - - /* The Aqua window may have already been destroyed (windows - * are unrealized from top down) - */ - - /* Unattach this window's GL contexts, if any. */ - glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); - if (glxPriv) { - __GLXcontext *gx; - __GLcontext *gc; - GLWIN_DEBUG_MSG("glWinUnealizeWindow is GL drawable!\n"); - - /* GL contexts bound to this window for drawing */ - for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - unattach(gc); - } - - /* GL contexts bound to this window for reading */ - for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { - gc = (__GLcontext *)gx->gc; - unattach(gc); - } - } - - pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow; - result = pScreen->UnrealizeWindow(pWin); - pScreen->UnrealizeWindow = glWinUnrealizeWindow; - - return result; -} - - -/* - * In the case the driver has no GLX visuals we'll use these. - * [0] = RGB, double buffered - * [1] = RGB, double buffered, stencil, accum - */ -/* Originally copied from Mesa */ - -static int numConfigs = 0; -static __GLXvisualConfig *visualConfigs = NULL; -static void **visualPrivates = NULL; - -#define NUM_FALLBACK_CONFIGS 2 -static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = { - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 16, 16, 16, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - } -}; - -static __GLXvisualConfig NullConfig = { - -1, /* vid */ - -1, /* class */ - False, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE_EXT, /* visualRating */ - 0, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ -}; - -static inline int count_bits(uint32_t x) -{ - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x = x + (x >> 8); - x = x + (x >> 16); - return x & 63; -} - -/* Mostly copied from Mesa's xf86glx.c */ -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numRGBconfigs; - int numCIconfigs; - int numVisuals = *nvisualp; - int numNewVisuals; - int numNewConfigs; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLcontextModes *modes = NULL; - __GLXvisualConfig *pNewVisualConfigs = NULL; - void **glXVisualPriv; - void **pNewVisualPriv; - int found_default; - int i, j, k; - - GLWIN_DEBUG_MSG("init_visuals\n"); - - if (numConfigs > 0) - numNewConfigs = numConfigs; - else - numNewConfigs = NUM_FALLBACK_CONFIGS; - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* - ** If SetVisualConfigs was not called, then use default GLX - ** visual configs. - */ - if (numConfigs == 0) { - memcpy(pNewVisualConfigs, FallbackConfigs, - NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig)); - memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *)); - } - else { - /* copy driver's visual config info */ - for (i = 0; i < numConfigs; i++) { - pNewVisualConfigs[i] = visualConfigs[i]; - pNewVisualPriv[i] = visualPrivates[i]; - } - } - - /* Count the number of RGB and CI visual configs */ - numRGBconfigs = 0; - numCIconfigs = 0; - for (i = 0; i < numNewConfigs; i++) { - if (pNewVisualConfigs[i].rgba) - numRGBconfigs++; - else - numCIconfigs++; - } - - /* Count the total number of visuals to compute */ - numNewVisuals = 0; - for (i = 0; i < numVisuals; i++) { - int count; - - count = ((pVisual[i].class == TrueColor - || pVisual[i].class == DirectColor) - ? numRGBconfigs : numCIconfigs); - if (count == 0) - count = 1; /* preserve the existing visual */ - - numNewVisuals += count; - } - - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - __glXFree(glXVisualPriv); - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Initialize the new visuals */ - found_default = FALSE; - glWinScreens[screenInfo.numScreens-1].modes = modes; - for (i = j = 0; i < numVisuals; i++) { - int is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - if (!is_rgb) - { - /* We don't support non-rgb visuals for GL. But we don't - want to remove them either, so just pass them through - with null glX configs */ - - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & NullConfig ); - modes->visualID = pVisualNew[j].vid; - - j++; - - continue; - } - - for (k = 0; k < numNewConfigs; k++) { - if (pNewVisualConfigs[k].rgba != is_rgb) - continue; - - assert( modes != NULL ); - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] ); - modes->visualID = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (modes->visualType == GLX_NONE) { - modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class ); - modes->redBits = count_bits(pVisual[i].redMask); - modes->greenBits = count_bits(pVisual[i].greenMask); - modes->blueBits = count_bits(pVisual[i].blueMask); - modes->alphaBits = modes->alphaBits; - modes->redMask = pVisual[i].redMask; - modes->greenMask = pVisual[i].greenMask; - modes->blueMask = pVisual[i].blueMask; - modes->alphaMask = modes->alphaMask; - modes->rgbBits = (is_rgb) - ? (modes->redBits + modes->greenBits + - modes->blueBits + modes->alphaBits) - : rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pNewVisualPriv[k]; - - j++; - modes = modes->next; - } - } - - assert(j <= numNewVisuals); - - /* Save the GLX visuals in the screen structure */ - glWinScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; - glWinScreens[screenInfo.numScreens-1].priv = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } - - /* Update the X server's visuals */ - *nvisualp = numNewVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - __glXFree(pVisual); - - /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) - xfree(visualPrivates); - visualPrivates = NULL; - - return TRUE; -} - - -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - glWinScreenRec *pScr = &glWinScreens[screen]; - __GLcontextModes *modes; - int j; - - GLWIN_DEBUG_MSG("fixup_visuals\n"); - - for (modes = pScr->modes; modes != NULL; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - VisualPtr pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes) { - - /* Fixup the masks */ - modes->redMask = pVis[j].redMask; - modes->greenMask = pVis[j].greenMask; - modes->blueMask = pVis[j].blueMask; - - /* Recalc the sizes */ - modes->redBits = count_bits(modes->redMask); - modes->greenBits = count_bits(modes->greenMask); - modes->blueBits = count_bits(modes->blueMask); - } - } - } -} - -static void init_screen_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __GLcontextModes *modes; - int *used; - int i, j; - - GLWIN_DEBUG_MSG("init_screen_visuals\n"); - - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; - for ( modes = glWinScreens[screen].modes - ; modes != NULL - ; modes = modes->next) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - for (j = 0; j < pScreen->numVisuals; j++) { - - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes && - pVis[j].redMask == modes->redMask && - pVis[j].greenMask == modes->greenMask && - pVis[j].blueMask == modes->blueMask && - !used[j]) { - -#if 0 - /* Create the XMesa visual */ - pXMesaVisual[i] = - XMesaCreateVisual(pScreen, - pVis, - modes->rgbMode, - (modes->alphaBits > 0), - modes->doubleBufferMode, - modes->stereoMode, - GL_TRUE, /* ximage_flag */ - modes->depthBits, - modes->stencilBits, - modes->accumRedBits, - modes->accumGreenBits, - modes->accumBlueBits, - modes->accumAlphaBits, - modes->samples, - modes->level, - modes->visualRating); -#endif - - /* Set the VisualID */ - modes->visualID = pVis[j].vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - - if ( j == pScreen->numVisuals ) { - ErrorF("No matching visual for __GLcontextMode with " - "visual class = %d (%d), nplanes = %u\n", - vis_class, - modes->visualType, - (modes->rgbBits - modes->alphaBits) ); - } - else if ( modes->visualID == -1 ) { - FatalError( "Matching visual found, but visualID still -1!\n" ); - } - - i++; - - } - - __glXFree(used); - - /* glWinScreens[screen].xm_vis = pXMesaVisual; */ -} - -static Bool glWinScreenProbe(int screen) -{ - ScreenPtr pScreen; - glWinScreenRec *screenPriv; - - GLWIN_DEBUG_MSG("glWinScreenProbe\n"); - - /* - * Set up the current screen's visuals. - */ - __glDDXScreenInfo.modes = glWinScreens[screen].modes; - __glDDXScreenInfo.pVisualPriv = glWinScreens[screen].priv; - __glDDXScreenInfo.numVisuals = - __glDDXScreenInfo.numUsableVisuals = glWinScreens[screen].num_vis; - - /* - * Set the current screen's createContext routine. This could be - * wrapped by a DDX GLX context creation routine. - */ - __glDDXScreenInfo.createContext = glWinCreateContext; - - /* - * The ordering of the rgb compenents might have been changed by the - * driver after mi initialized them. - */ - fixup_visuals(screen); - - /* - * Find the GLX visuals that are supported by this screen and create - * XMesa's visuals. - */ - init_screen_visuals(screen); - - /* Wrap RealizeWindow and UnrealizeWindow on this screen */ - pScreen = screenInfo.screens[screen]; - screenPriv = &glWinScreens[screen]; - screenPriv->RealizeWindow = pScreen->RealizeWindow; - pScreen->RealizeWindow = glWinRealizeWindow; - screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow; - pScreen->UnrealizeWindow = glWinUnrealizeWindow; - screenPriv->CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = glWinCopyWindow; - - return TRUE; -} - -static GLboolean glWinSwapBuffers(__GLXdrawablePrivate *glxPriv) -{ - /* swap buffers on only *one* of the contexts - * (e.g. the last one for drawing) - */ - __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc; - HDC dc; - BOOL ret; - - GLWIN_TRACE_MSG("glWinSwapBuffers (ctx %p)\n", (gc!=NULL?gc->ctx:NULL)); - - if (gc != NULL && gc->ctx != NULL) - { - dc = glWinMakeDC(gc); - if (dc == NULL) - return GL_FALSE; - - ret = SwapBuffers(dc); - if (!ret) - ErrorF("SwapBuffers failed: %s\n", glWinErrorMessage()); - - ReleaseDC(gc->winInfo.hwnd, dc); - if (!ret) - return GL_FALSE; - } - - return GL_TRUE; -} - -static void glWinDestroyDrawablePrivate(__GLdrawablePrivate *glPriv) -{ - GLWIN_DEBUG_MSG("glWinDestroyDrawablePrivate\n"); - - /* It doesn't work to call DRIDestroySurface here, the drawable's - already gone.. But dri.c notices the window destruction and - frees the surface itself. */ - - free(glPriv->private); - glPriv->private = NULL; -} - - -static void glWinCreateBuffer(__GLXdrawablePrivate *glxPriv) -{ - GLWinDrawableRec *winPriv = malloc(sizeof(GLWinDrawableRec)); - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - - /*winPriv->sid = 0; */ - winPriv->pDraw = NULL; - - GLWIN_DEBUG_MSG("glWinCreateBuffer\n"); - - /* replace swapBuffers (original is never called) */ - glxPriv->swapBuffers = glWinSwapBuffers; - - /* stash private data */ - glPriv->private = winPriv; - glPriv->freePrivate = glWinDestroyDrawablePrivate; -} - -static void glWinResetExtension(void) -{ - GLWIN_DEBUG_MSG("glWinResetExtension\n"); -} - -/* based on code in apples/indirect.c which is based on i830_dri.c */ -static void -glWinInitVisualConfigs(void) -{ - int lclNumConfigs = 0; - __GLXvisualConfig *lclVisualConfigs = NULL; - void **lclVisualPrivates = NULL; - - int depth, aux, buffers, stencil, accum; - int i = 0; - - GLWIN_DEBUG_MSG("glWinInitVisualConfigs "); - - /* count num configs: - 2 Z buffer (0, 24 bit) - 2 AUX buffer (0, 2) - 2 buffers (single, double) - 2 stencil (0, 8 bit) - 2 accum (0, 64 bit) - = 32 configs */ - - lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ - - /* alloc */ - lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs); - lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs); - - /* fill in configs */ - if (NULL != lclVisualConfigs) { - i = 0; /* current buffer */ - for (depth = 0; depth < 2; depth++) { - for (aux = 0; aux < 2; aux++) { - for (buffers = 0; buffers < 2; buffers++) { - for (stencil = 0; stencil < 2; stencil++) { - for (accum = 0; accum < 2; accum++) { - lclVisualConfigs[i].vid = -1; - lclVisualConfigs[i].class = -1; - lclVisualConfigs[i].rgba = TRUE; - lclVisualConfigs[i].redSize = -1; - lclVisualConfigs[i].greenSize = -1; - lclVisualConfigs[i].blueSize = -1; - lclVisualConfigs[i].redMask = -1; - lclVisualConfigs[i].greenMask = -1; - lclVisualConfigs[i].blueMask = -1; - lclVisualConfigs[i].alphaMask = 0; - if (accum) { - lclVisualConfigs[i].accumRedSize = 16; - lclVisualConfigs[i].accumGreenSize = 16; - lclVisualConfigs[i].accumBlueSize = 16; - lclVisualConfigs[i].accumAlphaSize = 16; - } - else { - lclVisualConfigs[i].accumRedSize = 0; - lclVisualConfigs[i].accumGreenSize = 0; - lclVisualConfigs[i].accumBlueSize = 0; - lclVisualConfigs[i].accumAlphaSize = 0; - } - lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; - lclVisualConfigs[i].stereo = FALSE; - lclVisualConfigs[i].bufferSize = -1; - - lclVisualConfigs[i].depthSize = depth? 24 : 0; - lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; - lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; - lclVisualConfigs[i].level = 0; - lclVisualConfigs[i].visualRating = GLX_NONE_EXT; - lclVisualConfigs[i].transparentPixel = 0; - lclVisualConfigs[i].transparentRed = 0; - lclVisualConfigs[i].transparentGreen = 0; - lclVisualConfigs[i].transparentBlue = 0; - lclVisualConfigs[i].transparentAlpha = 0; - lclVisualConfigs[i].transparentIndex = 0; - i++; - } - } - } - } - } - } - if (i != lclNumConfigs) - GLWIN_DEBUG_MSG("glWinInitVisualConfigs failed to alloc visual configs"); - - GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates); -} - -/* Copied from Mesa */ -static void glWinSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - GLWIN_DEBUG_MSG("glWinSetVisualConfigs\n"); - - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -/* Copied from Mesa */ -static Bool glWinInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB) -{ - glWinInitDebugSettings(); - - GLWIN_DEBUG_MSG("glWinInitVisuals\n"); - - if (0 == numConfigs) /* if no configs */ - glWinInitVisualConfigs(); /* ensure the visula configs are setup */ - - /* - * Setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} -- cgit v1.2.3 From e399356ed17baf7b50da393a3f13682b01bd14a9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 2 Feb 2015 15:04:01 +0100 Subject: drop .original files from the current code base --- nx-X11/CHANGELOG.NX.original | 1085 ----- nx-X11/CHANGELOG.X.original | 0 nx-X11/WSDrawBuffer.h.X.original | 0 nx-X11/include/Xpoll.h.in.NX.original | 299 -- nx-X11/include/Xpoll.h.in.X.original | 255 - nx-X11/include/extensions/XKBsrv.h.NX.original | 1192 ----- nx-X11/include/extensions/XKBsrv.h.X.original | 1187 ----- nx-X11/lib/X11/ChkIfEv.c.NX.original | 138 - nx-X11/lib/X11/ChkIfEv.c.X.original | 85 - nx-X11/lib/X11/ConnDis.c.NX.original | 1465 ------ nx-X11/lib/X11/ConnDis.c.X.original | 1233 ----- nx-X11/lib/X11/IfEvent.c.NX.original | 80 - nx-X11/lib/X11/IfEvent.c.X.original | 75 - nx-X11/lib/X11/Imakefile.NX.original | 1237 ----- nx-X11/lib/X11/Imakefile.X.original | 1134 ----- nx-X11/lib/X11/MaskEvent.c.NX.original | 84 - nx-X11/lib/X11/MaskEvent.c.X.original | 79 - nx-X11/lib/X11/OpenDis.c.NX.original | 911 ---- nx-X11/lib/X11/OpenDis.c.X.original | 869 ---- nx-X11/lib/X11/PeekIfEv.c.NX.original | 81 - nx-X11/lib/X11/PeekIfEv.c.X.original | 76 - nx-X11/lib/X11/Pending.c.NX.original | 69 - nx-X11/lib/X11/Pending.c.X.original | 60 - nx-X11/lib/X11/XKBMAlloc.c.NX.original | 1023 ---- nx-X11/lib/X11/XKBMAlloc.c.X.original | 994 ---- nx-X11/lib/X11/Xlib.h.NX.original | 4029 ---------------- nx-X11/lib/X11/Xlib.h.X.original | 4008 ---------------- nx-X11/lib/X11/XlibAsync.c.NX.original | 181 - nx-X11/lib/X11/XlibAsync.c.X.original | 156 - nx-X11/lib/X11/XlibInt.c.NX.original | 4167 ---------------- nx-X11/lib/X11/XlibInt.c.X.original | 3429 ------------- nx-X11/lib/X11/Xlibint.h.NX.original | 1346 ------ nx-X11/lib/X11/Xlibint.h.X.original | 1313 ----- nx-X11/lib/X11/cmsProp.c.X.original | 148 - nx-X11/lib/Xau/AuRead.c.NX.original | 137 - nx-X11/lib/Xau/AuRead.c.X.original | 111 - nx-X11/lib/Xpm/Imakefile.NX.original | 126 - nx-X11/lib/Xpm/Imakefile.X.original | 122 - nx-X11/lib/Xrender/Glyph.c.NX.original | 1169 ----- nx-X11/lib/Xrender/Glyph.c.X.original | 712 --- nx-X11/lib/Xrender/Xrender.h.NX.original | 544 --- nx-X11/lib/Xrender/Xrender.h.X.original | 528 -- nx-X11/lib/font/fontfile/encparse.c.NX.original | 966 ---- nx-X11/lib/font/fontfile/encparse.c.X.original | 963 ---- nx-X11/lib/xtrans/Xtranssock.c.NX.original | 3417 ------------- nx-X11/lib/xtrans/Xtranssock.c.X.original | 2504 ---------- nx-X11/programs/Imakefile.NX.original | 178 - nx-X11/programs/Imakefile.X.original | 158 - .../programs/Xserver/GL/glx/render2.c.NX.original | 271 -- .../programs/Xserver/GL/glx/render2.c.X.original | 271 -- .../Xserver/GL/glx/render2swap.c.NX.original | 393 -- .../Xserver/GL/glx/render2swap.c.X.original | 393 -- .../Xserver/GL/mesa/X/Imakefile.NX.original | 93 - .../Xserver/GL/mesa/X/Imakefile.X.original | 93 - .../Xserver/GL/mesa/X/xf86glx.c.NX.original | 952 ---- .../Xserver/GL/mesa/X/xf86glx.c.X.original | 914 ---- .../Xserver/GL/mesa/main/Imakefile.NX.original | 61 - .../Xserver/GL/mesa/main/Imakefile.X.original | 61 - nx-X11/programs/Xserver/Imakefile.NX.original | 1579 ------ nx-X11/programs/Xserver/Imakefile.X.original | 1242 ----- nx-X11/programs/Xserver/Xext/Imakefile.NX.original | 226 - nx-X11/programs/Xserver/Xext/Imakefile.X.original | 200 - .../programs/Xserver/Xext/security.c.NX.original | 2245 --------- nx-X11/programs/Xserver/Xext/security.c.X.original | 2008 -------- nx-X11/programs/Xserver/dix/dixfonts.c.NX.original | 2215 --------- nx-X11/programs/Xserver/dix/dixfonts.c.X.original | 2150 --------- nx-X11/programs/Xserver/dix/pixmap.c.NX.original | 152 - nx-X11/programs/Xserver/dix/pixmap.c.X.original | 145 - nx-X11/programs/Xserver/fb/Imakefile.NX.original | 194 - nx-X11/programs/Xserver/fb/Imakefile.X.original | 188 - nx-X11/programs/Xserver/fb/fbtrap.c.NX.original | 242 - nx-X11/programs/Xserver/fb/fbtrap.c.X.original | 239 - .../Xserver/hw/nxagent/NXdispatch.c.NX.original | 4716 ------------------ .../Xserver/hw/nxagent/NXdispatch.c.XF86.original | 4110 ---------------- .../Xserver/hw/nxagent/NXdixfonts.c.NX.original | 2883 ----------- .../Xserver/hw/nxagent/NXdixfonts.c.XF86.original | 2223 --------- .../Xserver/hw/nxagent/NXevents.c.NX.original | 4797 ------------------- .../Xserver/hw/nxagent/NXevents.c.XF86.original | 4637 ------------------ .../Xserver/hw/nxagent/NXextension.c.NX.original | 528 -- .../Xserver/hw/nxagent/NXextension.c.XF86.original | 486 -- .../Xserver/hw/nxagent/NXglxext.c.NX.original | 550 --- .../Xserver/hw/nxagent/NXglxext.c.XF86.original | 489 -- .../Xserver/hw/nxagent/NXglyph.c.NX.original | 511 -- .../Xserver/hw/nxagent/NXglyph.c.XF86.original | 416 -- .../Xserver/hw/nxagent/NXglyphcurs.c.NX.original | 252 - .../Xserver/hw/nxagent/NXglyphcurs.c.XF86.original | 197 - .../Xserver/hw/nxagent/NXglyphstr.h.NX.original | 161 - .../Xserver/hw/nxagent/NXglyphstr.h.XF86.original | 127 - .../Xserver/hw/nxagent/NXmiexpose.c.NX.original | 938 ---- .../Xserver/hw/nxagent/NXmiexpose.c.XF86.original | 873 ---- .../Xserver/hw/nxagent/NXmiglyph.c.NX.original | 322 -- .../Xserver/hw/nxagent/NXmiglyph.c.XF86.original | 239 - .../Xserver/hw/nxagent/NXmitrap.c.NX.original | 204 - .../Xserver/hw/nxagent/NXmitrap.c.XF86.original | 196 - .../Xserver/hw/nxagent/NXmiwindow.c.NX.original | 1205 ----- .../Xserver/hw/nxagent/NXmiwindow.c.XF86.original | 1176 ----- .../Xserver/hw/nxagent/NXpicture.c.NX.original | 1512 ------ .../Xserver/hw/nxagent/NXpicture.c.XF86.original | 1305 ----- .../Xserver/hw/nxagent/NXpicturestr.h.NX.original | 533 --- .../hw/nxagent/NXpicturestr.h.XF86.original | 501 -- .../Xserver/hw/nxagent/NXproperty.c.NX.original | 921 ---- .../Xserver/hw/nxagent/NXproperty.c.XF86.original | 736 --- .../Xserver/hw/nxagent/NXrender.c.NX.original | 3048 ------------ .../Xserver/hw/nxagent/NXrender.c.XF86.original | 2584 ---------- .../Xserver/hw/nxagent/NXresource.c.NX.original | 1103 ----- .../Xserver/hw/nxagent/NXresource.c.XF86.original | 975 ---- .../Xserver/hw/nxagent/NXshm.c.NX.original | 1425 ------ .../Xserver/hw/nxagent/NXshm.c.XF86.original | 1257 ----- .../Xserver/hw/nxagent/NXwindow.c.NX.original | 4179 ---------------- .../Xserver/hw/nxagent/NXwindow.c.XF86.original | 3947 --------------- .../Xserver/hw/nxagent/NXxvdisp.c.NX.original | 2277 --------- .../Xserver/hw/nxagent/NXxvdisp.c.XF86.original | 2214 --------- .../Xserver/hw/nxagent/X/NXdamage.c.NX.original | 2073 -------- .../Xserver/hw/nxagent/X/NXdamage.c.X.original | 1966 -------- .../Xserver/hw/nxagent/X/NXdispatch.c.NX.original | 4679 ------------------ .../Xserver/hw/nxagent/X/NXdispatch.c.X.original | 4035 ---------------- .../Xserver/hw/nxagent/X/NXdixfonts.c.NX.original | 2804 ----------- .../Xserver/hw/nxagent/X/NXdixfonts.c.X.original | 2150 --------- .../Xserver/hw/nxagent/X/NXevents.c.NX.original | 5044 -------------------- .../Xserver/hw/nxagent/X/NXevents.c.X.original | 4670 ------------------ .../Xserver/hw/nxagent/X/NXextension.c.NX.original | 508 -- .../Xserver/hw/nxagent/X/NXextension.c.X.original | 474 -- .../Xserver/hw/nxagent/X/NXglxext.c.NX.original | 575 --- .../Xserver/hw/nxagent/X/NXglxext.c.X.original | 505 -- .../Xserver/hw/nxagent/X/NXglyph.c.NX.original | 581 --- .../Xserver/hw/nxagent/X/NXglyph.c.X.original | 488 -- .../Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original | 241 - .../Xserver/hw/nxagent/X/NXglyphcurs.c.X.original | 194 - .../Xserver/hw/nxagent/X/NXglyphstr.h.NX.original | 174 - .../Xserver/hw/nxagent/X/NXglyphstr.h.X.original | 148 - .../Xserver/hw/nxagent/X/NXmiexpose.c.NX.original | 979 ---- .../Xserver/hw/nxagent/X/NXmiexpose.c.X.original | 905 ---- .../Xserver/hw/nxagent/X/NXmiglyph.c.NX.original | 318 -- .../Xserver/hw/nxagent/X/NXmiglyph.c.X.original | 243 - .../Xserver/hw/nxagent/X/NXmitrap.c.NX.original | 233 - .../Xserver/hw/nxagent/X/NXmitrap.c.X.original | 190 - .../Xserver/hw/nxagent/X/NXmiwindow.c.NX.original | 1222 ----- .../Xserver/hw/nxagent/X/NXmiwindow.c.X.original | 1184 ----- .../Xserver/hw/nxagent/X/NXpicture.c.NX.original | 2270 --------- .../Xserver/hw/nxagent/X/NXpicture.c.X.original | 1864 -------- .../hw/nxagent/X/NXpicturestr.h.NX.original | 678 --- .../Xserver/hw/nxagent/X/NXpicturestr.h.X.original | 654 --- .../Xserver/hw/nxagent/X/NXproperty.c.NX.original | 992 ---- .../Xserver/hw/nxagent/X/NXproperty.c.X.original | 729 --- .../Xserver/hw/nxagent/X/NXrender.c.NX.original | 3861 --------------- .../Xserver/hw/nxagent/X/NXrender.c.X.original | 3316 ------------- .../Xserver/hw/nxagent/X/NXresource.c.NX.original | 1250 ----- .../Xserver/hw/nxagent/X/NXresource.c.X.original | 954 ---- .../Xserver/hw/nxagent/X/NXshm.c.NX.original | 1498 ------ .../Xserver/hw/nxagent/X/NXshm.c.X.original | 1310 ----- .../Xserver/hw/nxagent/X/NXwindow.c.NX.original | 4167 ---------------- .../Xserver/hw/nxagent/X/NXwindow.c.X.original | 3853 --------------- .../Xserver/hw/nxagent/X/NXxvdisp.c.NX.original | 2286 --------- .../Xserver/hw/nxagent/X/NXxvdisp.c.X.original | 2217 --------- .../Xserver/include/dixstruct.h.NX.original | 236 - .../Xserver/include/dixstruct.h.X.original | 233 - nx-X11/programs/Xserver/mi/Imakefile.NX.original | 128 - nx-X11/programs/Xserver/mi/Imakefile.X.original | 94 - nx-X11/programs/Xserver/os/Imakefile.NX.original | 235 - nx-X11/programs/Xserver/os/Imakefile.X.original | 200 - nx-X11/programs/Xserver/os/WaitFor.c.NX.original | 882 ---- nx-X11/programs/Xserver/os/WaitFor.c.X.original | 701 --- nx-X11/programs/Xserver/os/auth.c.NX.original | 608 --- nx-X11/programs/Xserver/os/auth.c.X.original | 400 -- .../programs/Xserver/os/connection.c.NX.original | 1424 ------ nx-X11/programs/Xserver/os/connection.c.X.original | 1385 ------ nx-X11/programs/Xserver/os/log.c.NX.original | 716 --- nx-X11/programs/Xserver/os/log.c.X.original | 633 --- nx-X11/programs/Xserver/os/oscolor.c.NX.original | 483 -- nx-X11/programs/Xserver/os/oscolor.c.X.original | 303 -- nx-X11/programs/Xserver/os/utils.c.NX.original | 2440 ---------- nx-X11/programs/Xserver/os/utils.c.X.original | 2296 --------- nx-X11/programs/Xserver/os/xdmcp.c.NX.original | 1710 ------- nx-X11/programs/Xserver/os/xdmcp.c.X.original | 1681 ------- nx-X11/programs/Xserver/os/xprintf.c.NX.original | 163 - nx-X11/programs/Xserver/os/xprintf.c.X.original | 104 - nx-X11/programs/Xserver/randr.X.original/Imakefile | 18 - nx-X11/programs/Xserver/randr.X.original/mirandr.c | 102 - nx-X11/programs/Xserver/randr.X.original/randr.c | 1319 ----- .../programs/Xserver/randr.X.original/randrstr.h | 142 - .../programs/Xserver/randr/Imakefile.NX.original | 36 - nx-X11/programs/Xserver/randr/Imakefile.X.original | 0 .../Xserver/randr/panoramiXproto.h.NX.original | 192 - .../Xserver/randr/panoramiXproto.h.X.original | 0 nx-X11/programs/Xserver/randr/randr.c.NX.original | 521 -- nx-X11/programs/Xserver/randr/randr.c.X.original | 487 -- nx-X11/programs/Xserver/randr/randr.h.NX.original | 141 - nx-X11/programs/Xserver/randr/randr.h.X.original | 0 .../Xserver/randr/randrproto.h.NX.original | 655 --- .../programs/Xserver/randr/randrproto.h.X.original | 0 .../programs/Xserver/randr/registry.h.NX.original | 64 - .../programs/Xserver/randr/registry.h.X.original | 0 nx-X11/programs/Xserver/randr/rrcrtc.c.NX.original | 984 ---- nx-X11/programs/Xserver/randr/rrcrtc.c.X.original | 960 ---- .../programs/Xserver/randr/rrdispatch.c.X.original | 214 - nx-X11/programs/Xserver/randr/rrmode.c.NX.original | 420 -- nx-X11/programs/Xserver/randr/rrmode.c.X.original | 398 -- .../programs/Xserver/randr/rrscreen.c.NX.original | 1030 ---- .../programs/Xserver/randr/rrscreen.c.X.original | 981 ---- .../Xserver/randr/rrxinerama.c.NX.original | 490 -- .../programs/Xserver/randr/rrxinerama.c.X.original | 454 -- .../Xserver/render/renderedge.c.NX.original | 202 - .../Xserver/render/renderedge.c.X.original | 201 - .../programs/Xserver/xfixes/cursor.c.NX.original | 754 --- nx-X11/programs/Xserver/xfixes/cursor.c.X.original | 753 --- .../programs/Xserver/xfixes/select.c.NX.original | 281 -- nx-X11/programs/Xserver/xfixes/select.c.X.original | 279 -- nx-X11/programs/Xserver/xkb/Imakefile.NX.original | 106 - nx-X11/programs/Xserver/xkb/Imakefile.X.original | 102 - .../programs/Xserver/xkb/ddxKillSrv.c.NX.original | 69 - .../programs/Xserver/xkb/ddxKillSrv.c.X.original | 61 - nx-X11/programs/Xserver/xkb/ddxLoad.c.NX.original | 970 ---- nx-X11/programs/Xserver/xkb/ddxLoad.c.X.original | 604 --- nx-X11/programs/Xserver/xkb/xkbDflts.h.NX.original | 524 -- nx-X11/programs/Xserver/xkb/xkbDflts.h.X.original | 513 -- 215 files changed, 221967 deletions(-) delete mode 100644 nx-X11/CHANGELOG.NX.original delete mode 100644 nx-X11/CHANGELOG.X.original delete mode 100644 nx-X11/WSDrawBuffer.h.X.original delete mode 100644 nx-X11/include/Xpoll.h.in.NX.original delete mode 100644 nx-X11/include/Xpoll.h.in.X.original delete mode 100644 nx-X11/include/extensions/XKBsrv.h.NX.original delete mode 100644 nx-X11/include/extensions/XKBsrv.h.X.original delete mode 100644 nx-X11/lib/X11/ChkIfEv.c.NX.original delete mode 100644 nx-X11/lib/X11/ChkIfEv.c.X.original delete mode 100644 nx-X11/lib/X11/ConnDis.c.NX.original delete mode 100644 nx-X11/lib/X11/ConnDis.c.X.original delete mode 100644 nx-X11/lib/X11/IfEvent.c.NX.original delete mode 100644 nx-X11/lib/X11/IfEvent.c.X.original delete mode 100644 nx-X11/lib/X11/Imakefile.NX.original delete mode 100644 nx-X11/lib/X11/Imakefile.X.original delete mode 100644 nx-X11/lib/X11/MaskEvent.c.NX.original delete mode 100644 nx-X11/lib/X11/MaskEvent.c.X.original delete mode 100644 nx-X11/lib/X11/OpenDis.c.NX.original delete mode 100644 nx-X11/lib/X11/OpenDis.c.X.original delete mode 100644 nx-X11/lib/X11/PeekIfEv.c.NX.original delete mode 100644 nx-X11/lib/X11/PeekIfEv.c.X.original delete mode 100644 nx-X11/lib/X11/Pending.c.NX.original delete mode 100644 nx-X11/lib/X11/Pending.c.X.original delete mode 100644 nx-X11/lib/X11/XKBMAlloc.c.NX.original delete mode 100644 nx-X11/lib/X11/XKBMAlloc.c.X.original delete mode 100644 nx-X11/lib/X11/Xlib.h.NX.original delete mode 100644 nx-X11/lib/X11/Xlib.h.X.original delete mode 100644 nx-X11/lib/X11/XlibAsync.c.NX.original delete mode 100644 nx-X11/lib/X11/XlibAsync.c.X.original delete mode 100644 nx-X11/lib/X11/XlibInt.c.NX.original delete mode 100644 nx-X11/lib/X11/XlibInt.c.X.original delete mode 100644 nx-X11/lib/X11/Xlibint.h.NX.original delete mode 100644 nx-X11/lib/X11/Xlibint.h.X.original delete mode 100644 nx-X11/lib/X11/cmsProp.c.X.original delete mode 100644 nx-X11/lib/Xau/AuRead.c.NX.original delete mode 100644 nx-X11/lib/Xau/AuRead.c.X.original delete mode 100644 nx-X11/lib/Xpm/Imakefile.NX.original delete mode 100644 nx-X11/lib/Xpm/Imakefile.X.original delete mode 100644 nx-X11/lib/Xrender/Glyph.c.NX.original delete mode 100644 nx-X11/lib/Xrender/Glyph.c.X.original delete mode 100644 nx-X11/lib/Xrender/Xrender.h.NX.original delete mode 100644 nx-X11/lib/Xrender/Xrender.h.X.original delete mode 100644 nx-X11/lib/font/fontfile/encparse.c.NX.original delete mode 100644 nx-X11/lib/font/fontfile/encparse.c.X.original delete mode 100644 nx-X11/lib/xtrans/Xtranssock.c.NX.original delete mode 100644 nx-X11/lib/xtrans/Xtranssock.c.X.original delete mode 100644 nx-X11/programs/Imakefile.NX.original delete mode 100644 nx-X11/programs/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/GL/glx/render2.c.NX.original delete mode 100644 nx-X11/programs/Xserver/GL/glx/render2.c.X.original delete mode 100644 nx-X11/programs/Xserver/GL/glx/render2swap.c.NX.original delete mode 100644 nx-X11/programs/Xserver/GL/glx/render2swap.c.X.original delete mode 100644 nx-X11/programs/Xserver/GL/mesa/X/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/GL/mesa/X/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.NX.original delete mode 100644 nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.X.original delete mode 100644 nx-X11/programs/Xserver/GL/mesa/main/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/GL/mesa/main/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/Xext/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/Xext/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/Xext/security.c.NX.original delete mode 100644 nx-X11/programs/Xserver/Xext/security.c.X.original delete mode 100644 nx-X11/programs/Xserver/dix/dixfonts.c.NX.original delete mode 100644 nx-X11/programs/Xserver/dix/dixfonts.c.X.original delete mode 100644 nx-X11/programs/Xserver/dix/pixmap.c.NX.original delete mode 100644 nx-X11/programs/Xserver/dix/pixmap.c.X.original delete mode 100644 nx-X11/programs/Xserver/fb/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/fb/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/fb/fbtrap.c.NX.original delete mode 100644 nx-X11/programs/Xserver/fb/fbtrap.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXevents.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXextension.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXglxext.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXglxext.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXrender.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXresource.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXresource.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXshm.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXshm.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.X.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.X.original delete mode 100644 nx-X11/programs/Xserver/include/dixstruct.h.NX.original delete mode 100644 nx-X11/programs/Xserver/include/dixstruct.h.X.original delete mode 100644 nx-X11/programs/Xserver/mi/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/mi/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/os/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/os/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/os/WaitFor.c.NX.original delete mode 100644 nx-X11/programs/Xserver/os/WaitFor.c.X.original delete mode 100644 nx-X11/programs/Xserver/os/auth.c.NX.original delete mode 100644 nx-X11/programs/Xserver/os/auth.c.X.original delete mode 100644 nx-X11/programs/Xserver/os/connection.c.NX.original delete mode 100644 nx-X11/programs/Xserver/os/connection.c.X.original delete mode 100644 nx-X11/programs/Xserver/os/log.c.NX.original delete mode 100644 nx-X11/programs/Xserver/os/log.c.X.original delete mode 100644 nx-X11/programs/Xserver/os/oscolor.c.NX.original delete mode 100644 nx-X11/programs/Xserver/os/oscolor.c.X.original delete mode 100644 nx-X11/programs/Xserver/os/utils.c.NX.original delete mode 100644 nx-X11/programs/Xserver/os/utils.c.X.original delete mode 100644 nx-X11/programs/Xserver/os/xdmcp.c.NX.original delete mode 100644 nx-X11/programs/Xserver/os/xdmcp.c.X.original delete mode 100644 nx-X11/programs/Xserver/os/xprintf.c.NX.original delete mode 100644 nx-X11/programs/Xserver/os/xprintf.c.X.original delete mode 100644 nx-X11/programs/Xserver/randr.X.original/Imakefile delete mode 100644 nx-X11/programs/Xserver/randr.X.original/mirandr.c delete mode 100644 nx-X11/programs/Xserver/randr.X.original/randr.c delete mode 100644 nx-X11/programs/Xserver/randr.X.original/randrstr.h delete mode 100644 nx-X11/programs/Xserver/randr/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/randr/panoramiXproto.h.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/panoramiXproto.h.X.original delete mode 100644 nx-X11/programs/Xserver/randr/randr.c.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/randr.c.X.original delete mode 100644 nx-X11/programs/Xserver/randr/randr.h.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/randr.h.X.original delete mode 100644 nx-X11/programs/Xserver/randr/randrproto.h.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/randrproto.h.X.original delete mode 100644 nx-X11/programs/Xserver/randr/registry.h.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/registry.h.X.original delete mode 100644 nx-X11/programs/Xserver/randr/rrcrtc.c.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/rrcrtc.c.X.original delete mode 100644 nx-X11/programs/Xserver/randr/rrdispatch.c.X.original delete mode 100644 nx-X11/programs/Xserver/randr/rrmode.c.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/rrmode.c.X.original delete mode 100644 nx-X11/programs/Xserver/randr/rrscreen.c.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/rrscreen.c.X.original delete mode 100644 nx-X11/programs/Xserver/randr/rrxinerama.c.NX.original delete mode 100644 nx-X11/programs/Xserver/randr/rrxinerama.c.X.original delete mode 100644 nx-X11/programs/Xserver/render/renderedge.c.NX.original delete mode 100644 nx-X11/programs/Xserver/render/renderedge.c.X.original delete mode 100755 nx-X11/programs/Xserver/xfixes/cursor.c.NX.original delete mode 100755 nx-X11/programs/Xserver/xfixes/cursor.c.X.original delete mode 100755 nx-X11/programs/Xserver/xfixes/select.c.NX.original delete mode 100755 nx-X11/programs/Xserver/xfixes/select.c.X.original delete mode 100644 nx-X11/programs/Xserver/xkb/Imakefile.NX.original delete mode 100644 nx-X11/programs/Xserver/xkb/Imakefile.X.original delete mode 100644 nx-X11/programs/Xserver/xkb/ddxKillSrv.c.NX.original delete mode 100644 nx-X11/programs/Xserver/xkb/ddxKillSrv.c.X.original delete mode 100644 nx-X11/programs/Xserver/xkb/ddxLoad.c.NX.original delete mode 100644 nx-X11/programs/Xserver/xkb/ddxLoad.c.X.original delete mode 100644 nx-X11/programs/Xserver/xkb/xkbDflts.h.NX.original delete mode 100644 nx-X11/programs/Xserver/xkb/xkbDflts.h.X.original (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/CHANGELOG.NX.original b/nx-X11/CHANGELOG.NX.original deleted file mode 100644 index ffbbe0a61..000000000 --- a/nx-X11/CHANGELOG.NX.original +++ /dev/null @@ -1,1085 +0,0 @@ -ChangeLog: - -nx-X11-3.5.0-2 - -- Fixed TR0202420. XKB utility functions wrote out of bounds. - -- Upgraded RandR server extension to version 1.2. - -nx-X11-3.5.0-1 - -- Opened the 3.5.0 branch based on nx-X11-3.4.0-4. - -- Updated copyright to year 2011. - -nx-X11-3.4.0-4 - -- Fixed TR06H02359. Removed compiler warnings. - -nx-X11-3.4.0-3 - -- Updated copyright to year 2010. - -nx-X11-3.4.0-2 - -- Fixed TR04G02208. Added a path to rgb file. - -nx-X11-3.4.0-1 - -- Opened the 3.4.0 branch based on nx-X11-3.3.0-7. - -- Updated copyright to year 2009. - -nx-X11-3.3.0-7 - -- Fixed TR08G02257. The maximum client condition was reached because - available fd exhausted. This bug was caused by a function in font - library not closing the file before a return on error breaking the - flow of normal execution. - -- Fixed TR06G02225. The implementation of Xvprintf() has been reviewed - to work on more platforms. Previous implementation caused a failure - in the build of keyboard map on some platform like Solaris 8 and 9. - -nx-X11-3.3.0-6 - -- Fixed TR03G02198. Reimplemented Xvprintf() in Xserver/os to handle - the case in which vsnprintf returned -1. - -- Returning from _XSeqSyncFunction() and _XReply() if an I/O error is - detected. - -nx-X11-3.3.0-5 - -- Fixed TR01G02163. Signals need to be blocked before the call to - fork() in the Popen() utility. - -- Fixed TR01G02164. Trapezoid data need to be validated before use. - This issue was the same of CVE-2007-2437. - -nx-X11-3.3.0-4 - -- Enabled the code resetting the Xlib buffer if an IO error occured. - -nx-X11-3.3.0-3 - -- Fixed the search path for the XKB base directory. - -nx-X11-3.3.0-2 - -- Fixed TR10F02116. The X11 agent could enter an indefinite wait state - if connection to X display is broken and libX11 output buffer is not - empty. - -nx-X11-3.3.0-1 - -- Opened the 3.3.0 branch based on nx-X11-3.2.0-2. - -nx-X11-3.2.0-2 - -- Imported patch fixing issues from X.Org security advisory, June - 11th, 2008: Multiple vulnerabilities in X server extensions. CVE - IDs: CVE-2008-1377, CVE-2008-1379, CVE-2008-2360, CVE-2008-2361, - CVE-2008-2362. - -nx-X11-3.2.0-1 - -- Opened the 3.2.0 branch based on nx-X11-3.1.0-6. - -nx-X11-3.1.0-6 - -- Modified Xserver Imakefile to link the Xfixes library. - -nx-X11-3.1.0-5 - -- Disabled the terminate action, just in case the TerminateServer - symbol is binded to a non default key sequence. - -nx-X11-3.1.0-4 - -- Imported patch fixing issues from X.Org security advisory, January - 17th, 2008: Multiple vulnerabilities in the X server. CVE IDs: - CVE-2007-5760 CVE-2007-5958 CVE-2007-6427 CVE-2007-6428 - CVE-2007-6429 CVE-2008-0006. - -nx-X11-3.1.0-3 - -- Moved a variable definition placed in _mesa_make_current(). - -nx-X11-3.1.0-2 - -- Fixed TR10E01924. A crash could occur in _mesa_make_current(). - -- Initialized after_ret variable in _XcmsGetProperty(). - -nx-X11-3.1.0-1 - -- Opened the 3.1.0 branch based on nx-X11-3.0.0-37. - -nx-X11-3.0.0-37 - -- Changed the Xserver Imakefile to link against Xcomposite on the - Cygwin platform too. - -nx-X11-3.0.0-36 - -- Fixed TR07E01806. Modified host.def to build GLX code with symbol - __GLX_ALIGN64 defined on Solaris platform. - -nx-X11-3.0.0-35 - -- Flush explicitly the NX link before entering the select() in the - WaitForReadable() and WaitForWritable() routines. - -nx-X11-3.0.0-34 - -- Changed the agent Imakefile to link to the Xcomposite library. - -nx-X11-3.0.0-33 - -- Fix the NX_TRANS_WAKEUP stuff in WaitForSomething() to not over- - ride a valid timeout. - -- Check if the requesting client is gone in the XFixes functions - sending the cursor events. - -nx-X11-3.0.0-32 - -- Define DDXOSVERRORF and DDXOSFATALERROR symbols on Sun. - -- Changed the copyright attribution from Medialogic to NoMachine. - -nx-X11-3.0.0-31 - -- Make SmartScheduleStopTimer() visible outside Xserver/os/utils.c - so that it can be called by the agent. Export the declaration in - dixstruct.h. - -nx-X11-3.0.0-30 - -- The OsVendorVErrorFFatal flag is set to 1 if the function pointed - by OsVendorVErrorFProc is called due to a fatal error. - -- Give the possibility to the agent to redirect the standard error - during a Popen() or a System() by setting the OsVendorStartRedir- - ectErrorFProc and OsVendorEndRedirectErrorFProc function pointers. - -nx-X11-3.0.0-29 - -- Changed the default message printed on a fatal server error. The - new message is: - - Error: Aborting session with 'Error text...'. - -- Hacked LogVWrite() to force all fatal error messages to have an - uppercase initial. Also remove the trailing newline and the full- - stop, if present. - -nx-X11-3.0.0-28 - -- Corrected the typos in the ChangeLog. - -nx-X11-3.0.0-27 - -- Fixed the cleanup of the X_RenderCompositeText16 padding bytes. - -- More code cleanup in the NX changes to the Xrender library. - -- Changed host.def to build the freetype and fontconfig libraries - if the agent server is also built. Freetype is built as a shared - library: this avoids the link error on 64 bit platforms. - -nx-X11-3.0.0-26 - -- Applied the following security patches, from the X.Org security - advisory, April 3rd, 2007 "Multiple vulnerability in X server, - libXfont and libX11": - - xorg-xserver-1.2.0-xcmisc.diff - xorg-libXfont-1.2.7-bdf-fontdir.diff - xorg-libX11-1.1.1-xinitimage.diff - -nx-X11-3.0.0-25 - -- Added the missing *.X.original file for ChkIfEv.c and Xlib.h. - -nx-X11-3.0.0-24 - -- Changed Xrender to clean up the padding bytes in XRenderComposite- - Text functions. - -- Added function XRenderCleanGlyphs() cleaning the padding bytes in - the data section of RenderAddGlyphs requests. - -nx-X11-3.0.0-23 - -- Removed the additional parameter from the call to NXTransFlush() - in _XReply(). - -- Call NXTransExit() on AbortServer() (called by FatalError()) to - give the proxy a chance to shut down the NX transport. - -nx-X11-3.0.0-22 - -- Moved the replacement of XCheckIfEvent() ChkIfEv.c with the name - XCheckIfEventNoFlush(). - -nx-X11-3.0.0-21 - -- Set BUFSIZE to 8192 bytes. While the output buffer size can be - configured by setting the XLIBBUFFERSIZE in the environment (see - OpenDis.c), this constant is still used when reading from the - socket. - -nx-X11-3.0.0-20 - -- If set, the handler pointed by _NXDisplayWriteFunction is called - after that more data is written to the display connection. - -nx-X11-3.0.0-19 - -- Added a RejectWellKnownSockets() stub to make possible to compile - the agent when the NX transport is disabled. - -- Added more useful logs to _XWaitForWritable(). - -nx-X11-3.0.0-18 - -- Changed Imakefile of X11 and Xserver in order to build nxcompshad - just before the NX agent server. - -- Changed Imakefile in Xserver to add NXdamage.o to NXAGENTOBJS. - -nx-X11-3.0.0-17 - -- Changed host.def in order to build Xdamage and Xrandr libraries. - -- Changed host.def in order not to build NXWin. - -nx-X11-3.0.0-16 - -- Changed host.def in order to build Xtst as a shared library. - -nx-X11-3.0.0-15 - -- Changes to comply with nxcompshad library. - -- Changed configuration to statically build Xtst library. - -- Restored parser directory under Xserver/hw/xfree86. - -nx-X11-3.0.0-14 - -- Changed the LICENSE file to state that the software is only made - available under the version 2 of the GPL. - -- Added file COPYING. - -- In nx-X11/programs and nx-X11/programs/Xserver/hw/xfree86, removed - files and directories not needed to build servers. - -nx-X11-3.0.0-13 - -- Changes aimed to link servers with static versions of Xdmcp and Xau - libraries. - -nx-X11-3.0.0-12 - -- Added references to implented FR in the ChangeLog. - -- Removed nx-X11/fonts and nx-X11/doc directories. They are not needed - for building the NX components. - -nx-X11-3.0.0-11 - -- Updated the copyright notices to year 2007. - -nx-X11-3.0.0-10 - -- Applied the following security patches: - - x11r6.9.0-cidfonts.diff - x11r6.9.0-dbe-render.diff - x11r6.9.0-geteuid.diff - x11r6.9.0-mitri.diff - x11r6.9.0-setuid.diff - -nx-X11-3.0.0-9 - -- Merged the NX changes to X11 with the X11R6.9.0 version of X.org. - -nx-X11-3.0.0-8 - -- Changes to build Xshadow library when building X11. - -- Changes to Xserver Imakefile to link Xshadow library. - -- Changes to host.def in order to build on old distributions. - -nx-X11-3.0.0-7 - -- Imported changes up to nx-X11-2.1.0-2 - -- Fixed TR08D01485. Updated rgb file paths validation in order to - support Ubuntu distribution. - -- Added Xtst to libraries to be linked by nxagent. - -- Changed Xpm Imakefile to build a shared library on Solaris. - -- Fixed build error on Solaris in xtrans. - -- Changed host.def not to build Xnest server. - -- Changed Xserver Imakefile to link nxaccess library. - -nx-X11-3.0.0-6 - -- Added the path of nxaccess library to the server link command. - -nx-X11-3.0.0-5 - -- Implemented FR10C01079 and FR10C01080. The merge of NX changes to - the X.org code is complete. - -- Merged changes in config/cf. The NX-*.def files have been dismissed. - Main platform dependent configurations have been moved to host.def. - -- Removed *.reference files from config/cf. - -- Fixed compilation for Cygwin platform. - -nx-X11-3.0.0-4 - -- Imported all changes up to nx-X11-2.0.0-32. - -- Cleaned up lib/zlib directory. - -- Added missing file programs/Xserver/os/utils.c.NX.original. - -- Updated the copyright notice to year 2006. - -- The pointer to the display buffer is reset after an I/O error. - This prevents leaving the buffer in an inconsistent state if the - error occurs inside _XFlush(). - -- Removed the modifications to the Xrender library. The cleanup of - the padding bytes is now performed by the NX transport. - -- NX uses the updated ZLIB from its build tree, so Imake.tmpl will - now assume that the platform as ZLIB unless otherwise stated. - -- The path of the SecurityPolicy file is searched and validated at - runtime. - -- Added the _X11TransSocketProxyConnInfo() function to Xtranssock.c - It returns the pointer to the XtransConnInfo private, if it is a - valid _NXProxyConnInfo structure. - -- The above function is used by OpenDis.c to detect if the NX trans- - port was requested on the display and avoid spurious error messa- - ges in the case of a connection failure. - -- Added NXmiwindow.o to the NXAGENTOBJS in the Xserver's Imakefile - and imported NXmiwindow.c in nxagent. This allows us to check the - pointer to the pOldClip region in miSetShape() before going on - freeing it. - -- The path of the XKB base directory and of the xkbcomp comand is - validated at runtime. - -- Also added a check to verify the validity of the rgb file path. - -- Added NXresource.o to NXAGENTOBJS in the Imakefile of nxagent. We - need this to a assign a resource to the pixmaps and other server - objects which need to be enumerated at reconnection. Some objects, - being created by the X server and not by the clients, don't pass - through the resource assignment process operated by the dix. To - ensure that all objects get a resource, we add a resource at the - time the object is created and temporarily assign the resource to - the server client. If the dix later assigns the resource to a va- - lid client, the resource is removed from the server client's list. - -- The display block handler registered by the client is called in - WaitForReadable() and WaitForWritable() before every select(), - not only upon entering the function. The reason is that more - data can be possibly produced for the NX link by the proxy it- - self and, when setting the flush policy to deferred, the client - may not have the chance of flushing the NX link. - -- Fixed a bug in XkbUseExtension() that caused Xlib to query the - presence of the XKEYBOARD extension multiple times. This partial- - ly implents the FR01D01275. The complete implementation required - modifications to the X11 agent, implemented in nxagent-2.0.0-33. - -- Updated to comply with the new NXTransFlush() interface. - -- Both nxwin and nxagent now read the X authority file by using an - fopen() instead of the system command 'cat'. - -- Removed NXmiwindow.o from the NXAGENTOBJ list. The agent will now - use the original miwindow.c. - -- Added some additional logs in Xtranssock.c to follow the creation - and removal of the X server's Unix listener. - -- Avoided the sleep of 5 seconds forced by Xtransutil.c if the dir- - ectory where the Unix listener is created is not owned by root. - This sleep is not executed on Cygwin (where the X socket can be - hardly owned by root) but may delay the startup of the agent if - the user chose a different NX_TEMP directory. Furthermore, it is - unclear what real benefits such sleeps are intended to bring to - the security of the X server. This can be controlled by defining - the NX_TRANS_SLEEP directive in Xserver/os/Imakefile. - -- Added NXmiexpose.o to the NXAGENTOBJ. - -- Ensured that _X11TransSocketCloseConnInfo() now initiates the NX - shutdown by calling NXTransClose(). - -- Corrected a misplaced #else that made SocketUNIXConnect() skip a - block if the connection was not to the NX transport. - -- Updated to comply with the new NX function prototypes introduced - in nxcomp-2.0.0-31. - -- Moved the most important Xtranssock.c modifications into separate - functions. - -- Ensured that the modifications enabling the internal connections - to the proxy are compiled only when the TRANS_CLIENT directive is - defined. - -- Solved a bug that prevented the X11 socket to be deleted at the X - server shutdown. This needs further tests. - -- Added nxcompext to the link of nxagent, now that the dependency - of libX11 from nxcompext is removed. - -- Improved the Xtranssock routines to never loop through the array - of connection info. - -- Added a congestion flag to the connection info structure and a - function querying the transport and reporting if a change in the - congestion state has occurred. The code is currently not enabled, - because instead of polling the transport, we let the proxy notify - the changes in congestion state by using the callback. The code - can be used in future to extend the library, for example, by add- - ing some counters tracking the bandwidth usage of the socket con- - nection, so that we can make the congestion notifications work - even with a plain X11 connection. - -- Profiled the routines in XlibInt.c to reduce the number of calls - to the error predicate function provided by the client. - -- Fixed the nxcompext build problem that caused make World to fail. - -- Added a 'CONF' target to the X11 and Xext Imakefiles so that the - configure script is not run if the config.status exists. - -- Added the _NXDisplayBlockHandler hook. The function is called by - Xlib before blocking. The parameter says if Xlib is going to wait - for more input or because it needs to write to the display socket. - The client can use the hook to perform any internal operation that - may require some time to complete. The user, though, should not - try to read or write to the display inside the callback routine. - -- Removed the outdated NX_TRANS_PROCESS, NX_TRANS_THREAD and NX_TR- - ANS_INCLUDE defines. - -- Reverted the lib/Xext Imakefile to the original XF86 version and - moved the build of the nxcompext library among the libX11 depend- - encies. - -- Corrected the lib/X11 Imakefile so that a new build of nxcomp and - nxcompext is not attempted if the libraries are up-to-date. - -- Removed the unused display buffer and image cleanup functions. - -- Reverted the PutImage.c file to the original XF86 version. - -- Added the _NXDisplayErrorPredicate function in XlibInt.c. It is - actually a pointer to a function called whenever Xlib is going to - perform a network operation. If the function returns true, the - call will be aborted and Xlib will return the control to the ap- - plication. It is up to the application to set the XlibDisplayIO- - Error flag after the _NXDisplayErrorPredicate returns true. The - function can be used to activate additional checks, besides the - normal failures detected by Xlib on the display socket. For exam- - ple, the application can set the funciton to verify if an inter- - rupt was received or if any other event occurred mandating the - end of the session. - -- Modified XIfEvent(), XMaskEvent() and XPeekIfEvent() to check the - _NXDisplayErrorPredicate function and return immediately if the - function returns true. - -- Modified _XWaitForReadable() to never enter the loop if the dis- - play is broken. - -- Corrected a make problem on Windows that caused the nxcomp and - nxcompext libraries to be referred with the wrong name, with the - result that a new configure and make was attempted at each build - attempt. - -- Merged all the changes to os, Xext, xkb, dix. - -- Changed host.def to build only the agent server. - -- Merged the changes to Xtranssock.c - -nx-X11-3.0.0-3 - -- Merged the changes to lib/X11. Restored original PutImage.c and - ClDisplay.c files. - -nx-X11-3.0.0-2 - -- Created a directory named 'reference' to keep files that are chan- - ged during the development of nx-X11 since the 1.5.0-16 to 2.0.0-32 - version. These files will be removed as long as the differences are - merged to the 3.0.0 version. When all differences are merged, this - directory will be removed. - -nx-X11-3.0.0-1 - -- Opened the 3.0.0 branch based on the nx-X11-2.0.0-9. The 3.0.0 - branch will now support the migration toward the X.org tree. Due - to time concerns, the 2.0.0 branch is going to be based on the - same nx-X11 as the 1.5.0. - -nx-X11-2.0.0-9 - -- Modified the agent link arguments to explicitly include the NX - libraries. - -- Disabled the Xinerama extension to avoid further clashes with - the redefinition of GC in Xlib. - -- Added os/libos.a at the end of the agent link. - -nx-X11-2.0.0-8 - -- Moved the declarations of _NXEnable* and related structures from - Xlibint.h to NXlibint.h. - -- Added provision for building the agent. This can be controlled by - setting NXAgentServer to YES in host.def. - -- Setting the NXUpgradeAgentServer variable to YES in the host.def - file will make the agent assume that it is being built in the new - environment. This variable is normally unset when building in the - 1.5.0 tree. - -nx-X11-2.0.0-7 - -- Fixed a problem on AMD64 due to the size of the area pointed by - the argument of _X11TransBytesReadable(). BytesReadable_t is long, - at least on Linux, while the ioctl() requires a pointer to an int. - The original _X11TransBytesReadable() function simply calls the - ioctl() by passing the pointer that is provided. NXTransReadable(), - instead, was correctly returning the value assuming a pointer to - a long, but this crashes some applications, among them xterm. Now - NXTransReadable() follows the same schema of the ioctl() call and - stores the result assuming a pointer to an int. - -- Removed the outdated NX_TRANS_PROCESS and NX_TRANS_THREAD code. - -nx-X11-2.0.0-6 - -- Made xterm work with the NX transport. This required small changes - to the Xt toolkit's and the xterm's files to let them use the NX - aware select(). This is useful to test the NX transport until the - nxagent server is integrated. - -- When the transport is gone _X11TransSocketBytesReadable() returns - EPIPE. This makes the client become aware of the closure of the - connection. - -- Added a call to NXTransDestroy() in XCloseDisplay(). - -- The exit() function in XlibInt.c causes a call to NXTransExit(). - -- Merged changes to dix/pixmap.c, xkb/xkbDflts.h, mi/Imakefile. - -- Removed unneeded changes and files containing patches already in - the latest X.org distribution: dix/dispatch.c, fb/fbcompose.c, fb/ - fbgc.c, xkb/ddxList.c, font/fontfile/dirfile.c, font/fontfile/ - encparse.c, font/fontfile/fontfile.c, font/FreeType/fttools.c, - Xrender/FillRect.c, Xrender/Picture.c. - -nx-X11-2.0.0-5 - -- Changes to the lib/X11/Imakefile to cleanly build the tree. This - is obtained by creating a link to the Xcomp library in exports/lib - without having to modify the programs' Imakefiles. - -- Finished merging the NX changes in the lib/X11 files. - -- Merged the CHANGELOG with the one from the 1.5.0 tree. - -nx-X11-2.0.0-4 - -- Merged the NX changes in most Xtrans and lib/X11 files. - -nx-X11-2.0.0-3 - -- Temporarily disabled the use of the MMX extensions in the Xserver's - fb code to successfully compile with GCC 4. - -nx-X11-2.0.0-2 - -- Imported the *.NX.reference and *.XF86.reference files that will - be needed for the merge. These files are the *.original from the - 1.5.0 tree. They will be removed as long as the merge advances. - -nx-X11-2.0.0-1 - -- Created the 2.0.0 branch based on X.org the 6.8.99.16 snapshot. - -nx-X11-1.5.0-16 - -- Added the missing *.XF86.original and *.NX.original files. - -nx-X11-1.5.0-15 - -- Made the nxagent server use select() instead of poll() on Solaris - so that it can leverage the new NX transport. - -- Moved the NXTransFlush() call to _XReply(). - -nx-X11-1.5.0-14 - -- Added the 'synchronous' parameter in the _XWaitForReadable() call - to NXTransFlush(). - -nx-X11-1.5.0-13 - -- Removed the log entry in XlibInt.c on calling the NXTransFlush(). - -nx-X11-1.5.0-12 - -- Changed XlibInt.c and utils.c to call NXTransExit(). - -nx-X11-1.5.0-11 - -- Changed XlibInt.c to comply with the new NXTransFlush() interfa- - ce introduced in nxcomp-1.5.0-42. - -- Cosmetic changes to messages printed for debug. - -nx-X11-1.5.0-10 - -- Ensured that all calls to _XIOError() are followed by a return. - -- Put exiting the client program in the case of an I/O error under - the control of the _NXContinueOnDisplayError flag. If set, the - I/O error routine will simply return, leaving to the application - the responsibility of checking the state of the XlibDisplayIOEr- - ror flag. - -- Added some checks whenever a read or write is performed on the X - connection, so that we can exit the I/O loop if the X channel is - gone. It is likely that more work will be needed when trying to - support XTHREADS enabled connections. This should not be a pro- - blem for now, as the default is still to quit the application un- - less the _NXContinueOnDisplayError flag is explicitly set. - -nx-X11-1.5.0-9 - -- Removed the references to the cygipc library in NXWin. Now use the - cygserver daemon to provide the MIT-SHM extension. - -- Fixed an error in the UseCygIPC definition. - -- Changed the cygwin.cf file to avoid redefinition of the BuildGlxExt, - XWinServer and BuildGlxExt symbols. - -nx-X11-1.5.0-8 - -- Added provision for deferred writes in the NX transport. When en- - tering _XWaitForReadable() we must ensure that data is flushed to - the proxy link. - -- Added the UseCygIPC define to NX-Cygwin.def. - -- Updated the NoMachine copyright notice on the modified files. - -nx-X11-1.5.0-7 - -- Added the GLX extension in NX-Sun.def. - -- Added some more logs in WaitFor.c. - -nx-X11-1.5.0-6 - -- Modified Xlibint.h and XlibInt.c to remove the _NXFlushSize para- - meter. New agents run the NX transport in-process, so we don't get - any benefit from increasing the display buffer size. - -- Modified NX-Darwin.def to not build the NXDarwin server. Since the - 1.4.0 version the NXDarwin server is unsupported and the NX client - for the Mac requires that the Apple X server is installed. - -- Changed NX-Linux.def to avoid the warning due to "SharedLibGLw" - being not defined. - -nx-X11-1.5.0-5 - -- Modified the Xserver Imakefile to link nxagent with FbPostFbLibs - and avoid including mfb/libmfb.a. - -- Added the GLX extension in NX-Linux.def. This provides unaccelera- - ted support in nxagent, with GLX operations translated into core X - protocol primitives. - -- Fixed x-X11/programs/Xserver/GL/dri/Imakefile to look in ../../hw/ - /xfree86/os-support/bus for includes. - -nx-X11-1.5.0-4 - -- Avoid calling NXTransSelect() if the transport is gone, so that we - don't have to wait until the timeout. - -- Added the "-fno-strict-aliasing" option to linux.cf when compiling - with a GCC version >= 4. In the words of Stefan Dirsch: "The opt- - ion, which is default since gcc 3.1, can result in wrong code when - the gcc warnings related to it are ignored. And as there are seve- - ral warnings in X11 related to it, it has been disabled for X11 - from the beginning. This didn't change for gcc4, so it still needs - to be used." - -- Added more logs in XlibInt.c and utils.c. A warning is printed if - the SmartScheduler is initialized. - -nx-X11-1.5.0-3 - -- Started integration of nxcomp with the X libraries. The Xtrans - code creates an internal connection to the nxcomp library instead - of a child proxy process. - -- Changed Xpoll.h and XlibInt.c to replace the standard Select - with a version giving NX a chance to check its own descriptors. - -- Implemented the NXTransReadVector() and the NXTransWriteVector() - functions to replace READV() and WRITEV(). - -- Implemented memory-to-memory communication with the NX proxy by - making use of the NXTransAgent() interface. - -nx-X11-1.5.0-2 - -- We think that the way LoadAuthorization() is working is wrong. - It doesn't reset the list of stored authorizations before reading - the new cookies. Our take is that if a new auth file is to be - read, the only cookies that are to be accepted are those that are - in the new file, not those in the file -plus- those that have - been in the file in the past. Furthermore, if the list can't be - read or it is empty, it should assume that it ignores which co- - okies are valid and thus it should disable any access. Your mile- - age can vary. A less draconian approach could be to leave the old - cookies if the file can't be read and remove them only if the - file is empty. - - Adding the cookies without removing the old values for the same - protocol has an important implication. If an user shares the co- - okie with somebody and later wants to revoke the access to the - display, changing the cookie will not work. This is especially - important with NX. For security reasons, after reconnecting the - session to a different display, it is advisable to generate a - new set of cookies, but doing that it is useless with the current - code, as the old cookies are going to be still accepted. On the - same topic, consider that once an user has got access to the X - server, he/she can freely enable host authentication from any - host, so the safe behaviour should be to reset the host based - authenthication at least at reconnection, and keep as valid only - the cookies that are actually in the file. This behaviour would - surely break many applications, among them a SSH connection run - inside a NX session, as ssh -X reads the cookie for the display - only at session startup and does not read the cookies again - when the auth file is changed. - - Another bug (or feature, depending on how you want to consider - it) is that if the authority file contains entries for different - displays (as it is the norm when the authority file is the default - .Xauthority in the user's home), the X server will match -any- of - the cookies, even cookies that are not for its own display. This - means that you have to be careful when passing an authority file - to nxagent and maybe keep separate files for letting nxagent find - the cookie to be used to connect to the remote display and for - letting it find what cookies to accept. If the file is the same, - clients will be able to connect to nxagent with both the cookies. - This bug obviously affects any X server, also the real X server - running on the workstation, so it is common to see nxagent being - able to connect to the X server even if no cookie matches the - real display. - -- Added a check in lib/Xau/AuRead.c to prevent the fread() call to - be interrupted by SIGCHLD while reading the auth file. Due to the - way the old code worked, this could lead to the server enabling - local host access to the display. This problem had been identified - in the past. We just found that all the code dealing with reading - the auth file was affected. The code calls sigprocmask() to block - the signal (though it leaves some other calls unprotected) but the - SIGCHLD was not included in the set. - -- Added SIGCHLD to the set of signals that are blocked when reading - the authorization file. - -- As I was at it, I changed the path to the SecurityPolicy file. A - few Linux ditributors ship the file in $LIBDIR/xserver, a few only - in /etc/X11/xserver, most others in both places. It seems that - those who ship in $LIBDIR/xserver do also in /etc/X11 but the op- - posite is not true, so I switched to /etc/X11. - -nx-X11-1.5.0-1 - -- Opened the 1.5.0 branch. - -nx-X11-1.4.1-2 - -- Set parameter UseCygIPC on cygwin conf file in order to force the - build of MIT-SHM estension. - -- Removed some spurius object file. - -nx-X11-1.4.1-1 - -- Opened the 1.4.1 branch. - -nx-X11-1.4.0-8 - -- Changed DefaultFontPath and DefaultRGBDatabase in - NX-Cygwin.def. - -nx-X11-1.4.0-7 - -- Imported dispatch in nxdarwin package, in order to let - nxdarwin being able to detect new client connection. - -- Changed the Xpm Imakefile to make also .a static library - on Solaris. To link nxviewer and nxdestkop staticaly. - -nx-X11-1.4.0-6 - -- XInput extension enabled on MacOSX. - -- Added some missing backup files of the original XFree86 - package. - -nx-X11-1.4.0-5 - -- Changed the mi Imakefile in order to let xfree86 servers use - the normal mi extension initialization for the XInput exten- - sion. - -- XInput extension enabled on Solaris. - -nx-X11-1.4.0-4 - -- Removed the RejectWellKnownSocket for the cygwin and - MacOSX environments that doesn't use the Xtransport library. - -nx-X11-1.4.0-3 - -- Changed the implementation of the reject method in the - Xtransport library, now close any new incoming connection - immediately without reading or writing to it. - -nx-X11-1.4.0-2 - -- Implemented a reject method in the Xtransport library, - this function accept and close every connection attempt, - on the specified listening socket. - -- Added the new function RejectWellKnownSocket to the os - connection code. - This function use the new transport reject function on - all listening socket. - -nx-X11-1.4.0-1 - -- Opened the 1.4.0 branch. - -- Removed forgotten nxagent-1.3.2-20 directory. - -nx-X11-1.3.2-9 - -- Prevents NX Darwin server going through the reset. On Darwin - we found that the it is not possible to get the correct key- - board layout unless it is set on the local machine, before - the NX session is started, by using xmodmap. As we set the - keyboard locally, we must prevent the X server to reset, or - we would loose any local configuration. - -nx-X11-1.3.2-8 - -- Removed action associated to keysym XK_Terminate_Server. This - could cause agent to be terminated when pressing shift + back- - space if using the default US keyboard mapping. - -- Disabled the remaining debug logs in lib/X11/PutImage.c - -nx-X11-1.3.2-7 - -- Fixed the wrong programs/Xserver/Imakefile in 1.3.2-6 package. - -nx-X11-1.3.2-6 - -- Changed the define from NX_CLEAN_IN_PLACE to NX_CLEAN_INPLACE. - Definition of symbol is now placed in the Imakefile. - -- The new _NXEnableCleanInplace Xlib variable does control which - algorithm is used to clean the images. Setting NX_IMAGEINPLACE - in the environment will activate the in-place cleanup. - -- The default value of _NXEnableCleanInplace is -1. Leaving it to - a value <= 0 disables use of CleanInplace. - -nx-X11-1.3.2-5 - -- Patch in config/cf/sun.cf. Fix for libfontconfig compilation - during gmake Everything on Solaris. - -- Patch in lib/X11/Imakefile. Fix for nxcomp compilation during - gmake World on Solaris. - -nx-X11-1.3.2-4 - -- Image cleanup is now performed by using NXCleanInPlaceImage from - nxcompext. This function saves a buffer copy by cleaning the - padding bytes in the same buffer provided by the caller. Note that - to prevent memory violations in the case the image was allocated - in a static buffer, the function will temporarily redefine the - SIGSEGV handler. The former handler is restored before returning - to the caller. This can potentially affect some multithreaded - clients. Is to be decided if the function is safe enough to be - included in the production release. - -nx-X11-1.3.2-3 - -- More debug logs in programs/Xserver/xkb/ddxLoad.c. - -nx-X11-1.3.2-2 - -- Added NXmiwindow.o to NXAGENTOBJS in programs/Xserver/Imakefile. - File was not linked into the resulting nxagent. This solves the - problem of missing repaints in CDE and other Xt applications. - -nx-X11-1.3.2-1 - -- Added some debug logs in programs/Xserver/xkb/ddxLoad.c. Function - XkbDDXCompileKeymapByNames is called by OpenOffice to read the - keyboard configuration whenever a drop-down menu is accessed. It - seem to always fail with the following error: - - The XKEYBOARD keymap compiler (xkbcomp) reports: - > Error: Can't find file "unknown" for geometry include - > Exiting - > Abandoning geometry file "default" - -- Opened the 1.3.2 development branch. - -nx-X11-1.3.1-12 - -- Fixed a problem in xkb/ddxLoad.c on Solaris where Pclose was - always returning an error code despite the fact that command - was executed properly. - -nx-X11-1.3.1-11 - -- Changed default GCC flags from '-O2 -fno-strength-reduce' to - -O3. No platform where NX is targeted is currently using a - GCC 2.x affected by the -fno-strength-reduce bug. Note also - that nxcomp is already compiled with -O3 since 1.1.1, so it - can be considered safe. - -nx-X11-1.3.1-10 - -- Imported an updated fbcompose.c file from XFree86-4.3.99.902. - This fixes "uninitialized value" problems reported by Valgrind. - -- Fixed further buffer overflows by updating the following file - with recent versions coming from the XFree86-4.3.99.902 tree. - - nx-X11/lib/font/fontfile/dirfile.c - nx-X11/lib/font/fontfile/encparse.c - nx-X11/lib/font/fontfile/fontfile.c - -- Fixed a possible buffer overflow in lib/font/FreeType/fttools.c. - Verified that the change is already in the XFree86 4.4.0 CVS. - -nx-X11-1.3.1-9 - -- Fixed Xserver/Imakefile which was still referencing NXpixmap.o. - -nx-X11-1.3.1-8 - -- Imported an updated fbgc.c from XFree86-4.3.99.902. This fixes - some minor problems reported by Valgrind. - -- A major problem was reported by Valgrind about reading after - the block allocated in fbCreatePixmap from AllocatePixmap. The - file pixmap.c has been modified so that 4 bytes are added to - the pixmap buffer at any new allocation. This quick hack should - solve the problem for both nxagent and the NXWin server. Further - investigation is planned for the next release. - -- Fixed Xtranssock.c to compile on Solaris where struct sigaction - doesn't have the sa_restorer member. - -nx-X11-1.3.1-5 - -- Renamed the NX-sun.def configuration file to NX-Sun.def. - -- Renamed the non-standard NX_iPAQ_XServer and NX_Zaurus_XServer - symbols to NXiPAQXServer and NXZaurusXServer. - -- Added the missing sun.cf.XF86.original file in config/cf. - -- Added the missing empty file host.def.XF86.original in the - same directory. - -- Added initialization of sa.sa_mask when setting sigaction() - for SIGCHLD. The problem was reported by Valgrind running - nxagent. - -- Removed an unused block of code from WaitFor.c. The code had - been commented out in previous versions. - -- Removed the non-standard colon at the end of version in this - CHANGELOG. - -- Removed the spurious spaces in this CHANGELOG. - -nx-X11-1.3.1-4 - -- Added a little workaround to the top Imakefile intended to - hide the makedepend warnings about non portable whitespaces - in sources. - -nx-X11-1.3.1-3 - -- Fixed compilation problem with nxagent-1.3.1-13. - -nx-X11-1.3.1-2 - -- Changes in NX-sun.def configuration file for Solaris to allow - compilation of the XKB extension. - -nx-X11-1.3.1-1 - -- Opened the 1.3.1 development branch. - -nx-X11-1.3.0-6 - -- Original output buffer size in stock XFree86 is 2048. We try - to reduce context switches and help stream compression by - increasing the maximum size of the buffer 8192. _NXFlushSize - determines when the display buffer is actually flushed. It is - set by default to 4096 but agents should set it to 0 if they - want to disable early flush. - -- Added the _NXLostSequenceFunction function pointer to let NX - agents suppress the error message and modify the default Xlib - behaviour when out-of-order sequence numbers are received. diff --git a/nx-X11/CHANGELOG.X.original b/nx-X11/CHANGELOG.X.original deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/WSDrawBuffer.h.X.original b/nx-X11/WSDrawBuffer.h.X.original deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/include/Xpoll.h.in.NX.original b/nx-X11/include/Xpoll.h.in.NX.original deleted file mode 100644 index dcea39c60..000000000 --- a/nx-X11/include/Xpoll.h.in.NX.original +++ /dev/null @@ -1,299 +0,0 @@ -/* $Xorg: Xpoll.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */ - -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/* - * Copyright © 2005 Daniel Stone - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Daniel Stone not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. Daniel Stone makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * DANIEL STONE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DANIEL STONE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/* $XFree86: xc/include/Xpoll.h,v 3.8 2001/01/17 17:53:11 dawes Exp $ */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#ifndef _XPOLL_H_ -#define _XPOLL_H_ - -#ifndef WIN32 - -#ifndef USE_POLL - -#include - -/* Below is the monster branch from hell. Basically, most systems will drop to - * 'the branch below is the fallthrough for halfway modern systems', and include - * , so we get the FD_* macros. */ -#if !defined(DGUX) -# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) -# include -# ifdef luna -# include -# endif -# else /* not SVR4/CRAY/AIXv3 */ -# if defined(AIXV4) /* AIX 4.2 fubar-ed , so try really hard. */ -# if !defined(NFDBITS) -# include -# endif -# else /* the branch below is the fallthrough for halfway modern systems */ -# ifdef __QNX__ /* Make sure we get 256 bit select masks */ -# define FD_SETSIZE 256 -# endif -# include -# endif -# endif -#else /* DGUX -- No sys/select in Intel DG/ux */ -# include -# include -# include -#endif - -#include - -#ifdef CSRG_BASED -#include -# if BSD < 199103 -typedef long fd_mask; -# endif -#endif - -#define XFD_SETSIZE 256 - -#ifndef FD_SETSIZE -#define FD_SETSIZE XFD_SETSIZE -#endif - -#ifndef NBBY -#define NBBY 8 /* number of bits in a byte */ -#endif - -#ifndef NFDBITS -#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ -#endif - -#ifndef howmany -#define howmany(x,y) (((x)+((y)-1))/(y)) -#endif - -#if defined(BSD) && BSD < 198911 && !defined(luna) -typedef struct fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} fd_set; -#endif - -/* - * Replace the standard Select with a version giving NX a - * chance to check its own descriptors. This doesn't cover - * the cases where the system is using poll or when system- - * specific defines override the Select definition (OS/2). - * See XlibInt.c for _XSelect(). - */ - -#ifdef NX_TRANS_SOCKET - -extern int _XSelect(int maxfds, fd_set *readfds, fd_set *writefds, - fd_set *exceptfds, struct timeval *timeout); - -#ifndef hpux /* and perhaps old BSD ??? */ -# define Select(n,r,w,e,t) _XSelect(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) -#else -# ifndef _XPG4_EXTENDED /* HPUX 9.x and earlier */ -# define Select(n,r,w,e,t) _XSelect(n,(int*)r,(int*)w,(int*)e,(struct timeval*)t) -# else -# define Select(n,r,w,e,t) _XSelect(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) -# endif -#endif - -#else /* #ifdef NX_TRANS_SOCKET */ - -#ifndef hpux /* and perhaps old BSD ??? */ -# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) -#else -# ifndef _XPG4_EXTENDED /* HPUX 9.x and earlier */ -# define Select(n,r,w,e,t) select(n,(int*)r,(int*)w,(int*)e,(struct timeval*)t) -# else -# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) -# endif -#endif - -#endif /* #ifdef NX_TRANS_SOCKET */ - -#define __X_FDS_BITS @USE_FDS_BITS@ - -#ifndef __FDS_BITS -# define __FDS_BITS(p) ((p)->__X_FDS_BITS) -#endif - -#define __XFDS_BITS(p, n) (__FDS_BITS(p))[n] - -#ifndef FD_SET -#define FD_SET(n, p) (__XFDS_BITS(p, ((n)/NFDBITS)) |= ((fd_mask)1 << ((n) % NFDBITS))) -#endif -#ifndef FD_CLR -#define FD_CLR(n, p) (__XFDS_BITS((p), ((n)/NFDBITS)) &= ~((fd_mask)1 << ((n) % NFDBITS))) -#endif -#ifndef FD_ISSET -#define FD_ISSET(n, p) ((__XFDS_BITS((p), ((n)/NFDBITS))) & ((fd_mask)1 << ((n) % NFDBITS))) -#endif -#ifndef FD_ZERO -#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) -#endif - -/* - * The howmany(FD_SETSIZE, NFDBITS) computes the number of elements in the - * array. before accessing an element in the array we check it exists. - * If it does not exist then the compiler discards the code to access it. - */ -#define XFD_ANYSET(p) \ - ((howmany(FD_SETSIZE, NFDBITS) > 0 && (__XFDS_BITS(p, 0))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 1 && (__XFDS_BITS(p, 1))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 2 && (__XFDS_BITS(p, 2))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 3 && (__XFDS_BITS(p, 3))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 4 && (__XFDS_BITS(p, 4))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 5 && (__XFDS_BITS(p, 5))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 6 && (__XFDS_BITS(p, 6))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7)))) - -#define XFD_COPYSET(src,dst) { \ - int __i__; \ - for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ - __XFDS_BITS((dst), __i__) = __XFDS_BITS((src), __i__); \ - } -#define XFD_ANDSET(dst,b1,b2) { \ - int __i__; \ - for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ - __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) & (__XFDS_BITS((b2), __i__))); \ - } -#define XFD_ORSET(dst,b1,b2) { \ - int __i__; \ - for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ - __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) | (__XFDS_BITS((b2), __i__))); \ - } -#define XFD_UNSET(dst,b1) { \ - int __i__; \ - for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ - __XFDS_BITS((dst), __i__) &= ~(__XFDS_BITS((b1), __i__)); \ - } - -#else /* USE_POLL */ -#include -#endif /* USE_POLL */ - -#else /* WIN32 */ - -#define XFD_SETSIZE 256 -#ifndef FD_SETSIZE -#define FD_SETSIZE XFD_SETSIZE -#endif -#include - -#define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) - -#define XFD_SETCOUNT(p) (((fd_set FAR *)(p))->fd_count) -#define XFD_FD(p,i) (((fd_set FAR *)(p))->fd_array[i]) -#define XFD_ANYSET(p) XFD_SETCOUNT(p) - -#define XFD_COPYSET(src,dst) { \ - u_int __i; \ - FD_ZERO(dst); \ - for (__i = 0; __i < XFD_SETCOUNT(src) ; __i++) { \ - XFD_FD(dst,__i) = XFD_FD(src,__i); \ - } \ - XFD_SETCOUNT(dst) = XFD_SETCOUNT(src); \ -} - -#define XFD_ANDSET(dst,b1,b2) { \ - u_int __i; \ - FD_ZERO(dst); \ - for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ - if (FD_ISSET(XFD_FD(b1,__i), b2)) \ - FD_SET(XFD_FD(b1,__i), dst); \ - } \ -} - -#define XFD_ORSET(dst,b1,b2) { \ - u_int __i; \ - if (dst != b1) XFD_COPYSET(b1,dst); \ - for (__i = 0; __i < XFD_SETCOUNT(b2) ; __i++) { \ - if (!FD_ISSET(XFD_FD(b2,__i), dst)) \ - FD_SET(XFD_FD(b2,__i), dst); \ - } \ -} - -/* this one is really sub-optimal */ -#define XFD_UNSET(dst,b1) { \ - u_int __i; \ - for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ - FD_CLR(XFD_FD(b1,__i), dst); \ - } \ -} - -/* we have to pay the price of having an array here, unlike with bitmasks - calling twice FD_SET with the same fd is not transparent, so be careful */ -#undef FD_SET -#define FD_SET(fd,set) do { \ - if (XFD_SETCOUNT(set) < FD_SETSIZE && !FD_ISSET(fd,set)) \ - XFD_FD(set,XFD_SETCOUNT(set)++)=(fd); \ -} while(0) - -#define getdtablesize() FD_SETSIZE - -#endif /* WIN32 */ - -#endif /* _XPOLL_H_ */ diff --git a/nx-X11/include/Xpoll.h.in.X.original b/nx-X11/include/Xpoll.h.in.X.original deleted file mode 100644 index 33fdad477..000000000 --- a/nx-X11/include/Xpoll.h.in.X.original +++ /dev/null @@ -1,255 +0,0 @@ -/* $Xorg: Xpoll.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */ - -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/* - * Copyright © 2005 Daniel Stone - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Daniel Stone not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. Daniel Stone makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * DANIEL STONE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DANIEL STONE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/* $XFree86: xc/include/Xpoll.h,v 3.8 2001/01/17 17:53:11 dawes Exp $ */ - -#ifndef _XPOLL_H_ -#define _XPOLL_H_ - -#ifndef WIN32 - -#ifndef USE_POLL - -#include - -/* Below is the monster branch from hell. Basically, most systems will drop to - * 'the branch below is the fallthrough for halfway modern systems', and include - * , so we get the FD_* macros. */ -#if !defined(DGUX) -# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) -# include -# ifdef luna -# include -# endif -# else /* not SVR4/CRAY/AIXv3 */ -# if defined(AIXV4) /* AIX 4.2 fubar-ed , so try really hard. */ -# if !defined(NFDBITS) -# include -# endif -# else /* the branch below is the fallthrough for halfway modern systems */ -# ifdef __QNX__ /* Make sure we get 256 bit select masks */ -# define FD_SETSIZE 256 -# endif -# include -# endif -# endif -#else /* DGUX -- No sys/select in Intel DG/ux */ -# include -# include -# include -#endif - -#include - -#ifdef CSRG_BASED -#include -# if BSD < 199103 -typedef long fd_mask; -# endif -#endif - -#define XFD_SETSIZE 256 - -#ifndef FD_SETSIZE -#define FD_SETSIZE XFD_SETSIZE -#endif - -#ifndef NBBY -#define NBBY 8 /* number of bits in a byte */ -#endif - -#ifndef NFDBITS -#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ -#endif - -#ifndef howmany -#define howmany(x,y) (((x)+((y)-1))/(y)) -#endif - -#if defined(BSD) && BSD < 198911 && !defined(luna) -typedef struct fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} fd_set; -#endif - -#ifndef hpux /* and perhaps old BSD ??? */ -# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) -#else -# ifndef _XPG4_EXTENDED /* HPUX 9.x and earlier */ -# define Select(n,r,w,e,t) select(n,(int*)r,(int*)w,(int*)e,(struct timeval*)t) -# else -# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) -# endif -#endif - -#define __X_FDS_BITS @USE_FDS_BITS@ - -#ifndef __FDS_BITS -# define __FDS_BITS(p) ((p)->__X_FDS_BITS) -#endif - -#define __XFDS_BITS(p, n) (__FDS_BITS(p))[n] - -#ifndef FD_SET -#define FD_SET(n, p) (__XFDS_BITS(p, ((n)/NFDBITS)) |= ((fd_mask)1 << ((n) % NFDBITS))) -#endif -#ifndef FD_CLR -#define FD_CLR(n, p) (__XFDS_BITS((p), ((n)/NFDBITS)) &= ~((fd_mask)1 << ((n) % NFDBITS))) -#endif -#ifndef FD_ISSET -#define FD_ISSET(n, p) ((__XFDS_BITS((p), ((n)/NFDBITS))) & ((fd_mask)1 << ((n) % NFDBITS))) -#endif -#ifndef FD_ZERO -#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) -#endif - -/* - * The howmany(FD_SETSIZE, NFDBITS) computes the number of elements in the - * array. before accessing an element in the array we check it exists. - * If it does not exist then the compiler discards the code to access it. - */ -#define XFD_ANYSET(p) \ - ((howmany(FD_SETSIZE, NFDBITS) > 0 && (__XFDS_BITS(p, 0))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 1 && (__XFDS_BITS(p, 1))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 2 && (__XFDS_BITS(p, 2))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 3 && (__XFDS_BITS(p, 3))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 4 && (__XFDS_BITS(p, 4))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 5 && (__XFDS_BITS(p, 5))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 6 && (__XFDS_BITS(p, 6))) || \ - (howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7)))) - -#define XFD_COPYSET(src,dst) { \ - int __i__; \ - for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ - __XFDS_BITS((dst), __i__) = __XFDS_BITS((src), __i__); \ - } -#define XFD_ANDSET(dst,b1,b2) { \ - int __i__; \ - for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ - __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) & (__XFDS_BITS((b2), __i__))); \ - } -#define XFD_ORSET(dst,b1,b2) { \ - int __i__; \ - for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ - __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) | (__XFDS_BITS((b2), __i__))); \ - } -#define XFD_UNSET(dst,b1) { \ - int __i__; \ - for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ - __XFDS_BITS((dst), __i__) &= ~(__XFDS_BITS((b1), __i__)); \ - } - -#else /* USE_POLL */ -#include -#endif /* USE_POLL */ - -#else /* WIN32 */ - -#define XFD_SETSIZE 256 -#ifndef FD_SETSIZE -#define FD_SETSIZE XFD_SETSIZE -#endif -#include - -#define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) - -#define XFD_SETCOUNT(p) (((fd_set FAR *)(p))->fd_count) -#define XFD_FD(p,i) (((fd_set FAR *)(p))->fd_array[i]) -#define XFD_ANYSET(p) XFD_SETCOUNT(p) - -#define XFD_COPYSET(src,dst) { \ - u_int __i; \ - FD_ZERO(dst); \ - for (__i = 0; __i < XFD_SETCOUNT(src) ; __i++) { \ - XFD_FD(dst,__i) = XFD_FD(src,__i); \ - } \ - XFD_SETCOUNT(dst) = XFD_SETCOUNT(src); \ -} - -#define XFD_ANDSET(dst,b1,b2) { \ - u_int __i; \ - FD_ZERO(dst); \ - for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ - if (FD_ISSET(XFD_FD(b1,__i), b2)) \ - FD_SET(XFD_FD(b1,__i), dst); \ - } \ -} - -#define XFD_ORSET(dst,b1,b2) { \ - u_int __i; \ - if (dst != b1) XFD_COPYSET(b1,dst); \ - for (__i = 0; __i < XFD_SETCOUNT(b2) ; __i++) { \ - if (!FD_ISSET(XFD_FD(b2,__i), dst)) \ - FD_SET(XFD_FD(b2,__i), dst); \ - } \ -} - -/* this one is really sub-optimal */ -#define XFD_UNSET(dst,b1) { \ - u_int __i; \ - for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ - FD_CLR(XFD_FD(b1,__i), dst); \ - } \ -} - -/* we have to pay the price of having an array here, unlike with bitmasks - calling twice FD_SET with the same fd is not transparent, so be careful */ -#undef FD_SET -#define FD_SET(fd,set) do { \ - if (XFD_SETCOUNT(set) < FD_SETSIZE && !FD_ISSET(fd,set)) \ - XFD_FD(set,XFD_SETCOUNT(set)++)=(fd); \ -} while(0) - -#define getdtablesize() FD_SETSIZE - -#endif /* WIN32 */ - -#endif /* _XPOLL_H_ */ diff --git a/nx-X11/include/extensions/XKBsrv.h.NX.original b/nx-X11/include/extensions/XKBsrv.h.NX.original deleted file mode 100644 index 4a9d8edcb..000000000 --- a/nx-X11/include/extensions/XKBsrv.h.NX.original +++ /dev/null @@ -1,1192 +0,0 @@ -/* $Xorg: XKBsrv.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ -/* $XdotOrg: xc/include/extensions/XKBsrv.h,v 1.5 2005/09/01 19:56:14 krh Exp $ */ -/************************************************************ -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. - -********************************************************/ -/* $XFree86: xc/include/extensions/XKBsrv.h,v 3.22 2002/11/20 04:49:01 dawes Exp $ */ - -#ifndef _XKBSRV_H_ -#define _XKBSRV_H_ - -#ifdef XKB_IN_SERVER -#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 -#endif - -#include -#include -#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 pointer XkbLastRepeatEvent; - -extern CARD32 xkbDebugFlags; -extern CARD32 xkbDebugCtrls; - -#define _XkbAlloc(s) xalloc((s)) -#define _XkbCalloc(n,s) Xcalloc((n)*(s)) -#define _XkbRealloc(o,s) Xrealloc((o),(s)) -#define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t))) -#define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n)*sizeof(t))) -#define _XkbTypedRealloc(o,n,t) \ - ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t)) -#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t)) -#define _XkbFree(p) Xfree(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 pointer -#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 */, - pointer /* 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 char * _XkbDupString( - char * /* str */ -); - -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 */ -); - -#ifdef XKBSRV_NEED_FILE_FUNCS - -#include -#include -#include - -#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 */ -); - -#endif /* XKBSRV_NEED_FILE_FUNCS */ - - -_XFUNCPROTOEND - -#define XkbAtomGetString(d,s) NameForAtom(s) - -#endif /* _XKBSRV_H_ */ - - diff --git a/nx-X11/include/extensions/XKBsrv.h.X.original b/nx-X11/include/extensions/XKBsrv.h.X.original deleted file mode 100644 index b04264de8..000000000 --- a/nx-X11/include/extensions/XKBsrv.h.X.original +++ /dev/null @@ -1,1187 +0,0 @@ -/* $Xorg: XKBsrv.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ -/* $XdotOrg: xc/include/extensions/XKBsrv.h,v 1.5 2005/09/01 19:56:14 krh Exp $ */ -/************************************************************ -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. - -********************************************************/ -/* $XFree86: xc/include/extensions/XKBsrv.h,v 3.22 2002/11/20 04:49:01 dawes Exp $ */ - -#ifndef _XKBSRV_H_ -#define _XKBSRV_H_ - -#ifdef XKB_IN_SERVER -#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 -#endif - -#include -#include -#include "inputstr.h" - -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 pointer XkbLastRepeatEvent; - -extern CARD32 xkbDebugFlags; -extern CARD32 xkbDebugCtrls; - -#define _XkbAlloc(s) xalloc((s)) -#define _XkbCalloc(n,s) Xcalloc((n)*(s)) -#define _XkbRealloc(o,s) Xrealloc((o),(s)) -#define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t))) -#define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n)*sizeof(t))) -#define _XkbTypedRealloc(o,n,t) \ - ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t)) -#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t)) -#define _XkbFree(p) Xfree(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 pointer -#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 */, - pointer /* 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 char * _XkbDupString( - char * /* str */ -); - -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 */ -); - -#ifdef XKBSRV_NEED_FILE_FUNCS - -#include -#include -#include - -#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 */ -); - -#endif /* XKBSRV_NEED_FILE_FUNCS */ - - -_XFUNCPROTOEND - -#define XkbAtomGetString(d,s) NameForAtom(s) - -#endif /* _XKBSRV_H_ */ - - diff --git a/nx-X11/lib/X11/ChkIfEv.c.NX.original b/nx-X11/lib/X11/ChkIfEv.c.NX.original deleted file mode 100644 index 0217af830..000000000 --- a/nx-X11/lib/X11/ChkIfEv.c.NX.original +++ /dev/null @@ -1,138 +0,0 @@ -/* $Xorg: ChkIfEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ -/* - -Copyright 1985, 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86$ */ - -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -/* - * Check existing events in queue to find if any match. If so, return. - * If not, flush buffer and see if any more events are readable. If one - * matches, return. If all else fails, tell the user no events found. - */ - -Bool XCheckIfEvent (dpy, event, predicate, arg) - register Display *dpy; - Bool (*predicate)( - Display* /* display */, - XEvent* /* event */, - char* /* arg */ - ); /* function to call */ - register XEvent *event; /* XEvent to be filled in. */ - char *arg; -{ - register _XQEvent *prev, *qelt; - unsigned long qe_serial = 0; - int n; /* time through count */ - - LockDisplay(dpy); - prev = NULL; - for (n = 3; --n >= 0;) { - for (qelt = prev ? prev->next : dpy->head; - qelt; - prev = qelt, qelt = qelt->next) { - if(qelt->qserial_num > qe_serial - && (*predicate)(dpy, &qelt->event, arg)) { - *event = qelt->event; - _XDeq(dpy, prev, qelt); - UnlockDisplay(dpy); - return True; - } - } - if (prev) - qe_serial = prev->qserial_num; - switch (n) { - case 2: - _XEventsQueued(dpy, QueuedAfterReading); - break; - case 1: - _XFlush(dpy); - break; - } - if (prev && prev->qserial_num != qe_serial) - /* another thread has snatched this event */ - prev = NULL; - } - UnlockDisplay(dpy); - return False; -} - -#ifdef NX_TRANS_SOCKET - -/* - * This is just like XCheckIfEvent() but doesn't - * flush the output buffer if it can't read new - * events. - */ - -Bool XCheckIfEventNoFlush (dpy, event, predicate, arg) - register Display *dpy; - Bool (*predicate)( - Display* /* display */, - XEvent* /* event */, - char* /* arg */ - ); /* function to call */ - register XEvent *event; /* XEvent to be filled in. */ - char *arg; -{ - register _XQEvent *prev, *qelt; - unsigned long qe_serial = 0; - int n; /* time through count */ - - LockDisplay(dpy); - prev = NULL; - for (n = 2; --n >= 0;) { - for (qelt = prev ? prev->next : dpy->head; - qelt; - prev = qelt, qelt = qelt->next) { - if(qelt->qserial_num > qe_serial - && (*predicate)(dpy, &qelt->event, arg)) { - *event = qelt->event; - _XDeq(dpy, prev, qelt); - UnlockDisplay(dpy); - return True; - } - } - if (prev) - qe_serial = prev->qserial_num; - switch (n) { - case 1: - _XEventsQueued(dpy, QueuedAfterReading); - break; - } - if (prev && prev->qserial_num != qe_serial) - /* another thread has snatched this event */ - prev = NULL; - } - UnlockDisplay(dpy); - return False; -} - -#endif diff --git a/nx-X11/lib/X11/ChkIfEv.c.X.original b/nx-X11/lib/X11/ChkIfEv.c.X.original deleted file mode 100644 index ff74bcd73..000000000 --- a/nx-X11/lib/X11/ChkIfEv.c.X.original +++ /dev/null @@ -1,85 +0,0 @@ -/* $Xorg: ChkIfEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ -/* - -Copyright 1985, 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86$ */ - -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -/* - * Check existing events in queue to find if any match. If so, return. - * If not, flush buffer and see if any more events are readable. If one - * matches, return. If all else fails, tell the user no events found. - */ - -Bool XCheckIfEvent (dpy, event, predicate, arg) - register Display *dpy; - Bool (*predicate)( - Display* /* display */, - XEvent* /* event */, - char* /* arg */ - ); /* function to call */ - register XEvent *event; /* XEvent to be filled in. */ - char *arg; -{ - register _XQEvent *prev, *qelt; - unsigned long qe_serial = 0; - int n; /* time through count */ - - LockDisplay(dpy); - prev = NULL; - for (n = 3; --n >= 0;) { - for (qelt = prev ? prev->next : dpy->head; - qelt; - prev = qelt, qelt = qelt->next) { - if(qelt->qserial_num > qe_serial - && (*predicate)(dpy, &qelt->event, arg)) { - *event = qelt->event; - _XDeq(dpy, prev, qelt); - UnlockDisplay(dpy); - return True; - } - } - if (prev) - qe_serial = prev->qserial_num; - switch (n) { - case 2: - _XEventsQueued(dpy, QueuedAfterReading); - break; - case 1: - _XFlush(dpy); - break; - } - if (prev && prev->qserial_num != qe_serial) - /* another thread has snatched this event */ - prev = NULL; - } - UnlockDisplay(dpy); - return False; -} diff --git a/nx-X11/lib/X11/ConnDis.c.NX.original b/nx-X11/lib/X11/ConnDis.c.NX.original deleted file mode 100644 index 30146a9f1..000000000 --- a/nx-X11/lib/X11/ConnDis.c.NX.original +++ /dev/null @@ -1,1465 +0,0 @@ -/* $XdotOrg: xc/lib/X11/ConnDis.c,v 1.10 2005/07/03 07:00:55 daniels Exp $ */ -/* $Xorg: ConnDis.c,v 1.8 2001/02/09 02:03:31 xorgcvs Exp $ */ -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/lib/X11/ConnDis.c,v 3.28 2003/12/02 23:33:17 herrb Exp $ */ - -/* - * This file contains operating system dependencies. - */ - -#define NEED_EVENTS - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include - -#if !defined(WIN32) -#ifndef Lynx -#include -#else -#include -#endif -#else -#include -#endif - -#ifndef X_CONNECTION_RETRIES /* number retries on ECONNREFUSED */ -#define X_CONNECTION_RETRIES 5 -#endif - -#ifdef LOCALCONN -#include -#endif - -#include "Xintconn.h" - -/* prototypes */ -static void GetAuthorization( - XtransConnInfo trans_conn, - int family, - char *saddr, - int saddrlen, - int idisplay, - char **auth_namep, - int *auth_namelenp, - char **auth_datap, - int *auth_datalenp); - -/* functions */ -static char *copystring (char *src, int len) -{ - char *dst = Xmalloc (len + 1); - - if (dst) { - strncpy (dst, src, len); - dst[len] = '\0'; - } - - return dst; -} - - -/* - * Attempts to connect to server, given display name. Returns file descriptor - * (network socket) or -1 if connection fails. Display names may be of the - * following format: - * - * [protocol/] [hostname] : [:] displaynumber [.screennumber] - * - * A string with exactly two colons seperating hostname from the display - * indicates a DECnet style name. Colons in the hostname may occur if an - * IPv6 numeric address is used as the hostname. An IPv6 numeric address - * may also end in a double colon, so three colons in a row indicates an - * IPv6 address ending in :: followed by :display. To make it easier for - * people to read, an IPv6 numeric address hostname may be surrounded by - * [ ] in a similar fashion to the IPv6 numeric address URL syntax defined - * by IETF RFC 2732. - * - * If no hostname and no protocol is specified, the string is interpreted - * as the most efficient local connection to a server on the same machine. - * This is usually: - * - * o shared memory - * o local stream - * o UNIX domain socket - * o TCP to local host - * - * This function will eventually call the X Transport Interface functions - * which expects the hostname in the format: - * - * [protocol/] [hostname] : [:] displaynumber - * - */ -XtransConnInfo -_X11TransConnectDisplay ( - char *display_name, - char **fullnamep, /* RETURN */ - int *dpynump, /* RETURN */ - int *screenp, /* RETURN */ - char **auth_namep, /* RETURN */ - int *auth_namelenp, /* RETURN */ - char **auth_datap, /* RETURN */ - int *auth_datalenp) /* RETURN */ -{ - int family; - int saddrlen; - Xtransaddr *saddr; - char *lastp, *lastc, *p; /* char pointers */ - char *pprotocol = NULL; /* start of protocol name */ - char *phostname = NULL; /* start of host of display */ - char *pdpynum = NULL; /* start of dpynum of display */ - char *pscrnum = NULL; /* start of screen of display */ - Bool dnet = False; /* if true, then DECnet format */ - int idisplay = 0; /* required display number */ - int iscreen = 0; /* optional screen number */ - /* int (*connfunc)(); */ /* method to create connection */ - int len, hostlen; /* length tmp variable */ - int retry; /* retry counter */ - char addrbuf[128]; /* final address passed to - X Transport Interface */ - char* address = addrbuf; - XtransConnInfo trans_conn = NULL; /* transport connection object */ - int connect_stat; -#ifdef LOCALCONN - struct utsname sys; -#endif -#ifdef TCPCONN - char *tcphostname = NULL; /* A place to save hostname pointer */ -#endif - - p = display_name; - - saddrlen = 0; /* set so that we can clear later */ - saddr = NULL; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "_X11TransConnectDisplay: Called with display_name [%s].\n", display_name); -#endif - -#ifdef NX_TRANS_SOCKET - - /* - * Check if user selected the "nx" - * protocol or an "nx" hostname. - */ - - if (!strncasecmp(p, "nx/", 3) || !strcasecmp(p, "nx") || - !strncasecmp(p, "nx:", 3) || !strncasecmp(p, "nx,", 3)) - { - if (*(display_name + 2) == '/') - { - p += 3; - } - - pprotocol = copystring ("nx", 2); - - if (!pprotocol) goto bad; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_X11TransConnectDisplay: Forced protocol to [%s].\n", pprotocol); -#endif - - } - else - { - -#endif - - /* - * Step 0, find the protocol. This is delimited by the optional - * slash ('/'). - */ - for (lastp = p; *p && *p != ':' && *p != '/'; p++) ; - if (!*p) return NULL; /* must have a colon */ - - if (p != lastp && *p != ':') { /* protocol given? */ - pprotocol = copystring (lastp, p - lastp); - if (!pprotocol) goto bad; /* no memory */ - p++; /* skip the '/' */ - } else - p = display_name; /* reset the pointer in - case no protocol was given */ -#ifdef NX_TRANS_SOCKET - - } /* End of step 0. */ - - /* - * Check if user specified the "nx" protocol or - * hostname is "nx" or in the form "nx,...". - */ - - if (pprotocol && !strcasecmp(pprotocol, "nx")) - { - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_X11TransConnectDisplay: Checking hostname [%s].\n", p); -#endif - - /* - * Options can include a "display=" tuple so - * need to scan right to left. - */ - - lastp = p; - lastc = NULL; - - for (; *p; p++) - if (*p == ':') - lastc = p; - - /* - * Don't complain if no screen was provided. - */ - - if (lastc) - { - phostname = copystring (lastp, lastc - lastp); - - p = lastc; - } - else - { - phostname = copystring (lastp, strlen(lastp)); - } - - if (!phostname) goto bad; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_X11TransConnectDisplay: Forced hostname [%s].\n", phostname); -#endif - - } - else - { - -#endif - - /* - * Step 1, find the hostname. This is delimited by either one colon, - * or two colons in the case of DECnet (DECnet Phase V allows a single - * colon in the hostname). (See note above regarding IPv6 numeric - * addresses with triple colons or [] brackets.) - */ - - lastp = p; - lastc = NULL; - for (; *p; p++) - if (*p == ':') - lastc = p; - - if (!lastc) return NULL; /* must have a colon */ - - if ((lastp != lastc) && (*(lastc - 1) == ':') -#if defined(IPv6) && defined(AF_INET6) - && ( ((lastc - 1) == lastp) || (*(lastc - 2) != ':')) -#endif - ) { - /* DECnet display specified */ - -#ifndef DNETCONN - goto bad; -#else - dnet = True; - /* override the protocol specified */ - if (pprotocol) - Xfree (pprotocol); - pprotocol = copystring ("dnet", 4); - hostlen = lastc - 1 - lastp; -#endif - } - else - hostlen = lastc - lastp; - - if (hostlen > 0) { /* hostname given? */ - phostname = copystring (lastp, hostlen); - if (!phostname) goto bad; /* no memory */ - } - - p = lastc; - -#ifdef LOCALCONN - /* check if phostname == localnodename AND protocol not specified */ - if (!pprotocol && phostname && uname(&sys) >= 0 && - !strncmp(phostname, sys.nodename, - (strlen(sys.nodename) < strlen(phostname) ? - strlen(phostname) : strlen(sys.nodename)))) - { -#ifdef TCPCONN - /* - * We'll first attempt to connect using the local transport. If - * this fails (which is the case if sshd X protocol forwarding is - * being used), retry using tcp and this hostname. - */ - tcphostname = copystring(phostname, strlen(phostname)); -#endif - Xfree (phostname); - phostname = copystring ("unix", 4); - } -#endif - -#ifdef NX_TRANS_SOCKET - - } /* End of step 1. */ - - /* - * Check if no display was specified. In this case - * search the "port=n" option in NX host string. - */ - - if (*p) - { - -#endif - - - /* - * Step 2, find the display number. This field is required and is - * delimited either by a nul or a period, depending on whether or not - * a screen number is present. - */ - - for (lastp = ++p; *p && isascii(*p) && isdigit(*p); p++) ; - if ((p == lastp) || /* required field */ - (*p != '\0' && *p != '.') || /* invalid non-digit terminator */ - !(pdpynum = copystring (lastp, p - lastp))) /* no memory */ - goto bad; - idisplay = atoi (pdpynum); - -#ifdef NX_TRANS_SOCKET - - } - else - { - char *host = NULL; - char *name = NULL; - char *value = NULL; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_X11TransConnectDisplay: Searching port in port [%s].\n", phostname); -#endif - - if (!strncasecmp(phostname, "nx,", 3)) - { - host = copystring(phostname + 3, strlen(phostname) - 3); - } - - if (!host) goto bad; - - idisplay = -1; - - name = strtok(host, "="); - - while (name) - { - value = strtok(NULL, ","); - - if (value == NULL || strstr(value, "=") != NULL || - strstr(name, ",") != NULL || strlen(value) >= 128) - { - Xfree(host); - - goto bad; - } - else if (strcasecmp(name, "port") == 0) - { - idisplay = atoi(value); - - pdpynum = copystring(value, strlen(value)); - - if (!pdpynum) goto bad; - - break; - } - - name = strtok(NULL, "="); - } - - Xfree(host); - - if (idisplay == -1) - { - goto bad; - } - - } /* End of step 2. */ - -#endif - - - /* - * Step 3, find the screen number. This field is optional. It is - * present only if the display number was followed by a period (which - * we've already verified is the only non-nul character). - */ - - if (*p) { - for (lastp = ++p; *p && isascii(*p) && isdigit (*p); p++) ; - if (p != lastp) { - if (*p || /* non-digits */ - !(pscrnum = copystring (lastp, p - lastp))) /* no memory */ - goto bad; - iscreen = atoi (lastp); - } - } - - /* - * At this point, we know the following information: - * - * pprotocol protocol string or NULL - * phostname hostname string or NULL - * idisplay display number - * iscreen screen number - * dnet DECnet boolean - * - * We can now decide which transport to use based on the ConnectionFlags - * build parameter the hostname string. If phostname is NULL or equals - * the string "local", then choose the best transport. If phostname - * is "unix", then choose BSD UNIX domain sockets (if configured). - */ - -#ifdef NX_TRANS_SOCKET - - /* - * If user selected the "nx" protocol - * force "local" transport. - */ - - if (pprotocol && !strcasecmp(pprotocol, "nx")) - { - pprotocol = copystring ("local", 5); - - if (!pprotocol) goto bad; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_X11TransConnectDisplay: Converted protocol to [%s].\n", pprotocol); -#endif - - } - -#endif - -#if defined(TCPCONN) || defined(UNIXCONN) || defined(LOCALCONN) || defined(MNX_TCPCONN) || defined(OS2PIPECONN) - if (!pprotocol) { - if (!phostname) { -#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) - pprotocol = copystring ("local", 5); -#if defined(TCPCONN) - tcphostname = copystring("localhost", 9); -#endif - } - else - { -#endif - pprotocol = copystring ("tcp", 3); - } - } -#endif - -#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) - /* - * Now that the defaults have been established, see if we have any - * special names that we have to override: - * - * :N => if UNIXCONN then unix-domain-socket - * ::N => if UNIXCONN then unix-domain-socket - * unix:N => if UNIXCONN then unix-domain-socket - * - * Note that if UNIXCONN isn't defined, then we can use the default - * transport connection function set above. - */ - - if (!phostname) { -#ifdef apollo - ; /* Unix domain sockets are *really* bad on apollos */ -#else - if( pprotocol ) Xfree(pprotocol); - pprotocol = copystring ("local", 5); -#endif - } - else if (strcmp (phostname, "unix") == 0) { - if( pprotocol ) Xfree(pprotocol); - pprotocol = copystring ("local", 5); - } -#endif - -#if defined(TCPCONN) - connect: -#endif - /* - * This seems kind of backwards, but we need to put the protocol, - * host, and port back together to pass to _X11TransOpenCOTSClient(). - */ - - { - int olen = 3 + (pprotocol ? strlen(pprotocol) : 0) + - (phostname ? strlen(phostname) : 0) + - (pdpynum ? strlen(pdpynum) : 0); - if (olen > sizeof addrbuf) address = Xmalloc (olen); - } - if (!address) goto bad; - - sprintf(address,"%s/%s:%d", - pprotocol ? pprotocol : "", - phostname ? phostname : "", - idisplay ); - - /* - * Make the connection, also need to get the auth address info for - * the connection. Do retries in case server host has hit its - * backlog (which, unfortunately, isn't distinguishable from there not - * being a server listening at all, which is why we have to not retry - * too many times). - */ -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "_X11TransConnectDisplay: Entering connection loop.\n"); -#endif - for(retry=X_CONNECTION_RETRIES; retry>=0; retry-- ) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "_X11TransConnectDisplay: Going to call _X11TransOpenCOTSClient(address) with address [%s].\n", address); -#endif - if ( (trans_conn = _X11TransOpenCOTSClient(address)) == NULL ) - { - break; - } -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "_X11TransConnectDisplay: Going to call _X11TransConnect(trans_conn,address).\n"); -#endif - if ((connect_stat = _X11TransConnect(trans_conn,address)) < 0 ) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "_X11TransConnectDisplay: Going to call _X11TransClose(trans_conn).\n"); -#endif - _X11TransClose(trans_conn); - trans_conn = NULL; - - if (connect_stat == TRANS_TRY_CONNECT_AGAIN) - { - sleep(1); - continue; - } - else - break; - } - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "_X11TransConnectDisplay: Going to call _X11TransGetPeerAddr(trans_conn, &family, &saddrlen, &saddr).\n"); -#endif - _X11TransGetPeerAddr(trans_conn, &family, &saddrlen, &saddr); - - /* - * The family is given in a socket format (ie AF_INET). This - * will convert it to the format used by the authorization and - * X protocol (ie FamilyInternet). - */ - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "_X11TransConnectDisplay: Going to call _X11TransConvertAddress(&family, &saddrlen, &saddr).\n"); -#endif - if( _X11TransConvertAddress(&family, &saddrlen, &saddr) < 0 ) - { - _X11TransClose(trans_conn); - trans_conn = NULL; - sleep(1); - if (saddr) - { - free ((char *) saddr); - saddr = NULL; - } - continue; - } - - break; - } - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "_X11TransConnectDisplay: Out of connection loop.\n"); -#endif - if (address != addrbuf) Xfree (address); - address = addrbuf; - - if( trans_conn == NULL ) - goto bad; - - /* - * Set close-on-exec so that programs that fork() doesn't get confused. - */ - - _X11TransSetOption(trans_conn,TRANS_CLOSEONEXEC,1); - - /* - * Build the expanded display name: - * - * [host] : [:] dpy . scr \0 - */ - len = ((phostname ? strlen(phostname) : 0) + 1 + (dnet ? 1 : 0) + - strlen(pdpynum) + 1 + (pscrnum ? strlen(pscrnum) : 1) + 1); - *fullnamep = (char *) Xmalloc (len); - if (!*fullnamep) goto bad; - - sprintf (*fullnamep, "%s%s%d.%d", - (phostname ? phostname : ""), - (dnet ? "::" : ":"), - idisplay, iscreen); - - *dpynump = idisplay; - *screenp = iscreen; - if (pprotocol) Xfree (pprotocol); - if (phostname) Xfree (phostname); - if (pdpynum) Xfree (pdpynum); - if (pscrnum) Xfree (pscrnum); -#ifdef TCPCONN - if (tcphostname) Xfree (tcphostname); -#endif - - GetAuthorization(trans_conn, family, (char *) saddr, saddrlen, idisplay, - auth_namep, auth_namelenp, auth_datap, auth_datalenp); - return trans_conn; - - - /* - * error return; make sure everything is cleaned up. - */ - bad: - if (trans_conn) (void)_X11TransClose(trans_conn); - if (saddr) free ((char *) saddr); - if (pprotocol) Xfree (pprotocol); - if (phostname) Xfree (phostname); - if (address && address != addrbuf) { Xfree(address); address = addrbuf; } - -#if defined(TCPCONN) - if (tcphostname) { - pprotocol = copystring("tcp", 3); - phostname = tcphostname; - tcphostname = NULL; - goto connect; - } -#endif - - if (pdpynum) Xfree (pdpynum); - if (pscrnum) Xfree (pscrnum); - return NULL; - -} - -/* - * This is gross, but we need it for compatiblity. - * The test suite relies on the following interface. - * - */ - -int _XConnectDisplay ( - char *display_name, - char **fullnamep, /* RETURN */ - int *dpynump, /* RETURN */ - int *screenp, /* RETURN */ - char **auth_namep, /* RETURN */ - int *auth_namelenp, /* RETURN */ - char **auth_datap, /* RETURN */ - int *auth_datalenp) /* RETURN */ -{ - XtransConnInfo trans_conn; - - trans_conn = _X11TransConnectDisplay ( - display_name, fullnamep, dpynump, screenp, - auth_namep, auth_namelenp, auth_datap, auth_datalenp); - - if (trans_conn) - { - int fd = _X11TransGetConnectionNumber (trans_conn); - _X11TransFreeConnInfo (trans_conn); - return (fd); - } - else - return (-1); -} - - -/***************************************************************************** - * * - * Connection Utility Routines * - * * - *****************************************************************************/ - -/* - * Disconnect from server. - */ - -int _XDisconnectDisplay (trans_conn) - -XtransConnInfo trans_conn; - -{ - _X11TransDisconnect(trans_conn); - _X11TransClose(trans_conn); - return 0; -} - - - -Bool -_XSendClientPrefix (dpy, client, auth_proto, auth_string, prefix) - Display *dpy; - xConnClientPrefix *client; /* contains count for auth_* */ - char *auth_proto, *auth_string; /* NOT null-terminated */ - xConnSetupPrefix *prefix; /* prefix information */ -{ - int auth_length = client->nbytesAuthProto; - int auth_strlen = client->nbytesAuthString; - static char padbuf[3]; /* for padding to 4x bytes */ - int pad; - struct iovec iovarray[5], *iov = iovarray; - int niov = 0; - int len = 0; - -#define add_to_iov(b,l) \ - { iov->iov_base = (b); iov->iov_len = (l); iov++, niov++; len += (l); } - - add_to_iov ((caddr_t) client, SIZEOF(xConnClientPrefix)); - - /* - * write authorization protocol name and data - */ - if (auth_length > 0) { - add_to_iov (auth_proto, auth_length); - pad = -auth_length & 3; /* pad auth_length to a multiple of 4 */ - if (pad) add_to_iov (padbuf, pad); - } - if (auth_strlen > 0) { - add_to_iov (auth_string, auth_strlen); - pad = -auth_strlen & 3; /* pad auth_strlen to a multiple of 4 */ - if (pad) add_to_iov (padbuf, pad); - } - -#undef add_to_iov - - len -= _X11TransWritev (dpy->trans_conn, iovarray, niov); - - /* - * Set the connection non-blocking since we use select() to block. - */ - - _X11TransSetOption(dpy->trans_conn, TRANS_NONBLOCKING, 1); - - if (len != 0) - return -1; -#ifdef NX_TRANS_SOCKET - if (_NXDisplayWriteFunction != NULL) { - (*_NXDisplayWriteFunction)(dpy, len); - } -#ifdef NX_TRANS_CHANGE - if (_NXDisplayCongestionFunction != NULL && - _X11TransSocketCongestionChange(dpy->trans_conn, &congestion) == 1) { - (*_NXDisplayCongestionFunction)(dpy, congestion); - } -#endif -#endif - -#ifdef K5AUTH - if (auth_length == 14 && - !strncmp(auth_proto, "MIT-KERBEROS-5", 14)) - { - return k5_clientauth(dpy, prefix); - } else -#endif - return 0; -} - - -#ifdef STREAMSCONN -#ifdef SVR4 -#include -#else -#undef HASXDMAUTH -#endif -#endif - -#ifdef SECURE_RPC -#include -#ifdef ultrix -#include -#include -#endif -#endif - -#ifdef HASXDMAUTH -#include -#define Time_t time_t -#endif - -/* - * First, a routine for setting authorization data - */ -static int xauth_namelen = 0; -static char *xauth_name = NULL; /* NULL means use default mechanism */ -static int xauth_datalen = 0; -static char *xauth_data = NULL; /* NULL means get default data */ - -/* - * This is a list of the authorization names which Xlib currently supports. - * Xau will choose the file entry which matches the earliest entry in this - * array, allowing us to prioritize these in terms of the most secure first - */ - -static char *default_xauth_names[] = { -#ifdef K5AUTH - "MIT-KERBEROS-5", -#endif -#ifdef SECURE_RPC - "SUN-DES-1", -#endif -#ifdef HASXDMAUTH - "XDM-AUTHORIZATION-1", -#endif - "MIT-MAGIC-COOKIE-1" -}; - -static _Xconst int default_xauth_lengths[] = { -#ifdef K5AUTH - 14, /* strlen ("MIT-KERBEROS-5") */ -#endif -#ifdef SECURE_RPC - 9, /* strlen ("SUN-DES-1") */ -#endif -#ifdef HASXDMAUTH - 19, /* strlen ("XDM-AUTHORIZATION-1") */ -#endif - 18 /* strlen ("MIT-MAGIC-COOKIE-1") */ -}; - -#define NUM_DEFAULT_AUTH (sizeof (default_xauth_names) / sizeof (default_xauth_names[0])) - -static char **xauth_names = default_xauth_names; -static _Xconst int *xauth_lengths = default_xauth_lengths; - -static int xauth_names_length = NUM_DEFAULT_AUTH; - -void XSetAuthorization (name, namelen, data, datalen) - int namelen, datalen; /* lengths of name and data */ - char *name, *data; /* NULL or arbitrary array of bytes */ -{ - char *tmpname, *tmpdata; - - _XLockMutex(_Xglobal_lock); - if (xauth_name) Xfree (xauth_name); /* free any existing data */ - if (xauth_data) Xfree (xauth_data); - - xauth_name = xauth_data = NULL; /* mark it no longer valid */ - xauth_namelen = xauth_datalen = 0; - _XUnlockMutex(_Xglobal_lock); - - if (namelen < 0) namelen = 0; /* check for bogus inputs */ - if (datalen < 0) datalen = 0; /* maybe should return? */ - - if (namelen > 0) { /* try to allocate space */ - tmpname = Xmalloc ((unsigned) namelen); - if (!tmpname) return; - memcpy (tmpname, name, namelen); - } else { - tmpname = NULL; - } - - if (datalen > 0) { - tmpdata = Xmalloc ((unsigned) datalen); - if (!tmpdata) { - if (tmpname) (void) Xfree (tmpname); - return; - } - memcpy (tmpdata, data, datalen); - } else { - tmpdata = NULL; - } - - _XLockMutex(_Xglobal_lock); - xauth_name = tmpname; /* and store the suckers */ - xauth_namelen = namelen; - if (tmpname) - { - xauth_names = &xauth_name; - xauth_lengths = &xauth_namelen; - xauth_names_length = 1; - } - else - { - xauth_names = default_xauth_names; - xauth_lengths = default_xauth_lengths; - xauth_names_length = NUM_DEFAULT_AUTH; - } - xauth_data = tmpdata; - xauth_datalen = datalen; - _XUnlockMutex(_Xglobal_lock); - return; -} - -#ifdef SECURE_RPC -/* - * Create a credential that we can send to the X server. - */ -static int -auth_ezencode(servername, window, cred_out, len) - char *servername; - int window; - char *cred_out; - int *len; -{ - AUTH *a; - XDR xdr; - -#if defined(SVR4) && defined(sun) - a = authdes_seccreate(servername, window, NULL, NULL); -#else - a = (AUTH *)authdes_create(servername, window, NULL, NULL); -#endif - if (a == (AUTH *)NULL) { - perror("auth_create"); - return 0; - } - xdrmem_create(&xdr, cred_out, *len, XDR_ENCODE); - if (AUTH_MARSHALL(a, &xdr) == FALSE) { - perror("auth_marshall"); - AUTH_DESTROY(a); - return 0; - } - *len = xdr_getpos(&xdr); - AUTH_DESTROY(a); - return 1; -} -#endif - -#ifdef K5AUTH -#include - -extern krb5_flags krb5_kdc_default_options; - -/* - * k5_clientauth - * - * Returns non-zero if the setup prefix has been read, - * so we can tell XOpenDisplay to not bother looking for it by - * itself. - */ -static int k5_clientauth(dpy, sprefix) - Display *dpy; - xConnSetupPrefix *sprefix; -{ - krb5_error_code retval; - xReq prefix; - char *buf; - CARD16 plen, tlen; - krb5_data kbuf; - krb5_ccache cc; - krb5_creds creds; - krb5_principal cprinc, sprinc; - krb5_ap_rep_enc_part *repl; - - krb5_init_ets(); - /* - * stage 0: get encoded principal and tgt from server - */ - _XRead(dpy, (char *)&prefix, sz_xReq); - if (prefix.reqType != 2 && prefix.reqType != 3) - /* not an auth packet... so deal */ - if (prefix.reqType == 0 || prefix.reqType == 1) - { - memcpy((char *)sprefix, (char *)&prefix, sz_xReq); - _XRead(dpy, (char *)sprefix + sz_xReq, - sz_xConnSetupPrefix - sz_xReq); /* ewww... gross */ - return 1; - } - else - { - fprintf(stderr, - "Xlib: Krb5 stage 0: got illegal connection setup success code %d\n", - prefix.reqType); - return -1; - } - if (prefix.data != 0) - { - fprintf(stderr, "Xlib: got out of sequence (%d) packet in Krb5 auth\n", - prefix.data); - return -1; - } - buf = (char *)malloc((prefix.length << 2) - sz_xReq); - if (buf == NULL) /* malloc failed. Run away! */ - { - fprintf(stderr, "Xlib: malloc bombed in Krb5 auth\n"); - return -1; - } - tlen = (prefix.length << 2) - sz_xReq; - _XRead(dpy, buf, tlen); - if (prefix.reqType == 2 && tlen < 6) - { - fprintf(stderr, "Xlib: Krb5 stage 0 reply from server too short\n"); - free(buf); - return -1; - } - if (prefix.reqType == 2) - { - plen = *(CARD16 *)buf; - kbuf.data = buf + 2; - kbuf.length = (plen > tlen) ? tlen : plen; - } - else - { - kbuf.data = buf; - kbuf.length = tlen; - } - if (XauKrb5Decode(kbuf, &sprinc)) - { - free(buf); - fprintf(stderr, "Xlib: XauKrb5Decode bombed\n"); - return -1; - } - if (prefix.reqType == 3) /* do some special stuff here */ - { - char *sname, *hostname = NULL; - - sname = (char *)malloc(krb5_princ_component(sprinc, 0)->length + 1); - if (sname == NULL) - { - free(buf); - krb5_free_principal(sprinc); - fprintf(stderr, "Xlib: malloc bombed in Krb5 auth\n"); - return -1; - } - memcpy(sname, krb5_princ_component(sprinc, 0)->data, - krb5_princ_component(sprinc, 0)->length); - sname[krb5_princ_component(sprinc, 0)->length] = '\0'; - krb5_free_principal(sprinc); - if (dpy->display_name[0] != ':') /* hunt for a hostname */ - { - char *t; - - if ((hostname = (char *)malloc(strlen(dpy->display_name))) - == NULL) - { - free(buf); - free(sname); - fprintf(stderr, "Xlib: malloc bombed in Krb5 auth\n"); - return -1; - } - strcpy(hostname, dpy->display_name); - t = strchr(hostname, ':'); - if (t == NULL) - { - free(buf); - free(sname); - free(hostname); - fprintf(stderr, - "Xlib: shouldn't get here! malformed display name."); - return -1; - } - if ((t - hostname + 1 < strlen(hostname)) && t[1] == ':') - t++; - *t = '\0'; /* truncate the dpy number out */ - } - retval = krb5_sname_to_principal(hostname, sname, - KRB5_NT_SRV_HST, &sprinc); - free(sname); - if (hostname) - free(hostname); - if (retval) - { - free(buf); - fprintf(stderr, "Xlib: krb5_sname_to_principal failed: %s\n", - error_message(retval)); - return -1; - } - } - if (retval = krb5_cc_default(&cc)) - { - free(buf); - krb5_free_principal(sprinc); - fprintf(stderr, "Xlib: krb5_cc_default failed: %s\n", - error_message(retval)); - return -1; - } - if (retval = krb5_cc_get_principal(cc, &cprinc)) - { - free(buf); - krb5_free_principal(sprinc); - fprintf(stderr, "Xlib: cannot get Kerberos principal from \"%s\": %s\n", - krb5_cc_default_name(), error_message(retval)); - return -1; - } - bzero((char *)&creds, sizeof(creds)); - creds.server = sprinc; - creds.client = cprinc; - if (prefix.reqType == 2) - { - creds.second_ticket.length = tlen - plen - 2; - creds.second_ticket.data = buf + 2 + plen; - retval = krb5_get_credentials(KRB5_GC_USER_USER | - krb5_kdc_default_options, - cc, &creds); - } - else - retval = krb5_get_credentials(krb5_kdc_default_options, - cc, &creds); - if (retval) - { - free(buf); - krb5_free_cred_contents(&creds); - fprintf(stderr, "Xlib: cannot get Kerberos credentials: %s\n", - error_message(retval)); - return -1; - } - /* - * now format the ap_req to send to the server - */ - if (prefix.reqType == 2) - retval = krb5_mk_req_extended(AP_OPTS_USE_SESSION_KEY | - AP_OPTS_MUTUAL_REQUIRED, NULL, - 0, 0, NULL, cc, - &creds, NULL, &kbuf); - else - retval = krb5_mk_req_extended(AP_OPTS_MUTUAL_REQUIRED, NULL, - 0, 0, NULL, cc, &creds, NULL, - &kbuf); - free(buf); - if (retval) /* Some manner of Kerberos lossage */ - { - krb5_free_cred_contents(&creds); - fprintf(stderr, "Xlib: krb5_mk_req_extended failed: %s\n", - error_message(retval)); - return -1; - } - prefix.reqType = 1; - prefix.data = 0; - prefix.length = (kbuf.length + sz_xReq + 3) >> 2; - /* - * stage 1: send ap_req to server - */ - _XSend(dpy, (char *)&prefix, sz_xReq); - _XSend(dpy, (char *)kbuf.data, kbuf.length); - free(kbuf.data); - /* - * stage 2: get ap_rep from server to mutually authenticate - */ - _XRead(dpy, (char *)&prefix, sz_xReq); - if (prefix.reqType != 2) - if (prefix.reqType == 0 || prefix.reqType == 1) - { - memcpy((char *)sprefix, (char *)&prefix, sz_xReq); - _XRead(dpy, (char *)sprefix + sz_xReq, - sz_xConnSetupPrefix - sz_xReq); - return 1; - } - else - { - fprintf(stderr, - "Xlib: Krb5 stage 2: got illegal connection setup success code %d\n", - prefix.reqType); - return -1; - } - if (prefix.data != 2) - return -1; - kbuf.length = (prefix.length << 2) - sz_xReq; - kbuf.data = (char *)malloc(kbuf.length); - if (kbuf.data == NULL) - { - fprintf(stderr, "Xlib: malloc bombed in Krb5 auth\n"); - return -1; - } - _XRead(dpy, (char *)kbuf.data, kbuf.length); - retval = krb5_rd_rep(&kbuf, &creds.keyblock, &repl); - if (retval) - { - free(kbuf.data); - fprintf(stderr, "Xlib: krb5_rd_rep failed: %s\n", - error_message(retval)); - return -1; - } - free(kbuf.data); - /* - * stage 3: send a short ack to the server and return - */ - prefix.reqType = 3; - prefix.data = 0; - prefix.length = sz_xReq >> 2; - _XSend(dpy, (char *)&prefix, sz_xReq); - return 0; -} -#endif /* K5AUTH */ - -static void -GetAuthorization( - XtransConnInfo trans_conn, - int family, - char *saddr, - int saddrlen, - int idisplay, - char **auth_namep, /* RETURN */ - int *auth_namelenp, /* RETURN */ - char **auth_datap, /* RETURN */ - int *auth_datalenp) /* RETURN */ -{ -#ifdef SECURE_RPC - char rpc_cred[MAX_AUTH_BYTES]; -#endif -#ifdef HASXDMAUTH - unsigned char xdmcp_data[192/8]; -#endif - char *auth_name; - int auth_namelen; - unsigned char *auth_data; - int auth_datalen; - Xauth *authptr = NULL; - -/* - * Look up the authorization protocol name and data if necessary. - */ - if (xauth_name && xauth_data) { - auth_namelen = xauth_namelen; - auth_name = xauth_name; - auth_datalen = xauth_datalen; - auth_data = (unsigned char *) xauth_data; - } else { - char dpynumbuf[40]; /* big enough to hold 2^64 and more */ - (void) sprintf (dpynumbuf, "%d", idisplay); - - authptr = XauGetBestAuthByAddr ((unsigned short) family, - (unsigned short) saddrlen, - saddr, - (unsigned short) strlen (dpynumbuf), - dpynumbuf, - xauth_names_length, - xauth_names, - xauth_lengths); - if (authptr) { - auth_namelen = authptr->name_length; - auth_name = (char *)authptr->name; - auth_datalen = authptr->data_length; - auth_data = (unsigned char *) authptr->data; - } else { - auth_namelen = 0; - auth_name = NULL; - auth_datalen = 0; - auth_data = NULL; - } - } -#ifdef HASXDMAUTH - /* - * build XDM-AUTHORIZATION-1 data - */ - if (auth_namelen == 19 && !strncmp (auth_name, "XDM-AUTHORIZATION-1", 19)) - { - int i, j; - Time_t now; - int family, addrlen; - Xtransaddr *addr = NULL; - - for (j = 0; j < 8; j++) - xdmcp_data[j] = auth_data[j]; - - _X11TransGetMyAddr(trans_conn, &family, &addrlen, &addr); - - switch( family ) - { -#ifdef AF_INET - case AF_INET: - { - /* - * addr will contain a sockaddr_in with all - * of the members already in network byte order. - */ - - for(i=4; i<8; i++) /* do sin_addr */ - xdmcp_data[j++] = ((char *)addr)[i]; - for(i=2; i<4; i++) /* do sin_port */ - xdmcp_data[j++] = ((char *)addr)[i]; - break; - } -#endif /* AF_INET */ -#if defined(IPv6) && defined(AF_INET6) - case AF_INET6: - /* XXX This should probably never happen */ - { - unsigned char ipv4mappedprefix[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff }; - - /* In the case of v4 mapped addresses send the v4 - part of the address - addr is already in network byte order */ - if (memcmp(addr+8, ipv4mappedprefix, 12) == 0) { - for (i = 20 ; i < 24; i++) - xdmcp_data[j++] = ((char *)addr)[i]; - - /* Port number */ - for (i=2; i<4; i++) - xdmcp_data[j++] = ((char *)addr)[i]; - } else { - /* Fake data to keep the data aligned. Otherwise the - the server will bail about incorrect timing data */ - for (i = 0; i < 6; i++) { - xdmcp_data[j++] = 0; - } - } - break; - } -#endif /* AF_INET6 */ -#ifdef AF_UNIX - case AF_UNIX: - { - /* - * We don't use the sockaddr_un for this encoding. - * Instead, we create a sockaddr_in filled with - * a decreasing counter for the address, and the - * pid for the port. - */ - - static unsigned long unix_addr = 0xFFFFFFFF; - unsigned long the_addr; - unsigned short the_port; - unsigned long the_utime; - struct timeval tp; - - X_GETTIMEOFDAY(&tp); - _XLockMutex(_Xglobal_lock); - the_addr = unix_addr--; - _XUnlockMutex(_Xglobal_lock); - the_utime = (unsigned long) tp.tv_usec; - the_port = getpid (); - - xdmcp_data[j++] = (the_utime >> 24) & 0xFF; - xdmcp_data[j++] = (the_utime >> 16) & 0xFF; - xdmcp_data[j++] = ((the_utime >> 8) & 0xF0) - | ((the_addr >> 8) & 0x0F); - xdmcp_data[j++] = (the_addr >> 0) & 0xFF; - xdmcp_data[j++] = (the_port >> 8) & 0xFF; - xdmcp_data[j++] = (the_port >> 0) & 0xFF; - break; - } -#endif /* AF_UNIX */ -#ifdef AF_DECnet - case AF_DECnet: - /* - * What is the defined encoding for this? - */ - break; -#endif /* AF_DECnet */ - default: - /* - * Need to return some kind of errro status here. - * maybe a NULL auth?? - */ - break; - } /* switch */ - - if (addr) - free ((char *) addr); - - time (&now); - xdmcp_data[j++] = (now >> 24) & 0xFF; - xdmcp_data[j++] = (now >> 16) & 0xFF; - xdmcp_data[j++] = (now >> 8) & 0xFF; - xdmcp_data[j++] = (now >> 0) & 0xFF; - while (j < 192 / 8) - xdmcp_data[j++] = 0; - _XLockMutex(_Xglobal_lock); - /* this function might use static data, hence the lock around it */ - XdmcpWrap (xdmcp_data, auth_data + 8, - xdmcp_data, j); - _XUnlockMutex(_Xglobal_lock); - auth_data = xdmcp_data; - auth_datalen = j; - } -#endif /* HASXDMAUTH */ -#ifdef SECURE_RPC - /* - * The SUN-DES-1 authorization protocol uses the - * "secure RPC" mechanism in SunOS 4.0+. - */ - if (auth_namelen == 9 && !strncmp(auth_name, "SUN-DES-1", 9)) { - char servernetname[MAXNETNAMELEN + 1]; - - /* - * Copy over the server's netname from the authorization - * data field filled in by XauGetAuthByAddr(). - */ - if (auth_datalen > MAXNETNAMELEN) { - auth_datalen = 0; - auth_data = NULL; - } else { - memcpy(servernetname, auth_data, auth_datalen); - servernetname[auth_datalen] = '\0'; - - auth_datalen = sizeof (rpc_cred); - if (auth_ezencode(servernetname, 100, rpc_cred, - &auth_datalen)) - auth_data = (unsigned char *) rpc_cred; - else { - auth_datalen = 0; - auth_data = NULL; - } - } - } -#endif - if (saddr) free ((char *) saddr); - if ((*auth_namelenp = auth_namelen)) - { - if ((*auth_namep = Xmalloc(auth_namelen))) - memcpy(*auth_namep, auth_name, auth_namelen); - else - *auth_namelenp = 0; - } - else - *auth_namep = NULL; - if ((*auth_datalenp = auth_datalen)) - { - if ((*auth_datap = Xmalloc(auth_datalen))) - memcpy(*auth_datap, auth_data, auth_datalen); - else - *auth_datalenp = 0; - } - else - *auth_datap = NULL; - if (authptr) XauDisposeAuth (authptr); -} diff --git a/nx-X11/lib/X11/ConnDis.c.X.original b/nx-X11/lib/X11/ConnDis.c.X.original deleted file mode 100644 index 30616d207..000000000 --- a/nx-X11/lib/X11/ConnDis.c.X.original +++ /dev/null @@ -1,1233 +0,0 @@ -/* $XdotOrg: xc/lib/X11/ConnDis.c,v 1.10 2005/07/03 07:00:55 daniels Exp $ */ -/* $Xorg: ConnDis.c,v 1.8 2001/02/09 02:03:31 xorgcvs Exp $ */ -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/ConnDis.c,v 3.28 2003/12/02 23:33:17 herrb Exp $ */ - -/* - * This file contains operating system dependencies. - */ - -#define NEED_EVENTS - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include - -#if !defined(WIN32) -#ifndef Lynx -#include -#else -#include -#endif -#else -#include -#endif - -#ifndef X_CONNECTION_RETRIES /* number retries on ECONNREFUSED */ -#define X_CONNECTION_RETRIES 5 -#endif - -#ifdef LOCALCONN -#include -#endif - -#include "Xintconn.h" - -/* prototypes */ -static void GetAuthorization( - XtransConnInfo trans_conn, - int family, - char *saddr, - int saddrlen, - int idisplay, - char **auth_namep, - int *auth_namelenp, - char **auth_datap, - int *auth_datalenp); - -/* functions */ -static char *copystring (char *src, int len) -{ - char *dst = Xmalloc (len + 1); - - if (dst) { - strncpy (dst, src, len); - dst[len] = '\0'; - } - - return dst; -} - - -/* - * Attempts to connect to server, given display name. Returns file descriptor - * (network socket) or -1 if connection fails. Display names may be of the - * following format: - * - * [protocol/] [hostname] : [:] displaynumber [.screennumber] - * - * A string with exactly two colons seperating hostname from the display - * indicates a DECnet style name. Colons in the hostname may occur if an - * IPv6 numeric address is used as the hostname. An IPv6 numeric address - * may also end in a double colon, so three colons in a row indicates an - * IPv6 address ending in :: followed by :display. To make it easier for - * people to read, an IPv6 numeric address hostname may be surrounded by - * [ ] in a similar fashion to the IPv6 numeric address URL syntax defined - * by IETF RFC 2732. - * - * If no hostname and no protocol is specified, the string is interpreted - * as the most efficient local connection to a server on the same machine. - * This is usually: - * - * o shared memory - * o local stream - * o UNIX domain socket - * o TCP to local host - * - * This function will eventually call the X Transport Interface functions - * which expects the hostname in the format: - * - * [protocol/] [hostname] : [:] displaynumber - * - */ -XtransConnInfo -_X11TransConnectDisplay ( - char *display_name, - char **fullnamep, /* RETURN */ - int *dpynump, /* RETURN */ - int *screenp, /* RETURN */ - char **auth_namep, /* RETURN */ - int *auth_namelenp, /* RETURN */ - char **auth_datap, /* RETURN */ - int *auth_datalenp) /* RETURN */ -{ - int family; - int saddrlen; - Xtransaddr *saddr; - char *lastp, *lastc, *p; /* char pointers */ - char *pprotocol = NULL; /* start of protocol name */ - char *phostname = NULL; /* start of host of display */ - char *pdpynum = NULL; /* start of dpynum of display */ - char *pscrnum = NULL; /* start of screen of display */ - Bool dnet = False; /* if true, then DECnet format */ - int idisplay = 0; /* required display number */ - int iscreen = 0; /* optional screen number */ - /* int (*connfunc)(); */ /* method to create connection */ - int len, hostlen; /* length tmp variable */ - int retry; /* retry counter */ - char addrbuf[128]; /* final address passed to - X Transport Interface */ - char* address = addrbuf; - XtransConnInfo trans_conn = NULL; /* transport connection object */ - int connect_stat; -#ifdef LOCALCONN - struct utsname sys; -#endif -#ifdef TCPCONN - char *tcphostname = NULL; /* A place to save hostname pointer */ -#endif - - p = display_name; - - saddrlen = 0; /* set so that we can clear later */ - saddr = NULL; - - /* - * Step 0, find the protocol. This is delimited by the optional - * slash ('/'). - */ - for (lastp = p; *p && *p != ':' && *p != '/'; p++) ; - if (!*p) return NULL; /* must have a colon */ - - if (p != lastp && *p != ':') { /* protocol given? */ - pprotocol = copystring (lastp, p - lastp); - if (!pprotocol) goto bad; /* no memory */ - p++; /* skip the '/' */ - } else - p = display_name; /* reset the pointer in - case no protocol was given */ - - /* - * Step 1, find the hostname. This is delimited by either one colon, - * or two colons in the case of DECnet (DECnet Phase V allows a single - * colon in the hostname). (See note above regarding IPv6 numeric - * addresses with triple colons or [] brackets.) - */ - - lastp = p; - lastc = NULL; - for (; *p; p++) - if (*p == ':') - lastc = p; - - if (!lastc) return NULL; /* must have a colon */ - - if ((lastp != lastc) && (*(lastc - 1) == ':') -#if defined(IPv6) && defined(AF_INET6) - && ( ((lastc - 1) == lastp) || (*(lastc - 2) != ':')) -#endif - ) { - /* DECnet display specified */ - -#ifndef DNETCONN - goto bad; -#else - dnet = True; - /* override the protocol specified */ - if (pprotocol) - Xfree (pprotocol); - pprotocol = copystring ("dnet", 4); - hostlen = lastc - 1 - lastp; -#endif - } - else - hostlen = lastc - lastp; - - if (hostlen > 0) { /* hostname given? */ - phostname = copystring (lastp, hostlen); - if (!phostname) goto bad; /* no memory */ - } - - p = lastc; - -#ifdef LOCALCONN - /* check if phostname == localnodename AND protocol not specified */ - if (!pprotocol && phostname && uname(&sys) >= 0 && - !strncmp(phostname, sys.nodename, - (strlen(sys.nodename) < strlen(phostname) ? - strlen(phostname) : strlen(sys.nodename)))) - { -#ifdef TCPCONN - /* - * We'll first attempt to connect using the local transport. If - * this fails (which is the case if sshd X protocol forwarding is - * being used), retry using tcp and this hostname. - */ - tcphostname = copystring(phostname, strlen(phostname)); -#endif - Xfree (phostname); - phostname = copystring ("unix", 4); - } -#endif - - - /* - * Step 2, find the display number. This field is required and is - * delimited either by a nul or a period, depending on whether or not - * a screen number is present. - */ - - for (lastp = ++p; *p && isascii(*p) && isdigit(*p); p++) ; - if ((p == lastp) || /* required field */ - (*p != '\0' && *p != '.') || /* invalid non-digit terminator */ - !(pdpynum = copystring (lastp, p - lastp))) /* no memory */ - goto bad; - idisplay = atoi (pdpynum); - - - /* - * Step 3, find the screen number. This field is optional. It is - * present only if the display number was followed by a period (which - * we've already verified is the only non-nul character). - */ - - if (*p) { - for (lastp = ++p; *p && isascii(*p) && isdigit (*p); p++) ; - if (p != lastp) { - if (*p || /* non-digits */ - !(pscrnum = copystring (lastp, p - lastp))) /* no memory */ - goto bad; - iscreen = atoi (lastp); - } - } - - /* - * At this point, we know the following information: - * - * pprotocol protocol string or NULL - * phostname hostname string or NULL - * idisplay display number - * iscreen screen number - * dnet DECnet boolean - * - * We can now decide which transport to use based on the ConnectionFlags - * build parameter the hostname string. If phostname is NULL or equals - * the string "local", then choose the best transport. If phostname - * is "unix", then choose BSD UNIX domain sockets (if configured). - */ - -#if defined(TCPCONN) || defined(UNIXCONN) || defined(LOCALCONN) || defined(MNX_TCPCONN) || defined(OS2PIPECONN) - if (!pprotocol) { - if (!phostname) { -#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) - pprotocol = copystring ("local", 5); -#if defined(TCPCONN) - tcphostname = copystring("localhost", 9); -#endif - } - else - { -#endif - pprotocol = copystring ("tcp", 3); - } - } -#endif - -#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) - /* - * Now that the defaults have been established, see if we have any - * special names that we have to override: - * - * :N => if UNIXCONN then unix-domain-socket - * ::N => if UNIXCONN then unix-domain-socket - * unix:N => if UNIXCONN then unix-domain-socket - * - * Note that if UNIXCONN isn't defined, then we can use the default - * transport connection function set above. - */ - - if (!phostname) { -#ifdef apollo - ; /* Unix domain sockets are *really* bad on apollos */ -#else - if( pprotocol ) Xfree(pprotocol); - pprotocol = copystring ("local", 5); -#endif - } - else if (strcmp (phostname, "unix") == 0) { - if( pprotocol ) Xfree(pprotocol); - pprotocol = copystring ("local", 5); - } -#endif - -#if defined(TCPCONN) - connect: -#endif - /* - * This seems kind of backwards, but we need to put the protocol, - * host, and port back together to pass to _X11TransOpenCOTSClient(). - */ - - { - int olen = 3 + (pprotocol ? strlen(pprotocol) : 0) + - (phostname ? strlen(phostname) : 0) + - (pdpynum ? strlen(pdpynum) : 0); - if (olen > sizeof addrbuf) address = Xmalloc (olen); - } - if (!address) goto bad; - - sprintf(address,"%s/%s:%d", - pprotocol ? pprotocol : "", - phostname ? phostname : "", - idisplay ); - - /* - * Make the connection, also need to get the auth address info for - * the connection. Do retries in case server host has hit its - * backlog (which, unfortunately, isn't distinguishable from there not - * being a server listening at all, which is why we have to not retry - * too many times). - */ - for(retry=X_CONNECTION_RETRIES; retry>=0; retry-- ) - { - if ( (trans_conn = _X11TransOpenCOTSClient(address)) == NULL ) - { - break; - } - if ((connect_stat = _X11TransConnect(trans_conn,address)) < 0 ) - { - _X11TransClose(trans_conn); - trans_conn = NULL; - - if (connect_stat == TRANS_TRY_CONNECT_AGAIN) - { - sleep(1); - continue; - } - else - break; - } - - _X11TransGetPeerAddr(trans_conn, &family, &saddrlen, &saddr); - - /* - * The family is given in a socket format (ie AF_INET). This - * will convert it to the format used by the authorization and - * X protocol (ie FamilyInternet). - */ - - if( _X11TransConvertAddress(&family, &saddrlen, &saddr) < 0 ) - { - _X11TransClose(trans_conn); - trans_conn = NULL; - sleep(1); - if (saddr) - { - free ((char *) saddr); - saddr = NULL; - } - continue; - } - - break; - } - - if (address != addrbuf) Xfree (address); - address = addrbuf; - - if( trans_conn == NULL ) - goto bad; - - /* - * Set close-on-exec so that programs that fork() doesn't get confused. - */ - - _X11TransSetOption(trans_conn,TRANS_CLOSEONEXEC,1); - - /* - * Build the expanded display name: - * - * [host] : [:] dpy . scr \0 - */ - len = ((phostname ? strlen(phostname) : 0) + 1 + (dnet ? 1 : 0) + - strlen(pdpynum) + 1 + (pscrnum ? strlen(pscrnum) : 1) + 1); - *fullnamep = (char *) Xmalloc (len); - if (!*fullnamep) goto bad; - - sprintf (*fullnamep, "%s%s%d.%d", - (phostname ? phostname : ""), - (dnet ? "::" : ":"), - idisplay, iscreen); - - *dpynump = idisplay; - *screenp = iscreen; - if (pprotocol) Xfree (pprotocol); - if (phostname) Xfree (phostname); - if (pdpynum) Xfree (pdpynum); - if (pscrnum) Xfree (pscrnum); -#ifdef TCPCONN - if (tcphostname) Xfree (tcphostname); -#endif - - GetAuthorization(trans_conn, family, (char *) saddr, saddrlen, idisplay, - auth_namep, auth_namelenp, auth_datap, auth_datalenp); - return trans_conn; - - - /* - * error return; make sure everything is cleaned up. - */ - bad: - if (trans_conn) (void)_X11TransClose(trans_conn); - if (saddr) free ((char *) saddr); - if (pprotocol) Xfree (pprotocol); - if (phostname) Xfree (phostname); - if (address && address != addrbuf) { Xfree(address); address = addrbuf; } - -#if defined(TCPCONN) - if (tcphostname) { - pprotocol = copystring("tcp", 3); - phostname = tcphostname; - tcphostname = NULL; - goto connect; - } -#endif - - if (pdpynum) Xfree (pdpynum); - if (pscrnum) Xfree (pscrnum); - return NULL; - -} - -/* - * This is gross, but we need it for compatiblity. - * The test suite relies on the following interface. - * - */ - -int _XConnectDisplay ( - char *display_name, - char **fullnamep, /* RETURN */ - int *dpynump, /* RETURN */ - int *screenp, /* RETURN */ - char **auth_namep, /* RETURN */ - int *auth_namelenp, /* RETURN */ - char **auth_datap, /* RETURN */ - int *auth_datalenp) /* RETURN */ -{ - XtransConnInfo trans_conn; - - trans_conn = _X11TransConnectDisplay ( - display_name, fullnamep, dpynump, screenp, - auth_namep, auth_namelenp, auth_datap, auth_datalenp); - - if (trans_conn) - { - int fd = _X11TransGetConnectionNumber (trans_conn); - _X11TransFreeConnInfo (trans_conn); - return (fd); - } - else - return (-1); -} - - -/***************************************************************************** - * * - * Connection Utility Routines * - * * - *****************************************************************************/ - -/* - * Disconnect from server. - */ - -int _XDisconnectDisplay (trans_conn) - -XtransConnInfo trans_conn; - -{ - _X11TransDisconnect(trans_conn); - _X11TransClose(trans_conn); - return 0; -} - - - -Bool -_XSendClientPrefix (dpy, client, auth_proto, auth_string, prefix) - Display *dpy; - xConnClientPrefix *client; /* contains count for auth_* */ - char *auth_proto, *auth_string; /* NOT null-terminated */ - xConnSetupPrefix *prefix; /* prefix information */ -{ - int auth_length = client->nbytesAuthProto; - int auth_strlen = client->nbytesAuthString; - static char padbuf[3]; /* for padding to 4x bytes */ - int pad; - struct iovec iovarray[5], *iov = iovarray; - int niov = 0; - int len = 0; - -#define add_to_iov(b,l) \ - { iov->iov_base = (b); iov->iov_len = (l); iov++, niov++; len += (l); } - - add_to_iov ((caddr_t) client, SIZEOF(xConnClientPrefix)); - - /* - * write authorization protocol name and data - */ - if (auth_length > 0) { - add_to_iov (auth_proto, auth_length); - pad = -auth_length & 3; /* pad auth_length to a multiple of 4 */ - if (pad) add_to_iov (padbuf, pad); - } - if (auth_strlen > 0) { - add_to_iov (auth_string, auth_strlen); - pad = -auth_strlen & 3; /* pad auth_strlen to a multiple of 4 */ - if (pad) add_to_iov (padbuf, pad); - } - -#undef add_to_iov - - len -= _X11TransWritev (dpy->trans_conn, iovarray, niov); - - /* - * Set the connection non-blocking since we use select() to block. - */ - - _X11TransSetOption(dpy->trans_conn, TRANS_NONBLOCKING, 1); - - if (len != 0) - return -1; - -#ifdef K5AUTH - if (auth_length == 14 && - !strncmp(auth_proto, "MIT-KERBEROS-5", 14)) - { - return k5_clientauth(dpy, prefix); - } else -#endif - return 0; -} - - -#ifdef STREAMSCONN -#ifdef SVR4 -#include -#else -#undef HASXDMAUTH -#endif -#endif - -#ifdef SECURE_RPC -#include -#ifdef ultrix -#include -#include -#endif -#endif - -#ifdef HASXDMAUTH -#include -#define Time_t time_t -#endif - -/* - * First, a routine for setting authorization data - */ -static int xauth_namelen = 0; -static char *xauth_name = NULL; /* NULL means use default mechanism */ -static int xauth_datalen = 0; -static char *xauth_data = NULL; /* NULL means get default data */ - -/* - * This is a list of the authorization names which Xlib currently supports. - * Xau will choose the file entry which matches the earliest entry in this - * array, allowing us to prioritize these in terms of the most secure first - */ - -static char *default_xauth_names[] = { -#ifdef K5AUTH - "MIT-KERBEROS-5", -#endif -#ifdef SECURE_RPC - "SUN-DES-1", -#endif -#ifdef HASXDMAUTH - "XDM-AUTHORIZATION-1", -#endif - "MIT-MAGIC-COOKIE-1" -}; - -static _Xconst int default_xauth_lengths[] = { -#ifdef K5AUTH - 14, /* strlen ("MIT-KERBEROS-5") */ -#endif -#ifdef SECURE_RPC - 9, /* strlen ("SUN-DES-1") */ -#endif -#ifdef HASXDMAUTH - 19, /* strlen ("XDM-AUTHORIZATION-1") */ -#endif - 18 /* strlen ("MIT-MAGIC-COOKIE-1") */ -}; - -#define NUM_DEFAULT_AUTH (sizeof (default_xauth_names) / sizeof (default_xauth_names[0])) - -static char **xauth_names = default_xauth_names; -static _Xconst int *xauth_lengths = default_xauth_lengths; - -static int xauth_names_length = NUM_DEFAULT_AUTH; - -void XSetAuthorization (name, namelen, data, datalen) - int namelen, datalen; /* lengths of name and data */ - char *name, *data; /* NULL or arbitrary array of bytes */ -{ - char *tmpname, *tmpdata; - - _XLockMutex(_Xglobal_lock); - if (xauth_name) Xfree (xauth_name); /* free any existing data */ - if (xauth_data) Xfree (xauth_data); - - xauth_name = xauth_data = NULL; /* mark it no longer valid */ - xauth_namelen = xauth_datalen = 0; - _XUnlockMutex(_Xglobal_lock); - - if (namelen < 0) namelen = 0; /* check for bogus inputs */ - if (datalen < 0) datalen = 0; /* maybe should return? */ - - if (namelen > 0) { /* try to allocate space */ - tmpname = Xmalloc ((unsigned) namelen); - if (!tmpname) return; - memcpy (tmpname, name, namelen); - } else { - tmpname = NULL; - } - - if (datalen > 0) { - tmpdata = Xmalloc ((unsigned) datalen); - if (!tmpdata) { - if (tmpname) (void) Xfree (tmpname); - return; - } - memcpy (tmpdata, data, datalen); - } else { - tmpdata = NULL; - } - - _XLockMutex(_Xglobal_lock); - xauth_name = tmpname; /* and store the suckers */ - xauth_namelen = namelen; - if (tmpname) - { - xauth_names = &xauth_name; - xauth_lengths = &xauth_namelen; - xauth_names_length = 1; - } - else - { - xauth_names = default_xauth_names; - xauth_lengths = default_xauth_lengths; - xauth_names_length = NUM_DEFAULT_AUTH; - } - xauth_data = tmpdata; - xauth_datalen = datalen; - _XUnlockMutex(_Xglobal_lock); - return; -} - -#ifdef SECURE_RPC -/* - * Create a credential that we can send to the X server. - */ -static int -auth_ezencode(servername, window, cred_out, len) - char *servername; - int window; - char *cred_out; - int *len; -{ - AUTH *a; - XDR xdr; - -#if defined(SVR4) && defined(sun) - a = authdes_seccreate(servername, window, NULL, NULL); -#else - a = (AUTH *)authdes_create(servername, window, NULL, NULL); -#endif - if (a == (AUTH *)NULL) { - perror("auth_create"); - return 0; - } - xdrmem_create(&xdr, cred_out, *len, XDR_ENCODE); - if (AUTH_MARSHALL(a, &xdr) == FALSE) { - perror("auth_marshall"); - AUTH_DESTROY(a); - return 0; - } - *len = xdr_getpos(&xdr); - AUTH_DESTROY(a); - return 1; -} -#endif - -#ifdef K5AUTH -#include - -extern krb5_flags krb5_kdc_default_options; - -/* - * k5_clientauth - * - * Returns non-zero if the setup prefix has been read, - * so we can tell XOpenDisplay to not bother looking for it by - * itself. - */ -static int k5_clientauth(dpy, sprefix) - Display *dpy; - xConnSetupPrefix *sprefix; -{ - krb5_error_code retval; - xReq prefix; - char *buf; - CARD16 plen, tlen; - krb5_data kbuf; - krb5_ccache cc; - krb5_creds creds; - krb5_principal cprinc, sprinc; - krb5_ap_rep_enc_part *repl; - - krb5_init_ets(); - /* - * stage 0: get encoded principal and tgt from server - */ - _XRead(dpy, (char *)&prefix, sz_xReq); - if (prefix.reqType != 2 && prefix.reqType != 3) - /* not an auth packet... so deal */ - if (prefix.reqType == 0 || prefix.reqType == 1) - { - memcpy((char *)sprefix, (char *)&prefix, sz_xReq); - _XRead(dpy, (char *)sprefix + sz_xReq, - sz_xConnSetupPrefix - sz_xReq); /* ewww... gross */ - return 1; - } - else - { - fprintf(stderr, - "Xlib: Krb5 stage 0: got illegal connection setup success code %d\n", - prefix.reqType); - return -1; - } - if (prefix.data != 0) - { - fprintf(stderr, "Xlib: got out of sequence (%d) packet in Krb5 auth\n", - prefix.data); - return -1; - } - buf = (char *)malloc((prefix.length << 2) - sz_xReq); - if (buf == NULL) /* malloc failed. Run away! */ - { - fprintf(stderr, "Xlib: malloc bombed in Krb5 auth\n"); - return -1; - } - tlen = (prefix.length << 2) - sz_xReq; - _XRead(dpy, buf, tlen); - if (prefix.reqType == 2 && tlen < 6) - { - fprintf(stderr, "Xlib: Krb5 stage 0 reply from server too short\n"); - free(buf); - return -1; - } - if (prefix.reqType == 2) - { - plen = *(CARD16 *)buf; - kbuf.data = buf + 2; - kbuf.length = (plen > tlen) ? tlen : plen; - } - else - { - kbuf.data = buf; - kbuf.length = tlen; - } - if (XauKrb5Decode(kbuf, &sprinc)) - { - free(buf); - fprintf(stderr, "Xlib: XauKrb5Decode bombed\n"); - return -1; - } - if (prefix.reqType == 3) /* do some special stuff here */ - { - char *sname, *hostname = NULL; - - sname = (char *)malloc(krb5_princ_component(sprinc, 0)->length + 1); - if (sname == NULL) - { - free(buf); - krb5_free_principal(sprinc); - fprintf(stderr, "Xlib: malloc bombed in Krb5 auth\n"); - return -1; - } - memcpy(sname, krb5_princ_component(sprinc, 0)->data, - krb5_princ_component(sprinc, 0)->length); - sname[krb5_princ_component(sprinc, 0)->length] = '\0'; - krb5_free_principal(sprinc); - if (dpy->display_name[0] != ':') /* hunt for a hostname */ - { - char *t; - - if ((hostname = (char *)malloc(strlen(dpy->display_name))) - == NULL) - { - free(buf); - free(sname); - fprintf(stderr, "Xlib: malloc bombed in Krb5 auth\n"); - return -1; - } - strcpy(hostname, dpy->display_name); - t = strchr(hostname, ':'); - if (t == NULL) - { - free(buf); - free(sname); - free(hostname); - fprintf(stderr, - "Xlib: shouldn't get here! malformed display name."); - return -1; - } - if ((t - hostname + 1 < strlen(hostname)) && t[1] == ':') - t++; - *t = '\0'; /* truncate the dpy number out */ - } - retval = krb5_sname_to_principal(hostname, sname, - KRB5_NT_SRV_HST, &sprinc); - free(sname); - if (hostname) - free(hostname); - if (retval) - { - free(buf); - fprintf(stderr, "Xlib: krb5_sname_to_principal failed: %s\n", - error_message(retval)); - return -1; - } - } - if (retval = krb5_cc_default(&cc)) - { - free(buf); - krb5_free_principal(sprinc); - fprintf(stderr, "Xlib: krb5_cc_default failed: %s\n", - error_message(retval)); - return -1; - } - if (retval = krb5_cc_get_principal(cc, &cprinc)) - { - free(buf); - krb5_free_principal(sprinc); - fprintf(stderr, "Xlib: cannot get Kerberos principal from \"%s\": %s\n", - krb5_cc_default_name(), error_message(retval)); - return -1; - } - bzero((char *)&creds, sizeof(creds)); - creds.server = sprinc; - creds.client = cprinc; - if (prefix.reqType == 2) - { - creds.second_ticket.length = tlen - plen - 2; - creds.second_ticket.data = buf + 2 + plen; - retval = krb5_get_credentials(KRB5_GC_USER_USER | - krb5_kdc_default_options, - cc, &creds); - } - else - retval = krb5_get_credentials(krb5_kdc_default_options, - cc, &creds); - if (retval) - { - free(buf); - krb5_free_cred_contents(&creds); - fprintf(stderr, "Xlib: cannot get Kerberos credentials: %s\n", - error_message(retval)); - return -1; - } - /* - * now format the ap_req to send to the server - */ - if (prefix.reqType == 2) - retval = krb5_mk_req_extended(AP_OPTS_USE_SESSION_KEY | - AP_OPTS_MUTUAL_REQUIRED, NULL, - 0, 0, NULL, cc, - &creds, NULL, &kbuf); - else - retval = krb5_mk_req_extended(AP_OPTS_MUTUAL_REQUIRED, NULL, - 0, 0, NULL, cc, &creds, NULL, - &kbuf); - free(buf); - if (retval) /* Some manner of Kerberos lossage */ - { - krb5_free_cred_contents(&creds); - fprintf(stderr, "Xlib: krb5_mk_req_extended failed: %s\n", - error_message(retval)); - return -1; - } - prefix.reqType = 1; - prefix.data = 0; - prefix.length = (kbuf.length + sz_xReq + 3) >> 2; - /* - * stage 1: send ap_req to server - */ - _XSend(dpy, (char *)&prefix, sz_xReq); - _XSend(dpy, (char *)kbuf.data, kbuf.length); - free(kbuf.data); - /* - * stage 2: get ap_rep from server to mutually authenticate - */ - _XRead(dpy, (char *)&prefix, sz_xReq); - if (prefix.reqType != 2) - if (prefix.reqType == 0 || prefix.reqType == 1) - { - memcpy((char *)sprefix, (char *)&prefix, sz_xReq); - _XRead(dpy, (char *)sprefix + sz_xReq, - sz_xConnSetupPrefix - sz_xReq); - return 1; - } - else - { - fprintf(stderr, - "Xlib: Krb5 stage 2: got illegal connection setup success code %d\n", - prefix.reqType); - return -1; - } - if (prefix.data != 2) - return -1; - kbuf.length = (prefix.length << 2) - sz_xReq; - kbuf.data = (char *)malloc(kbuf.length); - if (kbuf.data == NULL) - { - fprintf(stderr, "Xlib: malloc bombed in Krb5 auth\n"); - return -1; - } - _XRead(dpy, (char *)kbuf.data, kbuf.length); - retval = krb5_rd_rep(&kbuf, &creds.keyblock, &repl); - if (retval) - { - free(kbuf.data); - fprintf(stderr, "Xlib: krb5_rd_rep failed: %s\n", - error_message(retval)); - return -1; - } - free(kbuf.data); - /* - * stage 3: send a short ack to the server and return - */ - prefix.reqType = 3; - prefix.data = 0; - prefix.length = sz_xReq >> 2; - _XSend(dpy, (char *)&prefix, sz_xReq); - return 0; -} -#endif /* K5AUTH */ - -static void -GetAuthorization( - XtransConnInfo trans_conn, - int family, - char *saddr, - int saddrlen, - int idisplay, - char **auth_namep, /* RETURN */ - int *auth_namelenp, /* RETURN */ - char **auth_datap, /* RETURN */ - int *auth_datalenp) /* RETURN */ -{ -#ifdef SECURE_RPC - char rpc_cred[MAX_AUTH_BYTES]; -#endif -#ifdef HASXDMAUTH - unsigned char xdmcp_data[192/8]; -#endif - char *auth_name; - int auth_namelen; - unsigned char *auth_data; - int auth_datalen; - Xauth *authptr = NULL; - -/* - * Look up the authorization protocol name and data if necessary. - */ - if (xauth_name && xauth_data) { - auth_namelen = xauth_namelen; - auth_name = xauth_name; - auth_datalen = xauth_datalen; - auth_data = (unsigned char *) xauth_data; - } else { - char dpynumbuf[40]; /* big enough to hold 2^64 and more */ - (void) sprintf (dpynumbuf, "%d", idisplay); - - authptr = XauGetBestAuthByAddr ((unsigned short) family, - (unsigned short) saddrlen, - saddr, - (unsigned short) strlen (dpynumbuf), - dpynumbuf, - xauth_names_length, - xauth_names, - xauth_lengths); - if (authptr) { - auth_namelen = authptr->name_length; - auth_name = (char *)authptr->name; - auth_datalen = authptr->data_length; - auth_data = (unsigned char *) authptr->data; - } else { - auth_namelen = 0; - auth_name = NULL; - auth_datalen = 0; - auth_data = NULL; - } - } -#ifdef HASXDMAUTH - /* - * build XDM-AUTHORIZATION-1 data - */ - if (auth_namelen == 19 && !strncmp (auth_name, "XDM-AUTHORIZATION-1", 19)) - { - int i, j; - Time_t now; - int family, addrlen; - Xtransaddr *addr = NULL; - - for (j = 0; j < 8; j++) - xdmcp_data[j] = auth_data[j]; - - _X11TransGetMyAddr(trans_conn, &family, &addrlen, &addr); - - switch( family ) - { -#ifdef AF_INET - case AF_INET: - { - /* - * addr will contain a sockaddr_in with all - * of the members already in network byte order. - */ - - for(i=4; i<8; i++) /* do sin_addr */ - xdmcp_data[j++] = ((char *)addr)[i]; - for(i=2; i<4; i++) /* do sin_port */ - xdmcp_data[j++] = ((char *)addr)[i]; - break; - } -#endif /* AF_INET */ -#if defined(IPv6) && defined(AF_INET6) - case AF_INET6: - /* XXX This should probably never happen */ - { - unsigned char ipv4mappedprefix[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff }; - - /* In the case of v4 mapped addresses send the v4 - part of the address - addr is already in network byte order */ - if (memcmp(addr+8, ipv4mappedprefix, 12) == 0) { - for (i = 20 ; i < 24; i++) - xdmcp_data[j++] = ((char *)addr)[i]; - - /* Port number */ - for (i=2; i<4; i++) - xdmcp_data[j++] = ((char *)addr)[i]; - } else { - /* Fake data to keep the data aligned. Otherwise the - the server will bail about incorrect timing data */ - for (i = 0; i < 6; i++) { - xdmcp_data[j++] = 0; - } - } - break; - } -#endif /* AF_INET6 */ -#ifdef AF_UNIX - case AF_UNIX: - { - /* - * We don't use the sockaddr_un for this encoding. - * Instead, we create a sockaddr_in filled with - * a decreasing counter for the address, and the - * pid for the port. - */ - - static unsigned long unix_addr = 0xFFFFFFFF; - unsigned long the_addr; - unsigned short the_port; - unsigned long the_utime; - struct timeval tp; - - X_GETTIMEOFDAY(&tp); - _XLockMutex(_Xglobal_lock); - the_addr = unix_addr--; - _XUnlockMutex(_Xglobal_lock); - the_utime = (unsigned long) tp.tv_usec; - the_port = getpid (); - - xdmcp_data[j++] = (the_utime >> 24) & 0xFF; - xdmcp_data[j++] = (the_utime >> 16) & 0xFF; - xdmcp_data[j++] = ((the_utime >> 8) & 0xF0) - | ((the_addr >> 8) & 0x0F); - xdmcp_data[j++] = (the_addr >> 0) & 0xFF; - xdmcp_data[j++] = (the_port >> 8) & 0xFF; - xdmcp_data[j++] = (the_port >> 0) & 0xFF; - break; - } -#endif /* AF_UNIX */ -#ifdef AF_DECnet - case AF_DECnet: - /* - * What is the defined encoding for this? - */ - break; -#endif /* AF_DECnet */ - default: - /* - * Need to return some kind of errro status here. - * maybe a NULL auth?? - */ - break; - } /* switch */ - - if (addr) - free ((char *) addr); - - time (&now); - xdmcp_data[j++] = (now >> 24) & 0xFF; - xdmcp_data[j++] = (now >> 16) & 0xFF; - xdmcp_data[j++] = (now >> 8) & 0xFF; - xdmcp_data[j++] = (now >> 0) & 0xFF; - while (j < 192 / 8) - xdmcp_data[j++] = 0; - _XLockMutex(_Xglobal_lock); - /* this function might use static data, hence the lock around it */ - XdmcpWrap (xdmcp_data, auth_data + 8, - xdmcp_data, j); - _XUnlockMutex(_Xglobal_lock); - auth_data = xdmcp_data; - auth_datalen = j; - } -#endif /* HASXDMAUTH */ -#ifdef SECURE_RPC - /* - * The SUN-DES-1 authorization protocol uses the - * "secure RPC" mechanism in SunOS 4.0+. - */ - if (auth_namelen == 9 && !strncmp(auth_name, "SUN-DES-1", 9)) { - char servernetname[MAXNETNAMELEN + 1]; - - /* - * Copy over the server's netname from the authorization - * data field filled in by XauGetAuthByAddr(). - */ - if (auth_datalen > MAXNETNAMELEN) { - auth_datalen = 0; - auth_data = NULL; - } else { - memcpy(servernetname, auth_data, auth_datalen); - servernetname[auth_datalen] = '\0'; - - auth_datalen = sizeof (rpc_cred); - if (auth_ezencode(servernetname, 100, rpc_cred, - &auth_datalen)) - auth_data = (unsigned char *) rpc_cred; - else { - auth_datalen = 0; - auth_data = NULL; - } - } - } -#endif - if (saddr) free ((char *) saddr); - if ((*auth_namelenp = auth_namelen)) - { - if ((*auth_namep = Xmalloc(auth_namelen))) - memcpy(*auth_namep, auth_name, auth_namelen); - else - *auth_namelenp = 0; - } - else - *auth_namep = NULL; - if ((*auth_datalenp = auth_datalen)) - { - if ((*auth_datap = Xmalloc(auth_datalen))) - memcpy(*auth_datap, auth_data, auth_datalen); - else - *auth_datalenp = 0; - } - else - *auth_datap = NULL; - if (authptr) XauDisposeAuth (authptr); -} diff --git a/nx-X11/lib/X11/IfEvent.c.NX.original b/nx-X11/lib/X11/IfEvent.c.NX.original deleted file mode 100644 index a7c0cb188..000000000 --- a/nx-X11/lib/X11/IfEvent.c.NX.original +++ /dev/null @@ -1,80 +0,0 @@ -/* $Xorg: IfEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ -/* - -Copyright 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/IfEvent.c,v 1.4 2001/12/14 19:54:01 dawes Exp $ */ - -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -/* - * Flush output and (wait for and) return the next event matching the - * predicate in the queue. - */ - -int -XIfEvent (dpy, event, predicate, arg) - register Display *dpy; - Bool (*predicate)( - Display* /* display */, - XEvent* /* event */, - char* /* arg */ - ); /* function to call */ - register XEvent *event; - char *arg; -{ - register _XQEvent *qelt, *prev; - unsigned long qe_serial = 0; - - LockDisplay(dpy); - prev = NULL; - while (1) { - for (qelt = prev ? prev->next : dpy->head; - qelt; - prev = qelt, qelt = qelt->next) { - if(qelt->qserial_num > qe_serial - && (*predicate)(dpy, &qelt->event, arg)) { - *event = qelt->event; - _XDeq(dpy, prev, qelt); - UnlockDisplay(dpy); - return 0; - } - } - if (prev) - qe_serial = prev->qserial_num; - _XReadEvents(dpy); - if (prev && prev->qserial_num != qe_serial) - /* another thread has snatched this event */ - prev = NULL; -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - return 0; - } -#endif - } -} diff --git a/nx-X11/lib/X11/IfEvent.c.X.original b/nx-X11/lib/X11/IfEvent.c.X.original deleted file mode 100644 index 55e7829ca..000000000 --- a/nx-X11/lib/X11/IfEvent.c.X.original +++ /dev/null @@ -1,75 +0,0 @@ -/* $Xorg: IfEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ -/* - -Copyright 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/IfEvent.c,v 1.4 2001/12/14 19:54:01 dawes Exp $ */ - -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -/* - * Flush output and (wait for and) return the next event matching the - * predicate in the queue. - */ - -int -XIfEvent (dpy, event, predicate, arg) - register Display *dpy; - Bool (*predicate)( - Display* /* display */, - XEvent* /* event */, - char* /* arg */ - ); /* function to call */ - register XEvent *event; - char *arg; -{ - register _XQEvent *qelt, *prev; - unsigned long qe_serial = 0; - - LockDisplay(dpy); - prev = NULL; - while (1) { - for (qelt = prev ? prev->next : dpy->head; - qelt; - prev = qelt, qelt = qelt->next) { - if(qelt->qserial_num > qe_serial - && (*predicate)(dpy, &qelt->event, arg)) { - *event = qelt->event; - _XDeq(dpy, prev, qelt); - UnlockDisplay(dpy); - return 0; - } - } - if (prev) - qe_serial = prev->qserial_num; - _XReadEvents(dpy); - if (prev && prev->qserial_num != qe_serial) - /* another thread has snatched this event */ - prev = NULL; - } -} diff --git a/nx-X11/lib/X11/Imakefile.NX.original b/nx-X11/lib/X11/Imakefile.NX.original deleted file mode 100644 index d8d0601b8..000000000 --- a/nx-X11/lib/X11/Imakefile.NX.original +++ /dev/null @@ -1,1237 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:44:38 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/lib/X11/Imakefile,v 3.52 2003/05/27 16:53:15 tsi Exp $ - - - - HEADERS = Xlib.h Xresource.h Xutil.h cursorfont.h Xlibint.h \ - Xcms.h Xlocale.h XKBlib.h XlibConf.h Xregion.h ImUtil.h - -#if BuildServersOnly && !XWinServer && !XnestServer && !BuildGLXLibrary && !BuildClients && !XdmxServer && !NXAgentServer -all:: - -BuildIncludes($(HEADERS),IncSubdir,..) - -#else - -#if NXLibraries - -#ifdef SunArchitecture -NX_INCLUDES = -I../../../nxcomp -I/usr/sfw/include -#else -NX_INCLUDES = -I../../../nxcomp -#endif - -NX_DEFINES = -DNX_TRANS_SOCKET \ - -DNX_TRANS_EXIT - -# -DNX_TRANS_CHANGE \ -# -DNX_TRANS_WARN \ -# -DNX_TRANS_INFO \ -# -DNX_TRANS_TEST \ -# -DNX_TRANS_DEBUG \ - -#ifdef cygwinArchitecture -NX_XCOMPLIBNAME = cygXcomp.dll -NX_XCOMPEXTLIBNAME = cygXcompext.dll -#else -NX_XCOMPLIBNAME = libXcomp.so -NX_XCOMPEXTLIBNAME = libXcompext.so -#endif - -NX_XCOMPLIBDIR = $(XTOP)/../nxcomp -NX_XCOMPLIBLINK = Xcomp -NX_XCOMPLIBTARGET = $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME) -NX_REQUIREDLIBS = -L$(NX_XCOMPLIBDIR) -l$(NX_XCOMPLIBLINK) -NX_XCOMPDEPTARGET = $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME) -NX_XCOMPCONFIGTARGET = $(NX_XCOMPLIBDIR)/config.status - -NX_XCOMPEXTLIBDIR = $(XTOP)/../nxcompext -NX_XCOMPEXTLIBTARGET = $(NX_XCOMPEXTLIBDIR)/$(NX_XCOMPEXTLIBNAME) -NX_XCOMPEXTCONFIGTARGET = $(NX_XCOMPEXTLIBDIR)/config.status - -#endif - -#if BuildLoadableXlibI18n -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" -#define NoLibSubdirs -#endif - -#define DoNormalLib NormalLibX11 -#define DoSharedLib SharedLibX11 -#define DoExtraLib SharedLibX11 -#define DoDebugLib DebugLibX11 -#define DoProfileLib ProfileLibX11 -#define LibName X11 -#define SoRev SOXLIBREV -#define HugeLibrary YES -#define IncSubdir X11 - -#if BuildLoadableXlibI18n -SUBDIRS = xlibi18n -#endif - -#include - -#ifndef MotifBC -#define MotifBC NO -#endif - -#ifdef SharedX11Reqs -REQUIREDX11LIBS = SharedX11Reqs -#endif -#if BuildLoadableXlibI18n -REQUIREDI18NLIBS = DlLibrary -#endif -#ifdef cygwinArchitecture -EXCLUDE_SYMBOL = -Wl,--exclude-symbol,XdmcpWrap:_XdmcpWrapperToOddParity -#endif - -REQUIREDLIBS=$(REQUIREDX11LIBS) $(REQUIREDI18NLIBS) $(EXCLUDE_SYMBOL) $(NX_REQUIREDLIBS) - -#if defined(MacIIArchitecture) || defined(SequentArchitecture) || defined(i386ScoArchitecture) -XBSDLIB = /**/ -#endif -#if defined(LunaArchitecture) && defined(Mc88000Architecture) -EXTRA_LIBRARIES = /**/ -#endif -#if Malloc0ReturnsNull - MALLOC_DEFINES = XMalloc0ReturnsNullDefines -#endif -#if HasXdmAuth - XDMAUTHDEFS = -DHASXDMAUTH - XDMAUTHOBJS = Wrap.o Wraphelp.o - XDMAUTHSRCS = Wrap.c Wraphelp.c -#endif -#if BuildXKBlib - XKB_DEFINES = -DXKB - XKBSRCS = XKB.c XKBBind.c XKBCompat.c XKBCtrls.c XKBCvt.c XKBGetMap.c \ - XKBGetByName.c XKBNames.c XKBRdBuf.c XKBSetMap.c XKBUse.c \ - XKBleds.c XKBBell.c XKBGeom.c XKBSetGeom.c XKBExtDev.c \ - XKBList.c XKBMisc.c \ - XKBMAlloc.c XKBGAlloc.c XKBAlloc.c - XKBOBJS = XKB.o XKBBind.o XKBCompat.o XKBCtrls.o XKBCvt.o XKBGetMap.o \ - XKBGetByName.o XKBNames.o XKBRdBuf.o XKBSetMap.o XKBUse.o \ - XKBleds.o XKBBell.o XKBGeom.o XKBSetGeom.o XKBExtDev.o \ - XKBList.o XKBMisc.o \ - XKBMAlloc.o XKBGAlloc.o XKBAlloc.o -#endif -#if HasSecureRPC - RPCDEFS = -DSECURE_RPC -#endif -#if HasPoll - POLL_DEFINES = -DUSE_POLL -#endif - CONN_DEFINES = $(CONNECTION_FLAGS) - XTRANS_X_DEFINES = -DX11_t -DTRANS_CLIENT $(XTRANS_FAILDEFINES) - XTRANS_XIM_DEFINES = -DXIM_t -DTRANS_CLIENT $(XTRANS_FAILDEFINES) -#if HasBSD44Sockets - SOCK_DEFINES = -DBSD44SOCKETS -#endif -#if HasShm - SHM_DEFINES = -DHAS_SHM -#endif - - XF86BIGFONT_DEFINES = XF86BigfontExtensionDefines - - EDB_DEFINES = -DERRORDB=\"$(LIBDIR)/XErrorDB\" - KDB_DEFINES = -DKEYSYMDB=\"$(LIBDIR)/XKeysymDB\" - CMS_DEFINES = -DXCMSDB=\"$(LIBDIR)/Xcms.txt\" -#if HasSnprintf - MISC_DEFINES = -DHAS_SNPRINTF -DLIBX11 -#endif -#if MotifBC - BC_DEFINES = -DMOTIFBC -#endif -#if NoRConst - RCONST_DEFINES = -DNORCONST -#endif -#if DisableXLocaleDirEnv - SETID_DEFINES = -DNO_XLOCALEDIR -#elif HasIssetugid - SETID_DEFINES = -DHASSETUGID -#elif HasGetresuid - SETID_DEFINES = -DHASGETRESUID -#endif - XLC_DEFINES = -DXLOCALEDIR=\"$(XLOCALEDIR)\" -#if HasKrb5 - K5OBJS = k5encode.o - K5SRCS = k5encode.c - K5INCL = Krb5Includes - K5DEFS = Krb5Defines -#endif -#if (defined(FreeBSDArchitecture) && OSRelVersion < 500016) || \ - defined(OpenBSDArchitecture) -THRSTUBSRCS = UIThrStubs.c -THRSTUBOBJS = UIThrStubs.o -#endif -#if BuildLoadableXlibXcursor -XCURSOR_DEFINES = -DUSE_DYNAMIC_XCURSOR -DLIBXCURSOR=\"libXcursor.so.$(SOXCURSORREV)\" -#endif -#if NeedLibInsideFlag - LIB_DEFINES = -D_XLIBINT_ -#endif -#if defined(LibDirName) - POSTLOCALELIBDIR = LibDirName - POSTLOCALELIBDEFINES = -DPOSTLOCALELIBDIR=\"$(POSTLOCALELIBDIR)\" -#endif - DEFINES = $(MALLOC_DEFINES) $(LIB_DEFINES) $(MISC_DEFINES)\ - $(POSTLOCALELIBDEFINES) $(NX_INCLUDES) $(NX_DEFINES) - OPEN_DEFINES = -I$(EXTINCSRC) $(K5INCL) $(K5DEFS) - DEPEND_DEFINES = $(OPEN_DEFINES) $(TRANS_INCLUDES) $(CONN_DEFINES) $(THREADS_DEFINES) DependDefines - AUTHOBJS = AuDispose.o AuGetBest.o AuFileName.o AuRead.o - AUTHSRCS = AuDispose.c AuGetBest.c AuFileName.c AuRead.c - SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(EXTRASRCS) /* try *.c if you have trouble */ - LINTLIBS = - -#if BuildLoadableXlibI18n && DoSharedLib -EXTRASHAREDSRC = $(SHAREDLCSRCS) -#endif -#if !BuildLoadableXlibI18n || DoNormalLib -EXTRASTATICSRC = $(STATICLCSRCS) -#endif - -EXTRASRCS = $(EXTRASHAREDSRC) $(EXTRASTATICSRC) - -SRCS1 = \ - Context.c \ - Depths.c \ - ParseCmd.c \ - Quarks.c \ - AllCells.c \ - AllPlanes.c \ - AllowEv.c \ - AutoRep.c \ - Backgnd.c \ - BdrWidth.c \ - Bell.c \ - Border.c \ - ChAccCon.c \ - ChClMode.c \ - ChActPGb.c \ - ChCmap.c \ - ChGC.c \ - ChKeyCon.c \ - ChPntCon.c \ - ChProp.c \ - ChSaveSet.c \ - ChWAttrs.c \ - ChWindow.c \ - ChkIfEv.c \ - ChkMaskEv.c \ - ChkWinEv.c \ - ChkTypEv.c \ - ChkTypWEv.c \ - CirWin.c \ - CirWinDn.c \ - CirWinUp.c \ - ClDisplay.c \ - Clear.c \ - ClearArea.c \ - ConfWind.c \ - ConnDis.c \ - ConvSel.c \ - CopyArea.c \ - CopyCmap.c \ - CopyGC.c \ - CopyPlane.c \ - CrBFData.c \ - CrCmap.c \ - CrCursor.c \ - CrGC.c \ - CrGlCur.c \ - CrPFBData.c \ - CrPixmap.c \ - CrWindow.c \ - Cursor.c \ - DefCursor.c \ - DelProp.c \ - DestSubs.c \ - DestWind.c \ - DisName.c \ - DrArc.c \ - DrArcs.c \ - DrLine.c \ - DrLines.c \ - DrPoint.c \ - DrPoints.c \ - DrRect.c \ - DrRects.c \ - DrSegs.c \ - ErrDes.c \ - ErrHndlr.c \ - EvToWire.c \ - FetchName.c \ - FillArc.c \ - FillArcs.c \ - FillPoly.c \ - FillRct.c \ - FillRcts.c \ - Flush.c \ - Font.c \ - FontNames.c \ - FontInfo.c \ - FreeCmap.c \ - FreeCols.c \ - FreeCurs.c \ - FreeEData.c \ - FreeGC.c \ - FreePix.c \ - FSSaver.c \ - GCMisc.c \ - Geom.c \ - GetAtomNm.c \ - GetColor.c \ - GetDflt.c \ - GetFPath.c \ - GetFProp.c \ - GetGeom.c \ - GetHColor.c \ - GetHints.c \ - GetIFocus.c \ - GetImage.c \ - GetKCnt.c \ - GetMoEv.c \ - GetPCnt.c \ - GetPntMap.c \ - GetProp.c \ - GetSOwner.c \ - GetSSaver.c \ - GetStCmap.c \ - GetWAttrs.c \ - GrButton.c \ - GrKey.c \ - GrKeybd.c \ - GrPointer.c \ - GrServer.c \ - Host.c \ - IfEvent.c \ - ImUtil.c \ - ImText.c \ - ImText16.c \ - InitExt.c \ - InsCmap.c \ - IntAtom.c \ - KeyBind.c \ - KeysymStr.c \ - KillCl.c \ - LiHosts.c \ - LiICmaps.c \ - LiProps.c \ - ListExt.c \ - LoadFont.c \ - LookupCol.c \ - LowerWin.c - -OBJS1 = \ - Context.o \ - Depths.o \ - ParseCmd.o \ - Quarks.o \ - AllCells.o \ - AllPlanes.o \ - AllowEv.o \ - AutoRep.o \ - Backgnd.o \ - BdrWidth.o \ - Bell.o \ - Border.o \ - ChAccCon.o \ - ChClMode.o \ - ChActPGb.o \ - ChCmap.o \ - ChGC.o \ - ChKeyCon.o \ - ChPntCon.o \ - ChProp.o \ - ChSaveSet.o \ - ChWAttrs.o \ - ChWindow.o \ - ChkIfEv.o \ - ChkMaskEv.o \ - ChkWinEv.o \ - ChkTypEv.o \ - ChkTypWEv.o \ - CirWin.o \ - CirWinDn.o \ - CirWinUp.o \ - ClDisplay.o \ - Clear.o \ - ClearArea.o \ - ConfWind.o \ - ConnDis.o \ - ConvSel.o \ - CopyArea.o \ - CopyCmap.o \ - CopyGC.o \ - CopyPlane.o \ - CrBFData.o \ - CrCmap.o \ - CrCursor.o \ - CrGC.o \ - CrGlCur.o \ - CrPFBData.o \ - CrPixmap.o \ - CrWindow.o \ - Cursor.o \ - DefCursor.o \ - DelProp.o \ - DestSubs.o \ - DestWind.o \ - DisName.o \ - DrArc.o \ - DrArcs.o \ - DrLine.o \ - DrLines.o \ - DrPoint.o \ - DrPoints.o \ - DrRect.o \ - DrRects.o \ - DrSegs.o \ - ErrDes.o \ - ErrHndlr.o \ - EvToWire.o \ - FetchName.o \ - FillArc.o \ - FillArcs.o \ - FillPoly.o \ - FillRct.o \ - FillRcts.o \ - Flush.o \ - Font.o \ - FontNames.o \ - FontInfo.o \ - FreeCmap.o \ - FreeCols.o \ - FreeCurs.o \ - FreeEData.o \ - FreeGC.o \ - FreePix.o \ - FSSaver.o \ - GCMisc.o \ - Geom.o \ - GetAtomNm.o \ - GetColor.o \ - GetDflt.o \ - GetFPath.o \ - GetFProp.o \ - GetGeom.o \ - GetHColor.o \ - GetHints.o \ - GetIFocus.o \ - GetImage.o \ - GetKCnt.o \ - GetMoEv.o \ - GetPCnt.o \ - GetPntMap.o \ - GetProp.o \ - GetSOwner.o \ - GetSSaver.o \ - GetStCmap.o \ - GetWAttrs.o \ - GrButton.o \ - GrKey.o \ - GrKeybd.o \ - GrPointer.o \ - GrServer.o \ - Host.o \ - IfEvent.o \ - ImUtil.o \ - ImText.o \ - ImText16.o \ - InitExt.o \ - InsCmap.o \ - IntAtom.o \ - KeyBind.o \ - KeysymStr.o \ - KillCl.o \ - LiHosts.o \ - LiICmaps.o \ - LiProps.o \ - ListExt.o \ - LoadFont.o \ - LookupCol.o \ - LowerWin.o - -SRCS2 = \ - Macros.c \ - MapRaised.c \ - MapSubs.c \ - MapWindow.c \ - MaskEvent.c \ - Misc.c \ - ModMap.c \ - MoveWin.c \ - NextEvent.c \ - OpenDis.c \ - ParseCol.c \ - ParseGeom.c \ - PeekEvent.c \ - PeekIfEv.c \ - Pending.c \ - PmapBgnd.c \ - PmapBord.c \ - PolyReg.c \ - PolyTxt.c \ - PolyTxt16.c \ - PutBEvent.c \ - PutImage.c \ - QuBest.c \ - QuColor.c \ - QuColors.c \ - QuCurShp.c \ - QuExt.c \ - QuKeybd.c \ - QuPntr.c \ - QuStipShp.c \ - QuTextE16.c \ - QuTextExt.c \ - QuTileShp.c \ - QuTree.c \ - RaiseWin.c \ - RdBitF.c \ - RecolorC.c \ - ReconfWin.c \ - Region.c \ - RepWindow.c \ - RestackWs.c \ - RotProp.c \ - ScrResStr.c \ - SelInput.c \ - SendEvent.c \ - SetBack.c \ - SetCRects.c \ - SetClMask.c \ - SetClOrig.c \ - SetDashes.c \ - SetFPath.c \ - SetFont.c \ - SetFore.c \ - SetFunc.c \ - SetHints.c \ - SetIFocus.c \ - SetLStyle.c \ - SetPMask.c \ - SetPntMap.c \ - SetSOwner.c \ - SetSSaver.c \ - SetState.c \ - SetStip.c \ - SetStCmap.c \ - SetTile.c \ - SetTSOrig.c \ - StBytes.c \ - StColor.c \ - StColors.c \ - StNColor.c \ - StName.c \ - StrKeysym.c \ - Sync.c \ - Synchro.c \ - Text.c \ - Text16.c \ - TextExt.c \ - TextExt16.c \ - TrCoords.c \ - UndefCurs.c \ - UngrabBut.c \ - UngrabKbd.c \ - UngrabKey.c \ - UngrabPtr.c \ - UngrabSvr.c \ - UninsCmap.c \ - UnldFont.c \ - UnmapSubs.c \ - UnmapWin.c \ - VisUtil.c \ - WarpPtr.c \ - WinEvent.c \ - Window.c \ - WrBitF.c \ - XlibAsync.c \ - XlibInt.c \ - Xrm.c \ - evtomask.c \ - globals.c \ - GetGCVals.c \ - GetNrmHint.c \ - GetRGBCMap.c \ - GetTxtProp.c \ - GetWMCMapW.c \ - GetWMProto.c \ - Iconify.c \ - PixFormats.c \ - PropAlloc.c \ - ReconfWM.c \ - SetNrmHint.c \ - SetRGBCMap.c \ - SetTxtProp.c \ - SetWMCMapW.c \ - SetWMProto.c \ - StrToText.c \ - TextToStr.c \ - Withdraw.c \ - WMGeom.c \ - WMProps.c \ - $(AUTHSRCS) $(XDMAUTHSRCS) $(K5SRCS) $(THRSTUBSRCS) - -OBJS2 = \ - Macros.o \ - MapRaised.o \ - MapSubs.o \ - MapWindow.o \ - MaskEvent.o \ - Misc.o \ - ModMap.o \ - MoveWin.o \ - NextEvent.o \ - OpenDis.o \ - ParseCol.o \ - ParseGeom.o \ - PeekEvent.o \ - PeekIfEv.o \ - Pending.o \ - PmapBgnd.o \ - PmapBord.o \ - PolyReg.o \ - PolyTxt.o \ - PolyTxt16.o \ - PutBEvent.o \ - PutImage.o \ - QuBest.o \ - QuColor.o \ - QuColors.o \ - QuCurShp.o \ - QuExt.o \ - QuKeybd.o \ - QuPntr.o \ - QuStipShp.o \ - QuTextE16.o \ - QuTextExt.o \ - QuTileShp.o \ - QuTree.o \ - RaiseWin.o \ - RdBitF.o \ - RecolorC.o \ - ReconfWin.o \ - Region.o \ - RepWindow.o \ - RestackWs.o \ - RotProp.o \ - ScrResStr.o \ - SelInput.o \ - SendEvent.o \ - SetBack.o \ - SetCRects.o \ - SetClMask.o \ - SetClOrig.o \ - SetDashes.o \ - SetFPath.o \ - SetFont.o \ - SetFore.o \ - SetFunc.o \ - SetHints.o \ - SetIFocus.o \ - SetLStyle.o \ - SetPMask.o \ - SetPntMap.o \ - SetSOwner.o \ - SetSSaver.o \ - SetState.o \ - SetStip.o \ - SetStCmap.o \ - SetTile.o \ - SetTSOrig.o \ - StBytes.o \ - StColor.o \ - StColors.o \ - StNColor.o \ - StName.o \ - StrKeysym.o \ - Sync.o \ - Synchro.o \ - Text.o \ - Text16.o \ - TextExt.o \ - TextExt16.o \ - TrCoords.o \ - UndefCurs.o \ - UngrabBut.o \ - UngrabKbd.o \ - UngrabKey.o \ - UngrabPtr.o \ - UngrabSvr.o \ - UninsCmap.o \ - UnldFont.o \ - UnmapSubs.o \ - UnmapWin.o \ - VisUtil.o \ - WarpPtr.o \ - WinEvent.o \ - Window.o \ - WrBitF.o \ - XlibAsync.o \ - XlibInt.o \ - Xrm.o \ - evtomask.o \ - globals.o \ - GetGCVals.o \ - GetNrmHint.o \ - GetRGBCMap.o \ - GetTxtProp.o \ - GetWMCMapW.o \ - GetWMProto.o \ - Iconify.o \ - PixFormats.o \ - PropAlloc.o \ - ReconfWM.o \ - SetNrmHint.o \ - SetRGBCMap.o \ - SetTxtProp.o \ - SetWMCMapW.o \ - SetWMProto.o \ - StrToText.o \ - TextToStr.o \ - Withdraw.o \ - WMGeom.o \ - WMProps.o \ - $(AUTHOBJS) \ - $(XDMAUTHOBJS) \ - $(K5OBJS) \ - $(THRSTUBOBJS) - -SRCS3 = \ - Lab.c \ - LabGcC.c \ - LabGcL.c \ - LabGcLC.c \ - LabMnL.c \ - LabMxC.c \ - LabMxL.c \ - LabMxLC.c \ - LabWpAj.c \ - Luv.c \ - LuvGcC.c \ - LuvGcL.c \ - LuvGcLC.c \ - LuvMnL.c \ - LuvMxC.c \ - LuvMxL.c \ - LuvMxLC.c \ - LuvWpAj.c \ - XYZ.c \ - uvY.c \ - xyY.c \ - HVC.c \ - HVCGcC.c \ - HVCGcV.c \ - HVCGcVC.c \ - HVCMnV.c \ - HVCMxC.c \ - HVCMxV.c \ - HVCMxVC.c \ - HVCMxVs.c \ - HVCWpAj.c \ - UNDEFINED.c \ - AddDIC.c \ - AddSF.c \ - cmsAllNCol.c \ - cmsAllCol.c \ - CCC.c \ - cmsCmap.c \ - cmsColNm.c \ - CvColW.c \ - CvCols.c \ - cmsGlobls.c \ - IdOfPr.c \ - cmsInt.c \ - LRGB.c \ - cmsLkCol.c \ - cmsMath.c \ - OfCCC.c \ - PrOfId.c \ - cmsProp.c \ - QBlack.c \ - QBlue.c \ - QGreen.c \ - QRed.c \ - QWhite.c \ - QuCol.c \ - QuCols.c \ - SetCCC.c \ - SetGetCols.c \ - StCol.c \ - StCols.c \ - cmsTrig.c \ - XRGB.c \ - FSWrap.c \ - ICWrap.c \ - IMWrap.c \ - OCWrap.c \ - OMWrap.c \ - lcWrap.c \ - mbWMProps.c \ - utf8WMProps.c \ - mbWrap.c \ - wcWrap.c \ - utf8Wrap.c \ - FilterEv.c \ - RegstFlt.c \ - locking.c \ - LockDis.c \ - x11trans.c \ - ximtrans.c \ - $(XKBSRCS) $(LCSRCS) $(MISCSRCS) - -OBJS3 = \ - Lab.o \ - LabGcC.o \ - LabGcL.o \ - LabGcLC.o \ - LabMnL.o \ - LabMxC.o \ - LabMxL.o \ - LabMxLC.o \ - LabWpAj.o \ - Luv.o \ - LuvGcC.o \ - LuvGcL.o \ - LuvGcLC.o \ - LuvMnL.o \ - LuvMxC.o \ - LuvMxL.o \ - LuvMxLC.o \ - LuvWpAj.o \ - XYZ.o \ - uvY.o \ - xyY.o \ - HVC.o \ - HVCGcC.o \ - HVCGcV.o \ - HVCGcVC.o \ - HVCMnV.o \ - HVCMxC.o \ - HVCMxV.o \ - HVCMxVC.o \ - HVCMxVs.o \ - HVCWpAj.o \ - UNDEFINED.o \ - AddDIC.o \ - AddSF.o \ - cmsAllNCol.o \ - cmsAllCol.o \ - CCC.o \ - cmsCmap.o \ - cmsColNm.o \ - CvColW.o \ - CvCols.o \ - cmsGlobls.o \ - IdOfPr.o \ - cmsInt.o \ - LRGB.o \ - cmsLkCol.o \ - cmsMath.o \ - OfCCC.o \ - PrOfId.o \ - cmsProp.o \ - QBlack.o \ - QBlue.o \ - QGreen.o \ - QRed.o \ - QWhite.o \ - QuCol.o \ - QuCols.o \ - SetCCC.o \ - SetGetCols.o \ - StCol.o \ - StCols.o \ - cmsTrig.o \ - XRGB.o \ - FSWrap.o \ - ICWrap.o \ - IMWrap.o \ - OCWrap.o \ - OMWrap.o \ - lcWrap.o \ - mbWMProps.o \ - utf8WMProps.o \ - mbWrap.o \ - wcWrap.o \ - utf8Wrap.o \ - FilterEv.o \ - RegstFlt.o \ - locking.o \ - LockDis.o \ - x11trans.o \ - ximtrans.o \ - $(XKBOBJS) $(LCOBJS) $(MISCOBJS) - -#if BuildLoadableXlibI18n -LC_DYNDEFINES = -DUSE_DYNAMIC_LC -#endif - -SHAREDLCDEPSYMSRCS = XlcDL.c XlcSL.c - -SHAREDI18NSTATICSRCS = \ - XDefaultIMIF.c XDefaultOMIF.c - -STATICLCDEPSYMSRCS = - -STATICI18NSTATICSRCS = \ - imCallbk.c \ - imDefFlt.c \ - imDefIc.c \ - imDefIm.c \ - imDefLkup.c \ - imDispch.c \ - imEvToWire.c \ - imExten.c \ - imImSw.c \ - imInsClbk.c \ - imInt.c \ - imLcFlt.c \ - imLcGIc.c \ - imLcIc.c \ - imLcIm.c \ - imLcLkup.c \ - imLcPrs.c \ - imLcSIc.c \ - imRm.c \ - imRmAttr.c \ - imThaiFlt.c \ - imThaiIc.c \ - imThaiIm.c \ - imTrX.c \ - imTransR.c \ - imTrans.c \ - lcEuc.c \ - lcGenConv.c \ - lcJis.c \ - lcSjis.c \ - lcUTF8Load.c \ - omDefault.c \ - omGeneric.c \ - omImText.c \ - omText.c \ - omTextEsc.c \ - omTextExt.c \ - omTextPer.c \ - omXChar.c - -LCSRCS = \ - SetLocale.c \ - imConv.c \ - imKStoUCS.c \ - lcCT.c \ - lcCharSet.c \ - lcConv.c \ - lcDB.c \ - lcDefConv.c \ - lcFile.c \ - lcGeneric.c \ - lcInit.c \ - lcPrTxt.c \ - lcPubWrap.c \ - lcPublic.c \ - lcRM.c \ - lcStd.c \ - lcTxtPr.c \ - lcUtil.c \ - lcUTF8.c - -STATICLCSRCS = \ - $(STATICLCDEPSYMSRCS) \ - $(STATICI18NSTATICSRCS) - -SHAREDLCSRCS = \ - $(SHAREDLCDEPSYMSRCS) \ - $(SHAREDI18NSTATICSRCS) - -SHAREDLCDEPOBJS = XlcDL.o XlcSL.o -SHAREDI18NSTATICOBJS = \ - XDefaultIMIF.o XDefaultOMIF.o -STATICLCDEPOBJS = -STATICI18NSTATICOBJS = \ - imCallbk.o \ - imDefFlt.o \ - imDefIc.o \ - imDefIm.o \ - imDefLkup.o \ - imDispch.o \ - imEvToWire.o \ - imExten.o \ - imImSw.o \ - imInsClbk.o \ - imInt.o \ - imLcFlt.o \ - imLcGIc.o \ - imLcIc.o \ - imLcIm.o \ - imLcLkup.o \ - imLcPrs.o \ - imLcSIc.o \ - imRm.o \ - imRmAttr.o \ - imThaiFlt.o \ - imThaiIc.o \ - imThaiIm.o \ - imTrX.o \ - imTransR.o \ - imTrans.o \ - lcEuc.o \ - lcGenConv.o \ - lcJis.o \ - lcSjis.o \ - lcUTF8Load.o \ - omDefault.o \ - omGeneric.o \ - omImText.o \ - omText.o \ - omTextEsc.o \ - omTextExt.o \ - omTextPer.o \ - omXChar.o - -LCOBJS = \ - SetLocale.o \ - imConv.o \ - imKStoUCS.o \ - lcCT.o \ - lcCharSet.o \ - lcConv.o \ - lcDB.o \ - lcDefConv.o \ - lcFile.o \ - lcGeneric.o \ - lcInit.o \ - lcPrTxt.o \ - lcPubWrap.o \ - lcPublic.o \ - lcRM.o \ - lcStd.o \ - lcTxtPr.o \ - lcUtil.o \ - lcUTF8.o - -STATICLCOBJS = \ - $(STATICLCDEPOBJS) \ - $(STATICI18NSTATICOBJS) - -SHAREDLCOBJS = \ - $(SHAREDLCDEPOBJS) \ - $(SHAREDI18NSTATICOBJS) - -#ifdef OS2Architecture -MISCSRCS = os2Stubs.c -#endif - -#ifdef OS2Architecture -MISCOBJS = os2Stubs.o -#endif - -OBJS = $(OBJS1) $(OBJS2) $(OBJS3) - -EXTRAUNSHAREDOBJS = $(STATICLCOBJS) - -#if BuildLoadableXlibI18n -EXTRASHAREDOBJS = $(SHAREDLCOBJS) -# else -EXTRASHAREDOBJS = $(STATICLCOBJS) -#endif - -#include - -SpecialCLibObjectRule(ErrDes,$(ICONFIGFILES),$(EDB_DEFINES)) -SpecialCLibObjectRule(StrKeysym,$(ICONFIGFILES),$(KDB_DEFINES)) -SpecialCLibObjectRule(ConnDis,$(ICONFIGFILES),$(XDMAUTHDEFS) $(RPCDEFS) $(CONN_DEFINES) $(SOCK_DEFINES) $(POLL_DEFINES) $(XTRANS_X_DEFINES) $(K5INCL) $(K5DEFS)) -SpecialCLibObjectRule(x11trans,$(ICONFIGFILES),$(TRANS_INCLUDES) $(CONN_DEFINES) $(SOCK_DEFINES) $(XTRANS_X_DEFINES) $(POLL_DEFINES)) -LinkFile(x11trans.c,$(TRANSCOMMSRC)/transport.c) -SpecialCLibObjectRule(ximtrans,$(ICONFIGFILES),$(TRANS_INCLUDES) $(CONN_DEFINES) $(SOCK_DEFINES) $(XTRANS_XIM_DEFINES) $(POLL_DEFINES)) -LinkFile(ximtrans.c,$(TRANSCOMMSRC)/transport.c) -SpecialCLibObjectRule(OpenDis,$(ICONFIGFILES),$(BC_DEFINES) $(OPEN_DEFINES) $(XTRANS_X_DEFINES) $(XKB_DEFINES)) -SpecialCLibObjectRule(Wrap,$(ICONFIGFILES),$(XDMAUTHDEFS)) -SpecialCLibObjectRule(XlibInt,$(ICONFIGFILES),$(CONN_DEFINES) $(POLL_DEFINES) $(XTRANS_X_DEFINES)) -SpecialCLibObjectRule(Font,$(ICONFIGFILES),$(SHM_DEFINES) $(XF86BIGFONT_DEFINES)) -SpecialCLibObjectRule(FontInfo,$(ICONFIGFILES),$(SHM_DEFINES) $(XF86BIGFONT_DEFINES)) -SpecialCLibObjectRule(cmsColNm,$(ICONFIGFILES),$(CMS_DEFINES)) -SpecialCLibObjectRule(globals,$(ICONFIGFILES),$(CONN_DEFINES)) -SpecialCLibObjectRule(Context,$(ICONFIGFILES),$(BC_DEFINES)) -SpecialCLibObjectRule(Xrm,$(_NOOP_),$(RCONST_DEFINES)) -SpecialCLibObjectRule(imTransR,$(ICONFIGFILES),$(CONN_DEFINES) $(XTRANS_XIM_DEFINES)) -SpecialCLibObjectRule(imTrans,$(ICONFIGFILES),$(CONN_DEFINES) $(XTRANS_XIM_DEFINES)) -SpecialCLibObjectRule(lcFile,$(ICONFIGFILES),$(XLC_DEFINES) $(SETID_DEFINES)) -#if BuildXKBlib -SpecialCLibObjectRule(XKBCvt,$(_NOOP_),$(RCONST_DEFINES)) -SpecialCLibObjectRule(KeyBind,$(ICONFIGFILES),$(XKB_DEFINES)) -SpecialCLibObjectRule(XKBBind,$(ICONFIGFILES),$(XKB_DEFINES)) -SpecialCLibObjectRule(imConv,$(ICONFIGFILES),$(XKB_DEFINES)) -#endif -#if HasKrb5 -SpecialCLibObjectRule(k5encode,$(_NOOP_),$(K5INCL)) -#endif -#if BuildLoadableXlibI18n -SpecialCLibObjectRuleSeparateOpts(lcInit,$(ICONFIGFILES),$(_NOOP_),$(LC_DYNDEFINES)) -SpecialCLibObjectRuleSeparateOpts(lcGeneric,$(ICONFIGFILES),$(_NOOP_),$(LC_DYNDEFINES)) -SpecialCLibObjectRuleSeparateOpts(lcPublic,$(ICONFIGFILES),$(_NOOP_),$(LC_DYNDEFINES)) -#endif -#if BuildLoadableXlibXcursor -SpecialCLibObjectRuleSeparateOpts(CrCursor,$(ICONFIGFILES),$(_NOOP_),$(XCURSOR_DEFINES)) -SpecialCLibObjectRuleSeparateOpts(CrGlCur,$(ICONFIGFILES),$(_NOOP_),$(XCURSOR_DEFINES)) -SpecialCLibObjectRuleSeparateOpts(CrPixmap,$(ICONFIGFILES),$(_NOOP_),$(XCURSOR_DEFINES)) -SpecialCLibObjectRuleSeparateOpts(PutImage,$(ICONFIGFILES),$(_NOOP_),$(XCURSOR_DEFINES)) -#endif - -#if InstallXcmsTxt -InstallNonExecFile(Xcms.txt,$(LIBDIR)) -#endif -InstallNonExecFile(XErrorDB,$(LIBDIR)) -InstallNonExecFile(XKeysymDB,$(LIBDIR)) -InstallLintLibrary(X11,$(LINTLIBDIR)) - - -LinkSourceFile(AuDispose.c,$(XAUTHSRC)) -LinkSourceFile(AuGetBest.c,$(XAUTHSRC)) -LinkSourceFile(AuFileName.c,$(XAUTHSRC)) -LinkSourceFile(AuRead.c,$(XAUTHSRC)) -#if HasKrb5 -LinkSourceFile(k5encode.c,$(XAUTHSRC)) -#endif -#if HasXdmAuth -LinkSourceFile(Wrap.h,$(XDMCPLIBSRC)) -LinkSourceFile(Wrap.c,$(XDMCPLIBSRC)) -LinkSourceFile(Wraphelp.c,$(XDMCPLIBSRC)) -#endif - -#ifdef QNX4Architecture -LOCAL_LDFLAGS=-F -#endif - -MAKEKEYS = ./makekeys - -#if CrossCompiling -HOST_LDLIBS= -HOST_CFLAGS=$(TOP_INCLUDES) $(INCLUDES) $(BOOTSTRAPCFLAGS) \ - $(CROSSCOMPILEDEFINES) $(CROSSCOMPILEBOOTSTRAPDEFINES) -#else -HOST_LDLIBS=$(LDLIBS) -HOST_CFLAGS=$(CFLAGS) -#endif - -ks_tables.h: $(XINCLUDESRC)/keysymdef.h util/makekeys.c - RemoveFiles($@ HostProgramTargetName(makekeys) makekeys.Osuf) - -HostLinkRule(HostProgramTargetName(makekeys),$(HOST_CFLAGS) $(LOCAL_LDFLAGS),util/makekeys.c,$(HOST_LDLIBS)) - RunProgram(MAKEKEYS,< $(XINCLUDESRC)/keysymdef.h > ks_tables_h) - $(MV) ks_tables_h $@ - RemoveFiles(HostProgramTargetName(makekeys) makekeys.Osuf ks_tables_h) - -includes:: ks_tables.h - -#if NXLibraries - -$(NX_XCOMPCONFIGTARGET): - cd ../../../nxcomp && \ - ./configure - -$(NX_XCOMPEXTCONFIGTARGET): - cd ../../../nxcompext && \ - ./configure - -#ifdef SunArchitecture -$(NX_XCOMPLIBTARGET): $(NX_XCOMPCONFIGTARGET) - cd $(NX_XCOMPLIBDIR) && \ - gmake - -$(NX_XCOMPEXTLIBTARGET): $(NX_XCOMPEXTCONFIGTARGET) - cd ../../../nxcompext && \ - gmake - -#else -$(NX_XCOMPLIBTARGET): $(NX_XCOMPCONFIGTARGET) - cd $(NX_XCOMPLIBDIR) && \ - make - -$(NX_XCOMPEXTLIBTARGET): $(NX_XCOMPEXTCONFIGTARGET) - cd ../../../nxcompext && \ - make - -#endif - -depend:: $(NX_XCOMPLIBTARGET) - -all:: $(NX_XCOMPLIBTARGET) - -$(NX_XCOMPDEPTARGET): - ln -s $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME) $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME) - ln -s $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME).1 $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME).1 - -depend:: $(NX_XCOMPLIBTARGET) - -all:: $(NX_XCOMPDEPTARGET) $(NX_XCOMPEXTLIBTARGET) - -clean:: - rm -f $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME) - rm -f $(BUILDLIBDIR)/$(NX_XCOMPLIBNAME).1 - -#endif - -depend:: ks_tables.h - -clean:: - RemoveFiles(ks_tables_h ks_tables.h HostProgramTargetName(makekeys)) - - -DependTarget3($(SRCS1),$(SRCS2),$(SRCS3) $(EXTRASRCS)) - -#if BuildLoadableXlibI18n -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -MakeLintLibSubdirs($(LINTSUBDIRS)) -MakeLintSubdirs($(LINTSUBDIRS),install.ln,install.ln) -#endif -#endif - -includes:: XlibConf.h - -#include - -#if ThreadedProject -#define XThreadsDefine echo '#ifndef XTHREADS' >> $@ @@\ - echo '#define XTHREADS' >> $@ @@\ - echo '#endif' >> $@ -#else -#define XThreadsDefine echo '#undef XTHREADS' >> $@ -#endif - -#if HasThreadSafeAPI -#define MTSafeAPIDefine echo '#ifndef XUSE_MTSAFE_API' >> $@ @@\ - echo '#define XUSE_MTSAFE_API' >> $@ @@\ - echo '#endif' >> $@ -#else -#define MTSafeAPIDefine echo '#undef XUSE_MTSAFE_API' >> $@ -#endif - -XlibConf.h: - echo '/* Defines needed to use Xlib from non-imake projects */' > $@ - XThreadsDefine - MTSafeAPIDefine diff --git a/nx-X11/lib/X11/Imakefile.X.original b/nx-X11/lib/X11/Imakefile.X.original deleted file mode 100644 index 1f2c9b2bc..000000000 --- a/nx-X11/lib/X11/Imakefile.X.original +++ /dev/null @@ -1,1134 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:44:38 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/lib/X11/Imakefile,v 3.52 2003/05/27 16:53:15 tsi Exp $ - - - - HEADERS = Xlib.h Xresource.h Xutil.h cursorfont.h Xlibint.h \ - Xcms.h Xlocale.h XKBlib.h XlibConf.h Xregion.h ImUtil.h - -#if BuildServersOnly && !XWinServer && !XnestServer && !BuildGLXLibrary && !BuildClients && !XdmxServer -all:: - -BuildIncludes($(HEADERS),IncSubdir,..) - -#else - -#if BuildLoadableXlibI18n -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" -#define NoLibSubdirs -#endif - -#define DoNormalLib NormalLibX11 -#define DoSharedLib SharedLibX11 -#define DoExtraLib SharedLibX11 -#define DoDebugLib DebugLibX11 -#define DoProfileLib ProfileLibX11 -#define LibName X11 -#define SoRev SOXLIBREV -#define HugeLibrary YES -#define IncSubdir X11 - -#if BuildLoadableXlibI18n -SUBDIRS = xlibi18n -#endif - -#include - -#ifndef MotifBC -#define MotifBC NO -#endif - -#ifdef SharedX11Reqs -REQUIREDX11LIBS = SharedX11Reqs -#endif -#if BuildLoadableXlibI18n -REQUIREDI18NLIBS = DlLibrary -#endif -#ifdef cygwinArchitecture -EXCLUDE_SYMBOL = -Wl,--exclude-symbol,XdmcpWrap:_XdmcpWrapperToOddParity -#endif - -REQUIREDLIBS=$(REQUIREDX11LIBS) $(REQUIREDI18NLIBS) $(EXCLUDE_SYMBOL) - -#if defined(MacIIArchitecture) || defined(SequentArchitecture) || defined(i386ScoArchitecture) -XBSDLIB = /**/ -#endif -#if defined(LunaArchitecture) && defined(Mc88000Architecture) -EXTRA_LIBRARIES = /**/ -#endif -#if Malloc0ReturnsNull - MALLOC_DEFINES = XMalloc0ReturnsNullDefines -#endif -#if HasXdmAuth - XDMAUTHDEFS = -DHASXDMAUTH - XDMAUTHOBJS = Wrap.o Wraphelp.o - XDMAUTHSRCS = Wrap.c Wraphelp.c -#endif -#if BuildXKBlib - XKB_DEFINES = -DXKB - XKBSRCS = XKB.c XKBBind.c XKBCompat.c XKBCtrls.c XKBCvt.c XKBGetMap.c \ - XKBGetByName.c XKBNames.c XKBRdBuf.c XKBSetMap.c XKBUse.c \ - XKBleds.c XKBBell.c XKBGeom.c XKBSetGeom.c XKBExtDev.c \ - XKBList.c XKBMisc.c \ - XKBMAlloc.c XKBGAlloc.c XKBAlloc.c - XKBOBJS = XKB.o XKBBind.o XKBCompat.o XKBCtrls.o XKBCvt.o XKBGetMap.o \ - XKBGetByName.o XKBNames.o XKBRdBuf.o XKBSetMap.o XKBUse.o \ - XKBleds.o XKBBell.o XKBGeom.o XKBSetGeom.o XKBExtDev.o \ - XKBList.o XKBMisc.o \ - XKBMAlloc.o XKBGAlloc.o XKBAlloc.o -#endif -#if HasSecureRPC - RPCDEFS = -DSECURE_RPC -#endif -#if HasPoll - POLL_DEFINES = -DUSE_POLL -#endif - CONN_DEFINES = $(CONNECTION_FLAGS) - XTRANS_X_DEFINES = -DX11_t -DTRANS_CLIENT $(XTRANS_FAILDEFINES) - XTRANS_XIM_DEFINES = -DXIM_t -DTRANS_CLIENT $(XTRANS_FAILDEFINES) -#if HasBSD44Sockets - SOCK_DEFINES = -DBSD44SOCKETS -#endif -#if HasShm - SHM_DEFINES = -DHAS_SHM -#endif - - XF86BIGFONT_DEFINES = XF86BigfontExtensionDefines - - EDB_DEFINES = -DERRORDB=\"$(LIBDIR)/XErrorDB\" - KDB_DEFINES = -DKEYSYMDB=\"$(LIBDIR)/XKeysymDB\" - CMS_DEFINES = -DXCMSDB=\"$(LIBDIR)/Xcms.txt\" -#if HasSnprintf - MISC_DEFINES = -DHAS_SNPRINTF -DLIBX11 -#endif -#if MotifBC - BC_DEFINES = -DMOTIFBC -#endif -#if NoRConst - RCONST_DEFINES = -DNORCONST -#endif -#if DisableXLocaleDirEnv - SETID_DEFINES = -DNO_XLOCALEDIR -#elif HasIssetugid - SETID_DEFINES = -DHASSETUGID -#elif HasGetresuid - SETID_DEFINES = -DHASGETRESUID -#endif - XLC_DEFINES = -DXLOCALEDIR=\"$(XLOCALEDIR)\" -#if HasKrb5 - K5OBJS = k5encode.o - K5SRCS = k5encode.c - K5INCL = Krb5Includes - K5DEFS = Krb5Defines -#endif -#if (defined(FreeBSDArchitecture) && OSRelVersion < 500016) || \ - defined(OpenBSDArchitecture) -THRSTUBSRCS = UIThrStubs.c -THRSTUBOBJS = UIThrStubs.o -#endif -#if BuildLoadableXlibXcursor -XCURSOR_DEFINES = -DUSE_DYNAMIC_XCURSOR -DLIBXCURSOR=\"libXcursor.so.$(SOXCURSORREV)\" -#endif -#if NeedLibInsideFlag - LIB_DEFINES = -D_XLIBINT_ -#endif -#if defined(LibDirName) - POSTLOCALELIBDIR = LibDirName - POSTLOCALELIBDEFINES = -DPOSTLOCALELIBDIR=\"$(POSTLOCALELIBDIR)\" -#endif - DEFINES = $(MALLOC_DEFINES) $(LIB_DEFINES) $(MISC_DEFINES)\ - $(POSTLOCALELIBDEFINES) - OPEN_DEFINES = -I$(EXTINCSRC) $(K5INCL) $(K5DEFS) - DEPEND_DEFINES = $(OPEN_DEFINES) $(TRANS_INCLUDES) $(CONN_DEFINES) $(THREADS_DEFINES) DependDefines - AUTHOBJS = AuDispose.o AuGetBest.o AuFileName.o AuRead.o - AUTHSRCS = AuDispose.c AuGetBest.c AuFileName.c AuRead.c - SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(EXTRASRCS) /* try *.c if you have trouble */ - LINTLIBS = - -#if BuildLoadableXlibI18n && DoSharedLib -EXTRASHAREDSRC = $(SHAREDLCSRCS) -#endif -#if !BuildLoadableXlibI18n || DoNormalLib -EXTRASTATICSRC = $(STATICLCSRCS) -#endif - -EXTRASRCS = $(EXTRASHAREDSRC) $(EXTRASTATICSRC) - -SRCS1 = \ - Context.c \ - Depths.c \ - ParseCmd.c \ - Quarks.c \ - AllCells.c \ - AllPlanes.c \ - AllowEv.c \ - AutoRep.c \ - Backgnd.c \ - BdrWidth.c \ - Bell.c \ - Border.c \ - ChAccCon.c \ - ChClMode.c \ - ChActPGb.c \ - ChCmap.c \ - ChGC.c \ - ChKeyCon.c \ - ChPntCon.c \ - ChProp.c \ - ChSaveSet.c \ - ChWAttrs.c \ - ChWindow.c \ - ChkIfEv.c \ - ChkMaskEv.c \ - ChkWinEv.c \ - ChkTypEv.c \ - ChkTypWEv.c \ - CirWin.c \ - CirWinDn.c \ - CirWinUp.c \ - ClDisplay.c \ - Clear.c \ - ClearArea.c \ - ConfWind.c \ - ConnDis.c \ - ConvSel.c \ - CopyArea.c \ - CopyCmap.c \ - CopyGC.c \ - CopyPlane.c \ - CrBFData.c \ - CrCmap.c \ - CrCursor.c \ - CrGC.c \ - CrGlCur.c \ - CrPFBData.c \ - CrPixmap.c \ - CrWindow.c \ - Cursor.c \ - DefCursor.c \ - DelProp.c \ - DestSubs.c \ - DestWind.c \ - DisName.c \ - DrArc.c \ - DrArcs.c \ - DrLine.c \ - DrLines.c \ - DrPoint.c \ - DrPoints.c \ - DrRect.c \ - DrRects.c \ - DrSegs.c \ - ErrDes.c \ - ErrHndlr.c \ - EvToWire.c \ - FetchName.c \ - FillArc.c \ - FillArcs.c \ - FillPoly.c \ - FillRct.c \ - FillRcts.c \ - Flush.c \ - Font.c \ - FontNames.c \ - FontInfo.c \ - FreeCmap.c \ - FreeCols.c \ - FreeCurs.c \ - FreeEData.c \ - FreeGC.c \ - FreePix.c \ - FSSaver.c \ - GCMisc.c \ - Geom.c \ - GetAtomNm.c \ - GetColor.c \ - GetDflt.c \ - GetFPath.c \ - GetFProp.c \ - GetGeom.c \ - GetHColor.c \ - GetHints.c \ - GetIFocus.c \ - GetImage.c \ - GetKCnt.c \ - GetMoEv.c \ - GetPCnt.c \ - GetPntMap.c \ - GetProp.c \ - GetSOwner.c \ - GetSSaver.c \ - GetStCmap.c \ - GetWAttrs.c \ - GrButton.c \ - GrKey.c \ - GrKeybd.c \ - GrPointer.c \ - GrServer.c \ - Host.c \ - IfEvent.c \ - ImUtil.c \ - ImText.c \ - ImText16.c \ - InitExt.c \ - InsCmap.c \ - IntAtom.c \ - KeyBind.c \ - KeysymStr.c \ - KillCl.c \ - LiHosts.c \ - LiICmaps.c \ - LiProps.c \ - ListExt.c \ - LoadFont.c \ - LookupCol.c \ - LowerWin.c - -OBJS1 = \ - Context.o \ - Depths.o \ - ParseCmd.o \ - Quarks.o \ - AllCells.o \ - AllPlanes.o \ - AllowEv.o \ - AutoRep.o \ - Backgnd.o \ - BdrWidth.o \ - Bell.o \ - Border.o \ - ChAccCon.o \ - ChClMode.o \ - ChActPGb.o \ - ChCmap.o \ - ChGC.o \ - ChKeyCon.o \ - ChPntCon.o \ - ChProp.o \ - ChSaveSet.o \ - ChWAttrs.o \ - ChWindow.o \ - ChkIfEv.o \ - ChkMaskEv.o \ - ChkWinEv.o \ - ChkTypEv.o \ - ChkTypWEv.o \ - CirWin.o \ - CirWinDn.o \ - CirWinUp.o \ - ClDisplay.o \ - Clear.o \ - ClearArea.o \ - ConfWind.o \ - ConnDis.o \ - ConvSel.o \ - CopyArea.o \ - CopyCmap.o \ - CopyGC.o \ - CopyPlane.o \ - CrBFData.o \ - CrCmap.o \ - CrCursor.o \ - CrGC.o \ - CrGlCur.o \ - CrPFBData.o \ - CrPixmap.o \ - CrWindow.o \ - Cursor.o \ - DefCursor.o \ - DelProp.o \ - DestSubs.o \ - DestWind.o \ - DisName.o \ - DrArc.o \ - DrArcs.o \ - DrLine.o \ - DrLines.o \ - DrPoint.o \ - DrPoints.o \ - DrRect.o \ - DrRects.o \ - DrSegs.o \ - ErrDes.o \ - ErrHndlr.o \ - EvToWire.o \ - FetchName.o \ - FillArc.o \ - FillArcs.o \ - FillPoly.o \ - FillRct.o \ - FillRcts.o \ - Flush.o \ - Font.o \ - FontNames.o \ - FontInfo.o \ - FreeCmap.o \ - FreeCols.o \ - FreeCurs.o \ - FreeEData.o \ - FreeGC.o \ - FreePix.o \ - FSSaver.o \ - GCMisc.o \ - Geom.o \ - GetAtomNm.o \ - GetColor.o \ - GetDflt.o \ - GetFPath.o \ - GetFProp.o \ - GetGeom.o \ - GetHColor.o \ - GetHints.o \ - GetIFocus.o \ - GetImage.o \ - GetKCnt.o \ - GetMoEv.o \ - GetPCnt.o \ - GetPntMap.o \ - GetProp.o \ - GetSOwner.o \ - GetSSaver.o \ - GetStCmap.o \ - GetWAttrs.o \ - GrButton.o \ - GrKey.o \ - GrKeybd.o \ - GrPointer.o \ - GrServer.o \ - Host.o \ - IfEvent.o \ - ImUtil.o \ - ImText.o \ - ImText16.o \ - InitExt.o \ - InsCmap.o \ - IntAtom.o \ - KeyBind.o \ - KeysymStr.o \ - KillCl.o \ - LiHosts.o \ - LiICmaps.o \ - LiProps.o \ - ListExt.o \ - LoadFont.o \ - LookupCol.o \ - LowerWin.o - -SRCS2 = \ - Macros.c \ - MapRaised.c \ - MapSubs.c \ - MapWindow.c \ - MaskEvent.c \ - Misc.c \ - ModMap.c \ - MoveWin.c \ - NextEvent.c \ - OpenDis.c \ - ParseCol.c \ - ParseGeom.c \ - PeekEvent.c \ - PeekIfEv.c \ - Pending.c \ - PmapBgnd.c \ - PmapBord.c \ - PolyReg.c \ - PolyTxt.c \ - PolyTxt16.c \ - PutBEvent.c \ - PutImage.c \ - QuBest.c \ - QuColor.c \ - QuColors.c \ - QuCurShp.c \ - QuExt.c \ - QuKeybd.c \ - QuPntr.c \ - QuStipShp.c \ - QuTextE16.c \ - QuTextExt.c \ - QuTileShp.c \ - QuTree.c \ - RaiseWin.c \ - RdBitF.c \ - RecolorC.c \ - ReconfWin.c \ - Region.c \ - RepWindow.c \ - RestackWs.c \ - RotProp.c \ - ScrResStr.c \ - SelInput.c \ - SendEvent.c \ - SetBack.c \ - SetCRects.c \ - SetClMask.c \ - SetClOrig.c \ - SetDashes.c \ - SetFPath.c \ - SetFont.c \ - SetFore.c \ - SetFunc.c \ - SetHints.c \ - SetIFocus.c \ - SetLStyle.c \ - SetPMask.c \ - SetPntMap.c \ - SetSOwner.c \ - SetSSaver.c \ - SetState.c \ - SetStip.c \ - SetStCmap.c \ - SetTile.c \ - SetTSOrig.c \ - StBytes.c \ - StColor.c \ - StColors.c \ - StNColor.c \ - StName.c \ - StrKeysym.c \ - Sync.c \ - Synchro.c \ - Text.c \ - Text16.c \ - TextExt.c \ - TextExt16.c \ - TrCoords.c \ - UndefCurs.c \ - UngrabBut.c \ - UngrabKbd.c \ - UngrabKey.c \ - UngrabPtr.c \ - UngrabSvr.c \ - UninsCmap.c \ - UnldFont.c \ - UnmapSubs.c \ - UnmapWin.c \ - VisUtil.c \ - WarpPtr.c \ - WinEvent.c \ - Window.c \ - WrBitF.c \ - XlibAsync.c \ - XlibInt.c \ - Xrm.c \ - evtomask.c \ - globals.c \ - GetGCVals.c \ - GetNrmHint.c \ - GetRGBCMap.c \ - GetTxtProp.c \ - GetWMCMapW.c \ - GetWMProto.c \ - Iconify.c \ - PixFormats.c \ - PropAlloc.c \ - ReconfWM.c \ - SetNrmHint.c \ - SetRGBCMap.c \ - SetTxtProp.c \ - SetWMCMapW.c \ - SetWMProto.c \ - StrToText.c \ - TextToStr.c \ - Withdraw.c \ - WMGeom.c \ - WMProps.c \ - $(AUTHSRCS) $(XDMAUTHSRCS) $(K5SRCS) $(THRSTUBSRCS) - -OBJS2 = \ - Macros.o \ - MapRaised.o \ - MapSubs.o \ - MapWindow.o \ - MaskEvent.o \ - Misc.o \ - ModMap.o \ - MoveWin.o \ - NextEvent.o \ - OpenDis.o \ - ParseCol.o \ - ParseGeom.o \ - PeekEvent.o \ - PeekIfEv.o \ - Pending.o \ - PmapBgnd.o \ - PmapBord.o \ - PolyReg.o \ - PolyTxt.o \ - PolyTxt16.o \ - PutBEvent.o \ - PutImage.o \ - QuBest.o \ - QuColor.o \ - QuColors.o \ - QuCurShp.o \ - QuExt.o \ - QuKeybd.o \ - QuPntr.o \ - QuStipShp.o \ - QuTextE16.o \ - QuTextExt.o \ - QuTileShp.o \ - QuTree.o \ - RaiseWin.o \ - RdBitF.o \ - RecolorC.o \ - ReconfWin.o \ - Region.o \ - RepWindow.o \ - RestackWs.o \ - RotProp.o \ - ScrResStr.o \ - SelInput.o \ - SendEvent.o \ - SetBack.o \ - SetCRects.o \ - SetClMask.o \ - SetClOrig.o \ - SetDashes.o \ - SetFPath.o \ - SetFont.o \ - SetFore.o \ - SetFunc.o \ - SetHints.o \ - SetIFocus.o \ - SetLStyle.o \ - SetPMask.o \ - SetPntMap.o \ - SetSOwner.o \ - SetSSaver.o \ - SetState.o \ - SetStip.o \ - SetStCmap.o \ - SetTile.o \ - SetTSOrig.o \ - StBytes.o \ - StColor.o \ - StColors.o \ - StNColor.o \ - StName.o \ - StrKeysym.o \ - Sync.o \ - Synchro.o \ - Text.o \ - Text16.o \ - TextExt.o \ - TextExt16.o \ - TrCoords.o \ - UndefCurs.o \ - UngrabBut.o \ - UngrabKbd.o \ - UngrabKey.o \ - UngrabPtr.o \ - UngrabSvr.o \ - UninsCmap.o \ - UnldFont.o \ - UnmapSubs.o \ - UnmapWin.o \ - VisUtil.o \ - WarpPtr.o \ - WinEvent.o \ - Window.o \ - WrBitF.o \ - XlibAsync.o \ - XlibInt.o \ - Xrm.o \ - evtomask.o \ - globals.o \ - GetGCVals.o \ - GetNrmHint.o \ - GetRGBCMap.o \ - GetTxtProp.o \ - GetWMCMapW.o \ - GetWMProto.o \ - Iconify.o \ - PixFormats.o \ - PropAlloc.o \ - ReconfWM.o \ - SetNrmHint.o \ - SetRGBCMap.o \ - SetTxtProp.o \ - SetWMCMapW.o \ - SetWMProto.o \ - StrToText.o \ - TextToStr.o \ - Withdraw.o \ - WMGeom.o \ - WMProps.o \ - $(AUTHOBJS) \ - $(XDMAUTHOBJS) \ - $(K5OBJS) \ - $(THRSTUBOBJS) - -SRCS3 = \ - Lab.c \ - LabGcC.c \ - LabGcL.c \ - LabGcLC.c \ - LabMnL.c \ - LabMxC.c \ - LabMxL.c \ - LabMxLC.c \ - LabWpAj.c \ - Luv.c \ - LuvGcC.c \ - LuvGcL.c \ - LuvGcLC.c \ - LuvMnL.c \ - LuvMxC.c \ - LuvMxL.c \ - LuvMxLC.c \ - LuvWpAj.c \ - XYZ.c \ - uvY.c \ - xyY.c \ - HVC.c \ - HVCGcC.c \ - HVCGcV.c \ - HVCGcVC.c \ - HVCMnV.c \ - HVCMxC.c \ - HVCMxV.c \ - HVCMxVC.c \ - HVCMxVs.c \ - HVCWpAj.c \ - UNDEFINED.c \ - AddDIC.c \ - AddSF.c \ - cmsAllNCol.c \ - cmsAllCol.c \ - CCC.c \ - cmsCmap.c \ - cmsColNm.c \ - CvColW.c \ - CvCols.c \ - cmsGlobls.c \ - IdOfPr.c \ - cmsInt.c \ - LRGB.c \ - cmsLkCol.c \ - cmsMath.c \ - OfCCC.c \ - PrOfId.c \ - cmsProp.c \ - QBlack.c \ - QBlue.c \ - QGreen.c \ - QRed.c \ - QWhite.c \ - QuCol.c \ - QuCols.c \ - SetCCC.c \ - SetGetCols.c \ - StCol.c \ - StCols.c \ - cmsTrig.c \ - XRGB.c \ - FSWrap.c \ - ICWrap.c \ - IMWrap.c \ - OCWrap.c \ - OMWrap.c \ - lcWrap.c \ - mbWMProps.c \ - utf8WMProps.c \ - mbWrap.c \ - wcWrap.c \ - utf8Wrap.c \ - FilterEv.c \ - RegstFlt.c \ - locking.c \ - LockDis.c \ - x11trans.c \ - ximtrans.c \ - $(XKBSRCS) $(LCSRCS) $(MISCSRCS) - -OBJS3 = \ - Lab.o \ - LabGcC.o \ - LabGcL.o \ - LabGcLC.o \ - LabMnL.o \ - LabMxC.o \ - LabMxL.o \ - LabMxLC.o \ - LabWpAj.o \ - Luv.o \ - LuvGcC.o \ - LuvGcL.o \ - LuvGcLC.o \ - LuvMnL.o \ - LuvMxC.o \ - LuvMxL.o \ - LuvMxLC.o \ - LuvWpAj.o \ - XYZ.o \ - uvY.o \ - xyY.o \ - HVC.o \ - HVCGcC.o \ - HVCGcV.o \ - HVCGcVC.o \ - HVCMnV.o \ - HVCMxC.o \ - HVCMxV.o \ - HVCMxVC.o \ - HVCMxVs.o \ - HVCWpAj.o \ - UNDEFINED.o \ - AddDIC.o \ - AddSF.o \ - cmsAllNCol.o \ - cmsAllCol.o \ - CCC.o \ - cmsCmap.o \ - cmsColNm.o \ - CvColW.o \ - CvCols.o \ - cmsGlobls.o \ - IdOfPr.o \ - cmsInt.o \ - LRGB.o \ - cmsLkCol.o \ - cmsMath.o \ - OfCCC.o \ - PrOfId.o \ - cmsProp.o \ - QBlack.o \ - QBlue.o \ - QGreen.o \ - QRed.o \ - QWhite.o \ - QuCol.o \ - QuCols.o \ - SetCCC.o \ - SetGetCols.o \ - StCol.o \ - StCols.o \ - cmsTrig.o \ - XRGB.o \ - FSWrap.o \ - ICWrap.o \ - IMWrap.o \ - OCWrap.o \ - OMWrap.o \ - lcWrap.o \ - mbWMProps.o \ - utf8WMProps.o \ - mbWrap.o \ - wcWrap.o \ - utf8Wrap.o \ - FilterEv.o \ - RegstFlt.o \ - locking.o \ - LockDis.o \ - x11trans.o \ - ximtrans.o \ - $(XKBOBJS) $(LCOBJS) $(MISCOBJS) - -#if BuildLoadableXlibI18n -LC_DYNDEFINES = -DUSE_DYNAMIC_LC -#endif - -SHAREDLCDEPSYMSRCS = XlcDL.c XlcSL.c - -SHAREDI18NSTATICSRCS = \ - XDefaultIMIF.c XDefaultOMIF.c - -STATICLCDEPSYMSRCS = - -STATICI18NSTATICSRCS = \ - imCallbk.c \ - imDefFlt.c \ - imDefIc.c \ - imDefIm.c \ - imDefLkup.c \ - imDispch.c \ - imEvToWire.c \ - imExten.c \ - imImSw.c \ - imInsClbk.c \ - imInt.c \ - imLcFlt.c \ - imLcGIc.c \ - imLcIc.c \ - imLcIm.c \ - imLcLkup.c \ - imLcPrs.c \ - imLcSIc.c \ - imRm.c \ - imRmAttr.c \ - imThaiFlt.c \ - imThaiIc.c \ - imThaiIm.c \ - imTrX.c \ - imTransR.c \ - imTrans.c \ - lcEuc.c \ - lcGenConv.c \ - lcJis.c \ - lcSjis.c \ - lcUTF8Load.c \ - omDefault.c \ - omGeneric.c \ - omImText.c \ - omText.c \ - omTextEsc.c \ - omTextExt.c \ - omTextPer.c \ - omXChar.c - -LCSRCS = \ - SetLocale.c \ - imConv.c \ - imKStoUCS.c \ - lcCT.c \ - lcCharSet.c \ - lcConv.c \ - lcDB.c \ - lcDefConv.c \ - lcFile.c \ - lcGeneric.c \ - lcInit.c \ - lcPrTxt.c \ - lcPubWrap.c \ - lcPublic.c \ - lcRM.c \ - lcStd.c \ - lcTxtPr.c \ - lcUtil.c \ - lcUTF8.c - -STATICLCSRCS = \ - $(STATICLCDEPSYMSRCS) \ - $(STATICI18NSTATICSRCS) - -SHAREDLCSRCS = \ - $(SHAREDLCDEPSYMSRCS) \ - $(SHAREDI18NSTATICSRCS) - -SHAREDLCDEPOBJS = XlcDL.o XlcSL.o -SHAREDI18NSTATICOBJS = \ - XDefaultIMIF.o XDefaultOMIF.o -STATICLCDEPOBJS = -STATICI18NSTATICOBJS = \ - imCallbk.o \ - imDefFlt.o \ - imDefIc.o \ - imDefIm.o \ - imDefLkup.o \ - imDispch.o \ - imEvToWire.o \ - imExten.o \ - imImSw.o \ - imInsClbk.o \ - imInt.o \ - imLcFlt.o \ - imLcGIc.o \ - imLcIc.o \ - imLcIm.o \ - imLcLkup.o \ - imLcPrs.o \ - imLcSIc.o \ - imRm.o \ - imRmAttr.o \ - imThaiFlt.o \ - imThaiIc.o \ - imThaiIm.o \ - imTrX.o \ - imTransR.o \ - imTrans.o \ - lcEuc.o \ - lcGenConv.o \ - lcJis.o \ - lcSjis.o \ - lcUTF8Load.o \ - omDefault.o \ - omGeneric.o \ - omImText.o \ - omText.o \ - omTextEsc.o \ - omTextExt.o \ - omTextPer.o \ - omXChar.o - -LCOBJS = \ - SetLocale.o \ - imConv.o \ - imKStoUCS.o \ - lcCT.o \ - lcCharSet.o \ - lcConv.o \ - lcDB.o \ - lcDefConv.o \ - lcFile.o \ - lcGeneric.o \ - lcInit.o \ - lcPrTxt.o \ - lcPubWrap.o \ - lcPublic.o \ - lcRM.o \ - lcStd.o \ - lcTxtPr.o \ - lcUtil.o \ - lcUTF8.o - -STATICLCOBJS = \ - $(STATICLCDEPOBJS) \ - $(STATICI18NSTATICOBJS) - -SHAREDLCOBJS = \ - $(SHAREDLCDEPOBJS) \ - $(SHAREDI18NSTATICOBJS) - -#ifdef OS2Architecture -MISCSRCS = os2Stubs.c -#endif - -#ifdef OS2Architecture -MISCOBJS = os2Stubs.o -#endif - -OBJS = $(OBJS1) $(OBJS2) $(OBJS3) - -EXTRAUNSHAREDOBJS = $(STATICLCOBJS) - -#if BuildLoadableXlibI18n -EXTRASHAREDOBJS = $(SHAREDLCOBJS) -# else -EXTRASHAREDOBJS = $(STATICLCOBJS) -#endif - -#include - -SpecialCLibObjectRule(ErrDes,$(ICONFIGFILES),$(EDB_DEFINES)) -SpecialCLibObjectRule(StrKeysym,$(ICONFIGFILES),$(KDB_DEFINES)) -SpecialCLibObjectRule(ConnDis,$(ICONFIGFILES),$(XDMAUTHDEFS) $(RPCDEFS) $(CONN_DEFINES) $(SOCK_DEFINES) $(POLL_DEFINES) $(XTRANS_X_DEFINES) $(K5INCL) $(K5DEFS)) -SpecialCLibObjectRule(x11trans,$(ICONFIGFILES),$(TRANS_INCLUDES) $(CONN_DEFINES) $(SOCK_DEFINES) $(XTRANS_X_DEFINES) $(POLL_DEFINES)) -LinkFile(x11trans.c,$(TRANSCOMMSRC)/transport.c) -SpecialCLibObjectRule(ximtrans,$(ICONFIGFILES),$(TRANS_INCLUDES) $(CONN_DEFINES) $(SOCK_DEFINES) $(XTRANS_XIM_DEFINES) $(POLL_DEFINES)) -LinkFile(ximtrans.c,$(TRANSCOMMSRC)/transport.c) -SpecialCLibObjectRule(OpenDis,$(ICONFIGFILES),$(BC_DEFINES) $(OPEN_DEFINES) $(XTRANS_X_DEFINES) $(XKB_DEFINES)) -SpecialCLibObjectRule(Wrap,$(ICONFIGFILES),$(XDMAUTHDEFS)) -SpecialCLibObjectRule(XlibInt,$(ICONFIGFILES),$(CONN_DEFINES) $(POLL_DEFINES) $(XTRANS_X_DEFINES)) -SpecialCLibObjectRule(Font,$(ICONFIGFILES),$(SHM_DEFINES) $(XF86BIGFONT_DEFINES)) -SpecialCLibObjectRule(FontInfo,$(ICONFIGFILES),$(SHM_DEFINES) $(XF86BIGFONT_DEFINES)) -SpecialCLibObjectRule(cmsColNm,$(ICONFIGFILES),$(CMS_DEFINES)) -SpecialCLibObjectRule(globals,$(ICONFIGFILES),$(CONN_DEFINES)) -SpecialCLibObjectRule(Context,$(ICONFIGFILES),$(BC_DEFINES)) -SpecialCLibObjectRule(Xrm,$(_NOOP_),$(RCONST_DEFINES)) -SpecialCLibObjectRule(imTransR,$(ICONFIGFILES),$(CONN_DEFINES) $(XTRANS_XIM_DEFINES)) -SpecialCLibObjectRule(imTrans,$(ICONFIGFILES),$(CONN_DEFINES) $(XTRANS_XIM_DEFINES)) -SpecialCLibObjectRule(lcFile,$(ICONFIGFILES),$(XLC_DEFINES) $(SETID_DEFINES)) -#if BuildXKBlib -SpecialCLibObjectRule(XKBCvt,$(_NOOP_),$(RCONST_DEFINES)) -SpecialCLibObjectRule(KeyBind,$(ICONFIGFILES),$(XKB_DEFINES)) -SpecialCLibObjectRule(XKBBind,$(ICONFIGFILES),$(XKB_DEFINES)) -SpecialCLibObjectRule(imConv,$(ICONFIGFILES),$(XKB_DEFINES)) -#endif -#if HasKrb5 -SpecialCLibObjectRule(k5encode,$(_NOOP_),$(K5INCL)) -#endif -#if BuildLoadableXlibI18n -SpecialCLibObjectRuleSeparateOpts(lcInit,$(ICONFIGFILES),$(_NOOP_),$(LC_DYNDEFINES)) -SpecialCLibObjectRuleSeparateOpts(lcGeneric,$(ICONFIGFILES),$(_NOOP_),$(LC_DYNDEFINES)) -SpecialCLibObjectRuleSeparateOpts(lcPublic,$(ICONFIGFILES),$(_NOOP_),$(LC_DYNDEFINES)) -#endif -#if BuildLoadableXlibXcursor -SpecialCLibObjectRuleSeparateOpts(CrCursor,$(ICONFIGFILES),$(_NOOP_),$(XCURSOR_DEFINES)) -SpecialCLibObjectRuleSeparateOpts(CrGlCur,$(ICONFIGFILES),$(_NOOP_),$(XCURSOR_DEFINES)) -SpecialCLibObjectRuleSeparateOpts(CrPixmap,$(ICONFIGFILES),$(_NOOP_),$(XCURSOR_DEFINES)) -SpecialCLibObjectRuleSeparateOpts(PutImage,$(ICONFIGFILES),$(_NOOP_),$(XCURSOR_DEFINES)) -#endif - -#if InstallXcmsTxt -InstallNonExecFile(Xcms.txt,$(LIBDIR)) -#endif -InstallNonExecFile(XErrorDB,$(LIBDIR)) -InstallNonExecFile(XKeysymDB,$(LIBDIR)) -InstallLintLibrary(X11,$(LINTLIBDIR)) - - -LinkSourceFile(AuDispose.c,$(XAUTHSRC)) -LinkSourceFile(AuGetBest.c,$(XAUTHSRC)) -LinkSourceFile(AuFileName.c,$(XAUTHSRC)) -LinkSourceFile(AuRead.c,$(XAUTHSRC)) -#if HasKrb5 -LinkSourceFile(k5encode.c,$(XAUTHSRC)) -#endif -#if HasXdmAuth -LinkSourceFile(Wrap.h,$(XDMCPLIBSRC)) -LinkSourceFile(Wrap.c,$(XDMCPLIBSRC)) -LinkSourceFile(Wraphelp.c,$(XDMCPLIBSRC)) -#endif - -#ifdef QNX4Architecture -LOCAL_LDFLAGS=-F -#endif - -MAKEKEYS = ./makekeys - -#if CrossCompiling -HOST_LDLIBS= -HOST_CFLAGS=$(TOP_INCLUDES) $(INCLUDES) $(BOOTSTRAPCFLAGS) \ - $(CROSSCOMPILEDEFINES) $(CROSSCOMPILEBOOTSTRAPDEFINES) -#else -HOST_LDLIBS=$(LDLIBS) -HOST_CFLAGS=$(CFLAGS) -#endif - -ks_tables.h: $(XINCLUDESRC)/keysymdef.h util/makekeys.c - RemoveFiles($@ HostProgramTargetName(makekeys) makekeys.Osuf) - -HostLinkRule(HostProgramTargetName(makekeys),$(HOST_CFLAGS) $(LOCAL_LDFLAGS),util/makekeys.c,$(HOST_LDLIBS)) - RunProgram(MAKEKEYS,< $(XINCLUDESRC)/keysymdef.h > ks_tables_h) - $(MV) ks_tables_h $@ - RemoveFiles(HostProgramTargetName(makekeys) makekeys.Osuf ks_tables_h) - -includes:: ks_tables.h - -depend:: ks_tables.h - -clean:: - RemoveFiles(ks_tables_h ks_tables.h HostProgramTargetName(makekeys)) - - -DependTarget3($(SRCS1),$(SRCS2),$(SRCS3) $(EXTRASRCS)) - -#if BuildLoadableXlibI18n -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -MakeLintLibSubdirs($(LINTSUBDIRS)) -MakeLintSubdirs($(LINTSUBDIRS),install.ln,install.ln) -#endif -#endif - -includes:: XlibConf.h - -#include - -#if ThreadedProject -#define XThreadsDefine echo '#ifndef XTHREADS' >> $@ @@\ - echo '#define XTHREADS' >> $@ @@\ - echo '#endif' >> $@ -#else -#define XThreadsDefine echo '#undef XTHREADS' >> $@ -#endif - -#if HasThreadSafeAPI -#define MTSafeAPIDefine echo '#ifndef XUSE_MTSAFE_API' >> $@ @@\ - echo '#define XUSE_MTSAFE_API' >> $@ @@\ - echo '#endif' >> $@ -#else -#define MTSafeAPIDefine echo '#undef XUSE_MTSAFE_API' >> $@ -#endif - -XlibConf.h: - echo '/* Defines needed to use Xlib from non-imake projects */' > $@ - XThreadsDefine - MTSafeAPIDefine diff --git a/nx-X11/lib/X11/MaskEvent.c.NX.original b/nx-X11/lib/X11/MaskEvent.c.NX.original deleted file mode 100644 index c48a960d2..000000000 --- a/nx-X11/lib/X11/MaskEvent.c.NX.original +++ /dev/null @@ -1,84 +0,0 @@ -/* $Xorg: MaskEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ -/* - -Copyright 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/MaskEvent.c,v 3.5 2001/10/28 03:32:30 tsi Exp $ */ - -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -extern long const _Xevent_to_mask[]; -#define AllPointers (PointerMotionMask|PointerMotionHintMask|ButtonMotionMask) -#define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\ - Button4MotionMask|Button5MotionMask) - -/* - * return the next event in the queue matching one of the events in the mask. - * If no event, flush output, and wait until match succeeds. - * Events earlier in the queue are not discarded. - */ - -int -XMaskEvent (dpy, mask, event) - register Display *dpy; - long mask; /* Selected event mask. */ - register XEvent *event; /* XEvent to be filled in. */ -{ - register _XQEvent *prev, *qelt; - unsigned long qe_serial = 0; - - LockDisplay(dpy); - prev = NULL; - while (1) { - for (qelt = prev ? prev->next : dpy->head; - qelt; - prev = qelt, qelt = qelt->next) { - if ((qelt->event.type < LASTEvent) && - (_Xevent_to_mask[qelt->event.type] & mask) && - ((qelt->event.type != MotionNotify) || - (mask & AllPointers) || - (mask & AllButtons & qelt->event.xmotion.state))) { - *event = qelt->event; - _XDeq(dpy, prev, qelt); - UnlockDisplay(dpy); - return 0; - } - } - if (prev) - qe_serial = prev->qserial_num; - _XReadEvents(dpy); - if (prev && prev->qserial_num != qe_serial) - /* another thread has snatched this event */ - prev = NULL; -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - return 0; - } -#endif - } -} diff --git a/nx-X11/lib/X11/MaskEvent.c.X.original b/nx-X11/lib/X11/MaskEvent.c.X.original deleted file mode 100644 index c5f41b54d..000000000 --- a/nx-X11/lib/X11/MaskEvent.c.X.original +++ /dev/null @@ -1,79 +0,0 @@ -/* $Xorg: MaskEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ -/* - -Copyright 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/MaskEvent.c,v 3.5 2001/10/28 03:32:30 tsi Exp $ */ - -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -extern long const _Xevent_to_mask[]; -#define AllPointers (PointerMotionMask|PointerMotionHintMask|ButtonMotionMask) -#define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\ - Button4MotionMask|Button5MotionMask) - -/* - * return the next event in the queue matching one of the events in the mask. - * If no event, flush output, and wait until match succeeds. - * Events earlier in the queue are not discarded. - */ - -int -XMaskEvent (dpy, mask, event) - register Display *dpy; - long mask; /* Selected event mask. */ - register XEvent *event; /* XEvent to be filled in. */ -{ - register _XQEvent *prev, *qelt; - unsigned long qe_serial = 0; - - LockDisplay(dpy); - prev = NULL; - while (1) { - for (qelt = prev ? prev->next : dpy->head; - qelt; - prev = qelt, qelt = qelt->next) { - if ((qelt->event.type < LASTEvent) && - (_Xevent_to_mask[qelt->event.type] & mask) && - ((qelt->event.type != MotionNotify) || - (mask & AllPointers) || - (mask & AllButtons & qelt->event.xmotion.state))) { - *event = qelt->event; - _XDeq(dpy, prev, qelt); - UnlockDisplay(dpy); - return 0; - } - } - if (prev) - qe_serial = prev->qserial_num; - _XReadEvents(dpy); - if (prev && prev->qserial_num != qe_serial) - /* another thread has snatched this event */ - prev = NULL; - } -} diff --git a/nx-X11/lib/X11/OpenDis.c.NX.original b/nx-X11/lib/X11/OpenDis.c.NX.original deleted file mode 100644 index e9d019723..000000000 --- a/nx-X11/lib/X11/OpenDis.c.NX.original +++ /dev/null @@ -1,911 +0,0 @@ -/* $Xorg: OpenDis.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ -/* - -Copyright 1985, 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/lib/X11/OpenDis.c,v 3.16 2003/07/04 16:24:23 eich Exp $ */ - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" -#include -#include -#include -#include -#include -#include "Xintconn.h" - -#ifdef XKB -#include "XKBlib.h" -#endif /* XKB */ - -#ifdef NX_TRANS_SOCKET -extern void *_X11TransSocketProxyConnInfo(XtransConnInfo); -#endif - -#ifdef X_NOT_POSIX -#define Size_t unsigned int -#else -#define Size_t size_t -#endif - -#define bignamelen (sizeof(XBigReqExtensionName) - 1) - -typedef struct { - unsigned long seq; - int opcode; -} _XBigReqState; - -#ifdef XTHREADS -#include "locking.h" -int (*_XInitDisplayLock_fn)(Display *dpy) = NULL; -void (*_XFreeDisplayLock_fn)(Display *dpy) = NULL; - -#define InitDisplayLock(d) (_XInitDisplayLock_fn ? (*_XInitDisplayLock_fn)(d) : Success) -#define FreeDisplayLock(d) if (_XFreeDisplayLock_fn) (*_XFreeDisplayLock_fn)(d) -#else -#define InitDisplayLock(dis) Success -#define FreeDisplayLock(dis) -#endif /* XTHREADS */ - -static xReq _dummy_request = { - 0, 0, 0 -}; - -static void OutOfMemory(Display *dpy, char *setup); -static Bool _XBigReqHandler(Display *dpy, xReply *rep, char *buf, int len, - XPointer data); - -/* - * Connects to a server, creates a Display object and returns a pointer to - * the newly created Display back to the caller. - */ -Display * -XOpenDisplay ( - register _Xconst char *display) -{ - register Display *dpy; /* New Display object being created. */ - register int i; - int j, k; /* random iterator indexes */ - char *display_name; /* pointer to display name */ - int endian; /* to determine which endian. */ - xConnClientPrefix client; /* client information */ - xConnSetupPrefix prefix; /* prefix information */ - int vendorlen; /* length of vendor string */ - char *setup = NULL; /* memory allocated at startup */ - char *fullname = NULL; /* expanded name of display */ - int idisplay; /* display number */ - int iscreen; /* screen number */ - int prefixread = 0; /* setup prefix already read? */ - union { - xConnSetup *setup; - char *failure; - char *vendor; - xPixmapFormat *sf; - xWindowRoot *rp; - xDepth *dp; - xVisualType *vp; - } u; /* proto data returned from server */ - long setuplength; /* number of bytes in setup message */ - long usedbytes = 0; /* number of bytes we have processed */ - char *conn_auth_name, *conn_auth_data; - int conn_auth_namelen, conn_auth_datalen; - unsigned long mask; - long int conn_buf_size; - char *xlib_buffer_size; - - bzero((char *) &client, sizeof(client)); - bzero((char *) &prefix, sizeof(prefix)); - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "\nXOpenDisplay: Called with display [%s].\n", display); -#endif - /* - * If the display specifier string supplied as an argument to this - * routine is NULL or a pointer to NULL, read the DISPLAY variable. - */ - if (display == NULL || *display == '\0') { - if ((display_name = getenv("DISPLAY")) == NULL) { - /* Oops! No DISPLAY environment variable - error. */ - return(NULL); - } - } - else { - /* Display is non-NULL, copy the pointer */ - display_name = (char *)display; - } -/* - * Set the default error handlers. This allows the global variables to - * default to NULL for use with shared libraries. - */ - if (_XErrorFunction == NULL) (void) XSetErrorHandler (NULL); - if (_XIOErrorFunction == NULL) (void) XSetIOErrorHandler (NULL); - -/* - * Attempt to allocate a display structure. Return NULL if allocation fails. - */ - if ((dpy = (Display *)Xcalloc(1, sizeof(Display))) == NULL) { - return(NULL); - } - -/* - * Call the Connect routine to get the transport connection object. - * If NULL is returned, the connection failed. The connect routine - * will set fullname to point to the expanded name. - */ - - if ((dpy->trans_conn = _X11TransConnectDisplay ( - display_name, &fullname, &idisplay, - &iscreen, &conn_auth_name, - &conn_auth_namelen, &conn_auth_data, - &conn_auth_datalen)) == NULL) { - Xfree ((char *) dpy); - return(NULL); - } - - dpy->fd = _X11TransGetConnectionNumber (dpy->trans_conn); - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "\nXOpenDisplay: Connected display with dpy->fd = [%d].\n", dpy->fd); -#endif - /* Initialize as much of the display structure as we can. - * Initialize pointers to NULL so that XFreeDisplayStructure will - * work if we run out of memory before we finish initializing. - */ - dpy->display_name = fullname; - dpy->keysyms = (KeySym *) NULL; - dpy->modifiermap = NULL; - dpy->lock_meaning = NoSymbol; - dpy->keysyms_per_keycode = 0; - dpy->xdefaults = (char *)NULL; - dpy->scratch_length = 0L; - dpy->scratch_buffer = NULL; - dpy->key_bindings = NULL; - dpy->ext_procs = (_XExtension *)NULL; - dpy->ext_data = (XExtData *)NULL; - dpy->ext_number = 0; - dpy->event_vec[X_Error] = _XUnknownWireEvent; - dpy->event_vec[X_Reply] = _XUnknownWireEvent; - dpy->wire_vec[X_Error] = _XUnknownNativeEvent; - dpy->wire_vec[X_Reply] = _XUnknownNativeEvent; - for (i = KeyPress; i < LASTEvent; i++) { - dpy->event_vec[i] = _XWireToEvent; - dpy->wire_vec[i] = NULL; - } - for (i = LASTEvent; i < 128; i++) { - dpy->event_vec[i] = _XUnknownWireEvent; - dpy->wire_vec[i] = _XUnknownNativeEvent; - } - dpy->resource_id = 0; - dpy->db = (struct _XrmHashBucketRec *)NULL; - dpy->cursor_font = None; - dpy->flags = 0; - dpy->async_handlers = NULL; - dpy->screens = NULL; - dpy->vendor = NULL; - dpy->buffer = NULL; - dpy->atoms = NULL; - dpy->error_vec = NULL; - dpy->context_db = NULL; - dpy->free_funcs = NULL; - dpy->pixmap_format = NULL; - dpy->cms.clientCmaps = NULL; - dpy->cms.defaultCCCs = NULL; - dpy->cms.perVisualIntensityMaps = NULL; - dpy->im_filters = NULL; - dpy->bigreq_size = 0; - dpy->lock = NULL; - dpy->lock_fns = NULL; - dpy->qfree = NULL; - dpy->next_event_serial_num = 1; - dpy->im_fd_info = NULL; - dpy->im_fd_length = 0; - dpy->conn_watchers = NULL; - dpy->watcher_count = 0; - dpy->filedes = NULL; - dpy->flushes = NULL; - dpy->xcmisc_opcode = 0; - dpy->xkb_info = NULL; - -/* - * Setup other information in this display structure. - */ - dpy->vnumber = X_PROTOCOL; - dpy->resource_alloc = _XAllocID; - dpy->idlist_alloc = _XAllocIDs; - dpy->synchandler = NULL; - dpy->savedsynchandler = NULL; - dpy->request = 0; - dpy->last_request_read = 0; - dpy->default_screen = iscreen; /* Value returned by ConnectDisplay */ - dpy->last_req = (char *)&_dummy_request; - - /* Initialize the display lock */ - if (InitDisplayLock(dpy) != 0) { - OutOfMemory (dpy, setup); - return(NULL); - } - - if (!_XPollfdCacheInit(dpy)) { - OutOfMemory (dpy, setup); - return(NULL); - } - - /* Set up the output buffers. */ -#ifndef XLIBDEFAULTBUFSIZE -#define XLIBDEFAULTBUFSIZE 16384 /* 16k */ -#endif -#ifndef XLIBMINBUFSIZE -#define XLIBMINBUFSIZE BUFSIZE /* old default buffer size */ -#endif - if ((xlib_buffer_size = getenv("XLIBBUFFERSIZE")) == NULL) - conn_buf_size = XLIBDEFAULTBUFSIZE; - else - conn_buf_size = 1024 * strtol(xlib_buffer_size, NULL, 10); - if (conn_buf_size < XLIBMINBUFSIZE) - conn_buf_size = XLIBMINBUFSIZE; -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf (stderr, "Xlib: Running with XLIBBUFFERSIZE [%d] XLIBMINBUFSIZE [%d] " - "buffer size [%ld].\n", XLIBDEFAULTBUFSIZE, XLIBMINBUFSIZE, conn_buf_size); -#endif - - if ((dpy->bufptr = dpy->buffer = Xcalloc(1, conn_buf_size)) == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - dpy->bufmax = dpy->buffer + conn_buf_size; - - /* Set up the input event queue and input event queue parameters. */ - dpy->head = dpy->tail = NULL; - dpy->qlen = 0; - - /* Set up free-function record */ - if ((dpy->free_funcs = (_XFreeFuncRec *)Xcalloc(1, - sizeof(_XFreeFuncRec))) - == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - -/* - * The xConnClientPrefix describes the initial connection setup information - * and is followed by the authorization information. Sites that are interested - * in security are strongly encouraged to use an authentication and - * authorization system such as Kerberos. - */ - endian = 1; - if (*(char *) &endian) - client.byteOrder = '\154'; /* 'l' */ - else - client.byteOrder = '\102'; /* 'B' */ - client.majorVersion = X_PROTOCOL; - client.minorVersion = X_PROTOCOL_REVISION; - client.nbytesAuthProto = conn_auth_namelen; - client.nbytesAuthString = conn_auth_datalen; - prefixread = _XSendClientPrefix(dpy, &client, - conn_auth_name, conn_auth_data, - &prefix); - if (prefixread < 0) - { - _XDisconnectDisplay (dpy->trans_conn); - Xfree ((char *)dpy); - return(NULL); - } - if (conn_auth_name) Xfree(conn_auth_name); - if (conn_auth_data) Xfree(conn_auth_data); -/* - * Now see if connection was accepted... - */ - /* these internal functions expect the display to be locked */ - LockDisplay(dpy); - - if (prefixread == 0) - _XRead (dpy, (char *)&prefix,(long)SIZEOF(xConnSetupPrefix)); - - /* an Authenticate reply we weren't expecting? */ - if (prefix.success != xTrue && prefix.success != xFalse) { - fprintf (stderr, - "Xlib: unexpected connection setup reply from server, type %d.\r\n", - prefix.success); - _XDisconnectDisplay (dpy->trans_conn); - Xfree ((char *)dpy); - return(NULL); - } - - if (prefix.majorVersion != X_PROTOCOL) { - /* XXX - printing messages marks a bad programming interface */ -#ifdef NX_TRANS_SOCKET - if (_X11TransSocketProxyConnInfo(dpy->trans_conn) == NULL) { - fprintf (stderr, "Xlib: client uses different protocol version (%d) " - "than server (%d)!\r\n", X_PROTOCOL, prefix.majorVersion); - } -#else - fprintf (stderr, - "Xlib: client uses different protocol version (%d) than server (%d)!\r\n", - X_PROTOCOL, prefix.majorVersion); -#endif - _XDisconnectDisplay (dpy->trans_conn); - Xfree ((char *)dpy); - return(NULL); - } - - setuplength = prefix.length << 2; - if ( (u.setup = (xConnSetup *) - (setup = Xmalloc ((unsigned) setuplength))) == NULL) { - _XDisconnectDisplay (dpy->trans_conn); - Xfree ((char *)dpy); - return(NULL); - } - _XRead (dpy, (char *)u.setup, setuplength); - -/* - * If the connection was not accepted by the server due to problems, - * give error message to the user.... - */ - if (prefix.success != xTrue) { - /* XXX - printing messages marks a bad programming interface */ - fprintf (stderr, - "Xlib: connection to \"%s\" refused by server\r\nXlib: ", - fullname); - - if (prefix.lengthReason > setuplength) { - fprintf (stderr, "Xlib: Broken initial reply: length of reason > length of packet\r\n"); - }else{ - (void) fwrite (u.failure, (Size_t)sizeof(char), - (Size_t)prefix.lengthReason, stderr); - (void) fwrite ("\r\n", sizeof(char), 2, stderr); - } - - OutOfMemory(dpy, setup); - return (NULL); - } - -/* - * Check if the reply was long enough to get any information out of it. - */ - usedbytes = sz_xConnSetup; - if (setuplength < usedbytes ) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory(dpy, setup); - return (NULL); - } - -/* - * We succeeded at authorization, so let us move the data into - * the display structure. - */ - dpy->proto_major_version= prefix.majorVersion; - dpy->proto_minor_version= prefix.minorVersion; - dpy->release = u.setup->release; - dpy->resource_base = u.setup->ridBase; - dpy->resource_mask = u.setup->ridMask; - dpy->min_keycode = u.setup->minKeyCode; - dpy->max_keycode = u.setup->maxKeyCode; - dpy->motion_buffer = u.setup->motionBufferSize; - dpy->nformats = u.setup->numFormats; - dpy->nscreens = u.setup->numRoots; - dpy->byte_order = u.setup->imageByteOrder; - dpy->bitmap_unit = u.setup->bitmapScanlineUnit; - dpy->bitmap_pad = u.setup->bitmapScanlinePad; - dpy->bitmap_bit_order = u.setup->bitmapBitOrder; - dpy->max_request_size = u.setup->maxRequestSize; - mask = dpy->resource_mask; - dpy->resource_shift = 0; - if (!mask) - { - fprintf (stderr, "Xlib: connection to \"%s\" invalid setup\n", - fullname); - OutOfMemory(dpy, setup); - return (NULL); - } - - while (!(mask & 1)) { - dpy->resource_shift++; - mask = mask >> 1; - } - dpy->resource_max = (dpy->resource_mask >> dpy->resource_shift) - 5; -/* - * now extract the vendor string... String must be null terminated, - * padded to multiple of 4 bytes. - */ - /* Check for a sane vendor string length */ - if (u.setup->nbytesVendor > 256) { - OutOfMemory(dpy, setup); - return (NULL); - } - - dpy->vendor = (char *) Xmalloc((unsigned) (u.setup->nbytesVendor + 1)); - if (dpy->vendor == NULL) { - OutOfMemory(dpy, setup); - return (NULL); - } - vendorlen = u.setup->nbytesVendor; - -/* - * validate setup length - */ - usedbytes += (vendorlen + 3) & ~3; - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory(dpy, setup); - return (NULL); - } - - u.setup = (xConnSetup *) (((char *) u.setup) + sz_xConnSetup); - (void) strncpy(dpy->vendor, u.vendor, vendorlen); - dpy->vendor[vendorlen] = '\0'; - vendorlen = (vendorlen + 3) & ~3; /* round up */ - - - memmove (setup, u.vendor + vendorlen, - (int) setuplength - sz_xConnSetup - vendorlen); - u.vendor = setup; -/* - * Now iterate down setup information..... - */ - dpy->pixmap_format = - (ScreenFormat *)Xmalloc( - (unsigned) (dpy->nformats *sizeof(ScreenFormat))); - if (dpy->pixmap_format == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } -/* - * First decode the Z axis Screen format information. - */ - usedbytes += dpy->nformats * sz_xPixmapFormat; - - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory (dpy, setup); - return(NULL); - } - - for (i = 0; i < dpy->nformats; i++) { - register ScreenFormat *fmt = &dpy->pixmap_format[i]; - fmt->depth = u.sf->depth; - fmt->bits_per_pixel = u.sf->bitsPerPixel; - fmt->scanline_pad = u.sf->scanLinePad; - fmt->ext_data = NULL; - u.sf = (xPixmapFormat *) (((char *) u.sf) + sz_xPixmapFormat); - } - -/* - * next the Screen structures. - */ - dpy->screens = - (Screen *)Xmalloc((unsigned) dpy->nscreens*sizeof(Screen)); - if (dpy->screens == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - -/* - * Now go deal with each screen structure. - */ - for (i = 0; i < dpy->nscreens; i++) { - register Screen *sp = &dpy->screens[i]; - VisualID root_visualID; - - usedbytes += sz_xWindowRoot; - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory (dpy, setup); - return(NULL); - } - - root_visualID = u.rp->rootVisualID; - sp->display = dpy; - sp->root = u.rp->windowId; - sp->cmap = u.rp->defaultColormap; - sp->white_pixel = u.rp->whitePixel; - sp->black_pixel = u.rp->blackPixel; - sp->root_input_mask = u.rp->currentInputMask; - sp->width = u.rp->pixWidth; - sp->height = u.rp->pixHeight; - sp->mwidth = u.rp->mmWidth; - sp->mheight = u.rp->mmHeight; - sp->min_maps = u.rp->minInstalledMaps; - sp->max_maps = u.rp->maxInstalledMaps; - sp->backing_store= u.rp->backingStore; - sp->save_unders = u.rp->saveUnders; - sp->root_depth = u.rp->rootDepth; - sp->ndepths = u.rp->nDepths; - sp->ext_data = NULL; - u.rp = (xWindowRoot *) (((char *) u.rp) + sz_xWindowRoot); -/* - * lets set up the depth structures. - */ - sp->depths = (Depth *)Xmalloc( - (unsigned)sp->ndepths*sizeof(Depth)); - if (sp->depths == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - /* - * for all depths on this screen. - */ - for (j = 0; j < sp->ndepths; j++) { - Depth *dp = &sp->depths[j]; - - usedbytes += sz_xDepth; - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory (dpy, setup); - return(NULL); - } - - dp->depth = u.dp->depth; - dp->nvisuals = u.dp->nVisuals; - u.dp = (xDepth *) (((char *) u.dp) + sz_xDepth); - if (dp->nvisuals > 0) { - dp->visuals = - (Visual *)Xmalloc((unsigned)dp->nvisuals*sizeof(Visual)); - if (dp->visuals == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - for (k = 0; k < dp->nvisuals; k++) { - register Visual *vp = &dp->visuals[k]; - - usedbytes += sz_xVisualType; - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory (dpy, setup); - return(NULL); - } - - vp->visualid = u.vp->visualID; - vp->class = u.vp->class; - vp->bits_per_rgb= u.vp->bitsPerRGB; - vp->map_entries = u.vp->colormapEntries; - vp->red_mask = u.vp->redMask; - vp->green_mask = u.vp->greenMask; - vp->blue_mask = u.vp->blueMask; - vp->ext_data = NULL; - u.vp = (xVisualType *) (((char *) u.vp) + - sz_xVisualType); - } - if (dp->depth == 32 && getenv ("XLIB_SKIP_ARGB_VISUALS")) - { - Xfree (dp->visuals); - dp->visuals = NULL; - dp->nvisuals = 0; - } - } else { - dp->visuals = (Visual *) NULL; - } - } - sp->root_visual = _XVIDtoVisual(dpy, root_visualID); - } - - if(usedbytes != setuplength){ - /* Sanity check, shouldn't happen. */ - fprintf(stderr, "Xlib: Did not parse entire setup message: " - "parsed: %ld, message: %ld\n", - usedbytes, setuplength); - OutOfMemory(dpy, setup); - return(NULL); - } - -/* - * Now start talking to the server to setup all other information... - */ - - Xfree (setup); /* all finished with setup information */ - -/* - * Make sure default screen is legal. - */ - if (iscreen >= dpy->nscreens) { - OutOfMemory(dpy, (char *) NULL); - return(NULL); - } - -/* - * finished calling internal routines, now unlock for external routines - */ - UnlockDisplay(dpy); - -/* - * Set up other stuff clients are always going to use. - */ - for (i = 0; i < dpy->nscreens; i++) { - register Screen *sp = &dpy->screens[i]; - XGCValues values; - values.foreground = sp->black_pixel; - values.background = sp->white_pixel; - if ((sp->default_gc = XCreateGC (dpy, sp->root, - GCForeground|GCBackground, - &values)) == NULL) { - OutOfMemory(dpy, (char *) NULL); - return (NULL); - } - } -/* - * call into synchronization routine so that all programs can be - * forced synchronous - */ - (void) XSynchronize(dpy, _Xdebug); - -/* - * get availability of large requests, and - * get the resource manager database off the root window. - */ - LockDisplay(dpy); - { - _XAsyncHandler async; - _XBigReqState async_state; - xQueryExtensionReq *qreq; - xGetPropertyReply reply; - xGetPropertyReq *req; - xBigReqEnableReq *breq; - xBigReqEnableReply brep; - - GetReq(QueryExtension, qreq); - async_state.seq = dpy->request; - async_state.opcode = 0; - async.next = dpy->async_handlers; - async.handler = _XBigReqHandler; - async.data = (XPointer)&async_state; - dpy->async_handlers = &async; - qreq->nbytes = bignamelen; - qreq->length += (bignamelen+3)>>2; - Data(dpy, XBigReqExtensionName, bignamelen); - - GetReq (GetProperty, req); - req->window = RootWindow(dpy, 0); - req->property = XA_RESOURCE_MANAGER; - req->type = XA_STRING; - req->delete = False; - req->longOffset = 0; - req->longLength = 100000000L; - - if (_XReply (dpy, (xReply *) &reply, 0, xFalse)) { - if (reply.format == 8 && reply.propertyType == XA_STRING && - (reply.nItems + 1 > 0) && - (reply.nItems <= req->longLength * 4) && - (dpy->xdefaults = Xmalloc (reply.nItems + 1))) { - _XReadPad (dpy, dpy->xdefaults, reply.nItems); - dpy->xdefaults[reply.nItems] = '\0'; - } - else if (reply.propertyType != None) - _XEatData(dpy, reply.nItems * (reply.format >> 3)); - } - DeqAsyncHandler(dpy, &async); - if (async_state.opcode) { - GetReq(BigReqEnable, breq); - breq->reqType = async_state.opcode; - breq->brReqType = X_BigReqEnable; - if (_XReply(dpy, (xReply *)&brep, 0, xFalse)) - dpy->bigreq_size = brep.max_request_size; - } - } - UnlockDisplay(dpy); - -#ifdef MOTIFBC - { - extern Display *_XHeadOfDisplayList; - _XHeadOfDisplayList = dpy; - } -#endif -#ifdef XKB - XkbUseExtension(dpy,NULL,NULL); -#endif -/* - * and return successfully - */ -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "XOpenDisplay: Returning display at [%p].\n", dpy); -#endif - return(dpy); -} - -static Bool -_XBigReqHandler(dpy, rep, buf, len, data) - register Display *dpy; - register xReply *rep; - char *buf; - int len; - XPointer data; -{ - _XBigReqState *state; - xQueryExtensionReply replbuf; - xQueryExtensionReply *repl; - - state = (_XBigReqState *)data; - if (dpy->last_request_read != state->seq) - return False; - if (rep->generic.type == X_Error) - return True; - repl = (xQueryExtensionReply *) - _XGetAsyncReply(dpy, (char *)&replbuf, rep, buf, len, - (SIZEOF(xQueryExtensionReply) - SIZEOF(xReply)) >> 2, - True); - if (repl->present) - state->opcode = repl->major_opcode; - return True; -} - - -/* XFreeDisplayStructure frees all the storage associated with a - * Display. It is used by XOpenDisplay if it runs out of memory, - * and also by XCloseDisplay. It needs to check whether all pointers - * are non-NULL before dereferencing them, since it may be called - * by XOpenDisplay before the Display structure is fully formed. - * XOpenDisplay must be sure to initialize all the pointers to NULL - * before the first possible call on this. - */ - -void _XFreeDisplayStructure(dpy) - register Display *dpy; -{ - while (dpy->ext_procs) { - _XExtension *ext = dpy->ext_procs; - dpy->ext_procs = ext->next; - if (ext->name) - Xfree (ext->name); - Xfree ((char *)ext); - } - if (dpy->im_filters) - (*dpy->free_funcs->im_filters)(dpy); - if (dpy->cms.clientCmaps) - (*dpy->free_funcs->clientCmaps)(dpy); - if (dpy->cms.defaultCCCs) - (*dpy->free_funcs->defaultCCCs)(dpy); - if (dpy->cms.perVisualIntensityMaps) - (*dpy->free_funcs->intensityMaps)(dpy); - if (dpy->atoms) - (*dpy->free_funcs->atoms)(dpy); - if (dpy->modifiermap) - (*dpy->free_funcs->modifiermap)(dpy->modifiermap); - if (dpy->key_bindings) - (*dpy->free_funcs->key_bindings)(dpy); - if (dpy->context_db) - (*dpy->free_funcs->context_db)(dpy); - if (dpy->xkb_info) - (*dpy->free_funcs->xkb)(dpy); - - /* if RM database was allocated by XGetDefault() free it */ - if (dpy->db && (dpy->flags & XlibDisplayDfltRMDB)) - XrmDestroyDatabase(dpy->db); - - if (dpy->screens) { - register int i; - - for (i = 0; i < dpy->nscreens; i++) { - Screen *sp = &dpy->screens[i]; - - if (sp->depths) { - register int j; - - for (j = 0; j < sp->ndepths; j++) { - Depth *dp = &sp->depths[j]; - - if (dp->visuals) { - register int k; - - for (k = 0; k < dp->nvisuals; k++) - _XFreeExtData (dp->visuals[k].ext_data); - Xfree ((char *) dp->visuals); - } - } - - Xfree ((char *) sp->depths); - } - - _XFreeExtData (sp->ext_data); - } - - Xfree ((char *)dpy->screens); - } - - if (dpy->pixmap_format) { - register int i; - - for (i = 0; i < dpy->nformats; i++) - _XFreeExtData (dpy->pixmap_format[i].ext_data); - Xfree ((char *)dpy->pixmap_format); - } - - if (dpy->display_name) - Xfree (dpy->display_name); - if (dpy->vendor) - Xfree (dpy->vendor); - - if (dpy->buffer) - Xfree (dpy->buffer); - if (dpy->keysyms) - Xfree ((char *) dpy->keysyms); - if (dpy->xdefaults) - Xfree (dpy->xdefaults); - if (dpy->error_vec) - Xfree ((char *)dpy->error_vec); - - _XFreeExtData (dpy->ext_data); - if (dpy->free_funcs) - Xfree ((char *)dpy->free_funcs); - if (dpy->scratch_buffer) - Xfree (dpy->scratch_buffer); - FreeDisplayLock(dpy); - - if (dpy->qfree) { - register _XQEvent *qelt = dpy->qfree; - - while (qelt) { - register _XQEvent *qnxt = qelt->next; - Xfree ((char *) qelt); - qelt = qnxt; - } - } - while (dpy->im_fd_info) { - struct _XConnectionInfo *conni = dpy->im_fd_info; - dpy->im_fd_info = conni->next; - if (conni->watch_data) - Xfree (conni->watch_data); - Xfree (conni); - } - if (dpy->conn_watchers) { - struct _XConnWatchInfo *watcher = dpy->conn_watchers; - dpy->conn_watchers = watcher->next; - Xfree (watcher); - } - if (dpy->filedes) - Xfree (dpy->filedes); - - Xfree ((char *)dpy); -} - -/* OutOfMemory is called if malloc fails. XOpenDisplay returns NULL - after this returns. */ - -static void OutOfMemory (dpy, setup) - Display *dpy; - char *setup; -{ - _XDisconnectDisplay (dpy->trans_conn); - _XFreeDisplayStructure (dpy); - if (setup) Xfree (setup); -} diff --git a/nx-X11/lib/X11/OpenDis.c.X.original b/nx-X11/lib/X11/OpenDis.c.X.original deleted file mode 100644 index 121291b5f..000000000 --- a/nx-X11/lib/X11/OpenDis.c.X.original +++ /dev/null @@ -1,869 +0,0 @@ -/* $Xorg: OpenDis.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ -/* - -Copyright 1985, 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/OpenDis.c,v 3.16 2003/07/04 16:24:23 eich Exp $ */ - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" -#include -#include -#include -#include -#include -#include "Xintconn.h" - -#ifdef XKB -#include "XKBlib.h" -#endif /* XKB */ - -#ifdef X_NOT_POSIX -#define Size_t unsigned int -#else -#define Size_t size_t -#endif - -#define bignamelen (sizeof(XBigReqExtensionName) - 1) - -typedef struct { - unsigned long seq; - int opcode; -} _XBigReqState; - -#ifdef XTHREADS -#include "locking.h" -int (*_XInitDisplayLock_fn)(Display *dpy) = NULL; -void (*_XFreeDisplayLock_fn)(Display *dpy) = NULL; - -#define InitDisplayLock(d) (_XInitDisplayLock_fn ? (*_XInitDisplayLock_fn)(d) : Success) -#define FreeDisplayLock(d) if (_XFreeDisplayLock_fn) (*_XFreeDisplayLock_fn)(d) -#else -#define InitDisplayLock(dis) Success -#define FreeDisplayLock(dis) -#endif /* XTHREADS */ - -static xReq _dummy_request = { - 0, 0, 0 -}; - -static void OutOfMemory(Display *dpy, char *setup); -static Bool _XBigReqHandler(Display *dpy, xReply *rep, char *buf, int len, - XPointer data); - -/* - * Connects to a server, creates a Display object and returns a pointer to - * the newly created Display back to the caller. - */ -Display * -XOpenDisplay ( - register _Xconst char *display) -{ - register Display *dpy; /* New Display object being created. */ - register int i; - int j, k; /* random iterator indexes */ - char *display_name; /* pointer to display name */ - int endian; /* to determine which endian. */ - xConnClientPrefix client; /* client information */ - xConnSetupPrefix prefix; /* prefix information */ - int vendorlen; /* length of vendor string */ - char *setup = NULL; /* memory allocated at startup */ - char *fullname = NULL; /* expanded name of display */ - int idisplay; /* display number */ - int iscreen; /* screen number */ - int prefixread = 0; /* setup prefix already read? */ - union { - xConnSetup *setup; - char *failure; - char *vendor; - xPixmapFormat *sf; - xWindowRoot *rp; - xDepth *dp; - xVisualType *vp; - } u; /* proto data returned from server */ - long setuplength; /* number of bytes in setup message */ - long usedbytes = 0; /* number of bytes we have processed */ - char *conn_auth_name, *conn_auth_data; - int conn_auth_namelen, conn_auth_datalen; - unsigned long mask; - long int conn_buf_size; - char *xlib_buffer_size; - - bzero((char *) &client, sizeof(client)); - bzero((char *) &prefix, sizeof(prefix)); - - /* - * If the display specifier string supplied as an argument to this - * routine is NULL or a pointer to NULL, read the DISPLAY variable. - */ - if (display == NULL || *display == '\0') { - if ((display_name = getenv("DISPLAY")) == NULL) { - /* Oops! No DISPLAY environment variable - error. */ - return(NULL); - } - } - else { - /* Display is non-NULL, copy the pointer */ - display_name = (char *)display; - } -/* - * Set the default error handlers. This allows the global variables to - * default to NULL for use with shared libraries. - */ - if (_XErrorFunction == NULL) (void) XSetErrorHandler (NULL); - if (_XIOErrorFunction == NULL) (void) XSetIOErrorHandler (NULL); - -/* - * Attempt to allocate a display structure. Return NULL if allocation fails. - */ - if ((dpy = (Display *)Xcalloc(1, sizeof(Display))) == NULL) { - return(NULL); - } - -/* - * Call the Connect routine to get the transport connection object. - * If NULL is returned, the connection failed. The connect routine - * will set fullname to point to the expanded name. - */ - - if ((dpy->trans_conn = _X11TransConnectDisplay ( - display_name, &fullname, &idisplay, - &iscreen, &conn_auth_name, - &conn_auth_namelen, &conn_auth_data, - &conn_auth_datalen)) == NULL) { - Xfree ((char *) dpy); - return(NULL); - } - - dpy->fd = _X11TransGetConnectionNumber (dpy->trans_conn); - - /* Initialize as much of the display structure as we can. - * Initialize pointers to NULL so that XFreeDisplayStructure will - * work if we run out of memory before we finish initializing. - */ - dpy->display_name = fullname; - dpy->keysyms = (KeySym *) NULL; - dpy->modifiermap = NULL; - dpy->lock_meaning = NoSymbol; - dpy->keysyms_per_keycode = 0; - dpy->xdefaults = (char *)NULL; - dpy->scratch_length = 0L; - dpy->scratch_buffer = NULL; - dpy->key_bindings = NULL; - dpy->ext_procs = (_XExtension *)NULL; - dpy->ext_data = (XExtData *)NULL; - dpy->ext_number = 0; - dpy->event_vec[X_Error] = _XUnknownWireEvent; - dpy->event_vec[X_Reply] = _XUnknownWireEvent; - dpy->wire_vec[X_Error] = _XUnknownNativeEvent; - dpy->wire_vec[X_Reply] = _XUnknownNativeEvent; - for (i = KeyPress; i < LASTEvent; i++) { - dpy->event_vec[i] = _XWireToEvent; - dpy->wire_vec[i] = NULL; - } - for (i = LASTEvent; i < 128; i++) { - dpy->event_vec[i] = _XUnknownWireEvent; - dpy->wire_vec[i] = _XUnknownNativeEvent; - } - dpy->resource_id = 0; - dpy->db = (struct _XrmHashBucketRec *)NULL; - dpy->cursor_font = None; - dpy->flags = 0; - dpy->async_handlers = NULL; - dpy->screens = NULL; - dpy->vendor = NULL; - dpy->buffer = NULL; - dpy->atoms = NULL; - dpy->error_vec = NULL; - dpy->context_db = NULL; - dpy->free_funcs = NULL; - dpy->pixmap_format = NULL; - dpy->cms.clientCmaps = NULL; - dpy->cms.defaultCCCs = NULL; - dpy->cms.perVisualIntensityMaps = NULL; - dpy->im_filters = NULL; - dpy->bigreq_size = 0; - dpy->lock = NULL; - dpy->lock_fns = NULL; - dpy->qfree = NULL; - dpy->next_event_serial_num = 1; - dpy->im_fd_info = NULL; - dpy->im_fd_length = 0; - dpy->conn_watchers = NULL; - dpy->watcher_count = 0; - dpy->filedes = NULL; - dpy->flushes = NULL; - dpy->xcmisc_opcode = 0; - dpy->xkb_info = NULL; - -/* - * Setup other information in this display structure. - */ - dpy->vnumber = X_PROTOCOL; - dpy->resource_alloc = _XAllocID; - dpy->idlist_alloc = _XAllocIDs; - dpy->synchandler = NULL; - dpy->savedsynchandler = NULL; - dpy->request = 0; - dpy->last_request_read = 0; - dpy->default_screen = iscreen; /* Value returned by ConnectDisplay */ - dpy->last_req = (char *)&_dummy_request; - - /* Initialize the display lock */ - if (InitDisplayLock(dpy) != 0) { - OutOfMemory (dpy, setup); - return(NULL); - } - - if (!_XPollfdCacheInit(dpy)) { - OutOfMemory (dpy, setup); - return(NULL); - } - - /* Set up the output buffers. */ -#ifndef XLIBDEFAULTBUFSIZE -#define XLIBDEFAULTBUFSIZE 16384 /* 16k */ -#endif -#ifndef XLIBMINBUFSIZE -#define XLIBMINBUFSIZE BUFSIZE /* old default buffer size */ -#endif - if ((xlib_buffer_size = getenv("XLIBBUFFERSIZE")) == NULL) - conn_buf_size = XLIBDEFAULTBUFSIZE; - else - conn_buf_size = 1024 * strtol(xlib_buffer_size, NULL, 10); - if (conn_buf_size < XLIBMINBUFSIZE) - conn_buf_size = XLIBMINBUFSIZE; - - if ((dpy->bufptr = dpy->buffer = Xcalloc(1, conn_buf_size)) == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - dpy->bufmax = dpy->buffer + conn_buf_size; - - /* Set up the input event queue and input event queue parameters. */ - dpy->head = dpy->tail = NULL; - dpy->qlen = 0; - - /* Set up free-function record */ - if ((dpy->free_funcs = (_XFreeFuncRec *)Xcalloc(1, - sizeof(_XFreeFuncRec))) - == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - -/* - * The xConnClientPrefix describes the initial connection setup information - * and is followed by the authorization information. Sites that are interested - * in security are strongly encouraged to use an authentication and - * authorization system such as Kerberos. - */ - endian = 1; - if (*(char *) &endian) - client.byteOrder = '\154'; /* 'l' */ - else - client.byteOrder = '\102'; /* 'B' */ - client.majorVersion = X_PROTOCOL; - client.minorVersion = X_PROTOCOL_REVISION; - client.nbytesAuthProto = conn_auth_namelen; - client.nbytesAuthString = conn_auth_datalen; - prefixread = _XSendClientPrefix(dpy, &client, - conn_auth_name, conn_auth_data, - &prefix); - if (prefixread < 0) - { - _XDisconnectDisplay (dpy->trans_conn); - Xfree ((char *)dpy); - return(NULL); - } - if (conn_auth_name) Xfree(conn_auth_name); - if (conn_auth_data) Xfree(conn_auth_data); -/* - * Now see if connection was accepted... - */ - /* these internal functions expect the display to be locked */ - LockDisplay(dpy); - - if (prefixread == 0) - _XRead (dpy, (char *)&prefix,(long)SIZEOF(xConnSetupPrefix)); - - /* an Authenticate reply we weren't expecting? */ - if (prefix.success != xTrue && prefix.success != xFalse) { - fprintf (stderr, - "Xlib: unexpected connection setup reply from server, type %d.\r\n", - prefix.success); - _XDisconnectDisplay (dpy->trans_conn); - Xfree ((char *)dpy); - return(NULL); - } - - if (prefix.majorVersion != X_PROTOCOL) { - /* XXX - printing messages marks a bad programming interface */ - fprintf (stderr, - "Xlib: client uses different protocol version (%d) than server (%d)!\r\n", - X_PROTOCOL, prefix.majorVersion); - _XDisconnectDisplay (dpy->trans_conn); - Xfree ((char *)dpy); - return(NULL); - } - - setuplength = prefix.length << 2; - if ( (u.setup = (xConnSetup *) - (setup = Xmalloc ((unsigned) setuplength))) == NULL) { - _XDisconnectDisplay (dpy->trans_conn); - Xfree ((char *)dpy); - return(NULL); - } - _XRead (dpy, (char *)u.setup, setuplength); - -/* - * If the connection was not accepted by the server due to problems, - * give error message to the user.... - */ - if (prefix.success != xTrue) { - /* XXX - printing messages marks a bad programming interface */ - fprintf (stderr, - "Xlib: connection to \"%s\" refused by server\r\nXlib: ", - fullname); - - if (prefix.lengthReason > setuplength) { - fprintf (stderr, "Xlib: Broken initial reply: length of reason > length of packet\r\n"); - }else{ - (void) fwrite (u.failure, (Size_t)sizeof(char), - (Size_t)prefix.lengthReason, stderr); - (void) fwrite ("\r\n", sizeof(char), 2, stderr); - } - - OutOfMemory(dpy, setup); - return (NULL); - } - -/* - * Check if the reply was long enough to get any information out of it. - */ - usedbytes = sz_xConnSetup; - if (setuplength < usedbytes ) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory(dpy, setup); - return (NULL); - } - -/* - * We succeeded at authorization, so let us move the data into - * the display structure. - */ - dpy->proto_major_version= prefix.majorVersion; - dpy->proto_minor_version= prefix.minorVersion; - dpy->release = u.setup->release; - dpy->resource_base = u.setup->ridBase; - dpy->resource_mask = u.setup->ridMask; - dpy->min_keycode = u.setup->minKeyCode; - dpy->max_keycode = u.setup->maxKeyCode; - dpy->motion_buffer = u.setup->motionBufferSize; - dpy->nformats = u.setup->numFormats; - dpy->nscreens = u.setup->numRoots; - dpy->byte_order = u.setup->imageByteOrder; - dpy->bitmap_unit = u.setup->bitmapScanlineUnit; - dpy->bitmap_pad = u.setup->bitmapScanlinePad; - dpy->bitmap_bit_order = u.setup->bitmapBitOrder; - dpy->max_request_size = u.setup->maxRequestSize; - mask = dpy->resource_mask; - dpy->resource_shift = 0; - if (!mask) - { - fprintf (stderr, "Xlib: connection to \"%s\" invalid setup\n", - fullname); - OutOfMemory(dpy, setup); - return (NULL); - } - - while (!(mask & 1)) { - dpy->resource_shift++; - mask = mask >> 1; - } - dpy->resource_max = (dpy->resource_mask >> dpy->resource_shift) - 5; -/* - * now extract the vendor string... String must be null terminated, - * padded to multiple of 4 bytes. - */ - /* Check for a sane vendor string length */ - if (u.setup->nbytesVendor > 256) { - OutOfMemory(dpy, setup); - return (NULL); - } - - dpy->vendor = (char *) Xmalloc((unsigned) (u.setup->nbytesVendor + 1)); - if (dpy->vendor == NULL) { - OutOfMemory(dpy, setup); - return (NULL); - } - vendorlen = u.setup->nbytesVendor; - -/* - * validate setup length - */ - usedbytes += (vendorlen + 3) & ~3; - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory(dpy, setup); - return (NULL); - } - - u.setup = (xConnSetup *) (((char *) u.setup) + sz_xConnSetup); - (void) strncpy(dpy->vendor, u.vendor, vendorlen); - dpy->vendor[vendorlen] = '\0'; - vendorlen = (vendorlen + 3) & ~3; /* round up */ - - - memmove (setup, u.vendor + vendorlen, - (int) setuplength - sz_xConnSetup - vendorlen); - u.vendor = setup; -/* - * Now iterate down setup information..... - */ - dpy->pixmap_format = - (ScreenFormat *)Xmalloc( - (unsigned) (dpy->nformats *sizeof(ScreenFormat))); - if (dpy->pixmap_format == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } -/* - * First decode the Z axis Screen format information. - */ - usedbytes += dpy->nformats * sz_xPixmapFormat; - - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory (dpy, setup); - return(NULL); - } - - for (i = 0; i < dpy->nformats; i++) { - register ScreenFormat *fmt = &dpy->pixmap_format[i]; - fmt->depth = u.sf->depth; - fmt->bits_per_pixel = u.sf->bitsPerPixel; - fmt->scanline_pad = u.sf->scanLinePad; - fmt->ext_data = NULL; - u.sf = (xPixmapFormat *) (((char *) u.sf) + sz_xPixmapFormat); - } - -/* - * next the Screen structures. - */ - dpy->screens = - (Screen *)Xmalloc((unsigned) dpy->nscreens*sizeof(Screen)); - if (dpy->screens == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - -/* - * Now go deal with each screen structure. - */ - for (i = 0; i < dpy->nscreens; i++) { - register Screen *sp = &dpy->screens[i]; - VisualID root_visualID; - - usedbytes += sz_xWindowRoot; - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory (dpy, setup); - return(NULL); - } - - root_visualID = u.rp->rootVisualID; - sp->display = dpy; - sp->root = u.rp->windowId; - sp->cmap = u.rp->defaultColormap; - sp->white_pixel = u.rp->whitePixel; - sp->black_pixel = u.rp->blackPixel; - sp->root_input_mask = u.rp->currentInputMask; - sp->width = u.rp->pixWidth; - sp->height = u.rp->pixHeight; - sp->mwidth = u.rp->mmWidth; - sp->mheight = u.rp->mmHeight; - sp->min_maps = u.rp->minInstalledMaps; - sp->max_maps = u.rp->maxInstalledMaps; - sp->backing_store= u.rp->backingStore; - sp->save_unders = u.rp->saveUnders; - sp->root_depth = u.rp->rootDepth; - sp->ndepths = u.rp->nDepths; - sp->ext_data = NULL; - u.rp = (xWindowRoot *) (((char *) u.rp) + sz_xWindowRoot); -/* - * lets set up the depth structures. - */ - sp->depths = (Depth *)Xmalloc( - (unsigned)sp->ndepths*sizeof(Depth)); - if (sp->depths == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - /* - * for all depths on this screen. - */ - for (j = 0; j < sp->ndepths; j++) { - Depth *dp = &sp->depths[j]; - - usedbytes += sz_xDepth; - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory (dpy, setup); - return(NULL); - } - - dp->depth = u.dp->depth; - dp->nvisuals = u.dp->nVisuals; - u.dp = (xDepth *) (((char *) u.dp) + sz_xDepth); - if (dp->nvisuals > 0) { - dp->visuals = - (Visual *)Xmalloc((unsigned)dp->nvisuals*sizeof(Visual)); - if (dp->visuals == NULL) { - OutOfMemory (dpy, setup); - return(NULL); - } - for (k = 0; k < dp->nvisuals; k++) { - register Visual *vp = &dp->visuals[k]; - - usedbytes += sz_xVisualType; - if (setuplength < usedbytes) { - fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength); - OutOfMemory (dpy, setup); - return(NULL); - } - - vp->visualid = u.vp->visualID; - vp->class = u.vp->class; - vp->bits_per_rgb= u.vp->bitsPerRGB; - vp->map_entries = u.vp->colormapEntries; - vp->red_mask = u.vp->redMask; - vp->green_mask = u.vp->greenMask; - vp->blue_mask = u.vp->blueMask; - vp->ext_data = NULL; - u.vp = (xVisualType *) (((char *) u.vp) + - sz_xVisualType); - } - if (dp->depth == 32 && getenv ("XLIB_SKIP_ARGB_VISUALS")) - { - Xfree (dp->visuals); - dp->visuals = NULL; - dp->nvisuals = 0; - } - } else { - dp->visuals = (Visual *) NULL; - } - } - sp->root_visual = _XVIDtoVisual(dpy, root_visualID); - } - - if(usedbytes != setuplength){ - /* Sanity check, shouldn't happen. */ - fprintf(stderr, "Xlib: Did not parse entire setup message: " - "parsed: %ld, message: %ld\n", - usedbytes, setuplength); - OutOfMemory(dpy, setup); - return(NULL); - } - -/* - * Now start talking to the server to setup all other information... - */ - - Xfree (setup); /* all finished with setup information */ - -/* - * Make sure default screen is legal. - */ - if (iscreen >= dpy->nscreens) { - OutOfMemory(dpy, (char *) NULL); - return(NULL); - } - -/* - * finished calling internal routines, now unlock for external routines - */ - UnlockDisplay(dpy); - -/* - * Set up other stuff clients are always going to use. - */ - for (i = 0; i < dpy->nscreens; i++) { - register Screen *sp = &dpy->screens[i]; - XGCValues values; - values.foreground = sp->black_pixel; - values.background = sp->white_pixel; - if ((sp->default_gc = XCreateGC (dpy, sp->root, - GCForeground|GCBackground, - &values)) == NULL) { - OutOfMemory(dpy, (char *) NULL); - return (NULL); - } - } -/* - * call into synchronization routine so that all programs can be - * forced synchronous - */ - (void) XSynchronize(dpy, _Xdebug); - -/* - * get availability of large requests, and - * get the resource manager database off the root window. - */ - LockDisplay(dpy); - { - _XAsyncHandler async; - _XBigReqState async_state; - xQueryExtensionReq *qreq; - xGetPropertyReply reply; - xGetPropertyReq *req; - xBigReqEnableReq *breq; - xBigReqEnableReply brep; - - GetReq(QueryExtension, qreq); - async_state.seq = dpy->request; - async_state.opcode = 0; - async.next = dpy->async_handlers; - async.handler = _XBigReqHandler; - async.data = (XPointer)&async_state; - dpy->async_handlers = &async; - qreq->nbytes = bignamelen; - qreq->length += (bignamelen+3)>>2; - Data(dpy, XBigReqExtensionName, bignamelen); - - GetReq (GetProperty, req); - req->window = RootWindow(dpy, 0); - req->property = XA_RESOURCE_MANAGER; - req->type = XA_STRING; - req->delete = False; - req->longOffset = 0; - req->longLength = 100000000L; - - if (_XReply (dpy, (xReply *) &reply, 0, xFalse)) { - if (reply.format == 8 && reply.propertyType == XA_STRING && - (reply.nItems + 1 > 0) && - (reply.nItems <= req->longLength * 4) && - (dpy->xdefaults = Xmalloc (reply.nItems + 1))) { - _XReadPad (dpy, dpy->xdefaults, reply.nItems); - dpy->xdefaults[reply.nItems] = '\0'; - } - else if (reply.propertyType != None) - _XEatData(dpy, reply.nItems * (reply.format >> 3)); - } - DeqAsyncHandler(dpy, &async); - if (async_state.opcode) { - GetReq(BigReqEnable, breq); - breq->reqType = async_state.opcode; - breq->brReqType = X_BigReqEnable; - if (_XReply(dpy, (xReply *)&brep, 0, xFalse)) - dpy->bigreq_size = brep.max_request_size; - } - } - UnlockDisplay(dpy); - -#ifdef MOTIFBC - { - extern Display *_XHeadOfDisplayList; - _XHeadOfDisplayList = dpy; - } -#endif -#ifdef XKB - XkbUseExtension(dpy,NULL,NULL); -#endif -/* - * and return successfully - */ - return(dpy); -} - -static Bool -_XBigReqHandler(dpy, rep, buf, len, data) - register Display *dpy; - register xReply *rep; - char *buf; - int len; - XPointer data; -{ - _XBigReqState *state; - xQueryExtensionReply replbuf; - xQueryExtensionReply *repl; - - state = (_XBigReqState *)data; - if (dpy->last_request_read != state->seq) - return False; - if (rep->generic.type == X_Error) - return True; - repl = (xQueryExtensionReply *) - _XGetAsyncReply(dpy, (char *)&replbuf, rep, buf, len, - (SIZEOF(xQueryExtensionReply) - SIZEOF(xReply)) >> 2, - True); - if (repl->present) - state->opcode = repl->major_opcode; - return True; -} - - -/* XFreeDisplayStructure frees all the storage associated with a - * Display. It is used by XOpenDisplay if it runs out of memory, - * and also by XCloseDisplay. It needs to check whether all pointers - * are non-NULL before dereferencing them, since it may be called - * by XOpenDisplay before the Display structure is fully formed. - * XOpenDisplay must be sure to initialize all the pointers to NULL - * before the first possible call on this. - */ - -void _XFreeDisplayStructure(dpy) - register Display *dpy; -{ - while (dpy->ext_procs) { - _XExtension *ext = dpy->ext_procs; - dpy->ext_procs = ext->next; - if (ext->name) - Xfree (ext->name); - Xfree ((char *)ext); - } - if (dpy->im_filters) - (*dpy->free_funcs->im_filters)(dpy); - if (dpy->cms.clientCmaps) - (*dpy->free_funcs->clientCmaps)(dpy); - if (dpy->cms.defaultCCCs) - (*dpy->free_funcs->defaultCCCs)(dpy); - if (dpy->cms.perVisualIntensityMaps) - (*dpy->free_funcs->intensityMaps)(dpy); - if (dpy->atoms) - (*dpy->free_funcs->atoms)(dpy); - if (dpy->modifiermap) - (*dpy->free_funcs->modifiermap)(dpy->modifiermap); - if (dpy->key_bindings) - (*dpy->free_funcs->key_bindings)(dpy); - if (dpy->context_db) - (*dpy->free_funcs->context_db)(dpy); - if (dpy->xkb_info) - (*dpy->free_funcs->xkb)(dpy); - - /* if RM database was allocated by XGetDefault() free it */ - if (dpy->db && (dpy->flags & XlibDisplayDfltRMDB)) - XrmDestroyDatabase(dpy->db); - - if (dpy->screens) { - register int i; - - for (i = 0; i < dpy->nscreens; i++) { - Screen *sp = &dpy->screens[i]; - - if (sp->depths) { - register int j; - - for (j = 0; j < sp->ndepths; j++) { - Depth *dp = &sp->depths[j]; - - if (dp->visuals) { - register int k; - - for (k = 0; k < dp->nvisuals; k++) - _XFreeExtData (dp->visuals[k].ext_data); - Xfree ((char *) dp->visuals); - } - } - - Xfree ((char *) sp->depths); - } - - _XFreeExtData (sp->ext_data); - } - - Xfree ((char *)dpy->screens); - } - - if (dpy->pixmap_format) { - register int i; - - for (i = 0; i < dpy->nformats; i++) - _XFreeExtData (dpy->pixmap_format[i].ext_data); - Xfree ((char *)dpy->pixmap_format); - } - - if (dpy->display_name) - Xfree (dpy->display_name); - if (dpy->vendor) - Xfree (dpy->vendor); - - if (dpy->buffer) - Xfree (dpy->buffer); - if (dpy->keysyms) - Xfree ((char *) dpy->keysyms); - if (dpy->xdefaults) - Xfree (dpy->xdefaults); - if (dpy->error_vec) - Xfree ((char *)dpy->error_vec); - - _XFreeExtData (dpy->ext_data); - if (dpy->free_funcs) - Xfree ((char *)dpy->free_funcs); - if (dpy->scratch_buffer) - Xfree (dpy->scratch_buffer); - FreeDisplayLock(dpy); - - if (dpy->qfree) { - register _XQEvent *qelt = dpy->qfree; - - while (qelt) { - register _XQEvent *qnxt = qelt->next; - Xfree ((char *) qelt); - qelt = qnxt; - } - } - while (dpy->im_fd_info) { - struct _XConnectionInfo *conni = dpy->im_fd_info; - dpy->im_fd_info = conni->next; - if (conni->watch_data) - Xfree (conni->watch_data); - Xfree (conni); - } - if (dpy->conn_watchers) { - struct _XConnWatchInfo *watcher = dpy->conn_watchers; - dpy->conn_watchers = watcher->next; - Xfree (watcher); - } - if (dpy->filedes) - Xfree (dpy->filedes); - - Xfree ((char *)dpy); -} - -/* OutOfMemory is called if malloc fails. XOpenDisplay returns NULL - after this returns. */ - -static void OutOfMemory (dpy, setup) - Display *dpy; - char *setup; -{ - _XDisconnectDisplay (dpy->trans_conn); - _XFreeDisplayStructure (dpy); - if (setup) Xfree (setup); -} diff --git a/nx-X11/lib/X11/PeekIfEv.c.NX.original b/nx-X11/lib/X11/PeekIfEv.c.NX.original deleted file mode 100644 index a8da27932..000000000 --- a/nx-X11/lib/X11/PeekIfEv.c.NX.original +++ /dev/null @@ -1,81 +0,0 @@ -/* $Xorg: PeekIfEv.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ -/* - -Copyright 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/PeekIfEv.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */ - -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -/* - * return the next event in the queue that satisfies the predicate. - * BUT do not remove it from the queue. - * If none found, flush, and then wait until one satisfies the predicate. - */ - -int -XPeekIfEvent (dpy, event, predicate, arg) - register Display *dpy; - register XEvent *event; - Bool (*predicate)( - Display* /* display */, - XEvent* /* event */, - char* /* arg */ - ); - char *arg; -{ - register _XQEvent *prev, *qelt; - unsigned long qe_serial = 0; - - LockDisplay(dpy); - prev = NULL; - while (1) { - for (qelt = prev ? prev->next : dpy->head; - qelt; - prev = qelt, qelt = qelt->next) { - if(qelt->qserial_num > qe_serial - && (*predicate)(dpy, &qelt->event, arg)) { - *event = qelt->event; - UnlockDisplay(dpy); - return 0; - } - } - if (prev) - qe_serial = prev->qserial_num; - _XReadEvents(dpy); - if (prev && prev->qserial_num != qe_serial) - /* another thread has snatched this event */ - prev = NULL; -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - return 0; - } -#endif - } -} - diff --git a/nx-X11/lib/X11/PeekIfEv.c.X.original b/nx-X11/lib/X11/PeekIfEv.c.X.original deleted file mode 100644 index beb991a07..000000000 --- a/nx-X11/lib/X11/PeekIfEv.c.X.original +++ /dev/null @@ -1,76 +0,0 @@ -/* $Xorg: PeekIfEv.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ -/* - -Copyright 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/PeekIfEv.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */ - -#define NEED_EVENTS -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -/* - * return the next event in the queue that satisfies the predicate. - * BUT do not remove it from the queue. - * If none found, flush, and then wait until one satisfies the predicate. - */ - -int -XPeekIfEvent (dpy, event, predicate, arg) - register Display *dpy; - register XEvent *event; - Bool (*predicate)( - Display* /* display */, - XEvent* /* event */, - char* /* arg */ - ); - char *arg; -{ - register _XQEvent *prev, *qelt; - unsigned long qe_serial = 0; - - LockDisplay(dpy); - prev = NULL; - while (1) { - for (qelt = prev ? prev->next : dpy->head; - qelt; - prev = qelt, qelt = qelt->next) { - if(qelt->qserial_num > qe_serial - && (*predicate)(dpy, &qelt->event, arg)) { - *event = qelt->event; - UnlockDisplay(dpy); - return 0; - } - } - if (prev) - qe_serial = prev->qserial_num; - _XReadEvents(dpy); - if (prev && prev->qserial_num != qe_serial) - /* another thread has snatched this event */ - prev = NULL; - } -} - diff --git a/nx-X11/lib/X11/Pending.c.NX.original b/nx-X11/lib/X11/Pending.c.NX.original deleted file mode 100644 index 34e7cf6ca..000000000 --- a/nx-X11/lib/X11/Pending.c.NX.original +++ /dev/null @@ -1,69 +0,0 @@ -/* $Xorg: Pending.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ -/* - -Copyright 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -#include - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -/* Read in pending events if needed and return the number of queued events. */ - -int XEventsQueued (dpy, mode) - register Display *dpy; - int mode; -{ - int ret_val; -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "\nXEventsQueued: Called with a display at [%p].\n", dpy); -#endif - - LockDisplay(dpy); - if (dpy->qlen || (mode == QueuedAlready)) - ret_val = dpy->qlen; - else - ret_val = _XEventsQueued (dpy, mode); -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "\nXEventsQueued: Going to unlock the display at [%p].\n", dpy); -#endif - UnlockDisplay(dpy); - return ret_val; -} - -int XPending (dpy) - register Display *dpy; -{ - int ret_val; - LockDisplay(dpy); - if (dpy->qlen) - ret_val = dpy->qlen; - else - ret_val = _XEventsQueued (dpy, QueuedAfterFlush); - UnlockDisplay(dpy); - return ret_val; -} diff --git a/nx-X11/lib/X11/Pending.c.X.original b/nx-X11/lib/X11/Pending.c.X.original deleted file mode 100644 index 480ec6cf0..000000000 --- a/nx-X11/lib/X11/Pending.c.X.original +++ /dev/null @@ -1,60 +0,0 @@ -/* $Xorg: Pending.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ -/* - -Copyright 1986, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" - -/* Read in pending events if needed and return the number of queued events. */ - -int XEventsQueued (dpy, mode) - register Display *dpy; - int mode; -{ - int ret_val; - LockDisplay(dpy); - if (dpy->qlen || (mode == QueuedAlready)) - ret_val = dpy->qlen; - else - ret_val = _XEventsQueued (dpy, mode); - UnlockDisplay(dpy); - return ret_val; -} - -int XPending (dpy) - register Display *dpy; -{ - int ret_val; - LockDisplay(dpy); - if (dpy->qlen) - ret_val = dpy->qlen; - else - ret_val = _XEventsQueued (dpy, QueuedAfterFlush); - UnlockDisplay(dpy); - return ret_val; -} diff --git a/nx-X11/lib/X11/XKBMAlloc.c.NX.original b/nx-X11/lib/X11/XKBMAlloc.c.NX.original deleted file mode 100644 index d57d9a58d..000000000 --- a/nx-X11/lib/X11/XKBMAlloc.c.NX.original +++ /dev/null @@ -1,1023 +0,0 @@ -/* $Xorg: XKBMAlloc.c,v 1.4 2000/08/17 19:45:02 cpqbld Exp $ */ -/************************************************************ -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. - -********************************************************/ -/* $XFree86: xc/lib/X11/XKBMAlloc.c,v 3.11 2001/01/17 19:41:48 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#elif defined(HAVE_CONFIG_H) -#include -#endif - -#ifndef XKB_IN_SERVER - -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include "Xlibint.h" -#include -#include -#include "XKBlibint.h" - -#else - -#include -#include -#define NEED_EVENTS -#define NEED_REPLIES -#include -#include "misc.h" -#include "inputstr.h" -#include -#define XKBSRV_NEED_FILE_FUNCS -#include - -#endif /* XKB_IN_SERVER */ - -/***====================================================================***/ - -Status -XkbAllocClientMap(XkbDescPtr xkb,unsigned which,unsigned nTotalTypes) -{ -register int i; -XkbClientMapPtr map; - - if ((xkb==NULL)||((nTotalTypes>0)&&(nTotalTypesmin_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code))) { -#ifdef DEBUG -fprintf(stderr,"bad keycode (%d,%d) in XkbAllocClientMap\n", - xkb->min_key_code,xkb->max_key_code); -#endif - return BadValue; - } - - if (xkb->map==NULL) { - map= _XkbTypedCalloc(1,XkbClientMapRec); - if (map==NULL) - return BadAlloc; - xkb->map= map; - } - else map= xkb->map; - - if ((which&XkbKeyTypesMask)&&(nTotalTypes>0)) { - if (map->types==NULL) { - map->types= _XkbTypedCalloc(nTotalTypes,XkbKeyTypeRec); - if (map->types==NULL) - return BadAlloc; - map->num_types= 0; - map->size_types= nTotalTypes; - } - else if (map->size_typestypes; - - map->types= _XkbTypedRealloc(map->types,nTotalTypes,XkbKeyTypeRec); - if (map->types==NULL) { - _XkbFree(prev_types); - map->num_types= map->size_types= 0; - return BadAlloc; - } - map->size_types= nTotalTypes; - bzero(&map->types[map->num_types], - ((map->size_types-map->num_types)*sizeof(XkbKeyTypeRec))); - } - } - if (which&XkbKeySymsMask) { - int nKeys= XkbNumKeys(xkb); - if (map->syms==NULL) { - map->size_syms= (nKeys*15)/10; - map->syms= _XkbTypedCalloc(map->size_syms,KeySym); - if (!map->syms) { - map->size_syms= 0; - return BadAlloc; - } - map->num_syms= 1; - map->syms[0]= NoSymbol; - } - if (map->key_sym_map==NULL) { - i= xkb->max_key_code+1; - map->key_sym_map= _XkbTypedCalloc(i,XkbSymMapRec); - if (map->key_sym_map==NULL) - return BadAlloc; - } - } - if (which&XkbModifierMapMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (map->modmap==NULL) { - i= xkb->max_key_code+1; - map->modmap= _XkbTypedCalloc(i,unsigned char); - if (map->modmap==NULL) - return BadAlloc; - } - } - return Success; -} - -Status -XkbAllocServerMap(XkbDescPtr xkb,unsigned which,unsigned nNewActions) -{ -register int i; -XkbServerMapPtr map; - - if (xkb==NULL) - return BadMatch; - if (xkb->server==NULL) { - map= _XkbTypedCalloc(1,XkbServerMapRec); - if (map==NULL) - return BadAlloc; - for (i=0;ivmods[i]= XkbNoModifierMask; - } - xkb->server= map; - } - else map= xkb->server; - if (which&XkbExplicitComponentsMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (map->explicit==NULL) { - i= xkb->max_key_code+1; - map->explicit= _XkbTypedCalloc(i,unsigned char); - if (map->explicit==NULL) - return BadAlloc; - } - } - if (which&XkbKeyActionsMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (nNewActions<1) - nNewActions= 1; - if (map->acts==NULL) { - map->acts= _XkbTypedCalloc((nNewActions+1),XkbAction); - if (map->acts==NULL) - return BadAlloc; - map->num_acts= 1; - map->size_acts= nNewActions+1; - } - else if ((map->size_acts-map->num_acts)acts; - need= map->num_acts+nNewActions; - map->acts= _XkbTypedRealloc(map->acts,need,XkbAction); - if (map->acts==NULL) { - _XkbFree(prev_acts); - map->num_acts= map->size_acts= 0; - return BadAlloc; - } - map->size_acts= need; - bzero(&map->acts[map->num_acts], - ((map->size_acts-map->num_acts)*sizeof(XkbAction))); - } - if (map->key_acts==NULL) { - i= xkb->max_key_code+1; - map->key_acts= _XkbTypedCalloc(i,unsigned short); - if (map->key_acts==NULL) - return BadAlloc; - } - } - if (which&XkbKeyBehaviorsMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (map->behaviors==NULL) { - i= xkb->max_key_code+1; - map->behaviors= _XkbTypedCalloc(i,XkbBehavior); - if (map->behaviors==NULL) - return BadAlloc; - } - } - if (which&XkbVirtualModMapMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (map->vmodmap==NULL) { - i= xkb->max_key_code+1; - map->vmodmap= _XkbTypedCalloc(i,unsigned short); - if (map->vmodmap==NULL) - return BadAlloc; - } - } - return Success; -} - -/***====================================================================***/ - -Status -XkbCopyKeyType(XkbKeyTypePtr from,XkbKeyTypePtr into) -{ - if ((!from)||(!into)) - return BadMatch; - if (into->map) { - _XkbFree(into->map); - into->map= NULL; - } - if (into->preserve) { - _XkbFree(into->preserve); - into->preserve= NULL; - } - if (into->level_names) { - _XkbFree(into->level_names); - into->level_names= NULL; - } - *into= *from; - if ((from->map)&&(into->map_count>0)) { - into->map= _XkbTypedCalloc(into->map_count,XkbKTMapEntryRec); - if (!into->map) - return BadAlloc; - memcpy(into->map,from->map,into->map_count*sizeof(XkbKTMapEntryRec)); - } - if ((from->preserve)&&(into->map_count>0)) { - into->preserve= _XkbTypedCalloc(into->map_count,XkbModsRec); - if (!into->preserve) - return BadAlloc; - memcpy(into->preserve,from->preserve, - into->map_count*sizeof(XkbModsRec)); - } - if ((from->level_names)&&(into->num_levels>0)) { - into->level_names= _XkbTypedCalloc(into->num_levels,Atom); - if (!into->level_names) - return BadAlloc; - memcpy(into->level_names,from->level_names, - into->num_levels*sizeof(Atom)); - } - return Success; -} - -Status -XkbCopyKeyTypes(XkbKeyTypePtr from,XkbKeyTypePtr into,int num_types) -{ -register int i,rtrn; - - if ((!from)||(!into)||(num_types<0)) - return BadMatch; - for (i=0;imap; - if ((map)&&(map->types)) { - for (i=0;inum_types;i++) { - if (map->types[i].name==name) { - Status status; - status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls); - return (status==Success?&map->types[i]:NULL); - } - } - } - if ((!map)||(!map->types)||(!map->num_typesnum_types<=XkbKeypadIndex) - tmp|= XkbKeypadMask; - if (map->num_types<=XkbAlphabeticIndex) - tmp|= XkbAlphabeticMask; - if (map->num_types<=XkbTwoLevelIndex) - tmp|= XkbTwoLevelMask; - if (map->num_types<=XkbOneLevelIndex) - tmp|= XkbOneLevelMask; - if (XkbInitCanonicalKeyTypes(xkb,tmp,XkbNoModifier)==Success) { - for (i=0;inum_types;i++) { - Status status; - if (map->types[i].name!=name) - continue; - status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls); - return (status==Success?&map->types[i]:NULL); - } - } - } - if ((map->num_types<=map->size_types)&& - (XkbAllocClientMap(xkb,XkbKeyTypesMask,map->num_types+1)!=Success)) { - return NULL; - } - type= &map->types[map->num_types]; - map->num_types++; - bzero((char *)type,sizeof(XkbKeyTypeRec)); - type->num_levels= num_lvls; - type->map_count= map_count; - type->name= name; - if (map_count>0) { - type->map= _XkbTypedCalloc(map_count,XkbKTMapEntryRec); - if (!type->map) { - map->num_types--; - return NULL; - } - if (want_preserve) { - type->preserve= _XkbTypedCalloc(map_count,XkbModsRec); - if (!type->preserve) { - _XkbFree(type->map); - map->num_types--; - return NULL; - } - } - } - return type; -} - -Status -XkbResizeKeyType( XkbDescPtr xkb, - int type_ndx, - int map_count, - Bool want_preserve, - int new_num_lvls) -{ -XkbKeyTypePtr type; -KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; - - if ((type_ndx<0)||(type_ndx>=xkb->map->num_types)||(map_count<0)|| - (new_num_lvls<1)) - return BadValue; - switch (type_ndx) { - case XkbOneLevelIndex: - if (new_num_lvls!=1) - return BadMatch; - break; - case XkbTwoLevelIndex: - case XkbAlphabeticIndex: - case XkbKeypadIndex: - if (new_num_lvls!=2) - return BadMatch; - break; - } - type= &xkb->map->types[type_ndx]; - if (map_count==0) { - if (type->map!=NULL) - _XkbFree(type->map); - type->map= NULL; - if (type->preserve!=NULL) - _XkbFree(type->preserve); - type->preserve= NULL; - type->map_count= 0; - } - else { - XkbKTMapEntryRec *prev_map = type->map; - - if ((map_count>type->map_count)||(type->map==NULL)) - type->map=_XkbTypedRealloc(type->map,map_count,XkbKTMapEntryRec); - if (!type->map) { - if (prev_map) - _XkbFree(prev_map); - return BadAlloc; - } - if (want_preserve) { - XkbModsRec *prev_preserve = type->preserve; - - if ((map_count>type->map_count)||(type->preserve==NULL)) { - type->preserve= _XkbTypedRealloc(type->preserve,map_count, - XkbModsRec); - } - if (!type->preserve) { - if (prev_preserve) - _XkbFree(prev_preserve); - return BadAlloc; - } - } - else if (type->preserve!=NULL) { - _XkbFree(type->preserve); - type->preserve= NULL; - } - type->map_count= map_count; - } - - if ((new_num_lvls>type->num_levels)||(type->level_names==NULL)) { - Atom * prev_level_names = type->level_names; - - type->level_names=_XkbTypedRealloc(type->level_names,new_num_lvls,Atom); - if (!type->level_names) { - if (prev_level_names) - _XkbFree(prev_level_names); - return BadAlloc; - } - } - /* - * Here's the theory: - * If the width of the type changed, we might have to resize the symbol - * maps for any keys that use the type for one or more groups. This is - * expensive, so we'll try to cull out any keys that are obviously okay: - * In any case: - * - keys that have a group width <= the old width are okay (because - * they could not possibly have been associated with the old type) - * If the key type increased in size: - * - keys that already have a group width >= to the new width are okay - * + keys that have a group width >= the old width but < the new width - * might have to be enlarged. - * If the key type decreased in size: - * - keys that have a group width > the old width don't have to be - * resized (because they must have some other wider type associated - * with some group). - * + keys that have a group width == the old width might have to be - * shrunk. - * The possibilities marked with '+' require us to examine the key types - * associated with each group for the key. - */ - bzero(matchingKeys,XkbMaxKeyCount*sizeof(KeyCode)); - nMatchingKeys= 0; - if (new_num_lvls>type->num_levels) { - int nTotal; - KeySym * newSyms; - int width,match,nResize; - register int i,g,nSyms; - - nResize= 0; - for (nTotal=1,i=xkb->min_key_code;i<=xkb->max_key_code;i++) { - width= XkbKeyGroupsWidth(xkb,i); - if (widthnum_levels) - continue; - for (match=0,g=XkbKeyNumGroups(xkb,i)-1;(g>=0)&&(!match);g--) { - if (XkbKeyKeyTypeIndex(xkb,i,g)==type_ndx) { - matchingKeys[nMatchingKeys++]= i; - match= 1; - } - } - if ((!match)||(width>=new_num_lvls)) - nTotal+= XkbKeyNumSyms(xkb,i); - else { - nTotal+= XkbKeyNumGroups(xkb,i)*new_num_lvls; - nResize++; - } - } - if (nResize>0) { - int nextMatch; - xkb->map->size_syms= (nTotal*12)/10; - newSyms = _XkbTypedCalloc(xkb->map->size_syms,KeySym); - if (newSyms==NULL) - return BadAlloc; - nextMatch= 0; - nSyms= 1; - for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) { - if (matchingKeys[nextMatch]==i) { - KeySym *pOld; - nextMatch++; - width= XkbKeyGroupsWidth(xkb,i); - pOld= XkbKeySymsPtr(xkb,i); - for (g=XkbKeyNumGroups(xkb,i)-1;g>=0;g--) { - memcpy(&newSyms[nSyms+(new_num_lvls*g)],&pOld[width*g], - width*sizeof(KeySym)); - } - xkb->map->key_sym_map[i].offset= nSyms; - nSyms+= XkbKeyNumGroups(xkb,i)*new_num_lvls; - } - else { - memcpy(&newSyms[nSyms],XkbKeySymsPtr(xkb,i), - XkbKeyNumSyms(xkb,i)*sizeof(KeySym)); - xkb->map->key_sym_map[i].offset= nSyms; - nSyms+= XkbKeyNumSyms(xkb,i); - } - } - type->num_levels= new_num_lvls; - _XkbFree(xkb->map->syms); - xkb->map->syms= newSyms; - xkb->map->num_syms= nSyms; - return Success; - } - } - else if (new_num_lvlsnum_levels) { - int width,match; - register int g,i; - for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) { - width= XkbKeyGroupsWidth(xkb,i); - if (widthnum_levels) - continue; - for (match=0,g=XkbKeyNumGroups(xkb,i)-1;(g>=0)&&(!match);g--) { - if (XkbKeyKeyTypeIndex(xkb,i,g)==type_ndx) { - matchingKeys[nMatchingKeys++]= i; - match= 1; - } - } - } - } - if (nMatchingKeys>0) { - int key,firstClear; - register int i,g; - if (new_num_lvls>type->num_levels) - firstClear= type->num_levels; - else firstClear= new_num_lvls; - for (i=0;i=0;g--) { - if (XkbKeyKeyTypeIndex(xkb,key,g)==type_ndx) { - if (nClear>0) - bzero(&pSyms[g*width+firstClear],nClear*sizeof(KeySym)); - } - } - } - } - type->num_levels= new_num_lvls; - return Success; -} - -KeySym * -XkbResizeKeySyms(XkbDescPtr xkb,int key,int needed) -{ -register int i,nSyms,nKeySyms; -unsigned nOldSyms; -KeySym *newSyms; - - if (needed==0) { - xkb->map->key_sym_map[key].offset= 0; - return xkb->map->syms; - } - nOldSyms= XkbKeyNumSyms(xkb,key); - if (nOldSyms>=(unsigned)needed) { - return XkbKeySymsPtr(xkb,key); - } - if (xkb->map->size_syms-xkb->map->num_syms>=(unsigned)needed) { - if (nOldSyms>0) { - memcpy(&xkb->map->syms[xkb->map->num_syms],XkbKeySymsPtr(xkb,key), - nOldSyms*sizeof(KeySym)); - } - if ((needed-nOldSyms)>0) { - bzero(&xkb->map->syms[xkb->map->num_syms+XkbKeyNumSyms(xkb,key)], - (needed-nOldSyms)*sizeof(KeySym)); - } - xkb->map->key_sym_map[key].offset = xkb->map->num_syms; - xkb->map->num_syms+= needed; - return &xkb->map->syms[xkb->map->key_sym_map[key].offset]; - } - xkb->map->size_syms+= (needed>32?needed:32); - newSyms = _XkbTypedCalloc(xkb->map->size_syms,KeySym); - if (newSyms==NULL) - return NULL; - newSyms[0]= NoSymbol; - nSyms = 1; - for (i=xkb->min_key_code;i<=(int)xkb->max_key_code;i++) { - int nCopy; - - nCopy= nKeySyms= XkbKeyNumSyms(xkb,i); - if ((nKeySyms==0)&&(i!=key)) - continue; - if (i==key) - nKeySyms= needed; - if (nCopy!=0) - memcpy(&newSyms[nSyms],XkbKeySymsPtr(xkb,i),nCopy*sizeof(KeySym)); - if (nKeySyms>nCopy) - bzero(&newSyms[nSyms+nCopy],(nKeySyms-nCopy)*sizeof(KeySym)); - xkb->map->key_sym_map[i].offset = nSyms; - nSyms+= nKeySyms; - } - _XkbFree(xkb->map->syms); - xkb->map->syms = newSyms; - xkb->map->num_syms = nSyms; - return &xkb->map->syms[xkb->map->key_sym_map[key].offset]; -} - -static unsigned -_ExtendRange( unsigned int old_flags, - unsigned int flag, - KeyCode newKC, - KeyCode * old_min, - unsigned char * old_num) -{ - if ((old_flags&flag)==0) { - old_flags|= flag; - *old_min= newKC; - *old_num= 1; - } - else { - int last= (*old_min)+(*old_num)-1; - if (newKC<*old_min) { - *old_min= newKC; - *old_num= (last-newKC)+1; - } - else if (newKC>last) { - *old_num= (newKC-(*old_min))+1; - } - } - return old_flags; -} - -Status -XkbChangeKeycodeRange( XkbDescPtr xkb, - int minKC, - int maxKC, - XkbChangesPtr changes) -{ -int tmp; - - if ((!xkb)||(minKCXkbMaxLegalKeyCode)) - return BadValue; - if (minKC>maxKC) - return BadMatch; - if (minKCmin_key_code) { - if (changes) - changes->map.min_key_code= minKC; - tmp= xkb->min_key_code-minKC; - if (xkb->map) { - if (xkb->map->key_sym_map) { - bzero((char *)&xkb->map->key_sym_map[minKC], - tmp*sizeof(XkbSymMapRec)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeySymsMask,minKC, - &changes->map.first_key_sym, - &changes->map.num_key_syms); - } - } - if (xkb->map->modmap) { - bzero((char *)&xkb->map->modmap[minKC],tmp); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbModifierMapMask,minKC, - &changes->map.first_modmap_key, - &changes->map.num_modmap_keys); - } - } - } - if (xkb->server) { - if (xkb->server->behaviors) { - bzero((char *)&xkb->server->behaviors[minKC], - tmp*sizeof(XkbBehavior)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeyBehaviorsMask,minKC, - &changes->map.first_key_behavior, - &changes->map.num_key_behaviors); - } - } - if (xkb->server->key_acts) { - bzero((char *)&xkb->server->key_acts[minKC], - tmp*sizeof(unsigned short)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeyActionsMask,minKC, - &changes->map.first_key_act, - &changes->map.num_key_acts); - } - } - if (xkb->server->vmodmap) { - bzero((char *)&xkb->server->vmodmap[minKC], - tmp*sizeof(unsigned short)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbVirtualModMapMask,minKC, - &changes->map.first_modmap_key, - &changes->map.num_vmodmap_keys); - } - } - } - if ((xkb->names)&&(xkb->names->keys)) { - bzero((char *)&xkb->names->keys[minKC],tmp*sizeof(XkbKeyNameRec)); - if (changes) { - changes->names.changed= _ExtendRange(changes->names.changed, - XkbKeyNamesMask,minKC, - &changes->names.first_key, - &changes->names.num_keys); - } - } - xkb->min_key_code= minKC; - } - if (maxKC>xkb->max_key_code) { - if (changes) - changes->map.max_key_code= maxKC; - tmp= maxKC-xkb->max_key_code; - if (xkb->map) { - if (xkb->map->key_sym_map) { - XkbSymMapRec *prev_key_sym_map = xkb->map->key_sym_map; - - xkb->map->key_sym_map= _XkbTypedRealloc(xkb->map->key_sym_map, - (maxKC+1),XkbSymMapRec); - if (!xkb->map->key_sym_map) { - _XkbFree(prev_key_sym_map); - return BadAlloc; - } -#ifdef NXAGENT_SERVER - bzero((char *)&xkb->map->key_sym_map[xkb->max_key_code+1], - tmp*sizeof(XkbSymMapRec)); -#else - bzero((char *)&xkb->map->key_sym_map[xkb->max_key_code], - tmp*sizeof(XkbSymMapRec)); -#endif - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeySymsMask,maxKC, - &changes->map.first_key_sym, - &changes->map.num_key_syms); - } - } - if (xkb->map->modmap) { - unsigned char *prev_modmap = xkb->map->modmap; - - xkb->map->modmap= _XkbTypedRealloc(xkb->map->modmap, - (maxKC+1),unsigned char); - if (!xkb->map->modmap) { - _XkbFree(prev_modmap); - return BadAlloc; - } -#ifdef NXAGENT_SERVER - bzero((char *)&xkb->map->modmap[xkb->max_key_code+1],tmp); -#else - bzero((char *)&xkb->map->modmap[xkb->max_key_code],tmp); -#endif - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbModifierMapMask,maxKC, - &changes->map.first_modmap_key, - &changes->map.num_modmap_keys); - } - } - } - if (xkb->server) { - if (xkb->server->behaviors) { - XkbBehavior *prev_behaviors = xkb->server->behaviors; - - xkb->server->behaviors=_XkbTypedRealloc(xkb->server->behaviors, - (maxKC+1),XkbBehavior); - if (!xkb->server->behaviors) { - _XkbFree(prev_behaviors); - return BadAlloc; - } -#ifdef NXAGENT_SERVER - bzero((char *)&xkb->server->behaviors[xkb->max_key_code+1], - tmp*sizeof(XkbBehavior)); -#else - bzero((char *)&xkb->server->behaviors[xkb->max_key_code], - tmp*sizeof(XkbBehavior)); -#endif - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeyBehaviorsMask,maxKC, - &changes->map.first_key_behavior, - &changes->map.num_key_behaviors); - } - } - if (xkb->server->key_acts) { - unsigned short *prev_key_acts = xkb->server->key_acts; - - xkb->server->key_acts= _XkbTypedRealloc(xkb->server->key_acts, - (maxKC+1),unsigned short); - if (!xkb->server->key_acts) { - _XkbFree(prev_key_acts); - return BadAlloc; - } -#ifdef NXAGENT_SERVER - bzero((char *)&xkb->server->key_acts[xkb->max_key_code+1], - tmp*sizeof(unsigned short)); -#else - bzero((char *)&xkb->server->key_acts[xkb->max_key_code], - tmp*sizeof(unsigned short)); -#endif - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeyActionsMask,maxKC, - &changes->map.first_key_act, - &changes->map.num_key_acts); - } - } - if (xkb->server->vmodmap) { - unsigned short *prev_vmodmap = xkb->server->vmodmap; - - xkb->server->vmodmap= _XkbTypedRealloc(xkb->server->vmodmap, - (maxKC+1),unsigned short); - if (!xkb->server->vmodmap) { - _XkbFree(prev_vmodmap); - return BadAlloc; - } -#ifdef NXAGENT_SERVER - bzero((char *)&xkb->server->vmodmap[xkb->max_key_code+1], - tmp*sizeof(unsigned short)); -#else - bzero((char *)&xkb->server->vmodmap[xkb->max_key_code], - tmp*sizeof(unsigned short)); -#endif - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbVirtualModMapMask,maxKC, - &changes->map.first_modmap_key, - &changes->map.num_vmodmap_keys); - } - } - } - if ((xkb->names)&&(xkb->names->keys)) { - XkbKeyNameRec *prev_keys = xkb->names->keys; - - xkb->names->keys= _XkbTypedRealloc(xkb->names->keys, - (maxKC+1),XkbKeyNameRec); - if (!xkb->names->keys) { - _XkbFree(prev_keys); - return BadAlloc; - } -#ifdef NXAGENT_SERVER - bzero((char *)&xkb->names->keys[xkb->max_key_code+1], - tmp*sizeof(XkbKeyNameRec)); -#else - bzero((char *)&xkb->names->keys[xkb->max_key_code], - tmp*sizeof(XkbKeyNameRec)); -#endif - if (changes) { - changes->names.changed= _ExtendRange(changes->names.changed, - XkbKeyNamesMask,maxKC, - &changes->names.first_key, - &changes->names.num_keys); - } - } - xkb->max_key_code= maxKC; - } - return Success; -} - -XkbAction * -XkbResizeKeyActions(XkbDescPtr xkb,int key,int needed) -{ -register int i,nActs; -XkbAction *newActs; - - if (needed==0) { - xkb->server->key_acts[key]= 0; - return NULL; - } - if (XkbKeyHasActions(xkb,key)&&(XkbKeyNumSyms(xkb,key)>=(unsigned)needed)) - return XkbKeyActionsPtr(xkb,key); - if (xkb->server->size_acts-xkb->server->num_acts>=(unsigned)needed) { - xkb->server->key_acts[key]= xkb->server->num_acts; - xkb->server->num_acts+= needed; - return &xkb->server->acts[xkb->server->key_acts[key]]; - } - xkb->server->size_acts= xkb->server->num_acts+needed+8; - newActs = _XkbTypedCalloc(xkb->server->size_acts,XkbAction); - if (newActs==NULL) - return NULL; - newActs[0].type = XkbSA_NoAction; - nActs = 1; - for (i=xkb->min_key_code;i<=(int)xkb->max_key_code;i++) { - int nKeyActs,nCopy; - - if ((xkb->server->key_acts[i]==0)&&(i!=key)) - continue; - - nCopy= nKeyActs= XkbKeyNumActions(xkb,i); - if (i==key) { - nKeyActs= needed; - if (needed0) - memcpy(&newActs[nActs],XkbKeyActionsPtr(xkb,i), - nCopy*sizeof(XkbAction)); - if (nCopyserver->key_acts[i]= nActs; - nActs+= nKeyActs; - } - _XkbFree(xkb->server->acts); - xkb->server->acts = newActs; - xkb->server->num_acts= nActs; - return &xkb->server->acts[xkb->server->key_acts[key]]; -} - -void -XkbFreeClientMap(XkbDescPtr xkb,unsigned what,Bool freeMap) -{ -XkbClientMapPtr map; - - if ((xkb==NULL)||(xkb->map==NULL)) - return; - if (freeMap) - what= XkbAllClientInfoMask; - map= xkb->map; - if (what&XkbKeyTypesMask) { - if (map->types!=NULL) { - if (map->num_types>0) { - register int i; - XkbKeyTypePtr type; - for (i=0,type=map->types;inum_types;i++,type++) { - if (type->map!=NULL) { - _XkbFree(type->map); - type->map= NULL; - } - if (type->preserve!=NULL) { - _XkbFree(type->preserve); - type->preserve= NULL; - } - type->map_count= 0; - if (type->level_names!=NULL) { - _XkbFree(type->level_names); - type->level_names= NULL; - } - } - } - _XkbFree(map->types); - map->num_types= map->size_types= 0; - map->types= NULL; - } - } - if (what&XkbKeySymsMask) { - if (map->key_sym_map!=NULL) { - _XkbFree(map->key_sym_map); - map->key_sym_map= NULL; - } - if (map->syms!=NULL) { - _XkbFree(map->syms); - map->size_syms= map->num_syms= 0; - map->syms= NULL; - } - } - if ((what&XkbModifierMapMask)&&(map->modmap!=NULL)) { - _XkbFree(map->modmap); - map->modmap= NULL; - } - if (freeMap) { - _XkbFree(xkb->map); - xkb->map= NULL; - } - return; -} - -void -XkbFreeServerMap(XkbDescPtr xkb,unsigned what,Bool freeMap) -{ -XkbServerMapPtr map; - - if ((xkb==NULL)||(xkb->server==NULL)) - return; - if (freeMap) - what= XkbAllServerInfoMask; - map= xkb->server; - if ((what&XkbExplicitComponentsMask)&&(map->explicit!=NULL)) { - _XkbFree(map->explicit); - map->explicit= NULL; - } - if (what&XkbKeyActionsMask) { - if (map->key_acts!=NULL) { - _XkbFree(map->key_acts); - map->key_acts= NULL; - } - if (map->acts!=NULL) { - _XkbFree(map->acts); - map->num_acts= map->size_acts= 0; - map->acts= NULL; - } - } - if ((what&XkbKeyBehaviorsMask)&&(map->behaviors!=NULL)) { - _XkbFree(map->behaviors); - map->behaviors= NULL; - } - if ((what&XkbVirtualModMapMask)&&(map->vmodmap!=NULL)) { - _XkbFree(map->vmodmap); - map->vmodmap= NULL; - } - - if (freeMap) { - _XkbFree(xkb->server); - xkb->server= NULL; - } - return; -} diff --git a/nx-X11/lib/X11/XKBMAlloc.c.X.original b/nx-X11/lib/X11/XKBMAlloc.c.X.original deleted file mode 100644 index 91d87d57c..000000000 --- a/nx-X11/lib/X11/XKBMAlloc.c.X.original +++ /dev/null @@ -1,994 +0,0 @@ -/* $Xorg: XKBMAlloc.c,v 1.4 2000/08/17 19:45:02 cpqbld Exp $ */ -/************************************************************ -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. - -********************************************************/ -/* $XFree86: xc/lib/X11/XKBMAlloc.c,v 3.11 2001/01/17 19:41:48 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#elif defined(HAVE_CONFIG_H) -#include -#endif - -#ifndef XKB_IN_SERVER - -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include "Xlibint.h" -#include -#include -#include "XKBlibint.h" - -#else - -#include -#include -#define NEED_EVENTS -#define NEED_REPLIES -#include -#include "misc.h" -#include "inputstr.h" -#include -#define XKBSRV_NEED_FILE_FUNCS -#include - -#endif /* XKB_IN_SERVER */ - -/***====================================================================***/ - -Status -XkbAllocClientMap(XkbDescPtr xkb,unsigned which,unsigned nTotalTypes) -{ -register int i; -XkbClientMapPtr map; - - if ((xkb==NULL)||((nTotalTypes>0)&&(nTotalTypesmin_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code))) { -#ifdef DEBUG -fprintf(stderr,"bad keycode (%d,%d) in XkbAllocClientMap\n", - xkb->min_key_code,xkb->max_key_code); -#endif - return BadValue; - } - - if (xkb->map==NULL) { - map= _XkbTypedCalloc(1,XkbClientMapRec); - if (map==NULL) - return BadAlloc; - xkb->map= map; - } - else map= xkb->map; - - if ((which&XkbKeyTypesMask)&&(nTotalTypes>0)) { - if (map->types==NULL) { - map->types= _XkbTypedCalloc(nTotalTypes,XkbKeyTypeRec); - if (map->types==NULL) - return BadAlloc; - map->num_types= 0; - map->size_types= nTotalTypes; - } - else if (map->size_typestypes; - - map->types= _XkbTypedRealloc(map->types,nTotalTypes,XkbKeyTypeRec); - if (map->types==NULL) { - _XkbFree(prev_types); - map->num_types= map->size_types= 0; - return BadAlloc; - } - map->size_types= nTotalTypes; - bzero(&map->types[map->num_types], - ((map->size_types-map->num_types)*sizeof(XkbKeyTypeRec))); - } - } - if (which&XkbKeySymsMask) { - int nKeys= XkbNumKeys(xkb); - if (map->syms==NULL) { - map->size_syms= (nKeys*15)/10; - map->syms= _XkbTypedCalloc(map->size_syms,KeySym); - if (!map->syms) { - map->size_syms= 0; - return BadAlloc; - } - map->num_syms= 1; - map->syms[0]= NoSymbol; - } - if (map->key_sym_map==NULL) { - i= xkb->max_key_code+1; - map->key_sym_map= _XkbTypedCalloc(i,XkbSymMapRec); - if (map->key_sym_map==NULL) - return BadAlloc; - } - } - if (which&XkbModifierMapMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (map->modmap==NULL) { - i= xkb->max_key_code+1; - map->modmap= _XkbTypedCalloc(i,unsigned char); - if (map->modmap==NULL) - return BadAlloc; - } - } - return Success; -} - -Status -XkbAllocServerMap(XkbDescPtr xkb,unsigned which,unsigned nNewActions) -{ -register int i; -XkbServerMapPtr map; - - if (xkb==NULL) - return BadMatch; - if (xkb->server==NULL) { - map= _XkbTypedCalloc(1,XkbServerMapRec); - if (map==NULL) - return BadAlloc; - for (i=0;ivmods[i]= XkbNoModifierMask; - } - xkb->server= map; - } - else map= xkb->server; - if (which&XkbExplicitComponentsMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (map->explicit==NULL) { - i= xkb->max_key_code+1; - map->explicit= _XkbTypedCalloc(i,unsigned char); - if (map->explicit==NULL) - return BadAlloc; - } - } - if (which&XkbKeyActionsMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (nNewActions<1) - nNewActions= 1; - if (map->acts==NULL) { - map->acts= _XkbTypedCalloc((nNewActions+1),XkbAction); - if (map->acts==NULL) - return BadAlloc; - map->num_acts= 1; - map->size_acts= nNewActions+1; - } - else if ((map->size_acts-map->num_acts)acts; - need= map->num_acts+nNewActions; - map->acts= _XkbTypedRealloc(map->acts,need,XkbAction); - if (map->acts==NULL) { - _XkbFree(prev_acts); - map->num_acts= map->size_acts= 0; - return BadAlloc; - } - map->size_acts= need; - bzero(&map->acts[map->num_acts], - ((map->size_acts-map->num_acts)*sizeof(XkbAction))); - } - if (map->key_acts==NULL) { - i= xkb->max_key_code+1; - map->key_acts= _XkbTypedCalloc(i,unsigned short); - if (map->key_acts==NULL) - return BadAlloc; - } - } - if (which&XkbKeyBehaviorsMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (map->behaviors==NULL) { - i= xkb->max_key_code+1; - map->behaviors= _XkbTypedCalloc(i,XkbBehavior); - if (map->behaviors==NULL) - return BadAlloc; - } - } - if (which&XkbVirtualModMapMask) { - if ((!XkbIsLegalKeycode(xkb->min_key_code))|| - (!XkbIsLegalKeycode(xkb->max_key_code))|| - (xkb->max_key_codemin_key_code)) - return BadMatch; - if (map->vmodmap==NULL) { - i= xkb->max_key_code+1; - map->vmodmap= _XkbTypedCalloc(i,unsigned short); - if (map->vmodmap==NULL) - return BadAlloc; - } - } - return Success; -} - -/***====================================================================***/ - -Status -XkbCopyKeyType(XkbKeyTypePtr from,XkbKeyTypePtr into) -{ - if ((!from)||(!into)) - return BadMatch; - if (into->map) { - _XkbFree(into->map); - into->map= NULL; - } - if (into->preserve) { - _XkbFree(into->preserve); - into->preserve= NULL; - } - if (into->level_names) { - _XkbFree(into->level_names); - into->level_names= NULL; - } - *into= *from; - if ((from->map)&&(into->map_count>0)) { - into->map= _XkbTypedCalloc(into->map_count,XkbKTMapEntryRec); - if (!into->map) - return BadAlloc; - memcpy(into->map,from->map,into->map_count*sizeof(XkbKTMapEntryRec)); - } - if ((from->preserve)&&(into->map_count>0)) { - into->preserve= _XkbTypedCalloc(into->map_count,XkbModsRec); - if (!into->preserve) - return BadAlloc; - memcpy(into->preserve,from->preserve, - into->map_count*sizeof(XkbModsRec)); - } - if ((from->level_names)&&(into->num_levels>0)) { - into->level_names= _XkbTypedCalloc(into->num_levels,Atom); - if (!into->level_names) - return BadAlloc; - memcpy(into->level_names,from->level_names, - into->num_levels*sizeof(Atom)); - } - return Success; -} - -Status -XkbCopyKeyTypes(XkbKeyTypePtr from,XkbKeyTypePtr into,int num_types) -{ -register int i,rtrn; - - if ((!from)||(!into)||(num_types<0)) - return BadMatch; - for (i=0;imap; - if ((map)&&(map->types)) { - for (i=0;inum_types;i++) { - if (map->types[i].name==name) { - Status status; - status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls); - return (status==Success?&map->types[i]:NULL); - } - } - } - if ((!map)||(!map->types)||(!map->num_typesnum_types<=XkbKeypadIndex) - tmp|= XkbKeypadMask; - if (map->num_types<=XkbAlphabeticIndex) - tmp|= XkbAlphabeticMask; - if (map->num_types<=XkbTwoLevelIndex) - tmp|= XkbTwoLevelMask; - if (map->num_types<=XkbOneLevelIndex) - tmp|= XkbOneLevelMask; - if (XkbInitCanonicalKeyTypes(xkb,tmp,XkbNoModifier)==Success) { - for (i=0;inum_types;i++) { - Status status; - if (map->types[i].name!=name) - continue; - status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls); - return (status==Success?&map->types[i]:NULL); - } - } - } - if ((map->num_types<=map->size_types)&& - (XkbAllocClientMap(xkb,XkbKeyTypesMask,map->num_types+1)!=Success)) { - return NULL; - } - type= &map->types[map->num_types]; - map->num_types++; - bzero((char *)type,sizeof(XkbKeyTypeRec)); - type->num_levels= num_lvls; - type->map_count= map_count; - type->name= name; - if (map_count>0) { - type->map= _XkbTypedCalloc(map_count,XkbKTMapEntryRec); - if (!type->map) { - map->num_types--; - return NULL; - } - if (want_preserve) { - type->preserve= _XkbTypedCalloc(map_count,XkbModsRec); - if (!type->preserve) { - _XkbFree(type->map); - map->num_types--; - return NULL; - } - } - } - return type; -} - -Status -XkbResizeKeyType( XkbDescPtr xkb, - int type_ndx, - int map_count, - Bool want_preserve, - int new_num_lvls) -{ -XkbKeyTypePtr type; -KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; - - if ((type_ndx<0)||(type_ndx>=xkb->map->num_types)||(map_count<0)|| - (new_num_lvls<1)) - return BadValue; - switch (type_ndx) { - case XkbOneLevelIndex: - if (new_num_lvls!=1) - return BadMatch; - break; - case XkbTwoLevelIndex: - case XkbAlphabeticIndex: - case XkbKeypadIndex: - if (new_num_lvls!=2) - return BadMatch; - break; - } - type= &xkb->map->types[type_ndx]; - if (map_count==0) { - if (type->map!=NULL) - _XkbFree(type->map); - type->map= NULL; - if (type->preserve!=NULL) - _XkbFree(type->preserve); - type->preserve= NULL; - type->map_count= 0; - } - else { - XkbKTMapEntryRec *prev_map = type->map; - - if ((map_count>type->map_count)||(type->map==NULL)) - type->map=_XkbTypedRealloc(type->map,map_count,XkbKTMapEntryRec); - if (!type->map) { - if (prev_map) - _XkbFree(prev_map); - return BadAlloc; - } - if (want_preserve) { - XkbModsRec *prev_preserve = type->preserve; - - if ((map_count>type->map_count)||(type->preserve==NULL)) { - type->preserve= _XkbTypedRealloc(type->preserve,map_count, - XkbModsRec); - } - if (!type->preserve) { - if (prev_preserve) - _XkbFree(prev_preserve); - return BadAlloc; - } - } - else if (type->preserve!=NULL) { - _XkbFree(type->preserve); - type->preserve= NULL; - } - type->map_count= map_count; - } - - if ((new_num_lvls>type->num_levels)||(type->level_names==NULL)) { - Atom * prev_level_names = type->level_names; - - type->level_names=_XkbTypedRealloc(type->level_names,new_num_lvls,Atom); - if (!type->level_names) { - if (prev_level_names) - _XkbFree(prev_level_names); - return BadAlloc; - } - } - /* - * Here's the theory: - * If the width of the type changed, we might have to resize the symbol - * maps for any keys that use the type for one or more groups. This is - * expensive, so we'll try to cull out any keys that are obviously okay: - * In any case: - * - keys that have a group width <= the old width are okay (because - * they could not possibly have been associated with the old type) - * If the key type increased in size: - * - keys that already have a group width >= to the new width are okay - * + keys that have a group width >= the old width but < the new width - * might have to be enlarged. - * If the key type decreased in size: - * - keys that have a group width > the old width don't have to be - * resized (because they must have some other wider type associated - * with some group). - * + keys that have a group width == the old width might have to be - * shrunk. - * The possibilities marked with '+' require us to examine the key types - * associated with each group for the key. - */ - bzero(matchingKeys,XkbMaxKeyCount*sizeof(KeyCode)); - nMatchingKeys= 0; - if (new_num_lvls>type->num_levels) { - int nTotal; - KeySym * newSyms; - int width,match,nResize; - register int i,g,nSyms; - - nResize= 0; - for (nTotal=1,i=xkb->min_key_code;i<=xkb->max_key_code;i++) { - width= XkbKeyGroupsWidth(xkb,i); - if (widthnum_levels) - continue; - for (match=0,g=XkbKeyNumGroups(xkb,i)-1;(g>=0)&&(!match);g--) { - if (XkbKeyKeyTypeIndex(xkb,i,g)==type_ndx) { - matchingKeys[nMatchingKeys++]= i; - match= 1; - } - } - if ((!match)||(width>=new_num_lvls)) - nTotal+= XkbKeyNumSyms(xkb,i); - else { - nTotal+= XkbKeyNumGroups(xkb,i)*new_num_lvls; - nResize++; - } - } - if (nResize>0) { - int nextMatch; - xkb->map->size_syms= (nTotal*12)/10; - newSyms = _XkbTypedCalloc(xkb->map->size_syms,KeySym); - if (newSyms==NULL) - return BadAlloc; - nextMatch= 0; - nSyms= 1; - for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) { - if (matchingKeys[nextMatch]==i) { - KeySym *pOld; - nextMatch++; - width= XkbKeyGroupsWidth(xkb,i); - pOld= XkbKeySymsPtr(xkb,i); - for (g=XkbKeyNumGroups(xkb,i)-1;g>=0;g--) { - memcpy(&newSyms[nSyms+(new_num_lvls*g)],&pOld[width*g], - width*sizeof(KeySym)); - } - xkb->map->key_sym_map[i].offset= nSyms; - nSyms+= XkbKeyNumGroups(xkb,i)*new_num_lvls; - } - else { - memcpy(&newSyms[nSyms],XkbKeySymsPtr(xkb,i), - XkbKeyNumSyms(xkb,i)*sizeof(KeySym)); - xkb->map->key_sym_map[i].offset= nSyms; - nSyms+= XkbKeyNumSyms(xkb,i); - } - } - type->num_levels= new_num_lvls; - _XkbFree(xkb->map->syms); - xkb->map->syms= newSyms; - xkb->map->num_syms= nSyms; - return Success; - } - } - else if (new_num_lvlsnum_levels) { - int width,match; - register int g,i; - for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) { - width= XkbKeyGroupsWidth(xkb,i); - if (widthnum_levels) - continue; - for (match=0,g=XkbKeyNumGroups(xkb,i)-1;(g>=0)&&(!match);g--) { - if (XkbKeyKeyTypeIndex(xkb,i,g)==type_ndx) { - matchingKeys[nMatchingKeys++]= i; - match= 1; - } - } - } - } - if (nMatchingKeys>0) { - int key,firstClear; - register int i,g; - if (new_num_lvls>type->num_levels) - firstClear= type->num_levels; - else firstClear= new_num_lvls; - for (i=0;i=0;g--) { - if (XkbKeyKeyTypeIndex(xkb,key,g)==type_ndx) { - if (nClear>0) - bzero(&pSyms[g*width+firstClear],nClear*sizeof(KeySym)); - } - } - } - } - type->num_levels= new_num_lvls; - return Success; -} - -KeySym * -XkbResizeKeySyms(XkbDescPtr xkb,int key,int needed) -{ -register int i,nSyms,nKeySyms; -unsigned nOldSyms; -KeySym *newSyms; - - if (needed==0) { - xkb->map->key_sym_map[key].offset= 0; - return xkb->map->syms; - } - nOldSyms= XkbKeyNumSyms(xkb,key); - if (nOldSyms>=(unsigned)needed) { - return XkbKeySymsPtr(xkb,key); - } - if (xkb->map->size_syms-xkb->map->num_syms>=(unsigned)needed) { - if (nOldSyms>0) { - memcpy(&xkb->map->syms[xkb->map->num_syms],XkbKeySymsPtr(xkb,key), - nOldSyms*sizeof(KeySym)); - } - if ((needed-nOldSyms)>0) { - bzero(&xkb->map->syms[xkb->map->num_syms+XkbKeyNumSyms(xkb,key)], - (needed-nOldSyms)*sizeof(KeySym)); - } - xkb->map->key_sym_map[key].offset = xkb->map->num_syms; - xkb->map->num_syms+= needed; - return &xkb->map->syms[xkb->map->key_sym_map[key].offset]; - } - xkb->map->size_syms+= (needed>32?needed:32); - newSyms = _XkbTypedCalloc(xkb->map->size_syms,KeySym); - if (newSyms==NULL) - return NULL; - newSyms[0]= NoSymbol; - nSyms = 1; - for (i=xkb->min_key_code;i<=(int)xkb->max_key_code;i++) { - int nCopy; - - nCopy= nKeySyms= XkbKeyNumSyms(xkb,i); - if ((nKeySyms==0)&&(i!=key)) - continue; - if (i==key) - nKeySyms= needed; - if (nCopy!=0) - memcpy(&newSyms[nSyms],XkbKeySymsPtr(xkb,i),nCopy*sizeof(KeySym)); - if (nKeySyms>nCopy) - bzero(&newSyms[nSyms+nCopy],(nKeySyms-nCopy)*sizeof(KeySym)); - xkb->map->key_sym_map[i].offset = nSyms; - nSyms+= nKeySyms; - } - _XkbFree(xkb->map->syms); - xkb->map->syms = newSyms; - xkb->map->num_syms = nSyms; - return &xkb->map->syms[xkb->map->key_sym_map[key].offset]; -} - -static unsigned -_ExtendRange( unsigned int old_flags, - unsigned int flag, - KeyCode newKC, - KeyCode * old_min, - unsigned char * old_num) -{ - if ((old_flags&flag)==0) { - old_flags|= flag; - *old_min= newKC; - *old_num= 1; - } - else { - int last= (*old_min)+(*old_num)-1; - if (newKC<*old_min) { - *old_min= newKC; - *old_num= (last-newKC)+1; - } - else if (newKC>last) { - *old_num= (newKC-(*old_min))+1; - } - } - return old_flags; -} - -Status -XkbChangeKeycodeRange( XkbDescPtr xkb, - int minKC, - int maxKC, - XkbChangesPtr changes) -{ -int tmp; - - if ((!xkb)||(minKCXkbMaxLegalKeyCode)) - return BadValue; - if (minKC>maxKC) - return BadMatch; - if (minKCmin_key_code) { - if (changes) - changes->map.min_key_code= minKC; - tmp= xkb->min_key_code-minKC; - if (xkb->map) { - if (xkb->map->key_sym_map) { - bzero((char *)&xkb->map->key_sym_map[minKC], - tmp*sizeof(XkbSymMapRec)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeySymsMask,minKC, - &changes->map.first_key_sym, - &changes->map.num_key_syms); - } - } - if (xkb->map->modmap) { - bzero((char *)&xkb->map->modmap[minKC],tmp); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbModifierMapMask,minKC, - &changes->map.first_modmap_key, - &changes->map.num_modmap_keys); - } - } - } - if (xkb->server) { - if (xkb->server->behaviors) { - bzero((char *)&xkb->server->behaviors[minKC], - tmp*sizeof(XkbBehavior)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeyBehaviorsMask,minKC, - &changes->map.first_key_behavior, - &changes->map.num_key_behaviors); - } - } - if (xkb->server->key_acts) { - bzero((char *)&xkb->server->key_acts[minKC], - tmp*sizeof(unsigned short)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeyActionsMask,minKC, - &changes->map.first_key_act, - &changes->map.num_key_acts); - } - } - if (xkb->server->vmodmap) { - bzero((char *)&xkb->server->vmodmap[minKC], - tmp*sizeof(unsigned short)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbVirtualModMapMask,minKC, - &changes->map.first_modmap_key, - &changes->map.num_vmodmap_keys); - } - } - } - if ((xkb->names)&&(xkb->names->keys)) { - bzero((char *)&xkb->names->keys[minKC],tmp*sizeof(XkbKeyNameRec)); - if (changes) { - changes->names.changed= _ExtendRange(changes->names.changed, - XkbKeyNamesMask,minKC, - &changes->names.first_key, - &changes->names.num_keys); - } - } - xkb->min_key_code= minKC; - } - if (maxKC>xkb->max_key_code) { - if (changes) - changes->map.max_key_code= maxKC; - tmp= maxKC-xkb->max_key_code; - if (xkb->map) { - if (xkb->map->key_sym_map) { - XkbSymMapRec *prev_key_sym_map = xkb->map->key_sym_map; - - xkb->map->key_sym_map= _XkbTypedRealloc(xkb->map->key_sym_map, - (maxKC+1),XkbSymMapRec); - if (!xkb->map->key_sym_map) { - _XkbFree(prev_key_sym_map); - return BadAlloc; - } - bzero((char *)&xkb->map->key_sym_map[xkb->max_key_code], - tmp*sizeof(XkbSymMapRec)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeySymsMask,maxKC, - &changes->map.first_key_sym, - &changes->map.num_key_syms); - } - } - if (xkb->map->modmap) { - unsigned char *prev_modmap = xkb->map->modmap; - - xkb->map->modmap= _XkbTypedRealloc(xkb->map->modmap, - (maxKC+1),unsigned char); - if (!xkb->map->modmap) { - _XkbFree(prev_modmap); - return BadAlloc; - } - bzero((char *)&xkb->map->modmap[xkb->max_key_code],tmp); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbModifierMapMask,maxKC, - &changes->map.first_modmap_key, - &changes->map.num_modmap_keys); - } - } - } - if (xkb->server) { - if (xkb->server->behaviors) { - XkbBehavior *prev_behaviors = xkb->server->behaviors; - - xkb->server->behaviors=_XkbTypedRealloc(xkb->server->behaviors, - (maxKC+1),XkbBehavior); - if (!xkb->server->behaviors) { - _XkbFree(prev_behaviors); - return BadAlloc; - } - bzero((char *)&xkb->server->behaviors[xkb->max_key_code], - tmp*sizeof(XkbBehavior)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeyBehaviorsMask,maxKC, - &changes->map.first_key_behavior, - &changes->map.num_key_behaviors); - } - } - if (xkb->server->key_acts) { - unsigned short *prev_key_acts = xkb->server->key_acts; - - xkb->server->key_acts= _XkbTypedRealloc(xkb->server->key_acts, - (maxKC+1),unsigned short); - if (!xkb->server->key_acts) { - _XkbFree(prev_key_acts); - return BadAlloc; - } - bzero((char *)&xkb->server->key_acts[xkb->max_key_code], - tmp*sizeof(unsigned short)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbKeyActionsMask,maxKC, - &changes->map.first_key_act, - &changes->map.num_key_acts); - } - } - if (xkb->server->vmodmap) { - unsigned short *prev_vmodmap = xkb->server->vmodmap; - - xkb->server->vmodmap= _XkbTypedRealloc(xkb->server->vmodmap, - (maxKC+1),unsigned short); - if (!xkb->server->vmodmap) { - _XkbFree(prev_vmodmap); - return BadAlloc; - } - bzero((char *)&xkb->server->vmodmap[xkb->max_key_code], - tmp*sizeof(unsigned short)); - if (changes) { - changes->map.changed= _ExtendRange(changes->map.changed, - XkbVirtualModMapMask,maxKC, - &changes->map.first_modmap_key, - &changes->map.num_vmodmap_keys); - } - } - } - if ((xkb->names)&&(xkb->names->keys)) { - XkbKeyNameRec *prev_keys = xkb->names->keys; - - xkb->names->keys= _XkbTypedRealloc(xkb->names->keys, - (maxKC+1),XkbKeyNameRec); - if (!xkb->names->keys) { - _XkbFree(prev_keys); - return BadAlloc; - } - bzero((char *)&xkb->names->keys[xkb->max_key_code], - tmp*sizeof(XkbKeyNameRec)); - if (changes) { - changes->names.changed= _ExtendRange(changes->names.changed, - XkbKeyNamesMask,maxKC, - &changes->names.first_key, - &changes->names.num_keys); - } - } - xkb->max_key_code= maxKC; - } - return Success; -} - -XkbAction * -XkbResizeKeyActions(XkbDescPtr xkb,int key,int needed) -{ -register int i,nActs; -XkbAction *newActs; - - if (needed==0) { - xkb->server->key_acts[key]= 0; - return NULL; - } - if (XkbKeyHasActions(xkb,key)&&(XkbKeyNumSyms(xkb,key)>=(unsigned)needed)) - return XkbKeyActionsPtr(xkb,key); - if (xkb->server->size_acts-xkb->server->num_acts>=(unsigned)needed) { - xkb->server->key_acts[key]= xkb->server->num_acts; - xkb->server->num_acts+= needed; - return &xkb->server->acts[xkb->server->key_acts[key]]; - } - xkb->server->size_acts= xkb->server->num_acts+needed+8; - newActs = _XkbTypedCalloc(xkb->server->size_acts,XkbAction); - if (newActs==NULL) - return NULL; - newActs[0].type = XkbSA_NoAction; - nActs = 1; - for (i=xkb->min_key_code;i<=(int)xkb->max_key_code;i++) { - int nKeyActs,nCopy; - - if ((xkb->server->key_acts[i]==0)&&(i!=key)) - continue; - - nCopy= nKeyActs= XkbKeyNumActions(xkb,i); - if (i==key) { - nKeyActs= needed; - if (needed0) - memcpy(&newActs[nActs],XkbKeyActionsPtr(xkb,i), - nCopy*sizeof(XkbAction)); - if (nCopyserver->key_acts[i]= nActs; - nActs+= nKeyActs; - } - _XkbFree(xkb->server->acts); - xkb->server->acts = newActs; - xkb->server->num_acts= nActs; - return &xkb->server->acts[xkb->server->key_acts[key]]; -} - -void -XkbFreeClientMap(XkbDescPtr xkb,unsigned what,Bool freeMap) -{ -XkbClientMapPtr map; - - if ((xkb==NULL)||(xkb->map==NULL)) - return; - if (freeMap) - what= XkbAllClientInfoMask; - map= xkb->map; - if (what&XkbKeyTypesMask) { - if (map->types!=NULL) { - if (map->num_types>0) { - register int i; - XkbKeyTypePtr type; - for (i=0,type=map->types;inum_types;i++,type++) { - if (type->map!=NULL) { - _XkbFree(type->map); - type->map= NULL; - } - if (type->preserve!=NULL) { - _XkbFree(type->preserve); - type->preserve= NULL; - } - type->map_count= 0; - if (type->level_names!=NULL) { - _XkbFree(type->level_names); - type->level_names= NULL; - } - } - } - _XkbFree(map->types); - map->num_types= map->size_types= 0; - map->types= NULL; - } - } - if (what&XkbKeySymsMask) { - if (map->key_sym_map!=NULL) { - _XkbFree(map->key_sym_map); - map->key_sym_map= NULL; - } - if (map->syms!=NULL) { - _XkbFree(map->syms); - map->size_syms= map->num_syms= 0; - map->syms= NULL; - } - } - if ((what&XkbModifierMapMask)&&(map->modmap!=NULL)) { - _XkbFree(map->modmap); - map->modmap= NULL; - } - if (freeMap) { - _XkbFree(xkb->map); - xkb->map= NULL; - } - return; -} - -void -XkbFreeServerMap(XkbDescPtr xkb,unsigned what,Bool freeMap) -{ -XkbServerMapPtr map; - - if ((xkb==NULL)||(xkb->server==NULL)) - return; - if (freeMap) - what= XkbAllServerInfoMask; - map= xkb->server; - if ((what&XkbExplicitComponentsMask)&&(map->explicit!=NULL)) { - _XkbFree(map->explicit); - map->explicit= NULL; - } - if (what&XkbKeyActionsMask) { - if (map->key_acts!=NULL) { - _XkbFree(map->key_acts); - map->key_acts= NULL; - } - if (map->acts!=NULL) { - _XkbFree(map->acts); - map->num_acts= map->size_acts= 0; - map->acts= NULL; - } - } - if ((what&XkbKeyBehaviorsMask)&&(map->behaviors!=NULL)) { - _XkbFree(map->behaviors); - map->behaviors= NULL; - } - if ((what&XkbVirtualModMapMask)&&(map->vmodmap!=NULL)) { - _XkbFree(map->vmodmap); - map->vmodmap= NULL; - } - - if (freeMap) { - _XkbFree(xkb->server); - xkb->server= NULL; - } - return; -} diff --git a/nx-X11/lib/X11/Xlib.h.NX.original b/nx-X11/lib/X11/Xlib.h.NX.original deleted file mode 100644 index e21d9ffac..000000000 --- a/nx-X11/lib/X11/Xlib.h.NX.original +++ /dev/null @@ -1,4029 +0,0 @@ -/* $XdotOrg: xc/lib/X11/Xlib.h,v 1.6 2005/11/08 06:33:25 jkj Exp $ */ -/* $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $ */ -/* - -Copyright 1985, 1986, 1987, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/Xlib.h,v 3.25 2003/11/17 22:20:10 dawes Exp $ */ - - -/* - * Xlib.h - Header definition and support file for the C subroutine - * interface library (Xlib) to the X Window System Protocol (V11). - * Structures and symbols starting with "_" are private to the library. - */ -#ifndef _XLIB_H_ -#define _XLIB_H_ - -#define XlibSpecificationRelease 6 - -#ifdef USG -#ifndef __TYPES__ -#include /* forgot to protect it... */ -#define __TYPES__ -#endif /* __TYPES__ */ -#else -#if defined(_POSIX_SOURCE) && defined(MOTOROLA) -#undef _POSIX_SOURCE -#include -#define _POSIX_SOURCE -#else -#include -#endif -#endif /* USG */ - -#if defined(__SCO__) || defined(__UNIXWARE__) -#include -#endif - -#include - -/* applications should not depend on these two headers being included! */ -#include -#include - -#ifndef X_WCHAR -#ifdef X_NOT_STDC_ENV -#ifndef ISC -#define X_WCHAR -#endif -#endif -#endif - -#ifndef X_WCHAR -#include -#else -#ifdef __UNIXOS2__ -#include -#else -/* replace this with #include or typedef appropriate for your system */ -typedef unsigned long wchar_t; -#endif -#endif - -#if defined(ISC) && defined(USE_XMBTOWC) -#define wctomb(a,b) _Xwctomb(a,b) -#define mblen(a,b) _Xmblen(a,b) -#ifndef USE_XWCHAR_STRING -#define mbtowc(a,b,c) _Xmbtowc(a,b,c) -#endif -#endif - -extern int -_Xmblen( -#ifdef ISC - char const *str, - size_t len -#else - char *str, - int len -#endif - ); - -/* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in - November 2000. Its presence is indicated through the following macro. */ -#define X_HAVE_UTF8_STRING 1 - -typedef char *XPointer; - -#define Bool int -#define Status int -#define True 1 -#define False 0 - -#define QueuedAlready 0 -#define QueuedAfterReading 1 -#define QueuedAfterFlush 2 - -#define ConnectionNumber(dpy) (((_XPrivDisplay)dpy)->fd) -#define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root) -#define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen) -#define DefaultRootWindow(dpy) (ScreenOfDisplay(dpy,DefaultScreen(dpy))->root) -#define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual) -#define DefaultGC(dpy, scr) (ScreenOfDisplay(dpy,scr)->default_gc) -#define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel) -#define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel) -#define AllPlanes ((unsigned long)~0L) -#define QLength(dpy) (((_XPrivDisplay)dpy)->qlen) -#define DisplayWidth(dpy, scr) (ScreenOfDisplay(dpy,scr)->width) -#define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height) -#define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth) -#define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight) -#define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) -#define DisplayCells(dpy, scr) (DefaultVisual(dpy,scr)->map_entries) -#define ScreenCount(dpy) (((_XPrivDisplay)dpy)->nscreens) -#define ServerVendor(dpy) (((_XPrivDisplay)dpy)->vendor) -#define ProtocolVersion(dpy) (((_XPrivDisplay)dpy)->proto_major_version) -#define ProtocolRevision(dpy) (((_XPrivDisplay)dpy)->proto_minor_version) -#define VendorRelease(dpy) (((_XPrivDisplay)dpy)->release) -#define DisplayString(dpy) (((_XPrivDisplay)dpy)->display_name) -#define DefaultDepth(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) -#define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap) -#define BitmapUnit(dpy) (((_XPrivDisplay)dpy)->bitmap_unit) -#define BitmapBitOrder(dpy) (((_XPrivDisplay)dpy)->bitmap_bit_order) -#define BitmapPad(dpy) (((_XPrivDisplay)dpy)->bitmap_pad) -#define ImageByteOrder(dpy) (((_XPrivDisplay)dpy)->byte_order) -#ifdef CRAY /* unable to get WORD64 without pulling in other symbols */ -#define NextRequest(dpy) XNextRequest(dpy) -#else -#define NextRequest(dpy) (((_XPrivDisplay)dpy)->request + 1) -#endif -#define LastKnownRequestProcessed(dpy) (((_XPrivDisplay)dpy)->last_request_read) - -/* macros for screen oriented applications (toolkit) */ -#define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr]) -#define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy)) -#define DisplayOfScreen(s) ((s)->display) -#define RootWindowOfScreen(s) ((s)->root) -#define BlackPixelOfScreen(s) ((s)->black_pixel) -#define WhitePixelOfScreen(s) ((s)->white_pixel) -#define DefaultColormapOfScreen(s)((s)->cmap) -#define DefaultDepthOfScreen(s) ((s)->root_depth) -#define DefaultGCOfScreen(s) ((s)->default_gc) -#define DefaultVisualOfScreen(s)((s)->root_visual) -#define WidthOfScreen(s) ((s)->width) -#define HeightOfScreen(s) ((s)->height) -#define WidthMMOfScreen(s) ((s)->mwidth) -#define HeightMMOfScreen(s) ((s)->mheight) -#define PlanesOfScreen(s) ((s)->root_depth) -#define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries) -#define MinCmapsOfScreen(s) ((s)->min_maps) -#define MaxCmapsOfScreen(s) ((s)->max_maps) -#define DoesSaveUnders(s) ((s)->save_unders) -#define DoesBackingStore(s) ((s)->backing_store) -#define EventMaskOfScreen(s) ((s)->root_input_mask) - -/* - * Extensions need a way to hang private data on some structures. - */ -typedef struct _XExtData { - int number; /* number returned by XRegisterExtension */ - struct _XExtData *next; /* next item on list of data for structure */ - int (*free_private)( /* called to free private storage */ - struct _XExtData *extension - ); - XPointer private_data; /* data private to this extension. */ -} XExtData; - -/* - * This file contains structures used by the extension mechanism. - */ -typedef struct { /* public to extension, cannot be changed */ - int extension; /* extension number */ - int major_opcode; /* major op-code assigned by server */ - int first_event; /* first event number for the extension */ - int first_error; /* first error number for the extension */ -} XExtCodes; - -/* - * Data structure for retrieving info about pixmap formats. - */ - -typedef struct { - int depth; - int bits_per_pixel; - int scanline_pad; -} XPixmapFormatValues; - - -/* - * Data structure for setting graphics context. - */ -typedef struct { - int function; /* logical operation */ - unsigned long plane_mask;/* plane mask */ - unsigned long foreground;/* foreground pixel */ - unsigned long background;/* background pixel */ - int line_width; /* line width */ - int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ - int cap_style; /* CapNotLast, CapButt, - CapRound, CapProjecting */ - int join_style; /* JoinMiter, JoinRound, JoinBevel */ - int fill_style; /* FillSolid, FillTiled, - FillStippled, FillOpaeueStippled */ - int fill_rule; /* EvenOddRule, WindingRule */ - int arc_mode; /* ArcChord, ArcPieSlice */ - Pixmap tile; /* tile pixmap for tiling operations */ - Pixmap stipple; /* stipple 1 plane pixmap for stipping */ - int ts_x_origin; /* offset for tile or stipple operations */ - int ts_y_origin; - Font font; /* default text font for text operations */ - int subwindow_mode; /* ClipByChildren, IncludeInferiors */ - Bool graphics_exposures;/* boolean, should exposures be generated */ - int clip_x_origin; /* origin for clipping */ - int clip_y_origin; - Pixmap clip_mask; /* bitmap clipping; other calls for rects */ - int dash_offset; /* patterned/dashed line information */ - char dashes; -} XGCValues; - -/* - * Graphics context. The contents of this structure are implementation - * dependent. A GC should be treated as opaque by application code. - */ - -typedef struct _XGC -#ifdef XLIB_ILLEGAL_ACCESS -{ - XExtData *ext_data; /* hook for extension to hang data */ - GContext gid; /* protocol ID for graphics context */ - /* there is more to this structure, but it is private to Xlib */ -} -#endif -*GC; - -/* - * Visual structure; contains information about colormapping possible. - */ -typedef struct { - XExtData *ext_data; /* hook for extension to hang data */ - VisualID visualid; /* visual id of this visual */ -#if defined(__cplusplus) || defined(c_plusplus) - int c_class; /* C++ class of screen (monochrome, etc.) */ -#else - int class; /* class of screen (monochrome, etc.) */ -#endif - unsigned long red_mask, green_mask, blue_mask; /* mask values */ - int bits_per_rgb; /* log base 2 of distinct color values */ - int map_entries; /* color map entries */ -} Visual; - -/* - * Depth structure; contains information for each possible depth. - */ -typedef struct { - int depth; /* this depth (Z) of the depth */ - int nvisuals; /* number of Visual types at this depth */ - Visual *visuals; /* list of visuals possible at this depth */ -} Depth; - -/* - * Information about the screen. The contents of this structure are - * implementation dependent. A Screen should be treated as opaque - * by application code. - */ - -struct _XDisplay; /* Forward declare before use for C++ */ - -typedef struct { - XExtData *ext_data; /* hook for extension to hang data */ - struct _XDisplay *display;/* back pointer to display structure */ - Window root; /* Root window id. */ - int width, height; /* width and height of screen */ - int mwidth, mheight; /* width and height of in millimeters */ - int ndepths; /* number of depths possible */ - Depth *depths; /* list of allowable depths on the screen */ - int root_depth; /* bits per pixel */ - Visual *root_visual; /* root visual */ - GC default_gc; /* GC for the root root visual */ - Colormap cmap; /* default color map */ - unsigned long white_pixel; - unsigned long black_pixel; /* White and Black pixel values */ - int max_maps, min_maps; /* max and min color maps */ - int backing_store; /* Never, WhenMapped, Always */ - Bool save_unders; - long root_input_mask; /* initial root input mask */ -} Screen; - -/* - * Format structure; describes ZFormat data the screen will understand. - */ -typedef struct { - XExtData *ext_data; /* hook for extension to hang data */ - int depth; /* depth of this image format */ - int bits_per_pixel; /* bits/pixel at this depth */ - int scanline_pad; /* scanline must padded to this multiple */ -} ScreenFormat; - -/* - * Data structure for setting window attributes. - */ -typedef struct { - Pixmap background_pixmap; /* background or None or ParentRelative */ - unsigned long background_pixel; /* background pixel */ - Pixmap border_pixmap; /* border of the window */ - unsigned long border_pixel; /* border pixel value */ - int bit_gravity; /* one of bit gravity values */ - int win_gravity; /* one of the window gravity values */ - int backing_store; /* NotUseful, WhenMapped, Always */ - unsigned long backing_planes;/* planes to be preseved if possible */ - unsigned long backing_pixel;/* value to use in restoring planes */ - Bool save_under; /* should bits under be saved? (popups) */ - long event_mask; /* set of events that should be saved */ - long do_not_propagate_mask; /* set of events that should not propagate */ - Bool override_redirect; /* boolean value for override-redirect */ - Colormap colormap; /* color map to be associated with window */ - Cursor cursor; /* cursor to be displayed (or None) */ -} XSetWindowAttributes; - -typedef struct { - int x, y; /* location of window */ - int width, height; /* width and height of window */ - int border_width; /* border width of window */ - int depth; /* depth of window */ - Visual *visual; /* the associated visual structure */ - Window root; /* root of screen containing window */ -#if defined(__cplusplus) || defined(c_plusplus) - int c_class; /* C++ InputOutput, InputOnly*/ -#else - int class; /* InputOutput, InputOnly*/ -#endif - int bit_gravity; /* one of bit gravity values */ - int win_gravity; /* one of the window gravity values */ - int backing_store; /* NotUseful, WhenMapped, Always */ - unsigned long backing_planes;/* planes to be preserved if possible */ - unsigned long backing_pixel;/* value to be used when restoring planes */ - Bool save_under; /* boolean, should bits under be saved? */ - Colormap colormap; /* color map to be associated with window */ - Bool map_installed; /* boolean, is color map currently installed*/ - int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ - long all_event_masks; /* set of events all people have interest in*/ - long your_event_mask; /* my event mask */ - long do_not_propagate_mask; /* set of events that should not propagate */ - Bool override_redirect; /* boolean value for override-redirect */ - Screen *screen; /* back pointer to correct screen */ -} XWindowAttributes; - -/* - * Data structure for host setting; getting routines. - * - */ - -typedef struct { - int family; /* for example FamilyInternet */ - int length; /* length of address, in bytes */ - char *address; /* pointer to where to find the bytes */ -} XHostAddress; - -/* - * Data structure for ServerFamilyInterpreted addresses in host routines - */ -typedef struct { - int typelength; /* length of type string, in bytes */ - int valuelength; /* length of value string, in bytes */ - char *type; /* pointer to where to find the type string */ - char *value; /* pointer to where to find the address */ -} XServerInterpretedAddress; - -/* - * Data structure for "image" data, used by image manipulation routines. - */ -typedef struct _XImage { - int width, height; /* size of image */ - int xoffset; /* number of pixels offset in X direction */ - int format; /* XYBitmap, XYPixmap, ZPixmap */ - char *data; /* pointer to image data */ - int byte_order; /* data byte order, LSBFirst, MSBFirst */ - int bitmap_unit; /* quant. of scanline 8, 16, 32 */ - int bitmap_bit_order; /* LSBFirst, MSBFirst */ - int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ - int depth; /* depth of image */ - int bytes_per_line; /* accelarator to next line */ - int bits_per_pixel; /* bits per pixel (ZPixmap) */ - unsigned long red_mask; /* bits in z arrangment */ - unsigned long green_mask; - unsigned long blue_mask; - XPointer obdata; /* hook for the object routines to hang on */ - struct funcs { /* image manipulation routines */ - struct _XImage *(*create_image)( - struct _XDisplay* /* display */, - Visual* /* visual */, - unsigned int /* depth */, - int /* format */, - int /* offset */, - char* /* data */, - unsigned int /* width */, - unsigned int /* height */, - int /* bitmap_pad */, - int /* bytes_per_line */); - int (*destroy_image) (struct _XImage *); - unsigned long (*get_pixel) (struct _XImage *, int, int); - int (*put_pixel) (struct _XImage *, int, int, unsigned long); - struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int); - int (*add_pixel) (struct _XImage *, long); - } f; -} XImage; - -/* - * Data structure for XReconfigureWindow - */ -typedef struct { - int x, y; - int width, height; - int border_width; - Window sibling; - int stack_mode; -} XWindowChanges; - -/* - * Data structure used by color operations - */ -typedef struct { - unsigned long pixel; - unsigned short red, green, blue; - char flags; /* do_red, do_green, do_blue */ - char pad; -} XColor; - -/* - * Data structures for graphics operations. On most machines, these are - * congruent with the wire protocol structures, so reformatting the data - * can be avoided on these architectures. - */ -typedef struct { - short x1, y1, x2, y2; -} XSegment; - -typedef struct { - short x, y; -} XPoint; - -typedef struct { - short x, y; - unsigned short width, height; -} XRectangle; - -typedef struct { - short x, y; - unsigned short width, height; - short angle1, angle2; -} XArc; - - -/* Data structure for XChangeKeyboardControl */ - -typedef struct { - int key_click_percent; - int bell_percent; - int bell_pitch; - int bell_duration; - int led; - int led_mode; - int key; - int auto_repeat_mode; /* On, Off, Default */ -} XKeyboardControl; - -/* Data structure for XGetKeyboardControl */ - -typedef struct { - int key_click_percent; - int bell_percent; - unsigned int bell_pitch, bell_duration; - unsigned long led_mask; - int global_auto_repeat; - char auto_repeats[32]; -} XKeyboardState; - -/* Data structure for XGetMotionEvents. */ - -typedef struct { - Time time; - short x, y; -} XTimeCoord; - -/* Data structure for X{Set,Get}ModifierMapping */ - -typedef struct { - int max_keypermod; /* The server's max # of keys per modifier */ - KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */ -} XModifierKeymap; - - -/* - * Display datatype maintaining display specific data. - * The contents of this structure are implementation dependent. - * A Display should be treated as opaque by application code. - */ -#ifndef XLIB_ILLEGAL_ACCESS -typedef struct _XDisplay Display; -#endif - -struct _XPrivate; /* Forward declare before use for C++ */ -struct _XrmHashBucketRec; - -typedef struct -#ifdef XLIB_ILLEGAL_ACCESS -_XDisplay -#endif -{ - XExtData *ext_data; /* hook for extension to hang data */ - struct _XPrivate *private1; - int fd; /* Network socket. */ - int private2; - int proto_major_version;/* major version of server's X protocol */ - int proto_minor_version;/* minor version of servers X protocol */ - char *vendor; /* vendor of the server hardware */ - XID private3; - XID private4; - XID private5; - int private6; - XID (*resource_alloc)( /* allocator function */ - struct _XDisplay* - ); - int byte_order; /* screen byte order, LSBFirst, MSBFirst */ - int bitmap_unit; /* padding and data requirements */ - int bitmap_pad; /* padding requirements on bitmaps */ - int bitmap_bit_order; /* LeastSignificant or MostSignificant */ - int nformats; /* number of pixmap formats in list */ - ScreenFormat *pixmap_format; /* pixmap format list */ - int private8; - int release; /* release of the server */ - struct _XPrivate *private9, *private10; - int qlen; /* Length of input event queue */ - unsigned long last_request_read; /* seq number of last event read */ - unsigned long request; /* sequence number of last request. */ - XPointer private11; - XPointer private12; - XPointer private13; - XPointer private14; - unsigned max_request_size; /* maximum number 32 bit words in request*/ - struct _XrmHashBucketRec *db; - int (*private15)( - struct _XDisplay* - ); - char *display_name; /* "host:display" string used on this connect*/ - int default_screen; /* default screen for operations */ - int nscreens; /* number of screens on this server*/ - Screen *screens; /* pointer to list of screens */ - unsigned long motion_buffer; /* size of motion buffer */ - unsigned long private16; - int min_keycode; /* minimum defined keycode */ - int max_keycode; /* maximum defined keycode */ - XPointer private17; - XPointer private18; - int private19; - char *xdefaults; /* contents of defaults from server */ - /* there is more to this structure, but it is private to Xlib */ -} -#ifdef XLIB_ILLEGAL_ACCESS -Display, -#endif -*_XPrivDisplay; - -#undef _XEVENT_ -#ifndef _XEVENT_ -/* - * Definitions of specific events. - */ -typedef struct { - int type; /* of event */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* "event" window it is reported relative to */ - Window root; /* root window that the event occurred on */ - Window subwindow; /* child window */ - Time time; /* milliseconds */ - int x, y; /* pointer x, y coordinates in event window */ - int x_root, y_root; /* coordinates relative to root */ - unsigned int state; /* key or button mask */ - unsigned int keycode; /* detail */ - Bool same_screen; /* same screen flag */ -} XKeyEvent; -typedef XKeyEvent XKeyPressedEvent; -typedef XKeyEvent XKeyReleasedEvent; - -typedef struct { - int type; /* of event */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* "event" window it is reported relative to */ - Window root; /* root window that the event occurred on */ - Window subwindow; /* child window */ - Time time; /* milliseconds */ - int x, y; /* pointer x, y coordinates in event window */ - int x_root, y_root; /* coordinates relative to root */ - unsigned int state; /* key or button mask */ - unsigned int button; /* detail */ - Bool same_screen; /* same screen flag */ -} XButtonEvent; -typedef XButtonEvent XButtonPressedEvent; -typedef XButtonEvent XButtonReleasedEvent; - -typedef struct { - int type; /* of event */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* "event" window reported relative to */ - Window root; /* root window that the event occurred on */ - Window subwindow; /* child window */ - Time time; /* milliseconds */ - int x, y; /* pointer x, y coordinates in event window */ - int x_root, y_root; /* coordinates relative to root */ - unsigned int state; /* key or button mask */ - char is_hint; /* detail */ - Bool same_screen; /* same screen flag */ -} XMotionEvent; -typedef XMotionEvent XPointerMovedEvent; - -typedef struct { - int type; /* of event */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* "event" window reported relative to */ - Window root; /* root window that the event occurred on */ - Window subwindow; /* child window */ - Time time; /* milliseconds */ - int x, y; /* pointer x, y coordinates in event window */ - int x_root, y_root; /* coordinates relative to root */ - int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ - int detail; - /* - * NotifyAncestor, NotifyVirtual, NotifyInferior, - * NotifyNonlinear,NotifyNonlinearVirtual - */ - Bool same_screen; /* same screen flag */ - Bool focus; /* boolean focus */ - unsigned int state; /* key or button mask */ -} XCrossingEvent; -typedef XCrossingEvent XEnterWindowEvent; -typedef XCrossingEvent XLeaveWindowEvent; - -typedef struct { - int type; /* FocusIn or FocusOut */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* window of event */ - int mode; /* NotifyNormal, NotifyWhileGrabbed, - NotifyGrab, NotifyUngrab */ - int detail; - /* - * NotifyAncestor, NotifyVirtual, NotifyInferior, - * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, - * NotifyPointerRoot, NotifyDetailNone - */ -} XFocusChangeEvent; -typedef XFocusChangeEvent XFocusInEvent; -typedef XFocusChangeEvent XFocusOutEvent; - -/* generated on EnterWindow and FocusIn when KeyMapState selected */ -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - char key_vector[32]; -} XKeymapEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - int x, y; - int width, height; - int count; /* if non-zero, at least this many more */ -} XExposeEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Drawable drawable; - int x, y; - int width, height; - int count; /* if non-zero, at least this many more */ - int major_code; /* core is CopyArea or CopyPlane */ - int minor_code; /* not defined in the core */ -} XGraphicsExposeEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Drawable drawable; - int major_code; /* core is CopyArea or CopyPlane */ - int minor_code; /* not defined in the core */ -} XNoExposeEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - int state; /* Visibility state */ -} XVisibilityEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; /* parent of the window */ - Window window; /* window id of window created */ - int x, y; /* window location */ - int width, height; /* size of window */ - int border_width; /* border width */ - Bool override_redirect; /* creation should be overridden */ -} XCreateWindowEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; -} XDestroyWindowEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - Bool from_configure; -} XUnmapEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - Bool override_redirect; /* boolean, is override set... */ -} XMapEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; - Window window; -} XMapRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - Window parent; - int x, y; - Bool override_redirect; -} XReparentEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - int x, y; - int width, height; - int border_width; - Window above; - Bool override_redirect; -} XConfigureEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - int x, y; -} XGravityEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - int width, height; -} XResizeRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; - Window window; - int x, y; - int width, height; - int border_width; - Window above; - int detail; /* Above, Below, TopIf, BottomIf, Opposite */ - unsigned long value_mask; -} XConfigureRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - int place; /* PlaceOnTop, PlaceOnBottom */ -} XCirculateEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; - Window window; - int place; /* PlaceOnTop, PlaceOnBottom */ -} XCirculateRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - Atom atom; - Time time; - int state; /* NewValue, Deleted */ -} XPropertyEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - Atom selection; - Time time; -} XSelectionClearEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window owner; - Window requestor; - Atom selection; - Atom target; - Atom property; - Time time; -} XSelectionRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window requestor; - Atom selection; - Atom target; - Atom property; /* ATOM or None */ - Time time; -} XSelectionEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - Colormap colormap; /* COLORMAP or None */ -#if defined(__cplusplus) || defined(c_plusplus) - Bool c_new; /* C++ */ -#else - Bool new; -#endif - int state; /* ColormapInstalled, ColormapUninstalled */ -} XColormapEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - Atom message_type; - int format; - union { - char b[20]; - short s[10]; - long l[5]; - } data; -} XClientMessageEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* unused */ - int request; /* one of MappingModifier, MappingKeyboard, - MappingPointer */ - int first_keycode; /* first keycode */ - int count; /* defines range of change w. first_keycode*/ -} XMappingEvent; - -typedef struct { - int type; - Display *display; /* Display the event was read from */ - XID resourceid; /* resource id */ - unsigned long serial; /* serial number of failed request */ - unsigned char error_code; /* error code of failed request */ - unsigned char request_code; /* Major op-code of failed request */ - unsigned char minor_code; /* Minor op-code of failed request */ -} XErrorEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display;/* Display the event was read from */ - Window window; /* window on which event was requested in event mask */ -} XAnyEvent; - -/* - * this union is defined so Xlib can always use the same sized - * event structure internally, to avoid memory fragmentation. - */ -typedef union _XEvent { - int type; /* must not be changed; first element */ - XAnyEvent xany; - XKeyEvent xkey; - XButtonEvent xbutton; - XMotionEvent xmotion; - XCrossingEvent xcrossing; - XFocusChangeEvent xfocus; - XExposeEvent xexpose; - XGraphicsExposeEvent xgraphicsexpose; - XNoExposeEvent xnoexpose; - XVisibilityEvent xvisibility; - XCreateWindowEvent xcreatewindow; - XDestroyWindowEvent xdestroywindow; - XUnmapEvent xunmap; - XMapEvent xmap; - XMapRequestEvent xmaprequest; - XReparentEvent xreparent; - XConfigureEvent xconfigure; - XGravityEvent xgravity; - XResizeRequestEvent xresizerequest; - XConfigureRequestEvent xconfigurerequest; - XCirculateEvent xcirculate; - XCirculateRequestEvent xcirculaterequest; - XPropertyEvent xproperty; - XSelectionClearEvent xselectionclear; - XSelectionRequestEvent xselectionrequest; - XSelectionEvent xselection; - XColormapEvent xcolormap; - XClientMessageEvent xclient; - XMappingEvent xmapping; - XErrorEvent xerror; - XKeymapEvent xkeymap; - long pad[24]; -} XEvent; -#endif - -#define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy))) - -/* - * per character font metric information. - */ -typedef struct { - short lbearing; /* origin to left edge of raster */ - short rbearing; /* origin to right edge of raster */ - short width; /* advance to next char's origin */ - short ascent; /* baseline to top edge of raster */ - short descent; /* baseline to bottom edge of raster */ - unsigned short attributes; /* per char flags (not predefined) */ -} XCharStruct; - -/* - * To allow arbitrary information with fonts, there are additional properties - * returned. - */ -typedef struct { - Atom name; - unsigned long card32; -} XFontProp; - -typedef struct { - XExtData *ext_data; /* hook for extension to hang data */ - Font fid; /* Font id for this font */ - unsigned direction; /* hint about direction the font is painted */ - unsigned min_char_or_byte2;/* first character */ - unsigned max_char_or_byte2;/* last character */ - unsigned min_byte1; /* first row that exists */ - unsigned max_byte1; /* last row that exists */ - Bool all_chars_exist;/* flag if all characters have non-zero size*/ - unsigned default_char; /* char to print for undefined character */ - int n_properties; /* how many properties there are */ - XFontProp *properties; /* pointer to array of additional properties*/ - XCharStruct min_bounds; /* minimum bounds over all existing char*/ - XCharStruct max_bounds; /* maximum bounds over all existing char*/ - XCharStruct *per_char; /* first_char to last_char information */ - int ascent; /* log. extent above baseline for spacing */ - int descent; /* log. descent below baseline for spacing */ -} XFontStruct; - -/* - * PolyText routines take these as arguments. - */ -typedef struct { - char *chars; /* pointer to string */ - int nchars; /* number of characters */ - int delta; /* delta between strings */ - Font font; /* font to print it in, None don't change */ -} XTextItem; - -typedef struct { /* normal 16 bit characters are two bytes */ - unsigned char byte1; - unsigned char byte2; -} XChar2b; - -typedef struct { - XChar2b *chars; /* two byte characters */ - int nchars; /* number of characters */ - int delta; /* delta between strings */ - Font font; /* font to print it in, None don't change */ -} XTextItem16; - - -typedef union { Display *display; - GC gc; - Visual *visual; - Screen *screen; - ScreenFormat *pixmap_format; - XFontStruct *font; } XEDataObject; - -typedef struct { - XRectangle max_ink_extent; - XRectangle max_logical_extent; -} XFontSetExtents; - -/* unused: -typedef void (*XOMProc)(); - */ - -typedef struct _XOM *XOM; -typedef struct _XOC *XOC, *XFontSet; - -typedef struct { - char *chars; - int nchars; - int delta; - XFontSet font_set; -} XmbTextItem; - -typedef struct { - wchar_t *chars; - int nchars; - int delta; - XFontSet font_set; -} XwcTextItem; - -#define XNRequiredCharSet "requiredCharSet" -#define XNQueryOrientation "queryOrientation" -#define XNBaseFontName "baseFontName" -#define XNOMAutomatic "omAutomatic" -#define XNMissingCharSet "missingCharSet" -#define XNDefaultString "defaultString" -#define XNOrientation "orientation" -#define XNDirectionalDependentDrawing "directionalDependentDrawing" -#define XNContextualDrawing "contextualDrawing" -#define XNFontInfo "fontInfo" - -typedef struct { - int charset_count; - char **charset_list; -} XOMCharSetList; - -typedef enum { - XOMOrientation_LTR_TTB, - XOMOrientation_RTL_TTB, - XOMOrientation_TTB_LTR, - XOMOrientation_TTB_RTL, - XOMOrientation_Context -} XOrientation; - -typedef struct { - int num_orientation; - XOrientation *orientation; /* Input Text description */ -} XOMOrientation; - -typedef struct { - int num_font; - XFontStruct **font_struct_list; - char **font_name_list; -} XOMFontInfo; - -typedef struct _XIM *XIM; -typedef struct _XIC *XIC; - -typedef void (*XIMProc)( - XIM, - XPointer, - XPointer -); - -typedef Bool (*XICProc)( - XIC, - XPointer, - XPointer -); - -typedef void (*XIDProc)( - Display*, - XPointer, - XPointer -); - -typedef unsigned long XIMStyle; - -typedef struct { - unsigned short count_styles; - XIMStyle *supported_styles; -} XIMStyles; - -#define XIMPreeditArea 0x0001L -#define XIMPreeditCallbacks 0x0002L -#define XIMPreeditPosition 0x0004L -#define XIMPreeditNothing 0x0008L -#define XIMPreeditNone 0x0010L -#define XIMStatusArea 0x0100L -#define XIMStatusCallbacks 0x0200L -#define XIMStatusNothing 0x0400L -#define XIMStatusNone 0x0800L - -#define XNVaNestedList "XNVaNestedList" -#define XNQueryInputStyle "queryInputStyle" -#define XNClientWindow "clientWindow" -#define XNInputStyle "inputStyle" -#define XNFocusWindow "focusWindow" -#define XNResourceName "resourceName" -#define XNResourceClass "resourceClass" -#define XNGeometryCallback "geometryCallback" -#define XNDestroyCallback "destroyCallback" -#define XNFilterEvents "filterEvents" -#define XNPreeditStartCallback "preeditStartCallback" -#define XNPreeditDoneCallback "preeditDoneCallback" -#define XNPreeditDrawCallback "preeditDrawCallback" -#define XNPreeditCaretCallback "preeditCaretCallback" -#define XNPreeditStateNotifyCallback "preeditStateNotifyCallback" -#define XNPreeditAttributes "preeditAttributes" -#define XNStatusStartCallback "statusStartCallback" -#define XNStatusDoneCallback "statusDoneCallback" -#define XNStatusDrawCallback "statusDrawCallback" -#define XNStatusAttributes "statusAttributes" -#define XNArea "area" -#define XNAreaNeeded "areaNeeded" -#define XNSpotLocation "spotLocation" -#define XNColormap "colorMap" -#define XNStdColormap "stdColorMap" -#define XNForeground "foreground" -#define XNBackground "background" -#define XNBackgroundPixmap "backgroundPixmap" -#define XNFontSet "fontSet" -#define XNLineSpace "lineSpace" -#define XNCursor "cursor" - -#define XNQueryIMValuesList "queryIMValuesList" -#define XNQueryICValuesList "queryICValuesList" -#define XNVisiblePosition "visiblePosition" -#define XNR6PreeditCallback "r6PreeditCallback" -#define XNStringConversionCallback "stringConversionCallback" -#define XNStringConversion "stringConversion" -#define XNResetState "resetState" -#define XNHotKey "hotKey" -#define XNHotKeyState "hotKeyState" -#define XNPreeditState "preeditState" -#define XNSeparatorofNestedList "separatorofNestedList" - -#define XBufferOverflow -1 -#define XLookupNone 1 -#define XLookupChars 2 -#define XLookupKeySym 3 -#define XLookupBoth 4 - -typedef void *XVaNestedList; - -typedef struct { - XPointer client_data; - XIMProc callback; -} XIMCallback; - -typedef struct { - XPointer client_data; - XICProc callback; -} XICCallback; - -typedef unsigned long XIMFeedback; - -#define XIMReverse 1L -#define XIMUnderline (1L<<1) -#define XIMHighlight (1L<<2) -#define XIMPrimary (1L<<5) -#define XIMSecondary (1L<<6) -#define XIMTertiary (1L<<7) -#define XIMVisibleToForward (1L<<8) -#define XIMVisibleToBackword (1L<<9) -#define XIMVisibleToCenter (1L<<10) - -typedef struct _XIMText { - unsigned short length; - XIMFeedback *feedback; - Bool encoding_is_wchar; - union { - char *multi_byte; - wchar_t *wide_char; - } string; -} XIMText; - -typedef unsigned long XIMPreeditState; - -#define XIMPreeditUnKnown 0L -#define XIMPreeditEnable 1L -#define XIMPreeditDisable (1L<<1) - -typedef struct _XIMPreeditStateNotifyCallbackStruct { - XIMPreeditState state; -} XIMPreeditStateNotifyCallbackStruct; - -typedef unsigned long XIMResetState; - -#define XIMInitialState 1L -#define XIMPreserveState (1L<<1) - -typedef unsigned long XIMStringConversionFeedback; - -#define XIMStringConversionLeftEdge (0x00000001) -#define XIMStringConversionRightEdge (0x00000002) -#define XIMStringConversionTopEdge (0x00000004) -#define XIMStringConversionBottomEdge (0x00000008) -#define XIMStringConversionConcealed (0x00000010) -#define XIMStringConversionWrapped (0x00000020) - -typedef struct _XIMStringConversionText { - unsigned short length; - XIMStringConversionFeedback *feedback; - Bool encoding_is_wchar; - union { - char *mbs; - wchar_t *wcs; - } string; -} XIMStringConversionText; - -typedef unsigned short XIMStringConversionPosition; - -typedef unsigned short XIMStringConversionType; - -#define XIMStringConversionBuffer (0x0001) -#define XIMStringConversionLine (0x0002) -#define XIMStringConversionWord (0x0003) -#define XIMStringConversionChar (0x0004) - -typedef unsigned short XIMStringConversionOperation; - -#define XIMStringConversionSubstitution (0x0001) -#define XIMStringConversionRetrieval (0x0002) - -typedef enum { - XIMForwardChar, XIMBackwardChar, - XIMForwardWord, XIMBackwardWord, - XIMCaretUp, XIMCaretDown, - XIMNextLine, XIMPreviousLine, - XIMLineStart, XIMLineEnd, - XIMAbsolutePosition, - XIMDontChange -} XIMCaretDirection; - -typedef struct _XIMStringConversionCallbackStruct { - XIMStringConversionPosition position; - XIMCaretDirection direction; - XIMStringConversionOperation operation; - unsigned short factor; - XIMStringConversionText *text; -} XIMStringConversionCallbackStruct; - -typedef struct _XIMPreeditDrawCallbackStruct { - int caret; /* Cursor offset within pre-edit string */ - int chg_first; /* Starting change position */ - int chg_length; /* Length of the change in character count */ - XIMText *text; -} XIMPreeditDrawCallbackStruct; - -typedef enum { - XIMIsInvisible, /* Disable caret feedback */ - XIMIsPrimary, /* UI defined caret feedback */ - XIMIsSecondary /* UI defined caret feedback */ -} XIMCaretStyle; - -typedef struct _XIMPreeditCaretCallbackStruct { - int position; /* Caret offset within pre-edit string */ - XIMCaretDirection direction; /* Caret moves direction */ - XIMCaretStyle style; /* Feedback of the caret */ -} XIMPreeditCaretCallbackStruct; - -typedef enum { - XIMTextType, - XIMBitmapType -} XIMStatusDataType; - -typedef struct _XIMStatusDrawCallbackStruct { - XIMStatusDataType type; - union { - XIMText *text; - Pixmap bitmap; - } data; -} XIMStatusDrawCallbackStruct; - -typedef struct _XIMHotKeyTrigger { - KeySym keysym; - int modifier; - int modifier_mask; -} XIMHotKeyTrigger; - -typedef struct _XIMHotKeyTriggers { - int num_hot_key; - XIMHotKeyTrigger *key; -} XIMHotKeyTriggers; - -typedef unsigned long XIMHotKeyState; - -#define XIMHotKeyStateON (0x0001L) -#define XIMHotKeyStateOFF (0x0002L) - -typedef struct { - unsigned short count_values; - char **supported_values; -} XIMValuesList; - -_XFUNCPROTOBEGIN - -#if defined(WIN32) && !defined(_XLIBINT_) -#define _Xdebug (*_Xdebug_p) -#endif - -extern int _Xdebug; - -extern XFontStruct *XLoadQueryFont( - Display* /* display */, - _Xconst char* /* name */ -); - -extern XFontStruct *XQueryFont( - Display* /* display */, - XID /* font_ID */ -); - - -extern XTimeCoord *XGetMotionEvents( - Display* /* display */, - Window /* w */, - Time /* start */, - Time /* stop */, - int* /* nevents_return */ -); - -extern XModifierKeymap *XDeleteModifiermapEntry( - XModifierKeymap* /* modmap */, -#if NeedWidePrototypes - unsigned int /* keycode_entry */, -#else - KeyCode /* keycode_entry */, -#endif - int /* modifier */ -); - -extern XModifierKeymap *XGetModifierMapping( - Display* /* display */ -); - -extern XModifierKeymap *XInsertModifiermapEntry( - XModifierKeymap* /* modmap */, -#if NeedWidePrototypes - unsigned int /* keycode_entry */, -#else - KeyCode /* keycode_entry */, -#endif - int /* modifier */ -); - -extern XModifierKeymap *XNewModifiermap( - int /* max_keys_per_mod */ -); - -extern XImage *XCreateImage( - Display* /* display */, - Visual* /* visual */, - unsigned int /* depth */, - int /* format */, - int /* offset */, - char* /* data */, - unsigned int /* width */, - unsigned int /* height */, - int /* bitmap_pad */, - int /* bytes_per_line */ -); -extern Status XInitImage( - XImage* /* image */ -); -extern XImage *XGetImage( - Display* /* display */, - Drawable /* d */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - unsigned long /* plane_mask */, - int /* format */ -); -extern XImage *XGetSubImage( - Display* /* display */, - Drawable /* d */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - unsigned long /* plane_mask */, - int /* format */, - XImage* /* dest_image */, - int /* dest_x */, - int /* dest_y */ -); - -/* - * X function declarations. - */ -extern Display *XOpenDisplay( - _Xconst char* /* display_name */ -); - -extern void XrmInitialize( - void -); - -extern char *XFetchBytes( - Display* /* display */, - int* /* nbytes_return */ -); -extern char *XFetchBuffer( - Display* /* display */, - int* /* nbytes_return */, - int /* buffer */ -); -extern char *XGetAtomName( - Display* /* display */, - Atom /* atom */ -); -extern Status XGetAtomNames( - Display* /* dpy */, - Atom* /* atoms */, - int /* count */, - char** /* names_return */ -); -extern char *XGetDefault( - Display* /* display */, - _Xconst char* /* program */, - _Xconst char* /* option */ -); -extern char *XDisplayName( - _Xconst char* /* string */ -); -extern char *XKeysymToString( - KeySym /* keysym */ -); - -extern int (*XSynchronize( - Display* /* display */, - Bool /* onoff */ -))( - Display* /* display */ -); -extern int (*XSetAfterFunction( - Display* /* display */, - int (*) ( - Display* /* display */ - ) /* procedure */ -))( - Display* /* display */ -); -extern Atom XInternAtom( - Display* /* display */, - _Xconst char* /* atom_name */, - Bool /* only_if_exists */ -); -extern Status XInternAtoms( - Display* /* dpy */, - char** /* names */, - int /* count */, - Bool /* onlyIfExists */, - Atom* /* atoms_return */ -); -extern Colormap XCopyColormapAndFree( - Display* /* display */, - Colormap /* colormap */ -); -extern Colormap XCreateColormap( - Display* /* display */, - Window /* w */, - Visual* /* visual */, - int /* alloc */ -); -extern Cursor XCreatePixmapCursor( - Display* /* display */, - Pixmap /* source */, - Pixmap /* mask */, - XColor* /* foreground_color */, - XColor* /* background_color */, - unsigned int /* x */, - unsigned int /* y */ -); -extern Cursor XCreateGlyphCursor( - Display* /* display */, - Font /* source_font */, - Font /* mask_font */, - unsigned int /* source_char */, - unsigned int /* mask_char */, - XColor _Xconst * /* foreground_color */, - XColor _Xconst * /* background_color */ -); -extern Cursor XCreateFontCursor( - Display* /* display */, - unsigned int /* shape */ -); -extern Font XLoadFont( - Display* /* display */, - _Xconst char* /* name */ -); -extern GC XCreateGC( - Display* /* display */, - Drawable /* d */, - unsigned long /* valuemask */, - XGCValues* /* values */ -); -extern GContext XGContextFromGC( - GC /* gc */ -); -extern void XFlushGC( - Display* /* display */, - GC /* gc */ -); -extern Pixmap XCreatePixmap( - Display* /* display */, - Drawable /* d */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int /* depth */ -); -extern Pixmap XCreateBitmapFromData( - Display* /* display */, - Drawable /* d */, - _Xconst char* /* data */, - unsigned int /* width */, - unsigned int /* height */ -); -extern Pixmap XCreatePixmapFromBitmapData( - Display* /* display */, - Drawable /* d */, - char* /* data */, - unsigned int /* width */, - unsigned int /* height */, - unsigned long /* fg */, - unsigned long /* bg */, - unsigned int /* depth */ -); -extern Window XCreateSimpleWindow( - Display* /* display */, - Window /* parent */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int /* border_width */, - unsigned long /* border */, - unsigned long /* background */ -); -extern Window XGetSelectionOwner( - Display* /* display */, - Atom /* selection */ -); -extern Window XCreateWindow( - Display* /* display */, - Window /* parent */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int /* border_width */, - int /* depth */, - unsigned int /* class */, - Visual* /* visual */, - unsigned long /* valuemask */, - XSetWindowAttributes* /* attributes */ -); -extern Colormap *XListInstalledColormaps( - Display* /* display */, - Window /* w */, - int* /* num_return */ -); -extern char **XListFonts( - Display* /* display */, - _Xconst char* /* pattern */, - int /* maxnames */, - int* /* actual_count_return */ -); -extern char **XListFontsWithInfo( - Display* /* display */, - _Xconst char* /* pattern */, - int /* maxnames */, - int* /* count_return */, - XFontStruct** /* info_return */ -); -extern char **XGetFontPath( - Display* /* display */, - int* /* npaths_return */ -); -extern char **XListExtensions( - Display* /* display */, - int* /* nextensions_return */ -); -extern Atom *XListProperties( - Display* /* display */, - Window /* w */, - int* /* num_prop_return */ -); -extern XHostAddress *XListHosts( - Display* /* display */, - int* /* nhosts_return */, - Bool* /* state_return */ -); -extern KeySym XKeycodeToKeysym( - Display* /* display */, -#if NeedWidePrototypes - unsigned int /* keycode */, -#else - KeyCode /* keycode */, -#endif - int /* index */ -); -extern KeySym XLookupKeysym( - XKeyEvent* /* key_event */, - int /* index */ -); -extern KeySym *XGetKeyboardMapping( - Display* /* display */, -#if NeedWidePrototypes - unsigned int /* first_keycode */, -#else - KeyCode /* first_keycode */, -#endif - int /* keycode_count */, - int* /* keysyms_per_keycode_return */ -); -extern KeySym XStringToKeysym( - _Xconst char* /* string */ -); -extern long XMaxRequestSize( - Display* /* display */ -); -extern long XExtendedMaxRequestSize( - Display* /* display */ -); -extern char *XResourceManagerString( - Display* /* display */ -); -extern char *XScreenResourceString( - Screen* /* screen */ -); -extern unsigned long XDisplayMotionBufferSize( - Display* /* display */ -); -extern VisualID XVisualIDFromVisual( - Visual* /* visual */ -); - -/* multithread routines */ - -extern Status XInitThreads( - void -); - -extern void XLockDisplay( - Display* /* display */ -); - -extern void XUnlockDisplay( - Display* /* display */ -); - -/* routines for dealing with extensions */ - -extern XExtCodes *XInitExtension( - Display* /* display */, - _Xconst char* /* name */ -); - -extern XExtCodes *XAddExtension( - Display* /* display */ -); -extern XExtData *XFindOnExtensionList( - XExtData** /* structure */, - int /* number */ -); -extern XExtData **XEHeadOfExtensionList( - XEDataObject /* object */ -); - -/* these are routines for which there are also macros */ -extern Window XRootWindow( - Display* /* display */, - int /* screen_number */ -); -extern Window XDefaultRootWindow( - Display* /* display */ -); -extern Window XRootWindowOfScreen( - Screen* /* screen */ -); -extern Visual *XDefaultVisual( - Display* /* display */, - int /* screen_number */ -); -extern Visual *XDefaultVisualOfScreen( - Screen* /* screen */ -); -extern GC XDefaultGC( - Display* /* display */, - int /* screen_number */ -); -extern GC XDefaultGCOfScreen( - Screen* /* screen */ -); -extern unsigned long XBlackPixel( - Display* /* display */, - int /* screen_number */ -); -extern unsigned long XWhitePixel( - Display* /* display */, - int /* screen_number */ -); -extern unsigned long XAllPlanes( - void -); -extern unsigned long XBlackPixelOfScreen( - Screen* /* screen */ -); -extern unsigned long XWhitePixelOfScreen( - Screen* /* screen */ -); -extern unsigned long XNextRequest( - Display* /* display */ -); -extern unsigned long XLastKnownRequestProcessed( - Display* /* display */ -); -extern char *XServerVendor( - Display* /* display */ -); -extern char *XDisplayString( - Display* /* display */ -); -extern Colormap XDefaultColormap( - Display* /* display */, - int /* screen_number */ -); -extern Colormap XDefaultColormapOfScreen( - Screen* /* screen */ -); -extern Display *XDisplayOfScreen( - Screen* /* screen */ -); -extern Screen *XScreenOfDisplay( - Display* /* display */, - int /* screen_number */ -); -extern Screen *XDefaultScreenOfDisplay( - Display* /* display */ -); -extern long XEventMaskOfScreen( - Screen* /* screen */ -); - -extern int XScreenNumberOfScreen( - Screen* /* screen */ -); - -typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */ - Display* /* display */, - XErrorEvent* /* error_event */ -); - -extern XErrorHandler XSetErrorHandler ( - XErrorHandler /* handler */ -); - - -typedef int (*XIOErrorHandler) ( /* WARNING, this type not in Xlib spec */ - Display* /* display */ -); - -extern XIOErrorHandler XSetIOErrorHandler ( - XIOErrorHandler /* handler */ -); - - -extern XPixmapFormatValues *XListPixmapFormats( - Display* /* display */, - int* /* count_return */ -); -extern int *XListDepths( - Display* /* display */, - int /* screen_number */, - int* /* count_return */ -); - -/* ICCCM routines for things that don't require special include files; */ -/* other declarations are given in Xutil.h */ -extern Status XReconfigureWMWindow( - Display* /* display */, - Window /* w */, - int /* screen_number */, - unsigned int /* mask */, - XWindowChanges* /* changes */ -); - -extern Status XGetWMProtocols( - Display* /* display */, - Window /* w */, - Atom** /* protocols_return */, - int* /* count_return */ -); -extern Status XSetWMProtocols( - Display* /* display */, - Window /* w */, - Atom* /* protocols */, - int /* count */ -); -extern Status XIconifyWindow( - Display* /* display */, - Window /* w */, - int /* screen_number */ -); -extern Status XWithdrawWindow( - Display* /* display */, - Window /* w */, - int /* screen_number */ -); -extern Status XGetCommand( - Display* /* display */, - Window /* w */, - char*** /* argv_return */, - int* /* argc_return */ -); -extern Status XGetWMColormapWindows( - Display* /* display */, - Window /* w */, - Window** /* windows_return */, - int* /* count_return */ -); -extern Status XSetWMColormapWindows( - Display* /* display */, - Window /* w */, - Window* /* colormap_windows */, - int /* count */ -); -extern void XFreeStringList( - char** /* list */ -); -extern int XSetTransientForHint( - Display* /* display */, - Window /* w */, - Window /* prop_window */ -); - -/* The following are given in alphabetical order */ - -extern int XActivateScreenSaver( - Display* /* display */ -); - -extern int XAddHost( - Display* /* display */, - XHostAddress* /* host */ -); - -extern int XAddHosts( - Display* /* display */, - XHostAddress* /* hosts */, - int /* num_hosts */ -); - -extern int XAddToExtensionList( - struct _XExtData** /* structure */, - XExtData* /* ext_data */ -); - -extern int XAddToSaveSet( - Display* /* display */, - Window /* w */ -); - -extern Status XAllocColor( - Display* /* display */, - Colormap /* colormap */, - XColor* /* screen_in_out */ -); - -extern Status XAllocColorCells( - Display* /* display */, - Colormap /* colormap */, - Bool /* contig */, - unsigned long* /* plane_masks_return */, - unsigned int /* nplanes */, - unsigned long* /* pixels_return */, - unsigned int /* npixels */ -); - -extern Status XAllocColorPlanes( - Display* /* display */, - Colormap /* colormap */, - Bool /* contig */, - unsigned long* /* pixels_return */, - int /* ncolors */, - int /* nreds */, - int /* ngreens */, - int /* nblues */, - unsigned long* /* rmask_return */, - unsigned long* /* gmask_return */, - unsigned long* /* bmask_return */ -); - -extern Status XAllocNamedColor( - Display* /* display */, - Colormap /* colormap */, - _Xconst char* /* color_name */, - XColor* /* screen_def_return */, - XColor* /* exact_def_return */ -); - -extern int XAllowEvents( - Display* /* display */, - int /* event_mode */, - Time /* time */ -); - -extern int XAutoRepeatOff( - Display* /* display */ -); - -extern int XAutoRepeatOn( - Display* /* display */ -); - -extern int XBell( - Display* /* display */, - int /* percent */ -); - -extern int XBitmapBitOrder( - Display* /* display */ -); - -extern int XBitmapPad( - Display* /* display */ -); - -extern int XBitmapUnit( - Display* /* display */ -); - -extern int XCellsOfScreen( - Screen* /* screen */ -); - -extern int XChangeActivePointerGrab( - Display* /* display */, - unsigned int /* event_mask */, - Cursor /* cursor */, - Time /* time */ -); - -extern int XChangeGC( - Display* /* display */, - GC /* gc */, - unsigned long /* valuemask */, - XGCValues* /* values */ -); - -extern int XChangeKeyboardControl( - Display* /* display */, - unsigned long /* value_mask */, - XKeyboardControl* /* values */ -); - -extern int XChangeKeyboardMapping( - Display* /* display */, - int /* first_keycode */, - int /* keysyms_per_keycode */, - KeySym* /* keysyms */, - int /* num_codes */ -); - -extern int XChangePointerControl( - Display* /* display */, - Bool /* do_accel */, - Bool /* do_threshold */, - int /* accel_numerator */, - int /* accel_denominator */, - int /* threshold */ -); - -extern int XChangeProperty( - Display* /* display */, - Window /* w */, - Atom /* property */, - Atom /* type */, - int /* format */, - int /* mode */, - _Xconst unsigned char* /* data */, - int /* nelements */ -); - -extern int XChangeSaveSet( - Display* /* display */, - Window /* w */, - int /* change_mode */ -); - -extern int XChangeWindowAttributes( - Display* /* display */, - Window /* w */, - unsigned long /* valuemask */, - XSetWindowAttributes* /* attributes */ -); - -extern Bool XCheckIfEvent( - Display* /* display */, - XEvent* /* event_return */, - Bool (*) ( - Display* /* display */, - XEvent* /* event */, - XPointer /* arg */ - ) /* predicate */, - XPointer /* arg */ -); - -#ifdef NX_TRANS_SOCKET - -/* - * This is just like XCheckIfEvent() but doesn't - * flush the output buffer if it can't read new - * events. - */ - -extern Bool XCheckIfEventNoFlush( - Display* /* display */, - XEvent* /* event_return */, - Bool (*) ( - Display* /* display */, - XEvent* /* event */, - XPointer /* arg */ - ) /* predicate */, - XPointer /* arg */ -); - -#endif - -extern Bool XCheckMaskEvent( - Display* /* display */, - long /* event_mask */, - XEvent* /* event_return */ -); - -extern Bool XCheckTypedEvent( - Display* /* display */, - int /* event_type */, - XEvent* /* event_return */ -); - -extern Bool XCheckTypedWindowEvent( - Display* /* display */, - Window /* w */, - int /* event_type */, - XEvent* /* event_return */ -); - -extern Bool XCheckWindowEvent( - Display* /* display */, - Window /* w */, - long /* event_mask */, - XEvent* /* event_return */ -); - -extern int XCirculateSubwindows( - Display* /* display */, - Window /* w */, - int /* direction */ -); - -extern int XCirculateSubwindowsDown( - Display* /* display */, - Window /* w */ -); - -extern int XCirculateSubwindowsUp( - Display* /* display */, - Window /* w */ -); - -extern int XClearArea( - Display* /* display */, - Window /* w */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - Bool /* exposures */ -); - -extern int XClearWindow( - Display* /* display */, - Window /* w */ -); - -extern int XCloseDisplay( - Display* /* display */ -); - -extern int XConfigureWindow( - Display* /* display */, - Window /* w */, - unsigned int /* value_mask */, - XWindowChanges* /* values */ -); - -extern int XConnectionNumber( - Display* /* display */ -); - -extern int XConvertSelection( - Display* /* display */, - Atom /* selection */, - Atom /* target */, - Atom /* property */, - Window /* requestor */, - Time /* time */ -); - -extern int XCopyArea( - Display* /* display */, - Drawable /* src */, - Drawable /* dest */, - GC /* gc */, - int /* src_x */, - int /* src_y */, - unsigned int /* width */, - unsigned int /* height */, - int /* dest_x */, - int /* dest_y */ -); - -extern int XCopyGC( - Display* /* display */, - GC /* src */, - unsigned long /* valuemask */, - GC /* dest */ -); - -extern int XCopyPlane( - Display* /* display */, - Drawable /* src */, - Drawable /* dest */, - GC /* gc */, - int /* src_x */, - int /* src_y */, - unsigned int /* width */, - unsigned int /* height */, - int /* dest_x */, - int /* dest_y */, - unsigned long /* plane */ -); - -extern int XDefaultDepth( - Display* /* display */, - int /* screen_number */ -); - -extern int XDefaultDepthOfScreen( - Screen* /* screen */ -); - -extern int XDefaultScreen( - Display* /* display */ -); - -extern int XDefineCursor( - Display* /* display */, - Window /* w */, - Cursor /* cursor */ -); - -extern int XDeleteProperty( - Display* /* display */, - Window /* w */, - Atom /* property */ -); - -extern int XDestroyWindow( - Display* /* display */, - Window /* w */ -); - -extern int XDestroySubwindows( - Display* /* display */, - Window /* w */ -); - -extern int XDoesBackingStore( - Screen* /* screen */ -); - -extern Bool XDoesSaveUnders( - Screen* /* screen */ -); - -extern int XDisableAccessControl( - Display* /* display */ -); - - -extern int XDisplayCells( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayHeight( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayHeightMM( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayKeycodes( - Display* /* display */, - int* /* min_keycodes_return */, - int* /* max_keycodes_return */ -); - -extern int XDisplayPlanes( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayWidth( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayWidthMM( - Display* /* display */, - int /* screen_number */ -); - -extern int XDrawArc( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - int /* angle1 */, - int /* angle2 */ -); - -extern int XDrawArcs( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XArc* /* arcs */, - int /* narcs */ -); - -extern int XDrawImageString( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* string */, - int /* length */ -); - -extern int XDrawImageString16( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst XChar2b* /* string */, - int /* length */ -); - -extern int XDrawLine( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x1 */, - int /* y1 */, - int /* x2 */, - int /* y2 */ -); - -extern int XDrawLines( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XPoint* /* points */, - int /* npoints */, - int /* mode */ -); - -extern int XDrawPoint( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */ -); - -extern int XDrawPoints( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XPoint* /* points */, - int /* npoints */, - int /* mode */ -); - -extern int XDrawRectangle( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XDrawRectangles( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XRectangle* /* rectangles */, - int /* nrectangles */ -); - -extern int XDrawSegments( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XSegment* /* segments */, - int /* nsegments */ -); - -extern int XDrawString( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* string */, - int /* length */ -); - -extern int XDrawString16( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst XChar2b* /* string */, - int /* length */ -); - -extern int XDrawText( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XTextItem* /* items */, - int /* nitems */ -); - -extern int XDrawText16( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XTextItem16* /* items */, - int /* nitems */ -); - -extern int XEnableAccessControl( - Display* /* display */ -); - -extern int XEventsQueued( - Display* /* display */, - int /* mode */ -); - -extern Status XFetchName( - Display* /* display */, - Window /* w */, - char** /* window_name_return */ -); - -extern int XFillArc( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - int /* angle1 */, - int /* angle2 */ -); - -extern int XFillArcs( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XArc* /* arcs */, - int /* narcs */ -); - -extern int XFillPolygon( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XPoint* /* points */, - int /* npoints */, - int /* shape */, - int /* mode */ -); - -extern int XFillRectangle( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XFillRectangles( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XRectangle* /* rectangles */, - int /* nrectangles */ -); - -extern int XFlush( - Display* /* display */ -); - -extern int XForceScreenSaver( - Display* /* display */, - int /* mode */ -); - -extern int XFree( - void* /* data */ -); - -extern int XFreeColormap( - Display* /* display */, - Colormap /* colormap */ -); - -extern int XFreeColors( - Display* /* display */, - Colormap /* colormap */, - unsigned long* /* pixels */, - int /* npixels */, - unsigned long /* planes */ -); - -extern int XFreeCursor( - Display* /* display */, - Cursor /* cursor */ -); - -extern int XFreeExtensionList( - char** /* list */ -); - -extern int XFreeFont( - Display* /* display */, - XFontStruct* /* font_struct */ -); - -extern int XFreeFontInfo( - char** /* names */, - XFontStruct* /* free_info */, - int /* actual_count */ -); - -extern int XFreeFontNames( - char** /* list */ -); - -extern int XFreeFontPath( - char** /* list */ -); - -extern int XFreeGC( - Display* /* display */, - GC /* gc */ -); - -extern int XFreeModifiermap( - XModifierKeymap* /* modmap */ -); - -extern int XFreePixmap( - Display* /* display */, - Pixmap /* pixmap */ -); - -extern int XGeometry( - Display* /* display */, - int /* screen */, - _Xconst char* /* position */, - _Xconst char* /* default_position */, - unsigned int /* bwidth */, - unsigned int /* fwidth */, - unsigned int /* fheight */, - int /* xadder */, - int /* yadder */, - int* /* x_return */, - int* /* y_return */, - int* /* width_return */, - int* /* height_return */ -); - -extern int XGetErrorDatabaseText( - Display* /* display */, - _Xconst char* /* name */, - _Xconst char* /* message */, - _Xconst char* /* default_string */, - char* /* buffer_return */, - int /* length */ -); - -extern int XGetErrorText( - Display* /* display */, - int /* code */, - char* /* buffer_return */, - int /* length */ -); - -extern Bool XGetFontProperty( - XFontStruct* /* font_struct */, - Atom /* atom */, - unsigned long* /* value_return */ -); - -extern Status XGetGCValues( - Display* /* display */, - GC /* gc */, - unsigned long /* valuemask */, - XGCValues* /* values_return */ -); - -extern Status XGetGeometry( - Display* /* display */, - Drawable /* d */, - Window* /* root_return */, - int* /* x_return */, - int* /* y_return */, - unsigned int* /* width_return */, - unsigned int* /* height_return */, - unsigned int* /* border_width_return */, - unsigned int* /* depth_return */ -); - -extern Status XGetIconName( - Display* /* display */, - Window /* w */, - char** /* icon_name_return */ -); - -extern int XGetInputFocus( - Display* /* display */, - Window* /* focus_return */, - int* /* revert_to_return */ -); - -extern int XGetKeyboardControl( - Display* /* display */, - XKeyboardState* /* values_return */ -); - -extern int XGetPointerControl( - Display* /* display */, - int* /* accel_numerator_return */, - int* /* accel_denominator_return */, - int* /* threshold_return */ -); - -extern int XGetPointerMapping( - Display* /* display */, - unsigned char* /* map_return */, - int /* nmap */ -); - -extern int XGetScreenSaver( - Display* /* display */, - int* /* timeout_return */, - int* /* interval_return */, - int* /* prefer_blanking_return */, - int* /* allow_exposures_return */ -); - -extern Status XGetTransientForHint( - Display* /* display */, - Window /* w */, - Window* /* prop_window_return */ -); - -extern int XGetWindowProperty( - Display* /* display */, - Window /* w */, - Atom /* property */, - long /* long_offset */, - long /* long_length */, - Bool /* delete */, - Atom /* req_type */, - Atom* /* actual_type_return */, - int* /* actual_format_return */, - unsigned long* /* nitems_return */, - unsigned long* /* bytes_after_return */, - unsigned char** /* prop_return */ -); - -extern Status XGetWindowAttributes( - Display* /* display */, - Window /* w */, - XWindowAttributes* /* window_attributes_return */ -); - -extern int XGrabButton( - Display* /* display */, - unsigned int /* button */, - unsigned int /* modifiers */, - Window /* grab_window */, - Bool /* owner_events */, - unsigned int /* event_mask */, - int /* pointer_mode */, - int /* keyboard_mode */, - Window /* confine_to */, - Cursor /* cursor */ -); - -extern int XGrabKey( - Display* /* display */, - int /* keycode */, - unsigned int /* modifiers */, - Window /* grab_window */, - Bool /* owner_events */, - int /* pointer_mode */, - int /* keyboard_mode */ -); - -extern int XGrabKeyboard( - Display* /* display */, - Window /* grab_window */, - Bool /* owner_events */, - int /* pointer_mode */, - int /* keyboard_mode */, - Time /* time */ -); - -extern int XGrabPointer( - Display* /* display */, - Window /* grab_window */, - Bool /* owner_events */, - unsigned int /* event_mask */, - int /* pointer_mode */, - int /* keyboard_mode */, - Window /* confine_to */, - Cursor /* cursor */, - Time /* time */ -); - -extern int XGrabServer( - Display* /* display */ -); - -extern int XHeightMMOfScreen( - Screen* /* screen */ -); - -extern int XHeightOfScreen( - Screen* /* screen */ -); - -extern int XIfEvent( - Display* /* display */, - XEvent* /* event_return */, - Bool (*) ( - Display* /* display */, - XEvent* /* event */, - XPointer /* arg */ - ) /* predicate */, - XPointer /* arg */ -); - -extern int XImageByteOrder( - Display* /* display */ -); - -extern int XInstallColormap( - Display* /* display */, - Colormap /* colormap */ -); - -extern KeyCode XKeysymToKeycode( - Display* /* display */, - KeySym /* keysym */ -); - -extern int XKillClient( - Display* /* display */, - XID /* resource */ -); - -extern Status XLookupColor( - Display* /* display */, - Colormap /* colormap */, - _Xconst char* /* color_name */, - XColor* /* exact_def_return */, - XColor* /* screen_def_return */ -); - -extern int XLowerWindow( - Display* /* display */, - Window /* w */ -); - -extern int XMapRaised( - Display* /* display */, - Window /* w */ -); - -extern int XMapSubwindows( - Display* /* display */, - Window /* w */ -); - -extern int XMapWindow( - Display* /* display */, - Window /* w */ -); - -extern int XMaskEvent( - Display* /* display */, - long /* event_mask */, - XEvent* /* event_return */ -); - -extern int XMaxCmapsOfScreen( - Screen* /* screen */ -); - -extern int XMinCmapsOfScreen( - Screen* /* screen */ -); - -extern int XMoveResizeWindow( - Display* /* display */, - Window /* w */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XMoveWindow( - Display* /* display */, - Window /* w */, - int /* x */, - int /* y */ -); - -extern int XNextEvent( - Display* /* display */, - XEvent* /* event_return */ -); - -extern int XNoOp( - Display* /* display */ -); - -extern Status XParseColor( - Display* /* display */, - Colormap /* colormap */, - _Xconst char* /* spec */, - XColor* /* exact_def_return */ -); - -extern int XParseGeometry( - _Xconst char* /* parsestring */, - int* /* x_return */, - int* /* y_return */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern int XPeekEvent( - Display* /* display */, - XEvent* /* event_return */ -); - -extern int XPeekIfEvent( - Display* /* display */, - XEvent* /* event_return */, - Bool (*) ( - Display* /* display */, - XEvent* /* event */, - XPointer /* arg */ - ) /* predicate */, - XPointer /* arg */ -); - -extern int XPending( - Display* /* display */ -); - -extern int XPlanesOfScreen( - Screen* /* screen */ -); - -extern int XProtocolRevision( - Display* /* display */ -); - -extern int XProtocolVersion( - Display* /* display */ -); - - -extern int XPutBackEvent( - Display* /* display */, - XEvent* /* event */ -); - -extern int XPutImage( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XImage* /* image */, - int /* src_x */, - int /* src_y */, - int /* dest_x */, - int /* dest_y */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XQLength( - Display* /* display */ -); - -extern Status XQueryBestCursor( - Display* /* display */, - Drawable /* d */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern Status XQueryBestSize( - Display* /* display */, - int /* class */, - Drawable /* which_screen */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern Status XQueryBestStipple( - Display* /* display */, - Drawable /* which_screen */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern Status XQueryBestTile( - Display* /* display */, - Drawable /* which_screen */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern int XQueryColor( - Display* /* display */, - Colormap /* colormap */, - XColor* /* def_in_out */ -); - -extern int XQueryColors( - Display* /* display */, - Colormap /* colormap */, - XColor* /* defs_in_out */, - int /* ncolors */ -); - -extern Bool XQueryExtension( - Display* /* display */, - _Xconst char* /* name */, - int* /* major_opcode_return */, - int* /* first_event_return */, - int* /* first_error_return */ -); - -extern int XQueryKeymap( - Display* /* display */, - char [32] /* keys_return */ -); - -extern Bool XQueryPointer( - Display* /* display */, - Window /* w */, - Window* /* root_return */, - Window* /* child_return */, - int* /* root_x_return */, - int* /* root_y_return */, - int* /* win_x_return */, - int* /* win_y_return */, - unsigned int* /* mask_return */ -); - -extern int XQueryTextExtents( - Display* /* display */, - XID /* font_ID */, - _Xconst char* /* string */, - int /* nchars */, - int* /* direction_return */, - int* /* font_ascent_return */, - int* /* font_descent_return */, - XCharStruct* /* overall_return */ -); - -extern int XQueryTextExtents16( - Display* /* display */, - XID /* font_ID */, - _Xconst XChar2b* /* string */, - int /* nchars */, - int* /* direction_return */, - int* /* font_ascent_return */, - int* /* font_descent_return */, - XCharStruct* /* overall_return */ -); - -extern Status XQueryTree( - Display* /* display */, - Window /* w */, - Window* /* root_return */, - Window* /* parent_return */, - Window** /* children_return */, - unsigned int* /* nchildren_return */ -); - -extern int XRaiseWindow( - Display* /* display */, - Window /* w */ -); - -extern int XReadBitmapFile( - Display* /* display */, - Drawable /* d */, - _Xconst char* /* filename */, - unsigned int* /* width_return */, - unsigned int* /* height_return */, - Pixmap* /* bitmap_return */, - int* /* x_hot_return */, - int* /* y_hot_return */ -); - -extern int XReadBitmapFileData( - _Xconst char* /* filename */, - unsigned int* /* width_return */, - unsigned int* /* height_return */, - unsigned char** /* data_return */, - int* /* x_hot_return */, - int* /* y_hot_return */ -); - -extern int XRebindKeysym( - Display* /* display */, - KeySym /* keysym */, - KeySym* /* list */, - int /* mod_count */, - _Xconst unsigned char* /* string */, - int /* bytes_string */ -); - -extern int XRecolorCursor( - Display* /* display */, - Cursor /* cursor */, - XColor* /* foreground_color */, - XColor* /* background_color */ -); - -extern int XRefreshKeyboardMapping( - XMappingEvent* /* event_map */ -); - -extern int XRemoveFromSaveSet( - Display* /* display */, - Window /* w */ -); - -extern int XRemoveHost( - Display* /* display */, - XHostAddress* /* host */ -); - -extern int XRemoveHosts( - Display* /* display */, - XHostAddress* /* hosts */, - int /* num_hosts */ -); - -extern int XReparentWindow( - Display* /* display */, - Window /* w */, - Window /* parent */, - int /* x */, - int /* y */ -); - -extern int XResetScreenSaver( - Display* /* display */ -); - -extern int XResizeWindow( - Display* /* display */, - Window /* w */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XRestackWindows( - Display* /* display */, - Window* /* windows */, - int /* nwindows */ -); - -extern int XRotateBuffers( - Display* /* display */, - int /* rotate */ -); - -extern int XRotateWindowProperties( - Display* /* display */, - Window /* w */, - Atom* /* properties */, - int /* num_prop */, - int /* npositions */ -); - -extern int XScreenCount( - Display* /* display */ -); - -extern int XSelectInput( - Display* /* display */, - Window /* w */, - long /* event_mask */ -); - -extern Status XSendEvent( - Display* /* display */, - Window /* w */, - Bool /* propagate */, - long /* event_mask */, - XEvent* /* event_send */ -); - -extern int XSetAccessControl( - Display* /* display */, - int /* mode */ -); - -extern int XSetArcMode( - Display* /* display */, - GC /* gc */, - int /* arc_mode */ -); - -extern int XSetBackground( - Display* /* display */, - GC /* gc */, - unsigned long /* background */ -); - -extern int XSetClipMask( - Display* /* display */, - GC /* gc */, - Pixmap /* pixmap */ -); - -extern int XSetClipOrigin( - Display* /* display */, - GC /* gc */, - int /* clip_x_origin */, - int /* clip_y_origin */ -); - -extern int XSetClipRectangles( - Display* /* display */, - GC /* gc */, - int /* clip_x_origin */, - int /* clip_y_origin */, - XRectangle* /* rectangles */, - int /* n */, - int /* ordering */ -); - -extern int XSetCloseDownMode( - Display* /* display */, - int /* close_mode */ -); - -extern int XSetCommand( - Display* /* display */, - Window /* w */, - char** /* argv */, - int /* argc */ -); - -extern int XSetDashes( - Display* /* display */, - GC /* gc */, - int /* dash_offset */, - _Xconst char* /* dash_list */, - int /* n */ -); - -extern int XSetFillRule( - Display* /* display */, - GC /* gc */, - int /* fill_rule */ -); - -extern int XSetFillStyle( - Display* /* display */, - GC /* gc */, - int /* fill_style */ -); - -extern int XSetFont( - Display* /* display */, - GC /* gc */, - Font /* font */ -); - -extern int XSetFontPath( - Display* /* display */, - char** /* directories */, - int /* ndirs */ -); - -extern int XSetForeground( - Display* /* display */, - GC /* gc */, - unsigned long /* foreground */ -); - -extern int XSetFunction( - Display* /* display */, - GC /* gc */, - int /* function */ -); - -extern int XSetGraphicsExposures( - Display* /* display */, - GC /* gc */, - Bool /* graphics_exposures */ -); - -extern int XSetIconName( - Display* /* display */, - Window /* w */, - _Xconst char* /* icon_name */ -); - -extern int XSetInputFocus( - Display* /* display */, - Window /* focus */, - int /* revert_to */, - Time /* time */ -); - -extern int XSetLineAttributes( - Display* /* display */, - GC /* gc */, - unsigned int /* line_width */, - int /* line_style */, - int /* cap_style */, - int /* join_style */ -); - -extern int XSetModifierMapping( - Display* /* display */, - XModifierKeymap* /* modmap */ -); - -extern int XSetPlaneMask( - Display* /* display */, - GC /* gc */, - unsigned long /* plane_mask */ -); - -extern int XSetPointerMapping( - Display* /* display */, - _Xconst unsigned char* /* map */, - int /* nmap */ -); - -extern int XSetScreenSaver( - Display* /* display */, - int /* timeout */, - int /* interval */, - int /* prefer_blanking */, - int /* allow_exposures */ -); - -extern int XSetSelectionOwner( - Display* /* display */, - Atom /* selection */, - Window /* owner */, - Time /* time */ -); - -extern int XSetState( - Display* /* display */, - GC /* gc */, - unsigned long /* foreground */, - unsigned long /* background */, - int /* function */, - unsigned long /* plane_mask */ -); - -extern int XSetStipple( - Display* /* display */, - GC /* gc */, - Pixmap /* stipple */ -); - -extern int XSetSubwindowMode( - Display* /* display */, - GC /* gc */, - int /* subwindow_mode */ -); - -extern int XSetTSOrigin( - Display* /* display */, - GC /* gc */, - int /* ts_x_origin */, - int /* ts_y_origin */ -); - -extern int XSetTile( - Display* /* display */, - GC /* gc */, - Pixmap /* tile */ -); - -extern int XSetWindowBackground( - Display* /* display */, - Window /* w */, - unsigned long /* background_pixel */ -); - -extern int XSetWindowBackgroundPixmap( - Display* /* display */, - Window /* w */, - Pixmap /* background_pixmap */ -); - -extern int XSetWindowBorder( - Display* /* display */, - Window /* w */, - unsigned long /* border_pixel */ -); - -extern int XSetWindowBorderPixmap( - Display* /* display */, - Window /* w */, - Pixmap /* border_pixmap */ -); - -extern int XSetWindowBorderWidth( - Display* /* display */, - Window /* w */, - unsigned int /* width */ -); - -extern int XSetWindowColormap( - Display* /* display */, - Window /* w */, - Colormap /* colormap */ -); - -extern int XStoreBuffer( - Display* /* display */, - _Xconst char* /* bytes */, - int /* nbytes */, - int /* buffer */ -); - -extern int XStoreBytes( - Display* /* display */, - _Xconst char* /* bytes */, - int /* nbytes */ -); - -extern int XStoreColor( - Display* /* display */, - Colormap /* colormap */, - XColor* /* color */ -); - -extern int XStoreColors( - Display* /* display */, - Colormap /* colormap */, - XColor* /* color */, - int /* ncolors */ -); - -extern int XStoreName( - Display* /* display */, - Window /* w */, - _Xconst char* /* window_name */ -); - -extern int XStoreNamedColor( - Display* /* display */, - Colormap /* colormap */, - _Xconst char* /* color */, - unsigned long /* pixel */, - int /* flags */ -); - -extern int XSync( - Display* /* display */, - Bool /* discard */ -); - -extern int XTextExtents( - XFontStruct* /* font_struct */, - _Xconst char* /* string */, - int /* nchars */, - int* /* direction_return */, - int* /* font_ascent_return */, - int* /* font_descent_return */, - XCharStruct* /* overall_return */ -); - -extern int XTextExtents16( - XFontStruct* /* font_struct */, - _Xconst XChar2b* /* string */, - int /* nchars */, - int* /* direction_return */, - int* /* font_ascent_return */, - int* /* font_descent_return */, - XCharStruct* /* overall_return */ -); - -extern int XTextWidth( - XFontStruct* /* font_struct */, - _Xconst char* /* string */, - int /* count */ -); - -extern int XTextWidth16( - XFontStruct* /* font_struct */, - _Xconst XChar2b* /* string */, - int /* count */ -); - -extern Bool XTranslateCoordinates( - Display* /* display */, - Window /* src_w */, - Window /* dest_w */, - int /* src_x */, - int /* src_y */, - int* /* dest_x_return */, - int* /* dest_y_return */, - Window* /* child_return */ -); - -extern int XUndefineCursor( - Display* /* display */, - Window /* w */ -); - -extern int XUngrabButton( - Display* /* display */, - unsigned int /* button */, - unsigned int /* modifiers */, - Window /* grab_window */ -); - -extern int XUngrabKey( - Display* /* display */, - int /* keycode */, - unsigned int /* modifiers */, - Window /* grab_window */ -); - -extern int XUngrabKeyboard( - Display* /* display */, - Time /* time */ -); - -extern int XUngrabPointer( - Display* /* display */, - Time /* time */ -); - -extern int XUngrabServer( - Display* /* display */ -); - -extern int XUninstallColormap( - Display* /* display */, - Colormap /* colormap */ -); - -extern int XUnloadFont( - Display* /* display */, - Font /* font */ -); - -extern int XUnmapSubwindows( - Display* /* display */, - Window /* w */ -); - -extern int XUnmapWindow( - Display* /* display */, - Window /* w */ -); - -extern int XVendorRelease( - Display* /* display */ -); - -extern int XWarpPointer( - Display* /* display */, - Window /* src_w */, - Window /* dest_w */, - int /* src_x */, - int /* src_y */, - unsigned int /* src_width */, - unsigned int /* src_height */, - int /* dest_x */, - int /* dest_y */ -); - -extern int XWidthMMOfScreen( - Screen* /* screen */ -); - -extern int XWidthOfScreen( - Screen* /* screen */ -); - -extern int XWindowEvent( - Display* /* display */, - Window /* w */, - long /* event_mask */, - XEvent* /* event_return */ -); - -extern int XWriteBitmapFile( - Display* /* display */, - _Xconst char* /* filename */, - Pixmap /* bitmap */, - unsigned int /* width */, - unsigned int /* height */, - int /* x_hot */, - int /* y_hot */ -); - -extern Bool XSupportsLocale (void); - -extern char *XSetLocaleModifiers( - const char* /* modifier_list */ -); - -extern XOM XOpenOM( - Display* /* display */, - struct _XrmHashBucketRec* /* rdb */, - _Xconst char* /* res_name */, - _Xconst char* /* res_class */ -); - -extern Status XCloseOM( - XOM /* om */ -); - -extern char *XSetOMValues( - XOM /* om */, - ... -) _X_SENTINEL(0); - -extern char *XGetOMValues( - XOM /* om */, - ... -) _X_SENTINEL(0); - -extern Display *XDisplayOfOM( - XOM /* om */ -); - -extern char *XLocaleOfOM( - XOM /* om */ -); - -extern XOC XCreateOC( - XOM /* om */, - ... -) _X_SENTINEL(0); - -extern void XDestroyOC( - XOC /* oc */ -); - -extern XOM XOMOfOC( - XOC /* oc */ -); - -extern char *XSetOCValues( - XOC /* oc */, - ... -) _X_SENTINEL(0); - -extern char *XGetOCValues( - XOC /* oc */, - ... -) _X_SENTINEL(0); - -extern XFontSet XCreateFontSet( - Display* /* display */, - _Xconst char* /* base_font_name_list */, - char*** /* missing_charset_list */, - int* /* missing_charset_count */, - char** /* def_string */ -); - -extern void XFreeFontSet( - Display* /* display */, - XFontSet /* font_set */ -); - -extern int XFontsOfFontSet( - XFontSet /* font_set */, - XFontStruct*** /* font_struct_list */, - char*** /* font_name_list */ -); - -extern char *XBaseFontNameListOfFontSet( - XFontSet /* font_set */ -); - -extern char *XLocaleOfFontSet( - XFontSet /* font_set */ -); - -extern Bool XContextDependentDrawing( - XFontSet /* font_set */ -); - -extern Bool XDirectionalDependentDrawing( - XFontSet /* font_set */ -); - -extern Bool XContextualDrawing( - XFontSet /* font_set */ -); - -extern XFontSetExtents *XExtentsOfFontSet( - XFontSet /* font_set */ -); - -extern int XmbTextEscapement( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern int XwcTextEscapement( - XFontSet /* font_set */, - _Xconst wchar_t* /* text */, - int /* num_wchars */ -); - -extern int Xutf8TextEscapement( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern int XmbTextExtents( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern int XwcTextExtents( - XFontSet /* font_set */, - _Xconst wchar_t* /* text */, - int /* num_wchars */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern int Xutf8TextExtents( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern Status XmbTextPerCharExtents( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */, - XRectangle* /* ink_extents_buffer */, - XRectangle* /* logical_extents_buffer */, - int /* buffer_size */, - int* /* num_chars */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern Status XwcTextPerCharExtents( - XFontSet /* font_set */, - _Xconst wchar_t* /* text */, - int /* num_wchars */, - XRectangle* /* ink_extents_buffer */, - XRectangle* /* logical_extents_buffer */, - int /* buffer_size */, - int* /* num_chars */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern Status Xutf8TextPerCharExtents( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */, - XRectangle* /* ink_extents_buffer */, - XRectangle* /* logical_extents_buffer */, - int /* buffer_size */, - int* /* num_chars */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern void XmbDrawText( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XmbTextItem* /* text_items */, - int /* nitems */ -); - -extern void XwcDrawText( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XwcTextItem* /* text_items */, - int /* nitems */ -); - -extern void Xutf8DrawText( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XmbTextItem* /* text_items */, - int /* nitems */ -); - -extern void XmbDrawString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern void XwcDrawString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst wchar_t* /* text */, - int /* num_wchars */ -); - -extern void Xutf8DrawString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern void XmbDrawImageString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern void XwcDrawImageString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst wchar_t* /* text */, - int /* num_wchars */ -); - -extern void Xutf8DrawImageString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern XIM XOpenIM( - Display* /* dpy */, - struct _XrmHashBucketRec* /* rdb */, - char* /* res_name */, - char* /* res_class */ -); - -extern Status XCloseIM( - XIM /* im */ -); - -extern char *XGetIMValues( - XIM /* im */, ... -) _X_SENTINEL(0); - -extern char *XSetIMValues( - XIM /* im */, ... -) _X_SENTINEL(0); - -extern Display *XDisplayOfIM( - XIM /* im */ -); - -extern char *XLocaleOfIM( - XIM /* im*/ -); - -extern XIC XCreateIC( - XIM /* im */, ... -) _X_SENTINEL(0); - -extern void XDestroyIC( - XIC /* ic */ -); - -extern void XSetICFocus( - XIC /* ic */ -); - -extern void XUnsetICFocus( - XIC /* ic */ -); - -extern wchar_t *XwcResetIC( - XIC /* ic */ -); - -extern char *XmbResetIC( - XIC /* ic */ -); - -extern char *Xutf8ResetIC( - XIC /* ic */ -); - -extern char *XSetICValues( - XIC /* ic */, ... -) _X_SENTINEL(0); - -extern char *XGetICValues( - XIC /* ic */, ... -) _X_SENTINEL(0); - -extern XIM XIMOfIC( - XIC /* ic */ -); - -extern Bool XFilterEvent( - XEvent* /* event */, - Window /* window */ -); - -extern int XmbLookupString( - XIC /* ic */, - XKeyPressedEvent* /* event */, - char* /* buffer_return */, - int /* bytes_buffer */, - KeySym* /* keysym_return */, - Status* /* status_return */ -); - -extern int XwcLookupString( - XIC /* ic */, - XKeyPressedEvent* /* event */, - wchar_t* /* buffer_return */, - int /* wchars_buffer */, - KeySym* /* keysym_return */, - Status* /* status_return */ -); - -extern int Xutf8LookupString( - XIC /* ic */, - XKeyPressedEvent* /* event */, - char* /* buffer_return */, - int /* bytes_buffer */, - KeySym* /* keysym_return */, - Status* /* status_return */ -); - -extern XVaNestedList XVaCreateNestedList( - int /*unused*/, ... -) _X_SENTINEL(0); - -/* internal connections for IMs */ - -extern Bool XRegisterIMInstantiateCallback( - Display* /* dpy */, - struct _XrmHashBucketRec* /* rdb */, - char* /* res_name */, - char* /* res_class */, - XIDProc /* callback */, - XPointer /* client_data */ -); - -extern Bool XUnregisterIMInstantiateCallback( - Display* /* dpy */, - struct _XrmHashBucketRec* /* rdb */, - char* /* res_name */, - char* /* res_class */, - XIDProc /* callback */, - XPointer /* client_data */ -); - -typedef void (*XConnectionWatchProc)( - Display* /* dpy */, - XPointer /* client_data */, - int /* fd */, - Bool /* opening */, /* open or close flag */ - XPointer* /* watch_data */ /* open sets, close uses */ -); - - -extern Status XInternalConnectionNumbers( - Display* /* dpy */, - int** /* fd_return */, - int* /* count_return */ -); - -extern void XProcessInternalConnection( - Display* /* dpy */, - int /* fd */ -); - -extern Status XAddConnectionWatch( - Display* /* dpy */, - XConnectionWatchProc /* callback */, - XPointer /* client_data */ -); - -extern void XRemoveConnectionWatch( - Display* /* dpy */, - XConnectionWatchProc /* callback */, - XPointer /* client_data */ -); - -extern void XSetAuthorization( - char * /* name */, - int /* namelen */, - char * /* data */, - int /* datalen */ -); - -extern int _Xmbtowc( - wchar_t * /* wstr */, -#ifdef ISC - char const * /* str */, - size_t /* len */ -#else - char * /* str */, - int /* len */ -#endif -); - -extern int _Xwctomb( - char * /* str */, - wchar_t /* wc */ -); - -_XFUNCPROTOEND - -#endif /* _XLIB_H_ */ diff --git a/nx-X11/lib/X11/Xlib.h.X.original b/nx-X11/lib/X11/Xlib.h.X.original deleted file mode 100644 index b1535f9b1..000000000 --- a/nx-X11/lib/X11/Xlib.h.X.original +++ /dev/null @@ -1,4008 +0,0 @@ -/* $XdotOrg: xc/lib/X11/Xlib.h,v 1.6 2005/11/08 06:33:25 jkj Exp $ */ -/* $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $ */ -/* - -Copyright 1985, 1986, 1987, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/Xlib.h,v 3.25 2003/11/17 22:20:10 dawes Exp $ */ - - -/* - * Xlib.h - Header definition and support file for the C subroutine - * interface library (Xlib) to the X Window System Protocol (V11). - * Structures and symbols starting with "_" are private to the library. - */ -#ifndef _XLIB_H_ -#define _XLIB_H_ - -#define XlibSpecificationRelease 6 - -#ifdef USG -#ifndef __TYPES__ -#include /* forgot to protect it... */ -#define __TYPES__ -#endif /* __TYPES__ */ -#else -#if defined(_POSIX_SOURCE) && defined(MOTOROLA) -#undef _POSIX_SOURCE -#include -#define _POSIX_SOURCE -#else -#include -#endif -#endif /* USG */ - -#if defined(__SCO__) || defined(__UNIXWARE__) -#include -#endif - -#include - -/* applications should not depend on these two headers being included! */ -#include -#include - -#ifndef X_WCHAR -#ifdef X_NOT_STDC_ENV -#ifndef ISC -#define X_WCHAR -#endif -#endif -#endif - -#ifndef X_WCHAR -#include -#else -#ifdef __UNIXOS2__ -#include -#else -/* replace this with #include or typedef appropriate for your system */ -typedef unsigned long wchar_t; -#endif -#endif - -#if defined(ISC) && defined(USE_XMBTOWC) -#define wctomb(a,b) _Xwctomb(a,b) -#define mblen(a,b) _Xmblen(a,b) -#ifndef USE_XWCHAR_STRING -#define mbtowc(a,b,c) _Xmbtowc(a,b,c) -#endif -#endif - -extern int -_Xmblen( -#ifdef ISC - char const *str, - size_t len -#else - char *str, - int len -#endif - ); - -/* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in - November 2000. Its presence is indicated through the following macro. */ -#define X_HAVE_UTF8_STRING 1 - -typedef char *XPointer; - -#define Bool int -#define Status int -#define True 1 -#define False 0 - -#define QueuedAlready 0 -#define QueuedAfterReading 1 -#define QueuedAfterFlush 2 - -#define ConnectionNumber(dpy) (((_XPrivDisplay)dpy)->fd) -#define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root) -#define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen) -#define DefaultRootWindow(dpy) (ScreenOfDisplay(dpy,DefaultScreen(dpy))->root) -#define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual) -#define DefaultGC(dpy, scr) (ScreenOfDisplay(dpy,scr)->default_gc) -#define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel) -#define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel) -#define AllPlanes ((unsigned long)~0L) -#define QLength(dpy) (((_XPrivDisplay)dpy)->qlen) -#define DisplayWidth(dpy, scr) (ScreenOfDisplay(dpy,scr)->width) -#define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height) -#define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth) -#define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight) -#define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) -#define DisplayCells(dpy, scr) (DefaultVisual(dpy,scr)->map_entries) -#define ScreenCount(dpy) (((_XPrivDisplay)dpy)->nscreens) -#define ServerVendor(dpy) (((_XPrivDisplay)dpy)->vendor) -#define ProtocolVersion(dpy) (((_XPrivDisplay)dpy)->proto_major_version) -#define ProtocolRevision(dpy) (((_XPrivDisplay)dpy)->proto_minor_version) -#define VendorRelease(dpy) (((_XPrivDisplay)dpy)->release) -#define DisplayString(dpy) (((_XPrivDisplay)dpy)->display_name) -#define DefaultDepth(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) -#define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap) -#define BitmapUnit(dpy) (((_XPrivDisplay)dpy)->bitmap_unit) -#define BitmapBitOrder(dpy) (((_XPrivDisplay)dpy)->bitmap_bit_order) -#define BitmapPad(dpy) (((_XPrivDisplay)dpy)->bitmap_pad) -#define ImageByteOrder(dpy) (((_XPrivDisplay)dpy)->byte_order) -#ifdef CRAY /* unable to get WORD64 without pulling in other symbols */ -#define NextRequest(dpy) XNextRequest(dpy) -#else -#define NextRequest(dpy) (((_XPrivDisplay)dpy)->request + 1) -#endif -#define LastKnownRequestProcessed(dpy) (((_XPrivDisplay)dpy)->last_request_read) - -/* macros for screen oriented applications (toolkit) */ -#define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr]) -#define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy)) -#define DisplayOfScreen(s) ((s)->display) -#define RootWindowOfScreen(s) ((s)->root) -#define BlackPixelOfScreen(s) ((s)->black_pixel) -#define WhitePixelOfScreen(s) ((s)->white_pixel) -#define DefaultColormapOfScreen(s)((s)->cmap) -#define DefaultDepthOfScreen(s) ((s)->root_depth) -#define DefaultGCOfScreen(s) ((s)->default_gc) -#define DefaultVisualOfScreen(s)((s)->root_visual) -#define WidthOfScreen(s) ((s)->width) -#define HeightOfScreen(s) ((s)->height) -#define WidthMMOfScreen(s) ((s)->mwidth) -#define HeightMMOfScreen(s) ((s)->mheight) -#define PlanesOfScreen(s) ((s)->root_depth) -#define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries) -#define MinCmapsOfScreen(s) ((s)->min_maps) -#define MaxCmapsOfScreen(s) ((s)->max_maps) -#define DoesSaveUnders(s) ((s)->save_unders) -#define DoesBackingStore(s) ((s)->backing_store) -#define EventMaskOfScreen(s) ((s)->root_input_mask) - -/* - * Extensions need a way to hang private data on some structures. - */ -typedef struct _XExtData { - int number; /* number returned by XRegisterExtension */ - struct _XExtData *next; /* next item on list of data for structure */ - int (*free_private)( /* called to free private storage */ - struct _XExtData *extension - ); - XPointer private_data; /* data private to this extension. */ -} XExtData; - -/* - * This file contains structures used by the extension mechanism. - */ -typedef struct { /* public to extension, cannot be changed */ - int extension; /* extension number */ - int major_opcode; /* major op-code assigned by server */ - int first_event; /* first event number for the extension */ - int first_error; /* first error number for the extension */ -} XExtCodes; - -/* - * Data structure for retrieving info about pixmap formats. - */ - -typedef struct { - int depth; - int bits_per_pixel; - int scanline_pad; -} XPixmapFormatValues; - - -/* - * Data structure for setting graphics context. - */ -typedef struct { - int function; /* logical operation */ - unsigned long plane_mask;/* plane mask */ - unsigned long foreground;/* foreground pixel */ - unsigned long background;/* background pixel */ - int line_width; /* line width */ - int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ - int cap_style; /* CapNotLast, CapButt, - CapRound, CapProjecting */ - int join_style; /* JoinMiter, JoinRound, JoinBevel */ - int fill_style; /* FillSolid, FillTiled, - FillStippled, FillOpaeueStippled */ - int fill_rule; /* EvenOddRule, WindingRule */ - int arc_mode; /* ArcChord, ArcPieSlice */ - Pixmap tile; /* tile pixmap for tiling operations */ - Pixmap stipple; /* stipple 1 plane pixmap for stipping */ - int ts_x_origin; /* offset for tile or stipple operations */ - int ts_y_origin; - Font font; /* default text font for text operations */ - int subwindow_mode; /* ClipByChildren, IncludeInferiors */ - Bool graphics_exposures;/* boolean, should exposures be generated */ - int clip_x_origin; /* origin for clipping */ - int clip_y_origin; - Pixmap clip_mask; /* bitmap clipping; other calls for rects */ - int dash_offset; /* patterned/dashed line information */ - char dashes; -} XGCValues; - -/* - * Graphics context. The contents of this structure are implementation - * dependent. A GC should be treated as opaque by application code. - */ - -typedef struct _XGC -#ifdef XLIB_ILLEGAL_ACCESS -{ - XExtData *ext_data; /* hook for extension to hang data */ - GContext gid; /* protocol ID for graphics context */ - /* there is more to this structure, but it is private to Xlib */ -} -#endif -*GC; - -/* - * Visual structure; contains information about colormapping possible. - */ -typedef struct { - XExtData *ext_data; /* hook for extension to hang data */ - VisualID visualid; /* visual id of this visual */ -#if defined(__cplusplus) || defined(c_plusplus) - int c_class; /* C++ class of screen (monochrome, etc.) */ -#else - int class; /* class of screen (monochrome, etc.) */ -#endif - unsigned long red_mask, green_mask, blue_mask; /* mask values */ - int bits_per_rgb; /* log base 2 of distinct color values */ - int map_entries; /* color map entries */ -} Visual; - -/* - * Depth structure; contains information for each possible depth. - */ -typedef struct { - int depth; /* this depth (Z) of the depth */ - int nvisuals; /* number of Visual types at this depth */ - Visual *visuals; /* list of visuals possible at this depth */ -} Depth; - -/* - * Information about the screen. The contents of this structure are - * implementation dependent. A Screen should be treated as opaque - * by application code. - */ - -struct _XDisplay; /* Forward declare before use for C++ */ - -typedef struct { - XExtData *ext_data; /* hook for extension to hang data */ - struct _XDisplay *display;/* back pointer to display structure */ - Window root; /* Root window id. */ - int width, height; /* width and height of screen */ - int mwidth, mheight; /* width and height of in millimeters */ - int ndepths; /* number of depths possible */ - Depth *depths; /* list of allowable depths on the screen */ - int root_depth; /* bits per pixel */ - Visual *root_visual; /* root visual */ - GC default_gc; /* GC for the root root visual */ - Colormap cmap; /* default color map */ - unsigned long white_pixel; - unsigned long black_pixel; /* White and Black pixel values */ - int max_maps, min_maps; /* max and min color maps */ - int backing_store; /* Never, WhenMapped, Always */ - Bool save_unders; - long root_input_mask; /* initial root input mask */ -} Screen; - -/* - * Format structure; describes ZFormat data the screen will understand. - */ -typedef struct { - XExtData *ext_data; /* hook for extension to hang data */ - int depth; /* depth of this image format */ - int bits_per_pixel; /* bits/pixel at this depth */ - int scanline_pad; /* scanline must padded to this multiple */ -} ScreenFormat; - -/* - * Data structure for setting window attributes. - */ -typedef struct { - Pixmap background_pixmap; /* background or None or ParentRelative */ - unsigned long background_pixel; /* background pixel */ - Pixmap border_pixmap; /* border of the window */ - unsigned long border_pixel; /* border pixel value */ - int bit_gravity; /* one of bit gravity values */ - int win_gravity; /* one of the window gravity values */ - int backing_store; /* NotUseful, WhenMapped, Always */ - unsigned long backing_planes;/* planes to be preseved if possible */ - unsigned long backing_pixel;/* value to use in restoring planes */ - Bool save_under; /* should bits under be saved? (popups) */ - long event_mask; /* set of events that should be saved */ - long do_not_propagate_mask; /* set of events that should not propagate */ - Bool override_redirect; /* boolean value for override-redirect */ - Colormap colormap; /* color map to be associated with window */ - Cursor cursor; /* cursor to be displayed (or None) */ -} XSetWindowAttributes; - -typedef struct { - int x, y; /* location of window */ - int width, height; /* width and height of window */ - int border_width; /* border width of window */ - int depth; /* depth of window */ - Visual *visual; /* the associated visual structure */ - Window root; /* root of screen containing window */ -#if defined(__cplusplus) || defined(c_plusplus) - int c_class; /* C++ InputOutput, InputOnly*/ -#else - int class; /* InputOutput, InputOnly*/ -#endif - int bit_gravity; /* one of bit gravity values */ - int win_gravity; /* one of the window gravity values */ - int backing_store; /* NotUseful, WhenMapped, Always */ - unsigned long backing_planes;/* planes to be preserved if possible */ - unsigned long backing_pixel;/* value to be used when restoring planes */ - Bool save_under; /* boolean, should bits under be saved? */ - Colormap colormap; /* color map to be associated with window */ - Bool map_installed; /* boolean, is color map currently installed*/ - int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ - long all_event_masks; /* set of events all people have interest in*/ - long your_event_mask; /* my event mask */ - long do_not_propagate_mask; /* set of events that should not propagate */ - Bool override_redirect; /* boolean value for override-redirect */ - Screen *screen; /* back pointer to correct screen */ -} XWindowAttributes; - -/* - * Data structure for host setting; getting routines. - * - */ - -typedef struct { - int family; /* for example FamilyInternet */ - int length; /* length of address, in bytes */ - char *address; /* pointer to where to find the bytes */ -} XHostAddress; - -/* - * Data structure for ServerFamilyInterpreted addresses in host routines - */ -typedef struct { - int typelength; /* length of type string, in bytes */ - int valuelength; /* length of value string, in bytes */ - char *type; /* pointer to where to find the type string */ - char *value; /* pointer to where to find the address */ -} XServerInterpretedAddress; - -/* - * Data structure for "image" data, used by image manipulation routines. - */ -typedef struct _XImage { - int width, height; /* size of image */ - int xoffset; /* number of pixels offset in X direction */ - int format; /* XYBitmap, XYPixmap, ZPixmap */ - char *data; /* pointer to image data */ - int byte_order; /* data byte order, LSBFirst, MSBFirst */ - int bitmap_unit; /* quant. of scanline 8, 16, 32 */ - int bitmap_bit_order; /* LSBFirst, MSBFirst */ - int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ - int depth; /* depth of image */ - int bytes_per_line; /* accelarator to next line */ - int bits_per_pixel; /* bits per pixel (ZPixmap) */ - unsigned long red_mask; /* bits in z arrangment */ - unsigned long green_mask; - unsigned long blue_mask; - XPointer obdata; /* hook for the object routines to hang on */ - struct funcs { /* image manipulation routines */ - struct _XImage *(*create_image)( - struct _XDisplay* /* display */, - Visual* /* visual */, - unsigned int /* depth */, - int /* format */, - int /* offset */, - char* /* data */, - unsigned int /* width */, - unsigned int /* height */, - int /* bitmap_pad */, - int /* bytes_per_line */); - int (*destroy_image) (struct _XImage *); - unsigned long (*get_pixel) (struct _XImage *, int, int); - int (*put_pixel) (struct _XImage *, int, int, unsigned long); - struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int); - int (*add_pixel) (struct _XImage *, long); - } f; -} XImage; - -/* - * Data structure for XReconfigureWindow - */ -typedef struct { - int x, y; - int width, height; - int border_width; - Window sibling; - int stack_mode; -} XWindowChanges; - -/* - * Data structure used by color operations - */ -typedef struct { - unsigned long pixel; - unsigned short red, green, blue; - char flags; /* do_red, do_green, do_blue */ - char pad; -} XColor; - -/* - * Data structures for graphics operations. On most machines, these are - * congruent with the wire protocol structures, so reformatting the data - * can be avoided on these architectures. - */ -typedef struct { - short x1, y1, x2, y2; -} XSegment; - -typedef struct { - short x, y; -} XPoint; - -typedef struct { - short x, y; - unsigned short width, height; -} XRectangle; - -typedef struct { - short x, y; - unsigned short width, height; - short angle1, angle2; -} XArc; - - -/* Data structure for XChangeKeyboardControl */ - -typedef struct { - int key_click_percent; - int bell_percent; - int bell_pitch; - int bell_duration; - int led; - int led_mode; - int key; - int auto_repeat_mode; /* On, Off, Default */ -} XKeyboardControl; - -/* Data structure for XGetKeyboardControl */ - -typedef struct { - int key_click_percent; - int bell_percent; - unsigned int bell_pitch, bell_duration; - unsigned long led_mask; - int global_auto_repeat; - char auto_repeats[32]; -} XKeyboardState; - -/* Data structure for XGetMotionEvents. */ - -typedef struct { - Time time; - short x, y; -} XTimeCoord; - -/* Data structure for X{Set,Get}ModifierMapping */ - -typedef struct { - int max_keypermod; /* The server's max # of keys per modifier */ - KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */ -} XModifierKeymap; - - -/* - * Display datatype maintaining display specific data. - * The contents of this structure are implementation dependent. - * A Display should be treated as opaque by application code. - */ -#ifndef XLIB_ILLEGAL_ACCESS -typedef struct _XDisplay Display; -#endif - -struct _XPrivate; /* Forward declare before use for C++ */ -struct _XrmHashBucketRec; - -typedef struct -#ifdef XLIB_ILLEGAL_ACCESS -_XDisplay -#endif -{ - XExtData *ext_data; /* hook for extension to hang data */ - struct _XPrivate *private1; - int fd; /* Network socket. */ - int private2; - int proto_major_version;/* major version of server's X protocol */ - int proto_minor_version;/* minor version of servers X protocol */ - char *vendor; /* vendor of the server hardware */ - XID private3; - XID private4; - XID private5; - int private6; - XID (*resource_alloc)( /* allocator function */ - struct _XDisplay* - ); - int byte_order; /* screen byte order, LSBFirst, MSBFirst */ - int bitmap_unit; /* padding and data requirements */ - int bitmap_pad; /* padding requirements on bitmaps */ - int bitmap_bit_order; /* LeastSignificant or MostSignificant */ - int nformats; /* number of pixmap formats in list */ - ScreenFormat *pixmap_format; /* pixmap format list */ - int private8; - int release; /* release of the server */ - struct _XPrivate *private9, *private10; - int qlen; /* Length of input event queue */ - unsigned long last_request_read; /* seq number of last event read */ - unsigned long request; /* sequence number of last request. */ - XPointer private11; - XPointer private12; - XPointer private13; - XPointer private14; - unsigned max_request_size; /* maximum number 32 bit words in request*/ - struct _XrmHashBucketRec *db; - int (*private15)( - struct _XDisplay* - ); - char *display_name; /* "host:display" string used on this connect*/ - int default_screen; /* default screen for operations */ - int nscreens; /* number of screens on this server*/ - Screen *screens; /* pointer to list of screens */ - unsigned long motion_buffer; /* size of motion buffer */ - unsigned long private16; - int min_keycode; /* minimum defined keycode */ - int max_keycode; /* maximum defined keycode */ - XPointer private17; - XPointer private18; - int private19; - char *xdefaults; /* contents of defaults from server */ - /* there is more to this structure, but it is private to Xlib */ -} -#ifdef XLIB_ILLEGAL_ACCESS -Display, -#endif -*_XPrivDisplay; - -#undef _XEVENT_ -#ifndef _XEVENT_ -/* - * Definitions of specific events. - */ -typedef struct { - int type; /* of event */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* "event" window it is reported relative to */ - Window root; /* root window that the event occurred on */ - Window subwindow; /* child window */ - Time time; /* milliseconds */ - int x, y; /* pointer x, y coordinates in event window */ - int x_root, y_root; /* coordinates relative to root */ - unsigned int state; /* key or button mask */ - unsigned int keycode; /* detail */ - Bool same_screen; /* same screen flag */ -} XKeyEvent; -typedef XKeyEvent XKeyPressedEvent; -typedef XKeyEvent XKeyReleasedEvent; - -typedef struct { - int type; /* of event */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* "event" window it is reported relative to */ - Window root; /* root window that the event occurred on */ - Window subwindow; /* child window */ - Time time; /* milliseconds */ - int x, y; /* pointer x, y coordinates in event window */ - int x_root, y_root; /* coordinates relative to root */ - unsigned int state; /* key or button mask */ - unsigned int button; /* detail */ - Bool same_screen; /* same screen flag */ -} XButtonEvent; -typedef XButtonEvent XButtonPressedEvent; -typedef XButtonEvent XButtonReleasedEvent; - -typedef struct { - int type; /* of event */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* "event" window reported relative to */ - Window root; /* root window that the event occurred on */ - Window subwindow; /* child window */ - Time time; /* milliseconds */ - int x, y; /* pointer x, y coordinates in event window */ - int x_root, y_root; /* coordinates relative to root */ - unsigned int state; /* key or button mask */ - char is_hint; /* detail */ - Bool same_screen; /* same screen flag */ -} XMotionEvent; -typedef XMotionEvent XPointerMovedEvent; - -typedef struct { - int type; /* of event */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* "event" window reported relative to */ - Window root; /* root window that the event occurred on */ - Window subwindow; /* child window */ - Time time; /* milliseconds */ - int x, y; /* pointer x, y coordinates in event window */ - int x_root, y_root; /* coordinates relative to root */ - int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ - int detail; - /* - * NotifyAncestor, NotifyVirtual, NotifyInferior, - * NotifyNonlinear,NotifyNonlinearVirtual - */ - Bool same_screen; /* same screen flag */ - Bool focus; /* boolean focus */ - unsigned int state; /* key or button mask */ -} XCrossingEvent; -typedef XCrossingEvent XEnterWindowEvent; -typedef XCrossingEvent XLeaveWindowEvent; - -typedef struct { - int type; /* FocusIn or FocusOut */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* window of event */ - int mode; /* NotifyNormal, NotifyWhileGrabbed, - NotifyGrab, NotifyUngrab */ - int detail; - /* - * NotifyAncestor, NotifyVirtual, NotifyInferior, - * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, - * NotifyPointerRoot, NotifyDetailNone - */ -} XFocusChangeEvent; -typedef XFocusChangeEvent XFocusInEvent; -typedef XFocusChangeEvent XFocusOutEvent; - -/* generated on EnterWindow and FocusIn when KeyMapState selected */ -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - char key_vector[32]; -} XKeymapEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - int x, y; - int width, height; - int count; /* if non-zero, at least this many more */ -} XExposeEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Drawable drawable; - int x, y; - int width, height; - int count; /* if non-zero, at least this many more */ - int major_code; /* core is CopyArea or CopyPlane */ - int minor_code; /* not defined in the core */ -} XGraphicsExposeEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Drawable drawable; - int major_code; /* core is CopyArea or CopyPlane */ - int minor_code; /* not defined in the core */ -} XNoExposeEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - int state; /* Visibility state */ -} XVisibilityEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; /* parent of the window */ - Window window; /* window id of window created */ - int x, y; /* window location */ - int width, height; /* size of window */ - int border_width; /* border width */ - Bool override_redirect; /* creation should be overridden */ -} XCreateWindowEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; -} XDestroyWindowEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - Bool from_configure; -} XUnmapEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - Bool override_redirect; /* boolean, is override set... */ -} XMapEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; - Window window; -} XMapRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - Window parent; - int x, y; - Bool override_redirect; -} XReparentEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - int x, y; - int width, height; - int border_width; - Window above; - Bool override_redirect; -} XConfigureEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - int x, y; -} XGravityEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - int width, height; -} XResizeRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; - Window window; - int x, y; - int width, height; - int border_width; - Window above; - int detail; /* Above, Below, TopIf, BottomIf, Opposite */ - unsigned long value_mask; -} XConfigureRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - int place; /* PlaceOnTop, PlaceOnBottom */ -} XCirculateEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; - Window window; - int place; /* PlaceOnTop, PlaceOnBottom */ -} XCirculateRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - Atom atom; - Time time; - int state; /* NewValue, Deleted */ -} XPropertyEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - Atom selection; - Time time; -} XSelectionClearEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window owner; - Window requestor; - Atom selection; - Atom target; - Atom property; - Time time; -} XSelectionRequestEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window requestor; - Atom selection; - Atom target; - Atom property; /* ATOM or None */ - Time time; -} XSelectionEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - Colormap colormap; /* COLORMAP or None */ -#if defined(__cplusplus) || defined(c_plusplus) - Bool c_new; /* C++ */ -#else - Bool new; -#endif - int state; /* ColormapInstalled, ColormapUninstalled */ -} XColormapEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; - Atom message_type; - int format; - union { - char b[20]; - short s[10]; - long l[5]; - } data; -} XClientMessageEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; /* unused */ - int request; /* one of MappingModifier, MappingKeyboard, - MappingPointer */ - int first_keycode; /* first keycode */ - int count; /* defines range of change w. first_keycode*/ -} XMappingEvent; - -typedef struct { - int type; - Display *display; /* Display the event was read from */ - XID resourceid; /* resource id */ - unsigned long serial; /* serial number of failed request */ - unsigned char error_code; /* error code of failed request */ - unsigned char request_code; /* Major op-code of failed request */ - unsigned char minor_code; /* Minor op-code of failed request */ -} XErrorEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display;/* Display the event was read from */ - Window window; /* window on which event was requested in event mask */ -} XAnyEvent; - -/* - * this union is defined so Xlib can always use the same sized - * event structure internally, to avoid memory fragmentation. - */ -typedef union _XEvent { - int type; /* must not be changed; first element */ - XAnyEvent xany; - XKeyEvent xkey; - XButtonEvent xbutton; - XMotionEvent xmotion; - XCrossingEvent xcrossing; - XFocusChangeEvent xfocus; - XExposeEvent xexpose; - XGraphicsExposeEvent xgraphicsexpose; - XNoExposeEvent xnoexpose; - XVisibilityEvent xvisibility; - XCreateWindowEvent xcreatewindow; - XDestroyWindowEvent xdestroywindow; - XUnmapEvent xunmap; - XMapEvent xmap; - XMapRequestEvent xmaprequest; - XReparentEvent xreparent; - XConfigureEvent xconfigure; - XGravityEvent xgravity; - XResizeRequestEvent xresizerequest; - XConfigureRequestEvent xconfigurerequest; - XCirculateEvent xcirculate; - XCirculateRequestEvent xcirculaterequest; - XPropertyEvent xproperty; - XSelectionClearEvent xselectionclear; - XSelectionRequestEvent xselectionrequest; - XSelectionEvent xselection; - XColormapEvent xcolormap; - XClientMessageEvent xclient; - XMappingEvent xmapping; - XErrorEvent xerror; - XKeymapEvent xkeymap; - long pad[24]; -} XEvent; -#endif - -#define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy))) - -/* - * per character font metric information. - */ -typedef struct { - short lbearing; /* origin to left edge of raster */ - short rbearing; /* origin to right edge of raster */ - short width; /* advance to next char's origin */ - short ascent; /* baseline to top edge of raster */ - short descent; /* baseline to bottom edge of raster */ - unsigned short attributes; /* per char flags (not predefined) */ -} XCharStruct; - -/* - * To allow arbitrary information with fonts, there are additional properties - * returned. - */ -typedef struct { - Atom name; - unsigned long card32; -} XFontProp; - -typedef struct { - XExtData *ext_data; /* hook for extension to hang data */ - Font fid; /* Font id for this font */ - unsigned direction; /* hint about direction the font is painted */ - unsigned min_char_or_byte2;/* first character */ - unsigned max_char_or_byte2;/* last character */ - unsigned min_byte1; /* first row that exists */ - unsigned max_byte1; /* last row that exists */ - Bool all_chars_exist;/* flag if all characters have non-zero size*/ - unsigned default_char; /* char to print for undefined character */ - int n_properties; /* how many properties there are */ - XFontProp *properties; /* pointer to array of additional properties*/ - XCharStruct min_bounds; /* minimum bounds over all existing char*/ - XCharStruct max_bounds; /* maximum bounds over all existing char*/ - XCharStruct *per_char; /* first_char to last_char information */ - int ascent; /* log. extent above baseline for spacing */ - int descent; /* log. descent below baseline for spacing */ -} XFontStruct; - -/* - * PolyText routines take these as arguments. - */ -typedef struct { - char *chars; /* pointer to string */ - int nchars; /* number of characters */ - int delta; /* delta between strings */ - Font font; /* font to print it in, None don't change */ -} XTextItem; - -typedef struct { /* normal 16 bit characters are two bytes */ - unsigned char byte1; - unsigned char byte2; -} XChar2b; - -typedef struct { - XChar2b *chars; /* two byte characters */ - int nchars; /* number of characters */ - int delta; /* delta between strings */ - Font font; /* font to print it in, None don't change */ -} XTextItem16; - - -typedef union { Display *display; - GC gc; - Visual *visual; - Screen *screen; - ScreenFormat *pixmap_format; - XFontStruct *font; } XEDataObject; - -typedef struct { - XRectangle max_ink_extent; - XRectangle max_logical_extent; -} XFontSetExtents; - -/* unused: -typedef void (*XOMProc)(); - */ - -typedef struct _XOM *XOM; -typedef struct _XOC *XOC, *XFontSet; - -typedef struct { - char *chars; - int nchars; - int delta; - XFontSet font_set; -} XmbTextItem; - -typedef struct { - wchar_t *chars; - int nchars; - int delta; - XFontSet font_set; -} XwcTextItem; - -#define XNRequiredCharSet "requiredCharSet" -#define XNQueryOrientation "queryOrientation" -#define XNBaseFontName "baseFontName" -#define XNOMAutomatic "omAutomatic" -#define XNMissingCharSet "missingCharSet" -#define XNDefaultString "defaultString" -#define XNOrientation "orientation" -#define XNDirectionalDependentDrawing "directionalDependentDrawing" -#define XNContextualDrawing "contextualDrawing" -#define XNFontInfo "fontInfo" - -typedef struct { - int charset_count; - char **charset_list; -} XOMCharSetList; - -typedef enum { - XOMOrientation_LTR_TTB, - XOMOrientation_RTL_TTB, - XOMOrientation_TTB_LTR, - XOMOrientation_TTB_RTL, - XOMOrientation_Context -} XOrientation; - -typedef struct { - int num_orientation; - XOrientation *orientation; /* Input Text description */ -} XOMOrientation; - -typedef struct { - int num_font; - XFontStruct **font_struct_list; - char **font_name_list; -} XOMFontInfo; - -typedef struct _XIM *XIM; -typedef struct _XIC *XIC; - -typedef void (*XIMProc)( - XIM, - XPointer, - XPointer -); - -typedef Bool (*XICProc)( - XIC, - XPointer, - XPointer -); - -typedef void (*XIDProc)( - Display*, - XPointer, - XPointer -); - -typedef unsigned long XIMStyle; - -typedef struct { - unsigned short count_styles; - XIMStyle *supported_styles; -} XIMStyles; - -#define XIMPreeditArea 0x0001L -#define XIMPreeditCallbacks 0x0002L -#define XIMPreeditPosition 0x0004L -#define XIMPreeditNothing 0x0008L -#define XIMPreeditNone 0x0010L -#define XIMStatusArea 0x0100L -#define XIMStatusCallbacks 0x0200L -#define XIMStatusNothing 0x0400L -#define XIMStatusNone 0x0800L - -#define XNVaNestedList "XNVaNestedList" -#define XNQueryInputStyle "queryInputStyle" -#define XNClientWindow "clientWindow" -#define XNInputStyle "inputStyle" -#define XNFocusWindow "focusWindow" -#define XNResourceName "resourceName" -#define XNResourceClass "resourceClass" -#define XNGeometryCallback "geometryCallback" -#define XNDestroyCallback "destroyCallback" -#define XNFilterEvents "filterEvents" -#define XNPreeditStartCallback "preeditStartCallback" -#define XNPreeditDoneCallback "preeditDoneCallback" -#define XNPreeditDrawCallback "preeditDrawCallback" -#define XNPreeditCaretCallback "preeditCaretCallback" -#define XNPreeditStateNotifyCallback "preeditStateNotifyCallback" -#define XNPreeditAttributes "preeditAttributes" -#define XNStatusStartCallback "statusStartCallback" -#define XNStatusDoneCallback "statusDoneCallback" -#define XNStatusDrawCallback "statusDrawCallback" -#define XNStatusAttributes "statusAttributes" -#define XNArea "area" -#define XNAreaNeeded "areaNeeded" -#define XNSpotLocation "spotLocation" -#define XNColormap "colorMap" -#define XNStdColormap "stdColorMap" -#define XNForeground "foreground" -#define XNBackground "background" -#define XNBackgroundPixmap "backgroundPixmap" -#define XNFontSet "fontSet" -#define XNLineSpace "lineSpace" -#define XNCursor "cursor" - -#define XNQueryIMValuesList "queryIMValuesList" -#define XNQueryICValuesList "queryICValuesList" -#define XNVisiblePosition "visiblePosition" -#define XNR6PreeditCallback "r6PreeditCallback" -#define XNStringConversionCallback "stringConversionCallback" -#define XNStringConversion "stringConversion" -#define XNResetState "resetState" -#define XNHotKey "hotKey" -#define XNHotKeyState "hotKeyState" -#define XNPreeditState "preeditState" -#define XNSeparatorofNestedList "separatorofNestedList" - -#define XBufferOverflow -1 -#define XLookupNone 1 -#define XLookupChars 2 -#define XLookupKeySym 3 -#define XLookupBoth 4 - -typedef void *XVaNestedList; - -typedef struct { - XPointer client_data; - XIMProc callback; -} XIMCallback; - -typedef struct { - XPointer client_data; - XICProc callback; -} XICCallback; - -typedef unsigned long XIMFeedback; - -#define XIMReverse 1L -#define XIMUnderline (1L<<1) -#define XIMHighlight (1L<<2) -#define XIMPrimary (1L<<5) -#define XIMSecondary (1L<<6) -#define XIMTertiary (1L<<7) -#define XIMVisibleToForward (1L<<8) -#define XIMVisibleToBackword (1L<<9) -#define XIMVisibleToCenter (1L<<10) - -typedef struct _XIMText { - unsigned short length; - XIMFeedback *feedback; - Bool encoding_is_wchar; - union { - char *multi_byte; - wchar_t *wide_char; - } string; -} XIMText; - -typedef unsigned long XIMPreeditState; - -#define XIMPreeditUnKnown 0L -#define XIMPreeditEnable 1L -#define XIMPreeditDisable (1L<<1) - -typedef struct _XIMPreeditStateNotifyCallbackStruct { - XIMPreeditState state; -} XIMPreeditStateNotifyCallbackStruct; - -typedef unsigned long XIMResetState; - -#define XIMInitialState 1L -#define XIMPreserveState (1L<<1) - -typedef unsigned long XIMStringConversionFeedback; - -#define XIMStringConversionLeftEdge (0x00000001) -#define XIMStringConversionRightEdge (0x00000002) -#define XIMStringConversionTopEdge (0x00000004) -#define XIMStringConversionBottomEdge (0x00000008) -#define XIMStringConversionConcealed (0x00000010) -#define XIMStringConversionWrapped (0x00000020) - -typedef struct _XIMStringConversionText { - unsigned short length; - XIMStringConversionFeedback *feedback; - Bool encoding_is_wchar; - union { - char *mbs; - wchar_t *wcs; - } string; -} XIMStringConversionText; - -typedef unsigned short XIMStringConversionPosition; - -typedef unsigned short XIMStringConversionType; - -#define XIMStringConversionBuffer (0x0001) -#define XIMStringConversionLine (0x0002) -#define XIMStringConversionWord (0x0003) -#define XIMStringConversionChar (0x0004) - -typedef unsigned short XIMStringConversionOperation; - -#define XIMStringConversionSubstitution (0x0001) -#define XIMStringConversionRetrieval (0x0002) - -typedef enum { - XIMForwardChar, XIMBackwardChar, - XIMForwardWord, XIMBackwardWord, - XIMCaretUp, XIMCaretDown, - XIMNextLine, XIMPreviousLine, - XIMLineStart, XIMLineEnd, - XIMAbsolutePosition, - XIMDontChange -} XIMCaretDirection; - -typedef struct _XIMStringConversionCallbackStruct { - XIMStringConversionPosition position; - XIMCaretDirection direction; - XIMStringConversionOperation operation; - unsigned short factor; - XIMStringConversionText *text; -} XIMStringConversionCallbackStruct; - -typedef struct _XIMPreeditDrawCallbackStruct { - int caret; /* Cursor offset within pre-edit string */ - int chg_first; /* Starting change position */ - int chg_length; /* Length of the change in character count */ - XIMText *text; -} XIMPreeditDrawCallbackStruct; - -typedef enum { - XIMIsInvisible, /* Disable caret feedback */ - XIMIsPrimary, /* UI defined caret feedback */ - XIMIsSecondary /* UI defined caret feedback */ -} XIMCaretStyle; - -typedef struct _XIMPreeditCaretCallbackStruct { - int position; /* Caret offset within pre-edit string */ - XIMCaretDirection direction; /* Caret moves direction */ - XIMCaretStyle style; /* Feedback of the caret */ -} XIMPreeditCaretCallbackStruct; - -typedef enum { - XIMTextType, - XIMBitmapType -} XIMStatusDataType; - -typedef struct _XIMStatusDrawCallbackStruct { - XIMStatusDataType type; - union { - XIMText *text; - Pixmap bitmap; - } data; -} XIMStatusDrawCallbackStruct; - -typedef struct _XIMHotKeyTrigger { - KeySym keysym; - int modifier; - int modifier_mask; -} XIMHotKeyTrigger; - -typedef struct _XIMHotKeyTriggers { - int num_hot_key; - XIMHotKeyTrigger *key; -} XIMHotKeyTriggers; - -typedef unsigned long XIMHotKeyState; - -#define XIMHotKeyStateON (0x0001L) -#define XIMHotKeyStateOFF (0x0002L) - -typedef struct { - unsigned short count_values; - char **supported_values; -} XIMValuesList; - -_XFUNCPROTOBEGIN - -#if defined(WIN32) && !defined(_XLIBINT_) -#define _Xdebug (*_Xdebug_p) -#endif - -extern int _Xdebug; - -extern XFontStruct *XLoadQueryFont( - Display* /* display */, - _Xconst char* /* name */ -); - -extern XFontStruct *XQueryFont( - Display* /* display */, - XID /* font_ID */ -); - - -extern XTimeCoord *XGetMotionEvents( - Display* /* display */, - Window /* w */, - Time /* start */, - Time /* stop */, - int* /* nevents_return */ -); - -extern XModifierKeymap *XDeleteModifiermapEntry( - XModifierKeymap* /* modmap */, -#if NeedWidePrototypes - unsigned int /* keycode_entry */, -#else - KeyCode /* keycode_entry */, -#endif - int /* modifier */ -); - -extern XModifierKeymap *XGetModifierMapping( - Display* /* display */ -); - -extern XModifierKeymap *XInsertModifiermapEntry( - XModifierKeymap* /* modmap */, -#if NeedWidePrototypes - unsigned int /* keycode_entry */, -#else - KeyCode /* keycode_entry */, -#endif - int /* modifier */ -); - -extern XModifierKeymap *XNewModifiermap( - int /* max_keys_per_mod */ -); - -extern XImage *XCreateImage( - Display* /* display */, - Visual* /* visual */, - unsigned int /* depth */, - int /* format */, - int /* offset */, - char* /* data */, - unsigned int /* width */, - unsigned int /* height */, - int /* bitmap_pad */, - int /* bytes_per_line */ -); -extern Status XInitImage( - XImage* /* image */ -); -extern XImage *XGetImage( - Display* /* display */, - Drawable /* d */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - unsigned long /* plane_mask */, - int /* format */ -); -extern XImage *XGetSubImage( - Display* /* display */, - Drawable /* d */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - unsigned long /* plane_mask */, - int /* format */, - XImage* /* dest_image */, - int /* dest_x */, - int /* dest_y */ -); - -/* - * X function declarations. - */ -extern Display *XOpenDisplay( - _Xconst char* /* display_name */ -); - -extern void XrmInitialize( - void -); - -extern char *XFetchBytes( - Display* /* display */, - int* /* nbytes_return */ -); -extern char *XFetchBuffer( - Display* /* display */, - int* /* nbytes_return */, - int /* buffer */ -); -extern char *XGetAtomName( - Display* /* display */, - Atom /* atom */ -); -extern Status XGetAtomNames( - Display* /* dpy */, - Atom* /* atoms */, - int /* count */, - char** /* names_return */ -); -extern char *XGetDefault( - Display* /* display */, - _Xconst char* /* program */, - _Xconst char* /* option */ -); -extern char *XDisplayName( - _Xconst char* /* string */ -); -extern char *XKeysymToString( - KeySym /* keysym */ -); - -extern int (*XSynchronize( - Display* /* display */, - Bool /* onoff */ -))( - Display* /* display */ -); -extern int (*XSetAfterFunction( - Display* /* display */, - int (*) ( - Display* /* display */ - ) /* procedure */ -))( - Display* /* display */ -); -extern Atom XInternAtom( - Display* /* display */, - _Xconst char* /* atom_name */, - Bool /* only_if_exists */ -); -extern Status XInternAtoms( - Display* /* dpy */, - char** /* names */, - int /* count */, - Bool /* onlyIfExists */, - Atom* /* atoms_return */ -); -extern Colormap XCopyColormapAndFree( - Display* /* display */, - Colormap /* colormap */ -); -extern Colormap XCreateColormap( - Display* /* display */, - Window /* w */, - Visual* /* visual */, - int /* alloc */ -); -extern Cursor XCreatePixmapCursor( - Display* /* display */, - Pixmap /* source */, - Pixmap /* mask */, - XColor* /* foreground_color */, - XColor* /* background_color */, - unsigned int /* x */, - unsigned int /* y */ -); -extern Cursor XCreateGlyphCursor( - Display* /* display */, - Font /* source_font */, - Font /* mask_font */, - unsigned int /* source_char */, - unsigned int /* mask_char */, - XColor _Xconst * /* foreground_color */, - XColor _Xconst * /* background_color */ -); -extern Cursor XCreateFontCursor( - Display* /* display */, - unsigned int /* shape */ -); -extern Font XLoadFont( - Display* /* display */, - _Xconst char* /* name */ -); -extern GC XCreateGC( - Display* /* display */, - Drawable /* d */, - unsigned long /* valuemask */, - XGCValues* /* values */ -); -extern GContext XGContextFromGC( - GC /* gc */ -); -extern void XFlushGC( - Display* /* display */, - GC /* gc */ -); -extern Pixmap XCreatePixmap( - Display* /* display */, - Drawable /* d */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int /* depth */ -); -extern Pixmap XCreateBitmapFromData( - Display* /* display */, - Drawable /* d */, - _Xconst char* /* data */, - unsigned int /* width */, - unsigned int /* height */ -); -extern Pixmap XCreatePixmapFromBitmapData( - Display* /* display */, - Drawable /* d */, - char* /* data */, - unsigned int /* width */, - unsigned int /* height */, - unsigned long /* fg */, - unsigned long /* bg */, - unsigned int /* depth */ -); -extern Window XCreateSimpleWindow( - Display* /* display */, - Window /* parent */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int /* border_width */, - unsigned long /* border */, - unsigned long /* background */ -); -extern Window XGetSelectionOwner( - Display* /* display */, - Atom /* selection */ -); -extern Window XCreateWindow( - Display* /* display */, - Window /* parent */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int /* border_width */, - int /* depth */, - unsigned int /* class */, - Visual* /* visual */, - unsigned long /* valuemask */, - XSetWindowAttributes* /* attributes */ -); -extern Colormap *XListInstalledColormaps( - Display* /* display */, - Window /* w */, - int* /* num_return */ -); -extern char **XListFonts( - Display* /* display */, - _Xconst char* /* pattern */, - int /* maxnames */, - int* /* actual_count_return */ -); -extern char **XListFontsWithInfo( - Display* /* display */, - _Xconst char* /* pattern */, - int /* maxnames */, - int* /* count_return */, - XFontStruct** /* info_return */ -); -extern char **XGetFontPath( - Display* /* display */, - int* /* npaths_return */ -); -extern char **XListExtensions( - Display* /* display */, - int* /* nextensions_return */ -); -extern Atom *XListProperties( - Display* /* display */, - Window /* w */, - int* /* num_prop_return */ -); -extern XHostAddress *XListHosts( - Display* /* display */, - int* /* nhosts_return */, - Bool* /* state_return */ -); -extern KeySym XKeycodeToKeysym( - Display* /* display */, -#if NeedWidePrototypes - unsigned int /* keycode */, -#else - KeyCode /* keycode */, -#endif - int /* index */ -); -extern KeySym XLookupKeysym( - XKeyEvent* /* key_event */, - int /* index */ -); -extern KeySym *XGetKeyboardMapping( - Display* /* display */, -#if NeedWidePrototypes - unsigned int /* first_keycode */, -#else - KeyCode /* first_keycode */, -#endif - int /* keycode_count */, - int* /* keysyms_per_keycode_return */ -); -extern KeySym XStringToKeysym( - _Xconst char* /* string */ -); -extern long XMaxRequestSize( - Display* /* display */ -); -extern long XExtendedMaxRequestSize( - Display* /* display */ -); -extern char *XResourceManagerString( - Display* /* display */ -); -extern char *XScreenResourceString( - Screen* /* screen */ -); -extern unsigned long XDisplayMotionBufferSize( - Display* /* display */ -); -extern VisualID XVisualIDFromVisual( - Visual* /* visual */ -); - -/* multithread routines */ - -extern Status XInitThreads( - void -); - -extern void XLockDisplay( - Display* /* display */ -); - -extern void XUnlockDisplay( - Display* /* display */ -); - -/* routines for dealing with extensions */ - -extern XExtCodes *XInitExtension( - Display* /* display */, - _Xconst char* /* name */ -); - -extern XExtCodes *XAddExtension( - Display* /* display */ -); -extern XExtData *XFindOnExtensionList( - XExtData** /* structure */, - int /* number */ -); -extern XExtData **XEHeadOfExtensionList( - XEDataObject /* object */ -); - -/* these are routines for which there are also macros */ -extern Window XRootWindow( - Display* /* display */, - int /* screen_number */ -); -extern Window XDefaultRootWindow( - Display* /* display */ -); -extern Window XRootWindowOfScreen( - Screen* /* screen */ -); -extern Visual *XDefaultVisual( - Display* /* display */, - int /* screen_number */ -); -extern Visual *XDefaultVisualOfScreen( - Screen* /* screen */ -); -extern GC XDefaultGC( - Display* /* display */, - int /* screen_number */ -); -extern GC XDefaultGCOfScreen( - Screen* /* screen */ -); -extern unsigned long XBlackPixel( - Display* /* display */, - int /* screen_number */ -); -extern unsigned long XWhitePixel( - Display* /* display */, - int /* screen_number */ -); -extern unsigned long XAllPlanes( - void -); -extern unsigned long XBlackPixelOfScreen( - Screen* /* screen */ -); -extern unsigned long XWhitePixelOfScreen( - Screen* /* screen */ -); -extern unsigned long XNextRequest( - Display* /* display */ -); -extern unsigned long XLastKnownRequestProcessed( - Display* /* display */ -); -extern char *XServerVendor( - Display* /* display */ -); -extern char *XDisplayString( - Display* /* display */ -); -extern Colormap XDefaultColormap( - Display* /* display */, - int /* screen_number */ -); -extern Colormap XDefaultColormapOfScreen( - Screen* /* screen */ -); -extern Display *XDisplayOfScreen( - Screen* /* screen */ -); -extern Screen *XScreenOfDisplay( - Display* /* display */, - int /* screen_number */ -); -extern Screen *XDefaultScreenOfDisplay( - Display* /* display */ -); -extern long XEventMaskOfScreen( - Screen* /* screen */ -); - -extern int XScreenNumberOfScreen( - Screen* /* screen */ -); - -typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */ - Display* /* display */, - XErrorEvent* /* error_event */ -); - -extern XErrorHandler XSetErrorHandler ( - XErrorHandler /* handler */ -); - - -typedef int (*XIOErrorHandler) ( /* WARNING, this type not in Xlib spec */ - Display* /* display */ -); - -extern XIOErrorHandler XSetIOErrorHandler ( - XIOErrorHandler /* handler */ -); - - -extern XPixmapFormatValues *XListPixmapFormats( - Display* /* display */, - int* /* count_return */ -); -extern int *XListDepths( - Display* /* display */, - int /* screen_number */, - int* /* count_return */ -); - -/* ICCCM routines for things that don't require special include files; */ -/* other declarations are given in Xutil.h */ -extern Status XReconfigureWMWindow( - Display* /* display */, - Window /* w */, - int /* screen_number */, - unsigned int /* mask */, - XWindowChanges* /* changes */ -); - -extern Status XGetWMProtocols( - Display* /* display */, - Window /* w */, - Atom** /* protocols_return */, - int* /* count_return */ -); -extern Status XSetWMProtocols( - Display* /* display */, - Window /* w */, - Atom* /* protocols */, - int /* count */ -); -extern Status XIconifyWindow( - Display* /* display */, - Window /* w */, - int /* screen_number */ -); -extern Status XWithdrawWindow( - Display* /* display */, - Window /* w */, - int /* screen_number */ -); -extern Status XGetCommand( - Display* /* display */, - Window /* w */, - char*** /* argv_return */, - int* /* argc_return */ -); -extern Status XGetWMColormapWindows( - Display* /* display */, - Window /* w */, - Window** /* windows_return */, - int* /* count_return */ -); -extern Status XSetWMColormapWindows( - Display* /* display */, - Window /* w */, - Window* /* colormap_windows */, - int /* count */ -); -extern void XFreeStringList( - char** /* list */ -); -extern int XSetTransientForHint( - Display* /* display */, - Window /* w */, - Window /* prop_window */ -); - -/* The following are given in alphabetical order */ - -extern int XActivateScreenSaver( - Display* /* display */ -); - -extern int XAddHost( - Display* /* display */, - XHostAddress* /* host */ -); - -extern int XAddHosts( - Display* /* display */, - XHostAddress* /* hosts */, - int /* num_hosts */ -); - -extern int XAddToExtensionList( - struct _XExtData** /* structure */, - XExtData* /* ext_data */ -); - -extern int XAddToSaveSet( - Display* /* display */, - Window /* w */ -); - -extern Status XAllocColor( - Display* /* display */, - Colormap /* colormap */, - XColor* /* screen_in_out */ -); - -extern Status XAllocColorCells( - Display* /* display */, - Colormap /* colormap */, - Bool /* contig */, - unsigned long* /* plane_masks_return */, - unsigned int /* nplanes */, - unsigned long* /* pixels_return */, - unsigned int /* npixels */ -); - -extern Status XAllocColorPlanes( - Display* /* display */, - Colormap /* colormap */, - Bool /* contig */, - unsigned long* /* pixels_return */, - int /* ncolors */, - int /* nreds */, - int /* ngreens */, - int /* nblues */, - unsigned long* /* rmask_return */, - unsigned long* /* gmask_return */, - unsigned long* /* bmask_return */ -); - -extern Status XAllocNamedColor( - Display* /* display */, - Colormap /* colormap */, - _Xconst char* /* color_name */, - XColor* /* screen_def_return */, - XColor* /* exact_def_return */ -); - -extern int XAllowEvents( - Display* /* display */, - int /* event_mode */, - Time /* time */ -); - -extern int XAutoRepeatOff( - Display* /* display */ -); - -extern int XAutoRepeatOn( - Display* /* display */ -); - -extern int XBell( - Display* /* display */, - int /* percent */ -); - -extern int XBitmapBitOrder( - Display* /* display */ -); - -extern int XBitmapPad( - Display* /* display */ -); - -extern int XBitmapUnit( - Display* /* display */ -); - -extern int XCellsOfScreen( - Screen* /* screen */ -); - -extern int XChangeActivePointerGrab( - Display* /* display */, - unsigned int /* event_mask */, - Cursor /* cursor */, - Time /* time */ -); - -extern int XChangeGC( - Display* /* display */, - GC /* gc */, - unsigned long /* valuemask */, - XGCValues* /* values */ -); - -extern int XChangeKeyboardControl( - Display* /* display */, - unsigned long /* value_mask */, - XKeyboardControl* /* values */ -); - -extern int XChangeKeyboardMapping( - Display* /* display */, - int /* first_keycode */, - int /* keysyms_per_keycode */, - KeySym* /* keysyms */, - int /* num_codes */ -); - -extern int XChangePointerControl( - Display* /* display */, - Bool /* do_accel */, - Bool /* do_threshold */, - int /* accel_numerator */, - int /* accel_denominator */, - int /* threshold */ -); - -extern int XChangeProperty( - Display* /* display */, - Window /* w */, - Atom /* property */, - Atom /* type */, - int /* format */, - int /* mode */, - _Xconst unsigned char* /* data */, - int /* nelements */ -); - -extern int XChangeSaveSet( - Display* /* display */, - Window /* w */, - int /* change_mode */ -); - -extern int XChangeWindowAttributes( - Display* /* display */, - Window /* w */, - unsigned long /* valuemask */, - XSetWindowAttributes* /* attributes */ -); - -extern Bool XCheckIfEvent( - Display* /* display */, - XEvent* /* event_return */, - Bool (*) ( - Display* /* display */, - XEvent* /* event */, - XPointer /* arg */ - ) /* predicate */, - XPointer /* arg */ -); - -extern Bool XCheckMaskEvent( - Display* /* display */, - long /* event_mask */, - XEvent* /* event_return */ -); - -extern Bool XCheckTypedEvent( - Display* /* display */, - int /* event_type */, - XEvent* /* event_return */ -); - -extern Bool XCheckTypedWindowEvent( - Display* /* display */, - Window /* w */, - int /* event_type */, - XEvent* /* event_return */ -); - -extern Bool XCheckWindowEvent( - Display* /* display */, - Window /* w */, - long /* event_mask */, - XEvent* /* event_return */ -); - -extern int XCirculateSubwindows( - Display* /* display */, - Window /* w */, - int /* direction */ -); - -extern int XCirculateSubwindowsDown( - Display* /* display */, - Window /* w */ -); - -extern int XCirculateSubwindowsUp( - Display* /* display */, - Window /* w */ -); - -extern int XClearArea( - Display* /* display */, - Window /* w */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - Bool /* exposures */ -); - -extern int XClearWindow( - Display* /* display */, - Window /* w */ -); - -extern int XCloseDisplay( - Display* /* display */ -); - -extern int XConfigureWindow( - Display* /* display */, - Window /* w */, - unsigned int /* value_mask */, - XWindowChanges* /* values */ -); - -extern int XConnectionNumber( - Display* /* display */ -); - -extern int XConvertSelection( - Display* /* display */, - Atom /* selection */, - Atom /* target */, - Atom /* property */, - Window /* requestor */, - Time /* time */ -); - -extern int XCopyArea( - Display* /* display */, - Drawable /* src */, - Drawable /* dest */, - GC /* gc */, - int /* src_x */, - int /* src_y */, - unsigned int /* width */, - unsigned int /* height */, - int /* dest_x */, - int /* dest_y */ -); - -extern int XCopyGC( - Display* /* display */, - GC /* src */, - unsigned long /* valuemask */, - GC /* dest */ -); - -extern int XCopyPlane( - Display* /* display */, - Drawable /* src */, - Drawable /* dest */, - GC /* gc */, - int /* src_x */, - int /* src_y */, - unsigned int /* width */, - unsigned int /* height */, - int /* dest_x */, - int /* dest_y */, - unsigned long /* plane */ -); - -extern int XDefaultDepth( - Display* /* display */, - int /* screen_number */ -); - -extern int XDefaultDepthOfScreen( - Screen* /* screen */ -); - -extern int XDefaultScreen( - Display* /* display */ -); - -extern int XDefineCursor( - Display* /* display */, - Window /* w */, - Cursor /* cursor */ -); - -extern int XDeleteProperty( - Display* /* display */, - Window /* w */, - Atom /* property */ -); - -extern int XDestroyWindow( - Display* /* display */, - Window /* w */ -); - -extern int XDestroySubwindows( - Display* /* display */, - Window /* w */ -); - -extern int XDoesBackingStore( - Screen* /* screen */ -); - -extern Bool XDoesSaveUnders( - Screen* /* screen */ -); - -extern int XDisableAccessControl( - Display* /* display */ -); - - -extern int XDisplayCells( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayHeight( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayHeightMM( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayKeycodes( - Display* /* display */, - int* /* min_keycodes_return */, - int* /* max_keycodes_return */ -); - -extern int XDisplayPlanes( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayWidth( - Display* /* display */, - int /* screen_number */ -); - -extern int XDisplayWidthMM( - Display* /* display */, - int /* screen_number */ -); - -extern int XDrawArc( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - int /* angle1 */, - int /* angle2 */ -); - -extern int XDrawArcs( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XArc* /* arcs */, - int /* narcs */ -); - -extern int XDrawImageString( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* string */, - int /* length */ -); - -extern int XDrawImageString16( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst XChar2b* /* string */, - int /* length */ -); - -extern int XDrawLine( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x1 */, - int /* y1 */, - int /* x2 */, - int /* y2 */ -); - -extern int XDrawLines( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XPoint* /* points */, - int /* npoints */, - int /* mode */ -); - -extern int XDrawPoint( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */ -); - -extern int XDrawPoints( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XPoint* /* points */, - int /* npoints */, - int /* mode */ -); - -extern int XDrawRectangle( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XDrawRectangles( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XRectangle* /* rectangles */, - int /* nrectangles */ -); - -extern int XDrawSegments( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XSegment* /* segments */, - int /* nsegments */ -); - -extern int XDrawString( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* string */, - int /* length */ -); - -extern int XDrawString16( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst XChar2b* /* string */, - int /* length */ -); - -extern int XDrawText( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XTextItem* /* items */, - int /* nitems */ -); - -extern int XDrawText16( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XTextItem16* /* items */, - int /* nitems */ -); - -extern int XEnableAccessControl( - Display* /* display */ -); - -extern int XEventsQueued( - Display* /* display */, - int /* mode */ -); - -extern Status XFetchName( - Display* /* display */, - Window /* w */, - char** /* window_name_return */ -); - -extern int XFillArc( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */, - int /* angle1 */, - int /* angle2 */ -); - -extern int XFillArcs( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XArc* /* arcs */, - int /* narcs */ -); - -extern int XFillPolygon( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XPoint* /* points */, - int /* npoints */, - int /* shape */, - int /* mode */ -); - -extern int XFillRectangle( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XFillRectangles( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XRectangle* /* rectangles */, - int /* nrectangles */ -); - -extern int XFlush( - Display* /* display */ -); - -extern int XForceScreenSaver( - Display* /* display */, - int /* mode */ -); - -extern int XFree( - void* /* data */ -); - -extern int XFreeColormap( - Display* /* display */, - Colormap /* colormap */ -); - -extern int XFreeColors( - Display* /* display */, - Colormap /* colormap */, - unsigned long* /* pixels */, - int /* npixels */, - unsigned long /* planes */ -); - -extern int XFreeCursor( - Display* /* display */, - Cursor /* cursor */ -); - -extern int XFreeExtensionList( - char** /* list */ -); - -extern int XFreeFont( - Display* /* display */, - XFontStruct* /* font_struct */ -); - -extern int XFreeFontInfo( - char** /* names */, - XFontStruct* /* free_info */, - int /* actual_count */ -); - -extern int XFreeFontNames( - char** /* list */ -); - -extern int XFreeFontPath( - char** /* list */ -); - -extern int XFreeGC( - Display* /* display */, - GC /* gc */ -); - -extern int XFreeModifiermap( - XModifierKeymap* /* modmap */ -); - -extern int XFreePixmap( - Display* /* display */, - Pixmap /* pixmap */ -); - -extern int XGeometry( - Display* /* display */, - int /* screen */, - _Xconst char* /* position */, - _Xconst char* /* default_position */, - unsigned int /* bwidth */, - unsigned int /* fwidth */, - unsigned int /* fheight */, - int /* xadder */, - int /* yadder */, - int* /* x_return */, - int* /* y_return */, - int* /* width_return */, - int* /* height_return */ -); - -extern int XGetErrorDatabaseText( - Display* /* display */, - _Xconst char* /* name */, - _Xconst char* /* message */, - _Xconst char* /* default_string */, - char* /* buffer_return */, - int /* length */ -); - -extern int XGetErrorText( - Display* /* display */, - int /* code */, - char* /* buffer_return */, - int /* length */ -); - -extern Bool XGetFontProperty( - XFontStruct* /* font_struct */, - Atom /* atom */, - unsigned long* /* value_return */ -); - -extern Status XGetGCValues( - Display* /* display */, - GC /* gc */, - unsigned long /* valuemask */, - XGCValues* /* values_return */ -); - -extern Status XGetGeometry( - Display* /* display */, - Drawable /* d */, - Window* /* root_return */, - int* /* x_return */, - int* /* y_return */, - unsigned int* /* width_return */, - unsigned int* /* height_return */, - unsigned int* /* border_width_return */, - unsigned int* /* depth_return */ -); - -extern Status XGetIconName( - Display* /* display */, - Window /* w */, - char** /* icon_name_return */ -); - -extern int XGetInputFocus( - Display* /* display */, - Window* /* focus_return */, - int* /* revert_to_return */ -); - -extern int XGetKeyboardControl( - Display* /* display */, - XKeyboardState* /* values_return */ -); - -extern int XGetPointerControl( - Display* /* display */, - int* /* accel_numerator_return */, - int* /* accel_denominator_return */, - int* /* threshold_return */ -); - -extern int XGetPointerMapping( - Display* /* display */, - unsigned char* /* map_return */, - int /* nmap */ -); - -extern int XGetScreenSaver( - Display* /* display */, - int* /* timeout_return */, - int* /* interval_return */, - int* /* prefer_blanking_return */, - int* /* allow_exposures_return */ -); - -extern Status XGetTransientForHint( - Display* /* display */, - Window /* w */, - Window* /* prop_window_return */ -); - -extern int XGetWindowProperty( - Display* /* display */, - Window /* w */, - Atom /* property */, - long /* long_offset */, - long /* long_length */, - Bool /* delete */, - Atom /* req_type */, - Atom* /* actual_type_return */, - int* /* actual_format_return */, - unsigned long* /* nitems_return */, - unsigned long* /* bytes_after_return */, - unsigned char** /* prop_return */ -); - -extern Status XGetWindowAttributes( - Display* /* display */, - Window /* w */, - XWindowAttributes* /* window_attributes_return */ -); - -extern int XGrabButton( - Display* /* display */, - unsigned int /* button */, - unsigned int /* modifiers */, - Window /* grab_window */, - Bool /* owner_events */, - unsigned int /* event_mask */, - int /* pointer_mode */, - int /* keyboard_mode */, - Window /* confine_to */, - Cursor /* cursor */ -); - -extern int XGrabKey( - Display* /* display */, - int /* keycode */, - unsigned int /* modifiers */, - Window /* grab_window */, - Bool /* owner_events */, - int /* pointer_mode */, - int /* keyboard_mode */ -); - -extern int XGrabKeyboard( - Display* /* display */, - Window /* grab_window */, - Bool /* owner_events */, - int /* pointer_mode */, - int /* keyboard_mode */, - Time /* time */ -); - -extern int XGrabPointer( - Display* /* display */, - Window /* grab_window */, - Bool /* owner_events */, - unsigned int /* event_mask */, - int /* pointer_mode */, - int /* keyboard_mode */, - Window /* confine_to */, - Cursor /* cursor */, - Time /* time */ -); - -extern int XGrabServer( - Display* /* display */ -); - -extern int XHeightMMOfScreen( - Screen* /* screen */ -); - -extern int XHeightOfScreen( - Screen* /* screen */ -); - -extern int XIfEvent( - Display* /* display */, - XEvent* /* event_return */, - Bool (*) ( - Display* /* display */, - XEvent* /* event */, - XPointer /* arg */ - ) /* predicate */, - XPointer /* arg */ -); - -extern int XImageByteOrder( - Display* /* display */ -); - -extern int XInstallColormap( - Display* /* display */, - Colormap /* colormap */ -); - -extern KeyCode XKeysymToKeycode( - Display* /* display */, - KeySym /* keysym */ -); - -extern int XKillClient( - Display* /* display */, - XID /* resource */ -); - -extern Status XLookupColor( - Display* /* display */, - Colormap /* colormap */, - _Xconst char* /* color_name */, - XColor* /* exact_def_return */, - XColor* /* screen_def_return */ -); - -extern int XLowerWindow( - Display* /* display */, - Window /* w */ -); - -extern int XMapRaised( - Display* /* display */, - Window /* w */ -); - -extern int XMapSubwindows( - Display* /* display */, - Window /* w */ -); - -extern int XMapWindow( - Display* /* display */, - Window /* w */ -); - -extern int XMaskEvent( - Display* /* display */, - long /* event_mask */, - XEvent* /* event_return */ -); - -extern int XMaxCmapsOfScreen( - Screen* /* screen */ -); - -extern int XMinCmapsOfScreen( - Screen* /* screen */ -); - -extern int XMoveResizeWindow( - Display* /* display */, - Window /* w */, - int /* x */, - int /* y */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XMoveWindow( - Display* /* display */, - Window /* w */, - int /* x */, - int /* y */ -); - -extern int XNextEvent( - Display* /* display */, - XEvent* /* event_return */ -); - -extern int XNoOp( - Display* /* display */ -); - -extern Status XParseColor( - Display* /* display */, - Colormap /* colormap */, - _Xconst char* /* spec */, - XColor* /* exact_def_return */ -); - -extern int XParseGeometry( - _Xconst char* /* parsestring */, - int* /* x_return */, - int* /* y_return */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern int XPeekEvent( - Display* /* display */, - XEvent* /* event_return */ -); - -extern int XPeekIfEvent( - Display* /* display */, - XEvent* /* event_return */, - Bool (*) ( - Display* /* display */, - XEvent* /* event */, - XPointer /* arg */ - ) /* predicate */, - XPointer /* arg */ -); - -extern int XPending( - Display* /* display */ -); - -extern int XPlanesOfScreen( - Screen* /* screen */ -); - -extern int XProtocolRevision( - Display* /* display */ -); - -extern int XProtocolVersion( - Display* /* display */ -); - - -extern int XPutBackEvent( - Display* /* display */, - XEvent* /* event */ -); - -extern int XPutImage( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - XImage* /* image */, - int /* src_x */, - int /* src_y */, - int /* dest_x */, - int /* dest_y */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XQLength( - Display* /* display */ -); - -extern Status XQueryBestCursor( - Display* /* display */, - Drawable /* d */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern Status XQueryBestSize( - Display* /* display */, - int /* class */, - Drawable /* which_screen */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern Status XQueryBestStipple( - Display* /* display */, - Drawable /* which_screen */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern Status XQueryBestTile( - Display* /* display */, - Drawable /* which_screen */, - unsigned int /* width */, - unsigned int /* height */, - unsigned int* /* width_return */, - unsigned int* /* height_return */ -); - -extern int XQueryColor( - Display* /* display */, - Colormap /* colormap */, - XColor* /* def_in_out */ -); - -extern int XQueryColors( - Display* /* display */, - Colormap /* colormap */, - XColor* /* defs_in_out */, - int /* ncolors */ -); - -extern Bool XQueryExtension( - Display* /* display */, - _Xconst char* /* name */, - int* /* major_opcode_return */, - int* /* first_event_return */, - int* /* first_error_return */ -); - -extern int XQueryKeymap( - Display* /* display */, - char [32] /* keys_return */ -); - -extern Bool XQueryPointer( - Display* /* display */, - Window /* w */, - Window* /* root_return */, - Window* /* child_return */, - int* /* root_x_return */, - int* /* root_y_return */, - int* /* win_x_return */, - int* /* win_y_return */, - unsigned int* /* mask_return */ -); - -extern int XQueryTextExtents( - Display* /* display */, - XID /* font_ID */, - _Xconst char* /* string */, - int /* nchars */, - int* /* direction_return */, - int* /* font_ascent_return */, - int* /* font_descent_return */, - XCharStruct* /* overall_return */ -); - -extern int XQueryTextExtents16( - Display* /* display */, - XID /* font_ID */, - _Xconst XChar2b* /* string */, - int /* nchars */, - int* /* direction_return */, - int* /* font_ascent_return */, - int* /* font_descent_return */, - XCharStruct* /* overall_return */ -); - -extern Status XQueryTree( - Display* /* display */, - Window /* w */, - Window* /* root_return */, - Window* /* parent_return */, - Window** /* children_return */, - unsigned int* /* nchildren_return */ -); - -extern int XRaiseWindow( - Display* /* display */, - Window /* w */ -); - -extern int XReadBitmapFile( - Display* /* display */, - Drawable /* d */, - _Xconst char* /* filename */, - unsigned int* /* width_return */, - unsigned int* /* height_return */, - Pixmap* /* bitmap_return */, - int* /* x_hot_return */, - int* /* y_hot_return */ -); - -extern int XReadBitmapFileData( - _Xconst char* /* filename */, - unsigned int* /* width_return */, - unsigned int* /* height_return */, - unsigned char** /* data_return */, - int* /* x_hot_return */, - int* /* y_hot_return */ -); - -extern int XRebindKeysym( - Display* /* display */, - KeySym /* keysym */, - KeySym* /* list */, - int /* mod_count */, - _Xconst unsigned char* /* string */, - int /* bytes_string */ -); - -extern int XRecolorCursor( - Display* /* display */, - Cursor /* cursor */, - XColor* /* foreground_color */, - XColor* /* background_color */ -); - -extern int XRefreshKeyboardMapping( - XMappingEvent* /* event_map */ -); - -extern int XRemoveFromSaveSet( - Display* /* display */, - Window /* w */ -); - -extern int XRemoveHost( - Display* /* display */, - XHostAddress* /* host */ -); - -extern int XRemoveHosts( - Display* /* display */, - XHostAddress* /* hosts */, - int /* num_hosts */ -); - -extern int XReparentWindow( - Display* /* display */, - Window /* w */, - Window /* parent */, - int /* x */, - int /* y */ -); - -extern int XResetScreenSaver( - Display* /* display */ -); - -extern int XResizeWindow( - Display* /* display */, - Window /* w */, - unsigned int /* width */, - unsigned int /* height */ -); - -extern int XRestackWindows( - Display* /* display */, - Window* /* windows */, - int /* nwindows */ -); - -extern int XRotateBuffers( - Display* /* display */, - int /* rotate */ -); - -extern int XRotateWindowProperties( - Display* /* display */, - Window /* w */, - Atom* /* properties */, - int /* num_prop */, - int /* npositions */ -); - -extern int XScreenCount( - Display* /* display */ -); - -extern int XSelectInput( - Display* /* display */, - Window /* w */, - long /* event_mask */ -); - -extern Status XSendEvent( - Display* /* display */, - Window /* w */, - Bool /* propagate */, - long /* event_mask */, - XEvent* /* event_send */ -); - -extern int XSetAccessControl( - Display* /* display */, - int /* mode */ -); - -extern int XSetArcMode( - Display* /* display */, - GC /* gc */, - int /* arc_mode */ -); - -extern int XSetBackground( - Display* /* display */, - GC /* gc */, - unsigned long /* background */ -); - -extern int XSetClipMask( - Display* /* display */, - GC /* gc */, - Pixmap /* pixmap */ -); - -extern int XSetClipOrigin( - Display* /* display */, - GC /* gc */, - int /* clip_x_origin */, - int /* clip_y_origin */ -); - -extern int XSetClipRectangles( - Display* /* display */, - GC /* gc */, - int /* clip_x_origin */, - int /* clip_y_origin */, - XRectangle* /* rectangles */, - int /* n */, - int /* ordering */ -); - -extern int XSetCloseDownMode( - Display* /* display */, - int /* close_mode */ -); - -extern int XSetCommand( - Display* /* display */, - Window /* w */, - char** /* argv */, - int /* argc */ -); - -extern int XSetDashes( - Display* /* display */, - GC /* gc */, - int /* dash_offset */, - _Xconst char* /* dash_list */, - int /* n */ -); - -extern int XSetFillRule( - Display* /* display */, - GC /* gc */, - int /* fill_rule */ -); - -extern int XSetFillStyle( - Display* /* display */, - GC /* gc */, - int /* fill_style */ -); - -extern int XSetFont( - Display* /* display */, - GC /* gc */, - Font /* font */ -); - -extern int XSetFontPath( - Display* /* display */, - char** /* directories */, - int /* ndirs */ -); - -extern int XSetForeground( - Display* /* display */, - GC /* gc */, - unsigned long /* foreground */ -); - -extern int XSetFunction( - Display* /* display */, - GC /* gc */, - int /* function */ -); - -extern int XSetGraphicsExposures( - Display* /* display */, - GC /* gc */, - Bool /* graphics_exposures */ -); - -extern int XSetIconName( - Display* /* display */, - Window /* w */, - _Xconst char* /* icon_name */ -); - -extern int XSetInputFocus( - Display* /* display */, - Window /* focus */, - int /* revert_to */, - Time /* time */ -); - -extern int XSetLineAttributes( - Display* /* display */, - GC /* gc */, - unsigned int /* line_width */, - int /* line_style */, - int /* cap_style */, - int /* join_style */ -); - -extern int XSetModifierMapping( - Display* /* display */, - XModifierKeymap* /* modmap */ -); - -extern int XSetPlaneMask( - Display* /* display */, - GC /* gc */, - unsigned long /* plane_mask */ -); - -extern int XSetPointerMapping( - Display* /* display */, - _Xconst unsigned char* /* map */, - int /* nmap */ -); - -extern int XSetScreenSaver( - Display* /* display */, - int /* timeout */, - int /* interval */, - int /* prefer_blanking */, - int /* allow_exposures */ -); - -extern int XSetSelectionOwner( - Display* /* display */, - Atom /* selection */, - Window /* owner */, - Time /* time */ -); - -extern int XSetState( - Display* /* display */, - GC /* gc */, - unsigned long /* foreground */, - unsigned long /* background */, - int /* function */, - unsigned long /* plane_mask */ -); - -extern int XSetStipple( - Display* /* display */, - GC /* gc */, - Pixmap /* stipple */ -); - -extern int XSetSubwindowMode( - Display* /* display */, - GC /* gc */, - int /* subwindow_mode */ -); - -extern int XSetTSOrigin( - Display* /* display */, - GC /* gc */, - int /* ts_x_origin */, - int /* ts_y_origin */ -); - -extern int XSetTile( - Display* /* display */, - GC /* gc */, - Pixmap /* tile */ -); - -extern int XSetWindowBackground( - Display* /* display */, - Window /* w */, - unsigned long /* background_pixel */ -); - -extern int XSetWindowBackgroundPixmap( - Display* /* display */, - Window /* w */, - Pixmap /* background_pixmap */ -); - -extern int XSetWindowBorder( - Display* /* display */, - Window /* w */, - unsigned long /* border_pixel */ -); - -extern int XSetWindowBorderPixmap( - Display* /* display */, - Window /* w */, - Pixmap /* border_pixmap */ -); - -extern int XSetWindowBorderWidth( - Display* /* display */, - Window /* w */, - unsigned int /* width */ -); - -extern int XSetWindowColormap( - Display* /* display */, - Window /* w */, - Colormap /* colormap */ -); - -extern int XStoreBuffer( - Display* /* display */, - _Xconst char* /* bytes */, - int /* nbytes */, - int /* buffer */ -); - -extern int XStoreBytes( - Display* /* display */, - _Xconst char* /* bytes */, - int /* nbytes */ -); - -extern int XStoreColor( - Display* /* display */, - Colormap /* colormap */, - XColor* /* color */ -); - -extern int XStoreColors( - Display* /* display */, - Colormap /* colormap */, - XColor* /* color */, - int /* ncolors */ -); - -extern int XStoreName( - Display* /* display */, - Window /* w */, - _Xconst char* /* window_name */ -); - -extern int XStoreNamedColor( - Display* /* display */, - Colormap /* colormap */, - _Xconst char* /* color */, - unsigned long /* pixel */, - int /* flags */ -); - -extern int XSync( - Display* /* display */, - Bool /* discard */ -); - -extern int XTextExtents( - XFontStruct* /* font_struct */, - _Xconst char* /* string */, - int /* nchars */, - int* /* direction_return */, - int* /* font_ascent_return */, - int* /* font_descent_return */, - XCharStruct* /* overall_return */ -); - -extern int XTextExtents16( - XFontStruct* /* font_struct */, - _Xconst XChar2b* /* string */, - int /* nchars */, - int* /* direction_return */, - int* /* font_ascent_return */, - int* /* font_descent_return */, - XCharStruct* /* overall_return */ -); - -extern int XTextWidth( - XFontStruct* /* font_struct */, - _Xconst char* /* string */, - int /* count */ -); - -extern int XTextWidth16( - XFontStruct* /* font_struct */, - _Xconst XChar2b* /* string */, - int /* count */ -); - -extern Bool XTranslateCoordinates( - Display* /* display */, - Window /* src_w */, - Window /* dest_w */, - int /* src_x */, - int /* src_y */, - int* /* dest_x_return */, - int* /* dest_y_return */, - Window* /* child_return */ -); - -extern int XUndefineCursor( - Display* /* display */, - Window /* w */ -); - -extern int XUngrabButton( - Display* /* display */, - unsigned int /* button */, - unsigned int /* modifiers */, - Window /* grab_window */ -); - -extern int XUngrabKey( - Display* /* display */, - int /* keycode */, - unsigned int /* modifiers */, - Window /* grab_window */ -); - -extern int XUngrabKeyboard( - Display* /* display */, - Time /* time */ -); - -extern int XUngrabPointer( - Display* /* display */, - Time /* time */ -); - -extern int XUngrabServer( - Display* /* display */ -); - -extern int XUninstallColormap( - Display* /* display */, - Colormap /* colormap */ -); - -extern int XUnloadFont( - Display* /* display */, - Font /* font */ -); - -extern int XUnmapSubwindows( - Display* /* display */, - Window /* w */ -); - -extern int XUnmapWindow( - Display* /* display */, - Window /* w */ -); - -extern int XVendorRelease( - Display* /* display */ -); - -extern int XWarpPointer( - Display* /* display */, - Window /* src_w */, - Window /* dest_w */, - int /* src_x */, - int /* src_y */, - unsigned int /* src_width */, - unsigned int /* src_height */, - int /* dest_x */, - int /* dest_y */ -); - -extern int XWidthMMOfScreen( - Screen* /* screen */ -); - -extern int XWidthOfScreen( - Screen* /* screen */ -); - -extern int XWindowEvent( - Display* /* display */, - Window /* w */, - long /* event_mask */, - XEvent* /* event_return */ -); - -extern int XWriteBitmapFile( - Display* /* display */, - _Xconst char* /* filename */, - Pixmap /* bitmap */, - unsigned int /* width */, - unsigned int /* height */, - int /* x_hot */, - int /* y_hot */ -); - -extern Bool XSupportsLocale (void); - -extern char *XSetLocaleModifiers( - const char* /* modifier_list */ -); - -extern XOM XOpenOM( - Display* /* display */, - struct _XrmHashBucketRec* /* rdb */, - _Xconst char* /* res_name */, - _Xconst char* /* res_class */ -); - -extern Status XCloseOM( - XOM /* om */ -); - -extern char *XSetOMValues( - XOM /* om */, - ... -) _X_SENTINEL(0); - -extern char *XGetOMValues( - XOM /* om */, - ... -) _X_SENTINEL(0); - -extern Display *XDisplayOfOM( - XOM /* om */ -); - -extern char *XLocaleOfOM( - XOM /* om */ -); - -extern XOC XCreateOC( - XOM /* om */, - ... -) _X_SENTINEL(0); - -extern void XDestroyOC( - XOC /* oc */ -); - -extern XOM XOMOfOC( - XOC /* oc */ -); - -extern char *XSetOCValues( - XOC /* oc */, - ... -) _X_SENTINEL(0); - -extern char *XGetOCValues( - XOC /* oc */, - ... -) _X_SENTINEL(0); - -extern XFontSet XCreateFontSet( - Display* /* display */, - _Xconst char* /* base_font_name_list */, - char*** /* missing_charset_list */, - int* /* missing_charset_count */, - char** /* def_string */ -); - -extern void XFreeFontSet( - Display* /* display */, - XFontSet /* font_set */ -); - -extern int XFontsOfFontSet( - XFontSet /* font_set */, - XFontStruct*** /* font_struct_list */, - char*** /* font_name_list */ -); - -extern char *XBaseFontNameListOfFontSet( - XFontSet /* font_set */ -); - -extern char *XLocaleOfFontSet( - XFontSet /* font_set */ -); - -extern Bool XContextDependentDrawing( - XFontSet /* font_set */ -); - -extern Bool XDirectionalDependentDrawing( - XFontSet /* font_set */ -); - -extern Bool XContextualDrawing( - XFontSet /* font_set */ -); - -extern XFontSetExtents *XExtentsOfFontSet( - XFontSet /* font_set */ -); - -extern int XmbTextEscapement( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern int XwcTextEscapement( - XFontSet /* font_set */, - _Xconst wchar_t* /* text */, - int /* num_wchars */ -); - -extern int Xutf8TextEscapement( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern int XmbTextExtents( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern int XwcTextExtents( - XFontSet /* font_set */, - _Xconst wchar_t* /* text */, - int /* num_wchars */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern int Xutf8TextExtents( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern Status XmbTextPerCharExtents( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */, - XRectangle* /* ink_extents_buffer */, - XRectangle* /* logical_extents_buffer */, - int /* buffer_size */, - int* /* num_chars */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern Status XwcTextPerCharExtents( - XFontSet /* font_set */, - _Xconst wchar_t* /* text */, - int /* num_wchars */, - XRectangle* /* ink_extents_buffer */, - XRectangle* /* logical_extents_buffer */, - int /* buffer_size */, - int* /* num_chars */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern Status Xutf8TextPerCharExtents( - XFontSet /* font_set */, - _Xconst char* /* text */, - int /* bytes_text */, - XRectangle* /* ink_extents_buffer */, - XRectangle* /* logical_extents_buffer */, - int /* buffer_size */, - int* /* num_chars */, - XRectangle* /* overall_ink_return */, - XRectangle* /* overall_logical_return */ -); - -extern void XmbDrawText( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XmbTextItem* /* text_items */, - int /* nitems */ -); - -extern void XwcDrawText( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XwcTextItem* /* text_items */, - int /* nitems */ -); - -extern void Xutf8DrawText( - Display* /* display */, - Drawable /* d */, - GC /* gc */, - int /* x */, - int /* y */, - XmbTextItem* /* text_items */, - int /* nitems */ -); - -extern void XmbDrawString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern void XwcDrawString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst wchar_t* /* text */, - int /* num_wchars */ -); - -extern void Xutf8DrawString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern void XmbDrawImageString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern void XwcDrawImageString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst wchar_t* /* text */, - int /* num_wchars */ -); - -extern void Xutf8DrawImageString( - Display* /* display */, - Drawable /* d */, - XFontSet /* font_set */, - GC /* gc */, - int /* x */, - int /* y */, - _Xconst char* /* text */, - int /* bytes_text */ -); - -extern XIM XOpenIM( - Display* /* dpy */, - struct _XrmHashBucketRec* /* rdb */, - char* /* res_name */, - char* /* res_class */ -); - -extern Status XCloseIM( - XIM /* im */ -); - -extern char *XGetIMValues( - XIM /* im */, ... -) _X_SENTINEL(0); - -extern char *XSetIMValues( - XIM /* im */, ... -) _X_SENTINEL(0); - -extern Display *XDisplayOfIM( - XIM /* im */ -); - -extern char *XLocaleOfIM( - XIM /* im*/ -); - -extern XIC XCreateIC( - XIM /* im */, ... -) _X_SENTINEL(0); - -extern void XDestroyIC( - XIC /* ic */ -); - -extern void XSetICFocus( - XIC /* ic */ -); - -extern void XUnsetICFocus( - XIC /* ic */ -); - -extern wchar_t *XwcResetIC( - XIC /* ic */ -); - -extern char *XmbResetIC( - XIC /* ic */ -); - -extern char *Xutf8ResetIC( - XIC /* ic */ -); - -extern char *XSetICValues( - XIC /* ic */, ... -) _X_SENTINEL(0); - -extern char *XGetICValues( - XIC /* ic */, ... -) _X_SENTINEL(0); - -extern XIM XIMOfIC( - XIC /* ic */ -); - -extern Bool XFilterEvent( - XEvent* /* event */, - Window /* window */ -); - -extern int XmbLookupString( - XIC /* ic */, - XKeyPressedEvent* /* event */, - char* /* buffer_return */, - int /* bytes_buffer */, - KeySym* /* keysym_return */, - Status* /* status_return */ -); - -extern int XwcLookupString( - XIC /* ic */, - XKeyPressedEvent* /* event */, - wchar_t* /* buffer_return */, - int /* wchars_buffer */, - KeySym* /* keysym_return */, - Status* /* status_return */ -); - -extern int Xutf8LookupString( - XIC /* ic */, - XKeyPressedEvent* /* event */, - char* /* buffer_return */, - int /* bytes_buffer */, - KeySym* /* keysym_return */, - Status* /* status_return */ -); - -extern XVaNestedList XVaCreateNestedList( - int /*unused*/, ... -) _X_SENTINEL(0); - -/* internal connections for IMs */ - -extern Bool XRegisterIMInstantiateCallback( - Display* /* dpy */, - struct _XrmHashBucketRec* /* rdb */, - char* /* res_name */, - char* /* res_class */, - XIDProc /* callback */, - XPointer /* client_data */ -); - -extern Bool XUnregisterIMInstantiateCallback( - Display* /* dpy */, - struct _XrmHashBucketRec* /* rdb */, - char* /* res_name */, - char* /* res_class */, - XIDProc /* callback */, - XPointer /* client_data */ -); - -typedef void (*XConnectionWatchProc)( - Display* /* dpy */, - XPointer /* client_data */, - int /* fd */, - Bool /* opening */, /* open or close flag */ - XPointer* /* watch_data */ /* open sets, close uses */ -); - - -extern Status XInternalConnectionNumbers( - Display* /* dpy */, - int** /* fd_return */, - int* /* count_return */ -); - -extern void XProcessInternalConnection( - Display* /* dpy */, - int /* fd */ -); - -extern Status XAddConnectionWatch( - Display* /* dpy */, - XConnectionWatchProc /* callback */, - XPointer /* client_data */ -); - -extern void XRemoveConnectionWatch( - Display* /* dpy */, - XConnectionWatchProc /* callback */, - XPointer /* client_data */ -); - -extern void XSetAuthorization( - char * /* name */, - int /* namelen */, - char * /* data */, - int /* datalen */ -); - -extern int _Xmbtowc( - wchar_t * /* wstr */, -#ifdef ISC - char const * /* str */, - size_t /* len */ -#else - char * /* str */, - int /* len */ -#endif -); - -extern int _Xwctomb( - char * /* str */, - wchar_t /* wc */ -); - -_XFUNCPROTOEND - -#endif /* _XLIB_H_ */ diff --git a/nx-X11/lib/X11/XlibAsync.c.NX.original b/nx-X11/lib/X11/XlibAsync.c.NX.original deleted file mode 100644 index 70bd82bad..000000000 --- a/nx-X11/lib/X11/XlibAsync.c.NX.original +++ /dev/null @@ -1,181 +0,0 @@ -/* $Xorg: XlibAsync.c,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */ -/* - -Copyright 1992, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#define NEED_REPLIES -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -/*ARGSUSED*/ -Bool -_XAsyncErrorHandler(dpy, rep, buf, len, data) - register Display *dpy; - register xReply *rep; - char *buf; - int len; - XPointer data; -{ - register _XAsyncErrorState *state; - - state = (_XAsyncErrorState *)data; - if (rep->generic.type == X_Error && - (!state->error_code || - rep->error.errorCode == state->error_code) && - (!state->major_opcode || - rep->error.majorCode == state->major_opcode) && - (!state->minor_opcode || - rep->error.minorCode == state->minor_opcode) && - (!state->min_sequence_number || - (state->min_sequence_number <= dpy->last_request_read)) && - (!state->max_sequence_number || - (state->max_sequence_number >= dpy->last_request_read))) { - state->last_error_received = rep->error.errorCode; - state->error_count++; - return True; - } - return False; -} - -void _XDeqAsyncHandler(dpy, handler) - Display *dpy; - register _XAsyncHandler *handler; -{ - register _XAsyncHandler **prev; - register _XAsyncHandler *async; - - for (prev = &dpy->async_handlers; - (async = *prev) && (async != handler); - prev = &async->next) - ; - if (async) - *prev = async->next; -} - -char * -_XGetAsyncReply(dpy, replbuf, rep, buf, len, extra, discard) - register Display *dpy; - register char *replbuf; /* data is read into this buffer */ - register xReply *rep; /* value passed to calling handler */ - char *buf; /* value passed to calling handler */ - int len; /* value passed to calling handler */ - int extra; /* extra words to read, ala _XReply */ - Bool discard; /* discard after extra?, ala _XReply */ -{ - if (extra == 0) { - if (discard && (rep->generic.length << 2) > len) - _XEatData (dpy, (rep->generic.length << 2) - len); - return (char *)rep; - } - - if (extra <= rep->generic.length) { - int size = SIZEOF(xReply) + (extra << 2); - if (size > len) { - memcpy(replbuf, buf, len); - _XRead(dpy, replbuf + len, size - len); - buf = replbuf; - len = size; -#ifdef MUSTCOPY - } else { - memcpy(replbuf, buf, size); - buf = replbuf; -#endif - } - - if (discard && rep->generic.length > extra && - (rep->generic.length << 2) > len) - _XEatData (dpy, (rep->generic.length << 2) - len); - - return buf; - } - /* - *if we get here, then extra > rep->generic.length--meaning we - * read a reply that's shorter than we expected. This is an - * error, but we still need to figure out how to handle it... - */ - if ((rep->generic.length << 2) > len) - _XEatData (dpy, (rep->generic.length << 2) - len); -#ifdef NX_TRANS_SOCKET - - /* - * The original code has provision - * for returning already. - */ - -#endif - _XIOError (dpy); - return (char *)rep; -} - -void -_XGetAsyncData(dpy, data, buf, len, skip, datalen, discardtotal) - Display *dpy; - char *data; /* data is read into this buffer */ - char *buf; /* value passed to calling handler */ - int len; /* value passed to calling handler */ - int skip; /* number of bytes already read in previous - _XGetAsyncReply or _XGetAsyncData calls */ - int datalen; /* size of data buffer in bytes */ - int discardtotal; /* min. bytes to consume (after skip) */ -{ - buf += skip; - len -= skip; - if (!data) { - if (datalen > len) - _XEatData(dpy, datalen - len); - } else if (datalen <= len) { - memcpy(data, buf, datalen); - } else { - memcpy(data, buf, len); - _XRead(dpy, data + len, datalen - len); - } - if (discardtotal > len) { - if (datalen > len) - len = datalen; - _XEatData(dpy, discardtotal - len); - } -} diff --git a/nx-X11/lib/X11/XlibAsync.c.X.original b/nx-X11/lib/X11/XlibAsync.c.X.original deleted file mode 100644 index a0314ba81..000000000 --- a/nx-X11/lib/X11/XlibAsync.c.X.original +++ /dev/null @@ -1,156 +0,0 @@ -/* $Xorg: XlibAsync.c,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */ -/* - -Copyright 1992, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -#define NEED_REPLIES -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -/*ARGSUSED*/ -Bool -_XAsyncErrorHandler(dpy, rep, buf, len, data) - register Display *dpy; - register xReply *rep; - char *buf; - int len; - XPointer data; -{ - register _XAsyncErrorState *state; - - state = (_XAsyncErrorState *)data; - if (rep->generic.type == X_Error && - (!state->error_code || - rep->error.errorCode == state->error_code) && - (!state->major_opcode || - rep->error.majorCode == state->major_opcode) && - (!state->minor_opcode || - rep->error.minorCode == state->minor_opcode) && - (!state->min_sequence_number || - (state->min_sequence_number <= dpy->last_request_read)) && - (!state->max_sequence_number || - (state->max_sequence_number >= dpy->last_request_read))) { - state->last_error_received = rep->error.errorCode; - state->error_count++; - return True; - } - return False; -} - -void _XDeqAsyncHandler(dpy, handler) - Display *dpy; - register _XAsyncHandler *handler; -{ - register _XAsyncHandler **prev; - register _XAsyncHandler *async; - - for (prev = &dpy->async_handlers; - (async = *prev) && (async != handler); - prev = &async->next) - ; - if (async) - *prev = async->next; -} - -char * -_XGetAsyncReply(dpy, replbuf, rep, buf, len, extra, discard) - register Display *dpy; - register char *replbuf; /* data is read into this buffer */ - register xReply *rep; /* value passed to calling handler */ - char *buf; /* value passed to calling handler */ - int len; /* value passed to calling handler */ - int extra; /* extra words to read, ala _XReply */ - Bool discard; /* discard after extra?, ala _XReply */ -{ - if (extra == 0) { - if (discard && (rep->generic.length << 2) > len) - _XEatData (dpy, (rep->generic.length << 2) - len); - return (char *)rep; - } - - if (extra <= rep->generic.length) { - int size = SIZEOF(xReply) + (extra << 2); - if (size > len) { - memcpy(replbuf, buf, len); - _XRead(dpy, replbuf + len, size - len); - buf = replbuf; - len = size; -#ifdef MUSTCOPY - } else { - memcpy(replbuf, buf, size); - buf = replbuf; -#endif - } - - if (discard && rep->generic.length > extra && - (rep->generic.length << 2) > len) - _XEatData (dpy, (rep->generic.length << 2) - len); - - return buf; - } - /* - *if we get here, then extra > rep->generic.length--meaning we - * read a reply that's shorter than we expected. This is an - * error, but we still need to figure out how to handle it... - */ - if ((rep->generic.length << 2) > len) - _XEatData (dpy, (rep->generic.length << 2) - len); - _XIOError (dpy); - return (char *)rep; -} - -void -_XGetAsyncData(dpy, data, buf, len, skip, datalen, discardtotal) - Display *dpy; - char *data; /* data is read into this buffer */ - char *buf; /* value passed to calling handler */ - int len; /* value passed to calling handler */ - int skip; /* number of bytes already read in previous - _XGetAsyncReply or _XGetAsyncData calls */ - int datalen; /* size of data buffer in bytes */ - int discardtotal; /* min. bytes to consume (after skip) */ -{ - buf += skip; - len -= skip; - if (!data) { - if (datalen > len) - _XEatData(dpy, datalen - len); - } else if (datalen <= len) { - memcpy(data, buf, datalen); - } else { - memcpy(data, buf, len); - _XRead(dpy, data + len, datalen - len); - } - if (discardtotal > len) { - if (datalen > len) - len = datalen; - _XEatData(dpy, discardtotal - len); - } -} diff --git a/nx-X11/lib/X11/XlibInt.c.NX.original b/nx-X11/lib/X11/XlibInt.c.NX.original deleted file mode 100644 index 47e2ea139..000000000 --- a/nx-X11/lib/X11/XlibInt.c.NX.original +++ /dev/null @@ -1,4167 +0,0 @@ -/* $Xorg: XlibInt.c,v 1.8 2001/02/09 02:03:38 xorgcvs Exp $ */ -/* - -Copyright 1985, 1986, 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/lib/X11/XlibInt.c,v 3.38 2003/10/30 21:55:05 alanh Exp $ */ - -/* - * XlibInt.c - Internal support routines for the C subroutine - * interface library (Xlib) to the X Window System Protocol V11.0. - */ -#define NEED_EVENTS -#define NEED_REPLIES - -#ifdef WIN32 -#define _XLIBINT_ -#endif -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" -#include -#include -#include -#include -#ifdef WIN32 -#include -#endif - -#ifdef XTHREADS -#include "locking.h" - -/* these pointers get initialized by XInitThreads */ -LockInfoPtr _Xglobal_lock = NULL; -void (*_XCreateMutex_fn)(LockInfoPtr) = NULL; -/* struct _XCVList *(*_XCreateCVL_fn)() = NULL; */ -void (*_XFreeMutex_fn)(LockInfoPtr) = NULL; -void (*_XLockMutex_fn)( - LockInfoPtr /* lock */ -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = NULL; -void (*_XUnlockMutex_fn)( - LockInfoPtr /* lock */ -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = NULL; -xthread_t (*_Xthread_self_fn)(void) = NULL; - -#define XThread_Self() ((*_Xthread_self_fn)()) - -#define UnlockNextReplyReader(d) if ((d)->lock) \ - (*(d)->lock->pop_reader)((d),&(d)->lock->reply_awaiters,&(d)->lock->reply_awaiters_tail) - -#define QueueReplyReaderLock(d) ((d)->lock ? \ - (*(d)->lock->push_reader)(d,&(d)->lock->reply_awaiters_tail) : NULL) -#define QueueEventReaderLock(d) ((d)->lock ? \ - (*(d)->lock->push_reader)(d,&(d)->lock->event_awaiters_tail) : NULL) - -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -#define InternalLockDisplay(d,wskip) if ((d)->lock) \ - (*(d)->lock->internal_lock_display)(d,wskip,__FILE__,__LINE__) -#else -#define InternalLockDisplay(d,wskip) if ((d)->lock) \ - (*(d)->lock->internal_lock_display)(d,wskip) -#endif - -#else /* XTHREADS else */ - -#define UnlockNextReplyReader(d) -#define UnlockNextEventReader(d) -#define InternalLockDisplay(d,wskip) - -#endif /* XTHREADS else */ - -#include "NX.h" - -#ifdef NX_TRANS_SOCKET - -#include "NX.h" -#include "NXvars.h" - -static struct timeval retry; - -/* - * From Xtranssock.c. Presently the congestion state - * is reported by the proxy to the application, by - * invoking the callback directly. The function will - * be possibly used in the future, to be able to track - * the bandwidth usage even when the NX transport is - * not running. Note that in this sample implementation - * the congestion state is checked very often and can - * be surely optimized. - */ - -#ifdef NX_TRANS_CHANGE - -extern int _X11TransSocketCongestionChange(XtransConnInfo, int *); - -#endif - -#endif /* #ifdef NX_TRANS_SOCKET */ - -/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX - * systems are broken and return EWOULDBLOCK when they should return EAGAIN - */ -#ifdef WIN32 -#define ETEST() (WSAGetLastError() == WSAEWOULDBLOCK) -#else -#ifdef __CYGWIN__ /* Cygwin uses ENOBUFS to signal socket is full */ -#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS) -#else -#if defined(EAGAIN) && defined(EWOULDBLOCK) -#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK) -#else -#ifdef EAGAIN -#define ETEST() (errno == EAGAIN) -#else -#define ETEST() (errno == EWOULDBLOCK) -#endif /* EAGAIN */ -#endif /* EAGAIN && EWOULDBLOCK */ -#endif /* __CYGWIN__ */ -#endif /* WIN32 */ - -#ifdef WIN32 -#define ECHECK(err) (WSAGetLastError() == err) -#define ESET(val) WSASetLastError(val) -#else -#ifdef __UNIXOS2__ -#define ECHECK(err) (errno == err) -#define ESET(val) -#else -#ifdef ISC -#define ECHECK(err) ((errno == err) || ETEST()) -#else -#define ECHECK(err) (errno == err) -#endif -#define ESET(val) errno = val -#endif -#endif - -#if defined(LOCALCONN) || defined(LACHMAN) -#ifdef EMSGSIZE -#define ESZTEST() (ECHECK(EMSGSIZE) || ECHECK(ERANGE)) -#else -#define ESZTEST() ECHECK(ERANGE) -#endif -#else -#ifdef EMSGSIZE -#define ESZTEST() ECHECK(EMSGSIZE) -#endif -#endif - -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2ClientSelect(n,r,w,x,t) -#include -#define MAX_PATH _POSIX_PATH_MAX -#endif - -#ifdef MUSTCOPY - -#define STARTITERATE(tpvar,type,start,endcond) \ - { register char *cpvar; \ - for (cpvar = (char *) (start); endcond; ) { \ - type dummy; memcpy ((char *) &dummy, cpvar, SIZEOF(type)); \ - tpvar = &dummy; -#define ITERPTR(tpvar) cpvar -#define RESETITERPTR(tpvar,type,start) cpvar = start -#define INCITERPTR(tpvar,type) cpvar += SIZEOF(type) -#define ENDITERATE }} - -#else - -#define STARTITERATE(tpvar,type,start,endcond) \ - for (tpvar = (type *) (start); endcond; ) -#define ITERPTR(tpvar) (char *)tpvar -#define RESETITERPTR(tpvar,type,start) tpvar = (type *) (start) -#define INCITERPTR(tpvar,type) tpvar++ -#define ENDITERATE - -#endif /* MUSTCOPY */ - -typedef union { - xReply rep; - char buf[BUFSIZE]; -} _XAlignedBuffer; - -static char *_XAsyncReply( - Display *dpy, - register xReply *rep, - char *buf, - register int *lenp, - Bool discard); - -static void _XProcessInternalConnection( - Display *dpy, - struct _XConnectionInfo *conn_info); - -#define SEQLIMIT (65535 - (BUFSIZE / SIZEOF(xReq)) - 10) - -/* - * The following routines are internal routines used by Xlib for protocol - * packet transmission and reception. - * - * _XIOError(Display *) will be called if any sort of system call error occurs. - * This is assumed to be a fatal condition, i.e., XIOError should not return. - * - * _XError(Display *, xError *) will be called whenever an X_Error event is - * received. This is not assumed to be a fatal condition, i.e., it is - * acceptable for this procedure to return. However, XError should NOT - * perform any operations (directly or indirectly) on the DISPLAY. - * - * Routines declared with a return type of 'Status' return 0 on failure, - * and non 0 on success. Routines with no declared return type don't - * return anything. Whenever possible routines that create objects return - * the object they have created. - */ - -static xReq _dummy_request = { - 0, 0, 0 -}; - -#ifdef NX_TRANS_SOCKET - -/* - * Replace the standard Select with a version giving NX a - * chance to check its own descriptors. This doesn't cover - * the cases where the system is using poll or when system- - * specific defines override the Select definition (OS/2). - */ - -int _XSelect(int maxfds, fd_set *readfds, fd_set *writefds, - fd_set *exceptfds, struct timeval *timeout) -{ -#ifdef NX_TRANS_TEST - fprintf(stderr, "_XSelect: Called with [%d][%p][%p][%p][%p].\n", - maxfds, (void *) readfds, (void *) writefds, (void *) exceptfds, - (void *) timeout); -#endif - - if (NXTransRunning(NX_FD_ANY)) - { - fd_set t_readfds, t_writefds; - struct timeval t_timeout; - - int n, r, e; - -#ifdef NX_TRANS_TEST - - if (exceptfds != NULL) - { - fprintf(stderr, "_XSelect: WARNING! Can't handle exception fds in select.\n"); - } - -#endif - - if (readfds == NULL) - { - FD_ZERO(&t_readfds); - - readfds = &t_readfds; - } - - if (writefds == NULL) - { - FD_ZERO(&t_writefds); - - writefds = &t_writefds; - } - - if (timeout == NULL) - { - t_timeout.tv_sec = 10; - t_timeout.tv_usec = 0; - - timeout = &t_timeout; - } - - n = maxfds; - - /* - * If the transport is gone avoid - * sleeping until the timeout. - */ - - if (NXTransPrepare(&n, readfds, writefds, timeout) != 0) - { - NXTransSelect(&r, &e, &n, readfds, writefds, timeout); - - NXTransExecute(&r, &e, &n, readfds, writefds, timeout); - - errno = e; - - return r; - } - else - { - return 0; - } - } - else - { - return select(maxfds, readfds, writefds, exceptfds, timeout); - } -} - -#else /* #ifdef NX_TRANS_SOCKET */ - -int _XSelect(int maxfds, fd_set *readfds, fd_set *writefds, - fd_set *exceptfds, struct timeval *timeout) -{ - return select(maxfds, readfds, writefds, exceptfds, timeout); -} - -#endif /* #ifdef NX_TRANS_SOCKET */ - -/* - * This is an OS dependent routine which: - * 1) returns as soon as the connection can be written on.... - * 2) if the connection can be read, must enqueue events and handle errors, - * until the connection is writable. - */ -static void -_XWaitForWritable( - Display *dpy -#ifdef XTHREADS - , - xcondition_t cv /* our reading condition variable */ -#endif - ) -{ -#ifdef USE_POLL - struct pollfd filedes; -#else - fd_set r_mask; - fd_set w_mask; -#endif - int nfound; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - int congestion; -#endif - -#ifdef NX_TRANS_SOCKET - - if (_XGetIOError(dpy)) { - return; - } - -#endif - -#ifdef USE_POLL - filedes.fd = dpy->fd; - filedes.events = 0; -#else - FD_ZERO(&r_mask); - FD_ZERO(&w_mask); -#endif - - for (;;) { -#ifdef XTHREADS - /* We allow only one thread at a time to read, to minimize - passing of read data between threads. - Now, who is it? If there is a non-NULL reply_awaiters and - we (i.e., our cv) are not at the head of it, then whoever - is at the head is the reader, and we don't read. - Otherwise there is no reply_awaiters or we are at the - head, having just appended ourselves. - In this case, if there is a event_awaiters, then whoever - is at the head of it got there before we did, and they are the - reader. - - Last cases: no event_awaiters and we are at the head of - reply_awaiters or reply_awaiters is NULL: we are the reader, - since there is obviously no one else involved. - - XXX - what if cv is NULL and someone else comes along after - us while we are waiting? - */ - - if (!dpy->lock || - (!dpy->lock->event_awaiters && - (!dpy->lock->reply_awaiters || - dpy->lock->reply_awaiters->cv == cv))) -#endif - -#ifndef NX_TRANS_SOCKET -#ifdef USE_POLL - filedes.events = POLLIN; - filedes.events |= POLLOUT; -#else - FD_SET(dpy->fd, &r_mask); - FD_SET(dpy->fd, &w_mask); -#endif -#endif /* #ifndef NX_TRANS_SOCKET */ - - do { -#ifdef NX_TRANS_SOCKET - /* - * Give a chance to the registered client to perform - * any needed operation before entering the select. - */ - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_XWaitForWritable: WAIT! Waiting for the display to become writable.\n"); -#endif - NXTransFlush(dpy->fd); - - if (_NXDisplayBlockFunction != NULL) { - (*_NXDisplayBlockFunction)(dpy, NXBlockWrite); - } - - /* - * Need to set again the descriptors as we could have - * run multiple selects before having the possibility - * to read or write to the X connection. - */ - -#ifdef USE_POLL - filedes.events = POLLIN; - filedes.events |= POLLOUT; -#else - FD_SET(dpy->fd, &r_mask); - FD_SET(dpy->fd, &w_mask); -#endif -#endif /* #ifdef NX_TRANS_SOCKET */ - - UnlockDisplay(dpy); -#ifdef USE_POLL -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XWaitForWritable: Calling poll().\n"); -#endif - nfound = poll (&filedes, 1, -1); -#else -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XWaitForWritable: Calling select() after [%ld] ms.\n", - NXTransTime()); -#endif -#ifdef NX_TRANS_SOCKET - /* - * Give a chance to the callback to detect - * the failure of the display even if we - * miss the interrupt inside the select. - */ - - if (_NXDisplayErrorFunction != NULL) { - retry.tv_sec = 5; - retry.tv_usec = 0; - nfound = Select (dpy->fd + 1, &r_mask, &w_mask, NULL, &retry); - } else { - nfound = Select (dpy->fd + 1, &r_mask, &w_mask, NULL, NULL); - } -#else - nfound = Select (dpy->fd + 1, &r_mask, &w_mask, NULL, NULL); -#endif -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XWaitForWritable: Out of select() with [%d] after [%ld] ms.\n", - nfound, NXTransTime()); - - if (FD_ISSET(dpy->fd, &r_mask)) - { - BytesReadable_t pend; - - _X11TransBytesReadable(dpy->trans_conn, &pend); - - fprintf(stderr, "_XWaitForWritable: Descriptor [%d] is ready with [%ld] bytes to read.\n", - dpy->fd, pend); - } - - if (FD_ISSET(dpy->fd, &w_mask)) - { - fprintf(stderr, "_XWaitForWritable: Descriptor [%d] has become writable.\n\n", - dpy->fd); - } -#endif -#endif - InternalLockDisplay(dpy, cv != NULL); -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - if (_NXDisplayCongestionFunction != NULL && - _X11TransSocketCongestionChange(dpy->trans_conn, &congestion) == 1) { - (*_NXDisplayCongestionFunction)(dpy, congestion); - } -#endif - -#ifdef NX_TRANS_SOCKET - if (nfound <= 0) { - if ((nfound == -1 && !ECHECK(EINTR)) || - (_NXDisplayErrorFunction != NULL && - (*_NXDisplayErrorFunction)(dpy, _XGetIOError(dpy)))) { - _XIOError(dpy); - return; - } - } -#else - if (nfound < 0 && !ECHECK(EINTR)) - _XIOError(dpy); -#endif - } while (nfound <= 0); - - if ( -#ifdef USE_POLL - filedes.revents & POLLIN -#else - FD_ISSET(dpy->fd, &r_mask) -#endif - ) - { - _XAlignedBuffer buf; - BytesReadable_t pend; - register int len; - register xReply *rep; - - /* find out how much data can be read */ - if (_X11TransBytesReadable(dpy->trans_conn, &pend) < 0) -#ifdef NX_TRANS_SOCKET - { - _XIOError(dpy); - - return; - } -#else - _XIOError(dpy); -#endif - len = pend; - - /* must read at least one xEvent; if none is pending, then - we'll just block waiting for it */ - if (len < SIZEOF(xReply) -#ifdef XTHREADS - || dpy->async_handlers -#endif - ) - len = SIZEOF(xReply); - - /* but we won't read more than the max buffer size */ - if (len > BUFSIZE) len = BUFSIZE; - - /* round down to an integral number of XReps */ - len = (len / SIZEOF(xReply)) * SIZEOF(xReply); - - (void) _XRead (dpy, buf.buf, (long) len); - - STARTITERATE(rep,xReply,buf.buf,len > 0) { - if (rep->generic.type == X_Reply) { - int tmp = len; - RESETITERPTR(rep,xReply, - _XAsyncReply (dpy, rep, - ITERPTR(rep), &tmp, True)); - len = tmp; - pend = len; - } else { - if (rep->generic.type == X_Error) - _XError (dpy, (xError *)rep); - else /* must be an event packet */ - _XEnq (dpy, (xEvent *)rep); - INCITERPTR(rep,xReply); - len -= SIZEOF(xReply); - } - } ENDITERATE -#ifdef XTHREADS - if (dpy->lock && dpy->lock->event_awaiters) - ConditionSignal(dpy, dpy->lock->event_awaiters->cv); -#endif - } -#ifdef USE_POLL - if (filedes.revents & (POLLOUT|POLLHUP|POLLERR)) -#else - if (FD_ISSET(dpy->fd, &w_mask)) -#endif - { -#ifdef XTHREADS - if (dpy->lock) { - ConditionBroadcast(dpy, dpy->lock->writers); - } -#endif - return; - } - } -} - - -#define POLLFD_CACHE_SIZE 5 - -/* initialize the struct array passed to poll() below */ -Bool _XPollfdCacheInit( - Display *dpy) -{ -#ifdef USE_POLL - struct pollfd *pfp; - - pfp = (struct pollfd *)Xmalloc(POLLFD_CACHE_SIZE * sizeof(struct pollfd)); - if (!pfp) - return False; - pfp[0].fd = dpy->fd; - pfp[0].events = POLLIN; - - dpy->filedes = (XPointer)pfp; -#endif - return True; -} - -void _XPollfdCacheAdd( - Display *dpy, - int fd) -{ -#ifdef USE_POLL - struct pollfd *pfp = (struct pollfd *)dpy->filedes; - - if (dpy->im_fd_length <= POLLFD_CACHE_SIZE) { - pfp[dpy->im_fd_length].fd = fd; - pfp[dpy->im_fd_length].events = POLLIN; - } -#endif -} - -/* ARGSUSED */ -void _XPollfdCacheDel( - Display *dpy, - int fd) /* not used */ -{ -#ifdef USE_POLL - struct pollfd *pfp = (struct pollfd *)dpy->filedes; - struct _XConnectionInfo *conni; - - /* just recalculate whole list */ - if (dpy->im_fd_length <= POLLFD_CACHE_SIZE) { - int loc = 1; - for (conni = dpy->im_fd_info; conni; conni=conni->next) { - pfp[loc].fd = conni->fd; - pfp[loc].events = POLLIN; - loc++; - } - } -#endif -} - -/* returns True iff there is an event in the queue newer than serial_num */ - -static Bool -_XNewerQueuedEvent( - Display *dpy, - int serial_num) -{ - _XQEvent *qev; - - if (dpy->next_event_serial_num == serial_num) - return False; - - qev = dpy->head; - while (qev) { - if (qev->qserial_num >= serial_num) { - return True; - } - qev = qev->next; - } - return False; -} - -static int -_XWaitForReadable( - Display *dpy) -{ - int result; - int fd = dpy->fd; - struct _XConnectionInfo *ilist; - register int saved_event_serial = 0; - int in_read_events = 0; - register Bool did_proc_conni = False; -#ifdef USE_POLL - struct pollfd *filedes; -#else - fd_set r_mask; - int highest_fd = fd; -#endif - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - int congestion; -#endif -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - return -1; - } -#endif - -#ifdef USE_POLL - if (dpy->im_fd_length + 1 > POLLFD_CACHE_SIZE - && !(dpy->flags & XlibDisplayProcConni)) { - /* XXX - this fallback is gross */ - int i; - - filedes = (struct pollfd *)Xmalloc(dpy->im_fd_length * sizeof(struct pollfd)); - filedes[0].fd = fd; - filedes[0].events = POLLIN; - for (ilist=dpy->im_fd_info, i=1; ilist; ilist=ilist->next, i++) { - filedes[i].fd = ilist->fd; - filedes[i].events = POLLIN; - } - } else { - filedes = (struct pollfd *)dpy->filedes; - } -#else - FD_ZERO(&r_mask); -#endif - for (;;) { -#ifndef USE_POLL - FD_SET(fd, &r_mask); - if (!(dpy->flags & XlibDisplayProcConni)) - for (ilist=dpy->im_fd_info; ilist; ilist=ilist->next) { - FD_SET(ilist->fd, &r_mask); - if (ilist->fd > highest_fd) - highest_fd = ilist->fd; - } -#endif - UnlockDisplay(dpy); -#ifdef USE_POLL -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XWaitForReadable: Calling poll().\n"); -#endif - result = poll(filedes, - (dpy->flags & XlibDisplayProcConni) ? 1 : 1+dpy->im_fd_length, - -1); -#else -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XWaitForReadable: Calling select().\n"); -#endif -#ifdef NX_TRANS_SOCKET - /* - * Give a chance to the registered application - * to perform any needed operation. - */ - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_XWaitForReadable: WAIT! Waiting for the display to become readable.\n"); -#endif - NXTransFlush(dpy->fd); - - if (_NXDisplayBlockFunction != NULL) { - (*_NXDisplayBlockFunction)(dpy, NXBlockRead); - } - - if (_NXDisplayErrorFunction != NULL) { - retry.tv_sec = 5; - retry.tv_usec = 0; - result = Select(highest_fd + 1, &r_mask, NULL, NULL, &retry); - } else { - result = Select(highest_fd + 1, &r_mask, NULL, NULL, NULL); - } -#else - result = Select(highest_fd + 1, &r_mask, NULL, NULL, NULL); -#endif -#endif -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XWaitForReadable: Out of select with result [%d] and errno [%d].\n", - result, (result < 0 ? errno : 0)); -#endif - InternalLockDisplay(dpy, dpy->flags & XlibDisplayReply); -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - if (_NXDisplayCongestionFunction != NULL && - _X11TransSocketCongestionChange(dpy->trans_conn, &congestion) == 1) { - (*_NXDisplayCongestionFunction)(dpy, congestion); - } -#endif -#ifdef NX_TRANS_SOCKET - if (result <= 0) { - if ((result == -1 && !ECHECK(EINTR)) || - (_NXDisplayErrorFunction != NULL && - (*_NXDisplayErrorFunction)(dpy, _XGetIOError(dpy)))) { - _XIOError(dpy); - return -1; - } - continue; - } -#else - if (result == -1 && !ECHECK(EINTR)) _XIOError(dpy); - if (result <= 0) - continue; -#endif -#ifdef USE_POLL - if (filedes[0].revents & (POLLIN|POLLHUP|POLLERR)) -#else - if (FD_ISSET(fd, &r_mask)) -#endif - break; - if (!(dpy->flags & XlibDisplayProcConni)) { - int i; - - saved_event_serial = dpy->next_event_serial_num; - /* dpy flags can be clobbered by internal connection callback */ - in_read_events = dpy->flags & XlibDisplayReadEvents; - for (ilist=dpy->im_fd_info, i=1; ilist; ilist=ilist->next, i++) { -#ifdef USE_POLL - if (filedes[i].revents & POLLIN) -#else - if (FD_ISSET(ilist->fd, &r_mask)) -#endif - { - _XProcessInternalConnection(dpy, ilist); - did_proc_conni = True; - } - } -#ifdef USE_POLL - if (dpy->im_fd_length + 1 > POLLFD_CACHE_SIZE) - Xfree(filedes); -#endif - } - if (did_proc_conni) { - /* some internal connection callback might have done an - XPutBackEvent. We notice it here and if we needed an event, - we can return all the way. */ - if (_XNewerQueuedEvent(dpy, saved_event_serial) - && (in_read_events -#ifdef XTHREADS - || (dpy->lock && dpy->lock->event_awaiters) -#endif - )) - return -2; - did_proc_conni = False; - } - } -#ifdef XTHREADS -#ifdef XTHREADS_DEBUG - printf("thread %x _XWaitForReadable returning\n", XThread_Self()); -#endif -#endif - return 0; -} - -static -int _XSeqSyncFunction( - register Display *dpy) -{ - xGetInputFocusReply rep; - register xReq *req; - -#ifdef NX_TRANS_SOCKET -#ifdef NX_TRANS_DEBUG - fprintf(stderr, "_XSeqSyncFunction: Going to synchronize the display.\n"); -#endif - if (dpy->flags & XlibDisplayIOError) - { -#ifdef NX_TRANS_DEBUG - fprintf(stderr, "_XSeqSyncFunction: Returning 0 with I/O error detected.\n"); -#endif - return 0; - } -#endif - - LockDisplay(dpy); - if ((dpy->request - dpy->last_request_read) >= (BUFSIZE / SIZEOF(xReq))) { - GetEmptyReq(GetInputFocus, req); - (void) _XReply (dpy, (xReply *)&rep, 0, xTrue); - } - /* could get XID handler while waiting for reply in MT env */ - if (dpy->synchandler == _XSeqSyncFunction) { - dpy->synchandler = dpy->savedsynchandler; - dpy->flags &= ~XlibDisplayPrivSync; - } - UnlockDisplay(dpy); - SyncHandle(); - return 0; -} - -#ifdef XTHREADS -static void _XFlushInt( - register Display *dpy, - register xcondition_t cv); -#endif - -/* - * _XFlush - Flush the X request buffer. If the buffer is empty, no - * action is taken. This routine correctly handles incremental writes. - * This routine may have to be reworked if int < long. - */ -void _XFlush( - register Display *dpy) -{ -#ifdef XTHREADS - /* With multi-threading we introduce an internal routine to which - we can pass a condition variable to do locking correctly. */ - - _XFlushInt(dpy, NULL); -} - -/* _XFlushInt - Internal version of _XFlush used to do multi-threaded - * locking correctly. - */ - -static void _XFlushInt( - register Display *dpy, - register xcondition_t cv) -{ -#endif /* XTHREADS*/ - register long size, todo; - register int write_stat; - register char *bufindex; - _XExtension *ext; -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - int congestion; -#endif - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XFlushInt: Entering flush with [%d] bytes to write.\n", - (dpy->bufptr - dpy->buffer)); -#endif - /* This fix resets the bufptr to the front of the buffer so - * additional appends to the bufptr will not corrupt memory. Since - * the server is down, these appends are no-op's anyway but - * callers of _XFlush() are not verifying this before they call it. - */ - if (dpy->flags & XlibDisplayIOError) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XFlushInt: Returning with I/O error detected.\n"); -#endif - dpy->bufptr = dpy->buffer; - dpy->last_req = (char *)&_dummy_request; - return; - } - -#ifdef XTHREADS -#ifdef NX_TRANS_SOCKET - while (dpy->flags & XlibDisplayWriting) { - if (_XGetIOError(dpy)) { - return; - } -#else - while (dpy->flags & XlibDisplayWriting) { -#endif - if (dpy->lock) { - ConditionWait(dpy, dpy->lock->writers); - } else { - _XWaitForWritable (dpy, cv); - } - } -#endif - size = todo = dpy->bufptr - dpy->buffer; - if (!size) return; -#ifdef XTHREADS - dpy->flags |= XlibDisplayWriting; - /* make sure no one else can put in data */ - dpy->bufptr = dpy->bufmax; -#endif - for (ext = dpy->flushes; ext; ext = ext->next_flush) - (*ext->before_flush)(dpy, &ext->codes, dpy->buffer, size); - bufindex = dpy->buffer; - /* - * While write has not written the entire buffer, keep looping - * until the entire buffer is written. bufindex will be - * incremented and size decremented as buffer is written out. - */ - while (size) { - ESET(0); - write_stat = _X11TransWrite(dpy->trans_conn, - bufindex, (int) todo); - if (write_stat >= 0) { -#ifdef NX_TRANS_SOCKET - if (_NXDisplayWriteFunction != NULL) { - (*_NXDisplayWriteFunction)(dpy, write_stat); - } -#ifdef NX_TRANS_CHANGE - if (_NXDisplayCongestionFunction != NULL && - _X11TransSocketCongestionChange(dpy->trans_conn, &congestion) == 1) { - (*_NXDisplayCongestionFunction)(dpy, congestion); - } -#endif -#endif - size -= write_stat; - todo = size; - bufindex += write_stat; - } else if (ETEST()) { - _XWaitForWritable(dpy -#ifdef XTHREADS - , cv -#endif - ); -#ifdef SUNSYSV - } else if (ECHECK(0)) { - _XWaitForWritable(dpy -#ifdef XTHREADS - , cv -#endif - ); -#endif -#ifdef ESZTEST - } else if (ESZTEST()) { - if (todo > 1) - todo >>= 1; - else { - _XWaitForWritable(dpy -#ifdef XTHREADS - , cv -#endif - ); - } -#endif -#ifdef NX_TRANS_SOCKET - } else if (!ECHECK(EINTR) || - (_NXDisplayErrorFunction != NULL && - (*_NXDisplayErrorFunction)(dpy, _XGetIOError(dpy)))) { - _XIOError(dpy); - return; - } -#else - } else if (!ECHECK(EINTR)) { - /* Write failed! */ - /* errno set by write system call. */ - _XIOError(dpy); - } -#endif -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - return; - } -#endif - } - dpy->last_req = (char *)&_dummy_request; - if ((dpy->request - dpy->last_request_read) >= SEQLIMIT && - !(dpy->flags & XlibDisplayPrivSync)) { - dpy->savedsynchandler = dpy->synchandler; - dpy->synchandler = _XSeqSyncFunction; - dpy->flags |= XlibDisplayPrivSync; - } - dpy->bufptr = dpy->buffer; -#ifdef XTHREADS - dpy->flags &= ~XlibDisplayWriting; -#endif -} - -int -_XEventsQueued( - register Display *dpy, - int mode) -{ - register int len; - BytesReadable_t pend; - _XAlignedBuffer buf; - register xReply *rep; - char *read_buf; -#ifdef XTHREADS - int entry_event_serial_num; - struct _XCVList *cvl = NULL; - xthread_t self; - -#ifdef XTHREADS_DEBUG - printf("_XEventsQueued called in thread %x\n", XThread_Self()); -#endif -#endif /* XTHREADS*/ - - if (mode == QueuedAfterFlush) - { - _XFlush(dpy); - if (dpy->qlen) - return(dpy->qlen); - } -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - if (dpy->flags & XlibDisplayIOError) { - fprintf(stderr, "_XEventsQueued: Returning [%d] after display failure.\n", - dpy->qlen); - } -#endif - if (dpy->flags & XlibDisplayIOError) return(dpy->qlen); - -#ifdef XTHREADS - /* create our condition variable and append to list, - * unless we were called from within XProcessInternalConnection - * or XLockDisplay - */ - xthread_clear_id(self); - if (dpy->lock && (xthread_have_id (dpy->lock->conni_thread) - || xthread_have_id (dpy->lock->locking_thread))) - /* some thread is in XProcessInternalConnection or XLockDisplay - so we have to see if we are it */ - self = XThread_Self(); - if (!xthread_have_id(self) - || (!xthread_equal(self, dpy->lock->conni_thread) - && !xthread_equal(self, dpy->lock->locking_thread))) { - /* In the multi-threaded case, if there is someone else - reading events, then there aren't any available, so - we just return. If we waited we would block. - */ - if (dpy->lock && dpy->lock->event_awaiters) - return dpy->qlen; - /* nobody here but us, so lock out any newcomers */ - cvl = QueueEventReaderLock(dpy); - } - - while (dpy->lock && cvl && dpy->lock->reply_first) { - /* note which events we have already seen so we'll know - if _XReply (in another thread) reads one */ - entry_event_serial_num = dpy->next_event_serial_num; - ConditionWait(dpy, cvl->cv); - /* did _XReply read an event we can return? */ - if (_XNewerQueuedEvent(dpy, entry_event_serial_num)) - { - UnlockNextEventReader(dpy); - return 0; - } - } -#endif /* XTHREADS*/ - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XEventsQueued: Checking bytes readable.\n"); -#endif - if (_X11TransBytesReadable(dpy->trans_conn, &pend) < 0) -#ifdef NX_TRANS_SOCKET - { - _XIOError(dpy); - - return (dpy->qlen); - } -#else - _XIOError(dpy); -#endif -#ifdef XCONN_CHECK_FREQ - /* This is a crock, required because FIONREAD or equivalent is - * not guaranteed to detect a broken connection. - */ - if (!pend && !dpy->qlen && ++dpy->conn_checker >= XCONN_CHECK_FREQ) - { - int result; -#ifdef USE_POLL - struct pollfd filedes; -#else - fd_set r_mask; - static struct timeval zero_time; -#endif - - dpy->conn_checker = 0; -#ifdef USE_POLL -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XEventsQueued: Calling poll().\n"); -#endif - filedes.fd = dpy->fd; - filedes.events = POLLIN; - if ((result = poll(&filedes, 1, 0))) -#else -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XEventsQueued: Calling select().\n"); -#endif - FD_ZERO(&r_mask); - FD_SET(dpy->fd, &r_mask); - if ((result = Select(dpy->fd + 1, &r_mask, NULL, NULL, &zero_time))) -#endif - { - if (result > 0) - { - if (_X11TransBytesReadable(dpy->trans_conn, &pend) < 0) -#ifdef NX_TRANS_SOCKET - { - _XIOError(dpy); - - return (dpy->qlen); - } -#else - _XIOError(dpy); -#endif - /* we should not get zero, if we do, force a read */ - if (!pend) - pend = SIZEOF(xReply); - } -#ifdef NX_TRANS_SOCKET - if (result <= 0) { - if ((result == -1 && !ECHECK(EINTR)) || - (_NXDisplayErrorFunction != NULL && - (*_NXDisplayErrorFunction)(dpy, _XGetIOError(dpy)))) { - _XIOError(dpy); - return (dpy->qlen); - } - } -#else - else if (result < 0 && !ECHECK(EINTR)) - _XIOError(dpy); -#endif - } - } -#endif /* XCONN_CHECK_FREQ */ - if (!(len = pend)) { - /* _XFlush can enqueue events */ -#ifdef XTHREADS - if (cvl) -#endif - { - UnlockNextEventReader(dpy); - } - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XEventsQueued: Returning [%d].\n", dpy->qlen); -#endif - return(dpy->qlen); - } - /* Force a read if there is not enough data. Otherwise, - * a select() loop at a higher-level will spin undesirably, - * and we've seen at least one OS that appears to not update - * the result from FIONREAD once it has returned nonzero. - */ -#ifdef XTHREADS - if (dpy->lock && dpy->lock->reply_awaiters) { - read_buf = (char *)dpy->lock->reply_awaiters->buf; - len = SIZEOF(xReply); - } else -#endif /* XTHREADS*/ - { - read_buf = buf.buf; - - if (len < SIZEOF(xReply) -#ifdef XTHREADS - || dpy->async_handlers -#endif - ) - len = SIZEOF(xReply); - else if (len > BUFSIZE) - len = BUFSIZE; - len = (len / SIZEOF(xReply)) * SIZEOF(xReply); - } -#ifdef XCONN_CHECK_FREQ - dpy->conn_checker = 0; -#endif - - (void) _XRead (dpy, read_buf, (long) len); - -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - return(dpy->qlen); - } -#endif -#ifdef XTHREADS - /* what did we actually read: reply or event? */ - if (dpy->lock && dpy->lock->reply_awaiters) { - if (((xReply *)read_buf)->generic.type == X_Reply || - ((xReply *)read_buf)->generic.type == X_Error) - { - dpy->lock->reply_was_read = True; - dpy->lock->reply_first = True; - if (read_buf != (char *)dpy->lock->reply_awaiters->buf) - memcpy(dpy->lock->reply_awaiters->buf, read_buf, - len); - if (cvl) { - UnlockNextEventReader(dpy); - } - return(dpy->qlen); /* we read, so we can return */ - } else if (read_buf != buf.buf) - memcpy(buf.buf, read_buf, len); - } -#endif /* XTHREADS*/ - - STARTITERATE(rep,xReply,buf.buf,len > 0) { - if (rep->generic.type == X_Reply) { - int tmp = len; - RESETITERPTR(rep,xReply, - _XAsyncReply (dpy, rep, - ITERPTR(rep), &tmp, True)); - len = tmp; - pend = len; - } else { - if (rep->generic.type == X_Error) - _XError (dpy, (xError *)rep); - else /* must be an event packet */ - _XEnq (dpy, (xEvent *)rep); - INCITERPTR(rep,xReply); - len -= SIZEOF(xReply); - } - } ENDITERATE - -#ifdef XTHREADS - if (cvl) -#endif - { - UnlockNextEventReader(dpy); - } - return(dpy->qlen); -} - -/* _XReadEvents - Flush the output queue, - * then read as many events as possible (but at least 1) and enqueue them - */ -void _XReadEvents( - register Display *dpy) -{ - _XAlignedBuffer buf; - BytesReadable_t pend; - int len; - register xReply *rep; - Bool not_yet_flushed = True; - char *read_buf; - int i; - int entry_event_serial_num = dpy->next_event_serial_num; -#ifdef XTHREADS - struct _XCVList *cvl = NULL; - xthread_t self; - -#ifdef XTHREADS_DEBUG - printf("_XReadEvents called in thread %x\n", - XThread_Self()); -#endif - /* create our condition variable and append to list, - * unless we were called from within XProcessInternalConnection - * or XLockDisplay - */ - xthread_clear_id(self); - if (dpy->lock && (xthread_have_id (dpy->lock->conni_thread) - || xthread_have_id (dpy->lock->locking_thread))) - /* some thread is in XProcessInternalConnection or XLockDisplay - so we have to see if we are it */ - self = XThread_Self(); - if (!xthread_have_id(self) - || (!xthread_equal(self, dpy->lock->conni_thread) - && !xthread_equal(self, dpy->lock->locking_thread))) - cvl = QueueEventReaderLock(dpy); -#endif /* XTHREADS */ - - do { -#ifdef XTHREADS - /* if it is not our turn to read an event off the wire, - wait til we're at head of list */ - if (dpy->lock && cvl && - (dpy->lock->event_awaiters != cvl || - dpy->lock->reply_first)) { - ConditionWait(dpy, cvl->cv); - continue; - } -#endif /* XTHREADS */ - /* find out how much data can be read */ - if (_X11TransBytesReadable(dpy->trans_conn, &pend) < 0) -#ifdef NX_TRANS_SOCKET - { - _XIOError(dpy); - - return; - } -#else - _XIOError(dpy); -#endif - len = pend; - - /* must read at least one xEvent; if none is pending, then - we'll just flush and block waiting for it */ - if (len < SIZEOF(xEvent) -#ifdef XTHREADS - || dpy->async_handlers -#endif - ) { - len = SIZEOF(xEvent); - /* don't flush until the first time we would block */ - if (not_yet_flushed) { - _XFlush (dpy); - if (_XNewerQueuedEvent(dpy, entry_event_serial_num)) { - /* _XReply has read an event for us */ - goto got_event; - } - not_yet_flushed = False; - } - } - -#ifdef XTHREADS - /* If someone is waiting for a reply, gamble that - the reply will be the next thing on the wire - and read it into their buffer. */ - if (dpy->lock && dpy->lock->reply_awaiters) { - read_buf = (char *)dpy->lock->reply_awaiters->buf; - len = SIZEOF(xReply); - } else -#endif /* XTHREADS*/ - { - read_buf = buf.buf; - - /* but we won't read more than the max buffer size */ - if (len > BUFSIZE) - len = BUFSIZE; - - /* round down to an integral number of XReps */ - len = (len / SIZEOF(xEvent)) * SIZEOF(xEvent); - } - -#ifdef XTHREADS - if (xthread_have_id(self)) - /* save value we may have to stick in conni_thread */ - dpy->lock->reading_thread = self; -#endif /* XTHREADS */ - dpy->flags |= XlibDisplayReadEvents; - i = _XRead (dpy, read_buf, (long) len); - dpy->flags &= ~XlibDisplayReadEvents; -#ifdef NX_TRANS_SOCKET - if (dpy->flags & XlibDisplayIOError) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XReadEvents: Returning with I/O error detected.\n"); -#endif - return; - } -#endif - if (i == -2) { - /* special flag from _XRead to say that internal connection has - done XPutBackEvent. Which we can use so we're done. */ - got_event: -#ifdef XTHREADS - if (dpy->lock && dpy->lock->lock_wait) { - if (dpy->lock->event_awaiters != cvl) - /* since it is not us, must be user lock thread */ - ConditionSignal(dpy, - dpy->lock->event_awaiters->cv); - (*dpy->lock->lock_wait)(dpy); - continue; - } -#endif - break; - } -#ifdef XTHREADS - if (xthread_have_id(self)) - xthread_clear_id(dpy->lock->reading_thread); - - /* what did we actually read: reply or event? */ - if (dpy->lock && dpy->lock->reply_awaiters) { - if (((xReply *)read_buf)->generic.type == X_Reply || - ((xReply *)read_buf)->generic.type == X_Error) - { - dpy->lock->reply_was_read = True; - dpy->lock->reply_first = True; - if (read_buf != (char *)dpy->lock->reply_awaiters->buf) - memcpy(dpy->lock->reply_awaiters->buf, - read_buf, len); - ConditionSignal(dpy, dpy->lock->reply_awaiters->cv); - continue; - } else if (read_buf != buf.buf) - memcpy(buf.buf, read_buf, len); - } -#endif /* XTHREADS */ - - STARTITERATE(rep,xReply,buf.buf,len > 0) { - if (rep->generic.type == X_Reply) { - RESETITERPTR(rep,xReply, - _XAsyncReply (dpy, rep, - ITERPTR(rep), &len, True)); - pend = len; - } else { - if (rep->generic.type == X_Error) - _XError (dpy, (xError *) rep); - else /* must be an event packet */ - _XEnq (dpy, (xEvent *)rep); - INCITERPTR(rep,xReply); - len -= SIZEOF(xReply); - } - } ENDITERATE; - } while (!_XNewerQueuedEvent(dpy, entry_event_serial_num)); - - UnlockNextEventReader(dpy); -} - -/* - * _XRead - Read bytes from the socket taking into account incomplete - * reads. This routine may have to be reworked if int < long. - */ -int _XRead( - register Display *dpy, - register char *data, - register long size) -{ - register long bytes_read; -#ifdef XTHREADS - int original_size = size; -#endif -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - int congestion; -#endif - - if ((dpy->flags & XlibDisplayIOError) || size == 0) - return 0; - ESET(0); -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - while (1) { - /* - * Need to check the congestion state - * after the read so split the statement - * in multiple blocks. - */ - - bytes_read = _X11TransRead(dpy->trans_conn, data, (int)size); - if (_NXDisplayCongestionFunction != NULL && - _X11TransSocketCongestionChange(dpy->trans_conn, &congestion) == 1) { - (*_NXDisplayCongestionFunction)(dpy, congestion); - } - if (bytes_read == size) { - break; - } -#else - while ((bytes_read = _X11TransRead(dpy->trans_conn, data, (int)size)) - != size) { -#endif - - if (bytes_read > 0) { - size -= bytes_read; - data += bytes_read; - } - else if (ETEST()) { - if (_XWaitForReadable(dpy) == -2) - return -2; /* internal connection did XPutBackEvent */ - ESET(0); - } -#ifdef SUNSYSV - else if (ECHECK(0)) { - if (_XWaitForReadable(dpy) == -2) - return -2; /* internal connection did XPutBackEvent */ - } -#endif - else if (bytes_read == 0) { - /* Read failed because of end of file! */ - ESET(EPIPE); -#ifdef NX_TRANS_SOCKET - _XIOError(dpy); - - return -1; -#else - _XIOError(dpy); -#endif - } - - else /* bytes_read is less than 0; presumably -1 */ { - /* If it's a system call interrupt, it's not an error. */ -#ifdef NX_TRANS_SOCKET - if (!ECHECK(EINTR) || - (_NXDisplayErrorFunction != NULL && - (*_NXDisplayErrorFunction)(dpy, _XGetIOError(dpy)))) { - _XIOError(dpy); - return -1; - } -#else - if (!ECHECK(EINTR)) - _XIOError(dpy); -#endif - } -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - return -1; - } -#endif - } -#ifdef XTHREADS - if (dpy->lock && dpy->lock->reply_bytes_left > 0) - { - dpy->lock->reply_bytes_left -= original_size; - if (dpy->lock->reply_bytes_left == 0) { - dpy->flags &= ~XlibDisplayReply; - UnlockNextReplyReader(dpy); - } - } -#endif /* XTHREADS*/ - return 0; -} - -#ifdef LONG64 -void _XRead32( - Display *dpy, - register long *data, - long len) -{ - register int *buf; - register long i; - - if (len) { - (void) _XRead(dpy, (char *)data, len); - i = len >> 2; - buf = (int *)data + i; - data += i; - while (--i >= 0) - *--data = *--buf; - } -} -#endif /* LONG64 */ - -#ifdef WORD64 - -/* - * XXX This is a *really* stupid way of doing this.... - * PACKBUFFERSIZE must be a multiple of 4. - */ - -#define PACKBUFFERSIZE 4096 - - -/* - * _XRead32 - Read bytes from the socket unpacking each 32 bits - * into a long (64 bits on a CRAY computer). - * - */ -static void _doXRead32( - register Display *dpy, - register long *data - register long size, - register char *packbuffer) -{ - long *lpack,*lp; - long mask32 = 0x00000000ffffffff; - long maskw, nwords, i, bits; - - _XReadPad (dpy, packbuffer, size); - - lp = data; - lpack = (long *) packbuffer; - nwords = size >> 2; - bits = 32; - - for(i=0;i> bits; - bits = bits ^32; - if(bits){ - lpack++; - } - } -} - -void _XRead32( - Display *dpy, - long *data, - long len) -{ - char packbuffer[PACKBUFFERSIZE]; - unsigned nunits = PACKBUFFERSIZE >> 2; - - for (; len > PACKBUFFERSIZE; len -= PACKBUFFERSIZE, data += nunits) { - _doXRead32 (dpy, data, PACKBUFFERSIZE, packbuffer); - } - if (len) _doXRead32 (dpy, data, len, packbuffer); -} - - - -/* - * _XRead16 - Read bytes from the socket unpacking each 16 bits - * into a long (64 bits on a CRAY computer). - * - */ -static _doXRead16( - register Display *dpy, - register short *data, - register long size, - char *packbuffer) -{ - long *lpack,*lp; - long mask16 = 0x000000000000ffff; - long maskw, nwords, i, bits; - - (void) _XRead(dpy,packbuffer,size); /* don't do a padded read... */ - - lp = (long *) data; - lpack = (long *) packbuffer; - nwords = size >> 1; /* number of 16 bit words to be unpacked */ - bits = 48; - for(i=0;i> bits; - bits -= 16; - if(bits < 0){ - lpack++; - bits = 48; - } - } -} - -void _XRead16( - Display *dpy, - short *data, - long len) -{ - char packbuffer[PACKBUFFERSIZE]; - unsigned nunits = PACKBUFFERSIZE >> 1; - - for (; len > PACKBUFFERSIZE; len -= PACKBUFFERSIZE, data += nunits) { - _doXRead16 (dpy, data, PACKBUFFERSIZE, packbuffer); - } - if (len) _doXRead16 (dpy, data, len, packbuffer); -} - -void _XRead16Pad( - Display *dpy, - short *data, - long size) -{ - int slop = (size & 3); - short slopbuf[3]; - - _XRead16 (dpy, data, size); - if (slop > 0) { - _XRead16 (dpy, slopbuf, 4 - slop); - } -} -#endif /* WORD64 */ - - -/* - * _XReadPad - Read bytes from the socket taking into account incomplete - * reads. If the number of bytes is not 0 mod 4, read additional pad - * bytes. This routine may have to be reworked if int < long. - */ -void _XReadPad( - register Display *dpy, - register char *data, - register long size) -{ - register long bytes_read; - struct iovec iov[2]; - char pad[3]; -#ifdef XTHREADS - int original_size; -#endif -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - int congestion; -#endif - - if ((dpy->flags & XlibDisplayIOError) || size == 0) return; - iov[0].iov_len = (int)size; - iov[0].iov_base = data; - /* - * The following hack is used to provide 32 bit long-word - * aligned padding. The [1] vector is of length 0, 1, 2, or 3, - * whatever is needed. - */ - - iov[1].iov_len = -size & 3; - iov[1].iov_base = pad; - size += iov[1].iov_len; -#ifdef XTHREADS - original_size = size; -#endif - ESET(0); -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - while (1) { - bytes_read = _X11TransReadv (dpy->trans_conn, iov, 2); - if (_NXDisplayCongestionFunction != NULL && - _X11TransSocketCongestionChange(dpy->trans_conn, &congestion) == 1) { - (*_NXDisplayCongestionFunction)(dpy, congestion); - } - if (bytes_read == size) { - break; - } -#else - while ((bytes_read = _X11TransReadv (dpy->trans_conn, iov, 2)) != size) { -#endif - - if (bytes_read > 0) { - size -= bytes_read; - if (iov[0].iov_len < bytes_read) { - int pad_bytes_read = bytes_read - iov[0].iov_len; - iov[1].iov_len -= pad_bytes_read; - iov[1].iov_base = - (char *)iov[1].iov_base + pad_bytes_read; - iov[0].iov_len = 0; - } - else { - iov[0].iov_len -= bytes_read; - iov[0].iov_base = (char *)iov[0].iov_base + bytes_read; - } - } - else if (ETEST()) { - _XWaitForReadable(dpy); - ESET(0); - } -#ifdef SUNSYSV - else if (ECHECK(0)) { - _XWaitForReadable(dpy); - } -#endif - else if (bytes_read == 0) { - /* Read failed because of end of file! */ - ESET(EPIPE); -#ifdef NX_TRANS_SOCKET - _XIOError(dpy); - - return; -#else - _XIOError(dpy); -#endif - } - - else /* bytes_read is less than 0; presumably -1 */ { - /* If it's a system call interrupt, it's not an error. */ -#ifdef NX_TRANS_SOCKET - if (!ECHECK(EINTR) || - (_NXDisplayErrorFunction != NULL && - (*_NXDisplayErrorFunction)(dpy, _XGetIOError(dpy)))) { - _XIOError(dpy); - return; - } -#else - if (!ECHECK(EINTR)) - _XIOError(dpy); -#endif - } -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - return; - } -#endif - } -#ifdef XTHREADS - if (dpy->lock && dpy->lock->reply_bytes_left > 0) - { - dpy->lock->reply_bytes_left -= original_size; - if (dpy->lock->reply_bytes_left == 0) { - dpy->flags &= ~XlibDisplayReply; - UnlockNextReplyReader(dpy); - } - } -#endif /* XTHREADS*/ -} - -/* - * _XSend - Flush the buffer and send the client data. 32 bit word aligned - * transmission is used, if size is not 0 mod 4, extra bytes are transmitted. - * This routine may have to be reworked if int < long; - */ -void -_XSend ( - register Display *dpy, - _Xconst char *data, - register long size) -{ - struct iovec iov[3]; - static char const pad[3] = {0, 0, 0}; - /* XText8 and XText16 require that the padding bytes be zero! */ - - long skip, dbufsize, padsize, total, todo; - _XExtension *ext; -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_CHANGE) - int congestion; -#endif - -#ifdef NX_TRANS_SOCKET -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XSend: Sending data with [%d] bytes to write.\n", - (dpy->bufptr - dpy->buffer)); -#endif - if (!size || (dpy->flags & XlibDisplayIOError)) - { - if (dpy->flags & XlibDisplayIOError) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XSend: Returning with I/O error detected.\n"); -#endif - dpy->bufptr = dpy->buffer; - dpy->last_req = (char *)&_dummy_request; - } - - return; - } -#else - if (!size || (dpy->flags & XlibDisplayIOError)) return; -#endif - dbufsize = dpy->bufptr - dpy->buffer; -#ifdef XTHREADS - dpy->flags |= XlibDisplayWriting; - /* make sure no one else can put in data */ - dpy->bufptr = dpy->bufmax; -#endif - padsize = -size & 3; - for (ext = dpy->flushes; ext; ext = ext->next_flush) { - (*ext->before_flush)(dpy, &ext->codes, dpy->buffer, dbufsize); - (*ext->before_flush)(dpy, &ext->codes, (char *)data, size); - if (padsize) - (*ext->before_flush)(dpy, &ext->codes, pad, padsize); - } - skip = 0; - todo = total = dbufsize + size + padsize; - - /* - * There are 3 pieces that may need to be written out: - * - * o whatever is in the display buffer - * o the data passed in by the user - * o any padding needed to 32bit align the whole mess - * - * This loop looks at all 3 pieces each time through. It uses skip - * to figure out whether or not a given piece is needed. - */ - while (total) { - long before = skip; /* amount of whole thing written */ - long remain = todo; /* amount to try this time, <= total */ - int i = 0; - long len; - - /* You could be very general here and have "in" and "out" iovecs - * and write a loop without using a macro, but what the heck. This - * translates to: - * - * how much of this piece is new? - * if more new then we are trying this time, clamp - * if nothing new - * then bump down amount already written, for next piece - * else put new stuff in iovec, will need all of next piece - * - * Note that todo had better be at least 1 or else we'll end up - * writing 0 iovecs. - */ -#define InsertIOV(pointer, length) \ - len = (length) - before; \ - if (len > remain) \ - len = remain; \ - if (len <= 0) { \ - before = (-len); \ - } else { \ - iov[i].iov_len = len; \ - iov[i].iov_base = (pointer) + before; \ - i++; \ - remain -= len; \ - before = 0; \ - } - - InsertIOV (dpy->buffer, dbufsize) - InsertIOV ((char *)data, size) - InsertIOV ((char *)pad, padsize) - - ESET(0); - if ((len = _X11TransWritev(dpy->trans_conn, iov, i)) >= 0) { -#ifdef NX_TRANS_SOCKET - if (_NXDisplayWriteFunction != NULL) { - (*_NXDisplayWriteFunction)(dpy, len); - } -#ifdef NX_TRANS_CHANGE - if (_NXDisplayCongestionFunction != NULL && - _X11TransSocketCongestionChange(dpy->trans_conn, &congestion) == 1) { - (*_NXDisplayCongestionFunction)(dpy, congestion); - } -#endif -#endif - skip += len; - total -= len; - todo = total; - } else if (ETEST()) { - _XWaitForWritable(dpy -#ifdef XTHREADS - , NULL -#endif - ); -#ifdef SUNSYSV - } else if (ECHECK(0)) { - _XWaitForWritable(dpy -#ifdef XTHREADS - , NULL -#endif - ); -#endif -#ifdef ESZTEST - } else if (ESZTEST()) { - if (todo > 1) - todo >>= 1; - else { - _XWaitForWritable(dpy -#ifdef XTHREADS - , NULL -#endif - ); - } -#endif -#ifdef NX_TRANS_SOCKET - } else if (!ECHECK(EINTR) || - (_NXDisplayErrorFunction != NULL && - (*_NXDisplayErrorFunction)(dpy, _XGetIOError(dpy)))) { - _XIOError(dpy); - return; - } -#else - } else if (!ECHECK(EINTR)) { - _XIOError(dpy); - } -#endif -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - return; - } -#endif - } - dpy->last_req = (char *) & _dummy_request; - if ((dpy->request - dpy->last_request_read) >= SEQLIMIT && - !(dpy->flags & XlibDisplayPrivSync)) { - dpy->savedsynchandler = dpy->synchandler; - dpy->synchandler = _XSeqSyncFunction; - dpy->flags |= XlibDisplayPrivSync; - } - dpy->bufptr = dpy->buffer; -#ifdef XTHREADS - dpy->flags &= ~XlibDisplayWriting; -#endif - return; -} - -static void -_XGetMiscCode( - register Display *dpy) -{ - xQueryExtensionReply qrep; - register xQueryExtensionReq *qreq; - xXCMiscGetVersionReply vrep; - register xXCMiscGetVersionReq *vreq; - - if (dpy->xcmisc_opcode) - return; - GetReq(QueryExtension, qreq); - qreq->nbytes = sizeof(XCMiscExtensionName) - 1; - qreq->length += (qreq->nbytes+(unsigned)3)>>2; - _XSend(dpy, XCMiscExtensionName, (long)qreq->nbytes); - if (!_XReply (dpy, (xReply *)&qrep, 0, xTrue)) - dpy->xcmisc_opcode = -1; - else { - GetReq(XCMiscGetVersion, vreq); - vreq->reqType = qrep.major_opcode; - vreq->miscReqType = X_XCMiscGetVersion; - vreq->majorVersion = XCMiscMajorVersion; - vreq->minorVersion = XCMiscMinorVersion; - if (!_XReply (dpy, (xReply *)&vrep, 0, xTrue)) - dpy->xcmisc_opcode = -1; - else - dpy->xcmisc_opcode = qrep.major_opcode; - } -} - -static int -_XIDHandler( - register Display *dpy) -{ - xXCMiscGetXIDRangeReply grep; - register xXCMiscGetXIDRangeReq *greq; - - LockDisplay(dpy); - _XGetMiscCode(dpy); - if (dpy->xcmisc_opcode > 0) { - GetReq(XCMiscGetXIDRange, greq); - greq->reqType = dpy->xcmisc_opcode; - greq->miscReqType = X_XCMiscGetXIDRange; - if (_XReply (dpy, (xReply *)&grep, 0, xTrue) && grep.count) { - dpy->resource_id = ((grep.start_id - dpy->resource_base) >> - dpy->resource_shift); - dpy->resource_max = dpy->resource_id; - if (grep.count > 5) - dpy->resource_max += grep.count - 6; - dpy->resource_max <<= dpy->resource_shift; - } - } - if (dpy->flags & XlibDisplayPrivSync) { - dpy->synchandler = dpy->savedsynchandler; - dpy->flags &= ~XlibDisplayPrivSync; - } - UnlockDisplay(dpy); - SyncHandle(); - return 0; -} - -/* - * _XAllocID - resource ID allocation routine. - */ -XID _XAllocID( - register Display *dpy) -{ - XID id; - - id = dpy->resource_id << dpy->resource_shift; - if (id >= dpy->resource_max) { - if (!(dpy->flags & XlibDisplayPrivSync)) { - dpy->savedsynchandler = dpy->synchandler; - dpy->flags |= XlibDisplayPrivSync; - } - dpy->synchandler = _XIDHandler; - dpy->resource_max = dpy->resource_mask + 1; - } - if (id <= dpy->resource_mask) { - dpy->resource_id++; - return (dpy->resource_base + id); - } - if (id != 0x10000000) { - (void) fprintf(stderr, - "Xlib: resource ID allocation space exhausted!\n"); - id = 0x10000000; - dpy->resource_id = id >> dpy->resource_shift; - } - return id; -} - -/* - * _XAllocIDs - multiple resource ID allocation routine. - */ -void _XAllocIDs( - register Display *dpy, - XID *ids, - int count) -{ - XID id; - int i; - xXCMiscGetXIDListReply grep; - register xXCMiscGetXIDListReq *greq; - - id = dpy->resource_id << dpy->resource_shift; - if (dpy->resource_max <= dpy->resource_mask && - id <= dpy->resource_mask && - (dpy->resource_max - id) > ((count - 1) << dpy->resource_shift)) { - id += dpy->resource_base; - for (i = 0; i < count; i++) { - ids[i] = id; - id += (1 << dpy->resource_shift); - dpy->resource_id++; - } - return; - } - grep.count = 0; - _XGetMiscCode(dpy); - if (dpy->xcmisc_opcode > 0) { - GetReq(XCMiscGetXIDList, greq); - greq->reqType = dpy->xcmisc_opcode; - greq->miscReqType = X_XCMiscGetXIDList; - greq->count = count; - if (_XReply(dpy, (xReply *)&grep, 0, xFalse) && grep.count) { - _XRead32(dpy, (long *) ids, 4L * (long) (grep.count)); - for (i = 0; i < grep.count; i++) { - id = (ids[i] - dpy->resource_base) >> dpy->resource_shift; - if (id >= dpy->resource_id) - dpy->resource_id = id; - } - if (id >= dpy->resource_max) { - if (!(dpy->flags & XlibDisplayPrivSync)) { - dpy->savedsynchandler = dpy->synchandler; - dpy->flags |= XlibDisplayPrivSync; - } - dpy->synchandler = _XIDHandler; - dpy->resource_max = dpy->resource_mask + 1; - } - } - } - for (i = grep.count; i < count; i++) - ids[i] = XAllocID(dpy); -} - -/* - * The hard part about this is that we only get 16 bits from a reply. - * We have three values that will march along, with the following invariant: - * dpy->last_request_read <= rep->sequenceNumber <= dpy->request - * We have to keep - * dpy->request - dpy->last_request_read < 2^16 - * or else we won't know for sure what value to use in events. We do this - * by forcing syncs when we get close. - */ - -unsigned long -_XSetLastRequestRead( - register Display *dpy, - register xGenericReply *rep) -{ - register unsigned long newseq, lastseq; - - lastseq = dpy->last_request_read; - /* - * KeymapNotify has no sequence number, but is always guaranteed - * to immediately follow another event, except when generated via - * SendEvent (hmmm). - */ - if ((rep->type & 0x7f) == KeymapNotify) - return(lastseq); - - newseq = (lastseq & ~((unsigned long)0xffff)) | rep->sequenceNumber; - - if (newseq < lastseq) { - newseq += 0x10000; - if (newseq > dpy->request) { - -#ifdef NX_TRANS_SOCKET - - if (_NXLostSequenceFunction != NULL) - { - (*_NXLostSequenceFunction)(dpy, newseq, dpy->request, - (unsigned int) rep->type); - } - else - { - (void) fprintf (stderr, - "Xlib: sequence lost (0x%lx > 0x%lx) in reply type 0x%x!\n", - newseq, dpy->request, - (unsigned int) rep->type); - } - -#else /* #ifdef NX_TRANS_SOCKET */ - - (void) fprintf (stderr, - "Xlib: sequence lost (0x%lx > 0x%lx) in reply type 0x%x!\n", - newseq, dpy->request, - (unsigned int) rep->type); - -#endif /* #ifdef NX_TRANS_SOCKET */ - - newseq -= 0x10000; - } - } - - dpy->last_request_read = newseq; - return(newseq); -} - -/* - * _XReply - Wait for a reply packet and copy its contents into the - * specified rep. Meanwhile we must handle error and event packets that - * we may encounter. - */ -Status -_XReply ( - register Display *dpy, - register xReply *rep, - int extra, /* number of 32-bit words expected after the reply */ - Bool discard) /* should I discard data following "extra" words? */ -{ - /* Pull out the serial number now, so that (currently illegal) requests - * generated by an error handler don't confuse us. - */ - unsigned long cur_request = dpy->request; -#ifdef XTHREADS - struct _XCVList *cvl; -#endif -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XReply: Going to wait for an X reply.\n"); -#endif - -#ifdef NX_TRANS_SOCKET - if (dpy->flags & XlibDisplayIOError) - { -#ifdef NX_TRANS_DEBUG - fprintf(stderr, "_XReply: Returning 0 with I/O error detected.\n"); -#endif - return 0; - } -#else - if (dpy->flags & XlibDisplayIOError) - return 0; -#endif - -#ifdef XTHREADS - /* create our condition variable and append to list */ - cvl = QueueReplyReaderLock(dpy); - if (cvl) { - cvl->buf = rep; - if (dpy->lock->reply_awaiters == cvl && !dpy->lock->event_awaiters) - dpy->lock->reply_first = True; - } - -#ifdef XTHREADS_DEBUG - printf("_XReply called in thread %x, adding %x to cvl\n", - XThread_Self(), cvl); -#endif - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XReply: Going to flush the display buffer.\n"); -#endif - _XFlushInt(dpy, cvl ? cvl->cv : NULL); - /* if it is not our turn to read a reply off the wire, - * wait til we're at head of list. if there is an event waiter, - * and our reply hasn't been read, they'll be in select and will - * hand control back to us next. - */ - if(dpy->lock && - (dpy->lock->reply_awaiters != cvl || !dpy->lock->reply_first)) { - ConditionWait(dpy, cvl->cv); - } - dpy->flags |= XlibDisplayReply; -#else /* XTHREADS else */ - _XFlush(dpy); -#endif - -#ifdef NX_TRANS_SOCKET - /* - * We are going to block waiting for the remote - * X server. Be sure that the proxy has flushed - * all the data. - */ - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_XReply: Requesting a flush of the NX transport.\n"); -#endif - - NXTransFlush(dpy->fd); -#endif - - for (;;) { -#ifdef XTHREADS - /* Did another thread's _XReadEvents get our reply by accident? */ - if (!dpy->lock || !dpy->lock->reply_was_read) -#endif - (void) _XRead(dpy, (char *)rep, (long)SIZEOF(xReply)); -#ifdef XTHREADS - if (dpy->lock) - dpy->lock->reply_was_read = False; -#endif - - switch ((int)rep->generic.type) { - - case X_Reply: - /* Reply received. Fast update for synchronous replies, - * but deal with multiple outstanding replies. - */ - if (rep->generic.sequenceNumber == (cur_request & 0xffff)) - dpy->last_request_read = cur_request; - else { - int pend = SIZEOF(xReply); - if (_XAsyncReply(dpy, rep, (char *)rep, &pend, False) - != (char *)rep) - continue; - } - if (extra <= rep->generic.length) { - if (extra > 0) - /* - * Read the extra data into storage immediately - * following the GenericReply structure. - */ - (void) _XRead (dpy, (char *) (NEXTPTR(rep,xReply)), - ((long)extra) << 2); - if (discard) { - if (extra < rep->generic.length) - _XEatData(dpy, (rep->generic.length - extra) << 2); - } -#ifdef XTHREADS - if (dpy->lock) { - if (discard) { - dpy->lock->reply_bytes_left = 0; - } else { - dpy->lock->reply_bytes_left = - (rep->generic.length - extra) << 2; - } - if (dpy->lock->reply_bytes_left == 0) { - dpy->flags &= ~XlibDisplayReply; - UnlockNextReplyReader(dpy); - } - } else - dpy->flags &= ~XlibDisplayReply; -#endif - return 1; - } - /* - *if we get here, then extra > rep->generic.length--meaning we - * read a reply that's shorter than we expected. This is an - * error, but we still need to figure out how to handle it... - */ - (void) _XRead (dpy, (char *) (NEXTPTR(rep,xReply)), - ((long) rep->generic.length) << 2); - dpy->flags &= ~XlibDisplayReply; - UnlockNextReplyReader(dpy); -#ifdef NX_TRANS_SOCKET - /* - * The original code has provision - * for returning already. - */ -#endif - _XIOError (dpy); - return (0); - - case X_Error: - { - register _XExtension *ext; - register Bool ret = False; - int ret_code; - xError *err = (xError *) rep; - unsigned long serial; - - dpy->flags &= ~XlibDisplayReply; - serial = _XSetLastRequestRead(dpy, (xGenericReply *)rep); - if (serial == cur_request) - /* do not die on "no such font", "can't allocate", - "can't grab" failures */ - switch ((int)err->errorCode) { - case BadName: - switch (err->majorCode) { - case X_LookupColor: - case X_AllocNamedColor: - UnlockNextReplyReader(dpy); - return(0); - } - break; - case BadFont: - if (err->majorCode == X_QueryFont) { - UnlockNextReplyReader(dpy); - return (0); - } - break; - case BadAlloc: - case BadAccess: - UnlockNextReplyReader(dpy); - return (0); - } - /* - * we better see if there is an extension who may - * want to suppress the error. - */ - for (ext = dpy->ext_procs; !ret && ext; ext = ext->next) { - if (ext->error) - ret = (*ext->error)(dpy, err, &ext->codes, &ret_code); - } - if (!ret) { - _XError(dpy, err); - ret_code = 0; - } - if (serial == cur_request) { - UnlockNextReplyReader(dpy); - return(ret_code); - } - - } /* case X_Error */ - break; - default: - _XEnq(dpy, (xEvent *) rep); -#ifdef XTHREADS - if (dpy->lock && dpy->lock->event_awaiters) - ConditionSignal(dpy, dpy->lock->event_awaiters->cv); -#endif - break; - } -#ifdef NX_TRANS_SOCKET - if (_XGetIOError(dpy)) { - UnlockNextReplyReader(dpy); - return 0; - } -#endif - } -} - -static char * -_XAsyncReply( - Display *dpy, - register xReply *rep, - char *buf, - register int *lenp, - Bool discard) -{ - register _XAsyncHandler *async, *next; - register int len; - register Bool consumed = False; - char *nbuf; - - (void) _XSetLastRequestRead(dpy, &rep->generic); - len = SIZEOF(xReply) + (rep->generic.length << 2); - if (len < SIZEOF(xReply)) { -#ifdef NX_TRANS_SOCKET - - /* - * The original code has provision - * for returning already. - */ - -#endif - _XIOError (dpy); - buf += *lenp; - *lenp = 0; - return buf; - } - - for (async = dpy->async_handlers; async; async = next) { - next = async->next; - if ((consumed = (*async->handler)(dpy, rep, buf, *lenp, async->data))) - break; - } - if (!consumed) { - if (!discard) - return buf; - (void) fprintf(stderr, - "Xlib: unexpected async reply (sequence 0x%lx)!\n", - dpy->last_request_read); -#ifdef XTHREADS -#ifdef XTHREADS_DEBUG - printf("thread %x, unexpected async reply\n", XThread_Self()); -#endif -#endif - if (len > *lenp) - _XEatData(dpy, len - *lenp); - } - if (len < SIZEOF(xReply)) - { -#ifdef NX_TRANS_SOCKET - - /* - * The original code has provision - * for returning already. - */ - -#endif - _XIOError (dpy); - buf += *lenp; - *lenp = 0; - return buf; - } - if (len >= *lenp) { - buf += *lenp; - *lenp = 0; - return buf; - } - *lenp -= len; - buf += len; - len = *lenp; - nbuf = buf; - while (len > SIZEOF(xReply)) { - if (*buf == X_Reply) - return nbuf; - buf += SIZEOF(xReply); - len -= SIZEOF(xReply); - } - if (len > 0 && len < SIZEOF(xReply)) { - buf = nbuf; - len = SIZEOF(xReply) - len; - nbuf -= len; - memmove(nbuf, buf, *lenp); - (void) _XRead(dpy, nbuf + *lenp, (long)len); - *lenp += len; - } - return nbuf; -} - -/* - * Support for internal connections, such as an IM might use. - * By Stephen Gildea, X Consortium, September 1993 - */ - -/* _XRegisterInternalConnection - * Each IM (or Xlib extension) that opens a file descriptor that Xlib should - * include in its select/poll mask must call this function to register the - * fd with Xlib. Any XConnectionWatchProc registered by XAddConnectionWatch - * will also be called. - * - * Whenever Xlib detects input available on fd, it will call callback - * with call_data to process it. If non-Xlib code calls select/poll - * and detects input available, it must call XProcessInternalConnection, - * which will call the associated callback. - * - * Non-Xlib code can learn about these additional fds by calling - * XInternalConnectionNumbers or, more typically, by registering - * a XConnectionWatchProc with XAddConnectionWatch - * to be called when fds are registered or unregistered. - * - * Returns True if registration succeeded, False if not, typically - * because could not allocate memory. - * Assumes Display locked when called. - */ -Status -_XRegisterInternalConnection( - Display* dpy, - int fd, - _XInternalConnectionProc callback, - XPointer call_data -) -{ - struct _XConnectionInfo *new_conni, **iptr; - struct _XConnWatchInfo *watchers; - XPointer *wd; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XRegisterInternalConnection: Got called.\n"); -#endif - - new_conni = (struct _XConnectionInfo*)Xmalloc(sizeof(struct _XConnectionInfo)); - if (!new_conni) - return 0; - new_conni->watch_data = (XPointer *)Xmalloc(dpy->watcher_count * sizeof(XPointer)); - if (!new_conni->watch_data) { - Xfree(new_conni); - return 0; - } - new_conni->fd = fd; - new_conni->read_callback = callback; - new_conni->call_data = call_data; - new_conni->next = NULL; - /* link new structure onto end of list */ - for (iptr = &dpy->im_fd_info; *iptr; iptr = &(*iptr)->next) - ; - *iptr = new_conni; - dpy->im_fd_length++; - _XPollfdCacheAdd(dpy, fd); - - for (watchers=dpy->conn_watchers, wd=new_conni->watch_data; - watchers; - watchers=watchers->next, wd++) { - *wd = NULL; /* for cleanliness */ - (*watchers->fn) (dpy, watchers->client_data, fd, True, wd); - } - - return 1; -} - -/* _XUnregisterInternalConnection - * Each IM (or Xlib extension) that closes a file descriptor previously - * registered with _XRegisterInternalConnection must call this function. - * Any XConnectionWatchProc registered by XAddConnectionWatch - * will also be called. - * - * Assumes Display locked when called. - */ -void -_XUnregisterInternalConnection( - Display* dpy, - int fd -) -{ - struct _XConnectionInfo *info_list, **prev; - struct _XConnWatchInfo *watch; - XPointer *wd; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XUnregisterInternalConnection: Got called.\n"); -#endif - - for (prev = &dpy->im_fd_info; (info_list = *prev); - prev = &info_list->next) { - if (info_list->fd == fd) { - *prev = info_list->next; - dpy->im_fd_length--; - for (watch=dpy->conn_watchers, wd=info_list->watch_data; - watch; - watch=watch->next, wd++) { - (*watch->fn) (dpy, watch->client_data, fd, False, wd); - } - if (info_list->watch_data) - Xfree (info_list->watch_data); - Xfree (info_list); - break; - } - } - _XPollfdCacheDel(dpy, fd); -} - -/* XInternalConnectionNumbers - * Returns an array of fds and an array of corresponding call data. - * Typically a XConnectionWatchProc registered with XAddConnectionWatch - * will be used instead of this function to discover - * additional fds to include in the select/poll mask. - * - * The list is allocated with Xmalloc and should be freed by the caller - * with Xfree; - */ -Status -XInternalConnectionNumbers( - Display *dpy, - int **fd_return, - int *count_return -) -{ - int count; - struct _XConnectionInfo *info_list; - int *fd_list; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "XInternalConnectionNumbers: Got called.\n"); -#endif - - LockDisplay(dpy); - count = 0; - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) - count++; - fd_list = (int*) Xmalloc (count * sizeof(int)); - if (!fd_list) { - UnlockDisplay(dpy); - return 0; - } - count = 0; - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) { - fd_list[count] = info_list->fd; - count++; - } - UnlockDisplay(dpy); - - *fd_return = fd_list; - *count_return = count; - return 1; -} - -static void _XProcessInternalConnection( - Display *dpy, - struct _XConnectionInfo *conn_info) -{ - dpy->flags |= XlibDisplayProcConni; -#ifdef XTHREADS - if (dpy->lock) { - /* check cache to avoid call to thread_self */ - if (xthread_have_id(dpy->lock->reading_thread)) - dpy->lock->conni_thread = dpy->lock->reading_thread; - else - dpy->lock->conni_thread = XThread_Self(); - } -#endif /* XTHREADS */ - UnlockDisplay(dpy); - (*conn_info->read_callback) (dpy, conn_info->fd, conn_info->call_data); - LockDisplay(dpy); -#ifdef XTHREADS - if (dpy->lock) - xthread_clear_id(dpy->lock->conni_thread); -#endif /* XTHREADS */ - dpy->flags &= ~XlibDisplayProcConni; -} - -/* XProcessInternalConnection - * Call the _XInternalConnectionProc registered by _XRegisterInternalConnection - * for this fd. - * The Display is NOT locked during the call. - */ -void -XProcessInternalConnection( - Display* dpy, - int fd -) -{ - struct _XConnectionInfo *info_list; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "XProcessInternalConnection: Got called.\n"); -#endif - - LockDisplay(dpy); - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) { - if (info_list->fd == fd) { - _XProcessInternalConnection(dpy, info_list); - break; - } - } - UnlockDisplay(dpy); -} - -/* XAddConnectionWatch - * Register a callback to be called whenever _XRegisterInternalConnection - * or _XUnregisterInternalConnection is called. - * Callbacks are called with the Display locked. - * If any connections are already registered, the callback is immediately - * called for each of them. - */ -Status -XAddConnectionWatch( - Display* dpy, - XConnectionWatchProc callback, - XPointer client_data -) -{ - struct _XConnWatchInfo *new_watcher, **wptr; - struct _XConnectionInfo *info_list; - XPointer *wd_array; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "XAddConnectionWatch: Got called.\n"); -#endif - - LockDisplay(dpy); - - /* allocate new watch data */ - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) { - wd_array = (XPointer *)Xrealloc((char *)info_list->watch_data, - (dpy->watcher_count + 1) * - sizeof(XPointer)); - if (!wd_array) { - UnlockDisplay(dpy); - return 0; - } - wd_array[dpy->watcher_count] = NULL; /* for cleanliness */ - } - - new_watcher = (struct _XConnWatchInfo*)Xmalloc(sizeof(struct _XConnWatchInfo)); - if (!new_watcher) { - UnlockDisplay(dpy); - return 0; - } - new_watcher->fn = callback; - new_watcher->client_data = client_data; - new_watcher->next = NULL; - - /* link new structure onto end of list */ - for (wptr = &dpy->conn_watchers; *wptr; wptr = &(*wptr)->next) - ; - *wptr = new_watcher; - dpy->watcher_count++; - - /* call new watcher on all currently registered fds */ - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) { - (*callback) (dpy, client_data, info_list->fd, True, - info_list->watch_data + dpy->watcher_count - 1); - } - - UnlockDisplay(dpy); - return 1; -} - -/* XRemoveConnectionWatch - * Unregister a callback registered by XAddConnectionWatch. - * Both callback and client_data must match what was passed to - * XAddConnectionWatch. - */ -void -XRemoveConnectionWatch( - Display* dpy, - XConnectionWatchProc callback, - XPointer client_data -) -{ - struct _XConnWatchInfo *watch; - struct _XConnWatchInfo *previous = NULL; - struct _XConnectionInfo *conni; - int counter = 0; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "XRemoveConnectionWatch: Got called.\n"); -#endif - - LockDisplay(dpy); - for (watch=dpy->conn_watchers; watch; watch=watch->next) { - if (watch->fn == callback && watch->client_data == client_data) { - if (previous) - previous->next = watch->next; - else - dpy->conn_watchers = watch->next; - Xfree (watch); - dpy->watcher_count--; - /* remove our watch_data for each connection */ - for (conni=dpy->im_fd_info; conni; conni=conni->next) { - /* don't bother realloc'ing; these arrays are small anyway */ - /* overlapping */ - memmove(conni->watch_data+counter, - conni->watch_data+counter+1, - dpy->watcher_count - counter); - } - break; - } - previous = watch; - counter++; - } - UnlockDisplay(dpy); -} - -/* end of internal connections support */ - - -/* Read and discard "n" 8-bit bytes of data */ - -void _XEatData( - Display *dpy, - register unsigned long n) -{ -#define SCRATCHSIZE 2048 - char buf[SCRATCHSIZE]; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "_XEatData: Going to eat [%ld] bytes of data from descriptor [%d].\n", - n, dpy->fd); -#endif - while (n > 0) { - register long bytes_read = (n > SCRATCHSIZE) ? SCRATCHSIZE : n; - (void) _XRead (dpy, buf, bytes_read); - n -= bytes_read; - } -#undef SCRATCHSIZE -} - - -/* - * _XEnq - Place event packets on the display's queue. - * note that no squishing of move events in V11, since there - * is pointer motion hints.... - */ -void _XEnq( - register Display *dpy, - register xEvent *event) -{ - register _XQEvent *qelt; - - if ((qelt = dpy->qfree)) { - /* If dpy->qfree is non-NULL do this, else malloc a new one. */ - dpy->qfree = qelt->next; - } - else if ((qelt = - (_XQEvent *) Xmalloc((unsigned)sizeof(_XQEvent))) == NULL) { - /* Malloc call failed! */ - ESET(ENOMEM); -#ifdef NX_TRANS_SOCKET - _XIOError(dpy); - - return; -#else - _XIOError(dpy); -#endif - } - qelt->next = NULL; - /* go call through display to find proper event reformatter */ - if ((*dpy->event_vec[event->u.u.type & 0177])(dpy, &qelt->event, event)) { - qelt->qserial_num = dpy->next_event_serial_num++; - if (dpy->tail) dpy->tail->next = qelt; - else dpy->head = qelt; - - dpy->tail = qelt; - dpy->qlen++; - } else { - /* ignored, or stashed away for many-to-one compression */ - qelt->next = dpy->qfree; - dpy->qfree = qelt; - } -} - -/* - * _XDeq - Remove event packet from the display's queue. - */ -void _XDeq( - register Display *dpy, - register _XQEvent *prev, /* element before qelt */ - register _XQEvent *qelt) /* element to be unlinked */ -{ - if (prev) { - if ((prev->next = qelt->next) == NULL) - dpy->tail = prev; - } else { - /* no prev, so removing first elt */ - if ((dpy->head = qelt->next) == NULL) - dpy->tail = NULL; - } - qelt->qserial_num = 0; - qelt->next = dpy->qfree; - dpy->qfree = qelt; - dpy->qlen--; -} - -/* - * EventToWire in separate file in that often not needed. - */ - -/*ARGSUSED*/ -Bool -_XUnknownWireEvent( - register Display *dpy, /* pointer to display structure */ - register XEvent *re, /* pointer to where event should be reformatted */ - register xEvent *event) /* wire protocol event */ -{ -#ifdef notdef - (void) fprintf(stderr, - "Xlib: unhandled wire event! event number = %d, display = %x\n.", - event->u.u.type, dpy); -#endif - return(False); -} - -/*ARGSUSED*/ -Status -_XUnknownNativeEvent( - register Display *dpy, /* pointer to display structure */ - register XEvent *re, /* pointer to where event should be reformatted */ - register xEvent *event) /* wire protocol event */ -{ -#ifdef notdef - (void) fprintf(stderr, - "Xlib: unhandled native event! event number = %d, display = %x\n.", - re->type, dpy); -#endif - return(0); -} -/* - * reformat a wire event into an XEvent structure of the right type. - */ -Bool -_XWireToEvent( - register Display *dpy, /* pointer to display structure */ - register XEvent *re, /* pointer to where event should be reformatted */ - register xEvent *event) /* wire protocol event */ -{ - - re->type = event->u.u.type & 0x7f; - ((XAnyEvent *)re)->serial = _XSetLastRequestRead(dpy, - (xGenericReply *)event); - ((XAnyEvent *)re)->send_event = ((event->u.u.type & 0x80) != 0); - ((XAnyEvent *)re)->display = dpy; - - /* Ignore the leading bit of the event type since it is set when a - client sends an event rather than the server. */ - - switch (event-> u.u.type & 0177) { - case KeyPress: - case KeyRelease: - { - register XKeyEvent *ev = (XKeyEvent*) re; - ev->root = event->u.keyButtonPointer.root; - ev->window = event->u.keyButtonPointer.event; - ev->subwindow = event->u.keyButtonPointer.child; - ev->time = event->u.keyButtonPointer.time; - ev->x = cvtINT16toInt(event->u.keyButtonPointer.eventX); - ev->y = cvtINT16toInt(event->u.keyButtonPointer.eventY); - ev->x_root = cvtINT16toInt(event->u.keyButtonPointer.rootX); - ev->y_root = cvtINT16toInt(event->u.keyButtonPointer.rootY); - ev->state = event->u.keyButtonPointer.state; - ev->same_screen = event->u.keyButtonPointer.sameScreen; - ev->keycode = event->u.u.detail; - } - break; - case ButtonPress: - case ButtonRelease: - { - register XButtonEvent *ev = (XButtonEvent *) re; - ev->root = event->u.keyButtonPointer.root; - ev->window = event->u.keyButtonPointer.event; - ev->subwindow = event->u.keyButtonPointer.child; - ev->time = event->u.keyButtonPointer.time; - ev->x = cvtINT16toInt(event->u.keyButtonPointer.eventX); - ev->y = cvtINT16toInt(event->u.keyButtonPointer.eventY); - ev->x_root = cvtINT16toInt(event->u.keyButtonPointer.rootX); - ev->y_root = cvtINT16toInt(event->u.keyButtonPointer.rootY); - ev->state = event->u.keyButtonPointer.state; - ev->same_screen = event->u.keyButtonPointer.sameScreen; - ev->button = event->u.u.detail; - } - break; - case MotionNotify: - { - register XMotionEvent *ev = (XMotionEvent *)re; - ev->root = event->u.keyButtonPointer.root; - ev->window = event->u.keyButtonPointer.event; - ev->subwindow = event->u.keyButtonPointer.child; - ev->time = event->u.keyButtonPointer.time; - ev->x = cvtINT16toInt(event->u.keyButtonPointer.eventX); - ev->y = cvtINT16toInt(event->u.keyButtonPointer.eventY); - ev->x_root = cvtINT16toInt(event->u.keyButtonPointer.rootX); - ev->y_root = cvtINT16toInt(event->u.keyButtonPointer.rootY); - ev->state = event->u.keyButtonPointer.state; - ev->same_screen = event->u.keyButtonPointer.sameScreen; - ev->is_hint = event->u.u.detail; - } - break; - case EnterNotify: - case LeaveNotify: - { - register XCrossingEvent *ev = (XCrossingEvent *) re; - ev->root = event->u.enterLeave.root; - ev->window = event->u.enterLeave.event; - ev->subwindow = event->u.enterLeave.child; - ev->time = event->u.enterLeave.time; - ev->x = cvtINT16toInt(event->u.enterLeave.eventX); - ev->y = cvtINT16toInt(event->u.enterLeave.eventY); - ev->x_root = cvtINT16toInt(event->u.enterLeave.rootX); - ev->y_root = cvtINT16toInt(event->u.enterLeave.rootY); - ev->state = event->u.enterLeave.state; - ev->mode = event->u.enterLeave.mode; - ev->same_screen = (event->u.enterLeave.flags & - ELFlagSameScreen) && True; - ev->focus = (event->u.enterLeave.flags & - ELFlagFocus) && True; - ev->detail = event->u.u.detail; - } - break; - case FocusIn: - case FocusOut: - { - register XFocusChangeEvent *ev = (XFocusChangeEvent *) re; - ev->window = event->u.focus.window; - ev->mode = event->u.focus.mode; - ev->detail = event->u.u.detail; - } - break; - case KeymapNotify: - { - register XKeymapEvent *ev = (XKeymapEvent *) re; - ev->window = None; - memcpy(&ev->key_vector[1], - (char *)((xKeymapEvent *) event)->map, - sizeof (((xKeymapEvent *) event)->map)); - } - break; - case Expose: - { - register XExposeEvent *ev = (XExposeEvent *) re; - ev->window = event->u.expose.window; - ev->x = event->u.expose.x; - ev->y = event->u.expose.y; - ev->width = event->u.expose.width; - ev->height = event->u.expose.height; - ev->count = event->u.expose.count; - } - break; - case GraphicsExpose: - { - register XGraphicsExposeEvent *ev = - (XGraphicsExposeEvent *) re; - ev->drawable = event->u.graphicsExposure.drawable; - ev->x = event->u.graphicsExposure.x; - ev->y = event->u.graphicsExposure.y; - ev->width = event->u.graphicsExposure.width; - ev->height = event->u.graphicsExposure.height; - ev->count = event->u.graphicsExposure.count; - ev->major_code = event->u.graphicsExposure.majorEvent; - ev->minor_code = event->u.graphicsExposure.minorEvent; - } - break; - case NoExpose: - { - register XNoExposeEvent *ev = (XNoExposeEvent *) re; - ev->drawable = event->u.noExposure.drawable; - ev->major_code = event->u.noExposure.majorEvent; - ev->minor_code = event->u.noExposure.minorEvent; - } - break; - case VisibilityNotify: - { - register XVisibilityEvent *ev = (XVisibilityEvent *) re; - ev->window = event->u.visibility.window; - ev->state = event->u.visibility.state; - } - break; - case CreateNotify: - { - register XCreateWindowEvent *ev = - (XCreateWindowEvent *) re; - ev->window = event->u.createNotify.window; - ev->parent = event->u.createNotify.parent; - ev->x = cvtINT16toInt(event->u.createNotify.x); - ev->y = cvtINT16toInt(event->u.createNotify.y); - ev->width = event->u.createNotify.width; - ev->height = event->u.createNotify.height; - ev->border_width = event->u.createNotify.borderWidth; - ev->override_redirect = event->u.createNotify.override; - } - break; - case DestroyNotify: - { - register XDestroyWindowEvent *ev = - (XDestroyWindowEvent *) re; - ev->window = event->u.destroyNotify.window; - ev->event = event->u.destroyNotify.event; - } - break; - case UnmapNotify: - { - register XUnmapEvent *ev = (XUnmapEvent *) re; - ev->window = event->u.unmapNotify.window; - ev->event = event->u.unmapNotify.event; - ev->from_configure = event->u.unmapNotify.fromConfigure; - } - break; - case MapNotify: - { - register XMapEvent *ev = (XMapEvent *) re; - ev->window = event->u.mapNotify.window; - ev->event = event->u.mapNotify.event; - ev->override_redirect = event->u.mapNotify.override; - } - break; - case MapRequest: - { - register XMapRequestEvent *ev = (XMapRequestEvent *) re; - ev->window = event->u.mapRequest.window; - ev->parent = event->u.mapRequest.parent; - } - break; - case ReparentNotify: - { - register XReparentEvent *ev = (XReparentEvent *) re; - ev->event = event->u.reparent.event; - ev->window = event->u.reparent.window; - ev->parent = event->u.reparent.parent; - ev->x = cvtINT16toInt(event->u.reparent.x); - ev->y = cvtINT16toInt(event->u.reparent.y); - ev->override_redirect = event->u.reparent.override; - } - break; - case ConfigureNotify: - { - register XConfigureEvent *ev = (XConfigureEvent *) re; - ev->event = event->u.configureNotify.event; - ev->window = event->u.configureNotify.window; - ev->above = event->u.configureNotify.aboveSibling; - ev->x = cvtINT16toInt(event->u.configureNotify.x); - ev->y = cvtINT16toInt(event->u.configureNotify.y); - ev->width = event->u.configureNotify.width; - ev->height = event->u.configureNotify.height; - ev->border_width = event->u.configureNotify.borderWidth; - ev->override_redirect = event->u.configureNotify.override; - } - break; - case ConfigureRequest: - { - register XConfigureRequestEvent *ev = - (XConfigureRequestEvent *) re; - ev->window = event->u.configureRequest.window; - ev->parent = event->u.configureRequest.parent; - ev->above = event->u.configureRequest.sibling; - ev->x = cvtINT16toInt(event->u.configureRequest.x); - ev->y = cvtINT16toInt(event->u.configureRequest.y); - ev->width = event->u.configureRequest.width; - ev->height = event->u.configureRequest.height; - ev->border_width = event->u.configureRequest.borderWidth; - ev->value_mask = event->u.configureRequest.valueMask; - ev->detail = event->u.u.detail; - } - break; - case GravityNotify: - { - register XGravityEvent *ev = (XGravityEvent *) re; - ev->window = event->u.gravity.window; - ev->event = event->u.gravity.event; - ev->x = cvtINT16toInt(event->u.gravity.x); - ev->y = cvtINT16toInt(event->u.gravity.y); - } - break; - case ResizeRequest: - { - register XResizeRequestEvent *ev = - (XResizeRequestEvent *) re; - ev->window = event->u.resizeRequest.window; - ev->width = event->u.resizeRequest.width; - ev->height = event->u.resizeRequest.height; - } - break; - case CirculateNotify: - { - register XCirculateEvent *ev = (XCirculateEvent *) re; - ev->window = event->u.circulate.window; - ev->event = event->u.circulate.event; - ev->place = event->u.circulate.place; - } - break; - case CirculateRequest: - { - register XCirculateRequestEvent *ev = - (XCirculateRequestEvent *) re; - ev->window = event->u.circulate.window; - ev->parent = event->u.circulate.event; - ev->place = event->u.circulate.place; - } - break; - case PropertyNotify: - { - register XPropertyEvent *ev = (XPropertyEvent *) re; - ev->window = event->u.property.window; - ev->atom = event->u.property.atom; - ev->time = event->u.property.time; - ev->state = event->u.property.state; - } - break; - case SelectionClear: - { - register XSelectionClearEvent *ev = - (XSelectionClearEvent *) re; - ev->window = event->u.selectionClear.window; - ev->selection = event->u.selectionClear.atom; - ev->time = event->u.selectionClear.time; - } - break; - case SelectionRequest: - { - register XSelectionRequestEvent *ev = - (XSelectionRequestEvent *) re; - ev->owner = event->u.selectionRequest.owner; - ev->requestor = event->u.selectionRequest.requestor; - ev->selection = event->u.selectionRequest.selection; - ev->target = event->u.selectionRequest.target; - ev->property = event->u.selectionRequest.property; - ev->time = event->u.selectionRequest.time; - } - break; - case SelectionNotify: - { - register XSelectionEvent *ev = (XSelectionEvent *) re; - ev->requestor = event->u.selectionNotify.requestor; - ev->selection = event->u.selectionNotify.selection; - ev->target = event->u.selectionNotify.target; - ev->property = event->u.selectionNotify.property; - ev->time = event->u.selectionNotify.time; - } - break; - case ColormapNotify: - { - register XColormapEvent *ev = (XColormapEvent *) re; - ev->window = event->u.colormap.window; - ev->colormap = event->u.colormap.colormap; - ev->new = event->u.colormap.new; - ev->state = event->u.colormap.state; - } - break; - case ClientMessage: - { - register int i; - register XClientMessageEvent *ev - = (XClientMessageEvent *) re; - ev->window = event->u.clientMessage.window; - ev->format = event->u.u.detail; - switch (ev->format) { - case 8: - ev->message_type = event->u.clientMessage.u.b.type; - for (i = 0; i < 20; i++) - ev->data.b[i] = event->u.clientMessage.u.b.bytes[i]; - break; - case 16: - ev->message_type = event->u.clientMessage.u.s.type; - ev->data.s[0] = cvtINT16toShort(event->u.clientMessage.u.s.shorts0); - ev->data.s[1] = cvtINT16toShort(event->u.clientMessage.u.s.shorts1); - ev->data.s[2] = cvtINT16toShort(event->u.clientMessage.u.s.shorts2); - ev->data.s[3] = cvtINT16toShort(event->u.clientMessage.u.s.shorts3); - ev->data.s[4] = cvtINT16toShort(event->u.clientMessage.u.s.shorts4); - ev->data.s[5] = cvtINT16toShort(event->u.clientMessage.u.s.shorts5); - ev->data.s[6] = cvtINT16toShort(event->u.clientMessage.u.s.shorts6); - ev->data.s[7] = cvtINT16toShort(event->u.clientMessage.u.s.shorts7); - ev->data.s[8] = cvtINT16toShort(event->u.clientMessage.u.s.shorts8); - ev->data.s[9] = cvtINT16toShort(event->u.clientMessage.u.s.shorts9); - break; - case 32: - ev->message_type = event->u.clientMessage.u.l.type; - ev->data.l[0] = cvtINT32toLong(event->u.clientMessage.u.l.longs0); - ev->data.l[1] = cvtINT32toLong(event->u.clientMessage.u.l.longs1); - ev->data.l[2] = cvtINT32toLong(event->u.clientMessage.u.l.longs2); - ev->data.l[3] = cvtINT32toLong(event->u.clientMessage.u.l.longs3); - ev->data.l[4] = cvtINT32toLong(event->u.clientMessage.u.l.longs4); - break; - default: /* XXX should never occur */ - break; - } - } - break; - case MappingNotify: - { - register XMappingEvent *ev = (XMappingEvent *)re; - ev->window = 0; - ev->first_keycode = event->u.mappingNotify.firstKeyCode; - ev->request = event->u.mappingNotify.request; - ev->count = event->u.mappingNotify.count; - } - break; - default: - return(_XUnknownWireEvent(dpy, re, event)); - } - return(True); -} - - -/* - * _XDefaultIOError - Default fatal system error reporting routine. Called - * when an X internal system error is encountered. - */ -int _XDefaultIOError( - Display *dpy) -{ - if (ECHECK(EPIPE)) { - (void) fprintf (stderr, - "X connection to %s broken (explicit kill or server shutdown).\r\n", - DisplayString (dpy)); - } else { - (void) fprintf (stderr, - "XIO: fatal IO error %d (%s) on X server \"%s\"\r\n", -#ifdef WIN32 - WSAGetLastError(), strerror(WSAGetLastError()), -#else - errno, strerror (errno), -#endif - DisplayString (dpy)); - (void) fprintf (stderr, - " after %lu requests (%lu known processed) with %d events remaining.\r\n", - NextRequest(dpy) - 1, LastKnownRequestProcessed(dpy), - QLength(dpy)); - - } -#ifdef NX_TRANS_SOCKET - if (_NXHandleDisplayError == 1) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_XDefaultIOError: Going to return from the error handler.\n"); -#endif - return 0; - } - else - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_XDefaultIOError: Going to exit from the program.\n"); -#endif -#ifdef NX_TRANS_EXIT - NXTransExit(1); -#else - exit(1); -#endif - } -#else - exit(1); -#endif /* #ifdef NX_TRANS_SOCKET */ - - return(0); /* dummy - function should never return */ -} - - -static int _XPrintDefaultError( - Display *dpy, - XErrorEvent *event, - FILE *fp) -{ - char buffer[BUFSIZ]; - char mesg[BUFSIZ]; - char number[32]; - char *mtype = "XlibMessage"; - register _XExtension *ext = (_XExtension *)NULL; - _XExtension *bext = (_XExtension *)NULL; - XGetErrorText(dpy, event->error_code, buffer, BUFSIZ); - XGetErrorDatabaseText(dpy, mtype, "XError", "X Error", mesg, BUFSIZ); - (void) fprintf(fp, "%s: %s\n ", mesg, buffer); - XGetErrorDatabaseText(dpy, mtype, "MajorCode", "Request Major code %d", - mesg, BUFSIZ); - (void) fprintf(fp, mesg, event->request_code); - if (event->request_code < 128) { - sprintf(number, "%d", event->request_code); - XGetErrorDatabaseText(dpy, "XRequest", number, "", buffer, BUFSIZ); - } else { - for (ext = dpy->ext_procs; - ext && (ext->codes.major_opcode != event->request_code); - ext = ext->next) - ; - if (ext) - strcpy(buffer, ext->name); - else - buffer[0] = '\0'; - } - (void) fprintf(fp, " (%s)\n", buffer); - if (event->request_code >= 128) { - XGetErrorDatabaseText(dpy, mtype, "MinorCode", "Request Minor code %d", - mesg, BUFSIZ); - fputs(" ", fp); - (void) fprintf(fp, mesg, event->minor_code); - if (ext) { - sprintf(mesg, "%s.%d", ext->name, event->minor_code); - XGetErrorDatabaseText(dpy, "XRequest", mesg, "", buffer, BUFSIZ); - (void) fprintf(fp, " (%s)", buffer); - } - fputs("\n", fp); - } - if (event->error_code >= 128) { - /* kludge, try to find the extension that caused it */ - buffer[0] = '\0'; - for (ext = dpy->ext_procs; ext; ext = ext->next) { - if (ext->error_string) - (*ext->error_string)(dpy, event->error_code, &ext->codes, - buffer, BUFSIZ); - if (buffer[0]) { - bext = ext; - break; - } - if (ext->codes.first_error && - ext->codes.first_error < (int)event->error_code && - (!bext || ext->codes.first_error > bext->codes.first_error)) - bext = ext; - } - if (bext) - sprintf(buffer, "%s.%d", bext->name, - event->error_code - bext->codes.first_error); - else - strcpy(buffer, "Value"); - XGetErrorDatabaseText(dpy, mtype, buffer, "", mesg, BUFSIZ); - if (mesg[0]) { - fputs(" ", fp); - (void) fprintf(fp, mesg, event->resourceid); - fputs("\n", fp); - } - /* let extensions try to print the values */ - for (ext = dpy->ext_procs; ext; ext = ext->next) { - if (ext->error_values) - (*ext->error_values)(dpy, event, fp); - } - } else if ((event->error_code == BadWindow) || - (event->error_code == BadPixmap) || - (event->error_code == BadCursor) || - (event->error_code == BadFont) || - (event->error_code == BadDrawable) || - (event->error_code == BadColor) || - (event->error_code == BadGC) || - (event->error_code == BadIDChoice) || - (event->error_code == BadValue) || - (event->error_code == BadAtom)) { - if (event->error_code == BadValue) - XGetErrorDatabaseText(dpy, mtype, "Value", "Value 0x%x", - mesg, BUFSIZ); - else if (event->error_code == BadAtom) - XGetErrorDatabaseText(dpy, mtype, "AtomID", "AtomID 0x%x", - mesg, BUFSIZ); - else - XGetErrorDatabaseText(dpy, mtype, "ResourceID", "ResourceID 0x%x", - mesg, BUFSIZ); - fputs(" ", fp); - (void) fprintf(fp, mesg, event->resourceid); - fputs("\n", fp); - } - XGetErrorDatabaseText(dpy, mtype, "ErrorSerial", "Error Serial #%d", - mesg, BUFSIZ); - fputs(" ", fp); - (void) fprintf(fp, mesg, event->serial); - XGetErrorDatabaseText(dpy, mtype, "CurrentSerial", "Current Serial #%d", - mesg, BUFSIZ); - fputs("\n ", fp); - (void) fprintf(fp, mesg, dpy->request); - fputs("\n", fp); - if (event->error_code == BadImplementation) return 0; - return 1; -} - -int _XDefaultError( - Display *dpy, - XErrorEvent *event) -{ - if (_XPrintDefaultError (dpy, event, stderr) == 0) return 0; - exit(1); - /*NOTREACHED*/ -} - -/*ARGSUSED*/ -Bool _XDefaultWireError(display, he, we) - Display *display; - XErrorEvent *he; - xError *we; -{ - return True; -} - -/* - * _XError - upcall internal or user protocol error handler - */ -int _XError ( - Display *dpy, - register xError *rep) -{ - /* - * X_Error packet encountered! We need to unpack the error before - * giving it to the user. - */ - XEvent event; /* make it a large event */ - register _XAsyncHandler *async, *next; - - event.xerror.serial = _XSetLastRequestRead(dpy, (xGenericReply *)rep); - - for (async = dpy->async_handlers; async; async = next) { - next = async->next; - if ((*async->handler)(dpy, (xReply *)rep, - (char *)rep, SIZEOF(xError), async->data)) - return 0; - } - - event.xerror.display = dpy; - event.xerror.type = X_Error; - event.xerror.resourceid = rep->resourceID; - event.xerror.error_code = rep->errorCode; - event.xerror.request_code = rep->majorCode; - event.xerror.minor_code = rep->minorCode; - if (dpy->error_vec && - !(*dpy->error_vec[rep->errorCode])(dpy, &event.xerror, rep)) - return 0; - if (_XErrorFunction != NULL) { - int rtn_val; -#ifdef XTHREADS - if (dpy->lock) - (*dpy->lock->user_lock_display)(dpy); - UnlockDisplay(dpy); -#endif /* XTHREADS */ - rtn_val = (*_XErrorFunction)(dpy, (XErrorEvent *)&event); /* upcall */ -#ifdef XTHREADS - LockDisplay(dpy); - if (dpy->lock) - (*dpy->lock->user_unlock_display)(dpy); -#endif /* XTHREADS */ - return rtn_val; - } else { - return _XDefaultError(dpy, (XErrorEvent *)&event); - } -} - -/* - * _XIOError - call user connection error handler and exit - */ -int -_XIOError ( - Display *dpy) -{ - dpy->flags |= XlibDisplayIOError; -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - - if (_XIOErrorFunction != NULL) - (*_XIOErrorFunction)(dpy); - else - _XDefaultIOError(dpy); -#ifdef NX_TRANS_SOCKET - /* - * Check if we are supposed to return in the case - * of a display failure. The client which originated - * the X operation will have to check the value of - * the XlibDisplayIOError flag and handle appropria- - * tely the display disconnection. - */ - - if (_NXHandleDisplayError == 0) - { -#ifdef NX_TRANS_EXIT - NXTransExit(1); -#else - exit(1); -#endif - } - - /* - * We are going to return. Reset the display - * buffers. Further writes will be discarded. - */ - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_XIOError: Resetting the display buffer.\n"); -#endif - - dpy->bufptr = dpy->buffer; - dpy->last_req = (char *) &_dummy_request; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_XIOError: Resetting the display flags.\n"); -#endif - - dpy->flags &= ~XlibDisplayProcConni; - dpy->flags &= ~XlibDisplayPrivSync; - dpy->flags &= ~XlibDisplayReadEvents; - dpy->flags &= ~XlibDisplayWriting; - dpy->flags &= ~XlibDisplayReply; -#else - exit (1); -#endif - return 0; -} - - -/* - * This routine can be used to (cheaply) get some memory within a single - * Xlib routine for scratch space. A single buffer is reused each time - * if possible. To be MT safe, you can only call this between a call to - * GetReq* and a call to Data* or _XSend*, or in a context when the thread - * is guaranteed to not unlock the display. - */ -char *_XAllocScratch( - register Display *dpy, - unsigned long nbytes) -{ - if (nbytes > dpy->scratch_length) { - if (dpy->scratch_buffer) Xfree (dpy->scratch_buffer); - if ((dpy->scratch_buffer = Xmalloc((unsigned) nbytes))) - dpy->scratch_length = nbytes; - else dpy->scratch_length = 0; - } - return (dpy->scratch_buffer); -} - -/* - * Scratch space allocator you can call any time, multiple times, and be - * MT safe, but you must hand the buffer back with _XFreeTemp. - */ -char *_XAllocTemp( - register Display *dpy, - unsigned long nbytes) -{ - char *buf; - - buf = _XAllocScratch(dpy, nbytes); - dpy->scratch_buffer = NULL; - dpy->scratch_length = 0; - return buf; -} - -void _XFreeTemp( - register Display *dpy, - char *buf, - unsigned long nbytes) -{ - if (dpy->scratch_buffer) - Xfree(dpy->scratch_buffer); - dpy->scratch_buffer = buf; - dpy->scratch_length = nbytes; -} - -/* - * Given a visual id, find the visual structure for this id on this display. - */ -Visual *_XVIDtoVisual( - Display *dpy, - VisualID id) -{ - register int i, j, k; - register Screen *sp; - register Depth *dp; - register Visual *vp; - for (i = 0; i < dpy->nscreens; i++) { - sp = &dpy->screens[i]; - for (j = 0; j < sp->ndepths; j++) { - dp = &sp->depths[j]; - /* if nvisuals == 0 then visuals will be NULL */ - for (k = 0; k < dp->nvisuals; k++) { - vp = &dp->visuals[k]; - if (vp->visualid == id) return (vp); - } - } - } - return (NULL); -} - -int -XFree (void *data) -{ - Xfree (data); - return 1; -} - -#ifdef _XNEEDBCOPYFUNC -void _Xbcopy(b1, b2, length) - register char *b1, *b2; - register length; -{ - if (b1 < b2) { - b2 += length; - b1 += length; - while (length--) - *--b2 = *--b1; - } else { - while (length--) - *b2++ = *b1++; - } -} -#endif - -#ifdef DataRoutineIsProcedure -void Data( - Display *dpy, - char *data, - long len) -{ - if (dpy->bufptr + (len) <= dpy->bufmax) { - memcpy(dpy->bufptr, data, (int)len); - dpy->bufptr += ((len) + 3) & ~3; - } else { - _XSend(dpy, data, len); - } -} -#endif /* DataRoutineIsProcedure */ - - -#ifdef LONG64 -int -_XData32( - Display *dpy, - register long *data, - unsigned len) -{ - register int *buf; - register long i; - - while (len) { - buf = (int *)dpy->bufptr; - i = dpy->bufmax - (char *)buf; - if (!i) { - _XFlush(dpy); - continue; - } - if (len < i) - i = len; - dpy->bufptr = (char *)buf + i; - len -= i; - i >>= 2; - while (--i >= 0) - *buf++ = *data++; - } - return 0; -} -#endif /* LONG64 */ - -#ifdef WORD64 - -/* - * XXX This is a *really* stupid way of doing this. It should just use - * dpy->bufptr directly, taking into account where in the word it is. - */ - -/* - * Data16 - Place 16 bit data in the buffer. - * - * "dpy" is a pointer to a Display. - * "data" is a pointer to the data. - * "len" is the length in bytes of the data. - */ - -static doData16( - register Display *dpy, - short *data, - unsigned len, - char *packbuffer) -{ - long *lp,*lpack; - long i, nwords,bits; - long mask16 = 0x000000000000ffff; - - lp = (long *)data; - lpack = (long *)packbuffer; - -/* nwords is the number of 16 bit values to be packed, - * the low order 16 bits of each word will be packed - * into 64 bit words - */ - nwords = len >> 1; - bits = 48; - - for(i=0;i> 1; - - for (; len > PACKBUFFERSIZE; len -= PACKBUFFERSIZE, data += nunits) { - doData16 (dpy, data, PACKBUFFERSIZE, packbuffer); - } - if (len) doData16 (dpy, data, len, packbuffer); -} - -/* - * Data32 - Place 32 bit data in the buffer. - * - * "dpy" is a pointer to a Display. - * "data" is a pointer to the data. - * "len" is the length in bytes of the data. - */ - -static doData32( - register Display *dpy - long *data, - unsigned len, - char *packbuffer) -{ - long *lp,*lpack; - long i,bits,nwords; - long mask32 = 0x00000000ffffffff; - - lpack = (long *) packbuffer; - lp = data; - -/* nwords is the number of 32 bit values to be packed - * the low order 32 bits of each word will be packed - * into 64 bit words - */ - nwords = len >> 2; - bits = 32; - - for(i=0;i> 2; - - for (; len > PACKBUFFERSIZE; len -= PACKBUFFERSIZE, data += nunits) { - doData32 (dpy, data, PACKBUFFERSIZE, packbuffer); - } - if (len) doData32 (dpy, data, len, packbuffer); -} - -#endif /* WORD64 */ - - -/* Make sure this produces the same string as DefineLocal/DefineSelf in xdm. - * Otherwise, Xau will not be able to find your cookies in the Xauthority file. - * - * Note: POSIX says that the ``nodename'' member of utsname does _not_ have - * to have sufficient information for interfacing to the network, - * and so, you may be better off using gethostname (if it exists). - */ - -#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) -#define NEED_UTSNAME -#include -#endif - -/* - * _XGetHostname - similar to gethostname but allows special processing. - */ -int _XGetHostname ( - char *buf, - int maxlen) -{ - int len; - -#ifdef NEED_UTSNAME - struct utsname name; - - if (maxlen <= 0 || buf == NULL) - return 0; - - uname (&name); - len = strlen (name.nodename); - if (len >= maxlen) len = maxlen - 1; - strncpy (buf, name.nodename, len); - buf[len] = '\0'; -#else - if (maxlen <= 0 || buf == NULL) - return 0; - - buf[0] = '\0'; - (void) gethostname (buf, maxlen); - buf [maxlen - 1] = '\0'; - len = strlen(buf); -#endif /* NEED_UTSNAME */ - return len; -} - - -/* - * _XScreenOfWindow - get the Screen of a given window - */ - -Screen *_XScreenOfWindow (dpy, w) - Display *dpy; - Window w; -{ - register int i; - Window root; - int x, y; /* dummy variables */ - unsigned int width, height, bw, depth; /* dummy variables */ - - if (XGetGeometry (dpy, w, &root, &x, &y, &width, &height, - &bw, &depth) == False) { - return None; - } - for (i = 0; i < ScreenCount (dpy); i++) { /* find root from list */ - if (root == RootWindow (dpy, i)) { - return ScreenOfDisplay (dpy, i); - } - } - return NULL; -} - - -#if defined(WIN32) - -/* - * These functions are intended to be used internally to Xlib only. - * These functions will always prefix the path with a DOS drive in the - * form ":". As such, these functions are only suitable - * for use by Xlib function that supply a root-based path to some - * particular file, e.g. /lib/X11/locale/locale.dir will - * be converted to "C:/usr/X11R6.3/lib/X11/locale/locale.dir". - */ - -static int access_file (path, pathbuf, len_pathbuf, pathret) - char* path; - char* pathbuf; - int len_pathbuf; - char** pathret; -{ - if (access (path, F_OK) == 0) { - if (strlen (path) < len_pathbuf) - *pathret = pathbuf; - else - *pathret = Xmalloc (strlen (path) + 1); - if (*pathret) { - strcpy (*pathret, path); - return 1; - } - } - return 0; -} - -static int AccessFile (path, pathbuf, len_pathbuf, pathret) - char* path; - char* pathbuf; - int len_pathbuf; - char** pathret; -{ - unsigned long drives; - int i, len; - char* drive; - char buf[MAX_PATH]; - char* bufp; - - /* just try the "raw" name first and see if it works */ - if (access_file (path, pathbuf, len_pathbuf, pathret)) - return 1; - - /* try the places set in the environment */ - drive = getenv ("_XBASEDRIVE"); -#ifdef __UNIXOS2__ - if (!drive) - drive = getenv ("X11ROOT"); -#endif - if (!drive) - drive = "C:"; - len = strlen (drive) + strlen (path); - if (len < MAX_PATH) bufp = buf; - else bufp = Xmalloc (len + 1); - strcpy (bufp, drive); - strcat (bufp, path); - if (access_file (bufp, pathbuf, len_pathbuf, pathret)) { - if (bufp != buf) Xfree (bufp); - return 1; - } - -#ifndef __UNIXOS2__ - /* one last place to look */ - drive = getenv ("HOMEDRIVE"); - if (drive) { - len = strlen (drive) + strlen (path); - if (len < MAX_PATH) bufp = buf; - else bufp = Xmalloc (len + 1); - strcpy (bufp, drive); - strcat (bufp, path); - if (access_file (bufp, pathbuf, len_pathbuf, pathret)) { - if (bufp != buf) Xfree (bufp); - return 1; - } - } - - /* tried everywhere else, go fishing */ -#define C_DRIVE ('C' - 'A') -#define Z_DRIVE ('Z' - 'A') - /* does OS/2 (with or with gcc-emx) have getdrives? */ - drives = _getdrives (); - for (i = C_DRIVE; i <= Z_DRIVE; i++) { /* don't check on A: or B: */ - if ((1 << i) & drives) { - len = 2 + strlen (path); - if (len < MAX_PATH) bufp = buf; - else bufp = Xmalloc (len + 1); - *bufp = 'A' + i; - *(bufp + 1) = ':'; - *(bufp + 2) = '\0'; - strcat (bufp, path); - if (access_file (bufp, pathbuf, len_pathbuf, pathret)) { - if (bufp != buf) Xfree (bufp); - return 1; - } - } - } -#endif - return 0; -} - -int _XOpenFile(path, flags) - _Xconst char* path; - int flags; -{ - char buf[MAX_PATH]; - char* bufp = NULL; - int ret = -1; - UINT olderror = SetErrorMode (SEM_FAILCRITICALERRORS); - - if (AccessFile (path, buf, MAX_PATH, &bufp)) - ret = open (bufp, flags); - - (void) SetErrorMode (olderror); - - if (bufp != buf) Xfree (bufp); - - return ret; -} - -void* _XFopenFile(path, mode) - _Xconst char* path; - _Xconst char* mode; -{ - char buf[MAX_PATH]; - char* bufp = NULL; - void* ret = NULL; - UINT olderror = SetErrorMode (SEM_FAILCRITICALERRORS); - - if (AccessFile (path, buf, MAX_PATH, &bufp)) - ret = fopen (bufp, mode); - - (void) SetErrorMode (olderror); - - if (bufp != buf) Xfree (bufp); - - return ret; -} - -int _XAccessFile(path) - _Xconst char* path; -{ - char buf[MAX_PATH]; - char* bufp; - int ret = -1; - UINT olderror = SetErrorMode (SEM_FAILCRITICALERRORS); - - ret = AccessFile (path, buf, MAX_PATH, &bufp); - - (void) SetErrorMode (olderror); - - if (bufp != buf) Xfree (bufp); - - return ret; -} - -#endif - -#ifdef WIN32 -#undef _Xdebug -int _Xdebug = 0; -int *_Xdebug_p = &_Xdebug; -void (**_XCreateMutex_fn_p)(LockInfoPtr) = &_XCreateMutex_fn; -void (**_XFreeMutex_fn_p)(LockInfoPtr) = &_XFreeMutex_fn; -void (**_XLockMutex_fn_p)(LockInfoPtr -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = &_XLockMutex_fn; -void (**_XUnlockMutex_fn_p)(LockInfoPtr -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = &_XUnlockMutex_fn; -LockInfoPtr *_Xglobal_lock_p = &_Xglobal_lock; -#endif diff --git a/nx-X11/lib/X11/XlibInt.c.X.original b/nx-X11/lib/X11/XlibInt.c.X.original deleted file mode 100644 index c042eb2e4..000000000 --- a/nx-X11/lib/X11/XlibInt.c.X.original +++ /dev/null @@ -1,3429 +0,0 @@ -/* $Xorg: XlibInt.c,v 1.8 2001/02/09 02:03:38 xorgcvs Exp $ */ -/* - -Copyright 1985, 1986, 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/XlibInt.c,v 3.38 2003/10/30 21:55:05 alanh Exp $ */ - -/* - * XlibInt.c - Internal support routines for the C subroutine - * interface library (Xlib) to the X Window System Protocol V11.0. - */ -#define NEED_EVENTS -#define NEED_REPLIES - -#ifdef WIN32 -#define _XLIBINT_ -#endif -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" -#include -#include -#include -#include -#ifdef WIN32 -#include -#endif - -#ifdef XTHREADS -#include "locking.h" - -/* these pointers get initialized by XInitThreads */ -LockInfoPtr _Xglobal_lock = NULL; -void (*_XCreateMutex_fn)(LockInfoPtr) = NULL; -/* struct _XCVList *(*_XCreateCVL_fn)() = NULL; */ -void (*_XFreeMutex_fn)(LockInfoPtr) = NULL; -void (*_XLockMutex_fn)( - LockInfoPtr /* lock */ -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = NULL; -void (*_XUnlockMutex_fn)( - LockInfoPtr /* lock */ -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = NULL; -xthread_t (*_Xthread_self_fn)(void) = NULL; - -#define XThread_Self() ((*_Xthread_self_fn)()) - -#define UnlockNextReplyReader(d) if ((d)->lock) \ - (*(d)->lock->pop_reader)((d),&(d)->lock->reply_awaiters,&(d)->lock->reply_awaiters_tail) - -#define QueueReplyReaderLock(d) ((d)->lock ? \ - (*(d)->lock->push_reader)(d,&(d)->lock->reply_awaiters_tail) : NULL) -#define QueueEventReaderLock(d) ((d)->lock ? \ - (*(d)->lock->push_reader)(d,&(d)->lock->event_awaiters_tail) : NULL) - -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -#define InternalLockDisplay(d,wskip) if ((d)->lock) \ - (*(d)->lock->internal_lock_display)(d,wskip,__FILE__,__LINE__) -#else -#define InternalLockDisplay(d,wskip) if ((d)->lock) \ - (*(d)->lock->internal_lock_display)(d,wskip) -#endif - -#else /* XTHREADS else */ - -#define UnlockNextReplyReader(d) -#define UnlockNextEventReader(d) -#define InternalLockDisplay(d,wskip) - -#endif /* XTHREADS else */ - -/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX - * systems are broken and return EWOULDBLOCK when they should return EAGAIN - */ -#ifdef WIN32 -#define ETEST() (WSAGetLastError() == WSAEWOULDBLOCK) -#else -#ifdef __CYGWIN__ /* Cygwin uses ENOBUFS to signal socket is full */ -#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS) -#else -#if defined(EAGAIN) && defined(EWOULDBLOCK) -#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK) -#else -#ifdef EAGAIN -#define ETEST() (errno == EAGAIN) -#else -#define ETEST() (errno == EWOULDBLOCK) -#endif /* EAGAIN */ -#endif /* EAGAIN && EWOULDBLOCK */ -#endif /* __CYGWIN__ */ -#endif /* WIN32 */ - -#ifdef WIN32 -#define ECHECK(err) (WSAGetLastError() == err) -#define ESET(val) WSASetLastError(val) -#else -#ifdef __UNIXOS2__ -#define ECHECK(err) (errno == err) -#define ESET(val) -#else -#ifdef ISC -#define ECHECK(err) ((errno == err) || ETEST()) -#else -#define ECHECK(err) (errno == err) -#endif -#define ESET(val) errno = val -#endif -#endif - -#if defined(LOCALCONN) || defined(LACHMAN) -#ifdef EMSGSIZE -#define ESZTEST() (ECHECK(EMSGSIZE) || ECHECK(ERANGE)) -#else -#define ESZTEST() ECHECK(ERANGE) -#endif -#else -#ifdef EMSGSIZE -#define ESZTEST() ECHECK(EMSGSIZE) -#endif -#endif - -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2ClientSelect(n,r,w,x,t) -#include -#define MAX_PATH _POSIX_PATH_MAX -#endif - -#ifdef MUSTCOPY - -#define STARTITERATE(tpvar,type,start,endcond) \ - { register char *cpvar; \ - for (cpvar = (char *) (start); endcond; ) { \ - type dummy; memcpy ((char *) &dummy, cpvar, SIZEOF(type)); \ - tpvar = &dummy; -#define ITERPTR(tpvar) cpvar -#define RESETITERPTR(tpvar,type,start) cpvar = start -#define INCITERPTR(tpvar,type) cpvar += SIZEOF(type) -#define ENDITERATE }} - -#else - -#define STARTITERATE(tpvar,type,start,endcond) \ - for (tpvar = (type *) (start); endcond; ) -#define ITERPTR(tpvar) (char *)tpvar -#define RESETITERPTR(tpvar,type,start) tpvar = (type *) (start) -#define INCITERPTR(tpvar,type) tpvar++ -#define ENDITERATE - -#endif /* MUSTCOPY */ - -typedef union { - xReply rep; - char buf[BUFSIZE]; -} _XAlignedBuffer; - -static char *_XAsyncReply( - Display *dpy, - register xReply *rep, - char *buf, - register int *lenp, - Bool discard); - -static void _XProcessInternalConnection( - Display *dpy, - struct _XConnectionInfo *conn_info); - -#define SEQLIMIT (65535 - (BUFSIZE / SIZEOF(xReq)) - 10) - -/* - * The following routines are internal routines used by Xlib for protocol - * packet transmission and reception. - * - * _XIOError(Display *) will be called if any sort of system call error occurs. - * This is assumed to be a fatal condition, i.e., XIOError should not return. - * - * _XError(Display *, xError *) will be called whenever an X_Error event is - * received. This is not assumed to be a fatal condition, i.e., it is - * acceptable for this procedure to return. However, XError should NOT - * perform any operations (directly or indirectly) on the DISPLAY. - * - * Routines declared with a return type of 'Status' return 0 on failure, - * and non 0 on success. Routines with no declared return type don't - * return anything. Whenever possible routines that create objects return - * the object they have created. - */ - -static xReq _dummy_request = { - 0, 0, 0 -}; - -/* - * This is an OS dependent routine which: - * 1) returns as soon as the connection can be written on.... - * 2) if the connection can be read, must enqueue events and handle errors, - * until the connection is writable. - */ -static void -_XWaitForWritable( - Display *dpy -#ifdef XTHREADS - , - xcondition_t cv /* our reading condition variable */ -#endif - ) -{ -#ifdef USE_POLL - struct pollfd filedes; -#else - fd_set r_mask; - fd_set w_mask; -#endif - int nfound; - -#ifdef USE_POLL - filedes.fd = dpy->fd; - filedes.events = 0; -#else - FD_ZERO(&r_mask); - FD_ZERO(&w_mask); -#endif - - for (;;) { -#ifdef XTHREADS - /* We allow only one thread at a time to read, to minimize - passing of read data between threads. - Now, who is it? If there is a non-NULL reply_awaiters and - we (i.e., our cv) are not at the head of it, then whoever - is at the head is the reader, and we don't read. - Otherwise there is no reply_awaiters or we are at the - head, having just appended ourselves. - In this case, if there is a event_awaiters, then whoever - is at the head of it got there before we did, and they are the - reader. - - Last cases: no event_awaiters and we are at the head of - reply_awaiters or reply_awaiters is NULL: we are the reader, - since there is obviously no one else involved. - - XXX - what if cv is NULL and someone else comes along after - us while we are waiting? - */ - - if (!dpy->lock || - (!dpy->lock->event_awaiters && - (!dpy->lock->reply_awaiters || - dpy->lock->reply_awaiters->cv == cv))) -#endif -#ifdef USE_POLL - filedes.events = POLLIN; - filedes.events |= POLLOUT; -#else - FD_SET(dpy->fd, &r_mask); - FD_SET(dpy->fd, &w_mask); -#endif - - do { - UnlockDisplay(dpy); -#ifdef USE_POLL - nfound = poll (&filedes, 1, -1); -#else - nfound = Select (dpy->fd + 1, &r_mask, &w_mask, NULL, NULL); -#endif - InternalLockDisplay(dpy, cv != NULL); - if (nfound < 0 && !ECHECK(EINTR)) - _XIOError(dpy); - } while (nfound <= 0); - - if ( -#ifdef USE_POLL - filedes.revents & POLLIN -#else - FD_ISSET(dpy->fd, &r_mask) -#endif - ) - { - _XAlignedBuffer buf; - BytesReadable_t pend; - register int len; - register xReply *rep; - - /* find out how much data can be read */ - if (_X11TransBytesReadable(dpy->trans_conn, &pend) < 0) - _XIOError(dpy); - len = pend; - - /* must read at least one xEvent; if none is pending, then - we'll just block waiting for it */ - if (len < SIZEOF(xReply) -#ifdef XTHREADS - || dpy->async_handlers -#endif - ) - len = SIZEOF(xReply); - - /* but we won't read more than the max buffer size */ - if (len > BUFSIZE) len = BUFSIZE; - - /* round down to an integral number of XReps */ - len = (len / SIZEOF(xReply)) * SIZEOF(xReply); - - (void) _XRead (dpy, buf.buf, (long) len); - - STARTITERATE(rep,xReply,buf.buf,len > 0) { - if (rep->generic.type == X_Reply) { - int tmp = len; - RESETITERPTR(rep,xReply, - _XAsyncReply (dpy, rep, - ITERPTR(rep), &tmp, True)); - len = tmp; - pend = len; - } else { - if (rep->generic.type == X_Error) - _XError (dpy, (xError *)rep); - else /* must be an event packet */ - _XEnq (dpy, (xEvent *)rep); - INCITERPTR(rep,xReply); - len -= SIZEOF(xReply); - } - } ENDITERATE -#ifdef XTHREADS - if (dpy->lock && dpy->lock->event_awaiters) - ConditionSignal(dpy, dpy->lock->event_awaiters->cv); -#endif - } -#ifdef USE_POLL - if (filedes.revents & (POLLOUT|POLLHUP|POLLERR)) -#else - if (FD_ISSET(dpy->fd, &w_mask)) -#endif - { -#ifdef XTHREADS - if (dpy->lock) { - ConditionBroadcast(dpy, dpy->lock->writers); - } -#endif - return; - } - } -} - - -#define POLLFD_CACHE_SIZE 5 - -/* initialize the struct array passed to poll() below */ -Bool _XPollfdCacheInit( - Display *dpy) -{ -#ifdef USE_POLL - struct pollfd *pfp; - - pfp = (struct pollfd *)Xmalloc(POLLFD_CACHE_SIZE * sizeof(struct pollfd)); - if (!pfp) - return False; - pfp[0].fd = dpy->fd; - pfp[0].events = POLLIN; - - dpy->filedes = (XPointer)pfp; -#endif - return True; -} - -void _XPollfdCacheAdd( - Display *dpy, - int fd) -{ -#ifdef USE_POLL - struct pollfd *pfp = (struct pollfd *)dpy->filedes; - - if (dpy->im_fd_length <= POLLFD_CACHE_SIZE) { - pfp[dpy->im_fd_length].fd = fd; - pfp[dpy->im_fd_length].events = POLLIN; - } -#endif -} - -/* ARGSUSED */ -void _XPollfdCacheDel( - Display *dpy, - int fd) /* not used */ -{ -#ifdef USE_POLL - struct pollfd *pfp = (struct pollfd *)dpy->filedes; - struct _XConnectionInfo *conni; - - /* just recalculate whole list */ - if (dpy->im_fd_length <= POLLFD_CACHE_SIZE) { - int loc = 1; - for (conni = dpy->im_fd_info; conni; conni=conni->next) { - pfp[loc].fd = conni->fd; - pfp[loc].events = POLLIN; - loc++; - } - } -#endif -} - -/* returns True iff there is an event in the queue newer than serial_num */ - -static Bool -_XNewerQueuedEvent( - Display *dpy, - int serial_num) -{ - _XQEvent *qev; - - if (dpy->next_event_serial_num == serial_num) - return False; - - qev = dpy->head; - while (qev) { - if (qev->qserial_num >= serial_num) { - return True; - } - qev = qev->next; - } - return False; -} - -static int -_XWaitForReadable( - Display *dpy) -{ - int result; - int fd = dpy->fd; - struct _XConnectionInfo *ilist; - register int saved_event_serial = 0; - int in_read_events = 0; - register Bool did_proc_conni = False; -#ifdef USE_POLL - struct pollfd *filedes; -#else - fd_set r_mask; - int highest_fd = fd; -#endif - -#ifdef USE_POLL - if (dpy->im_fd_length + 1 > POLLFD_CACHE_SIZE - && !(dpy->flags & XlibDisplayProcConni)) { - /* XXX - this fallback is gross */ - int i; - - filedes = (struct pollfd *)Xmalloc(dpy->im_fd_length * sizeof(struct pollfd)); - filedes[0].fd = fd; - filedes[0].events = POLLIN; - for (ilist=dpy->im_fd_info, i=1; ilist; ilist=ilist->next, i++) { - filedes[i].fd = ilist->fd; - filedes[i].events = POLLIN; - } - } else { - filedes = (struct pollfd *)dpy->filedes; - } -#else - FD_ZERO(&r_mask); -#endif - for (;;) { -#ifndef USE_POLL - FD_SET(fd, &r_mask); - if (!(dpy->flags & XlibDisplayProcConni)) - for (ilist=dpy->im_fd_info; ilist; ilist=ilist->next) { - FD_SET(ilist->fd, &r_mask); - if (ilist->fd > highest_fd) - highest_fd = ilist->fd; - } -#endif - UnlockDisplay(dpy); -#ifdef USE_POLL - result = poll(filedes, - (dpy->flags & XlibDisplayProcConni) ? 1 : 1+dpy->im_fd_length, - -1); -#else - result = Select(highest_fd + 1, &r_mask, NULL, NULL, NULL); -#endif - InternalLockDisplay(dpy, dpy->flags & XlibDisplayReply); - if (result == -1 && !ECHECK(EINTR)) _XIOError(dpy); - if (result <= 0) - continue; -#ifdef USE_POLL - if (filedes[0].revents & (POLLIN|POLLHUP|POLLERR)) -#else - if (FD_ISSET(fd, &r_mask)) -#endif - break; - if (!(dpy->flags & XlibDisplayProcConni)) { - int i; - - saved_event_serial = dpy->next_event_serial_num; - /* dpy flags can be clobbered by internal connection callback */ - in_read_events = dpy->flags & XlibDisplayReadEvents; - for (ilist=dpy->im_fd_info, i=1; ilist; ilist=ilist->next, i++) { -#ifdef USE_POLL - if (filedes[i].revents & POLLIN) -#else - if (FD_ISSET(ilist->fd, &r_mask)) -#endif - { - _XProcessInternalConnection(dpy, ilist); - did_proc_conni = True; - } - } -#ifdef USE_POLL - if (dpy->im_fd_length + 1 > POLLFD_CACHE_SIZE) - Xfree(filedes); -#endif - } - if (did_proc_conni) { - /* some internal connection callback might have done an - XPutBackEvent. We notice it here and if we needed an event, - we can return all the way. */ - if (_XNewerQueuedEvent(dpy, saved_event_serial) - && (in_read_events -#ifdef XTHREADS - || (dpy->lock && dpy->lock->event_awaiters) -#endif - )) - return -2; - did_proc_conni = False; - } - } -#ifdef XTHREADS -#ifdef XTHREADS_DEBUG - printf("thread %x _XWaitForReadable returning\n", XThread_Self()); -#endif -#endif - return 0; -} - -static -int _XSeqSyncFunction( - register Display *dpy) -{ - xGetInputFocusReply rep; - register xReq *req; - - LockDisplay(dpy); - if ((dpy->request - dpy->last_request_read) >= (BUFSIZE / SIZEOF(xReq))) { - GetEmptyReq(GetInputFocus, req); - (void) _XReply (dpy, (xReply *)&rep, 0, xTrue); - } - /* could get XID handler while waiting for reply in MT env */ - if (dpy->synchandler == _XSeqSyncFunction) { - dpy->synchandler = dpy->savedsynchandler; - dpy->flags &= ~XlibDisplayPrivSync; - } - UnlockDisplay(dpy); - SyncHandle(); - return 0; -} - -#ifdef XTHREADS -static void _XFlushInt( - register Display *dpy, - register xcondition_t cv); -#endif - -/* - * _XFlush - Flush the X request buffer. If the buffer is empty, no - * action is taken. This routine correctly handles incremental writes. - * This routine may have to be reworked if int < long. - */ -void _XFlush( - register Display *dpy) -{ -#ifdef XTHREADS - /* With multi-threading we introduce an internal routine to which - we can pass a condition variable to do locking correctly. */ - - _XFlushInt(dpy, NULL); -} - -/* _XFlushInt - Internal version of _XFlush used to do multi-threaded - * locking correctly. - */ - -static void _XFlushInt( - register Display *dpy, - register xcondition_t cv) -{ -#endif /* XTHREADS*/ - register long size, todo; - register int write_stat; - register char *bufindex; - _XExtension *ext; - - /* This fix resets the bufptr to the front of the buffer so - * additional appends to the bufptr will not corrupt memory. Since - * the server is down, these appends are no-op's anyway but - * callers of _XFlush() are not verifying this before they call it. - */ - if (dpy->flags & XlibDisplayIOError) - { - dpy->bufptr = dpy->buffer; - dpy->last_req = (char *)&_dummy_request; - return; - } - -#ifdef XTHREADS - while (dpy->flags & XlibDisplayWriting) { - if (dpy->lock) { - ConditionWait(dpy, dpy->lock->writers); - } else { - _XWaitForWritable (dpy, cv); - } - } -#endif - size = todo = dpy->bufptr - dpy->buffer; - if (!size) return; -#ifdef XTHREADS - dpy->flags |= XlibDisplayWriting; - /* make sure no one else can put in data */ - dpy->bufptr = dpy->bufmax; -#endif - for (ext = dpy->flushes; ext; ext = ext->next_flush) - (*ext->before_flush)(dpy, &ext->codes, dpy->buffer, size); - bufindex = dpy->buffer; - /* - * While write has not written the entire buffer, keep looping - * until the entire buffer is written. bufindex will be - * incremented and size decremented as buffer is written out. - */ - while (size) { - ESET(0); - write_stat = _X11TransWrite(dpy->trans_conn, - bufindex, (int) todo); - if (write_stat >= 0) { - size -= write_stat; - todo = size; - bufindex += write_stat; - } else if (ETEST()) { - _XWaitForWritable(dpy -#ifdef XTHREADS - , cv -#endif - ); -#ifdef SUNSYSV - } else if (ECHECK(0)) { - _XWaitForWritable(dpy -#ifdef XTHREADS - , cv -#endif - ); -#endif -#ifdef ESZTEST - } else if (ESZTEST()) { - if (todo > 1) - todo >>= 1; - else { - _XWaitForWritable(dpy -#ifdef XTHREADS - , cv -#endif - ); - } -#endif - } else if (!ECHECK(EINTR)) { - /* Write failed! */ - /* errno set by write system call. */ - _XIOError(dpy); - } - } - dpy->last_req = (char *)&_dummy_request; - if ((dpy->request - dpy->last_request_read) >= SEQLIMIT && - !(dpy->flags & XlibDisplayPrivSync)) { - dpy->savedsynchandler = dpy->synchandler; - dpy->synchandler = _XSeqSyncFunction; - dpy->flags |= XlibDisplayPrivSync; - } - dpy->bufptr = dpy->buffer; -#ifdef XTHREADS - dpy->flags &= ~XlibDisplayWriting; -#endif -} - -int -_XEventsQueued( - register Display *dpy, - int mode) -{ - register int len; - BytesReadable_t pend; - _XAlignedBuffer buf; - register xReply *rep; - char *read_buf; -#ifdef XTHREADS - int entry_event_serial_num; - struct _XCVList *cvl = NULL; - xthread_t self; - -#ifdef XTHREADS_DEBUG - printf("_XEventsQueued called in thread %x\n", XThread_Self()); -#endif -#endif /* XTHREADS*/ - - if (mode == QueuedAfterFlush) - { - _XFlush(dpy); - if (dpy->qlen) - return(dpy->qlen); - } - if (dpy->flags & XlibDisplayIOError) return(dpy->qlen); - -#ifdef XTHREADS - /* create our condition variable and append to list, - * unless we were called from within XProcessInternalConnection - * or XLockDisplay - */ - xthread_clear_id(self); - if (dpy->lock && (xthread_have_id (dpy->lock->conni_thread) - || xthread_have_id (dpy->lock->locking_thread))) - /* some thread is in XProcessInternalConnection or XLockDisplay - so we have to see if we are it */ - self = XThread_Self(); - if (!xthread_have_id(self) - || (!xthread_equal(self, dpy->lock->conni_thread) - && !xthread_equal(self, dpy->lock->locking_thread))) { - /* In the multi-threaded case, if there is someone else - reading events, then there aren't any available, so - we just return. If we waited we would block. - */ - if (dpy->lock && dpy->lock->event_awaiters) - return dpy->qlen; - /* nobody here but us, so lock out any newcomers */ - cvl = QueueEventReaderLock(dpy); - } - - while (dpy->lock && cvl && dpy->lock->reply_first) { - /* note which events we have already seen so we'll know - if _XReply (in another thread) reads one */ - entry_event_serial_num = dpy->next_event_serial_num; - ConditionWait(dpy, cvl->cv); - /* did _XReply read an event we can return? */ - if (_XNewerQueuedEvent(dpy, entry_event_serial_num)) - { - UnlockNextEventReader(dpy); - return 0; - } - } -#endif /* XTHREADS*/ - - if (_X11TransBytesReadable(dpy->trans_conn, &pend) < 0) - _XIOError(dpy); -#ifdef XCONN_CHECK_FREQ - /* This is a crock, required because FIONREAD or equivalent is - * not guaranteed to detect a broken connection. - */ - if (!pend && !dpy->qlen && ++dpy->conn_checker >= XCONN_CHECK_FREQ) - { - int result; -#ifdef USE_POLL - struct pollfd filedes; -#else - fd_set r_mask; - static struct timeval zero_time; -#endif - - dpy->conn_checker = 0; -#ifdef USE_POLL - filedes.fd = dpy->fd; - filedes.events = POLLIN; - if ((result = poll(&filedes, 1, 0))) -#else - FD_ZERO(&r_mask); - FD_SET(dpy->fd, &r_mask); - if ((result = Select(dpy->fd + 1, &r_mask, NULL, NULL, &zero_time))) -#endif - { - if (result > 0) - { - if (_X11TransBytesReadable(dpy->trans_conn, &pend) < 0) - _XIOError(dpy); - /* we should not get zero, if we do, force a read */ - if (!pend) - pend = SIZEOF(xReply); - } - else if (result < 0 && !ECHECK(EINTR)) - _XIOError(dpy); - } - } -#endif /* XCONN_CHECK_FREQ */ - if (!(len = pend)) { - /* _XFlush can enqueue events */ -#ifdef XTHREADS - if (cvl) -#endif - { - UnlockNextEventReader(dpy); - } - return(dpy->qlen); - } - /* Force a read if there is not enough data. Otherwise, - * a select() loop at a higher-level will spin undesirably, - * and we've seen at least one OS that appears to not update - * the result from FIONREAD once it has returned nonzero. - */ -#ifdef XTHREADS - if (dpy->lock && dpy->lock->reply_awaiters) { - read_buf = (char *)dpy->lock->reply_awaiters->buf; - len = SIZEOF(xReply); - } else -#endif /* XTHREADS*/ - { - read_buf = buf.buf; - - if (len < SIZEOF(xReply) -#ifdef XTHREADS - || dpy->async_handlers -#endif - ) - len = SIZEOF(xReply); - else if (len > BUFSIZE) - len = BUFSIZE; - len = (len / SIZEOF(xReply)) * SIZEOF(xReply); - } -#ifdef XCONN_CHECK_FREQ - dpy->conn_checker = 0; -#endif - - (void) _XRead (dpy, read_buf, (long) len); - -#ifdef XTHREADS - /* what did we actually read: reply or event? */ - if (dpy->lock && dpy->lock->reply_awaiters) { - if (((xReply *)read_buf)->generic.type == X_Reply || - ((xReply *)read_buf)->generic.type == X_Error) - { - dpy->lock->reply_was_read = True; - dpy->lock->reply_first = True; - if (read_buf != (char *)dpy->lock->reply_awaiters->buf) - memcpy(dpy->lock->reply_awaiters->buf, read_buf, - len); - if (cvl) { - UnlockNextEventReader(dpy); - } - return(dpy->qlen); /* we read, so we can return */ - } else if (read_buf != buf.buf) - memcpy(buf.buf, read_buf, len); - } -#endif /* XTHREADS*/ - - STARTITERATE(rep,xReply,buf.buf,len > 0) { - if (rep->generic.type == X_Reply) { - int tmp = len; - RESETITERPTR(rep,xReply, - _XAsyncReply (dpy, rep, - ITERPTR(rep), &tmp, True)); - len = tmp; - pend = len; - } else { - if (rep->generic.type == X_Error) - _XError (dpy, (xError *)rep); - else /* must be an event packet */ - _XEnq (dpy, (xEvent *)rep); - INCITERPTR(rep,xReply); - len -= SIZEOF(xReply); - } - } ENDITERATE - -#ifdef XTHREADS - if (cvl) -#endif - { - UnlockNextEventReader(dpy); - } - return(dpy->qlen); -} - -/* _XReadEvents - Flush the output queue, - * then read as many events as possible (but at least 1) and enqueue them - */ -void _XReadEvents( - register Display *dpy) -{ - _XAlignedBuffer buf; - BytesReadable_t pend; - int len; - register xReply *rep; - Bool not_yet_flushed = True; - char *read_buf; - int i; - int entry_event_serial_num = dpy->next_event_serial_num; -#ifdef XTHREADS - struct _XCVList *cvl = NULL; - xthread_t self; - -#ifdef XTHREADS_DEBUG - printf("_XReadEvents called in thread %x\n", - XThread_Self()); -#endif - /* create our condition variable and append to list, - * unless we were called from within XProcessInternalConnection - * or XLockDisplay - */ - xthread_clear_id(self); - if (dpy->lock && (xthread_have_id (dpy->lock->conni_thread) - || xthread_have_id (dpy->lock->locking_thread))) - /* some thread is in XProcessInternalConnection or XLockDisplay - so we have to see if we are it */ - self = XThread_Self(); - if (!xthread_have_id(self) - || (!xthread_equal(self, dpy->lock->conni_thread) - && !xthread_equal(self, dpy->lock->locking_thread))) - cvl = QueueEventReaderLock(dpy); -#endif /* XTHREADS */ - - do { -#ifdef XTHREADS - /* if it is not our turn to read an event off the wire, - wait til we're at head of list */ - if (dpy->lock && cvl && - (dpy->lock->event_awaiters != cvl || - dpy->lock->reply_first)) { - ConditionWait(dpy, cvl->cv); - continue; - } -#endif /* XTHREADS */ - /* find out how much data can be read */ - if (_X11TransBytesReadable(dpy->trans_conn, &pend) < 0) - _XIOError(dpy); - len = pend; - - /* must read at least one xEvent; if none is pending, then - we'll just flush and block waiting for it */ - if (len < SIZEOF(xEvent) -#ifdef XTHREADS - || dpy->async_handlers -#endif - ) { - len = SIZEOF(xEvent); - /* don't flush until the first time we would block */ - if (not_yet_flushed) { - _XFlush (dpy); - if (_XNewerQueuedEvent(dpy, entry_event_serial_num)) { - /* _XReply has read an event for us */ - goto got_event; - } - not_yet_flushed = False; - } - } - -#ifdef XTHREADS - /* If someone is waiting for a reply, gamble that - the reply will be the next thing on the wire - and read it into their buffer. */ - if (dpy->lock && dpy->lock->reply_awaiters) { - read_buf = (char *)dpy->lock->reply_awaiters->buf; - len = SIZEOF(xReply); - } else -#endif /* XTHREADS*/ - { - read_buf = buf.buf; - - /* but we won't read more than the max buffer size */ - if (len > BUFSIZE) - len = BUFSIZE; - - /* round down to an integral number of XReps */ - len = (len / SIZEOF(xEvent)) * SIZEOF(xEvent); - } - -#ifdef XTHREADS - if (xthread_have_id(self)) - /* save value we may have to stick in conni_thread */ - dpy->lock->reading_thread = self; -#endif /* XTHREADS */ - dpy->flags |= XlibDisplayReadEvents; - i = _XRead (dpy, read_buf, (long) len); - dpy->flags &= ~XlibDisplayReadEvents; - if (i == -2) { - /* special flag from _XRead to say that internal connection has - done XPutBackEvent. Which we can use so we're done. */ - got_event: -#ifdef XTHREADS - if (dpy->lock && dpy->lock->lock_wait) { - if (dpy->lock->event_awaiters != cvl) - /* since it is not us, must be user lock thread */ - ConditionSignal(dpy, - dpy->lock->event_awaiters->cv); - (*dpy->lock->lock_wait)(dpy); - continue; - } -#endif - break; - } -#ifdef XTHREADS - if (xthread_have_id(self)) - xthread_clear_id(dpy->lock->reading_thread); - - /* what did we actually read: reply or event? */ - if (dpy->lock && dpy->lock->reply_awaiters) { - if (((xReply *)read_buf)->generic.type == X_Reply || - ((xReply *)read_buf)->generic.type == X_Error) - { - dpy->lock->reply_was_read = True; - dpy->lock->reply_first = True; - if (read_buf != (char *)dpy->lock->reply_awaiters->buf) - memcpy(dpy->lock->reply_awaiters->buf, - read_buf, len); - ConditionSignal(dpy, dpy->lock->reply_awaiters->cv); - continue; - } else if (read_buf != buf.buf) - memcpy(buf.buf, read_buf, len); - } -#endif /* XTHREADS */ - - STARTITERATE(rep,xReply,buf.buf,len > 0) { - if (rep->generic.type == X_Reply) { - RESETITERPTR(rep,xReply, - _XAsyncReply (dpy, rep, - ITERPTR(rep), &len, True)); - pend = len; - } else { - if (rep->generic.type == X_Error) - _XError (dpy, (xError *) rep); - else /* must be an event packet */ - _XEnq (dpy, (xEvent *)rep); - INCITERPTR(rep,xReply); - len -= SIZEOF(xReply); - } - } ENDITERATE; - } while (!_XNewerQueuedEvent(dpy, entry_event_serial_num)); - - UnlockNextEventReader(dpy); -} - -/* - * _XRead - Read bytes from the socket taking into account incomplete - * reads. This routine may have to be reworked if int < long. - */ -int _XRead( - register Display *dpy, - register char *data, - register long size) -{ - register long bytes_read; -#ifdef XTHREADS - int original_size = size; -#endif - - if ((dpy->flags & XlibDisplayIOError) || size == 0) - return 0; - ESET(0); - while ((bytes_read = _X11TransRead(dpy->trans_conn, data, (int)size)) - != size) { - - if (bytes_read > 0) { - size -= bytes_read; - data += bytes_read; - } - else if (ETEST()) { - if (_XWaitForReadable(dpy) == -2) - return -2; /* internal connection did XPutBackEvent */ - ESET(0); - } -#ifdef SUNSYSV - else if (ECHECK(0)) { - if (_XWaitForReadable(dpy) == -2) - return -2; /* internal connection did XPutBackEvent */ - } -#endif - else if (bytes_read == 0) { - /* Read failed because of end of file! */ - ESET(EPIPE); - _XIOError(dpy); - } - - else /* bytes_read is less than 0; presumably -1 */ { - /* If it's a system call interrupt, it's not an error. */ - if (!ECHECK(EINTR)) - _XIOError(dpy); - } - } -#ifdef XTHREADS - if (dpy->lock && dpy->lock->reply_bytes_left > 0) - { - dpy->lock->reply_bytes_left -= original_size; - if (dpy->lock->reply_bytes_left == 0) { - dpy->flags &= ~XlibDisplayReply; - UnlockNextReplyReader(dpy); - } - } -#endif /* XTHREADS*/ - return 0; -} - -#ifdef LONG64 -void _XRead32( - Display *dpy, - register long *data, - long len) -{ - register int *buf; - register long i; - - if (len) { - (void) _XRead(dpy, (char *)data, len); - i = len >> 2; - buf = (int *)data + i; - data += i; - while (--i >= 0) - *--data = *--buf; - } -} -#endif /* LONG64 */ - -#ifdef WORD64 - -/* - * XXX This is a *really* stupid way of doing this.... - * PACKBUFFERSIZE must be a multiple of 4. - */ - -#define PACKBUFFERSIZE 4096 - - -/* - * _XRead32 - Read bytes from the socket unpacking each 32 bits - * into a long (64 bits on a CRAY computer). - * - */ -static void _doXRead32( - register Display *dpy, - register long *data - register long size, - register char *packbuffer) -{ - long *lpack,*lp; - long mask32 = 0x00000000ffffffff; - long maskw, nwords, i, bits; - - _XReadPad (dpy, packbuffer, size); - - lp = data; - lpack = (long *) packbuffer; - nwords = size >> 2; - bits = 32; - - for(i=0;i> bits; - bits = bits ^32; - if(bits){ - lpack++; - } - } -} - -void _XRead32( - Display *dpy, - long *data, - long len) -{ - char packbuffer[PACKBUFFERSIZE]; - unsigned nunits = PACKBUFFERSIZE >> 2; - - for (; len > PACKBUFFERSIZE; len -= PACKBUFFERSIZE, data += nunits) { - _doXRead32 (dpy, data, PACKBUFFERSIZE, packbuffer); - } - if (len) _doXRead32 (dpy, data, len, packbuffer); -} - - - -/* - * _XRead16 - Read bytes from the socket unpacking each 16 bits - * into a long (64 bits on a CRAY computer). - * - */ -static _doXRead16( - register Display *dpy, - register short *data, - register long size, - char *packbuffer) -{ - long *lpack,*lp; - long mask16 = 0x000000000000ffff; - long maskw, nwords, i, bits; - - (void) _XRead(dpy,packbuffer,size); /* don't do a padded read... */ - - lp = (long *) data; - lpack = (long *) packbuffer; - nwords = size >> 1; /* number of 16 bit words to be unpacked */ - bits = 48; - for(i=0;i> bits; - bits -= 16; - if(bits < 0){ - lpack++; - bits = 48; - } - } -} - -void _XRead16( - Display *dpy, - short *data, - long len) -{ - char packbuffer[PACKBUFFERSIZE]; - unsigned nunits = PACKBUFFERSIZE >> 1; - - for (; len > PACKBUFFERSIZE; len -= PACKBUFFERSIZE, data += nunits) { - _doXRead16 (dpy, data, PACKBUFFERSIZE, packbuffer); - } - if (len) _doXRead16 (dpy, data, len, packbuffer); -} - -void _XRead16Pad( - Display *dpy, - short *data, - long size) -{ - int slop = (size & 3); - short slopbuf[3]; - - _XRead16 (dpy, data, size); - if (slop > 0) { - _XRead16 (dpy, slopbuf, 4 - slop); - } -} -#endif /* WORD64 */ - - -/* - * _XReadPad - Read bytes from the socket taking into account incomplete - * reads. If the number of bytes is not 0 mod 4, read additional pad - * bytes. This routine may have to be reworked if int < long. - */ -void _XReadPad( - register Display *dpy, - register char *data, - register long size) -{ - register long bytes_read; - struct iovec iov[2]; - char pad[3]; -#ifdef XTHREADS - int original_size; -#endif - - if ((dpy->flags & XlibDisplayIOError) || size == 0) return; - iov[0].iov_len = (int)size; - iov[0].iov_base = data; - /* - * The following hack is used to provide 32 bit long-word - * aligned padding. The [1] vector is of length 0, 1, 2, or 3, - * whatever is needed. - */ - - iov[1].iov_len = -size & 3; - iov[1].iov_base = pad; - size += iov[1].iov_len; -#ifdef XTHREADS - original_size = size; -#endif - ESET(0); - while ((bytes_read = _X11TransReadv (dpy->trans_conn, iov, 2)) != size) { - - if (bytes_read > 0) { - size -= bytes_read; - if (iov[0].iov_len < bytes_read) { - int pad_bytes_read = bytes_read - iov[0].iov_len; - iov[1].iov_len -= pad_bytes_read; - iov[1].iov_base = - (char *)iov[1].iov_base + pad_bytes_read; - iov[0].iov_len = 0; - } - else { - iov[0].iov_len -= bytes_read; - iov[0].iov_base = (char *)iov[0].iov_base + bytes_read; - } - } - else if (ETEST()) { - _XWaitForReadable(dpy); - ESET(0); - } -#ifdef SUNSYSV - else if (ECHECK(0)) { - _XWaitForReadable(dpy); - } -#endif - else if (bytes_read == 0) { - /* Read failed because of end of file! */ - ESET(EPIPE); - _XIOError(dpy); - } - - else /* bytes_read is less than 0; presumably -1 */ { - /* If it's a system call interrupt, it's not an error. */ - if (!ECHECK(EINTR)) - _XIOError(dpy); - } - } -#ifdef XTHREADS - if (dpy->lock && dpy->lock->reply_bytes_left > 0) - { - dpy->lock->reply_bytes_left -= original_size; - if (dpy->lock->reply_bytes_left == 0) { - dpy->flags &= ~XlibDisplayReply; - UnlockNextReplyReader(dpy); - } - } -#endif /* XTHREADS*/ -} - -/* - * _XSend - Flush the buffer and send the client data. 32 bit word aligned - * transmission is used, if size is not 0 mod 4, extra bytes are transmitted. - * This routine may have to be reworked if int < long; - */ -void -_XSend ( - register Display *dpy, - _Xconst char *data, - register long size) -{ - struct iovec iov[3]; - static char const pad[3] = {0, 0, 0}; - /* XText8 and XText16 require that the padding bytes be zero! */ - - long skip, dbufsize, padsize, total, todo; - _XExtension *ext; - - if (!size || (dpy->flags & XlibDisplayIOError)) return; - dbufsize = dpy->bufptr - dpy->buffer; -#ifdef XTHREADS - dpy->flags |= XlibDisplayWriting; - /* make sure no one else can put in data */ - dpy->bufptr = dpy->bufmax; -#endif - padsize = -size & 3; - for (ext = dpy->flushes; ext; ext = ext->next_flush) { - (*ext->before_flush)(dpy, &ext->codes, dpy->buffer, dbufsize); - (*ext->before_flush)(dpy, &ext->codes, (char *)data, size); - if (padsize) - (*ext->before_flush)(dpy, &ext->codes, pad, padsize); - } - skip = 0; - todo = total = dbufsize + size + padsize; - - /* - * There are 3 pieces that may need to be written out: - * - * o whatever is in the display buffer - * o the data passed in by the user - * o any padding needed to 32bit align the whole mess - * - * This loop looks at all 3 pieces each time through. It uses skip - * to figure out whether or not a given piece is needed. - */ - while (total) { - long before = skip; /* amount of whole thing written */ - long remain = todo; /* amount to try this time, <= total */ - int i = 0; - long len; - - /* You could be very general here and have "in" and "out" iovecs - * and write a loop without using a macro, but what the heck. This - * translates to: - * - * how much of this piece is new? - * if more new then we are trying this time, clamp - * if nothing new - * then bump down amount already written, for next piece - * else put new stuff in iovec, will need all of next piece - * - * Note that todo had better be at least 1 or else we'll end up - * writing 0 iovecs. - */ -#define InsertIOV(pointer, length) \ - len = (length) - before; \ - if (len > remain) \ - len = remain; \ - if (len <= 0) { \ - before = (-len); \ - } else { \ - iov[i].iov_len = len; \ - iov[i].iov_base = (pointer) + before; \ - i++; \ - remain -= len; \ - before = 0; \ - } - - InsertIOV (dpy->buffer, dbufsize) - InsertIOV ((char *)data, size) - InsertIOV ((char *)pad, padsize) - - ESET(0); - if ((len = _X11TransWritev(dpy->trans_conn, iov, i)) >= 0) { - skip += len; - total -= len; - todo = total; - } else if (ETEST()) { - _XWaitForWritable(dpy -#ifdef XTHREADS - , NULL -#endif - ); -#ifdef SUNSYSV - } else if (ECHECK(0)) { - _XWaitForWritable(dpy -#ifdef XTHREADS - , NULL -#endif - ); -#endif -#ifdef ESZTEST - } else if (ESZTEST()) { - if (todo > 1) - todo >>= 1; - else { - _XWaitForWritable(dpy -#ifdef XTHREADS - , NULL -#endif - ); - } -#endif - } else if (!ECHECK(EINTR)) { - _XIOError(dpy); - } - } - dpy->last_req = (char *) & _dummy_request; - if ((dpy->request - dpy->last_request_read) >= SEQLIMIT && - !(dpy->flags & XlibDisplayPrivSync)) { - dpy->savedsynchandler = dpy->synchandler; - dpy->synchandler = _XSeqSyncFunction; - dpy->flags |= XlibDisplayPrivSync; - } - dpy->bufptr = dpy->buffer; -#ifdef XTHREADS - dpy->flags &= ~XlibDisplayWriting; -#endif - return; -} - -static void -_XGetMiscCode( - register Display *dpy) -{ - xQueryExtensionReply qrep; - register xQueryExtensionReq *qreq; - xXCMiscGetVersionReply vrep; - register xXCMiscGetVersionReq *vreq; - - if (dpy->xcmisc_opcode) - return; - GetReq(QueryExtension, qreq); - qreq->nbytes = sizeof(XCMiscExtensionName) - 1; - qreq->length += (qreq->nbytes+(unsigned)3)>>2; - _XSend(dpy, XCMiscExtensionName, (long)qreq->nbytes); - if (!_XReply (dpy, (xReply *)&qrep, 0, xTrue)) - dpy->xcmisc_opcode = -1; - else { - GetReq(XCMiscGetVersion, vreq); - vreq->reqType = qrep.major_opcode; - vreq->miscReqType = X_XCMiscGetVersion; - vreq->majorVersion = XCMiscMajorVersion; - vreq->minorVersion = XCMiscMinorVersion; - if (!_XReply (dpy, (xReply *)&vrep, 0, xTrue)) - dpy->xcmisc_opcode = -1; - else - dpy->xcmisc_opcode = qrep.major_opcode; - } -} - -static int -_XIDHandler( - register Display *dpy) -{ - xXCMiscGetXIDRangeReply grep; - register xXCMiscGetXIDRangeReq *greq; - - LockDisplay(dpy); - _XGetMiscCode(dpy); - if (dpy->xcmisc_opcode > 0) { - GetReq(XCMiscGetXIDRange, greq); - greq->reqType = dpy->xcmisc_opcode; - greq->miscReqType = X_XCMiscGetXIDRange; - if (_XReply (dpy, (xReply *)&grep, 0, xTrue) && grep.count) { - dpy->resource_id = ((grep.start_id - dpy->resource_base) >> - dpy->resource_shift); - dpy->resource_max = dpy->resource_id; - if (grep.count > 5) - dpy->resource_max += grep.count - 6; - dpy->resource_max <<= dpy->resource_shift; - } - } - if (dpy->flags & XlibDisplayPrivSync) { - dpy->synchandler = dpy->savedsynchandler; - dpy->flags &= ~XlibDisplayPrivSync; - } - UnlockDisplay(dpy); - SyncHandle(); - return 0; -} - -/* - * _XAllocID - resource ID allocation routine. - */ -XID _XAllocID( - register Display *dpy) -{ - XID id; - - id = dpy->resource_id << dpy->resource_shift; - if (id >= dpy->resource_max) { - if (!(dpy->flags & XlibDisplayPrivSync)) { - dpy->savedsynchandler = dpy->synchandler; - dpy->flags |= XlibDisplayPrivSync; - } - dpy->synchandler = _XIDHandler; - dpy->resource_max = dpy->resource_mask + 1; - } - if (id <= dpy->resource_mask) { - dpy->resource_id++; - return (dpy->resource_base + id); - } - if (id != 0x10000000) { - (void) fprintf(stderr, - "Xlib: resource ID allocation space exhausted!\n"); - id = 0x10000000; - dpy->resource_id = id >> dpy->resource_shift; - } - return id; -} - -/* - * _XAllocIDs - multiple resource ID allocation routine. - */ -void _XAllocIDs( - register Display *dpy, - XID *ids, - int count) -{ - XID id; - int i; - xXCMiscGetXIDListReply grep; - register xXCMiscGetXIDListReq *greq; - - id = dpy->resource_id << dpy->resource_shift; - if (dpy->resource_max <= dpy->resource_mask && - id <= dpy->resource_mask && - (dpy->resource_max - id) > ((count - 1) << dpy->resource_shift)) { - id += dpy->resource_base; - for (i = 0; i < count; i++) { - ids[i] = id; - id += (1 << dpy->resource_shift); - dpy->resource_id++; - } - return; - } - grep.count = 0; - _XGetMiscCode(dpy); - if (dpy->xcmisc_opcode > 0) { - GetReq(XCMiscGetXIDList, greq); - greq->reqType = dpy->xcmisc_opcode; - greq->miscReqType = X_XCMiscGetXIDList; - greq->count = count; - if (_XReply(dpy, (xReply *)&grep, 0, xFalse) && grep.count) { - _XRead32(dpy, (long *) ids, 4L * (long) (grep.count)); - for (i = 0; i < grep.count; i++) { - id = (ids[i] - dpy->resource_base) >> dpy->resource_shift; - if (id >= dpy->resource_id) - dpy->resource_id = id; - } - if (id >= dpy->resource_max) { - if (!(dpy->flags & XlibDisplayPrivSync)) { - dpy->savedsynchandler = dpy->synchandler; - dpy->flags |= XlibDisplayPrivSync; - } - dpy->synchandler = _XIDHandler; - dpy->resource_max = dpy->resource_mask + 1; - } - } - } - for (i = grep.count; i < count; i++) - ids[i] = XAllocID(dpy); -} - -/* - * The hard part about this is that we only get 16 bits from a reply. - * We have three values that will march along, with the following invariant: - * dpy->last_request_read <= rep->sequenceNumber <= dpy->request - * We have to keep - * dpy->request - dpy->last_request_read < 2^16 - * or else we won't know for sure what value to use in events. We do this - * by forcing syncs when we get close. - */ - -unsigned long -_XSetLastRequestRead( - register Display *dpy, - register xGenericReply *rep) -{ - register unsigned long newseq, lastseq; - - lastseq = dpy->last_request_read; - /* - * KeymapNotify has no sequence number, but is always guaranteed - * to immediately follow another event, except when generated via - * SendEvent (hmmm). - */ - if ((rep->type & 0x7f) == KeymapNotify) - return(lastseq); - - newseq = (lastseq & ~((unsigned long)0xffff)) | rep->sequenceNumber; - - if (newseq < lastseq) { - newseq += 0x10000; - if (newseq > dpy->request) { - (void) fprintf (stderr, - "Xlib: sequence lost (0x%lx > 0x%lx) in reply type 0x%x!\n", - newseq, dpy->request, - (unsigned int) rep->type); - newseq -= 0x10000; - } - } - - dpy->last_request_read = newseq; - return(newseq); -} - -/* - * _XReply - Wait for a reply packet and copy its contents into the - * specified rep. Meanwhile we must handle error and event packets that - * we may encounter. - */ -Status -_XReply ( - register Display *dpy, - register xReply *rep, - int extra, /* number of 32-bit words expected after the reply */ - Bool discard) /* should I discard data following "extra" words? */ -{ - /* Pull out the serial number now, so that (currently illegal) requests - * generated by an error handler don't confuse us. - */ - unsigned long cur_request = dpy->request; -#ifdef XTHREADS - struct _XCVList *cvl; -#endif - - if (dpy->flags & XlibDisplayIOError) - return 0; - -#ifdef XTHREADS - /* create our condition variable and append to list */ - cvl = QueueReplyReaderLock(dpy); - if (cvl) { - cvl->buf = rep; - if (dpy->lock->reply_awaiters == cvl && !dpy->lock->event_awaiters) - dpy->lock->reply_first = True; - } - -#ifdef XTHREADS_DEBUG - printf("_XReply called in thread %x, adding %x to cvl\n", - XThread_Self(), cvl); -#endif - - _XFlushInt(dpy, cvl ? cvl->cv : NULL); - /* if it is not our turn to read a reply off the wire, - * wait til we're at head of list. if there is an event waiter, - * and our reply hasn't been read, they'll be in select and will - * hand control back to us next. - */ - if(dpy->lock && - (dpy->lock->reply_awaiters != cvl || !dpy->lock->reply_first)) { - ConditionWait(dpy, cvl->cv); - } - dpy->flags |= XlibDisplayReply; -#else /* XTHREADS else */ - _XFlush(dpy); -#endif - - for (;;) { -#ifdef XTHREADS - /* Did another thread's _XReadEvents get our reply by accident? */ - if (!dpy->lock || !dpy->lock->reply_was_read) -#endif - (void) _XRead(dpy, (char *)rep, (long)SIZEOF(xReply)); -#ifdef XTHREADS - if (dpy->lock) - dpy->lock->reply_was_read = False; -#endif - - switch ((int)rep->generic.type) { - - case X_Reply: - /* Reply received. Fast update for synchronous replies, - * but deal with multiple outstanding replies. - */ - if (rep->generic.sequenceNumber == (cur_request & 0xffff)) - dpy->last_request_read = cur_request; - else { - int pend = SIZEOF(xReply); - if (_XAsyncReply(dpy, rep, (char *)rep, &pend, False) - != (char *)rep) - continue; - } - if (extra <= rep->generic.length) { - if (extra > 0) - /* - * Read the extra data into storage immediately - * following the GenericReply structure. - */ - (void) _XRead (dpy, (char *) (NEXTPTR(rep,xReply)), - ((long)extra) << 2); - if (discard) { - if (extra < rep->generic.length) - _XEatData(dpy, (rep->generic.length - extra) << 2); - } -#ifdef XTHREADS - if (dpy->lock) { - if (discard) { - dpy->lock->reply_bytes_left = 0; - } else { - dpy->lock->reply_bytes_left = - (rep->generic.length - extra) << 2; - } - if (dpy->lock->reply_bytes_left == 0) { - dpy->flags &= ~XlibDisplayReply; - UnlockNextReplyReader(dpy); - } - } else - dpy->flags &= ~XlibDisplayReply; -#endif - return 1; - } - /* - *if we get here, then extra > rep->generic.length--meaning we - * read a reply that's shorter than we expected. This is an - * error, but we still need to figure out how to handle it... - */ - (void) _XRead (dpy, (char *) (NEXTPTR(rep,xReply)), - ((long) rep->generic.length) << 2); - dpy->flags &= ~XlibDisplayReply; - UnlockNextReplyReader(dpy); - _XIOError (dpy); - return (0); - - case X_Error: - { - register _XExtension *ext; - register Bool ret = False; - int ret_code; - xError *err = (xError *) rep; - unsigned long serial; - - dpy->flags &= ~XlibDisplayReply; - serial = _XSetLastRequestRead(dpy, (xGenericReply *)rep); - if (serial == cur_request) - /* do not die on "no such font", "can't allocate", - "can't grab" failures */ - switch ((int)err->errorCode) { - case BadName: - switch (err->majorCode) { - case X_LookupColor: - case X_AllocNamedColor: - UnlockNextReplyReader(dpy); - return(0); - } - break; - case BadFont: - if (err->majorCode == X_QueryFont) { - UnlockNextReplyReader(dpy); - return (0); - } - break; - case BadAlloc: - case BadAccess: - UnlockNextReplyReader(dpy); - return (0); - } - /* - * we better see if there is an extension who may - * want to suppress the error. - */ - for (ext = dpy->ext_procs; !ret && ext; ext = ext->next) { - if (ext->error) - ret = (*ext->error)(dpy, err, &ext->codes, &ret_code); - } - if (!ret) { - _XError(dpy, err); - ret_code = 0; - } - if (serial == cur_request) { - UnlockNextReplyReader(dpy); - return(ret_code); - } - - } /* case X_Error */ - break; - default: - _XEnq(dpy, (xEvent *) rep); -#ifdef XTHREADS - if (dpy->lock && dpy->lock->event_awaiters) - ConditionSignal(dpy, dpy->lock->event_awaiters->cv); -#endif - break; - } - } -} - -static char * -_XAsyncReply( - Display *dpy, - register xReply *rep, - char *buf, - register int *lenp, - Bool discard) -{ - register _XAsyncHandler *async, *next; - register int len; - register Bool consumed = False; - char *nbuf; - - (void) _XSetLastRequestRead(dpy, &rep->generic); - len = SIZEOF(xReply) + (rep->generic.length << 2); - if (len < SIZEOF(xReply)) { - _XIOError (dpy); - buf += *lenp; - *lenp = 0; - return buf; - } - - for (async = dpy->async_handlers; async; async = next) { - next = async->next; - if ((consumed = (*async->handler)(dpy, rep, buf, *lenp, async->data))) - break; - } - if (!consumed) { - if (!discard) - return buf; - (void) fprintf(stderr, - "Xlib: unexpected async reply (sequence 0x%lx)!\n", - dpy->last_request_read); -#ifdef XTHREADS -#ifdef XTHREADS_DEBUG - printf("thread %x, unexpected async reply\n", XThread_Self()); -#endif -#endif - if (len > *lenp) - _XEatData(dpy, len - *lenp); - } - if (len < SIZEOF(xReply)) - { - _XIOError (dpy); - buf += *lenp; - *lenp = 0; - return buf; - } - if (len >= *lenp) { - buf += *lenp; - *lenp = 0; - return buf; - } - *lenp -= len; - buf += len; - len = *lenp; - nbuf = buf; - while (len > SIZEOF(xReply)) { - if (*buf == X_Reply) - return nbuf; - buf += SIZEOF(xReply); - len -= SIZEOF(xReply); - } - if (len > 0 && len < SIZEOF(xReply)) { - buf = nbuf; - len = SIZEOF(xReply) - len; - nbuf -= len; - memmove(nbuf, buf, *lenp); - (void) _XRead(dpy, nbuf + *lenp, (long)len); - *lenp += len; - } - return nbuf; -} - -/* - * Support for internal connections, such as an IM might use. - * By Stephen Gildea, X Consortium, September 1993 - */ - -/* _XRegisterInternalConnection - * Each IM (or Xlib extension) that opens a file descriptor that Xlib should - * include in its select/poll mask must call this function to register the - * fd with Xlib. Any XConnectionWatchProc registered by XAddConnectionWatch - * will also be called. - * - * Whenever Xlib detects input available on fd, it will call callback - * with call_data to process it. If non-Xlib code calls select/poll - * and detects input available, it must call XProcessInternalConnection, - * which will call the associated callback. - * - * Non-Xlib code can learn about these additional fds by calling - * XInternalConnectionNumbers or, more typically, by registering - * a XConnectionWatchProc with XAddConnectionWatch - * to be called when fds are registered or unregistered. - * - * Returns True if registration succeeded, False if not, typically - * because could not allocate memory. - * Assumes Display locked when called. - */ -Status -_XRegisterInternalConnection( - Display* dpy, - int fd, - _XInternalConnectionProc callback, - XPointer call_data -) -{ - struct _XConnectionInfo *new_conni, **iptr; - struct _XConnWatchInfo *watchers; - XPointer *wd; - - new_conni = (struct _XConnectionInfo*)Xmalloc(sizeof(struct _XConnectionInfo)); - if (!new_conni) - return 0; - new_conni->watch_data = (XPointer *)Xmalloc(dpy->watcher_count * sizeof(XPointer)); - if (!new_conni->watch_data) { - Xfree(new_conni); - return 0; - } - new_conni->fd = fd; - new_conni->read_callback = callback; - new_conni->call_data = call_data; - new_conni->next = NULL; - /* link new structure onto end of list */ - for (iptr = &dpy->im_fd_info; *iptr; iptr = &(*iptr)->next) - ; - *iptr = new_conni; - dpy->im_fd_length++; - _XPollfdCacheAdd(dpy, fd); - - for (watchers=dpy->conn_watchers, wd=new_conni->watch_data; - watchers; - watchers=watchers->next, wd++) { - *wd = NULL; /* for cleanliness */ - (*watchers->fn) (dpy, watchers->client_data, fd, True, wd); - } - - return 1; -} - -/* _XUnregisterInternalConnection - * Each IM (or Xlib extension) that closes a file descriptor previously - * registered with _XRegisterInternalConnection must call this function. - * Any XConnectionWatchProc registered by XAddConnectionWatch - * will also be called. - * - * Assumes Display locked when called. - */ -void -_XUnregisterInternalConnection( - Display* dpy, - int fd -) -{ - struct _XConnectionInfo *info_list, **prev; - struct _XConnWatchInfo *watch; - XPointer *wd; - - for (prev = &dpy->im_fd_info; (info_list = *prev); - prev = &info_list->next) { - if (info_list->fd == fd) { - *prev = info_list->next; - dpy->im_fd_length--; - for (watch=dpy->conn_watchers, wd=info_list->watch_data; - watch; - watch=watch->next, wd++) { - (*watch->fn) (dpy, watch->client_data, fd, False, wd); - } - if (info_list->watch_data) - Xfree (info_list->watch_data); - Xfree (info_list); - break; - } - } - _XPollfdCacheDel(dpy, fd); -} - -/* XInternalConnectionNumbers - * Returns an array of fds and an array of corresponding call data. - * Typically a XConnectionWatchProc registered with XAddConnectionWatch - * will be used instead of this function to discover - * additional fds to include in the select/poll mask. - * - * The list is allocated with Xmalloc and should be freed by the caller - * with Xfree; - */ -Status -XInternalConnectionNumbers( - Display *dpy, - int **fd_return, - int *count_return -) -{ - int count; - struct _XConnectionInfo *info_list; - int *fd_list; - - LockDisplay(dpy); - count = 0; - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) - count++; - fd_list = (int*) Xmalloc (count * sizeof(int)); - if (!fd_list) { - UnlockDisplay(dpy); - return 0; - } - count = 0; - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) { - fd_list[count] = info_list->fd; - count++; - } - UnlockDisplay(dpy); - - *fd_return = fd_list; - *count_return = count; - return 1; -} - -static void _XProcessInternalConnection( - Display *dpy, - struct _XConnectionInfo *conn_info) -{ - dpy->flags |= XlibDisplayProcConni; -#ifdef XTHREADS - if (dpy->lock) { - /* check cache to avoid call to thread_self */ - if (xthread_have_id(dpy->lock->reading_thread)) - dpy->lock->conni_thread = dpy->lock->reading_thread; - else - dpy->lock->conni_thread = XThread_Self(); - } -#endif /* XTHREADS */ - UnlockDisplay(dpy); - (*conn_info->read_callback) (dpy, conn_info->fd, conn_info->call_data); - LockDisplay(dpy); -#ifdef XTHREADS - if (dpy->lock) - xthread_clear_id(dpy->lock->conni_thread); -#endif /* XTHREADS */ - dpy->flags &= ~XlibDisplayProcConni; -} - -/* XProcessInternalConnection - * Call the _XInternalConnectionProc registered by _XRegisterInternalConnection - * for this fd. - * The Display is NOT locked during the call. - */ -void -XProcessInternalConnection( - Display* dpy, - int fd -) -{ - struct _XConnectionInfo *info_list; - - LockDisplay(dpy); - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) { - if (info_list->fd == fd) { - _XProcessInternalConnection(dpy, info_list); - break; - } - } - UnlockDisplay(dpy); -} - -/* XAddConnectionWatch - * Register a callback to be called whenever _XRegisterInternalConnection - * or _XUnregisterInternalConnection is called. - * Callbacks are called with the Display locked. - * If any connections are already registered, the callback is immediately - * called for each of them. - */ -Status -XAddConnectionWatch( - Display* dpy, - XConnectionWatchProc callback, - XPointer client_data -) -{ - struct _XConnWatchInfo *new_watcher, **wptr; - struct _XConnectionInfo *info_list; - XPointer *wd_array; - - LockDisplay(dpy); - - /* allocate new watch data */ - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) { - wd_array = (XPointer *)Xrealloc((char *)info_list->watch_data, - (dpy->watcher_count + 1) * - sizeof(XPointer)); - if (!wd_array) { - UnlockDisplay(dpy); - return 0; - } - wd_array[dpy->watcher_count] = NULL; /* for cleanliness */ - } - - new_watcher = (struct _XConnWatchInfo*)Xmalloc(sizeof(struct _XConnWatchInfo)); - if (!new_watcher) { - UnlockDisplay(dpy); - return 0; - } - new_watcher->fn = callback; - new_watcher->client_data = client_data; - new_watcher->next = NULL; - - /* link new structure onto end of list */ - for (wptr = &dpy->conn_watchers; *wptr; wptr = &(*wptr)->next) - ; - *wptr = new_watcher; - dpy->watcher_count++; - - /* call new watcher on all currently registered fds */ - for (info_list=dpy->im_fd_info; info_list; info_list=info_list->next) { - (*callback) (dpy, client_data, info_list->fd, True, - info_list->watch_data + dpy->watcher_count - 1); - } - - UnlockDisplay(dpy); - return 1; -} - -/* XRemoveConnectionWatch - * Unregister a callback registered by XAddConnectionWatch. - * Both callback and client_data must match what was passed to - * XAddConnectionWatch. - */ -void -XRemoveConnectionWatch( - Display* dpy, - XConnectionWatchProc callback, - XPointer client_data -) -{ - struct _XConnWatchInfo *watch; - struct _XConnWatchInfo *previous = NULL; - struct _XConnectionInfo *conni; - int counter = 0; - - LockDisplay(dpy); - for (watch=dpy->conn_watchers; watch; watch=watch->next) { - if (watch->fn == callback && watch->client_data == client_data) { - if (previous) - previous->next = watch->next; - else - dpy->conn_watchers = watch->next; - Xfree (watch); - dpy->watcher_count--; - /* remove our watch_data for each connection */ - for (conni=dpy->im_fd_info; conni; conni=conni->next) { - /* don't bother realloc'ing; these arrays are small anyway */ - /* overlapping */ - memmove(conni->watch_data+counter, - conni->watch_data+counter+1, - dpy->watcher_count - counter); - } - break; - } - previous = watch; - counter++; - } - UnlockDisplay(dpy); -} - -/* end of internal connections support */ - - -/* Read and discard "n" 8-bit bytes of data */ - -void _XEatData( - Display *dpy, - register unsigned long n) -{ -#define SCRATCHSIZE 2048 - char buf[SCRATCHSIZE]; - - while (n > 0) { - register long bytes_read = (n > SCRATCHSIZE) ? SCRATCHSIZE : n; - (void) _XRead (dpy, buf, bytes_read); - n -= bytes_read; - } -#undef SCRATCHSIZE -} - - -/* - * _XEnq - Place event packets on the display's queue. - * note that no squishing of move events in V11, since there - * is pointer motion hints.... - */ -void _XEnq( - register Display *dpy, - register xEvent *event) -{ - register _XQEvent *qelt; - - if ((qelt = dpy->qfree)) { - /* If dpy->qfree is non-NULL do this, else malloc a new one. */ - dpy->qfree = qelt->next; - } - else if ((qelt = - (_XQEvent *) Xmalloc((unsigned)sizeof(_XQEvent))) == NULL) { - /* Malloc call failed! */ - ESET(ENOMEM); - _XIOError(dpy); - } - qelt->next = NULL; - /* go call through display to find proper event reformatter */ - if ((*dpy->event_vec[event->u.u.type & 0177])(dpy, &qelt->event, event)) { - qelt->qserial_num = dpy->next_event_serial_num++; - if (dpy->tail) dpy->tail->next = qelt; - else dpy->head = qelt; - - dpy->tail = qelt; - dpy->qlen++; - } else { - /* ignored, or stashed away for many-to-one compression */ - qelt->next = dpy->qfree; - dpy->qfree = qelt; - } -} - -/* - * _XDeq - Remove event packet from the display's queue. - */ -void _XDeq( - register Display *dpy, - register _XQEvent *prev, /* element before qelt */ - register _XQEvent *qelt) /* element to be unlinked */ -{ - if (prev) { - if ((prev->next = qelt->next) == NULL) - dpy->tail = prev; - } else { - /* no prev, so removing first elt */ - if ((dpy->head = qelt->next) == NULL) - dpy->tail = NULL; - } - qelt->qserial_num = 0; - qelt->next = dpy->qfree; - dpy->qfree = qelt; - dpy->qlen--; -} - -/* - * EventToWire in separate file in that often not needed. - */ - -/*ARGSUSED*/ -Bool -_XUnknownWireEvent( - register Display *dpy, /* pointer to display structure */ - register XEvent *re, /* pointer to where event should be reformatted */ - register xEvent *event) /* wire protocol event */ -{ -#ifdef notdef - (void) fprintf(stderr, - "Xlib: unhandled wire event! event number = %d, display = %x\n.", - event->u.u.type, dpy); -#endif - return(False); -} - -/*ARGSUSED*/ -Status -_XUnknownNativeEvent( - register Display *dpy, /* pointer to display structure */ - register XEvent *re, /* pointer to where event should be reformatted */ - register xEvent *event) /* wire protocol event */ -{ -#ifdef notdef - (void) fprintf(stderr, - "Xlib: unhandled native event! event number = %d, display = %x\n.", - re->type, dpy); -#endif - return(0); -} -/* - * reformat a wire event into an XEvent structure of the right type. - */ -Bool -_XWireToEvent( - register Display *dpy, /* pointer to display structure */ - register XEvent *re, /* pointer to where event should be reformatted */ - register xEvent *event) /* wire protocol event */ -{ - - re->type = event->u.u.type & 0x7f; - ((XAnyEvent *)re)->serial = _XSetLastRequestRead(dpy, - (xGenericReply *)event); - ((XAnyEvent *)re)->send_event = ((event->u.u.type & 0x80) != 0); - ((XAnyEvent *)re)->display = dpy; - - /* Ignore the leading bit of the event type since it is set when a - client sends an event rather than the server. */ - - switch (event-> u.u.type & 0177) { - case KeyPress: - case KeyRelease: - { - register XKeyEvent *ev = (XKeyEvent*) re; - ev->root = event->u.keyButtonPointer.root; - ev->window = event->u.keyButtonPointer.event; - ev->subwindow = event->u.keyButtonPointer.child; - ev->time = event->u.keyButtonPointer.time; - ev->x = cvtINT16toInt(event->u.keyButtonPointer.eventX); - ev->y = cvtINT16toInt(event->u.keyButtonPointer.eventY); - ev->x_root = cvtINT16toInt(event->u.keyButtonPointer.rootX); - ev->y_root = cvtINT16toInt(event->u.keyButtonPointer.rootY); - ev->state = event->u.keyButtonPointer.state; - ev->same_screen = event->u.keyButtonPointer.sameScreen; - ev->keycode = event->u.u.detail; - } - break; - case ButtonPress: - case ButtonRelease: - { - register XButtonEvent *ev = (XButtonEvent *) re; - ev->root = event->u.keyButtonPointer.root; - ev->window = event->u.keyButtonPointer.event; - ev->subwindow = event->u.keyButtonPointer.child; - ev->time = event->u.keyButtonPointer.time; - ev->x = cvtINT16toInt(event->u.keyButtonPointer.eventX); - ev->y = cvtINT16toInt(event->u.keyButtonPointer.eventY); - ev->x_root = cvtINT16toInt(event->u.keyButtonPointer.rootX); - ev->y_root = cvtINT16toInt(event->u.keyButtonPointer.rootY); - ev->state = event->u.keyButtonPointer.state; - ev->same_screen = event->u.keyButtonPointer.sameScreen; - ev->button = event->u.u.detail; - } - break; - case MotionNotify: - { - register XMotionEvent *ev = (XMotionEvent *)re; - ev->root = event->u.keyButtonPointer.root; - ev->window = event->u.keyButtonPointer.event; - ev->subwindow = event->u.keyButtonPointer.child; - ev->time = event->u.keyButtonPointer.time; - ev->x = cvtINT16toInt(event->u.keyButtonPointer.eventX); - ev->y = cvtINT16toInt(event->u.keyButtonPointer.eventY); - ev->x_root = cvtINT16toInt(event->u.keyButtonPointer.rootX); - ev->y_root = cvtINT16toInt(event->u.keyButtonPointer.rootY); - ev->state = event->u.keyButtonPointer.state; - ev->same_screen = event->u.keyButtonPointer.sameScreen; - ev->is_hint = event->u.u.detail; - } - break; - case EnterNotify: - case LeaveNotify: - { - register XCrossingEvent *ev = (XCrossingEvent *) re; - ev->root = event->u.enterLeave.root; - ev->window = event->u.enterLeave.event; - ev->subwindow = event->u.enterLeave.child; - ev->time = event->u.enterLeave.time; - ev->x = cvtINT16toInt(event->u.enterLeave.eventX); - ev->y = cvtINT16toInt(event->u.enterLeave.eventY); - ev->x_root = cvtINT16toInt(event->u.enterLeave.rootX); - ev->y_root = cvtINT16toInt(event->u.enterLeave.rootY); - ev->state = event->u.enterLeave.state; - ev->mode = event->u.enterLeave.mode; - ev->same_screen = (event->u.enterLeave.flags & - ELFlagSameScreen) && True; - ev->focus = (event->u.enterLeave.flags & - ELFlagFocus) && True; - ev->detail = event->u.u.detail; - } - break; - case FocusIn: - case FocusOut: - { - register XFocusChangeEvent *ev = (XFocusChangeEvent *) re; - ev->window = event->u.focus.window; - ev->mode = event->u.focus.mode; - ev->detail = event->u.u.detail; - } - break; - case KeymapNotify: - { - register XKeymapEvent *ev = (XKeymapEvent *) re; - ev->window = None; - memcpy(&ev->key_vector[1], - (char *)((xKeymapEvent *) event)->map, - sizeof (((xKeymapEvent *) event)->map)); - } - break; - case Expose: - { - register XExposeEvent *ev = (XExposeEvent *) re; - ev->window = event->u.expose.window; - ev->x = event->u.expose.x; - ev->y = event->u.expose.y; - ev->width = event->u.expose.width; - ev->height = event->u.expose.height; - ev->count = event->u.expose.count; - } - break; - case GraphicsExpose: - { - register XGraphicsExposeEvent *ev = - (XGraphicsExposeEvent *) re; - ev->drawable = event->u.graphicsExposure.drawable; - ev->x = event->u.graphicsExposure.x; - ev->y = event->u.graphicsExposure.y; - ev->width = event->u.graphicsExposure.width; - ev->height = event->u.graphicsExposure.height; - ev->count = event->u.graphicsExposure.count; - ev->major_code = event->u.graphicsExposure.majorEvent; - ev->minor_code = event->u.graphicsExposure.minorEvent; - } - break; - case NoExpose: - { - register XNoExposeEvent *ev = (XNoExposeEvent *) re; - ev->drawable = event->u.noExposure.drawable; - ev->major_code = event->u.noExposure.majorEvent; - ev->minor_code = event->u.noExposure.minorEvent; - } - break; - case VisibilityNotify: - { - register XVisibilityEvent *ev = (XVisibilityEvent *) re; - ev->window = event->u.visibility.window; - ev->state = event->u.visibility.state; - } - break; - case CreateNotify: - { - register XCreateWindowEvent *ev = - (XCreateWindowEvent *) re; - ev->window = event->u.createNotify.window; - ev->parent = event->u.createNotify.parent; - ev->x = cvtINT16toInt(event->u.createNotify.x); - ev->y = cvtINT16toInt(event->u.createNotify.y); - ev->width = event->u.createNotify.width; - ev->height = event->u.createNotify.height; - ev->border_width = event->u.createNotify.borderWidth; - ev->override_redirect = event->u.createNotify.override; - } - break; - case DestroyNotify: - { - register XDestroyWindowEvent *ev = - (XDestroyWindowEvent *) re; - ev->window = event->u.destroyNotify.window; - ev->event = event->u.destroyNotify.event; - } - break; - case UnmapNotify: - { - register XUnmapEvent *ev = (XUnmapEvent *) re; - ev->window = event->u.unmapNotify.window; - ev->event = event->u.unmapNotify.event; - ev->from_configure = event->u.unmapNotify.fromConfigure; - } - break; - case MapNotify: - { - register XMapEvent *ev = (XMapEvent *) re; - ev->window = event->u.mapNotify.window; - ev->event = event->u.mapNotify.event; - ev->override_redirect = event->u.mapNotify.override; - } - break; - case MapRequest: - { - register XMapRequestEvent *ev = (XMapRequestEvent *) re; - ev->window = event->u.mapRequest.window; - ev->parent = event->u.mapRequest.parent; - } - break; - case ReparentNotify: - { - register XReparentEvent *ev = (XReparentEvent *) re; - ev->event = event->u.reparent.event; - ev->window = event->u.reparent.window; - ev->parent = event->u.reparent.parent; - ev->x = cvtINT16toInt(event->u.reparent.x); - ev->y = cvtINT16toInt(event->u.reparent.y); - ev->override_redirect = event->u.reparent.override; - } - break; - case ConfigureNotify: - { - register XConfigureEvent *ev = (XConfigureEvent *) re; - ev->event = event->u.configureNotify.event; - ev->window = event->u.configureNotify.window; - ev->above = event->u.configureNotify.aboveSibling; - ev->x = cvtINT16toInt(event->u.configureNotify.x); - ev->y = cvtINT16toInt(event->u.configureNotify.y); - ev->width = event->u.configureNotify.width; - ev->height = event->u.configureNotify.height; - ev->border_width = event->u.configureNotify.borderWidth; - ev->override_redirect = event->u.configureNotify.override; - } - break; - case ConfigureRequest: - { - register XConfigureRequestEvent *ev = - (XConfigureRequestEvent *) re; - ev->window = event->u.configureRequest.window; - ev->parent = event->u.configureRequest.parent; - ev->above = event->u.configureRequest.sibling; - ev->x = cvtINT16toInt(event->u.configureRequest.x); - ev->y = cvtINT16toInt(event->u.configureRequest.y); - ev->width = event->u.configureRequest.width; - ev->height = event->u.configureRequest.height; - ev->border_width = event->u.configureRequest.borderWidth; - ev->value_mask = event->u.configureRequest.valueMask; - ev->detail = event->u.u.detail; - } - break; - case GravityNotify: - { - register XGravityEvent *ev = (XGravityEvent *) re; - ev->window = event->u.gravity.window; - ev->event = event->u.gravity.event; - ev->x = cvtINT16toInt(event->u.gravity.x); - ev->y = cvtINT16toInt(event->u.gravity.y); - } - break; - case ResizeRequest: - { - register XResizeRequestEvent *ev = - (XResizeRequestEvent *) re; - ev->window = event->u.resizeRequest.window; - ev->width = event->u.resizeRequest.width; - ev->height = event->u.resizeRequest.height; - } - break; - case CirculateNotify: - { - register XCirculateEvent *ev = (XCirculateEvent *) re; - ev->window = event->u.circulate.window; - ev->event = event->u.circulate.event; - ev->place = event->u.circulate.place; - } - break; - case CirculateRequest: - { - register XCirculateRequestEvent *ev = - (XCirculateRequestEvent *) re; - ev->window = event->u.circulate.window; - ev->parent = event->u.circulate.event; - ev->place = event->u.circulate.place; - } - break; - case PropertyNotify: - { - register XPropertyEvent *ev = (XPropertyEvent *) re; - ev->window = event->u.property.window; - ev->atom = event->u.property.atom; - ev->time = event->u.property.time; - ev->state = event->u.property.state; - } - break; - case SelectionClear: - { - register XSelectionClearEvent *ev = - (XSelectionClearEvent *) re; - ev->window = event->u.selectionClear.window; - ev->selection = event->u.selectionClear.atom; - ev->time = event->u.selectionClear.time; - } - break; - case SelectionRequest: - { - register XSelectionRequestEvent *ev = - (XSelectionRequestEvent *) re; - ev->owner = event->u.selectionRequest.owner; - ev->requestor = event->u.selectionRequest.requestor; - ev->selection = event->u.selectionRequest.selection; - ev->target = event->u.selectionRequest.target; - ev->property = event->u.selectionRequest.property; - ev->time = event->u.selectionRequest.time; - } - break; - case SelectionNotify: - { - register XSelectionEvent *ev = (XSelectionEvent *) re; - ev->requestor = event->u.selectionNotify.requestor; - ev->selection = event->u.selectionNotify.selection; - ev->target = event->u.selectionNotify.target; - ev->property = event->u.selectionNotify.property; - ev->time = event->u.selectionNotify.time; - } - break; - case ColormapNotify: - { - register XColormapEvent *ev = (XColormapEvent *) re; - ev->window = event->u.colormap.window; - ev->colormap = event->u.colormap.colormap; - ev->new = event->u.colormap.new; - ev->state = event->u.colormap.state; - } - break; - case ClientMessage: - { - register int i; - register XClientMessageEvent *ev - = (XClientMessageEvent *) re; - ev->window = event->u.clientMessage.window; - ev->format = event->u.u.detail; - switch (ev->format) { - case 8: - ev->message_type = event->u.clientMessage.u.b.type; - for (i = 0; i < 20; i++) - ev->data.b[i] = event->u.clientMessage.u.b.bytes[i]; - break; - case 16: - ev->message_type = event->u.clientMessage.u.s.type; - ev->data.s[0] = cvtINT16toShort(event->u.clientMessage.u.s.shorts0); - ev->data.s[1] = cvtINT16toShort(event->u.clientMessage.u.s.shorts1); - ev->data.s[2] = cvtINT16toShort(event->u.clientMessage.u.s.shorts2); - ev->data.s[3] = cvtINT16toShort(event->u.clientMessage.u.s.shorts3); - ev->data.s[4] = cvtINT16toShort(event->u.clientMessage.u.s.shorts4); - ev->data.s[5] = cvtINT16toShort(event->u.clientMessage.u.s.shorts5); - ev->data.s[6] = cvtINT16toShort(event->u.clientMessage.u.s.shorts6); - ev->data.s[7] = cvtINT16toShort(event->u.clientMessage.u.s.shorts7); - ev->data.s[8] = cvtINT16toShort(event->u.clientMessage.u.s.shorts8); - ev->data.s[9] = cvtINT16toShort(event->u.clientMessage.u.s.shorts9); - break; - case 32: - ev->message_type = event->u.clientMessage.u.l.type; - ev->data.l[0] = cvtINT32toLong(event->u.clientMessage.u.l.longs0); - ev->data.l[1] = cvtINT32toLong(event->u.clientMessage.u.l.longs1); - ev->data.l[2] = cvtINT32toLong(event->u.clientMessage.u.l.longs2); - ev->data.l[3] = cvtINT32toLong(event->u.clientMessage.u.l.longs3); - ev->data.l[4] = cvtINT32toLong(event->u.clientMessage.u.l.longs4); - break; - default: /* XXX should never occur */ - break; - } - } - break; - case MappingNotify: - { - register XMappingEvent *ev = (XMappingEvent *)re; - ev->window = 0; - ev->first_keycode = event->u.mappingNotify.firstKeyCode; - ev->request = event->u.mappingNotify.request; - ev->count = event->u.mappingNotify.count; - } - break; - default: - return(_XUnknownWireEvent(dpy, re, event)); - } - return(True); -} - - -/* - * _XDefaultIOError - Default fatal system error reporting routine. Called - * when an X internal system error is encountered. - */ -int _XDefaultIOError( - Display *dpy) -{ - if (ECHECK(EPIPE)) { - (void) fprintf (stderr, - "X connection to %s broken (explicit kill or server shutdown).\r\n", - DisplayString (dpy)); - } else { - (void) fprintf (stderr, - "XIO: fatal IO error %d (%s) on X server \"%s\"\r\n", -#ifdef WIN32 - WSAGetLastError(), strerror(WSAGetLastError()), -#else - errno, strerror (errno), -#endif - DisplayString (dpy)); - (void) fprintf (stderr, - " after %lu requests (%lu known processed) with %d events remaining.\r\n", - NextRequest(dpy) - 1, LastKnownRequestProcessed(dpy), - QLength(dpy)); - - } - exit(1); - return(0); /* dummy - function should never return */ -} - - -static int _XPrintDefaultError( - Display *dpy, - XErrorEvent *event, - FILE *fp) -{ - char buffer[BUFSIZ]; - char mesg[BUFSIZ]; - char number[32]; - char *mtype = "XlibMessage"; - register _XExtension *ext = (_XExtension *)NULL; - _XExtension *bext = (_XExtension *)NULL; - XGetErrorText(dpy, event->error_code, buffer, BUFSIZ); - XGetErrorDatabaseText(dpy, mtype, "XError", "X Error", mesg, BUFSIZ); - (void) fprintf(fp, "%s: %s\n ", mesg, buffer); - XGetErrorDatabaseText(dpy, mtype, "MajorCode", "Request Major code %d", - mesg, BUFSIZ); - (void) fprintf(fp, mesg, event->request_code); - if (event->request_code < 128) { - sprintf(number, "%d", event->request_code); - XGetErrorDatabaseText(dpy, "XRequest", number, "", buffer, BUFSIZ); - } else { - for (ext = dpy->ext_procs; - ext && (ext->codes.major_opcode != event->request_code); - ext = ext->next) - ; - if (ext) - strcpy(buffer, ext->name); - else - buffer[0] = '\0'; - } - (void) fprintf(fp, " (%s)\n", buffer); - if (event->request_code >= 128) { - XGetErrorDatabaseText(dpy, mtype, "MinorCode", "Request Minor code %d", - mesg, BUFSIZ); - fputs(" ", fp); - (void) fprintf(fp, mesg, event->minor_code); - if (ext) { - sprintf(mesg, "%s.%d", ext->name, event->minor_code); - XGetErrorDatabaseText(dpy, "XRequest", mesg, "", buffer, BUFSIZ); - (void) fprintf(fp, " (%s)", buffer); - } - fputs("\n", fp); - } - if (event->error_code >= 128) { - /* kludge, try to find the extension that caused it */ - buffer[0] = '\0'; - for (ext = dpy->ext_procs; ext; ext = ext->next) { - if (ext->error_string) - (*ext->error_string)(dpy, event->error_code, &ext->codes, - buffer, BUFSIZ); - if (buffer[0]) { - bext = ext; - break; - } - if (ext->codes.first_error && - ext->codes.first_error < (int)event->error_code && - (!bext || ext->codes.first_error > bext->codes.first_error)) - bext = ext; - } - if (bext) - sprintf(buffer, "%s.%d", bext->name, - event->error_code - bext->codes.first_error); - else - strcpy(buffer, "Value"); - XGetErrorDatabaseText(dpy, mtype, buffer, "", mesg, BUFSIZ); - if (mesg[0]) { - fputs(" ", fp); - (void) fprintf(fp, mesg, event->resourceid); - fputs("\n", fp); - } - /* let extensions try to print the values */ - for (ext = dpy->ext_procs; ext; ext = ext->next) { - if (ext->error_values) - (*ext->error_values)(dpy, event, fp); - } - } else if ((event->error_code == BadWindow) || - (event->error_code == BadPixmap) || - (event->error_code == BadCursor) || - (event->error_code == BadFont) || - (event->error_code == BadDrawable) || - (event->error_code == BadColor) || - (event->error_code == BadGC) || - (event->error_code == BadIDChoice) || - (event->error_code == BadValue) || - (event->error_code == BadAtom)) { - if (event->error_code == BadValue) - XGetErrorDatabaseText(dpy, mtype, "Value", "Value 0x%x", - mesg, BUFSIZ); - else if (event->error_code == BadAtom) - XGetErrorDatabaseText(dpy, mtype, "AtomID", "AtomID 0x%x", - mesg, BUFSIZ); - else - XGetErrorDatabaseText(dpy, mtype, "ResourceID", "ResourceID 0x%x", - mesg, BUFSIZ); - fputs(" ", fp); - (void) fprintf(fp, mesg, event->resourceid); - fputs("\n", fp); - } - XGetErrorDatabaseText(dpy, mtype, "ErrorSerial", "Error Serial #%d", - mesg, BUFSIZ); - fputs(" ", fp); - (void) fprintf(fp, mesg, event->serial); - XGetErrorDatabaseText(dpy, mtype, "CurrentSerial", "Current Serial #%d", - mesg, BUFSIZ); - fputs("\n ", fp); - (void) fprintf(fp, mesg, dpy->request); - fputs("\n", fp); - if (event->error_code == BadImplementation) return 0; - return 1; -} - -int _XDefaultError( - Display *dpy, - XErrorEvent *event) -{ - if (_XPrintDefaultError (dpy, event, stderr) == 0) return 0; - exit(1); - /*NOTREACHED*/ -} - -/*ARGSUSED*/ -Bool _XDefaultWireError(display, he, we) - Display *display; - XErrorEvent *he; - xError *we; -{ - return True; -} - -/* - * _XError - upcall internal or user protocol error handler - */ -int _XError ( - Display *dpy, - register xError *rep) -{ - /* - * X_Error packet encountered! We need to unpack the error before - * giving it to the user. - */ - XEvent event; /* make it a large event */ - register _XAsyncHandler *async, *next; - - event.xerror.serial = _XSetLastRequestRead(dpy, (xGenericReply *)rep); - - for (async = dpy->async_handlers; async; async = next) { - next = async->next; - if ((*async->handler)(dpy, (xReply *)rep, - (char *)rep, SIZEOF(xError), async->data)) - return 0; - } - - event.xerror.display = dpy; - event.xerror.type = X_Error; - event.xerror.resourceid = rep->resourceID; - event.xerror.error_code = rep->errorCode; - event.xerror.request_code = rep->majorCode; - event.xerror.minor_code = rep->minorCode; - if (dpy->error_vec && - !(*dpy->error_vec[rep->errorCode])(dpy, &event.xerror, rep)) - return 0; - if (_XErrorFunction != NULL) { - int rtn_val; -#ifdef XTHREADS - if (dpy->lock) - (*dpy->lock->user_lock_display)(dpy); - UnlockDisplay(dpy); -#endif /* XTHREADS */ - rtn_val = (*_XErrorFunction)(dpy, (XErrorEvent *)&event); /* upcall */ -#ifdef XTHREADS - LockDisplay(dpy); - if (dpy->lock) - (*dpy->lock->user_unlock_display)(dpy); -#endif /* XTHREADS */ - return rtn_val; - } else { - return _XDefaultError(dpy, (XErrorEvent *)&event); - } -} - -/* - * _XIOError - call user connection error handler and exit - */ -int -_XIOError ( - Display *dpy) -{ - dpy->flags |= XlibDisplayIOError; -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - - if (_XIOErrorFunction != NULL) - (*_XIOErrorFunction)(dpy); - else - _XDefaultIOError(dpy); - exit (1); - return 0; -} - - -/* - * This routine can be used to (cheaply) get some memory within a single - * Xlib routine for scratch space. A single buffer is reused each time - * if possible. To be MT safe, you can only call this between a call to - * GetReq* and a call to Data* or _XSend*, or in a context when the thread - * is guaranteed to not unlock the display. - */ -char *_XAllocScratch( - register Display *dpy, - unsigned long nbytes) -{ - if (nbytes > dpy->scratch_length) { - if (dpy->scratch_buffer) Xfree (dpy->scratch_buffer); - if ((dpy->scratch_buffer = Xmalloc((unsigned) nbytes))) - dpy->scratch_length = nbytes; - else dpy->scratch_length = 0; - } - return (dpy->scratch_buffer); -} - -/* - * Scratch space allocator you can call any time, multiple times, and be - * MT safe, but you must hand the buffer back with _XFreeTemp. - */ -char *_XAllocTemp( - register Display *dpy, - unsigned long nbytes) -{ - char *buf; - - buf = _XAllocScratch(dpy, nbytes); - dpy->scratch_buffer = NULL; - dpy->scratch_length = 0; - return buf; -} - -void _XFreeTemp( - register Display *dpy, - char *buf, - unsigned long nbytes) -{ - if (dpy->scratch_buffer) - Xfree(dpy->scratch_buffer); - dpy->scratch_buffer = buf; - dpy->scratch_length = nbytes; -} - -/* - * Given a visual id, find the visual structure for this id on this display. - */ -Visual *_XVIDtoVisual( - Display *dpy, - VisualID id) -{ - register int i, j, k; - register Screen *sp; - register Depth *dp; - register Visual *vp; - for (i = 0; i < dpy->nscreens; i++) { - sp = &dpy->screens[i]; - for (j = 0; j < sp->ndepths; j++) { - dp = &sp->depths[j]; - /* if nvisuals == 0 then visuals will be NULL */ - for (k = 0; k < dp->nvisuals; k++) { - vp = &dp->visuals[k]; - if (vp->visualid == id) return (vp); - } - } - } - return (NULL); -} - -int -XFree (void *data) -{ - Xfree (data); - return 1; -} - -#ifdef _XNEEDBCOPYFUNC -void _Xbcopy(b1, b2, length) - register char *b1, *b2; - register length; -{ - if (b1 < b2) { - b2 += length; - b1 += length; - while (length--) - *--b2 = *--b1; - } else { - while (length--) - *b2++ = *b1++; - } -} -#endif - -#ifdef DataRoutineIsProcedure -void Data( - Display *dpy, - char *data, - long len) -{ - if (dpy->bufptr + (len) <= dpy->bufmax) { - memcpy(dpy->bufptr, data, (int)len); - dpy->bufptr += ((len) + 3) & ~3; - } else { - _XSend(dpy, data, len); - } -} -#endif /* DataRoutineIsProcedure */ - - -#ifdef LONG64 -int -_XData32( - Display *dpy, - register long *data, - unsigned len) -{ - register int *buf; - register long i; - - while (len) { - buf = (int *)dpy->bufptr; - i = dpy->bufmax - (char *)buf; - if (!i) { - _XFlush(dpy); - continue; - } - if (len < i) - i = len; - dpy->bufptr = (char *)buf + i; - len -= i; - i >>= 2; - while (--i >= 0) - *buf++ = *data++; - } - return 0; -} -#endif /* LONG64 */ - -#ifdef WORD64 - -/* - * XXX This is a *really* stupid way of doing this. It should just use - * dpy->bufptr directly, taking into account where in the word it is. - */ - -/* - * Data16 - Place 16 bit data in the buffer. - * - * "dpy" is a pointer to a Display. - * "data" is a pointer to the data. - * "len" is the length in bytes of the data. - */ - -static doData16( - register Display *dpy, - short *data, - unsigned len, - char *packbuffer) -{ - long *lp,*lpack; - long i, nwords,bits; - long mask16 = 0x000000000000ffff; - - lp = (long *)data; - lpack = (long *)packbuffer; - -/* nwords is the number of 16 bit values to be packed, - * the low order 16 bits of each word will be packed - * into 64 bit words - */ - nwords = len >> 1; - bits = 48; - - for(i=0;i> 1; - - for (; len > PACKBUFFERSIZE; len -= PACKBUFFERSIZE, data += nunits) { - doData16 (dpy, data, PACKBUFFERSIZE, packbuffer); - } - if (len) doData16 (dpy, data, len, packbuffer); -} - -/* - * Data32 - Place 32 bit data in the buffer. - * - * "dpy" is a pointer to a Display. - * "data" is a pointer to the data. - * "len" is the length in bytes of the data. - */ - -static doData32( - register Display *dpy - long *data, - unsigned len, - char *packbuffer) -{ - long *lp,*lpack; - long i,bits,nwords; - long mask32 = 0x00000000ffffffff; - - lpack = (long *) packbuffer; - lp = data; - -/* nwords is the number of 32 bit values to be packed - * the low order 32 bits of each word will be packed - * into 64 bit words - */ - nwords = len >> 2; - bits = 32; - - for(i=0;i> 2; - - for (; len > PACKBUFFERSIZE; len -= PACKBUFFERSIZE, data += nunits) { - doData32 (dpy, data, PACKBUFFERSIZE, packbuffer); - } - if (len) doData32 (dpy, data, len, packbuffer); -} - -#endif /* WORD64 */ - - -/* Make sure this produces the same string as DefineLocal/DefineSelf in xdm. - * Otherwise, Xau will not be able to find your cookies in the Xauthority file. - * - * Note: POSIX says that the ``nodename'' member of utsname does _not_ have - * to have sufficient information for interfacing to the network, - * and so, you may be better off using gethostname (if it exists). - */ - -#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) -#define NEED_UTSNAME -#include -#endif - -/* - * _XGetHostname - similar to gethostname but allows special processing. - */ -int _XGetHostname ( - char *buf, - int maxlen) -{ - int len; - -#ifdef NEED_UTSNAME - struct utsname name; - - if (maxlen <= 0 || buf == NULL) - return 0; - - uname (&name); - len = strlen (name.nodename); - if (len >= maxlen) len = maxlen - 1; - strncpy (buf, name.nodename, len); - buf[len] = '\0'; -#else - if (maxlen <= 0 || buf == NULL) - return 0; - - buf[0] = '\0'; - (void) gethostname (buf, maxlen); - buf [maxlen - 1] = '\0'; - len = strlen(buf); -#endif /* NEED_UTSNAME */ - return len; -} - - -/* - * _XScreenOfWindow - get the Screen of a given window - */ - -Screen *_XScreenOfWindow (dpy, w) - Display *dpy; - Window w; -{ - register int i; - Window root; - int x, y; /* dummy variables */ - unsigned int width, height, bw, depth; /* dummy variables */ - - if (XGetGeometry (dpy, w, &root, &x, &y, &width, &height, - &bw, &depth) == False) { - return None; - } - for (i = 0; i < ScreenCount (dpy); i++) { /* find root from list */ - if (root == RootWindow (dpy, i)) { - return ScreenOfDisplay (dpy, i); - } - } - return NULL; -} - - -#if defined(WIN32) - -/* - * These functions are intended to be used internally to Xlib only. - * These functions will always prefix the path with a DOS drive in the - * form ":". As such, these functions are only suitable - * for use by Xlib function that supply a root-based path to some - * particular file, e.g. /lib/X11/locale/locale.dir will - * be converted to "C:/usr/X11R6.3/lib/X11/locale/locale.dir". - */ - -static int access_file (path, pathbuf, len_pathbuf, pathret) - char* path; - char* pathbuf; - int len_pathbuf; - char** pathret; -{ - if (access (path, F_OK) == 0) { - if (strlen (path) < len_pathbuf) - *pathret = pathbuf; - else - *pathret = Xmalloc (strlen (path) + 1); - if (*pathret) { - strcpy (*pathret, path); - return 1; - } - } - return 0; -} - -static int AccessFile (path, pathbuf, len_pathbuf, pathret) - char* path; - char* pathbuf; - int len_pathbuf; - char** pathret; -{ - unsigned long drives; - int i, len; - char* drive; - char buf[MAX_PATH]; - char* bufp; - - /* just try the "raw" name first and see if it works */ - if (access_file (path, pathbuf, len_pathbuf, pathret)) - return 1; - - /* try the places set in the environment */ - drive = getenv ("_XBASEDRIVE"); -#ifdef __UNIXOS2__ - if (!drive) - drive = getenv ("X11ROOT"); -#endif - if (!drive) - drive = "C:"; - len = strlen (drive) + strlen (path); - if (len < MAX_PATH) bufp = buf; - else bufp = Xmalloc (len + 1); - strcpy (bufp, drive); - strcat (bufp, path); - if (access_file (bufp, pathbuf, len_pathbuf, pathret)) { - if (bufp != buf) Xfree (bufp); - return 1; - } - -#ifndef __UNIXOS2__ - /* one last place to look */ - drive = getenv ("HOMEDRIVE"); - if (drive) { - len = strlen (drive) + strlen (path); - if (len < MAX_PATH) bufp = buf; - else bufp = Xmalloc (len + 1); - strcpy (bufp, drive); - strcat (bufp, path); - if (access_file (bufp, pathbuf, len_pathbuf, pathret)) { - if (bufp != buf) Xfree (bufp); - return 1; - } - } - - /* tried everywhere else, go fishing */ -#define C_DRIVE ('C' - 'A') -#define Z_DRIVE ('Z' - 'A') - /* does OS/2 (with or with gcc-emx) have getdrives? */ - drives = _getdrives (); - for (i = C_DRIVE; i <= Z_DRIVE; i++) { /* don't check on A: or B: */ - if ((1 << i) & drives) { - len = 2 + strlen (path); - if (len < MAX_PATH) bufp = buf; - else bufp = Xmalloc (len + 1); - *bufp = 'A' + i; - *(bufp + 1) = ':'; - *(bufp + 2) = '\0'; - strcat (bufp, path); - if (access_file (bufp, pathbuf, len_pathbuf, pathret)) { - if (bufp != buf) Xfree (bufp); - return 1; - } - } - } -#endif - return 0; -} - -int _XOpenFile(path, flags) - _Xconst char* path; - int flags; -{ - char buf[MAX_PATH]; - char* bufp = NULL; - int ret = -1; - UINT olderror = SetErrorMode (SEM_FAILCRITICALERRORS); - - if (AccessFile (path, buf, MAX_PATH, &bufp)) - ret = open (bufp, flags); - - (void) SetErrorMode (olderror); - - if (bufp != buf) Xfree (bufp); - - return ret; -} - -void* _XFopenFile(path, mode) - _Xconst char* path; - _Xconst char* mode; -{ - char buf[MAX_PATH]; - char* bufp = NULL; - void* ret = NULL; - UINT olderror = SetErrorMode (SEM_FAILCRITICALERRORS); - - if (AccessFile (path, buf, MAX_PATH, &bufp)) - ret = fopen (bufp, mode); - - (void) SetErrorMode (olderror); - - if (bufp != buf) Xfree (bufp); - - return ret; -} - -int _XAccessFile(path) - _Xconst char* path; -{ - char buf[MAX_PATH]; - char* bufp; - int ret = -1; - UINT olderror = SetErrorMode (SEM_FAILCRITICALERRORS); - - ret = AccessFile (path, buf, MAX_PATH, &bufp); - - (void) SetErrorMode (olderror); - - if (bufp != buf) Xfree (bufp); - - return ret; -} - -#endif - -#ifdef WIN32 -#undef _Xdebug -int _Xdebug = 0; -int *_Xdebug_p = &_Xdebug; -void (**_XCreateMutex_fn_p)(LockInfoPtr) = &_XCreateMutex_fn; -void (**_XFreeMutex_fn_p)(LockInfoPtr) = &_XFreeMutex_fn; -void (**_XLockMutex_fn_p)(LockInfoPtr -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = &_XLockMutex_fn; -void (**_XUnlockMutex_fn_p)(LockInfoPtr -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = &_XUnlockMutex_fn; -LockInfoPtr *_Xglobal_lock_p = &_Xglobal_lock; -#endif diff --git a/nx-X11/lib/X11/Xlibint.h.NX.original b/nx-X11/lib/X11/Xlibint.h.NX.original deleted file mode 100644 index 56da2349b..000000000 --- a/nx-X11/lib/X11/Xlibint.h.NX.original +++ /dev/null @@ -1,1346 +0,0 @@ -/* $Xorg: Xlibint.h,v 1.5 2001/02/09 02:03:38 xorgcvs Exp $ */ - -/* - -Copyright 1984, 1985, 1987, 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/lib/X11/Xlibint.h,v 3.27 2003/05/27 22:26:26 tsi Exp $ */ - -#ifndef _XLIBINT_H_ -#define _XLIBINT_H_ 1 - -/* - * Xlibint.h - Header definition and support file for the internal - * support routines used by the C subroutine interface - * library (Xlib) to the X Window System. - * - * Warning, there be dragons here.... - */ - -#include -#include /* to declare xEvent */ -#include /* for configured options like XTHREADS */ - -#ifdef NX_TRANS_SOCKET - -#include "NXvars.h" - -#define _XGetIOError(dpy) \ - (dpy -> flags & XlibDisplayIOError) - -#endif - -#ifdef WIN32 -#define _XFlush _XFlushIt -#endif - -/* - * If your BytesReadable correctly detects broken connections, then - * you should NOT define XCONN_CHECK_FREQ. - */ -#ifndef XCONN_CHECK_FREQ -#define XCONN_CHECK_FREQ 256 -#endif - -struct _XGC -{ - XExtData *ext_data; /* hook for extension to hang data */ - GContext gid; /* protocol ID for graphics context */ - Bool rects; /* boolean: TRUE if clipmask is list of rectangles */ - Bool dashes; /* boolean: TRUE if dash-list is really a list */ - unsigned long dirty;/* cache dirty bits */ - XGCValues values; /* shadow structure of values */ -}; - -struct _XDisplay -{ - XExtData *ext_data; /* hook for extension to hang data */ - struct _XFreeFuncs *free_funcs; /* internal free functions */ - int fd; /* Network socket. */ - int conn_checker; /* ugly thing used by _XEventsQueued */ - int proto_major_version;/* maj. version of server's X protocol */ - int proto_minor_version;/* minor version of server's X protocol */ - char *vendor; /* vendor of the server hardware */ - XID resource_base; /* resource ID base */ - XID resource_mask; /* resource ID mask bits */ - XID resource_id; /* allocator current ID */ - int resource_shift; /* allocator shift to correct bits */ - XID (*resource_alloc)( /* allocator function */ - struct _XDisplay* - ); - int byte_order; /* screen byte order, LSBFirst, MSBFirst */ - int bitmap_unit; /* padding and data requirements */ - int bitmap_pad; /* padding requirements on bitmaps */ - int bitmap_bit_order; /* LeastSignificant or MostSignificant */ - int nformats; /* number of pixmap formats in list */ - ScreenFormat *pixmap_format; /* pixmap format list */ - int vnumber; /* Xlib's X protocol version number. */ - int release; /* release of the server */ - struct _XSQEvent *head, *tail; /* Input event queue. */ - int qlen; /* Length of input event queue */ - unsigned long last_request_read; /* seq number of last event read */ - unsigned long request; /* sequence number of last request. */ - char *last_req; /* beginning of last request, or dummy */ - char *buffer; /* Output buffer starting address. */ - char *bufptr; /* Output buffer index pointer. */ - char *bufmax; /* Output buffer maximum+1 address. */ - unsigned max_request_size; /* maximum number 32 bit words in request*/ - struct _XrmHashBucketRec *db; - int (*synchandler)( /* Synchronization handler */ - struct _XDisplay* - ); - char *display_name; /* "host:display" string used on this connect*/ - int default_screen; /* default screen for operations */ - int nscreens; /* number of screens on this server*/ - Screen *screens; /* pointer to list of screens */ - unsigned long motion_buffer; /* size of motion buffer */ - unsigned long flags; /* internal connection flags */ - int min_keycode; /* minimum defined keycode */ - int max_keycode; /* maximum defined keycode */ - KeySym *keysyms; /* This server's keysyms */ - XModifierKeymap *modifiermap; /* This server's modifier keymap */ - int keysyms_per_keycode;/* number of rows */ - char *xdefaults; /* contents of defaults from server */ - char *scratch_buffer; /* place to hang scratch buffer */ - unsigned long scratch_length; /* length of scratch buffer */ - int ext_number; /* extension number on this display */ - struct _XExten *ext_procs; /* extensions initialized on this display */ - /* - * the following can be fixed size, as the protocol defines how - * much address space is available. - * While this could be done using the extension vector, there - * may be MANY events processed, so a search through the extension - * list to find the right procedure for each event might be - * expensive if many extensions are being used. - */ - Bool (*event_vec[128])( /* vector for wire to event */ - Display * /* dpy */, - XEvent * /* re */, - xEvent * /* event */ - ); - Status (*wire_vec[128])( /* vector for event to wire */ - Display * /* dpy */, - XEvent * /* re */, - xEvent * /* event */ - ); - KeySym lock_meaning; /* for XLookupString */ - struct _XLockInfo *lock; /* multi-thread state, display lock */ - struct _XInternalAsync *async_handlers; /* for internal async */ - unsigned long bigreq_size; /* max size of big requests */ - struct _XLockPtrs *lock_fns; /* pointers to threads functions */ - void (*idlist_alloc)( /* XID list allocator function */ - Display * /* dpy */, - XID * /* ids */, - int /* count */ - ); - /* things above this line should not move, for binary compatibility */ - struct _XKeytrans *key_bindings; /* for XLookupString */ - Font cursor_font; /* for XCreateFontCursor */ - struct _XDisplayAtoms *atoms; /* for XInternAtom */ - unsigned int mode_switch; /* keyboard group modifiers */ - unsigned int num_lock; /* keyboard numlock modifiers */ - struct _XContextDB *context_db; /* context database */ - Bool (**error_vec)( /* vector for wire to error */ - Display * /* display */, - XErrorEvent * /* he */, - xError * /* we */ - ); - /* - * Xcms information - */ - struct { - XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */ - XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */ - XPointer perVisualIntensityMaps; - /* linked list of XcmsIntensityMap */ - } cms; - struct _XIMFilter *im_filters; - struct _XSQEvent *qfree; /* unallocated event queue elements */ - unsigned long next_event_serial_num; /* inserted into next queue elt */ - struct _XExten *flushes; /* Flush hooks */ - struct _XConnectionInfo *im_fd_info; /* _XRegisterInternalConnection */ - int im_fd_length; /* number of im_fd_info */ - struct _XConnWatchInfo *conn_watchers; /* XAddConnectionWatch */ - int watcher_count; /* number of conn_watchers */ - XPointer filedes; /* struct pollfd cache for _XWaitForReadable */ - int (*savedsynchandler)( /* user synchandler when Xlib usurps */ - Display * /* dpy */ - ); - XID resource_max; /* allocator max ID */ - int xcmisc_opcode; /* major opcode for XC-MISC */ - struct _XkbInfoRec *xkb_info; /* XKB info */ - struct _XtransConnInfo *trans_conn; /* transport connection object */ -}; - -#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n) - -/* - * define the following if you want the Data macro to be a procedure instead - */ -#ifdef CRAY -#define DataRoutineIsProcedure -#endif /* CRAY */ - -#ifndef _XEVENT_ -/* - * _QEvent datatype for use in input queueing. - */ -typedef struct _XSQEvent -{ - struct _XSQEvent *next; - XEvent event; - unsigned long qserial_num; /* so multi-threaded code can find new ones */ -} _XQEvent; -#endif - -#ifdef XTHREADS /* for xReply */ -#define NEED_REPLIES -#endif - -#define NEED_EVENTS -#define NEED_REPLIES -#include -#ifdef __sgi -#define _SGI_MP_SOURCE /* turn this on to get MP safe errno */ -#endif -#include -#define _XBCOPYFUNC _Xbcopy -#include -#include - -/* Utek leaves kernel macros around in include files (bleah) */ -#ifdef dirty -#undef dirty -#endif - -#include -#include - -#include - -_XFUNCPROTOBEGIN - -/* - * The following definitions can be used for locking requests in multi-threaded - * address spaces. - */ -#ifdef XTHREADS -/* Author: Stephen Gildea, MIT X Consortium - * - * declarations for C Threads locking - */ - -typedef struct _LockInfoRec *LockInfoPtr; - -/* interfaces for locking.c */ -struct _XLockPtrs { - /* used by all, including extensions; do not move */ - void (*lock_display)( - Display *dpy -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char *file - , int line -#endif - ); - void (*unlock_display)( - Display *dpy -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char *file - , int line -#endif - ); -}; - -#if defined(WIN32) && !defined(_XLIBINT_) -#define _XCreateMutex_fn (*_XCreateMutex_fn_p) -#define _XFreeMutex_fn (*_XFreeMutex_fn_p) -#define _XLockMutex_fn (*_XLockMutex_fn_p) -#define _XUnlockMutex_fn (*_XUnlockMutex_fn_p) -#define _Xglobal_lock (*_Xglobal_lock_p) -#endif - -/* in XlibInt.c */ -extern void (*_XCreateMutex_fn)( - LockInfoPtr /* lock */ -); -extern void (*_XFreeMutex_fn)( - LockInfoPtr /* lock */ -); -extern void (*_XLockMutex_fn)( - LockInfoPtr /* lock */ -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif -); -extern void (*_XUnlockMutex_fn)( - LockInfoPtr /* lock */ -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif -); - -extern LockInfoPtr _Xglobal_lock; - -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__) -#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__) -#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__) -#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__) -#else -/* used everywhere, so must be fast if not using threads */ -#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d) -#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d) -#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock) -#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock) -#endif -#define _XCreateMutex(lock) if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock); -#define _XFreeMutex(lock) if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock); - -#else /* XTHREADS */ -#define LockDisplay(dis) -#define _XLockMutex(lock) -#define _XUnlockMutex(lock) -#define UnlockDisplay(dis) -#define _XCreateMutex(lock) -#define _XFreeMutex(lock) -#endif - -#define Xfree(ptr) free((ptr)) - -/* - * Note that some machines do not return a valid pointer for malloc(0), in - * which case we provide an alternate under the control of the - * define MALLOC_0_RETURNS_NULL. This is necessary because some - * Xlib code expects malloc(0) to return a valid pointer to storage. - */ -#ifdef MALLOC_0_RETURNS_NULL - -# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size))) -# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size))) -# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize)) - -#else - -# define Xmalloc(size) malloc((size)) -# define Xrealloc(ptr, size) realloc((ptr), (size)) -# define Xcalloc(nelem, elsize) calloc((nelem), (elsize)) - -#endif - -#include - -#define LOCKED 1 -#define UNLOCKED 0 - -#ifdef NX_TRANS_SOCKET -#ifndef BUFSIZE /* Output buffer size is configurable */ -#define BUFSIZE 8192 /* but this is still used for reading. */ -#endif -#else -#ifndef BUFSIZE -#define BUFSIZE 2048 /* X output buffer size. */ -#endif -#endif -#ifndef PTSPERBATCH -#define PTSPERBATCH 1024 /* point batching */ -#endif -#ifndef WLNSPERBATCH -#define WLNSPERBATCH 50 /* wide line batching */ -#endif -#ifndef ZLNSPERBATCH -#define ZLNSPERBATCH 1024 /* thin line batching */ -#endif -#ifndef WRCTSPERBATCH -#define WRCTSPERBATCH 10 /* wide line rectangle batching */ -#endif -#ifndef ZRCTSPERBATCH -#define ZRCTSPERBATCH 256 /* thin line rectangle batching */ -#endif -#ifndef FRCTSPERBATCH -#define FRCTSPERBATCH 256 /* filled rectangle batching */ -#endif -#ifndef FARCSPERBATCH -#define FARCSPERBATCH 256 /* filled arc batching */ -#endif -#ifndef CURSORFONT -#define CURSORFONT "cursor" /* standard cursor fonts */ -#endif - -/* - * Display flags - */ -#define XlibDisplayIOError (1L << 0) -#define XlibDisplayClosing (1L << 1) -#define XlibDisplayNoXkb (1L << 2) -#define XlibDisplayPrivSync (1L << 3) -#define XlibDisplayProcConni (1L << 4) /* in _XProcessInternalConnection */ -#define XlibDisplayReadEvents (1L << 5) /* in _XReadEvents */ -#define XlibDisplayReply (1L << 5) /* in _XReply */ -#define XlibDisplayWriting (1L << 6) /* in _XFlushInt, _XSend */ -#define XlibDisplayDfltRMDB (1L << 7) /* mark if RM db from XGetDefault */ - -/* - * X Protocol packetizing macros. - */ - -/* Need to start requests on 64 bit word boundaries - * on a CRAY computer so add a NoOp (127) if needed. - * A character pointer on a CRAY computer will be non-zero - * after shifting right 61 bits of it is not pointing to - * a word boundary. - */ -#ifdef WORD64 -#define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\ - dpy->last_req = dpy->bufptr;\ - *(dpy->bufptr) = X_NoOperation;\ - *(dpy->bufptr+1) = 0;\ - *(dpy->bufptr+2) = 0;\ - *(dpy->bufptr+3) = 1;\ - dpy->request++;\ - dpy->bufptr += 4;\ - } -#else /* else does not require alignment on 64-bit boundaries */ -#define WORD64ALIGN -#endif /* WORD64 */ - - -/* - * GetReq - Get the next available X request packet in the buffer and - * return it. - * - * "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc. - * "req" is the name of the request pointer. - * - */ - -#if !defined(UNIXCPP) || defined(ANSICPP) -#define GetReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req))>>2;\ - dpy->bufptr += SIZEOF(x##name##Req);\ - dpy->request++ - -#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ -#define GetReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req))>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req);\ - dpy->request++ -#endif - -/* GetReqExtra is the same as GetReq, but allocates "n" additional - bytes after the request. "n" must be a multiple of 4! */ - -#if !defined(UNIXCPP) || defined(ANSICPP) -#define GetReqExtra(name, n, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x##name##Req) + n;\ - dpy->request++ -#else -#define GetReqExtra(name, n, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\ - dpy->request++ -#endif - - -/* - * GetResReq is for those requests that have a resource ID - * (Window, Pixmap, GContext, etc.) as their single argument. - * "rid" is the name of the resource. - */ - -#if !defined(UNIXCPP) || defined(ANSICPP) -#define GetResReq(name, rid, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = 2;\ - req->id = (rid);\ - dpy->bufptr += SIZEOF(xResourceReq);\ - dpy->request++ -#else -#define GetResReq(name, rid, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = 2;\ - req->id = (rid);\ - dpy->bufptr += SIZEOF(xResourceReq);\ - dpy->request++ -#endif - -/* - * GetEmptyReq is for those requests that have no arguments - * at all. - */ -#if !defined(UNIXCPP) || defined(ANSICPP) -#define GetEmptyReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = 1;\ - dpy->bufptr += SIZEOF(xReq);\ - dpy->request++ -#else -#define GetEmptyReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = 1;\ - dpy->bufptr += SIZEOF(xReq);\ - dpy->request++ -#endif - -#ifdef WORD64 -#define MakeBigReq(req,n) \ - { \ - char _BRdat[4]; \ - unsigned long _BRlen = req->length - 1; \ - req->length = 0; \ - memcpy(_BRdat, ((char *)req) + (_BRlen << 2), 4); \ - memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ - memcpy(((char *)req) + 4, _BRdat, 4); \ - Data32(dpy, (long *)&_BRdat, 4); \ - } -#else -#ifdef LONG64 -#define MakeBigReq(req,n) \ - { \ - CARD64 _BRdat; \ - CARD32 _BRlen = req->length - 1; \ - req->length = 0; \ - _BRdat = ((CARD32 *)req)[_BRlen]; \ - memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ - ((CARD32 *)req)[1] = _BRlen + n + 2; \ - Data32(dpy, &_BRdat, 4); \ - } -#else -#define MakeBigReq(req,n) \ - { \ - CARD32 _BRdat; \ - CARD32 _BRlen = req->length - 1; \ - req->length = 0; \ - _BRdat = ((CARD32 *)req)[_BRlen]; \ - memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ - ((CARD32 *)req)[1] = _BRlen + n + 2; \ - Data32(dpy, &_BRdat, 4); \ - } -#endif -#endif - -#define SetReqLen(req,n,badlen) \ - if ((req->length + n) > (unsigned)65535) { \ - if (dpy->bigreq_size) { \ - MakeBigReq(req,n) \ - } else { \ - n = badlen; \ - req->length += n; \ - } \ - } else \ - req->length += n - -#define SyncHandle() \ - if (dpy->synchandler) (*dpy->synchandler)(dpy) - -extern void _XFlushGCCache(Display *dpy, GC gc); -#define FlushGC(dpy, gc) \ - if ((gc)->dirty) _XFlushGCCache((dpy), (gc)) -/* - * Data - Place data in the buffer and pad the end to provide - * 32 bit word alignment. Transmit if the buffer fills. - * - * "dpy" is a pointer to a Display. - * "data" is a pinter to a data buffer. - * "len" is the length of the data buffer. - */ -#ifndef DataRoutineIsProcedure -#define Data(dpy, data, len) {\ - if (dpy->bufptr + (len) <= dpy->bufmax) {\ - memcpy(dpy->bufptr, data, (int)len);\ - dpy->bufptr += ((len) + 3) & ~3;\ - } else\ - _XSend(dpy, data, len);\ - } -#endif /* DataRoutineIsProcedure */ - - -/* Allocate bytes from the buffer. No padding is done, so if - * the length is not a multiple of 4, the caller must be - * careful to leave the buffer aligned after sending the - * current request. - * - * "type" is the type of the pointer being assigned to. - * "ptr" is the pointer being assigned to. - * "n" is the number of bytes to allocate. - * - * Example: - * xTextElt *elt; - * BufAlloc (xTextElt *, elt, nbytes) - */ - -#define BufAlloc(type, ptr, n) \ - if (dpy->bufptr + (n) > dpy->bufmax) \ - _XFlush (dpy); \ - ptr = (type) dpy->bufptr; \ - (void)ptr; \ - dpy->bufptr += (n); - -#ifdef WORD64 -#define Data16(dpy, data, len) _XData16(dpy, (short *)data, len) -#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) -#else -#define Data16(dpy, data, len) Data((dpy), (char *)(data), (len)) -#define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len)) -#define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len)) -#ifdef LONG64 -#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) -extern int _XData32( - Display *dpy, - register long *data, - unsigned len -); -extern void _XRead32( - Display *dpy, - register long *data, - long len -); -#else -#define Data32(dpy, data, len) Data((dpy), (char *)(data), (len)) -#define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len)) -#endif -#endif /* not WORD64 */ - -#define PackData16(dpy,data,len) Data16 (dpy, data, len) -#define PackData32(dpy,data,len) Data32 (dpy, data, len) - -/* Xlib manual is bogus */ -#define PackData(dpy,data,len) PackData16 (dpy, data, len) - -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#define max(a,b) (((a) > (b)) ? (a) : (b)) - -#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \ - (((cs)->rbearing|(cs)->lbearing| \ - (cs)->ascent|(cs)->descent) == 0)) - -/* - * CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit - * character. If the character is in the column and exists, then return the - * appropriate metrics (note that fonts with common per-character metrics will - * return min_bounds). If none of these hold true, try again with the default - * char. - */ -#define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \ -{ \ - cs = def; \ - if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ - if (fs->per_char == NULL) { \ - cs = &fs->min_bounds; \ - } else { \ - cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \ - if (CI_NONEXISTCHAR(cs)) cs = def; \ - } \ - } \ -} - -#define CI_GET_DEFAULT_INFO_1D(fs,cs) \ - CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs) - - - -/* - * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and - * column. This is used for fonts that have more than row zero. - */ -#define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \ -{ \ - cs = def; \ - if (row >= fs->min_byte1 && row <= fs->max_byte1 && \ - col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ - if (fs->per_char == NULL) { \ - cs = &fs->min_bounds; \ - } else { \ - cs = &fs->per_char[((row - fs->min_byte1) * \ - (fs->max_char_or_byte2 - \ - fs->min_char_or_byte2 + 1)) + \ - (col - fs->min_char_or_byte2)]; \ - if (CI_NONEXISTCHAR(cs)) cs = def; \ - } \ - } \ -} - -#define CI_GET_DEFAULT_INFO_2D(fs,cs) \ -{ \ - unsigned int r = (fs->default_char >> 8); \ - unsigned int c = (fs->default_char & 0xff); \ - CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \ -} - - -#ifdef MUSTCOPY - -/* for when 32-bit alignment is not good enough */ -#define OneDataCard32(dpy,dstaddr,srcvar) \ - { dpy->bufptr -= 4; Data32 (dpy, (char *) &(srcvar), 4); } - -#else - -/* srcvar must be a variable for large architecture version */ -#define OneDataCard32(dpy,dstaddr,srcvar) \ - { *(CARD32 *)(dstaddr) = (srcvar); } - -#endif /* MUSTCOPY */ - -typedef struct _XInternalAsync { - struct _XInternalAsync *next; - /* - * handler arguments: - * rep is the generic reply that caused this handler - * to be invoked. It must also be passed to _XGetAsyncReply. - * buf and len are opaque values that must be passed to - * _XGetAsyncReply or _XGetAsyncData. - * data is the closure stored in this struct. - * The handler returns True iff it handled this reply. - */ - Bool (*handler)( - Display* /* dpy */, - xReply* /* rep */, - char* /* buf */, - int /* len */, - XPointer /* data */ - ); - XPointer data; -} _XAsyncHandler; - -typedef struct _XAsyncEState { - unsigned long min_sequence_number; - unsigned long max_sequence_number; - unsigned char error_code; - unsigned char major_opcode; - unsigned short minor_opcode; - unsigned char last_error_received; - int error_count; -} _XAsyncErrorState; - -extern void _XDeqAsyncHandler(Display *dpy, _XAsyncHandler *handler); -#define DeqAsyncHandler(dpy,handler) { \ - if (dpy->async_handlers == (handler)) \ - dpy->async_handlers = (handler)->next; \ - else \ - _XDeqAsyncHandler(dpy, handler); \ - } - -typedef void (*FreeFuncType) ( - Display* /* display */ -); - -typedef int (*FreeModmapType) ( - XModifierKeymap* /* modmap */ -); - -/* - * This structure is private to the library. - */ -typedef struct _XFreeFuncs { - FreeFuncType atoms; /* _XFreeAtomTable */ - FreeModmapType modifiermap; /* XFreeModifierMap */ - FreeFuncType key_bindings; /* _XFreeKeyBindings */ - FreeFuncType context_db; /* _XFreeContextDB */ - FreeFuncType defaultCCCs; /* _XcmsFreeDefaultCCCs */ - FreeFuncType clientCmaps; /* _XcmsFreeClientCmaps */ - FreeFuncType intensityMaps; /* _XcmsFreeIntensityMaps */ - FreeFuncType im_filters; /* _XFreeIMFilters */ - FreeFuncType xkb; /* _XkbFreeInfo */ -} _XFreeFuncRec; - -/* types for InitExt.c */ -typedef int (*CreateGCType) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -); - -typedef int (*CopyGCType)( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -); - -typedef int (*FlushGCType) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -); - -typedef int (*FreeGCType) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -); - -typedef int (*CreateFontType) ( - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ -); - -typedef int (*FreeFontType) ( - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ -); - -typedef int (*CloseDisplayType) ( - Display* /* display */, - XExtCodes* /* codes */ -); - -typedef int (*ErrorType) ( - Display* /* display */, - xError* /* err */, - XExtCodes* /* codes */, - int* /* ret_code */ -); - -typedef char* (*ErrorStringType) ( - Display* /* display */, - int /* code */, - XExtCodes* /* codes */, - char* /* buffer */, - int /* nbytes */ -); - -typedef void (*PrintErrorType)( - Display* /* display */, - XErrorEvent* /* ev */, - void* /* fp */ -); - -typedef void (*BeforeFlushType)( - Display* /* display */, - XExtCodes* /* codes */, - _Xconst char* /* data */, - long /* len */ -); - -/* - * This structure is private to the library. - */ -typedef struct _XExten { /* private to extension mechanism */ - struct _XExten *next; /* next in list */ - XExtCodes codes; /* public information, all extension told */ - CreateGCType create_GC; /* routine to call when GC created */ - CopyGCType copy_GC; /* routine to call when GC copied */ - FlushGCType flush_GC; /* routine to call when GC flushed */ - FreeGCType free_GC; /* routine to call when GC freed */ - CreateFontType create_Font; /* routine to call when Font created */ - FreeFontType free_Font; /* routine to call when Font freed */ - CloseDisplayType close_display; /* routine to call when connection closed */ - ErrorType error; /* who to call when an error occurs */ - ErrorStringType error_string; /* routine to supply error string */ - char *name; /* name of this extension */ - PrintErrorType error_values; /* routine to supply error values */ - BeforeFlushType before_flush; /* routine to call when sending data */ - struct _XExten *next_flush; /* next in list of those with flushes */ -} _XExtension; - -/* extension hooks */ - -#ifdef DataRoutineIsProcedure -extern void Data(Display *dpy, char *data, long len); -#endif -extern int _XError( - Display* /* dpy */, - xError* /* rep */ -); -extern int _XIOError( - Display* /* dpy */ -); -extern int (*_XIOErrorFunction)( - Display* /* dpy */ -); -extern int (*_XErrorFunction)( - Display* /* dpy */, - XErrorEvent* /* error_event */ -); -extern void _XEatData( - Display* /* dpy */, - unsigned long /* n */ -); -extern char *_XAllocScratch( - Display* /* dpy */, - unsigned long /* nbytes */ -); -extern char *_XAllocTemp( - Display* /* dpy */, - unsigned long /* nbytes */ -); -extern void _XFreeTemp( - Display* /* dpy */, - char* /* buf */, - unsigned long /* nbytes */ -); -extern Visual *_XVIDtoVisual( - Display* /* dpy */, - VisualID /* id */ -); -extern unsigned long _XSetLastRequestRead( - Display* /* dpy */, - xGenericReply* /* rep */ -); -extern int _XGetHostname( - char* /* buf */, - int /* maxlen */ -); -extern Screen *_XScreenOfWindow( - Display* /* dpy */, - Window /* w */ -); -extern Bool _XAsyncErrorHandler( - Display* /* dpy */, - xReply* /* rep */, - char* /* buf */, - int /* len */, - XPointer /* data */ -); -extern char *_XGetAsyncReply( - Display* /* dpy */, - char* /* replbuf */, - xReply* /* rep */, - char* /* buf */, - int /* len */, - int /* extra */, - Bool /* discard */ -); -extern void _XGetAsyncData( - Display* /* dpy */, - char * /* data */, - char * /* buf */, - int /* len */, - int /* skip */, - int /* datalen */, - int /* discardtotal */ -); -extern void _XFlush( - Display* /* dpy */ -); -extern int _XEventsQueued( - Display* /* dpy */, - int /* mode */ -); -extern void _XReadEvents( - Display* /* dpy */ -); -extern int _XRead( - Display* /* dpy */, - char* /* data */, - long /* size */ -); -extern void _XReadPad( - Display* /* dpy */, - char* /* data */, - long /* size */ -); -extern void _XSend( - Display* /* dpy */, - _Xconst char* /* data */, - long /* size */ -); -extern Status _XReply( - Display* /* dpy */, - xReply* /* rep */, - int /* extra */, - Bool /* discard */ -); -extern void _XEnq( - Display* /* dpy */, - xEvent* /* event */ -); -extern void _XDeq( - Display* /* dpy */, - _XQEvent* /* prev */, - _XQEvent* /* qelt */ -); - -extern Bool _XUnknownWireEvent( - Display* /* dpy */, - XEvent* /* re */, - xEvent* /* event */ -); -extern Status _XUnknownNativeEvent( - Display* /* dpy */, - XEvent* /* re */, - xEvent* /* event */ -); - -extern Bool _XWireToEvent(Display *dpy, XEvent *re, xEvent *event); -extern Bool _XDefaultWireError(Display *display, XErrorEvent *he, xError *we); -extern Bool _XPollfdCacheInit(Display *dpy); -extern void _XPollfdCacheAdd(Display *dpy, int fd); -extern void _XPollfdCacheDel(Display *dpy, int fd); -extern XID _XAllocID(Display *dpy); -extern void _XAllocIDs(Display *dpy, XID *ids, int count); - -extern int _XFreeExtData( - XExtData* /* extension */ -); - -extern int (*XESetCreateGC( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, GC, XExtCodes* -); - -extern int (*XESetCopyGC( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, GC, XExtCodes* -); - -extern int (*XESetFlushGC( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, GC, XExtCodes* -); - -extern int (*XESetFreeGC( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, GC, XExtCodes* -); - -extern int (*XESetCreateFont( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, XFontStruct*, XExtCodes* -); - -extern int (*XESetFreeFont( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, XFontStruct*, XExtCodes* -); - -extern int (*XESetCloseDisplay( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, XExtCodes* -); - -extern int (*XESetError( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - xError* /* err */, - XExtCodes* /* codes */, - int* /* ret_code */ - ) /* proc */ -))( - Display*, xError*, XExtCodes*, int* -); - -extern char* (*XESetErrorString( - Display* /* display */, - int /* extension */, - char* (*) ( - Display* /* display */, - int /* code */, - XExtCodes* /* codes */, - char* /* buffer */, - int /* nbytes */ - ) /* proc */ -))( - Display*, int, XExtCodes*, char*, int -); - -extern void (*XESetPrintErrorValues ( - Display* /* display */, - int /* extension */, - void (*)( - Display* /* display */, - XErrorEvent* /* ev */, - void* /* fp */ - ) /* proc */ -))( - Display*, XErrorEvent*, void* -); - -extern Bool (*XESetWireToEvent( - Display* /* display */, - int /* event_number */, - Bool (*) ( - Display* /* display */, - XEvent* /* re */, - xEvent* /* event */ - ) /* proc */ -))( - Display*, XEvent*, xEvent* -); - -extern Status (*XESetEventToWire( - Display* /* display */, - int /* event_number */, - Status (*) ( - Display* /* display */, - XEvent* /* re */, - xEvent* /* event */ - ) /* proc */ -))( - Display*, XEvent*, xEvent* -); - -extern Bool (*XESetWireToError( - Display* /* display */, - int /* error_number */, - Bool (*) ( - Display* /* display */, - XErrorEvent* /* he */, - xError* /* we */ - ) /* proc */ -))( - Display*, XErrorEvent*, xError* -); - -extern void (*XESetBeforeFlush( - Display* /* display */, - int /* error_number */, - void (*) ( - Display* /* display */, - XExtCodes* /* codes */, - _Xconst char* /* data */, - long /* len */ - ) /* proc */ -))( - Display*, XExtCodes*, _Xconst char*, long -); - -/* internal connections for IMs */ - -typedef void (*_XInternalConnectionProc)( - Display* /* dpy */, - int /* fd */, - XPointer /* call_data */ -); - - -extern Status _XRegisterInternalConnection( - Display* /* dpy */, - int /* fd */, - _XInternalConnectionProc /* callback */, - XPointer /* call_data */ -); - -extern void _XUnregisterInternalConnection( - Display* /* dpy */, - int /* fd */ -); - -/* Display structure has pointers to these */ - -struct _XConnectionInfo { /* info from _XRegisterInternalConnection */ - int fd; - _XInternalConnectionProc read_callback; - XPointer call_data; - XPointer *watch_data; /* set/used by XConnectionWatchProc */ - struct _XConnectionInfo *next; -}; - -struct _XConnWatchInfo { /* info from XAddConnectionWatch */ - XConnectionWatchProc fn; - XPointer client_data; - struct _XConnWatchInfo *next; -}; - -#ifdef __UNIXOS2__ -extern char* __XOS2RedirRoot( - char* -); -#endif - -extern int _XTextHeight( - XFontStruct* /* font_struct */, - _Xconst char* /* string */, - int /* count */ -); - -extern int _XTextHeight16( - XFontStruct* /* font_struct */, - _Xconst XChar2b* /* string */, - int /* count */ -); - -#if defined(WIN32) - -extern int _XOpenFile( - _Xconst char* /* path */, - int /* flags */ -); - -extern void* _XFopenFile( - _Xconst char* /* path */, - _Xconst char* /* mode */ -); - -extern int _XAccessFile( - _Xconst char* /* path */ -); -#else -#define _XOpenFile(path,flags) open(path,flags) -#define _XFopenFile(path,mode) fopen(path,mode) -#endif - -/* EvToWire.c */ -extern Status _XEventToWire(Display *dpy, XEvent *re, xEvent *event); - -extern int _XF86LoadQueryLocaleFont( - Display* /* dpy */, - _Xconst char* /* name*/, - XFontStruct** /* xfp*/, - Font* /* fidp */ -); - -extern void _XProcessWindowAttributes ( - register Display *dpy, - xChangeWindowAttributesReq *req, - register unsigned long valuemask, - register XSetWindowAttributes *attributes); - -extern int _XDefaultError( - Display *dpy, - XErrorEvent *event); - -extern int _XDefaultIOError( - Display *dpy); - -extern void _XSetClipRectangles ( - register Display *dpy, - GC gc, - int clip_x_origin, int clip_y_origin, - XRectangle *rectangles, - int n, - int ordering); - -Status _XGetWindowAttributes( - register Display *dpy, - Window w, - XWindowAttributes *attr); - -int _XPutBackEvent ( - register Display *dpy, - register XEvent *event); - -_XFUNCPROTOEND - -#endif /* _XLIBINT_H_ */ diff --git a/nx-X11/lib/X11/Xlibint.h.X.original b/nx-X11/lib/X11/Xlibint.h.X.original deleted file mode 100644 index 8517f6539..000000000 --- a/nx-X11/lib/X11/Xlibint.h.X.original +++ /dev/null @@ -1,1313 +0,0 @@ -/* $Xorg: Xlibint.h,v 1.5 2001/02/09 02:03:38 xorgcvs Exp $ */ - -/* - -Copyright 1984, 1985, 1987, 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/X11/Xlibint.h,v 3.27 2003/05/27 22:26:26 tsi Exp $ */ - -#ifndef _XLIBINT_H_ -#define _XLIBINT_H_ 1 - -/* - * Xlibint.h - Header definition and support file for the internal - * support routines used by the C subroutine interface - * library (Xlib) to the X Window System. - * - * Warning, there be dragons here.... - */ - -#include -#include /* to declare xEvent */ -#include /* for configured options like XTHREADS */ - -#ifdef WIN32 -#define _XFlush _XFlushIt -#endif - -/* - * If your BytesReadable correctly detects broken connections, then - * you should NOT define XCONN_CHECK_FREQ. - */ -#ifndef XCONN_CHECK_FREQ -#define XCONN_CHECK_FREQ 256 -#endif - -struct _XGC -{ - XExtData *ext_data; /* hook for extension to hang data */ - GContext gid; /* protocol ID for graphics context */ - Bool rects; /* boolean: TRUE if clipmask is list of rectangles */ - Bool dashes; /* boolean: TRUE if dash-list is really a list */ - unsigned long dirty;/* cache dirty bits */ - XGCValues values; /* shadow structure of values */ -}; - -struct _XDisplay -{ - XExtData *ext_data; /* hook for extension to hang data */ - struct _XFreeFuncs *free_funcs; /* internal free functions */ - int fd; /* Network socket. */ - int conn_checker; /* ugly thing used by _XEventsQueued */ - int proto_major_version;/* maj. version of server's X protocol */ - int proto_minor_version;/* minor version of server's X protocol */ - char *vendor; /* vendor of the server hardware */ - XID resource_base; /* resource ID base */ - XID resource_mask; /* resource ID mask bits */ - XID resource_id; /* allocator current ID */ - int resource_shift; /* allocator shift to correct bits */ - XID (*resource_alloc)( /* allocator function */ - struct _XDisplay* - ); - int byte_order; /* screen byte order, LSBFirst, MSBFirst */ - int bitmap_unit; /* padding and data requirements */ - int bitmap_pad; /* padding requirements on bitmaps */ - int bitmap_bit_order; /* LeastSignificant or MostSignificant */ - int nformats; /* number of pixmap formats in list */ - ScreenFormat *pixmap_format; /* pixmap format list */ - int vnumber; /* Xlib's X protocol version number. */ - int release; /* release of the server */ - struct _XSQEvent *head, *tail; /* Input event queue. */ - int qlen; /* Length of input event queue */ - unsigned long last_request_read; /* seq number of last event read */ - unsigned long request; /* sequence number of last request. */ - char *last_req; /* beginning of last request, or dummy */ - char *buffer; /* Output buffer starting address. */ - char *bufptr; /* Output buffer index pointer. */ - char *bufmax; /* Output buffer maximum+1 address. */ - unsigned max_request_size; /* maximum number 32 bit words in request*/ - struct _XrmHashBucketRec *db; - int (*synchandler)( /* Synchronization handler */ - struct _XDisplay* - ); - char *display_name; /* "host:display" string used on this connect*/ - int default_screen; /* default screen for operations */ - int nscreens; /* number of screens on this server*/ - Screen *screens; /* pointer to list of screens */ - unsigned long motion_buffer; /* size of motion buffer */ - unsigned long flags; /* internal connection flags */ - int min_keycode; /* minimum defined keycode */ - int max_keycode; /* maximum defined keycode */ - KeySym *keysyms; /* This server's keysyms */ - XModifierKeymap *modifiermap; /* This server's modifier keymap */ - int keysyms_per_keycode;/* number of rows */ - char *xdefaults; /* contents of defaults from server */ - char *scratch_buffer; /* place to hang scratch buffer */ - unsigned long scratch_length; /* length of scratch buffer */ - int ext_number; /* extension number on this display */ - struct _XExten *ext_procs; /* extensions initialized on this display */ - /* - * the following can be fixed size, as the protocol defines how - * much address space is available. - * While this could be done using the extension vector, there - * may be MANY events processed, so a search through the extension - * list to find the right procedure for each event might be - * expensive if many extensions are being used. - */ - Bool (*event_vec[128])( /* vector for wire to event */ - Display * /* dpy */, - XEvent * /* re */, - xEvent * /* event */ - ); - Status (*wire_vec[128])( /* vector for event to wire */ - Display * /* dpy */, - XEvent * /* re */, - xEvent * /* event */ - ); - KeySym lock_meaning; /* for XLookupString */ - struct _XLockInfo *lock; /* multi-thread state, display lock */ - struct _XInternalAsync *async_handlers; /* for internal async */ - unsigned long bigreq_size; /* max size of big requests */ - struct _XLockPtrs *lock_fns; /* pointers to threads functions */ - void (*idlist_alloc)( /* XID list allocator function */ - Display * /* dpy */, - XID * /* ids */, - int /* count */ - ); - /* things above this line should not move, for binary compatibility */ - struct _XKeytrans *key_bindings; /* for XLookupString */ - Font cursor_font; /* for XCreateFontCursor */ - struct _XDisplayAtoms *atoms; /* for XInternAtom */ - unsigned int mode_switch; /* keyboard group modifiers */ - unsigned int num_lock; /* keyboard numlock modifiers */ - struct _XContextDB *context_db; /* context database */ - Bool (**error_vec)( /* vector for wire to error */ - Display * /* display */, - XErrorEvent * /* he */, - xError * /* we */ - ); - /* - * Xcms information - */ - struct { - XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */ - XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */ - XPointer perVisualIntensityMaps; - /* linked list of XcmsIntensityMap */ - } cms; - struct _XIMFilter *im_filters; - struct _XSQEvent *qfree; /* unallocated event queue elements */ - unsigned long next_event_serial_num; /* inserted into next queue elt */ - struct _XExten *flushes; /* Flush hooks */ - struct _XConnectionInfo *im_fd_info; /* _XRegisterInternalConnection */ - int im_fd_length; /* number of im_fd_info */ - struct _XConnWatchInfo *conn_watchers; /* XAddConnectionWatch */ - int watcher_count; /* number of conn_watchers */ - XPointer filedes; /* struct pollfd cache for _XWaitForReadable */ - int (*savedsynchandler)( /* user synchandler when Xlib usurps */ - Display * /* dpy */ - ); - XID resource_max; /* allocator max ID */ - int xcmisc_opcode; /* major opcode for XC-MISC */ - struct _XkbInfoRec *xkb_info; /* XKB info */ - struct _XtransConnInfo *trans_conn; /* transport connection object */ -}; - -#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n) - -/* - * define the following if you want the Data macro to be a procedure instead - */ -#ifdef CRAY -#define DataRoutineIsProcedure -#endif /* CRAY */ - -#ifndef _XEVENT_ -/* - * _QEvent datatype for use in input queueing. - */ -typedef struct _XSQEvent -{ - struct _XSQEvent *next; - XEvent event; - unsigned long qserial_num; /* so multi-threaded code can find new ones */ -} _XQEvent; -#endif - -#ifdef XTHREADS /* for xReply */ -#define NEED_REPLIES -#endif - -#define NEED_EVENTS -#define NEED_REPLIES -#include -#ifdef __sgi -#define _SGI_MP_SOURCE /* turn this on to get MP safe errno */ -#endif -#include -#define _XBCOPYFUNC _Xbcopy -#include -#include - -/* Utek leaves kernel macros around in include files (bleah) */ -#ifdef dirty -#undef dirty -#endif - -#include -#include - -#include - -_XFUNCPROTOBEGIN - -/* - * The following definitions can be used for locking requests in multi-threaded - * address spaces. - */ -#ifdef XTHREADS -/* Author: Stephen Gildea, MIT X Consortium - * - * declarations for C Threads locking - */ - -typedef struct _LockInfoRec *LockInfoPtr; - -/* interfaces for locking.c */ -struct _XLockPtrs { - /* used by all, including extensions; do not move */ - void (*lock_display)( - Display *dpy -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char *file - , int line -#endif - ); - void (*unlock_display)( - Display *dpy -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char *file - , int line -#endif - ); -}; - -#if defined(WIN32) && !defined(_XLIBINT_) -#define _XCreateMutex_fn (*_XCreateMutex_fn_p) -#define _XFreeMutex_fn (*_XFreeMutex_fn_p) -#define _XLockMutex_fn (*_XLockMutex_fn_p) -#define _XUnlockMutex_fn (*_XUnlockMutex_fn_p) -#define _Xglobal_lock (*_Xglobal_lock_p) -#endif - -/* in XlibInt.c */ -extern void (*_XCreateMutex_fn)( - LockInfoPtr /* lock */ -); -extern void (*_XFreeMutex_fn)( - LockInfoPtr /* lock */ -); -extern void (*_XLockMutex_fn)( - LockInfoPtr /* lock */ -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif -); -extern void (*_XUnlockMutex_fn)( - LockInfoPtr /* lock */ -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif -); - -extern LockInfoPtr _Xglobal_lock; - -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__) -#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__) -#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__) -#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__) -#else -/* used everywhere, so must be fast if not using threads */ -#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d) -#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d) -#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock) -#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock) -#endif -#define _XCreateMutex(lock) if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock); -#define _XFreeMutex(lock) if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock); - -#else /* XTHREADS */ -#define LockDisplay(dis) -#define _XLockMutex(lock) -#define _XUnlockMutex(lock) -#define UnlockDisplay(dis) -#define _XCreateMutex(lock) -#define _XFreeMutex(lock) -#endif - -#define Xfree(ptr) free((ptr)) - -/* - * Note that some machines do not return a valid pointer for malloc(0), in - * which case we provide an alternate under the control of the - * define MALLOC_0_RETURNS_NULL. This is necessary because some - * Xlib code expects malloc(0) to return a valid pointer to storage. - */ -#ifdef MALLOC_0_RETURNS_NULL - -# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size))) -# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size))) -# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize)) - -#else - -# define Xmalloc(size) malloc((size)) -# define Xrealloc(ptr, size) realloc((ptr), (size)) -# define Xcalloc(nelem, elsize) calloc((nelem), (elsize)) - -#endif - -#include - -#define LOCKED 1 -#define UNLOCKED 0 - -#ifndef BUFSIZE -#define BUFSIZE 2048 /* X output buffer size. */ -#endif -#ifndef PTSPERBATCH -#define PTSPERBATCH 1024 /* point batching */ -#endif -#ifndef WLNSPERBATCH -#define WLNSPERBATCH 50 /* wide line batching */ -#endif -#ifndef ZLNSPERBATCH -#define ZLNSPERBATCH 1024 /* thin line batching */ -#endif -#ifndef WRCTSPERBATCH -#define WRCTSPERBATCH 10 /* wide line rectangle batching */ -#endif -#ifndef ZRCTSPERBATCH -#define ZRCTSPERBATCH 256 /* thin line rectangle batching */ -#endif -#ifndef FRCTSPERBATCH -#define FRCTSPERBATCH 256 /* filled rectangle batching */ -#endif -#ifndef FARCSPERBATCH -#define FARCSPERBATCH 256 /* filled arc batching */ -#endif -#ifndef CURSORFONT -#define CURSORFONT "cursor" /* standard cursor fonts */ -#endif - -/* - * Display flags - */ -#define XlibDisplayIOError (1L << 0) -#define XlibDisplayClosing (1L << 1) -#define XlibDisplayNoXkb (1L << 2) -#define XlibDisplayPrivSync (1L << 3) -#define XlibDisplayProcConni (1L << 4) /* in _XProcessInternalConnection */ -#define XlibDisplayReadEvents (1L << 5) /* in _XReadEvents */ -#define XlibDisplayReply (1L << 5) /* in _XReply */ -#define XlibDisplayWriting (1L << 6) /* in _XFlushInt, _XSend */ -#define XlibDisplayDfltRMDB (1L << 7) /* mark if RM db from XGetDefault */ - -/* - * X Protocol packetizing macros. - */ - -/* Need to start requests on 64 bit word boundaries - * on a CRAY computer so add a NoOp (127) if needed. - * A character pointer on a CRAY computer will be non-zero - * after shifting right 61 bits of it is not pointing to - * a word boundary. - */ -#ifdef WORD64 -#define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\ - dpy->last_req = dpy->bufptr;\ - *(dpy->bufptr) = X_NoOperation;\ - *(dpy->bufptr+1) = 0;\ - *(dpy->bufptr+2) = 0;\ - *(dpy->bufptr+3) = 1;\ - dpy->request++;\ - dpy->bufptr += 4;\ - } -#else /* else does not require alignment on 64-bit boundaries */ -#define WORD64ALIGN -#endif /* WORD64 */ - - -/* - * GetReq - Get the next available X request packet in the buffer and - * return it. - * - * "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc. - * "req" is the name of the request pointer. - * - */ - -#if !defined(UNIXCPP) || defined(ANSICPP) -#define GetReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req))>>2;\ - dpy->bufptr += SIZEOF(x##name##Req);\ - dpy->request++ - -#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ -#define GetReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req))>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req);\ - dpy->request++ -#endif - -/* GetReqExtra is the same as GetReq, but allocates "n" additional - bytes after the request. "n" must be a multiple of 4! */ - -#if !defined(UNIXCPP) || defined(ANSICPP) -#define GetReqExtra(name, n, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x##name##Req) + n;\ - dpy->request++ -#else -#define GetReqExtra(name, n, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\ - dpy->request++ -#endif - - -/* - * GetResReq is for those requests that have a resource ID - * (Window, Pixmap, GContext, etc.) as their single argument. - * "rid" is the name of the resource. - */ - -#if !defined(UNIXCPP) || defined(ANSICPP) -#define GetResReq(name, rid, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = 2;\ - req->id = (rid);\ - dpy->bufptr += SIZEOF(xResourceReq);\ - dpy->request++ -#else -#define GetResReq(name, rid, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xResourceReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xResourceReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = 2;\ - req->id = (rid);\ - dpy->bufptr += SIZEOF(xResourceReq);\ - dpy->request++ -#endif - -/* - * GetEmptyReq is for those requests that have no arguments - * at all. - */ -#if !defined(UNIXCPP) || defined(ANSICPP) -#define GetEmptyReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = 1;\ - dpy->bufptr += SIZEOF(xReq);\ - dpy->request++ -#else -#define GetEmptyReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xReq)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xReq *) (dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = 1;\ - dpy->bufptr += SIZEOF(xReq);\ - dpy->request++ -#endif - -#ifdef WORD64 -#define MakeBigReq(req,n) \ - { \ - char _BRdat[4]; \ - unsigned long _BRlen = req->length - 1; \ - req->length = 0; \ - memcpy(_BRdat, ((char *)req) + (_BRlen << 2), 4); \ - memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ - memcpy(((char *)req) + 4, _BRdat, 4); \ - Data32(dpy, (long *)&_BRdat, 4); \ - } -#else -#ifdef LONG64 -#define MakeBigReq(req,n) \ - { \ - CARD64 _BRdat; \ - CARD32 _BRlen = req->length - 1; \ - req->length = 0; \ - _BRdat = ((CARD32 *)req)[_BRlen]; \ - memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ - ((CARD32 *)req)[1] = _BRlen + n + 2; \ - Data32(dpy, &_BRdat, 4); \ - } -#else -#define MakeBigReq(req,n) \ - { \ - CARD32 _BRdat; \ - CARD32 _BRlen = req->length - 1; \ - req->length = 0; \ - _BRdat = ((CARD32 *)req)[_BRlen]; \ - memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \ - ((CARD32 *)req)[1] = _BRlen + n + 2; \ - Data32(dpy, &_BRdat, 4); \ - } -#endif -#endif - -#define SetReqLen(req,n,badlen) \ - if ((req->length + n) > (unsigned)65535) { \ - if (dpy->bigreq_size) { \ - MakeBigReq(req,n) \ - } else { \ - n = badlen; \ - req->length += n; \ - } \ - } else \ - req->length += n - -#define SyncHandle() \ - if (dpy->synchandler) (*dpy->synchandler)(dpy) - -extern void _XFlushGCCache(Display *dpy, GC gc); -#define FlushGC(dpy, gc) \ - if ((gc)->dirty) _XFlushGCCache((dpy), (gc)) -/* - * Data - Place data in the buffer and pad the end to provide - * 32 bit word alignment. Transmit if the buffer fills. - * - * "dpy" is a pointer to a Display. - * "data" is a pinter to a data buffer. - * "len" is the length of the data buffer. - */ -#ifndef DataRoutineIsProcedure -#define Data(dpy, data, len) {\ - if (dpy->bufptr + (len) <= dpy->bufmax) {\ - memcpy(dpy->bufptr, data, (int)len);\ - dpy->bufptr += ((len) + 3) & ~3;\ - } else\ - _XSend(dpy, data, len);\ - } -#endif /* DataRoutineIsProcedure */ - - -/* Allocate bytes from the buffer. No padding is done, so if - * the length is not a multiple of 4, the caller must be - * careful to leave the buffer aligned after sending the - * current request. - * - * "type" is the type of the pointer being assigned to. - * "ptr" is the pointer being assigned to. - * "n" is the number of bytes to allocate. - * - * Example: - * xTextElt *elt; - * BufAlloc (xTextElt *, elt, nbytes) - */ - -#define BufAlloc(type, ptr, n) \ - if (dpy->bufptr + (n) > dpy->bufmax) \ - _XFlush (dpy); \ - ptr = (type) dpy->bufptr; \ - (void)ptr; \ - dpy->bufptr += (n); - -#ifdef WORD64 -#define Data16(dpy, data, len) _XData16(dpy, (short *)data, len) -#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) -#else -#define Data16(dpy, data, len) Data((dpy), (char *)(data), (len)) -#define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len)) -#define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len)) -#ifdef LONG64 -#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len) -extern int _XData32( - Display *dpy, - register long *data, - unsigned len -); -extern void _XRead32( - Display *dpy, - register long *data, - long len -); -#else -#define Data32(dpy, data, len) Data((dpy), (char *)(data), (len)) -#define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len)) -#endif -#endif /* not WORD64 */ - -#define PackData16(dpy,data,len) Data16 (dpy, data, len) -#define PackData32(dpy,data,len) Data32 (dpy, data, len) - -/* Xlib manual is bogus */ -#define PackData(dpy,data,len) PackData16 (dpy, data, len) - -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#define max(a,b) (((a) > (b)) ? (a) : (b)) - -#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \ - (((cs)->rbearing|(cs)->lbearing| \ - (cs)->ascent|(cs)->descent) == 0)) - -/* - * CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit - * character. If the character is in the column and exists, then return the - * appropriate metrics (note that fonts with common per-character metrics will - * return min_bounds). If none of these hold true, try again with the default - * char. - */ -#define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \ -{ \ - cs = def; \ - if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ - if (fs->per_char == NULL) { \ - cs = &fs->min_bounds; \ - } else { \ - cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \ - if (CI_NONEXISTCHAR(cs)) cs = def; \ - } \ - } \ -} - -#define CI_GET_DEFAULT_INFO_1D(fs,cs) \ - CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs) - - - -/* - * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and - * column. This is used for fonts that have more than row zero. - */ -#define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \ -{ \ - cs = def; \ - if (row >= fs->min_byte1 && row <= fs->max_byte1 && \ - col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ - if (fs->per_char == NULL) { \ - cs = &fs->min_bounds; \ - } else { \ - cs = &fs->per_char[((row - fs->min_byte1) * \ - (fs->max_char_or_byte2 - \ - fs->min_char_or_byte2 + 1)) + \ - (col - fs->min_char_or_byte2)]; \ - if (CI_NONEXISTCHAR(cs)) cs = def; \ - } \ - } \ -} - -#define CI_GET_DEFAULT_INFO_2D(fs,cs) \ -{ \ - unsigned int r = (fs->default_char >> 8); \ - unsigned int c = (fs->default_char & 0xff); \ - CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \ -} - - -#ifdef MUSTCOPY - -/* for when 32-bit alignment is not good enough */ -#define OneDataCard32(dpy,dstaddr,srcvar) \ - { dpy->bufptr -= 4; Data32 (dpy, (char *) &(srcvar), 4); } - -#else - -/* srcvar must be a variable for large architecture version */ -#define OneDataCard32(dpy,dstaddr,srcvar) \ - { *(CARD32 *)(dstaddr) = (srcvar); } - -#endif /* MUSTCOPY */ - -typedef struct _XInternalAsync { - struct _XInternalAsync *next; - /* - * handler arguments: - * rep is the generic reply that caused this handler - * to be invoked. It must also be passed to _XGetAsyncReply. - * buf and len are opaque values that must be passed to - * _XGetAsyncReply or _XGetAsyncData. - * data is the closure stored in this struct. - * The handler returns True iff it handled this reply. - */ - Bool (*handler)( - Display* /* dpy */, - xReply* /* rep */, - char* /* buf */, - int /* len */, - XPointer /* data */ - ); - XPointer data; -} _XAsyncHandler; - -typedef struct _XAsyncEState { - unsigned long min_sequence_number; - unsigned long max_sequence_number; - unsigned char error_code; - unsigned char major_opcode; - unsigned short minor_opcode; - unsigned char last_error_received; - int error_count; -} _XAsyncErrorState; - -extern void _XDeqAsyncHandler(Display *dpy, _XAsyncHandler *handler); -#define DeqAsyncHandler(dpy,handler) { \ - if (dpy->async_handlers == (handler)) \ - dpy->async_handlers = (handler)->next; \ - else \ - _XDeqAsyncHandler(dpy, handler); \ - } - -typedef void (*FreeFuncType) ( - Display* /* display */ -); - -typedef int (*FreeModmapType) ( - XModifierKeymap* /* modmap */ -); - -/* - * This structure is private to the library. - */ -typedef struct _XFreeFuncs { - FreeFuncType atoms; /* _XFreeAtomTable */ - FreeModmapType modifiermap; /* XFreeModifierMap */ - FreeFuncType key_bindings; /* _XFreeKeyBindings */ - FreeFuncType context_db; /* _XFreeContextDB */ - FreeFuncType defaultCCCs; /* _XcmsFreeDefaultCCCs */ - FreeFuncType clientCmaps; /* _XcmsFreeClientCmaps */ - FreeFuncType intensityMaps; /* _XcmsFreeIntensityMaps */ - FreeFuncType im_filters; /* _XFreeIMFilters */ - FreeFuncType xkb; /* _XkbFreeInfo */ -} _XFreeFuncRec; - -/* types for InitExt.c */ -typedef int (*CreateGCType) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -); - -typedef int (*CopyGCType)( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -); - -typedef int (*FlushGCType) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -); - -typedef int (*FreeGCType) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -); - -typedef int (*CreateFontType) ( - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ -); - -typedef int (*FreeFontType) ( - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ -); - -typedef int (*CloseDisplayType) ( - Display* /* display */, - XExtCodes* /* codes */ -); - -typedef int (*ErrorType) ( - Display* /* display */, - xError* /* err */, - XExtCodes* /* codes */, - int* /* ret_code */ -); - -typedef char* (*ErrorStringType) ( - Display* /* display */, - int /* code */, - XExtCodes* /* codes */, - char* /* buffer */, - int /* nbytes */ -); - -typedef void (*PrintErrorType)( - Display* /* display */, - XErrorEvent* /* ev */, - void* /* fp */ -); - -typedef void (*BeforeFlushType)( - Display* /* display */, - XExtCodes* /* codes */, - _Xconst char* /* data */, - long /* len */ -); - -/* - * This structure is private to the library. - */ -typedef struct _XExten { /* private to extension mechanism */ - struct _XExten *next; /* next in list */ - XExtCodes codes; /* public information, all extension told */ - CreateGCType create_GC; /* routine to call when GC created */ - CopyGCType copy_GC; /* routine to call when GC copied */ - FlushGCType flush_GC; /* routine to call when GC flushed */ - FreeGCType free_GC; /* routine to call when GC freed */ - CreateFontType create_Font; /* routine to call when Font created */ - FreeFontType free_Font; /* routine to call when Font freed */ - CloseDisplayType close_display; /* routine to call when connection closed */ - ErrorType error; /* who to call when an error occurs */ - ErrorStringType error_string; /* routine to supply error string */ - char *name; /* name of this extension */ - PrintErrorType error_values; /* routine to supply error values */ - BeforeFlushType before_flush; /* routine to call when sending data */ - struct _XExten *next_flush; /* next in list of those with flushes */ -} _XExtension; - -/* extension hooks */ - -#ifdef DataRoutineIsProcedure -extern void Data(Display *dpy, char *data, long len); -#endif -extern int _XError( - Display* /* dpy */, - xError* /* rep */ -); -extern int _XIOError( - Display* /* dpy */ -); -extern int (*_XIOErrorFunction)( - Display* /* dpy */ -); -extern int (*_XErrorFunction)( - Display* /* dpy */, - XErrorEvent* /* error_event */ -); -extern void _XEatData( - Display* /* dpy */, - unsigned long /* n */ -); -extern char *_XAllocScratch( - Display* /* dpy */, - unsigned long /* nbytes */ -); -extern char *_XAllocTemp( - Display* /* dpy */, - unsigned long /* nbytes */ -); -extern void _XFreeTemp( - Display* /* dpy */, - char* /* buf */, - unsigned long /* nbytes */ -); -extern Visual *_XVIDtoVisual( - Display* /* dpy */, - VisualID /* id */ -); -extern unsigned long _XSetLastRequestRead( - Display* /* dpy */, - xGenericReply* /* rep */ -); -extern int _XGetHostname( - char* /* buf */, - int /* maxlen */ -); -extern Screen *_XScreenOfWindow( - Display* /* dpy */, - Window /* w */ -); -extern Bool _XAsyncErrorHandler( - Display* /* dpy */, - xReply* /* rep */, - char* /* buf */, - int /* len */, - XPointer /* data */ -); -extern char *_XGetAsyncReply( - Display* /* dpy */, - char* /* replbuf */, - xReply* /* rep */, - char* /* buf */, - int /* len */, - int /* extra */, - Bool /* discard */ -); -extern void _XGetAsyncData( - Display* /* dpy */, - char * /* data */, - char * /* buf */, - int /* len */, - int /* skip */, - int /* datalen */, - int /* discardtotal */ -); -extern void _XFlush( - Display* /* dpy */ -); -extern int _XEventsQueued( - Display* /* dpy */, - int /* mode */ -); -extern void _XReadEvents( - Display* /* dpy */ -); -extern int _XRead( - Display* /* dpy */, - char* /* data */, - long /* size */ -); -extern void _XReadPad( - Display* /* dpy */, - char* /* data */, - long /* size */ -); -extern void _XSend( - Display* /* dpy */, - _Xconst char* /* data */, - long /* size */ -); -extern Status _XReply( - Display* /* dpy */, - xReply* /* rep */, - int /* extra */, - Bool /* discard */ -); -extern void _XEnq( - Display* /* dpy */, - xEvent* /* event */ -); -extern void _XDeq( - Display* /* dpy */, - _XQEvent* /* prev */, - _XQEvent* /* qelt */ -); - -extern Bool _XUnknownWireEvent( - Display* /* dpy */, - XEvent* /* re */, - xEvent* /* event */ -); -extern Status _XUnknownNativeEvent( - Display* /* dpy */, - XEvent* /* re */, - xEvent* /* event */ -); - -extern Bool _XWireToEvent(Display *dpy, XEvent *re, xEvent *event); -extern Bool _XDefaultWireError(Display *display, XErrorEvent *he, xError *we); -extern Bool _XPollfdCacheInit(Display *dpy); -extern void _XPollfdCacheAdd(Display *dpy, int fd); -extern void _XPollfdCacheDel(Display *dpy, int fd); -extern XID _XAllocID(Display *dpy); -extern void _XAllocIDs(Display *dpy, XID *ids, int count); - -extern int _XFreeExtData( - XExtData* /* extension */ -); - -extern int (*XESetCreateGC( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, GC, XExtCodes* -); - -extern int (*XESetCopyGC( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, GC, XExtCodes* -); - -extern int (*XESetFlushGC( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, GC, XExtCodes* -); - -extern int (*XESetFreeGC( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, GC, XExtCodes* -); - -extern int (*XESetCreateFont( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, XFontStruct*, XExtCodes* -); - -extern int (*XESetFreeFont( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, XFontStruct*, XExtCodes* -); - -extern int (*XESetCloseDisplay( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - XExtCodes* /* codes */ - ) /* proc */ -))( - Display*, XExtCodes* -); - -extern int (*XESetError( - Display* /* display */, - int /* extension */, - int (*) ( - Display* /* display */, - xError* /* err */, - XExtCodes* /* codes */, - int* /* ret_code */ - ) /* proc */ -))( - Display*, xError*, XExtCodes*, int* -); - -extern char* (*XESetErrorString( - Display* /* display */, - int /* extension */, - char* (*) ( - Display* /* display */, - int /* code */, - XExtCodes* /* codes */, - char* /* buffer */, - int /* nbytes */ - ) /* proc */ -))( - Display*, int, XExtCodes*, char*, int -); - -extern void (*XESetPrintErrorValues ( - Display* /* display */, - int /* extension */, - void (*)( - Display* /* display */, - XErrorEvent* /* ev */, - void* /* fp */ - ) /* proc */ -))( - Display*, XErrorEvent*, void* -); - -extern Bool (*XESetWireToEvent( - Display* /* display */, - int /* event_number */, - Bool (*) ( - Display* /* display */, - XEvent* /* re */, - xEvent* /* event */ - ) /* proc */ -))( - Display*, XEvent*, xEvent* -); - -extern Status (*XESetEventToWire( - Display* /* display */, - int /* event_number */, - Status (*) ( - Display* /* display */, - XEvent* /* re */, - xEvent* /* event */ - ) /* proc */ -))( - Display*, XEvent*, xEvent* -); - -extern Bool (*XESetWireToError( - Display* /* display */, - int /* error_number */, - Bool (*) ( - Display* /* display */, - XErrorEvent* /* he */, - xError* /* we */ - ) /* proc */ -))( - Display*, XErrorEvent*, xError* -); - -extern void (*XESetBeforeFlush( - Display* /* display */, - int /* error_number */, - void (*) ( - Display* /* display */, - XExtCodes* /* codes */, - _Xconst char* /* data */, - long /* len */ - ) /* proc */ -))( - Display*, XExtCodes*, _Xconst char*, long -); - -/* internal connections for IMs */ - -typedef void (*_XInternalConnectionProc)( - Display* /* dpy */, - int /* fd */, - XPointer /* call_data */ -); - - -extern Status _XRegisterInternalConnection( - Display* /* dpy */, - int /* fd */, - _XInternalConnectionProc /* callback */, - XPointer /* call_data */ -); - -extern void _XUnregisterInternalConnection( - Display* /* dpy */, - int /* fd */ -); - -/* Display structure has pointers to these */ - -struct _XConnectionInfo { /* info from _XRegisterInternalConnection */ - int fd; - _XInternalConnectionProc read_callback; - XPointer call_data; - XPointer *watch_data; /* set/used by XConnectionWatchProc */ - struct _XConnectionInfo *next; -}; - -struct _XConnWatchInfo { /* info from XAddConnectionWatch */ - XConnectionWatchProc fn; - XPointer client_data; - struct _XConnWatchInfo *next; -}; - -#ifdef __UNIXOS2__ -extern char* __XOS2RedirRoot( - char* -); -#endif - -extern int _XTextHeight( - XFontStruct* /* font_struct */, - _Xconst char* /* string */, - int /* count */ -); - -extern int _XTextHeight16( - XFontStruct* /* font_struct */, - _Xconst XChar2b* /* string */, - int /* count */ -); - -#if defined(WIN32) - -extern int _XOpenFile( - _Xconst char* /* path */, - int /* flags */ -); - -extern void* _XFopenFile( - _Xconst char* /* path */, - _Xconst char* /* mode */ -); - -extern int _XAccessFile( - _Xconst char* /* path */ -); -#else -#define _XOpenFile(path,flags) open(path,flags) -#define _XFopenFile(path,mode) fopen(path,mode) -#endif - -/* EvToWire.c */ -extern Status _XEventToWire(Display *dpy, XEvent *re, xEvent *event); - -extern int _XF86LoadQueryLocaleFont( - Display* /* dpy */, - _Xconst char* /* name*/, - XFontStruct** /* xfp*/, - Font* /* fidp */ -); - -extern void _XProcessWindowAttributes ( - register Display *dpy, - xChangeWindowAttributesReq *req, - register unsigned long valuemask, - register XSetWindowAttributes *attributes); - -extern int _XDefaultError( - Display *dpy, - XErrorEvent *event); - -extern int _XDefaultIOError( - Display *dpy); - -extern void _XSetClipRectangles ( - register Display *dpy, - GC gc, - int clip_x_origin, int clip_y_origin, - XRectangle *rectangles, - int n, - int ordering); - -Status _XGetWindowAttributes( - register Display *dpy, - Window w, - XWindowAttributes *attr); - -int _XPutBackEvent ( - register Display *dpy, - register XEvent *event); - -_XFUNCPROTOEND - -#endif /* _XLIBINT_H_ */ diff --git a/nx-X11/lib/X11/cmsProp.c.X.original b/nx-X11/lib/X11/cmsProp.c.X.original deleted file mode 100644 index 4040a05ce..000000000 --- a/nx-X11/lib/X11/cmsProp.c.X.original +++ /dev/null @@ -1,148 +0,0 @@ -/* $Xorg: cmsProp.c,v 1.3 2000/08/17 19:45:10 cpqbld Exp $ */ - -/* - * - * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. - * All Rights Reserved - * - * This file is a component of an X Window System-specific implementation - * of Xcms based on the TekColor Color Management System. Permission is - * hereby granted to use, copy, modify, sell, and otherwise distribute this - * software and its documentation for any purpose and without fee, provided - * that this copyright, permission, and disclaimer notice is reproduced in - * all copies of this software and in supporting documentation. TekColor - * is a trademark of Tektronix, Inc. - * - * Tektronix makes no representation about the suitability of this software - * for any purpose. It is provided "as is" and with all faults. - * - * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, - * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX 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 THE PERFORMANCE OF THIS SOFTWARE. - * - * NAME - * XcmsProp.c - * - * DESCRIPTION - * This utility routines for manipulating properties. - * - */ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include "Xlibint.h" -#include "Xcmsint.h" -#include "Cv.h" - - -/************************************************************************ - * * - * API PRIVATE ROUTINES * - * * - ************************************************************************/ - - -/* - * NAME - * _XcmsGetElement -- get an element value from the property passed - * - * SYNOPSIS - */ -unsigned long -_XcmsGetElement( - int format, - char **pValue, - unsigned long *pCount) -/* - * DESCRIPTION - * Get the next element from the property and return it. - * Also increment the pointer the amount needed. - * - * Returns - * unsigned long - */ -{ - unsigned long value; - - switch (format) { - case 32: - value = *((unsigned long *)(*pValue)) & 0xFFFFFFFF; - *pValue += sizeof(unsigned long); - *pCount -= 1; - break; - case 16: - value = *((unsigned short *)(*pValue)); - *pValue += sizeof(unsigned short); - *pCount -= 1; - break; - case 8: - value = *((unsigned char *) (*pValue)); - *pValue += 1; - *pCount -= 1; - break; - default: - value = 0; - break; - } - return(value); -} - - -/* - * NAME - * _XcmsGetProperty -- Determine the existance of a property - * - * SYNOPSIS - */ -int -_XcmsGetProperty( - Display *pDpy, - Window w, - Atom property, - int *pFormat, - unsigned long *pNItems, - unsigned long *pNBytes, - char **pValue) -/* - * DESCRIPTION - * - * Returns - * 0 if property does not exist. - * 1 if property exists. - */ -{ - char *prop_ret; - int format_ret; - long len = 6516; - unsigned long nitems_ret, after_ret; - Atom atom_ret; - - while (XGetWindowProperty (pDpy, w, property, 0, len, False, - XA_INTEGER, &atom_ret, &format_ret, - &nitems_ret, &after_ret, - (unsigned char **)&prop_ret)) { - if (after_ret > 0) { - len += nitems_ret * (format_ret >> 3); - XFree (prop_ret); - } else { - break; - } - } - if (format_ret == 0 || nitems_ret == 0) { - /* the property does not exist or is of an unexpected type */ - return(XcmsFailure); - } - - *pFormat = format_ret; - *pNItems = nitems_ret; - *pNBytes = nitems_ret * (format_ret >> 3); - *pValue = prop_ret; - return(XcmsSuccess); -} diff --git a/nx-X11/lib/Xau/AuRead.c.NX.original b/nx-X11/lib/Xau/AuRead.c.NX.original deleted file mode 100644 index 60a0d747f..000000000 --- a/nx-X11/lib/Xau/AuRead.c.NX.original +++ /dev/null @@ -1,137 +0,0 @@ -/* $Xorg: AuRead.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */ - -/* - -Copyright 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/Xau/AuRead.c,v 1.5 2001/07/25 15:04:48 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include - -static int -read_short (unsigned short *shortp, FILE *file) -{ - unsigned char file_short[2]; - - /* - * Added a check on EINTR to prevent the fread() call to be - * interrupted by any signal not blocked by OsBlockSignals(). - */ - - for (;;) { - if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) { - if (errno == EINTR && ferror (file)) { - perror ("Reading from auth file"); - clearerr (file); - continue; - } - return 0; - } - break; - } - *shortp = file_short[0] * 256 + file_short[1]; - return 1; -} - -static int -read_counted_string (unsigned short *countp, char **stringp, FILE *file) -{ - unsigned short len; - char *data; - - if (read_short (&len, file) == 0) - return 0; - if (len == 0) { - data = 0; - } else { - data = malloc ((unsigned) len); - if (!data) - return 0; - for (;;) - { - if (fread (data, (int) sizeof (char), (int) len, file) != len) - { - if (errno == EINTR && ferror (file)) - { - perror ("Reading from auth file"); - clearerr (file); - continue; - } - bzero (data, len); - free (data); - return 0; - } - break; - } - } - *stringp = data; - *countp = len; - return 1; -} - -Xauth * -XauReadAuth (auth_file) -FILE *auth_file; -{ - Xauth local; - Xauth *ret; - - if (read_short (&local.family, auth_file) == 0) - return 0; - if (read_counted_string (&local.address_length, &local.address, auth_file) == 0) - return 0; - if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) { - if (local.address) free (local.address); - return 0; - } - if (read_counted_string (&local.name_length, &local.name, auth_file) == 0) { - if (local.address) free (local.address); - if (local.number) free (local.number); - return 0; - } - if (read_counted_string (&local.data_length, &local.data, auth_file) == 0) { - if (local.address) free (local.address); - if (local.number) free (local.number); - if (local.name) free (local.name); - return 0; - } - ret = (Xauth *) malloc (sizeof (Xauth)); - if (!ret) { - if (local.address) free (local.address); - if (local.number) free (local.number); - if (local.name) free (local.name); - if (local.data) { - bzero (local.data, local.data_length); - free (local.data); - } - return 0; - } - *ret = local; - return ret; -} diff --git a/nx-X11/lib/Xau/AuRead.c.X.original b/nx-X11/lib/Xau/AuRead.c.X.original deleted file mode 100644 index f7cdf8f3a..000000000 --- a/nx-X11/lib/Xau/AuRead.c.X.original +++ /dev/null @@ -1,111 +0,0 @@ -/* $Xorg: AuRead.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */ - -/* - -Copyright 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/Xau/AuRead.c,v 1.5 2001/07/25 15:04:48 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -static int -read_short (unsigned short *shortp, FILE *file) -{ - unsigned char file_short[2]; - - if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) - return 0; - *shortp = file_short[0] * 256 + file_short[1]; - return 1; -} - -static int -read_counted_string (unsigned short *countp, char **stringp, FILE *file) -{ - unsigned short len; - char *data; - - if (read_short (&len, file) == 0) - return 0; - if (len == 0) { - data = 0; - } else { - data = malloc ((unsigned) len); - if (!data) - return 0; - if (fread (data, (int) sizeof (char), (int) len, file) != len) { - bzero (data, len); - free (data); - return 0; - } - } - *stringp = data; - *countp = len; - return 1; -} - -Xauth * -XauReadAuth (auth_file) -FILE *auth_file; -{ - Xauth local; - Xauth *ret; - - if (read_short (&local.family, auth_file) == 0) - return 0; - if (read_counted_string (&local.address_length, &local.address, auth_file) == 0) - return 0; - if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) { - if (local.address) free (local.address); - return 0; - } - if (read_counted_string (&local.name_length, &local.name, auth_file) == 0) { - if (local.address) free (local.address); - if (local.number) free (local.number); - return 0; - } - if (read_counted_string (&local.data_length, &local.data, auth_file) == 0) { - if (local.address) free (local.address); - if (local.number) free (local.number); - if (local.name) free (local.name); - return 0; - } - ret = (Xauth *) malloc (sizeof (Xauth)); - if (!ret) { - if (local.address) free (local.address); - if (local.number) free (local.number); - if (local.name) free (local.name); - if (local.data) { - bzero (local.data, local.data_length); - free (local.data); - } - return 0; - } - *ret = local; - return ret; -} diff --git a/nx-X11/lib/Xpm/Imakefile.NX.original b/nx-X11/lib/Xpm/Imakefile.NX.original deleted file mode 100644 index dd98b2fb8..000000000 --- a/nx-X11/lib/Xpm/Imakefile.NX.original +++ /dev/null @@ -1,126 +0,0 @@ -XCOMM $XFree86: xc/lib/Xpm/Imakefile,v 1.1 1999/01/11 14:40:02 dawes Exp $ - -/* This is a simplified version of the standard Xpm Imakefile */ - -#ifdef SunArchitecture -#define DoNormalLib YES -#else -#define DoNormalLib NormalLibXpm -#endif -#define DoSharedLib SharedLibXpm -#define DoExtraLib SharedLibXpm -#define DoDebugLib DebugLibXpm -#define DoProfileLib ProfileLibXpm -#define HasSharedData NO -#define LibName Xpm -#define SoRev SOXPMREV -#define IncSubdir X11 - -#ifdef SharedXpmReqs -REQUIREDLIBS = SharedXpmReqs -#endif - -/* - * if your system doesn't provide strcasecmp add -DNEED_STRCASECMP - * if your system doesn't provide strdup add -DNEED_STRDUP - * if your system doesn't provide pipe add -DNO_ZPIPE - * if on your system sprintf doesn't return the number of bytes transmitted - * add -DVOID_SPRINTF - * if you want xpm to try name.xpm.Z and name.xpm.gz when asked to read - * name.xpm , add -DSTAT_ZFILE - */ - -#if defined(LinuxArchitecture) -ZFILEDEF = -DSTAT_ZFILE -#endif -#if defined(UltrixArchitecture) || \ - (defined(MipsArchitecture) && !defined(SGIArchitecture)) -STRDUPDEF = -DNEED_STRDUP -#endif - -#if !HasStrcasecmp -STRCASECMPDEF = -DNEED_STRCASECMP -#endif - -#if defined(SunArchitecture) && !defined(SVR4Architecture) -SPRINTFDEF = -DVOID_SPRINTF -#endif - -#if HasStrlcat -STRLCATDEF = -DHAS_STRLCAT -#endif - -#if HasSnprintf -SNPRINTFDEF = -DHAS_SNPRINTF -#else -SNPRINTFDEF = -Dsnprintf=_XpmSnprintf -SNPRINTFSRCS = snprintf.c -SNPRINTFOBJS = snprintf.o -#endif - -#if defined(Win32Architecture) -ZPIPEDEF = -DNO_ZPIPE -#endif - -DEFINES = $(STRDUPDEF) $(STRCASECMPDEF) $(SPRINTFDEF) $(STRLCATDEF) \ - $(SNPRINTFDEF) $(ZPIPEDEF) $(ZFILEDEF) - -HEADERS = xpm.h - - SRCS = data.c create.c misc.c rgb.c scan.c parse.c hashtab.c \ - CrBufFrI.c CrDatFrP.c CrPFrBuf.c RdFToI.c WrFFrI.c \ - CrBufFrP.c CrIFrBuf.c CrPFrDat.c RdFToP.c WrFFrP.c \ - CrDatFrI.c CrIFrDat.c RdFToDat.c WrFFrDat.c \ - Attrib.c CrIFrP.c CrPFrI.c Image.c Info.c RdFToBuf.c WrFFrBuf.c \ - $(SNPRINTFSRCS) - - OBJS = data.o create.o misc.o rgb.o scan.o parse.o hashtab.o \ - CrBufFrI.o CrDatFrP.o CrPFrBuf.o RdFToI.o WrFFrI.o \ - CrBufFrP.o CrIFrBuf.o CrPFrDat.o RdFToP.o WrFFrP.o \ - CrDatFrI.o CrIFrDat.o RdFToDat.o WrFFrDat.o \ - Attrib.o CrIFrP.o CrPFrI.o Image.o Info.o RdFToBuf.o WrFFrBuf.o \ - $(SNPRINTFOBJS) - - XPMDIR = $(TOP)/extras/Xpm - XPMLIBDIR = $(TOP)/extras/Xpm/lib - - INCLUDES = -I$(XPMLIBDIR) - LINTLIBS = $(LINTXTOLL) $(LINTXLIB) - -#include - -LinkSourceFile(data.c,$(XPMLIBDIR)) -LinkSourceFile(create.c,$(XPMLIBDIR)) -LinkSourceFile(misc.c,$(XPMLIBDIR)) -LinkSourceFile(rgb.c,$(XPMLIBDIR)) -LinkSourceFile(scan.c,$(XPMLIBDIR)) -LinkSourceFile(parse.c,$(XPMLIBDIR)) -LinkSourceFile(hashtab.c,$(XPMLIBDIR)) -LinkSourceFile(CrBufFrI.c,$(XPMLIBDIR)) -LinkSourceFile(CrDatFrP.c,$(XPMLIBDIR)) -LinkSourceFile(CrPFrBuf.c,$(XPMLIBDIR)) -LinkSourceFile(RdFToI.c,$(XPMLIBDIR)) -LinkSourceFile(WrFFrI.c,$(XPMLIBDIR)) -LinkSourceFile(CrBufFrP.c,$(XPMLIBDIR)) -LinkSourceFile(CrIFrBuf.c,$(XPMLIBDIR)) -LinkSourceFile(CrPFrDat.c,$(XPMLIBDIR)) -LinkSourceFile(RdFToP.c,$(XPMLIBDIR)) -LinkSourceFile(WrFFrP.c,$(XPMLIBDIR)) -LinkSourceFile(CrDatFrI.c,$(XPMLIBDIR)) -LinkSourceFile(CrIFrDat.c,$(XPMLIBDIR)) -LinkSourceFile(RdFToDat.c,$(XPMLIBDIR)) -LinkSourceFile(WrFFrDat.c,$(XPMLIBDIR)) -LinkSourceFile(Attrib.c,$(XPMLIBDIR)) -LinkSourceFile(CrIFrP.c,$(XPMLIBDIR)) -LinkSourceFile(CrPFrI.c,$(XPMLIBDIR)) -LinkSourceFile(Image.c,$(XPMLIBDIR)) -LinkSourceFile(Info.c,$(XPMLIBDIR)) -LinkSourceFile(RdFToBuf.c,$(XPMLIBDIR)) -LinkSourceFile(WrFFrBuf.c,$(XPMLIBDIR)) -LinkSourceFile(xpm.h,$(XPMLIBDIR)) - -#if !HasSnprintf -LinkSourceFile(snprintf.c,$(LIBSRC)/misc) -#endif - -DependTarget() diff --git a/nx-X11/lib/Xpm/Imakefile.X.original b/nx-X11/lib/Xpm/Imakefile.X.original deleted file mode 100644 index 9899fe209..000000000 --- a/nx-X11/lib/Xpm/Imakefile.X.original +++ /dev/null @@ -1,122 +0,0 @@ -XCOMM $XFree86: xc/lib/Xpm/Imakefile,v 1.1 1999/01/11 14:40:02 dawes Exp $ - -/* This is a simplified version of the standard Xpm Imakefile */ - -#define DoNormalLib NormalLibXpm -#define DoSharedLib SharedLibXpm -#define DoExtraLib SharedLibXpm -#define DoDebugLib DebugLibXpm -#define DoProfileLib ProfileLibXpm -#define HasSharedData NO -#define LibName Xpm -#define SoRev SOXPMREV -#define IncSubdir X11 - -#ifdef SharedXpmReqs -REQUIREDLIBS = SharedXpmReqs -#endif - -/* - * if your system doesn't provide strcasecmp add -DNEED_STRCASECMP - * if your system doesn't provide strdup add -DNEED_STRDUP - * if your system doesn't provide pipe add -DNO_ZPIPE - * if on your system sprintf doesn't return the number of bytes transmitted - * add -DVOID_SPRINTF - * if you want xpm to try name.xpm.Z and name.xpm.gz when asked to read - * name.xpm , add -DSTAT_ZFILE - */ - -#if defined(LinuxArchitecture) -ZFILEDEF = -DSTAT_ZFILE -#endif -#if defined(UltrixArchitecture) || \ - (defined(MipsArchitecture) && !defined(SGIArchitecture)) -STRDUPDEF = -DNEED_STRDUP -#endif - -#if !HasStrcasecmp -STRCASECMPDEF = -DNEED_STRCASECMP -#endif - -#if defined(SunArchitecture) && !defined(SVR4Architecture) -SPRINTFDEF = -DVOID_SPRINTF -#endif - -#if HasStrlcat -STRLCATDEF = -DHAS_STRLCAT -#endif - -#if HasSnprintf -SNPRINTFDEF = -DHAS_SNPRINTF -#else -SNPRINTFDEF = -Dsnprintf=_XpmSnprintf -SNPRINTFSRCS = snprintf.c -SNPRINTFOBJS = snprintf.o -#endif - -#if defined(Win32Architecture) -ZPIPEDEF = -DNO_ZPIPE -#endif - -DEFINES = $(STRDUPDEF) $(STRCASECMPDEF) $(SPRINTFDEF) $(STRLCATDEF) \ - $(SNPRINTFDEF) $(ZPIPEDEF) $(ZFILEDEF) - -HEADERS = xpm.h - - SRCS = data.c create.c misc.c rgb.c scan.c parse.c hashtab.c \ - CrBufFrI.c CrDatFrP.c CrPFrBuf.c RdFToI.c WrFFrI.c \ - CrBufFrP.c CrIFrBuf.c CrPFrDat.c RdFToP.c WrFFrP.c \ - CrDatFrI.c CrIFrDat.c RdFToDat.c WrFFrDat.c \ - Attrib.c CrIFrP.c CrPFrI.c Image.c Info.c RdFToBuf.c WrFFrBuf.c \ - $(SNPRINTFSRCS) - - OBJS = data.o create.o misc.o rgb.o scan.o parse.o hashtab.o \ - CrBufFrI.o CrDatFrP.o CrPFrBuf.o RdFToI.o WrFFrI.o \ - CrBufFrP.o CrIFrBuf.o CrPFrDat.o RdFToP.o WrFFrP.o \ - CrDatFrI.o CrIFrDat.o RdFToDat.o WrFFrDat.o \ - Attrib.o CrIFrP.o CrPFrI.o Image.o Info.o RdFToBuf.o WrFFrBuf.o \ - $(SNPRINTFOBJS) - - XPMDIR = $(TOP)/extras/Xpm - XPMLIBDIR = $(TOP)/extras/Xpm/lib - - INCLUDES = -I$(XPMLIBDIR) - LINTLIBS = $(LINTXTOLL) $(LINTXLIB) - -#include - -LinkSourceFile(data.c,$(XPMLIBDIR)) -LinkSourceFile(create.c,$(XPMLIBDIR)) -LinkSourceFile(misc.c,$(XPMLIBDIR)) -LinkSourceFile(rgb.c,$(XPMLIBDIR)) -LinkSourceFile(scan.c,$(XPMLIBDIR)) -LinkSourceFile(parse.c,$(XPMLIBDIR)) -LinkSourceFile(hashtab.c,$(XPMLIBDIR)) -LinkSourceFile(CrBufFrI.c,$(XPMLIBDIR)) -LinkSourceFile(CrDatFrP.c,$(XPMLIBDIR)) -LinkSourceFile(CrPFrBuf.c,$(XPMLIBDIR)) -LinkSourceFile(RdFToI.c,$(XPMLIBDIR)) -LinkSourceFile(WrFFrI.c,$(XPMLIBDIR)) -LinkSourceFile(CrBufFrP.c,$(XPMLIBDIR)) -LinkSourceFile(CrIFrBuf.c,$(XPMLIBDIR)) -LinkSourceFile(CrPFrDat.c,$(XPMLIBDIR)) -LinkSourceFile(RdFToP.c,$(XPMLIBDIR)) -LinkSourceFile(WrFFrP.c,$(XPMLIBDIR)) -LinkSourceFile(CrDatFrI.c,$(XPMLIBDIR)) -LinkSourceFile(CrIFrDat.c,$(XPMLIBDIR)) -LinkSourceFile(RdFToDat.c,$(XPMLIBDIR)) -LinkSourceFile(WrFFrDat.c,$(XPMLIBDIR)) -LinkSourceFile(Attrib.c,$(XPMLIBDIR)) -LinkSourceFile(CrIFrP.c,$(XPMLIBDIR)) -LinkSourceFile(CrPFrI.c,$(XPMLIBDIR)) -LinkSourceFile(Image.c,$(XPMLIBDIR)) -LinkSourceFile(Info.c,$(XPMLIBDIR)) -LinkSourceFile(RdFToBuf.c,$(XPMLIBDIR)) -LinkSourceFile(WrFFrBuf.c,$(XPMLIBDIR)) -LinkSourceFile(xpm.h,$(XPMLIBDIR)) - -#if !HasSnprintf -LinkSourceFile(snprintf.c,$(LIBSRC)/misc) -#endif - -DependTarget() diff --git a/nx-X11/lib/Xrender/Glyph.c.NX.original b/nx-X11/lib/Xrender/Glyph.c.NX.original deleted file mode 100644 index e25805f5c..000000000 --- a/nx-X11/lib/Xrender/Glyph.c.NX.original +++ /dev/null @@ -1,1169 +0,0 @@ -/* - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xrenderint.h" - -/* - * NX_RENDER_CLEANUP enables cleaning of padding bytes - */ - -#define NX_RENDER_CLEANUP - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG -#undef DUMP - -#ifdef NX_RENDER_CLEANUP - -#include - -#define ROUNDUP(nbits, pad) ((((nbits) + ((pad)-1)) / (pad)) * ((pad)>>3)) - -#endif /* NX_RENDER_CLEANUP */ - -GlyphSet -XRenderCreateGlyphSet (Display *dpy, _Xconst XRenderPictFormat *format) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - GlyphSet gsid; - xRenderCreateGlyphSetReq *req; - - RenderCheckExtension (dpy, info, 0); - LockDisplay(dpy); - GetReq(RenderCreateGlyphSet, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCreateGlyphSet; - req->gsid = gsid = XAllocID(dpy); - req->format = format->id; - UnlockDisplay(dpy); - SyncHandle(); - return gsid; -} - -GlyphSet -XRenderReferenceGlyphSet (Display *dpy, GlyphSet existing) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - GlyphSet gsid; - xRenderReferenceGlyphSetReq *req; - - RenderCheckExtension (dpy, info, 0); - LockDisplay(dpy); - GetReq(RenderReferenceGlyphSet, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderReferenceGlyphSet; - req->gsid = gsid = XAllocID(dpy); - req->existing = existing; - UnlockDisplay(dpy); - SyncHandle(); - return gsid; -} - -void -XRenderFreeGlyphSet (Display *dpy, GlyphSet glyphset) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderFreeGlyphSetReq *req; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - GetReq(RenderFreeGlyphSet, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderFreeGlyphSet; - req->glyphset = glyphset; - UnlockDisplay(dpy); - SyncHandle(); -} - -#ifdef NX_RENDER_CLEANUP - -void -XRenderCleanGlyphs(xGlyphInfo *gi, - int nglyphs, - CARD8 *images, - int depth, - Display *dpy) -{ - - int widthInBits; - int bytesPerLine; - int bytesToClean; - int bitsToClean; - int widthInBytes; - int height = gi -> height; - register int i; - int j; - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: Found a Glyph with Depth %d, width %d, pad %d.\n", - depth, gi -> width, dpy -> bitmap_pad); - #endif - - while (nglyphs > 0) - { - if (depth == 24) - { - widthInBits = gi -> width * 32; - - bytesPerLine = ROUNDUP(widthInBits, dpy -> bitmap_pad); - - bytesToClean = bytesPerLine * height; - - #ifdef DUBUG - fprintf(stderr, "nxagentCleanGlyphs: Found glyph with depth 24, bytes to clean is %d" - "width in bits is %d bytes per line [%d] height [%d].\n", bytesToClean, - widthInBits, bytesPerLine, height); - #endif - - if (dpy -> byte_order == LSBFirst) - { - for (i = 3; i < bytesToClean; i += 4) - { - images[i] = 0x00; - } - } - else - { - for (i = 0; i < bytesToClean; i += 4) - { - images[i] = 0x00; - } - } - - #ifdef DUMP - fprintf(stderr, "nxagentCleanGlyphs: depth %d, bytesToClean %d, scanline: ", depth, bytesToClean); - for (i = 0; i < bytesPerLine; i++) - { - fprintf(stderr, "[%d]", images[i]); - } - fprintf(stderr,"\n"); - #endif - - images += bytesToClean; - - gi++; - - nglyphs--; - } - else if (depth == 1) - { - widthInBits = gi -> width; - - bytesPerLine = ROUNDUP(widthInBits, dpy -> bitmap_pad); - - bitsToClean = (bytesPerLine << 3) - (gi -> width); - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: Found glyph with depth 1, width [%d], height [%d], bitsToClean [%d]," - " bytesPerLine [%d].\n", gi -> width, height, bitsToClean, bytesPerLine); - #endif - - bytesToClean = bitsToClean >> 3; - - bitsToClean &= 7; - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: bitsToClean &=7 is %d, bytesToCLean is %d." - " byte_order is %d, bitmap_bit_order is %d.\n", bitsToClean, bytesToClean, - dpy -> byte_order, dpy -> bitmap_bit_order); - #endif - - for (i = 1; i <= height; i++) - { - if (dpy -> byte_order == dpy -> bitmap_bit_order) - { - for (j = 1; j <= bytesToClean; j++) - { - images[i * bytesPerLine - j] = 0x00; - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: byte_order = bitmap_bit_orde, cleaning %d, i=%d, j=%d.\n" - , (i * bytesPerLine - j), i, j); - #endif - - } - } - else - { - for (j = bytesToClean; j >= 1; j--) - { - images[i * bytesPerLine - j] = 0x00; - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: byte_order %d, bitmap_bit_order %d, cleaning %d, i=%d, j=%d.\n" - , dpy -> byte_order, dpy -> bitmap_bit_order, (i * bytesPerLine - j), i, j); - #endif - - } - } - - if (dpy -> bitmap_bit_order == MSBFirst) - { - images[i * bytesPerLine - j] &= 0xff << bitsToClean; - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: byte_order MSBFirst, cleaning %d, i=%d, j=%d.\n" - , (i * bytesPerLine - j), i, j); - #endif - } - else - { - images[i * bytesPerLine - j] &= 0xff >> bitsToClean; - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: byte_order LSBFirst, cleaning %d, i=%d, j=%d.\n" - , (i * bytesPerLine - j), i, j); - #endif - } - } - - #ifdef DUMP - fprintf(stderr, "nxagentCleanGlyphs: depth %d, bytesToClean %d, scanline: ", depth, bytesToClean); - for (i = 0; i < bytesPerLine; i++) - { - fprintf(stderr, "[%d]", images[i]); - } - fprintf(stderr,"\n"); - #endif - - images += bytesPerLine * height; - - gi++; - - nglyphs--; - } - else if ((depth == 8) || (depth == 16) ) - { - widthInBits = gi -> width * depth; - - bytesPerLine = ROUNDUP(widthInBits, dpy -> bitmap_pad); - - widthInBytes = (widthInBits >> 3); - - bytesToClean = bytesPerLine - widthInBytes; - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: nglyphs is %d, width of glyph in bits is %d, in bytes is %d.\n", - nglyphs, widthInBits, widthInBytes); - - fprintf(stderr, "nxagentCleanGlyphs: bytesPerLine is %d bytes, there are %d scanlines.\n", bytesPerLine, height); - - fprintf(stderr, "nxagentCleanGlyphs: Bytes to clean for each scanline are %d.\n", bytesToClean); - #endif - - if (bytesToClean > 0) - { - while (height > 0) - { - i = bytesToClean; - - while (i > 0) - { - *(images + (bytesPerLine - i)) = 0; - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: cleaned a byte.\n"); - #endif - - i--; - } - - #ifdef DUMP - fprintf(stderr, "nxagentCleanGlyphs: depth %d, bytesToClean %d, scanline: ", depth, bytesToClean); - for (i = 0; i < bytesPerLine; i++) - { - fprintf(stderr, "[%d]", images[i]); - } - fprintf(stderr,"\n"); - #endif - - images += bytesPerLine; - - height--; - } - } - - gi++; - - nglyphs--; - - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: Breaking Out.\n"); - #endif - } - else if (depth == 32) - { - #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: Found glyph with depth 32.\n"); - #endif - - gi++; - - nglyphs--; - } - else - { - #ifdef WARNING - fprintf(stderr, "nxagentCleanGlyphs: Unrecognized glyph, depth is not 8/16/24/32, it appears to be %d.\n", - depth); - #endif - - gi++; - - nglyphs--; - } - } -} - -#endif /* #ifdef NX_RENDER_CLEANUP */ - -void -XRenderAddGlyphs (Display *dpy, - GlyphSet glyphset, - _Xconst Glyph *gids, - _Xconst XGlyphInfo *glyphs, - int nglyphs, - _Xconst char *images, - int nbyte_images) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderAddGlyphsReq *req; - long len; - - if (nbyte_images & 3) - nbyte_images += 4 - (nbyte_images & 3); - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - GetReq(RenderAddGlyphs, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderAddGlyphs; - req->glyphset = glyphset; - req->nglyphs = nglyphs; - len = (nglyphs * (SIZEOF (xGlyphInfo) + 4) + nbyte_images) >> 2; - SetReqLen(req, len, len); - Data32 (dpy, (long *) gids, nglyphs * 4); - Data16 (dpy, (short *) glyphs, nglyphs * SIZEOF (xGlyphInfo)); - Data (dpy, images, nbyte_images); - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderFreeGlyphs (Display *dpy, - GlyphSet glyphset, - _Xconst Glyph *gids, - int nglyphs) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderFreeGlyphsReq *req; - long len; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - GetReq(RenderFreeGlyphs, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderFreeGlyphs; - req->glyphset = glyphset; - len = nglyphs; - SetReqLen(req, len, len); - len <<= 2; - Data32 (dpy, (long *) gids, len); - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeString8 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst char *string, - int nchar) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs8Req *req; - long len; - xGlyphElt *elt; - int nbytes; - - if (!nchar) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs8, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs8; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - - /* - * xGlyphElt must be aligned on a 32-bit boundary; this is - * easily done by filling no more than 252 glyphs in each - * bucket - */ - -#define MAX_8 252 - - len = SIZEOF(xGlyphElt) * ((nchar + MAX_8-1) / MAX_8) + nchar; - - req->length += (len + 3)>>2; /* convert to number of 32-bit words */ - - /* - * If the entire request does not fit into the remaining space in the - * buffer, flush the buffer first. - */ - - if (dpy->bufptr + len > dpy->bufmax) - _XFlush (dpy); - - while(nchar > MAX_8) - { - nbytes = MAX_8 + SIZEOF(xGlyphElt); - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = MAX_8; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - memcpy ((char *) (elt + 1), string, MAX_8); - nchar = nchar - MAX_8; - string += MAX_8; - } - - if (nchar) - { - nbytes = (nchar + SIZEOF(xGlyphElt) + 3) & ~3; - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = nchar; - elt->deltax = xDst; - elt->deltay = yDst; - memcpy ((char *) (elt + 1), string, nchar); - } -#undef MAX_8 - - UnlockDisplay(dpy); - SyncHandle(); -} -void -XRenderCompositeString16 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst unsigned short *string, - int nchar) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs8Req *req; - long len; - xGlyphElt *elt; - int nbytes; - - if (!nchar) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs16, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs16; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - -#define MAX_16 254 - - len = SIZEOF(xGlyphElt) * ((nchar + MAX_16-1) / MAX_16) + nchar * 2; - - req->length += (len + 3)>>2; /* convert to number of 32-bit words */ - - /* - * If the entire request does not fit into the remaining space in the - * buffer, flush the buffer first. - */ - - if (dpy->bufptr + len > dpy->bufmax) - _XFlush (dpy); - - while(nchar > MAX_16) - { - nbytes = MAX_16 * 2 + SIZEOF(xGlyphElt); - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = MAX_16; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - memcpy ((char *) (elt + 1), (char *) string, MAX_16 * 2); - nchar = nchar - MAX_16; - string += MAX_16; - } - - if (nchar) - { - nbytes = (nchar * 2 + SIZEOF(xGlyphElt) + 3) & ~3; - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = nchar; - elt->deltax = xDst; - elt->deltay = yDst; - memcpy ((char *) (elt + 1), (char *) string, nchar * 2); - } -#undef MAX_16 - - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeString32 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst unsigned int *string, - int nchar) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs8Req *req; - long len; - xGlyphElt *elt; - int nbytes; - - if (!nchar) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs32, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs32; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - -#define MAX_32 254 - - len = SIZEOF(xGlyphElt) * ((nchar + MAX_32-1) / MAX_32) + nchar * 4; - - req->length += (len + 3)>>2; /* convert to number of 32-bit words */ - - /* - * If the entire request does not fit into the remaining space in the - * buffer, flush the buffer first. - */ - - if (dpy->bufptr + len > dpy->bufmax) - _XFlush (dpy); - - while(nchar > MAX_32) - { - nbytes = MAX_32 * 4 + SIZEOF(xGlyphElt); - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = MAX_32; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - memcpy ((char *) (elt + 1), (char *) string, MAX_32 * 4); - nchar = nchar - MAX_32; - string += MAX_32; - } - - if (nchar) - { - nbytes = nchar * 4 + SIZEOF(xGlyphElt); - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = nchar; - elt->deltax = xDst; - elt->deltay = yDst; - memcpy ((char *) (elt + 1), (char *) string, nchar * 4); - } -#undef MAX_32 - - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeText8 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt8 *elts, - int nelt) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs8Req *req; - GlyphSet glyphset; - long len; - long elen; - xGlyphElt *elt; - int i; - _Xconst char *chars; - int nchars; - - #ifdef NX_RENDER_CLEANUP - - char tmpChar[4]; - int bytes_to_clean; - int bytes_to_write; - - #endif /* NX_RENDER_CLEANUP */ - - if (!nelt) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs8, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs8; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = elts[0].glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - - /* - * Compute the space necessary - */ - len = 0; - -#define MAX_8 252 - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Check for glyphset change - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - len += (SIZEOF (xGlyphElt) + 4) >> 2; - } - nchars = elts[i].nchars; - /* - * xGlyphElt must be aligned on a 32-bit boundary; this is - * easily done by filling no more than 252 glyphs in each - * bucket - */ - elen = SIZEOF(xGlyphElt) * ((nchars + MAX_8-1) / MAX_8) + nchars; - len += (elen + 3) >> 2; - } - - req->length += len; - - /* - * Send the glyphs - */ - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Switch glyphsets - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt)); - - #ifdef NX_RENDER_CLEANUP - - elt->pad1 = 0; - elt->pad2 = 0; - - #endif /* NX_RENDER_CLEANUP */ - - elt->len = 0xff; - elt->deltax = 0; - elt->deltay = 0; - Data32(dpy, &glyphset, 4); - } - nchars = elts[i].nchars; - xDst = elts[i].xOff; - yDst = elts[i].yOff; - chars = elts[i].chars; - while (nchars) - { - int this_chars = nchars > MAX_8 ? MAX_8 : nchars; - - BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt)) - - #ifdef NX_RENDER_CLEANUP - - elt->pad1 = 0; - elt->pad2 = 0; - - #endif /* NX_RENDER_CLEANUP */ - - elt->len = this_chars; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - - #ifdef NX_RENDER_CLEANUP - - bytes_to_write = this_chars & ~3; - - bytes_to_clean = ((this_chars + 3) & ~3) - this_chars; - - #ifdef DEBUG - fprintf(stderr, "XRenderCompositeText8: bytes_to_write %d, bytes_to_clean are %d," - " this_chars %d.\n", bytes_to_write, bytes_to_clean, this_chars); - #endif - - if (bytes_to_clean > 0) - { - if (bytes_to_write > 0) - { - #ifdef DEBUG - fprintf(stderr, "XRenderCompositeText8: found %d clean bytes, bytes_to_clean are %d," - " this_chars %d.\n", bytes_to_write, bytes_to_clean, this_chars); - #endif - - Data (dpy, chars, bytes_to_write); - chars += bytes_to_write; - } - - bytes_to_write = this_chars % 4; - memcpy (tmpChar, chars, bytes_to_write); - chars += bytes_to_write; - - #ifdef DEBUG - fprintf(stderr, "XRenderCompositeText8: last 32 bit, bytes_to_write are %d," - " bytes_to_clean are %d, this_chars are %d.\n", bytes_to_write, bytes_to_clean, this_chars); - #endif - - #ifdef DUMP - fprintf(stderr, "XRenderCompositeText8: bytes_to_clean %d, ", bytes_to_clean); - #endif - - while (bytes_to_clean > 0) - { - tmpChar[4 - bytes_to_clean] = 0; - bytes_to_clean--; - - #ifdef DEBUG - fprintf(stderr, "XRenderCompositeText8: Cleaned %d byte.\n", 4 - bytes_to_clean); - #endif - } - - Data (dpy, tmpChar, 4); - nchars -= this_chars; - - #ifdef DUMP - fprintf(stderr, "Data: "); - for (i = 0; i < 4; i++) - { - fprintf(stderr, "[%d]", tmpChar[i]); - } - fprintf(stderr,"\n"); - #endif - - #ifdef DEBUG - fprintf(stderr, "XRenderCompositeText8: nchars now is %d.\n", nchars); - #endif - - continue; - } - - #endif /* NX_RENDER_CLEANUP */ - - Data (dpy, chars, this_chars); - nchars -= this_chars; - chars += this_chars; - } - } -#undef MAX_8 - - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeText16 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt16 *elts, - int nelt) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs16Req *req; - GlyphSet glyphset; - long len; - long elen; - xGlyphElt *elt; - int i; - _Xconst unsigned short *chars; - int nchars; - - #ifdef NX_RENDER_CLEANUP - - int bytes_to_write; - int bytes_to_clean; - char tmpChar[4]; - - #endif /* NX_RENDER_CLEANUP */ - - if (!nelt) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs16, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs16; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = elts[0].glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - - /* - * Compute the space necessary - */ - len = 0; - -#define MAX_16 254 - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Check for glyphset change - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - len += (SIZEOF (xGlyphElt) + 4) >> 2; - } - nchars = elts[i].nchars; - /* - * xGlyphElt must be aligned on a 32-bit boundary; this is - * easily done by filling no more than 254 glyphs in each - * bucket - */ - elen = SIZEOF(xGlyphElt) * ((nchars + MAX_16-1) / MAX_16) + nchars * 2; - len += (elen + 3) >> 2; - } - - req->length += len; - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Switch glyphsets - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt)); - - #ifdef NX_RENDER_CLEANUP - - elt->pad1 = 0; - elt->pad2 = 0; - - #endif /* NX_RENDER_CLEANUP */ - - elt->len = 0xff; - elt->deltax = 0; - elt->deltay = 0; - Data32(dpy, &glyphset, 4); - } - nchars = elts[i].nchars; - xDst = elts[i].xOff; - yDst = elts[i].yOff; - chars = elts[i].chars; - while (nchars) - { - int this_chars = nchars > MAX_16 ? MAX_16 : nchars; - int this_bytes = this_chars * 2; - - BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt)) - - #ifdef NX_RENDER_CLEANUP - - elt->pad1 = 0; - elt->pad2 = 0; - - #endif /* NX_RENDER_CLEANUP */ - - elt->len = this_chars; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - - #ifdef NX_RENDER_CLEANUP - - bytes_to_write = this_bytes & ~3; - bytes_to_clean = ((this_bytes + 3) & ~3) - this_bytes; - - #ifdef DEBUG - fprintf(stderr, "XRenderCompositeText16: this_chars %d, this_bytes %d.\n" - "bytes_to_write %d, bytes_to_clean are %d.\n", this_chars, this_bytes, - bytes_to_write, bytes_to_clean); - #endif - - if (bytes_to_clean > 0) - { - if (bytes_to_write > 0) - { - Data16 (dpy, chars, bytes_to_write); - - /* - * Cast chars to avoid errors with pointer arithmetic. - */ - - chars = (unsigned short *) ((char *) chars + bytes_to_write); - } - - bytes_to_write = this_bytes % 4; - memcpy (tmpChar, (char *) chars, bytes_to_write); - chars = (unsigned short *) ((char *) chars + bytes_to_write); - - #ifdef DEBUG - fprintf(stderr, "XRenderCompositeText16: last 32 bit, bytes_to_write are %d," - " bytes_to_clean are %d.\n", bytes_to_write, bytes_to_clean); - #endif - - while (bytes_to_clean > 0) - { - tmpChar[4 - bytes_to_clean] = 0; - bytes_to_clean--; - - #ifdef DEBUG - fprintf(stderr, "XRenderCompositeText16: Cleaned %d byte.\n", 4 - bytes_to_clean); - #endif - } - - Data16 (dpy, tmpChar, 4); - nchars -= this_chars; - - #ifdef DEBUG - fprintf(stderr, "XRenderCompositeText16: nchars now is %d.\n", nchars); - #endif - - continue; - } - - #endif /* NX_RENDER_CLEANUP */ - - Data16 (dpy, chars, this_bytes); - nchars -= this_chars; - chars += this_chars; - } - } -#undef MAX_16 - - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeText32 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt32 *elts, - int nelt) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs32Req *req; - GlyphSet glyphset; - long len; - long elen; - xGlyphElt *elt; - int i; - _Xconst unsigned int *chars; - int nchars; - - if (!nelt) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - - GetReq(RenderCompositeGlyphs32, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs32; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = elts[0].glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - - /* - * Compute the space necessary - */ - len = 0; - -#define MAX_32 254 - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Check for glyphset change - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - len += (SIZEOF (xGlyphElt) + 4) >> 2; - } - nchars = elts[i].nchars; - elen = SIZEOF(xGlyphElt) * ((nchars + MAX_32) / MAX_32) + nchars *4; - len += (elen + 3) >> 2; - } - - req->length += len; - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Switch glyphsets - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt)); - - #ifdef NX_RENDER_CLEANUP - - elt->pad1 = 0; - elt->pad2 = 0; - - #endif /* NX_RENDER_CLEANUP */ - - elt->len = 0xff; - elt->deltax = 0; - elt->deltay = 0; - Data32(dpy, &glyphset, 4); - } - nchars = elts[i].nchars; - xDst = elts[i].xOff; - yDst = elts[i].yOff; - chars = elts[i].chars; - while (nchars) - { - int this_chars = nchars > MAX_32 ? MAX_32 : nchars; - int this_bytes = this_chars * 4; - BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt)) - - #ifdef NX_RENDER_CLEANUP - - elt->pad1 = 0; - elt->pad2 = 0; - - #endif /* NX_RENDER_CLEANUP */ - - elt->len = this_chars; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - - #ifdef TEST - fprintf(stderr, "XRenderCompositeText32: this_chars %d, this_bytes %d.\n", - this_chars, this_bytes); - #endif - - DataInt32 (dpy, chars, this_bytes); - nchars -= this_chars; - chars += this_chars; - } - } -#undef MAX_32 - - UnlockDisplay(dpy); - SyncHandle(); -} diff --git a/nx-X11/lib/Xrender/Glyph.c.X.original b/nx-X11/lib/Xrender/Glyph.c.X.original deleted file mode 100644 index 894bb77f2..000000000 --- a/nx-X11/lib/Xrender/Glyph.c.X.original +++ /dev/null @@ -1,712 +0,0 @@ -/* - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xrenderint.h" - -GlyphSet -XRenderCreateGlyphSet (Display *dpy, _Xconst XRenderPictFormat *format) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - GlyphSet gsid; - xRenderCreateGlyphSetReq *req; - - RenderCheckExtension (dpy, info, 0); - LockDisplay(dpy); - GetReq(RenderCreateGlyphSet, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCreateGlyphSet; - req->gsid = gsid = XAllocID(dpy); - req->format = format->id; - UnlockDisplay(dpy); - SyncHandle(); - return gsid; -} - -GlyphSet -XRenderReferenceGlyphSet (Display *dpy, GlyphSet existing) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - GlyphSet gsid; - xRenderReferenceGlyphSetReq *req; - - RenderCheckExtension (dpy, info, 0); - LockDisplay(dpy); - GetReq(RenderReferenceGlyphSet, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderReferenceGlyphSet; - req->gsid = gsid = XAllocID(dpy); - req->existing = existing; - UnlockDisplay(dpy); - SyncHandle(); - return gsid; -} - -void -XRenderFreeGlyphSet (Display *dpy, GlyphSet glyphset) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderFreeGlyphSetReq *req; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - GetReq(RenderFreeGlyphSet, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderFreeGlyphSet; - req->glyphset = glyphset; - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderAddGlyphs (Display *dpy, - GlyphSet glyphset, - _Xconst Glyph *gids, - _Xconst XGlyphInfo *glyphs, - int nglyphs, - _Xconst char *images, - int nbyte_images) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderAddGlyphsReq *req; - long len; - - if (nbyte_images & 3) - nbyte_images += 4 - (nbyte_images & 3); - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - GetReq(RenderAddGlyphs, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderAddGlyphs; - req->glyphset = glyphset; - req->nglyphs = nglyphs; - len = (nglyphs * (SIZEOF (xGlyphInfo) + 4) + nbyte_images) >> 2; - SetReqLen(req, len, len); - Data32 (dpy, (long *) gids, nglyphs * 4); - Data16 (dpy, (short *) glyphs, nglyphs * SIZEOF (xGlyphInfo)); - Data (dpy, images, nbyte_images); - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderFreeGlyphs (Display *dpy, - GlyphSet glyphset, - _Xconst Glyph *gids, - int nglyphs) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderFreeGlyphsReq *req; - long len; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - GetReq(RenderFreeGlyphs, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderFreeGlyphs; - req->glyphset = glyphset; - len = nglyphs; - SetReqLen(req, len, len); - len <<= 2; - Data32 (dpy, (long *) gids, len); - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeString8 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst char *string, - int nchar) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs8Req *req; - long len; - xGlyphElt *elt; - int nbytes; - - if (!nchar) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs8, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs8; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - - /* - * xGlyphElt must be aligned on a 32-bit boundary; this is - * easily done by filling no more than 252 glyphs in each - * bucket - */ - -#define MAX_8 252 - - len = SIZEOF(xGlyphElt) * ((nchar + MAX_8-1) / MAX_8) + nchar; - - req->length += (len + 3)>>2; /* convert to number of 32-bit words */ - - /* - * If the entire request does not fit into the remaining space in the - * buffer, flush the buffer first. - */ - - if (dpy->bufptr + len > dpy->bufmax) - _XFlush (dpy); - - while(nchar > MAX_8) - { - nbytes = MAX_8 + SIZEOF(xGlyphElt); - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = MAX_8; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - memcpy ((char *) (elt + 1), string, MAX_8); - nchar = nchar - MAX_8; - string += MAX_8; - } - - if (nchar) - { - nbytes = (nchar + SIZEOF(xGlyphElt) + 3) & ~3; - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = nchar; - elt->deltax = xDst; - elt->deltay = yDst; - memcpy ((char *) (elt + 1), string, nchar); - } -#undef MAX_8 - - UnlockDisplay(dpy); - SyncHandle(); -} -void -XRenderCompositeString16 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst unsigned short *string, - int nchar) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs8Req *req; - long len; - xGlyphElt *elt; - int nbytes; - - if (!nchar) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs16, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs16; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - -#define MAX_16 254 - - len = SIZEOF(xGlyphElt) * ((nchar + MAX_16-1) / MAX_16) + nchar * 2; - - req->length += (len + 3)>>2; /* convert to number of 32-bit words */ - - /* - * If the entire request does not fit into the remaining space in the - * buffer, flush the buffer first. - */ - - if (dpy->bufptr + len > dpy->bufmax) - _XFlush (dpy); - - while(nchar > MAX_16) - { - nbytes = MAX_16 * 2 + SIZEOF(xGlyphElt); - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = MAX_16; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - memcpy ((char *) (elt + 1), (char *) string, MAX_16 * 2); - nchar = nchar - MAX_16; - string += MAX_16; - } - - if (nchar) - { - nbytes = (nchar * 2 + SIZEOF(xGlyphElt) + 3) & ~3; - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = nchar; - elt->deltax = xDst; - elt->deltay = yDst; - memcpy ((char *) (elt + 1), (char *) string, nchar * 2); - } -#undef MAX_16 - - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeString32 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst unsigned int *string, - int nchar) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs8Req *req; - long len; - xGlyphElt *elt; - int nbytes; - - if (!nchar) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs32, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs32; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - -#define MAX_32 254 - - len = SIZEOF(xGlyphElt) * ((nchar + MAX_32-1) / MAX_32) + nchar * 4; - - req->length += (len + 3)>>2; /* convert to number of 32-bit words */ - - /* - * If the entire request does not fit into the remaining space in the - * buffer, flush the buffer first. - */ - - if (dpy->bufptr + len > dpy->bufmax) - _XFlush (dpy); - - while(nchar > MAX_32) - { - nbytes = MAX_32 * 4 + SIZEOF(xGlyphElt); - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = MAX_32; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - memcpy ((char *) (elt + 1), (char *) string, MAX_32 * 4); - nchar = nchar - MAX_32; - string += MAX_32; - } - - if (nchar) - { - nbytes = nchar * 4 + SIZEOF(xGlyphElt); - BufAlloc (xGlyphElt *, elt, nbytes); - elt->len = nchar; - elt->deltax = xDst; - elt->deltay = yDst; - memcpy ((char *) (elt + 1), (char *) string, nchar * 4); - } -#undef MAX_32 - - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeText8 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt8 *elts, - int nelt) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs8Req *req; - GlyphSet glyphset; - long len; - long elen; - xGlyphElt *elt; - int i; - _Xconst char *chars; - int nchars; - - if (!nelt) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs8, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs8; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = elts[0].glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - - /* - * Compute the space necessary - */ - len = 0; - -#define MAX_8 252 - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Check for glyphset change - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - len += (SIZEOF (xGlyphElt) + 4) >> 2; - } - nchars = elts[i].nchars; - /* - * xGlyphElt must be aligned on a 32-bit boundary; this is - * easily done by filling no more than 252 glyphs in each - * bucket - */ - elen = SIZEOF(xGlyphElt) * ((nchars + MAX_8-1) / MAX_8) + nchars; - len += (elen + 3) >> 2; - } - - req->length += len; - - /* - * Send the glyphs - */ - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Switch glyphsets - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt)); - elt->len = 0xff; - elt->deltax = 0; - elt->deltay = 0; - Data32(dpy, &glyphset, 4); - } - nchars = elts[i].nchars; - xDst = elts[i].xOff; - yDst = elts[i].yOff; - chars = elts[i].chars; - while (nchars) - { - int this_chars = nchars > MAX_8 ? MAX_8 : nchars; - - BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt)) - elt->len = this_chars; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - Data (dpy, chars, this_chars); - nchars -= this_chars; - chars += this_chars; - } - } -#undef MAX_8 - - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeText16 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt16 *elts, - int nelt) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs16Req *req; - GlyphSet glyphset; - long len; - long elen; - xGlyphElt *elt; - int i; - _Xconst unsigned short *chars; - int nchars; - - if (!nelt) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - GetReq(RenderCompositeGlyphs16, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs16; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = elts[0].glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - - /* - * Compute the space necessary - */ - len = 0; - -#define MAX_16 254 - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Check for glyphset change - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - len += (SIZEOF (xGlyphElt) + 4) >> 2; - } - nchars = elts[i].nchars; - /* - * xGlyphElt must be aligned on a 32-bit boundary; this is - * easily done by filling no more than 254 glyphs in each - * bucket - */ - elen = SIZEOF(xGlyphElt) * ((nchars + MAX_16-1) / MAX_16) + nchars * 2; - len += (elen + 3) >> 2; - } - - req->length += len; - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Switch glyphsets - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt)); - elt->len = 0xff; - elt->deltax = 0; - elt->deltay = 0; - Data32(dpy, &glyphset, 4); - } - nchars = elts[i].nchars; - xDst = elts[i].xOff; - yDst = elts[i].yOff; - chars = elts[i].chars; - while (nchars) - { - int this_chars = nchars > MAX_16 ? MAX_16 : nchars; - int this_bytes = this_chars * 2; - - BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt)) - elt->len = this_chars; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - Data16 (dpy, chars, this_bytes); - nchars -= this_chars; - chars += this_chars; - } - } -#undef MAX_16 - - UnlockDisplay(dpy); - SyncHandle(); -} - -void -XRenderCompositeText32 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt32 *elts, - int nelt) -{ - XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy); - xRenderCompositeGlyphs32Req *req; - GlyphSet glyphset; - long len; - long elen; - xGlyphElt *elt; - int i; - _Xconst unsigned int *chars; - int nchars; - - if (!nelt) - return; - - RenderSimpleCheckExtension (dpy, info); - LockDisplay(dpy); - - - GetReq(RenderCompositeGlyphs32, req); - req->reqType = info->codes->major_opcode; - req->renderReqType = X_RenderCompositeGlyphs32; - req->op = op; - req->src = src; - req->dst = dst; - req->maskFormat = maskFormat ? maskFormat->id : None; - req->glyphset = elts[0].glyphset; - req->xSrc = xSrc; - req->ySrc = ySrc; - - /* - * Compute the space necessary - */ - len = 0; - -#define MAX_32 254 - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Check for glyphset change - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - len += (SIZEOF (xGlyphElt) + 4) >> 2; - } - nchars = elts[i].nchars; - elen = SIZEOF(xGlyphElt) * ((nchars + MAX_32) / MAX_32) + nchars *4; - len += (elen + 3) >> 2; - } - - req->length += len; - - glyphset = elts[0].glyphset; - for (i = 0; i < nelt; i++) - { - /* - * Switch glyphsets - */ - if (elts[i].glyphset != glyphset) - { - glyphset = elts[i].glyphset; - BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt)); - elt->len = 0xff; - elt->deltax = 0; - elt->deltay = 0; - Data32(dpy, &glyphset, 4); - } - nchars = elts[i].nchars; - xDst = elts[i].xOff; - yDst = elts[i].yOff; - chars = elts[i].chars; - while (nchars) - { - int this_chars = nchars > MAX_32 ? MAX_32 : nchars; - int this_bytes = this_chars * 4; - BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt)) - elt->len = this_chars; - elt->deltax = xDst; - elt->deltay = yDst; - xDst = 0; - yDst = 0; - DataInt32 (dpy, chars, this_bytes); - nchars -= this_chars; - chars += this_chars; - } - } -#undef MAX_32 - - UnlockDisplay(dpy); - SyncHandle(); -} diff --git a/nx-X11/lib/Xrender/Xrender.h.NX.original b/nx-X11/lib/Xrender/Xrender.h.NX.original deleted file mode 100644 index 4d125cd81..000000000 --- a/nx-X11/lib/Xrender/Xrender.h.NX.original +++ /dev/null @@ -1,544 +0,0 @@ -/* - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifndef _XRENDER_H_ -#define _XRENDER_H_ - -#define NX_CLEANUP - -#include - -#include -#include -#include -#include - -#ifdef NX_CLEANUP -#include "renderproto.h" -#endif - -typedef struct { - short red; - short redMask; - short green; - short greenMask; - short blue; - short blueMask; - short alpha; - short alphaMask; -} XRenderDirectFormat; - -typedef struct { - PictFormat id; - int type; - int depth; - XRenderDirectFormat direct; - Colormap colormap; -} XRenderPictFormat; - -#define PictFormatID (1 << 0) -#define PictFormatType (1 << 1) -#define PictFormatDepth (1 << 2) -#define PictFormatRed (1 << 3) -#define PictFormatRedMask (1 << 4) -#define PictFormatGreen (1 << 5) -#define PictFormatGreenMask (1 << 6) -#define PictFormatBlue (1 << 7) -#define PictFormatBlueMask (1 << 8) -#define PictFormatAlpha (1 << 9) -#define PictFormatAlphaMask (1 << 10) -#define PictFormatColormap (1 << 11) - -typedef struct _XRenderPictureAttributes { - int repeat; - Picture alpha_map; - int alpha_x_origin; - int alpha_y_origin; - int clip_x_origin; - int clip_y_origin; - Pixmap clip_mask; - Bool graphics_exposures; - int subwindow_mode; - int poly_edge; - int poly_mode; - Atom dither; - Bool component_alpha; -} XRenderPictureAttributes; - -typedef struct { - unsigned short red; - unsigned short green; - unsigned short blue; - unsigned short alpha; -} XRenderColor; - -typedef struct _XGlyphInfo { - unsigned short width; - unsigned short height; - short x; - short y; - short xOff; - short yOff; -} XGlyphInfo; - -typedef struct _XGlyphElt8 { - GlyphSet glyphset; - _Xconst char *chars; - int nchars; - int xOff; - int yOff; -} XGlyphElt8; - -typedef struct _XGlyphElt16 { - GlyphSet glyphset; - _Xconst unsigned short *chars; - int nchars; - int xOff; - int yOff; -} XGlyphElt16; - -typedef struct _XGlyphElt32 { - GlyphSet glyphset; - _Xconst unsigned int *chars; - int nchars; - int xOff; - int yOff; -} XGlyphElt32; - -typedef double XDouble; - -typedef struct _XPointDouble { - XDouble x, y; -} XPointDouble; - -#define XDoubleToFixed(f) ((XFixed) ((f) * 65536)) -#define XFixedToDouble(f) (((XDouble) (f)) / 65536) - -typedef int XFixed; - -typedef struct _XPointFixed { - XFixed x, y; -} XPointFixed; - -typedef struct _XLineFixed { - XPointFixed p1, p2; -} XLineFixed; - -typedef struct _XTriangle { - XPointFixed p1, p2, p3; -} XTriangle; - -typedef struct _XCircle { - XFixed x; - XFixed y; - XFixed radius; -} XCircle; - -typedef struct _XTrapezoid { - XFixed top, bottom; - XLineFixed left, right; -} XTrapezoid; - -typedef struct _XTransform { - XFixed matrix[3][3]; -} XTransform; - -typedef struct _XFilters { - int nfilter; - char **filter; - int nalias; - short *alias; -} XFilters; - -typedef struct _XIndexValue { - unsigned long pixel; - unsigned short red, green, blue, alpha; -} XIndexValue; - -typedef struct _XAnimCursor { - Cursor cursor; - unsigned long delay; -} XAnimCursor; - -typedef struct _XSpanFix { - XFixed left, right, y; -} XSpanFix; - -typedef struct _XTrap { - XSpanFix top, bottom; -} XTrap; - -typedef struct _XLinearGradient { - XPointFixed p1; - XPointFixed p2; -} XLinearGradient; - -typedef struct _XRadialGradient { - XCircle inner; - XCircle outer; -} XRadialGradient; - -typedef struct _XConicalGradient { - XPointFixed center; - XFixed angle; /* in degrees */ -} XConicalGradient; - -_XFUNCPROTOBEGIN - -Bool XRenderQueryExtension (Display *dpy, int *event_basep, int *error_basep); - -Status XRenderQueryVersion (Display *dpy, - int *major_versionp, - int *minor_versionp); - -Status XRenderQueryFormats (Display *dpy); - -int XRenderQuerySubpixelOrder (Display *dpy, int screen); - -Bool XRenderSetSubpixelOrder (Display *dpy, int screen, int subpixel); - -XRenderPictFormat * -XRenderFindVisualFormat (Display *dpy, _Xconst Visual *visual); - -XRenderPictFormat * -XRenderFindFormat (Display *dpy, - unsigned long mask, - _Xconst XRenderPictFormat *templ, - int count); - -#define PictStandardARGB32 0 -#define PictStandardRGB24 1 -#define PictStandardA8 2 -#define PictStandardA4 3 -#define PictStandardA1 4 -#define PictStandardNUM 5 - -XRenderPictFormat * -XRenderFindStandardFormat (Display *dpy, - int format); - -XIndexValue * -XRenderQueryPictIndexValues(Display *dpy, - _Xconst XRenderPictFormat *format, - int *num); - -Picture -XRenderCreatePicture (Display *dpy, - Drawable drawable, - _Xconst XRenderPictFormat *format, - unsigned long valuemask, - _Xconst XRenderPictureAttributes *attributes); - -void -XRenderChangePicture (Display *dpy, - Picture picture, - unsigned long valuemask, - _Xconst XRenderPictureAttributes *attributes); - -void -XRenderSetPictureClipRectangles (Display *dpy, - Picture picture, - int xOrigin, - int yOrigin, - _Xconst XRectangle *rects, - int n); - -void -XRenderSetPictureClipRegion (Display *dpy, - Picture picture, - Region r); - -void -XRenderSetPictureTransform (Display *dpy, - Picture picture, - XTransform *transform); - -void -XRenderFreePicture (Display *dpy, - Picture picture); - -void -XRenderComposite (Display *dpy, - int op, - Picture src, - Picture mask, - Picture dst, - int src_x, - int src_y, - int mask_x, - int mask_y, - int dst_x, - int dst_y, - unsigned int width, - unsigned int height); - -GlyphSet -XRenderCreateGlyphSet (Display *dpy, _Xconst XRenderPictFormat *format); - -GlyphSet -XRenderReferenceGlyphSet (Display *dpy, GlyphSet existing); - -void -XRenderFreeGlyphSet (Display *dpy, GlyphSet glyphset); - -#ifdef NX_CLEANUP - -void XRenderCleanGlyphs (xGlyphInfo *gi, - int nglyphs, - CARD8 *images, - int depth, - Display *dpy); - -#endif /* #ifdef NX_CLEANUP */ - -void -XRenderAddGlyphs (Display *dpy, - GlyphSet glyphset, - _Xconst Glyph *gids, - _Xconst XGlyphInfo *glyphs, - int nglyphs, - _Xconst char *images, - int nbyte_images); - -void -XRenderFreeGlyphs (Display *dpy, - GlyphSet glyphset, - _Xconst Glyph *gids, - int nglyphs); - -void -XRenderCompositeString8 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst char *string, - int nchar); - -void -XRenderCompositeString16 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst unsigned short *string, - int nchar); - -void -XRenderCompositeString32 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst unsigned int *string, - int nchar); - -void -XRenderCompositeText8 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt8 *elts, - int nelt); - -void -XRenderCompositeText16 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt16 *elts, - int nelt); - -void -XRenderCompositeText32 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt32 *elts, - int nelt); - -void -XRenderFillRectangle (Display *dpy, - int op, - Picture dst, - _Xconst XRenderColor *color, - int x, - int y, - unsigned int width, - unsigned int height); - -void -XRenderFillRectangles (Display *dpy, - int op, - Picture dst, - _Xconst XRenderColor *color, - _Xconst XRectangle *rectangles, - int n_rects); - -void -XRenderCompositeTrapezoids (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - _Xconst XTrapezoid *traps, - int ntrap); - -void -XRenderCompositeTriangles (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - _Xconst XTriangle *triangles, - int ntriangle); - -void -XRenderCompositeTriStrip (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - _Xconst XPointFixed *points, - int npoint); - -void -XRenderCompositeTriFan (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - _Xconst XPointFixed *points, - int npoint); - -void -XRenderCompositeDoublePoly (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XPointDouble *fpoints, - int npoints, - int winding); -Status -XRenderParseColor(Display *dpy, - char *spec, - XRenderColor *def); - -Cursor -XRenderCreateCursor (Display *dpy, - Picture source, - unsigned int x, - unsigned int y); - -XFilters * -XRenderQueryFilters (Display *dpy, Drawable drawable); - -void -XRenderSetPictureFilter (Display *dpy, - Picture picture, - char *filter, - XFixed *params, - int nparams); - -Cursor -XRenderCreateAnimCursor (Display *dpy, - int ncursor, - XAnimCursor *cursors); - - -void -XRenderAddTraps (Display *dpy, - Picture picture, - int xOff, - int yOff, - _Xconst XTrap *traps, - int ntrap); - -Picture XRenderCreateSolidFill (Display *dpy, - const XRenderColor *color); - -Picture XRenderCreateLinearGradient (Display *dpy, - const XLinearGradient *gradient, - const XFixed *stops, - const XRenderColor *colors, - int nstops); - -Picture XRenderCreateRadialGradient (Display *dpy, - const XRadialGradient *gradient, - const XFixed *stops, - const XRenderColor *colors, - int nstops); - -Picture XRenderCreateConicalGradient (Display *dpy, - const XConicalGradient *gradient, - const XFixed *stops, - const XRenderColor *colors, - int nstops); - -_XFUNCPROTOEND - -#endif /* _XRENDER_H_ */ diff --git a/nx-X11/lib/Xrender/Xrender.h.X.original b/nx-X11/lib/Xrender/Xrender.h.X.original deleted file mode 100644 index 4e4723a64..000000000 --- a/nx-X11/lib/Xrender/Xrender.h.X.original +++ /dev/null @@ -1,528 +0,0 @@ -/* - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifndef _XRENDER_H_ -#define _XRENDER_H_ - -#include - -#include -#include -#include -#include - -typedef struct { - short red; - short redMask; - short green; - short greenMask; - short blue; - short blueMask; - short alpha; - short alphaMask; -} XRenderDirectFormat; - -typedef struct { - PictFormat id; - int type; - int depth; - XRenderDirectFormat direct; - Colormap colormap; -} XRenderPictFormat; - -#define PictFormatID (1 << 0) -#define PictFormatType (1 << 1) -#define PictFormatDepth (1 << 2) -#define PictFormatRed (1 << 3) -#define PictFormatRedMask (1 << 4) -#define PictFormatGreen (1 << 5) -#define PictFormatGreenMask (1 << 6) -#define PictFormatBlue (1 << 7) -#define PictFormatBlueMask (1 << 8) -#define PictFormatAlpha (1 << 9) -#define PictFormatAlphaMask (1 << 10) -#define PictFormatColormap (1 << 11) - -typedef struct _XRenderPictureAttributes { - int repeat; - Picture alpha_map; - int alpha_x_origin; - int alpha_y_origin; - int clip_x_origin; - int clip_y_origin; - Pixmap clip_mask; - Bool graphics_exposures; - int subwindow_mode; - int poly_edge; - int poly_mode; - Atom dither; - Bool component_alpha; -} XRenderPictureAttributes; - -typedef struct { - unsigned short red; - unsigned short green; - unsigned short blue; - unsigned short alpha; -} XRenderColor; - -typedef struct _XGlyphInfo { - unsigned short width; - unsigned short height; - short x; - short y; - short xOff; - short yOff; -} XGlyphInfo; - -typedef struct _XGlyphElt8 { - GlyphSet glyphset; - _Xconst char *chars; - int nchars; - int xOff; - int yOff; -} XGlyphElt8; - -typedef struct _XGlyphElt16 { - GlyphSet glyphset; - _Xconst unsigned short *chars; - int nchars; - int xOff; - int yOff; -} XGlyphElt16; - -typedef struct _XGlyphElt32 { - GlyphSet glyphset; - _Xconst unsigned int *chars; - int nchars; - int xOff; - int yOff; -} XGlyphElt32; - -typedef double XDouble; - -typedef struct _XPointDouble { - XDouble x, y; -} XPointDouble; - -#define XDoubleToFixed(f) ((XFixed) ((f) * 65536)) -#define XFixedToDouble(f) (((XDouble) (f)) / 65536) - -typedef int XFixed; - -typedef struct _XPointFixed { - XFixed x, y; -} XPointFixed; - -typedef struct _XLineFixed { - XPointFixed p1, p2; -} XLineFixed; - -typedef struct _XTriangle { - XPointFixed p1, p2, p3; -} XTriangle; - -typedef struct _XCircle { - XFixed x; - XFixed y; - XFixed radius; -} XCircle; - -typedef struct _XTrapezoid { - XFixed top, bottom; - XLineFixed left, right; -} XTrapezoid; - -typedef struct _XTransform { - XFixed matrix[3][3]; -} XTransform; - -typedef struct _XFilters { - int nfilter; - char **filter; - int nalias; - short *alias; -} XFilters; - -typedef struct _XIndexValue { - unsigned long pixel; - unsigned short red, green, blue, alpha; -} XIndexValue; - -typedef struct _XAnimCursor { - Cursor cursor; - unsigned long delay; -} XAnimCursor; - -typedef struct _XSpanFix { - XFixed left, right, y; -} XSpanFix; - -typedef struct _XTrap { - XSpanFix top, bottom; -} XTrap; - -typedef struct _XLinearGradient { - XPointFixed p1; - XPointFixed p2; -} XLinearGradient; - -typedef struct _XRadialGradient { - XCircle inner; - XCircle outer; -} XRadialGradient; - -typedef struct _XConicalGradient { - XPointFixed center; - XFixed angle; /* in degrees */ -} XConicalGradient; - -_XFUNCPROTOBEGIN - -Bool XRenderQueryExtension (Display *dpy, int *event_basep, int *error_basep); - -Status XRenderQueryVersion (Display *dpy, - int *major_versionp, - int *minor_versionp); - -Status XRenderQueryFormats (Display *dpy); - -int XRenderQuerySubpixelOrder (Display *dpy, int screen); - -Bool XRenderSetSubpixelOrder (Display *dpy, int screen, int subpixel); - -XRenderPictFormat * -XRenderFindVisualFormat (Display *dpy, _Xconst Visual *visual); - -XRenderPictFormat * -XRenderFindFormat (Display *dpy, - unsigned long mask, - _Xconst XRenderPictFormat *templ, - int count); - -#define PictStandardARGB32 0 -#define PictStandardRGB24 1 -#define PictStandardA8 2 -#define PictStandardA4 3 -#define PictStandardA1 4 -#define PictStandardNUM 5 - -XRenderPictFormat * -XRenderFindStandardFormat (Display *dpy, - int format); - -XIndexValue * -XRenderQueryPictIndexValues(Display *dpy, - _Xconst XRenderPictFormat *format, - int *num); - -Picture -XRenderCreatePicture (Display *dpy, - Drawable drawable, - _Xconst XRenderPictFormat *format, - unsigned long valuemask, - _Xconst XRenderPictureAttributes *attributes); - -void -XRenderChangePicture (Display *dpy, - Picture picture, - unsigned long valuemask, - _Xconst XRenderPictureAttributes *attributes); - -void -XRenderSetPictureClipRectangles (Display *dpy, - Picture picture, - int xOrigin, - int yOrigin, - _Xconst XRectangle *rects, - int n); - -void -XRenderSetPictureClipRegion (Display *dpy, - Picture picture, - Region r); - -void -XRenderSetPictureTransform (Display *dpy, - Picture picture, - XTransform *transform); - -void -XRenderFreePicture (Display *dpy, - Picture picture); - -void -XRenderComposite (Display *dpy, - int op, - Picture src, - Picture mask, - Picture dst, - int src_x, - int src_y, - int mask_x, - int mask_y, - int dst_x, - int dst_y, - unsigned int width, - unsigned int height); - -GlyphSet -XRenderCreateGlyphSet (Display *dpy, _Xconst XRenderPictFormat *format); - -GlyphSet -XRenderReferenceGlyphSet (Display *dpy, GlyphSet existing); - -void -XRenderFreeGlyphSet (Display *dpy, GlyphSet glyphset); - -void -XRenderAddGlyphs (Display *dpy, - GlyphSet glyphset, - _Xconst Glyph *gids, - _Xconst XGlyphInfo *glyphs, - int nglyphs, - _Xconst char *images, - int nbyte_images); - -void -XRenderFreeGlyphs (Display *dpy, - GlyphSet glyphset, - _Xconst Glyph *gids, - int nglyphs); - -void -XRenderCompositeString8 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst char *string, - int nchar); - -void -XRenderCompositeString16 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst unsigned short *string, - int nchar); - -void -XRenderCompositeString32 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - GlyphSet glyphset, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst unsigned int *string, - int nchar); - -void -XRenderCompositeText8 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt8 *elts, - int nelt); - -void -XRenderCompositeText16 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt16 *elts, - int nelt); - -void -XRenderCompositeText32 (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XGlyphElt32 *elts, - int nelt); - -void -XRenderFillRectangle (Display *dpy, - int op, - Picture dst, - _Xconst XRenderColor *color, - int x, - int y, - unsigned int width, - unsigned int height); - -void -XRenderFillRectangles (Display *dpy, - int op, - Picture dst, - _Xconst XRenderColor *color, - _Xconst XRectangle *rectangles, - int n_rects); - -void -XRenderCompositeTrapezoids (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - _Xconst XTrapezoid *traps, - int ntrap); - -void -XRenderCompositeTriangles (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - _Xconst XTriangle *triangles, - int ntriangle); - -void -XRenderCompositeTriStrip (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - _Xconst XPointFixed *points, - int npoint); - -void -XRenderCompositeTriFan (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - _Xconst XPointFixed *points, - int npoint); - -void -XRenderCompositeDoublePoly (Display *dpy, - int op, - Picture src, - Picture dst, - _Xconst XRenderPictFormat *maskFormat, - int xSrc, - int ySrc, - int xDst, - int yDst, - _Xconst XPointDouble *fpoints, - int npoints, - int winding); -Status -XRenderParseColor(Display *dpy, - char *spec, - XRenderColor *def); - -Cursor -XRenderCreateCursor (Display *dpy, - Picture source, - unsigned int x, - unsigned int y); - -XFilters * -XRenderQueryFilters (Display *dpy, Drawable drawable); - -void -XRenderSetPictureFilter (Display *dpy, - Picture picture, - char *filter, - XFixed *params, - int nparams); - -Cursor -XRenderCreateAnimCursor (Display *dpy, - int ncursor, - XAnimCursor *cursors); - - -void -XRenderAddTraps (Display *dpy, - Picture picture, - int xOff, - int yOff, - _Xconst XTrap *traps, - int ntrap); - -Picture XRenderCreateSolidFill (Display *dpy, - const XRenderColor *color); - -Picture XRenderCreateLinearGradient (Display *dpy, - const XLinearGradient *gradient, - const XFixed *stops, - const XRenderColor *colors, - int nstops); - -Picture XRenderCreateRadialGradient (Display *dpy, - const XRadialGradient *gradient, - const XFixed *stops, - const XRenderColor *colors, - int nstops); - -Picture XRenderCreateConicalGradient (Display *dpy, - const XConicalGradient *gradient, - const XFixed *stops, - const XRenderColor *colors, - int nstops); - -_XFUNCPROTOEND - -#endif /* _XRENDER_H_ */ diff --git a/nx-X11/lib/font/fontfile/encparse.c.NX.original b/nx-X11/lib/font/fontfile/encparse.c.NX.original deleted file mode 100644 index 6262aff07..000000000 --- a/nx-X11/lib/font/fontfile/encparse.c.NX.original +++ /dev/null @@ -1,966 +0,0 @@ -/* -Copyright (c) 1998-2001 by Juliusz Chroboczek - -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. -*/ - -/* $XFree86: xc/lib/font/fontfile/encparse.c,v 1.20tsi Exp $ */ - -/* Parser for encoding files */ - -/* This code assumes that we are using ASCII. We don't use the ctype - functions, as they depend on the current locale. On the other - hand, we do use strcasecmp, but only on strings that we've checked - to be pure ASCII. Bloody ``Code Set Independence''. */ - -#include -#include - -#if defined(__SCO__) || defined(__UNIXWARE__) -#include -#endif - -#ifndef FONTENC_NO_LIBFONT - -#include -#include - -#else - -#include -#define xalloc(n) malloc(n) -#define xrealloc(p, n) realloc(p, n) -#define xfree(p) free(p) - -#include "zlib.h" -typedef gzFile FontFilePtr; -#define FontFileGetc(f) gzgetc(f) -#define FontFileOpen(filename) gzopen(filename, "rb") -#define FontFileClose(f) gzclose(f) - -#define MAXFONTFILENAMELEN 1024 -#define MAXFONTNAMELEN 1024 - -#endif - -#include -#include "fontencI.h" - -#define MAXALIASES 20 - -#define EOF_TOKEN -1 -#define ERROR_TOKEN -2 -#define EOL_TOKEN 0 -#define NUMBER_TOKEN 1 -#define KEYWORD_TOKEN 2 - -#define EOF_LINE -1 -#define ERROR_LINE -2 -#define STARTENCODING_LINE 1 -#define STARTMAPPING_LINE 2 -#define ENDMAPPING_LINE 3 -#define CODE_LINE 4 -#define CODE_RANGE_LINE 5 -#define CODE_UNDEFINE_LINE 6 -#define NAME_LINE 7 -#define SIZE_LINE 8 -#define ALIAS_LINE 9 -#define FIRSTINDEX_LINE 10 - -/* Return from lexer */ -#define MAXKEYWORDLEN 100 - -static long number_value; -static char keyword_value[MAXKEYWORDLEN+1]; - -static long value1, value2, value3; - -/* Lexer code */ - -/* Skip to the beginning of new line */ -static void -skipEndOfLine(FontFilePtr f, int c) -{ - if(c == 0) - c = FontFileGetc(f); - - for(;;) - if(c <= 0 || c == '\n') - return; - else - c = FontFileGetc(f); -} - -/* Get a number; we're at the first digit. */ -static unsigned -getnum(FontFilePtr f, int c, int *cp) -{ - unsigned n = 0; - int base = 10; - - /* look for `0' or `0x' prefix */ - if(c == '0') { - c = FontFileGetc(f); - base = 8; - if(c == 'x' || c == 'X') { - base = 16; - c = FontFileGetc(f); - } - } - - /* accumulate digits */ - for(;;) { - if ('0' <= c && c <= '9') { - n *= base; n += c - '0'; - } else if('a' <= c && c <= 'f') { - n *= base; n += c - 'a' + 10; - } else if('A' <=c && c <= 'F') { - n *= base; n += c - 'A' + 10; - } else - break; - c = FontFileGetc(f); - } - - *cp = c; return n; -} - -/* Skip to beginning of new line; return 1 if only whitespace was found. */ -static int -endOfLine(FontFilePtr f, int c) -{ - if(c == 0) - c = FontFileGetc(f); - - for(;;) { - if(c <= 0 || c == '\n') - return 1; - else if(c == '#') { - skipEndOfLine(f,c); - return 1; - } - else if(c == ' ' || c == '\t') { - skipEndOfLine(f,c); - return 0; - } - c = FontFileGetc(f); - } -} - -/* Get a token; we're at first char */ -static int -gettoken(FontFilePtr f, int c, int *cp) -{ - char *p; - - if(c <= 0) - c = FontFileGetc(f); - - if(c <= 0) { - return EOF_TOKEN; - } - - while(c == ' ' || c == '\t') - c = FontFileGetc(f); - - if(c=='\n') { - return EOL_TOKEN; - } else if(c == '#') { - skipEndOfLine(f,c); - return EOL_TOKEN; - } else if(c >= '0' && c <= '9') { - number_value = getnum(f,c,cp); - return NUMBER_TOKEN; - } else if((c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z') || - c == '/' || c == '_' || c == '-' || c == '.') { - p = keyword_value; - *p++ = c; - while(p-keyword_value < MAXKEYWORDLEN) { - c = FontFileGetc(f); - if(c <= ' ' || c > '~' || c == '#') - break; - *p++ = c; - } - *cp = c; - *p = '\0'; - return KEYWORD_TOKEN; - } else { - *cp = c; - return ERROR_TOKEN; - } -} - -/* Parse a line. - * Always skips to the beginning of a new line, even if an error occurs */ -static int -getnextline(FontFilePtr f) -{ - int c, token; - c = FontFileGetc(f); - if(c <= 0) - return EOF_LINE; - - again: - token=gettoken(f,c,&c); - - switch(token) { - case EOF_TOKEN: - return EOF_LINE; - case EOL_TOKEN: - /* empty line */ - c = FontFileGetc(f); - goto again; - case NUMBER_TOKEN: - value1 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value2 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value3 = number_value; - return CODE_RANGE_LINE; - case EOL_TOKEN: - return CODE_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - case KEYWORD_TOKEN: - if(!endOfLine(f,c)) - return ERROR_LINE; - else - return NAME_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - case KEYWORD_TOKEN: - if(!strcasecmp(keyword_value, "STARTENCODING")) { - token = gettoken(f,c,&c); - if(token == KEYWORD_TOKEN) { - if(endOfLine(f,c)) - return STARTENCODING_LINE; - else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "ALIAS")) { - token = gettoken(f,c,&c); - if(token == KEYWORD_TOKEN) { - if(endOfLine(f,c)) - return ALIAS_LINE; - else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "SIZE")) { - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value1 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value2 = number_value; - return SIZE_LINE; - case EOL_TOKEN: - value2=0; - return SIZE_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "FIRSTINDEX")) { - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value1 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value2 = number_value; - return FIRSTINDEX_LINE; - case EOL_TOKEN: - value2 = 0; - return FIRSTINDEX_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "STARTMAPPING")) { - keyword_value[0] = 0; - value1 = 0; value1 = 0; - /* first a keyword */ - token = gettoken(f,c,&c); - if(token != KEYWORD_TOKEN) { - skipEndOfLine(f, c); - return ERROR_LINE; - } - - /* optional first integer */ - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value1 = number_value; - } else if(token == EOL_TOKEN) { - return STARTMAPPING_LINE; - } else { - skipEndOfLine(f, c); - return ERROR_LINE; - } - - /* optional second integer */ - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value2 = number_value; - } else if(token == EOL_TOKEN) { - return STARTMAPPING_LINE; - } else { - skipEndOfLine(f, c); - return ERROR_LINE; - } - - if(!endOfLine(f,c)) - return ERROR_LINE; - else { - return STARTMAPPING_LINE; - } - } else if(!strcasecmp(keyword_value, "UNDEFINE")) { - /* first integer */ - token = gettoken(f,c,&c); - if(token != NUMBER_TOKEN) { - skipEndOfLine(f,c); - return ERROR_LINE; - } - value1 = number_value; - /* optional second integer */ - token = gettoken(f,c,&c); - if(token == EOL_TOKEN) { - value2 = value1; - return CODE_UNDEFINE_LINE; - } else if(token == NUMBER_TOKEN) { - value2 = number_value; - if(endOfLine(f,c)) { - return CODE_UNDEFINE_LINE; - } else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "ENDENCODING")) { - if(endOfLine(f,c)) - return EOF_LINE; - else - return ERROR_LINE; - } else if(!strcasecmp(keyword_value, "ENDMAPPING")) { - if(endOfLine(f,c)) - return ENDMAPPING_LINE; - else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - default: - return ERROR_LINE; - } -} - -static void -install_mapping(FontEncPtr encoding, FontMapPtr mapping) -{ - FontMapPtr m; - - if(encoding->mappings == NULL) - encoding->mappings = mapping; - else { - m = encoding->mappings; - while(m->next != NULL) - m = m->next; - m->next = mapping; - } - mapping->next = NULL; - mapping->encoding = encoding; -} - -static int -setCode(unsigned from, unsigned to, unsigned row_size, - unsigned *first, unsigned *last, - unsigned *encsize, unsigned short **enc) -{ - unsigned index, i; - unsigned short *newenc; - - if(from>0xFFFF) - return 0; /* success */ - - if(row_size==0) - index=from; - else { - if((value1 & 0xFF) >= row_size) - return 0; /* ignore out of range mappings */ - index = (from>>8) * row_size + (from&0xFF); - } - - /* Optimize away useless identity mappings. This is only expected - to be useful with linear encodings. */ - if(index == to && (index < *first || index > *last)) - return 0; - if(*encsize == 0) { - *encsize = (index < 256) ? 256 : 0x10000; - *enc = (unsigned short*)xalloc((*encsize) * sizeof(unsigned short)); - if(*enc == NULL) { - *encsize = 0; - return 1; - } - } else if(*encsize <= index) { - *encsize = 0x10000; - if((newenc = (unsigned short*)xrealloc(enc, *encsize))==NULL) - return 1; - *enc = newenc; - } - if(*first > *last) { - *first = *last = index; - } - if(index < *first) { - for(i = index; i < *first; i++) - (*enc)[i] = i; - *first = index; - } - if(index > *last) { - for(i = *last + 1; i <= index; i++) - (*enc)[i] = i; - *last = index; - } - (*enc)[index] = to; - return 0; -} - -/* Parser. If headerOnly is true, we're only interested in the - data contained in the encoding file's header. */ - -/* As font encodings are currently never freed, the allocations done - by this function are mostly its private business. Note, however, - that FontEncIdentify needs to free the header fields -- so if you - change this function, you may need to change FontEncIdentify. */ - -/* I want a garbage collector. */ - -static FontEncPtr -parseEncodingFile(FontFilePtr f, int headerOnly) -{ - int line; - - unsigned short *enc=NULL; - char **nam = NULL, **newnam; - unsigned i, first = 0xFFFF, last=0, encsize=0, namsize=0; - FontEncPtr encoding = NULL; - FontMapPtr mapping = NULL; - FontEncSimpleMapPtr sm; - FontEncSimpleNamePtr sn; - char *aliases[MAXALIASES]; - int numaliases=0; - -#if 0 - /* GCC complains about unused labels. Please fix GCC rather than - obfuscating my code. */ - no_encoding: -#endif - line = getnextline(f); - switch(line) { - case EOF_LINE: - goto error; - case STARTENCODING_LINE: - encoding = (FontEncPtr)xalloc(sizeof(FontEncRec)); - if(encoding == NULL) - goto error; - encoding->name = (char*)xalloc(strlen(keyword_value)+1); - if(encoding->name == NULL) - goto error; - strcpy(encoding->name, keyword_value); - encoding->size = 256; - encoding->row_size = 0; - encoding->mappings = NULL; - encoding->next = NULL; - encoding->first = encoding->first_col=0; - goto no_mapping; - default: - goto error; - } - - no_mapping: - line = getnextline(f); - switch(line) { - case EOF_LINE: goto done; - case ALIAS_LINE: - if(numaliases < MAXALIASES) { - aliases[numaliases] = (char*)xalloc(strlen(keyword_value)+1); - if(aliases[numaliases] == NULL) - goto error; - strcpy(aliases[numaliases], keyword_value); - numaliases++; - } - goto no_mapping; - case SIZE_LINE: - encoding->size = value1; - encoding->row_size = value2; - goto no_mapping; - case FIRSTINDEX_LINE: - encoding->first = value1; - encoding->first_col = value2; - goto no_mapping; - case STARTMAPPING_LINE: - if(headerOnly) - goto done; - if(!strcasecmp(keyword_value, "unicode")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); - if(mapping == NULL) - goto error; - mapping->type = FONT_ENCODING_UNICODE; - mapping->pid = 0; - mapping->eid = 0; - mapping->recode = 0; - mapping->name = 0; - mapping->client_data = 0; - mapping->next = 0; - goto mapping; - } else if(!strcasecmp(keyword_value, "cmap")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); - if(mapping == NULL) - goto error; - mapping->type = FONT_ENCODING_TRUETYPE; - mapping->pid = value1; - mapping->eid = value2; - mapping->recode = 0; - mapping->name = 0; - mapping->client_data = 0; - mapping->next = 0; - goto mapping; - } else if(!strcasecmp(keyword_value, "postscript")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); - if(mapping == NULL) - goto error; - mapping->type = FONT_ENCODING_POSTSCRIPT; - mapping->pid = 0; - mapping->eid = 0; - mapping->recode = 0; - mapping->name = 0; - mapping->client_data = 0; - mapping->next = 0; - goto string_mapping; - } else { /* unknown mapping type -- ignore */ - goto skipmapping; - } - /* NOTREACHED */ - goto error; - default: goto no_mapping; /* ignore unknown lines */ - } - - skipmapping: - line = getnextline(f); - switch(line) { - case ENDMAPPING_LINE: - goto no_mapping; - case EOF_LINE: - goto error; - default: - goto skipmapping; - } - - mapping: - line = getnextline(f); - switch(line) { - case EOF_LINE: goto error; - case ENDMAPPING_LINE: - mapping->recode = FontEncSimpleRecode; - mapping->name = FontEncUndefinedName; - mapping->client_data = sm = - (FontEncSimpleMapPtr)xalloc(sizeof(FontEncSimpleMapRec)); - if(sm == NULL) - goto error; - sm->row_size = encoding->row_size; - if(first <= last) { - sm->first = first; - sm->len=last-first+1; - sm->map = - (unsigned short*)xalloc(sm->len * sizeof(unsigned short)); - if(sm->map == NULL) { - xfree(sm); - mapping->client_data = sm = NULL; - goto error; - } - } else { - sm->first = 0; - sm->len = 0; - sm->map = 0; - } - for(i=0; i < sm->len; i++) - sm -> map[i] = enc[first+i]; - install_mapping(encoding, mapping); - mapping = 0; - first = 0xFFFF; last=0; - goto no_mapping; - - case CODE_LINE: - if(setCode(value1, value2, encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - goto mapping; - - case CODE_RANGE_LINE: - if(value1 > 0x10000) - value1 = 0x10000; - if(value2 > 0x10000) - value2 = 0x10000; - if(value2 < value1) - goto mapping; - /* Do the last value first to avoid having to realloc() */ - if(setCode(value2, value3+(value2-value1), encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - for(i=value1; irow_size, - &first, &last, &encsize, &enc)) - goto error; - } - goto mapping; - - case CODE_UNDEFINE_LINE: - if(value1 > 0x10000) - value1 = 0x10000; - if(value2 > 0x10000) - value2 = 0x10000; - if(value2 < value1) - goto mapping; - /* Do the last value first to avoid having to realloc() */ - if(setCode(value2, 0, encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - for(i = value1; i < value2; i++) { - if(setCode(i, 0, encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - } - goto mapping; - - default: goto mapping; /* ignore unknown lines */ - } - - string_mapping: - line = getnextline(f); - switch(line) { - case EOF_LINE: goto error; - case ENDMAPPING_LINE: - mapping->recode = FontEncUndefinedRecode; - mapping->name = FontEncSimpleName; - mapping->client_data = sn = - (FontEncSimpleNamePtr)xalloc(sizeof(FontEncSimpleNameRec)); - if(sn == NULL) - goto error; - if(first > last) { - xfree(sn); - mapping->client_data = sn = NULL; - goto error; - } - sn->first = first; - sn->len = last - first + 1; - sn->map = (char**)xalloc(sn->len*sizeof(char*)); - if(sn->map == NULL) { - xfree(sn); - mapping->client_data = sn = NULL; - goto error; - } - for(i = 0; i < sn->len; i++) - sn->map[i] = nam[first+i]; - install_mapping(encoding,mapping); - mapping = 0; - first = 0xFFFF; last=0; - goto no_mapping; - case NAME_LINE: - if(value1 >= 0x10000) goto string_mapping; - if(namsize == 0) { - namsize = (value1) < 256 ? 256 : 0x10000; - nam = (char**)xalloc(namsize * sizeof(char*)); - if(nam == NULL) { - namsize=0; - goto error; - } - } else if(namsize <= value1) { - namsize = 0x10000; - if((newnam = (char**)xrealloc(nam, namsize)) == NULL) - goto error; - nam = newnam; - } - if(first > last) { - first = last = value1; - } - if(value1 < first) { - for(i = value1; i < first; i++) - nam[i] = NULL; - first = value1; - } - if(value1 > last) { - for(i=last+1; i <= value1; i++) - nam[i]=NULL; - last = value1; - } - nam[value1] = (char*)xalloc(strlen(keyword_value)+1); - if(nam[value1] == NULL) { - goto error; - } - strcpy(nam[value1], keyword_value); - goto string_mapping; - - default: goto string_mapping; /* ignore unknown lines */ - } - - done: - if(encsize) xfree(enc); encsize=0; enc = NULL; - if(namsize) xfree(nam); namsize=0; nam = NULL; /* don't free entries! */ - - encoding->aliases=NULL; - if(numaliases) { - encoding->aliases = (char**)xalloc((numaliases+1)*sizeof(char*)); - if(encoding->aliases == NULL) - goto error; - for(i=0; ialiases[i] = aliases[i]; - encoding->aliases[numaliases]=NULL; - } - - return encoding; - -error: - if(encsize) xfree(enc); encsize=0; - if(namsize) { - for(i = first; i <= last; i++) - if(nam[i]) - xfree(nam[i]); - xfree(nam); - namsize = 0; - } - if(mapping) { - if(mapping->client_data) xfree(mapping->client_data); - xfree(mapping); - } - if(encoding) { - if(encoding->name) xfree(encoding->name); - for(mapping = encoding->mappings; mapping; mapping = mapping->next) { - if(mapping->client_data) xfree(mapping->client_data); - xfree(mapping); - } - xfree(encoding); - } - for(i = 0; i < numaliases; i++) - xfree(aliases[i]); - /* We don't need to free sn and sm as they handled locally in the body.*/ - return 0; -} - -char* -FontEncDirectory() -{ - static char* dir = NULL; - - if(dir == NULL) { - char *c = getenv("FONT_ENCODINGS_DIRECTORY"); - if(c) { - dir = malloc(strlen(c) + 1); - if(!dir) - return NULL; - strcpy(dir, c); - } else { - dir = FONT_ENCODINGS_DIRECTORY; - } - } - return dir; -} - -static void -parseFontFileName(const char *fontFileName, char *buf, char *dir) -{ - const char *p; - char *q, *lastslash; - - for(p = fontFileName, q = dir, lastslash = NULL; *p; p++, q++) { - *q = *p; - if(*p == '/') - lastslash = q+1; - } - - if(!lastslash) - lastslash = dir; - - *lastslash = '\0'; - - if(buf && strlen(dir) + 14 < MAXFONTFILENAMELEN) { - strcpy(buf, dir); - strcat(buf, "encodings.dir"); - } -} - -static FontEncPtr -FontEncReallyReallyLoad(const char *charset, - const char *dirname, const char *dir) -{ - FontFilePtr f; - FILE *file; - FontEncPtr encoding; - char file_name[MAXFONTFILENAMELEN], encoding_name[MAXFONTNAMELEN], - buf[MAXFONTFILENAMELEN]; - int count, n; - static char format[24] = ""; - - /* As we don't really expect to open encodings that often, we don't - take the trouble of caching encodings directories. */ - - if((file = fopen(dirname, "r")) == NULL) { - return NULL; - } - - count = fscanf(file, "%d\n", &n); - if(count == EOF || count != 1) { - fclose(file); - return NULL; - } - - encoding = NULL; - if (!format[0]) { - sprintf(format, "%%%ds %%%d[^\n]\n", (int)sizeof(encoding_name) - 1, - (int)sizeof(file_name) - 1); - } - for(;;) { - count = fscanf(file, format, encoding_name, file_name); - if(count == EOF) - break; - if(count != 2) - break; - - if(!strcasecmp(encoding_name, charset)) { - /* Found it */ - if(file_name[0] != '/') { - if(strlen(dir) + strlen(file_name) >= MAXFONTFILENAMELEN) { - fclose(file); - return NULL; - } - strcpy(buf, dir); - strcat(buf, file_name); - } else { - strcpy(buf , file_name); - } - - f = FontFileOpen(buf); - if(f == NULL) { - fclose(file); - return NULL; - } - encoding = parseEncodingFile(f, 0); - FontFileClose(f); - break; - } - } - - fclose(file); - - return encoding; -} - -/* Parser ntrypoint -- used by FontEncLoad */ -FontEncPtr -FontEncReallyLoad(const char *charset, const char *fontFileName) -{ - FontEncPtr encoding; - char dir[MAXFONTFILENAMELEN], dirname[MAXFONTFILENAMELEN]; - char *d; - - if(fontFileName) { - parseFontFileName(fontFileName, dirname, dir); - encoding = FontEncReallyReallyLoad(charset, dirname, dir); - if(encoding) - return(encoding); - } - - d = FontEncDirectory(); - if(d) { - parseFontFileName(d, NULL, dir); - encoding = FontEncReallyReallyLoad(charset, d, dir); - return encoding; - } - - return NULL; -} - -/* Return a NULL-terminated array of encoding names. Note that this - * function has incestuous knowledge of the allocations done by - * parseEncodingFile. */ - -char ** -FontEncIdentify(const char *fileName) -{ - FontFilePtr f; - FontEncPtr encoding; - char **names, **name, **alias; - int numaliases; - - if((f = FontFileOpen(fileName))==NULL) { - return NULL; - } - encoding = parseEncodingFile(f, 1); - FontFileClose(f); - - if(!encoding) - return NULL; - - numaliases = 0; - if(encoding->aliases) - for(alias = encoding->aliases; *alias; alias++) - numaliases++; - - names = (char**)xalloc((numaliases+2)*sizeof(char*)); - if(names == NULL) { - if(encoding->aliases) - xfree(encoding->aliases); - xfree(encoding); - return NULL; - } - - name = names; - *(name++) = encoding->name; - if(numaliases > 0) - for(alias = encoding->aliases; *alias; alias++, name++) - *name = *alias; - - *name = 0; - xfree(encoding->aliases); - xfree(encoding); - - return names; -} diff --git a/nx-X11/lib/font/fontfile/encparse.c.X.original b/nx-X11/lib/font/fontfile/encparse.c.X.original deleted file mode 100644 index 285f5a17d..000000000 --- a/nx-X11/lib/font/fontfile/encparse.c.X.original +++ /dev/null @@ -1,963 +0,0 @@ -/* -Copyright (c) 1998-2001 by Juliusz Chroboczek - -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. -*/ - -/* $XFree86: xc/lib/font/fontfile/encparse.c,v 1.20tsi Exp $ */ - -/* Parser for encoding files */ - -/* This code assumes that we are using ASCII. We don't use the ctype - functions, as they depend on the current locale. On the other - hand, we do use strcasecmp, but only on strings that we've checked - to be pure ASCII. Bloody ``Code Set Independence''. */ - -#include -#include - -#if defined(__SCO__) || defined(__UNIXWARE__) -#include -#endif - -#ifndef FONTENC_NO_LIBFONT - -#include -#include - -#else - -#include -#define xalloc(n) malloc(n) -#define xrealloc(p, n) realloc(p, n) -#define xfree(p) free(p) - -#include "zlib.h" -typedef gzFile FontFilePtr; -#define FontFileGetc(f) gzgetc(f) -#define FontFileOpen(filename) gzopen(filename, "rb") -#define FontFileClose(f) gzclose(f) - -#define MAXFONTFILENAMELEN 1024 -#define MAXFONTNAMELEN 1024 - -#endif - -#include -#include "fontencI.h" - -#define MAXALIASES 20 - -#define EOF_TOKEN -1 -#define ERROR_TOKEN -2 -#define EOL_TOKEN 0 -#define NUMBER_TOKEN 1 -#define KEYWORD_TOKEN 2 - -#define EOF_LINE -1 -#define ERROR_LINE -2 -#define STARTENCODING_LINE 1 -#define STARTMAPPING_LINE 2 -#define ENDMAPPING_LINE 3 -#define CODE_LINE 4 -#define CODE_RANGE_LINE 5 -#define CODE_UNDEFINE_LINE 6 -#define NAME_LINE 7 -#define SIZE_LINE 8 -#define ALIAS_LINE 9 -#define FIRSTINDEX_LINE 10 - -/* Return from lexer */ -#define MAXKEYWORDLEN 100 - -static long number_value; -static char keyword_value[MAXKEYWORDLEN+1]; - -static long value1, value2, value3; - -/* Lexer code */ - -/* Skip to the beginning of new line */ -static void -skipEndOfLine(FontFilePtr f, int c) -{ - if(c == 0) - c = FontFileGetc(f); - - for(;;) - if(c <= 0 || c == '\n') - return; - else - c = FontFileGetc(f); -} - -/* Get a number; we're at the first digit. */ -static unsigned -getnum(FontFilePtr f, int c, int *cp) -{ - unsigned n = 0; - int base = 10; - - /* look for `0' or `0x' prefix */ - if(c == '0') { - c = FontFileGetc(f); - base = 8; - if(c == 'x' || c == 'X') { - base = 16; - c = FontFileGetc(f); - } - } - - /* accumulate digits */ - for(;;) { - if ('0' <= c && c <= '9') { - n *= base; n += c - '0'; - } else if('a' <= c && c <= 'f') { - n *= base; n += c - 'a' + 10; - } else if('A' <=c && c <= 'F') { - n *= base; n += c - 'A' + 10; - } else - break; - c = FontFileGetc(f); - } - - *cp = c; return n; -} - -/* Skip to beginning of new line; return 1 if only whitespace was found. */ -static int -endOfLine(FontFilePtr f, int c) -{ - if(c == 0) - c = FontFileGetc(f); - - for(;;) { - if(c <= 0 || c == '\n') - return 1; - else if(c == '#') { - skipEndOfLine(f,c); - return 1; - } - else if(c == ' ' || c == '\t') { - skipEndOfLine(f,c); - return 0; - } - c = FontFileGetc(f); - } -} - -/* Get a token; we're at first char */ -static int -gettoken(FontFilePtr f, int c, int *cp) -{ - char *p; - - if(c <= 0) - c = FontFileGetc(f); - - if(c <= 0) { - return EOF_TOKEN; - } - - while(c == ' ' || c == '\t') - c = FontFileGetc(f); - - if(c=='\n') { - return EOL_TOKEN; - } else if(c == '#') { - skipEndOfLine(f,c); - return EOL_TOKEN; - } else if(c >= '0' && c <= '9') { - number_value = getnum(f,c,cp); - return NUMBER_TOKEN; - } else if((c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z') || - c == '/' || c == '_' || c == '-' || c == '.') { - p = keyword_value; - *p++ = c; - while(p-keyword_value < MAXKEYWORDLEN) { - c = FontFileGetc(f); - if(c <= ' ' || c > '~' || c == '#') - break; - *p++ = c; - } - *cp = c; - *p = '\0'; - return KEYWORD_TOKEN; - } else { - *cp = c; - return ERROR_TOKEN; - } -} - -/* Parse a line. - * Always skips to the beginning of a new line, even if an error occurs */ -static int -getnextline(FontFilePtr f) -{ - int c, token; - c = FontFileGetc(f); - if(c <= 0) - return EOF_LINE; - - again: - token=gettoken(f,c,&c); - - switch(token) { - case EOF_TOKEN: - return EOF_LINE; - case EOL_TOKEN: - /* empty line */ - c = FontFileGetc(f); - goto again; - case NUMBER_TOKEN: - value1 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value2 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value3 = number_value; - return CODE_RANGE_LINE; - case EOL_TOKEN: - return CODE_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - case KEYWORD_TOKEN: - if(!endOfLine(f,c)) - return ERROR_LINE; - else - return NAME_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - case KEYWORD_TOKEN: - if(!strcasecmp(keyword_value, "STARTENCODING")) { - token = gettoken(f,c,&c); - if(token == KEYWORD_TOKEN) { - if(endOfLine(f,c)) - return STARTENCODING_LINE; - else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "ALIAS")) { - token = gettoken(f,c,&c); - if(token == KEYWORD_TOKEN) { - if(endOfLine(f,c)) - return ALIAS_LINE; - else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "SIZE")) { - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value1 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value2 = number_value; - return SIZE_LINE; - case EOL_TOKEN: - value2=0; - return SIZE_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "FIRSTINDEX")) { - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value1 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value2 = number_value; - return FIRSTINDEX_LINE; - case EOL_TOKEN: - value2 = 0; - return FIRSTINDEX_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "STARTMAPPING")) { - keyword_value[0] = 0; - value1 = 0; value1 = 0; - /* first a keyword */ - token = gettoken(f,c,&c); - if(token != KEYWORD_TOKEN) { - skipEndOfLine(f, c); - return ERROR_LINE; - } - - /* optional first integer */ - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value1 = number_value; - } else if(token == EOL_TOKEN) { - return STARTMAPPING_LINE; - } else { - skipEndOfLine(f, c); - return ERROR_LINE; - } - - /* optional second integer */ - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value2 = number_value; - } else if(token == EOL_TOKEN) { - return STARTMAPPING_LINE; - } else { - skipEndOfLine(f, c); - return ERROR_LINE; - } - - if(!endOfLine(f,c)) - return ERROR_LINE; - else { - return STARTMAPPING_LINE; - } - } else if(!strcasecmp(keyword_value, "UNDEFINE")) { - /* first integer */ - token = gettoken(f,c,&c); - if(token != NUMBER_TOKEN) { - skipEndOfLine(f,c); - return ERROR_LINE; - } - value1 = number_value; - /* optional second integer */ - token = gettoken(f,c,&c); - if(token == EOL_TOKEN) { - value2 = value1; - return CODE_UNDEFINE_LINE; - } else if(token == NUMBER_TOKEN) { - value2 = number_value; - if(endOfLine(f,c)) { - return CODE_UNDEFINE_LINE; - } else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "ENDENCODING")) { - if(endOfLine(f,c)) - return EOF_LINE; - else - return ERROR_LINE; - } else if(!strcasecmp(keyword_value, "ENDMAPPING")) { - if(endOfLine(f,c)) - return ENDMAPPING_LINE; - else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - default: - return ERROR_LINE; - } -} - -static void -install_mapping(FontEncPtr encoding, FontMapPtr mapping) -{ - FontMapPtr m; - - if(encoding->mappings == NULL) - encoding->mappings = mapping; - else { - m = encoding->mappings; - while(m->next != NULL) - m = m->next; - m->next = mapping; - } - mapping->next = NULL; - mapping->encoding = encoding; -} - -static int -setCode(unsigned from, unsigned to, unsigned row_size, - unsigned *first, unsigned *last, - unsigned *encsize, unsigned short **enc) -{ - unsigned index, i; - unsigned short *newenc; - - if(from>0xFFFF) - return 0; /* success */ - - if(row_size==0) - index=from; - else { - if((value1 & 0xFF) >= row_size) - return 0; /* ignore out of range mappings */ - index = (from>>8) * row_size + (from&0xFF); - } - - /* Optimize away useless identity mappings. This is only expected - to be useful with linear encodings. */ - if(index == to && (index < *first || index > *last)) - return 0; - if(*encsize == 0) { - *encsize = (index < 256) ? 256 : 0x10000; - *enc = (unsigned short*)xalloc((*encsize) * sizeof(unsigned short)); - if(*enc == NULL) { - *encsize = 0; - return 1; - } - } else if(*encsize <= index) { - *encsize = 0x10000; - if((newenc = (unsigned short*)xrealloc(enc, *encsize))==NULL) - return 1; - *enc = newenc; - } - if(*first > *last) { - *first = *last = index; - } - if(index < *first) { - for(i = index; i < *first; i++) - (*enc)[i] = i; - *first = index; - } - if(index > *last) { - for(i = *last + 1; i <= index; i++) - (*enc)[i] = i; - *last = index; - } - (*enc)[index] = to; - return 0; -} - -/* Parser. If headerOnly is true, we're only interested in the - data contained in the encoding file's header. */ - -/* As font encodings are currently never freed, the allocations done - by this function are mostly its private business. Note, however, - that FontEncIdentify needs to free the header fields -- so if you - change this function, you may need to change FontEncIdentify. */ - -/* I want a garbage collector. */ - -static FontEncPtr -parseEncodingFile(FontFilePtr f, int headerOnly) -{ - int line; - - unsigned short *enc=NULL; - char **nam = NULL, **newnam; - unsigned i, first = 0xFFFF, last=0, encsize=0, namsize=0; - FontEncPtr encoding = NULL; - FontMapPtr mapping = NULL; - FontEncSimpleMapPtr sm; - FontEncSimpleNamePtr sn; - char *aliases[MAXALIASES]; - int numaliases=0; - -#if 0 - /* GCC complains about unused labels. Please fix GCC rather than - obfuscating my code. */ - no_encoding: -#endif - line = getnextline(f); - switch(line) { - case EOF_LINE: - goto error; - case STARTENCODING_LINE: - encoding = (FontEncPtr)xalloc(sizeof(FontEncRec)); - if(encoding == NULL) - goto error; - encoding->name = (char*)xalloc(strlen(keyword_value)+1); - if(encoding->name == NULL) - goto error; - strcpy(encoding->name, keyword_value); - encoding->size = 256; - encoding->row_size = 0; - encoding->mappings = NULL; - encoding->next = NULL; - encoding->first = encoding->first_col=0; - goto no_mapping; - default: - goto error; - } - - no_mapping: - line = getnextline(f); - switch(line) { - case EOF_LINE: goto done; - case ALIAS_LINE: - if(numaliases < MAXALIASES) { - aliases[numaliases] = (char*)xalloc(strlen(keyword_value)+1); - if(aliases[numaliases] == NULL) - goto error; - strcpy(aliases[numaliases], keyword_value); - numaliases++; - } - goto no_mapping; - case SIZE_LINE: - encoding->size = value1; - encoding->row_size = value2; - goto no_mapping; - case FIRSTINDEX_LINE: - encoding->first = value1; - encoding->first_col = value2; - goto no_mapping; - case STARTMAPPING_LINE: - if(headerOnly) - goto done; - if(!strcasecmp(keyword_value, "unicode")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); - if(mapping == NULL) - goto error; - mapping->type = FONT_ENCODING_UNICODE; - mapping->pid = 0; - mapping->eid = 0; - mapping->recode = 0; - mapping->name = 0; - mapping->client_data = 0; - mapping->next = 0; - goto mapping; - } else if(!strcasecmp(keyword_value, "cmap")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); - if(mapping == NULL) - goto error; - mapping->type = FONT_ENCODING_TRUETYPE; - mapping->pid = value1; - mapping->eid = value2; - mapping->recode = 0; - mapping->name = 0; - mapping->client_data = 0; - mapping->next = 0; - goto mapping; - } else if(!strcasecmp(keyword_value, "postscript")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); - if(mapping == NULL) - goto error; - mapping->type = FONT_ENCODING_POSTSCRIPT; - mapping->pid = 0; - mapping->eid = 0; - mapping->recode = 0; - mapping->name = 0; - mapping->client_data = 0; - mapping->next = 0; - goto string_mapping; - } else { /* unknown mapping type -- ignore */ - goto skipmapping; - } - /* NOTREACHED */ - goto error; - default: goto no_mapping; /* ignore unknown lines */ - } - - skipmapping: - line = getnextline(f); - switch(line) { - case ENDMAPPING_LINE: - goto no_mapping; - case EOF_LINE: - goto error; - default: - goto skipmapping; - } - - mapping: - line = getnextline(f); - switch(line) { - case EOF_LINE: goto error; - case ENDMAPPING_LINE: - mapping->recode = FontEncSimpleRecode; - mapping->name = FontEncUndefinedName; - mapping->client_data = sm = - (FontEncSimpleMapPtr)xalloc(sizeof(FontEncSimpleMapRec)); - if(sm == NULL) - goto error; - sm->row_size = encoding->row_size; - if(first <= last) { - sm->first = first; - sm->len=last-first+1; - sm->map = - (unsigned short*)xalloc(sm->len * sizeof(unsigned short)); - if(sm->map == NULL) { - xfree(sm); - mapping->client_data = sm = NULL; - goto error; - } - } else { - sm->first = 0; - sm->len = 0; - sm->map = 0; - } - for(i=0; i < sm->len; i++) - sm -> map[i] = enc[first+i]; - install_mapping(encoding, mapping); - mapping = 0; - first = 0xFFFF; last=0; - goto no_mapping; - - case CODE_LINE: - if(setCode(value1, value2, encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - goto mapping; - - case CODE_RANGE_LINE: - if(value1 > 0x10000) - value1 = 0x10000; - if(value2 > 0x10000) - value2 = 0x10000; - if(value2 < value1) - goto mapping; - /* Do the last value first to avoid having to realloc() */ - if(setCode(value2, value3+(value2-value1), encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - for(i=value1; irow_size, - &first, &last, &encsize, &enc)) - goto error; - } - goto mapping; - - case CODE_UNDEFINE_LINE: - if(value1 > 0x10000) - value1 = 0x10000; - if(value2 > 0x10000) - value2 = 0x10000; - if(value2 < value1) - goto mapping; - /* Do the last value first to avoid having to realloc() */ - if(setCode(value2, 0, encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - for(i = value1; i < value2; i++) { - if(setCode(i, 0, encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - } - goto mapping; - - default: goto mapping; /* ignore unknown lines */ - } - - string_mapping: - line = getnextline(f); - switch(line) { - case EOF_LINE: goto error; - case ENDMAPPING_LINE: - mapping->recode = FontEncUndefinedRecode; - mapping->name = FontEncSimpleName; - mapping->client_data = sn = - (FontEncSimpleNamePtr)xalloc(sizeof(FontEncSimpleNameRec)); - if(sn == NULL) - goto error; - if(first > last) { - xfree(sn); - mapping->client_data = sn = NULL; - goto error; - } - sn->first = first; - sn->len = last - first + 1; - sn->map = (char**)xalloc(sn->len*sizeof(char*)); - if(sn->map == NULL) { - xfree(sn); - mapping->client_data = sn = NULL; - goto error; - } - for(i = 0; i < sn->len; i++) - sn->map[i] = nam[first+i]; - install_mapping(encoding,mapping); - mapping = 0; - first = 0xFFFF; last=0; - goto no_mapping; - case NAME_LINE: - if(value1 >= 0x10000) goto string_mapping; - if(namsize == 0) { - namsize = (value1) < 256 ? 256 : 0x10000; - nam = (char**)xalloc(namsize * sizeof(char*)); - if(nam == NULL) { - namsize=0; - goto error; - } - } else if(namsize <= value1) { - namsize = 0x10000; - if((newnam = (char**)xrealloc(nam, namsize)) == NULL) - goto error; - nam = newnam; - } - if(first > last) { - first = last = value1; - } - if(value1 < first) { - for(i = value1; i < first; i++) - nam[i] = NULL; - first = value1; - } - if(value1 > last) { - for(i=last+1; i <= value1; i++) - nam[i]=NULL; - last = value1; - } - nam[value1] = (char*)xalloc(strlen(keyword_value)+1); - if(nam[value1] == NULL) { - goto error; - } - strcpy(nam[value1], keyword_value); - goto string_mapping; - - default: goto string_mapping; /* ignore unknown lines */ - } - - done: - if(encsize) xfree(enc); encsize=0; enc = NULL; - if(namsize) xfree(nam); namsize=0; nam = NULL; /* don't free entries! */ - - encoding->aliases=NULL; - if(numaliases) { - encoding->aliases = (char**)xalloc((numaliases+1)*sizeof(char*)); - if(encoding->aliases == NULL) - goto error; - for(i=0; ialiases[i] = aliases[i]; - encoding->aliases[numaliases]=NULL; - } - - return encoding; - -error: - if(encsize) xfree(enc); encsize=0; - if(namsize) { - for(i = first; i <= last; i++) - if(nam[i]) - xfree(nam[i]); - xfree(nam); - namsize = 0; - } - if(mapping) { - if(mapping->client_data) xfree(mapping->client_data); - xfree(mapping); - } - if(encoding) { - if(encoding->name) xfree(encoding->name); - for(mapping = encoding->mappings; mapping; mapping = mapping->next) { - if(mapping->client_data) xfree(mapping->client_data); - xfree(mapping); - } - xfree(encoding); - } - for(i = 0; i < numaliases; i++) - xfree(aliases[i]); - /* We don't need to free sn and sm as they handled locally in the body.*/ - return 0; -} - -char* -FontEncDirectory() -{ - static char* dir = NULL; - - if(dir == NULL) { - char *c = getenv("FONT_ENCODINGS_DIRECTORY"); - if(c) { - dir = malloc(strlen(c) + 1); - if(!dir) - return NULL; - strcpy(dir, c); - } else { - dir = FONT_ENCODINGS_DIRECTORY; - } - } - return dir; -} - -static void -parseFontFileName(const char *fontFileName, char *buf, char *dir) -{ - const char *p; - char *q, *lastslash; - - for(p = fontFileName, q = dir, lastslash = NULL; *p; p++, q++) { - *q = *p; - if(*p == '/') - lastslash = q+1; - } - - if(!lastslash) - lastslash = dir; - - *lastslash = '\0'; - - if(buf && strlen(dir) + 14 < MAXFONTFILENAMELEN) { - strcpy(buf, dir); - strcat(buf, "encodings.dir"); - } -} - -static FontEncPtr -FontEncReallyReallyLoad(const char *charset, - const char *dirname, const char *dir) -{ - FontFilePtr f; - FILE *file; - FontEncPtr encoding; - char file_name[MAXFONTFILENAMELEN], encoding_name[MAXFONTNAMELEN], - buf[MAXFONTFILENAMELEN]; - int count, n; - static char format[24] = ""; - - /* As we don't really expect to open encodings that often, we don't - take the trouble of caching encodings directories. */ - - if((file = fopen(dirname, "r")) == NULL) { - return NULL; - } - - count = fscanf(file, "%d\n", &n); - if(count == EOF || count != 1) { - fclose(file); - return NULL; - } - - encoding = NULL; - if (!format[0]) { - sprintf(format, "%%%ds %%%d[^\n]\n", (int)sizeof(encoding_name) - 1, - (int)sizeof(file_name) - 1); - } - for(;;) { - count = fscanf(file, format, encoding_name, file_name); - if(count == EOF) - break; - if(count != 2) - break; - - if(!strcasecmp(encoding_name, charset)) { - /* Found it */ - if(file_name[0] != '/') { - if(strlen(dir) + strlen(file_name) >= MAXFONTFILENAMELEN) - return NULL; - strcpy(buf, dir); - strcat(buf, file_name); - } else { - strcpy(buf , file_name); - } - - f = FontFileOpen(buf); - if(f == NULL) { - return NULL; - } - encoding = parseEncodingFile(f, 0); - FontFileClose(f); - break; - } - } - - fclose(file); - - return encoding; -} - -/* Parser ntrypoint -- used by FontEncLoad */ -FontEncPtr -FontEncReallyLoad(const char *charset, const char *fontFileName) -{ - FontEncPtr encoding; - char dir[MAXFONTFILENAMELEN], dirname[MAXFONTFILENAMELEN]; - char *d; - - if(fontFileName) { - parseFontFileName(fontFileName, dirname, dir); - encoding = FontEncReallyReallyLoad(charset, dirname, dir); - if(encoding) - return(encoding); - } - - d = FontEncDirectory(); - if(d) { - parseFontFileName(d, NULL, dir); - encoding = FontEncReallyReallyLoad(charset, d, dir); - return encoding; - } - - return NULL; -} - -/* Return a NULL-terminated array of encoding names. Note that this - * function has incestuous knowledge of the allocations done by - * parseEncodingFile. */ - -char ** -FontEncIdentify(const char *fileName) -{ - FontFilePtr f; - FontEncPtr encoding; - char **names, **name, **alias; - int numaliases; - - if((f = FontFileOpen(fileName))==NULL) { - return NULL; - } - encoding = parseEncodingFile(f, 1); - FontFileClose(f); - - if(!encoding) - return NULL; - - numaliases = 0; - if(encoding->aliases) - for(alias = encoding->aliases; *alias; alias++) - numaliases++; - - names = (char**)xalloc((numaliases+2)*sizeof(char*)); - if(names == NULL) { - if(encoding->aliases) - xfree(encoding->aliases); - xfree(encoding); - return NULL; - } - - name = names; - *(name++) = encoding->name; - if(numaliases > 0) - for(alias = encoding->aliases; *alias; alias++, name++) - *name = *alias; - - *name = 0; - xfree(encoding->aliases); - xfree(encoding); - - return names; -} diff --git a/nx-X11/lib/xtrans/Xtranssock.c.NX.original b/nx-X11/lib/xtrans/Xtranssock.c.NX.original deleted file mode 100644 index 50b677057..000000000 --- a/nx-X11/lib/xtrans/Xtranssock.c.NX.original +++ /dev/null @@ -1,3417 +0,0 @@ -/* $XdotOrg: xc/lib/xtrans/Xtranssock.c,v 1.11 2005/11/08 06:33:26 jkj Exp $ */ -/* $Xorg: Xtranssock.c,v 1.11 2001/02/09 02:04:06 xorgcvs Exp $ */ -/* - -Copyright 1993, 1994, 1998 The Open Group -Copyright 2002 Sun Microsystems, Inc. All rights reserved. - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from the copyright holders. - -*/ -/* $XFree86: xc/lib/xtrans/Xtranssock.c,v 3.68 2004/01/07 04:28:02 dawes Exp $ */ - -/* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA - * - * 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 NCR not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. NCR makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN - * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#ifdef NX_TRANS_SOCKET - -#ifdef NX_TRANS_DEBUG -#define XTRANSDEBUG 5 -#endif - -#ifndef PF_LOCAL -#define PF_LOCAL PF_UNIX -#endif - -#endif - -#include -#ifdef XTHREADS -#include -#endif - -#ifndef WIN32 - -#if defined(TCPCONN) || defined(UNIXCONN) -#include -#include -#include -#endif - -#if defined(TCPCONN) || defined(UNIXCONN) -#define X_INCLUDE_NETDB_H -#define XOS_USE_NO_LOCKING -#include -#endif - -#ifdef UNIXCONN -#ifndef X_NO_SYS_UN -#ifndef Lynx -#include -#else -#include -#endif -#endif -#include -#endif - -#if defined(hpux) || (defined(MOTOROLA) && defined(SYSV)) -#define NO_TCP_H -#endif - -#ifndef NO_TCP_H -#if defined(__osf__) || defined(linux) || defined(__GLIBC__) || defined(AIXV5) -#include -#endif /* osf */ -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) -#include -#include -#endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ || __DragonFly__ */ -#include -#endif /* !NO_TCP_H */ - -#include -#if defined(SVR4) && !defined(DGUX) && !defined(_SEQUENT_) -#include -#endif - -#if (defined(i386) && defined(SYSV)) && !defined(SCO325) && !defined(sun) -#include -#endif - -#if (defined(i386) && defined(SYSV)) && (!defined(ISC) || !defined(I_NREAD) || defined(SCO325)) || defined(_SEQUENT_) -#include -#endif - -#else /* !WIN32 */ - -#include -#include -#include -#undef close -#define close closesocket -#define ECONNREFUSED WSAECONNREFUSED -#define EADDRINUSE WSAEADDRINUSE -#define EPROTOTYPE WSAEPROTOTYPE -#undef EWOULDBLOCK -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEINPROGRESS -#undef EINTR -#define EINTR WSAEINTR -#define X_INCLUDE_NETDB_H -#define XOS_USE_MTSAFE_NETDBAPI -#include -#endif /* WIN32 */ - -#if defined(SO_DONTLINGER) && defined(SO_LINGER) -#undef SO_DONTLINGER -#endif - -#if defined(__UNIXOS2__) -#if defined(NOT_EMX09A) -static int IBMsockInit = 0; -#define SocketInitOnce()\ - if (!IBMsockInit) {\ - sock_init();\ - IBMsockInit = 1;\ - } -#undef EINTR -#define EINTR SOCEINTR -#undef EINVAL -#define EINVAL SOCEINVAL -#undef errno -#define errno sock_errno() -#undef close -#define close soclose -#undef ioctl -#define ioctl sockioctl -#else -#define SocketInitOnce() /**/ -#endif -/* this is still not there */ -#define SOCKET int -#else -/* others don't need this */ -#define SocketInitOnce() /**/ -#endif - -#define MIN_BACKLOG 128 -#ifdef SOMAXCONN -#if SOMAXCONN > MIN_BACKLOG -#define BACKLOG SOMAXCONN -#endif -#endif -#ifndef BACKLOG -#define BACKLOG MIN_BACKLOG -#endif -/* - * This is the Socket implementation of the X Transport service layer - * - * This file contains the implementation for both the UNIX and INET domains, - * and can be built for either one, or both. - * - */ - -typedef struct _Sockettrans2dev { - char *transname; - int family; - int devcotsname; - int devcltsname; - int protocol; -} Sockettrans2dev; - -static Sockettrans2dev Sockettrans2devtab[] = { -#ifdef TCPCONN - {"inet",AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, -#if !defined(IPv6) || !defined(AF_INET6) - {"tcp",AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, -#else /* IPv6 */ - {"tcp",AF_INET6,SOCK_STREAM,SOCK_DGRAM,0}, - {"tcp",AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, /* fallback */ - {"inet6",AF_INET6,SOCK_STREAM,SOCK_DGRAM,0}, -#endif -#endif /* TCPCONN */ -#ifdef UNIXCONN - {"unix",AF_UNIX,SOCK_STREAM,SOCK_DGRAM,0}, -#if !defined(LOCALCONN) - {"local",AF_UNIX,SOCK_STREAM,SOCK_DGRAM,0}, -#endif /* !LOCALCONN */ -#endif /* UNIXCONN */ -}; - -#define NUMSOCKETFAMILIES (sizeof(Sockettrans2devtab)/sizeof(Sockettrans2dev)) - -#ifdef TCPCONN -static int TRANS(SocketINETClose) (XtransConnInfo ciptr); -#endif - -#ifdef UNIXCONN - -#ifdef hpux - -#if defined(X11_t) -#define UNIX_PATH "/usr/spool/sockets/X11/" -#define UNIX_DIR "/usr/spool/sockets/X11" -#define OLD_UNIX_PATH "/tmp/.X11-unix/X" -#endif /* X11_t */ -#if defined(XIM_t) -#define UNIX_PATH "/usr/spool/sockets/XIM/" -#define UNIX_DIR "/usr/spool/sockets/XIM" -#define OLD_UNIX_PATH "/tmp/.XIM-unix/XIM" -#endif /* XIM_t */ -#if defined(FS_t) || defined(FONT_t) -#define UNIX_PATH "/usr/spool/sockets/fontserv/" -#define UNIX_DIR "/usr/spool/sockets/fontserv" -#endif /* FS_t || FONT_t */ -#if defined(ICE_t) -#define UNIX_PATH "/usr/spool/sockets/ICE/" -#define UNIX_DIR "/usr/spool/sockets/ICE" -#endif /* ICE_t */ -#if defined(TEST_t) -#define UNIX_PATH "/usr/spool/sockets/xtrans_test/" -#define UNIX_DIR "/usr/spool/sockets/xtrans_test" -#endif -#if defined(LBXPROXY_t) -#define UNIX_PATH "/usr/spool/sockets/X11/" -#define UNIX_DIR "/usr/spool/sockets/X11" -#endif - -#else /* !hpux */ - -#if defined(X11_t) -#define UNIX_PATH "/tmp/.X11-unix/X" -#define UNIX_DIR "/tmp/.X11-unix" -#endif /* X11_t */ -#if defined(XIM_t) -#define UNIX_PATH "/tmp/.XIM-unix/XIM" -#define UNIX_DIR "/tmp/.XIM-unix" -#endif /* XIM_t */ -#if defined(FS_t) || defined(FONT_t) -#define UNIX_PATH "/tmp/.font-unix/fs" -#define UNIX_DIR "/tmp/.font-unix" -#endif /* FS_t || FONT_t */ -#if defined(ICE_t) -#define UNIX_PATH "/tmp/.ICE-unix/" -#define UNIX_DIR "/tmp/.ICE-unix" -#endif /* ICE_t */ -#if defined(TEST_t) -#define UNIX_PATH "/tmp/.Test-unix/test" -#define UNIX_DIR "/tmp/.Test-unix" -#endif -#if defined(LBXPROXY_t) -#define UNIX_PATH "/tmp/.X11-unix/X" -#define UNIX_DIR "/tmp/.X11-unix" -#endif - -#endif /* hpux */ - -#endif /* UNIXCONN */ - -#define PORTBUFSIZE 32 - -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 255 -#endif - -/* - * This provides compatibility for apps linked against system libraries - * that don't have IPv6 support. - */ -#if defined(IPv6) && defined(AF_INET6) -static const struct in6_addr local_in6addr_any = IN6ADDR_ANY_INIT; -#pragma weak in6addr_any = local_in6addr_any -#ifndef __USLC__ -#pragma weak getaddrinfo -#endif -static int haveIPv6 = 1; -#endif - -#ifndef X11_t - -/* - * No NX changes if this is not - * compiled as a X11 transport. - */ - -#undef NX_TRANS_SOCKET - -#endif - -#ifdef NX_TRANS_SOCKET - -#ifdef TRANS_CLIENT - -#include "NX.h" - -typedef struct -{ - XtransConnInfo info; - int local; - int remote; - int congestion; - -} _NXProxyConnInfo; - -#define NX_PROXY_CONN_LIMIT 256 - -static _NXProxyConnInfo *_NXProxyConnInfoTab[NX_PROXY_CONN_LIMIT]; - -#endif /* #ifdef TRANS_CLIENT */ - -/* - * Override the UNIX_DIR and UNIX_PATH settings and - * make them configurable, based on the NX_TEMP or - * the TEMP environment. - * - * We must be careful as the same defines are used - * for different directories, based on the subsystem - * that is compiling this, while we want to override - * only the '/tmp/.X11-unix' and '/tmp/.X11-unix/X' - * settings. - */ - -static char _NXUnixDir[1024]; -static char _NXUnixPath[1024]; - -static char *_NXGetUnixDir(char *dir) -{ - const char *tempDir; - - PRMSG (3, "_NXGetUnixDir(%s)\n", dir, 0, 0); - - if (strcmp(dir, UNIX_DIR) != 0) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixDir: Returning other Unix directory [%s].\n", dir); -#endif - return dir; - } - - /* - * Check the environment only once. - */ - - if (*_NXUnixDir != '\0') - { - return _NXUnixDir; - } - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixDir: Trying with the NX_TEMP environment.\n"); -#endif - - tempDir = getenv("NX_TEMP"); - - if (tempDir == NULL || *tempDir == '\0') - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixDir: Trying with the TEMP environment.\n"); -#endif - - tempDir = getenv("TEMP"); - } - - if (tempDir != NULL && *tempDir != '\0') - { - if (strlen(tempDir) + strlen("/.X11-unix") + 1 > 1024) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixDir: WARNING! Maximum length of X11 Unix directory exceeded.\n"); -#endif - goto _NXGetUnixDirError; - } - - strcpy(_NXUnixDir, tempDir); - strcat(_NXUnixDir, "/.X11-unix"); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixDir: Using X11 Unix directory [%s].\n", _NXUnixDir); -#endif - - return _NXUnixDir; - } - -_NXGetUnixDirError: - - strcpy(_NXUnixDir, dir); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixDir: Returning default X11 Unix directory [%s].\n", _NXUnixDir); -#endif - - return _NXUnixDir; -} - -static char *_NXGetUnixPath(char *path) -{ - const char *unixDir; - - PRMSG (3, "_NXGetUnixPath(%s)\n", path, 0, 0); - - if (strcmp(path, UNIX_PATH) != 0) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixPath: Returning other X11 Unix path [%s].\n", path); -#endif - return path; - } - - /* - * Check the environment only once. - */ - - if (*_NXUnixPath != '\0') - { - return _NXUnixPath; - } - - unixDir = _NXGetUnixDir(UNIX_DIR); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixPath: Got X11 Unix directory [%s].\n", unixDir); -#endif - - if (strlen(unixDir) + strlen("/X") + 1 > 1024) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixPath: WARNING! Maximum length of X11 Unix path exceeded.\n"); -#endif - - goto _NXGetUnixPathError; - } - - strcpy(_NXUnixPath, unixDir); - strcat(_NXUnixPath, "/X"); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixPath: Returning X11 Unix path [%s].\n", _NXUnixPath); -#endif - - return _NXUnixPath; - -_NXGetUnixPathError: - - strcpy(_NXUnixPath, path); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetUnixPath: Returning default X11 Unix path [%s].\n", _NXUnixPath); -#endif - - return _NXUnixPath; -} - -#ifdef hpux - -static char *_NXGetOldUnixPath(char *path) -{ - PRMSG (3, "_NXGetOldUnixPath(%s)\n", path, 0, 0); - - if (strcmp(path, OLD_UNIX_PATH) == 0) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetOldUnixPath: Returning X11 Unix path [%s].\n", - _NXGetUnixPath(path)); -#endif - - return _NXGetUnixPath(path); - } - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetOldUnixPath: Returning other old X11 Unix path [%s].\n", path); -#endif - - return path; -} - -#endif /* #ifdef hpux */ - -/* - * Forcibly close any connection attempt on the - * listening socket. Need this to avoid loopback - * connections to the agent server. - */ - -#ifdef TRANS_SERVER - -void TRANS(SocketRejectConnection) (XtransConnInfo ciptr) -{ - size_t sa_l = sizeof(struct sockaddr); - struct sockaddr sa; - fd_set fs; - struct timeval t; - int f; - - PRMSG (3, "SocketRejectConnection(%x)\n", ciptr, 0, 0); - - FD_ZERO(&fs); - FD_SET(ciptr -> fd, &fs); - - t.tv_sec = 0; - t.tv_usec = 0; - - /* - * Check if there is an awaiting connection. - */ - - if (select(ciptr -> fd + 1, &fs, NULL, NULL, &t) == 1) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketRejectConnection: Accepting connection attempt on fd [%d].\n", - ciptr -> fd); -#endif - /* - * If there is one, close it. - */ - - if ((f = accept(ciptr -> fd, &sa, &sa_l)) >= 0) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketRejectConnection: Closing connection attempt on fd [%d].\n", - ciptr -> fd); -#endif - close(f); - } - } -} - -#endif /* #ifdef TRANS_SERVER */ - -#ifdef TRANS_CLIENT - -void *TRANS(SocketProxyConnInfo) (XtransConnInfo ciptr) -{ - if (_NXProxyConnInfoTab[ciptr->fd] != NULL) - { - return ciptr->priv; - } - - return NULL; -} - -static XtransConnInfo TRANS(SocketCreateConnInfo) () -{ - XtransConnInfo ciptr; - - int fds[2]; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketCreateConnInfo: Going to create the NX connection info.\n"); -#endif - - if ((ciptr = (XtransConnInfo) xcalloc (1, sizeof(struct _XtransConnInfo))) == NULL) - { - PRMSG (1, "SocketCreateConnInfo: malloc failed\n", 0, 0, 0); - return NULL; - } - - /* - * Create a pair of sockets. We'll communicate with - * the NX proxy by reading and writing to our end. - */ - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketCreateConnInfo: Going to create the NX socketpair.\n"); -#endif - - if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fds) < 0) - { - PRMSG (1, "SocketCreateConnInfo: socketpair() failed.\n", 0, 0, 0); - xfree ((char *) ciptr); - return NULL; - } - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketCreateConnInfo: X socket end is [%d] NX proxy end is [%d].\n", - fds[0], fds[1]); -#endif - - /* - * Save in _NXProxyConnInfoTab the local and remote end of - * the socketpair. The remote end will be used by the proxy. - * When the memory-to-memory transport is activated, the - * agent and the proxy don't read or write to the real des- - * criptors but the communication takes place by reading - * and writing to the proxy's buffers. - */ - - ciptr->fd = fds[0]; - - if (ciptr->fd >= NX_PROXY_CONN_LIMIT) - { - PRMSG (1, "SocketCreateConnInfo: No space for a new _NXProxyConnInfo for [%d].\n", - ciptr->fd, 0, 0); - xfree ((char *) ciptr); - return NULL; - } - else if (_NXProxyConnInfoTab[ciptr->fd] != NULL) - { - PRMSG (1, "SocketCreateConnInfo: _NXProxyConnInfo for [%d] is not NULL. Exiting.\n", - ciptr->fd, 0, 0); - exit(1); - } - - _NXProxyConnInfoTab[ciptr->fd] = (_NXProxyConnInfo *) xcalloc(1, sizeof(_NXProxyConnInfo)); - - if (_NXProxyConnInfoTab[ciptr->fd] == NULL) - { - PRMSG (1, "SocketCreateConnInfo: Alloc of _NXProxyConnInfo failed.\n", 0, 0, 0); - xfree ((char *) ciptr); - return NULL; - } - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketCreateConnInfo: Allocated new _NXProxyConnInfo for [%d].\n", - ciptr->fd); -#endif - - _NXProxyConnInfoTab[ciptr->fd]->info = ciptr; - _NXProxyConnInfoTab[ciptr->fd]->local = fds[0]; - _NXProxyConnInfoTab[ciptr->fd]->remote = fds[1]; - _NXProxyConnInfoTab[ciptr->fd]->congestion = 0; - - ciptr->priv = (char *) _NXProxyConnInfoTab[ciptr->fd]; - - return ciptr; -} - -static int TRANS(SocketConnectConnInfo) (XtransConnInfo ciptr, char *host, char *port) -{ - int fds[2]; - char display[1024]; - - _NXProxyConnInfo *proxy_conn; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketConnectConnInfo: Going to connect NX fd [%d] to host [%s] port [%s].\n", - ciptr->fd, host, port); -#endif - - /* - * We should have already created the socket pair. - */ - - proxy_conn = (_NXProxyConnInfo *) ciptr->priv; - - if (proxy_conn == NULL) - { - PRMSG (1, "SocketConnectConnInfo: Pointer to _NXProxyConnInfo is NULL. Exiting.\n", 0, 0, 0); - - exit(1); - } - else if (_NXProxyConnInfoTab[ciptr->fd] != (_NXProxyConnInfo *) ciptr->priv) - { - PRMSG (1, "SocketConnectConnInfo: Can't find _NXProxyConnInfo in table. Exiting.\n", - 0, 0, 0); - - exit(1); - } - - if (strlen(host) + strlen(port) + 1 >= 1023) - { - PRMSG (1, "SocketConnectConnInfo: Length of NX display string '%s:%s' would exceed %d characters.\n", - host, port, 1023); - - return TRANS_CONNECT_FAILED; - } - - sprintf(display, "%s:%s", host, port); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketConnectConnInfo: Setting close-on-exec flag on local NX descriptor [%d].\n", - proxy_conn -> local); -#endif - -#ifdef F_SETFD -#ifdef FD_CLOEXEC - if (fcntl(proxy_conn -> local, F_SETFD, FD_CLOEXEC) != 0) -#else - if (fcntl(proxy_conn -> local, F_SETFD, 1) != 0) -#endif -#endif - { - PRMSG (1, "SocketConnectConnInfo: Cannot set close-on-exec on local NX descriptor [%d].\n", - proxy_conn -> local, 0, 0); - - return TRANS_CONNECT_FAILED; - } - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketConnectConnInfo: Creating the NX transport with display [%s].\n", - display); -#endif - - if (NXTransCreate(NX_FD_ANY, NX_MODE_CLIENT, display) < 0) - { - PRMSG (1, "SocketConnectConnInfo: Cannot create the NX transport.\n", - 0, 0, 0); - - return TRANS_CONNECT_FAILED; - } - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketConnectConnInfo: Starting the NX agent with descriptor [%d].\n", - proxy_conn -> remote); -#endif - - fds[0] = proxy_conn -> local; - fds[1] = proxy_conn -> remote; - - NXTransAgent(fds); - - return 0; -} - -static void TRANS(SocketCloseConnInfo) (XtransConnInfo ciptr) -{ - _NXProxyConnInfo *proxy_conn; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketCloseConnInfo: Going to close the NX fd [%d].\n", ciptr->fd); -#endif - - proxy_conn = (_NXProxyConnInfo *) ciptr->priv; - - if (proxy_conn == NULL) - { - PRMSG (1, "SocketCloseConnInfo: Pointer to _NXProxyConnInfo is NULL. Exiting.\n", 0, 0, 0); - - exit(1); - } - else if (ciptr->fd >= NX_PROXY_CONN_LIMIT || - _NXProxyConnInfoTab[ciptr->fd] != (_NXProxyConnInfo *) ciptr->priv) - { - PRMSG (1, "SocketCloseConnInfo: Can't find _NXProxyConnInfo in table. Exiting.\n", - 0, 0, 0); - exit(1); - } - else if (_NXProxyConnInfoTab[ciptr->fd] -> info != ciptr || - _NXProxyConnInfoTab[ciptr->fd] -> local != ciptr->fd) - { - PRMSG (1, "SocketCloseConnInfo: Invalid _NXProxyConnInfo structure for [%d]. Exiting.\n", - ciptr->fd, 0, 0); - exit(1); - } - else if (proxy_conn->local < 0 || proxy_conn->remote < 0) - { - PRMSG (1, "SocketCloseConnInfo: Invalid socket pair in NX connection for [%d]. Exiting.\n", - ciptr->fd, 0, 0); - exit(1); - } - - NXTransClose(ciptr->fd); - - /* - * Get rid of the _NXProxyConnInfo structure. - */ - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketCloseConnInfo: Freeing _NXProxyConnInfo structure for [%d].\n", - ciptr->fd); -#endif - - xfree((char *) _NXProxyConnInfoTab[ciptr->fd]); - - _NXProxyConnInfoTab[ciptr->fd] = NULL; - - ciptr->priv = NULL; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketCloseConnInfo: Should now close the local descriptor [%d].\n", - ciptr->fd); -#endif -} - -#endif /* #ifdef TRANS_CLIENT */ - -#if defined(TRANS_CLIENT) && defined(NX_TRANS_CHANGE) - -/* - * Check the congestion state of the NX transport - * and return 1 if there has been a change. This - * can be extended by adding a few counters track- - * ing the bandwidth usage of the X11 connection. - */ - -int TRANS(SocketCongestionChange) (XtransConnInfo ciptr, int *state) -{ - int congestion; - - _NXProxyConnInfo *proxy_conn; - - PRMSG (3, "SocketCongestionChange(%x)\n", ciptr, 0, 0); - - proxy_conn = (_NXProxyConnInfo *) ciptr->priv; - - if (proxy_conn == NULL) - { -#ifdef NX_TRANS_DEBUG - fprintf(stderr, "SocketCongestionChange: Descriptor [%d] doesn't appear to be a NX connection.\n", - ciptr->fd); -#endif - return 0; - } - -#ifdef NX_TRANS_DEBUG - fprintf(stderr, "SocketCongestionChange: Checking congestion on fd [%d] with old state [%d].\n", - ciptr->fd, proxy_conn->congestion); -#endif - - congestion = NXTransCongestion(ciptr->fd); - - if (congestion != proxy_conn->congestion) - { - proxy_conn->congestion = congestion; - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketCongestionChange: Change detected on fd [%d] with new state [%d].\n", - ciptr->fd, proxy_conn->congestion); -#endif - return 1; - } - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketCongestionChange: No change on fd [%d] with current state [%d].\n", - ciptr->fd, congestion); -#endif - return 0; -} - -#endif /* #if defined(TRANS_CLIENT) && defined(NX_TRANS_CHANGE) */ - -#endif /* #ifdef NX_TRANS_SOCKET */ - -/* - * These are some utility function used by the real interface function below. - */ - -static int -TRANS(SocketSelectFamily) (int first, char *family) - -{ - int i; - - PRMSG (3,"SocketSelectFamily(%s)\n", family, 0, 0); - - for (i = first + 1; i < NUMSOCKETFAMILIES;i++) - { - if (!strcmp (family, Sockettrans2devtab[i].transname)) - return i; - } - - return (first == -1 ? -2 : -1); -} - - -/* - * This function gets the local address of the socket and stores it in the - * XtransConnInfo structure for the connection. - */ - -static int -TRANS(SocketINETGetAddr) (XtransConnInfo ciptr) - -{ -#if defined(IPv6) && defined(AF_INET6) - struct sockaddr_storage socknamev6; -#endif - struct sockaddr_in socknamev4; - void *socknamePtr; -#if defined(SVR4) || defined(__SCO__) - size_t namelen; -#else - int namelen; -#endif - - PRMSG (3,"SocketINETGetAddr(%p)\n", ciptr, 0, 0); - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6) - { - namelen = sizeof(socknamev6); - socknamePtr = &socknamev6; - } - else -#endif - { - namelen = sizeof(socknamev4); - socknamePtr = &socknamev4; - } - - if (getsockname (ciptr->fd,(struct sockaddr *) socknamePtr, - (void *)&namelen) < 0) - { -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - PRMSG (1,"SocketINETGetAddr: getsockname() failed: %d\n", - EGET(),0, 0); - return -1; - } - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) - { - PRMSG (1, - "SocketINETGetAddr: Can't allocate space for the addr\n", - 0, 0, 0); - return -1; - } - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6) - { - ciptr->family = ((struct sockaddr *)socknamePtr)->sa_family; - } - else -#endif - { - ciptr->family = socknamev4.sin_family; - } - ciptr->addrlen = namelen; - memcpy (ciptr->addr, socknamePtr, ciptr->addrlen); - - return 0; -} - - -/* - * This function gets the remote address of the socket and stores it in the - * XtransConnInfo structure for the connection. - */ - -static int -TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr) - -{ -#if defined(IPv6) && defined(AF_INET6) - struct sockaddr_storage socknamev6; -#endif - struct sockaddr_in socknamev4; - void *socknamePtr; -#if defined(SVR4) || defined(__SCO__) - size_t namelen; -#else - int namelen; -#endif - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6 && ciptr->family == AF_INET6) - { - namelen = sizeof(socknamev6); - socknamePtr = &socknamev6; - } - else -#endif - { - namelen = sizeof(socknamev4); - socknamePtr = &socknamev4; - } - - PRMSG (3,"SocketINETGetPeerAddr(%p)\n", ciptr, 0, 0); - - if (getpeername (ciptr->fd, (struct sockaddr *) socknamePtr, - (void *)&namelen) < 0) - { -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - PRMSG (1,"SocketINETGetPeerAddr: getpeername() failed: %d\n", - EGET(), 0, 0); - return -1; - } - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) - { - PRMSG (1, - "SocketINETGetPeerAddr: Can't allocate space for the addr\n", - 0, 0, 0); - return -1; - } - - ciptr->peeraddrlen = namelen; - memcpy (ciptr->peeraddr, socknamePtr, ciptr->peeraddrlen); - - return 0; -} - - -static XtransConnInfo -TRANS(SocketOpen) (int i, int type) - -{ - XtransConnInfo ciptr; - - PRMSG (3,"SocketOpen(%d,%d)\n", i, type, 0); - -#if defined(IPv6) && defined(AF_INET6) - if (getaddrinfo == NULL) - haveIPv6 = 0; - - if (!haveIPv6 && Sockettrans2devtab[i].family == AF_INET6) - return NULL; -#endif - - if ((ciptr = (XtransConnInfo) xcalloc ( - 1, sizeof(struct _XtransConnInfo))) == NULL) - { - PRMSG (1, "SocketOpen: malloc failed\n", 0, 0, 0); - return NULL; - } - - if ((ciptr->fd = socket(Sockettrans2devtab[i].family, type, - Sockettrans2devtab[i].protocol)) < 0 -#ifndef WIN32 -#if (defined(X11_t) && !defined(USE_POLL)) || defined(FS_t) || defined(FONT_t) - || ciptr->fd >= TRANS_OPEN_MAX -#endif -#endif - ) { -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - PRMSG (2, "SocketOpen: socket() failed for %s\n", - Sockettrans2devtab[i].transname, 0, 0); - - xfree ((char *) ciptr); - return NULL; - } - -#ifdef TCP_NODELAY - if (Sockettrans2devtab[i].family == AF_INET -#if defined(IPv6) && defined(AF_INET6) - || Sockettrans2devtab[i].family == AF_INET6 -#endif - ) - { - /* - * turn off TCP coalescence for INET sockets - */ - - int tmp = 1; - setsockopt (ciptr->fd, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (int)); - } -#endif - - return ciptr; -} - - -#ifdef TRANS_REOPEN - -static XtransConnInfo -TRANS(SocketReopen) (int i, int type, int fd, char *port) - -{ - XtransConnInfo ciptr; - - PRMSG (3,"SocketReopen(%d,%d,%s)\n", type, fd, port); - - if ((ciptr = (XtransConnInfo) xcalloc ( - 1, sizeof(struct _XtransConnInfo))) == NULL) - { - PRMSG (1, "SocketReopen: malloc failed\n", 0, 0, 0); - return NULL; - } - - ciptr->fd = fd; - - return ciptr; -} - -#endif /* TRANS_REOPEN */ - - -/* - * These functions are the interface supplied in the Xtransport structure - */ - -#ifdef TRANS_CLIENT - -static XtransConnInfo -TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol, - char *host, char *port, int previndex) -{ - XtransConnInfo ciptr; - int i = previndex; - - PRMSG (2, "SocketOpenCOTSClient(%s,%s,%s)\n", - protocol, host, port); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, transname)) >= 0) { - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - if ((!strcmp(protocol, "local") || !strcmp(protocol, "nx")) && - (!strcasecmp(host, "nx") || !strncasecmp(host, "nx,", 3))) - { - ciptr = TRANS(SocketCreateConnInfo) (); - - if (ciptr == NULL) - { - PRMSG (1, "SocketOpenCOTSClient: Unable to create the NX connection info for %s.\n", - transname, 0, 0); - - return NULL; - } - - ciptr->index = i; - - return ciptr; - } - -#endif /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ - - if ((ciptr = TRANS(SocketOpen) ( - i, Sockettrans2devtab[i].devcotsname)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketOpenCOTSClient: Unable to open socket for %s\n", - transname, 0, 0); - else - PRMSG (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n", - transname, 0, 0); - return NULL; - } - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - ciptr->priv = NULL; - -#endif - - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -static XtransConnInfo -TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol, - char *host, char *port) -{ - return TRANS(SocketOpenCOTSClientBase)( - thistrans->TransName, protocol, host, port, -1); -} - - -#endif /* TRANS_CLIENT */ - - -#ifdef TRANS_SERVER - -static XtransConnInfo -TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - if ((ciptr = TRANS(SocketOpen) ( - i, Sockettrans2devtab[i].devcotsname)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketOpenCOTSServer: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - - /* - * Using this prevents the bind() check for an existing server listening - * on the same port, but it is required for other reasons. - */ -#ifdef SO_REUSEADDR - - /* - * SO_REUSEADDR only applied to AF_INET && AF_INET6 - */ - - if (Sockettrans2devtab[i].family == AF_INET -#if defined(IPv6) && defined(AF_INET6) - || Sockettrans2devtab[i].family == AF_INET6 -#endif - ) - { - int one = 1; - setsockopt (ciptr->fd, SOL_SOCKET, SO_REUSEADDR, - (char *) &one, sizeof (int)); - } -#endif -#ifdef IPV6_V6ONLY - if (Sockettrans2devtab[i].family == AF_INET6) - { - int one = 1; - setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(int)); - } -#endif - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_SERVER */ - - -#ifdef TRANS_CLIENT - -static XtransConnInfo -TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2,"SocketOpenCLTSClient(%s,%s,%s)\n", protocol, host, port); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - if ((!strcmp(protocol, "local") || !strcmp(protocol, "nx")) && - (!strcasecmp(host, "nx") || !strncasecmp(host, "nx,", 3))) - { - ciptr = TRANS(SocketCreateConnInfo) (); - - if (ciptr == NULL) - { - PRMSG (1, "SocketOpenCLTSClient: Unable to create the NX connection info for %s.\n", - thistrans->TransName, 0, 0); - - return NULL; - } - - ciptr->index = i; - - return ciptr; - } - -#endif /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ - - if ((ciptr = TRANS(SocketOpen) ( - i, Sockettrans2devtab[i].devcotsname)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketOpenCLTSClient: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - ciptr->priv = NULL; - -#endif /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ - - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_CLIENT */ - - -#ifdef TRANS_SERVER - -static XtransConnInfo -TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2,"SocketOpenCLTSServer(%s,%s,%s)\n", protocol, host, port); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - if ((ciptr = TRANS(SocketOpen) ( - i, Sockettrans2devtab[i].devcotsname)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketOpenCLTSServer: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - -#ifdef IPV6_V6ONLY - if (Sockettrans2devtab[i].family == AF_INET6) - { - int one = 1; - setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(int)); - } -#endif - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_SERVER */ - - -#ifdef TRANS_REOPEN - -static XtransConnInfo -TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2, - "SocketReopenCOTSServer(%d, %s)\n", fd, port, 0); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - if ((ciptr = TRANS(SocketReopen) ( - i, Sockettrans2devtab[i].devcotsname, fd, port)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketReopenCOTSServer: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -static XtransConnInfo -TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2, - "SocketReopenCLTSServer(%d, %s)\n", fd, port, 0); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - if ((ciptr = TRANS(SocketReopen) ( - i, Sockettrans2devtab[i].devcotsname, fd, port)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketReopenCLTSServer: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_REOPEN */ - - -static int -TRANS(SocketSetOption) (XtransConnInfo ciptr, int option, int arg) - -{ - PRMSG (2,"SocketSetOption(%d,%d,%d)\n", ciptr->fd, option, arg); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "SocketSetOption: WARNING! Not setting option [%d] with value [%d] on descriptor [%d].\n", - option, arg, ciptr -> fd); -#endif - - return -1; -} - -#ifdef UNIXCONN -static int -set_sun_path(const char *port, const char *upath, char *path) -{ - struct sockaddr_un s; - int maxlen = sizeof(s.sun_path) - 1; - - if (!port || !*port || !path) - return -1; - - if (*port == '/') { /* a full pathname */ - if (strlen(port) > maxlen) - return -1; - sprintf(path, "%s", port); - } else { - if (strlen(port) + strlen(upath) > maxlen) - return -1; - sprintf(path, "%s%s", upath, port); - } - return 0; -} -#endif - -#ifdef TRANS_SERVER - -static int -TRANS(SocketCreateListener) (XtransConnInfo ciptr, - struct sockaddr *sockname, - int socknamelen, unsigned int flags) - -{ - int namelen = socknamelen; - int fd = ciptr->fd; - int retry; - - PRMSG (3, "SocketCreateListener(%x,%p)\n", ciptr, fd, 0); - - if (Sockettrans2devtab[ciptr->index].family == AF_INET -#if defined(IPv6) && defined(AF_INET6) - || Sockettrans2devtab[ciptr->index].family == AF_INET6 -#endif - ) - retry = 20; - else - retry = 0; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "SocketCreateListener: Creating listener for ciptr at [%p] on path [%s].\n", - (void *) ciptr, ((struct sockaddr_un *) sockname)->sun_family == AF_UNIX ? - ((struct sockaddr_un *) sockname)->sun_path : "TCP"); -#endif - while (bind (fd, (struct sockaddr *) sockname, namelen) < 0) - { - if (errno == EADDRINUSE) { - if (flags & ADDR_IN_USE_ALLOWED) - break; - else - return TRANS_ADDR_IN_USE; - } - - if (retry-- == 0) { - PRMSG (1, "SocketCreateListener: failed to bind listener\n", - 0, 0, 0); - close (fd); - return TRANS_CREATE_LISTENER_FAILED; - } -#ifdef SO_REUSEADDR - sleep (1); -#else - sleep (10); -#endif /* SO_REUSEDADDR */ - } - - if (Sockettrans2devtab[ciptr->index].family == AF_INET -#if defined(IPv6) && defined(AF_INET6) - || Sockettrans2devtab[ciptr->index].family == AF_INET6 -#endif - ) { -#ifdef SO_DONTLINGER - setsockopt (fd, SOL_SOCKET, SO_DONTLINGER, (char *) NULL, 0); -#else -#ifdef SO_LINGER - { - static int linger[2] = { 0, 0 }; - setsockopt (fd, SOL_SOCKET, SO_LINGER, - (char *) linger, sizeof (linger)); - } -#endif -#endif -} - - if (listen (fd, BACKLOG) < 0) - { - PRMSG (1, "SocketCreateListener: listen() failed\n", 0, 0, 0); - close (fd); - return TRANS_CREATE_LISTENER_FAILED; - } - - /* Set a flag to indicate that this connection is a listener */ - - ciptr->flags = 1 | (ciptr->flags & TRANS_KEEPFLAGS); - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "SocketCreateListener: Set flags to [%d] for ciptr [%p].\n", - ciptr->flags, (void *) ciptr); -#endif - - return 0; -} - -#ifdef TCPCONN -static int -TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags) - -{ -#if defined(IPv6) && defined(AF_INET6) - struct sockaddr_storage sockname; -#else - struct sockaddr_in sockname; -#endif - unsigned short sport; - int namelen = sizeof(sockname); - int status; - long tmpport; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgetservbynameparams sparams; -#endif - struct servent *servp; - -#ifdef X11_t - char portbuf[PORTBUFSIZE]; -#endif - - PRMSG (2, "SocketINETCreateListener(%s)\n", port, 0, 0); - -#ifdef X11_t - /* - * X has a well known port, that is transport dependent. It is easier - * to handle it here, than try and come up with a transport independent - * representation that can be passed in and resolved the usual way. - * - * The port that is passed here is really a string containing the idisplay - * from ConnectDisplay(). - */ - - if (is_numeric (port)) - { - /* fixup the server port address */ - tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); - sprintf (portbuf,"%lu", tmpport); - port = portbuf; - } -#endif - - if (port && *port) - { - /* Check to see if the port string is just a number (handles X11) */ - - if (!is_numeric (port)) - { - if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL) - { - PRMSG (1, - "SocketINETCreateListener: Unable to get service for %s\n", - port, 0, 0); - return TRANS_CREATE_LISTENER_FAILED; - } - /* we trust getservbyname to return a valid number */ - sport = servp->s_port; - } - else - { - tmpport = strtol (port, (char**)NULL, 10); - /* - * check that somehow the port address isn't negative or in - * the range of reserved port addresses. This can happen and - * be very bad if the server is suid-root and the user does - * something (dumb) like `X :60049`. - */ - if (tmpport < 1024 || tmpport > USHRT_MAX) - return TRANS_CREATE_LISTENER_FAILED; - - sport = (unsigned short) tmpport; - } - } - else - sport = 0; - - bzero(&sockname, sizeof(sockname)); -#if defined(IPv6) && defined(AF_INET6) - if (Sockettrans2devtab[ciptr->index].family == AF_INET) { - namelen = sizeof (struct sockaddr_in); -#ifdef BSD44SOCKETS - ((struct sockaddr_in *)&sockname)->sin_len = namelen; -#endif - ((struct sockaddr_in *)&sockname)->sin_family = AF_INET; - ((struct sockaddr_in *)&sockname)->sin_port = htons(sport); - ((struct sockaddr_in *)&sockname)->sin_addr.s_addr = htonl(INADDR_ANY); - } else { - namelen = sizeof (struct sockaddr_in6); -#ifdef SIN6_LEN - ((struct sockaddr_in6 *)&sockname)->sin6_len = sizeof(sockname); -#endif - ((struct sockaddr_in6 *)&sockname)->sin6_family = AF_INET6; - ((struct sockaddr_in6 *)&sockname)->sin6_port = htons(sport); - ((struct sockaddr_in6 *)&sockname)->sin6_addr = in6addr_any; - } -#else -#ifdef BSD44SOCKETS - sockname.sin_len = sizeof (sockname); -#endif - sockname.sin_family = AF_INET; - sockname.sin_port = htons (sport); - sockname.sin_addr.s_addr = htonl (INADDR_ANY); -#endif - - if ((status = TRANS(SocketCreateListener) (ciptr, - (struct sockaddr *) &sockname, namelen, flags)) < 0) - { - PRMSG (1, - "SocketINETCreateListener: ...SocketCreateListener() failed\n", - 0, 0, 0); - return status; - } - - if (TRANS(SocketINETGetAddr) (ciptr) < 0) - { - PRMSG (1, - "SocketINETCreateListener: ...SocketINETGetAddr() failed\n", - 0, 0, 0); - return TRANS_CREATE_LISTENER_FAILED; - } - - return 0; -} - -#endif /* SOCKCONN */ - - -#ifdef UNIXCONN - -static int -TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port, - unsigned int flags) - -{ - struct sockaddr_un sockname; - int namelen; - int oldUmask; - int status; - unsigned int mode; - - PRMSG (2, "SocketUNIXCreateListener(%s)\n", - port ? port : "NULL", 0, 0); - - /* Make sure the directory is created */ - - oldUmask = umask (0); - -#ifdef UNIX_DIR -#ifdef HAS_STICKY_DIR_BIT - mode = 01777; -#else - mode = 0777; -#endif -#ifdef NX_TRANS_SOCKET - if (trans_mkdir(_NXGetUnixDir(UNIX_DIR), mode) == -1) { - PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n", - _NXGetUnixDir(UNIX_DIR), errno, 0); -#else - if (trans_mkdir(UNIX_DIR, mode) == -1) { - PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n", - UNIX_DIR, errno, 0); -#endif - (void) umask (oldUmask); - return TRANS_CREATE_LISTENER_FAILED; - } -#endif - - sockname.sun_family = AF_UNIX; - - if (port && *port) { -#ifdef NX_TRANS_SOCKET - if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path) != 0) { -#else - if (set_sun_path(port, UNIX_PATH, sockname.sun_path) != 0) { -#endif - PRMSG (1, "SocketUNIXCreateListener: path too long\n", 0, 0, 0); - return TRANS_CREATE_LISTENER_FAILED; - } - } else { -#ifdef NX_TRANS_SOCKET - sprintf (sockname.sun_path, "%s%ld", _NXGetUnixPath(UNIX_PATH), (long)getpid()); -#else - sprintf (sockname.sun_path, "%s%ld", UNIX_PATH, (long)getpid()); -#endif - } - -#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx) - sockname.sun_len = strlen(sockname.sun_path); - namelen = SUN_LEN(&sockname); -#else - namelen = strlen(sockname.sun_path) + sizeof(sockname.sun_family); -#endif - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "SocketUNIXCreateListener: Unlinking path [%s] for ciptr at [%p].\n", - sockname.sun_path, (void *) ciptr); -#endif - unlink (sockname.sun_path); - - if ((status = TRANS(SocketCreateListener) (ciptr, - (struct sockaddr *) &sockname, namelen, flags)) < 0) - { - PRMSG (1, - "SocketUNIXCreateListener: ...SocketCreateListener() failed\n", - 0, 0, 0); - (void) umask (oldUmask); - return status; - } - - /* - * Now that the listener is esablished, create the addr info for - * this connection. getpeername() doesn't work for UNIX Domain Sockets - * on some systems (hpux at least), so we will just do it manually, instead - * of calling something like TRANS(SocketUNIXGetAddr). - */ - - namelen = sizeof (sockname); /* this will always make it the same size */ - - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) - { - PRMSG (1, - "SocketUNIXCreateListener: Can't allocate space for the addr\n", - 0, 0, 0); - (void) umask (oldUmask); - return TRANS_CREATE_LISTENER_FAILED; - } - - ciptr->family = sockname.sun_family; - ciptr->addrlen = namelen; - memcpy (ciptr->addr, &sockname, ciptr->addrlen); - - (void) umask (oldUmask); - - return 0; -} - - -static int -TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr) - -{ - /* - * See if the unix domain socket has disappeared. If it has, recreate it. - */ - - struct sockaddr_un *unsock = (struct sockaddr_un *) ciptr->addr; - struct stat statb; - int status = TRANS_RESET_NOOP; - unsigned int mode; - - PRMSG (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd, 0); - - if (stat (unsock->sun_path, &statb) == -1 || - ((statb.st_mode & S_IFMT) != -#if (defined (sun) && defined(SVR4)) || defined(NCR) || defined(SCO325) || !defined(S_IFSOCK) - S_IFIFO)) -#else - S_IFSOCK)) -#endif - { - int oldUmask = umask (0); - -#ifdef UNIX_DIR -#ifdef HAS_STICKY_DIR_BIT - mode = 01777; -#else - mode = 0777; -#endif -#ifdef NX_TRANS_SOCKET - if (trans_mkdir(_NXGetUnixDir(UNIX_DIR), mode) == -1) { - PRMSG (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n", - _NXGetUnixDir(UNIX_DIR), errno, 0); -#else - if (trans_mkdir(UNIX_DIR, mode) == -1) { - PRMSG (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n", - UNIX_DIR, errno, 0); -#endif - (void) umask (oldUmask); - return TRANS_RESET_FAILURE; - } -#endif - - close (ciptr->fd); - unlink (unsock->sun_path); - - if ((ciptr->fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) - { - TRANS(FreeConnInfo) (ciptr); - (void) umask (oldUmask); - return TRANS_RESET_FAILURE; - } - - if (bind (ciptr->fd, (struct sockaddr *) unsock, ciptr->addrlen) < 0) - { - close (ciptr->fd); - TRANS(FreeConnInfo) (ciptr); - return TRANS_RESET_FAILURE; - } - - if (listen (ciptr->fd, BACKLOG) < 0) - { - close (ciptr->fd); - TRANS(FreeConnInfo) (ciptr); - (void) umask (oldUmask); - return TRANS_RESET_FAILURE; - } - - umask (oldUmask); - - status = TRANS_RESET_NEW_FD; - } - - return status; -} - -#endif /* UNIXCONN */ - - -#ifdef TCPCONN - -static XtransConnInfo -TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) - -{ - XtransConnInfo newciptr; - struct sockaddr_in sockname; - int namelen = sizeof(sockname); - - PRMSG (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd, 0); - - if ((newciptr = (XtransConnInfo) xcalloc ( - 1, sizeof(struct _XtransConnInfo))) == NULL) - { - PRMSG (1, "SocketINETAccept: malloc failed\n", 0, 0, 0); - *status = TRANS_ACCEPT_BAD_MALLOC; - return NULL; - } - - if ((newciptr->fd = accept (ciptr->fd, - (struct sockaddr *) &sockname, (void *)&namelen)) < 0) - { -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - PRMSG (1, "SocketINETAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); - *status = TRANS_ACCEPT_FAILED; - return NULL; - } - -#ifdef TCP_NODELAY - { - /* - * turn off TCP coalescence for INET sockets - */ - - int tmp = 1; - setsockopt (newciptr->fd, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (int)); - } -#endif - - /* - * Get this address again because the transport may give a more - * specific address now that a connection is established. - */ - - if (TRANS(SocketINETGetAddr) (newciptr) < 0) - { - PRMSG (1, - "SocketINETAccept: ...SocketINETGetAddr() failed:\n", - 0, 0, 0); - close (newciptr->fd); - xfree (newciptr); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - if (TRANS(SocketINETGetPeerAddr) (newciptr) < 0) - { - PRMSG (1, - "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n", - 0, 0, 0); - close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - *status = 0; - - return newciptr; -} - -#endif /* TCPCONN */ - - -#ifdef UNIXCONN -static XtransConnInfo -TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) - -{ - XtransConnInfo newciptr; - struct sockaddr_un sockname; -#if defined(SVR4) || defined(__SCO__) - size_t namelen = sizeof sockname; -#else - int namelen = sizeof sockname; -#endif - - PRMSG (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd, 0); - - if ((newciptr = (XtransConnInfo) xcalloc ( - 1, sizeof(struct _XtransConnInfo))) == NULL) - { - PRMSG (1, "SocketUNIXAccept: malloc() failed\n", 0, 0, 0); - *status = TRANS_ACCEPT_BAD_MALLOC; - return NULL; - } - - if ((newciptr->fd = accept (ciptr->fd, - (struct sockaddr *) &sockname, (void *)&namelen)) < 0) - { - PRMSG (1, "SocketUNIXAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); - *status = TRANS_ACCEPT_FAILED; - return NULL; - } - - /* - * Get the socket name and the peer name from the listener socket, - * since this is unix domain. - */ - - if ((newciptr->addr = (char *) xalloc (ciptr->addrlen)) == NULL) - { - PRMSG (1, - "SocketUNIXAccept: Can't allocate space for the addr\n", - 0, 0, 0); - close (newciptr->fd); - xfree (newciptr); - *status = TRANS_ACCEPT_BAD_MALLOC; - return NULL; - } - - - newciptr->addrlen = ciptr->addrlen; - memcpy (newciptr->addr, ciptr->addr, newciptr->addrlen); - - if ((newciptr->peeraddr = (char *) xalloc (ciptr->addrlen)) == NULL) - { - PRMSG (1, - "SocketUNIXAccept: Can't allocate space for the addr\n", - 0, 0, 0); - close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); - *status = TRANS_ACCEPT_BAD_MALLOC; - return NULL; - } - - newciptr->peeraddrlen = ciptr->addrlen; - memcpy (newciptr->peeraddr, ciptr->addr, newciptr->addrlen); - - newciptr->family = AF_UNIX; - - *status = 0; - - return newciptr; -} - -#endif /* UNIXCONN */ - -#endif /* TRANS_SERVER */ - - -#ifdef TRANS_CLIENT - -#ifdef TCPCONN - -#if defined(IPv6) && defined(AF_INET6) -struct addrlist { - struct addrinfo * addr; - struct addrinfo * firstaddr; - char port[PORTBUFSIZE]; - char host[MAXHOSTNAMELEN]; -}; -static struct addrlist *addrlist = NULL; -#endif - - -static int -TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) - -{ - struct sockaddr * socketaddr = NULL; - int socketaddrlen = 0; - int res; -#if defined(IPv6) && defined(AF_INET6) - struct addrinfo hints; - char ntopbuf[INET6_ADDRSTRLEN]; - int resetonce = 0; -#endif - struct sockaddr_in sockname; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgethostbynameparams hparams; - _Xgetservbynameparams sparams; -#endif - struct hostent *hostp; - struct servent *servp; - unsigned long tmpaddr; -#ifdef X11_t - char portbuf[PORTBUFSIZE]; -#endif - - long tmpport; - char hostnamebuf[256]; /* tmp space */ - - PRMSG (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port); - - if (!host) - { - hostnamebuf[0] = '\0'; - (void) TRANS(GetHostname) (hostnamebuf, sizeof hostnamebuf); - host = hostnamebuf; - } - -#ifdef X11_t - /* - * X has a well known port, that is transport dependent. It is easier - * to handle it here, than try and come up with a transport independent - * representation that can be passed in and resolved the usual way. - * - * The port that is passed here is really a string containing the idisplay - * from ConnectDisplay(). - */ - - if (is_numeric (port)) - { - tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); - sprintf (portbuf, "%lu", tmpport); - port = portbuf; - } -#endif - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6) { - if (addrlist != NULL) { - if (strcmp(host,addrlist->host) || strcmp(port,addrlist->port)) { - if (addrlist->firstaddr) - freeaddrinfo(addrlist->firstaddr); - addrlist->firstaddr = NULL; - } - } else { - addrlist = malloc(sizeof(struct addrlist)); - addrlist->firstaddr = NULL; - } - - if (addrlist->firstaddr == NULL) { - strncpy(addrlist->port, port, sizeof(addrlist->port)); - addrlist->port[sizeof(addrlist->port) - 1] = '\0'; - strncpy(addrlist->host, host, sizeof(addrlist->host)); - addrlist->host[sizeof(addrlist->host) - 1] = '\0'; - - bzero(&hints,sizeof(hints)); - hints.ai_socktype = Sockettrans2devtab[ciptr->index].devcotsname; - - res = getaddrinfo(host,port,&hints,&addrlist->firstaddr); - if (res != 0) { - PRMSG (1, "SocketINETConnect() can't get address " - "for %s:%s: %s\n", host, port, gai_strerror(res)); - ESET(EINVAL); - return TRANS_CONNECT_FAILED; - } - for (res = 0, addrlist->addr = addrlist->firstaddr; - addrlist->addr ; res++) { - addrlist->addr = addrlist->addr->ai_next; - } - PRMSG(4,"Got New Address list with %d addresses\n", res, 0, 0); - res = 0; - addrlist->addr = NULL; - } - - while (socketaddr == NULL) { - if (addrlist->addr == NULL) { - if (resetonce) { - /* Already checked entire list - no usable addresses */ - PRMSG (1, "SocketINETConnect() no usable address " - "for %s:%s\n", host, port, 0); - return TRANS_CONNECT_FAILED; - } else { - /* Go back to beginning of list */ - resetonce = 1; - addrlist->addr = addrlist->firstaddr; - } - } - - socketaddr = addrlist->addr->ai_addr; - socketaddrlen = addrlist->addr->ai_addrlen; - - if (addrlist->addr->ai_family == AF_INET) { - struct sockaddr_in *sin = (struct sockaddr_in *) socketaddr; - - PRMSG (4,"SocketINETConnect() sockname.sin_addr = %s\n", - inet_ntop(addrlist->addr->ai_family,&sin->sin_addr, - ntopbuf,sizeof(ntopbuf)), 0, 0); - - PRMSG (4,"SocketINETConnect() sockname.sin_port = %d\n", - ntohs(sin->sin_port), 0, 0); - - if (Sockettrans2devtab[ciptr->index].family == AF_INET6) { - if (strcmp(Sockettrans2devtab[ciptr->index].transname, - "tcp") == 0) { - XtransConnInfo newciptr; - - /* - * Our socket is an IPv6 socket, but the address is - * IPv4. Close it and get an IPv4 socket. This is - * needed for IPv4 connections to work on platforms - * that don't allow IPv4 over IPv6 sockets. - */ - TRANS(SocketINETClose)(ciptr); - newciptr = TRANS(SocketOpenCOTSClientBase)( - "tcp", "tcp", host, port, ciptr->index); - if (newciptr) - ciptr->fd = newciptr->fd; - if (!newciptr || - Sockettrans2devtab[newciptr->index].family != - AF_INET) { - socketaddr = NULL; - PRMSG (4,"SocketINETConnect() Cannot get IPv4 " - " socketfor IPv4 address\n", 0,0,0); - } - if (newciptr) - xfree(newciptr); - } else { - socketaddr = NULL; - PRMSG (4,"SocketINETConnect Skipping IPv4 address\n", - 0,0,0); - } - } - } else if (addrlist->addr->ai_family == AF_INET6) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) socketaddr; - - PRMSG (4,"SocketINETConnect() sockname.sin6_addr = %s\n", - inet_ntop(addrlist->addr->ai_family, - &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)), - 0, 0); - PRMSG (4,"SocketINETConnect() sockname.sin6_port = %d\n", - ntohs(sin6->sin6_port), 0, 0); - - if (Sockettrans2devtab[ciptr->index].family == AF_INET) { - if (strcmp(Sockettrans2devtab[ciptr->index].transname, - "tcp") == 0) { - XtransConnInfo newciptr; - - /* - * Close the IPv4 socket and try to open an IPv6 socket. - */ - TRANS(SocketINETClose)(ciptr); - newciptr = TRANS(SocketOpenCOTSClientBase)( - "tcp", "tcp", host, port, -1); - if (newciptr) - ciptr->fd = newciptr->fd; - if (!newciptr || - Sockettrans2devtab[newciptr->index].family != - AF_INET6) { - socketaddr = NULL; - PRMSG (4,"SocketINETConnect() Cannot get IPv6 " - "socket for IPv6 address\n", 0,0,0); - } - if (newciptr) - xfree(newciptr); - } - else - { - socketaddr = NULL; - PRMSG (4,"SocketINETConnect() Skipping IPv6 address\n", - 0,0,0); - } - } - } else { - socketaddr = NULL; /* Unsupported address type */ - } - if (socketaddr == NULL) { - addrlist->addr = addrlist->addr->ai_next; - } - } - } else -#endif - { - /* - * Build the socket name. - */ - -#ifdef BSD44SOCKETS - sockname.sin_len = sizeof (struct sockaddr_in); -#endif - sockname.sin_family = AF_INET; - - /* - * fill in sin_addr - */ - -#ifndef INADDR_NONE -#define INADDR_NONE ((in_addr_t) 0xffffffff) -#endif - - /* check for ww.xx.yy.zz host string */ - - if (isascii (host[0]) && isdigit (host[0])) { - tmpaddr = inet_addr (host); /* returns network byte order */ - } else { - tmpaddr = INADDR_NONE; - } - - PRMSG (4,"SocketINETConnect() inet_addr(%s) = %x\n", host, tmpaddr, 0); - - if (tmpaddr == INADDR_NONE) { - if ((hostp = _XGethostbyname(host,hparams)) == NULL) { - PRMSG (1,"SocketINETConnect: Can't get address for %s\n", - host, 0, 0); - ESET(EINVAL); - return TRANS_CONNECT_FAILED; - } - if (hostp->h_addrtype != AF_INET) { /* is IP host? */ - PRMSG (1,"SocketINETConnect: not INET host%s\n", host, 0, 0); - ESET(EPROTOTYPE); - return TRANS_CONNECT_FAILED; - } - -#if defined(CRAY) && defined(OLDTCP) - /* Only Cray UNICOS3 and UNICOS4 will define this */ - { - long t; - memcpy ((char *)&t, (char *) hostp->h_addr, sizeof (t)); - sockname.sin_addr = t; - } -#else - memcpy ((char *) &sockname.sin_addr, (char *) hostp->h_addr, - sizeof (sockname.sin_addr)); -#endif /* CRAY and OLDTCP */ - - } else { -#if defined(CRAY) && defined(OLDTCP) - /* Only Cray UNICOS3 and UNICOS4 will define this */ - sockname.sin_addr = tmpaddr; -#else - sockname.sin_addr.s_addr = tmpaddr; -#endif /* CRAY and OLDTCP */ - } - - /* - * fill in sin_port - */ - - /* Check for number in the port string */ - - if (!is_numeric (port)) { - if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL) { - PRMSG (1,"SocketINETConnect: can't get service for %s\n", - port, 0, 0); - return TRANS_CONNECT_FAILED; - } - sockname.sin_port = htons (servp->s_port); - } else { - tmpport = strtol (port, (char**)NULL, 10); - if (tmpport < 1024 || tmpport > USHRT_MAX) - return TRANS_CONNECT_FAILED; - sockname.sin_port = htons (((unsigned short) tmpport)); - } - - PRMSG (4,"SocketINETConnect: sockname.sin_port = %d\n", - ntohs(sockname.sin_port), 0, 0); - socketaddr = (struct sockaddr *) &sockname; - socketaddrlen = sizeof(sockname); - } - - /* - * Turn on socket keepalive so the client process will eventually - * be notified with a SIGPIPE signal if the display server fails - * to respond to a periodic transmission of messages - * on the connected socket. - * This is useful to avoid hung application processes when the - * processes are not spawned from the xdm session and - * the display server terminates abnormally. - * (Someone turned off the power switch.) - */ - - { - int tmp = 1; - setsockopt (ciptr->fd, SOL_SOCKET, SO_KEEPALIVE, - (char *) &tmp, sizeof (int)); - } - - /* - * Do the connect() - */ - - if (connect (ciptr->fd, socketaddr, socketaddrlen ) < 0) - { -#ifdef WIN32 - int olderrno = WSAGetLastError(); -#else - int olderrno = errno; -#endif - - /* - * If the error was ECONNREFUSED, the server may be overloaded - * and we should try again. - * - * If the error was EWOULDBLOCK or EINPROGRESS then the socket - * was non-blocking and we should poll using select - * - * If the error was EINTR, the connect was interrupted and we - * should try again. - * - * If multiple addresses are found for a host then we should - * try to connect again with a different address for a larger - * number of errors that made us quit before, since those - * could be caused by trying to use an IPv6 address to contact - * a machine with an IPv4-only server or other reasons that - * only affect one of a set of addresses. - */ - - if (olderrno == ECONNREFUSED || olderrno == EINTR -#if defined(IPv6) && defined(AF_INET6) - || (haveIPv6 && ((addrlist->addr->ai_next != NULL) || - (addrlist->addr != addrlist->firstaddr)) && - (olderrno == ENETUNREACH || olderrno == EAFNOSUPPORT || - olderrno == EADDRNOTAVAIL || olderrno == ETIMEDOUT -#if defined(EHOSTDOWN) - || olderrno == EHOSTDOWN -#endif - )) -#endif - ) - res = TRANS_TRY_CONNECT_AGAIN; - else if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) - res = TRANS_IN_PROGRESS; - else - { - PRMSG (2,"SocketINETConnect: Can't connect: errno = %d\n", - olderrno,0, 0); - - res = TRANS_CONNECT_FAILED; - } - } else { - res = 0; - - - /* - * Sync up the address fields of ciptr. - */ - - if (TRANS(SocketINETGetAddr) (ciptr) < 0) - { - PRMSG (1, - "SocketINETConnect: ...SocketINETGetAddr() failed:\n", - 0, 0, 0); - res = TRANS_CONNECT_FAILED; - } - - else if (TRANS(SocketINETGetPeerAddr) (ciptr) < 0) - { - PRMSG (1, - "SocketINETConnect: ...SocketINETGetPeerAddr() failed:\n", - 0, 0, 0); - res = TRANS_CONNECT_FAILED; - } - } - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6 && res != 0) { - addrlist->addr = addrlist->addr->ai_next; - } -#endif - - return res; -} - -#endif /* TCPCONN */ - - - -#ifdef UNIXCONN - -/* - * Make sure 'host' is really local. - */ - -static int -UnixHostReallyLocal (char *host) - -{ - char hostnamebuf[256]; - -#if defined(IPv6) && defined(AF_INET6) - if (getaddrinfo == NULL) - haveIPv6 = 0; -#endif - - TRANS(GetHostname) (hostnamebuf, sizeof (hostnamebuf)); - - if (strcmp (hostnamebuf, host) == 0) - { - return (1); - } -#if defined(IPv6) && defined(AF_INET6) - else if (haveIPv6) - { - struct addrinfo *localhostaddr; - struct addrinfo *otherhostaddr; - struct addrinfo *i, *j; - int equiv = 0; - - if (getaddrinfo(hostnamebuf, NULL, NULL, &localhostaddr) != 0) - return 0; - if (getaddrinfo(host, NULL, NULL, &otherhostaddr) != 0) { - freeaddrinfo(localhostaddr); - return 0; - } - - for (i = localhostaddr; i != NULL && equiv == 0; i = i->ai_next) { - for (j = otherhostaddr; j != NULL && equiv == 0; j = j->ai_next) { - if (i->ai_family == j->ai_family) { - if (i->ai_family == AF_INET) { - struct sockaddr_in *sinA - = (struct sockaddr_in *) i->ai_addr; - struct sockaddr_in *sinB - = (struct sockaddr_in *) j->ai_addr; - struct in_addr *A = &sinA->sin_addr; - struct in_addr *B = &sinB->sin_addr; - - if (memcmp(A,B,sizeof(struct in_addr)) == 0) { - equiv = 1; - } - } else if (i->ai_family == AF_INET6) { - struct sockaddr_in6 *sinA - = (struct sockaddr_in6 *) i->ai_addr; - struct sockaddr_in6 *sinB - = (struct sockaddr_in6 *) j->ai_addr; - struct in6_addr *A = &sinA->sin6_addr; - struct in6_addr *B = &sinB->sin6_addr; - - if (memcmp(A,B,sizeof(struct in6_addr)) == 0) { - equiv = 1; - } - } - } - } - } - - freeaddrinfo(localhostaddr); - freeaddrinfo(otherhostaddr); - return equiv; - } -#endif - else - { - /* - * A host may have more than one network address. If any of the - * network addresses of 'host' (specified to the connect call) - * match any of the network addresses of 'hostname' (determined - * by TRANS(GetHostname)), then the two hostnames are equivalent, - * and we know that 'host' is really a local host. - */ - char specified_local_addr_list[10][4]; - int scount, equiv, i, j; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgethostbynameparams hparams; -#endif - struct hostent *hostp; - - if ((hostp = _XGethostbyname (host,hparams)) == NULL) - return (0); - - scount = 0; - while (hostp->h_addr_list[scount] && scount <= 8) - { - /* - * The 2nd call to gethostname() overrides the data - * from the 1st call, so we must save the address list. - */ - - specified_local_addr_list[scount][0] = - hostp->h_addr_list[scount][0]; - specified_local_addr_list[scount][1] = - hostp->h_addr_list[scount][1]; - specified_local_addr_list[scount][2] = - hostp->h_addr_list[scount][2]; - specified_local_addr_list[scount][3] = - hostp->h_addr_list[scount][3]; - scount++; - } - if ((hostp = _XGethostbyname (hostnamebuf,hparams)) == NULL) - return (0); - - equiv = 0; - i = 0; - - while (i < scount && !equiv) - { - j = 0; - - while (hostp->h_addr_list[j]) - { - if ((specified_local_addr_list[i][0] == - hostp->h_addr_list[j][0]) && - (specified_local_addr_list[i][1] == - hostp->h_addr_list[j][1]) && - (specified_local_addr_list[i][2] == - hostp->h_addr_list[j][2]) && - (specified_local_addr_list[i][3] == - hostp->h_addr_list[j][3])) - { - /* They're equal, so we're done */ - - equiv = 1; - break; - } - - j++; - } - - i++; - } - return (equiv); - } -} - -static int -TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port) - -{ - struct sockaddr_un sockname; - int namelen; - -#if defined(hpux) && defined(X11_t) - struct sockaddr_un old_sockname; - int old_namelen; -#endif - - - PRMSG (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port); - - /* - * Make sure 'host' is really local. If not, we return failure. - * The reason we make this check is because a process may advertise - * a "local" network ID for which it can accept connections, but if - * a process on a remote machine tries to connect to this network ID, - * we know for sure it will fail. - */ - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - if (strcmp(host, "unix") != 0 && strcasecmp(host, "nx") != 0 && - strncasecmp(host, "nx,", 3) != 0 && !UnixHostReallyLocal (host)) -#else - if (strcmp (host, "unix") != 0 && !UnixHostReallyLocal (host)) -#endif - { - PRMSG (1, - "SocketUNIXConnect: Cannot connect to non-local host %s\n", - host, 0, 0); - return TRANS_CONNECT_FAILED; - } - - - /* - * Check the port. - */ - - if (!port || !*port) - { - PRMSG (1,"SocketUNIXConnect: Missing port specification\n", - 0, 0, 0); - return TRANS_CONNECT_FAILED; - } - - /* - * Build the socket name. - */ - - sockname.sun_family = AF_UNIX; - -#ifdef NX_TRANS_SOCKET - if (set_sun_path(port, _NXGetUnixPath(UNIX_PATH), sockname.sun_path) != 0) { -#else - if (set_sun_path(port, UNIX_PATH, sockname.sun_path) != 0) { -#endif - PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0); - return TRANS_CONNECT_FAILED; - } - -#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx) - sockname.sun_len = strlen (sockname.sun_path); - namelen = SUN_LEN (&sockname); -#else - namelen = strlen (sockname.sun_path) + sizeof (sockname.sun_family); -#endif - - -#if defined(hpux) && defined(X11_t) - /* - * This is gross, but it was in Xlib - */ - old_sockname.sun_family = AF_UNIX; -#ifdef NX_TRANS_SOCKET - if (set_sun_path(port, _NXGetOldUnixPath(OLD_UNIX_PATH), old_sockname.sun_path) != 0) { -#else - if (set_sun_path(port, OLD_UNIX_PATH, old_sockname.sun_path) != 0) { -#endif - PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0); - return TRANS_CONNECT_FAILED; - } - old_namelen = strlen (old_sockname.sun_path) + - sizeof (old_sockname.sun_family); -#endif - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - if (ciptr->priv != NULL) - { - if (TRANS(SocketConnectConnInfo) (ciptr, host, port) != 0) - { - return TRANS_CONNECT_FAILED; - } - - goto SocketUNIXConnectPost; - } - -#endif - - /* - * Do the connect() - */ - - if (connect (ciptr->fd, (struct sockaddr *) &sockname, namelen) < 0) - { - int olderrno = errno; - int connected = 0; - -#if defined(hpux) && defined(X11_t) - if (olderrno == ENOENT) - { - if (connect (ciptr->fd, - (struct sockaddr *) &old_sockname, old_namelen) >= 0) - { - connected = 1; - } - else - olderrno = errno; - } -#endif - if (!connected) - { - errno = olderrno; - - /* - * If the error was ENOENT, the server may be starting up - * and we should try again. - * - * If the error was EWOULDBLOCK or EINPROGRESS then the socket - * was non-blocking and we should poll using select - * - * If the error was EINTR, the connect was interrupted and we - * should try again. - */ - - if (olderrno == ENOENT || olderrno == EINTR) - return TRANS_TRY_CONNECT_AGAIN; - else if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) - return TRANS_IN_PROGRESS; - else - { - PRMSG (2,"SocketUNIXConnect: Can't connect: errno = %d\n", - EGET(),0, 0); - - return TRANS_CONNECT_FAILED; - } - } - } - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - -SocketUNIXConnectPost: - -#endif - - /* - * Get the socket name and the peer name from the connect socket, - * since this is unix domain. - */ - - if ((ciptr->addr = (char *) xalloc(namelen)) == NULL || - (ciptr->peeraddr = (char *) xalloc(namelen)) == NULL) - { - PRMSG (1, - "SocketUNIXCreateListener: Can't allocate space for the addr\n", - 0, 0, 0); - return TRANS_CONNECT_FAILED; - } - - ciptr->family = AF_UNIX; - ciptr->addrlen = namelen; - ciptr->peeraddrlen = namelen; - memcpy (ciptr->addr, &sockname, ciptr->addrlen); - memcpy (ciptr->peeraddr, &sockname, ciptr->peeraddrlen); - - return 0; -} - -#endif /* UNIXCONN */ - -#endif /* TRANS_CLIENT */ - - -static int -TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend) - -{ - PRMSG (2,"SocketBytesReadable(%p,%d,%p)\n", - ciptr, ciptr->fd, pend); - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - if (ciptr->priv) - { - if (NXTransRunning(ciptr->fd) == 0) - { - /* - * Force the application to shut down the - * socket if the NX transport is gone. We - * may probably save this additional call. - */ - -#ifdef NX_TRANS_DEBUG - fprintf(stderr, "SocketBytesReadable: NX transport not running for descriptor [%d].\n", - ciptr->fd); -#endif - ESET(EPIPE); - - return -1; - } - else - { - /* - * Emulate BytesReadable. Some X applications may use the system - * select() in their main loop, instead of the _XSelect() that is - * replaced by NX. Still these applications use _XEventsQueued to - * poll events from the X connection, and _XEventsQueued uses the - * NX _XSelect(), so it is generally possible to let the client - * yield the control to NX and let it handle the I/O on the proxy - * descriptors even if the application is not explicitly designed - * to work as a NX agent. - */ - -#ifdef NX_TRANS_DEBUG - - int result; - - result = NXTransReadable(ciptr->fd, (int *) pend); - - fprintf(stderr, "SocketBytesReadable: Descriptor [%d] result [%d] readable [%ld].\n", - ciptr->fd, result, *pend); - - return result; -#else - return NXTransReadable(ciptr->fd, (int *) pend); -#endif - } - } - -#endif /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ - -#if defined(QNX4) - *pend = 0L; /* FIONREAD only returns a short. Zero out upper bits */ -#endif -#ifdef WIN32 - { - int ret = ioctlsocket ((SOCKET) ciptr->fd, FIONREAD, (u_long *) pend); - errno = WSAGetLastError(); - return ret; - } -#else -#if (defined(i386) && defined(SYSV) && !defined(SCO325)) || (defined(_SEQUENT_) && _SOCKET_VERSION == 1) - return ioctl (ciptr->fd, I_NREAD, (char *) pend); -#else -#if defined(__UNIXOS2__) - return ioctl (ciptr->fd, FIONREAD, (char*) pend, sizeof(int)); -#else - return ioctl (ciptr->fd, FIONREAD, (char *) pend); -#endif /* __UNIXOS2__ */ -#endif /* i386 && SYSV || _SEQUENT_ && _SOCKET_VERSION == 1 */ -#endif /* WIN32 */ -} - - -static int -TRANS(SocketRead) (XtransConnInfo ciptr, char *buf, int size) - -{ - PRMSG (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size); - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - /* - * If we have a valid priv pointer then this - * is an internal connection to the proxy. - * In this case we should emulate the read. - */ - - if (ciptr->priv) - { - int result; - - result = NXTransRead(ciptr->fd, buf, size); - -#ifdef NX_TRANS_DEBUG - if (result < 0 && EGET() == EAGAIN) - { - fprintf(stderr, "SocketRead: Read from descriptor [%d] would block.\n", - ciptr->fd); - } - else - { - fprintf(stderr, "SocketRead: Read [%d] bytes from descriptor [%d].\n", - result, ciptr->fd); - } -#endif - return result; - } - else - { - return read (ciptr->fd, buf, size); - } - -#else /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ - -#if defined(WIN32) || defined(__UNIXOS2__) - { - int ret = recv ((SOCKET)ciptr->fd, buf, size, 0); -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - return ret; - } -#else - return read (ciptr->fd, buf, size); -#endif /* WIN32 */ - -#endif /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ -} - - -static int -TRANS(SocketWrite) (XtransConnInfo ciptr, char *buf, int size) - -{ - PRMSG (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size); - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - /* - * If we have a valid priv pointer then this - * is an internal connection to the proxy. - * In this case we should emulate the write. - */ - - if (ciptr->priv) - { - int result; - - result = NXTransWrite(ciptr->fd, buf, size); - -#ifdef NX_TRANS_DEBUG - if (result < 0 && EGET() == EAGAIN) - { - fprintf(stderr, "SocketWrite: Write on descriptor [%d] would block.\n", - ciptr->fd); - } - else - { - fprintf(stderr, "SocketWrite: Written [%d] bytes on descriptor [%d].\n", - result, ciptr->fd); - } -#endif - return result; - } - else - { - return write (ciptr->fd, buf, size); - } - -#else /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ - -#if defined(WIN32) || defined(__UNIXOS2__) - { - int ret = send ((SOCKET)ciptr->fd, buf, size, 0); -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - return ret; - } -#else - return write (ciptr->fd, buf, size); -#endif /* WIN32 */ - -#endif /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ -} - - -static int -TRANS(SocketReadv) (XtransConnInfo ciptr, struct iovec *buf, int size) - -{ - PRMSG (2,"SocketReadv(%d,%p,%d)\n", ciptr->fd, buf, size); - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - /* - * If we have a valid priv pointer then this - * is an internal connection to the proxy. - * In this case we should emulate the readv. - */ - - if (ciptr->priv) - { - return NXTransReadVector(ciptr->fd, buf, size); - } - else - { - return READV (ciptr, buf, size); - } - -#else /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ - - return READV (ciptr, buf, size); - -#endif /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ -} - - -static int -TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size) - -{ - PRMSG (2,"SocketWritev(%d,%p,%d)\n", ciptr->fd, buf, size); - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - /* - * If we have a valid priv pointer then this - * is an internal connection to the proxy. - * In this case we should emulate the writev. - */ - - if (ciptr->priv) - { - return NXTransWriteVector(ciptr->fd, buf, size); - } - else - { - return WRITEV (ciptr, buf, size); - } - -#else /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ - - return WRITEV (ciptr, buf, size); - -#endif /* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */ -} - - -static int -TRANS(SocketDisconnect) (XtransConnInfo ciptr) - -{ - PRMSG (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd, 0); - -#ifdef WIN32 - { - int ret = shutdown (ciptr->fd, 2); - errno = WSAGetLastError(); - return ret; - } -#else - return shutdown (ciptr->fd, 2); /* disallow further sends and receives */ -#endif -} - - -#ifdef TCPCONN -static int -TRANS(SocketINETClose) (XtransConnInfo ciptr) - -{ - PRMSG (2,"SocketINETClose(%p,%d)\n", ciptr, ciptr->fd, 0); - -#ifdef WIN32 - { - int ret = close (ciptr->fd); - errno = WSAGetLastError(); - return ret; - } -#else - return close (ciptr->fd); -#endif -} - -#endif /* TCPCONN */ - - -#ifdef UNIXCONN -static int -TRANS(SocketUNIXClose) (XtransConnInfo ciptr) - -{ - /* - * If this is the server side, then once the socket is closed, - * it must be unlinked to completely close it - */ - - struct sockaddr_un *sockname = (struct sockaddr_un *) ciptr->addr; - int ret; - - PRMSG (2,"SocketUNIXClose(%x,%d)\n", ciptr, ciptr->fd, 0); - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - if (ciptr->priv) - { - TRANS(SocketCloseConnInfo) (ciptr); - } - -#endif - - ret = close(ciptr->fd); - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "SocketUNIXClose: Flags are [%d] for ciptr at [%p] check is [%d].\n", - ciptr->flags, (void *) ciptr, (ciptr->flags && sockname - && sockname->sun_family == AF_UNIX && sockname->sun_path[0])); -#endif - - if (ciptr->flags - && sockname - && sockname->sun_family == AF_UNIX - && sockname->sun_path[0]) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - if (!(ciptr->flags & TRANS_NOUNLINK)) - { - fprintf(stderr, "SocketUNIXClose: Unlinking path [%s] for ciptr at [%p].\n", - sockname->sun_path, (void *) ciptr); - unlink (sockname->sun_path); - } -#else - if (!(ciptr->flags & TRANS_NOUNLINK)) - unlink (sockname->sun_path); -#endif - } - - return ret; -} - -static int -TRANS(SocketUNIXCloseForCloning) (XtransConnInfo ciptr) - -{ - /* - * Don't unlink path. - */ - - int ret; - - PRMSG (2,"SocketUNIXCloseForCloning(%p,%d)\n", - ciptr, ciptr->fd, 0); - -#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) - - if (ciptr->priv) - { - TRANS(SocketCloseConnInfo) (ciptr); - } - -#endif - - ret = close(ciptr->fd); - - return ret; -} - -#endif /* UNIXCONN */ - - -#ifdef TCPCONN -# ifdef TRANS_SERVER -static char* tcp_nolisten[] = { - "inet", -#if defined(IPv6) && defined(AF_INET6) - "inet6", -#endif - NULL -}; -# endif - -Xtransport TRANS(SocketTCPFuncs) = { - /* Socket Interface */ - "tcp", - TRANS_ALIAS, -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - tcp_nolisten, - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketINETCreateListener), - NULL, /* ResetListener */ - TRANS(SocketINETAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketINETConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketINETClose), - TRANS(SocketINETClose), - }; - -Xtransport TRANS(SocketINETFuncs) = { - /* Socket Interface */ - "inet", - 0, -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketINETCreateListener), - NULL, /* ResetListener */ - TRANS(SocketINETAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketINETConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketINETClose), - TRANS(SocketINETClose), - }; - -#if defined(IPv6) && defined(AF_INET6) -Xtransport TRANS(SocketINET6Funcs) = { - /* Socket Interface */ - "inet6", - 0, -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketINETCreateListener), - NULL, /* ResetListener */ - TRANS(SocketINETAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketINETConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketINETClose), - TRANS(SocketINETClose), - }; -#endif /* IPv6 */ -#endif /* TCPCONN */ - -#ifdef UNIXCONN -#if !defined(LOCALCONN) -Xtransport TRANS(SocketLocalFuncs) = { - /* Socket Interface */ - "local", - 0, -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketUNIXCreateListener), - TRANS(SocketUNIXResetListener), - TRANS(SocketUNIXAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketUNIXConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketUNIXClose), - TRANS(SocketUNIXCloseForCloning), - }; -#endif /* !LOCALCONN */ -# ifdef TRANS_SERVER -# if !defined(LOCALCONN) -static char* unix_nolisten[] = { "local" , NULL }; -# endif -# endif - -Xtransport TRANS(SocketUNIXFuncs) = { - /* Socket Interface */ - "unix", -#if !defined(LOCALCONN) - TRANS_ALIAS, -#else - 0, -#endif -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER -#if !defined(LOCALCONN) - unix_nolisten, -#else - NULL, -#endif - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketUNIXCreateListener), - TRANS(SocketUNIXResetListener), - TRANS(SocketUNIXAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketUNIXConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketUNIXClose), - TRANS(SocketUNIXCloseForCloning), - }; - -#endif /* UNIXCONN */ diff --git a/nx-X11/lib/xtrans/Xtranssock.c.X.original b/nx-X11/lib/xtrans/Xtranssock.c.X.original deleted file mode 100644 index 0f3c6b46a..000000000 --- a/nx-X11/lib/xtrans/Xtranssock.c.X.original +++ /dev/null @@ -1,2504 +0,0 @@ -/* $XdotOrg: xc/lib/xtrans/Xtranssock.c,v 1.11 2005/11/08 06:33:26 jkj Exp $ */ -/* $Xorg: Xtranssock.c,v 1.11 2001/02/09 02:04:06 xorgcvs Exp $ */ -/* - -Copyright 1993, 1994, 1998 The Open Group -Copyright 2002 Sun Microsystems, Inc. All rights reserved. - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the copyright holders shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from the copyright holders. - -*/ -/* $XFree86: xc/lib/xtrans/Xtranssock.c,v 3.68 2004/01/07 04:28:02 dawes Exp $ */ - -/* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA - * - * 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 NCR not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. NCR makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN - * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#ifdef XTHREADS -#include -#endif - -#ifndef WIN32 - -#if defined(TCPCONN) || defined(UNIXCONN) -#include -#include -#include -#endif - -#if defined(TCPCONN) || defined(UNIXCONN) -#define X_INCLUDE_NETDB_H -#define XOS_USE_NO_LOCKING -#include -#endif - -#ifdef UNIXCONN -#ifndef X_NO_SYS_UN -#ifndef Lynx -#include -#else -#include -#endif -#endif -#include -#endif - -#if defined(hpux) || (defined(MOTOROLA) && defined(SYSV)) -#define NO_TCP_H -#endif - -#ifndef NO_TCP_H -#if defined(__osf__) || defined(linux) || defined(__GLIBC__) || defined(AIXV5) -#include -#endif /* osf */ -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) -#include -#include -#endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ || __DragonFly__ */ -#include -#endif /* !NO_TCP_H */ - -#include -#if defined(SVR4) && !defined(DGUX) && !defined(_SEQUENT_) -#include -#endif - -#if (defined(i386) && defined(SYSV)) && !defined(SCO325) && !defined(sun) -#include -#endif - -#if (defined(i386) && defined(SYSV)) && (!defined(ISC) || !defined(I_NREAD) || defined(SCO325)) || defined(_SEQUENT_) -#include -#endif - -#else /* !WIN32 */ - -#include -#include -#include -#undef close -#define close closesocket -#define ECONNREFUSED WSAECONNREFUSED -#define EADDRINUSE WSAEADDRINUSE -#define EPROTOTYPE WSAEPROTOTYPE -#undef EWOULDBLOCK -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEINPROGRESS -#undef EINTR -#define EINTR WSAEINTR -#define X_INCLUDE_NETDB_H -#define XOS_USE_MTSAFE_NETDBAPI -#include -#endif /* WIN32 */ - -#if defined(SO_DONTLINGER) && defined(SO_LINGER) -#undef SO_DONTLINGER -#endif - -#if defined(__UNIXOS2__) -#if defined(NOT_EMX09A) -static int IBMsockInit = 0; -#define SocketInitOnce()\ - if (!IBMsockInit) {\ - sock_init();\ - IBMsockInit = 1;\ - } -#undef EINTR -#define EINTR SOCEINTR -#undef EINVAL -#define EINVAL SOCEINVAL -#undef errno -#define errno sock_errno() -#undef close -#define close soclose -#undef ioctl -#define ioctl sockioctl -#else -#define SocketInitOnce() /**/ -#endif -/* this is still not there */ -#define SOCKET int -#else -/* others don't need this */ -#define SocketInitOnce() /**/ -#endif - -#define MIN_BACKLOG 128 -#ifdef SOMAXCONN -#if SOMAXCONN > MIN_BACKLOG -#define BACKLOG SOMAXCONN -#endif -#endif -#ifndef BACKLOG -#define BACKLOG MIN_BACKLOG -#endif -/* - * This is the Socket implementation of the X Transport service layer - * - * This file contains the implementation for both the UNIX and INET domains, - * and can be built for either one, or both. - * - */ - -typedef struct _Sockettrans2dev { - char *transname; - int family; - int devcotsname; - int devcltsname; - int protocol; -} Sockettrans2dev; - -static Sockettrans2dev Sockettrans2devtab[] = { -#ifdef TCPCONN - {"inet",AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, -#if !defined(IPv6) || !defined(AF_INET6) - {"tcp",AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, -#else /* IPv6 */ - {"tcp",AF_INET6,SOCK_STREAM,SOCK_DGRAM,0}, - {"tcp",AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, /* fallback */ - {"inet6",AF_INET6,SOCK_STREAM,SOCK_DGRAM,0}, -#endif -#endif /* TCPCONN */ -#ifdef UNIXCONN - {"unix",AF_UNIX,SOCK_STREAM,SOCK_DGRAM,0}, -#if !defined(LOCALCONN) - {"local",AF_UNIX,SOCK_STREAM,SOCK_DGRAM,0}, -#endif /* !LOCALCONN */ -#endif /* UNIXCONN */ -}; - -#define NUMSOCKETFAMILIES (sizeof(Sockettrans2devtab)/sizeof(Sockettrans2dev)) - -#ifdef TCPCONN -static int TRANS(SocketINETClose) (XtransConnInfo ciptr); -#endif - -#ifdef UNIXCONN - -#ifdef hpux - -#if defined(X11_t) -#define UNIX_PATH "/usr/spool/sockets/X11/" -#define UNIX_DIR "/usr/spool/sockets/X11" -#define OLD_UNIX_PATH "/tmp/.X11-unix/X" -#endif /* X11_t */ -#if defined(XIM_t) -#define UNIX_PATH "/usr/spool/sockets/XIM/" -#define UNIX_DIR "/usr/spool/sockets/XIM" -#define OLD_UNIX_PATH "/tmp/.XIM-unix/XIM" -#endif /* XIM_t */ -#if defined(FS_t) || defined(FONT_t) -#define UNIX_PATH "/usr/spool/sockets/fontserv/" -#define UNIX_DIR "/usr/spool/sockets/fontserv" -#endif /* FS_t || FONT_t */ -#if defined(ICE_t) -#define UNIX_PATH "/usr/spool/sockets/ICE/" -#define UNIX_DIR "/usr/spool/sockets/ICE" -#endif /* ICE_t */ -#if defined(TEST_t) -#define UNIX_PATH "/usr/spool/sockets/xtrans_test/" -#define UNIX_DIR "/usr/spool/sockets/xtrans_test" -#endif -#if defined(LBXPROXY_t) -#define UNIX_PATH "/usr/spool/sockets/X11/" -#define UNIX_DIR "/usr/spool/sockets/X11" -#endif - -#else /* !hpux */ - -#if defined(X11_t) -#define UNIX_PATH "/tmp/.X11-unix/X" -#define UNIX_DIR "/tmp/.X11-unix" -#endif /* X11_t */ -#if defined(XIM_t) -#define UNIX_PATH "/tmp/.XIM-unix/XIM" -#define UNIX_DIR "/tmp/.XIM-unix" -#endif /* XIM_t */ -#if defined(FS_t) || defined(FONT_t) -#define UNIX_PATH "/tmp/.font-unix/fs" -#define UNIX_DIR "/tmp/.font-unix" -#endif /* FS_t || FONT_t */ -#if defined(ICE_t) -#define UNIX_PATH "/tmp/.ICE-unix/" -#define UNIX_DIR "/tmp/.ICE-unix" -#endif /* ICE_t */ -#if defined(TEST_t) -#define UNIX_PATH "/tmp/.Test-unix/test" -#define UNIX_DIR "/tmp/.Test-unix" -#endif -#if defined(LBXPROXY_t) -#define UNIX_PATH "/tmp/.X11-unix/X" -#define UNIX_DIR "/tmp/.X11-unix" -#endif - -#endif /* hpux */ - -#endif /* UNIXCONN */ - -#define PORTBUFSIZE 32 - -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 255 -#endif - -/* - * This provides compatibility for apps linked against system libraries - * that don't have IPv6 support. - */ -#if defined(IPv6) && defined(AF_INET6) -static const struct in6_addr local_in6addr_any = IN6ADDR_ANY_INIT; -#pragma weak in6addr_any = local_in6addr_any -#ifndef __USLC__ -#pragma weak getaddrinfo -#endif -static int haveIPv6 = 1; -#endif - -/* - * These are some utility function used by the real interface function below. - */ - -static int -TRANS(SocketSelectFamily) (int first, char *family) - -{ - int i; - - PRMSG (3,"SocketSelectFamily(%s)\n", family, 0, 0); - - for (i = first + 1; i < NUMSOCKETFAMILIES;i++) - { - if (!strcmp (family, Sockettrans2devtab[i].transname)) - return i; - } - - return (first == -1 ? -2 : -1); -} - - -/* - * This function gets the local address of the socket and stores it in the - * XtransConnInfo structure for the connection. - */ - -static int -TRANS(SocketINETGetAddr) (XtransConnInfo ciptr) - -{ -#if defined(IPv6) && defined(AF_INET6) - struct sockaddr_storage socknamev6; -#endif - struct sockaddr_in socknamev4; - void *socknamePtr; -#if defined(SVR4) || defined(__SCO__) - size_t namelen; -#else - int namelen; -#endif - - PRMSG (3,"SocketINETGetAddr(%p)\n", ciptr, 0, 0); - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6) - { - namelen = sizeof(socknamev6); - socknamePtr = &socknamev6; - } - else -#endif - { - namelen = sizeof(socknamev4); - socknamePtr = &socknamev4; - } - - if (getsockname (ciptr->fd,(struct sockaddr *) socknamePtr, - (void *)&namelen) < 0) - { -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - PRMSG (1,"SocketINETGetAddr: getsockname() failed: %d\n", - EGET(),0, 0); - return -1; - } - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) - { - PRMSG (1, - "SocketINETGetAddr: Can't allocate space for the addr\n", - 0, 0, 0); - return -1; - } - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6) - { - ciptr->family = ((struct sockaddr *)socknamePtr)->sa_family; - } - else -#endif - { - ciptr->family = socknamev4.sin_family; - } - ciptr->addrlen = namelen; - memcpy (ciptr->addr, socknamePtr, ciptr->addrlen); - - return 0; -} - - -/* - * This function gets the remote address of the socket and stores it in the - * XtransConnInfo structure for the connection. - */ - -static int -TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr) - -{ -#if defined(IPv6) && defined(AF_INET6) - struct sockaddr_storage socknamev6; -#endif - struct sockaddr_in socknamev4; - void *socknamePtr; -#if defined(SVR4) || defined(__SCO__) - size_t namelen; -#else - int namelen; -#endif - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6 && ciptr->family == AF_INET6) - { - namelen = sizeof(socknamev6); - socknamePtr = &socknamev6; - } - else -#endif - { - namelen = sizeof(socknamev4); - socknamePtr = &socknamev4; - } - - PRMSG (3,"SocketINETGetPeerAddr(%p)\n", ciptr, 0, 0); - - if (getpeername (ciptr->fd, (struct sockaddr *) socknamePtr, - (void *)&namelen) < 0) - { -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - PRMSG (1,"SocketINETGetPeerAddr: getpeername() failed: %d\n", - EGET(), 0, 0); - return -1; - } - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) - { - PRMSG (1, - "SocketINETGetPeerAddr: Can't allocate space for the addr\n", - 0, 0, 0); - return -1; - } - - ciptr->peeraddrlen = namelen; - memcpy (ciptr->peeraddr, socknamePtr, ciptr->peeraddrlen); - - return 0; -} - - -static XtransConnInfo -TRANS(SocketOpen) (int i, int type) - -{ - XtransConnInfo ciptr; - - PRMSG (3,"SocketOpen(%d,%d)\n", i, type, 0); - -#if defined(IPv6) && defined(AF_INET6) - if (getaddrinfo == NULL) - haveIPv6 = 0; - - if (!haveIPv6 && Sockettrans2devtab[i].family == AF_INET6) - return NULL; -#endif - - if ((ciptr = (XtransConnInfo) xcalloc ( - 1, sizeof(struct _XtransConnInfo))) == NULL) - { - PRMSG (1, "SocketOpen: malloc failed\n", 0, 0, 0); - return NULL; - } - - if ((ciptr->fd = socket(Sockettrans2devtab[i].family, type, - Sockettrans2devtab[i].protocol)) < 0 -#ifndef WIN32 -#if (defined(X11_t) && !defined(USE_POLL)) || defined(FS_t) || defined(FONT_t) - || ciptr->fd >= TRANS_OPEN_MAX -#endif -#endif - ) { -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - PRMSG (2, "SocketOpen: socket() failed for %s\n", - Sockettrans2devtab[i].transname, 0, 0); - - xfree ((char *) ciptr); - return NULL; - } - -#ifdef TCP_NODELAY - if (Sockettrans2devtab[i].family == AF_INET -#if defined(IPv6) && defined(AF_INET6) - || Sockettrans2devtab[i].family == AF_INET6 -#endif - ) - { - /* - * turn off TCP coalescence for INET sockets - */ - - int tmp = 1; - setsockopt (ciptr->fd, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (int)); - } -#endif - - return ciptr; -} - - -#ifdef TRANS_REOPEN - -static XtransConnInfo -TRANS(SocketReopen) (int i, int type, int fd, char *port) - -{ - XtransConnInfo ciptr; - - PRMSG (3,"SocketReopen(%d,%d,%s)\n", type, fd, port); - - if ((ciptr = (XtransConnInfo) xcalloc ( - 1, sizeof(struct _XtransConnInfo))) == NULL) - { - PRMSG (1, "SocketReopen: malloc failed\n", 0, 0, 0); - return NULL; - } - - ciptr->fd = fd; - - return ciptr; -} - -#endif /* TRANS_REOPEN */ - - -/* - * These functions are the interface supplied in the Xtransport structure - */ - -#ifdef TRANS_CLIENT - -static XtransConnInfo -TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol, - char *host, char *port, int previndex) -{ - XtransConnInfo ciptr; - int i = previndex; - - PRMSG (2, "SocketOpenCOTSClient(%s,%s,%s)\n", - protocol, host, port); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, transname)) >= 0) { - if ((ciptr = TRANS(SocketOpen) ( - i, Sockettrans2devtab[i].devcotsname)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketOpenCOTSClient: Unable to open socket for %s\n", - transname, 0, 0); - else - PRMSG (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n", - transname, 0, 0); - return NULL; - } - - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -static XtransConnInfo -TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol, - char *host, char *port) -{ - return TRANS(SocketOpenCOTSClientBase)( - thistrans->TransName, protocol, host, port, -1); -} - - -#endif /* TRANS_CLIENT */ - - -#ifdef TRANS_SERVER - -static XtransConnInfo -TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - if ((ciptr = TRANS(SocketOpen) ( - i, Sockettrans2devtab[i].devcotsname)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketOpenCOTSServer: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - - /* - * Using this prevents the bind() check for an existing server listening - * on the same port, but it is required for other reasons. - */ -#ifdef SO_REUSEADDR - - /* - * SO_REUSEADDR only applied to AF_INET && AF_INET6 - */ - - if (Sockettrans2devtab[i].family == AF_INET -#if defined(IPv6) && defined(AF_INET6) - || Sockettrans2devtab[i].family == AF_INET6 -#endif - ) - { - int one = 1; - setsockopt (ciptr->fd, SOL_SOCKET, SO_REUSEADDR, - (char *) &one, sizeof (int)); - } -#endif -#ifdef IPV6_V6ONLY - if (Sockettrans2devtab[i].family == AF_INET6) - { - int one = 1; - setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(int)); - } -#endif - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_SERVER */ - - -#ifdef TRANS_CLIENT - -static XtransConnInfo -TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2,"SocketOpenCLTSClient(%s,%s,%s)\n", protocol, host, port); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - if ((ciptr = TRANS(SocketOpen) ( - i, Sockettrans2devtab[i].devcotsname)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketOpenCLTSClient: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_CLIENT */ - - -#ifdef TRANS_SERVER - -static XtransConnInfo -TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2,"SocketOpenCLTSServer(%s,%s,%s)\n", protocol, host, port); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - if ((ciptr = TRANS(SocketOpen) ( - i, Sockettrans2devtab[i].devcotsname)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketOpenCLTSServer: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - -#ifdef IPV6_V6ONLY - if (Sockettrans2devtab[i].family == AF_INET6) - { - int one = 1; - setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(int)); - } -#endif - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_SERVER */ - - -#ifdef TRANS_REOPEN - -static XtransConnInfo -TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2, - "SocketReopenCOTSServer(%d, %s)\n", fd, port, 0); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - if ((ciptr = TRANS(SocketReopen) ( - i, Sockettrans2devtab[i].devcotsname, fd, port)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketReopenCOTSServer: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -static XtransConnInfo -TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port) - -{ - XtransConnInfo ciptr; - int i = -1; - - PRMSG (2, - "SocketReopenCLTSServer(%d, %s)\n", fd, port, 0); - - SocketInitOnce(); - - while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { - if ((ciptr = TRANS(SocketReopen) ( - i, Sockettrans2devtab[i].devcotsname, fd, port)) != NULL) - break; - } - if (i < 0) { - if (i == -1) - PRMSG (1,"SocketReopenCLTSServer: Unable to open socket for %s\n", - thistrans->TransName, 0, 0); - else - PRMSG (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n", - thistrans->TransName, 0, 0); - return NULL; - } - - /* Save the index for later use */ - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_REOPEN */ - - -static int -TRANS(SocketSetOption) (XtransConnInfo ciptr, int option, int arg) - -{ - PRMSG (2,"SocketSetOption(%d,%d,%d)\n", ciptr->fd, option, arg); - - return -1; -} - -#ifdef UNIXCONN -static int -set_sun_path(const char *port, const char *upath, char *path) -{ - struct sockaddr_un s; - int maxlen = sizeof(s.sun_path) - 1; - - if (!port || !*port || !path) - return -1; - - if (*port == '/') { /* a full pathname */ - if (strlen(port) > maxlen) - return -1; - sprintf(path, "%s", port); - } else { - if (strlen(port) + strlen(upath) > maxlen) - return -1; - sprintf(path, "%s%s", upath, port); - } - return 0; -} -#endif - -#ifdef TRANS_SERVER - -static int -TRANS(SocketCreateListener) (XtransConnInfo ciptr, - struct sockaddr *sockname, - int socknamelen, unsigned int flags) - -{ - int namelen = socknamelen; - int fd = ciptr->fd; - int retry; - - PRMSG (3, "SocketCreateListener(%x,%p)\n", ciptr, fd, 0); - - if (Sockettrans2devtab[ciptr->index].family == AF_INET -#if defined(IPv6) && defined(AF_INET6) - || Sockettrans2devtab[ciptr->index].family == AF_INET6 -#endif - ) - retry = 20; - else - retry = 0; - - while (bind (fd, (struct sockaddr *) sockname, namelen) < 0) - { - if (errno == EADDRINUSE) { - if (flags & ADDR_IN_USE_ALLOWED) - break; - else - return TRANS_ADDR_IN_USE; - } - - if (retry-- == 0) { - PRMSG (1, "SocketCreateListener: failed to bind listener\n", - 0, 0, 0); - close (fd); - return TRANS_CREATE_LISTENER_FAILED; - } -#ifdef SO_REUSEADDR - sleep (1); -#else - sleep (10); -#endif /* SO_REUSEDADDR */ - } - - if (Sockettrans2devtab[ciptr->index].family == AF_INET -#if defined(IPv6) && defined(AF_INET6) - || Sockettrans2devtab[ciptr->index].family == AF_INET6 -#endif - ) { -#ifdef SO_DONTLINGER - setsockopt (fd, SOL_SOCKET, SO_DONTLINGER, (char *) NULL, 0); -#else -#ifdef SO_LINGER - { - static int linger[2] = { 0, 0 }; - setsockopt (fd, SOL_SOCKET, SO_LINGER, - (char *) linger, sizeof (linger)); - } -#endif -#endif -} - - if (listen (fd, BACKLOG) < 0) - { - PRMSG (1, "SocketCreateListener: listen() failed\n", 0, 0, 0); - close (fd); - return TRANS_CREATE_LISTENER_FAILED; - } - - /* Set a flag to indicate that this connection is a listener */ - - ciptr->flags = 1 | (ciptr->flags & TRANS_KEEPFLAGS); - - return 0; -} - -#ifdef TCPCONN -static int -TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags) - -{ -#if defined(IPv6) && defined(AF_INET6) - struct sockaddr_storage sockname; -#else - struct sockaddr_in sockname; -#endif - unsigned short sport; - int namelen = sizeof(sockname); - int status; - long tmpport; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgetservbynameparams sparams; -#endif - struct servent *servp; - -#ifdef X11_t - char portbuf[PORTBUFSIZE]; -#endif - - PRMSG (2, "SocketINETCreateListener(%s)\n", port, 0, 0); - -#ifdef X11_t - /* - * X has a well known port, that is transport dependent. It is easier - * to handle it here, than try and come up with a transport independent - * representation that can be passed in and resolved the usual way. - * - * The port that is passed here is really a string containing the idisplay - * from ConnectDisplay(). - */ - - if (is_numeric (port)) - { - /* fixup the server port address */ - tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); - sprintf (portbuf,"%lu", tmpport); - port = portbuf; - } -#endif - - if (port && *port) - { - /* Check to see if the port string is just a number (handles X11) */ - - if (!is_numeric (port)) - { - if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL) - { - PRMSG (1, - "SocketINETCreateListener: Unable to get service for %s\n", - port, 0, 0); - return TRANS_CREATE_LISTENER_FAILED; - } - /* we trust getservbyname to return a valid number */ - sport = servp->s_port; - } - else - { - tmpport = strtol (port, (char**)NULL, 10); - /* - * check that somehow the port address isn't negative or in - * the range of reserved port addresses. This can happen and - * be very bad if the server is suid-root and the user does - * something (dumb) like `X :60049`. - */ - if (tmpport < 1024 || tmpport > USHRT_MAX) - return TRANS_CREATE_LISTENER_FAILED; - - sport = (unsigned short) tmpport; - } - } - else - sport = 0; - - bzero(&sockname, sizeof(sockname)); -#if defined(IPv6) && defined(AF_INET6) - if (Sockettrans2devtab[ciptr->index].family == AF_INET) { - namelen = sizeof (struct sockaddr_in); -#ifdef BSD44SOCKETS - ((struct sockaddr_in *)&sockname)->sin_len = namelen; -#endif - ((struct sockaddr_in *)&sockname)->sin_family = AF_INET; - ((struct sockaddr_in *)&sockname)->sin_port = htons(sport); - ((struct sockaddr_in *)&sockname)->sin_addr.s_addr = htonl(INADDR_ANY); - } else { - namelen = sizeof (struct sockaddr_in6); -#ifdef SIN6_LEN - ((struct sockaddr_in6 *)&sockname)->sin6_len = sizeof(sockname); -#endif - ((struct sockaddr_in6 *)&sockname)->sin6_family = AF_INET6; - ((struct sockaddr_in6 *)&sockname)->sin6_port = htons(sport); - ((struct sockaddr_in6 *)&sockname)->sin6_addr = in6addr_any; - } -#else -#ifdef BSD44SOCKETS - sockname.sin_len = sizeof (sockname); -#endif - sockname.sin_family = AF_INET; - sockname.sin_port = htons (sport); - sockname.sin_addr.s_addr = htonl (INADDR_ANY); -#endif - - if ((status = TRANS(SocketCreateListener) (ciptr, - (struct sockaddr *) &sockname, namelen, flags)) < 0) - { - PRMSG (1, - "SocketINETCreateListener: ...SocketCreateListener() failed\n", - 0, 0, 0); - return status; - } - - if (TRANS(SocketINETGetAddr) (ciptr) < 0) - { - PRMSG (1, - "SocketINETCreateListener: ...SocketINETGetAddr() failed\n", - 0, 0, 0); - return TRANS_CREATE_LISTENER_FAILED; - } - - return 0; -} - -#endif /* SOCKCONN */ - - -#ifdef UNIXCONN - -static int -TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port, - unsigned int flags) - -{ - struct sockaddr_un sockname; - int namelen; - int oldUmask; - int status; - unsigned int mode; - - PRMSG (2, "SocketUNIXCreateListener(%s)\n", - port ? port : "NULL", 0, 0); - - /* Make sure the directory is created */ - - oldUmask = umask (0); - -#ifdef UNIX_DIR -#ifdef HAS_STICKY_DIR_BIT - mode = 01777; -#else - mode = 0777; -#endif - if (trans_mkdir(UNIX_DIR, mode) == -1) { - PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n", - UNIX_DIR, errno, 0); - (void) umask (oldUmask); - return TRANS_CREATE_LISTENER_FAILED; - } -#endif - - sockname.sun_family = AF_UNIX; - - if (port && *port) { - if (set_sun_path(port, UNIX_PATH, sockname.sun_path) != 0) { - PRMSG (1, "SocketUNIXCreateListener: path too long\n", 0, 0, 0); - return TRANS_CREATE_LISTENER_FAILED; - } - } else { - sprintf (sockname.sun_path, "%s%ld", UNIX_PATH, (long)getpid()); - } - -#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx) - sockname.sun_len = strlen(sockname.sun_path); - namelen = SUN_LEN(&sockname); -#else - namelen = strlen(sockname.sun_path) + sizeof(sockname.sun_family); -#endif - - unlink (sockname.sun_path); - - if ((status = TRANS(SocketCreateListener) (ciptr, - (struct sockaddr *) &sockname, namelen, flags)) < 0) - { - PRMSG (1, - "SocketUNIXCreateListener: ...SocketCreateListener() failed\n", - 0, 0, 0); - (void) umask (oldUmask); - return status; - } - - /* - * Now that the listener is esablished, create the addr info for - * this connection. getpeername() doesn't work for UNIX Domain Sockets - * on some systems (hpux at least), so we will just do it manually, instead - * of calling something like TRANS(SocketUNIXGetAddr). - */ - - namelen = sizeof (sockname); /* this will always make it the same size */ - - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) - { - PRMSG (1, - "SocketUNIXCreateListener: Can't allocate space for the addr\n", - 0, 0, 0); - (void) umask (oldUmask); - return TRANS_CREATE_LISTENER_FAILED; - } - - ciptr->family = sockname.sun_family; - ciptr->addrlen = namelen; - memcpy (ciptr->addr, &sockname, ciptr->addrlen); - - (void) umask (oldUmask); - - return 0; -} - - -static int -TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr) - -{ - /* - * See if the unix domain socket has disappeared. If it has, recreate it. - */ - - struct sockaddr_un *unsock = (struct sockaddr_un *) ciptr->addr; - struct stat statb; - int status = TRANS_RESET_NOOP; - unsigned int mode; - - PRMSG (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd, 0); - - if (stat (unsock->sun_path, &statb) == -1 || - ((statb.st_mode & S_IFMT) != -#if (defined (sun) && defined(SVR4)) || defined(NCR) || defined(SCO325) || !defined(S_IFSOCK) - S_IFIFO)) -#else - S_IFSOCK)) -#endif - { - int oldUmask = umask (0); - -#ifdef UNIX_DIR -#ifdef HAS_STICKY_DIR_BIT - mode = 01777; -#else - mode = 0777; -#endif - if (trans_mkdir(UNIX_DIR, mode) == -1) { - PRMSG (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n", - UNIX_DIR, errno, 0); - (void) umask (oldUmask); - return TRANS_RESET_FAILURE; - } -#endif - - close (ciptr->fd); - unlink (unsock->sun_path); - - if ((ciptr->fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) - { - TRANS(FreeConnInfo) (ciptr); - (void) umask (oldUmask); - return TRANS_RESET_FAILURE; - } - - if (bind (ciptr->fd, (struct sockaddr *) unsock, ciptr->addrlen) < 0) - { - close (ciptr->fd); - TRANS(FreeConnInfo) (ciptr); - return TRANS_RESET_FAILURE; - } - - if (listen (ciptr->fd, BACKLOG) < 0) - { - close (ciptr->fd); - TRANS(FreeConnInfo) (ciptr); - (void) umask (oldUmask); - return TRANS_RESET_FAILURE; - } - - umask (oldUmask); - - status = TRANS_RESET_NEW_FD; - } - - return status; -} - -#endif /* UNIXCONN */ - - -#ifdef TCPCONN - -static XtransConnInfo -TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) - -{ - XtransConnInfo newciptr; - struct sockaddr_in sockname; - int namelen = sizeof(sockname); - - PRMSG (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd, 0); - - if ((newciptr = (XtransConnInfo) xcalloc ( - 1, sizeof(struct _XtransConnInfo))) == NULL) - { - PRMSG (1, "SocketINETAccept: malloc failed\n", 0, 0, 0); - *status = TRANS_ACCEPT_BAD_MALLOC; - return NULL; - } - - if ((newciptr->fd = accept (ciptr->fd, - (struct sockaddr *) &sockname, (void *)&namelen)) < 0) - { -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - PRMSG (1, "SocketINETAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); - *status = TRANS_ACCEPT_FAILED; - return NULL; - } - -#ifdef TCP_NODELAY - { - /* - * turn off TCP coalescence for INET sockets - */ - - int tmp = 1; - setsockopt (newciptr->fd, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (int)); - } -#endif - - /* - * Get this address again because the transport may give a more - * specific address now that a connection is established. - */ - - if (TRANS(SocketINETGetAddr) (newciptr) < 0) - { - PRMSG (1, - "SocketINETAccept: ...SocketINETGetAddr() failed:\n", - 0, 0, 0); - close (newciptr->fd); - xfree (newciptr); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - if (TRANS(SocketINETGetPeerAddr) (newciptr) < 0) - { - PRMSG (1, - "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n", - 0, 0, 0); - close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - *status = 0; - - return newciptr; -} - -#endif /* TCPCONN */ - - -#ifdef UNIXCONN -static XtransConnInfo -TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) - -{ - XtransConnInfo newciptr; - struct sockaddr_un sockname; -#if defined(SVR4) || defined(__SCO__) - size_t namelen = sizeof sockname; -#else - int namelen = sizeof sockname; -#endif - - PRMSG (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd, 0); - - if ((newciptr = (XtransConnInfo) xcalloc ( - 1, sizeof(struct _XtransConnInfo))) == NULL) - { - PRMSG (1, "SocketUNIXAccept: malloc() failed\n", 0, 0, 0); - *status = TRANS_ACCEPT_BAD_MALLOC; - return NULL; - } - - if ((newciptr->fd = accept (ciptr->fd, - (struct sockaddr *) &sockname, (void *)&namelen)) < 0) - { - PRMSG (1, "SocketUNIXAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); - *status = TRANS_ACCEPT_FAILED; - return NULL; - } - - /* - * Get the socket name and the peer name from the listener socket, - * since this is unix domain. - */ - - if ((newciptr->addr = (char *) xalloc (ciptr->addrlen)) == NULL) - { - PRMSG (1, - "SocketUNIXAccept: Can't allocate space for the addr\n", - 0, 0, 0); - close (newciptr->fd); - xfree (newciptr); - *status = TRANS_ACCEPT_BAD_MALLOC; - return NULL; - } - - - newciptr->addrlen = ciptr->addrlen; - memcpy (newciptr->addr, ciptr->addr, newciptr->addrlen); - - if ((newciptr->peeraddr = (char *) xalloc (ciptr->addrlen)) == NULL) - { - PRMSG (1, - "SocketUNIXAccept: Can't allocate space for the addr\n", - 0, 0, 0); - close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); - *status = TRANS_ACCEPT_BAD_MALLOC; - return NULL; - } - - newciptr->peeraddrlen = ciptr->addrlen; - memcpy (newciptr->peeraddr, ciptr->addr, newciptr->addrlen); - - newciptr->family = AF_UNIX; - - *status = 0; - - return newciptr; -} - -#endif /* UNIXCONN */ - -#endif /* TRANS_SERVER */ - - -#ifdef TRANS_CLIENT - -#ifdef TCPCONN - -#if defined(IPv6) && defined(AF_INET6) -struct addrlist { - struct addrinfo * addr; - struct addrinfo * firstaddr; - char port[PORTBUFSIZE]; - char host[MAXHOSTNAMELEN]; -}; -static struct addrlist *addrlist = NULL; -#endif - - -static int -TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) - -{ - struct sockaddr * socketaddr = NULL; - int socketaddrlen = 0; - int res; -#if defined(IPv6) && defined(AF_INET6) - struct addrinfo hints; - char ntopbuf[INET6_ADDRSTRLEN]; - int resetonce = 0; -#endif - struct sockaddr_in sockname; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgethostbynameparams hparams; - _Xgetservbynameparams sparams; -#endif - struct hostent *hostp; - struct servent *servp; - unsigned long tmpaddr; -#ifdef X11_t - char portbuf[PORTBUFSIZE]; -#endif - - long tmpport; - char hostnamebuf[256]; /* tmp space */ - - PRMSG (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port); - - if (!host) - { - hostnamebuf[0] = '\0'; - (void) TRANS(GetHostname) (hostnamebuf, sizeof hostnamebuf); - host = hostnamebuf; - } - -#ifdef X11_t - /* - * X has a well known port, that is transport dependent. It is easier - * to handle it here, than try and come up with a transport independent - * representation that can be passed in and resolved the usual way. - * - * The port that is passed here is really a string containing the idisplay - * from ConnectDisplay(). - */ - - if (is_numeric (port)) - { - tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); - sprintf (portbuf, "%lu", tmpport); - port = portbuf; - } -#endif - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6) { - if (addrlist != NULL) { - if (strcmp(host,addrlist->host) || strcmp(port,addrlist->port)) { - if (addrlist->firstaddr) - freeaddrinfo(addrlist->firstaddr); - addrlist->firstaddr = NULL; - } - } else { - addrlist = malloc(sizeof(struct addrlist)); - addrlist->firstaddr = NULL; - } - - if (addrlist->firstaddr == NULL) { - strncpy(addrlist->port, port, sizeof(addrlist->port)); - addrlist->port[sizeof(addrlist->port) - 1] = '\0'; - strncpy(addrlist->host, host, sizeof(addrlist->host)); - addrlist->host[sizeof(addrlist->host) - 1] = '\0'; - - bzero(&hints,sizeof(hints)); - hints.ai_socktype = Sockettrans2devtab[ciptr->index].devcotsname; - - res = getaddrinfo(host,port,&hints,&addrlist->firstaddr); - if (res != 0) { - PRMSG (1, "SocketINETConnect() can't get address " - "for %s:%s: %s\n", host, port, gai_strerror(res)); - ESET(EINVAL); - return TRANS_CONNECT_FAILED; - } - for (res = 0, addrlist->addr = addrlist->firstaddr; - addrlist->addr ; res++) { - addrlist->addr = addrlist->addr->ai_next; - } - PRMSG(4,"Got New Address list with %d addresses\n", res, 0, 0); - res = 0; - addrlist->addr = NULL; - } - - while (socketaddr == NULL) { - if (addrlist->addr == NULL) { - if (resetonce) { - /* Already checked entire list - no usable addresses */ - PRMSG (1, "SocketINETConnect() no usable address " - "for %s:%s\n", host, port, 0); - return TRANS_CONNECT_FAILED; - } else { - /* Go back to beginning of list */ - resetonce = 1; - addrlist->addr = addrlist->firstaddr; - } - } - - socketaddr = addrlist->addr->ai_addr; - socketaddrlen = addrlist->addr->ai_addrlen; - - if (addrlist->addr->ai_family == AF_INET) { - struct sockaddr_in *sin = (struct sockaddr_in *) socketaddr; - - PRMSG (4,"SocketINETConnect() sockname.sin_addr = %s\n", - inet_ntop(addrlist->addr->ai_family,&sin->sin_addr, - ntopbuf,sizeof(ntopbuf)), 0, 0); - - PRMSG (4,"SocketINETConnect() sockname.sin_port = %d\n", - ntohs(sin->sin_port), 0, 0); - - if (Sockettrans2devtab[ciptr->index].family == AF_INET6) { - if (strcmp(Sockettrans2devtab[ciptr->index].transname, - "tcp") == 0) { - XtransConnInfo newciptr; - - /* - * Our socket is an IPv6 socket, but the address is - * IPv4. Close it and get an IPv4 socket. This is - * needed for IPv4 connections to work on platforms - * that don't allow IPv4 over IPv6 sockets. - */ - TRANS(SocketINETClose)(ciptr); - newciptr = TRANS(SocketOpenCOTSClientBase)( - "tcp", "tcp", host, port, ciptr->index); - if (newciptr) - ciptr->fd = newciptr->fd; - if (!newciptr || - Sockettrans2devtab[newciptr->index].family != - AF_INET) { - socketaddr = NULL; - PRMSG (4,"SocketINETConnect() Cannot get IPv4 " - " socketfor IPv4 address\n", 0,0,0); - } - if (newciptr) - xfree(newciptr); - } else { - socketaddr = NULL; - PRMSG (4,"SocketINETConnect Skipping IPv4 address\n", - 0,0,0); - } - } - } else if (addrlist->addr->ai_family == AF_INET6) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) socketaddr; - - PRMSG (4,"SocketINETConnect() sockname.sin6_addr = %s\n", - inet_ntop(addrlist->addr->ai_family, - &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)), - 0, 0); - PRMSG (4,"SocketINETConnect() sockname.sin6_port = %d\n", - ntohs(sin6->sin6_port), 0, 0); - - if (Sockettrans2devtab[ciptr->index].family == AF_INET) { - if (strcmp(Sockettrans2devtab[ciptr->index].transname, - "tcp") == 0) { - XtransConnInfo newciptr; - - /* - * Close the IPv4 socket and try to open an IPv6 socket. - */ - TRANS(SocketINETClose)(ciptr); - newciptr = TRANS(SocketOpenCOTSClientBase)( - "tcp", "tcp", host, port, -1); - if (newciptr) - ciptr->fd = newciptr->fd; - if (!newciptr || - Sockettrans2devtab[newciptr->index].family != - AF_INET6) { - socketaddr = NULL; - PRMSG (4,"SocketINETConnect() Cannot get IPv6 " - "socket for IPv6 address\n", 0,0,0); - } - if (newciptr) - xfree(newciptr); - } - else - { - socketaddr = NULL; - PRMSG (4,"SocketINETConnect() Skipping IPv6 address\n", - 0,0,0); - } - } - } else { - socketaddr = NULL; /* Unsupported address type */ - } - if (socketaddr == NULL) { - addrlist->addr = addrlist->addr->ai_next; - } - } - } else -#endif - { - /* - * Build the socket name. - */ - -#ifdef BSD44SOCKETS - sockname.sin_len = sizeof (struct sockaddr_in); -#endif - sockname.sin_family = AF_INET; - - /* - * fill in sin_addr - */ - -#ifndef INADDR_NONE -#define INADDR_NONE ((in_addr_t) 0xffffffff) -#endif - - /* check for ww.xx.yy.zz host string */ - - if (isascii (host[0]) && isdigit (host[0])) { - tmpaddr = inet_addr (host); /* returns network byte order */ - } else { - tmpaddr = INADDR_NONE; - } - - PRMSG (4,"SocketINETConnect() inet_addr(%s) = %x\n", host, tmpaddr, 0); - - if (tmpaddr == INADDR_NONE) { - if ((hostp = _XGethostbyname(host,hparams)) == NULL) { - PRMSG (1,"SocketINETConnect: Can't get address for %s\n", - host, 0, 0); - ESET(EINVAL); - return TRANS_CONNECT_FAILED; - } - if (hostp->h_addrtype != AF_INET) { /* is IP host? */ - PRMSG (1,"SocketINETConnect: not INET host%s\n", host, 0, 0); - ESET(EPROTOTYPE); - return TRANS_CONNECT_FAILED; - } - -#if defined(CRAY) && defined(OLDTCP) - /* Only Cray UNICOS3 and UNICOS4 will define this */ - { - long t; - memcpy ((char *)&t, (char *) hostp->h_addr, sizeof (t)); - sockname.sin_addr = t; - } -#else - memcpy ((char *) &sockname.sin_addr, (char *) hostp->h_addr, - sizeof (sockname.sin_addr)); -#endif /* CRAY and OLDTCP */ - - } else { -#if defined(CRAY) && defined(OLDTCP) - /* Only Cray UNICOS3 and UNICOS4 will define this */ - sockname.sin_addr = tmpaddr; -#else - sockname.sin_addr.s_addr = tmpaddr; -#endif /* CRAY and OLDTCP */ - } - - /* - * fill in sin_port - */ - - /* Check for number in the port string */ - - if (!is_numeric (port)) { - if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL) { - PRMSG (1,"SocketINETConnect: can't get service for %s\n", - port, 0, 0); - return TRANS_CONNECT_FAILED; - } - sockname.sin_port = htons (servp->s_port); - } else { - tmpport = strtol (port, (char**)NULL, 10); - if (tmpport < 1024 || tmpport > USHRT_MAX) - return TRANS_CONNECT_FAILED; - sockname.sin_port = htons (((unsigned short) tmpport)); - } - - PRMSG (4,"SocketINETConnect: sockname.sin_port = %d\n", - ntohs(sockname.sin_port), 0, 0); - socketaddr = (struct sockaddr *) &sockname; - socketaddrlen = sizeof(sockname); - } - - /* - * Turn on socket keepalive so the client process will eventually - * be notified with a SIGPIPE signal if the display server fails - * to respond to a periodic transmission of messages - * on the connected socket. - * This is useful to avoid hung application processes when the - * processes are not spawned from the xdm session and - * the display server terminates abnormally. - * (Someone turned off the power switch.) - */ - - { - int tmp = 1; - setsockopt (ciptr->fd, SOL_SOCKET, SO_KEEPALIVE, - (char *) &tmp, sizeof (int)); - } - - /* - * Do the connect() - */ - - if (connect (ciptr->fd, socketaddr, socketaddrlen ) < 0) - { -#ifdef WIN32 - int olderrno = WSAGetLastError(); -#else - int olderrno = errno; -#endif - - /* - * If the error was ECONNREFUSED, the server may be overloaded - * and we should try again. - * - * If the error was EWOULDBLOCK or EINPROGRESS then the socket - * was non-blocking and we should poll using select - * - * If the error was EINTR, the connect was interrupted and we - * should try again. - * - * If multiple addresses are found for a host then we should - * try to connect again with a different address for a larger - * number of errors that made us quit before, since those - * could be caused by trying to use an IPv6 address to contact - * a machine with an IPv4-only server or other reasons that - * only affect one of a set of addresses. - */ - - if (olderrno == ECONNREFUSED || olderrno == EINTR -#if defined(IPv6) && defined(AF_INET6) - || (haveIPv6 && ((addrlist->addr->ai_next != NULL) || - (addrlist->addr != addrlist->firstaddr)) && - (olderrno == ENETUNREACH || olderrno == EAFNOSUPPORT || - olderrno == EADDRNOTAVAIL || olderrno == ETIMEDOUT -#if defined(EHOSTDOWN) - || olderrno == EHOSTDOWN -#endif - )) -#endif - ) - res = TRANS_TRY_CONNECT_AGAIN; - else if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) - res = TRANS_IN_PROGRESS; - else - { - PRMSG (2,"SocketINETConnect: Can't connect: errno = %d\n", - olderrno,0, 0); - - res = TRANS_CONNECT_FAILED; - } - } else { - res = 0; - - - /* - * Sync up the address fields of ciptr. - */ - - if (TRANS(SocketINETGetAddr) (ciptr) < 0) - { - PRMSG (1, - "SocketINETConnect: ...SocketINETGetAddr() failed:\n", - 0, 0, 0); - res = TRANS_CONNECT_FAILED; - } - - else if (TRANS(SocketINETGetPeerAddr) (ciptr) < 0) - { - PRMSG (1, - "SocketINETConnect: ...SocketINETGetPeerAddr() failed:\n", - 0, 0, 0); - res = TRANS_CONNECT_FAILED; - } - } - -#if defined(IPv6) && defined(AF_INET6) - if (haveIPv6 && res != 0) { - addrlist->addr = addrlist->addr->ai_next; - } -#endif - - return res; -} - -#endif /* TCPCONN */ - - - -#ifdef UNIXCONN - -/* - * Make sure 'host' is really local. - */ - -static int -UnixHostReallyLocal (char *host) - -{ - char hostnamebuf[256]; - -#if defined(IPv6) && defined(AF_INET6) - if (getaddrinfo == NULL) - haveIPv6 = 0; -#endif - - TRANS(GetHostname) (hostnamebuf, sizeof (hostnamebuf)); - - if (strcmp (hostnamebuf, host) == 0) - { - return (1); - } -#if defined(IPv6) && defined(AF_INET6) - else if (haveIPv6) - { - struct addrinfo *localhostaddr; - struct addrinfo *otherhostaddr; - struct addrinfo *i, *j; - int equiv = 0; - - if (getaddrinfo(hostnamebuf, NULL, NULL, &localhostaddr) != 0) - return 0; - if (getaddrinfo(host, NULL, NULL, &otherhostaddr) != 0) { - freeaddrinfo(localhostaddr); - return 0; - } - - for (i = localhostaddr; i != NULL && equiv == 0; i = i->ai_next) { - for (j = otherhostaddr; j != NULL && equiv == 0; j = j->ai_next) { - if (i->ai_family == j->ai_family) { - if (i->ai_family == AF_INET) { - struct sockaddr_in *sinA - = (struct sockaddr_in *) i->ai_addr; - struct sockaddr_in *sinB - = (struct sockaddr_in *) j->ai_addr; - struct in_addr *A = &sinA->sin_addr; - struct in_addr *B = &sinB->sin_addr; - - if (memcmp(A,B,sizeof(struct in_addr)) == 0) { - equiv = 1; - } - } else if (i->ai_family == AF_INET6) { - struct sockaddr_in6 *sinA - = (struct sockaddr_in6 *) i->ai_addr; - struct sockaddr_in6 *sinB - = (struct sockaddr_in6 *) j->ai_addr; - struct in6_addr *A = &sinA->sin6_addr; - struct in6_addr *B = &sinB->sin6_addr; - - if (memcmp(A,B,sizeof(struct in6_addr)) == 0) { - equiv = 1; - } - } - } - } - } - - freeaddrinfo(localhostaddr); - freeaddrinfo(otherhostaddr); - return equiv; - } -#endif - else - { - /* - * A host may have more than one network address. If any of the - * network addresses of 'host' (specified to the connect call) - * match any of the network addresses of 'hostname' (determined - * by TRANS(GetHostname)), then the two hostnames are equivalent, - * and we know that 'host' is really a local host. - */ - char specified_local_addr_list[10][4]; - int scount, equiv, i, j; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgethostbynameparams hparams; -#endif - struct hostent *hostp; - - if ((hostp = _XGethostbyname (host,hparams)) == NULL) - return (0); - - scount = 0; - while (hostp->h_addr_list[scount] && scount <= 8) - { - /* - * The 2nd call to gethostname() overrides the data - * from the 1st call, so we must save the address list. - */ - - specified_local_addr_list[scount][0] = - hostp->h_addr_list[scount][0]; - specified_local_addr_list[scount][1] = - hostp->h_addr_list[scount][1]; - specified_local_addr_list[scount][2] = - hostp->h_addr_list[scount][2]; - specified_local_addr_list[scount][3] = - hostp->h_addr_list[scount][3]; - scount++; - } - if ((hostp = _XGethostbyname (hostnamebuf,hparams)) == NULL) - return (0); - - equiv = 0; - i = 0; - - while (i < scount && !equiv) - { - j = 0; - - while (hostp->h_addr_list[j]) - { - if ((specified_local_addr_list[i][0] == - hostp->h_addr_list[j][0]) && - (specified_local_addr_list[i][1] == - hostp->h_addr_list[j][1]) && - (specified_local_addr_list[i][2] == - hostp->h_addr_list[j][2]) && - (specified_local_addr_list[i][3] == - hostp->h_addr_list[j][3])) - { - /* They're equal, so we're done */ - - equiv = 1; - break; - } - - j++; - } - - i++; - } - return (equiv); - } -} - -static int -TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port) - -{ - struct sockaddr_un sockname; - int namelen; - -#if defined(hpux) && defined(X11_t) - struct sockaddr_un old_sockname; - int old_namelen; -#endif - - - PRMSG (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port); - - /* - * Make sure 'host' is really local. If not, we return failure. - * The reason we make this check is because a process may advertise - * a "local" network ID for which it can accept connections, but if - * a process on a remote machine tries to connect to this network ID, - * we know for sure it will fail. - */ - - if (strcmp (host, "unix") != 0 && !UnixHostReallyLocal (host)) - { - PRMSG (1, - "SocketUNIXConnect: Cannot connect to non-local host %s\n", - host, 0, 0); - return TRANS_CONNECT_FAILED; - } - - - /* - * Check the port. - */ - - if (!port || !*port) - { - PRMSG (1,"SocketUNIXConnect: Missing port specification\n", - 0, 0, 0); - return TRANS_CONNECT_FAILED; - } - - /* - * Build the socket name. - */ - - sockname.sun_family = AF_UNIX; - - if (set_sun_path(port, UNIX_PATH, sockname.sun_path) != 0) { - PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0); - return TRANS_CONNECT_FAILED; - } - -#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx) - sockname.sun_len = strlen (sockname.sun_path); - namelen = SUN_LEN (&sockname); -#else - namelen = strlen (sockname.sun_path) + sizeof (sockname.sun_family); -#endif - - -#if defined(hpux) && defined(X11_t) - /* - * This is gross, but it was in Xlib - */ - old_sockname.sun_family = AF_UNIX; - if (set_sun_path(port, OLD_UNIX_PATH, old_sockname.sun_path) != 0) { - PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0); - return TRANS_CONNECT_FAILED; - } - old_namelen = strlen (old_sockname.sun_path) + - sizeof (old_sockname.sun_family); -#endif - - - /* - * Do the connect() - */ - - if (connect (ciptr->fd, (struct sockaddr *) &sockname, namelen) < 0) - { - int olderrno = errno; - int connected = 0; - -#if defined(hpux) && defined(X11_t) - if (olderrno == ENOENT) - { - if (connect (ciptr->fd, - (struct sockaddr *) &old_sockname, old_namelen) >= 0) - { - connected = 1; - } - else - olderrno = errno; - } -#endif - if (!connected) - { - errno = olderrno; - - /* - * If the error was ENOENT, the server may be starting up - * and we should try again. - * - * If the error was EWOULDBLOCK or EINPROGRESS then the socket - * was non-blocking and we should poll using select - * - * If the error was EINTR, the connect was interrupted and we - * should try again. - */ - - if (olderrno == ENOENT || olderrno == EINTR) - return TRANS_TRY_CONNECT_AGAIN; - else if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) - return TRANS_IN_PROGRESS; - else - { - PRMSG (2,"SocketUNIXConnect: Can't connect: errno = %d\n", - EGET(),0, 0); - - return TRANS_CONNECT_FAILED; - } - } - } - - /* - * Get the socket name and the peer name from the connect socket, - * since this is unix domain. - */ - - if ((ciptr->addr = (char *) xalloc(namelen)) == NULL || - (ciptr->peeraddr = (char *) xalloc(namelen)) == NULL) - { - PRMSG (1, - "SocketUNIXCreateListener: Can't allocate space for the addr\n", - 0, 0, 0); - return TRANS_CONNECT_FAILED; - } - - ciptr->family = AF_UNIX; - ciptr->addrlen = namelen; - ciptr->peeraddrlen = namelen; - memcpy (ciptr->addr, &sockname, ciptr->addrlen); - memcpy (ciptr->peeraddr, &sockname, ciptr->peeraddrlen); - - return 0; -} - -#endif /* UNIXCONN */ - -#endif /* TRANS_CLIENT */ - - -static int -TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend) - -{ - PRMSG (2,"SocketBytesReadable(%p,%d,%p)\n", - ciptr, ciptr->fd, pend); -#if defined(QNX4) - *pend = 0L; /* FIONREAD only returns a short. Zero out upper bits */ -#endif -#ifdef WIN32 - { - int ret = ioctlsocket ((SOCKET) ciptr->fd, FIONREAD, (u_long *) pend); - errno = WSAGetLastError(); - return ret; - } -#else -#if (defined(i386) && defined(SYSV) && !defined(SCO325)) || (defined(_SEQUENT_) && _SOCKET_VERSION == 1) - return ioctl (ciptr->fd, I_NREAD, (char *) pend); -#else -#if defined(__UNIXOS2__) - return ioctl (ciptr->fd, FIONREAD, (char*) pend, sizeof(int)); -#else - return ioctl (ciptr->fd, FIONREAD, (char *) pend); -#endif /* __UNIXOS2__ */ -#endif /* i386 && SYSV || _SEQUENT_ && _SOCKET_VERSION == 1 */ -#endif /* WIN32 */ -} - - -static int -TRANS(SocketRead) (XtransConnInfo ciptr, char *buf, int size) - -{ - PRMSG (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size); - -#if defined(WIN32) || defined(__UNIXOS2__) - { - int ret = recv ((SOCKET)ciptr->fd, buf, size, 0); -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - return ret; - } -#else - return read (ciptr->fd, buf, size); -#endif /* WIN32 */ -} - - -static int -TRANS(SocketWrite) (XtransConnInfo ciptr, char *buf, int size) - -{ - PRMSG (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size); - -#if defined(WIN32) || defined(__UNIXOS2__) - { - int ret = send ((SOCKET)ciptr->fd, buf, size, 0); -#ifdef WIN32 - errno = WSAGetLastError(); -#endif - return ret; - } -#else - return write (ciptr->fd, buf, size); -#endif /* WIN32 */ -} - - -static int -TRANS(SocketReadv) (XtransConnInfo ciptr, struct iovec *buf, int size) - -{ - PRMSG (2,"SocketReadv(%d,%p,%d)\n", ciptr->fd, buf, size); - - return READV (ciptr, buf, size); -} - - -static int -TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size) - -{ - PRMSG (2,"SocketWritev(%d,%p,%d)\n", ciptr->fd, buf, size); - - return WRITEV (ciptr, buf, size); -} - - -static int -TRANS(SocketDisconnect) (XtransConnInfo ciptr) - -{ - PRMSG (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd, 0); - -#ifdef WIN32 - { - int ret = shutdown (ciptr->fd, 2); - errno = WSAGetLastError(); - return ret; - } -#else - return shutdown (ciptr->fd, 2); /* disallow further sends and receives */ -#endif -} - - -#ifdef TCPCONN -static int -TRANS(SocketINETClose) (XtransConnInfo ciptr) - -{ - PRMSG (2,"SocketINETClose(%p,%d)\n", ciptr, ciptr->fd, 0); - -#ifdef WIN32 - { - int ret = close (ciptr->fd); - errno = WSAGetLastError(); - return ret; - } -#else - return close (ciptr->fd); -#endif -} - -#endif /* TCPCONN */ - - -#ifdef UNIXCONN -static int -TRANS(SocketUNIXClose) (XtransConnInfo ciptr) - -{ - /* - * If this is the server side, then once the socket is closed, - * it must be unlinked to completely close it - */ - - struct sockaddr_un *sockname = (struct sockaddr_un *) ciptr->addr; - int ret; - - PRMSG (2,"SocketUNIXClose(%p,%d)\n", ciptr, ciptr->fd, 0); - - ret = close(ciptr->fd); - - if (ciptr->flags - && sockname - && sockname->sun_family == AF_UNIX - && sockname->sun_path[0]) - { - if (!(ciptr->flags & TRANS_NOUNLINK)) - unlink (sockname->sun_path); - } - - return ret; -} - -static int -TRANS(SocketUNIXCloseForCloning) (XtransConnInfo ciptr) - -{ - /* - * Don't unlink path. - */ - - int ret; - - PRMSG (2,"SocketUNIXCloseForCloning(%p,%d)\n", - ciptr, ciptr->fd, 0); - - ret = close(ciptr->fd); - - return ret; -} - -#endif /* UNIXCONN */ - - -#ifdef TCPCONN -# ifdef TRANS_SERVER -static char* tcp_nolisten[] = { - "inet", -#if defined(IPv6) && defined(AF_INET6) - "inet6", -#endif - NULL -}; -# endif - -Xtransport TRANS(SocketTCPFuncs) = { - /* Socket Interface */ - "tcp", - TRANS_ALIAS, -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - tcp_nolisten, - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketINETCreateListener), - NULL, /* ResetListener */ - TRANS(SocketINETAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketINETConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketINETClose), - TRANS(SocketINETClose), - }; - -Xtransport TRANS(SocketINETFuncs) = { - /* Socket Interface */ - "inet", - 0, -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketINETCreateListener), - NULL, /* ResetListener */ - TRANS(SocketINETAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketINETConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketINETClose), - TRANS(SocketINETClose), - }; - -#if defined(IPv6) && defined(AF_INET6) -Xtransport TRANS(SocketINET6Funcs) = { - /* Socket Interface */ - "inet6", - 0, -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketINETCreateListener), - NULL, /* ResetListener */ - TRANS(SocketINETAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketINETConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketINETClose), - TRANS(SocketINETClose), - }; -#endif /* IPv6 */ -#endif /* TCPCONN */ - -#ifdef UNIXCONN -#if !defined(LOCALCONN) -Xtransport TRANS(SocketLocalFuncs) = { - /* Socket Interface */ - "local", - 0, -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketUNIXCreateListener), - TRANS(SocketUNIXResetListener), - TRANS(SocketUNIXAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketUNIXConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketUNIXClose), - TRANS(SocketUNIXCloseForCloning), - }; -#endif /* !LOCALCONN */ -# ifdef TRANS_SERVER -# if !defined(LOCALCONN) -static char* unix_nolisten[] = { "local" , NULL }; -# endif -# endif - -Xtransport TRANS(SocketUNIXFuncs) = { - /* Socket Interface */ - "unix", -#if !defined(LOCALCONN) - TRANS_ALIAS, -#else - 0, -#endif -#ifdef TRANS_CLIENT - TRANS(SocketOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER -#if !defined(LOCALCONN) - unix_nolisten, -#else - NULL, -#endif - TRANS(SocketOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(SocketOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(SocketReopenCOTSServer), - TRANS(SocketReopenCLTSServer), -#endif - TRANS(SocketSetOption), -#ifdef TRANS_SERVER - TRANS(SocketUNIXCreateListener), - TRANS(SocketUNIXResetListener), - TRANS(SocketUNIXAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(SocketUNIXConnect), -#endif /* TRANS_CLIENT */ - TRANS(SocketBytesReadable), - TRANS(SocketRead), - TRANS(SocketWrite), - TRANS(SocketReadv), - TRANS(SocketWritev), - TRANS(SocketDisconnect), - TRANS(SocketUNIXClose), - TRANS(SocketUNIXCloseForCloning), - }; - -#endif /* UNIXCONN */ diff --git a/nx-X11/programs/Imakefile.NX.original b/nx-X11/programs/Imakefile.NX.original deleted file mode 100644 index 9480baf6e..000000000 --- a/nx-X11/programs/Imakefile.NX.original +++ /dev/null @@ -1,178 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.4 2000/08/17 19:47:01 cpqbld Exp $ - - - -XCOMM $XFree86: xc/programs/Imakefile,v 3.54 2003/04/14 20:37:16 herrb Exp $ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -#if BuildServer || UseRgbTxt - RGBSRCDIR = rgb -#endif -#if BuildServer - XSSRCDIR = Xserver -#endif -#if BuildXkbcomp - XKBCOMPDIR = xkbcomp -#endif -#ifndef Win32Architecture -#if HasXServer - XINITSRCDIR = xinit -#endif -#if BuildFontServer - XFSSRCDIR = xfs -#endif -#if BuildXKBlib - XKBSRCDIRS = setxkbmap $(XKBCOMPDIR) xkbevd xkbprint xkbutils -#endif -#if BuildScreenSaverLibrary -SCREENSAVESRCDIR = beforelight -#endif -#if BuildXF86VidModeLibrary - XVIDTUNESRCDIR = xvidtune -#endif -#if BuildXF86DGALibrary - XF86DGASRCDIR = xf86dga -#endif -#if BuildXAServer - XASSRCDIR = Xaserver -#endif -#if BuildLBX - LBXPROXYSRCDIR = lbxproxy -#endif -#if BuildXprintClients - XPSRCDIRS = xplsprinters xprehashprinterlist xphelloworld xpr -#endif - PROXYMGRSRCDIR = proxymngr - RSTARTSRCDIR = rstart - SMPROXYSRCDIR = smproxy - TWMSRCDIR = twm - XCONSOLESRCDIR = xconsole - XDMSRCDIR = xdm -XFINDPROXYSRCDIR = xfindproxy - XFWPSRCDIR = xfwp -#if BuildXF86VidModeLibrary - XGAMMASRCDIR = xgamma -#endif -#if BuildXvLibrary - XVINFOSRCDIR = xvinfo -#endif - XHOSTSRCDIR = xhost -#if BuildPlugin && BuildXaw - XRXSRCDIR = xrx -#endif - XSMSRCDIR = xsm -#if BuildXterm - XTERMSRCDIR = xterm -#endif - SCRIPTSDIR = scripts -#endif /* Win32Architecture */ -#if BuildCID - MKCFMSRCDIR = mkcfm -#endif - -#if (HasFreetype2 || BuildFreetype2Library) && BuildFontEncLib - MKFONTSCALEDIR = mkfontscale -#endif - -#if BuildXInputLib -XINPUTCLIENTDIRS = xsetmode xsetpointer -#endif - -#if BuildXTrapLibrary -XTRAPCLIENTDIRS = xtrap -#endif - -/* makepsres should be considered as part of the DPS libraries */ -#if BuildDPSLibraries - MAKEPSRESDIR = makepsres -#endif - -/* on the other hand, the following are independent clients */ -#if BuildDPSClients - DPSCLIENTDIRS = dpsinfo dpsexec texteroids -#endif -#if BuildDBElib && BuildXprintClients - DBECLIENTDIRS = xdbedizzy -#endif - - XPMCLIENTDIRS = cxpm sxpm - -#if BuildGLXLibrary - GLXCLIENTDIRS = glxinfo glxgears -#endif - - XLOADDIR = xload - -#if BuildRandRLibrary - XRANDRDIR = xrandr -#endif - -#if BuildXcursorgen - XCURSORGENDIR = xcursorgen -#endif - -#if BuildFontconfigLibrary - FCDIRS = fc-cache fc-list -#endif -#if 0 - FCLANGDIR = fc-lang -#endif - -#if BuildXDriInfo - XDRIINFO = xdriinfo -#endif - -#if BuildXaw - XMORE = xmore -#endif - -#if BuildServersOnly || !BuildClients -#if defined(NXEmbeddedXServer) -SUBDIRS = $(XSSRCDIR) -#else -SUBDIRS = $(XSSRCDIR) nxauth -#endif -#else -SUBDIRS = \ - appres bdftopcf bitmap \ - $(SCREENSAVESRCDIR) editres $(FCDIRS) $(FCLANGDIR) fslsfonts fstobdf \ - iceauth ico listres luit \ - $(MAKEPSRESDIR) $(DPSCLIENTDIRS) $(DBECLIENTDIRS) \ - $(MKCFMSRCDIR) \ - mkfontdir $(MKFONTSCALEDIR) oclock $(PROXYMGRSRCDIR) \ - $(RGBSRCDIR) $(RSTARTSRCDIR) showfont \ - $(SMPROXYSRCDIR) $(TWMSRCDIR) viewres x11perf xauth xbiff xcalc \ - xclipboard xclock \ - xcmsdb $(XCONSOLESRCDIR) xditview $(XDMSRCDIR) xdpyinfo \ - $(XF86DGASRCDIR) xedit xev xeyes xfd xfontsel $(XFSSRCDIR) xfsinfo \ - $(XFINDPROXYSRCDIR) $(XFWPSRCDIR) $(XGAMMASRCDIR) xgc $(XHOSTSRCDIR) \ - $(XINITSRCDIR) $(XKBSRCDIRS) xkill $(XLOADDIR) xlogo xlsatoms \ - xlsclients xlsfonts xmag xman xmessage xmh xmodmap $(XMORE) xprop \ - xrdb xrefresh $(XRXSRCDIR) xset \ - xsetroot $(XSMSRCDIR) xstdcmap $(XINPUTCLIENTDIRS) \ - $(XTERMSRCDIR) $(XTRAPCLIENTDIRS) $(XVIDTUNESRCDIR) xwd xwininfo xwud \ - $(XPMCLIENTDIRS) $(XVINFOSRCDIR) \ - $(XSSRCDIR) $(XASSRCDIR) $(LBXPROXYSRCDIR) $(XPSRCDIRS) $(SCRIPTSDIR) \ - $(GLXCLIENTDIRS) $(XRANDRDIR) $(XCURSORGENDIR) $(XDRIINFO) -#endif - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Imakefile.X.original b/nx-X11/programs/Imakefile.X.original deleted file mode 100644 index 9078f73f5..000000000 --- a/nx-X11/programs/Imakefile.X.original +++ /dev/null @@ -1,158 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.4 2000/08/17 19:47:01 cpqbld Exp $ - - - -XCOMM $XFree86: xc/programs/Imakefile,v 3.54 2003/04/14 20:37:16 herrb Exp $ - -#define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" - -#if BuildServer || UseRgbTxt - RGBSRCDIR = rgb -#endif -#if BuildServer - XSSRCDIR = Xserver -#endif -#if BuildXkbcomp - XKBCOMPDIR = xkbcomp -#endif -#ifndef Win32Architecture -#if HasXServer - XINITSRCDIR = xinit -#endif -#if BuildFontServer - XFSSRCDIR = xfs -#endif -#if BuildXKBlib - XKBSRCDIRS = setxkbmap $(XKBCOMPDIR) xkbevd xkbprint xkbutils -#endif -#if BuildScreenSaverLibrary -SCREENSAVESRCDIR = beforelight -#endif -#if BuildXF86VidModeLibrary - XVIDTUNESRCDIR = xvidtune -#endif -#if BuildXF86DGALibrary - XF86DGASRCDIR = xf86dga -#endif -#if BuildXAServer - XASSRCDIR = Xaserver -#endif -#if BuildLBX - LBXPROXYSRCDIR = lbxproxy -#endif -#if BuildXprintClients - XPSRCDIRS = xplsprinters xprehashprinterlist xphelloworld xpr -#endif - PROXYMGRSRCDIR = proxymngr - RSTARTSRCDIR = rstart - SMPROXYSRCDIR = smproxy - TWMSRCDIR = twm - XCONSOLESRCDIR = xconsole - XDMSRCDIR = xdm -XFINDPROXYSRCDIR = xfindproxy - XFWPSRCDIR = xfwp -#if BuildXF86VidModeLibrary - XGAMMASRCDIR = xgamma -#endif -#if BuildXvLibrary - XVINFOSRCDIR = xvinfo -#endif - XHOSTSRCDIR = xhost -#if BuildPlugin && BuildXaw - XRXSRCDIR = xrx -#endif - XSMSRCDIR = xsm -#if BuildXterm - XTERMSRCDIR = xterm -#endif - SCRIPTSDIR = scripts -#endif /* Win32Architecture */ -#if BuildCID - MKCFMSRCDIR = mkcfm -#endif - -#if (HasFreetype2 || BuildFreetype2Library) && BuildFontEncLib - MKFONTSCALEDIR = mkfontscale -#endif - -#if BuildXInputLib -XINPUTCLIENTDIRS = xsetmode xsetpointer -#endif - -#if BuildXTrapLibrary -XTRAPCLIENTDIRS = xtrap -#endif - -/* makepsres should be considered as part of the DPS libraries */ -#if BuildDPSLibraries - MAKEPSRESDIR = makepsres -#endif - -/* on the other hand, the following are independent clients */ -#if BuildDPSClients - DPSCLIENTDIRS = dpsinfo dpsexec texteroids -#endif -#if BuildDBElib && BuildXprintClients - DBECLIENTDIRS = xdbedizzy -#endif - - XPMCLIENTDIRS = cxpm sxpm - -#if BuildGLXLibrary - GLXCLIENTDIRS = glxinfo glxgears -#endif - - XLOADDIR = xload - -#if BuildRandRLibrary - XRANDRDIR = xrandr -#endif - -#if BuildXcursorgen - XCURSORGENDIR = xcursorgen -#endif - -#if BuildFontconfigLibrary - FCDIRS = fc-cache fc-list -#endif -#if 0 - FCLANGDIR = fc-lang -#endif - -#if BuildXDriInfo - XDRIINFO = xdriinfo -#endif - -#if BuildXaw - XMORE = xmore -#endif - -#if BuildServersOnly || !BuildClients -SUBDIRS = $(XSSRCDIR) $(XKBCOMPDIR) -#else -SUBDIRS = \ - appres bdftopcf bitmap \ - $(SCREENSAVESRCDIR) editres $(FCDIRS) $(FCLANGDIR) fslsfonts fstobdf \ - iceauth ico listres luit \ - $(MAKEPSRESDIR) $(DPSCLIENTDIRS) $(DBECLIENTDIRS) \ - $(MKCFMSRCDIR) \ - mkfontdir $(MKFONTSCALEDIR) oclock $(PROXYMGRSRCDIR) \ - $(RGBSRCDIR) $(RSTARTSRCDIR) showfont \ - $(SMPROXYSRCDIR) $(TWMSRCDIR) viewres x11perf xauth xbiff xcalc \ - xclipboard xclock \ - xcmsdb $(XCONSOLESRCDIR) xditview $(XDMSRCDIR) xdpyinfo \ - $(XF86DGASRCDIR) xedit xev xeyes xfd xfontsel $(XFSSRCDIR) xfsinfo \ - $(XFINDPROXYSRCDIR) $(XFWPSRCDIR) $(XGAMMASRCDIR) xgc $(XHOSTSRCDIR) \ - $(XINITSRCDIR) $(XKBSRCDIRS) xkill $(XLOADDIR) xlogo xlsatoms \ - xlsclients xlsfonts xmag xman xmessage xmh xmodmap $(XMORE) xprop \ - xrdb xrefresh $(XRXSRCDIR) xset \ - xsetroot $(XSMSRCDIR) xstdcmap $(XINPUTCLIENTDIRS) \ - $(XTERMSRCDIR) $(XTRAPCLIENTDIRS) $(XVIDTUNESRCDIR) xwd xwininfo xwud \ - $(XPMCLIENTDIRS) $(XVINFOSRCDIR) \ - $(XSSRCDIR) $(XASSRCDIR) $(LBXPROXYSRCDIR) $(XPSRCDIRS) $(SCRIPTSDIR) \ - $(GLXCLIENTDIRS) $(XRANDRDIR) $(XCURSORGENDIR) $(XDRIINFO) -#endif - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/GL/glx/render2.c.NX.original b/nx-X11/programs/Xserver/GL/glx/render2.c.NX.original deleted file mode 100644 index f4491b276..000000000 --- a/nx-X11/programs/Xserver/GL/glx/render2.c.NX.original +++ /dev/null @@ -1,271 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.8 2004/02/03 23:04:08 alanh Exp $ */ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ - -/* #define NEED_REPLIES */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "unpack.h" -#include "g_disptab.h" -#include "g_disptab_EXT.h" -#include "indirect_size.h" - -void __glXDisp_Map1f(GLbyte *pc) -{ - GLint order, k; - GLfloat u1, u2, *points; - GLenum target; - - target = *(GLenum *)(pc + 0); - order = *(GLint *)(pc + 12); - u1 = *(GLfloat *)(pc + 4); - u2 = *(GLfloat *)(pc + 8); - points = (GLfloat *)(pc + 16); - k = __glMap1f_size(target); - - glMap1f(target, u1, u2, k, order, points); -} - -void __glXDisp_Map2f(GLbyte *pc) -{ - GLint uorder, vorder, ustride, vstride, k; - GLfloat u1, u2, v1, v2, *points; - GLenum target; - - target = *(GLenum *)(pc + 0); - uorder = *(GLint *)(pc + 12); - vorder = *(GLint *)(pc + 24); - u1 = *(GLfloat *)(pc + 4); - u2 = *(GLfloat *)(pc + 8); - v1 = *(GLfloat *)(pc + 16); - v2 = *(GLfloat *)(pc + 20); - points = (GLfloat *)(pc + 28); - - k = __glMap2f_size(target); - ustride = vorder * k; - vstride = k; - - glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -void __glXDisp_Map1d(GLbyte *pc) -{ - GLint order, k; -#ifdef __GLX_ALIGN64 - GLint compsize; -#endif - GLenum target; - GLdouble u1, u2, *points; - - target = *(GLenum*) (pc + 16); - order = *(GLint*) (pc + 20); - k = __glMap1d_size(target); - -#ifdef __GLX_ALIGN64 - if (order < 0 || k < 0) { - compsize = 0; - } else { - compsize = order * k; - } -#endif - - __GLX_GET_DOUBLE(u1,pc); - __GLX_GET_DOUBLE(u2,pc+8); - pc += 24; - -#ifdef __GLX_ALIGN64 - if (((unsigned long)pc) & 7) { - /* - ** Copy the doubles up 4 bytes, trashing the command but aligning - ** the data in the process - */ - __GLX_MEM_COPY(pc-4, pc, compsize*8); - points = (GLdouble*) (pc - 4); - } else { - points = (GLdouble*) pc; - } -#else - points = (GLdouble*) pc; -#endif - glMap1d(target, u1, u2, k, order, points); -} - -void __glXDisp_Map2d(GLbyte *pc) -{ - GLdouble u1, u2, v1, v2, *points; - GLint uorder, vorder, ustride, vstride, k; -#ifdef __GLX_ALIGN64 - GLint compsize; -#endif - GLenum target; - - target = *(GLenum *)(pc + 32); - uorder = *(GLint *)(pc + 36); - vorder = *(GLint *)(pc + 40); - k = __glMap2d_size(target); - -#ifdef __GLX_ALIGN64 - if (vorder < 0 || uorder < 0 || k < 0) { - compsize = 0; - } else { - compsize = uorder * vorder * k; - } -#endif - - __GLX_GET_DOUBLE(u1,pc); - __GLX_GET_DOUBLE(u2,pc+8); - __GLX_GET_DOUBLE(v1,pc+16); - __GLX_GET_DOUBLE(v2,pc+24); - pc += 44; - - ustride = vorder * k; - vstride = k; - -#ifdef __GLX_ALIGN64 - if (((unsigned long)pc) & 7) { - /* - ** Copy the doubles up 4 bytes, trashing the command but aligning - ** the data in the process - */ - __GLX_MEM_COPY(pc-4, pc, compsize*8); - points = (GLdouble*) (pc - 4); - } else { - points = (GLdouble*) pc; - } -#else - points = (GLdouble*) pc; -#endif - glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -void __glXDisp_CallLists(GLbyte *pc) -{ - GLenum type; - GLsizei n; - - type = *(GLenum *)(pc + 4); - n = *(GLsizei *)(pc + 0); - glCallLists(n, type, pc + 8); -} - -void __glXDisp_DrawArrays(GLbyte *pc) -{ - __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc; - __GLXdispatchDrawArraysComponentHeader *compHeader; - GLint numVertexes = hdr->numVertexes; - GLint numComponents = hdr->numComponents; - GLenum primType = hdr->primType; - GLint stride = 0; - int i; - - pc += sizeof(__GLXdispatchDrawArraysHeader); - compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc; - - /* compute stride (same for all component arrays) */ - for (i = 0; i < numComponents; i++) { - GLenum datatype = compHeader[i].datatype; - GLint numVals = compHeader[i].numVals; - - stride += __GLX_PAD(numVals * __glXTypeSize(datatype)); - } - - pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader); - - /* set up component arrays */ - for (i = 0; i < numComponents; i++) { - GLenum datatype = compHeader[i].datatype; - GLint numVals = compHeader[i].numVals; - GLenum component = compHeader[i].component; - - switch (component) { - case GL_VERTEX_ARRAY: - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(numVals, datatype, stride, pc); - break; - case GL_NORMAL_ARRAY: - glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(datatype, stride, pc); - break; - case GL_COLOR_ARRAY: - glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(numVals, datatype, stride, pc); - break; - case GL_INDEX_ARRAY: - glEnableClientState(GL_INDEX_ARRAY); - glIndexPointer(datatype, stride, pc); - break; - case GL_TEXTURE_COORD_ARRAY: - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(numVals, datatype, stride, pc); - break; - case GL_EDGE_FLAG_ARRAY: - glEnableClientState(GL_EDGE_FLAG_ARRAY); - glEdgeFlagPointer(stride, (const GLboolean *)pc); - break; - case GL_SECONDARY_COLOR_ARRAY: - glEnableClientState(GL_SECONDARY_COLOR_ARRAY); - glSecondaryColorPointer(numVals, datatype, stride, pc); - break; - case GL_FOG_COORD_ARRAY: - glEnableClientState(GL_FOG_COORD_ARRAY); - glFogCoordPointer(datatype, stride, pc); - break; - default: - break; - } - - pc += __GLX_PAD(numVals * __glXTypeSize(datatype)); - } - - glDrawArrays(primType, 0, numVertexes); - - /* turn off anything we might have turned on */ - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - glDisableClientState(GL_INDEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_EDGE_FLAG_ARRAY); - glDisableClientState(GL_SECONDARY_COLOR_ARRAY); - glDisableClientState(GL_FOG_COORD_ARRAY); -} - -void __glXDisp_DrawArraysEXT(GLbyte *pc) -{ - __glXDisp_DrawArrays(pc); -} diff --git a/nx-X11/programs/Xserver/GL/glx/render2.c.X.original b/nx-X11/programs/Xserver/GL/glx/render2.c.X.original deleted file mode 100644 index 39d0c132a..000000000 --- a/nx-X11/programs/Xserver/GL/glx/render2.c.X.original +++ /dev/null @@ -1,271 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.8 2004/02/03 23:04:08 alanh Exp $ */ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ - -/* #define NEED_REPLIES */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "unpack.h" -#include "g_disptab.h" -#include "g_disptab_EXT.h" - - -void __glXDisp_Map1f(GLbyte *pc) -{ - GLint order, k; - GLfloat u1, u2, *points; - GLenum target; - - target = *(GLenum *)(pc + 0); - order = *(GLint *)(pc + 12); - u1 = *(GLfloat *)(pc + 4); - u2 = *(GLfloat *)(pc + 8); - points = (GLfloat *)(pc + 16); - k = __glMap1f_size(target); - - glMap1f(target, u1, u2, k, order, points); -} - -void __glXDisp_Map2f(GLbyte *pc) -{ - GLint uorder, vorder, ustride, vstride, k; - GLfloat u1, u2, v1, v2, *points; - GLenum target; - - target = *(GLenum *)(pc + 0); - uorder = *(GLint *)(pc + 12); - vorder = *(GLint *)(pc + 24); - u1 = *(GLfloat *)(pc + 4); - u2 = *(GLfloat *)(pc + 8); - v1 = *(GLfloat *)(pc + 16); - v2 = *(GLfloat *)(pc + 20); - points = (GLfloat *)(pc + 28); - - k = __glMap2f_size(target); - ustride = vorder * k; - vstride = k; - - glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -void __glXDisp_Map1d(GLbyte *pc) -{ - GLint order, k; -#ifdef __GLX_ALIGN64 - GLint compsize; -#endif - GLenum target; - GLdouble u1, u2, *points; - - target = *(GLenum*) (pc + 16); - order = *(GLint*) (pc + 20); - k = __glMap1d_size(target); - -#ifdef __GLX_ALIGN64 - if (order < 0 || k < 0) { - compsize = 0; - } else { - compsize = order * k; - } -#endif - - __GLX_GET_DOUBLE(u1,pc); - __GLX_GET_DOUBLE(u2,pc+8); - pc += 24; - -#ifdef __GLX_ALIGN64 - if (((unsigned long)pc) & 7) { - /* - ** Copy the doubles up 4 bytes, trashing the command but aligning - ** the data in the process - */ - __GLX_MEM_COPY(pc-4, pc, compsize*8); - points = (GLdouble*) (pc - 4); - } else { - points = (GLdouble*) pc; - } -#else - points = (GLdouble*) pc; -#endif - glMap1d(target, u1, u2, k, order, points); -} - -void __glXDisp_Map2d(GLbyte *pc) -{ - GLdouble u1, u2, v1, v2, *points; - GLint uorder, vorder, ustride, vstride, k; -#ifdef __GLX_ALIGN64 - GLint compsize; -#endif - GLenum target; - - target = *(GLenum *)(pc + 32); - uorder = *(GLint *)(pc + 36); - vorder = *(GLint *)(pc + 40); - k = __glMap2d_size(target); - -#ifdef __GLX_ALIGN64 - if (vorder < 0 || uorder < 0 || k < 0) { - compsize = 0; - } else { - compsize = uorder * vorder * k; - } -#endif - - __GLX_GET_DOUBLE(u1,pc); - __GLX_GET_DOUBLE(u2,pc+8); - __GLX_GET_DOUBLE(v1,pc+16); - __GLX_GET_DOUBLE(v2,pc+24); - pc += 44; - - ustride = vorder * k; - vstride = k; - -#ifdef __GLX_ALIGN64 - if (((unsigned long)pc) & 7) { - /* - ** Copy the doubles up 4 bytes, trashing the command but aligning - ** the data in the process - */ - __GLX_MEM_COPY(pc-4, pc, compsize*8); - points = (GLdouble*) (pc - 4); - } else { - points = (GLdouble*) pc; - } -#else - points = (GLdouble*) pc; -#endif - glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -void __glXDisp_CallLists(GLbyte *pc) -{ - GLenum type; - GLsizei n; - - type = *(GLenum *)(pc + 4); - n = *(GLsizei *)(pc + 0); - glCallLists(n, type, pc + 8); -} - -void __glXDisp_DrawArrays(GLbyte *pc) -{ - __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc; - __GLXdispatchDrawArraysComponentHeader *compHeader; - GLint numVertexes = hdr->numVertexes; - GLint numComponents = hdr->numComponents; - GLenum primType = hdr->primType; - GLint stride = 0; - int i; - - pc += sizeof(__GLXdispatchDrawArraysHeader); - compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc; - - /* compute stride (same for all component arrays) */ - for (i = 0; i < numComponents; i++) { - GLenum datatype = compHeader[i].datatype; - GLint numVals = compHeader[i].numVals; - - stride += __GLX_PAD(numVals * __glXTypeSize(datatype)); - } - - pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader); - - /* set up component arrays */ - for (i = 0; i < numComponents; i++) { - GLenum datatype = compHeader[i].datatype; - GLint numVals = compHeader[i].numVals; - GLenum component = compHeader[i].component; - - switch (component) { - case GL_VERTEX_ARRAY: - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(numVals, datatype, stride, pc); - break; - case GL_NORMAL_ARRAY: - glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(datatype, stride, pc); - break; - case GL_COLOR_ARRAY: - glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(numVals, datatype, stride, pc); - break; - case GL_INDEX_ARRAY: - glEnableClientState(GL_INDEX_ARRAY); - glIndexPointer(datatype, stride, pc); - break; - case GL_TEXTURE_COORD_ARRAY: - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(numVals, datatype, stride, pc); - break; - case GL_EDGE_FLAG_ARRAY: - glEnableClientState(GL_EDGE_FLAG_ARRAY); - glEdgeFlagPointer(stride, (const GLboolean *)pc); - break; - case GL_SECONDARY_COLOR_ARRAY: - glEnableClientState(GL_SECONDARY_COLOR_ARRAY); - glSecondaryColorPointer(numVals, datatype, stride, pc); - break; - case GL_FOG_COORD_ARRAY: - glEnableClientState(GL_FOG_COORD_ARRAY); - glFogCoordPointer(datatype, stride, pc); - break; - default: - break; - } - - pc += __GLX_PAD(numVals * __glXTypeSize(datatype)); - } - - glDrawArrays(primType, 0, numVertexes); - - /* turn off anything we might have turned on */ - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - glDisableClientState(GL_INDEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_EDGE_FLAG_ARRAY); - glDisableClientState(GL_SECONDARY_COLOR_ARRAY); - glDisableClientState(GL_FOG_COORD_ARRAY); -} - -void __glXDisp_DrawArraysEXT(GLbyte *pc) -{ - __glXDisp_DrawArrays(pc); -} diff --git a/nx-X11/programs/Xserver/GL/glx/render2swap.c.NX.original b/nx-X11/programs/Xserver/GL/glx/render2swap.c.NX.original deleted file mode 100644 index 0225970cb..000000000 --- a/nx-X11/programs/Xserver/GL/glx/render2swap.c.NX.original +++ /dev/null @@ -1,393 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/render2swap.c,v 1.6 2002/01/14 22:47:08 tsi Exp $ */ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -*/ - -/* #define NEED_REPLIES */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "glxserver.h" -#include "unpack.h" -#include "g_disptab.h" -#include "g_disptab_EXT.h" -#include "indirect_size.h" - -void __glXDispSwap_Map1f(GLbyte *pc) -{ - GLint order, k; - GLfloat u1, u2, *points; - GLenum target; - GLint compsize; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_INT(pc + 0); - __GLX_SWAP_INT(pc + 12); - __GLX_SWAP_FLOAT(pc + 4); - __GLX_SWAP_FLOAT(pc + 8); - - target = *(GLenum *)(pc + 0); - order = *(GLint *)(pc + 12); - u1 = *(GLfloat *)(pc + 4); - u2 = *(GLfloat *)(pc + 8); - points = (GLfloat *)(pc + 16); - k = __glMap1f_size(target); - - if (order <= 0 || k < 0) { - /* Erroneous command. */ - compsize = 0; - } else { - compsize = order * k; - } - __GLX_SWAP_FLOAT_ARRAY(points, compsize); - - glMap1f(target, u1, u2, k, order, points); -} - -void __glXDispSwap_Map2f(GLbyte *pc) -{ - GLint uorder, vorder, ustride, vstride, k; - GLfloat u1, u2, v1, v2, *points; - GLenum target; - GLint compsize; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_INT(pc + 0); - __GLX_SWAP_INT(pc + 12); - __GLX_SWAP_INT(pc + 24); - __GLX_SWAP_FLOAT(pc + 4); - __GLX_SWAP_FLOAT(pc + 8); - __GLX_SWAP_FLOAT(pc + 16); - __GLX_SWAP_FLOAT(pc + 20); - - target = *(GLenum *)(pc + 0); - uorder = *(GLint *)(pc + 12); - vorder = *(GLint *)(pc + 24); - u1 = *(GLfloat *)(pc + 4); - u2 = *(GLfloat *)(pc + 8); - v1 = *(GLfloat *)(pc + 16); - v2 = *(GLfloat *)(pc + 20); - points = (GLfloat *)(pc + 28); - - k = __glMap2f_size(target); - ustride = vorder * k; - vstride = k; - - if (vorder <= 0 || uorder <= 0 || k < 0) { - /* Erroneous command. */ - compsize = 0; - } else { - compsize = uorder * vorder * k; - } - __GLX_SWAP_FLOAT_ARRAY(points, compsize); - - glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -void __glXDispSwap_Map1d(GLbyte *pc) -{ - GLint order, k, compsize; - GLenum target; - GLdouble u1, u2, *points; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_DOUBLE(pc + 0); - __GLX_SWAP_DOUBLE(pc + 8); - __GLX_SWAP_INT(pc + 16); - __GLX_SWAP_INT(pc + 20); - - target = *(GLenum*) (pc + 16); - order = *(GLint*) (pc + 20); - k = __glMap1d_size(target); - if (order <= 0 || k < 0) { - /* Erroneous command. */ - compsize = 0; - } else { - compsize = order * k; - } - __GLX_GET_DOUBLE(u1,pc); - __GLX_GET_DOUBLE(u2,pc+8); - __GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize); - pc += 24; - -#ifdef __GLX_ALIGN64 - if (((unsigned long)pc) & 7) { - /* - ** Copy the doubles up 4 bytes, trashing the command but aligning - ** the data in the process - */ - __GLX_MEM_COPY(pc-4, pc, compsize*8); - points = (GLdouble*) (pc - 4); - } else { - points = (GLdouble*) pc; - } -#else - points = (GLdouble*) pc; -#endif - glMap1d(target, u1, u2, k, order, points); -} - -void __glXDispSwap_Map2d(GLbyte *pc) -{ - GLdouble u1, u2, v1, v2, *points; - GLint uorder, vorder, ustride, vstride, k, compsize; - GLenum target; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_DOUBLE(pc + 0); - __GLX_SWAP_DOUBLE(pc + 8); - __GLX_SWAP_DOUBLE(pc + 16); - __GLX_SWAP_DOUBLE(pc + 24); - __GLX_SWAP_INT(pc + 32); - __GLX_SWAP_INT(pc + 36); - __GLX_SWAP_INT(pc + 40); - - target = *(GLenum *)(pc + 32); - uorder = *(GLint *)(pc + 36); - vorder = *(GLint *)(pc + 40); - k = __glMap2d_size(target); - if (vorder <= 0 || uorder <= 0 || k < 0) { - /* Erroneous command. */ - compsize = 0; - } else { - compsize = uorder * vorder * k; - } - __GLX_GET_DOUBLE(u1,pc); - __GLX_GET_DOUBLE(u2,pc+8); - __GLX_GET_DOUBLE(v1,pc+16); - __GLX_GET_DOUBLE(v2,pc+24); - __GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize); - pc += 44; - ustride = vorder * k; - vstride = k; - -#ifdef __GLX_ALIGN64 - if (((unsigned long)pc) & 7) { - /* - ** Copy the doubles up 4 bytes, trashing the command but aligning - ** the data in the process - */ - __GLX_MEM_COPY(pc-4, pc, compsize*8); - points = (GLdouble*) (pc - 4); - } else { - points = (GLdouble*) pc; - } -#else - points = (GLdouble*) pc; -#endif - glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -void __glXDispSwap_CallLists(GLbyte *pc) -{ - GLenum type; - GLsizei n; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_INT(pc + 4); - __GLX_SWAP_INT(pc + 0); - type = *(GLenum *)(pc + 4); - n = *(GLsizei *)(pc + 0); - - switch (type) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_2_BYTES: - case GL_3_BYTES: - case GL_4_BYTES: - break; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - __GLX_SWAP_SHORT_ARRAY(pc+8, n); - break; - case GL_INT: - case GL_UNSIGNED_INT: - __GLX_SWAP_INT_ARRAY(pc+8, n); - break; - case GL_FLOAT: - __GLX_SWAP_FLOAT_ARRAY(pc+8, n); - break; - } - - glCallLists(n, type, pc+8); -} - -static void swapArray(GLint numVals, GLenum datatype, - GLint stride, GLint numVertexes, GLbyte *pc) -{ - int i,j; - __GLX_DECLARE_SWAP_VARIABLES; - - switch (datatype) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - /* don't need to swap */ - return; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - for (i=0; inumVertexes; - GLint numComponents = hdr->numComponents; - GLenum primType = hdr->primType; - GLint stride = 0; - int i; - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_INT(&numVertexes); - __GLX_SWAP_INT(&numComponents); - __GLX_SWAP_INT(&primType); - - pc += sizeof(__GLXdispatchDrawArraysHeader); - compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc; - - /* compute stride (same for all component arrays) */ - for (i=0; i -#endif - -#include "glxserver.h" -#include "unpack.h" -#include "g_disptab.h" -#include "g_disptab_EXT.h" - - -void __glXDispSwap_Map1f(GLbyte *pc) -{ - GLint order, k; - GLfloat u1, u2, *points; - GLenum target; - GLint compsize; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_INT(pc + 0); - __GLX_SWAP_INT(pc + 12); - __GLX_SWAP_FLOAT(pc + 4); - __GLX_SWAP_FLOAT(pc + 8); - - target = *(GLenum *)(pc + 0); - order = *(GLint *)(pc + 12); - u1 = *(GLfloat *)(pc + 4); - u2 = *(GLfloat *)(pc + 8); - points = (GLfloat *)(pc + 16); - k = __glMap1f_size(target); - - if (order <= 0 || k < 0) { - /* Erroneous command. */ - compsize = 0; - } else { - compsize = order * k; - } - __GLX_SWAP_FLOAT_ARRAY(points, compsize); - - glMap1f(target, u1, u2, k, order, points); -} - -void __glXDispSwap_Map2f(GLbyte *pc) -{ - GLint uorder, vorder, ustride, vstride, k; - GLfloat u1, u2, v1, v2, *points; - GLenum target; - GLint compsize; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_INT(pc + 0); - __GLX_SWAP_INT(pc + 12); - __GLX_SWAP_INT(pc + 24); - __GLX_SWAP_FLOAT(pc + 4); - __GLX_SWAP_FLOAT(pc + 8); - __GLX_SWAP_FLOAT(pc + 16); - __GLX_SWAP_FLOAT(pc + 20); - - target = *(GLenum *)(pc + 0); - uorder = *(GLint *)(pc + 12); - vorder = *(GLint *)(pc + 24); - u1 = *(GLfloat *)(pc + 4); - u2 = *(GLfloat *)(pc + 8); - v1 = *(GLfloat *)(pc + 16); - v2 = *(GLfloat *)(pc + 20); - points = (GLfloat *)(pc + 28); - - k = __glMap2f_size(target); - ustride = vorder * k; - vstride = k; - - if (vorder <= 0 || uorder <= 0 || k < 0) { - /* Erroneous command. */ - compsize = 0; - } else { - compsize = uorder * vorder * k; - } - __GLX_SWAP_FLOAT_ARRAY(points, compsize); - - glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -void __glXDispSwap_Map1d(GLbyte *pc) -{ - GLint order, k, compsize; - GLenum target; - GLdouble u1, u2, *points; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_DOUBLE(pc + 0); - __GLX_SWAP_DOUBLE(pc + 8); - __GLX_SWAP_INT(pc + 16); - __GLX_SWAP_INT(pc + 20); - - target = *(GLenum*) (pc + 16); - order = *(GLint*) (pc + 20); - k = __glMap1d_size(target); - if (order <= 0 || k < 0) { - /* Erroneous command. */ - compsize = 0; - } else { - compsize = order * k; - } - __GLX_GET_DOUBLE(u1,pc); - __GLX_GET_DOUBLE(u2,pc+8); - __GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize); - pc += 24; - -#ifdef __GLX_ALIGN64 - if (((unsigned long)pc) & 7) { - /* - ** Copy the doubles up 4 bytes, trashing the command but aligning - ** the data in the process - */ - __GLX_MEM_COPY(pc-4, pc, compsize*8); - points = (GLdouble*) (pc - 4); - } else { - points = (GLdouble*) pc; - } -#else - points = (GLdouble*) pc; -#endif - glMap1d(target, u1, u2, k, order, points); -} - -void __glXDispSwap_Map2d(GLbyte *pc) -{ - GLdouble u1, u2, v1, v2, *points; - GLint uorder, vorder, ustride, vstride, k, compsize; - GLenum target; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_DOUBLE(pc + 0); - __GLX_SWAP_DOUBLE(pc + 8); - __GLX_SWAP_DOUBLE(pc + 16); - __GLX_SWAP_DOUBLE(pc + 24); - __GLX_SWAP_INT(pc + 32); - __GLX_SWAP_INT(pc + 36); - __GLX_SWAP_INT(pc + 40); - - target = *(GLenum *)(pc + 32); - uorder = *(GLint *)(pc + 36); - vorder = *(GLint *)(pc + 40); - k = __glMap2d_size(target); - if (vorder <= 0 || uorder <= 0 || k < 0) { - /* Erroneous command. */ - compsize = 0; - } else { - compsize = uorder * vorder * k; - } - __GLX_GET_DOUBLE(u1,pc); - __GLX_GET_DOUBLE(u2,pc+8); - __GLX_GET_DOUBLE(v1,pc+16); - __GLX_GET_DOUBLE(v2,pc+24); - __GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize); - pc += 44; - ustride = vorder * k; - vstride = k; - -#ifdef __GLX_ALIGN64 - if (((unsigned long)pc) & 7) { - /* - ** Copy the doubles up 4 bytes, trashing the command but aligning - ** the data in the process - */ - __GLX_MEM_COPY(pc-4, pc, compsize*8); - points = (GLdouble*) (pc - 4); - } else { - points = (GLdouble*) pc; - } -#else - points = (GLdouble*) pc; -#endif - glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -void __glXDispSwap_CallLists(GLbyte *pc) -{ - GLenum type; - GLsizei n; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - __GLX_SWAP_INT(pc + 4); - __GLX_SWAP_INT(pc + 0); - type = *(GLenum *)(pc + 4); - n = *(GLsizei *)(pc + 0); - - switch (type) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_2_BYTES: - case GL_3_BYTES: - case GL_4_BYTES: - break; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - __GLX_SWAP_SHORT_ARRAY(pc+8, n); - break; - case GL_INT: - case GL_UNSIGNED_INT: - __GLX_SWAP_INT_ARRAY(pc+8, n); - break; - case GL_FLOAT: - __GLX_SWAP_FLOAT_ARRAY(pc+8, n); - break; - } - - glCallLists(n, type, pc+8); -} - -static void swapArray(GLint numVals, GLenum datatype, - GLint stride, GLint numVertexes, GLbyte *pc) -{ - int i,j; - __GLX_DECLARE_SWAP_VARIABLES; - - switch (datatype) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - /* don't need to swap */ - return; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - for (i=0; inumVertexes; - GLint numComponents = hdr->numComponents; - GLenum primType = hdr->primType; - GLint stride = 0; - int i; - __GLX_DECLARE_SWAP_VARIABLES; - - __GLX_SWAP_INT(&numVertexes); - __GLX_SWAP_INT(&numComponents); - __GLX_SWAP_INT(&primType); - - pc += sizeof(__GLXdispatchDrawArraysHeader); - compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc; - - /* compute stride (same for all component arrays) */ - for (i=0; i - -#define NeedAllMesaSrc -#define NeedToLinkMesaSrc -#define MesaXBuildDir /**/ -#define MesaInXServer -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc" -#endif - - -LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) - - DRIVER_SRCS = $(XMESA_SRCS) - DRIVER_OBJS = $(XMESA_OBJS) - - COMMON_SRCS = driverfuncs.c - COMMON_OBJS = driverfuncs.o - -#ifndef XFree86Version - -/* This appears to be the quickest way to build a non-XFree86 server */ -GLXSRV_DEFINES = -DXFree86Server - -#endif - - GLX_SRCS = xf86glx.c xf86glx_util.c compsize.c - GLX_OBJS = xf86glx.o xf86glx_util.o compsize.o - - SRCS = $(DRIVER_SRCS) $(GLX_SRCS) $(COMMON_SRCS) - OBJS = $(DRIVER_OBJS) $(GLX_OBJS) $(COMMON_OBJS) - - INCLUDES = -I$(SERVERSRC)/GL/mesa/X -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) \ - -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/shader \ - -I$(MESASRCDIR)/src -I$(MESASRCDIR)/src/mesa/drivers/x11 \ - -I$(MESASRCDIR)/include \ - -I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \ - -I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \ - -I$(SERVERSRC)/GL/glx \ - -I$(XF86OSSRC) \ - -I$(DRMSRCDIR)/shared-core - - DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ - -#ifdef IHaveModules -ModuleObjectRule() -#else -NormalLibraryObjectRule() -#endif - -SubdirLibraryRule($(OBJS)) - -LintLibraryTarget(dri,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() - -#ifdef IHaveSubdirs -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -#if defined(IHaveModules) && BuildModuleInSubdir -LinkSourceFile(xf86glx.c,..) -LinkSourceFile(xf86glx_util.c,..) -#endif - -#ifndef MesaDrvSrcDir -#define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri -#endif - -MESADRVSRCDIR = MesaDrvSrcDir - - -LinkSourceFile(driverfuncs.c, $(MESADRVSRCDIR)/../common) -LinkSourceFile(driverfuncs.h, $(MESADRVSRCDIR)/../common) diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.X.original b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.X.original deleted file mode 100644 index 57fb7ff36..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.X.original +++ /dev/null @@ -1,93 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/Imakefile,v 1.16 2002/11/22 22:56:01 tsi Exp $ - -#if DoLoadableServer -#if !BuildModuleInSubdir -#define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif -#endif - -#include - -#define NeedAllMesaSrc -#define NeedToLinkMesaSrc -#define MesaXBuildDir /**/ -#define MesaInXServer -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc" -#endif - - -LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) - - DRIVER_SRCS = $(XMESA_SRCS) - DRIVER_OBJS = $(XMESA_OBJS) - - COMMON_SRCS = driverfuncs.c - COMMON_OBJS = driverfuncs.o - -#ifndef XFree86Version - -/* This appears to be the quickest way to build a non-XFree86 server */ -GLXSRV_DEFINES = -DXFree86Server - -#endif - - GLX_SRCS = xf86glx.c xf86glx_util.c compsize.c - GLX_OBJS = xf86glx.o xf86glx_util.o compsize.o - - SRCS = $(DRIVER_SRCS) $(GLX_SRCS) $(COMMON_SRCS) - OBJS = $(DRIVER_OBJS) $(GLX_OBJS) $(COMMON_OBJS) - - INCLUDES = -I$(SERVERSRC)/GL/mesa/X -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) \ - -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/shader \ - -I$(MESASRCDIR)/src -I$(MESASRCDIR)/src/mesa/drivers/x11 \ - -I$(MESASRCDIR)/include \ - -I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \ - -I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \ - -I$(SERVERSRC)/GL/glx \ - -I$(XF86OSSRC) \ - -I$(DRMSRCDIR)/shared-core - - DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ - -#ifdef IHaveModules -ModuleObjectRule() -#else -NormalLibraryObjectRule() -#endif - -SubdirLibraryRule($(OBJS)) - -LintLibraryTarget(dri,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() - -#ifdef IHaveSubdirs -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -#if defined(IHaveModules) && BuildModuleInSubdir -LinkSourceFile(xf86glx.c,..) -LinkSourceFile(xf86glx_util.c,..) -#endif - -#ifndef MesaDrvSrcDir -#define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri -#endif - -MESADRVSRCDIR = MesaDrvSrcDir - - -LinkSourceFile(driverfuncs.c, $(MESADRVSRCDIR)/../common) -LinkSourceFile(driverfuncs.h, $(MESADRVSRCDIR)/../common) diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.NX.original b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.NX.original deleted file mode 100644 index 19b5be637..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.NX.original +++ /dev/null @@ -1,952 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v 1.19 2003/07/16 01:38:27 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Brian E. Paul - * - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "xf86glxint.h" -#include "context.h" -#include "xmesaP.h" -#include -#include "context.h" - -/* - * This define is for the glcore.h header file. - * If you add it here, then make sure you also add it in - * ../../../glx/Imakefile. - */ -#if 0 -#define DEBUG -#include -#undef DEBUG -#else -#include -#endif - -#include "glcontextmodes.h" - -#ifdef NXAGENT_SERVER -#include "../main/WSDrawBuffer.h" -#endif - -/* - * This structure is statically allocated in the __glXScreens[] - * structure. This struct is not used anywhere other than in - * __glXScreenInit to initialize each of the active screens - * (__glXActiveScreens[]). Several of the fields must be initialized by - * the screenProbe routine before they are copied to the active screens - * struct. In particular, the contextCreate, pGlxVisual, numVisuals, - * and numUsableVisuals fields must be initialized. - */ -static __GLXscreenInfo __glDDXScreenInfo = { - __MESA_screenProbe, /* Must be generic and handle all screens */ - __MESA_createContext, /* Substitute screen's createContext routine */ - __MESA_createBuffer, /* Substitute screen's createBuffer routine */ - NULL, /* Set up modes in probe */ - NULL, /* Set up pVisualPriv in probe */ - 0, /* Set up numVisuals in probe */ - 0, /* Set up numUsableVisuals in probe */ - NULL, /* GLextensions is overwritten by __glXScreenInit */ - "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ - "Version String", /* GLXversion is overwritten by __glXScreenInit */ - "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ - NULL /* WrappedPositionWindow is overwritten */ -}; - -#ifdef NXAGENT_SERVER -WSDrawBufferPtr pWSDrawBuffer = NULL; - -void AddWSDrawBuffer(GLframebuffer *mesa_buffer) -{ - WSDrawBufferPtr prevWSDB; - WSDrawBufferPtr newWSDB; - WSDrawBufferPtr p; - - prevWSDB = NULL; - newWSDB = NULL; - p = pWSDrawBuffer; - while (p != NULL) { - prevWSDB = p; - if (prevWSDB -> DrawBuffer == mesa_buffer) { - return; - } - p = p -> next; - } - newWSDB = malloc(sizeof(WSDrawBufferRec)); - newWSDB -> DrawBuffer = mesa_buffer; - newWSDB -> next = NULL; - - if (pWSDrawBuffer == NULL) - pWSDrawBuffer = newWSDB; - else - prevWSDB -> next = newWSDB; -} -#endif - -void *__glXglDDXScreenInfo(void) { - return &__glDDXScreenInfo; -} - -static __GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_MESA, - __MESA_resetExtension, - __MESA_initVisuals, - __MESA_setVisualConfigs -}; - -void *__glXglDDXExtensionInfo(void) { - return &__glDDXExtensionInfo; -} - -static __MESA_screen MESAScreens[MAXSCREENS]; -static __GLcontext *MESA_CC = NULL; - -static int numConfigs = 0; -static __GLXvisualConfig *visualConfigs = NULL; -static void **visualPrivates = NULL; - - -static int count_bits(unsigned int n) -{ - int bits = 0; - - while (n > 0) { - if (n & 1) bits++; - n >>= 1; - } - return bits; -} - - -static XMesaVisual find_mesa_visual(int screen, VisualID vid) -{ - __MESA_screen * const pMScr = &MESAScreens[screen]; - const __GLcontextModes *modes; - unsigned i = 0; - - for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) { - if ( modes->visualID == vid ) { - break; - } - - i++; - } - - return (modes != NULL) ? pMScr->xm_vis[i] : NULL; -} - - -/* - * In the case the driver defines no GLX visuals we'll use these. - * Note that for TrueColor and DirectColor visuals, bufferSize is the - * sum of redSize, greenSize, blueSize and alphaSize, which may be larger - * than the nplanes/rootDepth of the server's X11 visuals - */ -#define NUM_FALLBACK_CONFIGS 5 -static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = { - /* [0] = RGB, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [1] = RGB, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 16, 16, 16, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [4] = CI, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - False, /* rgba? (false = color index) */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, -}; - - -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numRGBconfigs; - int numCIconfigs; - int numVisuals = *nvisualp; - int numNewVisuals; - int numNewConfigs; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLcontextModes *modes; - __GLXvisualConfig *pNewVisualConfigs = NULL; - void **glXVisualPriv; - void **pNewVisualPriv; - int found_default; - int i, j, k; - - if (numConfigs > 0) - numNewConfigs = numConfigs; - else - numNewConfigs = NUM_FALLBACK_CONFIGS; - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* - ** If SetVisualConfigs was not called, then use default GLX - ** visual configs. - */ - if (numConfigs == 0) { - memcpy(pNewVisualConfigs, FallbackConfigs, - NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig)); - memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *)); - } - else { - /* copy driver's visual config info */ - for (i = 0; i < numConfigs; i++) { - pNewVisualConfigs[i] = visualConfigs[i]; - pNewVisualPriv[i] = visualPrivates[i]; - } - } - - /* Count the number of RGB and CI visual configs */ - numRGBconfigs = 0; - numCIconfigs = 0; - for (i = 0; i < numNewConfigs; i++) { - if (pNewVisualConfigs[i].rgba) - numRGBconfigs++; - else - numCIconfigs++; - } - - /* Count the total number of visuals to compute */ - numNewVisuals = 0; - for (i = 0; i < numVisuals; i++) { - numNewVisuals += - (pVisual[i].class == TrueColor || pVisual[i].class == DirectColor) - ? numRGBconfigs : numCIconfigs; - } - - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - __glXFree(glXVisualPriv); - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Initialize the new visuals */ - found_default = FALSE; - MESAScreens[screenInfo.numScreens-1].modes = modes; - for (i = j = 0; i < numVisuals; i++) { - int is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - for (k = 0; k < numNewConfigs; k++) { - if (pNewVisualConfigs[k].rgba != is_rgb) - continue; - - assert( modes != NULL ); - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] ); - modes->visualID = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (modes->visualType == GLX_NONE) { - modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class ); - modes->redBits = count_bits(pVisual[i].redMask); - modes->greenBits = count_bits(pVisual[i].greenMask); - modes->blueBits = count_bits(pVisual[i].blueMask); - modes->alphaBits = modes->alphaBits; - modes->redMask = pVisual[i].redMask; - modes->greenMask = pVisual[i].greenMask; - modes->blueMask = pVisual[i].blueMask; - modes->alphaMask = modes->alphaMask; - modes->rgbBits = (is_rgb) - ? (modes->redBits + modes->greenBits + - modes->blueBits + modes->alphaBits) - : rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pNewVisualPriv[k]; - - j++; - modes = modes->next; - } - } - - assert(j <= numNewVisuals); - - /* Save the GLX visuals in the screen structure */ - MESAScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; - MESAScreens[screenInfo.numScreens-1].private = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } - - /* Update the X server's visuals */ - *nvisualp = numNewVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - __glXFree(pVisual); - - /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) - xfree(visualPrivates); - visualPrivates = NULL; - - return TRUE; -} - -void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -Bool __MESA_initVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, int *rootDepthp, - VisualID *defaultVisp, unsigned long sizes, - int bitsPerRGB) -{ - /* - * Setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} - -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __MESA_screen *pMScr = &MESAScreens[screen]; - int j; - __GLcontextModes *modes; - - for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes) { - - /* Fixup the masks */ - modes->redMask = pVis[j].redMask; - modes->greenMask = pVis[j].greenMask; - modes->blueMask = pVis[j].blueMask; - - /* Recalc the sizes */ - modes->redBits = count_bits(modes->redMask); - modes->greenBits = count_bits(modes->greenMask); - modes->blueBits = count_bits(modes->blueMask); - } - } - } -} - -static void init_screen_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __GLcontextModes *modes; - XMesaVisual *pXMesaVisual; - int *used; - int i, j; - - /* Alloc space for the list of XMesa visuals */ - pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis * - sizeof(XMesaVisual)); - __glXMemset(pXMesaVisual, 0, - MESAScreens[screen].num_vis * sizeof(XMesaVisual)); - - /* FIXME: Change 'used' to be a array of bits (rather than of ints), - * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less - * FIXME: than 64 or 128 the stack array can be used instead of calling - * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to - * FIXME: array of bytes instead of ints! - */ - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; - for ( modes = MESAScreens[screen].modes - ; modes != NULL - ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes && - pVis[j].redMask == modes->redMask && - pVis[j].greenMask == modes->greenMask && - pVis[j].blueMask == modes->blueMask && - !used[j]) { - - /* Create the XMesa visual */ - pXMesaVisual[i] = - XMesaCreateVisual(pScreen, - pVis, - modes->rgbMode, - (modes->alphaBits > 0), - modes->doubleBufferMode, - modes->stereoMode, - GL_TRUE, /* ximage_flag */ - modes->depthBits, - modes->stencilBits, - modes->accumRedBits, - modes->accumGreenBits, - modes->accumBlueBits, - modes->accumAlphaBits, - modes->samples, - modes->level, - modes->visualRating); - /* Set the VisualID */ - modes->visualID = pVis[j].vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - - if ( j == pScreen->numVisuals ) { - ErrorF("No matching visual for __GLcontextMode with " - "visual class = %d (%d), nplanes = %u\n", - vis_class, - modes->visualType, - (modes->rgbBits - modes->alphaBits) ); - } - else if ( modes->visualID == -1 ) { - FatalError( "Matching visual found, but visualID still -1!\n" ); - } - - i++; - } - - __glXFree(used); - - MESAScreens[screen].xm_vis = pXMesaVisual; -} - -Bool __MESA_screenProbe(int screen) -{ - /* - * Set up the current screen's visuals. - */ - __glDDXScreenInfo.modes = MESAScreens[screen].modes; - __glDDXScreenInfo.pVisualPriv = MESAScreens[screen].private; - __glDDXScreenInfo.numVisuals = - __glDDXScreenInfo.numUsableVisuals = MESAScreens[screen].num_vis; - - /* - * Set the current screen's createContext routine. This could be - * wrapped by a DDX GLX context creation routine. - */ - __glDDXScreenInfo.createContext = __MESA_createContext; - - /* - * The ordering of the rgb compenents might have been changed by the - * driver after mi initialized them. - */ - fixup_visuals(screen); - - /* - * Find the GLX visuals that are supported by this screen and create - * XMesa's visuals. - */ - init_screen_visuals(screen); - - return TRUE; -} - -extern void __MESA_resetExtension(void) -{ - int i, j; - - XMesaReset(); - - for (i = 0; i < screenInfo.numScreens; i++) { - for (j = 0; j < MESAScreens[i].num_vis; j++) { - if (MESAScreens[i].xm_vis[j]) { - XMesaDestroyVisual(MESAScreens[i].xm_vis[j]); - MESAScreens[i].xm_vis[j] = NULL; - } - } - _gl_context_modes_destroy( MESAScreens[i].modes ); - MESAScreens[i].modes = NULL; - __glXFree(MESAScreens[i].private); - MESAScreens[i].private = NULL; - __glXFree(MESAScreens[i].xm_vis); - MESAScreens[i].xm_vis = NULL; - MESAScreens[i].num_vis = 0; - } - __glDDXScreenInfo.modes = NULL; - MESA_CC = NULL; -} - -void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv) -{ - DrawablePtr pDraw = glxPriv->pDraw; - XMesaVisual xm_vis = find_mesa_visual(pDraw->pScreen->myNum, - glxPriv->modes->visualID); - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - __MESA_buffer buf; - - if (xm_vis == NULL) { - ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", - glxPriv->modes->visualID); - } - buf = (__MESA_buffer)__glXMalloc(sizeof(struct __MESA_bufferRec)); - - /* Create Mesa's buffers */ - if (glxPriv->type == DRAWABLE_WINDOW) { - buf->xm_buf = (void *)XMesaCreateWindowBuffer(xm_vis, - (WindowPtr)pDraw); - } else { - buf->xm_buf = (void *)XMesaCreatePixmapBuffer(xm_vis, - (PixmapPtr)pDraw, 0); - } - - /* Wrap the front buffer's resize routine */ - buf->fbresize = glPriv->frontBuffer.resize; - glPriv->frontBuffer.resize = __MESA_resizeBuffers; - - /* Wrap the swap buffers routine */ - buf->fbswap = glxPriv->swapBuffers; - glxPriv->swapBuffers = __MESA_swapBuffers; - - /* Save Mesa's private buffer structure */ - glPriv->private = (void *)buf; - glPriv->freePrivate = __MESA_destroyBuffer; -} - -GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buffer, - GLint x, GLint y, - GLuint width, GLuint height, - __GLdrawablePrivate *glPriv, - GLuint bufferMask) -{ - __MESA_buffer buf = (__MESA_buffer)glPriv->private; - - if (buf->xm_buf) - XMesaResizeBuffers(buf->xm_buf); - - return (*buf->fbresize)(buffer, x, y, width, height, glPriv, bufferMask); -} - -GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv) -{ - __MESA_buffer buf = (__MESA_buffer)glxPriv->glPriv.private; - - /* - ** Do not call the wrapped swap buffers routine since Mesa has - ** already done the swap. - */ - XMesaSwapBuffers(buf->xm_buf); - - return GL_TRUE; -} - -void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv) -{ - __MESA_buffer buf = (__MESA_buffer)glPriv->private; - __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other; - -#ifdef NXAGENT_SERVER - AddWSDrawBuffer(& (buf -> xm_buf -> mesa_buffer) ); -#endif - - /* Destroy Mesa's buffers */ - if (buf->xm_buf) - XMesaDestroyBuffer(buf->xm_buf); - - /* Unwrap these routines */ - glxPriv->swapBuffers = buf->fbswap; - glPriv->frontBuffer.resize = buf->fbresize; - - __glXFree(glPriv->private); - glPriv->private = NULL; -} - -__GLinterface *__MESA_createContext(__GLimports *imports, - __GLcontextModes *modes, - __GLinterface *shareGC) -{ - __GLcontext *gl_ctx = NULL; - __GLcontext *m_share = NULL; - __GLXcontext *glxc = (__GLXcontext *)imports->other; - XMesaVisual xm_vis; - - if (shareGC) - m_share = (__GLcontext *)shareGC; - - xm_vis = find_mesa_visual(glxc->pScreen->myNum, glxc->modes->visualID); - if (xm_vis) { - XMesaContext xmshare = m_share ? m_share->DriverCtx : 0; - XMesaContext xmctx = XMesaCreateContext(xm_vis, xmshare); - gl_ctx = xmctx ? &xmctx->mesa : 0; - } - else { - ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", - glxc->modes->visualID); - } - - - if (!gl_ctx) - return NULL; - - gl_ctx->imports = *imports; - gl_ctx->exports.destroyContext = __MESA_destroyContext; - gl_ctx->exports.loseCurrent = __MESA_loseCurrent; - gl_ctx->exports.makeCurrent = __MESA_makeCurrent; - gl_ctx->exports.shareContext = __MESA_shareContext; - gl_ctx->exports.copyContext = __MESA_copyContext; - gl_ctx->exports.forceCurrent = __MESA_forceCurrent; - gl_ctx->exports.notifyResize = __MESA_notifyResize; - gl_ctx->exports.notifyDestroy = __MESA_notifyDestroy; - gl_ctx->exports.notifySwapBuffers = __MESA_notifySwapBuffers; - gl_ctx->exports.dispatchExec = __MESA_dispatchExec; - gl_ctx->exports.beginDispatchOverride = __MESA_beginDispatchOverride; - gl_ctx->exports.endDispatchOverride = __MESA_endDispatchOverride; - - return (__GLinterface *)gl_ctx; -} - -GLboolean __MESA_destroyContext(__GLcontext *gc) -{ - XMesaContext xmesa = (XMesaContext) gc->DriverCtx; - XMesaDestroyContext( xmesa ); - return GL_TRUE; -} - -GLboolean __MESA_loseCurrent(__GLcontext *gc) -{ - XMesaContext xmesa = (XMesaContext) gc->DriverCtx; - MESA_CC = NULL; - __glXLastContext = NULL; - return XMesaLoseCurrent(xmesa); -} - -GLboolean __MESA_makeCurrent(__GLcontext *gc) -{ - __GLdrawablePrivate *drawPriv = gc->imports.getDrawablePrivate( gc ); - __MESA_buffer drawBuf = (__MESA_buffer)drawPriv->private; - __GLdrawablePrivate *readPriv = gc->imports.getReadablePrivate( gc ); - __MESA_buffer readBuf = (__MESA_buffer)readPriv->private; - XMesaContext xmesa = (XMesaContext) gc->DriverCtx; - - MESA_CC = gc; - return XMesaMakeCurrent2(xmesa, drawBuf->xm_buf, readBuf->xm_buf); -} - -GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare) -{ - /* NOT_DONE */ - /* XXX I don't see where/how this could ever be called */ - ErrorF("__MESA_shareContext\n"); - return GL_FALSE; -} - -GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask) -{ - XMesaContext xm_dst = (XMesaContext) dst->DriverCtx; - const XMesaContext xm_src = (const XMesaContext) src->DriverCtx; - _mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask); - return GL_TRUE; -} - -GLboolean __MESA_forceCurrent(__GLcontext *gc) -{ - XMesaContext xmesa = (XMesaContext) gc->DriverCtx; - MESA_CC = gc; - return XMesaForceCurrent(xmesa); -} - -GLboolean __MESA_notifyResize(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_notifyResize\n"); - return GL_FALSE; -} - -void __MESA_notifyDestroy(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_notifyDestroy\n"); - return; -} - -void __MESA_notifySwapBuffers(__GLcontext *gc) -{ - _mesa_notifySwapBuffers(gc); -} - -struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_dispatchExec\n"); - return NULL; -} - -void __MESA_beginDispatchOverride(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_beginDispatchOverride\n"); - return; -} - -void __MESA_endDispatchOverride(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_endDispatchOverride\n"); - return; -} - - -/* - * Server-side GLX uses these functions which are normally defined - * in the OpenGL SI. - */ - -GLuint __glFloorLog2(GLuint val) -{ - int c = 0; - - while (val > 1) { - c++; - val >>= 1; - } - return c; -} - diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.X.original b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.X.original deleted file mode 100644 index 5dd4e7c37..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c.X.original +++ /dev/null @@ -1,914 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v 1.19 2003/07/16 01:38:27 dawes Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Brian E. Paul - * - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "xf86glxint.h" -#include "context.h" -#include "xmesaP.h" -#include -#include "context.h" - -/* - * This define is for the glcore.h header file. - * If you add it here, then make sure you also add it in - * ../../../glx/Imakefile. - */ -#if 0 -#define DEBUG -#include -#undef DEBUG -#else -#include -#endif - -#include "glcontextmodes.h" - -/* - * This structure is statically allocated in the __glXScreens[] - * structure. This struct is not used anywhere other than in - * __glXScreenInit to initialize each of the active screens - * (__glXActiveScreens[]). Several of the fields must be initialized by - * the screenProbe routine before they are copied to the active screens - * struct. In particular, the contextCreate, pGlxVisual, numVisuals, - * and numUsableVisuals fields must be initialized. - */ -static __GLXscreenInfo __glDDXScreenInfo = { - __MESA_screenProbe, /* Must be generic and handle all screens */ - __MESA_createContext, /* Substitute screen's createContext routine */ - __MESA_createBuffer, /* Substitute screen's createBuffer routine */ - NULL, /* Set up modes in probe */ - NULL, /* Set up pVisualPriv in probe */ - 0, /* Set up numVisuals in probe */ - 0, /* Set up numUsableVisuals in probe */ - NULL, /* GLextensions is overwritten by __glXScreenInit */ - "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ - "Version String", /* GLXversion is overwritten by __glXScreenInit */ - "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ - NULL /* WrappedPositionWindow is overwritten */ -}; - -void *__glXglDDXScreenInfo(void) { - return &__glDDXScreenInfo; -} - -static __GLXextensionInfo __glDDXExtensionInfo = { - GL_CORE_MESA, - __MESA_resetExtension, - __MESA_initVisuals, - __MESA_setVisualConfigs -}; - -void *__glXglDDXExtensionInfo(void) { - return &__glDDXExtensionInfo; -} - -static __MESA_screen MESAScreens[MAXSCREENS]; -static __GLcontext *MESA_CC = NULL; - -static int numConfigs = 0; -static __GLXvisualConfig *visualConfigs = NULL; -static void **visualPrivates = NULL; - - -static int count_bits(unsigned int n) -{ - int bits = 0; - - while (n > 0) { - if (n & 1) bits++; - n >>= 1; - } - return bits; -} - - -static XMesaVisual find_mesa_visual(int screen, VisualID vid) -{ - __MESA_screen * const pMScr = &MESAScreens[screen]; - const __GLcontextModes *modes; - unsigned i = 0; - - for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) { - if ( modes->visualID == vid ) { - break; - } - - i++; - } - - return (modes != NULL) ? pMScr->xm_vis[i] : NULL; -} - - -/* - * In the case the driver defines no GLX visuals we'll use these. - * Note that for TrueColor and DirectColor visuals, bufferSize is the - * sum of redSize, greenSize, blueSize and alphaSize, which may be larger - * than the nplanes/rootDepth of the server's X11 visuals - */ -#define NUM_FALLBACK_CONFIGS 5 -static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = { - /* [0] = RGB, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [1] = RGB, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 16, 16, 16, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */ - { - -1, /* vid */ - -1, /* class */ - True, /* rgba */ - -1, -1, -1, 8, /* rgba sizes */ - -1, -1, -1, -1, /* rgba masks */ - 16, 16, 16, 16, /* rgba accum sizes */ - False, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 8, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, - /* [4] = CI, double buffered, Z */ - { - -1, /* vid */ - -1, /* class */ - False, /* rgba? (false = color index) */ - -1, -1, -1, 0, /* rgba sizes */ - -1, -1, -1, 0, /* rgba masks */ - 0, 0, 0, 0, /* rgba accum sizes */ - True, /* doubleBuffer */ - False, /* stereo */ - -1, /* bufferSize */ - 16, /* depthSize */ - 0, /* stencilSize */ - 0, /* auxBuffers */ - 0, /* level */ - GLX_NONE, /* visualRating */ - GLX_NONE, /* transparentPixel */ - 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */ - 0 /* transparentIndex */ - }, -}; - - -static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - VisualID *defaultVisp, - int ndepth, DepthPtr pdepth, - int rootDepth) -{ - int numRGBconfigs; - int numCIconfigs; - int numVisuals = *nvisualp; - int numNewVisuals; - int numNewConfigs; - VisualPtr pVisual = *visualp; - VisualPtr pVisualNew = NULL; - VisualID *orig_vid = NULL; - __GLcontextModes *modes; - __GLXvisualConfig *pNewVisualConfigs = NULL; - void **glXVisualPriv; - void **pNewVisualPriv; - int found_default; - int i, j, k; - - if (numConfigs > 0) - numNewConfigs = numConfigs; - else - numNewConfigs = NUM_FALLBACK_CONFIGS; - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* - ** If SetVisualConfigs was not called, then use default GLX - ** visual configs. - */ - if (numConfigs == 0) { - memcpy(pNewVisualConfigs, FallbackConfigs, - NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig)); - memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *)); - } - else { - /* copy driver's visual config info */ - for (i = 0; i < numConfigs; i++) { - pNewVisualConfigs[i] = visualConfigs[i]; - pNewVisualPriv[i] = visualPrivates[i]; - } - } - - /* Count the number of RGB and CI visual configs */ - numRGBconfigs = 0; - numCIconfigs = 0; - for (i = 0; i < numNewConfigs; i++) { - if (pNewVisualConfigs[i].rgba) - numRGBconfigs++; - else - numCIconfigs++; - } - - /* Count the total number of visuals to compute */ - numNewVisuals = 0; - for (i = 0; i < numVisuals; i++) { - numNewVisuals += - (pVisual[i].class == TrueColor || pVisual[i].class == DirectColor) - ? numRGBconfigs : numCIconfigs; - } - - /* Reset variables for use with the next screen/driver's visual configs */ - visualConfigs = NULL; - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { - __glXFree(glXVisualPriv); - _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - return FALSE; - } - - /* Initialize the new visuals */ - found_default = FALSE; - MESAScreens[screenInfo.numScreens-1].modes = modes; - for (i = j = 0; i < numVisuals; i++) { - int is_rgb = (pVisual[i].class == TrueColor || - pVisual[i].class == DirectColor); - - for (k = 0; k < numNewConfigs; k++) { - if (pNewVisualConfigs[k].rgba != is_rgb) - continue; - - assert( modes != NULL ); - - /* Initialize the new visual */ - pVisualNew[j] = pVisual[i]; - pVisualNew[j].vid = FakeClientID(0); - - /* Check for the default visual */ - if (!found_default && pVisual[i].vid == *defaultVisp) { - *defaultVisp = pVisualNew[j].vid; - found_default = TRUE; - } - - /* Save the old VisualID */ - orig_vid[j] = pVisual[i].vid; - - /* Initialize the glXVisual */ - _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] ); - modes->visualID = pVisualNew[j].vid; - - /* - * If the class is -1, then assume the X visual information - * is identical to what GLX needs, and take them from the X - * visual. NOTE: if class != -1, then all other fields MUST - * be initialized. - */ - if (modes->visualType == GLX_NONE) { - modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class ); - modes->redBits = count_bits(pVisual[i].redMask); - modes->greenBits = count_bits(pVisual[i].greenMask); - modes->blueBits = count_bits(pVisual[i].blueMask); - modes->alphaBits = modes->alphaBits; - modes->redMask = pVisual[i].redMask; - modes->greenMask = pVisual[i].greenMask; - modes->blueMask = pVisual[i].blueMask; - modes->alphaMask = modes->alphaMask; - modes->rgbBits = (is_rgb) - ? (modes->redBits + modes->greenBits + - modes->blueBits + modes->alphaBits) - : rootDepth; - } - - /* Save the device-dependent private for this visual */ - glXVisualPriv[j] = pNewVisualPriv[k]; - - j++; - modes = modes->next; - } - } - - assert(j <= numNewVisuals); - - /* Save the GLX visuals in the screen structure */ - MESAScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; - MESAScreens[screenInfo.numScreens-1].private = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { - int numVids = 0; - VisualID *pVids = NULL; - int k, n = 0; - - /* Count the new number of VisualIDs at this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) - for (k = 0; k < numNewVisuals; k++) - if (pdepth[i].vids[j] == orig_vid[k]) - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } - - /* Update the X server's visuals */ - *nvisualp = numNewVisuals; - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ - __glXFree(pVisual); - - /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) - xfree(visualPrivates); - visualPrivates = NULL; - - return TRUE; -} - -void __MESA_setVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates) -{ - numConfigs = nconfigs; - visualConfigs = configs; - visualPrivates = privates; -} - -Bool __MESA_initVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, int *rootDepthp, - VisualID *defaultVisp, unsigned long sizes, - int bitsPerRGB) -{ - /* - * Setup the visuals supported by this particular screen. - */ - return init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); -} - -static void fixup_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __MESA_screen *pMScr = &MESAScreens[screen]; - int j; - __GLcontextModes *modes; - - for ( modes = pMScr->modes ; modes != NULL ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - /* Find a visual that matches the GLX visual's class and size */ - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes) { - - /* Fixup the masks */ - modes->redMask = pVis[j].redMask; - modes->greenMask = pVis[j].greenMask; - modes->blueMask = pVis[j].blueMask; - - /* Recalc the sizes */ - modes->redBits = count_bits(modes->redMask); - modes->greenBits = count_bits(modes->greenMask); - modes->blueBits = count_bits(modes->blueMask); - } - } - } -} - -static void init_screen_visuals(int screen) -{ - ScreenPtr pScreen = screenInfo.screens[screen]; - __GLcontextModes *modes; - XMesaVisual *pXMesaVisual; - int *used; - int i, j; - - /* Alloc space for the list of XMesa visuals */ - pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis * - sizeof(XMesaVisual)); - __glXMemset(pXMesaVisual, 0, - MESAScreens[screen].num_vis * sizeof(XMesaVisual)); - - /* FIXME: Change 'used' to be a array of bits (rather than of ints), - * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less - * FIXME: than 64 or 128 the stack array can be used instead of calling - * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to - * FIXME: array of bytes instead of ints! - */ - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; - for ( modes = MESAScreens[screen].modes - ; modes != NULL - ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); - const int nplanes = (modes->rgbBits - modes->alphaBits); - const VisualPtr pVis = pScreen->visuals; - - for (j = 0; j < pScreen->numVisuals; j++) { - if (pVis[j].class == vis_class && - pVis[j].nplanes == nplanes && - pVis[j].redMask == modes->redMask && - pVis[j].greenMask == modes->greenMask && - pVis[j].blueMask == modes->blueMask && - !used[j]) { - - /* Create the XMesa visual */ - pXMesaVisual[i] = - XMesaCreateVisual(pScreen, - pVis, - modes->rgbMode, - (modes->alphaBits > 0), - modes->doubleBufferMode, - modes->stereoMode, - GL_TRUE, /* ximage_flag */ - modes->depthBits, - modes->stencilBits, - modes->accumRedBits, - modes->accumGreenBits, - modes->accumBlueBits, - modes->accumAlphaBits, - modes->samples, - modes->level, - modes->visualRating); - /* Set the VisualID */ - modes->visualID = pVis[j].vid; - - /* Mark this visual used */ - used[j] = 1; - break; - } - } - - if ( j == pScreen->numVisuals ) { - ErrorF("No matching visual for __GLcontextMode with " - "visual class = %d (%d), nplanes = %u\n", - vis_class, - modes->visualType, - (modes->rgbBits - modes->alphaBits) ); - } - else if ( modes->visualID == -1 ) { - FatalError( "Matching visual found, but visualID still -1!\n" ); - } - - i++; - } - - __glXFree(used); - - MESAScreens[screen].xm_vis = pXMesaVisual; -} - -Bool __MESA_screenProbe(int screen) -{ - /* - * Set up the current screen's visuals. - */ - __glDDXScreenInfo.modes = MESAScreens[screen].modes; - __glDDXScreenInfo.pVisualPriv = MESAScreens[screen].private; - __glDDXScreenInfo.numVisuals = - __glDDXScreenInfo.numUsableVisuals = MESAScreens[screen].num_vis; - - /* - * Set the current screen's createContext routine. This could be - * wrapped by a DDX GLX context creation routine. - */ - __glDDXScreenInfo.createContext = __MESA_createContext; - - /* - * The ordering of the rgb compenents might have been changed by the - * driver after mi initialized them. - */ - fixup_visuals(screen); - - /* - * Find the GLX visuals that are supported by this screen and create - * XMesa's visuals. - */ - init_screen_visuals(screen); - - return TRUE; -} - -extern void __MESA_resetExtension(void) -{ - int i, j; - - XMesaReset(); - - for (i = 0; i < screenInfo.numScreens; i++) { - for (j = 0; j < MESAScreens[i].num_vis; j++) { - if (MESAScreens[i].xm_vis[j]) { - XMesaDestroyVisual(MESAScreens[i].xm_vis[j]); - MESAScreens[i].xm_vis[j] = NULL; - } - } - _gl_context_modes_destroy( MESAScreens[i].modes ); - MESAScreens[i].modes = NULL; - __glXFree(MESAScreens[i].private); - MESAScreens[i].private = NULL; - __glXFree(MESAScreens[i].xm_vis); - MESAScreens[i].xm_vis = NULL; - MESAScreens[i].num_vis = 0; - } - __glDDXScreenInfo.modes = NULL; - MESA_CC = NULL; -} - -void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv) -{ - DrawablePtr pDraw = glxPriv->pDraw; - XMesaVisual xm_vis = find_mesa_visual(pDraw->pScreen->myNum, - glxPriv->modes->visualID); - __GLdrawablePrivate *glPriv = &glxPriv->glPriv; - __MESA_buffer buf; - - if (xm_vis == NULL) { - ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", - glxPriv->modes->visualID); - } - buf = (__MESA_buffer)__glXMalloc(sizeof(struct __MESA_bufferRec)); - - /* Create Mesa's buffers */ - if (glxPriv->type == DRAWABLE_WINDOW) { - buf->xm_buf = (void *)XMesaCreateWindowBuffer(xm_vis, - (WindowPtr)pDraw); - } else { - buf->xm_buf = (void *)XMesaCreatePixmapBuffer(xm_vis, - (PixmapPtr)pDraw, 0); - } - - /* Wrap the front buffer's resize routine */ - buf->fbresize = glPriv->frontBuffer.resize; - glPriv->frontBuffer.resize = __MESA_resizeBuffers; - - /* Wrap the swap buffers routine */ - buf->fbswap = glxPriv->swapBuffers; - glxPriv->swapBuffers = __MESA_swapBuffers; - - /* Save Mesa's private buffer structure */ - glPriv->private = (void *)buf; - glPriv->freePrivate = __MESA_destroyBuffer; -} - -GLboolean __MESA_resizeBuffers(__GLdrawableBuffer *buffer, - GLint x, GLint y, - GLuint width, GLuint height, - __GLdrawablePrivate *glPriv, - GLuint bufferMask) -{ - __MESA_buffer buf = (__MESA_buffer)glPriv->private; - - if (buf->xm_buf) - XMesaResizeBuffers(buf->xm_buf); - - return (*buf->fbresize)(buffer, x, y, width, height, glPriv, bufferMask); -} - -GLboolean __MESA_swapBuffers(__GLXdrawablePrivate *glxPriv) -{ - __MESA_buffer buf = (__MESA_buffer)glxPriv->glPriv.private; - - /* - ** Do not call the wrapped swap buffers routine since Mesa has - ** already done the swap. - */ - XMesaSwapBuffers(buf->xm_buf); - - return GL_TRUE; -} - -void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv) -{ - __MESA_buffer buf = (__MESA_buffer)glPriv->private; - __GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other; - - /* Destroy Mesa's buffers */ - if (buf->xm_buf) - XMesaDestroyBuffer(buf->xm_buf); - - /* Unwrap these routines */ - glxPriv->swapBuffers = buf->fbswap; - glPriv->frontBuffer.resize = buf->fbresize; - - __glXFree(glPriv->private); - glPriv->private = NULL; -} - -__GLinterface *__MESA_createContext(__GLimports *imports, - __GLcontextModes *modes, - __GLinterface *shareGC) -{ - __GLcontext *gl_ctx = NULL; - __GLcontext *m_share = NULL; - __GLXcontext *glxc = (__GLXcontext *)imports->other; - XMesaVisual xm_vis; - - if (shareGC) - m_share = (__GLcontext *)shareGC; - - xm_vis = find_mesa_visual(glxc->pScreen->myNum, glxc->modes->visualID); - if (xm_vis) { - XMesaContext xmshare = m_share ? m_share->DriverCtx : 0; - XMesaContext xmctx = XMesaCreateContext(xm_vis, xmshare); - gl_ctx = xmctx ? &xmctx->mesa : 0; - } - else { - ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", - glxc->modes->visualID); - } - - - if (!gl_ctx) - return NULL; - - gl_ctx->imports = *imports; - gl_ctx->exports.destroyContext = __MESA_destroyContext; - gl_ctx->exports.loseCurrent = __MESA_loseCurrent; - gl_ctx->exports.makeCurrent = __MESA_makeCurrent; - gl_ctx->exports.shareContext = __MESA_shareContext; - gl_ctx->exports.copyContext = __MESA_copyContext; - gl_ctx->exports.forceCurrent = __MESA_forceCurrent; - gl_ctx->exports.notifyResize = __MESA_notifyResize; - gl_ctx->exports.notifyDestroy = __MESA_notifyDestroy; - gl_ctx->exports.notifySwapBuffers = __MESA_notifySwapBuffers; - gl_ctx->exports.dispatchExec = __MESA_dispatchExec; - gl_ctx->exports.beginDispatchOverride = __MESA_beginDispatchOverride; - gl_ctx->exports.endDispatchOverride = __MESA_endDispatchOverride; - - return (__GLinterface *)gl_ctx; -} - -GLboolean __MESA_destroyContext(__GLcontext *gc) -{ - XMesaContext xmesa = (XMesaContext) gc->DriverCtx; - XMesaDestroyContext( xmesa ); - return GL_TRUE; -} - -GLboolean __MESA_loseCurrent(__GLcontext *gc) -{ - XMesaContext xmesa = (XMesaContext) gc->DriverCtx; - MESA_CC = NULL; - __glXLastContext = NULL; - return XMesaLoseCurrent(xmesa); -} - -GLboolean __MESA_makeCurrent(__GLcontext *gc) -{ - __GLdrawablePrivate *drawPriv = gc->imports.getDrawablePrivate( gc ); - __MESA_buffer drawBuf = (__MESA_buffer)drawPriv->private; - __GLdrawablePrivate *readPriv = gc->imports.getReadablePrivate( gc ); - __MESA_buffer readBuf = (__MESA_buffer)readPriv->private; - XMesaContext xmesa = (XMesaContext) gc->DriverCtx; - - MESA_CC = gc; - return XMesaMakeCurrent2(xmesa, drawBuf->xm_buf, readBuf->xm_buf); -} - -GLboolean __MESA_shareContext(__GLcontext *gc, __GLcontext *gcShare) -{ - /* NOT_DONE */ - /* XXX I don't see where/how this could ever be called */ - ErrorF("__MESA_shareContext\n"); - return GL_FALSE; -} - -GLboolean __MESA_copyContext(__GLcontext *dst, const __GLcontext *src, - GLuint mask) -{ - XMesaContext xm_dst = (XMesaContext) dst->DriverCtx; - const XMesaContext xm_src = (const XMesaContext) src->DriverCtx; - _mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask); - return GL_TRUE; -} - -GLboolean __MESA_forceCurrent(__GLcontext *gc) -{ - XMesaContext xmesa = (XMesaContext) gc->DriverCtx; - MESA_CC = gc; - return XMesaForceCurrent(xmesa); -} - -GLboolean __MESA_notifyResize(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_notifyResize\n"); - return GL_FALSE; -} - -void __MESA_notifyDestroy(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_notifyDestroy\n"); - return; -} - -void __MESA_notifySwapBuffers(__GLcontext *gc) -{ - _mesa_notifySwapBuffers(gc); -} - -struct __GLdispatchStateRec *__MESA_dispatchExec(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_dispatchExec\n"); - return NULL; -} - -void __MESA_beginDispatchOverride(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_beginDispatchOverride\n"); - return; -} - -void __MESA_endDispatchOverride(__GLcontext *gc) -{ - /* NOT_DONE */ - ErrorF("__MESA_endDispatchOverride\n"); - return; -} - - -/* - * Server-side GLX uses these functions which are normally defined - * in the OpenGL SI. - */ - -GLuint __glFloorLog2(GLuint val) -{ - int c = 0; - - while (val > 1) { - c++; - val >>= 1; - } - return c; -} - diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.NX.original b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.NX.original deleted file mode 100644 index 6287b92de..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.NX.original +++ /dev/null @@ -1,61 +0,0 @@ -XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/main/Imakefile,v 1.2 2004/08/19 07:34:43 kem Exp $ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ - -#if DoLoadableServer -#if !BuildModuleInSubdir -#define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif -#endif - -/* Large PIC tables needed for Solaris/SPARC builds */ -#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags) - PICFLAGS = LargePositionIndependentCFlags -#endif - -#include - -#define NeedAllMesaSrc -#define NeedToLinkMesaSrc -#define MesaBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/main/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/main/Imakefile.inc" -#endif - - SRCS = $(COREMESABASESRCS) - OBJS = $(COREMESABASEOBJS) - - INCLUDES = -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/shader \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/include \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \ - -I$(LIBSRC)/GL/include \ - -I$(XF86SRC) -I$(INCLUDESRC) - - DEFINES = $(GLX_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ - -#ifdef IHaveModules -ModuleObjectRule() -#else -NormalLibraryObjectRule() -#endif - -SubdirLibraryRule($(OBJS)) - -LintLibraryTarget(dri,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() - -#ifdef IHaveSubdirs -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.X.original b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.X.original deleted file mode 100644 index 463812236..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.X.original +++ /dev/null @@ -1,61 +0,0 @@ -XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/main/Imakefile,v 1.2 2004/08/19 07:34:43 kem Exp $ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ - -#if DoLoadableServer -#if !BuildModuleInSubdir -#define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif -#endif - -/* Large PIC tables needed for Solaris/SPARC builds */ -#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags) - PICFLAGS = LargePositionIndependentCFlags -#endif - -#include - -#define NeedAllMesaSrc -#define NeedToLinkMesaSrc -#define MesaBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/main/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/main/Imakefile.inc" -#endif - - SRCS = $(COREMESABASESRCS) - OBJS = $(COREMESABASEOBJS) - - INCLUDES = -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/shader \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/include \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \ - -I$(LIBSRC)/GL/include \ - -I$(XF86SRC) -I$(INCLUDESRC) - - DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ - -#ifdef IHaveModules -ModuleObjectRule() -#else -NormalLibraryObjectRule() -#endif - -SubdirLibraryRule($(OBJS)) - -LintLibraryTarget(dri,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() - -#ifdef IHaveSubdirs -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - diff --git a/nx-X11/programs/Xserver/Imakefile.NX.original b/nx-X11/programs/Xserver/Imakefile.NX.original deleted file mode 100644 index 6bf7801e7..000000000 --- a/nx-X11/programs/Xserver/Imakefile.NX.original +++ /dev/null @@ -1,1579 +0,0 @@ -XCOMM $XdotOrg: xc/programs/Xserver/Imakefile,v 1.37 2005/11/18 18:15:23 ajax Exp $ -XCOMM $Xorg: Imakefile,v 1.4 2001/03/14 18:42:02 pookie Exp $ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * Server Master Makefile - */ -XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.296 2003/11/23 06:47:00 torrey Exp $ - -#ifndef InstallXserverSetUID -#define InstallXserverSetUID NO -#endif -#define InstallServerSetUID InstallXserverSetUID - -#include - -/* On most systems the linker requires the libraries in dependency order. - But we have no real order because there are cycles. We fix this by adding - some libraries twice on the commandline. dependLib will add the - dependency library to the commandline if the link order is important */ -#if 1 /* This is currently enabled for all systems */ -#define dependLib(x) x -#else -#define dependLib(x) -#endif - -#if (defined (XFree86Version) || defined(XorgVersion)) -/* Do not strip server binaries */ -INSTPGMFLAGS = -#endif - -#define PreFbLibs $(DIX) $(OS) $(XPDDX) -#define PreFbLibsNoFont $(DIX) $(OS) -#define BarePostFbLibs $(MFB) $(XPFBLIBS) $(MI) -#define PostFbLibs BarePostFbLibs $(EXTENSIONS) -#define NoMfbBarePostFbLibs $(XPFBLIBS) $(MI) -#if !BuildXinerama -#define NoMfbPostFbLibs NoMfbBarePostFbLibs $(EXTENSIONS) -#else -#define NoMfbPostFbLibs $(EXTENSIONS) NoMfbBarePostFbLibs $(EXTENSIONS) -#endif - -#define MFBBareLibs PreFbLibs BarePostFbLibs -#define NoMFBBareLibs PreFbLibs NoMfbBarePostFbLibs -#define MFBLibs PreFbLibs PostFbLibs -#define NoMFBLibs PreFbLibs NoMfbPostFbLibs -#define CFBLibs PreFbLibs $(CFB) PostFbLibs -#define CFB4Libs PreFbLibs $(CFB4) PostFbLibs -#define CFB8Libs PreFbLibs $(CFB8) PostFbLibs -#define CFB16Libs PreFbLibs $(CFB16) PostFbLibs -#define CFB24Libs PreFbLibs $(CFB24) PostFbLibs -#define CFB32Libs PreFbLibs $(CFB32) PostFbLibs - -#define NoMFBCFBLibs PreFbLibs $(CFB) NoMfbPostFbLibs -#define NoMFBCFB8Libs PreFbLibs $(CFB8) NoMfbPostFbLibs -#define FbPostFbLibs $(FB) NoMfbPostFbLibs -#define FBLibs PreFbLibs FbPostFbLibs - -#define MiExtLibs $(SHADOW) - -#define AllFBLibs PreFbLibs $(FB) $(CFB) PostFbLibs - -#if BuildGlxExt -# if BuildXF86DRI && ((defined(XF86Server) && XF86Server) \ - || (defined(XorgServer) && XorgServer)) - DRILIB = GL/dri/ModuleLibraryTargetName(dri) -# else - DRILIB = -# endif -# if GlxUseSGISI - GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ - GL/sgi-si/ModuleLibraryTargetName(GLcore) \ - $(DRILIB) -# else -# if defined(GlxUseWindows) && GlxUseWindows - XWin_GL.exe.GLXLIB = GL/glx/ModuleLibraryTargetName(glx_stdcall) \ - GL/windows/ModuleLibraryTargetName(GLcore) -# endif /* GlxUseWindows */ -# if defined(Win32Architecture) && defined(GlxUseWindows) && GlxUseWindows - GLXLIB = GL/glx/ModuleLibraryTargetName(glx_stdcall) \ - GL/windows/ModuleLibraryTargetName(GLcore) -# elif DoLoadableServer - GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ - GL/mesa/GLcore/ModuleLibraryTargetName(GLcore) -# else - GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ - GL/mesa/GLcore/ModuleLibraryTargetName(GLcore) \ - $(DRILIB) -# endif -# endif - GLXDIR = GL -# if defined(cygwinArchitecture) && defined(GlxUseWindows) && GlxUseWindows - GLXEXT = $(if $($@.GLXLIB),$($@.GLXLIB), $(GLXLIB)) -# else - GLXEXT = $(GLXLIB) -# endif -#endif - -#if BuildXInputExt - XINPUTEXT = Xi/LibraryTargetName(xinput) - XIDIR = Xi -#endif -#if BuildXKB - XKBEXT = xkb/LibraryTargetName(xkb) dependLib($(OS)) - XKBDIR = xkb -#if (defined(XFree86Version) || defined(XorgVersion)) - XF86XKBOBJS = xkb/xf86KillSrv.o xkb/xf86VT.o xkb/xf86Private.o -#endif -#endif -#if BuildLBX - LBXEXT = lbx/LibraryTargetName(lbx) \ - $(TOP)/lib/lbxutil/LibraryTargetName(lbxutil) - LBXDIRS = lbx -#endif -#if BuildDBE - DBEEXT = dbe/LibraryTargetName(dbe) -#endif -#if BuildDBE || BuildDBElib - DBEDIR = dbe -#endif -#if BuildRECORD - RECORDEXT = record/LibraryTargetName(record) -#endif -#if BuildRECORD || BuildRECORDlib - RECORDDIR = record -#endif -#if BuildXTrap - XTRAPEXT = XTrap/LibraryTargetName(xtrap) - XTRAPDIR = XTrap -#endif -#ifdef SiteExtensionLibs - SITEEXTS = SiteExtensionLibs -#endif -#ifdef SiteExtensionDirs - SITEEXTDIRS = SiteExtensionDirs -#endif -#if DoLoadableServer && HasDlopen - LIBDL = DlLibrary -#endif - LIBREGEX = RegexLibrary - -#if DoLoadableServer - LIBCWRAPPER = os/libcwrapper.o -#endif - -#if BuildXprint - -XPCONFIGDIR = XpConfig - -#ifndef XpRasterDDX -#define XpRasterDDX YES -#endif -#ifndef XpColorPclDDX -#define XpColorPclDDX YES -#endif -#ifndef XpMonoPclDDX -#define XpMonoPclDDX NO -#endif -#ifndef XpPostScriptDDX -#define XpPostScriptDDX YES -#endif - -#if XpRasterDDX -XPRASTLIB = Xprint/raster/LibraryTargetName(raster) -#endif -#if XpColorPclDDX -XPPCLLIB = Xprint/pcl/LibraryTargetName(pcl) -#endif -#if XpMonoPclDDX -XPMPCLLIB = Xprint/pcl-mono/LibraryTargetName(pcl) -#endif -#if XpPostScriptDDX -XPPSLIB = Xprint/ps/LibraryTargetName(ps) -#endif - -XPDDXLIBS = Xprint/LibraryTargetName(printer) \ - $(XPRASTLIB) $(XPPCLLIB) $(XPMPCLLIB) $(XPPSLIB) -XPDDXFBLIBS = $(MFB) $(CFB32) -#if !PrintOnlyServer - XPFBLIBS = $(XPDDXFBLIBS) - XPDDX = $(XPDDXLIBS) -#endif - XPDDXDIR = Xprint -#endif -#if !BuildXprint || PrintOnlyServer -XPFBLIBS = dix/LibraryTargetName(xpstubs) -#endif - -#if BuildRender - RENDERDIR = render - RENDERLIB = $(RENDERDIR)/librender.a -#endif -#if BuildRandR - RANDRDIR = randr - RANDRLIB = $(RANDRDIR)/librandr.a -#endif -#if BuildXfixes - FIXESDIR = xfixes - FIXESLIB = $(FIXESDIR)/libxfixes.a -#endif -#if BuildDamage - DAMAGEDIR = damageext - DAMAGELIB = $(DAMAGEDIR)/libdamage.a -#endif -#if BuildComposite - CWDIR = miext/cw - COMPOSITEDIR = composite - COMPOSITELIB = $(COMPOSITEDIR)/libcomposite.a -#if DoLoadableServer - CW = miext/cw/ModuleLibraryTargetName(cw) -#else - CW = miext/cw/LibraryTargetName(cw) -#endif -#endif -#if DoLoadableServer - EXTENSIONS = $(COMPOSITELIB) $(DAMAGELIB) $(DAMAGE) $(FIXESLIB) $(CW) \ - $(OTHEREXTS) $(RANDRLIB) $(RENDERLIB) - LOADABLEEXTS = $(MISCEXT) $(DBEEXT) $(RECORDEXT) $(GLXEXT) $(XTRAPEXT) - MISCEXT = Xext/LibraryTargetName(ext) - OTHEREXTS = Xext/LibraryTargetName(exts) $(XKBEXT) $(XINPUTEXT) \ - $(LBXEXT) $(SITEEXTS) -#else - EXTENSIONS = $(COMPOSITELIB) $(DAMAGELIB) $(DAMAGE) $(FIXESLIB) $(CW) \ - $(OTHEREXTS) $(GLXEXT) $(RANDRLIB) $(RENDERLIB) - OTHEREXTS = Xext/LibraryTargetName(ext) $(XKBEXT) $(XINPUTEXT) \ - $(LBXEXT) $(DBEEXT) $(RECORDEXT) $(SITEEXTS) $(XTRAPEXT) -#endif - EXTDIRS = Xext $(XKBDIR) $(XIDIR) $(GLXDIR) \ - $(LBXDIRS) $(DBEDIR) $(RECORDDIR) $(SITEEXTDIRS) \ - $(RANDRDIR) $(RENDERDIR) $(XTRAPDIR) $(XPCONFIGDIR) \ - $(FIXESDIR) $(DAMAGEDIR) $(CWDIR) $(COMPOSITEDIR) -#if BuildLBX || GzipFontCompression - ZLIB = GzipLibrary -#endif - OS = os/LibraryTargetName(os) $(DEPXAUTHLIB) $(DEPXDMCPLIB) - BSDEMUL = $(DEPXBSDLIB) -#if DoLoadableServer - MFB = mfb/ModuleLibraryTargetName(mfb) - FB = fb/ModuleLibraryTargetName(fb) -#if XF8_32Wid - CFB = cfb/ModuleLibraryTargetName(cfb) \ - cfb16/ModuleLibraryTargetName(cfb16) \ - cfb24/ModuleLibraryTargetName(cfb24) \ - cfb32/ModuleLibraryTargetName(cfb32) -#else - CFB = cfb/ModuleLibraryTargetName(cfb) \ - cfb16/ModuleLibraryTargetName(cfb16) \ - cfb32/ModuleLibraryTargetName(cfb32) -#endif - CFB8 = cfb/ModuleLibraryTargetName(cfb) - CFB4 = cfb/ModuleLibraryTargetName(cfb) \ - cfb4/ModuleLibraryTargetName(cfb4) - CFB16 = cfb/ModuleLibraryTargetName(cfb) \ - cfb16/ModuleLibraryTargetName(cfb16) - CFB24 = cfb/ModuleLibraryTargetName(cfb) \ - cfb24/ModuleLibraryTargetName(cfb24) - CFB32 = cfb/ModuleLibraryTargetName(cfb) \ - cfb32/ModuleLibraryTargetName(cfb32) - DAMAGE = miext/damage/ModuleLibraryTargetName(damage) - SHADOW = miext/shadow/ModuleLibraryTargetName(shadow) - LAYER = miext/layer/ModuleLibraryTargetName(layer) -#else - MFB = mfb/LibraryTargetName(mfb) - FB = fb/LibraryTargetName(fb) -#if XF8_32Wid - CFB = cfb16/LibraryTargetName(cfb16) \ - cfb24/LibraryTargetName(cfb24) \ - cfb32/LibraryTargetName(cfb32) \ - cfb/LibraryTargetName(cfb) -#else - CFB = cfb16/LibraryTargetName(cfb16) \ - cfb32/LibraryTargetName(cfb32) \ - cfb/LibraryTargetName(cfb) -#endif - CFB8 = cfb/LibraryTargetName(cfb) - CFB4 = cfb4/LibraryTargetName(cfb4) \ - cfb/LibraryTargetName(cfb) - CFB16 = cfb16/LibraryTargetName(cfb16) \ - cfb/LibraryTargetName(cfb) - CFB24 = cfb24/LibraryTargetName(cfb24) \ - cfb/LibraryTargetName(cfb) - CFB32 = cfb32/LibraryTargetName(cfb32) \ - cfb/LibraryTargetName(cfb) - DAMAGE = miext/damage/LibraryTargetName(damage) - SHADOW = miext/shadow/LibraryTargetName(shadow) - LAYER = miext/layer/LibraryTargetName(layer) -#endif -#if !HasFfs && (defined(mingwArchitecture) || defined(cygwinArchitecture)) - /* Order of libraries is important when linking in mingw or - * cygwin. libmi.a requires ffs from libdix.a. So it is added - * after libmi.a on the commandline */ - MI = mi/LibraryTargetName(mi) $(DIX) -#else - MI = mi/LibraryTargetName(mi) -#endif - MIINITEXTOBJ = mi/miinitext.o - DIX = dix/LibraryTargetName(dix) - FONTBASE = $(FONTLIBSRC)/fontbase.o \ - $(FONTLIBSRC)/LibraryTargetName(fontbase) -#if XserverStaticFontLib - FONT = $(FONTLIBSRC)/LibraryTargetName(Xfont) $(FREETYPE2LIB) -#else - FONT = $(LDPRELIB) $(XFONTLIB) $(FREETYPE2LIB) -#endif - FONTLIBS = $(FONT) $(XPFBLIBS) -#if UsbMouseSupport -#if !HasLibUsb - USB = $(XF86OSSRC)/bsd/libusb/LibraryTargetName(usb) -#else - USB = UsbHidLib -#endif -#endif -#ifdef ServerExtraSysLibs - EXTRASYSLIBS = ServerExtraSysLibs -#endif -#if HasPam && HasPamMisc - PAMLIBS = PamLibraries PamMiscLibraries -#endif -#if !(SystemV4 || defined(SGIArchitecture) || UseRgbTxt) - DBMLIBS = DBMLibrary -#endif - SYSLIBS = $(ZLIB) MathLibrary Krb5Libraries $(DBMLIBS) $(USB) \ - $(PAMLIBS) $(EXTRASYSLIBS) -#if !HasCbrt - CBRT = mi/LibraryTargetName(cbrt) -#endif - STDDIRS = include dix os mi $(XPDDXDIR) $(EXTDIRS) - FBDIR = fb - MFBDIR = mfb - CFB4DIR = cfb4 - CFB8DIR = cfb - CFB16DIR = cfb16 - CFB24DIR = cfb24 - CFB32DIR = cfb32 - AFBDIR = afb - -XCOMM -XCOMM This turns off the default rule for compiling .c files because -XCOMM this makefile does not really know how to build it. This is really -XCOMM just a hack because of the Sun version of make and nfs. -XCOMM -.c.o: - -.s.o: - -/* Build rule blocks, add one for each server - * - * If a server needs mfb, its build block should have a line like: - * MFBSUBDIR = mfb - * Similarly, its build block should have: - * CFB4SUBDIR = cfb4 (if the server needs 4 bit cfb) - * CFB8SUBDIR = cfb (8 bit cfb) - * CFB16SUBDIR = cfb16 (16 bit cfb) - * CFB24SUBDIR = cfb24 (24 bit cfb) - * CFB32SUBDIR = cfb32 (32 bit cfb) - * - * If a server does not need all of the above components, simply - * omit the relevant lines from the build block. - * - * If these guidelines are followed, a make at the top of the server - * tree should result in each subdirectory being built only once, - * even if multiple servers that share subdirectories are being built. - */ - -#if defined(XdecServer) && XdecServer -XCOMM -XCOMM Digital MIPS based WS server (ultrix 4.2 and beyond) -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -DECWSDDXDIR = hw/dec/ws -DECDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(DECWSDDXDIR) $(DEPDIRS) -DECOBJS = hw/dec/ws/init.o hw/dec/ws/sdepthinit.o -DECLIBS = hw/dec/ws/LibraryTargetName(dec) CFB8Libs -ServerTarget(Xdec,$(DECDIRS),$(DECOBJS), \ - $(DECLIBS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xdec -#endif -#endif /* XdecServer */ - - -#if defined(XdecMultiDepthServer) && XdecMultiDepthServer -XCOMM -XCOMM Digital MIPS based WS server (ultrix 4.2 and beyond) -XCOMM Supports 8, 12, and 24 bit pixmaps -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -CFB24SUBDIR = cfb24 -CFB32SUBDIR = cfb32 -DECWSDDXDIR = hw/dec/ws -DECDIRS1 = $(STDDIRS) $(MFBDIR) \ - $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ - $(DECWSDDXDIR) $(DEPDIRS) -DECOBJS1 = hw/dec/ws/init.o hw/dec/ws/mdepthinit.o -DECLIBS1 = hw/dec/ws/LibraryTargetName(dec) CFBLibs -ServerTarget(Xdec_md,$(DECDIRS1),$(DECOBJS1), \ - $(DECLIBS1),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xdec_md -#endif -#endif /* XdecMultiDepthServer */ - - -#if defined(XsunServer) && XsunServer -XCOMM -XCOMM Sun server -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -SUNDDXDIR = hw/sun -#if DoLoadableServer -SUNOBJS = hw/sun/sunInit.o hw/sun/sunInitExt.o hw/sun/stubs.o -#elif (defined(XF86Server) && XF86Server) \ - || (defined(XorgServer) && XorgServer) -SUNOBJS = hw/sun/sunInit.o hw/sun/stubs.o -#else -SUNOBJS = hw/sun/sunInit.o -#endif -SUNDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(SUNDDXDIR) $(DEPDIRS) -SUNLIBS = hw/sun/LibraryTargetName(sun) CFB8Libs -SUNSYSLIBS = $(FONTLIBS) $(WIDECHARSYSLIB) $(SYSLIBS) -SetUIDServerTarget(Xsun,$(SUNDIRS),$(SUNOBJS), \ - $(LIBCWRAPPER) $(SUNLIBS) $(LOADABLEEXTS),$(SUNSYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xsun -#endif -#endif /* XsunServer */ - - -#if defined(Xsun24Server) && Xsun24Server -XCOMM -XCOMM Sun multiple pixmap depth (8, 12, 24) server -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -CFB24SUBDIR = cfb24 -CFB32SUBDIR = cfb32 -SUNDDXDIR = hw/sun -SUN24DIRS = $(STDDIRS) $(MFBDIR) \ - $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ - $(SUNDDXDIR) $(DEPDIRS) -#if DoLoadableServer -SUN24OBJS = hw/sun/sunInitMulti.o hw/sun/sunInitExt.o hw/sun/stubs.o -#elif defined(XF86Server) && XF86Server \ - || (defined(XorgServer) && XorgServer) -SUN24OBJS = hw/sun/sunInitMulti.o hw/sun/stubs.o -#else -SUN24OBJS = hw/sun/sunInitMulti.o -#endif -SUN24LIBS = hw/sun/LibraryTargetName(sun) CFBLibs -SetUIDServerTarget(Xsun24,$(SUN24DIRS),$(SUN24OBJS), \ - $(LIBCWRAPPER) $(SUN24LIBS) $(LOADABLEEXTS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xsun24 -#endif -#endif /* Xsun24Server */ - - -#if defined(XsunMonoServer) && XsunMonoServer -XCOMM -XCOMM Sun monochrome server -XCOMM -MFBSUBDIR = mfb -SUNDDXDIR = hw/sun -SUNMDIRS = $(STDDIRS) $(MFBDIR) $(SUNDDXDIR) $(DEPDIRS) -#if defined(XF86Server) && XF86Server \ - || (defined(XorgServer) && XorgServer) -SUNMOBJS = hw/sun/sunInitMono.o hw/sun/sunInExMono.o hw/sun/stubs.o -#else -SUNMOBJS = hw/sun/sunInitMono.o hw/sun/sunInExMono.o -#endif -SUNMLIBS = hw/sun/LibraryTargetName(sun) MFBBareLibs $(EXTENSIONS) -SetUIDServerTarget(XsunMono,$(SUNMDIRS),$(SUNMOBJS), \ - $(LIBCWRAPPER) $(SUNMLIBS) $(LOADABLEEXTS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall XsunMono -#endif -#endif /* XsunMonoServer */ - - -#if defined(XsunLynxServer) && XsunLynxServer -XCOMM -XCOMM Sun server for LynxOS microSPARC 2.4.0 -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -LYNXDDXDIR = hw/sunLynx -SUNDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(LYNXDDXDIR) $(DEPDIRS) -SUNOBJS = hw/sunLynx/sunLyInit.o -SUNLIBS = hw/sunLynx/libsun.a CFB8Libs -ServerTarget(Xsun,$(SUNDIRS),$(SUNOBJS), \ - $(SUNLIBS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xsun -#endif -#endif /* XsunLynxServer */ - - -#if defined(XsunLynxMonoServer) && XsunLynxMonoServer -XCOMM -XCOMM Sun monochrome server for LynxOS microSPARC 2.4.0 -XCOMM -MFBSUBDIR = mfb -LYNXDDXDIR = hw/sunLynx -SUNMDIRS = $(STDDIRS) $(MFBDIR) $(LYNXDDXDIR) $(DEPDIRS) -SUNMOBJS = hw/sunLynx/sunInitMono.o hw/sunLynx/sunInExMono.o -SUNMLIBS = hw/sunLynx/libsun.a MFBBareLibs $(OTHEREXTS) -ServerTarget(XsunMono,$(SUNMDIRS),$(SUNMOBJS), \ - $(SUNMLIBS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall XsunMono -#endif -#endif /* XsunLynxMonoServer */ - - -#if HasParallelMake -XCOMM -XCOMM force non-parallel build of XF86 servers to prevent MUTEX overrides -XCOMM -#if defined(XF86Server) && XF86Server -XF86SERVER = XFree86 -#endif -#if defined(XorgServer) && XorgServer -XF86SERVER = Xorg -#endif -#if defined(XnestServer) && XnestServer -XNEST = Xnext -#endif -#if defined(XVirtualFramebufferServer) && XVirtualFramebufferServer -XVFB = Xvfb -#endif -#if XdmxServer -XDMX = Xdmx -#endif -#if defined(XWinServer) && XWinServer && !MakeDllModules -XWIN = XWin -#endif -#if defined(NXAgentServer) && NXAgentServer -NXAGENT = nxagent -#endif -#if defined(NXWinServer) && NXWinServer && !MakeDllModules -NXWIN = NXWin -#endif -#if (defined(XF86Server) && XF86Server) || \ - (defined(XorgServer) && XorgServer) || \ - (defined(XnestServer) && XnestServer) || \ - (defined(NXAgentServer) && NXAgentServer) || \ - (defined(XVirtualFramebufferServer) && XVirtualFramebufferServer) || \ - (defined(XdmxServer) && XdmxServer) || \ - (!MakeDllModules && defined(XWinServer) && XWinServer) || \ - (!MakeDllModules && defined(NXWinServer) && NXWinServer) -MakeMutex($(XF86SERVER) $(XNEST) $(XVFB) $(XWIN) $(NXAGENT) $(NXWIN)) -#endif -MakeMutex($(STDDIRS) mfb fb cfb cfb16 cfb24 cfb32) -#endif - - -#if defined(XF86Server) && XF86Server -XCOMM -XCOMM XFree86 Server -XCOMM -FBSUBDIR = fb -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -CFB24SUBDIR = cfb24 -CFB32SUBDIR = cfb32 -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -LAYERDIR = miext/layer -#ifdef OS2Architecture -SERVERDEFFILE = XFree86.def -XNESTDEFFILE = Xnest.def -XVFBDEFFILE = Xvfb.def -#endif -#if XF86AFB -AFBSUBDIR = afb -#endif -XFREE86DDXDIR = hw/xfree86 -XF86SERVERSUBDIRS = $(STDDIRS) $(MFBDIR) $(FBDIR) $(AFBDIR) \ - $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ - $(SHADOWDIR) $(LAYERDIR) $(XFREE86DDXDIR) $(DEPDIRS) \ - $(MIDAMAGEDIR) -XF86INIT = $(XF86COMSRC)/xf86Init.o $(XF86COMSRC)/xf86IniExt.o -XF86COMLIB = $(XF86COMSRC)/LibraryTargetName(xf86) -XF86PARSLIB= $(XF86PARSERSRC)/LibraryTargetName(xf86config) -XF86OSLIB = $(XF86OSSRC)/LibraryTargetName(xf86_os) -#if XF86XAA -XF86XAALIB = $(XF86SRC)/xaa/LibraryTargetName(xaa) -#endif -#if XF86EXA -XF86EXALIB = $(XF86SRC)/exa/LibraryTargetName(exa) -#endif -#if XF86VgaHw -XF86VGAHWLIB = $(XF86SRC)/vgahw/LibraryTargetName(vgahw) -#endif -#if XF86FBDevHw -XF86FBDEVHWLIB = $(XF86SRC)/fbdevhw/LibraryTargetName(fbdevhw) -#endif -#if XF1Bpp || XF4Bpp -XF1BPPLIB = $(XF86SRC)/xf1bpp/LibraryTargetName(xf1bpp) -#endif -#if XF4Bpp -XF4BPPLIB = $(XF86SRC)/xf4bpp/LibraryTargetName(xf4bpp) -#endif -#if XF8_32Wid -XF8_32WIDLIB = $(XF86SRC)/xf8_32wid/LibraryTargetName(xf8_32wid) -#endif -#if XF8_32Bpp -XF8_32BPPLIB = $(XF86SRC)/xf8_32bpp/LibraryTargetName(xf8_32bpp) -#endif -#if XF8_16Bpp -XF8_16BPPLIB = $(XF86SRC)/xf8_16bpp/LibraryTargetName(xf8_16bpp) -#endif -#if XFShadowFB -XFSHADOWFBLIB = $(XF86SRC)/shadowfb/LibraryTargetName(shadowfb) -#endif -#if XF86AFB -AFBLIB = afb/LibraryTargetName(afb) -#endif -XF86DRIVERLIB = $(XF86SRC)/drivers/LibraryTargetName(driver) -#if XF86Ramdac -XF86RAMDACLIB = $(XF86SRC)/ramdac/LibraryTargetName(ramdac) -#endif -#if XF86I2C -XF86I2CLIB = $(XF86SRC)/i2c/LibraryTargetName(i2c) -#endif -#if XF86DDC -XF86DDCLIB = $(XF86SRC)/ddc/LibraryTargetName(ddc) -#endif -#if XF86VBE -XF86VBELIB = $(XF86SRC)/vbe/LibraryTargetName(vbe) -#endif -#if XF86RAC -XF86RACLIB = $(XF86SRC)/rac/LibraryTargetName(rac) -#endif -#if XF86INT10_BUILD > X86EMU_GENERIC -XF86INT10LIB = $(XF86OSSRC)/LibraryTargetName(int10) -#else -XF86INT10LIB = $(XF86SRC)/int10/LibraryTargetName(int10) -#endif -#if UseMemLeak -MEMDEBUGLIB = $(TOP)/util/memleak/LibraryTargetName(memleak) -#endif -XF86IDRIVERLIB = $(XF86SRC)/input/LibraryTargetName(idriver) -#if !DoLoadableServer -XF86DRVOBJS = $(XF86SRC)/drivers/drvConf.o -XF86DRVLIBS = $(XF86DRIVERLIB) $(XF86RAMDACLIB) $(XF86DDCLIB) $(XF86I2CLIB) \ - $(XF86XAALIB) $(XF86EXALIB) $(XF86VGAHWLIB) $(XF86FBDEVHWLIB) \ - $(XF8_32WIDLIB) $(XF8_32BPPLIB) \ - $(XF8_16BPPLIB) \ - $(XF4BPPLIB) $(XF1BPPLIB) $(XFSHADOWFBLIB) $(AFBLIB) -XF86IDRVOBJS = $(XF86SRC)/input/drvConf.o -XF86IDRVLIBS = $(XF86IDRIVERLIB) -XF86SCANLIB = $(XF86SRC)/scanpci/LibraryTargetName(scanpci) -XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) $(XF86RACLIB) \ - $(XF86PARSLIB) $(XF86VBELIB) $(XF86OSLIB) $(XF86INT10LIB) -#else -XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) \ - $(XF86PARSLIB) $(XF86OSLIB) -#endif -#if DoLoadableServer -XF86LOADERLIB = $(XF86SRC)/loader/LibraryTargetName(loader) -XF86MAINLIBS = PreFbLibsNoFont \ - $(FONTBASE) $(OTHEREXTS) $(XF86COMLIB) \ - NoMfbPostFbLibs -XF86SERVERSYSLIBS = $(SYSLIBS) $(LIBDL) $(LIBREGEX) -XF86SERVERLIBS = $(XF86DRVLIBS) $(XF86IDRVLIBS) $(XF86LIBS) $(XF86LOADERLIB) \ - $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB) -#else -XF86MAINLIBS = MiExtLibs AllFBLibs $(XF86COMLIB) $(MI) -XF86SERVERSYSLIBS = $(FONTLIBS) $(SYSLIBS) $(LIBDL) $(LIBREGEX) -XF86SERVERLIBS = $(XF86DRVLIBS) $(XF86IDRVLIBS) $(XF86LIBS) $(XF86LOADERLIB) \ - $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB) \ - $(XF86DDCLIB) -#endif -XF86SERVEROBJS = $(XF86XKBOBJS) $(XF86DRVOBJS) $(XF86IDRVOBJS) -#if HasParallelMake -MakeMutex($(XF86SERVERSUBDIRS) $(XF86SERVERLIBS) $(XF86SERVERSYSLIBS)) -#endif -#if ForceServerRemake -$(XF86SERVERLIBS) $(XF86SERVERSYSLIBS):: $(XF86SERVERSUBDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -SetUIDServerTarget(XFree86,$(XF86SERVERSUBDIRS),$(XF86SERVEROBJS) $(SERVERDEFFILE), \ - $(XF86SERVERLIBS),$(XF86SERVERSYSLIBS)) -#if DoLoadableServer -ServerDriverSDKTarget(XFree86) -#endif -#ifndef ServerToInstall -#define ServerToInstall XFree86 -#endif -#endif /* XF86Server */ - -#if defined(XorgServer) && XorgServer -XCOMM -XCOMM Xorg Server -XCOMM -FBSUBDIR = fb -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -#if XF8_32Wid -CFB24SUBDIR = cfb24 -#endif -CFB32SUBDIR = cfb32 -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -LAYERDIR = miext/layer -#ifdef OS2Architecture -SERVERDEFFILE = Xorg.def -XNESTDEFFILE = Xnest.def -XVFBDEFFILE = Xvfb.def -#endif -#if XF86AFB -AFBSUBDIR = afb -#endif -XFREE86DDXDIR = hw/xfree86 -XF86SERVERSUBDIRS = $(STDDIRS) $(MFBDIR) $(FBDIR) $(AFBDIR) \ - $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ - $(SHADOWDIR) $(LAYERDIR) $(XFREE86DDXDIR) $(DEPDIRS) \ - $(MIDAMAGEDIR) -XF86INIT = $(XF86COMSRC)/xf86Init.o $(XF86COMSRC)/xf86IniExt.o -XF86COMLIB = $(XF86COMSRC)/LibraryTargetName(xf86) -XF86PARSLIB= $(XF86PARSERSRC)/LibraryTargetName(xf86config) -XF86OSLIB = $(XF86OSSRC)/LibraryTargetName(xf86_os) -#if XF86XAA -XF86XAALIB = $(XF86SRC)/xaa/LibraryTargetName(xaa) -#endif -#if XF86EXA -XF86EXALIB = $(XF86SRC)/exa/LibraryTargetName(exa) -#endif -#if XF86VgaHw -XF86VGAHWLIB = $(XF86SRC)/vgahw/LibraryTargetName(vgahw) -#endif -#if XF86FBDevHw -XF86FBDEVHWLIB = $(XF86SRC)/fbdevhw/LibraryTargetName(fbdevhw) -#endif -#if XF1Bpp || XF4Bpp -XF1BPPLIB = $(XF86SRC)/xf1bpp/LibraryTargetName(xf1bpp) -#endif -#if XF4Bpp -XF4BPPLIB = $(XF86SRC)/xf4bpp/LibraryTargetName(xf4bpp) -#endif -#if XF8_32Wid -XF8_32WIDLIB = $(XF86SRC)/xf8_32wid/LibraryTargetName(xf8_32wid) -#endif -#if XF8_32Bpp -XF8_32BPPLIB = $(XF86SRC)/xf8_32bpp/LibraryTargetName(xf8_32bpp) -#endif -#if XF8_16Bpp -XF8_16BPPLIB = $(XF86SRC)/xf8_16bpp/LibraryTargetName(xf8_16bpp) -#endif -#if XFShadowFB -XFSHADOWFBLIB = $(XF86SRC)/shadowfb/LibraryTargetName(shadowfb) -#endif -#if XF86AFB -AFBLIB = afb/LibraryTargetName(afb) -#endif -XF86DRIVERLIB = $(XF86SRC)/drivers/LibraryTargetName(driver) -#if XF86Ramdac -XF86RAMDACLIB = $(XF86SRC)/ramdac/LibraryTargetName(ramdac) -#endif -#if XF86I2C -XF86I2CLIB = $(XF86SRC)/i2c/LibraryTargetName(i2c) -#endif -#if XF86DDC -XF86DDCLIB = $(XF86SRC)/ddc/LibraryTargetName(ddc) -#endif -#if XF86VBE -XF86VBELIB = $(XF86SRC)/vbe/LibraryTargetName(vbe) -#endif -#if XF86RAC -XF86RACLIB = $(XF86SRC)/rac/LibraryTargetName(rac) -#endif -#if XF86INT10_BUILD > X86EMU_GENERIC -XF86INT10LIB = $(XF86OSSRC)/LibraryTargetName(int10) -#else -XF86INT10LIB = $(XF86SRC)/int10/LibraryTargetName(int10) -#endif -#if UseMemLeak -MEMDEBUGLIB = $(TOP)/util/memleak/LibraryTargetName(memleak) -#endif -XF86IDRIVERLIB = $(XF86SRC)/input/LibraryTargetName(idriver) -#if !DoLoadableServer -XF86DRVOBJS = $(XF86SRC)/drivers/drvConf.o -XF86DRVLIBS = $(XF86DRIVERLIB) $(XF86RAMDACLIB) $(XF86DDCLIB) $(XF86I2CLIB) \ - $(XF86XAALIB) $(XF86EXALIB) $(XF86VGAHWLIB) $(XF86FBDEVHWLIB) \ - $(XF8_32WIDLIB) $(XF8_32BPPLIB) \ - $(XF8_16BPPLIB) \ - $(XF4BPPLIB) $(XF1BPPLIB) $(XFSHADOWFBLIB) $(AFBLIB) -XF86IDRVOBJS = $(XF86SRC)/input/drvConf.o -XF86IDRVLIBS = $(XF86IDRIVERLIB) -XF86SCANLIB = $(XF86SRC)/scanpci/LibraryTargetName(scanpci) -XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) $(XF86RACLIB) \ - $(XF86PARSLIB) $(XF86VBELIB) $(XF86OSLIB) $(XF86INT10LIB) -#else -XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) \ - $(XF86PARSLIB) $(XF86OSLIB) -#endif -#if DoLoadableServer -XF86LOADERLIB = $(XF86SRC)/loader/LibraryTargetName(loader) -XF86MAINLIBS = PreFbLibsNoFont \ - $(FONTBASE) $(OTHEREXTS) $(XF86COMLIB) \ - NoMfbPostFbLibs -XF86SERVERSYSLIBS = $(SYSLIBS) $(LIBDL) $(LIBREGEX) -XF86SERVERLIBS = $(XF86DRVLIBS) $(XF86IDRVLIBS) $(XF86LIBS) $(XF86LOADERLIB) \ - $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB) -#else -XF86MAINLIBS = MiExtLibs AllFBLibs $(XF86COMLIB) $(MI) -XF86SERVERSYSLIBS = $(FONTLIBS) $(SYSLIBS) $(LIBDL) $(LIBREGEX) -XF86SERVERLIBS = $(XF86DRVLIBS) $(XF86IDRVLIBS) $(XF86LIBS) $(XF86LOADERLIB) \ - $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB) \ - $(XF86DDCLIB) -#endif -XF86SERVEROBJS = $(XF86XKBOBJS) $(XF86DRVOBJS) $(XF86IDRVOBJS) -#if HasParallelMake -MakeMutex($(XF86SERVERSUBDIRS) $(XF86SERVERLIBS) $(XF86SERVERSYSLIBS)) -#endif -#if ForceServerRemake -$(XF86SERVERLIBS) $(XF86SERVERSYSLIBS):: $(XF86SERVERSUBDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -SetUIDServerTarget(Xorg,$(XF86SERVERSUBDIRS),$(XF86SERVEROBJS) $(SERVERDEFFILE), \ - $(XF86SERVERLIBS),$(XF86SERVERSYSLIBS)) -#if DoLoadableServer -ServerDriverSDKTarget(Xorg) -#endif -#ifndef ServerToInstall -#define ServerToInstall Xorg -#endif -#endif /* XorgServer */ - -#if defined(XprtServer) && XprtServer -XCOMM -XCOMM Print Server -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB32SUBDIR = cfb32 -MIDAMAGEDIR = miext/damage -XPSUBDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(CFB32DIR) $(DEPDIRS) \ - $(MIDAMAGEDIR) -XPOBJS = Xprint/ddxInit.o Xprint/dpmsstubs.o Xprint/miinitext.o -#if PrintOnlyServer -XPLIBS = PreFbLibs $(XPDDXLIBS) $(XPDDXFBLIBS) PostFbLibs -#else -XPLIBS = PreFbLibs PostFbLibs -#endif -#if (defined(SunArchitecture) || defined(SparcArchitecture)) && \ - defined(SVR4Architecture) -XPSYSLIBS = $(FONTLIBS) $(CBRT) $(SYSLIBS) $(XONLYLIB) -lw -#else -XPSYSLIBS = $(FONTLIBS) $(CBRT) $(SYSLIBS) $(XONLYLIB) -#endif -#if HasParallelMake -MakeMutex($(XPSUBDIRS) $(XPOBJS) $(XPLIBS) $(XPSYSLIBS)) -#endif -#if ForceServerRemake -$(XPOBJS) $(XPLIBS) $(XPSYSLIBS):: $(XPSUBDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -ServerTarget(Xprt,$(XPSUBDIRS),$(XPOBJS), \ - $(LIBCWRAPPER) $(XPLIBS) $(LOADABLEEXTS),$(XPSYSLIBS)) -#endif /* XprtServer */ - -#if defined(XnestServer) && XnestServer -XCOMM -XCOMM Server with Xlib-based ddx -XCOMM -#ifndef Win32Architecture -XNESTDDXDIR = hw/xnest -#else -XNESTDDXDIR = hw -#endif -#if BuildDPMS -XNESTDPMSSTUBOBJS = $(XNESTDDXDIR)/dpmsstubs.o -#endif -XNESTDIRS = $(STDDIRS) $(XNESTDDXDIR) $(DEPDIRS) -#if !defined(LynxOSArchitecture) && \ - !defined(Win32Architecture) && \ - !defined(QNX4Architecture) -XNESTOBJS = hw/xnest/miinitext.o $(XNESTDPMSSTUBOBJS) -#else -XNESTOBJS = hw/xnest/miinitext.o dix/main.o $(XNESTDPMSSTUBOBJS) -#endif -XNEST = hw/xnest/LibraryTargetName(xnest) -XNESTLIBS = PreFbLibs $(XNEST) NoMfbPostFbLibs $(XNEST) -XNESTSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XLIB) $(SYSLIBS) -#if HasParallelMake -MakeMutex($(XNESTDIRS) $(XNESTOBJS) $(XNESTLIBS) $(XNESTSYSLIBS)) -#endif -#if ForceServerRemake -$(XNESTOBJS) $(XNESTLIBS) $(XNESTSYSLIBS):: $(XNESTDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -ServerTarget(Xnest,$(XNESTDIRS),$(XNESTOBJS) $(XNESTDEFFILE), \ - $(LIBCWRAPPER) $(XNESTLIBS) $(LOADABLEEXTS),$(XNESTSYSLIBS)) -#endif /* XnestServer */ - -#if defined(NXAgentServer) && NXAgentServer -XCOMM -XCOMM Nested server with NXlib-based ddx and compressed transport. -XCOMM -FBSUBDIR = fb -MIDAMAGEDIR = miext/damage -FBDIR = fb -#ifndef Win32Architecture -NXAGENTDDXDIR = hw/nxagent -#else -NXAGENTDDXDIR = hw -#endif - -NXAGENTDIRS = $(STDDIRS) $(MFBDIR) $(FBDIR) $(MIDAMAGEDIR) $(NXAGENTDDXDIR) $(DEPDIRS) - -#if defined(SunArchitecture) || \ - defined(SparcArchitecture) -NXAGENTOBJS = hw/nxagent/miinitext.o \ - hw/nxagent/NXwindow.o \ - hw/nxagent/NXevents.o \ - hw/nxagent/NXproperty.o \ - hw/nxagent/NXdixfonts.o \ - hw/nxagent/NXglyphcurs.o \ - hw/nxagent/NXdispatch.o \ - hw/nxagent/NXrender.o \ - hw/nxagent/NXglyph.o \ - hw/nxagent/NXpicture.o \ - hw/nxagent/NXextension.o \ - hw/nxagent/NXglxext.o \ - hw/nxagent/NXmiglyph.o \ - hw/nxagent/NXmiexpose.o \ - hw/nxagent/NXresource.o \ - hw/nxagent/NXmiwindow.o \ - hw/nxagent/NXdamage.o -#elif !defined(LynxOSArchitecture) && \ - !defined(Win32Architecture) && \ - !defined(QNX4Architecture) -NXAGENTOBJS = hw/nxagent/miinitext.o \ - hw/nxagent/NXwindow.o \ - hw/nxagent/NXevents.o \ - hw/nxagent/NXproperty.o \ - hw/nxagent/NXdixfonts.o \ - hw/nxagent/NXglyphcurs.o \ - hw/nxagent/NXdispatch.o \ - hw/nxagent/NXrender.o \ - hw/nxagent/NXglyph.o \ - hw/nxagent/NXpicture.o \ - hw/nxagent/NXextension.o \ - hw/nxagent/NXglxext.o \ - hw/nxagent/NXxvdisp.o \ - hw/nxagent/NXmiglyph.o \ - hw/nxagent/NXmiexpose.o \ - hw/nxagent/NXresource.o \ - hw/nxagent/NXmiwindow.o \ - hw/nxagent/NXdamage.o -#else -NXAGENTOBJS = hw/nxagent/miinitext.o \ - hw/nxagent/NXwindow.o \ - hw/nxagent/NXevents.o \ - hw/nxagent/NXproperty.o \ - hw/nxagent/NXdixfonts.o \ - hw/nxagent/NXglyphcurs.o \ - hw/nxagent/NXdispatch.o \ - hw/nxagent/NXrender.o \ - hw/nxagent/NXglyph.o \ - hw/nxagent/NXpicture.o \ - hw/nxagent/NXextension.o \ - hw/nxagent/NXglxext.o \ - hw/nxagent/NXxvdisp.o \ - hw/nxagent/NXmiglyph.o \ - hw/nxagent/NXmiexpose.o \ - hw/nxagent/NXresource.o \ - hw/nxagent/NXmiwindow.o \ - hw/nxagent/NXdamage.o \ - dix/main.o -#endif - -XPMLIB = -lXpm -NXAGENT = hw/nxagent/LibraryTargetName(nxagent) -NXAGENTLIBS = PreFbLibs $(NXAGENT) FbPostFbLibs $(NXAGENT) $(MI) -NXAGENTSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XLIB) $(SYSLIBS) $(XPMLIB) -#if HasParallelMake -MakeMutex($(NXAGENTDIRS) $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS)) -#endif -#if ForceServerRemake -$(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS):: $(NXAGENTDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -#if NXLibraries -/* - * We need this as the linker will try to locate dependencies of X11 and Xext. - */ - -#if defined(SunArchitecture) -NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ - -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lXrender -lXfixes \ - -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -#elif defined(cygwinArchitecture) -NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ - -lXcomp -lXcompext -lXrender -lX11 -lXext -lXcomposite -lXfixes \ - -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -#else -NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ - -lXcomp -lXcompext -lXcompshad -lXrender -lX11 -lXext -lXfixes \ - -L../../../nx-X11/exports/lib -lXtst -lXdamage -lXrandr -lXcomposite -#endif - -#endif - -#ifdef cygwinArchitecture -NX_XSHADOWLIBNAME = cygXcompshad.dll -#else -NX_XSHADOWLIBNAME = libXcompshad.so -#endif - -NX_XSHADOWLIBDIR = $(XTOP)/../nxcompshad -NX_XSHADOWLIBTARGET = $(NX_XSHADOWLIBDIR)/$(NX_XSHADOWLIBNAME) -NX_XSHADOWCONFIGTARGET = $(NX_XSHADOWLIBDIR)/config.status - -$(NX_XSHADOWCONFIGTARGET): - cd $(NX_XSHADOWLIBDIR) && \ - ./configure - -#ifdef SunArchitecture -$(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) - cd $(NX_XSHADOWLIBDIR) && \ - gmake -#else -$(NX_XSHADOWLIBTARGET): $(NX_XSHADOWCONFIGTARGET) - cd $(NX_XSHADOWLIBDIR) && \ - make -#endif - -ServerTarget(nxagent,$(NX_XSHADOWLIBTARGET) $(NXAGENTDIRS),$(NXAGENTOBJS), \ - $(LIBCWRAPPER) $(NXAGENTLIBS) $(LOADABLEEXTS),$(NXAGENTSYSLIBS) $(NXAGENTNXLIBS)) - -/* - * Hard coded target to build a static nxagent server. - */ -nxagent_static: nxagent - if [ -f nxagent_static ]; then set -x; \ - $(MV) nxagent_static nxagent_static.bak; \ - else exit 0; fi - $(CCLINK) -o nxagent_static -static $(LDOPTIONS) $(NXAGENTOBJS) \ - $(LIBCWRAPPER) $(NXAGENTLIBS) $(LOADABLEEXTS) $(LDLIBS) \ - $(NXAGENTSYSLIBS) $(EXTRA_LOAD_FLAGS) - -/* - * Hard coded target to build a static nxagent server except for libX11 and libXext. - */ -nxagent_static_nolibs: nxagent - if [ -f nxagent_static_nolibs ]; then set -x; \ - $(MV) nxagent__static_nolibs nxagent_static_nolibs.bak; \ - else exit 0; fi - $(CCLINK) -o nxagent_static_nolibs -Wl,-Bstatic $(LDOPTIONS) $(NXAGENTOBJS) \ - $(NXAGENTLIBS) $(LOADABLEEXTS) $(LIBCWRAPPER) $(LDLIBS) $(FONTLIBS) \ - $(LDPRELIBS) $(SYSLIBS) -Wl,-Bdynamic -lXext -lX11 $(EXTRA_LOAD_FLAGS) -#endif /* NXAgentServer */ - -#if defined(XnonServer) && XnonServer -XCOMM -XCOMM non server, just compile sources for build test -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -CFB32SUBDIR = cfb32 -#if HasParallelMake -MakeMutex($(STDDIRS) $(MFBDIR) $(CFB8DIR) $(CFB16DIR) $(CFB32DIR) $(DEPDIRS)) -#endif -Xnon: $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(CFB16DIR) $(CFB32DIR) $(DEPDIRS) -#endif /* XnonServer */ - - -#if defined(XVirtualFramebufferServer) && XVirtualFramebufferServer -XCOMM -XCOMM server with Virtual (malloced) framebuffer -XCOMM -MFBSUBDIR = mfb -FBSUBDIR = fb -#if defined(Win32Architecture) -XVFBDDXDIR = hw -#else -XVFBDDXDIR = hw/vfb -#endif -XVFBDIRS = $(STDDIRS) $(MFBDIR) $(FBDIR) $(XVFBDDXDIR) $(DEPDIRS) -#ifndef Win32Architecture -#if BuildDPMS -XVFBDPMSSTUBOBJS = $(XVFBDDXDIR)/dpmsstubs.o -#endif -XVFBOBJS = $(XVFBDDXDIR)/stubs.o $(XVFBDDXDIR)/miinitext.o $(XVFBDPMSSTUBOBJS) -#else -XVFBOBJS = dix/main.o hw/vfb/stubs.o hw/vfb/miinitext.o -#endif -XVFB = $(XVFBDDXDIR)/LibraryTargetName(vfb) -XVFBLIBS = PreFbLibs $(XVFB) $(FB) PostFbLibs $(MI) -XVFBSYSLIBS = $(FONTLIBS) $(SYSLIBS) -#if HasParallelMake -MakeMutex($(XVFBDIRS) $(XVFBOBJS) $(XVFB) $(XVFBLIBS) $(XVFBSYSLIBS)) -#endif -#if ForceServerRemake -$(XVFBOBJS) $(XVFB) $(XVFBLIBS) $(XVFBSYSLIBS):: $(XVFBDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -ServerTarget(Xvfb,$(XVFBDIRS),$(XVFBOBJS) $(XVFBDEFFILE), \ - $(LIBCWRAPPER) $(XVFBLIBS) $(LOADABLEEXTS),$(XVFBSYSLIBS)) -#endif /* XVirtualFramebufferServer */ - -#if defined(XdmxServer) && XdmxServer -XCOMM -XCOMM distribued multihead Server -XCOMM -#ifndef Win32Architecture -XDMXDDXDIR = hw/dmx -#else -XDMXDDXDIR = hw -#endif -FBDIR = fb -FBSUBDIR = fb -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -XDMXDIRS = $(STDDIRS) $(XDMXDDXDIR) $(SHADOWDIR) $(DEPDIRS) $(FBDIR) $(MIDAMAGEDIR) -#if BuildGlxExt -#if BuildXinerama -GLXPROXY_EXTRAOBJS = hw/dmx/panoramiX.o -#endif -GLXPROXYLIB = hw/dmx/glxProxy/LibraryTargetName(glxProxy) -#endif -#if !defined(LynxOSArchitecture) && \ - !defined(Win32Architecture) && \ - !defined(QNX4Architecture) -XDMXOBJS = hw/dmx/miinitext.o $(GLXPROXY_EXTRAOBJS) -#else -XDMXOBJS = hw/dmx/miinitext.o $(GLXPROXY_EXTRAOBJS) dix/main.o -#endif -XDMX = hw/dmx/LibraryTargetName(dmx) \ - hw/dmx/input/LibraryTargetName(dmxinput) \ - hw/dmx/config/LibraryTargetName(dmxconfig) \ - $(GLXPROXYLIB) -XDMXLIBS = PreFbLibs $(XDMX) MiExtLibs FbPostFbLibs $(XDMX) -#if BuildRender -XDMXRENDERLIB = $(XRENDERLIB) -#endif -XDMXSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XILIB) $(XLIB) $(SYSLIBS) $(XMULIB) $(XDMXRENDERLIB) -#if HasParallelMake -MakeMutex($(XDMXDIRS) $(XDMXOBJS) $(XDMXLIBS) $(XDMXSYSLIBS)) -#endif -#if ForceServerRemake -$(XDMXOBJS) $(XDMXLIBS) $(XDMXSYSLIBS):: $(XDMXDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -ServerTarget(Xdmx,$(XDMXDIRS),$(XDMXOBJS), \ - $(LIBCWRAPPER) $(XDMXLIBS) $(LOADABLEEXTS),$(XDMXSYSLIBS)) -#endif /* XdmxServer */ - -#if defined(XWinServer) && XWinServer -XCOMM -XCOMM X Server for MS Windows -XCOMM -FBSUBDIR = fb -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -#if BuildXWinLayer -LAYERDIR = miext/layer -XWINLAYERLIB = $(LAYER) -#else -LAYERDIR = -XWINLAYERLIB = -#endif -#if BuildXWinMultiWindowExtWM -ROOTLESSDIR = miext/rootless -ROOTLESSLIB = $(ROOTLESSDIR)/LibraryTargetName(rootless) \ - $(ROOTLESSDIR)/safeAlpha/LibraryTargetName(safeAlpha) \ - $(ROOTLESSDIR)/accel/LibraryTargetName(rlAccel) -#else -ROOTLESSDIR = -ROOTLESSLIB = -#endif -XWINDDXDIR = hw/xwin -#if BuildXWinXF86Config -XWINPARSERDIR = hw/xfree86/parser -XWINPARSERLIB = $(XWINPARSERDIR)/LibraryTargetName(xf86config) -#else -XWINPARSERDIR = -XWINPARSERLIB = -#endif -#if defined(GlxUseWindows) && GlxUseWindows -XWINOPENGLLIB = -lopengl32 -#else -XWINOPENGLLIB = -#endif - -XWINLIB = $(XWINDDXDIR)/LibraryTargetName(XWin) -XWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(LAYERDIR) $(XWINDDXDIR) \ - $(DEPDIRS) $(XWINPARSERDIR) $(ROOTLESSDIR) $(MIDAMAGEDIR) -XWINOBJS = $(XWINDDXDIR)/stubs.o $(XWINDDXDIR)/XWin.res -XWINLIBS = PreFbLibs $(XWINLIB) FbPostFbLibs $(XWINLIB) $(XWINLAYERLIB) \ - $(SHADOW) $(XWINPARSERLIB) $(ROOTLESSLIB) $(OS) -#if BuildXWinMultiWindow || BuildXWinClipboard -XWINX11 = $(XONLYLIB) -# if defined(Win32Architecture) -PTHREADLIB = -lpthreadGC2 -# endif -#endif -#if defined(Win32Architecture) -# if defined(GlxUseWindows) && GlxUseWindows -XWINGL32 = -lopengl32 -# endif -XWINW32 = -lgdi32 -lwsock32 $(XWINGL32) $(PTHREADLIB) -#else -XWINW32 = -lgdi32 -#endif -XWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XWINX11) $(SYSLIBS) $(XWINW32) - -EXTRA_LDOPTIONS = -e _mainCRTStartup - -#if HasParallelMake -MakeMutex($(XWINDIRS) $(XWINOBJS) $(XWINLIB) $(XWINLIBS) $(XWINSYSLIBS)) -#endif - -#if ForceServerRemake -$(XWINOBJS) $(XWINLIB) $(XWINLIBS) $(XWINSYSLIBS):: $(XWINDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif - -#ifdef mingwArchitecture -XWINSERVERNAME=Xming -XWINGLSERVERNAME=XmingGL -#else -XWINSERVERNAME=XWin -XWINGLSERVERNAME=XWin_GL -#endif -ServerTarget($(XWINSERVERNAME),$(XWINDIRS),$(XWINOBJS), \ - $(LIBCWRAPPER) $(XWINLIBS) $(LOADABLEEXTS),$(XWINSYSLIBS)) -#if defined(cygwinArchitecture) && defined(GlxUseWindows) && GlxUseWindows -ServerTarget($(XWINGLSERVERNAME),$(XWINDIRS),$(XWINOBJS), \ - $(LIBCWRAPPER) $(XWINLIBS) $(LOADABLEEXTS),$(XWINSYSLIBS) \ - $(XWINOPENGLLIB)) -#endif - -#ifndef ServerToInstall -# define ServerToInstall $(XWINSERVERNAME) -#endif - -#endif /* XWinServer */ - - -#if defined(NXWinServer) && NXWinServer -XCOMM -XCOMM X Server for MS Windows -XCOMM -FBSUBDIR = fb -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -#if BuildXWinLayer -LAYERDIR = miext/layer -XWINLAYERLIB = $(LAYER) -#else -LAYERDIR = -XWINLAYERLIB = -#endif -#if BuildXWinMultiWindowExtWM -ROOTLESSDIR = miext/rootless -ROOTLESSLIB = $(ROOTLESSDIR)/LibraryTargetName(rootless) \ - $(ROOTLESSDIR)/safeAlpha/LibraryTargetName(safeAlpha) \ - $(ROOTLESSDIR)/accel/LibraryTargetName(rlAccel) -#else -ROOTLESSDIR = -ROOTLESSLIB = -#endif -NXWINDDXDIR = hw/nxwin -#if BuildXWinXF86Config -XWINPARSERDIR = hw/xfree86/parser -XWINPARSERLIB = $(XWINPARSERDIR)/LibraryTargetName(xf86config) -#else -XWINPARSERDIR = -XWINPARSERLIB = -#endif -#if defined(GlxUseWindows) && GlxUseWindows -XWINOPENGLLIB = -lopengl32 -#else -XWINOPENGLLIB = -#endif - -NXWINLIB = $(NXWINDDXDIR)/LibraryTargetName(NXWin) -NXWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(LAYERDIR) $(NXWINDDXDIR) \ - $(DEPDIRS) $(XWINPARSERDIR) $(ROOTLESSDIR) $(MIDAMAGEDIR) -NXWINOBJS = $(NXWINDDXDIR)/stubs.o $(NXWINDDXDIR)/NXWin.res -NXWINLIBS = PreFbLibs $(NXWINLIB) FbPostFbLibs $(NXWINLIB) $(XWINLAYERLIB) \ - $(SHADOW) $(XWINPARSERLIB) $(ROOTLESSLIB) $(OS) -#if BuildXWinMultiWindow || BuildXWinClipboard -XWINX11 = $(XONLYLIB) -# if defined(Win32Architecture) -PTHREADLIB = -lpthreadGC -# endif -#endif -#if defined(Win32Architecture) -# if defined(GlxUseWindows) && GlxUseWindows -XWINGL32 = -lopengl32 -# endif -XWINW32 = -lgdi32 -lwsock32 $(XWINGL32) $(PTHREADLIB) -#else -XWINW32 = -lgdi32 -#endif -NXWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XWINX11) $(SYSLIBS) $(XWINW32) - -NXWINNXLIBS = -L../../../nxcomp -lXcomp - -/* - * These flags cause NXWin.exe to be a Windows executable, which - * prevents NXWin.exe from opening a Command Prompt window when it is - * started. However, the flags also prevent NXWin.exe from outputting - * its status and error message to a Command Prompt; thus, one most - * implement a method to redirect status and error messages to a file - * before enabling these flags. - */ -EXTRA_LDOPTIONS = -e _mainCRTStartup - -#if HasParallelMake -MakeMutex($(NXWINDIRS) $(NXWINOBJS) $(NXWINLIB) $(NXWINLIBS) $(NXWINSYSLIBS) $(NXWINNXLIBS)) -#endif - -#if ForceServerRemake -$(NXWINOBJS) $(NXWINLIB) $(NXWINLIBS) $(NXWINSYSLIBS) $(NXWINNXLIBS):: $(NXWINDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif - -#ifdef mingwArchitecture -NXWINSERVERNAME=NXming -NXWINGLSERVERNAME=NXmingGL -#else -NXWINSERVERNAME=NXWin -NXWINGLSERVERNAME=NXWin_GL -#endif -ServerTarget($(NXWINSERVERNAME),$(NXWINDIRS),$(NXWINOBJS), \ - $(LIBCWRAPPER) $(NXWINLIBS) $(LOADABLEEXTS),$(NXWINSYSLIBS) $(NXWINNXLIBS)) -#if defined(cygwinArchitecture) && defined(GlxUseWindows) && GlxUseWindows -ServerTarget($(NXWINGLSERVERNAME),$(NXWINDIRS),$(NXWINOBJS), \ - $(LIBCWRAPPER) $(NXWINLIBS) $(LOADABLEEXTS),$(NXWINSYSLIBS) $(NXWINNXLIBS)\ - $(XWINOPENGLLIB)) -#endif - -#ifndef ServerToInstall -# define ServerToInstall $(NXWINSERVERNAME) -#endif - -#endif /* NXWinServer */ - -#if 0 -#if defined(NXWinServer) && NXWinServer -XCOMM -XCOMM X Server for MS Windows -XCOMM -FBDIR = fb -SHADOWDIR = miext/shadow -LAYERDIR = miext/layer -NXWINDDXDIR = hw/nxwin -XWINPARSERDIR = hw/xfree86/parser -XWINPARSERLIB = $(XWINPARSERDIR)/LibraryTargetName(xf86config) -NXWINLIB = $(NXWINDDXDIR)/LibraryTargetName(nxwin) -NXWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(LAYERDIR) $(NXWINDDXDIR) \ - $(DEPDIRS) $(XWINPARSERDIR) -#NXWINOBJS = $(NXWINDDXDIR)/stubs.o $(NXWINDDXDIR)/NX.res \ - $(NXWINDDXDIR)/NXwindow.o \ - $(NXWINDDXDIR)/NXdispatch.o $(NXWINDDXDIR)/NXproperty.o \ - $(NXWINDDXDIR)/NXevents.o -NXWINOBJS = $(NXWINDDXDIR)/stubs.o $(NXWINDDXDIR)/NX.res -NXWINLIBS = PreFbLibs $(NXWINLIB) FbPostFbLibs $(LAYER) $(SHADOW) \ - $(XWINPARSERLIB) -NXWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XLIB) $(SYSLIBS) -lgdi32 -lddraw -NXWINNXLIBS = -L../../../nxcomp -lXcomp - -/* - * These flags cause NXWin.exe to be a Windows executable, which - * prevents NXWin.exe from opening a Command Prompt window when it is - * started. However, the flags also prevent NXWin.exe from outputting - * its status and error message to a Command Prompt; thus, one most - * implement a method to redirect status and error messages to a file - * before enabling these flags. - */ -EXTRA_LDOPTIONS = -mwindows -e _mainCRTStartup - -#if HasParallelMake -MakeMutex($(NXWINDIRS) $(NXWINOBJS) $(NXWINLIB) $(NXWINLIBS) $(NXWINSYSLIBS) $(NXWINNXLIBS)) -#endif - -#if ForceServerRemake -$(NXWINOBJS) $(NXWINLIB) $(NXWINLIBS) $(NXWINSYSLIBS) $(NXWINNXLIBS):: $(NXWINDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif - -ServerTarget(NXWin,$(NXWINDIRS),$(NXWINOBJS), \ - $(NXWINLIBS) $(LOADABLEEXTS) $(LIBCWRAPPER),$(NXWINSYSLIBS) $(NXWINNXLIBS)) - -#ifndef ServerToInstall -#define ServerToInstall NXWin -#endif - -#endif /* NXWinServer */ -#endif - -#ifdef DarwinArchitecture -/* - * To allow building even when building the client-side libraries is turned - * off, libraries in ProjectRoot are listed as dependencies for some targets. - * This causes problems unless we tell make where to find these dependencies. - */ -VPATH = $(BUILDLIBDIR):$(USRLIBDIR) -#endif - -#if defined(XDarwinServer) && XDarwinServer -XCOMM -XCOMM X Darwin server for Mac OS X / Darwin -XCOMM -FBSUBDIR = fb -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -ROOTLESSDIR = miext/rootless -DARWINDDXDIR = hw/darwin -DARWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(DARWINDDXDIR) $(DEPDIRS) -DARWINOBJS = $(DARWINDDXDIR)/miinitext.o -DARWINLIBS = PreFbLibs $(DARWINDDXDIR)/LibraryTargetName(darwin) -DARWINEXTLIBS = MiExtLibs FbPostFbLibs $(DARWINDDXDIR)/LibraryTargetName(darwin) -DARWINSYSLIBS = $(FONTLIBS) $(SYSLIBS) -framework IOKit -IOKITLIB = $(DARWINDDXDIR)/iokit/LibraryTargetName(iokit) - -/* - * IOKit X server - */ -SetUIDServerTarget(XDarwin,$(DARWINDIRS),$(DARWINOBJS), \ - $(DARWINLIBS) $(IOKITLIB) $(DARWINEXTLIBS),$(DARWINSYSLIBS)) - -#if DarwinQuartzSupport - -QUARTZDIR = $(DARWINDDXDIR)/quartz -QUARTZLIB = $(QUARTZDIR)/LibraryTargetName(XQuartz) -QUARTZSYSLIBS = -framework ApplicationServices -framework Cocoa \ - -framework CoreAudio -framework Carbon -ObjC -ROOTLESSLIB = $(ROOTLESSDIR)/LibraryTargetName(rootless) \ - $(ROOTLESSDIR)/safeAlpha/LibraryTargetName(safeAlpha) \ - $(ROOTLESSDIR)/accel/LibraryTargetName(rlAccel) -XPLUGINLIB = XpluginLibrary - -#if NothingOutsideProjectRoot -XDARWINAPPDIR = $(BINDIR)/XDarwin.app/Contents -#else -XDARWINAPPDIR = /Applications/XDarwin.app/Contents -#endif - -/* - * Quartz X server (installed in its application bundle) - */ -SetUIDServerTarget(XDarwinApp,$(DARWINDIRS),$(DARWINOBJS), \ - $(DARWINLIBS) $(QUARTZLIB) $(DARWINEXTLIBS), \ - $(DARWINSYSLIBS) $(QUARTZSYSLIBS) -u _miDCInitialize) - -install:: - $(MKDIRHIER) $(DESTDIR)$(XDARWINAPPDIR)/MacOS - $(MV) $(DESTDIR)$(BINDIR)/XDarwinApp \ - $(DESTDIR)$(XDARWINAPPDIR)/MacOS/XDarwin - -(cd $(DESTDIR)$(BINDIR); $(RM) XDarwinQuartz; \ - $(LN) $(XDARWINAPPDIR)/MacOS/XDarwin XDarwinQuartz) - -/* - * Display mode bundles for Quartz - * (installed in their own bundles inside XDarwin's) - */ -#if HasXplugin -XPRDIRS = $(QUARTZDIR)/xpr $(ROOTLESSDIR) $(ROOTLESSDIR)/safeAlpha -XPRLIBS = $(QUARTZDIR)/xpr/LibraryTargetName(xpr) $(ROOTLESSLIB) - -BundleProgramTarget(xpr,XDarwinApp,$(XPRDIRS),$(QUARTZDIR)/xpr/xprScreen.o, \ - $(XPRLIBS),-framework ApplicationServices \ - $(XPLUGINLIB),$(XDARWINAPPDIR)/Resources) -#endif - -CRDIRS = $(QUARTZDIR)/cr $(ROOTLESSDIR) $(ROOTLESSDIR)/safeAlpha -CRLIBS = $(QUARTZDIR)/cr/LibraryTargetName(cr) $(ROOTLESSLIB) - -BundleProgramTarget(cr,XDarwinApp,$(CRDIRS),$(QUARTZDIR)/cr/crScreen.o, \ - $(CRLIBS),-framework ApplicationServices -framework Cocoa \ - -framework Carbon -ObjC,$(XDARWINAPPDIR)/Resources) - -FSDIRS = $(QUARTZDIR)/fullscreen $(SHADOWDIR) -FSLIBS = $(QUARTZDIR)/fullscreen/LibraryTargetName(fullscreen) $(SHADOW) - -BundleProgramTarget(fullscreen,XDarwinApp,$(FSDIRS), \ - $(QUARTZDIR)/fullscreen/fullscreen.o,$(FSLIBS), \ - -framework ApplicationServices,$(XDARWINAPPDIR)/Resources) - -/* - * GLX bundles for Quartz - * (installed in their own bundles inside XDarwin's) - */ -BundleProgramTarget(glxAGL,XDarwinApp,GL,GL/glx/glxext.o,GL/glx/libglx.a \ - GL/apple/libAGLcore.a, \ - -framework AGL -framework OpenGL,$(XDARWINAPPDIR)/Resources) - -#if BuildAppleDRI -BundleProgramTarget(glxCGL,XDarwinApp,GL,GL/glx/glxext.o,GL/glx/libglx.a \ - GL/apple/libCGLcore.a, \ - -framework OpenGL $(XPLUGINLIB),$(XDARWINAPPDIR)/Resources) -#endif - -BundleProgramTarget(glxMesa,XDarwinApp,GL,GL/glx/glxext.o,GL/glx/libglx.a \ - GL/mesa/GLcore/libGLcore.a,NullParameter,$(XDARWINAPPDIR)/Resources) - -#else /* !DarwinQuartzSupport */ - -#define ServerToInstall XDarwin - -#endif /* DarwinQuartzSupport */ - -#endif /* XDarwinServer */ - - -CFBSUBDIRS = $(CFB8SUBDIR) $(CFB16SUBDIR) $(CFB24SUBDIR) $(CFB32SUBDIR) -MIEXTDIRS = $(SHADOWDIR) $(LAYERDIR) $(ROOTLESSDIR) $(MIDAMAGEDIR) -IPLANDIRS = $(IPLAN2P2DIR) $(IPLAN2P4DIR) $(IPLAN2P8DIR) -DDXDIRS = $(DECWSDDXDIR) $(SUNDDXDIR) $(LYNXDDXDIR) \ - $(HPDDXDIR) $(XFREE86DDXDIR) $(XWINDDXDIR) $(DARWINDDXDIR) \ - $(XVFBDDXDIR) $(XNESTDDXDIR) $(XDMXDDXDIR) $(NXAGENTDDXDIR) $(NXWINDDXDIR) -SUBDIRS = $(STDDIRS) $(MFBSUBDIR) $(CFBSUBDIRS) \ - $(IPLANDIRS) $(ILBMDIR) $(AFBSUBDIR) \ - $(DDXDIRS) $(FBSUBDIR) $(KDRIVEDIRS) $(MIEXTDIRS) - -#if defined(ServerToInstall) && !defined(OS2Architecture) -install:: - -(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) ServerToInstall X) -#endif - -#define IHaveSubdirs - -DependSubdirs($(SUBDIRS)) -MakeLintLibSubdirs($(SUBDIRS)) -LintSubdirs($(SUBDIRS)) - -ForceSubdirs($(DEPDIRS) $(SUBDIRS)) - -DEFAULTFONTPATH = DefaultFontPath -EXTRAMANDEFS = -D__default_font_path__="`echo $(DEFAULTFONTPATH) | sed -e 's/,/, /g'`" - -InstallManPage(Xserver,$(MANDIR)) - -#if MakeDllModules && DoLoadableServer && \ - (defined(SunArchitecture) && defined(SVR4Architecture)) -XCOMM Hackery for building dlopen-able .so modules on Solaris - -AllTarget(linker-deps) - -LINKER_DEPS_DIRS = $(SUBDIRS) $(FONTLIBSRC) - -XCOMM After everything is built, run through and generate linker dependencies -linker-deps: - RunPerlScript($(XF86SRC)/os-support/sunos/find_deps.pl,-R ProjectRoot $(LINKER_DEPS_DIRS)) - for i in $(LINKER_DEPS_DIRS) ; do \ - echo "relinking with dependency flags in $(CURRENT_DIR)/$$i..."; \ - MakeNamedTargetSubdir($$i,NullParameter,all) ; \ - done -#endif diff --git a/nx-X11/programs/Xserver/Imakefile.X.original b/nx-X11/programs/Xserver/Imakefile.X.original deleted file mode 100644 index 58471ca7f..000000000 --- a/nx-X11/programs/Xserver/Imakefile.X.original +++ /dev/null @@ -1,1242 +0,0 @@ -XCOMM $XdotOrg: xc/programs/Xserver/Imakefile,v 1.37 2005/11/18 18:15:23 ajax Exp $ -XCOMM $Xorg: Imakefile,v 1.4 2001/03/14 18:42:02 pookie Exp $ -/* - * Server Master Makefile - */ -XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.296 2003/11/23 06:47:00 torrey Exp $ - -#ifndef InstallXserverSetUID -#define InstallXserverSetUID NO -#endif -#define InstallServerSetUID InstallXserverSetUID - -#include - -/* On most systems the linker requires the libraries in dependency order. - But we have no real order because there are cycles. We fix this by adding - some libraries twice on the commandline. dependLib will add the - dependency library to the commandline if the link order is important */ -#if 1 /* This is currently enabled for all systems */ -#define dependLib(x) x -#else -#define dependLib(x) -#endif - -#if (defined (XFree86Version) || defined(XorgVersion)) -/* Do not strip server binaries */ -INSTPGMFLAGS = -#endif - -#define PreFbLibs $(DIX) $(OS) $(XPDDX) -#define PreFbLibsNoFont $(DIX) $(OS) -#define BarePostFbLibs $(MFB) $(XPFBLIBS) $(MI) -#define PostFbLibs BarePostFbLibs $(EXTENSIONS) -#define NoMfbBarePostFbLibs $(XPFBLIBS) $(MI) -#if !BuildXinerama -#define NoMfbPostFbLibs NoMfbBarePostFbLibs $(EXTENSIONS) -#else -#define NoMfbPostFbLibs $(EXTENSIONS) NoMfbBarePostFbLibs $(EXTENSIONS) -#endif - -#define MFBBareLibs PreFbLibs BarePostFbLibs -#define NoMFBBareLibs PreFbLibs NoMfbBarePostFbLibs -#define MFBLibs PreFbLibs PostFbLibs -#define NoMFBLibs PreFbLibs NoMfbPostFbLibs -#define CFBLibs PreFbLibs $(CFB) PostFbLibs -#define CFB4Libs PreFbLibs $(CFB4) PostFbLibs -#define CFB8Libs PreFbLibs $(CFB8) PostFbLibs -#define CFB16Libs PreFbLibs $(CFB16) PostFbLibs -#define CFB24Libs PreFbLibs $(CFB24) PostFbLibs -#define CFB32Libs PreFbLibs $(CFB32) PostFbLibs - -#define NoMFBCFBLibs PreFbLibs $(CFB) NoMfbPostFbLibs -#define NoMFBCFB8Libs PreFbLibs $(CFB8) NoMfbPostFbLibs -#define FbPostFbLibs $(FB) NoMfbPostFbLibs -#define FBLibs PreFbLibs FbPostFbLibs - -#define MiExtLibs $(SHADOW) - -#define AllFBLibs PreFbLibs $(FB) $(CFB) PostFbLibs - -#if BuildGlxExt -# if BuildXF86DRI && ((defined(XF86Server) && XF86Server) \ - || (defined(XorgServer) && XorgServer)) - DRILIB = GL/dri/ModuleLibraryTargetName(dri) -# else - DRILIB = -# endif -# if GlxUseSGISI - GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ - GL/sgi-si/ModuleLibraryTargetName(GLcore) \ - $(DRILIB) -# else -# if defined(GlxUseWindows) && GlxUseWindows - XWin_GL.exe.GLXLIB = GL/glx/ModuleLibraryTargetName(glx_stdcall) \ - GL/windows/ModuleLibraryTargetName(GLcore) -# endif /* GlxUseWindows */ -# if defined(Win32Architecture) && defined(GlxUseWindows) && GlxUseWindows - GLXLIB = GL/glx/ModuleLibraryTargetName(glx_stdcall) \ - GL/windows/ModuleLibraryTargetName(GLcore) -# elif DoLoadableServer - GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ - GL/mesa/GLcore/ModuleLibraryTargetName(GLcore) -# else - GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ - GL/mesa/GLcore/ModuleLibraryTargetName(GLcore) \ - $(DRILIB) -# endif -# endif - GLXDIR = GL -# if defined(cygwinArchitecture) && defined(GlxUseWindows) && GlxUseWindows - GLXEXT = $(if $($@.GLXLIB),$($@.GLXLIB), $(GLXLIB)) -# else - GLXEXT = $(GLXLIB) -# endif -#endif - -#if BuildXInputExt - XINPUTEXT = Xi/LibraryTargetName(xinput) - XIDIR = Xi -#endif -#if BuildXKB - XKBEXT = xkb/LibraryTargetName(xkb) dependLib($(OS)) - XKBDIR = xkb -#if (defined(XFree86Version) || defined(XorgVersion)) - XF86XKBOBJS = xkb/xf86KillSrv.o xkb/xf86VT.o xkb/xf86Private.o -#endif -#endif -#if BuildLBX - LBXEXT = lbx/LibraryTargetName(lbx) \ - $(TOP)/lib/lbxutil/LibraryTargetName(lbxutil) - LBXDIRS = lbx -#endif -#if BuildDBE - DBEEXT = dbe/LibraryTargetName(dbe) -#endif -#if BuildDBE || BuildDBElib - DBEDIR = dbe -#endif -#if BuildRECORD - RECORDEXT = record/LibraryTargetName(record) -#endif -#if BuildRECORD || BuildRECORDlib - RECORDDIR = record -#endif -#if BuildXTrap - XTRAPEXT = XTrap/LibraryTargetName(xtrap) - XTRAPDIR = XTrap -#endif -#ifdef SiteExtensionLibs - SITEEXTS = SiteExtensionLibs -#endif -#ifdef SiteExtensionDirs - SITEEXTDIRS = SiteExtensionDirs -#endif -#if DoLoadableServer && HasDlopen - LIBDL = DlLibrary -#endif - LIBREGEX = RegexLibrary - -#if DoLoadableServer - LIBCWRAPPER = os/libcwrapper.o -#endif - -#if BuildXprint - -XPCONFIGDIR = XpConfig - -#ifndef XpRasterDDX -#define XpRasterDDX YES -#endif -#ifndef XpColorPclDDX -#define XpColorPclDDX YES -#endif -#ifndef XpMonoPclDDX -#define XpMonoPclDDX NO -#endif -#ifndef XpPostScriptDDX -#define XpPostScriptDDX YES -#endif - -#if XpRasterDDX -XPRASTLIB = Xprint/raster/LibraryTargetName(raster) -#endif -#if XpColorPclDDX -XPPCLLIB = Xprint/pcl/LibraryTargetName(pcl) -#endif -#if XpMonoPclDDX -XPMPCLLIB = Xprint/pcl-mono/LibraryTargetName(pcl) -#endif -#if XpPostScriptDDX -XPPSLIB = Xprint/ps/LibraryTargetName(ps) -#endif - -XPDDXLIBS = Xprint/LibraryTargetName(printer) \ - $(XPRASTLIB) $(XPPCLLIB) $(XPMPCLLIB) $(XPPSLIB) -XPDDXFBLIBS = $(MFB) $(CFB32) -#if !PrintOnlyServer - XPFBLIBS = $(XPDDXFBLIBS) - XPDDX = $(XPDDXLIBS) -#endif - XPDDXDIR = Xprint -#endif -#if !BuildXprint || PrintOnlyServer -XPFBLIBS = dix/LibraryTargetName(xpstubs) -#endif - -#if BuildRender - RENDERDIR = render - RENDERLIB = $(RENDERDIR)/librender.a -#endif -#if BuildRandR - RANDRDIR = randr - RANDRLIB = $(RANDRDIR)/librandr.a -#endif -#if BuildXfixes - FIXESDIR = xfixes - FIXESLIB = $(FIXESDIR)/libxfixes.a -#endif -#if BuildDamage - DAMAGEDIR = damageext - DAMAGELIB = $(DAMAGEDIR)/libdamage.a -#endif -#if BuildComposite - CWDIR = miext/cw - COMPOSITEDIR = composite - COMPOSITELIB = $(COMPOSITEDIR)/libcomposite.a -#if DoLoadableServer - CW = miext/cw/ModuleLibraryTargetName(cw) -#else - CW = miext/cw/LibraryTargetName(cw) -#endif -#endif -#if DoLoadableServer - EXTENSIONS = $(COMPOSITELIB) $(DAMAGELIB) $(DAMAGE) $(FIXESLIB) $(CW) \ - $(OTHEREXTS) $(RANDRLIB) $(RENDERLIB) - LOADABLEEXTS = $(MISCEXT) $(DBEEXT) $(RECORDEXT) $(GLXEXT) $(XTRAPEXT) - MISCEXT = Xext/LibraryTargetName(ext) - OTHEREXTS = Xext/LibraryTargetName(exts) $(XKBEXT) $(XINPUTEXT) \ - $(LBXEXT) $(SITEEXTS) -#else - EXTENSIONS = $(COMPOSITELIB) $(DAMAGELIB) $(DAMAGE) $(FIXESLIB) $(CW) \ - $(OTHEREXTS) $(GLXEXT) $(RANDRLIB) $(RENDERLIB) - OTHEREXTS = Xext/LibraryTargetName(ext) $(XKBEXT) $(XINPUTEXT) \ - $(LBXEXT) $(DBEEXT) $(RECORDEXT) $(SITEEXTS) $(XTRAPEXT) -#endif - EXTDIRS = Xext $(XKBDIR) $(XIDIR) $(GLXDIR) \ - $(LBXDIRS) $(DBEDIR) $(RECORDDIR) $(SITEEXTDIRS) \ - $(RANDRDIR) $(RENDERDIR) $(XTRAPDIR) $(XPCONFIGDIR) \ - $(FIXESDIR) $(DAMAGEDIR) $(CWDIR) $(COMPOSITEDIR) -#if BuildLBX || GzipFontCompression - ZLIB = GzipLibrary -#endif - OS = os/LibraryTargetName(os) - BSDEMUL = $(DEPXBSDLIB) -#if DoLoadableServer - MFB = mfb/ModuleLibraryTargetName(mfb) - FB = fb/ModuleLibraryTargetName(fb) -#if XF8_32Wid - CFB = cfb/ModuleLibraryTargetName(cfb) \ - cfb16/ModuleLibraryTargetName(cfb16) \ - cfb24/ModuleLibraryTargetName(cfb24) \ - cfb32/ModuleLibraryTargetName(cfb32) -#else - CFB = cfb/ModuleLibraryTargetName(cfb) \ - cfb16/ModuleLibraryTargetName(cfb16) \ - cfb32/ModuleLibraryTargetName(cfb32) -#endif - CFB8 = cfb/ModuleLibraryTargetName(cfb) - CFB4 = cfb/ModuleLibraryTargetName(cfb) \ - cfb4/ModuleLibraryTargetName(cfb4) - CFB16 = cfb/ModuleLibraryTargetName(cfb) \ - cfb16/ModuleLibraryTargetName(cfb16) - CFB24 = cfb/ModuleLibraryTargetName(cfb) \ - cfb24/ModuleLibraryTargetName(cfb24) - CFB32 = cfb/ModuleLibraryTargetName(cfb) \ - cfb32/ModuleLibraryTargetName(cfb32) - DAMAGE = miext/damage/ModuleLibraryTargetName(damage) - SHADOW = miext/shadow/ModuleLibraryTargetName(shadow) - LAYER = miext/layer/ModuleLibraryTargetName(layer) -#else - MFB = mfb/LibraryTargetName(mfb) - FB = fb/LibraryTargetName(fb) -#if XF8_32Wid - CFB = cfb16/LibraryTargetName(cfb16) \ - cfb24/LibraryTargetName(cfb24) \ - cfb32/LibraryTargetName(cfb32) \ - cfb/LibraryTargetName(cfb) -#else - CFB = cfb16/LibraryTargetName(cfb16) \ - cfb32/LibraryTargetName(cfb32) \ - cfb/LibraryTargetName(cfb) -#endif - CFB8 = cfb/LibraryTargetName(cfb) - CFB4 = cfb4/LibraryTargetName(cfb4) \ - cfb/LibraryTargetName(cfb) - CFB16 = cfb16/LibraryTargetName(cfb16) \ - cfb/LibraryTargetName(cfb) - CFB24 = cfb24/LibraryTargetName(cfb24) \ - cfb/LibraryTargetName(cfb) - CFB32 = cfb32/LibraryTargetName(cfb32) \ - cfb/LibraryTargetName(cfb) - DAMAGE = miext/damage/LibraryTargetName(damage) - SHADOW = miext/shadow/LibraryTargetName(shadow) - LAYER = miext/layer/LibraryTargetName(layer) -#endif -#if !HasFfs && (defined(mingwArchitecture) || defined(cygwinArchitecture)) - /* Order of libraries is important when linking in mingw or - * cygwin. libmi.a requires ffs from libdix.a. So it is added - * after libmi.a on the commandline */ - MI = mi/LibraryTargetName(mi) $(DIX) -#else - MI = mi/LibraryTargetName(mi) -#endif - MIINITEXTOBJ = mi/miinitext.o - DIX = dix/LibraryTargetName(dix) - FONTBASE = $(FONTLIBSRC)/fontbase.o \ - $(FONTLIBSRC)/LibraryTargetName(fontbase) -#if XserverStaticFontLib - FONT = $(FONTLIBSRC)/LibraryTargetName(Xfont) $(FREETYPE2LIB) -#else - FONT = $(LDPRELIB) $(XFONTLIB) $(FREETYPE2LIB) -#endif - FONTLIBS = $(FONT) $(XPFBLIBS) -#if UsbMouseSupport -#if !HasLibUsb - USB = $(XF86OSSRC)/bsd/libusb/LibraryTargetName(usb) -#else - USB = UsbHidLib -#endif -#endif -#ifdef ServerExtraSysLibs - EXTRASYSLIBS = ServerExtraSysLibs -#endif -#if HasPam && HasPamMisc - PAMLIBS = PamLibraries PamMiscLibraries -#endif -#if !(SystemV4 || defined(SGIArchitecture) || UseRgbTxt) - DBMLIBS = DBMLibrary -#endif - SYSLIBS = $(ZLIB) MathLibrary Krb5Libraries $(DBMLIBS) $(USB) \ - $(PAMLIBS) $(XAUTHLIB) $(XDMCPLIB) $(EXTRASYSLIBS) -#if !HasCbrt - CBRT = mi/LibraryTargetName(cbrt) -#endif - STDDIRS = include dix os mi $(XPDDXDIR) $(EXTDIRS) - FBDIR = fb - MFBDIR = mfb - CFB4DIR = cfb4 - CFB8DIR = cfb - CFB16DIR = cfb16 - CFB24DIR = cfb24 - CFB32DIR = cfb32 - AFBDIR = afb - -XCOMM -XCOMM This turns off the default rule for compiling .c files because -XCOMM this makefile does not really know how to build it. This is really -XCOMM just a hack because of the Sun version of make and nfs. -XCOMM -.c.o: - -.s.o: - -/* Build rule blocks, add one for each server - * - * If a server needs mfb, its build block should have a line like: - * MFBSUBDIR = mfb - * Similarly, its build block should have: - * CFB4SUBDIR = cfb4 (if the server needs 4 bit cfb) - * CFB8SUBDIR = cfb (8 bit cfb) - * CFB16SUBDIR = cfb16 (16 bit cfb) - * CFB24SUBDIR = cfb24 (24 bit cfb) - * CFB32SUBDIR = cfb32 (32 bit cfb) - * - * If a server does not need all of the above components, simply - * omit the relevant lines from the build block. - * - * If these guidelines are followed, a make at the top of the server - * tree should result in each subdirectory being built only once, - * even if multiple servers that share subdirectories are being built. - */ - -#if defined(XdecServer) && XdecServer -XCOMM -XCOMM Digital MIPS based WS server (ultrix 4.2 and beyond) -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -DECWSDDXDIR = hw/dec/ws -DECDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(DECWSDDXDIR) $(DEPDIRS) -DECOBJS = hw/dec/ws/init.o hw/dec/ws/sdepthinit.o -DECLIBS = hw/dec/ws/LibraryTargetName(dec) CFB8Libs -ServerTarget(Xdec,$(DECDIRS),$(DECOBJS), \ - $(DECLIBS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xdec -#endif -#endif /* XdecServer */ - - -#if defined(XdecMultiDepthServer) && XdecMultiDepthServer -XCOMM -XCOMM Digital MIPS based WS server (ultrix 4.2 and beyond) -XCOMM Supports 8, 12, and 24 bit pixmaps -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -CFB24SUBDIR = cfb24 -CFB32SUBDIR = cfb32 -DECWSDDXDIR = hw/dec/ws -DECDIRS1 = $(STDDIRS) $(MFBDIR) \ - $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ - $(DECWSDDXDIR) $(DEPDIRS) -DECOBJS1 = hw/dec/ws/init.o hw/dec/ws/mdepthinit.o -DECLIBS1 = hw/dec/ws/LibraryTargetName(dec) CFBLibs -ServerTarget(Xdec_md,$(DECDIRS1),$(DECOBJS1), \ - $(DECLIBS1),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xdec_md -#endif -#endif /* XdecMultiDepthServer */ - - -#if defined(XsunServer) && XsunServer -XCOMM -XCOMM Sun server -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -SUNDDXDIR = hw/sun -#if DoLoadableServer -SUNOBJS = hw/sun/sunInit.o hw/sun/sunInitExt.o hw/sun/stubs.o -#elif (defined(XF86Server) && XF86Server) \ - || (defined(XorgServer) && XorgServer) -SUNOBJS = hw/sun/sunInit.o hw/sun/stubs.o -#else -SUNOBJS = hw/sun/sunInit.o -#endif -SUNDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(SUNDDXDIR) $(DEPDIRS) -SUNLIBS = hw/sun/LibraryTargetName(sun) CFB8Libs -SUNSYSLIBS = $(FONTLIBS) $(WIDECHARSYSLIB) $(SYSLIBS) -SetUIDServerTarget(Xsun,$(SUNDIRS),$(SUNOBJS), \ - $(LIBCWRAPPER) $(SUNLIBS) $(LOADABLEEXTS),$(SUNSYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xsun -#endif -#endif /* XsunServer */ - - -#if defined(Xsun24Server) && Xsun24Server -XCOMM -XCOMM Sun multiple pixmap depth (8, 12, 24) server -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -CFB24SUBDIR = cfb24 -CFB32SUBDIR = cfb32 -SUNDDXDIR = hw/sun -SUN24DIRS = $(STDDIRS) $(MFBDIR) \ - $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ - $(SUNDDXDIR) $(DEPDIRS) -#if DoLoadableServer -SUN24OBJS = hw/sun/sunInitMulti.o hw/sun/sunInitExt.o hw/sun/stubs.o -#elif defined(XF86Server) && XF86Server \ - || (defined(XorgServer) && XorgServer) -SUN24OBJS = hw/sun/sunInitMulti.o hw/sun/stubs.o -#else -SUN24OBJS = hw/sun/sunInitMulti.o -#endif -SUN24LIBS = hw/sun/LibraryTargetName(sun) CFBLibs -SetUIDServerTarget(Xsun24,$(SUN24DIRS),$(SUN24OBJS), \ - $(LIBCWRAPPER) $(SUN24LIBS) $(LOADABLEEXTS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xsun24 -#endif -#endif /* Xsun24Server */ - - -#if defined(XsunMonoServer) && XsunMonoServer -XCOMM -XCOMM Sun monochrome server -XCOMM -MFBSUBDIR = mfb -SUNDDXDIR = hw/sun -SUNMDIRS = $(STDDIRS) $(MFBDIR) $(SUNDDXDIR) $(DEPDIRS) -#if defined(XF86Server) && XF86Server \ - || (defined(XorgServer) && XorgServer) -SUNMOBJS = hw/sun/sunInitMono.o hw/sun/sunInExMono.o hw/sun/stubs.o -#else -SUNMOBJS = hw/sun/sunInitMono.o hw/sun/sunInExMono.o -#endif -SUNMLIBS = hw/sun/LibraryTargetName(sun) MFBBareLibs $(EXTENSIONS) -SetUIDServerTarget(XsunMono,$(SUNMDIRS),$(SUNMOBJS), \ - $(LIBCWRAPPER) $(SUNMLIBS) $(LOADABLEEXTS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall XsunMono -#endif -#endif /* XsunMonoServer */ - - -#if defined(XsunLynxServer) && XsunLynxServer -XCOMM -XCOMM Sun server for LynxOS microSPARC 2.4.0 -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -LYNXDDXDIR = hw/sunLynx -SUNDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(LYNXDDXDIR) $(DEPDIRS) -SUNOBJS = hw/sunLynx/sunLyInit.o -SUNLIBS = hw/sunLynx/libsun.a CFB8Libs -ServerTarget(Xsun,$(SUNDIRS),$(SUNOBJS), \ - $(SUNLIBS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall Xsun -#endif -#endif /* XsunLynxServer */ - - -#if defined(XsunLynxMonoServer) && XsunLynxMonoServer -XCOMM -XCOMM Sun monochrome server for LynxOS microSPARC 2.4.0 -XCOMM -MFBSUBDIR = mfb -LYNXDDXDIR = hw/sunLynx -SUNMDIRS = $(STDDIRS) $(MFBDIR) $(LYNXDDXDIR) $(DEPDIRS) -SUNMOBJS = hw/sunLynx/sunInitMono.o hw/sunLynx/sunInExMono.o -SUNMLIBS = hw/sunLynx/libsun.a MFBBareLibs $(OTHEREXTS) -ServerTarget(XsunMono,$(SUNMDIRS),$(SUNMOBJS), \ - $(SUNMLIBS),$(FONTLIBS) $(SYSLIBS)) -#ifndef ServerToInstall -#define ServerToInstall XsunMono -#endif -#endif /* XsunLynxMonoServer */ - - -#if HasParallelMake -XCOMM -XCOMM force non-parallel build of XF86 servers to prevent MUTEX overrides -XCOMM -#if defined(XF86Server) && XF86Server -XF86SERVER = XFree86 -#endif -#if defined(XorgServer) && XorgServer -XF86SERVER = Xorg -#endif -#if defined(XnestServer) && XnestServer -XNEST = Xnext -#endif -#if defined(XVirtualFramebufferServer) && XVirtualFramebufferServer -XVFB = Xvfb -#endif -#if XdmxServer -XDMX = Xdmx -#endif -#if defined(XWinServer) && XWinServer && !MakeDllModules -XWIN = XWin -#endif -#if (defined(XF86Server) && XF86Server) || \ - (defined(XorgServer) && XorgServer) || \ - (defined(XnestServer) && XnestServer) || \ - (defined(XVirtualFramebufferServer) && XVirtualFramebufferServer) || \ - (defined(XdmxServer) && XdmxServer) || \ - (!MakeDllModules && defined(XWinServer) && XWinServer) -MakeMutex($(XF86SERVER) $(XNEST) $(XVFB) $(XWIN)) -#endif -MakeMutex($(STDDIRS) mfb fb cfb cfb16 cfb24 cfb32) -#endif - - -#if defined(XF86Server) && XF86Server -XCOMM -XCOMM XFree86 Server -XCOMM -FBSUBDIR = fb -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -CFB24SUBDIR = cfb24 -CFB32SUBDIR = cfb32 -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -LAYERDIR = miext/layer -#ifdef OS2Architecture -SERVERDEFFILE = XFree86.def -XNESTDEFFILE = Xnest.def -XVFBDEFFILE = Xvfb.def -#endif -#if XF86AFB -AFBSUBDIR = afb -#endif -XFREE86DDXDIR = hw/xfree86 -XF86SERVERSUBDIRS = $(STDDIRS) $(MFBDIR) $(FBDIR) $(AFBDIR) \ - $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ - $(SHADOWDIR) $(LAYERDIR) $(XFREE86DDXDIR) $(DEPDIRS) \ - $(MIDAMAGEDIR) -XF86INIT = $(XF86COMSRC)/xf86Init.o $(XF86COMSRC)/xf86IniExt.o -XF86COMLIB = $(XF86COMSRC)/LibraryTargetName(xf86) -XF86PARSLIB= $(XF86PARSERSRC)/LibraryTargetName(xf86config) -XF86OSLIB = $(XF86OSSRC)/LibraryTargetName(xf86_os) -#if XF86XAA -XF86XAALIB = $(XF86SRC)/xaa/LibraryTargetName(xaa) -#endif -#if XF86EXA -XF86EXALIB = $(XF86SRC)/exa/LibraryTargetName(exa) -#endif -#if XF86VgaHw -XF86VGAHWLIB = $(XF86SRC)/vgahw/LibraryTargetName(vgahw) -#endif -#if XF86FBDevHw -XF86FBDEVHWLIB = $(XF86SRC)/fbdevhw/LibraryTargetName(fbdevhw) -#endif -#if XF1Bpp || XF4Bpp -XF1BPPLIB = $(XF86SRC)/xf1bpp/LibraryTargetName(xf1bpp) -#endif -#if XF4Bpp -XF4BPPLIB = $(XF86SRC)/xf4bpp/LibraryTargetName(xf4bpp) -#endif -#if XF8_32Wid -XF8_32WIDLIB = $(XF86SRC)/xf8_32wid/LibraryTargetName(xf8_32wid) -#endif -#if XF8_32Bpp -XF8_32BPPLIB = $(XF86SRC)/xf8_32bpp/LibraryTargetName(xf8_32bpp) -#endif -#if XF8_16Bpp -XF8_16BPPLIB = $(XF86SRC)/xf8_16bpp/LibraryTargetName(xf8_16bpp) -#endif -#if XFShadowFB -XFSHADOWFBLIB = $(XF86SRC)/shadowfb/LibraryTargetName(shadowfb) -#endif -#if XF86AFB -AFBLIB = afb/LibraryTargetName(afb) -#endif -XF86DRIVERLIB = $(XF86SRC)/drivers/LibraryTargetName(driver) -#if XF86Ramdac -XF86RAMDACLIB = $(XF86SRC)/ramdac/LibraryTargetName(ramdac) -#endif -#if XF86I2C -XF86I2CLIB = $(XF86SRC)/i2c/LibraryTargetName(i2c) -#endif -#if XF86DDC -XF86DDCLIB = $(XF86SRC)/ddc/LibraryTargetName(ddc) -#endif -#if XF86VBE -XF86VBELIB = $(XF86SRC)/vbe/LibraryTargetName(vbe) -#endif -#if XF86RAC -XF86RACLIB = $(XF86SRC)/rac/LibraryTargetName(rac) -#endif -#if XF86INT10_BUILD > X86EMU_GENERIC -XF86INT10LIB = $(XF86OSSRC)/LibraryTargetName(int10) -#else -XF86INT10LIB = $(XF86SRC)/int10/LibraryTargetName(int10) -#endif -#if UseMemLeak -MEMDEBUGLIB = $(TOP)/util/memleak/LibraryTargetName(memleak) -#endif -XF86IDRIVERLIB = $(XF86SRC)/input/LibraryTargetName(idriver) -#if !DoLoadableServer -XF86DRVOBJS = $(XF86SRC)/drivers/drvConf.o -XF86DRVLIBS = $(XF86DRIVERLIB) $(XF86RAMDACLIB) $(XF86DDCLIB) $(XF86I2CLIB) \ - $(XF86XAALIB) $(XF86EXALIB) $(XF86VGAHWLIB) $(XF86FBDEVHWLIB) \ - $(XF8_32WIDLIB) $(XF8_32BPPLIB) \ - $(XF8_16BPPLIB) \ - $(XF4BPPLIB) $(XF1BPPLIB) $(XFSHADOWFBLIB) $(AFBLIB) -XF86IDRVOBJS = $(XF86SRC)/input/drvConf.o -XF86IDRVLIBS = $(XF86IDRIVERLIB) -XF86SCANLIB = $(XF86SRC)/scanpci/LibraryTargetName(scanpci) -XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) $(XF86RACLIB) \ - $(XF86PARSLIB) $(XF86VBELIB) $(XF86OSLIB) $(XF86INT10LIB) -#else -XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) \ - $(XF86PARSLIB) $(XF86OSLIB) -#endif -#if DoLoadableServer -XF86LOADERLIB = $(XF86SRC)/loader/LibraryTargetName(loader) -XF86MAINLIBS = PreFbLibsNoFont \ - $(FONTBASE) $(OTHEREXTS) $(XF86COMLIB) \ - NoMfbPostFbLibs -XF86SERVERSYSLIBS = $(SYSLIBS) $(LIBDL) $(LIBREGEX) -XF86SERVERLIBS = $(XF86DRVLIBS) $(XF86IDRVLIBS) $(XF86LIBS) $(XF86LOADERLIB) \ - $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB) -#else -XF86MAINLIBS = MiExtLibs AllFBLibs $(XF86COMLIB) $(MI) -XF86SERVERSYSLIBS = $(FONTLIBS) $(SYSLIBS) $(LIBDL) $(LIBREGEX) -XF86SERVERLIBS = $(XF86DRVLIBS) $(XF86IDRVLIBS) $(XF86LIBS) $(XF86LOADERLIB) \ - $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB) \ - $(XF86DDCLIB) -#endif -XF86SERVEROBJS = $(XF86XKBOBJS) $(XF86DRVOBJS) $(XF86IDRVOBJS) -#if HasParallelMake -MakeMutex($(XF86SERVERSUBDIRS) $(XF86SERVERLIBS) $(XF86SERVERSYSLIBS)) -#endif -#if ForceServerRemake -$(XF86SERVERLIBS) $(XF86SERVERSYSLIBS):: $(XF86SERVERSUBDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -SetUIDServerTarget(XFree86,$(XF86SERVERSUBDIRS),$(XF86SERVEROBJS) $(SERVERDEFFILE), \ - $(XF86SERVERLIBS),$(XF86SERVERSYSLIBS)) -#if DoLoadableServer -ServerDriverSDKTarget(XFree86) -#endif -#ifndef ServerToInstall -#define ServerToInstall XFree86 -#endif -#endif /* XF86Server */ - -#if defined(XorgServer) && XorgServer -XCOMM -XCOMM Xorg Server -XCOMM -FBSUBDIR = fb -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -#if XF8_32Wid -CFB24SUBDIR = cfb24 -#endif -CFB32SUBDIR = cfb32 -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -LAYERDIR = miext/layer -#ifdef OS2Architecture -SERVERDEFFILE = Xorg.def -XNESTDEFFILE = Xnest.def -XVFBDEFFILE = Xvfb.def -#endif -#if XF86AFB -AFBSUBDIR = afb -#endif -XFREE86DDXDIR = hw/xfree86 -XF86SERVERSUBDIRS = $(STDDIRS) $(MFBDIR) $(FBDIR) $(AFBDIR) \ - $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ - $(SHADOWDIR) $(LAYERDIR) $(XFREE86DDXDIR) $(DEPDIRS) \ - $(MIDAMAGEDIR) -XF86INIT = $(XF86COMSRC)/xf86Init.o $(XF86COMSRC)/xf86IniExt.o -XF86COMLIB = $(XF86COMSRC)/LibraryTargetName(xf86) -XF86PARSLIB= $(XF86PARSERSRC)/LibraryTargetName(xf86config) -XF86OSLIB = $(XF86OSSRC)/LibraryTargetName(xf86_os) -#if XF86XAA -XF86XAALIB = $(XF86SRC)/xaa/LibraryTargetName(xaa) -#endif -#if XF86EXA -XF86EXALIB = $(XF86SRC)/exa/LibraryTargetName(exa) -#endif -#if XF86VgaHw -XF86VGAHWLIB = $(XF86SRC)/vgahw/LibraryTargetName(vgahw) -#endif -#if XF86FBDevHw -XF86FBDEVHWLIB = $(XF86SRC)/fbdevhw/LibraryTargetName(fbdevhw) -#endif -#if XF1Bpp || XF4Bpp -XF1BPPLIB = $(XF86SRC)/xf1bpp/LibraryTargetName(xf1bpp) -#endif -#if XF4Bpp -XF4BPPLIB = $(XF86SRC)/xf4bpp/LibraryTargetName(xf4bpp) -#endif -#if XF8_32Wid -XF8_32WIDLIB = $(XF86SRC)/xf8_32wid/LibraryTargetName(xf8_32wid) -#endif -#if XF8_32Bpp -XF8_32BPPLIB = $(XF86SRC)/xf8_32bpp/LibraryTargetName(xf8_32bpp) -#endif -#if XF8_16Bpp -XF8_16BPPLIB = $(XF86SRC)/xf8_16bpp/LibraryTargetName(xf8_16bpp) -#endif -#if XFShadowFB -XFSHADOWFBLIB = $(XF86SRC)/shadowfb/LibraryTargetName(shadowfb) -#endif -#if XF86AFB -AFBLIB = afb/LibraryTargetName(afb) -#endif -XF86DRIVERLIB = $(XF86SRC)/drivers/LibraryTargetName(driver) -#if XF86Ramdac -XF86RAMDACLIB = $(XF86SRC)/ramdac/LibraryTargetName(ramdac) -#endif -#if XF86I2C -XF86I2CLIB = $(XF86SRC)/i2c/LibraryTargetName(i2c) -#endif -#if XF86DDC -XF86DDCLIB = $(XF86SRC)/ddc/LibraryTargetName(ddc) -#endif -#if XF86VBE -XF86VBELIB = $(XF86SRC)/vbe/LibraryTargetName(vbe) -#endif -#if XF86RAC -XF86RACLIB = $(XF86SRC)/rac/LibraryTargetName(rac) -#endif -#if XF86INT10_BUILD > X86EMU_GENERIC -XF86INT10LIB = $(XF86OSSRC)/LibraryTargetName(int10) -#else -XF86INT10LIB = $(XF86SRC)/int10/LibraryTargetName(int10) -#endif -#if UseMemLeak -MEMDEBUGLIB = $(TOP)/util/memleak/LibraryTargetName(memleak) -#endif -XF86IDRIVERLIB = $(XF86SRC)/input/LibraryTargetName(idriver) -#if !DoLoadableServer -XF86DRVOBJS = $(XF86SRC)/drivers/drvConf.o -XF86DRVLIBS = $(XF86DRIVERLIB) $(XF86RAMDACLIB) $(XF86DDCLIB) $(XF86I2CLIB) \ - $(XF86XAALIB) $(XF86EXALIB) $(XF86VGAHWLIB) $(XF86FBDEVHWLIB) \ - $(XF8_32WIDLIB) $(XF8_32BPPLIB) \ - $(XF8_16BPPLIB) \ - $(XF4BPPLIB) $(XF1BPPLIB) $(XFSHADOWFBLIB) $(AFBLIB) -XF86IDRVOBJS = $(XF86SRC)/input/drvConf.o -XF86IDRVLIBS = $(XF86IDRIVERLIB) -XF86SCANLIB = $(XF86SRC)/scanpci/LibraryTargetName(scanpci) -XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) $(XF86RACLIB) \ - $(XF86PARSLIB) $(XF86VBELIB) $(XF86OSLIB) $(XF86INT10LIB) -#else -XF86LIBS = $(MEMDEBUGLIB) $(XF86INIT) $(XF86COMLIB) \ - $(XF86PARSLIB) $(XF86OSLIB) -#endif -#if DoLoadableServer -XF86LOADERLIB = $(XF86SRC)/loader/LibraryTargetName(loader) -XF86MAINLIBS = PreFbLibsNoFont \ - $(FONTBASE) $(OTHEREXTS) $(XF86COMLIB) \ - NoMfbPostFbLibs -XF86SERVERSYSLIBS = $(SYSLIBS) $(LIBDL) $(LIBREGEX) -XF86SERVERLIBS = $(XF86DRVLIBS) $(XF86IDRVLIBS) $(XF86LIBS) $(XF86LOADERLIB) \ - $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB) -#else -XF86MAINLIBS = MiExtLibs AllFBLibs $(XF86COMLIB) $(MI) -XF86SERVERSYSLIBS = $(FONTLIBS) $(SYSLIBS) $(LIBDL) $(LIBREGEX) -XF86SERVERLIBS = $(XF86DRVLIBS) $(XF86IDRVLIBS) $(XF86LIBS) $(XF86LOADERLIB) \ - $(XF86COMLIB) $(XF86MAINLIBS) $(XF86SCANLIB) $(XF86OSLIB) \ - $(XF86DDCLIB) -#endif -XF86SERVEROBJS = $(XF86XKBOBJS) $(XF86DRVOBJS) $(XF86IDRVOBJS) -#if HasParallelMake -MakeMutex($(XF86SERVERSUBDIRS) $(XF86SERVERLIBS) $(XF86SERVERSYSLIBS)) -#endif -#if ForceServerRemake -$(XF86SERVERLIBS) $(XF86SERVERSYSLIBS):: $(XF86SERVERSUBDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -SetUIDServerTarget(Xorg,$(XF86SERVERSUBDIRS),$(XF86SERVEROBJS) $(SERVERDEFFILE), \ - $(XF86SERVERLIBS),$(XF86SERVERSYSLIBS)) -#if DoLoadableServer -ServerDriverSDKTarget(Xorg) -#endif -#ifndef ServerToInstall -#define ServerToInstall Xorg -#endif -#endif /* XorgServer */ - -#if defined(XprtServer) && XprtServer -XCOMM -XCOMM Print Server -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB32SUBDIR = cfb32 -MIDAMAGEDIR = miext/damage -XPSUBDIRS = $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(CFB32DIR) $(DEPDIRS) \ - $(MIDAMAGEDIR) -XPOBJS = Xprint/ddxInit.o Xprint/dpmsstubs.o Xprint/miinitext.o -#if PrintOnlyServer -XPLIBS = PreFbLibs $(XPDDXLIBS) $(XPDDXFBLIBS) PostFbLibs -#else -XPLIBS = PreFbLibs PostFbLibs -#endif -#if (defined(SunArchitecture) || defined(SparcArchitecture)) && \ - defined(SVR4Architecture) -XPSYSLIBS = $(FONTLIBS) $(CBRT) $(SYSLIBS) $(XONLYLIB) -lw -#else -XPSYSLIBS = $(FONTLIBS) $(CBRT) $(SYSLIBS) $(XONLYLIB) -#endif -#if HasParallelMake -MakeMutex($(XPSUBDIRS) $(XPOBJS) $(XPLIBS) $(XPSYSLIBS)) -#endif -#if ForceServerRemake -$(XPOBJS) $(XPLIBS) $(XPSYSLIBS):: $(XPSUBDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -ServerTarget(Xprt,$(XPSUBDIRS),$(XPOBJS), \ - $(LIBCWRAPPER) $(XPLIBS) $(LOADABLEEXTS),$(XPSYSLIBS)) -#endif /* XprtServer */ - -#if defined(XnestServer) && XnestServer -XCOMM -XCOMM Server with Xlib-based ddx -XCOMM -#ifndef Win32Architecture -XNESTDDXDIR = hw/xnest -#else -XNESTDDXDIR = hw -#endif -#if BuildDPMS -XNESTDPMSSTUBOBJS = $(XNESTDDXDIR)/dpmsstubs.o -#endif -XNESTDIRS = $(STDDIRS) $(XNESTDDXDIR) $(DEPDIRS) -#if !defined(LynxOSArchitecture) && \ - !defined(Win32Architecture) && \ - !defined(QNX4Architecture) -XNESTOBJS = hw/xnest/miinitext.o $(XNESTDPMSSTUBOBJS) -#else -XNESTOBJS = hw/xnest/miinitext.o dix/main.o $(XNESTDPMSSTUBOBJS) -#endif -XNEST = hw/xnest/LibraryTargetName(xnest) -XNESTLIBS = PreFbLibs $(XNEST) NoMfbPostFbLibs $(XNEST) -XNESTSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XLIB) $(SYSLIBS) -#if HasParallelMake -MakeMutex($(XNESTDIRS) $(XNESTOBJS) $(XNESTLIBS) $(XNESTSYSLIBS)) -#endif -#if ForceServerRemake -$(XNESTOBJS) $(XNESTLIBS) $(XNESTSYSLIBS):: $(XNESTDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -ServerTarget(Xnest,$(XNESTDIRS),$(XNESTOBJS) $(XNESTDEFFILE), \ - $(LIBCWRAPPER) $(XNESTLIBS) $(LOADABLEEXTS),$(XNESTSYSLIBS)) -#endif /* XnestServer */ - - -#if defined(XnonServer) && XnonServer -XCOMM -XCOMM non server, just compile sources for build test -XCOMM -MFBSUBDIR = mfb -CFB8SUBDIR = cfb -CFB16SUBDIR = cfb16 -CFB32SUBDIR = cfb32 -#if HasParallelMake -MakeMutex($(STDDIRS) $(MFBDIR) $(CFB8DIR) $(CFB16DIR) $(CFB32DIR) $(DEPDIRS)) -#endif -Xnon: $(STDDIRS) $(MFBDIR) $(CFB8DIR) $(CFB16DIR) $(CFB32DIR) $(DEPDIRS) -#endif /* XnonServer */ - - -#if defined(XVirtualFramebufferServer) && XVirtualFramebufferServer -XCOMM -XCOMM server with Virtual (malloced) framebuffer -XCOMM -MFBSUBDIR = mfb -FBSUBDIR = fb -#if defined(Win32Architecture) -XVFBDDXDIR = hw -#else -XVFBDDXDIR = hw/vfb -#endif -XVFBDIRS = $(STDDIRS) $(MFBDIR) $(FBDIR) $(XVFBDDXDIR) $(DEPDIRS) -#ifndef Win32Architecture -#if BuildDPMS -XVFBDPMSSTUBOBJS = $(XVFBDDXDIR)/dpmsstubs.o -#endif -XVFBOBJS = $(XVFBDDXDIR)/stubs.o $(XVFBDDXDIR)/miinitext.o $(XVFBDPMSSTUBOBJS) -#else -XVFBOBJS = dix/main.o hw/vfb/stubs.o hw/vfb/miinitext.o -#endif -XVFB = $(XVFBDDXDIR)/LibraryTargetName(vfb) -XVFBLIBS = PreFbLibs $(XVFB) $(FB) PostFbLibs $(MI) -XVFBSYSLIBS = $(FONTLIBS) $(SYSLIBS) -#if HasParallelMake -MakeMutex($(XVFBDIRS) $(XVFBOBJS) $(XVFB) $(XVFBLIBS) $(XVFBSYSLIBS)) -#endif -#if ForceServerRemake -$(XVFBOBJS) $(XVFB) $(XVFBLIBS) $(XVFBSYSLIBS):: $(XVFBDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -ServerTarget(Xvfb,$(XVFBDIRS),$(XVFBOBJS) $(XVFBDEFFILE), \ - $(LIBCWRAPPER) $(XVFBLIBS) $(LOADABLEEXTS),$(XVFBSYSLIBS)) -#endif /* XVirtualFramebufferServer */ - -#if defined(XdmxServer) && XdmxServer -XCOMM -XCOMM distribued multihead Server -XCOMM -#ifndef Win32Architecture -XDMXDDXDIR = hw/dmx -#else -XDMXDDXDIR = hw -#endif -FBDIR = fb -FBSUBDIR = fb -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -XDMXDIRS = $(STDDIRS) $(XDMXDDXDIR) $(SHADOWDIR) $(DEPDIRS) $(FBDIR) $(MIDAMAGEDIR) -#if BuildGlxExt -#if BuildXinerama -GLXPROXY_EXTRAOBJS = hw/dmx/panoramiX.o -#endif -GLXPROXYLIB = hw/dmx/glxProxy/LibraryTargetName(glxProxy) -#endif -#if !defined(LynxOSArchitecture) && \ - !defined(Win32Architecture) && \ - !defined(QNX4Architecture) -XDMXOBJS = hw/dmx/miinitext.o $(GLXPROXY_EXTRAOBJS) -#else -XDMXOBJS = hw/dmx/miinitext.o $(GLXPROXY_EXTRAOBJS) dix/main.o -#endif -XDMX = hw/dmx/LibraryTargetName(dmx) \ - hw/dmx/input/LibraryTargetName(dmxinput) \ - hw/dmx/config/LibraryTargetName(dmxconfig) \ - $(GLXPROXYLIB) -XDMXLIBS = PreFbLibs $(XDMX) MiExtLibs FbPostFbLibs $(XDMX) -#if BuildRender -XDMXRENDERLIB = $(XRENDERLIB) -#endif -XDMXSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XILIB) $(XLIB) $(SYSLIBS) $(XMULIB) $(XDMXRENDERLIB) -#if HasParallelMake -MakeMutex($(XDMXDIRS) $(XDMXOBJS) $(XDMXLIBS) $(XDMXSYSLIBS)) -#endif -#if ForceServerRemake -$(XDMXOBJS) $(XDMXLIBS) $(XDMXSYSLIBS):: $(XDMXDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif -ServerTarget(Xdmx,$(XDMXDIRS),$(XDMXOBJS), \ - $(LIBCWRAPPER) $(XDMXLIBS) $(LOADABLEEXTS),$(XDMXSYSLIBS)) -#endif /* XdmxServer */ - -#if defined(XWinServer) && XWinServer -XCOMM -XCOMM X Server for MS Windows -XCOMM -FBSUBDIR = fb -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -#if BuildXWinLayer -LAYERDIR = miext/layer -XWINLAYERLIB = $(LAYER) -#else -LAYERDIR = -XWINLAYERLIB = -#endif -#if BuildXWinMultiWindowExtWM -ROOTLESSDIR = miext/rootless -ROOTLESSLIB = $(ROOTLESSDIR)/LibraryTargetName(rootless) \ - $(ROOTLESSDIR)/safeAlpha/LibraryTargetName(safeAlpha) \ - $(ROOTLESSDIR)/accel/LibraryTargetName(rlAccel) -#else -ROOTLESSDIR = -ROOTLESSLIB = -#endif -XWINDDXDIR = hw/xwin -#if BuildXWinXF86Config -XWINPARSERDIR = hw/xfree86/parser -XWINPARSERLIB = $(XWINPARSERDIR)/LibraryTargetName(xf86config) -#else -XWINPARSERDIR = -XWINPARSERLIB = -#endif -#if defined(GlxUseWindows) && GlxUseWindows -XWINOPENGLLIB = -lopengl32 -#else -XWINOPENGLLIB = -#endif - -XWINLIB = $(XWINDDXDIR)/LibraryTargetName(XWin) -XWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(LAYERDIR) $(XWINDDXDIR) \ - $(DEPDIRS) $(XWINPARSERDIR) $(ROOTLESSDIR) $(MIDAMAGEDIR) -XWINOBJS = $(XWINDDXDIR)/stubs.o $(XWINDDXDIR)/XWin.res -XWINLIBS = PreFbLibs $(XWINLIB) FbPostFbLibs $(XWINLIB) $(XWINLAYERLIB) \ - $(SHADOW) $(XWINPARSERLIB) $(ROOTLESSLIB) $(OS) -#if BuildXWinMultiWindow || BuildXWinClipboard -XWINX11 = $(XONLYLIB) -# if defined(Win32Architecture) -PTHREADLIB = -lpthreadGC2 -# endif -#endif -#if defined(Win32Architecture) -# if defined(GlxUseWindows) && GlxUseWindows -XWINGL32 = -lopengl32 -# endif -XWINW32 = -lgdi32 -lwsock32 $(XWINGL32) $(PTHREADLIB) -#else -XWINW32 = -lgdi32 -#endif -XWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XWINX11) $(SYSLIBS) $(XWINW32) - -EXTRA_LDOPTIONS = -e _mainCRTStartup - -#if HasParallelMake -MakeMutex($(XWINDIRS) $(XWINOBJS) $(XWINLIB) $(XWINLIBS) $(XWINSYSLIBS)) -#endif - -#if ForceServerRemake -$(XWINOBJS) $(XWINLIB) $(XWINLIBS) $(XWINSYSLIBS):: $(XWINDIRS) - @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi -#endif - -#ifdef mingwArchitecture -XWINSERVERNAME=Xming -XWINGLSERVERNAME=XmingGL -#else -XWINSERVERNAME=XWin -XWINGLSERVERNAME=XWin_GL -#endif -ServerTarget($(XWINSERVERNAME),$(XWINDIRS),$(XWINOBJS), \ - $(LIBCWRAPPER) $(XWINLIBS) $(LOADABLEEXTS),$(XWINSYSLIBS)) -#if defined(cygwinArchitecture) && defined(GlxUseWindows) && GlxUseWindows -ServerTarget($(XWINGLSERVERNAME),$(XWINDIRS),$(XWINOBJS), \ - $(LIBCWRAPPER) $(XWINLIBS) $(LOADABLEEXTS),$(XWINSYSLIBS) \ - $(XWINOPENGLLIB)) -#endif - -#ifndef ServerToInstall -# define ServerToInstall $(XWINSERVERNAME) -#endif - -#endif /* XWinServer */ - - -#ifdef DarwinArchitecture -/* - * To allow building even when building the client-side libraries is turned - * off, libraries in ProjectRoot are listed as dependencies for some targets. - * This causes problems unless we tell make where to find these dependencies. - */ -VPATH = $(BUILDLIBDIR):$(USRLIBDIR) -#endif - -#if defined(XDarwinServer) && XDarwinServer -XCOMM -XCOMM X Darwin server for Mac OS X / Darwin -XCOMM -FBSUBDIR = fb -MIDAMAGEDIR = miext/damage -SHADOWDIR = miext/shadow -ROOTLESSDIR = miext/rootless -DARWINDDXDIR = hw/darwin -DARWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(DARWINDDXDIR) $(DEPDIRS) -DARWINOBJS = $(DARWINDDXDIR)/miinitext.o -DARWINLIBS = PreFbLibs $(DARWINDDXDIR)/LibraryTargetName(darwin) -DARWINEXTLIBS = MiExtLibs FbPostFbLibs $(DARWINDDXDIR)/LibraryTargetName(darwin) -DARWINSYSLIBS = $(FONTLIBS) $(SYSLIBS) -framework IOKit -IOKITLIB = $(DARWINDDXDIR)/iokit/LibraryTargetName(iokit) - -/* - * IOKit X server - */ -SetUIDServerTarget(XDarwin,$(DARWINDIRS),$(DARWINOBJS), \ - $(DARWINLIBS) $(IOKITLIB) $(DARWINEXTLIBS),$(DARWINSYSLIBS)) - -#if DarwinQuartzSupport - -QUARTZDIR = $(DARWINDDXDIR)/quartz -QUARTZLIB = $(QUARTZDIR)/LibraryTargetName(XQuartz) -QUARTZSYSLIBS = -framework ApplicationServices -framework Cocoa \ - -framework CoreAudio -framework Carbon -ObjC -ROOTLESSLIB = $(ROOTLESSDIR)/LibraryTargetName(rootless) \ - $(ROOTLESSDIR)/safeAlpha/LibraryTargetName(safeAlpha) \ - $(ROOTLESSDIR)/accel/LibraryTargetName(rlAccel) -XPLUGINLIB = XpluginLibrary - -#if NothingOutsideProjectRoot -XDARWINAPPDIR = $(BINDIR)/XDarwin.app/Contents -#else -XDARWINAPPDIR = /Applications/XDarwin.app/Contents -#endif - -/* - * Quartz X server (installed in its application bundle) - */ -SetUIDServerTarget(XDarwinApp,$(DARWINDIRS),$(DARWINOBJS), \ - $(DARWINLIBS) $(QUARTZLIB) $(DARWINEXTLIBS), \ - $(DARWINSYSLIBS) $(QUARTZSYSLIBS) -u _miDCInitialize) - -install:: - $(MKDIRHIER) $(DESTDIR)$(XDARWINAPPDIR)/MacOS - $(MV) $(DESTDIR)$(BINDIR)/XDarwinApp \ - $(DESTDIR)$(XDARWINAPPDIR)/MacOS/XDarwin - -(cd $(DESTDIR)$(BINDIR); $(RM) XDarwinQuartz; \ - $(LN) $(XDARWINAPPDIR)/MacOS/XDarwin XDarwinQuartz) - -/* - * Display mode bundles for Quartz - * (installed in their own bundles inside XDarwin's) - */ -#if HasXplugin -XPRDIRS = $(QUARTZDIR)/xpr $(ROOTLESSDIR) $(ROOTLESSDIR)/safeAlpha -XPRLIBS = $(QUARTZDIR)/xpr/LibraryTargetName(xpr) $(ROOTLESSLIB) - -BundleProgramTarget(xpr,XDarwinApp,$(XPRDIRS),$(QUARTZDIR)/xpr/xprScreen.o, \ - $(XPRLIBS),-framework ApplicationServices \ - $(XPLUGINLIB),$(XDARWINAPPDIR)/Resources) -#endif - -CRDIRS = $(QUARTZDIR)/cr $(ROOTLESSDIR) $(ROOTLESSDIR)/safeAlpha -CRLIBS = $(QUARTZDIR)/cr/LibraryTargetName(cr) $(ROOTLESSLIB) - -BundleProgramTarget(cr,XDarwinApp,$(CRDIRS),$(QUARTZDIR)/cr/crScreen.o, \ - $(CRLIBS),-framework ApplicationServices -framework Cocoa \ - -framework Carbon -ObjC,$(XDARWINAPPDIR)/Resources) - -FSDIRS = $(QUARTZDIR)/fullscreen $(SHADOWDIR) -FSLIBS = $(QUARTZDIR)/fullscreen/LibraryTargetName(fullscreen) $(SHADOW) - -BundleProgramTarget(fullscreen,XDarwinApp,$(FSDIRS), \ - $(QUARTZDIR)/fullscreen/fullscreen.o,$(FSLIBS), \ - -framework ApplicationServices,$(XDARWINAPPDIR)/Resources) - -/* - * GLX bundles for Quartz - * (installed in their own bundles inside XDarwin's) - */ -BundleProgramTarget(glxAGL,XDarwinApp,GL,GL/glx/glxext.o,GL/glx/libglx.a \ - GL/apple/libAGLcore.a, \ - -framework AGL -framework OpenGL,$(XDARWINAPPDIR)/Resources) - -#if BuildAppleDRI -BundleProgramTarget(glxCGL,XDarwinApp,GL,GL/glx/glxext.o,GL/glx/libglx.a \ - GL/apple/libCGLcore.a, \ - -framework OpenGL $(XPLUGINLIB),$(XDARWINAPPDIR)/Resources) -#endif - -BundleProgramTarget(glxMesa,XDarwinApp,GL,GL/glx/glxext.o,GL/glx/libglx.a \ - GL/mesa/GLcore/libGLcore.a,NullParameter,$(XDARWINAPPDIR)/Resources) - -#else /* !DarwinQuartzSupport */ - -#define ServerToInstall XDarwin - -#endif /* DarwinQuartzSupport */ - -#endif /* XDarwinServer */ - - -CFBSUBDIRS = $(CFB8SUBDIR) $(CFB16SUBDIR) $(CFB24SUBDIR) $(CFB32SUBDIR) -MIEXTDIRS = $(SHADOWDIR) $(LAYERDIR) $(ROOTLESSDIR) $(MIDAMAGEDIR) -IPLANDIRS = $(IPLAN2P2DIR) $(IPLAN2P4DIR) $(IPLAN2P8DIR) -DDXDIRS = $(DECWSDDXDIR) $(SUNDDXDIR) $(LYNXDDXDIR) \ - $(HPDDXDIR) $(XFREE86DDXDIR) $(XWINDDXDIR) $(DARWINDDXDIR) \ - $(XVFBDDXDIR) $(XNESTDDXDIR) $(XDMXDDXDIR) -SUBDIRS = $(STDDIRS) $(MFBSUBDIR) $(CFBSUBDIRS) \ - $(IPLANDIRS) $(ILBMDIR) $(AFBSUBDIR) \ - $(DDXDIRS) $(FBSUBDIR) $(KDRIVEDIRS) $(MIEXTDIRS) - -#if defined(ServerToInstall) && !defined(OS2Architecture) -install:: - -(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) ServerToInstall X) -#endif - -#define IHaveSubdirs - -DependSubdirs($(SUBDIRS)) -MakeLintLibSubdirs($(SUBDIRS)) -LintSubdirs($(SUBDIRS)) - -ForceSubdirs($(DEPDIRS) $(SUBDIRS)) - -DEFAULTFONTPATH = DefaultFontPath -EXTRAMANDEFS = -D__default_font_path__="`echo $(DEFAULTFONTPATH) | sed -e 's/,/, /g'`" - -InstallManPage(Xserver,$(MANDIR)) - -#if MakeDllModules && DoLoadableServer && \ - (defined(SunArchitecture) && defined(SVR4Architecture)) -XCOMM Hackery for building dlopen-able .so modules on Solaris - -AllTarget(linker-deps) - -LINKER_DEPS_DIRS = $(SUBDIRS) $(FONTLIBSRC) - -XCOMM After everything is built, run through and generate linker dependencies -linker-deps: - RunPerlScript($(XF86SRC)/os-support/sunos/find_deps.pl,-R ProjectRoot $(LINKER_DEPS_DIRS)) - for i in $(LINKER_DEPS_DIRS) ; do \ - echo "relinking with dependency flags in $(CURRENT_DIR)/$$i..."; \ - MakeNamedTargetSubdir($$i,NullParameter,all) ; \ - done -#endif diff --git a/nx-X11/programs/Xserver/Xext/Imakefile.NX.original b/nx-X11/programs/Xserver/Xext/Imakefile.NX.original deleted file mode 100644 index b75f8913b..000000000 --- a/nx-X11/programs/Xserver/Xext/Imakefile.NX.original +++ /dev/null @@ -1,226 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/Imakefile,v 1.9 2005/04/24 01:10:12 gisburn Exp $ */ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:55 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/Xext/Imakefile,v 3.43 2003/04/21 18:56:48 sven Exp $ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#include - -#if DoLoadableServer -#define IHaveSubdirs -SUBDIRS = extmod -#endif - -#if BuildEVI -#ifdef SGIArchitectureNotTog - EVISRCS = EVI.c sgiEVI.c - EVIOBJS = EVI.o sgiEVI.o -#else - EVISRCS = EVI.c sampleEVI.c - EVIOBJS = EVI.o sampleEVI.o -#endif -#endif -#if HasShm - SHMSRCS = shm.c - SHMOBJS = shm.o -#endif - -#if BuildMultibuffer - MULTIBUFSRC = mbuf.c - MULTIBUFOBJ = mbuf.o -#endif - -#if BuildScreenSaverExt - SCRNSAVSRC = saver.c - SCRNSAVOBJ = saver.o -#endif - -#if BuildXF86VidModeExt && \ - ((defined(XF86Server) && XF86Server) || \ - (defined(XorgServer) && XorgServer)) - VIDMODESRCS = xf86vmode.c - VIDMODEOBJS = xf86vmode.o -#endif - -#if BuildXF86MiscExt && \ - ((defined(XF86Server) && XF86Server) || \ - (defined(XorgServer) && XorgServer)) -XF86MISCSRCS = xf86misc.c -XF86MISCOBJS = xf86misc.o -#endif - -#if BuildXF86BigfontExt -XF86BIGFSRCS = xf86bigfont.c -XF86BIGFOBJS = xf86bigfont.o -#if HasShm - SHM_DEFINES = -DHAS_SHM -#endif -#endif - -#if BuildXF86DGA - XF86DGASRCS = xf86dga.c xf86dga2.c - XF86DGAOBJS = xf86dga.o xf86dga2.o -#if HasShm - XVMCSHM_DEFINES = -DHAS_XVMCSHM -#endif -#endif - -#if BuildXvExt - XVSRCS = xvmain.c xvdisp.c xvmc.c - XVOBJS = xvmain.o xvdisp.o xvmc.o -#endif - -#if BuildXResExt - XRESSRCS = xres.c - XRESOBJS = xres.o -#endif - -#if BuildAppgroup - APPGROUPSRCS = appgroup.c - APPGROUPOBJS = appgroup.o -#endif -#if BuildXCSecurity - SECURITYSRCS = security.c - SECURITYOBJS = security.o - SERVERCONFIGDIR = ServerConfigDir - POLICYFILEDEF = -DDEFAULTPOLICYFILE=\"$(SERVERCONFIGDIR)/SecurityPolicy\" -#endif -#if BuildCup - CUPSRCS = cup.c - CUPOBJS = cup.o -#endif -#if BuildXinerama - PNRXSRCS = panoramiX.c panoramiXSwap.c panoramiXprocs.c - PNRXOBJS = panoramiX.o panoramiXSwap.o panoramiXprocs.o - PNRXINCLUDES = -I$(FONTINCSRC) -I../mi -I../render -#endif -#if XdmxServer - DMXSRCS = dmx.c - DMXOBJS = dmx.o - DMXINCLUDES = -I../hw/dmx -#endif -#if BuildDPMS - DPMSSRCS = dpms.c - DPMSOBJS = dpms.o -#endif - -#if BuildFontCache - FONTCACHESRCS = fontcache.c - FONTCACHEOBJS = fontcache.o -#if 0 - FONTCACHEINCLUDES = -I$(XF86SRC)/os-support -#endif -#endif - -#if BuildXevie - XEVIESRCS = xevie.c - XEVIEOBJS = xevie.o -#endif - -#if BuildXprint - XPRINTSRCS = xprint.c - XPRINTOBJS = xprint.o -#endif - - SRCS = shape.c $(SHMSRCS) $(MULTIBUFSRC) \ - mitmisc.c xtest.c xtest1di.c xtest1dd.c sleepuntil.c \ - bigreq.c sync.c $(SCRNSAVSRC) xcmisc.c $(VIDMODESRCS) \ - $(XF86MISCSRCS) $(XF86BIGFSRCS) $(XF86DGASRCS) $(SECURITYSRCS) \ - $(APPGROUPSRCS) $(XPRINTSRCS) $(CUPSRCS) $(PNRXSRCS) $(DPMSSRCS) \ - $(XEVIESRCS) \ - $(EVISRCS) $(XVSRCS) $(FONTCACHESRCS) $(XRESSRCS) $(DMXSRCS) - - OBJS = shape.o $(SHMOBJS) $(MULTIBUFOBJ) \ - mitmisc.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o \ - bigreq.o sync.o $(SCRNSAVOBJ) xcmisc.o $(VIDMODEOBJS) \ - $(XF86MISCOBJS) $(XF86BIGFOBJS) $(XF86DGAOBJS) $(SECURITYOBJS) \ - $(APPGROUPOBJS) $(XPRINTOBJS) $(CUPOBJS) $(PNRXOBJS) $(DPMSOBJS) \ - $(XEVIEOBJS) \ - $(EVIOBJS) $(XVOBJS) $(FONTCACHEOBJS) $(XRESOBJS) $(DMXOBJS) - - SOBJS = $(SHMOBJS) $(APPGROUPOBJS) $(SECURITYOBJS) $(XPRINTOBJS) \ - shape.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o $(PNRXOBJS) \ - $(XEVIEOBJS) \ - $(XF86BIGFOBJS) - -#if defined(NXAgentServer) && NXAgentServer -NX_DEFINES = -DNXAGENT_SERVER -#endif - - -#if (defined(XFree86Version) || defined(XorgVersion)) -/* XXX Check if this can be eliminated */ -XF86INCLUDES = -I$(XF86COMSRC) -#endif - INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - $(PNRXINCLUDES) $(XF86INCLUDES) -I$(FONTINCSRC) \ - $(FONTCACHEINCLUDES) $(DMXINCLUDES) - LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln - -#if defined(NXAgentServer) && NXAgentServer - DEFINES = $(EXT_DEFINES) $(XVMCSHM_DEFINES) $(NX_DEFINES) -#else - DEFINES = $(EXT_DEFINES) $(XVMCSHM_DEFINES) -#endif - -NormalLibraryObjectRule() - -/* - * A hack to work around an optimization problem with gcc 2.95.2 - */ -#if BuildXF86VidModeExt && defined(GccOptBug295) -SpecialCObjectRule(xf86vmode,NullParameter,-O0) -#endif - -NormalLibraryTarget(ext,$(OBJS)) -LintLibraryTarget(ext,$(SRCS)) -NormalLintTarget($(SRCS)) - -#if DoLoadableServer -NormalLibraryTarget(exts,$(SOBJS)) -#endif - -#if BuildXF86BigfontExt -SpecialCObjectRule(xf86bigfont,$(ICONFIGFILES),$(SHM_DEFINES)) -#endif -#if BuildXCSecurity -SpecialCObjectRule(security,$(ICONFIGFILES),$(POLICYFILEDEF)) -#endif - -LinkConfDirectory(xserver,.,xserver,.) - -LinkSourceFile(modinit.h,extmod) - -#if BuildXCSecurity && InstallSecurityConfig -InstallNonExecFile(SecurityPolicy,$(SERVERCONFIGDIR)) -#endif - -DependTarget() - -#if DoLoadableServer -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -InstallDriverSDKNonExecFile(dgaproc.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xvdix.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xvmcext.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/Xext/Imakefile.X.original b/nx-X11/programs/Xserver/Xext/Imakefile.X.original deleted file mode 100644 index f2753b3f4..000000000 --- a/nx-X11/programs/Xserver/Xext/Imakefile.X.original +++ /dev/null @@ -1,200 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/Imakefile,v 1.9 2005/04/24 01:10:12 gisburn Exp $ */ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:55 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/Xext/Imakefile,v 3.43 2003/04/21 18:56:48 sven Exp $ - -#include - -#if DoLoadableServer -#define IHaveSubdirs -SUBDIRS = extmod -#endif - -#if BuildEVI -#ifdef SGIArchitectureNotTog - EVISRCS = EVI.c sgiEVI.c - EVIOBJS = EVI.o sgiEVI.o -#else - EVISRCS = EVI.c sampleEVI.c - EVIOBJS = EVI.o sampleEVI.o -#endif -#endif -#if HasShm - SHMSRCS = shm.c - SHMOBJS = shm.o -#endif - -#if BuildMultibuffer - MULTIBUFSRC = mbuf.c - MULTIBUFOBJ = mbuf.o -#endif - -#if BuildScreenSaverExt - SCRNSAVSRC = saver.c - SCRNSAVOBJ = saver.o -#endif - -#if BuildXF86VidModeExt && \ - ((defined(XF86Server) && XF86Server) || \ - (defined(XorgServer) && XorgServer)) - VIDMODESRCS = xf86vmode.c - VIDMODEOBJS = xf86vmode.o -#endif - -#if BuildXF86MiscExt && \ - ((defined(XF86Server) && XF86Server) || \ - (defined(XorgServer) && XorgServer)) -XF86MISCSRCS = xf86misc.c -XF86MISCOBJS = xf86misc.o -#endif - -#if BuildXF86BigfontExt -XF86BIGFSRCS = xf86bigfont.c -XF86BIGFOBJS = xf86bigfont.o -#if HasShm - SHM_DEFINES = -DHAS_SHM -#endif -#endif - -#if BuildXF86DGA - XF86DGASRCS = xf86dga.c xf86dga2.c - XF86DGAOBJS = xf86dga.o xf86dga2.o -#if HasShm - XVMCSHM_DEFINES = -DHAS_XVMCSHM -#endif -#endif - -#if BuildXvExt - XVSRCS = xvmain.c xvdisp.c xvmc.c - XVOBJS = xvmain.o xvdisp.o xvmc.o -#endif - -#if BuildXResExt - XRESSRCS = xres.c - XRESOBJS = xres.o -#endif - -#if BuildAppgroup - APPGROUPSRCS = appgroup.c - APPGROUPOBJS = appgroup.o -#endif -#if BuildXCSecurity - SECURITYSRCS = security.c - SECURITYOBJS = security.o - SERVERCONFIGDIR = ServerConfigDir - POLICYFILEDEF = -DDEFAULTPOLICYFILE=\"$(SERVERCONFIGDIR)/SecurityPolicy\" -#endif -#if BuildCup - CUPSRCS = cup.c - CUPOBJS = cup.o -#endif -#if BuildXinerama - PNRXSRCS = panoramiX.c panoramiXSwap.c panoramiXprocs.c - PNRXOBJS = panoramiX.o panoramiXSwap.o panoramiXprocs.o - PNRXINCLUDES = -I$(FONTINCSRC) -I../mi -I../render -#endif -#if XdmxServer - DMXSRCS = dmx.c - DMXOBJS = dmx.o - DMXINCLUDES = -I../hw/dmx -#endif -#if BuildDPMS - DPMSSRCS = dpms.c - DPMSOBJS = dpms.o -#endif - -#if BuildFontCache - FONTCACHESRCS = fontcache.c - FONTCACHEOBJS = fontcache.o -#if 0 - FONTCACHEINCLUDES = -I$(XF86SRC)/os-support -#endif -#endif - -#if BuildXevie - XEVIESRCS = xevie.c - XEVIEOBJS = xevie.o -#endif - -#if BuildXprint - XPRINTSRCS = xprint.c - XPRINTOBJS = xprint.o -#endif - - SRCS = shape.c $(SHMSRCS) $(MULTIBUFSRC) \ - mitmisc.c xtest.c xtest1di.c xtest1dd.c sleepuntil.c \ - bigreq.c sync.c $(SCRNSAVSRC) xcmisc.c $(VIDMODESRCS) \ - $(XF86MISCSRCS) $(XF86BIGFSRCS) $(XF86DGASRCS) $(SECURITYSRCS) \ - $(APPGROUPSRCS) $(XPRINTSRCS) $(CUPSRCS) $(PNRXSRCS) $(DPMSSRCS) \ - $(XEVIESRCS) \ - $(EVISRCS) $(XVSRCS) $(FONTCACHESRCS) $(XRESSRCS) $(DMXSRCS) - - OBJS = shape.o $(SHMOBJS) $(MULTIBUFOBJ) \ - mitmisc.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o \ - bigreq.o sync.o $(SCRNSAVOBJ) xcmisc.o $(VIDMODEOBJS) \ - $(XF86MISCOBJS) $(XF86BIGFOBJS) $(XF86DGAOBJS) $(SECURITYOBJS) \ - $(APPGROUPOBJS) $(XPRINTOBJS) $(CUPOBJS) $(PNRXOBJS) $(DPMSOBJS) \ - $(XEVIEOBJS) \ - $(EVIOBJS) $(XVOBJS) $(FONTCACHEOBJS) $(XRESOBJS) $(DMXOBJS) - - SOBJS = $(SHMOBJS) $(APPGROUPOBJS) $(SECURITYOBJS) $(XPRINTOBJS) \ - shape.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o $(PNRXOBJS) \ - $(XEVIEOBJS) \ - $(XF86BIGFOBJS) - -#if (defined(XFree86Version) || defined(XorgVersion)) -/* XXX Check if this can be eliminated */ -XF86INCLUDES = -I$(XF86COMSRC) -#endif - INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - $(PNRXINCLUDES) $(XF86INCLUDES) -I$(FONTINCSRC) \ - $(FONTCACHEINCLUDES) $(DMXINCLUDES) - LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln - - DEFINES = $(EXT_DEFINES) $(XVMCSHM_DEFINES) - -NormalLibraryObjectRule() - -/* - * A hack to work around an optimization problem with gcc 2.95.2 - */ -#if BuildXF86VidModeExt && defined(GccOptBug295) -SpecialCObjectRule(xf86vmode,NullParameter,-O0) -#endif - -NormalLibraryTarget(ext,$(OBJS)) -LintLibraryTarget(ext,$(SRCS)) -NormalLintTarget($(SRCS)) - -#if DoLoadableServer -NormalLibraryTarget(exts,$(SOBJS)) -#endif - -#if BuildXF86BigfontExt -SpecialCObjectRule(xf86bigfont,$(ICONFIGFILES),$(SHM_DEFINES)) -#endif -#if BuildXCSecurity -SpecialCObjectRule(security,$(ICONFIGFILES),$(POLICYFILEDEF)) -#endif - -LinkConfDirectory(xserver,.,xserver,.) - -LinkSourceFile(modinit.h,extmod) - -#if BuildXCSecurity && InstallSecurityConfig -InstallNonExecFile(SecurityPolicy,$(SERVERCONFIGDIR)) -#endif - -DependTarget() - -#if DoLoadableServer -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -InstallDriverSDKNonExecFile(dgaproc.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xvdix.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(xvmcext.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/Xext/security.c.NX.original b/nx-X11/programs/Xserver/Xext/security.c.NX.original deleted file mode 100644 index 2139425b4..000000000 --- a/nx-X11/programs/Xserver/Xext/security.c.NX.original +++ /dev/null @@ -1,2245 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/security.c,v 1.5 2005/07/03 07:01:04 daniels Exp $ */ -/* $Xorg: security.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/programs/Xserver/Xext/security.c,v 1.16tsi Exp $ */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "dixstruct.h" -#include "extnsionst.h" -#include "windowstr.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "colormapst.h" -#include "propertyst.h" -#define _SECURITY_SERVER -#include -#include -#include -#ifdef LBX -#define _XLBX_SERVER_ -#include -extern unsigned char LbxReqCode; -#endif -#ifdef XAPPGROUP -#include -#endif -#include /* for file reading operations */ -#include /* for XA_STRING */ - -#ifdef NXAGENT_SERVER - -#include -#include -#include -#include - -#endif - -#ifndef DEFAULTPOLICYFILE -# define DEFAULTPOLICYFILE NULL -#endif - -#ifdef NXAGENT_SERVER - -#define NX_ALTERNATIVEPOLICYFILE "/usr/lib/xserver/SecurityPolicy" - -#endif - -#if defined(WIN32) || defined(__CYGWIN__) -#include -#undef index -#endif - -/* - * Set here the required NX log level. - */ - -#ifdef NXAGENT_SERVER - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -#endif - -#ifdef NXAGENT_SERVER - -static char _NXPolicyFilePath[1024]; - -#endif - -#include "modinit.h" - -static int SecurityErrorBase; /* first Security error number */ -static int SecurityEventBase; /* first Security event number */ - -CallbackListPtr SecurityValidateGroupCallback = NULL; /* see security.h */ - -RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */ - -static RESTYPE RTEventClient; - -/* Proc vectors for untrusted clients, swapped and unswapped versions. - * These are the same as the normal proc vectors except that extensions - * that haven't declared themselves secure will have ProcBadRequest plugged - * in for their major opcode dispatcher. This prevents untrusted clients - * from guessing extension major opcodes and using the extension even though - * the extension can't be listed or queried. - */ -int (*UntrustedProcVector[256])( - ClientPtr /*client*/ -); -int (*SwappedUntrustedProcVector[256])( - ClientPtr /*client*/ -); - -#ifdef NXAGENT_SERVER - -/* - * This function returns the SecurityPolicy - * file full path. This path is referred by - * SecurityPolicyFile variable (generally it - * contains the hardcoded path at compile time). - * If the path does not exist, the function will - * try a set of well known paths. - */ - -const char *_NXGetPolicyFilePath(const char *path) -{ - - struct stat SecurityPolicyStat; - - /* - * Check the policy file path only once. - */ - - if (*_NXPolicyFilePath != '\0') - { - return _NXPolicyFilePath; - } - - if (stat(path, &SecurityPolicyStat) == 0) - { - if (strlen(path) + 1 > 1024) - { - #ifdef WARNING - fprintf(stderr, "_NXGetPolicyFilePath: WARNING! Maximum length of SecurityPolicy file path exceeded.\n"); - #endif - - goto _NXGetPolicyFilePathError; - } - - strcpy(_NXPolicyFilePath, path); - - #ifdef TEST - fprintf(stderr, "_NXGetPolicyFilePath: Using SecurityPolicy file path [%s].\n", - _NXPolicyFilePath); - #endif - - return _NXPolicyFilePath; - } - - if (stat(DEFAULTPOLICYFILE, &SecurityPolicyStat) == 0) - { - if (strlen(DEFAULTPOLICYFILE) + 1 > 1024) - { - #ifdef WARNING - fprintf(stderr, "_NXGetPolicyFilePath: WARNING! Maximum length of SecurityPolicy file path exceeded.\n"); - #endif - - goto _NXGetPolicyFilePathError; - } - - strcpy(_NXPolicyFilePath, DEFAULTPOLICYFILE); - - #ifdef TEST - fprintf(stderr, "_NXGetPolicyFilePath: Using SecurityPolicy file path [%s].\n", - _NXPolicyFilePath); - #endif - - return _NXPolicyFilePath; - } - - if (stat(NX_ALTERNATIVEPOLICYFILE, &SecurityPolicyStat) == 0) - { - if (strlen(NX_ALTERNATIVEPOLICYFILE) + 1 > 1024) - { - #ifdef WARNING - fprintf(stderr, "_NXGetPolicyFilePath: WARNING! Maximum length of SecurityPolicy file path exceeded.\n"); - #endif - - goto _NXGetPolicyFilePathError; - } - - strcpy(_NXPolicyFilePath, NX_ALTERNATIVEPOLICYFILE); - - #ifdef TEST - fprintf(stderr, "_NXGetPolicyFilePath: Using SecurityPolicy file path [%s].\n", - _NXPolicyFilePath); - #endif - - return _NXPolicyFilePath; - } - -_NXGetPolicyFilePathError: - - if (strlen(path) + 1 > 1024) - { - #ifdef WARNING - fprintf(stderr, "_NXGetPolicyFilePath: WARNING! Maximum length of SecurityPolicy file exceeded.\n"); - #endif - } - - strcpy(_NXPolicyFilePath, path); - - #ifdef TEST - fprintf(stderr, "_NXGetPolicyFilePath: Using default SecurityPolicy file path [%s].\n", - _NXPolicyFilePath); - #endif - - return _NXPolicyFilePath; -} - -#endif - -/* SecurityAudit - * - * Arguments: - * format is the formatting string to be used to interpret the - * remaining arguments. - * - * Returns: nothing. - * - * Side Effects: - * Writes the message to the log file if security logging is on. - */ - -void -SecurityAudit(char *format, ...) -{ - va_list args; - - if (auditTrailLevel < SECURITY_AUDIT_LEVEL) - return; - va_start(args, format); - VAuditF(format, args); - va_end(args); -} /* SecurityAudit */ - -#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) - -/* SecurityDeleteAuthorization - * - * Arguments: - * value is the authorization to delete. - * id is its resource ID. - * - * Returns: Success. - * - * Side Effects: - * Frees everything associated with the authorization. - */ - -static int -SecurityDeleteAuthorization( - pointer value, - XID id) -{ - SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value; - unsigned short name_len, data_len; - char *name, *data; - int status; - int i; - OtherClientsPtr pEventClient; - - /* Remove the auth using the os layer auth manager */ - - status = AuthorizationFromID(pAuth->id, &name_len, &name, - &data_len, &data); - assert(status); - status = RemoveAuthorization(name_len, name, data_len, data); - assert(status); - (void)status; - - /* free the auth timer if there is one */ - - if (pAuth->timer) TimerFree(pAuth->timer); - - /* send revoke events */ - - while ((pEventClient = pAuth->eventClients)) - { - /* send revocation event event */ - ClientPtr client = rClient(pEventClient); - - if (!client->clientGone) - { - xSecurityAuthorizationRevokedEvent are; - are.type = SecurityEventBase + XSecurityAuthorizationRevoked; - are.sequenceNumber = client->sequence; - are.authId = pAuth->id; - WriteEventsToClient(client, 1, (xEvent *)&are); - } - FreeResource(pEventClient->resource, RT_NONE); - } - - /* kill all clients using this auth */ - - for (i = 1; iauthId == pAuth->id)) - CloseDownClient(clients[i]); - } - - SecurityAudit("revoked authorization ID %d\n", pAuth->id); - xfree(pAuth); - return Success; - -} /* SecurityDeleteAuthorization */ - - -/* resource delete function for RTEventClient */ -static int -SecurityDeleteAuthorizationEventClient( - pointer value, - XID id) -{ - OtherClientsPtr pEventClient, prev = NULL; - SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value; - - for (pEventClient = pAuth->eventClients; - pEventClient; - pEventClient = pEventClient->next) - { - if (pEventClient->resource == id) - { - if (prev) - prev->next = pEventClient->next; - else - pAuth->eventClients = pEventClient->next; - xfree(pEventClient); - return(Success); - } - prev = pEventClient; - } - /*NOTREACHED*/ - return -1; /* make compiler happy */ -} /* SecurityDeleteAuthorizationEventClient */ - - -/* SecurityComputeAuthorizationTimeout - * - * Arguments: - * pAuth is the authorization for which we are computing the timeout - * seconds is the number of seconds we want to wait - * - * Returns: - * the number of milliseconds that the auth timer should be set to - * - * Side Effects: - * Sets pAuth->secondsRemaining to any "overflow" amount of time - * that didn't fit in 32 bits worth of milliseconds - */ - -static CARD32 -SecurityComputeAuthorizationTimeout( - SecurityAuthorizationPtr pAuth, - unsigned int seconds) -{ - /* maxSecs is the number of full seconds that can be expressed in - * 32 bits worth of milliseconds - */ - CARD32 maxSecs = (CARD32)(~0) / (CARD32)MILLI_PER_SECOND; - - if (seconds > maxSecs) - { /* only come here if we want to wait more than 49 days */ - pAuth->secondsRemaining = seconds - maxSecs; - return maxSecs * MILLI_PER_SECOND; - } - else - { /* by far the common case */ - pAuth->secondsRemaining = 0; - return seconds * MILLI_PER_SECOND; - } -} /* SecurityStartAuthorizationTimer */ - -/* SecurityAuthorizationExpired - * - * This function is passed as an argument to TimerSet and gets called from - * the timer manager in the os layer when its time is up. - * - * Arguments: - * timer is the timer for this authorization. - * time is the current time. - * pval is the authorization whose time is up. - * - * Returns: - * A new time delay in milliseconds if the timer should wait some - * more, else zero. - * - * Side Effects: - * Frees the authorization resource if the timeout period is really - * over, otherwise recomputes pAuth->secondsRemaining. - */ - -static CARD32 -SecurityAuthorizationExpired( - OsTimerPtr timer, - CARD32 time, - pointer pval) -{ - SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval; - - assert(pAuth->timer == timer); - - if (pAuth->secondsRemaining) - { - return SecurityComputeAuthorizationTimeout(pAuth, - pAuth->secondsRemaining); - } - else - { - FreeResource(pAuth->id, RT_NONE); - return 0; - } -} /* SecurityAuthorizationExpired */ - -/* SecurityStartAuthorizationTimer - * - * Arguments: - * pAuth is the authorization whose timer should be started. - * - * Returns: nothing. - * - * Side Effects: - * A timer is started, set to expire after the timeout period for - * this authorization. When it expires, the function - * SecurityAuthorizationExpired will be called. - */ - -static void -SecurityStartAuthorizationTimer( - SecurityAuthorizationPtr pAuth) -{ - pAuth->timer = TimerSet(pAuth->timer, 0, - SecurityComputeAuthorizationTimeout(pAuth, pAuth->timeout), - SecurityAuthorizationExpired, pAuth); -} /* SecurityStartAuthorizationTimer */ - - -/* Proc functions all take a client argument, execute the request in - * client->requestBuffer, and return a protocol error status. - */ - -static int -ProcSecurityQueryVersion( - ClientPtr client) -{ - /* REQUEST(xSecurityQueryVersionReq); */ - xSecurityQueryVersionReply rep; - - /* paranoia: this "can't happen" because this extension is hidden - * from untrusted clients, but just in case... - */ - if (client->trustLevel != XSecurityClientTrusted) - return BadRequest; - - REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.majorVersion = SECURITY_MAJOR_VERSION; - rep.minorVersion = SECURITY_MINOR_VERSION; - if(client->swapped) - { - register char n; - swaps(&rep.sequenceNumber, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - } - (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), - (char *)&rep); - return (client->noClientException); -} /* ProcSecurityQueryVersion */ - - -static int -SecurityEventSelectForAuthorization( - SecurityAuthorizationPtr pAuth, - ClientPtr client, - Mask mask) -{ - OtherClients *pEventClient; - - for (pEventClient = pAuth->eventClients; - pEventClient; - pEventClient = pEventClient->next) - { - if (SameClient(pEventClient, client)) - { - if (mask == 0) - FreeResource(pEventClient->resource, RT_NONE); - else - pEventClient->mask = mask; - return Success; - } - } - - pEventClient = (OtherClients *) xalloc(sizeof(OtherClients)); - if (!pEventClient) - return BadAlloc; - pEventClient->mask = mask; - pEventClient->resource = FakeClientID(client->index); - pEventClient->next = pAuth->eventClients; - if (!AddResource(pEventClient->resource, RTEventClient, - (pointer)pAuth)) - { - xfree(pEventClient); - return BadAlloc; - } - pAuth->eventClients = pEventClient; - - return Success; -} /* SecurityEventSelectForAuthorization */ - - -static int -ProcSecurityGenerateAuthorization( - ClientPtr client) -{ - REQUEST(xSecurityGenerateAuthorizationReq); - int len; /* request length in CARD32s*/ - Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */ - SecurityAuthorizationPtr pAuth = NULL; /* auth we are creating */ - int err; /* error to return from this function */ - XID authId; /* authorization ID assigned by os layer */ - xSecurityGenerateAuthorizationReply rep; /* reply struct */ - unsigned int trustLevel; /* trust level of new auth */ - XID group; /* group of new auth */ - CARD32 timeout; /* timeout of new auth */ - CARD32 *values; /* list of supplied attributes */ - char *protoname; /* auth proto name sent in request */ - char *protodata; /* auth proto data sent in request */ - unsigned int authdata_len; /* # bytes of generated auth data */ - char *pAuthdata; /* generated auth data */ - Mask eventMask; /* what events on this auth does client want */ - - /* paranoia: this "can't happen" because this extension is hidden - * from untrusted clients, but just in case... - */ - if (client->trustLevel != XSecurityClientTrusted) - return BadRequest; - - /* check request length */ - - REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq); - len = SIZEOF(xSecurityGenerateAuthorizationReq) >> 2; - len += (stuff->nbytesAuthProto + (unsigned)3) >> 2; - len += (stuff->nbytesAuthData + (unsigned)3) >> 2; - values = ((CARD32 *)stuff) + len; - len += Ones(stuff->valueMask); - if (client->req_len != len) - return BadLength; - - /* check valuemask */ - if (stuff->valueMask & ~XSecurityAllAuthorizationAttributes) - { - client->errorValue = stuff->valueMask; - return BadValue; - } - - /* check timeout */ - timeout = 60; - if (stuff->valueMask & XSecurityTimeout) - { - timeout = *values++; - } - - /* check trustLevel */ - trustLevel = XSecurityClientUntrusted; - if (stuff->valueMask & XSecurityTrustLevel) - { - trustLevel = *values++; - if (trustLevel != XSecurityClientTrusted && - trustLevel != XSecurityClientUntrusted) - { - client->errorValue = trustLevel; - return BadValue; - } - } - - /* check group */ - group = None; - if (stuff->valueMask & XSecurityGroup) - { - group = *values++; - if (SecurityValidateGroupCallback) - { - SecurityValidateGroupInfoRec vgi; - vgi.group = group; - vgi.valid = FALSE; - CallCallbacks(&SecurityValidateGroupCallback, (pointer)&vgi); - - /* if nobody said they recognized it, it's an error */ - - if (!vgi.valid) - { - client->errorValue = group; - return BadValue; - } - } - } - - /* check event mask */ - eventMask = 0; - if (stuff->valueMask & XSecurityEventMask) - { - eventMask = *values++; - if (eventMask & ~XSecurityAllEventMasks) - { - client->errorValue = eventMask; - return BadValue; - } - } - - protoname = (char *)&stuff[1]; - protodata = protoname + ((stuff->nbytesAuthProto + (unsigned)3) >> 2); - - /* call os layer to generate the authorization */ - - authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname, - stuff->nbytesAuthData, protodata, - &authdata_len, &pAuthdata); - if ((XID) ~0L == authId) - { - err = SecurityErrorBase + XSecurityBadAuthorizationProtocol; - goto bailout; - } - - /* now that we've added the auth, remember to remove it if we have to - * abort the request for some reason (like allocation failure) - */ - removeAuth = TRUE; - - /* associate additional information with this auth ID */ - - pAuth = (SecurityAuthorizationPtr)xalloc(sizeof(SecurityAuthorizationRec)); - if (!pAuth) - { - err = BadAlloc; - goto bailout; - } - - /* fill in the auth fields */ - - pAuth->id = authId; - pAuth->timeout = timeout; - pAuth->group = group; - pAuth->trustLevel = trustLevel; - pAuth->refcnt = 0; /* the auth was just created; nobody's using it yet */ - pAuth->secondsRemaining = 0; - pAuth->timer = NULL; - pAuth->eventClients = NULL; - - /* handle event selection */ - if (eventMask) - { - err = SecurityEventSelectForAuthorization(pAuth, client, eventMask); - if (err != Success) - goto bailout; - } - - if (!AddResource(authId, SecurityAuthorizationResType, pAuth)) - { - err = BadAlloc; - goto bailout; - } - - /* start the timer ticking */ - - if (pAuth->timeout != 0) - SecurityStartAuthorizationTimer(pAuth); - - /* tell client the auth id and data */ - - rep.type = X_Reply; - rep.length = (authdata_len + 3) >> 2; - rep.sequenceNumber = client->sequence; - rep.authId = authId; - rep.dataLength = authdata_len; - - if (client->swapped) - { - register char n; - swapl(&rep.length, n); - swaps(&rep.sequenceNumber, n); - swapl(&rep.authId, n); - swaps(&rep.dataLength, n); - } - - WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), - (char *)&rep); - WriteToClient(client, authdata_len, pAuthdata); - - SecurityAudit("client %d generated authorization %d trust %d timeout %d group %d events %d\n", - client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout, - pAuth->group, eventMask); - - /* the request succeeded; don't call RemoveAuthorization or free pAuth */ - - removeAuth = FALSE; - pAuth = NULL; - err = client->noClientException; - -bailout: - if (removeAuth) - RemoveAuthorization(stuff->nbytesAuthProto, protoname, - authdata_len, pAuthdata); - if (pAuth) xfree(pAuth); - return err; - -} /* ProcSecurityGenerateAuthorization */ - -static int -ProcSecurityRevokeAuthorization( - ClientPtr client) -{ - REQUEST(xSecurityRevokeAuthorizationReq); - SecurityAuthorizationPtr pAuth; - - /* paranoia: this "can't happen" because this extension is hidden - * from untrusted clients, but just in case... - */ - if (client->trustLevel != XSecurityClientTrusted) - return BadRequest; - - REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); - - pAuth = (SecurityAuthorizationPtr)SecurityLookupIDByType(client, - stuff->authId, SecurityAuthorizationResType, SecurityDestroyAccess); - if (!pAuth) - return SecurityErrorBase + XSecurityBadAuthorization; - - FreeResource(stuff->authId, RT_NONE); - return Success; -} /* ProcSecurityRevokeAuthorization */ - - -static int -ProcSecurityDispatch( - ClientPtr client) -{ - REQUEST(xReq); - - switch (stuff->data) - { - case X_SecurityQueryVersion: - return ProcSecurityQueryVersion(client); - case X_SecurityGenerateAuthorization: - return ProcSecurityGenerateAuthorization(client); - case X_SecurityRevokeAuthorization: - return ProcSecurityRevokeAuthorization(client); - default: - return BadRequest; - } -} /* ProcSecurityDispatch */ - -static int -SProcSecurityQueryVersion( - ClientPtr client) -{ - REQUEST(xSecurityQueryVersionReq); - register char n; - - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); - swaps(&stuff->majorVersion, n); - swaps(&stuff->minorVersion,n); - return ProcSecurityQueryVersion(client); -} /* SProcSecurityQueryVersion */ - - -static int -SProcSecurityGenerateAuthorization( - ClientPtr client) -{ - REQUEST(xSecurityGenerateAuthorizationReq); - register char n; - CARD32 *values; - unsigned long nvalues; - int values_offset; - - swaps(&stuff->length, n); - REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq); - swaps(&stuff->nbytesAuthProto, n); - swaps(&stuff->nbytesAuthData, n); - swapl(&stuff->valueMask, n); - values_offset = ((stuff->nbytesAuthProto + (unsigned)3) >> 2) + - ((stuff->nbytesAuthData + (unsigned)3) >> 2); - if (values_offset > - stuff->length - (sz_xSecurityGenerateAuthorizationReq >> 2)) - return BadLength; - values = (CARD32 *)(&stuff[1]) + values_offset; - nvalues = (((CARD32 *)stuff) + stuff->length) - values; - SwapLongs(values, nvalues); - return ProcSecurityGenerateAuthorization(client); -} /* SProcSecurityGenerateAuthorization */ - - -static int -SProcSecurityRevokeAuthorization( - ClientPtr client) -{ - REQUEST(xSecurityRevokeAuthorizationReq); - register char n; - - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); - swapl(&stuff->authId, n); - return ProcSecurityRevokeAuthorization(client); -} /* SProcSecurityRevokeAuthorization */ - - -static int -SProcSecurityDispatch( - ClientPtr client) -{ - REQUEST(xReq); - - switch (stuff->data) - { - case X_SecurityQueryVersion: - return SProcSecurityQueryVersion(client); - case X_SecurityGenerateAuthorization: - return SProcSecurityGenerateAuthorization(client); - case X_SecurityRevokeAuthorization: - return SProcSecurityRevokeAuthorization(client); - default: - return BadRequest; - } -} /* SProcSecurityDispatch */ - -static void -SwapSecurityAuthorizationRevokedEvent( - xSecurityAuthorizationRevokedEvent *from, - xSecurityAuthorizationRevokedEvent *to) -{ - to->type = from->type; - to->detail = from->detail; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->authId, to->authId); -} - -/* SecurityDetermineEventPropogationLimits - * - * This is a helper function for SecurityCheckDeviceAccess. - * - * Arguments: - * dev is the device for which the starting and stopping windows for - * event propogation should be determined. - * The values pointed to by ppWin and ppStopWin are not used. - * - * Returns: - * ppWin is filled in with a pointer to the window at which event - * propogation for the given device should start given the current - * state of the server (pointer position, window layout, etc.) - * ppStopWin is filled in with the window at which event propogation - * should stop; events should not go to ppStopWin. - * - * Side Effects: none. - */ - -static void -SecurityDetermineEventPropogationLimits( - DeviceIntPtr dev, - WindowPtr *ppWin, - WindowPtr *ppStopWin) -{ - WindowPtr pFocusWin = dev->focus ? dev->focus->win : NoneWin; - - if (pFocusWin == NoneWin) - { /* no focus -- events don't go anywhere */ - *ppWin = *ppStopWin = NULL; - return; - } - - if (pFocusWin == PointerRootWin) - { /* focus follows the pointer */ - *ppWin = GetSpriteWindow(); - *ppStopWin = NULL; /* propogate all the way to the root */ - } - else - { /* a real window is set for the focus */ - WindowPtr pSpriteWin = GetSpriteWindow(); - *ppStopWin = pFocusWin->parent; /* don't go past the focus window */ - - /* if the pointer is in a subwindow of the focus window, start - * at that subwindow, else start at the focus window itself - */ - if (IsParent(pFocusWin, pSpriteWin)) - *ppWin = pSpriteWin; - else *ppWin = pFocusWin; - } -} /* SecurityDetermineEventPropogationLimits */ - - -/* SecurityCheckDeviceAccess - * - * Arguments: - * client is the client attempting to access a device. - * dev is the device being accessed. - * fromRequest is TRUE if the device access is a direct result of - * the client executing some request and FALSE if it is a - * result of the server trying to send an event (e.g. KeymapNotify) - * to the client. - * Returns: - * TRUE if the device access should be allowed, else FALSE. - * - * Side Effects: - * An audit message is generated if access is denied. - */ - -Bool -SecurityCheckDeviceAccess(client, dev, fromRequest) - ClientPtr client; - DeviceIntPtr dev; - Bool fromRequest; -{ - WindowPtr pWin, pStopWin; - Bool untrusted_got_event; - Bool found_event_window; - Mask eventmask; - int reqtype = 0; - - /* trusted clients always allowed to do anything */ - if (client->trustLevel == XSecurityClientTrusted) - return TRUE; - - /* device security other than keyboard is not implemented yet */ - if (dev != inputInfo.keyboard) - return TRUE; - - /* some untrusted client wants access */ - - if (fromRequest) - { - reqtype = ((xReq *)client->requestBuffer)->reqType; - switch (reqtype) - { - /* never allow these */ - case X_ChangeKeyboardMapping: - case X_ChangeKeyboardControl: - case X_SetModifierMapping: - SecurityAudit("client %d attempted request %d\n", - client->index, reqtype); - return FALSE; - default: - break; - } - } - - untrusted_got_event = FALSE; - found_event_window = FALSE; - - if (dev->grab) - { - untrusted_got_event = - ((rClient(dev->grab))->trustLevel != XSecurityClientTrusted); - } - else - { - SecurityDetermineEventPropogationLimits(dev, &pWin, &pStopWin); - - eventmask = KeyPressMask | KeyReleaseMask; - while ( (pWin != pStopWin) && !found_event_window) - { - OtherClients *other; - - if (pWin->eventMask & eventmask) - { - found_event_window = TRUE; - client = wClient(pWin); - if (client->trustLevel != XSecurityClientTrusted) - { - untrusted_got_event = TRUE; - } - } - if (wOtherEventMasks(pWin) & eventmask) - { - found_event_window = TRUE; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->mask & eventmask) - { - client = rClient(other); - if (client->trustLevel != XSecurityClientTrusted) - { - untrusted_got_event = TRUE; - break; - } - } - } - } - if (wDontPropagateMask(pWin) & eventmask) - break; - pWin = pWin->parent; - } /* while propogating the event */ - } - - /* allow access by untrusted clients only if an event would have gone - * to an untrusted client - */ - - if (!untrusted_got_event) - { - char *devname = dev->name; - if (!devname) devname = "unnamed"; - if (fromRequest) - SecurityAudit("client %d attempted request %d device %d (%s)\n", - client->index, reqtype, dev->id, devname); - else - SecurityAudit("client %d attempted to access device %d (%s)\n", - client->index, dev->id, devname); - } - return untrusted_got_event; -} /* SecurityCheckDeviceAccess */ - - - -/* SecurityAuditResourceIDAccess - * - * Arguments: - * client is the client doing the resource access. - * id is the resource id. - * - * Returns: NULL - * - * Side Effects: - * An audit message is generated with details of the denied - * resource access. - */ - -static pointer -SecurityAuditResourceIDAccess( - ClientPtr client, - XID id) -{ - int cid = CLIENT_ID(id); - int reqtype = ((xReq *)client->requestBuffer)->reqType; - switch (reqtype) - { - case X_ChangeProperty: - case X_DeleteProperty: - case X_GetProperty: - { - xChangePropertyReq *req = - (xChangePropertyReq *)client->requestBuffer; - int propertyatom = req->property; - char *propertyname = NameForAtom(propertyatom); - - SecurityAudit("client %d attempted request %d with window 0x%x property %s of client %d\n", - client->index, reqtype, id, propertyname, cid); - break; - } - default: - { - SecurityAudit("client %d attempted request %d with resource 0x%x of client %d\n", - client->index, reqtype, id, cid); - break; - } - } - return NULL; -} /* SecurityAuditResourceIDAccess */ - - -/* SecurityCheckResourceIDAccess - * - * This function gets plugged into client->CheckAccess and is called from - * SecurityLookupIDByType/Class to determine if the client can access the - * resource. - * - * Arguments: - * client is the client doing the resource access. - * id is the resource id. - * rtype is its type or class. - * access_mode represents the intended use of the resource; see - * resource.h. - * rval is a pointer to the resource structure for this resource. - * - * Returns: - * If access is granted, the value of rval that was passed in, else NULL. - * - * Side Effects: - * Disallowed resource accesses are audited. - */ - -static pointer -SecurityCheckResourceIDAccess( - ClientPtr client, - XID id, - RESTYPE rtype, - Mask access_mode, - pointer rval) -{ - int cid = CLIENT_ID(id); - int reqtype = ((xReq *)client->requestBuffer)->reqType; - - if (SecurityUnknownAccess == access_mode) - return rval; /* for compatibility, we have to allow access */ - - switch (reqtype) - { /* these are always allowed */ - case X_QueryTree: - case X_TranslateCoords: - case X_GetGeometry: - /* property access is controlled in SecurityCheckPropertyAccess */ - case X_GetProperty: - case X_ChangeProperty: - case X_DeleteProperty: - case X_RotateProperties: - case X_ListProperties: - return rval; - default: - break; - } - - if (cid != 0) - { /* not a server-owned resource */ - /* - * The following 'if' restricts clients to only access resources at - * the same trustLevel. Since there are currently only two trust levels, - * and trusted clients never call this function, this degenerates into - * saying that untrusted clients can only access resources of other - * untrusted clients. One way to add the notion of groups would be to - * allow values other than Trusted (0) and Untrusted (1) for this field. - * Clients at the same trust level would be able to use each other's - * resources, but not those of clients at other trust levels. I haven't - * tried it, but this probably mostly works already. The obvious - * competing alternative for grouping clients for security purposes is to - * use app groups. dpw - */ - if (client->trustLevel == clients[cid]->trustLevel -#ifdef XAPPGROUP - || (RT_COLORMAP == rtype && - XagDefaultColormap (client) == (Colormap) id) -#endif - ) - return rval; - else - return SecurityAuditResourceIDAccess(client, id); - } - else /* server-owned resource - probably a default colormap or root window */ - { - if (RT_WINDOW == rtype || RC_DRAWABLE == rtype) - { - switch (reqtype) - { /* the following operations are allowed on root windows */ - case X_CreatePixmap: - case X_CreateGC: - case X_CreateWindow: - case X_CreateColormap: - case X_ListProperties: - case X_GrabPointer: - case X_UngrabButton: - case X_QueryBestSize: - case X_GetWindowAttributes: - break; - case X_SendEvent: - { /* see if it is an event specified by the ICCCM */ - xSendEventReq *req = (xSendEventReq *) - (client->requestBuffer); - if (req->propagate == xTrue - || - (req->eventMask != ColormapChangeMask && - req->eventMask != StructureNotifyMask && - req->eventMask != - (SubstructureRedirectMask|SubstructureNotifyMask) - ) - || - (req->event.u.u.type != UnmapNotify && - req->event.u.u.type != ConfigureRequest && - req->event.u.u.type != ClientMessage - ) - ) - { /* not an ICCCM event */ - return SecurityAuditResourceIDAccess(client, id); - } - break; - } /* case X_SendEvent on root */ - - case X_ChangeWindowAttributes: - { /* Allow selection of PropertyNotify and StructureNotify - * events on the root. - */ - xChangeWindowAttributesReq *req = - (xChangeWindowAttributesReq *)(client->requestBuffer); - if (req->valueMask == CWEventMask) - { - CARD32 value = *((CARD32 *)(req + 1)); - if ( (value & - ~(PropertyChangeMask|StructureNotifyMask)) == 0) - break; - } - return SecurityAuditResourceIDAccess(client, id); - } /* case X_ChangeWindowAttributes on root */ - - default: - { -#ifdef LBX - /* XXX really need per extension dispatching */ - if (reqtype == LbxReqCode) { - switch (((xReq *)client->requestBuffer)->data) { - case X_LbxGetProperty: - case X_LbxChangeProperty: - return rval; - default: - break; - } - } -#endif - /* others not allowed */ - return SecurityAuditResourceIDAccess(client, id); - } - } - } /* end server-owned window or drawable */ - else if (SecurityAuthorizationResType == rtype) - { - SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)rval; - if (pAuth->trustLevel != client->trustLevel) - return SecurityAuditResourceIDAccess(client, id); - } - else if (RT_COLORMAP != rtype) - { /* don't allow anything else besides colormaps */ - return SecurityAuditResourceIDAccess(client, id); - } - } - return rval; -} /* SecurityCheckResourceIDAccess */ - - -/* SecurityClientStateCallback - * - * Arguments: - * pcbl is &ClientStateCallback. - * nullata is NULL. - * calldata is a pointer to a NewClientInfoRec (include/dixstruct.h) - * which contains information about client state changes. - * - * Returns: nothing. - * - * Side Effects: - * - * If a new client is connecting, its authorization ID is copied to - * client->authID. If this is a generated authorization, its reference - * count is bumped, its timer is cancelled if it was running, and its - * trustlevel is copied to client->trustLevel. - * - * If a client is disconnecting and the client was using a generated - * authorization, the authorization's reference count is decremented, and - * if it is now zero, the timer for this authorization is started. - */ - -static void -SecurityClientStateCallback( - CallbackListPtr *pcbl, - pointer nulldata, - pointer calldata) -{ - NewClientInfoRec *pci = (NewClientInfoRec *)calldata; - ClientPtr client = pci->client; - - switch (client->clientState) - { - case ClientStateRunning: - { - XID authId = AuthorizationIDOfClient(client); - SecurityAuthorizationPtr pAuth; - - client->authId = authId; - pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId, - SecurityAuthorizationResType); - if (pAuth) - { /* it is a generated authorization */ - pAuth->refcnt++; - if (pAuth->refcnt == 1) - { - if (pAuth->timer) TimerCancel(pAuth->timer); - } - client->trustLevel = pAuth->trustLevel; - if (client->trustLevel != XSecurityClientTrusted) - { - client->CheckAccess = SecurityCheckResourceIDAccess; - client->requestVector = client->swapped ? - SwappedUntrustedProcVector : UntrustedProcVector; - } - } - break; - } - case ClientStateGone: - case ClientStateRetained: /* client disconnected */ - { - XID authId = client->authId; - SecurityAuthorizationPtr pAuth; - - pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId, - SecurityAuthorizationResType); - if (pAuth) - { /* it is a generated authorization */ - pAuth->refcnt--; - if (pAuth->refcnt == 0) - { - SecurityStartAuthorizationTimer(pAuth); - } - } - break; - } - default: break; - } -} /* SecurityClientStateCallback */ - -#ifdef LBX -Bool -SecuritySameLevel(client, authId) - ClientPtr client; - XID authId; -{ - SecurityAuthorizationPtr pAuth; - - pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId, - SecurityAuthorizationResType); - if (pAuth) - return client->trustLevel == pAuth->trustLevel; - return client->trustLevel == XSecurityClientTrusted; -} -#endif - -/* SecurityCensorImage - * - * Called after pScreen->GetImage to prevent pieces or trusted windows from - * being returned in image data from an untrusted window. - * - * Arguments: - * client is the client doing the GetImage. - * pVisibleRegion is the visible region of the window. - * widthBytesLine is the width in bytes of one horizontal line in pBuf. - * pDraw is the source window. - * x, y, w, h is the rectangle of image data from pDraw in pBuf. - * format is the format of the image data in pBuf: ZPixmap or XYPixmap. - * pBuf is the image data. - * - * Returns: nothing. - * - * Side Effects: - * Any part of the rectangle (x, y, w, h) that is outside the visible - * region of the window will be destroyed (overwritten) in pBuf. - */ -void -SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h, - format, pBuf) - ClientPtr client; - RegionPtr pVisibleRegion; - long widthBytesLine; - DrawablePtr pDraw; - int x, y, w, h; - unsigned int format; - char * pBuf; -{ - ScreenPtr pScreen = pDraw->pScreen; - RegionRec imageRegion; /* region representing x,y,w,h */ - RegionRec censorRegion; /* region to obliterate */ - BoxRec imageBox; - int nRects; - - imageBox.x1 = x; - imageBox.y1 = y; - imageBox.x2 = x + w; - imageBox.y2 = y + h; - REGION_INIT(pScreen, &imageRegion, &imageBox, 1); - REGION_NULL(pScreen, &censorRegion); - - /* censorRegion = imageRegion - visibleRegion */ - REGION_SUBTRACT(pScreen, &censorRegion, &imageRegion, pVisibleRegion); - nRects = REGION_NUM_RECTS(&censorRegion); - if (nRects > 0) - { /* we have something to censor */ - GCPtr pScratchGC = NULL; - PixmapPtr pPix = NULL; - xRectangle *pRects = NULL; - Bool failed = FALSE; - int depth = 1; - int bitsPerPixel = 1; - int i; - BoxPtr pBox; - - /* convert region to list-of-rectangles for PolyFillRect */ - - pRects = (xRectangle *)ALLOCATE_LOCAL(nRects * sizeof(xRectangle *)); - if (!pRects) - { - failed = TRUE; - goto failSafe; - } - for (pBox = REGION_RECTS(&censorRegion), i = 0; - i < nRects; - i++, pBox++) - { - pRects[i].x = pBox->x1; - pRects[i].y = pBox->y1 - imageBox.y1; - pRects[i].width = pBox->x2 - pBox->x1; - pRects[i].height = pBox->y2 - pBox->y1; - } - - /* use pBuf as a fake pixmap */ - - if (format == ZPixmap) - { - depth = pDraw->depth; - bitsPerPixel = pDraw->bitsPerPixel; - } - - pPix = GetScratchPixmapHeader(pDraw->pScreen, w, h, - depth, bitsPerPixel, - widthBytesLine, (pointer)pBuf); - if (!pPix) - { - failed = TRUE; - goto failSafe; - } - - pScratchGC = GetScratchGC(depth, pPix->drawable.pScreen); - if (!pScratchGC) - { - failed = TRUE; - goto failSafe; - } - - ValidateGC(&pPix->drawable, pScratchGC); - (* pScratchGC->ops->PolyFillRect)(&pPix->drawable, - pScratchGC, nRects, pRects); - - failSafe: - if (failed) - { - /* Censoring was not completed above. To be safe, wipe out - * all the image data so that nothing trusted gets out. - */ - bzero(pBuf, (int)(widthBytesLine * h)); - } - if (pRects) DEALLOCATE_LOCAL(pRects); - if (pScratchGC) FreeScratchGC(pScratchGC); - if (pPix) FreeScratchPixmapHeader(pPix); - } - REGION_UNINIT(pScreen, &imageRegion); - REGION_UNINIT(pScreen, &censorRegion); -} /* SecurityCensorImage */ - -/**********************************************************************/ - -typedef struct _PropertyAccessRec { - ATOM name; - ATOM mustHaveProperty; - char *mustHaveValue; - char windowRestriction; -#define SecurityAnyWindow 0 -#define SecurityRootWindow 1 -#define SecurityWindowWithProperty 2 - char readAction; - char writeAction; - char destroyAction; - struct _PropertyAccessRec *next; -} PropertyAccessRec, *PropertyAccessPtr; - -static PropertyAccessPtr PropertyAccessList = NULL; -static char SecurityDefaultAction = SecurityErrorOperation; -static char *SecurityPolicyFile = DEFAULTPOLICYFILE; -static ATOM SecurityMaxPropertyName = 0; - -static char *SecurityKeywords[] = { -#define SecurityKeywordComment 0 - "#", -#define SecurityKeywordProperty 1 - "property", -#define SecurityKeywordSitePolicy 2 - "sitepolicy", -#define SecurityKeywordRoot 3 - "root", -#define SecurityKeywordAny 4 - "any" -}; - -#define NUMKEYWORDS (sizeof(SecurityKeywords) / sizeof(char *)) - -#undef PROPDEBUG -/*#define PROPDEBUG 1*/ - -static void -SecurityFreePropertyAccessList(void) -{ - while (PropertyAccessList) - { - PropertyAccessPtr freeit = PropertyAccessList; - PropertyAccessList = PropertyAccessList->next; - xfree(freeit); - } -} /* SecurityFreePropertyAccessList */ - -#ifndef __UNIXOS2__ -#define SecurityIsWhitespace(c) ( (c == ' ') || (c == '\t') || (c == '\n') ) -#else -#define SecurityIsWhitespace(c) ( (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') ) -#endif - -static char * -SecuritySkipWhitespace( - char *p) -{ - while (SecurityIsWhitespace(*p)) - p++; - return p; -} /* SecuritySkipWhitespace */ - - -static char * -SecurityParseString( - char **rest) -{ - char *startOfString; - char *s = *rest; - char endChar = 0; - - s = SecuritySkipWhitespace(s); - - if (*s == '"' || *s == '\'') - { - endChar = *s++; - startOfString = s; - while (*s && (*s != endChar)) - s++; - } - else - { - startOfString = s; - while (*s && !SecurityIsWhitespace(*s)) - s++; - } - if (*s) - { - *s = '\0'; - *rest = s + 1; - return startOfString; - } - else - { - *rest = s; - return (endChar) ? NULL : startOfString; - } -} /* SecurityParseString */ - - -static int -SecurityParseKeyword( - char **p) -{ - int i; - char *s = *p; - s = SecuritySkipWhitespace(s); - for (i = 0; i < NUMKEYWORDS; i++) - { - int len = strlen(SecurityKeywords[i]); - if (strncmp(s, SecurityKeywords[i], len) == 0) - { - *p = s + len; - return (i); - } - } - *p = s; - return -1; -} /* SecurityParseKeyword */ - - -static Bool -SecurityParsePropertyAccessRule( - char *p) -{ - char *propname; - char c; - char action = SecurityDefaultAction; - char readAction, writeAction, destroyAction; - PropertyAccessPtr pacl, prev, cur; - char *mustHaveProperty = NULL; - char *mustHaveValue = NULL; - Bool invalid; - char windowRestriction; - int size; - int keyword; - - /* get property name */ - propname = SecurityParseString(&p); - if (!propname || (strlen(propname) == 0)) - return FALSE; - - /* get window on which property must reside for rule to apply */ - - keyword = SecurityParseKeyword(&p); - if (keyword == SecurityKeywordRoot) - windowRestriction = SecurityRootWindow; - else if (keyword == SecurityKeywordAny) - windowRestriction = SecurityAnyWindow; - else /* not root or any, must be a property name */ - { - mustHaveProperty = SecurityParseString(&p); - if (!mustHaveProperty || (strlen(mustHaveProperty) == 0)) - return FALSE; - windowRestriction = SecurityWindowWithProperty; - p = SecuritySkipWhitespace(p); - if (*p == '=') - { /* property value is specified too */ - p++; /* skip over '=' */ - mustHaveValue = SecurityParseString(&p); - if (!mustHaveValue) - return FALSE; - } - } - - /* get operations and actions */ - - invalid = FALSE; - readAction = writeAction = destroyAction = SecurityDefaultAction; - while ( (c = *p++) && !invalid) - { - switch (c) - { - case 'i': action = SecurityIgnoreOperation; break; - case 'a': action = SecurityAllowOperation; break; - case 'e': action = SecurityErrorOperation; break; - - case 'r': readAction = action; break; - case 'w': writeAction = action; break; - case 'd': destroyAction = action; break; - - default : - if (!SecurityIsWhitespace(c)) - invalid = TRUE; - break; - } - } - if (invalid) - return FALSE; - - /* We've successfully collected all the information needed for this - * property access rule. Now record it in a PropertyAccessRec. - */ - size = sizeof(PropertyAccessRec); - - /* If there is a property value string, allocate space for it - * right after the PropertyAccessRec. - */ - if (mustHaveValue) - size += strlen(mustHaveValue) + 1; - pacl = (PropertyAccessPtr)Xalloc(size); - if (!pacl) - return FALSE; - - pacl->name = MakeAtom(propname, strlen(propname), TRUE); - if (pacl->name == BAD_RESOURCE) - { - Xfree(pacl); - return FALSE; - } - if (mustHaveProperty) - { - pacl->mustHaveProperty = MakeAtom(mustHaveProperty, - strlen(mustHaveProperty), TRUE); - if (pacl->mustHaveProperty == BAD_RESOURCE) - { - Xfree(pacl); - return FALSE; - } - } - else - pacl->mustHaveProperty = 0; - - if (mustHaveValue) - { - pacl->mustHaveValue = (char *)(pacl + 1); - strcpy(pacl->mustHaveValue, mustHaveValue); - } - else - pacl->mustHaveValue = NULL; - - SecurityMaxPropertyName = max(SecurityMaxPropertyName, pacl->name); - - pacl->windowRestriction = windowRestriction; - pacl->readAction = readAction; - pacl->writeAction = writeAction; - pacl->destroyAction = destroyAction; - - /* link the new rule into the list of rules in order of increasing - * property name (atom) value to make searching easier - */ - - for (prev = NULL, cur = PropertyAccessList; - cur && cur->name <= pacl->name; - prev = cur, cur = cur->next) - ; - if (!prev) - { - pacl->next = cur; - PropertyAccessList = pacl; - } - else - { - prev->next = pacl; - pacl->next = cur; - } - return TRUE; -} /* SecurityParsePropertyAccessRule */ - -static char **SecurityPolicyStrings = NULL; -static int nSecurityPolicyStrings = 0; - -static Bool -SecurityParseSitePolicy( - char *p) -{ - char *policyStr = SecurityParseString(&p); - char *copyPolicyStr; - char **newStrings; - - if (!policyStr) - return FALSE; - - copyPolicyStr = (char *)Xalloc(strlen(policyStr) + 1); - if (!copyPolicyStr) - return TRUE; - strcpy(copyPolicyStr, policyStr); - newStrings = (char **)Xrealloc(SecurityPolicyStrings, - sizeof (char *) * (nSecurityPolicyStrings + 1)); - if (!newStrings) - { - Xfree(copyPolicyStr); - return TRUE; - } - - SecurityPolicyStrings = newStrings; - SecurityPolicyStrings[nSecurityPolicyStrings++] = copyPolicyStr; - - return TRUE; - -} /* SecurityParseSitePolicy */ - - -char ** -SecurityGetSitePolicyStrings(n) - int *n; -{ - *n = nSecurityPolicyStrings; - return SecurityPolicyStrings; -} /* SecurityGetSitePolicyStrings */ - -static void -SecurityFreeSitePolicyStrings(void) -{ - if (SecurityPolicyStrings) - { - assert(nSecurityPolicyStrings); - while (nSecurityPolicyStrings--) - { - Xfree(SecurityPolicyStrings[nSecurityPolicyStrings]); - } - Xfree(SecurityPolicyStrings); - SecurityPolicyStrings = NULL; - nSecurityPolicyStrings = 0; - } -} /* SecurityFreeSitePolicyStrings */ - - -static void -SecurityLoadPropertyAccessList(void) -{ - FILE *f; - int lineNumber = 0; - - SecurityMaxPropertyName = 0; - -#ifdef NXAGENT_SERVER - - if (!_NXGetPolicyFilePath(SecurityPolicyFile)) - { - return; - } - -#else - - if (!SecurityPolicyFile) - return; - -#endif - -#ifndef __UNIXOS2__ - -#ifdef NXAGENT_SERVER - - f = Fopen(_NXGetPolicyFilePath(SecurityPolicyFile), "r"); - -#else - - f = Fopen(SecurityPolicyFile, "r"); - -#endif - -#else - -#ifdef NXAGENT_SERVER - - f = Fopen((char*)__XOS2RedirRoot( _NXGetPolicyFilePath(SecurityPolicyFile)), "r"); - -#else - - f = Fopen((char*)__XOS2RedirRoot(SecurityPolicyFile), "r"); - -#endif - -#endif - - if (!f) - { -#ifdef NXAGENT_SERVER - - ErrorF("error opening security policy file %s\n", - _NXGetPolicyFilePath(SecurityPolicyFile)); - -#else - - ErrorF("error opening security policy file %s\n", - SecurityPolicyFile); - -#endif - - return; - } - - while (!feof(f)) - { - char buf[200]; - Bool validLine; - char *p; - - if (!(p = fgets(buf, sizeof(buf), f))) - break; - lineNumber++; - - /* if first line, check version number */ - if (lineNumber == 1) - { - char *v = SecurityParseString(&p); - if (strcmp(v, SECURITY_POLICY_FILE_VERSION) != 0) - { - -#ifdef NXAGENT_SERVER - - ErrorF("%s: invalid security policy file version, ignoring file\n", - _NXGetPolicyFilePath(SecurityPolicyFile)); - -#else - - ErrorF("%s: invalid security policy file version, ignoring file\n", - SecurityPolicyFile); - -#endif - - break; - } - validLine = TRUE; - } - else - { - switch (SecurityParseKeyword(&p)) - { - case SecurityKeywordComment: - validLine = TRUE; - break; - - case SecurityKeywordProperty: - validLine = SecurityParsePropertyAccessRule(p); - break; - - case SecurityKeywordSitePolicy: - validLine = SecurityParseSitePolicy(p); - break; - - default: - validLine = (*p == '\0'); /* blank lines OK, others not */ - break; - } - } - -#ifdef NXAGENT_SERVER - - if (!validLine) - { - ErrorF("Line %d of %s invalid, ignoring\n", - lineNumber, _NXGetPolicyFilePath(SecurityPolicyFile)); - } - -#else - - if (!validLine) - ErrorF("Line %d of %s invalid, ignoring\n", - lineNumber, SecurityPolicyFile); - -#endif - - } /* end while more input */ - -#ifdef PROPDEBUG - { - PropertyAccessPtr pacl; - char *op = "aie"; - for (pacl = PropertyAccessList; pacl; pacl = pacl->next) - { - ErrorF("property %s ", NameForAtom(pacl->name)); - switch (pacl->windowRestriction) - { - case SecurityAnyWindow: ErrorF("any "); break; - case SecurityRootWindow: ErrorF("root "); break; - case SecurityWindowWithProperty: - { - ErrorF("%s ", NameForAtom(pacl->mustHaveProperty)); - if (pacl->mustHaveValue) - ErrorF(" = \"%s\" ", pacl->mustHaveValue); - - } - break; - } - ErrorF("%cr %cw %cd\n", op[pacl->readAction], - op[pacl->writeAction], op[pacl->destroyAction]); - } - } -#endif /* PROPDEBUG */ - - Fclose(f); -} /* SecurityLoadPropertyAccessList */ - - -static Bool -SecurityMatchString( - char *ws, - char *cs) -{ - while (*ws && *cs) - { - if (*ws == '*') - { - Bool match = FALSE; - ws++; - while (!(match = SecurityMatchString(ws, cs)) && *cs) - { - cs++; - } - return match; - } - else if (*ws == *cs) - { - ws++; - cs++; - } - else break; - } - return ( ( (*ws == '\0') || ((*ws == '*') && *(ws+1) == '\0') ) - && (*cs == '\0') ); -} /* SecurityMatchString */ - -#ifdef PROPDEBUG -#include -#include -#endif - - -char -SecurityCheckPropertyAccess(client, pWin, propertyName, access_mode) - ClientPtr client; - WindowPtr pWin; - ATOM propertyName; - Mask access_mode; -{ - PropertyAccessPtr pacl; - char action = SecurityDefaultAction; - - /* if client trusted or window untrusted, allow operation */ - - if ( (client->trustLevel == XSecurityClientTrusted) || - (wClient(pWin)->trustLevel != XSecurityClientTrusted) ) - return SecurityAllowOperation; - -#ifdef PROPDEBUG - /* For testing, it's more convenient if the property rules file gets - * reloaded whenever it changes, so we can rapidly try things without - * having to reset the server. - */ - { - struct stat buf; - static time_t lastmod = 0; - -#ifdef NXAGENT_SERVER - - int ret = stat(_NXGetPolicyFilePath(SecurityPolicyFile), &buf); - -#else - - int ret = stat(SecurityPolicyFile , &buf); - -#endif - - if ( (ret == 0) && (buf.st_mtime > lastmod) ) - { - ErrorF("reloading property rules\n"); - SecurityFreePropertyAccessList(); - SecurityLoadPropertyAccessList(); - lastmod = buf.st_mtime; - } - } -#endif - - /* If the property atom is bigger than any atoms on the list, - * we know we won't find it, so don't even bother looking. - */ - if (propertyName <= SecurityMaxPropertyName) - { - /* untrusted client operating on trusted window; see if it's allowed */ - - for (pacl = PropertyAccessList; pacl; pacl = pacl->next) - { - if (pacl->name < propertyName) - continue; - if (pacl->name > propertyName) - break; - - /* pacl->name == propertyName, so see if it applies to this window */ - - switch (pacl->windowRestriction) - { - case SecurityAnyWindow: /* always applies */ - break; - - case SecurityRootWindow: - { - /* if not a root window, this rule doesn't apply */ - if (pWin->parent) - continue; - } - break; - - case SecurityWindowWithProperty: - { - PropertyPtr pProp = wUserProps (pWin); - Bool match = FALSE; - char *p; - char *pEndData; - - while (pProp) - { - if (pProp->propertyName == pacl->mustHaveProperty) - break; - pProp = pProp->next; - } - if (!pProp) - continue; - if (!pacl->mustHaveValue) - break; - if (pProp->type != XA_STRING || pProp->format != 8) - continue; - - p = pProp->data; - pEndData = ((char *)pProp->data) + pProp->size; - while (!match && p < pEndData) - { - if (SecurityMatchString(pacl->mustHaveValue, p)) - match = TRUE; - else - { /* skip to the next string */ - while (*p++ && p < pEndData) - ; - } - } - if (!match) - continue; - } - break; /* end case SecurityWindowWithProperty */ - } /* end switch on windowRestriction */ - - /* If we get here, the property access rule pacl applies. - * If pacl doesn't apply, something above should have - * executed a continue, which will skip the follwing code. - */ - action = SecurityAllowOperation; - if (access_mode & SecurityReadAccess) - action = max(action, pacl->readAction); - if (access_mode & SecurityWriteAccess) - action = max(action, pacl->writeAction); - if (access_mode & SecurityDestroyAccess) - action = max(action, pacl->destroyAction); - break; - } /* end for each pacl */ - } /* end if propertyName <= SecurityMaxPropertyName */ - - if (SecurityAllowOperation != action) - { /* audit the access violation */ - int cid = CLIENT_ID(pWin->drawable.id); - int reqtype = ((xReq *)client->requestBuffer)->reqType; - char *actionstr = (SecurityIgnoreOperation == action) ? - "ignored" : "error"; - SecurityAudit("client %d attempted request %d with window 0x%x property %s (atom 0x%x) of client %d, %s\n", - client->index, reqtype, pWin->drawable.id, - NameForAtom(propertyName), propertyName, cid, actionstr); - } - return action; -} /* SecurityCheckPropertyAccess */ - - -/* SecurityResetProc - * - * Arguments: - * extEntry is the extension information for the security extension. - * - * Returns: nothing. - * - * Side Effects: - * Performs any cleanup needed by Security at server shutdown time. - */ - -static void -SecurityResetProc( - ExtensionEntry *extEntry) -{ - SecurityFreePropertyAccessList(); - SecurityFreeSitePolicyStrings(); -} /* SecurityResetProc */ - - -int -XSecurityOptions(argc, argv, i) - int argc; - char **argv; - int i; -{ - if (strcmp(argv[i], "-sp") == 0) - { - if (i < argc) - SecurityPolicyFile = argv[++i]; - return (i + 1); - } - return (i); -} /* XSecurityOptions */ - - - -/* SecurityExtensionInit - * - * Arguments: none. - * - * Returns: nothing. - * - * Side Effects: - * Enables the Security extension if possible. - */ - -void -SecurityExtensionInit(INITARGS) -{ - ExtensionEntry *extEntry; - int i; - - SecurityAuthorizationResType = - CreateNewResourceType(SecurityDeleteAuthorization); - - RTEventClient = CreateNewResourceType( - SecurityDeleteAuthorizationEventClient); - - if (!SecurityAuthorizationResType || !RTEventClient) - return; - - RTEventClient |= RC_NEVERRETAIN; - - if (!AddCallback(&ClientStateCallback, SecurityClientStateCallback, NULL)) - return; - - extEntry = AddExtension(SECURITY_EXTENSION_NAME, - XSecurityNumberEvents, XSecurityNumberErrors, - ProcSecurityDispatch, SProcSecurityDispatch, - SecurityResetProc, StandardMinorOpcode); - - SecurityErrorBase = extEntry->errorBase; - SecurityEventBase = extEntry->eventBase; - - EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] = - (EventSwapPtr)SwapSecurityAuthorizationRevokedEvent; - - /* initialize untrusted proc vectors */ - - for (i = 0; i < 128; i++) - { - UntrustedProcVector[i] = ProcVector[i]; - SwappedUntrustedProcVector[i] = SwappedProcVector[i]; - } - - /* make sure insecure extensions are not allowed */ - - for (i = 128; i < 256; i++) - { - if (!UntrustedProcVector[i]) - { - UntrustedProcVector[i] = ProcBadRequest; - SwappedUntrustedProcVector[i] = ProcBadRequest; - } - } - - SecurityLoadPropertyAccessList(); - -} /* SecurityExtensionInit */ diff --git a/nx-X11/programs/Xserver/Xext/security.c.X.original b/nx-X11/programs/Xserver/Xext/security.c.X.original deleted file mode 100644 index c6a516733..000000000 --- a/nx-X11/programs/Xserver/Xext/security.c.X.original +++ /dev/null @@ -1,2008 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/security.c,v 1.5 2005/07/03 07:01:04 daniels Exp $ */ -/* $Xorg: security.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */ -/* - -Copyright 1996, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/programs/Xserver/Xext/security.c,v 1.16tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "dixstruct.h" -#include "extnsionst.h" -#include "windowstr.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "colormapst.h" -#include "propertyst.h" -#define _SECURITY_SERVER -#include -#include -#include -#ifdef LBX -#define _XLBX_SERVER_ -#include -extern unsigned char LbxReqCode; -#endif -#ifdef XAPPGROUP -#include -#endif -#include /* for file reading operations */ -#include /* for XA_STRING */ - -#ifndef DEFAULTPOLICYFILE -# define DEFAULTPOLICYFILE NULL -#endif -#if defined(WIN32) || defined(__CYGWIN__) -#include -#undef index -#endif - -#include "modinit.h" - -static int SecurityErrorBase; /* first Security error number */ -static int SecurityEventBase; /* first Security event number */ - -CallbackListPtr SecurityValidateGroupCallback = NULL; /* see security.h */ - -RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */ - -static RESTYPE RTEventClient; - -/* Proc vectors for untrusted clients, swapped and unswapped versions. - * These are the same as the normal proc vectors except that extensions - * that haven't declared themselves secure will have ProcBadRequest plugged - * in for their major opcode dispatcher. This prevents untrusted clients - * from guessing extension major opcodes and using the extension even though - * the extension can't be listed or queried. - */ -int (*UntrustedProcVector[256])( - ClientPtr /*client*/ -); -int (*SwappedUntrustedProcVector[256])( - ClientPtr /*client*/ -); - -/* SecurityAudit - * - * Arguments: - * format is the formatting string to be used to interpret the - * remaining arguments. - * - * Returns: nothing. - * - * Side Effects: - * Writes the message to the log file if security logging is on. - */ - -void -SecurityAudit(char *format, ...) -{ - va_list args; - - if (auditTrailLevel < SECURITY_AUDIT_LEVEL) - return; - va_start(args, format); - VAuditF(format, args); - va_end(args); -} /* SecurityAudit */ - -#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) - -/* SecurityDeleteAuthorization - * - * Arguments: - * value is the authorization to delete. - * id is its resource ID. - * - * Returns: Success. - * - * Side Effects: - * Frees everything associated with the authorization. - */ - -static int -SecurityDeleteAuthorization( - pointer value, - XID id) -{ - SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value; - unsigned short name_len, data_len; - char *name, *data; - int status; - int i; - OtherClientsPtr pEventClient; - - /* Remove the auth using the os layer auth manager */ - - status = AuthorizationFromID(pAuth->id, &name_len, &name, - &data_len, &data); - assert(status); - status = RemoveAuthorization(name_len, name, data_len, data); - assert(status); - (void)status; - - /* free the auth timer if there is one */ - - if (pAuth->timer) TimerFree(pAuth->timer); - - /* send revoke events */ - - while ((pEventClient = pAuth->eventClients)) - { - /* send revocation event event */ - ClientPtr client = rClient(pEventClient); - - if (!client->clientGone) - { - xSecurityAuthorizationRevokedEvent are; - are.type = SecurityEventBase + XSecurityAuthorizationRevoked; - are.sequenceNumber = client->sequence; - are.authId = pAuth->id; - WriteEventsToClient(client, 1, (xEvent *)&are); - } - FreeResource(pEventClient->resource, RT_NONE); - } - - /* kill all clients using this auth */ - - for (i = 1; iauthId == pAuth->id)) - CloseDownClient(clients[i]); - } - - SecurityAudit("revoked authorization ID %d\n", pAuth->id); - xfree(pAuth); - return Success; - -} /* SecurityDeleteAuthorization */ - - -/* resource delete function for RTEventClient */ -static int -SecurityDeleteAuthorizationEventClient( - pointer value, - XID id) -{ - OtherClientsPtr pEventClient, prev = NULL; - SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value; - - for (pEventClient = pAuth->eventClients; - pEventClient; - pEventClient = pEventClient->next) - { - if (pEventClient->resource == id) - { - if (prev) - prev->next = pEventClient->next; - else - pAuth->eventClients = pEventClient->next; - xfree(pEventClient); - return(Success); - } - prev = pEventClient; - } - /*NOTREACHED*/ - return -1; /* make compiler happy */ -} /* SecurityDeleteAuthorizationEventClient */ - - -/* SecurityComputeAuthorizationTimeout - * - * Arguments: - * pAuth is the authorization for which we are computing the timeout - * seconds is the number of seconds we want to wait - * - * Returns: - * the number of milliseconds that the auth timer should be set to - * - * Side Effects: - * Sets pAuth->secondsRemaining to any "overflow" amount of time - * that didn't fit in 32 bits worth of milliseconds - */ - -static CARD32 -SecurityComputeAuthorizationTimeout( - SecurityAuthorizationPtr pAuth, - unsigned int seconds) -{ - /* maxSecs is the number of full seconds that can be expressed in - * 32 bits worth of milliseconds - */ - CARD32 maxSecs = (CARD32)(~0) / (CARD32)MILLI_PER_SECOND; - - if (seconds > maxSecs) - { /* only come here if we want to wait more than 49 days */ - pAuth->secondsRemaining = seconds - maxSecs; - return maxSecs * MILLI_PER_SECOND; - } - else - { /* by far the common case */ - pAuth->secondsRemaining = 0; - return seconds * MILLI_PER_SECOND; - } -} /* SecurityStartAuthorizationTimer */ - -/* SecurityAuthorizationExpired - * - * This function is passed as an argument to TimerSet and gets called from - * the timer manager in the os layer when its time is up. - * - * Arguments: - * timer is the timer for this authorization. - * time is the current time. - * pval is the authorization whose time is up. - * - * Returns: - * A new time delay in milliseconds if the timer should wait some - * more, else zero. - * - * Side Effects: - * Frees the authorization resource if the timeout period is really - * over, otherwise recomputes pAuth->secondsRemaining. - */ - -static CARD32 -SecurityAuthorizationExpired( - OsTimerPtr timer, - CARD32 time, - pointer pval) -{ - SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval; - - assert(pAuth->timer == timer); - - if (pAuth->secondsRemaining) - { - return SecurityComputeAuthorizationTimeout(pAuth, - pAuth->secondsRemaining); - } - else - { - FreeResource(pAuth->id, RT_NONE); - return 0; - } -} /* SecurityAuthorizationExpired */ - -/* SecurityStartAuthorizationTimer - * - * Arguments: - * pAuth is the authorization whose timer should be started. - * - * Returns: nothing. - * - * Side Effects: - * A timer is started, set to expire after the timeout period for - * this authorization. When it expires, the function - * SecurityAuthorizationExpired will be called. - */ - -static void -SecurityStartAuthorizationTimer( - SecurityAuthorizationPtr pAuth) -{ - pAuth->timer = TimerSet(pAuth->timer, 0, - SecurityComputeAuthorizationTimeout(pAuth, pAuth->timeout), - SecurityAuthorizationExpired, pAuth); -} /* SecurityStartAuthorizationTimer */ - - -/* Proc functions all take a client argument, execute the request in - * client->requestBuffer, and return a protocol error status. - */ - -static int -ProcSecurityQueryVersion( - ClientPtr client) -{ - /* REQUEST(xSecurityQueryVersionReq); */ - xSecurityQueryVersionReply rep; - - /* paranoia: this "can't happen" because this extension is hidden - * from untrusted clients, but just in case... - */ - if (client->trustLevel != XSecurityClientTrusted) - return BadRequest; - - REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.majorVersion = SECURITY_MAJOR_VERSION; - rep.minorVersion = SECURITY_MINOR_VERSION; - if(client->swapped) - { - register char n; - swaps(&rep.sequenceNumber, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - } - (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), - (char *)&rep); - return (client->noClientException); -} /* ProcSecurityQueryVersion */ - - -static int -SecurityEventSelectForAuthorization( - SecurityAuthorizationPtr pAuth, - ClientPtr client, - Mask mask) -{ - OtherClients *pEventClient; - - for (pEventClient = pAuth->eventClients; - pEventClient; - pEventClient = pEventClient->next) - { - if (SameClient(pEventClient, client)) - { - if (mask == 0) - FreeResource(pEventClient->resource, RT_NONE); - else - pEventClient->mask = mask; - return Success; - } - } - - pEventClient = (OtherClients *) xalloc(sizeof(OtherClients)); - if (!pEventClient) - return BadAlloc; - pEventClient->mask = mask; - pEventClient->resource = FakeClientID(client->index); - pEventClient->next = pAuth->eventClients; - if (!AddResource(pEventClient->resource, RTEventClient, - (pointer)pAuth)) - { - xfree(pEventClient); - return BadAlloc; - } - pAuth->eventClients = pEventClient; - - return Success; -} /* SecurityEventSelectForAuthorization */ - - -static int -ProcSecurityGenerateAuthorization( - ClientPtr client) -{ - REQUEST(xSecurityGenerateAuthorizationReq); - int len; /* request length in CARD32s*/ - Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */ - SecurityAuthorizationPtr pAuth = NULL; /* auth we are creating */ - int err; /* error to return from this function */ - XID authId; /* authorization ID assigned by os layer */ - xSecurityGenerateAuthorizationReply rep; /* reply struct */ - unsigned int trustLevel; /* trust level of new auth */ - XID group; /* group of new auth */ - CARD32 timeout; /* timeout of new auth */ - CARD32 *values; /* list of supplied attributes */ - char *protoname; /* auth proto name sent in request */ - char *protodata; /* auth proto data sent in request */ - unsigned int authdata_len; /* # bytes of generated auth data */ - char *pAuthdata; /* generated auth data */ - Mask eventMask; /* what events on this auth does client want */ - - /* paranoia: this "can't happen" because this extension is hidden - * from untrusted clients, but just in case... - */ - if (client->trustLevel != XSecurityClientTrusted) - return BadRequest; - - /* check request length */ - - REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq); - len = SIZEOF(xSecurityGenerateAuthorizationReq) >> 2; - len += (stuff->nbytesAuthProto + (unsigned)3) >> 2; - len += (stuff->nbytesAuthData + (unsigned)3) >> 2; - values = ((CARD32 *)stuff) + len; - len += Ones(stuff->valueMask); - if (client->req_len != len) - return BadLength; - - /* check valuemask */ - if (stuff->valueMask & ~XSecurityAllAuthorizationAttributes) - { - client->errorValue = stuff->valueMask; - return BadValue; - } - - /* check timeout */ - timeout = 60; - if (stuff->valueMask & XSecurityTimeout) - { - timeout = *values++; - } - - /* check trustLevel */ - trustLevel = XSecurityClientUntrusted; - if (stuff->valueMask & XSecurityTrustLevel) - { - trustLevel = *values++; - if (trustLevel != XSecurityClientTrusted && - trustLevel != XSecurityClientUntrusted) - { - client->errorValue = trustLevel; - return BadValue; - } - } - - /* check group */ - group = None; - if (stuff->valueMask & XSecurityGroup) - { - group = *values++; - if (SecurityValidateGroupCallback) - { - SecurityValidateGroupInfoRec vgi; - vgi.group = group; - vgi.valid = FALSE; - CallCallbacks(&SecurityValidateGroupCallback, (pointer)&vgi); - - /* if nobody said they recognized it, it's an error */ - - if (!vgi.valid) - { - client->errorValue = group; - return BadValue; - } - } - } - - /* check event mask */ - eventMask = 0; - if (stuff->valueMask & XSecurityEventMask) - { - eventMask = *values++; - if (eventMask & ~XSecurityAllEventMasks) - { - client->errorValue = eventMask; - return BadValue; - } - } - - protoname = (char *)&stuff[1]; - protodata = protoname + ((stuff->nbytesAuthProto + (unsigned)3) >> 2); - - /* call os layer to generate the authorization */ - - authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname, - stuff->nbytesAuthData, protodata, - &authdata_len, &pAuthdata); - if ((XID) ~0L == authId) - { - err = SecurityErrorBase + XSecurityBadAuthorizationProtocol; - goto bailout; - } - - /* now that we've added the auth, remember to remove it if we have to - * abort the request for some reason (like allocation failure) - */ - removeAuth = TRUE; - - /* associate additional information with this auth ID */ - - pAuth = (SecurityAuthorizationPtr)xalloc(sizeof(SecurityAuthorizationRec)); - if (!pAuth) - { - err = BadAlloc; - goto bailout; - } - - /* fill in the auth fields */ - - pAuth->id = authId; - pAuth->timeout = timeout; - pAuth->group = group; - pAuth->trustLevel = trustLevel; - pAuth->refcnt = 0; /* the auth was just created; nobody's using it yet */ - pAuth->secondsRemaining = 0; - pAuth->timer = NULL; - pAuth->eventClients = NULL; - - /* handle event selection */ - if (eventMask) - { - err = SecurityEventSelectForAuthorization(pAuth, client, eventMask); - if (err != Success) - goto bailout; - } - - if (!AddResource(authId, SecurityAuthorizationResType, pAuth)) - { - err = BadAlloc; - goto bailout; - } - - /* start the timer ticking */ - - if (pAuth->timeout != 0) - SecurityStartAuthorizationTimer(pAuth); - - /* tell client the auth id and data */ - - rep.type = X_Reply; - rep.length = (authdata_len + 3) >> 2; - rep.sequenceNumber = client->sequence; - rep.authId = authId; - rep.dataLength = authdata_len; - - if (client->swapped) - { - register char n; - swapl(&rep.length, n); - swaps(&rep.sequenceNumber, n); - swapl(&rep.authId, n); - swaps(&rep.dataLength, n); - } - - WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), - (char *)&rep); - WriteToClient(client, authdata_len, pAuthdata); - - SecurityAudit("client %d generated authorization %d trust %d timeout %d group %d events %d\n", - client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout, - pAuth->group, eventMask); - - /* the request succeeded; don't call RemoveAuthorization or free pAuth */ - - removeAuth = FALSE; - pAuth = NULL; - err = client->noClientException; - -bailout: - if (removeAuth) - RemoveAuthorization(stuff->nbytesAuthProto, protoname, - authdata_len, pAuthdata); - if (pAuth) xfree(pAuth); - return err; - -} /* ProcSecurityGenerateAuthorization */ - -static int -ProcSecurityRevokeAuthorization( - ClientPtr client) -{ - REQUEST(xSecurityRevokeAuthorizationReq); - SecurityAuthorizationPtr pAuth; - - /* paranoia: this "can't happen" because this extension is hidden - * from untrusted clients, but just in case... - */ - if (client->trustLevel != XSecurityClientTrusted) - return BadRequest; - - REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); - - pAuth = (SecurityAuthorizationPtr)SecurityLookupIDByType(client, - stuff->authId, SecurityAuthorizationResType, SecurityDestroyAccess); - if (!pAuth) - return SecurityErrorBase + XSecurityBadAuthorization; - - FreeResource(stuff->authId, RT_NONE); - return Success; -} /* ProcSecurityRevokeAuthorization */ - - -static int -ProcSecurityDispatch( - ClientPtr client) -{ - REQUEST(xReq); - - switch (stuff->data) - { - case X_SecurityQueryVersion: - return ProcSecurityQueryVersion(client); - case X_SecurityGenerateAuthorization: - return ProcSecurityGenerateAuthorization(client); - case X_SecurityRevokeAuthorization: - return ProcSecurityRevokeAuthorization(client); - default: - return BadRequest; - } -} /* ProcSecurityDispatch */ - -static int -SProcSecurityQueryVersion( - ClientPtr client) -{ - REQUEST(xSecurityQueryVersionReq); - register char n; - - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); - swaps(&stuff->majorVersion, n); - swaps(&stuff->minorVersion,n); - return ProcSecurityQueryVersion(client); -} /* SProcSecurityQueryVersion */ - - -static int -SProcSecurityGenerateAuthorization( - ClientPtr client) -{ - REQUEST(xSecurityGenerateAuthorizationReq); - register char n; - CARD32 *values; - unsigned long nvalues; - int values_offset; - - swaps(&stuff->length, n); - REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq); - swaps(&stuff->nbytesAuthProto, n); - swaps(&stuff->nbytesAuthData, n); - swapl(&stuff->valueMask, n); - values_offset = ((stuff->nbytesAuthProto + (unsigned)3) >> 2) + - ((stuff->nbytesAuthData + (unsigned)3) >> 2); - if (values_offset > - stuff->length - (sz_xSecurityGenerateAuthorizationReq >> 2)) - return BadLength; - values = (CARD32 *)(&stuff[1]) + values_offset; - nvalues = (((CARD32 *)stuff) + stuff->length) - values; - SwapLongs(values, nvalues); - return ProcSecurityGenerateAuthorization(client); -} /* SProcSecurityGenerateAuthorization */ - - -static int -SProcSecurityRevokeAuthorization( - ClientPtr client) -{ - REQUEST(xSecurityRevokeAuthorizationReq); - register char n; - - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); - swapl(&stuff->authId, n); - return ProcSecurityRevokeAuthorization(client); -} /* SProcSecurityRevokeAuthorization */ - - -static int -SProcSecurityDispatch( - ClientPtr client) -{ - REQUEST(xReq); - - switch (stuff->data) - { - case X_SecurityQueryVersion: - return SProcSecurityQueryVersion(client); - case X_SecurityGenerateAuthorization: - return SProcSecurityGenerateAuthorization(client); - case X_SecurityRevokeAuthorization: - return SProcSecurityRevokeAuthorization(client); - default: - return BadRequest; - } -} /* SProcSecurityDispatch */ - -static void -SwapSecurityAuthorizationRevokedEvent( - xSecurityAuthorizationRevokedEvent *from, - xSecurityAuthorizationRevokedEvent *to) -{ - to->type = from->type; - to->detail = from->detail; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->authId, to->authId); -} - -/* SecurityDetermineEventPropogationLimits - * - * This is a helper function for SecurityCheckDeviceAccess. - * - * Arguments: - * dev is the device for which the starting and stopping windows for - * event propogation should be determined. - * The values pointed to by ppWin and ppStopWin are not used. - * - * Returns: - * ppWin is filled in with a pointer to the window at which event - * propogation for the given device should start given the current - * state of the server (pointer position, window layout, etc.) - * ppStopWin is filled in with the window at which event propogation - * should stop; events should not go to ppStopWin. - * - * Side Effects: none. - */ - -static void -SecurityDetermineEventPropogationLimits( - DeviceIntPtr dev, - WindowPtr *ppWin, - WindowPtr *ppStopWin) -{ - WindowPtr pFocusWin = dev->focus ? dev->focus->win : NoneWin; - - if (pFocusWin == NoneWin) - { /* no focus -- events don't go anywhere */ - *ppWin = *ppStopWin = NULL; - return; - } - - if (pFocusWin == PointerRootWin) - { /* focus follows the pointer */ - *ppWin = GetSpriteWindow(); - *ppStopWin = NULL; /* propogate all the way to the root */ - } - else - { /* a real window is set for the focus */ - WindowPtr pSpriteWin = GetSpriteWindow(); - *ppStopWin = pFocusWin->parent; /* don't go past the focus window */ - - /* if the pointer is in a subwindow of the focus window, start - * at that subwindow, else start at the focus window itself - */ - if (IsParent(pFocusWin, pSpriteWin)) - *ppWin = pSpriteWin; - else *ppWin = pFocusWin; - } -} /* SecurityDetermineEventPropogationLimits */ - - -/* SecurityCheckDeviceAccess - * - * Arguments: - * client is the client attempting to access a device. - * dev is the device being accessed. - * fromRequest is TRUE if the device access is a direct result of - * the client executing some request and FALSE if it is a - * result of the server trying to send an event (e.g. KeymapNotify) - * to the client. - * Returns: - * TRUE if the device access should be allowed, else FALSE. - * - * Side Effects: - * An audit message is generated if access is denied. - */ - -Bool -SecurityCheckDeviceAccess(client, dev, fromRequest) - ClientPtr client; - DeviceIntPtr dev; - Bool fromRequest; -{ - WindowPtr pWin, pStopWin; - Bool untrusted_got_event; - Bool found_event_window; - Mask eventmask; - int reqtype = 0; - - /* trusted clients always allowed to do anything */ - if (client->trustLevel == XSecurityClientTrusted) - return TRUE; - - /* device security other than keyboard is not implemented yet */ - if (dev != inputInfo.keyboard) - return TRUE; - - /* some untrusted client wants access */ - - if (fromRequest) - { - reqtype = ((xReq *)client->requestBuffer)->reqType; - switch (reqtype) - { - /* never allow these */ - case X_ChangeKeyboardMapping: - case X_ChangeKeyboardControl: - case X_SetModifierMapping: - SecurityAudit("client %d attempted request %d\n", - client->index, reqtype); - return FALSE; - default: - break; - } - } - - untrusted_got_event = FALSE; - found_event_window = FALSE; - - if (dev->grab) - { - untrusted_got_event = - ((rClient(dev->grab))->trustLevel != XSecurityClientTrusted); - } - else - { - SecurityDetermineEventPropogationLimits(dev, &pWin, &pStopWin); - - eventmask = KeyPressMask | KeyReleaseMask; - while ( (pWin != pStopWin) && !found_event_window) - { - OtherClients *other; - - if (pWin->eventMask & eventmask) - { - found_event_window = TRUE; - client = wClient(pWin); - if (client->trustLevel != XSecurityClientTrusted) - { - untrusted_got_event = TRUE; - } - } - if (wOtherEventMasks(pWin) & eventmask) - { - found_event_window = TRUE; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->mask & eventmask) - { - client = rClient(other); - if (client->trustLevel != XSecurityClientTrusted) - { - untrusted_got_event = TRUE; - break; - } - } - } - } - if (wDontPropagateMask(pWin) & eventmask) - break; - pWin = pWin->parent; - } /* while propogating the event */ - } - - /* allow access by untrusted clients only if an event would have gone - * to an untrusted client - */ - - if (!untrusted_got_event) - { - char *devname = dev->name; - if (!devname) devname = "unnamed"; - if (fromRequest) - SecurityAudit("client %d attempted request %d device %d (%s)\n", - client->index, reqtype, dev->id, devname); - else - SecurityAudit("client %d attempted to access device %d (%s)\n", - client->index, dev->id, devname); - } - return untrusted_got_event; -} /* SecurityCheckDeviceAccess */ - - - -/* SecurityAuditResourceIDAccess - * - * Arguments: - * client is the client doing the resource access. - * id is the resource id. - * - * Returns: NULL - * - * Side Effects: - * An audit message is generated with details of the denied - * resource access. - */ - -static pointer -SecurityAuditResourceIDAccess( - ClientPtr client, - XID id) -{ - int cid = CLIENT_ID(id); - int reqtype = ((xReq *)client->requestBuffer)->reqType; - switch (reqtype) - { - case X_ChangeProperty: - case X_DeleteProperty: - case X_GetProperty: - { - xChangePropertyReq *req = - (xChangePropertyReq *)client->requestBuffer; - int propertyatom = req->property; - char *propertyname = NameForAtom(propertyatom); - - SecurityAudit("client %d attempted request %d with window 0x%x property %s of client %d\n", - client->index, reqtype, id, propertyname, cid); - break; - } - default: - { - SecurityAudit("client %d attempted request %d with resource 0x%x of client %d\n", - client->index, reqtype, id, cid); - break; - } - } - return NULL; -} /* SecurityAuditResourceIDAccess */ - - -/* SecurityCheckResourceIDAccess - * - * This function gets plugged into client->CheckAccess and is called from - * SecurityLookupIDByType/Class to determine if the client can access the - * resource. - * - * Arguments: - * client is the client doing the resource access. - * id is the resource id. - * rtype is its type or class. - * access_mode represents the intended use of the resource; see - * resource.h. - * rval is a pointer to the resource structure for this resource. - * - * Returns: - * If access is granted, the value of rval that was passed in, else NULL. - * - * Side Effects: - * Disallowed resource accesses are audited. - */ - -static pointer -SecurityCheckResourceIDAccess( - ClientPtr client, - XID id, - RESTYPE rtype, - Mask access_mode, - pointer rval) -{ - int cid = CLIENT_ID(id); - int reqtype = ((xReq *)client->requestBuffer)->reqType; - - if (SecurityUnknownAccess == access_mode) - return rval; /* for compatibility, we have to allow access */ - - switch (reqtype) - { /* these are always allowed */ - case X_QueryTree: - case X_TranslateCoords: - case X_GetGeometry: - /* property access is controlled in SecurityCheckPropertyAccess */ - case X_GetProperty: - case X_ChangeProperty: - case X_DeleteProperty: - case X_RotateProperties: - case X_ListProperties: - return rval; - default: - break; - } - - if (cid != 0) - { /* not a server-owned resource */ - /* - * The following 'if' restricts clients to only access resources at - * the same trustLevel. Since there are currently only two trust levels, - * and trusted clients never call this function, this degenerates into - * saying that untrusted clients can only access resources of other - * untrusted clients. One way to add the notion of groups would be to - * allow values other than Trusted (0) and Untrusted (1) for this field. - * Clients at the same trust level would be able to use each other's - * resources, but not those of clients at other trust levels. I haven't - * tried it, but this probably mostly works already. The obvious - * competing alternative for grouping clients for security purposes is to - * use app groups. dpw - */ - if (client->trustLevel == clients[cid]->trustLevel -#ifdef XAPPGROUP - || (RT_COLORMAP == rtype && - XagDefaultColormap (client) == (Colormap) id) -#endif - ) - return rval; - else - return SecurityAuditResourceIDAccess(client, id); - } - else /* server-owned resource - probably a default colormap or root window */ - { - if (RT_WINDOW == rtype || RC_DRAWABLE == rtype) - { - switch (reqtype) - { /* the following operations are allowed on root windows */ - case X_CreatePixmap: - case X_CreateGC: - case X_CreateWindow: - case X_CreateColormap: - case X_ListProperties: - case X_GrabPointer: - case X_UngrabButton: - case X_QueryBestSize: - case X_GetWindowAttributes: - break; - case X_SendEvent: - { /* see if it is an event specified by the ICCCM */ - xSendEventReq *req = (xSendEventReq *) - (client->requestBuffer); - if (req->propagate == xTrue - || - (req->eventMask != ColormapChangeMask && - req->eventMask != StructureNotifyMask && - req->eventMask != - (SubstructureRedirectMask|SubstructureNotifyMask) - ) - || - (req->event.u.u.type != UnmapNotify && - req->event.u.u.type != ConfigureRequest && - req->event.u.u.type != ClientMessage - ) - ) - { /* not an ICCCM event */ - return SecurityAuditResourceIDAccess(client, id); - } - break; - } /* case X_SendEvent on root */ - - case X_ChangeWindowAttributes: - { /* Allow selection of PropertyNotify and StructureNotify - * events on the root. - */ - xChangeWindowAttributesReq *req = - (xChangeWindowAttributesReq *)(client->requestBuffer); - if (req->valueMask == CWEventMask) - { - CARD32 value = *((CARD32 *)(req + 1)); - if ( (value & - ~(PropertyChangeMask|StructureNotifyMask)) == 0) - break; - } - return SecurityAuditResourceIDAccess(client, id); - } /* case X_ChangeWindowAttributes on root */ - - default: - { -#ifdef LBX - /* XXX really need per extension dispatching */ - if (reqtype == LbxReqCode) { - switch (((xReq *)client->requestBuffer)->data) { - case X_LbxGetProperty: - case X_LbxChangeProperty: - return rval; - default: - break; - } - } -#endif - /* others not allowed */ - return SecurityAuditResourceIDAccess(client, id); - } - } - } /* end server-owned window or drawable */ - else if (SecurityAuthorizationResType == rtype) - { - SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)rval; - if (pAuth->trustLevel != client->trustLevel) - return SecurityAuditResourceIDAccess(client, id); - } - else if (RT_COLORMAP != rtype) - { /* don't allow anything else besides colormaps */ - return SecurityAuditResourceIDAccess(client, id); - } - } - return rval; -} /* SecurityCheckResourceIDAccess */ - - -/* SecurityClientStateCallback - * - * Arguments: - * pcbl is &ClientStateCallback. - * nullata is NULL. - * calldata is a pointer to a NewClientInfoRec (include/dixstruct.h) - * which contains information about client state changes. - * - * Returns: nothing. - * - * Side Effects: - * - * If a new client is connecting, its authorization ID is copied to - * client->authID. If this is a generated authorization, its reference - * count is bumped, its timer is cancelled if it was running, and its - * trustlevel is copied to client->trustLevel. - * - * If a client is disconnecting and the client was using a generated - * authorization, the authorization's reference count is decremented, and - * if it is now zero, the timer for this authorization is started. - */ - -static void -SecurityClientStateCallback( - CallbackListPtr *pcbl, - pointer nulldata, - pointer calldata) -{ - NewClientInfoRec *pci = (NewClientInfoRec *)calldata; - ClientPtr client = pci->client; - - switch (client->clientState) - { - case ClientStateRunning: - { - XID authId = AuthorizationIDOfClient(client); - SecurityAuthorizationPtr pAuth; - - client->authId = authId; - pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId, - SecurityAuthorizationResType); - if (pAuth) - { /* it is a generated authorization */ - pAuth->refcnt++; - if (pAuth->refcnt == 1) - { - if (pAuth->timer) TimerCancel(pAuth->timer); - } - client->trustLevel = pAuth->trustLevel; - if (client->trustLevel != XSecurityClientTrusted) - { - client->CheckAccess = SecurityCheckResourceIDAccess; - client->requestVector = client->swapped ? - SwappedUntrustedProcVector : UntrustedProcVector; - } - } - break; - } - case ClientStateGone: - case ClientStateRetained: /* client disconnected */ - { - XID authId = client->authId; - SecurityAuthorizationPtr pAuth; - - pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId, - SecurityAuthorizationResType); - if (pAuth) - { /* it is a generated authorization */ - pAuth->refcnt--; - if (pAuth->refcnt == 0) - { - SecurityStartAuthorizationTimer(pAuth); - } - } - break; - } - default: break; - } -} /* SecurityClientStateCallback */ - -#ifdef LBX -Bool -SecuritySameLevel(client, authId) - ClientPtr client; - XID authId; -{ - SecurityAuthorizationPtr pAuth; - - pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId, - SecurityAuthorizationResType); - if (pAuth) - return client->trustLevel == pAuth->trustLevel; - return client->trustLevel == XSecurityClientTrusted; -} -#endif - -/* SecurityCensorImage - * - * Called after pScreen->GetImage to prevent pieces or trusted windows from - * being returned in image data from an untrusted window. - * - * Arguments: - * client is the client doing the GetImage. - * pVisibleRegion is the visible region of the window. - * widthBytesLine is the width in bytes of one horizontal line in pBuf. - * pDraw is the source window. - * x, y, w, h is the rectangle of image data from pDraw in pBuf. - * format is the format of the image data in pBuf: ZPixmap or XYPixmap. - * pBuf is the image data. - * - * Returns: nothing. - * - * Side Effects: - * Any part of the rectangle (x, y, w, h) that is outside the visible - * region of the window will be destroyed (overwritten) in pBuf. - */ -void -SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h, - format, pBuf) - ClientPtr client; - RegionPtr pVisibleRegion; - long widthBytesLine; - DrawablePtr pDraw; - int x, y, w, h; - unsigned int format; - char * pBuf; -{ - ScreenPtr pScreen = pDraw->pScreen; - RegionRec imageRegion; /* region representing x,y,w,h */ - RegionRec censorRegion; /* region to obliterate */ - BoxRec imageBox; - int nRects; - - imageBox.x1 = x; - imageBox.y1 = y; - imageBox.x2 = x + w; - imageBox.y2 = y + h; - REGION_INIT(pScreen, &imageRegion, &imageBox, 1); - REGION_NULL(pScreen, &censorRegion); - - /* censorRegion = imageRegion - visibleRegion */ - REGION_SUBTRACT(pScreen, &censorRegion, &imageRegion, pVisibleRegion); - nRects = REGION_NUM_RECTS(&censorRegion); - if (nRects > 0) - { /* we have something to censor */ - GCPtr pScratchGC = NULL; - PixmapPtr pPix = NULL; - xRectangle *pRects = NULL; - Bool failed = FALSE; - int depth = 1; - int bitsPerPixel = 1; - int i; - BoxPtr pBox; - - /* convert region to list-of-rectangles for PolyFillRect */ - - pRects = (xRectangle *)ALLOCATE_LOCAL(nRects * sizeof(xRectangle *)); - if (!pRects) - { - failed = TRUE; - goto failSafe; - } - for (pBox = REGION_RECTS(&censorRegion), i = 0; - i < nRects; - i++, pBox++) - { - pRects[i].x = pBox->x1; - pRects[i].y = pBox->y1 - imageBox.y1; - pRects[i].width = pBox->x2 - pBox->x1; - pRects[i].height = pBox->y2 - pBox->y1; - } - - /* use pBuf as a fake pixmap */ - - if (format == ZPixmap) - { - depth = pDraw->depth; - bitsPerPixel = pDraw->bitsPerPixel; - } - - pPix = GetScratchPixmapHeader(pDraw->pScreen, w, h, - depth, bitsPerPixel, - widthBytesLine, (pointer)pBuf); - if (!pPix) - { - failed = TRUE; - goto failSafe; - } - - pScratchGC = GetScratchGC(depth, pPix->drawable.pScreen); - if (!pScratchGC) - { - failed = TRUE; - goto failSafe; - } - - ValidateGC(&pPix->drawable, pScratchGC); - (* pScratchGC->ops->PolyFillRect)(&pPix->drawable, - pScratchGC, nRects, pRects); - - failSafe: - if (failed) - { - /* Censoring was not completed above. To be safe, wipe out - * all the image data so that nothing trusted gets out. - */ - bzero(pBuf, (int)(widthBytesLine * h)); - } - if (pRects) DEALLOCATE_LOCAL(pRects); - if (pScratchGC) FreeScratchGC(pScratchGC); - if (pPix) FreeScratchPixmapHeader(pPix); - } - REGION_UNINIT(pScreen, &imageRegion); - REGION_UNINIT(pScreen, &censorRegion); -} /* SecurityCensorImage */ - -/**********************************************************************/ - -typedef struct _PropertyAccessRec { - ATOM name; - ATOM mustHaveProperty; - char *mustHaveValue; - char windowRestriction; -#define SecurityAnyWindow 0 -#define SecurityRootWindow 1 -#define SecurityWindowWithProperty 2 - char readAction; - char writeAction; - char destroyAction; - struct _PropertyAccessRec *next; -} PropertyAccessRec, *PropertyAccessPtr; - -static PropertyAccessPtr PropertyAccessList = NULL; -static char SecurityDefaultAction = SecurityErrorOperation; -static char *SecurityPolicyFile = DEFAULTPOLICYFILE; -static ATOM SecurityMaxPropertyName = 0; - -static char *SecurityKeywords[] = { -#define SecurityKeywordComment 0 - "#", -#define SecurityKeywordProperty 1 - "property", -#define SecurityKeywordSitePolicy 2 - "sitepolicy", -#define SecurityKeywordRoot 3 - "root", -#define SecurityKeywordAny 4 - "any" -}; - -#define NUMKEYWORDS (sizeof(SecurityKeywords) / sizeof(char *)) - -#undef PROPDEBUG -/*#define PROPDEBUG 1*/ - -static void -SecurityFreePropertyAccessList(void) -{ - while (PropertyAccessList) - { - PropertyAccessPtr freeit = PropertyAccessList; - PropertyAccessList = PropertyAccessList->next; - xfree(freeit); - } -} /* SecurityFreePropertyAccessList */ - -#ifndef __UNIXOS2__ -#define SecurityIsWhitespace(c) ( (c == ' ') || (c == '\t') || (c == '\n') ) -#else -#define SecurityIsWhitespace(c) ( (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') ) -#endif - -static char * -SecuritySkipWhitespace( - char *p) -{ - while (SecurityIsWhitespace(*p)) - p++; - return p; -} /* SecuritySkipWhitespace */ - - -static char * -SecurityParseString( - char **rest) -{ - char *startOfString; - char *s = *rest; - char endChar = 0; - - s = SecuritySkipWhitespace(s); - - if (*s == '"' || *s == '\'') - { - endChar = *s++; - startOfString = s; - while (*s && (*s != endChar)) - s++; - } - else - { - startOfString = s; - while (*s && !SecurityIsWhitespace(*s)) - s++; - } - if (*s) - { - *s = '\0'; - *rest = s + 1; - return startOfString; - } - else - { - *rest = s; - return (endChar) ? NULL : startOfString; - } -} /* SecurityParseString */ - - -static int -SecurityParseKeyword( - char **p) -{ - int i; - char *s = *p; - s = SecuritySkipWhitespace(s); - for (i = 0; i < NUMKEYWORDS; i++) - { - int len = strlen(SecurityKeywords[i]); - if (strncmp(s, SecurityKeywords[i], len) == 0) - { - *p = s + len; - return (i); - } - } - *p = s; - return -1; -} /* SecurityParseKeyword */ - - -static Bool -SecurityParsePropertyAccessRule( - char *p) -{ - char *propname; - char c; - char action = SecurityDefaultAction; - char readAction, writeAction, destroyAction; - PropertyAccessPtr pacl, prev, cur; - char *mustHaveProperty = NULL; - char *mustHaveValue = NULL; - Bool invalid; - char windowRestriction; - int size; - int keyword; - - /* get property name */ - propname = SecurityParseString(&p); - if (!propname || (strlen(propname) == 0)) - return FALSE; - - /* get window on which property must reside for rule to apply */ - - keyword = SecurityParseKeyword(&p); - if (keyword == SecurityKeywordRoot) - windowRestriction = SecurityRootWindow; - else if (keyword == SecurityKeywordAny) - windowRestriction = SecurityAnyWindow; - else /* not root or any, must be a property name */ - { - mustHaveProperty = SecurityParseString(&p); - if (!mustHaveProperty || (strlen(mustHaveProperty) == 0)) - return FALSE; - windowRestriction = SecurityWindowWithProperty; - p = SecuritySkipWhitespace(p); - if (*p == '=') - { /* property value is specified too */ - p++; /* skip over '=' */ - mustHaveValue = SecurityParseString(&p); - if (!mustHaveValue) - return FALSE; - } - } - - /* get operations and actions */ - - invalid = FALSE; - readAction = writeAction = destroyAction = SecurityDefaultAction; - while ( (c = *p++) && !invalid) - { - switch (c) - { - case 'i': action = SecurityIgnoreOperation; break; - case 'a': action = SecurityAllowOperation; break; - case 'e': action = SecurityErrorOperation; break; - - case 'r': readAction = action; break; - case 'w': writeAction = action; break; - case 'd': destroyAction = action; break; - - default : - if (!SecurityIsWhitespace(c)) - invalid = TRUE; - break; - } - } - if (invalid) - return FALSE; - - /* We've successfully collected all the information needed for this - * property access rule. Now record it in a PropertyAccessRec. - */ - size = sizeof(PropertyAccessRec); - - /* If there is a property value string, allocate space for it - * right after the PropertyAccessRec. - */ - if (mustHaveValue) - size += strlen(mustHaveValue) + 1; - pacl = (PropertyAccessPtr)Xalloc(size); - if (!pacl) - return FALSE; - - pacl->name = MakeAtom(propname, strlen(propname), TRUE); - if (pacl->name == BAD_RESOURCE) - { - Xfree(pacl); - return FALSE; - } - if (mustHaveProperty) - { - pacl->mustHaveProperty = MakeAtom(mustHaveProperty, - strlen(mustHaveProperty), TRUE); - if (pacl->mustHaveProperty == BAD_RESOURCE) - { - Xfree(pacl); - return FALSE; - } - } - else - pacl->mustHaveProperty = 0; - - if (mustHaveValue) - { - pacl->mustHaveValue = (char *)(pacl + 1); - strcpy(pacl->mustHaveValue, mustHaveValue); - } - else - pacl->mustHaveValue = NULL; - - SecurityMaxPropertyName = max(SecurityMaxPropertyName, pacl->name); - - pacl->windowRestriction = windowRestriction; - pacl->readAction = readAction; - pacl->writeAction = writeAction; - pacl->destroyAction = destroyAction; - - /* link the new rule into the list of rules in order of increasing - * property name (atom) value to make searching easier - */ - - for (prev = NULL, cur = PropertyAccessList; - cur && cur->name <= pacl->name; - prev = cur, cur = cur->next) - ; - if (!prev) - { - pacl->next = cur; - PropertyAccessList = pacl; - } - else - { - prev->next = pacl; - pacl->next = cur; - } - return TRUE; -} /* SecurityParsePropertyAccessRule */ - -static char **SecurityPolicyStrings = NULL; -static int nSecurityPolicyStrings = 0; - -static Bool -SecurityParseSitePolicy( - char *p) -{ - char *policyStr = SecurityParseString(&p); - char *copyPolicyStr; - char **newStrings; - - if (!policyStr) - return FALSE; - - copyPolicyStr = (char *)Xalloc(strlen(policyStr) + 1); - if (!copyPolicyStr) - return TRUE; - strcpy(copyPolicyStr, policyStr); - newStrings = (char **)Xrealloc(SecurityPolicyStrings, - sizeof (char *) * (nSecurityPolicyStrings + 1)); - if (!newStrings) - { - Xfree(copyPolicyStr); - return TRUE; - } - - SecurityPolicyStrings = newStrings; - SecurityPolicyStrings[nSecurityPolicyStrings++] = copyPolicyStr; - - return TRUE; - -} /* SecurityParseSitePolicy */ - - -char ** -SecurityGetSitePolicyStrings(n) - int *n; -{ - *n = nSecurityPolicyStrings; - return SecurityPolicyStrings; -} /* SecurityGetSitePolicyStrings */ - -static void -SecurityFreeSitePolicyStrings(void) -{ - if (SecurityPolicyStrings) - { - assert(nSecurityPolicyStrings); - while (nSecurityPolicyStrings--) - { - Xfree(SecurityPolicyStrings[nSecurityPolicyStrings]); - } - Xfree(SecurityPolicyStrings); - SecurityPolicyStrings = NULL; - nSecurityPolicyStrings = 0; - } -} /* SecurityFreeSitePolicyStrings */ - - -static void -SecurityLoadPropertyAccessList(void) -{ - FILE *f; - int lineNumber = 0; - - SecurityMaxPropertyName = 0; - - if (!SecurityPolicyFile) - return; - -#ifndef __UNIXOS2__ - f = Fopen(SecurityPolicyFile, "r"); -#else - f = Fopen((char*)__XOS2RedirRoot(SecurityPolicyFile), "r"); -#endif - if (!f) - { - ErrorF("error opening security policy file %s\n", - SecurityPolicyFile); - return; - } - - while (!feof(f)) - { - char buf[200]; - Bool validLine; - char *p; - - if (!(p = fgets(buf, sizeof(buf), f))) - break; - lineNumber++; - - /* if first line, check version number */ - if (lineNumber == 1) - { - char *v = SecurityParseString(&p); - if (strcmp(v, SECURITY_POLICY_FILE_VERSION) != 0) - { - ErrorF("%s: invalid security policy file version, ignoring file\n", - SecurityPolicyFile); - break; - } - validLine = TRUE; - } - else - { - switch (SecurityParseKeyword(&p)) - { - case SecurityKeywordComment: - validLine = TRUE; - break; - - case SecurityKeywordProperty: - validLine = SecurityParsePropertyAccessRule(p); - break; - - case SecurityKeywordSitePolicy: - validLine = SecurityParseSitePolicy(p); - break; - - default: - validLine = (*p == '\0'); /* blank lines OK, others not */ - break; - } - } - - if (!validLine) - ErrorF("Line %d of %s invalid, ignoring\n", - lineNumber, SecurityPolicyFile); - } /* end while more input */ - -#ifdef PROPDEBUG - { - PropertyAccessPtr pacl; - char *op = "aie"; - for (pacl = PropertyAccessList; pacl; pacl = pacl->next) - { - ErrorF("property %s ", NameForAtom(pacl->name)); - switch (pacl->windowRestriction) - { - case SecurityAnyWindow: ErrorF("any "); break; - case SecurityRootWindow: ErrorF("root "); break; - case SecurityWindowWithProperty: - { - ErrorF("%s ", NameForAtom(pacl->mustHaveProperty)); - if (pacl->mustHaveValue) - ErrorF(" = \"%s\" ", pacl->mustHaveValue); - - } - break; - } - ErrorF("%cr %cw %cd\n", op[pacl->readAction], - op[pacl->writeAction], op[pacl->destroyAction]); - } - } -#endif /* PROPDEBUG */ - - Fclose(f); -} /* SecurityLoadPropertyAccessList */ - - -static Bool -SecurityMatchString( - char *ws, - char *cs) -{ - while (*ws && *cs) - { - if (*ws == '*') - { - Bool match = FALSE; - ws++; - while (!(match = SecurityMatchString(ws, cs)) && *cs) - { - cs++; - } - return match; - } - else if (*ws == *cs) - { - ws++; - cs++; - } - else break; - } - return ( ( (*ws == '\0') || ((*ws == '*') && *(ws+1) == '\0') ) - && (*cs == '\0') ); -} /* SecurityMatchString */ - -#ifdef PROPDEBUG -#include -#include -#endif - - -char -SecurityCheckPropertyAccess(client, pWin, propertyName, access_mode) - ClientPtr client; - WindowPtr pWin; - ATOM propertyName; - Mask access_mode; -{ - PropertyAccessPtr pacl; - char action = SecurityDefaultAction; - - /* if client trusted or window untrusted, allow operation */ - - if ( (client->trustLevel == XSecurityClientTrusted) || - (wClient(pWin)->trustLevel != XSecurityClientTrusted) ) - return SecurityAllowOperation; - -#ifdef PROPDEBUG - /* For testing, it's more convenient if the property rules file gets - * reloaded whenever it changes, so we can rapidly try things without - * having to reset the server. - */ - { - struct stat buf; - static time_t lastmod = 0; - int ret = stat(SecurityPolicyFile , &buf); - if ( (ret == 0) && (buf.st_mtime > lastmod) ) - { - ErrorF("reloading property rules\n"); - SecurityFreePropertyAccessList(); - SecurityLoadPropertyAccessList(); - lastmod = buf.st_mtime; - } - } -#endif - - /* If the property atom is bigger than any atoms on the list, - * we know we won't find it, so don't even bother looking. - */ - if (propertyName <= SecurityMaxPropertyName) - { - /* untrusted client operating on trusted window; see if it's allowed */ - - for (pacl = PropertyAccessList; pacl; pacl = pacl->next) - { - if (pacl->name < propertyName) - continue; - if (pacl->name > propertyName) - break; - - /* pacl->name == propertyName, so see if it applies to this window */ - - switch (pacl->windowRestriction) - { - case SecurityAnyWindow: /* always applies */ - break; - - case SecurityRootWindow: - { - /* if not a root window, this rule doesn't apply */ - if (pWin->parent) - continue; - } - break; - - case SecurityWindowWithProperty: - { - PropertyPtr pProp = wUserProps (pWin); - Bool match = FALSE; - char *p; - char *pEndData; - - while (pProp) - { - if (pProp->propertyName == pacl->mustHaveProperty) - break; - pProp = pProp->next; - } - if (!pProp) - continue; - if (!pacl->mustHaveValue) - break; - if (pProp->type != XA_STRING || pProp->format != 8) - continue; - - p = pProp->data; - pEndData = ((char *)pProp->data) + pProp->size; - while (!match && p < pEndData) - { - if (SecurityMatchString(pacl->mustHaveValue, p)) - match = TRUE; - else - { /* skip to the next string */ - while (*p++ && p < pEndData) - ; - } - } - if (!match) - continue; - } - break; /* end case SecurityWindowWithProperty */ - } /* end switch on windowRestriction */ - - /* If we get here, the property access rule pacl applies. - * If pacl doesn't apply, something above should have - * executed a continue, which will skip the follwing code. - */ - action = SecurityAllowOperation; - if (access_mode & SecurityReadAccess) - action = max(action, pacl->readAction); - if (access_mode & SecurityWriteAccess) - action = max(action, pacl->writeAction); - if (access_mode & SecurityDestroyAccess) - action = max(action, pacl->destroyAction); - break; - } /* end for each pacl */ - } /* end if propertyName <= SecurityMaxPropertyName */ - - if (SecurityAllowOperation != action) - { /* audit the access violation */ - int cid = CLIENT_ID(pWin->drawable.id); - int reqtype = ((xReq *)client->requestBuffer)->reqType; - char *actionstr = (SecurityIgnoreOperation == action) ? - "ignored" : "error"; - SecurityAudit("client %d attempted request %d with window 0x%x property %s (atom 0x%x) of client %d, %s\n", - client->index, reqtype, pWin->drawable.id, - NameForAtom(propertyName), propertyName, cid, actionstr); - } - return action; -} /* SecurityCheckPropertyAccess */ - - -/* SecurityResetProc - * - * Arguments: - * extEntry is the extension information for the security extension. - * - * Returns: nothing. - * - * Side Effects: - * Performs any cleanup needed by Security at server shutdown time. - */ - -static void -SecurityResetProc( - ExtensionEntry *extEntry) -{ - SecurityFreePropertyAccessList(); - SecurityFreeSitePolicyStrings(); -} /* SecurityResetProc */ - - -int -XSecurityOptions(argc, argv, i) - int argc; - char **argv; - int i; -{ - if (strcmp(argv[i], "-sp") == 0) - { - if (i < argc) - SecurityPolicyFile = argv[++i]; - return (i + 1); - } - return (i); -} /* XSecurityOptions */ - - - -/* SecurityExtensionInit - * - * Arguments: none. - * - * Returns: nothing. - * - * Side Effects: - * Enables the Security extension if possible. - */ - -void -SecurityExtensionInit(INITARGS) -{ - ExtensionEntry *extEntry; - int i; - - SecurityAuthorizationResType = - CreateNewResourceType(SecurityDeleteAuthorization); - - RTEventClient = CreateNewResourceType( - SecurityDeleteAuthorizationEventClient); - - if (!SecurityAuthorizationResType || !RTEventClient) - return; - - RTEventClient |= RC_NEVERRETAIN; - - if (!AddCallback(&ClientStateCallback, SecurityClientStateCallback, NULL)) - return; - - extEntry = AddExtension(SECURITY_EXTENSION_NAME, - XSecurityNumberEvents, XSecurityNumberErrors, - ProcSecurityDispatch, SProcSecurityDispatch, - SecurityResetProc, StandardMinorOpcode); - - SecurityErrorBase = extEntry->errorBase; - SecurityEventBase = extEntry->eventBase; - - EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] = - (EventSwapPtr)SwapSecurityAuthorizationRevokedEvent; - - /* initialize untrusted proc vectors */ - - for (i = 0; i < 128; i++) - { - UntrustedProcVector[i] = ProcVector[i]; - SwappedUntrustedProcVector[i] = SwappedProcVector[i]; - } - - /* make sure insecure extensions are not allowed */ - - for (i = 128; i < 256; i++) - { - if (!UntrustedProcVector[i]) - { - UntrustedProcVector[i] = ProcBadRequest; - SwappedUntrustedProcVector[i] = ProcBadRequest; - } - } - - SecurityLoadPropertyAccessList(); - -} /* SecurityExtensionInit */ diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c.NX.original b/nx-X11/programs/Xserver/dix/dixfonts.c.NX.original deleted file mode 100644 index b66fe23bd..000000000 --- a/nx-X11/programs/Xserver/dix/dixfonts.c.NX.original +++ /dev/null @@ -1,2215 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/dix/dixfonts.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.28 2003/11/08 02:02:03 dawes 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. - -************************************************************************/ -/* The panoramix components contained the following notice */ -/* -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ -/* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ - -#define NEED_REPLIES -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "scrnintstr.h" -#include "resource.h" -#include "dixstruct.h" -#include "cursorstr.h" -#include "misc.h" -#include "opaque.h" -#include "dixfontstr.h" -#include "closestr.h" - -#ifdef DEBUG -#include -#endif - -#ifdef NX_TRANS_SOCKET - -char _NXFontPath[1024]; - -/* - * Override the default font path and make - * it configurable at run time, based on - * the NX_FONT environment. - */ - -static const char *_NXGetFontPath(const char *path) -{ - const char *fontEnv; - - /* - * Check the environment only once. - */ - - if (*_NXFontPath != '\0') - { - return _NXFontPath; - } - - fontEnv = getenv("NX_FONT"); - - if (fontEnv != NULL && *fontEnv != '\0') - { - if (strlen(fontEnv) + 1 > 1024) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetFontPath: WARNING! Maximum length of font path exceeded.\n"); -#endif - goto _NXGetFontPathError; - } - - strcpy(_NXFontPath, fontEnv); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetFontPath: Using NX font path [%s].\n", _NXFontPath); -#endif - - return _NXFontPath; - } - -_NXGetFontPathError: - - strcpy(_NXFontPath, path); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetFontPath: Using default font path [%s].\n", _NXFontPath); -#endif - - return _NXFontPath; -} - -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#endif - -#ifdef LBX -#include "lbxserve.h" -#endif - -#ifdef XF86BIGFONT -#define _XF86BIGFONT_SERVER_ -#include -#endif - -#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics - -extern pointer fosNaturalParams; -extern FontPtr defaultFont; - -static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; -static int num_fpes = 0; -FPEFunctions *fpe_functions = (FPEFunctions *) 0; -static int num_fpe_types = 0; - -static unsigned char *font_path_string; - -static int num_slept_fpes = 0; -static int size_slept_fpes = 0; -static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; -static FontPatternCachePtr patternCache; - -int -FontToXError(err) - int err; -{ - switch (err) { - case Successful: - return Success; - case AllocError: - return BadAlloc; - case BadFontName: - return BadName; - case BadFontPath: - case BadFontFormat: /* is there something better? */ - case BadCharRange: - return BadValue; - default: - return err; - } -} - - -/* - * adding RT_FONT prevents conflict with default cursor font - */ -Bool -SetDefaultFont(char *defaultfontname) -{ - int err; - FontPtr pf; - XID fid; - - fid = FakeClientID(0); - err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync, - (unsigned) strlen(defaultfontname), defaultfontname); - if (err != Success) - return FALSE; - pf = (FontPtr) LookupIDByType(fid, RT_FONT); - if (pf == (FontPtr) NULL) - return FALSE; - defaultFont = pf; - return TRUE; -} - -/* - * note that the font wakeup queue is not refcounted. this is because - * an fpe needs to be added when it's inited, and removed when it's finally - * freed, in order to handle any data that isn't requested, like FS events. - * - * since the only thing that should call these routines is the renderer's - * init_fpe() and free_fpe(), there shouldn't be any problem in using - * freed data. - */ -void -QueueFontWakeup(FontPathElementPtr fpe) -{ - int i; - FontPathElementPtr *new; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - -#ifdef DEBUG - fprintf(stderr, "re-queueing fpe wakeup\n"); -#endif - - return; - } - } - if (num_slept_fpes == size_slept_fpes) { - new = (FontPathElementPtr *) - xrealloc(slept_fpes, - sizeof(FontPathElementPtr) * (size_slept_fpes + 4)); - if (!new) - return; - slept_fpes = new; - size_slept_fpes += 4; - } - slept_fpes[num_slept_fpes] = fpe; - num_slept_fpes++; -} - -void -RemoveFontWakeup(FontPathElementPtr fpe) -{ - int i, - j; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - for (j = i; j < num_slept_fpes; j++) { - slept_fpes[j] = slept_fpes[j + 1]; - } - num_slept_fpes--; - return; - } - } -} - -void -FontWakeup(pointer data, int count, pointer LastSelectMask) -{ - int i; - FontPathElementPtr fpe; - - if (count < 0) - return; - /* wake up any fpe's that may be waiting for information */ - for (i = 0; i < num_slept_fpes; i++) { - fpe = slept_fpes[i]; - (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); - } -} - -/* XXX -- these two funcs may want to be broken into macros */ -static void -UseFPE(FontPathElementPtr fpe) -{ - fpe->refcount++; -} - -static void -FreeFPE (FontPathElementPtr fpe) -{ - fpe->refcount--; - if (fpe->refcount == 0) { - (*fpe_functions[fpe->type].free_fpe) (fpe); - xfree(fpe->name); - xfree(fpe); - } -} - -static Bool -doOpenFont(ClientPtr client, OFclosurePtr c) -{ - FontPtr pfont = NullFont; - FontPathElementPtr fpe = NULL; - ScreenPtr pScr; - int err = Successful; - int i; - char *alias, - *newname; - int newlen; - int aliascount = 20; - /* - * Decide at runtime what FontFormat to use. - */ - Mask FontFormat = - - ((screenInfo.imageByteOrder == LSBFirst) ? - BitmapFormatByteOrderLSB : BitmapFormatByteOrderMSB) | - - ((screenInfo.bitmapBitOrder == LSBFirst) ? - BitmapFormatBitOrderLSB : BitmapFormatBitOrderMSB) | - - BitmapFormatImageRectMin | - -#if GLYPHPADBYTES == 1 - BitmapFormatScanlinePad8 | -#endif - -#if GLYPHPADBYTES == 2 - BitmapFormatScanlinePad16 | -#endif - -#if GLYPHPADBYTES == 4 - BitmapFormatScanlinePad32 | -#endif - -#if GLYPHPADBYTES == 8 - BitmapFormatScanlinePad64 | -#endif - - BitmapFormatScanlineUnit8; - - if (client->clientGone) - { - if (c->current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - while (c->current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current_fpe]; - err = (*fpe_functions[fpe->type].open_font) - ((pointer) client, fpe, c->flags, - c->fontname, c->fnamelen, FontFormat, - BitmapFormatMaskByte | - BitmapFormatMaskBit | - BitmapFormatMaskImageRectangle | - BitmapFormatMaskScanLinePad | - BitmapFormatMaskScanLineUnit, - c->fontid, &pfont, &alias, - c->non_cachable_font && c->non_cachable_font->fpe == fpe ? - c->non_cachable_font : - (FontPtr)0); - - if (err == FontNameAlias && alias) { - newlen = strlen(alias); - newname = (char *) xrealloc(c->fontname, newlen); - if (!newname) { - err = AllocError; - break; - } - memmove(newname, alias, newlen); - c->fontname = newname; - c->fnamelen = newlen; - c->current_fpe = 0; - if (--aliascount <= 0) - break; - continue; - } - if (err == BadFontName) { - c->current_fpe++; - continue; - } - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (pointer) c); - } - return TRUE; - } - break; - } - - if (err != Successful) - goto bail; - if (!pfont) { - err = BadFontName; - goto bail; - } - /* check values for firstCol, lastCol, firstRow, and lastRow */ - if (pfont->info.firstCol > pfont->info.lastCol || - pfont->info.firstRow > pfont->info.lastRow || - pfont->info.lastCol - pfont->info.firstCol > 255) { - err = AllocError; - goto bail; - } - if (!pfont->fpe) - pfont->fpe = fpe; - pfont->refcnt++; - if (pfont->refcnt == 1) { - UseFPE(pfont->fpe); - for (i = 0; i < screenInfo.numScreens; i++) { - pScr = screenInfo.screens[i]; - if (pScr->RealizeFont) - { - if (!(*pScr->RealizeFont) (pScr, pfont)) - { - CloseFont (pfont, (Font) 0); - err = AllocError; - goto bail; - } - } - } - } - if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) { - err = AllocError; - goto bail; - } - if (patternCache && pfont != c->non_cachable_font) - CacheFontPattern(patternCache, c->origFontName, c->origFontNameLen, - pfont); -bail: - if (err != Successful && c->client != serverClient) { - SendErrorToClient(c->client, X_OpenFont, 0, - c->fontid, FontToXError(err)); - } - if (c->slept) - ClientWakeup(c->client); - for (i = 0; i < c->num_fpes; i++) { - FreeFPE(c->fpe_list[i]); - } - xfree(c->fpe_list); - xfree(c->fontname); - xfree(c); - return TRUE; -} - -int -OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontname) -{ - OFclosurePtr c; - int i; - FontPtr cached = (FontPtr)0; - -#ifdef FONTDEBUG - char *f; - f = (char *)xalloc(lenfname + 1); - memmove(f, pfontname, lenfname); - f[lenfname] = '\0'; - ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); -#endif - if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) - return BadName; - if (patternCache) - { - - /* - ** Check name cache. If we find a cached version of this font that - ** is cachable, immediately satisfy the request with it. If we find - ** a cached version of this font that is non-cachable, we do not - ** satisfy the request with it. Instead, we pass the FontPtr to the - ** FPE's open_font code (the fontfile FPE in turn passes the - ** information to the rasterizer; the fserve FPE ignores it). - ** - ** Presumably, the font is marked non-cachable because the FPE has - ** put some licensing restrictions on it. If the FPE, using - ** whatever logic it relies on, determines that it is willing to - ** share this existing font with the client, then it has the option - ** to return the FontPtr we passed it as the newly-opened font. - ** This allows the FPE to exercise its licensing logic without - ** having to create another instance of a font that already exists. - */ - - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); - if (cached && cached->info.cachable) - { - if (!AddResource(fid, RT_FONT, (pointer) cached)) - return BadAlloc; - cached->refcnt++; - return Success; - } - } - c = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); - if (!c) - return BadAlloc; - c->fontname = (char *) xalloc(lenfname); - c->origFontName = pfontname; - c->origFontNameLen = lenfname; - if (!c->fontname) { - xfree(c); - return BadAlloc; - } - /* - * copy the current FPE list, so that if it gets changed by another client - * while we're blocking, the request still appears atomic - */ - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c->fontname); - xfree(c); - return BadAlloc; - } - memmove(c->fontname, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->fontid = fid; - c->current_fpe = 0; - c->num_fpes = num_fpes; - c->fnamelen = lenfname; - c->slept = FALSE; - c->flags = flags; - c->non_cachable_font = cached; - - (void) doOpenFont(client, c); - return Success; -} - -/** - * Decrement font's ref count, and free storage if ref count equals zero - * - * \param value must conform to DeleteType - */ -int -CloseFont(pointer value, XID fid) -{ - int nscr; - ScreenPtr pscr; - FontPathElementPtr fpe; - FontPtr pfont = (FontPtr)value; - - if (pfont == NullFont) - return (Success); - if (--pfont->refcnt == 0) { - if (patternCache) - RemoveCachedFontPattern (patternCache, pfont); - /* - * since the last reference is gone, ask each screen to free any - * storage it may have allocated locally for it. - */ - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { - pscr = screenInfo.screens[nscr]; - if (pscr->UnrealizeFont) - (*pscr->UnrealizeFont) (pscr, pfont); - } - if (pfont == defaultFont) - defaultFont = NULL; -#ifdef LBX - LbxFreeFontTag(pfont); -#endif -#ifdef XF86BIGFONT - XF86BigfontFreeFontShm(pfont); -#endif - fpe = pfont->fpe; - (*fpe_functions[fpe->type].close_font) (fpe, pfont); - FreeFPE(fpe); - } - return (Success); -} - - -/***====================================================================***/ - -/** - * Sets up pReply as the correct QueryFontReply for pFont with the first - * nProtoCCIStructs char infos. - * - * \param pReply caller must allocate this storage - */ -void -QueryFont(FontPtr pFont, xQueryFontReply *pReply, int nProtoCCIStructs) -{ - FontPropPtr pFP; - int r, - c, - i; - xFontProp *prFP; - xCharInfo *prCI; - xCharInfo *charInfos[256]; - unsigned char chars[512]; - int ninfos; - unsigned long ncols; - unsigned long count; - - /* pr->length set in dispatch */ - pReply->minCharOrByte2 = pFont->info.firstCol; - pReply->defaultChar = pFont->info.defaultCh; - pReply->maxCharOrByte2 = pFont->info.lastCol; - pReply->drawDirection = pFont->info.drawDirection; - pReply->allCharsExist = pFont->info.allExist; - pReply->minByte1 = pFont->info.firstRow; - pReply->maxByte1 = pFont->info.lastRow; - pReply->fontAscent = pFont->info.fontAscent; - pReply->fontDescent = pFont->info.fontDescent; - - pReply->minBounds = pFont->info.ink_minbounds; - pReply->maxBounds = pFont->info.ink_maxbounds; - - pReply->nFontProps = pFont->info.nprops; - pReply->nCharInfos = nProtoCCIStructs; - - for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) (&pReply[1]); - i < pFont->info.nprops; - i++, pFP++, prFP++) { - prFP->name = pFP->name; - prFP->value = pFP->value; - } - - ninfos = 0; - ncols = (unsigned long) (pFont->info.lastCol - pFont->info.firstCol + 1); - prCI = (xCharInfo *) (prFP); - for (r = pFont->info.firstRow; - ninfos < nProtoCCIStructs && r <= (int)pFont->info.lastRow; - r++) { - i = 0; - for (c = pFont->info.firstCol; c <= (int)pFont->info.lastCol; c++) { - chars[i++] = r; - chars[i++] = c; - } - (*pFont->get_metrics) (pFont, ncols, chars, - TwoD16Bit, &count, charInfos); - i = 0; - for (i = 0; i < (int) count && ninfos < nProtoCCIStructs; i++) { - *prCI = *charInfos[i]; - prCI++; - ninfos++; - } - } - return; -} - -static Bool -doListFontsAndAliases(ClientPtr client, LFclosurePtr c) -{ - FontPathElementPtr fpe; - int err = Successful; - FontNamesPtr names = NULL; - char *name, *resolved=NULL; - int namelen, resolvedlen; - int nnames; - int stringLens; - int i; - xListFontsReply reply; - char *bufptr; - char *bufferStart; - int aliascount = 0; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - - if (!c->current.patlen) - goto finish; - - while (c->current.current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) - { - /* This FPE doesn't support/require list_fonts_and_aliases */ - - err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - c->names); - - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - } - return TRUE; - } - - err = BadFontName; - } - else - { - /* Start of list_fonts_and_aliases functionality. Modeled - after list_fonts_with_info in that it resolves aliases, - except that the information collected from FPEs is just - names, not font info. Each list_next_font_or_alias() - returns either a name into name/namelen or an alias into - name/namelen and its target name into resolved/resolvedlen. - The code at this level then resolves the alias by polling - the FPEs. */ - - if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - &c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) { - char *tmpname; - name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, - &resolvedlen, c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; - } - return TRUE; - } - if (err == FontNameAlias) { - if (resolved) xfree(resolved); - resolved = (char *) xalloc(resolvedlen + 1); - if (resolved) - memmove(resolved, tmpname, resolvedlen + 1); - } - } - - if (err == Successful) - { - if (c->haveSaved) - { - if (c->savedName) - (void)AddFontNamesName(c->names, c->savedName, - c->savedNameLen); - } - else - (void)AddFontNamesName(c->names, name, namelen); - } - - /* - * When we get an alias back, save our state and reset back to - * the start of the FPE looking for the specified name. As - * soon as a real font is found for the alias, pop back to the - * old state - */ - else if (err == FontNameAlias) { - char tmp_pattern[XLFDMAXFONTNAMELEN]; - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - memmove(tmp_pattern, resolved, resolvedlen); - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - - tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, - &tmpname, &tmpnamelen, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - c->savedNameLen = namelen; - aliascount = 20; - } - memmove(c->current.pattern, tmp_pattern, resolvedlen); - c->current.patlen = resolvedlen; - c->current.max_names = c->names->nnames + 1; - c->current.current_fpe = -1; - c->current.private = 0; - err = BadFontName; - } - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've collected enough - * font names, quit. - */ - if (err == BadFontName) { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->names->nnames == c->current.max_names || - c->current.current_fpe == c->num_fpes) { - c->haveSaved = FALSE; - c->current = c->saved; - /* Give the saved namelist a chance to clean itself up */ - continue; - } - } - if (c->names->nnames == c->current.max_names) - break; - } - } - - /* - * send the reply - */ - if (err != Successful) { - SendErrorToClient(client, X_ListFonts, 0, 0, FontToXError(err)); - goto bail; - } - -finish: - - names = c->names; - nnames = names->nnames; - client = c->client; - stringLens = 0; - for (i = 0; i < nnames; i++) - stringLens += (names->length[i] <= 255) ? names->length[i] : 0; - - reply.type = X_Reply; - reply.length = (stringLens + nnames + 3) >> 2; - reply.nFonts = nnames; - reply.sequenceNumber = client->sequence; - - bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2); - - if (!bufptr && reply.length) { - SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); - goto bail; - } - /* - * since WriteToClient long word aligns things, copy to temp buffer and - * write all at once - */ - for (i = 0; i < nnames; i++) { - if (names->length[i] > 255) - reply.nFonts--; - else - { - *bufptr++ = names->length[i]; - memmove( bufptr, names->names[i], names->length[i]); - bufptr += names->length[i]; - } - } - nnames = reply.nFonts; - reply.length = (stringLens + nnames + 3) >> 2; - client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; - WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); - (void) WriteToClient(client, stringLens + nnames, bufferStart); - DEALLOCATE_LOCAL(bufferStart); - -bail: - if (c->slept) - ClientWakeup(client); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - FreeFontNames(names); - xfree(c); - if (resolved) xfree(resolved); - return TRUE; -} - -int -ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, - unsigned max_names) -{ - int i; - LFclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) - return BadAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c); - return BadAlloc; - } - c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100); - if (!c->names) - { - xfree(c->fpe_list); - xfree(c); - return BadAlloc; - } - memmove( c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsAndAliases(client, c); - return Success; -} - -int -doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) -{ - FontPathElementPtr fpe; - int err = Successful; - char *name; - int namelen; - int numFonts; - FontInfoRec fontInfo, - *pFontInfo; - xListFontsWithInfoReply *reply; - int length; - xFontProp *pFP; - int i; - int aliascount = 0; - xListFontsWithInfoReply finalReply; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo]; - if (!c->current.patlen) - goto finish; - while (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - if (!c->current.list_started) - { - err = (*fpe_functions[fpe->type].start_list_fonts_with_info) - (client, fpe, c->current.pattern, c->current.patlen, - c->current.max_names, &c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, (ClientSleepProcPtr)doListFontsWithInfo, c); - c->slept = TRUE; - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) - { - name = 0; - pFontInfo = &fontInfo; - err = (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &name, &namelen, &pFontInfo, - &numFonts, c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsWithInfo, - c); - c->slept = TRUE; - } - return TRUE; - } - } - /* - * When we get an alias back, save our state and reset back to the - * start of the FPE looking for the specified name. As soon as a real - * font is found for the alias, pop back to the old state - */ - if (err == FontNameAlias) - { - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - FontInfoPtr tmpFontInfo; - - tmpname = 0; - tmpFontInfo = &fontInfo; - (void) (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, - &numFonts, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - c->savedNumFonts = numFonts; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - aliascount = 20; - } - memmove(c->current.pattern, name, namelen); - c->current.patlen = namelen; - c->current.max_names = 1; - c->current.current_fpe = 0; - c->current.private = 0; - c->current.list_started = FALSE; - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've sent enough font - * names, quit. Always wait for BadFontName to let the FPE - * have a chance to clean up. - */ - else if (err == BadFontName) - { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->current.max_names == 0 || - c->current.current_fpe == c->num_fpes) - { - c->haveSaved = FALSE; - c->saved.max_names -= (1 - c->current.max_names); - c->current = c->saved; - } - } - else if (c->current.max_names == 0) - break; - } - else if (err == Successful) - { - length = sizeof(*reply) + pFontInfo->nprops * sizeof(xFontProp); - reply = c->reply; - if (c->length < length) - { - reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length); - if (!reply) - { - err = AllocError; - break; - } - c->reply = reply; - c->length = length; - } - if (c->haveSaved) - { - numFonts = c->savedNumFonts; - name = c->savedName; - namelen = strlen(name); - } - reply->type = X_Reply; - reply->length = (sizeof *reply - sizeof(xGenericReply) + - pFontInfo->nprops * sizeof(xFontProp) + - namelen + 3) >> 2; - reply->sequenceNumber = client->sequence; - reply->nameLength = namelen; - reply->minBounds = pFontInfo->ink_minbounds; - reply->maxBounds = pFontInfo->ink_maxbounds; - reply->minCharOrByte2 = pFontInfo->firstCol; - reply->maxCharOrByte2 = pFontInfo->lastCol; - reply->defaultChar = pFontInfo->defaultCh; - reply->nFontProps = pFontInfo->nprops; - reply->drawDirection = pFontInfo->drawDirection; - reply->minByte1 = pFontInfo->firstRow; - reply->maxByte1 = pFontInfo->lastRow; - reply->allCharsExist = pFontInfo->allExist; - reply->fontAscent = pFontInfo->fontAscent; - reply->fontDescent = pFontInfo->fontDescent; - reply->nReplies = numFonts; - pFP = (xFontProp *) (reply + 1); - for (i = 0; i < pFontInfo->nprops; i++) - { - pFP->name = pFontInfo->props[i].name; - pFP->value = pFontInfo->props[i].value; - pFP++; - } - WriteSwappedDataToClient(client, length, reply); - (void) WriteToClient(client, namelen, name); - if (pFontInfo == &fontInfo) - { - xfree(fontInfo.props); - xfree(fontInfo.isStringProp); - } - --c->current.max_names; - } - } -finish: - length = sizeof(xListFontsWithInfoReply); - bzero((char *) &finalReply, sizeof(xListFontsWithInfoReply)); - finalReply.type = X_Reply; - finalReply.sequenceNumber = client->sequence; - finalReply.length = (sizeof(xListFontsWithInfoReply) - - sizeof(xGenericReply)) >> 2; - WriteSwappedDataToClient(client, length, &finalReply); -bail: - if (c->slept) - ClientWakeup(client); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->reply); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - xfree(c); - return TRUE; -} - -int -StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, - int max_names) -{ - int i; - LFWIclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFWIclosurePtr) xalloc(sizeof *c))) - goto badAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) - { - xfree(c); - goto badAlloc; - } - memmove(c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) - { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->reply = 0; - c->length = 0; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->savedNumFonts = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsWithInfo(client, c); - return Success; -badAlloc: - return BadAlloc; -} - -#define TextEltHeader 2 -#define FontShiftSize 5 -static XID clearGC[] = { CT_NONE }; -#define clearGCmask (GCClipMask) - -int -doPolyText(ClientPtr client, register PTclosurePtr c) -{ - register FontPtr pFont = c->pGC->font, oldpFont; - Font fid, oldfid; - int err = Success, lgerr; /* err is in X error, not font error, space */ - enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; - FontPathElementPtr fpe; - GC *origGC = NULL; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - - if (c->slept) - { - /* Client has died, but we cannot bail out right now. We - need to clean up after the work we did when going to - sleep. Setting the drawable pointer to 0 makes this - happen without any attempts to render or perform other - unnecessary activities. */ - c->pDraw = (DrawablePtr)0; - } - else - { - err = Success; - goto bail; - } - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client and avoid further - rendering while we clean up after ourself. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - c->pDraw = (DrawablePtr)0; - } - - client_state = c->slept ? SLEEPING : NEVER_SLEPT; - - while (c->endReq - c->pElt > TextEltHeader) - { - if (*c->pElt == FontChange) - { - if (c->endReq - c->pElt < FontShiftSize) - { - err = BadLength; - goto bail; - } - - oldpFont = pFont; - oldfid = fid; - - fid = ((Font)*(c->pElt+4)) /* big-endian */ - | ((Font)*(c->pElt+3)) << 8 - | ((Font)*(c->pElt+2)) << 16 - | ((Font)*(c->pElt+1)) << 24; - pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - client->errorValue = fid; - err = BadFont; - /* restore pFont and fid for step 4 (described below) */ - pFont = oldpFont; - fid = oldfid; - - /* If we're in START_SLEEP mode, the following step - shortens the request... in the unlikely event that - the fid somehow becomes valid before we come through - again to actually execute the polytext, which would - then mess up our refcounting scheme badly. */ - c->err = err; - c->endReq = c->pElt; - - goto bail; - } - - /* Step 3 (described below) on our new font */ - if (client_state == START_SLEEP) - pFont->refcnt++; - else - { - if (pFont != c->pGC->font && c->pDraw) - { - ChangeGC( c->pGC, GCFont, &fid); - ValidateGC(c->pDraw, c->pGC); - if (c->reqType == X_PolyText8) - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8; - else - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText16; - } - - /* Undo the refcnt++ we performed when going to sleep */ - if (client_state == SLEEPING) - (void)CloseFont(c->pGC->font, (Font)0); - } - c->pElt += FontShiftSize; - } - else /* print a string */ - { - unsigned char *pNextElt; - pNextElt = c->pElt + TextEltHeader + (*c->pElt)*c->itemSize; - if ( pNextElt > c->endReq) - { - err = BadLength; - goto bail; - } - if (client_state == START_SLEEP) - { - c->pElt = pNextElt; - continue; - } - if (c->pDraw) - { - lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, c->itemSize, - c->pElt + TextEltHeader); - } - else lgerr = Successful; - - if (lgerr == Suspended) - { - if (!c->slept) { - int len; - GC *pGC; - PTclosurePtr new_closure; - - /* We're putting the client to sleep. We need to do a few things - to ensure successful and atomic-appearing execution of the - remainder of the request. First, copy the remainder of the - request into a safe malloc'd area. Second, create a scratch GC - to use for the remainder of the request. Third, mark all fonts - referenced in the remainder of the request to prevent their - deallocation. Fourth, make the original GC look like the - request has completed... set its font to the final font value - from this request. These GC manipulations are for the unlikely - (but possible) event that some other client is using the GC. - Steps 3 and 4 are performed by running this procedure through - the remainder of the request in a special no-render mode - indicated by client_state = START_SLEEP. */ - - /* Step 1 */ - /* Allocate a malloc'd closure structure to replace - the local one we were passed */ - new_closure = (PTclosurePtr) xalloc(sizeof(PTclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - len = c->endReq - c->pElt; - c->data = (unsigned char *)xalloc(len); - if (!c->data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(c->data, c->pElt, len); - c->pElt = c->data; - c->endReq = c->pElt + len; - - /* Step 2 */ - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - if ((err = CopyGC(c->pGC, pGC, GCFunction | - GCPlaneMask | GCForeground | - GCBackground | GCFillStyle | - GCTile | GCStipple | - GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != - Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - origGC = c->pGC; - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doPolyText, - (pointer) c); - - /* Set up to perform steps 3 and 4 */ - client_state = START_SLEEP; - continue; /* on to steps 3 and 4 */ - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */ - c->xorg = (* c->polyText)(c->pDraw, c->pGC, c->xorg, c->yorg, - *c->pElt, c->pElt + TextEltHeader); - } - c->pElt = pNextElt; - } - } - -bail: - - if (client_state == START_SLEEP) - { - /* Step 4 */ - if (pFont != origGC->font) - { - ChangeGC(origGC, GCFont, &fid); - ValidateGC(c->pDraw, origGC); - } - - /* restore pElt pointer for execution of remainder of the request */ - c->pElt = c->data; - return TRUE; - } - - if (c->err != Success) err = c->err; - if (err != Success && c->client != serverClient) { -#ifdef PANORAMIX - if (noPanoramiXExtension || !c->pGC->pScreen->myNum) -#endif - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -PolyText(ClientPtr client, DrawablePtr pDraw, GC *pGC, unsigned char *pElt, - unsigned char *endReq, int xorg, int yorg, int reqType, XID did) -{ - PTclosureRec local_closure; - - local_closure.pElt = pElt; - local_closure.endReq = endReq; - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_PolyText8) - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText8; - local_closure.itemSize = 1; - } - else - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText16; - local_closure.itemSize = 2; - } - local_closure.pGC = pGC; - local_closure.did = did; - local_closure.err = Success; - local_closure.slept = FALSE; - - (void) doPolyText(client, &local_closure); - return Success; -} - - -#undef TextEltHeader -#undef FontShiftSize - -int -doImageText(ClientPtr client, register ITclosurePtr c) -{ - int err = Success, lgerr; /* err is in X error, not font error, space */ - FontPathElementPtr fpe; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, c->itemSize, c->data); - if (lgerr == Suspended) - { - if (!c->slept) { - GC *pGC; - unsigned char *data; - ITclosurePtr new_closure; - - /* We're putting the client to sleep. We need to - save some state. Similar problem to that handled - in doPolyText, but much simpler because the - request structure is much simpler. */ - - new_closure = (ITclosurePtr) xalloc(sizeof(ITclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - data = (unsigned char *)xalloc(c->nChars * c->itemSize); - if (!data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(data, c->data, c->nChars * c->itemSize); - c->data = data; - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - if ((err = CopyGC(c->pGC, pGC, GCFunction | GCPlaneMask | - GCForeground | GCBackground | GCFillStyle | - GCTile | GCStipple | GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doImageText, (pointer) c); - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - (* c->imageText)(c->pDraw, c->pGC, c->xorg, c->yorg, - c->nChars, c->data); - } - -bail: - - if (err != Success && c->client != serverClient) { - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -ImageText(ClientPtr client, DrawablePtr pDraw, GC *pGC, int nChars, - unsigned char *data, int xorg, int yorg, int reqType, XID did) -{ - ITclosureRec local_closure; - - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.pGC = pGC; - local_closure.nChars = nChars; - local_closure.data = data; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_ImageText8) - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText8; - local_closure.itemSize = 1; - } - else - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText16; - local_closure.itemSize = 2; - } - local_closure.did = did; - local_closure.slept = FALSE; - - (void) doImageText(client, &local_closure); - return Success; -} - - -/* does the necessary magic to figure out the fpe type */ -static int -DetermineFPEType(char *pathname) -{ - int i; - - for (i = 0; i < num_fpe_types; i++) { - if ((*fpe_functions[i].name_check) (pathname)) - return i; - } - return -1; -} - - -static void -FreeFontPath(FontPathElementPtr *list, int n, Bool force) -{ - int i; - - for (i = 0; i < n; i++) { - if (force) { - /* Sanity check that all refcounts will be 0 by the time - we get to the end of the list. */ - int found = 1; /* the first reference is us */ - int j; - for (j = i+1; j < n; j++) { - if (list[j] == list[i]) - found++; - } - if (list[i]->refcount != found) { - ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n", - list[i]->name_length, list[i]->name, - list[i]->refcount, found); - list[i]->refcount = found; /* ensure it will get freed */ - } - } - FreeFPE(list[i]); - } - xfree((char *) list); -} - -static FontPathElementPtr -find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len) -{ - FontPathElementPtr fpe; - int i; - - for (i = 0; i < num; i++) { - fpe = list[i]; - if (fpe->name_length == len && memcmp(name, fpe->name, len) == 0) - return fpe; - } - return (FontPathElementPtr) 0; -} - - -static int -SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) -{ - int i, err = 0; - int valid_paths = 0; - unsigned int len; - unsigned char *cp = paths; - FontPathElementPtr fpe = NULL, *fplist; - - fplist = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * npaths); - if (!fplist) { - *bad = 0; - return BadAlloc; - } - for (i = 0; i < num_fpe_types; i++) { - if (fpe_functions[i].set_path_hook) - (*fpe_functions[i].set_path_hook) (); - } - for (i = 0; i < npaths; i++) - { - len = (unsigned int) (*cp++); - - if (len == 0) - { - if (persist) - ErrorF ("Removing empty element from the valid list of fontpaths\n"); - err = BadValue; - } - else - { - /* if it's already in our active list, just reset it */ - /* - * note that this can miss FPE's in limbo -- may be worth catching - * them, though it'd muck up refcounting - */ - fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); - if (fpe) - { - err = (*fpe_functions[fpe->type].reset_fpe) (fpe); - if (err == Successful) - { - UseFPE(fpe);/* since it'll be decref'd later when freed - * from the old list */ - } - else - fpe = 0; - } - /* if error or can't do it, act like it's a new one */ - if (!fpe) - { - fpe = (FontPathElementPtr) xalloc(sizeof(FontPathElementRec)); - if (!fpe) - { - err = BadAlloc; - goto bail; - } - fpe->name = (char *) xalloc(len + 1); - if (!fpe->name) - { - xfree(fpe); - err = BadAlloc; - goto bail; - } - fpe->refcount = 1; - - strncpy(fpe->name, (char *) cp, (int) len); - fpe->name[len] = '\0'; - fpe->name_length = len; - fpe->type = DetermineFPEType(fpe->name); - if (fpe->type == -1) - err = BadValue; - else - err = (*fpe_functions[fpe->type].init_fpe) (fpe); - if (err != Successful) - { - if (persist) - { - ErrorF("Could not init font path element %s, removing from list!\n", - fpe->name); - } - xfree (fpe->name); - xfree (fpe); - } - } - } - if (err != Successful) - { - if (!persist) - goto bail; - } - else - { - fplist[valid_paths++] = fpe; - } - cp += len; - } - - FreeFontPath(font_path_elements, num_fpes, FALSE); - font_path_elements = fplist; - if (patternCache) - EmptyFontPatternCache(patternCache); - num_fpes = valid_paths; - - return Success; -bail: - *bad = i; - while (--valid_paths >= 0) - FreeFPE(fplist[valid_paths]); - xfree(fplist); - return FontToXError(err); -} - -/* XXX -- do we need to pass error down to each renderer? */ -int -SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) -{ - int err = Success; - - if (npaths == 0) { - if (SetDefaultFontPath(defaultFontPath) != Success) - return BadValue; - } else { - err = SetFontPathElements(npaths, paths, error, FALSE); - } - return err; -} - -int -SetDefaultFontPath(char *path) -{ - unsigned char *cp, - *pp, - *nump, - *newpath; - int num = 1, - len, - err, - size = 0, - bad; - - /* get enough for string, plus values -- use up commas */ -#ifdef NX_TRANS_SOCKET - len = strlen(_NXGetFontPath(path)) + 1; -#else - len = strlen(path) + 1; -#endif - nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); - if (!newpath) - return BadAlloc; -#ifdef NX_TRANS_SOCKET - pp = (unsigned char *) _NXGetFontPath(path); -#else - pp = (unsigned char *) path; -#endif - cp++; - while (*pp) { - if (*pp == ',') { - *nump = (unsigned char) size; - nump = cp++; - pp++; - num++; - size = 0; - } else { - *cp++ = *pp++; - size++; - } - } - *nump = (unsigned char) size; - - err = SetFontPathElements(num, newpath, &bad, TRUE); - - DEALLOCATE_LOCAL(newpath); - - return err; -} - -unsigned char * -GetFontPath(int *count, int *length) -{ - int i; - unsigned char *c; - int len; - FontPathElementPtr fpe; - - len = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - len += fpe->name_length + 1; - } - font_path_string = (unsigned char *) xrealloc(font_path_string, len); - if (!font_path_string) - return NULL; - - c = font_path_string; - *length = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - *c = fpe->name_length; - *length += *c++; - memmove(c, fpe->name, fpe->name_length); - c += fpe->name_length; - } - *count = num_fpes; - return font_path_string; -} - -int -LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, unsigned char *data) -{ - if (fpe_functions[pfont->fpe->type].load_glyphs) - return (*fpe_functions[pfont->fpe->type].load_glyphs) - (client, pfont, 0, nchars, item_size, data); - else - return Successful; -} - -void -DeleteClientFontStuff(ClientPtr client) -{ - int i; - FontPathElementPtr fpe; - - for (i = 0; i < num_fpes; i++) - { - fpe = font_path_elements[i]; - if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } -} - -void -InitFonts () -{ - patternCache = MakeFontPatternCache(); - -#ifndef KDRIVESERVER - if (screenInfo.numScreens > screenInfo.numVideoScreens) { - PrinterFontRegisterFpeFunctions(); - FontFileCheckRegisterFpeFunctions(); - check_fs_register_fpe_functions(); - } else -#endif - { -#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); -#endif - FontFileRegisterFpeFunctions(); -#ifndef NOFONTSERVERACCESS - fs_register_fpe_functions(); -#endif - } -} - -int -GetDefaultPointSize () -{ - return 120; -} - - -FontResolutionPtr -GetClientResolutions (int *num) -{ - if (requestingClient && requestingClient->fontResFunc != NULL && - !requestingClient->clientGone) - { - return (*requestingClient->fontResFunc)(requestingClient, num); - } - else { - static struct _FontResolution res; - ScreenPtr pScreen; - - pScreen = screenInfo.screens[0]; - res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; - /* - * XXX - we'll want this as long as bitmap instances are prevalent - so that we can match them from scalable fonts - */ - if (res.x_resolution < 88) - res.x_resolution = 75; - else - res.x_resolution = 100; - res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight; - if (res.y_resolution < 88) - res.y_resolution = 75; - else - res.y_resolution = 100; - res.point_size = 120; - *num = 1; - return &res; - } -} - -/* - * returns the type index of the new fpe - * - * should be called (only once!) by each type of fpe when initialized - */ - -int -RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func) -{ - FPEFunctions *new; - - /* grow the list */ - new = (FPEFunctions *) xrealloc(fpe_functions, - (num_fpe_types + 1) * sizeof(FPEFunctions)); - if (!new) - return -1; - fpe_functions = new; - - fpe_functions[num_fpe_types].name_check = name_func; - fpe_functions[num_fpe_types].open_font = open_func; - fpe_functions[num_fpe_types].close_font = close_func; - fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func; - fpe_functions[num_fpe_types].list_fonts = list_func; - fpe_functions[num_fpe_types].start_list_fonts_with_info = - start_lfwi_func; - fpe_functions[num_fpe_types].list_next_font_with_info = - next_lfwi_func; - fpe_functions[num_fpe_types].init_fpe = init_func; - fpe_functions[num_fpe_types].free_fpe = free_func; - fpe_functions[num_fpe_types].reset_fpe = reset_func; - fpe_functions[num_fpe_types].client_died = client_died; - fpe_functions[num_fpe_types].load_glyphs = load_glyphs; - fpe_functions[num_fpe_types].start_list_fonts_and_aliases = - start_list_alias_func; - fpe_functions[num_fpe_types].list_next_font_or_alias = - next_list_alias_func; - fpe_functions[num_fpe_types].set_path_hook = set_path_func; - - return num_fpe_types++; -} - -void -FreeFonts() -{ - if (patternCache) { - FreeFontPatternCache(patternCache); - patternCache = 0; - } - FreeFontPath(font_path_elements, num_fpes, TRUE); - font_path_elements = 0; - num_fpes = 0; - xfree(fpe_functions); - num_fpe_types = 0; - fpe_functions = (FPEFunctions *) 0; -} - -/* convenience functions for FS interface */ - -FontPtr -find_old_font(XID id) -{ - return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, - SecurityUnknownAccess); -} - -Font -GetNewFontClientID() -{ - return FakeClientID(0); -} - -int -StoreFontClientFont(FontPtr pfont, Font id) -{ - return AddResource(id, RT_NONE, (pointer) pfont); -} - -void -DeleteFontClientID(Font id) -{ - FreeResource(id, RT_NONE); -} - -int -client_auth_generation(ClientPtr client) -{ - return 0; -} - -static int fs_handlers_installed = 0; -static unsigned int last_server_gen; - -int -init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) -{ - /* if server has reset, make sure the b&w handlers are reinstalled */ - if (last_server_gen < serverGeneration) { - last_server_gen = serverGeneration; - fs_handlers_installed = 0; - } - if (fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "adding FS b & w handlers\n"); -#endif - - if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (pointer) 0)) - return AllocError; - fs_handlers_installed++; - } - QueueFontWakeup(fpe); - return Successful; -} - -void -remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, Bool all) -{ - if (all) { - /* remove the handlers if no one else is using them */ - if (--fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "removing FS b & w handlers\n"); -#endif - - RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (pointer) 0); - } - } - RemoveFontWakeup(fpe); -} - -#ifdef DEBUG -#define GLWIDTHBYTESPADDED(bits,nbytes) \ - ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \ - :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \ - :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \ - :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \ - : 0) - -#define GLYPH_SIZE(ch, nbytes) \ - GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \ - (ch)->metrics.leftSideBearing, (nbytes)) -void -dump_char_ascii(CharInfoPtr cip) -{ - int r, - l; - int bpr; - int byte; - static unsigned maskTab[] = { - (1 << 7), (1 << 6), (1 << 5), (1 << 4), - (1 << 3), (1 << 2), (1 << 1), (1 << 0), - }; - - bpr = GLYPH_SIZE(cip, 4); - for (r = 0; r < (cip->metrics.ascent + cip->metrics.descent); r++) { - pointer row = (pointer) cip->bits + r * bpr; - - byte = 0; - for (l = 0; l <= (cip->metrics.rightSideBearing - - cip->metrics.leftSideBearing); l++) { - if (maskTab[l & 7] & row[l >> 3]) - putchar('X'); - else - putchar('.'); - } - putchar('\n'); - } -} - -#endif diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c.X.original b/nx-X11/programs/Xserver/dix/dixfonts.c.X.original deleted file mode 100644 index 2c5874e8d..000000000 --- a/nx-X11/programs/Xserver/dix/dixfonts.c.X.original +++ /dev/null @@ -1,2150 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/dix/dixfonts.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.28 2003/11/08 02:02:03 dawes 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. - -************************************************************************/ -/* The panoramix components contained the following notice */ -/* -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ -/* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ - -#define NEED_REPLIES -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "scrnintstr.h" -#include "resource.h" -#include "dixstruct.h" -#include "cursorstr.h" -#include "misc.h" -#include "opaque.h" -#include "dixfontstr.h" -#include "closestr.h" - -#ifdef DEBUG -#include -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#endif - -#ifdef LBX -#include "lbxserve.h" -#endif - -#ifdef XF86BIGFONT -#define _XF86BIGFONT_SERVER_ -#include -#endif - -#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics - -extern pointer fosNaturalParams; -extern FontPtr defaultFont; - -static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; -static int num_fpes = 0; -FPEFunctions *fpe_functions = (FPEFunctions *) 0; -static int num_fpe_types = 0; - -static unsigned char *font_path_string; - -static int num_slept_fpes = 0; -static int size_slept_fpes = 0; -static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; -static FontPatternCachePtr patternCache; - -int -FontToXError(err) - int err; -{ - switch (err) { - case Successful: - return Success; - case AllocError: - return BadAlloc; - case BadFontName: - return BadName; - case BadFontPath: - case BadFontFormat: /* is there something better? */ - case BadCharRange: - return BadValue; - default: - return err; - } -} - - -/* - * adding RT_FONT prevents conflict with default cursor font - */ -Bool -SetDefaultFont(char *defaultfontname) -{ - int err; - FontPtr pf; - XID fid; - - fid = FakeClientID(0); - err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync, - (unsigned) strlen(defaultfontname), defaultfontname); - if (err != Success) - return FALSE; - pf = (FontPtr) LookupIDByType(fid, RT_FONT); - if (pf == (FontPtr) NULL) - return FALSE; - defaultFont = pf; - return TRUE; -} - -/* - * note that the font wakeup queue is not refcounted. this is because - * an fpe needs to be added when it's inited, and removed when it's finally - * freed, in order to handle any data that isn't requested, like FS events. - * - * since the only thing that should call these routines is the renderer's - * init_fpe() and free_fpe(), there shouldn't be any problem in using - * freed data. - */ -void -QueueFontWakeup(FontPathElementPtr fpe) -{ - int i; - FontPathElementPtr *new; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - -#ifdef DEBUG - fprintf(stderr, "re-queueing fpe wakeup\n"); -#endif - - return; - } - } - if (num_slept_fpes == size_slept_fpes) { - new = (FontPathElementPtr *) - xrealloc(slept_fpes, - sizeof(FontPathElementPtr) * (size_slept_fpes + 4)); - if (!new) - return; - slept_fpes = new; - size_slept_fpes += 4; - } - slept_fpes[num_slept_fpes] = fpe; - num_slept_fpes++; -} - -void -RemoveFontWakeup(FontPathElementPtr fpe) -{ - int i, - j; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - for (j = i; j < num_slept_fpes; j++) { - slept_fpes[j] = slept_fpes[j + 1]; - } - num_slept_fpes--; - return; - } - } -} - -void -FontWakeup(pointer data, int count, pointer LastSelectMask) -{ - int i; - FontPathElementPtr fpe; - - if (count < 0) - return; - /* wake up any fpe's that may be waiting for information */ - for (i = 0; i < num_slept_fpes; i++) { - fpe = slept_fpes[i]; - (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); - } -} - -/* XXX -- these two funcs may want to be broken into macros */ -static void -UseFPE(FontPathElementPtr fpe) -{ - fpe->refcount++; -} - -static void -FreeFPE (FontPathElementPtr fpe) -{ - fpe->refcount--; - if (fpe->refcount == 0) { - (*fpe_functions[fpe->type].free_fpe) (fpe); - xfree(fpe->name); - xfree(fpe); - } -} - -static Bool -doOpenFont(ClientPtr client, OFclosurePtr c) -{ - FontPtr pfont = NullFont; - FontPathElementPtr fpe = NULL; - ScreenPtr pScr; - int err = Successful; - int i; - char *alias, - *newname; - int newlen; - int aliascount = 20; - /* - * Decide at runtime what FontFormat to use. - */ - Mask FontFormat = - - ((screenInfo.imageByteOrder == LSBFirst) ? - BitmapFormatByteOrderLSB : BitmapFormatByteOrderMSB) | - - ((screenInfo.bitmapBitOrder == LSBFirst) ? - BitmapFormatBitOrderLSB : BitmapFormatBitOrderMSB) | - - BitmapFormatImageRectMin | - -#if GLYPHPADBYTES == 1 - BitmapFormatScanlinePad8 | -#endif - -#if GLYPHPADBYTES == 2 - BitmapFormatScanlinePad16 | -#endif - -#if GLYPHPADBYTES == 4 - BitmapFormatScanlinePad32 | -#endif - -#if GLYPHPADBYTES == 8 - BitmapFormatScanlinePad64 | -#endif - - BitmapFormatScanlineUnit8; - - if (client->clientGone) - { - if (c->current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - while (c->current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current_fpe]; - err = (*fpe_functions[fpe->type].open_font) - ((pointer) client, fpe, c->flags, - c->fontname, c->fnamelen, FontFormat, - BitmapFormatMaskByte | - BitmapFormatMaskBit | - BitmapFormatMaskImageRectangle | - BitmapFormatMaskScanLinePad | - BitmapFormatMaskScanLineUnit, - c->fontid, &pfont, &alias, - c->non_cachable_font && c->non_cachable_font->fpe == fpe ? - c->non_cachable_font : - (FontPtr)0); - - if (err == FontNameAlias && alias) { - newlen = strlen(alias); - newname = (char *) xrealloc(c->fontname, newlen); - if (!newname) { - err = AllocError; - break; - } - memmove(newname, alias, newlen); - c->fontname = newname; - c->fnamelen = newlen; - c->current_fpe = 0; - if (--aliascount <= 0) - break; - continue; - } - if (err == BadFontName) { - c->current_fpe++; - continue; - } - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (pointer) c); - } - return TRUE; - } - break; - } - - if (err != Successful) - goto bail; - if (!pfont) { - err = BadFontName; - goto bail; - } - /* check values for firstCol, lastCol, firstRow, and lastRow */ - if (pfont->info.firstCol > pfont->info.lastCol || - pfont->info.firstRow > pfont->info.lastRow || - pfont->info.lastCol - pfont->info.firstCol > 255) { - err = AllocError; - goto bail; - } - if (!pfont->fpe) - pfont->fpe = fpe; - pfont->refcnt++; - if (pfont->refcnt == 1) { - UseFPE(pfont->fpe); - for (i = 0; i < screenInfo.numScreens; i++) { - pScr = screenInfo.screens[i]; - if (pScr->RealizeFont) - { - if (!(*pScr->RealizeFont) (pScr, pfont)) - { - CloseFont (pfont, (Font) 0); - err = AllocError; - goto bail; - } - } - } - } - if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) { - err = AllocError; - goto bail; - } - if (patternCache && pfont != c->non_cachable_font) - CacheFontPattern(patternCache, c->origFontName, c->origFontNameLen, - pfont); -bail: - if (err != Successful && c->client != serverClient) { - SendErrorToClient(c->client, X_OpenFont, 0, - c->fontid, FontToXError(err)); - } - if (c->slept) - ClientWakeup(c->client); - for (i = 0; i < c->num_fpes; i++) { - FreeFPE(c->fpe_list[i]); - } - xfree(c->fpe_list); - xfree(c->fontname); - xfree(c); - return TRUE; -} - -int -OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontname) -{ - OFclosurePtr c; - int i; - FontPtr cached = (FontPtr)0; - -#ifdef FONTDEBUG - char *f; - f = (char *)xalloc(lenfname + 1); - memmove(f, pfontname, lenfname); - f[lenfname] = '\0'; - ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); -#endif - if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) - return BadName; - if (patternCache) - { - - /* - ** Check name cache. If we find a cached version of this font that - ** is cachable, immediately satisfy the request with it. If we find - ** a cached version of this font that is non-cachable, we do not - ** satisfy the request with it. Instead, we pass the FontPtr to the - ** FPE's open_font code (the fontfile FPE in turn passes the - ** information to the rasterizer; the fserve FPE ignores it). - ** - ** Presumably, the font is marked non-cachable because the FPE has - ** put some licensing restrictions on it. If the FPE, using - ** whatever logic it relies on, determines that it is willing to - ** share this existing font with the client, then it has the option - ** to return the FontPtr we passed it as the newly-opened font. - ** This allows the FPE to exercise its licensing logic without - ** having to create another instance of a font that already exists. - */ - - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); - if (cached && cached->info.cachable) - { - if (!AddResource(fid, RT_FONT, (pointer) cached)) - return BadAlloc; - cached->refcnt++; - return Success; - } - } - c = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); - if (!c) - return BadAlloc; - c->fontname = (char *) xalloc(lenfname); - c->origFontName = pfontname; - c->origFontNameLen = lenfname; - if (!c->fontname) { - xfree(c); - return BadAlloc; - } - /* - * copy the current FPE list, so that if it gets changed by another client - * while we're blocking, the request still appears atomic - */ - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c->fontname); - xfree(c); - return BadAlloc; - } - memmove(c->fontname, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->fontid = fid; - c->current_fpe = 0; - c->num_fpes = num_fpes; - c->fnamelen = lenfname; - c->slept = FALSE; - c->flags = flags; - c->non_cachable_font = cached; - - (void) doOpenFont(client, c); - return Success; -} - -/** - * Decrement font's ref count, and free storage if ref count equals zero - * - * \param value must conform to DeleteType - */ -int -CloseFont(pointer value, XID fid) -{ - int nscr; - ScreenPtr pscr; - FontPathElementPtr fpe; - FontPtr pfont = (FontPtr)value; - - if (pfont == NullFont) - return (Success); - if (--pfont->refcnt == 0) { - if (patternCache) - RemoveCachedFontPattern (patternCache, pfont); - /* - * since the last reference is gone, ask each screen to free any - * storage it may have allocated locally for it. - */ - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { - pscr = screenInfo.screens[nscr]; - if (pscr->UnrealizeFont) - (*pscr->UnrealizeFont) (pscr, pfont); - } - if (pfont == defaultFont) - defaultFont = NULL; -#ifdef LBX - LbxFreeFontTag(pfont); -#endif -#ifdef XF86BIGFONT - XF86BigfontFreeFontShm(pfont); -#endif - fpe = pfont->fpe; - (*fpe_functions[fpe->type].close_font) (fpe, pfont); - FreeFPE(fpe); - } - return (Success); -} - - -/***====================================================================***/ - -/** - * Sets up pReply as the correct QueryFontReply for pFont with the first - * nProtoCCIStructs char infos. - * - * \param pReply caller must allocate this storage - */ -void -QueryFont(FontPtr pFont, xQueryFontReply *pReply, int nProtoCCIStructs) -{ - FontPropPtr pFP; - int r, - c, - i; - xFontProp *prFP; - xCharInfo *prCI; - xCharInfo *charInfos[256]; - unsigned char chars[512]; - int ninfos; - unsigned long ncols; - unsigned long count; - - /* pr->length set in dispatch */ - pReply->minCharOrByte2 = pFont->info.firstCol; - pReply->defaultChar = pFont->info.defaultCh; - pReply->maxCharOrByte2 = pFont->info.lastCol; - pReply->drawDirection = pFont->info.drawDirection; - pReply->allCharsExist = pFont->info.allExist; - pReply->minByte1 = pFont->info.firstRow; - pReply->maxByte1 = pFont->info.lastRow; - pReply->fontAscent = pFont->info.fontAscent; - pReply->fontDescent = pFont->info.fontDescent; - - pReply->minBounds = pFont->info.ink_minbounds; - pReply->maxBounds = pFont->info.ink_maxbounds; - - pReply->nFontProps = pFont->info.nprops; - pReply->nCharInfos = nProtoCCIStructs; - - for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) (&pReply[1]); - i < pFont->info.nprops; - i++, pFP++, prFP++) { - prFP->name = pFP->name; - prFP->value = pFP->value; - } - - ninfos = 0; - ncols = (unsigned long) (pFont->info.lastCol - pFont->info.firstCol + 1); - prCI = (xCharInfo *) (prFP); - for (r = pFont->info.firstRow; - ninfos < nProtoCCIStructs && r <= (int)pFont->info.lastRow; - r++) { - i = 0; - for (c = pFont->info.firstCol; c <= (int)pFont->info.lastCol; c++) { - chars[i++] = r; - chars[i++] = c; - } - (*pFont->get_metrics) (pFont, ncols, chars, - TwoD16Bit, &count, charInfos); - i = 0; - for (i = 0; i < (int) count && ninfos < nProtoCCIStructs; i++) { - *prCI = *charInfos[i]; - prCI++; - ninfos++; - } - } - return; -} - -static Bool -doListFontsAndAliases(ClientPtr client, LFclosurePtr c) -{ - FontPathElementPtr fpe; - int err = Successful; - FontNamesPtr names = NULL; - char *name, *resolved=NULL; - int namelen, resolvedlen; - int nnames; - int stringLens; - int i; - xListFontsReply reply; - char *bufptr; - char *bufferStart; - int aliascount = 0; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - - if (!c->current.patlen) - goto finish; - - while (c->current.current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) - { - /* This FPE doesn't support/require list_fonts_and_aliases */ - - err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - c->names); - - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - } - return TRUE; - } - - err = BadFontName; - } - else - { - /* Start of list_fonts_and_aliases functionality. Modeled - after list_fonts_with_info in that it resolves aliases, - except that the information collected from FPEs is just - names, not font info. Each list_next_font_or_alias() - returns either a name into name/namelen or an alias into - name/namelen and its target name into resolved/resolvedlen. - The code at this level then resolves the alias by polling - the FPEs. */ - - if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - &c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) { - char *tmpname; - name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, - &resolvedlen, c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; - } - return TRUE; - } - if (err == FontNameAlias) { - if (resolved) xfree(resolved); - resolved = (char *) xalloc(resolvedlen + 1); - if (resolved) - memmove(resolved, tmpname, resolvedlen + 1); - } - } - - if (err == Successful) - { - if (c->haveSaved) - { - if (c->savedName) - (void)AddFontNamesName(c->names, c->savedName, - c->savedNameLen); - } - else - (void)AddFontNamesName(c->names, name, namelen); - } - - /* - * When we get an alias back, save our state and reset back to - * the start of the FPE looking for the specified name. As - * soon as a real font is found for the alias, pop back to the - * old state - */ - else if (err == FontNameAlias) { - char tmp_pattern[XLFDMAXFONTNAMELEN]; - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - memmove(tmp_pattern, resolved, resolvedlen); - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - - tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, - &tmpname, &tmpnamelen, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - c->savedNameLen = namelen; - aliascount = 20; - } - memmove(c->current.pattern, tmp_pattern, resolvedlen); - c->current.patlen = resolvedlen; - c->current.max_names = c->names->nnames + 1; - c->current.current_fpe = -1; - c->current.private = 0; - err = BadFontName; - } - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've collected enough - * font names, quit. - */ - if (err == BadFontName) { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->names->nnames == c->current.max_names || - c->current.current_fpe == c->num_fpes) { - c->haveSaved = FALSE; - c->current = c->saved; - /* Give the saved namelist a chance to clean itself up */ - continue; - } - } - if (c->names->nnames == c->current.max_names) - break; - } - } - - /* - * send the reply - */ - if (err != Successful) { - SendErrorToClient(client, X_ListFonts, 0, 0, FontToXError(err)); - goto bail; - } - -finish: - - names = c->names; - nnames = names->nnames; - client = c->client; - stringLens = 0; - for (i = 0; i < nnames; i++) - stringLens += (names->length[i] <= 255) ? names->length[i] : 0; - - reply.type = X_Reply; - reply.length = (stringLens + nnames + 3) >> 2; - reply.nFonts = nnames; - reply.sequenceNumber = client->sequence; - - bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2); - - if (!bufptr && reply.length) { - SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); - goto bail; - } - /* - * since WriteToClient long word aligns things, copy to temp buffer and - * write all at once - */ - for (i = 0; i < nnames; i++) { - if (names->length[i] > 255) - reply.nFonts--; - else - { - *bufptr++ = names->length[i]; - memmove( bufptr, names->names[i], names->length[i]); - bufptr += names->length[i]; - } - } - nnames = reply.nFonts; - reply.length = (stringLens + nnames + 3) >> 2; - client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; - WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); - (void) WriteToClient(client, stringLens + nnames, bufferStart); - DEALLOCATE_LOCAL(bufferStart); - -bail: - if (c->slept) - ClientWakeup(client); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - FreeFontNames(names); - xfree(c); - if (resolved) xfree(resolved); - return TRUE; -} - -int -ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, - unsigned max_names) -{ - int i; - LFclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) - return BadAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c); - return BadAlloc; - } - c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100); - if (!c->names) - { - xfree(c->fpe_list); - xfree(c); - return BadAlloc; - } - memmove( c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsAndAliases(client, c); - return Success; -} - -int -doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) -{ - FontPathElementPtr fpe; - int err = Successful; - char *name; - int namelen; - int numFonts; - FontInfoRec fontInfo, - *pFontInfo; - xListFontsWithInfoReply *reply; - int length; - xFontProp *pFP; - int i; - int aliascount = 0; - xListFontsWithInfoReply finalReply; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo]; - if (!c->current.patlen) - goto finish; - while (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - if (!c->current.list_started) - { - err = (*fpe_functions[fpe->type].start_list_fonts_with_info) - (client, fpe, c->current.pattern, c->current.patlen, - c->current.max_names, &c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, (ClientSleepProcPtr)doListFontsWithInfo, c); - c->slept = TRUE; - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) - { - name = 0; - pFontInfo = &fontInfo; - err = (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &name, &namelen, &pFontInfo, - &numFonts, c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsWithInfo, - c); - c->slept = TRUE; - } - return TRUE; - } - } - /* - * When we get an alias back, save our state and reset back to the - * start of the FPE looking for the specified name. As soon as a real - * font is found for the alias, pop back to the old state - */ - if (err == FontNameAlias) - { - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - FontInfoPtr tmpFontInfo; - - tmpname = 0; - tmpFontInfo = &fontInfo; - (void) (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, - &numFonts, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - c->savedNumFonts = numFonts; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - aliascount = 20; - } - memmove(c->current.pattern, name, namelen); - c->current.patlen = namelen; - c->current.max_names = 1; - c->current.current_fpe = 0; - c->current.private = 0; - c->current.list_started = FALSE; - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've sent enough font - * names, quit. Always wait for BadFontName to let the FPE - * have a chance to clean up. - */ - else if (err == BadFontName) - { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->current.max_names == 0 || - c->current.current_fpe == c->num_fpes) - { - c->haveSaved = FALSE; - c->saved.max_names -= (1 - c->current.max_names); - c->current = c->saved; - } - } - else if (c->current.max_names == 0) - break; - } - else if (err == Successful) - { - length = sizeof(*reply) + pFontInfo->nprops * sizeof(xFontProp); - reply = c->reply; - if (c->length < length) - { - reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length); - if (!reply) - { - err = AllocError; - break; - } - c->reply = reply; - c->length = length; - } - if (c->haveSaved) - { - numFonts = c->savedNumFonts; - name = c->savedName; - namelen = strlen(name); - } - reply->type = X_Reply; - reply->length = (sizeof *reply - sizeof(xGenericReply) + - pFontInfo->nprops * sizeof(xFontProp) + - namelen + 3) >> 2; - reply->sequenceNumber = client->sequence; - reply->nameLength = namelen; - reply->minBounds = pFontInfo->ink_minbounds; - reply->maxBounds = pFontInfo->ink_maxbounds; - reply->minCharOrByte2 = pFontInfo->firstCol; - reply->maxCharOrByte2 = pFontInfo->lastCol; - reply->defaultChar = pFontInfo->defaultCh; - reply->nFontProps = pFontInfo->nprops; - reply->drawDirection = pFontInfo->drawDirection; - reply->minByte1 = pFontInfo->firstRow; - reply->maxByte1 = pFontInfo->lastRow; - reply->allCharsExist = pFontInfo->allExist; - reply->fontAscent = pFontInfo->fontAscent; - reply->fontDescent = pFontInfo->fontDescent; - reply->nReplies = numFonts; - pFP = (xFontProp *) (reply + 1); - for (i = 0; i < pFontInfo->nprops; i++) - { - pFP->name = pFontInfo->props[i].name; - pFP->value = pFontInfo->props[i].value; - pFP++; - } - WriteSwappedDataToClient(client, length, reply); - (void) WriteToClient(client, namelen, name); - if (pFontInfo == &fontInfo) - { - xfree(fontInfo.props); - xfree(fontInfo.isStringProp); - } - --c->current.max_names; - } - } -finish: - length = sizeof(xListFontsWithInfoReply); - bzero((char *) &finalReply, sizeof(xListFontsWithInfoReply)); - finalReply.type = X_Reply; - finalReply.sequenceNumber = client->sequence; - finalReply.length = (sizeof(xListFontsWithInfoReply) - - sizeof(xGenericReply)) >> 2; - WriteSwappedDataToClient(client, length, &finalReply); -bail: - if (c->slept) - ClientWakeup(client); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->reply); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - xfree(c); - return TRUE; -} - -int -StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, - int max_names) -{ - int i; - LFWIclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFWIclosurePtr) xalloc(sizeof *c))) - goto badAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) - { - xfree(c); - goto badAlloc; - } - memmove(c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) - { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->reply = 0; - c->length = 0; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->savedNumFonts = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsWithInfo(client, c); - return Success; -badAlloc: - return BadAlloc; -} - -#define TextEltHeader 2 -#define FontShiftSize 5 -static XID clearGC[] = { CT_NONE }; -#define clearGCmask (GCClipMask) - -int -doPolyText(ClientPtr client, register PTclosurePtr c) -{ - register FontPtr pFont = c->pGC->font, oldpFont; - Font fid, oldfid; - int err = Success, lgerr; /* err is in X error, not font error, space */ - enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; - FontPathElementPtr fpe; - GC *origGC = NULL; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - - if (c->slept) - { - /* Client has died, but we cannot bail out right now. We - need to clean up after the work we did when going to - sleep. Setting the drawable pointer to 0 makes this - happen without any attempts to render or perform other - unnecessary activities. */ - c->pDraw = (DrawablePtr)0; - } - else - { - err = Success; - goto bail; - } - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client and avoid further - rendering while we clean up after ourself. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - c->pDraw = (DrawablePtr)0; - } - - client_state = c->slept ? SLEEPING : NEVER_SLEPT; - - while (c->endReq - c->pElt > TextEltHeader) - { - if (*c->pElt == FontChange) - { - if (c->endReq - c->pElt < FontShiftSize) - { - err = BadLength; - goto bail; - } - - oldpFont = pFont; - oldfid = fid; - - fid = ((Font)*(c->pElt+4)) /* big-endian */ - | ((Font)*(c->pElt+3)) << 8 - | ((Font)*(c->pElt+2)) << 16 - | ((Font)*(c->pElt+1)) << 24; - pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - client->errorValue = fid; - err = BadFont; - /* restore pFont and fid for step 4 (described below) */ - pFont = oldpFont; - fid = oldfid; - - /* If we're in START_SLEEP mode, the following step - shortens the request... in the unlikely event that - the fid somehow becomes valid before we come through - again to actually execute the polytext, which would - then mess up our refcounting scheme badly. */ - c->err = err; - c->endReq = c->pElt; - - goto bail; - } - - /* Step 3 (described below) on our new font */ - if (client_state == START_SLEEP) - pFont->refcnt++; - else - { - if (pFont != c->pGC->font && c->pDraw) - { - ChangeGC( c->pGC, GCFont, &fid); - ValidateGC(c->pDraw, c->pGC); - if (c->reqType == X_PolyText8) - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8; - else - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText16; - } - - /* Undo the refcnt++ we performed when going to sleep */ - if (client_state == SLEEPING) - (void)CloseFont(c->pGC->font, (Font)0); - } - c->pElt += FontShiftSize; - } - else /* print a string */ - { - unsigned char *pNextElt; - pNextElt = c->pElt + TextEltHeader + (*c->pElt)*c->itemSize; - if ( pNextElt > c->endReq) - { - err = BadLength; - goto bail; - } - if (client_state == START_SLEEP) - { - c->pElt = pNextElt; - continue; - } - if (c->pDraw) - { - lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, c->itemSize, - c->pElt + TextEltHeader); - } - else lgerr = Successful; - - if (lgerr == Suspended) - { - if (!c->slept) { - int len; - GC *pGC; - PTclosurePtr new_closure; - - /* We're putting the client to sleep. We need to do a few things - to ensure successful and atomic-appearing execution of the - remainder of the request. First, copy the remainder of the - request into a safe malloc'd area. Second, create a scratch GC - to use for the remainder of the request. Third, mark all fonts - referenced in the remainder of the request to prevent their - deallocation. Fourth, make the original GC look like the - request has completed... set its font to the final font value - from this request. These GC manipulations are for the unlikely - (but possible) event that some other client is using the GC. - Steps 3 and 4 are performed by running this procedure through - the remainder of the request in a special no-render mode - indicated by client_state = START_SLEEP. */ - - /* Step 1 */ - /* Allocate a malloc'd closure structure to replace - the local one we were passed */ - new_closure = (PTclosurePtr) xalloc(sizeof(PTclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - len = c->endReq - c->pElt; - c->data = (unsigned char *)xalloc(len); - if (!c->data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(c->data, c->pElt, len); - c->pElt = c->data; - c->endReq = c->pElt + len; - - /* Step 2 */ - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - if ((err = CopyGC(c->pGC, pGC, GCFunction | - GCPlaneMask | GCForeground | - GCBackground | GCFillStyle | - GCTile | GCStipple | - GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != - Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - origGC = c->pGC; - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doPolyText, - (pointer) c); - - /* Set up to perform steps 3 and 4 */ - client_state = START_SLEEP; - continue; /* on to steps 3 and 4 */ - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */ - c->xorg = (* c->polyText)(c->pDraw, c->pGC, c->xorg, c->yorg, - *c->pElt, c->pElt + TextEltHeader); - } - c->pElt = pNextElt; - } - } - -bail: - - if (client_state == START_SLEEP) - { - /* Step 4 */ - if (pFont != origGC->font) - { - ChangeGC(origGC, GCFont, &fid); - ValidateGC(c->pDraw, origGC); - } - - /* restore pElt pointer for execution of remainder of the request */ - c->pElt = c->data; - return TRUE; - } - - if (c->err != Success) err = c->err; - if (err != Success && c->client != serverClient) { -#ifdef PANORAMIX - if (noPanoramiXExtension || !c->pGC->pScreen->myNum) -#endif - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -PolyText(ClientPtr client, DrawablePtr pDraw, GC *pGC, unsigned char *pElt, - unsigned char *endReq, int xorg, int yorg, int reqType, XID did) -{ - PTclosureRec local_closure; - - local_closure.pElt = pElt; - local_closure.endReq = endReq; - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_PolyText8) - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText8; - local_closure.itemSize = 1; - } - else - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText16; - local_closure.itemSize = 2; - } - local_closure.pGC = pGC; - local_closure.did = did; - local_closure.err = Success; - local_closure.slept = FALSE; - - (void) doPolyText(client, &local_closure); - return Success; -} - - -#undef TextEltHeader -#undef FontShiftSize - -int -doImageText(ClientPtr client, register ITclosurePtr c) -{ - int err = Success, lgerr; /* err is in X error, not font error, space */ - FontPathElementPtr fpe; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, c->itemSize, c->data); - if (lgerr == Suspended) - { - if (!c->slept) { - GC *pGC; - unsigned char *data; - ITclosurePtr new_closure; - - /* We're putting the client to sleep. We need to - save some state. Similar problem to that handled - in doPolyText, but much simpler because the - request structure is much simpler. */ - - new_closure = (ITclosurePtr) xalloc(sizeof(ITclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - data = (unsigned char *)xalloc(c->nChars * c->itemSize); - if (!data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(data, c->data, c->nChars * c->itemSize); - c->data = data; - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - if ((err = CopyGC(c->pGC, pGC, GCFunction | GCPlaneMask | - GCForeground | GCBackground | GCFillStyle | - GCTile | GCStipple | GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doImageText, (pointer) c); - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - (* c->imageText)(c->pDraw, c->pGC, c->xorg, c->yorg, - c->nChars, c->data); - } - -bail: - - if (err != Success && c->client != serverClient) { - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -ImageText(ClientPtr client, DrawablePtr pDraw, GC *pGC, int nChars, - unsigned char *data, int xorg, int yorg, int reqType, XID did) -{ - ITclosureRec local_closure; - - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.pGC = pGC; - local_closure.nChars = nChars; - local_closure.data = data; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_ImageText8) - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText8; - local_closure.itemSize = 1; - } - else - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText16; - local_closure.itemSize = 2; - } - local_closure.did = did; - local_closure.slept = FALSE; - - (void) doImageText(client, &local_closure); - return Success; -} - - -/* does the necessary magic to figure out the fpe type */ -static int -DetermineFPEType(char *pathname) -{ - int i; - - for (i = 0; i < num_fpe_types; i++) { - if ((*fpe_functions[i].name_check) (pathname)) - return i; - } - return -1; -} - - -static void -FreeFontPath(FontPathElementPtr *list, int n, Bool force) -{ - int i; - - for (i = 0; i < n; i++) { - if (force) { - /* Sanity check that all refcounts will be 0 by the time - we get to the end of the list. */ - int found = 1; /* the first reference is us */ - int j; - for (j = i+1; j < n; j++) { - if (list[j] == list[i]) - found++; - } - if (list[i]->refcount != found) { - ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n", - list[i]->name_length, list[i]->name, - list[i]->refcount, found); - list[i]->refcount = found; /* ensure it will get freed */ - } - } - FreeFPE(list[i]); - } - xfree((char *) list); -} - -static FontPathElementPtr -find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len) -{ - FontPathElementPtr fpe; - int i; - - for (i = 0; i < num; i++) { - fpe = list[i]; - if (fpe->name_length == len && memcmp(name, fpe->name, len) == 0) - return fpe; - } - return (FontPathElementPtr) 0; -} - - -static int -SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) -{ - int i, err = 0; - int valid_paths = 0; - unsigned int len; - unsigned char *cp = paths; - FontPathElementPtr fpe = NULL, *fplist; - - fplist = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * npaths); - if (!fplist) { - *bad = 0; - return BadAlloc; - } - for (i = 0; i < num_fpe_types; i++) { - if (fpe_functions[i].set_path_hook) - (*fpe_functions[i].set_path_hook) (); - } - for (i = 0; i < npaths; i++) - { - len = (unsigned int) (*cp++); - - if (len == 0) - { - if (persist) - ErrorF ("Removing empty element from the valid list of fontpaths\n"); - err = BadValue; - } - else - { - /* if it's already in our active list, just reset it */ - /* - * note that this can miss FPE's in limbo -- may be worth catching - * them, though it'd muck up refcounting - */ - fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); - if (fpe) - { - err = (*fpe_functions[fpe->type].reset_fpe) (fpe); - if (err == Successful) - { - UseFPE(fpe);/* since it'll be decref'd later when freed - * from the old list */ - } - else - fpe = 0; - } - /* if error or can't do it, act like it's a new one */ - if (!fpe) - { - fpe = (FontPathElementPtr) xalloc(sizeof(FontPathElementRec)); - if (!fpe) - { - err = BadAlloc; - goto bail; - } - fpe->name = (char *) xalloc(len + 1); - if (!fpe->name) - { - xfree(fpe); - err = BadAlloc; - goto bail; - } - fpe->refcount = 1; - - strncpy(fpe->name, (char *) cp, (int) len); - fpe->name[len] = '\0'; - fpe->name_length = len; - fpe->type = DetermineFPEType(fpe->name); - if (fpe->type == -1) - err = BadValue; - else - err = (*fpe_functions[fpe->type].init_fpe) (fpe); - if (err != Successful) - { - if (persist) - { - ErrorF("Could not init font path element %s, removing from list!\n", - fpe->name); - } - xfree (fpe->name); - xfree (fpe); - } - } - } - if (err != Successful) - { - if (!persist) - goto bail; - } - else - { - fplist[valid_paths++] = fpe; - } - cp += len; - } - - FreeFontPath(font_path_elements, num_fpes, FALSE); - font_path_elements = fplist; - if (patternCache) - EmptyFontPatternCache(patternCache); - num_fpes = valid_paths; - - return Success; -bail: - *bad = i; - while (--valid_paths >= 0) - FreeFPE(fplist[valid_paths]); - xfree(fplist); - return FontToXError(err); -} - -/* XXX -- do we need to pass error down to each renderer? */ -int -SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) -{ - int err = Success; - - if (npaths == 0) { - if (SetDefaultFontPath(defaultFontPath) != Success) - return BadValue; - } else { - err = SetFontPathElements(npaths, paths, error, FALSE); - } - return err; -} - -int -SetDefaultFontPath(char *path) -{ - unsigned char *cp, - *pp, - *nump, - *newpath; - int num = 1, - len, - err, - size = 0, - bad; - - /* get enough for string, plus values -- use up commas */ - len = strlen(path) + 1; - nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); - if (!newpath) - return BadAlloc; - pp = (unsigned char *) path; - cp++; - while (*pp) { - if (*pp == ',') { - *nump = (unsigned char) size; - nump = cp++; - pp++; - num++; - size = 0; - } else { - *cp++ = *pp++; - size++; - } - } - *nump = (unsigned char) size; - - err = SetFontPathElements(num, newpath, &bad, TRUE); - - DEALLOCATE_LOCAL(newpath); - - return err; -} - -unsigned char * -GetFontPath(int *count, int *length) -{ - int i; - unsigned char *c; - int len; - FontPathElementPtr fpe; - - len = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - len += fpe->name_length + 1; - } - font_path_string = (unsigned char *) xrealloc(font_path_string, len); - if (!font_path_string) - return NULL; - - c = font_path_string; - *length = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - *c = fpe->name_length; - *length += *c++; - memmove(c, fpe->name, fpe->name_length); - c += fpe->name_length; - } - *count = num_fpes; - return font_path_string; -} - -int -LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, unsigned char *data) -{ - if (fpe_functions[pfont->fpe->type].load_glyphs) - return (*fpe_functions[pfont->fpe->type].load_glyphs) - (client, pfont, 0, nchars, item_size, data); - else - return Successful; -} - -void -DeleteClientFontStuff(ClientPtr client) -{ - int i; - FontPathElementPtr fpe; - - for (i = 0; i < num_fpes; i++) - { - fpe = font_path_elements[i]; - if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } -} - -void -InitFonts () -{ - patternCache = MakeFontPatternCache(); - -#ifndef KDRIVESERVER - if (screenInfo.numScreens > screenInfo.numVideoScreens) { - PrinterFontRegisterFpeFunctions(); - FontFileCheckRegisterFpeFunctions(); - check_fs_register_fpe_functions(); - } else -#endif - { -#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); -#endif - FontFileRegisterFpeFunctions(); -#ifndef NOFONTSERVERACCESS - fs_register_fpe_functions(); -#endif - } -} - -int -GetDefaultPointSize () -{ - return 120; -} - - -FontResolutionPtr -GetClientResolutions (int *num) -{ - if (requestingClient && requestingClient->fontResFunc != NULL && - !requestingClient->clientGone) - { - return (*requestingClient->fontResFunc)(requestingClient, num); - } - else { - static struct _FontResolution res; - ScreenPtr pScreen; - - pScreen = screenInfo.screens[0]; - res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; - /* - * XXX - we'll want this as long as bitmap instances are prevalent - so that we can match them from scalable fonts - */ - if (res.x_resolution < 88) - res.x_resolution = 75; - else - res.x_resolution = 100; - res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight; - if (res.y_resolution < 88) - res.y_resolution = 75; - else - res.y_resolution = 100; - res.point_size = 120; - *num = 1; - return &res; - } -} - -/* - * returns the type index of the new fpe - * - * should be called (only once!) by each type of fpe when initialized - */ - -int -RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func) -{ - FPEFunctions *new; - - /* grow the list */ - new = (FPEFunctions *) xrealloc(fpe_functions, - (num_fpe_types + 1) * sizeof(FPEFunctions)); - if (!new) - return -1; - fpe_functions = new; - - fpe_functions[num_fpe_types].name_check = name_func; - fpe_functions[num_fpe_types].open_font = open_func; - fpe_functions[num_fpe_types].close_font = close_func; - fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func; - fpe_functions[num_fpe_types].list_fonts = list_func; - fpe_functions[num_fpe_types].start_list_fonts_with_info = - start_lfwi_func; - fpe_functions[num_fpe_types].list_next_font_with_info = - next_lfwi_func; - fpe_functions[num_fpe_types].init_fpe = init_func; - fpe_functions[num_fpe_types].free_fpe = free_func; - fpe_functions[num_fpe_types].reset_fpe = reset_func; - fpe_functions[num_fpe_types].client_died = client_died; - fpe_functions[num_fpe_types].load_glyphs = load_glyphs; - fpe_functions[num_fpe_types].start_list_fonts_and_aliases = - start_list_alias_func; - fpe_functions[num_fpe_types].list_next_font_or_alias = - next_list_alias_func; - fpe_functions[num_fpe_types].set_path_hook = set_path_func; - - return num_fpe_types++; -} - -void -FreeFonts() -{ - if (patternCache) { - FreeFontPatternCache(patternCache); - patternCache = 0; - } - FreeFontPath(font_path_elements, num_fpes, TRUE); - font_path_elements = 0; - num_fpes = 0; - xfree(fpe_functions); - num_fpe_types = 0; - fpe_functions = (FPEFunctions *) 0; -} - -/* convenience functions for FS interface */ - -FontPtr -find_old_font(XID id) -{ - return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, - SecurityUnknownAccess); -} - -Font -GetNewFontClientID() -{ - return FakeClientID(0); -} - -int -StoreFontClientFont(FontPtr pfont, Font id) -{ - return AddResource(id, RT_NONE, (pointer) pfont); -} - -void -DeleteFontClientID(Font id) -{ - FreeResource(id, RT_NONE); -} - -int -client_auth_generation(ClientPtr client) -{ - return 0; -} - -static int fs_handlers_installed = 0; -static unsigned int last_server_gen; - -int -init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) -{ - /* if server has reset, make sure the b&w handlers are reinstalled */ - if (last_server_gen < serverGeneration) { - last_server_gen = serverGeneration; - fs_handlers_installed = 0; - } - if (fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "adding FS b & w handlers\n"); -#endif - - if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (pointer) 0)) - return AllocError; - fs_handlers_installed++; - } - QueueFontWakeup(fpe); - return Successful; -} - -void -remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, Bool all) -{ - if (all) { - /* remove the handlers if no one else is using them */ - if (--fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "removing FS b & w handlers\n"); -#endif - - RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (pointer) 0); - } - } - RemoveFontWakeup(fpe); -} - -#ifdef DEBUG -#define GLWIDTHBYTESPADDED(bits,nbytes) \ - ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \ - :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \ - :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \ - :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \ - : 0) - -#define GLYPH_SIZE(ch, nbytes) \ - GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \ - (ch)->metrics.leftSideBearing, (nbytes)) -void -dump_char_ascii(CharInfoPtr cip) -{ - int r, - l; - int bpr; - int byte; - static unsigned maskTab[] = { - (1 << 7), (1 << 6), (1 << 5), (1 << 4), - (1 << 3), (1 << 2), (1 << 1), (1 << 0), - }; - - bpr = GLYPH_SIZE(cip, 4); - for (r = 0; r < (cip->metrics.ascent + cip->metrics.descent); r++) { - pointer row = (pointer) cip->bits + r * bpr; - - byte = 0; - for (l = 0; l <= (cip->metrics.rightSideBearing - - cip->metrics.leftSideBearing); l++) { - if (maskTab[l & 7] & row[l >> 3]) - putchar('X'); - else - putchar('.'); - } - putchar('\n'); - } -} - -#endif diff --git a/nx-X11/programs/Xserver/dix/pixmap.c.NX.original b/nx-X11/programs/Xserver/dix/pixmap.c.NX.original deleted file mode 100644 index 4be7d03ce..000000000 --- a/nx-X11/programs/Xserver/dix/pixmap.c.NX.original +++ /dev/null @@ -1,152 +0,0 @@ -/* $Xorg: pixmap.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ -/* - -Copyright 1993, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/programs/Xserver/dix/pixmap.c,v 3.4 2001/01/17 22:36:44 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "scrnintstr.h" -#include "misc.h" -#include "os.h" -#include "windowstr.h" -#include "resource.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "site.h" - - -/* - * Scratch pixmap management and device independent pixmap allocation - * function. - */ - - -/* callable by ddx */ -PixmapPtr -GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) -{ - PixmapPtr pPixmap = pScreen->pScratchPixmap; - - if (pPixmap) - pScreen->pScratchPixmap = NULL; - else - /* width and height of 0 means don't allocate any pixmap data */ - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); - - if (pPixmap) { - if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, - bitsPerPixel, devKind, pPixData)) - return pPixmap; - (*pScreen->DestroyPixmap)(pPixmap); - } - return NullPixmap; -} - - -/* callable by ddx */ -void -FreeScratchPixmapHeader(PixmapPtr pPixmap) -{ - if (pPixmap) - { - ScreenPtr pScreen = pPixmap->drawable.pScreen; - - pPixmap->devPrivate.ptr = NULL; /* lest ddx chases bad ptr */ - if (pScreen->pScratchPixmap) - (*pScreen->DestroyPixmap)(pPixmap); - else - pScreen->pScratchPixmap = pPixmap; - } -} - - -Bool -CreateScratchPixmapsForScreen(int scrnum) -{ - /* let it be created on first use */ - screenInfo.screens[scrnum]->pScratchPixmap = NULL; - return TRUE; -} - - -void -FreeScratchPixmapsForScreen(int scrnum) -{ - FreeScratchPixmapHeader(screenInfo.screens[scrnum]->pScratchPixmap); -} - - -/* callable by ddx */ -PixmapPtr -AllocatePixmap(ScreenPtr pScreen, int pixDataSize) -{ - PixmapPtr pPixmap; -#ifdef PIXPRIV - char *ptr; - DevUnion *ppriv; - unsigned *sizes; - unsigned size; - int i; - - if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize) - return NullPixmap; - - /* - * FIXME: Allocate 4 bytes at the end of each pixmap. This - * is a quick workaround intended to fix a problem reported - * by Valgrind due to fbBlt() writing just after the end of - * the pixmap buffer. This may be a RENDER bug. - */ - - pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize + 4); - if (!pPixmap) - return NullPixmap; - ppriv = (DevUnion *)(pPixmap + 1); - pPixmap->devPrivates = ppriv; - sizes = pScreen->PixmapPrivateSizes; - ptr = (char *)(ppriv + pScreen->PixmapPrivateLen); - for (i = pScreen->PixmapPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ((size = *sizes) != 0) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } -#else - pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize); -#endif - return pPixmap; -} diff --git a/nx-X11/programs/Xserver/dix/pixmap.c.X.original b/nx-X11/programs/Xserver/dix/pixmap.c.X.original deleted file mode 100644 index 78ce2a8c6..000000000 --- a/nx-X11/programs/Xserver/dix/pixmap.c.X.original +++ /dev/null @@ -1,145 +0,0 @@ -/* $Xorg: pixmap.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ -/* - -Copyright 1993, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/programs/Xserver/dix/pixmap.c,v 3.4 2001/01/17 22:36:44 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "scrnintstr.h" -#include "misc.h" -#include "os.h" -#include "windowstr.h" -#include "resource.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "site.h" - - -/* - * Scratch pixmap management and device independent pixmap allocation - * function. - */ - - -/* callable by ddx */ -PixmapPtr -GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) -{ - PixmapPtr pPixmap = pScreen->pScratchPixmap; - - if (pPixmap) - pScreen->pScratchPixmap = NULL; - else - /* width and height of 0 means don't allocate any pixmap data */ - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); - - if (pPixmap) { - if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, - bitsPerPixel, devKind, pPixData)) - return pPixmap; - (*pScreen->DestroyPixmap)(pPixmap); - } - return NullPixmap; -} - - -/* callable by ddx */ -void -FreeScratchPixmapHeader(PixmapPtr pPixmap) -{ - if (pPixmap) - { - ScreenPtr pScreen = pPixmap->drawable.pScreen; - - pPixmap->devPrivate.ptr = NULL; /* lest ddx chases bad ptr */ - if (pScreen->pScratchPixmap) - (*pScreen->DestroyPixmap)(pPixmap); - else - pScreen->pScratchPixmap = pPixmap; - } -} - - -Bool -CreateScratchPixmapsForScreen(int scrnum) -{ - /* let it be created on first use */ - screenInfo.screens[scrnum]->pScratchPixmap = NULL; - return TRUE; -} - - -void -FreeScratchPixmapsForScreen(int scrnum) -{ - FreeScratchPixmapHeader(screenInfo.screens[scrnum]->pScratchPixmap); -} - - -/* callable by ddx */ -PixmapPtr -AllocatePixmap(ScreenPtr pScreen, int pixDataSize) -{ - PixmapPtr pPixmap; -#ifdef PIXPRIV - char *ptr; - DevUnion *ppriv; - unsigned *sizes; - unsigned size; - int i; - - if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize) - return NullPixmap; - - pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize); - if (!pPixmap) - return NullPixmap; - ppriv = (DevUnion *)(pPixmap + 1); - pPixmap->devPrivates = ppriv; - sizes = pScreen->PixmapPrivateSizes; - ptr = (char *)(ppriv + pScreen->PixmapPrivateLen); - for (i = pScreen->PixmapPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ((size = *sizes) != 0) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } -#else - pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize); -#endif - return pPixmap; -} diff --git a/nx-X11/programs/Xserver/fb/Imakefile.NX.original b/nx-X11/programs/Xserver/fb/Imakefile.NX.original deleted file mode 100644 index cb560e7a0..000000000 --- a/nx-X11/programs/Xserver/fb/Imakefile.NX.original +++ /dev/null @@ -1,194 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/fb/Imakefile,v 1.16 2002/05/31 16:12:17 dawes Exp $ -XCOMM -XCOMM -XCOMM Id: Imakefile,v 1.1 1999/11/02 03:54:44 keithp Exp $ - -/* - * The X.org 6.8.99.16 snapshot fails to compile with GCC 4. - * Temporarily disable the MMX features until the bug is - * fixed. - * -#if defined(HasGcc34) && HasGcc34 -MMXOPTIONS= -mmmx -msse -Winline --param inline-unit-growth=10000 \ - --param large-function-growth=10000 -DUSE_MMX -USEMMXOPTIONS= -DUSE_MMX -#if defined(i386Architecture) || defined(AMD64Architecture) -SpecialCObjectRule(fbmmx,fbmmx.c,$(MMXOPTIONS)) -SpecialCObjectRule(fbpict,fbpict.c,$(USEMMXOPTIONS)) -SpecialCObjectRule(fbfill,fbfill.c,$(USEMMXOPTIONS)) -SpecialCObjectRule(fbcopy,fbcopy.c,$(USEMMXOPTIONS)) -#endif - -#endif - */ - -#if DoLoadableServer -#if !BuildModuleInSubdir -#define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif -#endif - -#include - -#ifdef FbNoPixelAddrCode -DEFINES=-DFBNOPIXADDR -DFBNO24BIT -#endif - -#if defined(IHaveModules) -XFMODSRC = fbmodule.c -XFMODOBJ = fbmodule.o -#endif - -#if BuildRender -RENDERSRC = fbcompose.c -RENDEROBJ = fbcompose.o -#endif - -SRCS = $(XFMODSRC) \ - fballpriv.c \ - fbbits.c \ - fbblt.c \ - fbbltone.c \ - fbbstore.c \ - fbcmap.c \ - $(RENDERSRC) \ - fbcopy.c \ - fbedge.c \ - fbfill.c \ - fbfillrect.c \ - fbfillsp.c \ - fbgc.c \ - fbgetsp.c \ - fbglyph.c \ - fbimage.c \ - fbline.c \ - fboverlay.c \ - fbpixmap.c \ - fbpoint.c \ - fbpush.c \ - fbscreen.c \ - fbseg.c \ - fbsetsp.c \ - fbsolid.c \ - fbstipple.c \ - fbtile.c \ - fbtrap.c \ - fbutil.c \ - fbwindow.c \ - fb24_32.c \ - fbpict.c \ - fbmmx.c \ - fbpseudocolor.c - -OBJS = $(XFMODOBJ) \ - fbarc.o \ - fballpriv.o \ - fbbits.o \ - fbblt.o \ - fbbltone.o \ - fbbstore.o \ - fbcmap.o \ - $(RENDEROBJ) \ - fbcopy.o \ - fbedge.o \ - fbfill.o \ - fbfillrect.o \ - fbfillsp.o \ - fbgc.o \ - fbgetsp.o \ - fbglyph.o \ - fbimage.o \ - fbline.o \ - fboverlay.o \ - fbpixmap.o \ - fbpoint.o \ - fbpush.o \ - fbscreen.o \ - fbseg.o \ - fbsetsp.o \ - fbsolid.o \ - fbstipple.o \ - fbtile.o \ - fbtrap.o \ - fbutil.o \ - fbwindow.o \ - fb24_32.o \ - fbpict.o \ - fbmmx.o \ - fbpseudocolor.o - - INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I$(XF86SRC)/common $(EXTRAINCLUDES) \ - -I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext - LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ - $(SERVERSRC)/mi/llib-lmi.ln - -#ifdef IHaveModules -ModuleObjectRule() -LibraryModuleTarget(fb,$(OBJS)) -#else -NormalLibraryObjectRule() -NormalLibraryTarget(fb,$(OBJS)) -#endif - -LintLibraryTarget(fb,$(SRCS)) - -NormalLintTarget($(SRCS)) - -#ifdef IHaveModules -InstallLibraryModule(fb,$(MODULEDIR),.) -#endif - -DependTarget() - -#ifdef IHaveSubdirs -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -#ifdef LinkDirectory -LinkSourceFile(fb24_32.c,LinkDirectory) -LinkSourceFile(fballpriv.c,LinkDirectory) -LinkSourceFile(fbarc.c,LinkDirectory) -LinkSourceFile(fbbits.c,LinkDirectory) -LinkSourceFile(fbblt.c,LinkDirectory) -LinkSourceFile(fbbltone.c,LinkDirectory) -LinkSourceFile(fbbstore.c,LinkDirectory) -LinkSourceFile(fbcmap.c,LinkDirectory) -#if BuildRender -LinkSourceFile(fbcompose.c,LinkDirectory) -#endif -LinkSourceFile(fbcopy.c,LinkDirectory) -LinkSourceFile(fbfill.c,LinkDirectory) -LinkSourceFile(fbfillrect.c,LinkDirectory) -LinkSourceFile(fbfillsp.c,LinkDirectory) -LinkSourceFile(fbgc.c,LinkDirectory) -LinkSourceFile(fbgetsp.c,LinkDirectory) -LinkSourceFile(fbglyph.c,LinkDirectory) -LinkSourceFile(fbimage.c,LinkDirectory) -LinkSourceFile(fbline.c,LinkDirectory) -LinkSourceFile(fbmodule.c,LinkDirectory) -LinkSourceFile(fboverlay.c,LinkDirectory) -LinkSourceFile(fbpict.c,LinkDirectory) -LinkSourceFile(fbpixmap.c,LinkDirectory) -LinkSourceFile(fbpoint.c,LinkDirectory) -LinkSourceFile(fbpush.c,LinkDirectory) -LinkSourceFile(fbscreen.c,LinkDirectory) -LinkSourceFile(fbseg.c,LinkDirectory) -LinkSourceFile(fbsetsp.c,LinkDirectory) -LinkSourceFile(fbsolid.c,LinkDirectory) -LinkSourceFile(fbstipple.c,LinkDirectory) -LinkSourceFile(fbtile.c,LinkDirectory) -LinkSourceFile(fbtrap.c,LinkDirectory) -LinkSourceFile(fbutil.c,LinkDirectory) -LinkSourceFile(fbwindow.c,LinkDirectory) -LinkSourceFile(fbmmx.c,LinkDirectory) -#endif - -InstallDriverSDKLibraryModule(fb,$(DRIVERSDKMODULEDIR),.) -InstallDriverSDKNonExecFile(fb.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(fbrop.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/fb/Imakefile.X.original b/nx-X11/programs/Xserver/fb/Imakefile.X.original deleted file mode 100644 index df867016a..000000000 --- a/nx-X11/programs/Xserver/fb/Imakefile.X.original +++ /dev/null @@ -1,188 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/fb/Imakefile,v 1.16 2002/05/31 16:12:17 dawes Exp $ -XCOMM -XCOMM -XCOMM Id: Imakefile,v 1.1 1999/11/02 03:54:44 keithp Exp $ - -#if defined(HasGcc34) && HasGcc34 -MMXOPTIONS= -mmmx -msse -Winline --param inline-unit-growth=10000 \ - --param large-function-growth=10000 -DUSE_MMX -USEMMXOPTIONS= -DUSE_MMX -#if defined(i386Architecture) || defined(AMD64Architecture) -SpecialCObjectRule(fbmmx,fbmmx.c,$(MMXOPTIONS)) -SpecialCObjectRule(fbpict,fbpict.c,$(USEMMXOPTIONS)) -SpecialCObjectRule(fbfill,fbfill.c,$(USEMMXOPTIONS)) -SpecialCObjectRule(fbcopy,fbcopy.c,$(USEMMXOPTIONS)) -#endif - -#endif - -#if DoLoadableServer -#if !BuildModuleInSubdir -#define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif -#endif - -#include - -#ifdef FbNoPixelAddrCode -DEFINES=-DFBNOPIXADDR -DFBNO24BIT -#endif - -#if defined(IHaveModules) -XFMODSRC = fbmodule.c -XFMODOBJ = fbmodule.o -#endif - -#if BuildRender -RENDERSRC = fbcompose.c -RENDEROBJ = fbcompose.o -#endif - -SRCS = $(XFMODSRC) \ - fballpriv.c \ - fbbits.c \ - fbblt.c \ - fbbltone.c \ - fbbstore.c \ - fbcmap.c \ - $(RENDERSRC) \ - fbcopy.c \ - fbedge.c \ - fbfill.c \ - fbfillrect.c \ - fbfillsp.c \ - fbgc.c \ - fbgetsp.c \ - fbglyph.c \ - fbimage.c \ - fbline.c \ - fboverlay.c \ - fbpixmap.c \ - fbpoint.c \ - fbpush.c \ - fbscreen.c \ - fbseg.c \ - fbsetsp.c \ - fbsolid.c \ - fbstipple.c \ - fbtile.c \ - fbtrap.c \ - fbutil.c \ - fbwindow.c \ - fb24_32.c \ - fbpict.c \ - fbmmx.c \ - fbpseudocolor.c - -OBJS = $(XFMODOBJ) \ - fbarc.o \ - fballpriv.o \ - fbbits.o \ - fbblt.o \ - fbbltone.o \ - fbbstore.o \ - fbcmap.o \ - $(RENDEROBJ) \ - fbcopy.o \ - fbedge.o \ - fbfill.o \ - fbfillrect.o \ - fbfillsp.o \ - fbgc.o \ - fbgetsp.o \ - fbglyph.o \ - fbimage.o \ - fbline.o \ - fboverlay.o \ - fbpixmap.o \ - fbpoint.o \ - fbpush.o \ - fbscreen.o \ - fbseg.o \ - fbsetsp.o \ - fbsolid.o \ - fbstipple.o \ - fbtile.o \ - fbtrap.o \ - fbutil.o \ - fbwindow.o \ - fb24_32.o \ - fbpict.o \ - fbmmx.o \ - fbpseudocolor.o - - INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I$(XF86SRC)/common $(EXTRAINCLUDES) \ - -I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext - LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ - $(SERVERSRC)/mi/llib-lmi.ln - -#ifdef IHaveModules -ModuleObjectRule() -LibraryModuleTarget(fb,$(OBJS)) -#else -NormalLibraryObjectRule() -NormalLibraryTarget(fb,$(OBJS)) -#endif - -LintLibraryTarget(fb,$(SRCS)) - -NormalLintTarget($(SRCS)) - -#ifdef IHaveModules -InstallLibraryModule(fb,$(MODULEDIR),.) -#endif - -DependTarget() - -#ifdef IHaveSubdirs -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -#ifdef LinkDirectory -LinkSourceFile(fb24_32.c,LinkDirectory) -LinkSourceFile(fballpriv.c,LinkDirectory) -LinkSourceFile(fbarc.c,LinkDirectory) -LinkSourceFile(fbbits.c,LinkDirectory) -LinkSourceFile(fbblt.c,LinkDirectory) -LinkSourceFile(fbbltone.c,LinkDirectory) -LinkSourceFile(fbbstore.c,LinkDirectory) -LinkSourceFile(fbcmap.c,LinkDirectory) -#if BuildRender -LinkSourceFile(fbcompose.c,LinkDirectory) -#endif -LinkSourceFile(fbcopy.c,LinkDirectory) -LinkSourceFile(fbfill.c,LinkDirectory) -LinkSourceFile(fbfillrect.c,LinkDirectory) -LinkSourceFile(fbfillsp.c,LinkDirectory) -LinkSourceFile(fbgc.c,LinkDirectory) -LinkSourceFile(fbgetsp.c,LinkDirectory) -LinkSourceFile(fbglyph.c,LinkDirectory) -LinkSourceFile(fbimage.c,LinkDirectory) -LinkSourceFile(fbline.c,LinkDirectory) -LinkSourceFile(fbmodule.c,LinkDirectory) -LinkSourceFile(fboverlay.c,LinkDirectory) -LinkSourceFile(fbpict.c,LinkDirectory) -LinkSourceFile(fbpixmap.c,LinkDirectory) -LinkSourceFile(fbpoint.c,LinkDirectory) -LinkSourceFile(fbpush.c,LinkDirectory) -LinkSourceFile(fbscreen.c,LinkDirectory) -LinkSourceFile(fbseg.c,LinkDirectory) -LinkSourceFile(fbsetsp.c,LinkDirectory) -LinkSourceFile(fbsolid.c,LinkDirectory) -LinkSourceFile(fbstipple.c,LinkDirectory) -LinkSourceFile(fbtile.c,LinkDirectory) -LinkSourceFile(fbtrap.c,LinkDirectory) -LinkSourceFile(fbutil.c,LinkDirectory) -LinkSourceFile(fbwindow.c,LinkDirectory) -LinkSourceFile(fbmmx.c,LinkDirectory) -#endif - -InstallDriverSDKLibraryModule(fb,$(DRIVERSDKMODULEDIR),.) -InstallDriverSDKNonExecFile(fb.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(fbrop.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/fb/fbtrap.c.NX.original b/nx-X11/programs/Xserver/fb/fbtrap.c.NX.original deleted file mode 100644 index 1940bc209..000000000 --- a/nx-X11/programs/Xserver/fb/fbtrap.c.NX.original +++ /dev/null @@ -1,242 +0,0 @@ -/* - * $Id: fbtrap.c,v 1.5 2005/07/03 07:01:23 daniels Exp $ - * - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "fb.h" - -#ifdef RENDER - -#include "picturestr.h" -#include "mipict.h" -#include "renderedge.h" -#include "fbpict.h" - -void -fbAddTraps (PicturePtr pPicture, - INT16 x_off, - INT16 y_off, - int ntrap, - xTrap *traps) -{ - FbBits *buf; - int bpp; - int width; - int stride; - int height; - int pxoff, pyoff; - - xFixed x_off_fixed; - xFixed y_off_fixed; - RenderEdge l, r; - xFixed t, b; - - fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff); - - width = pPicture->pDrawable->width; - height = pPicture->pDrawable->height; - x_off += pxoff; - y_off += pyoff; - - x_off_fixed = IntToxFixed(y_off); - y_off_fixed = IntToxFixed(y_off); - - while (ntrap--) - { - t = traps->top.y + y_off_fixed; - if (t < 0) - t = 0; - t = RenderSampleCeilY (t, bpp); - - b = traps->bot.y + y_off_fixed; - if (xFixedToInt (b) >= height) - b = IntToxFixed (height) - 1; - b = RenderSampleFloorY (b, bpp); - - if (b >= t) - { - /* initialize edge walkers */ - RenderEdgeInit (&l, bpp, t, - traps->top.l + x_off_fixed, - traps->top.y + y_off_fixed, - traps->bot.l + x_off_fixed, - traps->bot.y + y_off_fixed); - - RenderEdgeInit (&r, bpp, t, - traps->top.r + x_off_fixed, - traps->top.y + y_off_fixed, - traps->bot.r + x_off_fixed, - traps->bot.y + y_off_fixed); - - fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b); - } - traps++; - } -} - -void -fbRasterizeTrapezoid (PicturePtr pPicture, - xTrapezoid *trap, - int x_off, - int y_off) -{ - FbBits *buf; - int bpp; - int width; - int stride; - int height; - int pxoff, pyoff; - - xFixed x_off_fixed; - xFixed y_off_fixed; - RenderEdge l, r; - xFixed t, b; - - if (!xTrapezoidValid (trap)) - return; - - fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff); - - width = pPicture->pDrawable->width; - height = pPicture->pDrawable->height; - x_off += pxoff; - y_off += pyoff; - - x_off_fixed = IntToxFixed(x_off); - y_off_fixed = IntToxFixed(y_off); - t = trap->top + y_off_fixed; - if (t < 0) - t = 0; - t = RenderSampleCeilY (t, bpp); - - b = trap->bottom + y_off_fixed; - if (xFixedToInt (b) >= height) - b = IntToxFixed (height) - 1; - b = RenderSampleFloorY (b, bpp); - - if (b >= t) - { - /* initialize edge walkers */ - RenderLineFixedEdgeInit (&l, bpp, t, &trap->left, x_off, y_off); - RenderLineFixedEdgeInit (&r, bpp, t, &trap->right, x_off, y_off); - - fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b); - } -} - -static int -_GreaterY (xPointFixed *a, xPointFixed *b) -{ - if (a->y == b->y) - return a->x > b->x; - return a->y > b->y; -} - -/* - * Note that the definition of this function is a bit odd because - * of the X coordinate space (y increasing downwards). - */ -static int -_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b) -{ - xPointFixed ad, bd; - - ad.x = a->x - ref->x; - ad.y = a->y - ref->y; - bd.x = b->x - ref->x; - bd.y = b->y - ref->y; - - return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0; -} - -/* FIXME -- this could be made more efficient */ -void -fbAddTriangles (PicturePtr pPicture, - INT16 x_off, - INT16 y_off, - int ntri, - xTriangle *tris) -{ - xPointFixed *top, *left, *right, *tmp; - xTrapezoid trap; - - for (; ntri; ntri--, tris++) - { - top = &tris->p1; - left = &tris->p2; - right = &tris->p3; - if (_GreaterY (top, left)) { - tmp = left; left = top; top = tmp; - } - if (_GreaterY (top, right)) { - tmp = right; right = top; top = tmp; - } - if (_Clockwise (top, right, left)) { - tmp = right; right = left; left = tmp; - } - - /* - * Two cases: - * - * + + - * / \ / \ - * / \ / \ - * / + + \ - * / -- -- \ - * / -- -- \ - * / --- --- \ - * +-- --+ - */ - - trap.top = top->y; - trap.left.p1 = *top; - trap.left.p2 = *left; - trap.right.p1 = *top; - trap.right.p2 = *right; - if (right->y < left->y) - trap.bottom = right->y; - else - trap.bottom = left->y; - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); - if (right->y < left->y) - { - trap.top = right->y; - trap.bottom = left->y; - trap.right.p1 = *right; - trap.right.p2 = *left; - } - else - { - trap.top = left->y; - trap.bottom = right->y; - trap.left.p1 = *left; - trap.left.p2 = *right; - } - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); - } -} - -#endif /* RENDER */ diff --git a/nx-X11/programs/Xserver/fb/fbtrap.c.X.original b/nx-X11/programs/Xserver/fb/fbtrap.c.X.original deleted file mode 100644 index 39483d8cd..000000000 --- a/nx-X11/programs/Xserver/fb/fbtrap.c.X.original +++ /dev/null @@ -1,239 +0,0 @@ -/* - * $Id: fbtrap.c,v 1.5 2005/07/03 07:01:23 daniels Exp $ - * - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "fb.h" - -#ifdef RENDER - -#include "picturestr.h" -#include "mipict.h" -#include "renderedge.h" -#include "fbpict.h" - -void -fbAddTraps (PicturePtr pPicture, - INT16 x_off, - INT16 y_off, - int ntrap, - xTrap *traps) -{ - FbBits *buf; - int bpp; - int width; - int stride; - int height; - int pxoff, pyoff; - - xFixed x_off_fixed; - xFixed y_off_fixed; - RenderEdge l, r; - xFixed t, b; - - fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff); - - width = pPicture->pDrawable->width; - height = pPicture->pDrawable->height; - x_off += pxoff; - y_off += pyoff; - - x_off_fixed = IntToxFixed(y_off); - y_off_fixed = IntToxFixed(y_off); - - while (ntrap--) - { - t = traps->top.y + y_off_fixed; - if (t < 0) - t = 0; - t = RenderSampleCeilY (t, bpp); - - b = traps->bot.y + y_off_fixed; - if (xFixedToInt (b) >= height) - b = IntToxFixed (height) - 1; - b = RenderSampleFloorY (b, bpp); - - if (b >= t) - { - /* initialize edge walkers */ - RenderEdgeInit (&l, bpp, t, - traps->top.l + x_off_fixed, - traps->top.y + y_off_fixed, - traps->bot.l + x_off_fixed, - traps->bot.y + y_off_fixed); - - RenderEdgeInit (&r, bpp, t, - traps->top.r + x_off_fixed, - traps->top.y + y_off_fixed, - traps->bot.r + x_off_fixed, - traps->bot.y + y_off_fixed); - - fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b); - } - traps++; - } -} - -void -fbRasterizeTrapezoid (PicturePtr pPicture, - xTrapezoid *trap, - int x_off, - int y_off) -{ - FbBits *buf; - int bpp; - int width; - int stride; - int height; - int pxoff, pyoff; - - xFixed x_off_fixed; - xFixed y_off_fixed; - RenderEdge l, r; - xFixed t, b; - - fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff); - - width = pPicture->pDrawable->width; - height = pPicture->pDrawable->height; - x_off += pxoff; - y_off += pyoff; - - x_off_fixed = IntToxFixed(x_off); - y_off_fixed = IntToxFixed(y_off); - t = trap->top + y_off_fixed; - if (t < 0) - t = 0; - t = RenderSampleCeilY (t, bpp); - - b = trap->bottom + y_off_fixed; - if (xFixedToInt (b) >= height) - b = IntToxFixed (height) - 1; - b = RenderSampleFloorY (b, bpp); - - if (b >= t) - { - /* initialize edge walkers */ - RenderLineFixedEdgeInit (&l, bpp, t, &trap->left, x_off, y_off); - RenderLineFixedEdgeInit (&r, bpp, t, &trap->right, x_off, y_off); - - fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b); - } -} - -static int -_GreaterY (xPointFixed *a, xPointFixed *b) -{ - if (a->y == b->y) - return a->x > b->x; - return a->y > b->y; -} - -/* - * Note that the definition of this function is a bit odd because - * of the X coordinate space (y increasing downwards). - */ -static int -_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b) -{ - xPointFixed ad, bd; - - ad.x = a->x - ref->x; - ad.y = a->y - ref->y; - bd.x = b->x - ref->x; - bd.y = b->y - ref->y; - - return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0; -} - -/* FIXME -- this could be made more efficient */ -void -fbAddTriangles (PicturePtr pPicture, - INT16 x_off, - INT16 y_off, - int ntri, - xTriangle *tris) -{ - xPointFixed *top, *left, *right, *tmp; - xTrapezoid trap; - - for (; ntri; ntri--, tris++) - { - top = &tris->p1; - left = &tris->p2; - right = &tris->p3; - if (_GreaterY (top, left)) { - tmp = left; left = top; top = tmp; - } - if (_GreaterY (top, right)) { - tmp = right; right = top; top = tmp; - } - if (_Clockwise (top, right, left)) { - tmp = right; right = left; left = tmp; - } - - /* - * Two cases: - * - * + + - * / \ / \ - * / \ / \ - * / + + \ - * / -- -- \ - * / -- -- \ - * / --- --- \ - * +-- --+ - */ - - trap.top = top->y; - trap.left.p1 = *top; - trap.left.p2 = *left; - trap.right.p1 = *top; - trap.right.p2 = *right; - if (right->y < left->y) - trap.bottom = right->y; - else - trap.bottom = left->y; - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); - if (right->y < left->y) - { - trap.top = right->y; - trap.bottom = left->y; - trap.right.p1 = *right; - trap.right.p2 = *left; - } - else - { - trap.top = left->y; - trap.bottom = right->y; - trap.left.p1 = *left; - trap.left.p2 = *right; - } - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); - } -} - -#endif /* RENDER */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original deleted file mode 100644 index 4f59b8098..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original +++ /dev/null @@ -1,4716 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXdispatch.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ -/************************************************************ - -Copyright 1987, 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* The panoramix components contained the following notice */ -/**************************************************************** -* * -* Copyright (c) Digital Equipment Corporation, 1991, 1997 * -* * -* All Rights Reserved. Unpublished rights reserved under * -* the copyright laws of the United States. * -* * -* The software contained on this media is proprietary to * -* and embodies the confidential technology of Digital * -* Equipment Corporation. Possession, use, duplication or * -* dissemination of the software and media is authorized only * -* pursuant to a valid written license from Digital Equipment * -* Corporation. * -* * -* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure * -* by the U.S. Government is subject to restrictions as set * -* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, * -* or in FAR 52.227-19, as applicable. * -* * -*****************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.29 2003/01/12 02:44:26 dawes Exp $ */ - -#ifdef PANORAMIX_DEBUG -#include -int ProcInitialConnection(); -#endif - -#ifdef __sun -#define False 0 -#define True 1 -#endif - -#define GC XlibGC -#include -#undef GC - -#include "windowstr.h" -#include "fontstruct.h" -#include "dixfontstr.h" -#include "gcstruct.h" -#include "selection.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "opaque.h" -#include "input.h" -#include "servermd.h" -#include "extnsionst.h" -#include "dixfont.h" -#include "../../dix/dispatch.h" -#include "swaprep.h" -#include "swapreq.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif -#ifdef XAPPGROUP -#include "Xagsrv.h" -#endif -#ifdef XKB -#define XKB_IN_SERVER -#include "inputstr.h" -#include "XKBsrv.h" -#endif - -#include "Atoms.h" -#include "Splash.h" -#include "Client.h" -#include "Clipboard.h" -#include "Reconnect.h" -#include "Millis.h" -#include "Font.h" -#include "Shadow.h" -#include "Handlers.h" - -const int nxagentMaxFontNames = 10000; - -char dispatchExceptionAtReset = DE_RESET; - -/* - * This allows the agent to exit if no - * client is connected within a timeout. -*/ - -int nxagentClients = 0; - -void nxagentWaitDisplay(void); - -void nxagentListRemoteFonts(const char *, int); - -unsigned int nxagentWMtimeout = 0; -Bool nxagentWMPassed = 0; - -/* - * Timeouts based on screen saver time. - */ - -int nxagentAutoDisconnectTimeout = 0; - -#ifdef LBX -#include "../../lbx/lbxserve.h" -#endif - -#include "Xatom.h" - -/* - * Set here the required log level. - */ - -#define PANIC -#define WARNING -#undef TEST -#undef WATCH - -/* - * Log begin and end of the important handlers. - */ - -#undef BLOCKS - -#ifdef WATCH -#include "unistd.h" -#endif - -#ifdef TEST -#include "Literals.h" -#endif - -#define mskcnt ((MAXCLIENTS + 31) / 32) -#define BITMASK(i) (1U << ((i) & 31)) -#define MASKIDX(i) ((i) >> 5) -#define MASKWORD(buf, i) buf[MASKIDX(i)] -#define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i) -#define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i) -#define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i)) - -extern xConnSetupPrefix connSetupPrefix; -extern char *ConnectionInfo; - -Selection *CurrentSelections; -int NumCurrentSelections; - -extern WindowPtr nxagentViewportFrameLeft; -extern WindowPtr nxagentViewportFrameRight; -extern WindowPtr nxagentViewportFrameAbove; -extern WindowPtr nxagentViewportFrameBelow; - -#define IsViewportFrame(pWin) ((pWin) == nxagentViewportFrameLeft || \ - (pWin) == nxagentViewportFrameRight || \ - (pWin) == nxagentViewportFrameAbove || \ - (pWin) == nxagentViewportFrameBelow) - -extern int nxagentMaxAllowedResets; - -extern int nxagentFindClientResource(int, RESTYPE, pointer); - -static ClientPtr grabClient; -#define GrabNone 0 -#define GrabActive 1 -#define GrabKickout 2 -static int grabState = GrabNone; -static long grabWaiters[mskcnt]; -CallbackListPtr ServerGrabCallback = NULL; -HWEventQueuePtr checkForInput[2]; -extern int connBlockScreenStart; - -static void KillAllClients( -#if NeedFunctionPrototypes - void -#endif -); - -static void DeleteClientFromAnySelections( -#if NeedFunctionPrototypes - ClientPtr /*client*/ -#endif -); - -static int nextFreeClientID; /* always MIN free client ID */ - -static int nClients; /* number of authorized clients */ - -CallbackListPtr ClientStateCallback; -char dispatchException = 0; -char isItTimeToYield; - -/* Various of the DIX function interfaces were not designed to allow - * the client->errorValue to be set on BadValue and other errors. - * Rather than changing interfaces and breaking untold code we introduce - * a new global that dispatch can use. - */ -XID clientErrorValue; /* XXX this is a kludge */ - -#define SAME_SCREENS(a, b) (\ - (a.pScreen == b.pScreen)) - -void -SetInputCheck(c0, c1) - HWEventQueuePtr c0, c1; -{ - checkForInput[0] = c0; - checkForInput[1] = c1; -} - -void -UpdateCurrentTime() -{ - TimeStamp systime; - - /* To avoid time running backwards, we must call GetTimeInMillis before - * calling ProcessInputEvents. - */ - systime.months = currentTime.months; - systime.milliseconds = GetTimeInMillis(); - if (systime.milliseconds < currentTime.milliseconds) - systime.months++; - if (*checkForInput[0] != *checkForInput[1]) - ProcessInputEvents(); - if (CompareTimeStamps(systime, currentTime) == LATER) - currentTime = systime; -} - -/* Like UpdateCurrentTime, but can't call ProcessInputEvents */ -void -UpdateCurrentTimeIf() -{ - TimeStamp systime; - - systime.months = currentTime.months; - systime.milliseconds = GetTimeInMillis(); - if (systime.milliseconds < currentTime.milliseconds) - systime.months++; - if (*checkForInput[0] == *checkForInput[1]) - currentTime = systime; -} - -void -InitSelections() -{ - if (CurrentSelections) - xfree(CurrentSelections); - CurrentSelections = (Selection *)NULL; - NumCurrentSelections = 0; - -#ifdef NXAGENT_CLIPBOARD - { - Selection *newsels; - newsels = (Selection *)xalloc(2 * sizeof(Selection)); - if (!newsels) - return; - NumCurrentSelections += 2; - CurrentSelections = newsels; - - CurrentSelections[0].selection = XA_PRIMARY; - CurrentSelections[0].lastTimeChanged = ClientTimeToServerTime(0); - CurrentSelections[0].window = WindowTable[0]->drawable.id; - CurrentSelections[0].pWin = NULL; - CurrentSelections[0].client = NullClient; - - CurrentSelections[1].selection = MakeAtom("CLIPBOARD", 9, 1); - CurrentSelections[1].lastTimeChanged = ClientTimeToServerTime(0); - CurrentSelections[1].window = WindowTable[0]->drawable.id; - CurrentSelections[1].pWin = NULL; - CurrentSelections[1].client = NullClient; - } -#endif - -} - -void -FlushClientCaches(id) - XID id; -{ - int i; - register ClientPtr client; - - client = clients[CLIENT_ID(id)]; - if (client == NullClient) - return ; - for (i=0; ilastDrawableID == id) - { - client->lastDrawableID = WindowTable[0]->drawable.id; - client->lastDrawable = (DrawablePtr)WindowTable[0]; - } - else if (client->lastGCID == id) - { - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } - } - } -} -#ifdef SMART_SCHEDULE - -#undef SMART_DEBUG - -#define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ -#define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ - -/* - * Disable the SmartScheduler as it doesn't - * seem to work for us. - */ - -Bool SmartScheduleDisable = True; - -long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; -long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; -long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; -long SmartScheduleTime; -ClientPtr SmartLastClient; -int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1]; -int SmartScheduleClient(int *clientReady, int nready); - -#ifdef SMART_DEBUG -long SmartLastPrint; -#endif - -void Dispatch(void); -void InitProcVectors(void); - -int -SmartScheduleClient (int *clientReady, int nready) -{ - ClientPtr pClient; - int i; - int client; - int bestPrio, best = 0; - int bestRobin, robin; - long now = SmartScheduleTime; - long idle; - - bestPrio = -0x7fffffff; - bestRobin = 0; - idle = 2 * SmartScheduleSlice; - for (i = 0; i < nready; i++) - { - client = clientReady[i]; - pClient = clients[client]; - /* Praise clients which are idle */ - if ((now - pClient->smart_check_tick) >= idle) - { - if (pClient->smart_priority < 0) - pClient->smart_priority++; - } - pClient->smart_check_tick = now; - - /* check priority to select best client */ - robin = (pClient->index - SmartLastIndex[pClient->smart_priority-SMART_MIN_PRIORITY]) & 0xff; - if (pClient->smart_priority > bestPrio || - (pClient->smart_priority == bestPrio && robin > bestRobin)) - { - bestPrio = pClient->smart_priority; - bestRobin = robin; - best = client; - } -#ifdef SMART_DEBUG - if ((now - SmartLastPrint) >= 5000) - fprintf (stderr, " %2d: %3d", client, pClient->smart_priority); -#endif - } -#ifdef SMART_DEBUG - if ((now - SmartLastPrint) >= 5000) - { - fprintf (stderr, " use %2d\n", best); - SmartLastPrint = now; - } -#endif - pClient = clients[best]; - SmartLastIndex[bestPrio-SMART_MIN_PRIORITY] = pClient->index; - /* - * Set current client pointer - */ - if (SmartLastClient != pClient) - { - pClient->smart_start_tick = now; - SmartLastClient = pClient; - } - /* - * Adjust slice - */ - if (nready == 1) - { - /* - * If it's been a long time since another client - * has run, bump the slice up to get maximal - * performance from a single client - */ - if ((now - pClient->smart_start_tick) > 1000 && - SmartScheduleSlice < SmartScheduleMaxSlice) - { - SmartScheduleSlice += SmartScheduleInterval; - } - } - else - { - SmartScheduleSlice = SmartScheduleInterval; - } - return best; -} -#endif - -#define MAJOROP ((xReq *)client->requestBuffer)->reqType - -void -Dispatch(void) -{ - register int *clientReady; /* array of request ready clients */ - register int result; - register ClientPtr client; - register int nready; - register HWEventQueuePtr* icheck = checkForInput; -#ifdef SMART_SCHEDULE - int start_tick; -#endif - - unsigned long currentDispatch = 0; - - nextFreeClientID = 1; - InitSelections(); - nClients = 0; - - /* - * The agent initialization was successfully - * completed. We can now handle our clients. - */ - - if (serverGeneration > nxagentMaxAllowedResets) - { - fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString()); - - nxagentSessionState = SESSION_UP; - } - -#ifdef NXAGENT_ONSTART - - /* - * Set NX_WM property (used by NX client to identify - * the agent's window) three seconds since the first - * client connects. - */ - - nxagentWMtimeout = GetTimeInMillis() + 3000; - -#endif - - clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients); - if (!clientReady) - return; - - #ifdef WATCH - - fprintf(stderr, "Dispatch: Watchpoint 12.\n"); - -/* -Reply Total Cached Bits In Bits Out Bits/Reply Ratio -------- ----- ------ ------- -------- ---------- ----- -#3 1 352 bits (0 KB) -> 236 bits (0 KB) -> 352/1 -> 236/1 = 1.492:1 -#14 1 256 bits (0 KB) -> 101 bits (0 KB) -> 256/1 -> 101/1 = 2.535:1 -#16 1 256 bits (0 KB) -> 26 bits (0 KB) -> 256/1 -> 26/1 = 9.846:1 -#20 2 2 12256 bits (1 KB) -> 56 bits (0 KB) -> 6128/1 -> 28/1 = 218.857:1 -#43 1 256 bits (0 KB) -> 45 bits (0 KB) -> 256/1 -> 45/1 = 5.689:1 -#47 2 2 42304 bits (5 KB) -> 49 bits (0 KB) -> 21152/1 -> 24/1 = 863.347:1 -#98 1 256 bits (0 KB) -> 34 bits (0 KB) -> 256/1 -> 34/1 = 7.529:1 -*/ - - sleep(30); - - #endif - - #ifdef TEST - fprintf(stderr, "Dispatch: Value of dispatchException is [%x].\n", - dispatchException); - - fprintf(stderr, "Dispatch: Value of dispatchExceptionAtReset is [%x].\n", - dispatchExceptionAtReset); - #endif - - if (!(dispatchException & DE_TERMINATE)) - dispatchException = 0; - - while (!dispatchException) - { - if (*icheck[0] != *icheck[1]) - { - ProcessInputEvents(); - FlushIfCriticalOutputPending(); - } - - /* - * Ensure we remove the splash after the timeout. - * Initializing clientReady[0] to -1 will tell - * WaitForSomething() to yield control after the - * timeout set in clientReady[1]. - */ - - clientReady[0] = 0; - - if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)) - { - #ifdef TEST - fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", - NXAGENT_WAKEUP); - #endif - - clientReady[0] = -1; - clientReady[1] = NXAGENT_WAKEUP; - } - - #ifdef BLOCKS - fprintf(stderr, "[End dispatch]\n"); - #endif - - nready = WaitForSomething(clientReady); - - #ifdef BLOCKS - fprintf(stderr, "[Begin dispatch]\n"); - #endif - - #ifdef TEST - fprintf(stderr, "******Dispatch: Running with [%d] clients ready.\n", - nready); - #endif - - #ifdef NXAGENT_ONSTART - - currentDispatch = GetTimeInMillis(); - - /* - * If the timeout is expired set the - * selection informing the NX client - * that the agent is ready. - */ - - if (!nxagentWMPassed && (nxagentWMtimeout < currentDispatch)) - { - nxagentRemoveSplashWindow(NULL); - } - - nxagentClients = nClients; - - #endif - -#ifdef SMART_SCHEDULE - if (nready && !SmartScheduleDisable) - { - clientReady[0] = SmartScheduleClient (clientReady, nready); - nready = 1; - } -#endif - /***************** - * Handle events in round robin fashion, doing input between - * each round - *****************/ - - while (!dispatchException && (--nready >= 0)) - { - client = clients[clientReady[nready]]; - if (! client) - { - /* KillClient can cause this to happen */ - continue; - } - /* GrabServer activation can cause this to be true */ - if (grabState == GrabKickout) - { - grabState = GrabActive; - break; - } - isItTimeToYield = FALSE; - - requestingClient = client; -#ifdef SMART_SCHEDULE - start_tick = SmartScheduleTime; -#endif - while (!isItTimeToYield) - { - if (*icheck[0] != *icheck[1]) - { - ProcessInputEvents(); - FlushIfCriticalOutputPending(); - } -#ifdef SMART_SCHEDULE - if (!SmartScheduleDisable && - (SmartScheduleTime - start_tick) >= SmartScheduleSlice) - { - /* Penalize clients which consume ticks */ - if (client->smart_priority > SMART_MIN_PRIORITY) - client->smart_priority--; - break; - } -#endif - /* now, finally, deal with client requests */ - - #ifdef TEST - fprintf(stderr, "******Dispatch: Reading request from client [%d].\n", - client->index); - #endif - - result = ReadRequestFromClient(client); - if (result <= 0) - { - if (result < 0) - CloseDownClient(client); - break; - } -#ifdef NXAGENT_SERVER - - #ifdef TEST - - else - { - if (MAJOROP > 127) - { - fprintf(stderr, "******Dispatch: Read [Extension] request OPCODE#%d MINOR#%d " - "size [%d] client [%d].\n", MAJOROP, *((char *) client->requestBuffer + 1), - client->req_len << 2, client->index); - } - else - { - fprintf(stderr, "******Dispatch: Read [%s] request OPCODE#%d size [%d] client [%d].\n", - nxagentRequestLiteral[MAJOROP], MAJOROP, client->req_len << 2, - client->index); - } - } - - #endif -#endif - - client->sequence++; -#ifdef DEBUG - if (client->requestLogIndex == MAX_REQUEST_LOG) - client->requestLogIndex = 0; - client->requestLog[client->requestLogIndex] = MAJOROP; - client->requestLogIndex++; -#endif - if (result > (MAX_BIG_REQUEST_SIZE << 2)) - result = BadLength; - else -#ifdef NXAGENT_SERVER - { - result = (* client->requestVector[MAJOROP])(client); - - #ifdef TEST - - if (MAJOROP > 127) - { - fprintf(stderr, "******Dispatch: Handled [Extension] request OPCODE#%d MINOR#%d " - "size [%d] client [%d] result [%d].\n", MAJOROP, - *((char *) client->requestBuffer + 1), client->req_len << 2, - client->index, result); - } - else - { - fprintf(stderr, "******Dispatch: Handled [%s] request OPCODE#%d size [%d] client [%d] " - "result [%d].\n", nxagentRequestLiteral[MAJOROP], MAJOROP, - client->req_len << 2, client->index, result); - } - - #endif - - /* - * Can set isItTimeToYield to force - * the dispatcher to pay attention - * to another client. - */ - - nxagentDispatchHandler(client, client->req_len << 2, 0); - } -#else - result = (* client->requestVector[MAJOROP])(client); -#endif - - if (result != Success) - { - if (client->noClientException != Success) - CloseDownClient(client); - else - SendErrorToClient(client, MAJOROP, - MinorOpcodeOfRequest(client), - client->errorValue, result); - break; - } - } - FlushAllOutput(); -#ifdef SMART_SCHEDULE - client = clients[clientReady[nready]]; - if (client) - client->smart_stop_tick = SmartScheduleTime; -#endif - requestingClient = NULL; - } - dispatchException &= ~DE_PRIORITYCHANGE; - } - - if ((dispatchException & DE_RESET) && - (serverGeneration > nxagentMaxAllowedResets)) - { - dispatchException &= ~DE_RESET; - dispatchException |= DE_TERMINATE; - - fprintf(stderr, "Info: Reached threshold of maximum allowed resets.\n"); - } - - nxagentResetAtomMap(); - - if (serverGeneration > nxagentMaxAllowedResets) - { - /* - * The session is terminating. Force an I/O - * error on the display and wait until the - * NX transport is gone. - */ - - fprintf(stderr, "Session: Terminating session at '%s'.\n", GetTimeAsString()); - - nxagentWaitDisplay(); - - fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString()); - } - - if (nxagentOption(Shadow)) - { - NXShadowDestroy(); - } - - KillAllClients(); - DEALLOCATE_LOCAL(clientReady); - dispatchException &= ~DE_RESET; -} - -#undef MAJOROP - -/*ARGSUSED*/ -int -ProcBadRequest(client) - ClientPtr client; -{ - return (BadRequest); -} - -int -ProcCreateWindow(client) - register ClientPtr client; -{ - register WindowPtr pParent, pWin; - REQUEST(xCreateWindowReq); - int result; - int len; - - REQUEST_AT_LEAST_SIZE(xCreateWindowReq); - - LEGAL_NEW_RESOURCE(stuff->wid, client); - if (!(pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess))) - return BadWindow; - len = client->req_len - (sizeof(xCreateWindowReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - pWin = CreateWindow(stuff->wid, pParent, stuff->x, - stuff->y, stuff->width, stuff->height, - stuff->borderWidth, stuff->class, - stuff->mask, (XID *) &stuff[1], - (int)stuff->depth, - client, stuff->visual, &result); - if (pWin) - { - Mask mask = pWin->eventMask; - - pWin->eventMask = 0; /* subterfuge in case AddResource fails */ - if (!AddResource(stuff->wid, RT_WINDOW, (pointer)pWin)) - return BadAlloc; - pWin->eventMask = mask; - } - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcChangeWindowAttributes(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xChangeWindowAttributesReq); - register int result; - int len; - - REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2); - if (len != Ones(stuff->valueMask)) - return BadLength; - result = ChangeWindowAttributes(pWin, - stuff->valueMask, - (XID *) &stuff[1], - client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcGetWindowAttributes(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - xGetWindowAttributesReply wa; - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - GetWindowAttributes(pWin, client, &wa); - WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa); - return(client->noClientException); -} - -int -ProcDestroyWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); - if (!pWin) - return(BadWindow); - if (pWin->parent) - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); -} - -int -ProcDestroySubwindows(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); - if (!pWin) - return(BadWindow); - DestroySubwindows(pWin, client); - return(client->noClientException); -} - -int -ProcChangeSaveSet(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xChangeSaveSetReq); - register int result; - - REQUEST_SIZE_MATCH(xChangeSaveSetReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) - return BadMatch; - if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete)) - { - result = AlterSaveSetForClient(client, pWin, stuff->mode); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - { - client->errorValue = stuff->mode; - return( BadValue ); - } -} - -int -ProcReparentWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin, pParent; - REQUEST(xReparentWindowReq); - register int result; - - REQUEST_SIZE_MATCH(xReparentWindowReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - - if (!nxagentWMPassed) - { - nxagentRemoveSplashWindow(pWin); - } - - pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess); - if (!pParent) - return(BadWindow); - if (SAME_SCREENS(pWin->drawable, pParent->drawable)) - { - if ((pWin->backgroundState == ParentRelative) && - (pParent->drawable.depth != pWin->drawable.depth)) - return BadMatch; - if ((pWin->drawable.class != InputOnly) && - (pParent->drawable.class == InputOnly)) - return BadMatch; - result = ReparentWindow(pWin, pParent, - (short)stuff->x, (short)stuff->y, client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - return (BadMatch); -} - -int -ProcMapWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - MapWindow(pWin, client); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcMapSubwindows(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - MapSubwindows(pWin, client); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcUnmapWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - UnmapWindow(pWin, FALSE); - /* update cache to say it is mapped */ - - return(client->noClientException); -} - -int -ProcUnmapSubwindows(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - UnmapSubwindows(pWin); - return(client->noClientException); -} - -int -ProcConfigureWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xConfigureWindowReq); - register int result; - int len; - - REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - len = client->req_len - (sizeof(xConfigureWindowReq) >> 2); - if (Ones((Mask)stuff->mask) != len) - return BadLength; - result = ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1], - client); - - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcCirculateWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xCirculateWindowReq); - - REQUEST_SIZE_MATCH(xCirculateWindowReq); - if ((stuff->direction != RaiseLowest) && - (stuff->direction != LowerHighest)) - { - client->errorValue = stuff->direction; - return BadValue; - } - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - CirculateWindow(pWin, (int)stuff->direction, client); - return(client->noClientException); -} - -int -GetGeometry(client, rep) - register ClientPtr client; - xGetGeometryReply *rep; -{ - register DrawablePtr pDraw; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, SecurityReadAccess); - rep->type = X_Reply; - rep->length = 0; - rep->sequenceNumber = client->sequence; - rep->root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - rep->depth = pDraw->depth; - rep->width = pDraw->width; - rep->height = pDraw->height; - - /* XXX - Because the pixmap-implementation of the multibuffer extension - * may have the buffer-id's drawable resource value be a pointer - * to the buffer's window instead of the buffer itself - * (this happens if the buffer is the displayed buffer), - * we also have to check that the id matches before we can - * truly say that it is a DRAWABLE_WINDOW. - */ - - if ((pDraw->type == UNDRAWABLE_WINDOW) || - ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id))) - { - register WindowPtr pWin = (WindowPtr)pDraw; - rep->x = pWin->origin.x - wBorderWidth (pWin); - rep->y = pWin->origin.y - wBorderWidth (pWin); - rep->borderWidth = pWin->borderWidth; - } - else /* DRAWABLE_PIXMAP or DRAWABLE_BUFFER */ - { - rep->x = rep->y = rep->borderWidth = 0; - } - - return Success; -} - - -int -ProcGetGeometry(client) - register ClientPtr client; -{ - xGetGeometryReply rep; - int status; - - if ((status = GetGeometry(client, &rep)) != Success) - return status; - - WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); - return(client->noClientException); -} - - -int -ProcQueryTree(client) - register ClientPtr client; -{ - xQueryTreeReply reply; - int numChildren = 0; - register WindowPtr pChild, pWin, pHead; - Window *childIDs = (Window *)NULL; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - reply.type = X_Reply; - reply.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - reply.sequenceNumber = client->sequence; - if (pWin->parent) - reply.parent = pWin->parent->drawable.id; - else - reply.parent = (Window)None; - pHead = RealChildHead(pWin); - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - { - if (!IsViewportFrame(pChild)) - { - numChildren++; - } - } - if (numChildren) - { - int curChild = 0; - - childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window)); - if (!childIDs) - return BadAlloc; - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - { - if (!IsViewportFrame(pChild)) - { - childIDs[curChild++] = pChild->drawable.id; - } - } - } - - reply.nChildren = numChildren; - reply.length = (numChildren * sizeof(Window)) >> 2; - - WriteReplyToClient(client, sizeof(xQueryTreeReply), &reply); - if (numChildren) - { - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs); - DEALLOCATE_LOCAL(childIDs); - } - - return(client->noClientException); -} - -int -ProcInternAtom(client) - register ClientPtr client; -{ - Atom atom; - char *tchar; - REQUEST(xInternAtomReq); - - REQUEST_FIXED_SIZE(xInternAtomReq, stuff->nbytes); - if ((stuff->onlyIfExists != xTrue) && (stuff->onlyIfExists != xFalse)) - { - client->errorValue = stuff->onlyIfExists; - return(BadValue); - } - tchar = (char *) &stuff[1]; - atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); - if (atom != BAD_RESOURCE) - { - xInternAtomReply reply; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.atom = atom; - WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); - return(client->noClientException); - } - else - return (BadAlloc); -} - -int -ProcGetAtomName(client) - register ClientPtr client; -{ - char *str; - xGetAtomNameReply reply; - int len; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - if ( (str = NameForAtom(stuff->id)) ) - { - len = strlen(str); - reply.type = X_Reply; - reply.length = (len + 3) >> 2; - reply.sequenceNumber = client->sequence; - reply.nameLength = len; - WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); - (void)WriteToClient(client, len, str); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadAtom); - } -} - -#ifdef K5AUTH -extern int k5_bad(); -#endif - -int -ProcSetSelectionOwner(client) - register ClientPtr client; -{ - WindowPtr pWin; - TimeStamp time; - REQUEST(xSetSelectionOwnerReq); - - REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); - UpdateCurrentTime(); - time = ClientTimeToServerTime(stuff->time); - - /* If the client's time stamp is in the future relative to the server's - time stamp, do not set the selection, just return success. */ - if (CompareTimeStamps(time, currentTime) == LATER) - return Success; - if (stuff->window != None) - { - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - } - else - pWin = (WindowPtr)None; - if (ValidAtom(stuff->selection)) - { - int i = 0; - - /* - * First, see if the selection is already set... - */ - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) - i++; - if (i < NumCurrentSelections) - { - xEvent event; - - /* If the timestamp in client's request is in the past relative - to the time stamp indicating the last time the owner of the - selection was set, do not set the selection, just return - success. */ - if (CompareTimeStamps(time, CurrentSelections[i].lastTimeChanged) - == EARLIER) - return Success; - if (CurrentSelections[i].client && - (!pWin || (CurrentSelections[i].client != client))) - { - event.u.u.type = SelectionClear; - event.u.selectionClear.time = time.milliseconds; - event.u.selectionClear.window = CurrentSelections[i].window; - event.u.selectionClear.atom = CurrentSelections[i].selection; - (void) TryClientEvents (CurrentSelections[i].client, &event, 1, - NoEventMask, NoEventMask /* CantBeFiltered */, - NullGrab); - } - } - else - { - /* - * It doesn't exist, so add it... - */ - Selection *newsels; - - if (i == 0) - newsels = (Selection *)xalloc(sizeof(Selection)); - else - newsels = (Selection *)xrealloc(CurrentSelections, - (NumCurrentSelections + 1) * sizeof(Selection)); - if (!newsels) - return BadAlloc; - NumCurrentSelections++; - CurrentSelections = newsels; - CurrentSelections[i].selection = stuff->selection; - } - CurrentSelections[i].lastTimeChanged = time; - CurrentSelections[i].window = stuff->window; - CurrentSelections[i].pWin = pWin; - CurrentSelections[i].client = (pWin ? client : NullClient); - -#ifdef NXAGENT_CLIPBOARD - if ((CurrentSelections[i].pWin != NULL) && - (nxagentOption(Clipboard) != ClipboardNone) && - ((CurrentSelections[i].selection == XA_PRIMARY) || - (CurrentSelections[i].selection == MakeAtom("CLIPBOARD", 9, 0)))) - { - nxagentSetSelectionOwner(&CurrentSelections[i]); - } -#endif - return (client->noClientException); - } - else - { - client->errorValue = stuff->selection; - return (BadAtom); - } -} - -int -ProcGetSelectionOwner(client) - register ClientPtr client; -{ - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - if (ValidAtom(stuff->id)) - { - int i; - xGetSelectionOwnerReply reply; - - i = 0; - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->id) i++; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - if (i < NumCurrentSelections) - reply.owner = CurrentSelections[i].window; - else - reply.owner = None; - WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadAtom); - } -} - -int -ProcConvertSelection(client) - register ClientPtr client; -{ - Bool paramsOkay; - xEvent event; - WindowPtr pWin; - REQUEST(xConvertSelectionReq); - - REQUEST_SIZE_MATCH(xConvertSelectionReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - -#ifdef NXAGENT_CLIPBOARD - if (((stuff->selection == XA_PRIMARY) || - (stuff->selection == MakeAtom("CLIPBOARD", 9, 0))) && - nxagentOption(Clipboard) != ClipboardNone) - { - int i = 0; - - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) i++; - - if ((i < NumCurrentSelections) && (CurrentSelections[i].window != None)) - { - if (nxagentConvertSelection(client, pWin, stuff->selection, stuff->requestor, - stuff->property, stuff->target, stuff->time)) - { - return (client->noClientException); - } - } - } -#endif - - paramsOkay = (ValidAtom(stuff->selection) && ValidAtom(stuff->target)); - if (stuff->property != None) - paramsOkay &= ValidAtom(stuff->property); - if (paramsOkay) - { - int i; - - i = 0; - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) i++; - if ((i < NumCurrentSelections) && - (CurrentSelections[i].window != None) && (CurrentSelections[i].client != NullClient) -#ifdef XCSECURITY - && (!client->CheckAccess || - (* client->CheckAccess)(client, CurrentSelections[i].window, - RT_WINDOW, SecurityReadAccess, - CurrentSelections[i].pWin)) -#endif - ) - { - event.u.u.type = SelectionRequest; - event.u.selectionRequest.time = stuff->time; - event.u.selectionRequest.owner = - CurrentSelections[i].window; - event.u.selectionRequest.requestor = stuff->requestor; - event.u.selectionRequest.selection = stuff->selection; - event.u.selectionRequest.target = stuff->target; - event.u.selectionRequest.property = stuff->property; - if (TryClientEvents( - CurrentSelections[i].client, &event, 1, NoEventMask, - NoEventMask /* CantBeFiltered */, NullGrab)) - return (client->noClientException); - } - event.u.u.type = SelectionNotify; - event.u.selectionNotify.time = stuff->time; - event.u.selectionNotify.requestor = stuff->requestor; - event.u.selectionNotify.selection = stuff->selection; - event.u.selectionNotify.target = stuff->target; - event.u.selectionNotify.property = None; - (void) TryClientEvents(client, &event, 1, NoEventMask, - NoEventMask /* CantBeFiltered */, NullGrab); - return (client->noClientException); - } - else - { - client->errorValue = stuff->property; - return (BadAtom); - } -} - -int -ProcGrabServer(client) - register ClientPtr client; -{ - REQUEST_SIZE_MATCH(xReq); - if (grabState != GrabNone && client != grabClient) - { - ResetCurrentRequest(client); - client->sequence--; - BITSET(grabWaiters, client->index); - IgnoreClient(client); - return(client->noClientException); - } - OnlyListenToOneClient(client); - grabState = GrabKickout; - grabClient = client; - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = SERVER_GRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); - } - - return(client->noClientException); -} - -static void -#if NeedFunctionPrototypes -UngrabServer(ClientPtr client) -#else -UngrabServer(client) - ClientPtr client; -#endif -{ - int i; - - grabState = GrabNone; - ListenToAllClients(); - for (i = mskcnt; --i >= 0 && !grabWaiters[i]; ) - ; - if (i >= 0) - { - i <<= 5; - while (!GETBIT(grabWaiters, i)) - i++; - BITCLEAR(grabWaiters, i); - AttendClient(clients[i]); - } - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = SERVER_UNGRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); - } -} - -int -ProcUngrabServer(client) - register ClientPtr client; -{ - REQUEST_SIZE_MATCH(xReq); - UngrabServer(client); - return(client->noClientException); -} - -int -ProcTranslateCoords(client) - register ClientPtr client; -{ - REQUEST(xTranslateCoordsReq); - - register WindowPtr pWin, pDst; - xTranslateCoordsReply rep; - - REQUEST_SIZE_MATCH(xTranslateCoordsReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, - SecurityReadAccess); - if (!pDst) - return(BadWindow); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (!SAME_SCREENS(pWin->drawable, pDst->drawable)) - { - rep.sameScreen = xFalse; - rep.child = None; - rep.dstX = rep.dstY = 0; - } - else - { - INT16 x, y; - rep.sameScreen = xTrue; - rep.child = None; - /* computing absolute coordinates -- adjust to destination later */ - x = pWin->drawable.x + stuff->srcX; - y = pWin->drawable.y + stuff->srcY; - pWin = pDst->firstChild; - while (pWin) - { -#ifdef SHAPE - BoxRec box; -#endif - if ((pWin->mapped) && - (x >= pWin->drawable.x - wBorderWidth (pWin)) && - (x < pWin->drawable.x + (int)pWin->drawable.width + - wBorderWidth (pWin)) && - (y >= pWin->drawable.y - wBorderWidth (pWin)) && - (y < pWin->drawable.y + (int)pWin->drawable.height + - wBorderWidth (pWin)) -#ifdef SHAPE - /* When a window is shaped, a further check - * is made to see if the point is inside - * borderSize - */ - && (!wBoundingShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - &pWin->borderSize, x, y, &box)) -#endif - ) - { - rep.child = pWin->drawable.id; - pWin = (WindowPtr) NULL; - } - else - pWin = pWin->nextSib; - } - /* adjust to destination coordinates */ - rep.dstX = x - pDst->drawable.x; - rep.dstY = y - pDst->drawable.y; - } - WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); - return(client->noClientException); -} - -int -ProcOpenFont(client) - register ClientPtr client; -{ - int err; - char fontReq[256]; - REQUEST(xOpenFontReq); - - REQUEST_FIXED_SIZE(xOpenFontReq, stuff->nbytes); - client->errorValue = stuff->fid; - LEGAL_NEW_RESOURCE(stuff->fid, client); - - memcpy(fontReq,(char *)&stuff[1],(stuff->nbytes<256)?stuff->nbytes:255); - fontReq[stuff->nbytes]=0; - if (strchr(fontReq,'*') || strchr(fontReq,'?')) - { - extern int nxOpenFont(ClientPtr, XID, Mask, unsigned, char*); -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "Dispatch: ProcOpenFont try to find a common font with font pattern=%s\n",fontReq); -#endif - nxagentListRemoteFonts(fontReq, nxagentMaxFontNames); - err = nxOpenFont(client, stuff->fid, (Mask) 0, - stuff->nbytes, (char *)&stuff[1]); - } - else - err = OpenFont(client, stuff->fid, (Mask) 0, - stuff->nbytes, (char *)&stuff[1]); - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcCloseFont(client) - register ClientPtr client; -{ - FontPtr pFont; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityDestroyAccess); - if (pFont != (FontPtr)NULL) - { - #ifdef NXAGENT_SERVER - - /* - * When a client closes a font the resource - * should not be lost if the reference counter - * is not 0, otherwise the server will not be - * able to find this font looping through the - * resources. - */ - - if (pFont -> refcnt > 0) - { - if (nxagentFindClientResource(serverClient -> index, RT_NX_FONT, pFont) == 0) - { - #ifdef TEST - fprintf(stderr, "ProcCloseFont: Switching resource for font at [%p].\n", - (void *) pFont); - #endif - - nxagentFontPriv(pFont) -> mirrorID = FakeClientID(serverClient -> index); - - AddResource(nxagentFontPriv(pFont) -> mirrorID, RT_NX_FONT, pFont); - - } - #ifdef TEST - else - { - fprintf(stderr, "ProcCloseFont: Found duplicated font at [%p], " - "resource switching skipped.\n", (void *) pFont); - } - #endif - } - - #endif - - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadFont); - } -} - -int -ProcQueryFont(client) - register ClientPtr client; -{ - xQueryFontReply *reply; - FontPtr pFont; - register GC *pGC; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - client->errorValue = stuff->id; /* EITHER font or gc */ - - pFont = NULL; - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - /* can't use VERIFY_GC because it might return BadGC */ - pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, - SecurityReadAccess); - if (!pGC) - { - client->errorValue = stuff->id; - return(BadFont); /* procotol spec says only error is BadFont */ - } - pFont = pGC->font; - } - -/* test -{ - Atom name_atom, value_atom; - int nprops; - FontPropPtr props; - int i; - char *name; - - name_atom = MakeAtom("FONT", 4, True); - value_atom = 0L; - - nprops = pFont->info.nprops; - props = pFont->info.props; - - for (i = 0; i < nprops; i++) - if (props[i].name == name_atom) { - value_atom = props[i].value; - break; - } - - if (!value_atom) return (BadFont); - - name = (char *)NameForAtom(value_atom); - fprintf(stderr, "QueryFont: font name [%s]\n",name); -} - end test */ - - { - xCharInfo *pmax = FONTINKMAX(pFont); - xCharInfo *pmin = FONTINKMIN(pFont); - int nprotoxcistructs; - int rlength; - - nprotoxcistructs = ( - pmax->rightSideBearing == pmin->rightSideBearing && - pmax->leftSideBearing == pmin->leftSideBearing && - pmax->descent == pmin->descent && - pmax->ascent == pmin->ascent && - pmax->characterWidth == pmin->characterWidth) ? - 0 : N2dChars(pFont); - - rlength = sizeof(xQueryFontReply) + - FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) + - nprotoxcistructs * sizeof(xCharInfo); - reply = NULL; - reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength); - if(!reply) - { - return(BadAlloc); - } - - reply->type = X_Reply; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->sequenceNumber = client->sequence; - QueryFont( pFont, reply, nprotoxcistructs); - - WriteReplyToClient(client, rlength, reply); - DEALLOCATE_LOCAL(reply); - return(client->noClientException); - } -} - -int -ProcQueryTextExtents(client) - register ClientPtr client; -{ - REQUEST(xQueryTextExtentsReq); - xQueryTextExtentsReply reply; - FontPtr pFont; - GC *pGC; - ExtentInfoRec info; - unsigned long length; - - REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); - - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - pGC = (GC *)SecurityLookupIDByType(client, stuff->fid, RT_GC, - SecurityReadAccess); - if (!pGC) - { - client->errorValue = stuff->fid; - return(BadFont); - } - pFont = pGC->font; - } - length = client->req_len - (sizeof(xQueryTextExtentsReq) >> 2); - length = length << 1; - if (stuff->oddLength) - { - if (length == 0) - return(BadLength); - length--; - } - if (!QueryTextExtents(pFont, length, (unsigned char *)&stuff[1], &info)) - return(BadAlloc); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.drawDirection = info.drawDirection; - reply.fontAscent = info.fontAscent; - reply.fontDescent = info.fontDescent; - reply.overallAscent = info.overallAscent; - reply.overallDescent = info.overallDescent; - reply.overallWidth = info.overallWidth; - reply.overallLeft = info.overallLeft; - reply.overallRight = info.overallRight; - WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply); - return(client->noClientException); -} - -int -ProcListFonts(client) - register ClientPtr client; -{ - char tmp[256]; - - REQUEST(xListFontsReq); - - REQUEST_FIXED_SIZE(xListFontsReq, stuff->nbytes); - memcpy(tmp,(unsigned char *) &stuff[1],(stuff->nbytes<256)?stuff->nbytes:255); - tmp[stuff->nbytes]=0; - -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "Dispatch: ListFont request with pattern %s max_names=%d\n",tmp,stuff->maxNames); -#endif - nxagentListRemoteFonts(tmp, stuff -> maxNames < nxagentMaxFontNames ? nxagentMaxFontNames : stuff->maxNames); - return ListFonts(client, (unsigned char *) &stuff[1], stuff->nbytes, - stuff->maxNames); -} - -int -ProcListFontsWithInfo(client) - register ClientPtr client; -{ - char tmp[256]; - REQUEST(xListFontsWithInfoReq); - - REQUEST_FIXED_SIZE(xListFontsWithInfoReq, stuff->nbytes); - - memcpy(tmp,(unsigned char *) &stuff[1],(stuff->nbytes<256)?stuff->nbytes:255); - tmp[stuff->nbytes]=0; -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "Dispatch: ListFont with info request with pattern %s max_names=%d\n",tmp,stuff->maxNames); -#endif - nxagentListRemoteFonts(tmp, stuff -> maxNames < nxagentMaxFontNames ? nxagentMaxFontNames :stuff->maxNames); - - return StartListFontsWithInfo(client, stuff->nbytes, - (unsigned char *) &stuff[1], stuff->maxNames); -} - -/*ARGSUSED*/ -int -dixDestroyPixmap(value, pid) - pointer value; /* must conform to DeleteType */ - XID pid; -{ - PixmapPtr pPixmap = (PixmapPtr)value; - return (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap); -} - -int -ProcCreatePixmap(client) - register ClientPtr client; -{ - PixmapPtr pMap; - register DrawablePtr pDraw; - REQUEST(xCreatePixmapReq); - DepthPtr pDepth; - register int i; - - REQUEST_SIZE_MATCH(xCreatePixmapReq); - client->errorValue = stuff->pid; - LEGAL_NEW_RESOURCE(stuff->pid, client); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } -CreatePmap: - pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, stuff->width, - stuff->height, stuff->depth); - if (pMap) - { - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) - return(client->noClientException); - } - return (BadAlloc); -} - -int -ProcFreePixmap(client) - register ClientPtr client; -{ - PixmapPtr pMap; - - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP, - SecurityDestroyAccess); - if (pMap) - { - #ifdef NXAGENT_SERVER - - /* - * When a client releases a pixmap the resource - * should not be lost if the reference counter - * is not 0, otherwise the server will not be - * able to find this pixmap looping through the - * resources. - */ - - if (pMap -> refcnt > 0) - { - if (nxagentFindClientResource(serverClient -> index, RT_NX_PIXMAP, pMap) == 0) - { - #ifdef TEST - fprintf(stderr, "ProcFreePixmap: Switching resource for pixmap at [%p].\n", - (void *) pMap); - #endif - - nxagentPixmapPriv(pMap) -> mid = FakeClientID(serverClient -> index); - - AddResource(nxagentPixmapPriv(pMap) -> mid, RT_NX_PIXMAP, pMap); - } - #ifdef TEST - else - { - fprintf(stderr, "ProcFreePixmap: Found duplicated pixmap at [%p], " - "resource switching skipped.\n", (void *) pMap); - } - #endif - } - - #endif - - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadPixmap); - } -} - -int -ProcCreateGC(client) - register ClientPtr client; -{ - int error; - GC *pGC; - register DrawablePtr pDraw; - unsigned len; - REQUEST(xCreateGCReq); - - REQUEST_AT_LEAST_SIZE(xCreateGCReq); - client->errorValue = stuff->gc; - LEGAL_NEW_RESOURCE(stuff->gc, client); - SECURITY_VERIFY_DRAWABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - len = client->req_len - (sizeof(xCreateGCReq) >> 2); - if (len != Ones(stuff->mask)) - return BadLength; - pGC = (GC *)CreateGC(pDraw, stuff->mask, - (XID *) &stuff[1], &error); - if (error != Success) - return error; - if (!AddResource(stuff->gc, RT_GC, (pointer)pGC)) - return (BadAlloc); - return(client->noClientException); -} - -int -ProcChangeGC(client) - register ClientPtr client; -{ - GC *pGC; - REQUEST(xChangeGCReq); - int result; - unsigned len; - - REQUEST_AT_LEAST_SIZE(xChangeGCReq); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); - len = client->req_len - (sizeof(xChangeGCReq) >> 2); - if (len != Ones(stuff->mask)) - return BadLength; - - result = dixChangeGC(client, pGC, stuff->mask, (CARD32 *) &stuff[1], 0); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcCopyGC(client) - register ClientPtr client; -{ - register GC *dstGC; - register GC *pGC; - int result; - REQUEST(xCopyGCReq); - - REQUEST_SIZE_MATCH(xCopyGCReq); - SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, SecurityReadAccess); - SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, SecurityWriteAccess); - if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) - return (BadMatch); - result = CopyGC(pGC, dstGC, stuff->mask); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcSetDashes(client) - register ClientPtr client; -{ - register GC *pGC; - int result; - REQUEST(xSetDashesReq); - - REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); - if (stuff->nDashes == 0) - { - client->errorValue = 0; - return BadValue; - } - - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); - - result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes, - (unsigned char *)&stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcSetClipRectangles(client) - register ClientPtr client; -{ - int nr; - int result; - register GC *pGC; - REQUEST(xSetClipRectanglesReq); - - REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); - if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) && - (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded)) - { - client->errorValue = stuff->ordering; - return BadValue; - } - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); - - nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); - if (nr & 4) - return(BadLength); - nr >>= 3; - result = SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin, - nr, (xRectangle *)&stuff[1], (int)stuff->ordering); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcFreeGC(client) - register ClientPtr client; -{ - register GC *pGC; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GC(pGC, stuff->id, client, SecurityDestroyAccess); - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); -} - -int -ProcClearToBackground(client) - register ClientPtr client; -{ - REQUEST(xClearAreaReq); - register WindowPtr pWin; - - REQUEST_SIZE_MATCH(xClearAreaReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (pWin->drawable.class == InputOnly) - { - client->errorValue = stuff->window; - return (BadMatch); - } - if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse)) - { - client->errorValue = stuff->exposures; - return(BadValue); - } - (*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y, - stuff->width, stuff->height, - (Bool)stuff->exposures); - return(client->noClientException); -} - -int -ProcCopyArea(client) - register ClientPtr client; -{ - register DrawablePtr pDst; - register DrawablePtr pSrc; - register GC *pGC; - REQUEST(xCopyAreaReq); - RegionPtr pRgn; - - REQUEST_SIZE_MATCH(xCopyAreaReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client); - if (stuff->dstDrawable != stuff->srcDrawable) - { - SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, - SecurityReadAccess); - if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) - { - client->errorValue = stuff->dstDrawable; - return (BadMatch); - } - } - else - pSrc = pDst; - - SET_DBE_SRCBUF(pSrc, stuff->srcDrawable); - - pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, stuff->srcX, stuff->srcY, - stuff->width, stuff->height, - stuff->dstX, stuff->dstY); - if (pGC->graphicsExposures) - { - (*pDst->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyArea, 0); - if (pRgn) - REGION_DESTROY(pDst->pScreen, pRgn); - } - - return(client->noClientException); -} - -int -ProcCopyPlane(client) - register ClientPtr client; -{ - register DrawablePtr psrcDraw, pdstDraw; - register GC *pGC; - REQUEST(xCopyPlaneReq); - RegionPtr pRgn; - - REQUEST_SIZE_MATCH(xCopyPlaneReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client); - if (stuff->dstDrawable != stuff->srcDrawable) - { - SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, - SecurityReadAccess); - if (pdstDraw->pScreen != psrcDraw->pScreen) - { - client->errorValue = stuff->dstDrawable; - return (BadMatch); - } - } - else - psrcDraw = pdstDraw; - - SET_DBE_SRCBUF(psrcDraw, stuff->srcDrawable); - - /* Check to see if stuff->bitPlane has exactly ONE good bit set */ - if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) || - (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) - { - client->errorValue = stuff->bitPlane; - return(BadValue); - } - - pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC, stuff->srcX, stuff->srcY, - stuff->width, stuff->height, - stuff->dstX, stuff->dstY, stuff->bitPlane); - if (pGC->graphicsExposures) - { - (*pdstDraw->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); - if (pRgn) - REGION_DESTROY(pdstDraw->pScreen, pRgn); - } - return(client->noClientException); -} - -int -ProcPolyPoint(client) - register ClientPtr client; -{ - int npoint; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyPointReq); - - REQUEST_AT_LEAST_SIZE(xPolyPointReq); - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2; - if (npoint) - { - (*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint, - (xPoint *) &stuff[1]); - } - return (client->noClientException); -} - -int -ProcPolyLine(client) - register ClientPtr client; -{ - int npoint; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyLineReq); - - REQUEST_AT_LEAST_SIZE(xPolyLineReq); - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2; - if (npoint > 1) - { - (*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint, - (DDXPointPtr) &stuff[1]); - } - return(client->noClientException); -} - -int -ProcPolySegment(client) - register ClientPtr client; -{ - int nsegs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolySegmentReq); - - REQUEST_AT_LEAST_SIZE(xPolySegmentReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); - if (nsegs & 4) - return(BadLength); - nsegs >>= 3; - if (nsegs) - { - (*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]); - } - return (client->noClientException); -} - -int -ProcPolyRectangle (client) - register ClientPtr client; -{ - int nrects; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyRectangleReq); - - REQUEST_AT_LEAST_SIZE(xPolyRectangleReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); - if (nrects & 4) - return(BadLength); - nrects >>= 3; - if (nrects) - { - (*pGC->ops->PolyRectangle)(pDraw, pGC, - nrects, (xRectangle *) &stuff[1]); - } - return(client->noClientException); -} - -int -ProcPolyArc(client) - register ClientPtr client; -{ - int narcs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyArcReq); - - REQUEST_AT_LEAST_SIZE(xPolyArcReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - narcs = (client->req_len << 2) - sizeof(xPolyArcReq); - if (narcs % sizeof(xArc)) - return(BadLength); - narcs /= sizeof(xArc); - if (narcs) - { - (*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]); - } - return (client->noClientException); -} - -int -ProcFillPoly(client) - register ClientPtr client; -{ - int things; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xFillPolyReq); - - REQUEST_AT_LEAST_SIZE(xFillPolyReq); - if ((stuff->shape != Complex) && (stuff->shape != Nonconvex) && - (stuff->shape != Convex)) - { - client->errorValue = stuff->shape; - return BadValue; - } - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - things = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2; - if (things) - { - (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape, - stuff->coordMode, things, - (DDXPointPtr) &stuff[1]); - } - return(client->noClientException); -} - -int -ProcPolyFillRectangle(client) - register ClientPtr client; -{ - int things; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyFillRectangleReq); - - REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); - if (things & 4) - return(BadLength); - things >>= 3; - - if (things) - { - (*pGC->ops->PolyFillRect) (pDraw, pGC, things, - (xRectangle *) &stuff[1]); - } - return (client->noClientException); -} - -int -ProcPolyFillArc(client) - register ClientPtr client; -{ - int narcs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyFillArcReq); - - REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); - if (narcs % sizeof(xArc)) - return(BadLength); - narcs /= sizeof(xArc); - if (narcs) - { - (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]); - } - return (client->noClientException); -} - -#ifdef MATCH_CLIENT_ENDIAN - -int -ServerOrder (void) -{ - int whichbyte = 1; - - if (*((char *) &whichbyte)) - return LSBFirst; - return MSBFirst; -} - -#define ClientOrder(client) ((client)->swapped ? !ServerOrder() : ServerOrder()) - -void -ReformatImage (char *base, int nbytes, int bpp, int order) -{ - switch (bpp) { - case 1: /* yuck */ - if (BITMAP_BIT_ORDER != order) - BitOrderInvert ((unsigned char *) base, nbytes); -#if IMAGE_BYTE_ORDER != BITMAP_BIT_ORDER && BITMAP_SCANLINE_UNIT != 8 - ReformatImage (base, nbytes, BITMAP_SCANLINE_UNIT, order); -#endif - break; - case 4: - break; /* yuck */ - case 8: - break; - case 16: - if (IMAGE_BYTE_ORDER != order) - TwoByteSwap ((unsigned char *) base, nbytes); - break; - case 32: - if (IMAGE_BYTE_ORDER != order) - FourByteSwap ((unsigned char *) base, nbytes); - break; - } -} -#else -#define ReformatImage(b,n,bpp,o) -#endif - -/* 64-bit server notes: the protocol restricts padding of images to - * 8-, 16-, or 32-bits. We would like to have 64-bits for the server - * to use internally. Removes need for internal alignment checking. - * All of the PutImage functions could be changed individually, but - * as currently written, they call other routines which require things - * to be 64-bit padded on scanlines, so we changed things here. - * If an image would be padded differently for 64- versus 32-, then - * copy each scanline to a 64-bit padded scanline. - * Also, we need to make sure that the image is aligned on a 64-bit - * boundary, even if the scanlines are padded to our satisfaction. - */ -int -ProcPutImage(client) - register ClientPtr client; -{ - register GC *pGC; - register DrawablePtr pDraw; - long length; /* length of scanline server padded */ - long lengthProto; /* length of scanline protocol padded */ - char *tmpImage; - REQUEST(xPutImageReq); - - REQUEST_AT_LEAST_SIZE(xPutImageReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - if (stuff->format == XYBitmap) - { - if ((stuff->depth != 1) || - (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad)) - return BadMatch; - length = BitmapBytePad(stuff->width + stuff->leftPad); - } - else if (stuff->format == XYPixmap) - { - if ((pDraw->depth != stuff->depth) || - (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad)) - return BadMatch; - length = BitmapBytePad(stuff->width + stuff->leftPad); - length *= stuff->depth; - } - else if (stuff->format == ZPixmap) - { - if ((pDraw->depth != stuff->depth) || (stuff->leftPad != 0)) - return BadMatch; - length = PixmapBytePad(stuff->width, stuff->depth); - } - else - { - client->errorValue = stuff->format; - return BadValue; - } - - tmpImage = (char *)&stuff[1]; - lengthProto = length; - - if (((((lengthProto * stuff->height) + (unsigned)3) >> 2) + - (sizeof(xPutImageReq) >> 2)) != client->req_len) - return BadLength; - - ReformatImage (tmpImage, lengthProto * stuff->height, - stuff->format == ZPixmap ? BitsPerPixel (stuff->depth) : 1, - ClientOrder(client)); - - (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, stuff->dstX, stuff->dstY, - stuff->width, stuff->height, - stuff->leftPad, stuff->format, tmpImage); - - return (client->noClientException); -} - - -int -DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return) - register ClientPtr client; - Drawable drawable; - int format; - int x, y, width, height; - Mask planemask; - xGetImageReply **im_return; -{ - register DrawablePtr pDraw; - int nlines, linesPerBuf; - register int linesDone; - long widthBytesLine, length; - Mask plane = 0; - char *pBuf; - xGetImageReply xgi; - RegionPtr pVisibleRegion = NULL; - - if ((format != XYPixmap) && (format != ZPixmap)) - { - client->errorValue = format; - return(BadValue); - } - SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, SecurityReadAccess); - if(pDraw->type == DRAWABLE_WINDOW) - { - if( /* check for being viewable */ - !((WindowPtr) pDraw)->realized || - /* check for being on screen */ - pDraw->x + x < 0 || - pDraw->x + x + width > pDraw->pScreen->width || - pDraw->y + y < 0 || - pDraw->y + y + height > pDraw->pScreen->height || - /* check for being inside of border */ - x < - wBorderWidth((WindowPtr)pDraw) || - x + width > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - y < -wBorderWidth((WindowPtr)pDraw) || - y + height > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height - ) - return(BadMatch); - xgi.visual = wVisual (((WindowPtr) pDraw)); - } - else - { - if(x < 0 || - x+width > (int)pDraw->width || - y < 0 || - y+height > (int)pDraw->height - ) - return(BadMatch); - xgi.visual = None; - } - - SET_DBE_SRCBUF(pDraw, drawable); - - xgi.type = X_Reply; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - if(format == ZPixmap) - { - widthBytesLine = PixmapBytePad(width, pDraw->depth); - length = widthBytesLine * height; - - } - else - { - widthBytesLine = BitmapBytePad(width); - plane = ((Mask)1) << (pDraw->depth - 1); - /* only planes asked for */ - length = widthBytesLine * height * - Ones(planemask & (plane | (plane - 1))); - - } - - xgi.length = length; - - if (im_return) { - pBuf = (char *)xalloc(sz_xGetImageReply + length); - if (!pBuf) - return (BadAlloc); - if (widthBytesLine == 0) - linesPerBuf = 0; - else - linesPerBuf = height; - *im_return = (xGetImageReply *)pBuf; - *(xGetImageReply *)pBuf = xgi; - pBuf += sz_xGetImageReply; - } else { - xgi.length = (xgi.length + 3) >> 2; - if (widthBytesLine == 0 || height == 0) - linesPerBuf = 0; - else if (widthBytesLine >= IMAGE_BUFSIZE) - linesPerBuf = 1; - else - { - linesPerBuf = IMAGE_BUFSIZE / widthBytesLine; - if (linesPerBuf > height) - linesPerBuf = height; - } - length = linesPerBuf * widthBytesLine; - if (linesPerBuf < height) - { - /* we have to make sure intermediate buffers don't need padding */ - while ((linesPerBuf > 1) && - (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1))) - { - linesPerBuf--; - length -= widthBytesLine; - } - while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1)) - { - linesPerBuf++; - length += widthBytesLine; - } - } - if(!(pBuf = (char *) ALLOCATE_LOCAL(length))) - return (BadAlloc); - WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); - } - -#ifdef XCSECURITY - if (client->trustLevel != XSecurityClientTrusted && - pDraw->type == DRAWABLE_WINDOW) - { - pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw); - if (pVisibleRegion) - { - REGION_TRANSLATE(pScreen, pVisibleRegion, -pDraw->x, -pDraw->y); - } - } -#endif - - if (linesPerBuf == 0) - { - /* nothing to do */ - } - else if (format == ZPixmap) - { - linesDone = 0; - while (height - linesDone > 0) - { - nlines = min(linesPerBuf, height - linesDone); - (*pDraw->pScreen->GetImage) (pDraw, - x, - y + linesDone, - width, - nlines, - format, - planemask, - (pointer) pBuf); -#ifdef XCSECURITY - if (pVisibleRegion) - SecurityCensorImage(client, pVisibleRegion, widthBytesLine, - pDraw, x, y + linesDone, width, - nlines, format, pBuf); -#endif - - /* Note that this is NOT a call to WriteSwappedDataToClient, - as we do NOT byte swap */ - if (!im_return) - { - ReformatImage (pBuf, (int)(nlines * widthBytesLine), - BitsPerPixel (pDraw->depth), - ClientOrder(client)); - -/* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, - (int)(nlines * widthBytesLine), - pBuf); - } - linesDone += nlines; - } - } - else /* XYPixmap */ - { - for (; plane; plane >>= 1) - { - if (planemask & plane) - { - linesDone = 0; - while (height - linesDone > 0) - { - nlines = min(linesPerBuf, height - linesDone); - (*pDraw->pScreen->GetImage) (pDraw, - x, - y + linesDone, - width, - nlines, - format, - plane, - (pointer)pBuf); -#ifdef XCSECURITY - if (pVisibleRegion) - SecurityCensorImage(client, pVisibleRegion, - widthBytesLine, - pDraw, x, y + linesDone, width, - nlines, format, pBuf); -#endif - - /* Note: NOT a call to WriteSwappedDataToClient, - as we do NOT byte swap */ - if (im_return) { - pBuf += nlines * widthBytesLine; - } else { - ReformatImage (pBuf, - (int)(nlines * widthBytesLine), - 1, - ClientOrder (client)); - -/* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, - (int)(nlines * widthBytesLine), - pBuf); - } - linesDone += nlines; - } - } - } - } -#ifdef XCSECURITY - if (pVisibleRegion) - REGION_DESTROY(pScreen, pVisibleRegion); -#endif - if (!im_return) - DEALLOCATE_LOCAL(pBuf); - return (client->noClientException); -} - -int -ProcGetImage(client) - register ClientPtr client; -{ - REQUEST(xGetImageReq); - - REQUEST_SIZE_MATCH(xGetImageReq); - - return DoGetImage(client, stuff->format, stuff->drawable, - stuff->x, stuff->y, - (int)stuff->width, (int)stuff->height, - stuff->planeMask, (xGetImageReply **)NULL); -} - -int -ProcPolyText(client) - register ClientPtr client; -{ - int err; - REQUEST(xPolyTextReq); - DrawablePtr pDraw; - GC *pGC; - - REQUEST_AT_LEAST_SIZE(xPolyTextReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = PolyText(client, - pDraw, - pGC, - (unsigned char *)&stuff[1], - ((unsigned char *) stuff) + (client->req_len << 2), - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcImageText8(client) - register ClientPtr client; -{ - int err; - register DrawablePtr pDraw; - register GC *pGC; - - REQUEST(xImageTextReq); - - REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = ImageText(client, - pDraw, - pGC, - stuff->nChars, - (unsigned char *)&stuff[1], - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcImageText16(client) - register ClientPtr client; -{ - int err; - register DrawablePtr pDraw; - register GC *pGC; - - REQUEST(xImageTextReq); - - REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = ImageText(client, - pDraw, - pGC, - stuff->nChars, - (unsigned char *)&stuff[1], - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - - -int -ProcCreateColormap(client) - register ClientPtr client; -{ - VisualPtr pVisual; - ColormapPtr pmap; - Colormap mid; - register WindowPtr pWin; - ScreenPtr pScreen; - REQUEST(xCreateColormapReq); - int i, result; - - REQUEST_SIZE_MATCH(xCreateColormapReq); - - if ((stuff->alloc != AllocNone) && (stuff->alloc != AllocAll)) - { - client->errorValue = stuff->alloc; - return(BadValue); - } - mid = stuff->mid; - LEGAL_NEW_RESOURCE(mid, client); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - pScreen = pWin->drawable.pScreen; - for (i = 0, pVisual = pScreen->visuals; - i < pScreen->numVisuals; - i++, pVisual++) - { - if (pVisual->vid != stuff->visual) - continue; - result = CreateColormap(mid, pScreen, pVisual, &pmap, - (int)stuff->alloc, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - client->errorValue = stuff->visual; - return(BadValue); -} - -int -ProcFreeColormap(client) - register ClientPtr client; -{ - ColormapPtr pmap; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pmap = (ColormapPtr )SecurityLookupIDByType(client, stuff->id, RT_COLORMAP, - SecurityDestroyAccess); - if (pmap) - { - /* Freeing a default colormap is a no-op */ - if (!(pmap->flags & IsDefault)) - FreeResource(stuff->id, RT_NONE); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - - -int -ProcCopyColormapAndFree(client) - register ClientPtr client; -{ - Colormap mid; - ColormapPtr pSrcMap; - REQUEST(xCopyColormapAndFreeReq); - int result; - - REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); - mid = stuff->mid; - LEGAL_NEW_RESOURCE(mid, client); - if( (pSrcMap = (ColormapPtr )SecurityLookupIDByType(client, stuff->srcCmap, - RT_COLORMAP, SecurityReadAccess|SecurityWriteAccess)) ) - { - result = CopyColormapAndFree(mid, pSrcMap, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - { - client->errorValue = stuff->srcCmap; - return(BadColor); - } -} - -int -ProcInstallColormap(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - (*(pcmp->pScreen->InstallColormap)) (pcmp); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - -int -ProcUninstallColormap(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - if(pcmp->mid != pcmp->pScreen->defColormap) - (*(pcmp->pScreen->UninstallColormap)) (pcmp); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - -int -ProcListInstalledColormaps(client) - register ClientPtr client; -{ - xListInstalledColormapsReply *preply; - int nummaps; - WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - - if (!pWin) - return(BadWindow); - - preply = (xListInstalledColormapsReply *) - ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) + - pWin->drawable.pScreen->maxInstalledCmaps * - sizeof(Colormap)); - if(!preply) - return(BadAlloc); - - preply->type = X_Reply; - preply->sequenceNumber = client->sequence; - nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) - (pWin->drawable.pScreen, (Colormap *)&preply[1]); - preply->nColormaps = nummaps; - preply->length = nummaps; - WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); - DEALLOCATE_LOCAL(preply); - return(client->noClientException); -} - -int -ProcAllocColor(client) - register ClientPtr client; -{ - ColormapPtr pmap; - int retval; - xAllocColorReply acr; - REQUEST(xAllocColorReq); - - REQUEST_SIZE_MATCH(xAllocColorReq); - pmap = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pmap) - { -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColor request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pmap, (xReq *) stuff)) - return Success; -#endif - acr.type = X_Reply; - acr.length = 0; - acr.sequenceNumber = client->sequence; - acr.red = stuff->red; - acr.green = stuff->green; - acr.blue = stuff->blue; - acr.pixel = 0; - if( (retval = AllocColor(pmap, &acr.red, &acr.green, &acr.blue, - &acr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return (retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pmap->pScreen->myNum) -#endif - WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); - return (client->noClientException); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocNamedColor (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xAllocNamedColorReq); - - REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int retval; - - xAllocNamedColorReply ancr; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocNamedColor request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - ancr.type = X_Reply; - ancr.length = 0; - ancr.sequenceNumber = client->sequence; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes, - &ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) - { - ancr.screenRed = ancr.exactRed; - ancr.screenGreen = ancr.exactGreen; - ancr.screenBlue = ancr.exactBlue; - ancr.pixel = 0; - if( (retval = AllocColor(pcmp, - &ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue, - &ancr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr); - return (client->noClientException); - } - else - return(BadName); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocColorCells (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xAllocColorCellsReq); - - REQUEST_SIZE_MATCH(xAllocColorCellsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xAllocColorCellsReply accr; - int npixels, nmasks, retval; - long length; - Pixel *ppixels, *pmasks; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColorCells request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - npixels = stuff->colors; - if (!npixels) - { - client->errorValue = npixels; - return (BadValue); - } - if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) - { - client->errorValue = stuff->contiguous; - return (BadValue); - } - nmasks = stuff->planes; - length = ((long)npixels + (long)nmasks) * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); - if(!ppixels) - return(BadAlloc); - pmasks = ppixels + npixels; - - if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks, - (Bool)stuff->contiguous, ppixels, pmasks)) ) - { - DEALLOCATE_LOCAL(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - { - accr.type = X_Reply; - accr.length = length >> 2; - accr.sequenceNumber = client->sequence; - accr.nPixels = npixels; - accr.nMasks = nmasks; - WriteReplyToClient(client, sizeof (xAllocColorCellsReply), &accr); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, length, ppixels); - } - DEALLOCATE_LOCAL(ppixels); - return (client->noClientException); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocColorPlanes(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xAllocColorPlanesReq); - - REQUEST_SIZE_MATCH(xAllocColorPlanesReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xAllocColorPlanesReply acpr; - int npixels, retval; - long length; - Pixel *ppixels; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColorPlanes request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - npixels = stuff->colors; - if (!npixels) - { - client->errorValue = npixels; - return (BadValue); - } - if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) - { - client->errorValue = stuff->contiguous; - return (BadValue); - } - acpr.type = X_Reply; - acpr.sequenceNumber = client->sequence; - acpr.nPixels = npixels; - length = (long)npixels * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); - if(!ppixels) - return(BadAlloc); - if( (retval = AllocColorPlanes(client->index, pcmp, npixels, - (int)stuff->red, (int)stuff->green, (int)stuff->blue, - (Bool)stuff->contiguous, ppixels, - &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) ) - { - DEALLOCATE_LOCAL(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } - acpr.length = length >> 2; -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - { - WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, length, ppixels); - } - DEALLOCATE_LOCAL(ppixels); - return (client->noClientException); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcFreeColors (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xFreeColorsReq); - - REQUEST_AT_LEAST_SIZE(xFreeColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int count; - int retval; - - if(pcmp->flags & AllAllocated) - return(BadAccess); - count = ((client->req_len << 2)- sizeof(xFreeColorsReq)) >> 2; - retval = FreeColors(pcmp, client->index, count, - (Pixel *)&stuff[1], (Pixel)stuff->planeMask); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(retval); - } - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcStoreColors (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xStoreColorsReq); - - REQUEST_AT_LEAST_SIZE(xStoreColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int count; - int retval; - - count = (client->req_len << 2) - sizeof(xStoreColorsReq); - if (count % sizeof(xColorItem)) - return(BadLength); - count /= sizeof(xColorItem); - retval = StoreColors(pcmp, count, (xColorItem *)&stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(retval); - } - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcStoreNamedColor (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xStoreNamedColorReq); - - REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xColorItem def; - int retval; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], - stuff->nbytes, &def.red, &def.green, &def.blue)) - { - def.flags = stuff->flags; - def.pixel = stuff->pixel; - retval = StoreColors(pcmp, 1, &def); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } - return (BadName); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcQueryColors(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xQueryColorsReq); - - REQUEST_AT_LEAST_SIZE(xQueryColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - int count, retval; - xrgb *prgbs; - xQueryColorsReply qcr; - - count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2; - prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb)); - if(!prgbs && count) - return(BadAlloc); - if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) ) - { - if (prgbs) DEALLOCATE_LOCAL(prgbs); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return (retval); - } - } - qcr.type = X_Reply; - qcr.length = (count * sizeof(xrgb)) >> 2; - qcr.sequenceNumber = client->sequence; - qcr.nColors = count; - WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr); - if (count) - { - client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; - WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); - } - if (prgbs) DEALLOCATE_LOCAL(prgbs); - return(client->noClientException); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcLookupColor(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xLookupColorReq); - - REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - xLookupColorReply lcr; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes, - &lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue)) - { - lcr.type = X_Reply; - lcr.length = 0; - lcr.sequenceNumber = client->sequence; - lcr.screenRed = lcr.exactRed; - lcr.screenGreen = lcr.exactGreen; - lcr.screenBlue = lcr.exactBlue; - (*pcmp->pScreen->ResolveColor)(&lcr.screenRed, - &lcr.screenGreen, - &lcr.screenBlue, - pcmp->pVisual); - WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr); - return(client->noClientException); - } - return (BadName); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcCreateCursor( client) - register ClientPtr client; -{ - CursorPtr pCursor; - - register PixmapPtr src; - register PixmapPtr msk; - unsigned char * srcbits; - unsigned char * mskbits; - unsigned short width, height; - long n; - CursorMetricRec cm; - - - REQUEST(xCreateCursorReq); - - REQUEST_SIZE_MATCH(xCreateCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - src = (PixmapPtr)SecurityLookupIDByType(client, stuff->source, - RT_PIXMAP, SecurityReadAccess); - msk = (PixmapPtr)SecurityLookupIDByType(client, stuff->mask, - RT_PIXMAP, SecurityReadAccess); - if ( src == (PixmapPtr)NULL) - { - client->errorValue = stuff->source; - return (BadPixmap); - } - if ( msk == (PixmapPtr)NULL) - { - if (stuff->mask != None) - { - client->errorValue = stuff->mask; - return (BadPixmap); - } - } - else if ( src->drawable.width != msk->drawable.width - || src->drawable.height != msk->drawable.height - || src->drawable.depth != 1 - || msk->drawable.depth != 1) - return (BadMatch); - - width = src->drawable.width; - height = src->drawable.height; - - if ( stuff->x > width - || stuff->y > height ) - return (BadMatch); - - n = BitmapBytePad(width)*height; - srcbits = (unsigned char *)xalloc(n); - if (!srcbits) - return (BadAlloc); - mskbits = (unsigned char *)xalloc(n); - if (!mskbits) - { - xfree(srcbits); - return (BadAlloc); - } - - /* zeroing the (pad) bits helps some ddx cursor handling */ - bzero((char *)srcbits, n); - (* src->drawable.pScreen->GetImage)( (DrawablePtr)src, 0, 0, width, height, - XYPixmap, 1, (pointer)srcbits); - if ( msk == (PixmapPtr)NULL) - { - register unsigned char *bits = mskbits; - while (--n >= 0) - *bits++ = ~0; - } - else - { - /* zeroing the (pad) bits helps some ddx cursor handling */ - bzero((char *)mskbits, n); - (* msk->drawable.pScreen->GetImage)( (DrawablePtr)msk, 0, 0, width, - height, XYPixmap, 1, (pointer)mskbits); - } - cm.width = width; - cm.height = height; - cm.xhot = stuff->x; - cm.yhot = stuff->y; - pCursor = AllocCursor( srcbits, mskbits, &cm, - stuff->foreRed, stuff->foreGreen, stuff->foreBlue, - stuff->backRed, stuff->backGreen, stuff->backBlue); - - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - { - #ifdef TEST - fprintf(stderr, "ProcCreateCursor: Created cursor at [%p].\n", (void *) pCursor); - #endif - - return (client->noClientException); - } - - return BadAlloc; -} - -int -ProcCreateGlyphCursor( client) - register ClientPtr client; -{ - CursorPtr pCursor; - int res; - - REQUEST(xCreateGlyphCursorReq); - - REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - res = AllocGlyphCursor(stuff->source, stuff->sourceChar, - stuff->mask, stuff->maskChar, - stuff->foreRed, stuff->foreGreen, stuff->foreBlue, - stuff->backRed, stuff->backGreen, stuff->backBlue, - &pCursor, client); - if (res != Success) - return res; - if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; - return BadAlloc; -} - - -int -ProcFreeCursor(client) - register ClientPtr client; -{ - CursorPtr pCursor; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->id, - RT_CURSOR, SecurityDestroyAccess); - if (pCursor) - { - FreeResource(stuff->id, RT_NONE); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadCursor); - } -} - -int -ProcQueryBestSize (client) - register ClientPtr client; -{ - xQueryBestSizeReply reply; - register DrawablePtr pDraw; - ScreenPtr pScreen; - REQUEST(xQueryBestSizeReq); - - REQUEST_SIZE_MATCH(xQueryBestSizeReq); - if ((stuff->class != CursorShape) && - (stuff->class != TileShape) && - (stuff->class != StippleShape)) - { - client->errorValue = stuff->class; - return(BadValue); - } - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW) - return (BadMatch); - pScreen = pDraw->pScreen; - (* pScreen->QueryBestSize)(stuff->class, &stuff->width, - &stuff->height, pScreen); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.width = stuff->width; - reply.height = stuff->height; - WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); - return (client->noClientException); -} - - -int -ProcSetScreenSaver (client) - register ClientPtr client; -{ - int blankingOption, exposureOption; - REQUEST(xSetScreenSaverReq); - - REQUEST_SIZE_MATCH(xSetScreenSaverReq); - blankingOption = stuff->preferBlank; - if ((blankingOption != DontPreferBlanking) && - (blankingOption != PreferBlanking) && - (blankingOption != DefaultBlanking)) - { - client->errorValue = blankingOption; - return BadValue; - } - exposureOption = stuff->allowExpose; - if ((exposureOption != DontAllowExposures) && - (exposureOption != AllowExposures) && - (exposureOption != DefaultExposures)) - { - client->errorValue = exposureOption; - return BadValue; - } - if (stuff->timeout < -1) - { - client->errorValue = stuff->timeout; - return BadValue; - } - if (stuff->interval < -1) - { - client->errorValue = stuff->interval; - return BadValue; - } - - /* - * The NX agent uses the screen saver procedure - * to monitor the user activities and launch its - * handlers (like timeout feature), so we can't - * always allow the clients to change our values. - */ - - #ifdef TEST - fprintf(stderr, "ProcSetScreenSaver: Called with timeout [%d] interval [%d] Blanking [%d] Exposure [%d].\n", - stuff -> timeout, stuff -> interval, blankingOption, exposureOption); - #endif - - if (nxagentOption(Timeout) == 0) - { - if (blankingOption == DefaultBlanking) - { - ScreenSaverBlanking = defaultScreenSaverBlanking; - } - else - { - ScreenSaverBlanking = blankingOption; - } - - if (exposureOption == DefaultExposures) - { - ScreenSaverAllowExposures = defaultScreenSaverAllowExposures; - } - else - { - ScreenSaverAllowExposures = exposureOption; - } - - if (stuff->timeout >= 0) - { - ScreenSaverTime = stuff->timeout * MILLI_PER_SECOND; - } - else - { - ScreenSaverTime = defaultScreenSaverTime; - } - - if (stuff->interval >= 0) - { - ScreenSaverInterval = stuff->interval * MILLI_PER_SECOND; - } - else - { - ScreenSaverInterval = defaultScreenSaverInterval; - } - } - - #ifdef TEST - - else - { - fprintf(stderr, "ProcSetScreenSaver: Keeping auto-disconnect timeout set to [%d] seconds.\n", - nxagentOption(Timeout)); - } - - #endif - - return (client->noClientException); -} - -int -ProcGetScreenSaver(client) - register ClientPtr client; -{ - xGetScreenSaverReply rep; - - REQUEST_SIZE_MATCH(xReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.timeout = ScreenSaverTime / MILLI_PER_SECOND; - rep.interval = ScreenSaverInterval / MILLI_PER_SECOND; - rep.preferBlanking = ScreenSaverBlanking; - rep.allowExposures = ScreenSaverAllowExposures; - WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep); - return (client->noClientException); -} - -int -ProcChangeHosts(client) - register ClientPtr client; -{ - REQUEST(xChangeHostsReq); - int result; - - REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength); - - if(stuff->mode == HostInsert) - result = AddHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); - else if (stuff->mode == HostDelete) - result = RemoveHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); - else - { - client->errorValue = stuff->mode; - return BadValue; - } - if (!result) - result = client->noClientException; - return (result); -} - -int -ProcListHosts(client) - register ClientPtr client; -{ - xListHostsReply reply; - int len, nHosts, result; - pointer pdata; - /* REQUEST(xListHostsReq); */ - - REQUEST_SIZE_MATCH(xListHostsReq); -#ifdef XCSECURITY - /* untrusted clients can't list hosts */ - if (client->trustLevel != XSecurityClientTrusted) - { - SecurityAudit("client %d attempted to list hosts\n", client->index); - return BadAccess; - } -#endif - result = GetHosts(&pdata, &nHosts, &len, &reply.enabled); - if (result != Success) - return(result); - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.nHosts = nHosts; - reply.length = len >> 2; - WriteReplyToClient(client, sizeof(xListHostsReply), &reply); - if (nHosts) - { - client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend; - WriteSwappedDataToClient(client, len, pdata); - } - xfree(pdata); - return (client->noClientException); -} - -int -ProcChangeAccessControl(client) - register ClientPtr client; -{ - int result; - REQUEST(xSetAccessControlReq); - - REQUEST_SIZE_MATCH(xSetAccessControlReq); - if ((stuff->mode != EnableAccess) && (stuff->mode != DisableAccess)) - { - client->errorValue = stuff->mode; - return BadValue; - } - result = ChangeAccessControl(client, stuff->mode == EnableAccess); - if (!result) - result = client->noClientException; - return (result); -} - -int -ProcKillClient(client) - register ClientPtr client; -{ - REQUEST(xResourceReq); - ClientPtr killclient; - - REQUEST_SIZE_MATCH(xResourceReq); - if (stuff->id == AllTemporary) - { - CloseDownRetainedResources(); - return (client->noClientException); - } - - if ((killclient = LookupClient(stuff->id, client))) - { - CloseDownClient(killclient); - /* if an LBX proxy gets killed, isItTimeToYield will be set */ - if (isItTimeToYield || (client == killclient)) - { - /* force yield and return Success, so that Dispatch() - * doesn't try to touch client - */ - isItTimeToYield = TRUE; - return (Success); - } - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadValue); - } -} - -int -ProcSetFontPath(client) - register ClientPtr client; -{ - unsigned char *ptr; - unsigned long nbytes, total; - long nfonts; - int n, result; - int error; - REQUEST(xSetFontPathReq); - - REQUEST_AT_LEAST_SIZE(xSetFontPathReq); - - nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq); - total = nbytes; - ptr = (unsigned char *)&stuff[1]; - nfonts = stuff->nFonts; - while (--nfonts >= 0) - { - if ((total == 0) || (total < (n = (*ptr + 1)))) - return(BadLength); - total -= n; - ptr += n; - } - if (total >= 4) - return(BadLength); - result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1], - &error); - if (!result) - { - result = client->noClientException; - client->errorValue = error; - } - return (result); -} - -int -ProcGetFontPath(client) - register ClientPtr client; -{ - xGetFontPathReply reply; - int stringLens, numpaths; - unsigned char *bufferStart; - /* REQUEST (xReq); */ - - REQUEST_SIZE_MATCH(xReq); - bufferStart = GetFontPath(&numpaths, &stringLens); - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = (stringLens + numpaths + 3) >> 2; - reply.nPaths = numpaths; - - WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); - if (stringLens || numpaths) - (void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart); - return(client->noClientException); -} - -int -ProcChangeCloseDownMode(client) - register ClientPtr client; -{ - REQUEST(xSetCloseDownModeReq); - - REQUEST_SIZE_MATCH(xSetCloseDownModeReq); - if ((stuff->mode == AllTemporary) || - (stuff->mode == RetainPermanent) || - (stuff->mode == RetainTemporary)) - { - client->closeDownMode = stuff->mode; - return (client->noClientException); - } - else - { - client->errorValue = stuff->mode; - return (BadValue); - } -} - -int ProcForceScreenSaver(client) - register ClientPtr client; -{ - REQUEST(xForceScreenSaverReq); - - REQUEST_SIZE_MATCH(xForceScreenSaverReq); - - if ((stuff->mode != ScreenSaverReset) && - (stuff->mode != ScreenSaverActive)) - { - client->errorValue = stuff->mode; - return BadValue; - } - - /* - * The NX agent uses the screen saver procedure - * to monitor the user activities and launch its - * handlers (like timeout feature), so we can't - * always allow the clients to force the screen - * saver handler execution. - */ - - if (nxagentOption(Timeout) == 0) - { - SaveScreens(SCREEN_SAVER_FORCER, (int)stuff->mode); - } - - #ifdef TEST - - else - { - fprintf(stderr, "ProcForceScreenSaver: Ignoring the client request with mode [%d].\n", - stuff -> mode); - } - - #endif - - return client->noClientException; -} - -int ProcNoOperation(client) - register ClientPtr client; -{ - REQUEST_AT_LEAST_SIZE(xReq); - - /* noop -- don't do anything */ - return(client->noClientException); -} - -void -InitProcVectors(void) -{ - int i; - for (i = 0; i<256; i++) - { - if(!ProcVector[i]) - { - ProcVector[i] = SwappedProcVector[i] = ProcBadRequest; - ReplySwapVector[i] = ReplyNotSwappd; - } -#ifdef K5AUTH - if (!k5_Vector[i]) - { - k5_Vector[i] = k5_bad; - } -#endif - } - for(i = LASTEvent; i < 128; i++) - { - EventSwapVector[i] = NotImplemented; - } - -} - -/********************** - * CloseDownClient - * - * Client can either mark his resources destroy or retain. If retained and - * then killed again, the client is really destroyed. - *********************/ - -void -CloseDownClient(client) - register ClientPtr client; -{ - Bool really_close_down = client->clientGone || - client->closeDownMode == DestroyAll; - - /* - * There must be a better way to hook a - * call-back function to be called any - * time a client is going to be closed. - */ - - nxagentClearClipboard(client, NULL); - - /* - * Need to reset the karma counter and - * get rid of the pending sync replies. - */ - - nxagentWakeupByReset(client); - - /* - * Check if the client - * is a shadow nxagent. - */ - - nxagentCheckIfShadowAgent(client); - - if (!client->clientGone) - { - /* ungrab server if grabbing client dies */ - if (grabState != GrabNone && grabClient == client) - { - UngrabServer(client); - } - BITCLEAR(grabWaiters, client->index); - DeleteClientFromAnySelections(client); - ReleaseActiveGrabs(client); - DeleteClientFontStuff(client); - if (!really_close_down) - { - /* This frees resources that should never be retained - * no matter what the close down mode is. Actually we - * could do this unconditionally, but it's probably - * better not to traverse all the client's resources - * twice (once here, once a few lines down in - * FreeClientResources) in the common case of - * really_close_down == TRUE. - */ - FreeClientNeverRetainResources(client); - client->clientState = ClientStateRetained; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - } - client->clientGone = TRUE; /* so events aren't sent to client */ - if (ClientIsAsleep(client)) - ClientSignal (client); - ProcessWorkQueueZombies(); -#ifdef LBX - ProcessQTagZombies(); -#endif - CloseDownConnection(client); - - /* If the client made it to the Running stage, nClients has - * been incremented on its behalf, so we need to decrement it - * now. If it hasn't gotten to Running, nClients has *not* - * been incremented, so *don't* decrement it. - */ - if (client->clientState != ClientStateInitial && - client->clientState != ClientStateAuthenticating ) - { - --nClients; - } - } - - if (really_close_down) - { - if (client->clientState == ClientStateRunning && nClients == 0) - dispatchException |= dispatchExceptionAtReset; - - client->clientState = ClientStateGone; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - FreeClientResources(client); - if (client->index < nextFreeClientID) - nextFreeClientID = client->index; - clients[client->index] = NullClient; -#ifdef SMART_SCHEDULE - SmartLastClient = NullClient; -#endif - xfree(client); - - while (!clients[currentMaxClients-1]) - currentMaxClients--; - } -} - -static void -KillAllClients() -{ - int i; - for (i=1; icloseDownMode = DestroyAll; - CloseDownClient(clients[i]); - } -} - -/********************* - * CloseDownRetainedResources - * - * Find all clients that are gone and have terminated in RetainTemporary - * and destroy their resources. - *********************/ - -void -CloseDownRetainedResources() -{ - register int i; - register ClientPtr client; - - for (i=1; icloseDownMode == RetainTemporary) - && (client->clientGone)) - CloseDownClient(client); - } -} - -void InitClient(client, i, ospriv) - ClientPtr client; - int i; - pointer ospriv; -{ - client->index = i; - client->sequence = 0; - client->clientAsMask = ((Mask)i) << CLIENTOFFSET; - client->clientGone = FALSE; - if (i) - { - client->closeDownMode = DestroyAll; - client->lastDrawable = (DrawablePtr)WindowTable[0]; - client->lastDrawableID = WindowTable[0]->drawable.id; - } - else - { - client->closeDownMode = RetainPermanent; - client->lastDrawable = (DrawablePtr)NULL; - client->lastDrawableID = INVALID; - } - client->lastGC = (GCPtr) NULL; - client->lastGCID = INVALID; - client->numSaved = 0; - client->saveSet = (pointer *)NULL; - client->noClientException = Success; -#ifdef LOG_DEBUG - client->requestLogIndex = 0; -#endif - client->requestVector = InitialVector; - client->osPrivate = ospriv; - client->swapped = FALSE; - client->big_requests = FALSE; - client->priority = 0; - client->clientState = ClientStateInitial; -#ifdef XKB - if (!noXkbExtension) { - client->xkbClientFlags = 0; - client->mapNotifyMask = 0; - QueryMinMaxKeyCodes(&client->minKC,&client->maxKC); - } -#endif - client->replyBytesRemaining = 0; -#ifdef LBX - client->readRequest = StandardReadRequestFromClient; -#endif -#ifdef XCSECURITY - client->trustLevel = XSecurityClientTrusted; - client->CheckAccess = NULL; - client->authId = 0; -#endif -#ifdef XAPPGROUP - client->appgroup = NULL; -#endif - client->fontResFunc = NULL; -#ifdef SMART_SCHEDULE - client->smart_priority = 0; - client->smart_start_tick = SmartScheduleTime; - client->smart_stop_tick = SmartScheduleTime; - client->smart_check_tick = SmartScheduleTime; -#endif -} - -extern int clientPrivateLen; -extern unsigned *clientPrivateSizes; -extern unsigned totalClientSize; - -int -InitClientPrivates(client) - ClientPtr client; -{ - register char *ptr; - DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; - - if (totalClientSize == sizeof(ClientRec)) - ppriv = (DevUnion *)NULL; - else if (client->index) - ppriv = (DevUnion *)(client + 1); - else - { - ppriv = (DevUnion *)xalloc(totalClientSize - sizeof(ClientRec)); - if (!ppriv) - return 0; - } - client->devPrivates = ppriv; - sizes = clientPrivateSizes; - ptr = (char *)(ppriv + clientPrivateLen); - for (i = clientPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - - /* - * Initialize the private members. - */ - - nxagentInitClientPrivates(client); - - return 1; -} - -/************************ - * int NextAvailableClient(ospriv) - * - * OS dependent portion can't assign client id's because of CloseDownModes. - * Returns NULL if there are no free clients. - *************************/ - -ClientPtr -NextAvailableClient(ospriv) - pointer ospriv; -{ - register int i; - register ClientPtr client; - xReq data; - - i = nextFreeClientID; - if (i == MAXCLIENTS) - return (ClientPtr)NULL; - clients[i] = client = (ClientPtr)xalloc(totalClientSize); - if (!client) - return (ClientPtr)NULL; - InitClient(client, i, ospriv); - InitClientPrivates(client); - if (!InitClientResources(client)) - { - xfree(client); - return (ClientPtr)NULL; - } - data.reqType = 1; - data.length = (sz_xReq + sz_xConnClientPrefix) >> 2; - if (!InsertFakeRequest(client, (char *)&data, sz_xReq)) - { - FreeClientResources(client); - xfree(client); - return (ClientPtr)NULL; - } - if (i == currentMaxClients) - currentMaxClients++; - while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID]) - nextFreeClientID++; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - return(client); -} - -int -ProcInitialConnection(client) - register ClientPtr client; -{ - REQUEST(xReq); - register xConnClientPrefix *prefix; - int whichbyte = 1; - - prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); - if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B')) - return (client->noClientException = -1); - if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) || - (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) - { - client->swapped = TRUE; - SwapConnClientPrefix(prefix); - } - stuff->reqType = 2; - stuff->length += ((prefix->nbytesAuthProto + (unsigned)3) >> 2) + - ((prefix->nbytesAuthString + (unsigned)3) >> 2); - if (client->swapped) - { - swaps(&stuff->length, whichbyte); - } - ResetCurrentRequest(client); - return (client->noClientException); -} - -#ifdef LBX -void -IncrementClientCount() -{ - nClients++; -} -#endif - -int -SendConnSetup(client, reason) - register ClientPtr client; - char *reason; -{ - register xWindowRoot *root; - register int i; - int numScreens; - char* lConnectionInfo; - xConnSetupPrefix* lconnSetupPrefix; - - if (reason) - { - xConnSetupPrefix csp; - - csp.success = xFalse; - csp.lengthReason = strlen(reason); - csp.length = (csp.lengthReason + (unsigned)3) >> 2; - csp.majorVersion = X_PROTOCOL; - csp.minorVersion = X_PROTOCOL_REVISION; - if (client->swapped) - WriteSConnSetupPrefix(client, &csp); - else - (void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp); - (void)WriteToClient(client, (int)csp.lengthReason, reason); - return (client->noClientException = -1); - } - - numScreens = screenInfo.numScreens; - lConnectionInfo = ConnectionInfo; - lconnSetupPrefix = &connSetupPrefix; - - /* We're about to start speaking X protocol back to the client by - * sending the connection setup info. This means the authorization - * step is complete, and we can count the client as an - * authorized one. - */ - nClients++; - - client->requestVector = client->swapped ? SwappedProcVector : ProcVector; - client->sequence = 0; -#ifdef XAPPGROUP - XagConnectionInfo (client, &lconnSetupPrefix, &lConnectionInfo, &numScreens); -#endif - ((xConnSetup *)lConnectionInfo)->ridBase = client->clientAsMask; - ((xConnSetup *)lConnectionInfo)->ridMask = RESOURCE_ID_MASK; -#ifdef MATCH_CLIENT_ENDIAN - ((xConnSetup *)lConnectionInfo)->imageByteOrder = ClientOrder (client); - ((xConnSetup *)lConnectionInfo)->bitmapBitOrder = ClientOrder (client); -#endif - /* fill in the "currentInputMask" */ - root = (xWindowRoot *)(lConnectionInfo + connBlockScreenStart); -#ifdef PANORAMIX - if (noPanoramiXExtension) - numScreens = screenInfo.numScreens; - else - numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; -#endif - - for (i=0; icurrentInputMask = WindowTable[i]->eventMask | - wOtherEventMasks (WindowTable[i]); - pDepth = (xDepth *)(root + 1); - for (j = 0; j < root->nDepths; j++) - { - pDepth = (xDepth *)(((char *)(pDepth + 1)) + - pDepth->nVisuals * sizeof(xVisualType)); - } - root = (xWindowRoot *)pDepth; - } - - if (client->swapped) - { - WriteSConnSetupPrefix(client, lconnSetupPrefix); - WriteSConnectionInfo(client, - (unsigned long)(lconnSetupPrefix->length << 2), - lConnectionInfo); - } - else - { - (void)WriteToClient(client, sizeof(xConnSetupPrefix), - (char *) lconnSetupPrefix); - (void)WriteToClient(client, (int)(lconnSetupPrefix->length << 2), - lConnectionInfo); - } - client->clientState = ClientStateRunning; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = lconnSetupPrefix; - clientinfo.setup = (xConnSetup *)lConnectionInfo; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - return (client->noClientException); -} - -int -ProcEstablishConnection(client) - register ClientPtr client; -{ - char *reason, *auth_proto, *auth_string; - register xConnClientPrefix *prefix; - REQUEST(xReq); - - prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); - auth_proto = (char *)prefix + sz_xConnClientPrefix; - auth_string = auth_proto + ((prefix->nbytesAuthProto + 3) & ~3); - if ((prefix->majorVersion != X_PROTOCOL) || - (prefix->minorVersion != X_PROTOCOL_REVISION)) - reason = "Protocol version mismatch"; - else - reason = ClientAuthorized(client, - (unsigned short)prefix->nbytesAuthProto, - auth_proto, - (unsigned short)prefix->nbytesAuthString, - auth_string); - /* - * If Kerberos is being used for this client, the clientState - * will be set to ClientStateAuthenticating at this point. - * More messages need to be exchanged among the X server, Kerberos - * server, and client to figure out if everyone is authorized. - * So we don't want to send the connection setup info yet, since - * the auth step isn't really done. - */ - if (client->clientState == ClientStateCheckingSecurity) - client->clientState = ClientStateCheckedSecurity; - else if (client->clientState != ClientStateAuthenticating) - return(SendConnSetup(client, reason)); - return(client->noClientException); -} - -void -SendErrorToClient(client, majorCode, minorCode, resId, errorCode) - ClientPtr client; - unsigned int majorCode; - unsigned int minorCode; - XID resId; - int errorCode; -{ - xError rep; - - rep.type = X_Error; - rep.sequenceNumber = client->sequence; - rep.errorCode = errorCode; - rep.majorCode = majorCode; - rep.minorCode = minorCode; - rep.resourceID = resId; - - WriteEventsToClient (client, 1, (xEvent *)&rep); -} - -void -DeleteWindowFromAnySelections(pWin) - WindowPtr pWin; -{ - register int i; - - for (i = 0; i< NumCurrentSelections; i++) - if (CurrentSelections[i].pWin == pWin) - { - CurrentSelections[i].pWin = (WindowPtr)NULL; - CurrentSelections[i].window = None; - CurrentSelections[i].client = NullClient; - } -} - -static void -DeleteClientFromAnySelections(client) - ClientPtr client; -{ - register int i; - - for (i = 0; i< NumCurrentSelections; i++) - if (CurrentSelections[i].client == client) - { - CurrentSelections[i].pWin = (WindowPtr)NULL; - CurrentSelections[i].window = None; - CurrentSelections[i].client = NullClient; - } -} - -void -MarkClientException(client) - ClientPtr client; -{ - client->noClientException = -1; -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.XF86.original deleted file mode 100644 index a385a8b09..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.XF86.original +++ /dev/null @@ -1,4110 +0,0 @@ -/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ -/************************************************************ - -Copyright 1987, 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* The panoramix components contained the following notice */ -/**************************************************************** -* * -* Copyright (c) Digital Equipment Corporation, 1991, 1997 * -* * -* All Rights Reserved. Unpublished rights reserved under * -* the copyright laws of the United States. * -* * -* The software contained on this media is proprietary to * -* and embodies the confidential technology of Digital * -* Equipment Corporation. Possession, use, duplication or * -* dissemination of the software and media is authorized only * -* pursuant to a valid written license from Digital Equipment * -* Corporation. * -* * -* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure * -* by the U.S. Government is subject to restrictions as set * -* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, * -* or in FAR 52.227-19, as applicable. * -* * -*****************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.29 2003/01/12 02:44:26 dawes Exp $ */ - -#ifdef PANORAMIX_DEBUG -#include -int ProcInitialConnection(); -#endif - -#include "windowstr.h" -#include "fontstruct.h" -#include "dixfontstr.h" -#include "gcstruct.h" -#include "selection.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "opaque.h" -#include "input.h" -#include "servermd.h" -#include "extnsionst.h" -#include "dixfont.h" -#include "dispatch.h" -#include "swaprep.h" -#include "swapreq.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif -#ifdef XAPPGROUP -#include "Xagsrv.h" -#endif -#ifdef XKB -#define XKB_IN_SERVER -#include "inputstr.h" -#include "XKBsrv.h" -#endif -#ifdef LBX -#include "lbxserve.h" -#endif - -#define mskcnt ((MAXCLIENTS + 31) / 32) -#define BITMASK(i) (1U << ((i) & 31)) -#define MASKIDX(i) ((i) >> 5) -#define MASKWORD(buf, i) buf[MASKIDX(i)] -#define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i) -#define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i) -#define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i)) - -extern xConnSetupPrefix connSetupPrefix; -extern char *ConnectionInfo; - -Selection *CurrentSelections; -int NumCurrentSelections; - -static ClientPtr grabClient; -#define GrabNone 0 -#define GrabActive 1 -#define GrabKickout 2 -static int grabState = GrabNone; -static long grabWaiters[mskcnt]; -CallbackListPtr ServerGrabCallback = NULL; -HWEventQueuePtr checkForInput[2]; -extern int connBlockScreenStart; - -static void KillAllClients( -#if NeedFunctionPrototypes - void -#endif -); - -static void DeleteClientFromAnySelections( -#if NeedFunctionPrototypes - ClientPtr /*client*/ -#endif -); - -static int nextFreeClientID; /* always MIN free client ID */ - -static int nClients; /* number of authorized clients */ - -CallbackListPtr ClientStateCallback; -char dispatchException = 0; -char isItTimeToYield; - -/* Various of the DIX function interfaces were not designed to allow - * the client->errorValue to be set on BadValue and other errors. - * Rather than changing interfaces and breaking untold code we introduce - * a new global that dispatch can use. - */ -XID clientErrorValue; /* XXX this is a kludge */ - -#define SAME_SCREENS(a, b) (\ - (a.pScreen == b.pScreen)) - -void -SetInputCheck(c0, c1) - HWEventQueuePtr c0, c1; -{ - checkForInput[0] = c0; - checkForInput[1] = c1; -} - -void -UpdateCurrentTime() -{ - TimeStamp systime; - - /* To avoid time running backwards, we must call GetTimeInMillis before - * calling ProcessInputEvents. - */ - systime.months = currentTime.months; - systime.milliseconds = GetTimeInMillis(); - if (systime.milliseconds < currentTime.milliseconds) - systime.months++; - if (*checkForInput[0] != *checkForInput[1]) - ProcessInputEvents(); - if (CompareTimeStamps(systime, currentTime) == LATER) - currentTime = systime; -} - -/* Like UpdateCurrentTime, but can't call ProcessInputEvents */ -void -UpdateCurrentTimeIf() -{ - TimeStamp systime; - - systime.months = currentTime.months; - systime.milliseconds = GetTimeInMillis(); - if (systime.milliseconds < currentTime.milliseconds) - systime.months++; - if (*checkForInput[0] == *checkForInput[1]) - currentTime = systime; -} - -void -InitSelections() -{ - if (CurrentSelections) - xfree(CurrentSelections); - CurrentSelections = (Selection *)NULL; - NumCurrentSelections = 0; -} - -void -FlushClientCaches(id) - XID id; -{ - int i; - register ClientPtr client; - - client = clients[CLIENT_ID(id)]; - if (client == NullClient) - return ; - for (i=0; ilastDrawableID == id) - { - client->lastDrawableID = WindowTable[0]->drawable.id; - client->lastDrawable = (DrawablePtr)WindowTable[0]; - } - else if (client->lastGCID == id) - { - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } - } - } -} -#ifdef SMART_SCHEDULE - -#undef SMART_DEBUG - -#define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ -#define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ - -Bool SmartScheduleDisable; -long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; -long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; -long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; -long SmartScheduleTime; -ClientPtr SmartLastClient; -int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1]; -int SmartScheduleClient(int *clientReady, int nready); - -#ifdef SMART_DEBUG -long SmartLastPrint; -#endif - -void Dispatch(void); -void InitProcVectors(void); - -int -SmartScheduleClient (int *clientReady, int nready) -{ - ClientPtr pClient; - int i; - int client; - int bestPrio, best = 0; - int bestRobin, robin; - long now = SmartScheduleTime; - long idle; - - bestPrio = -0x7fffffff; - bestRobin = 0; - idle = 2 * SmartScheduleSlice; - for (i = 0; i < nready; i++) - { - client = clientReady[i]; - pClient = clients[client]; - /* Praise clients which are idle */ - if ((now - pClient->smart_check_tick) >= idle) - { - if (pClient->smart_priority < 0) - pClient->smart_priority++; - } - pClient->smart_check_tick = now; - - /* check priority to select best client */ - robin = (pClient->index - SmartLastIndex[pClient->smart_priority-SMART_MIN_PRIORITY]) & 0xff; - if (pClient->smart_priority > bestPrio || - (pClient->smart_priority == bestPrio && robin > bestRobin)) - { - bestPrio = pClient->smart_priority; - bestRobin = robin; - best = client; - } -#ifdef SMART_DEBUG - if ((now - SmartLastPrint) >= 5000) - fprintf (stderr, " %2d: %3d", client, pClient->smart_priority); -#endif - } -#ifdef SMART_DEBUG - if ((now - SmartLastPrint) >= 5000) - { - fprintf (stderr, " use %2d\n", best); - SmartLastPrint = now; - } -#endif - pClient = clients[best]; - SmartLastIndex[bestPrio-SMART_MIN_PRIORITY] = pClient->index; - /* - * Set current client pointer - */ - if (SmartLastClient != pClient) - { - pClient->smart_start_tick = now; - SmartLastClient = pClient; - } - /* - * Adjust slice - */ - if (nready == 1) - { - /* - * If it's been a long time since another client - * has run, bump the slice up to get maximal - * performance from a single client - */ - if ((now - pClient->smart_start_tick) > 1000 && - SmartScheduleSlice < SmartScheduleMaxSlice) - { - SmartScheduleSlice += SmartScheduleInterval; - } - } - else - { - SmartScheduleSlice = SmartScheduleInterval; - } - return best; -} -#endif - -#define MAJOROP ((xReq *)client->requestBuffer)->reqType - -void -Dispatch(void) -{ - register int *clientReady; /* array of request ready clients */ - register int result; - register ClientPtr client; - register int nready; - register HWEventQueuePtr* icheck = checkForInput; -#ifdef SMART_SCHEDULE - int start_tick; -#endif - - #ifdef __DARWIN__ - extern char dispatchExceptionAtReset; - #endif - - nextFreeClientID = 1; - InitSelections(); - nClients = 0; - - clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients); - if (!clientReady) - return; - - while (!dispatchException) - { - if (*icheck[0] != *icheck[1]) - { - ProcessInputEvents(); - FlushIfCriticalOutputPending(); - } - - nready = WaitForSomething(clientReady); - -#ifdef SMART_SCHEDULE - if (nready && !SmartScheduleDisable) - { - clientReady[0] = SmartScheduleClient (clientReady, nready); - nready = 1; - } -#endif - /***************** - * Handle events in round robin fashion, doing input between - * each round - *****************/ - - while (!dispatchException && (--nready >= 0)) - { - client = clients[clientReady[nready]]; - if (! client) - { - /* KillClient can cause this to happen */ - continue; - } - /* GrabServer activation can cause this to be true */ - if (grabState == GrabKickout) - { - grabState = GrabActive; - break; - } - isItTimeToYield = FALSE; - - requestingClient = client; -#ifdef SMART_SCHEDULE - start_tick = SmartScheduleTime; -#endif - while (!isItTimeToYield) - { - if (*icheck[0] != *icheck[1]) - { - ProcessInputEvents(); - FlushIfCriticalOutputPending(); - } -#ifdef SMART_SCHEDULE - if (!SmartScheduleDisable && - (SmartScheduleTime - start_tick) >= SmartScheduleSlice) - { - /* Penalize clients which consume ticks */ - if (client->smart_priority > SMART_MIN_PRIORITY) - client->smart_priority--; - break; - } -#endif - /* now, finally, deal with client requests */ - - result = ReadRequestFromClient(client); - if (result <= 0) - { - if (result < 0) - CloseDownClient(client); - break; - } - - client->sequence++; -#ifdef DEBUG - if (client->requestLogIndex == MAX_REQUEST_LOG) - client->requestLogIndex = 0; - client->requestLog[client->requestLogIndex] = MAJOROP; - client->requestLogIndex++; -#endif - if (result > (MAX_BIG_REQUEST_SIZE << 2)) - result = BadLength; - else - result = (* client->requestVector[MAJOROP])(client); - - if (result != Success) - { - if (client->noClientException != Success) - CloseDownClient(client); - else - SendErrorToClient(client, MAJOROP, - MinorOpcodeOfRequest(client), - client->errorValue, result); - break; - } - } - FlushAllOutput(); -#ifdef SMART_SCHEDULE - client = clients[clientReady[nready]]; - if (client) - client->smart_stop_tick = SmartScheduleTime; -#endif - requestingClient = NULL; - } - dispatchException &= ~DE_PRIORITYCHANGE; - - /* - * On Darwin we found that the it is not possible - * to get the correct keyboard layout unless it is - * set on the local machine, before the NX session - * is started, by using xmodmap. As we set the key- - * board locally, we must prevent the X server to - * reset, otherwise we would loose any local confi- - * guration. The code below is aimed at this. Note - * also that a statically compiled version of xmod- - * map is included in the MacOS/X package. - */ - - #ifdef __DARWIN__ - - if (dispatchException & DE_RESET ) - { - dispatchException &= ~DE_RESET; - - dispatchExceptionAtReset = DE_TERMINATE; - } - - #endif /* __DARWIN__ */ - - } - KillAllClients(); - DEALLOCATE_LOCAL(clientReady); - dispatchException &= ~DE_RESET; -} - -#undef MAJOROP - -/*ARGSUSED*/ -int -ProcBadRequest(client) - ClientPtr client; -{ - return (BadRequest); -} - -int -ProcCreateWindow(client) - register ClientPtr client; -{ - register WindowPtr pParent, pWin; - REQUEST(xCreateWindowReq); - int result; - int len; - - REQUEST_AT_LEAST_SIZE(xCreateWindowReq); - - LEGAL_NEW_RESOURCE(stuff->wid, client); - if (!(pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess))) - return BadWindow; - len = client->req_len - (sizeof(xCreateWindowReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - pWin = CreateWindow(stuff->wid, pParent, stuff->x, - stuff->y, stuff->width, stuff->height, - stuff->borderWidth, stuff->class, - stuff->mask, (XID *) &stuff[1], - (int)stuff->depth, - client, stuff->visual, &result); - if (pWin) - { - Mask mask = pWin->eventMask; - - pWin->eventMask = 0; /* subterfuge in case AddResource fails */ - if (!AddResource(stuff->wid, RT_WINDOW, (pointer)pWin)) - return BadAlloc; - pWin->eventMask = mask; - } - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcChangeWindowAttributes(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xChangeWindowAttributesReq); - register int result; - int len; - - REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2); - if (len != Ones(stuff->valueMask)) - return BadLength; - result = ChangeWindowAttributes(pWin, - stuff->valueMask, - (XID *) &stuff[1], - client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcGetWindowAttributes(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - xGetWindowAttributesReply wa; - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - GetWindowAttributes(pWin, client, &wa); - WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa); - return(client->noClientException); -} - -int -ProcDestroyWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); - if (!pWin) - return(BadWindow); - if (pWin->parent) - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); -} - -int -ProcDestroySubwindows(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); - if (!pWin) - return(BadWindow); - DestroySubwindows(pWin, client); - return(client->noClientException); -} - -int -ProcChangeSaveSet(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xChangeSaveSetReq); - register int result; - - REQUEST_SIZE_MATCH(xChangeSaveSetReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) - return BadMatch; - if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete)) - { - result = AlterSaveSetForClient(client, pWin, stuff->mode); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - { - client->errorValue = stuff->mode; - return( BadValue ); - } -} - -int -ProcReparentWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin, pParent; - REQUEST(xReparentWindowReq); - register int result; - - REQUEST_SIZE_MATCH(xReparentWindowReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess); - if (!pParent) - return(BadWindow); - if (SAME_SCREENS(pWin->drawable, pParent->drawable)) - { - if ((pWin->backgroundState == ParentRelative) && - (pParent->drawable.depth != pWin->drawable.depth)) - return BadMatch; - if ((pWin->drawable.class != InputOnly) && - (pParent->drawable.class == InputOnly)) - return BadMatch; - result = ReparentWindow(pWin, pParent, - (short)stuff->x, (short)stuff->y, client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - return (BadMatch); -} - -int -ProcMapWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - MapWindow(pWin, client); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcMapSubwindows(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - MapSubwindows(pWin, client); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcUnmapWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - UnmapWindow(pWin, FALSE); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcUnmapSubwindows(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - UnmapSubwindows(pWin); - return(client->noClientException); -} - -int -ProcConfigureWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xConfigureWindowReq); - register int result; - int len; - - REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - len = client->req_len - (sizeof(xConfigureWindowReq) >> 2); - if (Ones((Mask)stuff->mask) != len) - return BadLength; - result = ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1], - client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcCirculateWindow(client) - register ClientPtr client; -{ - register WindowPtr pWin; - REQUEST(xCirculateWindowReq); - - REQUEST_SIZE_MATCH(xCirculateWindowReq); - if ((stuff->direction != RaiseLowest) && - (stuff->direction != LowerHighest)) - { - client->errorValue = stuff->direction; - return BadValue; - } - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - CirculateWindow(pWin, (int)stuff->direction, client); - return(client->noClientException); -} - -int -GetGeometry(client, rep) - register ClientPtr client; - xGetGeometryReply *rep; -{ - register DrawablePtr pDraw; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, SecurityReadAccess); - rep->type = X_Reply; - rep->length = 0; - rep->sequenceNumber = client->sequence; - rep->root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - rep->depth = pDraw->depth; - rep->width = pDraw->width; - rep->height = pDraw->height; - - /* XXX - Because the pixmap-implementation of the multibuffer extension - * may have the buffer-id's drawable resource value be a pointer - * to the buffer's window instead of the buffer itself - * (this happens if the buffer is the displayed buffer), - * we also have to check that the id matches before we can - * truly say that it is a DRAWABLE_WINDOW. - */ - - if ((pDraw->type == UNDRAWABLE_WINDOW) || - ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id))) - { - register WindowPtr pWin = (WindowPtr)pDraw; - rep->x = pWin->origin.x - wBorderWidth (pWin); - rep->y = pWin->origin.y - wBorderWidth (pWin); - rep->borderWidth = pWin->borderWidth; - } - else /* DRAWABLE_PIXMAP or DRAWABLE_BUFFER */ - { - rep->x = rep->y = rep->borderWidth = 0; - } - - return Success; -} - - -int -ProcGetGeometry(client) - register ClientPtr client; -{ - xGetGeometryReply rep; - int status; - - if ((status = GetGeometry(client, &rep)) != Success) - return status; - - WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); - return(client->noClientException); -} - - -int -ProcQueryTree(client) - register ClientPtr client; -{ - xQueryTreeReply reply; - int numChildren = 0; - register WindowPtr pChild, pWin, pHead; - Window *childIDs = (Window *)NULL; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - reply.type = X_Reply; - reply.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - reply.sequenceNumber = client->sequence; - if (pWin->parent) - reply.parent = pWin->parent->drawable.id; - else - reply.parent = (Window)None; - pHead = RealChildHead(pWin); - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - numChildren++; - if (numChildren) - { - int curChild = 0; - - childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window)); - if (!childIDs) - return BadAlloc; - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - childIDs[curChild++] = pChild->drawable.id; - } - - reply.nChildren = numChildren; - reply.length = (numChildren * sizeof(Window)) >> 2; - - WriteReplyToClient(client, sizeof(xQueryTreeReply), &reply); - if (numChildren) - { - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs); - DEALLOCATE_LOCAL(childIDs); - } - - return(client->noClientException); -} - -int -ProcInternAtom(client) - register ClientPtr client; -{ - Atom atom; - char *tchar; - REQUEST(xInternAtomReq); - - REQUEST_FIXED_SIZE(xInternAtomReq, stuff->nbytes); - if ((stuff->onlyIfExists != xTrue) && (stuff->onlyIfExists != xFalse)) - { - client->errorValue = stuff->onlyIfExists; - return(BadValue); - } - tchar = (char *) &stuff[1]; - atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); - if (atom != BAD_RESOURCE) - { - xInternAtomReply reply; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.atom = atom; - WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); - return(client->noClientException); - } - else - return (BadAlloc); -} - -int -ProcGetAtomName(client) - register ClientPtr client; -{ - char *str; - xGetAtomNameReply reply; - int len; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - if ( (str = NameForAtom(stuff->id)) ) - { - len = strlen(str); - reply.type = X_Reply; - reply.length = (len + 3) >> 2; - reply.sequenceNumber = client->sequence; - reply.nameLength = len; - WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); - (void)WriteToClient(client, len, str); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadAtom); - } -} - -#ifdef K5AUTH -extern int k5_bad(); -#endif - -int -ProcSetSelectionOwner(client) - register ClientPtr client; -{ - WindowPtr pWin; - TimeStamp time; - REQUEST(xSetSelectionOwnerReq); - - REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); - UpdateCurrentTime(); - time = ClientTimeToServerTime(stuff->time); - - /* If the client's time stamp is in the future relative to the server's - time stamp, do not set the selection, just return success. */ - if (CompareTimeStamps(time, currentTime) == LATER) - return Success; - if (stuff->window != None) - { - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - } - else - pWin = (WindowPtr)None; - if (ValidAtom(stuff->selection)) - { - int i = 0; - - /* - * First, see if the selection is already set... - */ - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) - i++; - if (i < NumCurrentSelections) - { - xEvent event; - - /* If the timestamp in client's request is in the past relative - to the time stamp indicating the last time the owner of the - selection was set, do not set the selection, just return - success. */ - if (CompareTimeStamps(time, CurrentSelections[i].lastTimeChanged) - == EARLIER) - return Success; - if (CurrentSelections[i].client && - (!pWin || (CurrentSelections[i].client != client))) - { - event.u.u.type = SelectionClear; - event.u.selectionClear.time = time.milliseconds; - event.u.selectionClear.window = CurrentSelections[i].window; - event.u.selectionClear.atom = CurrentSelections[i].selection; - (void) TryClientEvents (CurrentSelections[i].client, &event, 1, - NoEventMask, NoEventMask /* CantBeFiltered */, - NullGrab); - } - } - else - { - /* - * It doesn't exist, so add it... - */ - Selection *newsels; - - if (i == 0) - newsels = (Selection *)xalloc(sizeof(Selection)); - else - newsels = (Selection *)xrealloc(CurrentSelections, - (NumCurrentSelections + 1) * sizeof(Selection)); - if (!newsels) - return BadAlloc; - NumCurrentSelections++; - CurrentSelections = newsels; - CurrentSelections[i].selection = stuff->selection; - } - CurrentSelections[i].lastTimeChanged = time; - CurrentSelections[i].window = stuff->window; - CurrentSelections[i].pWin = pWin; - CurrentSelections[i].client = (pWin ? client : NullClient); - return (client->noClientException); - } - else - { - client->errorValue = stuff->selection; - return (BadAtom); - } -} - -int -ProcGetSelectionOwner(client) - register ClientPtr client; -{ - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - if (ValidAtom(stuff->id)) - { - int i; - xGetSelectionOwnerReply reply; - - i = 0; - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->id) i++; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - if (i < NumCurrentSelections) - reply.owner = CurrentSelections[i].window; - else - reply.owner = None; - WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadAtom); - } -} - -int -ProcConvertSelection(client) - register ClientPtr client; -{ - Bool paramsOkay; - xEvent event; - WindowPtr pWin; - REQUEST(xConvertSelectionReq); - - REQUEST_SIZE_MATCH(xConvertSelectionReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - paramsOkay = (ValidAtom(stuff->selection) && ValidAtom(stuff->target)); - if (stuff->property != None) - paramsOkay &= ValidAtom(stuff->property); - if (paramsOkay) - { - int i; - - i = 0; - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) i++; - if ((i < NumCurrentSelections) && - (CurrentSelections[i].window != None) -#ifdef XCSECURITY - && (!client->CheckAccess || - (* client->CheckAccess)(client, CurrentSelections[i].window, - RT_WINDOW, SecurityReadAccess, - CurrentSelections[i].pWin)) -#endif - ) - { - event.u.u.type = SelectionRequest; - event.u.selectionRequest.time = stuff->time; - event.u.selectionRequest.owner = - CurrentSelections[i].window; - event.u.selectionRequest.requestor = stuff->requestor; - event.u.selectionRequest.selection = stuff->selection; - event.u.selectionRequest.target = stuff->target; - event.u.selectionRequest.property = stuff->property; - if (TryClientEvents( - CurrentSelections[i].client, &event, 1, NoEventMask, - NoEventMask /* CantBeFiltered */, NullGrab)) - return (client->noClientException); - } - event.u.u.type = SelectionNotify; - event.u.selectionNotify.time = stuff->time; - event.u.selectionNotify.requestor = stuff->requestor; - event.u.selectionNotify.selection = stuff->selection; - event.u.selectionNotify.target = stuff->target; - event.u.selectionNotify.property = None; - (void) TryClientEvents(client, &event, 1, NoEventMask, - NoEventMask /* CantBeFiltered */, NullGrab); - return (client->noClientException); - } - else - { - client->errorValue = stuff->property; - return (BadAtom); - } -} - -int -ProcGrabServer(client) - register ClientPtr client; -{ - REQUEST_SIZE_MATCH(xReq); - if (grabState != GrabNone && client != grabClient) - { - ResetCurrentRequest(client); - client->sequence--; - BITSET(grabWaiters, client->index); - IgnoreClient(client); - return(client->noClientException); - } - OnlyListenToOneClient(client); - grabState = GrabKickout; - grabClient = client; - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = SERVER_GRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); - } - - return(client->noClientException); -} - -static void -#if NeedFunctionPrototypes -UngrabServer(ClientPtr client) -#else -UngrabServer(client) - ClientPtr client; -#endif -{ - int i; - - grabState = GrabNone; - ListenToAllClients(); - for (i = mskcnt; --i >= 0 && !grabWaiters[i]; ) - ; - if (i >= 0) - { - i <<= 5; - while (!GETBIT(grabWaiters, i)) - i++; - BITCLEAR(grabWaiters, i); - AttendClient(clients[i]); - } - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = SERVER_UNGRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); - } -} - -int -ProcUngrabServer(client) - register ClientPtr client; -{ - REQUEST_SIZE_MATCH(xReq); - UngrabServer(client); - return(client->noClientException); -} - -int -ProcTranslateCoords(client) - register ClientPtr client; -{ - REQUEST(xTranslateCoordsReq); - - register WindowPtr pWin, pDst; - xTranslateCoordsReply rep; - - REQUEST_SIZE_MATCH(xTranslateCoordsReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, - SecurityReadAccess); - if (!pDst) - return(BadWindow); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (!SAME_SCREENS(pWin->drawable, pDst->drawable)) - { - rep.sameScreen = xFalse; - rep.child = None; - rep.dstX = rep.dstY = 0; - } - else - { - INT16 x, y; - rep.sameScreen = xTrue; - rep.child = None; - /* computing absolute coordinates -- adjust to destination later */ - x = pWin->drawable.x + stuff->srcX; - y = pWin->drawable.y + stuff->srcY; - pWin = pDst->firstChild; - while (pWin) - { -#ifdef SHAPE - BoxRec box; -#endif - if ((pWin->mapped) && - (x >= pWin->drawable.x - wBorderWidth (pWin)) && - (x < pWin->drawable.x + (int)pWin->drawable.width + - wBorderWidth (pWin)) && - (y >= pWin->drawable.y - wBorderWidth (pWin)) && - (y < pWin->drawable.y + (int)pWin->drawable.height + - wBorderWidth (pWin)) -#ifdef SHAPE - /* When a window is shaped, a further check - * is made to see if the point is inside - * borderSize - */ - && (!wBoundingShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - &pWin->borderSize, x, y, &box)) -#endif - ) - { - rep.child = pWin->drawable.id; - pWin = (WindowPtr) NULL; - } - else - pWin = pWin->nextSib; - } - /* adjust to destination coordinates */ - rep.dstX = x - pDst->drawable.x; - rep.dstY = y - pDst->drawable.y; - } - WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); - return(client->noClientException); -} - -int -ProcOpenFont(client) - register ClientPtr client; -{ - int err; - REQUEST(xOpenFontReq); - - REQUEST_FIXED_SIZE(xOpenFontReq, stuff->nbytes); - client->errorValue = stuff->fid; - LEGAL_NEW_RESOURCE(stuff->fid, client); - err = OpenFont(client, stuff->fid, (Mask) 0, - stuff->nbytes, (char *)&stuff[1]); - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcCloseFont(client) - register ClientPtr client; -{ - FontPtr pFont; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityDestroyAccess); - if ( pFont != (FontPtr)NULL) /* id was valid */ - { - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadFont); - } -} - -int -ProcQueryFont(client) - register ClientPtr client; -{ - xQueryFontReply *reply; - FontPtr pFont; - register GC *pGC; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - client->errorValue = stuff->id; /* EITHER font or gc */ - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - /* can't use VERIFY_GC because it might return BadGC */ - pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, - SecurityReadAccess); - if (!pGC) - { - client->errorValue = stuff->id; - return(BadFont); /* procotol spec says only error is BadFont */ - } - pFont = pGC->font; - } - - { - xCharInfo *pmax = FONTINKMAX(pFont); - xCharInfo *pmin = FONTINKMIN(pFont); - int nprotoxcistructs; - int rlength; - - nprotoxcistructs = ( - pmax->rightSideBearing == pmin->rightSideBearing && - pmax->leftSideBearing == pmin->leftSideBearing && - pmax->descent == pmin->descent && - pmax->ascent == pmin->ascent && - pmax->characterWidth == pmin->characterWidth) ? - 0 : N2dChars(pFont); - - rlength = sizeof(xQueryFontReply) + - FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) + - nprotoxcistructs * sizeof(xCharInfo); - reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength); - if(!reply) - { - return(BadAlloc); - } - - reply->type = X_Reply; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->sequenceNumber = client->sequence; - QueryFont( pFont, reply, nprotoxcistructs); - - WriteReplyToClient(client, rlength, reply); - DEALLOCATE_LOCAL(reply); - return(client->noClientException); - } -} - -int -ProcQueryTextExtents(client) - register ClientPtr client; -{ - REQUEST(xQueryTextExtentsReq); - xQueryTextExtentsReply reply; - FontPtr pFont; - GC *pGC; - ExtentInfoRec info; - unsigned long length; - - REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); - - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - pGC = (GC *)SecurityLookupIDByType(client, stuff->fid, RT_GC, - SecurityReadAccess); - if (!pGC) - { - client->errorValue = stuff->fid; - return(BadFont); - } - pFont = pGC->font; - } - length = client->req_len - (sizeof(xQueryTextExtentsReq) >> 2); - length = length << 1; - if (stuff->oddLength) - { - if (length == 0) - return(BadLength); - length--; - } - if (!QueryTextExtents(pFont, length, (unsigned char *)&stuff[1], &info)) - return(BadAlloc); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.drawDirection = info.drawDirection; - reply.fontAscent = info.fontAscent; - reply.fontDescent = info.fontDescent; - reply.overallAscent = info.overallAscent; - reply.overallDescent = info.overallDescent; - reply.overallWidth = info.overallWidth; - reply.overallLeft = info.overallLeft; - reply.overallRight = info.overallRight; - WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply); - return(client->noClientException); -} - -int -ProcListFonts(client) - register ClientPtr client; -{ - REQUEST(xListFontsReq); - - REQUEST_FIXED_SIZE(xListFontsReq, stuff->nbytes); - - return ListFonts(client, (unsigned char *) &stuff[1], stuff->nbytes, - stuff->maxNames); -} - -int -ProcListFontsWithInfo(client) - register ClientPtr client; -{ - REQUEST(xListFontsWithInfoReq); - - REQUEST_FIXED_SIZE(xListFontsWithInfoReq, stuff->nbytes); - - return StartListFontsWithInfo(client, stuff->nbytes, - (unsigned char *) &stuff[1], stuff->maxNames); -} - -/*ARGSUSED*/ -int -dixDestroyPixmap(value, pid) - pointer value; /* must conform to DeleteType */ - XID pid; -{ - PixmapPtr pPixmap = (PixmapPtr)value; - return (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap); -} - -int -ProcCreatePixmap(client) - register ClientPtr client; -{ - PixmapPtr pMap; - register DrawablePtr pDraw; - REQUEST(xCreatePixmapReq); - DepthPtr pDepth; - register int i; - - REQUEST_SIZE_MATCH(xCreatePixmapReq); - client->errorValue = stuff->pid; - LEGAL_NEW_RESOURCE(stuff->pid, client); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } -CreatePmap: - pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, stuff->width, - stuff->height, stuff->depth); - if (pMap) - { - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) - return(client->noClientException); - } - return (BadAlloc); -} - -int -ProcFreePixmap(client) - register ClientPtr client; -{ - PixmapPtr pMap; - - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP, - SecurityDestroyAccess); - if (pMap) - { - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadPixmap); - } -} - -int -ProcCreateGC(client) - register ClientPtr client; -{ - int error; - GC *pGC; - register DrawablePtr pDraw; - unsigned len; - REQUEST(xCreateGCReq); - - REQUEST_AT_LEAST_SIZE(xCreateGCReq); - client->errorValue = stuff->gc; - LEGAL_NEW_RESOURCE(stuff->gc, client); - SECURITY_VERIFY_DRAWABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - len = client->req_len - (sizeof(xCreateGCReq) >> 2); - if (len != Ones(stuff->mask)) - return BadLength; - pGC = (GC *)CreateGC(pDraw, stuff->mask, - (XID *) &stuff[1], &error); - if (error != Success) - return error; - if (!AddResource(stuff->gc, RT_GC, (pointer)pGC)) - return (BadAlloc); - return(client->noClientException); -} - -int -ProcChangeGC(client) - register ClientPtr client; -{ - GC *pGC; - REQUEST(xChangeGCReq); - int result; - unsigned len; - - REQUEST_AT_LEAST_SIZE(xChangeGCReq); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); - len = client->req_len - (sizeof(xChangeGCReq) >> 2); - if (len != Ones(stuff->mask)) - return BadLength; - - result = dixChangeGC(client, pGC, stuff->mask, (CARD32 *) &stuff[1], 0); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcCopyGC(client) - register ClientPtr client; -{ - register GC *dstGC; - register GC *pGC; - int result; - REQUEST(xCopyGCReq); - - REQUEST_SIZE_MATCH(xCopyGCReq); - SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, SecurityReadAccess); - SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, SecurityWriteAccess); - if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) - return (BadMatch); - result = CopyGC(pGC, dstGC, stuff->mask); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcSetDashes(client) - register ClientPtr client; -{ - register GC *pGC; - int result; - REQUEST(xSetDashesReq); - - REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); - if (stuff->nDashes == 0) - { - client->errorValue = 0; - return BadValue; - } - - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); - - result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes, - (unsigned char *)&stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcSetClipRectangles(client) - register ClientPtr client; -{ - int nr; - int result; - register GC *pGC; - REQUEST(xSetClipRectanglesReq); - - REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); - if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) && - (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded)) - { - client->errorValue = stuff->ordering; - return BadValue; - } - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); - - nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); - if (nr & 4) - return(BadLength); - nr >>= 3; - result = SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin, - nr, (xRectangle *)&stuff[1], (int)stuff->ordering); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcFreeGC(client) - register ClientPtr client; -{ - register GC *pGC; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GC(pGC, stuff->id, client, SecurityDestroyAccess); - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); -} - -int -ProcClearToBackground(client) - register ClientPtr client; -{ - REQUEST(xClearAreaReq); - register WindowPtr pWin; - - REQUEST_SIZE_MATCH(xClearAreaReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (pWin->drawable.class == InputOnly) - { - client->errorValue = stuff->window; - return (BadMatch); - } - if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse)) - { - client->errorValue = stuff->exposures; - return(BadValue); - } - (*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y, - stuff->width, stuff->height, - (Bool)stuff->exposures); - return(client->noClientException); -} - -int -ProcCopyArea(client) - register ClientPtr client; -{ - register DrawablePtr pDst; - register DrawablePtr pSrc; - register GC *pGC; - REQUEST(xCopyAreaReq); - RegionPtr pRgn; - - REQUEST_SIZE_MATCH(xCopyAreaReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client); - if (stuff->dstDrawable != stuff->srcDrawable) - { - SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, - SecurityReadAccess); - if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) - { - client->errorValue = stuff->dstDrawable; - return (BadMatch); - } - } - else - pSrc = pDst; - - SET_DBE_SRCBUF(pSrc, stuff->srcDrawable); - - pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, stuff->srcX, stuff->srcY, - stuff->width, stuff->height, - stuff->dstX, stuff->dstY); - if (pGC->graphicsExposures) - { - (*pDst->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyArea, 0); - if (pRgn) - REGION_DESTROY(pDst->pScreen, pRgn); - } - - return(client->noClientException); -} - -int -ProcCopyPlane(client) - register ClientPtr client; -{ - register DrawablePtr psrcDraw, pdstDraw; - register GC *pGC; - REQUEST(xCopyPlaneReq); - RegionPtr pRgn; - - REQUEST_SIZE_MATCH(xCopyPlaneReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client); - if (stuff->dstDrawable != stuff->srcDrawable) - { - SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, - SecurityReadAccess); - if (pdstDraw->pScreen != psrcDraw->pScreen) - { - client->errorValue = stuff->dstDrawable; - return (BadMatch); - } - } - else - psrcDraw = pdstDraw; - - SET_DBE_SRCBUF(psrcDraw, stuff->srcDrawable); - - /* Check to see if stuff->bitPlane has exactly ONE good bit set */ - if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) || - (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) - { - client->errorValue = stuff->bitPlane; - return(BadValue); - } - - pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC, stuff->srcX, stuff->srcY, - stuff->width, stuff->height, - stuff->dstX, stuff->dstY, stuff->bitPlane); - if (pGC->graphicsExposures) - { - (*pdstDraw->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); - if (pRgn) - REGION_DESTROY(pdstDraw->pScreen, pRgn); - } - return(client->noClientException); -} - -int -ProcPolyPoint(client) - register ClientPtr client; -{ - int npoint; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyPointReq); - - REQUEST_AT_LEAST_SIZE(xPolyPointReq); - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2; - if (npoint) - (*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint, - (xPoint *) &stuff[1]); - return (client->noClientException); -} - -int -ProcPolyLine(client) - register ClientPtr client; -{ - int npoint; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyLineReq); - - REQUEST_AT_LEAST_SIZE(xPolyLineReq); - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2; - if (npoint > 1) - (*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint, - (DDXPointPtr) &stuff[1]); - return(client->noClientException); -} - -int -ProcPolySegment(client) - register ClientPtr client; -{ - int nsegs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolySegmentReq); - - REQUEST_AT_LEAST_SIZE(xPolySegmentReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); - if (nsegs & 4) - return(BadLength); - nsegs >>= 3; - if (nsegs) - (*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]); - return (client->noClientException); -} - -int -ProcPolyRectangle (client) - register ClientPtr client; -{ - int nrects; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyRectangleReq); - - REQUEST_AT_LEAST_SIZE(xPolyRectangleReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); - if (nrects & 4) - return(BadLength); - nrects >>= 3; - if (nrects) - (*pGC->ops->PolyRectangle)(pDraw, pGC, - nrects, (xRectangle *) &stuff[1]); - return(client->noClientException); -} - -int -ProcPolyArc(client) - register ClientPtr client; -{ - int narcs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyArcReq); - - REQUEST_AT_LEAST_SIZE(xPolyArcReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - narcs = (client->req_len << 2) - sizeof(xPolyArcReq); - if (narcs % sizeof(xArc)) - return(BadLength); - narcs /= sizeof(xArc); - if (narcs) - (*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]); - return (client->noClientException); -} - -int -ProcFillPoly(client) - register ClientPtr client; -{ - int things; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xFillPolyReq); - - REQUEST_AT_LEAST_SIZE(xFillPolyReq); - if ((stuff->shape != Complex) && (stuff->shape != Nonconvex) && - (stuff->shape != Convex)) - { - client->errorValue = stuff->shape; - return BadValue; - } - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - things = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2; - if (things) - (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape, - stuff->coordMode, things, - (DDXPointPtr) &stuff[1]); - return(client->noClientException); -} - -int -ProcPolyFillRectangle(client) - register ClientPtr client; -{ - int things; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyFillRectangleReq); - - REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); - if (things & 4) - return(BadLength); - things >>= 3; - - if (things) - (*pGC->ops->PolyFillRect) (pDraw, pGC, things, - (xRectangle *) &stuff[1]); - return (client->noClientException); -} - -int -ProcPolyFillArc(client) - register ClientPtr client; -{ - int narcs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyFillArcReq); - - REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); - if (narcs % sizeof(xArc)) - return(BadLength); - narcs /= sizeof(xArc); - if (narcs) - (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]); - return (client->noClientException); -} - -#ifdef MATCH_CLIENT_ENDIAN - -int -ServerOrder (void) -{ - int whichbyte = 1; - - if (*((char *) &whichbyte)) - return LSBFirst; - return MSBFirst; -} - -#define ClientOrder(client) ((client)->swapped ? !ServerOrder() : ServerOrder()) - -void -ReformatImage (char *base, int nbytes, int bpp, int order) -{ - switch (bpp) { - case 1: /* yuck */ - if (BITMAP_BIT_ORDER != order) - BitOrderInvert ((unsigned char *) base, nbytes); -#if IMAGE_BYTE_ORDER != BITMAP_BIT_ORDER && BITMAP_SCANLINE_UNIT != 8 - ReformatImage (base, nbytes, BITMAP_SCANLINE_UNIT, order); -#endif - break; - case 4: - break; /* yuck */ - case 8: - break; - case 16: - if (IMAGE_BYTE_ORDER != order) - TwoByteSwap ((unsigned char *) base, nbytes); - break; - case 32: - if (IMAGE_BYTE_ORDER != order) - FourByteSwap ((unsigned char *) base, nbytes); - break; - } -} -#else -#define ReformatImage(b,n,bpp,o) -#endif - -/* 64-bit server notes: the protocol restricts padding of images to - * 8-, 16-, or 32-bits. We would like to have 64-bits for the server - * to use internally. Removes need for internal alignment checking. - * All of the PutImage functions could be changed individually, but - * as currently written, they call other routines which require things - * to be 64-bit padded on scanlines, so we changed things here. - * If an image would be padded differently for 64- versus 32-, then - * copy each scanline to a 64-bit padded scanline. - * Also, we need to make sure that the image is aligned on a 64-bit - * boundary, even if the scanlines are padded to our satisfaction. - */ -int -ProcPutImage(client) - register ClientPtr client; -{ - register GC *pGC; - register DrawablePtr pDraw; - long length; /* length of scanline server padded */ - long lengthProto; /* length of scanline protocol padded */ - char *tmpImage; - REQUEST(xPutImageReq); - - REQUEST_AT_LEAST_SIZE(xPutImageReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - if (stuff->format == XYBitmap) - { - if ((stuff->depth != 1) || - (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad)) - return BadMatch; - length = BitmapBytePad(stuff->width + stuff->leftPad); - } - else if (stuff->format == XYPixmap) - { - if ((pDraw->depth != stuff->depth) || - (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad)) - return BadMatch; - length = BitmapBytePad(stuff->width + stuff->leftPad); - length *= stuff->depth; - } - else if (stuff->format == ZPixmap) - { - if ((pDraw->depth != stuff->depth) || (stuff->leftPad != 0)) - return BadMatch; - length = PixmapBytePad(stuff->width, stuff->depth); - } - else - { - client->errorValue = stuff->format; - return BadValue; - } - - tmpImage = (char *)&stuff[1]; - lengthProto = length; - - if (((((lengthProto * stuff->height) + (unsigned)3) >> 2) + - (sizeof(xPutImageReq) >> 2)) != client->req_len) - return BadLength; - - ReformatImage (tmpImage, lengthProto * stuff->height, - stuff->format == ZPixmap ? BitsPerPixel (stuff->depth) : 1, - ClientOrder(client)); - - (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, stuff->dstX, stuff->dstY, - stuff->width, stuff->height, - stuff->leftPad, stuff->format, tmpImage); - - return (client->noClientException); -} - - -int -DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return) - register ClientPtr client; - Drawable drawable; - int format; - int x, y, width, height; - Mask planemask; - xGetImageReply **im_return; -{ - register DrawablePtr pDraw; - int nlines, linesPerBuf; - register int linesDone; - long widthBytesLine, length; - Mask plane = 0; - char *pBuf; - xGetImageReply xgi; - RegionPtr pVisibleRegion = NULL; - - if ((format != XYPixmap) && (format != ZPixmap)) - { - client->errorValue = format; - return(BadValue); - } - SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, SecurityReadAccess); - if(pDraw->type == DRAWABLE_WINDOW) - { - if( /* check for being viewable */ - !((WindowPtr) pDraw)->realized || - /* check for being on screen */ - pDraw->x + x < 0 || - pDraw->x + x + width > pDraw->pScreen->width || - pDraw->y + y < 0 || - pDraw->y + y + height > pDraw->pScreen->height || - /* check for being inside of border */ - x < - wBorderWidth((WindowPtr)pDraw) || - x + width > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - y < -wBorderWidth((WindowPtr)pDraw) || - y + height > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height - ) - return(BadMatch); - xgi.visual = wVisual (((WindowPtr) pDraw)); - } - else - { - if(x < 0 || - x+width > (int)pDraw->width || - y < 0 || - y+height > (int)pDraw->height - ) - return(BadMatch); - xgi.visual = None; - } - - SET_DBE_SRCBUF(pDraw, drawable); - - xgi.type = X_Reply; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - if(format == ZPixmap) - { - widthBytesLine = PixmapBytePad(width, pDraw->depth); - length = widthBytesLine * height; - - } - else - { - widthBytesLine = BitmapBytePad(width); - plane = ((Mask)1) << (pDraw->depth - 1); - /* only planes asked for */ - length = widthBytesLine * height * - Ones(planemask & (plane | (plane - 1))); - - } - - xgi.length = length; - - if (im_return) { - pBuf = (char *)xalloc(sz_xGetImageReply + length); - if (!pBuf) - return (BadAlloc); - if (widthBytesLine == 0) - linesPerBuf = 0; - else - linesPerBuf = height; - *im_return = (xGetImageReply *)pBuf; - *(xGetImageReply *)pBuf = xgi; - pBuf += sz_xGetImageReply; - } else { - xgi.length = (xgi.length + 3) >> 2; - if (widthBytesLine == 0 || height == 0) - linesPerBuf = 0; - else if (widthBytesLine >= IMAGE_BUFSIZE) - linesPerBuf = 1; - else - { - linesPerBuf = IMAGE_BUFSIZE / widthBytesLine; - if (linesPerBuf > height) - linesPerBuf = height; - } - length = linesPerBuf * widthBytesLine; - if (linesPerBuf < height) - { - /* we have to make sure intermediate buffers don't need padding */ - while ((linesPerBuf > 1) && - (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1))) - { - linesPerBuf--; - length -= widthBytesLine; - } - while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1)) - { - linesPerBuf++; - length += widthBytesLine; - } - } - if(!(pBuf = (char *) ALLOCATE_LOCAL(length))) - return (BadAlloc); - WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); - } - -#ifdef XCSECURITY - if (client->trustLevel != XSecurityClientTrusted && - pDraw->type == DRAWABLE_WINDOW) - { - pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw); - if (pVisibleRegion) - { - REGION_TRANSLATE(pScreen, pVisibleRegion, -pDraw->x, -pDraw->y); - } - } -#endif - - if (linesPerBuf == 0) - { - /* nothing to do */ - } - else if (format == ZPixmap) - { - linesDone = 0; - while (height - linesDone > 0) - { - nlines = min(linesPerBuf, height - linesDone); - (*pDraw->pScreen->GetImage) (pDraw, - x, - y + linesDone, - width, - nlines, - format, - planemask, - (pointer) pBuf); -#ifdef XCSECURITY - if (pVisibleRegion) - SecurityCensorImage(client, pVisibleRegion, widthBytesLine, - pDraw, x, y + linesDone, width, - nlines, format, pBuf); -#endif - - /* Note that this is NOT a call to WriteSwappedDataToClient, - as we do NOT byte swap */ - if (!im_return) - { - ReformatImage (pBuf, (int)(nlines * widthBytesLine), - BitsPerPixel (pDraw->depth), - ClientOrder(client)); - -/* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, - (int)(nlines * widthBytesLine), - pBuf); - } - linesDone += nlines; - } - } - else /* XYPixmap */ - { - for (; plane; plane >>= 1) - { - if (planemask & plane) - { - linesDone = 0; - while (height - linesDone > 0) - { - nlines = min(linesPerBuf, height - linesDone); - (*pDraw->pScreen->GetImage) (pDraw, - x, - y + linesDone, - width, - nlines, - format, - plane, - (pointer)pBuf); -#ifdef XCSECURITY - if (pVisibleRegion) - SecurityCensorImage(client, pVisibleRegion, - widthBytesLine, - pDraw, x, y + linesDone, width, - nlines, format, pBuf); -#endif - - /* Note: NOT a call to WriteSwappedDataToClient, - as we do NOT byte swap */ - if (im_return) { - pBuf += nlines * widthBytesLine; - } else { - ReformatImage (pBuf, - (int)(nlines * widthBytesLine), - 1, - ClientOrder (client)); - -/* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, - (int)(nlines * widthBytesLine), - pBuf); - } - linesDone += nlines; - } - } - } - } -#ifdef XCSECURITY - if (pVisibleRegion) - REGION_DESTROY(pScreen, pVisibleRegion); -#endif - if (!im_return) - DEALLOCATE_LOCAL(pBuf); - return (client->noClientException); -} - -int -ProcGetImage(client) - register ClientPtr client; -{ - REQUEST(xGetImageReq); - - REQUEST_SIZE_MATCH(xGetImageReq); - - return DoGetImage(client, stuff->format, stuff->drawable, - stuff->x, stuff->y, - (int)stuff->width, (int)stuff->height, - stuff->planeMask, (xGetImageReply **)NULL); -} - -int -ProcPolyText(client) - register ClientPtr client; -{ - int err; - REQUEST(xPolyTextReq); - DrawablePtr pDraw; - GC *pGC; - - REQUEST_AT_LEAST_SIZE(xPolyTextReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = PolyText(client, - pDraw, - pGC, - (unsigned char *)&stuff[1], - ((unsigned char *) stuff) + (client->req_len << 2), - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcImageText8(client) - register ClientPtr client; -{ - int err; - register DrawablePtr pDraw; - register GC *pGC; - - REQUEST(xImageTextReq); - - REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = ImageText(client, - pDraw, - pGC, - stuff->nChars, - (unsigned char *)&stuff[1], - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcImageText16(client) - register ClientPtr client; -{ - int err; - register DrawablePtr pDraw; - register GC *pGC; - - REQUEST(xImageTextReq); - - REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = ImageText(client, - pDraw, - pGC, - stuff->nChars, - (unsigned char *)&stuff[1], - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - - -int -ProcCreateColormap(client) - register ClientPtr client; -{ - VisualPtr pVisual; - ColormapPtr pmap; - Colormap mid; - register WindowPtr pWin; - ScreenPtr pScreen; - REQUEST(xCreateColormapReq); - int i, result; - - REQUEST_SIZE_MATCH(xCreateColormapReq); - - if ((stuff->alloc != AllocNone) && (stuff->alloc != AllocAll)) - { - client->errorValue = stuff->alloc; - return(BadValue); - } - mid = stuff->mid; - LEGAL_NEW_RESOURCE(mid, client); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - pScreen = pWin->drawable.pScreen; - for (i = 0, pVisual = pScreen->visuals; - i < pScreen->numVisuals; - i++, pVisual++) - { - if (pVisual->vid != stuff->visual) - continue; - result = CreateColormap(mid, pScreen, pVisual, &pmap, - (int)stuff->alloc, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - client->errorValue = stuff->visual; - return(BadValue); -} - -int -ProcFreeColormap(client) - register ClientPtr client; -{ - ColormapPtr pmap; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pmap = (ColormapPtr )SecurityLookupIDByType(client, stuff->id, RT_COLORMAP, - SecurityDestroyAccess); - if (pmap) - { - /* Freeing a default colormap is a no-op */ - if (!(pmap->flags & IsDefault)) - FreeResource(stuff->id, RT_NONE); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - - -int -ProcCopyColormapAndFree(client) - register ClientPtr client; -{ - Colormap mid; - ColormapPtr pSrcMap; - REQUEST(xCopyColormapAndFreeReq); - int result; - - REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); - mid = stuff->mid; - LEGAL_NEW_RESOURCE(mid, client); - if( (pSrcMap = (ColormapPtr )SecurityLookupIDByType(client, stuff->srcCmap, - RT_COLORMAP, SecurityReadAccess|SecurityWriteAccess)) ) - { - result = CopyColormapAndFree(mid, pSrcMap, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - { - client->errorValue = stuff->srcCmap; - return(BadColor); - } -} - -int -ProcInstallColormap(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - (*(pcmp->pScreen->InstallColormap)) (pcmp); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - -int -ProcUninstallColormap(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - if(pcmp->mid != pcmp->pScreen->defColormap) - (*(pcmp->pScreen->UninstallColormap)) (pcmp); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - -int -ProcListInstalledColormaps(client) - register ClientPtr client; -{ - xListInstalledColormapsReply *preply; - int nummaps; - WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - - if (!pWin) - return(BadWindow); - - preply = (xListInstalledColormapsReply *) - ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) + - pWin->drawable.pScreen->maxInstalledCmaps * - sizeof(Colormap)); - if(!preply) - return(BadAlloc); - - preply->type = X_Reply; - preply->sequenceNumber = client->sequence; - nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) - (pWin->drawable.pScreen, (Colormap *)&preply[1]); - preply->nColormaps = nummaps; - preply->length = nummaps; - WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); - DEALLOCATE_LOCAL(preply); - return(client->noClientException); -} - -int -ProcAllocColor(client) - register ClientPtr client; -{ - ColormapPtr pmap; - int retval; - xAllocColorReply acr; - REQUEST(xAllocColorReq); - - REQUEST_SIZE_MATCH(xAllocColorReq); - pmap = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pmap) - { -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColor request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pmap, (xReq *) stuff)) - return Success; -#endif - acr.type = X_Reply; - acr.length = 0; - acr.sequenceNumber = client->sequence; - acr.red = stuff->red; - acr.green = stuff->green; - acr.blue = stuff->blue; - acr.pixel = 0; - if( (retval = AllocColor(pmap, &acr.red, &acr.green, &acr.blue, - &acr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return (retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pmap->pScreen->myNum) -#endif - WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); - return (client->noClientException); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocNamedColor (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xAllocNamedColorReq); - - REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int retval; - - xAllocNamedColorReply ancr; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocNamedColor request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - ancr.type = X_Reply; - ancr.length = 0; - ancr.sequenceNumber = client->sequence; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes, - &ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) - { - ancr.screenRed = ancr.exactRed; - ancr.screenGreen = ancr.exactGreen; - ancr.screenBlue = ancr.exactBlue; - ancr.pixel = 0; - if( (retval = AllocColor(pcmp, - &ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue, - &ancr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr); - return (client->noClientException); - } - else - return(BadName); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocColorCells (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xAllocColorCellsReq); - - REQUEST_SIZE_MATCH(xAllocColorCellsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xAllocColorCellsReply accr; - int npixels, nmasks, retval; - long length; - Pixel *ppixels, *pmasks; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColorCells request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - npixels = stuff->colors; - if (!npixels) - { - client->errorValue = npixels; - return (BadValue); - } - if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) - { - client->errorValue = stuff->contiguous; - return (BadValue); - } - nmasks = stuff->planes; - length = ((long)npixels + (long)nmasks) * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); - if(!ppixels) - return(BadAlloc); - pmasks = ppixels + npixels; - - if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks, - (Bool)stuff->contiguous, ppixels, pmasks)) ) - { - DEALLOCATE_LOCAL(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - { - accr.type = X_Reply; - accr.length = length >> 2; - accr.sequenceNumber = client->sequence; - accr.nPixels = npixels; - accr.nMasks = nmasks; - WriteReplyToClient(client, sizeof (xAllocColorCellsReply), &accr); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, length, ppixels); - } - DEALLOCATE_LOCAL(ppixels); - return (client->noClientException); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocColorPlanes(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xAllocColorPlanesReq); - - REQUEST_SIZE_MATCH(xAllocColorPlanesReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xAllocColorPlanesReply acpr; - int npixels, retval; - long length; - Pixel *ppixels; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColorPlanes request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - npixels = stuff->colors; - if (!npixels) - { - client->errorValue = npixels; - return (BadValue); - } - if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) - { - client->errorValue = stuff->contiguous; - return (BadValue); - } - acpr.type = X_Reply; - acpr.sequenceNumber = client->sequence; - acpr.nPixels = npixels; - length = (long)npixels * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); - if(!ppixels) - return(BadAlloc); - if( (retval = AllocColorPlanes(client->index, pcmp, npixels, - (int)stuff->red, (int)stuff->green, (int)stuff->blue, - (Bool)stuff->contiguous, ppixels, - &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) ) - { - DEALLOCATE_LOCAL(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } - acpr.length = length >> 2; -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - { - WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, length, ppixels); - } - DEALLOCATE_LOCAL(ppixels); - return (client->noClientException); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcFreeColors (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xFreeColorsReq); - - REQUEST_AT_LEAST_SIZE(xFreeColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int count; - int retval; - - if(pcmp->flags & AllAllocated) - return(BadAccess); - count = ((client->req_len << 2)- sizeof(xFreeColorsReq)) >> 2; - retval = FreeColors(pcmp, client->index, count, - (Pixel *)&stuff[1], (Pixel)stuff->planeMask); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(retval); - } - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcStoreColors (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xStoreColorsReq); - - REQUEST_AT_LEAST_SIZE(xStoreColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int count; - int retval; - - count = (client->req_len << 2) - sizeof(xStoreColorsReq); - if (count % sizeof(xColorItem)) - return(BadLength); - count /= sizeof(xColorItem); - retval = StoreColors(pcmp, count, (xColorItem *)&stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(retval); - } - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcStoreNamedColor (client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xStoreNamedColorReq); - - REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xColorItem def; - int retval; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], - stuff->nbytes, &def.red, &def.green, &def.blue)) - { - def.flags = stuff->flags; - def.pixel = stuff->pixel; - retval = StoreColors(pcmp, 1, &def); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } - return (BadName); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcQueryColors(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xQueryColorsReq); - - REQUEST_AT_LEAST_SIZE(xQueryColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - int count, retval; - xrgb *prgbs; - xQueryColorsReply qcr; - - count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2; - prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb)); - if(!prgbs && count) - return(BadAlloc); - if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) ) - { - if (prgbs) DEALLOCATE_LOCAL(prgbs); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return (retval); - } - } - qcr.type = X_Reply; - qcr.length = (count * sizeof(xrgb)) >> 2; - qcr.sequenceNumber = client->sequence; - qcr.nColors = count; - WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr); - if (count) - { - client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; - WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); - } - if (prgbs) DEALLOCATE_LOCAL(prgbs); - return(client->noClientException); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcLookupColor(client) - register ClientPtr client; -{ - ColormapPtr pcmp; - REQUEST(xLookupColorReq); - - REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - xLookupColorReply lcr; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes, - &lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue)) - { - lcr.type = X_Reply; - lcr.length = 0; - lcr.sequenceNumber = client->sequence; - lcr.screenRed = lcr.exactRed; - lcr.screenGreen = lcr.exactGreen; - lcr.screenBlue = lcr.exactBlue; - (*pcmp->pScreen->ResolveColor)(&lcr.screenRed, - &lcr.screenGreen, - &lcr.screenBlue, - pcmp->pVisual); - WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr); - return(client->noClientException); - } - return (BadName); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcCreateCursor( client) - register ClientPtr client; -{ - CursorPtr pCursor; - - register PixmapPtr src; - register PixmapPtr msk; - unsigned char * srcbits; - unsigned char * mskbits; - unsigned short width, height; - long n; - CursorMetricRec cm; - - - REQUEST(xCreateCursorReq); - - REQUEST_SIZE_MATCH(xCreateCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - src = (PixmapPtr)SecurityLookupIDByType(client, stuff->source, - RT_PIXMAP, SecurityReadAccess); - msk = (PixmapPtr)SecurityLookupIDByType(client, stuff->mask, - RT_PIXMAP, SecurityReadAccess); - if ( src == (PixmapPtr)NULL) - { - client->errorValue = stuff->source; - return (BadPixmap); - } - if ( msk == (PixmapPtr)NULL) - { - if (stuff->mask != None) - { - client->errorValue = stuff->mask; - return (BadPixmap); - } - } - else if ( src->drawable.width != msk->drawable.width - || src->drawable.height != msk->drawable.height - || src->drawable.depth != 1 - || msk->drawable.depth != 1) - return (BadMatch); - - width = src->drawable.width; - height = src->drawable.height; - - if ( stuff->x > width - || stuff->y > height ) - return (BadMatch); - - n = BitmapBytePad(width)*height; - srcbits = (unsigned char *)xalloc(n); - if (!srcbits) - return (BadAlloc); - mskbits = (unsigned char *)xalloc(n); - if (!mskbits) - { - xfree(srcbits); - return (BadAlloc); - } - - /* zeroing the (pad) bits helps some ddx cursor handling */ - bzero((char *)srcbits, n); - (* src->drawable.pScreen->GetImage)( (DrawablePtr)src, 0, 0, width, height, - XYPixmap, 1, (pointer)srcbits); - if ( msk == (PixmapPtr)NULL) - { - register unsigned char *bits = mskbits; - while (--n >= 0) - *bits++ = ~0; - } - else - { - /* zeroing the (pad) bits helps some ddx cursor handling */ - bzero((char *)mskbits, n); - (* msk->drawable.pScreen->GetImage)( (DrawablePtr)msk, 0, 0, width, - height, XYPixmap, 1, (pointer)mskbits); - } - cm.width = width; - cm.height = height; - cm.xhot = stuff->x; - cm.yhot = stuff->y; - pCursor = AllocCursor( srcbits, mskbits, &cm, - stuff->foreRed, stuff->foreGreen, stuff->foreBlue, - stuff->backRed, stuff->backGreen, stuff->backBlue); - - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return (client->noClientException); - return BadAlloc; -} - -int -ProcCreateGlyphCursor( client) - register ClientPtr client; -{ - CursorPtr pCursor; - int res; - - REQUEST(xCreateGlyphCursorReq); - - REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - res = AllocGlyphCursor(stuff->source, stuff->sourceChar, - stuff->mask, stuff->maskChar, - stuff->foreRed, stuff->foreGreen, stuff->foreBlue, - stuff->backRed, stuff->backGreen, stuff->backBlue, - &pCursor, client); - if (res != Success) - return res; - if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; - return BadAlloc; -} - - -int -ProcFreeCursor(client) - register ClientPtr client; -{ - CursorPtr pCursor; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->id, - RT_CURSOR, SecurityDestroyAccess); - if (pCursor) - { - FreeResource(stuff->id, RT_NONE); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadCursor); - } -} - -int -ProcQueryBestSize (client) - register ClientPtr client; -{ - xQueryBestSizeReply reply; - register DrawablePtr pDraw; - ScreenPtr pScreen; - REQUEST(xQueryBestSizeReq); - - REQUEST_SIZE_MATCH(xQueryBestSizeReq); - if ((stuff->class != CursorShape) && - (stuff->class != TileShape) && - (stuff->class != StippleShape)) - { - client->errorValue = stuff->class; - return(BadValue); - } - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW) - return (BadMatch); - pScreen = pDraw->pScreen; - (* pScreen->QueryBestSize)(stuff->class, &stuff->width, - &stuff->height, pScreen); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.width = stuff->width; - reply.height = stuff->height; - WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); - return (client->noClientException); -} - - -int -ProcSetScreenSaver (client) - register ClientPtr client; -{ - int blankingOption, exposureOption; - REQUEST(xSetScreenSaverReq); - - REQUEST_SIZE_MATCH(xSetScreenSaverReq); - blankingOption = stuff->preferBlank; - if ((blankingOption != DontPreferBlanking) && - (blankingOption != PreferBlanking) && - (blankingOption != DefaultBlanking)) - { - client->errorValue = blankingOption; - return BadValue; - } - exposureOption = stuff->allowExpose; - if ((exposureOption != DontAllowExposures) && - (exposureOption != AllowExposures) && - (exposureOption != DefaultExposures)) - { - client->errorValue = exposureOption; - return BadValue; - } - if (stuff->timeout < -1) - { - client->errorValue = stuff->timeout; - return BadValue; - } - if (stuff->interval < -1) - { - client->errorValue = stuff->interval; - return BadValue; - } - - if (blankingOption == DefaultBlanking) - ScreenSaverBlanking = defaultScreenSaverBlanking; - else - ScreenSaverBlanking = blankingOption; - if (exposureOption == DefaultExposures) - ScreenSaverAllowExposures = defaultScreenSaverAllowExposures; - else - ScreenSaverAllowExposures = exposureOption; - - if (stuff->timeout >= 0) - ScreenSaverTime = stuff->timeout * MILLI_PER_SECOND; - else - ScreenSaverTime = defaultScreenSaverTime; - if (stuff->interval >= 0) - ScreenSaverInterval = stuff->interval * MILLI_PER_SECOND; - else - ScreenSaverInterval = defaultScreenSaverInterval; - return (client->noClientException); -} - -int -ProcGetScreenSaver(client) - register ClientPtr client; -{ - xGetScreenSaverReply rep; - - REQUEST_SIZE_MATCH(xReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.timeout = ScreenSaverTime / MILLI_PER_SECOND; - rep.interval = ScreenSaverInterval / MILLI_PER_SECOND; - rep.preferBlanking = ScreenSaverBlanking; - rep.allowExposures = ScreenSaverAllowExposures; - WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep); - return (client->noClientException); -} - -int -ProcChangeHosts(client) - register ClientPtr client; -{ - REQUEST(xChangeHostsReq); - int result; - - REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength); - - if(stuff->mode == HostInsert) - result = AddHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); - else if (stuff->mode == HostDelete) - result = RemoveHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); - else - { - client->errorValue = stuff->mode; - return BadValue; - } - if (!result) - result = client->noClientException; - return (result); -} - -int -ProcListHosts(client) - register ClientPtr client; -{ - xListHostsReply reply; - int len, nHosts, result; - pointer pdata; - /* REQUEST(xListHostsReq); */ - - REQUEST_SIZE_MATCH(xListHostsReq); -#ifdef XCSECURITY - /* untrusted clients can't list hosts */ - if (client->trustLevel != XSecurityClientTrusted) - { - SecurityAudit("client %d attempted to list hosts\n", client->index); - return BadAccess; - } -#endif - result = GetHosts(&pdata, &nHosts, &len, &reply.enabled); - if (result != Success) - return(result); - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.nHosts = nHosts; - reply.length = len >> 2; - WriteReplyToClient(client, sizeof(xListHostsReply), &reply); - if (nHosts) - { - client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend; - WriteSwappedDataToClient(client, len, pdata); - } - xfree(pdata); - return (client->noClientException); -} - -int -ProcChangeAccessControl(client) - register ClientPtr client; -{ - int result; - REQUEST(xSetAccessControlReq); - - REQUEST_SIZE_MATCH(xSetAccessControlReq); - if ((stuff->mode != EnableAccess) && (stuff->mode != DisableAccess)) - { - client->errorValue = stuff->mode; - return BadValue; - } - result = ChangeAccessControl(client, stuff->mode == EnableAccess); - if (!result) - result = client->noClientException; - return (result); -} - -int -ProcKillClient(client) - register ClientPtr client; -{ - REQUEST(xResourceReq); - ClientPtr killclient; - - REQUEST_SIZE_MATCH(xResourceReq); - if (stuff->id == AllTemporary) - { - CloseDownRetainedResources(); - return (client->noClientException); - } - - if ((killclient = LookupClient(stuff->id, client))) - { - CloseDownClient(killclient); - /* if an LBX proxy gets killed, isItTimeToYield will be set */ - if (isItTimeToYield || (client == killclient)) - { - /* force yield and return Success, so that Dispatch() - * doesn't try to touch client - */ - isItTimeToYield = TRUE; - return (Success); - } - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadValue); - } -} - -int -ProcSetFontPath(client) - register ClientPtr client; -{ - unsigned char *ptr; - unsigned long nbytes, total; - long nfonts; - int n, result; - int error; - REQUEST(xSetFontPathReq); - - REQUEST_AT_LEAST_SIZE(xSetFontPathReq); - - nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq); - total = nbytes; - ptr = (unsigned char *)&stuff[1]; - nfonts = stuff->nFonts; - while (--nfonts >= 0) - { - if ((total == 0) || (total < (n = (*ptr + 1)))) - return(BadLength); - total -= n; - ptr += n; - } - if (total >= 4) - return(BadLength); - result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1], - &error); - if (!result) - { - result = client->noClientException; - client->errorValue = error; - } - return (result); -} - -int -ProcGetFontPath(client) - register ClientPtr client; -{ - xGetFontPathReply reply; - int stringLens, numpaths; - unsigned char *bufferStart; - /* REQUEST (xReq); */ - - REQUEST_SIZE_MATCH(xReq); - bufferStart = GetFontPath(&numpaths, &stringLens); - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = (stringLens + numpaths + 3) >> 2; - reply.nPaths = numpaths; - - WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); - if (stringLens || numpaths) - (void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart); - return(client->noClientException); -} - -int -ProcChangeCloseDownMode(client) - register ClientPtr client; -{ - REQUEST(xSetCloseDownModeReq); - - REQUEST_SIZE_MATCH(xSetCloseDownModeReq); - if ((stuff->mode == AllTemporary) || - (stuff->mode == RetainPermanent) || - (stuff->mode == RetainTemporary)) - { - client->closeDownMode = stuff->mode; - return (client->noClientException); - } - else - { - client->errorValue = stuff->mode; - return (BadValue); - } -} - -int ProcForceScreenSaver(client) - register ClientPtr client; -{ - REQUEST(xForceScreenSaverReq); - - REQUEST_SIZE_MATCH(xForceScreenSaverReq); - - if ((stuff->mode != ScreenSaverReset) && - (stuff->mode != ScreenSaverActive)) - { - client->errorValue = stuff->mode; - return BadValue; - } - SaveScreens(SCREEN_SAVER_FORCER, (int)stuff->mode); - return client->noClientException; -} - -int ProcNoOperation(client) - register ClientPtr client; -{ - REQUEST_AT_LEAST_SIZE(xReq); - - /* noop -- don't do anything */ - return(client->noClientException); -} - -void -InitProcVectors(void) -{ - int i; - for (i = 0; i<256; i++) - { - if(!ProcVector[i]) - { - ProcVector[i] = SwappedProcVector[i] = ProcBadRequest; - ReplySwapVector[i] = ReplyNotSwappd; - } -#ifdef K5AUTH - if (!k5_Vector[i]) - { - k5_Vector[i] = k5_bad; - } -#endif - } - for(i = LASTEvent; i < 128; i++) - { - EventSwapVector[i] = NotImplemented; - } - -} - -/********************** - * CloseDownClient - * - * Client can either mark his resources destroy or retain. If retained and - * then killed again, the client is really destroyed. - *********************/ - -char dispatchExceptionAtReset = DE_RESET; - -void -CloseDownClient(client) - register ClientPtr client; -{ - Bool really_close_down = client->clientGone || - client->closeDownMode == DestroyAll; - - if (!client->clientGone) - { - /* ungrab server if grabbing client dies */ - if (grabState != GrabNone && grabClient == client) - { - UngrabServer(client); - } - BITCLEAR(grabWaiters, client->index); - DeleteClientFromAnySelections(client); - ReleaseActiveGrabs(client); - DeleteClientFontStuff(client); - if (!really_close_down) - { - /* This frees resources that should never be retained - * no matter what the close down mode is. Actually we - * could do this unconditionally, but it's probably - * better not to traverse all the client's resources - * twice (once here, once a few lines down in - * FreeClientResources) in the common case of - * really_close_down == TRUE. - */ - FreeClientNeverRetainResources(client); - client->clientState = ClientStateRetained; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - } - client->clientGone = TRUE; /* so events aren't sent to client */ - if (ClientIsAsleep(client)) - ClientSignal (client); - ProcessWorkQueueZombies(); -#ifdef LBX - ProcessQTagZombies(); -#endif - CloseDownConnection(client); - - /* If the client made it to the Running stage, nClients has - * been incremented on its behalf, so we need to decrement it - * now. If it hasn't gotten to Running, nClients has *not* - * been incremented, so *don't* decrement it. - */ - if (client->clientState != ClientStateInitial && - client->clientState != ClientStateAuthenticating ) - { - --nClients; - } - } - - if (really_close_down) - { - if (client->clientState == ClientStateRunning && nClients == 0) - dispatchException |= dispatchExceptionAtReset; - - client->clientState = ClientStateGone; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - FreeClientResources(client); - if (client->index < nextFreeClientID) - nextFreeClientID = client->index; - clients[client->index] = NullClient; -#ifdef SMART_SCHEDULE - SmartLastClient = NullClient; -#endif - xfree(client); - - while (!clients[currentMaxClients-1]) - currentMaxClients--; - } -} - -static void -KillAllClients() -{ - int i; - for (i=1; icloseDownMode = DestroyAll; - CloseDownClient(clients[i]); - } -} - -/********************* - * CloseDownRetainedResources - * - * Find all clients that are gone and have terminated in RetainTemporary - * and destroy their resources. - *********************/ - -void -CloseDownRetainedResources() -{ - register int i; - register ClientPtr client; - - for (i=1; icloseDownMode == RetainTemporary) - && (client->clientGone)) - CloseDownClient(client); - } -} - -void InitClient(client, i, ospriv) - ClientPtr client; - int i; - pointer ospriv; -{ - client->index = i; - client->sequence = 0; - client->clientAsMask = ((Mask)i) << CLIENTOFFSET; - client->clientGone = FALSE; - if (i) - { - client->closeDownMode = DestroyAll; - client->lastDrawable = (DrawablePtr)WindowTable[0]; - client->lastDrawableID = WindowTable[0]->drawable.id; - } - else - { - client->closeDownMode = RetainPermanent; - client->lastDrawable = (DrawablePtr)NULL; - client->lastDrawableID = INVALID; - } - client->lastGC = (GCPtr) NULL; - client->lastGCID = INVALID; - client->numSaved = 0; - client->saveSet = (pointer *)NULL; - client->noClientException = Success; -#ifdef DEBUG - client->requestLogIndex = 0; -#endif - client->requestVector = InitialVector; - client->osPrivate = ospriv; - client->swapped = FALSE; - client->big_requests = FALSE; - client->priority = 0; - client->clientState = ClientStateInitial; -#ifdef XKB - if (!noXkbExtension) { - client->xkbClientFlags = 0; - client->mapNotifyMask = 0; - QueryMinMaxKeyCodes(&client->minKC,&client->maxKC); - } -#endif - client->replyBytesRemaining = 0; -#ifdef LBX - client->readRequest = StandardReadRequestFromClient; -#endif -#ifdef XCSECURITY - client->trustLevel = XSecurityClientTrusted; - client->CheckAccess = NULL; - client->authId = 0; -#endif -#ifdef XAPPGROUP - client->appgroup = NULL; -#endif - client->fontResFunc = NULL; -#ifdef SMART_SCHEDULE - client->smart_priority = 0; - client->smart_start_tick = SmartScheduleTime; - client->smart_stop_tick = SmartScheduleTime; - client->smart_check_tick = SmartScheduleTime; -#endif -} - -extern int clientPrivateLen; -extern unsigned *clientPrivateSizes; -extern unsigned totalClientSize; - -int -InitClientPrivates(client) - ClientPtr client; -{ - register char *ptr; - DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; - - if (totalClientSize == sizeof(ClientRec)) - ppriv = (DevUnion *)NULL; - else if (client->index) - ppriv = (DevUnion *)(client + 1); - else - { - ppriv = (DevUnion *)xalloc(totalClientSize - sizeof(ClientRec)); - if (!ppriv) - return 0; - } - client->devPrivates = ppriv; - sizes = clientPrivateSizes; - ptr = (char *)(ppriv + clientPrivateLen); - for (i = clientPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - return 1; -} - -/************************ - * int NextAvailableClient(ospriv) - * - * OS dependent portion can't assign client id's because of CloseDownModes. - * Returns NULL if there are no free clients. - *************************/ - -ClientPtr -NextAvailableClient(ospriv) - pointer ospriv; -{ - register int i; - register ClientPtr client; - xReq data; - - i = nextFreeClientID; - if (i == MAXCLIENTS) - return (ClientPtr)NULL; - clients[i] = client = (ClientPtr)xalloc(totalClientSize); - if (!client) - return (ClientPtr)NULL; - InitClient(client, i, ospriv); - InitClientPrivates(client); - if (!InitClientResources(client)) - { - xfree(client); - return (ClientPtr)NULL; - } - data.reqType = 1; - data.length = (sz_xReq + sz_xConnClientPrefix) >> 2; - if (!InsertFakeRequest(client, (char *)&data, sz_xReq)) - { - FreeClientResources(client); - xfree(client); - return (ClientPtr)NULL; - } - if (i == currentMaxClients) - currentMaxClients++; - while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID]) - nextFreeClientID++; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - return(client); -} - -int -ProcInitialConnection(client) - register ClientPtr client; -{ - REQUEST(xReq); - register xConnClientPrefix *prefix; - int whichbyte = 1; - - prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); - if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B')) - return (client->noClientException = -1); - if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) || - (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) - { - client->swapped = TRUE; - SwapConnClientPrefix(prefix); - } - stuff->reqType = 2; - stuff->length += ((prefix->nbytesAuthProto + (unsigned)3) >> 2) + - ((prefix->nbytesAuthString + (unsigned)3) >> 2); - if (client->swapped) - { - swaps(&stuff->length, whichbyte); - } - ResetCurrentRequest(client); - return (client->noClientException); -} - -#ifdef LBX -void -IncrementClientCount() -{ - nClients++; -} -#endif - -int -SendConnSetup(client, reason) - register ClientPtr client; - char *reason; -{ - register xWindowRoot *root; - register int i; - int numScreens; - char* lConnectionInfo; - xConnSetupPrefix* lconnSetupPrefix; - - if (reason) - { - xConnSetupPrefix csp; - - csp.success = xFalse; - csp.lengthReason = strlen(reason); - csp.length = (csp.lengthReason + (unsigned)3) >> 2; - csp.majorVersion = X_PROTOCOL; - csp.minorVersion = X_PROTOCOL_REVISION; - if (client->swapped) - WriteSConnSetupPrefix(client, &csp); - else - (void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp); - (void)WriteToClient(client, (int)csp.lengthReason, reason); - return (client->noClientException = -1); - } - - numScreens = screenInfo.numScreens; - lConnectionInfo = ConnectionInfo; - lconnSetupPrefix = &connSetupPrefix; - - /* We're about to start speaking X protocol back to the client by - * sending the connection setup info. This means the authorization - * step is complete, and we can count the client as an - * authorized one. - */ - nClients++; - - client->requestVector = client->swapped ? SwappedProcVector : ProcVector; - client->sequence = 0; -#ifdef XAPPGROUP - XagConnectionInfo (client, &lconnSetupPrefix, &lConnectionInfo, &numScreens); -#endif - ((xConnSetup *)lConnectionInfo)->ridBase = client->clientAsMask; - ((xConnSetup *)lConnectionInfo)->ridMask = RESOURCE_ID_MASK; -#ifdef MATCH_CLIENT_ENDIAN - ((xConnSetup *)lConnectionInfo)->imageByteOrder = ClientOrder (client); - ((xConnSetup *)lConnectionInfo)->bitmapBitOrder = ClientOrder (client); -#endif - /* fill in the "currentInputMask" */ - root = (xWindowRoot *)(lConnectionInfo + connBlockScreenStart); -#ifdef PANORAMIX - if (noPanoramiXExtension) - numScreens = screenInfo.numScreens; - else - numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; -#endif - - for (i=0; icurrentInputMask = WindowTable[i]->eventMask | - wOtherEventMasks (WindowTable[i]); - pDepth = (xDepth *)(root + 1); - for (j = 0; j < root->nDepths; j++) - { - pDepth = (xDepth *)(((char *)(pDepth + 1)) + - pDepth->nVisuals * sizeof(xVisualType)); - } - root = (xWindowRoot *)pDepth; - } - - if (client->swapped) - { - WriteSConnSetupPrefix(client, lconnSetupPrefix); - WriteSConnectionInfo(client, - (unsigned long)(lconnSetupPrefix->length << 2), - lConnectionInfo); - } - else - { - (void)WriteToClient(client, sizeof(xConnSetupPrefix), - (char *) lconnSetupPrefix); - (void)WriteToClient(client, (int)(lconnSetupPrefix->length << 2), - lConnectionInfo); - } - client->clientState = ClientStateRunning; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = lconnSetupPrefix; - clientinfo.setup = (xConnSetup *)lConnectionInfo; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - return (client->noClientException); -} - -int -ProcEstablishConnection(client) - register ClientPtr client; -{ - char *reason, *auth_proto, *auth_string; - register xConnClientPrefix *prefix; - REQUEST(xReq); - - prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); - auth_proto = (char *)prefix + sz_xConnClientPrefix; - auth_string = auth_proto + ((prefix->nbytesAuthProto + 3) & ~3); - if ((prefix->majorVersion != X_PROTOCOL) || - (prefix->minorVersion != X_PROTOCOL_REVISION)) - reason = "Protocol version mismatch"; - else - reason = ClientAuthorized(client, - (unsigned short)prefix->nbytesAuthProto, - auth_proto, - (unsigned short)prefix->nbytesAuthString, - auth_string); - /* - * If Kerberos is being used for this client, the clientState - * will be set to ClientStateAuthenticating at this point. - * More messages need to be exchanged among the X server, Kerberos - * server, and client to figure out if everyone is authorized. - * So we don't want to send the connection setup info yet, since - * the auth step isn't really done. - */ - if (client->clientState == ClientStateCheckingSecurity) - client->clientState = ClientStateCheckedSecurity; - else if (client->clientState != ClientStateAuthenticating) - return(SendConnSetup(client, reason)); - return(client->noClientException); -} - -void -SendErrorToClient(client, majorCode, minorCode, resId, errorCode) - ClientPtr client; - unsigned int majorCode; - unsigned int minorCode; - XID resId; - int errorCode; -{ - xError rep; - - rep.type = X_Error; - rep.sequenceNumber = client->sequence; - rep.errorCode = errorCode; - rep.majorCode = majorCode; - rep.minorCode = minorCode; - rep.resourceID = resId; - - WriteEventsToClient (client, 1, (xEvent *)&rep); -} - -void -DeleteWindowFromAnySelections(pWin) - WindowPtr pWin; -{ - register int i; - - for (i = 0; i< NumCurrentSelections; i++) - if (CurrentSelections[i].pWin == pWin) - { - CurrentSelections[i].pWin = (WindowPtr)NULL; - CurrentSelections[i].window = None; - CurrentSelections[i].client = NullClient; - } -} - -static void -DeleteClientFromAnySelections(client) - ClientPtr client; -{ - register int i; - - for (i = 0; i< NumCurrentSelections; i++) - if (CurrentSelections[i].client == client) - { - CurrentSelections[i].pWin = (WindowPtr)NULL; - CurrentSelections[i].window = None; - CurrentSelections[i].client = NullClient; - } -} - -void -MarkClientException(client) - ClientPtr client; -{ - client->noClientException = -1; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original deleted file mode 100644 index 1cccfd972..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original +++ /dev/null @@ -1,2883 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXdixfonts.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.27 2003/02/15 03:47:05 dawes 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: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ - -#define NEED_REPLIES -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" -#include "scrnintstr.h" -#include "resource.h" -#include "dixstruct.h" -#include "cursorstr.h" -#include "misc.h" -#include "opaque.h" -#include "dixfontstr.h" -#include "closestr.h" - -/* -#define NXAGENT_DEBUG -*/ - -#ifdef DEBUG -#include -#endif - -#include "Agent.h" -#include "Font.h" - -#ifndef NX_TRANS_SOCKET - -#define NX_TRANS_SOCKET - -#endif - -#ifdef NX_TRANS_SOCKET - -char _NXFontPath[1024]; - -/* - * Override the default font path and make - * it configurable at run time, based on - * the NX_FONT environment. - */ - -static const char *_NXGetFontPath(const char *path) -{ - const char *fontEnv; - - /* - * Check the environment only once. - */ - - if (*_NXFontPath != '\0') - { - return _NXFontPath; - } - - fontEnv = getenv("NX_FONT"); - - if (fontEnv != NULL && *fontEnv != '\0') - { - if (strlen(fontEnv) + 1 > 1024) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetFontPath: WARNING! Maximum length of font path exceeded.\n"); -#endif - goto _NXGetFontPathError; - } - - strcpy(_NXFontPath, fontEnv); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetFontPath: Using NX font path [%s].\n", _NXFontPath); -#endif - - return _NXFontPath; - } - -_NXGetFontPathError: - - strcpy(_NXFontPath, path); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetFontPath: Using default font path [%s].\n", _NXFontPath); -#endif - - return _NXFontPath; -} - -#endif - -#ifdef PANORAMIX -#include "../../Xext/panoramiX.h" -#include "../../Xext/panoramiXsrv.h" -#endif - -#ifdef LBX -#include "lbxserve.h" -#endif - -#ifdef XF86BIGFONT -#define _XF86BIGFONT_SERVER_ -#include "xf86bigfont.h" -#endif - -#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics - -extern pointer fosNaturalParams; -extern FontPtr defaultFont; - -static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; -static int num_fpes = 0; -FPEFunctions *fpe_functions = (FPEFunctions *) 0; -static int num_fpe_types = 0; - -static unsigned char *font_path_string; - -static int num_slept_fpes = 0; -static int size_slept_fpes = 0; -static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; -static FontPatternCachePtr patternCache; - -int -FontToXError(err) - int err; -{ - switch (err) { - case Successful: - return Success; - case AllocError: - return BadAlloc; - case BadFontName: - return BadName; - case BadFontPath: - case BadFontFormat: /* is there something better? */ - case BadCharRange: - return BadValue; - default: - return err; - } -} - - -/* - * adding RT_FONT prevents conflict with default cursor font - */ -Bool -SetDefaultFont(defaultfontname) - char *defaultfontname; -{ - int err; - FontPtr pf; - XID fid; - - fid = FakeClientID(0); - err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync, - (unsigned) strlen(defaultfontname), defaultfontname); - if (err != Success) - return FALSE; - pf = (FontPtr) LookupIDByType(fid, RT_FONT); - if (pf == (FontPtr) NULL) - return FALSE; - defaultFont = pf; - return TRUE; -} - -/* - * note that the font wakeup queue is not refcounted. this is because - * an fpe needs to be added when it's inited, and removed when it's finally - * freed, in order to handle any data that isn't requested, like FS events. - * - * since the only thing that should call these routines is the renderer's - * init_fpe() and free_fpe(), there shouldn't be any problem in using - * freed data. - */ -void -QueueFontWakeup(fpe) - FontPathElementPtr fpe; -{ - int i; - FontPathElementPtr *new; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - -#ifdef DEBUG - fprintf(stderr, "re-queueing fpe wakeup\n"); -#endif - - return; - } - } - if (num_slept_fpes == size_slept_fpes) { - new = (FontPathElementPtr *) - xrealloc(slept_fpes, - sizeof(FontPathElementPtr) * (size_slept_fpes + 4)); - if (!new) - return; - slept_fpes = new; - size_slept_fpes += 4; - } - slept_fpes[num_slept_fpes] = fpe; - num_slept_fpes++; -} - -void -RemoveFontWakeup(fpe) - FontPathElementPtr fpe; -{ - int i, - j; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - for (j = i; j < num_slept_fpes; j++) { - slept_fpes[j] = slept_fpes[j + 1]; - } - num_slept_fpes--; - return; - } - } -} - -/* ARGSUSED */ -void -FontWakeup(data, count, LastSelectMask) - pointer data; - int count; - pointer LastSelectMask; -{ - int i; - FontPathElementPtr fpe; - - if (count < 0) - return; - /* wake up any fpe's that may be waiting for information */ - for (i = 0; i < num_slept_fpes; i++) { - fpe = slept_fpes[i]; - (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); - } -} - -/* XXX -- these two funcs may want to be broken into macros */ -static void -#if NeedFunctionPrototypes -UseFPE(FontPathElementPtr fpe) -#else -UseFPE(fpe) - FontPathElementPtr fpe; -#endif -{ - fpe->refcount++; -} - -static void -#if NeedFunctionPrototypes -FreeFPE (FontPathElementPtr fpe) -#else -FreeFPE (fpe) - FontPathElementPtr fpe; -#endif -{ - fpe->refcount--; - if (fpe->refcount == 0) { - (*fpe_functions[fpe->type].free_fpe) (fpe); - xfree(fpe->name); - xfree(fpe); - } -} - -static Bool -#if NeedFunctionPrototypes -doOpenFont(ClientPtr client, OFclosurePtr c) -#else -doOpenFont(client, c) - ClientPtr client; - OFclosurePtr c; -#endif -{ - FontPtr pfont = NullFont; - FontPathElementPtr fpe = NULL; - ScreenPtr pScr; - int err = Successful; - int i; - char *alias, - *newname; - int newlen; - int aliascount = 20; - char nxagentOrigFontName[256]; - int nxagentOrigFontNameLen; - - /* - * Decide at runtime what FontFormat to use. - */ - Mask FontFormat = - - ((screenInfo.imageByteOrder == LSBFirst) ? - BitmapFormatByteOrderLSB : BitmapFormatByteOrderMSB) | - - ((screenInfo.bitmapBitOrder == LSBFirst) ? - BitmapFormatBitOrderLSB : BitmapFormatBitOrderMSB) | - - BitmapFormatImageRectMin | - -#if GLYPHPADBYTES == 1 - BitmapFormatScanlinePad8 | -#endif - -#if GLYPHPADBYTES == 2 - BitmapFormatScanlinePad16 | -#endif - -#if GLYPHPADBYTES == 4 - BitmapFormatScanlinePad32 | -#endif - -#if GLYPHPADBYTES == 8 - BitmapFormatScanlinePad64 | -#endif - - BitmapFormatScanlineUnit8; - - - nxagentOrigFontNameLen = (c -> origFontNameLen < 256) ? c -> origFontNameLen : 255; - - memcpy(nxagentOrigFontName, c -> origFontName, nxagentOrigFontNameLen); - - nxagentOrigFontName[nxagentOrigFontNameLen] = 0; - - if (client->clientGone) - { - if (c->current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - while (c->current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current_fpe]; - err = (*fpe_functions[fpe->type].open_font) - ((pointer) client, fpe, c->flags, - c->fontname, c->fnamelen, FontFormat, - BitmapFormatMaskByte | - BitmapFormatMaskBit | - BitmapFormatMaskImageRectangle | - BitmapFormatMaskScanLinePad | - BitmapFormatMaskScanLineUnit, - c->fontid, &pfont, &alias, - c->non_cachable_font && c->non_cachable_font->fpe == fpe ? - c->non_cachable_font : - (FontPtr)0); - - if (err == FontNameAlias && alias) { - newlen = strlen(alias); - newname = (char *) xrealloc(c->fontname, newlen); - if (!newname) { - err = AllocError; - break; - } - memmove(newname, alias, newlen); - c->fontname = newname; - c->fnamelen = newlen; - c->current_fpe = 0; - if (--aliascount <= 0) - break; - continue; - } - if (err == BadFontName) { - c->current_fpe++; - continue; - } - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (pointer) c); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doOpenFont: client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - break; - } - - if (err != Successful) - goto bail; - if (!pfont) { - err = BadFontName; - goto bail; - } - if (!pfont->fpe) - pfont->fpe = fpe; - pfont->refcnt++; - if (pfont->refcnt == 1) { - UseFPE(pfont->fpe); - for (i = 0; i < screenInfo.numScreens; i++) { - pScr = screenInfo.screens[i]; - if (pScr->RealizeFont) - { - - /* NXAGENT uses useless screen pointer to pass the original font name - * to realizeFont, could be a source of problems in the future. - */ - - if (!(*pScr->RealizeFont) ((ScreenPtr)nxagentOrigFontName, pfont)) - { - CloseFont (pfont, (Font) 0); - err=BadFontName; - goto bail; - } - } - } - } - if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) { - err = AllocError; - goto bail; - } - if( nxagentFontPriv(pfont) -> mirrorID == 0 ) - { - extern RESTYPE RT_NX_FONT; - - nxagentFontPriv(pfont) -> mirrorID = FakeClientID(0); - if (!AddResource(nxagentFontPriv(pfont) -> mirrorID, RT_NX_FONT, (pointer) pfont)) { - FreeResource(c->fontid, RT_NONE); - err = AllocError; - goto bail; - } - } - if (patternCache && pfont != c->non_cachable_font) - CacheFontPattern(patternCache, nxagentOrigFontName, nxagentOrigFontNameLen, - pfont); -bail: - if (err != Successful && c->client != serverClient) { - SendErrorToClient(c->client, X_OpenFont, 0, - c->fontid, FontToXError(err)); - } - if (c->slept) - { - ClientWakeup(c->client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doOpenFont: client [%lx] wakeup.\n", client); -#endif - } - for (i = 0; i < c->num_fpes; i++) { - FreeFPE(c->fpe_list[i]); - } - xfree(c->fpe_list); - xfree(c->fontname); - xfree(c); - return TRUE; -} - -int -OpenFont(client, fid, flags, lenfname, pfontname) - ClientPtr client; - XID fid; - Mask flags; - unsigned lenfname; - char *pfontname; -{ - OFclosurePtr c; - int i; - FontPtr cached = (FontPtr)0; - -#ifdef FONTDEBUG - char *f; - f = (char *)xalloc(lenfname + 1); - memmove(f, pfontname, lenfname); - f[lenfname] = '\0'; - ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); -#endif - if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) - return BadName; - if (patternCache) - { - - /* - ** Check name cache. If we find a cached version of this font that - ** is cachable, immediately satisfy the request with it. If we find - ** a cached version of this font that is non-cachable, we do not - ** satisfy the request with it. Instead, we pass the FontPtr to the - ** FPE's open_font code (the fontfile FPE in turn passes the - ** information to the rasterizer; the fserve FPE ignores it). - ** - ** Presumably, the font is marked non-cachable because the FPE has - ** put some licensing restrictions on it. If the FPE, using - ** whatever logic it relies on, determines that it is willing to - ** share this existing font with the client, then it has the option - ** to return the FontPtr we passed it as the newly-opened font. - ** This allows the FPE to exercise its licensing logic without - ** having to create another instance of a font that already exists. - */ - - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); - if (cached && cached->info.cachable) - { - if (!AddResource(fid, RT_FONT, (pointer) cached)) - return BadAlloc; - cached->refcnt++; - return Success; - } - } - c = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); - if (!c) - return BadAlloc; - c->fontname = (char *) xalloc(lenfname); - c->origFontName = pfontname; - c->origFontNameLen = lenfname; - if (!c->fontname) { - xfree(c); - return BadAlloc; - } - /* - * copy the current FPE list, so that if it gets changed by another client - * while we're blocking, the request still appears atomic - */ - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c->fontname); - xfree(c); - return BadAlloc; - } - memmove(c->fontname, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->fontid = fid; - c->current_fpe = 0; - c->num_fpes = num_fpes; - c->fnamelen = lenfname; - c->slept = FALSE; - c->flags = flags; - c->non_cachable_font = cached; - - (void) doOpenFont(client, c); - return Success; -} - -/* - * Decrement font's ref count, and free storage if ref count equals zero - */ -/*ARGSUSED*/ -int -CloseFont(value, fid) - pointer value; /* must conform to DeleteType */ - XID fid; -{ - int nscr; - ScreenPtr pscr; - FontPathElementPtr fpe; - FontPtr pfont = (FontPtr)value; - - if (pfont == NullFont) - return (Success); - if (--pfont->refcnt == 0) { - if (patternCache) - RemoveCachedFontPattern (patternCache, pfont); - /* - * since the last reference is gone, ask each screen to free any - * storage it may have allocated locally for it. - */ - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { - pscr = screenInfo.screens[nscr]; - if (pscr->UnrealizeFont) - (*pscr->UnrealizeFont) (pscr, pfont); - } - if (pfont == defaultFont) - defaultFont = NULL; -#ifdef LBX - LbxFreeFontTag(pfont); -#endif -#ifdef XF86BIGFONT - { - extern void XF86BigfontFreeFontShm(FontPtr); - XF86BigfontFreeFontShm(pfont); - } -#endif - fpe = pfont->fpe; - (*fpe_functions[fpe->type].close_font) (fpe, pfont); - FreeFPE(fpe); - } - return (Success); -} - - -/***====================================================================***/ - - /* - * \ Sets up pReply as the correct QueryFontReply for pFont with the first - * nProtoCCIStructs char infos. \ - */ - -void -QueryFont(pFont, pReply, nProtoCCIStructs) - FontPtr pFont; - xQueryFontReply *pReply; /* caller must allocate this storage */ - int nProtoCCIStructs; -{ - FontPropPtr pFP; - int r, - c, - i; - xFontProp *prFP; - xCharInfo *prCI; - xCharInfo *charInfos[256]; - unsigned char chars[512]; - int ninfos; - unsigned long ncols; - unsigned long count; - - /* pr->length set in dispatch */ - pReply->minCharOrByte2 = pFont->info.firstCol; - pReply->defaultChar = pFont->info.defaultCh; - pReply->maxCharOrByte2 = pFont->info.lastCol; - pReply->drawDirection = pFont->info.drawDirection; - pReply->allCharsExist = pFont->info.allExist; - pReply->minByte1 = pFont->info.firstRow; - pReply->maxByte1 = pFont->info.lastRow; - pReply->fontAscent = pFont->info.fontAscent; - pReply->fontDescent = pFont->info.fontDescent; - - pReply->minBounds = pFont->info.ink_minbounds; - pReply->maxBounds = pFont->info.ink_maxbounds; - - pReply->nFontProps = pFont->info.nprops; - pReply->nCharInfos = nProtoCCIStructs; - - for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) (&pReply[1]); - i < pFont->info.nprops; - i++, pFP++, prFP++) { - prFP->name = pFP->name; - prFP->value = pFP->value; - } - - ninfos = 0; - ncols = (unsigned long) (pFont->info.lastCol - pFont->info.firstCol + 1); - prCI = (xCharInfo *) (prFP); - for (r = pFont->info.firstRow; - ninfos < nProtoCCIStructs && r <= (int)pFont->info.lastRow; - r++) { - i = 0; - for (c = pFont->info.firstCol; c <= (int)pFont->info.lastCol; c++) { - chars[i++] = r; - chars[i++] = c; - } - (*pFont->get_metrics) (pFont, ncols, chars, - TwoD16Bit, &count, charInfos); - i = 0; - for (i = 0; i < (int) count && ninfos < nProtoCCIStructs; i++) { - *prCI = *charInfos[i]; - prCI++; - ninfos++; - } - } - return; -} - -static Bool -#if NeedFunctionPrototypes -doListFontsAndAliases(ClientPtr client, LFclosurePtr c) -#else -doListFontsAndAliases(client, c) - ClientPtr client; - LFclosurePtr c; -#endif -{ - FontPathElementPtr fpe; - int err = Successful; - FontNamesPtr names = NULL; - char *name, *resolved=NULL; - int namelen, resolvedlen; - int nnames; - int stringLens; - int i; - xListFontsReply reply; - char *bufptr; - char *bufferStart; - int aliascount = 0; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - - if (!c->current.patlen) - goto finish; - - while (c->current.current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) - { - /* This FPE doesn't support/require list_fonts_and_aliases */ - - err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - c->names); - - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFont (1): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - - err = BadFontName; - } - else - { - /* Start of list_fonts_and_aliases functionality. Modeled - after list_fonts_with_info in that it resolves aliases, - except that the information collected from FPEs is just - names, not font info. Each list_next_font_or_alias() - returns either a name into name/namelen or an alias into - name/namelen and its target name into resolved/resolvedlen. - The code at this level then resolves the alias by polling - the FPEs. */ - - if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - &c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFont (2): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) { - char *tmpname; - name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, - &resolvedlen, c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFont (3): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - if (err == FontNameAlias) { - if (resolved) xfree(resolved); - resolved = (char *) xalloc(resolvedlen + 1); - if (resolved) - memmove(resolved, tmpname, resolvedlen + 1); - } - } - - if (err == Successful) - { - if (c->haveSaved) - { - if (c->savedName) - (void)AddFontNamesName(c->names, c->savedName, - c->savedNameLen); - } - else - (void)AddFontNamesName(c->names, name, namelen); - } - - /* - * When we get an alias back, save our state and reset back to - * the start of the FPE looking for the specified name. As - * soon as a real font is found for the alias, pop back to the - * old state - */ - else if (err == FontNameAlias) { - char tmp_pattern[XLFDMAXFONTNAMELEN]; - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - memmove(tmp_pattern, resolved, resolvedlen); - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - - tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, - &tmpname, &tmpnamelen, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - c->savedNameLen = namelen; - aliascount = 20; - } - memmove(c->current.pattern, tmp_pattern, resolvedlen); - c->current.patlen = resolvedlen; - c->current.max_names = c->names->nnames + 1; - c->current.current_fpe = -1; - c->current.private = 0; - err = BadFontName; - } - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've collected enough - * font names, quit. - */ - if (err == BadFontName) { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->names->nnames == c->current.max_names || - c->current.current_fpe == c->num_fpes) { - c->haveSaved = FALSE; - c->current = c->saved; - /* Give the saved namelist a chance to clean itself up */ - continue; - } - } - if (c->names->nnames == c->current.max_names) - break; - } - } - - /* - * send the reply - */ - if (err != Successful) { - SendErrorToClient(client, X_ListFonts, 0, 0, FontToXError(err)); - goto bail; - } - -finish: - - names = c->names; - nnames = names->nnames; - client = c->client; - stringLens = 0; - for (i = 0; i < nnames; i++) - stringLens += (names->length[i] <= 255) ? names->length[i] : 0; - - reply.type = X_Reply; - reply.length = (stringLens + nnames + 3) >> 2; - reply.nFonts = nnames; - reply.sequenceNumber = client->sequence; - - bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2); - - if (!bufptr && reply.length) { - SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); - goto bail; - } - /* - * since WriteToClient long word aligns things, copy to temp buffer and - * write all at once - */ - for (i = 0; i < nnames; i++) { - if (names->length[i] > 255) - reply.nFonts--; - else - { - { - /* dirty hack: don't list to client fonts not existing on the remote side */ - char tmp[256]; - - memcpy(tmp, names->names[i], names->length[i]); - tmp[ names->length[i] ] = 0; - - if (nxagentFontLookUp(tmp) == 0) - { -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "doListFontsAndAliases:\n"); - fprintf(stderr, " removing font: %s \n", tmp); -#endif - reply.nFonts--; - stringLens -= names->length[i]; - continue; - } - } - *bufptr++ = names->length[i]; - memmove( bufptr, names->names[i], names->length[i]); - bufptr += names->length[i]; - } - } - nnames = reply.nFonts; - reply.length = (stringLens + nnames + 3) >> 2; - client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; - WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); - (void) WriteToClient(client, stringLens + nnames, bufferStart); - DEALLOCATE_LOCAL(bufferStart); - -bail: - if (c->slept) - { - ClientWakeup(client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFont: client [%lx] wakeup.\n", client); -#endif - } - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - FreeFontNames(names); - xfree(c); - if (resolved) xfree(resolved); - return TRUE; -} - -int -ListFonts(client, pattern, length, max_names) - ClientPtr client; - unsigned char *pattern; - unsigned int length; - unsigned int max_names; -{ - int i; - LFclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) - return BadAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c); - return BadAlloc; - } - c->names = MakeFontNamesRecord(max_names < nxagentMaxFontNames ? max_names : nxagentMaxFontNames); - if (!c->names) - { - xfree(c->fpe_list); - xfree(c); - return BadAlloc; - } - memmove( c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsAndAliases(client, c); - return Success; -} - -int -doListFontsWithInfo(client, c) - ClientPtr client; - LFWIclosurePtr c; -{ - FontPathElementPtr fpe; - int err = Successful; - char *name; - int namelen; - int numFonts; - FontInfoRec fontInfo, - *pFontInfo; - xListFontsWithInfoReply *reply; - int length; - xFontProp *pFP; - int i; - int aliascount = 0; - xListFontsWithInfoReply finalReply; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo]; - if (!c->current.patlen) - goto finish; - while (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - if (!c->current.list_started) - { - err = (*fpe_functions[fpe->type].start_list_fonts_with_info) - (client, fpe, c->current.pattern, c->current.patlen, - c->current.max_names, &c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, (ClientSleepProcPtr)doListFontsWithInfo, c); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFontWinfo (1): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) - { - name = 0; - pFontInfo = &fontInfo; - err = (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &name, &namelen, &pFontInfo, - &numFonts, c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsWithInfo, - c); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFontWinfo (2): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - } - /* - * When we get an alias back, save our state and reset back to the - * start of the FPE looking for the specified name. As soon as a real - * font is found for the alias, pop back to the old state - */ - if (err == FontNameAlias) - { - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - FontInfoPtr tmpFontInfo; - - tmpname = 0; - tmpFontInfo = &fontInfo; - (void) (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, - &numFonts, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - c->savedNumFonts = numFonts; - c->savedName = (char *) pFontInfo; - aliascount = 20; - } - memmove(c->current.pattern, name, namelen); - c->current.patlen = namelen; - c->current.max_names = 1; - c->current.current_fpe = 0; - c->current.private = 0; - c->current.list_started = FALSE; - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've sent enough font - * names, quit. Always wait for BadFontName to let the FPE - * have a chance to clean up. - */ - else if (err == BadFontName) - { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->current.max_names == 0 || - c->current.current_fpe == c->num_fpes) - { - c->haveSaved = FALSE; - c->saved.max_names -= (1 - c->current.max_names); - c->current = c->saved; - } - } - else if (c->current.max_names == 0) - break; - } - else if (err == Successful) - { - - if (c->haveSaved) - { - numFonts = c->savedNumFonts; - name = c->savedName; - namelen = strlen(name); - } - - if (nxagentFontLookUp(name) == 0) - { -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "doListFontsAndAliases (with info):\n"); - fprintf(stderr, " removing font: %s \n", name); -#endif - continue; - } - - length = sizeof(*reply) + pFontInfo->nprops * sizeof(xFontProp); - reply = c->reply; - if (c->length < length) - { - reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length); - if (!reply) - { - err = AllocError; - break; - } - c->reply = reply; - c->length = length; - } - reply->type = X_Reply; - reply->length = (sizeof *reply - sizeof(xGenericReply) + - pFontInfo->nprops * sizeof(xFontProp) + - namelen + 3) >> 2; - reply->sequenceNumber = client->sequence; - reply->nameLength = namelen; - reply->minBounds = pFontInfo->ink_minbounds; - reply->maxBounds = pFontInfo->ink_maxbounds; - reply->minCharOrByte2 = pFontInfo->firstCol; - reply->maxCharOrByte2 = pFontInfo->lastCol; - reply->defaultChar = pFontInfo->defaultCh; - reply->nFontProps = pFontInfo->nprops; - reply->drawDirection = pFontInfo->drawDirection; - reply->minByte1 = pFontInfo->firstRow; - reply->maxByte1 = pFontInfo->lastRow; - reply->allCharsExist = pFontInfo->allExist; - reply->fontAscent = pFontInfo->fontAscent; - reply->fontDescent = pFontInfo->fontDescent; - reply->nReplies = numFonts; - pFP = (xFontProp *) (reply + 1); - for (i = 0; i < pFontInfo->nprops; i++) - { - pFP->name = pFontInfo->props[i].name; - pFP->value = pFontInfo->props[i].value; - pFP++; - } - WriteSwappedDataToClient(client, length, reply); - (void) WriteToClient(client, namelen, name); - if (pFontInfo == &fontInfo) - { - xfree(fontInfo.props); - xfree(fontInfo.isStringProp); - } - --c->current.max_names; - } - } -finish: - length = sizeof(xListFontsWithInfoReply); - bzero((char *) &finalReply, sizeof(xListFontsWithInfoReply)); - finalReply.type = X_Reply; - finalReply.sequenceNumber = client->sequence; - finalReply.length = (sizeof(xListFontsWithInfoReply) - - sizeof(xGenericReply)) >> 2; - WriteSwappedDataToClient(client, length, &finalReply); -bail: - if (c->slept) - { - ClientWakeup(client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFontWinfo: client [%lx] wakeup.\n", client); -#endif - } - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->reply); - xfree(c->fpe_list); - xfree(c); - return TRUE; -} - -int -StartListFontsWithInfo(client, length, pattern, max_names) - ClientPtr client; - int length; - unsigned char *pattern; - int max_names; -{ - int i; - LFWIclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFWIclosurePtr) xalloc(sizeof *c))) - goto badAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) - { - xfree(c); - goto badAlloc; - } - memmove(c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) - { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->reply = 0; - c->length = 0; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->savedNumFonts = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - doListFontsWithInfo(client, c); - return Success; -badAlloc: - return BadAlloc; -} - -#define TextEltHeader 2 -#define FontShiftSize 5 -static XID clearGC[] = { CT_NONE }; -#define clearGCmask (GCClipMask) - -int -doPolyText(client, c) - ClientPtr client; - register PTclosurePtr c; -{ - register FontPtr pFont = c->pGC->font, oldpFont; - Font fid, oldfid; - int err = Success, lgerr; /* err is in X error, not font error, space */ - enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; - FontPathElementPtr fpe; - GC *origGC = NULL; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - - if (c->slept) - { - /* Client has died, but we cannot bail out right now. We - need to clean up after the work we did when going to - sleep. Setting the drawable pointer to 0 makes this - happen without any attempts to render or perform other - unnecessary activities. */ - c->pDraw = (DrawablePtr)0; - } - else - { - err = Success; - goto bail; - } - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client and avoid further - rendering while we clean up after ourself. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - c->pDraw = (DrawablePtr)0; - } - - client_state = c->slept ? SLEEPING : NEVER_SLEPT; - - while (c->endReq - c->pElt > TextEltHeader) - { - if (*c->pElt == FontChange) - { - if (c->endReq - c->pElt < FontShiftSize) - { - err = BadLength; - goto bail; - } - - oldpFont = pFont; - oldfid = fid; - - fid = ((Font)*(c->pElt+4)) /* big-endian */ - | ((Font)*(c->pElt+3)) << 8 - | ((Font)*(c->pElt+2)) << 16 - | ((Font)*(c->pElt+1)) << 24; - pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - client->errorValue = fid; - err = BadFont; - /* restore pFont and fid for step 4 (described below) */ - pFont = oldpFont; - fid = oldfid; - - /* If we're in START_SLEEP mode, the following step - shortens the request... in the unlikely event that - the fid somehow becomes valid before we come through - again to actually execute the polytext, which would - then mess up our refcounting scheme badly. */ - c->err = err; - c->endReq = c->pElt; - - goto bail; - } - - /* Step 3 (described below) on our new font */ - if (client_state == START_SLEEP) - pFont->refcnt++; - else - { - if (pFont != c->pGC->font && c->pDraw) - { - ChangeGC( c->pGC, GCFont, &fid); - ValidateGC(c->pDraw, c->pGC); - if (c->reqType == X_PolyText8) - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8; - else - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText16; - } - - /* Undo the refcnt++ we performed when going to sleep */ - if (client_state == SLEEPING) - (void)CloseFont(c->pGC->font, (Font)0); - } - c->pElt += FontShiftSize; - } - else /* print a string */ - { - unsigned char *pNextElt; - pNextElt = c->pElt + TextEltHeader + (*c->pElt)*c->itemSize; - if ( pNextElt > c->endReq) - { - err = BadLength; - goto bail; - } - if (client_state == START_SLEEP) - { - c->pElt = pNextElt; - continue; - } - if (c->pDraw) - { - lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, c->itemSize, - c->pElt + TextEltHeader); - } - else lgerr = Successful; - - if (lgerr == Suspended) - { - if (!c->slept) { - int len; - GC *pGC; - PTclosurePtr new_closure; - - /* We're putting the client to sleep. We need to do a few things - to ensure successful and atomic-appearing execution of the - remainder of the request. First, copy the remainder of the - request into a safe malloc'd area. Second, create a scratch GC - to use for the remainder of the request. Third, mark all fonts - referenced in the remainder of the request to prevent their - deallocation. Fourth, make the original GC look like the - request has completed... set its font to the final font value - from this request. These GC manipulations are for the unlikely - (but possible) event that some other client is using the GC. - Steps 3 and 4 are performed by running this procedure through - the remainder of the request in a special no-render mode - indicated by client_state = START_SLEEP. */ - - /* Step 1 */ - /* Allocate a malloc'd closure structure to replace - the local one we were passed */ - new_closure = (PTclosurePtr) xalloc(sizeof(PTclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - len = c->endReq - c->pElt; - c->data = (unsigned char *)xalloc(len); - if (!c->data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(c->data, c->pElt, len); - c->pElt = c->data; - c->endReq = c->pElt + len; - - /* Step 2 */ - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - - pGC->tileIsPixel = TRUE; - pGC->tile.pixel = 0; - pGC->stipple = NullPixmap; - - if ((err = CopyGC(c->pGC, pGC, GCFunction | - GCPlaneMask | GCForeground | - GCBackground | GCFillStyle | - GCTile | GCStipple | - GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != - Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - origGC = c->pGC; - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doPolyText, - (pointer) c); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doPolyText (1): client [%lx] sleeping.\n", client); -#endif - - /* Set up to perform steps 3 and 4 */ - client_state = START_SLEEP; - continue; /* on to steps 3 and 4 */ - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */ - c->xorg = (* c->polyText)(c->pDraw, c->pGC, c->xorg, c->yorg, - *c->pElt, c->pElt + TextEltHeader); - } - c->pElt = pNextElt; - } - } - -bail: - - if (client_state == START_SLEEP) - { - /* Step 4 */ - if (pFont != origGC->font) - { - ChangeGC(origGC, GCFont, &fid); - ValidateGC(c->pDraw, origGC); - } - - /* restore pElt pointer for execution of remainder of the request */ - c->pElt = c->data; - return TRUE; - } - - if (c->err != Success) err = c->err; - if (err != Success && c->client != serverClient) { -#ifdef PANORAMIX - if (noPanoramiXExtension || !c->pGC->pScreen->myNum) -#endif - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doPolytext: client [%lx] wakeup.\n", client); -#endif - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -PolyText(client, pDraw, pGC, pElt, endReq, xorg, yorg, reqType, did) - ClientPtr client; - DrawablePtr pDraw; - GC *pGC; - unsigned char *pElt; - unsigned char *endReq; - int xorg; - int yorg; - int reqType; - XID did; -{ - PTclosureRec local_closure; - - local_closure.pElt = pElt; - local_closure.endReq = endReq; - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_PolyText8) - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText8; - local_closure.itemSize = 1; - } - else - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText16; - local_closure.itemSize = 2; - } - local_closure.pGC = pGC; - local_closure.did = did; - local_closure.err = Success; - local_closure.slept = FALSE; - - (void) doPolyText(client, &local_closure); - return Success; -} - - -#undef TextEltHeader -#undef FontShiftSize - -int -doImageText(client, c) - ClientPtr client; - register ITclosurePtr c; -{ - int err = Success, lgerr; /* err is in X error, not font error, space */ - FontPathElementPtr fpe; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, c->itemSize, c->data); - if (lgerr == Suspended) - { - if (!c->slept) { - GC *pGC; - unsigned char *data; - ITclosurePtr new_closure; - - /* We're putting the client to sleep. We need to - save some state. Similar problem to that handled - in doPolyText, but much simpler because the - request structure is much simpler. */ - - new_closure = (ITclosurePtr) xalloc(sizeof(ITclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - data = (unsigned char *)xalloc(c->nChars * c->itemSize); - if (!data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(data, c->data, c->nChars * c->itemSize); - c->data = data; - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - - pGC->tileIsPixel = TRUE; - pGC->tile.pixel = 0; - pGC->stipple = NullPixmap; - - if ((err = CopyGC(c->pGC, pGC, GCFunction | GCPlaneMask | - GCForeground | GCBackground | GCFillStyle | - GCTile | GCStipple | GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doImageText, (pointer) c); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doImageText (1): client [%lx] sleeping.\n", client); -#endif - - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - (* c->imageText)(c->pDraw, c->pGC, c->xorg, c->yorg, - c->nChars, c->data); - } - -bail: - - if (err != Success && c->client != serverClient) { - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doImageText: client [%lx] wakeup.\n", client); -#endif - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -ImageText(client, pDraw, pGC, nChars, data, xorg, yorg, reqType, did) - ClientPtr client; - DrawablePtr pDraw; - GC *pGC; - int nChars; - unsigned char *data; - int xorg; - int yorg; - int reqType; - XID did; -{ - ITclosureRec local_closure; - - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.pGC = pGC; - local_closure.nChars = nChars; - local_closure.data = data; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_ImageText8) - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText8; - local_closure.itemSize = 1; - } - else - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText16; - local_closure.itemSize = 2; - } - local_closure.did = did; - local_closure.slept = FALSE; - - (void) doImageText(client, &local_closure); - return Success; -} - - -/* does the necessary magic to figure out the fpe type */ -static int -#if NeedFunctionPrototypes -DetermineFPEType(char *pathname) -#else -DetermineFPEType(pathname) - char *pathname; -#endif -{ - int i; - - for (i = 0; i < num_fpe_types; i++) { - if ((*fpe_functions[i].name_check) (pathname)) - return i; - } - return -1; -} - - -static void -#if NeedFunctionPrototypes -FreeFontPath(FontPathElementPtr *list, int n, Bool force) -#else -FreeFontPath(list, n, force) - FontPathElementPtr *list; - Bool force; - int n; -#endif -{ - int i; - - for (i = 0; i < n; i++) { - if (force) { - /* Sanity check that all refcounts will be 0 by the time - we get to the end of the list. */ - int found = 1; /* the first reference is us */ - int j; - for (j = i+1; j < n; j++) { - if (list[j] == list[i]) - found++; - } - if (list[i]->refcount != found) { - ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n", - list[i]->name_length, list[i]->name, - list[i]->refcount, found); - list[i]->refcount = found; /* ensure it will get freed */ - } - } - FreeFPE(list[i]); - } - xfree((char *) list); -} - -static FontPathElementPtr -#if NeedFunctionPrototypes -find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len) -#else -find_existing_fpe(list, num, name, len) - FontPathElementPtr *list; - int num; - unsigned char *name; - int len; -#endif -{ - FontPathElementPtr fpe; - int i; - - for (i = 0; i < num; i++) { - fpe = list[i]; - if (fpe->name_length == len && memcmp(name, fpe->name, len) == 0) - return fpe; - } - return (FontPathElementPtr) 0; -} - - -static int -#if NeedFunctionPrototypes -SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) -#else -SetFontPathElements(npaths, paths, bad, persist) - int npaths; - unsigned char *paths; - int *bad; - Bool persist; -#endif -{ - int i, err = 0; - int valid_paths = 0; - unsigned int len; - unsigned char *cp = paths; - FontPathElementPtr fpe = NULL, *fplist; - - fplist = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * npaths); - if (!fplist) { - *bad = 0; - return BadAlloc; - } - for (i = 0; i < num_fpe_types; i++) { - if (fpe_functions[i].set_path_hook) - (*fpe_functions[i].set_path_hook) (); - } - for (i = 0; i < npaths; i++) - { - len = (unsigned int) (*cp++); - - if (len == 0) - { - if (persist) - ErrorF ("Removing empty element from the valid list of fontpaths\n"); - err = BadValue; - } - else - { - /* if it's already in our active list, just reset it */ - /* - * note that this can miss FPE's in limbo -- may be worth catching - * them, though it'd muck up refcounting - */ - fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); - if (fpe) - { - err = (*fpe_functions[fpe->type].reset_fpe) (fpe); - if (err == Successful) - { - UseFPE(fpe);/* since it'll be decref'd later when freed - * from the old list */ - } - else - fpe = 0; - } - /* if error or can't do it, act like it's a new one */ - if (!fpe) - { - fpe = (FontPathElementPtr) xalloc(sizeof(FontPathElementRec)); - if (!fpe) - { - err = BadAlloc; - goto bail; - } - fpe->name = (char *) xalloc(len + 1); - if (!fpe->name) - { - xfree(fpe); - err = BadAlloc; - goto bail; - } - fpe->refcount = 1; - - strncpy(fpe->name, (char *) cp, (int) len); - fpe->name[len] = '\0'; - fpe->name_length = len; - fpe->type = DetermineFPEType(fpe->name); - if (fpe->type == -1) - err = BadValue; - else - err = (*fpe_functions[fpe->type].init_fpe) (fpe); - if (err != Successful) - { - if (persist) - { - ErrorF("Could not init font path element %s, removing from list!\n", - fpe->name); - } - xfree (fpe->name); - xfree (fpe); - } - } - } - if (err != Successful) - { - if (!persist) - goto bail; - } - else - { - fplist[valid_paths++] = fpe; - } - cp += len; - } - - FreeFontPath(font_path_elements, num_fpes, FALSE); - font_path_elements = fplist; - if (patternCache) - EmptyFontPatternCache(patternCache); - num_fpes = valid_paths; - - return Success; -bail: - *bad = i; - while (--valid_paths >= 0) - FreeFPE(fplist[valid_paths]); - xfree(fplist); - return FontToXError(err); -} - -/* XXX -- do we need to pass error down to each renderer? */ -int -SetFontPath(client, npaths, paths, error) - ClientPtr client; - int npaths; - unsigned char *paths; - int *error; -{ - int err = Success; - - if (npaths == 0) { - if (SetDefaultFontPath(defaultFontPath) != Success) - return BadValue; - } else { - err = SetFontPathElements(npaths, paths, error, FALSE); - } - return err; -} - -int -SetDefaultFontPath(path) - char *path; -{ - unsigned char *cp, - *pp, - *nump, - *newpath; - int num = 1, - len, - err, - size = 0, - bad; - - /* get enough for string, plus values -- use up commas */ -#ifdef NX_TRANS_SOCKET - len = strlen(_NXGetFontPath(path)) + 1; -#else - len = strlen(path) + 1; -#endif - nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); - if (!newpath) - return BadAlloc; -#ifdef NX_TRANS_SOCKET - pp = (unsigned char *) _NXGetFontPath(path); -#else - pp = (unsigned char *) path; -#endif - cp++; - while (*pp) { - if (*pp == ',') { - *nump = (unsigned char) size; - nump = cp++; - pp++; - num++; - size = 0; - } else { - *cp++ = *pp++; - size++; - } - } - *nump = (unsigned char) size; - - err = SetFontPathElements(num, newpath, &bad, TRUE); - - DEALLOCATE_LOCAL(newpath); - - return err; -} - -unsigned char * -GetFontPath(count, length) - int *count; - int *length; -{ - int i; - unsigned char *c; - int len; - FontPathElementPtr fpe; - - len = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - len += fpe->name_length + 1; - } - font_path_string = (unsigned char *) xrealloc(font_path_string, len); - if (!font_path_string) - return NULL; - - c = font_path_string; - *length = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - *c = fpe->name_length; - *length += *c++; - memmove(c, fpe->name, fpe->name_length); - c += fpe->name_length; - } - *count = num_fpes; - return font_path_string; -} - -int -LoadGlyphs(client, pfont, nchars, item_size, data) - ClientPtr client; - FontPtr pfont; - unsigned nchars; - int item_size; - unsigned char *data; -{ - if (fpe_functions[pfont->fpe->type].load_glyphs) - return (*fpe_functions[pfont->fpe->type].load_glyphs) - (client, pfont, 0, nchars, item_size, data); - else - return Successful; -} - -void -DeleteClientFontStuff(client) - ClientPtr client; -{ - int i; - FontPathElementPtr fpe; - - for (i = 0; i < num_fpes; i++) - { - fpe = font_path_elements[i]; - if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } -} - -void -InitFonts () -{ - patternCache = MakeFontPatternCache(); - -#ifndef KDRIVESERVER - if (screenInfo.numScreens > screenInfo.numVideoScreens) { - PrinterFontRegisterFpeFunctions(); - FontFileCheckRegisterFpeFunctions(); - check_fs_register_fpe_functions(); - } else -#endif - { -#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); -#endif - FontFileRegisterFpeFunctions(); -#ifndef NOFONTSERVERACCESS - fs_register_fpe_functions(); -#endif - } -} - -int -GetDefaultPointSize () -{ - return 120; -} - - -FontResolutionPtr -GetClientResolutions (num) - int *num; -{ - if (requestingClient && requestingClient->fontResFunc != NULL && - !requestingClient->clientGone) - { - return (*requestingClient->fontResFunc)(requestingClient, num); - } - else { - static struct _FontResolution res; - ScreenPtr pScreen; - - pScreen = screenInfo.screens[0]; - res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; - /* - * XXX - we'll want this as long as bitmap instances are prevalent - so that we can match them from scalable fonts - */ - if (res.x_resolution < 88) - res.x_resolution = 75; - else - res.x_resolution = 100; - res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight; - if (res.y_resolution < 88) - res.y_resolution = 75; - else - res.y_resolution = 100; - res.point_size = 120; - *num = 1; - return &res; - } -} - -/* - * returns the type index of the new fpe - * - * should be called (only once!) by each type of fpe when initialized - */ - -int -RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func) -{ - FPEFunctions *new; - - /* grow the list */ - new = (FPEFunctions *) xrealloc(fpe_functions, - (num_fpe_types + 1) * sizeof(FPEFunctions)); - if (!new) - return -1; - fpe_functions = new; - - fpe_functions[num_fpe_types].name_check = name_func; - fpe_functions[num_fpe_types].open_font = open_func; - fpe_functions[num_fpe_types].close_font = close_func; - fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func; - fpe_functions[num_fpe_types].list_fonts = list_func; - fpe_functions[num_fpe_types].start_list_fonts_with_info = - start_lfwi_func; - fpe_functions[num_fpe_types].list_next_font_with_info = - next_lfwi_func; - fpe_functions[num_fpe_types].init_fpe = init_func; - fpe_functions[num_fpe_types].free_fpe = free_func; - fpe_functions[num_fpe_types].reset_fpe = reset_func; - fpe_functions[num_fpe_types].client_died = client_died; - fpe_functions[num_fpe_types].load_glyphs = load_glyphs; - fpe_functions[num_fpe_types].start_list_fonts_and_aliases = - start_list_alias_func; - fpe_functions[num_fpe_types].list_next_font_or_alias = - next_list_alias_func; - fpe_functions[num_fpe_types].set_path_hook = set_path_func; - - return num_fpe_types++; -} - -void -FreeFonts() -{ - if (patternCache) { - FreeFontPatternCache(patternCache); - patternCache = 0; - } - FreeFontPath(font_path_elements, num_fpes, TRUE); - font_path_elements = 0; - num_fpes = 0; - xfree(fpe_functions); - num_fpe_types = 0; - fpe_functions = (FPEFunctions *) 0; -} - -/* convenience functions for FS interface */ - -FontPtr -find_old_font(id) - XID id; -{ - return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, - SecurityUnknownAccess); -} - -Font -GetNewFontClientID() -{ - return FakeClientID(0); -} - -int -StoreFontClientFont(pfont, id) - FontPtr pfont; - Font id; -{ - return AddResource(id, RT_NONE, (pointer) pfont); -} - -void -DeleteFontClientID(id) - Font id; -{ - FreeResource(id, RT_NONE); -} - -int -client_auth_generation(client) - ClientPtr client; -{ - return 0; -} - -static int fs_handlers_installed = 0; -static unsigned int last_server_gen; - -int -init_fs_handlers(fpe, block_handler) - FontPathElementPtr fpe; - BlockHandlerProcPtr block_handler; -{ - /* if server has reset, make sure the b&w handlers are reinstalled */ - if (last_server_gen < serverGeneration) { - last_server_gen = serverGeneration; - fs_handlers_installed = 0; - } - if (fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "adding FS b & w handlers\n"); -#endif - - if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (pointer) 0)) - return AllocError; - fs_handlers_installed++; - } - QueueFontWakeup(fpe); - return Successful; -} - -void -remove_fs_handlers(fpe, block_handler, all) - FontPathElementPtr fpe; - BlockHandlerProcPtr block_handler; - Bool all; -{ - if (all) { - /* remove the handlers if no one else is using them */ - if (--fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "removing FS b & w handlers\n"); -#endif - - RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (pointer) 0); - } - } - RemoveFontWakeup(fpe); -} - -#ifdef DEBUG -#define GLWIDTHBYTESPADDED(bits,nbytes) \ - ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \ - :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \ - :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \ - :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \ - : 0) - -#define GLYPH_SIZE(ch, nbytes) \ - GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \ - (ch)->metrics.leftSideBearing, (nbytes)) -dump_char_ascii(cip) - CharInfoPtr cip; -{ - int r, - l; - int bpr; - int byte; - static unsigned maskTab[] = { - (1 << 7), (1 << 6), (1 << 5), (1 << 4), - (1 << 3), (1 << 2), (1 << 1), (1 << 0), - }; - - bpr = GLYPH_SIZE(cip, 4); - for (r = 0; r < (cip->metrics.ascent + cip->metrics.descent); r++) { - pointer row = (pointer) cip->bits + r * bpr; - - byte = 0; - for (l = 0; l <= (cip->metrics.rightSideBearing - - cip->metrics.leftSideBearing); l++) { - if (maskTab[l & 7] & row[l >> 3]) - putchar('X'); - else - putchar('.'); - } - putchar('\n'); - } -} - -#endif - - -typedef struct -{ - LFclosurePtr c; - OFclosurePtr oc; -} nxFs,*nxFsPtr; - -static Bool -#if NeedFunctionPrototypes -nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) -#else -nxdoListFontsAndAliases(client, fss) - ClientPtr client; - nxFsPtr fss; -#endif -{ - LFclosurePtr c=fss->c; - OFclosurePtr oc=fss->oc; - FontPathElementPtr fpe; - int err = Successful; - char *name, *resolved=NULL; - int namelen, resolvedlen; - int i; - int aliascount = 0; - char tmp[256]; - tmp[0]=0; - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - - if (!c->current.patlen) - goto finish; - - while (c->current.current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) - { - /* This FPE doesn't support/require list_fonts_and_aliases */ - - err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - c->names); - - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)nxdoListFontsAndAliases, - (pointer) fss); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: nxdoListFont (1): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - - err = BadFontName; - } - else - { - /* Start of list_fonts_and_aliases functionality. Modeled - after list_fonts_with_info in that it resolves aliases, - except that the information collected from FPEs is just - names, not font info. Each list_next_font_or_alias() - returns either a name into name/namelen or an alias into - name/namelen and its target name into resolved/resolvedlen. - The code at this level then resolves the alias by polling - the FPEs. */ - - if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - &c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)nxdoListFontsAndAliases, - (pointer) fss); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: nxdoListFont (2): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) { - char *tmpname; - name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, - &resolvedlen, c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)nxdoListFontsAndAliases, - (pointer) fss); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: nxdoListFont (3): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - if (err == FontNameAlias) { - if (resolved) xfree(resolved); - resolved = (char *) xalloc(resolvedlen + 1); - if (resolved) - { - memmove(resolved, tmpname, resolvedlen); - resolved[resolvedlen] = '\0'; - } - } - } - - if (err == Successful) - { - if (c->haveSaved) - { - if (c->savedName) - { - memcpy(tmp,c->savedName,c->savedNameLen>255?255:c->savedNameLen); - tmp[c->savedNameLen>255?256:c->savedNameLen]=0; - if (nxagentFontLookUp(tmp)) - break; - else tmp[0]=0; - } - } - else - { - memcpy(tmp,name,namelen>255?255:namelen); - tmp[namelen>255?256:namelen]=0; - if (nxagentFontLookUp(tmp)) - break; - else tmp[0]=0; - } - } - - /* - * When we get an alias back, save our state and reset back to - * the start of the FPE looking for the specified name. As - * soon as a real font is found for the alias, pop back to the - * old state - */ - else if (err == FontNameAlias) { - char tmp_pattern[XLFDMAXFONTNAMELEN]; - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - memmove(tmp_pattern, resolved, resolvedlen); - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - - tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, - &tmpname, &tmpnamelen, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - { - memmove(c->savedName, name, namelen); - c->savedName[namelen] = '\0'; - } - c->savedNameLen = namelen; - aliascount = 20; - } - memmove(c->current.pattern, tmp_pattern, resolvedlen); - c->current.patlen = resolvedlen; - c->current.max_names = c->names->nnames + 1; - c->current.current_fpe = -1; - c->current.private = 0; - err = BadFontName; - } - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've collected enough - * font names, quit. - */ - if (err == BadFontName) { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->names->nnames == c->current.max_names || - c->current.current_fpe == c->num_fpes) { - c->haveSaved = FALSE; - c->current = c->saved; - /* Give the saved namelist a chance to clean itself up */ - continue; - } - } - if (c->names->nnames == c->current.max_names) - break; - } - } - - /* - * send the reply - */ -bail: -finish: - if (strlen(tmp)) - { -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "nxListFont changed (0) font to %s\n",tmp); -#endif - memcpy(oc->fontname, tmp, strlen(tmp)); - oc->fnamelen = strlen(tmp); - - oc->origFontName = oc->fontname; - oc->origFontNameLen = oc->fnamelen; - - } - else - { - for (i = 0; i < c->names->nnames; i++) - { - if (c->names->length[i] > 255) - continue; - else - { - memcpy(tmp, c->names->names[i], c->names->length[i]); - tmp[ c->names->length[i] ] = 0; - if (nxagentFontLookUp(tmp) == 0) - continue; - memcpy(oc->fontname, tmp, strlen(tmp)); - oc->fnamelen = strlen(tmp); - - oc->origFontName = oc->fontname; - oc->origFontNameLen = oc->fnamelen; - -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "nxListFont changed (1) font to %s\n",tmp); -#endif - break; - } - } - } - - if (c->slept) - { - ClientWakeup(client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: nxdoListFont: client [%lx] wakeup.\n", client); -#endif - } - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - FreeFontNames(c->names); - xfree(c); - xfree(fss); - if (resolved) xfree(resolved); - - return doOpenFont(client, oc); -} - -int -nxOpenFont(client, fid, flags, lenfname, pfontname) - ClientPtr client; - XID fid; - Mask flags; - unsigned lenfname; - char *pfontname; -{ - nxFsPtr fss; - LFclosurePtr c; - OFclosurePtr oc; - int i; - FontPtr cached = (FontPtr)0; - -#ifdef FONTDEBUG - char *f; - f = (char *)xalloc(lenfname + 1); - memmove(f, pfontname, lenfname); - f[lenfname] = '\0'; - ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); -#endif - if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) - return BadName; - if (patternCache) - { - - /* - ** Check name cache. If we find a cached version of this font that - ** is cachable, immediately satisfy the request with it. If we find - ** a cached version of this font that is non-cachable, we do not - ** satisfy the request with it. Instead, we pass the FontPtr to the - ** FPE's open_font code (the fontfile FPE in turn passes the - ** information to the rasterizer; the fserve FPE ignores it). - ** - ** Presumably, the font is marked non-cachable because the FPE has - ** put some licensing restrictions on it. If the FPE, using - ** whatever logic it relies on, determines that it is willing to - ** share this existing font with the client, then it has the option - ** to return the FontPtr we passed it as the newly-opened font. - ** This allows the FPE to exercise its licensing logic without - ** having to create another instance of a font that already exists. - */ - - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); - if (cached && cached->info.cachable) - { - if (!AddResource(fid, RT_FONT, (pointer) cached)) - return BadAlloc; - cached->refcnt++; - return Success; - } - } - if (!(fss = (nxFsPtr) xalloc(sizeof(nxFs)))) - return BadAlloc; - - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) - { - xfree(fss); - return BadAlloc; - } - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c); - xfree(fss); - return BadAlloc; - } - c->names = MakeFontNamesRecord(100); - if (!c->names) - { - xfree(c->fpe_list); - xfree(c); - xfree(fss); - return BadAlloc; - } - memmove( c->current.pattern, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->current.patlen = lenfname; - c->current.current_fpe = 0; - c->current.max_names = nxagentMaxFontNames; - c->current.list_started = FALSE; - c->current.private = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - - oc = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); - if (!oc) - { - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(fss); - return BadAlloc; - } - oc->fontname = (char *) xalloc(256);/* I don't want to deal with future reallocs errors */ - oc->origFontName = pfontname; - oc->origFontNameLen = lenfname; - if (!oc->fontname) { - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(oc); - xfree(fss); - return BadAlloc; - } - /* - * copy the current FPE list, so that if it gets changed by another client - * while we're blocking, the request still appears atomic - */ - oc->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!oc->fpe_list) { - xfree(oc->fontname); - xfree(oc); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(fss); - return BadAlloc; - } - memmove(oc->fontname, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - oc->fpe_list[i] = font_path_elements[i]; - UseFPE(oc->fpe_list[i]); - } - oc->client = client; - oc->fontid = fid; - oc->current_fpe = 0; - oc->num_fpes = num_fpes; - oc->fnamelen = lenfname; - oc->slept = FALSE; - oc->flags = flags; - oc->non_cachable_font = cached; - fss->c=c; - fss->oc=oc; - nxdoListFontsAndAliases(client, fss); - return Success; -} - - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.XF86.original deleted file mode 100644 index 5386c908b..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.XF86.original +++ /dev/null @@ -1,2223 +0,0 @@ -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.27 2003/02/15 03:47:05 dawes 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: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ - -#define NEED_REPLIES -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" -#include "scrnintstr.h" -#include "resource.h" -#include "dixstruct.h" -#include "cursorstr.h" -#include "misc.h" -#include "opaque.h" -#include "dixfontstr.h" -#include "closestr.h" - -#ifdef DEBUG -#include -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#endif - -#ifdef LBX -#include "lbxserve.h" -#endif - -#ifdef XF86BIGFONT -#define _XF86BIGFONT_SERVER_ -#include "xf86bigfont.h" -#endif - -#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics - -extern pointer fosNaturalParams; -extern FontPtr defaultFont; - -static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; -static int num_fpes = 0; -FPEFunctions *fpe_functions = (FPEFunctions *) 0; -static int num_fpe_types = 0; - -static unsigned char *font_path_string; - -static int num_slept_fpes = 0; -static int size_slept_fpes = 0; -static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; -static FontPatternCachePtr patternCache; - -int -FontToXError(err) - int err; -{ - switch (err) { - case Successful: - return Success; - case AllocError: - return BadAlloc; - case BadFontName: - return BadName; - case BadFontPath: - case BadFontFormat: /* is there something better? */ - case BadCharRange: - return BadValue; - default: - return err; - } -} - - -/* - * adding RT_FONT prevents conflict with default cursor font - */ -Bool -SetDefaultFont(defaultfontname) - char *defaultfontname; -{ - int err; - FontPtr pf; - XID fid; - - fid = FakeClientID(0); - err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync, - (unsigned) strlen(defaultfontname), defaultfontname); - if (err != Success) - return FALSE; - pf = (FontPtr) LookupIDByType(fid, RT_FONT); - if (pf == (FontPtr) NULL) - return FALSE; - defaultFont = pf; - return TRUE; -} - -/* - * note that the font wakeup queue is not refcounted. this is because - * an fpe needs to be added when it's inited, and removed when it's finally - * freed, in order to handle any data that isn't requested, like FS events. - * - * since the only thing that should call these routines is the renderer's - * init_fpe() and free_fpe(), there shouldn't be any problem in using - * freed data. - */ -void -QueueFontWakeup(fpe) - FontPathElementPtr fpe; -{ - int i; - FontPathElementPtr *new; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - -#ifdef DEBUG - fprintf(stderr, "re-queueing fpe wakeup\n"); -#endif - - return; - } - } - if (num_slept_fpes == size_slept_fpes) { - new = (FontPathElementPtr *) - xrealloc(slept_fpes, - sizeof(FontPathElementPtr) * (size_slept_fpes + 4)); - if (!new) - return; - slept_fpes = new; - size_slept_fpes += 4; - } - slept_fpes[num_slept_fpes] = fpe; - num_slept_fpes++; -} - -void -RemoveFontWakeup(fpe) - FontPathElementPtr fpe; -{ - int i, - j; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - for (j = i; j < num_slept_fpes; j++) { - slept_fpes[j] = slept_fpes[j + 1]; - } - num_slept_fpes--; - return; - } - } -} - -/* ARGSUSED */ -void -FontWakeup(data, count, LastSelectMask) - pointer data; - int count; - pointer LastSelectMask; -{ - int i; - FontPathElementPtr fpe; - - if (count < 0) - return; - /* wake up any fpe's that may be waiting for information */ - for (i = 0; i < num_slept_fpes; i++) { - fpe = slept_fpes[i]; - (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); - } -} - -/* XXX -- these two funcs may want to be broken into macros */ -static void -#if NeedFunctionPrototypes -UseFPE(FontPathElementPtr fpe) -#else -UseFPE(fpe) - FontPathElementPtr fpe; -#endif -{ - fpe->refcount++; -} - -static void -#if NeedFunctionPrototypes -FreeFPE (FontPathElementPtr fpe) -#else -FreeFPE (fpe) - FontPathElementPtr fpe; -#endif -{ - fpe->refcount--; - if (fpe->refcount == 0) { - (*fpe_functions[fpe->type].free_fpe) (fpe); - xfree(fpe->name); - xfree(fpe); - } -} - -static Bool -#if NeedFunctionPrototypes -doOpenFont(ClientPtr client, OFclosurePtr c) -#else -doOpenFont(client, c) - ClientPtr client; - OFclosurePtr c; -#endif -{ - FontPtr pfont = NullFont; - FontPathElementPtr fpe = NULL; - ScreenPtr pScr; - int err = Successful; - int i; - char *alias, - *newname; - int newlen; - int aliascount = 20; - /* - * Decide at runtime what FontFormat to use. - */ - Mask FontFormat = - - ((screenInfo.imageByteOrder == LSBFirst) ? - BitmapFormatByteOrderLSB : BitmapFormatByteOrderMSB) | - - ((screenInfo.bitmapBitOrder == LSBFirst) ? - BitmapFormatBitOrderLSB : BitmapFormatBitOrderMSB) | - - BitmapFormatImageRectMin | - -#if GLYPHPADBYTES == 1 - BitmapFormatScanlinePad8 | -#endif - -#if GLYPHPADBYTES == 2 - BitmapFormatScanlinePad16 | -#endif - -#if GLYPHPADBYTES == 4 - BitmapFormatScanlinePad32 | -#endif - -#if GLYPHPADBYTES == 8 - BitmapFormatScanlinePad64 | -#endif - - BitmapFormatScanlineUnit8; - - if (client->clientGone) - { - if (c->current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - while (c->current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current_fpe]; - err = (*fpe_functions[fpe->type].open_font) - ((pointer) client, fpe, c->flags, - c->fontname, c->fnamelen, FontFormat, - BitmapFormatMaskByte | - BitmapFormatMaskBit | - BitmapFormatMaskImageRectangle | - BitmapFormatMaskScanLinePad | - BitmapFormatMaskScanLineUnit, - c->fontid, &pfont, &alias, - c->non_cachable_font && c->non_cachable_font->fpe == fpe ? - c->non_cachable_font : - (FontPtr)0); - - if (err == FontNameAlias && alias) { - newlen = strlen(alias); - newname = (char *) xrealloc(c->fontname, newlen); - if (!newname) { - err = AllocError; - break; - } - memmove(newname, alias, newlen); - c->fontname = newname; - c->fnamelen = newlen; - c->current_fpe = 0; - if (--aliascount <= 0) - break; - continue; - } - if (err == BadFontName) { - c->current_fpe++; - continue; - } - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (pointer) c); - } - return TRUE; - } - break; - } - - if (err != Successful) - goto bail; - if (!pfont) { - err = BadFontName; - goto bail; - } - if (!pfont->fpe) - pfont->fpe = fpe; - pfont->refcnt++; - if (pfont->refcnt == 1) { - UseFPE(pfont->fpe); - for (i = 0; i < screenInfo.numScreens; i++) { - pScr = screenInfo.screens[i]; - if (pScr->RealizeFont) - { - if (!(*pScr->RealizeFont) (pScr, pfont)) - { - CloseFont (pfont, (Font) 0); - err = AllocError; - goto bail; - } - } - } - } - if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) { - err = AllocError; - goto bail; - } - if (patternCache && pfont != c->non_cachable_font) - CacheFontPattern(patternCache, c->origFontName, c->origFontNameLen, - pfont); -bail: - if (err != Successful && c->client != serverClient) { - SendErrorToClient(c->client, X_OpenFont, 0, - c->fontid, FontToXError(err)); - } - if (c->slept) - ClientWakeup(c->client); - for (i = 0; i < c->num_fpes; i++) { - FreeFPE(c->fpe_list[i]); - } - xfree(c->fpe_list); - xfree(c->fontname); - xfree(c); - return TRUE; -} - -int -OpenFont(client, fid, flags, lenfname, pfontname) - ClientPtr client; - XID fid; - Mask flags; - unsigned lenfname; - char *pfontname; -{ - OFclosurePtr c; - int i; - FontPtr cached = (FontPtr)0; - -#ifdef FONTDEBUG - char *f; - f = (char *)xalloc(lenfname + 1); - memmove(f, pfontname, lenfname); - f[lenfname] = '\0'; - ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); -#endif - if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) - return BadName; - if (patternCache) - { - - /* - ** Check name cache. If we find a cached version of this font that - ** is cachable, immediately satisfy the request with it. If we find - ** a cached version of this font that is non-cachable, we do not - ** satisfy the request with it. Instead, we pass the FontPtr to the - ** FPE's open_font code (the fontfile FPE in turn passes the - ** information to the rasterizer; the fserve FPE ignores it). - ** - ** Presumably, the font is marked non-cachable because the FPE has - ** put some licensing restrictions on it. If the FPE, using - ** whatever logic it relies on, determines that it is willing to - ** share this existing font with the client, then it has the option - ** to return the FontPtr we passed it as the newly-opened font. - ** This allows the FPE to exercise its licensing logic without - ** having to create another instance of a font that already exists. - */ - - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); - if (cached && cached->info.cachable) - { - if (!AddResource(fid, RT_FONT, (pointer) cached)) - return BadAlloc; - cached->refcnt++; - return Success; - } - } - c = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); - if (!c) - return BadAlloc; - c->fontname = (char *) xalloc(lenfname); - c->origFontName = pfontname; - c->origFontNameLen = lenfname; - if (!c->fontname) { - xfree(c); - return BadAlloc; - } - /* - * copy the current FPE list, so that if it gets changed by another client - * while we're blocking, the request still appears atomic - */ - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c->fontname); - xfree(c); - return BadAlloc; - } - memmove(c->fontname, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->fontid = fid; - c->current_fpe = 0; - c->num_fpes = num_fpes; - c->fnamelen = lenfname; - c->slept = FALSE; - c->flags = flags; - c->non_cachable_font = cached; - - (void) doOpenFont(client, c); - return Success; -} - -/* - * Decrement font's ref count, and free storage if ref count equals zero - */ -/*ARGSUSED*/ -int -CloseFont(value, fid) - pointer value; /* must conform to DeleteType */ - XID fid; -{ - int nscr; - ScreenPtr pscr; - FontPathElementPtr fpe; - FontPtr pfont = (FontPtr)value; - - if (pfont == NullFont) - return (Success); - if (--pfont->refcnt == 0) { - if (patternCache) - RemoveCachedFontPattern (patternCache, pfont); - /* - * since the last reference is gone, ask each screen to free any - * storage it may have allocated locally for it. - */ - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { - pscr = screenInfo.screens[nscr]; - if (pscr->UnrealizeFont) - (*pscr->UnrealizeFont) (pscr, pfont); - } - if (pfont == defaultFont) - defaultFont = NULL; -#ifdef LBX - LbxFreeFontTag(pfont); -#endif -#ifdef XF86BIGFONT - XF86BigfontFreeFontShm(pfont); -#endif - fpe = pfont->fpe; - (*fpe_functions[fpe->type].close_font) (fpe, pfont); - FreeFPE(fpe); - } - return (Success); -} - - -/***====================================================================***/ - - /* - * \ Sets up pReply as the correct QueryFontReply for pFont with the first - * nProtoCCIStructs char infos. \ - */ - -void -QueryFont(pFont, pReply, nProtoCCIStructs) - FontPtr pFont; - xQueryFontReply *pReply; /* caller must allocate this storage */ - int nProtoCCIStructs; -{ - FontPropPtr pFP; - int r, - c, - i; - xFontProp *prFP; - xCharInfo *prCI; - xCharInfo *charInfos[256]; - unsigned char chars[512]; - int ninfos; - unsigned long ncols; - unsigned long count; - - /* pr->length set in dispatch */ - pReply->minCharOrByte2 = pFont->info.firstCol; - pReply->defaultChar = pFont->info.defaultCh; - pReply->maxCharOrByte2 = pFont->info.lastCol; - pReply->drawDirection = pFont->info.drawDirection; - pReply->allCharsExist = pFont->info.allExist; - pReply->minByte1 = pFont->info.firstRow; - pReply->maxByte1 = pFont->info.lastRow; - pReply->fontAscent = pFont->info.fontAscent; - pReply->fontDescent = pFont->info.fontDescent; - - pReply->minBounds = pFont->info.ink_minbounds; - pReply->maxBounds = pFont->info.ink_maxbounds; - - pReply->nFontProps = pFont->info.nprops; - pReply->nCharInfos = nProtoCCIStructs; - - for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) (&pReply[1]); - i < pFont->info.nprops; - i++, pFP++, prFP++) { - prFP->name = pFP->name; - prFP->value = pFP->value; - } - - ninfos = 0; - ncols = (unsigned long) (pFont->info.lastCol - pFont->info.firstCol + 1); - prCI = (xCharInfo *) (prFP); - for (r = pFont->info.firstRow; - ninfos < nProtoCCIStructs && r <= (int)pFont->info.lastRow; - r++) { - i = 0; - for (c = pFont->info.firstCol; c <= (int)pFont->info.lastCol; c++) { - chars[i++] = r; - chars[i++] = c; - } - (*pFont->get_metrics) (pFont, ncols, chars, - TwoD16Bit, &count, charInfos); - i = 0; - for (i = 0; i < (int) count && ninfos < nProtoCCIStructs; i++) { - *prCI = *charInfos[i]; - prCI++; - ninfos++; - } - } - return; -} - -static Bool -#if NeedFunctionPrototypes -doListFontsAndAliases(ClientPtr client, LFclosurePtr c) -#else -doListFontsAndAliases(client, c) - ClientPtr client; - LFclosurePtr c; -#endif -{ - FontPathElementPtr fpe; - int err = Successful; - FontNamesPtr names = NULL; - char *name, *resolved=NULL; - int namelen, resolvedlen; - int nnames; - int stringLens; - int i; - xListFontsReply reply; - char *bufptr; - char *bufferStart; - int aliascount = 0; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - - if (!c->current.patlen) - goto finish; - - while (c->current.current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) - { - /* This FPE doesn't support/require list_fonts_and_aliases */ - - err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - c->names); - - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - } - return TRUE; - } - - err = BadFontName; - } - else - { - /* Start of list_fonts_and_aliases functionality. Modeled - after list_fonts_with_info in that it resolves aliases, - except that the information collected from FPEs is just - names, not font info. Each list_next_font_or_alias() - returns either a name into name/namelen or an alias into - name/namelen and its target name into resolved/resolvedlen. - The code at this level then resolves the alias by polling - the FPEs. */ - - if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - &c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) { - char *tmpname; - name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, - &resolvedlen, c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; - } - return TRUE; - } - if (err == FontNameAlias) { - if (resolved) xfree(resolved); - resolved = (char *) xalloc(resolvedlen + 1); - if (resolved) - memmove(resolved, tmpname, resolvedlen + 1); - } - } - - if (err == Successful) - { - if (c->haveSaved) - { - if (c->savedName) - (void)AddFontNamesName(c->names, c->savedName, - c->savedNameLen); - } - else - (void)AddFontNamesName(c->names, name, namelen); - } - - /* - * When we get an alias back, save our state and reset back to - * the start of the FPE looking for the specified name. As - * soon as a real font is found for the alias, pop back to the - * old state - */ - else if (err == FontNameAlias) { - char tmp_pattern[XLFDMAXFONTNAMELEN]; - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - memmove(tmp_pattern, resolved, resolvedlen); - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - - tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, - &tmpname, &tmpnamelen, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - c->savedNameLen = namelen; - aliascount = 20; - } - memmove(c->current.pattern, tmp_pattern, resolvedlen); - c->current.patlen = resolvedlen; - c->current.max_names = c->names->nnames + 1; - c->current.current_fpe = -1; - c->current.private = 0; - err = BadFontName; - } - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've collected enough - * font names, quit. - */ - if (err == BadFontName) { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->names->nnames == c->current.max_names || - c->current.current_fpe == c->num_fpes) { - c->haveSaved = FALSE; - c->current = c->saved; - /* Give the saved namelist a chance to clean itself up */ - continue; - } - } - if (c->names->nnames == c->current.max_names) - break; - } - } - - /* - * send the reply - */ - if (err != Successful) { - SendErrorToClient(client, X_ListFonts, 0, 0, FontToXError(err)); - goto bail; - } - -finish: - - names = c->names; - nnames = names->nnames; - client = c->client; - stringLens = 0; - for (i = 0; i < nnames; i++) - stringLens += (names->length[i] <= 255) ? names->length[i] : 0; - - reply.type = X_Reply; - reply.length = (stringLens + nnames + 3) >> 2; - reply.nFonts = nnames; - reply.sequenceNumber = client->sequence; - - bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2); - - if (!bufptr && reply.length) { - SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); - goto bail; - } - /* - * since WriteToClient long word aligns things, copy to temp buffer and - * write all at once - */ - for (i = 0; i < nnames; i++) { - if (names->length[i] > 255) - reply.nFonts--; - else - { - *bufptr++ = names->length[i]; - memmove( bufptr, names->names[i], names->length[i]); - bufptr += names->length[i]; - } - } - nnames = reply.nFonts; - reply.length = (stringLens + nnames + 3) >> 2; - client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; - WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); - (void) WriteToClient(client, stringLens + nnames, bufferStart); - DEALLOCATE_LOCAL(bufferStart); - -bail: - if (c->slept) - ClientWakeup(client); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - FreeFontNames(names); - xfree(c); - if (resolved) xfree(resolved); - return TRUE; -} - -int -ListFonts(client, pattern, length, max_names) - ClientPtr client; - unsigned char *pattern; - unsigned int length; - unsigned int max_names; -{ - int i; - LFclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) - return BadAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c); - return BadAlloc; - } - c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100); - if (!c->names) - { - xfree(c->fpe_list); - xfree(c); - return BadAlloc; - } - memmove( c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsAndAliases(client, c); - return Success; -} - -int -doListFontsWithInfo(client, c) - ClientPtr client; - LFWIclosurePtr c; -{ - FontPathElementPtr fpe; - int err = Successful; - char *name; - int namelen; - int numFonts; - FontInfoRec fontInfo, - *pFontInfo; - xListFontsWithInfoReply *reply; - int length; - xFontProp *pFP; - int i; - int aliascount = 0; - xListFontsWithInfoReply finalReply; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo]; - if (!c->current.patlen) - goto finish; - while (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - if (!c->current.list_started) - { - err = (*fpe_functions[fpe->type].start_list_fonts_with_info) - (client, fpe, c->current.pattern, c->current.patlen, - c->current.max_names, &c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, (ClientSleepProcPtr)doListFontsWithInfo, c); - c->slept = TRUE; - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) - { - name = 0; - pFontInfo = &fontInfo; - err = (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &name, &namelen, &pFontInfo, - &numFonts, c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsWithInfo, - c); - c->slept = TRUE; - } - return TRUE; - } - } - /* - * When we get an alias back, save our state and reset back to the - * start of the FPE looking for the specified name. As soon as a real - * font is found for the alias, pop back to the old state - */ - if (err == FontNameAlias) - { - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - FontInfoPtr tmpFontInfo; - - tmpname = 0; - tmpFontInfo = &fontInfo; - (void) (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, - &numFonts, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - c->savedNumFonts = numFonts; - c->savedName = (char *) pFontInfo; - aliascount = 20; - } - memmove(c->current.pattern, name, namelen); - c->current.patlen = namelen; - c->current.max_names = 1; - c->current.current_fpe = 0; - c->current.private = 0; - c->current.list_started = FALSE; - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've sent enough font - * names, quit. Always wait for BadFontName to let the FPE - * have a chance to clean up. - */ - else if (err == BadFontName) - { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->current.max_names == 0 || - c->current.current_fpe == c->num_fpes) - { - c->haveSaved = FALSE; - c->saved.max_names -= (1 - c->current.max_names); - c->current = c->saved; - } - } - else if (c->current.max_names == 0) - break; - } - else if (err == Successful) - { - length = sizeof(*reply) + pFontInfo->nprops * sizeof(xFontProp); - reply = c->reply; - if (c->length < length) - { - reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length); - if (!reply) - { - err = AllocError; - break; - } - c->reply = reply; - c->length = length; - } - if (c->haveSaved) - { - numFonts = c->savedNumFonts; - name = c->savedName; - namelen = strlen(name); - } - reply->type = X_Reply; - reply->length = (sizeof *reply - sizeof(xGenericReply) + - pFontInfo->nprops * sizeof(xFontProp) + - namelen + 3) >> 2; - reply->sequenceNumber = client->sequence; - reply->nameLength = namelen; - reply->minBounds = pFontInfo->ink_minbounds; - reply->maxBounds = pFontInfo->ink_maxbounds; - reply->minCharOrByte2 = pFontInfo->firstCol; - reply->maxCharOrByte2 = pFontInfo->lastCol; - reply->defaultChar = pFontInfo->defaultCh; - reply->nFontProps = pFontInfo->nprops; - reply->drawDirection = pFontInfo->drawDirection; - reply->minByte1 = pFontInfo->firstRow; - reply->maxByte1 = pFontInfo->lastRow; - reply->allCharsExist = pFontInfo->allExist; - reply->fontAscent = pFontInfo->fontAscent; - reply->fontDescent = pFontInfo->fontDescent; - reply->nReplies = numFonts; - pFP = (xFontProp *) (reply + 1); - for (i = 0; i < pFontInfo->nprops; i++) - { - pFP->name = pFontInfo->props[i].name; - pFP->value = pFontInfo->props[i].value; - pFP++; - } - WriteSwappedDataToClient(client, length, reply); - (void) WriteToClient(client, namelen, name); - if (pFontInfo == &fontInfo) - { - xfree(fontInfo.props); - xfree(fontInfo.isStringProp); - } - --c->current.max_names; - } - } -finish: - length = sizeof(xListFontsWithInfoReply); - bzero((char *) &finalReply, sizeof(xListFontsWithInfoReply)); - finalReply.type = X_Reply; - finalReply.sequenceNumber = client->sequence; - finalReply.length = (sizeof(xListFontsWithInfoReply) - - sizeof(xGenericReply)) >> 2; - WriteSwappedDataToClient(client, length, &finalReply); -bail: - if (c->slept) - ClientWakeup(client); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->reply); - xfree(c->fpe_list); - xfree(c); - return TRUE; -} - -int -StartListFontsWithInfo(client, length, pattern, max_names) - ClientPtr client; - int length; - unsigned char *pattern; - int max_names; -{ - int i; - LFWIclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFWIclosurePtr) xalloc(sizeof *c))) - goto badAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) - { - xfree(c); - goto badAlloc; - } - memmove(c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) - { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->reply = 0; - c->length = 0; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->savedNumFonts = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - doListFontsWithInfo(client, c); - return Success; -badAlloc: - return BadAlloc; -} - -#define TextEltHeader 2 -#define FontShiftSize 5 -static XID clearGC[] = { CT_NONE }; -#define clearGCmask (GCClipMask) - -int -doPolyText(client, c) - ClientPtr client; - register PTclosurePtr c; -{ - register FontPtr pFont = c->pGC->font, oldpFont; - Font fid, oldfid; - int err = Success, lgerr; /* err is in X error, not font error, space */ - enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; - FontPathElementPtr fpe; - GC *origGC = NULL; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - - if (c->slept) - { - /* Client has died, but we cannot bail out right now. We - need to clean up after the work we did when going to - sleep. Setting the drawable pointer to 0 makes this - happen without any attempts to render or perform other - unnecessary activities. */ - c->pDraw = (DrawablePtr)0; - } - else - { - err = Success; - goto bail; - } - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client and avoid further - rendering while we clean up after ourself. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - c->pDraw = (DrawablePtr)0; - } - - client_state = c->slept ? SLEEPING : NEVER_SLEPT; - - while (c->endReq - c->pElt > TextEltHeader) - { - if (*c->pElt == FontChange) - { - if (c->endReq - c->pElt < FontShiftSize) - { - err = BadLength; - goto bail; - } - - oldpFont = pFont; - oldfid = fid; - - fid = ((Font)*(c->pElt+4)) /* big-endian */ - | ((Font)*(c->pElt+3)) << 8 - | ((Font)*(c->pElt+2)) << 16 - | ((Font)*(c->pElt+1)) << 24; - pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - client->errorValue = fid; - err = BadFont; - /* restore pFont and fid for step 4 (described below) */ - pFont = oldpFont; - fid = oldfid; - - /* If we're in START_SLEEP mode, the following step - shortens the request... in the unlikely event that - the fid somehow becomes valid before we come through - again to actually execute the polytext, which would - then mess up our refcounting scheme badly. */ - c->err = err; - c->endReq = c->pElt; - - goto bail; - } - - /* Step 3 (described below) on our new font */ - if (client_state == START_SLEEP) - pFont->refcnt++; - else - { - if (pFont != c->pGC->font && c->pDraw) - { - ChangeGC( c->pGC, GCFont, &fid); - ValidateGC(c->pDraw, c->pGC); - if (c->reqType == X_PolyText8) - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8; - else - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText16; - } - - /* Undo the refcnt++ we performed when going to sleep */ - if (client_state == SLEEPING) - (void)CloseFont(c->pGC->font, (Font)0); - } - c->pElt += FontShiftSize; - } - else /* print a string */ - { - unsigned char *pNextElt; - pNextElt = c->pElt + TextEltHeader + (*c->pElt)*c->itemSize; - if ( pNextElt > c->endReq) - { - err = BadLength; - goto bail; - } - if (client_state == START_SLEEP) - { - c->pElt = pNextElt; - continue; - } - if (c->pDraw) - { - lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, c->itemSize, - c->pElt + TextEltHeader); - } - else lgerr = Successful; - - if (lgerr == Suspended) - { - if (!c->slept) { - int len; - GC *pGC; - PTclosurePtr new_closure; - - /* We're putting the client to sleep. We need to do a few things - to ensure successful and atomic-appearing execution of the - remainder of the request. First, copy the remainder of the - request into a safe malloc'd area. Second, create a scratch GC - to use for the remainder of the request. Third, mark all fonts - referenced in the remainder of the request to prevent their - deallocation. Fourth, make the original GC look like the - request has completed... set its font to the final font value - from this request. These GC manipulations are for the unlikely - (but possible) event that some other client is using the GC. - Steps 3 and 4 are performed by running this procedure through - the remainder of the request in a special no-render mode - indicated by client_state = START_SLEEP. */ - - /* Step 1 */ - /* Allocate a malloc'd closure structure to replace - the local one we were passed */ - new_closure = (PTclosurePtr) xalloc(sizeof(PTclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - len = c->endReq - c->pElt; - c->data = (unsigned char *)xalloc(len); - if (!c->data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(c->data, c->pElt, len); - c->pElt = c->data; - c->endReq = c->pElt + len; - - /* Step 2 */ - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - if ((err = CopyGC(c->pGC, pGC, GCFunction | - GCPlaneMask | GCForeground | - GCBackground | GCFillStyle | - GCTile | GCStipple | - GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != - Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - origGC = c->pGC; - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doPolyText, - (pointer) c); - - /* Set up to perform steps 3 and 4 */ - client_state = START_SLEEP; - continue; /* on to steps 3 and 4 */ - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */ - c->xorg = (* c->polyText)(c->pDraw, c->pGC, c->xorg, c->yorg, - *c->pElt, c->pElt + TextEltHeader); - } - c->pElt = pNextElt; - } - } - -bail: - - if (client_state == START_SLEEP) - { - /* Step 4 */ - if (pFont != origGC->font) - { - ChangeGC(origGC, GCFont, &fid); - ValidateGC(c->pDraw, origGC); - } - - /* restore pElt pointer for execution of remainder of the request */ - c->pElt = c->data; - return TRUE; - } - - if (c->err != Success) err = c->err; - if (err != Success && c->client != serverClient) { -#ifdef PANORAMIX - if (noPanoramiXExtension || !c->pGC->pScreen->myNum) -#endif - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -PolyText(client, pDraw, pGC, pElt, endReq, xorg, yorg, reqType, did) - ClientPtr client; - DrawablePtr pDraw; - GC *pGC; - unsigned char *pElt; - unsigned char *endReq; - int xorg; - int yorg; - int reqType; - XID did; -{ - PTclosureRec local_closure; - - local_closure.pElt = pElt; - local_closure.endReq = endReq; - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_PolyText8) - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText8; - local_closure.itemSize = 1; - } - else - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText16; - local_closure.itemSize = 2; - } - local_closure.pGC = pGC; - local_closure.did = did; - local_closure.err = Success; - local_closure.slept = FALSE; - - (void) doPolyText(client, &local_closure); - return Success; -} - - -#undef TextEltHeader -#undef FontShiftSize - -int -doImageText(client, c) - ClientPtr client; - register ITclosurePtr c; -{ - int err = Success, lgerr; /* err is in X error, not font error, space */ - FontPathElementPtr fpe; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, c->itemSize, c->data); - if (lgerr == Suspended) - { - if (!c->slept) { - GC *pGC; - unsigned char *data; - ITclosurePtr new_closure; - - /* We're putting the client to sleep. We need to - save some state. Similar problem to that handled - in doPolyText, but much simpler because the - request structure is much simpler. */ - - new_closure = (ITclosurePtr) xalloc(sizeof(ITclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - data = (unsigned char *)xalloc(c->nChars * c->itemSize); - if (!data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(data, c->data, c->nChars * c->itemSize); - c->data = data; - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - if ((err = CopyGC(c->pGC, pGC, GCFunction | GCPlaneMask | - GCForeground | GCBackground | GCFillStyle | - GCTile | GCStipple | GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doImageText, (pointer) c); - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - (* c->imageText)(c->pDraw, c->pGC, c->xorg, c->yorg, - c->nChars, c->data); - } - -bail: - - if (err != Success && c->client != serverClient) { - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -ImageText(client, pDraw, pGC, nChars, data, xorg, yorg, reqType, did) - ClientPtr client; - DrawablePtr pDraw; - GC *pGC; - int nChars; - unsigned char *data; - int xorg; - int yorg; - int reqType; - XID did; -{ - ITclosureRec local_closure; - - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.pGC = pGC; - local_closure.nChars = nChars; - local_closure.data = data; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_ImageText8) - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText8; - local_closure.itemSize = 1; - } - else - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText16; - local_closure.itemSize = 2; - } - local_closure.did = did; - local_closure.slept = FALSE; - - (void) doImageText(client, &local_closure); - return Success; -} - - -/* does the necessary magic to figure out the fpe type */ -static int -#if NeedFunctionPrototypes -DetermineFPEType(char *pathname) -#else -DetermineFPEType(pathname) - char *pathname; -#endif -{ - int i; - - for (i = 0; i < num_fpe_types; i++) { - if ((*fpe_functions[i].name_check) (pathname)) - return i; - } - return -1; -} - - -static void -#if NeedFunctionPrototypes -FreeFontPath(FontPathElementPtr *list, int n, Bool force) -#else -FreeFontPath(list, n, force) - FontPathElementPtr *list; - Bool force; - int n; -#endif -{ - int i; - - for (i = 0; i < n; i++) { - if (force) { - /* Sanity check that all refcounts will be 0 by the time - we get to the end of the list. */ - int found = 1; /* the first reference is us */ - int j; - for (j = i+1; j < n; j++) { - if (list[j] == list[i]) - found++; - } - if (list[i]->refcount != found) { - ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n", - list[i]->name_length, list[i]->name, - list[i]->refcount, found); - list[i]->refcount = found; /* ensure it will get freed */ - } - } - FreeFPE(list[i]); - } - xfree((char *) list); -} - -static FontPathElementPtr -#if NeedFunctionPrototypes -find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len) -#else -find_existing_fpe(list, num, name, len) - FontPathElementPtr *list; - int num; - unsigned char *name; - int len; -#endif -{ - FontPathElementPtr fpe; - int i; - - for (i = 0; i < num; i++) { - fpe = list[i]; - if (fpe->name_length == len && memcmp(name, fpe->name, len) == 0) - return fpe; - } - return (FontPathElementPtr) 0; -} - - -static int -#if NeedFunctionPrototypes -SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) -#else -SetFontPathElements(npaths, paths, bad, persist) - int npaths; - unsigned char *paths; - int *bad; - Bool persist; -#endif -{ - int i, err = 0; - int valid_paths = 0; - unsigned int len; - unsigned char *cp = paths; - FontPathElementPtr fpe = NULL, *fplist; - - fplist = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * npaths); - if (!fplist) { - *bad = 0; - return BadAlloc; - } - for (i = 0; i < num_fpe_types; i++) { - if (fpe_functions[i].set_path_hook) - (*fpe_functions[i].set_path_hook) (); - } - for (i = 0; i < npaths; i++) - { - len = (unsigned int) (*cp++); - - if (len == 0) - { - if (persist) - ErrorF ("Removing empty element from the valid list of fontpaths\n"); - err = BadValue; - } - else - { - /* if it's already in our active list, just reset it */ - /* - * note that this can miss FPE's in limbo -- may be worth catching - * them, though it'd muck up refcounting - */ - fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); - if (fpe) - { - err = (*fpe_functions[fpe->type].reset_fpe) (fpe); - if (err == Successful) - { - UseFPE(fpe);/* since it'll be decref'd later when freed - * from the old list */ - } - else - fpe = 0; - } - /* if error or can't do it, act like it's a new one */ - if (!fpe) - { - fpe = (FontPathElementPtr) xalloc(sizeof(FontPathElementRec)); - if (!fpe) - { - err = BadAlloc; - goto bail; - } - fpe->name = (char *) xalloc(len + 1); - if (!fpe->name) - { - xfree(fpe); - err = BadAlloc; - goto bail; - } - fpe->refcount = 1; - - strncpy(fpe->name, (char *) cp, (int) len); - fpe->name[len] = '\0'; - fpe->name_length = len; - fpe->type = DetermineFPEType(fpe->name); - if (fpe->type == -1) - err = BadValue; - else - err = (*fpe_functions[fpe->type].init_fpe) (fpe); - if (err != Successful) - { - if (persist) - { - ErrorF("Could not init font path element %s, removing from list!\n", - fpe->name); - } - xfree (fpe->name); - xfree (fpe); - } - } - } - if (err != Successful) - { - if (!persist) - goto bail; - } - else - { - fplist[valid_paths++] = fpe; - } - cp += len; - } - - FreeFontPath(font_path_elements, num_fpes, FALSE); - font_path_elements = fplist; - if (patternCache) - EmptyFontPatternCache(patternCache); - num_fpes = valid_paths; - - return Success; -bail: - *bad = i; - while (--valid_paths >= 0) - FreeFPE(fplist[valid_paths]); - xfree(fplist); - return FontToXError(err); -} - -/* XXX -- do we need to pass error down to each renderer? */ -int -SetFontPath(client, npaths, paths, error) - ClientPtr client; - int npaths; - unsigned char *paths; - int *error; -{ - int err = Success; - - if (npaths == 0) { - if (SetDefaultFontPath(defaultFontPath) != Success) - return BadValue; - } else { - err = SetFontPathElements(npaths, paths, error, FALSE); - } - return err; -} - -int -SetDefaultFontPath(path) - char *path; -{ - unsigned char *cp, - *pp, - *nump, - *newpath; - int num = 1, - len, - err, - size = 0, - bad; - - /* get enough for string, plus values -- use up commas */ - len = strlen(path) + 1; - nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); - if (!newpath) - return BadAlloc; - pp = (unsigned char *) path; - cp++; - while (*pp) { - if (*pp == ',') { - *nump = (unsigned char) size; - nump = cp++; - pp++; - num++; - size = 0; - } else { - *cp++ = *pp++; - size++; - } - } - *nump = (unsigned char) size; - - err = SetFontPathElements(num, newpath, &bad, TRUE); - - DEALLOCATE_LOCAL(newpath); - - return err; -} - -unsigned char * -GetFontPath(count, length) - int *count; - int *length; -{ - int i; - unsigned char *c; - int len; - FontPathElementPtr fpe; - - len = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - len += fpe->name_length + 1; - } - font_path_string = (unsigned char *) xrealloc(font_path_string, len); - if (!font_path_string) - return NULL; - - c = font_path_string; - *length = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - *c = fpe->name_length; - *length += *c++; - memmove(c, fpe->name, fpe->name_length); - c += fpe->name_length; - } - *count = num_fpes; - return font_path_string; -} - -int -LoadGlyphs(client, pfont, nchars, item_size, data) - ClientPtr client; - FontPtr pfont; - unsigned nchars; - int item_size; - unsigned char *data; -{ - if (fpe_functions[pfont->fpe->type].load_glyphs) - return (*fpe_functions[pfont->fpe->type].load_glyphs) - (client, pfont, 0, nchars, item_size, data); - else - return Successful; -} - -void -DeleteClientFontStuff(client) - ClientPtr client; -{ - int i; - FontPathElementPtr fpe; - - for (i = 0; i < num_fpes; i++) - { - fpe = font_path_elements[i]; - if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } -} - -void -InitFonts () -{ - patternCache = MakeFontPatternCache(); - -#ifndef KDRIVESERVER - if (screenInfo.numScreens > screenInfo.numVideoScreens) { - PrinterFontRegisterFpeFunctions(); - FontFileCheckRegisterFpeFunctions(); - check_fs_register_fpe_functions(); - } else -#endif - { -#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); -#endif - FontFileRegisterFpeFunctions(); -#ifndef NOFONTSERVERACCESS - fs_register_fpe_functions(); -#endif - } -} - -int -GetDefaultPointSize () -{ - return 120; -} - - -FontResolutionPtr -GetClientResolutions (num) - int *num; -{ - if (requestingClient && requestingClient->fontResFunc != NULL && - !requestingClient->clientGone) - { - return (*requestingClient->fontResFunc)(requestingClient, num); - } - else { - static struct _FontResolution res; - ScreenPtr pScreen; - - pScreen = screenInfo.screens[0]; - res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; - /* - * XXX - we'll want this as long as bitmap instances are prevalent - so that we can match them from scalable fonts - */ - if (res.x_resolution < 88) - res.x_resolution = 75; - else - res.x_resolution = 100; - res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight; - if (res.y_resolution < 88) - res.y_resolution = 75; - else - res.y_resolution = 100; - res.point_size = 120; - *num = 1; - return &res; - } -} - -/* - * returns the type index of the new fpe - * - * should be called (only once!) by each type of fpe when initialized - */ - -int -RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func) -{ - FPEFunctions *new; - - /* grow the list */ - new = (FPEFunctions *) xrealloc(fpe_functions, - (num_fpe_types + 1) * sizeof(FPEFunctions)); - if (!new) - return -1; - fpe_functions = new; - - fpe_functions[num_fpe_types].name_check = name_func; - fpe_functions[num_fpe_types].open_font = open_func; - fpe_functions[num_fpe_types].close_font = close_func; - fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func; - fpe_functions[num_fpe_types].list_fonts = list_func; - fpe_functions[num_fpe_types].start_list_fonts_with_info = - start_lfwi_func; - fpe_functions[num_fpe_types].list_next_font_with_info = - next_lfwi_func; - fpe_functions[num_fpe_types].init_fpe = init_func; - fpe_functions[num_fpe_types].free_fpe = free_func; - fpe_functions[num_fpe_types].reset_fpe = reset_func; - fpe_functions[num_fpe_types].client_died = client_died; - fpe_functions[num_fpe_types].load_glyphs = load_glyphs; - fpe_functions[num_fpe_types].start_list_fonts_and_aliases = - start_list_alias_func; - fpe_functions[num_fpe_types].list_next_font_or_alias = - next_list_alias_func; - fpe_functions[num_fpe_types].set_path_hook = set_path_func; - - return num_fpe_types++; -} - -void -FreeFonts() -{ - if (patternCache) { - FreeFontPatternCache(patternCache); - patternCache = 0; - } - FreeFontPath(font_path_elements, num_fpes, TRUE); - font_path_elements = 0; - num_fpes = 0; - xfree(fpe_functions); - num_fpe_types = 0; - fpe_functions = (FPEFunctions *) 0; -} - -/* convenience functions for FS interface */ - -FontPtr -find_old_font(id) - XID id; -{ - return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, - SecurityUnknownAccess); -} - -Font -GetNewFontClientID() -{ - return FakeClientID(0); -} - -int -StoreFontClientFont(pfont, id) - FontPtr pfont; - Font id; -{ - return AddResource(id, RT_NONE, (pointer) pfont); -} - -void -DeleteFontClientID(id) - Font id; -{ - FreeResource(id, RT_NONE); -} - -int -client_auth_generation(client) - ClientPtr client; -{ - return 0; -} - -static int fs_handlers_installed = 0; -static unsigned int last_server_gen; - -int -init_fs_handlers(fpe, block_handler) - FontPathElementPtr fpe; - BlockHandlerProcPtr block_handler; -{ - /* if server has reset, make sure the b&w handlers are reinstalled */ - if (last_server_gen < serverGeneration) { - last_server_gen = serverGeneration; - fs_handlers_installed = 0; - } - if (fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "adding FS b & w handlers\n"); -#endif - - if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (pointer) 0)) - return AllocError; - fs_handlers_installed++; - } - QueueFontWakeup(fpe); - return Successful; -} - -void -remove_fs_handlers(fpe, block_handler, all) - FontPathElementPtr fpe; - BlockHandlerProcPtr block_handler; - Bool all; -{ - if (all) { - /* remove the handlers if no one else is using them */ - if (--fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "removing FS b & w handlers\n"); -#endif - - RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (pointer) 0); - } - } - RemoveFontWakeup(fpe); -} - -#ifdef DEBUG -#define GLWIDTHBYTESPADDED(bits,nbytes) \ - ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \ - :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \ - :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \ - :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \ - : 0) - -#define GLYPH_SIZE(ch, nbytes) \ - GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \ - (ch)->metrics.leftSideBearing, (nbytes)) -dump_char_ascii(cip) - CharInfoPtr cip; -{ - int r, - l; - int bpr; - int byte; - static unsigned maskTab[] = { - (1 << 7), (1 << 6), (1 << 5), (1 << 4), - (1 << 3), (1 << 2), (1 << 1), (1 << 0), - }; - - bpr = GLYPH_SIZE(cip, 4); - for (r = 0; r < (cip->metrics.ascent + cip->metrics.descent); r++) { - pointer row = (pointer) cip->bits + r * bpr; - - byte = 0; - for (l = 0; l <= (cip->metrics.rightSideBearing - - cip->metrics.leftSideBearing); l++) { - if (maskTab[l & 7] & row[l >> 3]) - putchar('X'); - else - putchar('.'); - } - putchar('\n'); - } -} - -#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original deleted file mode 100644 index f697cf3ca..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original +++ /dev/null @@ -1,4797 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXevents.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.46 2002/09/17 01:15:09 dawes Exp $ */ -/************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* The panoramix components contained the following notice */ -/**************************************************************** -* * -* Copyright (c) Digital Equipment Corporation, 1991, 1997 * -* * -* All Rights Reserved. Unpublished rights reserved under * -* the copyright laws of the United States. * -* * -* The software contained on this media is proprietary to * -* and embodies the confidential technology of Digital * -* Equipment Corporation. Possession, use, duplication or * -* dissemination of the software and media is authorized only * -* pursuant to a valid written license from Digital Equipment * -* Corporation. * -* * -* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure * -* by the U.S. Government is subject to restrictions as set * -* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, * -* or in FAR 52.227-19, as applicable. * -* * -*****************************************************************/ - -/* $Xorg: events.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" -#include "Xlib.h" -#include "misc.h" -#include "resource.h" -#define NEED_EVENTS -#define NEED_REPLIES -#include "Xproto.h" -#include "windowstr.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "cursorstr.h" - -#include "dixstruct.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include "globals.h" - -#ifdef XKB -#include "XKBsrv.h" -#if NeedFunctionPrototypes -extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); -#else -extern Bool XkbFilterEvents(); -#endif -#endif - -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif - -#include "XIproto.h" -#include "exevents.h" -#include "extnsionst.h" - -#include "dixevents.h" -#include "dixgrabs.h" -#include "../../dix/dispatch.h" - -#include "NXlib.h" - -#include "Events.h" -#include "Windows.h" - -extern Display *nxagentDisplay; - -extern WindowPtr nxagentLastEnteredWindow; - -#define EXTENSION_EVENT_BASE 64 - -#define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */ -#define StructureAndSubMask ( StructureNotifyMask | SubstructureNotifyMask ) -#define AllButtonsMask ( \ - Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask ) -#define MotionMask ( \ - PointerMotionMask | Button1MotionMask | \ - Button2MotionMask | Button3MotionMask | Button4MotionMask | \ - Button5MotionMask | ButtonMotionMask ) -#define PropagateMask ( \ - KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \ - MotionMask ) -#define PointerGrabMask ( \ - ButtonPressMask | ButtonReleaseMask | \ - EnterWindowMask | LeaveWindowMask | \ - PointerMotionHintMask | KeymapStateMask | \ - MotionMask ) -#define AllModifiersMask ( \ - ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ - Mod3Mask | Mod4Mask | Mod5Mask ) -#define AllEventMasks (lastEventMask|(lastEventMask-1)) -/* - * The following relies on the fact that the ButtonMotionMasks are equal - * to the corresponding ButtonMasks from the current modifier/button state. - */ -#define Motion_Filter(class) (PointerMotionMask | \ - (class)->state | (class)->motionMask) - - -#define WID(w) ((w) ? ((w)->drawable.id) : 0) - -#define XE_KBPTR (xE->u.keyButtonPointer) - - -#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) - -CallbackListPtr EventCallback; -CallbackListPtr DeviceEventCallback; - -#define DNPMCOUNT 8 - -Mask DontPropagateMasks[DNPMCOUNT]; -static int DontPropagateRefCnts[DNPMCOUNT]; - -#ifdef DEBUG -static debug_events = 0; -#endif -InputInfo inputInfo; - -static struct { - QdEventPtr pending, *pendtail; - DeviceIntPtr replayDev; /* kludgy rock to put flag for */ - WindowPtr replayWin; /* ComputeFreezes */ - Bool playingEvents; - TimeStamp time; -} syncEvents; - -/* - * The window trace information is used to avoid having to compute all the - * windows between the root and the current pointer window each time a button - * or key goes down. The grabs on each of those windows must be checked. - */ -static WindowPtr *spriteTrace = (WindowPtr *)NULL; -#define ROOT spriteTrace[0] -static int spriteTraceSize = 0; -static int spriteTraceGood; - -typedef struct { - int x, y; - ScreenPtr pScreen; -} HotSpot; - -static struct { - CursorPtr current; - BoxRec hotLimits; /* logical constraints of hot spot */ - Bool confined; /* confined to screen */ -#if defined(SHAPE) || defined(PANORAMIX) - RegionPtr hotShape; /* additional logical shape constraint */ -#endif - BoxRec physLimits; /* physical constraints of hot spot */ - WindowPtr win; /* window of logical position */ - HotSpot hot; /* logical pointer position */ - HotSpot hotPhys; /* physical pointer position */ -#ifdef PANORAMIX - ScreenPtr screen; /* all others are in Screen 0 coordinates */ - RegionRec Reg1; /* Region 1 for confining motion */ - RegionRec Reg2; /* Region 2 for confining virtual motion */ - WindowPtr windows[MAXSCREENS]; - WindowPtr confineWin; /* confine window */ -#endif -} sprite; /* info about the cursor sprite */ - -static void DoEnterLeaveEvents( -#if NeedFunctionPrototypes - WindowPtr /*fromWin*/, - WindowPtr /*toWin*/, - int /*mode*/ -#endif -); - -static WindowPtr XYToWindow( -#if NeedFunctionPrototypes - int /*x*/, - int /*y*/ -#endif -); - -extern int lastEvent; - -static Mask lastEventMask; - -#ifdef XINPUT -extern int DeviceMotionNotify; -#endif - -#define CantBeFiltered NoEventMask -static Mask filters[128] = -{ - NoSuchEvent, /* 0 */ - NoSuchEvent, /* 1 */ - KeyPressMask, /* KeyPress */ - KeyReleaseMask, /* KeyRelease */ - ButtonPressMask, /* ButtonPress */ - ButtonReleaseMask, /* ButtonRelease */ - PointerMotionMask, /* MotionNotify (initial state) */ - EnterWindowMask, /* EnterNotify */ - LeaveWindowMask, /* LeaveNotify */ - FocusChangeMask, /* FocusIn */ - FocusChangeMask, /* FocusOut */ - KeymapStateMask, /* KeymapNotify */ - ExposureMask, /* Expose */ - CantBeFiltered, /* GraphicsExpose */ - CantBeFiltered, /* NoExpose */ - VisibilityChangeMask, /* VisibilityNotify */ - SubstructureNotifyMask, /* CreateNotify */ - StructureAndSubMask, /* DestroyNotify */ - StructureAndSubMask, /* UnmapNotify */ - StructureAndSubMask, /* MapNotify */ - SubstructureRedirectMask, /* MapRequest */ - StructureAndSubMask, /* ReparentNotify */ - StructureAndSubMask, /* ConfigureNotify */ - SubstructureRedirectMask, /* ConfigureRequest */ - StructureAndSubMask, /* GravityNotify */ - ResizeRedirectMask, /* ResizeRequest */ - StructureAndSubMask, /* CirculateNotify */ - SubstructureRedirectMask, /* CirculateRequest */ - PropertyChangeMask, /* PropertyNotify */ - CantBeFiltered, /* SelectionClear */ - CantBeFiltered, /* SelectionRequest */ - CantBeFiltered, /* SelectionNotify */ - ColormapChangeMask, /* ColormapNotify */ - CantBeFiltered, /* ClientMessage */ - CantBeFiltered /* MappingNotify */ -}; - -static CARD8 criticalEvents[32] = -{ - 0x7c /* key and button events */ -}; - -#ifdef PANORAMIX - -static void ConfineToShape(RegionPtr shape, int *px, int *py); -static void SyntheticMotion(int x, int y); -static void PostNewCursor(void); - -static Bool -XineramaSetCursorPosition( - int x, - int y, - Bool generateEvent -){ - ScreenPtr pScreen; - BoxRec box; - int i; - - /* x,y are in Screen 0 coordinates. We need to decide what Screen - to send the message too and what the coordinates relative to - that screen are. */ - - pScreen = sprite.screen; - x += panoramiXdataPtr[0].x; - y += panoramiXdataPtr[0].y; - - if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], - x, y, &box)) - { - FOR_NSCREENS(i) - { - if(i == pScreen->myNum) - continue; - if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box)) - { - pScreen = screenInfo.screens[i]; - break; - } - } - } - - sprite.screen = pScreen; - sprite.hotPhys.x = x - panoramiXdataPtr[0].x; - sprite.hotPhys.y = y - panoramiXdataPtr[0].y; - x -= panoramiXdataPtr[pScreen->myNum].x; - y -= panoramiXdataPtr[pScreen->myNum].y; - - return (*pScreen->SetCursorPosition)(pScreen, x, y, generateEvent); -} - - -static void -XineramaConstrainCursor(void) -{ - ScreenPtr pScreen = sprite.screen; - BoxRec newBox = sprite.physLimits; - - /* Translate the constraining box to the screen - the sprite is actually on */ - newBox.x1 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; - newBox.x2 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; - newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; - newBox.y2 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; - - (* pScreen->ConstrainCursor)(pScreen, &newBox); -} - -static void -XineramaCheckPhysLimits( - CursorPtr cursor, - Bool generateEvents -){ - HotSpot new; - - if (!cursor) - return; - - new = sprite.hotPhys; - - /* I don't care what the DDX has to say about it */ - sprite.physLimits = sprite.hotLimits; - - /* constrain the pointer to those limits */ - if (new.x < sprite.physLimits.x1) - new.x = sprite.physLimits.x1; - else - if (new.x >= sprite.physLimits.x2) - new.x = sprite.physLimits.x2 - 1; - if (new.y < sprite.physLimits.y1) - new.y = sprite.physLimits.y1; - else - if (new.y >= sprite.physLimits.y2) - new.y = sprite.physLimits.y2 - 1; - - if (sprite.hotShape) /* more work if the shape is a mess */ - ConfineToShape(sprite.hotShape, &new.x, &new.y); - - if((new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y)) - { - XineramaSetCursorPosition (new.x, new.y, generateEvents); - if (!generateEvents) - SyntheticMotion(new.x, new.y); - } - - /* Tell DDX what the limits are */ - XineramaConstrainCursor(); -} - - -static Bool -XineramaSetWindowPntrs(WindowPtr pWin) -{ - if(pWin == WindowTable[0]) { - memcpy(sprite.windows, WindowTable, - PanoramiXNumScreens*sizeof(WindowPtr)); - } else { - PanoramiXRes *win; - int i; - - win = (PanoramiXRes*)LookupIDByType(pWin->drawable.id, XRT_WINDOW); - - if(!win) - return FALSE; - - for(i = 0; i < PanoramiXNumScreens; i++) { - sprite.windows[i] = LookupIDByType(win->info[i].id, RT_WINDOW); - if(!sprite.windows[i]) /* window is being unmapped */ - return FALSE; - } - } - return TRUE; -} - -static void -XineramaCheckVirtualMotion( - QdEventPtr qe, - WindowPtr pWin -){ - - if (qe) - { - sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */ - sprite.hot.x = qe->event->u.keyButtonPointer.rootX; - sprite.hot.y = qe->event->u.keyButtonPointer.rootY; - pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo : - NullWindow; - } - if (pWin) - { - int x, y, off_x, off_y, i; - BoxRec lims; - - if(!XineramaSetWindowPntrs(pWin)) - return; - - i = PanoramiXNumScreens - 1; - - REGION_COPY(sprite.screen, &sprite.Reg2, - &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - - while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; - - if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y); - - REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2, - &sprite.windows[i]->borderSize); - - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - } - - lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2); - - if (sprite.hot.x < lims.x1) - sprite.hot.x = lims.x1; - else if (sprite.hot.x >= lims.x2) - sprite.hot.x = lims.x2 - 1; - if (sprite.hot.y < lims.y1) - sprite.hot.y = lims.y1; - else if (sprite.hot.y >= lims.y2) - sprite.hot.y = lims.y2 - 1; - - if (REGION_NUM_RECTS(&sprite.Reg2) > 1) - ConfineToShape(&sprite.Reg2, &sprite.hot.x, &sprite.hot.y); - - if (qe) - { - qe->pScreen = sprite.hot.pScreen; - qe->event->u.keyButtonPointer.rootX = sprite.hot.x; - qe->event->u.keyButtonPointer.rootY = sprite.hot.y; - } - } -} - - -static Bool -XineramaCheckMotion(xEvent *xE) -{ - WindowPtr prevSpriteWin = sprite.win; - - if (xE && !syncEvents.playingEvents) - { - /* Motion events entering DIX get translated to Screen 0 - coordinates. Replayed events have already been - translated since they've entered DIX before */ - XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x - - panoramiXdataPtr[0].x; - XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y - - panoramiXdataPtr[0].y; - - sprite.hot.x = XE_KBPTR.rootX; - sprite.hot.y = XE_KBPTR.rootY; - if (sprite.hot.x < sprite.physLimits.x1) - sprite.hot.x = sprite.physLimits.x1; - else if (sprite.hot.x >= sprite.physLimits.x2) - sprite.hot.x = sprite.physLimits.x2 - 1; - if (sprite.hot.y < sprite.physLimits.y1) - sprite.hot.y = sprite.physLimits.y1; - else if (sprite.hot.y >= sprite.physLimits.y2) - sprite.hot.y = sprite.physLimits.y2 - 1; - - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); - - sprite.hotPhys = sprite.hot; - if ((sprite.hotPhys.x != XE_KBPTR.rootX) || - (sprite.hotPhys.y != XE_KBPTR.rootY)) - { - XineramaSetCursorPosition( - sprite.hotPhys.x, sprite.hotPhys.y, FALSE); - } - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - } - - sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); - - if (sprite.win != prevSpriteWin) - { - if (prevSpriteWin != NullWindow) { - if (!xE) - UpdateCurrentTimeIf(); - DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); - } - PostNewCursor(); - return FALSE; - } - return TRUE; -} - - -static void -XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents) -{ - - if (syncEvents.playingEvents) - { - XineramaCheckVirtualMotion((QdEventPtr)NULL, pWin); - SyntheticMotion(sprite.hot.x, sprite.hot.y); - } - else - { - int x, y, off_x, off_y, i; - - if(!XineramaSetWindowPntrs(pWin)) - return; - - i = PanoramiXNumScreens - 1; - - REGION_COPY(sprite.screen, &sprite.Reg1, - &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - - while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; - - if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y); - - REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1, - &sprite.windows[i]->borderSize); - - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - } - - sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1); - - if(REGION_NUM_RECTS(&sprite.Reg1) > 1) - sprite.hotShape = &sprite.Reg1; - else - sprite.hotShape = NullRegion; - - sprite.confined = FALSE; - sprite.confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin; - - XineramaCheckPhysLimits(sprite.current, generateEvents); - } -} - - -static void -XineramaChangeToCursor(CursorPtr cursor) -{ - if (cursor != sprite.current) - { - if ((sprite.current->bits->xhot != cursor->bits->xhot) || - (sprite.current->bits->yhot != cursor->bits->yhot)) - XineramaCheckPhysLimits(cursor, FALSE); - (*sprite.screen->DisplayCursor)(sprite.screen, cursor); - sprite.current = cursor; - } -} - - -#endif /* PANORAMIX */ - -void -SetMaskForEvent(mask, event) - Mask mask; - int event; -{ - if ((event < LASTEvent) || (event >= 128)) - FatalError("SetMaskForEvent: bogus event number"); - filters[event] = mask; -} - -void -SetCriticalEvent(event) - int event; -{ - if (event >= 128) - FatalError("SetCriticalEvent: bogus event number"); - criticalEvents[event >> 3] |= 1 << (event & 7); -} - -static void -#if NeedFunctionPrototypes -SyntheticMotion(int x, int y) -#else -SyntheticMotion(x, y) - int x, y; -#endif -{ - xEvent xE; - -#ifdef PANORAMIX - /* Translate back to the sprite screen since processInputProc - will translate from sprite screen to screen 0 upon reentry - to the DIX layer */ - if(!noPanoramiXExtension) { - x += panoramiXdataPtr[0].x - panoramiXdataPtr[sprite.screen->myNum].x; - y += panoramiXdataPtr[0].y - panoramiXdataPtr[sprite.screen->myNum].y; - } -#endif - xE.u.keyButtonPointer.rootX = x; - xE.u.keyButtonPointer.rootY = y; - if (syncEvents.playingEvents) - xE.u.keyButtonPointer.time = syncEvents.time.milliseconds; - else - xE.u.keyButtonPointer.time = currentTime.milliseconds; - xE.u.u.type = MotionNotify; - (*inputInfo.pointer->public.processInputProc)(&xE, inputInfo.pointer, 1); -} - -#ifdef SHAPE -static void -#if NeedFunctionPrototypes -ConfineToShape(RegionPtr shape, int *px, int *py) -#else -ConfineToShape(shape, px, py) - RegionPtr shape; - int *px, *py; -#endif -{ - BoxRec box; - int x = *px, y = *py; - int incx = 1, incy = 1; - - if (POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)) - return; - box = *REGION_EXTENTS(sprite.hot.pScreen, shape); - /* this is rather crude */ - do { - x += incx; - if (x >= box.x2) - { - incx = -1; - x = *px - 1; - } - else if (x < box.x1) - { - incx = 1; - x = *px; - y += incy; - if (y >= box.y2) - { - incy = -1; - y = *py - 1; - } - else if (y < box.y1) - return; /* should never get here! */ - } - } while (!POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)); - *px = x; - *py = y; -} -#endif - -static void -#if NeedFunctionPrototypes -CheckPhysLimits( - CursorPtr cursor, - Bool generateEvents, - Bool confineToScreen, - ScreenPtr pScreen) -#else -CheckPhysLimits(cursor, generateEvents, confineToScreen, pScreen) - CursorPtr cursor; - Bool generateEvents; - Bool confineToScreen; - ScreenPtr pScreen; -#endif -{ - HotSpot new; - - if (!cursor) - return; - new = sprite.hotPhys; - if (pScreen) - new.pScreen = pScreen; - else - pScreen = new.pScreen; - (*pScreen->CursorLimits) (pScreen, cursor, &sprite.hotLimits, - &sprite.physLimits); - sprite.confined = confineToScreen; - (* pScreen->ConstrainCursor)(pScreen, &sprite.physLimits); - if (new.x < sprite.physLimits.x1) - new.x = sprite.physLimits.x1; - else - if (new.x >= sprite.physLimits.x2) - new.x = sprite.physLimits.x2 - 1; - if (new.y < sprite.physLimits.y1) - new.y = sprite.physLimits.y1; - else - if (new.y >= sprite.physLimits.y2) - new.y = sprite.physLimits.y2 - 1; -#ifdef SHAPE - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &new.x, &new.y); -#endif - if ((pScreen != sprite.hotPhys.pScreen) || - (new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y)) - { - if (pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys = new; - (*pScreen->SetCursorPosition) (pScreen, new.x, new.y, generateEvents); - if (!generateEvents) - SyntheticMotion(new.x, new.y); - } -} - -static void -#if NeedFunctionPrototypes -CheckVirtualMotion( - register QdEventPtr qe, - register WindowPtr pWin) -#else -CheckVirtualMotion(qe, pWin) - register QdEventPtr qe; - register WindowPtr pWin; -#endif -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaCheckVirtualMotion(qe, pWin); - return; - } -#endif - if (qe) - { - sprite.hot.pScreen = qe->pScreen; - sprite.hot.x = qe->event->u.keyButtonPointer.rootX; - sprite.hot.y = qe->event->u.keyButtonPointer.rootY; - pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo : - NullWindow; - } - if (pWin) - { - BoxRec lims; - - if (sprite.hot.pScreen != pWin->drawable.pScreen) - { - sprite.hot.pScreen = pWin->drawable.pScreen; - sprite.hot.x = sprite.hot.y = 0; - } - lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize); - if (sprite.hot.x < lims.x1) - sprite.hot.x = lims.x1; - else if (sprite.hot.x >= lims.x2) - sprite.hot.x = lims.x2 - 1; - if (sprite.hot.y < lims.y1) - sprite.hot.y = lims.y1; - else if (sprite.hot.y >= lims.y2) - sprite.hot.y = lims.y2 - 1; -#ifdef SHAPE - if (wBoundingShape(pWin)) - ConfineToShape(&pWin->borderSize, &sprite.hot.x, &sprite.hot.y); -#endif - if (qe) - { - qe->pScreen = sprite.hot.pScreen; - qe->event->u.keyButtonPointer.rootX = sprite.hot.x; - qe->event->u.keyButtonPointer.rootY = sprite.hot.y; - } - } - ROOT = WindowTable[sprite.hot.pScreen->myNum]; -} - -static void -ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaConfineCursorToWindow(pWin, generateEvents); - return; - } -#endif - - if (syncEvents.playingEvents) - { - CheckVirtualMotion((QdEventPtr)NULL, pWin); - SyntheticMotion(sprite.hot.x, sprite.hot.y); - } - else - { - sprite.hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize); -#ifdef SHAPE - sprite.hotShape = wBoundingShape(pWin) ? &pWin->borderSize - : NullRegion; -#endif - CheckPhysLimits(sprite.current, generateEvents, confineToScreen, - pScreen); - } -} - -Bool -PointerConfinedToScreen() -{ - return sprite.confined; -} - -static void -#if NeedFunctionPrototypes -ChangeToCursor(CursorPtr cursor) -#else -ChangeToCursor(cursor) - CursorPtr cursor; -#endif -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaChangeToCursor(cursor); - return; - } -#endif - - if (cursor != sprite.current) - { - if ((sprite.current->bits->xhot != cursor->bits->xhot) || - (sprite.current->bits->yhot != cursor->bits->yhot)) - CheckPhysLimits(cursor, FALSE, sprite.confined, - (ScreenPtr)NULL); - (*sprite.hotPhys.pScreen->DisplayCursor) (sprite.hotPhys.pScreen, - cursor); - sprite.current = cursor; - } -} - -/* returns true if b is a descendent of a */ -Bool -IsParent(a, b) - register WindowPtr a, b; -{ - for (b = b->parent; b; b = b->parent) - if (b == a) return TRUE; - return FALSE; -} - -static void -#if NeedFunctionPrototypes -PostNewCursor(void) -#else -PostNewCursor() -#endif -{ - register WindowPtr win; - register GrabPtr grab = inputInfo.pointer->grab; - - if (syncEvents.playingEvents) - return; - if (grab) - { - if (grab->cursor) - { - ChangeToCursor(grab->cursor); - return; - } - if (IsParent(grab->window, sprite.win)) - win = sprite.win; - else - win = grab->window; - } - else - win = sprite.win; - for (; win; win = win->parent) - if (win->optional && win->optional->cursor != NullCursor) - { - ChangeToCursor(win->optional->cursor); - return; - } -} - -WindowPtr -GetCurrentRootWindow() -{ - return ROOT; -} - -WindowPtr -GetSpriteWindow() -{ - return sprite.win; -} - -CursorPtr -GetSpriteCursor() -{ - return sprite.current; -} - -void -GetSpritePosition(px, py) - int *px, *py; -{ - *px = sprite.hotPhys.x; - *py = sprite.hotPhys.y; -} - -#ifdef PANORAMIX -int -XineramaGetCursorScreen() -{ - if(!noPanoramiXExtension) { - return sprite.screen->myNum; - } else { - return 0; - } -} -#endif /* PANORAMIX */ - -#define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ - -static void -#if NeedFunctionPrototypes -MonthChangedOrBadTime(register xEvent *xE) -#else -MonthChangedOrBadTime(xE) - register xEvent *xE; -#endif -{ - /* If the ddx/OS is careless about not processing timestamped events from - * different sources in sorted order, then it's possible for time to go - * backwards when it should not. Here we ensure a decent time. - */ - if ((currentTime.milliseconds - XE_KBPTR.time) > TIMESLOP) - currentTime.months++; - else - XE_KBPTR.time = currentTime.milliseconds; -} - -#define NoticeTime(xE) { \ - if ((xE)->u.keyButtonPointer.time < currentTime.milliseconds) \ - MonthChangedOrBadTime(xE); \ - currentTime.milliseconds = (xE)->u.keyButtonPointer.time; \ - lastDeviceEventTime = currentTime; } - -void -NoticeEventTime(xE) - register xEvent *xE; -{ - if (!syncEvents.playingEvents) - NoticeTime(xE); -} - -/************************************************************************** - * The following procedures deal with synchronous events * - **************************************************************************/ - -void -EnqueueEvent(xE, device, count) - xEvent *xE; - DeviceIntPtr device; - int count; -{ - register QdEventPtr tail = *syncEvents.pendtail; - register QdEventPtr qe; - xEvent *qxE; - - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - /* The RECORD spec says that the root window field of motion events - * must be valid. At this point, it hasn't been filled in yet, so - * we do it here. The long expression below is necessary to get - * the current root window; the apparently reasonable alternative - * GetCurrentRootWindow()->drawable.id doesn't give you the right - * answer on the first motion event after a screen change because - * the data that GetCurrentRootWindow relies on hasn't been - * updated yet. - */ - if (xE->u.u.type == MotionNotify) - XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - if (xE->u.u.type == MotionNotify) - { -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x - - panoramiXdataPtr[0].x; - XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y - - panoramiXdataPtr[0].y; - } -#endif - sprite.hotPhys.x = XE_KBPTR.rootX; - sprite.hotPhys.y = XE_KBPTR.rootY; - /* do motion compression */ - if (tail && - (tail->event->u.u.type == MotionNotify) && - (tail->pScreen == sprite.hotPhys.pScreen)) - { - tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x; - tail->event->u.keyButtonPointer.rootY = sprite.hotPhys.y; - tail->event->u.keyButtonPointer.time = XE_KBPTR.time; - tail->months = currentTime.months; - return; - } - } - qe = (QdEventPtr)xalloc(sizeof(QdEventRec) + (count * sizeof(xEvent))); - if (!qe) - return; - qe->next = (QdEventPtr)NULL; - qe->device = device; - qe->pScreen = sprite.hotPhys.pScreen; - qe->months = currentTime.months; - qe->event = (xEvent *)(qe + 1); - qe->evcount = count; - for (qxE = qe->event; --count >= 0; qxE++, xE++) - *qxE = *xE; - if (tail) - syncEvents.pendtail = &tail->next; - *syncEvents.pendtail = qe; -} - -static void -#if NeedFunctionPrototypes -PlayReleasedEvents(void) -#else -PlayReleasedEvents() -#endif -{ - register QdEventPtr *prev, qe; - register DeviceIntPtr dev; - - prev = &syncEvents.pending; - while ( (qe = *prev) ) - { - if (!qe->device->sync.frozen) - { - *prev = qe->next; - if (*syncEvents.pendtail == *prev) - syncEvents.pendtail = prev; - if (qe->event->u.u.type == MotionNotify) - CheckVirtualMotion(qe, NullWindow); - syncEvents.time.months = qe->months; - syncEvents.time.milliseconds = qe->event->u.keyButtonPointer.time; -#ifdef PANORAMIX - /* Translate back to the sprite screen since processInputProc - will translate from sprite screen to screen 0 upon reentry - to the DIX layer */ - if(!noPanoramiXExtension) { - qe->event->u.keyButtonPointer.rootX += - panoramiXdataPtr[0].x - - panoramiXdataPtr[sprite.screen->myNum].x; - qe->event->u.keyButtonPointer.rootY += - panoramiXdataPtr[0].y - - panoramiXdataPtr[sprite.screen->myNum].y; - } -#endif - (*qe->device->public.processInputProc)(qe->event, qe->device, - qe->evcount); - xfree(qe); - for (dev = inputInfo.devices; dev && dev->sync.frozen; dev = dev->next) - ; - if (!dev) - break; - /* Playing the event may have unfrozen another device. */ - /* So to play it safe, restart at the head of the queue */ - prev = &syncEvents.pending; - } - else - prev = &qe->next; - } -} - -static void -#if NeedFunctionPrototypes -FreezeThaw(register DeviceIntPtr dev, Bool frozen) -#else -FreezeThaw(dev, frozen) - register DeviceIntPtr dev; - Bool frozen; -#endif -{ - dev->sync.frozen = frozen; - if (frozen) - dev->public.processInputProc = dev->public.enqueueInputProc; - else - dev->public.processInputProc = dev->public.realInputProc; -} - -void -ComputeFreezes() -{ - register DeviceIntPtr replayDev = syncEvents.replayDev; - register int i; - WindowPtr w; - register xEvent *xE; - int count; - GrabPtr grab; - register DeviceIntPtr dev; - - for (dev = inputInfo.devices; dev; dev = dev->next) - FreezeThaw(dev, dev->sync.other || (dev->sync.state >= FROZEN)); - if (syncEvents.playingEvents || (!replayDev && !syncEvents.pending)) - return; - syncEvents.playingEvents = TRUE; - if (replayDev) - { - xE = replayDev->sync.event; - count = replayDev->sync.evcount; - syncEvents.replayDev = (DeviceIntPtr)NULL; - - w = XYToWindow( XE_KBPTR.rootX, XE_KBPTR.rootY); - for (i = 0; i < spriteTraceGood; i++) - { - if (syncEvents.replayWin == spriteTrace[i]) - { - if (!CheckDeviceGrabs(replayDev, xE, i+1, count)) { - if (replayDev->focus) - DeliverFocusedEvent(replayDev, xE, w, count); - else - DeliverDeviceEvents(w, xE, NullGrab, NullWindow, - replayDev, count); - } - goto playmore; - } - } - /* must not still be in the same stack */ - if (replayDev->focus) - DeliverFocusedEvent(replayDev, xE, w, count); - else - DeliverDeviceEvents(w, xE, NullGrab, NullWindow, replayDev, count); - } -playmore: - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (!dev->sync.frozen) - { - PlayReleasedEvents(); - break; - } - } - syncEvents.playingEvents = FALSE; - /* the following may have been skipped during replay, so do it now */ - if ((grab = inputInfo.pointer->grab) && grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } - else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); - PostNewCursor(); -} - -#ifdef RANDR -void -ScreenRestructured (ScreenPtr pScreen) -{ - GrabPtr grab; - - if ((grab = inputInfo.pointer->grab) && grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } - else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); -} -#endif - -void -CheckGrabForSyncs(thisDev, thisMode, otherMode) - register DeviceIntPtr thisDev; - Bool thisMode, otherMode; -{ - register GrabPtr grab = thisDev->grab; - register DeviceIntPtr dev; - - if (thisMode == GrabModeSync) - thisDev->sync.state = FROZEN_NO_EVENT; - else - { /* free both if same client owns both */ - thisDev->sync.state = THAWED; - if (thisDev->sync.other && - (CLIENT_BITS(thisDev->sync.other->resource) == - CLIENT_BITS(grab->resource))) - thisDev->sync.other = NullGrab; - } - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev != thisDev) - { - if (otherMode == GrabModeSync) - dev->sync.other = grab; - else - { /* free both if same client owns both */ - if (dev->sync.other && - (CLIENT_BITS(dev->sync.other->resource) == - CLIENT_BITS(grab->resource))) - dev->sync.other = NullGrab; - } - } - } - ComputeFreezes(); -} - -void -ActivatePointerGrab(mouse, grab, time, autoGrab) - register GrabPtr grab; - register DeviceIntPtr mouse; - TimeStamp time; - Bool autoGrab; -{ - WindowPtr oldWin = (mouse->grab) ? mouse->grab->window - : sprite.win; - - if (grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, FALSE, TRUE); - } - DoEnterLeaveEvents(oldWin, grab->window, NotifyGrab); - mouse->valuator->motionHintWindow = NullWindow; - if (syncEvents.playingEvents) - mouse->grabTime = syncEvents.time; - else - mouse->grabTime = time; - if (grab->cursor) - grab->cursor->refcnt++; - mouse->activeGrab = *grab; - mouse->grab = &mouse->activeGrab; - mouse->fromPassiveGrab = autoGrab; - PostNewCursor(); - CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode); - - #ifdef NXAGENT_SERVER - - /* - * If grab is synchronous, events are delivered to clients only if they send - * an AllowEvent request. If mode field in AllowEvent request is SyncPointer, the - * delivered event is saved in a queue and replayed later, when grab is released. - * We should export sync grab to X as async in order to avoid events to be - * queued twice, in the agent and in the X server. This solution have a drawback: - * replayed events are not delivered to that application that are not clients of - * the agent. - * A different solution could be to make the grab asynchronous in the agent and - * to export it as synchronous. But this seems to be less safe. - * - * To make internal grab asynchronous, change previous line as follows. - * - * if (nxagentOption(Rootless)) - * { - * CheckGrabForSyncs(mouse, GrabModeAsync, (Bool)grab->keyboardMode); - * } - * else - * { - * CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode); - * } - */ - - if (nxagentOption(Rootless) == 1) - { - /* - * FIXME: We should use the correct value - * for the cursor. Temporarily we set it - * to None. - */ - - int resource = nxagentWaitForResource(NXGetCollectGrabPointerResource, - nxagentCollectGrabPointerPredicate); - - NXCollectGrabPointer(nxagentDisplay, resource, nxagentWindow(grab -> window), - 1, grab -> eventMask & PointerGrabMask, - GrabModeAsync, GrabModeAsync, (grab -> confineTo) ? - nxagentWindow(grab -> confineTo) : None, - None, CurrentTime); - } - - #endif -} - -void -DeactivatePointerGrab(mouse) - register DeviceIntPtr mouse; -{ - register GrabPtr grab = mouse->grab; - register DeviceIntPtr dev; - - mouse->valuator->motionHintWindow = NullWindow; - mouse->grab = NullGrab; - mouse->sync.state = NOT_GRABBED; - mouse->fromPassiveGrab = FALSE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->sync.other == grab) - dev->sync.other = NullGrab; - } - DoEnterLeaveEvents(grab->window, sprite.win, NotifyUngrab); - if (grab->confineTo) - ConfineCursorToWindow(ROOT, FALSE, FALSE); - PostNewCursor(); - if (grab->cursor) - FreeCursor(grab->cursor, (Cursor)0); - ComputeFreezes(); - - #ifdef NXAGENT_SERVER - - if (nxagentOption(Rootless) == 1) - { - XUngrabPointer(nxagentDisplay, CurrentTime); - - if (sprite.win == ROOT) - { - mouse -> button -> state &= - ~(Button1Mask | Button2Mask | Button3Mask | - Button4Mask | Button5Mask); - } - } - - #endif -} - -void -ActivateKeyboardGrab(keybd, grab, time, passive) - register DeviceIntPtr keybd; - GrabPtr grab; - TimeStamp time; - Bool passive; -{ - WindowPtr oldWin; - - if (keybd->grab) - oldWin = keybd->grab->window; - else if (keybd->focus) - oldWin = keybd->focus->win; - else - oldWin = sprite.win; - if (oldWin == FollowKeyboardWin) - oldWin = inputInfo.keyboard->focus->win; - if (keybd->valuator) - keybd->valuator->motionHintWindow = NullWindow; - DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab); - if (syncEvents.playingEvents) - keybd->grabTime = syncEvents.time; - else - keybd->grabTime = time; - keybd->activeGrab = *grab; - keybd->grab = &keybd->activeGrab; - keybd->fromPassiveGrab = passive; - CheckGrabForSyncs(keybd, (Bool)grab->keyboardMode, (Bool)grab->pointerMode); -} - -void -DeactivateKeyboardGrab(keybd) - register DeviceIntPtr keybd; -{ - register GrabPtr grab = keybd->grab; - register DeviceIntPtr dev; - register WindowPtr focusWin = keybd->focus ? keybd->focus->win - : sprite.win; - - if (focusWin == FollowKeyboardWin) - focusWin = inputInfo.keyboard->focus->win; - if (keybd->valuator) - keybd->valuator->motionHintWindow = NullWindow; - keybd->grab = NullGrab; - keybd->sync.state = NOT_GRABBED; - keybd->fromPassiveGrab = FALSE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->sync.other == grab) - dev->sync.other = NullGrab; - } - DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab); - ComputeFreezes(); -} - -void -AllowSome(client, time, thisDev, newState) - ClientPtr client; - TimeStamp time; - register DeviceIntPtr thisDev; - int newState; -{ - Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced; - TimeStamp grabTime; - register DeviceIntPtr dev; - - thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client); - thisSynced = FALSE; - otherGrabbed = FALSE; - othersFrozen = TRUE; - grabTime = thisDev->grabTime; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - if (dev->grab && SameClient(dev->grab, client)) - { - if (!(thisGrabbed || otherGrabbed) || - (CompareTimeStamps(dev->grabTime, grabTime) == LATER)) - grabTime = dev->grabTime; - otherGrabbed = TRUE; - if (thisDev->sync.other == dev->grab) - thisSynced = TRUE; - if (dev->sync.state < FROZEN) - othersFrozen = FALSE; - } - else if (!dev->sync.other || !SameClient(dev->sync.other, client)) - othersFrozen = FALSE; - } - if (!((thisGrabbed && thisDev->sync.state >= FROZEN) || thisSynced)) - return; - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, grabTime) == EARLIER)) - return; - switch (newState) - { - case THAWED: /* Async */ - if (thisGrabbed) - thisDev->sync.state = THAWED; - if (thisSynced) - thisDev->sync.other = NullGrab; - ComputeFreezes(); - break; - case FREEZE_NEXT_EVENT: /* Sync */ - if (thisGrabbed) - { - thisDev->sync.state = FREEZE_NEXT_EVENT; - if (thisSynced) - thisDev->sync.other = NullGrab; - ComputeFreezes(); - } - break; - case THAWED_BOTH: /* AsyncBoth */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = THAWED; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - case FREEZE_BOTH_NEXT_EVENT: /* SyncBoth */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = FREEZE_BOTH_NEXT_EVENT; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - case NOT_GRABBED: /* Replay */ - if (thisGrabbed && thisDev->sync.state == FROZEN_WITH_EVENT) - { - if (thisSynced) - thisDev->sync.other = NullGrab; - syncEvents.replayDev = thisDev; - syncEvents.replayWin = thisDev->grab->window; - (*thisDev->DeactivateGrab)(thisDev); - syncEvents.replayDev = (DeviceIntPtr)NULL; - } - break; - case THAW_OTHERS: /* AsyncOthers */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = THAWED; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - } -} - -int -ProcAllowEvents(client) - register ClientPtr client; -{ - TimeStamp time; - DeviceIntPtr mouse = inputInfo.pointer; - DeviceIntPtr keybd = inputInfo.keyboard; - REQUEST(xAllowEventsReq); - - REQUEST_SIZE_MATCH(xAllowEventsReq); - time = ClientTimeToServerTime(stuff->time); - switch (stuff->mode) - { - case ReplayPointer: - AllowSome(client, time, mouse, NOT_GRABBED); - break; - case SyncPointer: - AllowSome(client, time, mouse, FREEZE_NEXT_EVENT); - break; - case AsyncPointer: - AllowSome(client, time, mouse, THAWED); - break; - case ReplayKeyboard: - AllowSome(client, time, keybd, NOT_GRABBED); - break; - case SyncKeyboard: - AllowSome(client, time, keybd, FREEZE_NEXT_EVENT); - break; - case AsyncKeyboard: - AllowSome(client, time, keybd, THAWED); - break; - case SyncBoth: - AllowSome(client, time, keybd, FREEZE_BOTH_NEXT_EVENT); - break; - case AsyncBoth: - AllowSome(client, time, keybd, THAWED_BOTH); - break; - default: - client->errorValue = stuff->mode; - return BadValue; - } - - /* - * This is not necessary if we export grab to X as asynchronous. - * - * if (nxagentOption(Rootless) && stuff -> mode != ReplayKeyboard && - * stuff -> mode != SyncKeyboard && stuff -> mode != AsyncKeyboard) - * { - * XAllowEvents(nxagentDisplay, stuff -> mode, CurrentTime); - * } - */ - - return Success; -} - -void -ReleaseActiveGrabs(client) - ClientPtr client; -{ - register DeviceIntPtr dev; - Bool done; - - /* XXX CloseDownClient should remove passive grabs before - * releasing active grabs. - */ - do { - done = TRUE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - { - (*dev->DeactivateGrab)(dev); - done = FALSE; - } - } - } while (!done); -} - -/************************************************************************** - * The following procedures deal with delivering events * - **************************************************************************/ - -int -TryClientEvents (client, pEvents, count, mask, filter, grab) - ClientPtr client; - GrabPtr grab; - xEvent *pEvents; - int count; - Mask mask, filter; -{ - int i; - int type; - -#ifdef DEBUG - if (debug_events) ErrorF( - "Event([%d, %d], mask=0x%x), client=%d", - pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); -#endif - if ((client) && (client != serverClient) && (!client->clientGone) && - ((filter == CantBeFiltered) || (mask & filter))) - { - if (grab && !SameClient(grab, client)) - return -1; /* don't send, but notify caller */ - type = pEvents->u.u.type; - if (type == MotionNotify) - { - if (mask & PointerMotionHintMask) - { - if (WID(inputInfo.pointer->valuator->motionHintWindow) == - pEvents->u.keyButtonPointer.event) - { -#ifdef DEBUG - if (debug_events) ErrorF("\n"); - fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); -#endif - return 1; /* don't send, but pretend we did */ - } - pEvents->u.u.detail = NotifyHint; - } - else - { - pEvents->u.u.detail = NotifyNormal; - } - } -#ifdef XINPUT - else - { - if ((type == DeviceMotionNotify) && - MaybeSendDeviceMotionNotifyHint - ((deviceKeyButtonPointer*)pEvents, mask) != 0) - return 1; - } -#endif - type &= 0177; - if (type != KeymapNotify) - { - /* all extension events must have a sequence number */ - for (i = 0; i < count; i++) - pEvents[i].u.u.sequenceNumber = client->sequence; - } - - if (BitIsOn(criticalEvents, type)) - { -#ifdef SMART_SCHEDULE - if (client->smart_priority < SMART_MAX_PRIORITY) - client->smart_priority++; -#endif - SetCriticalOutputPending(); - } - - WriteEventsToClient(client, count, pEvents); -#ifdef DEBUG - if (debug_events) ErrorF( " delivered\n"); -#endif - return 1; - } - else - { -#ifdef DEBUG - if (debug_events) ErrorF("\n"); -#endif - return 0; - } -} - -int -DeliverEventsToWindow(pWin, pEvents, count, filter, grab, mskidx) - register WindowPtr pWin; - GrabPtr grab; - xEvent *pEvents; - int count; - Mask filter; - int mskidx; -{ - int deliveries = 0, nondeliveries = 0; - int attempt; - register InputClients *other; - ClientPtr client = NullClient; - Mask deliveryMask = 0; /* If a grab occurs due to a button press, then - this mask is the mask of the grab. */ - int type = pEvents->u.u.type; - - /* CantBeFiltered means only window owner gets the event */ - if ((filter == CantBeFiltered) || !(type & EXTENSION_EVENT_BASE)) - { - /* if nobody ever wants to see this event, skip some work */ - if (filter != CantBeFiltered && - !((wOtherEventMasks(pWin)|pWin->eventMask) & filter)) - return 0; - if ( (attempt = TryClientEvents(wClient(pWin), pEvents, count, - pWin->eventMask, filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = wClient(pWin); - deliveryMask = pWin->eventMask; - } else - nondeliveries--; - } - } - if (filter != CantBeFiltered) - { - if (type & EXTENSION_EVENT_BASE) - { - OtherInputMasks *inputMasks; - - inputMasks = wOtherInputMasks(pWin); - if (!inputMasks || - !(inputMasks->inputEvents[mskidx] & filter)) - return 0; - other = inputMasks->inputClients; - } - else - other = (InputClients *)wOtherClients(pWin); - for (; other; other = other->next) - { - if ( (attempt = TryClientEvents(rClient(other), pEvents, count, - other->mask[mskidx], filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = rClient(other); - deliveryMask = other->mask[mskidx]; - } else - nondeliveries--; - } - } - } - if ((type == ButtonPress) && deliveries && (!grab)) - { - GrabRec tempGrab; - - tempGrab.device = inputInfo.pointer; - tempGrab.resource = client->clientAsMask; - tempGrab.window = pWin; - tempGrab.ownerEvents = (deliveryMask & OwnerGrabButtonMask) ? TRUE : FALSE; - tempGrab.eventMask = deliveryMask; - tempGrab.keyboardMode = GrabModeAsync; - tempGrab.pointerMode = GrabModeAsync; - tempGrab.confineTo = NullWindow; - tempGrab.cursor = NullCursor; - (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab, - currentTime, TRUE); - } - else if ((type == MotionNotify) && deliveries) - inputInfo.pointer->valuator->motionHintWindow = pWin; -#ifdef XINPUT - else - { - if (((type == DeviceMotionNotify) || (type == DeviceButtonPress)) && - deliveries) - CheckDeviceGrabAndHintWindow (pWin, type, - (deviceKeyButtonPointer*) pEvents, - grab, client, deliveryMask); - } -#endif - if (deliveries) - return deliveries; - return nondeliveries; -} - -/* If the event goes to dontClient, don't send it and return 0. if - send works, return 1 or if send didn't work, return 2. - Only works for core events. -*/ - -#ifdef PANORAMIX -static int -XineramaTryClientEventsResult( - ClientPtr client, - GrabPtr grab, - Mask mask, - Mask filter -){ - if ((client) && (client != serverClient) && (!client->clientGone) && - ((filter == CantBeFiltered) || (mask & filter))) - { - if (grab && !SameClient(grab, client)) return -1; - else return 1; - } - return 0; -} -#endif - -int -MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient) - register WindowPtr pWin; - xEvent *pEvents; - int count; - Mask filter; - ClientPtr dontClient; -{ - register OtherClients *other; - - - if (pWin->eventMask & filter) - { - if (wClient(pWin) == dontClient) - return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return XineramaTryClientEventsResult( - wClient(pWin), NullGrab, pWin->eventMask, filter); -#endif - return TryClientEvents(wClient(pWin), pEvents, count, - pWin->eventMask, filter, NullGrab); - } - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->mask & filter) - { - if (SameClient(other, dontClient)) - return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return XineramaTryClientEventsResult( - rClient(other), NullGrab, other->mask, filter); -#endif - return TryClientEvents(rClient(other), pEvents, count, - other->mask, filter, NullGrab); - } - } - return 2; -} - -static void -#if NeedFunctionPrototypes -FixUpEventFromWindow( - xEvent *xE, - WindowPtr pWin, - Window child, - Bool calcChild) -#else -FixUpEventFromWindow(xE, pWin, child, calcChild) - xEvent *xE; - WindowPtr pWin; - Window child; - Bool calcChild; -#endif -{ - if (calcChild) - { - WindowPtr w=spriteTrace[spriteTraceGood-1]; - /* If the search ends up past the root should the child field be - set to none or should the value in the argument be passed - through. It probably doesn't matter since everyone calls - this function with child == None anyway. */ - - while (w) - { - /* If the source window is same as event window, child should be - none. Don't bother going all all the way back to the root. */ - - if (w == pWin) - { - child = None; - break; - } - - if (w->parent == pWin) - { - child = w->drawable.id; - break; - } - w = w->parent; - } - } - XE_KBPTR.root = ROOT->drawable.id; - XE_KBPTR.event = pWin->drawable.id; - if (sprite.hot.pScreen == pWin->drawable.pScreen) - { - XE_KBPTR.sameScreen = xTrue; - XE_KBPTR.child = child; - XE_KBPTR.eventX = - XE_KBPTR.rootX - pWin->drawable.x; - XE_KBPTR.eventY = - XE_KBPTR.rootY - pWin->drawable.y; - } - else - { - XE_KBPTR.sameScreen = xFalse; - XE_KBPTR.child = None; - XE_KBPTR.eventX = 0; - XE_KBPTR.eventY = 0; - } -} - -int -DeliverDeviceEvents(pWin, xE, grab, stopAt, dev, count) - register WindowPtr pWin, stopAt; - register xEvent *xE; - GrabPtr grab; - DeviceIntPtr dev; - int count; -{ - Window child = None; - int type = xE->u.u.type; - Mask filter = filters[type]; - int deliveries = 0; - - if (type & EXTENSION_EVENT_BASE) - { - register OtherInputMasks *inputMasks; - int mskidx = dev->id; - - inputMasks = wOtherInputMasks(pWin); - if (inputMasks && !(filter & inputMasks->deliverableEvents[mskidx])) - return 0; - while (pWin) - { - if (inputMasks && (inputMasks->inputEvents[mskidx] & filter)) - { - FixUpEventFromWindow(xE, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(pWin, xE, count, filter, - grab, mskidx); - if (deliveries > 0) - return deliveries; - } - if ((deliveries < 0) || - (pWin == stopAt) || - (inputMasks && - (filter & inputMasks->dontPropagateMask[mskidx]))) - return 0; - child = pWin->drawable.id; - pWin = pWin->parent; - if (pWin) - inputMasks = wOtherInputMasks(pWin); - } - } - else - { - if (!(filter & pWin->deliverableEvents)) - return 0; - while (pWin) - { - if ((wOtherEventMasks(pWin)|pWin->eventMask) & filter) - { - FixUpEventFromWindow(xE, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(pWin, xE, count, filter, - grab, 0); - if (deliveries > 0) - return deliveries; - } - if ((deliveries < 0) || - (pWin == stopAt) || - (filter & wDontPropagateMask(pWin))) - return 0; - child = pWin->drawable.id; - pWin = pWin->parent; - } - } - return 0; -} - -/* not useful for events that propagate up the tree or extension events */ -int -DeliverEvents(pWin, xE, count, otherParent) - register WindowPtr pWin, otherParent; - register xEvent *xE; - int count; -{ - Mask filter; - int deliveries; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return count; -#endif - - if (!count) - return 0; - filter = filters[xE->u.u.type]; - if ((filter & SubstructureNotifyMask) && (xE->u.u.type != CreateNotify)) - xE->u.destroyNotify.event = pWin->drawable.id; - if (filter != StructureAndSubMask) - return DeliverEventsToWindow(pWin, xE, count, filter, NullGrab, 0); - deliveries = DeliverEventsToWindow(pWin, xE, count, StructureNotifyMask, - NullGrab, 0); - if (pWin->parent) - { - xE->u.destroyNotify.event = pWin->parent->drawable.id; - deliveries += DeliverEventsToWindow(pWin->parent, xE, count, - SubstructureNotifyMask, NullGrab, - 0); - if (xE->u.u.type == ReparentNotify) - { - xE->u.destroyNotify.event = otherParent->drawable.id; - deliveries += DeliverEventsToWindow(otherParent, xE, count, - SubstructureNotifyMask, - NullGrab, 0); - } - } - return deliveries; -} - - -static Bool -PointInBorderSize(WindowPtr pWin, int x, int y) -{ - BoxRec box; - - if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box)) - return TRUE; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { - int i; - - for(i = 1; i < PanoramiXNumScreens; i++) { - if(POINT_IN_REGION(sprite.screen, - &sprite.windows[i]->borderSize, - x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x, - y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y, - &box)) - return TRUE; - } - } -#endif - return FALSE; -} - -static WindowPtr -#if NeedFunctionPrototypes -XYToWindow(int x, int y) -#else -XYToWindow(x, y) - int x, y; -#endif -{ - register WindowPtr pWin; - - spriteTraceGood = 1; /* root window still there */ - - if (nxagentOption(Rootless)) - { - if (nxagentLastEnteredWindow == NULL) - { - return ROOT; - } - - pWin = ROOT->lastChild; - - while (pWin && pWin != ROOT->firstChild && pWin != nxagentLastEnteredWindow) - { - pWin = pWin->prevSib; - } - } - else - { - pWin = ROOT->firstChild; - } - - while (pWin) - { - if ((pWin->mapped) && - (x >= pWin->drawable.x - wBorderWidth (pWin)) && - (x < pWin->drawable.x + (int)pWin->drawable.width + - wBorderWidth(pWin)) && - (y >= pWin->drawable.y - wBorderWidth (pWin)) && - (y < pWin->drawable.y + (int)pWin->drawable.height + - wBorderWidth (pWin)) -#ifdef SHAPE - /* When a window is shaped, a further check - * is made to see if the point is inside - * borderSize - */ - && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y)) -#endif - ) - { - if (spriteTraceGood >= spriteTraceSize) - { - spriteTraceSize += 10; - Must_have_memory = TRUE; /* XXX */ - spriteTrace = (WindowPtr *)xrealloc( - spriteTrace, spriteTraceSize*sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ - } - spriteTrace[spriteTraceGood++] = pWin; - pWin = pWin->firstChild; - } - else - pWin = pWin->nextSib; - } - return spriteTrace[spriteTraceGood-1]; -} - -static Bool -#if NeedFunctionPrototypes -CheckMotion(xEvent *xE) -#else -CheckMotion(xE) - xEvent *xE; -#endif -{ - WindowPtr prevSpriteWin = sprite.win; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return XineramaCheckMotion(xE); -#endif - - if (xE && !syncEvents.playingEvents) - { - if (sprite.hot.pScreen != sprite.hotPhys.pScreen) - { - sprite.hot.pScreen = sprite.hotPhys.pScreen; - ROOT = WindowTable[sprite.hot.pScreen->myNum]; - } - sprite.hot.x = XE_KBPTR.rootX; - sprite.hot.y = XE_KBPTR.rootY; - if (sprite.hot.x < sprite.physLimits.x1) - sprite.hot.x = sprite.physLimits.x1; - else if (sprite.hot.x >= sprite.physLimits.x2) - sprite.hot.x = sprite.physLimits.x2 - 1; - if (sprite.hot.y < sprite.physLimits.y1) - sprite.hot.y = sprite.physLimits.y1; - else if (sprite.hot.y >= sprite.physLimits.y2) - sprite.hot.y = sprite.physLimits.y2 - 1; -#ifdef SHAPE - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); -#endif - sprite.hotPhys = sprite.hot; - - /* - * This code force cursor position to be inside the - * root window of the agent. We can't view a reason - * to do this and it interacts in an undesirable way - * with toggling fullscreen. - * - * if ((sprite.hotPhys.x != XE_KBPTR.rootX) || - * (sprite.hotPhys.y != XE_KBPTR.rootY)) - * { - * (*sprite.hotPhys.pScreen->SetCursorPosition)( - * sprite.hotPhys.pScreen, - * sprite.hotPhys.x, sprite.hotPhys.y, FALSE); - * } - */ - - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - } - - sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); -#ifdef notyet - if (!(sprite.win->deliverableEvents & - Motion_Filter(inputInfo.pointer->button)) - !syncEvents.playingEvents) - { - /* XXX Do PointerNonInterestBox here */ - } -#endif - if (sprite.win != prevSpriteWin) - { - if (prevSpriteWin != NullWindow) { - if (!xE) - UpdateCurrentTimeIf(); - DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); - } - PostNewCursor(); - return FALSE; - } - return TRUE; -} - -void -WindowsRestructured() -{ - (void) CheckMotion((xEvent *)NULL); -} - -void -DefineInitialRootWindow(win) - register WindowPtr win; -{ - register ScreenPtr pScreen = win->drawable.pScreen; - extern void nxagentInitViewportFrame(ScreenPtr, WindowPtr); - extern int nxagentShadowInit(ScreenPtr, WindowPtr); - - sprite.hotPhys.pScreen = pScreen; - sprite.hotPhys.x = pScreen->width / 2; - sprite.hotPhys.y = pScreen->height / 2; - sprite.hot = sprite.hotPhys; - sprite.hotLimits.x2 = pScreen->width; - sprite.hotLimits.y2 = pScreen->height; - sprite.win = win; - sprite.current = wCursor (win); - spriteTraceGood = 1; - ROOT = win; - (*pScreen->CursorLimits) ( - pScreen, sprite.current, &sprite.hotLimits, &sprite.physLimits); - sprite.confined = FALSE; - (*pScreen->ConstrainCursor) (pScreen, &sprite.physLimits); - (*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE); - (*pScreen->DisplayCursor) (pScreen, sprite.current); - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - sprite.hotLimits.x1 = -panoramiXdataPtr[0].x; - sprite.hotLimits.y1 = -panoramiXdataPtr[0].y; - sprite.hotLimits.x2 = PanoramiXPixWidth - panoramiXdataPtr[0].x; - sprite.hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y; - sprite.physLimits = sprite.hotLimits; - sprite.confineWin = NullWindow; - sprite.screen = pScreen; - /* gotta UNINIT these someplace */ - REGION_INIT(pScreen, &sprite.Reg1, NullBox, 1); - REGION_INIT(pScreen, &sprite.Reg2, NullBox, 1); - } -#endif - - nxagentInitViewportFrame(pScreen, win); - - if (nxagentOption(Shadow)) - { - if (nxagentShadowInit(pScreen, win) == -1) - { - GiveUp(0); - } - } -} - -/* - * This does not take any shortcuts, and even ignores its argument, since - * it does not happen very often, and one has to walk up the tree since - * this might be a newly instantiated cursor for an intermediate window - * between the one the pointer is in and the one that the last cursor was - * instantiated from. - */ -/*ARGSUSED*/ -void -WindowHasNewCursor(pWin) - WindowPtr pWin; -{ - PostNewCursor(); -} - -void -NewCurrentScreen(newScreen, x, y) - ScreenPtr newScreen; - int x,y; -{ - sprite.hotPhys.x = x; - sprite.hotPhys.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - sprite.hotPhys.x += panoramiXdataPtr[newScreen->myNum].x - - panoramiXdataPtr[0].x; - sprite.hotPhys.y += panoramiXdataPtr[newScreen->myNum].y - - panoramiXdataPtr[0].y; - if (newScreen != sprite.screen) { - sprite.screen = newScreen; - /* Make sure we tell the DDX to update its copy of the screen */ - if(sprite.confineWin) - XineramaConfineCursorToWindow(sprite.confineWin, TRUE); - else - XineramaConfineCursorToWindow(WindowTable[0], TRUE); - /* if the pointer wasn't confined, the DDX won't get - told of the pointer warp so we reposition it here */ - if(!syncEvents.playingEvents) - (*sprite.screen->SetCursorPosition)(sprite.screen, - sprite.hotPhys.x + panoramiXdataPtr[0].x - - panoramiXdataPtr[sprite.screen->myNum].x, - sprite.hotPhys.y + panoramiXdataPtr[0].y - - panoramiXdataPtr[sprite.screen->myNum].y, FALSE); - } - } else -#endif - if (newScreen != sprite.hotPhys.pScreen) - ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE); -} - -#ifdef PANORAMIX - -static Bool -XineramaPointInWindowIsVisible( - WindowPtr pWin, - int x, - int y -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - BoxRec box; - int i, xoff, yoff; - - if (!pWin->realized) return FALSE; - - if (POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) - return TRUE; - - if(!XineramaSetWindowPntrs(pWin)) return FALSE; - - xoff = x + panoramiXdataPtr[0].x; - yoff = y + panoramiXdataPtr[0].y; - - for(i = 1; i < PanoramiXNumScreens; i++) { - pWin = sprite.windows[i]; - pScreen = pWin->drawable.pScreen; - x = xoff - panoramiXdataPtr[i].x; - y = yoff - panoramiXdataPtr[i].y; - - if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) - return TRUE; - - } - - return FALSE; -} - -static int -XineramaWarpPointer(ClientPtr client) -{ - WindowPtr dest = NULL; - int x, y; - - REQUEST(xWarpPointerReq); - - - if (stuff->dstWid != None) - { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); - if (!dest) - return BadWindow; - } - x = sprite.hotPhys.x; - y = sprite.hotPhys.y; - - if (stuff->srcWid != None) - { - int winX, winY; - XID winID = stuff->srcWid; - WindowPtr source; - - source = SecurityLookupWindow(winID, client, SecurityReadAccess); - if (!source) return BadWindow; - - winX = source->drawable.x; - winY = source->drawable.y; - if(source == WindowTable[0]) { - winX -= panoramiXdataPtr[0].x; - winY -= panoramiXdataPtr[0].y; - } - if (x < winX + stuff->srcX || - y < winY + stuff->srcY || - (stuff->srcWidth != 0 && - winX + stuff->srcX + (int)stuff->srcWidth < x) || - (stuff->srcHeight != 0 && - winY + stuff->srcY + (int)stuff->srcHeight < y) || - !XineramaPointInWindowIsVisible(source, x, y)) - return Success; - } - if (dest) { - x = dest->drawable.x; - y = dest->drawable.y; - if(dest == WindowTable[0]) { - x -= panoramiXdataPtr[0].x; - y -= panoramiXdataPtr[0].y; - } - } - - x += stuff->dstX; - y += stuff->dstY; - - if (x < sprite.physLimits.x1) - x = sprite.physLimits.x1; - else if (x >= sprite.physLimits.x2) - x = sprite.physLimits.x2 - 1; - if (y < sprite.physLimits.y1) - y = sprite.physLimits.y1; - else if (y >= sprite.physLimits.y2) - y = sprite.physLimits.y2 - 1; - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &x, &y); - - XineramaSetCursorPosition(x, y, TRUE); - - return Success; -} - -#endif - - -int -ProcWarpPointer(client) - ClientPtr client; -{ - WindowPtr dest = NULL; - int x, y; - ScreenPtr newScreen; - - REQUEST(xWarpPointerReq); - - REQUEST_SIZE_MATCH(xWarpPointerReq); - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return XineramaWarpPointer(client); -#endif - - if (stuff->dstWid != None) - { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); - if (!dest) - return BadWindow; - } - x = sprite.hotPhys.x; - y = sprite.hotPhys.y; - - if (stuff->srcWid != None) - { - int winX, winY; - XID winID = stuff->srcWid; - WindowPtr source; - - source = SecurityLookupWindow(winID, client, SecurityReadAccess); - if (!source) return BadWindow; - - winX = source->drawable.x; - winY = source->drawable.y; - if (source->drawable.pScreen != sprite.hotPhys.pScreen || - x < winX + stuff->srcX || - y < winY + stuff->srcY || - (stuff->srcWidth != 0 && - winX + stuff->srcX + (int)stuff->srcWidth < x) || - (stuff->srcHeight != 0 && - winY + stuff->srcY + (int)stuff->srcHeight < y) || - !PointInWindowIsVisible(source, x, y)) - return Success; - } - if (dest) - { - x = dest->drawable.x; - y = dest->drawable.y; - newScreen = dest->drawable.pScreen; - } else - newScreen = sprite.hotPhys.pScreen; - - x += stuff->dstX; - y += stuff->dstY; - - if (x < 0) - x = 0; - else if (x >= newScreen->width) - x = newScreen->width - 1; - if (y < 0) - y = 0; - else if (y >= newScreen->height) - y = newScreen->height - 1; - - if (newScreen == sprite.hotPhys.pScreen) - { - if (x < sprite.physLimits.x1) - x = sprite.physLimits.x1; - else if (x >= sprite.physLimits.x2) - x = sprite.physLimits.x2 - 1; - if (y < sprite.physLimits.y1) - y = sprite.physLimits.y1; - else if (y >= sprite.physLimits.y2) - y = sprite.physLimits.y2 - 1; -#if defined(SHAPE) - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &x, &y); -#endif - (*newScreen->SetCursorPosition)(newScreen, x, y, TRUE); - } - else if (!PointerConfinedToScreen()) - { - NewCurrentScreen(newScreen, x, y); - } - return Success; -} - -static Bool -BorderSizeNotEmpty(WindowPtr pWin) -{ - if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize)) - return TRUE; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { - int i; - - for(i = 1; i < PanoramiXNumScreens; i++) { - if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize)) - return TRUE; - } - } -#endif - return FALSE; -} - -/* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a - passive grab set on the window to be activated. */ - -static Bool -#if NeedFunctionPrototypes -CheckPassiveGrabsOnWindow( - WindowPtr pWin, - register DeviceIntPtr device, - register xEvent *xE, - int count) -#else -CheckPassiveGrabsOnWindow(pWin, device, xE, count) - WindowPtr pWin; - register DeviceIntPtr device; - register xEvent *xE; - int count; -#endif -{ - register GrabPtr grab = wPassiveGrabs(pWin); - GrabRec tempGrab; - register xEvent *dxE; - - if (!grab) - return FALSE; - tempGrab.window = pWin; - tempGrab.device = device; - tempGrab.type = xE->u.u.type; - tempGrab.detail.exact = xE->u.u.detail; - tempGrab.detail.pMask = NULL; - tempGrab.modifiersDetail.pMask = NULL; - for (; grab; grab = grab->next) - { -#ifdef XKB - DeviceIntPtr gdev; - XkbSrvInfoPtr xkbi; - - gdev= grab->modifierDevice; - xkbi= gdev->key->xkbInfo; -#endif - tempGrab.modifierDevice = grab->modifierDevice; - if (device == grab->modifierDevice && - (xE->u.u.type == KeyPress -#ifdef XINPUT - || xE->u.u.type == DeviceKeyPress -#endif - )) - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension?gdev->key->prev_state:xkbi->state.grab_mods); -#else - grab->modifierDevice->key->prev_state; -#endif - else - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension ? gdev->key->state : xkbi->state.grab_mods); -#else - grab->modifierDevice->key->state; -#endif - if (GrabMatchesSecond(&tempGrab, grab) && - (!grab->confineTo || - (grab->confineTo->realized && - BorderSizeNotEmpty(grab->confineTo)))) - { -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(wClient(pWin), device, FALSE)) - return FALSE; -#endif -#ifdef XKB - if (!noXkbExtension) { - XE_KBPTR.state &= 0x1f00; - XE_KBPTR.state |= - tempGrab.modifiersDetail.exact&(~0x1f00); - } -#endif - (*device->ActivateGrab)(device, grab, currentTime, TRUE); - - FixUpEventFromWindow(xE, grab->window, None, TRUE); - - (void) TryClientEvents(rClient(grab), xE, count, - filters[xE->u.u.type], - filters[xE->u.u.type], grab); - - if (device->sync.state == FROZEN_NO_EVENT) - { - if (device->sync.evcount < count) - { - Must_have_memory = TRUE; /* XXX */ - device->sync.event = (xEvent *)xrealloc(device->sync.event, - count* - sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ - } - device->sync.evcount = count; - for (dxE = device->sync.event; --count >= 0; dxE++, xE++) - *dxE = *xE; - device->sync.state = FROZEN_WITH_EVENT; - } - return TRUE; - } - } - return FALSE; -} - -/* -"CheckDeviceGrabs" handles both keyboard and pointer events that may cause -a passive grab to be activated. If the event is a keyboard event, the -ancestors of the focus window are traced down and tried to see if they have -any passive grabs to be activated. If the focus window itself is reached and -it's descendants contain they pointer, the ancestors of the window that the -pointer is in are then traced down starting at the focus window, otherwise no -grabs are activated. If the event is a pointer event, the ancestors of the -window that the pointer is in are traced down starting at the root until -CheckPassiveGrabs causes a passive grab to activate or all the windows are -tried. PRH -*/ - -Bool -CheckDeviceGrabs(device, xE, checkFirst, count) - register DeviceIntPtr device; - register xEvent *xE; - int checkFirst; - int count; -{ - register int i; - register WindowPtr pWin = NULL; - register FocusClassPtr focus = device->focus; - - if ((xE->u.u.type == ButtonPress -#ifdef XINPUT - || xE->u.u.type == DeviceButtonPress -#endif - ) && device->button->buttonsDown != 1) - return FALSE; - - i = checkFirst; - - if (focus) - { - for (; i < focus->traceGood; i++) - { - pWin = focus->trace[i]; - if (pWin->optional && - CheckPassiveGrabsOnWindow(pWin, device, xE, count)) - return TRUE; - } - - if ((focus->win == NoneWin) || - (i >= spriteTraceGood) || - ((i > checkFirst) && (pWin != spriteTrace[i-1]))) - return FALSE; - } - - for (; i < spriteTraceGood; i++) - { - pWin = spriteTrace[i]; - if (pWin->optional && - CheckPassiveGrabsOnWindow(pWin, device, xE, count)) - return TRUE; - } - - return FALSE; -} - -void -DeliverFocusedEvent(keybd, xE, window, count) - xEvent *xE; - DeviceIntPtr keybd; - WindowPtr window; - int count; -{ - WindowPtr focus = keybd->focus->win; - int mskidx = 0; - - if (focus == FollowKeyboardWin) - focus = inputInfo.keyboard->focus->win; - if (!focus) - return; - if (focus == PointerRootWin) - { - DeliverDeviceEvents(window, xE, NullGrab, NullWindow, keybd, count); - return; - } - if ((focus == window) || IsParent(focus, window)) - { - if (DeliverDeviceEvents(window, xE, NullGrab, focus, keybd, count)) - return; - } - /* just deliver it to the focus window */ - FixUpEventFromWindow(xE, focus, None, FALSE); - if (xE->u.u.type & EXTENSION_EVENT_BASE) - mskidx = keybd->id; - (void)DeliverEventsToWindow(focus, xE, count, filters[xE->u.u.type], - NullGrab, mskidx); -} - -void -DeliverGrabbedEvent(xE, thisDev, deactivateGrab, count) - register xEvent *xE; - register DeviceIntPtr thisDev; - Bool deactivateGrab; - int count; -{ - register GrabPtr grab = thisDev->grab; - int deliveries = 0; - register DeviceIntPtr dev; - register xEvent *dxE; - - if (grab->ownerEvents) - { - WindowPtr focus; - - if (thisDev->focus) - { - focus = thisDev->focus->win; - if (focus == FollowKeyboardWin) - focus = inputInfo.keyboard->focus->win; - } - else - focus = PointerRootWin; - if (focus == PointerRootWin) - deliveries = DeliverDeviceEvents(sprite.win, xE, grab, NullWindow, - thisDev, count); - else if (focus && (focus == sprite.win || IsParent(focus, sprite.win))) - deliveries = DeliverDeviceEvents(sprite.win, xE, grab, focus, - thisDev, count); - else if (focus) - deliveries = DeliverDeviceEvents(focus, xE, grab, focus, - thisDev, count); - } - if (!deliveries) - { - FixUpEventFromWindow(xE, grab->window, None, TRUE); - deliveries = TryClientEvents(rClient(grab), xE, count, - (Mask)grab->eventMask, - filters[xE->u.u.type], grab); - if (deliveries && (xE->u.u.type == MotionNotify -#ifdef XINPUT - || xE->u.u.type == DeviceMotionNotify -#endif - )) - thisDev->valuator->motionHintWindow = grab->window; - } - if (deliveries && !deactivateGrab && (xE->u.u.type != MotionNotify -#ifdef XINPUT - && xE->u.u.type != DeviceMotionNotify -#endif - )) - switch (thisDev->sync.state) - { - case FREEZE_BOTH_NEXT_EVENT: - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - FreezeThaw(dev, TRUE); - if ((dev->sync.state == FREEZE_BOTH_NEXT_EVENT) && - (CLIENT_BITS(dev->grab->resource) == - CLIENT_BITS(thisDev->grab->resource))) - dev->sync.state = FROZEN_NO_EVENT; - else - dev->sync.other = thisDev->grab; - } - /* fall through */ - case FREEZE_NEXT_EVENT: - thisDev->sync.state = FROZEN_WITH_EVENT; - FreezeThaw(thisDev, TRUE); - if (thisDev->sync.evcount < count) - { - Must_have_memory = TRUE; /* XXX */ - thisDev->sync.event = (xEvent *)xrealloc(thisDev->sync.event, - count*sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ - } - thisDev->sync.evcount = count; - for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++) - *dxE = *xE; - break; - } -} - -void -#ifdef XKB -CoreProcessKeyboardEvent (xE, keybd, count) -#else -ProcessKeyboardEvent (xE, keybd, count) -#endif - register xEvent *xE; - register DeviceIntPtr keybd; - int count; -{ - int key, bit; - register BYTE *kptr; - register int i; - register CARD8 modifiers; - register CARD16 mask; - GrabPtr grab = keybd->grab; - Bool deactivateGrab = FALSE; - register KeyClassPtr keyc = keybd->key; - - if (!syncEvents.playingEvents) - { - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - } - XE_KBPTR.state = (keyc->state | inputInfo.pointer->button->state); - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); - modifiers = keyc->modifierMap[key]; -#ifdef DEBUG - if ((xkbDebugFlags&0x4)&& - ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { - ErrorF("CoreProcessKbdEvent: Key %d %s\n",key, - (xE->u.u.type==KeyPress?"down":"up")); - } -#endif - switch (xE->u.u.type) - { - case KeyPress: - if (*kptr & bit) /* allow ddx to generate multiple downs */ - { - if (!modifiers) - { - xE->u.u.type = KeyRelease; - (*keybd->public.processInputProc)(xE, keybd, count); - xE->u.u.type = KeyPress; - /* release can have side effects, don't fall through */ - (*keybd->public.processInputProc)(xE, keybd, count); - } - return; - } - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr |= bit; - keyc->prev_state = keyc->state; - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) - { - /* This key affects modifier "i" */ - keyc->modifierKeyCount[i]++; - keyc->state |= mask; - modifiers &= ~mask; - } - } - if (!grab && CheckDeviceGrabs(keybd, xE, 0, count)) - { - keybd->activatingKey = key; - return; - } - break; - case KeyRelease: - if (!(*kptr & bit)) /* guard against duplicates */ - return; - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr &= ~bit; - keyc->prev_state = keyc->state; - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) { - /* This key affects modifier "i" */ - if (--keyc->modifierKeyCount[i] <= 0) { - keyc->state &= ~mask; - keyc->modifierKeyCount[i] = 0; - } - modifiers &= ~mask; - } - } - if (keybd->fromPassiveGrab && (key == keybd->activatingKey)) - deactivateGrab = TRUE; - break; - default: - FatalError("Impossible keyboard event"); - } - if (grab) - DeliverGrabbedEvent(xE, keybd, deactivateGrab, count); - else - DeliverFocusedEvent(keybd, xE, sprite.win, count); - if (deactivateGrab) - (*keybd->DeactivateGrab)(keybd); -} - -#ifdef XKB -/* This function is used to set the key pressed or key released state - - this is only used when the pressing of keys does not cause - CoreProcessKeyEvent to be called, as in for example Mouse Keys. -*/ -void -FixKeyState (xE, keybd) - register xEvent *xE; - register DeviceIntPtr keybd; -{ - int key, bit; - register BYTE *kptr; - register KeyClassPtr keyc = keybd->key; - - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); -#ifdef DEBUG - if ((xkbDebugFlags&0x4)&& - ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { - ErrorF("FixKeyState: Key %d %s\n",key, - (xE->u.u.type==KeyPress?"down":"up")); - } -#endif - switch (xE->u.u.type) - { - case KeyPress: - *kptr |= bit; - break; - case KeyRelease: - *kptr &= ~bit; - break; - default: - FatalError("Impossible keyboard event"); - } -} -#endif - -void -#ifdef XKB -CoreProcessPointerEvent (xE, mouse, count) -#else -ProcessPointerEvent (xE, mouse, count) -#endif - register xEvent *xE; - register DeviceIntPtr mouse; - int count; -{ - register GrabPtr grab = mouse->grab; - Bool deactivateGrab = FALSE; - register ButtonClassPtr butc = mouse->button; -#ifdef XKB - XkbSrvInfoPtr xkbi; - - xkbi = inputInfo.keyboard->key->xkbInfo; -#endif - - if (!syncEvents.playingEvents) - NoticeTime(xE) - XE_KBPTR.state = (butc->state | ( -#ifdef XKB - (noXkbExtension ? - inputInfo.keyboard->key->state : - xkbi->state.grab_mods) -#else - inputInfo.keyboard->key->state -#endif - )); - { - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - /* see comment in EnqueueEvents regarding the next three lines */ - if (xE->u.u.type == MotionNotify) - XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - } - if (xE->u.u.type != MotionNotify) - { - register int key; - register BYTE *kptr; - int bit; - - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - - key = xE->u.u.detail; - kptr = &butc->down[key >> 3]; - bit = 1 << (key & 7); - switch (xE->u.u.type) - { - case ButtonPress: - mouse->valuator->motionHintWindow = NullWindow; - if (!(*kptr & bit)) - butc->buttonsDown++; - butc->motionMask = ButtonMotionMask; - *kptr |= bit; -#if !defined(XFree86Server) || !defined(XINPUT) - xE->u.u.detail = butc->map[key]; -#endif - if (xE->u.u.detail == 0) - return; - if (xE->u.u.detail <= 5) - butc->state |= (Button1Mask >> 1) << xE->u.u.detail; - filters[MotionNotify] = Motion_Filter(butc); - if (!grab) - if (CheckDeviceGrabs(mouse, xE, 0, count)) - return; - break; - case ButtonRelease: - mouse->valuator->motionHintWindow = NullWindow; - if (*kptr & bit) - --butc->buttonsDown; - if (!butc->buttonsDown) - butc->motionMask = 0; - *kptr &= ~bit; -#if !defined(XFree86Server) || !defined(XINPUT) - xE->u.u.detail = butc->map[key]; -#endif - if (xE->u.u.detail == 0) - return; - if (xE->u.u.detail <= 5) - butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); - filters[MotionNotify] = Motion_Filter(butc); - if (!butc->state && mouse->fromPassiveGrab) - deactivateGrab = TRUE; - break; - default: - FatalError("bogus pointer event from ddx"); - } - } - else if (!CheckMotion(xE)) - return; - if (grab) - DeliverGrabbedEvent(xE, mouse, deactivateGrab, count); - else - DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, - mouse, count); - if (deactivateGrab) - (*mouse->DeactivateGrab)(mouse); -} - -#define AtMostOneClient \ - (SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask) - -void -RecalculateDeliverableEvents(pWin) - register WindowPtr pWin; -{ - register OtherClients *others; - register WindowPtr pChild; - - pChild = pWin; - while (1) - { - if (pChild->optional) - { - pChild->optional->otherEventMasks = 0; - for (others = wOtherClients(pChild); others; others = others->next) - { - pChild->optional->otherEventMasks |= others->mask; - } - } - pChild->deliverableEvents = pChild->eventMask| - wOtherEventMasks(pChild); - if (pChild->parent) - pChild->deliverableEvents |= - (pChild->parent->deliverableEvents & - ~wDontPropagateMask(pChild) & PropagateMask); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } -} - -int -OtherClientGone(value, id) - pointer value; /* must conform to DeleteType */ - XID id; -{ - register OtherClientsPtr other, prev; - register WindowPtr pWin = (WindowPtr)value; - - prev = 0; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->resource == id) - { - if (prev) - prev->next = other->next; - else - { - if (!(pWin->optional->otherClients = other->next)) - CheckWindowOptionalNeed (pWin); - } - xfree(other); - RecalculateDeliverableEvents(pWin); - return(Success); - } - prev = other; - } - FatalError("client not on event list"); - /*NOTREACHED*/ - return -1; /* make compiler happy */ -} - -int -EventSelectForWindow(pWin, client, mask) - register WindowPtr pWin; - register ClientPtr client; - Mask mask; -{ - Mask check; - OtherClients * others; - - if (mask & ~AllEventMasks) - { - client->errorValue = mask; - return BadValue; - } - check = (mask & AtMostOneClient); - if (check & (pWin->eventMask|wOtherEventMasks(pWin))) - { /* It is illegal for two different - clients to select on any of the - events for AtMostOneClient. However, - it is OK, for some client to - continue selecting on one of those - events. */ - if ((wClient(pWin) != client) && (check & pWin->eventMask)) - return BadAccess; - for (others = wOtherClients (pWin); others; others = others->next) - { - if (!SameClient(others, client) && (check & others->mask)) - return BadAccess; - } - } - if (wClient (pWin) == client) - { - check = pWin->eventMask; -#ifdef SGIMISC - pWin->eventMask = - (mask & ~SGIMiscSpecialDestroyMask) | (pWin->eventMask & SGIMiscSpecialDestroyMask); -#else - pWin->eventMask = mask; -#endif - } - else - { - for (others = wOtherClients (pWin); others; others = others->next) - { - if (SameClient(others, client)) - { - check = others->mask; -#ifdef SGIMISC - mask = (mask & ~SGIMiscSpecialDestroyMask) | (others->mask & SGIMiscSpecialDestroyMask); -#endif - if (mask == 0) - { - FreeResource(others->resource, RT_NONE); - return Success; - } - else - others->mask = mask; - goto maskSet; - } - } - check = 0; - if (!pWin->optional && !MakeWindowOptional (pWin)) - return BadAlloc; - others = (OtherClients *) xalloc(sizeof(OtherClients)); - if (!others) - return BadAlloc; - others->mask = mask; - others->resource = FakeClientID(client->index); - others->next = pWin->optional->otherClients; - pWin->optional->otherClients = others; - if (!AddResource(others->resource, RT_OTHERCLIENT, (pointer)pWin)) - return BadAlloc; - } -maskSet: - if ((inputInfo.pointer->valuator->motionHintWindow == pWin) && - (mask & PointerMotionHintMask) && - !(check & PointerMotionHintMask) && - !inputInfo.pointer->grab) - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - RecalculateDeliverableEvents(pWin); - return Success; -} - -/*ARGSUSED*/ -int -EventSuppressForWindow(pWin, client, mask, checkOptional) - register WindowPtr pWin; - register ClientPtr client; - Mask mask; - Bool *checkOptional; -{ - register int i, free; - - if ((mask & ~PropagateMask) && !permitOldBugs) - { - client->errorValue = mask; - return BadValue; - } - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]--; - if (!mask) - i = 0; - else - { - for (i = DNPMCOUNT, free = 0; --i > 0; ) - { - if (!DontPropagateRefCnts[i]) - free = i; - else if (mask == DontPropagateMasks[i]) - break; - } - if (!i && free) - { - i = free; - DontPropagateMasks[i] = mask; - } - } - if (i || !mask) - { - pWin->dontPropagate = i; - if (i) - DontPropagateRefCnts[i]++; - if (pWin->optional) - { - pWin->optional->dontPropagateMask = mask; - *checkOptional = TRUE; - } - } - else - { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]++; - return BadAlloc; - } - pWin->dontPropagate = 0; - pWin->optional->dontPropagateMask = mask; - } - RecalculateDeliverableEvents(pWin); - return Success; -} - -static WindowPtr -#if NeedFunctionPrototypes -CommonAncestor( - register WindowPtr a, - register WindowPtr b) -#else -CommonAncestor(a, b) - register WindowPtr a, b; -#endif -{ - for (b = b->parent; b; b = b->parent) - if (IsParent(b, a)) return b; - return NullWindow; -} - -static void -#if NeedFunctionPrototypes -EnterLeaveEvent( - int type, - int mode, - int detail, - register WindowPtr pWin, - Window child) -#else -EnterLeaveEvent(type, mode, detail, pWin, child) - int type, mode, detail; - register WindowPtr pWin; - Window child; -#endif -{ - xEvent event; - register DeviceIntPtr keybd = inputInfo.keyboard; - WindowPtr focus; - register DeviceIntPtr mouse = inputInfo.pointer; - register GrabPtr grab = mouse->grab; - Mask mask; - - if ((pWin == mouse->valuator->motionHintWindow) && - (detail != NotifyInferior)) - mouse->valuator->motionHintWindow = NullWindow; - if (grab) - { - mask = (pWin == grab->window) ? grab->eventMask : 0; - if (grab->ownerEvents) - mask |= EventMaskForClient(pWin, rClient(grab)); - } - else - { - mask = pWin->eventMask | wOtherEventMasks(pWin); - } - if (mask & filters[type]) - { - event.u.u.type = type; - event.u.u.detail = detail; - event.u.enterLeave.time = currentTime.milliseconds; - event.u.enterLeave.rootX = sprite.hot.x; - event.u.enterLeave.rootY = sprite.hot.y; - /* Counts on the same initial structure of crossing & button events! */ - FixUpEventFromWindow(&event, pWin, None, FALSE); - /* Enter/Leave events always set child */ - event.u.enterLeave.child = child; - event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ? - ELFlagSameScreen : 0; -#ifdef XKB - if (!noXkbExtension) { - event.u.enterLeave.state = mouse->button->state & 0x1f00; - event.u.enterLeave.state |= - XkbGrabStateFromRec(&keybd->key->xkbInfo->state); - } else -#endif - event.u.enterLeave.state = keybd->key->state | mouse->button->state; - event.u.enterLeave.mode = mode; - focus = keybd->focus->win; - if ((focus != NoneWin) && - ((pWin == focus) || (focus == PointerRootWin) || - IsParent(focus, pWin))) - event.u.enterLeave.flags |= ELFlagFocus; - if (grab) - (void)TryClientEvents(rClient(grab), &event, 1, mask, - filters[type], grab); - else - (void)DeliverEventsToWindow(pWin, &event, 1, filters[type], - NullGrab, 0); - } - if ((type == EnterNotify) && (mask & KeymapStateMask)) - { - xKeymapEvent ke; - -#ifdef XCSECURITY - ClientPtr client = grab ? rClient(grab) - : clients[CLIENT_ID(pWin->drawable.id)]; - if (!SecurityCheckDeviceAccess(client, keybd, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } - else -#endif - memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31); - ke.type = KeymapNotify; - if (grab) - (void)TryClientEvents(rClient(grab), (xEvent *)&ke, 1, mask, - KeymapStateMask, grab); - else - (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1, - KeymapStateMask, NullGrab, 0); - } -} - -static void -#if NeedFunctionPrototypes -EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail) -#else -EnterNotifies(ancestor, child, mode, detail) - WindowPtr ancestor, child; - int mode, detail; -#endif -{ - WindowPtr parent = child->parent; - - if (ancestor == parent) - return; - EnterNotifies(ancestor, parent, mode, detail); - EnterLeaveEvent(EnterNotify, mode, detail, parent, child->drawable.id); -} - -static void -#if NeedFunctionPrototypes -LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail) -#else -LeaveNotifies(child, ancestor, mode, detail) - WindowPtr child, ancestor; - int detail, mode; -#endif -{ - register WindowPtr pWin; - - if (ancestor == child) - return; - for (pWin = child->parent; pWin != ancestor; pWin = pWin->parent) - { - EnterLeaveEvent(LeaveNotify, mode, detail, pWin, child->drawable.id); - child = pWin; - } -} - -static void -#if NeedFunctionPrototypes -DoEnterLeaveEvents(WindowPtr fromWin, WindowPtr toWin, int mode) -#else -DoEnterLeaveEvents(fromWin, toWin, mode) - WindowPtr fromWin, toWin; - int mode; -#endif -{ - if (fromWin == toWin) - return; - if (IsParent(fromWin, toWin)) - { - EnterLeaveEvent(LeaveNotify, mode, NotifyInferior, fromWin, None); - EnterNotifies(fromWin, toWin, mode, NotifyVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyAncestor, toWin, None); - } - else if (IsParent(toWin, fromWin)) - { - EnterLeaveEvent(LeaveNotify, mode, NotifyAncestor, fromWin, None); - LeaveNotifies(fromWin, toWin, mode, NotifyVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyInferior, toWin, None); - } - else - { /* neither fromWin nor toWin is descendent of the other */ - WindowPtr common = CommonAncestor(toWin, fromWin); - /* common == NullWindow ==> different screens */ - EnterLeaveEvent(LeaveNotify, mode, NotifyNonlinear, fromWin, None); - LeaveNotifies(fromWin, common, mode, NotifyNonlinearVirtual); - EnterNotifies(common, toWin, mode, NotifyNonlinearVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyNonlinear, toWin, None); - } -} - -static void -#if NeedFunctionPrototypes -FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin) -#else -FocusEvent(dev, type, mode, detail, pWin) - DeviceIntPtr dev; - int type, mode, detail; - register WindowPtr pWin; -#endif -{ - xEvent event; - -#ifdef XINPUT - if (dev != inputInfo.keyboard) - { - DeviceFocusEvent(dev, type, mode, detail, pWin); - return; - } -#endif - event.u.focus.mode = mode; - event.u.u.type = type; - event.u.u.detail = detail; - event.u.focus.window = pWin->drawable.id; - (void)DeliverEventsToWindow(pWin, &event, 1, filters[type], NullGrab, - 0); - if ((type == FocusIn) && - ((pWin->eventMask | wOtherEventMasks(pWin)) & KeymapStateMask)) - { - xKeymapEvent ke; -#ifdef XCSECURITY - ClientPtr client = clients[CLIENT_ID(pWin->drawable.id)]; - if (!SecurityCheckDeviceAccess(client, dev, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } - else -#endif - memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31); - ke.type = KeymapNotify; - (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1, - KeymapStateMask, NullGrab, 0); - } -} - - /* - * recursive because it is easier - * no-op if child not descended from ancestor - */ -static Bool -#if NeedFunctionPrototypes -FocusInEvents( - DeviceIntPtr dev, - WindowPtr ancestor, WindowPtr child, WindowPtr skipChild, - int mode, int detail, - Bool doAncestor) -#else -FocusInEvents(dev, ancestor, child, skipChild, mode, detail, doAncestor) - DeviceIntPtr dev; - WindowPtr ancestor, child, skipChild; - int mode, detail; - Bool doAncestor; -#endif -{ - if (child == NullWindow) - return ancestor == NullWindow; - if (ancestor == child) - { - if (doAncestor) - FocusEvent(dev, FocusIn, mode, detail, child); - return TRUE; - } - if (FocusInEvents(dev, ancestor, child->parent, skipChild, mode, detail, - doAncestor)) - { - if (child != skipChild) - FocusEvent(dev, FocusIn, mode, detail, child); - return TRUE; - } - return FALSE; -} - -/* dies horribly if ancestor is not an ancestor of child */ -static void -#if NeedFunctionPrototypes -FocusOutEvents( - DeviceIntPtr dev, - WindowPtr child, WindowPtr ancestor, - int mode, int detail, - Bool doAncestor) -#else -FocusOutEvents(dev, child, ancestor, mode, detail, doAncestor) - DeviceIntPtr dev; - WindowPtr child, ancestor; - int mode; - int detail; - Bool doAncestor; -#endif -{ - register WindowPtr pWin; - - for (pWin = child; pWin != ancestor; pWin = pWin->parent) - FocusEvent(dev, FocusOut, mode, detail, pWin); - if (doAncestor) - FocusEvent(dev, FocusOut, mode, detail, ancestor); -} - -void -DoFocusEvents(dev, fromWin, toWin, mode) - DeviceIntPtr dev; - WindowPtr fromWin, toWin; - int mode; -{ - int out, in; /* for holding details for to/from - PointerRoot/None */ - int i; - - if (fromWin == toWin) - return; - out = (fromWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; - in = (toWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; - /* wrong values if neither, but then not referenced */ - - if ((toWin == NullWindow) || (toWin == PointerRootWin)) - { - if ((fromWin == NullWindow) || (fromWin == PointerRootWin)) - { - if (fromWin == PointerRootWin) - FocusOutEvents(dev, sprite.win, ROOT, mode, NotifyPointer, - TRUE); - /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusOut, mode, out, WindowTable[0]); - else -#endif - for (i=0; iparent, NullWindow, mode, - NotifyNonlinearVirtual, FALSE); - } - /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusIn, mode, in, WindowTable[0]); - else -#endif - for (i=0; iparent != NullWindow) - (void)FocusInEvents(dev, ROOT, toWin, toWin, mode, - NotifyNonlinearVirtual, TRUE); - FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin); - if (IsParent(toWin, sprite.win)) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, mode, - NotifyPointer, FALSE); - } - else - { - if (IsParent(toWin, fromWin)) - { - FocusEvent(dev, FocusOut, mode, NotifyAncestor, fromWin); - FocusOutEvents(dev, fromWin->parent, toWin, mode, - NotifyVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyInferior, toWin); - if ((IsParent(toWin, sprite.win)) && - (sprite.win != fromWin) && - (!IsParent(fromWin, sprite.win)) && - (!IsParent(sprite.win, fromWin))) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, - mode, NotifyPointer, FALSE); - } - else - if (IsParent(fromWin, toWin)) - { - if ((IsParent(fromWin, sprite.win)) && - (sprite.win != fromWin) && - (!IsParent(toWin, sprite.win)) && - (!IsParent(sprite.win, toWin))) - FocusOutEvents(dev, sprite.win, fromWin, mode, - NotifyPointer, FALSE); - FocusEvent(dev, FocusOut, mode, NotifyInferior, fromWin); - (void)FocusInEvents(dev, fromWin, toWin, toWin, mode, - NotifyVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyAncestor, toWin); - } - else - { - /* neither fromWin or toWin is child of other */ - WindowPtr common = CommonAncestor(toWin, fromWin); - /* common == NullWindow ==> different screens */ - if (IsParent(fromWin, sprite.win)) - FocusOutEvents(dev, sprite.win, fromWin, mode, - NotifyPointer, FALSE); - FocusEvent(dev, FocusOut, mode, NotifyNonlinear, fromWin); - if (fromWin->parent != NullWindow) - FocusOutEvents(dev, fromWin->parent, common, mode, - NotifyNonlinearVirtual, FALSE); - if (toWin->parent != NullWindow) - (void)FocusInEvents(dev, common, toWin, toWin, mode, - NotifyNonlinearVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin); - if (IsParent(toWin, sprite.win)) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, - mode, NotifyPointer, FALSE); - } - } - } -} - -int -#if NeedFunctionPrototypes -SetInputFocus( - ClientPtr client, - DeviceIntPtr dev, - Window focusID, - CARD8 revertTo, - Time ctime, - Bool followOK) -#else -SetInputFocus(client, dev, focusID, revertTo, ctime, followOK) - ClientPtr client; - DeviceIntPtr dev; - Window focusID; - CARD8 revertTo; - Time ctime; - Bool followOK; -#endif -{ - register FocusClassPtr focus; - register WindowPtr focusWin; - int mode; - TimeStamp time; - - UpdateCurrentTime(); - if ((revertTo != RevertToParent) && - (revertTo != RevertToPointerRoot) && - (revertTo != RevertToNone) && - ((revertTo != RevertToFollowKeyboard) || !followOK)) - { - client->errorValue = revertTo; - return BadValue; - } - time = ClientTimeToServerTime(ctime); - if ((focusID == None) || (focusID == PointerRoot)) - focusWin = (WindowPtr)(long)focusID; - else if ((focusID == FollowKeyboard) && followOK) - focusWin = inputInfo.keyboard->focus->win; - else if (!(focusWin = SecurityLookupWindow(focusID, client, - SecurityReadAccess))) - return BadWindow; - else - { - /* It is a match error to try to set the input focus to an - unviewable window. */ - - if(!focusWin->realized) - return(BadMatch); - } - focus = dev->focus; - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, focus->time) == EARLIER)) - return Success; - mode = (dev->grab) ? NotifyWhileGrabbed : NotifyNormal; - if (focus->win == FollowKeyboardWin) - DoFocusEvents(dev, inputInfo.keyboard->focus->win, focusWin, mode); - else - DoFocusEvents(dev, focus->win, focusWin, mode); - focus->time = time; - focus->revert = revertTo; - if (focusID == FollowKeyboard) - focus->win = FollowKeyboardWin; - else - focus->win = focusWin; - if ((focusWin == NoneWin) || (focusWin == PointerRootWin)) - focus->traceGood = 0; - else - { - int depth = 0; - register WindowPtr pWin; - - for (pWin = focusWin; pWin; pWin = pWin->parent) depth++; - if (depth > focus->traceSize) - { - focus->traceSize = depth+1; - Must_have_memory = TRUE; /* XXX */ - focus->trace = (WindowPtr *)xrealloc(focus->trace, - focus->traceSize * - sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ - } - focus->traceGood = depth; - for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--) - focus->trace[depth] = pWin; - } - return Success; -} - -int -ProcSetInputFocus(client) - ClientPtr client; -{ - REQUEST(xSetInputFocusReq); - - REQUEST_SIZE_MATCH(xSetInputFocusReq); -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) - return Success; -#endif - return SetInputFocus(client, inputInfo.keyboard, stuff->focus, - stuff->revertTo, stuff->time, FALSE); -} - -int -ProcGetInputFocus(client) - ClientPtr client; -{ - xGetInputFocusReply rep; - /* REQUEST(xReq); */ - FocusClassPtr focus = inputInfo.keyboard->focus; - - REQUEST_SIZE_MATCH(xReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (focus->win == NoneWin) - rep.focus = None; - else if (focus->win == PointerRootWin) - rep.focus = PointerRoot; - else rep.focus = focus->win->drawable.id; - rep.revertTo = focus->revert; - WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep); - return Success; -} - -int -ProcGrabPointer(client) - ClientPtr client; -{ - xGrabPointerReply rep; - DeviceIntPtr device = inputInfo.pointer; - GrabPtr grab; - WindowPtr pWin, confineTo; - CursorPtr cursor, oldCursor; - REQUEST(xGrabPointerReq); - TimeStamp time; - - REQUEST_SIZE_MATCH(xGrabPointerReq); - UpdateCurrentTime(); - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue)) - { - client->errorValue = stuff->ownerEvents; - return BadValue; - } - if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (stuff->confineTo == None) - confineTo = NullWindow; - else - { - confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); - if (!confineTo) - return BadWindow; - } - if (stuff->cursor == None) - cursor = NullCursor; - else - { - cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - /* at this point, some sort of reply is guaranteed. */ - time = ClientTimeToServerTime(stuff->time); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - grab = device->grab; - if ((grab) && !SameClient(grab, client)) - rep.status = AlreadyGrabbed; - else if ((!pWin->realized) || - (confineTo && - !(confineTo->realized && BorderSizeNotEmpty(confineTo)))) - rep.status = GrabNotViewable; - else if (device->sync.frozen && - device->sync.other && !SameClient(device->sync.other, client)) - rep.status = GrabFrozen; - else if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, device->grabTime) == EARLIER)) - rep.status = GrabInvalidTime; - else - { - GrabRec tempGrab; - - oldCursor = NullCursor; - if (grab) - { - if (grab->confineTo && !confineTo) - ConfineCursorToWindow(ROOT, FALSE, FALSE); - oldCursor = grab->cursor; - } - tempGrab.cursor = cursor; - tempGrab.resource = client->clientAsMask; - tempGrab.ownerEvents = stuff->ownerEvents; - tempGrab.eventMask = stuff->eventMask; - tempGrab.confineTo = confineTo; - tempGrab.window = pWin; - tempGrab.keyboardMode = stuff->keyboardMode; - tempGrab.pointerMode = stuff->pointerMode; - tempGrab.device = device; - (*device->ActivateGrab)(device, &tempGrab, time, FALSE); - if (oldCursor) - FreeCursor (oldCursor, (Cursor)0); - rep.status = GrabSuccess; - } - WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep); - return Success; -} - -int -ProcChangeActivePointerGrab(client) - ClientPtr client; -{ - DeviceIntPtr device = inputInfo.pointer; - register GrabPtr grab = device->grab; - CursorPtr newCursor, oldCursor; - REQUEST(xChangeActivePointerGrabReq); - TimeStamp time; - - REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); - if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - if (stuff->cursor == None) - newCursor = NullCursor; - else - { - newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!newCursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - if (!grab) - return Success; - if (!SameClient(grab, client)) - return Success; - time = ClientTimeToServerTime(stuff->time); - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, device->grabTime) == EARLIER)) - return Success; - oldCursor = grab->cursor; - grab->cursor = newCursor; - if (newCursor) - newCursor->refcnt++; - PostNewCursor(); - if (oldCursor) - FreeCursor(oldCursor, (Cursor)0); - grab->eventMask = stuff->eventMask; - return Success; -} - -int -ProcUngrabPointer(client) - ClientPtr client; -{ - DeviceIntPtr device = inputInfo.pointer; - GrabPtr grab; - TimeStamp time; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - UpdateCurrentTime(); - grab = device->grab; - time = ClientTimeToServerTime(stuff->id); - if ((CompareTimeStamps(time, currentTime) != LATER) && - (CompareTimeStamps(time, device->grabTime) != EARLIER) && - (grab) && SameClient(grab, client)) - (*device->DeactivateGrab)(device); - return Success; -} - -int -GrabDevice(client, dev, this_mode, other_mode, grabWindow, ownerEvents, ctime, - mask, status) - register ClientPtr client; - register DeviceIntPtr dev; - unsigned this_mode; - unsigned other_mode; - Window grabWindow; - unsigned ownerEvents; - Time ctime; - Mask mask; - CARD8 *status; -{ - register WindowPtr pWin; - register GrabPtr grab; - TimeStamp time; - - UpdateCurrentTime(); - if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync)) - { - client->errorValue = this_mode; - return BadValue; - } - if ((other_mode != GrabModeSync) && (other_mode != GrabModeAsync)) - { - client->errorValue = other_mode; - return BadValue; - } - if ((ownerEvents != xFalse) && (ownerEvents != xTrue)) - { - client->errorValue = ownerEvents; - return BadValue; - } - pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - time = ClientTimeToServerTime(ctime); - grab = dev->grab; - if (grab && !SameClient(grab, client)) - *status = AlreadyGrabbed; - else if (!pWin->realized) - *status = GrabNotViewable; - else if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, dev->grabTime) == EARLIER)) - *status = GrabInvalidTime; - else if (dev->sync.frozen && - dev->sync.other && !SameClient(dev->sync.other, client)) - *status = GrabFrozen; - else - { - GrabRec tempGrab; - - tempGrab.window = pWin; - tempGrab.resource = client->clientAsMask; - tempGrab.ownerEvents = ownerEvents; - tempGrab.keyboardMode = this_mode; - tempGrab.pointerMode = other_mode; - tempGrab.eventMask = mask; - tempGrab.device = dev; - (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE); - *status = GrabSuccess; - } - return Success; -} - -int -ProcGrabKeyboard(client) - ClientPtr client; -{ - xGrabKeyboardReply rep; - REQUEST(xGrabKeyboardReq); - int result; - - REQUEST_SIZE_MATCH(xGrabKeyboardReq); -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) - { - result = Success; - rep.status = AlreadyGrabbed; - } - else -#endif - result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode, - stuff->pointerMode, stuff->grabWindow, - stuff->ownerEvents, stuff->time, - KeyPressMask | KeyReleaseMask, &rep.status); - if (result != Success) - return result; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep); - return Success; -} - -int -ProcUngrabKeyboard(client) - ClientPtr client; -{ - DeviceIntPtr device = inputInfo.keyboard; - GrabPtr grab; - TimeStamp time; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - UpdateCurrentTime(); - grab = device->grab; - time = ClientTimeToServerTime(stuff->id); - if ((CompareTimeStamps(time, currentTime) != LATER) && - (CompareTimeStamps(time, device->grabTime) != EARLIER) && - (grab) && SameClient(grab, client)) - (*device->DeactivateGrab)(device); - return Success; -} - -int -ProcQueryPointer(client) - ClientPtr client; -{ - xQueryPointerReply rep; - WindowPtr pWin, t; - REQUEST(xResourceReq); - DeviceIntPtr mouse = inputInfo.pointer; - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (mouse->valuator->motionHintWindow) - MaybeStopHint(mouse, client); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.mask = mouse->button->state | inputInfo.keyboard->key->state; - rep.length = 0; - rep.root = (ROOT)->drawable.id; - rep.rootX = sprite.hot.x; - rep.rootY = sprite.hot.y; - rep.child = None; - if (sprite.hot.pScreen == pWin->drawable.pScreen) - { - rep.sameScreen = xTrue; - rep.winX = sprite.hot.x - pWin->drawable.x; - rep.winY = sprite.hot.y - pWin->drawable.y; - for (t = sprite.win; t; t = t->parent) - if (t->parent == pWin) - { - rep.child = t->drawable.id; - break; - } - } - else - { - rep.sameScreen = xFalse; - rep.winX = 0; - rep.winY = 0; - } - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - rep.rootX += panoramiXdataPtr[0].x; - rep.rootY += panoramiXdataPtr[0].y; - if(stuff->id == rep.root) { - rep.winX += panoramiXdataPtr[0].x; - rep.winY += panoramiXdataPtr[0].y; - } - } -#endif - - WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep); - - return(Success); -} - -void -InitEvents() -{ - int i; - - sprite.hot.pScreen = sprite.hotPhys.pScreen = (ScreenPtr)NULL; - inputInfo.numDevices = 0; - inputInfo.devices = (DeviceIntPtr)NULL; - inputInfo.off_devices = (DeviceIntPtr)NULL; - inputInfo.keyboard = (DeviceIntPtr)NULL; - inputInfo.pointer = (DeviceIntPtr)NULL; - if (spriteTraceSize == 0) - { - spriteTraceSize = 32; - spriteTrace = (WindowPtr *)xalloc(32*sizeof(WindowPtr)); - if (!spriteTrace) - FatalError("failed to allocate spriteTrace"); - } - spriteTraceGood = 0; - lastEventMask = OwnerGrabButtonMask; - filters[MotionNotify] = PointerMotionMask; - sprite.win = NullWindow; - sprite.current = NullCursor; - sprite.hotLimits.x1 = 0; - sprite.hotLimits.y1 = 0; - sprite.hotLimits.x2 = 0; - sprite.hotLimits.y2 = 0; - sprite.confined = FALSE; - syncEvents.replayDev = (DeviceIntPtr)NULL; - syncEvents.replayWin = NullWindow; - while (syncEvents.pending) - { - QdEventPtr next = syncEvents.pending->next; - xfree(syncEvents.pending); - syncEvents.pending = next; - } - syncEvents.pendtail = &syncEvents.pending; - syncEvents.playingEvents = FALSE; - syncEvents.time.months = 0; - syncEvents.time.milliseconds = 0; /* hardly matters */ - currentTime.months = 0; - currentTime.milliseconds = GetTimeInMillis(); - lastDeviceEventTime = currentTime; - for (i = 0; i < DNPMCOUNT; i++) - { - DontPropagateMasks[i] = 0; - DontPropagateRefCnts[i] = 0; - } -} - -void -CloseDownEvents(void) -{ - xfree(spriteTrace); - spriteTrace = NULL; - spriteTraceSize = 0; -} - -int -ProcSendEvent(client) - ClientPtr client; -{ - WindowPtr pWin; - WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */ - REQUEST(xSendEventReq); - - REQUEST_SIZE_MATCH(xSendEventReq); - - /* The client's event type must be a core event type or one defined by an - extension. */ - - -#ifdef NXAGENT_CLIPBOARD - - if (stuff -> event.u.u.type == SelectionNotify) - { - extern int nxagentSendNotify(xEvent*); - if (nxagentSendNotify(&stuff->event) == 1) - return Success; - } -#endif - - if ( ! ((stuff->event.u.u.type > X_Reply && - stuff->event.u.u.type < LASTEvent) || - (stuff->event.u.u.type >= EXTENSION_EVENT_BASE && - stuff->event.u.u.type < (unsigned)lastEvent))) - { - client->errorValue = stuff->event.u.u.type; - return BadValue; - } - if (stuff->event.u.u.type == ClientMessage && - stuff->event.u.u.detail != 8 && - stuff->event.u.u.detail != 16 && - stuff->event.u.u.detail != 32 && - !permitOldBugs) - { - client->errorValue = stuff->event.u.u.detail; - return BadValue; - } - if ((stuff->eventMask & ~AllEventMasks) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - - if (stuff->destination == PointerWindow) - pWin = sprite.win; - else if (stuff->destination == InputFocus) - { - WindowPtr inputFocus = inputInfo.keyboard->focus->win; - - if (inputFocus == NoneWin) - return Success; - - /* If the input focus is PointerRootWin, send the event to where - the pointer is if possible, then perhaps propogate up to root. */ - if (inputFocus == PointerRootWin) - inputFocus = ROOT; - - if (IsParent(inputFocus, sprite.win)) - { - effectiveFocus = inputFocus; - pWin = sprite.win; - } - else - effectiveFocus = pWin = inputFocus; - } - else - pWin = SecurityLookupWindow(stuff->destination, client, - SecurityReadAccess); - if (!pWin) - return BadWindow; - if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) - { - client->errorValue = stuff->propagate; - return BadValue; - } - stuff->event.u.u.type |= 0x80; - if (stuff->propagate) - { - for (;pWin; pWin = pWin->parent) - { - if (DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask, - NullGrab, 0)) - return Success; - if (pWin == effectiveFocus) - return Success; - stuff->eventMask &= ~wDontPropagateMask(pWin); - if (!stuff->eventMask) - break; - } - } - else - (void)DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask, - NullGrab, 0); - return Success; -} - -int -ProcUngrabKey(client) - ClientPtr client; -{ - REQUEST(xUngrabKeyReq); - WindowPtr pWin; - GrabRec tempGrab; - DeviceIntPtr keybd = inputInfo.keyboard; - - REQUEST_SIZE_MATCH(xUngrabKeyReq); - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - - if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) || - (stuff->key < keybd->key->curKeySyms.minKeyCode)) - && (stuff->key != AnyKey)) - { - client->errorValue = stuff->key; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - tempGrab.resource = client->clientAsMask; - tempGrab.device = keybd; - tempGrab.window = pWin; - tempGrab.modifiersDetail.exact = stuff->modifiers; - tempGrab.modifiersDetail.pMask = NULL; - tempGrab.modifierDevice = inputInfo.keyboard; - tempGrab.type = KeyPress; - tempGrab.detail.exact = stuff->key; - tempGrab.detail.pMask = NULL; - - if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); -} - -int -ProcGrabKey(client) - ClientPtr client; -{ - WindowPtr pWin; - REQUEST(xGrabKeyReq); - GrabPtr grab; - DeviceIntPtr keybd = inputInfo.keyboard; - - REQUEST_SIZE_MATCH(xGrabKeyReq); - if ((stuff->ownerEvents != xTrue) && (stuff->ownerEvents != xFalse)) - { - client->errorValue = stuff->ownerEvents; - return(BadValue); - } - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) || - (stuff->key < keybd->key->curKeySyms.minKeyCode)) - && (stuff->key != AnyKey)) - { - client->errorValue = stuff->key; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - - grab = CreateGrab(client->index, keybd, pWin, - (Mask)(KeyPressMask | KeyReleaseMask), (Bool)stuff->ownerEvents, - (Bool)stuff->keyboardMode, (Bool)stuff->pointerMode, - keybd, stuff->modifiers, KeyPress, stuff->key, - NullWindow, NullCursor); - if (!grab) - return BadAlloc; - return AddPassiveGrabToList(grab); -} - - -int -ProcGrabButton(client) - ClientPtr client; -{ - WindowPtr pWin, confineTo; - REQUEST(xGrabButtonReq); - CursorPtr cursor; - GrabPtr grab; - - REQUEST_SIZE_MATCH(xGrabButtonReq); - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue)) - { - client->errorValue = stuff->ownerEvents; - return BadValue; - } - if (stuff->eventMask & ~PointerGrabMask) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (stuff->confineTo == None) - confineTo = NullWindow; - else { - confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); - if (!confineTo) - return BadWindow; - } - if (stuff->cursor == None) - cursor = NullCursor; - else - { - cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - - - grab = CreateGrab(client->index, inputInfo.pointer, pWin, - permitOldBugs ? (Mask)(stuff->eventMask | - ButtonPressMask | ButtonReleaseMask) : - (Mask)stuff->eventMask, - (Bool)stuff->ownerEvents, (Bool) stuff->keyboardMode, - (Bool)stuff->pointerMode, inputInfo.keyboard, stuff->modifiers, - ButtonPress, stuff->button, confineTo, cursor); - if (!grab) - return BadAlloc; - return AddPassiveGrabToList(grab); -} - -int -ProcUngrabButton(client) - ClientPtr client; -{ - REQUEST(xUngrabButtonReq); - WindowPtr pWin; - GrabRec tempGrab; - - REQUEST_SIZE_MATCH(xUngrabButtonReq); - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - tempGrab.resource = client->clientAsMask; - tempGrab.device = inputInfo.pointer; - tempGrab.window = pWin; - tempGrab.modifiersDetail.exact = stuff->modifiers; - tempGrab.modifiersDetail.pMask = NULL; - tempGrab.modifierDevice = inputInfo.keyboard; - tempGrab.type = ButtonPress; - tempGrab.detail.exact = stuff->button; - tempGrab.detail.pMask = NULL; - - if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); -} - -void -DeleteWindowFromAnyEvents(pWin, freeResources) - WindowPtr pWin; - Bool freeResources; -{ - WindowPtr parent; - DeviceIntPtr mouse = inputInfo.pointer; - DeviceIntPtr keybd = inputInfo.keyboard; - FocusClassPtr focus = keybd->focus; - OtherClientsPtr oc; - GrabPtr passive; - - - /* Deactivate any grabs performed on this window, before making any - input focus changes. */ - - if (mouse->grab && - ((mouse->grab->window == pWin) || (mouse->grab->confineTo == pWin))) - (*mouse->DeactivateGrab)(mouse); - - /* Deactivating a keyboard grab should cause focus events. */ - - if (keybd->grab && (keybd->grab->window == pWin)) - (*keybd->DeactivateGrab)(keybd); - - /* If the focus window is a root window (ie. has no parent) then don't - delete the focus from it. */ - - if ((pWin == focus->win) && (pWin->parent != NullWindow)) - { - int focusEventMode = NotifyNormal; - - /* If a grab is in progress, then alter the mode of focus events. */ - - if (keybd->grab) - focusEventMode = NotifyWhileGrabbed; - - switch (focus->revert) - { - case RevertToNone: - DoFocusEvents(keybd, pWin, NoneWin, focusEventMode); - focus->win = NoneWin; - focus->traceGood = 0; - break; - case RevertToParent: - parent = pWin; - do - { - parent = parent->parent; - focus->traceGood--; - } while (!parent->realized -/* This would be a good protocol change -- windows being reparented - during SaveSet processing would cause the focus to revert to the - nearest enclosing window which will survive the death of the exiting - client, instead of ending up reverting to a dying window and thence - to None - */ -#ifdef NOTDEF - || clients[CLIENT_ID(parent->drawable.id)]->clientGone -#endif - ); - DoFocusEvents(keybd, pWin, parent, focusEventMode); - focus->win = parent; - focus->revert = RevertToNone; - break; - case RevertToPointerRoot: - DoFocusEvents(keybd, pWin, PointerRootWin, focusEventMode); - focus->win = PointerRootWin; - focus->traceGood = 0; - break; - } - } - - if (mouse->valuator->motionHintWindow == pWin) - mouse->valuator->motionHintWindow = NullWindow; - - if (freeResources) - { - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]--; - while ( (oc = wOtherClients(pWin)) ) - FreeResource(oc->resource, RT_NONE); - while ( (passive = wPassiveGrabs(pWin)) ) - FreeResource(passive->resource, RT_NONE); - } -#ifdef XINPUT - DeleteWindowFromAnyExtEvents(pWin, freeResources); -#endif -} - -/* Call this whenever some window at or below pWin has changed geometry */ - -/*ARGSUSED*/ -void -CheckCursorConfinement(pWin) - WindowPtr pWin; -{ - GrabPtr grab = inputInfo.pointer->grab; - WindowPtr confineTo; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return; -#endif - - if (grab && (confineTo = grab->confineTo)) - { - if (!BorderSizeNotEmpty(confineTo)) - (*inputInfo.pointer->DeactivateGrab)(inputInfo.pointer); - else if ((pWin == confineTo) || IsParent(pWin, confineTo)) - ConfineCursorToWindow(confineTo, TRUE, TRUE); - } -} - -Mask -EventMaskForClient(pWin, client) - WindowPtr pWin; - ClientPtr client; -{ - register OtherClientsPtr other; - - if (wClient (pWin) == client) - return pWin->eventMask; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (SameClient(other, client)) - return other->mask; - } - return 0; -} - -int -ProcRecolorCursor(client) - ClientPtr client; -{ - CursorPtr pCursor; - int nscr; - ScreenPtr pscr; - Bool displayed; - REQUEST(xRecolorCursorReq); - - REQUEST_SIZE_MATCH(xRecolorCursorReq); - pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityWriteAccess); - if ( !pCursor) - { - client->errorValue = stuff->cursor; - return (BadCursor); - } - - pCursor->foreRed = stuff->foreRed; - pCursor->foreGreen = stuff->foreGreen; - pCursor->foreBlue = stuff->foreBlue; - - pCursor->backRed = stuff->backRed; - pCursor->backGreen = stuff->backGreen; - pCursor->backBlue = stuff->backBlue; - - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) - { - pscr = screenInfo.screens[nscr]; -#ifdef PANORAMIX - if(!noPanoramiXExtension) - displayed = (pscr == sprite.screen); - else -#endif - displayed = (pscr == sprite.hotPhys.pScreen); - ( *pscr->RecolorCursor)(pscr, pCursor, - (pCursor == sprite.current) && displayed); - } - return (Success); -} - -void -WriteEventsToClient(pClient, count, events) - ClientPtr pClient; - int count; - xEvent *events; -{ -#ifdef PANORAMIX - xEvent eventCopy; -#endif - xEvent eventTo, *eventFrom; - int i; - -#ifdef XKB - if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events))) - return; -#endif - -#ifdef PANORAMIX - if(!noPanoramiXExtension && - (panoramiXdataPtr[0].x || panoramiXdataPtr[0].y)) - { - switch(events->u.u.type) { - case MotionNotify: - case ButtonPress: - case ButtonRelease: - case KeyPress: - case KeyRelease: - case EnterNotify: - case LeaveNotify: - /* - When multiple clients want the same event DeliverEventsToWindow - passes the same event structure multiple times so we can't - modify the one passed to us - */ - count = 1; /* should always be 1 */ - memcpy(&eventCopy, events, sizeof(xEvent)); - eventCopy.u.keyButtonPointer.rootX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.rootY += panoramiXdataPtr[0].y; - if(eventCopy.u.keyButtonPointer.event == - eventCopy.u.keyButtonPointer.root) - { - eventCopy.u.keyButtonPointer.eventX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.eventY += panoramiXdataPtr[0].y; - } - events = &eventCopy; - break; - default: break; - } - } -#endif - - if (EventCallback) - { - EventInfoRec eventinfo; - eventinfo.client = pClient; - eventinfo.events = events; - eventinfo.count = count; - CallCallbacks(&EventCallback, (pointer)&eventinfo); - } - if(pClient->swapped) - { - for(i = 0; i < count; i++) - { - eventFrom = &events[i]; - /* Remember to strip off the leading bit of type in case - this event was sent with "SendEvent." */ - (*EventSwapVector[eventFrom->u.u.type & 0177]) - (eventFrom, &eventTo); - (void)WriteToClient(pClient, sizeof(xEvent), (char *)&eventTo); - } - } - else - { - (void)WriteToClient(pClient, count * sizeof(xEvent), (char *) events); - } -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.XF86.original deleted file mode 100644 index ce8e53f92..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.XF86.original +++ /dev/null @@ -1,4637 +0,0 @@ -/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.46 2002/09/17 01:15:09 dawes Exp $ */ -/************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* The panoramix components contained the following notice */ -/**************************************************************** -* * -* Copyright (c) Digital Equipment Corporation, 1991, 1997 * -* * -* All Rights Reserved. Unpublished rights reserved under * -* the copyright laws of the United States. * -* * -* The software contained on this media is proprietary to * -* and embodies the confidential technology of Digital * -* Equipment Corporation. Possession, use, duplication or * -* dissemination of the software and media is authorized only * -* pursuant to a valid written license from Digital Equipment * -* Corporation. * -* * -* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure * -* by the U.S. Government is subject to restrictions as set * -* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, * -* or in FAR 52.227-19, as applicable. * -* * -*****************************************************************/ - -/* $Xorg: events.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" -#include "misc.h" -#include "resource.h" -#define NEED_EVENTS -#define NEED_REPLIES -#include "Xproto.h" -#include "windowstr.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "cursorstr.h" - -#include "dixstruct.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include "globals.h" - -#ifdef XKB -#include "XKBsrv.h" -#if NeedFunctionPrototypes -extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); -#else -extern Bool XkbFilterEvents(); -#endif -#endif - -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif - -#include "XIproto.h" -#include "exevents.h" -#include "extnsionst.h" - -#include "dixevents.h" -#include "dixgrabs.h" -#include "dispatch.h" - -#define EXTENSION_EVENT_BASE 64 - -#define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */ -#define StructureAndSubMask ( StructureNotifyMask | SubstructureNotifyMask ) -#define AllButtonsMask ( \ - Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask ) -#define MotionMask ( \ - PointerMotionMask | Button1MotionMask | \ - Button2MotionMask | Button3MotionMask | Button4MotionMask | \ - Button5MotionMask | ButtonMotionMask ) -#define PropagateMask ( \ - KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \ - MotionMask ) -#define PointerGrabMask ( \ - ButtonPressMask | ButtonReleaseMask | \ - EnterWindowMask | LeaveWindowMask | \ - PointerMotionHintMask | KeymapStateMask | \ - MotionMask ) -#define AllModifiersMask ( \ - ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ - Mod3Mask | Mod4Mask | Mod5Mask ) -#define AllEventMasks (lastEventMask|(lastEventMask-1)) -/* - * The following relies on the fact that the ButtonMotionMasks are equal - * to the corresponding ButtonMasks from the current modifier/button state. - */ -#define Motion_Filter(class) (PointerMotionMask | \ - (class)->state | (class)->motionMask) - - -#define WID(w) ((w) ? ((w)->drawable.id) : 0) - -#define XE_KBPTR (xE->u.keyButtonPointer) - - -#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) - -CallbackListPtr EventCallback; -CallbackListPtr DeviceEventCallback; - -#define DNPMCOUNT 8 - -Mask DontPropagateMasks[DNPMCOUNT]; -static int DontPropagateRefCnts[DNPMCOUNT]; - -#ifdef DEBUG -static debug_events = 0; -#endif -InputInfo inputInfo; - -static struct { - QdEventPtr pending, *pendtail; - DeviceIntPtr replayDev; /* kludgy rock to put flag for */ - WindowPtr replayWin; /* ComputeFreezes */ - Bool playingEvents; - TimeStamp time; -} syncEvents; - -/* - * The window trace information is used to avoid having to compute all the - * windows between the root and the current pointer window each time a button - * or key goes down. The grabs on each of those windows must be checked. - */ -static WindowPtr *spriteTrace = (WindowPtr *)NULL; -#define ROOT spriteTrace[0] -static int spriteTraceSize = 0; -static int spriteTraceGood; - -typedef struct { - int x, y; - ScreenPtr pScreen; -} HotSpot; - -static struct { - CursorPtr current; - BoxRec hotLimits; /* logical constraints of hot spot */ - Bool confined; /* confined to screen */ -#if defined(SHAPE) || defined(PANORAMIX) - RegionPtr hotShape; /* additional logical shape constraint */ -#endif - BoxRec physLimits; /* physical constraints of hot spot */ - WindowPtr win; /* window of logical position */ - HotSpot hot; /* logical pointer position */ - HotSpot hotPhys; /* physical pointer position */ -#ifdef PANORAMIX - ScreenPtr screen; /* all others are in Screen 0 coordinates */ - RegionRec Reg1; /* Region 1 for confining motion */ - RegionRec Reg2; /* Region 2 for confining virtual motion */ - WindowPtr windows[MAXSCREENS]; - WindowPtr confineWin; /* confine window */ -#endif -} sprite; /* info about the cursor sprite */ - -static void DoEnterLeaveEvents( -#if NeedFunctionPrototypes - WindowPtr /*fromWin*/, - WindowPtr /*toWin*/, - int /*mode*/ -#endif -); - -static WindowPtr XYToWindow( -#if NeedFunctionPrototypes - int /*x*/, - int /*y*/ -#endif -); - -extern int lastEvent; - -static Mask lastEventMask; - -#ifdef XINPUT -extern int DeviceMotionNotify; -#endif - -#define CantBeFiltered NoEventMask -static Mask filters[128] = -{ - NoSuchEvent, /* 0 */ - NoSuchEvent, /* 1 */ - KeyPressMask, /* KeyPress */ - KeyReleaseMask, /* KeyRelease */ - ButtonPressMask, /* ButtonPress */ - ButtonReleaseMask, /* ButtonRelease */ - PointerMotionMask, /* MotionNotify (initial state) */ - EnterWindowMask, /* EnterNotify */ - LeaveWindowMask, /* LeaveNotify */ - FocusChangeMask, /* FocusIn */ - FocusChangeMask, /* FocusOut */ - KeymapStateMask, /* KeymapNotify */ - ExposureMask, /* Expose */ - CantBeFiltered, /* GraphicsExpose */ - CantBeFiltered, /* NoExpose */ - VisibilityChangeMask, /* VisibilityNotify */ - SubstructureNotifyMask, /* CreateNotify */ - StructureAndSubMask, /* DestroyNotify */ - StructureAndSubMask, /* UnmapNotify */ - StructureAndSubMask, /* MapNotify */ - SubstructureRedirectMask, /* MapRequest */ - StructureAndSubMask, /* ReparentNotify */ - StructureAndSubMask, /* ConfigureNotify */ - SubstructureRedirectMask, /* ConfigureRequest */ - StructureAndSubMask, /* GravityNotify */ - ResizeRedirectMask, /* ResizeRequest */ - StructureAndSubMask, /* CirculateNotify */ - SubstructureRedirectMask, /* CirculateRequest */ - PropertyChangeMask, /* PropertyNotify */ - CantBeFiltered, /* SelectionClear */ - CantBeFiltered, /* SelectionRequest */ - CantBeFiltered, /* SelectionNotify */ - ColormapChangeMask, /* ColormapNotify */ - CantBeFiltered, /* ClientMessage */ - CantBeFiltered /* MappingNotify */ -}; - -static CARD8 criticalEvents[32] = -{ - 0x7c /* key and button events */ -}; - -#ifdef PANORAMIX - -static void ConfineToShape(RegionPtr shape, int *px, int *py); -static void SyntheticMotion(int x, int y); -static void PostNewCursor(void); - -static Bool -XineramaSetCursorPosition( - int x, - int y, - Bool generateEvent -){ - ScreenPtr pScreen; - BoxRec box; - int i; - - /* x,y are in Screen 0 coordinates. We need to decide what Screen - to send the message too and what the coordinates relative to - that screen are. */ - - pScreen = sprite.screen; - x += panoramiXdataPtr[0].x; - y += panoramiXdataPtr[0].y; - - if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], - x, y, &box)) - { - FOR_NSCREENS(i) - { - if(i == pScreen->myNum) - continue; - if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box)) - { - pScreen = screenInfo.screens[i]; - break; - } - } - } - - sprite.screen = pScreen; - sprite.hotPhys.x = x - panoramiXdataPtr[0].x; - sprite.hotPhys.y = y - panoramiXdataPtr[0].y; - x -= panoramiXdataPtr[pScreen->myNum].x; - y -= panoramiXdataPtr[pScreen->myNum].y; - - return (*pScreen->SetCursorPosition)(pScreen, x, y, generateEvent); -} - - -static void -XineramaConstrainCursor(void) -{ - ScreenPtr pScreen = sprite.screen; - BoxRec newBox = sprite.physLimits; - - /* Translate the constraining box to the screen - the sprite is actually on */ - newBox.x1 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; - newBox.x2 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; - newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; - newBox.y2 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; - - (* pScreen->ConstrainCursor)(pScreen, &newBox); -} - -static void -XineramaCheckPhysLimits( - CursorPtr cursor, - Bool generateEvents -){ - HotSpot new; - - if (!cursor) - return; - - new = sprite.hotPhys; - - /* I don't care what the DDX has to say about it */ - sprite.physLimits = sprite.hotLimits; - - /* constrain the pointer to those limits */ - if (new.x < sprite.physLimits.x1) - new.x = sprite.physLimits.x1; - else - if (new.x >= sprite.physLimits.x2) - new.x = sprite.physLimits.x2 - 1; - if (new.y < sprite.physLimits.y1) - new.y = sprite.physLimits.y1; - else - if (new.y >= sprite.physLimits.y2) - new.y = sprite.physLimits.y2 - 1; - - if (sprite.hotShape) /* more work if the shape is a mess */ - ConfineToShape(sprite.hotShape, &new.x, &new.y); - - if((new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y)) - { - XineramaSetCursorPosition (new.x, new.y, generateEvents); - if (!generateEvents) - SyntheticMotion(new.x, new.y); - } - - /* Tell DDX what the limits are */ - XineramaConstrainCursor(); -} - - -static Bool -XineramaSetWindowPntrs(WindowPtr pWin) -{ - if(pWin == WindowTable[0]) { - memcpy(sprite.windows, WindowTable, - PanoramiXNumScreens*sizeof(WindowPtr)); - } else { - PanoramiXRes *win; - int i; - - win = (PanoramiXRes*)LookupIDByType(pWin->drawable.id, XRT_WINDOW); - - if(!win) - return FALSE; - - for(i = 0; i < PanoramiXNumScreens; i++) { - sprite.windows[i] = LookupIDByType(win->info[i].id, RT_WINDOW); - if(!sprite.windows[i]) /* window is being unmapped */ - return FALSE; - } - } - return TRUE; -} - -static void -XineramaCheckVirtualMotion( - QdEventPtr qe, - WindowPtr pWin -){ - - if (qe) - { - sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */ - sprite.hot.x = qe->event->u.keyButtonPointer.rootX; - sprite.hot.y = qe->event->u.keyButtonPointer.rootY; - pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo : - NullWindow; - } - if (pWin) - { - int x, y, off_x, off_y, i; - BoxRec lims; - - if(!XineramaSetWindowPntrs(pWin)) - return; - - i = PanoramiXNumScreens - 1; - - REGION_COPY(sprite.screen, &sprite.Reg2, - &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - - while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; - - if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y); - - REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2, - &sprite.windows[i]->borderSize); - - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - } - - lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2); - - if (sprite.hot.x < lims.x1) - sprite.hot.x = lims.x1; - else if (sprite.hot.x >= lims.x2) - sprite.hot.x = lims.x2 - 1; - if (sprite.hot.y < lims.y1) - sprite.hot.y = lims.y1; - else if (sprite.hot.y >= lims.y2) - sprite.hot.y = lims.y2 - 1; - - if (REGION_NUM_RECTS(&sprite.Reg2) > 1) - ConfineToShape(&sprite.Reg2, &sprite.hot.x, &sprite.hot.y); - - if (qe) - { - qe->pScreen = sprite.hot.pScreen; - qe->event->u.keyButtonPointer.rootX = sprite.hot.x; - qe->event->u.keyButtonPointer.rootY = sprite.hot.y; - } - } -} - - -static Bool -XineramaCheckMotion(xEvent *xE) -{ - WindowPtr prevSpriteWin = sprite.win; - - if (xE && !syncEvents.playingEvents) - { - /* Motion events entering DIX get translated to Screen 0 - coordinates. Replayed events have already been - translated since they've entered DIX before */ - XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x - - panoramiXdataPtr[0].x; - XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y - - panoramiXdataPtr[0].y; - - sprite.hot.x = XE_KBPTR.rootX; - sprite.hot.y = XE_KBPTR.rootY; - if (sprite.hot.x < sprite.physLimits.x1) - sprite.hot.x = sprite.physLimits.x1; - else if (sprite.hot.x >= sprite.physLimits.x2) - sprite.hot.x = sprite.physLimits.x2 - 1; - if (sprite.hot.y < sprite.physLimits.y1) - sprite.hot.y = sprite.physLimits.y1; - else if (sprite.hot.y >= sprite.physLimits.y2) - sprite.hot.y = sprite.physLimits.y2 - 1; - - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); - - sprite.hotPhys = sprite.hot; - if ((sprite.hotPhys.x != XE_KBPTR.rootX) || - (sprite.hotPhys.y != XE_KBPTR.rootY)) - { - XineramaSetCursorPosition( - sprite.hotPhys.x, sprite.hotPhys.y, FALSE); - } - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - } - - sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); - - if (sprite.win != prevSpriteWin) - { - if (prevSpriteWin != NullWindow) { - if (!xE) - UpdateCurrentTimeIf(); - DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); - } - PostNewCursor(); - return FALSE; - } - return TRUE; -} - - -static void -XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents) -{ - - if (syncEvents.playingEvents) - { - XineramaCheckVirtualMotion((QdEventPtr)NULL, pWin); - SyntheticMotion(sprite.hot.x, sprite.hot.y); - } - else - { - int x, y, off_x, off_y, i; - - if(!XineramaSetWindowPntrs(pWin)) - return; - - i = PanoramiXNumScreens - 1; - - REGION_COPY(sprite.screen, &sprite.Reg1, - &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - - while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; - - if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y); - - REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1, - &sprite.windows[i]->borderSize); - - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - } - - sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1); - - if(REGION_NUM_RECTS(&sprite.Reg1) > 1) - sprite.hotShape = &sprite.Reg1; - else - sprite.hotShape = NullRegion; - - sprite.confined = FALSE; - sprite.confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin; - - XineramaCheckPhysLimits(sprite.current, generateEvents); - } -} - - -static void -XineramaChangeToCursor(CursorPtr cursor) -{ - if (cursor != sprite.current) - { - if ((sprite.current->bits->xhot != cursor->bits->xhot) || - (sprite.current->bits->yhot != cursor->bits->yhot)) - XineramaCheckPhysLimits(cursor, FALSE); - (*sprite.screen->DisplayCursor)(sprite.screen, cursor); - sprite.current = cursor; - } -} - - -#endif /* PANORAMIX */ - -void -SetMaskForEvent(mask, event) - Mask mask; - int event; -{ - if ((event < LASTEvent) || (event >= 128)) - FatalError("SetMaskForEvent: bogus event number"); - filters[event] = mask; -} - -void -SetCriticalEvent(event) - int event; -{ - if (event >= 128) - FatalError("SetCriticalEvent: bogus event number"); - criticalEvents[event >> 3] |= 1 << (event & 7); -} - -static void -#if NeedFunctionPrototypes -SyntheticMotion(int x, int y) -#else -SyntheticMotion(x, y) - int x, y; -#endif -{ - xEvent xE; - -#ifdef PANORAMIX - /* Translate back to the sprite screen since processInputProc - will translate from sprite screen to screen 0 upon reentry - to the DIX layer */ - if(!noPanoramiXExtension) { - x += panoramiXdataPtr[0].x - panoramiXdataPtr[sprite.screen->myNum].x; - y += panoramiXdataPtr[0].y - panoramiXdataPtr[sprite.screen->myNum].y; - } -#endif - xE.u.keyButtonPointer.rootX = x; - xE.u.keyButtonPointer.rootY = y; - if (syncEvents.playingEvents) - xE.u.keyButtonPointer.time = syncEvents.time.milliseconds; - else - xE.u.keyButtonPointer.time = currentTime.milliseconds; - xE.u.u.type = MotionNotify; - (*inputInfo.pointer->public.processInputProc)(&xE, inputInfo.pointer, 1); -} - -#ifdef SHAPE -static void -#if NeedFunctionPrototypes -ConfineToShape(RegionPtr shape, int *px, int *py) -#else -ConfineToShape(shape, px, py) - RegionPtr shape; - int *px, *py; -#endif -{ - BoxRec box; - int x = *px, y = *py; - int incx = 1, incy = 1; - - if (POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)) - return; - box = *REGION_EXTENTS(sprite.hot.pScreen, shape); - /* this is rather crude */ - do { - x += incx; - if (x >= box.x2) - { - incx = -1; - x = *px - 1; - } - else if (x < box.x1) - { - incx = 1; - x = *px; - y += incy; - if (y >= box.y2) - { - incy = -1; - y = *py - 1; - } - else if (y < box.y1) - return; /* should never get here! */ - } - } while (!POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)); - *px = x; - *py = y; -} -#endif - -static void -#if NeedFunctionPrototypes -CheckPhysLimits( - CursorPtr cursor, - Bool generateEvents, - Bool confineToScreen, - ScreenPtr pScreen) -#else -CheckPhysLimits(cursor, generateEvents, confineToScreen, pScreen) - CursorPtr cursor; - Bool generateEvents; - Bool confineToScreen; - ScreenPtr pScreen; -#endif -{ - HotSpot new; - - if (!cursor) - return; - new = sprite.hotPhys; - if (pScreen) - new.pScreen = pScreen; - else - pScreen = new.pScreen; - (*pScreen->CursorLimits) (pScreen, cursor, &sprite.hotLimits, - &sprite.physLimits); - sprite.confined = confineToScreen; - (* pScreen->ConstrainCursor)(pScreen, &sprite.physLimits); - if (new.x < sprite.physLimits.x1) - new.x = sprite.physLimits.x1; - else - if (new.x >= sprite.physLimits.x2) - new.x = sprite.physLimits.x2 - 1; - if (new.y < sprite.physLimits.y1) - new.y = sprite.physLimits.y1; - else - if (new.y >= sprite.physLimits.y2) - new.y = sprite.physLimits.y2 - 1; -#ifdef SHAPE - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &new.x, &new.y); -#endif - if ((pScreen != sprite.hotPhys.pScreen) || - (new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y)) - { - if (pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys = new; - (*pScreen->SetCursorPosition) (pScreen, new.x, new.y, generateEvents); - if (!generateEvents) - SyntheticMotion(new.x, new.y); - } -} - -static void -#if NeedFunctionPrototypes -CheckVirtualMotion( - register QdEventPtr qe, - register WindowPtr pWin) -#else -CheckVirtualMotion(qe, pWin) - register QdEventPtr qe; - register WindowPtr pWin; -#endif -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaCheckVirtualMotion(qe, pWin); - return; - } -#endif - if (qe) - { - sprite.hot.pScreen = qe->pScreen; - sprite.hot.x = qe->event->u.keyButtonPointer.rootX; - sprite.hot.y = qe->event->u.keyButtonPointer.rootY; - pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo : - NullWindow; - } - if (pWin) - { - BoxRec lims; - - if (sprite.hot.pScreen != pWin->drawable.pScreen) - { - sprite.hot.pScreen = pWin->drawable.pScreen; - sprite.hot.x = sprite.hot.y = 0; - } - lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize); - if (sprite.hot.x < lims.x1) - sprite.hot.x = lims.x1; - else if (sprite.hot.x >= lims.x2) - sprite.hot.x = lims.x2 - 1; - if (sprite.hot.y < lims.y1) - sprite.hot.y = lims.y1; - else if (sprite.hot.y >= lims.y2) - sprite.hot.y = lims.y2 - 1; -#ifdef SHAPE - if (wBoundingShape(pWin)) - ConfineToShape(&pWin->borderSize, &sprite.hot.x, &sprite.hot.y); -#endif - if (qe) - { - qe->pScreen = sprite.hot.pScreen; - qe->event->u.keyButtonPointer.rootX = sprite.hot.x; - qe->event->u.keyButtonPointer.rootY = sprite.hot.y; - } - } - ROOT = WindowTable[sprite.hot.pScreen->myNum]; -} - -static void -ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaConfineCursorToWindow(pWin, generateEvents); - return; - } -#endif - - if (syncEvents.playingEvents) - { - CheckVirtualMotion((QdEventPtr)NULL, pWin); - SyntheticMotion(sprite.hot.x, sprite.hot.y); - } - else - { - sprite.hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize); -#ifdef SHAPE - sprite.hotShape = wBoundingShape(pWin) ? &pWin->borderSize - : NullRegion; -#endif - CheckPhysLimits(sprite.current, generateEvents, confineToScreen, - pScreen); - } -} - -Bool -PointerConfinedToScreen() -{ - return sprite.confined; -} - -static void -#if NeedFunctionPrototypes -ChangeToCursor(CursorPtr cursor) -#else -ChangeToCursor(cursor) - CursorPtr cursor; -#endif -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaChangeToCursor(cursor); - return; - } -#endif - - if (cursor != sprite.current) - { - if ((sprite.current->bits->xhot != cursor->bits->xhot) || - (sprite.current->bits->yhot != cursor->bits->yhot)) - CheckPhysLimits(cursor, FALSE, sprite.confined, - (ScreenPtr)NULL); - (*sprite.hotPhys.pScreen->DisplayCursor) (sprite.hotPhys.pScreen, - cursor); - sprite.current = cursor; - } -} - -/* returns true if b is a descendent of a */ -Bool -IsParent(a, b) - register WindowPtr a, b; -{ - for (b = b->parent; b; b = b->parent) - if (b == a) return TRUE; - return FALSE; -} - -static void -#if NeedFunctionPrototypes -PostNewCursor(void) -#else -PostNewCursor() -#endif -{ - register WindowPtr win; - register GrabPtr grab = inputInfo.pointer->grab; - - if (syncEvents.playingEvents) - return; - if (grab) - { - if (grab->cursor) - { - ChangeToCursor(grab->cursor); - return; - } - if (IsParent(grab->window, sprite.win)) - win = sprite.win; - else - win = grab->window; - } - else - win = sprite.win; - for (; win; win = win->parent) - if (win->optional && win->optional->cursor != NullCursor) - { - ChangeToCursor(win->optional->cursor); - return; - } -} - -WindowPtr -GetCurrentRootWindow() -{ - return ROOT; -} - -WindowPtr -GetSpriteWindow() -{ - return sprite.win; -} - -CursorPtr -GetSpriteCursor() -{ - return sprite.current; -} - -void -GetSpritePosition(px, py) - int *px, *py; -{ - *px = sprite.hotPhys.x; - *py = sprite.hotPhys.y; -} - -#ifdef PANORAMIX -int -XineramaGetCursorScreen() -{ - if(!noPanoramiXExtension) { - return sprite.screen->myNum; - } else { - return 0; - } -} -#endif /* PANORAMIX */ - -#define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ - -static void -#if NeedFunctionPrototypes -MonthChangedOrBadTime(register xEvent *xE) -#else -MonthChangedOrBadTime(xE) - register xEvent *xE; -#endif -{ - /* If the ddx/OS is careless about not processing timestamped events from - * different sources in sorted order, then it's possible for time to go - * backwards when it should not. Here we ensure a decent time. - */ - if ((currentTime.milliseconds - XE_KBPTR.time) > TIMESLOP) - currentTime.months++; - else - XE_KBPTR.time = currentTime.milliseconds; -} - -#define NoticeTime(xE) { \ - if ((xE)->u.keyButtonPointer.time < currentTime.milliseconds) \ - MonthChangedOrBadTime(xE); \ - currentTime.milliseconds = (xE)->u.keyButtonPointer.time; \ - lastDeviceEventTime = currentTime; } - -void -NoticeEventTime(xE) - register xEvent *xE; -{ - if (!syncEvents.playingEvents) - NoticeTime(xE); -} - -/************************************************************************** - * The following procedures deal with synchronous events * - **************************************************************************/ - -void -EnqueueEvent(xE, device, count) - xEvent *xE; - DeviceIntPtr device; - int count; -{ - register QdEventPtr tail = *syncEvents.pendtail; - register QdEventPtr qe; - xEvent *qxE; - - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - /* The RECORD spec says that the root window field of motion events - * must be valid. At this point, it hasn't been filled in yet, so - * we do it here. The long expression below is necessary to get - * the current root window; the apparently reasonable alternative - * GetCurrentRootWindow()->drawable.id doesn't give you the right - * answer on the first motion event after a screen change because - * the data that GetCurrentRootWindow relies on hasn't been - * updated yet. - */ - if (xE->u.u.type == MotionNotify) - XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - if (xE->u.u.type == MotionNotify) - { -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x - - panoramiXdataPtr[0].x; - XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y - - panoramiXdataPtr[0].y; - } -#endif - sprite.hotPhys.x = XE_KBPTR.rootX; - sprite.hotPhys.y = XE_KBPTR.rootY; - /* do motion compression */ - if (tail && - (tail->event->u.u.type == MotionNotify) && - (tail->pScreen == sprite.hotPhys.pScreen)) - { - tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x; - tail->event->u.keyButtonPointer.rootY = sprite.hotPhys.y; - tail->event->u.keyButtonPointer.time = XE_KBPTR.time; - tail->months = currentTime.months; - return; - } - } - qe = (QdEventPtr)xalloc(sizeof(QdEventRec) + (count * sizeof(xEvent))); - if (!qe) - return; - qe->next = (QdEventPtr)NULL; - qe->device = device; - qe->pScreen = sprite.hotPhys.pScreen; - qe->months = currentTime.months; - qe->event = (xEvent *)(qe + 1); - qe->evcount = count; - for (qxE = qe->event; --count >= 0; qxE++, xE++) - *qxE = *xE; - if (tail) - syncEvents.pendtail = &tail->next; - *syncEvents.pendtail = qe; -} - -static void -#if NeedFunctionPrototypes -PlayReleasedEvents(void) -#else -PlayReleasedEvents() -#endif -{ - register QdEventPtr *prev, qe; - register DeviceIntPtr dev; - - prev = &syncEvents.pending; - while ( (qe = *prev) ) - { - if (!qe->device->sync.frozen) - { - *prev = qe->next; - if (*syncEvents.pendtail == *prev) - syncEvents.pendtail = prev; - if (qe->event->u.u.type == MotionNotify) - CheckVirtualMotion(qe, NullWindow); - syncEvents.time.months = qe->months; - syncEvents.time.milliseconds = qe->event->u.keyButtonPointer.time; -#ifdef PANORAMIX - /* Translate back to the sprite screen since processInputProc - will translate from sprite screen to screen 0 upon reentry - to the DIX layer */ - if(!noPanoramiXExtension) { - qe->event->u.keyButtonPointer.rootX += - panoramiXdataPtr[0].x - - panoramiXdataPtr[sprite.screen->myNum].x; - qe->event->u.keyButtonPointer.rootY += - panoramiXdataPtr[0].y - - panoramiXdataPtr[sprite.screen->myNum].y; - } -#endif - (*qe->device->public.processInputProc)(qe->event, qe->device, - qe->evcount); - xfree(qe); - for (dev = inputInfo.devices; dev && dev->sync.frozen; dev = dev->next) - ; - if (!dev) - break; - /* Playing the event may have unfrozen another device. */ - /* So to play it safe, restart at the head of the queue */ - prev = &syncEvents.pending; - } - else - prev = &qe->next; - } -} - -static void -#if NeedFunctionPrototypes -FreezeThaw(register DeviceIntPtr dev, Bool frozen) -#else -FreezeThaw(dev, frozen) - register DeviceIntPtr dev; - Bool frozen; -#endif -{ - dev->sync.frozen = frozen; - if (frozen) - dev->public.processInputProc = dev->public.enqueueInputProc; - else - dev->public.processInputProc = dev->public.realInputProc; -} - -void -ComputeFreezes() -{ - register DeviceIntPtr replayDev = syncEvents.replayDev; - register int i; - WindowPtr w; - register xEvent *xE; - int count; - GrabPtr grab; - register DeviceIntPtr dev; - - for (dev = inputInfo.devices; dev; dev = dev->next) - FreezeThaw(dev, dev->sync.other || (dev->sync.state >= FROZEN)); - if (syncEvents.playingEvents || (!replayDev && !syncEvents.pending)) - return; - syncEvents.playingEvents = TRUE; - if (replayDev) - { - xE = replayDev->sync.event; - count = replayDev->sync.evcount; - syncEvents.replayDev = (DeviceIntPtr)NULL; - - w = XYToWindow( XE_KBPTR.rootX, XE_KBPTR.rootY); - for (i = 0; i < spriteTraceGood; i++) - { - if (syncEvents.replayWin == spriteTrace[i]) - { - if (!CheckDeviceGrabs(replayDev, xE, i+1, count)) { - if (replayDev->focus) - DeliverFocusedEvent(replayDev, xE, w, count); - else - DeliverDeviceEvents(w, xE, NullGrab, NullWindow, - replayDev, count); - } - goto playmore; - } - } - /* must not still be in the same stack */ - if (replayDev->focus) - DeliverFocusedEvent(replayDev, xE, w, count); - else - DeliverDeviceEvents(w, xE, NullGrab, NullWindow, replayDev, count); - } -playmore: - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (!dev->sync.frozen) - { - PlayReleasedEvents(); - break; - } - } - syncEvents.playingEvents = FALSE; - /* the following may have been skipped during replay, so do it now */ - if ((grab = inputInfo.pointer->grab) && grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } - else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); - PostNewCursor(); -} - -#ifdef RANDR -void -ScreenRestructured (ScreenPtr pScreen) -{ - GrabPtr grab; - - if ((grab = inputInfo.pointer->grab) && grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } - else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); -} -#endif - -void -CheckGrabForSyncs(thisDev, thisMode, otherMode) - register DeviceIntPtr thisDev; - Bool thisMode, otherMode; -{ - register GrabPtr grab = thisDev->grab; - register DeviceIntPtr dev; - - if (thisMode == GrabModeSync) - thisDev->sync.state = FROZEN_NO_EVENT; - else - { /* free both if same client owns both */ - thisDev->sync.state = THAWED; - if (thisDev->sync.other && - (CLIENT_BITS(thisDev->sync.other->resource) == - CLIENT_BITS(grab->resource))) - thisDev->sync.other = NullGrab; - } - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev != thisDev) - { - if (otherMode == GrabModeSync) - dev->sync.other = grab; - else - { /* free both if same client owns both */ - if (dev->sync.other && - (CLIENT_BITS(dev->sync.other->resource) == - CLIENT_BITS(grab->resource))) - dev->sync.other = NullGrab; - } - } - } - ComputeFreezes(); -} - -void -ActivatePointerGrab(mouse, grab, time, autoGrab) - register GrabPtr grab; - register DeviceIntPtr mouse; - TimeStamp time; - Bool autoGrab; -{ - WindowPtr oldWin = (mouse->grab) ? mouse->grab->window - : sprite.win; - - if (grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, FALSE, TRUE); - } - DoEnterLeaveEvents(oldWin, grab->window, NotifyGrab); - mouse->valuator->motionHintWindow = NullWindow; - if (syncEvents.playingEvents) - mouse->grabTime = syncEvents.time; - else - mouse->grabTime = time; - if (grab->cursor) - grab->cursor->refcnt++; - mouse->activeGrab = *grab; - mouse->grab = &mouse->activeGrab; - mouse->fromPassiveGrab = autoGrab; - PostNewCursor(); - CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode); -} - -void -DeactivatePointerGrab(mouse) - register DeviceIntPtr mouse; -{ - register GrabPtr grab = mouse->grab; - register DeviceIntPtr dev; - - mouse->valuator->motionHintWindow = NullWindow; - mouse->grab = NullGrab; - mouse->sync.state = NOT_GRABBED; - mouse->fromPassiveGrab = FALSE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->sync.other == grab) - dev->sync.other = NullGrab; - } - DoEnterLeaveEvents(grab->window, sprite.win, NotifyUngrab); - if (grab->confineTo) - ConfineCursorToWindow(ROOT, FALSE, FALSE); - PostNewCursor(); - if (grab->cursor) - FreeCursor(grab->cursor, (Cursor)0); - ComputeFreezes(); -} - -void -ActivateKeyboardGrab(keybd, grab, time, passive) - register DeviceIntPtr keybd; - GrabPtr grab; - TimeStamp time; - Bool passive; -{ - WindowPtr oldWin; - - if (keybd->grab) - oldWin = keybd->grab->window; - else if (keybd->focus) - oldWin = keybd->focus->win; - else - oldWin = sprite.win; - if (oldWin == FollowKeyboardWin) - oldWin = inputInfo.keyboard->focus->win; - if (keybd->valuator) - keybd->valuator->motionHintWindow = NullWindow; - DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab); - if (syncEvents.playingEvents) - keybd->grabTime = syncEvents.time; - else - keybd->grabTime = time; - keybd->activeGrab = *grab; - keybd->grab = &keybd->activeGrab; - keybd->fromPassiveGrab = passive; - CheckGrabForSyncs(keybd, (Bool)grab->keyboardMode, (Bool)grab->pointerMode); -} - -void -DeactivateKeyboardGrab(keybd) - register DeviceIntPtr keybd; -{ - register GrabPtr grab = keybd->grab; - register DeviceIntPtr dev; - register WindowPtr focusWin = keybd->focus ? keybd->focus->win - : sprite.win; - - if (focusWin == FollowKeyboardWin) - focusWin = inputInfo.keyboard->focus->win; - if (keybd->valuator) - keybd->valuator->motionHintWindow = NullWindow; - keybd->grab = NullGrab; - keybd->sync.state = NOT_GRABBED; - keybd->fromPassiveGrab = FALSE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->sync.other == grab) - dev->sync.other = NullGrab; - } - DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab); - ComputeFreezes(); -} - -void -AllowSome(client, time, thisDev, newState) - ClientPtr client; - TimeStamp time; - register DeviceIntPtr thisDev; - int newState; -{ - Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced; - TimeStamp grabTime; - register DeviceIntPtr dev; - - thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client); - thisSynced = FALSE; - otherGrabbed = FALSE; - othersFrozen = TRUE; - grabTime = thisDev->grabTime; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - if (dev->grab && SameClient(dev->grab, client)) - { - if (!(thisGrabbed || otherGrabbed) || - (CompareTimeStamps(dev->grabTime, grabTime) == LATER)) - grabTime = dev->grabTime; - otherGrabbed = TRUE; - if (thisDev->sync.other == dev->grab) - thisSynced = TRUE; - if (dev->sync.state < FROZEN) - othersFrozen = FALSE; - } - else if (!dev->sync.other || !SameClient(dev->sync.other, client)) - othersFrozen = FALSE; - } - if (!((thisGrabbed && thisDev->sync.state >= FROZEN) || thisSynced)) - return; - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, grabTime) == EARLIER)) - return; - switch (newState) - { - case THAWED: /* Async */ - if (thisGrabbed) - thisDev->sync.state = THAWED; - if (thisSynced) - thisDev->sync.other = NullGrab; - ComputeFreezes(); - break; - case FREEZE_NEXT_EVENT: /* Sync */ - if (thisGrabbed) - { - thisDev->sync.state = FREEZE_NEXT_EVENT; - if (thisSynced) - thisDev->sync.other = NullGrab; - ComputeFreezes(); - } - break; - case THAWED_BOTH: /* AsyncBoth */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = THAWED; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - case FREEZE_BOTH_NEXT_EVENT: /* SyncBoth */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = FREEZE_BOTH_NEXT_EVENT; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - case NOT_GRABBED: /* Replay */ - if (thisGrabbed && thisDev->sync.state == FROZEN_WITH_EVENT) - { - if (thisSynced) - thisDev->sync.other = NullGrab; - syncEvents.replayDev = thisDev; - syncEvents.replayWin = thisDev->grab->window; - (*thisDev->DeactivateGrab)(thisDev); - syncEvents.replayDev = (DeviceIntPtr)NULL; - } - break; - case THAW_OTHERS: /* AsyncOthers */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = THAWED; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - } -} - -int -ProcAllowEvents(client) - register ClientPtr client; -{ - TimeStamp time; - DeviceIntPtr mouse = inputInfo.pointer; - DeviceIntPtr keybd = inputInfo.keyboard; - REQUEST(xAllowEventsReq); - - REQUEST_SIZE_MATCH(xAllowEventsReq); - time = ClientTimeToServerTime(stuff->time); - switch (stuff->mode) - { - case ReplayPointer: - AllowSome(client, time, mouse, NOT_GRABBED); - break; - case SyncPointer: - AllowSome(client, time, mouse, FREEZE_NEXT_EVENT); - break; - case AsyncPointer: - AllowSome(client, time, mouse, THAWED); - break; - case ReplayKeyboard: - AllowSome(client, time, keybd, NOT_GRABBED); - break; - case SyncKeyboard: - AllowSome(client, time, keybd, FREEZE_NEXT_EVENT); - break; - case AsyncKeyboard: - AllowSome(client, time, keybd, THAWED); - break; - case SyncBoth: - AllowSome(client, time, keybd, FREEZE_BOTH_NEXT_EVENT); - break; - case AsyncBoth: - AllowSome(client, time, keybd, THAWED_BOTH); - break; - default: - client->errorValue = stuff->mode; - return BadValue; - } - return Success; -} - -void -ReleaseActiveGrabs(client) - ClientPtr client; -{ - register DeviceIntPtr dev; - Bool done; - - /* XXX CloseDownClient should remove passive grabs before - * releasing active grabs. - */ - do { - done = TRUE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - { - (*dev->DeactivateGrab)(dev); - done = FALSE; - } - } - } while (!done); -} - -/************************************************************************** - * The following procedures deal with delivering events * - **************************************************************************/ - -int -TryClientEvents (client, pEvents, count, mask, filter, grab) - ClientPtr client; - GrabPtr grab; - xEvent *pEvents; - int count; - Mask mask, filter; -{ - int i; - int type; - -#ifdef DEBUG - if (debug_events) ErrorF( - "Event([%d, %d], mask=0x%x), client=%d", - pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); -#endif - if ((client) && (client != serverClient) && (!client->clientGone) && - ((filter == CantBeFiltered) || (mask & filter))) - { - if (grab && !SameClient(grab, client)) - return -1; /* don't send, but notify caller */ - type = pEvents->u.u.type; - if (type == MotionNotify) - { - if (mask & PointerMotionHintMask) - { - if (WID(inputInfo.pointer->valuator->motionHintWindow) == - pEvents->u.keyButtonPointer.event) - { -#ifdef DEBUG - if (debug_events) ErrorF("\n"); - fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); -#endif - return 1; /* don't send, but pretend we did */ - } - pEvents->u.u.detail = NotifyHint; - } - else - { - pEvents->u.u.detail = NotifyNormal; - } - } -#ifdef XINPUT - else - { - if ((type == DeviceMotionNotify) && - MaybeSendDeviceMotionNotifyHint - ((deviceKeyButtonPointer*)pEvents, mask) != 0) - return 1; - } -#endif - type &= 0177; - if (type != KeymapNotify) - { - /* all extension events must have a sequence number */ - for (i = 0; i < count; i++) - pEvents[i].u.u.sequenceNumber = client->sequence; - } - - if (BitIsOn(criticalEvents, type)) - { -#ifdef SMART_SCHEDULE - if (client->smart_priority < SMART_MAX_PRIORITY) - client->smart_priority++; -#endif - SetCriticalOutputPending(); - } - - WriteEventsToClient(client, count, pEvents); -#ifdef DEBUG - if (debug_events) ErrorF( " delivered\n"); -#endif - return 1; - } - else - { -#ifdef DEBUG - if (debug_events) ErrorF("\n"); -#endif - return 0; - } -} - -int -DeliverEventsToWindow(pWin, pEvents, count, filter, grab, mskidx) - register WindowPtr pWin; - GrabPtr grab; - xEvent *pEvents; - int count; - Mask filter; - int mskidx; -{ - int deliveries = 0, nondeliveries = 0; - int attempt; - register InputClients *other; - ClientPtr client = NullClient; - Mask deliveryMask = 0; /* If a grab occurs due to a button press, then - this mask is the mask of the grab. */ - int type = pEvents->u.u.type; - - /* CantBeFiltered means only window owner gets the event */ - if ((filter == CantBeFiltered) || !(type & EXTENSION_EVENT_BASE)) - { - /* if nobody ever wants to see this event, skip some work */ - if (filter != CantBeFiltered && - !((wOtherEventMasks(pWin)|pWin->eventMask) & filter)) - return 0; - if ( (attempt = TryClientEvents(wClient(pWin), pEvents, count, - pWin->eventMask, filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = wClient(pWin); - deliveryMask = pWin->eventMask; - } else - nondeliveries--; - } - } - if (filter != CantBeFiltered) - { - if (type & EXTENSION_EVENT_BASE) - { - OtherInputMasks *inputMasks; - - inputMasks = wOtherInputMasks(pWin); - if (!inputMasks || - !(inputMasks->inputEvents[mskidx] & filter)) - return 0; - other = inputMasks->inputClients; - } - else - other = (InputClients *)wOtherClients(pWin); - for (; other; other = other->next) - { - if ( (attempt = TryClientEvents(rClient(other), pEvents, count, - other->mask[mskidx], filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = rClient(other); - deliveryMask = other->mask[mskidx]; - } else - nondeliveries--; - } - } - } - if ((type == ButtonPress) && deliveries && (!grab)) - { - GrabRec tempGrab; - - tempGrab.device = inputInfo.pointer; - tempGrab.resource = client->clientAsMask; - tempGrab.window = pWin; - tempGrab.ownerEvents = (deliveryMask & OwnerGrabButtonMask) ? TRUE : FALSE; - tempGrab.eventMask = deliveryMask; - tempGrab.keyboardMode = GrabModeAsync; - tempGrab.pointerMode = GrabModeAsync; - tempGrab.confineTo = NullWindow; - tempGrab.cursor = NullCursor; - (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab, - currentTime, TRUE); - } - else if ((type == MotionNotify) && deliveries) - inputInfo.pointer->valuator->motionHintWindow = pWin; -#ifdef XINPUT - else - { - if (((type == DeviceMotionNotify) || (type == DeviceButtonPress)) && - deliveries) - CheckDeviceGrabAndHintWindow (pWin, type, - (deviceKeyButtonPointer*) pEvents, - grab, client, deliveryMask); - } -#endif - if (deliveries) - return deliveries; - return nondeliveries; -} - -/* If the event goes to dontClient, don't send it and return 0. if - send works, return 1 or if send didn't work, return 2. - Only works for core events. -*/ - -#ifdef PANORAMIX -static int -XineramaTryClientEventsResult( - ClientPtr client, - GrabPtr grab, - Mask mask, - Mask filter -){ - if ((client) && (client != serverClient) && (!client->clientGone) && - ((filter == CantBeFiltered) || (mask & filter))) - { - if (grab && !SameClient(grab, client)) return -1; - else return 1; - } - return 0; -} -#endif - -int -MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient) - register WindowPtr pWin; - xEvent *pEvents; - int count; - Mask filter; - ClientPtr dontClient; -{ - register OtherClients *other; - - - if (pWin->eventMask & filter) - { - if (wClient(pWin) == dontClient) - return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return XineramaTryClientEventsResult( - wClient(pWin), NullGrab, pWin->eventMask, filter); -#endif - return TryClientEvents(wClient(pWin), pEvents, count, - pWin->eventMask, filter, NullGrab); - } - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->mask & filter) - { - if (SameClient(other, dontClient)) - return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return XineramaTryClientEventsResult( - rClient(other), NullGrab, other->mask, filter); -#endif - return TryClientEvents(rClient(other), pEvents, count, - other->mask, filter, NullGrab); - } - } - return 2; -} - -static void -#if NeedFunctionPrototypes -FixUpEventFromWindow( - xEvent *xE, - WindowPtr pWin, - Window child, - Bool calcChild) -#else -FixUpEventFromWindow(xE, pWin, child, calcChild) - xEvent *xE; - WindowPtr pWin; - Window child; - Bool calcChild; -#endif -{ - if (calcChild) - { - WindowPtr w=spriteTrace[spriteTraceGood-1]; - /* If the search ends up past the root should the child field be - set to none or should the value in the argument be passed - through. It probably doesn't matter since everyone calls - this function with child == None anyway. */ - - while (w) - { - /* If the source window is same as event window, child should be - none. Don't bother going all all the way back to the root. */ - - if (w == pWin) - { - child = None; - break; - } - - if (w->parent == pWin) - { - child = w->drawable.id; - break; - } - w = w->parent; - } - } - XE_KBPTR.root = ROOT->drawable.id; - XE_KBPTR.event = pWin->drawable.id; - if (sprite.hot.pScreen == pWin->drawable.pScreen) - { - XE_KBPTR.sameScreen = xTrue; - XE_KBPTR.child = child; - XE_KBPTR.eventX = - XE_KBPTR.rootX - pWin->drawable.x; - XE_KBPTR.eventY = - XE_KBPTR.rootY - pWin->drawable.y; - } - else - { - XE_KBPTR.sameScreen = xFalse; - XE_KBPTR.child = None; - XE_KBPTR.eventX = 0; - XE_KBPTR.eventY = 0; - } -} - -int -DeliverDeviceEvents(pWin, xE, grab, stopAt, dev, count) - register WindowPtr pWin, stopAt; - register xEvent *xE; - GrabPtr grab; - DeviceIntPtr dev; - int count; -{ - Window child = None; - int type = xE->u.u.type; - Mask filter = filters[type]; - int deliveries = 0; - - if (type & EXTENSION_EVENT_BASE) - { - register OtherInputMasks *inputMasks; - int mskidx = dev->id; - - inputMasks = wOtherInputMasks(pWin); - if (inputMasks && !(filter & inputMasks->deliverableEvents[mskidx])) - return 0; - while (pWin) - { - if (inputMasks && (inputMasks->inputEvents[mskidx] & filter)) - { - FixUpEventFromWindow(xE, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(pWin, xE, count, filter, - grab, mskidx); - if (deliveries > 0) - return deliveries; - } - if ((deliveries < 0) || - (pWin == stopAt) || - (inputMasks && - (filter & inputMasks->dontPropagateMask[mskidx]))) - return 0; - child = pWin->drawable.id; - pWin = pWin->parent; - if (pWin) - inputMasks = wOtherInputMasks(pWin); - } - } - else - { - if (!(filter & pWin->deliverableEvents)) - return 0; - while (pWin) - { - if ((wOtherEventMasks(pWin)|pWin->eventMask) & filter) - { - FixUpEventFromWindow(xE, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(pWin, xE, count, filter, - grab, 0); - if (deliveries > 0) - return deliveries; - } - if ((deliveries < 0) || - (pWin == stopAt) || - (filter & wDontPropagateMask(pWin))) - return 0; - child = pWin->drawable.id; - pWin = pWin->parent; - } - } - return 0; -} - -/* not useful for events that propagate up the tree or extension events */ -int -DeliverEvents(pWin, xE, count, otherParent) - register WindowPtr pWin, otherParent; - register xEvent *xE; - int count; -{ - Mask filter; - int deliveries; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return count; -#endif - - if (!count) - return 0; - filter = filters[xE->u.u.type]; - if ((filter & SubstructureNotifyMask) && (xE->u.u.type != CreateNotify)) - xE->u.destroyNotify.event = pWin->drawable.id; - if (filter != StructureAndSubMask) - return DeliverEventsToWindow(pWin, xE, count, filter, NullGrab, 0); - deliveries = DeliverEventsToWindow(pWin, xE, count, StructureNotifyMask, - NullGrab, 0); - if (pWin->parent) - { - xE->u.destroyNotify.event = pWin->parent->drawable.id; - deliveries += DeliverEventsToWindow(pWin->parent, xE, count, - SubstructureNotifyMask, NullGrab, - 0); - if (xE->u.u.type == ReparentNotify) - { - xE->u.destroyNotify.event = otherParent->drawable.id; - deliveries += DeliverEventsToWindow(otherParent, xE, count, - SubstructureNotifyMask, - NullGrab, 0); - } - } - return deliveries; -} - - -static Bool -PointInBorderSize(WindowPtr pWin, int x, int y) -{ - BoxRec box; - - if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box)) - return TRUE; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { - int i; - - for(i = 1; i < PanoramiXNumScreens; i++) { - if(POINT_IN_REGION(sprite.screen, - &sprite.windows[i]->borderSize, - x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x, - y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y, - &box)) - return TRUE; - } - } -#endif - return FALSE; -} - -static WindowPtr -#if NeedFunctionPrototypes -XYToWindow(int x, int y) -#else -XYToWindow(x, y) - int x, y; -#endif -{ - register WindowPtr pWin; - - spriteTraceGood = 1; /* root window still there */ - pWin = ROOT->firstChild; - while (pWin) - { - if ((pWin->mapped) && - (x >= pWin->drawable.x - wBorderWidth (pWin)) && - (x < pWin->drawable.x + (int)pWin->drawable.width + - wBorderWidth(pWin)) && - (y >= pWin->drawable.y - wBorderWidth (pWin)) && - (y < pWin->drawable.y + (int)pWin->drawable.height + - wBorderWidth (pWin)) -#ifdef SHAPE - /* When a window is shaped, a further check - * is made to see if the point is inside - * borderSize - */ - && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y)) -#endif - ) - { - if (spriteTraceGood >= spriteTraceSize) - { - spriteTraceSize += 10; - Must_have_memory = TRUE; /* XXX */ - spriteTrace = (WindowPtr *)xrealloc( - spriteTrace, spriteTraceSize*sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ - } - spriteTrace[spriteTraceGood++] = pWin; - pWin = pWin->firstChild; - } - else - pWin = pWin->nextSib; - } - return spriteTrace[spriteTraceGood-1]; -} - -static Bool -#if NeedFunctionPrototypes -CheckMotion(xEvent *xE) -#else -CheckMotion(xE) - xEvent *xE; -#endif -{ - WindowPtr prevSpriteWin = sprite.win; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return XineramaCheckMotion(xE); -#endif - - if (xE && !syncEvents.playingEvents) - { - if (sprite.hot.pScreen != sprite.hotPhys.pScreen) - { - sprite.hot.pScreen = sprite.hotPhys.pScreen; - ROOT = WindowTable[sprite.hot.pScreen->myNum]; - } - sprite.hot.x = XE_KBPTR.rootX; - sprite.hot.y = XE_KBPTR.rootY; - if (sprite.hot.x < sprite.physLimits.x1) - sprite.hot.x = sprite.physLimits.x1; - else if (sprite.hot.x >= sprite.physLimits.x2) - sprite.hot.x = sprite.physLimits.x2 - 1; - if (sprite.hot.y < sprite.physLimits.y1) - sprite.hot.y = sprite.physLimits.y1; - else if (sprite.hot.y >= sprite.physLimits.y2) - sprite.hot.y = sprite.physLimits.y2 - 1; -#ifdef SHAPE - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); -#endif - sprite.hotPhys = sprite.hot; - if ((sprite.hotPhys.x != XE_KBPTR.rootX) || - (sprite.hotPhys.y != XE_KBPTR.rootY)) - { - (*sprite.hotPhys.pScreen->SetCursorPosition)( - sprite.hotPhys.pScreen, - sprite.hotPhys.x, sprite.hotPhys.y, FALSE); - } - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - } - - sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); -#ifdef notyet - if (!(sprite.win->deliverableEvents & - Motion_Filter(inputInfo.pointer->button)) - !syncEvents.playingEvents) - { - /* XXX Do PointerNonInterestBox here */ - } -#endif - if (sprite.win != prevSpriteWin) - { - if (prevSpriteWin != NullWindow) { - if (!xE) - UpdateCurrentTimeIf(); - DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); - } - PostNewCursor(); - return FALSE; - } - return TRUE; -} - -void -WindowsRestructured() -{ - (void) CheckMotion((xEvent *)NULL); -} - -void -DefineInitialRootWindow(win) - register WindowPtr win; -{ - register ScreenPtr pScreen = win->drawable.pScreen; - - sprite.hotPhys.pScreen = pScreen; - sprite.hotPhys.x = pScreen->width / 2; - sprite.hotPhys.y = pScreen->height / 2; - sprite.hot = sprite.hotPhys; - sprite.hotLimits.x2 = pScreen->width; - sprite.hotLimits.y2 = pScreen->height; - sprite.win = win; - sprite.current = wCursor (win); - spriteTraceGood = 1; - ROOT = win; - (*pScreen->CursorLimits) ( - pScreen, sprite.current, &sprite.hotLimits, &sprite.physLimits); - sprite.confined = FALSE; - (*pScreen->ConstrainCursor) (pScreen, &sprite.physLimits); - (*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE); - (*pScreen->DisplayCursor) (pScreen, sprite.current); - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - sprite.hotLimits.x1 = -panoramiXdataPtr[0].x; - sprite.hotLimits.y1 = -panoramiXdataPtr[0].y; - sprite.hotLimits.x2 = PanoramiXPixWidth - panoramiXdataPtr[0].x; - sprite.hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y; - sprite.physLimits = sprite.hotLimits; - sprite.confineWin = NullWindow; - sprite.screen = pScreen; - /* gotta UNINIT these someplace */ - REGION_INIT(pScreen, &sprite.Reg1, NullBox, 1); - REGION_INIT(pScreen, &sprite.Reg2, NullBox, 1); - } -#endif -} - -/* - * This does not take any shortcuts, and even ignores its argument, since - * it does not happen very often, and one has to walk up the tree since - * this might be a newly instantiated cursor for an intermediate window - * between the one the pointer is in and the one that the last cursor was - * instantiated from. - */ -/*ARGSUSED*/ -void -WindowHasNewCursor(pWin) - WindowPtr pWin; -{ - PostNewCursor(); -} - -void -NewCurrentScreen(newScreen, x, y) - ScreenPtr newScreen; - int x,y; -{ - sprite.hotPhys.x = x; - sprite.hotPhys.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - sprite.hotPhys.x += panoramiXdataPtr[newScreen->myNum].x - - panoramiXdataPtr[0].x; - sprite.hotPhys.y += panoramiXdataPtr[newScreen->myNum].y - - panoramiXdataPtr[0].y; - if (newScreen != sprite.screen) { - sprite.screen = newScreen; - /* Make sure we tell the DDX to update its copy of the screen */ - if(sprite.confineWin) - XineramaConfineCursorToWindow(sprite.confineWin, TRUE); - else - XineramaConfineCursorToWindow(WindowTable[0], TRUE); - /* if the pointer wasn't confined, the DDX won't get - told of the pointer warp so we reposition it here */ - if(!syncEvents.playingEvents) - (*sprite.screen->SetCursorPosition)(sprite.screen, - sprite.hotPhys.x + panoramiXdataPtr[0].x - - panoramiXdataPtr[sprite.screen->myNum].x, - sprite.hotPhys.y + panoramiXdataPtr[0].y - - panoramiXdataPtr[sprite.screen->myNum].y, FALSE); - } - } else -#endif - if (newScreen != sprite.hotPhys.pScreen) - ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE); -} - -#ifdef PANORAMIX - -static Bool -XineramaPointInWindowIsVisible( - WindowPtr pWin, - int x, - int y -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - BoxRec box; - int i, xoff, yoff; - - if (!pWin->realized) return FALSE; - - if (POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) - return TRUE; - - if(!XineramaSetWindowPntrs(pWin)) return FALSE; - - xoff = x + panoramiXdataPtr[0].x; - yoff = y + panoramiXdataPtr[0].y; - - for(i = 1; i < PanoramiXNumScreens; i++) { - pWin = sprite.windows[i]; - pScreen = pWin->drawable.pScreen; - x = xoff - panoramiXdataPtr[i].x; - y = yoff - panoramiXdataPtr[i].y; - - if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) - return TRUE; - - } - - return FALSE; -} - -static int -XineramaWarpPointer(ClientPtr client) -{ - WindowPtr dest = NULL; - int x, y; - - REQUEST(xWarpPointerReq); - - - if (stuff->dstWid != None) - { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); - if (!dest) - return BadWindow; - } - x = sprite.hotPhys.x; - y = sprite.hotPhys.y; - - if (stuff->srcWid != None) - { - int winX, winY; - XID winID = stuff->srcWid; - WindowPtr source; - - source = SecurityLookupWindow(winID, client, SecurityReadAccess); - if (!source) return BadWindow; - - winX = source->drawable.x; - winY = source->drawable.y; - if(source == WindowTable[0]) { - winX -= panoramiXdataPtr[0].x; - winY -= panoramiXdataPtr[0].y; - } - if (x < winX + stuff->srcX || - y < winY + stuff->srcY || - (stuff->srcWidth != 0 && - winX + stuff->srcX + (int)stuff->srcWidth < x) || - (stuff->srcHeight != 0 && - winY + stuff->srcY + (int)stuff->srcHeight < y) || - !XineramaPointInWindowIsVisible(source, x, y)) - return Success; - } - if (dest) { - x = dest->drawable.x; - y = dest->drawable.y; - if(dest == WindowTable[0]) { - x -= panoramiXdataPtr[0].x; - y -= panoramiXdataPtr[0].y; - } - } - - x += stuff->dstX; - y += stuff->dstY; - - if (x < sprite.physLimits.x1) - x = sprite.physLimits.x1; - else if (x >= sprite.physLimits.x2) - x = sprite.physLimits.x2 - 1; - if (y < sprite.physLimits.y1) - y = sprite.physLimits.y1; - else if (y >= sprite.physLimits.y2) - y = sprite.physLimits.y2 - 1; - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &x, &y); - - XineramaSetCursorPosition(x, y, TRUE); - - return Success; -} - -#endif - - -int -ProcWarpPointer(client) - ClientPtr client; -{ - WindowPtr dest = NULL; - int x, y; - ScreenPtr newScreen; - - REQUEST(xWarpPointerReq); - - REQUEST_SIZE_MATCH(xWarpPointerReq); - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return XineramaWarpPointer(client); -#endif - - if (stuff->dstWid != None) - { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); - if (!dest) - return BadWindow; - } - x = sprite.hotPhys.x; - y = sprite.hotPhys.y; - - if (stuff->srcWid != None) - { - int winX, winY; - XID winID = stuff->srcWid; - WindowPtr source; - - source = SecurityLookupWindow(winID, client, SecurityReadAccess); - if (!source) return BadWindow; - - winX = source->drawable.x; - winY = source->drawable.y; - if (source->drawable.pScreen != sprite.hotPhys.pScreen || - x < winX + stuff->srcX || - y < winY + stuff->srcY || - (stuff->srcWidth != 0 && - winX + stuff->srcX + (int)stuff->srcWidth < x) || - (stuff->srcHeight != 0 && - winY + stuff->srcY + (int)stuff->srcHeight < y) || - !PointInWindowIsVisible(source, x, y)) - return Success; - } - if (dest) - { - x = dest->drawable.x; - y = dest->drawable.y; - newScreen = dest->drawable.pScreen; - } else - newScreen = sprite.hotPhys.pScreen; - - x += stuff->dstX; - y += stuff->dstY; - - if (x < 0) - x = 0; - else if (x >= newScreen->width) - x = newScreen->width - 1; - if (y < 0) - y = 0; - else if (y >= newScreen->height) - y = newScreen->height - 1; - - if (newScreen == sprite.hotPhys.pScreen) - { - if (x < sprite.physLimits.x1) - x = sprite.physLimits.x1; - else if (x >= sprite.physLimits.x2) - x = sprite.physLimits.x2 - 1; - if (y < sprite.physLimits.y1) - y = sprite.physLimits.y1; - else if (y >= sprite.physLimits.y2) - y = sprite.physLimits.y2 - 1; -#if defined(SHAPE) - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &x, &y); -#endif - (*newScreen->SetCursorPosition)(newScreen, x, y, TRUE); - } - else if (!PointerConfinedToScreen()) - { - NewCurrentScreen(newScreen, x, y); - } - return Success; -} - -static Bool -BorderSizeNotEmpty(WindowPtr pWin) -{ - if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize)) - return TRUE; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { - int i; - - for(i = 1; i < PanoramiXNumScreens; i++) { - if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize)) - return TRUE; - } - } -#endif - return FALSE; -} - -/* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a - passive grab set on the window to be activated. */ - -static Bool -#if NeedFunctionPrototypes -CheckPassiveGrabsOnWindow( - WindowPtr pWin, - register DeviceIntPtr device, - register xEvent *xE, - int count) -#else -CheckPassiveGrabsOnWindow(pWin, device, xE, count) - WindowPtr pWin; - register DeviceIntPtr device; - register xEvent *xE; - int count; -#endif -{ - register GrabPtr grab = wPassiveGrabs(pWin); - GrabRec tempGrab; - register xEvent *dxE; - - if (!grab) - return FALSE; - tempGrab.window = pWin; - tempGrab.device = device; - tempGrab.type = xE->u.u.type; - tempGrab.detail.exact = xE->u.u.detail; - tempGrab.detail.pMask = NULL; - tempGrab.modifiersDetail.pMask = NULL; - for (; grab; grab = grab->next) - { -#ifdef XKB - DeviceIntPtr gdev; - XkbSrvInfoPtr xkbi; - - gdev= grab->modifierDevice; - xkbi= gdev->key->xkbInfo; -#endif - tempGrab.modifierDevice = grab->modifierDevice; - if (device == grab->modifierDevice && - (xE->u.u.type == KeyPress -#ifdef XINPUT - || xE->u.u.type == DeviceKeyPress -#endif - )) - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension?gdev->key->prev_state:xkbi->state.grab_mods); -#else - grab->modifierDevice->key->prev_state; -#endif - else - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension ? gdev->key->state : xkbi->state.grab_mods); -#else - grab->modifierDevice->key->state; -#endif - if (GrabMatchesSecond(&tempGrab, grab) && - (!grab->confineTo || - (grab->confineTo->realized && - BorderSizeNotEmpty(grab->confineTo)))) - { -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(wClient(pWin), device, FALSE)) - return FALSE; -#endif -#ifdef XKB - if (!noXkbExtension) { - XE_KBPTR.state &= 0x1f00; - XE_KBPTR.state |= - tempGrab.modifiersDetail.exact&(~0x1f00); - } -#endif - (*device->ActivateGrab)(device, grab, currentTime, TRUE); - - FixUpEventFromWindow(xE, grab->window, None, TRUE); - - (void) TryClientEvents(rClient(grab), xE, count, - filters[xE->u.u.type], - filters[xE->u.u.type], grab); - - if (device->sync.state == FROZEN_NO_EVENT) - { - if (device->sync.evcount < count) - { - Must_have_memory = TRUE; /* XXX */ - device->sync.event = (xEvent *)xrealloc(device->sync.event, - count* - sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ - } - device->sync.evcount = count; - for (dxE = device->sync.event; --count >= 0; dxE++, xE++) - *dxE = *xE; - device->sync.state = FROZEN_WITH_EVENT; - } - return TRUE; - } - } - return FALSE; -} - -/* -"CheckDeviceGrabs" handles both keyboard and pointer events that may cause -a passive grab to be activated. If the event is a keyboard event, the -ancestors of the focus window are traced down and tried to see if they have -any passive grabs to be activated. If the focus window itself is reached and -it's descendants contain they pointer, the ancestors of the window that the -pointer is in are then traced down starting at the focus window, otherwise no -grabs are activated. If the event is a pointer event, the ancestors of the -window that the pointer is in are traced down starting at the root until -CheckPassiveGrabs causes a passive grab to activate or all the windows are -tried. PRH -*/ - -Bool -CheckDeviceGrabs(device, xE, checkFirst, count) - register DeviceIntPtr device; - register xEvent *xE; - int checkFirst; - int count; -{ - register int i; - register WindowPtr pWin = NULL; - register FocusClassPtr focus = device->focus; - - if ((xE->u.u.type == ButtonPress -#ifdef XINPUT - || xE->u.u.type == DeviceButtonPress -#endif - ) && device->button->buttonsDown != 1) - return FALSE; - - i = checkFirst; - - if (focus) - { - for (; i < focus->traceGood; i++) - { - pWin = focus->trace[i]; - if (pWin->optional && - CheckPassiveGrabsOnWindow(pWin, device, xE, count)) - return TRUE; - } - - if ((focus->win == NoneWin) || - (i >= spriteTraceGood) || - ((i > checkFirst) && (pWin != spriteTrace[i-1]))) - return FALSE; - } - - for (; i < spriteTraceGood; i++) - { - pWin = spriteTrace[i]; - if (pWin->optional && - CheckPassiveGrabsOnWindow(pWin, device, xE, count)) - return TRUE; - } - - return FALSE; -} - -void -DeliverFocusedEvent(keybd, xE, window, count) - xEvent *xE; - DeviceIntPtr keybd; - WindowPtr window; - int count; -{ - WindowPtr focus = keybd->focus->win; - int mskidx = 0; - - if (focus == FollowKeyboardWin) - focus = inputInfo.keyboard->focus->win; - if (!focus) - return; - if (focus == PointerRootWin) - { - DeliverDeviceEvents(window, xE, NullGrab, NullWindow, keybd, count); - return; - } - if ((focus == window) || IsParent(focus, window)) - { - if (DeliverDeviceEvents(window, xE, NullGrab, focus, keybd, count)) - return; - } - /* just deliver it to the focus window */ - FixUpEventFromWindow(xE, focus, None, FALSE); - if (xE->u.u.type & EXTENSION_EVENT_BASE) - mskidx = keybd->id; - (void)DeliverEventsToWindow(focus, xE, count, filters[xE->u.u.type], - NullGrab, mskidx); -} - -void -DeliverGrabbedEvent(xE, thisDev, deactivateGrab, count) - register xEvent *xE; - register DeviceIntPtr thisDev; - Bool deactivateGrab; - int count; -{ - register GrabPtr grab = thisDev->grab; - int deliveries = 0; - register DeviceIntPtr dev; - register xEvent *dxE; - - if (grab->ownerEvents) - { - WindowPtr focus; - - if (thisDev->focus) - { - focus = thisDev->focus->win; - if (focus == FollowKeyboardWin) - focus = inputInfo.keyboard->focus->win; - } - else - focus = PointerRootWin; - if (focus == PointerRootWin) - deliveries = DeliverDeviceEvents(sprite.win, xE, grab, NullWindow, - thisDev, count); - else if (focus && (focus == sprite.win || IsParent(focus, sprite.win))) - deliveries = DeliverDeviceEvents(sprite.win, xE, grab, focus, - thisDev, count); - else if (focus) - deliveries = DeliverDeviceEvents(focus, xE, grab, focus, - thisDev, count); - } - if (!deliveries) - { - FixUpEventFromWindow(xE, grab->window, None, TRUE); - deliveries = TryClientEvents(rClient(grab), xE, count, - (Mask)grab->eventMask, - filters[xE->u.u.type], grab); - if (deliveries && (xE->u.u.type == MotionNotify -#ifdef XINPUT - || xE->u.u.type == DeviceMotionNotify -#endif - )) - thisDev->valuator->motionHintWindow = grab->window; - } - if (deliveries && !deactivateGrab && (xE->u.u.type != MotionNotify -#ifdef XINPUT - && xE->u.u.type != DeviceMotionNotify -#endif - )) - switch (thisDev->sync.state) - { - case FREEZE_BOTH_NEXT_EVENT: - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - FreezeThaw(dev, TRUE); - if ((dev->sync.state == FREEZE_BOTH_NEXT_EVENT) && - (CLIENT_BITS(dev->grab->resource) == - CLIENT_BITS(thisDev->grab->resource))) - dev->sync.state = FROZEN_NO_EVENT; - else - dev->sync.other = thisDev->grab; - } - /* fall through */ - case FREEZE_NEXT_EVENT: - thisDev->sync.state = FROZEN_WITH_EVENT; - FreezeThaw(thisDev, TRUE); - if (thisDev->sync.evcount < count) - { - Must_have_memory = TRUE; /* XXX */ - thisDev->sync.event = (xEvent *)xrealloc(thisDev->sync.event, - count*sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ - } - thisDev->sync.evcount = count; - for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++) - *dxE = *xE; - break; - } -} - -void -#ifdef XKB -CoreProcessKeyboardEvent (xE, keybd, count) -#else -ProcessKeyboardEvent (xE, keybd, count) -#endif - register xEvent *xE; - register DeviceIntPtr keybd; - int count; -{ - int key, bit; - register BYTE *kptr; - register int i; - register CARD8 modifiers; - register CARD16 mask; - GrabPtr grab = keybd->grab; - Bool deactivateGrab = FALSE; - register KeyClassPtr keyc = keybd->key; - - if (!syncEvents.playingEvents) - { - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - } - XE_KBPTR.state = (keyc->state | inputInfo.pointer->button->state); - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); - modifiers = keyc->modifierMap[key]; -#ifdef DEBUG - if ((xkbDebugFlags&0x4)&& - ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { - ErrorF("CoreProcessKbdEvent: Key %d %s\n",key, - (xE->u.u.type==KeyPress?"down":"up")); - } -#endif - switch (xE->u.u.type) - { - case KeyPress: - if (*kptr & bit) /* allow ddx to generate multiple downs */ - { - if (!modifiers) - { - xE->u.u.type = KeyRelease; - (*keybd->public.processInputProc)(xE, keybd, count); - xE->u.u.type = KeyPress; - /* release can have side effects, don't fall through */ - (*keybd->public.processInputProc)(xE, keybd, count); - } - return; - } - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr |= bit; - keyc->prev_state = keyc->state; - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) - { - /* This key affects modifier "i" */ - keyc->modifierKeyCount[i]++; - keyc->state |= mask; - modifiers &= ~mask; - } - } - if (!grab && CheckDeviceGrabs(keybd, xE, 0, count)) - { - keybd->activatingKey = key; - return; - } - break; - case KeyRelease: - if (!(*kptr & bit)) /* guard against duplicates */ - return; - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr &= ~bit; - keyc->prev_state = keyc->state; - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) { - /* This key affects modifier "i" */ - if (--keyc->modifierKeyCount[i] <= 0) { - keyc->state &= ~mask; - keyc->modifierKeyCount[i] = 0; - } - modifiers &= ~mask; - } - } - if (keybd->fromPassiveGrab && (key == keybd->activatingKey)) - deactivateGrab = TRUE; - break; - default: - FatalError("Impossible keyboard event"); - } - if (grab) - DeliverGrabbedEvent(xE, keybd, deactivateGrab, count); - else - DeliverFocusedEvent(keybd, xE, sprite.win, count); - if (deactivateGrab) - (*keybd->DeactivateGrab)(keybd); -} - -#ifdef XKB -/* This function is used to set the key pressed or key released state - - this is only used when the pressing of keys does not cause - CoreProcessKeyEvent to be called, as in for example Mouse Keys. -*/ -void -FixKeyState (xE, keybd) - register xEvent *xE; - register DeviceIntPtr keybd; -{ - int key, bit; - register BYTE *kptr; - register KeyClassPtr keyc = keybd->key; - - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); -#ifdef DEBUG - if ((xkbDebugFlags&0x4)&& - ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { - ErrorF("FixKeyState: Key %d %s\n",key, - (xE->u.u.type==KeyPress?"down":"up")); - } -#endif - switch (xE->u.u.type) - { - case KeyPress: - *kptr |= bit; - break; - case KeyRelease: - *kptr &= ~bit; - break; - default: - FatalError("Impossible keyboard event"); - } -} -#endif - -void -#ifdef XKB -CoreProcessPointerEvent (xE, mouse, count) -#else -ProcessPointerEvent (xE, mouse, count) -#endif - register xEvent *xE; - register DeviceIntPtr mouse; - int count; -{ - register GrabPtr grab = mouse->grab; - Bool deactivateGrab = FALSE; - register ButtonClassPtr butc = mouse->button; -#ifdef XKB - XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo; -#endif - - if (!syncEvents.playingEvents) - NoticeTime(xE) - XE_KBPTR.state = (butc->state | ( -#ifdef XKB - (noXkbExtension ? - inputInfo.keyboard->key->state : - xkbi->state.grab_mods) -#else - inputInfo.keyboard->key->state -#endif - )); - { - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - /* see comment in EnqueueEvents regarding the next three lines */ - if (xE->u.u.type == MotionNotify) - XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - } - if (xE->u.u.type != MotionNotify) - { - register int key; - register BYTE *kptr; - int bit; - - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - - key = xE->u.u.detail; - kptr = &butc->down[key >> 3]; - bit = 1 << (key & 7); - switch (xE->u.u.type) - { - case ButtonPress: - mouse->valuator->motionHintWindow = NullWindow; - if (!(*kptr & bit)) - butc->buttonsDown++; - butc->motionMask = ButtonMotionMask; - *kptr |= bit; -#if !defined(XFree86Server) || !defined(XINPUT) - xE->u.u.detail = butc->map[key]; -#endif - if (xE->u.u.detail == 0) - return; - if (xE->u.u.detail <= 5) - butc->state |= (Button1Mask >> 1) << xE->u.u.detail; - filters[MotionNotify] = Motion_Filter(butc); - if (!grab) - if (CheckDeviceGrabs(mouse, xE, 0, count)) - return; - break; - case ButtonRelease: - mouse->valuator->motionHintWindow = NullWindow; - if (*kptr & bit) - --butc->buttonsDown; - if (!butc->buttonsDown) - butc->motionMask = 0; - *kptr &= ~bit; -#if !defined(XFree86Server) || !defined(XINPUT) - xE->u.u.detail = butc->map[key]; -#endif - if (xE->u.u.detail == 0) - return; - if (xE->u.u.detail <= 5) - butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); - filters[MotionNotify] = Motion_Filter(butc); - if (!butc->state && mouse->fromPassiveGrab) - deactivateGrab = TRUE; - break; - default: - FatalError("bogus pointer event from ddx"); - } - } - else if (!CheckMotion(xE)) - return; - if (grab) - DeliverGrabbedEvent(xE, mouse, deactivateGrab, count); - else - DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, - mouse, count); - if (deactivateGrab) - (*mouse->DeactivateGrab)(mouse); -} - -#define AtMostOneClient \ - (SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask) - -void -RecalculateDeliverableEvents(pWin) - register WindowPtr pWin; -{ - register OtherClients *others; - register WindowPtr pChild; - - pChild = pWin; - while (1) - { - if (pChild->optional) - { - pChild->optional->otherEventMasks = 0; - for (others = wOtherClients(pChild); others; others = others->next) - { - pChild->optional->otherEventMasks |= others->mask; - } - } - pChild->deliverableEvents = pChild->eventMask| - wOtherEventMasks(pChild); - if (pChild->parent) - pChild->deliverableEvents |= - (pChild->parent->deliverableEvents & - ~wDontPropagateMask(pChild) & PropagateMask); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } -} - -int -OtherClientGone(value, id) - pointer value; /* must conform to DeleteType */ - XID id; -{ - register OtherClientsPtr other, prev; - register WindowPtr pWin = (WindowPtr)value; - - prev = 0; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->resource == id) - { - if (prev) - prev->next = other->next; - else - { - if (!(pWin->optional->otherClients = other->next)) - CheckWindowOptionalNeed (pWin); - } - xfree(other); - RecalculateDeliverableEvents(pWin); - return(Success); - } - prev = other; - } - FatalError("client not on event list"); - /*NOTREACHED*/ - return -1; /* make compiler happy */ -} - -int -EventSelectForWindow(pWin, client, mask) - register WindowPtr pWin; - register ClientPtr client; - Mask mask; -{ - Mask check; - OtherClients * others; - - if (mask & ~AllEventMasks) - { - client->errorValue = mask; - return BadValue; - } - check = (mask & AtMostOneClient); - if (check & (pWin->eventMask|wOtherEventMasks(pWin))) - { /* It is illegal for two different - clients to select on any of the - events for AtMostOneClient. However, - it is OK, for some client to - continue selecting on one of those - events. */ - if ((wClient(pWin) != client) && (check & pWin->eventMask)) - return BadAccess; - for (others = wOtherClients (pWin); others; others = others->next) - { - if (!SameClient(others, client) && (check & others->mask)) - return BadAccess; - } - } - if (wClient (pWin) == client) - { - check = pWin->eventMask; -#ifdef SGIMISC - pWin->eventMask = - (mask & ~SGIMiscSpecialDestroyMask) | (pWin->eventMask & SGIMiscSpecialDestroyMask); -#else - pWin->eventMask = mask; -#endif - } - else - { - for (others = wOtherClients (pWin); others; others = others->next) - { - if (SameClient(others, client)) - { - check = others->mask; -#ifdef SGIMISC - mask = (mask & ~SGIMiscSpecialDestroyMask) | (others->mask & SGIMiscSpecialDestroyMask); -#endif - if (mask == 0) - { - FreeResource(others->resource, RT_NONE); - return Success; - } - else - others->mask = mask; - goto maskSet; - } - } - check = 0; - if (!pWin->optional && !MakeWindowOptional (pWin)) - return BadAlloc; - others = (OtherClients *) xalloc(sizeof(OtherClients)); - if (!others) - return BadAlloc; - others->mask = mask; - others->resource = FakeClientID(client->index); - others->next = pWin->optional->otherClients; - pWin->optional->otherClients = others; - if (!AddResource(others->resource, RT_OTHERCLIENT, (pointer)pWin)) - return BadAlloc; - } -maskSet: - if ((inputInfo.pointer->valuator->motionHintWindow == pWin) && - (mask & PointerMotionHintMask) && - !(check & PointerMotionHintMask) && - !inputInfo.pointer->grab) - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - RecalculateDeliverableEvents(pWin); - return Success; -} - -/*ARGSUSED*/ -int -EventSuppressForWindow(pWin, client, mask, checkOptional) - register WindowPtr pWin; - register ClientPtr client; - Mask mask; - Bool *checkOptional; -{ - register int i, free; - - if ((mask & ~PropagateMask) && !permitOldBugs) - { - client->errorValue = mask; - return BadValue; - } - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]--; - if (!mask) - i = 0; - else - { - for (i = DNPMCOUNT, free = 0; --i > 0; ) - { - if (!DontPropagateRefCnts[i]) - free = i; - else if (mask == DontPropagateMasks[i]) - break; - } - if (!i && free) - { - i = free; - DontPropagateMasks[i] = mask; - } - } - if (i || !mask) - { - pWin->dontPropagate = i; - if (i) - DontPropagateRefCnts[i]++; - if (pWin->optional) - { - pWin->optional->dontPropagateMask = mask; - *checkOptional = TRUE; - } - } - else - { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]++; - return BadAlloc; - } - pWin->dontPropagate = 0; - pWin->optional->dontPropagateMask = mask; - } - RecalculateDeliverableEvents(pWin); - return Success; -} - -static WindowPtr -#if NeedFunctionPrototypes -CommonAncestor( - register WindowPtr a, - register WindowPtr b) -#else -CommonAncestor(a, b) - register WindowPtr a, b; -#endif -{ - for (b = b->parent; b; b = b->parent) - if (IsParent(b, a)) return b; - return NullWindow; -} - -static void -#if NeedFunctionPrototypes -EnterLeaveEvent( - int type, - int mode, - int detail, - register WindowPtr pWin, - Window child) -#else -EnterLeaveEvent(type, mode, detail, pWin, child) - int type, mode, detail; - register WindowPtr pWin; - Window child; -#endif -{ - xEvent event; - register DeviceIntPtr keybd = inputInfo.keyboard; - WindowPtr focus; - register DeviceIntPtr mouse = inputInfo.pointer; - register GrabPtr grab = mouse->grab; - Mask mask; - - if ((pWin == mouse->valuator->motionHintWindow) && - (detail != NotifyInferior)) - mouse->valuator->motionHintWindow = NullWindow; - if (grab) - { - mask = (pWin == grab->window) ? grab->eventMask : 0; - if (grab->ownerEvents) - mask |= EventMaskForClient(pWin, rClient(grab)); - } - else - { - mask = pWin->eventMask | wOtherEventMasks(pWin); - } - if (mask & filters[type]) - { - event.u.u.type = type; - event.u.u.detail = detail; - event.u.enterLeave.time = currentTime.milliseconds; - event.u.enterLeave.rootX = sprite.hot.x; - event.u.enterLeave.rootY = sprite.hot.y; - /* Counts on the same initial structure of crossing & button events! */ - FixUpEventFromWindow(&event, pWin, None, FALSE); - /* Enter/Leave events always set child */ - event.u.enterLeave.child = child; - event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ? - ELFlagSameScreen : 0; -#ifdef XKB - if (!noXkbExtension) { - event.u.enterLeave.state = mouse->button->state & 0x1f00; - event.u.enterLeave.state |= - XkbGrabStateFromRec(&keybd->key->xkbInfo->state); - } else -#endif - event.u.enterLeave.state = keybd->key->state | mouse->button->state; - event.u.enterLeave.mode = mode; - focus = keybd->focus->win; - if ((focus != NoneWin) && - ((pWin == focus) || (focus == PointerRootWin) || - IsParent(focus, pWin))) - event.u.enterLeave.flags |= ELFlagFocus; - if (grab) - (void)TryClientEvents(rClient(grab), &event, 1, mask, - filters[type], grab); - else - (void)DeliverEventsToWindow(pWin, &event, 1, filters[type], - NullGrab, 0); - } - if ((type == EnterNotify) && (mask & KeymapStateMask)) - { - xKeymapEvent ke; - -#ifdef XCSECURITY - ClientPtr client = grab ? rClient(grab) - : clients[CLIENT_ID(pWin->drawable.id)]; - if (!SecurityCheckDeviceAccess(client, keybd, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } - else -#endif - memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31); - ke.type = KeymapNotify; - if (grab) - (void)TryClientEvents(rClient(grab), (xEvent *)&ke, 1, mask, - KeymapStateMask, grab); - else - (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1, - KeymapStateMask, NullGrab, 0); - } -} - -static void -#if NeedFunctionPrototypes -EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail) -#else -EnterNotifies(ancestor, child, mode, detail) - WindowPtr ancestor, child; - int mode, detail; -#endif -{ - WindowPtr parent = child->parent; - - if (ancestor == parent) - return; - EnterNotifies(ancestor, parent, mode, detail); - EnterLeaveEvent(EnterNotify, mode, detail, parent, child->drawable.id); -} - -static void -#if NeedFunctionPrototypes -LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail) -#else -LeaveNotifies(child, ancestor, mode, detail) - WindowPtr child, ancestor; - int detail, mode; -#endif -{ - register WindowPtr pWin; - - if (ancestor == child) - return; - for (pWin = child->parent; pWin != ancestor; pWin = pWin->parent) - { - EnterLeaveEvent(LeaveNotify, mode, detail, pWin, child->drawable.id); - child = pWin; - } -} - -static void -#if NeedFunctionPrototypes -DoEnterLeaveEvents(WindowPtr fromWin, WindowPtr toWin, int mode) -#else -DoEnterLeaveEvents(fromWin, toWin, mode) - WindowPtr fromWin, toWin; - int mode; -#endif -{ - if (fromWin == toWin) - return; - if (IsParent(fromWin, toWin)) - { - EnterLeaveEvent(LeaveNotify, mode, NotifyInferior, fromWin, None); - EnterNotifies(fromWin, toWin, mode, NotifyVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyAncestor, toWin, None); - } - else if (IsParent(toWin, fromWin)) - { - EnterLeaveEvent(LeaveNotify, mode, NotifyAncestor, fromWin, None); - LeaveNotifies(fromWin, toWin, mode, NotifyVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyInferior, toWin, None); - } - else - { /* neither fromWin nor toWin is descendent of the other */ - WindowPtr common = CommonAncestor(toWin, fromWin); - /* common == NullWindow ==> different screens */ - EnterLeaveEvent(LeaveNotify, mode, NotifyNonlinear, fromWin, None); - LeaveNotifies(fromWin, common, mode, NotifyNonlinearVirtual); - EnterNotifies(common, toWin, mode, NotifyNonlinearVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyNonlinear, toWin, None); - } -} - -static void -#if NeedFunctionPrototypes -FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin) -#else -FocusEvent(dev, type, mode, detail, pWin) - DeviceIntPtr dev; - int type, mode, detail; - register WindowPtr pWin; -#endif -{ - xEvent event; - -#ifdef XINPUT - if (dev != inputInfo.keyboard) - { - DeviceFocusEvent(dev, type, mode, detail, pWin); - return; - } -#endif - event.u.focus.mode = mode; - event.u.u.type = type; - event.u.u.detail = detail; - event.u.focus.window = pWin->drawable.id; - (void)DeliverEventsToWindow(pWin, &event, 1, filters[type], NullGrab, - 0); - if ((type == FocusIn) && - ((pWin->eventMask | wOtherEventMasks(pWin)) & KeymapStateMask)) - { - xKeymapEvent ke; -#ifdef XCSECURITY - ClientPtr client = clients[CLIENT_ID(pWin->drawable.id)]; - if (!SecurityCheckDeviceAccess(client, dev, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } - else -#endif - memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31); - ke.type = KeymapNotify; - (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1, - KeymapStateMask, NullGrab, 0); - } -} - - /* - * recursive because it is easier - * no-op if child not descended from ancestor - */ -static Bool -#if NeedFunctionPrototypes -FocusInEvents( - DeviceIntPtr dev, - WindowPtr ancestor, WindowPtr child, WindowPtr skipChild, - int mode, int detail, - Bool doAncestor) -#else -FocusInEvents(dev, ancestor, child, skipChild, mode, detail, doAncestor) - DeviceIntPtr dev; - WindowPtr ancestor, child, skipChild; - int mode, detail; - Bool doAncestor; -#endif -{ - if (child == NullWindow) - return ancestor == NullWindow; - if (ancestor == child) - { - if (doAncestor) - FocusEvent(dev, FocusIn, mode, detail, child); - return TRUE; - } - if (FocusInEvents(dev, ancestor, child->parent, skipChild, mode, detail, - doAncestor)) - { - if (child != skipChild) - FocusEvent(dev, FocusIn, mode, detail, child); - return TRUE; - } - return FALSE; -} - -/* dies horribly if ancestor is not an ancestor of child */ -static void -#if NeedFunctionPrototypes -FocusOutEvents( - DeviceIntPtr dev, - WindowPtr child, WindowPtr ancestor, - int mode, int detail, - Bool doAncestor) -#else -FocusOutEvents(dev, child, ancestor, mode, detail, doAncestor) - DeviceIntPtr dev; - WindowPtr child, ancestor; - int mode; - int detail; - Bool doAncestor; -#endif -{ - register WindowPtr pWin; - - for (pWin = child; pWin != ancestor; pWin = pWin->parent) - FocusEvent(dev, FocusOut, mode, detail, pWin); - if (doAncestor) - FocusEvent(dev, FocusOut, mode, detail, ancestor); -} - -void -DoFocusEvents(dev, fromWin, toWin, mode) - DeviceIntPtr dev; - WindowPtr fromWin, toWin; - int mode; -{ - int out, in; /* for holding details for to/from - PointerRoot/None */ - int i; - - if (fromWin == toWin) - return; - out = (fromWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; - in = (toWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; - /* wrong values if neither, but then not referenced */ - - if ((toWin == NullWindow) || (toWin == PointerRootWin)) - { - if ((fromWin == NullWindow) || (fromWin == PointerRootWin)) - { - if (fromWin == PointerRootWin) - FocusOutEvents(dev, sprite.win, ROOT, mode, NotifyPointer, - TRUE); - /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusOut, mode, out, WindowTable[0]); - else -#endif - for (i=0; iparent, NullWindow, mode, - NotifyNonlinearVirtual, FALSE); - } - /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusIn, mode, in, WindowTable[0]); - else -#endif - for (i=0; iparent != NullWindow) - (void)FocusInEvents(dev, ROOT, toWin, toWin, mode, - NotifyNonlinearVirtual, TRUE); - FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin); - if (IsParent(toWin, sprite.win)) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, mode, - NotifyPointer, FALSE); - } - else - { - if (IsParent(toWin, fromWin)) - { - FocusEvent(dev, FocusOut, mode, NotifyAncestor, fromWin); - FocusOutEvents(dev, fromWin->parent, toWin, mode, - NotifyVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyInferior, toWin); - if ((IsParent(toWin, sprite.win)) && - (sprite.win != fromWin) && - (!IsParent(fromWin, sprite.win)) && - (!IsParent(sprite.win, fromWin))) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, - mode, NotifyPointer, FALSE); - } - else - if (IsParent(fromWin, toWin)) - { - if ((IsParent(fromWin, sprite.win)) && - (sprite.win != fromWin) && - (!IsParent(toWin, sprite.win)) && - (!IsParent(sprite.win, toWin))) - FocusOutEvents(dev, sprite.win, fromWin, mode, - NotifyPointer, FALSE); - FocusEvent(dev, FocusOut, mode, NotifyInferior, fromWin); - (void)FocusInEvents(dev, fromWin, toWin, toWin, mode, - NotifyVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyAncestor, toWin); - } - else - { - /* neither fromWin or toWin is child of other */ - WindowPtr common = CommonAncestor(toWin, fromWin); - /* common == NullWindow ==> different screens */ - if (IsParent(fromWin, sprite.win)) - FocusOutEvents(dev, sprite.win, fromWin, mode, - NotifyPointer, FALSE); - FocusEvent(dev, FocusOut, mode, NotifyNonlinear, fromWin); - if (fromWin->parent != NullWindow) - FocusOutEvents(dev, fromWin->parent, common, mode, - NotifyNonlinearVirtual, FALSE); - if (toWin->parent != NullWindow) - (void)FocusInEvents(dev, common, toWin, toWin, mode, - NotifyNonlinearVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin); - if (IsParent(toWin, sprite.win)) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, - mode, NotifyPointer, FALSE); - } - } - } -} - -int -#if NeedFunctionPrototypes -SetInputFocus( - ClientPtr client, - DeviceIntPtr dev, - Window focusID, - CARD8 revertTo, - Time ctime, - Bool followOK) -#else -SetInputFocus(client, dev, focusID, revertTo, ctime, followOK) - ClientPtr client; - DeviceIntPtr dev; - Window focusID; - CARD8 revertTo; - Time ctime; - Bool followOK; -#endif -{ - register FocusClassPtr focus; - register WindowPtr focusWin; - int mode; - TimeStamp time; - - UpdateCurrentTime(); - if ((revertTo != RevertToParent) && - (revertTo != RevertToPointerRoot) && - (revertTo != RevertToNone) && - ((revertTo != RevertToFollowKeyboard) || !followOK)) - { - client->errorValue = revertTo; - return BadValue; - } - time = ClientTimeToServerTime(ctime); - if ((focusID == None) || (focusID == PointerRoot)) - focusWin = (WindowPtr)(long)focusID; - else if ((focusID == FollowKeyboard) && followOK) - focusWin = inputInfo.keyboard->focus->win; - else if (!(focusWin = SecurityLookupWindow(focusID, client, - SecurityReadAccess))) - return BadWindow; - else - { - /* It is a match error to try to set the input focus to an - unviewable window. */ - - if(!focusWin->realized) - return(BadMatch); - } - focus = dev->focus; - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, focus->time) == EARLIER)) - return Success; - mode = (dev->grab) ? NotifyWhileGrabbed : NotifyNormal; - if (focus->win == FollowKeyboardWin) - DoFocusEvents(dev, inputInfo.keyboard->focus->win, focusWin, mode); - else - DoFocusEvents(dev, focus->win, focusWin, mode); - focus->time = time; - focus->revert = revertTo; - if (focusID == FollowKeyboard) - focus->win = FollowKeyboardWin; - else - focus->win = focusWin; - if ((focusWin == NoneWin) || (focusWin == PointerRootWin)) - focus->traceGood = 0; - else - { - int depth = 0; - register WindowPtr pWin; - - for (pWin = focusWin; pWin; pWin = pWin->parent) depth++; - if (depth > focus->traceSize) - { - focus->traceSize = depth+1; - Must_have_memory = TRUE; /* XXX */ - focus->trace = (WindowPtr *)xrealloc(focus->trace, - focus->traceSize * - sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ - } - focus->traceGood = depth; - for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--) - focus->trace[depth] = pWin; - } - return Success; -} - -int -ProcSetInputFocus(client) - ClientPtr client; -{ - REQUEST(xSetInputFocusReq); - - REQUEST_SIZE_MATCH(xSetInputFocusReq); -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) - return Success; -#endif - return SetInputFocus(client, inputInfo.keyboard, stuff->focus, - stuff->revertTo, stuff->time, FALSE); -} - -int -ProcGetInputFocus(client) - ClientPtr client; -{ - xGetInputFocusReply rep; - /* REQUEST(xReq); */ - FocusClassPtr focus = inputInfo.keyboard->focus; - - REQUEST_SIZE_MATCH(xReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (focus->win == NoneWin) - rep.focus = None; - else if (focus->win == PointerRootWin) - rep.focus = PointerRoot; - else rep.focus = focus->win->drawable.id; - rep.revertTo = focus->revert; - WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep); - return Success; -} - -int -ProcGrabPointer(client) - ClientPtr client; -{ - xGrabPointerReply rep; - DeviceIntPtr device = inputInfo.pointer; - GrabPtr grab; - WindowPtr pWin, confineTo; - CursorPtr cursor, oldCursor; - REQUEST(xGrabPointerReq); - TimeStamp time; - - REQUEST_SIZE_MATCH(xGrabPointerReq); - UpdateCurrentTime(); - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue)) - { - client->errorValue = stuff->ownerEvents; - return BadValue; - } - if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (stuff->confineTo == None) - confineTo = NullWindow; - else - { - confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); - if (!confineTo) - return BadWindow; - } - if (stuff->cursor == None) - cursor = NullCursor; - else - { - cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - /* at this point, some sort of reply is guaranteed. */ - time = ClientTimeToServerTime(stuff->time); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - grab = device->grab; - if ((grab) && !SameClient(grab, client)) - rep.status = AlreadyGrabbed; - else if ((!pWin->realized) || - (confineTo && - !(confineTo->realized && BorderSizeNotEmpty(confineTo)))) - rep.status = GrabNotViewable; - else if (device->sync.frozen && - device->sync.other && !SameClient(device->sync.other, client)) - rep.status = GrabFrozen; - else if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, device->grabTime) == EARLIER)) - rep.status = GrabInvalidTime; - else - { - GrabRec tempGrab; - - oldCursor = NullCursor; - if (grab) - { - if (grab->confineTo && !confineTo) - ConfineCursorToWindow(ROOT, FALSE, FALSE); - oldCursor = grab->cursor; - } - tempGrab.cursor = cursor; - tempGrab.resource = client->clientAsMask; - tempGrab.ownerEvents = stuff->ownerEvents; - tempGrab.eventMask = stuff->eventMask; - tempGrab.confineTo = confineTo; - tempGrab.window = pWin; - tempGrab.keyboardMode = stuff->keyboardMode; - tempGrab.pointerMode = stuff->pointerMode; - tempGrab.device = device; - (*device->ActivateGrab)(device, &tempGrab, time, FALSE); - if (oldCursor) - FreeCursor (oldCursor, (Cursor)0); - rep.status = GrabSuccess; - } - WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep); - return Success; -} - -int -ProcChangeActivePointerGrab(client) - ClientPtr client; -{ - DeviceIntPtr device = inputInfo.pointer; - register GrabPtr grab = device->grab; - CursorPtr newCursor, oldCursor; - REQUEST(xChangeActivePointerGrabReq); - TimeStamp time; - - REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); - if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - if (stuff->cursor == None) - newCursor = NullCursor; - else - { - newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!newCursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - if (!grab) - return Success; - if (!SameClient(grab, client)) - return Success; - time = ClientTimeToServerTime(stuff->time); - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, device->grabTime) == EARLIER)) - return Success; - oldCursor = grab->cursor; - grab->cursor = newCursor; - if (newCursor) - newCursor->refcnt++; - PostNewCursor(); - if (oldCursor) - FreeCursor(oldCursor, (Cursor)0); - grab->eventMask = stuff->eventMask; - return Success; -} - -int -ProcUngrabPointer(client) - ClientPtr client; -{ - DeviceIntPtr device = inputInfo.pointer; - GrabPtr grab; - TimeStamp time; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - UpdateCurrentTime(); - grab = device->grab; - time = ClientTimeToServerTime(stuff->id); - if ((CompareTimeStamps(time, currentTime) != LATER) && - (CompareTimeStamps(time, device->grabTime) != EARLIER) && - (grab) && SameClient(grab, client)) - (*device->DeactivateGrab)(device); - return Success; -} - -int -GrabDevice(client, dev, this_mode, other_mode, grabWindow, ownerEvents, ctime, - mask, status) - register ClientPtr client; - register DeviceIntPtr dev; - unsigned this_mode; - unsigned other_mode; - Window grabWindow; - unsigned ownerEvents; - Time ctime; - Mask mask; - CARD8 *status; -{ - register WindowPtr pWin; - register GrabPtr grab; - TimeStamp time; - - UpdateCurrentTime(); - if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync)) - { - client->errorValue = this_mode; - return BadValue; - } - if ((other_mode != GrabModeSync) && (other_mode != GrabModeAsync)) - { - client->errorValue = other_mode; - return BadValue; - } - if ((ownerEvents != xFalse) && (ownerEvents != xTrue)) - { - client->errorValue = ownerEvents; - return BadValue; - } - pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - time = ClientTimeToServerTime(ctime); - grab = dev->grab; - if (grab && !SameClient(grab, client)) - *status = AlreadyGrabbed; - else if (!pWin->realized) - *status = GrabNotViewable; - else if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, dev->grabTime) == EARLIER)) - *status = GrabInvalidTime; - else if (dev->sync.frozen && - dev->sync.other && !SameClient(dev->sync.other, client)) - *status = GrabFrozen; - else - { - GrabRec tempGrab; - - tempGrab.window = pWin; - tempGrab.resource = client->clientAsMask; - tempGrab.ownerEvents = ownerEvents; - tempGrab.keyboardMode = this_mode; - tempGrab.pointerMode = other_mode; - tempGrab.eventMask = mask; - tempGrab.device = dev; - (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE); - *status = GrabSuccess; - } - return Success; -} - -int -ProcGrabKeyboard(client) - ClientPtr client; -{ - xGrabKeyboardReply rep; - REQUEST(xGrabKeyboardReq); - int result; - - REQUEST_SIZE_MATCH(xGrabKeyboardReq); -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) - { - result = Success; - rep.status = AlreadyGrabbed; - } - else -#endif - result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode, - stuff->pointerMode, stuff->grabWindow, - stuff->ownerEvents, stuff->time, - KeyPressMask | KeyReleaseMask, &rep.status); - if (result != Success) - return result; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep); - return Success; -} - -int -ProcUngrabKeyboard(client) - ClientPtr client; -{ - DeviceIntPtr device = inputInfo.keyboard; - GrabPtr grab; - TimeStamp time; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - UpdateCurrentTime(); - grab = device->grab; - time = ClientTimeToServerTime(stuff->id); - if ((CompareTimeStamps(time, currentTime) != LATER) && - (CompareTimeStamps(time, device->grabTime) != EARLIER) && - (grab) && SameClient(grab, client)) - (*device->DeactivateGrab)(device); - return Success; -} - -int -ProcQueryPointer(client) - ClientPtr client; -{ - xQueryPointerReply rep; - WindowPtr pWin, t; - REQUEST(xResourceReq); - DeviceIntPtr mouse = inputInfo.pointer; - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (mouse->valuator->motionHintWindow) - MaybeStopHint(mouse, client); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.mask = mouse->button->state | inputInfo.keyboard->key->state; - rep.length = 0; - rep.root = (ROOT)->drawable.id; - rep.rootX = sprite.hot.x; - rep.rootY = sprite.hot.y; - rep.child = None; - if (sprite.hot.pScreen == pWin->drawable.pScreen) - { - rep.sameScreen = xTrue; - rep.winX = sprite.hot.x - pWin->drawable.x; - rep.winY = sprite.hot.y - pWin->drawable.y; - for (t = sprite.win; t; t = t->parent) - if (t->parent == pWin) - { - rep.child = t->drawable.id; - break; - } - } - else - { - rep.sameScreen = xFalse; - rep.winX = 0; - rep.winY = 0; - } - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - rep.rootX += panoramiXdataPtr[0].x; - rep.rootY += panoramiXdataPtr[0].y; - if(stuff->id == rep.root) { - rep.winX += panoramiXdataPtr[0].x; - rep.winY += panoramiXdataPtr[0].y; - } - } -#endif - - WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep); - - return(Success); -} - -void -InitEvents() -{ - int i; - - sprite.hot.pScreen = sprite.hotPhys.pScreen = (ScreenPtr)NULL; - inputInfo.numDevices = 0; - inputInfo.devices = (DeviceIntPtr)NULL; - inputInfo.off_devices = (DeviceIntPtr)NULL; - inputInfo.keyboard = (DeviceIntPtr)NULL; - inputInfo.pointer = (DeviceIntPtr)NULL; - if (spriteTraceSize == 0) - { - spriteTraceSize = 32; - spriteTrace = (WindowPtr *)xalloc(32*sizeof(WindowPtr)); - if (!spriteTrace) - FatalError("failed to allocate spriteTrace"); - } - spriteTraceGood = 0; - lastEventMask = OwnerGrabButtonMask; - filters[MotionNotify] = PointerMotionMask; - sprite.win = NullWindow; - sprite.current = NullCursor; - sprite.hotLimits.x1 = 0; - sprite.hotLimits.y1 = 0; - sprite.hotLimits.x2 = 0; - sprite.hotLimits.y2 = 0; - sprite.confined = FALSE; - syncEvents.replayDev = (DeviceIntPtr)NULL; - syncEvents.replayWin = NullWindow; - while (syncEvents.pending) - { - QdEventPtr next = syncEvents.pending->next; - xfree(syncEvents.pending); - syncEvents.pending = next; - } - syncEvents.pendtail = &syncEvents.pending; - syncEvents.playingEvents = FALSE; - syncEvents.time.months = 0; - syncEvents.time.milliseconds = 0; /* hardly matters */ - currentTime.months = 0; - currentTime.milliseconds = GetTimeInMillis(); - lastDeviceEventTime = currentTime; - for (i = 0; i < DNPMCOUNT; i++) - { - DontPropagateMasks[i] = 0; - DontPropagateRefCnts[i] = 0; - } -} - -void -CloseDownEvents(void) -{ - xfree(spriteTrace); - spriteTrace = NULL; - spriteTraceSize = 0; -} - -int -ProcSendEvent(client) - ClientPtr client; -{ - WindowPtr pWin; - WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */ - REQUEST(xSendEventReq); - - REQUEST_SIZE_MATCH(xSendEventReq); - - /* The client's event type must be a core event type or one defined by an - extension. */ - - if ( ! ((stuff->event.u.u.type > X_Reply && - stuff->event.u.u.type < LASTEvent) || - (stuff->event.u.u.type >= EXTENSION_EVENT_BASE && - stuff->event.u.u.type < (unsigned)lastEvent))) - { - client->errorValue = stuff->event.u.u.type; - return BadValue; - } - if (stuff->event.u.u.type == ClientMessage && - stuff->event.u.u.detail != 8 && - stuff->event.u.u.detail != 16 && - stuff->event.u.u.detail != 32 && - !permitOldBugs) - { - client->errorValue = stuff->event.u.u.detail; - return BadValue; - } - if ((stuff->eventMask & ~AllEventMasks) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - - if (stuff->destination == PointerWindow) - pWin = sprite.win; - else if (stuff->destination == InputFocus) - { - WindowPtr inputFocus = inputInfo.keyboard->focus->win; - - if (inputFocus == NoneWin) - return Success; - - /* If the input focus is PointerRootWin, send the event to where - the pointer is if possible, then perhaps propogate up to root. */ - if (inputFocus == PointerRootWin) - inputFocus = ROOT; - - if (IsParent(inputFocus, sprite.win)) - { - effectiveFocus = inputFocus; - pWin = sprite.win; - } - else - effectiveFocus = pWin = inputFocus; - } - else - pWin = SecurityLookupWindow(stuff->destination, client, - SecurityReadAccess); - if (!pWin) - return BadWindow; - if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) - { - client->errorValue = stuff->propagate; - return BadValue; - } - stuff->event.u.u.type |= 0x80; - if (stuff->propagate) - { - for (;pWin; pWin = pWin->parent) - { - if (DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask, - NullGrab, 0)) - return Success; - if (pWin == effectiveFocus) - return Success; - stuff->eventMask &= ~wDontPropagateMask(pWin); - if (!stuff->eventMask) - break; - } - } - else - (void)DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask, - NullGrab, 0); - return Success; -} - -int -ProcUngrabKey(client) - ClientPtr client; -{ - REQUEST(xUngrabKeyReq); - WindowPtr pWin; - GrabRec tempGrab; - DeviceIntPtr keybd = inputInfo.keyboard; - - REQUEST_SIZE_MATCH(xUngrabKeyReq); - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - - if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) || - (stuff->key < keybd->key->curKeySyms.minKeyCode)) - && (stuff->key != AnyKey)) - { - client->errorValue = stuff->key; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - tempGrab.resource = client->clientAsMask; - tempGrab.device = keybd; - tempGrab.window = pWin; - tempGrab.modifiersDetail.exact = stuff->modifiers; - tempGrab.modifiersDetail.pMask = NULL; - tempGrab.modifierDevice = inputInfo.keyboard; - tempGrab.type = KeyPress; - tempGrab.detail.exact = stuff->key; - tempGrab.detail.pMask = NULL; - - if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); -} - -int -ProcGrabKey(client) - ClientPtr client; -{ - WindowPtr pWin; - REQUEST(xGrabKeyReq); - GrabPtr grab; - DeviceIntPtr keybd = inputInfo.keyboard; - - REQUEST_SIZE_MATCH(xGrabKeyReq); - if ((stuff->ownerEvents != xTrue) && (stuff->ownerEvents != xFalse)) - { - client->errorValue = stuff->ownerEvents; - return(BadValue); - } - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) || - (stuff->key < keybd->key->curKeySyms.minKeyCode)) - && (stuff->key != AnyKey)) - { - client->errorValue = stuff->key; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - - grab = CreateGrab(client->index, keybd, pWin, - (Mask)(KeyPressMask | KeyReleaseMask), (Bool)stuff->ownerEvents, - (Bool)stuff->keyboardMode, (Bool)stuff->pointerMode, - keybd, stuff->modifiers, KeyPress, stuff->key, - NullWindow, NullCursor); - if (!grab) - return BadAlloc; - return AddPassiveGrabToList(grab); -} - - -int -ProcGrabButton(client) - ClientPtr client; -{ - WindowPtr pWin, confineTo; - REQUEST(xGrabButtonReq); - CursorPtr cursor; - GrabPtr grab; - - REQUEST_SIZE_MATCH(xGrabButtonReq); - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue)) - { - client->errorValue = stuff->ownerEvents; - return BadValue; - } - if (stuff->eventMask & ~PointerGrabMask) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (stuff->confineTo == None) - confineTo = NullWindow; - else { - confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); - if (!confineTo) - return BadWindow; - } - if (stuff->cursor == None) - cursor = NullCursor; - else - { - cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - - - grab = CreateGrab(client->index, inputInfo.pointer, pWin, - permitOldBugs ? (Mask)(stuff->eventMask | - ButtonPressMask | ButtonReleaseMask) : - (Mask)stuff->eventMask, - (Bool)stuff->ownerEvents, (Bool) stuff->keyboardMode, - (Bool)stuff->pointerMode, inputInfo.keyboard, stuff->modifiers, - ButtonPress, stuff->button, confineTo, cursor); - if (!grab) - return BadAlloc; - return AddPassiveGrabToList(grab); -} - -int -ProcUngrabButton(client) - ClientPtr client; -{ - REQUEST(xUngrabButtonReq); - WindowPtr pWin; - GrabRec tempGrab; - - REQUEST_SIZE_MATCH(xUngrabButtonReq); - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - tempGrab.resource = client->clientAsMask; - tempGrab.device = inputInfo.pointer; - tempGrab.window = pWin; - tempGrab.modifiersDetail.exact = stuff->modifiers; - tempGrab.modifiersDetail.pMask = NULL; - tempGrab.modifierDevice = inputInfo.keyboard; - tempGrab.type = ButtonPress; - tempGrab.detail.exact = stuff->button; - tempGrab.detail.pMask = NULL; - - if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); -} - -void -DeleteWindowFromAnyEvents(pWin, freeResources) - WindowPtr pWin; - Bool freeResources; -{ - WindowPtr parent; - DeviceIntPtr mouse = inputInfo.pointer; - DeviceIntPtr keybd = inputInfo.keyboard; - FocusClassPtr focus = keybd->focus; - OtherClientsPtr oc; - GrabPtr passive; - - - /* Deactivate any grabs performed on this window, before making any - input focus changes. */ - - if (mouse->grab && - ((mouse->grab->window == pWin) || (mouse->grab->confineTo == pWin))) - (*mouse->DeactivateGrab)(mouse); - - /* Deactivating a keyboard grab should cause focus events. */ - - if (keybd->grab && (keybd->grab->window == pWin)) - (*keybd->DeactivateGrab)(keybd); - - /* If the focus window is a root window (ie. has no parent) then don't - delete the focus from it. */ - - if ((pWin == focus->win) && (pWin->parent != NullWindow)) - { - int focusEventMode = NotifyNormal; - - /* If a grab is in progress, then alter the mode of focus events. */ - - if (keybd->grab) - focusEventMode = NotifyWhileGrabbed; - - switch (focus->revert) - { - case RevertToNone: - DoFocusEvents(keybd, pWin, NoneWin, focusEventMode); - focus->win = NoneWin; - focus->traceGood = 0; - break; - case RevertToParent: - parent = pWin; - do - { - parent = parent->parent; - focus->traceGood--; - } while (!parent->realized -/* This would be a good protocol change -- windows being reparented - during SaveSet processing would cause the focus to revert to the - nearest enclosing window which will survive the death of the exiting - client, instead of ending up reverting to a dying window and thence - to None - */ -#ifdef NOTDEF - || clients[CLIENT_ID(parent->drawable.id)]->clientGone -#endif - ); - DoFocusEvents(keybd, pWin, parent, focusEventMode); - focus->win = parent; - focus->revert = RevertToNone; - break; - case RevertToPointerRoot: - DoFocusEvents(keybd, pWin, PointerRootWin, focusEventMode); - focus->win = PointerRootWin; - focus->traceGood = 0; - break; - } - } - - if (mouse->valuator->motionHintWindow == pWin) - mouse->valuator->motionHintWindow = NullWindow; - - if (freeResources) - { - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]--; - while ( (oc = wOtherClients(pWin)) ) - FreeResource(oc->resource, RT_NONE); - while ( (passive = wPassiveGrabs(pWin)) ) - FreeResource(passive->resource, RT_NONE); - } -#ifdef XINPUT - DeleteWindowFromAnyExtEvents(pWin, freeResources); -#endif -} - -/* Call this whenever some window at or below pWin has changed geometry */ - -/*ARGSUSED*/ -void -CheckCursorConfinement(pWin) - WindowPtr pWin; -{ - GrabPtr grab = inputInfo.pointer->grab; - WindowPtr confineTo; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return; -#endif - - if (grab && (confineTo = grab->confineTo)) - { - if (!BorderSizeNotEmpty(confineTo)) - (*inputInfo.pointer->DeactivateGrab)(inputInfo.pointer); - else if ((pWin == confineTo) || IsParent(pWin, confineTo)) - ConfineCursorToWindow(confineTo, TRUE, TRUE); - } -} - -Mask -EventMaskForClient(pWin, client) - WindowPtr pWin; - ClientPtr client; -{ - register OtherClientsPtr other; - - if (wClient (pWin) == client) - return pWin->eventMask; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (SameClient(other, client)) - return other->mask; - } - return 0; -} - -int -ProcRecolorCursor(client) - ClientPtr client; -{ - CursorPtr pCursor; - int nscr; - ScreenPtr pscr; - Bool displayed; - REQUEST(xRecolorCursorReq); - - REQUEST_SIZE_MATCH(xRecolorCursorReq); - pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityWriteAccess); - if ( !pCursor) - { - client->errorValue = stuff->cursor; - return (BadCursor); - } - - pCursor->foreRed = stuff->foreRed; - pCursor->foreGreen = stuff->foreGreen; - pCursor->foreBlue = stuff->foreBlue; - - pCursor->backRed = stuff->backRed; - pCursor->backGreen = stuff->backGreen; - pCursor->backBlue = stuff->backBlue; - - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) - { - pscr = screenInfo.screens[nscr]; -#ifdef PANORAMIX - if(!noPanoramiXExtension) - displayed = (pscr == sprite.screen); - else -#endif - displayed = (pscr == sprite.hotPhys.pScreen); - ( *pscr->RecolorCursor)(pscr, pCursor, - (pCursor == sprite.current) && displayed); - } - return (Success); -} - -void -WriteEventsToClient(pClient, count, events) - ClientPtr pClient; - int count; - xEvent *events; -{ -#ifdef PANORAMIX - xEvent eventCopy; -#endif - xEvent eventTo, *eventFrom; - int i; - -#ifdef XKB - if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events))) - return; -#endif - -#ifdef PANORAMIX - if(!noPanoramiXExtension && - (panoramiXdataPtr[0].x || panoramiXdataPtr[0].y)) - { - switch(events->u.u.type) { - case MotionNotify: - case ButtonPress: - case ButtonRelease: - case KeyPress: - case KeyRelease: - case EnterNotify: - case LeaveNotify: - /* - When multiple clients want the same event DeliverEventsToWindow - passes the same event structure multiple times so we can't - modify the one passed to us - */ - count = 1; /* should always be 1 */ - memcpy(&eventCopy, events, sizeof(xEvent)); - eventCopy.u.keyButtonPointer.rootX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.rootY += panoramiXdataPtr[0].y; - if(eventCopy.u.keyButtonPointer.event == - eventCopy.u.keyButtonPointer.root) - { - eventCopy.u.keyButtonPointer.eventX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.eventY += panoramiXdataPtr[0].y; - } - events = &eventCopy; - break; - default: break; - } - } -#endif - - if (EventCallback) - { - EventInfoRec eventinfo; - eventinfo.client = pClient; - eventinfo.events = events; - eventinfo.count = count; - CallCallbacks(&EventCallback, (pointer)&eventinfo); - } - if(pClient->swapped) - { - for(i = 0; i < count; i++) - { - eventFrom = &events[i]; - /* Remember to strip off the leading bit of type in case - this event was sent with "SendEvent." */ - (*EventSwapVector[eventFrom->u.u.type & 0177]) - (eventFrom, &eventTo); - (void)WriteToClient(pClient, sizeof(xEvent), (char *)&eventTo); - } - } - else - { - (void)WriteToClient(pClient, count * sizeof(xEvent), (char *) events); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original deleted file mode 100644 index 1d86bf870..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original +++ /dev/null @@ -1,528 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXextension.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: extension.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" -#define NEED_EVENTS -#define NEED_REPLIES -#include "Xproto.h" -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "gcstruct.h" -#include "scrnintstr.h" -#include "../../dix/dispatch.h" -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif -#ifdef LBX -#include "lbxserve.h" -#endif - -#include "Trap.h" - -#define EXTENSION_BASE 128 -#define EXTENSION_EVENT_BASE 64 -#define LAST_EVENT 128 -#define LAST_ERROR 255 - -ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS]; - -static ExtensionEntry **extensions = (ExtensionEntry **)NULL; - -int lastEvent = EXTENSION_EVENT_BASE; -static int lastError = FirstExtensionError; -static unsigned int NumExtensions = 0; - -ExtensionEntry * -AddExtension(char *name, int NumEvents, int NumErrors, - int (*MainProc)(ClientPtr c1), - int (*SwappedMainProc)(ClientPtr c2), - void (*CloseDownProc)(ExtensionEntry *e), - unsigned short (*MinorOpcodeProc)(ClientPtr c3)) -{ - int i; - register ExtensionEntry *ext, **newexts; - - if (!MainProc || !SwappedMainProc || !CloseDownProc || !MinorOpcodeProc) - return((ExtensionEntry *) NULL); - if ((lastEvent + NumEvents > LAST_EVENT) || - (unsigned)(lastError + NumErrors > LAST_ERROR)) - return((ExtensionEntry *) NULL); - - ext = (ExtensionEntry *) xalloc(sizeof(ExtensionEntry)); - if (!ext) - return((ExtensionEntry *) NULL); - ext->name = (char *)xalloc(strlen(name) + 1); - ext->num_aliases = 0; - ext->aliases = (char **)NULL; - if (!ext->name) - { - xfree(ext); - return((ExtensionEntry *) NULL); - } - strcpy(ext->name, name); - i = NumExtensions; - newexts = (ExtensionEntry **) xrealloc(extensions, - (i + 1) * sizeof(ExtensionEntry *)); - if (!newexts) - { - xfree(ext->name); - xfree(ext); - return((ExtensionEntry *) NULL); - } - NumExtensions++; - extensions = newexts; - extensions[i] = ext; - ext->index = i; - ext->base = i + EXTENSION_BASE; - ext->CloseDown = CloseDownProc; - ext->MinorOpcode = MinorOpcodeProc; - ProcVector[i + EXTENSION_BASE] = MainProc; - SwappedProcVector[i + EXTENSION_BASE] = SwappedMainProc; - if (NumEvents) - { - ext->eventBase = lastEvent; - ext->eventLast = lastEvent + NumEvents; - lastEvent += NumEvents; - } - else - { - ext->eventBase = 0; - ext->eventLast = 0; - } - if (NumErrors) - { - ext->errorBase = lastError; - ext->errorLast = lastError + NumErrors; - lastError += NumErrors; - } - else - { - ext->errorBase = 0; - ext->errorLast = 0; - } -#ifdef XCSECURITY - ext->secure = FALSE; -#endif - -#ifdef LBX - (void) LbxAddExtension(name, ext->base, ext->eventBase, ext->errorBase); -#endif - return(ext); -} - -Bool AddExtensionAlias(alias, ext) - char *alias; - ExtensionEntry *ext; -{ - char *name; - char **aliases; - - aliases = (char **)xrealloc(ext->aliases, - (ext->num_aliases + 1) * sizeof(char *)); - if (!aliases) - return FALSE; - ext->aliases = aliases; - name = (char *)xalloc(strlen(alias) + 1); - if (!name) - return FALSE; - strcpy(name, alias); - ext->aliases[ext->num_aliases] = name; - ext->num_aliases++; -#ifdef LBX - return LbxAddExtensionAlias(ext->index, alias); -#else - return TRUE; -#endif -} - -static int -FindExtension(char *extname, int len) -{ - int i, j; - - for (i=0; iname) == len) && - !strncmp(extname, extensions[i]->name, len)) - break; - for (j = extensions[i]->num_aliases; --j >= 0;) - { - if ((strlen(extensions[i]->aliases[j]) == len) && - !strncmp(extname, extensions[i]->aliases[j], len)) - break; - } - if (j >= 0) break; - } - return ((i == NumExtensions) ? -1 : i); -} - -/* - * CheckExtension returns the extensions[] entry for the requested - * extension name. Maybe this could just return a Bool instead? - */ -ExtensionEntry * -CheckExtension(const char *extname) -{ - int n; - - n = FindExtension((char*)extname, strlen(extname)); - if (n != -1) - return extensions[n]; - else - return NULL; -} - -void -DeclareExtensionSecurity(extname, secure) - char *extname; - Bool secure; -{ -#ifdef XCSECURITY - int i = FindExtension(extname, strlen(extname)); - if (i >= 0) - { - int majorop = extensions[i]->base; - extensions[i]->secure = secure; - if (secure) - { - UntrustedProcVector[majorop] = ProcVector[majorop]; - SwappedUntrustedProcVector[majorop] = SwappedProcVector[majorop]; - } - else - { - UntrustedProcVector[majorop] = ProcBadRequest; - SwappedUntrustedProcVector[majorop] = ProcBadRequest; - } - } -#endif -#ifdef LBX - LbxDeclareExtensionSecurity(extname, secure); -#endif -} - -unsigned short -StandardMinorOpcode(client) - ClientPtr client; -{ - return ((xReq *)client->requestBuffer)->data; -} - -unsigned short -MinorOpcodeOfRequest(client) - ClientPtr client; -{ - unsigned char major; - - major = ((xReq *)client->requestBuffer)->reqType; - if (major < EXTENSION_BASE) - return 0; - major -= EXTENSION_BASE; - if (major >= NumExtensions) - return 0; - return (*extensions[major]->MinorOpcode)(client); -} - -void -CloseDownExtensions() -{ - register int i,j; - -#ifdef LBX - LbxCloseDownExtensions(); -#endif - - for (i = NumExtensions - 1; i >= 0; i--) - { - (* extensions[i]->CloseDown)(extensions[i]); - NumExtensions = i; - xfree(extensions[i]->name); - for (j = extensions[i]->num_aliases; --j >= 0;) - xfree(extensions[i]->aliases[j]); - xfree(extensions[i]->aliases); - xfree(extensions[i]); - } - xfree(extensions); - extensions = (ExtensionEntry **)NULL; - lastEvent = EXTENSION_EVENT_BASE; - lastError = FirstExtensionError; - for (i=0; inum) - { - spentry->num--; - xfree(spentry->procList[spentry->num].name); - } - xfree(spentry->procList); - spentry->procList = (ProcEntryPtr)NULL; - } -} - - -int -ProcQueryExtension(client) - ClientPtr client; -{ - xQueryExtensionReply reply; - int i; - REQUEST(xQueryExtensionReq); - - REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes); - - reply.type = X_Reply; - reply.length = 0; - reply.major_opcode = 0; - reply.sequenceNumber = client->sequence; - - if ( ! NumExtensions ) - reply.present = xFalse; - else - { - i = FindExtension((char *)&stuff[1], stuff->nbytes); - if (i < 0 - - /* - * Hide RENDER if our implementation - * is faulty. - */ - - || (nxagentRenderTrap && strcmp(extensions[i]->name, "RENDER") == 0) -#ifdef XCSECURITY - /* don't show insecure extensions to untrusted clients */ - || (client->trustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) -#endif - ) - reply.present = xFalse; - else - { - reply.present = xTrue; - reply.major_opcode = extensions[i]->base; - reply.first_event = extensions[i]->eventBase; - reply.first_error = extensions[i]->errorBase; - } - } - WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply); - return(client->noClientException); -} - -int -ProcListExtensions(client) - ClientPtr client; -{ - xListExtensionsReply reply; - char *bufptr, *buffer; - int total_length = 0; - - REQUEST_SIZE_MATCH(xReq); - - reply.type = X_Reply; - reply.nExtensions = 0; - reply.length = 0; - reply.sequenceNumber = client->sequence; - buffer = NULL; - - if ( NumExtensions ) - { - register int i, j; - - for (i=0; itrustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) - continue; -#endif - /* - * Hide RENDER if our implementation - * is faulty. - */ - - if (nxagentRenderTrap && strcmp(extensions[i]->name, "RENDER") == 0) - continue; - - total_length += strlen(extensions[i]->name) + 1; - reply.nExtensions += 1 + extensions[i]->num_aliases; - for (j = extensions[i]->num_aliases; --j >= 0;) - total_length += strlen(extensions[i]->aliases[j]) + 1; - } - reply.length = (total_length + 3) >> 2; - buffer = bufptr = (char *)ALLOCATE_LOCAL(total_length); - if (!buffer) - return(BadAlloc); - for (i=0; itrustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) - continue; -#endif - *bufptr++ = len = strlen(extensions[i]->name); - memmove(bufptr, extensions[i]->name, len); - bufptr += len; - for (j = extensions[i]->num_aliases; --j >= 0;) - { - *bufptr++ = len = strlen(extensions[i]->aliases[j]); - memmove(bufptr, extensions[i]->aliases[j], len); - bufptr += len; - } - } - } - WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply); - if (reply.length) - { - WriteToClient(client, total_length, buffer); - DEALLOCATE_LOCAL(buffer); - } - return(client->noClientException); -} - - -ExtensionLookupProc -LookupProc(name, pGC) - char *name; - GCPtr pGC; -{ - register int i; - register ScreenProcEntry *spentry; - spentry = &AuxillaryScreenProcs[pGC->pScreen->myNum]; - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - return(spentry->procList[i].proc); - } - return (ExtensionLookupProc)NULL; -} - -Bool -RegisterProc(name, pGC, proc) - char *name; - GC *pGC; - ExtensionLookupProc proc; -{ - return RegisterScreenProc(name, pGC->pScreen, proc); -} - -Bool -RegisterScreenProc(name, pScreen, proc) - char *name; - ScreenPtr pScreen; - ExtensionLookupProc proc; -{ - register ScreenProcEntry *spentry; - register ProcEntryPtr procEntry = (ProcEntryPtr)NULL; - char *newname; - int i; - - spentry = &AuxillaryScreenProcs[pScreen->myNum]; - /* first replace duplicates */ - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - { - procEntry = &spentry->procList[i]; - break; - } - } - if (procEntry) - procEntry->proc = proc; - else - { - newname = (char *)xalloc(strlen(name)+1); - if (!newname) - return FALSE; - procEntry = (ProcEntryPtr) - xrealloc(spentry->procList, - sizeof(ProcEntryRec) * (spentry->num+1)); - if (!procEntry) - { - xfree(newname); - return FALSE; - } - spentry->procList = procEntry; - procEntry += spentry->num; - procEntry->name = newname; - strcpy(newname, name); - procEntry->proc = proc; - spentry->num++; - } - return TRUE; -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.XF86.original deleted file mode 100644 index 36f053f02..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.XF86.original +++ /dev/null @@ -1,486 +0,0 @@ -/* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: extension.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" -#define NEED_EVENTS -#define NEED_REPLIES -#include "Xproto.h" -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "gcstruct.h" -#include "scrnintstr.h" -#include "dispatch.h" -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif -#ifdef LBX -#include "lbxserve.h" -#endif - -#define EXTENSION_BASE 128 -#define EXTENSION_EVENT_BASE 64 -#define LAST_EVENT 128 -#define LAST_ERROR 255 - -ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS]; - -static ExtensionEntry **extensions = (ExtensionEntry **)NULL; - -int lastEvent = EXTENSION_EVENT_BASE; -static int lastError = FirstExtensionError; -static unsigned int NumExtensions = 0; - -ExtensionEntry * -AddExtension(char *name, int NumEvents, int NumErrors, - int (*MainProc)(ClientPtr c1), - int (*SwappedMainProc)(ClientPtr c2), - void (*CloseDownProc)(ExtensionEntry *e), - unsigned short (*MinorOpcodeProc)(ClientPtr c3)) -{ - int i; - register ExtensionEntry *ext, **newexts; - - if (!MainProc || !SwappedMainProc || !CloseDownProc || !MinorOpcodeProc) - return((ExtensionEntry *) NULL); - if ((lastEvent + NumEvents > LAST_EVENT) || - (unsigned)(lastError + NumErrors > LAST_ERROR)) - return((ExtensionEntry *) NULL); - - ext = (ExtensionEntry *) xalloc(sizeof(ExtensionEntry)); - if (!ext) - return((ExtensionEntry *) NULL); - ext->name = (char *)xalloc(strlen(name) + 1); - ext->num_aliases = 0; - ext->aliases = (char **)NULL; - if (!ext->name) - { - xfree(ext); - return((ExtensionEntry *) NULL); - } - strcpy(ext->name, name); - i = NumExtensions; - newexts = (ExtensionEntry **) xrealloc(extensions, - (i + 1) * sizeof(ExtensionEntry *)); - if (!newexts) - { - xfree(ext->name); - xfree(ext); - return((ExtensionEntry *) NULL); - } - NumExtensions++; - extensions = newexts; - extensions[i] = ext; - ext->index = i; - ext->base = i + EXTENSION_BASE; - ext->CloseDown = CloseDownProc; - ext->MinorOpcode = MinorOpcodeProc; - ProcVector[i + EXTENSION_BASE] = MainProc; - SwappedProcVector[i + EXTENSION_BASE] = SwappedMainProc; - if (NumEvents) - { - ext->eventBase = lastEvent; - ext->eventLast = lastEvent + NumEvents; - lastEvent += NumEvents; - } - else - { - ext->eventBase = 0; - ext->eventLast = 0; - } - if (NumErrors) - { - ext->errorBase = lastError; - ext->errorLast = lastError + NumErrors; - lastError += NumErrors; - } - else - { - ext->errorBase = 0; - ext->errorLast = 0; - } -#ifdef XCSECURITY - ext->secure = FALSE; -#endif - -#ifdef LBX - (void) LbxAddExtension(name, ext->base, ext->eventBase, ext->errorBase); -#endif - return(ext); -} - -Bool AddExtensionAlias(alias, ext) - char *alias; - ExtensionEntry *ext; -{ - char *name; - char **aliases; - - aliases = (char **)xrealloc(ext->aliases, - (ext->num_aliases + 1) * sizeof(char *)); - if (!aliases) - return FALSE; - ext->aliases = aliases; - name = (char *)xalloc(strlen(alias) + 1); - if (!name) - return FALSE; - strcpy(name, alias); - ext->aliases[ext->num_aliases] = name; - ext->num_aliases++; -#ifdef LBX - return LbxAddExtensionAlias(ext->index, alias); -#else - return TRUE; -#endif -} - -static int -FindExtension(char *extname, int len) -{ - int i, j; - - for (i=0; iname) == len) && - !strncmp(extname, extensions[i]->name, len)) - break; - for (j = extensions[i]->num_aliases; --j >= 0;) - { - if ((strlen(extensions[i]->aliases[j]) == len) && - !strncmp(extname, extensions[i]->aliases[j], len)) - break; - } - if (j >= 0) break; - } - return ((i == NumExtensions) ? -1 : i); -} - -/* - * CheckExtension returns the extensions[] entry for the requested - * extension name. Maybe this could just return a Bool instead? - */ -ExtensionEntry * -CheckExtension(const char *extname) -{ - int n; - - n = FindExtension((char*)extname, strlen(extname)); - if (n != -1) - return extensions[n]; - else - return NULL; -} - -void -DeclareExtensionSecurity(extname, secure) - char *extname; - Bool secure; -{ -#ifdef XCSECURITY - int i = FindExtension(extname, strlen(extname)); - if (i >= 0) - { - int majorop = extensions[i]->base; - extensions[i]->secure = secure; - if (secure) - { - UntrustedProcVector[majorop] = ProcVector[majorop]; - SwappedUntrustedProcVector[majorop] = SwappedProcVector[majorop]; - } - else - { - UntrustedProcVector[majorop] = ProcBadRequest; - SwappedUntrustedProcVector[majorop] = ProcBadRequest; - } - } -#endif -#ifdef LBX - LbxDeclareExtensionSecurity(extname, secure); -#endif -} - -unsigned short -StandardMinorOpcode(client) - ClientPtr client; -{ - return ((xReq *)client->requestBuffer)->data; -} - -unsigned short -MinorOpcodeOfRequest(client) - ClientPtr client; -{ - unsigned char major; - - major = ((xReq *)client->requestBuffer)->reqType; - if (major < EXTENSION_BASE) - return 0; - major -= EXTENSION_BASE; - if (major >= NumExtensions) - return 0; - return (*extensions[major]->MinorOpcode)(client); -} - -void -CloseDownExtensions() -{ - register int i,j; - -#ifdef LBX - LbxCloseDownExtensions(); -#endif - - for (i = NumExtensions - 1; i >= 0; i--) - { - (* extensions[i]->CloseDown)(extensions[i]); - NumExtensions = i; - xfree(extensions[i]->name); - for (j = extensions[i]->num_aliases; --j >= 0;) - xfree(extensions[i]->aliases[j]); - xfree(extensions[i]->aliases); - xfree(extensions[i]); - } - xfree(extensions); - extensions = (ExtensionEntry **)NULL; - lastEvent = EXTENSION_EVENT_BASE; - lastError = FirstExtensionError; - for (i=0; inum) - { - spentry->num--; - xfree(spentry->procList[spentry->num].name); - } - xfree(spentry->procList); - spentry->procList = (ProcEntryPtr)NULL; - } -} - - -int -ProcQueryExtension(client) - ClientPtr client; -{ - xQueryExtensionReply reply; - int i; - REQUEST(xQueryExtensionReq); - - REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes); - - reply.type = X_Reply; - reply.length = 0; - reply.major_opcode = 0; - reply.sequenceNumber = client->sequence; - - if ( ! NumExtensions ) - reply.present = xFalse; - else - { - i = FindExtension((char *)&stuff[1], stuff->nbytes); - if (i < 0 -#ifdef XCSECURITY - /* don't show insecure extensions to untrusted clients */ - || (client->trustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) -#endif - ) - reply.present = xFalse; - else - { - reply.present = xTrue; - reply.major_opcode = extensions[i]->base; - reply.first_event = extensions[i]->eventBase; - reply.first_error = extensions[i]->errorBase; - } - } - WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply); - return(client->noClientException); -} - -int -ProcListExtensions(client) - ClientPtr client; -{ - xListExtensionsReply reply; - char *bufptr, *buffer; - int total_length = 0; - - REQUEST_SIZE_MATCH(xReq); - - reply.type = X_Reply; - reply.nExtensions = 0; - reply.length = 0; - reply.sequenceNumber = client->sequence; - buffer = NULL; - - if ( NumExtensions ) - { - register int i, j; - - for (i=0; itrustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) - continue; -#endif - total_length += strlen(extensions[i]->name) + 1; - reply.nExtensions += 1 + extensions[i]->num_aliases; - for (j = extensions[i]->num_aliases; --j >= 0;) - total_length += strlen(extensions[i]->aliases[j]) + 1; - } - reply.length = (total_length + 3) >> 2; - buffer = bufptr = (char *)ALLOCATE_LOCAL(total_length); - if (!buffer) - return(BadAlloc); - for (i=0; itrustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) - continue; -#endif - *bufptr++ = len = strlen(extensions[i]->name); - memmove(bufptr, extensions[i]->name, len); - bufptr += len; - for (j = extensions[i]->num_aliases; --j >= 0;) - { - *bufptr++ = len = strlen(extensions[i]->aliases[j]); - memmove(bufptr, extensions[i]->aliases[j], len); - bufptr += len; - } - } - } - WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply); - if (reply.length) - { - WriteToClient(client, total_length, buffer); - DEALLOCATE_LOCAL(buffer); - } - return(client->noClientException); -} - - -ExtensionLookupProc -LookupProc(name, pGC) - char *name; - GCPtr pGC; -{ - register int i; - register ScreenProcEntry *spentry; - spentry = &AuxillaryScreenProcs[pGC->pScreen->myNum]; - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - return(spentry->procList[i].proc); - } - return (ExtensionLookupProc)NULL; -} - -Bool -RegisterProc(name, pGC, proc) - char *name; - GC *pGC; - ExtensionLookupProc proc; -{ - return RegisterScreenProc(name, pGC->pScreen, proc); -} - -Bool -RegisterScreenProc(name, pScreen, proc) - char *name; - ScreenPtr pScreen; - ExtensionLookupProc proc; -{ - register ScreenProcEntry *spentry; - register ProcEntryPtr procEntry = (ProcEntryPtr)NULL; - char *newname; - int i; - - spentry = &AuxillaryScreenProcs[pScreen->myNum]; - /* first replace duplicates */ - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - { - procEntry = &spentry->procList[i]; - break; - } - } - if (procEntry) - procEntry->proc = proc; - else - { - newname = (char *)xalloc(strlen(name)+1); - if (!newname) - return FALSE; - procEntry = (ProcEntryPtr) - xrealloc(spentry->procList, - sizeof(ProcEntryRec) * (spentry->num+1)); - if (!procEntry) - { - xfree(newname); - return FALSE; - } - spentry->procList = procEntry; - procEntry += spentry->num; - procEntry->name = newname; - strcpy(newname, name); - procEntry->proc = proc; - spentry->num++; - } - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c.NX.original deleted file mode 100644 index fe2f4aa6c..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c.NX.original +++ /dev/null @@ -1,550 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXglxext.c" - -#else - -/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.8 2001/08/23 18:25:40 alanh Exp $ -** The contents of this file are subject to the GLX Public License Version 1.0 -** (the "License"). You may not use this file except in compliance with the -** License. You may obtain a copy of the License at Silicon Graphics, Inc., -** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 -** or at http://www.sgi.com/software/opensource/glx/license.html. -** -** Software distributed under the License is distributed on an "AS IS" -** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY -** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR -** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific -** language governing rights and limitations under the License. -** -** The Original Software is GLX version 1.2 source code, released February, -** 1999. The developer of the Original Software is Silicon Graphics, Inc. -** Those portions of the Subject Software created by Silicon Graphics, Inc. -** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. -** -*/ - -#define NEED_REPLIES -#include "glxserver.h" -#include -#include -#include -#include "g_disptab.h" -#include "unpack.h" -#include "glxutil.h" -#include "glxext.h" -#include "micmap.h" - -#include "Trap.h" - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -extern __GLXextensionInfo __glDDXExtensionInfo; - -__GLXextensionInfo *__glXExt = &__glDDXExtensionInfo; - -/* -** Forward declarations. -*/ -static int __glXSwapDispatch(ClientPtr); -static int __glXDispatch(ClientPtr); - -/* -** Called when the extension is reset. -*/ -static void ResetExtension(ExtensionEntry* extEntry) -{ - __glXFlushContextCache(); - (*__glXExt->resetExtension)(); - __glXScreenReset(); -} - -/* -** Initialize the per-client context storage. -*/ -static void ResetClientState(int clientIndex) -{ - __GLXclientState *cl = __glXClients[clientIndex]; - - if (cl->returnBuf) __glXFree(cl->returnBuf); - if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf); - if (cl->currentContexts) __glXFree(cl->currentContexts); - __glXMemset(cl, 0, sizeof(__GLXclientState)); - /* - ** By default, assume that the client supports - ** GLX major version 1 minor version 0 protocol. - */ - cl->GLClientmajorVersion = 1; - cl->GLClientminorVersion = 0; - if (cl->GLClientextensions) __glXFree(cl->GLClientextensions); - -} - -/* -** Reset state used to keep track of large (multi-request) commands. -*/ -void __glXResetLargeCommandStatus(__GLXclientState *cl) -{ - cl->largeCmdBytesSoFar = 0; - cl->largeCmdBytesTotal = 0; - cl->largeCmdRequestsSoFar = 0; - cl->largeCmdRequestsTotal = 0; -} - -/* -** This procedure is called when the client who created the context goes -** away OR when glXDestroyContext is called. In either case, all we do is -** flag that the ID is no longer valid, and (maybe) free the context. -** use. -*/ -static int ContextGone(__GLXcontext* cx, XID id) -{ - cx->idExists = GL_FALSE; - if (!cx->isCurrent) { - __glXFreeContext(cx); - } - - return True; -} - -/* -** Free a client's state. -*/ -static int ClientGone(int clientIndex, XID id) -{ - __GLXcontext *cx; - __GLXclientState *cl = __glXClients[clientIndex]; - int i; - - if (cl) { - /* - ** Free all the contexts that are current for this client. - */ - for (i=0; i < cl->numCurrentContexts; i++) { - cx = cl->currentContexts[i]; - if (cx) { - __glXDeassociateContext(cx, cx->glxPriv); - cx->isCurrent = GL_FALSE; - if (!cx->idExists) { - __glXFreeContext(cx); - } - } - } - /* - ** Re-initialize the client state structure. Don't free it because - ** we'll probably get another client with this index and use the struct - ** again. There is a maximum of MAXCLIENTS of these structures. - */ - ResetClientState(clientIndex); - } - - return True; -} - -/* -** Free a GLX Pixmap. -*/ -static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id) -{ - PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw; - - pGlxPixmap->idExists = False; - if (!pGlxPixmap->refcnt) { - /* - ** The DestroyPixmap routine should decrement the refcount and free - ** only if it's zero. - */ - (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap); - __glXFree(pGlxPixmap); - } - - return True; -} - -/* -** Free a context. -*/ -GLboolean __glXFreeContext(__GLXcontext *cx) -{ - if (cx->idExists || cx->isCurrent) return GL_FALSE; - - if (!cx->isDirect) { - if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) { - return GL_FALSE; - } - } - if (cx->feedbackBuf) __glXFree(cx->feedbackBuf); - if (cx->selectBuf) __glXFree(cx->selectBuf); - __glXFree(cx); - if (cx == __glXLastContext) { - __glXFlushContextCache(); - } - - return GL_TRUE; -} - -/************************************************************************/ - -/* -** These routines can be used to check whether a particular GL command -** has caused an error. Specifically, we use them to check whether a -** given query has caused an error, in which case a zero-length data -** reply is sent to the client. -*/ - -static GLboolean errorOccured = GL_FALSE; - -/* -** The GL was will call this routine if an error occurs. -*/ -void __glXErrorCallBack(__GLinterface *gc, GLenum code) -{ - errorOccured = GL_TRUE; -} - -/* -** Clear the error flag before calling the GL command. -*/ -void __glXClearErrorOccured(void) -{ - errorOccured = GL_FALSE; -} - -/* -** Check if the GL command caused an error. -*/ -GLboolean __glXErrorOccured(void) -{ - return errorOccured; -} - -/************************************************************************/ - -/* -** Initialize the GLX extension. -*/ -void GlxExtensionInit(void) -{ - ExtensionEntry *extEntry; - int i; - -#ifdef X11R5 - __glXContextRes = CreateNewResourceType(ContextGone); - __glXClientRes = CreateNewResourceType(ClientGone); - __glXPixmapRes = CreateNewResourceType(PixmapGone); -#else - __glXContextRes = CreateNewResourceType((DeleteType)ContextGone); - __glXClientRes = CreateNewResourceType((DeleteType)ClientGone); - __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone); -#endif - - /* - ** Add extension to server extensions. - */ - extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, - __GLX_NUMBER_ERRORS, __glXDispatch, - __glXSwapDispatch, ResetExtension, - StandardMinorOpcode); - if (!extEntry) { - FatalError("__glXExtensionInit: AddExtensions failed\n"); - return; - } - if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) { - ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); - return; - } - - __glXBadContext = extEntry->errorBase + GLXBadContext; - __glXBadContextState = extEntry->errorBase + GLXBadContextState; - __glXBadDrawable = extEntry->errorBase + GLXBadDrawable; - __glXBadPixmap = extEntry->errorBase + GLXBadPixmap; - __glXBadContextTag = extEntry->errorBase + GLXBadContextTag; - __glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow; - __glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest; - __glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest; - __glXUnsupportedPrivateRequest = extEntry->errorBase + - GLXUnsupportedPrivateRequest; - - /* - ** Initialize table of client state. There is never a client 0. - */ - for (i=1; i <= MAXCLIENTS; i++) { - __glXClients[i] = 0; - } - - /* - ** Initialize screen specific data. - */ - __glXScreenInit(screenInfo.numScreens); -} - -/************************************************************************/ - -Bool __glXCoreType(void) -{ - return __glXExt->type; -} - -/************************************************************************/ - -void GlxSetVisualConfigs(int nconfigs, - __GLXvisualConfig *configs, void **privates) -{ - (*__glXExt->setVisualConfigs)(nconfigs, configs, privates); -} - -static miInitVisualsProcPtr saveInitVisualsProc; - -Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB, - int preferredVis) -{ - Bool ret; - - if (saveInitVisualsProc) { - ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp, - rootDepthp, defaultVisp, sizes, bitsPerRGB, - preferredVis); - if (!ret) - return False; - } - (*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp, - defaultVisp, sizes, bitsPerRGB); - return True; -} - -void -GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc) -{ - saveInitVisualsProc = *initVisProc; - *initVisProc = GlxInitVisuals; -} - -/************************************************************************/ - -void __glXFlushContextCache(void) -{ - __glXLastContext = 0; -} - -/* -** Make a context the current one for the GL (in this implementation, there -** is only one instance of the GL, and we use it to serve all GL clients by -** switching it between different contexts). While we are at it, look up -** a context by its tag and return its (__GLXcontext *). -*/ -__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, - int *error) -{ - __GLXcontext *cx; - - /* - ** See if the context tag is legal; it is managed by the extension, - ** so if it's invalid, we have an implementation error. - */ - cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag); - if (!cx) { - cl->client->errorValue = tag; - *error = __glXBadContextTag; - return 0; - } - - if (!cx->isDirect) { - if (cx->glxPriv == NULL) { - /* - ** The drawable has vanished. It must be a window, because only - ** windows can be destroyed from under us; GLX pixmaps are - ** refcounted and don't go away until no one is using them. - */ - *error = __glXBadCurrentWindow; - return 0; - } - } - - if (cx == __glXLastContext) { - /* No need to re-bind */ - return cx; - } - - /* Make this context the current one for the GL. */ - if (!cx->isDirect) { - if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) { - /* Bind failed, and set the error code. Bummer */ - cl->client->errorValue = cx->id; - *error = __glXBadContextState; - return 0; - } - } - __glXLastContext = cx; - return cx; -} - -/************************************************************************/ - -/* -** Top level dispatcher; all commands are executed from here down. -*/ -static int __glXDispatch(ClientPtr client) -{ - int result; - - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - __glXMemset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** If we're expecting a glXRenderLarge request, this better be one. - */ - if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) { - client->errorValue = stuff->glxCode; - return __glXBadLargeRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSingleTable[opcode]; - - /* - * Report upstream that we are - * dispatching a GLX operation. - */ - - nxagentGlxTrap = 1; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - result = (*proc)(cl, (GLbyte *) stuff); - - nxagentGlxTrap = 0; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - return result; -} - -static int __glXSwapDispatch(ClientPtr client) -{ - int result; - - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - __glXMemset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSwapSingleTable[opcode]; - - /* - * Report upstream that we are - * dispatching a GLX operation. - */ - - nxagentGlxTrap = 1; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - result = (*proc)(cl, (GLbyte *) stuff); - - nxagentGlxTrap = 0; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - return result; -} - -int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc) -{ - return BadRequest; -} - -void __glXNoSuchRenderOpcode(GLbyte *pc) -{ - return; -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c.XF86.original deleted file mode 100644 index 95a9c2e6e..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c.XF86.original +++ /dev/null @@ -1,489 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.8 2001/08/23 18:25:40 alanh Exp $ -** The contents of this file are subject to the GLX Public License Version 1.0 -** (the "License"). You may not use this file except in compliance with the -** License. You may obtain a copy of the License at Silicon Graphics, Inc., -** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 -** or at http://www.sgi.com/software/opensource/glx/license.html. -** -** Software distributed under the License is distributed on an "AS IS" -** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY -** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR -** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific -** language governing rights and limitations under the License. -** -** The Original Software is GLX version 1.2 source code, released February, -** 1999. The developer of the Original Software is Silicon Graphics, Inc. -** Those portions of the Subject Software created by Silicon Graphics, Inc. -** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. -** -*/ - -#define NEED_REPLIES -#include "glxserver.h" -#include -#include -#include -#include "g_disptab.h" -#include "unpack.h" -#include "glxutil.h" -#include "glxext.h" -#include "micmap.h" - - -extern __GLXextensionInfo __glDDXExtensionInfo; - -__GLXextensionInfo *__glXExt = &__glDDXExtensionInfo; - -/* -** Forward declarations. -*/ -static int __glXSwapDispatch(ClientPtr); -static int __glXDispatch(ClientPtr); - -/* -** Called when the extension is reset. -*/ -static void ResetExtension(ExtensionEntry* extEntry) -{ - __glXFlushContextCache(); - (*__glXExt->resetExtension)(); - __glXScreenReset(); -} - -/* -** Initialize the per-client context storage. -*/ -static void ResetClientState(int clientIndex) -{ - __GLXclientState *cl = __glXClients[clientIndex]; - - if (cl->returnBuf) __glXFree(cl->returnBuf); - if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf); - if (cl->currentContexts) __glXFree(cl->currentContexts); - __glXMemset(cl, 0, sizeof(__GLXclientState)); - /* - ** By default, assume that the client supports - ** GLX major version 1 minor version 0 protocol. - */ - cl->GLClientmajorVersion = 1; - cl->GLClientminorVersion = 0; - if (cl->GLClientextensions) __glXFree(cl->GLClientextensions); - -} - -/* -** Reset state used to keep track of large (multi-request) commands. -*/ -void __glXResetLargeCommandStatus(__GLXclientState *cl) -{ - cl->largeCmdBytesSoFar = 0; - cl->largeCmdBytesTotal = 0; - cl->largeCmdRequestsSoFar = 0; - cl->largeCmdRequestsTotal = 0; -} - -/* -** This procedure is called when the client who created the context goes -** away OR when glXDestroyContext is called. In either case, all we do is -** flag that the ID is no longer valid, and (maybe) free the context. -** use. -*/ -static int ContextGone(__GLXcontext* cx, XID id) -{ - cx->idExists = GL_FALSE; - if (!cx->isCurrent) { - __glXFreeContext(cx); - } - - return True; -} - -/* -** Free a client's state. -*/ -static int ClientGone(int clientIndex, XID id) -{ - __GLXcontext *cx; - __GLXclientState *cl = __glXClients[clientIndex]; - int i; - - if (cl) { - /* - ** Free all the contexts that are current for this client. - */ - for (i=0; i < cl->numCurrentContexts; i++) { - cx = cl->currentContexts[i]; - if (cx) { - __glXDeassociateContext(cx, cx->glxPriv); - cx->isCurrent = GL_FALSE; - if (!cx->idExists) { - __glXFreeContext(cx); - } - } - } - /* - ** Re-initialize the client state structure. Don't free it because - ** we'll probably get another client with this index and use the struct - ** again. There is a maximum of MAXCLIENTS of these structures. - */ - ResetClientState(clientIndex); - } - - return True; -} - -/* -** Free a GLX Pixmap. -*/ -static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id) -{ - PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw; - - pGlxPixmap->idExists = False; - if (!pGlxPixmap->refcnt) { - /* - ** The DestroyPixmap routine should decrement the refcount and free - ** only if it's zero. - */ - (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap); - __glXFree(pGlxPixmap); - } - - return True; -} - -/* -** Free a context. -*/ -GLboolean __glXFreeContext(__GLXcontext *cx) -{ - if (cx->idExists || cx->isCurrent) return GL_FALSE; - - if (!cx->isDirect) { - if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) { - return GL_FALSE; - } - } - if (cx->feedbackBuf) __glXFree(cx->feedbackBuf); - if (cx->selectBuf) __glXFree(cx->selectBuf); - __glXFree(cx); - if (cx == __glXLastContext) { - __glXFlushContextCache(); - } - - return GL_TRUE; -} - -/************************************************************************/ - -/* -** These routines can be used to check whether a particular GL command -** has caused an error. Specifically, we use them to check whether a -** given query has caused an error, in which case a zero-length data -** reply is sent to the client. -*/ - -static GLboolean errorOccured = GL_FALSE; - -/* -** The GL was will call this routine if an error occurs. -*/ -void __glXErrorCallBack(__GLinterface *gc, GLenum code) -{ - errorOccured = GL_TRUE; -} - -/* -** Clear the error flag before calling the GL command. -*/ -void __glXClearErrorOccured(void) -{ - errorOccured = GL_FALSE; -} - -/* -** Check if the GL command caused an error. -*/ -GLboolean __glXErrorOccured(void) -{ - return errorOccured; -} - -/************************************************************************/ - -/* -** Initialize the GLX extension. -*/ -void GlxExtensionInit(void) -{ - ExtensionEntry *extEntry; - int i; - -#ifdef X11R5 - __glXContextRes = CreateNewResourceType(ContextGone); - __glXClientRes = CreateNewResourceType(ClientGone); - __glXPixmapRes = CreateNewResourceType(PixmapGone); -#else - __glXContextRes = CreateNewResourceType((DeleteType)ContextGone); - __glXClientRes = CreateNewResourceType((DeleteType)ClientGone); - __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone); -#endif - - /* - ** Add extension to server extensions. - */ - extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, - __GLX_NUMBER_ERRORS, __glXDispatch, - __glXSwapDispatch, ResetExtension, - StandardMinorOpcode); - if (!extEntry) { - FatalError("__glXExtensionInit: AddExtensions failed\n"); - return; - } - if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) { - ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); - return; - } - - __glXBadContext = extEntry->errorBase + GLXBadContext; - __glXBadContextState = extEntry->errorBase + GLXBadContextState; - __glXBadDrawable = extEntry->errorBase + GLXBadDrawable; - __glXBadPixmap = extEntry->errorBase + GLXBadPixmap; - __glXBadContextTag = extEntry->errorBase + GLXBadContextTag; - __glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow; - __glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest; - __glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest; - __glXUnsupportedPrivateRequest = extEntry->errorBase + - GLXUnsupportedPrivateRequest; - - /* - ** Initialize table of client state. There is never a client 0. - */ - for (i=1; i <= MAXCLIENTS; i++) { - __glXClients[i] = 0; - } - - /* - ** Initialize screen specific data. - */ - __glXScreenInit(screenInfo.numScreens); -} - -/************************************************************************/ - -Bool __glXCoreType(void) -{ - return __glXExt->type; -} - -/************************************************************************/ - -void GlxSetVisualConfigs(int nconfigs, - __GLXvisualConfig *configs, void **privates) -{ - (*__glXExt->setVisualConfigs)(nconfigs, configs, privates); -} - -static miInitVisualsProcPtr saveInitVisualsProc; - -Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB, - int preferredVis) -{ - Bool ret; - - if (saveInitVisualsProc) { - ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp, - rootDepthp, defaultVisp, sizes, bitsPerRGB, - preferredVis); - if (!ret) - return False; - } - (*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp, - defaultVisp, sizes, bitsPerRGB); - return True; -} - -void -GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc) -{ - saveInitVisualsProc = *initVisProc; - *initVisProc = GlxInitVisuals; -} - -/************************************************************************/ - -void __glXFlushContextCache(void) -{ - __glXLastContext = 0; -} - -/* -** Make a context the current one for the GL (in this implementation, there -** is only one instance of the GL, and we use it to serve all GL clients by -** switching it between different contexts). While we are at it, look up -** a context by its tag and return its (__GLXcontext *). -*/ -__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, - int *error) -{ - __GLXcontext *cx; - - /* - ** See if the context tag is legal; it is managed by the extension, - ** so if it's invalid, we have an implementation error. - */ - cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag); - if (!cx) { - cl->client->errorValue = tag; - *error = __glXBadContextTag; - return 0; - } - - if (!cx->isDirect) { - if (cx->glxPriv == NULL) { - /* - ** The drawable has vanished. It must be a window, because only - ** windows can be destroyed from under us; GLX pixmaps are - ** refcounted and don't go away until no one is using them. - */ - *error = __glXBadCurrentWindow; - return 0; - } - } - - if (cx == __glXLastContext) { - /* No need to re-bind */ - return cx; - } - - /* Make this context the current one for the GL. */ - if (!cx->isDirect) { - if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) { - /* Bind failed, and set the error code. Bummer */ - cl->client->errorValue = cx->id; - *error = __glXBadContextState; - return 0; - } - } - __glXLastContext = cx; - return cx; -} - -/************************************************************************/ - -/* -** Top level dispatcher; all commands are executed from here down. -*/ -static int __glXDispatch(ClientPtr client) -{ - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - __glXMemset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** If we're expecting a glXRenderLarge request, this better be one. - */ - if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) { - client->errorValue = stuff->glxCode; - return __glXBadLargeRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSingleTable[opcode]; - return (*proc)(cl, (GLbyte *) stuff); -} - -static int __glXSwapDispatch(ClientPtr client) -{ - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - __glXMemset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSwapSingleTable[opcode]; - return (*proc)(cl, (GLbyte *) stuff); -} - -int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc) -{ - return BadRequest; -} - -void __glXNoSuchRenderOpcode(GLbyte *pc) -{ - return; -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original deleted file mode 100644 index 22483b3fd..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original +++ /dev/null @@ -1,511 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXglyph.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/glyph.c,v 1.6 2001/10/28 03:34:19 tsi Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" - -#ifdef NXAGENT_SERVER - -#include "NXpicturestr.h" -#include "NXglyphstr.h" -#include "Render.h" - -#define PANIC -#define WARNING -#undef DEBUG -#undef TEST - -#endif - -/* - * From Knuth -- a good choice for hash/rehash values is p, p-2 where - * p and p-2 are both prime. These tables are sized to have an extra 10% - * free to avoid exponential performance degradation as the hash table fills - */ -static GlyphHashSetRec glyphHashSets[] = { - { 32, 43, 41 }, - { 64, 73, 71 }, - { 128, 151, 149 }, - { 256, 283, 281 }, - { 512, 571, 569 }, - { 1024, 1153, 1151 }, - { 2048, 2269, 2267 }, - { 4096, 4519, 4517 }, - { 8192, 9013, 9011 }, - { 16384, 18043, 18041 }, - { 32768, 36109, 36107 }, - { 65536, 72091, 72089 }, - { 131072, 144409, 144407 }, - { 262144, 288361, 288359 }, - { 524288, 576883, 576881 }, - { 1048576, 1153459, 1153457 }, - { 2097152, 2307163, 2307161 }, - { 4194304, 4613893, 4613891 }, - { 8388608, 9227641, 9227639 }, - { 16777216, 18455029, 18455027 }, - { 33554432, 36911011, 36911009 }, - { 67108864, 73819861, 73819859 }, - { 134217728, 147639589, 147639587 }, - { 268435456, 295279081, 295279079 }, - { 536870912, 590559793, 590559791 } -}; - -#define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0])) - -const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 }; - -GlyphHashRec globalGlyphs[GlyphFormatNum]; - -GlyphHashSetPtr -FindGlyphHashSet (CARD32 filled) -{ - int i; - - for (i = 0; i < NGLYPHHASHSETS; i++) - if (glyphHashSets[i].entries >= filled) - return &glyphHashSets[i]; - return 0; -} - -Bool -GlyphInit (ScreenPtr pScreen) -{ - return TRUE; -} - -GlyphRefPtr -FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare) -{ - CARD32 elt, step, s; - GlyphPtr glyph; - GlyphRefPtr table, gr, del; - CARD32 tableSize = hash->hashSet->size; - - table = hash->table; - elt = signature % tableSize; - step = 0; - del = 0; - for (;;) - { - gr = &table[elt]; - s = gr->signature; - glyph = gr->glyph; - if (!glyph) - { - if (del) - gr = del; - break; - } - if (glyph == DeletedGlyph) - { - if (!del) - del = gr; - else if (gr == del) - break; - } - else if (s == signature && - (!match || - memcmp (&compare->info, &glyph->info, compare->size) == 0)) - { - break; - } - if (!step) - { - step = signature % hash->hashSet->rehash; - if (!step) - step = 1; - } - elt += step; - if (elt >= tableSize) - elt -= tableSize; - } - return gr; -} - -CARD32 -HashGlyph (GlyphPtr glyph) -{ - CARD32 *bits = (CARD32 *) &(glyph->info); - CARD32 hash; - int n = glyph->size / sizeof (CARD32); - - hash = 0; - while (n--) - hash ^= *bits++; - return hash; -} - -#ifdef CHECK_DUPLICATES -void -DuplicateRef (GlyphPtr glyph, char *where) -{ - ErrorF ("Duplicate Glyph 0x%x from %s\n", glyph, where); -} - -void -CheckDuplicates (GlyphHashPtr hash, char *where) -{ - GlyphPtr g; - int i, j; - - for (i = 0; i < hash->hashSet->size; i++) - { - g = hash->table[i].glyph; - if (!g || g == DeletedGlyph) - continue; - for (j = i + 1; j < hash->hashSet->size; j++) - if (hash->table[j].glyph == g) - DuplicateRef (g, where); - } -} -#else -#define CheckDuplicates(a,b) -#define DuplicateRef(a,b) -#endif - -void -FreeGlyph (GlyphPtr glyph, int format) -{ - CheckDuplicates (&globalGlyphs[format], "FreeGlyph"); - if (--glyph->refcnt == 0) - { - GlyphRefPtr gr; - int i; - int first; - - first = -1; - for (i = 0; i < globalGlyphs[format].hashSet->size; i++) - if (globalGlyphs[format].table[i].glyph == glyph) - { - if (first != -1) - DuplicateRef (glyph, "FreeGlyph check"); - first = i; - } - - gr = FindGlyphRef (&globalGlyphs[format], - HashGlyph (glyph), TRUE, glyph); - if (gr - globalGlyphs[format].table != first) - DuplicateRef (glyph, "Found wrong one"); - if (gr->glyph && gr->glyph != DeletedGlyph) - { - gr->glyph = DeletedGlyph; - gr->signature = 0; - globalGlyphs[format].tableEntries--; - } - xfree (glyph); - } -} - -void -AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) -{ - GlyphRefPtr gr; - CARD32 hash; - - CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph top global"); - /* Locate existing matching glyph */ - hash = HashGlyph (glyph); - gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph); - if (gr->glyph && gr->glyph != DeletedGlyph) - { - xfree (glyph); - glyph = gr->glyph; - } - else - { - gr->glyph = glyph; - gr->signature = hash; - globalGlyphs[glyphSet->fdepth].tableEntries++; - } - - /* Insert/replace glyphset value */ - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - ++glyph->refcnt; - if (gr->glyph && gr->glyph != DeletedGlyph) - FreeGlyph (gr->glyph, glyphSet->fdepth); - else - glyphSet->hash.tableEntries++; - gr->glyph = glyph; - gr->signature = id; - - #ifdef NXAGENT_SERVER - - gr -> corruptedGlyph = 1; - - #endif - - CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom"); -} - -Bool -DeleteGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphRefPtr gr; - GlyphPtr glyph; - - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - glyph = gr->glyph; - if (glyph && glyph != DeletedGlyph) - { - gr->glyph = DeletedGlyph; - glyphSet->hash.tableEntries--; - FreeGlyph (glyph, glyphSet->fdepth); - return TRUE; - } - return FALSE; -} - -#ifdef NXAGENT_SERVER - -GlyphPtr FindGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphRefPtr gr; - GlyphPtr glyph; - - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - glyph = gr -> glyph; - - if (glyph == DeletedGlyph) - { - glyph = 0; - } - else if (gr -> corruptedGlyph == 1) - { - #ifdef DEBUG - fprintf(stderr, "FindGlyphRef: Going to synchronize the glyph [%p] for glyphset [%p].\n", - (void *) glyph, (void *) glyphSet); - #endif - - nxagentAddGlyphs(glyphSet, &id, &(glyph -> info), 1, - (CARD8*)(glyph + 1), glyph -> size - sizeof(xGlyphInfo)); - } - - return glyph; -} - -#else - -GlyphPtr -FindGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphPtr glyph; - - glyph = FindGlyphRef (&glyphSet->hash, id, FALSE, 0)->glyph; - if (glyph == DeletedGlyph) - glyph = 0; - return glyph; -} - -#endif - -GlyphPtr -AllocateGlyph (xGlyphInfo *gi, int fdepth) -{ - int size; - GlyphPtr glyph; - - size = gi->height * PixmapBytePad (gi->width, glyphDepths[fdepth]); - glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec)); - if (!glyph) - return 0; - glyph->refcnt = 0; - glyph->size = size + sizeof (xGlyphInfo); - glyph->info = *gi; - return glyph; -} - -Bool -AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) -{ - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); - if (!hash->table) - return FALSE; - memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); - hash->hashSet = hashSet; - hash->tableEntries = 0; - return TRUE; -} - -Bool -ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) -{ - CARD32 tableEntries; - GlyphHashSetPtr hashSet; - GlyphHashRec newHash; - GlyphRefPtr gr; - GlyphPtr glyph; - int i; - int oldSize; - CARD32 s; - - #ifdef NXAGENT_SERVER - - CARD32 c; - - #endif - - tableEntries = hash->tableEntries + change; - hashSet = FindGlyphHashSet (tableEntries); - if (hashSet == hash->hashSet) - return TRUE; - if (global) - CheckDuplicates (hash, "ResizeGlyphHash top"); - if (!AllocateGlyphHash (&newHash, hashSet)) - return FALSE; - if (hash->table) - { - oldSize = hash->hashSet->size; - for (i = 0; i < oldSize; i++) - { - glyph = hash->table[i].glyph; - if (glyph && glyph != DeletedGlyph) - { - s = hash->table[i].signature; - - #ifdef NXAGENT_SERVER - - c = hash->table[i].corruptedGlyph; - - #endif - - gr = FindGlyphRef (&newHash, s, global, glyph); - gr->signature = s; - gr->glyph = glyph; - - #ifdef NXAGENT_SERVER - - gr -> corruptedGlyph = c; - - #endif - - ++newHash.tableEntries; - } - } - xfree (hash->table); - } - *hash = newHash; - if (global) - CheckDuplicates (hash, "ResizeGlyphHash bottom"); - return TRUE; -} - -Bool -ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change) -{ - return (ResizeGlyphHash (&glyphSet->hash, change, FALSE) && - ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], change, TRUE)); -} - -GlyphSetPtr -AllocateGlyphSet (int fdepth, PictFormatPtr format) -{ - GlyphSetPtr glyphSet; - - if (!globalGlyphs[fdepth].hashSet) - { - if (!AllocateGlyphHash (&globalGlyphs[fdepth], &glyphHashSets[0])) - return FALSE; - } - glyphSet = xalloc (sizeof (GlyphSetRec)); - if (!glyphSet) - return FALSE; - if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) - { - xfree (glyphSet); - return FALSE; - } - glyphSet->refcnt = 1; - glyphSet->fdepth = fdepth; - glyphSet->format = format; - return glyphSet; -} - -int -FreeGlyphSet (pointer value, - XID gid) -{ - GlyphSetPtr glyphSet = (GlyphSetPtr) value; - - if (--glyphSet->refcnt == 0) - { - CARD32 i, tableSize = glyphSet->hash.hashSet->size; - GlyphRefPtr table = glyphSet->hash.table; - GlyphPtr glyph; - - for (i = 0; i < tableSize; i++) - { - glyph = table[i].glyph; - if (glyph && glyph != DeletedGlyph) - FreeGlyph (glyph, glyphSet->fdepth); - } - if (!globalGlyphs[glyphSet->fdepth].tableEntries) - { - xfree (globalGlyphs[glyphSet->fdepth].table); - globalGlyphs[glyphSet->fdepth].table = 0; - globalGlyphs[glyphSet->fdepth].hashSet = 0; - } - else - ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE); - xfree (table); - xfree (glyphSet); - } - return Success; -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.XF86.original deleted file mode 100644 index b4f08c223..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.XF86.original +++ /dev/null @@ -1,416 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/glyph.c,v 1.6 2001/10/28 03:34:19 tsi Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "picturestr.h" -#include "glyphstr.h" - -/* - * From Knuth -- a good choice for hash/rehash values is p, p-2 where - * p and p-2 are both prime. These tables are sized to have an extra 10% - * free to avoid exponential performance degradation as the hash table fills - */ -static GlyphHashSetRec glyphHashSets[] = { - { 32, 43, 41 }, - { 64, 73, 71 }, - { 128, 151, 149 }, - { 256, 283, 281 }, - { 512, 571, 569 }, - { 1024, 1153, 1151 }, - { 2048, 2269, 2267 }, - { 4096, 4519, 4517 }, - { 8192, 9013, 9011 }, - { 16384, 18043, 18041 }, - { 32768, 36109, 36107 }, - { 65536, 72091, 72089 }, - { 131072, 144409, 144407 }, - { 262144, 288361, 288359 }, - { 524288, 576883, 576881 }, - { 1048576, 1153459, 1153457 }, - { 2097152, 2307163, 2307161 }, - { 4194304, 4613893, 4613891 }, - { 8388608, 9227641, 9227639 }, - { 16777216, 18455029, 18455027 }, - { 33554432, 36911011, 36911009 }, - { 67108864, 73819861, 73819859 }, - { 134217728, 147639589, 147639587 }, - { 268435456, 295279081, 295279079 }, - { 536870912, 590559793, 590559791 } -}; - -#define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0])) - -const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 }; - -GlyphHashRec globalGlyphs[GlyphFormatNum]; - -GlyphHashSetPtr -FindGlyphHashSet (CARD32 filled) -{ - int i; - - for (i = 0; i < NGLYPHHASHSETS; i++) - if (glyphHashSets[i].entries >= filled) - return &glyphHashSets[i]; - return 0; -} - -Bool -GlyphInit (ScreenPtr pScreen) -{ - return TRUE; -} - -GlyphRefPtr -FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare) -{ - CARD32 elt, step, s; - GlyphPtr glyph; - GlyphRefPtr table, gr, del; - CARD32 tableSize = hash->hashSet->size; - - table = hash->table; - elt = signature % tableSize; - step = 0; - del = 0; - for (;;) - { - gr = &table[elt]; - s = gr->signature; - glyph = gr->glyph; - if (!glyph) - { - if (del) - gr = del; - break; - } - if (glyph == DeletedGlyph) - { - if (!del) - del = gr; - else if (gr == del) - break; - } - else if (s == signature && - (!match || - memcmp (&compare->info, &glyph->info, compare->size) == 0)) - { - break; - } - if (!step) - { - step = signature % hash->hashSet->rehash; - if (!step) - step = 1; - } - elt += step; - if (elt >= tableSize) - elt -= tableSize; - } - return gr; -} - -CARD32 -HashGlyph (GlyphPtr glyph) -{ - CARD32 *bits = (CARD32 *) &(glyph->info); - CARD32 hash; - int n = glyph->size / sizeof (CARD32); - - hash = 0; - while (n--) - hash ^= *bits++; - return hash; -} - -#ifdef CHECK_DUPLICATES -void -DuplicateRef (GlyphPtr glyph, char *where) -{ - ErrorF ("Duplicate Glyph 0x%x from %s\n", glyph, where); -} - -void -CheckDuplicates (GlyphHashPtr hash, char *where) -{ - GlyphPtr g; - int i, j; - - for (i = 0; i < hash->hashSet->size; i++) - { - g = hash->table[i].glyph; - if (!g || g == DeletedGlyph) - continue; - for (j = i + 1; j < hash->hashSet->size; j++) - if (hash->table[j].glyph == g) - DuplicateRef (g, where); - } -} -#else -#define CheckDuplicates(a,b) -#define DuplicateRef(a,b) -#endif - -void -FreeGlyph (GlyphPtr glyph, int format) -{ - CheckDuplicates (&globalGlyphs[format], "FreeGlyph"); - if (--glyph->refcnt == 0) - { - GlyphRefPtr gr; - int i; - int first; - - first = -1; - for (i = 0; i < globalGlyphs[format].hashSet->size; i++) - if (globalGlyphs[format].table[i].glyph == glyph) - { - if (first != -1) - DuplicateRef (glyph, "FreeGlyph check"); - first = i; - } - - gr = FindGlyphRef (&globalGlyphs[format], - HashGlyph (glyph), TRUE, glyph); - if (gr - globalGlyphs[format].table != first) - DuplicateRef (glyph, "Found wrong one"); - if (gr->glyph && gr->glyph != DeletedGlyph) - { - gr->glyph = DeletedGlyph; - gr->signature = 0; - globalGlyphs[format].tableEntries--; - } - xfree (glyph); - } -} - -void -AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) -{ - GlyphRefPtr gr; - CARD32 hash; - - CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph top global"); - /* Locate existing matching glyph */ - hash = HashGlyph (glyph); - gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph); - if (gr->glyph && gr->glyph != DeletedGlyph) - { - xfree (glyph); - glyph = gr->glyph; - } - else - { - gr->glyph = glyph; - gr->signature = hash; - globalGlyphs[glyphSet->fdepth].tableEntries++; - } - - /* Insert/replace glyphset value */ - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - ++glyph->refcnt; - if (gr->glyph && gr->glyph != DeletedGlyph) - FreeGlyph (gr->glyph, glyphSet->fdepth); - else - glyphSet->hash.tableEntries++; - gr->glyph = glyph; - gr->signature = id; - CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom"); -} - -Bool -DeleteGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphRefPtr gr; - GlyphPtr glyph; - - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - glyph = gr->glyph; - if (glyph && glyph != DeletedGlyph) - { - gr->glyph = DeletedGlyph; - glyphSet->hash.tableEntries--; - FreeGlyph (glyph, glyphSet->fdepth); - return TRUE; - } - return FALSE; -} - -GlyphPtr -FindGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphPtr glyph; - - glyph = FindGlyphRef (&glyphSet->hash, id, FALSE, 0)->glyph; - if (glyph == DeletedGlyph) - glyph = 0; - return glyph; -} - -GlyphPtr -AllocateGlyph (xGlyphInfo *gi, int fdepth) -{ - int size; - GlyphPtr glyph; - - size = gi->height * PixmapBytePad (gi->width, glyphDepths[fdepth]); - glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec)); - if (!glyph) - return 0; - glyph->refcnt = 0; - glyph->size = size + sizeof (xGlyphInfo); - glyph->info = *gi; - return glyph; -} - -Bool -AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) -{ - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); - if (!hash->table) - return FALSE; - memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); - hash->hashSet = hashSet; - hash->tableEntries = 0; - return TRUE; -} - -Bool -ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) -{ - CARD32 tableEntries; - GlyphHashSetPtr hashSet; - GlyphHashRec newHash; - GlyphRefPtr gr; - GlyphPtr glyph; - int i; - int oldSize; - CARD32 s; - - tableEntries = hash->tableEntries + change; - hashSet = FindGlyphHashSet (tableEntries); - if (hashSet == hash->hashSet) - return TRUE; - if (global) - CheckDuplicates (hash, "ResizeGlyphHash top"); - if (!AllocateGlyphHash (&newHash, hashSet)) - return FALSE; - if (hash->table) - { - oldSize = hash->hashSet->size; - for (i = 0; i < oldSize; i++) - { - glyph = hash->table[i].glyph; - if (glyph && glyph != DeletedGlyph) - { - s = hash->table[i].signature; - gr = FindGlyphRef (&newHash, s, global, glyph); - gr->signature = s; - gr->glyph = glyph; - ++newHash.tableEntries; - } - } - xfree (hash->table); - } - *hash = newHash; - if (global) - CheckDuplicates (hash, "ResizeGlyphHash bottom"); - return TRUE; -} - -Bool -ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change) -{ - return (ResizeGlyphHash (&glyphSet->hash, change, FALSE) && - ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], change, TRUE)); -} - -GlyphSetPtr -AllocateGlyphSet (int fdepth, PictFormatPtr format) -{ - GlyphSetPtr glyphSet; - - if (!globalGlyphs[fdepth].hashSet) - { - if (!AllocateGlyphHash (&globalGlyphs[fdepth], &glyphHashSets[0])) - return FALSE; - } - glyphSet = xalloc (sizeof (GlyphSetRec)); - if (!glyphSet) - return FALSE; - if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) - { - xfree (glyphSet); - return FALSE; - } - glyphSet->refcnt = 1; - glyphSet->fdepth = fdepth; - glyphSet->format = format; - return glyphSet; -} - -int -FreeGlyphSet (pointer value, - XID gid) -{ - GlyphSetPtr glyphSet = (GlyphSetPtr) value; - - if (--glyphSet->refcnt == 0) - { - CARD32 i, tableSize = glyphSet->hash.hashSet->size; - GlyphRefPtr table = glyphSet->hash.table; - GlyphPtr glyph; - - for (i = 0; i < tableSize; i++) - { - glyph = table[i].glyph; - if (glyph && glyph != DeletedGlyph) - FreeGlyph (glyph, glyphSet->fdepth); - } - if (!globalGlyphs[glyphSet->fdepth].tableEntries) - { - xfree (globalGlyphs[glyphSet->fdepth].table); - globalGlyphs[glyphSet->fdepth].table = 0; - globalGlyphs[glyphSet->fdepth].hashSet = 0; - } - else - ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE); - xfree (table); - xfree (glyphSet); - } - return Success; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original deleted file mode 100644 index 9212bf438..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original +++ /dev/null @@ -1,252 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXglyphcurs.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/************************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ - -/* $Xorg: glyphcurs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "misc.h" -#include "fontstruct.h" -#include "dixfontstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "resource.h" -#include "dix.h" -#include "cursorstr.h" -#include "opaque.h" -#include "servermd.h" - -#include "../../fb/fb.h" -#include "Pixmaps.h" - -#ifndef True -#define True 1 -#endif - -/* - get the bits out of the font in a portable way. to avoid -dealing with padding and such-like, we draw the glyph into -a bitmap, then read the bits out with GetImage, which -uses server-natural format. - since all screens return the same bitmap format, we'll just use -the first one we find. - the character origin lines up with the hotspot in the -cursor metrics. -*/ - -int -ServerBitsFromGlyph(pfont, ch, cm, ppbits) - FontPtr pfont; - unsigned int ch; - register CursorMetricPtr cm; - unsigned char **ppbits; -{ - register ScreenPtr pScreen; - register GCPtr pGC; - xRectangle rect; - PixmapPtr ppix; - long nby; - char *pbits; - ChangeGCVal gcval[3]; - unsigned char char2b[2]; - - /* turn glyph index into a protocol-format char2b */ - char2b[0] = (unsigned char)(ch >> 8); - char2b[1] = (unsigned char)(ch & 0xff); - - pScreen = screenInfo.screens[0]; - nby = BitmapBytePad(cm->width) * (long)cm->height; - pbits = (char *)xalloc(nby); - if (!pbits) - return BadAlloc; - /* zeroing the (pad) bits seems to help some ddx cursor handling */ - bzero(pbits, nby); - - ppix = fbCreatePixmap(pScreen, cm->width, cm->height, 1); - pGC = GetScratchGC(1, pScreen); - if (!ppix || !pGC) - { - if (ppix) - fbDestroyPixmap(ppix); - if (pGC) - FreeScratchGC(pGC); - xfree(pbits); - return BadAlloc; - } - - #ifdef TEST - fprintf(stderr, "ServerBitsFromGlyph: Created virtual pixmap at [%p] with width [%d] height [%d] depth [%d].\n", - (void *) ppix, cm->width, cm->height, 1); - #endif - - nxagentPixmapPriv(ppix) -> id = 0; - nxagentPixmapPriv(ppix) -> mid = 0; - nxagentPixmapPriv(ppix) -> isVirtual = True; - nxagentPixmapPriv(ppix) -> pRealPixmap = NULL; - nxagentPixmapPriv(ppix) -> pVirtualPixmap = NULL; - - rect.x = 0; - rect.y = 0; - rect.width = cm->width; - rect.height = cm->height; - - pGC->stateChanges |= GCFunction | GCForeground | GCFont; - pGC->alu = GXcopy; - - pGC->fgPixel = 0; - - pfont->refcnt++; - - if (pGC->font) - CloseFont(pGC->font, (Font)0); - - pGC->font = pfont; - - ValidateGC((DrawablePtr)ppix, pGC); - fbPolyFillRect((DrawablePtr)ppix, pGC, 1, &rect); - - /* draw the glyph */ - gcval[0].val = 1; - pGC->fgPixel = 1; - - pGC->stateChanges |= GCForeground; - - ValidateGC((DrawablePtr)ppix, pGC); - miPolyText16((DrawablePtr)ppix, pGC, (int)cm->xhot, (int)cm->yhot, (int)1, (unsigned short*)char2b); - fbGetImage((DrawablePtr)ppix, 0, 0, cm->width, cm->height, - XYPixmap, 1, pbits); - *ppbits = (unsigned char *)pbits; - FreeScratchGC(pGC); - fbDestroyPixmap(ppix); - - #ifdef TEST - fprintf(stderr, "ServerBitsFromGlyph: Destroyed virtual pixmap at [%p].\n", - (void *) ppix); - #endif - - return Success; -} - - -Bool -CursorMetricsFromGlyph( pfont, ch, cm) - register FontPtr pfont; - unsigned ch; - register CursorMetricPtr cm; -{ - CharInfoPtr pci; - unsigned long nglyphs; - CARD8 chs[2]; - FontEncoding encoding; - - chs[0] = ch >> 8; - chs[1] = ch; - encoding = (FONTLASTROW(pfont) == 0) ? Linear16Bit : TwoD16Bit; - if (encoding == Linear16Bit) - { - if (ch < pfont->info.firstCol || pfont->info.lastCol < ch) - return FALSE; - } - else - { - if (chs[0] < pfont->info.firstRow || pfont->info.lastRow < chs[0]) - return FALSE; - if (chs[1] < pfont->info.firstCol || pfont->info.lastCol < chs[1]) - return FALSE; - } - (*pfont->get_glyphs) (pfont, 1, chs, encoding, &nglyphs, &pci); - if (nglyphs == 0) - return FALSE; - cm->width = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; - cm->height = pci->metrics.descent + pci->metrics.ascent; - if (pci->metrics.leftSideBearing > 0) - { - cm->width += pci->metrics.leftSideBearing; - cm->xhot = 0; - } - else - { - cm->xhot = -pci->metrics.leftSideBearing; - if (pci->metrics.rightSideBearing < 0) - cm->width -= pci->metrics.rightSideBearing; - } - if (pci->metrics.ascent < 0) - { - cm->height -= pci->metrics.ascent; - cm->yhot = 0; - } - else - { - cm->yhot = pci->metrics.ascent; - if (pci->metrics.descent < 0) - cm->height -= pci->metrics.descent; - } - return TRUE; -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.XF86.original deleted file mode 100644 index 630e98fa3..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.XF86.original +++ /dev/null @@ -1,197 +0,0 @@ -/************************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ - -/* $Xorg: glyphcurs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "misc.h" -#include "fontstruct.h" -#include "dixfontstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "resource.h" -#include "dix.h" -#include "cursorstr.h" -#include "opaque.h" -#include "servermd.h" - - -/* - get the bits out of the font in a portable way. to avoid -dealing with padding and such-like, we draw the glyph into -a bitmap, then read the bits out with GetImage, which -uses server-natural format. - since all screens return the same bitmap format, we'll just use -the first one we find. - the character origin lines up with the hotspot in the -cursor metrics. -*/ - -int -ServerBitsFromGlyph(pfont, ch, cm, ppbits) - FontPtr pfont; - unsigned int ch; - register CursorMetricPtr cm; - unsigned char **ppbits; -{ - register ScreenPtr pScreen; - register GCPtr pGC; - xRectangle rect; - PixmapPtr ppix; - long nby; - char *pbits; - ChangeGCVal gcval[3]; - unsigned char char2b[2]; - - /* turn glyph index into a protocol-format char2b */ - char2b[0] = (unsigned char)(ch >> 8); - char2b[1] = (unsigned char)(ch & 0xff); - - pScreen = screenInfo.screens[0]; - nby = BitmapBytePad(cm->width) * (long)cm->height; - pbits = (char *)xalloc(nby); - if (!pbits) - return BadAlloc; - /* zeroing the (pad) bits seems to help some ddx cursor handling */ - bzero(pbits, nby); - - ppix = (PixmapPtr)(*pScreen->CreatePixmap)(pScreen, cm->width, - cm->height, 1); - pGC = GetScratchGC(1, pScreen); - if (!ppix || !pGC) - { - if (ppix) - (*pScreen->DestroyPixmap)(ppix); - if (pGC) - FreeScratchGC(pGC); - xfree(pbits); - return BadAlloc; - } - - rect.x = 0; - rect.y = 0; - rect.width = cm->width; - rect.height = cm->height; - - /* fill the pixmap with 0 */ - gcval[0].val = GXcopy; - gcval[1].val = 0; - gcval[2].ptr = (pointer)pfont; - dixChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont, - NULL, gcval); - ValidateGC((DrawablePtr)ppix, pGC); - (*pGC->ops->PolyFillRect)((DrawablePtr)ppix, pGC, 1, &rect); - - /* draw the glyph */ - gcval[0].val = 1; - dixChangeGC(NullClient, pGC, GCForeground, NULL, gcval); - ValidateGC((DrawablePtr)ppix, pGC); - (*pGC->ops->PolyText16)((DrawablePtr)ppix, pGC, cm->xhot, cm->yhot, - 1, (unsigned short *)char2b); - (*pScreen->GetImage)((DrawablePtr)ppix, 0, 0, cm->width, cm->height, - XYPixmap, 1, pbits); - *ppbits = (unsigned char *)pbits; - FreeScratchGC(pGC); - (*pScreen->DestroyPixmap)(ppix); - return Success; -} - - -Bool -CursorMetricsFromGlyph( pfont, ch, cm) - register FontPtr pfont; - unsigned ch; - register CursorMetricPtr cm; -{ - CharInfoPtr pci; - unsigned long nglyphs; - CARD8 chs[2]; - FontEncoding encoding; - - chs[0] = ch >> 8; - chs[1] = ch; - encoding = (FONTLASTROW(pfont) == 0) ? Linear16Bit : TwoD16Bit; - if (encoding == Linear16Bit) - { - if (ch < pfont->info.firstCol || pfont->info.lastCol < ch) - return FALSE; - } - else - { - if (chs[0] < pfont->info.firstRow || pfont->info.lastRow < chs[0]) - return FALSE; - if (chs[1] < pfont->info.firstCol || pfont->info.lastCol < chs[1]) - return FALSE; - } - (*pfont->get_glyphs) (pfont, 1, chs, encoding, &nglyphs, &pci); - if (nglyphs == 0) - return FALSE; - cm->width = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; - cm->height = pci->metrics.descent + pci->metrics.ascent; - if (pci->metrics.leftSideBearing > 0) - { - cm->width += pci->metrics.leftSideBearing; - cm->xhot = 0; - } - else - { - cm->xhot = -pci->metrics.leftSideBearing; - if (pci->metrics.rightSideBearing < 0) - cm->width -= pci->metrics.rightSideBearing; - } - if (pci->metrics.ascent < 0) - { - cm->height -= pci->metrics.ascent; - cm->yhot = 0; - } - else - { - cm->yhot = pci->metrics.ascent; - if (pci->metrics.descent < 0) - cm->height -= pci->metrics.descent; - } - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original deleted file mode 100644 index 0f122be4a..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original +++ /dev/null @@ -1,161 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXglyphstr.h" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.4 2001/01/21 21:19:39 tsi Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -/* - * This must keep the same symbol as the original glyphstr.h - * or symbols will be redefined. The code here adds a field - * to _GlyphSet. This should be done by defining a new type - * and casting when appropriate. - */ - -#ifndef _GLYPHSTR_H_ -#define _GLYPHSTR_H_ - -#include "renderproto.h" -#include "../../render/picture.h" -#include "screenint.h" - -#define GlyphFormat1 0 -#define GlyphFormat4 1 -#define GlyphFormat8 2 -#define GlyphFormat16 3 -#define GlyphFormat32 4 -#define GlyphFormatNum 5 - -typedef struct _Glyph { - CARD32 refcnt; - CARD32 size; /* info + bitmap */ - xGlyphInfo info; - /* bits follow */ -} GlyphRec, *GlyphPtr; - -typedef struct _GlyphRef { - CARD32 signature; - GlyphPtr glyph; - CARD16 corruptedGlyph; -} GlyphRefRec, *GlyphRefPtr; - -#define DeletedGlyph ((GlyphPtr) 1) - -typedef struct _GlyphHashSet { - CARD32 entries; - CARD32 size; - CARD32 rehash; -} GlyphHashSetRec, *GlyphHashSetPtr; - -typedef struct _GlyphHash { - GlyphRefPtr table; - GlyphHashSetPtr hashSet; - CARD32 tableEntries; -} GlyphHashRec, *GlyphHashPtr; - -typedef struct _GlyphSet { - CARD32 refcnt; - PictFormatPtr format; - int fdepth; - GlyphHashRec hash; - CARD32 remoteID; -} GlyphSetRec, *GlyphSetPtr; - -typedef struct _GlyphList { - INT16 xOff; - INT16 yOff; - CARD8 len; - PictFormatPtr format; -} GlyphListRec, *GlyphListPtr; - -extern GlyphHashRec globalGlyphs[GlyphFormatNum]; - -GlyphHashSetPtr -FindGlyphHashSet (CARD32 filled); - -Bool -GlyphInit (ScreenPtr pScreen); - -GlyphRefPtr -FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare); - -CARD32 -HashGlyph (GlyphPtr glyph); - -void -FreeGlyph (GlyphPtr glyph, int format); - -void -AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id); - -Bool -DeleteGlyph (GlyphSetPtr glyphSet, Glyph id); - -GlyphPtr -FindGlyph (GlyphSetPtr glyphSet, Glyph id); - -GlyphPtr -AllocateGlyph (xGlyphInfo *gi, int format); - -Bool -AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet); - -Bool -ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global); - -Bool -ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change); - -GlyphSetPtr -AllocateGlyphSet (int fdepth, PictFormatPtr format); - -int -FreeGlyphSet (pointer value, - XID gid); - - - -#endif /* _GLYPHSTR_H_ */ - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.XF86.original deleted file mode 100644 index 99f55e3eb..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.XF86.original +++ /dev/null @@ -1,127 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.4 2001/01/21 21:19:39 tsi Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifndef _GLYPHSTR_H_ -#define _GLYPHSTR_H_ - -#include "renderproto.h" -#include "picture.h" -#include "screenint.h" - -#define GlyphFormat1 0 -#define GlyphFormat4 1 -#define GlyphFormat8 2 -#define GlyphFormat16 3 -#define GlyphFormat32 4 -#define GlyphFormatNum 5 - -typedef struct _Glyph { - CARD32 refcnt; - CARD32 size; /* info + bitmap */ - xGlyphInfo info; - /* bits follow */ -} GlyphRec, *GlyphPtr; - -typedef struct _GlyphRef { - CARD32 signature; - GlyphPtr glyph; -} GlyphRefRec, *GlyphRefPtr; - -#define DeletedGlyph ((GlyphPtr) 1) - -typedef struct _GlyphHashSet { - CARD32 entries; - CARD32 size; - CARD32 rehash; -} GlyphHashSetRec, *GlyphHashSetPtr; - -typedef struct _GlyphHash { - GlyphRefPtr table; - GlyphHashSetPtr hashSet; - CARD32 tableEntries; -} GlyphHashRec, *GlyphHashPtr; - -typedef struct _GlyphSet { - CARD32 refcnt; - PictFormatPtr format; - int fdepth; - GlyphHashRec hash; -} GlyphSetRec, *GlyphSetPtr; - -typedef struct _GlyphList { - INT16 xOff; - INT16 yOff; - CARD8 len; - PictFormatPtr format; -} GlyphListRec, *GlyphListPtr; - -extern GlyphHashRec globalGlyphs[GlyphFormatNum]; - -GlyphHashSetPtr -FindGlyphHashSet (CARD32 filled); - -Bool -GlyphInit (ScreenPtr pScreen); - -GlyphRefPtr -FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare); - -CARD32 -HashGlyph (GlyphPtr glyph); - -void -FreeGlyph (GlyphPtr glyph, int format); - -void -AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id); - -Bool -DeleteGlyph (GlyphSetPtr glyphSet, Glyph id); - -GlyphPtr -FindGlyph (GlyphSetPtr glyphSet, Glyph id); - -GlyphPtr -AllocateGlyph (xGlyphInfo *gi, int format); - -Bool -AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet); - -Bool -ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global); - -Bool -ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change); - -GlyphSetPtr -AllocateGlyphSet (int fdepth, PictFormatPtr format); - -int -FreeGlyphSet (pointer value, - XID gid); - - - -#endif /* _GLYPHSTR_H_ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c.NX.original deleted file mode 100644 index bd068170c..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c.NX.original +++ /dev/null @@ -1,938 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXmiexpose.c" - -#else - -/* $XFree86: xc/programs/Xserver/mi/miexpose.c,v 3.9 2001/12/14 20:00:22 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* $Xorg: miexpose.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ - -#include "X.h" -#define NEED_EVENTS -#include "Xproto.h" -#include "Xprotostr.h" - -#include "misc.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmap.h" -#include "input.h" - -#include "dixstruct.h" -#include "mi.h" -#include "Xmd.h" - -#include "globals.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -/* - machine-independent graphics exposure code. any device that uses -the region package can call this. -*/ - -#ifdef NXAGENT_SERVER - -#include "Windows.h" - -#endif - -#ifndef RECTLIMIT -#define RECTLIMIT 25 /* pick a number, any number > 8 */ -#endif - -/* miHandleExposures - generate a region for exposures for areas that were copied from obscured or -non-existent areas to non-obscured areas of the destination. Paint the -background for the region, if the destination is a window. - -NOTE: - this should generally be called, even if graphicsExposures is false, -because this is where bits get recovered from backing store. - -NOTE: - added argument 'plane' is used to indicate how exposures from backing -store should be accomplished. If plane is 0 (i.e. no bit plane), CopyArea -should be used, else a CopyPlane of the indicated plane will be used. The -exposing is done by the backing store's GraphicsExpose function, of course. - -*/ - -RegionPtr -miHandleExposures(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, plane) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; - GCPtr pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; - unsigned long plane; -{ - register ScreenPtr pscr; - RegionPtr prgnSrcClip; /* drawable-relative source clip */ - RegionRec rgnSrcRec; - RegionPtr prgnDstClip; /* drawable-relative dest clip */ - RegionRec rgnDstRec; - BoxRec srcBox; /* unclipped source */ - RegionRec rgnExposed; /* exposed region, calculated source- - relative, made dst relative to - intersect with visible parts of - dest and send events to client, - and then screen relative to paint - the window background - */ - WindowPtr pSrcWin; - BoxRec expBox; - Bool extents; - -#ifdef NXAGENT_SERVER - - /* - * Set the elements reported by the compiler - * as uninitialized. - */ - - expBox.x1 = 0; - expBox.y1 = 0; - expBox.x2 = 0; - expBox.y2 = 0; - -#endif - - /* This prevents warning about pscr not being used. */ - pGC->pScreen = pscr = pGC->pScreen; - - /* avoid work if we can */ - if (!pGC->graphicsExposures && - (pDstDrawable->type == DRAWABLE_PIXMAP) && - ((pSrcDrawable->type == DRAWABLE_PIXMAP) || - (((WindowPtr)pSrcDrawable)->backStorage == NULL))) - return NULL; - - srcBox.x1 = srcx; - srcBox.y1 = srcy; - srcBox.x2 = srcx+width; - srcBox.y2 = srcy+height; - - if (pSrcDrawable->type != DRAWABLE_PIXMAP) - { - BoxRec TsrcBox; - - TsrcBox.x1 = srcx + pSrcDrawable->x; - TsrcBox.y1 = srcy + pSrcDrawable->y; - TsrcBox.x2 = TsrcBox.x1 + width; - TsrcBox.y2 = TsrcBox.y1 + height; - pSrcWin = (WindowPtr) pSrcDrawable; - if (pGC->subWindowMode == IncludeInferiors) - { - prgnSrcClip = NotClippedByChildren (pSrcWin); - if ((RECT_IN_REGION(pscr, prgnSrcClip, &TsrcBox)) == rgnIN) - { - REGION_DESTROY(pscr, prgnSrcClip); - return NULL; - } - } - else - { - if ((RECT_IN_REGION(pscr, &pSrcWin->clipList, &TsrcBox)) == rgnIN) - return NULL; - prgnSrcClip = &rgnSrcRec; - REGION_INIT(pscr, prgnSrcClip, NullBox, 0); - REGION_COPY(pscr, prgnSrcClip, &pSrcWin->clipList); - } - REGION_TRANSLATE(pscr, prgnSrcClip, - -pSrcDrawable->x, -pSrcDrawable->y); - } - else - { - BoxRec box; - - if ((srcBox.x1 >= 0) && (srcBox.y1 >= 0) && - (srcBox.x2 <= pSrcDrawable->width) && - (srcBox.y2 <= pSrcDrawable->height)) - return NULL; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pSrcDrawable->width; - box.y2 = pSrcDrawable->height; - prgnSrcClip = &rgnSrcRec; - REGION_INIT(pscr, prgnSrcClip, &box, 1); - pSrcWin = (WindowPtr)NULL; - } - - if (pDstDrawable == pSrcDrawable) - { - prgnDstClip = prgnSrcClip; - } - else if (pDstDrawable->type != DRAWABLE_PIXMAP) - { - if (pGC->subWindowMode == IncludeInferiors) - { - prgnDstClip = NotClippedByChildren((WindowPtr)pDstDrawable); - } - else - { - prgnDstClip = &rgnDstRec; - REGION_INIT(pscr, prgnDstClip, NullBox, 0); - REGION_COPY(pscr, prgnDstClip, - &((WindowPtr)pDstDrawable)->clipList); - } - REGION_TRANSLATE(pscr, prgnDstClip, - -pDstDrawable->x, -pDstDrawable->y); - } - else - { - BoxRec box; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pDstDrawable->width; - box.y2 = pDstDrawable->height; - prgnDstClip = &rgnDstRec; - REGION_INIT(pscr, prgnDstClip, &box, 1); - } - - /* drawable-relative source region */ - REGION_INIT(pscr, &rgnExposed, &srcBox, 1); - - /* now get the hidden parts of the source box*/ - REGION_SUBTRACT(pscr, &rgnExposed, &rgnExposed, prgnSrcClip); - - if (pSrcWin && pSrcWin->backStorage) - { - /* - * Copy any areas from the source backing store. Modifies - * rgnExposed. - */ - (* pSrcWin->drawable.pScreen->ExposeCopy) ((WindowPtr)pSrcDrawable, - pDstDrawable, - pGC, - &rgnExposed, - srcx, srcy, - dstx, dsty, - plane); - } - - /* move them over the destination */ - REGION_TRANSLATE(pscr, &rgnExposed, dstx-srcx, dsty-srcy); - - /* intersect with visible areas of dest */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip); - - /* - * If we have LOTS of rectangles, we decide to take the extents - * and force an exposure on that. This should require much less - * work overall, on both client and server. This is cheating, but - * isn't prohibited by the protocol ("spontaneous combustion" :-) - * for windows. - */ - extents = pGC->graphicsExposures && - (REGION_NUM_RECTS(&rgnExposed) > RECTLIMIT) && - (pDstDrawable->type != DRAWABLE_PIXMAP); -#ifdef SHAPE - if (pSrcWin) - { - RegionPtr region; - if (!(region = wClipShape (pSrcWin))) - region = wBoundingShape (pSrcWin); - /* - * If you try to CopyArea the extents of a shaped window, compacting the - * exposed region will undo all our work! - */ - if (extents && pSrcWin && region && - (RECT_IN_REGION(pscr, region, &srcBox) != rgnIN)) - extents = FALSE; - } -#endif - if (extents) - { - WindowPtr pWin = (WindowPtr)pDstDrawable; - - expBox = *REGION_EXTENTS(pscr, &rgnExposed); - REGION_RESET(pscr, &rgnExposed, &expBox); - /* need to clear out new areas of backing store */ - if (pWin->backStorage) - (void) (* pWin->drawable.pScreen->ClearBackingStore)( - pWin, - expBox.x1, - expBox.y1, - expBox.x2 - expBox.x1, - expBox.y2 - expBox.y1, - FALSE); - } - if ((pDstDrawable->type != DRAWABLE_PIXMAP) && - (((WindowPtr)pDstDrawable)->backgroundState != None)) - { - WindowPtr pWin = (WindowPtr)pDstDrawable; - - /* make the exposed area screen-relative */ - REGION_TRANSLATE(pscr, &rgnExposed, - pDstDrawable->x, pDstDrawable->y); - - if (extents) - { - /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList); - } - (*pWin->drawable.pScreen->PaintWindowBackground)( - (WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); - - if (extents) - { - REGION_RESET(pscr, &rgnExposed, &expBox); - } - else - REGION_TRANSLATE(pscr, &rgnExposed, - -pDstDrawable->x, -pDstDrawable->y); - } - if (prgnDstClip == &rgnDstRec) - { - REGION_UNINIT(pscr, prgnDstClip); - } - else if (prgnDstClip != prgnSrcClip) - { - REGION_DESTROY(pscr, prgnDstClip); - } - - if (prgnSrcClip == &rgnSrcRec) - { - REGION_UNINIT(pscr, prgnSrcClip); - } - else - { - REGION_DESTROY(pscr, prgnSrcClip); - } - - if (pGC->graphicsExposures) - { - /* don't look */ - RegionPtr exposed = REGION_CREATE(pscr, NullBox, 0); - *exposed = rgnExposed; - return exposed; - } - else - { - REGION_UNINIT(pscr, &rgnExposed); - return NULL; - } -} - -/* send GraphicsExpose events, or a NoExpose event, based on the region */ - -void -miSendGraphicsExpose (client, pRgn, drawable, major, minor) - ClientPtr client; - RegionPtr pRgn; - XID drawable; - int major; - int minor; -{ - if (pRgn && !REGION_NIL(pRgn)) - { - xEvent *pEvent; - register xEvent *pe; - register BoxPtr pBox; - register int i; - int numRects; - - numRects = REGION_NUM_RECTS(pRgn); - pBox = REGION_RECTS(pRgn); - if(!(pEvent = (xEvent *)ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) - return; - pe = pEvent; - - for (i=1; i<=numRects; i++, pe++, pBox++) - { - pe->u.u.type = GraphicsExpose; - pe->u.graphicsExposure.drawable = drawable; - pe->u.graphicsExposure.x = pBox->x1; - pe->u.graphicsExposure.y = pBox->y1; - pe->u.graphicsExposure.width = pBox->x2 - pBox->x1; - pe->u.graphicsExposure.height = pBox->y2 - pBox->y1; - pe->u.graphicsExposure.count = numRects - i; - pe->u.graphicsExposure.majorEvent = major; - pe->u.graphicsExposure.minorEvent = minor; - } - TryClientEvents(client, pEvent, numRects, - (Mask)0, NoEventMask, NullGrab); - DEALLOCATE_LOCAL(pEvent); - } - else - { - xEvent event; - event.u.u.type = NoExpose; - event.u.noExposure.drawable = drawable; - event.u.noExposure.majorEvent = major; - event.u.noExposure.minorEvent = minor; - TryClientEvents(client, &event, 1, - (Mask)0, NoEventMask, NullGrab); - } -} - - -void -miSendExposures(pWin, pRgn, dx, dy) - WindowPtr pWin; - RegionPtr pRgn; - register int dx, dy; -{ - register BoxPtr pBox; - int numRects; - register xEvent *pEvent, *pe; - register int i; - - pBox = REGION_RECTS(pRgn); - numRects = REGION_NUM_RECTS(pRgn); - if(!(pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) - return; - - for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++) - { - pe->u.u.type = Expose; - pe->u.expose.window = pWin->drawable.id; - pe->u.expose.x = pBox->x1 - dx; - pe->u.expose.y = pBox->y1 - dy; - pe->u.expose.width = pBox->x2 - pBox->x1; - pe->u.expose.height = pBox->y2 - pBox->y1; - pe->u.expose.count = i; - } - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int scrnum = pWin->drawable.pScreen->myNum; - int x = 0, y = 0; - XID realWin = 0; - - if(!pWin->parent) { - x = panoramiXdataPtr[scrnum].x; - y = panoramiXdataPtr[scrnum].y; - pWin = WindowTable[0]; - realWin = pWin->drawable.id; - } else if (scrnum) { - PanoramiXRes *win; - win = PanoramiXFindIDByScrnum(XRT_WINDOW, - pWin->drawable.id, scrnum); - if(!win) { - DEALLOCATE_LOCAL(pEvent); - return; - } - realWin = win->info[0].id; - pWin = LookupIDByType(realWin, RT_WINDOW); - } - if(x || y || scrnum) - for (i = 0; i < numRects; i++) { - pEvent[i].u.expose.window = realWin; - pEvent[i].u.expose.x += x; - pEvent[i].u.expose.y += y; - } - } -#endif - - DeliverEvents(pWin, pEvent, numRects, NullWindow); - - DEALLOCATE_LOCAL(pEvent); -} - -void -miWindowExposures(pWin, prgn, other_exposed) - WindowPtr pWin; - register RegionPtr prgn, other_exposed; -{ -#ifdef NXAGENT_SERVER - - int total; - -#endif - RegionPtr exposures = prgn; - if (pWin->backStorage && prgn) - /* - * in some cases, backing store will cause a different - * region to be exposed than needs to be repainted - * (like when a window is mapped). RestoreAreas is - * allowed to return a region other than prgn, - * in which case this routine will free the resultant - * region. If exposures is null, then no events will - * be sent to the client; if prgn is empty - * no areas will be repainted. - */ - exposures = (*pWin->drawable.pScreen->RestoreAreas)(pWin, prgn); - if ((prgn && !REGION_NIL(prgn)) || - (exposures && !REGION_NIL(exposures)) || other_exposed) - { - RegionRec expRec; - int clientInterested; - - /* - * Restore from backing-store FIRST. - */ - clientInterested = (pWin->eventMask|wOtherEventMasks(pWin)) & ExposureMask; - if (other_exposed) - { - if (exposures) - { - REGION_UNION(pWin->drawable.pScreen, other_exposed, - exposures, - other_exposed); - if (exposures != prgn) - REGION_DESTROY(pWin->drawable.pScreen, exposures); - } - exposures = other_exposed; - } -#ifdef NXAGENT_SERVER - - /* - * If the number of rectangles is greater - * than 4, let the function decide. - */ - - total = REGION_NUM_RECTS(exposures); - - if (clientInterested && exposures && (total > RECTLIMIT || - (total > 4 && nxagentExtentsPredicate(total) == 1))) -#else - if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT)) -#endif - { - /* - * If we have LOTS of rectangles, we decide to take the extents - * and force an exposure on that. This should require much less - * work overall, on both client and server. This is cheating, but - * isn't prohibited by the protocol ("spontaneous combustion" :-). - */ - BoxRec box; - - box = *REGION_EXTENTS( pWin->drawable.pScreen, exposures); - if (exposures == prgn) { - exposures = &expRec; - REGION_INIT( pWin->drawable.pScreen, exposures, &box, 1); - REGION_RESET( pWin->drawable.pScreen, prgn, &box); - } else { - REGION_RESET( pWin->drawable.pScreen, exposures, &box); - REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures); - } - /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList); - /* need to clear out new areas of backing store, too */ - if (pWin->backStorage) - (void) (* pWin->drawable.pScreen->ClearBackingStore)( - pWin, - box.x1 - pWin->drawable.x, - box.y1 - pWin->drawable.y, - box.x2 - box.x1, - box.y2 - box.y1, - FALSE); - } - if (prgn && !REGION_NIL(prgn)) - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !REGION_NIL(exposures)) - miSendExposures(pWin, exposures, - pWin->drawable.x, pWin->drawable.y); - if (exposures == &expRec) - { - REGION_UNINIT( pWin->drawable.pScreen, exposures); - } - else if (exposures && exposures != prgn && exposures != other_exposed) - REGION_DESTROY( pWin->drawable.pScreen, exposures); - if (prgn) - REGION_EMPTY( pWin->drawable.pScreen, prgn); - } - else if (exposures && exposures != prgn) - REGION_DESTROY( pWin->drawable.pScreen, exposures); -} - - -/* - this code is highly unlikely. it is not haile selassie. - - there is some hair here. we can't just use the window's -clip region as it is, because if we are painting the border, -the border is not in the client area and so we will be excluded -when we validate the GC, and if we are painting a parent-relative -background, the area we want to paint is in some other window. -since we trust the code calling us to tell us to paint only areas -that are really ours, we will temporarily give the window a -clipList the size of the whole screen and an origin at (0,0). -this more or less assumes that ddX code will do translation -based on the window's absolute position, and that ValidateGC will -look at clipList, and that no other fields from the -window will be used. it's not possible to just draw -in the root because it may be a different depth. - -to get the tile to align correctly we set the GC's tile origin to -be the (x,y) of the window's upper left corner, after which we -get the right bits when drawing into the root. - -because the clip_mask is being set to None, we may call DoChangeGC with -fPointer set true, thus we no longer need to install the background or -border tile in the resource table. -*/ - -static RESTYPE ResType = 0; -static int numGCs = 0; -static GCPtr screenContext[MAXSCREENS]; - -/*ARGSUSED*/ -static int -tossGC ( - pointer value, - XID id) -{ - GCPtr pGC = (GCPtr)value; - screenContext[pGC->pScreen->myNum] = (GCPtr)NULL; - FreeGC (pGC, id); - numGCs--; - if (!numGCs) - ResType = 0; - - return 0; -} - - -void -miPaintWindow(pWin, prgn, what) -register WindowPtr pWin; -RegionPtr prgn; -int what; -{ - int status; - - Bool usingScratchGC = FALSE; - WindowPtr pRoot; - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - ChangeGCVal gcval[7]; - ChangeGCVal newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - -#ifdef NXAGENT_SERVER - - /* - * Set the elements reported by the compiler - * as uninitialized. - */ - - prgnWin.extents.x1 = 0; - prgnWin.extents.y1 = 0; - prgnWin.extents.x2 = 0; - prgnWin.extents.y2 = 0; - - prgnWin.data = NULL; - - oldCorner.x = 0; - oldCorner.y = 0; - -#endif - - gcmask = 0; - - if (what == PW_BACKGROUND) - { - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground)(pWin->parent, prgn, what); - return; - case BackgroundPixel: - newValues[FOREGROUND].val = pWin->background.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE].ptr = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - break; - } - } - else - { - if (pWin->borderIsPixel) - { - newValues[FOREGROUND].val = pWin->border.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE].ptr = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * - sizeof(xRectangle)); - if (!prect) - return; - - newValues[FUNCTION].val = GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - pRoot = WindowTable[i]; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - } - - if ((pWin->drawable.depth != pRoot->drawable.depth) || - (pWin->drawable.bitsPerPixel != pRoot->drawable.bitsPerPixel)) - { - usingScratchGC = TRUE; - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if (!pGC) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if (what == PW_BORDER) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - } - else - { - newValues[ABSX].val = 0; - newValues[ABSY].val = 0; - } - } else { - /* - * draw the background to the root window - */ - if (screenContext[i] == (GCPtr)NULL) - { - if (!ResType && !(ResType = CreateNewResourceType(tossGC))) - return; - screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0, - (XID *)NULL, &status); - if (!screenContext[i]) - return; - numGCs++; - if (!AddResource(FakeClientID(0), ResType, - (pointer)screenContext[i])) - return; - } - pGC = screenContext[i]; - newValues[SUBWINDOW].val = IncludeInferiors; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - gcmask |= GCSubwindowMode; - pWin = pRoot; - } - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack); - - mask = gcmask; - gcmask = 0; - i = 0; - while (mask) { - index = lowbit (mask); - mask &= ~index; - switch (index) { - case GCFunction: - if (pGC->alu != newValues[FUNCTION].val) { - gcmask |= index; - gcval[i++].val = newValues[FUNCTION].val; - } - break; - case GCTileStipXOrigin: - if ( pGC->patOrg.x != newValues[ABSX].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSX].val; - } - break; - case GCTileStipYOrigin: - if ( pGC->patOrg.y != newValues[ABSY].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSY].val; - } - break; - case GCClipMask: - if ( pGC->clientClipType != CT_NONE) { - gcmask |= index; - gcval[i++].val = CT_NONE; - } - break; - case GCSubwindowMode: - if ( pGC->subWindowMode != newValues[SUBWINDOW].val) { - gcmask |= index; - gcval[i++].val = newValues[SUBWINDOW].val; - } - break; - case GCTile: - if (pGC->tileIsPixel || pGC->tile.pixmap != newValues[TILE].ptr) - { - gcmask |= index; - gcval[i++].ptr = newValues[TILE].ptr; - } - break; - case GCFillStyle: - if ( pGC->fillStyle != newValues[FILLSTYLE].val) { - gcmask |= index; - gcval[i++].val = newValues[FILLSTYLE].val; - } - break; - case GCForeground: - if ( pGC->fgPixel != newValues[FOREGROUND].val) { - gcmask |= index; - gcval[i++].val = newValues[FOREGROUND].val; - } - break; - } - } - - if (gcmask) - dixChangeGC(NullClient, pGC, gcmask, NULL, gcval); - - if (pWin->drawable.serialNumber != pGC->serialNumber) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(prgn); - pbox = REGION_RECTS(prgn); - for (i= numRects; --i >= 0; pbox++, prect++) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing); - - if (usingScratchGC) - { - if (what == PW_BORDER) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); - } -} - - -/* MICLEARDRAWABLE -- sets the entire drawable to the background color of - * the GC. Useful when we have a scratch drawable and need to initialize - * it. */ -void -miClearDrawable(pDraw, pGC) - DrawablePtr pDraw; - GCPtr pGC; -{ - XID fg = pGC->fgPixel; - XID bg = pGC->bgPixel; - xRectangle rect; - - rect.x = 0; - rect.y = 0; - rect.width = pDraw->width; - rect.height = pDraw->height; - DoChangeGC(pGC, GCForeground, &bg, 0); - ValidateGC(pDraw, pGC); - (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect); - DoChangeGC(pGC, GCForeground, &fg, 0); - ValidateGC(pDraw, pGC); -} - -#endif /* NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c.XF86.original deleted file mode 100644 index ca896b9e0..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c.XF86.original +++ /dev/null @@ -1,873 +0,0 @@ -/* $XFree86: xc/programs/Xserver/mi/miexpose.c,v 3.9 2001/12/14 20:00:22 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* $Xorg: miexpose.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ - -#include "X.h" -#define NEED_EVENTS -#include "Xproto.h" -#include "Xprotostr.h" - -#include "misc.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmap.h" -#include "input.h" - -#include "dixstruct.h" -#include "mi.h" -#include "Xmd.h" - -#include "globals.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -/* - machine-independent graphics exposure code. any device that uses -the region package can call this. -*/ - -#ifndef RECTLIMIT -#define RECTLIMIT 25 /* pick a number, any number > 8 */ -#endif - -/* miHandleExposures - generate a region for exposures for areas that were copied from obscured or -non-existent areas to non-obscured areas of the destination. Paint the -background for the region, if the destination is a window. - -NOTE: - this should generally be called, even if graphicsExposures is false, -because this is where bits get recovered from backing store. - -NOTE: - added argument 'plane' is used to indicate how exposures from backing -store should be accomplished. If plane is 0 (i.e. no bit plane), CopyArea -should be used, else a CopyPlane of the indicated plane will be used. The -exposing is done by the backing store's GraphicsExpose function, of course. - -*/ - -RegionPtr -miHandleExposures(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, plane) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; - GCPtr pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; - unsigned long plane; -{ - register ScreenPtr pscr; - RegionPtr prgnSrcClip; /* drawable-relative source clip */ - RegionRec rgnSrcRec; - RegionPtr prgnDstClip; /* drawable-relative dest clip */ - RegionRec rgnDstRec; - BoxRec srcBox; /* unclipped source */ - RegionRec rgnExposed; /* exposed region, calculated source- - relative, made dst relative to - intersect with visible parts of - dest and send events to client, - and then screen relative to paint - the window background - */ - WindowPtr pSrcWin; - BoxRec expBox; - Bool extents; - - /* This prevents warning about pscr not being used. */ - pGC->pScreen = pscr = pGC->pScreen; - - /* avoid work if we can */ - if (!pGC->graphicsExposures && - (pDstDrawable->type == DRAWABLE_PIXMAP) && - ((pSrcDrawable->type == DRAWABLE_PIXMAP) || - (((WindowPtr)pSrcDrawable)->backStorage == NULL))) - return NULL; - - srcBox.x1 = srcx; - srcBox.y1 = srcy; - srcBox.x2 = srcx+width; - srcBox.y2 = srcy+height; - - if (pSrcDrawable->type != DRAWABLE_PIXMAP) - { - BoxRec TsrcBox; - - TsrcBox.x1 = srcx + pSrcDrawable->x; - TsrcBox.y1 = srcy + pSrcDrawable->y; - TsrcBox.x2 = TsrcBox.x1 + width; - TsrcBox.y2 = TsrcBox.y1 + height; - pSrcWin = (WindowPtr) pSrcDrawable; - if (pGC->subWindowMode == IncludeInferiors) - { - prgnSrcClip = NotClippedByChildren (pSrcWin); - if ((RECT_IN_REGION(pscr, prgnSrcClip, &TsrcBox)) == rgnIN) - { - REGION_DESTROY(pscr, prgnSrcClip); - return NULL; - } - } - else - { - if ((RECT_IN_REGION(pscr, &pSrcWin->clipList, &TsrcBox)) == rgnIN) - return NULL; - prgnSrcClip = &rgnSrcRec; - REGION_INIT(pscr, prgnSrcClip, NullBox, 0); - REGION_COPY(pscr, prgnSrcClip, &pSrcWin->clipList); - } - REGION_TRANSLATE(pscr, prgnSrcClip, - -pSrcDrawable->x, -pSrcDrawable->y); - } - else - { - BoxRec box; - - if ((srcBox.x1 >= 0) && (srcBox.y1 >= 0) && - (srcBox.x2 <= pSrcDrawable->width) && - (srcBox.y2 <= pSrcDrawable->height)) - return NULL; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pSrcDrawable->width; - box.y2 = pSrcDrawable->height; - prgnSrcClip = &rgnSrcRec; - REGION_INIT(pscr, prgnSrcClip, &box, 1); - pSrcWin = (WindowPtr)NULL; - } - - if (pDstDrawable == pSrcDrawable) - { - prgnDstClip = prgnSrcClip; - } - else if (pDstDrawable->type != DRAWABLE_PIXMAP) - { - if (pGC->subWindowMode == IncludeInferiors) - { - prgnDstClip = NotClippedByChildren((WindowPtr)pDstDrawable); - } - else - { - prgnDstClip = &rgnDstRec; - REGION_INIT(pscr, prgnDstClip, NullBox, 0); - REGION_COPY(pscr, prgnDstClip, - &((WindowPtr)pDstDrawable)->clipList); - } - REGION_TRANSLATE(pscr, prgnDstClip, - -pDstDrawable->x, -pDstDrawable->y); - } - else - { - BoxRec box; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pDstDrawable->width; - box.y2 = pDstDrawable->height; - prgnDstClip = &rgnDstRec; - REGION_INIT(pscr, prgnDstClip, &box, 1); - } - - /* drawable-relative source region */ - REGION_INIT(pscr, &rgnExposed, &srcBox, 1); - - /* now get the hidden parts of the source box*/ - REGION_SUBTRACT(pscr, &rgnExposed, &rgnExposed, prgnSrcClip); - - if (pSrcWin && pSrcWin->backStorage) - { - /* - * Copy any areas from the source backing store. Modifies - * rgnExposed. - */ - (* pSrcWin->drawable.pScreen->ExposeCopy) ((WindowPtr)pSrcDrawable, - pDstDrawable, - pGC, - &rgnExposed, - srcx, srcy, - dstx, dsty, - plane); - } - - /* move them over the destination */ - REGION_TRANSLATE(pscr, &rgnExposed, dstx-srcx, dsty-srcy); - - /* intersect with visible areas of dest */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip); - - /* - * If we have LOTS of rectangles, we decide to take the extents - * and force an exposure on that. This should require much less - * work overall, on both client and server. This is cheating, but - * isn't prohibited by the protocol ("spontaneous combustion" :-) - * for windows. - */ - extents = pGC->graphicsExposures && - (REGION_NUM_RECTS(&rgnExposed) > RECTLIMIT) && - (pDstDrawable->type != DRAWABLE_PIXMAP); -#ifdef SHAPE - if (pSrcWin) - { - RegionPtr region; - if (!(region = wClipShape (pSrcWin))) - region = wBoundingShape (pSrcWin); - /* - * If you try to CopyArea the extents of a shaped window, compacting the - * exposed region will undo all our work! - */ - if (extents && pSrcWin && region && - (RECT_IN_REGION(pscr, region, &srcBox) != rgnIN)) - extents = FALSE; - } -#endif - if (extents) - { - WindowPtr pWin = (WindowPtr)pDstDrawable; - - expBox = *REGION_EXTENTS(pscr, &rgnExposed); - REGION_RESET(pscr, &rgnExposed, &expBox); - /* need to clear out new areas of backing store */ - if (pWin->backStorage) - (void) (* pWin->drawable.pScreen->ClearBackingStore)( - pWin, - expBox.x1, - expBox.y1, - expBox.x2 - expBox.x1, - expBox.y2 - expBox.y1, - FALSE); - } - if ((pDstDrawable->type != DRAWABLE_PIXMAP) && - (((WindowPtr)pDstDrawable)->backgroundState != None)) - { - WindowPtr pWin = (WindowPtr)pDstDrawable; - - /* make the exposed area screen-relative */ - REGION_TRANSLATE(pscr, &rgnExposed, - pDstDrawable->x, pDstDrawable->y); - - if (extents) - { - /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList); - } - (*pWin->drawable.pScreen->PaintWindowBackground)( - (WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); - - if (extents) - { - REGION_RESET(pscr, &rgnExposed, &expBox); - } - else - REGION_TRANSLATE(pscr, &rgnExposed, - -pDstDrawable->x, -pDstDrawable->y); - } - if (prgnDstClip == &rgnDstRec) - { - REGION_UNINIT(pscr, prgnDstClip); - } - else if (prgnDstClip != prgnSrcClip) - { - REGION_DESTROY(pscr, prgnDstClip); - } - - if (prgnSrcClip == &rgnSrcRec) - { - REGION_UNINIT(pscr, prgnSrcClip); - } - else - { - REGION_DESTROY(pscr, prgnSrcClip); - } - - if (pGC->graphicsExposures) - { - /* don't look */ - RegionPtr exposed = REGION_CREATE(pscr, NullBox, 0); - *exposed = rgnExposed; - return exposed; - } - else - { - REGION_UNINIT(pscr, &rgnExposed); - return NULL; - } -} - -/* send GraphicsExpose events, or a NoExpose event, based on the region */ - -void -miSendGraphicsExpose (client, pRgn, drawable, major, minor) - ClientPtr client; - RegionPtr pRgn; - XID drawable; - int major; - int minor; -{ - if (pRgn && !REGION_NIL(pRgn)) - { - xEvent *pEvent; - register xEvent *pe; - register BoxPtr pBox; - register int i; - int numRects; - - numRects = REGION_NUM_RECTS(pRgn); - pBox = REGION_RECTS(pRgn); - if(!(pEvent = (xEvent *)ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) - return; - pe = pEvent; - - for (i=1; i<=numRects; i++, pe++, pBox++) - { - pe->u.u.type = GraphicsExpose; - pe->u.graphicsExposure.drawable = drawable; - pe->u.graphicsExposure.x = pBox->x1; - pe->u.graphicsExposure.y = pBox->y1; - pe->u.graphicsExposure.width = pBox->x2 - pBox->x1; - pe->u.graphicsExposure.height = pBox->y2 - pBox->y1; - pe->u.graphicsExposure.count = numRects - i; - pe->u.graphicsExposure.majorEvent = major; - pe->u.graphicsExposure.minorEvent = minor; - } - TryClientEvents(client, pEvent, numRects, - (Mask)0, NoEventMask, NullGrab); - DEALLOCATE_LOCAL(pEvent); - } - else - { - xEvent event; - event.u.u.type = NoExpose; - event.u.noExposure.drawable = drawable; - event.u.noExposure.majorEvent = major; - event.u.noExposure.minorEvent = minor; - TryClientEvents(client, &event, 1, - (Mask)0, NoEventMask, NullGrab); - } -} - - -void -miSendExposures(pWin, pRgn, dx, dy) - WindowPtr pWin; - RegionPtr pRgn; - register int dx, dy; -{ - register BoxPtr pBox; - int numRects; - register xEvent *pEvent, *pe; - register int i; - - pBox = REGION_RECTS(pRgn); - numRects = REGION_NUM_RECTS(pRgn); - if(!(pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) - return; - - for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++) - { - pe->u.u.type = Expose; - pe->u.expose.window = pWin->drawable.id; - pe->u.expose.x = pBox->x1 - dx; - pe->u.expose.y = pBox->y1 - dy; - pe->u.expose.width = pBox->x2 - pBox->x1; - pe->u.expose.height = pBox->y2 - pBox->y1; - pe->u.expose.count = i; - } - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int scrnum = pWin->drawable.pScreen->myNum; - int x = 0, y = 0; - XID realWin = 0; - - if(!pWin->parent) { - x = panoramiXdataPtr[scrnum].x; - y = panoramiXdataPtr[scrnum].y; - pWin = WindowTable[0]; - realWin = pWin->drawable.id; - } else if (scrnum) { - PanoramiXRes *win; - win = PanoramiXFindIDByScrnum(XRT_WINDOW, - pWin->drawable.id, scrnum); - if(!win) { - DEALLOCATE_LOCAL(pEvent); - return; - } - realWin = win->info[0].id; - pWin = LookupIDByType(realWin, RT_WINDOW); - } - if(x || y || scrnum) - for (i = 0; i < numRects; i++) { - pEvent[i].u.expose.window = realWin; - pEvent[i].u.expose.x += x; - pEvent[i].u.expose.y += y; - } - } -#endif - - DeliverEvents(pWin, pEvent, numRects, NullWindow); - - DEALLOCATE_LOCAL(pEvent); -} - -void -miWindowExposures(pWin, prgn, other_exposed) - WindowPtr pWin; - register RegionPtr prgn, other_exposed; -{ - RegionPtr exposures = prgn; - if (pWin->backStorage && prgn) - /* - * in some cases, backing store will cause a different - * region to be exposed than needs to be repainted - * (like when a window is mapped). RestoreAreas is - * allowed to return a region other than prgn, - * in which case this routine will free the resultant - * region. If exposures is null, then no events will - * be sent to the client; if prgn is empty - * no areas will be repainted. - */ - exposures = (*pWin->drawable.pScreen->RestoreAreas)(pWin, prgn); - if ((prgn && !REGION_NIL(prgn)) || - (exposures && !REGION_NIL(exposures)) || other_exposed) - { - RegionRec expRec; - int clientInterested; - - /* - * Restore from backing-store FIRST. - */ - clientInterested = (pWin->eventMask|wOtherEventMasks(pWin)) & ExposureMask; - if (other_exposed) - { - if (exposures) - { - REGION_UNION(pWin->drawable.pScreen, other_exposed, - exposures, - other_exposed); - if (exposures != prgn) - REGION_DESTROY(pWin->drawable.pScreen, exposures); - } - exposures = other_exposed; - } - if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT)) - { - /* - * If we have LOTS of rectangles, we decide to take the extents - * and force an exposure on that. This should require much less - * work overall, on both client and server. This is cheating, but - * isn't prohibited by the protocol ("spontaneous combustion" :-). - */ - BoxRec box; - - box = *REGION_EXTENTS( pWin->drawable.pScreen, exposures); - if (exposures == prgn) { - exposures = &expRec; - REGION_INIT( pWin->drawable.pScreen, exposures, &box, 1); - REGION_RESET( pWin->drawable.pScreen, prgn, &box); - } else { - REGION_RESET( pWin->drawable.pScreen, exposures, &box); - REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures); - } - /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList); - /* need to clear out new areas of backing store, too */ - if (pWin->backStorage) - (void) (* pWin->drawable.pScreen->ClearBackingStore)( - pWin, - box.x1 - pWin->drawable.x, - box.y1 - pWin->drawable.y, - box.x2 - box.x1, - box.y2 - box.y1, - FALSE); - } - if (prgn && !REGION_NIL(prgn)) - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !REGION_NIL(exposures)) - miSendExposures(pWin, exposures, - pWin->drawable.x, pWin->drawable.y); - if (exposures == &expRec) - { - REGION_UNINIT( pWin->drawable.pScreen, exposures); - } - else if (exposures && exposures != prgn && exposures != other_exposed) - REGION_DESTROY( pWin->drawable.pScreen, exposures); - if (prgn) - REGION_EMPTY( pWin->drawable.pScreen, prgn); - } - else if (exposures && exposures != prgn) - REGION_DESTROY( pWin->drawable.pScreen, exposures); -} - - -/* - this code is highly unlikely. it is not haile selassie. - - there is some hair here. we can't just use the window's -clip region as it is, because if we are painting the border, -the border is not in the client area and so we will be excluded -when we validate the GC, and if we are painting a parent-relative -background, the area we want to paint is in some other window. -since we trust the code calling us to tell us to paint only areas -that are really ours, we will temporarily give the window a -clipList the size of the whole screen and an origin at (0,0). -this more or less assumes that ddX code will do translation -based on the window's absolute position, and that ValidateGC will -look at clipList, and that no other fields from the -window will be used. it's not possible to just draw -in the root because it may be a different depth. - -to get the tile to align correctly we set the GC's tile origin to -be the (x,y) of the window's upper left corner, after which we -get the right bits when drawing into the root. - -because the clip_mask is being set to None, we may call DoChangeGC with -fPointer set true, thus we no longer need to install the background or -border tile in the resource table. -*/ - -static RESTYPE ResType = 0; -static int numGCs = 0; -static GCPtr screenContext[MAXSCREENS]; - -/*ARGSUSED*/ -static int -tossGC ( - pointer value, - XID id) -{ - GCPtr pGC = (GCPtr)value; - screenContext[pGC->pScreen->myNum] = (GCPtr)NULL; - FreeGC (pGC, id); - numGCs--; - if (!numGCs) - ResType = 0; - - return 0; -} - - -void -miPaintWindow(pWin, prgn, what) -register WindowPtr pWin; -RegionPtr prgn; -int what; -{ - int status; - - Bool usingScratchGC = FALSE; - WindowPtr pRoot; - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - ChangeGCVal gcval[7]; - ChangeGCVal newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - - gcmask = 0; - - if (what == PW_BACKGROUND) - { - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground)(pWin->parent, prgn, what); - return; - case BackgroundPixel: - newValues[FOREGROUND].val = pWin->background.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE].ptr = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - break; - } - } - else - { - if (pWin->borderIsPixel) - { - newValues[FOREGROUND].val = pWin->border.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE].ptr = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * - sizeof(xRectangle)); - if (!prect) - return; - - newValues[FUNCTION].val = GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - pRoot = WindowTable[i]; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - } - - if ((pWin->drawable.depth != pRoot->drawable.depth) || - (pWin->drawable.bitsPerPixel != pRoot->drawable.bitsPerPixel)) - { - usingScratchGC = TRUE; - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if (!pGC) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if (what == PW_BORDER) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - } - else - { - newValues[ABSX].val = 0; - newValues[ABSY].val = 0; - } - } else { - /* - * draw the background to the root window - */ - if (screenContext[i] == (GCPtr)NULL) - { - if (!ResType && !(ResType = CreateNewResourceType(tossGC))) - return; - screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0, - (XID *)NULL, &status); - if (!screenContext[i]) - return; - numGCs++; - if (!AddResource(FakeClientID(0), ResType, - (pointer)screenContext[i])) - return; - } - pGC = screenContext[i]; - newValues[SUBWINDOW].val = IncludeInferiors; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - gcmask |= GCSubwindowMode; - pWin = pRoot; - } - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack); - - mask = gcmask; - gcmask = 0; - i = 0; - while (mask) { - index = lowbit (mask); - mask &= ~index; - switch (index) { - case GCFunction: - if (pGC->alu != newValues[FUNCTION].val) { - gcmask |= index; - gcval[i++].val = newValues[FUNCTION].val; - } - break; - case GCTileStipXOrigin: - if ( pGC->patOrg.x != newValues[ABSX].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSX].val; - } - break; - case GCTileStipYOrigin: - if ( pGC->patOrg.y != newValues[ABSY].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSY].val; - } - break; - case GCClipMask: - if ( pGC->clientClipType != CT_NONE) { - gcmask |= index; - gcval[i++].val = CT_NONE; - } - break; - case GCSubwindowMode: - if ( pGC->subWindowMode != newValues[SUBWINDOW].val) { - gcmask |= index; - gcval[i++].val = newValues[SUBWINDOW].val; - } - break; - case GCTile: - if (pGC->tileIsPixel || pGC->tile.pixmap != newValues[TILE].ptr) - { - gcmask |= index; - gcval[i++].ptr = newValues[TILE].ptr; - } - break; - case GCFillStyle: - if ( pGC->fillStyle != newValues[FILLSTYLE].val) { - gcmask |= index; - gcval[i++].val = newValues[FILLSTYLE].val; - } - break; - case GCForeground: - if ( pGC->fgPixel != newValues[FOREGROUND].val) { - gcmask |= index; - gcval[i++].val = newValues[FOREGROUND].val; - } - break; - } - } - - if (gcmask) - dixChangeGC(NullClient, pGC, gcmask, NULL, gcval); - - if (pWin->drawable.serialNumber != pGC->serialNumber) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(prgn); - pbox = REGION_RECTS(prgn); - for (i= numRects; --i >= 0; pbox++, prect++) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing); - - if (usingScratchGC) - { - if (what == PW_BORDER) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); - } -} - - -/* MICLEARDRAWABLE -- sets the entire drawable to the background color of - * the GC. Useful when we have a scratch drawable and need to initialize - * it. */ -void -miClearDrawable(pDraw, pGC) - DrawablePtr pDraw; - GCPtr pGC; -{ - XID fg = pGC->fgPixel; - XID bg = pGC->bgPixel; - xRectangle rect; - - rect.x = 0; - rect.y = 0; - rect.width = pDraw->width; - rect.height = pDraw->height; - DoChangeGC(pGC, GCForeground, &bg, 0); - ValidateGC(pDraw, pGC); - (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect); - DoChangeGC(pGC, GCForeground, &fg, 0); - ValidateGC(pDraw, pGC); -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original deleted file mode 100644 index 09901ba9c..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original +++ /dev/null @@ -1,322 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXmiglyph.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/miglyph.c,v 1.6 2000/12/05 03:13:31 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "mi.h" -#include "picturestr.h" -#include "mipict.h" - -#ifdef NXAGENT_SERVER - -#include "Render.h" - -#endif - -void -miGlyphExtents (int nlist, - GlyphListPtr list, - GlyphPtr *glyphs, - BoxPtr extents) -{ - int x1, x2, y1, y2; - int n; - GlyphPtr glyph; - int x, y; - - x = 0; - y = 0; - extents->x1 = MAXSHORT; - extents->x2 = MINSHORT; - extents->y1 = MAXSHORT; - extents->y2 = MINSHORT; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - list++; - while (n--) - { - glyph = *glyphs++; - x1 = x - glyph->info.x; - if (x1 < MINSHORT) - x1 = MINSHORT; - y1 = y - glyph->info.y; - if (y1 < MINSHORT) - y1 = MINSHORT; - x2 = x1 + glyph->info.width; - if (x2 > MAXSHORT) - x2 = MAXSHORT; - y2 = y1 + glyph->info.height; - if (y2 > MAXSHORT) - y2 = MAXSHORT; - if (x1 < extents->x1) - extents->x1 = x1; - if (x2 > extents->x2) - extents->x2 = x2; - if (y1 < extents->y1) - extents->y1 = y1; - if (y2 > extents->y2) - extents->y2 = y2; - x += glyph->info.xOff; - y += glyph->info.yOff; - } - } -} - -#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) - -void -miGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) -{ - PixmapPtr pPixmap = 0; - PicturePtr pPicture; - PixmapPtr pMaskPixmap = 0; - PicturePtr pMask; - ScreenPtr pScreen = pDst->pDrawable->pScreen; - int width = 0, height = 0; - int x, y; - int xDst = list->xOff, yDst = list->yOff; - int n; - GlyphPtr glyph; - int error; - BoxRec extents; - CARD32 component_alpha; - - #ifdef NXAGENT_SERVER - - /* - * Get rid of the warning. - */ - - extents.x1 = 0; - extents.y1 = 0; - - #endif - - if (maskFormat) - { - GCPtr pGC; - xRectangle rect; - - #ifdef NXAGENT_SERVER - - if (nxagentGlyphsExtents != NullBox) - { - memcpy(&extents, nxagentGlyphsExtents, sizeof(BoxRec)); - } - else - { - nxagentGlyphsExtents = (BoxPtr) xalloc(sizeof(BoxRec)); - - miGlyphExtents (nlist, list, glyphs, &extents); - - memcpy(nxagentGlyphsExtents, &extents, sizeof(BoxRec)); - } - - #else - - miGlyphExtents (nlist, list, glyphs, &extents); - - #endif - - if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) - return; - width = extents.x2 - extents.x1; - height = extents.y2 - extents.y1; - pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, maskFormat->depth); - - if (!pMaskPixmap) - return; - - component_alpha = NeedsComponent(maskFormat->format); - pMask = CreatePicture (0, &pMaskPixmap->drawable, - maskFormat, CPComponentAlpha, &component_alpha, - serverClient, &error); - - if (!pMask) - { - (*pScreen->DestroyPixmap) (pMaskPixmap); - return; - } - pGC = GetScratchGC (pMaskPixmap->drawable.depth, pScreen); - ValidateGC (&pMaskPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - x = -extents.x1; - y = -extents.y1; - } - else - { - pMask = pDst; - x = 0; - y = 0; - } - pPicture = 0; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - - while (n--) - { - glyph = *glyphs++; - if (!pPicture) - { - pPixmap = GetScratchPixmapHeader (pScreen, glyph->info.width, glyph->info.height, - list->format->depth, - list->format->depth, - 0, (pointer) (glyph + 1)); - if (!pPixmap) - return; - component_alpha = NeedsComponent(list->format->format); - pPicture = CreatePicture (0, &pPixmap->drawable, list->format, - CPComponentAlpha, &component_alpha, - serverClient, &error); - if (!pPicture) - { - FreeScratchPixmapHeader (pPixmap); - return; - } - } - (*pScreen->ModifyPixmapHeader) (pPixmap, - glyph->info.width, glyph->info.height, - 0, 0, -1, (pointer) (glyph + 1)); - - #ifdef NXAGENT_SERVER - - /* - * The following line fixes a problem with glyphs that appeared - * as clipped. It was a side effect due the validate function - * "ValidatePicture" that makes a check on the Drawable serial - * number instead of the picture serial number, failing thus - * the clip mask update. - */ - - pPicture->pDrawable->serialNumber = NEXT_SERIAL_NUMBER; - - #endif - - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - if (maskFormat) - { - CompositePicture (PictOpAdd, - pPicture, - None, - pMask, - 0, 0, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - else - { - CompositePicture (op, - pSrc, - pPicture, - pDst, - xSrc + (x - glyph->info.x) - xDst, - ySrc + (y - glyph->info.y) - yDst, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - x += glyph->info.xOff; - y += glyph->info.yOff; - } - - list++; - if (pPicture) - { - FreeScratchPixmapHeader (pPixmap); - FreePicture ((pointer) pPicture, 0); - pPicture = 0; - pPixmap = 0; - } - } - if (maskFormat) - { - x = extents.x1; - y = extents.y1; - CompositePicture (op, - pSrc, - pMask, - pDst, - xSrc + x - xDst, - ySrc + y - yDst, - 0, 0, - x, y, - width, height); - - FreePicture ((pointer) pMask, (XID) 0); - (*pScreen->DestroyPixmap) (pMaskPixmap); - } - -} - -#endif /* NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.XF86.original deleted file mode 100644 index 00b6764d6..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.XF86.original +++ /dev/null @@ -1,239 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/miglyph.c,v 1.6 2000/12/05 03:13:31 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "mi.h" -#include "picturestr.h" -#include "mipict.h" - -void -miGlyphExtents (int nlist, - GlyphListPtr list, - GlyphPtr *glyphs, - BoxPtr extents) -{ - int x1, x2, y1, y2; - int n; - GlyphPtr glyph; - int x, y; - - x = 0; - y = 0; - extents->x1 = MAXSHORT; - extents->x2 = MINSHORT; - extents->y1 = MAXSHORT; - extents->y2 = MINSHORT; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - list++; - while (n--) - { - glyph = *glyphs++; - x1 = x - glyph->info.x; - if (x1 < MINSHORT) - x1 = MINSHORT; - y1 = y - glyph->info.y; - if (y1 < MINSHORT) - y1 = MINSHORT; - x2 = x1 + glyph->info.width; - if (x2 > MAXSHORT) - x2 = MAXSHORT; - y2 = y1 + glyph->info.height; - if (y2 > MAXSHORT) - y2 = MAXSHORT; - if (x1 < extents->x1) - extents->x1 = x1; - if (x2 > extents->x2) - extents->x2 = x2; - if (y1 < extents->y1) - extents->y1 = y1; - if (y2 > extents->y2) - extents->y2 = y2; - x += glyph->info.xOff; - y += glyph->info.yOff; - } - } -} - -#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) - -void -miGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) -{ - PixmapPtr pPixmap = 0; - PicturePtr pPicture; - PixmapPtr pMaskPixmap = 0; - PicturePtr pMask; - ScreenPtr pScreen = pDst->pDrawable->pScreen; - int width = 0, height = 0; - int x, y; - int xDst = list->xOff, yDst = list->yOff; - int n; - GlyphPtr glyph; - int error; - BoxRec extents; - CARD32 component_alpha; - - if (maskFormat) - { - GCPtr pGC; - xRectangle rect; - - miGlyphExtents (nlist, list, glyphs, &extents); - - if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) - return; - width = extents.x2 - extents.x1; - height = extents.y2 - extents.y1; - pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, maskFormat->depth); - if (!pMaskPixmap) - return; - component_alpha = NeedsComponent(maskFormat->format); - pMask = CreatePicture (0, &pMaskPixmap->drawable, - maskFormat, CPComponentAlpha, &component_alpha, - serverClient, &error); - if (!pMask) - { - (*pScreen->DestroyPixmap) (pMaskPixmap); - return; - } - pGC = GetScratchGC (pMaskPixmap->drawable.depth, pScreen); - ValidateGC (&pMaskPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - x = -extents.x1; - y = -extents.y1; - } - else - { - pMask = pDst; - x = 0; - y = 0; - } - pPicture = 0; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - while (n--) - { - glyph = *glyphs++; - if (!pPicture) - { - pPixmap = GetScratchPixmapHeader (pScreen, glyph->info.width, glyph->info.height, - list->format->depth, - list->format->depth, - 0, (pointer) (glyph + 1)); - if (!pPixmap) - return; - component_alpha = NeedsComponent(list->format->format); - pPicture = CreatePicture (0, &pPixmap->drawable, list->format, - CPComponentAlpha, &component_alpha, - serverClient, &error); - if (!pPicture) - { - FreeScratchPixmapHeader (pPixmap); - return; - } - } - (*pScreen->ModifyPixmapHeader) (pPixmap, - glyph->info.width, glyph->info.height, - 0, 0, -1, (pointer) (glyph + 1)); - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - if (maskFormat) - { - CompositePicture (PictOpAdd, - pPicture, - None, - pMask, - 0, 0, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - else - { - CompositePicture (op, - pSrc, - pPicture, - pDst, - xSrc + (x - glyph->info.x) - xDst, - ySrc + (y - glyph->info.y) - yDst, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - x += glyph->info.xOff; - y += glyph->info.yOff; - } - list++; - if (pPicture) - { - FreeScratchPixmapHeader (pPixmap); - FreePicture ((pointer) pPicture, 0); - pPicture = 0; - pPixmap = 0; - } - } - if (maskFormat) - { - x = extents.x1; - y = extents.y1; - CompositePicture (op, - pSrc, - pMask, - pDst, - xSrc + x - xDst, - ySrc + y - yDst, - 0, 0, - x, y, - width, height); - FreePicture ((pointer) pMask, (XID) 0); - (*pScreen->DestroyPixmap) (pMaskPixmap); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c.NX.original deleted file mode 100644 index 7d0a99572..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c.NX.original +++ /dev/null @@ -1,204 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXmitrap.c" - -#else - -/* - * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.9 2002/11/05 23:39:16 keithp Exp $ - * - * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "servermd.h" -#include "mi.h" -#include "picturestr.h" -#include "mipict.h" - -PicturePtr -miCreateAlphaPicture (ScreenPtr pScreen, - PicturePtr pDst, - PictFormatPtr pPictFormat, - CARD16 width, - CARD16 height) -{ - PixmapPtr pPixmap; - PicturePtr pPicture; - GCPtr pGC; - int error; - xRectangle rect; - - if (width > 32767 || height > 32767) - return 0; - - if (!pPictFormat) - { - if (pDst->polyEdge == PolyEdgeSharp) - pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - if (!pPictFormat) - return 0; - } - - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pPictFormat->depth); - if (!pPixmap) - return 0; - pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); - if (!pGC) - { - (*pScreen->DestroyPixmap) (pPixmap); - return 0; - } - ValidateGC (&pPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat, - 0, 0, serverClient, &error); - (*pScreen->DestroyPixmap) (pPixmap); - return pPicture; -} - -static xFixed -miLineFixedX (xLineFixed *l, xFixed y, Bool ceil) -{ - xFixed dx = l->p2.x - l->p1.x; - xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx; - xFixed dy = l->p2.y - l->p1.y; - if (ceil) - ex += (dy - 1); - return l->p1.x + (xFixed) (ex / dy); -} - -void -miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box) -{ - box->y1 = MAXSHORT; - box->y2 = MINSHORT; - box->x1 = MAXSHORT; - box->x2 = MINSHORT; - for (; ntrap; ntrap--, traps++) - { - INT16 x1, y1, x2, y2; - - if (!xTrapezoidValid(traps)) - continue; - y1 = xFixedToInt (traps->top); - if (y1 < box->y1) - box->y1 = y1; - - y2 = xFixedToInt (xFixedCeil (traps->bottom)); - if (y2 > box->y2) - box->y2 = y2; - - x1 = xFixedToInt (min (miLineFixedX (&traps->left, traps->top, FALSE), - miLineFixedX (&traps->left, traps->bottom, FALSE))); - if (x1 < box->x1) - box->x1 = x1; - - x2 = xFixedToInt (xFixedCeil (max (miLineFixedX (&traps->right, traps->top, TRUE), - miLineFixedX (&traps->right, traps->bottom, TRUE)))); - if (x2 > box->x2) - box->x2 = x2; - } -} - -void -miTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - PicturePtr pPicture = 0; - BoxRec bounds; - INT16 xDst, yDst; - INT16 xRel, yRel; - - xDst = traps[0].left.p1.x >> 16; - yDst = traps[0].left.p1.y >> 16; - - if (maskFormat) - { - miTrapezoidBounds (ntrap, traps, &bounds); - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - return; - pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - if (!pPicture) - return; - } - for (; ntrap; ntrap--, traps++) - { - if (!xTrapezoidValid(traps)) - continue; - if (!maskFormat) - { - miTrapezoidBounds (1, traps, &bounds); - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - continue; - pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - if (!pPicture) - continue; - } - (*ps->RasterizeTrapezoid) (pPicture, traps, - -bounds.x1, -bounds.y1); - if (!maskFormat) - { - xRel = bounds.x1 + xSrc - xDst; - yRel = bounds.y1 + ySrc - yDst; - CompositePicture (op, pSrc, pPicture, pDst, - xRel, yRel, 0, 0, bounds.x1, bounds.y1, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); - } - } - if (maskFormat) - { - xRel = bounds.x1 + xSrc - xDst; - yRel = bounds.y1 + ySrc - yDst; - CompositePicture (op, pSrc, pPicture, pDst, - xRel, yRel, 0, 0, bounds.x1, bounds.y1, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); - } -} - -#endif /* NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c.XF86.original deleted file mode 100644 index 7f592ccd4..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c.XF86.original +++ /dev/null @@ -1,196 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.9 2002/11/05 23:39:16 keithp Exp $ - * - * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "servermd.h" -#include "mi.h" -#include "picturestr.h" -#include "mipict.h" - -PicturePtr -miCreateAlphaPicture (ScreenPtr pScreen, - PicturePtr pDst, - PictFormatPtr pPictFormat, - CARD16 width, - CARD16 height) -{ - PixmapPtr pPixmap; - PicturePtr pPicture; - GCPtr pGC; - int error; - xRectangle rect; - - if (width > 32767 || height > 32767) - return 0; - - if (!pPictFormat) - { - if (pDst->polyEdge == PolyEdgeSharp) - pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - if (!pPictFormat) - return 0; - } - - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pPictFormat->depth); - if (!pPixmap) - return 0; - pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); - if (!pGC) - { - (*pScreen->DestroyPixmap) (pPixmap); - return 0; - } - ValidateGC (&pPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat, - 0, 0, serverClient, &error); - (*pScreen->DestroyPixmap) (pPixmap); - return pPicture; -} - -static xFixed -miLineFixedX (xLineFixed *l, xFixed y, Bool ceil) -{ - xFixed dx = l->p2.x - l->p1.x; - xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx; - xFixed dy = l->p2.y - l->p1.y; - if (ceil) - ex += (dy - 1); - return l->p1.x + (xFixed) (ex / dy); -} - -void -miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box) -{ - box->y1 = MAXSHORT; - box->y2 = MINSHORT; - box->x1 = MAXSHORT; - box->x2 = MINSHORT; - for (; ntrap; ntrap--, traps++) - { - INT16 x1, y1, x2, y2; - - if (!xTrapezoidValid(traps)) - continue; - y1 = xFixedToInt (traps->top); - if (y1 < box->y1) - box->y1 = y1; - - y2 = xFixedToInt (xFixedCeil (traps->bottom)); - if (y2 > box->y2) - box->y2 = y2; - - x1 = xFixedToInt (min (miLineFixedX (&traps->left, traps->top, FALSE), - miLineFixedX (&traps->left, traps->bottom, FALSE))); - if (x1 < box->x1) - box->x1 = x1; - - x2 = xFixedToInt (xFixedCeil (max (miLineFixedX (&traps->right, traps->top, TRUE), - miLineFixedX (&traps->right, traps->bottom, TRUE)))); - if (x2 > box->x2) - box->x2 = x2; - } -} - -void -miTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - PicturePtr pPicture = 0; - BoxRec bounds; - INT16 xDst, yDst; - INT16 xRel, yRel; - - xDst = traps[0].left.p1.x >> 16; - yDst = traps[0].left.p1.y >> 16; - - if (maskFormat) - { - miTrapezoidBounds (ntrap, traps, &bounds); - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - return; - pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - if (!pPicture) - return; - } - for (; ntrap; ntrap--, traps++) - { - if (!xTrapezoidValid(traps)) - continue; - if (!maskFormat) - { - miTrapezoidBounds (1, traps, &bounds); - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - continue; - pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - if (!pPicture) - continue; - } - (*ps->RasterizeTrapezoid) (pPicture, traps, - -bounds.x1, -bounds.y1); - if (!maskFormat) - { - xRel = bounds.x1 + xSrc - xDst; - yRel = bounds.y1 + ySrc - yDst; - CompositePicture (op, pSrc, pPicture, pDst, - xRel, yRel, 0, 0, bounds.x1, bounds.y1, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); - } - } - if (maskFormat) - { - xRel = bounds.x1 + xSrc - xDst; - yRel = bounds.y1 + ySrc - yDst; - CompositePicture (op, pSrc, pPicture, pDst, - xRel, yRel, 0, 0, bounds.x1, bounds.y1, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c.NX.original deleted file mode 100644 index ea2e7df28..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c.NX.original +++ /dev/null @@ -1,1205 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXmiwindow.c" - -#else - -/* $XFree86: xc/programs/Xserver/mi/miwindow.c,v 1.7 2001/12/14 20:00:28 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: miwindow.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ -#include "X.h" -#include "miscstruct.h" -#include "region.h" -#include "mi.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "mivalidate.h" - -void -miClearToBackground(pWin, x, y, w, h, generateExposures) - WindowPtr pWin; - int x,y; - int w,h; - Bool generateExposures; -{ - BoxRec box; - RegionRec reg; - RegionPtr pBSReg = NullRegion; - ScreenPtr pScreen; - BoxPtr extents; - int x1, y1, x2, y2; - - /* compute everything using ints to avoid overflow */ - - x1 = pWin->drawable.x + x; - y1 = pWin->drawable.y + y; - if (w) - x2 = x1 + (int) w; - else - x2 = x1 + (int) pWin->drawable.width - (int) x; - if (h) - y2 = y1 + h; - else - y2 = y1 + (int) pWin->drawable.height - (int) y; - - extents = &pWin->clipList.extents; - - /* clip the resulting rectangle to the window clipList extents. This - * makes sure that the result will fit in a box, given that the - * screen is < 32768 on a side. - */ - - if (x1 < extents->x1) - x1 = extents->x1; - if (x2 > extents->x2) - x2 = extents->x2; - if (y1 < extents->y1) - y1 = extents->y1; - if (y2 > extents->y2) - y2 = extents->y2; - - if (x2 <= x1 || y2 <= y1) - { - x2 = x1 = 0; - y2 = y1 = 0; - } - - box.x1 = x1; - box.x2 = x2; - box.y1 = y1; - box.y2 = y2; - - pScreen = pWin->drawable.pScreen; - REGION_INIT(pScreen, ®, &box, 1); - if (pWin->backStorage) - { - /* - * If the window has backing-store on, call through the - * ClearToBackground vector to handle the special semantics - * (i.e. things backing store is to be cleared out and - * an Expose event is to be generated for those areas in backing - * store if generateExposures is TRUE). - */ - pBSReg = (* pScreen->ClearBackingStore)(pWin, x, y, w, h, - generateExposures); - } - - REGION_INTERSECT(pScreen, ®, ®, &pWin->clipList); - if (generateExposures) - (*pScreen->WindowExposures)(pWin, ®, pBSReg); - else if (pWin->backgroundState != None) - (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); - REGION_UNINIT(pScreen, ®); - if (pBSReg) - REGION_DESTROY(pScreen, pBSReg); -} - -/* - * For SaveUnders using backing-store. The idea is that when a window is mapped - * with saveUnder set TRUE, any windows it obscures will have its backing - * store turned on setting the DIXsaveUnder bit, - * The backing-store code must be written to allow for this - */ - -/*- - *----------------------------------------------------------------------- - * miCheckSubSaveUnder -- - * Check all the inferiors of a window for coverage by saveUnder - * windows. Called from ChangeSaveUnder and CheckSaveUnder. - * This code is very inefficient. - * - * Results: - * TRUE if any windows need to have backing-store removed. - * - * Side Effects: - * Windows may have backing-store turned on or off. - * - *----------------------------------------------------------------------- - */ -static Bool -miCheckSubSaveUnder( - register WindowPtr pParent, /* Parent to check */ - WindowPtr pFirst, /* first reconfigured window */ - RegionPtr pRegion) /* Initial area obscured by saveUnder */ -{ - register WindowPtr pChild; /* Current child */ - register ScreenPtr pScreen; /* Screen to use */ - RegionRec SubRegion; /* Area of children obscured */ - Bool res = FALSE; /* result */ - Bool subInited=FALSE;/* SubRegion initialized */ - - pScreen = pParent->drawable.pScreen; - if ( (pChild = pParent->firstChild) ) - { - /* - * build region above first changed window - */ - - for (; pChild != pFirst; pChild = pChild->nextSib) - if (pChild->viewable && pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); - - /* - * check region below and including first changed window - */ - - for (; pChild; pChild = pChild->nextSib) - { - if (pChild->viewable) - { - /* - * don't save under nephew/niece windows; - * use a separate region - */ - - if (pChild->firstChild) - { - if (!subInited) - { - REGION_INIT(pScreen, &SubRegion, NullBox, 0); - subInited = TRUE; - } - REGION_COPY(pScreen, &SubRegion, pRegion); - res |= miCheckSubSaveUnder(pChild, pChild->firstChild, - &SubRegion); - } - else - { - res |= miCheckSubSaveUnder(pChild, pChild->firstChild, - pRegion); - } - - if (pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); - } - } - - if (subInited) - REGION_UNINIT(pScreen, &SubRegion); - } - - /* - * Check the state of this window. DIX save unders are - * enabled for viewable windows with some client expressing - * exposure interest and which intersect the save under region - */ - - if (pParent->viewable && - ((pParent->eventMask | wOtherEventMasks(pParent)) & ExposureMask) && - REGION_NOTEMPTY(pScreen, &pParent->borderSize) && - RECT_IN_REGION(pScreen, pRegion, REGION_EXTENTS(pScreen, - &pParent->borderSize)) != rgnOUT) - { - if (!pParent->DIXsaveUnder) - { - pParent->DIXsaveUnder = TRUE; - (*pScreen->ChangeWindowAttributes) (pParent, CWBackingStore); - } - } - else - { - if (pParent->DIXsaveUnder) - { - res = TRUE; - pParent->DIXsaveUnder = FALSE; - } - } - return res; -} - - -/*- - *----------------------------------------------------------------------- - * miChangeSaveUnder -- - * Change the save-under state of a tree of windows. Called when - * a window with saveUnder TRUE is mapped/unmapped/reconfigured. - * - * Results: - * TRUE if any windows need to have backing-store removed (which - * means that PostChangeSaveUnder needs to be called later to - * finish the job). - * - * Side Effects: - * Windows may have backing-store turned on or off. - * - *----------------------------------------------------------------------- - */ -Bool -miChangeSaveUnder(pWin, first) - register WindowPtr pWin; - WindowPtr first; /* First window to check. - * Used when pWin was restacked */ -{ - RegionRec rgn; /* Area obscured by saveUnder windows */ - register ScreenPtr pScreen; - Bool res; - - if (!deltaSaveUndersViewable && !numSaveUndersViewable) - return FALSE; - numSaveUndersViewable += deltaSaveUndersViewable; - deltaSaveUndersViewable = 0; - pScreen = pWin->drawable.pScreen; - REGION_INIT(pScreen, &rgn, NullBox, 1); - res = miCheckSubSaveUnder (pWin->parent, - pWin->saveUnder ? first : pWin->nextSib, - &rgn); - REGION_UNINIT(pScreen, &rgn); - return res; -} - -/*- - *----------------------------------------------------------------------- - * miPostChangeSaveUnder -- - * Actually turn backing-store off for those windows that no longer - * need to have it on. - * - * Results: - * None. - * - * Side Effects: - * Backing-store and SAVE_UNDER_CHANGE_BIT are turned off for those - * windows affected. - * - *----------------------------------------------------------------------- - */ -void -miPostChangeSaveUnder(pWin, pFirst) - WindowPtr pWin; - WindowPtr pFirst; -{ - register WindowPtr pParent, pChild; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - - if (!(pParent = pWin->parent)) - return; - ChangeWindowAttributes = pParent->drawable.pScreen->ChangeWindowAttributes; - if (!pParent->DIXsaveUnder && - (pParent->backingStore == NotUseful) && pParent->backStorage) - (*ChangeWindowAttributes)(pParent, CWBackingStore); - if (!(pChild = pFirst)) - return; - while (1) - { - if (!pChild->DIXsaveUnder && - (pChild->backingStore == NotUseful) && pChild->backStorage) - (*ChangeWindowAttributes)(pChild, CWBackingStore); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib) - { - pChild = pChild->parent; - if (pChild == pParent) - return; - } - pChild = pChild->nextSib; - } -} - -void -miMarkWindow(pWin) - register WindowPtr pWin; -{ - register ValidatePtr val; - - if (pWin->valdata) - return; - val = (ValidatePtr)xnfalloc(sizeof(ValidateRec)); - val->before.oldAbsCorner.x = pWin->drawable.x; - val->before.oldAbsCorner.y = pWin->drawable.y; - val->before.borderVisible = NullRegion; - val->before.resized = FALSE; - pWin->valdata = val; -} - -Bool -miMarkOverlappedWindows(pWin, pFirst, ppLayerWin) - WindowPtr pWin; - WindowPtr pFirst; - WindowPtr *ppLayerWin; -{ - register BoxPtr box; - register WindowPtr pChild, pLast; - Bool anyMarked = FALSE; - MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow; - ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; - - /* single layered systems are easy */ - if (ppLayerWin) *ppLayerWin = pWin; - - if (pWin == pFirst) - { - /* Blindly mark pWin and all of its inferiors. This is a slight - * overkill if there are mapped windows that outside pWin's border, - * but it's better than wasting time on RectIn checks. - */ - pChild = pWin; - while (1) - { - if (pChild->viewable) - { - if (REGION_BROKEN (pScreen, &pChild->winSize)) - SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) - SetBorderSize (pChild); - (* MarkWindow)(pChild); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } - anyMarked = TRUE; - pFirst = pFirst->nextSib; - } - if ( (pChild = pFirst) ) - { - box = REGION_EXTENTS(pChild->drawable.pScreen, &pWin->borderSize); - pLast = pChild->parent->lastChild; - while (1) - { - if (pChild->viewable) - { - if (REGION_BROKEN (pScreen, &pChild->winSize)) - SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) - SetBorderSize (pChild); - if (RECT_IN_REGION(pScreen, &pChild->borderSize, box)) - { - (* MarkWindow)(pChild); - anyMarked = TRUE; - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - } - while (!pChild->nextSib && (pChild != pLast)) - pChild = pChild->parent; - if (pChild == pLast) - break; - pChild = pChild->nextSib; - } - } - if (anyMarked) - (* MarkWindow)(pWin->parent); - return anyMarked; -} - -/***** - * miHandleValidateExposures(pWin) - * starting at pWin, draw background in any windows that have exposure - * regions, translate the regions, restore any backing store, - * and then send any regions still exposed to the client - *****/ -void -miHandleValidateExposures(pWin) - WindowPtr pWin; -{ - register WindowPtr pChild; - register ValidatePtr val; - ScreenPtr pScreen; - WindowExposuresProcPtr WindowExposures; - - pScreen = pWin->drawable.pScreen; - - pChild = pWin; - WindowExposures = pChild->drawable.pScreen->WindowExposures; - while (1) - { - if ( (val = pChild->valdata) ) - { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) - (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, - &val->after.borderExposed, - PW_BORDER); - REGION_UNINIT(pScreen, &val->after.borderExposed); - (*WindowExposures)(pChild, &val->after.exposed, NullRegion); - REGION_UNINIT(pScreen, &val->after.exposed); - xfree(val); - pChild->valdata = (ValidatePtr)NULL; - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } -} - -void -miMoveWindow(pWin, x, y, pNextSib, kind) - register WindowPtr pWin; - int x,y; - WindowPtr pNextSib; - VTKind kind; -{ - WindowPtr pParent; - Bool WasViewable = (Bool)(pWin->viewable); - short bw; - RegionPtr oldRegion = NULL; - DDXPointRec oldpt; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - WindowPtr windowToValidate; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - /* if this is a root window, can't be moved */ - if (!(pParent = pWin->parent)) - return ; - pScreen = pWin->drawable.pScreen; - bw = wBorderWidth (pWin); - - oldpt.x = pWin->drawable.x; - oldpt.y = pWin->drawable.y; - if (WasViewable) - { - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->borderClip); - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); - } - pWin->origin.x = x + (int)bw; - pWin->origin.y = y + (int)bw; - x = pWin->drawable.x = pParent->drawable.x + x + (int)bw; - y = pWin->drawable.y = pParent->drawable.y + y + (int)bw; - - SetWinSize (pWin); - SetBorderSize (pWin); - - (*pScreen->PositionWindow)(pWin, x, y); - - windowToValidate = MoveWindowInStack(pWin, pNextSib); - - ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0); - - if (WasViewable) - { - if (pLayerWin == pWin) - anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, windowToValidate, (WindowPtr *)NULL); - else - anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, pLayerWin, (WindowPtr *)NULL); - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, windowToValidate); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, kind); - (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, oldRegion); - REGION_DESTROY(pScreen, oldRegion); - /* XXX need to retile border if ParentRelative origin */ - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, windowToValidate); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, kind); - } - if (pWin->realized) - WindowsRestructured (); -} - - -/* - * pValid is a region of the screen which has been - * successfully copied -- recomputed exposed regions for affected windows - */ - -static int -miRecomputeExposures ( - register WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ -{ - register ScreenPtr pScreen; - RegionPtr pValid = (RegionPtr)value; - - if (pWin->valdata) - { - pScreen = pWin->drawable.pScreen; - /* - * compute exposed regions of this window - */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, - &pWin->clipList, pValid); - /* - * compute exposed regions of the border - */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, - &pWin->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, - &pWin->valdata->after.borderExposed, pValid); - return WT_WALKCHILDREN; - } - return WT_NOMATCH; -} - -void -miSlideAndSizeWindow(pWin, x, y, w, h, pSib) - register WindowPtr pWin; - int x,y; - unsigned int w, h; - WindowPtr pSib; -{ - WindowPtr pParent; - Bool WasViewable = (Bool)(pWin->viewable); - unsigned short width = pWin->drawable.width, - height = pWin->drawable.height; - short oldx = pWin->drawable.x, - oldy = pWin->drawable.y; - int bw = wBorderWidth (pWin); - short dw, dh; - DDXPointRec oldpt; - RegionPtr oldRegion = NULL; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - WindowPtr pFirstChange; - register WindowPtr pChild; - RegionPtr gravitate[StaticGravity + 1]; - register unsigned g; - int nx, ny; /* destination x,y */ - int newx, newy; /* new inner window position */ - RegionPtr pRegion = NULL; - RegionPtr destClip; /* portions of destination already written */ - RegionPtr oldWinClip = NULL; /* old clip list for window */ - RegionPtr borderVisible = NullRegion; /* visible area of the border */ - RegionPtr bsExposed = NullRegion; /* backing store exposures */ - Bool shrunk = FALSE; /* shrunk in an inner dimension */ - Bool moved = FALSE; /* window position changed */ -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - /* if this is a root window, can't be resized */ - if (!(pParent = pWin->parent)) - return ; - - pScreen = pWin->drawable.pScreen; - newx = pParent->drawable.x + x + bw; - newy = pParent->drawable.y + y + bw; - if (WasViewable) - { - anyMarked = FALSE; - /* - * save the visible region of the window - */ - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->winSize); - - /* - * categorize child windows into regions to be moved - */ - for (g = 0; g <= StaticGravity; g++) - gravitate[g] = (RegionPtr) NULL; - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - g = pChild->winGravity; - if (g != UnmapGravity) - { - if (!gravitate[g]) - gravitate[g] = REGION_CREATE(pScreen, NullBox, 1); - REGION_UNION(pScreen, gravitate[g], - gravitate[g], &pChild->borderClip); - } - else - { - UnmapWindow(pChild, TRUE); - anyMarked = TRUE; - } - } - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - - oldWinClip = NULL; - if (pWin->bitGravity != ForgetGravity) - { - oldWinClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip, &pWin->clipList); - } - /* - * if the window is changing size, borderExposed - * can't be computed correctly without some help. - */ - if (pWin->drawable.height > h || pWin->drawable.width > w) - shrunk = TRUE; - - if (newx != oldx || newy != oldy) - moved = TRUE; - - if ((pWin->drawable.height != h || pWin->drawable.width != w) && - HasBorder (pWin)) - { - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - /* for tiled borders, we punt and draw the whole thing */ - if (pWin->borderIsPixel || !moved) - { - if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, - &pWin->winSize); - else - REGION_COPY(pScreen, borderVisible, - &pWin->borderClip); - } - } - } - pWin->origin.x = x + bw; - pWin->origin.y = y + bw; - pWin->drawable.height = h; - pWin->drawable.width = w; - - x = pWin->drawable.x = newx; - y = pWin->drawable.y = newy; - - SetWinSize (pWin); - SetBorderSize (pWin); - - dw = (int)w - (int)width; - dh = (int)h - (int)height; - ResizeChildrenWinSize(pWin, x - oldx, y - oldy, dw, dh); - - /* let the hardware adjust background and border pixmaps, if any */ - (*pScreen->PositionWindow)(pWin, x, y); - - pFirstChange = MoveWindowInStack(pWin, pSib); - - if (WasViewable) - { - pRegion = REGION_CREATE(pScreen, NullBox, 1); - if (pWin->backStorage) - REGION_COPY(pScreen, pRegion, &pWin->clipList); - - if (pLayerWin == pWin) - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, - (WindowPtr *)NULL); - else - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin, - (WindowPtr *)NULL); - - if (pWin->valdata) - { - pWin->valdata->before.resized = TRUE; - pWin->valdata->before.borderVisible = borderVisible; - } - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, VTOther); - /* - * the entire window is trashed unless bitGravity - * recovers portions of it - */ - REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList); - } - - GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pRegion = &pWin->clipList; /* a convenient empty region */ - if (pWin->bitGravity == ForgetGravity) - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, NullRegion, oldx, oldy); - else - { - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, nx - x, ny - y, pRegion, oldx, oldy); - } - } - - if (WasViewable) - { - /* avoid the border */ - if (HasBorder (pWin)) - { - int offx, offy, dx, dy; - - /* kruft to avoid double translates for each gravity */ - offx = 0; - offy = 0; - for (g = 0; g <= StaticGravity; g++) - { - if (!gravitate[g]) - continue; - - /* align winSize to gravitate[g]. - * winSize is in new coordinates, - * gravitate[g] is still in old coordinates */ - GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny); - - dx = (oldx - nx) - offx; - dy = (oldy - ny) - offy; - if (dx || dy) - { - REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy); - offx += dx; - offy += dy; - } - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], - &pWin->winSize); - } - /* get winSize back where it belongs */ - if (offx || offy) - REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy); - } - /* - * add screen bits to the appropriate bucket - */ - - if (oldWinClip) - { - /* - * clip to new clipList - */ - REGION_COPY(pScreen, pRegion, oldWinClip); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList); - /* - * don't step on any gravity bits which will be copied after this - * region. Note -- this assumes that the regions will be copied - * in gravity order. - */ - for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) - { - if (gravitate[g]) - REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip, - gravitate[g]); - } - REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny); - g = pWin->bitGravity; - if (!gravitate[g]) - gravitate[g] = oldWinClip; - else - { - REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip); - REGION_DESTROY(pScreen, oldWinClip); - } - } - - /* - * move the bits on the screen - */ - - destClip = NULL; - - for (g = 0; g <= StaticGravity; g++) - { - if (!gravitate[g]) - continue; - - GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny); - - oldpt.x = oldx + (x - nx); - oldpt.y = oldy + (y - ny); - - /* Note that gravitate[g] is *translated* by CopyWindow */ - - /* only copy the remaining useful bits */ - - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], oldRegion); - - /* clip to not overwrite already copied areas */ - - if (destClip) { - REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip); - REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y); - } - - /* and move those bits */ - - if (oldpt.x != x || oldpt.y != y) - (*pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, gravitate[g]); - - /* remove any overwritten bits from the remaining useful bits */ - - REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]); - - /* - * recompute exposed regions of child windows - */ - - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - if (pChild->winGravity != g) - continue; - REGION_INTERSECT(pScreen, pRegion, - &pChild->borderClip, gravitate[g]); - TraverseTree (pChild, miRecomputeExposures, (pointer)pRegion); - } - - /* - * remove the successfully copied regions of the - * window from its exposed region - */ - - if (g == pWin->bitGravity) - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, - &pWin->valdata->after.exposed, gravitate[g]); - if (!destClip) - destClip = gravitate[g]; - else - { - REGION_UNION(pScreen, destClip, destClip, gravitate[g]); - REGION_DESTROY(pScreen, gravitate[g]); - } - } - - REGION_DESTROY(pScreen, oldRegion); - REGION_DESTROY(pScreen, pRegion); - if (destClip) - REGION_DESTROY(pScreen, destClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - if (anyMarked) - (*pScreen->HandleExposures)(pLayerWin->parent); -#ifdef DO_SAVE_UNDERS - if (dosave) - { - (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange, - VTOther); - } - else if (bsExposed) - { - (*pScreen->WindowExposures) (pWin, NullRegion, bsExposed); - REGION_DESTROY(pScreen, bsExposed); - } - if (pWin->realized) - WindowsRestructured (); -} - -WindowPtr -miGetLayerWindow(pWin) - WindowPtr pWin; -{ - return pWin->firstChild; -} - -#ifdef SHAPE -/****** - * - * miSetShape - * The border/window shape has changed. Recompute winSize/borderSize - * and send appropriate exposure events - */ - -void -miSetShape(pWin) - register WindowPtr pWin; -{ - Bool WasViewable = (Bool)(pWin->viewable); - register ScreenPtr pScreen = pWin->drawable.pScreen; - Bool anyMarked = FALSE; - RegionPtr pOldClip = NULL, bsExposed; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - if (WasViewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - SetWinSize (pWin); - SetBorderSize (pWin); - - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - if (WasViewable) - { - if (pWin->backStorage) - { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); - } - - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - (WindowPtr *)NULL); - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, VTOther); - } - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pOldClip = &pWin->clipList; /* a convenient empty region */ - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, pOldClip, - pWin->drawable.x, pWin->drawable.y); -#ifdef NXAGENT_SERVER - - /* - * We got a few, rare, segfaults here after having - * started using the backing store. It may be a - * different bug but miChangeSaveUnder() calls mi- - * CheckSubSaveUnder() that, in turn, can change - * the backing store attribute of the window. This - * means that we may try to destroy the region - * even if it was not created at the beginning of - * this function as, at the time, the backing store - * was off. miCheckSubSaveUnder() appear to get a - * pointer to the parent, so maybe doesn't change - * the attribute of the window itself. This is to - * be better investigated. - */ - - if (WasViewable && pOldClip) - REGION_DESTROY(pScreen, pOldClip); -#else - if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); -#endif - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - } - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pLayerWin->parent); -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured (); - CheckCursorConfinement(pWin); -} -#endif - -/* Keeps the same inside(!) origin */ - -void -miChangeBorderWidth(pWin, width) - register WindowPtr pWin; - unsigned int width; -{ - WindowPtr pParent; - int oldwidth; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - Bool WasViewable = (Bool)(pWin->viewable); - Bool HadBorder; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - oldwidth = wBorderWidth (pWin); - if (oldwidth == width) - return; - HadBorder = HasBorder(pWin); - pScreen = pWin->drawable.pScreen; - pParent = pWin->parent; - if (WasViewable && width < oldwidth) - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); - - pWin->borderWidth = width; - SetBorderSize (pWin); - - if (WasViewable) - { - if (width > oldwidth) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - /* - * save the old border visible region to correctly compute - * borderExposed. - */ - if (pWin->valdata && HadBorder) - { - RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTOther); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, - VTOther); - } - if (pWin->realized) - WindowsRestructured (); -} - -void -miMarkUnrealizedWindow(pChild, pWin, fromConfigure) - WindowPtr pChild; - WindowPtr pWin; - Bool fromConfigure; -{ - if ((pChild != pWin) || fromConfigure) - { - REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList); - if (pChild->drawable.pScreen->ClipNotify) - (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0); - REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip); - } -} - -void -miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth) -{ - ScreenPtr pScreen; - WindowPtr pChild; - - pScreen = pWin->drawable.pScreen; - - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - if (pChild->drawable.depth == depth) - REGION_UNION(pScreen, pReg, pReg, &pChild->borderClip); - - if (pChild->firstChild) - miSegregateChildren(pChild, pReg, depth); - } -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c.XF86.original deleted file mode 100644 index fbced41c6..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c.XF86.original +++ /dev/null @@ -1,1176 +0,0 @@ -/* $XFree86: xc/programs/Xserver/mi/miwindow.c,v 1.7 2001/12/14 20:00:28 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: miwindow.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ -#include "X.h" -#include "miscstruct.h" -#include "region.h" -#include "mi.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "mivalidate.h" - -void -miClearToBackground(pWin, x, y, w, h, generateExposures) - WindowPtr pWin; - int x,y; - int w,h; - Bool generateExposures; -{ - BoxRec box; - RegionRec reg; - RegionPtr pBSReg = NullRegion; - ScreenPtr pScreen; - BoxPtr extents; - int x1, y1, x2, y2; - - /* compute everything using ints to avoid overflow */ - - x1 = pWin->drawable.x + x; - y1 = pWin->drawable.y + y; - if (w) - x2 = x1 + (int) w; - else - x2 = x1 + (int) pWin->drawable.width - (int) x; - if (h) - y2 = y1 + h; - else - y2 = y1 + (int) pWin->drawable.height - (int) y; - - extents = &pWin->clipList.extents; - - /* clip the resulting rectangle to the window clipList extents. This - * makes sure that the result will fit in a box, given that the - * screen is < 32768 on a side. - */ - - if (x1 < extents->x1) - x1 = extents->x1; - if (x2 > extents->x2) - x2 = extents->x2; - if (y1 < extents->y1) - y1 = extents->y1; - if (y2 > extents->y2) - y2 = extents->y2; - - if (x2 <= x1 || y2 <= y1) - { - x2 = x1 = 0; - y2 = y1 = 0; - } - - box.x1 = x1; - box.x2 = x2; - box.y1 = y1; - box.y2 = y2; - - pScreen = pWin->drawable.pScreen; - REGION_INIT(pScreen, ®, &box, 1); - if (pWin->backStorage) - { - /* - * If the window has backing-store on, call through the - * ClearToBackground vector to handle the special semantics - * (i.e. things backing store is to be cleared out and - * an Expose event is to be generated for those areas in backing - * store if generateExposures is TRUE). - */ - pBSReg = (* pScreen->ClearBackingStore)(pWin, x, y, w, h, - generateExposures); - } - - REGION_INTERSECT(pScreen, ®, ®, &pWin->clipList); - if (generateExposures) - (*pScreen->WindowExposures)(pWin, ®, pBSReg); - else if (pWin->backgroundState != None) - (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); - REGION_UNINIT(pScreen, ®); - if (pBSReg) - REGION_DESTROY(pScreen, pBSReg); -} - -/* - * For SaveUnders using backing-store. The idea is that when a window is mapped - * with saveUnder set TRUE, any windows it obscures will have its backing - * store turned on setting the DIXsaveUnder bit, - * The backing-store code must be written to allow for this - */ - -/*- - *----------------------------------------------------------------------- - * miCheckSubSaveUnder -- - * Check all the inferiors of a window for coverage by saveUnder - * windows. Called from ChangeSaveUnder and CheckSaveUnder. - * This code is very inefficient. - * - * Results: - * TRUE if any windows need to have backing-store removed. - * - * Side Effects: - * Windows may have backing-store turned on or off. - * - *----------------------------------------------------------------------- - */ -static Bool -miCheckSubSaveUnder( - register WindowPtr pParent, /* Parent to check */ - WindowPtr pFirst, /* first reconfigured window */ - RegionPtr pRegion) /* Initial area obscured by saveUnder */ -{ - register WindowPtr pChild; /* Current child */ - register ScreenPtr pScreen; /* Screen to use */ - RegionRec SubRegion; /* Area of children obscured */ - Bool res = FALSE; /* result */ - Bool subInited=FALSE;/* SubRegion initialized */ - - pScreen = pParent->drawable.pScreen; - if ( (pChild = pParent->firstChild) ) - { - /* - * build region above first changed window - */ - - for (; pChild != pFirst; pChild = pChild->nextSib) - if (pChild->viewable && pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); - - /* - * check region below and including first changed window - */ - - for (; pChild; pChild = pChild->nextSib) - { - if (pChild->viewable) - { - /* - * don't save under nephew/niece windows; - * use a separate region - */ - - if (pChild->firstChild) - { - if (!subInited) - { - REGION_INIT(pScreen, &SubRegion, NullBox, 0); - subInited = TRUE; - } - REGION_COPY(pScreen, &SubRegion, pRegion); - res |= miCheckSubSaveUnder(pChild, pChild->firstChild, - &SubRegion); - } - else - { - res |= miCheckSubSaveUnder(pChild, pChild->firstChild, - pRegion); - } - - if (pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); - } - } - - if (subInited) - REGION_UNINIT(pScreen, &SubRegion); - } - - /* - * Check the state of this window. DIX save unders are - * enabled for viewable windows with some client expressing - * exposure interest and which intersect the save under region - */ - - if (pParent->viewable && - ((pParent->eventMask | wOtherEventMasks(pParent)) & ExposureMask) && - REGION_NOTEMPTY(pScreen, &pParent->borderSize) && - RECT_IN_REGION(pScreen, pRegion, REGION_EXTENTS(pScreen, - &pParent->borderSize)) != rgnOUT) - { - if (!pParent->DIXsaveUnder) - { - pParent->DIXsaveUnder = TRUE; - (*pScreen->ChangeWindowAttributes) (pParent, CWBackingStore); - } - } - else - { - if (pParent->DIXsaveUnder) - { - res = TRUE; - pParent->DIXsaveUnder = FALSE; - } - } - return res; -} - - -/*- - *----------------------------------------------------------------------- - * miChangeSaveUnder -- - * Change the save-under state of a tree of windows. Called when - * a window with saveUnder TRUE is mapped/unmapped/reconfigured. - * - * Results: - * TRUE if any windows need to have backing-store removed (which - * means that PostChangeSaveUnder needs to be called later to - * finish the job). - * - * Side Effects: - * Windows may have backing-store turned on or off. - * - *----------------------------------------------------------------------- - */ -Bool -miChangeSaveUnder(pWin, first) - register WindowPtr pWin; - WindowPtr first; /* First window to check. - * Used when pWin was restacked */ -{ - RegionRec rgn; /* Area obscured by saveUnder windows */ - register ScreenPtr pScreen; - Bool res; - - if (!deltaSaveUndersViewable && !numSaveUndersViewable) - return FALSE; - numSaveUndersViewable += deltaSaveUndersViewable; - deltaSaveUndersViewable = 0; - pScreen = pWin->drawable.pScreen; - REGION_INIT(pScreen, &rgn, NullBox, 1); - res = miCheckSubSaveUnder (pWin->parent, - pWin->saveUnder ? first : pWin->nextSib, - &rgn); - REGION_UNINIT(pScreen, &rgn); - return res; -} - -/*- - *----------------------------------------------------------------------- - * miPostChangeSaveUnder -- - * Actually turn backing-store off for those windows that no longer - * need to have it on. - * - * Results: - * None. - * - * Side Effects: - * Backing-store and SAVE_UNDER_CHANGE_BIT are turned off for those - * windows affected. - * - *----------------------------------------------------------------------- - */ -void -miPostChangeSaveUnder(pWin, pFirst) - WindowPtr pWin; - WindowPtr pFirst; -{ - register WindowPtr pParent, pChild; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - - if (!(pParent = pWin->parent)) - return; - ChangeWindowAttributes = pParent->drawable.pScreen->ChangeWindowAttributes; - if (!pParent->DIXsaveUnder && - (pParent->backingStore == NotUseful) && pParent->backStorage) - (*ChangeWindowAttributes)(pParent, CWBackingStore); - if (!(pChild = pFirst)) - return; - while (1) - { - if (!pChild->DIXsaveUnder && - (pChild->backingStore == NotUseful) && pChild->backStorage) - (*ChangeWindowAttributes)(pChild, CWBackingStore); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib) - { - pChild = pChild->parent; - if (pChild == pParent) - return; - } - pChild = pChild->nextSib; - } -} - -void -miMarkWindow(pWin) - register WindowPtr pWin; -{ - register ValidatePtr val; - - if (pWin->valdata) - return; - val = (ValidatePtr)xnfalloc(sizeof(ValidateRec)); - val->before.oldAbsCorner.x = pWin->drawable.x; - val->before.oldAbsCorner.y = pWin->drawable.y; - val->before.borderVisible = NullRegion; - val->before.resized = FALSE; - pWin->valdata = val; -} - -Bool -miMarkOverlappedWindows(pWin, pFirst, ppLayerWin) - WindowPtr pWin; - WindowPtr pFirst; - WindowPtr *ppLayerWin; -{ - register BoxPtr box; - register WindowPtr pChild, pLast; - Bool anyMarked = FALSE; - MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow; - ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; - - /* single layered systems are easy */ - if (ppLayerWin) *ppLayerWin = pWin; - - if (pWin == pFirst) - { - /* Blindly mark pWin and all of its inferiors. This is a slight - * overkill if there are mapped windows that outside pWin's border, - * but it's better than wasting time on RectIn checks. - */ - pChild = pWin; - while (1) - { - if (pChild->viewable) - { - if (REGION_BROKEN (pScreen, &pChild->winSize)) - SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) - SetBorderSize (pChild); - (* MarkWindow)(pChild); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } - anyMarked = TRUE; - pFirst = pFirst->nextSib; - } - if ( (pChild = pFirst) ) - { - box = REGION_EXTENTS(pChild->drawable.pScreen, &pWin->borderSize); - pLast = pChild->parent->lastChild; - while (1) - { - if (pChild->viewable) - { - if (REGION_BROKEN (pScreen, &pChild->winSize)) - SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) - SetBorderSize (pChild); - if (RECT_IN_REGION(pScreen, &pChild->borderSize, box)) - { - (* MarkWindow)(pChild); - anyMarked = TRUE; - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - } - while (!pChild->nextSib && (pChild != pLast)) - pChild = pChild->parent; - if (pChild == pLast) - break; - pChild = pChild->nextSib; - } - } - if (anyMarked) - (* MarkWindow)(pWin->parent); - return anyMarked; -} - -/***** - * miHandleValidateExposures(pWin) - * starting at pWin, draw background in any windows that have exposure - * regions, translate the regions, restore any backing store, - * and then send any regions still exposed to the client - *****/ -void -miHandleValidateExposures(pWin) - WindowPtr pWin; -{ - register WindowPtr pChild; - register ValidatePtr val; - ScreenPtr pScreen; - WindowExposuresProcPtr WindowExposures; - - pScreen = pWin->drawable.pScreen; - - pChild = pWin; - WindowExposures = pChild->drawable.pScreen->WindowExposures; - while (1) - { - if ( (val = pChild->valdata) ) - { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) - (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, - &val->after.borderExposed, - PW_BORDER); - REGION_UNINIT(pScreen, &val->after.borderExposed); - (*WindowExposures)(pChild, &val->after.exposed, NullRegion); - REGION_UNINIT(pScreen, &val->after.exposed); - xfree(val); - pChild->valdata = (ValidatePtr)NULL; - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } -} - -void -miMoveWindow(pWin, x, y, pNextSib, kind) - register WindowPtr pWin; - int x,y; - WindowPtr pNextSib; - VTKind kind; -{ - WindowPtr pParent; - Bool WasViewable = (Bool)(pWin->viewable); - short bw; - RegionPtr oldRegion = NULL; - DDXPointRec oldpt; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - WindowPtr windowToValidate; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - /* if this is a root window, can't be moved */ - if (!(pParent = pWin->parent)) - return ; - pScreen = pWin->drawable.pScreen; - bw = wBorderWidth (pWin); - - oldpt.x = pWin->drawable.x; - oldpt.y = pWin->drawable.y; - if (WasViewable) - { - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->borderClip); - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); - } - pWin->origin.x = x + (int)bw; - pWin->origin.y = y + (int)bw; - x = pWin->drawable.x = pParent->drawable.x + x + (int)bw; - y = pWin->drawable.y = pParent->drawable.y + y + (int)bw; - - SetWinSize (pWin); - SetBorderSize (pWin); - - (*pScreen->PositionWindow)(pWin, x, y); - - windowToValidate = MoveWindowInStack(pWin, pNextSib); - - ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0); - - if (WasViewable) - { - if (pLayerWin == pWin) - anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, windowToValidate, (WindowPtr *)NULL); - else - anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, pLayerWin, (WindowPtr *)NULL); - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, windowToValidate); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, kind); - (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, oldRegion); - REGION_DESTROY(pScreen, oldRegion); - /* XXX need to retile border if ParentRelative origin */ - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, windowToValidate); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, kind); - } - if (pWin->realized) - WindowsRestructured (); -} - - -/* - * pValid is a region of the screen which has been - * successfully copied -- recomputed exposed regions for affected windows - */ - -static int -miRecomputeExposures ( - register WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ -{ - register ScreenPtr pScreen; - RegionPtr pValid = (RegionPtr)value; - - if (pWin->valdata) - { - pScreen = pWin->drawable.pScreen; - /* - * compute exposed regions of this window - */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, - &pWin->clipList, pValid); - /* - * compute exposed regions of the border - */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, - &pWin->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, - &pWin->valdata->after.borderExposed, pValid); - return WT_WALKCHILDREN; - } - return WT_NOMATCH; -} - -void -miSlideAndSizeWindow(pWin, x, y, w, h, pSib) - register WindowPtr pWin; - int x,y; - unsigned int w, h; - WindowPtr pSib; -{ - WindowPtr pParent; - Bool WasViewable = (Bool)(pWin->viewable); - unsigned short width = pWin->drawable.width, - height = pWin->drawable.height; - short oldx = pWin->drawable.x, - oldy = pWin->drawable.y; - int bw = wBorderWidth (pWin); - short dw, dh; - DDXPointRec oldpt; - RegionPtr oldRegion = NULL; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - WindowPtr pFirstChange; - register WindowPtr pChild; - RegionPtr gravitate[StaticGravity + 1]; - register unsigned g; - int nx, ny; /* destination x,y */ - int newx, newy; /* new inner window position */ - RegionPtr pRegion = NULL; - RegionPtr destClip; /* portions of destination already written */ - RegionPtr oldWinClip = NULL; /* old clip list for window */ - RegionPtr borderVisible = NullRegion; /* visible area of the border */ - RegionPtr bsExposed = NullRegion; /* backing store exposures */ - Bool shrunk = FALSE; /* shrunk in an inner dimension */ - Bool moved = FALSE; /* window position changed */ -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - /* if this is a root window, can't be resized */ - if (!(pParent = pWin->parent)) - return ; - - pScreen = pWin->drawable.pScreen; - newx = pParent->drawable.x + x + bw; - newy = pParent->drawable.y + y + bw; - if (WasViewable) - { - anyMarked = FALSE; - /* - * save the visible region of the window - */ - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->winSize); - - /* - * categorize child windows into regions to be moved - */ - for (g = 0; g <= StaticGravity; g++) - gravitate[g] = (RegionPtr) NULL; - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - g = pChild->winGravity; - if (g != UnmapGravity) - { - if (!gravitate[g]) - gravitate[g] = REGION_CREATE(pScreen, NullBox, 1); - REGION_UNION(pScreen, gravitate[g], - gravitate[g], &pChild->borderClip); - } - else - { - UnmapWindow(pChild, TRUE); - anyMarked = TRUE; - } - } - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - - oldWinClip = NULL; - if (pWin->bitGravity != ForgetGravity) - { - oldWinClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip, &pWin->clipList); - } - /* - * if the window is changing size, borderExposed - * can't be computed correctly without some help. - */ - if (pWin->drawable.height > h || pWin->drawable.width > w) - shrunk = TRUE; - - if (newx != oldx || newy != oldy) - moved = TRUE; - - if ((pWin->drawable.height != h || pWin->drawable.width != w) && - HasBorder (pWin)) - { - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - /* for tiled borders, we punt and draw the whole thing */ - if (pWin->borderIsPixel || !moved) - { - if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, - &pWin->winSize); - else - REGION_COPY(pScreen, borderVisible, - &pWin->borderClip); - } - } - } - pWin->origin.x = x + bw; - pWin->origin.y = y + bw; - pWin->drawable.height = h; - pWin->drawable.width = w; - - x = pWin->drawable.x = newx; - y = pWin->drawable.y = newy; - - SetWinSize (pWin); - SetBorderSize (pWin); - - dw = (int)w - (int)width; - dh = (int)h - (int)height; - ResizeChildrenWinSize(pWin, x - oldx, y - oldy, dw, dh); - - /* let the hardware adjust background and border pixmaps, if any */ - (*pScreen->PositionWindow)(pWin, x, y); - - pFirstChange = MoveWindowInStack(pWin, pSib); - - if (WasViewable) - { - pRegion = REGION_CREATE(pScreen, NullBox, 1); - if (pWin->backStorage) - REGION_COPY(pScreen, pRegion, &pWin->clipList); - - if (pLayerWin == pWin) - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, - (WindowPtr *)NULL); - else - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin, - (WindowPtr *)NULL); - - if (pWin->valdata) - { - pWin->valdata->before.resized = TRUE; - pWin->valdata->before.borderVisible = borderVisible; - } - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, VTOther); - /* - * the entire window is trashed unless bitGravity - * recovers portions of it - */ - REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList); - } - - GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pRegion = &pWin->clipList; /* a convenient empty region */ - if (pWin->bitGravity == ForgetGravity) - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, NullRegion, oldx, oldy); - else - { - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, nx - x, ny - y, pRegion, oldx, oldy); - } - } - - if (WasViewable) - { - /* avoid the border */ - if (HasBorder (pWin)) - { - int offx, offy, dx, dy; - - /* kruft to avoid double translates for each gravity */ - offx = 0; - offy = 0; - for (g = 0; g <= StaticGravity; g++) - { - if (!gravitate[g]) - continue; - - /* align winSize to gravitate[g]. - * winSize is in new coordinates, - * gravitate[g] is still in old coordinates */ - GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny); - - dx = (oldx - nx) - offx; - dy = (oldy - ny) - offy; - if (dx || dy) - { - REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy); - offx += dx; - offy += dy; - } - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], - &pWin->winSize); - } - /* get winSize back where it belongs */ - if (offx || offy) - REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy); - } - /* - * add screen bits to the appropriate bucket - */ - - if (oldWinClip) - { - /* - * clip to new clipList - */ - REGION_COPY(pScreen, pRegion, oldWinClip); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList); - /* - * don't step on any gravity bits which will be copied after this - * region. Note -- this assumes that the regions will be copied - * in gravity order. - */ - for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) - { - if (gravitate[g]) - REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip, - gravitate[g]); - } - REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny); - g = pWin->bitGravity; - if (!gravitate[g]) - gravitate[g] = oldWinClip; - else - { - REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip); - REGION_DESTROY(pScreen, oldWinClip); - } - } - - /* - * move the bits on the screen - */ - - destClip = NULL; - - for (g = 0; g <= StaticGravity; g++) - { - if (!gravitate[g]) - continue; - - GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny); - - oldpt.x = oldx + (x - nx); - oldpt.y = oldy + (y - ny); - - /* Note that gravitate[g] is *translated* by CopyWindow */ - - /* only copy the remaining useful bits */ - - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], oldRegion); - - /* clip to not overwrite already copied areas */ - - if (destClip) { - REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip); - REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y); - } - - /* and move those bits */ - - if (oldpt.x != x || oldpt.y != y) - (*pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, gravitate[g]); - - /* remove any overwritten bits from the remaining useful bits */ - - REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]); - - /* - * recompute exposed regions of child windows - */ - - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - if (pChild->winGravity != g) - continue; - REGION_INTERSECT(pScreen, pRegion, - &pChild->borderClip, gravitate[g]); - TraverseTree (pChild, miRecomputeExposures, (pointer)pRegion); - } - - /* - * remove the successfully copied regions of the - * window from its exposed region - */ - - if (g == pWin->bitGravity) - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, - &pWin->valdata->after.exposed, gravitate[g]); - if (!destClip) - destClip = gravitate[g]; - else - { - REGION_UNION(pScreen, destClip, destClip, gravitate[g]); - REGION_DESTROY(pScreen, gravitate[g]); - } - } - - REGION_DESTROY(pScreen, oldRegion); - REGION_DESTROY(pScreen, pRegion); - if (destClip) - REGION_DESTROY(pScreen, destClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - if (anyMarked) - (*pScreen->HandleExposures)(pLayerWin->parent); -#ifdef DO_SAVE_UNDERS - if (dosave) - { - (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange, - VTOther); - } - else if (bsExposed) - { - (*pScreen->WindowExposures) (pWin, NullRegion, bsExposed); - REGION_DESTROY(pScreen, bsExposed); - } - if (pWin->realized) - WindowsRestructured (); -} - -WindowPtr -miGetLayerWindow(pWin) - WindowPtr pWin; -{ - return pWin->firstChild; -} - -#ifdef SHAPE -/****** - * - * miSetShape - * The border/window shape has changed. Recompute winSize/borderSize - * and send appropriate exposure events - */ - -void -miSetShape(pWin) - register WindowPtr pWin; -{ - Bool WasViewable = (Bool)(pWin->viewable); - register ScreenPtr pScreen = pWin->drawable.pScreen; - Bool anyMarked = FALSE; - RegionPtr pOldClip = NULL, bsExposed; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - if (WasViewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - SetWinSize (pWin); - SetBorderSize (pWin); - - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - if (WasViewable) - { - if (pWin->backStorage) - { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); - } - - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - (WindowPtr *)NULL); - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, VTOther); - } - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pOldClip = &pWin->clipList; /* a convenient empty region */ - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, pOldClip, - pWin->drawable.x, pWin->drawable.y); - if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - } - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pLayerWin->parent); -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured (); - CheckCursorConfinement(pWin); -} -#endif - -/* Keeps the same inside(!) origin */ - -void -miChangeBorderWidth(pWin, width) - register WindowPtr pWin; - unsigned int width; -{ - WindowPtr pParent; - int oldwidth; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - Bool WasViewable = (Bool)(pWin->viewable); - Bool HadBorder; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - oldwidth = wBorderWidth (pWin); - if (oldwidth == width) - return; - HadBorder = HasBorder(pWin); - pScreen = pWin->drawable.pScreen; - pParent = pWin->parent; - if (WasViewable && width < oldwidth) - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); - - pWin->borderWidth = width; - SetBorderSize (pWin); - - if (WasViewable) - { - if (width > oldwidth) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - /* - * save the old border visible region to correctly compute - * borderExposed. - */ - if (pWin->valdata && HadBorder) - { - RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTOther); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, - VTOther); - } - if (pWin->realized) - WindowsRestructured (); -} - -void -miMarkUnrealizedWindow(pChild, pWin, fromConfigure) - WindowPtr pChild; - WindowPtr pWin; - Bool fromConfigure; -{ - if ((pChild != pWin) || fromConfigure) - { - REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList); - if (pChild->drawable.pScreen->ClipNotify) - (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0); - REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip); - } -} - -void -miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth) -{ - ScreenPtr pScreen; - WindowPtr pChild; - - pScreen = pWin->drawable.pScreen; - - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - if (pChild->drawable.depth == depth) - REGION_UNION(pScreen, pReg, pReg, &pChild->borderClip); - - if (pChild->firstChild) - miSegregateChildren(pChild, pReg, depth); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original deleted file mode 100644 index d32cdb6c4..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original +++ /dev/null @@ -1,1512 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXpicture.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/picture.c,v 1.30 2003/01/26 16:40:43 eich Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "NXpicturestr.h" - -#include "Screen.h" -#include "Pixmaps.h" -#include "Drawable.h" - -void *nxagentMatchingFormats(PictFormatPtr pForm); - -int PictureScreenPrivateIndex = -1; -int PictureWindowPrivateIndex; -int PictureGeneration; -RESTYPE PictureType; -RESTYPE PictFormatType; -RESTYPE GlyphSetType; -int PictureCmapPolicy = PictureCmapPolicyDefault; - -Bool -PictureDestroyWindow (WindowPtr pWindow) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - PicturePtr pPicture; - PictureScreenPtr ps = GetPictureScreen(pScreen); - Bool ret; - - while ((pPicture = GetPictureWindow(pWindow))) - { - SetPictureWindow(pWindow, pPicture->pNext); - if (pPicture->id) - FreeResource (pPicture->id, PictureType); - FreePicture ((pointer) pPicture, pPicture->id); - } - pScreen->DestroyWindow = ps->DestroyWindow; - ret = (*pScreen->DestroyWindow) (pWindow); - ps->DestroyWindow = pScreen->DestroyWindow; - pScreen->DestroyWindow = PictureDestroyWindow; - return ret; -} - -Bool -PictureCloseScreen (int index, ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - Bool ret; - int n; - - pScreen->CloseScreen = ps->CloseScreen; - ret = (*pScreen->CloseScreen) (index, pScreen); - PictureResetFilters (pScreen); - for (n = 0; n < ps->nformats; n++) - if (ps->formats[n].type == PictTypeIndexed) - (*ps->CloseIndexed) (pScreen, &ps->formats[n]); - SetPictureScreen(pScreen, 0); - xfree (ps->formats); - xfree (ps); - return ret; -} - -void -PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef) -{ - ScreenPtr pScreen = pColormap->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - pScreen->StoreColors = ps->StoreColors; - (*pScreen->StoreColors) (pColormap, ndef, pdef); - ps->StoreColors = pScreen->StoreColors; - pScreen->StoreColors = PictureStoreColors; - - if (pColormap->class == PseudoColor || pColormap->class == GrayScale) - { - PictFormatPtr format = ps->formats; - int nformats = ps->nformats; - - while (nformats--) - { - if (format->type == PictTypeIndexed && - format->index.pColormap == pColormap) - { - (*ps->UpdateIndexed) (pScreen, format, ndef, pdef); - break; - } - format++; - } - } -} - -static int -visualDepth (ScreenPtr pScreen, VisualPtr pVisual) -{ - int d, v; - DepthPtr pDepth; - - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = &pScreen->allowedDepths[d]; - for (v = 0; v < pDepth->numVids; v++) - if (pDepth->vids[v] == pVisual->vid) - return pDepth->depth; - } - return 0; -} - -typedef struct _formatInit { - CARD32 format; - CARD8 depth; -} FormatInitRec, *FormatInitPtr; - -static int -addFormat (FormatInitRec formats[256], - int nformat, - CARD32 format, - CARD8 depth) -{ - int n; - - for (n = 0; n < nformat; n++) - if (formats[n].format == format && formats[n].depth == depth) - return nformat; - formats[nformat].format = format; - formats[nformat].depth = depth; - return ++nformat; -} - -#define Mask(n) ((n) == 32 ? 0xffffffff : ((1 << (n))-1)) - -PictFormatPtr -PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) -{ -#ifdef NXAGENT_SERVER - int nformats, f, n; -#else - int nformats, f; -#endif - PictFormatPtr pFormats; - FormatInitRec formats[1024]; - CARD32 format; - CARD8 depth; - VisualPtr pVisual; - int v; - int bpp; - int type; - int r, g, b; - int d; - DepthPtr pDepth; - - nformats = 0; - /* formats required by protocol */ - formats[nformats].format = PICT_a1; - formats[nformats].depth = 1; - nformats++; - formats[nformats].format = PICT_a8; - formats[nformats].depth = 8; - nformats++; - formats[nformats].format = PICT_a4; - formats[nformats].depth = 4; - nformats++; - formats[nformats].format = PICT_a8r8g8b8; - formats[nformats].depth = 32; - nformats++; - formats[nformats].format = PICT_x8r8g8b8; - formats[nformats].depth = 32; - nformats++; - - /* now look through the depths and visuals adding other formats */ - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = &pScreen->visuals[v]; - depth = visualDepth (pScreen, pVisual); - if (!depth) - continue; - bpp = BitsPerPixel (depth); - switch (pVisual->class) { - case DirectColor: - case TrueColor: - r = Ones (pVisual->redMask); - g = Ones (pVisual->greenMask); - b = Ones (pVisual->blueMask); - type = PICT_TYPE_OTHER; - /* - * Current rendering code supports only two direct formats, - * fields must be packed together at the bottom of the pixel - * and must be either RGB or BGR - */ - if (pVisual->offsetBlue == 0 && - pVisual->offsetGreen == b && - pVisual->offsetRed == b + g) - { - type = PICT_TYPE_ARGB; - } - else if (pVisual->offsetRed == 0 && - pVisual->offsetGreen == r && - pVisual->offsetBlue == r + g) - { - type = PICT_TYPE_ABGR; - } - if (type != PICT_TYPE_OTHER) - { - format = PICT_FORMAT(bpp, type, 0, r, g, b); - nformats = addFormat (formats, nformats, format, depth); - } - break; - case StaticColor: - case PseudoColor: - format = PICT_VISFORMAT (bpp, PICT_TYPE_COLOR, v); - nformats = addFormat (formats, nformats, format, depth); - break; - case StaticGray: - case GrayScale: - format = PICT_VISFORMAT (bpp, PICT_TYPE_GRAY, v); - nformats = addFormat (formats, nformats, format, depth); - break; - } - } - /* - * Walk supported depths and add useful Direct formats - */ - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = &pScreen->allowedDepths[d]; - bpp = BitsPerPixel (pDepth->depth); - format = 0; - switch (bpp) { - case 16: - /* depth 12 formats */ - if (pDepth->depth >= 12) - { - nformats = addFormat (formats, nformats, - PICT_x4r4g4b4, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x4b4g4r4, pDepth->depth); - } - /* depth 15 formats */ - if (pDepth->depth >= 15) - { - nformats = addFormat (formats, nformats, - PICT_x1r5g5b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x1b5g5r5, pDepth->depth); - } - /* depth 16 formats */ - if (pDepth->depth >= 16) - { - nformats = addFormat (formats, nformats, - PICT_a1r5g5b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a1b5g5r5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_r5g6b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_b5g6r5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a4r4g4b4, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a4b4g4r4, pDepth->depth); - } - break; - case 24: - if (pDepth->depth >= 24) - { - nformats = addFormat (formats, nformats, - PICT_r8g8b8, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_b8g8r8, pDepth->depth); - } - break; - case 32: - if (pDepth->depth >= 24) - { - nformats = addFormat (formats, nformats, - PICT_x8r8g8b8, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x8b8g8r8, pDepth->depth); - } - break; - } - } - - - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); - if (!pFormats) - return 0; - memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); -#ifdef NXAGENT_SERVER - for (f = 0, n = 0; n < nformats; n++) - { - pFormats[f].id = FakeClientID (0); - pFormats[f].depth = formats[n].depth; - format = formats[n].format; - pFormats[f].format = format; -#else - for (f = 0; f < nformats; f++) - { - pFormats[f].id = FakeClientID (0); - pFormats[f].depth = formats[f].depth; - format = formats[f].format; - pFormats[f].format = format; -#endif - switch (PICT_FORMAT_TYPE(format)) { - case PICT_TYPE_ARGB: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - if (pFormats[f].direct.alphaMask) - pFormats[f].direct.alpha = (PICT_FORMAT_R(format) + - PICT_FORMAT_G(format) + - PICT_FORMAT_B(format)); - - pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format)); - pFormats[f].direct.red = (PICT_FORMAT_G(format) + - PICT_FORMAT_B(format)); - - pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format)); - pFormats[f].direct.green = PICT_FORMAT_B(format); - - pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format)); - pFormats[f].direct.blue = 0; - break; - - case PICT_TYPE_ABGR: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - if (pFormats[f].direct.alphaMask) - pFormats[f].direct.alpha = (PICT_FORMAT_B(format) + - PICT_FORMAT_G(format) + - PICT_FORMAT_R(format)); - - pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format)); - pFormats[f].direct.blue = (PICT_FORMAT_G(format) + - PICT_FORMAT_R(format)); - - pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format)); - pFormats[f].direct.green = PICT_FORMAT_R(format); - - pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format)); - pFormats[f].direct.red = 0; - break; - - case PICT_TYPE_A: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alpha = 0; - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - - /* remaining fields already set to zero */ - break; - - case PICT_TYPE_COLOR: - case PICT_TYPE_GRAY: - pFormats[f].type = PictTypeIndexed; - pFormats[f].index.pVisual = &pScreen->visuals[PICT_FORMAT_VIS(format)]; - break; - } - -#ifdef NXAGENT_SERVER - if (nxagentMatchingFormats(&pFormats[f]) != NULL) - { - f++; - } - else - { - memset(&pFormats[f], '\0', sizeof(PictFormatRec)); - } - } - *nformatp = f; -#else - } - *nformatp = nformats; -#endif - return pFormats; -} - -Bool -PictureInitIndexedFormats (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - - if (!ps) - return FALSE; - format = ps->formats; - nformat = ps->nformats; - while (nformat--) - { - if (format->type == PictTypeIndexed && !format->index.pColormap) - { - if (format->index.pVisual->vid == pScreen->rootVisual) - format->index.pColormap = (ColormapPtr) LookupIDByType(pScreen->defColormap, - RT_COLORMAP); - else - { - if (CreateColormap (FakeClientID (0), pScreen, - format->index.pVisual, - &format->index.pColormap, AllocNone, - 0) != Success) - { - return FALSE; - } - } - if (!(*ps->InitIndexed) (pScreen, format)) - return FALSE; - } - format++; - } - return TRUE; -} - -Bool -PictureFinishInit (void) -{ - int s; - - for (s = 0; s < screenInfo.numScreens; s++) - { - if (!PictureInitIndexedFormats (screenInfo.screens[s])) - return FALSE; - (void) AnimCurInit (screenInfo.screens[s]); - } - - return TRUE; -} - -Bool -PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - if (!ps) - return FALSE; - ps->subpixel = subpixel; - return TRUE; - -} - -int -PictureGetSubpixelOrder (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - if (!ps) - return SubPixelUnknown; - return ps->subpixel; -} - -PictFormatPtr -PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - int type; - - if (!ps) - return 0; - format = ps->formats; - nformat = ps->nformats; - switch (pVisual->class) { - case StaticGray: - case GrayScale: - case StaticColor: - case PseudoColor: - type = PictTypeIndexed; - break; - case TrueColor: - type = PictTypeDirect; - break; - case DirectColor: - default: - return 0; - } - while (nformat--) - { - if (format->depth == depth && format->type == type) - { - if (type == PictTypeIndexed) - { - if (format->index.pVisual == pVisual) - return format; - } - else - { - if (format->direct.redMask << format->direct.red == - pVisual->redMask && - format->direct.greenMask << format->direct.green == - pVisual->greenMask && - format->direct.blueMask << format->direct.blue == - pVisual->blueMask) - { - return format; - } - } - } - format++; - } - return 0; -} - -PictFormatPtr -PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 f) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - - if (!ps) - return 0; - format = ps->formats; - nformat = ps->nformats; - while (nformat--) - { - if (format->depth == depth && format->format == (f & 0xffffff)) - return format; - format++; - } - return 0; -} - -int -PictureParseCmapPolicy (const char *name) -{ - if ( strcmp (name, "default" ) == 0) - return PictureCmapPolicyDefault; - else if ( strcmp (name, "mono" ) == 0) - return PictureCmapPolicyMono; - else if ( strcmp (name, "gray" ) == 0) - return PictureCmapPolicyGray; - else if ( strcmp (name, "color" ) == 0) - return PictureCmapPolicyColor; - else if ( strcmp (name, "all" ) == 0) - return PictureCmapPolicyAll; - else - return PictureCmapPolicyInvalid; -} - -Bool -PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) -{ - PictureScreenPtr ps; - int n; - CARD32 type, a, r, g, b; - - if (PictureGeneration != serverGeneration) - { - PictureType = CreateNewResourceType (FreePicture); - if (!PictureType) - return FALSE; - PictFormatType = CreateNewResourceType (FreePictFormat); - if (!PictFormatType) - return FALSE; - GlyphSetType = CreateNewResourceType (FreeGlyphSet); - if (!GlyphSetType) - return FALSE; - PictureScreenPrivateIndex = AllocateScreenPrivateIndex(); - if (PictureScreenPrivateIndex < 0) - return FALSE; - PictureWindowPrivateIndex = AllocateWindowPrivateIndex(); - PictureGeneration = serverGeneration; -#ifdef XResExtension - RegisterResourceName (PictureType, "PICTURE"); - RegisterResourceName (PictFormatType, "PICTFORMAT"); - RegisterResourceName (GlyphSetType, "GLYPHSET"); -#endif - } - if (!AllocateWindowPrivate (pScreen, PictureWindowPrivateIndex, 0)) - return FALSE; - - if (!formats) - { - formats = PictureCreateDefaultFormats (pScreen, &nformats); - if (!formats) - return FALSE; - } - for (n = 0; n < nformats; n++) - { - if (!AddResource (formats[n].id, PictFormatType, (pointer) (formats+n))) - { - xfree (formats); - return FALSE; - } - if (formats[n].type == PictTypeIndexed) - { - if ((formats[n].index.pVisual->class | DynamicClass) == PseudoColor) - type = PICT_TYPE_COLOR; - else - type = PICT_TYPE_GRAY; - a = r = g = b = 0; - } - else - { - if ((formats[n].direct.redMask| - formats[n].direct.blueMask| - formats[n].direct.greenMask) == 0) - type = PICT_TYPE_A; - else if (formats[n].direct.red > formats[n].direct.blue) - type = PICT_TYPE_ARGB; - else - type = PICT_TYPE_ABGR; - a = Ones (formats[n].direct.alphaMask); - r = Ones (formats[n].direct.redMask); - g = Ones (formats[n].direct.greenMask); - b = Ones (formats[n].direct.blueMask); - } - formats[n].format = PICT_FORMAT(0,type,a,r,g,b); - } - ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec)); - if (!ps) - { - xfree (formats); - return FALSE; - } - SetPictureScreen(pScreen, ps); - if (!GlyphInit (pScreen)) - { - SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); - return FALSE; - } - - ps->totalPictureSize = sizeof (PictureRec); - ps->PicturePrivateSizes = 0; - ps->PicturePrivateLen = 0; - - ps->formats = formats; - ps->fallback = formats; - ps->nformats = nformats; - - ps->filters = 0; - ps->nfilters = 0; - ps->filterAliases = 0; - ps->nfilterAliases = 0; - - ps->subpixel = SubPixelUnknown; - - ps->CloseScreen = pScreen->CloseScreen; - ps->DestroyWindow = pScreen->DestroyWindow; - ps->StoreColors = pScreen->StoreColors; - pScreen->DestroyWindow = PictureDestroyWindow; - pScreen->CloseScreen = PictureCloseScreen; - pScreen->StoreColors = PictureStoreColors; - - if (!PictureSetDefaultFilters (pScreen)) - { - PictureResetFilters (pScreen); - SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); - return FALSE; - } - - return TRUE; -} - -void -SetPictureToDefaults (PicturePtr pPicture) -{ - pPicture->refcnt = 1; - pPicture->repeat = 0; - pPicture->graphicsExposures = FALSE; - pPicture->subWindowMode = ClipByChildren; - pPicture->polyEdge = PolyEdgeSharp; - pPicture->polyMode = PolyModePrecise; - pPicture->freeCompClip = FALSE; - pPicture->clientClipType = CT_NONE; - pPicture->componentAlpha = FALSE; - - pPicture->alphaMap = 0; - pPicture->alphaOrigin.x = 0; - pPicture->alphaOrigin.y = 0; - - pPicture->clipOrigin.x = 0; - pPicture->clipOrigin.y = 0; - pPicture->clientClip = 0; - - pPicture->transform = 0; - - pPicture->dither = None; - pPicture->filter = PictureGetFilterId (FilterNearest, -1, TRUE); - pPicture->filter_params = 0; - pPicture->filter_nparams = 0; - - pPicture->serialNumber = GC_CHANGE_SERIAL_BIT; - pPicture->stateChanges = (1 << (CPLastBit+1)) - 1; -} - -PicturePtr -AllocatePicture (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - PicturePtr pPicture; - char *ptr; - DevUnion *ppriv; - unsigned int *sizes; - unsigned int size; - int i; - - pPicture = (PicturePtr) xalloc (ps->totalPictureSize); - if (!pPicture) - return 0; - ppriv = (DevUnion *)(pPicture + 1); - pPicture->devPrivates = ppriv; - sizes = ps->PicturePrivateSizes; - ptr = (char *)(ppriv + ps->PicturePrivateLen); - for (i = ps->PicturePrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - return pPicture; -} - -/* - * Let picture always point to the virtual pixmap. - * For sure this is not the best way to deal with - * the virtual frame-buffer. - */ - -#define NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - -PicturePtr -CreatePicture (Picture pid, - DrawablePtr pDrawable, - PictFormatPtr pFormat, - Mask vmask, - XID *vlist, - ClientPtr client, - int *error) -{ - PicturePtr pPicture; - PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen); - - pPicture = AllocatePicture (pDrawable->pScreen); - if (!pPicture) - { - *error = BadAlloc; - return 0; - } - - pPicture->id = pid; - pPicture->pDrawable = pDrawable; - pPicture->pFormat = pFormat; - pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24); - if (pDrawable->type == DRAWABLE_PIXMAP) - { - #ifdef NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - - pPicture->pDrawable = nxagentVirtualDrawable(pDrawable); - - #endif - - ++((PixmapPtr)pDrawable)->refcnt; - pPicture->pNext = 0; - } - else - { - pPicture->pNext = GetPictureWindow(((WindowPtr) pDrawable)); - SetPictureWindow(((WindowPtr) pDrawable), pPicture); - } - - SetPictureToDefaults (pPicture); - - if (vmask) - *error = ChangePicture (pPicture, vmask, vlist, 0, client); - else - *error = Success; - if (*error == Success) - *error = (*ps->CreatePicture) (pPicture); - if (*error != Success) - { - FreePicture (pPicture, (XID) 0); - pPicture = 0; - } - return pPicture; -} - -#define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val) - -#define NEXT_PTR(_type) ((_type) ulist++->ptr) - -int -ChangePicture (PicturePtr pPicture, - Mask vmask, - XID *vlist, - DevUnion *ulist, - ClientPtr client) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - BITS32 index2; - int error = 0; - BITS32 maskQ; - - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - maskQ = vmask; - while (vmask && !error) - { - index2 = (BITS32) lowbit (vmask); - vmask &= ~index2; - pPicture->stateChanges |= index2; - switch (index2) - { - case CPRepeat: - { - unsigned int newr; - newr = NEXT_VAL(unsigned int); - if (newr <= xTrue) - pPicture->repeat = newr; - else - { - client->errorValue = newr; - error = BadValue; - } - } - break; - case CPAlphaMap: - { - PicturePtr pAlpha; - - if (vlist) - { - Picture pid = NEXT_VAL(Picture); - - if (pid == None) - pAlpha = 0; - else - { - pAlpha = (PicturePtr) SecurityLookupIDByType(client, - pid, - PictureType, - SecurityWriteAccess|SecurityReadAccess); - if (!pAlpha) - { - client->errorValue = pid; - error = BadPixmap; - break; - } - if (pAlpha->pDrawable->type != DRAWABLE_PIXMAP) - { - client->errorValue = pid; - error = BadMatch; - break; - } - } - } - else - pAlpha = NEXT_PTR(PicturePtr); - if (!error) - { - if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP) - pAlpha->refcnt++; - if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); - pPicture->alphaMap = pAlpha; - } - } - break; - case CPAlphaXOrigin: - pPicture->alphaOrigin.x = NEXT_VAL(INT16); - break; - case CPAlphaYOrigin: - pPicture->alphaOrigin.y = NEXT_VAL(INT16); - break; - case CPClipXOrigin: - pPicture->clipOrigin.x = NEXT_VAL(INT16); - break; - case CPClipYOrigin: - pPicture->clipOrigin.y = NEXT_VAL(INT16); - break; - case CPClipMask: - { - Pixmap pid; - PixmapPtr pPixmap; - int clipType; - - if (vlist) - { - pid = NEXT_VAL(Pixmap); - if (pid == None) - { - clipType = CT_NONE; - pPixmap = NullPixmap; - } - else - { - clipType = CT_PIXMAP; - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - pid, - RT_PIXMAP, - SecurityReadAccess); - if (!pPixmap) - { - client->errorValue = pid; - error = BadPixmap; - break; - } - } - } - else - { - pPixmap = NEXT_PTR(PixmapPtr); - if (pPixmap) - clipType = CT_PIXMAP; - else - clipType = CT_NONE; - } - - if (pPixmap) - { - if ((pPixmap->drawable.depth != 1) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - break; - } - else - { - clipType = CT_PIXMAP; - pPixmap->refcnt++; - } - } - error = (*ps->ChangePictureClip)(pPicture, clipType, - (pointer)pPixmap, 0); - break; - } - case CPGraphicsExposure: - { - unsigned int newe; - newe = NEXT_VAL(unsigned int); - if (newe <= xTrue) - pPicture->graphicsExposures = newe; - else - { - client->errorValue = newe; - error = BadValue; - } - } - break; - case CPSubwindowMode: - { - unsigned int news; - news = NEXT_VAL(unsigned int); - if (news == ClipByChildren || news == IncludeInferiors) - pPicture->subWindowMode = news; - else - { - client->errorValue = news; - error = BadValue; - } - } - break; - case CPPolyEdge: - { - unsigned int newe; - newe = NEXT_VAL(unsigned int); - if (newe == PolyEdgeSharp || newe == PolyEdgeSmooth) - pPicture->polyEdge = newe; - else - { - client->errorValue = newe; - error = BadValue; - } - } - break; - case CPPolyMode: - { - unsigned int newm; - newm = NEXT_VAL(unsigned int); - if (newm == PolyModePrecise || newm == PolyModeImprecise) - pPicture->polyMode = newm; - else - { - client->errorValue = newm; - error = BadValue; - } - } - break; - case CPDither: - pPicture->dither = NEXT_VAL(Atom); - break; - case CPComponentAlpha: - { - unsigned int newca; - - newca = NEXT_VAL (unsigned int); - if (newca <= xTrue) - pPicture->componentAlpha = newca; - else - { - client->errorValue = newca; - error = BadValue; - } - } - break; - default: - client->errorValue = maskQ; - error = BadValue; - break; - } - } - (*ps->ChangePicture) (pPicture, maskQ); - return error; -} - -int -SetPictureClipRects (PicturePtr pPicture, - int xOrigin, - int yOrigin, - int nRect, - xRectangle *rects) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - RegionPtr clientClip; - int result; - - clientClip = RECTS_TO_REGION(pScreen, - nRect, rects, CT_UNSORTED); - if (!clientClip) - return BadAlloc; - result =(*ps->ChangePictureClip) (pPicture, CT_REGION, - (pointer) clientClip, 0); - if (result == Success) - { - pPicture->clipOrigin.x = xOrigin; - pPicture->clipOrigin.y = yOrigin; - pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask; - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - } - return result; -} - -int -SetPictureTransform (PicturePtr pPicture, - PictTransform *transform) -{ - static const PictTransform identity = { { - { xFixed1, 0x00000, 0x00000 }, - { 0x00000, xFixed1, 0x00000 }, - { 0x00000, 0x00000, xFixed1 }, - } }; - - if (transform && memcmp (transform, &identity, sizeof (PictTransform)) == 0) - transform = 0; - - if (transform) - { - if (!pPicture->transform) - { - pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform)); - if (!pPicture->transform) - return BadAlloc; - } - *pPicture->transform = *transform; - } - else - { - if (pPicture->transform) - { - xfree (pPicture->transform); - pPicture->transform = 0; - } - } - return Success; -} - -static void -ValidateOnePicture (PicturePtr pPicture) -{ - if (pPicture->serialNumber != pPicture->pDrawable->serialNumber) - { - PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen); - - (*ps->ValidatePicture) (pPicture, pPicture->stateChanges); - pPicture->stateChanges = 0; - pPicture->serialNumber = pPicture->pDrawable->serialNumber; - } -} - -void -ValidatePicture(PicturePtr pPicture) -{ - ValidateOnePicture (pPicture); - if (pPicture->alphaMap) - ValidateOnePicture (pPicture->alphaMap); -} - -int -FreePicture (pointer value, - XID pid) -{ - PicturePtr pPicture = (PicturePtr) value; - - if (--pPicture->refcnt == 0) - { - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); - (*ps->DestroyPicture) (pPicture); - (*ps->DestroyPictureClip) (pPicture); - if (pPicture->transform) - xfree (pPicture->transform); - if (pPicture->pDrawable->type == DRAWABLE_WINDOW) - { - WindowPtr pWindow = (WindowPtr) pPicture->pDrawable; - PicturePtr *pPrev; - - for (pPrev = (PicturePtr *) &((pWindow)->devPrivates[PictureWindowPrivateIndex].ptr); - *pPrev; - pPrev = &(*pPrev)->pNext) - { - if (*pPrev == pPicture) - { - *pPrev = pPicture->pNext; - break; - } - } - } - else if (pPicture->pDrawable->type == DRAWABLE_PIXMAP) - { - (*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable); - } - xfree (pPicture); - } - return Success; -} - -int -FreePictFormat (pointer pPictFormat, - XID pid) -{ - return Success; -} - -void -CompositePicture (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - if (pMask) - ValidatePicture (pMask); - ValidatePicture (pDst); - (*ps->Composite) (op, - pSrc, - pMask, - pDst, - xSrc, - ySrc, - xMask, - yMask, - xDst, - yDst, - width, - height); -} - -void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr lists, - GlyphPtr *glyphs) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - - #ifdef TEST - fprintf(stderr, "CompositeGlyphs: Going to composite glyphs with " - "source at [%p] and destination at [%p].\n", - (void *) pSrc, (void *) pDst); - #endif - - (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs); -} - -void -CompositeRects (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pDst); - (*ps->CompositeRects) (op, pDst, color, nRect, rects); -} - -void -CompositeTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Trapezoids) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps); -} - -void -CompositeTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntriangles, - xTriangle *triangles) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntriangles, triangles); -} - -void -CompositeTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); -} - -void -CompositeTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); -} - -typedef xFixed_32_32 xFixed_48_16; - -#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff) -#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31)) - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - for (j = 0; j < 2; j++) - { - partial = (xFixed_48_16) result.vector[j] << 16; - v = partial / result.vector[2]; - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - vector->vector[j] = (xFixed) v; - } - vector->vector[2] = xFixed1; - return TRUE; -} - -#ifndef True -# define True 1 -#endif - -#ifndef False -# define False 0 -#endif - -void nxagentReconnectPictFormat(void*, XID, void*); - -Bool nxagentReconnectAllPictFormat(void *p) -{ - PictFormatPtr formats_old, formats; - int nformats, nformats_old; - Bool success = True; - Bool matched; - int i, n; - CARD32 type, a, r, g, b; - - #ifdef DEBUG - fprintf(stderr, "nxagentReconnectAllPictFormat\n"); - #endif - - formats_old = GetPictureScreen(nxagentDefaultScreen) -> formats; - nformats_old = GetPictureScreen(nxagentDefaultScreen) -> nformats; - - /* - * TODO: We could copy PictureCreateDefaultFormats, - * in order not to waste ID with FakeClientID(). - */ - formats = PictureCreateDefaultFormats (nxagentDefaultScreen, &nformats); - - if (!formats) - return FALSE; - - for (n = 0; n < nformats; n++) - { - if (formats[n].type == PictTypeIndexed) - { - if ((formats[n].index.pVisual->class | DynamicClass) == PseudoColor) - type = PICT_TYPE_COLOR; - else - type = PICT_TYPE_GRAY; - a = r = g = b = 0; - } - else - { - if ((formats[n].direct.redMask| - formats[n].direct.blueMask| - formats[n].direct.greenMask) == 0) - type = PICT_TYPE_A; - else if (formats[n].direct.red > formats[n].direct.blue) - type = PICT_TYPE_ARGB; - else - type = PICT_TYPE_ABGR; - a = Ones (formats[n].direct.alphaMask); - r = Ones (formats[n].direct.redMask); - g = Ones (formats[n].direct.greenMask); - b = Ones (formats[n].direct.blueMask); - } - formats[n].format = PICT_FORMAT(0,type,a,r,g,b); - } - - for (n = 0; n < nformats_old; n++) - { - for (i = 0, matched = False; (!matched) && (i < nformats); i++) - { - if (formats_old[n].format == formats[i].format && - formats_old[n].type == formats[i].type && - formats_old[n].direct.red == formats[i].direct.red && - formats_old[n].direct.green == formats[i].direct.green && - formats_old[n].direct.blue == formats[i].direct.blue && - formats_old[n].direct.redMask == formats[i].direct.redMask && - formats_old[n].direct.greenMask == formats[i].direct.greenMask && - formats_old[n].direct.blueMask == formats[i].direct.blueMask && - formats_old[n].direct.alpha == formats[i].direct.alpha && - formats_old[n].direct.alphaMask == formats[i].direct.alphaMask) - { - /* - * Regard depth 16 and 15 as were the same, if all other values match. - */ - - if ((formats_old[n].depth == formats[i].depth) || - ((formats_old[n].depth == 15 || formats_old[n].depth == 16) && - (formats[i].depth == 15 || formats[i].depth == 16))) - { - matched = True; - } - } - } - if (!matched) - return False; - } - xfree(formats); - - /* TODO: Perhaps do i have to do PictureFinishInit ?. */ - /* TODO: We have to check for new Render protocol version. */ - - for (i = 0; (i < MAXCLIENTS) && (success); i++) - { - if (clients[i]) - { - FindClientResourcesByType(clients[i], PictFormatType, nxagentReconnectPictFormat, &success); - } - } - - return success; -} - -/* - * It seem we don't have nothing - * to do for reconnect PictureFormat. - */ - -void nxagentReconnectPictFormat(void *p0, XID x1, void *p2) -{ - PictFormatPtr pFormat; - Bool *pBool; - - pFormat = (PictFormatPtr)p0; - pBool = (Bool*)p2; - - #ifdef DEBUG - fprintf(stderr, "nxagentReconnectPictFormat.\n"); - #endif -} - - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.XF86.original deleted file mode 100644 index b2ef69bdf..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.XF86.original +++ /dev/null @@ -1,1305 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/picture.c,v 1.30 2003/01/26 16:40:43 eich Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "picturestr.h" - -int PictureScreenPrivateIndex = -1; -int PictureWindowPrivateIndex; -int PictureGeneration; -RESTYPE PictureType; -RESTYPE PictFormatType; -RESTYPE GlyphSetType; -int PictureCmapPolicy = PictureCmapPolicyDefault; - -Bool -PictureDestroyWindow (WindowPtr pWindow) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - PicturePtr pPicture; - PictureScreenPtr ps = GetPictureScreen(pScreen); - Bool ret; - - while ((pPicture = GetPictureWindow(pWindow))) - { - SetPictureWindow(pWindow, pPicture->pNext); - if (pPicture->id) - FreeResource (pPicture->id, PictureType); - FreePicture ((pointer) pPicture, pPicture->id); - } - pScreen->DestroyWindow = ps->DestroyWindow; - ret = (*pScreen->DestroyWindow) (pWindow); - ps->DestroyWindow = pScreen->DestroyWindow; - pScreen->DestroyWindow = PictureDestroyWindow; - return ret; -} - -Bool -PictureCloseScreen (int index, ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - Bool ret; - int n; - - pScreen->CloseScreen = ps->CloseScreen; - ret = (*pScreen->CloseScreen) (index, pScreen); - PictureResetFilters (pScreen); - for (n = 0; n < ps->nformats; n++) - if (ps->formats[n].type == PictTypeIndexed) - (*ps->CloseIndexed) (pScreen, &ps->formats[n]); - SetPictureScreen(pScreen, 0); - xfree (ps->formats); - xfree (ps); - return ret; -} - -void -PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef) -{ - ScreenPtr pScreen = pColormap->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - pScreen->StoreColors = ps->StoreColors; - (*pScreen->StoreColors) (pColormap, ndef, pdef); - ps->StoreColors = pScreen->StoreColors; - pScreen->StoreColors = PictureStoreColors; - - if (pColormap->class == PseudoColor || pColormap->class == GrayScale) - { - PictFormatPtr format = ps->formats; - int nformats = ps->nformats; - - while (nformats--) - { - if (format->type == PictTypeIndexed && - format->index.pColormap == pColormap) - { - (*ps->UpdateIndexed) (pScreen, format, ndef, pdef); - break; - } - format++; - } - } -} - -static int -visualDepth (ScreenPtr pScreen, VisualPtr pVisual) -{ - int d, v; - DepthPtr pDepth; - - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = &pScreen->allowedDepths[d]; - for (v = 0; v < pDepth->numVids; v++) - if (pDepth->vids[v] == pVisual->vid) - return pDepth->depth; - } - return 0; -} - -typedef struct _formatInit { - CARD32 format; - CARD8 depth; -} FormatInitRec, *FormatInitPtr; - -static int -addFormat (FormatInitRec formats[256], - int nformat, - CARD32 format, - CARD8 depth) -{ - int n; - - for (n = 0; n < nformat; n++) - if (formats[n].format == format && formats[n].depth == depth) - return nformat; - formats[nformat].format = format; - formats[nformat].depth = depth; - return ++nformat; -} - -#define Mask(n) ((n) == 32 ? 0xffffffff : ((1 << (n))-1)) - -PictFormatPtr -PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) -{ - int nformats, f; - PictFormatPtr pFormats; - FormatInitRec formats[1024]; - CARD32 format; - CARD8 depth; - VisualPtr pVisual; - int v; - int bpp; - int type; - int r, g, b; - int d; - DepthPtr pDepth; - - nformats = 0; - /* formats required by protocol */ - formats[nformats].format = PICT_a1; - formats[nformats].depth = 1; - nformats++; - formats[nformats].format = PICT_a8; - formats[nformats].depth = 8; - nformats++; - formats[nformats].format = PICT_a4; - formats[nformats].depth = 4; - nformats++; - formats[nformats].format = PICT_a8r8g8b8; - formats[nformats].depth = 32; - nformats++; - formats[nformats].format = PICT_x8r8g8b8; - formats[nformats].depth = 32; - nformats++; - - /* now look through the depths and visuals adding other formats */ - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = &pScreen->visuals[v]; - depth = visualDepth (pScreen, pVisual); - if (!depth) - continue; - bpp = BitsPerPixel (depth); - switch (pVisual->class) { - case DirectColor: - case TrueColor: - r = Ones (pVisual->redMask); - g = Ones (pVisual->greenMask); - b = Ones (pVisual->blueMask); - type = PICT_TYPE_OTHER; - /* - * Current rendering code supports only two direct formats, - * fields must be packed together at the bottom of the pixel - * and must be either RGB or BGR - */ - if (pVisual->offsetBlue == 0 && - pVisual->offsetGreen == b && - pVisual->offsetRed == b + g) - { - type = PICT_TYPE_ARGB; - } - else if (pVisual->offsetRed == 0 && - pVisual->offsetGreen == r && - pVisual->offsetBlue == r + g) - { - type = PICT_TYPE_ABGR; - } - if (type != PICT_TYPE_OTHER) - { - format = PICT_FORMAT(bpp, type, 0, r, g, b); - nformats = addFormat (formats, nformats, format, depth); - } - break; - case StaticColor: - case PseudoColor: - format = PICT_VISFORMAT (bpp, PICT_TYPE_COLOR, v); - nformats = addFormat (formats, nformats, format, depth); - break; - case StaticGray: - case GrayScale: - format = PICT_VISFORMAT (bpp, PICT_TYPE_GRAY, v); - nformats = addFormat (formats, nformats, format, depth); - break; - } - } - /* - * Walk supported depths and add useful Direct formats - */ - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = &pScreen->allowedDepths[d]; - bpp = BitsPerPixel (pDepth->depth); - format = 0; - switch (bpp) { - case 16: - /* depth 12 formats */ - if (pDepth->depth >= 12) - { - nformats = addFormat (formats, nformats, - PICT_x4r4g4b4, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x4b4g4r4, pDepth->depth); - } - /* depth 15 formats */ - if (pDepth->depth >= 15) - { - nformats = addFormat (formats, nformats, - PICT_x1r5g5b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x1b5g5r5, pDepth->depth); - } - /* depth 16 formats */ - if (pDepth->depth >= 16) - { - nformats = addFormat (formats, nformats, - PICT_a1r5g5b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a1b5g5r5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_r5g6b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_b5g6r5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a4r4g4b4, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a4b4g4r4, pDepth->depth); - } - break; - case 24: - if (pDepth->depth >= 24) - { - nformats = addFormat (formats, nformats, - PICT_r8g8b8, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_b8g8r8, pDepth->depth); - } - break; - case 32: - if (pDepth->depth >= 24) - { - nformats = addFormat (formats, nformats, - PICT_x8r8g8b8, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x8b8g8r8, pDepth->depth); - } - break; - } - } - - - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); - if (!pFormats) - return 0; - memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); - for (f = 0; f < nformats; f++) - { - pFormats[f].id = FakeClientID (0); - pFormats[f].depth = formats[f].depth; - format = formats[f].format; - pFormats[f].format = format; - switch (PICT_FORMAT_TYPE(format)) { - case PICT_TYPE_ARGB: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - if (pFormats[f].direct.alphaMask) - pFormats[f].direct.alpha = (PICT_FORMAT_R(format) + - PICT_FORMAT_G(format) + - PICT_FORMAT_B(format)); - - pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format)); - pFormats[f].direct.red = (PICT_FORMAT_G(format) + - PICT_FORMAT_B(format)); - - pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format)); - pFormats[f].direct.green = PICT_FORMAT_B(format); - - pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format)); - pFormats[f].direct.blue = 0; - break; - - case PICT_TYPE_ABGR: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - if (pFormats[f].direct.alphaMask) - pFormats[f].direct.alpha = (PICT_FORMAT_B(format) + - PICT_FORMAT_G(format) + - PICT_FORMAT_R(format)); - - pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format)); - pFormats[f].direct.blue = (PICT_FORMAT_G(format) + - PICT_FORMAT_R(format)); - - pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format)); - pFormats[f].direct.green = PICT_FORMAT_R(format); - - pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format)); - pFormats[f].direct.red = 0; - break; - - case PICT_TYPE_A: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alpha = 0; - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - - /* remaining fields already set to zero */ - break; - - case PICT_TYPE_COLOR: - case PICT_TYPE_GRAY: - pFormats[f].type = PictTypeIndexed; - pFormats[f].index.pVisual = &pScreen->visuals[PICT_FORMAT_VIS(format)]; - break; - } - } - *nformatp = nformats; - return pFormats; -} - -Bool -PictureInitIndexedFormats (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - - if (!ps) - return FALSE; - format = ps->formats; - nformat = ps->nformats; - while (nformat--) - { - if (format->type == PictTypeIndexed && !format->index.pColormap) - { - if (format->index.pVisual->vid == pScreen->rootVisual) - format->index.pColormap = (ColormapPtr) LookupIDByType(pScreen->defColormap, - RT_COLORMAP); - else - { - if (CreateColormap (FakeClientID (0), pScreen, - format->index.pVisual, - &format->index.pColormap, AllocNone, - 0) != Success) - { - return FALSE; - } - } - if (!(*ps->InitIndexed) (pScreen, format)) - return FALSE; - } - format++; - } - return TRUE; -} - -Bool -PictureFinishInit (void) -{ - int s; - - for (s = 0; s < screenInfo.numScreens; s++) - { - if (!PictureInitIndexedFormats (screenInfo.screens[s])) - return FALSE; - (void) AnimCurInit (screenInfo.screens[s]); - } - - return TRUE; -} - -Bool -PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - if (!ps) - return FALSE; - ps->subpixel = subpixel; - return TRUE; - -} - -int -PictureGetSubpixelOrder (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - if (!ps) - return SubPixelUnknown; - return ps->subpixel; -} - -PictFormatPtr -PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - int type; - - if (!ps) - return 0; - format = ps->formats; - nformat = ps->nformats; - switch (pVisual->class) { - case StaticGray: - case GrayScale: - case StaticColor: - case PseudoColor: - type = PictTypeIndexed; - break; - case TrueColor: - type = PictTypeDirect; - break; - case DirectColor: - default: - return 0; - } - while (nformat--) - { - if (format->depth == depth && format->type == type) - { - if (type == PictTypeIndexed) - { - if (format->index.pVisual == pVisual) - return format; - } - else - { - if (format->direct.redMask << format->direct.red == - pVisual->redMask && - format->direct.greenMask << format->direct.green == - pVisual->greenMask && - format->direct.blueMask << format->direct.blue == - pVisual->blueMask) - { - return format; - } - } - } - format++; - } - return 0; -} - -PictFormatPtr -PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 f) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - - if (!ps) - return 0; - format = ps->formats; - nformat = ps->nformats; - while (nformat--) - { - if (format->depth == depth && format->format == (f & 0xffffff)) - return format; - format++; - } - return 0; -} - -int -PictureParseCmapPolicy (const char *name) -{ - if ( strcmp (name, "default" ) == 0) - return PictureCmapPolicyDefault; - else if ( strcmp (name, "mono" ) == 0) - return PictureCmapPolicyMono; - else if ( strcmp (name, "gray" ) == 0) - return PictureCmapPolicyGray; - else if ( strcmp (name, "color" ) == 0) - return PictureCmapPolicyColor; - else if ( strcmp (name, "all" ) == 0) - return PictureCmapPolicyAll; - else - return PictureCmapPolicyInvalid; -} - -Bool -PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) -{ - PictureScreenPtr ps; - int n; - CARD32 type, a, r, g, b; - - if (PictureGeneration != serverGeneration) - { - PictureType = CreateNewResourceType (FreePicture); - if (!PictureType) - return FALSE; - PictFormatType = CreateNewResourceType (FreePictFormat); - if (!PictFormatType) - return FALSE; - GlyphSetType = CreateNewResourceType (FreeGlyphSet); - if (!GlyphSetType) - return FALSE; - PictureScreenPrivateIndex = AllocateScreenPrivateIndex(); - if (PictureScreenPrivateIndex < 0) - return FALSE; - PictureWindowPrivateIndex = AllocateWindowPrivateIndex(); - PictureGeneration = serverGeneration; -#ifdef XResExtension - RegisterResourceName (PictureType, "PICTURE"); - RegisterResourceName (PictFormatType, "PICTFORMAT"); - RegisterResourceName (GlyphSetType, "GLYPHSET"); -#endif - } - if (!AllocateWindowPrivate (pScreen, PictureWindowPrivateIndex, 0)) - return FALSE; - - if (!formats) - { - formats = PictureCreateDefaultFormats (pScreen, &nformats); - if (!formats) - return FALSE; - } - for (n = 0; n < nformats; n++) - { - if (!AddResource (formats[n].id, PictFormatType, (pointer) (formats+n))) - { - xfree (formats); - return FALSE; - } - if (formats[n].type == PictTypeIndexed) - { - if ((formats[n].index.pVisual->class | DynamicClass) == PseudoColor) - type = PICT_TYPE_COLOR; - else - type = PICT_TYPE_GRAY; - a = r = g = b = 0; - } - else - { - if ((formats[n].direct.redMask| - formats[n].direct.blueMask| - formats[n].direct.greenMask) == 0) - type = PICT_TYPE_A; - else if (formats[n].direct.red > formats[n].direct.blue) - type = PICT_TYPE_ARGB; - else - type = PICT_TYPE_ABGR; - a = Ones (formats[n].direct.alphaMask); - r = Ones (formats[n].direct.redMask); - g = Ones (formats[n].direct.greenMask); - b = Ones (formats[n].direct.blueMask); - } - formats[n].format = PICT_FORMAT(0,type,a,r,g,b); - } - ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec)); - if (!ps) - { - xfree (formats); - return FALSE; - } - SetPictureScreen(pScreen, ps); - if (!GlyphInit (pScreen)) - { - SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); - return FALSE; - } - - ps->totalPictureSize = sizeof (PictureRec); - ps->PicturePrivateSizes = 0; - ps->PicturePrivateLen = 0; - - ps->formats = formats; - ps->fallback = formats; - ps->nformats = nformats; - - ps->filters = 0; - ps->nfilters = 0; - ps->filterAliases = 0; - ps->nfilterAliases = 0; - - ps->subpixel = SubPixelUnknown; - - ps->CloseScreen = pScreen->CloseScreen; - ps->DestroyWindow = pScreen->DestroyWindow; - ps->StoreColors = pScreen->StoreColors; - pScreen->DestroyWindow = PictureDestroyWindow; - pScreen->CloseScreen = PictureCloseScreen; - pScreen->StoreColors = PictureStoreColors; - - if (!PictureSetDefaultFilters (pScreen)) - { - PictureResetFilters (pScreen); - SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); - return FALSE; - } - - return TRUE; -} - -void -SetPictureToDefaults (PicturePtr pPicture) -{ - pPicture->refcnt = 1; - pPicture->repeat = 0; - pPicture->graphicsExposures = FALSE; - pPicture->subWindowMode = ClipByChildren; - pPicture->polyEdge = PolyEdgeSharp; - pPicture->polyMode = PolyModePrecise; - pPicture->freeCompClip = FALSE; - pPicture->clientClipType = CT_NONE; - pPicture->componentAlpha = FALSE; - - pPicture->alphaMap = 0; - pPicture->alphaOrigin.x = 0; - pPicture->alphaOrigin.y = 0; - - pPicture->clipOrigin.x = 0; - pPicture->clipOrigin.y = 0; - pPicture->clientClip = 0; - - pPicture->transform = 0; - - pPicture->dither = None; - pPicture->filter = PictureGetFilterId (FilterNearest, -1, TRUE); - pPicture->filter_params = 0; - pPicture->filter_nparams = 0; - - pPicture->serialNumber = GC_CHANGE_SERIAL_BIT; - pPicture->stateChanges = (1 << (CPLastBit+1)) - 1; -} - -PicturePtr -AllocatePicture (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - PicturePtr pPicture; - char *ptr; - DevUnion *ppriv; - unsigned int *sizes; - unsigned int size; - int i; - - pPicture = (PicturePtr) xalloc (ps->totalPictureSize); - if (!pPicture) - return 0; - ppriv = (DevUnion *)(pPicture + 1); - pPicture->devPrivates = ppriv; - sizes = ps->PicturePrivateSizes; - ptr = (char *)(ppriv + ps->PicturePrivateLen); - for (i = ps->PicturePrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - return pPicture; -} - -PicturePtr -CreatePicture (Picture pid, - DrawablePtr pDrawable, - PictFormatPtr pFormat, - Mask vmask, - XID *vlist, - ClientPtr client, - int *error) -{ - PicturePtr pPicture; - PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen); - - pPicture = AllocatePicture (pDrawable->pScreen); - if (!pPicture) - { - *error = BadAlloc; - return 0; - } - - pPicture->id = pid; - pPicture->pDrawable = pDrawable; - pPicture->pFormat = pFormat; - pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24); - if (pDrawable->type == DRAWABLE_PIXMAP) - { - ++((PixmapPtr)pDrawable)->refcnt; - pPicture->pNext = 0; - } - else - { - pPicture->pNext = GetPictureWindow(((WindowPtr) pDrawable)); - SetPictureWindow(((WindowPtr) pDrawable), pPicture); - } - - SetPictureToDefaults (pPicture); - - if (vmask) - *error = ChangePicture (pPicture, vmask, vlist, 0, client); - else - *error = Success; - if (*error == Success) - *error = (*ps->CreatePicture) (pPicture); - if (*error != Success) - { - FreePicture (pPicture, (XID) 0); - pPicture = 0; - } - return pPicture; -} - -#define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val) - -#define NEXT_PTR(_type) ((_type) ulist++->ptr) - -int -ChangePicture (PicturePtr pPicture, - Mask vmask, - XID *vlist, - DevUnion *ulist, - ClientPtr client) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - BITS32 index2; - int error = 0; - BITS32 maskQ; - - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - maskQ = vmask; - while (vmask && !error) - { - index2 = (BITS32) lowbit (vmask); - vmask &= ~index2; - pPicture->stateChanges |= index2; - switch (index2) - { - case CPRepeat: - { - unsigned int newr; - newr = NEXT_VAL(unsigned int); - if (newr <= xTrue) - pPicture->repeat = newr; - else - { - client->errorValue = newr; - error = BadValue; - } - } - break; - case CPAlphaMap: - { - PicturePtr pAlpha; - - if (vlist) - { - Picture pid = NEXT_VAL(Picture); - - if (pid == None) - pAlpha = 0; - else - { - pAlpha = (PicturePtr) SecurityLookupIDByType(client, - pid, - PictureType, - SecurityWriteAccess|SecurityReadAccess); - if (!pAlpha) - { - client->errorValue = pid; - error = BadPixmap; - break; - } - if (pAlpha->pDrawable->type != DRAWABLE_PIXMAP) - { - client->errorValue = pid; - error = BadMatch; - break; - } - } - } - else - pAlpha = NEXT_PTR(PicturePtr); - if (!error) - { - if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP) - pAlpha->refcnt++; - if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); - pPicture->alphaMap = pAlpha; - } - } - break; - case CPAlphaXOrigin: - pPicture->alphaOrigin.x = NEXT_VAL(INT16); - break; - case CPAlphaYOrigin: - pPicture->alphaOrigin.y = NEXT_VAL(INT16); - break; - case CPClipXOrigin: - pPicture->clipOrigin.x = NEXT_VAL(INT16); - break; - case CPClipYOrigin: - pPicture->clipOrigin.y = NEXT_VAL(INT16); - break; - case CPClipMask: - { - Pixmap pid; - PixmapPtr pPixmap; - int clipType; - - if (vlist) - { - pid = NEXT_VAL(Pixmap); - if (pid == None) - { - clipType = CT_NONE; - pPixmap = NullPixmap; - } - else - { - clipType = CT_PIXMAP; - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - pid, - RT_PIXMAP, - SecurityReadAccess); - if (!pPixmap) - { - client->errorValue = pid; - error = BadPixmap; - break; - } - } - } - else - { - pPixmap = NEXT_PTR(PixmapPtr); - if (pPixmap) - clipType = CT_PIXMAP; - else - clipType = CT_NONE; - } - - if (pPixmap) - { - if ((pPixmap->drawable.depth != 1) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - break; - } - else - { - clipType = CT_PIXMAP; - pPixmap->refcnt++; - } - } - error = (*ps->ChangePictureClip)(pPicture, clipType, - (pointer)pPixmap, 0); - break; - } - case CPGraphicsExposure: - { - unsigned int newe; - newe = NEXT_VAL(unsigned int); - if (newe <= xTrue) - pPicture->graphicsExposures = newe; - else - { - client->errorValue = newe; - error = BadValue; - } - } - break; - case CPSubwindowMode: - { - unsigned int news; - news = NEXT_VAL(unsigned int); - if (news == ClipByChildren || news == IncludeInferiors) - pPicture->subWindowMode = news; - else - { - client->errorValue = news; - error = BadValue; - } - } - break; - case CPPolyEdge: - { - unsigned int newe; - newe = NEXT_VAL(unsigned int); - if (newe == PolyEdgeSharp || newe == PolyEdgeSmooth) - pPicture->polyEdge = newe; - else - { - client->errorValue = newe; - error = BadValue; - } - } - break; - case CPPolyMode: - { - unsigned int newm; - newm = NEXT_VAL(unsigned int); - if (newm == PolyModePrecise || newm == PolyModeImprecise) - pPicture->polyMode = newm; - else - { - client->errorValue = newm; - error = BadValue; - } - } - break; - case CPDither: - pPicture->dither = NEXT_VAL(Atom); - break; - case CPComponentAlpha: - { - unsigned int newca; - - newca = NEXT_VAL (unsigned int); - if (newca <= xTrue) - pPicture->componentAlpha = newca; - else - { - client->errorValue = newca; - error = BadValue; - } - } - break; - default: - client->errorValue = maskQ; - error = BadValue; - break; - } - } - (*ps->ChangePicture) (pPicture, maskQ); - return error; -} - -int -SetPictureClipRects (PicturePtr pPicture, - int xOrigin, - int yOrigin, - int nRect, - xRectangle *rects) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - RegionPtr clientClip; - int result; - - clientClip = RECTS_TO_REGION(pScreen, - nRect, rects, CT_UNSORTED); - if (!clientClip) - return BadAlloc; - result =(*ps->ChangePictureClip) (pPicture, CT_REGION, - (pointer) clientClip, 0); - if (result == Success) - { - pPicture->clipOrigin.x = xOrigin; - pPicture->clipOrigin.y = yOrigin; - pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask; - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - } - return result; -} - -int -SetPictureTransform (PicturePtr pPicture, - PictTransform *transform) -{ - static const PictTransform identity = { { - { xFixed1, 0x00000, 0x00000 }, - { 0x00000, xFixed1, 0x00000 }, - { 0x00000, 0x00000, xFixed1 }, - } }; - - if (transform && memcmp (transform, &identity, sizeof (PictTransform)) == 0) - transform = 0; - - if (transform) - { - if (!pPicture->transform) - { - pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform)); - if (!pPicture->transform) - return BadAlloc; - } - *pPicture->transform = *transform; - } - else - { - if (pPicture->transform) - { - xfree (pPicture->transform); - pPicture->transform = 0; - } - } - return Success; -} - -static void -ValidateOnePicture (PicturePtr pPicture) -{ - if (pPicture->serialNumber != pPicture->pDrawable->serialNumber) - { - PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen); - - (*ps->ValidatePicture) (pPicture, pPicture->stateChanges); - pPicture->stateChanges = 0; - pPicture->serialNumber = pPicture->pDrawable->serialNumber; - } -} - -void -ValidatePicture(PicturePtr pPicture) -{ - ValidateOnePicture (pPicture); - if (pPicture->alphaMap) - ValidateOnePicture (pPicture->alphaMap); -} - -int -FreePicture (pointer value, - XID pid) -{ - PicturePtr pPicture = (PicturePtr) value; - - if (--pPicture->refcnt == 0) - { - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); - (*ps->DestroyPicture) (pPicture); - (*ps->DestroyPictureClip) (pPicture); - if (pPicture->transform) - xfree (pPicture->transform); - if (pPicture->pDrawable->type == DRAWABLE_WINDOW) - { - WindowPtr pWindow = (WindowPtr) pPicture->pDrawable; - PicturePtr *pPrev; - - for (pPrev = (PicturePtr *) &((pWindow)->devPrivates[PictureWindowPrivateIndex].ptr); - *pPrev; - pPrev = &(*pPrev)->pNext) - { - if (*pPrev == pPicture) - { - *pPrev = pPicture->pNext; - break; - } - } - } - else if (pPicture->pDrawable->type == DRAWABLE_PIXMAP) - { - (*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable); - } - xfree (pPicture); - } - return Success; -} - -int -FreePictFormat (pointer pPictFormat, - XID pid) -{ - return Success; -} - -void -CompositePicture (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - if (pMask) - ValidatePicture (pMask); - ValidatePicture (pDst); - (*ps->Composite) (op, - pSrc, - pMask, - pDst, - xSrc, - ySrc, - xMask, - yMask, - xDst, - yDst, - width, - height); -} - -void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr lists, - GlyphPtr *glyphs) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs); -} - -void -CompositeRects (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pDst); - (*ps->CompositeRects) (op, pDst, color, nRect, rects); -} - -void -CompositeTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Trapezoids) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps); -} - -void -CompositeTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntriangles, - xTriangle *triangles) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntriangles, triangles); -} - -void -CompositeTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); -} - -void -CompositeTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); -} - -typedef xFixed_32_32 xFixed_48_16; - -#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff) -#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31)) - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - for (j = 0; j < 2; j++) - { - partial = (xFixed_48_16) result.vector[j] << 16; - v = partial / result.vector[2]; - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - vector->vector[j] = (xFixed) v; - } - vector->vector[2] = xFixed1; - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original deleted file mode 100644 index 91eab0125..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original +++ /dev/null @@ -1,533 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXpicturestr.h" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/picturestr.h,v 1.22 2002/11/23 02:38:15 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -/* - * This must keep the same symbol as the original - * picturestr.h or symbols will be redefined. We - * should define a new types and cast when appro- - * priate. - */ - -#ifndef _PICTURESTR_H_ -#define _PICTURESTR_H_ - -#include "NXglyphstr.h" -#include "scrnintstr.h" -#include "resource.h" - -typedef struct _DirectFormat { - CARD16 red, redMask; - CARD16 green, greenMask; - CARD16 blue, blueMask; - CARD16 alpha, alphaMask; -} DirectFormatRec; - -typedef struct _IndexFormat { - VisualPtr pVisual; - ColormapPtr pColormap; - int nvalues; - xIndexValue *pValues; - void *devPrivate; -} IndexFormatRec; - -typedef struct _PictFormat { - CARD32 id; - CARD32 format; /* except bpp */ - unsigned char type; - unsigned char depth; - DirectFormatRec direct; - IndexFormatRec index; -} PictFormatRec; - -typedef struct _PictVector { - xFixed vector[3]; -} PictVector, *PictVectorPtr; - -typedef struct _PictTransform { - xFixed matrix[3][3]; -} PictTransform, *PictTransformPtr; - -typedef struct _Picture { - DrawablePtr pDrawable; - PictFormatPtr pFormat; - CARD32 format; /* PICT_FORMAT */ - int refcnt; - CARD32 id; - PicturePtr pNext; /* chain on same drawable */ - - unsigned int repeat : 1; - unsigned int graphicsExposures : 1; - unsigned int subWindowMode : 1; - unsigned int polyEdge : 1; - unsigned int polyMode : 1; - unsigned int freeCompClip : 1; - unsigned int clientClipType : 2; - unsigned int componentAlpha : 1; - unsigned int unused : 23; - - PicturePtr alphaMap; - DDXPointRec alphaOrigin; - - DDXPointRec clipOrigin; - pointer clientClip; - - Atom dither; - - unsigned long stateChanges; - unsigned long serialNumber; - - RegionPtr pCompositeClip; - - DevUnion *devPrivates; - - PictTransform *transform; - - int filter; - xFixed *filter_params; - int filter_nparams; -} PictureRec; - -typedef struct { - char *name; - xFixed *params; - int nparams; - int id; -} PictFilterRec, *PictFilterPtr; - -#define PictFilterNearest 0 -#define PictFilterBilinear 1 - -#define PictFilterFast 2 -#define PictFilterGood 3 -#define PictFilterBest 4 - -typedef struct { - char *alias; - int alias_id; - int filter_id; -} PictFilterAliasRec, *PictFilterAliasPtr; - -typedef int (*CreatePictureProcPtr) (PicturePtr pPicture); -typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture); -typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture, - int clipType, - pointer value, - int n); -typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture); - -typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture, - PictTransform *transform); - -typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture, - int filter, - xFixed *params, - int nparams); - -typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture); - -typedef void (*ChangePictureProcPtr) (PicturePtr pPicture, - Mask mask); -typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture, - Mask mask); -typedef void (*CompositeProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -typedef void (*GlyphsProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlists, - GlyphListPtr lists, - GlyphPtr *glyphs); - -typedef void (*CompositeRectsProcPtr) (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects); - -typedef void (*RasterizeTrapezoidProcPtr)(PicturePtr pMask, - xTrapezoid *trap, - int x_off, - int y_off); - -typedef void (*TrapezoidsProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps); - -typedef void (*TrianglesProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntri, - xTriangle *tris); - -typedef void (*TriStripProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -typedef void (*TriFanProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat); - -typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat); - -typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat, - int ndef, - xColorItem *pdef); - -typedef struct _PictureScreen { - int totalPictureSize; - unsigned int *PicturePrivateSizes; - int PicturePrivateLen; - - PictFormatPtr formats; - PictFormatPtr fallback; - int nformats; - - CreatePictureProcPtr CreatePicture; - DestroyPictureProcPtr DestroyPicture; - ChangePictureClipProcPtr ChangePictureClip; - DestroyPictureClipProcPtr DestroyPictureClip; - - ChangePictureProcPtr ChangePicture; - ValidatePictureProcPtr ValidatePicture; - - CompositeProcPtr Composite; - GlyphsProcPtr Glyphs; - CompositeRectsProcPtr CompositeRects; - - DestroyWindowProcPtr DestroyWindow; - CloseScreenProcPtr CloseScreen; - - StoreColorsProcPtr StoreColors; - - InitIndexedProcPtr InitIndexed; - CloseIndexedProcPtr CloseIndexed; - UpdateIndexedProcPtr UpdateIndexed; - - int subpixel; - - PictFilterPtr filters; - int nfilters; - PictFilterAliasPtr filterAliases; - int nfilterAliases; - - ChangePictureTransformProcPtr ChangePictureTransform; - ChangePictureFilterProcPtr ChangePictureFilter; - DestroyPictureFilterProcPtr DestroyPictureFilter; - - TrapezoidsProcPtr Trapezoids; - TrianglesProcPtr Triangles; - TriStripProcPtr TriStrip; - TriFanProcPtr TriFan; - - RasterizeTrapezoidProcPtr RasterizeTrapezoid; -} PictureScreenRec, *PictureScreenPtr; - -extern int PictureScreenPrivateIndex; -extern int PictureWindowPrivateIndex; -extern RESTYPE PictureType; -extern RESTYPE PictFormatType; -extern RESTYPE GlyphSetType; - -#define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr)) -#define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL) -#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p)) -#define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr)) -#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p)) - -#define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\ - pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\ - if (!pPicture) { \ - client->errorValue = pid; \ - return err; \ - } \ -} - -#define VERIFY_ALPHA(pPicture, pid, client, mode, err) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_PICTURE(pPicture, pid, client, mode, err); \ - } \ -} \ - -Bool -PictureDestroyWindow (WindowPtr pWindow); - -Bool -PictureCloseScreen (int Index, ScreenPtr pScreen); - -void -PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef); - -Bool -PictureInitIndexedFormats (ScreenPtr pScreen); - -Bool -PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel); - -int -PictureGetSubpixelOrder (ScreenPtr pScreen); - -PictFormatPtr -PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp); - -PictFormatPtr -PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual); - -PictFormatPtr -PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format); - -Bool -PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); - -int -PictureGetFilterId (char *filter, int len, Bool makeit); - -char * -PictureGetFilterName (int id); - -int -PictureAddFilter (ScreenPtr pScreen, char *filter, xFixed *params, int nparams); - -Bool -PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias); - -Bool -PictureSetDefaultFilters (ScreenPtr pScreen); - -void -PictureResetFilters (ScreenPtr pScreen); - -PictFilterPtr -PictureFindFilter (ScreenPtr pScreen, char *name, int len); - -int -SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams); - -Bool -PictureFinishInit (void); - -void -SetPictureToDefaults (PicturePtr pPicture); - -PicturePtr -AllocatePicture (ScreenPtr pScreen); - -#if 0 -Bool -miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); -#endif - - -PicturePtr -CreatePicture (Picture pid, - DrawablePtr pDrawable, - PictFormatPtr pFormat, - Mask mask, - XID *list, - ClientPtr client, - int *error); - -int -ChangePicture (PicturePtr pPicture, - Mask vmask, - XID *vlist, - DevUnion *ulist, - ClientPtr client); - -int -SetPictureClipRects (PicturePtr pPicture, - int xOrigin, - int yOrigin, - int nRect, - xRectangle *rects); - -int -SetPictureTransform (PicturePtr pPicture, - PictTransform *transform); - -void -ValidatePicture(PicturePtr pPicture); - -int -FreePicture (pointer pPicture, - XID pid); - -int -FreePictFormat (pointer pPictFormat, - XID pid); - -void -CompositePicture (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr lists, - GlyphPtr *glyphs); - -void -CompositeRects (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects); - -void -CompositeTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps); - -void -CompositeTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntriangles, - xTriangle *triangles); - -void -CompositeTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points); - -void -CompositeTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points); - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector); - -void RenderExtensionInit (void); - -Bool -AnimCurInit (ScreenPtr pScreen); - -int -AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor); - -#ifdef PANORAMIX -void PanoramiXRenderInit (void); -void PanoramiXRenderReset (void); -#endif - -#endif /* _PICTURESTR_H_ */ - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.XF86.original deleted file mode 100644 index cb5ea0ac9..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.XF86.original +++ /dev/null @@ -1,501 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/picturestr.h,v 1.22 2002/11/23 02:38:15 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifndef _PICTURESTR_H_ -#define _PICTURESTR_H_ - -#include "glyphstr.h" -#include "scrnintstr.h" -#include "resource.h" - -typedef struct _DirectFormat { - CARD16 red, redMask; - CARD16 green, greenMask; - CARD16 blue, blueMask; - CARD16 alpha, alphaMask; -} DirectFormatRec; - -typedef struct _IndexFormat { - VisualPtr pVisual; - ColormapPtr pColormap; - int nvalues; - xIndexValue *pValues; - void *devPrivate; -} IndexFormatRec; - -typedef struct _PictFormat { - CARD32 id; - CARD32 format; /* except bpp */ - unsigned char type; - unsigned char depth; - DirectFormatRec direct; - IndexFormatRec index; -} PictFormatRec; - -typedef struct _PictVector { - xFixed vector[3]; -} PictVector, *PictVectorPtr; - -typedef struct _PictTransform { - xFixed matrix[3][3]; -} PictTransform, *PictTransformPtr; - -typedef struct _Picture { - DrawablePtr pDrawable; - PictFormatPtr pFormat; - CARD32 format; /* PICT_FORMAT */ - int refcnt; - CARD32 id; - PicturePtr pNext; /* chain on same drawable */ - - unsigned int repeat : 1; - unsigned int graphicsExposures : 1; - unsigned int subWindowMode : 1; - unsigned int polyEdge : 1; - unsigned int polyMode : 1; - unsigned int freeCompClip : 1; - unsigned int clientClipType : 2; - unsigned int componentAlpha : 1; - unsigned int unused : 23; - - PicturePtr alphaMap; - DDXPointRec alphaOrigin; - - DDXPointRec clipOrigin; - pointer clientClip; - - Atom dither; - - unsigned long stateChanges; - unsigned long serialNumber; - - RegionPtr pCompositeClip; - - DevUnion *devPrivates; - - PictTransform *transform; - - int filter; - xFixed *filter_params; - int filter_nparams; -} PictureRec; - -typedef struct { - char *name; - xFixed *params; - int nparams; - int id; -} PictFilterRec, *PictFilterPtr; - -#define PictFilterNearest 0 -#define PictFilterBilinear 1 - -#define PictFilterFast 2 -#define PictFilterGood 3 -#define PictFilterBest 4 - -typedef struct { - char *alias; - int alias_id; - int filter_id; -} PictFilterAliasRec, *PictFilterAliasPtr; - -typedef int (*CreatePictureProcPtr) (PicturePtr pPicture); -typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture); -typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture, - int clipType, - pointer value, - int n); -typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture); - -typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture, - PictTransform *transform); - -typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture, - int filter, - xFixed *params, - int nparams); - -typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture); - -typedef void (*ChangePictureProcPtr) (PicturePtr pPicture, - Mask mask); -typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture, - Mask mask); -typedef void (*CompositeProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -typedef void (*GlyphsProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlists, - GlyphListPtr lists, - GlyphPtr *glyphs); - -typedef void (*CompositeRectsProcPtr) (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects); - -typedef void (*RasterizeTrapezoidProcPtr)(PicturePtr pMask, - xTrapezoid *trap, - int x_off, - int y_off); - -typedef void (*TrapezoidsProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps); - -typedef void (*TrianglesProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntri, - xTriangle *tris); - -typedef void (*TriStripProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -typedef void (*TriFanProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat); - -typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat); - -typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat, - int ndef, - xColorItem *pdef); - -typedef struct _PictureScreen { - int totalPictureSize; - unsigned int *PicturePrivateSizes; - int PicturePrivateLen; - - PictFormatPtr formats; - PictFormatPtr fallback; - int nformats; - - CreatePictureProcPtr CreatePicture; - DestroyPictureProcPtr DestroyPicture; - ChangePictureClipProcPtr ChangePictureClip; - DestroyPictureClipProcPtr DestroyPictureClip; - - ChangePictureProcPtr ChangePicture; - ValidatePictureProcPtr ValidatePicture; - - CompositeProcPtr Composite; - GlyphsProcPtr Glyphs; - CompositeRectsProcPtr CompositeRects; - - DestroyWindowProcPtr DestroyWindow; - CloseScreenProcPtr CloseScreen; - - StoreColorsProcPtr StoreColors; - - InitIndexedProcPtr InitIndexed; - CloseIndexedProcPtr CloseIndexed; - UpdateIndexedProcPtr UpdateIndexed; - - int subpixel; - - PictFilterPtr filters; - int nfilters; - PictFilterAliasPtr filterAliases; - int nfilterAliases; - - ChangePictureTransformProcPtr ChangePictureTransform; - ChangePictureFilterProcPtr ChangePictureFilter; - DestroyPictureFilterProcPtr DestroyPictureFilter; - - TrapezoidsProcPtr Trapezoids; - TrianglesProcPtr Triangles; - TriStripProcPtr TriStrip; - TriFanProcPtr TriFan; - - RasterizeTrapezoidProcPtr RasterizeTrapezoid; -} PictureScreenRec, *PictureScreenPtr; - -extern int PictureScreenPrivateIndex; -extern int PictureWindowPrivateIndex; -extern RESTYPE PictureType; -extern RESTYPE PictFormatType; -extern RESTYPE GlyphSetType; - -#define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr)) -#define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL) -#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p)) -#define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr)) -#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p)) - -#define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\ - pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\ - if (!pPicture) { \ - client->errorValue = pid; \ - return err; \ - } \ -} - -#define VERIFY_ALPHA(pPicture, pid, client, mode, err) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_PICTURE(pPicture, pid, client, mode, err); \ - } \ -} \ - -Bool -PictureDestroyWindow (WindowPtr pWindow); - -Bool -PictureCloseScreen (int Index, ScreenPtr pScreen); - -void -PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef); - -Bool -PictureInitIndexedFormats (ScreenPtr pScreen); - -Bool -PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel); - -int -PictureGetSubpixelOrder (ScreenPtr pScreen); - -PictFormatPtr -PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp); - -PictFormatPtr -PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual); - -PictFormatPtr -PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format); - -Bool -PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); - -int -PictureGetFilterId (char *filter, int len, Bool makeit); - -char * -PictureGetFilterName (int id); - -int -PictureAddFilter (ScreenPtr pScreen, char *filter, xFixed *params, int nparams); - -Bool -PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias); - -Bool -PictureSetDefaultFilters (ScreenPtr pScreen); - -void -PictureResetFilters (ScreenPtr pScreen); - -PictFilterPtr -PictureFindFilter (ScreenPtr pScreen, char *name, int len); - -int -SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams); - -Bool -PictureFinishInit (void); - -void -SetPictureToDefaults (PicturePtr pPicture); - -PicturePtr -AllocatePicture (ScreenPtr pScreen); - -#if 0 -Bool -miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); -#endif - - -PicturePtr -CreatePicture (Picture pid, - DrawablePtr pDrawable, - PictFormatPtr pFormat, - Mask mask, - XID *list, - ClientPtr client, - int *error); - -int -ChangePicture (PicturePtr pPicture, - Mask vmask, - XID *vlist, - DevUnion *ulist, - ClientPtr client); - -int -SetPictureClipRects (PicturePtr pPicture, - int xOrigin, - int yOrigin, - int nRect, - xRectangle *rects); - -int -SetPictureTransform (PicturePtr pPicture, - PictTransform *transform); - -void -ValidatePicture(PicturePtr pPicture); - -int -FreePicture (pointer pPicture, - XID pid); - -int -FreePictFormat (pointer pPictFormat, - XID pid); - -void -CompositePicture (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr lists, - GlyphPtr *glyphs); - -void -CompositeRects (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects); - -void -CompositeTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps); - -void -CompositeTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntriangles, - xTriangle *triangles); - -void -CompositeTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points); - -void -CompositeTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points); - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector); - -void RenderExtensionInit (void); - -Bool -AnimCurInit (ScreenPtr pScreen); - -int -AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor); - -#ifdef PANORAMIX -void PanoramiXRenderInit (void); -void PanoramiXRenderReset (void); -#endif - -#endif /* _PICTURESTR_H_ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original deleted file mode 100644 index 20a6bd6dc..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original +++ /dev/null @@ -1,921 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXproperty.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: property.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" -#define NEED_REPLIES -#define NEED_EVENTS -#include "Xproto.h" -#include "windowstr.h" -#include "propertyst.h" -#include "dixstruct.h" -#include "../../dix/dispatch.h" -#include "swaprep.h" -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif -#ifdef LBX -#include "lbxserve.h" -#include "lbxtags.h" -#endif - -#include "Options.h" -#include "Rootless.h" -#include "Client.h" - -#if defined(LBX) || defined(LBX_COMPAT) -int fWriteToClient(client, len, buf) - ClientPtr client; - int len; - char *buf; -{ - return WriteToClient(client, len, buf); -} -#endif - -/***************************************************************** - * Property Stuff - * - * ChangeProperty, DeleteProperty, GetProperties, - * ListProperties - * - * Properties below to windows. A allocate slots each time - * a property is added. No fancy searching done. - * - *****************************************************************/ - -#ifdef notdef -static void -PrintPropertys(pWin) - WindowPtr pWin; -{ - PropertyPtr pProp; - register int j; - - pProp = pWin->userProps; - while (pProp) - { - ErrorF( "%x %x\n", pProp->propertyName, pProp->type); - ErrorF("property format: %d\n", pProp->format); - ErrorF("property data: \n"); - for (j=0; j<(pProp->format/8)*pProp->size; j++) - ErrorF("%c\n", pProp->data[j]); - pProp = pProp->next; - } -} -#endif - -int -ProcRotateProperties(client) - ClientPtr client; -{ - int i, j, delta; - REQUEST(xRotatePropertiesReq); - WindowPtr pWin; - register Atom * atoms; - PropertyPtr * props; /* array of pointer */ - PropertyPtr pProp; - xEvent event; - - REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2); - UpdateCurrentTime(); - pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!stuff->nAtoms) - return(Success); - atoms = (Atom *) & stuff[1]; - props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr)); - if (!props) - return(BadAlloc); - for (i = 0; i < stuff->nAtoms; i++) - { -#ifdef XCSECURITY - char action = SecurityCheckPropertyAccess(client, pWin, atoms[i], - SecurityReadAccess|SecurityWriteAccess); -#endif - if (!ValidAtom(atoms[i]) -#ifdef XCSECURITY - || (SecurityErrorOperation == action) -#endif - ) - { - DEALLOCATE_LOCAL(props); - client->errorValue = atoms[i]; - return BadAtom; - } -#ifdef XCSECURITY - if (SecurityIgnoreOperation == action) - { - DEALLOCATE_LOCAL(props); - return Success; - } -#endif - for (j = i + 1; j < stuff->nAtoms; j++) - if (atoms[j] == atoms[i]) - { - DEALLOCATE_LOCAL(props); - return BadMatch; - } - pProp = wUserProps (pWin); - while (pProp) - { - if (pProp->propertyName == atoms[i]) - goto found; - pProp = pProp->next; - } - DEALLOCATE_LOCAL(props); - return BadMatch; -found: - props[i] = pProp; - } - delta = stuff->nPositions; - - /* If the rotation is a complete 360 degrees, then moving the properties - around and generating PropertyNotify events should be skipped. */ - - if ( (stuff->nAtoms != 0) && (abs(delta) % stuff->nAtoms) != 0 ) - { - while (delta < 0) /* faster if abs value is small */ - delta += stuff->nAtoms; - for (i = 0; i < stuff->nAtoms; i++) - { - /* Generate a PropertyNotify event for each property whose value - is changed in the order in which they appear in the request. */ - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyNewValue; - event.u.property.atom = props[i]->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - - props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms]; - } - } - DEALLOCATE_LOCAL(props); - return Success; -} - -int -ProcChangeProperty(client) - ClientPtr client; -{ - WindowPtr pWin; - char format, mode; - unsigned long len; - int sizeInBytes; - int totalSize; - int err; - REQUEST(xChangePropertyReq); - - REQUEST_AT_LEAST_SIZE(xChangePropertyReq); - UpdateCurrentTime(); - format = stuff->format; - mode = stuff->mode; - if ((mode != PropModeReplace) && (mode != PropModeAppend) && - (mode != PropModePrepend)) - { - client->errorValue = mode; - return BadValue; - } - if ((format != 8) && (format != 16) && (format != 32)) - { - client->errorValue = format; - return BadValue; - } - len = stuff->nUnits; - if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2)) - return BadLength; - sizeInBytes = format>>3; - totalSize = len * sizeInBytes; - REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); - -#ifdef NXAGENT_CLIPBOARD - { - extern WindowPtr nxagentGetClipboardWindow(Atom, WindowPtr); - - pWin = nxagentGetClipboardWindow(stuff->property, NULL); - } - - if (pWin == NULL) -#endif - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return(BadAtom); - } - if (!ValidAtom(stuff->type)) - { - client->errorValue = stuff->type; - return(BadAtom); - } - -#ifdef XCSECURITY - switch (SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityWriteAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom; - case SecurityIgnoreOperation: - return Success; - } -#endif - -#ifdef NXAGENT_ARTSD - { - /* Do not process MCOPGLOBALS property changes, - they are already set reflecting the server side settings. - Just return success. - */ - extern Atom mcop_local_atom; - if (stuff->property == mcop_local_atom) - return client->noClientException; - } -#endif - -#ifdef LBX - err = LbxChangeWindowProperty(client, pWin, stuff->property, stuff->type, - (int)format, (int)mode, len, TRUE, (pointer)&stuff[1], TRUE, NULL); -#else - err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, - (int)mode, len, (pointer)&stuff[1], TRUE); -#endif - if (err != Success) - return err; - else - { - if (nxagentOption(Rootless) == 1) - { - nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format, - (int) mode, len, (pointer) &stuff[1]); - } - - nxagentGuessClientHint(client, stuff->property, (char *) &stuff[1]); - - nxagentGuessShadowHint(client, stuff->property); - - return client->noClientException; - } -} - -int -ChangeWindowProperty(pWin, property, type, format, mode, len, value, sendevent) - WindowPtr pWin; - Atom property, type; - int format, mode; - unsigned long len; - pointer value; - Bool sendevent; -{ -#ifdef LBX - return LbxChangeWindowProperty(NULL, pWin, property, type, - format, mode, len, TRUE, value, - sendevent, NULL); -#else - PropertyPtr pProp; - xEvent event; - int sizeInBytes; - int totalSize; - pointer data; - - sizeInBytes = format>>3; - totalSize = len * sizeInBytes; - - /* first see if property already exists */ - - pProp = wUserProps (pWin); - while (pProp) - { - if (pProp->propertyName == property) - break; - pProp = pProp->next; - } - if (!pProp) /* just add to list */ - { - if (!pWin->optional && !MakeWindowOptional (pWin)) - return(BadAlloc); - pProp = (PropertyPtr)xalloc(sizeof(PropertyRec)); - if (!pProp) - return(BadAlloc); - data = (pointer)xalloc(totalSize); - if (!data && len) - { - xfree(pProp); - return(BadAlloc); - } - pProp->propertyName = property; - pProp->type = type; - pProp->format = format; - pProp->data = data; - if (len) - memmove((char *)data, (char *)value, totalSize); - pProp->size = len; - pProp->next = pWin->optional->userProps; - pWin->optional->userProps = pProp; - } - else - { - /* To append or prepend to a property the request format and type - must match those of the already defined property. The - existing format and type are irrelevant when using the mode - "PropModeReplace" since they will be written over. */ - - if ((format != pProp->format) && (mode != PropModeReplace)) - return(BadMatch); - if ((pProp->type != type) && (mode != PropModeReplace)) - return(BadMatch); - if (mode == PropModeReplace) - { - if (totalSize != pProp->size * (pProp->format >> 3)) - { - data = (pointer)xrealloc(pProp->data, totalSize); - if (!data && len) - return(BadAlloc); - pProp->data = data; - } - if (len) - memmove((char *)pProp->data, (char *)value, totalSize); - pProp->size = len; - pProp->type = type; - pProp->format = format; - } - else if (len == 0) - { - /* do nothing */ - } - else if (mode == PropModeAppend) - { - data = (pointer)xrealloc(pProp->data, - sizeInBytes * (len + pProp->size)); - if (!data) - return(BadAlloc); - pProp->data = data; - memmove(&((char *)data)[pProp->size * sizeInBytes], - (char *)value, - totalSize); - pProp->size += len; - } - else if (mode == PropModePrepend) - { - data = (pointer)xalloc(sizeInBytes * (len + pProp->size)); - if (!data) - return(BadAlloc); - memmove(&((char *)data)[totalSize], (char *)pProp->data, - (int)(pProp->size * sizeInBytes)); - memmove((char *)data, (char *)value, totalSize); - xfree(pProp->data); - pProp->data = data; - pProp->size += len; - } - } - if (sendevent) - { - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyNewValue; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - return(Success); -#endif -} - -int -DeleteProperty(pWin, propName) - WindowPtr pWin; - Atom propName; -{ - PropertyPtr pProp, prevProp; - xEvent event; - - if (!(pProp = wUserProps (pWin))) - return(Success); - prevProp = (PropertyPtr)NULL; - while (pProp) - { - if (pProp->propertyName == propName) - break; - prevProp = pProp; - pProp = pProp->next; - } - if (pProp) - { - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - { - prevProp->next = pProp->next; - } -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - xfree(pProp->data); - xfree(pProp); - } - return(Success); -} - -void -DeleteAllWindowProperties(pWin) - WindowPtr pWin; -{ - PropertyPtr pProp, pNextProp; - xEvent event; - - pProp = wUserProps (pWin); - while (pProp) - { -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - pNextProp = pProp->next; - xfree(pProp->data); - xfree(pProp); - pProp = pNextProp; - } -} - -static int -NullPropertyReply(client, propertyType, format, reply) - ClientPtr client; - ATOM propertyType; - int format; - xGetPropertyReply *reply; -{ - reply->nItems = 0; - reply->length = 0; - reply->bytesAfter = 0; - reply->propertyType = propertyType; - reply->format = format; - WriteReplyToClient(client, sizeof(xGenericReply), reply); - return(client->noClientException); -} - -/***************** - * GetProperty - * If type Any is specified, returns the property from the specified - * window regardless of its type. If a type is specified, returns the - * property only if its type equals the specified type. - * If delete is True and a property is returned, the property is also - * deleted from the window and a PropertyNotify event is generated on the - * window. - *****************/ - -int -ProcGetProperty(client) - ClientPtr client; -{ - PropertyPtr pProp, prevProp; - unsigned long n, len, ind; - WindowPtr pWin; - xGetPropertyReply reply; - REQUEST(xGetPropertyReq); - - REQUEST_SIZE_MATCH(xGetPropertyReq); - if (stuff->delete) - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return BadWindow; - - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return(BadAtom); - } - if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) - { - client->errorValue = stuff->delete; - return(BadValue); - } - if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) - { - client->errorValue = stuff->type; - return(BadAtom); - } - - pProp = wUserProps (pWin); - prevProp = (PropertyPtr)NULL; - while (pProp) - { - if (pProp->propertyName == stuff->property) - break; - prevProp = pProp; - pProp = pProp->next; - } - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - if (!pProp) - return NullPropertyReply(client, None, 0, &reply); - -#ifdef XCSECURITY - { - Mask access_mode = SecurityReadAccess; - - if (stuff->delete) - access_mode |= SecurityDestroyAccess; - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - access_mode)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return NullPropertyReply(client, pProp->type, pProp->format, - &reply); - } - } -#endif - /* If the request type and actual type don't match. Return the - property information, but not the data. */ - - if (((stuff->type != pProp->type) && - (stuff->type != AnyPropertyType)) - ) - { - reply.bytesAfter = pProp->size; - reply.format = pProp->format; - reply.length = 0; - reply.nItems = 0; - reply.propertyType = pProp->type; - WriteReplyToClient(client, sizeof(xGenericReply), &reply); - return(Success); - } -#ifdef LBX - /* make sure we have the current value */ - if (pProp->tag_id && pProp->owner_pid) { - LbxStallPropRequest(client, pProp); - return client->noClientException; - } -#endif - -/* - * Return type, format, value to client - */ - n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - ind = stuff->longOffset << 2; - - /* If longOffset is invalid such that it causes "len" to - be negative, it's a value error. */ - - if (n < ind) - { - client->errorValue = stuff->longOffset; - return BadValue; - } - - len = min(n - ind, 4 * stuff->longLength); - - reply.bytesAfter = n - (ind + len); - reply.format = pProp->format; - reply.length = (len + 3) >> 2; - reply.nItems = len / (pProp->format / 8 ); - reply.propertyType = pProp->type; - - if (stuff->delete && (reply.bytesAfter == 0)) - { /* send the event */ - xEvent event; - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - - WriteReplyToClient(client, sizeof(xGenericReply), &reply); - if (len) - { - switch (reply.format) { - case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break; - case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break; - default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break; - } - WriteSwappedDataToClient(client, len, - (char *)pProp->data + ind); - } - - if (stuff->delete && (reply.bytesAfter == 0)) - { /* delete the Property */ -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - prevProp->next = pProp->next; - xfree(pProp->data); - xfree(pProp); - } - return(client->noClientException); -} - -#ifdef NXAGENT_CLIPBOARD -/* GetWindowProperty clipboard use only */ -int -GetWindowProperty(pWin, property, longOffset, longLength, delete, - type, actualType, format, nItems, bytesAfter, propData ) - WindowPtr pWin; - Atom property; - long longOffset; - long longLength; - Bool delete; - Atom type; - Atom *actualType; - int *format; - unsigned long *nItems; - unsigned long *bytesAfter; - unsigned char **propData; -{ - PropertyPtr pProp, prevProp; - unsigned long n, len, ind; - - if (!pWin) - return BadWindow; - - - if (!ValidAtom(property)) - { - return(BadAtom); - } - if ((type != AnyPropertyType) && !ValidAtom(type)) - { - return(BadAtom); - } - - pProp = wUserProps (pWin); - prevProp = (PropertyPtr)NULL; - - while (pProp) - { - if (pProp->propertyName == property) - break; - prevProp = pProp; - pProp = pProp->next; - } - - - if (!pProp) - return (BadAtom); - - /* If the request type and actual type don't match. Return the - property information, but not the data. */ - - if (((type != pProp->type) && - (type != AnyPropertyType)) - ) - { - *bytesAfter = pProp->size; - *format = pProp->format; - *nItems = 0; - *actualType = pProp->type; - return(Success); - } - -/* - * Return type, format, value to client - */ - n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - ind = longOffset << 2; - - /* If longOffset is invalid such that it causes "len" to - be negative, it's a value error. */ - - if (n < ind) - { - return BadValue; - } - - len = min(n - ind, 4 * longLength); - - *bytesAfter = n - (ind + len); - *format = pProp->format; - *nItems = len / (pProp->format / 8 ); - *actualType = pProp->type; - - if (delete && (*bytesAfter == 0)) - { /* send the event */ - xEvent event; - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - - if (len) - { - *propData = (unsigned char *)(pProp->data) + ind; - } - - if (delete && (*bytesAfter == 0)) - { /* delete the Property */ -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - prevProp->next = pProp->next; - xfree(pProp->data); - xfree(pProp); - } - return(Success); -} -#endif - -int -ProcListProperties(client) - ClientPtr client; -{ - Atom *pAtoms = NULL, *temppAtoms; - xListPropertiesReply xlpr; - int numProps = 0; - WindowPtr pWin; - PropertyPtr pProp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - pProp = wUserProps (pWin); - while (pProp) - { - pProp = pProp->next; - numProps++; - } - if (numProps) - if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) - return(BadAlloc); - - xlpr.type = X_Reply; - xlpr.nProperties = numProps; - xlpr.length = (numProps * sizeof(Atom)) >> 2; - xlpr.sequenceNumber = client->sequence; - pProp = wUserProps (pWin); - temppAtoms = pAtoms; - while (pProp) - { - *temppAtoms++ = pProp->propertyName; - pProp = pProp->next; - } - WriteReplyToClient(client, sizeof(xGenericReply), &xlpr); - if (numProps) - { - client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; - WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - DEALLOCATE_LOCAL(pAtoms); - } - return(client->noClientException); -} - -int -ProcDeleteProperty(client) - register ClientPtr client; -{ - WindowPtr pWin; - REQUEST(xDeletePropertyReq); - int result; - - REQUEST_SIZE_MATCH(xDeletePropertyReq); - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return (BadAtom); - } - -#ifdef XCSECURITY - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityDestroyAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return Success; - } -#endif - - result = DeleteProperty(pWin, stuff->property); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.XF86.original deleted file mode 100644 index ba12faffe..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.XF86.original +++ /dev/null @@ -1,736 +0,0 @@ -/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: property.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" -#define NEED_REPLIES -#define NEED_EVENTS -#include "Xproto.h" -#include "windowstr.h" -#include "propertyst.h" -#include "dixstruct.h" -#include "dispatch.h" -#include "swaprep.h" -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif -#ifdef LBX -#include "lbxserve.h" -#include "lbxtags.h" -#endif - -#if defined(LBX) || defined(LBX_COMPAT) -int fWriteToClient(ClientPtr client, int len, char *buf) -{ - return WriteToClient(client, len, buf); -} -#endif - -/***************************************************************** - * Property Stuff - * - * ChangeProperty, DeleteProperty, GetProperties, - * ListProperties - * - * Properties below to windows. A allocate slots each time - * a property is added. No fancy searching done. - * - *****************************************************************/ - -#ifdef notdef -static void -PrintPropertys(pWin) - WindowPtr pWin; -{ - PropertyPtr pProp; - register int j; - - pProp = pWin->userProps; - while (pProp) - { - ErrorF( "%x %x\n", pProp->propertyName, pProp->type); - ErrorF("property format: %d\n", pProp->format); - ErrorF("property data: \n"); - for (j=0; j<(pProp->format/8)*pProp->size; j++) - ErrorF("%c\n", pProp->data[j]); - pProp = pProp->next; - } -} -#endif - -int -ProcRotateProperties(client) - ClientPtr client; -{ - int i, j, delta; - REQUEST(xRotatePropertiesReq); - WindowPtr pWin; - register Atom * atoms; - PropertyPtr * props; /* array of pointer */ - PropertyPtr pProp; - xEvent event; - - REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2); - UpdateCurrentTime(); - pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!stuff->nAtoms) - return(Success); - atoms = (Atom *) & stuff[1]; - props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr)); - if (!props) - return(BadAlloc); - for (i = 0; i < stuff->nAtoms; i++) - { -#ifdef XCSECURITY - char action = SecurityCheckPropertyAccess(client, pWin, atoms[i], - SecurityReadAccess|SecurityWriteAccess); -#endif - if (!ValidAtom(atoms[i]) -#ifdef XCSECURITY - || (SecurityErrorOperation == action) -#endif - ) - { - DEALLOCATE_LOCAL(props); - client->errorValue = atoms[i]; - return BadAtom; - } -#ifdef XCSECURITY - if (SecurityIgnoreOperation == action) - { - DEALLOCATE_LOCAL(props); - return Success; - } -#endif - for (j = i + 1; j < stuff->nAtoms; j++) - if (atoms[j] == atoms[i]) - { - DEALLOCATE_LOCAL(props); - return BadMatch; - } - pProp = wUserProps (pWin); - while (pProp) - { - if (pProp->propertyName == atoms[i]) - goto found; - pProp = pProp->next; - } - DEALLOCATE_LOCAL(props); - return BadMatch; -found: - props[i] = pProp; - } - delta = stuff->nPositions; - - /* If the rotation is a complete 360 degrees, then moving the properties - around and generating PropertyNotify events should be skipped. */ - - if ( (stuff->nAtoms != 0) && (abs(delta) % stuff->nAtoms) != 0 ) - { - while (delta < 0) /* faster if abs value is small */ - delta += stuff->nAtoms; - for (i = 0; i < stuff->nAtoms; i++) - { - /* Generate a PropertyNotify event for each property whose value - is changed in the order in which they appear in the request. */ - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyNewValue; - event.u.property.atom = props[i]->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - - props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms]; - } - } - DEALLOCATE_LOCAL(props); - return Success; -} - -int -ProcChangeProperty(client) - ClientPtr client; -{ - WindowPtr pWin; - char format, mode; - unsigned long len; - int sizeInBytes; - int totalSize; - int err; - REQUEST(xChangePropertyReq); - - REQUEST_AT_LEAST_SIZE(xChangePropertyReq); - UpdateCurrentTime(); - format = stuff->format; - mode = stuff->mode; - if ((mode != PropModeReplace) && (mode != PropModeAppend) && - (mode != PropModePrepend)) - { - client->errorValue = mode; - return BadValue; - } - if ((format != 8) && (format != 16) && (format != 32)) - { - client->errorValue = format; - return BadValue; - } - len = stuff->nUnits; - if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2)) - return BadLength; - sizeInBytes = format>>3; - totalSize = len * sizeInBytes; - REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); - - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return(BadAtom); - } - if (!ValidAtom(stuff->type)) - { - client->errorValue = stuff->type; - return(BadAtom); - } - -#ifdef XCSECURITY - switch (SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityWriteAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom; - case SecurityIgnoreOperation: - return Success; - } -#endif - -#ifdef LBX - err = LbxChangeWindowProperty(client, pWin, stuff->property, stuff->type, - (int)format, (int)mode, len, TRUE, (pointer)&stuff[1], TRUE, NULL); -#else - err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, - (int)mode, len, (pointer)&stuff[1], TRUE); -#endif - if (err != Success) - return err; - else - return client->noClientException; -} - -int -ChangeWindowProperty(pWin, property, type, format, mode, len, value, sendevent) - WindowPtr pWin; - Atom property, type; - int format, mode; - unsigned long len; - pointer value; - Bool sendevent; -{ -#ifdef LBX - return LbxChangeWindowProperty(NULL, pWin, property, type, - format, mode, len, TRUE, value, - sendevent, NULL); -#else - PropertyPtr pProp; - xEvent event; - int sizeInBytes; - int totalSize; - pointer data; - - sizeInBytes = format>>3; - totalSize = len * sizeInBytes; - - /* first see if property already exists */ - - pProp = wUserProps (pWin); - while (pProp) - { - if (pProp->propertyName == property) - break; - pProp = pProp->next; - } - if (!pProp) /* just add to list */ - { - if (!pWin->optional && !MakeWindowOptional (pWin)) - return(BadAlloc); - pProp = (PropertyPtr)xalloc(sizeof(PropertyRec)); - if (!pProp) - return(BadAlloc); - data = (pointer)xalloc(totalSize); - if (!data && len) - { - xfree(pProp); - return(BadAlloc); - } - pProp->propertyName = property; - pProp->type = type; - pProp->format = format; - pProp->data = data; - if (len) - memmove((char *)data, (char *)value, totalSize); - pProp->size = len; - pProp->next = pWin->optional->userProps; - pWin->optional->userProps = pProp; - } - else - { - /* To append or prepend to a property the request format and type - must match those of the already defined property. The - existing format and type are irrelevant when using the mode - "PropModeReplace" since they will be written over. */ - - if ((format != pProp->format) && (mode != PropModeReplace)) - return(BadMatch); - if ((pProp->type != type) && (mode != PropModeReplace)) - return(BadMatch); - if (mode == PropModeReplace) - { - if (totalSize != pProp->size * (pProp->format >> 3)) - { - data = (pointer)xrealloc(pProp->data, totalSize); - if (!data && len) - return(BadAlloc); - pProp->data = data; - } - if (len) - memmove((char *)pProp->data, (char *)value, totalSize); - pProp->size = len; - pProp->type = type; - pProp->format = format; - } - else if (len == 0) - { - /* do nothing */ - } - else if (mode == PropModeAppend) - { - data = (pointer)xrealloc(pProp->data, - sizeInBytes * (len + pProp->size)); - if (!data) - return(BadAlloc); - pProp->data = data; - memmove(&((char *)data)[pProp->size * sizeInBytes], - (char *)value, - totalSize); - pProp->size += len; - } - else if (mode == PropModePrepend) - { - data = (pointer)xalloc(sizeInBytes * (len + pProp->size)); - if (!data) - return(BadAlloc); - memmove(&((char *)data)[totalSize], (char *)pProp->data, - (int)(pProp->size * sizeInBytes)); - memmove((char *)data, (char *)value, totalSize); - xfree(pProp->data); - pProp->data = data; - pProp->size += len; - } - } - if (sendevent) - { - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyNewValue; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - return(Success); -#endif -} - -int -DeleteProperty(pWin, propName) - WindowPtr pWin; - Atom propName; -{ - PropertyPtr pProp, prevProp; - xEvent event; - - if (!(pProp = wUserProps (pWin))) - return(Success); - prevProp = (PropertyPtr)NULL; - while (pProp) - { - if (pProp->propertyName == propName) - break; - prevProp = pProp; - pProp = pProp->next; - } - if (pProp) - { - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - { - prevProp->next = pProp->next; - } -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - xfree(pProp->data); - xfree(pProp); - } - return(Success); -} - -void -DeleteAllWindowProperties(pWin) - WindowPtr pWin; -{ - PropertyPtr pProp, pNextProp; - xEvent event; - - pProp = wUserProps (pWin); - while (pProp) - { -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - pNextProp = pProp->next; - xfree(pProp->data); - xfree(pProp); - pProp = pNextProp; - } -} - -static int -NullPropertyReply(client, propertyType, format, reply) - ClientPtr client; - ATOM propertyType; - int format; - xGetPropertyReply *reply; -{ - reply->nItems = 0; - reply->length = 0; - reply->bytesAfter = 0; - reply->propertyType = propertyType; - reply->format = format; - WriteReplyToClient(client, sizeof(xGenericReply), reply); - return(client->noClientException); -} - -/***************** - * GetProperty - * If type Any is specified, returns the property from the specified - * window regardless of its type. If a type is specified, returns the - * property only if its type equals the specified type. - * If delete is True and a property is returned, the property is also - * deleted from the window and a PropertyNotify event is generated on the - * window. - *****************/ - -int -ProcGetProperty(client) - ClientPtr client; -{ - PropertyPtr pProp, prevProp; - unsigned long n, len, ind; - WindowPtr pWin; - xGetPropertyReply reply; - REQUEST(xGetPropertyReq); - - REQUEST_SIZE_MATCH(xGetPropertyReq); - if (stuff->delete) - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return BadWindow; - - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return(BadAtom); - } - if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) - { - client->errorValue = stuff->delete; - return(BadValue); - } - if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) - { - client->errorValue = stuff->type; - return(BadAtom); - } - - pProp = wUserProps (pWin); - prevProp = (PropertyPtr)NULL; - while (pProp) - { - if (pProp->propertyName == stuff->property) - break; - prevProp = pProp; - pProp = pProp->next; - } - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - if (!pProp) - return NullPropertyReply(client, None, 0, &reply); - -#ifdef XCSECURITY - { - Mask access_mode = SecurityReadAccess; - - if (stuff->delete) - access_mode |= SecurityDestroyAccess; - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - access_mode)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return NullPropertyReply(client, pProp->type, pProp->format, - &reply); - } - } -#endif - /* If the request type and actual type don't match. Return the - property information, but not the data. */ - - if (((stuff->type != pProp->type) && - (stuff->type != AnyPropertyType)) - ) - { - reply.bytesAfter = pProp->size; - reply.format = pProp->format; - reply.length = 0; - reply.nItems = 0; - reply.propertyType = pProp->type; - WriteReplyToClient(client, sizeof(xGenericReply), &reply); - return(Success); - } -#ifdef LBX - /* make sure we have the current value */ - if (pProp->tag_id && pProp->owner_pid) { - LbxStallPropRequest(client, pProp); - return client->noClientException; - } -#endif - -/* - * Return type, format, value to client - */ - n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - ind = stuff->longOffset << 2; - - /* If longOffset is invalid such that it causes "len" to - be negative, it's a value error. */ - - if (n < ind) - { - client->errorValue = stuff->longOffset; - return BadValue; - } - - len = min(n - ind, 4 * stuff->longLength); - - reply.bytesAfter = n - (ind + len); - reply.format = pProp->format; - reply.length = (len + 3) >> 2; - reply.nItems = len / (pProp->format / 8 ); - reply.propertyType = pProp->type; - - if (stuff->delete && (reply.bytesAfter == 0)) - { /* send the event */ - xEvent event; - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - - WriteReplyToClient(client, sizeof(xGenericReply), &reply); - if (len) - { - switch (reply.format) { - case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break; - case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break; - default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break; - } - WriteSwappedDataToClient(client, len, - (char *)pProp->data + ind); - } - - if (stuff->delete && (reply.bytesAfter == 0)) - { /* delete the Property */ -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - prevProp->next = pProp->next; - xfree(pProp->data); - xfree(pProp); - } - return(client->noClientException); -} - -int -ProcListProperties(client) - ClientPtr client; -{ - Atom *pAtoms = NULL, *temppAtoms; - xListPropertiesReply xlpr; - int numProps = 0; - WindowPtr pWin; - PropertyPtr pProp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - pProp = wUserProps (pWin); - while (pProp) - { - pProp = pProp->next; - numProps++; - } - if (numProps) - if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) - return(BadAlloc); - - xlpr.type = X_Reply; - xlpr.nProperties = numProps; - xlpr.length = (numProps * sizeof(Atom)) >> 2; - xlpr.sequenceNumber = client->sequence; - pProp = wUserProps (pWin); - temppAtoms = pAtoms; - while (pProp) - { - *temppAtoms++ = pProp->propertyName; - pProp = pProp->next; - } - WriteReplyToClient(client, sizeof(xGenericReply), &xlpr); - if (numProps) - { - client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; - WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - DEALLOCATE_LOCAL(pAtoms); - } - return(client->noClientException); -} - -int -ProcDeleteProperty(client) - register ClientPtr client; -{ - WindowPtr pWin; - REQUEST(xDeletePropertyReq); - int result; - - REQUEST_SIZE_MATCH(xDeletePropertyReq); - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return (BadAtom); - } - -#ifdef XCSECURITY - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityDestroyAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return Success; - } -#endif - - result = DeleteProperty(pWin, stuff->property); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original deleted file mode 100644 index 43607ac08..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original +++ /dev/null @@ -1,3048 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXrender.c" - -#else - -/* - * $XFree86: xc/programs/Xserver/render/render.c,v 1.26 2003/02/14 18:15:21 dawes Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#define NEED_REPLIES -#define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "colormapst.h" -#include "extnsionst.h" -#include "servermd.h" -#include "render.h" -#include "renderproto.h" -#include "Xfuncproto.h" -#include "cursorstr.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#include "NXpicturestr.h" -#include "NXglyphstr.h" - -#include "Trap.h" - -#include "Render.h" -#include "Pixmaps.h" -#include "Options.h" -#include "Screen.h" - -/* - * Set here the required log level. - */ - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -/* - * From NXmiglyph.c. - */ - -void miGlyphExtents(int nlist, GlyphListPtr list, - GlyphPtr *glyphs, BoxPtr extents); - -/* - * Functions from Render.c. - */ - -int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); -void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); -int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); -int nxagentCreatePicture(PicturePtr, Mask); -void nxagentDestroyPicture(PicturePtr pPicture); -void nxagentChangePicture(PicturePtr, Mask); -int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); -void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, - INT16, INT16, INT16, INT16, CARD16, CARD16); -void nxagentCompositeRects(CARD8, PicturePtr, xRenderColor *, int, xRectangle *); -void nxagentCreateGlyphSet(GlyphSetPtr glyphSet); -void nxagentReferenceGlyphSet(GlyphSetPtr glyphSet); -void nxagentFreeGlyphs(GlyphSetPtr glyphSet, CARD32 *gids, int nglyph); -void nxagentFreeGlyphSet(GlyphSetPtr glyphSet); -void nxagentSetPictureTransform(PicturePtr pPicture, pointer transform); -void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, - pointer params, int nparams); -void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, - INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); - -/* - * The void pointer is actually a XGlyphElt8. - */ - -void nxagentGlyphs(CARD8, PicturePtr, PicturePtr, PictFormatPtr, - INT16, INT16, int, void *, int, GlyphPtr *); - -static int ProcRenderQueryVersion (ClientPtr pClient); -static int ProcRenderQueryPictFormats (ClientPtr pClient); -static int ProcRenderQueryPictIndexValues (ClientPtr pClient); -static int ProcRenderQueryDithers (ClientPtr pClient); -static int ProcRenderCreatePicture (ClientPtr pClient); -static int ProcRenderChangePicture (ClientPtr pClient); -static int ProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int ProcRenderFreePicture (ClientPtr pClient); -static int ProcRenderComposite (ClientPtr pClient); -static int ProcRenderScale (ClientPtr pClient); -static int ProcRenderTrapezoids (ClientPtr pClient); -static int ProcRenderTriangles (ClientPtr pClient); -static int ProcRenderTriStrip (ClientPtr pClient); -static int ProcRenderTriFan (ClientPtr pClient); -static int ProcRenderColorTrapezoids (ClientPtr pClient); -static int ProcRenderColorTriangles (ClientPtr pClient); -static int ProcRenderTransform (ClientPtr pClient); -static int ProcRenderCreateGlyphSet (ClientPtr pClient); -static int ProcRenderReferenceGlyphSet (ClientPtr pClient); -static int ProcRenderFreeGlyphSet (ClientPtr pClient); -static int ProcRenderAddGlyphs (ClientPtr pClient); -static int ProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int ProcRenderFreeGlyphs (ClientPtr pClient); -static int ProcRenderCompositeGlyphs (ClientPtr pClient); -static int ProcRenderFillRectangles (ClientPtr pClient); -static int ProcRenderCreateCursor (ClientPtr pClient); -static int ProcRenderSetPictureTransform (ClientPtr pClient); -static int ProcRenderQueryFilters (ClientPtr pClient); -static int ProcRenderSetPictureFilter (ClientPtr pClient); -static int ProcRenderCreateAnimCursor (ClientPtr pClient); - -static int ProcRenderDispatch (ClientPtr pClient); - -static int SProcRenderQueryVersion (ClientPtr pClient); -static int SProcRenderQueryPictFormats (ClientPtr pClient); -static int SProcRenderQueryPictIndexValues (ClientPtr pClient); -static int SProcRenderQueryDithers (ClientPtr pClient); -static int SProcRenderCreatePicture (ClientPtr pClient); -static int SProcRenderChangePicture (ClientPtr pClient); -static int SProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int SProcRenderFreePicture (ClientPtr pClient); -static int SProcRenderComposite (ClientPtr pClient); -static int SProcRenderScale (ClientPtr pClient); -static int SProcRenderTrapezoids (ClientPtr pClient); -static int SProcRenderTriangles (ClientPtr pClient); -static int SProcRenderTriStrip (ClientPtr pClient); -static int SProcRenderTriFan (ClientPtr pClient); -static int SProcRenderColorTrapezoids (ClientPtr pClient); -static int SProcRenderColorTriangles (ClientPtr pClient); -static int SProcRenderTransform (ClientPtr pClient); -static int SProcRenderCreateGlyphSet (ClientPtr pClient); -static int SProcRenderReferenceGlyphSet (ClientPtr pClient); -static int SProcRenderFreeGlyphSet (ClientPtr pClient); -static int SProcRenderAddGlyphs (ClientPtr pClient); -static int SProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int SProcRenderFreeGlyphs (ClientPtr pClient); -static int SProcRenderCompositeGlyphs (ClientPtr pClient); -static int SProcRenderFillRectangles (ClientPtr pClient); -static int SProcRenderCreateCursor (ClientPtr pClient); -static int SProcRenderSetPictureTransform (ClientPtr pClient); -static int SProcRenderQueryFilters (ClientPtr pClient); -static int SProcRenderSetPictureFilter (ClientPtr pClient); -static int SProcRenderCreateAnimCursor (ClientPtr pClient); - -static int SProcRenderDispatch (ClientPtr pClient); - -int (*ProcRenderVector[RenderNumberRequests])(ClientPtr) = { - ProcRenderQueryVersion, - ProcRenderQueryPictFormats, - ProcRenderQueryPictIndexValues, - ProcRenderQueryDithers, - ProcRenderCreatePicture, - ProcRenderChangePicture, - ProcRenderSetPictureClipRectangles, - ProcRenderFreePicture, - ProcRenderComposite, - ProcRenderScale, - ProcRenderTrapezoids, - ProcRenderTriangles, - ProcRenderTriStrip, - ProcRenderTriFan, - ProcRenderColorTrapezoids, - ProcRenderColorTriangles, - ProcRenderTransform, - ProcRenderCreateGlyphSet, - ProcRenderReferenceGlyphSet, - ProcRenderFreeGlyphSet, - ProcRenderAddGlyphs, - ProcRenderAddGlyphsFromPicture, - ProcRenderFreeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderFillRectangles, - ProcRenderCreateCursor, - ProcRenderSetPictureTransform, - ProcRenderQueryFilters, - ProcRenderSetPictureFilter, - ProcRenderCreateAnimCursor, -}; - -int (*SProcRenderVector[RenderNumberRequests])(ClientPtr) = { - SProcRenderQueryVersion, - SProcRenderQueryPictFormats, - SProcRenderQueryPictIndexValues, - SProcRenderQueryDithers, - SProcRenderCreatePicture, - SProcRenderChangePicture, - SProcRenderSetPictureClipRectangles, - SProcRenderFreePicture, - SProcRenderComposite, - SProcRenderScale, - SProcRenderTrapezoids, - SProcRenderTriangles, - SProcRenderTriStrip, - SProcRenderTriFan, - SProcRenderColorTrapezoids, - SProcRenderColorTriangles, - SProcRenderTransform, - SProcRenderCreateGlyphSet, - SProcRenderReferenceGlyphSet, - SProcRenderFreeGlyphSet, - SProcRenderAddGlyphs, - SProcRenderAddGlyphsFromPicture, - SProcRenderFreeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderFillRectangles, - SProcRenderCreateCursor, - SProcRenderSetPictureTransform, - SProcRenderQueryFilters, - SProcRenderSetPictureFilter, - SProcRenderCreateAnimCursor, -}; - -static void -RenderResetProc (ExtensionEntry *extEntry); - -static CARD8 RenderReqCode; -int RenderErrBase; -int RenderClientPrivateIndex; - -typedef struct _RenderClient { - int major_version; - int minor_version; -} RenderClientRec, *RenderClientPtr; - -#define GetRenderClient(pClient) ((RenderClientPtr) (pClient)->devPrivates[RenderClientPrivateIndex].ptr) - -static void -RenderClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - RenderClientPtr pRenderClient = GetRenderClient (pClient); - - pRenderClient->major_version = 0; - pRenderClient->minor_version = 0; -} - -void -RenderExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (!PictureType) - return; - if (!PictureFinishInit ()) - return; - RenderClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RenderClientPrivateIndex, - sizeof (RenderClientRec))) - return; - if (!AddCallback (&ClientStateCallback, RenderClientCallback, 0)) - return; - - extEntry = AddExtension (RENDER_NAME, 0, RenderNumberErrors, - ProcRenderDispatch, SProcRenderDispatch, - RenderResetProc, StandardMinorOpcode); - if (!extEntry) - return; - RenderReqCode = (CARD8) extEntry->base; - RenderErrBase = extEntry->errorBase; -} - -static void -RenderResetProc (ExtensionEntry *extEntry) -{ -} - -static int -ProcRenderQueryVersion (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryVersionReply rep; - register int n; - REQUEST(xRenderQueryVersionReq); - - pRenderClient->major_version = stuff->majorVersion; - pRenderClient->minor_version = stuff->minorVersion; - - REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = nxagentRenderVersionMajor; - rep.minorVersion = nxagentRenderVersionMinor; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -#if 0 -static int -VisualDepth (ScreenPtr pScreen, VisualPtr pVisual) -{ - DepthPtr pDepth; - int d, v; - - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = pScreen->allowedDepths + d; - for (v = 0; v < pDepth->numVids; v++) - { - if (pDepth->vids[v] == pVisual->vid) - return pDepth->depth; - } - } - return 0; -} -#endif - -static VisualPtr -findVisual (ScreenPtr pScreen, VisualID vid) -{ - VisualPtr pVisual; - int v; - - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = pScreen->visuals + v; - if (pVisual->vid == vid) - return pVisual; - } - return 0; -} - -extern char *ConnectionInfo; - -static int -ProcRenderQueryPictFormats (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryPictFormatsReply *reply; - xPictScreen *pictScreen; - xPictDepth *pictDepth; - xPictVisual *pictVisual; - xPictFormInfo *pictForm; - CARD32 *pictSubpixel; - ScreenPtr pScreen; - VisualPtr pVisual; - DepthPtr pDepth; - int v, d; - PictureScreenPtr ps; - PictFormatPtr pFormat; - int nformat; - int ndepth; - int nvisual; - int rlength; - int s; - int n; - int numScreens; - int numSubpixel; - - extern int nxagentAlphaEnabled; -/* REQUEST(xRenderQueryPictFormatsReq); */ - - REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); - -#ifdef PANORAMIX - if (noPanoramiXExtension) - numScreens = screenInfo.numScreens; - else - numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; -#else - numScreens = screenInfo.numScreens; -#endif - ndepth = nformat = nvisual = 0; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = pScreen->allowedDepths + d; - ++ndepth; - - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && PictureMatchVisual (pScreen, pDepth->depth, pVisual)) - ++nvisual; - } - } - ps = GetPictureScreenIfSet(pScreen); - if (ps) - nformat += ps->nformats; - } - if (pRenderClient->major_version == 0 && pRenderClient->minor_version < 6) - numSubpixel = 0; - else - numSubpixel = numScreens; - - rlength = (sizeof (xRenderQueryPictFormatsReply) + - nformat * sizeof (xPictFormInfo) + - numScreens * sizeof (xPictScreen) + - ndepth * sizeof (xPictDepth) + - nvisual * sizeof (xPictVisual) + - numSubpixel * sizeof (CARD32)); - reply = (xRenderQueryPictFormatsReply *) xalloc (rlength); - if (!reply) - return BadAlloc; - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->numFormats = nformat; - reply->numScreens = numScreens; - reply->numDepths = ndepth; - reply->numVisuals = nvisual; - reply->numSubpixel = numSubpixel; - - pictForm = (xPictFormInfo *) (reply + 1); - - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (nformat = 0, pFormat = ps->formats; - nformat < ps->nformats; - nformat++, pFormat++) - { - pictForm->id = pFormat->id; - pictForm->type = pFormat->type; - pictForm->depth = pFormat->depth; - pictForm->direct.red = pFormat->direct.red; - pictForm->direct.redMask = pFormat->direct.redMask; - pictForm->direct.green = pFormat->direct.green; - pictForm->direct.greenMask = pFormat->direct.greenMask; - pictForm->direct.blue = pFormat->direct.blue; - pictForm->direct.blueMask = pFormat->direct.blueMask; - pictForm->direct.alpha = nxagentAlphaEnabled ? pFormat->direct.alpha : 0; - pictForm->direct.alphaMask = pFormat->direct.alphaMask; - if (pFormat->type == PictTypeIndexed && pFormat->index.pColormap) - pictForm->colormap = pFormat->index.pColormap->mid; - else - pictForm->colormap = None; - if (client->swapped) - { - swapl (&pictForm->id, n); - swaps (&pictForm->direct.red, n); - swaps (&pictForm->direct.redMask, n); - swaps (&pictForm->direct.green, n); - swaps (&pictForm->direct.greenMask, n); - swaps (&pictForm->direct.blue, n); - swaps (&pictForm->direct.blueMask, n); - swaps (&pictForm->direct.alpha, n); - swaps (&pictForm->direct.alphaMask, n); - swapl (&pictForm->colormap, n); - } - pictForm++; - } - } - } - - pictScreen = (xPictScreen *) pictForm; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - pictDepth = (xPictDepth *) (pictScreen + 1); - ndepth = 0; - for (d = 0; d < pScreen->numDepths; d++) - { - pictVisual = (xPictVisual *) (pictDepth + 1); - pDepth = pScreen->allowedDepths + d; - - nvisual = 0; - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && (pFormat = PictureMatchVisual (pScreen, - pDepth->depth, - pVisual))) - { - pictVisual->visual = pVisual->vid; - pictVisual->format = pFormat->id; - if (client->swapped) - { - swapl (&pictVisual->visual, n); - swapl (&pictVisual->format, n); - } - pictVisual++; - nvisual++; - } - } - pictDepth->depth = pDepth->depth; - pictDepth->nPictVisuals = nvisual; - if (client->swapped) - { - swaps (&pictDepth->nPictVisuals, n); - } - ndepth++; - pictDepth = (xPictDepth *) pictVisual; - } - pictScreen->nDepth = ndepth; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - pictScreen->fallback = ps->fallback->id; - else - pictScreen->fallback = 0; - if (client->swapped) - { - swapl (&pictScreen->nDepth, n); - swapl (&pictScreen->fallback, n); - } - pictScreen = (xPictScreen *) pictDepth; - } - pictSubpixel = (CARD32 *) pictScreen; - - for (s = 0; s < numSubpixel; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - *pictSubpixel = ps->subpixel; - else - *pictSubpixel = SubPixelUnknown; - if (client->swapped) - { - swapl (pictSubpixel, n); - } - ++pictSubpixel; - } - - if (client->swapped) - { - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numFormats, n); - swapl (&reply->numScreens, n); - swapl (&reply->numDepths, n); - swapl (&reply->numVisuals, n); - swapl (&reply->numSubpixel, n); - } - WriteToClient(client, rlength, (char *) reply); - xfree (reply); - return client->noClientException; -} - -static int -ProcRenderQueryPictIndexValues (ClientPtr client) -{ - PictFormatPtr pFormat; - int num; - int rlength; - int i, n; - REQUEST(xRenderQueryPictIndexValuesReq); - xRenderQueryPictIndexValuesReply *reply; - xIndexValue *values; - - REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); - - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - - if (!pFormat) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - if (pFormat->type != PictTypeIndexed) - { - client->errorValue = stuff->format; - return BadMatch; - } - num = pFormat->index.nvalues; - rlength = (sizeof (xRenderQueryPictIndexValuesReply) + - num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength); - if (!reply) - return BadAlloc; - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->numIndexValues = num; - - values = (xIndexValue *) (reply + 1); - - memcpy (reply + 1, pFormat->index.pValues, num * sizeof (xIndexValue)); - - if (client->swapped) - { - for (i = 0; i < num; i++) - { - swapl (&values[i].pixel, n); - swaps (&values[i].red, n); - swaps (&values[i].green, n); - swaps (&values[i].blue, n); - swaps (&values[i].alpha, n); - } - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numIndexValues, n); - } - - WriteToClient(client, rlength, (char *) reply); - xfree(reply); - return (client->noClientException); -} - -static int -ProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreatePicture (ClientPtr client) -{ - PicturePtr pPicture; - DrawablePtr pDrawable; - PictFormatPtr pFormat; - int len; - int error; - REQUEST(xRenderCreatePictureReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, - SecurityWriteAccess); - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - if (pFormat->depth != pDrawable->depth) - return BadMatch; - len = client->req_len - (sizeof(xRenderCreatePictureReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - - pPicture = CreatePicture (stuff->pid, - pDrawable, - pFormat, - stuff->mask, - (XID *) (stuff + 1), - client, - &error); - if (!pPicture) - return error; - nxagentCreatePicture(pPicture, stuff -> mask); - - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int -ProcRenderChangePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderChangePictureReq); - int len; - int error; - - REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - - error = ChangePicture (pPicture, stuff->mask, (XID *) (stuff + 1), - (DevUnion *) 0, client); - - nxagentChangePicture(pPicture, stuff->mask); - - return error; -} - -static int -ProcRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - PicturePtr pPicture; - int nr; - int result; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - /* - * The original code used sizeof(xRenderChangePictureReq). - * This was harmless, as both structures have the same size. - * - * nr = (client->req_len << 2) - sizeof(xRenderChangePictureReq); - */ - nr = (client->req_len << 2) - sizeof(xRenderSetPictureClipRectanglesReq); - if (nr & 4) - return BadLength; - nr >>= 3; - result = SetPictureClipRects (pPicture, - stuff->xOrigin, stuff->yOrigin, - nr, (xRectangle *) &stuff[1]); - nxagentChangePictureClip (pPicture, - CT_NONE, - nr, - (xRectangle *) &stuff[1], - (int)stuff -> xOrigin, - (int)stuff -> yOrigin); - - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderFreePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, - RenderErrBase + BadPicture); - - nxagentDestroyPicture(pPicture); - - FreeResource (stuff->picture, RT_NONE); - return(client->noClientException); -} - -static Bool -PictOpValid (CARD8 op) -{ - if (/*PictOpMinimum <= op && */ op <= PictOpMaximum) - return TRUE; - if (PictOpDisjointMinimum <= op && op <= PictOpDisjointMaximum) - return TRUE; - if (PictOpConjointMinimum <= op && op <= PictOpConjointMaximum) - return TRUE; - return FALSE; -} - -/* - * Check if both pictures have drawables which are - * virtual pixmaps. See the corresponding define - * in NXpicture.c - */ - -#define NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - -#ifdef NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - -#define nxagentCompositePredicate(pSrc, pDst) TRUE - -#else - -/* - * This is still under development. The final - * goal is to let pictures point to the real - * pixmaps instead of pointing to virtuals. - */ - -int nxagentCompositePredicate(PicturePtr pSrc, PicturePtr pDst) -{ - PixmapPtr pPixmap1; - PixmapPtr pPixmap2; - - pPixmap1 = (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? - ((PixmapPtr) pSrc -> pDrawable) : NULL); - - pPixmap2 = (pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? - ((PixmapPtr) pDst -> pDrawable) : NULL); - - if (pPixmap1 == NULL || pPixmap2 == NULL) - { - #ifdef TEST - fprintf(stderr, "nxagentCompositePredicate: Case 0.\n"); - #endif - - return FALSE; - } - else - { - #ifdef TEST - fprintf(stderr, "nxagentCompositePredicate: Case 1.\n"); - #endif - - if (nxagentPixmapIsVirtual(pPixmap1) == 1 && - nxagentPixmapIsVirtual(pPixmap2) == 1) - { - #ifdef TEST - fprintf(stderr, "nxagentCompositePredicate: Case 2.\n"); - #endif - - return TRUE; - } - } - - #ifdef TEST - fprintf(stderr, "nxagentCompositePredicate: Case 3.\n"); - #endif - - return FALSE; -} - -#endif - -static int -ProcRenderComposite (ClientPtr client) -{ - PicturePtr pSrc, pMask, pDst; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen || - (pMask && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) - return BadMatch; - - ValidatePicture (pSrc); - if (pMask) - ValidatePicture (pMask); - ValidatePicture (pDst); - - #ifdef NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - - if (nxagentCompositePredicate(pSrc, pDst)) - { - #ifdef TEST - fprintf(stderr, "ProcRenderComposite: Going to composite with " - "source at [%p] mask at [%p] and destination at [%p].\n", - (void *) pSrc, (void *) pMask, (void *) pDst); - #endif - - CompositePicture (stuff->op, - pSrc, - pMask, - pDst, - stuff->xSrc, - stuff->ySrc, - stuff->xMask, - stuff->yMask, - stuff->xDst, - stuff->yDst, - stuff->width, - stuff->height); - } - - #else - - if (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP && - pDst -> pDrawable -> type == DRAWABLE_PIXMAP && - (!pMask || pMask -> pDrawable -> type == DRAWABLE_PIXMAP)) - { - PixmapPtr pVirtualPixmapSrc; - PixmapPtr pVirtualPixmapDst; - PixmapPtr pVirtualPixmapMask; - - PicturePtr pVirtualPictureSrc; - PicturePtr pVirtualPictureDst; - PicturePtr pVirtualPictureMask; - - pVirtualPixmapSrc = (PixmapPtr) pSrc -> pDrawable; - pVirtualPictureSrc = nxagentPixmapPriv(pVirtualPixmapSrc) -> pPicture; - - pVirtualPixmapDst = (PixmapPtr) pDst -> pDrawable; - pVirtualPictureDst = nxagentPixmapPriv(pVirtualPixmapDst) -> pPicture; - - if (pMask) - { - pVirtualPixmapMask = (PixmapPtr) pMask -> pDrawable; - pVirtualPictureMask = nxagentPixmapPriv(pVirtualPixmapMask) -> pPicture; - } - else - { - pVirtualPixmapMask = NULL; - pVirtualPictureMask = NULL; - } - - if (pVirtualPictureSrc && pVirtualPictureDst) - { - #ifdef TEST - fprintf(stderr, "ProcRenderComposite: Going to composite with " - "source at [%p] mask at [%p] and destination at [%p].\n", - (void *) pVirtualPixmapSrc, (void *) pVirtualPixmapMask, - (void *) pVirtualPixmapDst); - #endif - - CompositePicture (stuff->op, - pVirtualPictureSrc, - pVirtualPictureMask, - pVirtualPictureDst, - stuff->xSrc, - stuff->ySrc, - stuff->xMask, - stuff->yMask, - stuff->xDst, - stuff->yDst, - stuff->width, - stuff->height); - } - } - - #endif - - nxagentComposite (stuff -> op, - pSrc, - pMask, - pDst, - stuff -> xSrc, - stuff -> ySrc, - stuff -> xMask, - stuff -> yMask, - stuff -> xDst, - stuff -> yDst, - stuff -> width, - stuff -> height); - - return Success; -} - -static int -ProcRenderScale (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTrapezoids (ClientPtr client) -{ - int ntraps; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - ntraps = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); - if (ntraps % sizeof (xTrapezoid)) - return BadLength; - ntraps /= sizeof (xTrapezoid); - if (ntraps) - { - if (nxagentCompositePredicate(pSrc, pDst)) - { - CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntraps, (xTrapezoid *) &stuff[1]); - } - - nxagentTrapezoids (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntraps, (xTrapezoid *) &stuff[1]); - } - - return client->noClientException; -} - -static int -ProcRenderTriangles (ClientPtr client) -{ - int ntris; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - ntris = (client->req_len << 2) - sizeof (xRenderTrianglesReq); - if (ntris % sizeof (xTriangle)) - return BadLength; - ntris /= sizeof (xTriangle); - if (ntris) - CompositeTriangles (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntris, (xTriangle *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriStrip (ClientPtr client) -{ - int npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriStrip (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriFan (ClientPtr client) -{ - int npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriFan (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreateGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - PictFormatPtr format; - int f; - REQUEST(xRenderCreateGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - format = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - if (!format) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - switch (format->depth) { - case 1: - f = GlyphFormat1; - break; - case 4: - f = GlyphFormat4; - break; - case 8: - f = GlyphFormat8; - break; - case 16: - f = GlyphFormat16; - break; - case 32: - f = GlyphFormat32; - break; - default: - return BadMatch; - } - if (format->type != PictTypeDirect) - return BadMatch; - glyphSet = AllocateGlyphSet (f, format); - if (!glyphSet) - return BadAlloc; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - - nxagentCreateGlyphSet(glyphSet); - - return Success; -} - -static int -ProcRenderReferenceGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderReferenceGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->existing, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->existing; - return RenderErrBase + BadGlyphSet; - } - glyphSet->refcnt++; - - nxagentReferenceGlyphSet(glyphSet); - - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - return client->noClientException; -} - -#define NLOCALDELTA 64 -#define NLOCALGLYPH 256 - -static int -ProcRenderFreeGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderFreeGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityDestroyAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - nxagentFreeGlyphSet(glyphSet); - - FreeResource (stuff->glyphset, RT_NONE); - return client->noClientException; -} - -typedef struct _GlyphNew { - Glyph id; - GlyphPtr glyph; -} GlyphNewRec, *GlyphNewPtr; - -static int -ProcRenderAddGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderAddGlyphsReq); - GlyphNewRec glyphsLocal[NLOCALGLYPH]; - GlyphNewPtr glyphsBase, glyphs; - GlyphPtr glyph = NULL; - int remain, nglyphs; - CARD32 *gids; - xGlyphInfo *gi; - CARD8 *bits; - int size; - int err = BadAlloc; - - int totSizeImages; - - REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - nglyphs = stuff->nglyphs; - if (nglyphs <= NLOCALGLYPH) - glyphsBase = glyphsLocal; - else - { - glyphsBase = (GlyphNewPtr) ALLOCATE_LOCAL (nglyphs * sizeof (GlyphNewRec)); - if (!glyphsBase) - return BadAlloc; - } - - remain = (client->req_len << 2) - sizeof (xRenderAddGlyphsReq); - - glyphs = glyphsBase; - - totSizeImages = 0; - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + nglyphs); - bits = (CARD8 *) (gi + nglyphs); - remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs; - - while (remain >= 0 && nglyphs) - { - glyph = AllocateGlyph (gi, glyphSet->fdepth); - if (!glyph) - { - err = BadAlloc; - goto bail; - } - - glyphs->glyph = glyph; - glyphs->id = *gids; - - size = glyph->size - sizeof (xGlyphInfo); - if (remain < size) - break; - memcpy ((CARD8 *) (glyph + 1), bits, size); - - if (size & 3) - size += 4 - (size & 3); - bits += size; - totSizeImages += size; - remain -= size; - gi++; - gids++; - glyphs++; - nglyphs--; - } - - if (nglyphs || remain) - { - err = BadLength; - goto bail; - } - nglyphs = stuff->nglyphs; - if (!ResizeGlyphSet (glyphSet, nglyphs)) - { - err = BadAlloc; - goto bail; - } - glyphs = glyphsBase; - while (nglyphs--) - AddGlyph (glyphSet, glyphs->glyph, glyphs->id); - - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - return client->noClientException; -bail: - while (glyphs != glyphsBase) - { - --glyphs; - xfree (glyphs->glyph); - } - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - return err; -} - -static int -ProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderFreeGlyphs (ClientPtr client) -{ - REQUEST(xRenderFreeGlyphsReq); - GlyphSetPtr glyphSet; - int nglyph; - CARD32 *gids; - CARD32 glyph; - - REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - nglyph = ((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)) >> 2; - gids = (CARD32 *) (stuff + 1); - - nxagentFreeGlyphs(glyphSet, gids, nglyph); - - while (nglyph-- > 0) - { - glyph = *gids++; - if (!DeleteGlyph (glyphSet, glyph)) - { - client->errorValue = glyph; - return RenderErrBase + BadGlyph; - } - } - return client->noClientException; -} - -typedef struct XGlyphElt8{ - GlyphSet glyphset; - _Xconst char *chars; - int nchars; - int xOff; - int yOff; -} XGlyphElt8; - -static int -ProcRenderCompositeGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - GlyphSet gs; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - GlyphListRec listsLocal[NLOCALDELTA]; - GlyphListPtr lists, listsBase; - GlyphPtr glyphsLocal[NLOCALGLYPH]; - Glyph glyph; - GlyphPtr *glyphs, *glyphsBase; - xGlyphElt *elt; - CARD8 *buffer, *end; - int nglyph; - int nlist; - int space; - int size; - int n; - - XGlyphElt8 *elements, *elementsBase; - - REQUEST(xRenderCompositeGlyphsReq); - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityReadAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - nglyph = 0; - nlist = 0; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - buffer += 4; - } - else - { - nlist++; - nglyph += elt->len; - space = size * elt->len; - if (space & 3) - space += 4 - (space & 3); - buffer += space; - } - } - if (nglyph <= NLOCALGLYPH) - glyphsBase = glyphsLocal; - else - { - glyphsBase = (GlyphPtr *) ALLOCATE_LOCAL (nglyph * sizeof (GlyphPtr)); - if (!glyphsBase) - return BadAlloc; - } - if (nlist <= NLOCALDELTA) - listsBase = listsLocal; - else - { - listsBase = (GlyphListPtr) ALLOCATE_LOCAL (nlist * sizeof (GlyphListRec)); - if (!listsBase) - return BadAlloc; - } - - elementsBase = xalloc(nlist * sizeof(XGlyphElt8)); - if (!elementsBase) - return BadAlloc; - - buffer = (CARD8 *) (stuff + 1); - glyphs = glyphsBase; - lists = listsBase; - elements = elementsBase; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - #ifdef DEBUG - fprintf(stderr, "ProcRenderCompositeGlyphs: Glyphset change with base size [%d].\n", - size); - #endif - - if (buffer + sizeof (GlyphSet) < end) - { - gs = *(GlyphSet *) buffer; - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - gs, - GlyphSetType, - SecurityReadAccess); - if (!glyphSet) - { - client->errorValue = gs; - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); - return RenderErrBase + BadGlyphSet; - } - } - buffer += 4; - } - else - { - lists->xOff = elt->deltax; - lists->yOff = elt->deltay; - lists->format = glyphSet->format; - lists->len = 0; - elements -> glyphset = glyphSet -> remoteID; - elements -> chars = (char *) buffer; - elements -> nchars = elt->len; - elements -> xOff = elt->deltax; - elements -> yOff = elt->deltay; - n = elt->len; - while (n--) - { - if (buffer + size <= end) - { - switch (size) { - case 1: - glyph = *((CARD8 *)buffer); break; - case 2: - glyph = *((CARD16 *)buffer); break; - case 4: - default: - glyph = *((CARD32 *)buffer); break; - } - if ((*glyphs = FindGlyph (glyphSet, glyph))) - { - lists->len++; - glyphs++; - } - } - buffer += size; - } - space = size * elt->len; - if (space & 3) - buffer += 4 - (space & 3); - lists++; - elements++; - } - } - if (buffer > end) - return BadLength; - - /* - * We need to know the glyphs extents to synchronize - * the drawables involved in the composite text ope- - * ration. Also we need to synchronize only the back- - * ground of the text we are going to render, so the - * operations on the framebuffer must be executed - * after the X requests. - */ - - if (pFormat != NULL) - { - nxagentGlyphsExtents = (BoxPtr) xalloc(sizeof(BoxRec)); - - miGlyphExtents(nlist, listsBase, glyphsBase, nxagentGlyphsExtents); - } - - nxagentGlyphs(stuff -> op, - pSrc, - pDst, - pFormat, - stuff -> xSrc, - stuff -> ySrc, - nlist, - elementsBase, - size, - glyphsBase); - - if (nxagentCompositePredicate(pSrc, pDst) == 1) - { - #ifdef TEST - fprintf(stderr, "ProcRenderCompositeGlyphs: Going to composite glyphs with " - "source at [%p] and destination at [%p].\n", - (void *) pSrc, (void *) pDst); - #endif - - CompositeGlyphs(stuff -> op, - pSrc, - pDst, - pFormat, - stuff -> xSrc, - stuff -> ySrc, - nlist, - listsBase, - glyphsBase); - } - - if (nxagentGlyphsExtents != NullBox) - { - xfree(nxagentGlyphsExtents); - - nxagentGlyphsExtents = NullBox; - } - - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); - - xfree(elementsBase); - - return client->noClientException; -} - -static int -ProcRenderFillRectangles (ClientPtr client) -{ - PicturePtr pDst; - int things; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - things = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq); - if (things & 4) - return(BadLength); - things >>= 3; - - CompositeRects (stuff->op, - pDst, - &stuff->color, - things, - (xRectangle *) &stuff[1]); - - ValidatePicture (pDst); - nxagentCompositeRects(stuff -> op, - pDst, - &stuff -> color, - things, - (xRectangle *) &stuff[1]); - - return client->noClientException; -} - -static void -SetBit (unsigned char *line, int x, int bit) -{ - unsigned char mask; - - if (screenInfo.bitmapBitOrder == LSBFirst) - mask = (1 << (x & 7)); - else - mask = (0x80 >> (x & 7)); - /* XXX assumes byte order is host byte order */ - line += (x >> 3); - if (bit) - *line |= mask; - else - *line &= ~mask; -} - -#define DITHER_DIM 2 - -static CARD32 orderedDither[DITHER_DIM][DITHER_DIM] = { - { 1, 3, }, - { 4, 2, }, -}; - -#define DITHER_SIZE ((sizeof orderedDither / sizeof orderedDither[0][0]) + 1) - -static int -ProcRenderCreateCursor (ClientPtr client) -{ - REQUEST(xRenderCreateCursorReq); - PicturePtr pSrc; - ScreenPtr pScreen; - unsigned short width, height; - CARD32 *argbbits, *argb; - unsigned char *srcbits, *srcline; - unsigned char *mskbits, *mskline; - int stride; - int x, y; - int nbytes_mono; - CursorMetricRec cm; - CursorPtr pCursor; - CARD32 twocolor[3]; - int ncolor; - - RealizeCursorProcPtr saveRealizeCursor; - - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - pScreen = pSrc->pDrawable->pScreen; - width = pSrc->pDrawable->width; - height = pSrc->pDrawable->height; - if ( stuff->x > width - || stuff->y > height ) - return (BadMatch); - argbbits = xalloc (width * height * sizeof (CARD32)); - if (!argbbits) - return (BadAlloc); - - stride = BitmapBytePad(width); - nbytes_mono = stride*height; - srcbits = (unsigned char *)xalloc(nbytes_mono); - if (!srcbits) - { - xfree (argbbits); - return (BadAlloc); - } - mskbits = (unsigned char *)xalloc(nbytes_mono); - if (!mskbits) - { - xfree(argbbits); - xfree(srcbits); - return (BadAlloc); - } - bzero ((char *) mskbits, nbytes_mono); - bzero ((char *) srcbits, nbytes_mono); - - if (pSrc->format == PICT_a8r8g8b8) - { - (*pScreen->GetImage) (pSrc->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - } - else - { - PixmapPtr pPixmap; - PicturePtr pPicture; - PictFormatPtr pFormat; - int error; - - pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); - if (!pFormat) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadImplementation); - } - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); - if (!pPixmap) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadAlloc); - } - pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0, - client, &error); - if (!pPicture) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return error; - } - (*pScreen->DestroyPixmap) (pPixmap); - CompositePicture (PictOpSrc, - pSrc, 0, pPicture, - 0, 0, 0, 0, 0, 0, width, height); - (*pScreen->GetImage) (pPicture->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - FreePicture (pPicture, 0); - } - /* - * Check whether the cursor can be directly supported by - * the core cursor code - */ - ncolor = 0; - argb = argbbits; - for (y = 0; ncolor <= 2 && y < height; y++) - { - for (x = 0; ncolor <= 2 && x < width; x++) - { - CARD32 p = *argb++; - CARD32 a = (p >> 24); - - if (a == 0) /* transparent */ - continue; - if (a == 0xff) /* opaque */ - { - int n; - for (n = 0; n < ncolor; n++) - if (p == twocolor[n]) - break; - if (n == ncolor) - twocolor[ncolor++] = p; - } - else - ncolor = 3; - } - } - - /* - * Convert argb image to two plane cursor - */ - srcline = srcbits; - mskline = mskbits; - argb = argbbits; - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - CARD32 p = *argb++; - - if (ncolor <= 2) - { - CARD32 a = ((p >> 24)); - - SetBit (mskline, x, a != 0); - SetBit (srcline, x, a != 0 && p == twocolor[0]); - } - else - { - CARD32 a = ((p >> 24) * DITHER_SIZE + 127) / 255; - CARD32 i = ((CvtR8G8B8toY15(p) >> 7) * DITHER_SIZE + 127) / 255; - CARD32 d = orderedDither[y&(DITHER_DIM-1)][x&(DITHER_DIM-1)]; - /* Set mask from dithered alpha value */ - SetBit(mskline, x, a > d); - /* Set src from dithered intensity value */ - SetBit(srcline, x, a > d && i <= d); - } - } - srcline += stride; - mskline += stride; - } - /* - * Dither to white and black if the cursor has more than two colors - */ - if (ncolor > 2) - { - twocolor[0] = 0xff000000; - twocolor[1] = 0xffffffff; - } - else - { - xfree (argbbits); - argbbits = 0; - } - -#define GetByte(p,s) (((p) >> (s)) & 0xff) -#define GetColor(p,s) (GetByte(p,s) | (GetByte(p,s) << 8)) - - cm.width = width; - cm.height = height; - cm.xhot = stuff->x; - cm.yhot = stuff->y; - - /* - * This cursor uses RENDER, so we make sure - * that it is allocated in a way that allows - * the mi and dix layers to handle it but we - * later create it on the server by mirror- - * ing the RENDER operation we got from the - * client. - */ - - saveRealizeCursor = pScreen -> RealizeCursor; - - pScreen -> RealizeCursor = nxagentCursorSaveRenderInfo; - - pCursor = AllocCursorARGB (srcbits, mskbits, argbbits, &cm, - GetColor(twocolor[0], 16), - GetColor(twocolor[0], 8), - GetColor(twocolor[0], 0), - GetColor(twocolor[1], 16), - GetColor(twocolor[1], 8), - GetColor(twocolor[1], 0)); - - pScreen -> RealizeCursor = saveRealizeCursor; - - /* - * Store into the private data members the - * information needed to recreate it at - * reconnection. This is done in two steps - * as in the first step we don't have the - * picture info. - */ - - if (pCursor == NULL) - { - return BadAlloc; - } - - nxagentCursorPostSaveRenderInfo(pCursor, pScreen, pSrc, stuff -> x, stuff -> y); - - nxagentRenderRealizeCursor(pScreen, pCursor); - - if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return (client->noClientException); - return BadAlloc; -} - -static int -ProcRenderSetPictureTransform (ClientPtr client) -{ - REQUEST(xRenderSetPictureTransformReq); - PicturePtr pPicture; - int result; - - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); - - nxagentSetPictureTransform(pPicture, &stuff->transform); - - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderQueryFilters (ClientPtr client) -{ - REQUEST (xRenderQueryFiltersReq); - DrawablePtr pDrawable; - xRenderQueryFiltersReply *reply; - int nbytesName; - int nnames; - ScreenPtr pScreen; - PictureScreenPtr ps; - int i, j; - int len; - int total_bytes; - INT16 *aliases; - char *names; - - REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess); - - pScreen = pDrawable->pScreen; - nbytesName = 0; - nnames = 0; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (i = 0; i < ps->nfilters; i++) - nbytesName += 1 + strlen (ps->filters[i].name); - for (i = 0; i < ps->nfilterAliases; i++) - nbytesName += 1 + strlen (ps->filterAliases[i].alias); - nnames = ps->nfilters + ps->nfilterAliases; - } - len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2); - total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) xalloc (total_bytes); - if (!reply) - return BadAlloc; - aliases = (INT16 *) (reply + 1); - names = (char *) (aliases + ((nnames + 1) & ~1)); - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = len; - reply->numAliases = nnames; - reply->numFilters = nnames; - if (ps) - { - - /* fill in alias values */ - for (i = 0; i < ps->nfilters; i++) - aliases[i] = FilterAliasNone; - for (i = 0; i < ps->nfilterAliases; i++) - { - for (j = 0; j < ps->nfilters; j++) - if (ps->filterAliases[i].filter_id == ps->filters[j].id) - break; - if (j == ps->nfilters) - { - for (j = 0; j < ps->nfilterAliases; j++) - if (ps->filterAliases[i].filter_id == - ps->filterAliases[j].alias_id) - { - break; - } - if (j == ps->nfilterAliases) - j = FilterAliasNone; - else - j = j + ps->nfilters; - } - aliases[i + ps->nfilters] = j; - } - - /* fill in filter names */ - for (i = 0; i < ps->nfilters; i++) - { - j = strlen (ps->filters[i].name); - *names++ = j; - strncpy (names, ps->filters[i].name, j); - names += j; - } - - /* fill in filter alias names */ - for (i = 0; i < ps->nfilterAliases; i++) - { - j = strlen (ps->filterAliases[i].alias); - *names++ = j; - strncpy (names, ps->filterAliases[i].alias, j); - names += j; - } - } - - if (client->swapped) - { - register int n; - - for (i = 0; i < (int)reply->numAliases; i++) - { - swaps (&aliases[i], n); - } - swaps(&reply->sequenceNumber, n); - swapl(&reply->length, n); - swapl(&reply->numAliases, n); - swapl(&reply->numFilters, n); - } - WriteToClient(client, total_bytes, (char *) reply); - xfree (reply); - - return(client->noClientException); -} - -static int -ProcRenderSetPictureFilter (ClientPtr client) -{ - REQUEST (xRenderSetPictureFilterReq); - PicturePtr pPicture; - int result; - xFixed *params; - int nparams; - char *name; - - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - name = (char *) (stuff + 1); - params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); - nparams = ((xFixed *) stuff + client->req_len) - params; - result = SetPictureFilter (pPicture, name, stuff->nbytes, params, nparams); - - nxagentSetPictureFilter(pPicture, name, stuff->nbytes, params, nparams); - - return result; -} - -static int -ProcRenderCreateAnimCursor (ClientPtr client) -{ - REQUEST(xRenderCreateAnimCursorReq); - CursorPtr *cursors; - CARD32 *deltas; - CursorPtr pCursor; - int ncursor; - xAnimCursorElt *elt; - int i; - int ret; - - REQUEST_AT_LEAST_SIZE(xRenderCreateAnimCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - if (client->req_len & 1) - return BadLength; - ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1; - cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); - if (!cursors) - return BadAlloc; - deltas = (CARD32 *) (cursors + ncursor); - elt = (xAnimCursorElt *) (stuff + 1); - for (i = 0; i < ncursor; i++) - { - cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursors[i]) - { - xfree (cursors); - client->errorValue = elt->cursor; - return BadCursor; - } - deltas[i] = elt->delay; - elt++; - } - ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor); - xfree (cursors); - if (ret != Success) - return ret; - - for (i = 0; i < MAXSCREENS; i++) - { - pCursor -> devPriv[i] = NULL; - } - - if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; - return BadAlloc; -} - -static int -ProcRenderDispatch (ClientPtr client) -{ - int result; - - REQUEST(xReq); - - /* - * Let the client fail if we are - * hiding the RENDER extension. - */ - - if (nxagentRenderTrap) - { - return BadRequest; - } - - if (stuff->data < RenderNumberRequests) - { - /* - * Set the nxagentGCTrap flag while - * dispatching a render operation to - * avoid reentrancy in GCOps.c. - */ - - nxagentGCTrap = 1; - - result = (*ProcRenderVector[stuff->data]) (client); - - nxagentGCTrap = 0; - - return result; - } - else - return BadRequest; -} - -static int -SProcRenderQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return (*ProcRenderVector[stuff->renderReqType])(client); -} - -static int -SProcRenderQueryPictFormats (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictFormatsReq); - swaps(&stuff->length, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryPictIndexValues (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictIndexValuesReq); - swaps(&stuff->length, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreatePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreatePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swapl(&stuff->format, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderChangePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderChangePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureClipRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureClipRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderComposite (ClientPtr client) -{ - register int n; - REQUEST(xRenderCompositeReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->mask, n); - swapl(&stuff->dst, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xMask, n); - swaps(&stuff->yMask, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderScale (ClientPtr client) -{ - register int n; - REQUEST(xRenderScaleReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->colorScale, n); - swapl(&stuff->alphaScale, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTrapezoids (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriStrip (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriStripReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriFan (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriFanReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreateGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderReferenceGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderReferenceGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->existing, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreeGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphs (ClientPtr client) -{ - register int n; - register unsigned int i; - CARD32 *gids; - void *end; - xGlyphInfo *gi; - REQUEST(xRenderAddGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - swapl(&stuff->nglyphs, n); - if (stuff->nglyphs & 0xe0000000) - return BadLength; - end = (CARD8 *) stuff + (client->req_len << 2); - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + stuff->nglyphs); - if ((char *) end - (char *) (gids + stuff->nglyphs) < 0) - return BadLength; - if ((char *) end - (char *) (gi + stuff->nglyphs) < 0) - return BadLength; - for (i = 0; i < stuff->nglyphs; i++) - { - swapl (&gids[i], n); - swaps (&gi[i].width, n); - swaps (&gi[i].height, n); - swaps (&gi[i].x, n); - swaps (&gi[i].y, n); - swaps (&gi[i].xOff, n); - swaps (&gi[i].yOff, n); - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderFreeGlyphs (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCompositeGlyphs (ClientPtr client) -{ - register int n; - xGlyphElt *elt; - CARD8 *buffer; - CARD8 *end; - int space; - int i; - int size; - - REQUEST(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->maskFormat, n); - swapl(&stuff->glyphset, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - swaps (&elt->deltax, n); - swaps (&elt->deltay, n); - - i = elt->len; - if (i == 0xff) - { - swapl (buffer, n); - buffer += 4; - } - else - { - space = size * i; - switch (size) { - case 1: - buffer += i; - break; - case 2: - while (i--) - { - swaps (buffer, n); - buffer += 2; - } - break; - case 4: - while (i--) - { - swapl (buffer, n); - buffer += 4; - } - break; - } - if (space & 3) - buffer += 4 - (space & 3); - } - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFillRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->dst, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - swaps(&stuff->color.alpha, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateCursor (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateCursorReq); - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - swapl(&stuff->src, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureTransform (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureTransformReq); - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->transform.matrix11, n); - swapl(&stuff->transform.matrix12, n); - swapl(&stuff->transform.matrix13, n); - swapl(&stuff->transform.matrix21, n); - swapl(&stuff->transform.matrix22, n); - swapl(&stuff->transform.matrix23, n); - swapl(&stuff->transform.matrix31, n); - swapl(&stuff->transform.matrix32, n); - swapl(&stuff->transform.matrix33, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryFilters (ClientPtr client) -{ - register int n; - REQUEST (xRenderQueryFiltersReq); - REQUEST_SIZE_MATCH (xRenderQueryFiltersReq); - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureFilter (ClientPtr client) -{ - register int n; - REQUEST (xRenderSetPictureFilterReq); - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->nbytes, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateAnimCursor (ClientPtr client) -{ - register int n; - REQUEST (xRenderCreateAnimCursorReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderDispatch (ClientPtr client) -{ - int result; - - REQUEST(xReq); - - /* - * Let the client fail if we are - * hiding the RENDER extension. - */ - - if (nxagentRenderTrap) - { - return BadRequest; - } - - if (stuff->data < RenderNumberRequests) - { - /* - * Set the nxagentGCTrap flag while - * dispatching a render operation to - * avoid reentrancy in GCOps.c. - */ - - nxagentGCTrap = 1; - - result = (*SProcRenderVector[stuff->data]) (client); - - nxagentGCTrap = 0; - - return result; - } - else - return BadRequest; -} - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - -#define VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err) {\ - pPicture = SecurityLookupIDByType(client, pid, XRT_PICTURE, mode);\ - if (!pPicture) { \ - client->errorValue = pid; \ - return err; \ - } \ -} - -#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode, err) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err); \ - } \ -} \ - -int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr); - -unsigned long XRT_PICTURE; - -static int -PanoramiXRenderCreatePicture (ClientPtr client) -{ - REQUEST(xRenderCreatePictureReq); - PanoramiXRes *refDraw, *newPict; - int result = Success, j; - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) - return BadAlloc; - newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; - - if (refDraw->type == XRT_WINDOW && - stuff->drawable == WindowTable[0]->drawable.id) - { - newPict->u.pict.root = TRUE; - } - else - newPict->u.pict.root = FALSE; - - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - - FOR_NSCREENS_BACKWARD(j) { - stuff->pid = newPict->info[j].id; - stuff->drawable = refDraw->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderCreatePicture]) (client); - if(result != Success) break; - } - - if (result == Success) - AddResource(newPict->info[0].id, XRT_PICTURE, newPict); - else - xfree(newPict); - - return (result); -} - -static int -PanoramiXRenderChangePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderChangePictureReq); - - REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderChangePicture]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureClipRectangles]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderFreePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - client->errorValue = stuff->picture; - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess, - RenderErrBase + BadPicture); - - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFreePicture]) (client); - if(result != Success) break; - } - - /* Since ProcRenderFreePicture is using FreeResource, it will free - our resource for us on the last pass through the loop above */ - - return (result); -} - -static int -PanoramiXRenderComposite (ClientPtr client) -{ - PanoramiXRes *src, *msk, *dst; - int result = Success, j; - xRenderCompositeReq orig; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - orig = *stuff; - - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - stuff->xDst = orig.xDst - panoramiXdataPtr[j].x; - stuff->yDst = orig.yDst - panoramiXdataPtr[j].y; - } - if (msk) - { - stuff->mask = msk->info[j].id; - if (msk->u.pict.root) - { - stuff->xMask = orig.xMask - panoramiXdataPtr[j].x; - stuff->yMask = orig.yMask - panoramiXdataPtr[j].y; - } - } - result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client); - if(result != Success) break; - } - - return result; -} - -static int -PanoramiXRenderCompositeGlyphs (ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderCompositeGlyphsReq); - xGlyphElt origElt, *elt; - INT16 xSrc, ySrc; - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) + - sizeof (xGlyphElt))) - { - elt = (xGlyphElt *) (stuff + 1); - origElt = *elt; - xSrc = stuff->xSrc; - ySrc = stuff->ySrc; - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - elt->deltax = origElt.deltax - panoramiXdataPtr[j].x; - elt->deltay = origElt.deltay - panoramiXdataPtr[j].y; - } - result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client); - if(result != Success) break; - } - } - - return result; -} - -static int -PanoramiXRenderFillRectangles (ClientPtr client) -{ - PanoramiXRes *dst; - int result = Success, j; - REQUEST(xRenderFillRectanglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) - { - memcpy (extra, stuff + 1, extra_len); - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) - { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xRectangle *rects = (xRectangle *) (stuff + 1); - int i = extra_len / sizeof (xRectangle); - - while (i--) - { - rects->x -= x_off; - rects->y -= y_off; - rects++; - } - } - } - stuff->dst = dst->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); - if(result != Success) break; - } - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -void -PanoramiXRenderInit (void) -{ - int i; - - XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource); - for (i = 0; i < RenderNumberRequests; i++) - PanoramiXSaveRenderVector[i] = ProcRenderVector[i]; - /* - * Stuff in Xinerama aware request processing hooks - */ - ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture; - ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture; - ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles; - ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture; - ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite; - ProcRenderVector[X_RenderCompositeGlyphs8] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles; -} - -void -PanoramiXRenderReset (void) -{ - int i; - for (i = 0; i < RenderNumberRequests; i++) - ProcRenderVector[i] = PanoramiXSaveRenderVector[i]; -} - -#endif /* PANORAMIX */ - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.XF86.original deleted file mode 100644 index a4f90ea77..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.XF86.original +++ /dev/null @@ -1,2584 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/render.c,v 1.26 2003/02/14 18:15:21 dawes Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#define NEED_REPLIES -#define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "colormapst.h" -#include "extnsionst.h" -#include "servermd.h" -#include "render.h" -#include "renderproto.h" -#include "picturestr.h" -#include "glyphstr.h" -#include "Xfuncproto.h" -#include "cursorstr.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -static int ProcRenderQueryVersion (ClientPtr pClient); -static int ProcRenderQueryPictFormats (ClientPtr pClient); -static int ProcRenderQueryPictIndexValues (ClientPtr pClient); -static int ProcRenderQueryDithers (ClientPtr pClient); -static int ProcRenderCreatePicture (ClientPtr pClient); -static int ProcRenderChangePicture (ClientPtr pClient); -static int ProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int ProcRenderFreePicture (ClientPtr pClient); -static int ProcRenderComposite (ClientPtr pClient); -static int ProcRenderScale (ClientPtr pClient); -static int ProcRenderTrapezoids (ClientPtr pClient); -static int ProcRenderTriangles (ClientPtr pClient); -static int ProcRenderTriStrip (ClientPtr pClient); -static int ProcRenderTriFan (ClientPtr pClient); -static int ProcRenderColorTrapezoids (ClientPtr pClient); -static int ProcRenderColorTriangles (ClientPtr pClient); -static int ProcRenderTransform (ClientPtr pClient); -static int ProcRenderCreateGlyphSet (ClientPtr pClient); -static int ProcRenderReferenceGlyphSet (ClientPtr pClient); -static int ProcRenderFreeGlyphSet (ClientPtr pClient); -static int ProcRenderAddGlyphs (ClientPtr pClient); -static int ProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int ProcRenderFreeGlyphs (ClientPtr pClient); -static int ProcRenderCompositeGlyphs (ClientPtr pClient); -static int ProcRenderFillRectangles (ClientPtr pClient); -static int ProcRenderCreateCursor (ClientPtr pClient); -static int ProcRenderSetPictureTransform (ClientPtr pClient); -static int ProcRenderQueryFilters (ClientPtr pClient); -static int ProcRenderSetPictureFilter (ClientPtr pClient); -static int ProcRenderCreateAnimCursor (ClientPtr pClient); - -static int ProcRenderDispatch (ClientPtr pClient); - -static int SProcRenderQueryVersion (ClientPtr pClient); -static int SProcRenderQueryPictFormats (ClientPtr pClient); -static int SProcRenderQueryPictIndexValues (ClientPtr pClient); -static int SProcRenderQueryDithers (ClientPtr pClient); -static int SProcRenderCreatePicture (ClientPtr pClient); -static int SProcRenderChangePicture (ClientPtr pClient); -static int SProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int SProcRenderFreePicture (ClientPtr pClient); -static int SProcRenderComposite (ClientPtr pClient); -static int SProcRenderScale (ClientPtr pClient); -static int SProcRenderTrapezoids (ClientPtr pClient); -static int SProcRenderTriangles (ClientPtr pClient); -static int SProcRenderTriStrip (ClientPtr pClient); -static int SProcRenderTriFan (ClientPtr pClient); -static int SProcRenderColorTrapezoids (ClientPtr pClient); -static int SProcRenderColorTriangles (ClientPtr pClient); -static int SProcRenderTransform (ClientPtr pClient); -static int SProcRenderCreateGlyphSet (ClientPtr pClient); -static int SProcRenderReferenceGlyphSet (ClientPtr pClient); -static int SProcRenderFreeGlyphSet (ClientPtr pClient); -static int SProcRenderAddGlyphs (ClientPtr pClient); -static int SProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int SProcRenderFreeGlyphs (ClientPtr pClient); -static int SProcRenderCompositeGlyphs (ClientPtr pClient); -static int SProcRenderFillRectangles (ClientPtr pClient); -static int SProcRenderCreateCursor (ClientPtr pClient); -static int SProcRenderSetPictureTransform (ClientPtr pClient); -static int SProcRenderQueryFilters (ClientPtr pClient); -static int SProcRenderSetPictureFilter (ClientPtr pClient); -static int SProcRenderCreateAnimCursor (ClientPtr pClient); - -static int SProcRenderDispatch (ClientPtr pClient); - -int (*ProcRenderVector[RenderNumberRequests])(ClientPtr) = { - ProcRenderQueryVersion, - ProcRenderQueryPictFormats, - ProcRenderQueryPictIndexValues, - ProcRenderQueryDithers, - ProcRenderCreatePicture, - ProcRenderChangePicture, - ProcRenderSetPictureClipRectangles, - ProcRenderFreePicture, - ProcRenderComposite, - ProcRenderScale, - ProcRenderTrapezoids, - ProcRenderTriangles, - ProcRenderTriStrip, - ProcRenderTriFan, - ProcRenderColorTrapezoids, - ProcRenderColorTriangles, - ProcRenderTransform, - ProcRenderCreateGlyphSet, - ProcRenderReferenceGlyphSet, - ProcRenderFreeGlyphSet, - ProcRenderAddGlyphs, - ProcRenderAddGlyphsFromPicture, - ProcRenderFreeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderFillRectangles, - ProcRenderCreateCursor, - ProcRenderSetPictureTransform, - ProcRenderQueryFilters, - ProcRenderSetPictureFilter, - ProcRenderCreateAnimCursor, -}; - -int (*SProcRenderVector[RenderNumberRequests])(ClientPtr) = { - SProcRenderQueryVersion, - SProcRenderQueryPictFormats, - SProcRenderQueryPictIndexValues, - SProcRenderQueryDithers, - SProcRenderCreatePicture, - SProcRenderChangePicture, - SProcRenderSetPictureClipRectangles, - SProcRenderFreePicture, - SProcRenderComposite, - SProcRenderScale, - SProcRenderTrapezoids, - SProcRenderTriangles, - SProcRenderTriStrip, - SProcRenderTriFan, - SProcRenderColorTrapezoids, - SProcRenderColorTriangles, - SProcRenderTransform, - SProcRenderCreateGlyphSet, - SProcRenderReferenceGlyphSet, - SProcRenderFreeGlyphSet, - SProcRenderAddGlyphs, - SProcRenderAddGlyphsFromPicture, - SProcRenderFreeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderFillRectangles, - SProcRenderCreateCursor, - SProcRenderSetPictureTransform, - SProcRenderQueryFilters, - SProcRenderSetPictureFilter, - SProcRenderCreateAnimCursor, -}; - -static void -RenderResetProc (ExtensionEntry *extEntry); - -static CARD8 RenderReqCode; -int RenderErrBase; -int RenderClientPrivateIndex; - -typedef struct _RenderClient { - int major_version; - int minor_version; -} RenderClientRec, *RenderClientPtr; - -#define GetRenderClient(pClient) ((RenderClientPtr) (pClient)->devPrivates[RenderClientPrivateIndex].ptr) - -static void -RenderClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - RenderClientPtr pRenderClient = GetRenderClient (pClient); - - pRenderClient->major_version = 0; - pRenderClient->minor_version = 0; -} - -void -RenderExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (!PictureType) - return; - if (!PictureFinishInit ()) - return; - RenderClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RenderClientPrivateIndex, - sizeof (RenderClientRec))) - return; - if (!AddCallback (&ClientStateCallback, RenderClientCallback, 0)) - return; - - extEntry = AddExtension (RENDER_NAME, 0, RenderNumberErrors, - ProcRenderDispatch, SProcRenderDispatch, - RenderResetProc, StandardMinorOpcode); - if (!extEntry) - return; - RenderReqCode = (CARD8) extEntry->base; - RenderErrBase = extEntry->errorBase; -} - -static void -RenderResetProc (ExtensionEntry *extEntry) -{ -} - -static int -ProcRenderQueryVersion (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryVersionReply rep; - register int n; - REQUEST(xRenderQueryVersionReq); - - pRenderClient->major_version = stuff->majorVersion; - pRenderClient->minor_version = stuff->minorVersion; - - REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RENDER_MAJOR; - rep.minorVersion = RENDER_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -#if 0 -static int -VisualDepth (ScreenPtr pScreen, VisualPtr pVisual) -{ - DepthPtr pDepth; - int d, v; - - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = pScreen->allowedDepths + d; - for (v = 0; v < pDepth->numVids; v++) - { - if (pDepth->vids[v] == pVisual->vid) - return pDepth->depth; - } - } - return 0; -} -#endif - -static VisualPtr -findVisual (ScreenPtr pScreen, VisualID vid) -{ - VisualPtr pVisual; - int v; - - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = pScreen->visuals + v; - if (pVisual->vid == vid) - return pVisual; - } - return 0; -} - -extern char *ConnectionInfo; - -static int -ProcRenderQueryPictFormats (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryPictFormatsReply *reply; - xPictScreen *pictScreen; - xPictDepth *pictDepth; - xPictVisual *pictVisual; - xPictFormInfo *pictForm; - CARD32 *pictSubpixel; - ScreenPtr pScreen; - VisualPtr pVisual; - DepthPtr pDepth; - int v, d; - PictureScreenPtr ps; - PictFormatPtr pFormat; - int nformat; - int ndepth; - int nvisual; - int rlength; - int s; - int n; - int numScreens; - int numSubpixel; -/* REQUEST(xRenderQueryPictFormatsReq); */ - - REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); - -#ifdef PANORAMIX - if (noPanoramiXExtension) - numScreens = screenInfo.numScreens; - else - numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; -#else - numScreens = screenInfo.numScreens; -#endif - ndepth = nformat = nvisual = 0; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = pScreen->allowedDepths + d; - ++ndepth; - - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && PictureMatchVisual (pScreen, pDepth->depth, pVisual)) - ++nvisual; - } - } - ps = GetPictureScreenIfSet(pScreen); - if (ps) - nformat += ps->nformats; - } - if (pRenderClient->major_version == 0 && pRenderClient->minor_version < 6) - numSubpixel = 0; - else - numSubpixel = numScreens; - - rlength = (sizeof (xRenderQueryPictFormatsReply) + - nformat * sizeof (xPictFormInfo) + - numScreens * sizeof (xPictScreen) + - ndepth * sizeof (xPictDepth) + - nvisual * sizeof (xPictVisual) + - numSubpixel * sizeof (CARD32)); - reply = (xRenderQueryPictFormatsReply *) xalloc (rlength); - if (!reply) - return BadAlloc; - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->numFormats = nformat; - reply->numScreens = numScreens; - reply->numDepths = ndepth; - reply->numVisuals = nvisual; - reply->numSubpixel = numSubpixel; - - pictForm = (xPictFormInfo *) (reply + 1); - - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (nformat = 0, pFormat = ps->formats; - nformat < ps->nformats; - nformat++, pFormat++) - { - pictForm->id = pFormat->id; - pictForm->type = pFormat->type; - pictForm->depth = pFormat->depth; - pictForm->direct.red = pFormat->direct.red; - pictForm->direct.redMask = pFormat->direct.redMask; - pictForm->direct.green = pFormat->direct.green; - pictForm->direct.greenMask = pFormat->direct.greenMask; - pictForm->direct.blue = pFormat->direct.blue; - pictForm->direct.blueMask = pFormat->direct.blueMask; - pictForm->direct.alpha = pFormat->direct.alpha; - pictForm->direct.alphaMask = pFormat->direct.alphaMask; - if (pFormat->type == PictTypeIndexed && pFormat->index.pColormap) - pictForm->colormap = pFormat->index.pColormap->mid; - else - pictForm->colormap = None; - if (client->swapped) - { - swapl (&pictForm->id, n); - swaps (&pictForm->direct.red, n); - swaps (&pictForm->direct.redMask, n); - swaps (&pictForm->direct.green, n); - swaps (&pictForm->direct.greenMask, n); - swaps (&pictForm->direct.blue, n); - swaps (&pictForm->direct.blueMask, n); - swaps (&pictForm->direct.alpha, n); - swaps (&pictForm->direct.alphaMask, n); - swapl (&pictForm->colormap, n); - } - pictForm++; - } - } - } - - pictScreen = (xPictScreen *) pictForm; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - pictDepth = (xPictDepth *) (pictScreen + 1); - ndepth = 0; - for (d = 0; d < pScreen->numDepths; d++) - { - pictVisual = (xPictVisual *) (pictDepth + 1); - pDepth = pScreen->allowedDepths + d; - - nvisual = 0; - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && (pFormat = PictureMatchVisual (pScreen, - pDepth->depth, - pVisual))) - { - pictVisual->visual = pVisual->vid; - pictVisual->format = pFormat->id; - if (client->swapped) - { - swapl (&pictVisual->visual, n); - swapl (&pictVisual->format, n); - } - pictVisual++; - nvisual++; - } - } - pictDepth->depth = pDepth->depth; - pictDepth->nPictVisuals = nvisual; - if (client->swapped) - { - swaps (&pictDepth->nPictVisuals, n); - } - ndepth++; - pictDepth = (xPictDepth *) pictVisual; - } - pictScreen->nDepth = ndepth; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - pictScreen->fallback = ps->fallback->id; - else - pictScreen->fallback = 0; - if (client->swapped) - { - swapl (&pictScreen->nDepth, n); - swapl (&pictScreen->fallback, n); - } - pictScreen = (xPictScreen *) pictDepth; - } - pictSubpixel = (CARD32 *) pictScreen; - - for (s = 0; s < numSubpixel; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - *pictSubpixel = ps->subpixel; - else - *pictSubpixel = SubPixelUnknown; - if (client->swapped) - { - swapl (pictSubpixel, n); - } - ++pictSubpixel; - } - - if (client->swapped) - { - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numFormats, n); - swapl (&reply->numScreens, n); - swapl (&reply->numDepths, n); - swapl (&reply->numVisuals, n); - swapl (&reply->numSubpixel, n); - } - WriteToClient(client, rlength, (char *) reply); - xfree (reply); - return client->noClientException; -} - -static int -ProcRenderQueryPictIndexValues (ClientPtr client) -{ - PictFormatPtr pFormat; - int num; - int rlength; - int i, n; - REQUEST(xRenderQueryPictIndexValuesReq); - xRenderQueryPictIndexValuesReply *reply; - xIndexValue *values; - - REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); - - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - - if (!pFormat) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - if (pFormat->type != PictTypeIndexed) - { - client->errorValue = stuff->format; - return BadMatch; - } - num = pFormat->index.nvalues; - rlength = (sizeof (xRenderQueryPictIndexValuesReply) + - num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength); - if (!reply) - return BadAlloc; - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->numIndexValues = num; - - values = (xIndexValue *) (reply + 1); - - memcpy (reply + 1, pFormat->index.pValues, num * sizeof (xIndexValue)); - - if (client->swapped) - { - for (i = 0; i < num; i++) - { - swapl (&values[i].pixel, n); - swaps (&values[i].red, n); - swaps (&values[i].green, n); - swaps (&values[i].blue, n); - swaps (&values[i].alpha, n); - } - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numIndexValues, n); - } - - WriteToClient(client, rlength, (char *) reply); - xfree(reply); - return (client->noClientException); -} - -static int -ProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreatePicture (ClientPtr client) -{ - PicturePtr pPicture; - DrawablePtr pDrawable; - PictFormatPtr pFormat; - int len; - int error; - REQUEST(xRenderCreatePictureReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, - SecurityWriteAccess); - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - if (pFormat->depth != pDrawable->depth) - return BadMatch; - len = client->req_len - (sizeof(xRenderCreatePictureReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - - pPicture = CreatePicture (stuff->pid, - pDrawable, - pFormat, - stuff->mask, - (XID *) (stuff + 1), - client, - &error); - if (!pPicture) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int -ProcRenderChangePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderChangePictureReq); - int len; - - REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - - return ChangePicture (pPicture, stuff->mask, (XID *) (stuff + 1), - (DevUnion *) 0, client); -} - -static int -ProcRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - PicturePtr pPicture; - int nr; - int result; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - nr = (client->req_len << 2) - sizeof(xRenderChangePictureReq); - if (nr & 4) - return BadLength; - nr >>= 3; - result = SetPictureClipRects (pPicture, - stuff->xOrigin, stuff->yOrigin, - nr, (xRectangle *) &stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderFreePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, - RenderErrBase + BadPicture); - FreeResource (stuff->picture, RT_NONE); - return(client->noClientException); -} - -static Bool -PictOpValid (CARD8 op) -{ - if (/*PictOpMinimum <= op && */ op <= PictOpMaximum) - return TRUE; - if (PictOpDisjointMinimum <= op && op <= PictOpDisjointMaximum) - return TRUE; - if (PictOpConjointMinimum <= op && op <= PictOpConjointMaximum) - return TRUE; - return FALSE; -} - -static int -ProcRenderComposite (ClientPtr client) -{ - PicturePtr pSrc, pMask, pDst; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen || - (pMask && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) - return BadMatch; - CompositePicture (stuff->op, - pSrc, - pMask, - pDst, - stuff->xSrc, - stuff->ySrc, - stuff->xMask, - stuff->yMask, - stuff->xDst, - stuff->yDst, - stuff->width, - stuff->height); - return Success; -} - -static int -ProcRenderScale (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTrapezoids (ClientPtr client) -{ - int ntraps; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - ntraps = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); - if (ntraps % sizeof (xTrapezoid)) - return BadLength; - ntraps /= sizeof (xTrapezoid); - if (ntraps) - CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntraps, (xTrapezoid *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriangles (ClientPtr client) -{ - int ntris; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - ntris = (client->req_len << 2) - sizeof (xRenderTrianglesReq); - if (ntris % sizeof (xTriangle)) - return BadLength; - ntris /= sizeof (xTriangle); - if (ntris) - CompositeTriangles (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntris, (xTriangle *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriStrip (ClientPtr client) -{ - int npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriStrip (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriFan (ClientPtr client) -{ - int npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriFan (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreateGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - PictFormatPtr format; - int f; - REQUEST(xRenderCreateGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - format = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - if (!format) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - switch (format->depth) { - case 1: - f = GlyphFormat1; - break; - case 4: - f = GlyphFormat4; - break; - case 8: - f = GlyphFormat8; - break; - case 16: - f = GlyphFormat16; - break; - case 32: - f = GlyphFormat32; - break; - default: - return BadMatch; - } - if (format->type != PictTypeDirect) - return BadMatch; - glyphSet = AllocateGlyphSet (f, format); - if (!glyphSet) - return BadAlloc; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - return Success; -} - -static int -ProcRenderReferenceGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderReferenceGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->existing, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->existing; - return RenderErrBase + BadGlyphSet; - } - glyphSet->refcnt++; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - return client->noClientException; -} - -#define NLOCALDELTA 64 -#define NLOCALGLYPH 256 - -static int -ProcRenderFreeGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderFreeGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityDestroyAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - FreeResource (stuff->glyphset, RT_NONE); - return client->noClientException; -} - -typedef struct _GlyphNew { - Glyph id; - GlyphPtr glyph; -} GlyphNewRec, *GlyphNewPtr; - -static int -ProcRenderAddGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderAddGlyphsReq); - GlyphNewRec glyphsLocal[NLOCALGLYPH]; - GlyphNewPtr glyphsBase, glyphs; - GlyphPtr glyph; - int remain, nglyphs; - CARD32 *gids; - xGlyphInfo *gi; - CARD8 *bits; - int size; - int err = BadAlloc; - - REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - nglyphs = stuff->nglyphs; - if (nglyphs <= NLOCALGLYPH) - glyphsBase = glyphsLocal; - else - { - glyphsBase = (GlyphNewPtr) ALLOCATE_LOCAL (nglyphs * sizeof (GlyphNewRec)); - if (!glyphsBase) - return BadAlloc; - } - - remain = (client->req_len << 2) - sizeof (xRenderAddGlyphsReq); - - glyphs = glyphsBase; - - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + nglyphs); - bits = (CARD8 *) (gi + nglyphs); - remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs; - while (remain >= 0 && nglyphs) - { - glyph = AllocateGlyph (gi, glyphSet->fdepth); - if (!glyph) - { - err = BadAlloc; - goto bail; - } - - glyphs->glyph = glyph; - glyphs->id = *gids; - - size = glyph->size - sizeof (xGlyphInfo); - if (remain < size) - break; - memcpy ((CARD8 *) (glyph + 1), bits, size); - - if (size & 3) - size += 4 - (size & 3); - bits += size; - remain -= size; - gi++; - gids++; - glyphs++; - nglyphs--; - } - if (nglyphs || remain) - { - err = BadLength; - goto bail; - } - nglyphs = stuff->nglyphs; - if (!ResizeGlyphSet (glyphSet, nglyphs)) - { - err = BadAlloc; - goto bail; - } - glyphs = glyphsBase; - while (nglyphs--) - AddGlyph (glyphSet, glyphs->glyph, glyphs->id); - - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - return client->noClientException; -bail: - while (glyphs != glyphsBase) - { - --glyphs; - xfree (glyphs->glyph); - } - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - return err; -} - -static int -ProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderFreeGlyphs (ClientPtr client) -{ - REQUEST(xRenderFreeGlyphsReq); - GlyphSetPtr glyphSet; - int nglyph; - CARD32 *gids; - CARD32 glyph; - - REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - nglyph = ((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)) >> 2; - gids = (CARD32 *) (stuff + 1); - while (nglyph-- > 0) - { - glyph = *gids++; - if (!DeleteGlyph (glyphSet, glyph)) - { - client->errorValue = glyph; - return RenderErrBase + BadGlyph; - } - } - return client->noClientException; -} - -static int -ProcRenderCompositeGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - GlyphSet gs; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - GlyphListRec listsLocal[NLOCALDELTA]; - GlyphListPtr lists, listsBase; - GlyphPtr glyphsLocal[NLOCALGLYPH]; - Glyph glyph; - GlyphPtr *glyphs, *glyphsBase; - xGlyphElt *elt; - CARD8 *buffer, *end; - int nglyph; - int nlist; - int space; - int size; - int n; - - REQUEST(xRenderCompositeGlyphsReq); - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityReadAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - nglyph = 0; - nlist = 0; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - buffer += 4; - } - else - { - nlist++; - nglyph += elt->len; - space = size * elt->len; - if (space & 3) - space += 4 - (space & 3); - buffer += space; - } - } - if (nglyph <= NLOCALGLYPH) - glyphsBase = glyphsLocal; - else - { - glyphsBase = (GlyphPtr *) ALLOCATE_LOCAL (nglyph * sizeof (GlyphPtr)); - if (!glyphsBase) - return BadAlloc; - } - if (nlist <= NLOCALDELTA) - listsBase = listsLocal; - else - { - listsBase = (GlyphListPtr) ALLOCATE_LOCAL (nlist * sizeof (GlyphListRec)); - if (!listsBase) - return BadAlloc; - } - buffer = (CARD8 *) (stuff + 1); - glyphs = glyphsBase; - lists = listsBase; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - if (buffer + sizeof (GlyphSet) < end) - { - gs = *(GlyphSet *) buffer; - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - gs, - GlyphSetType, - SecurityReadAccess); - if (!glyphSet) - { - client->errorValue = gs; - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); - return RenderErrBase + BadGlyphSet; - } - } - buffer += 4; - } - else - { - lists->xOff = elt->deltax; - lists->yOff = elt->deltay; - lists->format = glyphSet->format; - lists->len = 0; - n = elt->len; - while (n--) - { - if (buffer + size <= end) - { - switch (size) { - case 1: - glyph = *((CARD8 *)buffer); break; - case 2: - glyph = *((CARD16 *)buffer); break; - case 4: - default: - glyph = *((CARD32 *)buffer); break; - } - if ((*glyphs = FindGlyph (glyphSet, glyph))) - { - lists->len++; - glyphs++; - } - } - buffer += size; - } - space = size * elt->len; - if (space & 3) - buffer += 4 - (space & 3); - lists++; - } - } - if (buffer > end) - return BadLength; - - CompositeGlyphs (stuff->op, - pSrc, - pDst, - pFormat, - stuff->xSrc, - stuff->ySrc, - nlist, - listsBase, - glyphsBase); - - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); - - return client->noClientException; -} - -static int -ProcRenderFillRectangles (ClientPtr client) -{ - PicturePtr pDst; - int things; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - things = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq); - if (things & 4) - return(BadLength); - things >>= 3; - - CompositeRects (stuff->op, - pDst, - &stuff->color, - things, - (xRectangle *) &stuff[1]); - - return client->noClientException; -} - -static void -SetBit (unsigned char *line, int x, int bit) -{ - unsigned char mask; - - if (screenInfo.bitmapBitOrder == LSBFirst) - mask = (1 << (x & 7)); - else - mask = (0x80 >> (x & 7)); - /* XXX assumes byte order is host byte order */ - line += (x >> 3); - if (bit) - *line |= mask; - else - *line &= ~mask; -} - -#define DITHER_DIM 2 - -static CARD32 orderedDither[DITHER_DIM][DITHER_DIM] = { - { 1, 3, }, - { 4, 2, }, -}; - -#define DITHER_SIZE ((sizeof orderedDither / sizeof orderedDither[0][0]) + 1) - -static int -ProcRenderCreateCursor (ClientPtr client) -{ - REQUEST(xRenderCreateCursorReq); - PicturePtr pSrc; - ScreenPtr pScreen; - unsigned short width, height; - CARD32 *argbbits, *argb; - unsigned char *srcbits, *srcline; - unsigned char *mskbits, *mskline; - int stride; - int x, y; - int nbytes_mono; - CursorMetricRec cm; - CursorPtr pCursor; - CARD32 twocolor[3]; - int ncolor; - - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - pScreen = pSrc->pDrawable->pScreen; - width = pSrc->pDrawable->width; - height = pSrc->pDrawable->height; - if ( stuff->x > width - || stuff->y > height ) - return (BadMatch); - argbbits = xalloc (width * height * sizeof (CARD32)); - if (!argbbits) - return (BadAlloc); - - stride = BitmapBytePad(width); - nbytes_mono = stride*height; - srcbits = (unsigned char *)xalloc(nbytes_mono); - if (!srcbits) - { - xfree (argbbits); - return (BadAlloc); - } - mskbits = (unsigned char *)xalloc(nbytes_mono); - if (!mskbits) - { - xfree(argbbits); - xfree(srcbits); - return (BadAlloc); - } - bzero ((char *) mskbits, nbytes_mono); - bzero ((char *) srcbits, nbytes_mono); - - if (pSrc->format == PICT_a8r8g8b8) - { - (*pScreen->GetImage) (pSrc->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - } - else - { - PixmapPtr pPixmap; - PicturePtr pPicture; - PictFormatPtr pFormat; - int error; - - pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); - if (!pFormat) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadImplementation); - } - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); - if (!pPixmap) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadAlloc); - } - pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0, - client, &error); - if (!pPicture); - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return error; - } - (*pScreen->DestroyPixmap) (pPixmap); - CompositePicture (PictOpSrc, - pSrc, 0, pPicture, - 0, 0, 0, 0, 0, 0, width, height); - (*pScreen->GetImage) (pPicture->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - FreePicture (pPicture, 0); - } - /* - * Check whether the cursor can be directly supported by - * the core cursor code - */ - ncolor = 0; - argb = argbbits; - for (y = 0; ncolor <= 2 && y < height; y++) - { - for (x = 0; ncolor <= 2 && x < width; x++) - { - CARD32 p = *argb++; - CARD32 a = (p >> 24); - - if (a == 0) /* transparent */ - continue; - if (a == 0xff) /* opaque */ - { - int n; - for (n = 0; n < ncolor; n++) - if (p == twocolor[n]) - break; - if (n == ncolor) - twocolor[ncolor++] = p; - } - else - ncolor = 3; - } - } - - /* - * Convert argb image to two plane cursor - */ - srcline = srcbits; - mskline = mskbits; - argb = argbbits; - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - CARD32 p = *argb++; - - if (ncolor <= 2) - { - CARD32 a = ((p >> 24)); - - SetBit (mskline, x, a != 0); - SetBit (srcline, x, a != 0 && p == twocolor[0]); - } - else - { - CARD32 a = ((p >> 24) * DITHER_SIZE + 127) / 255; - CARD32 i = ((CvtR8G8B8toY15(p) >> 7) * DITHER_SIZE + 127) / 255; - CARD32 d = orderedDither[y&(DITHER_DIM-1)][x&(DITHER_DIM-1)]; - /* Set mask from dithered alpha value */ - SetBit(mskline, x, a > d); - /* Set src from dithered intensity value */ - SetBit(srcline, x, a > d && i <= d); - } - } - srcline += stride; - mskline += stride; - } - /* - * Dither to white and black if the cursor has more than two colors - */ - if (ncolor > 2) - { - twocolor[0] = 0xff000000; - twocolor[1] = 0xffffffff; - } - else - { - xfree (argbbits); - argbbits = 0; - } - -#define GetByte(p,s) (((p) >> (s)) & 0xff) -#define GetColor(p,s) (GetByte(p,s) | (GetByte(p,s) << 8)) - - cm.width = width; - cm.height = height; - cm.xhot = stuff->x; - cm.yhot = stuff->y; - pCursor = AllocCursorARGB (srcbits, mskbits, argbbits, &cm, - GetColor(twocolor[0], 16), - GetColor(twocolor[0], 8), - GetColor(twocolor[0], 0), - GetColor(twocolor[1], 16), - GetColor(twocolor[1], 8), - GetColor(twocolor[1], 0)); - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return (client->noClientException); - return BadAlloc; -} - -static int -ProcRenderSetPictureTransform (ClientPtr client) -{ - REQUEST(xRenderSetPictureTransformReq); - PicturePtr pPicture; - int result; - - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderQueryFilters (ClientPtr client) -{ - REQUEST (xRenderQueryFiltersReq); - DrawablePtr pDrawable; - xRenderQueryFiltersReply *reply; - int nbytesName; - int nnames; - ScreenPtr pScreen; - PictureScreenPtr ps; - int i, j; - int len; - int total_bytes; - INT16 *aliases; - char *names; - - REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess); - - pScreen = pDrawable->pScreen; - nbytesName = 0; - nnames = 0; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (i = 0; i < ps->nfilters; i++) - nbytesName += 1 + strlen (ps->filters[i].name); - for (i = 0; i < ps->nfilterAliases; i++) - nbytesName += 1 + strlen (ps->filterAliases[i].alias); - nnames = ps->nfilters + ps->nfilterAliases; - } - len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2); - total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) xalloc (total_bytes); - if (!reply) - return BadAlloc; - aliases = (INT16 *) (reply + 1); - names = (char *) (aliases + ((nnames + 1) & ~1)); - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = len; - reply->numAliases = nnames; - reply->numFilters = nnames; - if (ps) - { - - /* fill in alias values */ - for (i = 0; i < ps->nfilters; i++) - aliases[i] = FilterAliasNone; - for (i = 0; i < ps->nfilterAliases; i++) - { - for (j = 0; j < ps->nfilters; j++) - if (ps->filterAliases[i].filter_id == ps->filters[j].id) - break; - if (j == ps->nfilters) - { - for (j = 0; j < ps->nfilterAliases; j++) - if (ps->filterAliases[i].filter_id == - ps->filterAliases[j].alias_id) - { - break; - } - if (j == ps->nfilterAliases) - j = FilterAliasNone; - else - j = j + ps->nfilters; - } - aliases[i + ps->nfilters] = j; - } - - /* fill in filter names */ - for (i = 0; i < ps->nfilters; i++) - { - j = strlen (ps->filters[i].name); - *names++ = j; - strncpy (names, ps->filters[i].name, j); - names += j; - } - - /* fill in filter alias names */ - for (i = 0; i < ps->nfilterAliases; i++) - { - j = strlen (ps->filterAliases[i].alias); - *names++ = j; - strncpy (names, ps->filterAliases[i].alias, j); - names += j; - } - } - - if (client->swapped) - { - register int n; - - for (i = 0; i < reply->numAliases; i++) - { - swaps (&aliases[i], n); - } - swaps(&reply->sequenceNumber, n); - swapl(&reply->length, n); - swapl(&reply->numAliases, n); - swapl(&reply->numFilters, n); - } - WriteToClient(client, total_bytes, (char *) reply); - xfree (reply); - - return(client->noClientException); -} - -static int -ProcRenderSetPictureFilter (ClientPtr client) -{ - REQUEST (xRenderSetPictureFilterReq); - PicturePtr pPicture; - int result; - xFixed *params; - int nparams; - char *name; - - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - name = (char *) (stuff + 1); - params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); - nparams = ((xFixed *) stuff + client->req_len) - params; - result = SetPictureFilter (pPicture, name, stuff->nbytes, params, nparams); - return result; -} - -static int -ProcRenderCreateAnimCursor (ClientPtr client) -{ - REQUEST(xRenderCreateAnimCursorReq); - CursorPtr *cursors; - CARD32 *deltas; - CursorPtr pCursor; - int ncursor; - xAnimCursorElt *elt; - int i; - int ret; - - REQUEST_AT_LEAST_SIZE(xRenderCreateAnimCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - if (client->req_len & 1) - return BadLength; - ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1; - cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); - if (!cursors) - return BadAlloc; - deltas = (CARD32 *) (cursors + ncursor); - elt = (xAnimCursorElt *) (stuff + 1); - for (i = 0; i < ncursor; i++) - { - cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursors[i]) - { - xfree (cursors); - client->errorValue = elt->cursor; - return BadCursor; - } - deltas[i] = elt->delay; - elt++; - } - ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor); - xfree (cursors); - if (ret != Success) - return ret; - - if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; - return BadAlloc; -} - -static int -ProcRenderDispatch (ClientPtr client) -{ - REQUEST(xReq); - - if (stuff->data < RenderNumberRequests) - return (*ProcRenderVector[stuff->data]) (client); - else - return BadRequest; -} - -static int -SProcRenderQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return (*ProcRenderVector[stuff->renderReqType])(client); -} - -static int -SProcRenderQueryPictFormats (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictFormatsReq); - swaps(&stuff->length, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryPictIndexValues (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictIndexValuesReq); - swaps(&stuff->length, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreatePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreatePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swapl(&stuff->format, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderChangePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderChangePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureClipRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureClipRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderComposite (ClientPtr client) -{ - register int n; - REQUEST(xRenderCompositeReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->mask, n); - swapl(&stuff->dst, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xMask, n); - swaps(&stuff->yMask, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderScale (ClientPtr client) -{ - register int n; - REQUEST(xRenderScaleReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->colorScale, n); - swapl(&stuff->alphaScale, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTrapezoids (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriStrip (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriStripReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriFan (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriFanReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreateGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderReferenceGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderReferenceGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->existing, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreeGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphs (ClientPtr client) -{ - register int n; - register int i; - CARD32 *gids; - void *end; - xGlyphInfo *gi; - REQUEST(xRenderAddGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - swapl(&stuff->nglyphs, n); - if (stuff->nglyphs & 0xe0000000) - return BadLength; - end = (CARD8 *) stuff + (client->req_len << 2); - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + stuff->nglyphs); - if ((char *) end - (char *) (gids + stuff->nglyphs) < 0) - return BadLength; - if ((char *) end - (char *) (gi + stuff->nglyphs) < 0) - return BadLength; - for (i = 0; i < stuff->nglyphs; i++) - { - swapl (&gids[i], n); - swaps (&gi[i].width, n); - swaps (&gi[i].height, n); - swaps (&gi[i].x, n); - swaps (&gi[i].y, n); - swaps (&gi[i].xOff, n); - swaps (&gi[i].yOff, n); - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderFreeGlyphs (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCompositeGlyphs (ClientPtr client) -{ - register int n; - xGlyphElt *elt; - CARD8 *buffer; - CARD8 *end; - int space; - int i; - int size; - - REQUEST(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->maskFormat, n); - swapl(&stuff->glyphset, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - swaps (&elt->deltax, n); - swaps (&elt->deltay, n); - - i = elt->len; - if (i == 0xff) - { - swapl (buffer, n); - buffer += 4; - } - else - { - space = size * i; - switch (size) { - case 1: - buffer += i; - break; - case 2: - while (i--) - { - swaps (buffer, n); - buffer += 2; - } - break; - case 4: - while (i--) - { - swapl (buffer, n); - buffer += 4; - } - break; - } - if (space & 3) - buffer += 4 - (space & 3); - } - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFillRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->dst, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - swaps(&stuff->color.alpha, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateCursor (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateCursorReq); - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - swapl(&stuff->src, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureTransform (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureTransformReq); - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->transform.matrix11, n); - swapl(&stuff->transform.matrix12, n); - swapl(&stuff->transform.matrix13, n); - swapl(&stuff->transform.matrix21, n); - swapl(&stuff->transform.matrix22, n); - swapl(&stuff->transform.matrix23, n); - swapl(&stuff->transform.matrix31, n); - swapl(&stuff->transform.matrix32, n); - swapl(&stuff->transform.matrix33, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryFilters (ClientPtr client) -{ - register int n; - REQUEST (xRenderQueryFiltersReq); - REQUEST_SIZE_MATCH (xRenderQueryFiltersReq); - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureFilter (ClientPtr client) -{ - register int n; - REQUEST (xRenderSetPictureFilterReq); - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->nbytes, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateAnimCursor (ClientPtr client) -{ - register int n; - REQUEST (xRenderCreateAnimCursorReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderDispatch (ClientPtr client) -{ - REQUEST(xReq); - - if (stuff->data < RenderNumberRequests) - return (*SProcRenderVector[stuff->data]) (client); - else - return BadRequest; -} - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - -#define VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err) {\ - pPicture = SecurityLookupIDByType(client, pid, XRT_PICTURE, mode);\ - if (!pPicture) { \ - client->errorValue = pid; \ - return err; \ - } \ -} - -#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode, err) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err); \ - } \ -} \ - -int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr); - -unsigned long XRT_PICTURE; - -static int -PanoramiXRenderCreatePicture (ClientPtr client) -{ - REQUEST(xRenderCreatePictureReq); - PanoramiXRes *refDraw, *newPict; - int result = Success, j; - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) - return BadAlloc; - newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; - - if (refDraw->type == XRT_WINDOW && - stuff->drawable == WindowTable[0]->drawable.id) - { - newPict->u.pict.root = TRUE; - } - else - newPict->u.pict.root = FALSE; - - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - - FOR_NSCREENS_BACKWARD(j) { - stuff->pid = newPict->info[j].id; - stuff->drawable = refDraw->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderCreatePicture]) (client); - if(result != Success) break; - } - - if (result == Success) - AddResource(newPict->info[0].id, XRT_PICTURE, newPict); - else - xfree(newPict); - - return (result); -} - -static int -PanoramiXRenderChangePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderChangePictureReq); - - REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderChangePicture]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureClipRectangles]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderFreePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - client->errorValue = stuff->picture; - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess, - RenderErrBase + BadPicture); - - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFreePicture]) (client); - if(result != Success) break; - } - - /* Since ProcRenderFreePicture is using FreeResource, it will free - our resource for us on the last pass through the loop above */ - - return (result); -} - -static int -PanoramiXRenderComposite (ClientPtr client) -{ - PanoramiXRes *src, *msk, *dst; - int result = Success, j; - xRenderCompositeReq orig; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - orig = *stuff; - - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - stuff->xDst = orig.xDst - panoramiXdataPtr[j].x; - stuff->yDst = orig.yDst - panoramiXdataPtr[j].y; - } - if (msk) - { - stuff->mask = msk->info[j].id; - if (msk->u.pict.root) - { - stuff->xMask = orig.xMask - panoramiXdataPtr[j].x; - stuff->yMask = orig.yMask - panoramiXdataPtr[j].y; - } - } - result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client); - if(result != Success) break; - } - - return result; -} - -static int -PanoramiXRenderCompositeGlyphs (ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderCompositeGlyphsReq); - xGlyphElt origElt, *elt; - INT16 xSrc, ySrc; - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) + - sizeof (xGlyphElt))) - { - elt = (xGlyphElt *) (stuff + 1); - origElt = *elt; - xSrc = stuff->xSrc; - ySrc = stuff->ySrc; - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - elt->deltax = origElt.deltax - panoramiXdataPtr[j].x; - elt->deltay = origElt.deltay - panoramiXdataPtr[j].y; - } - result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client); - if(result != Success) break; - } - } - - return result; -} - -static int -PanoramiXRenderFillRectangles (ClientPtr client) -{ - PanoramiXRes *dst; - int result = Success, j; - REQUEST(xRenderFillRectanglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) - { - memcpy (extra, stuff + 1, extra_len); - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) - { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xRectangle *rects = (xRectangle *) (stuff + 1); - int i = extra_len / sizeof (xRectangle); - - while (i--) - { - rects->x -= x_off; - rects->y -= y_off; - rects++; - } - } - } - stuff->dst = dst->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); - if(result != Success) break; - } - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -void -PanoramiXRenderInit (void) -{ - int i; - - XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource); - for (i = 0; i < RenderNumberRequests; i++) - PanoramiXSaveRenderVector[i] = ProcRenderVector[i]; - /* - * Stuff in Xinerama aware request processing hooks - */ - ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture; - ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture; - ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles; - ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture; - ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite; - ProcRenderVector[X_RenderCompositeGlyphs8] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles; -} - -void -PanoramiXRenderReset (void) -{ - int i; - for (i = 0; i < RenderNumberRequests; i++) - ProcRenderVector[i] = PanoramiXSaveRenderVector[i]; -} - -#endif /* PANORAMIX */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c.NX.original deleted file mode 100644 index 0c81c81ef..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c.NX.original +++ /dev/null @@ -1,1103 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXresource.c" - -#else - -/************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* $Xorg: resource.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ - - -/* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */ - -/* Routines to manage various kinds of resources: - * - * CreateNewResourceType, CreateNewResourceClass, InitClientResources, - * FakeClientID, AddResource, FreeResource, FreeClientResources, - * FreeAllResources, LookupIDByType, LookupIDByClass, GetXIDRange - */ - -/* - * A resource ID is a 32 bit quantity, the upper 2 bits of which are - * off-limits for client-visible resources. The next 8 bits are - * used as client ID, and the low 22 bits come from the client. - * A resource ID is "hashed" by extracting and xoring subfields - * (varying with the size of the hash table). - * - * It is sometimes necessary for the server to create an ID that looks - * like it belongs to a client. This ID, however, must not be one - * the client actually can create, or we have the potential for conflict. - * The 31st bit of the ID is reserved for the server's use for this - * purpose. By setting CLIENT_ID(id) to the client, the SERVER_BIT to - * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a - * resource "owned" by the client. - */ -/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.12 2002/03/06 21:13:38 mvojkovi Exp $ */ - -#define NEED_EVENTS -#include "X.h" -#include "misc.h" -#include "os.h" -#include "resource.h" -#include "dixstruct.h" -#include "opaque.h" -#include "windowstr.h" -#include "dixfont.h" -#include "colormap.h" -#include "inputstr.h" -#include "dixevents.h" -#include "dixgrabs.h" -#include "cursor.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include - -#ifdef NXAGENT_SERVER - -#include "Agent.h" -#include "Font.h" -#include "Pixmaps.h" -#include "GCs.h" - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -#endif - -static void RebuildTable( -#if NeedFunctionPrototypes - int /*client*/ -#endif -); - -#define SERVER_MINID 32 - -#define INITBUCKETS 64 -#define INITHASHSIZE 6 -#define MAXHASHSIZE 11 - -typedef struct _Resource { - struct _Resource *next; - XID id; - RESTYPE type; - pointer value; -} ResourceRec, *ResourcePtr; -#define NullResource ((ResourcePtr)NULL) - -typedef struct _ClientResource { - ResourcePtr *resources; - int elements; - int buckets; - int hashsize; /* log(2)(buckets) */ - XID fakeID; - XID endFakeID; - XID expectID; -} ClientResourceRec; - -RESTYPE lastResourceType; -static RESTYPE lastResourceClass; -RESTYPE TypeMask; - -static DeleteType *DeleteFuncs = (DeleteType *)NULL; - -#ifdef XResExtension - -Atom * ResourceNames = NULL; - -void RegisterResourceName (RESTYPE type, char *name) -{ - ResourceNames[type & TypeMask] = MakeAtom(name, strlen(name), TRUE); -} - -#endif - -RESTYPE -CreateNewResourceType(deleteFunc) - DeleteType deleteFunc; -{ - RESTYPE next = lastResourceType + 1; - DeleteType *funcs; - - if (next & lastResourceClass) - return 0; - funcs = (DeleteType *)xrealloc(DeleteFuncs, - (next + 1) * sizeof(DeleteType)); - if (!funcs) - return 0; - -#ifdef XResExtension - { - Atom *newnames; - newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom)); - if(!newnames) - return 0; - ResourceNames = newnames; - ResourceNames[next] = 0; - } -#endif - - lastResourceType = next; - DeleteFuncs = funcs; - DeleteFuncs[next] = deleteFunc; - return next; -} - -RESTYPE -CreateNewResourceClass() -{ - RESTYPE next = lastResourceClass >> 1; - - if (next & lastResourceType) - return 0; - lastResourceClass = next; - TypeMask = next - 1; - return next; -} - -ClientResourceRec clientTable[MAXCLIENTS]; - -/***************** - * InitClientResources - * When a new client is created, call this to allocate space - * in resource table - *****************/ - -Bool -InitClientResources(client) - ClientPtr client; -{ - register int i, j; - - if (client == serverClient) - { - lastResourceType = RT_LASTPREDEF; - lastResourceClass = RC_LASTPREDEF; - TypeMask = RC_LASTPREDEF - 1; - if (DeleteFuncs) - xfree(DeleteFuncs); - DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) * - sizeof(DeleteType)); - if (!DeleteFuncs) - return FALSE; - DeleteFuncs[RT_NONE & TypeMask] = (DeleteType)NoopDDA; - DeleteFuncs[RT_WINDOW & TypeMask] = DeleteWindow; - DeleteFuncs[RT_PIXMAP & TypeMask] = dixDestroyPixmap; - DeleteFuncs[RT_GC & TypeMask] = FreeGC; - DeleteFuncs[RT_FONT & TypeMask] = CloseFont; - DeleteFuncs[RT_CURSOR & TypeMask] = FreeCursor; - DeleteFuncs[RT_COLORMAP & TypeMask] = FreeColormap; - DeleteFuncs[RT_CMAPENTRY & TypeMask] = FreeClientPixels; - DeleteFuncs[RT_OTHERCLIENT & TypeMask] = OtherClientGone; - DeleteFuncs[RT_PASSIVEGRAB & TypeMask] = DeletePassiveGrab; - -#ifdef XResExtension - if(ResourceNames) - xfree(ResourceNames); - ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom)); - if(!ResourceNames) - return FALSE; -#endif - } - clientTable[i = client->index].resources = - (ResourcePtr *)xalloc(INITBUCKETS*sizeof(ResourcePtr)); - if (!clientTable[i].resources) - return FALSE; - clientTable[i].buckets = INITBUCKETS; - clientTable[i].elements = 0; - clientTable[i].hashsize = INITHASHSIZE; - /* Many IDs allocated from the server client are visible to clients, - * so we don't use the SERVER_BIT for them, but we have to start - * past the magic value constants used in the protocol. For normal - * clients, we can start from zero, with SERVER_BIT set. - */ - clientTable[i].fakeID = client->clientAsMask | - (client->index ? SERVER_BIT : SERVER_MINID); - clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1; - clientTable[i].expectID = client->clientAsMask; - for (j=0; j>6) ^ (id>>12)))); - case 7: - return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13)))); - case 8: - return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16)))); - case 9: - return ((int)(0x1FF & (id ^ (id>>9)))); - case 10: - return ((int)(0x3FF & (id ^ (id>>10)))); - case 11: - return ((int)(0x7FF & (id ^ (id>>11)))); - } - return -1; -} - -static XID -#if NeedFunctionPrototypes -AvailableID( - register int client, - register XID id, - register XID maxid, - register XID goodid) -#else -AvailableID(client, id, maxid, goodid) - register int client; - register XID id, maxid, goodid; -#endif -{ - register ResourcePtr res; - - if ((goodid >= id) && (goodid <= maxid)) - return goodid; - for (; id <= maxid; id++) - { - res = clientTable[client].resources[Hash(client, id)]; - while (res && (res->id != id)) - res = res->next; - if (!res) - return id; - } - return 0; -} - -void -GetXIDRange(client, server, minp, maxp) - int client; - Bool server; - XID *minp, *maxp; -{ - register XID id, maxid; - register ResourcePtr *resp; - register ResourcePtr res; - register int i; - XID goodid; - - id = (Mask)client << CLIENTOFFSET; - if (server) - id |= client ? SERVER_BIT : SERVER_MINID; - maxid = id | RESOURCE_ID_MASK; - goodid = 0; - for (resp = clientTable[client].resources, i = clientTable[client].buckets; - --i >= 0;) - { - for (res = *resp++; res; res = res->next) - { - if ((res->id < id) || (res->id > maxid)) - continue; - if (((res->id - id) >= (maxid - res->id)) ? - (goodid = AvailableID(client, id, res->id - 1, goodid)) : - !(goodid = AvailableID(client, res->id + 1, maxid, goodid))) - maxid = res->id - 1; - else - id = res->id + 1; - } - } - if (id > maxid) - id = maxid = 0; - *minp = id; - *maxp = maxid; -} - -/* GetXIDList is called by the XC-MISC extension's MiscGetXIDList function. - * This function tries to find count unused XIDs for the given client. It - * puts the IDs in the array pids and returns the number found, which should - * almost always be the number requested. - * - * The circumstances that lead to a call to this function are very rare. - * Xlib must run out of IDs while trying to generate a request that wants - * multiple ID's, like the Multi-buffering CreateImageBuffers request. - * - * No rocket science in the implementation; just iterate over all - * possible IDs for the given client and pick the first count IDs - * that aren't in use. A more efficient algorithm could probably be - * invented, but this will be used so rarely that this should suffice. - */ - -unsigned int -GetXIDList(pClient, count, pids) - ClientPtr pClient; - unsigned int count; - XID *pids; -{ - unsigned int found = 0; - XID id = pClient->clientAsMask; - XID maxid; - - maxid = id | RESOURCE_ID_MASK; - while ( (found < count) && (id <= maxid) ) - { - if (!LookupIDByClass(id, RC_ANY)) - { - pids[found++] = id; - } - id++; - } - return found; -} - -/* - * Return the next usable fake client ID. - * - * Normally this is just the next one in line, but if we've used the last - * in the range, we need to find a new range of safe IDs to avoid - * over-running another client. - */ - -XID -FakeClientID(client) - register int client; -{ - XID id, maxid; - - id = clientTable[client].fakeID++; - if (id != clientTable[client].endFakeID) - return id; - GetXIDRange(client, TRUE, &id, &maxid); - if (!id) { - if (!client) - FatalError("FakeClientID: server internal ids exhausted\n"); - MarkClientException(clients[client]); - id = ((Mask)client << CLIENTOFFSET) | (SERVER_BIT * 3); - maxid = id | RESOURCE_ID_MASK; - } - clientTable[client].fakeID = id + 1; - clientTable[client].endFakeID = maxid + 1; - return id; -} - -#ifdef NXAGENT_SERVER - -int nxagentFindClientResource(int client, RESTYPE type, pointer value) -{ - ResourcePtr pResource; - ResourcePtr *resources; - - int i; - - for (i = 0; i < clientTable[client].buckets; i++) - { - resources = clientTable[client].resources; - - for (pResource = resources[i]; pResource; pResource = pResource -> next) - { - if (pResource -> type == type && pResource -> value == value) - { - #ifdef TEST - fprintf(stderr, "nxagentFindClientResource: Found resource [%p] type [%lu] " - "for client [%d].\n", (void *) value, - pResource -> type, client); - #endif - - return 1; - } - } - } - - return 0; -} - -int nxagentSwitchResourceType(int client, RESTYPE type, pointer value) -{ - ResourcePtr pResource; - ResourcePtr *resources; - - RESTYPE internalType = 0; - - int i; - - if (type == RT_PIXMAP) - { - internalType = RT_NX_PIXMAP; - } - else if (type == RT_GC) - { - internalType = RT_NX_GC; - } - else if (type == RT_FONT) - { - internalType = RT_NX_FONT; - } - else - { - return 0; - } - - if (client == serverClient -> index) - { - #ifdef TEST - fprintf(stderr, "nxagentSwitchResourceType: Requesting client is [%d]. Skipping the resource switch.\n", - client); - #endif - - return 0; - } - - for (i = 0; i < clientTable[serverClient -> index].buckets; i++) - { - resources = clientTable[serverClient -> index].resources; - - for (pResource = resources[i]; pResource; pResource = pResource -> next) - { - if (pResource -> type == internalType && - pResource -> value == value) - { - #ifdef TEST - fprintf(stderr, "nxagentSwitchResourceType: Changing resource [%p] type from [%lu] to " - "[%lu] for server client [%d].\n", (void *) value, - (unsigned long) pResource -> type, (unsigned long) type, serverClient -> index); - #endif - - FreeResource(pResource -> id, RT_NONE); - - return 1; - } - } - } - - return 0; -} - -#endif - -Bool -AddResource(id, type, value) - XID id; - RESTYPE type; - pointer value; -{ - int client; - register ClientResourceRec *rrec; - register ResourcePtr res, *head; - - client = CLIENT_ID(id); - rrec = &clientTable[client]; - if (!rrec->buckets) - { - ErrorF("AddResource(%x, %x, %x), client=%d \n", - id, type, (unsigned long)value, client); - FatalError("client not in use\n"); - } - -#ifdef NXAGENT_SERVER - - nxagentSwitchResourceType(client, type, value); - - #ifdef TEST - fprintf(stderr, "AddResource: Adding resource for client [%d] type [%lu] value [%p] id [%lu].\n", - client, (unsigned long) type, (void *) value, (unsigned long) id); - #endif - -#endif - - if ((rrec->elements >= 4*rrec->buckets) && - (rrec->hashsize < MAXHASHSIZE)) - RebuildTable(client); - head = &rrec->resources[Hash(client, id)]; - res = (ResourcePtr)xalloc(sizeof(ResourceRec)); - if (!res) - { - (*DeleteFuncs[type & TypeMask])(value, id); - return FALSE; - } - res->next = *head; - res->id = id; - res->type = type; - res->value = value; - *head = res; - rrec->elements++; - if (!(id & SERVER_BIT) && (id >= rrec->expectID)) - rrec->expectID = id + 1; - return TRUE; -} - -static void -RebuildTable(client) - int client; -{ - register int j; - register ResourcePtr res, next; - ResourcePtr **tails, *resources; - register ResourcePtr **tptr, *rptr; - - /* - * For now, preserve insertion order, since some ddx layers depend - * on resources being free in the opposite order they are added. - */ - - j = 2 * clientTable[client].buckets; - tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); - if (!tails) - return; - resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr)); - if (!resources) - { - DEALLOCATE_LOCAL(tails); - return; - } - for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) - { - *rptr = NullResource; - *tptr = rptr; - } - clientTable[client].hashsize++; - for (j = clientTable[client].buckets, - rptr = clientTable[client].resources; - --j >= 0; - rptr++) - { - for (res = *rptr; res; res = next) - { - next = res->next; - res->next = NullResource; - tptr = &tails[Hash(client, res->id)]; - **tptr = res; - *tptr = &res->next; - } - } - DEALLOCATE_LOCAL(tails); - clientTable[client].buckets *= 2; - xfree(clientTable[client].resources); - clientTable[client].resources = resources; -} - -void -FreeResource(id, skipDeleteFuncType) - XID id; - RESTYPE skipDeleteFuncType; -{ - int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - register int *eltptr; - int elements; - Bool gotOne = FALSE; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - head = &clientTable[cid].resources[Hash(cid, id)]; - eltptr = &clientTable[cid].elements; - - prev = head; - while ( (res = *prev) ) - { - if (res->id == id) - { - RESTYPE rtype = res->type; - *prev = res->next; - elements = --*eltptr; - if (rtype & RC_CACHED) - FlushClientCaches(res->id); - if (rtype != skipDeleteFuncType) - (*DeleteFuncs[rtype & TypeMask])(res->value, res->id); - xfree(res); - if (*eltptr != elements) - prev = head; /* prev may no longer be valid */ - gotOne = TRUE; - } - else - prev = &res->next; - } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; - } - } - if (!gotOne) - FatalError("Freeing resource id=%X which isn't there", id); -} - - -void -FreeResourceByType(id, type, skipFree) - XID id; - RESTYPE type; - Bool skipFree; -{ - int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - head = &clientTable[cid].resources[Hash(cid, id)]; - - prev = head; - while ( (res = *prev) ) - { - if (res->id == id && res->type == type) - { - *prev = res->next; - if (type & RC_CACHED) - FlushClientCaches(res->id); - if (!skipFree) - (*DeleteFuncs[type & TypeMask])(res->value, res->id); - xfree(res); - break; - } - else - prev = &res->next; - } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; - } - } -} - -/* - * Change the value associated with a resource id. Caller - * is responsible for "doing the right thing" with the old - * data - */ - -Bool -ChangeResourceValue (id, rtype, value) - XID id; - RESTYPE rtype; - pointer value; -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - { - if (rtype & RC_CACHED) - FlushClientCaches(res->id); - res->value = value; - return TRUE; - } - } - return FALSE; -} - -/* Note: if func adds or deletes resources, then func can get called - * more than once for some resources. If func adds new resources, - * func might or might not get called for them. func cannot both - * add and delete an equal number of resources! - */ - -void -FindClientResourcesByType( - ClientPtr client, - RESTYPE type, - FindResType func, - pointer cdata -){ - register ResourcePtr *resources; - register ResourcePtr this, next; - int i, elements; - register int *eltptr; - - if (!client) - client = serverClient; - - resources = clientTable[client->index].resources; - eltptr = &clientTable[client->index].elements; - for (i = 0; i < clientTable[client->index].buckets; i++) - { - for (this = resources[i]; this; this = next) - { - next = this->next; - if (!type || this->type == type) { - elements = *eltptr; - (*func)(this->value, this->id, cdata); - if (*eltptr != elements) - next = resources[i]; /* start over */ - } - } - } -} - -void -FindAllClientResources( - ClientPtr client, - FindAllRes func, - pointer cdata -){ - register ResourcePtr *resources; - register ResourcePtr this, next; - int i, elements; - register int *eltptr; - - if (!client) - client = serverClient; - - resources = clientTable[client->index].resources; - eltptr = &clientTable[client->index].elements; - for (i = 0; i < clientTable[client->index].buckets; i++) - { - for (this = resources[i]; this; this = next) - { - next = this->next; - elements = *eltptr; - (*func)(this->value, this->id, this->type, cdata); - if (*eltptr != elements) - next = resources[i]; /* start over */ - } - } -} - - -pointer -LookupClientResourceComplex( - ClientPtr client, - RESTYPE type, - FindComplexResType func, - pointer cdata -){ - ResourcePtr *resources; - ResourcePtr this; - int i; - - if (!client) - client = serverClient; - - resources = clientTable[client->index].resources; - for (i = 0; i < clientTable[client->index].buckets; i++) { - for (this = resources[i]; this; this = this->next) { - if (!type || this->type == type) { - if((*func)(this->value, this->id, cdata)) - return this->value; - } - } - } - return NULL; -} - - -void -FreeClientNeverRetainResources(ClientPtr client) -{ - ResourcePtr *resources; - ResourcePtr this; - ResourcePtr *prev; - int j; - - if (!client) - return; - - resources = clientTable[client->index].resources; - for (j=0; j < clientTable[client->index].buckets; j++) - { - prev = &resources[j]; - while ( (this = *prev) ) - { - RESTYPE rtype = this->type; - if (rtype & RC_NEVERRETAIN) - { - *prev = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); - (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); - } - else - prev = &this->next; - } - } -} - -void -FreeClientResources(client) - ClientPtr client; -{ - register ResourcePtr *resources; - register ResourcePtr this; - int j; - - /* This routine shouldn't be called with a null client, but just in - case ... */ - - if (!client) - return; - - HandleSaveSet(client); - - resources = clientTable[client->index].resources; - for (j=0; j < clientTable[client->index].buckets; j++) - { - /* It may seem silly to update the head of this resource list as - we delete the members, since the entire list will be deleted any way, - but there are some resource deletion functions "FreeClientPixels" for - one which do a LookupID on another resource id (a Colormap id in this - case), so the resource list must be kept valid up to the point that - it is deleted, so every time we delete a resource, we must update the - head, just like in FreeResource. I hope that this doesn't slow down - mass deletion appreciably. PRH */ - - ResourcePtr *head; - - head = &resources[j]; - - for (this = *head; this; this = *head) - { - RESTYPE rtype = this->type; - *head = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); - (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); - } - } - xfree(clientTable[client->index].resources); - clientTable[client->index].resources = NULL; - clientTable[client->index].buckets = 0; -} - -void -FreeAllResources() -{ - int i; - - for (i = currentMaxClients; --i >= 0; ) - { - if (clientTable[i].buckets) - FreeClientResources(clients[i]); - } -} - -Bool -LegalNewID(id, client) - XID id; - register ClientPtr client; -{ - -#ifdef PANORAMIX - XID minid, maxid; - - if (!noPanoramiXExtension) { - minid = client->clientAsMask | (client->index ? - SERVER_BIT : SERVER_MINID); - maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; - if ((id >= minid) && (id <= maxid)) - return TRUE; - } -#endif /* PANORAMIX */ - return ((client->clientAsMask == (id & ~RESOURCE_ID_MASK)) && - ((clientTable[client->index].expectID <= id) || - !LookupIDByClass(id, RC_ANY))); -} - -#ifdef XCSECURITY - -/* SecurityLookupIDByType and SecurityLookupIDByClass: - * These are the heart of the resource ID security system. They take - * two additional arguments compared to the old LookupID functions: - * the client doing the lookup, and the access mode (see resource.h). - * The resource is returned if it exists and the client is allowed access, - * else NULL is returned. - */ - -pointer -SecurityLookupIDByType(client, id, rtype, mode) - ClientPtr client; - XID id; - RESTYPE rtype; - Mask mode; -{ - int cid; - register ResourcePtr res; - pointer retval = NULL; - - assert(client == NullClient || - (client->index <= currentMaxClients && clients[client->index] == client)); - assert( (rtype & TypeMask) <= lastResourceType); - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - { - retval = res->value; - break; - } - } - if (retval && client && client->CheckAccess) - retval = (* client->CheckAccess)(client, id, rtype, mode, retval); - return retval; -} - - -pointer -SecurityLookupIDByClass(client, id, classes, mode) - ClientPtr client; - XID id; - RESTYPE classes; - Mask mode; -{ - int cid; - register ResourcePtr res = NULL; - pointer retval = NULL; - - assert(client == NullClient || - (client->index <= currentMaxClients && clients[client->index] == client)); - assert (classes >= lastResourceClass); - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type & classes)) - { - retval = res->value; - break; - } - } - if (retval && client && client->CheckAccess) - retval = (* client->CheckAccess)(client, id, res->type, mode, retval); - return retval; -} - -/* We can't replace the LookupIDByType and LookupIDByClass functions with - * macros because of compatibility with loadable servers. - */ - -pointer -LookupIDByType(id, rtype) - XID id; - RESTYPE rtype; -{ - return SecurityLookupIDByType(NullClient, id, rtype, - SecurityUnknownAccess); -} - -pointer -LookupIDByClass(id, classes) - XID id; - RESTYPE classes; -{ - return SecurityLookupIDByClass(NullClient, id, classes, - SecurityUnknownAccess); -} - -#else /* not XCSECURITY */ - -/* - * LookupIDByType returns the object with the given id and type, else NULL. - */ -pointer -LookupIDByType(id, rtype) - XID id; - RESTYPE rtype; -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - return res->value; - } - return (pointer)NULL; -} - -/* - * LookupIDByClass returns the object with the given id and any one of the - * given classes, else NULL. - */ -pointer -LookupIDByClass(id, classes) - XID id; - RESTYPE classes; -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type & classes)) - return res->value; - } - return (pointer)NULL; -} - -#endif /* XCSECURITY */ - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c.XF86.original deleted file mode 100644 index d17586a77..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c.XF86.original +++ /dev/null @@ -1,975 +0,0 @@ -/************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* $Xorg: resource.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ - - -/* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */ - -/* Routines to manage various kinds of resources: - * - * CreateNewResourceType, CreateNewResourceClass, InitClientResources, - * FakeClientID, AddResource, FreeResource, FreeClientResources, - * FreeAllResources, LookupIDByType, LookupIDByClass, GetXIDRange - */ - -/* - * A resource ID is a 32 bit quantity, the upper 2 bits of which are - * off-limits for client-visible resources. The next 8 bits are - * used as client ID, and the low 22 bits come from the client. - * A resource ID is "hashed" by extracting and xoring subfields - * (varying with the size of the hash table). - * - * It is sometimes necessary for the server to create an ID that looks - * like it belongs to a client. This ID, however, must not be one - * the client actually can create, or we have the potential for conflict. - * The 31st bit of the ID is reserved for the server's use for this - * purpose. By setting CLIENT_ID(id) to the client, the SERVER_BIT to - * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a - * resource "owned" by the client. - */ -/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.12 2002/03/06 21:13:38 mvojkovi Exp $ */ - -#define NEED_EVENTS -#include "X.h" -#include "misc.h" -#include "os.h" -#include "resource.h" -#include "dixstruct.h" -#include "opaque.h" -#include "windowstr.h" -#include "dixfont.h" -#include "colormap.h" -#include "inputstr.h" -#include "dixevents.h" -#include "dixgrabs.h" -#include "cursor.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include - -static void RebuildTable( -#if NeedFunctionPrototypes - int /*client*/ -#endif -); - -#define SERVER_MINID 32 - -#define INITBUCKETS 64 -#define INITHASHSIZE 6 -#define MAXHASHSIZE 11 - -typedef struct _Resource { - struct _Resource *next; - XID id; - RESTYPE type; - pointer value; -} ResourceRec, *ResourcePtr; -#define NullResource ((ResourcePtr)NULL) - -typedef struct _ClientResource { - ResourcePtr *resources; - int elements; - int buckets; - int hashsize; /* log(2)(buckets) */ - XID fakeID; - XID endFakeID; - XID expectID; -} ClientResourceRec; - -RESTYPE lastResourceType; -static RESTYPE lastResourceClass; -RESTYPE TypeMask; - -static DeleteType *DeleteFuncs = (DeleteType *)NULL; - -#ifdef XResExtension - -Atom * ResourceNames = NULL; - -void RegisterResourceName (RESTYPE type, char *name) -{ - ResourceNames[type & TypeMask] = MakeAtom(name, strlen(name), TRUE); -} - -#endif - -RESTYPE -CreateNewResourceType(deleteFunc) - DeleteType deleteFunc; -{ - RESTYPE next = lastResourceType + 1; - DeleteType *funcs; - - if (next & lastResourceClass) - return 0; - funcs = (DeleteType *)xrealloc(DeleteFuncs, - (next + 1) * sizeof(DeleteType)); - if (!funcs) - return 0; - -#ifdef XResExtension - { - Atom *newnames; - newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom)); - if(!newnames) - return 0; - ResourceNames = newnames; - ResourceNames[next] = 0; - } -#endif - - lastResourceType = next; - DeleteFuncs = funcs; - DeleteFuncs[next] = deleteFunc; - return next; -} - -RESTYPE -CreateNewResourceClass() -{ - RESTYPE next = lastResourceClass >> 1; - - if (next & lastResourceType) - return 0; - lastResourceClass = next; - TypeMask = next - 1; - return next; -} - -ClientResourceRec clientTable[MAXCLIENTS]; - -/***************** - * InitClientResources - * When a new client is created, call this to allocate space - * in resource table - *****************/ - -Bool -InitClientResources(client) - ClientPtr client; -{ - register int i, j; - - if (client == serverClient) - { - lastResourceType = RT_LASTPREDEF; - lastResourceClass = RC_LASTPREDEF; - TypeMask = RC_LASTPREDEF - 1; - if (DeleteFuncs) - xfree(DeleteFuncs); - DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) * - sizeof(DeleteType)); - if (!DeleteFuncs) - return FALSE; - DeleteFuncs[RT_NONE & TypeMask] = (DeleteType)NoopDDA; - DeleteFuncs[RT_WINDOW & TypeMask] = DeleteWindow; - DeleteFuncs[RT_PIXMAP & TypeMask] = dixDestroyPixmap; - DeleteFuncs[RT_GC & TypeMask] = FreeGC; - DeleteFuncs[RT_FONT & TypeMask] = CloseFont; - DeleteFuncs[RT_CURSOR & TypeMask] = FreeCursor; - DeleteFuncs[RT_COLORMAP & TypeMask] = FreeColormap; - DeleteFuncs[RT_CMAPENTRY & TypeMask] = FreeClientPixels; - DeleteFuncs[RT_OTHERCLIENT & TypeMask] = OtherClientGone; - DeleteFuncs[RT_PASSIVEGRAB & TypeMask] = DeletePassiveGrab; - -#ifdef XResExtension - if(ResourceNames) - xfree(ResourceNames); - ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom)); - if(!ResourceNames) - return FALSE; -#endif - } - clientTable[i = client->index].resources = - (ResourcePtr *)xalloc(INITBUCKETS*sizeof(ResourcePtr)); - if (!clientTable[i].resources) - return FALSE; - clientTable[i].buckets = INITBUCKETS; - clientTable[i].elements = 0; - clientTable[i].hashsize = INITHASHSIZE; - /* Many IDs allocated from the server client are visible to clients, - * so we don't use the SERVER_BIT for them, but we have to start - * past the magic value constants used in the protocol. For normal - * clients, we can start from zero, with SERVER_BIT set. - */ - clientTable[i].fakeID = client->clientAsMask | - (client->index ? SERVER_BIT : SERVER_MINID); - clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1; - clientTable[i].expectID = client->clientAsMask; - for (j=0; j>6) ^ (id>>12)))); - case 7: - return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13)))); - case 8: - return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16)))); - case 9: - return ((int)(0x1FF & (id ^ (id>>9)))); - case 10: - return ((int)(0x3FF & (id ^ (id>>10)))); - case 11: - return ((int)(0x7FF & (id ^ (id>>11)))); - } - return -1; -} - -static XID -#if NeedFunctionPrototypes -AvailableID( - register int client, - register XID id, - register XID maxid, - register XID goodid) -#else -AvailableID(client, id, maxid, goodid) - register int client; - register XID id, maxid, goodid; -#endif -{ - register ResourcePtr res; - - if ((goodid >= id) && (goodid <= maxid)) - return goodid; - for (; id <= maxid; id++) - { - res = clientTable[client].resources[Hash(client, id)]; - while (res && (res->id != id)) - res = res->next; - if (!res) - return id; - } - return 0; -} - -void -GetXIDRange(client, server, minp, maxp) - int client; - Bool server; - XID *minp, *maxp; -{ - register XID id, maxid; - register ResourcePtr *resp; - register ResourcePtr res; - register int i; - XID goodid; - - id = (Mask)client << CLIENTOFFSET; - if (server) - id |= client ? SERVER_BIT : SERVER_MINID; - maxid = id | RESOURCE_ID_MASK; - goodid = 0; - for (resp = clientTable[client].resources, i = clientTable[client].buckets; - --i >= 0;) - { - for (res = *resp++; res; res = res->next) - { - if ((res->id < id) || (res->id > maxid)) - continue; - if (((res->id - id) >= (maxid - res->id)) ? - (goodid = AvailableID(client, id, res->id - 1, goodid)) : - !(goodid = AvailableID(client, res->id + 1, maxid, goodid))) - maxid = res->id - 1; - else - id = res->id + 1; - } - } - if (id > maxid) - id = maxid = 0; - *minp = id; - *maxp = maxid; -} - -/* GetXIDList is called by the XC-MISC extension's MiscGetXIDList function. - * This function tries to find count unused XIDs for the given client. It - * puts the IDs in the array pids and returns the number found, which should - * almost always be the number requested. - * - * The circumstances that lead to a call to this function are very rare. - * Xlib must run out of IDs while trying to generate a request that wants - * multiple ID's, like the Multi-buffering CreateImageBuffers request. - * - * No rocket science in the implementation; just iterate over all - * possible IDs for the given client and pick the first count IDs - * that aren't in use. A more efficient algorithm could probably be - * invented, but this will be used so rarely that this should suffice. - */ - -unsigned int -GetXIDList(pClient, count, pids) - ClientPtr pClient; - unsigned int count; - XID *pids; -{ - unsigned int found = 0; - XID id = pClient->clientAsMask; - XID maxid; - - maxid = id | RESOURCE_ID_MASK; - while ( (found < count) && (id <= maxid) ) - { - if (!LookupIDByClass(id, RC_ANY)) - { - pids[found++] = id; - } - id++; - } - return found; -} - -/* - * Return the next usable fake client ID. - * - * Normally this is just the next one in line, but if we've used the last - * in the range, we need to find a new range of safe IDs to avoid - * over-running another client. - */ - -XID -FakeClientID(client) - register int client; -{ - XID id, maxid; - - id = clientTable[client].fakeID++; - if (id != clientTable[client].endFakeID) - return id; - GetXIDRange(client, TRUE, &id, &maxid); - if (!id) { - if (!client) - FatalError("FakeClientID: server internal ids exhausted\n"); - MarkClientException(clients[client]); - id = ((Mask)client << CLIENTOFFSET) | (SERVER_BIT * 3); - maxid = id | RESOURCE_ID_MASK; - } - clientTable[client].fakeID = id + 1; - clientTable[client].endFakeID = maxid + 1; - return id; -} - -Bool -AddResource(id, type, value) - XID id; - RESTYPE type; - pointer value; -{ - int client; - register ClientResourceRec *rrec; - register ResourcePtr res, *head; - - client = CLIENT_ID(id); - rrec = &clientTable[client]; - if (!rrec->buckets) - { - ErrorF("AddResource(%x, %x, %x), client=%d \n", - id, type, (unsigned long)value, client); - FatalError("client not in use\n"); - } - if ((rrec->elements >= 4*rrec->buckets) && - (rrec->hashsize < MAXHASHSIZE)) - RebuildTable(client); - head = &rrec->resources[Hash(client, id)]; - res = (ResourcePtr)xalloc(sizeof(ResourceRec)); - if (!res) - { - (*DeleteFuncs[type & TypeMask])(value, id); - return FALSE; - } - res->next = *head; - res->id = id; - res->type = type; - res->value = value; - *head = res; - rrec->elements++; - if (!(id & SERVER_BIT) && (id >= rrec->expectID)) - rrec->expectID = id + 1; - return TRUE; -} - -static void -RebuildTable(client) - int client; -{ - register int j; - register ResourcePtr res, next; - ResourcePtr **tails, *resources; - register ResourcePtr **tptr, *rptr; - - /* - * For now, preserve insertion order, since some ddx layers depend - * on resources being free in the opposite order they are added. - */ - - j = 2 * clientTable[client].buckets; - tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); - if (!tails) - return; - resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr)); - if (!resources) - { - DEALLOCATE_LOCAL(tails); - return; - } - for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) - { - *rptr = NullResource; - *tptr = rptr; - } - clientTable[client].hashsize++; - for (j = clientTable[client].buckets, - rptr = clientTable[client].resources; - --j >= 0; - rptr++) - { - for (res = *rptr; res; res = next) - { - next = res->next; - res->next = NullResource; - tptr = &tails[Hash(client, res->id)]; - **tptr = res; - *tptr = &res->next; - } - } - DEALLOCATE_LOCAL(tails); - clientTable[client].buckets *= 2; - xfree(clientTable[client].resources); - clientTable[client].resources = resources; -} - -void -FreeResource(id, skipDeleteFuncType) - XID id; - RESTYPE skipDeleteFuncType; -{ - int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - register int *eltptr; - int elements; - Bool gotOne = FALSE; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - head = &clientTable[cid].resources[Hash(cid, id)]; - eltptr = &clientTable[cid].elements; - - prev = head; - while ( (res = *prev) ) - { - if (res->id == id) - { - RESTYPE rtype = res->type; - *prev = res->next; - elements = --*eltptr; - if (rtype & RC_CACHED) - FlushClientCaches(res->id); - if (rtype != skipDeleteFuncType) - (*DeleteFuncs[rtype & TypeMask])(res->value, res->id); - xfree(res); - if (*eltptr != elements) - prev = head; /* prev may no longer be valid */ - gotOne = TRUE; - } - else - prev = &res->next; - } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; - } - } - if (!gotOne) - FatalError("Freeing resource id=%X which isn't there", id); -} - - -void -FreeResourceByType(id, type, skipFree) - XID id; - RESTYPE type; - Bool skipFree; -{ - int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - head = &clientTable[cid].resources[Hash(cid, id)]; - - prev = head; - while ( (res = *prev) ) - { - if (res->id == id && res->type == type) - { - *prev = res->next; - if (type & RC_CACHED) - FlushClientCaches(res->id); - if (!skipFree) - (*DeleteFuncs[type & TypeMask])(res->value, res->id); - xfree(res); - break; - } - else - prev = &res->next; - } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; - } - } -} - -/* - * Change the value associated with a resource id. Caller - * is responsible for "doing the right thing" with the old - * data - */ - -Bool -ChangeResourceValue (id, rtype, value) - XID id; - RESTYPE rtype; - pointer value; -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - { - if (rtype & RC_CACHED) - FlushClientCaches(res->id); - res->value = value; - return TRUE; - } - } - return FALSE; -} - -/* Note: if func adds or deletes resources, then func can get called - * more than once for some resources. If func adds new resources, - * func might or might not get called for them. func cannot both - * add and delete an equal number of resources! - */ - -void -FindClientResourcesByType( - ClientPtr client, - RESTYPE type, - FindResType func, - pointer cdata -){ - register ResourcePtr *resources; - register ResourcePtr this, next; - int i, elements; - register int *eltptr; - - if (!client) - client = serverClient; - - resources = clientTable[client->index].resources; - eltptr = &clientTable[client->index].elements; - for (i = 0; i < clientTable[client->index].buckets; i++) - { - for (this = resources[i]; this; this = next) - { - next = this->next; - if (!type || this->type == type) { - elements = *eltptr; - (*func)(this->value, this->id, cdata); - if (*eltptr != elements) - next = resources[i]; /* start over */ - } - } - } -} - -void -FindAllClientResources( - ClientPtr client, - FindAllRes func, - pointer cdata -){ - register ResourcePtr *resources; - register ResourcePtr this, next; - int i, elements; - register int *eltptr; - - if (!client) - client = serverClient; - - resources = clientTable[client->index].resources; - eltptr = &clientTable[client->index].elements; - for (i = 0; i < clientTable[client->index].buckets; i++) - { - for (this = resources[i]; this; this = next) - { - next = this->next; - elements = *eltptr; - (*func)(this->value, this->id, this->type, cdata); - if (*eltptr != elements) - next = resources[i]; /* start over */ - } - } -} - - -pointer -LookupClientResourceComplex( - ClientPtr client, - RESTYPE type, - FindComplexResType func, - pointer cdata -){ - ResourcePtr *resources; - ResourcePtr this; - int i; - - if (!client) - client = serverClient; - - resources = clientTable[client->index].resources; - for (i = 0; i < clientTable[client->index].buckets; i++) { - for (this = resources[i]; this; this = this->next) { - if (!type || this->type == type) { - if((*func)(this->value, this->id, cdata)) - return this->value; - } - } - } - return NULL; -} - - -void -FreeClientNeverRetainResources(ClientPtr client) -{ - ResourcePtr *resources; - ResourcePtr this; - ResourcePtr *prev; - int j; - - if (!client) - return; - - resources = clientTable[client->index].resources; - for (j=0; j < clientTable[client->index].buckets; j++) - { - prev = &resources[j]; - while ( (this = *prev) ) - { - RESTYPE rtype = this->type; - if (rtype & RC_NEVERRETAIN) - { - *prev = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); - (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); - } - else - prev = &this->next; - } - } -} - -void -FreeClientResources(client) - ClientPtr client; -{ - register ResourcePtr *resources; - register ResourcePtr this; - int j; - - /* This routine shouldn't be called with a null client, but just in - case ... */ - - if (!client) - return; - - HandleSaveSet(client); - - resources = clientTable[client->index].resources; - for (j=0; j < clientTable[client->index].buckets; j++) - { - /* It may seem silly to update the head of this resource list as - we delete the members, since the entire list will be deleted any way, - but there are some resource deletion functions "FreeClientPixels" for - one which do a LookupID on another resource id (a Colormap id in this - case), so the resource list must be kept valid up to the point that - it is deleted, so every time we delete a resource, we must update the - head, just like in FreeResource. I hope that this doesn't slow down - mass deletion appreciably. PRH */ - - ResourcePtr *head; - - head = &resources[j]; - - for (this = *head; this; this = *head) - { - RESTYPE rtype = this->type; - *head = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); - (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); - } - } - xfree(clientTable[client->index].resources); - clientTable[client->index].resources = NULL; - clientTable[client->index].buckets = 0; -} - -void -FreeAllResources() -{ - int i; - - for (i = currentMaxClients; --i >= 0; ) - { - if (clientTable[i].buckets) - FreeClientResources(clients[i]); - } -} - -Bool -LegalNewID(id, client) - XID id; - register ClientPtr client; -{ - -#ifdef PANORAMIX - XID minid, maxid; - - if (!noPanoramiXExtension) { - minid = client->clientAsMask | (client->index ? - SERVER_BIT : SERVER_MINID); - maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; - if ((id >= minid) && (id <= maxid)) - return TRUE; - } -#endif /* PANORAMIX */ - return ((client->clientAsMask == (id & ~RESOURCE_ID_MASK)) && - ((clientTable[client->index].expectID <= id) || - !LookupIDByClass(id, RC_ANY))); -} - -#ifdef XCSECURITY - -/* SecurityLookupIDByType and SecurityLookupIDByClass: - * These are the heart of the resource ID security system. They take - * two additional arguments compared to the old LookupID functions: - * the client doing the lookup, and the access mode (see resource.h). - * The resource is returned if it exists and the client is allowed access, - * else NULL is returned. - */ - -pointer -SecurityLookupIDByType(client, id, rtype, mode) - ClientPtr client; - XID id; - RESTYPE rtype; - Mask mode; -{ - int cid; - register ResourcePtr res; - pointer retval = NULL; - - assert(client == NullClient || - (client->index <= currentMaxClients && clients[client->index] == client)); - assert( (rtype & TypeMask) <= lastResourceType); - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - { - retval = res->value; - break; - } - } - if (retval && client && client->CheckAccess) - retval = (* client->CheckAccess)(client, id, rtype, mode, retval); - return retval; -} - - -pointer -SecurityLookupIDByClass(client, id, classes, mode) - ClientPtr client; - XID id; - RESTYPE classes; - Mask mode; -{ - int cid; - register ResourcePtr res = NULL; - pointer retval = NULL; - - assert(client == NullClient || - (client->index <= currentMaxClients && clients[client->index] == client)); - assert (classes >= lastResourceClass); - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type & classes)) - { - retval = res->value; - break; - } - } - if (retval && client && client->CheckAccess) - retval = (* client->CheckAccess)(client, id, res->type, mode, retval); - return retval; -} - -/* We can't replace the LookupIDByType and LookupIDByClass functions with - * macros because of compatibility with loadable servers. - */ - -pointer -LookupIDByType(id, rtype) - XID id; - RESTYPE rtype; -{ - return SecurityLookupIDByType(NullClient, id, rtype, - SecurityUnknownAccess); -} - -pointer -LookupIDByClass(id, classes) - XID id; - RESTYPE classes; -{ - return SecurityLookupIDByClass(NullClient, id, classes, - SecurityUnknownAccess); -} - -#else /* not XCSECURITY */ - -/* - * LookupIDByType returns the object with the given id and type, else NULL. - */ -pointer -LookupIDByType(id, rtype) - XID id; - RESTYPE rtype; -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - return res->value; - } - return (pointer)NULL; -} - -/* - * LookupIDByClass returns the object with the given id and any one of the - * given classes, else NULL. - */ -pointer -LookupIDByClass(id, classes) - XID id; - RESTYPE classes; -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type & classes)) - return res->value; - } - return (pointer)NULL; -} - -#endif /* XCSECURITY */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c.NX.original deleted file mode 100644 index e70415a7d..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c.NX.original +++ /dev/null @@ -1,1425 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXshm.c" - -#else - -/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.36 2002/04/03 19:51:11 herrb Exp $ */ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -********************************************************/ - -/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ - -/* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ - -#include -#ifndef Lynx -#include -#include -#else -#include -#include -#endif -#include -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "extnsionst.h" -#include "servermd.h" -#define _XSHM_SERVER_ -#include "shmstr.h" -#include "Xfuncproto.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -#include "Trap.h" -#include "Agent.h" -#include "Drawable.h" -#include "Pixmaps.h" - -/* - * Set here the required log level. - */ - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -extern void fbGetImage(DrawablePtr pDrw, int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, char *d); - -extern void fbPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, int format, - char *pImage); - -typedef struct _ShmDesc { - struct _ShmDesc *next; - int shmid; - int refcnt; - char *addr; - Bool writable; - unsigned long size; -} ShmDescRec, *ShmDescPtr; - -static void miShmPutImage(XSHM_PUT_IMAGE_ARGS); -static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS); -static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); -static int ShmDetachSegment( -#if NeedFunctionPrototypes - pointer /* value */, - XID /* shmseg */ -#endif - ); -static void ShmResetProc( -#if NeedFunctionPrototypes - ExtensionEntry * /* extEntry */ -#endif - ); -static void SShmCompletionEvent( -#if NeedFunctionPrototypes - xShmCompletionEvent * /* from */, - xShmCompletionEvent * /* to */ -#endif - ); - -static Bool ShmDestroyPixmap (PixmapPtr pPixmap); - -static DISPATCH_PROC(ProcShmAttach); -static DISPATCH_PROC(ProcShmCreatePixmap); -static DISPATCH_PROC(ProcShmDetach); -static DISPATCH_PROC(ProcShmDispatch); -static DISPATCH_PROC(ProcShmGetImage); -static DISPATCH_PROC(ProcShmPutImage); -static DISPATCH_PROC(ProcShmQueryVersion); -static DISPATCH_PROC(SProcShmAttach); -static DISPATCH_PROC(SProcShmCreatePixmap); -static DISPATCH_PROC(SProcShmDetach); -static DISPATCH_PROC(SProcShmDispatch); -static DISPATCH_PROC(SProcShmGetImage); -static DISPATCH_PROC(SProcShmPutImage); -static DISPATCH_PROC(SProcShmQueryVersion); - -static unsigned char ShmReqCode; -int ShmCompletionCode; -int BadShmSegCode; -RESTYPE ShmSegType; -static ShmDescPtr Shmsegs; -static Bool sharedPixmaps; -static int pixmapFormat; -static int shmPixFormat[MAXSCREENS]; -static ShmFuncsPtr shmFuncs[MAXSCREENS]; -static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS]; -#ifdef PIXPRIV -static int shmPixmapPrivate; -#endif -static ShmFuncs miFuncs = {NULL, miShmPutImage}; -static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage}; - -#define VERIFY_SHMSEG(shmseg,shmdesc,client) \ -{ \ - shmdesc = (ShmDescPtr)LookupIDByType(shmseg, ShmSegType); \ - if (!shmdesc) \ - { \ - client->errorValue = shmseg; \ - return BadShmSegCode; \ - } \ -} - -#define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \ -{ \ - VERIFY_SHMSEG(shmseg, shmdesc, client); \ - if ((offset & 3) || (offset > shmdesc->size)) \ - { \ - client->errorValue = offset; \ - return BadValue; \ - } \ - if (needwrite && !shmdesc->writable) \ - return BadAccess; \ -} - -#define VERIFY_SHMSIZE(shmdesc,offset,len,client) \ -{ \ - if ((offset + len) > shmdesc->size) \ - { \ - return BadAccess; \ - } \ -} - - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) -#include - -static Bool badSysCall = FALSE; - -static void -SigSysHandler(signo) -int signo; -{ - badSysCall = TRUE; -} - -static Bool CheckForShmSyscall() -{ - void (*oldHandler)(); - int shmid = -1; - - /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ - oldHandler = signal(SIGSYS, SigSysHandler); - - badSysCall = FALSE; - shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); - /* Clean up */ - if (shmid != -1) - { - shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL); - } - signal(SIGSYS, oldHandler); - return(!badSysCall); -} -#endif - -void -ShmExtensionInit() -{ - ExtensionEntry *extEntry; - int i; - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) - if (!CheckForShmSyscall()) - { - ErrorF("MIT-SHM extension disabled due to lack of kernel support\n"); - return; - } -#endif - - if (nxagentOption(SharedMemory) == False) - { - return; - } - - sharedPixmaps = xFalse; - pixmapFormat = 0; - { - sharedPixmaps = nxagentOption(SharedPixmaps); - pixmapFormat = shmPixFormat[0]; - for (i = 0; i < screenInfo.numScreens; i++) - { - if (!shmFuncs[i]) - { - #ifdef TEST - fprintf(stderr, "ShmExtensionInit: Registering shmFuncs as miFuncs.\n"); - #endif - shmFuncs[i] = &miFuncs; - } - if (!shmFuncs[i]->CreatePixmap) - sharedPixmaps = xFalse; - if (shmPixFormat[i] && (shmPixFormat[i] != pixmapFormat)) - { - sharedPixmaps = xFalse; - pixmapFormat = 0; - } - } - if (!pixmapFormat) - pixmapFormat = ZPixmap; - if (sharedPixmaps) - { - for (i = 0; i < screenInfo.numScreens; i++) - { - destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap; - screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap; - } -#ifdef PIXPRIV - shmPixmapPrivate = AllocatePixmapPrivateIndex(); - for (i = 0; i < screenInfo.numScreens; i++) - { - if (!AllocatePixmapPrivate(screenInfo.screens[i], - shmPixmapPrivate, 0)) - return; - } -#endif - } - } - ShmSegType = CreateNewResourceType(ShmDetachSegment); - if (ShmSegType && - (extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors, - ProcShmDispatch, SProcShmDispatch, - ShmResetProc, StandardMinorOpcode))) - { - ShmReqCode = (unsigned char)extEntry->base; - ShmCompletionCode = extEntry->eventBase; - BadShmSegCode = extEntry->errorBase; - EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent; - } -} - -/*ARGSUSED*/ -static void -ShmResetProc (extEntry) -ExtensionEntry *extEntry; -{ - int i; - - for (i = 0; i < MAXSCREENS; i++) - { - shmFuncs[i] = (ShmFuncsPtr)NULL; - shmPixFormat[i] = 0; - } -} - -void -ShmRegisterFuncs(pScreen, funcs) - ScreenPtr pScreen; - ShmFuncsPtr funcs; -{ - shmFuncs[pScreen->myNum] = funcs; -} - -void -ShmSetPixmapFormat(pScreen, format) - ScreenPtr pScreen; - int format; -{ - shmPixFormat[pScreen->myNum] = format; -} - -static Bool -ShmDestroyPixmap (PixmapPtr pPixmap) -{ - ScreenPtr pScreen = pPixmap->drawable.pScreen; - Bool ret; - if (pPixmap->refcnt == 1) - { - ShmDescPtr shmdesc; -#ifdef PIXPRIV - shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr; -#else - char *base = (char *) pPixmap->devPrivate.ptr; - - if (base != (pointer) (pPixmap + 1)) - { - for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next) - { - if (shmdesc->addr <= base && base <= shmdesc->addr + shmdesc->size) - break; - } - } - else - shmdesc = 0; -#endif - if (shmdesc) - ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id); - } - - pScreen->DestroyPixmap = destroyPixmap[pScreen->myNum]; - ret = (*pScreen->DestroyPixmap) (pPixmap); - destroyPixmap[pScreen->myNum] = pScreen->DestroyPixmap; - pScreen->DestroyPixmap = ShmDestroyPixmap; - return ret; -} - -void -ShmRegisterFbFuncs(pScreen) - ScreenPtr pScreen; -{ - #ifdef TEST - fprintf(stderr, "ShmRegisterFbFuncs: Registering shmFuncs as fbFuncs.\n"); - #endif - shmFuncs[pScreen->myNum] = &fbFuncs; -} - -static int -ProcShmQueryVersion(client) - register ClientPtr client; -{ - xShmQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xShmQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.sharedPixmaps = sharedPixmaps; - rep.pixmapFormat = pixmapFormat; - rep.majorVersion = SHM_MAJOR_VERSION; - rep.minorVersion = SHM_MINOR_VERSION; - rep.uid = geteuid(); - rep.gid = getegid(); - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - swaps(&rep.uid, n); - swaps(&rep.gid, n); - } - WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -/* - * Simulate the access() system call for a shared memory segement, - * using the credentials from the client if available - */ -static int -shm_access(ClientPtr client, struct ipc_perm *perm, int readonly) -{ - int uid, gid; - mode_t mask; - - if (LocalClientCred(client, &uid, &gid) != -1) { - - /* User id 0 always gets access */ - if (uid == 0) { - return 0; - } - /* Check the owner */ - if (perm->uid == uid || perm->cuid == uid) { - mask = S_IRUSR; - if (!readonly) { - mask |= S_IWUSR; - } - return (perm->mode & mask) == mask ? 0 : -1; - } - /* Check the group */ - if (perm->gid == gid || perm->cgid == gid) { - mask = S_IRGRP; - if (!readonly) { - mask |= S_IWGRP; - } - return (perm->mode & mask) == mask ? 0 : -1; - } - } - /* Otherwise, check everyone else */ - mask = S_IROTH; - if (!readonly) { - mask |= S_IWOTH; - } - return (perm->mode & mask) == mask ? 0 : -1; -} - -static int -ProcShmAttach(client) - register ClientPtr client; -{ - struct shmid_ds buf; - ShmDescPtr shmdesc; - REQUEST(xShmAttachReq); - - REQUEST_SIZE_MATCH(xShmAttachReq); - LEGAL_NEW_RESOURCE(stuff->shmseg, client); - if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) - { - client->errorValue = stuff->readOnly; - return(BadValue); - } - for (shmdesc = Shmsegs; - shmdesc && (shmdesc->shmid != stuff->shmid); - shmdesc = shmdesc->next) - ; - if (shmdesc) - { - if (!stuff->readOnly && !shmdesc->writable) - return BadAccess; - shmdesc->refcnt++; - } - else - { - shmdesc = (ShmDescPtr) xalloc(sizeof(ShmDescRec)); - if (!shmdesc) - return BadAlloc; - shmdesc->addr = shmat(stuff->shmid, 0, - stuff->readOnly ? SHM_RDONLY : 0); - if ((shmdesc->addr == ((char *)-1)) || - shmctl(stuff->shmid, IPC_STAT, &buf)) - { - xfree(shmdesc); - return BadAccess; - } - - /* The attach was performed with root privs. We must - * do manual checking of access rights for the credentials - * of the client */ - - if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) { - shmdt(shmdesc->addr); - xfree(shmdesc); - return BadAccess; - } - - shmdesc->shmid = stuff->shmid; - shmdesc->refcnt = 1; - shmdesc->writable = !stuff->readOnly; - shmdesc->size = buf.shm_segsz; - shmdesc->next = Shmsegs; - Shmsegs = shmdesc; - } - if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc)) - return BadAlloc; - return(client->noClientException); -} - -/*ARGSUSED*/ -static int -ShmDetachSegment(value, shmseg) - pointer value; /* must conform to DeleteType */ - XID shmseg; -{ - ShmDescPtr shmdesc = (ShmDescPtr)value; - ShmDescPtr *prev; - - if (--shmdesc->refcnt) - return TRUE; - shmdt(shmdesc->addr); - for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next) - ; - *prev = shmdesc->next; - xfree(shmdesc); - return Success; -} - -static int -ProcShmDetach(client) - register ClientPtr client; -{ - ShmDescPtr shmdesc; - REQUEST(xShmDetachReq); - - REQUEST_SIZE_MATCH(xShmDetachReq); - VERIFY_SHMSEG(stuff->shmseg, shmdesc, client); - FreeResource(stuff->shmseg, RT_NONE); - return(client->noClientException); -} - -static void -miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) - DrawablePtr dst; - GCPtr pGC; - int depth, w, h, sx, sy, sw, sh, dx, dy; - unsigned int format; - char *data; -{ - PixmapPtr pmap; - GCPtr putGC; - - nxagentShmTrap = 0; - putGC = GetScratchGC(depth, dst->pScreen); - if (!putGC) - { - nxagentShmTrap = 1; - return; - } - pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth); - if (!pmap) - { - nxagentShmTrap = 1; - FreeScratchGC(putGC); - return; - } - ValidateGC((DrawablePtr)pmap, putGC); - (*putGC->ops->PutImage)((DrawablePtr)pmap, putGC, depth, -sx, -sy, w, h, 0, - (format == XYPixmap) ? XYPixmap : ZPixmap, data); - FreeScratchGC(putGC); - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy, 1L); - else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy); - (*pmap->drawable.pScreen->DestroyPixmap)(pmap); - nxagentShmTrap = 1; -} - -static void -fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) - DrawablePtr dst; - GCPtr pGC; - int depth, w, h, sx, sy, sw, sh, dx, dy; - unsigned int format; - char *data; -{ - int length; - char *newdata; - extern int nxagentImageLength(int, int, int, int, int); - - #ifdef TEST - fprintf(stderr, "fbShmPutImage: Called with drawable at [%p] GC at [%p] data at [%p].\n", - (void *) dst, (void *) pGC, (void *) data); - #endif - - if ((format == ZPixmap) || (depth == 1)) - { - PixmapPtr pPixmap; - - pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, - BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data); - if (!pPixmap) - return; - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, dst, pGC, - sx, sy, sw, sh, dx, dy, 1L); - else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, dst, pGC, - sx, sy, sw, sh, dx, dy); - - /* - * We updated the internal framebuffer, - * now we want to go on the real X. - */ - - #ifdef TEST - fprintf(stderr, "fbShmPutImage: Realizing the PutImage with depth [%d] " - " format [%d] w [%d] h [%d] sx [%d] sy [%d] sw [%d] " - " sh [%d] dx [%d].\n", depth, format, w, h, - sx, sy, sw, sh, dx); - #endif - - length = nxagentImageLength(sw, sh, format, 0, depth); - - if ((newdata = xalloc(length)) != NULL) - { - fbGetImage((DrawablePtr) pPixmap, sx, sy, sw, sh, format, AllPlanes, newdata); - (*pGC->ops->PutImage)(dst, pGC, depth, dx, dy, sw, sh, 0, format, newdata); - - xfree(newdata); - } - else - { - #ifdef WARNING - fprintf(stderr, "fbShmPutImage: WARNING! Data allocation failed.\n"); - #endif - } - - FreeScratchPixmapHeader(pPixmap); - } - else - { - #ifdef TEST - fprintf(stderr, "fbShmPutImage: Calling miShmPutImage().\n"); - #endif - miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, - data); - } -} - - -#ifdef PANORAMIX -static int -ProcPanoramiXShmPutImage(register ClientPtr client) -{ - int j, result = 0, orig_x, orig_y; - PanoramiXRes *draw, *gc; - Bool sendEvent, isRoot; - - REQUEST(xShmPutImageReq); - REQUEST_SIZE_MATCH(xShmPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - orig_x = stuff->dstX; - orig_y = stuff->dstY; - sendEvent = stuff->sendEvent; - stuff->sendEvent = 0; - FOR_NSCREENS(j) { - if(!j) stuff->sendEvent = sendEvent; - stuff->drawable = draw->info[j].id; - stuff->gc = gc->info[j].id; - if (isRoot) { - stuff->dstX = orig_x - panoramiXdataPtr[j].x; - stuff->dstY = orig_y - panoramiXdataPtr[j].y; - } - result = ProcShmPutImage(client); - if(result != client->noClientException) break; - } - return(result); -} - -static int -ProcPanoramiXShmGetImage(ClientPtr client) -{ - PanoramiXRes *draw; - DrawablePtr drawables[MAXSCREENS]; - DrawablePtr pDraw; - xShmGetImageReply xgi; - ShmDescPtr shmdesc; - int i, x, y, w, h, format; - Mask plane = 0, planemask; - long lenPer = 0, length, widthBytesLine; - Bool isRoot; - - REQUEST(xShmGetImageReq); - - REQUEST_SIZE_MATCH(xShmGetImageReq); - - if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { - client->errorValue = stuff->format; - return(BadValue); - } - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if (draw->type == XRT_PIXMAP) - return ProcShmGetImage(client); - - VERIFY_DRAWABLE(pDraw, stuff->drawable, client); - - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - - x = stuff->x; - y = stuff->y; - w = stuff->width; - h = stuff->height; - format = stuff->format; - planemask = stuff->planeMask; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - if(isRoot) { - if( /* check for being onscreen */ - x < 0 || x + w > PanoramiXPixWidth || - y < 0 || y + h > PanoramiXPixHeight ) - return(BadMatch); - } else { - if( /* check for being onscreen */ - panoramiXdataPtr[0].x + pDraw->x + x < 0 || - panoramiXdataPtr[0].x + pDraw->x + x + w > PanoramiXPixWidth || - panoramiXdataPtr[0].y + pDraw->y + y < 0 || - panoramiXdataPtr[0].y + pDraw->y + y + h > PanoramiXPixHeight || - /* check for being inside of border */ - x < - wBorderWidth((WindowPtr)pDraw) || - x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - y < -wBorderWidth((WindowPtr)pDraw) || - y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height) - return(BadMatch); - } - - drawables[0] = pDraw; - for(i = 1; i < PanoramiXNumScreens; i++) - VERIFY_DRAWABLE(drawables[i], draw->info[i].id, client); - - xgi.visual = wVisual(((WindowPtr)pDraw)); - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - - if(format == ZPixmap) { - widthBytesLine = PixmapBytePad(w, pDraw->depth); - length = widthBytesLine * h; - } else { - widthBytesLine = PixmapBytePad(w, 1); - lenPer = widthBytesLine * h; - plane = ((Mask)1) << (pDraw->depth - 1); - length = lenPer * Ones(planemask & (plane | (plane - 1))); - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); - xgi.size = length; - - if (length == 0) {/* nothing to do */ } - else if (format == ZPixmap) { - XineramaGetImageData(drawables, x, y, w, h, format, planemask, - shmdesc->addr + stuff->offset, - widthBytesLine, isRoot); - } else { - - length = stuff->offset; - for (; plane; plane >>= 1) { - if (planemask & plane) { - XineramaGetImageData(drawables, x, y, w, h, - format, plane, shmdesc->addr + length, - widthBytesLine, isRoot); - length += lenPer; - } - } - } - - if (client->swapped) { - register int n; - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); - } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - - return(client->noClientException); -} - -static int -ProcPanoramiXShmCreatePixmap(client) - register ClientPtr client; -{ - ScreenPtr pScreen = NULL; - PixmapPtr pMap = NULL; - DrawablePtr pDraw; - DepthPtr pDepth; - int i, j, result; - ShmDescPtr shmdesc; - REQUEST(xShmCreatePixmapReq); - PanoramiXRes *newPix; - - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - client->errorValue = stuff->pid; - if (!sharedPixmaps) - return BadImplementation; - LEGAL_NEW_RESOURCE(stuff->pid, client); - VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } -CreatePmap: - VERIFY_SHMSIZE(shmdesc, stuff->offset, - PixmapBytePad(stuff->width, stuff->depth) * stuff->height, - client); - - if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) - return BadAlloc; - - newPix->type = XRT_PIXMAP; - newPix->u.pix.shared = TRUE; - newPix->info[0].id = stuff->pid; - for(j = 1; j < PanoramiXNumScreens; j++) - newPix->info[j].id = FakeClientID(client->index); - - result = (client->noClientException); - - FOR_NSCREENS(j) { - pScreen = screenInfo.screens[j]; - - pMap = (*shmFuncs[j]->CreatePixmap)(pScreen, - stuff->width, stuff->height, stuff->depth, - shmdesc->addr + stuff->offset); - - if (pMap) { -#ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif - shmdesc->refcnt++; - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = newPix->info[j].id; - if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) { - (*pScreen->DestroyPixmap)(pMap); - result = BadAlloc; - break; - } - } else { - result = BadAlloc; - break; - } - } - - if(result == BadAlloc) { - while(j--) { - (*pScreen->DestroyPixmap)(pMap); - FreeResource(newPix->info[j].id, RT_NONE); - } - xfree(newPix); - } else - AddResource(stuff->pid, XRT_PIXMAP, newPix); - - return result; -} - -#endif - -static int -ProcShmPutImage(client) - register ClientPtr client; -{ - register GCPtr pGC; - register DrawablePtr pDraw; - long length; - ShmDescPtr shmdesc; - REQUEST(xShmPutImageReq); - - REQUEST_SIZE_MATCH(xShmPutImageReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client); - if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse)) - return BadValue; - if (stuff->format == XYBitmap) - { - if (stuff->depth != 1) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, 1); - } - else if (stuff->format == XYPixmap) - { - if (pDraw->depth != stuff->depth) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, 1); - length *= stuff->depth; - } - else if (stuff->format == ZPixmap) - { - if (pDraw->depth != stuff->depth) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, stuff->depth); - } - else - { - client->errorValue = stuff->format; - return BadValue; - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight, - client); - if (stuff->srcX > stuff->totalWidth) - { - client->errorValue = stuff->srcX; - return BadValue; - } - if (stuff->srcY > stuff->totalHeight) - { - client->errorValue = stuff->srcY; - return BadValue; - } - if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth) - { - client->errorValue = stuff->srcWidth; - return BadValue; - } - if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight) - { - client->errorValue = stuff->srcHeight; - return BadValue; - } - - #ifdef TEST - fprintf(stderr, "ProcShmPutImage: Format [%d] srcX [%d] srcY [%d], " - "totalWidth [%d] totalHeight [%d]\n", stuff->format, stuff->srcX, - stuff->srcY, stuff->totalWidth, stuff->totalHeight); - #endif - - #ifdef TEST - fprintf(stderr, "ProcShmPutImage: Calling (*shmFuncs[pDraw->pScreen->myNum]->PutImage)().\n"); - #endif - - (*shmFuncs[pDraw->pScreen->myNum]->PutImage)( - pDraw, pGC, stuff->depth, stuff->format, - stuff->totalWidth, stuff->totalHeight, - stuff->srcX, stuff->srcY, - stuff->srcWidth, stuff->srcHeight, - stuff->dstX, stuff->dstY, - shmdesc->addr + stuff->offset); - - if (stuff->sendEvent) - { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.sequenceNumber = client->sequence; - ev.minorEvent = X_ShmPutImage; - ev.majorEvent = ShmReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; - WriteEventsToClient(client, 1, (xEvent *) &ev); - } - - return (client->noClientException); -} - - - -static int -ProcShmGetImage(client) - register ClientPtr client; -{ - register DrawablePtr pDraw; - long lenPer = 0, length; - Mask plane = 0; - xShmGetImageReply xgi; - ShmDescPtr shmdesc; - int n; - - REQUEST(xShmGetImageReq); - - REQUEST_SIZE_MATCH(xShmGetImageReq); - if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) - { - client->errorValue = stuff->format; - return(BadValue); - } - VERIFY_DRAWABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - if (pDraw->type == DRAWABLE_WINDOW) - { - if( /* check for being viewable */ - !((WindowPtr) pDraw)->realized || - /* check for being on screen */ - pDraw->x + stuff->x < 0 || - pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width || - pDraw->y + stuff->y < 0 || - pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height || - /* check for being inside of border */ - stuff->x < - wBorderWidth((WindowPtr)pDraw) || - stuff->x + (int)stuff->width > - wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - stuff->y < -wBorderWidth((WindowPtr)pDraw) || - stuff->y + (int)stuff->height > - wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height - ) - return(BadMatch); - xgi.visual = wVisual(((WindowPtr)pDraw)); - } - else - { - if (stuff->x < 0 || - stuff->x+(int)stuff->width > pDraw->width || - stuff->y < 0 || - stuff->y+(int)stuff->height > pDraw->height - ) - return(BadMatch); - xgi.visual = None; - } - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - if(stuff->format == ZPixmap) - { - length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height; - } - else - { - lenPer = PixmapBytePad(stuff->width, 1) * stuff->height; - plane = ((Mask)1) << (pDraw->depth - 1); - /* only planes asked for */ - length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1))); - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); - xgi.size = length; - - if (length == 0) - { - /* nothing to do */ - } - else if (stuff->format == ZPixmap) - { - (*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y, - stuff->width, stuff->height, - stuff->format, stuff->planeMask, - shmdesc->addr + stuff->offset); - } - else - { - - length = stuff->offset; - for (; plane; plane >>= 1) - { - if (stuff->planeMask & plane) - { - (*pDraw->pScreen->GetImage)(pDraw, - stuff->x, stuff->y, - stuff->width, stuff->height, - stuff->format, plane, - shmdesc->addr + length); - length += lenPer; - } - } - } - - if (client->swapped) { - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); - } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - - return(client->noClientException); -} - -static PixmapPtr -fbShmCreatePixmap (pScreen, width, height, depth, addr) - ScreenPtr pScreen; - int width; - int height; - int depth; - char *addr; -{ - register PixmapPtr pPixmap; - - nxagentShmPixmapTrap = 1; - - pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, depth); - - if (!pPixmap) - { - nxagentShmPixmapTrap = 0; - - return NullPixmap; - } - - #ifdef TEST - fprintf(stderr,"fbShmCreatePixmap: Width [%d] Height [%d] Depth [%d]\n", width, height, depth); - #endif - - if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, - BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) - { - #ifdef WARNING - fprintf(stderr,"fbShmCreatePixmap: Return Null Pixmap.\n"); - #endif - - (*pScreen->DestroyPixmap)(pPixmap); - - nxagentShmPixmapTrap = 0; - - return NullPixmap; - } - - nxagentShmPixmapTrap = 0; - - return pPixmap; -} - -static int -ProcShmCreatePixmap(client) - register ClientPtr client; -{ - PixmapPtr pMap; - register DrawablePtr pDraw; - DepthPtr pDepth; - register int i; - ShmDescPtr shmdesc; - REQUEST(xShmCreatePixmapReq); - - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - client->errorValue = stuff->pid; - if (!sharedPixmaps) - return BadImplementation; - LEGAL_NEW_RESOURCE(stuff->pid, client); - VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } -CreatePmap: - VERIFY_SHMSIZE(shmdesc, stuff->offset, - PixmapBytePad(stuff->width, stuff->depth) * stuff->height, - client); - pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)( - pDraw->pScreen, stuff->width, - stuff->height, stuff->depth, - shmdesc->addr + stuff->offset); - if (pMap) - { -#ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif - shmdesc->refcnt++; - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) - { - return(client->noClientException); - } - } - return (BadAlloc); -} - -static int -ProcShmDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - - #ifdef TEST - fprintf(stderr, "ProcShmDispatch: Going to execute operation [%d] for client [%d].\n", - stuff -> data, client -> index); - #endif - - switch (stuff->data) - { - case X_ShmQueryVersion: - return ProcShmQueryVersion(client); - case X_ShmAttach: - return ProcShmAttach(client); - case X_ShmDetach: - return ProcShmDetach(client); - case X_ShmPutImage: - { - int result; - - #ifdef TEST - fprintf(stderr, "ProcShmDispatch: Going to execute ProcShmPutImage() for client [%d].\n", - client -> index); - #endif - - nxagentShmTrap = 1; - -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - { - result = ProcPanoramiXShmPutImage(client); - - nxagentShmTrap = 0; - - return result; - } -#endif - - result = ProcShmPutImage(client); - - nxagentShmTrap = 0; - - #ifdef TEST - fprintf(stderr, "ProcShmDispatch: Returning from ProcShmPutImage() for client [%d].\n", - client -> index); - #endif - - return result; - } - case X_ShmGetImage: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmGetImage(client); -#endif - return ProcShmGetImage(client); - case X_ShmCreatePixmap: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmCreatePixmap(client); -#endif - return ProcShmCreatePixmap(client); - default: - return BadRequest; - } -} - -static void -SShmCompletionEvent(from, to) - xShmCompletionEvent *from, *to; -{ - to->type = from->type; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->drawable, to->drawable); - cpswaps(from->minorEvent, to->minorEvent); - to->majorEvent = from->majorEvent; - cpswapl(from->shmseg, to->shmseg); - cpswapl(from->offset, to->offset); -} - -static int -SProcShmQueryVersion(client) - register ClientPtr client; -{ - register int n; - REQUEST(xShmQueryVersionReq); - - swaps(&stuff->length, n); - return ProcShmQueryVersion(client); -} - -static int -SProcShmAttach(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmAttachReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmAttachReq); - swapl(&stuff->shmseg, n); - swapl(&stuff->shmid, n); - return ProcShmAttach(client); -} - -static int -SProcShmDetach(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmDetachReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmDetachReq); - swapl(&stuff->shmseg, n); - return ProcShmDetach(client); -} - -static int -SProcShmPutImage(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmPutImageReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmPutImageReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->totalWidth, n); - swaps(&stuff->totalHeight, n); - swaps(&stuff->srcX, n); - swaps(&stuff->srcY, n); - swaps(&stuff->srcWidth, n); - swaps(&stuff->srcHeight, n); - swaps(&stuff->dstX, n); - swaps(&stuff->dstY, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmPutImage(client); -} - -static int -SProcShmGetImage(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmGetImageReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmGetImageReq); - swapl(&stuff->drawable, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->planeMask, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmGetImage(client); -} - -static int -SProcShmCreatePixmap(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmCreatePixmapReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - swapl(&stuff->drawable, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmCreatePixmap(client); -} - -static int -SProcShmDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - - #ifdef TEST - fprintf(stderr, "SProcShmDispatch: Going to execute operation [%d] for client [%d].\n", - stuff -> data, client -> index); - #endif - - switch (stuff->data) - { - case X_ShmQueryVersion: - return SProcShmQueryVersion(client); - case X_ShmAttach: - return SProcShmAttach(client); - case X_ShmDetach: - return SProcShmDetach(client); - case X_ShmPutImage: - { - int result; - - #ifdef TEST - fprintf(stderr, "SProcShmDispatch: Going to execute SProcShmPutImage() for client [%d].\n", - client -> index); - #endif - - nxagentShmTrap = 1; - - result = SProcShmPutImage(client); - - nxagentShmTrap = 0; - - #ifdef TEST - fprintf(stderr, "SProcShmDispatch: Returning from SProcShmPutImage() for client [%d].\n", - client -> index); - #endif - - return result; - } - case X_ShmGetImage: - return SProcShmGetImage(client); - case X_ShmCreatePixmap: - return SProcShmCreatePixmap(client); - default: - return BadRequest; - } -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c.XF86.original deleted file mode 100644 index 3ba9ad2c1..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c.XF86.original +++ /dev/null @@ -1,1257 +0,0 @@ -/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.36 2002/04/03 19:51:11 herrb Exp $ */ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -********************************************************/ - -/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ - -/* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ - -#include -#ifndef Lynx -#include -#include -#else -#include -#include -#endif -#include -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "extnsionst.h" -#include "servermd.h" -#define _XSHM_SERVER_ -#include "shmstr.h" -#include "Xfuncproto.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -typedef struct _ShmDesc { - struct _ShmDesc *next; - int shmid; - int refcnt; - char *addr; - Bool writable; - unsigned long size; -} ShmDescRec, *ShmDescPtr; - -static void miShmPutImage(XSHM_PUT_IMAGE_ARGS); -static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS); -static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); -static int ShmDetachSegment( -#if NeedFunctionPrototypes - pointer /* value */, - XID /* shmseg */ -#endif - ); -static void ShmResetProc( -#if NeedFunctionPrototypes - ExtensionEntry * /* extEntry */ -#endif - ); -static void SShmCompletionEvent( -#if NeedFunctionPrototypes - xShmCompletionEvent * /* from */, - xShmCompletionEvent * /* to */ -#endif - ); - -static Bool ShmDestroyPixmap (PixmapPtr pPixmap); - -static DISPATCH_PROC(ProcShmAttach); -static DISPATCH_PROC(ProcShmCreatePixmap); -static DISPATCH_PROC(ProcShmDetach); -static DISPATCH_PROC(ProcShmDispatch); -static DISPATCH_PROC(ProcShmGetImage); -static DISPATCH_PROC(ProcShmPutImage); -static DISPATCH_PROC(ProcShmQueryVersion); -static DISPATCH_PROC(SProcShmAttach); -static DISPATCH_PROC(SProcShmCreatePixmap); -static DISPATCH_PROC(SProcShmDetach); -static DISPATCH_PROC(SProcShmDispatch); -static DISPATCH_PROC(SProcShmGetImage); -static DISPATCH_PROC(SProcShmPutImage); -static DISPATCH_PROC(SProcShmQueryVersion); - -static unsigned char ShmReqCode; -int ShmCompletionCode; -int BadShmSegCode; -RESTYPE ShmSegType; -static ShmDescPtr Shmsegs; -static Bool sharedPixmaps; -static int pixmapFormat; -static int shmPixFormat[MAXSCREENS]; -static ShmFuncsPtr shmFuncs[MAXSCREENS]; -static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS]; -#ifdef PIXPRIV -static int shmPixmapPrivate; -#endif -static ShmFuncs miFuncs = {NULL, miShmPutImage}; -static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage}; - -#define VERIFY_SHMSEG(shmseg,shmdesc,client) \ -{ \ - shmdesc = (ShmDescPtr)LookupIDByType(shmseg, ShmSegType); \ - if (!shmdesc) \ - { \ - client->errorValue = shmseg; \ - return BadShmSegCode; \ - } \ -} - -#define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \ -{ \ - VERIFY_SHMSEG(shmseg, shmdesc, client); \ - if ((offset & 3) || (offset > shmdesc->size)) \ - { \ - client->errorValue = offset; \ - return BadValue; \ - } \ - if (needwrite && !shmdesc->writable) \ - return BadAccess; \ -} - -#define VERIFY_SHMSIZE(shmdesc,offset,len,client) \ -{ \ - if ((offset + len) > shmdesc->size) \ - { \ - return BadAccess; \ - } \ -} - - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -#include - -static Bool badSysCall = FALSE; - -static void -SigSysHandler(signo) -int signo; -{ - badSysCall = TRUE; -} - -static Bool CheckForShmSyscall() -{ - void (*oldHandler)(); - int shmid = -1; - - /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ - oldHandler = signal(SIGSYS, SigSysHandler); - - badSysCall = FALSE; - shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); - /* Clean up */ - if (shmid != -1) - { - shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL); - } - signal(SIGSYS, oldHandler); - return(!badSysCall); -} -#endif - -void -ShmExtensionInit() -{ - ExtensionEntry *extEntry; - int i; - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) - if (!CheckForShmSyscall()) - { - ErrorF("MIT-SHM extension disabled due to lack of kernel support\n"); - return; - } -#endif - - sharedPixmaps = xFalse; - pixmapFormat = 0; - { - sharedPixmaps = xTrue; - pixmapFormat = shmPixFormat[0]; - for (i = 0; i < screenInfo.numScreens; i++) - { - if (!shmFuncs[i]) - shmFuncs[i] = &miFuncs; - if (!shmFuncs[i]->CreatePixmap) - sharedPixmaps = xFalse; - if (shmPixFormat[i] && (shmPixFormat[i] != pixmapFormat)) - { - sharedPixmaps = xFalse; - pixmapFormat = 0; - } - } - if (!pixmapFormat) - pixmapFormat = ZPixmap; - if (sharedPixmaps) - { - for (i = 0; i < screenInfo.numScreens; i++) - { - destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap; - screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap; - } -#ifdef PIXPRIV - shmPixmapPrivate = AllocatePixmapPrivateIndex(); - for (i = 0; i < screenInfo.numScreens; i++) - { - if (!AllocatePixmapPrivate(screenInfo.screens[i], - shmPixmapPrivate, 0)) - return; - } -#endif - } - } - ShmSegType = CreateNewResourceType(ShmDetachSegment); - if (ShmSegType && - (extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors, - ProcShmDispatch, SProcShmDispatch, - ShmResetProc, StandardMinorOpcode))) - { - ShmReqCode = (unsigned char)extEntry->base; - ShmCompletionCode = extEntry->eventBase; - BadShmSegCode = extEntry->errorBase; - EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent; - } -} - -/*ARGSUSED*/ -static void -ShmResetProc (extEntry) -ExtensionEntry *extEntry; -{ - int i; - - for (i = 0; i < MAXSCREENS; i++) - { - shmFuncs[i] = (ShmFuncsPtr)NULL; - shmPixFormat[i] = 0; - } -} - -void -ShmRegisterFuncs(pScreen, funcs) - ScreenPtr pScreen; - ShmFuncsPtr funcs; -{ - shmFuncs[pScreen->myNum] = funcs; -} - -void -ShmSetPixmapFormat(pScreen, format) - ScreenPtr pScreen; - int format; -{ - shmPixFormat[pScreen->myNum] = format; -} - -static Bool -ShmDestroyPixmap (PixmapPtr pPixmap) -{ - ScreenPtr pScreen = pPixmap->drawable.pScreen; - Bool ret; - if (pPixmap->refcnt == 1) - { - ShmDescPtr shmdesc; -#ifdef PIXPRIV - shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr; -#else - char *base = (char *) pPixmap->devPrivate.ptr; - - if (base != (pointer) (pPixmap + 1)) - { - for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next) - { - if (shmdesc->addr <= base && base <= shmdesc->addr + shmdesc->size) - break; - } - } - else - shmdesc = 0; -#endif - if (shmdesc) - ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id); - } - - pScreen->DestroyPixmap = destroyPixmap[pScreen->myNum]; - ret = (*pScreen->DestroyPixmap) (pPixmap); - destroyPixmap[pScreen->myNum] = pScreen->DestroyPixmap; - pScreen->DestroyPixmap = ShmDestroyPixmap; - return ret; -} - -void -ShmRegisterFbFuncs(pScreen) - ScreenPtr pScreen; -{ - shmFuncs[pScreen->myNum] = &fbFuncs; -} - -static int -ProcShmQueryVersion(client) - register ClientPtr client; -{ - xShmQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xShmQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.sharedPixmaps = sharedPixmaps; - rep.pixmapFormat = pixmapFormat; - rep.majorVersion = SHM_MAJOR_VERSION; - rep.minorVersion = SHM_MINOR_VERSION; - rep.uid = geteuid(); - rep.gid = getegid(); - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - swaps(&rep.uid, n); - swaps(&rep.gid, n); - } - WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -/* - * Simulate the access() system call for a shared memory segement, - * using the credentials from the client if available - */ -static int -shm_access(ClientPtr client, struct ipc_perm *perm, int readonly) -{ - int uid, gid; - mode_t mask; - - if (LocalClientCred(client, &uid, &gid) != -1) { - - /* User id 0 always gets access */ - if (uid == 0) { - return 0; - } - /* Check the owner */ - if (perm->uid == uid || perm->cuid == uid) { - mask = S_IRUSR; - if (!readonly) { - mask |= S_IWUSR; - } - return (perm->mode & mask) == mask ? 0 : -1; - } - /* Check the group */ - if (perm->gid == gid || perm->cgid == gid) { - mask = S_IRGRP; - if (!readonly) { - mask |= S_IWGRP; - } - return (perm->mode & mask) == mask ? 0 : -1; - } - } - /* Otherwise, check everyone else */ - mask = S_IROTH; - if (!readonly) { - mask |= S_IWOTH; - } - return (perm->mode & mask) == mask ? 0 : -1; -} - -static int -ProcShmAttach(client) - register ClientPtr client; -{ - struct shmid_ds buf; - ShmDescPtr shmdesc; - REQUEST(xShmAttachReq); - - REQUEST_SIZE_MATCH(xShmAttachReq); - LEGAL_NEW_RESOURCE(stuff->shmseg, client); - if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) - { - client->errorValue = stuff->readOnly; - return(BadValue); - } - for (shmdesc = Shmsegs; - shmdesc && (shmdesc->shmid != stuff->shmid); - shmdesc = shmdesc->next) - ; - if (shmdesc) - { - if (!stuff->readOnly && !shmdesc->writable) - return BadAccess; - shmdesc->refcnt++; - } - else - { - shmdesc = (ShmDescPtr) xalloc(sizeof(ShmDescRec)); - if (!shmdesc) - return BadAlloc; - shmdesc->addr = shmat(stuff->shmid, 0, - stuff->readOnly ? SHM_RDONLY : 0); - if ((shmdesc->addr == ((char *)-1)) || - shmctl(stuff->shmid, IPC_STAT, &buf)) - { - xfree(shmdesc); - return BadAccess; - } - - /* The attach was performed with root privs. We must - * do manual checking of access rights for the credentials - * of the client */ - - if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) { - shmdt(shmdesc->addr); - xfree(shmdesc); - return BadAccess; - } - - shmdesc->shmid = stuff->shmid; - shmdesc->refcnt = 1; - shmdesc->writable = !stuff->readOnly; - shmdesc->size = buf.shm_segsz; - shmdesc->next = Shmsegs; - Shmsegs = shmdesc; - } - if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc)) - return BadAlloc; - return(client->noClientException); -} - -/*ARGSUSED*/ -static int -ShmDetachSegment(value, shmseg) - pointer value; /* must conform to DeleteType */ - XID shmseg; -{ - ShmDescPtr shmdesc = (ShmDescPtr)value; - ShmDescPtr *prev; - - if (--shmdesc->refcnt) - return TRUE; - shmdt(shmdesc->addr); - for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next) - ; - *prev = shmdesc->next; - xfree(shmdesc); - return Success; -} - -static int -ProcShmDetach(client) - register ClientPtr client; -{ - ShmDescPtr shmdesc; - REQUEST(xShmDetachReq); - - REQUEST_SIZE_MATCH(xShmDetachReq); - VERIFY_SHMSEG(stuff->shmseg, shmdesc, client); - FreeResource(stuff->shmseg, RT_NONE); - return(client->noClientException); -} - -static void -miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) - DrawablePtr dst; - GCPtr pGC; - int depth, w, h, sx, sy, sw, sh, dx, dy; - unsigned int format; - char *data; -{ - PixmapPtr pmap; - GCPtr putGC; - - putGC = GetScratchGC(depth, dst->pScreen); - if (!putGC) - return; - pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth); - if (!pmap) - { - FreeScratchGC(putGC); - return; - } - ValidateGC((DrawablePtr)pmap, putGC); - (*putGC->ops->PutImage)((DrawablePtr)pmap, putGC, depth, -sx, -sy, w, h, 0, - (format == XYPixmap) ? XYPixmap : ZPixmap, data); - FreeScratchGC(putGC); - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy, 1L); - else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy); - (*pmap->drawable.pScreen->DestroyPixmap)(pmap); -} - -static void -fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) - DrawablePtr dst; - GCPtr pGC; - int depth, w, h, sx, sy, sw, sh, dx, dy; - unsigned int format; - char *data; -{ - if ((format == ZPixmap) || (depth == 1)) - { - PixmapPtr pPixmap; - - pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, - BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data); - if (!pPixmap) - return; - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, dst, pGC, - sx, sy, sw, sh, dx, dy, 1L); - else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, dst, pGC, - sx, sy, sw, sh, dx, dy); - FreeScratchPixmapHeader(pPixmap); - } - else - miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, - data); -} - - -#ifdef PANORAMIX -static int -ProcPanoramiXShmPutImage(register ClientPtr client) -{ - int j, result = 0, orig_x, orig_y; - PanoramiXRes *draw, *gc; - Bool sendEvent, isRoot; - - REQUEST(xShmPutImageReq); - REQUEST_SIZE_MATCH(xShmPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - orig_x = stuff->dstX; - orig_y = stuff->dstY; - sendEvent = stuff->sendEvent; - stuff->sendEvent = 0; - FOR_NSCREENS(j) { - if(!j) stuff->sendEvent = sendEvent; - stuff->drawable = draw->info[j].id; - stuff->gc = gc->info[j].id; - if (isRoot) { - stuff->dstX = orig_x - panoramiXdataPtr[j].x; - stuff->dstY = orig_y - panoramiXdataPtr[j].y; - } - result = ProcShmPutImage(client); - if(result != client->noClientException) break; - } - return(result); -} - -static int -ProcPanoramiXShmGetImage(ClientPtr client) -{ - PanoramiXRes *draw; - DrawablePtr drawables[MAXSCREENS]; - DrawablePtr pDraw; - xShmGetImageReply xgi; - ShmDescPtr shmdesc; - int i, x, y, w, h, format; - Mask plane = 0, planemask; - long lenPer = 0, length, widthBytesLine; - Bool isRoot; - - REQUEST(xShmGetImageReq); - - REQUEST_SIZE_MATCH(xShmGetImageReq); - - if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { - client->errorValue = stuff->format; - return(BadValue); - } - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if (draw->type == XRT_PIXMAP) - return ProcShmGetImage(client); - - VERIFY_DRAWABLE(pDraw, stuff->drawable, client); - - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - - x = stuff->x; - y = stuff->y; - w = stuff->width; - h = stuff->height; - format = stuff->format; - planemask = stuff->planeMask; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - if(isRoot) { - if( /* check for being onscreen */ - x < 0 || x + w > PanoramiXPixWidth || - y < 0 || y + h > PanoramiXPixHeight ) - return(BadMatch); - } else { - if( /* check for being onscreen */ - panoramiXdataPtr[0].x + pDraw->x + x < 0 || - panoramiXdataPtr[0].x + pDraw->x + x + w > PanoramiXPixWidth || - panoramiXdataPtr[0].y + pDraw->y + y < 0 || - panoramiXdataPtr[0].y + pDraw->y + y + h > PanoramiXPixHeight || - /* check for being inside of border */ - x < - wBorderWidth((WindowPtr)pDraw) || - x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - y < -wBorderWidth((WindowPtr)pDraw) || - y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height) - return(BadMatch); - } - - drawables[0] = pDraw; - for(i = 1; i < PanoramiXNumScreens; i++) - VERIFY_DRAWABLE(drawables[i], draw->info[i].id, client); - - xgi.visual = wVisual(((WindowPtr)pDraw)); - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - - if(format == ZPixmap) { - widthBytesLine = PixmapBytePad(w, pDraw->depth); - length = widthBytesLine * h; - } else { - widthBytesLine = PixmapBytePad(w, 1); - lenPer = widthBytesLine * h; - plane = ((Mask)1) << (pDraw->depth - 1); - length = lenPer * Ones(planemask & (plane | (plane - 1))); - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); - xgi.size = length; - - if (length == 0) {/* nothing to do */ } - else if (format == ZPixmap) { - XineramaGetImageData(drawables, x, y, w, h, format, planemask, - shmdesc->addr + stuff->offset, - widthBytesLine, isRoot); - } else { - - length = stuff->offset; - for (; plane; plane >>= 1) { - if (planemask & plane) { - XineramaGetImageData(drawables, x, y, w, h, - format, plane, shmdesc->addr + length, - widthBytesLine, isRoot); - length += lenPer; - } - } - } - - if (client->swapped) { - register int n; - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); - } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - - return(client->noClientException); -} - -static int -ProcPanoramiXShmCreatePixmap(client) - register ClientPtr client; -{ - ScreenPtr pScreen = NULL; - PixmapPtr pMap = NULL; - DrawablePtr pDraw; - DepthPtr pDepth; - int i, j, result; - ShmDescPtr shmdesc; - REQUEST(xShmCreatePixmapReq); - PanoramiXRes *newPix; - - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - client->errorValue = stuff->pid; - if (!sharedPixmaps) - return BadImplementation; - LEGAL_NEW_RESOURCE(stuff->pid, client); - VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } -CreatePmap: - VERIFY_SHMSIZE(shmdesc, stuff->offset, - PixmapBytePad(stuff->width, stuff->depth) * stuff->height, - client); - - if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) - return BadAlloc; - - newPix->type = XRT_PIXMAP; - newPix->u.pix.shared = TRUE; - newPix->info[0].id = stuff->pid; - for(j = 1; j < PanoramiXNumScreens; j++) - newPix->info[j].id = FakeClientID(client->index); - - result = (client->noClientException); - - FOR_NSCREENS(j) { - pScreen = screenInfo.screens[j]; - - pMap = (*shmFuncs[j]->CreatePixmap)(pScreen, - stuff->width, stuff->height, stuff->depth, - shmdesc->addr + stuff->offset); - - if (pMap) { -#ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif - shmdesc->refcnt++; - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = newPix->info[j].id; - if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) { - (*pScreen->DestroyPixmap)(pMap); - result = BadAlloc; - break; - } - } else { - result = BadAlloc; - break; - } - } - - if(result == BadAlloc) { - while(j--) { - (*pScreen->DestroyPixmap)(pMap); - FreeResource(newPix->info[j].id, RT_NONE); - } - xfree(newPix); - } else - AddResource(stuff->pid, XRT_PIXMAP, newPix); - - return result; -} - -#endif - -static int -ProcShmPutImage(client) - register ClientPtr client; -{ - register GCPtr pGC; - register DrawablePtr pDraw; - long length; - ShmDescPtr shmdesc; - REQUEST(xShmPutImageReq); - - REQUEST_SIZE_MATCH(xShmPutImageReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client); - if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse)) - return BadValue; - if (stuff->format == XYBitmap) - { - if (stuff->depth != 1) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, 1); - } - else if (stuff->format == XYPixmap) - { - if (pDraw->depth != stuff->depth) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, 1); - length *= stuff->depth; - } - else if (stuff->format == ZPixmap) - { - if (pDraw->depth != stuff->depth) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, stuff->depth); - } - else - { - client->errorValue = stuff->format; - return BadValue; - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight, - client); - if (stuff->srcX > stuff->totalWidth) - { - client->errorValue = stuff->srcX; - return BadValue; - } - if (stuff->srcY > stuff->totalHeight) - { - client->errorValue = stuff->srcY; - return BadValue; - } - if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth) - { - client->errorValue = stuff->srcWidth; - return BadValue; - } - if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight) - { - client->errorValue = stuff->srcHeight; - return BadValue; - } - - if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) || - ((stuff->format != ZPixmap) && - (stuff->srcX < screenInfo.bitmapScanlinePad) && - ((stuff->format == XYBitmap) || - ((stuff->srcY == 0) && - (stuff->srcHeight == stuff->totalHeight))))) && - ((stuff->srcX + stuff->srcWidth) == stuff->totalWidth)) - (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, - stuff->dstX, stuff->dstY, - stuff->totalWidth, stuff->srcHeight, - stuff->srcX, stuff->format, - shmdesc->addr + stuff->offset + - (stuff->srcY * length)); - else - (*shmFuncs[pDraw->pScreen->myNum]->PutImage)( - pDraw, pGC, stuff->depth, stuff->format, - stuff->totalWidth, stuff->totalHeight, - stuff->srcX, stuff->srcY, - stuff->srcWidth, stuff->srcHeight, - stuff->dstX, stuff->dstY, - shmdesc->addr + stuff->offset); - - if (stuff->sendEvent) - { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.sequenceNumber = client->sequence; - ev.minorEvent = X_ShmPutImage; - ev.majorEvent = ShmReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; - WriteEventsToClient(client, 1, (xEvent *) &ev); - } - - return (client->noClientException); -} - - - -static int -ProcShmGetImage(client) - register ClientPtr client; -{ - register DrawablePtr pDraw; - long lenPer = 0, length; - Mask plane = 0; - xShmGetImageReply xgi; - ShmDescPtr shmdesc; - int n; - - REQUEST(xShmGetImageReq); - - REQUEST_SIZE_MATCH(xShmGetImageReq); - if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) - { - client->errorValue = stuff->format; - return(BadValue); - } - VERIFY_DRAWABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - if (pDraw->type == DRAWABLE_WINDOW) - { - if( /* check for being viewable */ - !((WindowPtr) pDraw)->realized || - /* check for being on screen */ - pDraw->x + stuff->x < 0 || - pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width || - pDraw->y + stuff->y < 0 || - pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height || - /* check for being inside of border */ - stuff->x < - wBorderWidth((WindowPtr)pDraw) || - stuff->x + (int)stuff->width > - wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - stuff->y < -wBorderWidth((WindowPtr)pDraw) || - stuff->y + (int)stuff->height > - wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height - ) - return(BadMatch); - xgi.visual = wVisual(((WindowPtr)pDraw)); - } - else - { - if (stuff->x < 0 || - stuff->x+(int)stuff->width > pDraw->width || - stuff->y < 0 || - stuff->y+(int)stuff->height > pDraw->height - ) - return(BadMatch); - xgi.visual = None; - } - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - if(stuff->format == ZPixmap) - { - length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height; - } - else - { - lenPer = PixmapBytePad(stuff->width, 1) * stuff->height; - plane = ((Mask)1) << (pDraw->depth - 1); - /* only planes asked for */ - length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1))); - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); - xgi.size = length; - - if (length == 0) - { - /* nothing to do */ - } - else if (stuff->format == ZPixmap) - { - (*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y, - stuff->width, stuff->height, - stuff->format, stuff->planeMask, - shmdesc->addr + stuff->offset); - } - else - { - - length = stuff->offset; - for (; plane; plane >>= 1) - { - if (stuff->planeMask & plane) - { - (*pDraw->pScreen->GetImage)(pDraw, - stuff->x, stuff->y, - stuff->width, stuff->height, - stuff->format, plane, - shmdesc->addr + length); - length += lenPer; - } - } - } - - if (client->swapped) { - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); - } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - - return(client->noClientException); -} - -static PixmapPtr -fbShmCreatePixmap (pScreen, width, height, depth, addr) - ScreenPtr pScreen; - int width; - int height; - int depth; - char *addr; -{ - register PixmapPtr pPixmap; - - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); - if (!pPixmap) - return NullPixmap; - - if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, - BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) { - (*pScreen->DestroyPixmap)(pPixmap); - return NullPixmap; - } - return pPixmap; -} - -static int -ProcShmCreatePixmap(client) - register ClientPtr client; -{ - PixmapPtr pMap; - register DrawablePtr pDraw; - DepthPtr pDepth; - register int i; - ShmDescPtr shmdesc; - REQUEST(xShmCreatePixmapReq); - - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - client->errorValue = stuff->pid; - if (!sharedPixmaps) - return BadImplementation; - LEGAL_NEW_RESOURCE(stuff->pid, client); - VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } -CreatePmap: - VERIFY_SHMSIZE(shmdesc, stuff->offset, - PixmapBytePad(stuff->width, stuff->depth) * stuff->height, - client); - pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)( - pDraw->pScreen, stuff->width, - stuff->height, stuff->depth, - shmdesc->addr + stuff->offset); - if (pMap) - { -#ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif - shmdesc->refcnt++; - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) - { - return(client->noClientException); - } - } - return (BadAlloc); -} - -static int -ProcShmDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_ShmQueryVersion: - return ProcShmQueryVersion(client); - case X_ShmAttach: - return ProcShmAttach(client); - case X_ShmDetach: - return ProcShmDetach(client); - case X_ShmPutImage: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmPutImage(client); -#endif - return ProcShmPutImage(client); - case X_ShmGetImage: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmGetImage(client); -#endif - return ProcShmGetImage(client); - case X_ShmCreatePixmap: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmCreatePixmap(client); -#endif - return ProcShmCreatePixmap(client); - default: - return BadRequest; - } -} - -static void -SShmCompletionEvent(from, to) - xShmCompletionEvent *from, *to; -{ - to->type = from->type; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->drawable, to->drawable); - cpswaps(from->minorEvent, to->minorEvent); - to->majorEvent = from->majorEvent; - cpswapl(from->shmseg, to->shmseg); - cpswapl(from->offset, to->offset); -} - -static int -SProcShmQueryVersion(client) - register ClientPtr client; -{ - register int n; - REQUEST(xShmQueryVersionReq); - - swaps(&stuff->length, n); - return ProcShmQueryVersion(client); -} - -static int -SProcShmAttach(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmAttachReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmAttachReq); - swapl(&stuff->shmseg, n); - swapl(&stuff->shmid, n); - return ProcShmAttach(client); -} - -static int -SProcShmDetach(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmDetachReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmDetachReq); - swapl(&stuff->shmseg, n); - return ProcShmDetach(client); -} - -static int -SProcShmPutImage(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmPutImageReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmPutImageReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->totalWidth, n); - swaps(&stuff->totalHeight, n); - swaps(&stuff->srcX, n); - swaps(&stuff->srcY, n); - swaps(&stuff->srcWidth, n); - swaps(&stuff->srcHeight, n); - swaps(&stuff->dstX, n); - swaps(&stuff->dstY, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmPutImage(client); -} - -static int -SProcShmGetImage(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmGetImageReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmGetImageReq); - swapl(&stuff->drawable, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->planeMask, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmGetImage(client); -} - -static int -SProcShmCreatePixmap(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmCreatePixmapReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - swapl(&stuff->drawable, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmCreatePixmap(client); -} - -static int -SProcShmDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_ShmQueryVersion: - return SProcShmQueryVersion(client); - case X_ShmAttach: - return SProcShmAttach(client); - case X_ShmDetach: - return SProcShmDetach(client); - case X_ShmPutImage: - return SProcShmPutImage(client); - case X_ShmGetImage: - return SProcShmGetImage(client); - case X_ShmCreatePixmap: - return SProcShmCreatePixmap(client); - default: - return BadRequest; - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original deleted file mode 100644 index 95ecde951..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original +++ /dev/null @@ -1,4179 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXwindow.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -/**************************************************************** -* * -* Copyright (c) Digital Equipment Corporation, 1991, 1997 * -* * -* All Rights Reserved. Unpublished rights reserved under * -* the copyright laws of the United States. * -* * -* The software contained on this media is proprietary to * -* and embodies the confidential technology of Digital * -* Equipment Corporation. Possession, use, duplication or * -* dissemination of the software and media is authorized only * -* pursuant to a valid written license from Digital Equipment * -* Corporation. * -* * -* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure * -* by the U.S. Government is subject to restrictions as set * -* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, * -* or in FAR 52.227-19, as applicable. * -* * -*****************************************************************/ - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "selection.h" -#ifdef PANORAMIX -#include "../../Xext/panoramiX.h" -#include "../../Xext/panoramiXsrv.h" -#endif -#include "dixevents.h" -#include "globals.h" - -#ifdef XAPPGROUP -#include "Xagsrv.h" -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif - -#include "Screen.h" -#include "Options.h" -#include "Atoms.h" -#include "Clipboard.h" -#include "Splash.h" -#include "Rootless.h" -#include "Composite.h" -#include "Drawable.h" -#include "Colormap.h" - -#if defined(NEED_SCREEN_REGIONS) -#define REGION_PTR(pScreen,pWin) \ - register ScreenPtr pScreen = pWin->drawable.pScreen; -#else -#define REGION_PTR(pScreen,pWin) /* nothing */ -#endif - -extern Bool nxagentWMIsRunning; -extern Bool nxagentScreenTrap; - -/****** - * Window stuff for server - * - * CreateRootWindow, CreateWindow, ChangeWindowAttributes, - * GetWindowAttributes, DeleteWindow, DestroySubWindows, - * HandleSaveSet, ReparentWindow, MapWindow, MapSubWindows, - * UnmapWindow, UnmapSubWindows, ConfigureWindow, CirculateWindow, - * - ******/ - -int screenIsSaved = SCREEN_SAVER_OFF; - -ScreenSaverStuffRec savedScreenInfo[MAXSCREENS]; - -#if 0 -extern void DeleteWindowFromAnyEvents(); -extern Mask EventMaskForClient(); -extern void WindowHasNewCursor(); -extern void RecalculateDeliverableEvents(); -#endif - -static Bool TileScreenSaver( -#if NeedFunctionPrototypes - int /*i*/, - int /*kind*/ -#endif -); - - -#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \ - CWDontPropagate | CWOverrideRedirect | CWCursor ) - -#define BOXES_OVERLAP(b1, b2) \ - (!( ((b1)->x2 <= (b2)->x1) || \ - ( ((b1)->x1 >= (b2)->x2)) || \ - ( ((b1)->y2 <= (b2)->y1)) || \ - ( ((b1)->y1 >= (b2)->y2)) ) ) - -#define RedirectSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureRedirectMask) - -#define SubSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureNotifyMask) - -#define StrSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & StructureNotifyMask) - -#define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent)) - - -/* - * Set here the required log level. - */ - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -int numSaveUndersViewable = 0; -int deltaSaveUndersViewable = 0; - -WindowPtr nxagentRootTileWindow; - -/* - * This block used the DEBUG symbol. - */ - -#ifdef WINDOW_TREE_DEBUG -/****** - * PrintWindowTree - * For debugging only - ******/ - -int -PrintChildren(p1, indent) - WindowPtr p1; - int indent; -{ - WindowPtr p2; - int i; - - while (p1) - { - p2 = p1->firstChild; - for (i=0; idrawable.id); - miPrintRegion(&p1->clipList); - PrintChildren(p2, indent+4); - p1 = p1->nextSib; - } -} - -PrintWindowTree() -{ - int i; - WindowPtr pWin, p1; - - for (i=0; iclipList); - p1 = pWin->firstChild; - PrintChildren(p1, 4); - } -} -#endif - -int -TraverseTree(pWin, func, data) - register WindowPtr pWin; - VisitWindowProcPtr func; - pointer data; -{ - register int result; - register WindowPtr pChild; - - if (!(pChild = pWin)) - return(WT_NOMATCH); - while (1) - { - result = (* func)(pChild, data); - if (result == WT_STOPWALKING) - return(WT_STOPWALKING); - if ((result == WT_WALKCHILDREN) && pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } - return(WT_NOMATCH); -} - -/***** - * WalkTree - * Walk the window tree, for SCREEN, preforming FUNC(pWin, data) on - * each window. If FUNC returns WT_WALKCHILDREN, traverse the children, - * if it returns WT_DONTWALKCHILDREN, dont. If it returns WT_STOPWALKING - * exit WalkTree. Does depth-first traverse. - *****/ - -int -WalkTree(pScreen, func, data) - ScreenPtr pScreen; - VisitWindowProcPtr func; - pointer data; -{ - return(TraverseTree(WindowTable[pScreen->myNum], func, data)); -} - -/* hack for forcing backing store on all windows */ -int defaultBackingStore = NotUseful; -/* hack to force no backing store */ -Bool disableBackingStore = FALSE; -Bool enableBackingStore = FALSE; -/* hack to force no save unders */ -Bool disableSaveUnders = FALSE; - -static void -#if NeedFunctionPrototypes -SetWindowToDefaults(register WindowPtr pWin) -#else -SetWindowToDefaults(pWin) - register WindowPtr pWin; -#endif -{ - pWin->prevSib = NullWindow; - pWin->firstChild = NullWindow; - pWin->lastChild = NullWindow; - - pWin->valdata = (ValidatePtr)NULL; - pWin->optional = (WindowOptPtr)NULL; - pWin->cursorIsNone = TRUE; - - pWin->backingStore = NotUseful; - pWin->DIXsaveUnder = FALSE; - pWin->backStorage = (pointer) NULL; - - pWin->mapped = FALSE; /* off */ - pWin->realized = FALSE; /* off */ - pWin->viewable = FALSE; - pWin->visibility = VisibilityNotViewable; - pWin->overrideRedirect = FALSE; - pWin->saveUnder = FALSE; - - pWin->bitGravity = ForgetGravity; - pWin->winGravity = NorthWestGravity; - - pWin->eventMask = 0; - pWin->deliverableEvents = 0; - pWin->dontPropagate = 0; - pWin->forcedBS = FALSE; -#ifdef NEED_DBE_BUF_BITS - pWin->srcBuffer = DBE_FRONT_BUFFER; - pWin->dstBuffer = DBE_FRONT_BUFFER; -#endif -} - -void nxagentClearSplash(WindowPtr pW) -{ - int w, h; - ScreenPtr pScreen; - - w = pW->drawable.width; - h = pW->drawable.height; - - pScreen = pW->drawable.pScreen; - - if (pW->backgroundState == BackgroundPixmap) - { - (*pScreen->DestroyPixmap)(pW->background.pixmap); - } - - pW->backgroundState = BackgroundPixel; - pW->background.pixel = nxagentLogoBlack; - - (*pScreen->ChangeWindowAttributes)(pW, CWBackPixmap|CWBackPixel); -} - -static void -#if NeedFunctionPrototypes -MakeRootTile(WindowPtr pWin) -#else -MakeRootTile(pWin) - WindowPtr pWin; -#endif -{ - nxagentRootTileWindow = pWin; -} - -WindowPtr -AllocateWindow(pScreen) - ScreenPtr pScreen; -{ - WindowPtr pWin; - register char *ptr; - register DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; - - pWin = (WindowPtr)xalloc(pScreen->totalWindowSize); - if (pWin) - { - ppriv = (DevUnion *)(pWin + 1); - pWin->devPrivates = ppriv; - sizes = pScreen->WindowPrivateSizes; - ptr = (char *)(ppriv + pScreen->WindowPrivateLen); - for (i = pScreen->WindowPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - } - return pWin; -} - -/***** - * CreateRootWindow - * Makes a window at initialization time for specified screen - *****/ - -Bool -CreateRootWindow(pScreen) - ScreenPtr pScreen; -{ - WindowPtr pWin; - BoxRec box; - PixmapFormatRec *format; - - pWin = AllocateWindow(pScreen); - if (!pWin) - return FALSE; - - savedScreenInfo[pScreen->myNum].pWindow = NULL; - savedScreenInfo[pScreen->myNum].wid = FakeClientID(0); - savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL; - screenIsSaved = SCREEN_SAVER_OFF; - - WindowTable[pScreen->myNum] = pWin; - - pWin->drawable.pScreen = pScreen; - pWin->drawable.type = DRAWABLE_WINDOW; - - pWin->drawable.depth = pScreen->rootDepth; - for (format = screenInfo.formats; - format->depth != pScreen->rootDepth; - format++) - ; - pWin->drawable.bitsPerPixel = format->bitsPerPixel; - - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - pWin->parent = NullWindow; - SetWindowToDefaults(pWin); - - pWin->optional = (WindowOptRec *) xalloc (sizeof (WindowOptRec)); - if (!pWin->optional) - return FALSE; - - pWin->optional->dontPropagateMask = 0; - pWin->optional->otherEventMasks = 0; - pWin->optional->otherClients = NULL; - pWin->optional->passiveGrabs = NULL; - pWin->optional->userProps = NULL; - pWin->optional->backingBitPlanes = ~0L; - pWin->optional->backingPixel = 0; -#ifdef SHAPE - pWin->optional->boundingShape = NULL; - pWin->optional->clipShape = NULL; -#endif -#ifdef XINPUT - pWin->optional->inputMasks = NULL; -#endif - pWin->optional->colormap = pScreen->defColormap; - pWin->optional->visual = pScreen->rootVisual; - - pWin->nextSib = NullWindow; - - pWin->drawable.id = FakeClientID(0); - - pWin->origin.x = pWin->origin.y = 0; - pWin->drawable.height = pScreen->height; - pWin->drawable.width = pScreen->width; - pWin->drawable.x = pWin->drawable.y = 0; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - REGION_INIT(pScreen, &pWin->winSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderClip, &box, 1); - - pWin->drawable.class = InputOutput; - pWin->optional->visual = pScreen->rootVisual; - - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = pScreen->whitePixel; - - pWin->borderIsPixel = TRUE; - pWin->border.pixel = pScreen->blackPixel; - pWin->borderWidth = 0; - - if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin)) - return FALSE; - - if (disableBackingStore) - { - pScreen -> backingStoreSupport = NotUseful; - } - - if (enableBackingStore) - { - pScreen -> backingStoreSupport = Always; - } - - pScreen->saveUnderSupport = False; - -#ifdef DO_SAVE_UNDERS - if ((pScreen->backingStoreSupport != NotUseful) && - (pScreen->saveUnderSupport == NotUseful)) - { - /* - * If the screen has backing-store but no save-unders, let the - * clients know we can support save-unders using backing-store. - */ - pScreen->saveUnderSupport = USE_DIX_SAVE_UNDERS; - } -#endif /* DO_SAVE_UNDERS */ - - if (disableSaveUnders) - pScreen->saveUnderSupport = NotUseful; - - return TRUE; -} - -void -InitRootWindow(pWin) - WindowPtr pWin; -{ - ScreenPtr pScreen; - - #ifdef TEST - fprintf(stderr, "InitRootWindow: Called for window at [%p][%ld] with parent [%p].\n", - (void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); - #endif - - if (nxagentOption(Rootless)) - { - #ifdef TEST - fprintf(stderr, "InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].\n", - (void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); - #endif - - nxagentRootlessWindow = pWin; - } - - pScreen = pWin->drawable.pScreen; - - /* - * A root window is created for each screen by main - * and the pointer is saved in WindowTable as in the - * following snippet: - * - * for (i = 0; i < screenInfo.numScreens; i++) - * InitRootWindow(WindowTable[i]); - * - * Our root window on the real display was already - * created at the time the screen was opened, so it - * is unclear how this window (or the other window, - * if you prefer) fits in the big picture. - */ - - #ifdef TEST - fprintf(stderr, "InitRootWindow: Going to create window as root at [%p][%ld] with parent [%p].\n", - (void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); - #endif - - if (!(*pScreen->CreateWindow)(pWin)) - return; /* XXX */ - - #ifdef TEST - fprintf(stderr, "InitRootWindow: Created window as root at [%p][%ld] with parent [%p].\n", - (void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); - #endif - - (*pScreen->PositionWindow)(pWin, 0, 0); - - pWin->cursorIsNone = FALSE; - pWin->optional->cursor = rootCursor; - rootCursor->refcnt++; - pWin->backingStore = defaultBackingStore; - pWin->forcedBS = (defaultBackingStore != NotUseful); - - #ifdef NXAGENT_SPLASH - /* We SHOULD check for an error value here XXX */ - pWin -> background.pixel = pScreen -> blackPixel; - (*pScreen->ChangeWindowAttributes)(pWin, - CWBackPixel|CWBorderPixel|CWCursor|CWBackingStore); - #else - (*pScreen->ChangeWindowAttributes)(pWin, - CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore); - #endif - - MakeRootTile(pWin); - - /* - * Map both the root and the default agent window. - */ - - #ifdef TEST - fprintf(stderr, "InitRootWindow: Mapping default windows.\n"); - #endif - - nxagentInitAtoms(pWin); - - nxagentInitClipboard(pWin); - - nxagentMapDefaultWindows(); - - nxagentRedirectDefaultWindows(); - - #ifdef NXAGENT_ARTSD - { - char artsd_port[10]; - int nPort; - extern void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port); - nPort = atoi(display) + 7000; - sprintf(artsd_port,"%d", nPort); - nxagentPropagateArtsdProperties(pScreen, artsd_port); - } - #endif -} - -/* Set the region to the intersection of the rectangle and the - * window's winSize. The window is typically the parent of the - * window from which the region came. - */ - -void -ClippedRegionFromBox(pWin, Rgn, x, y, w, h) - register WindowPtr pWin; - RegionPtr Rgn; - register int x, y; - int w, h; -{ - REGION_PTR(pScreen, pWin) - BoxRec box; - - box = *(REGION_EXTENTS(pScreen, &pWin->winSize)); - /* we do these calculations to avoid overflows */ - if (x > box.x1) - box.x1 = x; - if (y > box.y1) - box.y1 = y; - x += w; - if (x < box.x2) - box.x2 = x; - y += h; - if (y < box.y2) - box.y2 = y; - if (box.x1 > box.x2) - box.x2 = box.x1; - if (box.y1 > box.y2) - box.y2 = box.y1; - REGION_RESET(pScreen, Rgn, &box); - REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize); -} - -WindowPtr -RealChildHead(pWin) - register WindowPtr pWin; -{ - if (!pWin->parent && - (screenIsSaved == SCREEN_SAVER_ON) && - (HasSaverWindow (pWin->drawable.pScreen->myNum))) - return (pWin->firstChild); - else - return (NullWindow); -} - -/***** - * CreateWindow - * Makes a window in response to client request - *****/ - -WindowPtr -CreateWindow(wid, pParent, x, y, w, h, bw, class, vmask, vlist, - depth, client, visual, error) - Window wid; - register WindowPtr pParent; - int x,y; - unsigned int w, h, bw; - unsigned int class; - register Mask vmask; - XID *vlist; - int depth; - ClientPtr client; - VisualID visual; - int *error; -{ - register WindowPtr pWin; - WindowPtr pHead; - register ScreenPtr pScreen; - xEvent event; - int idepth, ivisual; - Bool fOK; - DepthPtr pDepth; - PixmapFormatRec *format; - register WindowOptPtr ancwopt; - - if (class == CopyFromParent) - class = pParent->drawable.class; - - if ((class != InputOutput) && (class != InputOnly)) - { - *error = BadValue; - client->errorValue = class; - return NullWindow; - } - - if ((class != InputOnly) && (pParent->drawable.class == InputOnly)) - { - *error = BadMatch; - return NullWindow; - } - - if ((class == InputOnly) && ((bw != 0) || (depth != 0))) - { - *error = BadMatch; - return NullWindow; - } - - pScreen = pParent->drawable.pScreen; - if ((class == InputOutput) && (depth == 0)) - depth = pParent->drawable.depth; - ancwopt = pParent->optional; - if (!ancwopt) - ancwopt = FindWindowWithOptional(pParent)->optional; - if (visual == CopyFromParent) { -#ifdef XAPPGROUP - VisualID ag_visual; - - if (client->appgroup && !pParent->parent && - (ag_visual = XagRootVisual (client))) - visual = ag_visual; - else -#endif - visual = ancwopt->visual; - } - - /* Find out if the depth and visual are acceptable for this Screen */ - if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) - { - fOK = FALSE; - for(idepth = 0; idepth < pScreen->numDepths; idepth++) - { - pDepth = (DepthPtr) &pScreen->allowedDepths[idepth]; - if ((depth == pDepth->depth) || (depth == 0)) - { - for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) - { - if (visual == pDepth->vids[ivisual]) - { - fOK = TRUE; - break; - } - } - } - } - if (fOK == FALSE) - { - *error = BadMatch; - return NullWindow; - } - } - - if (((vmask & (CWBorderPixmap | CWBorderPixel)) == 0) && - (class != InputOnly) && - (depth != pParent->drawable.depth)) - { - *error = BadMatch; - return NullWindow; - } - - if (((vmask & CWColormap) == 0) && - (class != InputOnly) && - ((visual != ancwopt->visual) || (ancwopt->colormap == None))) - { - *error = BadMatch; - return NullWindow; - } - - pWin = AllocateWindow(pScreen); - if (!pWin) - { - *error = BadAlloc; - return NullWindow; - } - pWin->drawable = pParent->drawable; - pWin->drawable.depth = depth; - if (depth == pParent->drawable.depth) - pWin->drawable.bitsPerPixel = pParent->drawable.bitsPerPixel; - else - { - for (format = screenInfo.formats; format->depth != depth; format++) - ; - pWin->drawable.bitsPerPixel = format->bitsPerPixel; - } - if (class == InputOnly) - pWin->drawable.type = (short) UNDRAWABLE_WINDOW; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - pWin->drawable.id = wid; - pWin->drawable.class = class; - - pWin->parent = pParent; - SetWindowToDefaults(pWin); - - if (visual != ancwopt->visual) - { - if (!MakeWindowOptional (pWin)) - { - xfree (pWin); - *error = BadAlloc; - return NullWindow; - } - pWin->optional->visual = visual; - pWin->optional->colormap = None; - } - - pWin->borderWidth = bw; -#ifdef XCSECURITY - /* can't let untrusted clients have background None windows; - * they make it too easy to steal window contents - */ - if (client->trustLevel != XSecurityClientTrusted) - { - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = 0; - } - else -#endif - pWin->backgroundState = None; - - pWin->borderIsPixel = pParent->borderIsPixel; - pWin->border = pParent->border; - if (pWin->borderIsPixel == FALSE) - pWin->border.pixmap->refcnt++; - - pWin->origin.x = x + (int)bw; - pWin->origin.y = y + (int)bw; - pWin->drawable.width = w; - pWin->drawable.height = h; - pWin->drawable.x = pParent->drawable.x + x + (int)bw; - pWin->drawable.y = pParent->drawable.y + y + (int)bw; - - /* set up clip list correctly for unobscured WindowPtr */ - REGION_INIT(pScreen, &pWin->clipList, NullBox, 1); - REGION_INIT(pScreen, &pWin->borderClip, NullBox, 1); - REGION_INIT(pScreen, &pWin->winSize, NullBox, 1); - REGION_INIT(pScreen, &pWin->borderSize, NullBox, 1); - - pHead = RealChildHead(pParent); - if (pHead) - { - pWin->nextSib = pHead->nextSib; - if (pHead->nextSib) - pHead->nextSib->prevSib = pWin; - else - pParent->lastChild = pWin; - pHead->nextSib = pWin; - pWin->prevSib = pHead; - } - else - { - pWin->nextSib = pParent->firstChild; - if (pParent->firstChild) - pParent->firstChild->prevSib = pWin; - else - pParent->lastChild = pWin; - pParent->firstChild = pWin; - } - - SetWinSize (pWin); - SetBorderSize (pWin); - - /* We SHOULD check for an error value here XXX */ - if (!(*pScreen->CreateWindow)(pWin)) - { - *error = BadAlloc; - DeleteWindow(pWin, None); - return NullWindow; - } - /* We SHOULD check for an error value here XXX */ - (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y); - - if (!(vmask & CWEventMask)) - RecalculateDeliverableEvents(pWin); - - if (vmask) - *error = ChangeWindowAttributes(pWin, vmask, vlist, wClient (pWin)); - else - *error = Success; - - if (*error != Success) - { - DeleteWindow(pWin, None); - return NullWindow; - } - if (!(vmask & CWBackingStore) && (defaultBackingStore != NotUseful)) - { - XID value = defaultBackingStore; - (void)ChangeWindowAttributes(pWin, CWBackingStore, &value, wClient (pWin)); - pWin->forcedBS = TRUE; - } - - if (SubSend(pParent)) - { - event.u.u.type = CreateNotify; - event.u.createNotify.window = wid; - event.u.createNotify.parent = pParent->drawable.id; - event.u.createNotify.x = x; - event.u.createNotify.y = y; - event.u.createNotify.width = w; - event.u.createNotify.height = h; - event.u.createNotify.borderWidth = bw; - event.u.createNotify.override = pWin->overrideRedirect; - DeliverEvents(pParent, &event, 1, NullWindow); - } - return pWin; -} - -static void -#if NeedFunctionPrototypes -FreeWindowResources(register WindowPtr pWin) -#else -FreeWindowResources(pWin) - register WindowPtr pWin; -#endif -{ - register ScreenPtr pScreen = pWin->drawable.pScreen; - - DeleteWindowFromAnySaveSet(pWin); - DeleteWindowFromAnySelections(pWin); - DeleteWindowFromAnyEvents(pWin, TRUE); - REGION_UNINIT(pScreen, &pWin->clipList); - REGION_UNINIT(pScreen, &pWin->winSize); - REGION_UNINIT(pScreen, &pWin->borderClip); - REGION_UNINIT(pScreen, &pWin->borderSize); -#ifdef SHAPE - if (wBoundingShape (pWin)) - REGION_DESTROY(pScreen, wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_DESTROY(pScreen, wClipShape (pWin)); -#endif - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - - DeleteAllWindowProperties(pWin); - /* We SHOULD check for an error value here XXX */ - (*pScreen->DestroyWindow)(pWin); - DisposeWindowOptional (pWin); -} - -static void -#if NeedFunctionPrototypes -CrushTree(WindowPtr pWin) -#else -CrushTree(pWin) - WindowPtr pWin; -#endif -{ - register WindowPtr pChild, pSib, pParent; - UnrealizeWindowProcPtr UnrealizeWindow; - xEvent event; - - if (!(pChild = pWin->firstChild)) - return; - UnrealizeWindow = pWin->drawable.pScreen->UnrealizeWindow; - while (1) - { - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (1) - { - pParent = pChild->parent; - if (SubStrSend(pChild, pParent)) - { - event.u.u.type = DestroyNotify; - event.u.destroyNotify.window = pChild->drawable.id; - DeliverEvents(pChild, &event, 1, NullWindow); - } - FreeResource(pChild->drawable.id, RT_WINDOW); - pSib = pChild->nextSib; -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder && pChild->viewable) - deltaSaveUndersViewable--; -#endif - pChild->viewable = FALSE; - if (pChild->realized) - { - pChild->realized = FALSE; - (*UnrealizeWindow)(pChild); - } - FreeWindowResources(pChild); - xfree(pChild); - if ( (pChild = pSib) ) - break; - pChild = pParent; - pChild->firstChild = NullWindow; - pChild->lastChild = NullWindow; - if (pChild == pWin) - return; - } - } -} - -/***** - * DeleteWindow - * Deletes child of window then window itself - * If wid is None, don't send any events - *****/ - -/*ARGSUSED*/ -int -DeleteWindow(value, wid) - pointer value; - XID wid; - { - register WindowPtr pParent; - register WindowPtr pWin = (WindowPtr)value; - xEvent event; - - UnmapWindow(pWin, FALSE); - - CrushTree(pWin); - - pParent = pWin->parent; - if (wid && pParent && SubStrSend(pWin, pParent)) - { - event.u.u.type = DestroyNotify; - event.u.destroyNotify.window = pWin->drawable.id; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - FreeWindowResources(pWin); - if (pParent) - { - if (pParent->firstChild == pWin) - pParent->firstChild = pWin->nextSib; - if (pParent->lastChild == pWin) - pParent->lastChild = pWin->prevSib; - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - } - xfree(pWin); - - if (pWin -> optional && - pWin -> optional -> colormap && - pWin -> parent) - { - nxagentSetInstalledColormapWindows(pWin -> drawable.pScreen); - } - - return Success; -} - -/*ARGSUSED*/ -void -DestroySubwindows(pWin, client) - register WindowPtr pWin; - ClientPtr client; -{ - /* XXX - * The protocol is quite clear that each window should be - * destroyed in turn, however, unmapping all of the first - * eliminates most of the calls to ValidateTree. So, - * this implementation is incorrect in that all of the - * UnmapNotifies occur before all of the DestroyNotifies. - * If you care, simply delete the call to UnmapSubwindows. - */ - UnmapSubwindows(pWin); - while (pWin->lastChild) - FreeResource(pWin->lastChild->drawable.id, RT_NONE); -} - -#define DeviceEventMasks (KeyPressMask | KeyReleaseMask | ButtonPressMask | \ - ButtonReleaseMask | PointerMotionMask) - -/***** - * ChangeWindowAttributes - * - * The value-mask specifies which attributes are to be changed; the - * value-list contains one value for each one bit in the mask, from least - * to most significant bit in the mask. - *****/ - -int -ChangeWindowAttributes(pWin, vmask, vlist, client) - register WindowPtr pWin; - Mask vmask; - XID *vlist; - ClientPtr client; -{ - register Mask index2; - register XID *pVlist; - PixmapPtr pPixmap; - Pixmap pixID; - CursorPtr pCursor, pOldCursor; - Cursor cursorID; - WindowPtr pChild; - Colormap cmap; - ColormapPtr pCmap; - xEvent xE; - int result; - register ScreenPtr pScreen; - Mask vmaskCopy = 0; - register Mask tmask; - unsigned int val; - int error; - Bool checkOptional = FALSE; - Bool borderRelative = FALSE; - WindowPtr pLayerWin; - - if ((pWin->drawable.class == InputOnly) && (vmask & (~INPUTONLY_LEGAL_MASK))) - return BadMatch; - - error = Success; - pScreen = pWin->drawable.pScreen; - pVlist = vlist; - tmask = vmask; - while (tmask) - { - index2 = (Mask) lowbit (tmask); - tmask &= ~index2; - switch (index2) - { - case CWBackPixmap: - pixID = (Pixmap )*pVlist; - pVlist++; - if (pWin->backgroundState == ParentRelative) - borderRelative = TRUE; - if (pixID == None) - { -#ifdef XCSECURITY - /* can't let untrusted clients have background None windows */ - if (client->trustLevel == XSecurityClientTrusted) - { -#endif - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - if (!pWin->parent) - MakeRootTile(pWin); - else - pWin->backgroundState = None; -#ifdef XCSECURITY - } - else - { /* didn't change the background to None, so don't tell ddx */ - index2 = 0; - } -#endif - } - else if (pixID == ParentRelative) - { - if (pWin->parent && - pWin->drawable.depth != pWin->parent->drawable.depth) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - if (!pWin->parent) - MakeRootTile(pWin); - else - pWin->backgroundState = ParentRelative; - borderRelative = TRUE; - /* Note that the parent's backgroundTile's refcnt is NOT - * incremented. */ - } - else - { - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); - if (pPixmap != (PixmapPtr) NULL) - { - if ((pPixmap->drawable.depth != pWin->drawable.depth) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - pWin->backgroundState = BackgroundPixmap; - pWin->background.pixmap = pPixmap; - pPixmap->refcnt++; - } - else - { - error = BadPixmap; - client->errorValue = pixID; - goto PatchUp; - } - } - break; - case CWBackPixel: - if (pWin->backgroundState == ParentRelative) - borderRelative = TRUE; - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = (CARD32 ) *pVlist; - /* background pixel overrides background pixmap, - so don't let the ddx layer see both bits */ - vmaskCopy &= ~CWBackPixmap; - pVlist++; - break; - case CWBorderPixmap: - pixID = (Pixmap ) *pVlist; - pVlist++; - if (pixID == CopyFromParent) - { - if (!pWin->parent || - (pWin->drawable.depth != pWin->parent->drawable.depth)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->border = pWin->parent->border; - if ((pWin->borderIsPixel = pWin->parent->borderIsPixel) == TRUE) - { - index2 = CWBorderPixel; - } - else - { - pWin->parent->border.pixmap->refcnt++; - } - } - else - { - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); - if (pPixmap) - { - if ((pPixmap->drawable.depth != pWin->drawable.depth) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->borderIsPixel = FALSE; - pWin->border.pixmap = pPixmap; - pPixmap->refcnt++; - } - else - { - error = BadPixmap; - client->errorValue = pixID; - goto PatchUp; - } - } - break; - case CWBorderPixel: - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->borderIsPixel = TRUE; - pWin->border.pixel = (CARD32) *pVlist; - /* border pixel overrides border pixmap, - so don't let the ddx layer see both bits */ - vmaskCopy &= ~CWBorderPixmap; - pVlist++; - break; - case CWBitGravity: - val = (CARD8 )*pVlist; - pVlist++; - if (val > StaticGravity) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->bitGravity = val; - break; - case CWWinGravity: - val = (CARD8 )*pVlist; - pVlist++; - if (val > StaticGravity) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->winGravity = val; - break; - case CWBackingStore: - val = (CARD8 )*pVlist; - pVlist++; - if ((val != NotUseful) && (val != WhenMapped) && (val != Always)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->backingStore = val; - - #ifdef TEST - fprintf(stderr, "ChangeWindowAttributes: Changed backing store value to %d for window at %p.\n", - val, (void*)pWin); - #endif - - pWin->forcedBS = FALSE; - break; - case CWBackingPlanes: - if (pWin->optional || ((CARD32)*pVlist != (CARD32)~0L)) { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - pWin->optional->backingBitPlanes = (CARD32) *pVlist; - if ((CARD32)*pVlist == (CARD32)~0L) - checkOptional = TRUE; - } - pVlist++; - break; - case CWBackingPixel: - if (pWin->optional || (CARD32) *pVlist) { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - pWin->optional->backingPixel = (CARD32) *pVlist; - if (!*pVlist) - checkOptional = TRUE; - } - pVlist++; - break; - case CWSaveUnder: - val = (BOOL) *pVlist; - pVlist++; - if ((val != xTrue) && (val != xFalse)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } -#ifdef DO_SAVE_UNDERS - if (pWin->parent && (pWin->saveUnder != val) && (pWin->viewable) && - DO_SAVE_UNDERS(pWin)) - { - /* - * Re-check all siblings and inferiors for obscurity or - * exposition (hee hee). - */ - if (pWin->saveUnder) - deltaSaveUndersViewable--; - else - deltaSaveUndersViewable++; - pWin->saveUnder = val; - - if (pWin->firstChild) - { - pLayerWin = (*pScreen->GetLayerWindow)(pWin); - if ((*pScreen->ChangeSaveUnder)(pLayerWin->parent, pWin->nextSib)) - (*pScreen->PostChangeSaveUnder)(pLayerWin->parent, - pWin->nextSib); - } - else - { - if ((*pScreen->ChangeSaveUnder)(pWin, pWin->nextSib)) - (*pScreen->PostChangeSaveUnder)(pWin, - pWin->nextSib); - } - } - else - { - /* If we're changing the saveUnder attribute of the root - * window, all we do is set pWin->saveUnder so that - * GetWindowAttributes returns the right value. We don't - * do the "normal" save-under processing (as above). - * Hope that doesn't cause any problems. - */ - pWin->saveUnder = val; - } -#else - pWin->saveUnder = val; -#endif /* DO_SAVE_UNDERS */ - break; - case CWEventMask: - /* - * TODO: Some applications like java bean shell - * don' t work if they cannot monitor the root - * window for Structure Redirect events. However - * this doesn't seem to be the best solution, since - * also an X server with a window manager running, - * doesn't allow to monitor for those events, but - * the java bean shell works flawlessy on this - * server. - * - * if (nxagentCheckIllegalRootMonitoring(pWin, (Mask)*pVlist)) - * { - * return BadAccess; - * } - */ - - result = EventSelectForWindow(pWin, client, (Mask )*pVlist); - if (result) - { - error = result; - goto PatchUp; - } - pVlist++; - break; - case CWDontPropagate: - result = EventSuppressForWindow(pWin, client, (Mask )*pVlist, - &checkOptional); - if (result) - { - error = result; - goto PatchUp; - } - pVlist++; - break; - case CWOverrideRedirect: - val = (BOOL ) *pVlist; - pVlist++; - if ((val != xTrue) && (val != xFalse)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->overrideRedirect = val; - break; - case CWColormap: - cmap = (Colormap) *pVlist; - pVlist++; - if (cmap == CopyFromParent) - { -#ifdef XAPPGROUP - Colormap ag_colormap; - ClientPtr win_owner; - - /* - * win_owner == client for CreateWindow, other clients - * can ChangeWindowAttributes - */ - win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - - if ( win_owner && win_owner->appgroup && - !pWin->parent->parent && - (ag_colormap = XagDefaultColormap (win_owner))) - cmap = ag_colormap; - else -#endif - if (pWin->parent && - (!pWin->optional || - pWin->optional->visual == wVisual (pWin->parent))) - { - cmap = wColormap (pWin->parent); - } - else - cmap = None; - } - if (cmap == None) - { - error = BadMatch; - goto PatchUp; - } - pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap, - RT_COLORMAP, SecurityReadAccess); - if (!pCmap) - { - error = BadColor; - client->errorValue = cmap; - goto PatchUp; - } - if (pCmap->pVisual->vid != wVisual (pWin) || - pCmap->pScreen != pScreen) - { - error = BadMatch; - goto PatchUp; - } - if (cmap != wColormap (pWin)) - { - if (!pWin->optional) - { - if (!MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - } - else if (pWin->parent && cmap == wColormap (pWin->parent)) - checkOptional = TRUE; - - /* - * propagate the original colormap to any children - * inheriting it - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (!pChild->optional && !MakeWindowOptional (pChild)) - { - error = BadAlloc; - goto PatchUp; - } - } - - pWin->optional->colormap = cmap; - - /* - * check on any children now matching the new colormap - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (pChild->optional->colormap == cmap) - CheckWindowOptionalNeed (pChild); - } - - xE.u.u.type = ColormapNotify; - xE.u.colormap.window = pWin->drawable.id; - xE.u.colormap.colormap = cmap; - xE.u.colormap.new = xTrue; - xE.u.colormap.state = IsMapInstalled(cmap, pWin); - DeliverEvents(pWin, &xE, 1, NullWindow); - } - break; - case CWCursor: - cursorID = (Cursor ) *pVlist; - pVlist++; - /* - * install the new - */ - if ( cursorID == None) - { - if (pWin == WindowTable[pWin->drawable.pScreen->myNum]) - pCursor = rootCursor; - else - pCursor = (CursorPtr) None; - } - else - { - pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID, - RT_CURSOR, SecurityReadAccess); - if (!pCursor) - { - error = BadCursor; - client->errorValue = cursorID; - goto PatchUp; - } - } - - if (pCursor != wCursor (pWin)) - { - /* - * patch up child windows so they don't lose cursors. - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (!pChild->optional && !pChild->cursorIsNone && - !MakeWindowOptional (pChild)) - { - error = BadAlloc; - goto PatchUp; - } - } - - pOldCursor = 0; - if (pCursor == (CursorPtr) None) - { - pWin->cursorIsNone = TRUE; - if (pWin->optional) - { - pOldCursor = pWin->optional->cursor; - pWin->optional->cursor = (CursorPtr) None; - checkOptional = TRUE; - } - } else { - if (!pWin->optional) - { - if (!MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - } - else if (pWin->parent && pCursor == wCursor (pWin->parent)) - checkOptional = TRUE; - pOldCursor = pWin->optional->cursor; - pWin->optional->cursor = pCursor; - pCursor->refcnt++; - pWin->cursorIsNone = FALSE; - /* - * check on any children now matching the new cursor - */ - - for (pChild=pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (pChild->optional && - (pChild->optional->cursor == pCursor)) - CheckWindowOptionalNeed (pChild); - } - } - - if (pWin->realized) - WindowHasNewCursor( pWin); - - /* Can't free cursor until here - old cursor - * is needed in WindowHasNewCursor - */ - if (pOldCursor) - FreeCursor (pOldCursor, (Cursor)0); - } - break; - default: - error = BadValue; - client->errorValue = vmask; - goto PatchUp; - } - vmaskCopy |= index2; - } -PatchUp: - if (checkOptional) - CheckWindowOptionalNeed (pWin); - - /* We SHOULD check for an error value here XXX */ - (*pScreen->ChangeWindowAttributes)(pWin, vmaskCopy); - - /* - If the border contents have changed, redraw the border. - Note that this has to be done AFTER pScreen->ChangeWindowAttributes - for the tile to be rotated, and the correct function selected. - */ - if (((vmaskCopy & (CWBorderPixel | CWBorderPixmap)) || borderRelative) - && pWin->viewable && HasBorder (pWin)) - { - RegionRec exposed; - - REGION_INIT(pScreen, &exposed, NullBox, 0); - REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize); - (*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER); - REGION_UNINIT(pScreen, &exposed); - } - return error; -} - - -/***** - * GetWindowAttributes - * Notice that this is different than ChangeWindowAttributes - *****/ - -void -GetWindowAttributes(pWin, client, wa) - register WindowPtr pWin; - ClientPtr client; - xGetWindowAttributesReply *wa; -{ - wa->type = X_Reply; - wa->bitGravity = pWin->bitGravity; - wa->winGravity = pWin->winGravity; - if (pWin->forcedBS && pWin->backingStore != Always) - wa->backingStore = NotUseful; - else - wa->backingStore = pWin->backingStore; - wa->length = (sizeof(xGetWindowAttributesReply) - - sizeof(xGenericReply)) >> 2; - wa->sequenceNumber = client->sequence; - wa->backingBitPlanes = wBackingBitPlanes (pWin); - wa->backingPixel = wBackingPixel (pWin); - wa->saveUnder = (BOOL)pWin->saveUnder; - wa->override = pWin->overrideRedirect; - if (!pWin->mapped) - wa->mapState = IsUnmapped; - else if (pWin->realized) - wa->mapState = IsViewable; - else - wa->mapState = IsUnviewable; - - wa->colormap = wColormap (pWin); - wa->mapInstalled = (wa->colormap == None) ? xFalse - : IsMapInstalled(wa->colormap, pWin); - - wa->yourEventMask = EventMaskForClient(pWin, client); - wa->allEventMasks = pWin->eventMask | wOtherEventMasks (pWin); - wa->doNotPropagateMask = wDontPropagateMask (pWin); - wa->class = pWin->drawable.class; - wa->visualID = wVisual (pWin); -} - - -WindowPtr -MoveWindowInStack(pWin, pNextSib) - register WindowPtr pWin, pNextSib; -{ - register WindowPtr pParent = pWin->parent; - WindowPtr pFirstChange = pWin; /* highest window where list changes */ - - if (pWin->nextSib != pNextSib) - { - WindowPtr pOldNextSib = pWin->nextSib; - - if (!pNextSib) /* move to bottom */ - { - if (pParent->firstChild == pWin) - pParent->firstChild = pWin->nextSib; - /* if (pWin->nextSib) */ /* is always True: pNextSib == NULL - * and pWin->nextSib != pNextSib - * therefore pWin->nextSib != NULL */ - pFirstChange = pWin->nextSib; - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pParent->lastChild->nextSib = pWin; - pWin->prevSib = pParent->lastChild; - pWin->nextSib = NullWindow; - pParent->lastChild = pWin; - } - else if (pParent->firstChild == pNextSib) /* move to top */ - { - pFirstChange = pWin; - if (pParent->lastChild == pWin) - pParent->lastChild = pWin->prevSib; - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pWin->nextSib = pParent->firstChild; - pWin->prevSib = (WindowPtr ) NULL; - pNextSib->prevSib = pWin; - pParent->firstChild = pWin; - } - else /* move in middle of list */ - { - WindowPtr pOldNext = pWin->nextSib; - - pFirstChange = NullWindow; - if (pParent->firstChild == pWin) - pFirstChange = pParent->firstChild = pWin->nextSib; - if (pParent->lastChild == pWin) { - pFirstChange = pWin; - pParent->lastChild = pWin->prevSib; - } - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pWin->nextSib = pNextSib; - pWin->prevSib = pNextSib->prevSib; - if (pNextSib->prevSib) - pNextSib->prevSib->nextSib = pWin; - pNextSib->prevSib = pWin; - if (!pFirstChange) { /* do we know it yet? */ - pFirstChange = pParent->firstChild; /* no, search from top */ - while ((pFirstChange != pWin) && (pFirstChange != pOldNext)) - pFirstChange = pFirstChange->nextSib; - } - } - if(pWin->drawable.pScreen->RestackWindow) - (*pWin->drawable.pScreen->RestackWindow)(pWin, pOldNextSib); - } - - return( pFirstChange ); -} - -RegionPtr -CreateUnclippedWinSize (pWin) - register WindowPtr pWin; -{ - RegionPtr pRgn; - BoxRec box; - - box.x1 = pWin->drawable.x; - box.y1 = pWin->drawable.y; - box.x2 = pWin->drawable.x + (int) pWin->drawable.width; - box.y2 = pWin->drawable.y + (int) pWin->drawable.height; - pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); -#ifdef SHAPE - if (wBoundingShape (pWin) || wClipShape (pWin)) { - REGION_PTR(pScreen, pWin) - - REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x, - - pWin->drawable.y); - if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wClipShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x, pWin->drawable.y); - } -#endif - return pRgn; -} - -void -SetWinSize (pWin) - register WindowPtr pWin; -{ - ClippedRegionFromBox(pWin->parent, &pWin->winSize, - pWin->drawable.x, pWin->drawable.y, - (int)pWin->drawable.width, - (int)pWin->drawable.height); -#ifdef SHAPE - if (wBoundingShape (pWin) || wClipShape (pWin)) { - REGION_PTR(pScreen, pWin) - - REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x, - - pWin->drawable.y); - if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, - wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, - wClipShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->winSize, pWin->drawable.x, - pWin->drawable.y); - } -#endif -} - -void -SetBorderSize (pWin) - register WindowPtr pWin; -{ - int bw; - - if (HasBorder (pWin)) { - bw = wBorderWidth (pWin); - ClippedRegionFromBox(pWin->parent, &pWin->borderSize, - pWin->drawable.x - bw, pWin->drawable.y - bw, - (int)(pWin->drawable.width + (bw<<1)), - (int)(pWin->drawable.height + (bw<<1))); -#ifdef SHAPE - if (wBoundingShape (pWin)) { - REGION_PTR(pScreen, pWin) - - REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x, - - pWin->drawable.y); - REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize, - wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->borderSize, pWin->drawable.x, - pWin->drawable.y); - REGION_UNION(pScreen, &pWin->borderSize, &pWin->borderSize, - &pWin->winSize); - } -#endif - } else { - REGION_COPY(pWin->drawable.pScreen, &pWin->borderSize, - &pWin->winSize); - } -} - -void -GravityTranslate (x, y, oldx, oldy, dw, dh, gravity, destx, desty) - register int x, y; /* new window position */ - int oldx, oldy; /* old window position */ - int dw, dh; - unsigned gravity; - register int *destx, *desty; /* position relative to gravity */ -{ - switch (gravity) { - case NorthGravity: - *destx = x + dw / 2; - *desty = y; - break; - case NorthEastGravity: - *destx = x + dw; - *desty = y; - break; - case WestGravity: - *destx = x; - *desty = y + dh / 2; - break; - case CenterGravity: - *destx = x + dw / 2; - *desty = y + dh / 2; - break; - case EastGravity: - *destx = x + dw; - *desty = y + dh / 2; - break; - case SouthWestGravity: - *destx = x; - *desty = y + dh; - break; - case SouthGravity: - *destx = x + dw / 2; - *desty = y + dh; - break; - case SouthEastGravity: - *destx = x + dw; - *desty = y + dh; - break; - case StaticGravity: - *destx = oldx; - *desty = oldy; - break; - default: - *destx = x; - *desty = y; - break; - } -} - -/* XXX need to retile border on each window with ParentRelative origin */ -void -ResizeChildrenWinSize(pWin, dx, dy, dw, dh) - register WindowPtr pWin; - int dx, dy, dw, dh; -{ - register ScreenPtr pScreen; - register WindowPtr pSib, pChild; - Bool resized = (dw || dh); - - pScreen = pWin->drawable.pScreen; - - for (pSib = pWin->firstChild; pSib; pSib = pSib->nextSib) - { - if (resized && (pSib->winGravity > NorthWestGravity)) - { - int cwsx, cwsy; - - cwsx = pSib->origin.x; - cwsy = pSib->origin.y; - GravityTranslate (cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh, - pSib->winGravity, &cwsx, &cwsy); - if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) - { - xEvent event; - - event.u.u.type = GravityNotify; - event.u.gravity.window = pSib->drawable.id; - event.u.gravity.x = cwsx - wBorderWidth (pSib); - event.u.gravity.y = cwsy - wBorderWidth (pSib); - DeliverEvents (pSib, &event, 1, NullWindow); - pSib->origin.x = cwsx; - pSib->origin.y = cwsy; - } - } - pSib->drawable.x = pWin->drawable.x + pSib->origin.x; - pSib->drawable.y = pWin->drawable.y + pSib->origin.y; - SetWinSize (pSib); - SetBorderSize (pSib); - - /* - * Don't force X to move children. It will position them - * according with gravity. - * - * (*pScreen->PositionWindow)(pSib, pSib->drawable.x, pSib->drawable.y); - */ - - /* - * Update pSib privates, as this window is moved by X. - */ - - nxagentAddConfiguredWindow(pSib, CW_Update); - - if ( (pChild = pSib->firstChild) ) - { - while (1) - { - pChild->drawable.x = pChild->parent->drawable.x + - pChild->origin.x; - pChild->drawable.y = pChild->parent->drawable.y + - pChild->origin.y; - SetWinSize (pChild); - SetBorderSize (pChild); - - (*pScreen->PositionWindow)(pChild, pChild->drawable.x, - pChild->drawable.y); - - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pSib)) - pChild = pChild->parent; - if (pChild == pSib) - break; - pChild = pChild->nextSib; - } - } - } -} - -#define GET_INT16(m, f) \ - if (m & mask) \ - { \ - f = (INT16) *pVlist;\ - pVlist++; \ - } -#define GET_CARD16(m, f) \ - if (m & mask) \ - { \ - f = (CARD16) *pVlist;\ - pVlist++;\ - } - -#define GET_CARD8(m, f) \ - if (m & mask) \ - { \ - f = (CARD8) *pVlist;\ - pVlist++;\ - } - -#define ChangeMask ((Mask)(CWX | CWY | CWWidth | CWHeight)) - -#define IllegalInputOnlyConfigureMask (CWBorderWidth) - -/* - * IsSiblingAboveMe - * returns Above if pSib above pMe in stack or Below otherwise - */ - -static int -#if NeedFunctionPrototypes -IsSiblingAboveMe( - register WindowPtr pMe, - register WindowPtr pSib) -#else -IsSiblingAboveMe(pMe, pSib) - register WindowPtr pMe, pSib; -#endif -{ - register WindowPtr pWin; - - pWin = pMe->parent->firstChild; - while (pWin) - { - if (pWin == pSib) - return(Above); - else if (pWin == pMe) - return(Below); - pWin = pWin->nextSib; - } - return(Below); -} - -static BoxPtr -#if NeedFunctionPrototypes -WindowExtents( - register WindowPtr pWin, - register BoxPtr pBox) -#else -WindowExtents(pWin, pBox) - register WindowPtr pWin; - register BoxPtr pBox; -#endif -{ - pBox->x1 = pWin->drawable.x - wBorderWidth (pWin); - pBox->y1 = pWin->drawable.y - wBorderWidth (pWin); - pBox->x2 = pWin->drawable.x + (int)pWin->drawable.width - + wBorderWidth (pWin); - pBox->y2 = pWin->drawable.y + (int)pWin->drawable.height - + wBorderWidth (pWin); - return(pBox); -} - -#ifdef SHAPE -#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL) - -static RegionPtr -#if NeedFunctionPrototypes -MakeBoundingRegion ( - register WindowPtr pWin, - BoxPtr pBox) -#else -MakeBoundingRegion (pWin, pBox) - register WindowPtr pWin; - BoxPtr pBox; -#endif -{ - RegionPtr pRgn; - REGION_PTR(pScreen, pWin) - - pRgn = REGION_CREATE(pScreen, pBox, 1); - if (wBoundingShape (pWin)) { - REGION_TRANSLATE(pScreen, pRgn, -pWin->origin.x, - -pWin->origin.y); - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->origin.x, - pWin->origin.y); - } - return pRgn; -} - -static Bool -#if NeedFunctionPrototypes -ShapeOverlap ( - WindowPtr pWin, - BoxPtr pWinBox, - WindowPtr pSib, - BoxPtr pSibBox) -#else -ShapeOverlap (pWin, pWinBox, pSib, pSibBox) - WindowPtr pWin, pSib; - BoxPtr pWinBox, pSibBox; -#endif -{ - RegionPtr pWinRgn, pSibRgn; - register ScreenPtr pScreen; - Bool ret; - - if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib)) - return TRUE; - pScreen = pWin->drawable.pScreen; - pWinRgn = MakeBoundingRegion (pWin, pWinBox); - pSibRgn = MakeBoundingRegion (pSib, pSibBox); - REGION_INTERSECT(pScreen, pWinRgn, pWinRgn, pSibRgn); - ret = REGION_NOTEMPTY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pSibRgn); - return ret; -} -#endif - -static Bool -#if NeedFunctionPrototypes -AnyWindowOverlapsMe( - WindowPtr pWin, - WindowPtr pHead, - register BoxPtr box) -#else -AnyWindowOverlapsMe(pWin, pHead, box) - WindowPtr pWin, pHead; - register BoxPtr box; -#endif -{ - register WindowPtr pSib; - BoxRec sboxrec; - register BoxPtr sbox; - - for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib) - { - if (pSib->mapped) - { - sbox = WindowExtents(pSib, &sboxrec); - if (BOXES_OVERLAP(sbox, box) -#ifdef SHAPE - && ShapeOverlap (pWin, box, pSib, sbox) -#endif - ) - return(TRUE); - } - } - return(FALSE); -} - -static Bool -#if NeedFunctionPrototypes -IOverlapAnyWindow( - WindowPtr pWin, - register BoxPtr box) -#else -IOverlapAnyWindow(pWin, box) - WindowPtr pWin; - register BoxPtr box; -#endif -{ - register WindowPtr pSib; - BoxRec sboxrec; - register BoxPtr sbox; - - for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib) - { - if (pSib->mapped) - { - sbox = WindowExtents(pSib, &sboxrec); - if (BOXES_OVERLAP(sbox, box) -#ifdef SHAPE - && ShapeOverlap (pWin, box, pSib, sbox) -#endif - ) - return(TRUE); - } - } - return(FALSE); -} - -/* - * WhereDoIGoInTheStack() - * Given pWin and pSib and the relationshipe smode, return - * the window that pWin should go ABOVE. - * If a pSib is specified: - * Above: pWin is placed just above pSib - * Below: pWin is placed just below pSib - * TopIf: if pSib occludes pWin, then pWin is placed - * at the top of the stack - * BottomIf: if pWin occludes pSib, then pWin is - * placed at the bottom of the stack - * Opposite: if pSib occludes pWin, then pWin is placed at the - * top of the stack, else if pWin occludes pSib, then - * pWin is placed at the bottom of the stack - * - * If pSib is NULL: - * Above: pWin is placed at the top of the stack - * Below: pWin is placed at the bottom of the stack - * TopIf: if any sibling occludes pWin, then pWin is placed at - * the top of the stack - * BottomIf: if pWin occludes any sibline, then pWin is placed at - * the bottom of the stack - * Opposite: if any sibling occludes pWin, then pWin is placed at - * the top of the stack, else if pWin occludes any - * sibling, then pWin is placed at the bottom of the stack - * - */ - -static WindowPtr -#if NeedFunctionPrototypes -WhereDoIGoInTheStack( - register WindowPtr pWin, - register WindowPtr pSib, - short x, - short y, - unsigned short w, - unsigned short h, - int smode) -#else -WhereDoIGoInTheStack(pWin, pSib, x, y, w, h, smode) - register WindowPtr pWin, pSib; - short x, y; - unsigned short w, h; - int smode; -#endif -{ - BoxRec box; - register ScreenPtr pScreen; - WindowPtr pHead, pFirst; - - if ((pWin == pWin->parent->firstChild) && - (pWin == pWin->parent->lastChild)) - return((WindowPtr ) NULL); - pHead = RealChildHead(pWin->parent); - pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild; - pScreen = pWin->drawable.pScreen; - box.x1 = x; - box.y1 = y; - box.x2 = x + (int)w; - box.y2 = y + (int)h; - switch (smode) - { - case Above: - if (pSib) - return(pSib); - else if (pWin == pFirst) - return(pWin->nextSib); - else - return(pFirst); - case Below: - if (pSib) - if (pSib->nextSib != pWin) - return(pSib->nextSib); - else - return(pWin->nextSib); - else - return NullWindow; - case TopIf: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if ((IsSiblingAboveMe(pWin, pSib) == Above) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) - return(pFirst); - else - return(pWin->nextSib); - } - else if (AnyWindowOverlapsMe(pWin, pHead, &box)) - return(pFirst); - else - return(pWin->nextSib); - case BottomIf: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if ((IsSiblingAboveMe(pWin, pSib) == Below) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) - return NullWindow; - else - return(pWin->nextSib); - } - else if (IOverlapAnyWindow(pWin, &box)) - return NullWindow; - else - return(pWin->nextSib); - case Opposite: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT) - { - if (IsSiblingAboveMe(pWin, pSib) == Above) - return(pFirst); - else - return NullWindow; - } - else - return(pWin->nextSib); - } - else if (AnyWindowOverlapsMe(pWin, pHead, &box)) - { - /* If I'm occluded, I can't possibly be the first child - * if (pWin == pWin->parent->firstChild) - * return pWin->nextSib; - */ - return(pFirst); - } - else if (IOverlapAnyWindow(pWin, &box)) - return NullWindow; - else - return pWin->nextSib; - default: - { - ErrorF("Internal error in ConfigureWindow, smode == %d\n",smode ); - return pWin->nextSib; - } - } -} - -static void -#if NeedFunctionPrototypes -ReflectStackChange( - register WindowPtr pWin, - register WindowPtr pSib, - VTKind kind) -#else -ReflectStackChange(pWin, pSib, kind) - register WindowPtr pWin, pSib; - VTKind kind; -#endif -{ -/* Note that pSib might be NULL */ - - Bool WasViewable = (Bool)pWin->viewable; - WindowPtr pParent; - Bool anyMarked; - WindowPtr pFirstChange; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - ScreenPtr pScreen = pWin->drawable.pScreen; - - /* if this is a root window, can't be restacked */ - if (!(pParent = pWin->parent)) - return ; - - pFirstChange = MoveWindowInStack(pWin, pSib); - - if (WasViewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, - &pLayerWin); - if (pLayerWin != pWin) pFirstChange = pLayerWin; -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, kind); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pWin->drawable.pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange, kind); - } - if (pWin->realized) - WindowsRestructured (); -} - -/***** - * ConfigureWindow - *****/ - -int -ConfigureWindow(pWin, mask, vlist, client) - register WindowPtr pWin; - register Mask mask; - XID *vlist; - ClientPtr client; -{ -#define RESTACK_WIN 0 -#define MOVE_WIN 1 -#define RESIZE_WIN 2 -#define REBORDER_WIN 3 - register WindowPtr pSib = NullWindow; - register WindowPtr pParent = pWin->parent; - Window sibwid = 0; - Mask index2, tmask; - register XID *pVlist; - short x, y, beforeX, beforeY; - unsigned short w = pWin->drawable.width, - h = pWin->drawable.height, - bw = pWin->borderWidth; - int action, smode = Above; -#ifdef XAPPGROUP - ClientPtr win_owner; - ClientPtr ag_leader = NULL; -#endif - xEvent event; - - if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask)) - return(BadMatch); - - if ((mask & CWSibling) && !(mask & CWStackMode)) - return(BadMatch); - - pVlist = vlist; - - if (pParent) - { - x = pWin->drawable.x - pParent->drawable.x - (int)bw; - y = pWin->drawable.y - pParent->drawable.y - (int)bw; - } - else - { - x = pWin->drawable.x; - y = pWin->drawable.y; - } - beforeX = x; - beforeY = y; - action = RESTACK_WIN; - if ((mask & (CWX | CWY)) && (!(mask & (CWHeight | CWWidth)))) - { - GET_INT16(CWX, x); - GET_INT16(CWY, y); - action = MOVE_WIN; - } - /* or should be resized */ - else if (mask & (CWX | CWY | CWWidth | CWHeight)) - { - GET_INT16(CWX, x); - GET_INT16(CWY, y); - GET_CARD16(CWWidth, w); - GET_CARD16 (CWHeight, h); - if (!w || !h) - { - client->errorValue = 0; - return BadValue; - } - action = RESIZE_WIN; - } - tmask = mask & ~ChangeMask; - while (tmask) - { - index2 = (Mask)lowbit (tmask); - tmask &= ~index2; - switch (index2) - { - case CWBorderWidth: - GET_CARD16(CWBorderWidth, bw); - break; - case CWSibling: - sibwid = (Window ) *pVlist; - pVlist++; - pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid, - RT_WINDOW, SecurityReadAccess); - if (!pSib) - { - client->errorValue = sibwid; - return(BadWindow); - } - if (pSib->parent != pParent) - return(BadMatch); - if (pSib == pWin) - return(BadMatch); - break; - case CWStackMode: - GET_CARD8(CWStackMode, smode); - if ((smode != TopIf) && (smode != BottomIf) && - (smode != Opposite) && (smode != Above) && (smode != Below)) - { - client->errorValue = smode; - return(BadValue); - } - break; - default: - client->errorValue = mask; - return(BadValue); - } - } - /* root really can't be reconfigured, so just return */ - if (!pParent) - return Success; - - /* Figure out if the window should be moved. Doesnt - make the changes to the window if event sent */ - - #ifdef TEST - if (nxagentWindowTopLevel(pWin)) - { - - fprintf(stderr, "ConfigureWindow: pWin [%p] mask [%lu] client [%p]\n", - pWin, mask, client); - - fprintf(stderr, "ConfigureWindow: x [%d] y [%d] w [%d] h [%d] CWStackMode [%d] " - "smode [%d] pSib [%p]\n", - x, y, w, h, (mask & CWStackMode) ? 1 : 0, smode, pSib); - } - #endif - - if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) && - pWin -> overrideRedirect == 0 && - nxagentScreenTrap == 0) - { - nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask); - - return Success; - } - - if (mask & CWStackMode) - pSib = WhereDoIGoInTheStack(pWin, pSib, pParent->drawable.x + x, - pParent->drawable.y + y, - w + (bw << 1), h + (bw << 1), smode); - else - pSib = pWin->nextSib; - -#ifdef XAPPGROUP - win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - ag_leader = XagLeader (win_owner); -#endif - - if ((!pWin->overrideRedirect) && - (RedirectSend(pParent) -#ifdef XAPPGROUP - || (win_owner->appgroup && ag_leader && - XagIsControlledRoot (client, pParent)) -#endif - )) - { - event.u.u.type = ConfigureRequest; - event.u.configureRequest.window = pWin->drawable.id; - if (mask & CWSibling) - event.u.configureRequest.sibling = sibwid; - else - event.u.configureRequest.sibling = None; - if (mask & CWStackMode) - event.u.u.detail = smode; - else - event.u.u.detail = Above; - event.u.configureRequest.x = x; - event.u.configureRequest.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureRequest.x += panoramiXdataPtr[0].x; - event.u.configureRequest.y += panoramiXdataPtr[0].y; - } -#endif - event.u.configureRequest.width = w; - event.u.configureRequest.height = h; - event.u.configureRequest.borderWidth = bw; - event.u.configureRequest.valueMask = mask; -#ifdef XAPPGROUP - /* make sure if the ag_leader maps the window it goes to the wm */ - if (ag_leader && ag_leader != client && - XagIsControlledRoot (client, pParent)) { - event.u.configureRequest.parent = XagId (win_owner); - (void) TryClientEvents (ag_leader, &event, 1, - NoEventMask, NoEventMask, NullGrab); - return Success; - } -#endif - event.u.configureRequest.parent = pParent->drawable.id; - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - if (action == RESIZE_WIN) - { - Bool size_change = (w != pWin->drawable.width) - || (h != pWin->drawable.height); - if (size_change && ((pWin->eventMask|wOtherEventMasks(pWin)) & ResizeRedirectMask)) - { - xEvent eventT; - eventT.u.u.type = ResizeRequest; - eventT.u.resizeRequest.window = pWin->drawable.id; - eventT.u.resizeRequest.width = w; - eventT.u.resizeRequest.height = h; - if (MaybeDeliverEventsToClient(pWin, &eventT, 1, - ResizeRedirectMask, client) == 1) - { - /* if event is delivered, leave the actual size alone. */ - w = pWin->drawable.width; - h = pWin->drawable.height; - size_change = FALSE; - } - } - if (!size_change) - { - if (mask & (CWX | CWY)) - action = MOVE_WIN; - else if (mask & (CWStackMode | CWBorderWidth)) - action = RESTACK_WIN; - else /* really nothing to do */ - return(Success) ; - } - } - - if (action == RESIZE_WIN) - /* we've already checked whether there's really a size change */ - goto ActuallyDoSomething; - if ((mask & CWX) && (x != beforeX)) - goto ActuallyDoSomething; - if ((mask & CWY) && (y != beforeY)) - goto ActuallyDoSomething; - if ((mask & CWBorderWidth) && (bw != wBorderWidth (pWin))) - goto ActuallyDoSomething; - if (mask & CWStackMode) - { - if (pWin->nextSib != pSib) - goto ActuallyDoSomething; - } - return(Success); - -ActuallyDoSomething: - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - if (pSib) - event.u.configureNotify.aboveSibling = pSib->drawable.id; - else - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = x; - event.u.configureNotify.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureNotify.x += panoramiXdataPtr[0].x; - event.u.configureNotify.y += panoramiXdataPtr[0].y; - } -#endif - event.u.configureNotify.width = w; - event.u.configureNotify.height = h; - event.u.configureNotify.borderWidth = bw; - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - if (mask & CWBorderWidth) - { - if (action == RESTACK_WIN) - { - action = MOVE_WIN; - pWin->borderWidth = bw; - } - else if ((action == MOVE_WIN) && - (beforeX + wBorderWidth (pWin) == x + (int)bw) && - (beforeY + wBorderWidth (pWin) == y + (int)bw)) - { - action = REBORDER_WIN; - (*pWin->drawable.pScreen->ChangeBorderWidth)(pWin, bw); - } - else - pWin->borderWidth = bw; - } - if (action == MOVE_WIN) - (*pWin->drawable.pScreen->MoveWindow)(pWin, x, y, pSib, - (mask & CWBorderWidth) ? VTOther : VTMove); - else if (action == RESIZE_WIN) - (*pWin->drawable.pScreen->ResizeWindow)(pWin, x, y, w, h, pSib); - else if (mask & CWStackMode) - ReflectStackChange(pWin, pSib, VTOther); - - if (action != RESTACK_WIN) - CheckCursorConfinement(pWin); - - nxagentFlushConfigureWindow(); - - return(Success); -#undef RESTACK_WIN -#undef MOVE_WIN -#undef RESIZE_WIN -#undef REBORDER_WIN -} - - -/****** - * - * CirculateWindow - * For RaiseLowest, raises the lowest mapped child (if any) that is - * obscured by another child to the top of the stack. For LowerHighest, - * lowers the highest mapped child (if any) that is obscuring another - * child to the bottom of the stack. Exposure processing is performed - * - ******/ - -int -CirculateWindow(pParent, direction, client) - WindowPtr pParent; - int direction; - ClientPtr client; -{ - register WindowPtr pWin, pHead, pFirst; - xEvent event; - BoxRec box; - - #ifdef TEST - fprintf(stderr, "CirculateWindow: pParent [%p] direction [%d] client [%p]\n", - pParent, direction, client); - #endif - - /* - * if (nxagentOption(Rootless) && nxagentWMIsRunning && - * nxagentWindowTopLevel(pWin) && pWin -> overrideRedirect == 0) - * { - * nxagentCirculateRootlessWindows(direction); - * return Success; - * } - */ - - pHead = RealChildHead(pParent); - pFirst = pHead ? pHead->nextSib : pParent->firstChild; - if (direction == RaiseLowest) - { - for (pWin = pParent->lastChild; - (pWin != pHead) && - !(pWin->mapped && - AnyWindowOverlapsMe(pWin, pHead, WindowExtents(pWin, &box))); - pWin = pWin->prevSib) ; - if (pWin == pHead) - return Success; - } - else - { - for (pWin = pFirst; - pWin && - !(pWin->mapped && - IOverlapAnyWindow(pWin, WindowExtents(pWin, &box))); - pWin = pWin->nextSib) ; - if (!pWin) - return Success; - } - - event.u.circulate.window = pWin->drawable.id; - event.u.circulate.parent = pParent->drawable.id; - event.u.circulate.event = pParent->drawable.id; - if (direction == RaiseLowest) - event.u.circulate.place = PlaceOnTop; - else - event.u.circulate.place = PlaceOnBottom; - - if (RedirectSend(pParent)) - { - event.u.u.type = CirculateRequest; - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - - event.u.u.type = CirculateNotify; - DeliverEvents(pWin, &event, 1, NullWindow); - ReflectStackChange(pWin, - (direction == RaiseLowest) ? pFirst : NullWindow, - VTStack); - - return(Success); -} - -static int -#if NeedFunctionPrototypes -CompareWIDs( - WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ -#else -CompareWIDs(pWin, value) - WindowPtr pWin; - pointer value; /* must conform to VisitWindowProcPtr */ -#endif -{ - Window *wid = (Window *)value; - - if (pWin->drawable.id == *wid) - return(WT_STOPWALKING); - else - return(WT_WALKCHILDREN); -} - -/***** - * ReparentWindow - *****/ - -int -ReparentWindow(pWin, pParent, x, y, client) - register WindowPtr pWin, pParent; - int x,y; - ClientPtr client; -{ - WindowPtr pPrev, pPriorParent; - Bool WasMapped = (Bool)(pWin->mapped); - xEvent event; - int bw = wBorderWidth (pWin); - register ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; - if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING) - return(BadMatch); - if (!MakeWindowOptional(pWin)) - return(BadAlloc); - - if (WasMapped) - UnmapWindow(pWin, FALSE); - - event.u.u.type = ReparentNotify; - event.u.reparent.window = pWin->drawable.id; - event.u.reparent.parent = pParent->drawable.id; - event.u.reparent.x = x; - event.u.reparent.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pParent->parent) { - event.u.reparent.x += panoramiXdataPtr[0].x; - event.u.reparent.y += panoramiXdataPtr[0].y; - } -#endif - event.u.reparent.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, pParent); - - /* take out of sibling chain */ - - pPriorParent = pPrev = pWin->parent; - if (pPrev->firstChild == pWin) - pPrev->firstChild = pWin->nextSib; - if (pPrev->lastChild == pWin) - pPrev->lastChild = pWin->prevSib; - - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - - /* insert at begining of pParent */ - pWin->parent = pParent; - pPrev = RealChildHead(pParent); - - if (pWin->parent == WindowTable[0]) - { - nxagentSetTopLevelEventMask(pWin); - } - - if (pPrev) - { - pWin->nextSib = pPrev->nextSib; - if (pPrev->nextSib) - pPrev->nextSib->prevSib = pWin; - else - pParent->lastChild = pWin; - pPrev->nextSib = pWin; - pWin->prevSib = pPrev; - } - else - { - pWin->nextSib = pParent->firstChild; - pWin->prevSib = NullWindow; - if (pParent->firstChild) - pParent->firstChild->prevSib = pWin; - else - pParent->lastChild = pWin; - pParent->firstChild = pWin; - } - - pWin->origin.x = x + bw; - pWin->origin.y = y + bw; - pWin->drawable.x = x + bw + pParent->drawable.x; - pWin->drawable.y = y + bw + pParent->drawable.y; - - /* clip to parent */ - SetWinSize (pWin); - SetBorderSize (pWin); - - if (pScreen->ReparentWindow) - (*pScreen->ReparentWindow)(pWin, pPriorParent); - - (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y); - - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - CheckWindowOptionalNeed(pWin); - - if (WasMapped) - MapWindow(pWin, client); - RecalculateDeliverableEvents(pWin); - return(Success); -} - -static void -#if NeedFunctionPrototypes -RealizeTree(WindowPtr pWin) -#else -RealizeTree(pWin) - WindowPtr pWin; -#endif -{ - register WindowPtr pChild; - RealizeWindowProcPtr Realize; - - Realize = pWin->drawable.pScreen->RealizeWindow; - pChild = pWin; - while (1) - { - if (pChild->mapped) - { - pChild->realized = TRUE; -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder) - deltaSaveUndersViewable++; -#endif - pChild->viewable = (pChild->drawable.class == InputOutput); - (* Realize)(pChild); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - return; - pChild = pChild->nextSib; - } -} - -/***** - * MapWindow - * If some other client has selected SubStructureReDirect on the parent - * and override-redirect is xFalse, then a MapRequest event is generated, - * but the window remains unmapped. Otherwise, the window is mapped and a - * MapNotify event is generated. - *****/ - -int -MapWindow(pWin, client) - register WindowPtr pWin; - ClientPtr client; -{ - register ScreenPtr pScreen; - - register WindowPtr pParent; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - #ifdef TEST - if (nxagentWindowTopLevel(pWin)) - { - fprintf(stderr, "MapWindow: pWin [%p] client [%p]\n", pWin, client); - } - #endif - - if (pWin->mapped) - return(Success); - -#ifdef XCSECURITY - /* don't let an untrusted client map a child-of-trusted-window, InputOnly - * window; too easy to steal device input - */ - if ( (client->trustLevel != XSecurityClientTrusted) && - (pWin->drawable.class == InputOnly) && - (wClient(pWin->parent)->trustLevel == XSecurityClientTrusted) ) - return Success; -#endif - - pScreen = pWin->drawable.pScreen; - if ( (pParent = pWin->parent) ) - { - xEvent event; - Bool anyMarked; -#ifdef XAPPGROUP - ClientPtr win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - ClientPtr ag_leader = XagLeader (win_owner); -#endif - - if ((!pWin->overrideRedirect) && - (RedirectSend(pParent) -#ifdef XAPPGROUP - || (win_owner->appgroup && ag_leader && - XagIsControlledRoot (client, pParent)) -#endif - )) - { - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; -#ifdef XAPPGROUP - /* make sure if the ag_leader maps the window it goes to the wm */ - if (ag_leader && ag_leader != client && - XagIsControlledRoot (client, pParent)) { - event.u.mapRequest.parent = XagId (win_owner); - (void) TryClientEvents (ag_leader, &event, 1, - NoEventMask, NoEventMask, NullGrab); - return Success; - } -#endif - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - - pWin->mapped = TRUE; - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - if (!pParent->realized) - return(Success); - RealizeTree(pWin); - if (pWin->viewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTMap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, VTMap); - } - WindowsRestructured (); - } - else - { - RegionRec temp; - - pWin->mapped = TRUE; - pWin->realized = TRUE; /* for roots */ - pWin->viewable = pWin->drawable.class == InputOutput; - /* We SHOULD check for an error value here XXX */ - (*pScreen->RealizeWindow)(pWin); - if (pScreen->ClipNotify) - (*pScreen->ClipNotify) (pWin, 0, 0); - if (pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(NullWindow, pWin, VTMap); - REGION_INIT(pScreen, &temp, NullBox, 0); - REGION_COPY(pScreen, &temp, &pWin->clipList); - (*pScreen->WindowExposures) (pWin, &temp, NullRegion); - REGION_UNINIT(pScreen, &temp); - } - - nxagentFlushConfigureWindow(); - - return(Success); -} - - -/***** - * MapSubwindows - * Performs a MapWindow all unmapped children of the window, in top - * to bottom stacking order. - *****/ - -void -MapSubwindows(pParent, client) - register WindowPtr pParent; - ClientPtr client; -{ - register WindowPtr pWin; - WindowPtr pFirstMapped = NullWindow; -#ifdef DO_SAVE_UNDERS - WindowPtr pFirstSaveUndered = NullWindow; -#endif - register ScreenPtr pScreen; - register Mask parentRedirect; - register Mask parentNotify; - xEvent event; - Bool anyMarked; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - pScreen = pParent->drawable.pScreen; - parentRedirect = RedirectSend(pParent); - parentNotify = SubSend(pParent); - anyMarked = FALSE; - for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) - { - if (!pWin->mapped) - { - if (parentRedirect && !pWin->overrideRedirect) - { - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - continue; - } - - pWin->mapped = TRUE; - if (parentNotify || StrSend(pWin)) - { - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - if (!pFirstMapped) - pFirstMapped = pWin; - if (pParent->realized) - { - RealizeTree(pWin); - if (pWin->viewable) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - (WindowPtr *)NULL); -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = TRUE; - } -#endif /* DO_SAVE_UNDERS */ - } - } - } - } - - if (pFirstMapped) - { - pLayerWin = (*pScreen->GetLayerWindow)(pParent); - if (pLayerWin->parent != pParent) { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pLayerWin, - pLayerWin, - (WindowPtr *)NULL); - pFirstMapped = pLayerWin; - } - if (anyMarked) - { -#ifdef DO_SAVE_UNDERS - if (pLayerWin->parent != pParent) - { - if (dosave || (DO_SAVE_UNDERS(pLayerWin))) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, - pLayerWin); - } - } - else if (dosave) - { - dosave = FALSE; - for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) - { - if (DO_SAVE_UNDERS(pWin)) - { - dosave |= (*pScreen->ChangeSaveUnder)(pWin, - pWin->nextSib); - if (dosave && !pFirstSaveUndered) - pFirstSaveUndered = pWin; - } - } - } -#endif /* DO_SAVE_UNDERS */ - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstMapped, VTMap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, - pFirstSaveUndered->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstMapped, - VTMap); - WindowsRestructured (); - } -} - -static void -#if NeedFunctionPrototypes -UnrealizeTree( - WindowPtr pWin, - Bool fromConfigure) -#else -UnrealizeTree(pWin, fromConfigure) - WindowPtr pWin; - Bool fromConfigure; -#endif -{ - register WindowPtr pChild; - UnrealizeWindowProcPtr Unrealize; - MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; - - Unrealize = pWin->drawable.pScreen->UnrealizeWindow; - MarkUnrealizedWindow = pWin->drawable.pScreen->MarkUnrealizedWindow; - pChild = pWin; - while (1) - { - if (pChild->realized) - { - pChild->realized = FALSE; - pChild->visibility = VisibilityNotViewable; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) { - PanoramiXRes *win; - win = (PanoramiXRes*)LookupIDByType(pChild->drawable.id, - XRT_WINDOW); - if(win) - win->u.win.visibility = VisibilityNotViewable; - } -#endif - (* Unrealize)(pChild); - DeleteWindowFromAnyEvents(pChild, FALSE); - if (pChild->viewable) - { -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder) - deltaSaveUndersViewable--; -#endif - pChild->viewable = FALSE; - if (pChild->backStorage) - (*pChild->drawable.pScreen->SaveDoomedAreas)( - pChild, &pChild->clipList, 0, 0); - (* MarkUnrealizedWindow)(pChild, pWin, fromConfigure); - pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - return; - pChild = pChild->nextSib; - } -} - -/***** - * UnmapWindow - * If the window is already unmapped, this request has no effect. - * Otherwise, the window is unmapped and an UnMapNotify event is - * generated. Cannot unmap a root window. - *****/ - -int -UnmapWindow(pWin, fromConfigure) - register WindowPtr pWin; - Bool fromConfigure; -{ - register WindowPtr pParent; - xEvent event; - Bool wasRealized = (Bool)pWin->realized; - Bool wasViewable = (Bool)pWin->viewable; - ScreenPtr pScreen = pWin->drawable.pScreen; - WindowPtr pLayerWin = pWin; - - #ifdef TEST - if (nxagentWindowTopLevel(pWin)) - { - fprintf(stderr, "UnmapWindow: pWin [%p] fromConfigure [%d]\n", pWin, - fromConfigure); - } - #endif - - if ((!pWin->mapped) || (!(pParent = pWin->parent))) - return(Success); - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pWin->drawable.id; - event.u.unmapNotify.fromConfigure = fromConfigure; - DeliverEvents(pWin, &event, 1, NullWindow); - } - if (wasViewable && !fromConfigure) - { - pWin->valdata = UnmapValData; - (*pScreen->MarkOverlappedWindows)(pWin, pWin->nextSib, &pLayerWin); - (*pScreen->MarkWindow)(pLayerWin->parent); - } - pWin->mapped = FALSE; - if (wasRealized) - UnrealizeTree(pWin, fromConfigure); - if (wasViewable) - { - if (!fromConfigure) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pWin, VTUnmap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib) ) - { - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); - } - } - pWin->DIXsaveUnder = FALSE; -#endif /* DO_SAVE_UNDERS */ - if (!fromConfigure && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pWin, VTUnmap); - } - if (wasRealized && !fromConfigure) - WindowsRestructured (); - return(Success); -} - -/***** - * UnmapSubwindows - * Performs an UnmapWindow request with the specified mode on all mapped - * children of the window, in bottom to top stacking order. - *****/ - -void -UnmapSubwindows(pWin) - register WindowPtr pWin; -{ - register WindowPtr pChild, pHead; - xEvent event; - Bool wasRealized = (Bool)pWin->realized; - Bool wasViewable = (Bool)pWin->viewable; - Bool anyMarked = FALSE; - Mask parentNotify; - WindowPtr pLayerWin = NULL; - ScreenPtr pScreen = pWin->drawable.pScreen; - - if (!pWin->firstChild) - return; - parentNotify = SubSend(pWin); - pHead = RealChildHead(pWin); - - if (wasViewable) - pLayerWin = (*pScreen->GetLayerWindow)(pWin); - - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - { - if (pChild->mapped) - { - if (parentNotify || StrSend(pChild)) - { - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pChild->drawable.id; - event.u.unmapNotify.fromConfigure = xFalse; - DeliverEvents(pChild, &event, 1, NullWindow); - } - if (pChild->viewable) - { - pChild->valdata = UnmapValData; - anyMarked = TRUE; - } - pChild->mapped = FALSE; - if (pChild->realized) - UnrealizeTree(pChild, FALSE); - if (wasViewable) - { -#ifdef DO_SAVE_UNDERS - pChild->DIXsaveUnder = FALSE; -#endif /* DO_SAVE_UNDERS */ - if (pChild->backStorage) - (*pScreen->SaveDoomedAreas)( - pChild, &pChild->clipList, 0, 0); - } - } - } - if (wasViewable) - { - if (anyMarked) - { - if (pLayerWin->parent == pWin) - (*pScreen->MarkWindow)(pWin); - else - { - WindowPtr ptmp; - (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin, - (WindowPtr *)NULL); - (*pScreen->MarkWindow)(pLayerWin->parent); - - /* Windows between pWin and pLayerWin may not have been marked */ - ptmp = pWin; - - while (ptmp != pLayerWin->parent) - { - (*pScreen->MarkWindow)(ptmp); - ptmp = ptmp->parent; - } - pHead = pWin->firstChild; - } - (*pScreen->ValidateTree)(pLayerWin->parent, pHead, VTUnmap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin)) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pHead, VTUnmap); - } - if (wasRealized) - WindowsRestructured (); -} - - -void -HandleSaveSet(client) - register ClientPtr client; -{ - register WindowPtr pParent, pWin; - register int j; - - for (j=0; jnumSaved; j++) - { - pWin = (WindowPtr)client->saveSet[j]; - pParent = pWin->parent; - while (pParent && (wClient (pParent) == client)) - pParent = pParent->parent; - if (pParent) - { - if (pParent != pWin->parent) - { - ReparentWindow(pWin, pParent, - pWin->drawable.x - wBorderWidth (pWin) - pParent->drawable.x, - pWin->drawable.y - wBorderWidth (pWin) - pParent->drawable.y, - client); - if(!pWin->realized && pWin->mapped) - pWin->mapped = FALSE; - } - MapWindow(pWin, client); - } - } - xfree(client->saveSet); - client->numSaved = 0; - client->saveSet = (pointer *)NULL; -} - -Bool -VisibleBoundingBoxFromPoint(pWin, x, y, box) - register WindowPtr pWin; - int x, y; /* in root */ - BoxPtr box; /* "return" value */ -{ - if (!pWin->realized) - return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box)) - return(TRUE); - return(FALSE); -} - -Bool -PointInWindowIsVisible(pWin, x, y) - register WindowPtr pWin; - int x, y; /* in root */ -{ - BoxRec box; - - if (!pWin->realized) - return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip, - x, y, &box)) - return(TRUE); - return(FALSE); -} - - -RegionPtr -NotClippedByChildren(pWin) - register WindowPtr pWin; -{ - register ScreenPtr pScreen; - RegionPtr pReg; - - pScreen = pWin->drawable.pScreen; - pReg = REGION_CREATE(pScreen, NullBox, 1); - if (pWin->parent || - screenIsSaved != SCREEN_SAVER_ON || - !HasSaverWindow (pWin->drawable.pScreen->myNum)) - { - REGION_INTERSECT(pScreen, pReg, &pWin->borderClip, &pWin->winSize); - } - return(pReg); -} - -void -SendVisibilityNotify(pWin) - WindowPtr pWin; -{ - xEvent event; - unsigned int visibility = pWin->visibility; - -#ifdef PANORAMIX - /* This is not quite correct yet, but it's close */ - if(!noPanoramiXExtension) { - PanoramiXRes *win; - WindowPtr pWin2; - int i, Scrnum; - - Scrnum = pWin->drawable.pScreen->myNum; - - win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, Scrnum); - - if(!win || (win->u.win.visibility == visibility)) - return; - - switch(visibility) { - case VisibilityUnobscured: - for(i = 0; i < PanoramiXNumScreens; i++) { - if(i == Scrnum) continue; - - pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); - - if (pWin2) { - if(pWin2->visibility == VisibilityPartiallyObscured) - return; - - if(!i) pWin = pWin2; - } - } - break; - case VisibilityPartiallyObscured: - if(Scrnum) { - pWin2 = (WindowPtr)LookupIDByType(win->info[0].id, RT_WINDOW); - if (pWin2) pWin = pWin2; - } - break; - case VisibilityFullyObscured: - for(i = 0; i < PanoramiXNumScreens; i++) { - if(i == Scrnum) continue; - - pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); - - if (pWin2) { - if(pWin2->visibility != VisibilityFullyObscured) - return; - - if(!i) pWin = pWin2; - } - } - break; - } - - win->u.win.visibility = visibility; - } -#endif - - event.u.u.type = VisibilityNotify; - event.u.visibility.window = pWin->drawable.id; - event.u.visibility.state = visibility; - DeliverEvents(pWin, &event, 1, NullWindow); -} - - -#define RANDOM_WIDTH 32 - -#ifndef NOLOGOHACK -static void DrawLogo( -#if NeedFunctionPrototypes - WindowPtr /*pWin*/ -#endif -); -#endif - -void -SaveScreens(on, mode) - int on; - int mode; -{ - int i; - int what; - int type; - - if (on == SCREEN_SAVER_FORCER) - { - UpdateCurrentTimeIf(); - lastDeviceEventTime = currentTime; - if (mode == ScreenSaverReset) - what = SCREEN_SAVER_OFF; - else - what = SCREEN_SAVER_ON; - type = what; - } - else - { - what = on; - type = what; - if (what == screenIsSaved) - type = SCREEN_SAVER_CYCLE; - } - for (i = 0; i < screenInfo.numScreens; i++) - { - if (on == SCREEN_SAVER_FORCER) - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], on); - if (savedScreenInfo[i].ExternalScreenSaver) - { - if (nxagentOption(Timeout) != 0) - { - #ifdef TEST - fprintf(stderr, "SaveScreens: An external screen-saver handler is installed. " - "Ignoring it to let the auto-disconnect feature work.\n"); - #endif - } - else - { - if ((*savedScreenInfo[i].ExternalScreenSaver) - (screenInfo.screens[i], type, on == SCREEN_SAVER_FORCER)) - continue; - } - } - if (type == screenIsSaved) - continue; - switch (type) { - case SCREEN_SAVER_OFF: - if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED) - { - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], - what); - } - else if (HasSaverWindow (i)) - { - savedScreenInfo[i].pWindow = NullWindow; - FreeResource(savedScreenInfo[i].wid, RT_NONE); - } - break; - case SCREEN_SAVER_CYCLE: - if (savedScreenInfo[i].blanked == SCREEN_IS_TILED) - { - WindowPtr pWin = savedScreenInfo[i].pWindow; - /* make it look like screen saver is off, so that - * NotClippedByChildren will compute a clip list - * for the root window, so miPaintWindow works - */ - screenIsSaved = SCREEN_SAVER_OFF; -#ifndef NOLOGOHACK - if (logoScreenSaver) - (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, FALSE); -#endif - (*pWin->drawable.pScreen->MoveWindow)(pWin, - (short)(-(rand() % RANDOM_WIDTH)), - (short)(-(rand() % RANDOM_WIDTH)), - pWin->nextSib, VTMove); -#ifndef NOLOGOHACK - if (logoScreenSaver) - DrawLogo(pWin); -#endif - screenIsSaved = SCREEN_SAVER_ON; - } - /* - * Call the DDX saver in case it wants to do something - * at cycle time - */ - else if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED) - { - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], - type); - } - break; - case SCREEN_SAVER_ON: - if (ScreenSaverBlanking != DontPreferBlanking) - { - if ((* screenInfo.screens[i]->SaveScreen) - (screenInfo.screens[i], what)) - { - savedScreenInfo[i].blanked = SCREEN_IS_BLANKED; - continue; - } - if ((ScreenSaverAllowExposures != DontAllowExposures) && - TileScreenSaver(i, SCREEN_IS_BLACK)) - { - savedScreenInfo[i].blanked = SCREEN_IS_BLACK; - continue; - } - } - if ((ScreenSaverAllowExposures != DontAllowExposures) && - TileScreenSaver(i, SCREEN_IS_TILED)) - { - savedScreenInfo[i].blanked = SCREEN_IS_TILED; - } - else - savedScreenInfo[i].blanked = SCREEN_ISNT_SAVED; - break; - } - } - screenIsSaved = what; -} - -static Bool -#if NeedFunctionPrototypes -TileScreenSaver(int i, int kind) -#else -TileScreenSaver(i, kind) - int i; - int kind; -#endif -{ - int j; - int result; - XID attributes[3]; - Mask mask; - WindowPtr pWin; - CursorMetricRec cm; - unsigned char *srcbits, *mskbits; - CursorPtr cursor; - XID cursorID = 0; - int attri; - - mask = 0; - attri = 0; - switch (kind) { - case SCREEN_IS_TILED: - switch (WindowTable[i]->backgroundState) { - case BackgroundPixel: - attributes[attri++] = WindowTable[i]->background.pixel; - mask |= CWBackPixel; - break; - case BackgroundPixmap: - attributes[attri++] = None; - mask |= CWBackPixmap; - break; - default: - break; - } - break; - case SCREEN_IS_BLACK: - attributes[attri++] = WindowTable[i]->drawable.pScreen->blackPixel; - mask |= CWBackPixel; - break; - } - mask |= CWOverrideRedirect; - attributes[attri++] = xTrue; - - /* - * create a blank cursor - */ - - cm.width=16; - cm.height=16; - cm.xhot=8; - cm.yhot=8; - srcbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); - mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); - if (!srcbits || !mskbits) - { - xfree(srcbits); - xfree(mskbits); - cursor = 0; - } - else - { - for (j=0; jwidth + RANDOM_WIDTH, - (unsigned short)screenInfo.screens[i]->height + RANDOM_WIDTH, - 0, InputOutput, mask, attributes, 0, serverClient, - wVisual (WindowTable[i]), &result); - - if (cursor) - FreeResource (cursorID, RT_NONE); - - if (!pWin) - return FALSE; - - if (!AddResource(pWin->drawable.id, RT_WINDOW, - (pointer)savedScreenInfo[i].pWindow)) - return FALSE; - - if (mask & CWBackPixmap) - { - MakeRootTile (pWin); - (*pWin->drawable.pScreen->ChangeWindowAttributes)(pWin, CWBackPixmap); - } - MapWindow(pWin, serverClient); -#ifndef NOLOGOHACK - if (kind == SCREEN_IS_TILED && logoScreenSaver) - DrawLogo(pWin); -#endif - return TRUE; -} - -/* - * FindWindowWithOptional - * - * search ancestors of the given window for an entry containing - * a WindowOpt structure. Assumptions: some parent will - * contain the structure. - */ - -WindowPtr -FindWindowWithOptional (w) - register WindowPtr w; -{ - do - w = w->parent; - while (!w->optional); - return w; -} - -/* - * CheckWindowOptionalNeed - * - * check each optional entry in the given window to see if - * the value is satisfied by the default rules. If so, - * release the optional record - */ - -void -CheckWindowOptionalNeed (w) - register WindowPtr w; -{ - register WindowOptPtr optional; - register WindowOptPtr parentOptional; - - if (!w->parent) - return; - optional = w->optional; - if (optional->dontPropagateMask != DontPropagateMasks[w->dontPropagate]) - return; - if (optional->otherEventMasks != 0) - return; - if (optional->otherClients != NULL) - return; - if (optional->passiveGrabs != NULL) - return; - if (optional->userProps != NULL) - return; - if (optional->backingBitPlanes != ~0L) - return; - if (optional->backingPixel != 0) - return; -#ifdef SHAPE - if (optional->boundingShape != NULL) - return; - if (optional->clipShape != NULL) - return; -#endif -#ifdef XINPUT - if (optional->inputMasks != NULL) - return; -#endif - parentOptional = FindWindowWithOptional(w)->optional; - if (optional->visual != parentOptional->visual) - return; - if (optional->cursor != None && - (optional->cursor != parentOptional->cursor || - w->parent->cursorIsNone)) - return; - if (optional->colormap != parentOptional->colormap) - return; - DisposeWindowOptional (w); -} - -/* - * MakeWindowOptional - * - * create an optional record and initialize it with the default - * values. - */ - -Bool -MakeWindowOptional (pWin) - register WindowPtr pWin; -{ - register WindowOptPtr optional; - register WindowOptPtr parentOptional; - - if (pWin->optional) - return TRUE; - optional = (WindowOptPtr) xalloc (sizeof (WindowOptRec)); - if (!optional) - return FALSE; - optional->dontPropagateMask = DontPropagateMasks[pWin->dontPropagate]; - optional->otherEventMasks = 0; - optional->otherClients = NULL; - optional->passiveGrabs = NULL; - optional->userProps = NULL; - optional->backingBitPlanes = ~0L; - optional->backingPixel = 0; -#ifdef SHAPE - optional->boundingShape = NULL; - optional->clipShape = NULL; -#endif -#ifdef XINPUT - optional->inputMasks = NULL; -#endif - parentOptional = FindWindowWithOptional(pWin)->optional; - optional->visual = parentOptional->visual; - if (!pWin->cursorIsNone) - { - optional->cursor = parentOptional->cursor; - optional->cursor->refcnt++; - } - else - { - optional->cursor = None; - } - optional->colormap = parentOptional->colormap; - pWin->optional = optional; - return TRUE; -} - -void -DisposeWindowOptional (pWin) - register WindowPtr pWin; -{ - if (!pWin->optional) - return; - /* - * everything is peachy. Delete the optional record - * and clean up - */ - /* - * TOG changed this code to: - * - * if (pWin->cursorIsNone == FALSE) - * FreeCursor (pWin->optional->cursor, (Cursor)0); - * pWin->cursorIsNone = TRUE; - * - * This is blatently wrong; windows without optionals can have - * two different cursor values, either None or sharing their - * parents cursor. This difference is controlled by the - * cursorIsNone value; when TRUE, the window has no cursor, - * when false, it shares its cursor with its parent; TOG - * made it impossible for a window to have a cursor without - * an optional record. - */ - if (pWin->optional->cursor) - { - FreeCursor (pWin->optional->cursor, (Cursor)0); - pWin->cursorIsNone = FALSE; - } - else - pWin->cursorIsNone = TRUE; -/* FIXME - There is an error when disposing ClientResources on Agent exit - this xfree is not valid in some window at exit -*/ - - xfree (pWin->optional); - pWin->optional = NULL; -} - -#ifndef NOLOGOHACK -static void -#if NeedFunctionPrototypes -DrawLogo(WindowPtr pWin) -#else -DrawLogo(pWin) - WindowPtr pWin; -#endif -{ - DrawablePtr pDraw; - ScreenPtr pScreen; - int x, y; - unsigned int width, height, size; - GC *pGC; - int thin, gap, d31; - DDXPointRec poly[4]; - ChangeGCVal fore[2], back[2]; - xrgb rgb[2]; - BITS32 fmask, bmask; - ColormapPtr cmap; - - pDraw = (DrawablePtr)pWin; - pScreen = pDraw->pScreen; - x = -pWin->origin.x; - y = -pWin->origin.y; - width = pScreen->width; - height = pScreen->height; - pGC = GetScratchGC(pScreen->rootDepth, pScreen); - if (!pGC) - return; - - if ((rand() % 100) <= 17) /* make the probability for white fairly low */ - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; - if ((pWin->backgroundState == BackgroundPixel) && - (cmap = (ColormapPtr)LookupIDByType(wColormap (pWin), RT_COLORMAP))) { - Pixel querypixels[2]; - - querypixels[0] = fore[0].val; - querypixels[1] = pWin->background.pixel; - QueryColors(cmap, 2, querypixels, rgb); - if ((rgb[0].red == rgb[1].red) && - (rgb[0].green == rgb[1].green) && - (rgb[0].blue == rgb[1].blue)) { - if (fore[0].val == pScreen->blackPixel) - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; - } - } - fore[1].val = FillSolid; - fmask = GCForeground|GCFillStyle; - if (pWin->backgroundState == BackgroundPixel) { - back[0].val = pWin->background.pixel; - back[1].val = FillSolid; - bmask = GCForeground|GCFillStyle; - } else { - back[0].val = 0; - back[1].val = 0; - dixChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, - NULL, back); - back[0].val = FillTiled; - back[1].ptr = pWin->background.pixmap; - bmask = GCFillStyle|GCTile; - } - - /* should be the same as the reference function XmuDrawLogo() */ - - size = width; - if (height < width) - size = height; - size = RANDOM_WIDTH + rand() % (size - RANDOM_WIDTH); - size &= ~1; - x += rand() % (width - size); - y += rand() % (height - size); - -/* - * Draw what will be the thin strokes. - * - * ----- - * / / - * / / - * / / - * / / - * /____/ - * d - * - * Point d is 9/44 (~1/5) of the way across. - */ - - thin = (size / 11); - if (thin < 1) thin = 1; - gap = (thin+3) / 4; - d31 = thin + thin + gap; - poly[0].x = x + size; poly[0].y = y; - poly[1].x = x + size-d31; poly[1].y = y; - poly[2].x = x + 0; poly[2].y = y + size; - poly[3].x = x + d31; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, fmask, NULL, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for lower thin stroke. - * - * ------ - * / / - * / __ / - * / / / - * / / / - * /__/__/ - */ - - poly[0].x = x + d31/2; poly[0].y = y + size; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + d31; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, bmask, NULL, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for upper thin stroke. - * - * ------ - * / / / - * /--/ / - * / / - * / / - * /_____/ - */ - - poly[0].x = x + size - d31/2; poly[0].y = y; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + size - d31; poly[3].y = y; - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Draw thick stroke. - * Point b is 1/4 of the way across. - * - * b - * ----- - * \ \ - * \ \ - * \ \ - * \ \ - * \____\ - */ - - poly[0].x = x; poly[0].y = y; - poly[1].x = x + size/4; poly[1].y = y; - poly[2].x = x + size; poly[2].y = y + size; - poly[3].x = x + size - size/4; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, fmask, NULL, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase to create gap. - * - * / - * / - * / - * / - * / - */ - - poly[0].x = x + size- thin; poly[0].y = y; - poly[1].x = x + size-( thin+gap); poly[1].y = y; - poly[2].x = x + thin; poly[2].y = y + size; - poly[3].x = x + thin + gap; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, bmask, NULL, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - - FreeScratchGC(pGC); -} - -#endif - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.XF86.original deleted file mode 100644 index 30c0df032..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.XF86.original +++ /dev/null @@ -1,3947 +0,0 @@ -/* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -/* The panoramix components contained the following notice */ -/**************************************************************** -* * -* Copyright (c) Digital Equipment Corporation, 1991, 1997 * -* * -* All Rights Reserved. Unpublished rights reserved under * -* the copyright laws of the United States. * -* * -* The software contained on this media is proprietary to * -* and embodies the confidential technology of Digital * -* Equipment Corporation. Possession, use, duplication or * -* dissemination of the software and media is authorized only * -* pursuant to a valid written license from Digital Equipment * -* Corporation. * -* * -* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure * -* by the U.S. Government is subject to restrictions as set * -* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, * -* or in FAR 52.227-19, as applicable. * -* * -*****************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.32 2003/01/12 02:44:26 dawes Exp $ */ - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include "dixevents.h" -#include "globals.h" - -#ifdef XAPPGROUP -#include "Xagsrv.h" -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include "security.h" -#endif - -#if defined(NEED_SCREEN_REGIONS) -#define REGION_PTR(pScreen,pWin) \ - register ScreenPtr pScreen = pWin->drawable.pScreen; -#else -#define REGION_PTR(pScreen,pWin) /* nothing */ -#endif - -/****** - * Window stuff for server - * - * CreateRootWindow, CreateWindow, ChangeWindowAttributes, - * GetWindowAttributes, DeleteWindow, DestroySubWindows, - * HandleSaveSet, ReparentWindow, MapWindow, MapSubWindows, - * UnmapWindow, UnmapSubWindows, ConfigureWindow, CirculateWindow, - * - ******/ - -static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11}; -static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88}; - -int screenIsSaved = SCREEN_SAVER_OFF; - -ScreenSaverStuffRec savedScreenInfo[MAXSCREENS]; - -#if 0 -extern void DeleteWindowFromAnyEvents(); -extern Mask EventMaskForClient(); -extern void WindowHasNewCursor(); -extern void RecalculateDeliverableEvents(); -#endif - -static Bool TileScreenSaver( -#if NeedFunctionPrototypes - int /*i*/, - int /*kind*/ -#endif -); - - -#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \ - CWDontPropagate | CWOverrideRedirect | CWCursor ) - -#define BOXES_OVERLAP(b1, b2) \ - (!( ((b1)->x2 <= (b2)->x1) || \ - ( ((b1)->x1 >= (b2)->x2)) || \ - ( ((b1)->y2 <= (b2)->y1)) || \ - ( ((b1)->y1 >= (b2)->y2)) ) ) - -#define RedirectSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureRedirectMask) - -#define SubSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureNotifyMask) - -#define StrSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & StructureNotifyMask) - -#define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent)) - - -int numSaveUndersViewable = 0; -int deltaSaveUndersViewable = 0; - -#ifdef DEBUG -/****** - * PrintWindowTree - * For debugging only - ******/ - -int -PrintChildren(p1, indent) - WindowPtr p1; - int indent; -{ - WindowPtr p2; - int i; - - while (p1) - { - p2 = p1->firstChild; - for (i=0; idrawable.id); - miPrintRegion(&p1->clipList); - PrintChildren(p2, indent+4); - p1 = p1->nextSib; - } -} - -PrintWindowTree() -{ - int i; - WindowPtr pWin, p1; - - for (i=0; iclipList); - p1 = pWin->firstChild; - PrintChildren(p1, 4); - } -} -#endif - -int -TraverseTree(pWin, func, data) - register WindowPtr pWin; - VisitWindowProcPtr func; - pointer data; -{ - register int result; - register WindowPtr pChild; - - if (!(pChild = pWin)) - return(WT_NOMATCH); - while (1) - { - result = (* func)(pChild, data); - if (result == WT_STOPWALKING) - return(WT_STOPWALKING); - if ((result == WT_WALKCHILDREN) && pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } - return(WT_NOMATCH); -} - -/***** - * WalkTree - * Walk the window tree, for SCREEN, preforming FUNC(pWin, data) on - * each window. If FUNC returns WT_WALKCHILDREN, traverse the children, - * if it returns WT_DONTWALKCHILDREN, dont. If it returns WT_STOPWALKING - * exit WalkTree. Does depth-first traverse. - *****/ - -int -WalkTree(pScreen, func, data) - ScreenPtr pScreen; - VisitWindowProcPtr func; - pointer data; -{ - return(TraverseTree(WindowTable[pScreen->myNum], func, data)); -} - -/* hack for forcing backing store on all windows */ -int defaultBackingStore = NotUseful; -/* hack to force no backing store */ -Bool disableBackingStore = FALSE; -Bool enableBackingStore = FALSE; -/* hack to force no save unders */ -Bool disableSaveUnders = FALSE; - -static void -#if NeedFunctionPrototypes -SetWindowToDefaults(register WindowPtr pWin) -#else -SetWindowToDefaults(pWin) - register WindowPtr pWin; -#endif -{ - pWin->prevSib = NullWindow; - pWin->firstChild = NullWindow; - pWin->lastChild = NullWindow; - - pWin->valdata = (ValidatePtr)NULL; - pWin->optional = (WindowOptPtr)NULL; - pWin->cursorIsNone = TRUE; - - pWin->backingStore = NotUseful; - pWin->DIXsaveUnder = FALSE; - pWin->backStorage = (pointer) NULL; - - pWin->mapped = FALSE; /* off */ - pWin->realized = FALSE; /* off */ - pWin->viewable = FALSE; - pWin->visibility = VisibilityNotViewable; - pWin->overrideRedirect = FALSE; - pWin->saveUnder = FALSE; - - pWin->bitGravity = ForgetGravity; - pWin->winGravity = NorthWestGravity; - - pWin->eventMask = 0; - pWin->deliverableEvents = 0; - pWin->dontPropagate = 0; - pWin->forcedBS = FALSE; -#ifdef NEED_DBE_BUF_BITS - pWin->srcBuffer = DBE_FRONT_BUFFER; - pWin->dstBuffer = DBE_FRONT_BUFFER; -#endif -} - -static void -#if NeedFunctionPrototypes -MakeRootTile(WindowPtr pWin) -#else -MakeRootTile(pWin) - WindowPtr pWin; -#endif -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - GCPtr pGC; - unsigned char back[128]; - int len = BitmapBytePad(sizeof(long)); - register unsigned char *from, *to; - register int i, j; - - pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4, - pScreen->rootDepth); - - pWin->backgroundState = BackgroundPixmap; - pGC = GetScratchGC(pScreen->rootDepth, pScreen); - if (!pWin->background.pixmap || !pGC) - FatalError("could not create root tile"); - - { - CARD32 attributes[2]; - - attributes[0] = pScreen->whitePixel; - attributes[1] = pScreen->blackPixel; - - (void)ChangeGC(pGC, GCForeground | GCBackground, attributes); - } - - ValidateGC((DrawablePtr)pWin->background.pixmap, pGC); - - from = (screenInfo.bitmapBitOrder == LSBFirst) ? _back_lsb : _back_msb; - to = back; - - for (i = 4; i > 0; i--, from++) - for (j = len; j > 0; j--) - *to++ = *from; - - if (blackRoot) - bzero(back, sizeof(back)); - - (*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, pGC, 1, - 0, 0, len, 4, 0, XYBitmap, (char *)back); - - FreeScratchGC(pGC); - -} - -WindowPtr -AllocateWindow(pScreen) - ScreenPtr pScreen; -{ - WindowPtr pWin; - register char *ptr; - register DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; - - pWin = (WindowPtr)xalloc(pScreen->totalWindowSize); - if (pWin) - { - ppriv = (DevUnion *)(pWin + 1); - pWin->devPrivates = ppriv; - sizes = pScreen->WindowPrivateSizes; - ptr = (char *)(ppriv + pScreen->WindowPrivateLen); - for (i = pScreen->WindowPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - } - return pWin; -} - -/***** - * CreateRootWindow - * Makes a window at initialization time for specified screen - *****/ - -Bool -CreateRootWindow(pScreen) - ScreenPtr pScreen; -{ - WindowPtr pWin; - BoxRec box; - PixmapFormatRec *format; - - pWin = AllocateWindow(pScreen); - if (!pWin) - return FALSE; - - savedScreenInfo[pScreen->myNum].pWindow = NULL; - savedScreenInfo[pScreen->myNum].wid = FakeClientID(0); - savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL; - screenIsSaved = SCREEN_SAVER_OFF; - - WindowTable[pScreen->myNum] = pWin; - - pWin->drawable.pScreen = pScreen; - pWin->drawable.type = DRAWABLE_WINDOW; - - pWin->drawable.depth = pScreen->rootDepth; - for (format = screenInfo.formats; - format->depth != pScreen->rootDepth; - format++) - ; - pWin->drawable.bitsPerPixel = format->bitsPerPixel; - - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - pWin->parent = NullWindow; - SetWindowToDefaults(pWin); - - pWin->optional = (WindowOptRec *) xalloc (sizeof (WindowOptRec)); - if (!pWin->optional) - return FALSE; - - pWin->optional->dontPropagateMask = 0; - pWin->optional->otherEventMasks = 0; - pWin->optional->otherClients = NULL; - pWin->optional->passiveGrabs = NULL; - pWin->optional->userProps = NULL; - pWin->optional->backingBitPlanes = ~0L; - pWin->optional->backingPixel = 0; -#ifdef SHAPE - pWin->optional->boundingShape = NULL; - pWin->optional->clipShape = NULL; -#endif -#ifdef XINPUT - pWin->optional->inputMasks = NULL; -#endif - pWin->optional->colormap = pScreen->defColormap; - pWin->optional->visual = pScreen->rootVisual; - - pWin->nextSib = NullWindow; - - pWin->drawable.id = FakeClientID(0); - - pWin->origin.x = pWin->origin.y = 0; - pWin->drawable.height = pScreen->height; - pWin->drawable.width = pScreen->width; - pWin->drawable.x = pWin->drawable.y = 0; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - REGION_INIT(pScreen, &pWin->winSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderClip, &box, 1); - - pWin->drawable.class = InputOutput; - pWin->optional->visual = pScreen->rootVisual; - - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = pScreen->whitePixel; - - pWin->borderIsPixel = TRUE; - pWin->border.pixel = pScreen->blackPixel; - pWin->borderWidth = 0; - - if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin)) - return FALSE; - - if (disableBackingStore) - pScreen->backingStoreSupport = NotUseful; - if (enableBackingStore) - pScreen->backingStoreSupport = Always; - -#ifdef DO_SAVE_UNDERS - if ((pScreen->backingStoreSupport != NotUseful) && - (pScreen->saveUnderSupport == NotUseful)) - { - /* - * If the screen has backing-store but no save-unders, let the - * clients know we can support save-unders using backing-store. - */ - pScreen->saveUnderSupport = USE_DIX_SAVE_UNDERS; - } -#endif /* DO_SAVE_UNDERS */ - - if (disableSaveUnders) - pScreen->saveUnderSupport = NotUseful; - - return TRUE; -} - -void -InitRootWindow(pWin) - WindowPtr pWin; -{ - ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; - if (!(*pScreen->CreateWindow)(pWin)) - return; /* XXX */ - (*pScreen->PositionWindow)(pWin, 0, 0); - - pWin->cursorIsNone = FALSE; - pWin->optional->cursor = rootCursor; - rootCursor->refcnt++; - MakeRootTile(pWin); - pWin->backingStore = defaultBackingStore; - pWin->forcedBS = (defaultBackingStore != NotUseful); - /* We SHOULD check for an error value here XXX */ - (*pScreen->ChangeWindowAttributes)(pWin, - CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore); - - MapWindow(pWin, serverClient); -} - -/* Set the region to the intersection of the rectangle and the - * window's winSize. The window is typically the parent of the - * window from which the region came. - */ - -void -ClippedRegionFromBox(pWin, Rgn, x, y, w, h) - register WindowPtr pWin; - RegionPtr Rgn; - register int x, y; - int w, h; -{ - REGION_PTR(pScreen, pWin) - BoxRec box; - - box = *(REGION_EXTENTS(pScreen, &pWin->winSize)); - /* we do these calculations to avoid overflows */ - if (x > box.x1) - box.x1 = x; - if (y > box.y1) - box.y1 = y; - x += w; - if (x < box.x2) - box.x2 = x; - y += h; - if (y < box.y2) - box.y2 = y; - if (box.x1 > box.x2) - box.x2 = box.x1; - if (box.y1 > box.y2) - box.y2 = box.y1; - REGION_RESET(pScreen, Rgn, &box); - REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize); -} - -WindowPtr -RealChildHead(pWin) - register WindowPtr pWin; -{ - if (!pWin->parent && - (screenIsSaved == SCREEN_SAVER_ON) && - (HasSaverWindow (pWin->drawable.pScreen->myNum))) - return (pWin->firstChild); - else - return (NullWindow); -} - -/***** - * CreateWindow - * Makes a window in response to client request - *****/ - -WindowPtr -CreateWindow(wid, pParent, x, y, w, h, bw, class, vmask, vlist, - depth, client, visual, error) - Window wid; - register WindowPtr pParent; - int x,y; - unsigned int w, h, bw; - unsigned int class; - register Mask vmask; - XID *vlist; - int depth; - ClientPtr client; - VisualID visual; - int *error; -{ - register WindowPtr pWin; - WindowPtr pHead; - register ScreenPtr pScreen; - xEvent event; - int idepth, ivisual; - Bool fOK; - DepthPtr pDepth; - PixmapFormatRec *format; - register WindowOptPtr ancwopt; - - if (class == CopyFromParent) - class = pParent->drawable.class; - - if ((class != InputOutput) && (class != InputOnly)) - { - *error = BadValue; - client->errorValue = class; - return NullWindow; - } - - if ((class != InputOnly) && (pParent->drawable.class == InputOnly)) - { - *error = BadMatch; - return NullWindow; - } - - if ((class == InputOnly) && ((bw != 0) || (depth != 0))) - { - *error = BadMatch; - return NullWindow; - } - - pScreen = pParent->drawable.pScreen; - if ((class == InputOutput) && (depth == 0)) - depth = pParent->drawable.depth; - ancwopt = pParent->optional; - if (!ancwopt) - ancwopt = FindWindowWithOptional(pParent)->optional; - if (visual == CopyFromParent) { -#ifdef XAPPGROUP - VisualID ag_visual; - - if (client->appgroup && !pParent->parent && - (ag_visual = XagRootVisual (client))) - visual = ag_visual; - else -#endif - visual = ancwopt->visual; - } - - /* Find out if the depth and visual are acceptable for this Screen */ - if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) - { - fOK = FALSE; - for(idepth = 0; idepth < pScreen->numDepths; idepth++) - { - pDepth = (DepthPtr) &pScreen->allowedDepths[idepth]; - if ((depth == pDepth->depth) || (depth == 0)) - { - for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) - { - if (visual == pDepth->vids[ivisual]) - { - fOK = TRUE; - break; - } - } - } - } - if (fOK == FALSE) - { - *error = BadMatch; - return NullWindow; - } - } - - if (((vmask & (CWBorderPixmap | CWBorderPixel)) == 0) && - (class != InputOnly) && - (depth != pParent->drawable.depth)) - { - *error = BadMatch; - return NullWindow; - } - - if (((vmask & CWColormap) == 0) && - (class != InputOnly) && - ((visual != ancwopt->visual) || (ancwopt->colormap == None))) - { - *error = BadMatch; - return NullWindow; - } - - pWin = AllocateWindow(pScreen); - if (!pWin) - { - *error = BadAlloc; - return NullWindow; - } - pWin->drawable = pParent->drawable; - pWin->drawable.depth = depth; - if (depth == pParent->drawable.depth) - pWin->drawable.bitsPerPixel = pParent->drawable.bitsPerPixel; - else - { - for (format = screenInfo.formats; format->depth != depth; format++) - ; - pWin->drawable.bitsPerPixel = format->bitsPerPixel; - } - if (class == InputOnly) - pWin->drawable.type = (short) UNDRAWABLE_WINDOW; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - pWin->drawable.id = wid; - pWin->drawable.class = class; - - pWin->parent = pParent; - SetWindowToDefaults(pWin); - - if (visual != ancwopt->visual) - { - if (!MakeWindowOptional (pWin)) - { - xfree (pWin); - *error = BadAlloc; - return NullWindow; - } - pWin->optional->visual = visual; - pWin->optional->colormap = None; - } - - pWin->borderWidth = bw; -#ifdef XCSECURITY - /* can't let untrusted clients have background None windows; - * they make it too easy to steal window contents - */ - if (client->trustLevel != XSecurityClientTrusted) - { - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = 0; - } - else -#endif - pWin->backgroundState = None; - - pWin->borderIsPixel = pParent->borderIsPixel; - pWin->border = pParent->border; - if (pWin->borderIsPixel == FALSE) - pWin->border.pixmap->refcnt++; - - pWin->origin.x = x + (int)bw; - pWin->origin.y = y + (int)bw; - pWin->drawable.width = w; - pWin->drawable.height = h; - pWin->drawable.x = pParent->drawable.x + x + (int)bw; - pWin->drawable.y = pParent->drawable.y + y + (int)bw; - - /* set up clip list correctly for unobscured WindowPtr */ - REGION_INIT(pScreen, &pWin->clipList, NullBox, 1); - REGION_INIT(pScreen, &pWin->borderClip, NullBox, 1); - REGION_INIT(pScreen, &pWin->winSize, NullBox, 1); - REGION_INIT(pScreen, &pWin->borderSize, NullBox, 1); - - pHead = RealChildHead(pParent); - if (pHead) - { - pWin->nextSib = pHead->nextSib; - if (pHead->nextSib) - pHead->nextSib->prevSib = pWin; - else - pParent->lastChild = pWin; - pHead->nextSib = pWin; - pWin->prevSib = pHead; - } - else - { - pWin->nextSib = pParent->firstChild; - if (pParent->firstChild) - pParent->firstChild->prevSib = pWin; - else - pParent->lastChild = pWin; - pParent->firstChild = pWin; - } - - SetWinSize (pWin); - SetBorderSize (pWin); - - /* We SHOULD check for an error value here XXX */ - if (!(*pScreen->CreateWindow)(pWin)) - { - *error = BadAlloc; - DeleteWindow(pWin, None); - return NullWindow; - } - /* We SHOULD check for an error value here XXX */ - (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y); - - if (!(vmask & CWEventMask)) - RecalculateDeliverableEvents(pWin); - - if (vmask) - *error = ChangeWindowAttributes(pWin, vmask, vlist, wClient (pWin)); - else - *error = Success; - - if (*error != Success) - { - DeleteWindow(pWin, None); - return NullWindow; - } - if (!(vmask & CWBackingStore) && (defaultBackingStore != NotUseful)) - { - XID value = defaultBackingStore; - (void)ChangeWindowAttributes(pWin, CWBackingStore, &value, wClient (pWin)); - pWin->forcedBS = TRUE; - } - - if (SubSend(pParent)) - { - event.u.u.type = CreateNotify; - event.u.createNotify.window = wid; - event.u.createNotify.parent = pParent->drawable.id; - event.u.createNotify.x = x; - event.u.createNotify.y = y; - event.u.createNotify.width = w; - event.u.createNotify.height = h; - event.u.createNotify.borderWidth = bw; - event.u.createNotify.override = pWin->overrideRedirect; - DeliverEvents(pParent, &event, 1, NullWindow); - } - return pWin; -} - -static void -#if NeedFunctionPrototypes -FreeWindowResources(register WindowPtr pWin) -#else -FreeWindowResources(pWin) - register WindowPtr pWin; -#endif -{ - register ScreenPtr pScreen = pWin->drawable.pScreen; - - DeleteWindowFromAnySaveSet(pWin); - DeleteWindowFromAnySelections(pWin); - DeleteWindowFromAnyEvents(pWin, TRUE); - REGION_UNINIT(pScreen, &pWin->clipList); - REGION_UNINIT(pScreen, &pWin->winSize); - REGION_UNINIT(pScreen, &pWin->borderClip); - REGION_UNINIT(pScreen, &pWin->borderSize); -#ifdef SHAPE - if (wBoundingShape (pWin)) - REGION_DESTROY(pScreen, wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_DESTROY(pScreen, wClipShape (pWin)); -#endif - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - - DeleteAllWindowProperties(pWin); - /* We SHOULD check for an error value here XXX */ - (*pScreen->DestroyWindow)(pWin); - DisposeWindowOptional (pWin); -} - -static void -#if NeedFunctionPrototypes -CrushTree(WindowPtr pWin) -#else -CrushTree(pWin) - WindowPtr pWin; -#endif -{ - register WindowPtr pChild, pSib, pParent; - UnrealizeWindowProcPtr UnrealizeWindow; - xEvent event; - - if (!(pChild = pWin->firstChild)) - return; - UnrealizeWindow = pWin->drawable.pScreen->UnrealizeWindow; - while (1) - { - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (1) - { - pParent = pChild->parent; - if (SubStrSend(pChild, pParent)) - { - event.u.u.type = DestroyNotify; - event.u.destroyNotify.window = pChild->drawable.id; - DeliverEvents(pChild, &event, 1, NullWindow); - } - FreeResource(pChild->drawable.id, RT_WINDOW); - pSib = pChild->nextSib; -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder && pChild->viewable) - deltaSaveUndersViewable--; -#endif - pChild->viewable = FALSE; - if (pChild->realized) - { - pChild->realized = FALSE; - (*UnrealizeWindow)(pChild); - } - FreeWindowResources(pChild); - xfree(pChild); - if ( (pChild = pSib) ) - break; - pChild = pParent; - pChild->firstChild = NullWindow; - pChild->lastChild = NullWindow; - if (pChild == pWin) - return; - } - } -} - -/***** - * DeleteWindow - * Deletes child of window then window itself - * If wid is None, don't send any events - *****/ - -/*ARGSUSED*/ -int -DeleteWindow(value, wid) - pointer value; - XID wid; - { - register WindowPtr pParent; - register WindowPtr pWin = (WindowPtr)value; - xEvent event; - - UnmapWindow(pWin, FALSE); - - CrushTree(pWin); - - pParent = pWin->parent; - if (wid && pParent && SubStrSend(pWin, pParent)) - { - event.u.u.type = DestroyNotify; - event.u.destroyNotify.window = pWin->drawable.id; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - FreeWindowResources(pWin); - if (pParent) - { - if (pParent->firstChild == pWin) - pParent->firstChild = pWin->nextSib; - if (pParent->lastChild == pWin) - pParent->lastChild = pWin->prevSib; - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - } - xfree(pWin); - return Success; -} - -/*ARGSUSED*/ -void -DestroySubwindows(pWin, client) - register WindowPtr pWin; - ClientPtr client; -{ - /* XXX - * The protocol is quite clear that each window should be - * destroyed in turn, however, unmapping all of the first - * eliminates most of the calls to ValidateTree. So, - * this implementation is incorrect in that all of the - * UnmapNotifies occur before all of the DestroyNotifies. - * If you care, simply delete the call to UnmapSubwindows. - */ - UnmapSubwindows(pWin); - while (pWin->lastChild) - FreeResource(pWin->lastChild->drawable.id, RT_NONE); -} - -#define DeviceEventMasks (KeyPressMask | KeyReleaseMask | ButtonPressMask | \ - ButtonReleaseMask | PointerMotionMask) - -/***** - * ChangeWindowAttributes - * - * The value-mask specifies which attributes are to be changed; the - * value-list contains one value for each one bit in the mask, from least - * to most significant bit in the mask. - *****/ - -int -ChangeWindowAttributes(pWin, vmask, vlist, client) - register WindowPtr pWin; - Mask vmask; - XID *vlist; - ClientPtr client; -{ - register Mask index2; - register XID *pVlist; - PixmapPtr pPixmap; - Pixmap pixID; - CursorPtr pCursor, pOldCursor; - Cursor cursorID; - WindowPtr pChild; - Colormap cmap; - ColormapPtr pCmap; - xEvent xE; - int result; - register ScreenPtr pScreen; - Mask vmaskCopy = 0; - register Mask tmask; - unsigned int val; - int error; - Bool checkOptional = FALSE; - Bool borderRelative = FALSE; - WindowPtr pLayerWin; - - if ((pWin->drawable.class == InputOnly) && (vmask & (~INPUTONLY_LEGAL_MASK))) - return BadMatch; - - error = Success; - pScreen = pWin->drawable.pScreen; - pVlist = vlist; - tmask = vmask; - while (tmask) - { - index2 = (Mask) lowbit (tmask); - tmask &= ~index2; - switch (index2) - { - case CWBackPixmap: - pixID = (Pixmap )*pVlist; - pVlist++; - if (pWin->backgroundState == ParentRelative) - borderRelative = TRUE; - if (pixID == None) - { -#ifdef XCSECURITY - /* can't let untrusted clients have background None windows */ - if (client->trustLevel == XSecurityClientTrusted) - { -#endif - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - if (!pWin->parent) - MakeRootTile(pWin); - else - pWin->backgroundState = None; -#ifdef XCSECURITY - } - else - { /* didn't change the background to None, so don't tell ddx */ - index2 = 0; - } -#endif - } - else if (pixID == ParentRelative) - { - if (pWin->parent && - pWin->drawable.depth != pWin->parent->drawable.depth) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - if (!pWin->parent) - MakeRootTile(pWin); - else - pWin->backgroundState = ParentRelative; - borderRelative = TRUE; - /* Note that the parent's backgroundTile's refcnt is NOT - * incremented. */ - } - else - { - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); - if (pPixmap != (PixmapPtr) NULL) - { - if ((pPixmap->drawable.depth != pWin->drawable.depth) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - pWin->backgroundState = BackgroundPixmap; - pWin->background.pixmap = pPixmap; - pPixmap->refcnt++; - } - else - { - error = BadPixmap; - client->errorValue = pixID; - goto PatchUp; - } - } - break; - case CWBackPixel: - if (pWin->backgroundState == ParentRelative) - borderRelative = TRUE; - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = (CARD32 ) *pVlist; - /* background pixel overrides background pixmap, - so don't let the ddx layer see both bits */ - vmaskCopy &= ~CWBackPixmap; - pVlist++; - break; - case CWBorderPixmap: - pixID = (Pixmap ) *pVlist; - pVlist++; - if (pixID == CopyFromParent) - { - if (!pWin->parent || - (pWin->drawable.depth != pWin->parent->drawable.depth)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->border = pWin->parent->border; - if ((pWin->borderIsPixel = pWin->parent->borderIsPixel) == TRUE) - { - index2 = CWBorderPixel; - } - else - { - pWin->parent->border.pixmap->refcnt++; - } - } - else - { - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); - if (pPixmap) - { - if ((pPixmap->drawable.depth != pWin->drawable.depth) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->borderIsPixel = FALSE; - pWin->border.pixmap = pPixmap; - pPixmap->refcnt++; - } - else - { - error = BadPixmap; - client->errorValue = pixID; - goto PatchUp; - } - } - break; - case CWBorderPixel: - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->borderIsPixel = TRUE; - pWin->border.pixel = (CARD32) *pVlist; - /* border pixel overrides border pixmap, - so don't let the ddx layer see both bits */ - vmaskCopy &= ~CWBorderPixmap; - pVlist++; - break; - case CWBitGravity: - val = (CARD8 )*pVlist; - pVlist++; - if (val > StaticGravity) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->bitGravity = val; - break; - case CWWinGravity: - val = (CARD8 )*pVlist; - pVlist++; - if (val > StaticGravity) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->winGravity = val; - break; - case CWBackingStore: - val = (CARD8 )*pVlist; - pVlist++; - if ((val != NotUseful) && (val != WhenMapped) && (val != Always)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->backingStore = val; - pWin->forcedBS = FALSE; - break; - case CWBackingPlanes: - if (pWin->optional || ((CARD32)*pVlist != (CARD32)~0L)) { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - pWin->optional->backingBitPlanes = (CARD32) *pVlist; - if ((CARD32)*pVlist == (CARD32)~0L) - checkOptional = TRUE; - } - pVlist++; - break; - case CWBackingPixel: - if (pWin->optional || (CARD32) *pVlist) { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - pWin->optional->backingPixel = (CARD32) *pVlist; - if (!*pVlist) - checkOptional = TRUE; - } - pVlist++; - break; - case CWSaveUnder: - val = (BOOL) *pVlist; - pVlist++; - if ((val != xTrue) && (val != xFalse)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } -#ifdef DO_SAVE_UNDERS - if (pWin->parent && (pWin->saveUnder != val) && (pWin->viewable) && - DO_SAVE_UNDERS(pWin)) - { - /* - * Re-check all siblings and inferiors for obscurity or - * exposition (hee hee). - */ - if (pWin->saveUnder) - deltaSaveUndersViewable--; - else - deltaSaveUndersViewable++; - pWin->saveUnder = val; - - if (pWin->firstChild) - { - pLayerWin = (*pScreen->GetLayerWindow)(pWin); - if ((*pScreen->ChangeSaveUnder)(pLayerWin->parent, pWin->nextSib)) - (*pScreen->PostChangeSaveUnder)(pLayerWin->parent, - pWin->nextSib); - } - else - { - if ((*pScreen->ChangeSaveUnder)(pWin, pWin->nextSib)) - (*pScreen->PostChangeSaveUnder)(pWin, - pWin->nextSib); - } - } - else - { - /* If we're changing the saveUnder attribute of the root - * window, all we do is set pWin->saveUnder so that - * GetWindowAttributes returns the right value. We don't - * do the "normal" save-under processing (as above). - * Hope that doesn't cause any problems. - */ - pWin->saveUnder = val; - } -#else - pWin->saveUnder = val; -#endif /* DO_SAVE_UNDERS */ - break; - case CWEventMask: - result = EventSelectForWindow(pWin, client, (Mask )*pVlist); - if (result) - { - error = result; - goto PatchUp; - } - pVlist++; - break; - case CWDontPropagate: - result = EventSuppressForWindow(pWin, client, (Mask )*pVlist, - &checkOptional); - if (result) - { - error = result; - goto PatchUp; - } - pVlist++; - break; - case CWOverrideRedirect: - val = (BOOL ) *pVlist; - pVlist++; - if ((val != xTrue) && (val != xFalse)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->overrideRedirect = val; - break; - case CWColormap: - cmap = (Colormap) *pVlist; - pVlist++; - if (cmap == CopyFromParent) - { -#ifdef XAPPGROUP - Colormap ag_colormap; - ClientPtr win_owner; - - /* - * win_owner == client for CreateWindow, other clients - * can ChangeWindowAttributes - */ - win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - - if ( win_owner && win_owner->appgroup && - !pWin->parent->parent && - (ag_colormap = XagDefaultColormap (win_owner))) - cmap = ag_colormap; - else -#endif - if (pWin->parent && - (!pWin->optional || - pWin->optional->visual == wVisual (pWin->parent))) - { - cmap = wColormap (pWin->parent); - } - else - cmap = None; - } - if (cmap == None) - { - error = BadMatch; - goto PatchUp; - } - pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap, - RT_COLORMAP, SecurityReadAccess); - if (!pCmap) - { - error = BadColor; - client->errorValue = cmap; - goto PatchUp; - } - if (pCmap->pVisual->vid != wVisual (pWin) || - pCmap->pScreen != pScreen) - { - error = BadMatch; - goto PatchUp; - } - if (cmap != wColormap (pWin)) - { - if (!pWin->optional) - { - if (!MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - } - else if (pWin->parent && cmap == wColormap (pWin->parent)) - checkOptional = TRUE; - - /* - * propagate the original colormap to any children - * inheriting it - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (!pChild->optional && !MakeWindowOptional (pChild)) - { - error = BadAlloc; - goto PatchUp; - } - } - - pWin->optional->colormap = cmap; - - /* - * check on any children now matching the new colormap - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (pChild->optional->colormap == cmap) - CheckWindowOptionalNeed (pChild); - } - - xE.u.u.type = ColormapNotify; - xE.u.colormap.window = pWin->drawable.id; - xE.u.colormap.colormap = cmap; - xE.u.colormap.new = xTrue; - xE.u.colormap.state = IsMapInstalled(cmap, pWin); - DeliverEvents(pWin, &xE, 1, NullWindow); - } - break; - case CWCursor: - cursorID = (Cursor ) *pVlist; - pVlist++; - /* - * install the new - */ - if ( cursorID == None) - { - if (pWin == WindowTable[pWin->drawable.pScreen->myNum]) - pCursor = rootCursor; - else - pCursor = (CursorPtr) None; - } - else - { - pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID, - RT_CURSOR, SecurityReadAccess); - if (!pCursor) - { - error = BadCursor; - client->errorValue = cursorID; - goto PatchUp; - } - } - - if (pCursor != wCursor (pWin)) - { - /* - * patch up child windows so they don't lose cursors. - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (!pChild->optional && !pChild->cursorIsNone && - !MakeWindowOptional (pChild)) - { - error = BadAlloc; - goto PatchUp; - } - } - - pOldCursor = 0; - if (pCursor == (CursorPtr) None) - { - pWin->cursorIsNone = TRUE; - if (pWin->optional) - { - pOldCursor = pWin->optional->cursor; - pWin->optional->cursor = (CursorPtr) None; - checkOptional = TRUE; - } - } else { - if (!pWin->optional) - { - if (!MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - } - else if (pWin->parent && pCursor == wCursor (pWin->parent)) - checkOptional = TRUE; - pOldCursor = pWin->optional->cursor; - pWin->optional->cursor = pCursor; - pCursor->refcnt++; - pWin->cursorIsNone = FALSE; - /* - * check on any children now matching the new cursor - */ - - for (pChild=pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (pChild->optional && - (pChild->optional->cursor == pCursor)) - CheckWindowOptionalNeed (pChild); - } - } - - if (pWin->realized) - WindowHasNewCursor( pWin); - - /* Can't free cursor until here - old cursor - * is needed in WindowHasNewCursor - */ - if (pOldCursor) - FreeCursor (pOldCursor, (Cursor)0); - } - break; - default: - error = BadValue; - client->errorValue = vmask; - goto PatchUp; - } - vmaskCopy |= index2; - } -PatchUp: - if (checkOptional) - CheckWindowOptionalNeed (pWin); - - /* We SHOULD check for an error value here XXX */ - (*pScreen->ChangeWindowAttributes)(pWin, vmaskCopy); - - /* - If the border contents have changed, redraw the border. - Note that this has to be done AFTER pScreen->ChangeWindowAttributes - for the tile to be rotated, and the correct function selected. - */ - if (((vmaskCopy & (CWBorderPixel | CWBorderPixmap)) || borderRelative) - && pWin->viewable && HasBorder (pWin)) - { - RegionRec exposed; - - REGION_INIT(pScreen, &exposed, NullBox, 0); - REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize); - (*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER); - REGION_UNINIT(pScreen, &exposed); - } - return error; -} - - -/***** - * GetWindowAttributes - * Notice that this is different than ChangeWindowAttributes - *****/ - -void -GetWindowAttributes(pWin, client, wa) - register WindowPtr pWin; - ClientPtr client; - xGetWindowAttributesReply *wa; -{ - wa->type = X_Reply; - wa->bitGravity = pWin->bitGravity; - wa->winGravity = pWin->winGravity; - if (pWin->forcedBS && pWin->backingStore != Always) - wa->backingStore = NotUseful; - else - wa->backingStore = pWin->backingStore; - wa->length = (sizeof(xGetWindowAttributesReply) - - sizeof(xGenericReply)) >> 2; - wa->sequenceNumber = client->sequence; - wa->backingBitPlanes = wBackingBitPlanes (pWin); - wa->backingPixel = wBackingPixel (pWin); - wa->saveUnder = (BOOL)pWin->saveUnder; - wa->override = pWin->overrideRedirect; - if (!pWin->mapped) - wa->mapState = IsUnmapped; - else if (pWin->realized) - wa->mapState = IsViewable; - else - wa->mapState = IsUnviewable; - - wa->colormap = wColormap (pWin); - wa->mapInstalled = (wa->colormap == None) ? xFalse - : IsMapInstalled(wa->colormap, pWin); - - wa->yourEventMask = EventMaskForClient(pWin, client); - wa->allEventMasks = pWin->eventMask | wOtherEventMasks (pWin); - wa->doNotPropagateMask = wDontPropagateMask (pWin); - wa->class = pWin->drawable.class; - wa->visualID = wVisual (pWin); -} - - -WindowPtr -MoveWindowInStack(pWin, pNextSib) - register WindowPtr pWin, pNextSib; -{ - register WindowPtr pParent = pWin->parent; - WindowPtr pFirstChange = pWin; /* highest window where list changes */ - - if (pWin->nextSib != pNextSib) - { - WindowPtr pOldNextSib = pWin->nextSib; - - if (!pNextSib) /* move to bottom */ - { - if (pParent->firstChild == pWin) - pParent->firstChild = pWin->nextSib; - /* if (pWin->nextSib) */ /* is always True: pNextSib == NULL - * and pWin->nextSib != pNextSib - * therefore pWin->nextSib != NULL */ - pFirstChange = pWin->nextSib; - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pParent->lastChild->nextSib = pWin; - pWin->prevSib = pParent->lastChild; - pWin->nextSib = NullWindow; - pParent->lastChild = pWin; - } - else if (pParent->firstChild == pNextSib) /* move to top */ - { - pFirstChange = pWin; - if (pParent->lastChild == pWin) - pParent->lastChild = pWin->prevSib; - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pWin->nextSib = pParent->firstChild; - pWin->prevSib = (WindowPtr ) NULL; - pNextSib->prevSib = pWin; - pParent->firstChild = pWin; - } - else /* move in middle of list */ - { - WindowPtr pOldNext = pWin->nextSib; - - pFirstChange = NullWindow; - if (pParent->firstChild == pWin) - pFirstChange = pParent->firstChild = pWin->nextSib; - if (pParent->lastChild == pWin) { - pFirstChange = pWin; - pParent->lastChild = pWin->prevSib; - } - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pWin->nextSib = pNextSib; - pWin->prevSib = pNextSib->prevSib; - if (pNextSib->prevSib) - pNextSib->prevSib->nextSib = pWin; - pNextSib->prevSib = pWin; - if (!pFirstChange) { /* do we know it yet? */ - pFirstChange = pParent->firstChild; /* no, search from top */ - while ((pFirstChange != pWin) && (pFirstChange != pOldNext)) - pFirstChange = pFirstChange->nextSib; - } - } - if(pWin->drawable.pScreen->RestackWindow) - (*pWin->drawable.pScreen->RestackWindow)(pWin, pOldNextSib); - } - - return( pFirstChange ); -} - -RegionPtr -CreateUnclippedWinSize (pWin) - register WindowPtr pWin; -{ - RegionPtr pRgn; - BoxRec box; - - box.x1 = pWin->drawable.x; - box.y1 = pWin->drawable.y; - box.x2 = pWin->drawable.x + (int) pWin->drawable.width; - box.y2 = pWin->drawable.y + (int) pWin->drawable.height; - pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); -#ifdef SHAPE - if (wBoundingShape (pWin) || wClipShape (pWin)) { - REGION_PTR(pScreen, pWin) - - REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x, - - pWin->drawable.y); - if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wClipShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x, pWin->drawable.y); - } -#endif - return pRgn; -} - -void -SetWinSize (pWin) - register WindowPtr pWin; -{ - ClippedRegionFromBox(pWin->parent, &pWin->winSize, - pWin->drawable.x, pWin->drawable.y, - (int)pWin->drawable.width, - (int)pWin->drawable.height); -#ifdef SHAPE - if (wBoundingShape (pWin) || wClipShape (pWin)) { - REGION_PTR(pScreen, pWin) - - REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x, - - pWin->drawable.y); - if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, - wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, - wClipShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->winSize, pWin->drawable.x, - pWin->drawable.y); - } -#endif -} - -void -SetBorderSize (pWin) - register WindowPtr pWin; -{ - int bw; - - if (HasBorder (pWin)) { - bw = wBorderWidth (pWin); - ClippedRegionFromBox(pWin->parent, &pWin->borderSize, - pWin->drawable.x - bw, pWin->drawable.y - bw, - (int)(pWin->drawable.width + (bw<<1)), - (int)(pWin->drawable.height + (bw<<1))); -#ifdef SHAPE - if (wBoundingShape (pWin)) { - REGION_PTR(pScreen, pWin) - - REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x, - - pWin->drawable.y); - REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize, - wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->borderSize, pWin->drawable.x, - pWin->drawable.y); - REGION_UNION(pScreen, &pWin->borderSize, &pWin->borderSize, - &pWin->winSize); - } -#endif - } else { - REGION_COPY(pWin->drawable.pScreen, &pWin->borderSize, - &pWin->winSize); - } -} - -void -GravityTranslate (x, y, oldx, oldy, dw, dh, gravity, destx, desty) - register int x, y; /* new window position */ - int oldx, oldy; /* old window position */ - int dw, dh; - unsigned gravity; - register int *destx, *desty; /* position relative to gravity */ -{ - switch (gravity) { - case NorthGravity: - *destx = x + dw / 2; - *desty = y; - break; - case NorthEastGravity: - *destx = x + dw; - *desty = y; - break; - case WestGravity: - *destx = x; - *desty = y + dh / 2; - break; - case CenterGravity: - *destx = x + dw / 2; - *desty = y + dh / 2; - break; - case EastGravity: - *destx = x + dw; - *desty = y + dh / 2; - break; - case SouthWestGravity: - *destx = x; - *desty = y + dh; - break; - case SouthGravity: - *destx = x + dw / 2; - *desty = y + dh; - break; - case SouthEastGravity: - *destx = x + dw; - *desty = y + dh; - break; - case StaticGravity: - *destx = oldx; - *desty = oldy; - break; - default: - *destx = x; - *desty = y; - break; - } -} - -/* XXX need to retile border on each window with ParentRelative origin */ -void -ResizeChildrenWinSize(pWin, dx, dy, dw, dh) - register WindowPtr pWin; - int dx, dy, dw, dh; -{ - register ScreenPtr pScreen; - register WindowPtr pSib, pChild; - Bool resized = (dw || dh); - - pScreen = pWin->drawable.pScreen; - - for (pSib = pWin->firstChild; pSib; pSib = pSib->nextSib) - { - if (resized && (pSib->winGravity > NorthWestGravity)) - { - int cwsx, cwsy; - - cwsx = pSib->origin.x; - cwsy = pSib->origin.y; - GravityTranslate (cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh, - pSib->winGravity, &cwsx, &cwsy); - if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) - { - xEvent event; - - event.u.u.type = GravityNotify; - event.u.gravity.window = pSib->drawable.id; - event.u.gravity.x = cwsx - wBorderWidth (pSib); - event.u.gravity.y = cwsy - wBorderWidth (pSib); - DeliverEvents (pSib, &event, 1, NullWindow); - pSib->origin.x = cwsx; - pSib->origin.y = cwsy; - } - } - pSib->drawable.x = pWin->drawable.x + pSib->origin.x; - pSib->drawable.y = pWin->drawable.y + pSib->origin.y; - SetWinSize (pSib); - SetBorderSize (pSib); - (*pScreen->PositionWindow)(pSib, pSib->drawable.x, pSib->drawable.y); - - if ( (pChild = pSib->firstChild) ) - { - while (1) - { - pChild->drawable.x = pChild->parent->drawable.x + - pChild->origin.x; - pChild->drawable.y = pChild->parent->drawable.y + - pChild->origin.y; - SetWinSize (pChild); - SetBorderSize (pChild); - (*pScreen->PositionWindow)(pChild, - pChild->drawable.x, pChild->drawable.y); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pSib)) - pChild = pChild->parent; - if (pChild == pSib) - break; - pChild = pChild->nextSib; - } - } - } -} - -#define GET_INT16(m, f) \ - if (m & mask) \ - { \ - f = (INT16) *pVlist;\ - pVlist++; \ - } -#define GET_CARD16(m, f) \ - if (m & mask) \ - { \ - f = (CARD16) *pVlist;\ - pVlist++;\ - } - -#define GET_CARD8(m, f) \ - if (m & mask) \ - { \ - f = (CARD8) *pVlist;\ - pVlist++;\ - } - -#define ChangeMask ((Mask)(CWX | CWY | CWWidth | CWHeight)) - -#define IllegalInputOnlyConfigureMask (CWBorderWidth) - -/* - * IsSiblingAboveMe - * returns Above if pSib above pMe in stack or Below otherwise - */ - -static int -#if NeedFunctionPrototypes -IsSiblingAboveMe( - register WindowPtr pMe, - register WindowPtr pSib) -#else -IsSiblingAboveMe(pMe, pSib) - register WindowPtr pMe, pSib; -#endif -{ - register WindowPtr pWin; - - pWin = pMe->parent->firstChild; - while (pWin) - { - if (pWin == pSib) - return(Above); - else if (pWin == pMe) - return(Below); - pWin = pWin->nextSib; - } - return(Below); -} - -static BoxPtr -#if NeedFunctionPrototypes -WindowExtents( - register WindowPtr pWin, - register BoxPtr pBox) -#else -WindowExtents(pWin, pBox) - register WindowPtr pWin; - register BoxPtr pBox; -#endif -{ - pBox->x1 = pWin->drawable.x - wBorderWidth (pWin); - pBox->y1 = pWin->drawable.y - wBorderWidth (pWin); - pBox->x2 = pWin->drawable.x + (int)pWin->drawable.width - + wBorderWidth (pWin); - pBox->y2 = pWin->drawable.y + (int)pWin->drawable.height - + wBorderWidth (pWin); - return(pBox); -} - -#ifdef SHAPE -#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL) - -static RegionPtr -#if NeedFunctionPrototypes -MakeBoundingRegion ( - register WindowPtr pWin, - BoxPtr pBox) -#else -MakeBoundingRegion (pWin, pBox) - register WindowPtr pWin; - BoxPtr pBox; -#endif -{ - RegionPtr pRgn; - REGION_PTR(pScreen, pWin) - - pRgn = REGION_CREATE(pScreen, pBox, 1); - if (wBoundingShape (pWin)) { - REGION_TRANSLATE(pScreen, pRgn, -pWin->origin.x, - -pWin->origin.y); - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->origin.x, - pWin->origin.y); - } - return pRgn; -} - -static Bool -#if NeedFunctionPrototypes -ShapeOverlap ( - WindowPtr pWin, - BoxPtr pWinBox, - WindowPtr pSib, - BoxPtr pSibBox) -#else -ShapeOverlap (pWin, pWinBox, pSib, pSibBox) - WindowPtr pWin, pSib; - BoxPtr pWinBox, pSibBox; -#endif -{ - RegionPtr pWinRgn, pSibRgn; - register ScreenPtr pScreen; - Bool ret; - - if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib)) - return TRUE; - pScreen = pWin->drawable.pScreen; - pWinRgn = MakeBoundingRegion (pWin, pWinBox); - pSibRgn = MakeBoundingRegion (pSib, pSibBox); - REGION_INTERSECT(pScreen, pWinRgn, pWinRgn, pSibRgn); - ret = REGION_NOTEMPTY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pSibRgn); - return ret; -} -#endif - -static Bool -#if NeedFunctionPrototypes -AnyWindowOverlapsMe( - WindowPtr pWin, - WindowPtr pHead, - register BoxPtr box) -#else -AnyWindowOverlapsMe(pWin, pHead, box) - WindowPtr pWin, pHead; - register BoxPtr box; -#endif -{ - register WindowPtr pSib; - BoxRec sboxrec; - register BoxPtr sbox; - - for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib) - { - if (pSib->mapped) - { - sbox = WindowExtents(pSib, &sboxrec); - if (BOXES_OVERLAP(sbox, box) -#ifdef SHAPE - && ShapeOverlap (pWin, box, pSib, sbox) -#endif - ) - return(TRUE); - } - } - return(FALSE); -} - -static Bool -#if NeedFunctionPrototypes -IOverlapAnyWindow( - WindowPtr pWin, - register BoxPtr box) -#else -IOverlapAnyWindow(pWin, box) - WindowPtr pWin; - register BoxPtr box; -#endif -{ - register WindowPtr pSib; - BoxRec sboxrec; - register BoxPtr sbox; - - for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib) - { - if (pSib->mapped) - { - sbox = WindowExtents(pSib, &sboxrec); - if (BOXES_OVERLAP(sbox, box) -#ifdef SHAPE - && ShapeOverlap (pWin, box, pSib, sbox) -#endif - ) - return(TRUE); - } - } - return(FALSE); -} - -/* - * WhereDoIGoInTheStack() - * Given pWin and pSib and the relationshipe smode, return - * the window that pWin should go ABOVE. - * If a pSib is specified: - * Above: pWin is placed just above pSib - * Below: pWin is placed just below pSib - * TopIf: if pSib occludes pWin, then pWin is placed - * at the top of the stack - * BottomIf: if pWin occludes pSib, then pWin is - * placed at the bottom of the stack - * Opposite: if pSib occludes pWin, then pWin is placed at the - * top of the stack, else if pWin occludes pSib, then - * pWin is placed at the bottom of the stack - * - * If pSib is NULL: - * Above: pWin is placed at the top of the stack - * Below: pWin is placed at the bottom of the stack - * TopIf: if any sibling occludes pWin, then pWin is placed at - * the top of the stack - * BottomIf: if pWin occludes any sibline, then pWin is placed at - * the bottom of the stack - * Opposite: if any sibling occludes pWin, then pWin is placed at - * the top of the stack, else if pWin occludes any - * sibling, then pWin is placed at the bottom of the stack - * - */ - -static WindowPtr -#if NeedFunctionPrototypes -WhereDoIGoInTheStack( - register WindowPtr pWin, - register WindowPtr pSib, - short x, - short y, - unsigned short w, - unsigned short h, - int smode) -#else -WhereDoIGoInTheStack(pWin, pSib, x, y, w, h, smode) - register WindowPtr pWin, pSib; - short x, y; - unsigned short w, h; - int smode; -#endif -{ - BoxRec box; - register ScreenPtr pScreen; - WindowPtr pHead, pFirst; - - if ((pWin == pWin->parent->firstChild) && - (pWin == pWin->parent->lastChild)) - return((WindowPtr ) NULL); - pHead = RealChildHead(pWin->parent); - pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild; - pScreen = pWin->drawable.pScreen; - box.x1 = x; - box.y1 = y; - box.x2 = x + (int)w; - box.y2 = y + (int)h; - switch (smode) - { - case Above: - if (pSib) - return(pSib); - else if (pWin == pFirst) - return(pWin->nextSib); - else - return(pFirst); - case Below: - if (pSib) - if (pSib->nextSib != pWin) - return(pSib->nextSib); - else - return(pWin->nextSib); - else - return NullWindow; - case TopIf: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if ((IsSiblingAboveMe(pWin, pSib) == Above) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) - return(pFirst); - else - return(pWin->nextSib); - } - else if (AnyWindowOverlapsMe(pWin, pHead, &box)) - return(pFirst); - else - return(pWin->nextSib); - case BottomIf: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if ((IsSiblingAboveMe(pWin, pSib) == Below) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) - return NullWindow; - else - return(pWin->nextSib); - } - else if (IOverlapAnyWindow(pWin, &box)) - return NullWindow; - else - return(pWin->nextSib); - case Opposite: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT) - { - if (IsSiblingAboveMe(pWin, pSib) == Above) - return(pFirst); - else - return NullWindow; - } - else - return(pWin->nextSib); - } - else if (AnyWindowOverlapsMe(pWin, pHead, &box)) - { - /* If I'm occluded, I can't possibly be the first child - * if (pWin == pWin->parent->firstChild) - * return pWin->nextSib; - */ - return(pFirst); - } - else if (IOverlapAnyWindow(pWin, &box)) - return NullWindow; - else - return pWin->nextSib; - default: - { - ErrorF("Internal error in ConfigureWindow, smode == %d\n",smode ); - return pWin->nextSib; - } - } -} - -static void -#if NeedFunctionPrototypes -ReflectStackChange( - register WindowPtr pWin, - register WindowPtr pSib, - VTKind kind) -#else -ReflectStackChange(pWin, pSib, kind) - register WindowPtr pWin, pSib; - VTKind kind; -#endif -{ -/* Note that pSib might be NULL */ - - Bool WasViewable = (Bool)pWin->viewable; - WindowPtr pParent; - Bool anyMarked; - WindowPtr pFirstChange; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - ScreenPtr pScreen = pWin->drawable.pScreen; - - /* if this is a root window, can't be restacked */ - if (!(pParent = pWin->parent)) - return ; - - pFirstChange = MoveWindowInStack(pWin, pSib); - - if (WasViewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, - &pLayerWin); - if (pLayerWin != pWin) pFirstChange = pLayerWin; -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, kind); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pWin->drawable.pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange, kind); - } - if (pWin->realized) - WindowsRestructured (); -} - -/***** - * ConfigureWindow - *****/ - -int -ConfigureWindow(pWin, mask, vlist, client) - register WindowPtr pWin; - register Mask mask; - XID *vlist; - ClientPtr client; -{ -#define RESTACK_WIN 0 -#define MOVE_WIN 1 -#define RESIZE_WIN 2 -#define REBORDER_WIN 3 - register WindowPtr pSib = NullWindow; - register WindowPtr pParent = pWin->parent; - Window sibwid = 0; - Mask index2, tmask; - register XID *pVlist; - short x, y, beforeX, beforeY; - unsigned short w = pWin->drawable.width, - h = pWin->drawable.height, - bw = pWin->borderWidth; - int action, smode = Above; -#ifdef XAPPGROUP - ClientPtr win_owner; - ClientPtr ag_leader = NULL; -#endif - xEvent event; - - if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask)) - return(BadMatch); - - if ((mask & CWSibling) && !(mask & CWStackMode)) - return(BadMatch); - - pVlist = vlist; - - if (pParent) - { - x = pWin->drawable.x - pParent->drawable.x - (int)bw; - y = pWin->drawable.y - pParent->drawable.y - (int)bw; - } - else - { - x = pWin->drawable.x; - y = pWin->drawable.y; - } - beforeX = x; - beforeY = y; - action = RESTACK_WIN; - if ((mask & (CWX | CWY)) && (!(mask & (CWHeight | CWWidth)))) - { - GET_INT16(CWX, x); - GET_INT16(CWY, y); - action = MOVE_WIN; - } - /* or should be resized */ - else if (mask & (CWX | CWY | CWWidth | CWHeight)) - { - GET_INT16(CWX, x); - GET_INT16(CWY, y); - GET_CARD16(CWWidth, w); - GET_CARD16 (CWHeight, h); - if (!w || !h) - { - client->errorValue = 0; - return BadValue; - } - action = RESIZE_WIN; - } - tmask = mask & ~ChangeMask; - while (tmask) - { - index2 = (Mask)lowbit (tmask); - tmask &= ~index2; - switch (index2) - { - case CWBorderWidth: - GET_CARD16(CWBorderWidth, bw); - break; - case CWSibling: - sibwid = (Window ) *pVlist; - pVlist++; - pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid, - RT_WINDOW, SecurityReadAccess); - if (!pSib) - { - client->errorValue = sibwid; - return(BadWindow); - } - if (pSib->parent != pParent) - return(BadMatch); - if (pSib == pWin) - return(BadMatch); - break; - case CWStackMode: - GET_CARD8(CWStackMode, smode); - if ((smode != TopIf) && (smode != BottomIf) && - (smode != Opposite) && (smode != Above) && (smode != Below)) - { - client->errorValue = smode; - return(BadValue); - } - break; - default: - client->errorValue = mask; - return(BadValue); - } - } - /* root really can't be reconfigured, so just return */ - if (!pParent) - return Success; - - /* Figure out if the window should be moved. Doesnt - make the changes to the window if event sent */ - - if (mask & CWStackMode) - pSib = WhereDoIGoInTheStack(pWin, pSib, pParent->drawable.x + x, - pParent->drawable.y + y, - w + (bw << 1), h + (bw << 1), smode); - else - pSib = pWin->nextSib; - -#ifdef XAPPGROUP - win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - ag_leader = XagLeader (win_owner); -#endif - - if ((!pWin->overrideRedirect) && - (RedirectSend(pParent) -#ifdef XAPPGROUP - || (win_owner->appgroup && ag_leader && - XagIsControlledRoot (client, pParent)) -#endif - )) - { - event.u.u.type = ConfigureRequest; - event.u.configureRequest.window = pWin->drawable.id; - if (mask & CWSibling) - event.u.configureRequest.sibling = sibwid; - else - event.u.configureRequest.sibling = None; - if (mask & CWStackMode) - event.u.u.detail = smode; - else - event.u.u.detail = Above; - event.u.configureRequest.x = x; - event.u.configureRequest.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureRequest.x += panoramiXdataPtr[0].x; - event.u.configureRequest.y += panoramiXdataPtr[0].y; - } -#endif - event.u.configureRequest.width = w; - event.u.configureRequest.height = h; - event.u.configureRequest.borderWidth = bw; - event.u.configureRequest.valueMask = mask; -#ifdef XAPPGROUP - /* make sure if the ag_leader maps the window it goes to the wm */ - if (ag_leader && ag_leader != client && - XagIsControlledRoot (client, pParent)) { - event.u.configureRequest.parent = XagId (win_owner); - (void) TryClientEvents (ag_leader, &event, 1, - NoEventMask, NoEventMask, NullGrab); - return Success; - } -#endif - event.u.configureRequest.parent = pParent->drawable.id; - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - if (action == RESIZE_WIN) - { - Bool size_change = (w != pWin->drawable.width) - || (h != pWin->drawable.height); - if (size_change && ((pWin->eventMask|wOtherEventMasks(pWin)) & ResizeRedirectMask)) - { - xEvent eventT; - eventT.u.u.type = ResizeRequest; - eventT.u.resizeRequest.window = pWin->drawable.id; - eventT.u.resizeRequest.width = w; - eventT.u.resizeRequest.height = h; - if (MaybeDeliverEventsToClient(pWin, &eventT, 1, - ResizeRedirectMask, client) == 1) - { - /* if event is delivered, leave the actual size alone. */ - w = pWin->drawable.width; - h = pWin->drawable.height; - size_change = FALSE; - } - } - if (!size_change) - { - if (mask & (CWX | CWY)) - action = MOVE_WIN; - else if (mask & (CWStackMode | CWBorderWidth)) - action = RESTACK_WIN; - else /* really nothing to do */ - return(Success) ; - } - } - - if (action == RESIZE_WIN) - /* we've already checked whether there's really a size change */ - goto ActuallyDoSomething; - if ((mask & CWX) && (x != beforeX)) - goto ActuallyDoSomething; - if ((mask & CWY) && (y != beforeY)) - goto ActuallyDoSomething; - if ((mask & CWBorderWidth) && (bw != wBorderWidth (pWin))) - goto ActuallyDoSomething; - if (mask & CWStackMode) - { - if (pWin->nextSib != pSib) - goto ActuallyDoSomething; - } - return(Success); - -ActuallyDoSomething: - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - if (pSib) - event.u.configureNotify.aboveSibling = pSib->drawable.id; - else - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = x; - event.u.configureNotify.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureNotify.x += panoramiXdataPtr[0].x; - event.u.configureNotify.y += panoramiXdataPtr[0].y; - } -#endif - event.u.configureNotify.width = w; - event.u.configureNotify.height = h; - event.u.configureNotify.borderWidth = bw; - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - if (mask & CWBorderWidth) - { - if (action == RESTACK_WIN) - { - action = MOVE_WIN; - pWin->borderWidth = bw; - } - else if ((action == MOVE_WIN) && - (beforeX + wBorderWidth (pWin) == x + (int)bw) && - (beforeY + wBorderWidth (pWin) == y + (int)bw)) - { - action = REBORDER_WIN; - (*pWin->drawable.pScreen->ChangeBorderWidth)(pWin, bw); - } - else - pWin->borderWidth = bw; - } - if (action == MOVE_WIN) - (*pWin->drawable.pScreen->MoveWindow)(pWin, x, y, pSib, - (mask & CWBorderWidth) ? VTOther : VTMove); - else if (action == RESIZE_WIN) - (*pWin->drawable.pScreen->ResizeWindow)(pWin, x, y, w, h, pSib); - else if (mask & CWStackMode) - ReflectStackChange(pWin, pSib, VTOther); - - if (action != RESTACK_WIN) - CheckCursorConfinement(pWin); - return(Success); -#undef RESTACK_WIN -#undef MOVE_WIN -#undef RESIZE_WIN -#undef REBORDER_WIN -} - - -/****** - * - * CirculateWindow - * For RaiseLowest, raises the lowest mapped child (if any) that is - * obscured by another child to the top of the stack. For LowerHighest, - * lowers the highest mapped child (if any) that is obscuring another - * child to the bottom of the stack. Exposure processing is performed - * - ******/ - -int -CirculateWindow(pParent, direction, client) - WindowPtr pParent; - int direction; - ClientPtr client; -{ - register WindowPtr pWin, pHead, pFirst; - xEvent event; - BoxRec box; - - pHead = RealChildHead(pParent); - pFirst = pHead ? pHead->nextSib : pParent->firstChild; - if (direction == RaiseLowest) - { - for (pWin = pParent->lastChild; - (pWin != pHead) && - !(pWin->mapped && - AnyWindowOverlapsMe(pWin, pHead, WindowExtents(pWin, &box))); - pWin = pWin->prevSib) ; - if (pWin == pHead) - return Success; - } - else - { - for (pWin = pFirst; - pWin && - !(pWin->mapped && - IOverlapAnyWindow(pWin, WindowExtents(pWin, &box))); - pWin = pWin->nextSib) ; - if (!pWin) - return Success; - } - - event.u.circulate.window = pWin->drawable.id; - event.u.circulate.parent = pParent->drawable.id; - event.u.circulate.event = pParent->drawable.id; - if (direction == RaiseLowest) - event.u.circulate.place = PlaceOnTop; - else - event.u.circulate.place = PlaceOnBottom; - - if (RedirectSend(pParent)) - { - event.u.u.type = CirculateRequest; - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - - event.u.u.type = CirculateNotify; - DeliverEvents(pWin, &event, 1, NullWindow); - ReflectStackChange(pWin, - (direction == RaiseLowest) ? pFirst : NullWindow, - VTStack); - - return(Success); -} - -static int -#if NeedFunctionPrototypes -CompareWIDs( - WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ -#else -CompareWIDs(pWin, value) - WindowPtr pWin; - pointer value; /* must conform to VisitWindowProcPtr */ -#endif -{ - Window *wid = (Window *)value; - - if (pWin->drawable.id == *wid) - return(WT_STOPWALKING); - else - return(WT_WALKCHILDREN); -} - -/***** - * ReparentWindow - *****/ - -int -ReparentWindow(pWin, pParent, x, y, client) - register WindowPtr pWin, pParent; - int x,y; - ClientPtr client; -{ - WindowPtr pPrev, pPriorParent; - Bool WasMapped = (Bool)(pWin->mapped); - xEvent event; - int bw = wBorderWidth (pWin); - register ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; - if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING) - return(BadMatch); - if (!MakeWindowOptional(pWin)) - return(BadAlloc); - - if (WasMapped) - UnmapWindow(pWin, FALSE); - - event.u.u.type = ReparentNotify; - event.u.reparent.window = pWin->drawable.id; - event.u.reparent.parent = pParent->drawable.id; - event.u.reparent.x = x; - event.u.reparent.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pParent->parent) { - event.u.reparent.x += panoramiXdataPtr[0].x; - event.u.reparent.y += panoramiXdataPtr[0].y; - } -#endif - event.u.reparent.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, pParent); - - /* take out of sibling chain */ - - pPriorParent = pPrev = pWin->parent; - if (pPrev->firstChild == pWin) - pPrev->firstChild = pWin->nextSib; - if (pPrev->lastChild == pWin) - pPrev->lastChild = pWin->prevSib; - - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - - /* insert at begining of pParent */ - pWin->parent = pParent; - pPrev = RealChildHead(pParent); - if (pPrev) - { - pWin->nextSib = pPrev->nextSib; - if (pPrev->nextSib) - pPrev->nextSib->prevSib = pWin; - else - pParent->lastChild = pWin; - pPrev->nextSib = pWin; - pWin->prevSib = pPrev; - } - else - { - pWin->nextSib = pParent->firstChild; - pWin->prevSib = NullWindow; - if (pParent->firstChild) - pParent->firstChild->prevSib = pWin; - else - pParent->lastChild = pWin; - pParent->firstChild = pWin; - } - - pWin->origin.x = x + bw; - pWin->origin.y = y + bw; - pWin->drawable.x = x + bw + pParent->drawable.x; - pWin->drawable.y = y + bw + pParent->drawable.y; - - /* clip to parent */ - SetWinSize (pWin); - SetBorderSize (pWin); - - if (pScreen->ReparentWindow) - (*pScreen->ReparentWindow)(pWin, pPriorParent); - (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y); - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - CheckWindowOptionalNeed(pWin); - - if (WasMapped) - MapWindow(pWin, client); - RecalculateDeliverableEvents(pWin); - return(Success); -} - -static void -#if NeedFunctionPrototypes -RealizeTree(WindowPtr pWin) -#else -RealizeTree(pWin) - WindowPtr pWin; -#endif -{ - register WindowPtr pChild; - RealizeWindowProcPtr Realize; - - Realize = pWin->drawable.pScreen->RealizeWindow; - pChild = pWin; - while (1) - { - if (pChild->mapped) - { - pChild->realized = TRUE; -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder) - deltaSaveUndersViewable++; -#endif - pChild->viewable = (pChild->drawable.class == InputOutput); - (* Realize)(pChild); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - return; - pChild = pChild->nextSib; - } -} - -/***** - * MapWindow - * If some other client has selected SubStructureReDirect on the parent - * and override-redirect is xFalse, then a MapRequest event is generated, - * but the window remains unmapped. Otherwise, the window is mapped and a - * MapNotify event is generated. - *****/ - -int -MapWindow(pWin, client) - register WindowPtr pWin; - ClientPtr client; -{ - register ScreenPtr pScreen; - - register WindowPtr pParent; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - if (pWin->mapped) - return(Success); - -#ifdef XCSECURITY - /* don't let an untrusted client map a child-of-trusted-window, InputOnly - * window; too easy to steal device input - */ - if ( (client->trustLevel != XSecurityClientTrusted) && - (pWin->drawable.class == InputOnly) && - (wClient(pWin->parent)->trustLevel == XSecurityClientTrusted) ) - return Success; -#endif - - pScreen = pWin->drawable.pScreen; - if ( (pParent = pWin->parent) ) - { - xEvent event; - Bool anyMarked; -#ifdef XAPPGROUP - ClientPtr win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - ClientPtr ag_leader = XagLeader (win_owner); -#endif - - if ((!pWin->overrideRedirect) && - (RedirectSend(pParent) -#ifdef XAPPGROUP - || (win_owner->appgroup && ag_leader && - XagIsControlledRoot (client, pParent)) -#endif - )) - { - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; -#ifdef XAPPGROUP - /* make sure if the ag_leader maps the window it goes to the wm */ - if (ag_leader && ag_leader != client && - XagIsControlledRoot (client, pParent)) { - event.u.mapRequest.parent = XagId (win_owner); - (void) TryClientEvents (ag_leader, &event, 1, - NoEventMask, NoEventMask, NullGrab); - return Success; - } -#endif - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - - pWin->mapped = TRUE; - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - if (!pParent->realized) - return(Success); - RealizeTree(pWin); - if (pWin->viewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTMap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, VTMap); - } - WindowsRestructured (); - } - else - { - RegionRec temp; - - pWin->mapped = TRUE; - pWin->realized = TRUE; /* for roots */ - pWin->viewable = pWin->drawable.class == InputOutput; - /* We SHOULD check for an error value here XXX */ - (*pScreen->RealizeWindow)(pWin); - if (pScreen->ClipNotify) - (*pScreen->ClipNotify) (pWin, 0, 0); - if (pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(NullWindow, pWin, VTMap); - REGION_INIT(pScreen, &temp, NullBox, 0); - REGION_COPY(pScreen, &temp, &pWin->clipList); - (*pScreen->WindowExposures) (pWin, &temp, NullRegion); - REGION_UNINIT(pScreen, &temp); - } - - return(Success); -} - - -/***** - * MapSubwindows - * Performs a MapWindow all unmapped children of the window, in top - * to bottom stacking order. - *****/ - -void -MapSubwindows(pParent, client) - register WindowPtr pParent; - ClientPtr client; -{ - register WindowPtr pWin; - WindowPtr pFirstMapped = NullWindow; -#ifdef DO_SAVE_UNDERS - WindowPtr pFirstSaveUndered = NullWindow; -#endif - register ScreenPtr pScreen; - register Mask parentRedirect; - register Mask parentNotify; - xEvent event; - Bool anyMarked; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - pScreen = pParent->drawable.pScreen; - parentRedirect = RedirectSend(pParent); - parentNotify = SubSend(pParent); - anyMarked = FALSE; - for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) - { - if (!pWin->mapped) - { - if (parentRedirect && !pWin->overrideRedirect) - { - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - continue; - } - - pWin->mapped = TRUE; - if (parentNotify || StrSend(pWin)) - { - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - if (!pFirstMapped) - pFirstMapped = pWin; - if (pParent->realized) - { - RealizeTree(pWin); - if (pWin->viewable) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - (WindowPtr *)NULL); -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = TRUE; - } -#endif /* DO_SAVE_UNDERS */ - } - } - } - } - - if (pFirstMapped) - { - pLayerWin = (*pScreen->GetLayerWindow)(pParent); - if (pLayerWin->parent != pParent) { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pLayerWin, - pLayerWin, - (WindowPtr *)NULL); - pFirstMapped = pLayerWin; - } - if (anyMarked) - { -#ifdef DO_SAVE_UNDERS - if (pLayerWin->parent != pParent) - { - if (dosave || (DO_SAVE_UNDERS(pLayerWin))) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, - pLayerWin); - } - } - else if (dosave) - { - dosave = FALSE; - for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) - { - if (DO_SAVE_UNDERS(pWin)) - { - dosave |= (*pScreen->ChangeSaveUnder)(pWin, - pWin->nextSib); - if (dosave && !pFirstSaveUndered) - pFirstSaveUndered = pWin; - } - } - } -#endif /* DO_SAVE_UNDERS */ - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstMapped, VTMap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, - pFirstSaveUndered->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstMapped, - VTMap); - WindowsRestructured (); - } -} - -static void -#if NeedFunctionPrototypes -UnrealizeTree( - WindowPtr pWin, - Bool fromConfigure) -#else -UnrealizeTree(pWin, fromConfigure) - WindowPtr pWin; - Bool fromConfigure; -#endif -{ - register WindowPtr pChild; - UnrealizeWindowProcPtr Unrealize; - MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; - - Unrealize = pWin->drawable.pScreen->UnrealizeWindow; - MarkUnrealizedWindow = pWin->drawable.pScreen->MarkUnrealizedWindow; - pChild = pWin; - while (1) - { - if (pChild->realized) - { - pChild->realized = FALSE; - pChild->visibility = VisibilityNotViewable; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) { - PanoramiXRes *win; - win = (PanoramiXRes*)LookupIDByType(pChild->drawable.id, - XRT_WINDOW); - if(win) - win->u.win.visibility = VisibilityNotViewable; - } -#endif - (* Unrealize)(pChild); - DeleteWindowFromAnyEvents(pChild, FALSE); - if (pChild->viewable) - { -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder) - deltaSaveUndersViewable--; -#endif - pChild->viewable = FALSE; - if (pChild->backStorage) - (*pChild->drawable.pScreen->SaveDoomedAreas)( - pChild, &pChild->clipList, 0, 0); - (* MarkUnrealizedWindow)(pChild, pWin, fromConfigure); - pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - return; - pChild = pChild->nextSib; - } -} - -/***** - * UnmapWindow - * If the window is already unmapped, this request has no effect. - * Otherwise, the window is unmapped and an UnMapNotify event is - * generated. Cannot unmap a root window. - *****/ - -int -UnmapWindow(pWin, fromConfigure) - register WindowPtr pWin; - Bool fromConfigure; -{ - register WindowPtr pParent; - xEvent event; - Bool wasRealized = (Bool)pWin->realized; - Bool wasViewable = (Bool)pWin->viewable; - ScreenPtr pScreen = pWin->drawable.pScreen; - WindowPtr pLayerWin = pWin; - - if ((!pWin->mapped) || (!(pParent = pWin->parent))) - return(Success); - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pWin->drawable.id; - event.u.unmapNotify.fromConfigure = fromConfigure; - DeliverEvents(pWin, &event, 1, NullWindow); - } - if (wasViewable && !fromConfigure) - { - pWin->valdata = UnmapValData; - (*pScreen->MarkOverlappedWindows)(pWin, pWin->nextSib, &pLayerWin); - (*pScreen->MarkWindow)(pLayerWin->parent); - } - pWin->mapped = FALSE; - if (wasRealized) - UnrealizeTree(pWin, fromConfigure); - if (wasViewable) - { - if (!fromConfigure) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pWin, VTUnmap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib) ) - { - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); - } - } - pWin->DIXsaveUnder = FALSE; -#endif /* DO_SAVE_UNDERS */ - if (!fromConfigure && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pWin, VTUnmap); - } - if (wasRealized && !fromConfigure) - WindowsRestructured (); - return(Success); -} - -/***** - * UnmapSubwindows - * Performs an UnmapWindow request with the specified mode on all mapped - * children of the window, in bottom to top stacking order. - *****/ - -void -UnmapSubwindows(pWin) - register WindowPtr pWin; -{ - register WindowPtr pChild, pHead; - xEvent event; - Bool wasRealized = (Bool)pWin->realized; - Bool wasViewable = (Bool)pWin->viewable; - Bool anyMarked = FALSE; - Mask parentNotify; - WindowPtr pLayerWin = NULL; - ScreenPtr pScreen = pWin->drawable.pScreen; - - if (!pWin->firstChild) - return; - parentNotify = SubSend(pWin); - pHead = RealChildHead(pWin); - - if (wasViewable) - pLayerWin = (*pScreen->GetLayerWindow)(pWin); - - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - { - if (pChild->mapped) - { - if (parentNotify || StrSend(pChild)) - { - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pChild->drawable.id; - event.u.unmapNotify.fromConfigure = xFalse; - DeliverEvents(pChild, &event, 1, NullWindow); - } - if (pChild->viewable) - { - pChild->valdata = UnmapValData; - anyMarked = TRUE; - } - pChild->mapped = FALSE; - if (pChild->realized) - UnrealizeTree(pChild, FALSE); - if (wasViewable) - { -#ifdef DO_SAVE_UNDERS - pChild->DIXsaveUnder = FALSE; -#endif /* DO_SAVE_UNDERS */ - if (pChild->backStorage) - (*pScreen->SaveDoomedAreas)( - pChild, &pChild->clipList, 0, 0); - } - } - } - if (wasViewable) - { - if (anyMarked) - { - if (pLayerWin->parent == pWin) - (*pScreen->MarkWindow)(pWin); - else - { - WindowPtr ptmp; - (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin, - (WindowPtr *)NULL); - (*pScreen->MarkWindow)(pLayerWin->parent); - - /* Windows between pWin and pLayerWin may not have been marked */ - ptmp = pWin; - - while (ptmp != pLayerWin->parent) - { - (*pScreen->MarkWindow)(ptmp); - ptmp = ptmp->parent; - } - pHead = pWin->firstChild; - } - (*pScreen->ValidateTree)(pLayerWin->parent, pHead, VTUnmap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin)) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pHead, VTUnmap); - } - if (wasRealized) - WindowsRestructured (); -} - - -void -HandleSaveSet(client) - register ClientPtr client; -{ - register WindowPtr pParent, pWin; - register int j; - - for (j=0; jnumSaved; j++) - { - pWin = (WindowPtr)client->saveSet[j]; - pParent = pWin->parent; - while (pParent && (wClient (pParent) == client)) - pParent = pParent->parent; - if (pParent) - { - if (pParent != pWin->parent) - { - ReparentWindow(pWin, pParent, - pWin->drawable.x - wBorderWidth (pWin) - pParent->drawable.x, - pWin->drawable.y - wBorderWidth (pWin) - pParent->drawable.y, - client); - if(!pWin->realized && pWin->mapped) - pWin->mapped = FALSE; - } - MapWindow(pWin, client); - } - } - xfree(client->saveSet); - client->numSaved = 0; - client->saveSet = (pointer *)NULL; -} - -Bool -VisibleBoundingBoxFromPoint(pWin, x, y, box) - register WindowPtr pWin; - int x, y; /* in root */ - BoxPtr box; /* "return" value */ -{ - if (!pWin->realized) - return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box)) - return(TRUE); - return(FALSE); -} - -Bool -PointInWindowIsVisible(pWin, x, y) - register WindowPtr pWin; - int x, y; /* in root */ -{ - BoxRec box; - - if (!pWin->realized) - return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip, - x, y, &box)) - return(TRUE); - return(FALSE); -} - - -RegionPtr -NotClippedByChildren(pWin) - register WindowPtr pWin; -{ - register ScreenPtr pScreen; - RegionPtr pReg; - - pScreen = pWin->drawable.pScreen; - pReg = REGION_CREATE(pScreen, NullBox, 1); - if (pWin->parent || - screenIsSaved != SCREEN_SAVER_ON || - !HasSaverWindow (pWin->drawable.pScreen->myNum)) - { - REGION_INTERSECT(pScreen, pReg, &pWin->borderClip, &pWin->winSize); - } - return(pReg); -} - -void -SendVisibilityNotify(pWin) - WindowPtr pWin; -{ - xEvent event; - unsigned int visibility = pWin->visibility; - -#ifdef PANORAMIX - /* This is not quite correct yet, but it's close */ - if(!noPanoramiXExtension) { - PanoramiXRes *win; - WindowPtr pWin2; - int i, Scrnum; - - Scrnum = pWin->drawable.pScreen->myNum; - - win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, Scrnum); - - if(!win || (win->u.win.visibility == visibility)) - return; - - switch(visibility) { - case VisibilityUnobscured: - for(i = 0; i < PanoramiXNumScreens; i++) { - if(i == Scrnum) continue; - - pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); - - if (pWin2) { - if(pWin2->visibility == VisibilityPartiallyObscured) - return; - - if(!i) pWin = pWin2; - } - } - break; - case VisibilityPartiallyObscured: - if(Scrnum) { - pWin2 = (WindowPtr)LookupIDByType(win->info[0].id, RT_WINDOW); - if (pWin2) pWin = pWin2; - } - break; - case VisibilityFullyObscured: - for(i = 0; i < PanoramiXNumScreens; i++) { - if(i == Scrnum) continue; - - pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); - - if (pWin2) { - if(pWin2->visibility != VisibilityFullyObscured) - return; - - if(!i) pWin = pWin2; - } - } - break; - } - - win->u.win.visibility = visibility; - } -#endif - - event.u.u.type = VisibilityNotify; - event.u.visibility.window = pWin->drawable.id; - event.u.visibility.state = visibility; - DeliverEvents(pWin, &event, 1, NullWindow); -} - - -#define RANDOM_WIDTH 32 - -#ifndef NOLOGOHACK -static void DrawLogo( -#if NeedFunctionPrototypes - WindowPtr /*pWin*/ -#endif -); -#endif - -void -SaveScreens(on, mode) - int on; - int mode; -{ - int i; - int what; - int type; - - if (on == SCREEN_SAVER_FORCER) - { - UpdateCurrentTimeIf(); - lastDeviceEventTime = currentTime; - if (mode == ScreenSaverReset) - what = SCREEN_SAVER_OFF; - else - what = SCREEN_SAVER_ON; - type = what; - } - else - { - what = on; - type = what; - if (what == screenIsSaved) - type = SCREEN_SAVER_CYCLE; - } - for (i = 0; i < screenInfo.numScreens; i++) - { - if (on == SCREEN_SAVER_FORCER) - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], on); - if (savedScreenInfo[i].ExternalScreenSaver) - { - if ((*savedScreenInfo[i].ExternalScreenSaver) - (screenInfo.screens[i], type, on == SCREEN_SAVER_FORCER)) - continue; - } - if (type == screenIsSaved) - continue; - switch (type) { - case SCREEN_SAVER_OFF: - if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED) - { - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], - what); - } - else if (HasSaverWindow (i)) - { - savedScreenInfo[i].pWindow = NullWindow; - FreeResource(savedScreenInfo[i].wid, RT_NONE); - } - break; - case SCREEN_SAVER_CYCLE: - if (savedScreenInfo[i].blanked == SCREEN_IS_TILED) - { - WindowPtr pWin = savedScreenInfo[i].pWindow; - /* make it look like screen saver is off, so that - * NotClippedByChildren will compute a clip list - * for the root window, so miPaintWindow works - */ - screenIsSaved = SCREEN_SAVER_OFF; -#ifndef NOLOGOHACK - if (logoScreenSaver) - (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, FALSE); -#endif - (*pWin->drawable.pScreen->MoveWindow)(pWin, - (short)(-(rand() % RANDOM_WIDTH)), - (short)(-(rand() % RANDOM_WIDTH)), - pWin->nextSib, VTMove); -#ifndef NOLOGOHACK - if (logoScreenSaver) - DrawLogo(pWin); -#endif - screenIsSaved = SCREEN_SAVER_ON; - } - /* - * Call the DDX saver in case it wants to do something - * at cycle time - */ - else if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED) - { - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], - type); - } - break; - case SCREEN_SAVER_ON: - if (ScreenSaverBlanking != DontPreferBlanking) - { - if ((* screenInfo.screens[i]->SaveScreen) - (screenInfo.screens[i], what)) - { - savedScreenInfo[i].blanked = SCREEN_IS_BLANKED; - continue; - } - if ((ScreenSaverAllowExposures != DontAllowExposures) && - TileScreenSaver(i, SCREEN_IS_BLACK)) - { - savedScreenInfo[i].blanked = SCREEN_IS_BLACK; - continue; - } - } - if ((ScreenSaverAllowExposures != DontAllowExposures) && - TileScreenSaver(i, SCREEN_IS_TILED)) - { - savedScreenInfo[i].blanked = SCREEN_IS_TILED; - } - else - savedScreenInfo[i].blanked = SCREEN_ISNT_SAVED; - break; - } - } - screenIsSaved = what; -} - -static Bool -#if NeedFunctionPrototypes -TileScreenSaver(int i, int kind) -#else -TileScreenSaver(i, kind) - int i; - int kind; -#endif -{ - int j; - int result; - XID attributes[3]; - Mask mask; - WindowPtr pWin; - CursorMetricRec cm; - unsigned char *srcbits, *mskbits; - CursorPtr cursor; - XID cursorID = 0; - int attri; - - mask = 0; - attri = 0; - switch (kind) { - case SCREEN_IS_TILED: - switch (WindowTable[i]->backgroundState) { - case BackgroundPixel: - attributes[attri++] = WindowTable[i]->background.pixel; - mask |= CWBackPixel; - break; - case BackgroundPixmap: - attributes[attri++] = None; - mask |= CWBackPixmap; - break; - default: - break; - } - break; - case SCREEN_IS_BLACK: - attributes[attri++] = WindowTable[i]->drawable.pScreen->blackPixel; - mask |= CWBackPixel; - break; - } - mask |= CWOverrideRedirect; - attributes[attri++] = xTrue; - - /* - * create a blank cursor - */ - - cm.width=16; - cm.height=16; - cm.xhot=8; - cm.yhot=8; - srcbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); - mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); - if (!srcbits || !mskbits) - { - xfree(srcbits); - xfree(mskbits); - cursor = 0; - } - else - { - for (j=0; jwidth + RANDOM_WIDTH, - (unsigned short)screenInfo.screens[i]->height + RANDOM_WIDTH, - 0, InputOutput, mask, attributes, 0, serverClient, - wVisual (WindowTable[i]), &result); - - if (cursor) - FreeResource (cursorID, RT_NONE); - - if (!pWin) - return FALSE; - - if (!AddResource(pWin->drawable.id, RT_WINDOW, - (pointer)savedScreenInfo[i].pWindow)) - return FALSE; - - if (mask & CWBackPixmap) - { - MakeRootTile (pWin); - (*pWin->drawable.pScreen->ChangeWindowAttributes)(pWin, CWBackPixmap); - } - MapWindow(pWin, serverClient); -#ifndef NOLOGOHACK - if (kind == SCREEN_IS_TILED && logoScreenSaver) - DrawLogo(pWin); -#endif - return TRUE; -} - -/* - * FindWindowWithOptional - * - * search ancestors of the given window for an entry containing - * a WindowOpt structure. Assumptions: some parent will - * contain the structure. - */ - -WindowPtr -FindWindowWithOptional (w) - register WindowPtr w; -{ - do - w = w->parent; - while (!w->optional); - return w; -} - -/* - * CheckWindowOptionalNeed - * - * check each optional entry in the given window to see if - * the value is satisfied by the default rules. If so, - * release the optional record - */ - -void -CheckWindowOptionalNeed (w) - register WindowPtr w; -{ - register WindowOptPtr optional; - register WindowOptPtr parentOptional; - - if (!w->parent) - return; - optional = w->optional; - if (optional->dontPropagateMask != DontPropagateMasks[w->dontPropagate]) - return; - if (optional->otherEventMasks != 0) - return; - if (optional->otherClients != NULL) - return; - if (optional->passiveGrabs != NULL) - return; - if (optional->userProps != NULL) - return; - if (optional->backingBitPlanes != ~0L) - return; - if (optional->backingPixel != 0) - return; -#ifdef SHAPE - if (optional->boundingShape != NULL) - return; - if (optional->clipShape != NULL) - return; -#endif -#ifdef XINPUT - if (optional->inputMasks != NULL) - return; -#endif - parentOptional = FindWindowWithOptional(w)->optional; - if (optional->visual != parentOptional->visual) - return; - if (optional->cursor != None && - (optional->cursor != parentOptional->cursor || - w->parent->cursorIsNone)) - return; - if (optional->colormap != parentOptional->colormap) - return; - DisposeWindowOptional (w); -} - -/* - * MakeWindowOptional - * - * create an optional record and initialize it with the default - * values. - */ - -Bool -MakeWindowOptional (pWin) - register WindowPtr pWin; -{ - register WindowOptPtr optional; - register WindowOptPtr parentOptional; - - if (pWin->optional) - return TRUE; - optional = (WindowOptPtr) xalloc (sizeof (WindowOptRec)); - if (!optional) - return FALSE; - optional->dontPropagateMask = DontPropagateMasks[pWin->dontPropagate]; - optional->otherEventMasks = 0; - optional->otherClients = NULL; - optional->passiveGrabs = NULL; - optional->userProps = NULL; - optional->backingBitPlanes = ~0L; - optional->backingPixel = 0; -#ifdef SHAPE - optional->boundingShape = NULL; - optional->clipShape = NULL; -#endif -#ifdef XINPUT - optional->inputMasks = NULL; -#endif - parentOptional = FindWindowWithOptional(pWin)->optional; - optional->visual = parentOptional->visual; - if (!pWin->cursorIsNone) - { - optional->cursor = parentOptional->cursor; - optional->cursor->refcnt++; - } - else - { - optional->cursor = None; - } - optional->colormap = parentOptional->colormap; - pWin->optional = optional; - return TRUE; -} - -void -DisposeWindowOptional (pWin) - register WindowPtr pWin; -{ - if (!pWin->optional) - return; - /* - * everything is peachy. Delete the optional record - * and clean up - */ - /* - * TOG changed this code to: - * - * if (pWin->cursorIsNone == FALSE) - * FreeCursor (pWin->optional->cursor, (Cursor)0); - * pWin->cursorIsNone = TRUE; - * - * This is blatently wrong; windows without optionals can have - * two different cursor values, either None or sharing their - * parents cursor. This difference is controlled by the - * cursorIsNone value; when TRUE, the window has no cursor, - * when false, it shares its cursor with its parent; TOG - * made it impossible for a window to have a cursor without - * an optional record. - */ - if (pWin->optional->cursor) - { - FreeCursor (pWin->optional->cursor, (Cursor)0); - pWin->cursorIsNone = FALSE; - } - else - pWin->cursorIsNone = TRUE; - xfree (pWin->optional); - pWin->optional = NULL; -} - -#ifndef NOLOGOHACK -static void -#if NeedFunctionPrototypes -DrawLogo(WindowPtr pWin) -#else -DrawLogo(pWin) - WindowPtr pWin; -#endif -{ - DrawablePtr pDraw; - ScreenPtr pScreen; - int x, y; - unsigned int width, height, size; - GC *pGC; - int thin, gap, d31; - DDXPointRec poly[4]; - ChangeGCVal fore[2], back[2]; - xrgb rgb[2]; - BITS32 fmask, bmask; - ColormapPtr cmap; - - pDraw = (DrawablePtr)pWin; - pScreen = pDraw->pScreen; - x = -pWin->origin.x; - y = -pWin->origin.y; - width = pScreen->width; - height = pScreen->height; - pGC = GetScratchGC(pScreen->rootDepth, pScreen); - if (!pGC) - return; - - if ((rand() % 100) <= 17) /* make the probability for white fairly low */ - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; - if ((pWin->backgroundState == BackgroundPixel) && - (cmap = (ColormapPtr)LookupIDByType(wColormap (pWin), RT_COLORMAP))) { - Pixel querypixels[2]; - - querypixels[0] = fore[0].val; - querypixels[1] = pWin->background.pixel; - QueryColors(cmap, 2, querypixels, rgb); - if ((rgb[0].red == rgb[1].red) && - (rgb[0].green == rgb[1].green) && - (rgb[0].blue == rgb[1].blue)) { - if (fore[0].val == pScreen->blackPixel) - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; - } - } - fore[1].val = FillSolid; - fmask = GCForeground|GCFillStyle; - if (pWin->backgroundState == BackgroundPixel) { - back[0].val = pWin->background.pixel; - back[1].val = FillSolid; - bmask = GCForeground|GCFillStyle; - } else { - back[0].val = 0; - back[1].val = 0; - dixChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, - NULL, back); - back[0].val = FillTiled; - back[1].ptr = pWin->background.pixmap; - bmask = GCFillStyle|GCTile; - } - - /* should be the same as the reference function XmuDrawLogo() */ - - size = width; - if (height < width) - size = height; - size = RANDOM_WIDTH + rand() % (size - RANDOM_WIDTH); - size &= ~1; - x += rand() % (width - size); - y += rand() % (height - size); - -/* - * Draw what will be the thin strokes. - * - * ----- - * / / - * / / - * / / - * / / - * /____/ - * d - * - * Point d is 9/44 (~1/5) of the way across. - */ - - thin = (size / 11); - if (thin < 1) thin = 1; - gap = (thin+3) / 4; - d31 = thin + thin + gap; - poly[0].x = x + size; poly[0].y = y; - poly[1].x = x + size-d31; poly[1].y = y; - poly[2].x = x + 0; poly[2].y = y + size; - poly[3].x = x + d31; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, fmask, NULL, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for lower thin stroke. - * - * ------ - * / / - * / __ / - * / / / - * / / / - * /__/__/ - */ - - poly[0].x = x + d31/2; poly[0].y = y + size; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + d31; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, bmask, NULL, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for upper thin stroke. - * - * ------ - * / / / - * /--/ / - * / / - * / / - * /_____/ - */ - - poly[0].x = x + size - d31/2; poly[0].y = y; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + size - d31; poly[3].y = y; - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Draw thick stroke. - * Point b is 1/4 of the way across. - * - * b - * ----- - * \ \ - * \ \ - * \ \ - * \ \ - * \____\ - */ - - poly[0].x = x; poly[0].y = y; - poly[1].x = x + size/4; poly[1].y = y; - poly[2].x = x + size; poly[2].y = y + size; - poly[3].x = x + size - size/4; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, fmask, NULL, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase to create gap. - * - * / - * / - * / - * / - * / - */ - - poly[0].x = x + size- thin; poly[0].y = y; - poly[1].x = x + size-( thin+gap); poly[1].y = y; - poly[2].x = x + thin; poly[2].y = y + size; - poly[3].x = x + thin + gap; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, bmask, NULL, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - - FreeScratchGC(pGC); -} - -#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c.NX.original deleted file mode 100644 index f3bfcf58a..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c.NX.original +++ /dev/null @@ -1,2277 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#if !defined(__sun) && !defined(__CYGWIN__) - -#include "X/NXxvdisp.c" - -#endif - -#else - -/*********************************************************** -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, -and the Massachusetts Institute of Technology, Cambridge, 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 names of Digital or MIT not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.25 2001/11/18 23:55:48 mvojkovi Exp $ */ - -/* -** File: -** -** xvdisp.c --- Xv server extension dispatch module. -** -** Author: -** -** David Carver (Digital Workstation Engineering/Project Athena) -** -** Revisions: -** -** 11.06.91 Carver -** - changed SetPortControl to SetPortAttribute -** - changed GetPortControl to GetPortAttribute -** - changed QueryBestSize -** -** 15.05.91 Carver -** - version 2.0 upgrade -** -** 24.01.91 Carver -** - version 1.4 upgrade -** -*/ - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "dixstruct.h" -#include "resource.h" -#include "opaque.h" - -#include "Xv.h" -#include "Xvproto.h" -#include "xvdix.h" -#ifdef MITSHM -#define _XSHM_SERVER_ -#include "shmstr.h" -#endif - -#include "Trap.h" - -#undef TEST -#undef DEBUG - -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - -unsigned long XvXRTPort; - -#ifdef MITSHM -static int XineramaXvShmPutImage(ClientPtr); -#endif -static int XineramaXvPutImage(ClientPtr); -static int XineramaXvPutVideo(ClientPtr); -static int XineramaXvPutStill(ClientPtr); -static int XineramaXvSetPortAttribute(ClientPtr); -static int XineramaXvStopVideo(ClientPtr); -#endif - -/* INTERNAL */ - -static int ProcXvQueryExtension(ClientPtr); -static int ProcXvQueryAdaptors(ClientPtr); -static int ProcXvQueryEncodings(ClientPtr); -static int ProcXvPutVideo(ClientPtr); -static int ProcXvPutStill(ClientPtr); -static int ProcXvGetVideo(ClientPtr); -static int ProcXvGetStill(ClientPtr); -static int ProcXvGrabPort(ClientPtr); -static int ProcXvUngrabPort(ClientPtr); -static int ProcXvSelectVideoNotify(ClientPtr); -static int ProcXvSelectPortNotify(ClientPtr); -static int ProcXvStopVideo(ClientPtr); -static int ProcXvSetPortAttribute(ClientPtr); -static int ProcXvGetPortAttribute(ClientPtr); -static int ProcXvQueryBestSize(ClientPtr); -static int ProcXvQueryPortAttributes(ClientPtr); -static int ProcXvPutImage(ClientPtr); -#ifdef MITSHM -static int ProcXvShmPutImage(ClientPtr); -#endif -static int ProcXvQueryImageAttributes(ClientPtr); -static int ProcXvListImageFormats(ClientPtr); - -static int SProcXvQueryExtension(ClientPtr); -static int SProcXvQueryAdaptors(ClientPtr); -static int SProcXvQueryEncodings(ClientPtr); -static int SProcXvPutVideo(ClientPtr); -static int SProcXvPutStill(ClientPtr); -static int SProcXvGetVideo(ClientPtr); -static int SProcXvGetStill(ClientPtr); -static int SProcXvGrabPort(ClientPtr); -static int SProcXvUngrabPort(ClientPtr); -static int SProcXvSelectVideoNotify(ClientPtr); -static int SProcXvSelectPortNotify(ClientPtr); -static int SProcXvStopVideo(ClientPtr); -static int SProcXvSetPortAttribute(ClientPtr); -static int SProcXvGetPortAttribute(ClientPtr); -static int SProcXvQueryBestSize(ClientPtr); -static int SProcXvQueryPortAttributes(ClientPtr); -static int SProcXvPutImage(ClientPtr); -#ifdef MITSHM -static int SProcXvShmPutImage(ClientPtr); -#endif -static int SProcXvQueryImageAttributes(ClientPtr); -static int SProcXvListImageFormats(ClientPtr); - -static int SWriteQueryAdaptorsReply(ClientPtr, xvQueryAdaptorsReply *); -static int SWriteQueryExtensionReply(ClientPtr, xvQueryExtensionReply *); -static int SWriteQueryEncodingsReply(ClientPtr, xvQueryEncodingsReply *); -static int SWriteAdaptorInfo(ClientPtr, xvAdaptorInfo *); -static int SWriteEncodingInfo(ClientPtr, xvEncodingInfo *); -static int SWriteFormat(ClientPtr, xvFormat *); -static int SWriteAttributeInfo(ClientPtr, xvAttributeInfo *); -static int SWriteGrabPortReply(ClientPtr, xvGrabPortReply *); -static int SWriteGetPortAttributeReply(ClientPtr, xvGetPortAttributeReply *); -static int SWriteQueryBestSizeReply(ClientPtr, xvQueryBestSizeReply *); -static int SWriteQueryPortAttributesReply( - ClientPtr, xvQueryPortAttributesReply *); -static int SWriteQueryImageAttributesReply( - ClientPtr, xvQueryImageAttributesReply*); -static int SWriteListImageFormatsReply(ClientPtr, xvListImageFormatsReply*); -static int SWriteImageFormatInfo(ClientPtr, xvImageFormatInfo*); - -#define _WriteQueryAdaptorsReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryAdaptorsReply, (char*)_d) - -#define _WriteQueryExtensionReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryExtensionReply, (char*)_d) - -#define _WriteQueryEncodingsReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryEncodingsReply, (char*)_d) - -#define _WriteAdaptorInfo(_c,_d) \ - if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAdaptorInfo, (char*)_d) - -#define _WriteAttributeInfo(_c,_d) \ - if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAttributeInfo, (char*)_d) - -#define _WriteEncodingInfo(_c,_d) \ - if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \ - else WriteToClient(_c, sz_xvEncodingInfo, (char*)_d) - -#define _WriteFormat(_c,_d) \ - if ((_c)->swapped) SWriteFormat(_c, _d); \ - else WriteToClient(_c, sz_xvFormat, (char*)_d) - -#define _WriteGrabPortReply(_c,_d) \ - if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \ - else WriteToClient(_c, sz_xvGrabPortReply, (char*)_d) - -#define _WriteGetPortAttributeReply(_c,_d) \ - if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \ - else WriteToClient(_c, sz_xvGetPortAttributeReply, (char*)_d) - -#define _WriteQueryBestSizeReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryBestSizeReply,(char*) _d) - -#define _WriteQueryPortAttributesReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryPortAttributesReply,(char*) _d) - -#define _WriteQueryImageAttributesReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryImageAttributesReply,(char*) _d) - -#define _WriteListImageFormatsReply(_c,_d) \ - if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \ - else WriteToClient(_c, sz_xvListImageFormatsReply,(char*) _d) - -#define _WriteImageFormatInfo(_c,_d) \ - if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \ - else WriteToClient(_c, sz_xvImageFormatInfo, (char*)_d) - -#define _AllocatePort(_i,_p) \ - ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success - -/* -** ProcXvDispatch -** -** -** -*/ - -int -ProcXvDispatch(ClientPtr client) -{ - int result; - - REQUEST(xReq); - - UpdateCurrentTime(); - - /* - * Report upstream that we are - * dispatching a XVideo operation. - */ - - nxagentXvTrap = 1; - - #ifdef TEST - fprintf(stderr, "ProcXvDispatch: Going to dispatch XVideo operation [%d] for client [%d].\n", - stuff->data, client -> index); - #endif - - switch (stuff->data) - { - case xv_QueryExtension: result = (ProcXvQueryExtension(client)); break; - case xv_QueryAdaptors: result = (ProcXvQueryAdaptors(client)); break; - case xv_QueryEncodings: result = (ProcXvQueryEncodings(client)); break; - case xv_PutVideo: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvPutVideo(client)); break; - else -#endif - result = (ProcXvPutVideo(client)); break; - case xv_PutStill: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvPutStill(client)); break - else -#endif - result = (ProcXvPutStill(client)); break; - case xv_GetVideo: result = (ProcXvGetVideo(client)); break; - case xv_GetStill: result = (ProcXvGetStill(client)); break; - case xv_GrabPort: result = (ProcXvGrabPort(client)); break; - case xv_UngrabPort: result = (ProcXvUngrabPort(client)); break; - case xv_SelectVideoNotify: result = (ProcXvSelectVideoNotify(client)); break; - case xv_SelectPortNotify: result = (ProcXvSelectPortNotify(client)); break; - case xv_StopVideo: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvStopVideo(client)); break; - else -#endif - result = (ProcXvStopVideo(client)); break; - case xv_SetPortAttribute: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvSetPortAttribute(client)); break; - else -#endif - result = (ProcXvSetPortAttribute(client)); break; - case xv_GetPortAttribute: result = (ProcXvGetPortAttribute(client)); break; - case xv_QueryBestSize: result = (ProcXvQueryBestSize(client)); break; - case xv_QueryPortAttributes: result = (ProcXvQueryPortAttributes(client)); break; - case xv_PutImage: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvPutImage(client)); break; - else -#endif - result = (ProcXvPutImage(client)); break; -#ifdef MITSHM - case xv_ShmPutImage: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvShmPutImage(client)); break; - else -#endif - result = (ProcXvShmPutImage(client)); break; -#endif - case xv_QueryImageAttributes: result = (ProcXvQueryImageAttributes(client)); break; - case xv_ListImageFormats: result = (ProcXvListImageFormats(client)); break; - default: - if (stuff->data < xvNumRequests) - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, - BadImplementation); - result = (BadImplementation); break; - } - else - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); - result = (BadRequest); break; - } - } - - nxagentXvTrap = 0; - - #ifdef TEST - fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", - stuff->data, client -> index); - #endif - - return result; -} - -int -SProcXvDispatch(ClientPtr client) -{ - int result; - - REQUEST(xReq); - - UpdateCurrentTime(); - - /* - * Report upstream that we are - * dispatching a XVideo operation. - */ - - nxagentXvTrap = 1; - - #ifdef TEST - fprintf(stderr, "SProcXvDispatch: Going to dispatch XVideo operation [%d] for client [%d].\n", - stuff->data, client -> index); - #endif - - switch (stuff->data) - { - case xv_QueryExtension: result = (SProcXvQueryExtension(client)); break; - case xv_QueryAdaptors: result = (SProcXvQueryAdaptors(client)); break; - case xv_QueryEncodings: result = (SProcXvQueryEncodings(client)); break; - case xv_PutVideo: result = (SProcXvPutVideo(client)); break; - case xv_PutStill: result = (SProcXvPutStill(client)); break; - case xv_GetVideo: result = (SProcXvGetVideo(client)); break; - case xv_GetStill: result = (SProcXvGetStill(client)); break; - case xv_GrabPort: result = (SProcXvGrabPort(client)); break; - case xv_UngrabPort: result = (SProcXvUngrabPort(client)); break; - case xv_SelectVideoNotify: result = (SProcXvSelectVideoNotify(client)); break; - case xv_SelectPortNotify: result = (SProcXvSelectPortNotify(client)); break; - case xv_StopVideo: result = (SProcXvStopVideo(client)); break; - case xv_SetPortAttribute: result = (SProcXvSetPortAttribute(client)); break; - case xv_GetPortAttribute: result = (SProcXvGetPortAttribute(client)); break; - case xv_QueryBestSize: result = (SProcXvQueryBestSize(client)); break; - case xv_QueryPortAttributes: result = (SProcXvQueryPortAttributes(client)); break; - case xv_PutImage: result = (SProcXvPutImage(client)); break; -#ifdef MITSHM - case xv_ShmPutImage: result = (SProcXvShmPutImage(client)); break; -#endif - case xv_QueryImageAttributes: result = (SProcXvQueryImageAttributes(client)); break; - case xv_ListImageFormats: result = (SProcXvListImageFormats(client)); break; - default: - if (stuff->data < xvNumRequests) - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, - BadImplementation); - result = (BadImplementation); break; - } - else - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); - result = (BadRequest); break; - } - } - - nxagentXvTrap = 0; - - #ifdef TEST - fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", - stuff->data, client -> index); - #endif - - return result; -} - -static int -ProcXvQueryExtension(ClientPtr client) -{ - xvQueryExtensionReply rep; - /* REQUEST(xvQueryExtensionReq); */ - REQUEST_SIZE_MATCH(xvQueryExtensionReq); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.version = XvVersion; - rep.revision = XvRevision; - - _WriteQueryExtensionReply(client, &rep); - - return Success; - -} - -static int -ProcXvQueryAdaptors(ClientPtr client) -{ - xvFormat format; - xvAdaptorInfo ainfo; - xvQueryAdaptorsReply rep; - int totalSize; - int na; - XvAdaptorPtr pa; - int nf; - XvFormatPtr pf; - WindowPtr pWin; - ScreenPtr pScreen; - XvScreenPtr pxvs; - - REQUEST(xvQueryAdaptorsReq); - REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); - - if(!(pWin = (WindowPtr)LookupWindow(stuff->window, client) )) - { - client->errorValue = stuff->window; - return (BadWindow); - } - - pScreen = pWin->drawable.pScreen; - pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr; - - if (!pxvs) - { - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = 0; - rep.length = 0; - - _WriteQueryAdaptorsReply(client, &rep); - - return Success; - } - - (* pxvs->ddQueryAdaptors)(pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = pxvs->nAdaptors; - - /* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */ - - totalSize = pxvs->nAdaptors * sz_xvAdaptorInfo; - - /* FOR EACH ADPATOR ADD UP THE BYTES FOR ENCODINGS AND FORMATS */ - - na = pxvs->nAdaptors; - pa = pxvs->pAdaptors; - while (na--) - { - totalSize += (strlen(pa->name) + 3) & ~3; - totalSize += pa->nFormats * sz_xvFormat; - pa++; - } - - rep.length = totalSize >> 2; - - _WriteQueryAdaptorsReply(client, &rep); - - na = pxvs->nAdaptors; - pa = pxvs->pAdaptors; - while (na--) - { - - ainfo.base_id = pa->base_id; - ainfo.num_ports = pa->nPorts; - ainfo.type = pa->type; - ainfo.name_size = strlen(pa->name); - ainfo.num_formats = pa->nFormats; - - _WriteAdaptorInfo(client, &ainfo); - - WriteToClient(client, ainfo.name_size, pa->name); - - nf = pa->nFormats; - pf = pa->pFormats; - while (nf--) - { - format.depth = pf->depth; - format.visual = pf->visual; - _WriteFormat(client, &format); - pf++; - } - - pa++; - - } - - return (client->noClientException); - -} - -static int -ProcXvQueryEncodings(ClientPtr client) -{ - xvEncodingInfo einfo; - xvQueryEncodingsReply rep; - int totalSize; - XvPortPtr pPort; - int ne; - XvEncodingPtr pe; - int status; - - REQUEST(xvQueryEncodingsReq); - REQUEST_SIZE_MATCH(xvQueryEncodingsReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_encodings = pPort->pAdaptor->nEncodings; - - /* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */ - - ne = pPort->pAdaptor->nEncodings; - pe = pPort->pAdaptor->pEncodings; - totalSize = ne * sz_xvEncodingInfo; - while (ne--) - { - totalSize += (strlen(pe->name) + 3) & ~3; - pe++; - } - - rep.length = totalSize >> 2; - - _WriteQueryEncodingsReply(client, &rep); - - ne = pPort->pAdaptor->nEncodings; - pe = pPort->pAdaptor->pEncodings; - while (ne--) - { - einfo.encoding = pe->id; - einfo.name_size = strlen(pe->name); - einfo.width = pe->width; - einfo.height = pe->height; - einfo.rate.numerator = pe->rate.numerator; - einfo.rate.denominator = pe->rate.denominator; - _WriteEncodingInfo(client, &einfo); - WriteToClient(client, einfo.name_size, pe->name); - pe++; - } - - return (client->noClientException); - -} - -static int -ProcXvPutVideo(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvPutVideoReq); - REQUEST_SIZE_MATCH(xvPutVideoReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvInputMask) || - !(pPort->pAdaptor->type & XvVideoMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diPutVideo)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - -static int -ProcXvPutStill(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvPutStillReq); - REQUEST_SIZE_MATCH(xvPutStillReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvInputMask) || - !(pPort->pAdaptor->type & XvStillMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diPutStill)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - - -static int -ProcXvGetVideo(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvGetVideoReq); - REQUEST_SIZE_MATCH(xvGetVideoReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvOutputMask) || - !(pPort->pAdaptor->type & XvVideoMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diGetVideo)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - - -static int -ProcXvGetStill(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvGetStillReq); - REQUEST_SIZE_MATCH(xvGetStillReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvOutputMask) || - !(pPort->pAdaptor->type & XvStillMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diGetStill)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - -static int -ProcXvSelectVideoNotify(ClientPtr client) -{ - register DrawablePtr pDraw; - REQUEST(xvSelectVideoNotifyReq); - REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); - - if(!(pDraw = (DrawablePtr)LOOKUP_DRAWABLE(stuff->drawable, client) )) - { - client->errorValue = stuff->drawable; - return (BadWindow); - } - - return XVCALL(diSelectVideoNotify)(client, pDraw, stuff->onoff); - -} - -static int -ProcXvSelectPortNotify(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvSelectPortNotifyReq); - REQUEST_SIZE_MATCH(xvSelectPortNotifyReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - return XVCALL(diSelectPortNotify)(client, pPort, stuff->onoff); - -} - -static int -ProcXvGrabPort(ClientPtr client) -{ - int result, status; - XvPortPtr pPort; - xvGrabPortReply rep; - REQUEST(xvGrabPortReq); - REQUEST_SIZE_MATCH(xvGrabPortReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - status = XVCALL(diGrabPort)(client, pPort, stuff->time, &result); - - if (status != Success) - { - return status; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.result = result; - - _WriteGrabPortReply(client, &rep); - - return Success; - -} - -static int -ProcXvUngrabPort(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvGrabPortReq); - REQUEST_SIZE_MATCH(xvGrabPortReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - return XVCALL(diUngrabPort)(client, pPort, stuff->time); - -} - - -static int -ProcXvStopVideo(ClientPtr client) -{ - int status; - register DrawablePtr pDraw; - XvPortPtr pPort; - REQUEST(xvStopVideoReq); - REQUEST_SIZE_MATCH(xvStopVideoReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if(!(pDraw = LOOKUP_DRAWABLE(stuff->drawable, client) )) - { - client->errorValue = stuff->drawable; - return (BadDrawable); - } - - return XVCALL(diStopVideo)(client, pPort, pDraw); - -} - -static int -ProcXvSetPortAttribute(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvSetPortAttributeReq); - REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!ValidAtom(stuff->attribute)) - { - client->errorValue = stuff->attribute; - return(BadAtom); - } - - status = XVCALL(diSetPortAttribute)(client, pPort, - stuff->attribute, stuff->value); - - if (status == BadMatch) - client->errorValue = stuff->attribute; - else - client->errorValue = stuff->value; - - return status; -} - -static int -ProcXvGetPortAttribute(ClientPtr client) -{ - INT32 value; - int status; - XvPortPtr pPort; - xvGetPortAttributeReply rep; - REQUEST(xvGetPortAttributeReq); - REQUEST_SIZE_MATCH(xvGetPortAttributeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!ValidAtom(stuff->attribute)) - { - client->errorValue = stuff->attribute; - return(BadAtom); - } - - status = XVCALL(diGetPortAttribute)(client, pPort, stuff->attribute, &value); - if (status != Success) - { - client->errorValue = stuff->attribute; - return status; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.value = value; - - _WriteGetPortAttributeReply(client, &rep); - - return Success; -} - -static int -ProcXvQueryBestSize(ClientPtr client) -{ - int status; - unsigned int actual_width, actual_height; - XvPortPtr pPort; - xvQueryBestSizeReply rep; - REQUEST(xvQueryBestSizeReq); - REQUEST_SIZE_MATCH(xvQueryBestSizeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - - (* pPort->pAdaptor->ddQueryBestSize)(client, pPort, stuff->motion, - stuff->vid_w, stuff->vid_h, - stuff->drw_w, stuff->drw_h, - &actual_width, &actual_height); - - rep.actual_width = actual_width; - rep.actual_height = actual_height; - - _WriteQueryBestSizeReply(client, &rep); - - return Success; -} - - -static int -ProcXvQueryPortAttributes(ClientPtr client) -{ - int status, size, i; - XvPortPtr pPort; - XvAttributePtr pAtt; - xvQueryPortAttributesReply rep; - xvAttributeInfo Info; - REQUEST(xvQueryPortAttributesReq); - REQUEST_SIZE_MATCH(xvQueryPortAttributesReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_attributes = pPort->pAdaptor->nAttributes; - rep.text_size = 0; - - for(i = 0, pAtt = pPort->pAdaptor->pAttributes; - i < rep.num_attributes; i++, pAtt++) - { - rep.text_size += (strlen(pAtt->name) + 1 + 3) & ~3L; - } - - rep.length = (rep.num_attributes * sz_xvAttributeInfo) + rep.text_size; - rep.length >>= 2; - - _WriteQueryPortAttributesReply(client, &rep); - - for(i = 0, pAtt = pPort->pAdaptor->pAttributes; - i < rep.num_attributes; i++, pAtt++) - { - size = strlen(pAtt->name) + 1; /* pass the NULL */ - Info.flags = pAtt->flags; - Info.min = pAtt->min_value; - Info.max = pAtt->max_value; - Info.size = (size + 3) & ~3L; - - _WriteAttributeInfo(client, &Info); - - WriteToClient(client, size, pAtt->name); - } - - return Success; -} - - - -static int -ProcXvPutImage(ClientPtr client) -{ - DrawablePtr pDraw; - XvPortPtr pPort; - XvImagePtr pImage = NULL; - GCPtr pGC; - int status, i, size; - CARD16 width, height; - - REQUEST(xvPutImageReq); - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvImageMask) || - !(pPort->pAdaptor->type & XvInputMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - - if(!pImage) - return BadMatch; - - width = stuff->width; - height = stuff->height; - size = (*pPort->pAdaptor->ddQueryImageAttributes)(client, - pPort, pImage, &width, &height, NULL, NULL); - size += sizeof(xvPutImageReq); - size = (size + 3) >> 2; - - if((width < stuff->width) || (height < stuff->height)) - return BadValue; - - if(client->req_len < size) - return BadLength; - - return XVCALL(diPutImage)(client, pDraw, pPort, pGC, - stuff->src_x, stuff->src_y, - stuff->src_w, stuff->src_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h, - pImage, (unsigned char*)(&stuff[1]), FALSE, - stuff->width, stuff->height); -} - -#ifdef MITSHM -/* redefined here since it's not in any header file */ -typedef struct _ShmDesc { - struct _ShmDesc *next; - int shmid; - int refcnt; - char *addr; - Bool writable; - unsigned long size; -} ShmDescRec, *ShmDescPtr; - -extern RESTYPE ShmSegType; -extern int BadShmSegCode; -extern int ShmCompletionCode; - -static int -ProcXvShmPutImage(ClientPtr client) -{ - ShmDescPtr shmdesc; - DrawablePtr pDraw; - XvPortPtr pPort; - XvImagePtr pImage = NULL; - GCPtr pGC; - int status, size_needed, i; - CARD16 width, height; - - REQUEST(xvShmPutImageReq); - REQUEST_SIZE_MATCH(xvShmPutImageReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvImageMask) || - !(pPort->pAdaptor->type & XvInputMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - - if(!pImage) - return BadMatch; - - if(!(shmdesc = (ShmDescPtr)LookupIDByType(stuff->shmseg, ShmSegType))) - { - client->errorValue = stuff->shmseg; - return BadShmSegCode; - } - - width = stuff->width; - height = stuff->height; - size_needed = (*pPort->pAdaptor->ddQueryImageAttributes)(client, - pPort, pImage, &width, &height, NULL, NULL); - if((size_needed + stuff->offset) > shmdesc->size) - return BadAccess; - - if((width < stuff->width) || (height < stuff->height)) - return BadValue; - - status = XVCALL(diPutImage)(client, pDraw, pPort, pGC, - stuff->src_x, stuff->src_y, - stuff->src_w, stuff->src_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h, pImage, - (unsigned char *)shmdesc->addr + stuff->offset, - stuff->send_event, stuff->width, stuff->height); - - if((status == Success) && stuff->send_event) { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.sequenceNumber = client->sequence; - ev.minorEvent = xv_ShmPutImage; - ev.majorEvent = XvReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; - WriteEventsToClient(client, 1, (xEvent *) &ev); - } - - return status; -} -#endif - -#ifdef XvMCExtension -XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id); -#endif - -static int -ProcXvQueryImageAttributes(ClientPtr client) -{ - xvQueryImageAttributesReply rep; - int size, num_planes, i; - CARD16 width, height; - XvImagePtr pImage = NULL; - XvPortPtr pPort; - int *offsets; - int *pitches; - REQUEST(xvQueryImageAttributesReq); - - REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - -#ifdef XvMCExtension - if(!pImage) - pImage = XvMCFindXvImage(pPort, stuff->id); -#endif - - if(!pImage) - return BadMatch; - - num_planes = pImage->num_planes; - - if(!(offsets = xalloc(num_planes << 3))) - return BadAlloc; - pitches = offsets + num_planes; - - width = stuff->width; - height = stuff->height; - - size = (*pPort->pAdaptor->ddQueryImageAttributes)(client, pPort, pImage, - &width, &height, offsets, pitches); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = num_planes << 1; - rep.num_planes = num_planes; - rep.width = width; - rep.height = height; - rep.data_size = size; - - _WriteQueryImageAttributesReply(client, &rep); - if(client->swapped) - SwapLongs((CARD32*)offsets, rep.length); - WriteToClient(client, rep.length << 2, (char*)offsets); - - xfree(offsets); - - return Success; -} - -static int -ProcXvListImageFormats(ClientPtr client) -{ - XvPortPtr pPort; - XvImagePtr pImage; - int i; - xvListImageFormatsReply rep; - xvImageFormatInfo info; - REQUEST(xvListImageFormatsReq); - - REQUEST_SIZE_MATCH(xvListImageFormatsReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_formats = pPort->pAdaptor->nImages; - rep.length = rep.num_formats * sz_xvImageFormatInfo >> 2; - - _WriteListImageFormatsReply(client, &rep); - - pImage = pPort->pAdaptor->pImages; - - for(i = 0; i < rep.num_formats; i++, pImage++) { - info.id = pImage->id; - info.type = pImage->type; - info.byte_order = pImage->byte_order; - memcpy(&info.guid, pImage->guid, 16); - info.bpp = pImage->bits_per_pixel; - info.num_planes = pImage->num_planes; - info.depth = pImage->depth; - info.red_mask = pImage->red_mask; - info.green_mask = pImage->green_mask; - info.blue_mask = pImage->blue_mask; - info.format = pImage->format; - info.y_sample_bits = pImage->y_sample_bits; - info.u_sample_bits = pImage->u_sample_bits; - info.v_sample_bits = pImage->v_sample_bits; - info.horz_y_period = pImage->horz_y_period; - info.horz_u_period = pImage->horz_u_period; - info.horz_v_period = pImage->horz_v_period; - info.vert_y_period = pImage->vert_y_period; - info.vert_u_period = pImage->vert_u_period; - info.vert_v_period = pImage->vert_v_period; - memcpy(&info.comp_order, pImage->component_order, 32); - info.scanline_order = pImage->scanline_order; - _WriteImageFormatInfo(client, &info); - } - - return Success; -} - - - -/* Swapped Procs */ - -static int -SProcXvQueryExtension(ClientPtr client) -{ - register char n; - REQUEST(xvQueryExtensionReq); - swaps(&stuff->length, n); - return ProcXvQueryExtension(client); -} - -static int -SProcXvQueryAdaptors(ClientPtr client) -{ - register char n; - REQUEST(xvQueryAdaptorsReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcXvQueryAdaptors(client); -} - -static int -SProcXvQueryEncodings(ClientPtr client) -{ - register char n; - REQUEST(xvQueryEncodingsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvQueryEncodings(client); -} - -static int -SProcXvGrabPort(ClientPtr client) -{ - register char n; - REQUEST(xvGrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); - return ProcXvGrabPort(client); -} - -static int -SProcXvUngrabPort(ClientPtr client) -{ - register char n; - REQUEST(xvUngrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); - return ProcXvUngrabPort(client); -} - -static int -SProcXvPutVideo(ClientPtr client) -{ - register char n; - REQUEST(xvPutVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvPutVideo(client); -} - -static int -SProcXvPutStill(ClientPtr client) -{ - register char n; - REQUEST(xvPutStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvPutStill(client); -} - -static int -SProcXvGetVideo(ClientPtr client) -{ - register char n; - REQUEST(xvGetVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvGetVideo(client); -} - -static int -SProcXvGetStill(ClientPtr client) -{ - register char n; - REQUEST(xvGetStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvGetStill(client); -} - -static int -SProcXvPutImage(ClientPtr client) -{ - register char n; - REQUEST(xvPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->id, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return ProcXvPutImage(client); -} - -#ifdef MITSHM -static int -SProcXvShmPutImage(ClientPtr client) -{ - register char n; - REQUEST(xvShmPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->id, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->offset, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return ProcXvShmPutImage(client); -} -#endif - - -static int -SProcXvSelectVideoNotify(ClientPtr client) -{ - register char n; - REQUEST(xvSelectVideoNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - return ProcXvSelectVideoNotify(client); -} - -static int -SProcXvSelectPortNotify(ClientPtr client) -{ - register char n; - REQUEST(xvSelectPortNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvSelectPortNotify(client); -} - -static int -SProcXvStopVideo(ClientPtr client) -{ - register char n; - REQUEST(xvStopVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - return ProcXvStopVideo(client); -} - -static int -SProcXvSetPortAttribute(ClientPtr client) -{ - register char n; - REQUEST(xvSetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); - return ProcXvSetPortAttribute(client); -} - -static int -SProcXvGetPortAttribute(ClientPtr client) -{ - register char n; - REQUEST(xvGetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); - return ProcXvGetPortAttribute(client); -} - -static int -SProcXvQueryBestSize(ClientPtr client) -{ - register char n; - REQUEST(xvQueryBestSizeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvQueryBestSize(client); -} - -static int -SProcXvQueryPortAttributes(ClientPtr client) -{ - register char n; - REQUEST(xvQueryPortAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvQueryPortAttributes(client); -} - -static int -SProcXvQueryImageAttributes(ClientPtr client) -{ - register char n; - REQUEST(xvQueryImageAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->id, n); - swaps(&stuff->width, n); - swaps(&stuff->width, n); - return ProcXvQueryImageAttributes(client); -} - -static int -SProcXvListImageFormats(ClientPtr client) -{ - register char n; - REQUEST(xvListImageFormatsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvListImageFormats(client); -} - - -static int -SWriteQueryExtensionReply( - ClientPtr client, - xvQueryExtensionReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->version, n); - swaps(&rep->revision, n); - - (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryAdaptorsReply( - ClientPtr client, - xvQueryAdaptorsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_adaptors, n); - - (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryEncodingsReply( - ClientPtr client, - xvQueryEncodingsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_encodings, n); - - (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep); - - return Success; -} - -static int -SWriteAdaptorInfo( - ClientPtr client, - xvAdaptorInfo *pAdaptor -){ - register char n; - - swapl(&pAdaptor->base_id, n); - swaps(&pAdaptor->name_size, n); - swaps(&pAdaptor->num_ports, n); - swaps(&pAdaptor->num_formats, n); - - (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor); - - return Success; -} - -static int -SWriteEncodingInfo( - ClientPtr client, - xvEncodingInfo *pEncoding -){ - register char n; - - swapl(&pEncoding->encoding, n); - swaps(&pEncoding->name_size, n); - swaps(&pEncoding->width, n); - swaps(&pEncoding->height, n); - swapl(&pEncoding->rate.numerator, n); - swapl(&pEncoding->rate.denominator, n); - (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding); - - return Success; -} - -static int -SWriteFormat( - ClientPtr client, - xvFormat *pFormat -){ - register char n; - - swapl(&pFormat->visual, n); - (void)WriteToClient(client, sz_xvFormat, (char *)pFormat); - - return Success; -} - -static int -SWriteAttributeInfo( - ClientPtr client, - xvAttributeInfo *pAtt -){ - register char n; - - swapl(&pAtt->flags, n); - swapl(&pAtt->size, n); - swapl(&pAtt->min, n); - swapl(&pAtt->max, n); - (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt); - - return Success; -} - -static int -SWriteImageFormatInfo( - ClientPtr client, - xvImageFormatInfo *pImage -){ - register char n; - - swapl(&pImage->id, n); - swapl(&pImage->red_mask, n); - swapl(&pImage->green_mask, n); - swapl(&pImage->blue_mask, n); - swapl(&pImage->y_sample_bits, n); - swapl(&pImage->u_sample_bits, n); - swapl(&pImage->v_sample_bits, n); - swapl(&pImage->horz_y_period, n); - swapl(&pImage->horz_u_period, n); - swapl(&pImage->horz_v_period, n); - swapl(&pImage->vert_y_period, n); - swapl(&pImage->vert_u_period, n); - swapl(&pImage->vert_v_period, n); - - (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage); - - return Success; -} - - - -static int -SWriteGrabPortReply( - ClientPtr client, - xvGrabPortReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - - (void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep); - - return Success; -} - -static int -SWriteGetPortAttributeReply( - ClientPtr client, - xvGetPortAttributeReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->value, n); - - (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryBestSizeReply( - ClientPtr client, - xvQueryBestSizeReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->actual_width, n); - swaps(&rep->actual_height, n); - - (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryPortAttributesReply( - ClientPtr client, - xvQueryPortAttributesReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_attributes, n); - swapl(&rep->text_size, n); - - (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryImageAttributesReply( - ClientPtr client, - xvQueryImageAttributesReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_planes, n); - swapl(&rep->data_size, n); - swaps(&rep->width, n); - swaps(&rep->height, n); - - (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep); - - return Success; -} - - -static int -SWriteListImageFormatsReply( - ClientPtr client, - xvListImageFormatsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_formats, n); - - (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep); - - return Success; -} - - -#ifdef PANORAMIX - - - - -static int -XineramaXvStopVideo(ClientPtr client) -{ - int result = Success, i; - PanoramiXRes *draw, *port; - REQUEST(xvStopVideoReq); - REQUEST_SIZE_MATCH(xvStopVideoReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - result = ProcXvStopVideo(client); - } - } - - return result; -} - -static int -XineramaXvSetPortAttribute(ClientPtr client) -{ - REQUEST(xvSetPortAttributeReq); - PanoramiXRes *port; - int result = Success, i; - - REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->port = port->info[i].id; - result = ProcXvSetPortAttribute(client); - } - } - return result; -} - - -#ifdef MITSHM -static int -XineramaXvShmPutImage(ClientPtr client) -{ - REQUEST(xvShmPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool send_event = stuff->send_event; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_SIZE_MATCH(xvShmPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - stuff->send_event = (send_event && !i) ? 1 : 0; - - result = ProcXvShmPutImage(client); - } - } - return result; -} -#endif - -static int -XineramaXvPutImage(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutImage(client); - } - } - return result; -} - -static int -XineramaXvPutVideo(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutVideoReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutVideo(client); - } - } - return result; -} - -static int -XineramaXvPutStill(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutStill(client); - } - } - return result; -} - - -void XineramifyXv(void) -{ - ScreenPtr pScreen, screen0 = screenInfo.screens[0]; - XvScreenPtr xvsp0 = (XvScreenPtr)screen0->devPrivates[XvScreenIndex].ptr; - XvAdaptorPtr refAdapt, pAdapt; - XvAttributePtr pAttr; - XvScreenPtr xvsp; - Bool isOverlay, hasOverlay; - PanoramiXRes *port; - XvAdaptorPtr MatchingAdaptors[MAXSCREENS]; - int i, j, k, l; - - XvXRTPort = CreateNewResourceType(XineramaDeleteResource); - - if(!xvsp0) return; - - for(i = 0; i < xvsp0->nAdaptors; i++) { - refAdapt = xvsp0->pAdaptors + i; - - bzero(MatchingAdaptors, sizeof(XvAdaptorPtr) * MAXSCREENS); - - MatchingAdaptors[0] = refAdapt; - - if(!(refAdapt->type & XvInputMask)) continue; - - isOverlay = FALSE; - for(j = 0; j < refAdapt->nAttributes; j++) { - pAttr = refAdapt->pAttributes + j; - if(!strcmp(pAttr->name, "XV_COLORKEY")) { - isOverlay = TRUE; - break; - } - } - - for(j = 1; j < PanoramiXNumScreens; j++) { - pScreen = screenInfo.screens[j]; - xvsp = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr; - - /* Do not try to go on if xv is not supported on this screen */ - if (xvsp==NULL) continue ; - - /* if the adaptor has the same name it's a perfect match */ - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if(!strcmp(refAdapt->name, pAdapt->name)) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - if(MatchingAdaptors[j]) continue; /* found it */ - - /* otherwise we only look for XvImage adaptors */ - if(!(refAdapt->type & XvImageMask)) continue; - if(refAdapt->nImages <= 0) continue; - - /* prefer overlay/overlay non-overlay/non-overlay pairing */ - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) { - hasOverlay = FALSE; - for(l = 0; l < pAdapt->nAttributes; l++) { - if(!strcmp(pAdapt->name, "XV_COLORKEY")) { - hasOverlay = TRUE; - break; - } - } - if(isOverlay && hasOverlay) { - MatchingAdaptors[j] = pAdapt; - break; - } - else if(!isOverlay && !hasOverlay) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - } - - if(MatchingAdaptors[j]) continue; /* found it */ - - /* but we'll take any XvImage pairing if we can get it */ - - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - } - - /* now create a resource for each port */ - for(j = 0; j < refAdapt->nPorts; j++) { - if(!(port = xalloc(sizeof(PanoramiXRes)))) - break; - port->info[0].id = MatchingAdaptors[0]->base_id + j; - AddResource(port->info[0].id, XvXRTPort, port); - - for(k = 1; k < PanoramiXNumScreens; k++) { - if(MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j)) - port->info[k].id = MatchingAdaptors[k]->base_id + j; - else - port->info[k].id = 0; - } - } - } -} - -#endif - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c.XF86.original deleted file mode 100644 index 3d321e8ae..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c.XF86.original +++ /dev/null @@ -1,2214 +0,0 @@ -/*********************************************************** -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, -and the Massachusetts Institute of Technology, Cambridge, 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 names of Digital or MIT not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.25 2001/11/18 23:55:48 mvojkovi Exp $ */ - -/* -** File: -** -** xvdisp.c --- Xv server extension dispatch module. -** -** Author: -** -** David Carver (Digital Workstation Engineering/Project Athena) -** -** Revisions: -** -** 11.06.91 Carver -** - changed SetPortControl to SetPortAttribute -** - changed GetPortControl to GetPortAttribute -** - changed QueryBestSize -** -** 15.05.91 Carver -** - version 2.0 upgrade -** -** 24.01.91 Carver -** - version 1.4 upgrade -** -*/ - -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "dixstruct.h" -#include "resource.h" -#include "opaque.h" - -#include "Xv.h" -#include "Xvproto.h" -#include "xvdix.h" -#ifdef MITSHM -#define _XSHM_SERVER_ -#include "shmstr.h" -#endif - -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - -unsigned long XvXRTPort; - -#ifdef MITSHM -static int XineramaXvShmPutImage(ClientPtr); -#endif -static int XineramaXvPutImage(ClientPtr); -static int XineramaXvPutVideo(ClientPtr); -static int XineramaXvPutStill(ClientPtr); -static int XineramaXvSetPortAttribute(ClientPtr); -static int XineramaXvStopVideo(ClientPtr); -#endif - -/* INTERNAL */ - -static int ProcXvQueryExtension(ClientPtr); -static int ProcXvQueryAdaptors(ClientPtr); -static int ProcXvQueryEncodings(ClientPtr); -static int ProcXvPutVideo(ClientPtr); -static int ProcXvPutStill(ClientPtr); -static int ProcXvGetVideo(ClientPtr); -static int ProcXvGetStill(ClientPtr); -static int ProcXvGrabPort(ClientPtr); -static int ProcXvUngrabPort(ClientPtr); -static int ProcXvSelectVideoNotify(ClientPtr); -static int ProcXvSelectPortNotify(ClientPtr); -static int ProcXvStopVideo(ClientPtr); -static int ProcXvSetPortAttribute(ClientPtr); -static int ProcXvGetPortAttribute(ClientPtr); -static int ProcXvQueryBestSize(ClientPtr); -static int ProcXvQueryPortAttributes(ClientPtr); -static int ProcXvPutImage(ClientPtr); -#ifdef MITSHM -static int ProcXvShmPutImage(ClientPtr); -#endif -static int ProcXvQueryImageAttributes(ClientPtr); -static int ProcXvListImageFormats(ClientPtr); - -static int SProcXvQueryExtension(ClientPtr); -static int SProcXvQueryAdaptors(ClientPtr); -static int SProcXvQueryEncodings(ClientPtr); -static int SProcXvPutVideo(ClientPtr); -static int SProcXvPutStill(ClientPtr); -static int SProcXvGetVideo(ClientPtr); -static int SProcXvGetStill(ClientPtr); -static int SProcXvGrabPort(ClientPtr); -static int SProcXvUngrabPort(ClientPtr); -static int SProcXvSelectVideoNotify(ClientPtr); -static int SProcXvSelectPortNotify(ClientPtr); -static int SProcXvStopVideo(ClientPtr); -static int SProcXvSetPortAttribute(ClientPtr); -static int SProcXvGetPortAttribute(ClientPtr); -static int SProcXvQueryBestSize(ClientPtr); -static int SProcXvQueryPortAttributes(ClientPtr); -static int SProcXvPutImage(ClientPtr); -#ifdef MITSHM -static int SProcXvShmPutImage(ClientPtr); -#endif -static int SProcXvQueryImageAttributes(ClientPtr); -static int SProcXvListImageFormats(ClientPtr); - -static int SWriteQueryAdaptorsReply(ClientPtr, xvQueryAdaptorsReply *); -static int SWriteQueryExtensionReply(ClientPtr, xvQueryExtensionReply *); -static int SWriteQueryEncodingsReply(ClientPtr, xvQueryEncodingsReply *); -static int SWriteAdaptorInfo(ClientPtr, xvAdaptorInfo *); -static int SWriteEncodingInfo(ClientPtr, xvEncodingInfo *); -static int SWriteFormat(ClientPtr, xvFormat *); -static int SWriteAttributeInfo(ClientPtr, xvAttributeInfo *); -static int SWriteGrabPortReply(ClientPtr, xvGrabPortReply *); -static int SWriteGetPortAttributeReply(ClientPtr, xvGetPortAttributeReply *); -static int SWriteQueryBestSizeReply(ClientPtr, xvQueryBestSizeReply *); -static int SWriteQueryPortAttributesReply( - ClientPtr, xvQueryPortAttributesReply *); -static int SWriteQueryImageAttributesReply( - ClientPtr, xvQueryImageAttributesReply*); -static int SWriteListImageFormatsReply(ClientPtr, xvListImageFormatsReply*); -static int SWriteImageFormatInfo(ClientPtr, xvImageFormatInfo*); - -#define _WriteQueryAdaptorsReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryAdaptorsReply, (char*)_d) - -#define _WriteQueryExtensionReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryExtensionReply, (char*)_d) - -#define _WriteQueryEncodingsReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryEncodingsReply, (char*)_d) - -#define _WriteAdaptorInfo(_c,_d) \ - if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAdaptorInfo, (char*)_d) - -#define _WriteAttributeInfo(_c,_d) \ - if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAttributeInfo, (char*)_d) - -#define _WriteEncodingInfo(_c,_d) \ - if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \ - else WriteToClient(_c, sz_xvEncodingInfo, (char*)_d) - -#define _WriteFormat(_c,_d) \ - if ((_c)->swapped) SWriteFormat(_c, _d); \ - else WriteToClient(_c, sz_xvFormat, (char*)_d) - -#define _WriteGrabPortReply(_c,_d) \ - if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \ - else WriteToClient(_c, sz_xvGrabPortReply, (char*)_d) - -#define _WriteGetPortAttributeReply(_c,_d) \ - if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \ - else WriteToClient(_c, sz_xvGetPortAttributeReply, (char*)_d) - -#define _WriteQueryBestSizeReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryBestSizeReply,(char*) _d) - -#define _WriteQueryPortAttributesReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryPortAttributesReply,(char*) _d) - -#define _WriteQueryImageAttributesReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryImageAttributesReply,(char*) _d) - -#define _WriteListImageFormatsReply(_c,_d) \ - if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \ - else WriteToClient(_c, sz_xvListImageFormatsReply,(char*) _d) - -#define _WriteImageFormatInfo(_c,_d) \ - if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \ - else WriteToClient(_c, sz_xvImageFormatInfo, (char*)_d) - -#define _AllocatePort(_i,_p) \ - ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success - -/* -** ProcXvDispatch -** -** -** -*/ - -int -ProcXvDispatch(ClientPtr client) -{ - REQUEST(xReq); - - UpdateCurrentTime(); - - switch (stuff->data) - { - case xv_QueryExtension: return(ProcXvQueryExtension(client)); - case xv_QueryAdaptors: return(ProcXvQueryAdaptors(client)); - case xv_QueryEncodings: return(ProcXvQueryEncodings(client)); - case xv_PutVideo: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvPutVideo(client)); - else -#endif - return(ProcXvPutVideo(client)); - case xv_PutStill: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvPutStill(client)); - else -#endif - return(ProcXvPutStill(client)); - case xv_GetVideo: return(ProcXvGetVideo(client)); - case xv_GetStill: return(ProcXvGetStill(client)); - case xv_GrabPort: return(ProcXvGrabPort(client)); - case xv_UngrabPort: return(ProcXvUngrabPort(client)); - case xv_SelectVideoNotify: return(ProcXvSelectVideoNotify(client)); - case xv_SelectPortNotify: return(ProcXvSelectPortNotify(client)); - case xv_StopVideo: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvStopVideo(client)); - else -#endif - return(ProcXvStopVideo(client)); - case xv_SetPortAttribute: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvSetPortAttribute(client)); - else -#endif - return(ProcXvSetPortAttribute(client)); - case xv_GetPortAttribute: return(ProcXvGetPortAttribute(client)); - case xv_QueryBestSize: return(ProcXvQueryBestSize(client)); - case xv_QueryPortAttributes: return(ProcXvQueryPortAttributes(client)); - case xv_PutImage: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvPutImage(client)); - else -#endif - return(ProcXvPutImage(client)); -#ifdef MITSHM - case xv_ShmPutImage: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvShmPutImage(client)); - else -#endif - return(ProcXvShmPutImage(client)); -#endif - case xv_QueryImageAttributes: return(ProcXvQueryImageAttributes(client)); - case xv_ListImageFormats: return(ProcXvListImageFormats(client)); - default: - if (stuff->data < xvNumRequests) - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, - BadImplementation); - return(BadImplementation); - } - else - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); - return(BadRequest); - } - } -} - -int -SProcXvDispatch(ClientPtr client) -{ - REQUEST(xReq); - - UpdateCurrentTime(); - - switch (stuff->data) - { - case xv_QueryExtension: return(SProcXvQueryExtension(client)); - case xv_QueryAdaptors: return(SProcXvQueryAdaptors(client)); - case xv_QueryEncodings: return(SProcXvQueryEncodings(client)); - case xv_PutVideo: return(SProcXvPutVideo(client)); - case xv_PutStill: return(SProcXvPutStill(client)); - case xv_GetVideo: return(SProcXvGetVideo(client)); - case xv_GetStill: return(SProcXvGetStill(client)); - case xv_GrabPort: return(SProcXvGrabPort(client)); - case xv_UngrabPort: return(SProcXvUngrabPort(client)); - case xv_SelectVideoNotify: return(SProcXvSelectVideoNotify(client)); - case xv_SelectPortNotify: return(SProcXvSelectPortNotify(client)); - case xv_StopVideo: return(SProcXvStopVideo(client)); - case xv_SetPortAttribute: return(SProcXvSetPortAttribute(client)); - case xv_GetPortAttribute: return(SProcXvGetPortAttribute(client)); - case xv_QueryBestSize: return(SProcXvQueryBestSize(client)); - case xv_QueryPortAttributes: return(SProcXvQueryPortAttributes(client)); - case xv_PutImage: return(SProcXvPutImage(client)); -#ifdef MITSHM - case xv_ShmPutImage: return(SProcXvShmPutImage(client)); -#endif - case xv_QueryImageAttributes: return(SProcXvQueryImageAttributes(client)); - case xv_ListImageFormats: return(SProcXvListImageFormats(client)); - default: - if (stuff->data < xvNumRequests) - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, - BadImplementation); - return(BadImplementation); - } - else - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); - return(BadRequest); - } - } -} - -static int -ProcXvQueryExtension(ClientPtr client) -{ - xvQueryExtensionReply rep; - /* REQUEST(xvQueryExtensionReq); */ - REQUEST_SIZE_MATCH(xvQueryExtensionReq); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.version = XvVersion; - rep.revision = XvRevision; - - _WriteQueryExtensionReply(client, &rep); - - return Success; - -} - -static int -ProcXvQueryAdaptors(ClientPtr client) -{ - xvFormat format; - xvAdaptorInfo ainfo; - xvQueryAdaptorsReply rep; - int totalSize; - int na; - XvAdaptorPtr pa; - int nf; - XvFormatPtr pf; - WindowPtr pWin; - ScreenPtr pScreen; - XvScreenPtr pxvs; - - REQUEST(xvQueryAdaptorsReq); - REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); - - if(!(pWin = (WindowPtr)LookupWindow(stuff->window, client) )) - { - client->errorValue = stuff->window; - return (BadWindow); - } - - pScreen = pWin->drawable.pScreen; - pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr; - - if (!pxvs) - { - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = 0; - rep.length = 0; - - _WriteQueryAdaptorsReply(client, &rep); - - return Success; - } - - (* pxvs->ddQueryAdaptors)(pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = pxvs->nAdaptors; - - /* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */ - - totalSize = pxvs->nAdaptors * sz_xvAdaptorInfo; - - /* FOR EACH ADPATOR ADD UP THE BYTES FOR ENCODINGS AND FORMATS */ - - na = pxvs->nAdaptors; - pa = pxvs->pAdaptors; - while (na--) - { - totalSize += (strlen(pa->name) + 3) & ~3; - totalSize += pa->nFormats * sz_xvFormat; - pa++; - } - - rep.length = totalSize >> 2; - - _WriteQueryAdaptorsReply(client, &rep); - - na = pxvs->nAdaptors; - pa = pxvs->pAdaptors; - while (na--) - { - - ainfo.base_id = pa->base_id; - ainfo.num_ports = pa->nPorts; - ainfo.type = pa->type; - ainfo.name_size = strlen(pa->name); - ainfo.num_formats = pa->nFormats; - - _WriteAdaptorInfo(client, &ainfo); - - WriteToClient(client, ainfo.name_size, pa->name); - - nf = pa->nFormats; - pf = pa->pFormats; - while (nf--) - { - format.depth = pf->depth; - format.visual = pf->visual; - _WriteFormat(client, &format); - pf++; - } - - pa++; - - } - - return (client->noClientException); - -} - -static int -ProcXvQueryEncodings(ClientPtr client) -{ - xvEncodingInfo einfo; - xvQueryEncodingsReply rep; - int totalSize; - XvPortPtr pPort; - int ne; - XvEncodingPtr pe; - int status; - - REQUEST(xvQueryEncodingsReq); - REQUEST_SIZE_MATCH(xvQueryEncodingsReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_encodings = pPort->pAdaptor->nEncodings; - - /* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */ - - ne = pPort->pAdaptor->nEncodings; - pe = pPort->pAdaptor->pEncodings; - totalSize = ne * sz_xvEncodingInfo; - while (ne--) - { - totalSize += (strlen(pe->name) + 3) & ~3; - pe++; - } - - rep.length = totalSize >> 2; - - _WriteQueryEncodingsReply(client, &rep); - - ne = pPort->pAdaptor->nEncodings; - pe = pPort->pAdaptor->pEncodings; - while (ne--) - { - einfo.encoding = pe->id; - einfo.name_size = strlen(pe->name); - einfo.width = pe->width; - einfo.height = pe->height; - einfo.rate.numerator = pe->rate.numerator; - einfo.rate.denominator = pe->rate.denominator; - _WriteEncodingInfo(client, &einfo); - WriteToClient(client, einfo.name_size, pe->name); - pe++; - } - - return (client->noClientException); - -} - -static int -ProcXvPutVideo(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvPutVideoReq); - REQUEST_SIZE_MATCH(xvPutVideoReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvInputMask) || - !(pPort->pAdaptor->type & XvVideoMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diPutVideo)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - -static int -ProcXvPutStill(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvPutStillReq); - REQUEST_SIZE_MATCH(xvPutStillReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvInputMask) || - !(pPort->pAdaptor->type & XvStillMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diPutStill)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - - -static int -ProcXvGetVideo(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvGetVideoReq); - REQUEST_SIZE_MATCH(xvGetVideoReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvOutputMask) || - !(pPort->pAdaptor->type & XvVideoMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diGetVideo)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - - -static int -ProcXvGetStill(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvGetStillReq); - REQUEST_SIZE_MATCH(xvGetStillReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvOutputMask) || - !(pPort->pAdaptor->type & XvStillMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diGetStill)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - -static int -ProcXvSelectVideoNotify(ClientPtr client) -{ - register DrawablePtr pDraw; - REQUEST(xvSelectVideoNotifyReq); - REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); - - if(!(pDraw = (DrawablePtr)LOOKUP_DRAWABLE(stuff->drawable, client) )) - { - client->errorValue = stuff->drawable; - return (BadWindow); - } - - return XVCALL(diSelectVideoNotify)(client, pDraw, stuff->onoff); - -} - -static int -ProcXvSelectPortNotify(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvSelectPortNotifyReq); - REQUEST_SIZE_MATCH(xvSelectPortNotifyReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - return XVCALL(diSelectPortNotify)(client, pPort, stuff->onoff); - -} - -static int -ProcXvGrabPort(ClientPtr client) -{ - int result, status; - XvPortPtr pPort; - xvGrabPortReply rep; - REQUEST(xvGrabPortReq); - REQUEST_SIZE_MATCH(xvGrabPortReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - status = XVCALL(diGrabPort)(client, pPort, stuff->time, &result); - - if (status != Success) - { - return status; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.result = result; - - _WriteGrabPortReply(client, &rep); - - return Success; - -} - -static int -ProcXvUngrabPort(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvGrabPortReq); - REQUEST_SIZE_MATCH(xvGrabPortReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - return XVCALL(diUngrabPort)(client, pPort, stuff->time); - -} - - -static int -ProcXvStopVideo(ClientPtr client) -{ - int status; - register DrawablePtr pDraw; - XvPortPtr pPort; - REQUEST(xvStopVideoReq); - REQUEST_SIZE_MATCH(xvStopVideoReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if(!(pDraw = LOOKUP_DRAWABLE(stuff->drawable, client) )) - { - client->errorValue = stuff->drawable; - return (BadDrawable); - } - - return XVCALL(diStopVideo)(client, pPort, pDraw); - -} - -static int -ProcXvSetPortAttribute(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvSetPortAttributeReq); - REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!ValidAtom(stuff->attribute)) - { - client->errorValue = stuff->attribute; - return(BadAtom); - } - - status = XVCALL(diSetPortAttribute)(client, pPort, - stuff->attribute, stuff->value); - - if (status == BadMatch) - client->errorValue = stuff->attribute; - else - client->errorValue = stuff->value; - - return status; -} - -static int -ProcXvGetPortAttribute(ClientPtr client) -{ - INT32 value; - int status; - XvPortPtr pPort; - xvGetPortAttributeReply rep; - REQUEST(xvGetPortAttributeReq); - REQUEST_SIZE_MATCH(xvGetPortAttributeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!ValidAtom(stuff->attribute)) - { - client->errorValue = stuff->attribute; - return(BadAtom); - } - - status = XVCALL(diGetPortAttribute)(client, pPort, stuff->attribute, &value); - if (status != Success) - { - client->errorValue = stuff->attribute; - return status; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.value = value; - - _WriteGetPortAttributeReply(client, &rep); - - return Success; -} - -static int -ProcXvQueryBestSize(ClientPtr client) -{ - int status; - unsigned int actual_width, actual_height; - XvPortPtr pPort; - xvQueryBestSizeReply rep; - REQUEST(xvQueryBestSizeReq); - REQUEST_SIZE_MATCH(xvQueryBestSizeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - - (* pPort->pAdaptor->ddQueryBestSize)(client, pPort, stuff->motion, - stuff->vid_w, stuff->vid_h, - stuff->drw_w, stuff->drw_h, - &actual_width, &actual_height); - - rep.actual_width = actual_width; - rep.actual_height = actual_height; - - _WriteQueryBestSizeReply(client, &rep); - - return Success; -} - - -static int -ProcXvQueryPortAttributes(ClientPtr client) -{ - int status, size, i; - XvPortPtr pPort; - XvAttributePtr pAtt; - xvQueryPortAttributesReply rep; - xvAttributeInfo Info; - REQUEST(xvQueryPortAttributesReq); - REQUEST_SIZE_MATCH(xvQueryPortAttributesReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_attributes = pPort->pAdaptor->nAttributes; - rep.text_size = 0; - - for(i = 0, pAtt = pPort->pAdaptor->pAttributes; - i < rep.num_attributes; i++, pAtt++) - { - rep.text_size += (strlen(pAtt->name) + 1 + 3) & ~3L; - } - - rep.length = (rep.num_attributes * sz_xvAttributeInfo) + rep.text_size; - rep.length >>= 2; - - _WriteQueryPortAttributesReply(client, &rep); - - for(i = 0, pAtt = pPort->pAdaptor->pAttributes; - i < rep.num_attributes; i++, pAtt++) - { - size = strlen(pAtt->name) + 1; /* pass the NULL */ - Info.flags = pAtt->flags; - Info.min = pAtt->min_value; - Info.max = pAtt->max_value; - Info.size = (size + 3) & ~3L; - - _WriteAttributeInfo(client, &Info); - - WriteToClient(client, size, pAtt->name); - } - - return Success; -} - - - -static int -ProcXvPutImage(ClientPtr client) -{ - DrawablePtr pDraw; - XvPortPtr pPort; - XvImagePtr pImage = NULL; - GCPtr pGC; - int status, i, size; - CARD16 width, height; - - REQUEST(xvPutImageReq); - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvImageMask) || - !(pPort->pAdaptor->type & XvInputMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - - if(!pImage) - return BadMatch; - - width = stuff->width; - height = stuff->height; - size = (*pPort->pAdaptor->ddQueryImageAttributes)(client, - pPort, pImage, &width, &height, NULL, NULL); - size += sizeof(xvPutImageReq); - size = (size + 3) >> 2; - - if((width < stuff->width) || (height < stuff->height)) - return BadValue; - - if(client->req_len < size) - return BadLength; - - return XVCALL(diPutImage)(client, pDraw, pPort, pGC, - stuff->src_x, stuff->src_y, - stuff->src_w, stuff->src_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h, - pImage, (unsigned char*)(&stuff[1]), FALSE, - stuff->width, stuff->height); -} - -#ifdef MITSHM -/* redefined here since it's not in any header file */ -typedef struct _ShmDesc { - struct _ShmDesc *next; - int shmid; - int refcnt; - char *addr; - Bool writable; - unsigned long size; -} ShmDescRec, *ShmDescPtr; - -extern RESTYPE ShmSegType; -extern int BadShmSegCode; -extern int ShmCompletionCode; - -static int -ProcXvShmPutImage(ClientPtr client) -{ - ShmDescPtr shmdesc; - DrawablePtr pDraw; - XvPortPtr pPort; - XvImagePtr pImage = NULL; - GCPtr pGC; - int status, size_needed, i; - CARD16 width, height; - - REQUEST(xvShmPutImageReq); - REQUEST_SIZE_MATCH(xvShmPutImageReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvImageMask) || - !(pPort->pAdaptor->type & XvInputMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - - if(!pImage) - return BadMatch; - - if(!(shmdesc = (ShmDescPtr)LookupIDByType(stuff->shmseg, ShmSegType))) - { - client->errorValue = stuff->shmseg; - return BadShmSegCode; - } - - width = stuff->width; - height = stuff->height; - size_needed = (*pPort->pAdaptor->ddQueryImageAttributes)(client, - pPort, pImage, &width, &height, NULL, NULL); - if((size_needed + stuff->offset) > shmdesc->size) - return BadAccess; - - if((width < stuff->width) || (height < stuff->height)) - return BadValue; - - status = XVCALL(diPutImage)(client, pDraw, pPort, pGC, - stuff->src_x, stuff->src_y, - stuff->src_w, stuff->src_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h, pImage, - (unsigned char *)shmdesc->addr + stuff->offset, - stuff->send_event, stuff->width, stuff->height); - - if((status == Success) && stuff->send_event) { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.sequenceNumber = client->sequence; - ev.minorEvent = xv_ShmPutImage; - ev.majorEvent = XvReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; - WriteEventsToClient(client, 1, (xEvent *) &ev); - } - - return status; -} -#endif - -#ifdef XvMCExtension -XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id); -#endif - -static int -ProcXvQueryImageAttributes(ClientPtr client) -{ - xvQueryImageAttributesReply rep; - int size, num_planes, i; - CARD16 width, height; - XvImagePtr pImage = NULL; - XvPortPtr pPort; - int *offsets; - int *pitches; - REQUEST(xvQueryImageAttributesReq); - - REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - -#ifdef XvMCExtension - if(!pImage) - pImage = XvMCFindXvImage(pPort, stuff->id); -#endif - - if(!pImage) - return BadMatch; - - num_planes = pImage->num_planes; - - if(!(offsets = xalloc(num_planes << 3))) - return BadAlloc; - pitches = offsets + num_planes; - - width = stuff->width; - height = stuff->height; - - size = (*pPort->pAdaptor->ddQueryImageAttributes)(client, pPort, pImage, - &width, &height, offsets, pitches); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = num_planes << 1; - rep.num_planes = num_planes; - rep.width = width; - rep.height = height; - rep.data_size = size; - - _WriteQueryImageAttributesReply(client, &rep); - if(client->swapped) - SwapLongs((CARD32*)offsets, rep.length); - WriteToClient(client, rep.length << 2, (char*)offsets); - - xfree(offsets); - - return Success; -} - -static int -ProcXvListImageFormats(ClientPtr client) -{ - XvPortPtr pPort; - XvImagePtr pImage; - int i; - xvListImageFormatsReply rep; - xvImageFormatInfo info; - REQUEST(xvListImageFormatsReq); - - REQUEST_SIZE_MATCH(xvListImageFormatsReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_formats = pPort->pAdaptor->nImages; - rep.length = rep.num_formats * sz_xvImageFormatInfo >> 2; - - _WriteListImageFormatsReply(client, &rep); - - pImage = pPort->pAdaptor->pImages; - - for(i = 0; i < rep.num_formats; i++, pImage++) { - info.id = pImage->id; - info.type = pImage->type; - info.byte_order = pImage->byte_order; - memcpy(&info.guid, pImage->guid, 16); - info.bpp = pImage->bits_per_pixel; - info.num_planes = pImage->num_planes; - info.depth = pImage->depth; - info.red_mask = pImage->red_mask; - info.green_mask = pImage->green_mask; - info.blue_mask = pImage->blue_mask; - info.format = pImage->format; - info.y_sample_bits = pImage->y_sample_bits; - info.u_sample_bits = pImage->u_sample_bits; - info.v_sample_bits = pImage->v_sample_bits; - info.horz_y_period = pImage->horz_y_period; - info.horz_u_period = pImage->horz_u_period; - info.horz_v_period = pImage->horz_v_period; - info.vert_y_period = pImage->vert_y_period; - info.vert_u_period = pImage->vert_u_period; - info.vert_v_period = pImage->vert_v_period; - memcpy(&info.comp_order, pImage->component_order, 32); - info.scanline_order = pImage->scanline_order; - _WriteImageFormatInfo(client, &info); - } - - return Success; -} - - - -/* Swapped Procs */ - -static int -SProcXvQueryExtension(ClientPtr client) -{ - register char n; - REQUEST(xvQueryExtensionReq); - swaps(&stuff->length, n); - return ProcXvQueryExtension(client); -} - -static int -SProcXvQueryAdaptors(ClientPtr client) -{ - register char n; - REQUEST(xvQueryAdaptorsReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcXvQueryAdaptors(client); -} - -static int -SProcXvQueryEncodings(ClientPtr client) -{ - register char n; - REQUEST(xvQueryEncodingsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvQueryEncodings(client); -} - -static int -SProcXvGrabPort(ClientPtr client) -{ - register char n; - REQUEST(xvGrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); - return ProcXvGrabPort(client); -} - -static int -SProcXvUngrabPort(ClientPtr client) -{ - register char n; - REQUEST(xvUngrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); - return ProcXvUngrabPort(client); -} - -static int -SProcXvPutVideo(ClientPtr client) -{ - register char n; - REQUEST(xvPutVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvPutVideo(client); -} - -static int -SProcXvPutStill(ClientPtr client) -{ - register char n; - REQUEST(xvPutStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvPutStill(client); -} - -static int -SProcXvGetVideo(ClientPtr client) -{ - register char n; - REQUEST(xvGetVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvGetVideo(client); -} - -static int -SProcXvGetStill(ClientPtr client) -{ - register char n; - REQUEST(xvGetStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvGetStill(client); -} - -static int -SProcXvPutImage(ClientPtr client) -{ - register char n; - REQUEST(xvPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->id, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return ProcXvPutImage(client); -} - -#ifdef MITSHM -static int -SProcXvShmPutImage(ClientPtr client) -{ - register char n; - REQUEST(xvShmPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->id, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->offset, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return ProcXvShmPutImage(client); -} -#endif - - -static int -SProcXvSelectVideoNotify(ClientPtr client) -{ - register char n; - REQUEST(xvSelectVideoNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - return ProcXvSelectVideoNotify(client); -} - -static int -SProcXvSelectPortNotify(ClientPtr client) -{ - register char n; - REQUEST(xvSelectPortNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvSelectPortNotify(client); -} - -static int -SProcXvStopVideo(ClientPtr client) -{ - register char n; - REQUEST(xvStopVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - return ProcXvStopVideo(client); -} - -static int -SProcXvSetPortAttribute(ClientPtr client) -{ - register char n; - REQUEST(xvSetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); - return ProcXvSetPortAttribute(client); -} - -static int -SProcXvGetPortAttribute(ClientPtr client) -{ - register char n; - REQUEST(xvGetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); - return ProcXvGetPortAttribute(client); -} - -static int -SProcXvQueryBestSize(ClientPtr client) -{ - register char n; - REQUEST(xvQueryBestSizeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvQueryBestSize(client); -} - -static int -SProcXvQueryPortAttributes(ClientPtr client) -{ - register char n; - REQUEST(xvQueryPortAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvQueryPortAttributes(client); -} - -static int -SProcXvQueryImageAttributes(ClientPtr client) -{ - register char n; - REQUEST(xvQueryImageAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->id, n); - swaps(&stuff->width, n); - swaps(&stuff->width, n); - return ProcXvQueryImageAttributes(client); -} - -static int -SProcXvListImageFormats(ClientPtr client) -{ - register char n; - REQUEST(xvListImageFormatsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvListImageFormats(client); -} - - -static int -SWriteQueryExtensionReply( - ClientPtr client, - xvQueryExtensionReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->version, n); - swaps(&rep->revision, n); - - (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryAdaptorsReply( - ClientPtr client, - xvQueryAdaptorsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_adaptors, n); - - (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryEncodingsReply( - ClientPtr client, - xvQueryEncodingsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_encodings, n); - - (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep); - - return Success; -} - -static int -SWriteAdaptorInfo( - ClientPtr client, - xvAdaptorInfo *pAdaptor -){ - register char n; - - swapl(&pAdaptor->base_id, n); - swaps(&pAdaptor->name_size, n); - swaps(&pAdaptor->num_ports, n); - swaps(&pAdaptor->num_formats, n); - - (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor); - - return Success; -} - -static int -SWriteEncodingInfo( - ClientPtr client, - xvEncodingInfo *pEncoding -){ - register char n; - - swapl(&pEncoding->encoding, n); - swaps(&pEncoding->name_size, n); - swaps(&pEncoding->width, n); - swaps(&pEncoding->height, n); - swapl(&pEncoding->rate.numerator, n); - swapl(&pEncoding->rate.denominator, n); - (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding); - - return Success; -} - -static int -SWriteFormat( - ClientPtr client, - xvFormat *pFormat -){ - register char n; - - swapl(&pFormat->visual, n); - (void)WriteToClient(client, sz_xvFormat, (char *)pFormat); - - return Success; -} - -static int -SWriteAttributeInfo( - ClientPtr client, - xvAttributeInfo *pAtt -){ - register char n; - - swapl(&pAtt->flags, n); - swapl(&pAtt->size, n); - swapl(&pAtt->min, n); - swapl(&pAtt->max, n); - (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt); - - return Success; -} - -static int -SWriteImageFormatInfo( - ClientPtr client, - xvImageFormatInfo *pImage -){ - register char n; - - swapl(&pImage->id, n); - swapl(&pImage->red_mask, n); - swapl(&pImage->green_mask, n); - swapl(&pImage->blue_mask, n); - swapl(&pImage->y_sample_bits, n); - swapl(&pImage->u_sample_bits, n); - swapl(&pImage->v_sample_bits, n); - swapl(&pImage->horz_y_period, n); - swapl(&pImage->horz_u_period, n); - swapl(&pImage->horz_v_period, n); - swapl(&pImage->vert_y_period, n); - swapl(&pImage->vert_u_period, n); - swapl(&pImage->vert_v_period, n); - - (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage); - - return Success; -} - - - -static int -SWriteGrabPortReply( - ClientPtr client, - xvGrabPortReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - - (void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep); - - return Success; -} - -static int -SWriteGetPortAttributeReply( - ClientPtr client, - xvGetPortAttributeReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->value, n); - - (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryBestSizeReply( - ClientPtr client, - xvQueryBestSizeReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->actual_width, n); - swaps(&rep->actual_height, n); - - (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryPortAttributesReply( - ClientPtr client, - xvQueryPortAttributesReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_attributes, n); - swapl(&rep->text_size, n); - - (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryImageAttributesReply( - ClientPtr client, - xvQueryImageAttributesReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_planes, n); - swapl(&rep->data_size, n); - swaps(&rep->width, n); - swaps(&rep->height, n); - - (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep); - - return Success; -} - - -static int -SWriteListImageFormatsReply( - ClientPtr client, - xvListImageFormatsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_formats, n); - - (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep); - - return Success; -} - - -#ifdef PANORAMIX - - - - -static int -XineramaXvStopVideo(ClientPtr client) -{ - int result = Success, i; - PanoramiXRes *draw, *port; - REQUEST(xvStopVideoReq); - REQUEST_SIZE_MATCH(xvStopVideoReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - result = ProcXvStopVideo(client); - } - } - - return result; -} - -static int -XineramaXvSetPortAttribute(ClientPtr client) -{ - REQUEST(xvSetPortAttributeReq); - PanoramiXRes *port; - int result = Success, i; - - REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->port = port->info[i].id; - result = ProcXvSetPortAttribute(client); - } - } - return result; -} - - -#ifdef MITSHM -static int -XineramaXvShmPutImage(ClientPtr client) -{ - REQUEST(xvShmPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool send_event = stuff->send_event; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_SIZE_MATCH(xvShmPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - stuff->send_event = (send_event && !i) ? 1 : 0; - - result = ProcXvShmPutImage(client); - } - } - return result; -} -#endif - -static int -XineramaXvPutImage(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutImage(client); - } - } - return result; -} - -static int -XineramaXvPutVideo(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutVideoReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutVideo(client); - } - } - return result; -} - -static int -XineramaXvPutStill(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && - (stuff->drawable == WindowTable[0]->drawable.id); - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutStill(client); - } - } - return result; -} - - -void XineramifyXv(void) -{ - ScreenPtr pScreen, screen0 = screenInfo.screens[0]; - XvScreenPtr xvsp0 = (XvScreenPtr)screen0->devPrivates[XvScreenIndex].ptr; - XvAdaptorPtr refAdapt, pAdapt; - XvAttributePtr pAttr; - XvScreenPtr xvsp; - Bool isOverlay, hasOverlay; - PanoramiXRes *port; - XvAdaptorPtr MatchingAdaptors[MAXSCREENS]; - int i, j, k, l; - - XvXRTPort = CreateNewResourceType(XineramaDeleteResource); - - if(!xvsp0) return; - - for(i = 0; i < xvsp0->nAdaptors; i++) { - refAdapt = xvsp0->pAdaptors + i; - - bzero(MatchingAdaptors, sizeof(XvAdaptorPtr) * MAXSCREENS); - - MatchingAdaptors[0] = refAdapt; - - if(!(refAdapt->type & XvInputMask)) continue; - - isOverlay = FALSE; - for(j = 0; j < refAdapt->nAttributes; j++) { - pAttr = refAdapt->pAttributes + j; - if(!strcmp(pAttr->name, "XV_COLORKEY")) { - isOverlay = TRUE; - break; - } - } - - for(j = 1; j < PanoramiXNumScreens; j++) { - pScreen = screenInfo.screens[j]; - xvsp = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr; - - /* Do not try to go on if xv is not supported on this screen */ - if (xvsp==NULL) continue ; - - /* if the adaptor has the same name it's a perfect match */ - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if(!strcmp(refAdapt->name, pAdapt->name)) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - if(MatchingAdaptors[j]) continue; /* found it */ - - /* otherwise we only look for XvImage adaptors */ - if(!(refAdapt->type & XvImageMask)) continue; - if(refAdapt->nImages <= 0) continue; - - /* prefer overlay/overlay non-overlay/non-overlay pairing */ - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) { - hasOverlay = FALSE; - for(l = 0; l < pAdapt->nAttributes; l++) { - if(!strcmp(pAdapt->name, "XV_COLORKEY")) { - hasOverlay = TRUE; - break; - } - } - if(isOverlay && hasOverlay) { - MatchingAdaptors[j] = pAdapt; - break; - } - else if(!isOverlay && !hasOverlay) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - } - - if(MatchingAdaptors[j]) continue; /* found it */ - - /* but we'll take any XvImage pairing if we can get it */ - - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - } - - /* now create a resource for each port */ - for(j = 0; j < refAdapt->nPorts; j++) { - if(!(port = xalloc(sizeof(PanoramiXRes)))) - break; - port->info[0].id = MatchingAdaptors[0]->base_id + j; - AddResource(port->info[0].id, XvXRTPort, port); - - for(k = 1; k < PanoramiXNumScreens; k++) { - if(MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j)) - port->info[k].id = MatchingAdaptors[k]->base_id + j; - else - port->info[k].id = 0; - } - } - } -} - -#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original deleted file mode 100644 index cf5d48ba2..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original +++ /dev/null @@ -1,2073 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $Id: damage.c,v 1.19 2005/10/06 21:55:41 anholt Exp $ - * - * Copyright © 2003 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "scrnintstr.h" -#include "windowstr.h" -#include -#include "dixfontstr.h" -#include -#include "mi.h" -#include "regionstr.h" -#include "globals.h" -#include "gcstruct.h" -#include "damage.h" -#include "damagestr.h" -#ifdef COMPOSITE -#include "cw.h" -#endif - -#define wrap(priv, real, mem, func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv, real, mem) {\ - real->mem = priv->mem; \ -} - -#define BOX_SAME(a,b) \ - ((a)->x1 == (b)->x1 && \ - (a)->y1 == (b)->y1 && \ - (a)->x2 == (b)->x2 && \ - (a)->y2 == (b)->y2) - -#define DAMAGE_VALIDATE_ENABLE 0 -#define DAMAGE_DEBUG_ENABLE 0 -#if DAMAGE_DEBUG_ENABLE -#define DAMAGE_DEBUG(x) ErrorF x -#else -#define DAMAGE_DEBUG(x) -#endif - -#define getPixmapDamageRef(pPixmap) \ - ((DamagePtr *) &(pPixmap->devPrivates[damagePixPrivateIndex].ptr)) - -#define pixmapDamage(pPixmap) damagePixPriv(pPixmap) - -static DamagePtr * -getDrawableDamageRef (DrawablePtr pDrawable) -{ - PixmapPtr pPixmap; - - if (pDrawable->type == DRAWABLE_WINDOW) - { - ScreenPtr pScreen = pDrawable->pScreen; - - pPixmap = 0; - if (pScreen->GetWindowPixmap -#ifdef ROOTLESS_WORKAROUND - && ((WindowPtr)pDrawable)->viewable -#endif - ) - pPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr)pDrawable); - - if (!pPixmap) - { - damageScrPriv(pScreen); - - return &pScrPriv->pScreenDamage; - } - } - else - pPixmap = (PixmapPtr) pDrawable; - return getPixmapDamageRef (pPixmap); -} - -#define getDrawableDamage(pDrawable) (*getDrawableDamageRef (pDrawable)) -#define getWindowDamage(pWin) getDrawableDamage(&(pWin)->drawable) - -#define drawableDamage(pDrawable) \ - DamagePtr pDamage = getDrawableDamage(pDrawable) - -#define windowDamage(pWin) drawableDamage(&(pWin)->drawable) - -#define winDamageRef(pWindow) \ - DamagePtr *pPrev = (DamagePtr *) \ - &(pWindow->devPrivates[damageWinPrivateIndex].ptr) - -#if DAMAGE_DEBUG_ENABLE -static void -_damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, int subWindowMode, const char *where) -#define damageDamageRegion(d,r,c,m) _damageDamageRegion(d,r,c,m,__FUNCTION__) -#else -static void -damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, - int subWindowMode) -#endif -{ - ScreenPtr pScreen = pDrawable->pScreen; - damageScrPriv(pScreen); - drawableDamage(pDrawable); - DamagePtr pNext; - RegionRec clippedRec; - RegionPtr pDamageRegion; - RegionRec pixClip; - Bool was_empty; - RegionRec tmpRegion; - BoxRec tmpBox; - int draw_x, draw_y; -#ifdef COMPOSITE - int screen_x = 0, screen_y = 0; -#endif - - /* short circuit for empty regions */ - if (!REGION_NOTEMPTY(pScreen, pRegion)) - return; - -#ifdef COMPOSITE - /* - * When drawing to a pixmap which is storing window contents, - * the region presented is in pixmap relative coordinates which - * need to be converted to screen relative coordinates - */ - if (pDrawable->type != DRAWABLE_WINDOW) - { - screen_x = ((PixmapPtr) pDrawable)->screen_x - pDrawable->x; - screen_y = ((PixmapPtr) pDrawable)->screen_y - pDrawable->y; - } - if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y); -#endif - - if (pDrawable->type == DRAWABLE_WINDOW && - ((WindowPtr)(pDrawable))->backingStore == NotUseful) - { - if (subWindowMode == ClipByChildren) - { - REGION_INTERSECT(pScreen, pRegion, pRegion, - &((WindowPtr)(pDrawable))->clipList); - } - else if (subWindowMode == IncludeInferiors) - { - RegionPtr pTempRegion = - NotClippedByChildren((WindowPtr)(pDrawable)); - REGION_INTERSECT(pScreen, pRegion, pRegion, pTempRegion); - REGION_DESTROY(pScreen, pTempRegion); - } - /* If subWindowMode is set to an invalid value, don't perform - * any drawable-based clipping. */ - } - - - REGION_NULL (pScreen, &clippedRec); - for (; pDamage; pDamage = pNext) - { - pNext = pDamage->pNext; - /* - * Check for internal damage and don't send events - */ - if (pScrPriv->internalLevel > 0 && !pDamage->isInternal) - { - DAMAGE_DEBUG (("non internal damage, skipping at %d\n", - pScrPriv->internalLevel)); - continue; - } - /* - * Check for unrealized windows - */ - if (pDamage->pDrawable->type == DRAWABLE_WINDOW && - !((WindowPtr) (pDamage->pDrawable))->realized) - { -#if 0 - DAMAGE_DEBUG (("damage while window unrealized\n")); -#endif - continue; - } - - draw_x = pDamage->pDrawable->x; - draw_y = pDamage->pDrawable->y; -#ifdef COMPOSITE - /* - * Need to move everyone to screen coordinates - * XXX what about off-screen pixmaps with non-zero x/y? - */ - if (pDamage->pDrawable->type != DRAWABLE_WINDOW) - { - draw_x += ((PixmapPtr) pDamage->pDrawable)->screen_x; - draw_y += ((PixmapPtr) pDamage->pDrawable)->screen_y; - } -#endif - - /* - * Clip against border or pixmap bounds - */ - - pDamageRegion = pRegion; - if (clip || pDamage->pDrawable != pDrawable) - { - pDamageRegion = &clippedRec; - if (pDamage->pDrawable->type == DRAWABLE_WINDOW) { - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, - &((WindowPtr)(pDamage->pDrawable))->borderClip); - } else { - BoxRec box; - box.x1 = draw_x; - box.y1 = draw_y; - box.x2 = draw_x + pDamage->pDrawable->width; - box.y2 = draw_y + pDamage->pDrawable->height; - REGION_INIT(pScreen, &pixClip, &box, 1); - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, &pixClip); - REGION_UNINIT(pScreen, &pixClip); - } - /* - * Short circuit empty results - */ - if (!REGION_NOTEMPTY(pScreen, pDamageRegion)) - continue; - } - - DAMAGE_DEBUG (("%s %d x %d +%d +%d (target 0x%lx monitor 0x%lx)\n", - where, - pDamageRegion->extents.x2 - pDamageRegion->extents.x1, - pDamageRegion->extents.y2 - pDamageRegion->extents.y1, - pDamageRegion->extents.x1, pDamageRegion->extents.y1, - pDrawable->id, pDamage->pDrawable->id)); - - /* - * Move region to target coordinate space - */ - if (draw_x || draw_y) - REGION_TRANSLATE (pScreen, pDamageRegion, -draw_x, -draw_y); - - switch (pDamage->damageLevel) { - case DamageReportRawRegion: - (*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure); - break; - case DamageReportDeltaRegion: - REGION_NULL (pScreen, &tmpRegion); - REGION_SUBTRACT (pScreen, &tmpRegion, pDamageRegion, &pDamage->damage); - if (REGION_NOTEMPTY (pScreen, &tmpRegion)) - { - REGION_UNION(pScreen, &pDamage->damage, - &pDamage->damage, pDamageRegion); - (*pDamage->damageReport) (pDamage, &tmpRegion, pDamage->closure); - } - REGION_UNINIT(pScreen, &tmpRegion); - break; - case DamageReportBoundingBox: - tmpBox = *REGION_EXTENTS (pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, - &pDamage->damage, pDamageRegion); - if (!BOX_SAME (&tmpBox, REGION_EXTENTS (pScreen, &pDamage->damage))) - (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); - break; - case DamageReportNonEmpty: - was_empty = !REGION_NOTEMPTY(pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, - pDamageRegion); - if (was_empty && REGION_NOTEMPTY(pScreen, &pDamage->damage)) - (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); - break; - case DamageReportNone: - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, - pDamageRegion); - break; - } - /* - * translate original region back - */ - if (pDamageRegion == pRegion && (draw_x || draw_y)) - REGION_TRANSLATE (pScreen, pDamageRegion, draw_x, draw_y); - } -#ifdef COMPOSITE - if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, -screen_x, -screen_y); -#endif - - REGION_UNINIT (pScreen, &clippedRec); -} - -#if DAMAGE_DEBUG_ENABLE -#define damageDamageBox(d,b,m) _damageDamageBox(d,b,m,__FUNCTION__) -static void -_damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode, const char *where) -#else -static void -damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode) -#endif -{ - RegionRec region; - - REGION_INIT (pDrawable->pScreen, ®ion, pBox, 1); -#if DAMAGE_DEBUG_ENABLE - _damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode, where); -#else - damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode); -#endif - REGION_UNINIT (pDrawable->pScreen, ®ion); -} - -static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); -static void damageChangeGC(GCPtr, unsigned long); -static void damageCopyGC(GCPtr, unsigned long, GCPtr); -static void damageDestroyGC(GCPtr); -static void damageChangeClip(GCPtr, int, pointer, int); -static void damageDestroyClip(GCPtr); -static void damageCopyClip(GCPtr, GCPtr); - -GCFuncs damageGCFuncs = { - damageValidateGC, damageChangeGC, damageCopyGC, damageDestroyGC, - damageChangeClip, damageDestroyClip, damageCopyClip -}; - -extern GCOps damageGCOps; - -static Bool -damageCreateGC(GCPtr pGC) -{ - ScreenPtr pScreen = pGC->pScreen; - damageScrPriv(pScreen); - damageGCPriv(pGC); - Bool ret; - - pGC->pCompositeClip = 0; - unwrap (pScrPriv, pScreen, CreateGC); - if((ret = (*pScreen->CreateGC) (pGC))) { - pGCPriv->ops = NULL; - pGCPriv->funcs = pGC->funcs; - pGC->funcs = &damageGCFuncs; - } - wrap (pScrPriv, pScreen, CreateGC, damageCreateGC); - - return ret; -} - -#ifdef NOTUSED -static void -damageWrapGC (GCPtr pGC) -{ - damageGCPriv(pGC); - - pGCPriv->ops = NULL; - pGCPriv->funcs = pGC->funcs; - pGC->funcs = &damageGCFuncs; -} - -static void -damageUnwrapGC (GCPtr pGC) -{ - damageGCPriv(pGC); - - pGC->funcs = pGCPriv->funcs; - if (pGCPriv->ops) - pGC->ops = pGCPriv->ops; -} -#endif - -#define DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable) \ - damageGCPriv(pGC); \ - GCFuncs *oldFuncs = pGC->funcs; \ - unwrap(pGCPriv, pGC, funcs); \ - unwrap(pGCPriv, pGC, ops); \ - -#define DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable) \ - wrap(pGCPriv, pGC, funcs, oldFuncs); \ - wrap(pGCPriv, pGC, ops, &damageGCOps) - -#define DAMAGE_GC_FUNC_PROLOGUE(pGC) \ - damageGCPriv(pGC); \ - unwrap(pGCPriv, pGC, funcs); \ - if (pGCPriv->ops) unwrap(pGCPriv, pGC, ops) - -#define DAMAGE_GC_FUNC_EPILOGUE(pGC) \ - wrap(pGCPriv, pGC, funcs, &damageGCFuncs); \ - if (pGCPriv->ops) wrap(pGCPriv, pGC, ops, &damageGCOps) - -static void -damageValidateGC(GCPtr pGC, - unsigned long changes, - DrawablePtr pDrawable) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->ValidateGC)(pGC, changes, pDrawable); - pGCPriv->ops = pGC->ops; /* just so it's not NULL */ - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -static void -damageDestroyGC(GCPtr pGC) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->DestroyGC)(pGC); - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -static void -damageChangeGC (GCPtr pGC, - unsigned long mask) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->ChangeGC) (pGC, mask); - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -static void -damageCopyGC (GCPtr pGCSrc, - unsigned long mask, - GCPtr pGCDst) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGCDst); - (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); - DAMAGE_GC_FUNC_EPILOGUE (pGCDst); -} - -static void -damageChangeClip (GCPtr pGC, - int type, - pointer pvalue, - int nrects) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -static void -damageCopyClip(GCPtr pgcDst, GCPtr pgcSrc) -{ - DAMAGE_GC_FUNC_PROLOGUE (pgcDst); - (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc); - DAMAGE_GC_FUNC_EPILOGUE (pgcDst); -} - -static void -damageDestroyClip(GCPtr pGC) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (* pGC->funcs->DestroyClip)(pGC); - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -#define TRIM_BOX(box, pGC) if (pGC->pCompositeClip) { \ - BoxPtr extents = &pGC->pCompositeClip->extents;\ - if(box.x1 < extents->x1) box.x1 = extents->x1; \ - if(box.x2 > extents->x2) box.x2 = extents->x2; \ - if(box.y1 < extents->y1) box.y1 = extents->y1; \ - if(box.y2 > extents->y2) box.y2 = extents->y2; \ - } - -#define TRANSLATE_BOX(box, pDrawable) { \ - box.x1 += pDrawable->x; \ - box.x2 += pDrawable->x; \ - box.y1 += pDrawable->y; \ - box.y2 += pDrawable->y; \ - } - -#define TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC) { \ - TRANSLATE_BOX(box, pDrawable); \ - TRIM_BOX(box, pGC); \ - } - -#define BOX_NOT_EMPTY(box) \ - (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0)) - -#define checkGCDamage(d,g) (getDrawableDamage(d) && \ - (!g->pCompositeClip ||\ - REGION_NOTEMPTY(d->pScreen, \ - g->pCompositeClip))) - -#ifdef RENDER - -#define TRIM_PICTURE_BOX(box, pDst) { \ - BoxPtr extents = &pDst->pCompositeClip->extents;\ - if(box.x1 < extents->x1) box.x1 = extents->x1; \ - if(box.x2 > extents->x2) box.x2 = extents->x2; \ - if(box.y1 < extents->y1) box.y1 = extents->y1; \ - if(box.y2 > extents->y2) box.y2 = extents->y2; \ - } - -#define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \ - REGION_NOTEMPTY(pScreen, p->pCompositeClip)) - -static void -damageComposite (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - damageScrPriv(pScreen); - - if (checkPictureDamage (pDst)) - { - BoxRec box; - - box.x1 = xDst + pDst->pDrawable->x; - box.y1 = yDst + pDst->pDrawable->y; - box.x2 = box.x1 + width; - box.y2 = box.y1 + height; - TRIM_PICTURE_BOX(box, pDst); - if (BOX_NOT_EMPTY(box)) - damageDamageBox (pDst->pDrawable, &box, pDst->subWindowMode); - } - unwrap (pScrPriv, ps, Composite); - (*ps->Composite) (op, - pSrc, - pMask, - pDst, - xSrc, - ySrc, - xMask, - yMask, - xDst, - yDst, - width, - height); - wrap (pScrPriv, ps, Composite, damageComposite); -} - -static void -damageGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - damageScrPriv(pScreen); - - if (checkPictureDamage (pDst)) - { - int nlistTmp = nlist; - GlyphListPtr listTmp = list; - GlyphPtr *glyphsTmp = glyphs; - int x, y; - int n; - GlyphPtr glyph; - BoxRec box; - int x1, y1, x2, y2; - - box.x1 = 32767; - box.y1 = 32767; - box.x2 = -32767; - box.y2 = -32767; - x = pDst->pDrawable->x; - y = pDst->pDrawable->y; - while (nlistTmp--) - { - x += listTmp->xOff; - y += listTmp->yOff; - n = listTmp->len; - while (n--) - { - glyph = *glyphsTmp++; - x1 = x - glyph->info.x; - y1 = y - glyph->info.y; - x2 = x1 + glyph->info.width; - y2 = y1 + glyph->info.height; - if (x1 < box.x1) - box.x1 = x1; - if (y1 < box.y1) - box.y1 = y1; - if (x2 > box.x2) - box.x2 = x2; - if (y2 > box.y2) - box.y2 = y2; - x += glyph->info.xOff; - y += glyph->info.yOff; - } - listTmp++; - } - TRIM_PICTURE_BOX (box, pDst); - if (BOX_NOT_EMPTY(box)) - damageDamageBox (pDst->pDrawable, &box, pDst->subWindowMode); - } - unwrap (pScrPriv, ps, Glyphs); - (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); - wrap (pScrPriv, ps, Glyphs, damageGlyphs); -} -#endif - -/**********************************************************/ - - -static void -damageFillSpans(DrawablePtr pDrawable, - GC *pGC, - int npt, - DDXPointPtr ppt, - int *pwidth, - int fSorted) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt && checkGCDamage (pDrawable, pGC)) - { - int nptTmp = npt; - DDXPointPtr pptTmp = ppt; - int *pwidthTmp = pwidth; - BoxRec box; - - box.x1 = pptTmp->x; - box.x2 = box.x1 + *pwidthTmp; - box.y2 = box.y1 = pptTmp->y; - - while(--nptTmp) - { - pptTmp++; - pwidthTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - if(box.x2 < (pptTmp->x + *pwidthTmp)) - box.x2 = pptTmp->x + *pwidthTmp; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - - box.y2++; - - if(!pGC->miTranslate) { - TRANSLATE_BOX(box, pDrawable); - } - TRIM_BOX(box, pGC); - - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - - (*pGC->ops->FillSpans)(pDrawable, pGC, npt, ppt, pwidth, fSorted); - - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damageSetSpans(DrawablePtr pDrawable, - GCPtr pGC, - char *pcharsrc, - DDXPointPtr ppt, - int *pwidth, - int npt, - int fSorted) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt && checkGCDamage (pDrawable, pGC)) - { - DDXPointPtr pptTmp = ppt; - int *pwidthTmp = pwidth; - int nptTmp = npt; - BoxRec box; - - box.x1 = pptTmp->x; - box.x2 = box.x1 + *pwidthTmp; - box.y2 = box.y1 = pptTmp->y; - - while(--nptTmp) - { - pptTmp++; - pwidthTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - if(box.x2 < (pptTmp->x + *pwidthTmp)) - box.x2 = pptTmp->x + *pwidthTmp; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - - box.y2++; - - if(!pGC->miTranslate) { - TRANSLATE_BOX(box, pDrawable); - } - TRIM_BOX(box, pGC); - - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->SetSpans)(pDrawable, pGC, pcharsrc, ppt, pwidth, npt, fSorted); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePutImage(DrawablePtr pDrawable, - GCPtr pGC, - int depth, - int x, - int y, - int w, - int h, - int leftPad, - int format, - char *pImage) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - if (checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - - box.x1 = x + pDrawable->x; - box.x2 = box.x1 + w; - box.y1 = y + pDrawable->y; - box.y2 = box.y1 + h; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PutImage)(pDrawable, pGC, depth, x, y, w, h, - leftPad, format, pImage); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static RegionPtr -damageCopyArea(DrawablePtr pSrc, - DrawablePtr pDst, - GC *pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, - int dsty) -{ - RegionPtr ret; - DAMAGE_GC_OP_PROLOGUE(pGC, pDst); - - /* The driver will only call SourceValidate() when pSrc != pDst, - * but the software sprite (misprite.c) always need to know when a - * drawable is copied so it can remove the sprite. See #1030. */ - if ((pSrc == pDst) && pSrc->pScreen->SourceValidate && - pSrc->type == DRAWABLE_WINDOW && - ((WindowPtr)pSrc)->viewable) - { - (*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height); - } - - if (checkGCDamage (pDst, pGC)) - { - BoxRec box; - - box.x1 = dstx + pDst->x; - box.x2 = box.x1 + width; - box.y1 = dsty + pDst->y; - box.y2 = box.y1 + height; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDst, &box, pGC->subWindowMode); - } - - ret = (*pGC->ops->CopyArea)(pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty); - DAMAGE_GC_OP_EPILOGUE(pGC, pDst); - return ret; -} - -static RegionPtr -damageCopyPlane(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, - int dsty, - unsigned long bitPlane) -{ - RegionPtr ret; - DAMAGE_GC_OP_PROLOGUE(pGC, pDst); - - /* The driver will only call SourceValidate() when pSrc != pDst, - * but the software sprite (misprite.c) always need to know when a - * drawable is copied so it can remove the sprite. See #1030. */ - if ((pSrc == pDst) && pSrc->pScreen->SourceValidate && - pSrc->type == DRAWABLE_WINDOW && - ((WindowPtr)pSrc)->viewable) - { - (*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height); - } - - if (checkGCDamage (pDst, pGC)) - { - BoxRec box; - - box.x1 = dstx + pDst->x; - box.x2 = box.x1 + width; - box.y1 = dsty + pDst->y; - box.y2 = box.y1 + height; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDst, &box, pGC->subWindowMode); - } - - ret = (*pGC->ops->CopyPlane)(pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - DAMAGE_GC_OP_EPILOGUE(pGC, pDst); - return ret; -} - -static void -damagePolyPoint(DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int npt, - xPoint *ppt) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - int nptTmp = npt; - xPoint *pptTmp = ppt; - - box.x2 = box.x1 = pptTmp->x; - box.y2 = box.y1 = pptTmp->y; - - /* this could be slow if the points were spread out */ - - while(--nptTmp) - { - pptTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - else if(box.x2 < pptTmp->x) box.x2 = pptTmp->x; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolyPoint)(pDrawable, pGC, mode, npt, ppt); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolylines(DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int npt, - DDXPointPtr ppt) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt && checkGCDamage (pDrawable, pGC)) - { - int nptTmp = npt; - DDXPointPtr pptTmp = ppt; - BoxRec box; - int extra = pGC->lineWidth >> 1; - - box.x2 = box.x1 = pptTmp->x; - box.y2 = box.y1 = pptTmp->y; - - if(nptTmp > 1) - { - if(pGC->joinStyle == JoinMiter) - extra = 6 * pGC->lineWidth; - else if(pGC->capStyle == CapProjecting) - extra = pGC->lineWidth; - } - - if(mode == CoordModePrevious) - { - int x = box.x1; - int y = box.y1; - while(--nptTmp) - { - pptTmp++; - x += pptTmp->x; - y += pptTmp->y; - if(box.x1 > x) box.x1 = x; - else if(box.x2 < x) box.x2 = x; - if(box.y1 > y) box.y1 = y; - else if(box.y2 < y) box.y2 = y; - } - } - else - { - while(--nptTmp) - { - pptTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - else if(box.x2 < pptTmp->x) box.x2 = pptTmp->x; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - } - - box.x2++; - box.y2++; - - if(extra) - { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->Polylines)(pDrawable, pGC, mode, npt, ppt); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolySegment(DrawablePtr pDrawable, - GCPtr pGC, - int nSeg, - xSegment *pSeg) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (nSeg && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - int extra = pGC->lineWidth; - int nsegTmp = nSeg; - xSegment *pSegTmp = pSeg; - - if(pGC->capStyle != CapProjecting) - extra >>= 1; - - if(pSegTmp->x2 > pSegTmp->x1) { - box.x1 = pSegTmp->x1; - box.x2 = pSegTmp->x2; - } else { - box.x2 = pSegTmp->x1; - box.x1 = pSegTmp->x2; - } - - if(pSegTmp->y2 > pSegTmp->y1) { - box.y1 = pSegTmp->y1; - box.y2 = pSegTmp->y2; - } else { - box.y2 = pSegTmp->y1; - box.y1 = pSegTmp->y2; - } - - while(--nsegTmp) - { - pSegTmp++; - if(pSegTmp->x2 > pSegTmp->x1) - { - if(pSegTmp->x1 < box.x1) box.x1 = pSegTmp->x1; - if(pSegTmp->x2 > box.x2) box.x2 = pSegTmp->x2; - } - else - { - if(pSegTmp->x2 < box.x1) box.x1 = pSegTmp->x2; - if(pSegTmp->x1 > box.x2) box.x2 = pSegTmp->x1; - } - if(pSegTmp->y2 > pSegTmp->y1) - { - if(pSegTmp->y1 < box.y1) box.y1 = pSegTmp->y1; - if(pSegTmp->y2 > box.y2) box.y2 = pSegTmp->y2; - } - else - { - if(pSegTmp->y2 < box.y1) box.y1 = pSegTmp->y2; - if(pSegTmp->y1 > box.y2) box.y2 = pSegTmp->y1; - } - } - - box.x2++; - box.y2++; - - if(extra) - { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolySegment)(pDrawable, pGC, nSeg, pSeg); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolyRectangle(DrawablePtr pDrawable, - GCPtr pGC, - int nRects, - xRectangle *pRects) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (nRects && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - int offset1, offset2, offset3; - int nRectsTmp = nRects; - xRectangle *pRectsTmp = pRects; - - offset2 = pGC->lineWidth; - if(!offset2) offset2 = 1; - offset1 = offset2 >> 1; - offset3 = offset2 - offset1; - - while(nRectsTmp--) - { - box.x1 = pRectsTmp->x - offset1; - box.y1 = pRectsTmp->y - offset1; - box.x2 = box.x1 + pRectsTmp->width + offset2; - box.y2 = box.y1 + offset2; - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - - box.x1 = pRectsTmp->x - offset1; - box.y1 = pRectsTmp->y + offset3; - box.x2 = box.x1 + offset2; - box.y2 = box.y1 + pRectsTmp->height - offset2; - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - - box.x1 = pRectsTmp->x + pRectsTmp->width - offset1; - box.y1 = pRectsTmp->y + offset3; - box.x2 = box.x1 + offset2; - box.y2 = box.y1 + pRectsTmp->height - offset2; - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - - box.x1 = pRectsTmp->x - offset1; - box.y1 = pRectsTmp->y + pRectsTmp->height - offset1; - box.x2 = box.x1 + pRectsTmp->width + offset2; - box.y2 = box.y1 + offset2; - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - - pRectsTmp++; - } - } - (*pGC->ops->PolyRectangle)(pDrawable, pGC, nRects, pRects); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolyArc(DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (nArcs && checkGCDamage (pDrawable, pGC)) - { - int extra = pGC->lineWidth >> 1; - BoxRec box; - int nArcsTmp = nArcs; - xArc *pArcsTmp = pArcs; - - box.x1 = pArcsTmp->x; - box.x2 = box.x1 + pArcsTmp->width; - box.y1 = pArcsTmp->y; - box.y2 = box.y1 + pArcsTmp->height; - - while(--nArcsTmp) - { - pArcsTmp++; - if(box.x1 > pArcsTmp->x) - box.x1 = pArcsTmp->x; - if(box.x2 < (pArcsTmp->x + pArcsTmp->width)) - box.x2 = pArcsTmp->x + pArcsTmp->width; - if(box.y1 > pArcsTmp->y) - box.y1 = pArcsTmp->y; - if(box.y2 < (pArcsTmp->y + pArcsTmp->height)) - box.y2 = pArcsTmp->y + pArcsTmp->height; - } - - if(extra) - { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolyArc)(pDrawable, pGC, nArcs, pArcs); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damageFillPolygon(DrawablePtr pDrawable, - GCPtr pGC, - int shape, - int mode, - int npt, - DDXPointPtr ppt) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt > 2 && checkGCDamage (pDrawable, pGC)) - { - DDXPointPtr pptTmp = ppt; - int nptTmp = npt; - BoxRec box; - - box.x2 = box.x1 = pptTmp->x; - box.y2 = box.y1 = pptTmp->y; - - if(mode != CoordModeOrigin) - { - int x = box.x1; - int y = box.y1; - while(--nptTmp) - { - pptTmp++; - x += pptTmp->x; - y += pptTmp->y; - if(box.x1 > x) box.x1 = x; - else if(box.x2 < x) box.x2 = x; - if(box.y1 > y) box.y1 = y; - else if(box.y2 < y) box.y2 = y; - } - } - else - { - while(--nptTmp) - { - pptTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - else if(box.x2 < pptTmp->x) box.x2 = pptTmp->x; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - - (*pGC->ops->FillPolygon)(pDrawable, pGC, shape, mode, npt, ppt); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - - -static void -damagePolyFillRect(DrawablePtr pDrawable, - GCPtr pGC, - int nRects, - xRectangle *pRects) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - if (nRects && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - xRectangle *pRectsTmp = pRects; - int nRectsTmp = nRects; - - box.x1 = pRectsTmp->x; - box.x2 = box.x1 + pRectsTmp->width; - box.y1 = pRectsTmp->y; - box.y2 = box.y1 + pRectsTmp->height; - - while(--nRectsTmp) - { - pRectsTmp++; - if(box.x1 > pRectsTmp->x) box.x1 = pRectsTmp->x; - if(box.x2 < (pRectsTmp->x + pRectsTmp->width)) - box.x2 = pRectsTmp->x + pRectsTmp->width; - if(box.y1 > pRectsTmp->y) box.y1 = pRectsTmp->y; - if(box.y2 < (pRectsTmp->y + pRectsTmp->height)) - box.y2 = pRectsTmp->y + pRectsTmp->height; - } - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolyFillRect)(pDrawable, pGC, nRects, pRects); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - - -static void -damagePolyFillArc(DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (nArcs && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - int nArcsTmp = nArcs; - xArc *pArcsTmp = pArcs; - - box.x1 = pArcsTmp->x; - box.x2 = box.x1 + pArcsTmp->width; - box.y1 = pArcsTmp->y; - box.y2 = box.y1 + pArcsTmp->height; - - while(--nArcsTmp) - { - pArcsTmp++; - if(box.x1 > pArcsTmp->x) - box.x1 = pArcsTmp->x; - if(box.x2 < (pArcsTmp->x + pArcsTmp->width)) - box.x2 = pArcsTmp->x + pArcsTmp->width; - if(box.y1 > pArcsTmp->y) - box.y1 = pArcsTmp->y; - if(box.y2 < (pArcsTmp->y + pArcsTmp->height)) - box.y2 = pArcsTmp->y + pArcsTmp->height; - } - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolyFillArc)(pDrawable, pGC, nArcs, pArcs); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -/* - * general Poly/Image text function. Extract glyph information, - * compute bounding box and remove cursor if it is overlapped. - */ - -static void -damageDamageChars (DrawablePtr pDrawable, - FontPtr font, - int x, - int y, - unsigned int n, - CharInfoPtr *charinfo, - Bool imageblt, - int subWindowMode) -{ - ExtentInfoRec extents; - BoxRec box; - - QueryGlyphExtents(font, charinfo, n, &extents); - if (imageblt) - { - if (extents.overallWidth > extents.overallRight) - extents.overallRight = extents.overallWidth; - if (extents.overallWidth < extents.overallLeft) - extents.overallLeft = extents.overallWidth; - if (extents.overallLeft > 0) - extents.overallLeft = 0; - if (extents.fontAscent > extents.overallAscent) - extents.overallAscent = extents.fontAscent; - if (extents.fontDescent > extents.overallDescent) - extents.overallDescent = extents.fontDescent; - } - box.x1 = x + extents.overallLeft; - box.y1 = y - extents.overallAscent; - box.x2 = x + extents.overallRight; - box.y2 = y + extents.overallDescent; - damageDamageBox (pDrawable, &box, subWindowMode); -} - -/* - * values for textType: - */ -#define TT_POLY8 0 -#define TT_IMAGE8 1 -#define TT_POLY16 2 -#define TT_IMAGE16 3 - -static int -damageText (DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned long count, - char *chars, - FontEncoding fontEncoding, - Bool textType) -{ - CharInfoPtr *charinfo; - CharInfoPtr *info; - unsigned long i; - unsigned int n; - int w; - Bool imageblt; - - imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16); - - charinfo = (CharInfoPtr *) ALLOCATE_LOCAL(count * sizeof(CharInfoPtr)); - if (!charinfo) - return x; - - GetGlyphs(pGC->font, count, (unsigned char *)chars, - fontEncoding, &i, charinfo); - n = (unsigned int)i; - w = 0; - if (!imageblt) - for (info = charinfo; i--; info++) - w += (*info)->metrics.characterWidth; - - if (n != 0) { - damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, n, - charinfo, imageblt, pGC->subWindowMode); - -#ifndef NXAGENT_SERVER - - if (imageblt) - (*pGC->ops->ImageGlyphBlt)(pDrawable, pGC, x, y, n, charinfo, - FONTGLYPHS(pGC->font)); - else - (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, n, charinfo, - FONTGLYPHS(pGC->font)); -#endif - - } - DEALLOCATE_LOCAL(charinfo); - return x + w; -} - -#ifndef NXAGENT_SERVER - -static int -damagePolyText8(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - x = damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_POLY8); - else - x = (*pGC->ops->PolyText8)(pDrawable, pGC, x, y, count, chars); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); - return x; -} - -static int -damagePolyText16(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - x = damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_POLY16); - else - x = (*pGC->ops->PolyText16)(pDrawable, pGC, x, y, count, chars); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); - return x; -} - -static void -damageImageText8(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_IMAGE8); - else - (*pGC->ops->ImageText8)(pDrawable, pGC, x, y, count, chars); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damageImageText16(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_IMAGE16); - else - (*pGC->ops->ImageText16)(pDrawable, pGC, x, y, count, chars); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -#else /* #ifndef NXAGENT_SERVER */ - -static int -damagePolyText8(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_POLY8); - - x = (*pGC->ops->PolyText8)(pDrawable, pGC, x, y, count, chars); - - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); - return x; -} - -static int -damagePolyText16(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_POLY16); - - x = (*pGC->ops->PolyText16)(pDrawable, pGC, x, y, count, chars); - - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); - return x; -} - -static void -damageImageText8(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_IMAGE8); - - (*pGC->ops->ImageText8)(pDrawable, pGC, x, y, count, chars); - - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damageImageText16(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_IMAGE16); - - (*pGC->ops->ImageText16)(pDrawable, pGC, x, y, count, chars); - - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -#endif /* #ifndef NXAGENT_SERVER */ - -static void -damageImageGlyphBlt(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned int nglyph, - CharInfoPtr *ppci, - pointer pglyphBase) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, - nglyph, ppci, TRUE, pGC->subWindowMode); - (*pGC->ops->ImageGlyphBlt)(pDrawable, pGC, x, y, nglyph, - ppci, pglyphBase); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolyGlyphBlt(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned int nglyph, - CharInfoPtr *ppci, - pointer pglyphBase) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, - nglyph, ppci, FALSE, pGC->subWindowMode); - (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, - ppci, pglyphBase); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePushPixels(GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDrawable, - int dx, - int dy, - int xOrg, - int yOrg) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - if(checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - - box.x1 = xOrg; - box.y1 = yOrg; - - if(!pGC->miTranslate) { - box.x1 += pDrawable->x; - box.y1 += pDrawable->y; - } - - box.x2 = box.x1 + dx; - box.y2 = box.y1 + dy; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PushPixels)(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damageRemoveDamage (DamagePtr *pPrev, DamagePtr pDamage) -{ - while (*pPrev) - { - if (*pPrev == pDamage) - { - *pPrev = pDamage->pNext; - return; - } - pPrev = &(*pPrev)->pNext; - } -#if DAMAGE_VALIDATE_ENABLE - ErrorF ("Damage not on list\n"); - abort (); -#endif -} - -static void -damageInsertDamage (DamagePtr *pPrev, DamagePtr pDamage) -{ -#if DAMAGE_VALIDATE_ENABLE - DamagePtr pOld; - - for (pOld = *pPrev; pOld; pOld = pOld->pNext) - if (pOld == pDamage) { - ErrorF ("Damage already on list\n"); - abort (); - } -#endif - pDamage->pNext = *pPrev; - *pPrev = pDamage; -} - -static Bool -damageDestroyPixmap (PixmapPtr pPixmap) -{ - ScreenPtr pScreen = pPixmap->drawable.pScreen; - damageScrPriv(pScreen); - - if (pPixmap->refcnt == 1) - { - DamagePtr *pPrev = getPixmapDamageRef (pPixmap); - DamagePtr pDamage; - - while ((pDamage = *pPrev)) - { - damageRemoveDamage (pPrev, pDamage); - if (!pDamage->isWindow) - DamageDestroy (pDamage); - } - } - unwrap (pScrPriv, pScreen, DestroyPixmap); - (*pScreen->DestroyPixmap) (pPixmap); - wrap (pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); - return TRUE; -} - -static void -damagePaintWindow(WindowPtr pWindow, - RegionPtr prgn, - int what) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - /* - * Painting background none doesn't actually *do* anything, so - * no damage is recorded - */ - if ((what != PW_BACKGROUND || pWindow->backgroundState != None) && - getWindowDamage (pWindow)) - damageDamageRegion (&pWindow->drawable, prgn, FALSE, -1); - if(what == PW_BACKGROUND) { - unwrap (pScrPriv, pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWindow, prgn, what); - wrap (pScrPriv, pScreen, PaintWindowBackground, damagePaintWindow); - } else { - unwrap (pScrPriv, pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWindow, prgn, what); - wrap (pScrPriv, pScreen, PaintWindowBorder, damagePaintWindow); - } -} - - -static void -damageCopyWindow(WindowPtr pWindow, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - if (getWindowDamage (pWindow)) - { - int dx = pWindow->drawable.x - ptOldOrg.x; - int dy = pWindow->drawable.y - ptOldOrg.y; - - /* - * The region comes in source relative, but the damage occurs - * at the destination location. Translate back and forth. - */ - REGION_TRANSLATE (pScreen, prgnSrc, dx, dy); - damageDamageRegion (&pWindow->drawable, prgnSrc, FALSE, -1); - REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy); - } - unwrap (pScrPriv, pScreen, CopyWindow); - (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc); - wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow); -} - -GCOps damageGCOps = { - damageFillSpans, damageSetSpans, - damagePutImage, damageCopyArea, - damageCopyPlane, damagePolyPoint, - damagePolylines, damagePolySegment, - damagePolyRectangle, damagePolyArc, - damageFillPolygon, damagePolyFillRect, - damagePolyFillArc, damagePolyText8, - damagePolyText16, damageImageText8, - damageImageText16, damageImageGlyphBlt, - damagePolyGlyphBlt, damagePushPixels, -#ifdef NEED_LINEHELPER - NULL, -#endif - {NULL} /* devPrivate */ -}; - -static void -damageRestoreAreas (PixmapPtr pPixmap, - RegionPtr prgn, - int xorg, - int yorg, - WindowPtr pWindow) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - damageDamageRegion (&pWindow->drawable, prgn, FALSE, -1); - unwrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas); - (*pScreen->BackingStoreFuncs.RestoreAreas) (pPixmap, prgn, - xorg, yorg, pWindow); - wrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas, - damageRestoreAreas); -} - -static void -damageSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap) -{ - DamagePtr pDamage; - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - if ((pDamage = damageGetWinPriv(pWindow))) - { - PixmapPtr pOldPixmap = (*pScreen->GetWindowPixmap) (pWindow); - DamagePtr *pPrev = getPixmapDamageRef(pOldPixmap); - - while (pDamage) - { - damageRemoveDamage (pPrev, pDamage); - pDamage = pDamage->pNextWin; - } - } - unwrap (pScrPriv, pScreen, SetWindowPixmap); - (*pScreen->SetWindowPixmap) (pWindow, pPixmap); - wrap (pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); - if ((pDamage = damageGetWinPriv(pWindow))) - { - DamagePtr *pPrev = getPixmapDamageRef(pPixmap); - - while (pDamage) - { - damageInsertDamage (pPrev, pDamage); - pDamage = pDamage->pNextWin; - } - } -} - -static Bool -damageDestroyWindow (WindowPtr pWindow) -{ - DamagePtr pDamage; - ScreenPtr pScreen = pWindow->drawable.pScreen; - Bool ret; - damageScrPriv(pScreen); - - while ((pDamage = damageGetWinPriv(pWindow))) - { - DamageUnregister (&pWindow->drawable, pDamage); - DamageDestroy (pDamage); - } - unwrap (pScrPriv, pScreen, DestroyWindow); - ret = (*pScreen->DestroyWindow) (pWindow); - wrap (pScrPriv, pScreen, DestroyWindow, damageDestroyWindow); - return ret; -} - -static Bool -damageCloseScreen (int i, ScreenPtr pScreen) -{ - damageScrPriv(pScreen); - - unwrap (pScrPriv, pScreen, DestroyPixmap); - unwrap (pScrPriv, pScreen, CreateGC); - unwrap (pScrPriv, pScreen, PaintWindowBackground); - unwrap (pScrPriv, pScreen, PaintWindowBorder); - unwrap (pScrPriv, pScreen, CopyWindow); - unwrap (pScrPriv, pScreen, CloseScreen); - unwrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas); - xfree (pScrPriv); - return (*pScreen->CloseScreen) (i, pScreen); -} - -int damageScrPrivateIndex; -int damagePixPrivateIndex; -int damageGCPrivateIndex; -int damageWinPrivateIndex; -int damageGeneration; - -Bool -DamageSetup (ScreenPtr pScreen) -{ - DamageScrPrivPtr pScrPriv; -#ifdef RENDER - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); -#endif - - if (damageGeneration != serverGeneration) - { - damageScrPrivateIndex = AllocateScreenPrivateIndex (); - if (damageScrPrivateIndex == -1) - return FALSE; - damageGCPrivateIndex = AllocateGCPrivateIndex (); - if (damageGCPrivateIndex == -1) - return FALSE; - damagePixPrivateIndex = AllocatePixmapPrivateIndex (); - if (damagePixPrivateIndex == -1) - return FALSE; - damageWinPrivateIndex = AllocateWindowPrivateIndex (); - if (damageWinPrivateIndex == -1) - return FALSE; - damageGeneration = serverGeneration; - } - if (pScreen->devPrivates[damageScrPrivateIndex].ptr) - return TRUE; - - if (!AllocateGCPrivate (pScreen, damageGCPrivateIndex, sizeof (DamageGCPrivRec))) - return FALSE; - if (!AllocatePixmapPrivate (pScreen, damagePixPrivateIndex, 0)) - return FALSE; - if (!AllocateWindowPrivate (pScreen, damageWinPrivateIndex, 0)) - return FALSE; - - pScrPriv = (DamageScrPrivPtr) xalloc (sizeof (DamageScrPrivRec)); - if (!pScrPriv) - return FALSE; - -#ifdef COMPOSITE - /* This is a kludge to ensure wrapping order with the composite wrapper. - * If it's done from compinit.c, then DamageSetup may be called before the - * extension init phase, so that cw will be higher in the wrapping chain and - * rewrite drawables before damage gets to it, causing confusion. - */ - if (!noCompositeExtension) - miInitializeCompositeWrapper (pScreen); -#endif - - pScrPriv->internalLevel = 0; - pScrPriv->pScreenDamage = 0; - - wrap (pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); - wrap (pScrPriv, pScreen, CreateGC, damageCreateGC); - wrap (pScrPriv, pScreen, PaintWindowBackground, damagePaintWindow); - wrap (pScrPriv, pScreen, PaintWindowBorder, damagePaintWindow); - wrap (pScrPriv, pScreen, DestroyWindow, damageDestroyWindow); - wrap (pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); - wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow); - wrap (pScrPriv, pScreen, CloseScreen, damageCloseScreen); - wrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas, - damageRestoreAreas); -#ifdef RENDER - if (ps) { - wrap (pScrPriv, ps, Glyphs, damageGlyphs); - wrap (pScrPriv, ps, Composite, damageComposite); - } -#endif - - pScreen->devPrivates[damageScrPrivateIndex].ptr = (pointer) pScrPriv; - return TRUE; -} - -DamagePtr -DamageCreate (DamageReportFunc damageReport, - DamageDestroyFunc damageDestroy, - DamageReportLevel damageLevel, - Bool isInternal, - ScreenPtr pScreen, - void *closure) -{ - DamagePtr pDamage; - - pDamage = xalloc (sizeof (DamageRec)); - if (!pDamage) - return 0; - pDamage->pNext = 0; - pDamage->pNextWin = 0; - REGION_NULL(pScreen, &pDamage->damage); - - pDamage->damageLevel = damageLevel; - pDamage->isInternal = isInternal; - pDamage->closure = closure; - pDamage->isWindow = FALSE; - pDamage->pDrawable = 0; - - pDamage->damageReport = damageReport; - pDamage->damageDestroy = damageDestroy; - return pDamage; -} - -void -DamageRegister (DrawablePtr pDrawable, - DamagePtr pDamage) -{ - if (pDrawable->type == DRAWABLE_WINDOW) - { - WindowPtr pWindow = (WindowPtr) pDrawable; - winDamageRef(pWindow); - -#if DAMAGE_VALIDATE_ENABLE - DamagePtr pOld; - - for (pOld = *pPrev; pOld; pOld = pOld->pNextWin) - if (pOld == pDamage) { - ErrorF ("Damage already on window list\n"); - abort (); - } -#endif - pDamage->pNextWin = *pPrev; - *pPrev = pDamage; - pDamage->isWindow = TRUE; - } - else - pDamage->isWindow = FALSE; - pDamage->pDrawable = pDrawable; - damageInsertDamage (getDrawableDamageRef (pDrawable), pDamage); -} - -void -DamageDrawInternal (ScreenPtr pScreen, Bool enable) -{ - damageScrPriv (pScreen); - - pScrPriv->internalLevel += enable ? 1 : -1; -} - -void -DamageUnregister (DrawablePtr pDrawable, - DamagePtr pDamage) -{ - if (pDrawable->type == DRAWABLE_WINDOW) - { - WindowPtr pWindow = (WindowPtr) pDrawable; - winDamageRef (pWindow); -#if DAMAGE_VALIDATE_ENABLE - int found = 0; -#endif - - while (*pPrev) - { - if (*pPrev == pDamage) - { - *pPrev = pDamage->pNextWin; -#if DAMAGE_VALIDATE_ENABLE - found = 1; -#endif - break; - } - pPrev = &(*pPrev)->pNextWin; - } -#if DAMAGE_VALIDATE_ENABLE - if (!found) { - ErrorF ("Damage not on window list\n"); - abort (); - } -#endif - } - pDamage->pDrawable = 0; - damageRemoveDamage (getDrawableDamageRef (pDrawable), pDamage); -} - -void -DamageDestroy (DamagePtr pDamage) -{ - if (pDamage->damageDestroy) - (*pDamage->damageDestroy) (pDamage, pDamage->closure); - REGION_UNINIT (pDamage->pDrawable->pScreen, &pDamage->damage); - xfree (pDamage); -} - -Bool -DamageSubtract (DamagePtr pDamage, - const RegionPtr pRegion) -{ - RegionPtr pClip; - RegionRec pixmapClip; - DrawablePtr pDrawable = pDamage->pDrawable; - - REGION_SUBTRACT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pRegion); - if (pDrawable) - { - if (pDrawable->type == DRAWABLE_WINDOW) - pClip = &((WindowPtr) pDrawable)->borderClip; - else - { - BoxRec box; - - box.x1 = pDrawable->x; - box.y1 = pDrawable->y; - box.x2 = pDrawable->x + pDrawable->width; - box.y2 = pDrawable->y + pDrawable->height; - REGION_INIT (pDrawable->pScreen, &pixmapClip, &box, 1); - pClip = &pixmapClip; - } - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, pDrawable->x, pDrawable->y); - REGION_INTERSECT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pClip); - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, -pDrawable->x, -pDrawable->y); - if (pDrawable->type != DRAWABLE_WINDOW) - REGION_UNINIT(pDrawable->pScreen, &pixmapClip); - } - return REGION_NOTEMPTY (pDrawable->pScreen, &pDamage->damage); -} - -void -DamageEmpty (DamagePtr pDamage) -{ - REGION_EMPTY (pDamage->pDrawable->pScreen, &pDamage->damage); -} - -RegionPtr -DamageRegion (DamagePtr pDamage) -{ - return &pDamage->damage; -} - -void -DamageDamageRegion (DrawablePtr pDrawable, - RegionPtr pRegion) -{ - damageDamageRegion (pDrawable, pRegion, FALSE, -1); -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.X.original deleted file mode 100644 index 286728cd1..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.X.original +++ /dev/null @@ -1,1966 +0,0 @@ -/* - * $Id: damage.c,v 1.19 2005/10/06 21:55:41 anholt Exp $ - * - * Copyright © 2003 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "scrnintstr.h" -#include "windowstr.h" -#include -#include "dixfontstr.h" -#include -#include "mi.h" -#include "regionstr.h" -#include "globals.h" -#include "gcstruct.h" -#include "damage.h" -#include "damagestr.h" -#ifdef COMPOSITE -#include "cw.h" -#endif - -#define wrap(priv, real, mem, func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv, real, mem) {\ - real->mem = priv->mem; \ -} - -#define BOX_SAME(a,b) \ - ((a)->x1 == (b)->x1 && \ - (a)->y1 == (b)->y1 && \ - (a)->x2 == (b)->x2 && \ - (a)->y2 == (b)->y2) - -#define DAMAGE_VALIDATE_ENABLE 0 -#define DAMAGE_DEBUG_ENABLE 0 -#if DAMAGE_DEBUG_ENABLE -#define DAMAGE_DEBUG(x) ErrorF x -#else -#define DAMAGE_DEBUG(x) -#endif - -#define getPixmapDamageRef(pPixmap) \ - ((DamagePtr *) &(pPixmap->devPrivates[damagePixPrivateIndex].ptr)) - -#define pixmapDamage(pPixmap) damagePixPriv(pPixmap) - -static DamagePtr * -getDrawableDamageRef (DrawablePtr pDrawable) -{ - PixmapPtr pPixmap; - - if (pDrawable->type == DRAWABLE_WINDOW) - { - ScreenPtr pScreen = pDrawable->pScreen; - - pPixmap = 0; - if (pScreen->GetWindowPixmap -#ifdef ROOTLESS_WORKAROUND - && ((WindowPtr)pDrawable)->viewable -#endif - ) - pPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr)pDrawable); - - if (!pPixmap) - { - damageScrPriv(pScreen); - - return &pScrPriv->pScreenDamage; - } - } - else - pPixmap = (PixmapPtr) pDrawable; - return getPixmapDamageRef (pPixmap); -} - -#define getDrawableDamage(pDrawable) (*getDrawableDamageRef (pDrawable)) -#define getWindowDamage(pWin) getDrawableDamage(&(pWin)->drawable) - -#define drawableDamage(pDrawable) \ - DamagePtr pDamage = getDrawableDamage(pDrawable) - -#define windowDamage(pWin) drawableDamage(&(pWin)->drawable) - -#define winDamageRef(pWindow) \ - DamagePtr *pPrev = (DamagePtr *) \ - &(pWindow->devPrivates[damageWinPrivateIndex].ptr) - -#if DAMAGE_DEBUG_ENABLE -static void -_damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, int subWindowMode, const char *where) -#define damageDamageRegion(d,r,c,m) _damageDamageRegion(d,r,c,m,__FUNCTION__) -#else -static void -damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, - int subWindowMode) -#endif -{ - ScreenPtr pScreen = pDrawable->pScreen; - damageScrPriv(pScreen); - drawableDamage(pDrawable); - DamagePtr pNext; - RegionRec clippedRec; - RegionPtr pDamageRegion; - RegionRec pixClip; - Bool was_empty; - RegionRec tmpRegion; - BoxRec tmpBox; - int draw_x, draw_y; -#ifdef COMPOSITE - int screen_x = 0, screen_y = 0; -#endif - - /* short circuit for empty regions */ - if (!REGION_NOTEMPTY(pScreen, pRegion)) - return; - -#ifdef COMPOSITE - /* - * When drawing to a pixmap which is storing window contents, - * the region presented is in pixmap relative coordinates which - * need to be converted to screen relative coordinates - */ - if (pDrawable->type != DRAWABLE_WINDOW) - { - screen_x = ((PixmapPtr) pDrawable)->screen_x - pDrawable->x; - screen_y = ((PixmapPtr) pDrawable)->screen_y - pDrawable->y; - } - if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y); -#endif - - if (pDrawable->type == DRAWABLE_WINDOW && - ((WindowPtr)(pDrawable))->backingStore == NotUseful) - { - if (subWindowMode == ClipByChildren) - { - REGION_INTERSECT(pScreen, pRegion, pRegion, - &((WindowPtr)(pDrawable))->clipList); - } - else if (subWindowMode == IncludeInferiors) - { - RegionPtr pTempRegion = - NotClippedByChildren((WindowPtr)(pDrawable)); - REGION_INTERSECT(pScreen, pRegion, pRegion, pTempRegion); - REGION_DESTROY(pScreen, pTempRegion); - } - /* If subWindowMode is set to an invalid value, don't perform - * any drawable-based clipping. */ - } - - - REGION_NULL (pScreen, &clippedRec); - for (; pDamage; pDamage = pNext) - { - pNext = pDamage->pNext; - /* - * Check for internal damage and don't send events - */ - if (pScrPriv->internalLevel > 0 && !pDamage->isInternal) - { - DAMAGE_DEBUG (("non internal damage, skipping at %d\n", - pScrPriv->internalLevel)); - continue; - } - /* - * Check for unrealized windows - */ - if (pDamage->pDrawable->type == DRAWABLE_WINDOW && - !((WindowPtr) (pDamage->pDrawable))->realized) - { -#if 0 - DAMAGE_DEBUG (("damage while window unrealized\n")); -#endif - continue; - } - - draw_x = pDamage->pDrawable->x; - draw_y = pDamage->pDrawable->y; -#ifdef COMPOSITE - /* - * Need to move everyone to screen coordinates - * XXX what about off-screen pixmaps with non-zero x/y? - */ - if (pDamage->pDrawable->type != DRAWABLE_WINDOW) - { - draw_x += ((PixmapPtr) pDamage->pDrawable)->screen_x; - draw_y += ((PixmapPtr) pDamage->pDrawable)->screen_y; - } -#endif - - /* - * Clip against border or pixmap bounds - */ - - pDamageRegion = pRegion; - if (clip || pDamage->pDrawable != pDrawable) - { - pDamageRegion = &clippedRec; - if (pDamage->pDrawable->type == DRAWABLE_WINDOW) { - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, - &((WindowPtr)(pDamage->pDrawable))->borderClip); - } else { - BoxRec box; - box.x1 = draw_x; - box.y1 = draw_y; - box.x2 = draw_x + pDamage->pDrawable->width; - box.y2 = draw_y + pDamage->pDrawable->height; - REGION_INIT(pScreen, &pixClip, &box, 1); - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, &pixClip); - REGION_UNINIT(pScreen, &pixClip); - } - /* - * Short circuit empty results - */ - if (!REGION_NOTEMPTY(pScreen, pDamageRegion)) - continue; - } - - DAMAGE_DEBUG (("%s %d x %d +%d +%d (target 0x%lx monitor 0x%lx)\n", - where, - pDamageRegion->extents.x2 - pDamageRegion->extents.x1, - pDamageRegion->extents.y2 - pDamageRegion->extents.y1, - pDamageRegion->extents.x1, pDamageRegion->extents.y1, - pDrawable->id, pDamage->pDrawable->id)); - - /* - * Move region to target coordinate space - */ - if (draw_x || draw_y) - REGION_TRANSLATE (pScreen, pDamageRegion, -draw_x, -draw_y); - - switch (pDamage->damageLevel) { - case DamageReportRawRegion: - (*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure); - break; - case DamageReportDeltaRegion: - REGION_NULL (pScreen, &tmpRegion); - REGION_SUBTRACT (pScreen, &tmpRegion, pDamageRegion, &pDamage->damage); - if (REGION_NOTEMPTY (pScreen, &tmpRegion)) - { - REGION_UNION(pScreen, &pDamage->damage, - &pDamage->damage, pDamageRegion); - (*pDamage->damageReport) (pDamage, &tmpRegion, pDamage->closure); - } - REGION_UNINIT(pScreen, &tmpRegion); - break; - case DamageReportBoundingBox: - tmpBox = *REGION_EXTENTS (pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, - &pDamage->damage, pDamageRegion); - if (!BOX_SAME (&tmpBox, REGION_EXTENTS (pScreen, &pDamage->damage))) - (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); - break; - case DamageReportNonEmpty: - was_empty = !REGION_NOTEMPTY(pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, - pDamageRegion); - if (was_empty && REGION_NOTEMPTY(pScreen, &pDamage->damage)) - (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); - break; - case DamageReportNone: - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, - pDamageRegion); - break; - } - /* - * translate original region back - */ - if (pDamageRegion == pRegion && (draw_x || draw_y)) - REGION_TRANSLATE (pScreen, pDamageRegion, draw_x, draw_y); - } -#ifdef COMPOSITE - if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, -screen_x, -screen_y); -#endif - - REGION_UNINIT (pScreen, &clippedRec); -} - -#if DAMAGE_DEBUG_ENABLE -#define damageDamageBox(d,b,m) _damageDamageBox(d,b,m,__FUNCTION__) -static void -_damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode, const char *where) -#else -static void -damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode) -#endif -{ - RegionRec region; - - REGION_INIT (pDrawable->pScreen, ®ion, pBox, 1); -#if DAMAGE_DEBUG_ENABLE - _damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode, where); -#else - damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode); -#endif - REGION_UNINIT (pDrawable->pScreen, ®ion); -} - -static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); -static void damageChangeGC(GCPtr, unsigned long); -static void damageCopyGC(GCPtr, unsigned long, GCPtr); -static void damageDestroyGC(GCPtr); -static void damageChangeClip(GCPtr, int, pointer, int); -static void damageDestroyClip(GCPtr); -static void damageCopyClip(GCPtr, GCPtr); - -GCFuncs damageGCFuncs = { - damageValidateGC, damageChangeGC, damageCopyGC, damageDestroyGC, - damageChangeClip, damageDestroyClip, damageCopyClip -}; - -extern GCOps damageGCOps; - -static Bool -damageCreateGC(GCPtr pGC) -{ - ScreenPtr pScreen = pGC->pScreen; - damageScrPriv(pScreen); - damageGCPriv(pGC); - Bool ret; - - pGC->pCompositeClip = 0; - unwrap (pScrPriv, pScreen, CreateGC); - if((ret = (*pScreen->CreateGC) (pGC))) { - pGCPriv->ops = NULL; - pGCPriv->funcs = pGC->funcs; - pGC->funcs = &damageGCFuncs; - } - wrap (pScrPriv, pScreen, CreateGC, damageCreateGC); - - return ret; -} - -#ifdef NOTUSED -static void -damageWrapGC (GCPtr pGC) -{ - damageGCPriv(pGC); - - pGCPriv->ops = NULL; - pGCPriv->funcs = pGC->funcs; - pGC->funcs = &damageGCFuncs; -} - -static void -damageUnwrapGC (GCPtr pGC) -{ - damageGCPriv(pGC); - - pGC->funcs = pGCPriv->funcs; - if (pGCPriv->ops) - pGC->ops = pGCPriv->ops; -} -#endif - -#define DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable) \ - damageGCPriv(pGC); \ - GCFuncs *oldFuncs = pGC->funcs; \ - unwrap(pGCPriv, pGC, funcs); \ - unwrap(pGCPriv, pGC, ops); \ - -#define DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable) \ - wrap(pGCPriv, pGC, funcs, oldFuncs); \ - wrap(pGCPriv, pGC, ops, &damageGCOps) - -#define DAMAGE_GC_FUNC_PROLOGUE(pGC) \ - damageGCPriv(pGC); \ - unwrap(pGCPriv, pGC, funcs); \ - if (pGCPriv->ops) unwrap(pGCPriv, pGC, ops) - -#define DAMAGE_GC_FUNC_EPILOGUE(pGC) \ - wrap(pGCPriv, pGC, funcs, &damageGCFuncs); \ - if (pGCPriv->ops) wrap(pGCPriv, pGC, ops, &damageGCOps) - -static void -damageValidateGC(GCPtr pGC, - unsigned long changes, - DrawablePtr pDrawable) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->ValidateGC)(pGC, changes, pDrawable); - pGCPriv->ops = pGC->ops; /* just so it's not NULL */ - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -static void -damageDestroyGC(GCPtr pGC) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->DestroyGC)(pGC); - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -static void -damageChangeGC (GCPtr pGC, - unsigned long mask) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->ChangeGC) (pGC, mask); - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -static void -damageCopyGC (GCPtr pGCSrc, - unsigned long mask, - GCPtr pGCDst) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGCDst); - (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); - DAMAGE_GC_FUNC_EPILOGUE (pGCDst); -} - -static void -damageChangeClip (GCPtr pGC, - int type, - pointer pvalue, - int nrects) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -static void -damageCopyClip(GCPtr pgcDst, GCPtr pgcSrc) -{ - DAMAGE_GC_FUNC_PROLOGUE (pgcDst); - (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc); - DAMAGE_GC_FUNC_EPILOGUE (pgcDst); -} - -static void -damageDestroyClip(GCPtr pGC) -{ - DAMAGE_GC_FUNC_PROLOGUE (pGC); - (* pGC->funcs->DestroyClip)(pGC); - DAMAGE_GC_FUNC_EPILOGUE (pGC); -} - -#define TRIM_BOX(box, pGC) if (pGC->pCompositeClip) { \ - BoxPtr extents = &pGC->pCompositeClip->extents;\ - if(box.x1 < extents->x1) box.x1 = extents->x1; \ - if(box.x2 > extents->x2) box.x2 = extents->x2; \ - if(box.y1 < extents->y1) box.y1 = extents->y1; \ - if(box.y2 > extents->y2) box.y2 = extents->y2; \ - } - -#define TRANSLATE_BOX(box, pDrawable) { \ - box.x1 += pDrawable->x; \ - box.x2 += pDrawable->x; \ - box.y1 += pDrawable->y; \ - box.y2 += pDrawable->y; \ - } - -#define TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC) { \ - TRANSLATE_BOX(box, pDrawable); \ - TRIM_BOX(box, pGC); \ - } - -#define BOX_NOT_EMPTY(box) \ - (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0)) - -#define checkGCDamage(d,g) (getDrawableDamage(d) && \ - (!g->pCompositeClip ||\ - REGION_NOTEMPTY(d->pScreen, \ - g->pCompositeClip))) - -#ifdef RENDER - -#define TRIM_PICTURE_BOX(box, pDst) { \ - BoxPtr extents = &pDst->pCompositeClip->extents;\ - if(box.x1 < extents->x1) box.x1 = extents->x1; \ - if(box.x2 > extents->x2) box.x2 = extents->x2; \ - if(box.y1 < extents->y1) box.y1 = extents->y1; \ - if(box.y2 > extents->y2) box.y2 = extents->y2; \ - } - -#define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \ - REGION_NOTEMPTY(pScreen, p->pCompositeClip)) - -static void -damageComposite (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - damageScrPriv(pScreen); - - if (checkPictureDamage (pDst)) - { - BoxRec box; - - box.x1 = xDst + pDst->pDrawable->x; - box.y1 = yDst + pDst->pDrawable->y; - box.x2 = box.x1 + width; - box.y2 = box.y1 + height; - TRIM_PICTURE_BOX(box, pDst); - if (BOX_NOT_EMPTY(box)) - damageDamageBox (pDst->pDrawable, &box, pDst->subWindowMode); - } - unwrap (pScrPriv, ps, Composite); - (*ps->Composite) (op, - pSrc, - pMask, - pDst, - xSrc, - ySrc, - xMask, - yMask, - xDst, - yDst, - width, - height); - wrap (pScrPriv, ps, Composite, damageComposite); -} - -static void -damageGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - damageScrPriv(pScreen); - - if (checkPictureDamage (pDst)) - { - int nlistTmp = nlist; - GlyphListPtr listTmp = list; - GlyphPtr *glyphsTmp = glyphs; - int x, y; - int n; - GlyphPtr glyph; - BoxRec box; - int x1, y1, x2, y2; - - box.x1 = 32767; - box.y1 = 32767; - box.x2 = -32767; - box.y2 = -32767; - x = pDst->pDrawable->x; - y = pDst->pDrawable->y; - while (nlistTmp--) - { - x += listTmp->xOff; - y += listTmp->yOff; - n = listTmp->len; - while (n--) - { - glyph = *glyphsTmp++; - x1 = x - glyph->info.x; - y1 = y - glyph->info.y; - x2 = x1 + glyph->info.width; - y2 = y1 + glyph->info.height; - if (x1 < box.x1) - box.x1 = x1; - if (y1 < box.y1) - box.y1 = y1; - if (x2 > box.x2) - box.x2 = x2; - if (y2 > box.y2) - box.y2 = y2; - x += glyph->info.xOff; - y += glyph->info.yOff; - } - listTmp++; - } - TRIM_PICTURE_BOX (box, pDst); - if (BOX_NOT_EMPTY(box)) - damageDamageBox (pDst->pDrawable, &box, pDst->subWindowMode); - } - unwrap (pScrPriv, ps, Glyphs); - (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); - wrap (pScrPriv, ps, Glyphs, damageGlyphs); -} -#endif - -/**********************************************************/ - - -static void -damageFillSpans(DrawablePtr pDrawable, - GC *pGC, - int npt, - DDXPointPtr ppt, - int *pwidth, - int fSorted) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt && checkGCDamage (pDrawable, pGC)) - { - int nptTmp = npt; - DDXPointPtr pptTmp = ppt; - int *pwidthTmp = pwidth; - BoxRec box; - - box.x1 = pptTmp->x; - box.x2 = box.x1 + *pwidthTmp; - box.y2 = box.y1 = pptTmp->y; - - while(--nptTmp) - { - pptTmp++; - pwidthTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - if(box.x2 < (pptTmp->x + *pwidthTmp)) - box.x2 = pptTmp->x + *pwidthTmp; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - - box.y2++; - - if(!pGC->miTranslate) { - TRANSLATE_BOX(box, pDrawable); - } - TRIM_BOX(box, pGC); - - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - - (*pGC->ops->FillSpans)(pDrawable, pGC, npt, ppt, pwidth, fSorted); - - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damageSetSpans(DrawablePtr pDrawable, - GCPtr pGC, - char *pcharsrc, - DDXPointPtr ppt, - int *pwidth, - int npt, - int fSorted) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt && checkGCDamage (pDrawable, pGC)) - { - DDXPointPtr pptTmp = ppt; - int *pwidthTmp = pwidth; - int nptTmp = npt; - BoxRec box; - - box.x1 = pptTmp->x; - box.x2 = box.x1 + *pwidthTmp; - box.y2 = box.y1 = pptTmp->y; - - while(--nptTmp) - { - pptTmp++; - pwidthTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - if(box.x2 < (pptTmp->x + *pwidthTmp)) - box.x2 = pptTmp->x + *pwidthTmp; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - - box.y2++; - - if(!pGC->miTranslate) { - TRANSLATE_BOX(box, pDrawable); - } - TRIM_BOX(box, pGC); - - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->SetSpans)(pDrawable, pGC, pcharsrc, ppt, pwidth, npt, fSorted); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePutImage(DrawablePtr pDrawable, - GCPtr pGC, - int depth, - int x, - int y, - int w, - int h, - int leftPad, - int format, - char *pImage) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - if (checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - - box.x1 = x + pDrawable->x; - box.x2 = box.x1 + w; - box.y1 = y + pDrawable->y; - box.y2 = box.y1 + h; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PutImage)(pDrawable, pGC, depth, x, y, w, h, - leftPad, format, pImage); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static RegionPtr -damageCopyArea(DrawablePtr pSrc, - DrawablePtr pDst, - GC *pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, - int dsty) -{ - RegionPtr ret; - DAMAGE_GC_OP_PROLOGUE(pGC, pDst); - - /* The driver will only call SourceValidate() when pSrc != pDst, - * but the software sprite (misprite.c) always need to know when a - * drawable is copied so it can remove the sprite. See #1030. */ - if ((pSrc == pDst) && pSrc->pScreen->SourceValidate && - pSrc->type == DRAWABLE_WINDOW && - ((WindowPtr)pSrc)->viewable) - { - (*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height); - } - - if (checkGCDamage (pDst, pGC)) - { - BoxRec box; - - box.x1 = dstx + pDst->x; - box.x2 = box.x1 + width; - box.y1 = dsty + pDst->y; - box.y2 = box.y1 + height; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDst, &box, pGC->subWindowMode); - } - - ret = (*pGC->ops->CopyArea)(pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty); - DAMAGE_GC_OP_EPILOGUE(pGC, pDst); - return ret; -} - -static RegionPtr -damageCopyPlane(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, - int dsty, - unsigned long bitPlane) -{ - RegionPtr ret; - DAMAGE_GC_OP_PROLOGUE(pGC, pDst); - - /* The driver will only call SourceValidate() when pSrc != pDst, - * but the software sprite (misprite.c) always need to know when a - * drawable is copied so it can remove the sprite. See #1030. */ - if ((pSrc == pDst) && pSrc->pScreen->SourceValidate && - pSrc->type == DRAWABLE_WINDOW && - ((WindowPtr)pSrc)->viewable) - { - (*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height); - } - - if (checkGCDamage (pDst, pGC)) - { - BoxRec box; - - box.x1 = dstx + pDst->x; - box.x2 = box.x1 + width; - box.y1 = dsty + pDst->y; - box.y2 = box.y1 + height; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDst, &box, pGC->subWindowMode); - } - - ret = (*pGC->ops->CopyPlane)(pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - DAMAGE_GC_OP_EPILOGUE(pGC, pDst); - return ret; -} - -static void -damagePolyPoint(DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int npt, - xPoint *ppt) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - int nptTmp = npt; - xPoint *pptTmp = ppt; - - box.x2 = box.x1 = pptTmp->x; - box.y2 = box.y1 = pptTmp->y; - - /* this could be slow if the points were spread out */ - - while(--nptTmp) - { - pptTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - else if(box.x2 < pptTmp->x) box.x2 = pptTmp->x; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolyPoint)(pDrawable, pGC, mode, npt, ppt); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolylines(DrawablePtr pDrawable, - GCPtr pGC, - int mode, - int npt, - DDXPointPtr ppt) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt && checkGCDamage (pDrawable, pGC)) - { - int nptTmp = npt; - DDXPointPtr pptTmp = ppt; - BoxRec box; - int extra = pGC->lineWidth >> 1; - - box.x2 = box.x1 = pptTmp->x; - box.y2 = box.y1 = pptTmp->y; - - if(nptTmp > 1) - { - if(pGC->joinStyle == JoinMiter) - extra = 6 * pGC->lineWidth; - else if(pGC->capStyle == CapProjecting) - extra = pGC->lineWidth; - } - - if(mode == CoordModePrevious) - { - int x = box.x1; - int y = box.y1; - while(--nptTmp) - { - pptTmp++; - x += pptTmp->x; - y += pptTmp->y; - if(box.x1 > x) box.x1 = x; - else if(box.x2 < x) box.x2 = x; - if(box.y1 > y) box.y1 = y; - else if(box.y2 < y) box.y2 = y; - } - } - else - { - while(--nptTmp) - { - pptTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - else if(box.x2 < pptTmp->x) box.x2 = pptTmp->x; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - } - - box.x2++; - box.y2++; - - if(extra) - { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->Polylines)(pDrawable, pGC, mode, npt, ppt); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolySegment(DrawablePtr pDrawable, - GCPtr pGC, - int nSeg, - xSegment *pSeg) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (nSeg && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - int extra = pGC->lineWidth; - int nsegTmp = nSeg; - xSegment *pSegTmp = pSeg; - - if(pGC->capStyle != CapProjecting) - extra >>= 1; - - if(pSegTmp->x2 > pSegTmp->x1) { - box.x1 = pSegTmp->x1; - box.x2 = pSegTmp->x2; - } else { - box.x2 = pSegTmp->x1; - box.x1 = pSegTmp->x2; - } - - if(pSegTmp->y2 > pSegTmp->y1) { - box.y1 = pSegTmp->y1; - box.y2 = pSegTmp->y2; - } else { - box.y2 = pSegTmp->y1; - box.y1 = pSegTmp->y2; - } - - while(--nsegTmp) - { - pSegTmp++; - if(pSegTmp->x2 > pSegTmp->x1) - { - if(pSegTmp->x1 < box.x1) box.x1 = pSegTmp->x1; - if(pSegTmp->x2 > box.x2) box.x2 = pSegTmp->x2; - } - else - { - if(pSegTmp->x2 < box.x1) box.x1 = pSegTmp->x2; - if(pSegTmp->x1 > box.x2) box.x2 = pSegTmp->x1; - } - if(pSegTmp->y2 > pSegTmp->y1) - { - if(pSegTmp->y1 < box.y1) box.y1 = pSegTmp->y1; - if(pSegTmp->y2 > box.y2) box.y2 = pSegTmp->y2; - } - else - { - if(pSegTmp->y2 < box.y1) box.y1 = pSegTmp->y2; - if(pSegTmp->y1 > box.y2) box.y2 = pSegTmp->y1; - } - } - - box.x2++; - box.y2++; - - if(extra) - { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolySegment)(pDrawable, pGC, nSeg, pSeg); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolyRectangle(DrawablePtr pDrawable, - GCPtr pGC, - int nRects, - xRectangle *pRects) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (nRects && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - int offset1, offset2, offset3; - int nRectsTmp = nRects; - xRectangle *pRectsTmp = pRects; - - offset2 = pGC->lineWidth; - if(!offset2) offset2 = 1; - offset1 = offset2 >> 1; - offset3 = offset2 - offset1; - - while(nRectsTmp--) - { - box.x1 = pRectsTmp->x - offset1; - box.y1 = pRectsTmp->y - offset1; - box.x2 = box.x1 + pRectsTmp->width + offset2; - box.y2 = box.y1 + offset2; - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - - box.x1 = pRectsTmp->x - offset1; - box.y1 = pRectsTmp->y + offset3; - box.x2 = box.x1 + offset2; - box.y2 = box.y1 + pRectsTmp->height - offset2; - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - - box.x1 = pRectsTmp->x + pRectsTmp->width - offset1; - box.y1 = pRectsTmp->y + offset3; - box.x2 = box.x1 + offset2; - box.y2 = box.y1 + pRectsTmp->height - offset2; - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - - box.x1 = pRectsTmp->x - offset1; - box.y1 = pRectsTmp->y + pRectsTmp->height - offset1; - box.x2 = box.x1 + pRectsTmp->width + offset2; - box.y2 = box.y1 + offset2; - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - - pRectsTmp++; - } - } - (*pGC->ops->PolyRectangle)(pDrawable, pGC, nRects, pRects); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolyArc(DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (nArcs && checkGCDamage (pDrawable, pGC)) - { - int extra = pGC->lineWidth >> 1; - BoxRec box; - int nArcsTmp = nArcs; - xArc *pArcsTmp = pArcs; - - box.x1 = pArcsTmp->x; - box.x2 = box.x1 + pArcsTmp->width; - box.y1 = pArcsTmp->y; - box.y2 = box.y1 + pArcsTmp->height; - - while(--nArcsTmp) - { - pArcsTmp++; - if(box.x1 > pArcsTmp->x) - box.x1 = pArcsTmp->x; - if(box.x2 < (pArcsTmp->x + pArcsTmp->width)) - box.x2 = pArcsTmp->x + pArcsTmp->width; - if(box.y1 > pArcsTmp->y) - box.y1 = pArcsTmp->y; - if(box.y2 < (pArcsTmp->y + pArcsTmp->height)) - box.y2 = pArcsTmp->y + pArcsTmp->height; - } - - if(extra) - { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolyArc)(pDrawable, pGC, nArcs, pArcs); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damageFillPolygon(DrawablePtr pDrawable, - GCPtr pGC, - int shape, - int mode, - int npt, - DDXPointPtr ppt) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (npt > 2 && checkGCDamage (pDrawable, pGC)) - { - DDXPointPtr pptTmp = ppt; - int nptTmp = npt; - BoxRec box; - - box.x2 = box.x1 = pptTmp->x; - box.y2 = box.y1 = pptTmp->y; - - if(mode != CoordModeOrigin) - { - int x = box.x1; - int y = box.y1; - while(--nptTmp) - { - pptTmp++; - x += pptTmp->x; - y += pptTmp->y; - if(box.x1 > x) box.x1 = x; - else if(box.x2 < x) box.x2 = x; - if(box.y1 > y) box.y1 = y; - else if(box.y2 < y) box.y2 = y; - } - } - else - { - while(--nptTmp) - { - pptTmp++; - if(box.x1 > pptTmp->x) box.x1 = pptTmp->x; - else if(box.x2 < pptTmp->x) box.x2 = pptTmp->x; - if(box.y1 > pptTmp->y) box.y1 = pptTmp->y; - else if(box.y2 < pptTmp->y) box.y2 = pptTmp->y; - } - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - - (*pGC->ops->FillPolygon)(pDrawable, pGC, shape, mode, npt, ppt); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - - -static void -damagePolyFillRect(DrawablePtr pDrawable, - GCPtr pGC, - int nRects, - xRectangle *pRects) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - if (nRects && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - xRectangle *pRectsTmp = pRects; - int nRectsTmp = nRects; - - box.x1 = pRectsTmp->x; - box.x2 = box.x1 + pRectsTmp->width; - box.y1 = pRectsTmp->y; - box.y2 = box.y1 + pRectsTmp->height; - - while(--nRectsTmp) - { - pRectsTmp++; - if(box.x1 > pRectsTmp->x) box.x1 = pRectsTmp->x; - if(box.x2 < (pRectsTmp->x + pRectsTmp->width)) - box.x2 = pRectsTmp->x + pRectsTmp->width; - if(box.y1 > pRectsTmp->y) box.y1 = pRectsTmp->y; - if(box.y2 < (pRectsTmp->y + pRectsTmp->height)) - box.y2 = pRectsTmp->y + pRectsTmp->height; - } - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolyFillRect)(pDrawable, pGC, nRects, pRects); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - - -static void -damagePolyFillArc(DrawablePtr pDrawable, - GCPtr pGC, - int nArcs, - xArc *pArcs) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (nArcs && checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - int nArcsTmp = nArcs; - xArc *pArcsTmp = pArcs; - - box.x1 = pArcsTmp->x; - box.x2 = box.x1 + pArcsTmp->width; - box.y1 = pArcsTmp->y; - box.y2 = box.y1 + pArcsTmp->height; - - while(--nArcsTmp) - { - pArcsTmp++; - if(box.x1 > pArcsTmp->x) - box.x1 = pArcsTmp->x; - if(box.x2 < (pArcsTmp->x + pArcsTmp->width)) - box.x2 = pArcsTmp->x + pArcsTmp->width; - if(box.y1 > pArcsTmp->y) - box.y1 = pArcsTmp->y; - if(box.y2 < (pArcsTmp->y + pArcsTmp->height)) - box.y2 = pArcsTmp->y + pArcsTmp->height; - } - - TRIM_AND_TRANSLATE_BOX(box, pDrawable, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PolyFillArc)(pDrawable, pGC, nArcs, pArcs); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -/* - * general Poly/Image text function. Extract glyph information, - * compute bounding box and remove cursor if it is overlapped. - */ - -static void -damageDamageChars (DrawablePtr pDrawable, - FontPtr font, - int x, - int y, - unsigned int n, - CharInfoPtr *charinfo, - Bool imageblt, - int subWindowMode) -{ - ExtentInfoRec extents; - BoxRec box; - - QueryGlyphExtents(font, charinfo, n, &extents); - if (imageblt) - { - if (extents.overallWidth > extents.overallRight) - extents.overallRight = extents.overallWidth; - if (extents.overallWidth < extents.overallLeft) - extents.overallLeft = extents.overallWidth; - if (extents.overallLeft > 0) - extents.overallLeft = 0; - if (extents.fontAscent > extents.overallAscent) - extents.overallAscent = extents.fontAscent; - if (extents.fontDescent > extents.overallDescent) - extents.overallDescent = extents.fontDescent; - } - box.x1 = x + extents.overallLeft; - box.y1 = y - extents.overallAscent; - box.x2 = x + extents.overallRight; - box.y2 = y + extents.overallDescent; - damageDamageBox (pDrawable, &box, subWindowMode); -} - -/* - * values for textType: - */ -#define TT_POLY8 0 -#define TT_IMAGE8 1 -#define TT_POLY16 2 -#define TT_IMAGE16 3 - -static int -damageText (DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned long count, - char *chars, - FontEncoding fontEncoding, - Bool textType) -{ - CharInfoPtr *charinfo; - CharInfoPtr *info; - unsigned long i; - unsigned int n; - int w; - Bool imageblt; - - imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16); - - charinfo = (CharInfoPtr *) ALLOCATE_LOCAL(count * sizeof(CharInfoPtr)); - if (!charinfo) - return x; - - GetGlyphs(pGC->font, count, (unsigned char *)chars, - fontEncoding, &i, charinfo); - n = (unsigned int)i; - w = 0; - if (!imageblt) - for (info = charinfo; i--; info++) - w += (*info)->metrics.characterWidth; - - if (n != 0) { - damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, n, - charinfo, imageblt, pGC->subWindowMode); - if (imageblt) - (*pGC->ops->ImageGlyphBlt)(pDrawable, pGC, x, y, n, charinfo, - FONTGLYPHS(pGC->font)); - else - (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, n, charinfo, - FONTGLYPHS(pGC->font)); - } - DEALLOCATE_LOCAL(charinfo); - return x + w; -} - -static int -damagePolyText8(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - x = damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_POLY8); - else - x = (*pGC->ops->PolyText8)(pDrawable, pGC, x, y, count, chars); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); - return x; -} - -static int -damagePolyText16(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - x = damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_POLY16); - else - x = (*pGC->ops->PolyText16)(pDrawable, pGC, x, y, count, chars); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); - return x; -} - -static void -damageImageText8(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - char *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_IMAGE8); - else - (*pGC->ops->ImageText8)(pDrawable, pGC, x, y, count, chars); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damageImageText16(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_IMAGE16); - else - (*pGC->ops->ImageText16)(pDrawable, pGC, x, y, count, chars); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - - -static void -damageImageGlyphBlt(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned int nglyph, - CharInfoPtr *ppci, - pointer pglyphBase) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, - nglyph, ppci, TRUE, pGC->subWindowMode); - (*pGC->ops->ImageGlyphBlt)(pDrawable, pGC, x, y, nglyph, - ppci, pglyphBase); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePolyGlyphBlt(DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned int nglyph, - CharInfoPtr *ppci, - pointer pglyphBase) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, - nglyph, ppci, FALSE, pGC->subWindowMode); - (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, - ppci, pglyphBase); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damagePushPixels(GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDrawable, - int dx, - int dy, - int xOrg, - int yOrg) -{ - DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - if(checkGCDamage (pDrawable, pGC)) - { - BoxRec box; - - box.x1 = xOrg; - box.y1 = yOrg; - - if(!pGC->miTranslate) { - box.x1 += pDrawable->x; - box.y1 += pDrawable->y; - } - - box.x2 = box.x1 + dx; - box.y2 = box.y1 + dy; - - TRIM_BOX(box, pGC); - if(BOX_NOT_EMPTY(box)) - damageDamageBox (pDrawable, &box, pGC->subWindowMode); - } - (*pGC->ops->PushPixels)(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg); - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - -static void -damageRemoveDamage (DamagePtr *pPrev, DamagePtr pDamage) -{ - while (*pPrev) - { - if (*pPrev == pDamage) - { - *pPrev = pDamage->pNext; - return; - } - pPrev = &(*pPrev)->pNext; - } -#if DAMAGE_VALIDATE_ENABLE - ErrorF ("Damage not on list\n"); - abort (); -#endif -} - -static void -damageInsertDamage (DamagePtr *pPrev, DamagePtr pDamage) -{ -#if DAMAGE_VALIDATE_ENABLE - DamagePtr pOld; - - for (pOld = *pPrev; pOld; pOld = pOld->pNext) - if (pOld == pDamage) { - ErrorF ("Damage already on list\n"); - abort (); - } -#endif - pDamage->pNext = *pPrev; - *pPrev = pDamage; -} - -static Bool -damageDestroyPixmap (PixmapPtr pPixmap) -{ - ScreenPtr pScreen = pPixmap->drawable.pScreen; - damageScrPriv(pScreen); - - if (pPixmap->refcnt == 1) - { - DamagePtr *pPrev = getPixmapDamageRef (pPixmap); - DamagePtr pDamage; - - while ((pDamage = *pPrev)) - { - damageRemoveDamage (pPrev, pDamage); - if (!pDamage->isWindow) - DamageDestroy (pDamage); - } - } - unwrap (pScrPriv, pScreen, DestroyPixmap); - (*pScreen->DestroyPixmap) (pPixmap); - wrap (pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); - return TRUE; -} - -static void -damagePaintWindow(WindowPtr pWindow, - RegionPtr prgn, - int what) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - /* - * Painting background none doesn't actually *do* anything, so - * no damage is recorded - */ - if ((what != PW_BACKGROUND || pWindow->backgroundState != None) && - getWindowDamage (pWindow)) - damageDamageRegion (&pWindow->drawable, prgn, FALSE, -1); - if(what == PW_BACKGROUND) { - unwrap (pScrPriv, pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWindow, prgn, what); - wrap (pScrPriv, pScreen, PaintWindowBackground, damagePaintWindow); - } else { - unwrap (pScrPriv, pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWindow, prgn, what); - wrap (pScrPriv, pScreen, PaintWindowBorder, damagePaintWindow); - } -} - - -static void -damageCopyWindow(WindowPtr pWindow, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - if (getWindowDamage (pWindow)) - { - int dx = pWindow->drawable.x - ptOldOrg.x; - int dy = pWindow->drawable.y - ptOldOrg.y; - - /* - * The region comes in source relative, but the damage occurs - * at the destination location. Translate back and forth. - */ - REGION_TRANSLATE (pScreen, prgnSrc, dx, dy); - damageDamageRegion (&pWindow->drawable, prgnSrc, FALSE, -1); - REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy); - } - unwrap (pScrPriv, pScreen, CopyWindow); - (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc); - wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow); -} - -GCOps damageGCOps = { - damageFillSpans, damageSetSpans, - damagePutImage, damageCopyArea, - damageCopyPlane, damagePolyPoint, - damagePolylines, damagePolySegment, - damagePolyRectangle, damagePolyArc, - damageFillPolygon, damagePolyFillRect, - damagePolyFillArc, damagePolyText8, - damagePolyText16, damageImageText8, - damageImageText16, damageImageGlyphBlt, - damagePolyGlyphBlt, damagePushPixels, -#ifdef NEED_LINEHELPER - NULL, -#endif - {NULL} /* devPrivate */ -}; - -static void -damageRestoreAreas (PixmapPtr pPixmap, - RegionPtr prgn, - int xorg, - int yorg, - WindowPtr pWindow) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - damageDamageRegion (&pWindow->drawable, prgn, FALSE, -1); - unwrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas); - (*pScreen->BackingStoreFuncs.RestoreAreas) (pPixmap, prgn, - xorg, yorg, pWindow); - wrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas, - damageRestoreAreas); -} - -static void -damageSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap) -{ - DamagePtr pDamage; - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - if ((pDamage = damageGetWinPriv(pWindow))) - { - PixmapPtr pOldPixmap = (*pScreen->GetWindowPixmap) (pWindow); - DamagePtr *pPrev = getPixmapDamageRef(pOldPixmap); - - while (pDamage) - { - damageRemoveDamage (pPrev, pDamage); - pDamage = pDamage->pNextWin; - } - } - unwrap (pScrPriv, pScreen, SetWindowPixmap); - (*pScreen->SetWindowPixmap) (pWindow, pPixmap); - wrap (pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); - if ((pDamage = damageGetWinPriv(pWindow))) - { - DamagePtr *pPrev = getPixmapDamageRef(pPixmap); - - while (pDamage) - { - damageInsertDamage (pPrev, pDamage); - pDamage = pDamage->pNextWin; - } - } -} - -static Bool -damageDestroyWindow (WindowPtr pWindow) -{ - DamagePtr pDamage; - ScreenPtr pScreen = pWindow->drawable.pScreen; - Bool ret; - damageScrPriv(pScreen); - - while ((pDamage = damageGetWinPriv(pWindow))) - { - DamageUnregister (&pWindow->drawable, pDamage); - DamageDestroy (pDamage); - } - unwrap (pScrPriv, pScreen, DestroyWindow); - ret = (*pScreen->DestroyWindow) (pWindow); - wrap (pScrPriv, pScreen, DestroyWindow, damageDestroyWindow); - return ret; -} - -static Bool -damageCloseScreen (int i, ScreenPtr pScreen) -{ - damageScrPriv(pScreen); - - unwrap (pScrPriv, pScreen, DestroyPixmap); - unwrap (pScrPriv, pScreen, CreateGC); - unwrap (pScrPriv, pScreen, PaintWindowBackground); - unwrap (pScrPriv, pScreen, PaintWindowBorder); - unwrap (pScrPriv, pScreen, CopyWindow); - unwrap (pScrPriv, pScreen, CloseScreen); - unwrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas); - xfree (pScrPriv); - return (*pScreen->CloseScreen) (i, pScreen); -} - -int damageScrPrivateIndex; -int damagePixPrivateIndex; -int damageGCPrivateIndex; -int damageWinPrivateIndex; -int damageGeneration; - -Bool -DamageSetup (ScreenPtr pScreen) -{ - DamageScrPrivPtr pScrPriv; -#ifdef RENDER - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); -#endif - - if (damageGeneration != serverGeneration) - { - damageScrPrivateIndex = AllocateScreenPrivateIndex (); - if (damageScrPrivateIndex == -1) - return FALSE; - damageGCPrivateIndex = AllocateGCPrivateIndex (); - if (damageGCPrivateIndex == -1) - return FALSE; - damagePixPrivateIndex = AllocatePixmapPrivateIndex (); - if (damagePixPrivateIndex == -1) - return FALSE; - damageWinPrivateIndex = AllocateWindowPrivateIndex (); - if (damageWinPrivateIndex == -1) - return FALSE; - damageGeneration = serverGeneration; - } - if (pScreen->devPrivates[damageScrPrivateIndex].ptr) - return TRUE; - - if (!AllocateGCPrivate (pScreen, damageGCPrivateIndex, sizeof (DamageGCPrivRec))) - return FALSE; - if (!AllocatePixmapPrivate (pScreen, damagePixPrivateIndex, 0)) - return FALSE; - if (!AllocateWindowPrivate (pScreen, damageWinPrivateIndex, 0)) - return FALSE; - - pScrPriv = (DamageScrPrivPtr) xalloc (sizeof (DamageScrPrivRec)); - if (!pScrPriv) - return FALSE; - -#ifdef COMPOSITE - /* This is a kludge to ensure wrapping order with the composite wrapper. - * If it's done from compinit.c, then DamageSetup may be called before the - * extension init phase, so that cw will be higher in the wrapping chain and - * rewrite drawables before damage gets to it, causing confusion. - */ - if (!noCompositeExtension) - miInitializeCompositeWrapper (pScreen); -#endif - - pScrPriv->internalLevel = 0; - pScrPriv->pScreenDamage = 0; - - wrap (pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); - wrap (pScrPriv, pScreen, CreateGC, damageCreateGC); - wrap (pScrPriv, pScreen, PaintWindowBackground, damagePaintWindow); - wrap (pScrPriv, pScreen, PaintWindowBorder, damagePaintWindow); - wrap (pScrPriv, pScreen, DestroyWindow, damageDestroyWindow); - wrap (pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); - wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow); - wrap (pScrPriv, pScreen, CloseScreen, damageCloseScreen); - wrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas, - damageRestoreAreas); -#ifdef RENDER - if (ps) { - wrap (pScrPriv, ps, Glyphs, damageGlyphs); - wrap (pScrPriv, ps, Composite, damageComposite); - } -#endif - - pScreen->devPrivates[damageScrPrivateIndex].ptr = (pointer) pScrPriv; - return TRUE; -} - -DamagePtr -DamageCreate (DamageReportFunc damageReport, - DamageDestroyFunc damageDestroy, - DamageReportLevel damageLevel, - Bool isInternal, - ScreenPtr pScreen, - void *closure) -{ - DamagePtr pDamage; - - pDamage = xalloc (sizeof (DamageRec)); - if (!pDamage) - return 0; - pDamage->pNext = 0; - pDamage->pNextWin = 0; - REGION_NULL(pScreen, &pDamage->damage); - - pDamage->damageLevel = damageLevel; - pDamage->isInternal = isInternal; - pDamage->closure = closure; - pDamage->isWindow = FALSE; - pDamage->pDrawable = 0; - - pDamage->damageReport = damageReport; - pDamage->damageDestroy = damageDestroy; - return pDamage; -} - -void -DamageRegister (DrawablePtr pDrawable, - DamagePtr pDamage) -{ - if (pDrawable->type == DRAWABLE_WINDOW) - { - WindowPtr pWindow = (WindowPtr) pDrawable; - winDamageRef(pWindow); - -#if DAMAGE_VALIDATE_ENABLE - DamagePtr pOld; - - for (pOld = *pPrev; pOld; pOld = pOld->pNextWin) - if (pOld == pDamage) { - ErrorF ("Damage already on window list\n"); - abort (); - } -#endif - pDamage->pNextWin = *pPrev; - *pPrev = pDamage; - pDamage->isWindow = TRUE; - } - else - pDamage->isWindow = FALSE; - pDamage->pDrawable = pDrawable; - damageInsertDamage (getDrawableDamageRef (pDrawable), pDamage); -} - -void -DamageDrawInternal (ScreenPtr pScreen, Bool enable) -{ - damageScrPriv (pScreen); - - pScrPriv->internalLevel += enable ? 1 : -1; -} - -void -DamageUnregister (DrawablePtr pDrawable, - DamagePtr pDamage) -{ - if (pDrawable->type == DRAWABLE_WINDOW) - { - WindowPtr pWindow = (WindowPtr) pDrawable; - winDamageRef (pWindow); -#if DAMAGE_VALIDATE_ENABLE - int found = 0; -#endif - - while (*pPrev) - { - if (*pPrev == pDamage) - { - *pPrev = pDamage->pNextWin; -#if DAMAGE_VALIDATE_ENABLE - found = 1; -#endif - break; - } - pPrev = &(*pPrev)->pNextWin; - } -#if DAMAGE_VALIDATE_ENABLE - if (!found) { - ErrorF ("Damage not on window list\n"); - abort (); - } -#endif - } - pDamage->pDrawable = 0; - damageRemoveDamage (getDrawableDamageRef (pDrawable), pDamage); -} - -void -DamageDestroy (DamagePtr pDamage) -{ - if (pDamage->damageDestroy) - (*pDamage->damageDestroy) (pDamage, pDamage->closure); - REGION_UNINIT (pDamage->pDrawable->pScreen, &pDamage->damage); - xfree (pDamage); -} - -Bool -DamageSubtract (DamagePtr pDamage, - const RegionPtr pRegion) -{ - RegionPtr pClip; - RegionRec pixmapClip; - DrawablePtr pDrawable = pDamage->pDrawable; - - REGION_SUBTRACT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pRegion); - if (pDrawable) - { - if (pDrawable->type == DRAWABLE_WINDOW) - pClip = &((WindowPtr) pDrawable)->borderClip; - else - { - BoxRec box; - - box.x1 = pDrawable->x; - box.y1 = pDrawable->y; - box.x2 = pDrawable->x + pDrawable->width; - box.y2 = pDrawable->y + pDrawable->height; - REGION_INIT (pDrawable->pScreen, &pixmapClip, &box, 1); - pClip = &pixmapClip; - } - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, pDrawable->x, pDrawable->y); - REGION_INTERSECT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pClip); - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, -pDrawable->x, -pDrawable->y); - if (pDrawable->type != DRAWABLE_WINDOW) - REGION_UNINIT(pDrawable->pScreen, &pixmapClip); - } - return REGION_NOTEMPTY (pDrawable->pScreen, &pDamage->damage); -} - -void -DamageEmpty (DamagePtr pDamage) -{ - REGION_EMPTY (pDamage->pDrawable->pScreen, &pDamage->damage); -} - -RegionPtr -DamageRegion (DamagePtr pDamage) -{ - return &pDamage->damage; -} - -void -DamageDamageRegion (DrawablePtr pDrawable, - RegionPtr pRegion) -{ - damageDamageRegion (pDrawable, pRegion, FALSE, -1); -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original deleted file mode 100644 index 69ad30d2d..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original +++ /dev/null @@ -1,4679 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.13 2005/09/13 01:33:19 daniels Exp $ */ -/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ -/************************************************************ - -Copyright 1987, 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* The panoramix components contained the following notice */ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.32 2003/11/10 18:21:45 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef PANORAMIX_DEBUG -#include -int ProcInitialConnection(); -#endif - -#ifdef __sun -#define False 0 -#define True 1 -#endif - -#define GC XlibGC -#include -#undef GC - -#include "windowstr.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "selection.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "opaque.h" -#include "input.h" -#include "servermd.h" -#include "extnsionst.h" -#include "dixfont.h" -#include "../../dix/dispatch.h" -#include "swaprep.h" -#include "swapreq.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif -#ifdef XAPPGROUP -#include -#endif -#ifdef XKB -#define XKB_IN_SERVER -#include "inputstr.h" -#include -#endif - -#include "Atoms.h" -#include "Splash.h" -#include "Client.h" -#include "Clipboard.h" -#include "Reconnect.h" -#include "Millis.h" -#include "Font.h" -#include "Shadow.h" -#include "Handlers.h" -#include "Keyboard.h" - -const int nxagentMaxFontNames = 10000; - -char dispatchExceptionAtReset = DE_RESET; - -/* - * This allows the agent to exit if no - * client is connected within a timeout. - */ - -int nxagentClients = 0; - -void nxagentWaitDisplay(void); - -void nxagentListRemoteFonts(const char *, int); - -unsigned int nxagentWMtimeout = 0; -Bool nxagentWMPassed = 0; - -/* - * Timeouts based on screen saver time. - */ - -int nxagentAutoDisconnectTimeout = 0; - -#ifdef LBX -#include "../../lbx/lbxserve.h" -#endif - -#include "Xatom.h" - -/* - * Set here the required log level. - */ - -#define PANIC -#define WARNING -#undef TEST -#undef WATCH - -/* - * Log begin and end of the important handlers. - */ - -#undef BLOCKS - -#ifdef WATCH -#include "unistd.h" -#endif - -#ifdef TEST -#include "Literals.h" -#endif - -#define mskcnt ((MAXCLIENTS + 31) / 32) -#define BITMASK(i) (1U << ((i) & 31)) -#define MASKIDX(i) ((i) >> 5) -#define MASKWORD(buf, i) buf[MASKIDX(i)] -#define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i) -#define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i) -#define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i)) - -extern xConnSetupPrefix connSetupPrefix; -extern char *ConnectionInfo; - -Selection *CurrentSelections; -int NumCurrentSelections; -CallbackListPtr SelectionCallback = NULL; - -#ifdef VIEWPORT_FRAME - -extern WindowPtr nxagentViewportFrameLeft; -extern WindowPtr nxagentViewportFrameRight; -extern WindowPtr nxagentViewportFrameAbove; -extern WindowPtr nxagentViewportFrameBelow; - -#define IsViewportFrame(pWin) ((pWin) == nxagentViewportFrameLeft || \ - (pWin) == nxagentViewportFrameRight || \ - (pWin) == nxagentViewportFrameAbove || \ - (pWin) == nxagentViewportFrameBelow) - -#else - -#define IsViewportFrame(pWin) (0) - -#endif /* #ifdef VIEWPORT_FRAME */ - -extern int nxagentMaxAllowedResets; - -extern int nxagentFindClientResource(int, RESTYPE, pointer); - -static ClientPtr grabClient; -#define GrabNone 0 -#define GrabActive 1 -#define GrabKickout 2 -static int grabState = GrabNone; -static long grabWaiters[mskcnt]; -CallbackListPtr ServerGrabCallback = NULL; -HWEventQueuePtr checkForInput[2]; -extern int connBlockScreenStart; - -static void KillAllClients(void); - -static void DeleteClientFromAnySelections(ClientPtr client); - -static int nextFreeClientID; /* always MIN free client ID */ - -static int nClients; /* number of authorized clients */ - -CallbackListPtr ClientStateCallback; - -/* dispatchException & isItTimeToYield must be declared volatile since they - * are modified by signal handlers - otherwise optimizer may assume it doesn't - * need to actually check value in memory when used and may miss changes from - * signal handlers. - */ -volatile char dispatchException = 0; -volatile char isItTimeToYield; - -/* Various of the DIX function interfaces were not designed to allow - * the client->errorValue to be set on BadValue and other errors. - * Rather than changing interfaces and breaking untold code we introduce - * a new global that dispatch can use. - */ -XID clientErrorValue; /* XXX this is a kludge */ - -#define SAME_SCREENS(a, b) (\ - (a.pScreen == b.pScreen)) - -void -SetInputCheck(HWEventQueuePtr c0, HWEventQueuePtr c1) -{ - checkForInput[0] = c0; - checkForInput[1] = c1; -} - -void -UpdateCurrentTime() -{ - TimeStamp systime; - - /* To avoid time running backwards, we must call GetTimeInMillis before - * calling ProcessInputEvents. - */ - systime.months = currentTime.months; - systime.milliseconds = GetTimeInMillis(); - if (systime.milliseconds < currentTime.milliseconds) - systime.months++; - if (*checkForInput[0] != *checkForInput[1]) - ProcessInputEvents(); - if (CompareTimeStamps(systime, currentTime) == LATER) - currentTime = systime; -} - -/* Like UpdateCurrentTime, but can't call ProcessInputEvents */ -void -UpdateCurrentTimeIf() -{ - TimeStamp systime; - - systime.months = currentTime.months; - systime.milliseconds = GetTimeInMillis(); - if (systime.milliseconds < currentTime.milliseconds) - systime.months++; - if (*checkForInput[0] == *checkForInput[1]) - currentTime = systime; -} - -void -InitSelections() -{ - if (CurrentSelections) - xfree(CurrentSelections); - CurrentSelections = (Selection *)NULL; - NumCurrentSelections = 0; - -#ifdef NXAGENT_CLIPBOARD - { - Selection *newsels; - newsels = (Selection *)xalloc(2 * sizeof(Selection)); - if (!newsels) - return; - NumCurrentSelections += 2; - CurrentSelections = newsels; - - CurrentSelections[0].selection = XA_PRIMARY; - CurrentSelections[0].lastTimeChanged = ClientTimeToServerTime(0); - CurrentSelections[0].window = WindowTable[0]->drawable.id; - CurrentSelections[0].pWin = NULL; - CurrentSelections[0].client = NullClient; - - CurrentSelections[1].selection = MakeAtom("CLIPBOARD", 9, 1); - CurrentSelections[1].lastTimeChanged = ClientTimeToServerTime(0); - CurrentSelections[1].window = WindowTable[0]->drawable.id; - CurrentSelections[1].pWin = NULL; - CurrentSelections[1].client = NullClient; - } -#endif - -} - -void -FlushClientCaches(XID id) -{ - int i; - register ClientPtr client; - - client = clients[CLIENT_ID(id)]; - if (client == NullClient) - return ; - for (i=0; ilastDrawableID == id) - { - client->lastDrawableID = WindowTable[0]->drawable.id; - client->lastDrawable = (DrawablePtr)WindowTable[0]; - } - else if (client->lastGCID == id) - { - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } - } - } -} -#ifdef SMART_SCHEDULE - -#undef SMART_DEBUG - -#define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ -#define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ - -Bool SmartScheduleDisable = FALSE; -long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; -long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; -long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; -long SmartScheduleTime; -ClientPtr SmartLastClient; -int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1]; -int SmartScheduleClient(int *clientReady, int nready); - -#ifdef SMART_DEBUG -long SmartLastPrint; -#endif - -void Dispatch(void); -void InitProcVectors(void); - -int -SmartScheduleClient (int *clientReady, int nready) -{ - ClientPtr pClient; - int i; - int client; - int bestPrio, best = 0; - int bestRobin, robin; - long now = SmartScheduleTime; - long idle; - - bestPrio = -0x7fffffff; - bestRobin = 0; - idle = 2 * SmartScheduleSlice; - for (i = 0; i < nready; i++) - { - client = clientReady[i]; - pClient = clients[client]; - /* Praise clients which are idle */ - if ((now - pClient->smart_check_tick) >= idle) - { - if (pClient->smart_priority < 0) - pClient->smart_priority++; - } - pClient->smart_check_tick = now; - - /* check priority to select best client */ - robin = (pClient->index - SmartLastIndex[pClient->smart_priority-SMART_MIN_PRIORITY]) & 0xff; - if (pClient->smart_priority > bestPrio || - (pClient->smart_priority == bestPrio && robin > bestRobin)) - { - bestPrio = pClient->smart_priority; - bestRobin = robin; - best = client; - } -#ifdef SMART_DEBUG - if ((now - SmartLastPrint) >= 5000) - fprintf (stderr, " %2d: %3d", client, pClient->smart_priority); -#endif - } -#ifdef SMART_DEBUG - if ((now - SmartLastPrint) >= 5000) - { - fprintf (stderr, " use %2d\n", best); - SmartLastPrint = now; - } -#endif - pClient = clients[best]; - SmartLastIndex[bestPrio-SMART_MIN_PRIORITY] = pClient->index; - /* - * Set current client pointer - */ - if (SmartLastClient != pClient) - { - pClient->smart_start_tick = now; - SmartLastClient = pClient; - } - /* - * Adjust slice - */ - if (nready == 1) - { - /* - * If it's been a long time since another client - * has run, bump the slice up to get maximal - * performance from a single client - */ - if ((now - pClient->smart_start_tick) > 1000 && - SmartScheduleSlice < SmartScheduleMaxSlice) - { - SmartScheduleSlice += SmartScheduleInterval; - } - } - else - { - SmartScheduleSlice = SmartScheduleInterval; - } - return best; -} -#endif - -#define MAJOROP ((xReq *)client->requestBuffer)->reqType - -void -Dispatch(void) -{ - register int *clientReady; /* array of request ready clients */ - register int result; - register ClientPtr client; - register int nready; - register HWEventQueuePtr* icheck = checkForInput; -#ifdef SMART_SCHEDULE - long start_tick; -#endif - - unsigned long currentDispatch = 0; - - nextFreeClientID = 1; - InitSelections(); - nClients = 0; - - /* - * The agent initialization was successfully - * completed. We can now handle our clients. - */ - - #ifdef XKB - - nxagentInitXkbWrapper(); - - nxagentTuneXkbWrapper(); - - #endif - - #ifdef NXAGENT_ONSTART - - /* - * Set NX_WM property (used by NX client to identify - * the agent's window) three seconds since the first - * client connects. - */ - - nxagentWMtimeout = GetTimeInMillis() + 3000; - - #endif - - clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients); - if (!clientReady) - return; - - #ifdef WATCH - - fprintf(stderr, "Dispatch: Watchpoint 12.\n"); - -/* -Reply Total Cached Bits In Bits Out Bits/Reply Ratio -------- ----- ------ ------- -------- ---------- ----- -#3 1 352 bits (0 KB) -> 236 bits (0 KB) -> 352/1 -> 236/1 = 1.492:1 -#14 1 256 bits (0 KB) -> 101 bits (0 KB) -> 256/1 -> 101/1 = 2.535:1 -#16 1 256 bits (0 KB) -> 26 bits (0 KB) -> 256/1 -> 26/1 = 9.846:1 -#20 2 2 12256 bits (1 KB) -> 56 bits (0 KB) -> 6128/1 -> 28/1 = 218.857:1 -#43 1 256 bits (0 KB) -> 45 bits (0 KB) -> 256/1 -> 45/1 = 5.689:1 -#47 2 2 42304 bits (5 KB) -> 49 bits (0 KB) -> 21152/1 -> 24/1 = 863.347:1 -#98 1 256 bits (0 KB) -> 34 bits (0 KB) -> 256/1 -> 34/1 = 7.529:1 -*/ - - sleep(30); - - #endif - - #ifdef TEST - fprintf(stderr, "Dispatch: Value of dispatchException is [%x].\n", - dispatchException); - - fprintf(stderr, "Dispatch: Value of dispatchExceptionAtReset is [%x].\n", - dispatchExceptionAtReset); - #endif - - if (!(dispatchException & DE_TERMINATE)) - dispatchException = 0; - - while (!dispatchException) - { - if (*icheck[0] != *icheck[1]) - { - ProcessInputEvents(); - FlushIfCriticalOutputPending(); - } - - /* - * Ensure we remove the splash after the timeout. - * Initializing clientReady[0] to -1 will tell - * WaitForSomething() to yield control after the - * timeout set in clientReady[1]. - */ - - clientReady[0] = 0; - - if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)) - { - #ifdef TEST - fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", - NXAGENT_WAKEUP); - #endif - - clientReady[0] = -1; - clientReady[1] = NXAGENT_WAKEUP; - } - - if (serverGeneration > nxagentMaxAllowedResets && - nxagentSessionState == SESSION_STARTING && - (nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1)) - { - #ifdef NX_DEBUG_INPUT - fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", - GetTimeAsString(), GetTimeInMillis()); - #else - fprintf(stderr, "Session: Session started at '%s'.\n", - GetTimeAsString()); - #endif - - nxagentSessionState = SESSION_UP; - } - - #ifdef BLOCKS - fprintf(stderr, "[End dispatch]\n"); - #endif - - nready = WaitForSomething(clientReady); - - #ifdef BLOCKS - fprintf(stderr, "[Begin dispatch]\n"); - #endif - - #ifdef TEST - fprintf(stderr, "******Dispatch: Running with [%d] clients ready.\n", - nready); - #endif - - #ifdef NXAGENT_ONSTART - - currentDispatch = GetTimeInMillis(); - - /* - * If the timeout is expired set the - * selection informing the NX client - * that the agent is ready. - */ - - if (!nxagentWMPassed && (nxagentWMtimeout < currentDispatch)) - { - nxagentRemoveSplashWindow(NULL); - } - - nxagentClients = nClients; - - #endif - -#ifdef SMART_SCHEDULE - if (nready && !SmartScheduleDisable) - { - clientReady[0] = SmartScheduleClient (clientReady, nready); - nready = 1; - } -#endif - /***************** - * Handle events in round robin fashion, doing input between - * each round - *****************/ - - while (!dispatchException && (--nready >= 0)) - { - client = clients[clientReady[nready]]; - if (! client) - { - /* KillClient can cause this to happen */ - continue; - } - /* GrabServer activation can cause this to be true */ - if (grabState == GrabKickout) - { - grabState = GrabActive; - break; - } - isItTimeToYield = FALSE; - - requestingClient = client; -#ifdef SMART_SCHEDULE - start_tick = SmartScheduleTime; -#endif - while (!isItTimeToYield) - { - if (*icheck[0] != *icheck[1]) - { - ProcessInputEvents(); - FlushIfCriticalOutputPending(); - } -#ifdef SMART_SCHEDULE - if (!SmartScheduleDisable && - (SmartScheduleTime - start_tick) >= SmartScheduleSlice) - { - /* Penalize clients which consume ticks */ - if (client->smart_priority > SMART_MIN_PRIORITY) - client->smart_priority--; - break; - } -#endif - /* now, finally, deal with client requests */ - - #ifdef TEST - fprintf(stderr, "******Dispatch: Reading request from client [%d].\n", - client->index); - #endif - - result = ReadRequestFromClient(client); - if (result <= 0) - { - if (result < 0) - CloseDownClient(client); - break; - } -#ifdef NXAGENT_SERVER - - #ifdef TEST - - else - { - - if (MAJOROP > 127) - { - fprintf(stderr, "******Dispatch: Read [Extension] request OPCODE#%d MINOR#%d " - "size [%d] client [%d].\n", MAJOROP, *((char *) client->requestBuffer + 1), - client->req_len << 2, client->index); - } - else - { - fprintf(stderr, "******Dispatch: Read [%s] request OPCODE#%d size [%d] client [%d].\n", - nxagentRequestLiteral[MAJOROP], MAJOROP, client->req_len << 2, - client->index); - } - } - - #endif -#endif - - client->sequence++; -#ifdef DEBUG - if (client->requestLogIndex == MAX_REQUEST_LOG) - client->requestLogIndex = 0; - client->requestLog[client->requestLogIndex] = MAJOROP; - client->requestLogIndex++; -#endif - if (result > (maxBigRequestSize << 2)) - result = BadLength; - else -#ifdef NXAGENT_SERVER - { - result = (* client->requestVector[MAJOROP])(client); - - #ifdef TEST - - if (MAJOROP > 127) - { - fprintf(stderr, "******Dispatch: Handled [Extension] request OPCODE#%d MINOR#%d " - "size [%d] client [%d] result [%d].\n", MAJOROP, - *((char *) client->requestBuffer + 1), client->req_len << 2, - client->index, result); - } - else - { - fprintf(stderr, "******Dispatch: Handled [%s] request OPCODE#%d size [%d] client [%d] " - "result [%d].\n", nxagentRequestLiteral[MAJOROP], MAJOROP, - client->req_len << 2, client->index, result); - } - - #endif - - /* - * Can set isItTimeToYield to force - * the dispatcher to pay attention - * to another client. - */ - - nxagentDispatchHandler(client, client->req_len << 2, 0); - } -#else - result = (* client->requestVector[MAJOROP])(client); -#endif - - if (result != Success) - { - if (client->noClientException != Success) - CloseDownClient(client); - else - SendErrorToClient(client, MAJOROP, - MinorOpcodeOfRequest(client), - client->errorValue, result); - break; - } -#ifdef DAMAGEEXT - FlushIfCriticalOutputPending (); -#endif - } - FlushAllOutput(); -#ifdef SMART_SCHEDULE - client = clients[clientReady[nready]]; - if (client) - client->smart_stop_tick = SmartScheduleTime; -#endif - requestingClient = NULL; - } - dispatchException &= ~DE_PRIORITYCHANGE; - } -#if defined(DDXBEFORERESET) - ddxBeforeReset (); -#endif - if ((dispatchException & DE_RESET) && - (serverGeneration > nxagentMaxAllowedResets)) - { - dispatchException &= ~DE_RESET; - dispatchException |= DE_TERMINATE; - - fprintf(stderr, "Info: Reached threshold of maximum allowed resets.\n"); - } - - nxagentResetAtomMap(); - - if (serverGeneration > nxagentMaxAllowedResets) - { - /* - * The session is terminating. Force an I/O - * error on the display and wait until the - * NX transport is gone. - */ - - fprintf(stderr, "Session: Terminating session at '%s'.\n", GetTimeAsString()); - - nxagentWaitDisplay(); - - fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString()); - } - - if (nxagentOption(Shadow) == 1) - { - NXShadowDestroy(); - } - - KillAllClients(); - DEALLOCATE_LOCAL(clientReady); - dispatchException &= ~DE_RESET; -} - -#undef MAJOROP - -int -ProcBadRequest(ClientPtr client) -{ - return (BadRequest); -} - -int -ProcCreateWindow(ClientPtr client) -{ - register WindowPtr pParent, pWin; - REQUEST(xCreateWindowReq); - int result; - int len; - - REQUEST_AT_LEAST_SIZE(xCreateWindowReq); - - LEGAL_NEW_RESOURCE(stuff->wid, client); - if (!(pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess))) - return BadWindow; - len = client->req_len - (sizeof(xCreateWindowReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - pWin = CreateWindow(stuff->wid, pParent, stuff->x, - stuff->y, stuff->width, stuff->height, - stuff->borderWidth, stuff->class, - stuff->mask, (XID *) &stuff[1], - (int)stuff->depth, - client, stuff->visual, &result); - if (pWin) - { - Mask mask = pWin->eventMask; - - pWin->eventMask = 0; /* subterfuge in case AddResource fails */ - if (!AddResource(stuff->wid, RT_WINDOW, (pointer)pWin)) - return BadAlloc; - pWin->eventMask = mask; - } - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcChangeWindowAttributes(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xChangeWindowAttributesReq); - register int result; - int len; - - REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2); - if (len != Ones(stuff->valueMask)) - return BadLength; - result = ChangeWindowAttributes(pWin, - stuff->valueMask, - (XID *) &stuff[1], - client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcGetWindowAttributes(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - xGetWindowAttributesReply wa; - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - GetWindowAttributes(pWin, client, &wa); - WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa); - return(client->noClientException); -} - -int -ProcDestroyWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); - if (!pWin) - return(BadWindow); - if (pWin->parent) - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); -} - -int -ProcDestroySubwindows(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); - if (!pWin) - return(BadWindow); - DestroySubwindows(pWin, client); - return(client->noClientException); -} - -int -ProcChangeSaveSet(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xChangeSaveSetReq); - register int result; - - REQUEST_SIZE_MATCH(xChangeSaveSetReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) - return BadMatch; - if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete)) - { - result = AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - { - client->errorValue = stuff->mode; - return( BadValue ); - } -} - -int -ProcReparentWindow(register ClientPtr client) -{ - register WindowPtr pWin, pParent; - REQUEST(xReparentWindowReq); - register int result; - - REQUEST_SIZE_MATCH(xReparentWindowReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - - if (!nxagentWMPassed) - { - nxagentRemoveSplashWindow(pWin); - } - - pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess); - if (!pParent) - return(BadWindow); - if (SAME_SCREENS(pWin->drawable, pParent->drawable)) - { - if ((pWin->backgroundState == ParentRelative) && - (pParent->drawable.depth != pWin->drawable.depth)) - return BadMatch; - if ((pWin->drawable.class != InputOnly) && - (pParent->drawable.class == InputOnly)) - return BadMatch; - result = ReparentWindow(pWin, pParent, - (short)stuff->x, (short)stuff->y, client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - return (BadMatch); -} - -int -ProcMapWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - MapWindow(pWin, client); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcMapSubwindows(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - MapSubwindows(pWin, client); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcUnmapWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - UnmapWindow(pWin, FALSE); - /* update cache to say it is mapped */ - - return(client->noClientException); -} - -int -ProcUnmapSubwindows(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - UnmapSubwindows(pWin); - return(client->noClientException); -} - -int -ProcConfigureWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xConfigureWindowReq); - register int result; - int len; - - REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - len = client->req_len - (sizeof(xConfigureWindowReq) >> 2); - if (Ones((Mask)stuff->mask) != len) - return BadLength; - result = ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1], - client); - - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcCirculateWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xCirculateWindowReq); - - REQUEST_SIZE_MATCH(xCirculateWindowReq); - if ((stuff->direction != RaiseLowest) && - (stuff->direction != LowerHighest)) - { - client->errorValue = stuff->direction; - return BadValue; - } - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - CirculateWindow(pWin, (int)stuff->direction, client); - return(client->noClientException); -} - -int -GetGeometry(register ClientPtr client, xGetGeometryReply *rep) -{ - register DrawablePtr pDraw; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, SecurityReadAccess); - rep->type = X_Reply; - rep->length = 0; - rep->sequenceNumber = client->sequence; - rep->root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - rep->depth = pDraw->depth; - rep->width = pDraw->width; - rep->height = pDraw->height; - - /* XXX - Because the pixmap-implementation of the multibuffer extension - * may have the buffer-id's drawable resource value be a pointer - * to the buffer's window instead of the buffer itself - * (this happens if the buffer is the displayed buffer), - * we also have to check that the id matches before we can - * truly say that it is a DRAWABLE_WINDOW. - */ - - if ((pDraw->type == UNDRAWABLE_WINDOW) || - ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id))) - { - register WindowPtr pWin = (WindowPtr)pDraw; - rep->x = pWin->origin.x - wBorderWidth (pWin); - rep->y = pWin->origin.y - wBorderWidth (pWin); - rep->borderWidth = pWin->borderWidth; - } - else /* DRAWABLE_PIXMAP or DRAWABLE_BUFFER */ - { - rep->x = rep->y = rep->borderWidth = 0; - } - - return Success; -} - - -int -ProcGetGeometry(register ClientPtr client) -{ - xGetGeometryReply rep; - int status; - - if ((status = GetGeometry(client, &rep)) != Success) - return status; - - WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); - return(client->noClientException); -} - - -int -ProcQueryTree(register ClientPtr client) -{ - xQueryTreeReply reply; - int numChildren = 0; - register WindowPtr pChild, pWin, pHead; - Window *childIDs = (Window *)NULL; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - reply.type = X_Reply; - reply.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - reply.sequenceNumber = client->sequence; - if (pWin->parent) - reply.parent = pWin->parent->drawable.id; - else - reply.parent = (Window)None; - pHead = RealChildHead(pWin); - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - { - if (!IsViewportFrame(pChild)) - { - numChildren++; - } - } - if (numChildren) - { - int curChild = 0; - - childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window)); - if (!childIDs) - return BadAlloc; - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - { - if (!IsViewportFrame(pChild)) - { - childIDs[curChild++] = pChild->drawable.id; - } - } - } - - reply.nChildren = numChildren; - reply.length = (numChildren * sizeof(Window)) >> 2; - - WriteReplyToClient(client, sizeof(xQueryTreeReply), &reply); - if (numChildren) - { - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs); - DEALLOCATE_LOCAL(childIDs); - } - - return(client->noClientException); -} - -int -ProcInternAtom(register ClientPtr client) -{ - Atom atom; - char *tchar; - REQUEST(xInternAtomReq); - - REQUEST_FIXED_SIZE(xInternAtomReq, stuff->nbytes); - if ((stuff->onlyIfExists != xTrue) && (stuff->onlyIfExists != xFalse)) - { - client->errorValue = stuff->onlyIfExists; - return(BadValue); - } - tchar = (char *) &stuff[1]; - atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); - if (atom != BAD_RESOURCE) - { - xInternAtomReply reply; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.atom = atom; - WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); - return(client->noClientException); - } - else - return (BadAlloc); -} - -int -ProcGetAtomName(register ClientPtr client) -{ - char *str; - xGetAtomNameReply reply; - int len; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - if ( (str = NameForAtom(stuff->id)) ) - { - len = strlen(str); - reply.type = X_Reply; - reply.length = (len + 3) >> 2; - reply.sequenceNumber = client->sequence; - reply.nameLength = len; - WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); - (void)WriteToClient(client, len, str); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadAtom); - } -} - -#ifdef K5AUTH -extern int k5_bad(); -#endif - -int -ProcSetSelectionOwner(register ClientPtr client) -{ - WindowPtr pWin; - TimeStamp time; - REQUEST(xSetSelectionOwnerReq); - - REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); - UpdateCurrentTime(); - time = ClientTimeToServerTime(stuff->time); - - /* If the client's time stamp is in the future relative to the server's - time stamp, do not set the selection, just return success. */ - if (CompareTimeStamps(time, currentTime) == LATER) - return Success; - if (stuff->window != None) - { - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - } - else - pWin = (WindowPtr)None; - if (ValidAtom(stuff->selection)) - { - int i = 0; - - /* - * First, see if the selection is already set... - */ - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) - i++; - if (i < NumCurrentSelections) - { - xEvent event; - - /* If the timestamp in client's request is in the past relative - to the time stamp indicating the last time the owner of the - selection was set, do not set the selection, just return - success. */ - if (CompareTimeStamps(time, CurrentSelections[i].lastTimeChanged) - == EARLIER) - return Success; - if (CurrentSelections[i].client && - (!pWin || (CurrentSelections[i].client != client))) - { - event.u.u.type = SelectionClear; - event.u.selectionClear.time = time.milliseconds; - event.u.selectionClear.window = CurrentSelections[i].window; - event.u.selectionClear.atom = CurrentSelections[i].selection; - (void) TryClientEvents (CurrentSelections[i].client, &event, 1, - NoEventMask, NoEventMask /* CantBeFiltered */, - NullGrab); - } - } - else - { - /* - * It doesn't exist, so add it... - */ - Selection *newsels; - - if (i == 0) - newsels = (Selection *)xalloc(sizeof(Selection)); - else - newsels = (Selection *)xrealloc(CurrentSelections, - (NumCurrentSelections + 1) * sizeof(Selection)); - if (!newsels) - return BadAlloc; - NumCurrentSelections++; - CurrentSelections = newsels; - CurrentSelections[i].selection = stuff->selection; - } - CurrentSelections[i].lastTimeChanged = time; - CurrentSelections[i].window = stuff->window; - CurrentSelections[i].pWin = pWin; - CurrentSelections[i].client = (pWin ? client : NullClient); - if (SelectionCallback) - { - SelectionInfoRec info; - - info.selection = &CurrentSelections[i]; - info.kind= SelectionSetOwner; - CallCallbacks(&SelectionCallback, &info); - } - -#ifdef NXAGENT_CLIPBOARD - if ((CurrentSelections[i].pWin != NULL) && - (nxagentOption(Clipboard) != ClipboardNone) && - ((CurrentSelections[i].selection == XA_PRIMARY) || - (CurrentSelections[i].selection == MakeAtom("CLIPBOARD", 9, 0)))) - { - nxagentSetSelectionOwner(&CurrentSelections[i]); - } -#endif - return (client->noClientException); - } - else - { - client->errorValue = stuff->selection; - return (BadAtom); - } -} - -int -ProcGetSelectionOwner(register ClientPtr client) -{ - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - if (ValidAtom(stuff->id)) - { - int i; - xGetSelectionOwnerReply reply; - - i = 0; - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->id) i++; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - if (i < NumCurrentSelections) - reply.owner = CurrentSelections[i].window; - else - reply.owner = None; - WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadAtom); - } -} - -int -ProcConvertSelection(register ClientPtr client) -{ - Bool paramsOkay; - xEvent event; - WindowPtr pWin; - REQUEST(xConvertSelectionReq); - - REQUEST_SIZE_MATCH(xConvertSelectionReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - -#ifdef NXAGENT_CLIPBOARD - if (((stuff->selection == XA_PRIMARY) || - (stuff->selection == MakeAtom("CLIPBOARD", 9, 0))) && - nxagentOption(Clipboard) != ClipboardNone) - { - int i = 0; - - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) i++; - - if ((i < NumCurrentSelections) && (CurrentSelections[i].window != None)) - { - if (nxagentConvertSelection(client, pWin, stuff->selection, stuff->requestor, - stuff->property, stuff->target, stuff->time)) - { - return (client->noClientException); - } - } - } -#endif - - paramsOkay = (ValidAtom(stuff->selection) && ValidAtom(stuff->target)); - if (stuff->property != None) - paramsOkay &= ValidAtom(stuff->property); - if (paramsOkay) - { - int i; - - i = 0; - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) i++; - if ((i < NumCurrentSelections) && - (CurrentSelections[i].window != None) && (CurrentSelections[i].client != NullClient) -#ifdef XCSECURITY - && (!client->CheckAccess || - (* client->CheckAccess)(client, CurrentSelections[i].window, - RT_WINDOW, SecurityReadAccess, - CurrentSelections[i].pWin)) -#endif - ) - { - event.u.u.type = SelectionRequest; - event.u.selectionRequest.time = stuff->time; - event.u.selectionRequest.owner = - CurrentSelections[i].window; - event.u.selectionRequest.requestor = stuff->requestor; - event.u.selectionRequest.selection = stuff->selection; - event.u.selectionRequest.target = stuff->target; - event.u.selectionRequest.property = stuff->property; - if (TryClientEvents( - CurrentSelections[i].client, &event, 1, NoEventMask, - NoEventMask /* CantBeFiltered */, NullGrab)) - return (client->noClientException); - } - event.u.u.type = SelectionNotify; - event.u.selectionNotify.time = stuff->time; - event.u.selectionNotify.requestor = stuff->requestor; - event.u.selectionNotify.selection = stuff->selection; - event.u.selectionNotify.target = stuff->target; - event.u.selectionNotify.property = None; - (void) TryClientEvents(client, &event, 1, NoEventMask, - NoEventMask /* CantBeFiltered */, NullGrab); - return (client->noClientException); - } - else - { - client->errorValue = stuff->property; - return (BadAtom); - } -} - -int -ProcGrabServer(register ClientPtr client) -{ - REQUEST_SIZE_MATCH(xReq); - if (grabState != GrabNone && client != grabClient) - { - ResetCurrentRequest(client); - client->sequence--; - BITSET(grabWaiters, client->index); - IgnoreClient(client); - return(client->noClientException); - } - OnlyListenToOneClient(client); - grabState = GrabKickout; - grabClient = client; - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = SERVER_GRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); - } - - return(client->noClientException); -} - -static void -UngrabServer(ClientPtr client) -{ - int i; - - grabState = GrabNone; - ListenToAllClients(); - for (i = mskcnt; --i >= 0 && !grabWaiters[i]; ) - ; - if (i >= 0) - { - i <<= 5; - while (!GETBIT(grabWaiters, i)) - i++; - BITCLEAR(grabWaiters, i); - AttendClient(clients[i]); - } - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = SERVER_UNGRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); - } -} - -int -ProcUngrabServer(register ClientPtr client) -{ - REQUEST_SIZE_MATCH(xReq); - UngrabServer(client); - return(client->noClientException); -} - -int -ProcTranslateCoords(register ClientPtr client) -{ - REQUEST(xTranslateCoordsReq); - - register WindowPtr pWin, pDst; - xTranslateCoordsReply rep; - - REQUEST_SIZE_MATCH(xTranslateCoordsReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, - SecurityReadAccess); - if (!pDst) - return(BadWindow); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (!SAME_SCREENS(pWin->drawable, pDst->drawable)) - { - rep.sameScreen = xFalse; - rep.child = None; - rep.dstX = rep.dstY = 0; - } - else - { - INT16 x, y; - rep.sameScreen = xTrue; - rep.child = None; - /* computing absolute coordinates -- adjust to destination later */ - x = pWin->drawable.x + stuff->srcX; - y = pWin->drawable.y + stuff->srcY; - pWin = pDst->firstChild; - while (pWin) - { -#ifdef SHAPE - BoxRec box; -#endif - if ((pWin->mapped) && - (x >= pWin->drawable.x - wBorderWidth (pWin)) && - (x < pWin->drawable.x + (int)pWin->drawable.width + - wBorderWidth (pWin)) && - (y >= pWin->drawable.y - wBorderWidth (pWin)) && - (y < pWin->drawable.y + (int)pWin->drawable.height + - wBorderWidth (pWin)) -#ifdef SHAPE - /* When a window is shaped, a further check - * is made to see if the point is inside - * borderSize - */ - && (!wBoundingShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - &pWin->borderSize, x, y, &box)) - - && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - wInputShape(pWin), - x - pWin->drawable.x, - y - pWin->drawable.y, &box)) -#endif - ) - { - rep.child = pWin->drawable.id; - pWin = (WindowPtr) NULL; - } - else - pWin = pWin->nextSib; - } - /* adjust to destination coordinates */ - rep.dstX = x - pDst->drawable.x; - rep.dstY = y - pDst->drawable.y; - } - WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); - return(client->noClientException); -} - -int -ProcOpenFont(register ClientPtr client) -{ - int err; - char fontReq[256]; - REQUEST(xOpenFontReq); - - REQUEST_FIXED_SIZE(xOpenFontReq, stuff->nbytes); - client->errorValue = stuff->fid; - LEGAL_NEW_RESOURCE(stuff->fid, client); - - memcpy(fontReq,(char *)&stuff[1],(stuff->nbytes<256)?stuff->nbytes:255); - fontReq[stuff->nbytes]=0; - if (strchr(fontReq,'*') || strchr(fontReq,'?')) - { - extern int nxOpenFont(ClientPtr, XID, Mask, unsigned, char*); -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "Dispatch: ProcOpenFont try to find a common font with font pattern=%s\n",fontReq); -#endif - nxagentListRemoteFonts(fontReq, nxagentMaxFontNames); - err = nxOpenFont(client, stuff->fid, (Mask) 0, - stuff->nbytes, (char *)&stuff[1]); - } - else - err = OpenFont(client, stuff->fid, (Mask) 0, - stuff->nbytes, (char *)&stuff[1]); - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcCloseFont(register ClientPtr client) -{ - FontPtr pFont; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityDestroyAccess); - if (pFont != (FontPtr)NULL) - { - #ifdef NXAGENT_SERVER - - /* - * When a client closes a font the resource - * should not be lost if the reference counter - * is not 0, otherwise the server will not be - * able to find this font looping through the - * resources. - */ - - if (pFont -> refcnt > 0) - { - if (nxagentFindClientResource(serverClient -> index, RT_NX_FONT, pFont) == 0) - { - #ifdef TEST - fprintf(stderr, "ProcCloseFont: Switching resource for font at [%p].\n", - (void *) pFont); - #endif - - nxagentFontPriv(pFont) -> mirrorID = FakeClientID(serverClient -> index); - - AddResource(nxagentFontPriv(pFont) -> mirrorID, RT_NX_FONT, pFont); - - } - #ifdef TEST - else - { - fprintf(stderr, "ProcCloseFont: Found duplicated font at [%p], " - "resource switching skipped.\n", (void *) pFont); - } - #endif - } - - #endif - - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadFont); - } -} - -int -ProcQueryFont(register ClientPtr client) -{ - xQueryFontReply *reply; - FontPtr pFont; - register GC *pGC; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - client->errorValue = stuff->id; /* EITHER font or gc */ - - pFont = NULL; - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - /* can't use VERIFY_GC because it might return BadGC */ - pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, - SecurityReadAccess); - if (!pGC) - { - client->errorValue = stuff->id; - return(BadFont); /* procotol spec says only error is BadFont */ - } - pFont = pGC->font; - } - -/* test -{ - Atom name_atom, value_atom; - int nprops; - FontPropPtr props; - int i; - char *name; - - name_atom = MakeAtom("FONT", 4, True); - value_atom = 0L; - - nprops = pFont->info.nprops; - props = pFont->info.props; - - for (i = 0; i < nprops; i++) - if (props[i].name == name_atom) { - value_atom = props[i].value; - break; - } - - if (!value_atom) return (BadFont); - - name = (char *)NameForAtom(value_atom); - fprintf(stderr, "QueryFont: font name [%s]\n",name); -} - end test */ - - { - xCharInfo *pmax = FONTINKMAX(pFont); - xCharInfo *pmin = FONTINKMIN(pFont); - int nprotoxcistructs; - int rlength; - - nprotoxcistructs = ( - pmax->rightSideBearing == pmin->rightSideBearing && - pmax->leftSideBearing == pmin->leftSideBearing && - pmax->descent == pmin->descent && - pmax->ascent == pmin->ascent && - pmax->characterWidth == pmin->characterWidth) ? - 0 : N2dChars(pFont); - - rlength = sizeof(xQueryFontReply) + - FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) + - nprotoxcistructs * sizeof(xCharInfo); - reply = NULL; - reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength); - if(!reply) - { - return(BadAlloc); - } - - reply->type = X_Reply; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->sequenceNumber = client->sequence; - QueryFont( pFont, reply, nprotoxcistructs); - - WriteReplyToClient(client, rlength, reply); - DEALLOCATE_LOCAL(reply); - return(client->noClientException); - } -} - -int -ProcQueryTextExtents(register ClientPtr client) -{ - REQUEST(xQueryTextExtentsReq); - xQueryTextExtentsReply reply; - FontPtr pFont; - GC *pGC; - ExtentInfoRec info; - unsigned long length; - - REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); - - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - pGC = (GC *)SecurityLookupIDByType(client, stuff->fid, RT_GC, - SecurityReadAccess); - if (!pGC) - { - client->errorValue = stuff->fid; - return(BadFont); - } - pFont = pGC->font; - } - length = client->req_len - (sizeof(xQueryTextExtentsReq) >> 2); - length = length << 1; - if (stuff->oddLength) - { - if (length == 0) - return(BadLength); - length--; - } - if (!QueryTextExtents(pFont, length, (unsigned char *)&stuff[1], &info)) - return(BadAlloc); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.drawDirection = info.drawDirection; - reply.fontAscent = info.fontAscent; - reply.fontDescent = info.fontDescent; - reply.overallAscent = info.overallAscent; - reply.overallDescent = info.overallDescent; - reply.overallWidth = info.overallWidth; - reply.overallLeft = info.overallLeft; - reply.overallRight = info.overallRight; - WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply); - return(client->noClientException); -} - -int -ProcListFonts(register ClientPtr client) -{ - char tmp[256]; - - REQUEST(xListFontsReq); - - REQUEST_FIXED_SIZE(xListFontsReq, stuff->nbytes); - memcpy(tmp,(unsigned char *) &stuff[1],(stuff->nbytes<256)?stuff->nbytes:255); - tmp[stuff->nbytes]=0; - -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "Dispatch: ListFont request with pattern %s max_names=%d\n",tmp,stuff->maxNames); -#endif - nxagentListRemoteFonts(tmp, stuff -> maxNames < nxagentMaxFontNames ? nxagentMaxFontNames : stuff->maxNames); - return ListFonts(client, (unsigned char *) &stuff[1], stuff->nbytes, - stuff->maxNames); -} - -int -ProcListFontsWithInfo(register ClientPtr client) -{ - char tmp[256]; - REQUEST(xListFontsWithInfoReq); - - REQUEST_FIXED_SIZE(xListFontsWithInfoReq, stuff->nbytes); - - memcpy(tmp,(unsigned char *) &stuff[1],(stuff->nbytes<256)?stuff->nbytes:255); - tmp[stuff->nbytes]=0; -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "Dispatch: ListFont with info request with pattern %s max_names=%d\n",tmp,stuff->maxNames); -#endif - nxagentListRemoteFonts(tmp, stuff -> maxNames < nxagentMaxFontNames ? nxagentMaxFontNames :stuff->maxNames); - - return StartListFontsWithInfo(client, stuff->nbytes, - (unsigned char *) &stuff[1], stuff->maxNames); -} - -/** - * - * \param value must conform to DeleteType - */ -int -dixDestroyPixmap(pointer value, XID pid) -{ - PixmapPtr pPixmap = (PixmapPtr)value; - return (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap); -} - -int -ProcCreatePixmap(register ClientPtr client) -{ - PixmapPtr pMap; - register DrawablePtr pDraw; - REQUEST(xCreatePixmapReq); - DepthPtr pDepth; - register int i; - - REQUEST_SIZE_MATCH(xCreatePixmapReq); - client->errorValue = stuff->pid; - LEGAL_NEW_RESOURCE(stuff->pid, client); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - if (stuff->width > 32767 || stuff->height > 32767) - { - /* It is allowed to try and allocate a pixmap which is larger than - * 32767 in either dimension. However, all of the framebuffer code - * is buggy and does not reliably draw to such big pixmaps, basically - * because the Region data structure operates with signed shorts - * for the rectangles in it. - * - * Furthermore, several places in the X server computes the - * size in bytes of the pixmap and tries to store it in an - * integer. This integer can overflow and cause the allocated size - * to be much smaller. - * - * So, such big pixmaps are rejected here with a BadAlloc - */ - return BadAlloc; - } - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } -CreatePmap: - pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, stuff->width, - stuff->height, stuff->depth); - if (pMap) - { - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) - return(client->noClientException); - } - return (BadAlloc); -} - -int -ProcFreePixmap(register ClientPtr client) -{ - PixmapPtr pMap; - - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP, - SecurityDestroyAccess); - if (pMap) - { - #ifdef NXAGENT_SERVER - - /* - * When a client releases a pixmap the resource - * should not be lost if the reference counter - * is not 0, otherwise the server will not be - * able to find this pixmap looping through the - * resources. - */ - - if (pMap -> refcnt > 0) - { - if (nxagentFindClientResource(serverClient -> index, RT_NX_PIXMAP, pMap) == 0) - { - #ifdef TEST - fprintf(stderr, "ProcFreePixmap: Switching resource for pixmap at [%p].\n", - (void *) pMap); - #endif - - nxagentPixmapPriv(pMap) -> mid = FakeClientID(serverClient -> index); - - AddResource(nxagentPixmapPriv(pMap) -> mid, RT_NX_PIXMAP, pMap); - } - #ifdef TEST - else - { - fprintf(stderr, "ProcFreePixmap: Found duplicated pixmap at [%p], " - "resource switching skipped.\n", (void *) pMap); - } - #endif - } - - #endif - - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadPixmap); - } -} - -int -ProcCreateGC(register ClientPtr client) -{ - int error; - GC *pGC; - register DrawablePtr pDraw; - unsigned len; - REQUEST(xCreateGCReq); - - REQUEST_AT_LEAST_SIZE(xCreateGCReq); - client->errorValue = stuff->gc; - LEGAL_NEW_RESOURCE(stuff->gc, client); - SECURITY_VERIFY_DRAWABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - len = client->req_len - (sizeof(xCreateGCReq) >> 2); - if (len != Ones(stuff->mask)) - return BadLength; - pGC = (GC *)CreateGC(pDraw, stuff->mask, - (XID *) &stuff[1], &error); - if (error != Success) - return error; - if (!AddResource(stuff->gc, RT_GC, (pointer)pGC)) - return (BadAlloc); - return(client->noClientException); -} - -int -ProcChangeGC(register ClientPtr client) -{ - GC *pGC; - REQUEST(xChangeGCReq); - int result; - unsigned len; - - REQUEST_AT_LEAST_SIZE(xChangeGCReq); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); - len = client->req_len - (sizeof(xChangeGCReq) >> 2); - if (len != Ones(stuff->mask)) - return BadLength; - - result = dixChangeGC(client, pGC, stuff->mask, (CARD32 *) &stuff[1], 0); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcCopyGC(register ClientPtr client) -{ - register GC *dstGC; - register GC *pGC; - int result; - REQUEST(xCopyGCReq); - - REQUEST_SIZE_MATCH(xCopyGCReq); - SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, SecurityReadAccess); - SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, SecurityWriteAccess); - if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) - return (BadMatch); - result = CopyGC(pGC, dstGC, stuff->mask); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcSetDashes(register ClientPtr client) -{ - register GC *pGC; - int result; - REQUEST(xSetDashesReq); - - REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); - if (stuff->nDashes == 0) - { - client->errorValue = 0; - return BadValue; - } - - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); - - result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes, - (unsigned char *)&stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcSetClipRectangles(register ClientPtr client) -{ - int nr; - int result; - register GC *pGC; - REQUEST(xSetClipRectanglesReq); - - REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); - if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) && - (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded)) - { - client->errorValue = stuff->ordering; - return BadValue; - } - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); - - nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); - if (nr & 4) - return(BadLength); - nr >>= 3; - result = SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin, - nr, (xRectangle *)&stuff[1], (int)stuff->ordering); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcFreeGC(register ClientPtr client) -{ - register GC *pGC; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GC(pGC, stuff->id, client, SecurityDestroyAccess); - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); -} - -int -ProcClearToBackground(register ClientPtr client) -{ - REQUEST(xClearAreaReq); - register WindowPtr pWin; - - REQUEST_SIZE_MATCH(xClearAreaReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (pWin->drawable.class == InputOnly) - { - client->errorValue = stuff->window; - return (BadMatch); - } - if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse)) - { - client->errorValue = stuff->exposures; - return(BadValue); - } - (*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y, - stuff->width, stuff->height, - (Bool)stuff->exposures); - return(client->noClientException); -} - -int -ProcCopyArea(register ClientPtr client) -{ - register DrawablePtr pDst; - register DrawablePtr pSrc; - register GC *pGC; - REQUEST(xCopyAreaReq); - RegionPtr pRgn; - - REQUEST_SIZE_MATCH(xCopyAreaReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client); - if (stuff->dstDrawable != stuff->srcDrawable) - { - SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, - SecurityReadAccess); - if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) - { - client->errorValue = stuff->dstDrawable; - return (BadMatch); - } - } - else - pSrc = pDst; - - SET_DBE_SRCBUF(pSrc, stuff->srcDrawable); - - pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, stuff->srcX, stuff->srcY, - stuff->width, stuff->height, - stuff->dstX, stuff->dstY); - if (pGC->graphicsExposures) - { - (*pDst->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyArea, 0); - if (pRgn) - REGION_DESTROY(pDst->pScreen, pRgn); - } - - return(client->noClientException); -} - -int -ProcCopyPlane(register ClientPtr client) -{ - register DrawablePtr psrcDraw, pdstDraw; - register GC *pGC; - REQUEST(xCopyPlaneReq); - RegionPtr pRgn; - - REQUEST_SIZE_MATCH(xCopyPlaneReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client); - if (stuff->dstDrawable != stuff->srcDrawable) - { - SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, - SecurityReadAccess); - if (pdstDraw->pScreen != psrcDraw->pScreen) - { - client->errorValue = stuff->dstDrawable; - return (BadMatch); - } - } - else - psrcDraw = pdstDraw; - - SET_DBE_SRCBUF(psrcDraw, stuff->srcDrawable); - - /* Check to see if stuff->bitPlane has exactly ONE good bit set */ - if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) || - (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) - { - client->errorValue = stuff->bitPlane; - return(BadValue); - } - - pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC, stuff->srcX, stuff->srcY, - stuff->width, stuff->height, - stuff->dstX, stuff->dstY, stuff->bitPlane); - if (pGC->graphicsExposures) - { - (*pdstDraw->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); - if (pRgn) - REGION_DESTROY(pdstDraw->pScreen, pRgn); - } - return(client->noClientException); -} - -int -ProcPolyPoint(register ClientPtr client) -{ - int npoint; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyPointReq); - - REQUEST_AT_LEAST_SIZE(xPolyPointReq); - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2; - if (npoint) - { - (*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint, - (xPoint *) &stuff[1]); - } - return (client->noClientException); -} - -int -ProcPolyLine(register ClientPtr client) -{ - int npoint; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyLineReq); - - REQUEST_AT_LEAST_SIZE(xPolyLineReq); - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2; - if (npoint > 1) - { - (*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint, - (DDXPointPtr) &stuff[1]); - } - return(client->noClientException); -} - -int -ProcPolySegment(register ClientPtr client) -{ - int nsegs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolySegmentReq); - - REQUEST_AT_LEAST_SIZE(xPolySegmentReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); - if (nsegs & 4) - return(BadLength); - nsegs >>= 3; - if (nsegs) - { - (*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]); - } - return (client->noClientException); -} - -int -ProcPolyRectangle (register ClientPtr client) -{ - int nrects; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyRectangleReq); - - REQUEST_AT_LEAST_SIZE(xPolyRectangleReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); - if (nrects & 4) - return(BadLength); - nrects >>= 3; - if (nrects) - { - (*pGC->ops->PolyRectangle)(pDraw, pGC, - nrects, (xRectangle *) &stuff[1]); - } - return(client->noClientException); -} - -int -ProcPolyArc(register ClientPtr client) -{ - int narcs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyArcReq); - - REQUEST_AT_LEAST_SIZE(xPolyArcReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - narcs = (client->req_len << 2) - sizeof(xPolyArcReq); - if (narcs % sizeof(xArc)) - return(BadLength); - narcs /= sizeof(xArc); - if (narcs) - { - (*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]); - } - return (client->noClientException); -} - -int -ProcFillPoly(register ClientPtr client) -{ - int things; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xFillPolyReq); - - REQUEST_AT_LEAST_SIZE(xFillPolyReq); - if ((stuff->shape != Complex) && (stuff->shape != Nonconvex) && - (stuff->shape != Convex)) - { - client->errorValue = stuff->shape; - return BadValue; - } - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - things = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2; - if (things) - { - (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape, - stuff->coordMode, things, - (DDXPointPtr) &stuff[1]); - } - return(client->noClientException); -} - -int -ProcPolyFillRectangle(register ClientPtr client) -{ - int things; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyFillRectangleReq); - - REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); - if (things & 4) - return(BadLength); - things >>= 3; - - if (things) - { - (*pGC->ops->PolyFillRect) (pDraw, pGC, things, - (xRectangle *) &stuff[1]); - } - return (client->noClientException); -} - -int -ProcPolyFillArc(register ClientPtr client) -{ - int narcs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyFillArcReq); - - REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); - if (narcs % sizeof(xArc)) - return(BadLength); - narcs /= sizeof(xArc); - if (narcs) - { - (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]); - } - return (client->noClientException); -} - -#ifdef MATCH_CLIENT_ENDIAN - -int -ServerOrder (void) -{ - int whichbyte = 1; - - if (*((char *) &whichbyte)) - return LSBFirst; - return MSBFirst; -} - -#define ClientOrder(client) ((client)->swapped ? !ServerOrder() : ServerOrder()) - -void -ReformatImage (char *base, int nbytes, int bpp, int order) -{ - switch (bpp) { - case 1: /* yuck */ - if (BITMAP_BIT_ORDER != order) - BitOrderInvert ((unsigned char *) base, nbytes); -#if IMAGE_BYTE_ORDER != BITMAP_BIT_ORDER && BITMAP_SCANLINE_UNIT != 8 - ReformatImage (base, nbytes, BITMAP_SCANLINE_UNIT, order); -#endif - break; - case 4: - break; /* yuck */ - case 8: - break; - case 16: - if (IMAGE_BYTE_ORDER != order) - TwoByteSwap ((unsigned char *) base, nbytes); - break; - case 32: - if (IMAGE_BYTE_ORDER != order) - FourByteSwap ((unsigned char *) base, nbytes); - break; - } -} -#else -#define ReformatImage(b,n,bpp,o) -#endif - -/* 64-bit server notes: the protocol restricts padding of images to - * 8-, 16-, or 32-bits. We would like to have 64-bits for the server - * to use internally. Removes need for internal alignment checking. - * All of the PutImage functions could be changed individually, but - * as currently written, they call other routines which require things - * to be 64-bit padded on scanlines, so we changed things here. - * If an image would be padded differently for 64- versus 32-, then - * copy each scanline to a 64-bit padded scanline. - * Also, we need to make sure that the image is aligned on a 64-bit - * boundary, even if the scanlines are padded to our satisfaction. - */ -int -ProcPutImage(register ClientPtr client) -{ - register GC *pGC; - register DrawablePtr pDraw; - long length; /* length of scanline server padded */ - long lengthProto; /* length of scanline protocol padded */ - char *tmpImage; - REQUEST(xPutImageReq); - - REQUEST_AT_LEAST_SIZE(xPutImageReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - if (stuff->format == XYBitmap) - { - if ((stuff->depth != 1) || - (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad)) - return BadMatch; - length = BitmapBytePad(stuff->width + stuff->leftPad); - } - else if (stuff->format == XYPixmap) - { - if ((pDraw->depth != stuff->depth) || - (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad)) - return BadMatch; - length = BitmapBytePad(stuff->width + stuff->leftPad); - length *= stuff->depth; - } - else if (stuff->format == ZPixmap) - { - if ((pDraw->depth != stuff->depth) || (stuff->leftPad != 0)) - return BadMatch; - length = PixmapBytePad(stuff->width, stuff->depth); - } - else - { - client->errorValue = stuff->format; - return BadValue; - } - - tmpImage = (char *)&stuff[1]; - lengthProto = length; - - if (((((lengthProto * stuff->height) + (unsigned)3) >> 2) + - (sizeof(xPutImageReq) >> 2)) != client->req_len) - return BadLength; - - ReformatImage (tmpImage, lengthProto * stuff->height, - stuff->format == ZPixmap ? BitsPerPixel (stuff->depth) : 1, - ClientOrder(client)); - - (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, stuff->dstX, stuff->dstY, - stuff->width, stuff->height, - stuff->leftPad, stuff->format, tmpImage); - - return (client->noClientException); -} - - -int -DoGetImage(register ClientPtr client, int format, Drawable drawable, - int x, int y, int width, int height, - Mask planemask, xGetImageReply **im_return) -{ - register DrawablePtr pDraw; - int nlines, linesPerBuf; - register int linesDone; - long widthBytesLine, length; - Mask plane = 0; - char *pBuf; - xGetImageReply xgi; -#ifdef XCSECURITY - RegionPtr pVisibleRegion = NULL; -#endif - - if ((format != XYPixmap) && (format != ZPixmap)) - { - client->errorValue = format; - return(BadValue); - } - SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, SecurityReadAccess); - if(pDraw->type == DRAWABLE_WINDOW) - { - if( /* check for being viewable */ - !((WindowPtr) pDraw)->realized || - /* check for being on screen */ - pDraw->x + x < 0 || - pDraw->x + x + width > pDraw->pScreen->width || - pDraw->y + y < 0 || - pDraw->y + y + height > pDraw->pScreen->height || - /* check for being inside of border */ - x < - wBorderWidth((WindowPtr)pDraw) || - x + width > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - y < -wBorderWidth((WindowPtr)pDraw) || - y + height > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height - ) - return(BadMatch); - xgi.visual = wVisual (((WindowPtr) pDraw)); - } - else - { - if(x < 0 || - x+width > (int)pDraw->width || - y < 0 || - y+height > (int)pDraw->height - ) - return(BadMatch); - xgi.visual = None; - } - - SET_DBE_SRCBUF(pDraw, drawable); - - xgi.type = X_Reply; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - if(format == ZPixmap) - { - widthBytesLine = PixmapBytePad(width, pDraw->depth); - length = widthBytesLine * height; - - } - else - { - widthBytesLine = BitmapBytePad(width); - plane = ((Mask)1) << (pDraw->depth - 1); - /* only planes asked for */ - length = widthBytesLine * height * - Ones(planemask & (plane | (plane - 1))); - - } - - xgi.length = length; - - if (im_return) { - pBuf = (char *)xalloc(sz_xGetImageReply + length); - if (!pBuf) - return (BadAlloc); - if (widthBytesLine == 0) - linesPerBuf = 0; - else - linesPerBuf = height; - *im_return = (xGetImageReply *)pBuf; - *(xGetImageReply *)pBuf = xgi; - pBuf += sz_xGetImageReply; - } else { - xgi.length = (xgi.length + 3) >> 2; - if (widthBytesLine == 0 || height == 0) - linesPerBuf = 0; - else if (widthBytesLine >= IMAGE_BUFSIZE) - linesPerBuf = 1; - else - { - linesPerBuf = IMAGE_BUFSIZE / widthBytesLine; - if (linesPerBuf > height) - linesPerBuf = height; - } - length = linesPerBuf * widthBytesLine; - if (linesPerBuf < height) - { - /* we have to make sure intermediate buffers don't need padding */ - while ((linesPerBuf > 1) && - (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1))) - { - linesPerBuf--; - length -= widthBytesLine; - } - while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1)) - { - linesPerBuf++; - length += widthBytesLine; - } - } - if(!(pBuf = (char *) ALLOCATE_LOCAL(length))) - return (BadAlloc); - WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); - } - -#ifdef XCSECURITY - if (client->trustLevel != XSecurityClientTrusted && - pDraw->type == DRAWABLE_WINDOW) - { - pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw); - if (pVisibleRegion) - { - REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, -pDraw->x, -pDraw->y); - } - } -#endif - - if (linesPerBuf == 0) - { - /* nothing to do */ - } - else if (format == ZPixmap) - { - linesDone = 0; - while (height - linesDone > 0) - { - nlines = min(linesPerBuf, height - linesDone); - (*pDraw->pScreen->GetImage) (pDraw, - x, - y + linesDone, - width, - nlines, - format, - planemask, - (pointer) pBuf); -#ifdef XCSECURITY - if (pVisibleRegion) - SecurityCensorImage(client, pVisibleRegion, widthBytesLine, - pDraw, x, y + linesDone, width, - nlines, format, pBuf); -#endif - - /* Note that this is NOT a call to WriteSwappedDataToClient, - as we do NOT byte swap */ - if (!im_return) - { - ReformatImage (pBuf, (int)(nlines * widthBytesLine), - BitsPerPixel (pDraw->depth), - ClientOrder(client)); - -/* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, - (int)(nlines * widthBytesLine), - pBuf); - } - linesDone += nlines; - } - } - else /* XYPixmap */ - { - for (; plane; plane >>= 1) - { - if (planemask & plane) - { - linesDone = 0; - while (height - linesDone > 0) - { - nlines = min(linesPerBuf, height - linesDone); - (*pDraw->pScreen->GetImage) (pDraw, - x, - y + linesDone, - width, - nlines, - format, - plane, - (pointer)pBuf); -#ifdef XCSECURITY - if (pVisibleRegion) - SecurityCensorImage(client, pVisibleRegion, - widthBytesLine, - pDraw, x, y + linesDone, width, - nlines, format, pBuf); -#endif - - /* Note: NOT a call to WriteSwappedDataToClient, - as we do NOT byte swap */ - if (im_return) { - pBuf += nlines * widthBytesLine; - } else { - ReformatImage (pBuf, - (int)(nlines * widthBytesLine), - 1, - ClientOrder (client)); - -/* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, - (int)(nlines * widthBytesLine), - pBuf); - } - linesDone += nlines; - } - } - } - } -#ifdef XCSECURITY - if (pVisibleRegion) - REGION_DESTROY(pDraw->pScreen, pVisibleRegion); -#endif - if (!im_return) - DEALLOCATE_LOCAL(pBuf); - return (client->noClientException); -} - -int -ProcGetImage(register ClientPtr client) -{ - REQUEST(xGetImageReq); - - REQUEST_SIZE_MATCH(xGetImageReq); - - return DoGetImage(client, stuff->format, stuff->drawable, - stuff->x, stuff->y, - (int)stuff->width, (int)stuff->height, - stuff->planeMask, (xGetImageReply **)NULL); -} - -int -ProcPolyText(register ClientPtr client) -{ - int err; - REQUEST(xPolyTextReq); - DrawablePtr pDraw; - GC *pGC; - - REQUEST_AT_LEAST_SIZE(xPolyTextReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = PolyText(client, - pDraw, - pGC, - (unsigned char *)&stuff[1], - ((unsigned char *) stuff) + (client->req_len << 2), - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcImageText8(register ClientPtr client) -{ - int err; - register DrawablePtr pDraw; - register GC *pGC; - - REQUEST(xImageTextReq); - - REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = ImageText(client, - pDraw, - pGC, - stuff->nChars, - (unsigned char *)&stuff[1], - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcImageText16(register ClientPtr client) -{ - int err; - register DrawablePtr pDraw; - register GC *pGC; - - REQUEST(xImageTextReq); - - REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = ImageText(client, - pDraw, - pGC, - stuff->nChars, - (unsigned char *)&stuff[1], - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - - -int -ProcCreateColormap(register ClientPtr client) -{ - VisualPtr pVisual; - ColormapPtr pmap; - Colormap mid; - register WindowPtr pWin; - ScreenPtr pScreen; - REQUEST(xCreateColormapReq); - int i, result; - - REQUEST_SIZE_MATCH(xCreateColormapReq); - - if ((stuff->alloc != AllocNone) && (stuff->alloc != AllocAll)) - { - client->errorValue = stuff->alloc; - return(BadValue); - } - mid = stuff->mid; - LEGAL_NEW_RESOURCE(mid, client); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - pScreen = pWin->drawable.pScreen; - for (i = 0, pVisual = pScreen->visuals; - i < pScreen->numVisuals; - i++, pVisual++) - { - if (pVisual->vid != stuff->visual) - continue; - result = CreateColormap(mid, pScreen, pVisual, &pmap, - (int)stuff->alloc, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - client->errorValue = stuff->visual; - return(BadValue); -} - -int -ProcFreeColormap(register ClientPtr client) -{ - ColormapPtr pmap; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pmap = (ColormapPtr )SecurityLookupIDByType(client, stuff->id, RT_COLORMAP, - SecurityDestroyAccess); - if (pmap) - { - /* Freeing a default colormap is a no-op */ - if (!(pmap->flags & IsDefault)) - FreeResource(stuff->id, RT_NONE); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - - -int -ProcCopyColormapAndFree(register ClientPtr client) -{ - Colormap mid; - ColormapPtr pSrcMap; - REQUEST(xCopyColormapAndFreeReq); - int result; - - REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); - mid = stuff->mid; - LEGAL_NEW_RESOURCE(mid, client); - if( (pSrcMap = (ColormapPtr )SecurityLookupIDByType(client, stuff->srcCmap, - RT_COLORMAP, SecurityReadAccess|SecurityWriteAccess)) ) - { - result = CopyColormapAndFree(mid, pSrcMap, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - { - client->errorValue = stuff->srcCmap; - return(BadColor); - } -} - -int -ProcInstallColormap(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - (*(pcmp->pScreen->InstallColormap)) (pcmp); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - -int -ProcUninstallColormap(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - if(pcmp->mid != pcmp->pScreen->defColormap) - (*(pcmp->pScreen->UninstallColormap)) (pcmp); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - -int -ProcListInstalledColormaps(register ClientPtr client) -{ - xListInstalledColormapsReply *preply; - int nummaps; - WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - - if (!pWin) - return(BadWindow); - - preply = (xListInstalledColormapsReply *) - ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) + - pWin->drawable.pScreen->maxInstalledCmaps * - sizeof(Colormap)); - if(!preply) - return(BadAlloc); - - preply->type = X_Reply; - preply->sequenceNumber = client->sequence; - nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) - (pWin->drawable.pScreen, (Colormap *)&preply[1]); - preply->nColormaps = nummaps; - preply->length = nummaps; - WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); - DEALLOCATE_LOCAL(preply); - return(client->noClientException); -} - -int -ProcAllocColor (register ClientPtr client) -{ - ColormapPtr pmap; - int retval; - xAllocColorReply acr; - REQUEST(xAllocColorReq); - - REQUEST_SIZE_MATCH(xAllocColorReq); - pmap = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pmap) - { -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColor request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pmap, (xReq *) stuff)) - return Success; -#endif - acr.type = X_Reply; - acr.length = 0; - acr.sequenceNumber = client->sequence; - acr.red = stuff->red; - acr.green = stuff->green; - acr.blue = stuff->blue; - acr.pixel = 0; - if( (retval = AllocColor(pmap, &acr.red, &acr.green, &acr.blue, - &acr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return (retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pmap->pScreen->myNum) -#endif - WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); - return (client->noClientException); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocNamedColor (register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xAllocNamedColorReq); - - REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int retval; - - xAllocNamedColorReply ancr; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocNamedColor request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - ancr.type = X_Reply; - ancr.length = 0; - ancr.sequenceNumber = client->sequence; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes, - &ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) - { - ancr.screenRed = ancr.exactRed; - ancr.screenGreen = ancr.exactGreen; - ancr.screenBlue = ancr.exactBlue; - ancr.pixel = 0; - if( (retval = AllocColor(pcmp, - &ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue, - &ancr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr); - return (client->noClientException); - } - else - return(BadName); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocColorCells (register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xAllocColorCellsReq); - - REQUEST_SIZE_MATCH(xAllocColorCellsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xAllocColorCellsReply accr; - int npixels, nmasks, retval; - long length; - Pixel *ppixels, *pmasks; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColorCells request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - npixels = stuff->colors; - if (!npixels) - { - client->errorValue = npixels; - return (BadValue); - } - if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) - { - client->errorValue = stuff->contiguous; - return (BadValue); - } - nmasks = stuff->planes; - length = ((long)npixels + (long)nmasks) * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); - if(!ppixels) - return(BadAlloc); - pmasks = ppixels + npixels; - - if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks, - (Bool)stuff->contiguous, ppixels, pmasks)) ) - { - DEALLOCATE_LOCAL(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - { - accr.type = X_Reply; - accr.length = length >> 2; - accr.sequenceNumber = client->sequence; - accr.nPixels = npixels; - accr.nMasks = nmasks; - WriteReplyToClient(client, sizeof (xAllocColorCellsReply), &accr); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, length, ppixels); - } - DEALLOCATE_LOCAL(ppixels); - return (client->noClientException); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocColorPlanes(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xAllocColorPlanesReq); - - REQUEST_SIZE_MATCH(xAllocColorPlanesReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xAllocColorPlanesReply acpr; - int npixels, retval; - long length; - Pixel *ppixels; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColorPlanes request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - npixels = stuff->colors; - if (!npixels) - { - client->errorValue = npixels; - return (BadValue); - } - if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) - { - client->errorValue = stuff->contiguous; - return (BadValue); - } - acpr.type = X_Reply; - acpr.sequenceNumber = client->sequence; - acpr.nPixels = npixels; - length = (long)npixels * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); - if(!ppixels) - return(BadAlloc); - if( (retval = AllocColorPlanes(client->index, pcmp, npixels, - (int)stuff->red, (int)stuff->green, (int)stuff->blue, - (Bool)stuff->contiguous, ppixels, - &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) ) - { - DEALLOCATE_LOCAL(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } - acpr.length = length >> 2; -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - { - WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, length, ppixels); - } - DEALLOCATE_LOCAL(ppixels); - return (client->noClientException); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcFreeColors(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xFreeColorsReq); - - REQUEST_AT_LEAST_SIZE(xFreeColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int count; - int retval; - - if(pcmp->flags & AllAllocated) - return(BadAccess); - count = ((client->req_len << 2)- sizeof(xFreeColorsReq)) >> 2; - retval = FreeColors(pcmp, client->index, count, - (Pixel *)&stuff[1], (Pixel)stuff->planeMask); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(retval); - } - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcStoreColors (ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xStoreColorsReq); - - REQUEST_AT_LEAST_SIZE(xStoreColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int count; - int retval; - - count = (client->req_len << 2) - sizeof(xStoreColorsReq); - if (count % sizeof(xColorItem)) - return(BadLength); - count /= sizeof(xColorItem); - retval = StoreColors(pcmp, count, (xColorItem *)&stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(retval); - } - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcStoreNamedColor (register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xStoreNamedColorReq); - - REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xColorItem def; - int retval; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], - stuff->nbytes, &def.red, &def.green, &def.blue)) - { - def.flags = stuff->flags; - def.pixel = stuff->pixel; - retval = StoreColors(pcmp, 1, &def); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } - return (BadName); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcQueryColors(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xQueryColorsReq); - - REQUEST_AT_LEAST_SIZE(xQueryColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - int count, retval; - xrgb *prgbs; - xQueryColorsReply qcr; - - count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2; - prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb)); - if(!prgbs && count) - return(BadAlloc); - if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) ) - { - if (prgbs) DEALLOCATE_LOCAL(prgbs); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return (retval); - } - } - qcr.type = X_Reply; - qcr.length = (count * sizeof(xrgb)) >> 2; - qcr.sequenceNumber = client->sequence; - qcr.nColors = count; - WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr); - if (count) - { - client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; - WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); - } - if (prgbs) DEALLOCATE_LOCAL(prgbs); - return(client->noClientException); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcLookupColor(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xLookupColorReq); - - REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - xLookupColorReply lcr; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes, - &lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue)) - { - lcr.type = X_Reply; - lcr.length = 0; - lcr.sequenceNumber = client->sequence; - lcr.screenRed = lcr.exactRed; - lcr.screenGreen = lcr.exactGreen; - lcr.screenBlue = lcr.exactBlue; - (*pcmp->pScreen->ResolveColor)(&lcr.screenRed, - &lcr.screenGreen, - &lcr.screenBlue, - pcmp->pVisual); - WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr); - return(client->noClientException); - } - return (BadName); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcCreateCursor (register ClientPtr client) -{ - CursorPtr pCursor; - - register PixmapPtr src; - register PixmapPtr msk; - unsigned char * srcbits; - unsigned char * mskbits; - unsigned short width, height; - long n; - CursorMetricRec cm; - - - REQUEST(xCreateCursorReq); - - REQUEST_SIZE_MATCH(xCreateCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - src = (PixmapPtr)SecurityLookupIDByType(client, stuff->source, - RT_PIXMAP, SecurityReadAccess); - msk = (PixmapPtr)SecurityLookupIDByType(client, stuff->mask, - RT_PIXMAP, SecurityReadAccess); - if ( src == (PixmapPtr)NULL) - { - client->errorValue = stuff->source; - return (BadPixmap); - } - if ( msk == (PixmapPtr)NULL) - { - if (stuff->mask != None) - { - client->errorValue = stuff->mask; - return (BadPixmap); - } - } - else if ( src->drawable.width != msk->drawable.width - || src->drawable.height != msk->drawable.height - || src->drawable.depth != 1 - || msk->drawable.depth != 1) - return (BadMatch); - - width = src->drawable.width; - height = src->drawable.height; - - if ( stuff->x > width - || stuff->y > height ) - return (BadMatch); - - n = BitmapBytePad(width)*height; - srcbits = (unsigned char *)xalloc(n); - if (!srcbits) - return (BadAlloc); - mskbits = (unsigned char *)xalloc(n); - if (!mskbits) - { - xfree(srcbits); - return (BadAlloc); - } - - /* zeroing the (pad) bits helps some ddx cursor handling */ - bzero((char *)srcbits, n); - (* src->drawable.pScreen->GetImage)( (DrawablePtr)src, 0, 0, width, height, - XYPixmap, 1, (pointer)srcbits); - if ( msk == (PixmapPtr)NULL) - { - register unsigned char *bits = mskbits; - while (--n >= 0) - *bits++ = ~0; - } - else - { - /* zeroing the (pad) bits helps some ddx cursor handling */ - bzero((char *)mskbits, n); - (* msk->drawable.pScreen->GetImage)( (DrawablePtr)msk, 0, 0, width, - height, XYPixmap, 1, (pointer)mskbits); - } - cm.width = width; - cm.height = height; - cm.xhot = stuff->x; - cm.yhot = stuff->y; - pCursor = AllocCursor( srcbits, mskbits, &cm, - stuff->foreRed, stuff->foreGreen, stuff->foreBlue, - stuff->backRed, stuff->backGreen, stuff->backBlue); - - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - { - #ifdef TEST - fprintf(stderr, "ProcCreateCursor: Created cursor at [%p].\n", (void *) pCursor); - #endif - - return (client->noClientException); - } - - return BadAlloc; -} - -int -ProcCreateGlyphCursor (register ClientPtr client) -{ - CursorPtr pCursor; - int res; - - REQUEST(xCreateGlyphCursorReq); - - REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - res = AllocGlyphCursor(stuff->source, stuff->sourceChar, - stuff->mask, stuff->maskChar, - stuff->foreRed, stuff->foreGreen, stuff->foreBlue, - stuff->backRed, stuff->backGreen, stuff->backBlue, - &pCursor, client); - if (res != Success) - return res; - if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; - return BadAlloc; -} - - -int -ProcFreeCursor (register ClientPtr client) -{ - CursorPtr pCursor; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->id, - RT_CURSOR, SecurityDestroyAccess); - if (pCursor) - { - FreeResource(stuff->id, RT_NONE); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadCursor); - } -} - -int -ProcQueryBestSize (register ClientPtr client) -{ - xQueryBestSizeReply reply; - register DrawablePtr pDraw; - ScreenPtr pScreen; - REQUEST(xQueryBestSizeReq); - - REQUEST_SIZE_MATCH(xQueryBestSizeReq); - if ((stuff->class != CursorShape) && - (stuff->class != TileShape) && - (stuff->class != StippleShape)) - { - client->errorValue = stuff->class; - return(BadValue); - } - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW) - return (BadMatch); - pScreen = pDraw->pScreen; - (* pScreen->QueryBestSize)(stuff->class, &stuff->width, - &stuff->height, pScreen); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.width = stuff->width; - reply.height = stuff->height; - WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); - return (client->noClientException); -} - - -int -ProcSetScreenSaver (register ClientPtr client) -{ - int blankingOption, exposureOption; - REQUEST(xSetScreenSaverReq); - - REQUEST_SIZE_MATCH(xSetScreenSaverReq); - blankingOption = stuff->preferBlank; - if ((blankingOption != DontPreferBlanking) && - (blankingOption != PreferBlanking) && - (blankingOption != DefaultBlanking)) - { - client->errorValue = blankingOption; - return BadValue; - } - exposureOption = stuff->allowExpose; - if ((exposureOption != DontAllowExposures) && - (exposureOption != AllowExposures) && - (exposureOption != DefaultExposures)) - { - client->errorValue = exposureOption; - return BadValue; - } - if (stuff->timeout < -1) - { - client->errorValue = stuff->timeout; - return BadValue; - } - if (stuff->interval < -1) - { - client->errorValue = stuff->interval; - return BadValue; - } - - /* - * The NX agent uses the screen saver procedure - * to monitor the user activities and launch its - * handlers (like timeout feature), so we can't - * always allow the clients to change our values. - */ - - #ifdef TEST - fprintf(stderr, "ProcSetScreenSaver: Called with timeout [%d] interval [%d] Blanking [%d] Exposure [%d].\n", - stuff -> timeout, stuff -> interval, blankingOption, exposureOption); - #endif - - if (nxagentOption(Timeout) == 0) - { - if (blankingOption == DefaultBlanking) - { - ScreenSaverBlanking = defaultScreenSaverBlanking; - } - else - { - ScreenSaverBlanking = blankingOption; - } - - if (exposureOption == DefaultExposures) - { - ScreenSaverAllowExposures = defaultScreenSaverAllowExposures; - } - else - { - ScreenSaverAllowExposures = exposureOption; - } - - if (stuff->timeout >= 0) - { - ScreenSaverTime = stuff->timeout * MILLI_PER_SECOND; - } - else - { - ScreenSaverTime = defaultScreenSaverTime; - } - - if (stuff->interval >= 0) - { - ScreenSaverInterval = stuff->interval * MILLI_PER_SECOND; - } - else - { - ScreenSaverInterval = defaultScreenSaverInterval; - } - - SetScreenSaverTimer(); - } - #ifdef TEST - - else - { - fprintf(stderr, "ProcSetScreenSaver: Keeping auto-disconnect timeout set to [%d] seconds.\n", - nxagentOption(Timeout)); - } - - #endif - - return (client->noClientException); -} - -int -ProcGetScreenSaver(register ClientPtr client) -{ - xGetScreenSaverReply rep; - - REQUEST_SIZE_MATCH(xReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.timeout = ScreenSaverTime / MILLI_PER_SECOND; - rep.interval = ScreenSaverInterval / MILLI_PER_SECOND; - rep.preferBlanking = ScreenSaverBlanking; - rep.allowExposures = ScreenSaverAllowExposures; - WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep); - return (client->noClientException); -} - -int -ProcChangeHosts(register ClientPtr client) -{ - REQUEST(xChangeHostsReq); - int result; - - REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength); - - if(stuff->mode == HostInsert) - result = AddHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); - else if (stuff->mode == HostDelete) - result = RemoveHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); - else - { - client->errorValue = stuff->mode; - return BadValue; - } - if (!result) - result = client->noClientException; - return (result); -} - -int -ProcListHosts(register ClientPtr client) -{ - xListHostsReply reply; - int len, nHosts, result; - pointer pdata; - /* REQUEST(xListHostsReq); */ - - REQUEST_SIZE_MATCH(xListHostsReq); -#ifdef XCSECURITY - /* untrusted clients can't list hosts */ - if (client->trustLevel != XSecurityClientTrusted) - { - SecurityAudit("client %d attempted to list hosts\n", client->index); - return BadAccess; - } -#endif - result = GetHosts(&pdata, &nHosts, &len, &reply.enabled); - if (result != Success) - return(result); - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.nHosts = nHosts; - reply.length = len >> 2; - WriteReplyToClient(client, sizeof(xListHostsReply), &reply); - if (nHosts) - { - client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend; - WriteSwappedDataToClient(client, len, pdata); - } - xfree(pdata); - return (client->noClientException); -} - -int -ProcChangeAccessControl(register ClientPtr client) -{ - int result; - REQUEST(xSetAccessControlReq); - - REQUEST_SIZE_MATCH(xSetAccessControlReq); - if ((stuff->mode != EnableAccess) && (stuff->mode != DisableAccess)) - { - client->errorValue = stuff->mode; - return BadValue; - } - result = ChangeAccessControl(client, stuff->mode == EnableAccess); - if (!result) - result = client->noClientException; - return (result); -} - -int -ProcKillClient(register ClientPtr client) -{ - REQUEST(xResourceReq); - ClientPtr killclient; - - REQUEST_SIZE_MATCH(xResourceReq); - if (stuff->id == AllTemporary) - { - CloseDownRetainedResources(); - return (client->noClientException); - } - - if ((killclient = LookupClient(stuff->id, client))) - { - CloseDownClient(killclient); - /* if an LBX proxy gets killed, isItTimeToYield will be set */ - if (isItTimeToYield || (client == killclient)) - { - /* force yield and return Success, so that Dispatch() - * doesn't try to touch client - */ - isItTimeToYield = TRUE; - return (Success); - } - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadValue); - } -} - -int -ProcSetFontPath(register ClientPtr client) -{ - unsigned char *ptr; - unsigned long nbytes, total; - long nfonts; - int n, result; - int error; - REQUEST(xSetFontPathReq); - - REQUEST_AT_LEAST_SIZE(xSetFontPathReq); - - nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq); - total = nbytes; - ptr = (unsigned char *)&stuff[1]; - nfonts = stuff->nFonts; - while (--nfonts >= 0) - { - if ((total == 0) || (total < (n = (*ptr + 1)))) - return(BadLength); - total -= n; - ptr += n; - } - if (total >= 4) - return(BadLength); - result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1], - &error); - if (!result) - { - result = client->noClientException; - client->errorValue = error; - } - return (result); -} - -int -ProcGetFontPath(register ClientPtr client) -{ - xGetFontPathReply reply; - int stringLens, numpaths; - unsigned char *bufferStart; - /* REQUEST (xReq); */ - - REQUEST_SIZE_MATCH(xReq); - bufferStart = GetFontPath(&numpaths, &stringLens); - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = (stringLens + numpaths + 3) >> 2; - reply.nPaths = numpaths; - - WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); - if (stringLens || numpaths) - (void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart); - return(client->noClientException); -} - -int -ProcChangeCloseDownMode(register ClientPtr client) -{ - REQUEST(xSetCloseDownModeReq); - - REQUEST_SIZE_MATCH(xSetCloseDownModeReq); - if ((stuff->mode == AllTemporary) || - (stuff->mode == RetainPermanent) || - (stuff->mode == RetainTemporary)) - { - client->closeDownMode = stuff->mode; - return (client->noClientException); - } - else - { - client->errorValue = stuff->mode; - return (BadValue); - } -} - -int ProcForceScreenSaver(register ClientPtr client) -{ - REQUEST(xForceScreenSaverReq); - - REQUEST_SIZE_MATCH(xForceScreenSaverReq); - - if ((stuff->mode != ScreenSaverReset) && - (stuff->mode != ScreenSaverActive)) - { - client->errorValue = stuff->mode; - return BadValue; - } - - /* - * The NX agent uses the screen saver procedure - * to monitor the user activities and launch its - * handlers (like timeout feature), so we can't - * always allow the clients to force the screen - * saver handler execution. - */ - - if (nxagentOption(Timeout) == 0) - { - SaveScreens(SCREEN_SAVER_FORCER, (int)stuff->mode); - } - - #ifdef TEST - - else - { - fprintf(stderr, "ProcForceScreenSaver: Ignoring the client request with mode [%d].\n", - stuff -> mode); - } - - #endif - - return client->noClientException; -} - -int ProcNoOperation(register ClientPtr client) -{ - REQUEST_AT_LEAST_SIZE(xReq); - - /* noop -- don't do anything */ - return(client->noClientException); -} - -void -InitProcVectors(void) -{ - int i; - for (i = 0; i<256; i++) - { - if(!ProcVector[i]) - { - ProcVector[i] = SwappedProcVector[i] = ProcBadRequest; - ReplySwapVector[i] = ReplyNotSwappd; - } -#ifdef K5AUTH - if (!k5_Vector[i]) - { - k5_Vector[i] = k5_bad; - } -#endif - } - for(i = LASTEvent; i < 128; i++) - { - EventSwapVector[i] = NotImplemented; - } - -} - -/********************** - * CloseDownClient - * - * Client can either mark his resources destroy or retain. If retained and - * then killed again, the client is really destroyed. - *********************/ - -void -CloseDownClient(register ClientPtr client) -{ - Bool really_close_down = client->clientGone || - client->closeDownMode == DestroyAll; - - /* - * There must be a better way to hook a - * call-back function to be called any - * time a client is going to be closed. - */ - - nxagentClearClipboard(client, NULL); - - /* - * Need to reset the karma counter and - * get rid of the pending sync replies. - */ - - nxagentWakeupByReset(client); - - /* - * Check if the client - * is a shadow nxagent. - */ - - nxagentCheckIfShadowAgent(client); - - if (!client->clientGone) - { - /* ungrab server if grabbing client dies */ - if (grabState != GrabNone && grabClient == client) - { - UngrabServer(client); - } - BITCLEAR(grabWaiters, client->index); - DeleteClientFromAnySelections(client); - ReleaseActiveGrabs(client); - DeleteClientFontStuff(client); - if (!really_close_down) - { - /* This frees resources that should never be retained - * no matter what the close down mode is. Actually we - * could do this unconditionally, but it's probably - * better not to traverse all the client's resources - * twice (once here, once a few lines down in - * FreeClientResources) in the common case of - * really_close_down == TRUE. - */ - FreeClientNeverRetainResources(client); - client->clientState = ClientStateRetained; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - } - client->clientGone = TRUE; /* so events aren't sent to client */ - if (ClientIsAsleep(client)) - ClientSignal (client); - ProcessWorkQueueZombies(); -#ifdef LBX - ProcessQTagZombies(); -#endif - CloseDownConnection(client); - - /* If the client made it to the Running stage, nClients has - * been incremented on its behalf, so we need to decrement it - * now. If it hasn't gotten to Running, nClients has *not* - * been incremented, so *don't* decrement it. - */ - if (client->clientState != ClientStateInitial && - client->clientState != ClientStateAuthenticating ) - { - --nClients; - } - } - - if (really_close_down) - { - if (client->clientState == ClientStateRunning && nClients == 0) - dispatchException |= dispatchExceptionAtReset; - - client->clientState = ClientStateGone; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - FreeClientResources(client); - if (client->index < nextFreeClientID) - nextFreeClientID = client->index; - clients[client->index] = NullClient; -#ifdef SMART_SCHEDULE - SmartLastClient = NullClient; -#endif - xfree(client); - - while (!clients[currentMaxClients-1]) - currentMaxClients--; - } -} - -static void -KillAllClients() -{ - int i; - for (i=1; icloseDownMode = DestroyAll; - CloseDownClient(clients[i]); - } -} - -/********************* - * CloseDownRetainedResources - * - * Find all clients that are gone and have terminated in RetainTemporary - * and destroy their resources. - *********************/ - -void -CloseDownRetainedResources() -{ - register int i; - register ClientPtr client; - - for (i=1; icloseDownMode == RetainTemporary) - && (client->clientGone)) - CloseDownClient(client); - } -} - -void InitClient(ClientPtr client, int i, pointer ospriv) -{ - client->index = i; - client->sequence = 0; - client->clientAsMask = ((Mask)i) << CLIENTOFFSET; - client->clientGone = FALSE; - if (i) - { - client->closeDownMode = DestroyAll; - client->lastDrawable = (DrawablePtr)WindowTable[0]; - client->lastDrawableID = WindowTable[0]->drawable.id; - } - else - { - client->closeDownMode = RetainPermanent; - client->lastDrawable = (DrawablePtr)NULL; - client->lastDrawableID = INVALID; - } - client->lastGC = (GCPtr) NULL; - client->lastGCID = INVALID; - client->numSaved = 0; - client->saveSet = (SaveSetElt *)NULL; - client->noClientException = Success; -#ifdef LOG_DEBUG - client->requestLogIndex = 0; -#endif - client->requestVector = InitialVector; - client->osPrivate = ospriv; - client->swapped = FALSE; - client->big_requests = FALSE; - client->priority = 0; - client->clientState = ClientStateInitial; -#ifdef XKB - if (!noXkbExtension) { - client->xkbClientFlags = 0; - client->mapNotifyMask = 0; - QueryMinMaxKeyCodes(&client->minKC,&client->maxKC); - } -#endif - client->replyBytesRemaining = 0; -#ifdef LBX - client->readRequest = StandardReadRequestFromClient; -#endif -#ifdef XCSECURITY - client->trustLevel = XSecurityClientTrusted; - client->CheckAccess = NULL; - client->authId = 0; -#endif -#ifdef XAPPGROUP - client->appgroup = NULL; -#endif - client->fontResFunc = NULL; -#ifdef SMART_SCHEDULE - client->smart_priority = 0; - client->smart_start_tick = SmartScheduleTime; - client->smart_stop_tick = SmartScheduleTime; - client->smart_check_tick = SmartScheduleTime; -#endif -} - -extern int clientPrivateLen; -extern unsigned *clientPrivateSizes; -extern unsigned totalClientSize; - -int -InitClientPrivates(ClientPtr client) -{ - register char *ptr; - DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; - - if (totalClientSize == sizeof(ClientRec)) - ppriv = (DevUnion *)NULL; - else if (client->index) - ppriv = (DevUnion *)(client + 1); - else - { - ppriv = (DevUnion *)xalloc(totalClientSize - sizeof(ClientRec)); - if (!ppriv) - return 0; - } - client->devPrivates = ppriv; - sizes = clientPrivateSizes; - ptr = (char *)(ppriv + clientPrivateLen); - for (i = clientPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - - /* - * Initialize the private members. - */ - - nxagentInitClientPrivates(client); - - return 1; -} - -/************************ - * int NextAvailableClient(ospriv) - * - * OS dependent portion can't assign client id's because of CloseDownModes. - * Returns NULL if there are no free clients. - *************************/ - -ClientPtr NextAvailableClient(pointer ospriv) -{ - register int i; - register ClientPtr client; - xReq data; - - i = nextFreeClientID; - if (i == MAXCLIENTS) - return (ClientPtr)NULL; - clients[i] = client = (ClientPtr)xalloc(totalClientSize); - if (!client) - return (ClientPtr)NULL; - InitClient(client, i, ospriv); - InitClientPrivates(client); - if (!InitClientResources(client)) - { - xfree(client); - return (ClientPtr)NULL; - } - data.reqType = 1; - data.length = (sz_xReq + sz_xConnClientPrefix) >> 2; - if (!InsertFakeRequest(client, (char *)&data, sz_xReq)) - { - FreeClientResources(client); - xfree(client); - return (ClientPtr)NULL; - } - if (i == currentMaxClients) - currentMaxClients++; - while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID]) - nextFreeClientID++; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - return(client); -} - -int -ProcInitialConnection(register ClientPtr client) -{ - REQUEST(xReq); - register xConnClientPrefix *prefix; - int whichbyte = 1; - - prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); - if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B')) - return (client->noClientException = -1); - if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) || - (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) - { - client->swapped = TRUE; - SwapConnClientPrefix(prefix); - } - stuff->reqType = 2; - stuff->length += ((prefix->nbytesAuthProto + (unsigned)3) >> 2) + - ((prefix->nbytesAuthString + (unsigned)3) >> 2); - if (client->swapped) - { - swaps(&stuff->length, whichbyte); - } - ResetCurrentRequest(client); - return (client->noClientException); -} - -#ifdef LBX -void -IncrementClientCount() -{ - nClients++; -} -#endif - -int -SendConnSetup(register ClientPtr client, char *reason) -{ - register xWindowRoot *root; - register int i; - int numScreens; - char* lConnectionInfo; - xConnSetupPrefix* lconnSetupPrefix; - - if (reason) - { - xConnSetupPrefix csp; - - csp.success = xFalse; - csp.lengthReason = strlen(reason); - csp.length = (csp.lengthReason + (unsigned)3) >> 2; - csp.majorVersion = X_PROTOCOL; - csp.minorVersion = X_PROTOCOL_REVISION; - if (client->swapped) - WriteSConnSetupPrefix(client, &csp); - else - (void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp); - (void)WriteToClient(client, (int)csp.lengthReason, reason); - return (client->noClientException = -1); - } - - numScreens = screenInfo.numScreens; - lConnectionInfo = ConnectionInfo; - lconnSetupPrefix = &connSetupPrefix; - - /* We're about to start speaking X protocol back to the client by - * sending the connection setup info. This means the authorization - * step is complete, and we can count the client as an - * authorized one. - */ - nClients++; - - client->requestVector = client->swapped ? SwappedProcVector : ProcVector; - client->sequence = 0; -#ifdef XAPPGROUP - XagConnectionInfo (client, &lconnSetupPrefix, &lConnectionInfo, &numScreens); -#endif - ((xConnSetup *)lConnectionInfo)->ridBase = client->clientAsMask; - ((xConnSetup *)lConnectionInfo)->ridMask = RESOURCE_ID_MASK; -#ifdef MATCH_CLIENT_ENDIAN - ((xConnSetup *)lConnectionInfo)->imageByteOrder = ClientOrder (client); - ((xConnSetup *)lConnectionInfo)->bitmapBitOrder = ClientOrder (client); -#endif - /* fill in the "currentInputMask" */ - root = (xWindowRoot *)(lConnectionInfo + connBlockScreenStart); -#ifdef PANORAMIX - if (noPanoramiXExtension) - numScreens = screenInfo.numScreens; - else - numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; -#endif - - for (i=0; icurrentInputMask = WindowTable[i]->eventMask | - wOtherEventMasks (WindowTable[i]); - pDepth = (xDepth *)(root + 1); - for (j = 0; j < root->nDepths; j++) - { - pDepth = (xDepth *)(((char *)(pDepth + 1)) + - pDepth->nVisuals * sizeof(xVisualType)); - } - root = (xWindowRoot *)pDepth; - } - - if (client->swapped) - { - WriteSConnSetupPrefix(client, lconnSetupPrefix); - WriteSConnectionInfo(client, - (unsigned long)(lconnSetupPrefix->length << 2), - lConnectionInfo); - } - else - { - (void)WriteToClient(client, sizeof(xConnSetupPrefix), - (char *) lconnSetupPrefix); - (void)WriteToClient(client, (int)(lconnSetupPrefix->length << 2), - lConnectionInfo); - } - client->clientState = ClientStateRunning; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = lconnSetupPrefix; - clientinfo.setup = (xConnSetup *)lConnectionInfo; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - return (client->noClientException); -} - -int -ProcEstablishConnection(register ClientPtr client) -{ - char *reason, *auth_proto, *auth_string; - register xConnClientPrefix *prefix; - REQUEST(xReq); - - prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); - auth_proto = (char *)prefix + sz_xConnClientPrefix; - auth_string = auth_proto + ((prefix->nbytesAuthProto + 3) & ~3); - if ((prefix->majorVersion != X_PROTOCOL) || - (prefix->minorVersion != X_PROTOCOL_REVISION)) - reason = "Protocol version mismatch"; - else - reason = ClientAuthorized(client, - (unsigned short)prefix->nbytesAuthProto, - auth_proto, - (unsigned short)prefix->nbytesAuthString, - auth_string); - /* - * If Kerberos is being used for this client, the clientState - * will be set to ClientStateAuthenticating at this point. - * More messages need to be exchanged among the X server, Kerberos - * server, and client to figure out if everyone is authorized. - * So we don't want to send the connection setup info yet, since - * the auth step isn't really done. - */ - if (client->clientState == ClientStateCheckingSecurity) - client->clientState = ClientStateCheckedSecurity; - else if (client->clientState != ClientStateAuthenticating) - return(SendConnSetup(client, reason)); - return(client->noClientException); -} - -void -SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, - XID resId, int errorCode) -{ - xError rep; - - rep.type = X_Error; - rep.sequenceNumber = client->sequence; - rep.errorCode = errorCode; - rep.majorCode = majorCode; - rep.minorCode = minorCode; - rep.resourceID = resId; - - WriteEventsToClient (client, 1, (xEvent *)&rep); -} - -void -DeleteWindowFromAnySelections(WindowPtr pWin) -{ - register int i; - - for (i = 0; i< NumCurrentSelections; i++) - if (CurrentSelections[i].pWin == pWin) - { - if (SelectionCallback) - { - SelectionInfoRec info; - - info.selection = &CurrentSelections[i]; - info.kind = SelectionWindowDestroy; - CallCallbacks(&SelectionCallback, &info); - } - CurrentSelections[i].pWin = (WindowPtr)NULL; - CurrentSelections[i].window = None; - CurrentSelections[i].client = NullClient; - } -} - -static void -DeleteClientFromAnySelections(ClientPtr client) -{ - register int i; - - for (i = 0; i< NumCurrentSelections; i++) - if (CurrentSelections[i].client == client) - { - if (SelectionCallback) - { - SelectionInfoRec info; - - info.selection = &CurrentSelections[i]; - info.kind = SelectionWindowDestroy; - CallCallbacks(&SelectionCallback, &info); - } - CurrentSelections[i].pWin = (WindowPtr)NULL; - CurrentSelections[i].window = None; - CurrentSelections[i].client = NullClient; - } -} - -void -MarkClientException(ClientPtr client) -{ - client->noClientException = -1; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.X.original deleted file mode 100644 index 6941456de..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.X.original +++ /dev/null @@ -1,4035 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.13 2005/09/13 01:33:19 daniels Exp $ */ -/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ -/************************************************************ - -Copyright 1987, 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* The panoramix components contained the following notice */ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.32 2003/11/10 18:21:45 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef PANORAMIX_DEBUG -#include -int ProcInitialConnection(); -#endif - -#include "windowstr.h" -#include -#include "dixfontstr.h" -#include "gcstruct.h" -#include "selection.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "opaque.h" -#include "input.h" -#include "servermd.h" -#include "extnsionst.h" -#include "dixfont.h" -#include "dispatch.h" -#include "swaprep.h" -#include "swapreq.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif -#ifdef XAPPGROUP -#include -#endif -#ifdef XKB -#define XKB_IN_SERVER -#include "inputstr.h" -#include -#endif -#ifdef LBX -#include "lbxserve.h" -#endif - -#define mskcnt ((MAXCLIENTS + 31) / 32) -#define BITMASK(i) (1U << ((i) & 31)) -#define MASKIDX(i) ((i) >> 5) -#define MASKWORD(buf, i) buf[MASKIDX(i)] -#define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i) -#define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i) -#define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i)) - -extern xConnSetupPrefix connSetupPrefix; -extern char *ConnectionInfo; - -Selection *CurrentSelections; -int NumCurrentSelections; -CallbackListPtr SelectionCallback = NULL; - -static ClientPtr grabClient; -#define GrabNone 0 -#define GrabActive 1 -#define GrabKickout 2 -static int grabState = GrabNone; -static long grabWaiters[mskcnt]; -CallbackListPtr ServerGrabCallback = NULL; -HWEventQueuePtr checkForInput[2]; -extern int connBlockScreenStart; - -static void KillAllClients(void); - -static void DeleteClientFromAnySelections(ClientPtr client); - -static int nextFreeClientID; /* always MIN free client ID */ - -static int nClients; /* number of authorized clients */ - -CallbackListPtr ClientStateCallback; - -/* dispatchException & isItTimeToYield must be declared volatile since they - * are modified by signal handlers - otherwise optimizer may assume it doesn't - * need to actually check value in memory when used and may miss changes from - * signal handlers. - */ -volatile char dispatchException = 0; -volatile char isItTimeToYield; - -/* Various of the DIX function interfaces were not designed to allow - * the client->errorValue to be set on BadValue and other errors. - * Rather than changing interfaces and breaking untold code we introduce - * a new global that dispatch can use. - */ -XID clientErrorValue; /* XXX this is a kludge */ - -#define SAME_SCREENS(a, b) (\ - (a.pScreen == b.pScreen)) - -void -SetInputCheck(HWEventQueuePtr c0, HWEventQueuePtr c1) -{ - checkForInput[0] = c0; - checkForInput[1] = c1; -} - -void -UpdateCurrentTime() -{ - TimeStamp systime; - - /* To avoid time running backwards, we must call GetTimeInMillis before - * calling ProcessInputEvents. - */ - systime.months = currentTime.months; - systime.milliseconds = GetTimeInMillis(); - if (systime.milliseconds < currentTime.milliseconds) - systime.months++; - if (*checkForInput[0] != *checkForInput[1]) - ProcessInputEvents(); - if (CompareTimeStamps(systime, currentTime) == LATER) - currentTime = systime; -} - -/* Like UpdateCurrentTime, but can't call ProcessInputEvents */ -void -UpdateCurrentTimeIf() -{ - TimeStamp systime; - - systime.months = currentTime.months; - systime.milliseconds = GetTimeInMillis(); - if (systime.milliseconds < currentTime.milliseconds) - systime.months++; - if (*checkForInput[0] == *checkForInput[1]) - currentTime = systime; -} - -void -InitSelections() -{ - if (CurrentSelections) - xfree(CurrentSelections); - CurrentSelections = (Selection *)NULL; - NumCurrentSelections = 0; -} - -void -FlushClientCaches(XID id) -{ - int i; - register ClientPtr client; - - client = clients[CLIENT_ID(id)]; - if (client == NullClient) - return ; - for (i=0; ilastDrawableID == id) - { - client->lastDrawableID = WindowTable[0]->drawable.id; - client->lastDrawable = (DrawablePtr)WindowTable[0]; - } - else if (client->lastGCID == id) - { - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } - } - } -} -#ifdef SMART_SCHEDULE - -#undef SMART_DEBUG - -#define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ -#define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ - -Bool SmartScheduleDisable = FALSE; -long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; -long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; -long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; -long SmartScheduleTime; -ClientPtr SmartLastClient; -int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1]; -int SmartScheduleClient(int *clientReady, int nready); - -#ifdef SMART_DEBUG -long SmartLastPrint; -#endif - -void Dispatch(void); -void InitProcVectors(void); - -int -SmartScheduleClient (int *clientReady, int nready) -{ - ClientPtr pClient; - int i; - int client; - int bestPrio, best = 0; - int bestRobin, robin; - long now = SmartScheduleTime; - long idle; - - bestPrio = -0x7fffffff; - bestRobin = 0; - idle = 2 * SmartScheduleSlice; - for (i = 0; i < nready; i++) - { - client = clientReady[i]; - pClient = clients[client]; - /* Praise clients which are idle */ - if ((now - pClient->smart_check_tick) >= idle) - { - if (pClient->smart_priority < 0) - pClient->smart_priority++; - } - pClient->smart_check_tick = now; - - /* check priority to select best client */ - robin = (pClient->index - SmartLastIndex[pClient->smart_priority-SMART_MIN_PRIORITY]) & 0xff; - if (pClient->smart_priority > bestPrio || - (pClient->smart_priority == bestPrio && robin > bestRobin)) - { - bestPrio = pClient->smart_priority; - bestRobin = robin; - best = client; - } -#ifdef SMART_DEBUG - if ((now - SmartLastPrint) >= 5000) - fprintf (stderr, " %2d: %3d", client, pClient->smart_priority); -#endif - } -#ifdef SMART_DEBUG - if ((now - SmartLastPrint) >= 5000) - { - fprintf (stderr, " use %2d\n", best); - SmartLastPrint = now; - } -#endif - pClient = clients[best]; - SmartLastIndex[bestPrio-SMART_MIN_PRIORITY] = pClient->index; - /* - * Set current client pointer - */ - if (SmartLastClient != pClient) - { - pClient->smart_start_tick = now; - SmartLastClient = pClient; - } - /* - * Adjust slice - */ - if (nready == 1) - { - /* - * If it's been a long time since another client - * has run, bump the slice up to get maximal - * performance from a single client - */ - if ((now - pClient->smart_start_tick) > 1000 && - SmartScheduleSlice < SmartScheduleMaxSlice) - { - SmartScheduleSlice += SmartScheduleInterval; - } - } - else - { - SmartScheduleSlice = SmartScheduleInterval; - } - return best; -} -#endif - -#define MAJOROP ((xReq *)client->requestBuffer)->reqType - -void -Dispatch(void) -{ - register int *clientReady; /* array of request ready clients */ - register int result; - register ClientPtr client; - register int nready; - register HWEventQueuePtr* icheck = checkForInput; -#ifdef SMART_SCHEDULE - long start_tick; -#endif - - nextFreeClientID = 1; - InitSelections(); - nClients = 0; - - clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients); - if (!clientReady) - return; - - while (!dispatchException) - { - if (*icheck[0] != *icheck[1]) - { - ProcessInputEvents(); - FlushIfCriticalOutputPending(); - } - - nready = WaitForSomething(clientReady); - -#ifdef SMART_SCHEDULE - if (nready && !SmartScheduleDisable) - { - clientReady[0] = SmartScheduleClient (clientReady, nready); - nready = 1; - } -#endif - /***************** - * Handle events in round robin fashion, doing input between - * each round - *****************/ - - while (!dispatchException && (--nready >= 0)) - { - client = clients[clientReady[nready]]; - if (! client) - { - /* KillClient can cause this to happen */ - continue; - } - /* GrabServer activation can cause this to be true */ - if (grabState == GrabKickout) - { - grabState = GrabActive; - break; - } - isItTimeToYield = FALSE; - - requestingClient = client; -#ifdef SMART_SCHEDULE - start_tick = SmartScheduleTime; -#endif - while (!isItTimeToYield) - { - if (*icheck[0] != *icheck[1]) - { - ProcessInputEvents(); - FlushIfCriticalOutputPending(); - } -#ifdef SMART_SCHEDULE - if (!SmartScheduleDisable && - (SmartScheduleTime - start_tick) >= SmartScheduleSlice) - { - /* Penalize clients which consume ticks */ - if (client->smart_priority > SMART_MIN_PRIORITY) - client->smart_priority--; - break; - } -#endif - /* now, finally, deal with client requests */ - - result = ReadRequestFromClient(client); - if (result <= 0) - { - if (result < 0) - CloseDownClient(client); - break; - } - - client->sequence++; -#ifdef DEBUG - if (client->requestLogIndex == MAX_REQUEST_LOG) - client->requestLogIndex = 0; - client->requestLog[client->requestLogIndex] = MAJOROP; - client->requestLogIndex++; -#endif - if (result > (maxBigRequestSize << 2)) - result = BadLength; - else - result = (* client->requestVector[MAJOROP])(client); - - if (result != Success) - { - if (client->noClientException != Success) - CloseDownClient(client); - else - SendErrorToClient(client, MAJOROP, - MinorOpcodeOfRequest(client), - client->errorValue, result); - break; - } -#ifdef DAMAGEEXT - FlushIfCriticalOutputPending (); -#endif - } - FlushAllOutput(); -#ifdef SMART_SCHEDULE - client = clients[clientReady[nready]]; - if (client) - client->smart_stop_tick = SmartScheduleTime; -#endif - requestingClient = NULL; - } - dispatchException &= ~DE_PRIORITYCHANGE; - } -#if defined(DDXBEFORERESET) - ddxBeforeReset (); -#endif - KillAllClients(); - DEALLOCATE_LOCAL(clientReady); - dispatchException &= ~DE_RESET; -} - -#undef MAJOROP - -int -ProcBadRequest(ClientPtr client) -{ - return (BadRequest); -} - -int -ProcCreateWindow(ClientPtr client) -{ - register WindowPtr pParent, pWin; - REQUEST(xCreateWindowReq); - int result; - int len; - - REQUEST_AT_LEAST_SIZE(xCreateWindowReq); - - LEGAL_NEW_RESOURCE(stuff->wid, client); - if (!(pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess))) - return BadWindow; - len = client->req_len - (sizeof(xCreateWindowReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - pWin = CreateWindow(stuff->wid, pParent, stuff->x, - stuff->y, stuff->width, stuff->height, - stuff->borderWidth, stuff->class, - stuff->mask, (XID *) &stuff[1], - (int)stuff->depth, - client, stuff->visual, &result); - if (pWin) - { - Mask mask = pWin->eventMask; - - pWin->eventMask = 0; /* subterfuge in case AddResource fails */ - if (!AddResource(stuff->wid, RT_WINDOW, (pointer)pWin)) - return BadAlloc; - pWin->eventMask = mask; - } - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcChangeWindowAttributes(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xChangeWindowAttributesReq); - register int result; - int len; - - REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2); - if (len != Ones(stuff->valueMask)) - return BadLength; - result = ChangeWindowAttributes(pWin, - stuff->valueMask, - (XID *) &stuff[1], - client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcGetWindowAttributes(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - xGetWindowAttributesReply wa; - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - GetWindowAttributes(pWin, client, &wa); - WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa); - return(client->noClientException); -} - -int -ProcDestroyWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); - if (!pWin) - return(BadWindow); - if (pWin->parent) - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); -} - -int -ProcDestroySubwindows(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); - if (!pWin) - return(BadWindow); - DestroySubwindows(pWin, client); - return(client->noClientException); -} - -int -ProcChangeSaveSet(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xChangeSaveSetReq); - register int result; - - REQUEST_SIZE_MATCH(xChangeSaveSetReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) - return BadMatch; - if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete)) - { - result = AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - { - client->errorValue = stuff->mode; - return( BadValue ); - } -} - -int -ProcReparentWindow(register ClientPtr client) -{ - register WindowPtr pWin, pParent; - REQUEST(xReparentWindowReq); - register int result; - - REQUEST_SIZE_MATCH(xReparentWindowReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess); - if (!pParent) - return(BadWindow); - if (SAME_SCREENS(pWin->drawable, pParent->drawable)) - { - if ((pWin->backgroundState == ParentRelative) && - (pParent->drawable.depth != pWin->drawable.depth)) - return BadMatch; - if ((pWin->drawable.class != InputOnly) && - (pParent->drawable.class == InputOnly)) - return BadMatch; - result = ReparentWindow(pWin, pParent, - (short)stuff->x, (short)stuff->y, client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - return (BadMatch); -} - -int -ProcMapWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - MapWindow(pWin, client); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcMapSubwindows(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - MapSubwindows(pWin, client); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcUnmapWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - UnmapWindow(pWin, FALSE); - /* update cache to say it is mapped */ - return(client->noClientException); -} - -int -ProcUnmapSubwindows(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - UnmapSubwindows(pWin); - return(client->noClientException); -} - -int -ProcConfigureWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xConfigureWindowReq); - register int result; - int len; - - REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); - pWin = (WindowPtr)SecurityLookupWindow( stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - len = client->req_len - (sizeof(xConfigureWindowReq) >> 2); - if (Ones((Mask)stuff->mask) != len) - return BadLength; - result = ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1], - client); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcCirculateWindow(register ClientPtr client) -{ - register WindowPtr pWin; - REQUEST(xCirculateWindowReq); - - REQUEST_SIZE_MATCH(xCirculateWindowReq); - if ((stuff->direction != RaiseLowest) && - (stuff->direction != LowerHighest)) - { - client->errorValue = stuff->direction; - return BadValue; - } - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - CirculateWindow(pWin, (int)stuff->direction, client); - return(client->noClientException); -} - -int -GetGeometry(register ClientPtr client, xGetGeometryReply *rep) -{ - register DrawablePtr pDraw; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, SecurityReadAccess); - rep->type = X_Reply; - rep->length = 0; - rep->sequenceNumber = client->sequence; - rep->root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - rep->depth = pDraw->depth; - rep->width = pDraw->width; - rep->height = pDraw->height; - - /* XXX - Because the pixmap-implementation of the multibuffer extension - * may have the buffer-id's drawable resource value be a pointer - * to the buffer's window instead of the buffer itself - * (this happens if the buffer is the displayed buffer), - * we also have to check that the id matches before we can - * truly say that it is a DRAWABLE_WINDOW. - */ - - if ((pDraw->type == UNDRAWABLE_WINDOW) || - ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id))) - { - register WindowPtr pWin = (WindowPtr)pDraw; - rep->x = pWin->origin.x - wBorderWidth (pWin); - rep->y = pWin->origin.y - wBorderWidth (pWin); - rep->borderWidth = pWin->borderWidth; - } - else /* DRAWABLE_PIXMAP or DRAWABLE_BUFFER */ - { - rep->x = rep->y = rep->borderWidth = 0; - } - - return Success; -} - - -int -ProcGetGeometry(register ClientPtr client) -{ - xGetGeometryReply rep; - int status; - - if ((status = GetGeometry(client, &rep)) != Success) - return status; - - WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); - return(client->noClientException); -} - - -int -ProcQueryTree(register ClientPtr client) -{ - xQueryTreeReply reply; - int numChildren = 0; - register WindowPtr pChild, pWin, pHead; - Window *childIDs = (Window *)NULL; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - reply.type = X_Reply; - reply.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - reply.sequenceNumber = client->sequence; - if (pWin->parent) - reply.parent = pWin->parent->drawable.id; - else - reply.parent = (Window)None; - pHead = RealChildHead(pWin); - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - numChildren++; - if (numChildren) - { - int curChild = 0; - - childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window)); - if (!childIDs) - return BadAlloc; - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - childIDs[curChild++] = pChild->drawable.id; - } - - reply.nChildren = numChildren; - reply.length = (numChildren * sizeof(Window)) >> 2; - - WriteReplyToClient(client, sizeof(xQueryTreeReply), &reply); - if (numChildren) - { - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs); - DEALLOCATE_LOCAL(childIDs); - } - - return(client->noClientException); -} - -int -ProcInternAtom(register ClientPtr client) -{ - Atom atom; - char *tchar; - REQUEST(xInternAtomReq); - - REQUEST_FIXED_SIZE(xInternAtomReq, stuff->nbytes); - if ((stuff->onlyIfExists != xTrue) && (stuff->onlyIfExists != xFalse)) - { - client->errorValue = stuff->onlyIfExists; - return(BadValue); - } - tchar = (char *) &stuff[1]; - atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); - if (atom != BAD_RESOURCE) - { - xInternAtomReply reply; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.atom = atom; - WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); - return(client->noClientException); - } - else - return (BadAlloc); -} - -int -ProcGetAtomName(register ClientPtr client) -{ - char *str; - xGetAtomNameReply reply; - int len; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - if ( (str = NameForAtom(stuff->id)) ) - { - len = strlen(str); - reply.type = X_Reply; - reply.length = (len + 3) >> 2; - reply.sequenceNumber = client->sequence; - reply.nameLength = len; - WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); - (void)WriteToClient(client, len, str); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadAtom); - } -} - -#ifdef K5AUTH -extern int k5_bad(); -#endif - -int -ProcSetSelectionOwner(register ClientPtr client) -{ - WindowPtr pWin; - TimeStamp time; - REQUEST(xSetSelectionOwnerReq); - - REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); - UpdateCurrentTime(); - time = ClientTimeToServerTime(stuff->time); - - /* If the client's time stamp is in the future relative to the server's - time stamp, do not set the selection, just return success. */ - if (CompareTimeStamps(time, currentTime) == LATER) - return Success; - if (stuff->window != None) - { - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - } - else - pWin = (WindowPtr)None; - if (ValidAtom(stuff->selection)) - { - int i = 0; - - /* - * First, see if the selection is already set... - */ - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) - i++; - if (i < NumCurrentSelections) - { - xEvent event; - - /* If the timestamp in client's request is in the past relative - to the time stamp indicating the last time the owner of the - selection was set, do not set the selection, just return - success. */ - if (CompareTimeStamps(time, CurrentSelections[i].lastTimeChanged) - == EARLIER) - return Success; - if (CurrentSelections[i].client && - (!pWin || (CurrentSelections[i].client != client))) - { - event.u.u.type = SelectionClear; - event.u.selectionClear.time = time.milliseconds; - event.u.selectionClear.window = CurrentSelections[i].window; - event.u.selectionClear.atom = CurrentSelections[i].selection; - (void) TryClientEvents (CurrentSelections[i].client, &event, 1, - NoEventMask, NoEventMask /* CantBeFiltered */, - NullGrab); - } - } - else - { - /* - * It doesn't exist, so add it... - */ - Selection *newsels; - - if (i == 0) - newsels = (Selection *)xalloc(sizeof(Selection)); - else - newsels = (Selection *)xrealloc(CurrentSelections, - (NumCurrentSelections + 1) * sizeof(Selection)); - if (!newsels) - return BadAlloc; - NumCurrentSelections++; - CurrentSelections = newsels; - CurrentSelections[i].selection = stuff->selection; - } - CurrentSelections[i].lastTimeChanged = time; - CurrentSelections[i].window = stuff->window; - CurrentSelections[i].pWin = pWin; - CurrentSelections[i].client = (pWin ? client : NullClient); - if (SelectionCallback) - { - SelectionInfoRec info; - - info.selection = &CurrentSelections[i]; - info.kind= SelectionSetOwner; - CallCallbacks(&SelectionCallback, &info); - } - return (client->noClientException); - } - else - { - client->errorValue = stuff->selection; - return (BadAtom); - } -} - -int -ProcGetSelectionOwner(register ClientPtr client) -{ - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - if (ValidAtom(stuff->id)) - { - int i; - xGetSelectionOwnerReply reply; - - i = 0; - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->id) i++; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - if (i < NumCurrentSelections) - reply.owner = CurrentSelections[i].window; - else - reply.owner = None; - WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadAtom); - } -} - -int -ProcConvertSelection(register ClientPtr client) -{ - Bool paramsOkay; - xEvent event; - WindowPtr pWin; - REQUEST(xConvertSelectionReq); - - REQUEST_SIZE_MATCH(xConvertSelectionReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - paramsOkay = (ValidAtom(stuff->selection) && ValidAtom(stuff->target)); - if (stuff->property != None) - paramsOkay &= ValidAtom(stuff->property); - if (paramsOkay) - { - int i; - - i = 0; - while ((i < NumCurrentSelections) && - CurrentSelections[i].selection != stuff->selection) i++; - if ((i < NumCurrentSelections) && - (CurrentSelections[i].window != None) -#ifdef XCSECURITY - && (!client->CheckAccess || - (* client->CheckAccess)(client, CurrentSelections[i].window, - RT_WINDOW, SecurityReadAccess, - CurrentSelections[i].pWin)) -#endif - ) - { - event.u.u.type = SelectionRequest; - event.u.selectionRequest.time = stuff->time; - event.u.selectionRequest.owner = - CurrentSelections[i].window; - event.u.selectionRequest.requestor = stuff->requestor; - event.u.selectionRequest.selection = stuff->selection; - event.u.selectionRequest.target = stuff->target; - event.u.selectionRequest.property = stuff->property; - if (TryClientEvents( - CurrentSelections[i].client, &event, 1, NoEventMask, - NoEventMask /* CantBeFiltered */, NullGrab)) - return (client->noClientException); - } - event.u.u.type = SelectionNotify; - event.u.selectionNotify.time = stuff->time; - event.u.selectionNotify.requestor = stuff->requestor; - event.u.selectionNotify.selection = stuff->selection; - event.u.selectionNotify.target = stuff->target; - event.u.selectionNotify.property = None; - (void) TryClientEvents(client, &event, 1, NoEventMask, - NoEventMask /* CantBeFiltered */, NullGrab); - return (client->noClientException); - } - else - { - client->errorValue = stuff->property; - return (BadAtom); - } -} - -int -ProcGrabServer(register ClientPtr client) -{ - REQUEST_SIZE_MATCH(xReq); - if (grabState != GrabNone && client != grabClient) - { - ResetCurrentRequest(client); - client->sequence--; - BITSET(grabWaiters, client->index); - IgnoreClient(client); - return(client->noClientException); - } - OnlyListenToOneClient(client); - grabState = GrabKickout; - grabClient = client; - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = SERVER_GRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); - } - - return(client->noClientException); -} - -static void -UngrabServer(ClientPtr client) -{ - int i; - - grabState = GrabNone; - ListenToAllClients(); - for (i = mskcnt; --i >= 0 && !grabWaiters[i]; ) - ; - if (i >= 0) - { - i <<= 5; - while (!GETBIT(grabWaiters, i)) - i++; - BITCLEAR(grabWaiters, i); - AttendClient(clients[i]); - } - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = SERVER_UNGRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); - } -} - -int -ProcUngrabServer(register ClientPtr client) -{ - REQUEST_SIZE_MATCH(xReq); - UngrabServer(client); - return(client->noClientException); -} - -int -ProcTranslateCoords(register ClientPtr client) -{ - REQUEST(xTranslateCoordsReq); - - register WindowPtr pWin, pDst; - xTranslateCoordsReply rep; - - REQUEST_SIZE_MATCH(xTranslateCoordsReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, - SecurityReadAccess); - if (!pDst) - return(BadWindow); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (!SAME_SCREENS(pWin->drawable, pDst->drawable)) - { - rep.sameScreen = xFalse; - rep.child = None; - rep.dstX = rep.dstY = 0; - } - else - { - INT16 x, y; - rep.sameScreen = xTrue; - rep.child = None; - /* computing absolute coordinates -- adjust to destination later */ - x = pWin->drawable.x + stuff->srcX; - y = pWin->drawable.y + stuff->srcY; - pWin = pDst->firstChild; - while (pWin) - { -#ifdef SHAPE - BoxRec box; -#endif - if ((pWin->mapped) && - (x >= pWin->drawable.x - wBorderWidth (pWin)) && - (x < pWin->drawable.x + (int)pWin->drawable.width + - wBorderWidth (pWin)) && - (y >= pWin->drawable.y - wBorderWidth (pWin)) && - (y < pWin->drawable.y + (int)pWin->drawable.height + - wBorderWidth (pWin)) -#ifdef SHAPE - /* When a window is shaped, a further check - * is made to see if the point is inside - * borderSize - */ - && (!wBoundingShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - &pWin->borderSize, x, y, &box)) - - && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - wInputShape(pWin), - x - pWin->drawable.x, - y - pWin->drawable.y, &box)) -#endif - ) - { - rep.child = pWin->drawable.id; - pWin = (WindowPtr) NULL; - } - else - pWin = pWin->nextSib; - } - /* adjust to destination coordinates */ - rep.dstX = x - pDst->drawable.x; - rep.dstY = y - pDst->drawable.y; - } - WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); - return(client->noClientException); -} - -int -ProcOpenFont(register ClientPtr client) -{ - int err; - REQUEST(xOpenFontReq); - - REQUEST_FIXED_SIZE(xOpenFontReq, stuff->nbytes); - client->errorValue = stuff->fid; - LEGAL_NEW_RESOURCE(stuff->fid, client); - err = OpenFont(client, stuff->fid, (Mask) 0, - stuff->nbytes, (char *)&stuff[1]); - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcCloseFont(register ClientPtr client) -{ - FontPtr pFont; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityDestroyAccess); - if ( pFont != (FontPtr)NULL) /* id was valid */ - { - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadFont); - } -} - -int -ProcQueryFont(register ClientPtr client) -{ - xQueryFontReply *reply; - FontPtr pFont; - register GC *pGC; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - client->errorValue = stuff->id; /* EITHER font or gc */ - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - /* can't use VERIFY_GC because it might return BadGC */ - pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, - SecurityReadAccess); - if (!pGC) - { - client->errorValue = stuff->id; - return(BadFont); /* procotol spec says only error is BadFont */ - } - pFont = pGC->font; - } - - { - xCharInfo *pmax = FONTINKMAX(pFont); - xCharInfo *pmin = FONTINKMIN(pFont); - int nprotoxcistructs; - int rlength; - - nprotoxcistructs = ( - pmax->rightSideBearing == pmin->rightSideBearing && - pmax->leftSideBearing == pmin->leftSideBearing && - pmax->descent == pmin->descent && - pmax->ascent == pmin->ascent && - pmax->characterWidth == pmin->characterWidth) ? - 0 : N2dChars(pFont); - - rlength = sizeof(xQueryFontReply) + - FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) + - nprotoxcistructs * sizeof(xCharInfo); - reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength); - if(!reply) - { - return(BadAlloc); - } - - reply->type = X_Reply; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->sequenceNumber = client->sequence; - QueryFont( pFont, reply, nprotoxcistructs); - - WriteReplyToClient(client, rlength, reply); - DEALLOCATE_LOCAL(reply); - return(client->noClientException); - } -} - -int -ProcQueryTextExtents(register ClientPtr client) -{ - REQUEST(xQueryTextExtentsReq); - xQueryTextExtentsReply reply; - FontPtr pFont; - GC *pGC; - ExtentInfoRec info; - unsigned long length; - - REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); - - pFont = (FontPtr)SecurityLookupIDByType(client, stuff->fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - pGC = (GC *)SecurityLookupIDByType(client, stuff->fid, RT_GC, - SecurityReadAccess); - if (!pGC) - { - client->errorValue = stuff->fid; - return(BadFont); - } - pFont = pGC->font; - } - length = client->req_len - (sizeof(xQueryTextExtentsReq) >> 2); - length = length << 1; - if (stuff->oddLength) - { - if (length == 0) - return(BadLength); - length--; - } - if (!QueryTextExtents(pFont, length, (unsigned char *)&stuff[1], &info)) - return(BadAlloc); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.drawDirection = info.drawDirection; - reply.fontAscent = info.fontAscent; - reply.fontDescent = info.fontDescent; - reply.overallAscent = info.overallAscent; - reply.overallDescent = info.overallDescent; - reply.overallWidth = info.overallWidth; - reply.overallLeft = info.overallLeft; - reply.overallRight = info.overallRight; - WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply); - return(client->noClientException); -} - -int -ProcListFonts(register ClientPtr client) -{ - REQUEST(xListFontsReq); - - REQUEST_FIXED_SIZE(xListFontsReq, stuff->nbytes); - - return ListFonts(client, (unsigned char *) &stuff[1], stuff->nbytes, - stuff->maxNames); -} - -int -ProcListFontsWithInfo(register ClientPtr client) -{ - REQUEST(xListFontsWithInfoReq); - - REQUEST_FIXED_SIZE(xListFontsWithInfoReq, stuff->nbytes); - - return StartListFontsWithInfo(client, stuff->nbytes, - (unsigned char *) &stuff[1], stuff->maxNames); -} - -/** - * - * \param value must conform to DeleteType - */ -int -dixDestroyPixmap(pointer value, XID pid) -{ - PixmapPtr pPixmap = (PixmapPtr)value; - return (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap); -} - -int -ProcCreatePixmap(register ClientPtr client) -{ - PixmapPtr pMap; - register DrawablePtr pDraw; - REQUEST(xCreatePixmapReq); - DepthPtr pDepth; - register int i; - - REQUEST_SIZE_MATCH(xCreatePixmapReq); - client->errorValue = stuff->pid; - LEGAL_NEW_RESOURCE(stuff->pid, client); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - if (!stuff->width || !stuff->height) - { - client->errorValue = 0; - return BadValue; - } - if (stuff->width > 32767 || stuff->height > 32767) - { - /* It is allowed to try and allocate a pixmap which is larger than - * 32767 in either dimension. However, all of the framebuffer code - * is buggy and does not reliably draw to such big pixmaps, basically - * because the Region data structure operates with signed shorts - * for the rectangles in it. - * - * Furthermore, several places in the X server computes the - * size in bytes of the pixmap and tries to store it in an - * integer. This integer can overflow and cause the allocated size - * to be much smaller. - * - * So, such big pixmaps are rejected here with a BadAlloc - */ - return BadAlloc; - } - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } -CreatePmap: - pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap) - (pDraw->pScreen, stuff->width, - stuff->height, stuff->depth); - if (pMap) - { - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) - return(client->noClientException); - } - return (BadAlloc); -} - -int -ProcFreePixmap(register ClientPtr client) -{ - PixmapPtr pMap; - - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP, - SecurityDestroyAccess); - if (pMap) - { - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadPixmap); - } -} - -int -ProcCreateGC(register ClientPtr client) -{ - int error; - GC *pGC; - register DrawablePtr pDraw; - unsigned len; - REQUEST(xCreateGCReq); - - REQUEST_AT_LEAST_SIZE(xCreateGCReq); - client->errorValue = stuff->gc; - LEGAL_NEW_RESOURCE(stuff->gc, client); - SECURITY_VERIFY_DRAWABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - len = client->req_len - (sizeof(xCreateGCReq) >> 2); - if (len != Ones(stuff->mask)) - return BadLength; - pGC = (GC *)CreateGC(pDraw, stuff->mask, - (XID *) &stuff[1], &error); - if (error != Success) - return error; - if (!AddResource(stuff->gc, RT_GC, (pointer)pGC)) - return (BadAlloc); - return(client->noClientException); -} - -int -ProcChangeGC(register ClientPtr client) -{ - GC *pGC; - REQUEST(xChangeGCReq); - int result; - unsigned len; - - REQUEST_AT_LEAST_SIZE(xChangeGCReq); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); - len = client->req_len - (sizeof(xChangeGCReq) >> 2); - if (len != Ones(stuff->mask)) - return BadLength; - - result = dixChangeGC(client, pGC, stuff->mask, (CARD32 *) &stuff[1], 0); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcCopyGC(register ClientPtr client) -{ - register GC *dstGC; - register GC *pGC; - int result; - REQUEST(xCopyGCReq); - - REQUEST_SIZE_MATCH(xCopyGCReq); - SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, SecurityReadAccess); - SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, SecurityWriteAccess); - if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) - return (BadMatch); - result = CopyGC(pGC, dstGC, stuff->mask); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcSetDashes(register ClientPtr client) -{ - register GC *pGC; - int result; - REQUEST(xSetDashesReq); - - REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); - if (stuff->nDashes == 0) - { - client->errorValue = 0; - return BadValue; - } - - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); - - result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes, - (unsigned char *)&stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(result); - } -} - -int -ProcSetClipRectangles(register ClientPtr client) -{ - int nr; - int result; - register GC *pGC; - REQUEST(xSetClipRectanglesReq); - - REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); - if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) && - (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded)) - { - client->errorValue = stuff->ordering; - return BadValue; - } - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); - - nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); - if (nr & 4) - return(BadLength); - nr >>= 3; - result = SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin, - nr, (xRectangle *)&stuff[1], (int)stuff->ordering); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -int -ProcFreeGC(register ClientPtr client) -{ - register GC *pGC; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GC(pGC, stuff->id, client, SecurityDestroyAccess); - FreeResource(stuff->id, RT_NONE); - return(client->noClientException); -} - -int -ProcClearToBackground(register ClientPtr client) -{ - REQUEST(xClearAreaReq); - register WindowPtr pWin; - - REQUEST_SIZE_MATCH(xClearAreaReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (pWin->drawable.class == InputOnly) - { - client->errorValue = stuff->window; - return (BadMatch); - } - if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse)) - { - client->errorValue = stuff->exposures; - return(BadValue); - } - (*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y, - stuff->width, stuff->height, - (Bool)stuff->exposures); - return(client->noClientException); -} - -int -ProcCopyArea(register ClientPtr client) -{ - register DrawablePtr pDst; - register DrawablePtr pSrc; - register GC *pGC; - REQUEST(xCopyAreaReq); - RegionPtr pRgn; - - REQUEST_SIZE_MATCH(xCopyAreaReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client); - if (stuff->dstDrawable != stuff->srcDrawable) - { - SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, - SecurityReadAccess); - if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) - { - client->errorValue = stuff->dstDrawable; - return (BadMatch); - } - } - else - pSrc = pDst; - - SET_DBE_SRCBUF(pSrc, stuff->srcDrawable); - - pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, stuff->srcX, stuff->srcY, - stuff->width, stuff->height, - stuff->dstX, stuff->dstY); - if (pGC->graphicsExposures) - { - (*pDst->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyArea, 0); - if (pRgn) - REGION_DESTROY(pDst->pScreen, pRgn); - } - - return(client->noClientException); -} - -int -ProcCopyPlane(register ClientPtr client) -{ - register DrawablePtr psrcDraw, pdstDraw; - register GC *pGC; - REQUEST(xCopyPlaneReq); - RegionPtr pRgn; - - REQUEST_SIZE_MATCH(xCopyPlaneReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client); - if (stuff->dstDrawable != stuff->srcDrawable) - { - SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, - SecurityReadAccess); - if (pdstDraw->pScreen != psrcDraw->pScreen) - { - client->errorValue = stuff->dstDrawable; - return (BadMatch); - } - } - else - psrcDraw = pdstDraw; - - SET_DBE_SRCBUF(psrcDraw, stuff->srcDrawable); - - /* Check to see if stuff->bitPlane has exactly ONE good bit set */ - if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) || - (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) - { - client->errorValue = stuff->bitPlane; - return(BadValue); - } - - pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC, stuff->srcX, stuff->srcY, - stuff->width, stuff->height, - stuff->dstX, stuff->dstY, stuff->bitPlane); - if (pGC->graphicsExposures) - { - (*pdstDraw->pScreen->SendGraphicsExpose) - (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); - if (pRgn) - REGION_DESTROY(pdstDraw->pScreen, pRgn); - } - return(client->noClientException); -} - -int -ProcPolyPoint(register ClientPtr client) -{ - int npoint; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyPointReq); - - REQUEST_AT_LEAST_SIZE(xPolyPointReq); - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2; - if (npoint) - (*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint, - (xPoint *) &stuff[1]); - return (client->noClientException); -} - -int -ProcPolyLine(register ClientPtr client) -{ - int npoint; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyLineReq); - - REQUEST_AT_LEAST_SIZE(xPolyLineReq); - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2; - if (npoint > 1) - (*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint, - (DDXPointPtr) &stuff[1]); - return(client->noClientException); -} - -int -ProcPolySegment(register ClientPtr client) -{ - int nsegs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolySegmentReq); - - REQUEST_AT_LEAST_SIZE(xPolySegmentReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); - if (nsegs & 4) - return(BadLength); - nsegs >>= 3; - if (nsegs) - (*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]); - return (client->noClientException); -} - -int -ProcPolyRectangle (register ClientPtr client) -{ - int nrects; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyRectangleReq); - - REQUEST_AT_LEAST_SIZE(xPolyRectangleReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); - if (nrects & 4) - return(BadLength); - nrects >>= 3; - if (nrects) - (*pGC->ops->PolyRectangle)(pDraw, pGC, - nrects, (xRectangle *) &stuff[1]); - return(client->noClientException); -} - -int -ProcPolyArc(register ClientPtr client) -{ - int narcs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyArcReq); - - REQUEST_AT_LEAST_SIZE(xPolyArcReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - narcs = (client->req_len << 2) - sizeof(xPolyArcReq); - if (narcs % sizeof(xArc)) - return(BadLength); - narcs /= sizeof(xArc); - if (narcs) - (*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]); - return (client->noClientException); -} - -int -ProcFillPoly(register ClientPtr client) -{ - int things; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xFillPolyReq); - - REQUEST_AT_LEAST_SIZE(xFillPolyReq); - if ((stuff->shape != Complex) && (stuff->shape != Nonconvex) && - (stuff->shape != Convex)) - { - client->errorValue = stuff->shape; - return BadValue; - } - if ((stuff->coordMode != CoordModeOrigin) && - (stuff->coordMode != CoordModePrevious)) - { - client->errorValue = stuff->coordMode; - return BadValue; - } - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - things = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2; - if (things) - (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape, - stuff->coordMode, things, - (DDXPointPtr) &stuff[1]); - return(client->noClientException); -} - -int -ProcPolyFillRectangle(register ClientPtr client) -{ - int things; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyFillRectangleReq); - - REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); - if (things & 4) - return(BadLength); - things >>= 3; - - if (things) - (*pGC->ops->PolyFillRect) (pDraw, pGC, things, - (xRectangle *) &stuff[1]); - return (client->noClientException); -} - -int -ProcPolyFillArc(register ClientPtr client) -{ - int narcs; - register GC *pGC; - register DrawablePtr pDraw; - REQUEST(xPolyFillArcReq); - - REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); - if (narcs % sizeof(xArc)) - return(BadLength); - narcs /= sizeof(xArc); - if (narcs) - (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]); - return (client->noClientException); -} - -#ifdef MATCH_CLIENT_ENDIAN - -int -ServerOrder (void) -{ - int whichbyte = 1; - - if (*((char *) &whichbyte)) - return LSBFirst; - return MSBFirst; -} - -#define ClientOrder(client) ((client)->swapped ? !ServerOrder() : ServerOrder()) - -void -ReformatImage (char *base, int nbytes, int bpp, int order) -{ - switch (bpp) { - case 1: /* yuck */ - if (BITMAP_BIT_ORDER != order) - BitOrderInvert ((unsigned char *) base, nbytes); -#if IMAGE_BYTE_ORDER != BITMAP_BIT_ORDER && BITMAP_SCANLINE_UNIT != 8 - ReformatImage (base, nbytes, BITMAP_SCANLINE_UNIT, order); -#endif - break; - case 4: - break; /* yuck */ - case 8: - break; - case 16: - if (IMAGE_BYTE_ORDER != order) - TwoByteSwap ((unsigned char *) base, nbytes); - break; - case 32: - if (IMAGE_BYTE_ORDER != order) - FourByteSwap ((unsigned char *) base, nbytes); - break; - } -} -#else -#define ReformatImage(b,n,bpp,o) -#endif - -/* 64-bit server notes: the protocol restricts padding of images to - * 8-, 16-, or 32-bits. We would like to have 64-bits for the server - * to use internally. Removes need for internal alignment checking. - * All of the PutImage functions could be changed individually, but - * as currently written, they call other routines which require things - * to be 64-bit padded on scanlines, so we changed things here. - * If an image would be padded differently for 64- versus 32-, then - * copy each scanline to a 64-bit padded scanline. - * Also, we need to make sure that the image is aligned on a 64-bit - * boundary, even if the scanlines are padded to our satisfaction. - */ -int -ProcPutImage(register ClientPtr client) -{ - register GC *pGC; - register DrawablePtr pDraw; - long length; /* length of scanline server padded */ - long lengthProto; /* length of scanline protocol padded */ - char *tmpImage; - REQUEST(xPutImageReq); - - REQUEST_AT_LEAST_SIZE(xPutImageReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - if (stuff->format == XYBitmap) - { - if ((stuff->depth != 1) || - (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad)) - return BadMatch; - length = BitmapBytePad(stuff->width + stuff->leftPad); - } - else if (stuff->format == XYPixmap) - { - if ((pDraw->depth != stuff->depth) || - (stuff->leftPad >= (unsigned int)screenInfo.bitmapScanlinePad)) - return BadMatch; - length = BitmapBytePad(stuff->width + stuff->leftPad); - length *= stuff->depth; - } - else if (stuff->format == ZPixmap) - { - if ((pDraw->depth != stuff->depth) || (stuff->leftPad != 0)) - return BadMatch; - length = PixmapBytePad(stuff->width, stuff->depth); - } - else - { - client->errorValue = stuff->format; - return BadValue; - } - - tmpImage = (char *)&stuff[1]; - lengthProto = length; - - if (((((lengthProto * stuff->height) + (unsigned)3) >> 2) + - (sizeof(xPutImageReq) >> 2)) != client->req_len) - return BadLength; - - ReformatImage (tmpImage, lengthProto * stuff->height, - stuff->format == ZPixmap ? BitsPerPixel (stuff->depth) : 1, - ClientOrder(client)); - - (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, stuff->dstX, stuff->dstY, - stuff->width, stuff->height, - stuff->leftPad, stuff->format, tmpImage); - - return (client->noClientException); -} - - -int -DoGetImage(register ClientPtr client, int format, Drawable drawable, - int x, int y, int width, int height, - Mask planemask, xGetImageReply **im_return) -{ - register DrawablePtr pDraw; - int nlines, linesPerBuf; - register int linesDone; - long widthBytesLine, length; - Mask plane = 0; - char *pBuf; - xGetImageReply xgi; -#ifdef XCSECURITY - RegionPtr pVisibleRegion = NULL; -#endif - - if ((format != XYPixmap) && (format != ZPixmap)) - { - client->errorValue = format; - return(BadValue); - } - SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, SecurityReadAccess); - if(pDraw->type == DRAWABLE_WINDOW) - { - if( /* check for being viewable */ - !((WindowPtr) pDraw)->realized || - /* check for being on screen */ - pDraw->x + x < 0 || - pDraw->x + x + width > pDraw->pScreen->width || - pDraw->y + y < 0 || - pDraw->y + y + height > pDraw->pScreen->height || - /* check for being inside of border */ - x < - wBorderWidth((WindowPtr)pDraw) || - x + width > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - y < -wBorderWidth((WindowPtr)pDraw) || - y + height > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height - ) - return(BadMatch); - xgi.visual = wVisual (((WindowPtr) pDraw)); - } - else - { - if(x < 0 || - x+width > (int)pDraw->width || - y < 0 || - y+height > (int)pDraw->height - ) - return(BadMatch); - xgi.visual = None; - } - - SET_DBE_SRCBUF(pDraw, drawable); - - xgi.type = X_Reply; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - if(format == ZPixmap) - { - widthBytesLine = PixmapBytePad(width, pDraw->depth); - length = widthBytesLine * height; - - } - else - { - widthBytesLine = BitmapBytePad(width); - plane = ((Mask)1) << (pDraw->depth - 1); - /* only planes asked for */ - length = widthBytesLine * height * - Ones(planemask & (plane | (plane - 1))); - - } - - xgi.length = length; - - if (im_return) { - pBuf = (char *)xalloc(sz_xGetImageReply + length); - if (!pBuf) - return (BadAlloc); - if (widthBytesLine == 0) - linesPerBuf = 0; - else - linesPerBuf = height; - *im_return = (xGetImageReply *)pBuf; - *(xGetImageReply *)pBuf = xgi; - pBuf += sz_xGetImageReply; - } else { - xgi.length = (xgi.length + 3) >> 2; - if (widthBytesLine == 0 || height == 0) - linesPerBuf = 0; - else if (widthBytesLine >= IMAGE_BUFSIZE) - linesPerBuf = 1; - else - { - linesPerBuf = IMAGE_BUFSIZE / widthBytesLine; - if (linesPerBuf > height) - linesPerBuf = height; - } - length = linesPerBuf * widthBytesLine; - if (linesPerBuf < height) - { - /* we have to make sure intermediate buffers don't need padding */ - while ((linesPerBuf > 1) && - (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1))) - { - linesPerBuf--; - length -= widthBytesLine; - } - while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD)-1)) - { - linesPerBuf++; - length += widthBytesLine; - } - } - if(!(pBuf = (char *) ALLOCATE_LOCAL(length))) - return (BadAlloc); - WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); - } - -#ifdef XCSECURITY - if (client->trustLevel != XSecurityClientTrusted && - pDraw->type == DRAWABLE_WINDOW) - { - pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw); - if (pVisibleRegion) - { - REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, -pDraw->x, -pDraw->y); - } - } -#endif - - if (linesPerBuf == 0) - { - /* nothing to do */ - } - else if (format == ZPixmap) - { - linesDone = 0; - while (height - linesDone > 0) - { - nlines = min(linesPerBuf, height - linesDone); - (*pDraw->pScreen->GetImage) (pDraw, - x, - y + linesDone, - width, - nlines, - format, - planemask, - (pointer) pBuf); -#ifdef XCSECURITY - if (pVisibleRegion) - SecurityCensorImage(client, pVisibleRegion, widthBytesLine, - pDraw, x, y + linesDone, width, - nlines, format, pBuf); -#endif - - /* Note that this is NOT a call to WriteSwappedDataToClient, - as we do NOT byte swap */ - if (!im_return) - { - ReformatImage (pBuf, (int)(nlines * widthBytesLine), - BitsPerPixel (pDraw->depth), - ClientOrder(client)); - -/* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, - (int)(nlines * widthBytesLine), - pBuf); - } - linesDone += nlines; - } - } - else /* XYPixmap */ - { - for (; plane; plane >>= 1) - { - if (planemask & plane) - { - linesDone = 0; - while (height - linesDone > 0) - { - nlines = min(linesPerBuf, height - linesDone); - (*pDraw->pScreen->GetImage) (pDraw, - x, - y + linesDone, - width, - nlines, - format, - plane, - (pointer)pBuf); -#ifdef XCSECURITY - if (pVisibleRegion) - SecurityCensorImage(client, pVisibleRegion, - widthBytesLine, - pDraw, x, y + linesDone, width, - nlines, format, pBuf); -#endif - - /* Note: NOT a call to WriteSwappedDataToClient, - as we do NOT byte swap */ - if (im_return) { - pBuf += nlines * widthBytesLine; - } else { - ReformatImage (pBuf, - (int)(nlines * widthBytesLine), - 1, - ClientOrder (client)); - -/* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, - (int)(nlines * widthBytesLine), - pBuf); - } - linesDone += nlines; - } - } - } - } -#ifdef XCSECURITY - if (pVisibleRegion) - REGION_DESTROY(pDraw->pScreen, pVisibleRegion); -#endif - if (!im_return) - DEALLOCATE_LOCAL(pBuf); - return (client->noClientException); -} - -int -ProcGetImage(register ClientPtr client) -{ - REQUEST(xGetImageReq); - - REQUEST_SIZE_MATCH(xGetImageReq); - - return DoGetImage(client, stuff->format, stuff->drawable, - stuff->x, stuff->y, - (int)stuff->width, (int)stuff->height, - stuff->planeMask, (xGetImageReply **)NULL); -} - -int -ProcPolyText(register ClientPtr client) -{ - int err; - REQUEST(xPolyTextReq); - DrawablePtr pDraw; - GC *pGC; - - REQUEST_AT_LEAST_SIZE(xPolyTextReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = PolyText(client, - pDraw, - pGC, - (unsigned char *)&stuff[1], - ((unsigned char *) stuff) + (client->req_len << 2), - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcImageText8(register ClientPtr client) -{ - int err; - register DrawablePtr pDraw; - register GC *pGC; - - REQUEST(xImageTextReq); - - REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = ImageText(client, - pDraw, - pGC, - stuff->nChars, - (unsigned char *)&stuff[1], - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - -int -ProcImageText16(register ClientPtr client) -{ - int err; - register DrawablePtr pDraw; - register GC *pGC; - - REQUEST(xImageTextReq); - - REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - err = ImageText(client, - pDraw, - pGC, - stuff->nChars, - (unsigned char *)&stuff[1], - stuff->x, - stuff->y, - stuff->reqType, - stuff->drawable); - - if (err == Success) - { - return(client->noClientException); - } - else - return err; -} - - -int -ProcCreateColormap(register ClientPtr client) -{ - VisualPtr pVisual; - ColormapPtr pmap; - Colormap mid; - register WindowPtr pWin; - ScreenPtr pScreen; - REQUEST(xCreateColormapReq); - int i, result; - - REQUEST_SIZE_MATCH(xCreateColormapReq); - - if ((stuff->alloc != AllocNone) && (stuff->alloc != AllocAll)) - { - client->errorValue = stuff->alloc; - return(BadValue); - } - mid = stuff->mid; - LEGAL_NEW_RESOURCE(mid, client); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - pScreen = pWin->drawable.pScreen; - for (i = 0, pVisual = pScreen->visuals; - i < pScreen->numVisuals; - i++, pVisual++) - { - if (pVisual->vid != stuff->visual) - continue; - result = CreateColormap(mid, pScreen, pVisual, &pmap, - (int)stuff->alloc, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - client->errorValue = stuff->visual; - return(BadValue); -} - -int -ProcFreeColormap(register ClientPtr client) -{ - ColormapPtr pmap; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pmap = (ColormapPtr )SecurityLookupIDByType(client, stuff->id, RT_COLORMAP, - SecurityDestroyAccess); - if (pmap) - { - /* Freeing a default colormap is a no-op */ - if (!(pmap->flags & IsDefault)) - FreeResource(stuff->id, RT_NONE); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - - -int -ProcCopyColormapAndFree(register ClientPtr client) -{ - Colormap mid; - ColormapPtr pSrcMap; - REQUEST(xCopyColormapAndFreeReq); - int result; - - REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); - mid = stuff->mid; - LEGAL_NEW_RESOURCE(mid, client); - if( (pSrcMap = (ColormapPtr )SecurityLookupIDByType(client, stuff->srcCmap, - RT_COLORMAP, SecurityReadAccess|SecurityWriteAccess)) ) - { - result = CopyColormapAndFree(mid, pSrcMap, client->index); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); - } - else - { - client->errorValue = stuff->srcCmap; - return(BadColor); - } -} - -int -ProcInstallColormap(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - (*(pcmp->pScreen->InstallColormap)) (pcmp); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - -int -ProcUninstallColormap(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - if(pcmp->mid != pcmp->pScreen->defColormap) - (*(pcmp->pScreen->UninstallColormap)) (pcmp); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadColor); - } -} - -int -ProcListInstalledColormaps(register ClientPtr client) -{ - xListInstalledColormapsReply *preply; - int nummaps; - WindowPtr pWin; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - - if (!pWin) - return(BadWindow); - - preply = (xListInstalledColormapsReply *) - ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) + - pWin->drawable.pScreen->maxInstalledCmaps * - sizeof(Colormap)); - if(!preply) - return(BadAlloc); - - preply->type = X_Reply; - preply->sequenceNumber = client->sequence; - nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) - (pWin->drawable.pScreen, (Colormap *)&preply[1]); - preply->nColormaps = nummaps; - preply->length = nummaps; - WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); - DEALLOCATE_LOCAL(preply); - return(client->noClientException); -} - -int -ProcAllocColor (register ClientPtr client) -{ - ColormapPtr pmap; - int retval; - xAllocColorReply acr; - REQUEST(xAllocColorReq); - - REQUEST_SIZE_MATCH(xAllocColorReq); - pmap = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pmap) - { -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColor request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pmap, (xReq *) stuff)) - return Success; -#endif - acr.type = X_Reply; - acr.length = 0; - acr.sequenceNumber = client->sequence; - acr.red = stuff->red; - acr.green = stuff->green; - acr.blue = stuff->blue; - acr.pixel = 0; - if( (retval = AllocColor(pmap, &acr.red, &acr.green, &acr.blue, - &acr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return (retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pmap->pScreen->myNum) -#endif - WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); - return (client->noClientException); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocNamedColor (register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xAllocNamedColorReq); - - REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int retval; - - xAllocNamedColorReply ancr; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocNamedColor request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - ancr.type = X_Reply; - ancr.length = 0; - ancr.sequenceNumber = client->sequence; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes, - &ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) - { - ancr.screenRed = ancr.exactRed; - ancr.screenGreen = ancr.exactGreen; - ancr.screenBlue = ancr.exactBlue; - ancr.pixel = 0; - if( (retval = AllocColor(pcmp, - &ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue, - &ancr.pixel, client->index)) ) - { - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr); - return (client->noClientException); - } - else - return(BadName); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocColorCells (register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xAllocColorCellsReq); - - REQUEST_SIZE_MATCH(xAllocColorCellsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xAllocColorCellsReply accr; - int npixels, nmasks, retval; - long length; - Pixel *ppixels, *pmasks; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColorCells request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - npixels = stuff->colors; - if (!npixels) - { - client->errorValue = npixels; - return (BadValue); - } - if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) - { - client->errorValue = stuff->contiguous; - return (BadValue); - } - nmasks = stuff->planes; - length = ((long)npixels + (long)nmasks) * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); - if(!ppixels) - return(BadAlloc); - pmasks = ppixels + npixels; - - if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks, - (Bool)stuff->contiguous, ppixels, pmasks)) ) - { - DEALLOCATE_LOCAL(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - { - accr.type = X_Reply; - accr.length = length >> 2; - accr.sequenceNumber = client->sequence; - accr.nPixels = npixels; - accr.nMasks = nmasks; - WriteReplyToClient(client, sizeof (xAllocColorCellsReply), &accr); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, length, ppixels); - } - DEALLOCATE_LOCAL(ppixels); - return (client->noClientException); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcAllocColorPlanes(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xAllocColorPlanesReq); - - REQUEST_SIZE_MATCH(xAllocColorPlanesReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xAllocColorPlanesReply acpr; - int npixels, retval; - long length; - Pixel *ppixels; - -#ifdef LBX - /* - * If the colormap is grabbed by a proxy, the server will have - * to regain control over the colormap. This AllocColorPlanes request - * will be handled after the server gets back the colormap control. - */ - if (LbxCheckColorRequest (client, pcmp, (xReq *) stuff)) - return Success; -#endif - npixels = stuff->colors; - if (!npixels) - { - client->errorValue = npixels; - return (BadValue); - } - if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) - { - client->errorValue = stuff->contiguous; - return (BadValue); - } - acpr.type = X_Reply; - acpr.sequenceNumber = client->sequence; - acpr.nPixels = npixels; - length = (long)npixels * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); - if(!ppixels) - return(BadAlloc); - if( (retval = AllocColorPlanes(client->index, pcmp, npixels, - (int)stuff->red, (int)stuff->green, (int)stuff->blue, - (Bool)stuff->contiguous, ppixels, - &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) ) - { - DEALLOCATE_LOCAL(ppixels); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } - acpr.length = length >> 2; -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) -#endif - { - WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr); - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, length, ppixels); - } - DEALLOCATE_LOCAL(ppixels); - return (client->noClientException); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcFreeColors(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xFreeColorsReq); - - REQUEST_AT_LEAST_SIZE(xFreeColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int count; - int retval; - - if(pcmp->flags & AllAllocated) - return(BadAccess); - count = ((client->req_len << 2)- sizeof(xFreeColorsReq)) >> 2; - retval = FreeColors(pcmp, client->index, count, - (Pixel *)&stuff[1], (Pixel)stuff->planeMask); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(retval); - } - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcStoreColors (ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xStoreColorsReq); - - REQUEST_AT_LEAST_SIZE(xStoreColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - int count; - int retval; - - count = (client->req_len << 2) - sizeof(xStoreColorsReq); - if (count % sizeof(xColorItem)) - return(BadLength); - count /= sizeof(xColorItem); - retval = StoreColors(pcmp, count, (xColorItem *)&stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return(retval); - } - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcStoreNamedColor (register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xStoreNamedColorReq); - - REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); - if (pcmp) - { - xColorItem def; - int retval; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], - stuff->nbytes, &def.red, &def.green, &def.blue)) - { - def.flags = stuff->flags; - def.pixel = stuff->pixel; - retval = StoreColors(pcmp, 1, &def); - if (client->noClientException != Success) - return(client->noClientException); - else - return(retval); - } - return (BadName); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcQueryColors(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xQueryColorsReq); - - REQUEST_AT_LEAST_SIZE(xQueryColorsReq); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - int count, retval; - xrgb *prgbs; - xQueryColorsReply qcr; - - count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2; - prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb)); - if(!prgbs && count) - return(BadAlloc); - if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) ) - { - if (prgbs) DEALLOCATE_LOCAL(prgbs); - if (client->noClientException != Success) - return(client->noClientException); - else - { - client->errorValue = clientErrorValue; - return (retval); - } - } - qcr.type = X_Reply; - qcr.length = (count * sizeof(xrgb)) >> 2; - qcr.sequenceNumber = client->sequence; - qcr.nColors = count; - WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr); - if (count) - { - client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; - WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); - } - if (prgbs) DEALLOCATE_LOCAL(prgbs); - return(client->noClientException); - - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcLookupColor(register ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xLookupColorReq); - - REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); - pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); - if (pcmp) - { - xLookupColorReply lcr; - - if(OsLookupColor(pcmp->pScreen->myNum, (char *)&stuff[1], stuff->nbytes, - &lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue)) - { - lcr.type = X_Reply; - lcr.length = 0; - lcr.sequenceNumber = client->sequence; - lcr.screenRed = lcr.exactRed; - lcr.screenGreen = lcr.exactGreen; - lcr.screenBlue = lcr.exactBlue; - (*pcmp->pScreen->ResolveColor)(&lcr.screenRed, - &lcr.screenGreen, - &lcr.screenBlue, - pcmp->pVisual); - WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr); - return(client->noClientException); - } - return (BadName); - } - else - { - client->errorValue = stuff->cmap; - return (BadColor); - } -} - -int -ProcCreateCursor (register ClientPtr client) -{ - CursorPtr pCursor; - - register PixmapPtr src; - register PixmapPtr msk; - unsigned char * srcbits; - unsigned char * mskbits; - unsigned short width, height; - long n; - CursorMetricRec cm; - - - REQUEST(xCreateCursorReq); - - REQUEST_SIZE_MATCH(xCreateCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - src = (PixmapPtr)SecurityLookupIDByType(client, stuff->source, - RT_PIXMAP, SecurityReadAccess); - msk = (PixmapPtr)SecurityLookupIDByType(client, stuff->mask, - RT_PIXMAP, SecurityReadAccess); - if ( src == (PixmapPtr)NULL) - { - client->errorValue = stuff->source; - return (BadPixmap); - } - if ( msk == (PixmapPtr)NULL) - { - if (stuff->mask != None) - { - client->errorValue = stuff->mask; - return (BadPixmap); - } - } - else if ( src->drawable.width != msk->drawable.width - || src->drawable.height != msk->drawable.height - || src->drawable.depth != 1 - || msk->drawable.depth != 1) - return (BadMatch); - - width = src->drawable.width; - height = src->drawable.height; - - if ( stuff->x > width - || stuff->y > height ) - return (BadMatch); - - n = BitmapBytePad(width)*height; - srcbits = (unsigned char *)xalloc(n); - if (!srcbits) - return (BadAlloc); - mskbits = (unsigned char *)xalloc(n); - if (!mskbits) - { - xfree(srcbits); - return (BadAlloc); - } - - /* zeroing the (pad) bits helps some ddx cursor handling */ - bzero((char *)srcbits, n); - (* src->drawable.pScreen->GetImage)( (DrawablePtr)src, 0, 0, width, height, - XYPixmap, 1, (pointer)srcbits); - if ( msk == (PixmapPtr)NULL) - { - register unsigned char *bits = mskbits; - while (--n >= 0) - *bits++ = ~0; - } - else - { - /* zeroing the (pad) bits helps some ddx cursor handling */ - bzero((char *)mskbits, n); - (* msk->drawable.pScreen->GetImage)( (DrawablePtr)msk, 0, 0, width, - height, XYPixmap, 1, (pointer)mskbits); - } - cm.width = width; - cm.height = height; - cm.xhot = stuff->x; - cm.yhot = stuff->y; - pCursor = AllocCursor( srcbits, mskbits, &cm, - stuff->foreRed, stuff->foreGreen, stuff->foreBlue, - stuff->backRed, stuff->backGreen, stuff->backBlue); - - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return (client->noClientException); - return BadAlloc; -} - -int -ProcCreateGlyphCursor (register ClientPtr client) -{ - CursorPtr pCursor; - int res; - - REQUEST(xCreateGlyphCursorReq); - - REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - res = AllocGlyphCursor(stuff->source, stuff->sourceChar, - stuff->mask, stuff->maskChar, - stuff->foreRed, stuff->foreGreen, stuff->foreBlue, - stuff->backRed, stuff->backGreen, stuff->backBlue, - &pCursor, client); - if (res != Success) - return res; - if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; - return BadAlloc; -} - - -int -ProcFreeCursor (register ClientPtr client) -{ - CursorPtr pCursor; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->id, - RT_CURSOR, SecurityDestroyAccess); - if (pCursor) - { - FreeResource(stuff->id, RT_NONE); - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadCursor); - } -} - -int -ProcQueryBestSize (register ClientPtr client) -{ - xQueryBestSizeReply reply; - register DrawablePtr pDraw; - ScreenPtr pScreen; - REQUEST(xQueryBestSizeReq); - - REQUEST_SIZE_MATCH(xQueryBestSizeReq); - if ((stuff->class != CursorShape) && - (stuff->class != TileShape) && - (stuff->class != StippleShape)) - { - client->errorValue = stuff->class; - return(BadValue); - } - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); - if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW) - return (BadMatch); - pScreen = pDraw->pScreen; - (* pScreen->QueryBestSize)(stuff->class, &stuff->width, - &stuff->height, pScreen); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.width = stuff->width; - reply.height = stuff->height; - WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); - return (client->noClientException); -} - - -int -ProcSetScreenSaver (register ClientPtr client) -{ - int blankingOption, exposureOption; - REQUEST(xSetScreenSaverReq); - - REQUEST_SIZE_MATCH(xSetScreenSaverReq); - blankingOption = stuff->preferBlank; - if ((blankingOption != DontPreferBlanking) && - (blankingOption != PreferBlanking) && - (blankingOption != DefaultBlanking)) - { - client->errorValue = blankingOption; - return BadValue; - } - exposureOption = stuff->allowExpose; - if ((exposureOption != DontAllowExposures) && - (exposureOption != AllowExposures) && - (exposureOption != DefaultExposures)) - { - client->errorValue = exposureOption; - return BadValue; - } - if (stuff->timeout < -1) - { - client->errorValue = stuff->timeout; - return BadValue; - } - if (stuff->interval < -1) - { - client->errorValue = stuff->interval; - return BadValue; - } - - if (blankingOption == DefaultBlanking) - ScreenSaverBlanking = defaultScreenSaverBlanking; - else - ScreenSaverBlanking = blankingOption; - if (exposureOption == DefaultExposures) - ScreenSaverAllowExposures = defaultScreenSaverAllowExposures; - else - ScreenSaverAllowExposures = exposureOption; - - if (stuff->timeout >= 0) - ScreenSaverTime = stuff->timeout * MILLI_PER_SECOND; - else - ScreenSaverTime = defaultScreenSaverTime; - if (stuff->interval >= 0) - ScreenSaverInterval = stuff->interval * MILLI_PER_SECOND; - else - ScreenSaverInterval = defaultScreenSaverInterval; - - SetScreenSaverTimer(); - return (client->noClientException); -} - -int -ProcGetScreenSaver(register ClientPtr client) -{ - xGetScreenSaverReply rep; - - REQUEST_SIZE_MATCH(xReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.timeout = ScreenSaverTime / MILLI_PER_SECOND; - rep.interval = ScreenSaverInterval / MILLI_PER_SECOND; - rep.preferBlanking = ScreenSaverBlanking; - rep.allowExposures = ScreenSaverAllowExposures; - WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep); - return (client->noClientException); -} - -int -ProcChangeHosts(register ClientPtr client) -{ - REQUEST(xChangeHostsReq); - int result; - - REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength); - - if(stuff->mode == HostInsert) - result = AddHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); - else if (stuff->mode == HostDelete) - result = RemoveHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); - else - { - client->errorValue = stuff->mode; - return BadValue; - } - if (!result) - result = client->noClientException; - return (result); -} - -int -ProcListHosts(register ClientPtr client) -{ - xListHostsReply reply; - int len, nHosts, result; - pointer pdata; - /* REQUEST(xListHostsReq); */ - - REQUEST_SIZE_MATCH(xListHostsReq); -#ifdef XCSECURITY - /* untrusted clients can't list hosts */ - if (client->trustLevel != XSecurityClientTrusted) - { - SecurityAudit("client %d attempted to list hosts\n", client->index); - return BadAccess; - } -#endif - result = GetHosts(&pdata, &nHosts, &len, &reply.enabled); - if (result != Success) - return(result); - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.nHosts = nHosts; - reply.length = len >> 2; - WriteReplyToClient(client, sizeof(xListHostsReply), &reply); - if (nHosts) - { - client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend; - WriteSwappedDataToClient(client, len, pdata); - } - xfree(pdata); - return (client->noClientException); -} - -int -ProcChangeAccessControl(register ClientPtr client) -{ - int result; - REQUEST(xSetAccessControlReq); - - REQUEST_SIZE_MATCH(xSetAccessControlReq); - if ((stuff->mode != EnableAccess) && (stuff->mode != DisableAccess)) - { - client->errorValue = stuff->mode; - return BadValue; - } - result = ChangeAccessControl(client, stuff->mode == EnableAccess); - if (!result) - result = client->noClientException; - return (result); -} - -int -ProcKillClient(register ClientPtr client) -{ - REQUEST(xResourceReq); - ClientPtr killclient; - - REQUEST_SIZE_MATCH(xResourceReq); - if (stuff->id == AllTemporary) - { - CloseDownRetainedResources(); - return (client->noClientException); - } - - if ((killclient = LookupClient(stuff->id, client))) - { - CloseDownClient(killclient); - /* if an LBX proxy gets killed, isItTimeToYield will be set */ - if (isItTimeToYield || (client == killclient)) - { - /* force yield and return Success, so that Dispatch() - * doesn't try to touch client - */ - isItTimeToYield = TRUE; - return (Success); - } - return (client->noClientException); - } - else - { - client->errorValue = stuff->id; - return (BadValue); - } -} - -int -ProcSetFontPath(register ClientPtr client) -{ - unsigned char *ptr; - unsigned long nbytes, total; - long nfonts; - int n, result; - int error; - REQUEST(xSetFontPathReq); - - REQUEST_AT_LEAST_SIZE(xSetFontPathReq); - - nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq); - total = nbytes; - ptr = (unsigned char *)&stuff[1]; - nfonts = stuff->nFonts; - while (--nfonts >= 0) - { - if ((total == 0) || (total < (n = (*ptr + 1)))) - return(BadLength); - total -= n; - ptr += n; - } - if (total >= 4) - return(BadLength); - result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1], - &error); - if (!result) - { - result = client->noClientException; - client->errorValue = error; - } - return (result); -} - -int -ProcGetFontPath(register ClientPtr client) -{ - xGetFontPathReply reply; - int stringLens, numpaths; - unsigned char *bufferStart; - /* REQUEST (xReq); */ - - REQUEST_SIZE_MATCH(xReq); - bufferStart = GetFontPath(&numpaths, &stringLens); - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = (stringLens + numpaths + 3) >> 2; - reply.nPaths = numpaths; - - WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); - if (stringLens || numpaths) - (void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart); - return(client->noClientException); -} - -int -ProcChangeCloseDownMode(register ClientPtr client) -{ - REQUEST(xSetCloseDownModeReq); - - REQUEST_SIZE_MATCH(xSetCloseDownModeReq); - if ((stuff->mode == AllTemporary) || - (stuff->mode == RetainPermanent) || - (stuff->mode == RetainTemporary)) - { - client->closeDownMode = stuff->mode; - return (client->noClientException); - } - else - { - client->errorValue = stuff->mode; - return (BadValue); - } -} - -int ProcForceScreenSaver(register ClientPtr client) -{ - REQUEST(xForceScreenSaverReq); - - REQUEST_SIZE_MATCH(xForceScreenSaverReq); - - if ((stuff->mode != ScreenSaverReset) && - (stuff->mode != ScreenSaverActive)) - { - client->errorValue = stuff->mode; - return BadValue; - } - SaveScreens(SCREEN_SAVER_FORCER, (int)stuff->mode); - return client->noClientException; -} - -int ProcNoOperation(register ClientPtr client) -{ - REQUEST_AT_LEAST_SIZE(xReq); - - /* noop -- don't do anything */ - return(client->noClientException); -} - -void -InitProcVectors(void) -{ - int i; - for (i = 0; i<256; i++) - { - if(!ProcVector[i]) - { - ProcVector[i] = SwappedProcVector[i] = ProcBadRequest; - ReplySwapVector[i] = ReplyNotSwappd; - } -#ifdef K5AUTH - if (!k5_Vector[i]) - { - k5_Vector[i] = k5_bad; - } -#endif - } - for(i = LASTEvent; i < 128; i++) - { - EventSwapVector[i] = NotImplemented; - } - -} - -/********************** - * CloseDownClient - * - * Client can either mark his resources destroy or retain. If retained and - * then killed again, the client is really destroyed. - *********************/ - -char dispatchExceptionAtReset = DE_RESET; - -void -CloseDownClient(register ClientPtr client) -{ - Bool really_close_down = client->clientGone || - client->closeDownMode == DestroyAll; - - if (!client->clientGone) - { - /* ungrab server if grabbing client dies */ - if (grabState != GrabNone && grabClient == client) - { - UngrabServer(client); - } - BITCLEAR(grabWaiters, client->index); - DeleteClientFromAnySelections(client); - ReleaseActiveGrabs(client); - DeleteClientFontStuff(client); - if (!really_close_down) - { - /* This frees resources that should never be retained - * no matter what the close down mode is. Actually we - * could do this unconditionally, but it's probably - * better not to traverse all the client's resources - * twice (once here, once a few lines down in - * FreeClientResources) in the common case of - * really_close_down == TRUE. - */ - FreeClientNeverRetainResources(client); - client->clientState = ClientStateRetained; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - } - client->clientGone = TRUE; /* so events aren't sent to client */ - if (ClientIsAsleep(client)) - ClientSignal (client); - ProcessWorkQueueZombies(); -#ifdef LBX - ProcessQTagZombies(); -#endif - CloseDownConnection(client); - - /* If the client made it to the Running stage, nClients has - * been incremented on its behalf, so we need to decrement it - * now. If it hasn't gotten to Running, nClients has *not* - * been incremented, so *don't* decrement it. - */ - if (client->clientState != ClientStateInitial && - client->clientState != ClientStateAuthenticating ) - { - --nClients; - } - } - - if (really_close_down) - { - if (client->clientState == ClientStateRunning && nClients == 0) - dispatchException |= dispatchExceptionAtReset; - - client->clientState = ClientStateGone; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - FreeClientResources(client); - if (client->index < nextFreeClientID) - nextFreeClientID = client->index; - clients[client->index] = NullClient; -#ifdef SMART_SCHEDULE - SmartLastClient = NullClient; -#endif - xfree(client); - - while (!clients[currentMaxClients-1]) - currentMaxClients--; - } -} - -static void -KillAllClients() -{ - int i; - for (i=1; icloseDownMode = DestroyAll; - CloseDownClient(clients[i]); - } -} - -/********************* - * CloseDownRetainedResources - * - * Find all clients that are gone and have terminated in RetainTemporary - * and destroy their resources. - *********************/ - -void -CloseDownRetainedResources() -{ - register int i; - register ClientPtr client; - - for (i=1; icloseDownMode == RetainTemporary) - && (client->clientGone)) - CloseDownClient(client); - } -} - -void InitClient(ClientPtr client, int i, pointer ospriv) -{ - client->index = i; - client->sequence = 0; - client->clientAsMask = ((Mask)i) << CLIENTOFFSET; - client->clientGone = FALSE; - if (i) - { - client->closeDownMode = DestroyAll; - client->lastDrawable = (DrawablePtr)WindowTable[0]; - client->lastDrawableID = WindowTable[0]->drawable.id; - } - else - { - client->closeDownMode = RetainPermanent; - client->lastDrawable = (DrawablePtr)NULL; - client->lastDrawableID = INVALID; - } - client->lastGC = (GCPtr) NULL; - client->lastGCID = INVALID; - client->numSaved = 0; - client->saveSet = (SaveSetElt *)NULL; - client->noClientException = Success; -#ifdef DEBUG - client->requestLogIndex = 0; -#endif - client->requestVector = InitialVector; - client->osPrivate = ospriv; - client->swapped = FALSE; - client->big_requests = FALSE; - client->priority = 0; - client->clientState = ClientStateInitial; -#ifdef XKB - if (!noXkbExtension) { - client->xkbClientFlags = 0; - client->mapNotifyMask = 0; - QueryMinMaxKeyCodes(&client->minKC,&client->maxKC); - } -#endif - client->replyBytesRemaining = 0; -#ifdef LBX - client->readRequest = StandardReadRequestFromClient; -#endif -#ifdef XCSECURITY - client->trustLevel = XSecurityClientTrusted; - client->CheckAccess = NULL; - client->authId = 0; -#endif -#ifdef XAPPGROUP - client->appgroup = NULL; -#endif - client->fontResFunc = NULL; -#ifdef SMART_SCHEDULE - client->smart_priority = 0; - client->smart_start_tick = SmartScheduleTime; - client->smart_stop_tick = SmartScheduleTime; - client->smart_check_tick = SmartScheduleTime; -#endif -} - -extern int clientPrivateLen; -extern unsigned *clientPrivateSizes; -extern unsigned totalClientSize; - -int -InitClientPrivates(ClientPtr client) -{ - register char *ptr; - DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; - - if (totalClientSize == sizeof(ClientRec)) - ppriv = (DevUnion *)NULL; - else if (client->index) - ppriv = (DevUnion *)(client + 1); - else - { - ppriv = (DevUnion *)xalloc(totalClientSize - sizeof(ClientRec)); - if (!ppriv) - return 0; - } - client->devPrivates = ppriv; - sizes = clientPrivateSizes; - ptr = (char *)(ppriv + clientPrivateLen); - for (i = clientPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - return 1; -} - -/************************ - * int NextAvailableClient(ospriv) - * - * OS dependent portion can't assign client id's because of CloseDownModes. - * Returns NULL if there are no free clients. - *************************/ - -ClientPtr NextAvailableClient(pointer ospriv) -{ - register int i; - register ClientPtr client; - xReq data; - - i = nextFreeClientID; - if (i == MAXCLIENTS) - return (ClientPtr)NULL; - clients[i] = client = (ClientPtr)xalloc(totalClientSize); - if (!client) - return (ClientPtr)NULL; - InitClient(client, i, ospriv); - InitClientPrivates(client); - if (!InitClientResources(client)) - { - xfree(client); - return (ClientPtr)NULL; - } - data.reqType = 1; - data.length = (sz_xReq + sz_xConnClientPrefix) >> 2; - if (!InsertFakeRequest(client, (char *)&data, sz_xReq)) - { - FreeClientResources(client); - xfree(client); - return (ClientPtr)NULL; - } - if (i == currentMaxClients) - currentMaxClients++; - while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID]) - nextFreeClientID++; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = (xConnSetupPrefix *)NULL; - clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - return(client); -} - -int -ProcInitialConnection(register ClientPtr client) -{ - REQUEST(xReq); - register xConnClientPrefix *prefix; - int whichbyte = 1; - - prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); - if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B')) - return (client->noClientException = -1); - if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) || - (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) - { - client->swapped = TRUE; - SwapConnClientPrefix(prefix); - } - stuff->reqType = 2; - stuff->length += ((prefix->nbytesAuthProto + (unsigned)3) >> 2) + - ((prefix->nbytesAuthString + (unsigned)3) >> 2); - if (client->swapped) - { - swaps(&stuff->length, whichbyte); - } - ResetCurrentRequest(client); - return (client->noClientException); -} - -#ifdef LBX -void -IncrementClientCount() -{ - nClients++; -} -#endif - -int -SendConnSetup(register ClientPtr client, char *reason) -{ - register xWindowRoot *root; - register int i; - int numScreens; - char* lConnectionInfo; - xConnSetupPrefix* lconnSetupPrefix; - - if (reason) - { - xConnSetupPrefix csp; - - csp.success = xFalse; - csp.lengthReason = strlen(reason); - csp.length = (csp.lengthReason + (unsigned)3) >> 2; - csp.majorVersion = X_PROTOCOL; - csp.minorVersion = X_PROTOCOL_REVISION; - if (client->swapped) - WriteSConnSetupPrefix(client, &csp); - else - (void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp); - (void)WriteToClient(client, (int)csp.lengthReason, reason); - return (client->noClientException = -1); - } - - numScreens = screenInfo.numScreens; - lConnectionInfo = ConnectionInfo; - lconnSetupPrefix = &connSetupPrefix; - - /* We're about to start speaking X protocol back to the client by - * sending the connection setup info. This means the authorization - * step is complete, and we can count the client as an - * authorized one. - */ - nClients++; - - client->requestVector = client->swapped ? SwappedProcVector : ProcVector; - client->sequence = 0; -#ifdef XAPPGROUP - XagConnectionInfo (client, &lconnSetupPrefix, &lConnectionInfo, &numScreens); -#endif - ((xConnSetup *)lConnectionInfo)->ridBase = client->clientAsMask; - ((xConnSetup *)lConnectionInfo)->ridMask = RESOURCE_ID_MASK; -#ifdef MATCH_CLIENT_ENDIAN - ((xConnSetup *)lConnectionInfo)->imageByteOrder = ClientOrder (client); - ((xConnSetup *)lConnectionInfo)->bitmapBitOrder = ClientOrder (client); -#endif - /* fill in the "currentInputMask" */ - root = (xWindowRoot *)(lConnectionInfo + connBlockScreenStart); -#ifdef PANORAMIX - if (noPanoramiXExtension) - numScreens = screenInfo.numScreens; - else - numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; -#endif - - for (i=0; icurrentInputMask = WindowTable[i]->eventMask | - wOtherEventMasks (WindowTable[i]); - pDepth = (xDepth *)(root + 1); - for (j = 0; j < root->nDepths; j++) - { - pDepth = (xDepth *)(((char *)(pDepth + 1)) + - pDepth->nVisuals * sizeof(xVisualType)); - } - root = (xWindowRoot *)pDepth; - } - - if (client->swapped) - { - WriteSConnSetupPrefix(client, lconnSetupPrefix); - WriteSConnectionInfo(client, - (unsigned long)(lconnSetupPrefix->length << 2), - lConnectionInfo); - } - else - { - (void)WriteToClient(client, sizeof(xConnSetupPrefix), - (char *) lconnSetupPrefix); - (void)WriteToClient(client, (int)(lconnSetupPrefix->length << 2), - lConnectionInfo); - } - client->clientState = ClientStateRunning; - if (ClientStateCallback) - { - NewClientInfoRec clientinfo; - - clientinfo.client = client; - clientinfo.prefix = lconnSetupPrefix; - clientinfo.setup = (xConnSetup *)lConnectionInfo; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); - } - return (client->noClientException); -} - -int -ProcEstablishConnection(register ClientPtr client) -{ - char *reason, *auth_proto, *auth_string; - register xConnClientPrefix *prefix; - REQUEST(xReq); - - prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); - auth_proto = (char *)prefix + sz_xConnClientPrefix; - auth_string = auth_proto + ((prefix->nbytesAuthProto + 3) & ~3); - if ((prefix->majorVersion != X_PROTOCOL) || - (prefix->minorVersion != X_PROTOCOL_REVISION)) - reason = "Protocol version mismatch"; - else - reason = ClientAuthorized(client, - (unsigned short)prefix->nbytesAuthProto, - auth_proto, - (unsigned short)prefix->nbytesAuthString, - auth_string); - /* - * If Kerberos is being used for this client, the clientState - * will be set to ClientStateAuthenticating at this point. - * More messages need to be exchanged among the X server, Kerberos - * server, and client to figure out if everyone is authorized. - * So we don't want to send the connection setup info yet, since - * the auth step isn't really done. - */ - if (client->clientState == ClientStateCheckingSecurity) - client->clientState = ClientStateCheckedSecurity; - else if (client->clientState != ClientStateAuthenticating) - return(SendConnSetup(client, reason)); - return(client->noClientException); -} - -void -SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, - XID resId, int errorCode) -{ - xError rep; - - rep.type = X_Error; - rep.sequenceNumber = client->sequence; - rep.errorCode = errorCode; - rep.majorCode = majorCode; - rep.minorCode = minorCode; - rep.resourceID = resId; - - WriteEventsToClient (client, 1, (xEvent *)&rep); -} - -void -DeleteWindowFromAnySelections(WindowPtr pWin) -{ - register int i; - - for (i = 0; i< NumCurrentSelections; i++) - if (CurrentSelections[i].pWin == pWin) - { - if (SelectionCallback) - { - SelectionInfoRec info; - - info.selection = &CurrentSelections[i]; - info.kind = SelectionWindowDestroy; - CallCallbacks(&SelectionCallback, &info); - } - CurrentSelections[i].pWin = (WindowPtr)NULL; - CurrentSelections[i].window = None; - CurrentSelections[i].client = NullClient; - } -} - -static void -DeleteClientFromAnySelections(ClientPtr client) -{ - register int i; - - for (i = 0; i< NumCurrentSelections; i++) - if (CurrentSelections[i].client == client) - { - if (SelectionCallback) - { - SelectionInfoRec info; - - info.selection = &CurrentSelections[i]; - info.kind = SelectionWindowDestroy; - CallCallbacks(&SelectionCallback, &info); - } - CurrentSelections[i].pWin = (WindowPtr)NULL; - CurrentSelections[i].window = None; - CurrentSelections[i].client = NullClient; - } -} - -void -MarkClientException(ClientPtr client) -{ - client->noClientException = -1; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original deleted file mode 100644 index 04fc047fc..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original +++ /dev/null @@ -1,2804 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XdotOrg: xc/programs/Xserver/dix/dixfonts.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.28 2003/11/08 02:02:03 dawes 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. - -************************************************************************/ -/* The panoramix components contained the following notice */ -/* -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ -/* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ - -#define NEED_REPLIES -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "scrnintstr.h" -#include "resource.h" -#include "dixstruct.h" -#include "cursorstr.h" -#include "misc.h" -#include "opaque.h" -#include "dixfontstr.h" -#include "closestr.h" - -/* -#define NXAGENT_DEBUG -*/ - -#ifdef DEBUG -#include -#endif - -#include "Agent.h" -#include "Font.h" - -#ifndef NX_TRANS_SOCKET - -#define NX_TRANS_SOCKET - -#endif - -#ifdef NX_TRANS_SOCKET - -char _NXFontPath[1024]; - -/* - * Override the default font path and make - * it configurable at run time, based on - * the NX_FONT environment. - */ - -static const char *_NXGetFontPath(const char *path) -{ - const char *fontEnv; - - /* - * Check the environment only once. - */ - - if (*_NXFontPath != '\0') - { - return _NXFontPath; - } - - fontEnv = getenv("NX_FONT"); - - if (fontEnv != NULL && *fontEnv != '\0') - { - if (strlen(fontEnv) + 1 > 1024) - { -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetFontPath: WARNING! Maximum length of font path exceeded.\n"); -#endif - goto _NXGetFontPathError; - } - - strcpy(_NXFontPath, fontEnv); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetFontPath: Using NX font path [%s].\n", _NXFontPath); -#endif - - return _NXFontPath; - } - -_NXGetFontPathError: - - strcpy(_NXFontPath, path); - -#ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetFontPath: Using default font path [%s].\n", _NXFontPath); -#endif - - return _NXFontPath; -} - -#endif - -#ifdef PANORAMIX -#include "../../Xext/panoramiX.h" -#include "../../Xext/panoramiXsrv.h" -#endif - -#ifdef LBX -#include "lbxserve.h" -#endif - -#ifdef XF86BIGFONT -#define _XF86BIGFONT_SERVER_ -#include -#endif - -#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics - -extern pointer fosNaturalParams; -extern FontPtr defaultFont; - -static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; -static int num_fpes = 0; -FPEFunctions *fpe_functions = (FPEFunctions *) 0; -static int num_fpe_types = 0; - -static unsigned char *font_path_string; - -static int num_slept_fpes = 0; -static int size_slept_fpes = 0; -static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; -static FontPatternCachePtr patternCache; - -int -FontToXError(err) - int err; -{ - switch (err) { - case Successful: - return Success; - case AllocError: - return BadAlloc; - case BadFontName: - return BadName; - case BadFontPath: - case BadFontFormat: /* is there something better? */ - case BadCharRange: - return BadValue; - default: - return err; - } -} - - -/* - * adding RT_FONT prevents conflict with default cursor font - */ -Bool -SetDefaultFont(char *defaultfontname) -{ - int err; - FontPtr pf; - XID fid; - - fid = FakeClientID(0); - err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync, - (unsigned) strlen(defaultfontname), defaultfontname); - if (err != Success) - return FALSE; - pf = (FontPtr) LookupIDByType(fid, RT_FONT); - if (pf == (FontPtr) NULL) - return FALSE; - defaultFont = pf; - return TRUE; -} - -/* - * note that the font wakeup queue is not refcounted. this is because - * an fpe needs to be added when it's inited, and removed when it's finally - * freed, in order to handle any data that isn't requested, like FS events. - * - * since the only thing that should call these routines is the renderer's - * init_fpe() and free_fpe(), there shouldn't be any problem in using - * freed data. - */ -void -QueueFontWakeup(FontPathElementPtr fpe) -{ - int i; - FontPathElementPtr *new; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - -#ifdef DEBUG - fprintf(stderr, "re-queueing fpe wakeup\n"); -#endif - - return; - } - } - if (num_slept_fpes == size_slept_fpes) { - new = (FontPathElementPtr *) - xrealloc(slept_fpes, - sizeof(FontPathElementPtr) * (size_slept_fpes + 4)); - if (!new) - return; - slept_fpes = new; - size_slept_fpes += 4; - } - slept_fpes[num_slept_fpes] = fpe; - num_slept_fpes++; -} - -void -RemoveFontWakeup(FontPathElementPtr fpe) -{ - int i, - j; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - for (j = i; j < num_slept_fpes; j++) { - slept_fpes[j] = slept_fpes[j + 1]; - } - num_slept_fpes--; - return; - } - } -} - -void -FontWakeup(pointer data, int count, pointer LastSelectMask) -{ - int i; - FontPathElementPtr fpe; - - if (count < 0) - return; - /* wake up any fpe's that may be waiting for information */ - for (i = 0; i < num_slept_fpes; i++) { - fpe = slept_fpes[i]; - (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); - } -} - -/* XXX -- these two funcs may want to be broken into macros */ -static void -UseFPE(FontPathElementPtr fpe) -{ - fpe->refcount++; -} - -static void -FreeFPE (FontPathElementPtr fpe) -{ - fpe->refcount--; - if (fpe->refcount == 0) { - (*fpe_functions[fpe->type].free_fpe) (fpe); - xfree(fpe->name); - xfree(fpe); - } -} - -static Bool -doOpenFont(ClientPtr client, OFclosurePtr c) -{ - FontPtr pfont = NullFont; - FontPathElementPtr fpe = NULL; - ScreenPtr pScr; - int err = Successful; - int i; - char *alias, - *newname; - int newlen; - int aliascount = 20; - char nxagentOrigFontName[256]; - int nxagentOrigFontNameLen; - - /* - * Decide at runtime what FontFormat to use. - */ - Mask FontFormat = - - ((screenInfo.imageByteOrder == LSBFirst) ? - BitmapFormatByteOrderLSB : BitmapFormatByteOrderMSB) | - - ((screenInfo.bitmapBitOrder == LSBFirst) ? - BitmapFormatBitOrderLSB : BitmapFormatBitOrderMSB) | - - BitmapFormatImageRectMin | - -#if GLYPHPADBYTES == 1 - BitmapFormatScanlinePad8 | -#endif - -#if GLYPHPADBYTES == 2 - BitmapFormatScanlinePad16 | -#endif - -#if GLYPHPADBYTES == 4 - BitmapFormatScanlinePad32 | -#endif - -#if GLYPHPADBYTES == 8 - BitmapFormatScanlinePad64 | -#endif - - BitmapFormatScanlineUnit8; - - - nxagentOrigFontNameLen = (c -> origFontNameLen < 256) ? c -> origFontNameLen : 255; - - memcpy(nxagentOrigFontName, c -> origFontName, nxagentOrigFontNameLen); - - nxagentOrigFontName[nxagentOrigFontNameLen] = 0; - - if (client->clientGone) - { - if (c->current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - while (c->current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current_fpe]; - err = (*fpe_functions[fpe->type].open_font) - ((pointer) client, fpe, c->flags, - c->fontname, c->fnamelen, FontFormat, - BitmapFormatMaskByte | - BitmapFormatMaskBit | - BitmapFormatMaskImageRectangle | - BitmapFormatMaskScanLinePad | - BitmapFormatMaskScanLineUnit, - c->fontid, &pfont, &alias, - c->non_cachable_font && c->non_cachable_font->fpe == fpe ? - c->non_cachable_font : - (FontPtr)0); - - if (err == FontNameAlias && alias) { - newlen = strlen(alias); - newname = (char *) xrealloc(c->fontname, newlen); - if (!newname) { - err = AllocError; - break; - } - memmove(newname, alias, newlen); - c->fontname = newname; - c->fnamelen = newlen; - c->current_fpe = 0; - if (--aliascount <= 0) - break; - continue; - } - if (err == BadFontName) { - c->current_fpe++; - continue; - } - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (pointer) c); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doOpenFont: client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - break; - } - - if (err != Successful) - goto bail; - if (!pfont) { - err = BadFontName; - goto bail; - } - /* check values for firstCol, lastCol, firstRow, and lastRow */ - if (pfont->info.firstCol > pfont->info.lastCol || - pfont->info.firstRow > pfont->info.lastRow || - pfont->info.lastCol - pfont->info.firstCol > 255) { - err = AllocError; - goto bail; - } - if (!pfont->fpe) - pfont->fpe = fpe; - pfont->refcnt++; - if (pfont->refcnt == 1) { - UseFPE(pfont->fpe); - for (i = 0; i < screenInfo.numScreens; i++) { - pScr = screenInfo.screens[i]; - if (pScr->RealizeFont) - { - - /* NXAGENT uses useless screen pointer to pass the original font name - * to realizeFont, could be a source of problems in the future. - */ - - if (!(*pScr->RealizeFont) ((ScreenPtr)nxagentOrigFontName, pfont)) - { - CloseFont (pfont, (Font) 0); - err=BadFontName; - goto bail; - } - } - } - } - if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) { - err = AllocError; - goto bail; - } - if( nxagentFontPriv(pfont) -> mirrorID == 0 ) - { - extern RESTYPE RT_NX_FONT; - - nxagentFontPriv(pfont) -> mirrorID = FakeClientID(0); - if (!AddResource(nxagentFontPriv(pfont) -> mirrorID, RT_NX_FONT, (pointer) pfont)) { - FreeResource(c->fontid, RT_NONE); - err = AllocError; - goto bail; - } - } - if (patternCache && pfont != c->non_cachable_font) - CacheFontPattern(patternCache, nxagentOrigFontName, nxagentOrigFontNameLen, - pfont); -bail: - if (err != Successful && c->client != serverClient) { - SendErrorToClient(c->client, X_OpenFont, 0, - c->fontid, FontToXError(err)); - } - if (c->slept) - { - ClientWakeup(c->client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doOpenFont: client [%lx] wakeup.\n", client); -#endif - } - for (i = 0; i < c->num_fpes; i++) { - FreeFPE(c->fpe_list[i]); - } - xfree(c->fpe_list); - xfree(c->fontname); - xfree(c); - return TRUE; -} - -int -OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontname) -{ - OFclosurePtr c; - int i; - FontPtr cached = (FontPtr)0; - -#ifdef FONTDEBUG - char *f; - f = (char *)xalloc(lenfname + 1); - memmove(f, pfontname, lenfname); - f[lenfname] = '\0'; - ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); -#endif - if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) - return BadName; - if (patternCache) - { - - /* - ** Check name cache. If we find a cached version of this font that - ** is cachable, immediately satisfy the request with it. If we find - ** a cached version of this font that is non-cachable, we do not - ** satisfy the request with it. Instead, we pass the FontPtr to the - ** FPE's open_font code (the fontfile FPE in turn passes the - ** information to the rasterizer; the fserve FPE ignores it). - ** - ** Presumably, the font is marked non-cachable because the FPE has - ** put some licensing restrictions on it. If the FPE, using - ** whatever logic it relies on, determines that it is willing to - ** share this existing font with the client, then it has the option - ** to return the FontPtr we passed it as the newly-opened font. - ** This allows the FPE to exercise its licensing logic without - ** having to create another instance of a font that already exists. - */ - - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); - if (cached && cached->info.cachable) - { - if (!AddResource(fid, RT_FONT, (pointer) cached)) - return BadAlloc; - cached->refcnt++; - return Success; - } - } - c = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); - if (!c) - return BadAlloc; - c->fontname = (char *) xalloc(lenfname); - c->origFontName = pfontname; - c->origFontNameLen = lenfname; - if (!c->fontname) { - xfree(c); - return BadAlloc; - } - /* - * copy the current FPE list, so that if it gets changed by another client - * while we're blocking, the request still appears atomic - */ - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c->fontname); - xfree(c); - return BadAlloc; - } - memmove(c->fontname, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->fontid = fid; - c->current_fpe = 0; - c->num_fpes = num_fpes; - c->fnamelen = lenfname; - c->slept = FALSE; - c->flags = flags; - c->non_cachable_font = cached; - - (void) doOpenFont(client, c); - return Success; -} - -/** - * Decrement font's ref count, and free storage if ref count equals zero - * - * \param value must conform to DeleteType - */ -int -CloseFont(pointer value, XID fid) -{ - int nscr; - ScreenPtr pscr; - FontPathElementPtr fpe; - FontPtr pfont = (FontPtr)value; - - if (pfont == NullFont) - return (Success); - if (--pfont->refcnt == 0) { - if (patternCache) - RemoveCachedFontPattern (patternCache, pfont); - /* - * since the last reference is gone, ask each screen to free any - * storage it may have allocated locally for it. - */ - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { - pscr = screenInfo.screens[nscr]; - if (pscr->UnrealizeFont) - (*pscr->UnrealizeFont) (pscr, pfont); - } - if (pfont == defaultFont) - defaultFont = NULL; -#ifdef LBX - LbxFreeFontTag(pfont); -#endif -#ifdef XF86BIGFONT - { - extern void XF86BigfontFreeFontShm(FontPtr); - XF86BigfontFreeFontShm(pfont); - } -#endif - fpe = pfont->fpe; - (*fpe_functions[fpe->type].close_font) (fpe, pfont); - FreeFPE(fpe); - } - return (Success); -} - - -/***====================================================================***/ - -/** - * Sets up pReply as the correct QueryFontReply for pFont with the first - * nProtoCCIStructs char infos. - * - * \param pReply caller must allocate this storage - */ -void -QueryFont(FontPtr pFont, xQueryFontReply *pReply, int nProtoCCIStructs) -{ - FontPropPtr pFP; - int r, - c, - i; - xFontProp *prFP; - xCharInfo *prCI; - xCharInfo *charInfos[256]; - unsigned char chars[512]; - int ninfos; - unsigned long ncols; - unsigned long count; - - /* pr->length set in dispatch */ - pReply->minCharOrByte2 = pFont->info.firstCol; - pReply->defaultChar = pFont->info.defaultCh; - pReply->maxCharOrByte2 = pFont->info.lastCol; - pReply->drawDirection = pFont->info.drawDirection; - pReply->allCharsExist = pFont->info.allExist; - pReply->minByte1 = pFont->info.firstRow; - pReply->maxByte1 = pFont->info.lastRow; - pReply->fontAscent = pFont->info.fontAscent; - pReply->fontDescent = pFont->info.fontDescent; - - pReply->minBounds = pFont->info.ink_minbounds; - pReply->maxBounds = pFont->info.ink_maxbounds; - - pReply->nFontProps = pFont->info.nprops; - pReply->nCharInfos = nProtoCCIStructs; - - for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) (&pReply[1]); - i < pFont->info.nprops; - i++, pFP++, prFP++) { - prFP->name = pFP->name; - prFP->value = pFP->value; - } - - ninfos = 0; - ncols = (unsigned long) (pFont->info.lastCol - pFont->info.firstCol + 1); - prCI = (xCharInfo *) (prFP); - for (r = pFont->info.firstRow; - ninfos < nProtoCCIStructs && r <= (int)pFont->info.lastRow; - r++) { - i = 0; - for (c = pFont->info.firstCol; c <= (int)pFont->info.lastCol; c++) { - chars[i++] = r; - chars[i++] = c; - } - (*pFont->get_metrics) (pFont, ncols, chars, - TwoD16Bit, &count, charInfos); - i = 0; - for (i = 0; i < (int) count && ninfos < nProtoCCIStructs; i++) { - *prCI = *charInfos[i]; - prCI++; - ninfos++; - } - } - return; -} - -static Bool -doListFontsAndAliases(ClientPtr client, LFclosurePtr c) -{ - FontPathElementPtr fpe; - int err = Successful; - FontNamesPtr names = NULL; - char *name, *resolved=NULL; - int namelen, resolvedlen; - int nnames; - int stringLens; - int i; - xListFontsReply reply; - char *bufptr; - char *bufferStart; - int aliascount = 0; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - - if (!c->current.patlen) - goto finish; - - while (c->current.current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) - { - /* This FPE doesn't support/require list_fonts_and_aliases */ - - err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - c->names); - - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFont (1): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - - err = BadFontName; - } - else - { - /* Start of list_fonts_and_aliases functionality. Modeled - after list_fonts_with_info in that it resolves aliases, - except that the information collected from FPEs is just - names, not font info. Each list_next_font_or_alias() - returns either a name into name/namelen or an alias into - name/namelen and its target name into resolved/resolvedlen. - The code at this level then resolves the alias by polling - the FPEs. */ - - if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - &c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) { - char *tmpname; - name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, - &resolvedlen, c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFont (2): client [%lx] sleeping.\n", client); -#endif -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFont (3): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - if (err == FontNameAlias) { - if (resolved) xfree(resolved); - resolved = (char *) xalloc(resolvedlen + 1); - if (resolved) - memmove(resolved, tmpname, resolvedlen + 1); - } - } - - if (err == Successful) - { - if (c->haveSaved) - { - if (c->savedName) - (void)AddFontNamesName(c->names, c->savedName, - c->savedNameLen); - } - else - (void)AddFontNamesName(c->names, name, namelen); - } - - /* - * When we get an alias back, save our state and reset back to - * the start of the FPE looking for the specified name. As - * soon as a real font is found for the alias, pop back to the - * old state - */ - else if (err == FontNameAlias) { - char tmp_pattern[XLFDMAXFONTNAMELEN]; - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - memmove(tmp_pattern, resolved, resolvedlen); - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - - tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, - &tmpname, &tmpnamelen, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - c->savedNameLen = namelen; - aliascount = 20; - } - memmove(c->current.pattern, tmp_pattern, resolvedlen); - c->current.patlen = resolvedlen; - c->current.max_names = c->names->nnames + 1; - c->current.current_fpe = -1; - c->current.private = 0; - err = BadFontName; - } - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've collected enough - * font names, quit. - */ - if (err == BadFontName) { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->names->nnames == c->current.max_names || - c->current.current_fpe == c->num_fpes) { - c->haveSaved = FALSE; - c->current = c->saved; - /* Give the saved namelist a chance to clean itself up */ - continue; - } - } - if (c->names->nnames == c->current.max_names) - break; - } - } - - /* - * send the reply - */ - if (err != Successful) { - SendErrorToClient(client, X_ListFonts, 0, 0, FontToXError(err)); - goto bail; - } - -finish: - - names = c->names; - nnames = names->nnames; - client = c->client; - stringLens = 0; - for (i = 0; i < nnames; i++) - stringLens += (names->length[i] <= 255) ? names->length[i] : 0; - - reply.type = X_Reply; - reply.length = (stringLens + nnames + 3) >> 2; - reply.nFonts = nnames; - reply.sequenceNumber = client->sequence; - - bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2); - - if (!bufptr && reply.length) { - SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); - goto bail; - } - /* - * since WriteToClient long word aligns things, copy to temp buffer and - * write all at once - */ - for (i = 0; i < nnames; i++) { - if (names->length[i] > 255) - reply.nFonts--; - else - { - { - /* dirty hack: don't list to client fonts not existing on the remote side */ - char tmp[256]; - - memcpy(tmp, names->names[i], names->length[i]); - tmp[ names->length[i] ] = 0; - - if (nxagentFontLookUp(tmp) == 0) - { -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "doListFontsAndAliases:\n"); - fprintf(stderr, " removing font: %s \n", tmp); -#endif - reply.nFonts--; - stringLens -= names->length[i]; - continue; - } - } - *bufptr++ = names->length[i]; - memmove( bufptr, names->names[i], names->length[i]); - bufptr += names->length[i]; - } - } - nnames = reply.nFonts; - reply.length = (stringLens + nnames + 3) >> 2; - client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; - WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); - (void) WriteToClient(client, stringLens + nnames, bufferStart); - DEALLOCATE_LOCAL(bufferStart); - -bail: - if (c->slept) - { - ClientWakeup(client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFont: client [%lx] wakeup.\n", client); -#endif - } - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - FreeFontNames(names); - xfree(c); - if (resolved) xfree(resolved); - return TRUE; -} - -int -ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, - unsigned max_names) -{ - int i; - LFclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) - return BadAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c); - return BadAlloc; - } - c->names = MakeFontNamesRecord(max_names < nxagentMaxFontNames ? max_names : nxagentMaxFontNames); - if (!c->names) - { - xfree(c->fpe_list); - xfree(c); - return BadAlloc; - } - memmove( c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsAndAliases(client, c); - return Success; -} - -int -doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) -{ - FontPathElementPtr fpe; - int err = Successful; - char *name; - int namelen; - int numFonts; - FontInfoRec fontInfo, - *pFontInfo; - xListFontsWithInfoReply *reply; - int length; - xFontProp *pFP; - int i; - int aliascount = 0; - xListFontsWithInfoReply finalReply; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo]; - if (!c->current.patlen) - goto finish; - while (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - if (!c->current.list_started) - { - err = (*fpe_functions[fpe->type].start_list_fonts_with_info) - (client, fpe, c->current.pattern, c->current.patlen, - c->current.max_names, &c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, (ClientSleepProcPtr)doListFontsWithInfo, c); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFontWinfo (1): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) - { - name = 0; - pFontInfo = &fontInfo; - err = (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &name, &namelen, &pFontInfo, - &numFonts, c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsWithInfo, - c); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFontWinfo (2): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - } - /* - * When we get an alias back, save our state and reset back to the - * start of the FPE looking for the specified name. As soon as a real - * font is found for the alias, pop back to the old state - */ - if (err == FontNameAlias) - { - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - FontInfoPtr tmpFontInfo; - - tmpname = 0; - tmpFontInfo = &fontInfo; - (void) (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, - &numFonts, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - c->savedNumFonts = numFonts; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - aliascount = 20; - } - memmove(c->current.pattern, name, namelen); - c->current.patlen = namelen; - c->current.max_names = 1; - c->current.current_fpe = 0; - c->current.private = 0; - c->current.list_started = FALSE; - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've sent enough font - * names, quit. Always wait for BadFontName to let the FPE - * have a chance to clean up. - */ - else if (err == BadFontName) - { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->current.max_names == 0 || - c->current.current_fpe == c->num_fpes) - { - c->haveSaved = FALSE; - c->saved.max_names -= (1 - c->current.max_names); - c->current = c->saved; - } - } - else if (c->current.max_names == 0) - break; - } - else if (err == Successful) - { - - if (c->haveSaved) - { - numFonts = c->savedNumFonts; - name = c->savedName; - namelen = strlen(name); - } - - if (nxagentFontLookUp(name) == 0) - { -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "doListFontsAndAliases (with info):\n"); - fprintf(stderr, " removing font: %s \n", name); -#endif - continue; - } - - length = sizeof(*reply) + pFontInfo->nprops * sizeof(xFontProp); - reply = c->reply; - if (c->length < length) - { - reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length); - if (!reply) - { - err = AllocError; - break; - } - c->reply = reply; - c->length = length; - } - reply->type = X_Reply; - reply->length = (sizeof *reply - sizeof(xGenericReply) + - pFontInfo->nprops * sizeof(xFontProp) + - namelen + 3) >> 2; - reply->sequenceNumber = client->sequence; - reply->nameLength = namelen; - reply->minBounds = pFontInfo->ink_minbounds; - reply->maxBounds = pFontInfo->ink_maxbounds; - reply->minCharOrByte2 = pFontInfo->firstCol; - reply->maxCharOrByte2 = pFontInfo->lastCol; - reply->defaultChar = pFontInfo->defaultCh; - reply->nFontProps = pFontInfo->nprops; - reply->drawDirection = pFontInfo->drawDirection; - reply->minByte1 = pFontInfo->firstRow; - reply->maxByte1 = pFontInfo->lastRow; - reply->allCharsExist = pFontInfo->allExist; - reply->fontAscent = pFontInfo->fontAscent; - reply->fontDescent = pFontInfo->fontDescent; - reply->nReplies = numFonts; - pFP = (xFontProp *) (reply + 1); - for (i = 0; i < pFontInfo->nprops; i++) - { - pFP->name = pFontInfo->props[i].name; - pFP->value = pFontInfo->props[i].value; - pFP++; - } - WriteSwappedDataToClient(client, length, reply); - (void) WriteToClient(client, namelen, name); - if (pFontInfo == &fontInfo) - { - xfree(fontInfo.props); - xfree(fontInfo.isStringProp); - } - --c->current.max_names; - } - } -finish: - length = sizeof(xListFontsWithInfoReply); - bzero((char *) &finalReply, sizeof(xListFontsWithInfoReply)); - finalReply.type = X_Reply; - finalReply.sequenceNumber = client->sequence; - finalReply.length = (sizeof(xListFontsWithInfoReply) - - sizeof(xGenericReply)) >> 2; - WriteSwappedDataToClient(client, length, &finalReply); -bail: - if (c->slept) - { - ClientWakeup(client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doListFontWinfo: client [%lx] wakeup.\n", client); -#endif - } - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->reply); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - xfree(c); - return TRUE; -} - -int -StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, - int max_names) -{ - int i; - LFWIclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFWIclosurePtr) xalloc(sizeof *c))) - goto badAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) - { - xfree(c); - goto badAlloc; - } - memmove(c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) - { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->reply = 0; - c->length = 0; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->savedNumFonts = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsWithInfo(client, c); - return Success; -badAlloc: - return BadAlloc; -} - -#define TextEltHeader 2 -#define FontShiftSize 5 -static XID clearGC[] = { CT_NONE }; -#define clearGCmask (GCClipMask) - -int -doPolyText(ClientPtr client, register PTclosurePtr c) -{ - register FontPtr pFont = c->pGC->font, oldpFont; - Font fid, oldfid; - int err = Success, lgerr; /* err is in X error, not font error, space */ - enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; - FontPathElementPtr fpe; - GC *origGC = NULL; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - - if (c->slept) - { - /* Client has died, but we cannot bail out right now. We - need to clean up after the work we did when going to - sleep. Setting the drawable pointer to 0 makes this - happen without any attempts to render or perform other - unnecessary activities. */ - c->pDraw = (DrawablePtr)0; - } - else - { - err = Success; - goto bail; - } - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client and avoid further - rendering while we clean up after ourself. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - c->pDraw = (DrawablePtr)0; - } - - client_state = c->slept ? SLEEPING : NEVER_SLEPT; - - while (c->endReq - c->pElt > TextEltHeader) - { - if (*c->pElt == FontChange) - { - if (c->endReq - c->pElt < FontShiftSize) - { - err = BadLength; - goto bail; - } - - oldpFont = pFont; - oldfid = fid; - - fid = ((Font)*(c->pElt+4)) /* big-endian */ - | ((Font)*(c->pElt+3)) << 8 - | ((Font)*(c->pElt+2)) << 16 - | ((Font)*(c->pElt+1)) << 24; - pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - client->errorValue = fid; - err = BadFont; - /* restore pFont and fid for step 4 (described below) */ - pFont = oldpFont; - fid = oldfid; - - /* If we're in START_SLEEP mode, the following step - shortens the request... in the unlikely event that - the fid somehow becomes valid before we come through - again to actually execute the polytext, which would - then mess up our refcounting scheme badly. */ - c->err = err; - c->endReq = c->pElt; - - goto bail; - } - - /* Step 3 (described below) on our new font */ - if (client_state == START_SLEEP) - pFont->refcnt++; - else - { - if (pFont != c->pGC->font && c->pDraw) - { - ChangeGC( c->pGC, GCFont, &fid); - ValidateGC(c->pDraw, c->pGC); - if (c->reqType == X_PolyText8) - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8; - else - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText16; - } - - /* Undo the refcnt++ we performed when going to sleep */ - if (client_state == SLEEPING) - (void)CloseFont(c->pGC->font, (Font)0); - } - c->pElt += FontShiftSize; - } - else /* print a string */ - { - unsigned char *pNextElt; - pNextElt = c->pElt + TextEltHeader + (*c->pElt)*c->itemSize; - if ( pNextElt > c->endReq) - { - err = BadLength; - goto bail; - } - if (client_state == START_SLEEP) - { - c->pElt = pNextElt; - continue; - } - if (c->pDraw) - { - lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, c->itemSize, - c->pElt + TextEltHeader); - } - else lgerr = Successful; - - if (lgerr == Suspended) - { - if (!c->slept) { - int len; - GC *pGC; - PTclosurePtr new_closure; - - /* We're putting the client to sleep. We need to do a few things - to ensure successful and atomic-appearing execution of the - remainder of the request. First, copy the remainder of the - request into a safe malloc'd area. Second, create a scratch GC - to use for the remainder of the request. Third, mark all fonts - referenced in the remainder of the request to prevent their - deallocation. Fourth, make the original GC look like the - request has completed... set its font to the final font value - from this request. These GC manipulations are for the unlikely - (but possible) event that some other client is using the GC. - Steps 3 and 4 are performed by running this procedure through - the remainder of the request in a special no-render mode - indicated by client_state = START_SLEEP. */ - - /* Step 1 */ - /* Allocate a malloc'd closure structure to replace - the local one we were passed */ - new_closure = (PTclosurePtr) xalloc(sizeof(PTclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - len = c->endReq - c->pElt; - c->data = (unsigned char *)xalloc(len); - if (!c->data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(c->data, c->pElt, len); - c->pElt = c->data; - c->endReq = c->pElt + len; - - /* Step 2 */ - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - - pGC->tileIsPixel = TRUE; - pGC->tile.pixel = 0; - pGC->stipple = NullPixmap; - - if ((err = CopyGC(c->pGC, pGC, GCFunction | - GCPlaneMask | GCForeground | - GCBackground | GCFillStyle | - GCTile | GCStipple | - GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != - Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - origGC = c->pGC; - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doPolyText, - (pointer) c); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doPolyText (1): client [%lx] sleeping.\n", client); -#endif - - /* Set up to perform steps 3 and 4 */ - client_state = START_SLEEP; - continue; /* on to steps 3 and 4 */ - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */ - c->xorg = (* c->polyText)(c->pDraw, c->pGC, c->xorg, c->yorg, - *c->pElt, c->pElt + TextEltHeader); - } - c->pElt = pNextElt; - } - } - -bail: - - if (client_state == START_SLEEP) - { - /* Step 4 */ - if (pFont != origGC->font) - { - ChangeGC(origGC, GCFont, &fid); - ValidateGC(c->pDraw, origGC); - } - - /* restore pElt pointer for execution of remainder of the request */ - c->pElt = c->data; - return TRUE; - } - - if (c->err != Success) err = c->err; - if (err != Success && c->client != serverClient) { -#ifdef PANORAMIX - if (noPanoramiXExtension || !c->pGC->pScreen->myNum) -#endif - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doPolytext: client [%lx] wakeup.\n", client); -#endif - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -PolyText(ClientPtr client, DrawablePtr pDraw, GC *pGC, unsigned char *pElt, - unsigned char *endReq, int xorg, int yorg, int reqType, XID did) -{ - PTclosureRec local_closure; - - local_closure.pElt = pElt; - local_closure.endReq = endReq; - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_PolyText8) - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText8; - local_closure.itemSize = 1; - } - else - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText16; - local_closure.itemSize = 2; - } - local_closure.pGC = pGC; - local_closure.did = did; - local_closure.err = Success; - local_closure.slept = FALSE; - - (void) doPolyText(client, &local_closure); - return Success; -} - - -#undef TextEltHeader -#undef FontShiftSize - -int -doImageText(ClientPtr client, register ITclosurePtr c) -{ - int err = Success, lgerr; /* err is in X error, not font error, space */ - FontPathElementPtr fpe; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, c->itemSize, c->data); - if (lgerr == Suspended) - { - if (!c->slept) { - GC *pGC; - unsigned char *data; - ITclosurePtr new_closure; - - /* We're putting the client to sleep. We need to - save some state. Similar problem to that handled - in doPolyText, but much simpler because the - request structure is much simpler. */ - - new_closure = (ITclosurePtr) xalloc(sizeof(ITclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - data = (unsigned char *)xalloc(c->nChars * c->itemSize); - if (!data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(data, c->data, c->nChars * c->itemSize); - c->data = data; - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - - pGC->tileIsPixel = TRUE; - pGC->tile.pixel = 0; - pGC->stipple = NullPixmap; - - if ((err = CopyGC(c->pGC, pGC, GCFunction | GCPlaneMask | - GCForeground | GCBackground | GCFillStyle | - GCTile | GCStipple | GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doImageText, (pointer) c); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doImageText (1): client [%lx] sleeping.\n", client); -#endif - - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - (* c->imageText)(c->pDraw, c->pGC, c->xorg, c->yorg, - c->nChars, c->data); - } - -bail: - - if (err != Success && c->client != serverClient) { - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: doImageText: client [%lx] wakeup.\n", client); -#endif - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -ImageText(ClientPtr client, DrawablePtr pDraw, GC *pGC, int nChars, - unsigned char *data, int xorg, int yorg, int reqType, XID did) -{ - ITclosureRec local_closure; - - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.pGC = pGC; - local_closure.nChars = nChars; - local_closure.data = data; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_ImageText8) - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText8; - local_closure.itemSize = 1; - } - else - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText16; - local_closure.itemSize = 2; - } - local_closure.did = did; - local_closure.slept = FALSE; - - (void) doImageText(client, &local_closure); - return Success; -} - - -/* does the necessary magic to figure out the fpe type */ -static int -DetermineFPEType(char *pathname) -{ - int i; - - for (i = 0; i < num_fpe_types; i++) { - if ((*fpe_functions[i].name_check) (pathname)) - return i; - } - return -1; -} - - -static void -FreeFontPath(FontPathElementPtr *list, int n, Bool force) -{ - int i; - - for (i = 0; i < n; i++) { - if (force) { - /* Sanity check that all refcounts will be 0 by the time - we get to the end of the list. */ - int found = 1; /* the first reference is us */ - int j; - for (j = i+1; j < n; j++) { - if (list[j] == list[i]) - found++; - } - if (list[i]->refcount != found) { - ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n", - list[i]->name_length, list[i]->name, - list[i]->refcount, found); - list[i]->refcount = found; /* ensure it will get freed */ - } - } - FreeFPE(list[i]); - } - xfree((char *) list); -} - -static FontPathElementPtr -find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len) -{ - FontPathElementPtr fpe; - int i; - - for (i = 0; i < num; i++) { - fpe = list[i]; - if (fpe->name_length == len && memcmp(name, fpe->name, len) == 0) - return fpe; - } - return (FontPathElementPtr) 0; -} - - -static int -SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) -{ - int i, err = 0; - int valid_paths = 0; - unsigned int len; - unsigned char *cp = paths; - FontPathElementPtr fpe = NULL, *fplist; - - fplist = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * npaths); - if (!fplist) { - *bad = 0; - return BadAlloc; - } - for (i = 0; i < num_fpe_types; i++) { - if (fpe_functions[i].set_path_hook) - (*fpe_functions[i].set_path_hook) (); - } - for (i = 0; i < npaths; i++) - { - len = (unsigned int) (*cp++); - - if (len == 0) - { - if (persist) - ErrorF ("Removing empty element from the valid list of fontpaths\n"); - err = BadValue; - } - else - { - /* if it's already in our active list, just reset it */ - /* - * note that this can miss FPE's in limbo -- may be worth catching - * them, though it'd muck up refcounting - */ - fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); - if (fpe) - { - err = (*fpe_functions[fpe->type].reset_fpe) (fpe); - if (err == Successful) - { - UseFPE(fpe);/* since it'll be decref'd later when freed - * from the old list */ - } - else - fpe = 0; - } - /* if error or can't do it, act like it's a new one */ - if (!fpe) - { - fpe = (FontPathElementPtr) xalloc(sizeof(FontPathElementRec)); - if (!fpe) - { - err = BadAlloc; - goto bail; - } - fpe->name = (char *) xalloc(len + 1); - if (!fpe->name) - { - xfree(fpe); - err = BadAlloc; - goto bail; - } - fpe->refcount = 1; - - strncpy(fpe->name, (char *) cp, (int) len); - fpe->name[len] = '\0'; - fpe->name_length = len; - fpe->type = DetermineFPEType(fpe->name); - if (fpe->type == -1) - err = BadValue; - else - err = (*fpe_functions[fpe->type].init_fpe) (fpe); - if (err != Successful) - { - #ifndef NXAGENT_SERVER - if (persist) - { - ErrorF("Could not init font path element %s, removing from list!\n", - fpe->name); - } - #endif - xfree (fpe->name); - xfree (fpe); - } - } - } - if (err != Successful) - { - if (!persist) - goto bail; - } - else - { - fplist[valid_paths++] = fpe; - } - cp += len; - } - - FreeFontPath(font_path_elements, num_fpes, FALSE); - font_path_elements = fplist; - if (patternCache) - EmptyFontPatternCache(patternCache); - num_fpes = valid_paths; - - return Success; -bail: - *bad = i; - while (--valid_paths >= 0) - FreeFPE(fplist[valid_paths]); - xfree(fplist); - return FontToXError(err); -} - -/* XXX -- do we need to pass error down to each renderer? */ -int -SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) -{ - int err = Success; - - if (npaths == 0) { - if (SetDefaultFontPath(defaultFontPath) != Success) - return BadValue; - } else { - err = SetFontPathElements(npaths, paths, error, FALSE); - } - return err; -} - -int -SetDefaultFontPath(char *path) -{ - unsigned char *cp, - *pp, - *nump, - *newpath; - int num = 1, - len, - err, - size = 0, - bad; - - /* get enough for string, plus values -- use up commas */ -#ifdef NX_TRANS_SOCKET - len = strlen(_NXGetFontPath(path)) + 1; -#else - len = strlen(path) + 1; -#endif - nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); - if (!newpath) - return BadAlloc; -#ifdef NX_TRANS_SOCKET - pp = (unsigned char *) _NXGetFontPath(path); -#else - pp = (unsigned char *) path; -#endif - cp++; - while (*pp) { - if (*pp == ',') { - *nump = (unsigned char) size; - nump = cp++; - pp++; - num++; - size = 0; - } else { - *cp++ = *pp++; - size++; - } - } - *nump = (unsigned char) size; - - err = SetFontPathElements(num, newpath, &bad, TRUE); - - DEALLOCATE_LOCAL(newpath); - - return err; -} - -unsigned char * -GetFontPath(int *count, int *length) -{ - int i; - unsigned char *c; - int len; - FontPathElementPtr fpe; - - len = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - len += fpe->name_length + 1; - } - font_path_string = (unsigned char *) xrealloc(font_path_string, len); - if (!font_path_string) - return NULL; - - c = font_path_string; - *length = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - *c = fpe->name_length; - *length += *c++; - memmove(c, fpe->name, fpe->name_length); - c += fpe->name_length; - } - *count = num_fpes; - return font_path_string; -} - -int -LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, unsigned char *data) -{ - if (fpe_functions[pfont->fpe->type].load_glyphs) - return (*fpe_functions[pfont->fpe->type].load_glyphs) - (client, pfont, 0, nchars, item_size, data); - else - return Successful; -} - -void -DeleteClientFontStuff(ClientPtr client) -{ - int i; - FontPathElementPtr fpe; - - for (i = 0; i < num_fpes; i++) - { - fpe = font_path_elements[i]; - if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } -} - -void -InitFonts () -{ - patternCache = MakeFontPatternCache(); - -#ifndef KDRIVESERVER - if (screenInfo.numScreens > screenInfo.numVideoScreens) { - PrinterFontRegisterFpeFunctions(); - FontFileCheckRegisterFpeFunctions(); - check_fs_register_fpe_functions(); - } else -#endif - { -#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); -#endif - FontFileRegisterFpeFunctions(); -#ifndef NOFONTSERVERACCESS - fs_register_fpe_functions(); -#endif - } -} - -int -GetDefaultPointSize () -{ - return 120; -} - - -FontResolutionPtr -GetClientResolutions (int *num) -{ - if (requestingClient && requestingClient->fontResFunc != NULL && - !requestingClient->clientGone) - { - return (*requestingClient->fontResFunc)(requestingClient, num); - } - else { - static struct _FontResolution res; - ScreenPtr pScreen; - - pScreen = screenInfo.screens[0]; - res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; - /* - * XXX - we'll want this as long as bitmap instances are prevalent - so that we can match them from scalable fonts - */ - if (res.x_resolution < 88) - res.x_resolution = 75; - else - res.x_resolution = 100; - res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight; - if (res.y_resolution < 88) - res.y_resolution = 75; - else - res.y_resolution = 100; - res.point_size = 120; - *num = 1; - return &res; - } -} - -/* - * returns the type index of the new fpe - * - * should be called (only once!) by each type of fpe when initialized - */ - -int -RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func) -{ - FPEFunctions *new; - - /* grow the list */ - new = (FPEFunctions *) xrealloc(fpe_functions, - (num_fpe_types + 1) * sizeof(FPEFunctions)); - if (!new) - return -1; - fpe_functions = new; - - fpe_functions[num_fpe_types].name_check = name_func; - fpe_functions[num_fpe_types].open_font = open_func; - fpe_functions[num_fpe_types].close_font = close_func; - fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func; - fpe_functions[num_fpe_types].list_fonts = list_func; - fpe_functions[num_fpe_types].start_list_fonts_with_info = - start_lfwi_func; - fpe_functions[num_fpe_types].list_next_font_with_info = - next_lfwi_func; - fpe_functions[num_fpe_types].init_fpe = init_func; - fpe_functions[num_fpe_types].free_fpe = free_func; - fpe_functions[num_fpe_types].reset_fpe = reset_func; - fpe_functions[num_fpe_types].client_died = client_died; - fpe_functions[num_fpe_types].load_glyphs = load_glyphs; - fpe_functions[num_fpe_types].start_list_fonts_and_aliases = - start_list_alias_func; - fpe_functions[num_fpe_types].list_next_font_or_alias = - next_list_alias_func; - fpe_functions[num_fpe_types].set_path_hook = set_path_func; - - return num_fpe_types++; -} - -void -FreeFonts() -{ - if (patternCache) { - FreeFontPatternCache(patternCache); - patternCache = 0; - } - FreeFontPath(font_path_elements, num_fpes, TRUE); - font_path_elements = 0; - num_fpes = 0; - xfree(fpe_functions); - num_fpe_types = 0; - fpe_functions = (FPEFunctions *) 0; -} - -/* convenience functions for FS interface */ - -FontPtr -find_old_font(XID id) -{ - return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, - SecurityUnknownAccess); -} - -Font -GetNewFontClientID() -{ - return FakeClientID(0); -} - -int -StoreFontClientFont(FontPtr pfont, Font id) -{ - return AddResource(id, RT_NONE, (pointer) pfont); -} - -void -DeleteFontClientID(Font id) -{ - FreeResource(id, RT_NONE); -} - -int -client_auth_generation(ClientPtr client) -{ - return 0; -} - -static int fs_handlers_installed = 0; -static unsigned int last_server_gen; - -int -init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) -{ - /* if server has reset, make sure the b&w handlers are reinstalled */ - if (last_server_gen < serverGeneration) { - last_server_gen = serverGeneration; - fs_handlers_installed = 0; - } - if (fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "adding FS b & w handlers\n"); -#endif - - if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (pointer) 0)) - return AllocError; - fs_handlers_installed++; - } - QueueFontWakeup(fpe); - return Successful; -} - -void -remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, Bool all) -{ - if (all) { - /* remove the handlers if no one else is using them */ - if (--fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "removing FS b & w handlers\n"); -#endif - - RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (pointer) 0); - } - } - RemoveFontWakeup(fpe); -} - -#ifdef DEBUG -#define GLWIDTHBYTESPADDED(bits,nbytes) \ - ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \ - :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \ - :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \ - :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \ - : 0) - -#define GLYPH_SIZE(ch, nbytes) \ - GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \ - (ch)->metrics.leftSideBearing, (nbytes)) -void -dump_char_ascii(CharInfoPtr cip) -{ - int r, - l; - int bpr; - int byte; - static unsigned maskTab[] = { - (1 << 7), (1 << 6), (1 << 5), (1 << 4), - (1 << 3), (1 << 2), (1 << 1), (1 << 0), - }; - - bpr = GLYPH_SIZE(cip, 4); - for (r = 0; r < (cip->metrics.ascent + cip->metrics.descent); r++) { - pointer row = (pointer) cip->bits + r * bpr; - - byte = 0; - for (l = 0; l <= (cip->metrics.rightSideBearing - - cip->metrics.leftSideBearing); l++) { - if (maskTab[l & 7] & row[l >> 3]) - putchar('X'); - else - putchar('.'); - } - putchar('\n'); - } -} - -#endif - - -typedef struct -{ - LFclosurePtr c; - OFclosurePtr oc; -} nxFs,*nxFsPtr; - -static Bool -#if NeedFunctionPrototypes -nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) -#else -nxdoListFontsAndAliases(client, fss) - ClientPtr client; - nxFsPtr fss; -#endif -{ - LFclosurePtr c=fss->c; - OFclosurePtr oc=fss->oc; - FontPathElementPtr fpe; - int err = Successful; - char *name, *resolved=NULL; - int namelen, resolvedlen; - int i; - int aliascount = 0; - char tmp[256]; - tmp[0]=0; - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - - if (!c->current.patlen) - goto finish; - - while (c->current.current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) - { - /* This FPE doesn't support/require list_fonts_and_aliases */ - - err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - c->names); - - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)nxdoListFontsAndAliases, - (pointer) fss); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: nxdoListFont (1): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - - err = BadFontName; - } - else - { - /* Start of list_fonts_and_aliases functionality. Modeled - after list_fonts_with_info in that it resolves aliases, - except that the information collected from FPEs is just - names, not font info. Each list_next_font_or_alias() - returns either a name into name/namelen or an alias into - name/namelen and its target name into resolved/resolvedlen. - The code at this level then resolves the alias by polling - the FPEs. */ - - if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - &c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)nxdoListFontsAndAliases, - (pointer) fss); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: nxdoListFont (2): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) { - char *tmpname; - name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, - &resolvedlen, c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)nxdoListFontsAndAliases, - (pointer) fss); - c->slept = TRUE; -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: nxdoListFont (3): client [%lx] sleeping.\n", client); -#endif - } - return TRUE; - } - if (err == FontNameAlias) { - if (resolved) xfree(resolved); - resolved = (char *) xalloc(resolvedlen + 1); - if (resolved) - { - memmove(resolved, tmpname, resolvedlen); - resolved[resolvedlen] = '\0'; - } - } - } - - if (err == Successful) - { - if (c->haveSaved) - { - if (c->savedName) - { - memcpy(tmp,c->savedName,c->savedNameLen>255?255:c->savedNameLen); - tmp[c->savedNameLen>255?256:c->savedNameLen]=0; - if (nxagentFontLookUp(tmp)) - break; - else tmp[0]=0; - } - } - else - { - memcpy(tmp,name,namelen>255?255:namelen); - tmp[namelen>255?256:namelen]=0; - if (nxagentFontLookUp(tmp)) - break; - else tmp[0]=0; - } - } - - /* - * When we get an alias back, save our state and reset back to - * the start of the FPE looking for the specified name. As - * soon as a real font is found for the alias, pop back to the - * old state - */ - else if (err == FontNameAlias) { - char tmp_pattern[XLFDMAXFONTNAMELEN]; - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - memmove(tmp_pattern, resolved, resolvedlen); - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - - tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, - &tmpname, &tmpnamelen, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - { - memmove(c->savedName, name, namelen); - c->savedName[namelen] = '\0'; - } - c->savedNameLen = namelen; - aliascount = 20; - } - memmove(c->current.pattern, tmp_pattern, resolvedlen); - c->current.patlen = resolvedlen; - c->current.max_names = c->names->nnames + 1; - c->current.current_fpe = -1; - c->current.private = 0; - err = BadFontName; - } - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've collected enough - * font names, quit. - */ - if (err == BadFontName) { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->names->nnames == c->current.max_names || - c->current.current_fpe == c->num_fpes) { - c->haveSaved = FALSE; - c->current = c->saved; - /* Give the saved namelist a chance to clean itself up */ - continue; - } - } - if (c->names->nnames == c->current.max_names) - break; - } - } - - /* - * send the reply - */ -bail: -finish: - if (strlen(tmp)) - { -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "nxListFont changed (0) font to %s\n",tmp); -#endif - memcpy(oc->fontname, tmp, strlen(tmp)); - oc->fnamelen = strlen(tmp); - - oc->origFontName = oc->fontname; - oc->origFontNameLen = oc->fnamelen; - - } - else - { - for (i = 0; i < c->names->nnames; i++) - { - if (c->names->length[i] > 255) - continue; - else - { - memcpy(tmp, c->names->names[i], c->names->length[i]); - tmp[ c->names->length[i] ] = 0; - if (nxagentFontLookUp(tmp) == 0) - continue; - memcpy(oc->fontname, tmp, strlen(tmp)); - oc->fnamelen = strlen(tmp); - - oc->origFontName = oc->fontname; - oc->origFontNameLen = oc->fnamelen; - -#ifdef NXAGENT_FONTMATCH_DEBUG - fprintf(stderr, "nxListFont changed (1) font to %s\n",tmp); -#endif - break; - } - } - } - - if (c->slept) - { - ClientWakeup(client); -#ifdef NXAGENT_DEBUG - fprintf(stderr, " NXdixfonts: nxdoListFont: client [%lx] wakeup.\n", client); -#endif - } - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - FreeFontNames(c->names); - xfree(c); - xfree(fss); - if (resolved) xfree(resolved); - - return doOpenFont(client, oc); -} - -int -nxOpenFont(client, fid, flags, lenfname, pfontname) - ClientPtr client; - XID fid; - Mask flags; - unsigned lenfname; - char *pfontname; -{ - nxFsPtr fss; - LFclosurePtr c; - OFclosurePtr oc; - int i; - FontPtr cached = (FontPtr)0; - -#ifdef FONTDEBUG - char *f; - f = (char *)xalloc(lenfname + 1); - memmove(f, pfontname, lenfname); - f[lenfname] = '\0'; - ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); -#endif - if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) - return BadName; - if (patternCache) - { - - /* - ** Check name cache. If we find a cached version of this font that - ** is cachable, immediately satisfy the request with it. If we find - ** a cached version of this font that is non-cachable, we do not - ** satisfy the request with it. Instead, we pass the FontPtr to the - ** FPE's open_font code (the fontfile FPE in turn passes the - ** information to the rasterizer; the fserve FPE ignores it). - ** - ** Presumably, the font is marked non-cachable because the FPE has - ** put some licensing restrictions on it. If the FPE, using - ** whatever logic it relies on, determines that it is willing to - ** share this existing font with the client, then it has the option - ** to return the FontPtr we passed it as the newly-opened font. - ** This allows the FPE to exercise its licensing logic without - ** having to create another instance of a font that already exists. - */ - - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); - if (cached && cached->info.cachable) - { - if (!AddResource(fid, RT_FONT, (pointer) cached)) - return BadAlloc; - cached->refcnt++; - return Success; - } - } - if (!(fss = (nxFsPtr) xalloc(sizeof(nxFs)))) - return BadAlloc; - - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) - { - xfree(fss); - return BadAlloc; - } - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c); - xfree(fss); - return BadAlloc; - } - c->names = MakeFontNamesRecord(100); - if (!c->names) - { - xfree(c->fpe_list); - xfree(c); - xfree(fss); - return BadAlloc; - } - memmove( c->current.pattern, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->current.patlen = lenfname; - c->current.current_fpe = 0; - c->current.max_names = nxagentMaxFontNames; - c->current.list_started = FALSE; - c->current.private = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - - oc = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); - if (!oc) - { - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(fss); - return BadAlloc; - } - oc->fontname = (char *) xalloc(256);/* I don't want to deal with future reallocs errors */ - oc->origFontName = pfontname; - oc->origFontNameLen = lenfname; - if (!oc->fontname) { - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(oc); - xfree(fss); - return BadAlloc; - } - /* - * copy the current FPE list, so that if it gets changed by another client - * while we're blocking, the request still appears atomic - */ - oc->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!oc->fpe_list) { - xfree(oc->fontname); - xfree(oc); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(fss); - return BadAlloc; - } - memmove(oc->fontname, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - oc->fpe_list[i] = font_path_elements[i]; - UseFPE(oc->fpe_list[i]); - } - oc->client = client; - oc->fontid = fid; - oc->current_fpe = 0; - oc->num_fpes = num_fpes; - oc->fnamelen = lenfname; - oc->slept = FALSE; - oc->flags = flags; - oc->non_cachable_font = cached; - fss->c=c; - fss->oc=oc; - nxdoListFontsAndAliases(client, fss); - return Success; -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.X.original deleted file mode 100644 index 2c5874e8d..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.X.original +++ /dev/null @@ -1,2150 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/dix/dixfonts.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.28 2003/11/08 02:02:03 dawes 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. - -************************************************************************/ -/* The panoramix components contained the following notice */ -/* -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ -/* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ - -#define NEED_REPLIES -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include "scrnintstr.h" -#include "resource.h" -#include "dixstruct.h" -#include "cursorstr.h" -#include "misc.h" -#include "opaque.h" -#include "dixfontstr.h" -#include "closestr.h" - -#ifdef DEBUG -#include -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#endif - -#ifdef LBX -#include "lbxserve.h" -#endif - -#ifdef XF86BIGFONT -#define _XF86BIGFONT_SERVER_ -#include -#endif - -#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics - -extern pointer fosNaturalParams; -extern FontPtr defaultFont; - -static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; -static int num_fpes = 0; -FPEFunctions *fpe_functions = (FPEFunctions *) 0; -static int num_fpe_types = 0; - -static unsigned char *font_path_string; - -static int num_slept_fpes = 0; -static int size_slept_fpes = 0; -static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; -static FontPatternCachePtr patternCache; - -int -FontToXError(err) - int err; -{ - switch (err) { - case Successful: - return Success; - case AllocError: - return BadAlloc; - case BadFontName: - return BadName; - case BadFontPath: - case BadFontFormat: /* is there something better? */ - case BadCharRange: - return BadValue; - default: - return err; - } -} - - -/* - * adding RT_FONT prevents conflict with default cursor font - */ -Bool -SetDefaultFont(char *defaultfontname) -{ - int err; - FontPtr pf; - XID fid; - - fid = FakeClientID(0); - err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync, - (unsigned) strlen(defaultfontname), defaultfontname); - if (err != Success) - return FALSE; - pf = (FontPtr) LookupIDByType(fid, RT_FONT); - if (pf == (FontPtr) NULL) - return FALSE; - defaultFont = pf; - return TRUE; -} - -/* - * note that the font wakeup queue is not refcounted. this is because - * an fpe needs to be added when it's inited, and removed when it's finally - * freed, in order to handle any data that isn't requested, like FS events. - * - * since the only thing that should call these routines is the renderer's - * init_fpe() and free_fpe(), there shouldn't be any problem in using - * freed data. - */ -void -QueueFontWakeup(FontPathElementPtr fpe) -{ - int i; - FontPathElementPtr *new; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - -#ifdef DEBUG - fprintf(stderr, "re-queueing fpe wakeup\n"); -#endif - - return; - } - } - if (num_slept_fpes == size_slept_fpes) { - new = (FontPathElementPtr *) - xrealloc(slept_fpes, - sizeof(FontPathElementPtr) * (size_slept_fpes + 4)); - if (!new) - return; - slept_fpes = new; - size_slept_fpes += 4; - } - slept_fpes[num_slept_fpes] = fpe; - num_slept_fpes++; -} - -void -RemoveFontWakeup(FontPathElementPtr fpe) -{ - int i, - j; - - for (i = 0; i < num_slept_fpes; i++) { - if (slept_fpes[i] == fpe) { - for (j = i; j < num_slept_fpes; j++) { - slept_fpes[j] = slept_fpes[j + 1]; - } - num_slept_fpes--; - return; - } - } -} - -void -FontWakeup(pointer data, int count, pointer LastSelectMask) -{ - int i; - FontPathElementPtr fpe; - - if (count < 0) - return; - /* wake up any fpe's that may be waiting for information */ - for (i = 0; i < num_slept_fpes; i++) { - fpe = slept_fpes[i]; - (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask); - } -} - -/* XXX -- these two funcs may want to be broken into macros */ -static void -UseFPE(FontPathElementPtr fpe) -{ - fpe->refcount++; -} - -static void -FreeFPE (FontPathElementPtr fpe) -{ - fpe->refcount--; - if (fpe->refcount == 0) { - (*fpe_functions[fpe->type].free_fpe) (fpe); - xfree(fpe->name); - xfree(fpe); - } -} - -static Bool -doOpenFont(ClientPtr client, OFclosurePtr c) -{ - FontPtr pfont = NullFont; - FontPathElementPtr fpe = NULL; - ScreenPtr pScr; - int err = Successful; - int i; - char *alias, - *newname; - int newlen; - int aliascount = 20; - /* - * Decide at runtime what FontFormat to use. - */ - Mask FontFormat = - - ((screenInfo.imageByteOrder == LSBFirst) ? - BitmapFormatByteOrderLSB : BitmapFormatByteOrderMSB) | - - ((screenInfo.bitmapBitOrder == LSBFirst) ? - BitmapFormatBitOrderLSB : BitmapFormatBitOrderMSB) | - - BitmapFormatImageRectMin | - -#if GLYPHPADBYTES == 1 - BitmapFormatScanlinePad8 | -#endif - -#if GLYPHPADBYTES == 2 - BitmapFormatScanlinePad16 | -#endif - -#if GLYPHPADBYTES == 4 - BitmapFormatScanlinePad32 | -#endif - -#if GLYPHPADBYTES == 8 - BitmapFormatScanlinePad64 | -#endif - - BitmapFormatScanlineUnit8; - - if (client->clientGone) - { - if (c->current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - while (c->current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current_fpe]; - err = (*fpe_functions[fpe->type].open_font) - ((pointer) client, fpe, c->flags, - c->fontname, c->fnamelen, FontFormat, - BitmapFormatMaskByte | - BitmapFormatMaskBit | - BitmapFormatMaskImageRectangle | - BitmapFormatMaskScanLinePad | - BitmapFormatMaskScanLineUnit, - c->fontid, &pfont, &alias, - c->non_cachable_font && c->non_cachable_font->fpe == fpe ? - c->non_cachable_font : - (FontPtr)0); - - if (err == FontNameAlias && alias) { - newlen = strlen(alias); - newname = (char *) xrealloc(c->fontname, newlen); - if (!newname) { - err = AllocError; - break; - } - memmove(newname, alias, newlen); - c->fontname = newname; - c->fnamelen = newlen; - c->current_fpe = 0; - if (--aliascount <= 0) - break; - continue; - } - if (err == BadFontName) { - c->current_fpe++; - continue; - } - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (pointer) c); - } - return TRUE; - } - break; - } - - if (err != Successful) - goto bail; - if (!pfont) { - err = BadFontName; - goto bail; - } - /* check values for firstCol, lastCol, firstRow, and lastRow */ - if (pfont->info.firstCol > pfont->info.lastCol || - pfont->info.firstRow > pfont->info.lastRow || - pfont->info.lastCol - pfont->info.firstCol > 255) { - err = AllocError; - goto bail; - } - if (!pfont->fpe) - pfont->fpe = fpe; - pfont->refcnt++; - if (pfont->refcnt == 1) { - UseFPE(pfont->fpe); - for (i = 0; i < screenInfo.numScreens; i++) { - pScr = screenInfo.screens[i]; - if (pScr->RealizeFont) - { - if (!(*pScr->RealizeFont) (pScr, pfont)) - { - CloseFont (pfont, (Font) 0); - err = AllocError; - goto bail; - } - } - } - } - if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) { - err = AllocError; - goto bail; - } - if (patternCache && pfont != c->non_cachable_font) - CacheFontPattern(patternCache, c->origFontName, c->origFontNameLen, - pfont); -bail: - if (err != Successful && c->client != serverClient) { - SendErrorToClient(c->client, X_OpenFont, 0, - c->fontid, FontToXError(err)); - } - if (c->slept) - ClientWakeup(c->client); - for (i = 0; i < c->num_fpes; i++) { - FreeFPE(c->fpe_list[i]); - } - xfree(c->fpe_list); - xfree(c->fontname); - xfree(c); - return TRUE; -} - -int -OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontname) -{ - OFclosurePtr c; - int i; - FontPtr cached = (FontPtr)0; - -#ifdef FONTDEBUG - char *f; - f = (char *)xalloc(lenfname + 1); - memmove(f, pfontname, lenfname); - f[lenfname] = '\0'; - ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); -#endif - if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) - return BadName; - if (patternCache) - { - - /* - ** Check name cache. If we find a cached version of this font that - ** is cachable, immediately satisfy the request with it. If we find - ** a cached version of this font that is non-cachable, we do not - ** satisfy the request with it. Instead, we pass the FontPtr to the - ** FPE's open_font code (the fontfile FPE in turn passes the - ** information to the rasterizer; the fserve FPE ignores it). - ** - ** Presumably, the font is marked non-cachable because the FPE has - ** put some licensing restrictions on it. If the FPE, using - ** whatever logic it relies on, determines that it is willing to - ** share this existing font with the client, then it has the option - ** to return the FontPtr we passed it as the newly-opened font. - ** This allows the FPE to exercise its licensing logic without - ** having to create another instance of a font that already exists. - */ - - cached = FindCachedFontPattern(patternCache, pfontname, lenfname); - if (cached && cached->info.cachable) - { - if (!AddResource(fid, RT_FONT, (pointer) cached)) - return BadAlloc; - cached->refcnt++; - return Success; - } - } - c = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); - if (!c) - return BadAlloc; - c->fontname = (char *) xalloc(lenfname); - c->origFontName = pfontname; - c->origFontNameLen = lenfname; - if (!c->fontname) { - xfree(c); - return BadAlloc; - } - /* - * copy the current FPE list, so that if it gets changed by another client - * while we're blocking, the request still appears atomic - */ - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c->fontname); - xfree(c); - return BadAlloc; - } - memmove(c->fontname, pfontname, lenfname); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->fontid = fid; - c->current_fpe = 0; - c->num_fpes = num_fpes; - c->fnamelen = lenfname; - c->slept = FALSE; - c->flags = flags; - c->non_cachable_font = cached; - - (void) doOpenFont(client, c); - return Success; -} - -/** - * Decrement font's ref count, and free storage if ref count equals zero - * - * \param value must conform to DeleteType - */ -int -CloseFont(pointer value, XID fid) -{ - int nscr; - ScreenPtr pscr; - FontPathElementPtr fpe; - FontPtr pfont = (FontPtr)value; - - if (pfont == NullFont) - return (Success); - if (--pfont->refcnt == 0) { - if (patternCache) - RemoveCachedFontPattern (patternCache, pfont); - /* - * since the last reference is gone, ask each screen to free any - * storage it may have allocated locally for it. - */ - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { - pscr = screenInfo.screens[nscr]; - if (pscr->UnrealizeFont) - (*pscr->UnrealizeFont) (pscr, pfont); - } - if (pfont == defaultFont) - defaultFont = NULL; -#ifdef LBX - LbxFreeFontTag(pfont); -#endif -#ifdef XF86BIGFONT - XF86BigfontFreeFontShm(pfont); -#endif - fpe = pfont->fpe; - (*fpe_functions[fpe->type].close_font) (fpe, pfont); - FreeFPE(fpe); - } - return (Success); -} - - -/***====================================================================***/ - -/** - * Sets up pReply as the correct QueryFontReply for pFont with the first - * nProtoCCIStructs char infos. - * - * \param pReply caller must allocate this storage - */ -void -QueryFont(FontPtr pFont, xQueryFontReply *pReply, int nProtoCCIStructs) -{ - FontPropPtr pFP; - int r, - c, - i; - xFontProp *prFP; - xCharInfo *prCI; - xCharInfo *charInfos[256]; - unsigned char chars[512]; - int ninfos; - unsigned long ncols; - unsigned long count; - - /* pr->length set in dispatch */ - pReply->minCharOrByte2 = pFont->info.firstCol; - pReply->defaultChar = pFont->info.defaultCh; - pReply->maxCharOrByte2 = pFont->info.lastCol; - pReply->drawDirection = pFont->info.drawDirection; - pReply->allCharsExist = pFont->info.allExist; - pReply->minByte1 = pFont->info.firstRow; - pReply->maxByte1 = pFont->info.lastRow; - pReply->fontAscent = pFont->info.fontAscent; - pReply->fontDescent = pFont->info.fontDescent; - - pReply->minBounds = pFont->info.ink_minbounds; - pReply->maxBounds = pFont->info.ink_maxbounds; - - pReply->nFontProps = pFont->info.nprops; - pReply->nCharInfos = nProtoCCIStructs; - - for (i = 0, pFP = pFont->info.props, prFP = (xFontProp *) (&pReply[1]); - i < pFont->info.nprops; - i++, pFP++, prFP++) { - prFP->name = pFP->name; - prFP->value = pFP->value; - } - - ninfos = 0; - ncols = (unsigned long) (pFont->info.lastCol - pFont->info.firstCol + 1); - prCI = (xCharInfo *) (prFP); - for (r = pFont->info.firstRow; - ninfos < nProtoCCIStructs && r <= (int)pFont->info.lastRow; - r++) { - i = 0; - for (c = pFont->info.firstCol; c <= (int)pFont->info.lastCol; c++) { - chars[i++] = r; - chars[i++] = c; - } - (*pFont->get_metrics) (pFont, ncols, chars, - TwoD16Bit, &count, charInfos); - i = 0; - for (i = 0; i < (int) count && ninfos < nProtoCCIStructs; i++) { - *prCI = *charInfos[i]; - prCI++; - ninfos++; - } - } - return; -} - -static Bool -doListFontsAndAliases(ClientPtr client, LFclosurePtr c) -{ - FontPathElementPtr fpe; - int err = Successful; - FontNamesPtr names = NULL; - char *name, *resolved=NULL; - int namelen, resolvedlen; - int nnames; - int stringLens; - int i; - xListFontsReply reply; - char *bufptr; - char *bufferStart; - int aliascount = 0; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - - if (!c->current.patlen) - goto finish; - - while (c->current.current_fpe < c->num_fpes) { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - - if (!fpe_functions[fpe->type].start_list_fonts_and_aliases) - { - /* This FPE doesn't support/require list_fonts_and_aliases */ - - err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - c->names); - - if (err == Suspended) { - if (!c->slept) { - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - } - return TRUE; - } - - err = BadFontName; - } - else - { - /* Start of list_fonts_and_aliases functionality. Modeled - after list_fonts_with_info in that it resolves aliases, - except that the information collected from FPEs is just - names, not font info. Each list_next_font_or_alias() - returns either a name into name/namelen or an alias into - name/namelen and its target name into resolved/resolvedlen. - The code at this level then resolves the alias by polling - the FPEs. */ - - if (!c->current.list_started) { - err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, - c->current.patlen, c->current.max_names - c->names->nnames, - &c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) { - char *tmpname; - name = 0; - err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, - &resolvedlen, c->current.private); - if (err == Suspended) { - if (!c->slept) { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); - c->slept = TRUE; - } - return TRUE; - } - if (err == FontNameAlias) { - if (resolved) xfree(resolved); - resolved = (char *) xalloc(resolvedlen + 1); - if (resolved) - memmove(resolved, tmpname, resolvedlen + 1); - } - } - - if (err == Successful) - { - if (c->haveSaved) - { - if (c->savedName) - (void)AddFontNamesName(c->names, c->savedName, - c->savedNameLen); - } - else - (void)AddFontNamesName(c->names, name, namelen); - } - - /* - * When we get an alias back, save our state and reset back to - * the start of the FPE looking for the specified name. As - * soon as a real font is found for the alias, pop back to the - * old state - */ - else if (err == FontNameAlias) { - char tmp_pattern[XLFDMAXFONTNAMELEN]; - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - memmove(tmp_pattern, resolved, resolvedlen); - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - - tmpname = 0; - (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, - &tmpname, &tmpnamelen, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - c->savedNameLen = namelen; - aliascount = 20; - } - memmove(c->current.pattern, tmp_pattern, resolvedlen); - c->current.patlen = resolvedlen; - c->current.max_names = c->names->nnames + 1; - c->current.current_fpe = -1; - c->current.private = 0; - err = BadFontName; - } - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've collected enough - * font names, quit. - */ - if (err == BadFontName) { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->names->nnames == c->current.max_names || - c->current.current_fpe == c->num_fpes) { - c->haveSaved = FALSE; - c->current = c->saved; - /* Give the saved namelist a chance to clean itself up */ - continue; - } - } - if (c->names->nnames == c->current.max_names) - break; - } - } - - /* - * send the reply - */ - if (err != Successful) { - SendErrorToClient(client, X_ListFonts, 0, 0, FontToXError(err)); - goto bail; - } - -finish: - - names = c->names; - nnames = names->nnames; - client = c->client; - stringLens = 0; - for (i = 0; i < nnames; i++) - stringLens += (names->length[i] <= 255) ? names->length[i] : 0; - - reply.type = X_Reply; - reply.length = (stringLens + nnames + 3) >> 2; - reply.nFonts = nnames; - reply.sequenceNumber = client->sequence; - - bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2); - - if (!bufptr && reply.length) { - SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); - goto bail; - } - /* - * since WriteToClient long word aligns things, copy to temp buffer and - * write all at once - */ - for (i = 0; i < nnames; i++) { - if (names->length[i] > 255) - reply.nFonts--; - else - { - *bufptr++ = names->length[i]; - memmove( bufptr, names->names[i], names->length[i]); - bufptr += names->length[i]; - } - } - nnames = reply.nFonts; - reply.length = (stringLens + nnames + 3) >> 2; - client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; - WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); - (void) WriteToClient(client, stringLens + nnames, bufferStart); - DEALLOCATE_LOCAL(bufferStart); - -bail: - if (c->slept) - ClientWakeup(client); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - FreeFontNames(names); - xfree(c); - if (resolved) xfree(resolved); - return TRUE; -} - -int -ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, - unsigned max_names) -{ - int i; - LFclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) - return BadAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) { - xfree(c); - return BadAlloc; - } - c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100); - if (!c->names) - { - xfree(c->fpe_list); - xfree(c); - return BadAlloc; - } - memmove( c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsAndAliases(client, c); - return Success; -} - -int -doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) -{ - FontPathElementPtr fpe; - int err = Successful; - char *name; - int namelen; - int numFonts; - FontInfoRec fontInfo, - *pFontInfo; - xListFontsWithInfoReply *reply; - int length; - xFontProp *pFP; - int i; - int aliascount = 0; - xListFontsWithInfoReply finalReply; - - if (client->clientGone) - { - if (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } - err = Successful; - goto bail; - } - client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo]; - if (!c->current.patlen) - goto finish; - while (c->current.current_fpe < c->num_fpes) - { - fpe = c->fpe_list[c->current.current_fpe]; - err = Successful; - if (!c->current.list_started) - { - err = (*fpe_functions[fpe->type].start_list_fonts_with_info) - (client, fpe, c->current.pattern, c->current.patlen, - c->current.max_names, &c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, (ClientSleepProcPtr)doListFontsWithInfo, c); - c->slept = TRUE; - } - return TRUE; - } - if (err == Successful) - c->current.list_started = TRUE; - } - if (err == Successful) - { - name = 0; - pFontInfo = &fontInfo; - err = (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &name, &namelen, &pFontInfo, - &numFonts, c->current.private); - if (err == Suspended) - { - if (!c->slept) - { - ClientSleep(client, - (ClientSleepProcPtr)doListFontsWithInfo, - c); - c->slept = TRUE; - } - return TRUE; - } - } - /* - * When we get an alias back, save our state and reset back to the - * start of the FPE looking for the specified name. As soon as a real - * font is found for the alias, pop back to the old state - */ - if (err == FontNameAlias) - { - /* - * when an alias recurses, we need to give - * the last FPE a chance to clean up; so we call - * it again, and assume that the error returned - * is BadFontName, indicating the alias resolution - * is complete. - */ - if (c->haveSaved) - { - char *tmpname; - int tmpnamelen; - FontInfoPtr tmpFontInfo; - - tmpname = 0; - tmpFontInfo = &fontInfo; - (void) (*fpe_functions[fpe->type].list_next_font_with_info) - (client, fpe, &tmpname, &tmpnamelen, &tmpFontInfo, - &numFonts, c->current.private); - if (--aliascount <= 0) - { - err = BadFontName; - goto ContBadFontName; - } - } - else - { - c->saved = c->current; - c->haveSaved = TRUE; - c->savedNumFonts = numFonts; - if (c->savedName) - xfree(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); - if (c->savedName) - memmove(c->savedName, name, namelen + 1); - aliascount = 20; - } - memmove(c->current.pattern, name, namelen); - c->current.patlen = namelen; - c->current.max_names = 1; - c->current.current_fpe = 0; - c->current.private = 0; - c->current.list_started = FALSE; - } - /* - * At the end of this FPE, step to the next. If we've finished - * processing an alias, pop state back. If we've sent enough font - * names, quit. Always wait for BadFontName to let the FPE - * have a chance to clean up. - */ - else if (err == BadFontName) - { - ContBadFontName: ; - c->current.list_started = FALSE; - c->current.current_fpe++; - err = Successful; - if (c->haveSaved) - { - if (c->current.max_names == 0 || - c->current.current_fpe == c->num_fpes) - { - c->haveSaved = FALSE; - c->saved.max_names -= (1 - c->current.max_names); - c->current = c->saved; - } - } - else if (c->current.max_names == 0) - break; - } - else if (err == Successful) - { - length = sizeof(*reply) + pFontInfo->nprops * sizeof(xFontProp); - reply = c->reply; - if (c->length < length) - { - reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length); - if (!reply) - { - err = AllocError; - break; - } - c->reply = reply; - c->length = length; - } - if (c->haveSaved) - { - numFonts = c->savedNumFonts; - name = c->savedName; - namelen = strlen(name); - } - reply->type = X_Reply; - reply->length = (sizeof *reply - sizeof(xGenericReply) + - pFontInfo->nprops * sizeof(xFontProp) + - namelen + 3) >> 2; - reply->sequenceNumber = client->sequence; - reply->nameLength = namelen; - reply->minBounds = pFontInfo->ink_minbounds; - reply->maxBounds = pFontInfo->ink_maxbounds; - reply->minCharOrByte2 = pFontInfo->firstCol; - reply->maxCharOrByte2 = pFontInfo->lastCol; - reply->defaultChar = pFontInfo->defaultCh; - reply->nFontProps = pFontInfo->nprops; - reply->drawDirection = pFontInfo->drawDirection; - reply->minByte1 = pFontInfo->firstRow; - reply->maxByte1 = pFontInfo->lastRow; - reply->allCharsExist = pFontInfo->allExist; - reply->fontAscent = pFontInfo->fontAscent; - reply->fontDescent = pFontInfo->fontDescent; - reply->nReplies = numFonts; - pFP = (xFontProp *) (reply + 1); - for (i = 0; i < pFontInfo->nprops; i++) - { - pFP->name = pFontInfo->props[i].name; - pFP->value = pFontInfo->props[i].value; - pFP++; - } - WriteSwappedDataToClient(client, length, reply); - (void) WriteToClient(client, namelen, name); - if (pFontInfo == &fontInfo) - { - xfree(fontInfo.props); - xfree(fontInfo.isStringProp); - } - --c->current.max_names; - } - } -finish: - length = sizeof(xListFontsWithInfoReply); - bzero((char *) &finalReply, sizeof(xListFontsWithInfoReply)); - finalReply.type = X_Reply; - finalReply.sequenceNumber = client->sequence; - finalReply.length = (sizeof(xListFontsWithInfoReply) - - sizeof(xGenericReply)) >> 2; - WriteSwappedDataToClient(client, length, &finalReply); -bail: - if (c->slept) - ClientWakeup(client); - for (i = 0; i < c->num_fpes; i++) - FreeFPE(c->fpe_list[i]); - xfree(c->reply); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - xfree(c); - return TRUE; -} - -int -StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, - int max_names) -{ - int i; - LFWIclosurePtr c; - - /* - * The right error to return here would be BadName, however the - * specification does not allow for a Name error on this request. - * Perhaps a better solution would be to return a nil list, i.e. - * a list containing zero fontnames. - */ - if (length > XLFDMAXFONTNAMELEN) - return BadAlloc; - - if (!(c = (LFWIclosurePtr) xalloc(sizeof *c))) - goto badAlloc; - c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); - if (!c->fpe_list) - { - xfree(c); - goto badAlloc; - } - memmove(c->current.pattern, pattern, length); - for (i = 0; i < num_fpes; i++) - { - c->fpe_list[i] = font_path_elements[i]; - UseFPE(c->fpe_list[i]); - } - c->client = client; - c->num_fpes = num_fpes; - c->reply = 0; - c->length = 0; - c->current.patlen = length; - c->current.current_fpe = 0; - c->current.max_names = max_names; - c->current.list_started = FALSE; - c->current.private = 0; - c->savedNumFonts = 0; - c->haveSaved = FALSE; - c->slept = FALSE; - c->savedName = 0; - doListFontsWithInfo(client, c); - return Success; -badAlloc: - return BadAlloc; -} - -#define TextEltHeader 2 -#define FontShiftSize 5 -static XID clearGC[] = { CT_NONE }; -#define clearGCmask (GCClipMask) - -int -doPolyText(ClientPtr client, register PTclosurePtr c) -{ - register FontPtr pFont = c->pGC->font, oldpFont; - Font fid, oldfid; - int err = Success, lgerr; /* err is in X error, not font error, space */ - enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; - FontPathElementPtr fpe; - GC *origGC = NULL; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - - if (c->slept) - { - /* Client has died, but we cannot bail out right now. We - need to clean up after the work we did when going to - sleep. Setting the drawable pointer to 0 makes this - happen without any attempts to render or perform other - unnecessary activities. */ - c->pDraw = (DrawablePtr)0; - } - else - { - err = Success; - goto bail; - } - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client and avoid further - rendering while we clean up after ourself. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - c->pDraw = (DrawablePtr)0; - } - - client_state = c->slept ? SLEEPING : NEVER_SLEPT; - - while (c->endReq - c->pElt > TextEltHeader) - { - if (*c->pElt == FontChange) - { - if (c->endReq - c->pElt < FontShiftSize) - { - err = BadLength; - goto bail; - } - - oldpFont = pFont; - oldfid = fid; - - fid = ((Font)*(c->pElt+4)) /* big-endian */ - | ((Font)*(c->pElt+3)) << 8 - | ((Font)*(c->pElt+2)) << 16 - | ((Font)*(c->pElt+1)) << 24; - pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT, - SecurityReadAccess); - if (!pFont) - { - client->errorValue = fid; - err = BadFont; - /* restore pFont and fid for step 4 (described below) */ - pFont = oldpFont; - fid = oldfid; - - /* If we're in START_SLEEP mode, the following step - shortens the request... in the unlikely event that - the fid somehow becomes valid before we come through - again to actually execute the polytext, which would - then mess up our refcounting scheme badly. */ - c->err = err; - c->endReq = c->pElt; - - goto bail; - } - - /* Step 3 (described below) on our new font */ - if (client_state == START_SLEEP) - pFont->refcnt++; - else - { - if (pFont != c->pGC->font && c->pDraw) - { - ChangeGC( c->pGC, GCFont, &fid); - ValidateGC(c->pDraw, c->pGC); - if (c->reqType == X_PolyText8) - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8; - else - c->polyText = (PolyTextPtr) c->pGC->ops->PolyText16; - } - - /* Undo the refcnt++ we performed when going to sleep */ - if (client_state == SLEEPING) - (void)CloseFont(c->pGC->font, (Font)0); - } - c->pElt += FontShiftSize; - } - else /* print a string */ - { - unsigned char *pNextElt; - pNextElt = c->pElt + TextEltHeader + (*c->pElt)*c->itemSize; - if ( pNextElt > c->endReq) - { - err = BadLength; - goto bail; - } - if (client_state == START_SLEEP) - { - c->pElt = pNextElt; - continue; - } - if (c->pDraw) - { - lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, c->itemSize, - c->pElt + TextEltHeader); - } - else lgerr = Successful; - - if (lgerr == Suspended) - { - if (!c->slept) { - int len; - GC *pGC; - PTclosurePtr new_closure; - - /* We're putting the client to sleep. We need to do a few things - to ensure successful and atomic-appearing execution of the - remainder of the request. First, copy the remainder of the - request into a safe malloc'd area. Second, create a scratch GC - to use for the remainder of the request. Third, mark all fonts - referenced in the remainder of the request to prevent their - deallocation. Fourth, make the original GC look like the - request has completed... set its font to the final font value - from this request. These GC manipulations are for the unlikely - (but possible) event that some other client is using the GC. - Steps 3 and 4 are performed by running this procedure through - the remainder of the request in a special no-render mode - indicated by client_state = START_SLEEP. */ - - /* Step 1 */ - /* Allocate a malloc'd closure structure to replace - the local one we were passed */ - new_closure = (PTclosurePtr) xalloc(sizeof(PTclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - len = c->endReq - c->pElt; - c->data = (unsigned char *)xalloc(len); - if (!c->data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(c->data, c->pElt, len); - c->pElt = c->data; - c->endReq = c->pElt + len; - - /* Step 2 */ - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - if ((err = CopyGC(c->pGC, pGC, GCFunction | - GCPlaneMask | GCForeground | - GCBackground | GCFillStyle | - GCTile | GCStipple | - GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != - Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - origGC = c->pGC; - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, - (ClientSleepProcPtr)doPolyText, - (pointer) c); - - /* Set up to perform steps 3 and 4 */ - client_state = START_SLEEP; - continue; /* on to steps 3 and 4 */ - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */ - c->xorg = (* c->polyText)(c->pDraw, c->pGC, c->xorg, c->yorg, - *c->pElt, c->pElt + TextEltHeader); - } - c->pElt = pNextElt; - } - } - -bail: - - if (client_state == START_SLEEP) - { - /* Step 4 */ - if (pFont != origGC->font) - { - ChangeGC(origGC, GCFont, &fid); - ValidateGC(c->pDraw, origGC); - } - - /* restore pElt pointer for execution of remainder of the request */ - c->pElt = c->data; - return TRUE; - } - - if (c->err != Success) err = c->err; - if (err != Success && c->client != serverClient) { -#ifdef PANORAMIX - if (noPanoramiXExtension || !c->pGC->pScreen->myNum) -#endif - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -PolyText(ClientPtr client, DrawablePtr pDraw, GC *pGC, unsigned char *pElt, - unsigned char *endReq, int xorg, int yorg, int reqType, XID did) -{ - PTclosureRec local_closure; - - local_closure.pElt = pElt; - local_closure.endReq = endReq; - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_PolyText8) - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText8; - local_closure.itemSize = 1; - } - else - { - local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText16; - local_closure.itemSize = 2; - } - local_closure.pGC = pGC; - local_closure.did = did; - local_closure.err = Success; - local_closure.slept = FALSE; - - (void) doPolyText(client, &local_closure); - return Success; -} - - -#undef TextEltHeader -#undef FontShiftSize - -int -doImageText(ClientPtr client, register ITclosurePtr c) -{ - int err = Success, lgerr; /* err is in X error, not font error, space */ - FontPathElementPtr fpe; - - if (client->clientGone) - { - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - /* Make sure our drawable hasn't disappeared while we slept. */ - if (c->slept && - c->pDraw && - c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) - { - /* Our drawable has disappeared. Treat like client died... ask - the FPE code to clean up after client. */ - fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - err = Success; - goto bail; - } - - lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, c->itemSize, c->data); - if (lgerr == Suspended) - { - if (!c->slept) { - GC *pGC; - unsigned char *data; - ITclosurePtr new_closure; - - /* We're putting the client to sleep. We need to - save some state. Similar problem to that handled - in doPolyText, but much simpler because the - request structure is much simpler. */ - - new_closure = (ITclosurePtr) xalloc(sizeof(ITclosureRec)); - if (!new_closure) - { - err = BadAlloc; - goto bail; - } - *new_closure = *c; - c = new_closure; - - data = (unsigned char *)xalloc(c->nChars * c->itemSize); - if (!data) - { - xfree(c); - err = BadAlloc; - goto bail; - } - memmove(data, c->data, c->nChars * c->itemSize); - c->data = data; - - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); - if (!pGC) - { - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - if ((err = CopyGC(c->pGC, pGC, GCFunction | GCPlaneMask | - GCForeground | GCBackground | GCFillStyle | - GCTile | GCStipple | GCTileStipXOrigin | - GCTileStipYOrigin | GCFont | - GCSubwindowMode | GCClipXOrigin | - GCClipYOrigin | GCClipMask)) != Success) - { - FreeScratchGC(pGC); - xfree(c->data); - xfree(c); - err = BadAlloc; - goto bail; - } - c->pGC = pGC; - ValidateGC(c->pDraw, c->pGC); - - c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doImageText, (pointer) c); - } - return TRUE; - } - else if (lgerr != Successful) - { - err = FontToXError(lgerr); - goto bail; - } - if (c->pDraw) - { - (* c->imageText)(c->pDraw, c->pGC, c->xorg, c->yorg, - c->nChars, c->data); - } - -bail: - - if (err != Success && c->client != serverClient) { - SendErrorToClient(c->client, c->reqType, 0, 0, err); - } - if (c->slept) - { - ClientWakeup(c->client); - ChangeGC(c->pGC, clearGCmask, clearGC); - - /* Unreference the font from the scratch GC */ - CloseFont(c->pGC->font, (Font)0); - c->pGC->font = NullFont; - - FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); - } - return TRUE; -} - -int -ImageText(ClientPtr client, DrawablePtr pDraw, GC *pGC, int nChars, - unsigned char *data, int xorg, int yorg, int reqType, XID did) -{ - ITclosureRec local_closure; - - local_closure.client = client; - local_closure.pDraw = pDraw; - local_closure.pGC = pGC; - local_closure.nChars = nChars; - local_closure.data = data; - local_closure.xorg = xorg; - local_closure.yorg = yorg; - if ((local_closure.reqType = reqType) == X_ImageText8) - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText8; - local_closure.itemSize = 1; - } - else - { - local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText16; - local_closure.itemSize = 2; - } - local_closure.did = did; - local_closure.slept = FALSE; - - (void) doImageText(client, &local_closure); - return Success; -} - - -/* does the necessary magic to figure out the fpe type */ -static int -DetermineFPEType(char *pathname) -{ - int i; - - for (i = 0; i < num_fpe_types; i++) { - if ((*fpe_functions[i].name_check) (pathname)) - return i; - } - return -1; -} - - -static void -FreeFontPath(FontPathElementPtr *list, int n, Bool force) -{ - int i; - - for (i = 0; i < n; i++) { - if (force) { - /* Sanity check that all refcounts will be 0 by the time - we get to the end of the list. */ - int found = 1; /* the first reference is us */ - int j; - for (j = i+1; j < n; j++) { - if (list[j] == list[i]) - found++; - } - if (list[i]->refcount != found) { - ErrorF("FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n", - list[i]->name_length, list[i]->name, - list[i]->refcount, found); - list[i]->refcount = found; /* ensure it will get freed */ - } - } - FreeFPE(list[i]); - } - xfree((char *) list); -} - -static FontPathElementPtr -find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len) -{ - FontPathElementPtr fpe; - int i; - - for (i = 0; i < num; i++) { - fpe = list[i]; - if (fpe->name_length == len && memcmp(name, fpe->name, len) == 0) - return fpe; - } - return (FontPathElementPtr) 0; -} - - -static int -SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) -{ - int i, err = 0; - int valid_paths = 0; - unsigned int len; - unsigned char *cp = paths; - FontPathElementPtr fpe = NULL, *fplist; - - fplist = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * npaths); - if (!fplist) { - *bad = 0; - return BadAlloc; - } - for (i = 0; i < num_fpe_types; i++) { - if (fpe_functions[i].set_path_hook) - (*fpe_functions[i].set_path_hook) (); - } - for (i = 0; i < npaths; i++) - { - len = (unsigned int) (*cp++); - - if (len == 0) - { - if (persist) - ErrorF ("Removing empty element from the valid list of fontpaths\n"); - err = BadValue; - } - else - { - /* if it's already in our active list, just reset it */ - /* - * note that this can miss FPE's in limbo -- may be worth catching - * them, though it'd muck up refcounting - */ - fpe = find_existing_fpe(font_path_elements, num_fpes, cp, len); - if (fpe) - { - err = (*fpe_functions[fpe->type].reset_fpe) (fpe); - if (err == Successful) - { - UseFPE(fpe);/* since it'll be decref'd later when freed - * from the old list */ - } - else - fpe = 0; - } - /* if error or can't do it, act like it's a new one */ - if (!fpe) - { - fpe = (FontPathElementPtr) xalloc(sizeof(FontPathElementRec)); - if (!fpe) - { - err = BadAlloc; - goto bail; - } - fpe->name = (char *) xalloc(len + 1); - if (!fpe->name) - { - xfree(fpe); - err = BadAlloc; - goto bail; - } - fpe->refcount = 1; - - strncpy(fpe->name, (char *) cp, (int) len); - fpe->name[len] = '\0'; - fpe->name_length = len; - fpe->type = DetermineFPEType(fpe->name); - if (fpe->type == -1) - err = BadValue; - else - err = (*fpe_functions[fpe->type].init_fpe) (fpe); - if (err != Successful) - { - if (persist) - { - ErrorF("Could not init font path element %s, removing from list!\n", - fpe->name); - } - xfree (fpe->name); - xfree (fpe); - } - } - } - if (err != Successful) - { - if (!persist) - goto bail; - } - else - { - fplist[valid_paths++] = fpe; - } - cp += len; - } - - FreeFontPath(font_path_elements, num_fpes, FALSE); - font_path_elements = fplist; - if (patternCache) - EmptyFontPatternCache(patternCache); - num_fpes = valid_paths; - - return Success; -bail: - *bad = i; - while (--valid_paths >= 0) - FreeFPE(fplist[valid_paths]); - xfree(fplist); - return FontToXError(err); -} - -/* XXX -- do we need to pass error down to each renderer? */ -int -SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) -{ - int err = Success; - - if (npaths == 0) { - if (SetDefaultFontPath(defaultFontPath) != Success) - return BadValue; - } else { - err = SetFontPathElements(npaths, paths, error, FALSE); - } - return err; -} - -int -SetDefaultFontPath(char *path) -{ - unsigned char *cp, - *pp, - *nump, - *newpath; - int num = 1, - len, - err, - size = 0, - bad; - - /* get enough for string, plus values -- use up commas */ - len = strlen(path) + 1; - nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); - if (!newpath) - return BadAlloc; - pp = (unsigned char *) path; - cp++; - while (*pp) { - if (*pp == ',') { - *nump = (unsigned char) size; - nump = cp++; - pp++; - num++; - size = 0; - } else { - *cp++ = *pp++; - size++; - } - } - *nump = (unsigned char) size; - - err = SetFontPathElements(num, newpath, &bad, TRUE); - - DEALLOCATE_LOCAL(newpath); - - return err; -} - -unsigned char * -GetFontPath(int *count, int *length) -{ - int i; - unsigned char *c; - int len; - FontPathElementPtr fpe; - - len = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - len += fpe->name_length + 1; - } - font_path_string = (unsigned char *) xrealloc(font_path_string, len); - if (!font_path_string) - return NULL; - - c = font_path_string; - *length = 0; - for (i = 0; i < num_fpes; i++) { - fpe = font_path_elements[i]; - *c = fpe->name_length; - *length += *c++; - memmove(c, fpe->name, fpe->name_length); - c += fpe->name_length; - } - *count = num_fpes; - return font_path_string; -} - -int -LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, unsigned char *data) -{ - if (fpe_functions[pfont->fpe->type].load_glyphs) - return (*fpe_functions[pfont->fpe->type].load_glyphs) - (client, pfont, 0, nchars, item_size, data); - else - return Successful; -} - -void -DeleteClientFontStuff(ClientPtr client) -{ - int i; - FontPathElementPtr fpe; - - for (i = 0; i < num_fpes; i++) - { - fpe = font_path_elements[i]; - if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); - } -} - -void -InitFonts () -{ - patternCache = MakeFontPatternCache(); - -#ifndef KDRIVESERVER - if (screenInfo.numScreens > screenInfo.numVideoScreens) { - PrinterFontRegisterFpeFunctions(); - FontFileCheckRegisterFpeFunctions(); - check_fs_register_fpe_functions(); - } else -#endif - { -#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); -#endif - FontFileRegisterFpeFunctions(); -#ifndef NOFONTSERVERACCESS - fs_register_fpe_functions(); -#endif - } -} - -int -GetDefaultPointSize () -{ - return 120; -} - - -FontResolutionPtr -GetClientResolutions (int *num) -{ - if (requestingClient && requestingClient->fontResFunc != NULL && - !requestingClient->clientGone) - { - return (*requestingClient->fontResFunc)(requestingClient, num); - } - else { - static struct _FontResolution res; - ScreenPtr pScreen; - - pScreen = screenInfo.screens[0]; - res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; - /* - * XXX - we'll want this as long as bitmap instances are prevalent - so that we can match them from scalable fonts - */ - if (res.x_resolution < 88) - res.x_resolution = 75; - else - res.x_resolution = 100; - res.y_resolution = (pScreen->height * 25.4) / pScreen->mmHeight; - if (res.y_resolution < 88) - res.y_resolution = 75; - else - res.y_resolution = 100; - res.point_size = 120; - *num = 1; - return &res; - } -} - -/* - * returns the type index of the new fpe - * - * should be called (only once!) by each type of fpe when initialized - */ - -int -RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func) -{ - FPEFunctions *new; - - /* grow the list */ - new = (FPEFunctions *) xrealloc(fpe_functions, - (num_fpe_types + 1) * sizeof(FPEFunctions)); - if (!new) - return -1; - fpe_functions = new; - - fpe_functions[num_fpe_types].name_check = name_func; - fpe_functions[num_fpe_types].open_font = open_func; - fpe_functions[num_fpe_types].close_font = close_func; - fpe_functions[num_fpe_types].wakeup_fpe = wakeup_func; - fpe_functions[num_fpe_types].list_fonts = list_func; - fpe_functions[num_fpe_types].start_list_fonts_with_info = - start_lfwi_func; - fpe_functions[num_fpe_types].list_next_font_with_info = - next_lfwi_func; - fpe_functions[num_fpe_types].init_fpe = init_func; - fpe_functions[num_fpe_types].free_fpe = free_func; - fpe_functions[num_fpe_types].reset_fpe = reset_func; - fpe_functions[num_fpe_types].client_died = client_died; - fpe_functions[num_fpe_types].load_glyphs = load_glyphs; - fpe_functions[num_fpe_types].start_list_fonts_and_aliases = - start_list_alias_func; - fpe_functions[num_fpe_types].list_next_font_or_alias = - next_list_alias_func; - fpe_functions[num_fpe_types].set_path_hook = set_path_func; - - return num_fpe_types++; -} - -void -FreeFonts() -{ - if (patternCache) { - FreeFontPatternCache(patternCache); - patternCache = 0; - } - FreeFontPath(font_path_elements, num_fpes, TRUE); - font_path_elements = 0; - num_fpes = 0; - xfree(fpe_functions); - num_fpe_types = 0; - fpe_functions = (FPEFunctions *) 0; -} - -/* convenience functions for FS interface */ - -FontPtr -find_old_font(XID id) -{ - return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, - SecurityUnknownAccess); -} - -Font -GetNewFontClientID() -{ - return FakeClientID(0); -} - -int -StoreFontClientFont(FontPtr pfont, Font id) -{ - return AddResource(id, RT_NONE, (pointer) pfont); -} - -void -DeleteFontClientID(Font id) -{ - FreeResource(id, RT_NONE); -} - -int -client_auth_generation(ClientPtr client) -{ - return 0; -} - -static int fs_handlers_installed = 0; -static unsigned int last_server_gen; - -int -init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) -{ - /* if server has reset, make sure the b&w handlers are reinstalled */ - if (last_server_gen < serverGeneration) { - last_server_gen = serverGeneration; - fs_handlers_installed = 0; - } - if (fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "adding FS b & w handlers\n"); -#endif - - if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (pointer) 0)) - return AllocError; - fs_handlers_installed++; - } - QueueFontWakeup(fpe); - return Successful; -} - -void -remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, Bool all) -{ - if (all) { - /* remove the handlers if no one else is using them */ - if (--fs_handlers_installed == 0) { - -#ifdef DEBUG - fprintf(stderr, "removing FS b & w handlers\n"); -#endif - - RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (pointer) 0); - } - } - RemoveFontWakeup(fpe); -} - -#ifdef DEBUG -#define GLWIDTHBYTESPADDED(bits,nbytes) \ - ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \ - :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \ - :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \ - :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \ - : 0) - -#define GLYPH_SIZE(ch, nbytes) \ - GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \ - (ch)->metrics.leftSideBearing, (nbytes)) -void -dump_char_ascii(CharInfoPtr cip) -{ - int r, - l; - int bpr; - int byte; - static unsigned maskTab[] = { - (1 << 7), (1 << 6), (1 << 5), (1 << 4), - (1 << 3), (1 << 2), (1 << 1), (1 << 0), - }; - - bpr = GLYPH_SIZE(cip, 4); - for (r = 0; r < (cip->metrics.ascent + cip->metrics.descent); r++) { - pointer row = (pointer) cip->bits + r * bpr; - - byte = 0; - for (l = 0; l <= (cip->metrics.rightSideBearing - - cip->metrics.leftSideBearing); l++) { - if (maskTab[l & 7] & row[l >> 3]) - putchar('X'); - else - putchar('.'); - } - putchar('\n'); - } -} - -#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original deleted file mode 100644 index c5593adbb..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original +++ /dev/null @@ -1,5044 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.17 2005/08/25 22:11:04 anholt Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.51 2004/01/12 17:04:52 tsi Exp $ */ -/************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* The panoramix components contained the following notice */ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/***************************************************************** - -Copyright 2003-2005 Sun Microsystems, Inc. - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -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 -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. - -******************************************************************/ - -/* $Xorg: events.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "Xlib.h" -#include "misc.h" -#include "resource.h" -#define NEED_EVENTS -#define NEED_REPLIES -#include -#include "windowstr.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "cursorstr.h" - -#include "dixstruct.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include "globals.h" - -#ifdef XKB -#include -extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); -#endif - -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif - -#ifdef XEVIE -extern WindowPtr *WindowTable; -extern int xevieFlag; -extern int xevieClientIndex; -extern DeviceIntPtr xeviemouse; -extern DeviceIntPtr xeviekb; -extern Mask xevieMask; -extern Mask xevieFilters[128]; -extern int xevieEventSent; -extern int xevieKBEventSent; -int xeviegrabState = 0; -xEvent *xeviexE; -#endif - -#include -#include "exevents.h" -#include "extnsionst.h" - -#include "dixevents.h" -#include "dixgrabs.h" -#include "../../dix/dispatch.h" - -#include "NXlib.h" - -#include "Events.h" -#include "Windows.h" -#include "Args.h" - -#ifdef NX_DEBUG_INPUT -extern int nxagentDebugInput; -extern int nxagentDebugInputDevices; -#endif - -extern Display *nxagentDisplay; - -extern WindowPtr nxagentLastEnteredWindow; - -#define EXTENSION_EVENT_BASE 64 - -#define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */ -#define StructureAndSubMask ( StructureNotifyMask | SubstructureNotifyMask ) -#define AllButtonsMask ( \ - Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask ) -#define MotionMask ( \ - PointerMotionMask | Button1MotionMask | \ - Button2MotionMask | Button3MotionMask | Button4MotionMask | \ - Button5MotionMask | ButtonMotionMask ) -#define PropagateMask ( \ - KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \ - MotionMask ) -#define PointerGrabMask ( \ - ButtonPressMask | ButtonReleaseMask | \ - EnterWindowMask | LeaveWindowMask | \ - PointerMotionHintMask | KeymapStateMask | \ - MotionMask ) -#define AllModifiersMask ( \ - ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ - Mod3Mask | Mod4Mask | Mod5Mask ) -#define AllEventMasks (lastEventMask|(lastEventMask-1)) -/* - * The following relies on the fact that the ButtonMotionMasks are equal - * to the corresponding ButtonMasks from the current modifier/button state. - */ -#define Motion_Filter(class) (PointerMotionMask | \ - (class)->state | (class)->motionMask) - - -#define WID(w) ((w) ? ((w)->drawable.id) : 0) - -#define XE_KBPTR (xE->u.keyButtonPointer) - - -#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) - -CallbackListPtr EventCallback; -CallbackListPtr DeviceEventCallback; - -#define DNPMCOUNT 8 - -Mask DontPropagateMasks[DNPMCOUNT]; -static int DontPropagateRefCnts[DNPMCOUNT]; - -#ifdef DEBUG -static debug_events = 0; -#endif -InputInfo inputInfo; - -static struct { - QdEventPtr pending, *pendtail; - DeviceIntPtr replayDev; /* kludgy rock to put flag for */ - WindowPtr replayWin; /* ComputeFreezes */ - Bool playingEvents; - TimeStamp time; -} syncEvents; - -/* - * The window trace information is used to avoid having to compute all the - * windows between the root and the current pointer window each time a button - * or key goes down. The grabs on each of those windows must be checked. - */ -static WindowPtr *spriteTrace = (WindowPtr *)NULL; -#define ROOT spriteTrace[0] -static int spriteTraceSize = 0; -static int spriteTraceGood; - -static struct { - CursorPtr current; - BoxRec hotLimits; /* logical constraints of hot spot */ - Bool confined; /* confined to screen */ -#if defined(SHAPE) || defined(PANORAMIX) - RegionPtr hotShape; /* additional logical shape constraint */ -#endif - BoxRec physLimits; /* physical constraints of hot spot */ - WindowPtr win; /* window of logical position */ - HotSpot hot; /* logical pointer position */ - HotSpot hotPhys; /* physical pointer position */ -#ifdef PANORAMIX - ScreenPtr screen; /* all others are in Screen 0 coordinates */ - RegionRec Reg1; /* Region 1 for confining motion */ - RegionRec Reg2; /* Region 2 for confining virtual motion */ - WindowPtr windows[MAXSCREENS]; - WindowPtr confineWin; /* confine window */ -#endif -} sprite; /* info about the cursor sprite */ - -#ifdef XEVIE -WindowPtr xeviewin; -HotSpot xeviehot; -#endif - -static void DoEnterLeaveEvents( - WindowPtr fromWin, - WindowPtr toWin, - int mode -); - -static WindowPtr XYToWindow( - int x, - int y -); - -extern int lastEvent; - -static Mask lastEventMask; - -#ifdef XINPUT -extern int DeviceMotionNotify; -#endif - -#define CantBeFiltered NoEventMask -static Mask filters[128] = -{ - NoSuchEvent, /* 0 */ - NoSuchEvent, /* 1 */ - KeyPressMask, /* KeyPress */ - KeyReleaseMask, /* KeyRelease */ - ButtonPressMask, /* ButtonPress */ - ButtonReleaseMask, /* ButtonRelease */ - PointerMotionMask, /* MotionNotify (initial state) */ - EnterWindowMask, /* EnterNotify */ - LeaveWindowMask, /* LeaveNotify */ - FocusChangeMask, /* FocusIn */ - FocusChangeMask, /* FocusOut */ - KeymapStateMask, /* KeymapNotify */ - ExposureMask, /* Expose */ - CantBeFiltered, /* GraphicsExpose */ - CantBeFiltered, /* NoExpose */ - VisibilityChangeMask, /* VisibilityNotify */ - SubstructureNotifyMask, /* CreateNotify */ - StructureAndSubMask, /* DestroyNotify */ - StructureAndSubMask, /* UnmapNotify */ - StructureAndSubMask, /* MapNotify */ - SubstructureRedirectMask, /* MapRequest */ - StructureAndSubMask, /* ReparentNotify */ - StructureAndSubMask, /* ConfigureNotify */ - SubstructureRedirectMask, /* ConfigureRequest */ - StructureAndSubMask, /* GravityNotify */ - ResizeRedirectMask, /* ResizeRequest */ - StructureAndSubMask, /* CirculateNotify */ - SubstructureRedirectMask, /* CirculateRequest */ - PropertyChangeMask, /* PropertyNotify */ - CantBeFiltered, /* SelectionClear */ - CantBeFiltered, /* SelectionRequest */ - CantBeFiltered, /* SelectionNotify */ - ColormapChangeMask, /* ColormapNotify */ - CantBeFiltered, /* ClientMessage */ - CantBeFiltered /* MappingNotify */ -}; - -static CARD8 criticalEvents[32] = -{ - 0x7c /* key and button events */ -}; - -#ifdef PANORAMIX - -static void ConfineToShape(RegionPtr shape, int *px, int *py); -static void SyntheticMotion(int x, int y); -static void PostNewCursor(void); - -static Bool -XineramaSetCursorPosition( - int x, - int y, - Bool generateEvent -){ - ScreenPtr pScreen; - BoxRec box; - int i; - - /* x,y are in Screen 0 coordinates. We need to decide what Screen - to send the message too and what the coordinates relative to - that screen are. */ - - pScreen = sprite.screen; - x += panoramiXdataPtr[0].x; - y += panoramiXdataPtr[0].y; - - if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], - x, y, &box)) - { - FOR_NSCREENS(i) - { - if(i == pScreen->myNum) - continue; - if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box)) - { - pScreen = screenInfo.screens[i]; - break; - } - } - } - - sprite.screen = pScreen; - sprite.hotPhys.x = x - panoramiXdataPtr[0].x; - sprite.hotPhys.y = y - panoramiXdataPtr[0].y; - x -= panoramiXdataPtr[pScreen->myNum].x; - y -= panoramiXdataPtr[pScreen->myNum].y; - - return (*pScreen->SetCursorPosition)(pScreen, x, y, generateEvent); -} - - -static void -XineramaConstrainCursor(void) -{ - ScreenPtr pScreen = sprite.screen; - BoxRec newBox = sprite.physLimits; - - /* Translate the constraining box to the screen - the sprite is actually on */ - newBox.x1 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; - newBox.x2 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; - newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; - newBox.y2 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; - - (* pScreen->ConstrainCursor)(pScreen, &newBox); -} - -static void -XineramaCheckPhysLimits( - CursorPtr cursor, - Bool generateEvents -){ - HotSpot new; - - if (!cursor) - return; - - new = sprite.hotPhys; - - /* I don't care what the DDX has to say about it */ - sprite.physLimits = sprite.hotLimits; - - /* constrain the pointer to those limits */ - if (new.x < sprite.physLimits.x1) - new.x = sprite.physLimits.x1; - else - if (new.x >= sprite.physLimits.x2) - new.x = sprite.physLimits.x2 - 1; - if (new.y < sprite.physLimits.y1) - new.y = sprite.physLimits.y1; - else - if (new.y >= sprite.physLimits.y2) - new.y = sprite.physLimits.y2 - 1; - - if (sprite.hotShape) /* more work if the shape is a mess */ - ConfineToShape(sprite.hotShape, &new.x, &new.y); - - if((new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y)) - { - XineramaSetCursorPosition (new.x, new.y, generateEvents); - if (!generateEvents) - SyntheticMotion(new.x, new.y); - } - - /* Tell DDX what the limits are */ - XineramaConstrainCursor(); -} - - -static Bool -XineramaSetWindowPntrs(WindowPtr pWin) -{ - if(pWin == WindowTable[0]) { - memcpy(sprite.windows, WindowTable, - PanoramiXNumScreens*sizeof(WindowPtr)); - } else { - PanoramiXRes *win; - int i; - - win = (PanoramiXRes*)LookupIDByType(pWin->drawable.id, XRT_WINDOW); - - if(!win) - return FALSE; - - for(i = 0; i < PanoramiXNumScreens; i++) { - sprite.windows[i] = LookupIDByType(win->info[i].id, RT_WINDOW); - if(!sprite.windows[i]) /* window is being unmapped */ - return FALSE; - } - } - return TRUE; -} - -static void -XineramaCheckVirtualMotion( - QdEventPtr qe, - WindowPtr pWin -){ - - if (qe) - { - sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */ -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = qe->event->u.keyButtonPointer.rootX; -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = qe->event->u.keyButtonPointer.rootY; - pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo : - NullWindow; - } - if (pWin) - { - int x, y, off_x, off_y, i; - BoxRec lims; - - if(!XineramaSetWindowPntrs(pWin)) - return; - - i = PanoramiXNumScreens - 1; - - REGION_COPY(sprite.screen, &sprite.Reg2, - &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - - while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; - - if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y); - - REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2, - &sprite.windows[i]->borderSize); - - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - } - - lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2); - - if (sprite.hot.x < lims.x1) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = lims.x1; - else if (sprite.hot.x >= lims.x2) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = lims.x2 - 1; - if (sprite.hot.y < lims.y1) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = lims.y1; - else if (sprite.hot.y >= lims.y2) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = lims.y2 - 1; - - if (REGION_NUM_RECTS(&sprite.Reg2) > 1) - ConfineToShape(&sprite.Reg2, &sprite.hot.x, &sprite.hot.y); - - if (qe) - { - qe->pScreen = sprite.hot.pScreen; - qe->event->u.keyButtonPointer.rootX = sprite.hot.x; - qe->event->u.keyButtonPointer.rootY = sprite.hot.y; - } - } -} - - -static Bool -XineramaCheckMotion(xEvent *xE) -{ - WindowPtr prevSpriteWin = sprite.win; - - if (xE && !syncEvents.playingEvents) - { - /* Motion events entering DIX get translated to Screen 0 - coordinates. Replayed events have already been - translated since they've entered DIX before */ - XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x - - panoramiXdataPtr[0].x; - XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y - - panoramiXdataPtr[0].y; -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = XE_KBPTR.rootX; -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = XE_KBPTR.rootY; - if (sprite.hot.x < sprite.physLimits.x1) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = sprite.physLimits.x1; - else if (sprite.hot.x >= sprite.physLimits.x2) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = sprite.physLimits.x2 - 1; - if (sprite.hot.y < sprite.physLimits.y1) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = sprite.physLimits.y1; - else if (sprite.hot.y >= sprite.physLimits.y2) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = sprite.physLimits.y2 - 1; - - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); - - sprite.hotPhys = sprite.hot; - if ((sprite.hotPhys.x != XE_KBPTR.rootX) || - (sprite.hotPhys.y != XE_KBPTR.rootY)) - { - XineramaSetCursorPosition( - sprite.hotPhys.x, sprite.hotPhys.y, FALSE); - } - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - } - -#ifdef XEVIE - xeviewin = -#endif - sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); - - if (sprite.win != prevSpriteWin) - { - if (prevSpriteWin != NullWindow) { - if (!xE) - UpdateCurrentTimeIf(); - DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); - } - PostNewCursor(); - return FALSE; - } - return TRUE; -} - - -static void -XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents) -{ - - if (syncEvents.playingEvents) - { - XineramaCheckVirtualMotion((QdEventPtr)NULL, pWin); - SyntheticMotion(sprite.hot.x, sprite.hot.y); - } - else - { - int x, y, off_x, off_y, i; - - if(!XineramaSetWindowPntrs(pWin)) - return; - - i = PanoramiXNumScreens - 1; - - REGION_COPY(sprite.screen, &sprite.Reg1, - &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - - while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; - - if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y); - - REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1, - &sprite.windows[i]->borderSize); - - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - } - - sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1); - - if(REGION_NUM_RECTS(&sprite.Reg1) > 1) - sprite.hotShape = &sprite.Reg1; - else - sprite.hotShape = NullRegion; - - sprite.confined = FALSE; - sprite.confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin; - - XineramaCheckPhysLimits(sprite.current, generateEvents); - } -} - - -static void -XineramaChangeToCursor(CursorPtr cursor) -{ - if (cursor != sprite.current) - { - if ((sprite.current->bits->xhot != cursor->bits->xhot) || - (sprite.current->bits->yhot != cursor->bits->yhot)) - XineramaCheckPhysLimits(cursor, FALSE); - (*sprite.screen->DisplayCursor)(sprite.screen, cursor); - FreeCursor(sprite.current, (Cursor)0); - sprite.current = cursor; - sprite.current->refcnt++; - } -} - - -#endif /* PANORAMIX */ - -void -SetMaskForEvent(Mask mask, int event) -{ - if ((event < LASTEvent) || (event >= 128)) - FatalError("SetMaskForEvent: bogus event number"); - filters[event] = mask; -} - -void -SetCriticalEvent(int event) -{ - if (event >= 128) - FatalError("SetCriticalEvent: bogus event number"); - criticalEvents[event >> 3] |= 1 << (event & 7); -} - -static void -SyntheticMotion(int x, int y) -{ - xEvent xE; - -#ifdef PANORAMIX - /* Translate back to the sprite screen since processInputProc - will translate from sprite screen to screen 0 upon reentry - to the DIX layer */ - if(!noPanoramiXExtension) { - x += panoramiXdataPtr[0].x - panoramiXdataPtr[sprite.screen->myNum].x; - y += panoramiXdataPtr[0].y - panoramiXdataPtr[sprite.screen->myNum].y; - } -#endif - xE.u.keyButtonPointer.rootX = x; - xE.u.keyButtonPointer.rootY = y; - if (syncEvents.playingEvents) - xE.u.keyButtonPointer.time = syncEvents.time.milliseconds; - else - xE.u.keyButtonPointer.time = currentTime.milliseconds; - xE.u.u.type = MotionNotify; - (*inputInfo.pointer->public.processInputProc)(&xE, inputInfo.pointer, 1); -} - -#ifdef SHAPE -static void -ConfineToShape(RegionPtr shape, int *px, int *py) -{ - BoxRec box; - int x = *px, y = *py; - int incx = 1, incy = 1; - - if (POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)) - return; - box = *REGION_EXTENTS(sprite.hot.pScreen, shape); - /* this is rather crude */ - do { - x += incx; - if (x >= box.x2) - { - incx = -1; - x = *px - 1; - } - else if (x < box.x1) - { - incx = 1; - x = *px; - y += incy; - if (y >= box.y2) - { - incy = -1; - y = *py - 1; - } - else if (y < box.y1) - return; /* should never get here! */ - } - } while (!POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)); - *px = x; - *py = y; -} -#endif - -static void -CheckPhysLimits( - CursorPtr cursor, - Bool generateEvents, - Bool confineToScreen, - ScreenPtr pScreen) -{ - HotSpot new; - - if (!cursor) - return; - new = sprite.hotPhys; - if (pScreen) - new.pScreen = pScreen; - else - pScreen = new.pScreen; - (*pScreen->CursorLimits) (pScreen, cursor, &sprite.hotLimits, - &sprite.physLimits); - sprite.confined = confineToScreen; - (* pScreen->ConstrainCursor)(pScreen, &sprite.physLimits); - if (new.x < sprite.physLimits.x1) - new.x = sprite.physLimits.x1; - else - if (new.x >= sprite.physLimits.x2) - new.x = sprite.physLimits.x2 - 1; - if (new.y < sprite.physLimits.y1) - new.y = sprite.physLimits.y1; - else - if (new.y >= sprite.physLimits.y2) - new.y = sprite.physLimits.y2 - 1; -#ifdef SHAPE - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &new.x, &new.y); -#endif - if ((pScreen != sprite.hotPhys.pScreen) || - (new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y)) - { - if (pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys = new; - (*pScreen->SetCursorPosition) (pScreen, new.x, new.y, generateEvents); - if (!generateEvents) - SyntheticMotion(new.x, new.y); - } -} - -static void -CheckVirtualMotion( - register QdEventPtr qe, - register WindowPtr pWin) -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaCheckVirtualMotion(qe, pWin); - return; - } -#endif - if (qe) - { - sprite.hot.pScreen = qe->pScreen; -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = qe->event->u.keyButtonPointer.rootX; -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = qe->event->u.keyButtonPointer.rootY; - pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo : - NullWindow; - } - if (pWin) - { - BoxRec lims; - - if (sprite.hot.pScreen != pWin->drawable.pScreen) - { - sprite.hot.pScreen = pWin->drawable.pScreen; -#ifdef XEVIE - xeviehot.x = xeviehot.y = 0; -#endif - sprite.hot.x = sprite.hot.y = 0; - } - lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize); - if (sprite.hot.x < lims.x1) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = lims.x1; - else if (sprite.hot.x >= lims.x2) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = lims.x2 - 1; - if (sprite.hot.y < lims.y1) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = lims.y1; - else if (sprite.hot.y >= lims.y2) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = lims.y2 - 1; -#ifdef SHAPE - if (wBoundingShape(pWin)) - ConfineToShape(&pWin->borderSize, &sprite.hot.x, &sprite.hot.y); -#endif - if (qe) - { - qe->pScreen = sprite.hot.pScreen; - qe->event->u.keyButtonPointer.rootX = sprite.hot.x; - qe->event->u.keyButtonPointer.rootY = sprite.hot.y; - } - } - ROOT = WindowTable[sprite.hot.pScreen->myNum]; -} - -static void -ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaConfineCursorToWindow(pWin, generateEvents); - return; - } -#endif - - if (syncEvents.playingEvents) - { - CheckVirtualMotion((QdEventPtr)NULL, pWin); - SyntheticMotion(sprite.hot.x, sprite.hot.y); - } - else - { - sprite.hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize); -#ifdef SHAPE - sprite.hotShape = wBoundingShape(pWin) ? &pWin->borderSize - : NullRegion; -#endif - CheckPhysLimits(sprite.current, generateEvents, confineToScreen, - pScreen); - } -} - -Bool -PointerConfinedToScreen() -{ - return sprite.confined; -} - -static void -ChangeToCursor(CursorPtr cursor) -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaChangeToCursor(cursor); - return; - } -#endif - - if (cursor != sprite.current) - { - if ((sprite.current->bits->xhot != cursor->bits->xhot) || - (sprite.current->bits->yhot != cursor->bits->yhot)) - CheckPhysLimits(cursor, FALSE, sprite.confined, - (ScreenPtr)NULL); - (*sprite.hotPhys.pScreen->DisplayCursor) (sprite.hotPhys.pScreen, - cursor); - FreeCursor(sprite.current, (Cursor)0); - sprite.current = cursor; - sprite.current->refcnt++; - } -} - -/* returns true if b is a descendent of a */ -Bool -IsParent(register WindowPtr a, register WindowPtr b) -{ - for (b = b->parent; b; b = b->parent) - if (b == a) return TRUE; - return FALSE; -} - -static void -PostNewCursor(void) -{ - register WindowPtr win; - register GrabPtr grab = inputInfo.pointer->grab; - - if (syncEvents.playingEvents) - return; - if (grab) - { - if (grab->cursor) - { - ChangeToCursor(grab->cursor); - return; - } - if (IsParent(grab->window, sprite.win)) - win = sprite.win; - else - win = grab->window; - } - else - win = sprite.win; - for (; win; win = win->parent) - if (win->optional && win->optional->cursor != NullCursor) - { - ChangeToCursor(win->optional->cursor); - return; - } -} - -WindowPtr -GetCurrentRootWindow() -{ - return ROOT; -} - -WindowPtr -GetSpriteWindow() -{ - return sprite.win; -} - -CursorPtr -GetSpriteCursor() -{ - return sprite.current; -} - -void -GetSpritePosition(int *px, int *py) -{ - *px = sprite.hotPhys.x; - *py = sprite.hotPhys.y; -} - -#ifdef PANORAMIX -int -XineramaGetCursorScreen() -{ - if(!noPanoramiXExtension) { - return sprite.screen->myNum; - } else { - return 0; - } -} -#endif /* PANORAMIX */ - -#define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ - -static void -MonthChangedOrBadTime(register xEvent *xE) -{ - /* If the ddx/OS is careless about not processing timestamped events from - * different sources in sorted order, then it's possible for time to go - * backwards when it should not. Here we ensure a decent time. - */ - if ((currentTime.milliseconds - XE_KBPTR.time) > TIMESLOP) - currentTime.months++; - else - XE_KBPTR.time = currentTime.milliseconds; -} - -#define NoticeTime(xE) { \ - if ((xE)->u.keyButtonPointer.time < currentTime.milliseconds) \ - MonthChangedOrBadTime(xE); \ - currentTime.milliseconds = (xE)->u.keyButtonPointer.time; \ - lastDeviceEventTime = currentTime; } - -void -NoticeEventTime(register xEvent *xE) -{ - if (!syncEvents.playingEvents) - NoticeTime(xE); -} - -/************************************************************************** - * The following procedures deal with synchronous events * - **************************************************************************/ - -void -EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) -{ - register QdEventPtr tail = *syncEvents.pendtail; - register QdEventPtr qe; - xEvent *qxE; - - NoticeTime(xE); - -#ifdef XKB - /* Fix for key repeating bug. */ - if (device->key != NULL && device->key->xkbInfo != NULL && - xE->u.u.type == KeyRelease) - AccessXCancelRepeatKey(device->key->xkbInfo, xE->u.u.detail); -#endif - - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - /* The RECORD spec says that the root window field of motion events - * must be valid. At this point, it hasn't been filled in yet, so - * we do it here. The long expression below is necessary to get - * the current root window; the apparently reasonable alternative - * GetCurrentRootWindow()->drawable.id doesn't give you the right - * answer on the first motion event after a screen change because - * the data that GetCurrentRootWindow relies on hasn't been - * updated yet. - */ - if (xE->u.u.type == MotionNotify) - XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - if (xE->u.u.type == MotionNotify) - { -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x - - panoramiXdataPtr[0].x; - XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y - - panoramiXdataPtr[0].y; - } -#endif - sprite.hotPhys.x = XE_KBPTR.rootX; - sprite.hotPhys.y = XE_KBPTR.rootY; - /* do motion compression */ - if (tail && - (tail->event->u.u.type == MotionNotify) && - (tail->pScreen == sprite.hotPhys.pScreen)) - { - tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x; - tail->event->u.keyButtonPointer.rootY = sprite.hotPhys.y; - tail->event->u.keyButtonPointer.time = XE_KBPTR.time; - tail->months = currentTime.months; - return; - } - } - qe = (QdEventPtr)xalloc(sizeof(QdEventRec) + (count * sizeof(xEvent))); - if (!qe) - return; - qe->next = (QdEventPtr)NULL; - qe->device = device; - qe->pScreen = sprite.hotPhys.pScreen; - qe->months = currentTime.months; - qe->event = (xEvent *)(qe + 1); - qe->evcount = count; - for (qxE = qe->event; --count >= 0; qxE++, xE++) - *qxE = *xE; - if (tail) - syncEvents.pendtail = &tail->next; - *syncEvents.pendtail = qe; -} - -static void -PlayReleasedEvents(void) -{ - register QdEventPtr *prev, qe; - register DeviceIntPtr dev; - - prev = &syncEvents.pending; - while ( (qe = *prev) ) - { - if (!qe->device->sync.frozen) - { - *prev = qe->next; - if (*syncEvents.pendtail == *prev) - syncEvents.pendtail = prev; - if (qe->event->u.u.type == MotionNotify) - CheckVirtualMotion(qe, NullWindow); - syncEvents.time.months = qe->months; - syncEvents.time.milliseconds = qe->event->u.keyButtonPointer.time; -#ifdef PANORAMIX - /* Translate back to the sprite screen since processInputProc - will translate from sprite screen to screen 0 upon reentry - to the DIX layer */ - if(!noPanoramiXExtension) { - qe->event->u.keyButtonPointer.rootX += - panoramiXdataPtr[0].x - - panoramiXdataPtr[sprite.screen->myNum].x; - qe->event->u.keyButtonPointer.rootY += - panoramiXdataPtr[0].y - - panoramiXdataPtr[sprite.screen->myNum].y; - } -#endif - (*qe->device->public.processInputProc)(qe->event, qe->device, - qe->evcount); - xfree(qe); - for (dev = inputInfo.devices; dev && dev->sync.frozen; dev = dev->next) - ; - if (!dev) - break; - /* Playing the event may have unfrozen another device. */ - /* So to play it safe, restart at the head of the queue */ - prev = &syncEvents.pending; - } - else - prev = &qe->next; - } -} - -static void -FreezeThaw(register DeviceIntPtr dev, Bool frozen) -{ - dev->sync.frozen = frozen; - if (frozen) - dev->public.processInputProc = dev->public.enqueueInputProc; - else - dev->public.processInputProc = dev->public.realInputProc; -} - -void -ComputeFreezes() -{ - register DeviceIntPtr replayDev = syncEvents.replayDev; - register int i; - WindowPtr w; - register xEvent *xE; - int count; - GrabPtr grab; - register DeviceIntPtr dev; - - for (dev = inputInfo.devices; dev; dev = dev->next) - FreezeThaw(dev, dev->sync.other || (dev->sync.state >= FROZEN)); - if (syncEvents.playingEvents || (!replayDev && !syncEvents.pending)) - return; - syncEvents.playingEvents = TRUE; - if (replayDev) - { - xE = replayDev->sync.event; - count = replayDev->sync.evcount; - syncEvents.replayDev = (DeviceIntPtr)NULL; - - w = XYToWindow( XE_KBPTR.rootX, XE_KBPTR.rootY); - for (i = 0; i < spriteTraceGood; i++) - { - if (syncEvents.replayWin == spriteTrace[i]) - { - if (!CheckDeviceGrabs(replayDev, xE, i+1, count)) { - if (replayDev->focus) - DeliverFocusedEvent(replayDev, xE, w, count); - else - DeliverDeviceEvents(w, xE, NullGrab, NullWindow, - replayDev, count); - } - goto playmore; - } - } - /* must not still be in the same stack */ - if (replayDev->focus) - DeliverFocusedEvent(replayDev, xE, w, count); - else - DeliverDeviceEvents(w, xE, NullGrab, NullWindow, replayDev, count); - } -playmore: - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (!dev->sync.frozen) - { - PlayReleasedEvents(); - break; - } - } - syncEvents.playingEvents = FALSE; - /* the following may have been skipped during replay, so do it now */ - if ((grab = inputInfo.pointer->grab) && grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } - else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); - PostNewCursor(); -} - -#ifdef RANDR -void -ScreenRestructured (ScreenPtr pScreen) -{ - GrabPtr grab; - - if ((grab = inputInfo.pointer->grab) && grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } - else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); -} -#endif - -void -CheckGrabForSyncs(register DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) -{ - register GrabPtr grab = thisDev->grab; - register DeviceIntPtr dev; - - if (thisMode == GrabModeSync) - thisDev->sync.state = FROZEN_NO_EVENT; - else - { /* free both if same client owns both */ - thisDev->sync.state = THAWED; - if (thisDev->sync.other && - (CLIENT_BITS(thisDev->sync.other->resource) == - CLIENT_BITS(grab->resource))) - thisDev->sync.other = NullGrab; - } - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev != thisDev) - { - if (otherMode == GrabModeSync) - dev->sync.other = grab; - else - { /* free both if same client owns both */ - if (dev->sync.other && - (CLIENT_BITS(dev->sync.other->resource) == - CLIENT_BITS(grab->resource))) - dev->sync.other = NullGrab; - } - } - } - ComputeFreezes(); -} - -void -ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, - TimeStamp time, Bool autoGrab) -{ - WindowPtr oldWin = (mouse->grab) ? mouse->grab->window - : sprite.win; - - if (grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, FALSE, TRUE); - } - DoEnterLeaveEvents(oldWin, grab->window, NotifyGrab); - mouse->valuator->motionHintWindow = NullWindow; - if (syncEvents.playingEvents) - mouse->grabTime = syncEvents.time; - else - mouse->grabTime = time; - if (grab->cursor) - grab->cursor->refcnt++; - mouse->activeGrab = *grab; - mouse->grab = &mouse->activeGrab; - mouse->fromPassiveGrab = autoGrab; - PostNewCursor(); - CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode); - - #ifdef NXAGENT_SERVER - - /* - * If grab is synchronous, events are delivered to clients only if they send - * an AllowEvent request. If mode field in AllowEvent request is SyncPointer, the - * delivered event is saved in a queue and replayed later, when grab is released. - * We should export sync grab to X as async in order to avoid events to be - * queued twice, in the agent and in the X server. This solution have a drawback: - * replayed events are not delivered to that application that are not clients of - * the agent. - * A different solution could be to make the grab asynchronous in the agent and - * to export it as synchronous. But this seems to be less safe. - * - * To make internal grab asynchronous, change previous line as follows. - * - * if (nxagentOption(Rootless)) - * { - * CheckGrabForSyncs(mouse, GrabModeAsync, (Bool)grab->keyboardMode); - * } - * else - * { - * CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode); - * } - */ - - if (nxagentOption(Rootless) == 1) - { - /* - * FIXME: We should use the correct value - * for the cursor. Temporarily we set it - * to None. - */ - - int resource = nxagentWaitForResource(NXGetCollectGrabPointerResource, - nxagentCollectGrabPointerPredicate); - - NXCollectGrabPointer(nxagentDisplay, resource, nxagentWindow(grab -> window), - 1, grab -> eventMask & PointerGrabMask, - GrabModeAsync, GrabModeAsync, (grab -> confineTo) ? - nxagentWindow(grab -> confineTo) : None, - None, CurrentTime); - } - - #endif -} - -void -DeactivatePointerGrab(register DeviceIntPtr mouse) -{ - register GrabPtr grab = mouse->grab; - register DeviceIntPtr dev; - - mouse->valuator->motionHintWindow = NullWindow; - mouse->grab = NullGrab; - mouse->sync.state = NOT_GRABBED; - mouse->fromPassiveGrab = FALSE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->sync.other == grab) - dev->sync.other = NullGrab; - } - DoEnterLeaveEvents(grab->window, sprite.win, NotifyUngrab); - if (grab->confineTo) - ConfineCursorToWindow(ROOT, FALSE, FALSE); - PostNewCursor(); - if (grab->cursor) - FreeCursor(grab->cursor, (Cursor)0); - ComputeFreezes(); - - #ifdef NXAGENT_SERVER - - if (nxagentOption(Rootless) == 1) - { - XUngrabPointer(nxagentDisplay, CurrentTime); - - if (sprite.win == ROOT) - { - mouse -> button -> state &= - ~(Button1Mask | Button2Mask | Button3Mask | - Button4Mask | Button5Mask); - } - } - - #endif -} - -void -ActivateKeyboardGrab(register DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive) -{ - WindowPtr oldWin; - - if (keybd->grab) - oldWin = keybd->grab->window; - else if (keybd->focus) - oldWin = keybd->focus->win; - else - oldWin = sprite.win; - if (oldWin == FollowKeyboardWin) - oldWin = inputInfo.keyboard->focus->win; - if (keybd->valuator) - keybd->valuator->motionHintWindow = NullWindow; - DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab); - if (syncEvents.playingEvents) - keybd->grabTime = syncEvents.time; - else - keybd->grabTime = time; - keybd->activeGrab = *grab; - keybd->grab = &keybd->activeGrab; - keybd->fromPassiveGrab = passive; - CheckGrabForSyncs(keybd, (Bool)grab->keyboardMode, (Bool)grab->pointerMode); -} - -void -DeactivateKeyboardGrab(register DeviceIntPtr keybd) -{ - register GrabPtr grab = keybd->grab; - register DeviceIntPtr dev; - register WindowPtr focusWin = keybd->focus ? keybd->focus->win - : sprite.win; - - if (focusWin == FollowKeyboardWin) - focusWin = inputInfo.keyboard->focus->win; - if (keybd->valuator) - keybd->valuator->motionHintWindow = NullWindow; - keybd->grab = NullGrab; - keybd->sync.state = NOT_GRABBED; - keybd->fromPassiveGrab = FALSE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->sync.other == grab) - dev->sync.other = NullGrab; - } - DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab); - ComputeFreezes(); -} - -void -AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState) -{ - Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced; - TimeStamp grabTime; - register DeviceIntPtr dev; - - thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client); - thisSynced = FALSE; - otherGrabbed = FALSE; - othersFrozen = TRUE; - grabTime = thisDev->grabTime; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - if (dev->grab && SameClient(dev->grab, client)) - { - if (!(thisGrabbed || otherGrabbed) || - (CompareTimeStamps(dev->grabTime, grabTime) == LATER)) - grabTime = dev->grabTime; - otherGrabbed = TRUE; - if (thisDev->sync.other == dev->grab) - thisSynced = TRUE; - if (dev->sync.state < FROZEN) - othersFrozen = FALSE; - } - else if (!dev->sync.other || !SameClient(dev->sync.other, client)) - othersFrozen = FALSE; - } - if (!((thisGrabbed && thisDev->sync.state >= FROZEN) || thisSynced)) - return; - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, grabTime) == EARLIER)) - return; - switch (newState) - { - case THAWED: /* Async */ - if (thisGrabbed) - thisDev->sync.state = THAWED; - if (thisSynced) - thisDev->sync.other = NullGrab; - ComputeFreezes(); - break; - case FREEZE_NEXT_EVENT: /* Sync */ - if (thisGrabbed) - { - thisDev->sync.state = FREEZE_NEXT_EVENT; - if (thisSynced) - thisDev->sync.other = NullGrab; - ComputeFreezes(); - } - break; - case THAWED_BOTH: /* AsyncBoth */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = THAWED; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - case FREEZE_BOTH_NEXT_EVENT: /* SyncBoth */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = FREEZE_BOTH_NEXT_EVENT; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - case NOT_GRABBED: /* Replay */ - if (thisGrabbed && thisDev->sync.state == FROZEN_WITH_EVENT) - { - if (thisSynced) - thisDev->sync.other = NullGrab; - syncEvents.replayDev = thisDev; - syncEvents.replayWin = thisDev->grab->window; - (*thisDev->DeactivateGrab)(thisDev); - syncEvents.replayDev = (DeviceIntPtr)NULL; - } - break; - case THAW_OTHERS: /* AsyncOthers */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = THAWED; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - } -} - -int -ProcAllowEvents(register ClientPtr client) -{ - TimeStamp time; - DeviceIntPtr mouse = inputInfo.pointer; - DeviceIntPtr keybd = inputInfo.keyboard; - REQUEST(xAllowEventsReq); - - REQUEST_SIZE_MATCH(xAllowEventsReq); - time = ClientTimeToServerTime(stuff->time); - switch (stuff->mode) - { - case ReplayPointer: - AllowSome(client, time, mouse, NOT_GRABBED); - break; - case SyncPointer: - AllowSome(client, time, mouse, FREEZE_NEXT_EVENT); - break; - case AsyncPointer: - AllowSome(client, time, mouse, THAWED); - break; - case ReplayKeyboard: - AllowSome(client, time, keybd, NOT_GRABBED); - break; - case SyncKeyboard: - AllowSome(client, time, keybd, FREEZE_NEXT_EVENT); - break; - case AsyncKeyboard: - AllowSome(client, time, keybd, THAWED); - break; - case SyncBoth: - AllowSome(client, time, keybd, FREEZE_BOTH_NEXT_EVENT); - break; - case AsyncBoth: - AllowSome(client, time, keybd, THAWED_BOTH); - break; - default: - client->errorValue = stuff->mode; - return BadValue; - } - - /* - * This is not necessary if we export grab to X as asynchronous. - * - * if (nxagentOption(Rootless) && stuff -> mode != ReplayKeyboard && - * stuff -> mode != SyncKeyboard && stuff -> mode != AsyncKeyboard) - * { - * XAllowEvents(nxagentDisplay, stuff -> mode, CurrentTime); - * } - */ - - return Success; -} - -void -ReleaseActiveGrabs(ClientPtr client) -{ - register DeviceIntPtr dev; - Bool done; - - /* XXX CloseDownClient should remove passive grabs before - * releasing active grabs. - */ - do { - done = TRUE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - { - (*dev->DeactivateGrab)(dev); - done = FALSE; - } - } - } while (!done); -} - -/************************************************************************** - * The following procedures deal with delivering events * - **************************************************************************/ - -int -TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, - Mask filter, GrabPtr grab) -{ - int i; - int type; - -#ifdef NX_DEBUG_INPUT - if (grab && nxagentDebugInput && grab->window) - { - fprintf(stderr, "TryClientEvents: Grab window is [0x%x].\n", - (unsigned int)grab->window->drawable.id); - if (!SameClient(grab, client)) - fprintf(stderr, "TryClientEvents: Events are going to be " - "discarded.\n"); - } -#endif -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - fprintf(stderr, "Event([%d, %d], mask=0x%x), client=%d", - pEvents->u.u.type, pEvents->u.u.detail, (unsigned int)mask, - client->index); -#else - if (debug_events) ErrorF( - "Event([%d, %d], mask=0x%x), client=%d", - pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); -#endif -#endif - if ((client) && (client != serverClient) && (!client->clientGone) && - ((filter == CantBeFiltered) || (mask & filter))) - { - if (grab && !SameClient(grab, client)) - return -1; /* don't send, but notify caller */ - type = pEvents->u.u.type; - if (type == MotionNotify) - { - if (mask & PointerMotionHintMask) - { - if (WID(inputInfo.pointer->valuator->motionHintWindow) == - pEvents->u.keyButtonPointer.event) - { -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - { - fprintf(stderr,"\nmotionHintWindow == keyButtonPointer.event\n"); - } -#else - if (debug_events) ErrorF("\n"); - fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); -#endif -#endif - return 1; /* don't send, but pretend we did */ - } - pEvents->u.u.detail = NotifyHint; - } - else - { - pEvents->u.u.detail = NotifyNormal; - } - } -#ifdef XINPUT - else - { - if ((type == DeviceMotionNotify) && - MaybeSendDeviceMotionNotifyHint - ((deviceKeyButtonPointer*)pEvents, mask) != 0) - return 1; - } -#endif - type &= 0177; - if (type != KeymapNotify) - { - /* all extension events must have a sequence number */ - for (i = 0; i < count; i++) - pEvents[i].u.u.sequenceNumber = client->sequence; - } - - if (BitIsOn(criticalEvents, type)) - { -#ifdef SMART_SCHEDULE - if (client->smart_priority < SMART_MAX_PRIORITY) - client->smart_priority++; -#endif - SetCriticalOutputPending(); - } - - WriteEventsToClient(client, count, pEvents); -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - fprintf(stderr, " delivered\n"); -#else - if (debug_events) ErrorF( " delivered\n"); -#endif -#endif - return 1; - } - else - { -#if defined(DEBUG) || defined(NX_DEBUG_INPUT) -#ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - fprintf(stderr, "\n"); -#else - if (debug_events) ErrorF("\n"); -#endif -#endif - return 0; - } -} - -int -DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, - Mask filter, GrabPtr grab, int mskidx) -{ - int deliveries = 0, nondeliveries = 0; - int attempt; - register InputClients *other; - ClientPtr client = NullClient; - Mask deliveryMask = 0; /* If a grab occurs due to a button press, then - this mask is the mask of the grab. */ - int type = pEvents->u.u.type; - - /* CantBeFiltered means only window owner gets the event */ - if ((filter == CantBeFiltered) || !(type & EXTENSION_EVENT_BASE)) - { - /* if nobody ever wants to see this event, skip some work */ - if (filter != CantBeFiltered && - !((wOtherEventMasks(pWin)|pWin->eventMask) & filter)) - return 0; - if ( (attempt = TryClientEvents(wClient(pWin), pEvents, count, - pWin->eventMask, filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = wClient(pWin); - deliveryMask = pWin->eventMask; - } else - nondeliveries--; - } - } - if (filter != CantBeFiltered) - { - if (type & EXTENSION_EVENT_BASE) - { - OtherInputMasks *inputMasks; - - inputMasks = wOtherInputMasks(pWin); - if (!inputMasks || - !(inputMasks->inputEvents[mskidx] & filter)) - return 0; - other = inputMasks->inputClients; - } - else - other = (InputClients *)wOtherClients(pWin); - for (; other; other = other->next) - { - if ( (attempt = TryClientEvents(rClient(other), pEvents, count, - other->mask[mskidx], filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = rClient(other); - deliveryMask = other->mask[mskidx]; - } else - nondeliveries--; - } - } - } - if ((type == ButtonPress) && deliveries && (!grab)) - { - GrabRec tempGrab; - - tempGrab.device = inputInfo.pointer; - tempGrab.resource = client->clientAsMask; - tempGrab.window = pWin; - tempGrab.ownerEvents = (deliveryMask & OwnerGrabButtonMask) ? TRUE : FALSE; - tempGrab.eventMask = deliveryMask; - tempGrab.keyboardMode = GrabModeAsync; - tempGrab.pointerMode = GrabModeAsync; - tempGrab.confineTo = NullWindow; - tempGrab.cursor = NullCursor; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "DeliverEventsToWindow: Activating passive grab on pointer.\n"); - } - #endif - (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab, - currentTime, TRUE); - } - else if ((type == MotionNotify) && deliveries) - inputInfo.pointer->valuator->motionHintWindow = pWin; -#ifdef XINPUT - else - { - if (((type == DeviceMotionNotify) -#ifdef XKB - || (type == DeviceButtonPress) -#endif - ) && deliveries) - CheckDeviceGrabAndHintWindow (pWin, type, - (deviceKeyButtonPointer*) pEvents, - grab, client, deliveryMask); - } -#endif - if (deliveries) - return deliveries; - return nondeliveries; -} - -/* If the event goes to dontClient, don't send it and return 0. if - send works, return 1 or if send didn't work, return 2. - Only works for core events. -*/ - -#ifdef PANORAMIX -static int -XineramaTryClientEventsResult( - ClientPtr client, - GrabPtr grab, - Mask mask, - Mask filter -){ - if ((client) && (client != serverClient) && (!client->clientGone) && - ((filter == CantBeFiltered) || (mask & filter))) - { - if (grab && !SameClient(grab, client)) return -1; - else return 1; - } - return 0; -} -#endif - -int -MaybeDeliverEventsToClient(register WindowPtr pWin, xEvent *pEvents, - int count, Mask filter, ClientPtr dontClient) -{ - register OtherClients *other; - - - if (pWin->eventMask & filter) - { - if (wClient(pWin) == dontClient) - return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return XineramaTryClientEventsResult( - wClient(pWin), NullGrab, pWin->eventMask, filter); -#endif - return TryClientEvents(wClient(pWin), pEvents, count, - pWin->eventMask, filter, NullGrab); - } - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->mask & filter) - { - if (SameClient(other, dontClient)) - return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return XineramaTryClientEventsResult( - rClient(other), NullGrab, other->mask, filter); -#endif - return TryClientEvents(rClient(other), pEvents, count, - other->mask, filter, NullGrab); - } - } - return 2; -} - -static void -FixUpEventFromWindow( - xEvent *xE, - WindowPtr pWin, - Window child, - Bool calcChild) -{ - if (calcChild) - { - WindowPtr w=spriteTrace[spriteTraceGood-1]; - /* If the search ends up past the root should the child field be - set to none or should the value in the argument be passed - through. It probably doesn't matter since everyone calls - this function with child == None anyway. */ - - while (w) - { - /* If the source window is same as event window, child should be - none. Don't bother going all all the way back to the root. */ - - if (w == pWin) - { - child = None; - break; - } - - if (w->parent == pWin) - { - child = w->drawable.id; - break; - } - w = w->parent; - } - } - XE_KBPTR.root = ROOT->drawable.id; - XE_KBPTR.event = pWin->drawable.id; - if (sprite.hot.pScreen == pWin->drawable.pScreen) - { - XE_KBPTR.sameScreen = xTrue; - XE_KBPTR.child = child; - XE_KBPTR.eventX = - XE_KBPTR.rootX - pWin->drawable.x; - XE_KBPTR.eventY = - XE_KBPTR.rootY - pWin->drawable.y; - } - else - { - XE_KBPTR.sameScreen = xFalse; - XE_KBPTR.child = None; - XE_KBPTR.eventX = 0; - XE_KBPTR.eventY = 0; - } -} - -int -DeliverDeviceEvents(register WindowPtr pWin, register xEvent *xE, GrabPtr grab, - register WindowPtr stopAt, DeviceIntPtr dev, int count) -{ - Window child = None; - int type = xE->u.u.type; - Mask filter = filters[type]; - int deliveries = 0; - - if (type & EXTENSION_EVENT_BASE) - { - register OtherInputMasks *inputMasks; - int mskidx = dev->id; - - inputMasks = wOtherInputMasks(pWin); - if (inputMasks && !(filter & inputMasks->deliverableEvents[mskidx])) - return 0; - while (pWin) - { - if (inputMasks && (inputMasks->inputEvents[mskidx] & filter)) - { - FixUpEventFromWindow(xE, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(pWin, xE, count, filter, - grab, mskidx); - if (deliveries > 0) - return deliveries; - } - if ((deliveries < 0) || - (pWin == stopAt) || - (inputMasks && - (filter & inputMasks->dontPropagateMask[mskidx]))) - return 0; - child = pWin->drawable.id; - pWin = pWin->parent; - if (pWin) - inputMasks = wOtherInputMasks(pWin); - } - } - else - { - if (!(filter & pWin->deliverableEvents)) - return 0; - while (pWin) - { - if ((wOtherEventMasks(pWin)|pWin->eventMask) & filter) - { - FixUpEventFromWindow(xE, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(pWin, xE, count, filter, - grab, 0); - if (deliveries > 0) - return deliveries; - } - if ((deliveries < 0) || - (pWin == stopAt) || - (filter & wDontPropagateMask(pWin))) - return 0; - child = pWin->drawable.id; - pWin = pWin->parent; - } - } - return 0; -} - -/* not useful for events that propagate up the tree or extension events */ -int -DeliverEvents(register WindowPtr pWin, register xEvent *xE, int count, - register WindowPtr otherParent) -{ - Mask filter; - int deliveries; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return count; -#endif - - if (!count) - return 0; - filter = filters[xE->u.u.type]; - if ((filter & SubstructureNotifyMask) && (xE->u.u.type != CreateNotify)) - xE->u.destroyNotify.event = pWin->drawable.id; - if (filter != StructureAndSubMask) - return DeliverEventsToWindow(pWin, xE, count, filter, NullGrab, 0); - deliveries = DeliverEventsToWindow(pWin, xE, count, StructureNotifyMask, - NullGrab, 0); - if (pWin->parent) - { - xE->u.destroyNotify.event = pWin->parent->drawable.id; - deliveries += DeliverEventsToWindow(pWin->parent, xE, count, - SubstructureNotifyMask, NullGrab, - 0); - if (xE->u.u.type == ReparentNotify) - { - xE->u.destroyNotify.event = otherParent->drawable.id; - deliveries += DeliverEventsToWindow(otherParent, xE, count, - SubstructureNotifyMask, - NullGrab, 0); - } - } - return deliveries; -} - - -static Bool -PointInBorderSize(WindowPtr pWin, int x, int y) -{ - BoxRec box; - - if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box)) - return TRUE; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { - int i; - - for(i = 1; i < PanoramiXNumScreens; i++) { - if(POINT_IN_REGION(sprite.screen, - &sprite.windows[i]->borderSize, - x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x, - y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y, - &box)) - return TRUE; - } - } -#endif - return FALSE; -} - -static WindowPtr -XYToWindow(int x, int y) -{ - register WindowPtr pWin; - BoxRec box; - - spriteTraceGood = 1; /* root window still there */ - - if (nxagentOption(Rootless)) - { - if (nxagentLastEnteredWindow == NULL) - { - return ROOT; - } - - pWin = ROOT->lastChild; - - while (pWin && pWin != ROOT->firstChild && pWin != nxagentLastEnteredWindow) - { - pWin = pWin->prevSib; - } - } - else - { - pWin = ROOT->firstChild; - } - - while (pWin) - { - if ((pWin->mapped) && - (x >= pWin->drawable.x - wBorderWidth (pWin)) && - (x < pWin->drawable.x + (int)pWin->drawable.width + - wBorderWidth(pWin)) && - (y >= pWin->drawable.y - wBorderWidth (pWin)) && - (y < pWin->drawable.y + (int)pWin->drawable.height + - wBorderWidth (pWin)) -#ifdef SHAPE - /* When a window is shaped, a further check - * is made to see if the point is inside - * borderSize - */ - && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y)) - && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - wInputShape(pWin), - x - pWin->drawable.x, - y - pWin->drawable.y, &box)) -#endif - ) - { - if (spriteTraceGood >= spriteTraceSize) - { - spriteTraceSize += 10; - Must_have_memory = TRUE; /* XXX */ - spriteTrace = (WindowPtr *)xrealloc( - spriteTrace, spriteTraceSize*sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ - } - spriteTrace[spriteTraceGood++] = pWin; - pWin = pWin->firstChild; - } - else - pWin = pWin->nextSib; - } - return spriteTrace[spriteTraceGood-1]; -} - -static Bool -CheckMotion(xEvent *xE) -{ - WindowPtr prevSpriteWin = sprite.win; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return XineramaCheckMotion(xE); -#endif - - if (xE && !syncEvents.playingEvents) - { - if (sprite.hot.pScreen != sprite.hotPhys.pScreen) - { - sprite.hot.pScreen = sprite.hotPhys.pScreen; - ROOT = WindowTable[sprite.hot.pScreen->myNum]; - } -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = XE_KBPTR.rootX; -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = XE_KBPTR.rootY; - if (sprite.hot.x < sprite.physLimits.x1) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = sprite.physLimits.x1; - else if (sprite.hot.x >= sprite.physLimits.x2) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = sprite.physLimits.x2 - 1; - if (sprite.hot.y < sprite.physLimits.y1) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = sprite.physLimits.y1; - else if (sprite.hot.y >= sprite.physLimits.y2) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = sprite.physLimits.y2 - 1; -#ifdef SHAPE - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); -#endif - sprite.hotPhys = sprite.hot; - - /* - * This code force cursor position to be inside the - * root window of the agent. We can't view a reason - * to do this and it interacts in an undesirable way - * with toggling fullscreen. - * - * if ((sprite.hotPhys.x != XE_KBPTR.rootX) || - * (sprite.hotPhys.y != XE_KBPTR.rootY)) - * { - * (*sprite.hotPhys.pScreen->SetCursorPosition)( - * sprite.hotPhys.pScreen, - * sprite.hotPhys.x, sprite.hotPhys.y, FALSE); - * } - */ - - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - } - -#ifdef XEVIE - xeviewin = -#endif - sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); -#ifdef notyet - if (!(sprite.win->deliverableEvents & - Motion_Filter(inputInfo.pointer->button)) - !syncEvents.playingEvents) - { - /* XXX Do PointerNonInterestBox here */ - } -#endif - if (sprite.win != prevSpriteWin) - { - if (prevSpriteWin != NullWindow) { - if (!xE) - UpdateCurrentTimeIf(); - DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); - } - PostNewCursor(); - return FALSE; - } - return TRUE; -} - -void -WindowsRestructured() -{ - (void) CheckMotion((xEvent *)NULL); -} - -#ifdef PANORAMIX -/* This was added to support reconfiguration under Xdmx. The problem is - * that if the 0th screen (i.e., WindowTable[0]) is moved to an origin - * other than 0,0, the information in the private sprite structure must - * be updated accordingly, or XYToWindow (and other routines) will not - * compute correctly. */ -void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) -{ - ScreenPtr pScreen = win->drawable.pScreen; - GrabPtr grab; - - if (noPanoramiXExtension) return; - - sprite.hot.x -= xoff; - sprite.hot.y -= yoff; - - sprite.hotPhys.x -= xoff; - sprite.hotPhys.y -= yoff; - - sprite.hotLimits.x1 -= xoff; - sprite.hotLimits.y1 -= yoff; - sprite.hotLimits.x2 -= xoff; - sprite.hotLimits.y2 -= yoff; - - if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg1)) - REGION_TRANSLATE(sprite.screen, &sprite.Reg1, xoff, yoff); - if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg2)) - REGION_TRANSLATE(sprite.screen, &sprite.Reg2, xoff, yoff); - - /* FIXME: if we call ConfineCursorToWindow, must we do anything else? */ - if ((grab = inputInfo.pointer->grab) && grab->confineTo) { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); -} -#endif - -void -DefineInitialRootWindow(register WindowPtr win) -{ - register ScreenPtr pScreen = win->drawable.pScreen; - #ifdef VIEWPORT_FRAME - extern void nxagentInitViewportFrame(ScreenPtr, WindowPtr); - #endif - extern int nxagentShadowInit(ScreenPtr, WindowPtr); - - sprite.hotPhys.pScreen = pScreen; - sprite.hotPhys.x = pScreen->width / 2; - sprite.hotPhys.y = pScreen->height / 2; - sprite.hot = sprite.hotPhys; - sprite.hotLimits.x2 = pScreen->width; - sprite.hotLimits.y2 = pScreen->height; -#ifdef XEVIE - xeviewin = -#endif - sprite.win = win; - sprite.current = wCursor (win); - sprite.current->refcnt++; - spriteTraceGood = 1; - ROOT = win; - (*pScreen->CursorLimits) ( - pScreen, sprite.current, &sprite.hotLimits, &sprite.physLimits); - sprite.confined = FALSE; - (*pScreen->ConstrainCursor) (pScreen, &sprite.physLimits); - (*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE); - (*pScreen->DisplayCursor) (pScreen, sprite.current); - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - sprite.hotLimits.x1 = -panoramiXdataPtr[0].x; - sprite.hotLimits.y1 = -panoramiXdataPtr[0].y; - sprite.hotLimits.x2 = PanoramiXPixWidth - panoramiXdataPtr[0].x; - sprite.hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y; - sprite.physLimits = sprite.hotLimits; - sprite.confineWin = NullWindow; -#ifdef SHAPE - sprite.hotShape = NullRegion; -#endif - sprite.screen = pScreen; - /* gotta UNINIT these someplace */ - REGION_NULL(pScreen, &sprite.Reg1); - REGION_NULL(pScreen, &sprite.Reg2); - } -#endif - - #ifdef VIEWPORT_FRAME - nxagentInitViewportFrame(pScreen, win); - #endif - - if (nxagentOption(Shadow)) - { - if (nxagentShadowInit(pScreen, win) == -1) - { - FatalError("Failed to connect to display '%s'", nxagentShadowDisplayName); - } - } -} - -/* - * This does not take any shortcuts, and even ignores its argument, since - * it does not happen very often, and one has to walk up the tree since - * this might be a newly instantiated cursor for an intermediate window - * between the one the pointer is in and the one that the last cursor was - * instantiated from. - */ -void -WindowHasNewCursor(WindowPtr pWin) -{ - PostNewCursor(); -} - -void -NewCurrentScreen(ScreenPtr newScreen, int x, int y) -{ - sprite.hotPhys.x = x; - sprite.hotPhys.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - sprite.hotPhys.x += panoramiXdataPtr[newScreen->myNum].x - - panoramiXdataPtr[0].x; - sprite.hotPhys.y += panoramiXdataPtr[newScreen->myNum].y - - panoramiXdataPtr[0].y; - if (newScreen != sprite.screen) { - sprite.screen = newScreen; - /* Make sure we tell the DDX to update its copy of the screen */ - if(sprite.confineWin) - XineramaConfineCursorToWindow(sprite.confineWin, TRUE); - else - XineramaConfineCursorToWindow(WindowTable[0], TRUE); - /* if the pointer wasn't confined, the DDX won't get - told of the pointer warp so we reposition it here */ - if(!syncEvents.playingEvents) - (*sprite.screen->SetCursorPosition)(sprite.screen, - sprite.hotPhys.x + panoramiXdataPtr[0].x - - panoramiXdataPtr[sprite.screen->myNum].x, - sprite.hotPhys.y + panoramiXdataPtr[0].y - - panoramiXdataPtr[sprite.screen->myNum].y, FALSE); - } - } else -#endif - if (newScreen != sprite.hotPhys.pScreen) - ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE); -} - -#ifdef PANORAMIX - -static Bool -XineramaPointInWindowIsVisible( - WindowPtr pWin, - int x, - int y -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - BoxRec box; - int i, xoff, yoff; - - if (!pWin->realized) return FALSE; - - if (POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) - return TRUE; - - if(!XineramaSetWindowPntrs(pWin)) return FALSE; - - xoff = x + panoramiXdataPtr[0].x; - yoff = y + panoramiXdataPtr[0].y; - - for(i = 1; i < PanoramiXNumScreens; i++) { - pWin = sprite.windows[i]; - pScreen = pWin->drawable.pScreen; - x = xoff - panoramiXdataPtr[i].x; - y = yoff - panoramiXdataPtr[i].y; - - if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box) - && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - wInputShape(pWin), - x - pWin->drawable.x, - y - pWin->drawable.y, &box))) - return TRUE; - - } - - return FALSE; -} - -static int -XineramaWarpPointer(ClientPtr client) -{ - WindowPtr dest = NULL; - int x, y; - - REQUEST(xWarpPointerReq); - - - if (stuff->dstWid != None) - { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); - if (!dest) - return BadWindow; - } - x = sprite.hotPhys.x; - y = sprite.hotPhys.y; - - if (stuff->srcWid != None) - { - int winX, winY; - XID winID = stuff->srcWid; - WindowPtr source; - - source = SecurityLookupWindow(winID, client, SecurityReadAccess); - if (!source) return BadWindow; - - winX = source->drawable.x; - winY = source->drawable.y; - if(source == WindowTable[0]) { - winX -= panoramiXdataPtr[0].x; - winY -= panoramiXdataPtr[0].y; - } - if (x < winX + stuff->srcX || - y < winY + stuff->srcY || - (stuff->srcWidth != 0 && - winX + stuff->srcX + (int)stuff->srcWidth < x) || - (stuff->srcHeight != 0 && - winY + stuff->srcY + (int)stuff->srcHeight < y) || - !XineramaPointInWindowIsVisible(source, x, y)) - return Success; - } - if (dest) { - x = dest->drawable.x; - y = dest->drawable.y; - if(dest == WindowTable[0]) { - x -= panoramiXdataPtr[0].x; - y -= panoramiXdataPtr[0].y; - } - } - - x += stuff->dstX; - y += stuff->dstY; - - if (x < sprite.physLimits.x1) - x = sprite.physLimits.x1; - else if (x >= sprite.physLimits.x2) - x = sprite.physLimits.x2 - 1; - if (y < sprite.physLimits.y1) - y = sprite.physLimits.y1; - else if (y >= sprite.physLimits.y2) - y = sprite.physLimits.y2 - 1; - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &x, &y); - - XineramaSetCursorPosition(x, y, TRUE); - - return Success; -} - -#endif - - -int -ProcWarpPointer(ClientPtr client) -{ - WindowPtr dest = NULL; - int x, y; - ScreenPtr newScreen; - - REQUEST(xWarpPointerReq); - - REQUEST_SIZE_MATCH(xWarpPointerReq); - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return XineramaWarpPointer(client); -#endif - - if (stuff->dstWid != None) - { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); - if (!dest) - return BadWindow; - } - x = sprite.hotPhys.x; - y = sprite.hotPhys.y; - - if (stuff->srcWid != None) - { - int winX, winY; - XID winID = stuff->srcWid; - WindowPtr source; - - source = SecurityLookupWindow(winID, client, SecurityReadAccess); - if (!source) return BadWindow; - - winX = source->drawable.x; - winY = source->drawable.y; - if (source->drawable.pScreen != sprite.hotPhys.pScreen || - x < winX + stuff->srcX || - y < winY + stuff->srcY || - (stuff->srcWidth != 0 && - winX + stuff->srcX + (int)stuff->srcWidth < x) || - (stuff->srcHeight != 0 && - winY + stuff->srcY + (int)stuff->srcHeight < y) || - !PointInWindowIsVisible(source, x, y)) - return Success; - } - if (dest) - { - x = dest->drawable.x; - y = dest->drawable.y; - newScreen = dest->drawable.pScreen; - } else - newScreen = sprite.hotPhys.pScreen; - - x += stuff->dstX; - y += stuff->dstY; - - if (x < 0) - x = 0; - else if (x >= newScreen->width) - x = newScreen->width - 1; - if (y < 0) - y = 0; - else if (y >= newScreen->height) - y = newScreen->height - 1; - - if (newScreen == sprite.hotPhys.pScreen) - { - if (x < sprite.physLimits.x1) - x = sprite.physLimits.x1; - else if (x >= sprite.physLimits.x2) - x = sprite.physLimits.x2 - 1; - if (y < sprite.physLimits.y1) - y = sprite.physLimits.y1; - else if (y >= sprite.physLimits.y2) - y = sprite.physLimits.y2 - 1; -#if defined(SHAPE) - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &x, &y); -#endif - (*newScreen->SetCursorPosition)(newScreen, x, y, TRUE); - } - else if (!PointerConfinedToScreen()) - { - NewCurrentScreen(newScreen, x, y); - } - return Success; -} - -static Bool -BorderSizeNotEmpty(WindowPtr pWin) -{ - if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize)) - return TRUE; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { - int i; - - for(i = 1; i < PanoramiXNumScreens; i++) { - if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize)) - return TRUE; - } - } -#endif - return FALSE; -} - -/* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a - passive grab set on the window to be activated. */ - -static Bool -CheckPassiveGrabsOnWindow( - WindowPtr pWin, - register DeviceIntPtr device, - register xEvent *xE, - int count) -{ - register GrabPtr grab = wPassiveGrabs(pWin); - GrabRec tempGrab; - register xEvent *dxE; - - if (!grab) - return FALSE; - tempGrab.window = pWin; - tempGrab.device = device; - tempGrab.type = xE->u.u.type; - tempGrab.detail.exact = xE->u.u.detail; - tempGrab.detail.pMask = NULL; - tempGrab.modifiersDetail.pMask = NULL; - for (; grab; grab = grab->next) - { -#ifdef XKB - DeviceIntPtr gdev; - XkbSrvInfoPtr xkbi; - - gdev= grab->modifierDevice; - xkbi= gdev->key->xkbInfo; -#endif - tempGrab.modifierDevice = grab->modifierDevice; - if ((device == grab->modifierDevice) && - ((xE->u.u.type == KeyPress) -#if defined(XINPUT) && defined(XKB) - || (xE->u.u.type == DeviceKeyPress) -#endif - )) - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension?gdev->key->prev_state:xkbi->state.grab_mods); -#else - grab->modifierDevice->key->prev_state; -#endif - else - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension ? gdev->key->state : xkbi->state.grab_mods); -#else - grab->modifierDevice->key->state; -#endif - if (GrabMatchesSecond(&tempGrab, grab) && - (!grab->confineTo || - (grab->confineTo->realized && - BorderSizeNotEmpty(grab->confineTo)))) - { -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(wClient(pWin), device, FALSE)) - return FALSE; -#endif -#ifdef XKB - if (!noXkbExtension) { - XE_KBPTR.state &= 0x1f00; - XE_KBPTR.state |= - tempGrab.modifiersDetail.exact&(~0x1f00); - } -#endif - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "CheckPassiveGrabsOnWindow: Activating passive grab on %s.\n", - device == inputInfo.keyboard ? "keyboard" : "pointer"); - } - #endif - (*device->ActivateGrab)(device, grab, currentTime, TRUE); - - FixUpEventFromWindow(xE, grab->window, None, TRUE); - - (void) TryClientEvents(rClient(grab), xE, count, - filters[xE->u.u.type], - filters[xE->u.u.type], grab); - - if (device->sync.state == FROZEN_NO_EVENT) - { - if (device->sync.evcount < count) - { - Must_have_memory = TRUE; /* XXX */ - device->sync.event = (xEvent *)xrealloc(device->sync.event, - count* - sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ - } - device->sync.evcount = count; - for (dxE = device->sync.event; --count >= 0; dxE++, xE++) - *dxE = *xE; - device->sync.state = FROZEN_WITH_EVENT; - } - return TRUE; - } - } - return FALSE; -} - -/** -"CheckDeviceGrabs" handles both keyboard and pointer events that may cause -a passive grab to be activated. If the event is a keyboard event, the -ancestors of the focus window are traced down and tried to see if they have -any passive grabs to be activated. If the focus window itself is reached and -it's descendants contain they pointer, the ancestors of the window that the -pointer is in are then traced down starting at the focus window, otherwise no -grabs are activated. If the event is a pointer event, the ancestors of the -window that the pointer is in are traced down starting at the root until -CheckPassiveGrabs causes a passive grab to activate or all the windows are -tried. PRH -*/ - -Bool -CheckDeviceGrabs(register DeviceIntPtr device, register xEvent *xE, - int checkFirst, int count) -{ - register int i; - register WindowPtr pWin = NULL; - register FocusClassPtr focus = device->focus; - - if (((xE->u.u.type == ButtonPress) -#if defined(XINPUT) && defined(XKB) - || (xE->u.u.type == DeviceButtonPress) -#endif - ) && (device->button->buttonsDown != 1)) - return FALSE; - - i = checkFirst; - - if (focus) - { - for (; i < focus->traceGood; i++) - { - pWin = focus->trace[i]; - if (pWin->optional && - CheckPassiveGrabsOnWindow(pWin, device, xE, count)) - return TRUE; - } - - if ((focus->win == NoneWin) || - (i >= spriteTraceGood) || - ((i > checkFirst) && (pWin != spriteTrace[i-1]))) - return FALSE; - } - - for (; i < spriteTraceGood; i++) - { - pWin = spriteTrace[i]; - if (pWin->optional && - CheckPassiveGrabsOnWindow(pWin, device, xE, count)) - return TRUE; - } - - return FALSE; -} - -void -DeliverFocusedEvent(DeviceIntPtr keybd, xEvent *xE, WindowPtr window, int count) -{ - WindowPtr focus = keybd->focus->win; - int mskidx = 0; - - if (focus == FollowKeyboardWin) - focus = inputInfo.keyboard->focus->win; - if (!focus) - return; - if (focus == PointerRootWin) - { - DeliverDeviceEvents(window, xE, NullGrab, NullWindow, keybd, count); - return; - } - if ((focus == window) || IsParent(focus, window)) - { - if (DeliverDeviceEvents(window, xE, NullGrab, focus, keybd, count)) - return; - } - /* just deliver it to the focus window */ - FixUpEventFromWindow(xE, focus, None, FALSE); - if (xE->u.u.type & EXTENSION_EVENT_BASE) - mskidx = keybd->id; - (void)DeliverEventsToWindow(focus, xE, count, filters[xE->u.u.type], - NullGrab, mskidx); -} - -void -DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev, - Bool deactivateGrab, int count) -{ - register GrabPtr grab = thisDev->grab; - int deliveries = 0; - register DeviceIntPtr dev; - register xEvent *dxE; - - if (grab->ownerEvents) - { - WindowPtr focus; - - if (thisDev->focus) - { - focus = thisDev->focus->win; - if (focus == FollowKeyboardWin) - focus = inputInfo.keyboard->focus->win; - } - else - focus = PointerRootWin; - if (focus == PointerRootWin) - deliveries = DeliverDeviceEvents(sprite.win, xE, grab, NullWindow, - thisDev, count); - else if (focus && (focus == sprite.win || IsParent(focus, sprite.win))) - deliveries = DeliverDeviceEvents(sprite.win, xE, grab, focus, - thisDev, count); - else if (focus) - deliveries = DeliverDeviceEvents(focus, xE, grab, focus, - thisDev, count); - } - if (!deliveries) - { - FixUpEventFromWindow(xE, grab->window, None, TRUE); - deliveries = TryClientEvents(rClient(grab), xE, count, - (Mask)grab->eventMask, - filters[xE->u.u.type], grab); - if (deliveries && (xE->u.u.type == MotionNotify -#ifdef XINPUT - || xE->u.u.type == DeviceMotionNotify -#endif - )) - thisDev->valuator->motionHintWindow = grab->window; - } - if (deliveries && !deactivateGrab && (xE->u.u.type != MotionNotify -#ifdef XINPUT - && xE->u.u.type != DeviceMotionNotify -#endif - )) - switch (thisDev->sync.state) - { - case FREEZE_BOTH_NEXT_EVENT: - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - FreezeThaw(dev, TRUE); - if ((dev->sync.state == FREEZE_BOTH_NEXT_EVENT) && - (CLIENT_BITS(dev->grab->resource) == - CLIENT_BITS(thisDev->grab->resource))) - dev->sync.state = FROZEN_NO_EVENT; - else - dev->sync.other = thisDev->grab; - } - /* fall through */ - case FREEZE_NEXT_EVENT: - thisDev->sync.state = FROZEN_WITH_EVENT; - FreezeThaw(thisDev, TRUE); - if (thisDev->sync.evcount < count) - { - Must_have_memory = TRUE; /* XXX */ - thisDev->sync.event = (xEvent *)xrealloc(thisDev->sync.event, - count*sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ - } - thisDev->sync.evcount = count; - for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++) - *dxE = *xE; - break; - } -} - -void -#ifdef XKB -CoreProcessKeyboardEvent (register xEvent *xE, register DeviceIntPtr keybd, int count) -#else -ProcessKeyboardEvent (register xEvent *xE, register DeviceIntPtr keybd, int count) -#endif -{ - int key, bit; - register BYTE *kptr; - register int i; - register CARD8 modifiers; - register CARD16 mask; - GrabPtr grab = keybd->grab; - Bool deactivateGrab = FALSE; - register KeyClassPtr keyc = keybd->key; -#ifdef XEVIE - static Window rootWin = 0; - - if(!xeviegrabState && xevieFlag && clients[xevieClientIndex] && - (xevieMask & xevieFilters[xE->u.u.type])) { - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); - if((xE->u.u.type == KeyPress && (*kptr & bit)) || - (xE->u.u.type == KeyRelease && !(*kptr & bit))) - {} else { -#ifdef XKB - if(!noXkbExtension) - xevieKBEventSent = 1; -#endif - if(!xevieKBEventSent) - { - xeviekb = keybd; - if(!rootWin) { - rootWin = GetCurrentRootWindow()->drawable.id; - } - xE->u.keyButtonPointer.event = xeviewin->drawable.id; - xE->u.keyButtonPointer.root = rootWin; - xE->u.keyButtonPointer.child = (xeviewin->firstChild) ? xeviewin->firstChild-> -drawable.id:0; - xE->u.keyButtonPointer.rootX = xeviehot.x; - xE->u.keyButtonPointer.rootY = xeviehot.y; - xE->u.keyButtonPointer.state = keyc->state; - WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); -#ifdef XKB - if(noXkbExtension) -#endif - return; - } else { - xevieKBEventSent = 0; - } - } - } -#endif - - if (!syncEvents.playingEvents) - { - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - } -#ifdef XEVIE - /* fix for bug5094030: don't change the state bit if the event is from XEvIE client */ - if(!(!xeviegrabState && xevieFlag && clients[xevieClientIndex] && - (xevieMask & xevieFilters[xE->u.u.type] -#ifdef XKB - && !noXkbExtension -#endif - ))) -#endif - XE_KBPTR.state = (keyc->state | inputInfo.pointer->button->state); - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); - modifiers = keyc->modifierMap[key]; -#if defined(XKB) && defined(XEVIE) - if(!noXkbExtension && !xeviegrabState && - xevieFlag && clients[xevieClientIndex] && - (xevieMask & xevieFilters[xE->u.u.type])) { - switch(xE->u.u.type) { - case KeyPress: *kptr &= ~bit; break; - case KeyRelease: *kptr |= bit; break; - } - } -#endif - -#ifdef DEBUG - if ((xkbDebugFlags&0x4)&& - ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { - ErrorF("CoreProcessKbdEvent: Key %d %s\n",key, - (xE->u.u.type==KeyPress?"down":"up")); - } -#endif - switch (xE->u.u.type) - { - case KeyPress: - if (*kptr & bit) /* allow ddx to generate multiple downs */ - { - if (!modifiers) - { - xE->u.u.type = KeyRelease; - (*keybd->public.processInputProc)(xE, keybd, count); - xE->u.u.type = KeyPress; - /* release can have side effects, don't fall through */ - (*keybd->public.processInputProc)(xE, keybd, count); - } - return; - } - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr |= bit; - keyc->prev_state = keyc->state; - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) - { - /* This key affects modifier "i" */ - keyc->modifierKeyCount[i]++; - keyc->state |= mask; - modifiers &= ~mask; - } - } - if (!grab && CheckDeviceGrabs(keybd, xE, 0, count)) - { - keybd->activatingKey = key; - return; - } - break; - case KeyRelease: - if (!(*kptr & bit)) /* guard against duplicates */ - return; - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr &= ~bit; - keyc->prev_state = keyc->state; - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) { - /* This key affects modifier "i" */ - if (--keyc->modifierKeyCount[i] <= 0) { - keyc->state &= ~mask; - keyc->modifierKeyCount[i] = 0; - } - modifiers &= ~mask; - } - } - if (keybd->fromPassiveGrab && (key == keybd->activatingKey)) - deactivateGrab = TRUE; - break; - default: - FatalError("Impossible keyboard event"); - } - if (grab) - DeliverGrabbedEvent(xE, keybd, deactivateGrab, count); - else - DeliverFocusedEvent(keybd, xE, sprite.win, count); - if (deactivateGrab) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcessKeyboardEvent: Deactivating grab on keyboard.\n"); - } - #endif - (*keybd->DeactivateGrab)(keybd); - #ifdef NX_DEBUG_INPUT - } - #endif -} - -#ifdef XKB -/* This function is used to set the key pressed or key released state - - this is only used when the pressing of keys does not cause - CoreProcessKeyEvent to be called, as in for example Mouse Keys. -*/ -void -FixKeyState (register xEvent *xE, register DeviceIntPtr keybd) -{ - int key, bit; - register BYTE *kptr; - register KeyClassPtr keyc = keybd->key; - - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); -#ifdef DEBUG - if ((xkbDebugFlags&0x4)&& - ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { - ErrorF("FixKeyState: Key %d %s\n",key, - (xE->u.u.type==KeyPress?"down":"up")); - } -#endif - switch (xE->u.u.type) - { - case KeyPress: - *kptr |= bit; - break; - case KeyRelease: - *kptr &= ~bit; - break; - default: - FatalError("Impossible keyboard event"); - } -} -#endif - -void -#ifdef XKB -CoreProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count) -#else -ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count) -#endif -{ - register GrabPtr grab = mouse->grab; - Bool deactivateGrab = FALSE; - register ButtonClassPtr butc = mouse->button; -#ifdef XKB - XkbSrvInfoPtr xkbi; - - xkbi = inputInfo.keyboard->key->xkbInfo; -#endif -#ifdef XEVIE - if(xevieFlag && clients[xevieClientIndex] && !xeviegrabState && - (xevieMask & xevieFilters[xE->u.u.type])) { - if(xevieEventSent) - xevieEventSent = 0; - else { - xeviemouse = mouse; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: Going to send XEVIE event.\n"); - } - #endif - WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); - return; - } - } -#endif - - if (!syncEvents.playingEvents) - NoticeTime(xE) - XE_KBPTR.state = (butc->state | ( -#ifdef XKB - (noXkbExtension ? - inputInfo.keyboard->key->state : - xkbi->state.grab_mods) -#else - inputInfo.keyboard->key->state -#endif - )); - { - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - /* see comment in EnqueueEvents regarding the next three lines */ - if (xE->u.u.type == MotionNotify) - XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - } - if (xE->u.u.type != MotionNotify) - { - register int key; - register BYTE *kptr; - int bit; - - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - - key = xE->u.u.detail; - kptr = &butc->down[key >> 3]; - bit = 1 << (key & 7); - switch (xE->u.u.type) - { - case ButtonPress: - mouse->valuator->motionHintWindow = NullWindow; - if (!(*kptr & bit)) - butc->buttonsDown++; - butc->motionMask = ButtonMotionMask; - *kptr |= bit; -#if !defined(XFree86Server) || !defined(XINPUT) - xE->u.u.detail = butc->map[key]; -#endif - #ifdef NX_DEBUG_INPUT - if (xE->u.u.detail == 0) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" - " for ButtonPress.\n"); - } - return; - } - #else - if (xE->u.u.detail == 0) - return; - #endif - if (xE->u.u.detail <= 5) - butc->state |= (Button1Mask >> 1) << xE->u.u.detail; - filters[MotionNotify] = Motion_Filter(butc); - if (!grab) - #ifdef NX_DEBUG_INPUT - if (CheckDeviceGrabs(mouse, xE, 0, count)) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: CheckDeviceGrabs" - " returned True for ButtonPress.\n"); - } - return; - } - #else - if (CheckDeviceGrabs(mouse, xE, 0, count)) - return; - #endif - break; - case ButtonRelease: - mouse->valuator->motionHintWindow = NullWindow; - if (*kptr & bit) - --butc->buttonsDown; - if (!butc->buttonsDown) - butc->motionMask = 0; - *kptr &= ~bit; -#if !defined(XFree86Server) || !defined(XINPUT) - xE->u.u.detail = butc->map[key]; -#endif - #ifdef NX_DEBUG_INPUT - if (xE->u.u.detail == 0) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" - " for ButtonRelease.\n"); - } - return; - } - #else - if (xE->u.u.detail == 0) - return; - #endif - if (xE->u.u.detail <= 5) - butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); - filters[MotionNotify] = Motion_Filter(butc); - if (!butc->state && mouse->fromPassiveGrab) - deactivateGrab = TRUE; - break; - default: - FatalError("bogus pointer event from ddx"); - } - } - #ifdef NX_DEBUG_INPUT - else if (!CheckMotion(xE)) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: CheckMotion returned False" - " for MotionNotify.\n"); - } - return; - } - if (grab) - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: Going to deliver grabbed " - "events (count = %d).\n", count); - } - DeliverGrabbedEvent(xE, mouse, deactivateGrab, count); - } - else - { - if (nxagentDebugInput == 1) - { - fprintf(stderr, "ProcessPointerEvent: Going to deliver device " - "events (count = %d).\n", count); - } - DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, - mouse, count); - } - #else - else if (!CheckMotion(xE)) - return; - if (grab) - DeliverGrabbedEvent(xE, mouse, deactivateGrab, count); - else - DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, - mouse, count); - #endif - if (deactivateGrab) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcessPointerEvent: Deactivating grab on pointer.\n"); - } - #endif - (*mouse->DeactivateGrab)(mouse); - #ifdef NX_DEBUG_INPUT - } - #endif -} - -#define AtMostOneClient \ - (SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask) - -void -RecalculateDeliverableEvents(pWin) - register WindowPtr pWin; -{ - register OtherClients *others; - register WindowPtr pChild; - - pChild = pWin; - while (1) - { - if (pChild->optional) - { - pChild->optional->otherEventMasks = 0; - for (others = wOtherClients(pChild); others; others = others->next) - { - pChild->optional->otherEventMasks |= others->mask; - } - } - pChild->deliverableEvents = pChild->eventMask| - wOtherEventMasks(pChild); - if (pChild->parent) - pChild->deliverableEvents |= - (pChild->parent->deliverableEvents & - ~wDontPropagateMask(pChild) & PropagateMask); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } -} - -/** - * - * \param value must conform to DeleteType - */ -int -OtherClientGone(pointer value, XID id) -{ - register OtherClientsPtr other, prev; - register WindowPtr pWin = (WindowPtr)value; - - prev = 0; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->resource == id) - { - if (prev) - prev->next = other->next; - else - { - if (!(pWin->optional->otherClients = other->next)) - CheckWindowOptionalNeed (pWin); - } - xfree(other); - RecalculateDeliverableEvents(pWin); - return(Success); - } - prev = other; - } - FatalError("client not on event list"); - /*NOTREACHED*/ - return -1; /* make compiler happy */ -} - -int -EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask mask) -{ - Mask check; - OtherClients * others; - - if (mask & ~AllEventMasks) - { - client->errorValue = mask; - return BadValue; - } - check = (mask & AtMostOneClient); - if (check & (pWin->eventMask|wOtherEventMasks(pWin))) - { /* It is illegal for two different - clients to select on any of the - events for AtMostOneClient. However, - it is OK, for some client to - continue selecting on one of those - events. */ - if ((wClient(pWin) != client) && (check & pWin->eventMask)) - return BadAccess; - for (others = wOtherClients (pWin); others; others = others->next) - { - if (!SameClient(others, client) && (check & others->mask)) - return BadAccess; - } - } - if (wClient (pWin) == client) - { - check = pWin->eventMask; -#ifdef SGIMISC - pWin->eventMask = - (mask & ~SGIMiscSpecialDestroyMask) | (pWin->eventMask & SGIMiscSpecialDestroyMask); -#else - pWin->eventMask = mask; -#endif - } - else - { - for (others = wOtherClients (pWin); others; others = others->next) - { - if (SameClient(others, client)) - { - check = others->mask; -#ifdef SGIMISC - mask = (mask & ~SGIMiscSpecialDestroyMask) | (others->mask & SGIMiscSpecialDestroyMask); -#endif - if (mask == 0) - { - FreeResource(others->resource, RT_NONE); - return Success; - } - else - others->mask = mask; - goto maskSet; - } - } - check = 0; - if (!pWin->optional && !MakeWindowOptional (pWin)) - return BadAlloc; - others = (OtherClients *) xalloc(sizeof(OtherClients)); - if (!others) - return BadAlloc; - others->mask = mask; - others->resource = FakeClientID(client->index); - others->next = pWin->optional->otherClients; - pWin->optional->otherClients = others; - if (!AddResource(others->resource, RT_OTHERCLIENT, (pointer)pWin)) - return BadAlloc; - } -maskSet: - if ((inputInfo.pointer->valuator->motionHintWindow == pWin) && - (mask & PointerMotionHintMask) && - !(check & PointerMotionHintMask) && - !inputInfo.pointer->grab) - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - RecalculateDeliverableEvents(pWin); - return Success; -} - -int -EventSuppressForWindow(register WindowPtr pWin, register ClientPtr client, - Mask mask, Bool *checkOptional) -{ - register int i, free; - - if ((mask & ~PropagateMask) && !permitOldBugs) - { - client->errorValue = mask; - return BadValue; - } - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]--; - if (!mask) - i = 0; - else - { - for (i = DNPMCOUNT, free = 0; --i > 0; ) - { - if (!DontPropagateRefCnts[i]) - free = i; - else if (mask == DontPropagateMasks[i]) - break; - } - if (!i && free) - { - i = free; - DontPropagateMasks[i] = mask; - } - } - if (i || !mask) - { - pWin->dontPropagate = i; - if (i) - DontPropagateRefCnts[i]++; - if (pWin->optional) - { - pWin->optional->dontPropagateMask = mask; - *checkOptional = TRUE; - } - } - else - { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]++; - return BadAlloc; - } - pWin->dontPropagate = 0; - pWin->optional->dontPropagateMask = mask; - } - RecalculateDeliverableEvents(pWin); - return Success; -} - -static WindowPtr -CommonAncestor( - register WindowPtr a, - register WindowPtr b) -{ - for (b = b->parent; b; b = b->parent) - if (IsParent(b, a)) return b; - return NullWindow; -} - -static void -EnterLeaveEvent( - int type, - int mode, - int detail, - register WindowPtr pWin, - Window child) -{ - xEvent event; - register DeviceIntPtr keybd = inputInfo.keyboard; - WindowPtr focus; - register DeviceIntPtr mouse = inputInfo.pointer; - register GrabPtr grab = mouse->grab; - Mask mask; - - if ((pWin == mouse->valuator->motionHintWindow) && - (detail != NotifyInferior)) - mouse->valuator->motionHintWindow = NullWindow; - if (grab) - { - mask = (pWin == grab->window) ? grab->eventMask : 0; - if (grab->ownerEvents) - mask |= EventMaskForClient(pWin, rClient(grab)); - } - else - { - mask = pWin->eventMask | wOtherEventMasks(pWin); - } - if (mask & filters[type]) - { - event.u.u.type = type; - event.u.u.detail = detail; - event.u.enterLeave.time = currentTime.milliseconds; - event.u.enterLeave.rootX = sprite.hot.x; - event.u.enterLeave.rootY = sprite.hot.y; - /* Counts on the same initial structure of crossing & button events! */ - FixUpEventFromWindow(&event, pWin, None, FALSE); - /* Enter/Leave events always set child */ - event.u.enterLeave.child = child; - event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ? - ELFlagSameScreen : 0; -#ifdef XKB - if (!noXkbExtension) { - event.u.enterLeave.state = mouse->button->state & 0x1f00; - event.u.enterLeave.state |= - XkbGrabStateFromRec(&keybd->key->xkbInfo->state); - } else -#endif - event.u.enterLeave.state = keybd->key->state | mouse->button->state; - event.u.enterLeave.mode = mode; - focus = keybd->focus->win; - if ((focus != NoneWin) && - ((pWin == focus) || (focus == PointerRootWin) || - IsParent(focus, pWin))) - event.u.enterLeave.flags |= ELFlagFocus; - if (grab) - (void)TryClientEvents(rClient(grab), &event, 1, mask, - filters[type], grab); - else - (void)DeliverEventsToWindow(pWin, &event, 1, filters[type], - NullGrab, 0); - } - if ((type == EnterNotify) && (mask & KeymapStateMask)) - { - xKeymapEvent ke; - -#ifdef XCSECURITY - ClientPtr client = grab ? rClient(grab) - : clients[CLIENT_ID(pWin->drawable.id)]; - if (!SecurityCheckDeviceAccess(client, keybd, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } - else -#endif - memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31); - ke.type = KeymapNotify; - if (grab) - (void)TryClientEvents(rClient(grab), (xEvent *)&ke, 1, mask, - KeymapStateMask, grab); - else - (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1, - KeymapStateMask, NullGrab, 0); - } -} - -static void -EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail) -{ - WindowPtr parent = child->parent; - - if (ancestor == parent) - return; - EnterNotifies(ancestor, parent, mode, detail); - EnterLeaveEvent(EnterNotify, mode, detail, parent, child->drawable.id); -} - -static void -LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail) -{ - register WindowPtr pWin; - - if (ancestor == child) - return; - for (pWin = child->parent; pWin != ancestor; pWin = pWin->parent) - { - EnterLeaveEvent(LeaveNotify, mode, detail, pWin, child->drawable.id); - child = pWin; - } -} - -static void -DoEnterLeaveEvents(WindowPtr fromWin, WindowPtr toWin, int mode) -{ - if (fromWin == toWin) - return; - if (IsParent(fromWin, toWin)) - { - EnterLeaveEvent(LeaveNotify, mode, NotifyInferior, fromWin, None); - EnterNotifies(fromWin, toWin, mode, NotifyVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyAncestor, toWin, None); - } - else if (IsParent(toWin, fromWin)) - { - EnterLeaveEvent(LeaveNotify, mode, NotifyAncestor, fromWin, None); - LeaveNotifies(fromWin, toWin, mode, NotifyVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyInferior, toWin, None); - } - else - { /* neither fromWin nor toWin is descendent of the other */ - WindowPtr common = CommonAncestor(toWin, fromWin); - /* common == NullWindow ==> different screens */ - EnterLeaveEvent(LeaveNotify, mode, NotifyNonlinear, fromWin, None); - LeaveNotifies(fromWin, common, mode, NotifyNonlinearVirtual); - EnterNotifies(common, toWin, mode, NotifyNonlinearVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyNonlinear, toWin, None); - } -} - -static void -FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin) -{ - xEvent event; - -#ifdef XINPUT - if (dev != inputInfo.keyboard) - { - DeviceFocusEvent(dev, type, mode, detail, pWin); - return; - } -#endif - event.u.focus.mode = mode; - event.u.u.type = type; - event.u.u.detail = detail; - event.u.focus.window = pWin->drawable.id; - (void)DeliverEventsToWindow(pWin, &event, 1, filters[type], NullGrab, - 0); - if ((type == FocusIn) && - ((pWin->eventMask | wOtherEventMasks(pWin)) & KeymapStateMask)) - { - xKeymapEvent ke; -#ifdef XCSECURITY - ClientPtr client = clients[CLIENT_ID(pWin->drawable.id)]; - if (!SecurityCheckDeviceAccess(client, dev, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } - else -#endif - memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31); - ke.type = KeymapNotify; - (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1, - KeymapStateMask, NullGrab, 0); - } -} - - /* - * recursive because it is easier - * no-op if child not descended from ancestor - */ -static Bool -FocusInEvents( - DeviceIntPtr dev, - WindowPtr ancestor, WindowPtr child, WindowPtr skipChild, - int mode, int detail, - Bool doAncestor) -{ - if (child == NullWindow) - return ancestor == NullWindow; - if (ancestor == child) - { - if (doAncestor) - FocusEvent(dev, FocusIn, mode, detail, child); - return TRUE; - } - if (FocusInEvents(dev, ancestor, child->parent, skipChild, mode, detail, - doAncestor)) - { - if (child != skipChild) - FocusEvent(dev, FocusIn, mode, detail, child); - return TRUE; - } - return FALSE; -} - -/* dies horribly if ancestor is not an ancestor of child */ -static void -FocusOutEvents( - DeviceIntPtr dev, - WindowPtr child, WindowPtr ancestor, - int mode, int detail, - Bool doAncestor) -{ - register WindowPtr pWin; - - for (pWin = child; pWin != ancestor; pWin = pWin->parent) - FocusEvent(dev, FocusOut, mode, detail, pWin); - if (doAncestor) - FocusEvent(dev, FocusOut, mode, detail, ancestor); -} - -void -DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode) -{ - int out, in; /* for holding details for to/from - PointerRoot/None */ - int i; - - if (fromWin == toWin) - return; - out = (fromWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; - in = (toWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; - /* wrong values if neither, but then not referenced */ - - if ((toWin == NullWindow) || (toWin == PointerRootWin)) - { - if ((fromWin == NullWindow) || (fromWin == PointerRootWin)) - { - if (fromWin == PointerRootWin) - FocusOutEvents(dev, sprite.win, ROOT, mode, NotifyPointer, - TRUE); - /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusOut, mode, out, WindowTable[0]); - else -#endif - for (i=0; iparent, NullWindow, mode, - NotifyNonlinearVirtual, FALSE); - } - /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusIn, mode, in, WindowTable[0]); - else -#endif - for (i=0; iparent != NullWindow) - (void)FocusInEvents(dev, ROOT, toWin, toWin, mode, - NotifyNonlinearVirtual, TRUE); - FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin); - if (IsParent(toWin, sprite.win)) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, mode, - NotifyPointer, FALSE); - } - else - { - if (IsParent(toWin, fromWin)) - { - FocusEvent(dev, FocusOut, mode, NotifyAncestor, fromWin); - FocusOutEvents(dev, fromWin->parent, toWin, mode, - NotifyVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyInferior, toWin); - if ((IsParent(toWin, sprite.win)) && - (sprite.win != fromWin) && - (!IsParent(fromWin, sprite.win)) && - (!IsParent(sprite.win, fromWin))) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, - mode, NotifyPointer, FALSE); - } - else - if (IsParent(fromWin, toWin)) - { - if ((IsParent(fromWin, sprite.win)) && - (sprite.win != fromWin) && - (!IsParent(toWin, sprite.win)) && - (!IsParent(sprite.win, toWin))) - FocusOutEvents(dev, sprite.win, fromWin, mode, - NotifyPointer, FALSE); - FocusEvent(dev, FocusOut, mode, NotifyInferior, fromWin); - (void)FocusInEvents(dev, fromWin, toWin, toWin, mode, - NotifyVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyAncestor, toWin); - } - else - { - /* neither fromWin or toWin is child of other */ - WindowPtr common = CommonAncestor(toWin, fromWin); - /* common == NullWindow ==> different screens */ - if (IsParent(fromWin, sprite.win)) - FocusOutEvents(dev, sprite.win, fromWin, mode, - NotifyPointer, FALSE); - FocusEvent(dev, FocusOut, mode, NotifyNonlinear, fromWin); - if (fromWin->parent != NullWindow) - FocusOutEvents(dev, fromWin->parent, common, mode, - NotifyNonlinearVirtual, FALSE); - if (toWin->parent != NullWindow) - (void)FocusInEvents(dev, common, toWin, toWin, mode, - NotifyNonlinearVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin); - if (IsParent(toWin, sprite.win)) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, - mode, NotifyPointer, FALSE); - } - } - } -} - -int -SetInputFocus( - ClientPtr client, - DeviceIntPtr dev, - Window focusID, - CARD8 revertTo, - Time ctime, - Bool followOK) -{ - register FocusClassPtr focus; - register WindowPtr focusWin; - int mode; - TimeStamp time; - - UpdateCurrentTime(); - if ((revertTo != RevertToParent) && - (revertTo != RevertToPointerRoot) && - (revertTo != RevertToNone) && - ((revertTo != RevertToFollowKeyboard) || !followOK)) - { - client->errorValue = revertTo; - return BadValue; - } - time = ClientTimeToServerTime(ctime); - if ((focusID == None) || (focusID == PointerRoot)) - focusWin = (WindowPtr)(long)focusID; - else if ((focusID == FollowKeyboard) && followOK) - focusWin = inputInfo.keyboard->focus->win; - else if (!(focusWin = SecurityLookupWindow(focusID, client, - SecurityReadAccess))) - return BadWindow; - else - { - /* It is a match error to try to set the input focus to an - unviewable window. */ - - if(!focusWin->realized) - return(BadMatch); - } - focus = dev->focus; - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, focus->time) == EARLIER)) - return Success; - mode = (dev->grab) ? NotifyWhileGrabbed : NotifyNormal; - if (focus->win == FollowKeyboardWin) - DoFocusEvents(dev, inputInfo.keyboard->focus->win, focusWin, mode); - else - DoFocusEvents(dev, focus->win, focusWin, mode); - focus->time = time; - focus->revert = revertTo; - if (focusID == FollowKeyboard) - focus->win = FollowKeyboardWin; - else - focus->win = focusWin; - if ((focusWin == NoneWin) || (focusWin == PointerRootWin)) - focus->traceGood = 0; - else - { - int depth = 0; - register WindowPtr pWin; - - for (pWin = focusWin; pWin; pWin = pWin->parent) depth++; - if (depth > focus->traceSize) - { - focus->traceSize = depth+1; - Must_have_memory = TRUE; /* XXX */ - focus->trace = (WindowPtr *)xrealloc(focus->trace, - focus->traceSize * - sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ - } - focus->traceGood = depth; - for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--) - focus->trace[depth] = pWin; - } - return Success; -} - -int -ProcSetInputFocus(client) - ClientPtr client; -{ - REQUEST(xSetInputFocusReq); - - REQUEST_SIZE_MATCH(xSetInputFocusReq); -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) - return Success; -#endif - return SetInputFocus(client, inputInfo.keyboard, stuff->focus, - stuff->revertTo, stuff->time, FALSE); -} - -int -ProcGetInputFocus(ClientPtr client) -{ - xGetInputFocusReply rep; - /* REQUEST(xReq); */ - FocusClassPtr focus = inputInfo.keyboard->focus; - - REQUEST_SIZE_MATCH(xReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (focus->win == NoneWin) - rep.focus = None; - else if (focus->win == PointerRootWin) - rep.focus = PointerRoot; - else rep.focus = focus->win->drawable.id; - rep.revertTo = focus->revert; - WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep); - return Success; -} - -int -ProcGrabPointer(ClientPtr client) -{ - xGrabPointerReply rep; - DeviceIntPtr device = inputInfo.pointer; - GrabPtr grab; - WindowPtr pWin, confineTo; - CursorPtr cursor, oldCursor; - REQUEST(xGrabPointerReq); - TimeStamp time; - - REQUEST_SIZE_MATCH(xGrabPointerReq); - UpdateCurrentTime(); - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue)) - { - client->errorValue = stuff->ownerEvents; - return BadValue; - } - if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcGrabPointer: pWin [%p] client [%d].\n", pWin, client -> index); - } - #endif - if (stuff->confineTo == None) - confineTo = NullWindow; - else - { - confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); - if (!confineTo) - return BadWindow; - } - if (stuff->cursor == None) - cursor = NullCursor; - else - { - cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - /* at this point, some sort of reply is guaranteed. */ - time = ClientTimeToServerTime(stuff->time); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - grab = device->grab; - if ((grab) && !SameClient(grab, client)) - rep.status = AlreadyGrabbed; - else if ((!pWin->realized) || - (confineTo && - !(confineTo->realized && BorderSizeNotEmpty(confineTo)))) - rep.status = GrabNotViewable; - else if (device->sync.frozen && - device->sync.other && !SameClient(device->sync.other, client)) - rep.status = GrabFrozen; - else if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, device->grabTime) == EARLIER)) - rep.status = GrabInvalidTime; - else - { - GrabRec tempGrab; - - oldCursor = NullCursor; - if (grab) - { - if (grab->confineTo && !confineTo) - ConfineCursorToWindow(ROOT, FALSE, FALSE); - oldCursor = grab->cursor; - } - tempGrab.cursor = cursor; - tempGrab.resource = client->clientAsMask; - tempGrab.ownerEvents = stuff->ownerEvents; - tempGrab.eventMask = stuff->eventMask; - tempGrab.confineTo = confineTo; - tempGrab.window = pWin; - tempGrab.keyboardMode = stuff->keyboardMode; - tempGrab.pointerMode = stuff->pointerMode; - tempGrab.device = device; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcGrabPointer: Activating active grab on pointer.\n"); - } - #endif - (*device->ActivateGrab)(device, &tempGrab, time, FALSE); - if (oldCursor) - FreeCursor (oldCursor, (Cursor)0); - rep.status = GrabSuccess; - } - WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep); - return Success; -} - -int -ProcChangeActivePointerGrab(ClientPtr client) -{ - DeviceIntPtr device = inputInfo.pointer; - register GrabPtr grab = device->grab; - CursorPtr newCursor, oldCursor; - REQUEST(xChangeActivePointerGrabReq); - TimeStamp time; - - REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); - if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - if (stuff->cursor == None) - newCursor = NullCursor; - else - { - newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!newCursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - if (!grab) - return Success; - if (!SameClient(grab, client)) - return Success; - time = ClientTimeToServerTime(stuff->time); - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, device->grabTime) == EARLIER)) - return Success; - oldCursor = grab->cursor; - grab->cursor = newCursor; - if (newCursor) - newCursor->refcnt++; - PostNewCursor(); - if (oldCursor) - FreeCursor(oldCursor, (Cursor)0); - grab->eventMask = stuff->eventMask; - return Success; -} - -int -ProcUngrabPointer(ClientPtr client) -{ - DeviceIntPtr device = inputInfo.pointer; - GrabPtr grab; - TimeStamp time; - REQUEST(xResourceReq); - - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabPointer: client [%d].\n", client -> index); - } - #endif - REQUEST_SIZE_MATCH(xResourceReq); - UpdateCurrentTime(); - grab = device->grab; - time = ClientTimeToServerTime(stuff->id); - if ((CompareTimeStamps(time, currentTime) != LATER) && - (CompareTimeStamps(time, device->grabTime) != EARLIER) && - (grab) && SameClient(grab, client)) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabPointer: Deactivating grab on pointer.\n"); - } - #endif - (*device->DeactivateGrab)(device); - #ifdef NX_DEBUG_INPUT - } - else - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabPointer: current time [%lu] request time [%lu] grab time [%lu].\n", - currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); - } - } - #endif - return Success; -} - -int -GrabDevice(register ClientPtr client, register DeviceIntPtr dev, - unsigned this_mode, unsigned other_mode, Window grabWindow, - unsigned ownerEvents, Time ctime, Mask mask, CARD8 *status) -{ - register WindowPtr pWin; - register GrabPtr grab; - TimeStamp time; - - UpdateCurrentTime(); - if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync)) - { - client->errorValue = this_mode; - return BadValue; - } - if ((other_mode != GrabModeSync) && (other_mode != GrabModeAsync)) - { - client->errorValue = other_mode; - return BadValue; - } - if ((ownerEvents != xFalse) && (ownerEvents != xTrue)) - { - client->errorValue = ownerEvents; - return BadValue; - } - pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - time = ClientTimeToServerTime(ctime); - grab = dev->grab; - if (grab && !SameClient(grab, client)) - *status = AlreadyGrabbed; - else if (!pWin->realized) - *status = GrabNotViewable; - else if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, dev->grabTime) == EARLIER)) - *status = GrabInvalidTime; - else if (dev->sync.frozen && - dev->sync.other && !SameClient(dev->sync.other, client)) - *status = GrabFrozen; - else - { - GrabRec tempGrab; - - tempGrab.window = pWin; - tempGrab.resource = client->clientAsMask; - tempGrab.ownerEvents = ownerEvents; - tempGrab.keyboardMode = this_mode; - tempGrab.pointerMode = other_mode; - tempGrab.eventMask = mask; - tempGrab.device = dev; - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "GrabDevice: Activating active grab on keyboard.\n"); - } - #endif - (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE); - *status = GrabSuccess; - } - return Success; -} - -int -ProcGrabKeyboard(ClientPtr client) -{ - xGrabKeyboardReply rep; - REQUEST(xGrabKeyboardReq); - int result; - - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcGrabKeyboard: client [%d].\n", client -> index); - } - #endif - REQUEST_SIZE_MATCH(xGrabKeyboardReq); -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) - { - result = Success; - rep.status = AlreadyGrabbed; - } - else -#endif - result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode, - stuff->pointerMode, stuff->grabWindow, - stuff->ownerEvents, stuff->time, - KeyPressMask | KeyReleaseMask, &rep.status); - if (result != Success) - return result; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep); - return Success; -} - -int -ProcUngrabKeyboard(ClientPtr client) -{ - DeviceIntPtr device = inputInfo.keyboard; - GrabPtr grab; - TimeStamp time; - REQUEST(xResourceReq); - - #ifdef NX_DEBUG_INPUT - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabKeyboard: client [%d].\n", client -> index); - } - #endif - REQUEST_SIZE_MATCH(xResourceReq); - UpdateCurrentTime(); - grab = device->grab; - time = ClientTimeToServerTime(stuff->id); - if ((CompareTimeStamps(time, currentTime) != LATER) && - (CompareTimeStamps(time, device->grabTime) != EARLIER) && - (grab) && SameClient(grab, client)) - #ifdef NX_DEBUG_INPUT - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabKeyboard: Deactivating grab on keyboard.\n"); - } - #endif - (*device->DeactivateGrab)(device); - #ifdef NX_DEBUG_INPUT - } - else - { - if (nxagentDebugInputDevices == 1) - { - fprintf(stderr, "ProcUngrabKeyboard: current time [%lu] request time [%lu] grab time [%lu].\n", - currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); - } - } - #endif - return Success; -} - -int -ProcQueryPointer(ClientPtr client) -{ - xQueryPointerReply rep; - WindowPtr pWin, t; - REQUEST(xResourceReq); - DeviceIntPtr mouse = inputInfo.pointer; - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (mouse->valuator->motionHintWindow) - MaybeStopHint(mouse, client); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.mask = mouse->button->state | inputInfo.keyboard->key->state; - rep.length = 0; - rep.root = (ROOT)->drawable.id; - rep.rootX = sprite.hot.x; - rep.rootY = sprite.hot.y; - rep.child = None; - if (sprite.hot.pScreen == pWin->drawable.pScreen) - { - rep.sameScreen = xTrue; - rep.winX = sprite.hot.x - pWin->drawable.x; - rep.winY = sprite.hot.y - pWin->drawable.y; - for (t = sprite.win; t; t = t->parent) - if (t->parent == pWin) - { - rep.child = t->drawable.id; - break; - } - } - else - { - rep.sameScreen = xFalse; - rep.winX = 0; - rep.winY = 0; - } - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - rep.rootX += panoramiXdataPtr[0].x; - rep.rootY += panoramiXdataPtr[0].y; - if(stuff->id == rep.root) { - rep.winX += panoramiXdataPtr[0].x; - rep.winY += panoramiXdataPtr[0].y; - } - } -#endif - - WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep); - - return(Success); -} - -void -InitEvents() -{ - int i; - - sprite.hot.pScreen = sprite.hotPhys.pScreen = (ScreenPtr)NULL; - inputInfo.numDevices = 0; - inputInfo.devices = (DeviceIntPtr)NULL; - inputInfo.off_devices = (DeviceIntPtr)NULL; - inputInfo.keyboard = (DeviceIntPtr)NULL; - inputInfo.pointer = (DeviceIntPtr)NULL; - if (spriteTraceSize == 0) - { - spriteTraceSize = 32; - spriteTrace = (WindowPtr *)xalloc(32*sizeof(WindowPtr)); - if (!spriteTrace) - FatalError("failed to allocate spriteTrace"); - } - spriteTraceGood = 0; - lastEventMask = OwnerGrabButtonMask; - filters[MotionNotify] = PointerMotionMask; -#ifdef XEVIE - xeviewin = -#endif - sprite.win = NullWindow; - sprite.current = NullCursor; - sprite.hotLimits.x1 = 0; - sprite.hotLimits.y1 = 0; - sprite.hotLimits.x2 = 0; - sprite.hotLimits.y2 = 0; - sprite.confined = FALSE; - syncEvents.replayDev = (DeviceIntPtr)NULL; - syncEvents.replayWin = NullWindow; - while (syncEvents.pending) - { - QdEventPtr next = syncEvents.pending->next; - xfree(syncEvents.pending); - syncEvents.pending = next; - } - syncEvents.pendtail = &syncEvents.pending; - syncEvents.playingEvents = FALSE; - syncEvents.time.months = 0; - syncEvents.time.milliseconds = 0; /* hardly matters */ - currentTime.months = 0; - currentTime.milliseconds = GetTimeInMillis(); - lastDeviceEventTime = currentTime; - for (i = 0; i < DNPMCOUNT; i++) - { - DontPropagateMasks[i] = 0; - DontPropagateRefCnts[i] = 0; - } -} - -void -CloseDownEvents(void) -{ - xfree(spriteTrace); - spriteTrace = NULL; - spriteTraceSize = 0; -} - -int -ProcSendEvent(ClientPtr client) -{ - WindowPtr pWin; - WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */ - REQUEST(xSendEventReq); - - REQUEST_SIZE_MATCH(xSendEventReq); - - /* The client's event type must be a core event type or one defined by an - extension. */ - - -#ifdef NXAGENT_CLIPBOARD - - if (stuff -> event.u.u.type == SelectionNotify) - { - extern int nxagentSendNotify(xEvent*); - if (nxagentSendNotify(&stuff->event) == 1) - return Success; - } -#endif - - if ( ! ((stuff->event.u.u.type > X_Reply && - stuff->event.u.u.type < LASTEvent) || - (stuff->event.u.u.type >= EXTENSION_EVENT_BASE && - stuff->event.u.u.type < (unsigned)lastEvent))) - { - client->errorValue = stuff->event.u.u.type; - return BadValue; - } - if (stuff->event.u.u.type == ClientMessage && - stuff->event.u.u.detail != 8 && - stuff->event.u.u.detail != 16 && - stuff->event.u.u.detail != 32 && - !permitOldBugs) - { - client->errorValue = stuff->event.u.u.detail; - return BadValue; - } - if ((stuff->eventMask & ~AllEventMasks) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - - if (stuff->destination == PointerWindow) - pWin = sprite.win; - else if (stuff->destination == InputFocus) - { - WindowPtr inputFocus = inputInfo.keyboard->focus->win; - - if (inputFocus == NoneWin) - return Success; - - /* If the input focus is PointerRootWin, send the event to where - the pointer is if possible, then perhaps propogate up to root. */ - if (inputFocus == PointerRootWin) - inputFocus = ROOT; - - if (IsParent(inputFocus, sprite.win)) - { - effectiveFocus = inputFocus; - pWin = sprite.win; - } - else - effectiveFocus = pWin = inputFocus; - } - else - pWin = SecurityLookupWindow(stuff->destination, client, - SecurityReadAccess); - if (!pWin) - return BadWindow; - if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) - { - client->errorValue = stuff->propagate; - return BadValue; - } - stuff->event.u.u.type |= 0x80; - if (stuff->propagate) - { - for (;pWin; pWin = pWin->parent) - { - if (DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask, - NullGrab, 0)) - return Success; - if (pWin == effectiveFocus) - return Success; - stuff->eventMask &= ~wDontPropagateMask(pWin); - if (!stuff->eventMask) - break; - } - } - else - (void)DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask, - NullGrab, 0); - return Success; -} - -int -ProcUngrabKey(ClientPtr client) -{ - REQUEST(xUngrabKeyReq); - WindowPtr pWin; - GrabRec tempGrab; - DeviceIntPtr keybd = inputInfo.keyboard; - - REQUEST_SIZE_MATCH(xUngrabKeyReq); - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - - if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) || - (stuff->key < keybd->key->curKeySyms.minKeyCode)) - && (stuff->key != AnyKey)) - { - client->errorValue = stuff->key; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - tempGrab.resource = client->clientAsMask; - tempGrab.device = keybd; - tempGrab.window = pWin; - tempGrab.modifiersDetail.exact = stuff->modifiers; - tempGrab.modifiersDetail.pMask = NULL; - tempGrab.modifierDevice = inputInfo.keyboard; - tempGrab.type = KeyPress; - tempGrab.detail.exact = stuff->key; - tempGrab.detail.pMask = NULL; - - if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); -} - -int -ProcGrabKey(ClientPtr client) -{ - WindowPtr pWin; - REQUEST(xGrabKeyReq); - GrabPtr grab; - DeviceIntPtr keybd = inputInfo.keyboard; - - REQUEST_SIZE_MATCH(xGrabKeyReq); - if ((stuff->ownerEvents != xTrue) && (stuff->ownerEvents != xFalse)) - { - client->errorValue = stuff->ownerEvents; - return(BadValue); - } - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) || - (stuff->key < keybd->key->curKeySyms.minKeyCode)) - && (stuff->key != AnyKey)) - { - client->errorValue = stuff->key; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - - grab = CreateGrab(client->index, keybd, pWin, - (Mask)(KeyPressMask | KeyReleaseMask), (Bool)stuff->ownerEvents, - (Bool)stuff->keyboardMode, (Bool)stuff->pointerMode, - keybd, stuff->modifiers, KeyPress, stuff->key, - NullWindow, NullCursor); - if (!grab) - return BadAlloc; - return AddPassiveGrabToList(grab); -} - - -int -ProcGrabButton(ClientPtr client) -{ - WindowPtr pWin, confineTo; - REQUEST(xGrabButtonReq); - CursorPtr cursor; - GrabPtr grab; - - REQUEST_SIZE_MATCH(xGrabButtonReq); - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue)) - { - client->errorValue = stuff->ownerEvents; - return BadValue; - } - if (stuff->eventMask & ~PointerGrabMask) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (stuff->confineTo == None) - confineTo = NullWindow; - else { - confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); - if (!confineTo) - return BadWindow; - } - if (stuff->cursor == None) - cursor = NullCursor; - else - { - cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - - - grab = CreateGrab(client->index, inputInfo.pointer, pWin, - permitOldBugs ? (Mask)(stuff->eventMask | - ButtonPressMask | ButtonReleaseMask) : - (Mask)stuff->eventMask, - (Bool)stuff->ownerEvents, (Bool) stuff->keyboardMode, - (Bool)stuff->pointerMode, inputInfo.keyboard, stuff->modifiers, - ButtonPress, stuff->button, confineTo, cursor); - if (!grab) - return BadAlloc; - return AddPassiveGrabToList(grab); -} - -int -ProcUngrabButton(ClientPtr client) -{ - REQUEST(xUngrabButtonReq); - WindowPtr pWin; - GrabRec tempGrab; - - REQUEST_SIZE_MATCH(xUngrabButtonReq); - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - tempGrab.resource = client->clientAsMask; - tempGrab.device = inputInfo.pointer; - tempGrab.window = pWin; - tempGrab.modifiersDetail.exact = stuff->modifiers; - tempGrab.modifiersDetail.pMask = NULL; - tempGrab.modifierDevice = inputInfo.keyboard; - tempGrab.type = ButtonPress; - tempGrab.detail.exact = stuff->button; - tempGrab.detail.pMask = NULL; - - if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); -} - -void -DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources) -{ - WindowPtr parent; - DeviceIntPtr mouse = inputInfo.pointer; - DeviceIntPtr keybd = inputInfo.keyboard; - FocusClassPtr focus = keybd->focus; - OtherClientsPtr oc; - GrabPtr passive; - - - /* Deactivate any grabs performed on this window, before making any - input focus changes. */ - - if (mouse->grab && - ((mouse->grab->window == pWin) || (mouse->grab->confineTo == pWin))) - (*mouse->DeactivateGrab)(mouse); - - /* Deactivating a keyboard grab should cause focus events. */ - - if (keybd->grab && (keybd->grab->window == pWin)) - (*keybd->DeactivateGrab)(keybd); - - /* If the focus window is a root window (ie. has no parent) then don't - delete the focus from it. */ - - if ((pWin == focus->win) && (pWin->parent != NullWindow)) - { - int focusEventMode = NotifyNormal; - - /* If a grab is in progress, then alter the mode of focus events. */ - - if (keybd->grab) - focusEventMode = NotifyWhileGrabbed; - - switch (focus->revert) - { - case RevertToNone: - DoFocusEvents(keybd, pWin, NoneWin, focusEventMode); - focus->win = NoneWin; - focus->traceGood = 0; - break; - case RevertToParent: - parent = pWin; - do - { - parent = parent->parent; - focus->traceGood--; - } while (!parent->realized -/* This would be a good protocol change -- windows being reparented - during SaveSet processing would cause the focus to revert to the - nearest enclosing window which will survive the death of the exiting - client, instead of ending up reverting to a dying window and thence - to None - */ -#ifdef NOTDEF - || clients[CLIENT_ID(parent->drawable.id)]->clientGone -#endif - ); - DoFocusEvents(keybd, pWin, parent, focusEventMode); - focus->win = parent; - focus->revert = RevertToNone; - break; - case RevertToPointerRoot: - DoFocusEvents(keybd, pWin, PointerRootWin, focusEventMode); - focus->win = PointerRootWin; - focus->traceGood = 0; - break; - } - } - - if (mouse->valuator->motionHintWindow == pWin) - mouse->valuator->motionHintWindow = NullWindow; - - if (freeResources) - { - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]--; - while ( (oc = wOtherClients(pWin)) ) - FreeResource(oc->resource, RT_NONE); - while ( (passive = wPassiveGrabs(pWin)) ) - FreeResource(passive->resource, RT_NONE); - } -#ifdef XINPUT - DeleteWindowFromAnyExtEvents(pWin, freeResources); -#endif -} - -/** - * Call this whenever some window at or below pWin has changed geometry - */ -void -CheckCursorConfinement(WindowPtr pWin) -{ - GrabPtr grab = inputInfo.pointer->grab; - WindowPtr confineTo; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return; -#endif - - if (grab && (confineTo = grab->confineTo)) - { - if (!BorderSizeNotEmpty(confineTo)) - (*inputInfo.pointer->DeactivateGrab)(inputInfo.pointer); - else if ((pWin == confineTo) || IsParent(pWin, confineTo)) - ConfineCursorToWindow(confineTo, TRUE, TRUE); - } -} - -Mask -EventMaskForClient(WindowPtr pWin, ClientPtr client) -{ - register OtherClientsPtr other; - - if (wClient (pWin) == client) - return pWin->eventMask; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (SameClient(other, client)) - return other->mask; - } - return 0; -} - -int -ProcRecolorCursor(ClientPtr client) -{ - CursorPtr pCursor; - int nscr; - ScreenPtr pscr; - Bool displayed; - REQUEST(xRecolorCursorReq); - - REQUEST_SIZE_MATCH(xRecolorCursorReq); - pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityWriteAccess); - if ( !pCursor) - { - client->errorValue = stuff->cursor; - return (BadCursor); - } - - pCursor->foreRed = stuff->foreRed; - pCursor->foreGreen = stuff->foreGreen; - pCursor->foreBlue = stuff->foreBlue; - - pCursor->backRed = stuff->backRed; - pCursor->backGreen = stuff->backGreen; - pCursor->backBlue = stuff->backBlue; - - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) - { - pscr = screenInfo.screens[nscr]; -#ifdef PANORAMIX - if(!noPanoramiXExtension) - displayed = (pscr == sprite.screen); - else -#endif - displayed = (pscr == sprite.hotPhys.pScreen); - ( *pscr->RecolorCursor)(pscr, pCursor, - (pCursor == sprite.current) && displayed); - } - return (Success); -} - -void -WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) -{ -#ifdef PANORAMIX - xEvent eventCopy; -#endif - xEvent eventTo, *eventFrom; - int i; - -#ifdef XKB - if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events))) - return; -#endif - -#ifdef PANORAMIX - if(!noPanoramiXExtension && - (panoramiXdataPtr[0].x || panoramiXdataPtr[0].y)) - { - switch(events->u.u.type) { - case MotionNotify: - case ButtonPress: - case ButtonRelease: - case KeyPress: - case KeyRelease: - case EnterNotify: - case LeaveNotify: - /* - When multiple clients want the same event DeliverEventsToWindow - passes the same event structure multiple times so we can't - modify the one passed to us - */ - count = 1; /* should always be 1 */ - memcpy(&eventCopy, events, sizeof(xEvent)); - eventCopy.u.keyButtonPointer.rootX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.rootY += panoramiXdataPtr[0].y; - if(eventCopy.u.keyButtonPointer.event == - eventCopy.u.keyButtonPointer.root) - { - eventCopy.u.keyButtonPointer.eventX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.eventY += panoramiXdataPtr[0].y; - } - events = &eventCopy; - break; - default: break; - } - } -#endif - - if (EventCallback) - { - EventInfoRec eventinfo; - eventinfo.client = pClient; - eventinfo.events = events; - eventinfo.count = count; - CallCallbacks(&EventCallback, (pointer)&eventinfo); - } - if(pClient->swapped) - { - for(i = 0; i < count; i++) - { - eventFrom = &events[i]; - /* Remember to strip off the leading bit of type in case - this event was sent with "SendEvent." */ - (*EventSwapVector[eventFrom->u.u.type & 0177]) - (eventFrom, &eventTo); - (void)WriteToClient(pClient, sizeof(xEvent), (char *)&eventTo); - } - } - else - { - (void)WriteToClient(pClient, count * sizeof(xEvent), (char *) events); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.X.original deleted file mode 100644 index 4373673f9..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.X.original +++ /dev/null @@ -1,4670 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.17 2005/08/25 22:11:04 anholt Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.51 2004/01/12 17:04:52 tsi Exp $ */ -/************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ - -/* The panoramix components contained the following notice */ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/***************************************************************** - -Copyright 2003-2005 Sun Microsystems, Inc. - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -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 -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. - -******************************************************************/ - -/* $Xorg: events.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "resource.h" -#define NEED_EVENTS -#define NEED_REPLIES -#include -#include "windowstr.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "cursorstr.h" - -#include "dixstruct.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include "globals.h" - -#ifdef XKB -#include -extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); -#endif - -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif - -#ifdef XEVIE -extern WindowPtr *WindowTable; -extern int xevieFlag; -extern int xevieClientIndex; -extern DeviceIntPtr xeviemouse; -extern DeviceIntPtr xeviekb; -extern Mask xevieMask; -extern Mask xevieFilters[128]; -extern int xevieEventSent; -extern int xevieKBEventSent; -int xeviegrabState = 0; -xEvent *xeviexE; -#endif - -#include -#include "exevents.h" -#include "extnsionst.h" - -#include "dixevents.h" -#include "dixgrabs.h" -#include "dispatch.h" - -#define EXTENSION_EVENT_BASE 64 - -#define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */ -#define StructureAndSubMask ( StructureNotifyMask | SubstructureNotifyMask ) -#define AllButtonsMask ( \ - Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask ) -#define MotionMask ( \ - PointerMotionMask | Button1MotionMask | \ - Button2MotionMask | Button3MotionMask | Button4MotionMask | \ - Button5MotionMask | ButtonMotionMask ) -#define PropagateMask ( \ - KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \ - MotionMask ) -#define PointerGrabMask ( \ - ButtonPressMask | ButtonReleaseMask | \ - EnterWindowMask | LeaveWindowMask | \ - PointerMotionHintMask | KeymapStateMask | \ - MotionMask ) -#define AllModifiersMask ( \ - ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ - Mod3Mask | Mod4Mask | Mod5Mask ) -#define AllEventMasks (lastEventMask|(lastEventMask-1)) -/* - * The following relies on the fact that the ButtonMotionMasks are equal - * to the corresponding ButtonMasks from the current modifier/button state. - */ -#define Motion_Filter(class) (PointerMotionMask | \ - (class)->state | (class)->motionMask) - - -#define WID(w) ((w) ? ((w)->drawable.id) : 0) - -#define XE_KBPTR (xE->u.keyButtonPointer) - - -#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) - -CallbackListPtr EventCallback; -CallbackListPtr DeviceEventCallback; - -#define DNPMCOUNT 8 - -Mask DontPropagateMasks[DNPMCOUNT]; -static int DontPropagateRefCnts[DNPMCOUNT]; - -#ifdef DEBUG -static debug_events = 0; -#endif -InputInfo inputInfo; - -static struct { - QdEventPtr pending, *pendtail; - DeviceIntPtr replayDev; /* kludgy rock to put flag for */ - WindowPtr replayWin; /* ComputeFreezes */ - Bool playingEvents; - TimeStamp time; -} syncEvents; - -/* - * The window trace information is used to avoid having to compute all the - * windows between the root and the current pointer window each time a button - * or key goes down. The grabs on each of those windows must be checked. - */ -static WindowPtr *spriteTrace = (WindowPtr *)NULL; -#define ROOT spriteTrace[0] -static int spriteTraceSize = 0; -static int spriteTraceGood; - -static struct { - CursorPtr current; - BoxRec hotLimits; /* logical constraints of hot spot */ - Bool confined; /* confined to screen */ -#if defined(SHAPE) || defined(PANORAMIX) - RegionPtr hotShape; /* additional logical shape constraint */ -#endif - BoxRec physLimits; /* physical constraints of hot spot */ - WindowPtr win; /* window of logical position */ - HotSpot hot; /* logical pointer position */ - HotSpot hotPhys; /* physical pointer position */ -#ifdef PANORAMIX - ScreenPtr screen; /* all others are in Screen 0 coordinates */ - RegionRec Reg1; /* Region 1 for confining motion */ - RegionRec Reg2; /* Region 2 for confining virtual motion */ - WindowPtr windows[MAXSCREENS]; - WindowPtr confineWin; /* confine window */ -#endif -} sprite; /* info about the cursor sprite */ - -#ifdef XEVIE -WindowPtr xeviewin; -HotSpot xeviehot; -#endif - -static void DoEnterLeaveEvents( - WindowPtr fromWin, - WindowPtr toWin, - int mode -); - -static WindowPtr XYToWindow( - int x, - int y -); - -extern int lastEvent; - -static Mask lastEventMask; - -#ifdef XINPUT -extern int DeviceMotionNotify; -#endif - -#define CantBeFiltered NoEventMask -static Mask filters[128] = -{ - NoSuchEvent, /* 0 */ - NoSuchEvent, /* 1 */ - KeyPressMask, /* KeyPress */ - KeyReleaseMask, /* KeyRelease */ - ButtonPressMask, /* ButtonPress */ - ButtonReleaseMask, /* ButtonRelease */ - PointerMotionMask, /* MotionNotify (initial state) */ - EnterWindowMask, /* EnterNotify */ - LeaveWindowMask, /* LeaveNotify */ - FocusChangeMask, /* FocusIn */ - FocusChangeMask, /* FocusOut */ - KeymapStateMask, /* KeymapNotify */ - ExposureMask, /* Expose */ - CantBeFiltered, /* GraphicsExpose */ - CantBeFiltered, /* NoExpose */ - VisibilityChangeMask, /* VisibilityNotify */ - SubstructureNotifyMask, /* CreateNotify */ - StructureAndSubMask, /* DestroyNotify */ - StructureAndSubMask, /* UnmapNotify */ - StructureAndSubMask, /* MapNotify */ - SubstructureRedirectMask, /* MapRequest */ - StructureAndSubMask, /* ReparentNotify */ - StructureAndSubMask, /* ConfigureNotify */ - SubstructureRedirectMask, /* ConfigureRequest */ - StructureAndSubMask, /* GravityNotify */ - ResizeRedirectMask, /* ResizeRequest */ - StructureAndSubMask, /* CirculateNotify */ - SubstructureRedirectMask, /* CirculateRequest */ - PropertyChangeMask, /* PropertyNotify */ - CantBeFiltered, /* SelectionClear */ - CantBeFiltered, /* SelectionRequest */ - CantBeFiltered, /* SelectionNotify */ - ColormapChangeMask, /* ColormapNotify */ - CantBeFiltered, /* ClientMessage */ - CantBeFiltered /* MappingNotify */ -}; - -static CARD8 criticalEvents[32] = -{ - 0x7c /* key and button events */ -}; - -#ifdef PANORAMIX - -static void ConfineToShape(RegionPtr shape, int *px, int *py); -static void SyntheticMotion(int x, int y); -static void PostNewCursor(void); - -static Bool -XineramaSetCursorPosition( - int x, - int y, - Bool generateEvent -){ - ScreenPtr pScreen; - BoxRec box; - int i; - - /* x,y are in Screen 0 coordinates. We need to decide what Screen - to send the message too and what the coordinates relative to - that screen are. */ - - pScreen = sprite.screen; - x += panoramiXdataPtr[0].x; - y += panoramiXdataPtr[0].y; - - if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], - x, y, &box)) - { - FOR_NSCREENS(i) - { - if(i == pScreen->myNum) - continue; - if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box)) - { - pScreen = screenInfo.screens[i]; - break; - } - } - } - - sprite.screen = pScreen; - sprite.hotPhys.x = x - panoramiXdataPtr[0].x; - sprite.hotPhys.y = y - panoramiXdataPtr[0].y; - x -= panoramiXdataPtr[pScreen->myNum].x; - y -= panoramiXdataPtr[pScreen->myNum].y; - - return (*pScreen->SetCursorPosition)(pScreen, x, y, generateEvent); -} - - -static void -XineramaConstrainCursor(void) -{ - ScreenPtr pScreen = sprite.screen; - BoxRec newBox = sprite.physLimits; - - /* Translate the constraining box to the screen - the sprite is actually on */ - newBox.x1 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; - newBox.x2 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; - newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; - newBox.y2 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; - - (* pScreen->ConstrainCursor)(pScreen, &newBox); -} - -static void -XineramaCheckPhysLimits( - CursorPtr cursor, - Bool generateEvents -){ - HotSpot new; - - if (!cursor) - return; - - new = sprite.hotPhys; - - /* I don't care what the DDX has to say about it */ - sprite.physLimits = sprite.hotLimits; - - /* constrain the pointer to those limits */ - if (new.x < sprite.physLimits.x1) - new.x = sprite.physLimits.x1; - else - if (new.x >= sprite.physLimits.x2) - new.x = sprite.physLimits.x2 - 1; - if (new.y < sprite.physLimits.y1) - new.y = sprite.physLimits.y1; - else - if (new.y >= sprite.physLimits.y2) - new.y = sprite.physLimits.y2 - 1; - - if (sprite.hotShape) /* more work if the shape is a mess */ - ConfineToShape(sprite.hotShape, &new.x, &new.y); - - if((new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y)) - { - XineramaSetCursorPosition (new.x, new.y, generateEvents); - if (!generateEvents) - SyntheticMotion(new.x, new.y); - } - - /* Tell DDX what the limits are */ - XineramaConstrainCursor(); -} - - -static Bool -XineramaSetWindowPntrs(WindowPtr pWin) -{ - if(pWin == WindowTable[0]) { - memcpy(sprite.windows, WindowTable, - PanoramiXNumScreens*sizeof(WindowPtr)); - } else { - PanoramiXRes *win; - int i; - - win = (PanoramiXRes*)LookupIDByType(pWin->drawable.id, XRT_WINDOW); - - if(!win) - return FALSE; - - for(i = 0; i < PanoramiXNumScreens; i++) { - sprite.windows[i] = LookupIDByType(win->info[i].id, RT_WINDOW); - if(!sprite.windows[i]) /* window is being unmapped */ - return FALSE; - } - } - return TRUE; -} - -static void -XineramaCheckVirtualMotion( - QdEventPtr qe, - WindowPtr pWin -){ - - if (qe) - { - sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */ -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = qe->event->u.keyButtonPointer.rootX; -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = qe->event->u.keyButtonPointer.rootY; - pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo : - NullWindow; - } - if (pWin) - { - int x, y, off_x, off_y, i; - BoxRec lims; - - if(!XineramaSetWindowPntrs(pWin)) - return; - - i = PanoramiXNumScreens - 1; - - REGION_COPY(sprite.screen, &sprite.Reg2, - &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - - while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; - - if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y); - - REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2, - &sprite.windows[i]->borderSize); - - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - } - - lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2); - - if (sprite.hot.x < lims.x1) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = lims.x1; - else if (sprite.hot.x >= lims.x2) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = lims.x2 - 1; - if (sprite.hot.y < lims.y1) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = lims.y1; - else if (sprite.hot.y >= lims.y2) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = lims.y2 - 1; - - if (REGION_NUM_RECTS(&sprite.Reg2) > 1) - ConfineToShape(&sprite.Reg2, &sprite.hot.x, &sprite.hot.y); - - if (qe) - { - qe->pScreen = sprite.hot.pScreen; - qe->event->u.keyButtonPointer.rootX = sprite.hot.x; - qe->event->u.keyButtonPointer.rootY = sprite.hot.y; - } - } -} - - -static Bool -XineramaCheckMotion(xEvent *xE) -{ - WindowPtr prevSpriteWin = sprite.win; - - if (xE && !syncEvents.playingEvents) - { - /* Motion events entering DIX get translated to Screen 0 - coordinates. Replayed events have already been - translated since they've entered DIX before */ - XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x - - panoramiXdataPtr[0].x; - XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y - - panoramiXdataPtr[0].y; -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = XE_KBPTR.rootX; -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = XE_KBPTR.rootY; - if (sprite.hot.x < sprite.physLimits.x1) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = sprite.physLimits.x1; - else if (sprite.hot.x >= sprite.physLimits.x2) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = sprite.physLimits.x2 - 1; - if (sprite.hot.y < sprite.physLimits.y1) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = sprite.physLimits.y1; - else if (sprite.hot.y >= sprite.physLimits.y2) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = sprite.physLimits.y2 - 1; - - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); - - sprite.hotPhys = sprite.hot; - if ((sprite.hotPhys.x != XE_KBPTR.rootX) || - (sprite.hotPhys.y != XE_KBPTR.rootY)) - { - XineramaSetCursorPosition( - sprite.hotPhys.x, sprite.hotPhys.y, FALSE); - } - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - } - -#ifdef XEVIE - xeviewin = -#endif - sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); - - if (sprite.win != prevSpriteWin) - { - if (prevSpriteWin != NullWindow) { - if (!xE) - UpdateCurrentTimeIf(); - DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); - } - PostNewCursor(); - return FALSE; - } - return TRUE; -} - - -static void -XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents) -{ - - if (syncEvents.playingEvents) - { - XineramaCheckVirtualMotion((QdEventPtr)NULL, pWin); - SyntheticMotion(sprite.hot.x, sprite.hot.y); - } - else - { - int x, y, off_x, off_y, i; - - if(!XineramaSetWindowPntrs(pWin)) - return; - - i = PanoramiXNumScreens - 1; - - REGION_COPY(sprite.screen, &sprite.Reg1, - &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - - while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; - - if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y); - - REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1, - &sprite.windows[i]->borderSize); - - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; - } - - sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1); - - if(REGION_NUM_RECTS(&sprite.Reg1) > 1) - sprite.hotShape = &sprite.Reg1; - else - sprite.hotShape = NullRegion; - - sprite.confined = FALSE; - sprite.confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin; - - XineramaCheckPhysLimits(sprite.current, generateEvents); - } -} - - -static void -XineramaChangeToCursor(CursorPtr cursor) -{ - if (cursor != sprite.current) - { - if ((sprite.current->bits->xhot != cursor->bits->xhot) || - (sprite.current->bits->yhot != cursor->bits->yhot)) - XineramaCheckPhysLimits(cursor, FALSE); - (*sprite.screen->DisplayCursor)(sprite.screen, cursor); - FreeCursor(sprite.current, (Cursor)0); - sprite.current = cursor; - sprite.current->refcnt++; - } -} - - -#endif /* PANORAMIX */ - -void -SetMaskForEvent(Mask mask, int event) -{ - if ((event < LASTEvent) || (event >= 128)) - FatalError("SetMaskForEvent: bogus event number"); - filters[event] = mask; -} - -void -SetCriticalEvent(int event) -{ - if (event >= 128) - FatalError("SetCriticalEvent: bogus event number"); - criticalEvents[event >> 3] |= 1 << (event & 7); -} - -static void -SyntheticMotion(int x, int y) -{ - xEvent xE; - -#ifdef PANORAMIX - /* Translate back to the sprite screen since processInputProc - will translate from sprite screen to screen 0 upon reentry - to the DIX layer */ - if(!noPanoramiXExtension) { - x += panoramiXdataPtr[0].x - panoramiXdataPtr[sprite.screen->myNum].x; - y += panoramiXdataPtr[0].y - panoramiXdataPtr[sprite.screen->myNum].y; - } -#endif - xE.u.keyButtonPointer.rootX = x; - xE.u.keyButtonPointer.rootY = y; - if (syncEvents.playingEvents) - xE.u.keyButtonPointer.time = syncEvents.time.milliseconds; - else - xE.u.keyButtonPointer.time = currentTime.milliseconds; - xE.u.u.type = MotionNotify; - (*inputInfo.pointer->public.processInputProc)(&xE, inputInfo.pointer, 1); -} - -#ifdef SHAPE -static void -ConfineToShape(RegionPtr shape, int *px, int *py) -{ - BoxRec box; - int x = *px, y = *py; - int incx = 1, incy = 1; - - if (POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)) - return; - box = *REGION_EXTENTS(sprite.hot.pScreen, shape); - /* this is rather crude */ - do { - x += incx; - if (x >= box.x2) - { - incx = -1; - x = *px - 1; - } - else if (x < box.x1) - { - incx = 1; - x = *px; - y += incy; - if (y >= box.y2) - { - incy = -1; - y = *py - 1; - } - else if (y < box.y1) - return; /* should never get here! */ - } - } while (!POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)); - *px = x; - *py = y; -} -#endif - -static void -CheckPhysLimits( - CursorPtr cursor, - Bool generateEvents, - Bool confineToScreen, - ScreenPtr pScreen) -{ - HotSpot new; - - if (!cursor) - return; - new = sprite.hotPhys; - if (pScreen) - new.pScreen = pScreen; - else - pScreen = new.pScreen; - (*pScreen->CursorLimits) (pScreen, cursor, &sprite.hotLimits, - &sprite.physLimits); - sprite.confined = confineToScreen; - (* pScreen->ConstrainCursor)(pScreen, &sprite.physLimits); - if (new.x < sprite.physLimits.x1) - new.x = sprite.physLimits.x1; - else - if (new.x >= sprite.physLimits.x2) - new.x = sprite.physLimits.x2 - 1; - if (new.y < sprite.physLimits.y1) - new.y = sprite.physLimits.y1; - else - if (new.y >= sprite.physLimits.y2) - new.y = sprite.physLimits.y2 - 1; -#ifdef SHAPE - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &new.x, &new.y); -#endif - if ((pScreen != sprite.hotPhys.pScreen) || - (new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y)) - { - if (pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys = new; - (*pScreen->SetCursorPosition) (pScreen, new.x, new.y, generateEvents); - if (!generateEvents) - SyntheticMotion(new.x, new.y); - } -} - -static void -CheckVirtualMotion( - register QdEventPtr qe, - register WindowPtr pWin) -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaCheckVirtualMotion(qe, pWin); - return; - } -#endif - if (qe) - { - sprite.hot.pScreen = qe->pScreen; -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = qe->event->u.keyButtonPointer.rootX; -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = qe->event->u.keyButtonPointer.rootY; - pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo : - NullWindow; - } - if (pWin) - { - BoxRec lims; - - if (sprite.hot.pScreen != pWin->drawable.pScreen) - { - sprite.hot.pScreen = pWin->drawable.pScreen; -#ifdef XEVIE - xeviehot.x = xeviehot.y = 0; -#endif - sprite.hot.x = sprite.hot.y = 0; - } - lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize); - if (sprite.hot.x < lims.x1) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = lims.x1; - else if (sprite.hot.x >= lims.x2) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = lims.x2 - 1; - if (sprite.hot.y < lims.y1) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = lims.y1; - else if (sprite.hot.y >= lims.y2) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = lims.y2 - 1; -#ifdef SHAPE - if (wBoundingShape(pWin)) - ConfineToShape(&pWin->borderSize, &sprite.hot.x, &sprite.hot.y); -#endif - if (qe) - { - qe->pScreen = sprite.hot.pScreen; - qe->event->u.keyButtonPointer.rootX = sprite.hot.x; - qe->event->u.keyButtonPointer.rootY = sprite.hot.y; - } - } - ROOT = WindowTable[sprite.hot.pScreen->myNum]; -} - -static void -ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaConfineCursorToWindow(pWin, generateEvents); - return; - } -#endif - - if (syncEvents.playingEvents) - { - CheckVirtualMotion((QdEventPtr)NULL, pWin); - SyntheticMotion(sprite.hot.x, sprite.hot.y); - } - else - { - sprite.hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize); -#ifdef SHAPE - sprite.hotShape = wBoundingShape(pWin) ? &pWin->borderSize - : NullRegion; -#endif - CheckPhysLimits(sprite.current, generateEvents, confineToScreen, - pScreen); - } -} - -Bool -PointerConfinedToScreen() -{ - return sprite.confined; -} - -static void -ChangeToCursor(CursorPtr cursor) -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XineramaChangeToCursor(cursor); - return; - } -#endif - - if (cursor != sprite.current) - { - if ((sprite.current->bits->xhot != cursor->bits->xhot) || - (sprite.current->bits->yhot != cursor->bits->yhot)) - CheckPhysLimits(cursor, FALSE, sprite.confined, - (ScreenPtr)NULL); - (*sprite.hotPhys.pScreen->DisplayCursor) (sprite.hotPhys.pScreen, - cursor); - FreeCursor(sprite.current, (Cursor)0); - sprite.current = cursor; - sprite.current->refcnt++; - } -} - -/* returns true if b is a descendent of a */ -Bool -IsParent(register WindowPtr a, register WindowPtr b) -{ - for (b = b->parent; b; b = b->parent) - if (b == a) return TRUE; - return FALSE; -} - -static void -PostNewCursor(void) -{ - register WindowPtr win; - register GrabPtr grab = inputInfo.pointer->grab; - - if (syncEvents.playingEvents) - return; - if (grab) - { - if (grab->cursor) - { - ChangeToCursor(grab->cursor); - return; - } - if (IsParent(grab->window, sprite.win)) - win = sprite.win; - else - win = grab->window; - } - else - win = sprite.win; - for (; win; win = win->parent) - if (win->optional && win->optional->cursor != NullCursor) - { - ChangeToCursor(win->optional->cursor); - return; - } -} - -WindowPtr -GetCurrentRootWindow() -{ - return ROOT; -} - -WindowPtr -GetSpriteWindow() -{ - return sprite.win; -} - -CursorPtr -GetSpriteCursor() -{ - return sprite.current; -} - -void -GetSpritePosition(int *px, int *py) -{ - *px = sprite.hotPhys.x; - *py = sprite.hotPhys.y; -} - -#ifdef PANORAMIX -int -XineramaGetCursorScreen() -{ - if(!noPanoramiXExtension) { - return sprite.screen->myNum; - } else { - return 0; - } -} -#endif /* PANORAMIX */ - -#define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ - -static void -MonthChangedOrBadTime(register xEvent *xE) -{ - /* If the ddx/OS is careless about not processing timestamped events from - * different sources in sorted order, then it's possible for time to go - * backwards when it should not. Here we ensure a decent time. - */ - if ((currentTime.milliseconds - XE_KBPTR.time) > TIMESLOP) - currentTime.months++; - else - XE_KBPTR.time = currentTime.milliseconds; -} - -#define NoticeTime(xE) { \ - if ((xE)->u.keyButtonPointer.time < currentTime.milliseconds) \ - MonthChangedOrBadTime(xE); \ - currentTime.milliseconds = (xE)->u.keyButtonPointer.time; \ - lastDeviceEventTime = currentTime; } - -void -NoticeEventTime(register xEvent *xE) -{ - if (!syncEvents.playingEvents) - NoticeTime(xE); -} - -/************************************************************************** - * The following procedures deal with synchronous events * - **************************************************************************/ - -void -EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) -{ - register QdEventPtr tail = *syncEvents.pendtail; - register QdEventPtr qe; - xEvent *qxE; - - NoticeTime(xE); - -#ifdef XKB - /* Fix for key repeating bug. */ - if (device->key != NULL && device->key->xkbInfo != NULL && - xE->u.u.type == KeyRelease) - AccessXCancelRepeatKey(device->key->xkbInfo, xE->u.u.detail); -#endif - - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - /* The RECORD spec says that the root window field of motion events - * must be valid. At this point, it hasn't been filled in yet, so - * we do it here. The long expression below is necessary to get - * the current root window; the apparently reasonable alternative - * GetCurrentRootWindow()->drawable.id doesn't give you the right - * answer on the first motion event after a screen change because - * the data that GetCurrentRootWindow relies on hasn't been - * updated yet. - */ - if (xE->u.u.type == MotionNotify) - XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - if (xE->u.u.type == MotionNotify) - { -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x - - panoramiXdataPtr[0].x; - XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y - - panoramiXdataPtr[0].y; - } -#endif - sprite.hotPhys.x = XE_KBPTR.rootX; - sprite.hotPhys.y = XE_KBPTR.rootY; - /* do motion compression */ - if (tail && - (tail->event->u.u.type == MotionNotify) && - (tail->pScreen == sprite.hotPhys.pScreen)) - { - tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x; - tail->event->u.keyButtonPointer.rootY = sprite.hotPhys.y; - tail->event->u.keyButtonPointer.time = XE_KBPTR.time; - tail->months = currentTime.months; - return; - } - } - qe = (QdEventPtr)xalloc(sizeof(QdEventRec) + (count * sizeof(xEvent))); - if (!qe) - return; - qe->next = (QdEventPtr)NULL; - qe->device = device; - qe->pScreen = sprite.hotPhys.pScreen; - qe->months = currentTime.months; - qe->event = (xEvent *)(qe + 1); - qe->evcount = count; - for (qxE = qe->event; --count >= 0; qxE++, xE++) - *qxE = *xE; - if (tail) - syncEvents.pendtail = &tail->next; - *syncEvents.pendtail = qe; -} - -static void -PlayReleasedEvents(void) -{ - register QdEventPtr *prev, qe; - register DeviceIntPtr dev; - - prev = &syncEvents.pending; - while ( (qe = *prev) ) - { - if (!qe->device->sync.frozen) - { - *prev = qe->next; - if (*syncEvents.pendtail == *prev) - syncEvents.pendtail = prev; - if (qe->event->u.u.type == MotionNotify) - CheckVirtualMotion(qe, NullWindow); - syncEvents.time.months = qe->months; - syncEvents.time.milliseconds = qe->event->u.keyButtonPointer.time; -#ifdef PANORAMIX - /* Translate back to the sprite screen since processInputProc - will translate from sprite screen to screen 0 upon reentry - to the DIX layer */ - if(!noPanoramiXExtension) { - qe->event->u.keyButtonPointer.rootX += - panoramiXdataPtr[0].x - - panoramiXdataPtr[sprite.screen->myNum].x; - qe->event->u.keyButtonPointer.rootY += - panoramiXdataPtr[0].y - - panoramiXdataPtr[sprite.screen->myNum].y; - } -#endif - (*qe->device->public.processInputProc)(qe->event, qe->device, - qe->evcount); - xfree(qe); - for (dev = inputInfo.devices; dev && dev->sync.frozen; dev = dev->next) - ; - if (!dev) - break; - /* Playing the event may have unfrozen another device. */ - /* So to play it safe, restart at the head of the queue */ - prev = &syncEvents.pending; - } - else - prev = &qe->next; - } -} - -static void -FreezeThaw(register DeviceIntPtr dev, Bool frozen) -{ - dev->sync.frozen = frozen; - if (frozen) - dev->public.processInputProc = dev->public.enqueueInputProc; - else - dev->public.processInputProc = dev->public.realInputProc; -} - -void -ComputeFreezes() -{ - register DeviceIntPtr replayDev = syncEvents.replayDev; - register int i; - WindowPtr w; - register xEvent *xE; - int count; - GrabPtr grab; - register DeviceIntPtr dev; - - for (dev = inputInfo.devices; dev; dev = dev->next) - FreezeThaw(dev, dev->sync.other || (dev->sync.state >= FROZEN)); - if (syncEvents.playingEvents || (!replayDev && !syncEvents.pending)) - return; - syncEvents.playingEvents = TRUE; - if (replayDev) - { - xE = replayDev->sync.event; - count = replayDev->sync.evcount; - syncEvents.replayDev = (DeviceIntPtr)NULL; - - w = XYToWindow( XE_KBPTR.rootX, XE_KBPTR.rootY); - for (i = 0; i < spriteTraceGood; i++) - { - if (syncEvents.replayWin == spriteTrace[i]) - { - if (!CheckDeviceGrabs(replayDev, xE, i+1, count)) { - if (replayDev->focus) - DeliverFocusedEvent(replayDev, xE, w, count); - else - DeliverDeviceEvents(w, xE, NullGrab, NullWindow, - replayDev, count); - } - goto playmore; - } - } - /* must not still be in the same stack */ - if (replayDev->focus) - DeliverFocusedEvent(replayDev, xE, w, count); - else - DeliverDeviceEvents(w, xE, NullGrab, NullWindow, replayDev, count); - } -playmore: - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (!dev->sync.frozen) - { - PlayReleasedEvents(); - break; - } - } - syncEvents.playingEvents = FALSE; - /* the following may have been skipped during replay, so do it now */ - if ((grab = inputInfo.pointer->grab) && grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } - else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); - PostNewCursor(); -} - -#ifdef RANDR -void -ScreenRestructured (ScreenPtr pScreen) -{ - GrabPtr grab; - - if ((grab = inputInfo.pointer->grab) && grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } - else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); -} -#endif - -void -CheckGrabForSyncs(register DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) -{ - register GrabPtr grab = thisDev->grab; - register DeviceIntPtr dev; - - if (thisMode == GrabModeSync) - thisDev->sync.state = FROZEN_NO_EVENT; - else - { /* free both if same client owns both */ - thisDev->sync.state = THAWED; - if (thisDev->sync.other && - (CLIENT_BITS(thisDev->sync.other->resource) == - CLIENT_BITS(grab->resource))) - thisDev->sync.other = NullGrab; - } - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev != thisDev) - { - if (otherMode == GrabModeSync) - dev->sync.other = grab; - else - { /* free both if same client owns both */ - if (dev->sync.other && - (CLIENT_BITS(dev->sync.other->resource) == - CLIENT_BITS(grab->resource))) - dev->sync.other = NullGrab; - } - } - } - ComputeFreezes(); -} - -void -ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, - TimeStamp time, Bool autoGrab) -{ - WindowPtr oldWin = (mouse->grab) ? mouse->grab->window - : sprite.win; - - if (grab->confineTo) - { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, FALSE, TRUE); - } - DoEnterLeaveEvents(oldWin, grab->window, NotifyGrab); - mouse->valuator->motionHintWindow = NullWindow; - if (syncEvents.playingEvents) - mouse->grabTime = syncEvents.time; - else - mouse->grabTime = time; - if (grab->cursor) - grab->cursor->refcnt++; - mouse->activeGrab = *grab; - mouse->grab = &mouse->activeGrab; - mouse->fromPassiveGrab = autoGrab; - PostNewCursor(); - CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode); -} - -void -DeactivatePointerGrab(register DeviceIntPtr mouse) -{ - register GrabPtr grab = mouse->grab; - register DeviceIntPtr dev; - - mouse->valuator->motionHintWindow = NullWindow; - mouse->grab = NullGrab; - mouse->sync.state = NOT_GRABBED; - mouse->fromPassiveGrab = FALSE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->sync.other == grab) - dev->sync.other = NullGrab; - } - DoEnterLeaveEvents(grab->window, sprite.win, NotifyUngrab); - if (grab->confineTo) - ConfineCursorToWindow(ROOT, FALSE, FALSE); - PostNewCursor(); - if (grab->cursor) - FreeCursor(grab->cursor, (Cursor)0); - ComputeFreezes(); -} - -void -ActivateKeyboardGrab(register DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive) -{ - WindowPtr oldWin; - - if (keybd->grab) - oldWin = keybd->grab->window; - else if (keybd->focus) - oldWin = keybd->focus->win; - else - oldWin = sprite.win; - if (oldWin == FollowKeyboardWin) - oldWin = inputInfo.keyboard->focus->win; - if (keybd->valuator) - keybd->valuator->motionHintWindow = NullWindow; - DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab); - if (syncEvents.playingEvents) - keybd->grabTime = syncEvents.time; - else - keybd->grabTime = time; - keybd->activeGrab = *grab; - keybd->grab = &keybd->activeGrab; - keybd->fromPassiveGrab = passive; - CheckGrabForSyncs(keybd, (Bool)grab->keyboardMode, (Bool)grab->pointerMode); -} - -void -DeactivateKeyboardGrab(register DeviceIntPtr keybd) -{ - register GrabPtr grab = keybd->grab; - register DeviceIntPtr dev; - register WindowPtr focusWin = keybd->focus ? keybd->focus->win - : sprite.win; - - if (focusWin == FollowKeyboardWin) - focusWin = inputInfo.keyboard->focus->win; - if (keybd->valuator) - keybd->valuator->motionHintWindow = NullWindow; - keybd->grab = NullGrab; - keybd->sync.state = NOT_GRABBED; - keybd->fromPassiveGrab = FALSE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->sync.other == grab) - dev->sync.other = NullGrab; - } - DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab); - ComputeFreezes(); -} - -void -AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState) -{ - Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced; - TimeStamp grabTime; - register DeviceIntPtr dev; - - thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client); - thisSynced = FALSE; - otherGrabbed = FALSE; - othersFrozen = TRUE; - grabTime = thisDev->grabTime; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - if (dev->grab && SameClient(dev->grab, client)) - { - if (!(thisGrabbed || otherGrabbed) || - (CompareTimeStamps(dev->grabTime, grabTime) == LATER)) - grabTime = dev->grabTime; - otherGrabbed = TRUE; - if (thisDev->sync.other == dev->grab) - thisSynced = TRUE; - if (dev->sync.state < FROZEN) - othersFrozen = FALSE; - } - else if (!dev->sync.other || !SameClient(dev->sync.other, client)) - othersFrozen = FALSE; - } - if (!((thisGrabbed && thisDev->sync.state >= FROZEN) || thisSynced)) - return; - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, grabTime) == EARLIER)) - return; - switch (newState) - { - case THAWED: /* Async */ - if (thisGrabbed) - thisDev->sync.state = THAWED; - if (thisSynced) - thisDev->sync.other = NullGrab; - ComputeFreezes(); - break; - case FREEZE_NEXT_EVENT: /* Sync */ - if (thisGrabbed) - { - thisDev->sync.state = FREEZE_NEXT_EVENT; - if (thisSynced) - thisDev->sync.other = NullGrab; - ComputeFreezes(); - } - break; - case THAWED_BOTH: /* AsyncBoth */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = THAWED; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - case FREEZE_BOTH_NEXT_EVENT: /* SyncBoth */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = FREEZE_BOTH_NEXT_EVENT; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - case NOT_GRABBED: /* Replay */ - if (thisGrabbed && thisDev->sync.state == FROZEN_WITH_EVENT) - { - if (thisSynced) - thisDev->sync.other = NullGrab; - syncEvents.replayDev = thisDev; - syncEvents.replayWin = thisDev->grab->window; - (*thisDev->DeactivateGrab)(thisDev); - syncEvents.replayDev = (DeviceIntPtr)NULL; - } - break; - case THAW_OTHERS: /* AsyncOthers */ - if (othersFrozen) - { - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - if (dev->grab && SameClient(dev->grab, client)) - dev->sync.state = THAWED; - if (dev->sync.other && SameClient(dev->sync.other, client)) - dev->sync.other = NullGrab; - } - ComputeFreezes(); - } - break; - } -} - -int -ProcAllowEvents(register ClientPtr client) -{ - TimeStamp time; - DeviceIntPtr mouse = inputInfo.pointer; - DeviceIntPtr keybd = inputInfo.keyboard; - REQUEST(xAllowEventsReq); - - REQUEST_SIZE_MATCH(xAllowEventsReq); - time = ClientTimeToServerTime(stuff->time); - switch (stuff->mode) - { - case ReplayPointer: - AllowSome(client, time, mouse, NOT_GRABBED); - break; - case SyncPointer: - AllowSome(client, time, mouse, FREEZE_NEXT_EVENT); - break; - case AsyncPointer: - AllowSome(client, time, mouse, THAWED); - break; - case ReplayKeyboard: - AllowSome(client, time, keybd, NOT_GRABBED); - break; - case SyncKeyboard: - AllowSome(client, time, keybd, FREEZE_NEXT_EVENT); - break; - case AsyncKeyboard: - AllowSome(client, time, keybd, THAWED); - break; - case SyncBoth: - AllowSome(client, time, keybd, FREEZE_BOTH_NEXT_EVENT); - break; - case AsyncBoth: - AllowSome(client, time, keybd, THAWED_BOTH); - break; - default: - client->errorValue = stuff->mode; - return BadValue; - } - return Success; -} - -void -ReleaseActiveGrabs(ClientPtr client) -{ - register DeviceIntPtr dev; - Bool done; - - /* XXX CloseDownClient should remove passive grabs before - * releasing active grabs. - */ - do { - done = TRUE; - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev->grab && SameClient(dev->grab, client)) - { - (*dev->DeactivateGrab)(dev); - done = FALSE; - } - } - } while (!done); -} - -/************************************************************************** - * The following procedures deal with delivering events * - **************************************************************************/ - -int -TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, - Mask filter, GrabPtr grab) -{ - int i; - int type; - -#ifdef DEBUG - if (debug_events) ErrorF( - "Event([%d, %d], mask=0x%x), client=%d", - pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); -#endif - if ((client) && (client != serverClient) && (!client->clientGone) && - ((filter == CantBeFiltered) || (mask & filter))) - { - if (grab && !SameClient(grab, client)) - return -1; /* don't send, but notify caller */ - type = pEvents->u.u.type; - if (type == MotionNotify) - { - if (mask & PointerMotionHintMask) - { - if (WID(inputInfo.pointer->valuator->motionHintWindow) == - pEvents->u.keyButtonPointer.event) - { -#ifdef DEBUG - if (debug_events) ErrorF("\n"); - fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); -#endif - return 1; /* don't send, but pretend we did */ - } - pEvents->u.u.detail = NotifyHint; - } - else - { - pEvents->u.u.detail = NotifyNormal; - } - } -#ifdef XINPUT - else - { - if ((type == DeviceMotionNotify) && - MaybeSendDeviceMotionNotifyHint - ((deviceKeyButtonPointer*)pEvents, mask) != 0) - return 1; - } -#endif - type &= 0177; - if (type != KeymapNotify) - { - /* all extension events must have a sequence number */ - for (i = 0; i < count; i++) - pEvents[i].u.u.sequenceNumber = client->sequence; - } - - if (BitIsOn(criticalEvents, type)) - { -#ifdef SMART_SCHEDULE - if (client->smart_priority < SMART_MAX_PRIORITY) - client->smart_priority++; -#endif - SetCriticalOutputPending(); - } - - WriteEventsToClient(client, count, pEvents); -#ifdef DEBUG - if (debug_events) ErrorF( " delivered\n"); -#endif - return 1; - } - else - { -#ifdef DEBUG - if (debug_events) ErrorF("\n"); -#endif - return 0; - } -} - -int -DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, - Mask filter, GrabPtr grab, int mskidx) -{ - int deliveries = 0, nondeliveries = 0; - int attempt; - register InputClients *other; - ClientPtr client = NullClient; - Mask deliveryMask = 0; /* If a grab occurs due to a button press, then - this mask is the mask of the grab. */ - int type = pEvents->u.u.type; - - /* CantBeFiltered means only window owner gets the event */ - if ((filter == CantBeFiltered) || !(type & EXTENSION_EVENT_BASE)) - { - /* if nobody ever wants to see this event, skip some work */ - if (filter != CantBeFiltered && - !((wOtherEventMasks(pWin)|pWin->eventMask) & filter)) - return 0; - if ( (attempt = TryClientEvents(wClient(pWin), pEvents, count, - pWin->eventMask, filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = wClient(pWin); - deliveryMask = pWin->eventMask; - } else - nondeliveries--; - } - } - if (filter != CantBeFiltered) - { - if (type & EXTENSION_EVENT_BASE) - { - OtherInputMasks *inputMasks; - - inputMasks = wOtherInputMasks(pWin); - if (!inputMasks || - !(inputMasks->inputEvents[mskidx] & filter)) - return 0; - other = inputMasks->inputClients; - } - else - other = (InputClients *)wOtherClients(pWin); - for (; other; other = other->next) - { - if ( (attempt = TryClientEvents(rClient(other), pEvents, count, - other->mask[mskidx], filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = rClient(other); - deliveryMask = other->mask[mskidx]; - } else - nondeliveries--; - } - } - } - if ((type == ButtonPress) && deliveries && (!grab)) - { - GrabRec tempGrab; - - tempGrab.device = inputInfo.pointer; - tempGrab.resource = client->clientAsMask; - tempGrab.window = pWin; - tempGrab.ownerEvents = (deliveryMask & OwnerGrabButtonMask) ? TRUE : FALSE; - tempGrab.eventMask = deliveryMask; - tempGrab.keyboardMode = GrabModeAsync; - tempGrab.pointerMode = GrabModeAsync; - tempGrab.confineTo = NullWindow; - tempGrab.cursor = NullCursor; - (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab, - currentTime, TRUE); - } - else if ((type == MotionNotify) && deliveries) - inputInfo.pointer->valuator->motionHintWindow = pWin; -#ifdef XINPUT - else - { - if (((type == DeviceMotionNotify) -#ifdef XKB - || (type == DeviceButtonPress) -#endif - ) && deliveries) - CheckDeviceGrabAndHintWindow (pWin, type, - (deviceKeyButtonPointer*) pEvents, - grab, client, deliveryMask); - } -#endif - if (deliveries) - return deliveries; - return nondeliveries; -} - -/* If the event goes to dontClient, don't send it and return 0. if - send works, return 1 or if send didn't work, return 2. - Only works for core events. -*/ - -#ifdef PANORAMIX -static int -XineramaTryClientEventsResult( - ClientPtr client, - GrabPtr grab, - Mask mask, - Mask filter -){ - if ((client) && (client != serverClient) && (!client->clientGone) && - ((filter == CantBeFiltered) || (mask & filter))) - { - if (grab && !SameClient(grab, client)) return -1; - else return 1; - } - return 0; -} -#endif - -int -MaybeDeliverEventsToClient(register WindowPtr pWin, xEvent *pEvents, - int count, Mask filter, ClientPtr dontClient) -{ - register OtherClients *other; - - - if (pWin->eventMask & filter) - { - if (wClient(pWin) == dontClient) - return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return XineramaTryClientEventsResult( - wClient(pWin), NullGrab, pWin->eventMask, filter); -#endif - return TryClientEvents(wClient(pWin), pEvents, count, - pWin->eventMask, filter, NullGrab); - } - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->mask & filter) - { - if (SameClient(other, dontClient)) - return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return XineramaTryClientEventsResult( - rClient(other), NullGrab, other->mask, filter); -#endif - return TryClientEvents(rClient(other), pEvents, count, - other->mask, filter, NullGrab); - } - } - return 2; -} - -static void -FixUpEventFromWindow( - xEvent *xE, - WindowPtr pWin, - Window child, - Bool calcChild) -{ - if (calcChild) - { - WindowPtr w=spriteTrace[spriteTraceGood-1]; - /* If the search ends up past the root should the child field be - set to none or should the value in the argument be passed - through. It probably doesn't matter since everyone calls - this function with child == None anyway. */ - - while (w) - { - /* If the source window is same as event window, child should be - none. Don't bother going all all the way back to the root. */ - - if (w == pWin) - { - child = None; - break; - } - - if (w->parent == pWin) - { - child = w->drawable.id; - break; - } - w = w->parent; - } - } - XE_KBPTR.root = ROOT->drawable.id; - XE_KBPTR.event = pWin->drawable.id; - if (sprite.hot.pScreen == pWin->drawable.pScreen) - { - XE_KBPTR.sameScreen = xTrue; - XE_KBPTR.child = child; - XE_KBPTR.eventX = - XE_KBPTR.rootX - pWin->drawable.x; - XE_KBPTR.eventY = - XE_KBPTR.rootY - pWin->drawable.y; - } - else - { - XE_KBPTR.sameScreen = xFalse; - XE_KBPTR.child = None; - XE_KBPTR.eventX = 0; - XE_KBPTR.eventY = 0; - } -} - -int -DeliverDeviceEvents(register WindowPtr pWin, register xEvent *xE, GrabPtr grab, - register WindowPtr stopAt, DeviceIntPtr dev, int count) -{ - Window child = None; - int type = xE->u.u.type; - Mask filter = filters[type]; - int deliveries = 0; - - if (type & EXTENSION_EVENT_BASE) - { - register OtherInputMasks *inputMasks; - int mskidx = dev->id; - - inputMasks = wOtherInputMasks(pWin); - if (inputMasks && !(filter & inputMasks->deliverableEvents[mskidx])) - return 0; - while (pWin) - { - if (inputMasks && (inputMasks->inputEvents[mskidx] & filter)) - { - FixUpEventFromWindow(xE, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(pWin, xE, count, filter, - grab, mskidx); - if (deliveries > 0) - return deliveries; - } - if ((deliveries < 0) || - (pWin == stopAt) || - (inputMasks && - (filter & inputMasks->dontPropagateMask[mskidx]))) - return 0; - child = pWin->drawable.id; - pWin = pWin->parent; - if (pWin) - inputMasks = wOtherInputMasks(pWin); - } - } - else - { - if (!(filter & pWin->deliverableEvents)) - return 0; - while (pWin) - { - if ((wOtherEventMasks(pWin)|pWin->eventMask) & filter) - { - FixUpEventFromWindow(xE, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(pWin, xE, count, filter, - grab, 0); - if (deliveries > 0) - return deliveries; - } - if ((deliveries < 0) || - (pWin == stopAt) || - (filter & wDontPropagateMask(pWin))) - return 0; - child = pWin->drawable.id; - pWin = pWin->parent; - } - } - return 0; -} - -/* not useful for events that propagate up the tree or extension events */ -int -DeliverEvents(register WindowPtr pWin, register xEvent *xE, int count, - register WindowPtr otherParent) -{ - Mask filter; - int deliveries; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return count; -#endif - - if (!count) - return 0; - filter = filters[xE->u.u.type]; - if ((filter & SubstructureNotifyMask) && (xE->u.u.type != CreateNotify)) - xE->u.destroyNotify.event = pWin->drawable.id; - if (filter != StructureAndSubMask) - return DeliverEventsToWindow(pWin, xE, count, filter, NullGrab, 0); - deliveries = DeliverEventsToWindow(pWin, xE, count, StructureNotifyMask, - NullGrab, 0); - if (pWin->parent) - { - xE->u.destroyNotify.event = pWin->parent->drawable.id; - deliveries += DeliverEventsToWindow(pWin->parent, xE, count, - SubstructureNotifyMask, NullGrab, - 0); - if (xE->u.u.type == ReparentNotify) - { - xE->u.destroyNotify.event = otherParent->drawable.id; - deliveries += DeliverEventsToWindow(otherParent, xE, count, - SubstructureNotifyMask, - NullGrab, 0); - } - } - return deliveries; -} - - -static Bool -PointInBorderSize(WindowPtr pWin, int x, int y) -{ - BoxRec box; - - if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box)) - return TRUE; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { - int i; - - for(i = 1; i < PanoramiXNumScreens; i++) { - if(POINT_IN_REGION(sprite.screen, - &sprite.windows[i]->borderSize, - x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x, - y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y, - &box)) - return TRUE; - } - } -#endif - return FALSE; -} - -static WindowPtr -XYToWindow(int x, int y) -{ - register WindowPtr pWin; - BoxRec box; - - spriteTraceGood = 1; /* root window still there */ - pWin = ROOT->firstChild; - while (pWin) - { - if ((pWin->mapped) && - (x >= pWin->drawable.x - wBorderWidth (pWin)) && - (x < pWin->drawable.x + (int)pWin->drawable.width + - wBorderWidth(pWin)) && - (y >= pWin->drawable.y - wBorderWidth (pWin)) && - (y < pWin->drawable.y + (int)pWin->drawable.height + - wBorderWidth (pWin)) -#ifdef SHAPE - /* When a window is shaped, a further check - * is made to see if the point is inside - * borderSize - */ - && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y)) - && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - wInputShape(pWin), - x - pWin->drawable.x, - y - pWin->drawable.y, &box)) -#endif - ) - { - if (spriteTraceGood >= spriteTraceSize) - { - spriteTraceSize += 10; - Must_have_memory = TRUE; /* XXX */ - spriteTrace = (WindowPtr *)xrealloc( - spriteTrace, spriteTraceSize*sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ - } - spriteTrace[spriteTraceGood++] = pWin; - pWin = pWin->firstChild; - } - else - pWin = pWin->nextSib; - } - return spriteTrace[spriteTraceGood-1]; -} - -static Bool -CheckMotion(xEvent *xE) -{ - WindowPtr prevSpriteWin = sprite.win; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return XineramaCheckMotion(xE); -#endif - - if (xE && !syncEvents.playingEvents) - { - if (sprite.hot.pScreen != sprite.hotPhys.pScreen) - { - sprite.hot.pScreen = sprite.hotPhys.pScreen; - ROOT = WindowTable[sprite.hot.pScreen->myNum]; - } -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = XE_KBPTR.rootX; -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = XE_KBPTR.rootY; - if (sprite.hot.x < sprite.physLimits.x1) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = sprite.physLimits.x1; - else if (sprite.hot.x >= sprite.physLimits.x2) -#ifdef XEVIE - xeviehot.x = -#endif - sprite.hot.x = sprite.physLimits.x2 - 1; - if (sprite.hot.y < sprite.physLimits.y1) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = sprite.physLimits.y1; - else if (sprite.hot.y >= sprite.physLimits.y2) -#ifdef XEVIE - xeviehot.y = -#endif - sprite.hot.y = sprite.physLimits.y2 - 1; -#ifdef SHAPE - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y); -#endif - sprite.hotPhys = sprite.hot; - if ((sprite.hotPhys.x != XE_KBPTR.rootX) || - (sprite.hotPhys.y != XE_KBPTR.rootY)) - { - (*sprite.hotPhys.pScreen->SetCursorPosition)( - sprite.hotPhys.pScreen, - sprite.hotPhys.x, sprite.hotPhys.y, FALSE); - } - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - } - -#ifdef XEVIE - xeviewin = -#endif - sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); -#ifdef notyet - if (!(sprite.win->deliverableEvents & - Motion_Filter(inputInfo.pointer->button)) - !syncEvents.playingEvents) - { - /* XXX Do PointerNonInterestBox here */ - } -#endif - if (sprite.win != prevSpriteWin) - { - if (prevSpriteWin != NullWindow) { - if (!xE) - UpdateCurrentTimeIf(); - DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal); - } - PostNewCursor(); - return FALSE; - } - return TRUE; -} - -void -WindowsRestructured() -{ - (void) CheckMotion((xEvent *)NULL); -} - -#ifdef PANORAMIX -/* This was added to support reconfiguration under Xdmx. The problem is - * that if the 0th screen (i.e., WindowTable[0]) is moved to an origin - * other than 0,0, the information in the private sprite structure must - * be updated accordingly, or XYToWindow (and other routines) will not - * compute correctly. */ -void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) -{ - ScreenPtr pScreen = win->drawable.pScreen; - GrabPtr grab; - - if (noPanoramiXExtension) return; - - sprite.hot.x -= xoff; - sprite.hot.y -= yoff; - - sprite.hotPhys.x -= xoff; - sprite.hotPhys.y -= yoff; - - sprite.hotLimits.x1 -= xoff; - sprite.hotLimits.y1 -= yoff; - sprite.hotLimits.x2 -= xoff; - sprite.hotLimits.y2 -= yoff; - - if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg1)) - REGION_TRANSLATE(sprite.screen, &sprite.Reg1, xoff, yoff); - if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg2)) - REGION_TRANSLATE(sprite.screen, &sprite.Reg2, xoff, yoff); - - /* FIXME: if we call ConfineCursorToWindow, must we do anything else? */ - if ((grab = inputInfo.pointer->grab) && grab->confineTo) { - if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen) - sprite.hotPhys.x = sprite.hotPhys.y = 0; - ConfineCursorToWindow(grab->confineTo, TRUE, TRUE); - } else - ConfineCursorToWindow(WindowTable[sprite.hotPhys.pScreen->myNum], - TRUE, FALSE); -} -#endif - -void -DefineInitialRootWindow(register WindowPtr win) -{ - register ScreenPtr pScreen = win->drawable.pScreen; - - sprite.hotPhys.pScreen = pScreen; - sprite.hotPhys.x = pScreen->width / 2; - sprite.hotPhys.y = pScreen->height / 2; - sprite.hot = sprite.hotPhys; - sprite.hotLimits.x2 = pScreen->width; - sprite.hotLimits.y2 = pScreen->height; -#ifdef XEVIE - xeviewin = -#endif - sprite.win = win; - sprite.current = wCursor (win); - sprite.current->refcnt++; - spriteTraceGood = 1; - ROOT = win; - (*pScreen->CursorLimits) ( - pScreen, sprite.current, &sprite.hotLimits, &sprite.physLimits); - sprite.confined = FALSE; - (*pScreen->ConstrainCursor) (pScreen, &sprite.physLimits); - (*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE); - (*pScreen->DisplayCursor) (pScreen, sprite.current); - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - sprite.hotLimits.x1 = -panoramiXdataPtr[0].x; - sprite.hotLimits.y1 = -panoramiXdataPtr[0].y; - sprite.hotLimits.x2 = PanoramiXPixWidth - panoramiXdataPtr[0].x; - sprite.hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y; - sprite.physLimits = sprite.hotLimits; - sprite.confineWin = NullWindow; -#ifdef SHAPE - sprite.hotShape = NullRegion; -#endif - sprite.screen = pScreen; - /* gotta UNINIT these someplace */ - REGION_NULL(pScreen, &sprite.Reg1); - REGION_NULL(pScreen, &sprite.Reg2); - } -#endif -} - -/* - * This does not take any shortcuts, and even ignores its argument, since - * it does not happen very often, and one has to walk up the tree since - * this might be a newly instantiated cursor for an intermediate window - * between the one the pointer is in and the one that the last cursor was - * instantiated from. - */ -void -WindowHasNewCursor(WindowPtr pWin) -{ - PostNewCursor(); -} - -void -NewCurrentScreen(ScreenPtr newScreen, int x, int y) -{ - sprite.hotPhys.x = x; - sprite.hotPhys.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - sprite.hotPhys.x += panoramiXdataPtr[newScreen->myNum].x - - panoramiXdataPtr[0].x; - sprite.hotPhys.y += panoramiXdataPtr[newScreen->myNum].y - - panoramiXdataPtr[0].y; - if (newScreen != sprite.screen) { - sprite.screen = newScreen; - /* Make sure we tell the DDX to update its copy of the screen */ - if(sprite.confineWin) - XineramaConfineCursorToWindow(sprite.confineWin, TRUE); - else - XineramaConfineCursorToWindow(WindowTable[0], TRUE); - /* if the pointer wasn't confined, the DDX won't get - told of the pointer warp so we reposition it here */ - if(!syncEvents.playingEvents) - (*sprite.screen->SetCursorPosition)(sprite.screen, - sprite.hotPhys.x + panoramiXdataPtr[0].x - - panoramiXdataPtr[sprite.screen->myNum].x, - sprite.hotPhys.y + panoramiXdataPtr[0].y - - panoramiXdataPtr[sprite.screen->myNum].y, FALSE); - } - } else -#endif - if (newScreen != sprite.hotPhys.pScreen) - ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE); -} - -#ifdef PANORAMIX - -static Bool -XineramaPointInWindowIsVisible( - WindowPtr pWin, - int x, - int y -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - BoxRec box; - int i, xoff, yoff; - - if (!pWin->realized) return FALSE; - - if (POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) - return TRUE; - - if(!XineramaSetWindowPntrs(pWin)) return FALSE; - - xoff = x + panoramiXdataPtr[0].x; - yoff = y + panoramiXdataPtr[0].y; - - for(i = 1; i < PanoramiXNumScreens; i++) { - pWin = sprite.windows[i]; - pScreen = pWin->drawable.pScreen; - x = xoff - panoramiXdataPtr[i].x; - y = yoff - panoramiXdataPtr[i].y; - - if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box) - && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - wInputShape(pWin), - x - pWin->drawable.x, - y - pWin->drawable.y, &box))) - return TRUE; - - } - - return FALSE; -} - -static int -XineramaWarpPointer(ClientPtr client) -{ - WindowPtr dest = NULL; - int x, y; - - REQUEST(xWarpPointerReq); - - - if (stuff->dstWid != None) - { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); - if (!dest) - return BadWindow; - } - x = sprite.hotPhys.x; - y = sprite.hotPhys.y; - - if (stuff->srcWid != None) - { - int winX, winY; - XID winID = stuff->srcWid; - WindowPtr source; - - source = SecurityLookupWindow(winID, client, SecurityReadAccess); - if (!source) return BadWindow; - - winX = source->drawable.x; - winY = source->drawable.y; - if(source == WindowTable[0]) { - winX -= panoramiXdataPtr[0].x; - winY -= panoramiXdataPtr[0].y; - } - if (x < winX + stuff->srcX || - y < winY + stuff->srcY || - (stuff->srcWidth != 0 && - winX + stuff->srcX + (int)stuff->srcWidth < x) || - (stuff->srcHeight != 0 && - winY + stuff->srcY + (int)stuff->srcHeight < y) || - !XineramaPointInWindowIsVisible(source, x, y)) - return Success; - } - if (dest) { - x = dest->drawable.x; - y = dest->drawable.y; - if(dest == WindowTable[0]) { - x -= panoramiXdataPtr[0].x; - y -= panoramiXdataPtr[0].y; - } - } - - x += stuff->dstX; - y += stuff->dstY; - - if (x < sprite.physLimits.x1) - x = sprite.physLimits.x1; - else if (x >= sprite.physLimits.x2) - x = sprite.physLimits.x2 - 1; - if (y < sprite.physLimits.y1) - y = sprite.physLimits.y1; - else if (y >= sprite.physLimits.y2) - y = sprite.physLimits.y2 - 1; - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &x, &y); - - XineramaSetCursorPosition(x, y, TRUE); - - return Success; -} - -#endif - - -int -ProcWarpPointer(ClientPtr client) -{ - WindowPtr dest = NULL; - int x, y; - ScreenPtr newScreen; - - REQUEST(xWarpPointerReq); - - REQUEST_SIZE_MATCH(xWarpPointerReq); - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return XineramaWarpPointer(client); -#endif - - if (stuff->dstWid != None) - { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); - if (!dest) - return BadWindow; - } - x = sprite.hotPhys.x; - y = sprite.hotPhys.y; - - if (stuff->srcWid != None) - { - int winX, winY; - XID winID = stuff->srcWid; - WindowPtr source; - - source = SecurityLookupWindow(winID, client, SecurityReadAccess); - if (!source) return BadWindow; - - winX = source->drawable.x; - winY = source->drawable.y; - if (source->drawable.pScreen != sprite.hotPhys.pScreen || - x < winX + stuff->srcX || - y < winY + stuff->srcY || - (stuff->srcWidth != 0 && - winX + stuff->srcX + (int)stuff->srcWidth < x) || - (stuff->srcHeight != 0 && - winY + stuff->srcY + (int)stuff->srcHeight < y) || - !PointInWindowIsVisible(source, x, y)) - return Success; - } - if (dest) - { - x = dest->drawable.x; - y = dest->drawable.y; - newScreen = dest->drawable.pScreen; - } else - newScreen = sprite.hotPhys.pScreen; - - x += stuff->dstX; - y += stuff->dstY; - - if (x < 0) - x = 0; - else if (x >= newScreen->width) - x = newScreen->width - 1; - if (y < 0) - y = 0; - else if (y >= newScreen->height) - y = newScreen->height - 1; - - if (newScreen == sprite.hotPhys.pScreen) - { - if (x < sprite.physLimits.x1) - x = sprite.physLimits.x1; - else if (x >= sprite.physLimits.x2) - x = sprite.physLimits.x2 - 1; - if (y < sprite.physLimits.y1) - y = sprite.physLimits.y1; - else if (y >= sprite.physLimits.y2) - y = sprite.physLimits.y2 - 1; -#if defined(SHAPE) - if (sprite.hotShape) - ConfineToShape(sprite.hotShape, &x, &y); -#endif - (*newScreen->SetCursorPosition)(newScreen, x, y, TRUE); - } - else if (!PointerConfinedToScreen()) - { - NewCurrentScreen(newScreen, x, y); - } - return Success; -} - -static Bool -BorderSizeNotEmpty(WindowPtr pWin) -{ - if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize)) - return TRUE; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { - int i; - - for(i = 1; i < PanoramiXNumScreens; i++) { - if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize)) - return TRUE; - } - } -#endif - return FALSE; -} - -/* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a - passive grab set on the window to be activated. */ - -static Bool -CheckPassiveGrabsOnWindow( - WindowPtr pWin, - register DeviceIntPtr device, - register xEvent *xE, - int count) -{ - register GrabPtr grab = wPassiveGrabs(pWin); - GrabRec tempGrab; - register xEvent *dxE; - - if (!grab) - return FALSE; - tempGrab.window = pWin; - tempGrab.device = device; - tempGrab.type = xE->u.u.type; - tempGrab.detail.exact = xE->u.u.detail; - tempGrab.detail.pMask = NULL; - tempGrab.modifiersDetail.pMask = NULL; - for (; grab; grab = grab->next) - { -#ifdef XKB - DeviceIntPtr gdev; - XkbSrvInfoPtr xkbi; - - gdev= grab->modifierDevice; - xkbi= gdev->key->xkbInfo; -#endif - tempGrab.modifierDevice = grab->modifierDevice; - if ((device == grab->modifierDevice) && - ((xE->u.u.type == KeyPress) -#if defined(XINPUT) && defined(XKB) - || (xE->u.u.type == DeviceKeyPress) -#endif - )) - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension?gdev->key->prev_state:xkbi->state.grab_mods); -#else - grab->modifierDevice->key->prev_state; -#endif - else - tempGrab.modifiersDetail.exact = -#ifdef XKB - (noXkbExtension ? gdev->key->state : xkbi->state.grab_mods); -#else - grab->modifierDevice->key->state; -#endif - if (GrabMatchesSecond(&tempGrab, grab) && - (!grab->confineTo || - (grab->confineTo->realized && - BorderSizeNotEmpty(grab->confineTo)))) - { -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(wClient(pWin), device, FALSE)) - return FALSE; -#endif -#ifdef XKB - if (!noXkbExtension) { - XE_KBPTR.state &= 0x1f00; - XE_KBPTR.state |= - tempGrab.modifiersDetail.exact&(~0x1f00); - } -#endif - (*device->ActivateGrab)(device, grab, currentTime, TRUE); - - FixUpEventFromWindow(xE, grab->window, None, TRUE); - - (void) TryClientEvents(rClient(grab), xE, count, - filters[xE->u.u.type], - filters[xE->u.u.type], grab); - - if (device->sync.state == FROZEN_NO_EVENT) - { - if (device->sync.evcount < count) - { - Must_have_memory = TRUE; /* XXX */ - device->sync.event = (xEvent *)xrealloc(device->sync.event, - count* - sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ - } - device->sync.evcount = count; - for (dxE = device->sync.event; --count >= 0; dxE++, xE++) - *dxE = *xE; - device->sync.state = FROZEN_WITH_EVENT; - } - return TRUE; - } - } - return FALSE; -} - -/** -"CheckDeviceGrabs" handles both keyboard and pointer events that may cause -a passive grab to be activated. If the event is a keyboard event, the -ancestors of the focus window are traced down and tried to see if they have -any passive grabs to be activated. If the focus window itself is reached and -it's descendants contain they pointer, the ancestors of the window that the -pointer is in are then traced down starting at the focus window, otherwise no -grabs are activated. If the event is a pointer event, the ancestors of the -window that the pointer is in are traced down starting at the root until -CheckPassiveGrabs causes a passive grab to activate or all the windows are -tried. PRH -*/ - -Bool -CheckDeviceGrabs(register DeviceIntPtr device, register xEvent *xE, - int checkFirst, int count) -{ - register int i; - register WindowPtr pWin = NULL; - register FocusClassPtr focus = device->focus; - - if (((xE->u.u.type == ButtonPress) -#if defined(XINPUT) && defined(XKB) - || (xE->u.u.type == DeviceButtonPress) -#endif - ) && (device->button->buttonsDown != 1)) - return FALSE; - - i = checkFirst; - - if (focus) - { - for (; i < focus->traceGood; i++) - { - pWin = focus->trace[i]; - if (pWin->optional && - CheckPassiveGrabsOnWindow(pWin, device, xE, count)) - return TRUE; - } - - if ((focus->win == NoneWin) || - (i >= spriteTraceGood) || - ((i > checkFirst) && (pWin != spriteTrace[i-1]))) - return FALSE; - } - - for (; i < spriteTraceGood; i++) - { - pWin = spriteTrace[i]; - if (pWin->optional && - CheckPassiveGrabsOnWindow(pWin, device, xE, count)) - return TRUE; - } - - return FALSE; -} - -void -DeliverFocusedEvent(DeviceIntPtr keybd, xEvent *xE, WindowPtr window, int count) -{ - WindowPtr focus = keybd->focus->win; - int mskidx = 0; - - if (focus == FollowKeyboardWin) - focus = inputInfo.keyboard->focus->win; - if (!focus) - return; - if (focus == PointerRootWin) - { - DeliverDeviceEvents(window, xE, NullGrab, NullWindow, keybd, count); - return; - } - if ((focus == window) || IsParent(focus, window)) - { - if (DeliverDeviceEvents(window, xE, NullGrab, focus, keybd, count)) - return; - } - /* just deliver it to the focus window */ - FixUpEventFromWindow(xE, focus, None, FALSE); - if (xE->u.u.type & EXTENSION_EVENT_BASE) - mskidx = keybd->id; - (void)DeliverEventsToWindow(focus, xE, count, filters[xE->u.u.type], - NullGrab, mskidx); -} - -void -DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev, - Bool deactivateGrab, int count) -{ - register GrabPtr grab = thisDev->grab; - int deliveries = 0; - register DeviceIntPtr dev; - register xEvent *dxE; - - if (grab->ownerEvents) - { - WindowPtr focus; - - if (thisDev->focus) - { - focus = thisDev->focus->win; - if (focus == FollowKeyboardWin) - focus = inputInfo.keyboard->focus->win; - } - else - focus = PointerRootWin; - if (focus == PointerRootWin) - deliveries = DeliverDeviceEvents(sprite.win, xE, grab, NullWindow, - thisDev, count); - else if (focus && (focus == sprite.win || IsParent(focus, sprite.win))) - deliveries = DeliverDeviceEvents(sprite.win, xE, grab, focus, - thisDev, count); - else if (focus) - deliveries = DeliverDeviceEvents(focus, xE, grab, focus, - thisDev, count); - } - if (!deliveries) - { - FixUpEventFromWindow(xE, grab->window, None, TRUE); - deliveries = TryClientEvents(rClient(grab), xE, count, - (Mask)grab->eventMask, - filters[xE->u.u.type], grab); - if (deliveries && (xE->u.u.type == MotionNotify -#ifdef XINPUT - || xE->u.u.type == DeviceMotionNotify -#endif - )) - thisDev->valuator->motionHintWindow = grab->window; - } - if (deliveries && !deactivateGrab && (xE->u.u.type != MotionNotify -#ifdef XINPUT - && xE->u.u.type != DeviceMotionNotify -#endif - )) - switch (thisDev->sync.state) - { - case FREEZE_BOTH_NEXT_EVENT: - for (dev = inputInfo.devices; dev; dev = dev->next) - { - if (dev == thisDev) - continue; - FreezeThaw(dev, TRUE); - if ((dev->sync.state == FREEZE_BOTH_NEXT_EVENT) && - (CLIENT_BITS(dev->grab->resource) == - CLIENT_BITS(thisDev->grab->resource))) - dev->sync.state = FROZEN_NO_EVENT; - else - dev->sync.other = thisDev->grab; - } - /* fall through */ - case FREEZE_NEXT_EVENT: - thisDev->sync.state = FROZEN_WITH_EVENT; - FreezeThaw(thisDev, TRUE); - if (thisDev->sync.evcount < count) - { - Must_have_memory = TRUE; /* XXX */ - thisDev->sync.event = (xEvent *)xrealloc(thisDev->sync.event, - count*sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ - } - thisDev->sync.evcount = count; - for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++) - *dxE = *xE; - break; - } -} - -void -#ifdef XKB -CoreProcessKeyboardEvent (register xEvent *xE, register DeviceIntPtr keybd, int count) -#else -ProcessKeyboardEvent (register xEvent *xE, register DeviceIntPtr keybd, int count) -#endif -{ - int key, bit; - register BYTE *kptr; - register int i; - register CARD8 modifiers; - register CARD16 mask; - GrabPtr grab = keybd->grab; - Bool deactivateGrab = FALSE; - register KeyClassPtr keyc = keybd->key; -#ifdef XEVIE - static Window rootWin = 0; - - if(!xeviegrabState && xevieFlag && clients[xevieClientIndex] && - (xevieMask & xevieFilters[xE->u.u.type])) { - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); - if((xE->u.u.type == KeyPress && (*kptr & bit)) || - (xE->u.u.type == KeyRelease && !(*kptr & bit))) - {} else { -#ifdef XKB - if(!noXkbExtension) - xevieKBEventSent = 1; -#endif - if(!xevieKBEventSent) - { - xeviekb = keybd; - if(!rootWin) { - rootWin = GetCurrentRootWindow()->drawable.id; - } - xE->u.keyButtonPointer.event = xeviewin->drawable.id; - xE->u.keyButtonPointer.root = rootWin; - xE->u.keyButtonPointer.child = (xeviewin->firstChild) ? xeviewin->firstChild-> -drawable.id:0; - xE->u.keyButtonPointer.rootX = xeviehot.x; - xE->u.keyButtonPointer.rootY = xeviehot.y; - xE->u.keyButtonPointer.state = keyc->state; - WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); -#ifdef XKB - if(noXkbExtension) -#endif - return; - } else { - xevieKBEventSent = 0; - } - } - } -#endif - - if (!syncEvents.playingEvents) - { - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - } -#ifdef XEVIE - /* fix for bug5094030: don't change the state bit if the event is from XEvIE client */ - if(!(!xeviegrabState && xevieFlag && clients[xevieClientIndex] && - (xevieMask & xevieFilters[xE->u.u.type] -#ifdef XKB - && !noXkbExtension -#endif - ))) -#endif - XE_KBPTR.state = (keyc->state | inputInfo.pointer->button->state); - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); - modifiers = keyc->modifierMap[key]; -#if defined(XKB) && defined(XEVIE) - if(!noXkbExtension && !xeviegrabState && - xevieFlag && clients[xevieClientIndex] && - (xevieMask & xevieFilters[xE->u.u.type])) { - switch(xE->u.u.type) { - case KeyPress: *kptr &= ~bit; break; - case KeyRelease: *kptr |= bit; break; - } - } -#endif - -#ifdef DEBUG - if ((xkbDebugFlags&0x4)&& - ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { - ErrorF("CoreProcessKbdEvent: Key %d %s\n",key, - (xE->u.u.type==KeyPress?"down":"up")); - } -#endif - switch (xE->u.u.type) - { - case KeyPress: - if (*kptr & bit) /* allow ddx to generate multiple downs */ - { - if (!modifiers) - { - xE->u.u.type = KeyRelease; - (*keybd->public.processInputProc)(xE, keybd, count); - xE->u.u.type = KeyPress; - /* release can have side effects, don't fall through */ - (*keybd->public.processInputProc)(xE, keybd, count); - } - return; - } - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr |= bit; - keyc->prev_state = keyc->state; - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) - { - /* This key affects modifier "i" */ - keyc->modifierKeyCount[i]++; - keyc->state |= mask; - modifiers &= ~mask; - } - } - if (!grab && CheckDeviceGrabs(keybd, xE, 0, count)) - { - keybd->activatingKey = key; - return; - } - break; - case KeyRelease: - if (!(*kptr & bit)) /* guard against duplicates */ - return; - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr &= ~bit; - keyc->prev_state = keyc->state; - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) { - /* This key affects modifier "i" */ - if (--keyc->modifierKeyCount[i] <= 0) { - keyc->state &= ~mask; - keyc->modifierKeyCount[i] = 0; - } - modifiers &= ~mask; - } - } - if (keybd->fromPassiveGrab && (key == keybd->activatingKey)) - deactivateGrab = TRUE; - break; - default: - FatalError("Impossible keyboard event"); - } - if (grab) - DeliverGrabbedEvent(xE, keybd, deactivateGrab, count); - else - DeliverFocusedEvent(keybd, xE, sprite.win, count); - if (deactivateGrab) - (*keybd->DeactivateGrab)(keybd); -} - -#ifdef XKB -/* This function is used to set the key pressed or key released state - - this is only used when the pressing of keys does not cause - CoreProcessKeyEvent to be called, as in for example Mouse Keys. -*/ -void -FixKeyState (register xEvent *xE, register DeviceIntPtr keybd) -{ - int key, bit; - register BYTE *kptr; - register KeyClassPtr keyc = keybd->key; - - key = xE->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); -#ifdef DEBUG - if ((xkbDebugFlags&0x4)&& - ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { - ErrorF("FixKeyState: Key %d %s\n",key, - (xE->u.u.type==KeyPress?"down":"up")); - } -#endif - switch (xE->u.u.type) - { - case KeyPress: - *kptr |= bit; - break; - case KeyRelease: - *kptr &= ~bit; - break; - default: - FatalError("Impossible keyboard event"); - } -} -#endif - -void -#ifdef XKB -CoreProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count) -#else -ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count) -#endif -{ - register GrabPtr grab = mouse->grab; - Bool deactivateGrab = FALSE; - register ButtonClassPtr butc = mouse->button; -#ifdef XKB - XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo; -#endif -#ifdef XEVIE - if(xevieFlag && clients[xevieClientIndex] && !xeviegrabState && - (xevieMask & xevieFilters[xE->u.u.type])) { - if(xevieEventSent) - xevieEventSent = 0; - else { - xeviemouse = mouse; - WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); - return; - } - } -#endif - - if (!syncEvents.playingEvents) - NoticeTime(xE) - XE_KBPTR.state = (butc->state | ( -#ifdef XKB - (noXkbExtension ? - inputInfo.keyboard->key->state : - xkbi->state.grab_mods) -#else - inputInfo.keyboard->key->state -#endif - )); - { - NoticeTime(xE); - if (DeviceEventCallback) - { - DeviceEventInfoRec eventinfo; - /* see comment in EnqueueEvents regarding the next three lines */ - if (xE->u.u.type == MotionNotify) - XE_KBPTR.root = - WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; - eventinfo.events = xE; - eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); - } - } - if (xE->u.u.type != MotionNotify) - { - register int key; - register BYTE *kptr; - int bit; - - XE_KBPTR.rootX = sprite.hot.x; - XE_KBPTR.rootY = sprite.hot.y; - - key = xE->u.u.detail; - kptr = &butc->down[key >> 3]; - bit = 1 << (key & 7); - switch (xE->u.u.type) - { - case ButtonPress: - mouse->valuator->motionHintWindow = NullWindow; - if (!(*kptr & bit)) - butc->buttonsDown++; - butc->motionMask = ButtonMotionMask; - *kptr |= bit; -#if !defined(XFree86Server) || !defined(XINPUT) - xE->u.u.detail = butc->map[key]; -#endif - if (xE->u.u.detail == 0) - return; - if (xE->u.u.detail <= 5) - butc->state |= (Button1Mask >> 1) << xE->u.u.detail; - filters[MotionNotify] = Motion_Filter(butc); - if (!grab) - if (CheckDeviceGrabs(mouse, xE, 0, count)) - return; - break; - case ButtonRelease: - mouse->valuator->motionHintWindow = NullWindow; - if (*kptr & bit) - --butc->buttonsDown; - if (!butc->buttonsDown) - butc->motionMask = 0; - *kptr &= ~bit; -#if !defined(XFree86Server) || !defined(XINPUT) - xE->u.u.detail = butc->map[key]; -#endif - if (xE->u.u.detail == 0) - return; - if (xE->u.u.detail <= 5) - butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); - filters[MotionNotify] = Motion_Filter(butc); - if (!butc->state && mouse->fromPassiveGrab) - deactivateGrab = TRUE; - break; - default: - FatalError("bogus pointer event from ddx"); - } - } - else if (!CheckMotion(xE)) - return; - if (grab) - DeliverGrabbedEvent(xE, mouse, deactivateGrab, count); - else - DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, - mouse, count); - if (deactivateGrab) - (*mouse->DeactivateGrab)(mouse); -} - -#define AtMostOneClient \ - (SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask) - -void -RecalculateDeliverableEvents(pWin) - register WindowPtr pWin; -{ - register OtherClients *others; - register WindowPtr pChild; - - pChild = pWin; - while (1) - { - if (pChild->optional) - { - pChild->optional->otherEventMasks = 0; - for (others = wOtherClients(pChild); others; others = others->next) - { - pChild->optional->otherEventMasks |= others->mask; - } - } - pChild->deliverableEvents = pChild->eventMask| - wOtherEventMasks(pChild); - if (pChild->parent) - pChild->deliverableEvents |= - (pChild->parent->deliverableEvents & - ~wDontPropagateMask(pChild) & PropagateMask); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } -} - -/** - * - * \param value must conform to DeleteType - */ -int -OtherClientGone(pointer value, XID id) -{ - register OtherClientsPtr other, prev; - register WindowPtr pWin = (WindowPtr)value; - - prev = 0; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (other->resource == id) - { - if (prev) - prev->next = other->next; - else - { - if (!(pWin->optional->otherClients = other->next)) - CheckWindowOptionalNeed (pWin); - } - xfree(other); - RecalculateDeliverableEvents(pWin); - return(Success); - } - prev = other; - } - FatalError("client not on event list"); - /*NOTREACHED*/ - return -1; /* make compiler happy */ -} - -int -EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask mask) -{ - Mask check; - OtherClients * others; - - if (mask & ~AllEventMasks) - { - client->errorValue = mask; - return BadValue; - } - check = (mask & AtMostOneClient); - if (check & (pWin->eventMask|wOtherEventMasks(pWin))) - { /* It is illegal for two different - clients to select on any of the - events for AtMostOneClient. However, - it is OK, for some client to - continue selecting on one of those - events. */ - if ((wClient(pWin) != client) && (check & pWin->eventMask)) - return BadAccess; - for (others = wOtherClients (pWin); others; others = others->next) - { - if (!SameClient(others, client) && (check & others->mask)) - return BadAccess; - } - } - if (wClient (pWin) == client) - { - check = pWin->eventMask; -#ifdef SGIMISC - pWin->eventMask = - (mask & ~SGIMiscSpecialDestroyMask) | (pWin->eventMask & SGIMiscSpecialDestroyMask); -#else - pWin->eventMask = mask; -#endif - } - else - { - for (others = wOtherClients (pWin); others; others = others->next) - { - if (SameClient(others, client)) - { - check = others->mask; -#ifdef SGIMISC - mask = (mask & ~SGIMiscSpecialDestroyMask) | (others->mask & SGIMiscSpecialDestroyMask); -#endif - if (mask == 0) - { - FreeResource(others->resource, RT_NONE); - return Success; - } - else - others->mask = mask; - goto maskSet; - } - } - check = 0; - if (!pWin->optional && !MakeWindowOptional (pWin)) - return BadAlloc; - others = (OtherClients *) xalloc(sizeof(OtherClients)); - if (!others) - return BadAlloc; - others->mask = mask; - others->resource = FakeClientID(client->index); - others->next = pWin->optional->otherClients; - pWin->optional->otherClients = others; - if (!AddResource(others->resource, RT_OTHERCLIENT, (pointer)pWin)) - return BadAlloc; - } -maskSet: - if ((inputInfo.pointer->valuator->motionHintWindow == pWin) && - (mask & PointerMotionHintMask) && - !(check & PointerMotionHintMask) && - !inputInfo.pointer->grab) - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - RecalculateDeliverableEvents(pWin); - return Success; -} - -int -EventSuppressForWindow(register WindowPtr pWin, register ClientPtr client, - Mask mask, Bool *checkOptional) -{ - register int i, free; - - if ((mask & ~PropagateMask) && !permitOldBugs) - { - client->errorValue = mask; - return BadValue; - } - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]--; - if (!mask) - i = 0; - else - { - for (i = DNPMCOUNT, free = 0; --i > 0; ) - { - if (!DontPropagateRefCnts[i]) - free = i; - else if (mask == DontPropagateMasks[i]) - break; - } - if (!i && free) - { - i = free; - DontPropagateMasks[i] = mask; - } - } - if (i || !mask) - { - pWin->dontPropagate = i; - if (i) - DontPropagateRefCnts[i]++; - if (pWin->optional) - { - pWin->optional->dontPropagateMask = mask; - *checkOptional = TRUE; - } - } - else - { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]++; - return BadAlloc; - } - pWin->dontPropagate = 0; - pWin->optional->dontPropagateMask = mask; - } - RecalculateDeliverableEvents(pWin); - return Success; -} - -static WindowPtr -CommonAncestor( - register WindowPtr a, - register WindowPtr b) -{ - for (b = b->parent; b; b = b->parent) - if (IsParent(b, a)) return b; - return NullWindow; -} - -static void -EnterLeaveEvent( - int type, - int mode, - int detail, - register WindowPtr pWin, - Window child) -{ - xEvent event; - register DeviceIntPtr keybd = inputInfo.keyboard; - WindowPtr focus; - register DeviceIntPtr mouse = inputInfo.pointer; - register GrabPtr grab = mouse->grab; - Mask mask; - - if ((pWin == mouse->valuator->motionHintWindow) && - (detail != NotifyInferior)) - mouse->valuator->motionHintWindow = NullWindow; - if (grab) - { - mask = (pWin == grab->window) ? grab->eventMask : 0; - if (grab->ownerEvents) - mask |= EventMaskForClient(pWin, rClient(grab)); - } - else - { - mask = pWin->eventMask | wOtherEventMasks(pWin); - } - if (mask & filters[type]) - { - event.u.u.type = type; - event.u.u.detail = detail; - event.u.enterLeave.time = currentTime.milliseconds; - event.u.enterLeave.rootX = sprite.hot.x; - event.u.enterLeave.rootY = sprite.hot.y; - /* Counts on the same initial structure of crossing & button events! */ - FixUpEventFromWindow(&event, pWin, None, FALSE); - /* Enter/Leave events always set child */ - event.u.enterLeave.child = child; - event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ? - ELFlagSameScreen : 0; -#ifdef XKB - if (!noXkbExtension) { - event.u.enterLeave.state = mouse->button->state & 0x1f00; - event.u.enterLeave.state |= - XkbGrabStateFromRec(&keybd->key->xkbInfo->state); - } else -#endif - event.u.enterLeave.state = keybd->key->state | mouse->button->state; - event.u.enterLeave.mode = mode; - focus = keybd->focus->win; - if ((focus != NoneWin) && - ((pWin == focus) || (focus == PointerRootWin) || - IsParent(focus, pWin))) - event.u.enterLeave.flags |= ELFlagFocus; - if (grab) - (void)TryClientEvents(rClient(grab), &event, 1, mask, - filters[type], grab); - else - (void)DeliverEventsToWindow(pWin, &event, 1, filters[type], - NullGrab, 0); - } - if ((type == EnterNotify) && (mask & KeymapStateMask)) - { - xKeymapEvent ke; - -#ifdef XCSECURITY - ClientPtr client = grab ? rClient(grab) - : clients[CLIENT_ID(pWin->drawable.id)]; - if (!SecurityCheckDeviceAccess(client, keybd, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } - else -#endif - memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31); - ke.type = KeymapNotify; - if (grab) - (void)TryClientEvents(rClient(grab), (xEvent *)&ke, 1, mask, - KeymapStateMask, grab); - else - (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1, - KeymapStateMask, NullGrab, 0); - } -} - -static void -EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail) -{ - WindowPtr parent = child->parent; - - if (ancestor == parent) - return; - EnterNotifies(ancestor, parent, mode, detail); - EnterLeaveEvent(EnterNotify, mode, detail, parent, child->drawable.id); -} - -static void -LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail) -{ - register WindowPtr pWin; - - if (ancestor == child) - return; - for (pWin = child->parent; pWin != ancestor; pWin = pWin->parent) - { - EnterLeaveEvent(LeaveNotify, mode, detail, pWin, child->drawable.id); - child = pWin; - } -} - -static void -DoEnterLeaveEvents(WindowPtr fromWin, WindowPtr toWin, int mode) -{ - if (fromWin == toWin) - return; - if (IsParent(fromWin, toWin)) - { - EnterLeaveEvent(LeaveNotify, mode, NotifyInferior, fromWin, None); - EnterNotifies(fromWin, toWin, mode, NotifyVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyAncestor, toWin, None); - } - else if (IsParent(toWin, fromWin)) - { - EnterLeaveEvent(LeaveNotify, mode, NotifyAncestor, fromWin, None); - LeaveNotifies(fromWin, toWin, mode, NotifyVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyInferior, toWin, None); - } - else - { /* neither fromWin nor toWin is descendent of the other */ - WindowPtr common = CommonAncestor(toWin, fromWin); - /* common == NullWindow ==> different screens */ - EnterLeaveEvent(LeaveNotify, mode, NotifyNonlinear, fromWin, None); - LeaveNotifies(fromWin, common, mode, NotifyNonlinearVirtual); - EnterNotifies(common, toWin, mode, NotifyNonlinearVirtual); - EnterLeaveEvent(EnterNotify, mode, NotifyNonlinear, toWin, None); - } -} - -static void -FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin) -{ - xEvent event; - -#ifdef XINPUT - if (dev != inputInfo.keyboard) - { - DeviceFocusEvent(dev, type, mode, detail, pWin); - return; - } -#endif - event.u.focus.mode = mode; - event.u.u.type = type; - event.u.u.detail = detail; - event.u.focus.window = pWin->drawable.id; - (void)DeliverEventsToWindow(pWin, &event, 1, filters[type], NullGrab, - 0); - if ((type == FocusIn) && - ((pWin->eventMask | wOtherEventMasks(pWin)) & KeymapStateMask)) - { - xKeymapEvent ke; -#ifdef XCSECURITY - ClientPtr client = clients[CLIENT_ID(pWin->drawable.id)]; - if (!SecurityCheckDeviceAccess(client, dev, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } - else -#endif - memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31); - ke.type = KeymapNotify; - (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1, - KeymapStateMask, NullGrab, 0); - } -} - - /* - * recursive because it is easier - * no-op if child not descended from ancestor - */ -static Bool -FocusInEvents( - DeviceIntPtr dev, - WindowPtr ancestor, WindowPtr child, WindowPtr skipChild, - int mode, int detail, - Bool doAncestor) -{ - if (child == NullWindow) - return ancestor == NullWindow; - if (ancestor == child) - { - if (doAncestor) - FocusEvent(dev, FocusIn, mode, detail, child); - return TRUE; - } - if (FocusInEvents(dev, ancestor, child->parent, skipChild, mode, detail, - doAncestor)) - { - if (child != skipChild) - FocusEvent(dev, FocusIn, mode, detail, child); - return TRUE; - } - return FALSE; -} - -/* dies horribly if ancestor is not an ancestor of child */ -static void -FocusOutEvents( - DeviceIntPtr dev, - WindowPtr child, WindowPtr ancestor, - int mode, int detail, - Bool doAncestor) -{ - register WindowPtr pWin; - - for (pWin = child; pWin != ancestor; pWin = pWin->parent) - FocusEvent(dev, FocusOut, mode, detail, pWin); - if (doAncestor) - FocusEvent(dev, FocusOut, mode, detail, ancestor); -} - -void -DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode) -{ - int out, in; /* for holding details for to/from - PointerRoot/None */ - int i; - - if (fromWin == toWin) - return; - out = (fromWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; - in = (toWin == NoneWin) ? NotifyDetailNone : NotifyPointerRoot; - /* wrong values if neither, but then not referenced */ - - if ((toWin == NullWindow) || (toWin == PointerRootWin)) - { - if ((fromWin == NullWindow) || (fromWin == PointerRootWin)) - { - if (fromWin == PointerRootWin) - FocusOutEvents(dev, sprite.win, ROOT, mode, NotifyPointer, - TRUE); - /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusOut, mode, out, WindowTable[0]); - else -#endif - for (i=0; iparent, NullWindow, mode, - NotifyNonlinearVirtual, FALSE); - } - /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - FocusEvent(dev, FocusIn, mode, in, WindowTable[0]); - else -#endif - for (i=0; iparent != NullWindow) - (void)FocusInEvents(dev, ROOT, toWin, toWin, mode, - NotifyNonlinearVirtual, TRUE); - FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin); - if (IsParent(toWin, sprite.win)) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, mode, - NotifyPointer, FALSE); - } - else - { - if (IsParent(toWin, fromWin)) - { - FocusEvent(dev, FocusOut, mode, NotifyAncestor, fromWin); - FocusOutEvents(dev, fromWin->parent, toWin, mode, - NotifyVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyInferior, toWin); - if ((IsParent(toWin, sprite.win)) && - (sprite.win != fromWin) && - (!IsParent(fromWin, sprite.win)) && - (!IsParent(sprite.win, fromWin))) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, - mode, NotifyPointer, FALSE); - } - else - if (IsParent(fromWin, toWin)) - { - if ((IsParent(fromWin, sprite.win)) && - (sprite.win != fromWin) && - (!IsParent(toWin, sprite.win)) && - (!IsParent(sprite.win, toWin))) - FocusOutEvents(dev, sprite.win, fromWin, mode, - NotifyPointer, FALSE); - FocusEvent(dev, FocusOut, mode, NotifyInferior, fromWin); - (void)FocusInEvents(dev, fromWin, toWin, toWin, mode, - NotifyVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyAncestor, toWin); - } - else - { - /* neither fromWin or toWin is child of other */ - WindowPtr common = CommonAncestor(toWin, fromWin); - /* common == NullWindow ==> different screens */ - if (IsParent(fromWin, sprite.win)) - FocusOutEvents(dev, sprite.win, fromWin, mode, - NotifyPointer, FALSE); - FocusEvent(dev, FocusOut, mode, NotifyNonlinear, fromWin); - if (fromWin->parent != NullWindow) - FocusOutEvents(dev, fromWin->parent, common, mode, - NotifyNonlinearVirtual, FALSE); - if (toWin->parent != NullWindow) - (void)FocusInEvents(dev, common, toWin, toWin, mode, - NotifyNonlinearVirtual, FALSE); - FocusEvent(dev, FocusIn, mode, NotifyNonlinear, toWin); - if (IsParent(toWin, sprite.win)) - (void)FocusInEvents(dev, toWin, sprite.win, NullWindow, - mode, NotifyPointer, FALSE); - } - } - } -} - -int -SetInputFocus( - ClientPtr client, - DeviceIntPtr dev, - Window focusID, - CARD8 revertTo, - Time ctime, - Bool followOK) -{ - register FocusClassPtr focus; - register WindowPtr focusWin; - int mode; - TimeStamp time; - - UpdateCurrentTime(); - if ((revertTo != RevertToParent) && - (revertTo != RevertToPointerRoot) && - (revertTo != RevertToNone) && - ((revertTo != RevertToFollowKeyboard) || !followOK)) - { - client->errorValue = revertTo; - return BadValue; - } - time = ClientTimeToServerTime(ctime); - if ((focusID == None) || (focusID == PointerRoot)) - focusWin = (WindowPtr)(long)focusID; - else if ((focusID == FollowKeyboard) && followOK) - focusWin = inputInfo.keyboard->focus->win; - else if (!(focusWin = SecurityLookupWindow(focusID, client, - SecurityReadAccess))) - return BadWindow; - else - { - /* It is a match error to try to set the input focus to an - unviewable window. */ - - if(!focusWin->realized) - return(BadMatch); - } - focus = dev->focus; - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, focus->time) == EARLIER)) - return Success; - mode = (dev->grab) ? NotifyWhileGrabbed : NotifyNormal; - if (focus->win == FollowKeyboardWin) - DoFocusEvents(dev, inputInfo.keyboard->focus->win, focusWin, mode); - else - DoFocusEvents(dev, focus->win, focusWin, mode); - focus->time = time; - focus->revert = revertTo; - if (focusID == FollowKeyboard) - focus->win = FollowKeyboardWin; - else - focus->win = focusWin; - if ((focusWin == NoneWin) || (focusWin == PointerRootWin)) - focus->traceGood = 0; - else - { - int depth = 0; - register WindowPtr pWin; - - for (pWin = focusWin; pWin; pWin = pWin->parent) depth++; - if (depth > focus->traceSize) - { - focus->traceSize = depth+1; - Must_have_memory = TRUE; /* XXX */ - focus->trace = (WindowPtr *)xrealloc(focus->trace, - focus->traceSize * - sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ - } - focus->traceGood = depth; - for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--) - focus->trace[depth] = pWin; - } - return Success; -} - -int -ProcSetInputFocus(client) - ClientPtr client; -{ - REQUEST(xSetInputFocusReq); - - REQUEST_SIZE_MATCH(xSetInputFocusReq); -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) - return Success; -#endif - return SetInputFocus(client, inputInfo.keyboard, stuff->focus, - stuff->revertTo, stuff->time, FALSE); -} - -int -ProcGetInputFocus(ClientPtr client) -{ - xGetInputFocusReply rep; - /* REQUEST(xReq); */ - FocusClassPtr focus = inputInfo.keyboard->focus; - - REQUEST_SIZE_MATCH(xReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (focus->win == NoneWin) - rep.focus = None; - else if (focus->win == PointerRootWin) - rep.focus = PointerRoot; - else rep.focus = focus->win->drawable.id; - rep.revertTo = focus->revert; - WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep); - return Success; -} - -int -ProcGrabPointer(ClientPtr client) -{ - xGrabPointerReply rep; - DeviceIntPtr device = inputInfo.pointer; - GrabPtr grab; - WindowPtr pWin, confineTo; - CursorPtr cursor, oldCursor; - REQUEST(xGrabPointerReq); - TimeStamp time; - - REQUEST_SIZE_MATCH(xGrabPointerReq); - UpdateCurrentTime(); - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue)) - { - client->errorValue = stuff->ownerEvents; - return BadValue; - } - if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (stuff->confineTo == None) - confineTo = NullWindow; - else - { - confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); - if (!confineTo) - return BadWindow; - } - if (stuff->cursor == None) - cursor = NullCursor; - else - { - cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - /* at this point, some sort of reply is guaranteed. */ - time = ClientTimeToServerTime(stuff->time); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - grab = device->grab; - if ((grab) && !SameClient(grab, client)) - rep.status = AlreadyGrabbed; - else if ((!pWin->realized) || - (confineTo && - !(confineTo->realized && BorderSizeNotEmpty(confineTo)))) - rep.status = GrabNotViewable; - else if (device->sync.frozen && - device->sync.other && !SameClient(device->sync.other, client)) - rep.status = GrabFrozen; - else if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, device->grabTime) == EARLIER)) - rep.status = GrabInvalidTime; - else - { - GrabRec tempGrab; - - oldCursor = NullCursor; - if (grab) - { - if (grab->confineTo && !confineTo) - ConfineCursorToWindow(ROOT, FALSE, FALSE); - oldCursor = grab->cursor; - } - tempGrab.cursor = cursor; - tempGrab.resource = client->clientAsMask; - tempGrab.ownerEvents = stuff->ownerEvents; - tempGrab.eventMask = stuff->eventMask; - tempGrab.confineTo = confineTo; - tempGrab.window = pWin; - tempGrab.keyboardMode = stuff->keyboardMode; - tempGrab.pointerMode = stuff->pointerMode; - tempGrab.device = device; - (*device->ActivateGrab)(device, &tempGrab, time, FALSE); - if (oldCursor) - FreeCursor (oldCursor, (Cursor)0); - rep.status = GrabSuccess; - } - WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep); - return Success; -} - -int -ProcChangeActivePointerGrab(ClientPtr client) -{ - DeviceIntPtr device = inputInfo.pointer; - register GrabPtr grab = device->grab; - CursorPtr newCursor, oldCursor; - REQUEST(xChangeActivePointerGrabReq); - TimeStamp time; - - REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); - if ((stuff->eventMask & ~PointerGrabMask) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - if (stuff->cursor == None) - newCursor = NullCursor; - else - { - newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!newCursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - if (!grab) - return Success; - if (!SameClient(grab, client)) - return Success; - time = ClientTimeToServerTime(stuff->time); - if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, device->grabTime) == EARLIER)) - return Success; - oldCursor = grab->cursor; - grab->cursor = newCursor; - if (newCursor) - newCursor->refcnt++; - PostNewCursor(); - if (oldCursor) - FreeCursor(oldCursor, (Cursor)0); - grab->eventMask = stuff->eventMask; - return Success; -} - -int -ProcUngrabPointer(ClientPtr client) -{ - DeviceIntPtr device = inputInfo.pointer; - GrabPtr grab; - TimeStamp time; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - UpdateCurrentTime(); - grab = device->grab; - time = ClientTimeToServerTime(stuff->id); - if ((CompareTimeStamps(time, currentTime) != LATER) && - (CompareTimeStamps(time, device->grabTime) != EARLIER) && - (grab) && SameClient(grab, client)) - (*device->DeactivateGrab)(device); - return Success; -} - -int -GrabDevice(register ClientPtr client, register DeviceIntPtr dev, - unsigned this_mode, unsigned other_mode, Window grabWindow, - unsigned ownerEvents, Time ctime, Mask mask, CARD8 *status) -{ - register WindowPtr pWin; - register GrabPtr grab; - TimeStamp time; - - UpdateCurrentTime(); - if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync)) - { - client->errorValue = this_mode; - return BadValue; - } - if ((other_mode != GrabModeSync) && (other_mode != GrabModeAsync)) - { - client->errorValue = other_mode; - return BadValue; - } - if ((ownerEvents != xFalse) && (ownerEvents != xTrue)) - { - client->errorValue = ownerEvents; - return BadValue; - } - pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - time = ClientTimeToServerTime(ctime); - grab = dev->grab; - if (grab && !SameClient(grab, client)) - *status = AlreadyGrabbed; - else if (!pWin->realized) - *status = GrabNotViewable; - else if ((CompareTimeStamps(time, currentTime) == LATER) || - (CompareTimeStamps(time, dev->grabTime) == EARLIER)) - *status = GrabInvalidTime; - else if (dev->sync.frozen && - dev->sync.other && !SameClient(dev->sync.other, client)) - *status = GrabFrozen; - else - { - GrabRec tempGrab; - - tempGrab.window = pWin; - tempGrab.resource = client->clientAsMask; - tempGrab.ownerEvents = ownerEvents; - tempGrab.keyboardMode = this_mode; - tempGrab.pointerMode = other_mode; - tempGrab.eventMask = mask; - tempGrab.device = dev; - (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE); - *status = GrabSuccess; - } - return Success; -} - -int -ProcGrabKeyboard(ClientPtr client) -{ - xGrabKeyboardReply rep; - REQUEST(xGrabKeyboardReq); - int result; - - REQUEST_SIZE_MATCH(xGrabKeyboardReq); -#ifdef XCSECURITY - if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) - { - result = Success; - rep.status = AlreadyGrabbed; - } - else -#endif - result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode, - stuff->pointerMode, stuff->grabWindow, - stuff->ownerEvents, stuff->time, - KeyPressMask | KeyReleaseMask, &rep.status); - if (result != Success) - return result; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep); - return Success; -} - -int -ProcUngrabKeyboard(ClientPtr client) -{ - DeviceIntPtr device = inputInfo.keyboard; - GrabPtr grab; - TimeStamp time; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - UpdateCurrentTime(); - grab = device->grab; - time = ClientTimeToServerTime(stuff->id); - if ((CompareTimeStamps(time, currentTime) != LATER) && - (CompareTimeStamps(time, device->grabTime) != EARLIER) && - (grab) && SameClient(grab, client)) - (*device->DeactivateGrab)(device); - return Success; -} - -int -ProcQueryPointer(ClientPtr client) -{ - xQueryPointerReply rep; - WindowPtr pWin, t; - REQUEST(xResourceReq); - DeviceIntPtr mouse = inputInfo.pointer; - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (mouse->valuator->motionHintWindow) - MaybeStopHint(mouse, client); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.mask = mouse->button->state | inputInfo.keyboard->key->state; - rep.length = 0; - rep.root = (ROOT)->drawable.id; - rep.rootX = sprite.hot.x; - rep.rootY = sprite.hot.y; - rep.child = None; - if (sprite.hot.pScreen == pWin->drawable.pScreen) - { - rep.sameScreen = xTrue; - rep.winX = sprite.hot.x - pWin->drawable.x; - rep.winY = sprite.hot.y - pWin->drawable.y; - for (t = sprite.win; t; t = t->parent) - if (t->parent == pWin) - { - rep.child = t->drawable.id; - break; - } - } - else - { - rep.sameScreen = xFalse; - rep.winX = 0; - rep.winY = 0; - } - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - rep.rootX += panoramiXdataPtr[0].x; - rep.rootY += panoramiXdataPtr[0].y; - if(stuff->id == rep.root) { - rep.winX += panoramiXdataPtr[0].x; - rep.winY += panoramiXdataPtr[0].y; - } - } -#endif - - WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep); - - return(Success); -} - -void -InitEvents() -{ - int i; - - sprite.hot.pScreen = sprite.hotPhys.pScreen = (ScreenPtr)NULL; - inputInfo.numDevices = 0; - inputInfo.devices = (DeviceIntPtr)NULL; - inputInfo.off_devices = (DeviceIntPtr)NULL; - inputInfo.keyboard = (DeviceIntPtr)NULL; - inputInfo.pointer = (DeviceIntPtr)NULL; - if (spriteTraceSize == 0) - { - spriteTraceSize = 32; - spriteTrace = (WindowPtr *)xalloc(32*sizeof(WindowPtr)); - if (!spriteTrace) - FatalError("failed to allocate spriteTrace"); - } - spriteTraceGood = 0; - lastEventMask = OwnerGrabButtonMask; - filters[MotionNotify] = PointerMotionMask; -#ifdef XEVIE - xeviewin = -#endif - sprite.win = NullWindow; - sprite.current = NullCursor; - sprite.hotLimits.x1 = 0; - sprite.hotLimits.y1 = 0; - sprite.hotLimits.x2 = 0; - sprite.hotLimits.y2 = 0; - sprite.confined = FALSE; - syncEvents.replayDev = (DeviceIntPtr)NULL; - syncEvents.replayWin = NullWindow; - while (syncEvents.pending) - { - QdEventPtr next = syncEvents.pending->next; - xfree(syncEvents.pending); - syncEvents.pending = next; - } - syncEvents.pendtail = &syncEvents.pending; - syncEvents.playingEvents = FALSE; - syncEvents.time.months = 0; - syncEvents.time.milliseconds = 0; /* hardly matters */ - currentTime.months = 0; - currentTime.milliseconds = GetTimeInMillis(); - lastDeviceEventTime = currentTime; - for (i = 0; i < DNPMCOUNT; i++) - { - DontPropagateMasks[i] = 0; - DontPropagateRefCnts[i] = 0; - } -} - -void -CloseDownEvents(void) -{ - xfree(spriteTrace); - spriteTrace = NULL; - spriteTraceSize = 0; -} - -int -ProcSendEvent(ClientPtr client) -{ - WindowPtr pWin; - WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */ - REQUEST(xSendEventReq); - - REQUEST_SIZE_MATCH(xSendEventReq); - - /* The client's event type must be a core event type or one defined by an - extension. */ - - if ( ! ((stuff->event.u.u.type > X_Reply && - stuff->event.u.u.type < LASTEvent) || - (stuff->event.u.u.type >= EXTENSION_EVENT_BASE && - stuff->event.u.u.type < (unsigned)lastEvent))) - { - client->errorValue = stuff->event.u.u.type; - return BadValue; - } - if (stuff->event.u.u.type == ClientMessage && - stuff->event.u.u.detail != 8 && - stuff->event.u.u.detail != 16 && - stuff->event.u.u.detail != 32 && - !permitOldBugs) - { - client->errorValue = stuff->event.u.u.detail; - return BadValue; - } - if ((stuff->eventMask & ~AllEventMasks) && !permitOldBugs) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - - if (stuff->destination == PointerWindow) - pWin = sprite.win; - else if (stuff->destination == InputFocus) - { - WindowPtr inputFocus = inputInfo.keyboard->focus->win; - - if (inputFocus == NoneWin) - return Success; - - /* If the input focus is PointerRootWin, send the event to where - the pointer is if possible, then perhaps propogate up to root. */ - if (inputFocus == PointerRootWin) - inputFocus = ROOT; - - if (IsParent(inputFocus, sprite.win)) - { - effectiveFocus = inputFocus; - pWin = sprite.win; - } - else - effectiveFocus = pWin = inputFocus; - } - else - pWin = SecurityLookupWindow(stuff->destination, client, - SecurityReadAccess); - if (!pWin) - return BadWindow; - if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) - { - client->errorValue = stuff->propagate; - return BadValue; - } - stuff->event.u.u.type |= 0x80; - if (stuff->propagate) - { - for (;pWin; pWin = pWin->parent) - { - if (DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask, - NullGrab, 0)) - return Success; - if (pWin == effectiveFocus) - return Success; - stuff->eventMask &= ~wDontPropagateMask(pWin); - if (!stuff->eventMask) - break; - } - } - else - (void)DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask, - NullGrab, 0); - return Success; -} - -int -ProcUngrabKey(ClientPtr client) -{ - REQUEST(xUngrabKeyReq); - WindowPtr pWin; - GrabRec tempGrab; - DeviceIntPtr keybd = inputInfo.keyboard; - - REQUEST_SIZE_MATCH(xUngrabKeyReq); - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - - if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) || - (stuff->key < keybd->key->curKeySyms.minKeyCode)) - && (stuff->key != AnyKey)) - { - client->errorValue = stuff->key; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - tempGrab.resource = client->clientAsMask; - tempGrab.device = keybd; - tempGrab.window = pWin; - tempGrab.modifiersDetail.exact = stuff->modifiers; - tempGrab.modifiersDetail.pMask = NULL; - tempGrab.modifierDevice = inputInfo.keyboard; - tempGrab.type = KeyPress; - tempGrab.detail.exact = stuff->key; - tempGrab.detail.pMask = NULL; - - if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); -} - -int -ProcGrabKey(ClientPtr client) -{ - WindowPtr pWin; - REQUEST(xGrabKeyReq); - GrabPtr grab; - DeviceIntPtr keybd = inputInfo.keyboard; - - REQUEST_SIZE_MATCH(xGrabKeyReq); - if ((stuff->ownerEvents != xTrue) && (stuff->ownerEvents != xFalse)) - { - client->errorValue = stuff->ownerEvents; - return(BadValue); - } - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if (((stuff->key > keybd->key->curKeySyms.maxKeyCode) || - (stuff->key < keybd->key->curKeySyms.minKeyCode)) - && (stuff->key != AnyKey)) - { - client->errorValue = stuff->key; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - - grab = CreateGrab(client->index, keybd, pWin, - (Mask)(KeyPressMask | KeyReleaseMask), (Bool)stuff->ownerEvents, - (Bool)stuff->keyboardMode, (Bool)stuff->pointerMode, - keybd, stuff->modifiers, KeyPress, stuff->key, - NullWindow, NullCursor); - if (!grab) - return BadAlloc; - return AddPassiveGrabToList(grab); -} - - -int -ProcGrabButton(ClientPtr client) -{ - WindowPtr pWin, confineTo; - REQUEST(xGrabButtonReq); - CursorPtr cursor; - GrabPtr grab; - - REQUEST_SIZE_MATCH(xGrabButtonReq); - if ((stuff->pointerMode != GrabModeSync) && - (stuff->pointerMode != GrabModeAsync)) - { - client->errorValue = stuff->pointerMode; - return BadValue; - } - if ((stuff->keyboardMode != GrabModeSync) && - (stuff->keyboardMode != GrabModeAsync)) - { - client->errorValue = stuff->keyboardMode; - return BadValue; - } - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - if ((stuff->ownerEvents != xFalse) && (stuff->ownerEvents != xTrue)) - { - client->errorValue = stuff->ownerEvents; - return BadValue; - } - if (stuff->eventMask & ~PointerGrabMask) - { - client->errorValue = stuff->eventMask; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - if (stuff->confineTo == None) - confineTo = NullWindow; - else { - confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); - if (!confineTo) - return BadWindow; - } - if (stuff->cursor == None) - cursor = NullCursor; - else - { - cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursor) - { - client->errorValue = stuff->cursor; - return BadCursor; - } - } - - - grab = CreateGrab(client->index, inputInfo.pointer, pWin, - permitOldBugs ? (Mask)(stuff->eventMask | - ButtonPressMask | ButtonReleaseMask) : - (Mask)stuff->eventMask, - (Bool)stuff->ownerEvents, (Bool) stuff->keyboardMode, - (Bool)stuff->pointerMode, inputInfo.keyboard, stuff->modifiers, - ButtonPress, stuff->button, confineTo, cursor); - if (!grab) - return BadAlloc; - return AddPassiveGrabToList(grab); -} - -int -ProcUngrabButton(ClientPtr client) -{ - REQUEST(xUngrabButtonReq); - WindowPtr pWin; - GrabRec tempGrab; - - REQUEST_SIZE_MATCH(xUngrabButtonReq); - if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - client->errorValue = stuff->modifiers; - return BadValue; - } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); - if (!pWin) - return BadWindow; - tempGrab.resource = client->clientAsMask; - tempGrab.device = inputInfo.pointer; - tempGrab.window = pWin; - tempGrab.modifiersDetail.exact = stuff->modifiers; - tempGrab.modifiersDetail.pMask = NULL; - tempGrab.modifierDevice = inputInfo.keyboard; - tempGrab.type = ButtonPress; - tempGrab.detail.exact = stuff->button; - tempGrab.detail.pMask = NULL; - - if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); -} - -void -DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources) -{ - WindowPtr parent; - DeviceIntPtr mouse = inputInfo.pointer; - DeviceIntPtr keybd = inputInfo.keyboard; - FocusClassPtr focus = keybd->focus; - OtherClientsPtr oc; - GrabPtr passive; - - - /* Deactivate any grabs performed on this window, before making any - input focus changes. */ - - if (mouse->grab && - ((mouse->grab->window == pWin) || (mouse->grab->confineTo == pWin))) - (*mouse->DeactivateGrab)(mouse); - - /* Deactivating a keyboard grab should cause focus events. */ - - if (keybd->grab && (keybd->grab->window == pWin)) - (*keybd->DeactivateGrab)(keybd); - - /* If the focus window is a root window (ie. has no parent) then don't - delete the focus from it. */ - - if ((pWin == focus->win) && (pWin->parent != NullWindow)) - { - int focusEventMode = NotifyNormal; - - /* If a grab is in progress, then alter the mode of focus events. */ - - if (keybd->grab) - focusEventMode = NotifyWhileGrabbed; - - switch (focus->revert) - { - case RevertToNone: - DoFocusEvents(keybd, pWin, NoneWin, focusEventMode); - focus->win = NoneWin; - focus->traceGood = 0; - break; - case RevertToParent: - parent = pWin; - do - { - parent = parent->parent; - focus->traceGood--; - } while (!parent->realized -/* This would be a good protocol change -- windows being reparented - during SaveSet processing would cause the focus to revert to the - nearest enclosing window which will survive the death of the exiting - client, instead of ending up reverting to a dying window and thence - to None - */ -#ifdef NOTDEF - || clients[CLIENT_ID(parent->drawable.id)]->clientGone -#endif - ); - DoFocusEvents(keybd, pWin, parent, focusEventMode); - focus->win = parent; - focus->revert = RevertToNone; - break; - case RevertToPointerRoot: - DoFocusEvents(keybd, pWin, PointerRootWin, focusEventMode); - focus->win = PointerRootWin; - focus->traceGood = 0; - break; - } - } - - if (mouse->valuator->motionHintWindow == pWin) - mouse->valuator->motionHintWindow = NullWindow; - - if (freeResources) - { - if (pWin->dontPropagate) - DontPropagateRefCnts[pWin->dontPropagate]--; - while ( (oc = wOtherClients(pWin)) ) - FreeResource(oc->resource, RT_NONE); - while ( (passive = wPassiveGrabs(pWin)) ) - FreeResource(passive->resource, RT_NONE); - } -#ifdef XINPUT - DeleteWindowFromAnyExtEvents(pWin, freeResources); -#endif -} - -/** - * Call this whenever some window at or below pWin has changed geometry - */ -void -CheckCursorConfinement(WindowPtr pWin) -{ - GrabPtr grab = inputInfo.pointer->grab; - WindowPtr confineTo; - -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return; -#endif - - if (grab && (confineTo = grab->confineTo)) - { - if (!BorderSizeNotEmpty(confineTo)) - (*inputInfo.pointer->DeactivateGrab)(inputInfo.pointer); - else if ((pWin == confineTo) || IsParent(pWin, confineTo)) - ConfineCursorToWindow(confineTo, TRUE, TRUE); - } -} - -Mask -EventMaskForClient(WindowPtr pWin, ClientPtr client) -{ - register OtherClientsPtr other; - - if (wClient (pWin) == client) - return pWin->eventMask; - for (other = wOtherClients(pWin); other; other = other->next) - { - if (SameClient(other, client)) - return other->mask; - } - return 0; -} - -int -ProcRecolorCursor(ClientPtr client) -{ - CursorPtr pCursor; - int nscr; - ScreenPtr pscr; - Bool displayed; - REQUEST(xRecolorCursorReq); - - REQUEST_SIZE_MATCH(xRecolorCursorReq); - pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityWriteAccess); - if ( !pCursor) - { - client->errorValue = stuff->cursor; - return (BadCursor); - } - - pCursor->foreRed = stuff->foreRed; - pCursor->foreGreen = stuff->foreGreen; - pCursor->foreBlue = stuff->foreBlue; - - pCursor->backRed = stuff->backRed; - pCursor->backGreen = stuff->backGreen; - pCursor->backBlue = stuff->backBlue; - - for (nscr = 0; nscr < screenInfo.numScreens; nscr++) - { - pscr = screenInfo.screens[nscr]; -#ifdef PANORAMIX - if(!noPanoramiXExtension) - displayed = (pscr == sprite.screen); - else -#endif - displayed = (pscr == sprite.hotPhys.pScreen); - ( *pscr->RecolorCursor)(pscr, pCursor, - (pCursor == sprite.current) && displayed); - } - return (Success); -} - -void -WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) -{ -#ifdef PANORAMIX - xEvent eventCopy; -#endif - xEvent eventTo, *eventFrom; - int i; - -#ifdef XKB - if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events))) - return; -#endif - -#ifdef PANORAMIX - if(!noPanoramiXExtension && - (panoramiXdataPtr[0].x || panoramiXdataPtr[0].y)) - { - switch(events->u.u.type) { - case MotionNotify: - case ButtonPress: - case ButtonRelease: - case KeyPress: - case KeyRelease: - case EnterNotify: - case LeaveNotify: - /* - When multiple clients want the same event DeliverEventsToWindow - passes the same event structure multiple times so we can't - modify the one passed to us - */ - count = 1; /* should always be 1 */ - memcpy(&eventCopy, events, sizeof(xEvent)); - eventCopy.u.keyButtonPointer.rootX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.rootY += panoramiXdataPtr[0].y; - if(eventCopy.u.keyButtonPointer.event == - eventCopy.u.keyButtonPointer.root) - { - eventCopy.u.keyButtonPointer.eventX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.eventY += panoramiXdataPtr[0].y; - } - events = &eventCopy; - break; - default: break; - } - } -#endif - - if (EventCallback) - { - EventInfoRec eventinfo; - eventinfo.client = pClient; - eventinfo.events = events; - eventinfo.count = count; - CallCallbacks(&EventCallback, (pointer)&eventinfo); - } - if(pClient->swapped) - { - for(i = 0; i < count; i++) - { - eventFrom = &events[i]; - /* Remember to strip off the leading bit of type in case - this event was sent with "SendEvent." */ - (*EventSwapVector[eventFrom->u.u.type & 0177]) - (eventFrom, &eventTo); - (void)WriteToClient(pClient, sizeof(xEvent), (char *)&eventTo); - } - } - else - { - (void)WriteToClient(pClient, count * sizeof(xEvent), (char *) events); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original deleted file mode 100644 index ead9b9d28..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original +++ /dev/null @@ -1,508 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.11 2001/12/14 19:59:31 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: extension.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#define NEED_EVENTS -#define NEED_REPLIES -#include -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "gcstruct.h" -#include "scrnintstr.h" -#include "../../dix/dispatch.h" -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif -#ifdef LBX -#include "lbxserve.h" -#endif - -#include "Trap.h" - -#define EXTENSION_BASE 128 -#define EXTENSION_EVENT_BASE 64 -#define LAST_EVENT 128 -#define LAST_ERROR 255 - -ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS]; - -static ExtensionEntry **extensions = (ExtensionEntry **)NULL; - -int lastEvent = EXTENSION_EVENT_BASE; -static int lastError = FirstExtensionError; -static unsigned int NumExtensions = 0; - -ExtensionEntry * -AddExtension(char *name, int NumEvents, int NumErrors, - int (*MainProc)(ClientPtr c1), - int (*SwappedMainProc)(ClientPtr c2), - void (*CloseDownProc)(ExtensionEntry *e), - unsigned short (*MinorOpcodeProc)(ClientPtr c3)) -{ - int i; - register ExtensionEntry *ext, **newexts; - - if (!MainProc || !SwappedMainProc || !CloseDownProc || !MinorOpcodeProc) - return((ExtensionEntry *) NULL); - if ((lastEvent + NumEvents > LAST_EVENT) || - (unsigned)(lastError + NumErrors > LAST_ERROR)) - return((ExtensionEntry *) NULL); - - ext = (ExtensionEntry *) xalloc(sizeof(ExtensionEntry)); - if (!ext) - return((ExtensionEntry *) NULL); - ext->name = (char *)xalloc(strlen(name) + 1); - ext->num_aliases = 0; - ext->aliases = (char **)NULL; - if (!ext->name) - { - xfree(ext); - return((ExtensionEntry *) NULL); - } - strcpy(ext->name, name); - i = NumExtensions; - newexts = (ExtensionEntry **) xrealloc(extensions, - (i + 1) * sizeof(ExtensionEntry *)); - if (!newexts) - { - xfree(ext->name); - xfree(ext); - return((ExtensionEntry *) NULL); - } - NumExtensions++; - extensions = newexts; - extensions[i] = ext; - ext->index = i; - ext->base = i + EXTENSION_BASE; - ext->CloseDown = CloseDownProc; - ext->MinorOpcode = MinorOpcodeProc; - ProcVector[i + EXTENSION_BASE] = MainProc; - SwappedProcVector[i + EXTENSION_BASE] = SwappedMainProc; - if (NumEvents) - { - ext->eventBase = lastEvent; - ext->eventLast = lastEvent + NumEvents; - lastEvent += NumEvents; - } - else - { - ext->eventBase = 0; - ext->eventLast = 0; - } - if (NumErrors) - { - ext->errorBase = lastError; - ext->errorLast = lastError + NumErrors; - lastError += NumErrors; - } - else - { - ext->errorBase = 0; - ext->errorLast = 0; - } -#ifdef XCSECURITY - ext->secure = FALSE; -#endif - -#ifdef LBX - (void) LbxAddExtension(name, ext->base, ext->eventBase, ext->errorBase); -#endif - return(ext); -} - -Bool AddExtensionAlias(char *alias, ExtensionEntry *ext) -{ - char *name; - char **aliases; - - aliases = (char **)xrealloc(ext->aliases, - (ext->num_aliases + 1) * sizeof(char *)); - if (!aliases) - return FALSE; - ext->aliases = aliases; - name = (char *)xalloc(strlen(alias) + 1); - if (!name) - return FALSE; - strcpy(name, alias); - ext->aliases[ext->num_aliases] = name; - ext->num_aliases++; -#ifdef LBX - return LbxAddExtensionAlias(ext->index, alias); -#else - return TRUE; -#endif -} - -static int -FindExtension(char *extname, int len) -{ - int i, j; - - for (i=0; iname) == len) && - !strncmp(extname, extensions[i]->name, len)) - break; - for (j = extensions[i]->num_aliases; --j >= 0;) - { - if ((strlen(extensions[i]->aliases[j]) == len) && - !strncmp(extname, extensions[i]->aliases[j], len)) - break; - } - if (j >= 0) break; - } - return ((i == NumExtensions) ? -1 : i); -} - -/* - * CheckExtension returns the extensions[] entry for the requested - * extension name. Maybe this could just return a Bool instead? - */ -ExtensionEntry * -CheckExtension(const char *extname) -{ - int n; - - n = FindExtension((char*)extname, strlen(extname)); - if (n != -1) - return extensions[n]; - else - return NULL; -} - -void -DeclareExtensionSecurity(char *extname, Bool secure) -{ -#ifdef XCSECURITY - int i = FindExtension(extname, strlen(extname)); - if (i >= 0) - { - int majorop = extensions[i]->base; - extensions[i]->secure = secure; - if (secure) - { - UntrustedProcVector[majorop] = ProcVector[majorop]; - SwappedUntrustedProcVector[majorop] = SwappedProcVector[majorop]; - } - else - { - UntrustedProcVector[majorop] = ProcBadRequest; - SwappedUntrustedProcVector[majorop] = ProcBadRequest; - } - } -#endif -#ifdef LBX - LbxDeclareExtensionSecurity(extname, secure); -#endif -} - -unsigned short -StandardMinorOpcode(ClientPtr client) -{ - return ((xReq *)client->requestBuffer)->data; -} - -unsigned short -MinorOpcodeOfRequest(ClientPtr client) -{ - unsigned char major; - - major = ((xReq *)client->requestBuffer)->reqType; - if (major < EXTENSION_BASE) - return 0; - major -= EXTENSION_BASE; - if (major >= NumExtensions) - return 0; - return (*extensions[major]->MinorOpcode)(client); -} - -void -CloseDownExtensions() -{ - register int i,j; - -#ifdef LBX - LbxCloseDownExtensions(); -#endif - - for (i = NumExtensions - 1; i >= 0; i--) - { - (* extensions[i]->CloseDown)(extensions[i]); - NumExtensions = i; - xfree(extensions[i]->name); - for (j = extensions[i]->num_aliases; --j >= 0;) - xfree(extensions[i]->aliases[j]); - xfree(extensions[i]->aliases); - xfree(extensions[i]); - } - xfree(extensions); - extensions = (ExtensionEntry **)NULL; - lastEvent = EXTENSION_EVENT_BASE; - lastError = FirstExtensionError; - for (i=0; inum) - { - spentry->num--; - xfree(spentry->procList[spentry->num].name); - } - xfree(spentry->procList); - spentry->procList = (ProcEntryPtr)NULL; - } -} - - -int -ProcQueryExtension(ClientPtr client) -{ - xQueryExtensionReply reply; - int i; - REQUEST(xQueryExtensionReq); - - REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes); - - reply.type = X_Reply; - reply.length = 0; - reply.major_opcode = 0; - reply.sequenceNumber = client->sequence; - - if ( ! NumExtensions ) - reply.present = xFalse; - else - { - i = FindExtension((char *)&stuff[1], stuff->nbytes); - if (i < 0 - - /* - * Hide RENDER if our implementation - * is faulty. - */ - - || (nxagentRenderTrap && strcmp(extensions[i]->name, "RENDER") == 0) -#ifdef XCSECURITY - /* don't show insecure extensions to untrusted clients */ - || (client->trustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) -#endif - ) - reply.present = xFalse; - else - { - reply.present = xTrue; - reply.major_opcode = extensions[i]->base; - reply.first_event = extensions[i]->eventBase; - reply.first_error = extensions[i]->errorBase; - } - } - WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply); - return(client->noClientException); -} - -int -ProcListExtensions(ClientPtr client) -{ - xListExtensionsReply reply; - char *bufptr, *buffer; - int total_length = 0; - - REQUEST_SIZE_MATCH(xReq); - - reply.type = X_Reply; - reply.nExtensions = 0; - reply.length = 0; - reply.sequenceNumber = client->sequence; - buffer = NULL; - - if ( NumExtensions ) - { - register int i, j; - - for (i=0; itrustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) - continue; -#endif - /* - * Hide RENDER if our implementation - * is faulty. - */ - - if (nxagentRenderTrap && strcmp(extensions[i]->name, "RENDER") == 0) - continue; - - total_length += strlen(extensions[i]->name) + 1; - reply.nExtensions += 1 + extensions[i]->num_aliases; - for (j = extensions[i]->num_aliases; --j >= 0;) - total_length += strlen(extensions[i]->aliases[j]) + 1; - } - reply.length = (total_length + 3) >> 2; - buffer = bufptr = (char *)ALLOCATE_LOCAL(total_length); - if (!buffer) - return(BadAlloc); - for (i=0; itrustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) - continue; -#endif - *bufptr++ = len = strlen(extensions[i]->name); - memmove(bufptr, extensions[i]->name, len); - bufptr += len; - for (j = extensions[i]->num_aliases; --j >= 0;) - { - *bufptr++ = len = strlen(extensions[i]->aliases[j]); - memmove(bufptr, extensions[i]->aliases[j], len); - bufptr += len; - } - } - } - WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply); - if (reply.length) - { - WriteToClient(client, total_length, buffer); - DEALLOCATE_LOCAL(buffer); - } - return(client->noClientException); -} - - -ExtensionLookupProc -LookupProc(char *name, GCPtr pGC) -{ - register int i; - register ScreenProcEntry *spentry; - spentry = &AuxillaryScreenProcs[pGC->pScreen->myNum]; - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - return(spentry->procList[i].proc); - } - return (ExtensionLookupProc)NULL; -} - -Bool -RegisterProc(char *name, GC *pGC, ExtensionLookupProc proc) -{ - return RegisterScreenProc(name, pGC->pScreen, proc); -} - -Bool -RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc) -{ - register ScreenProcEntry *spentry; - register ProcEntryPtr procEntry = (ProcEntryPtr)NULL; - char *newname; - int i; - - spentry = &AuxillaryScreenProcs[pScreen->myNum]; - /* first replace duplicates */ - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - { - procEntry = &spentry->procList[i]; - break; - } - } - if (procEntry) - procEntry->proc = proc; - else - { - newname = (char *)xalloc(strlen(name)+1); - if (!newname) - return FALSE; - procEntry = (ProcEntryPtr) - xrealloc(spentry->procList, - sizeof(ProcEntryRec) * (spentry->num+1)); - if (!procEntry) - { - xfree(newname); - return FALSE; - } - spentry->procList = procEntry; - procEntry += spentry->num; - procEntry->name = newname; - strcpy(newname, name); - procEntry->proc = proc; - spentry->num++; - } - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.X.original deleted file mode 100644 index 270d54f9b..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.X.original +++ /dev/null @@ -1,474 +0,0 @@ -/* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.11 2001/12/14 19:59:31 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: extension.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#define NEED_EVENTS -#define NEED_REPLIES -#include -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "gcstruct.h" -#include "scrnintstr.h" -#include "dispatch.h" -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif -#ifdef LBX -#include "lbxserve.h" -#endif - -#define EXTENSION_BASE 128 -#define EXTENSION_EVENT_BASE 64 -#define LAST_EVENT 128 -#define LAST_ERROR 255 - -ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS]; - -static ExtensionEntry **extensions = (ExtensionEntry **)NULL; - -int lastEvent = EXTENSION_EVENT_BASE; -static int lastError = FirstExtensionError; -static unsigned int NumExtensions = 0; - -ExtensionEntry * -AddExtension(char *name, int NumEvents, int NumErrors, - int (*MainProc)(ClientPtr c1), - int (*SwappedMainProc)(ClientPtr c2), - void (*CloseDownProc)(ExtensionEntry *e), - unsigned short (*MinorOpcodeProc)(ClientPtr c3)) -{ - int i; - register ExtensionEntry *ext, **newexts; - - if (!MainProc || !SwappedMainProc || !CloseDownProc || !MinorOpcodeProc) - return((ExtensionEntry *) NULL); - if ((lastEvent + NumEvents > LAST_EVENT) || - (unsigned)(lastError + NumErrors > LAST_ERROR)) - return((ExtensionEntry *) NULL); - - ext = (ExtensionEntry *) xalloc(sizeof(ExtensionEntry)); - if (!ext) - return((ExtensionEntry *) NULL); - ext->name = (char *)xalloc(strlen(name) + 1); - ext->num_aliases = 0; - ext->aliases = (char **)NULL; - if (!ext->name) - { - xfree(ext); - return((ExtensionEntry *) NULL); - } - strcpy(ext->name, name); - i = NumExtensions; - newexts = (ExtensionEntry **) xrealloc(extensions, - (i + 1) * sizeof(ExtensionEntry *)); - if (!newexts) - { - xfree(ext->name); - xfree(ext); - return((ExtensionEntry *) NULL); - } - NumExtensions++; - extensions = newexts; - extensions[i] = ext; - ext->index = i; - ext->base = i + EXTENSION_BASE; - ext->CloseDown = CloseDownProc; - ext->MinorOpcode = MinorOpcodeProc; - ProcVector[i + EXTENSION_BASE] = MainProc; - SwappedProcVector[i + EXTENSION_BASE] = SwappedMainProc; - if (NumEvents) - { - ext->eventBase = lastEvent; - ext->eventLast = lastEvent + NumEvents; - lastEvent += NumEvents; - } - else - { - ext->eventBase = 0; - ext->eventLast = 0; - } - if (NumErrors) - { - ext->errorBase = lastError; - ext->errorLast = lastError + NumErrors; - lastError += NumErrors; - } - else - { - ext->errorBase = 0; - ext->errorLast = 0; - } -#ifdef XCSECURITY - ext->secure = FALSE; -#endif - -#ifdef LBX - (void) LbxAddExtension(name, ext->base, ext->eventBase, ext->errorBase); -#endif - return(ext); -} - -Bool AddExtensionAlias(char *alias, ExtensionEntry *ext) -{ - char *name; - char **aliases; - - aliases = (char **)xrealloc(ext->aliases, - (ext->num_aliases + 1) * sizeof(char *)); - if (!aliases) - return FALSE; - ext->aliases = aliases; - name = (char *)xalloc(strlen(alias) + 1); - if (!name) - return FALSE; - strcpy(name, alias); - ext->aliases[ext->num_aliases] = name; - ext->num_aliases++; -#ifdef LBX - return LbxAddExtensionAlias(ext->index, alias); -#else - return TRUE; -#endif -} - -static int -FindExtension(char *extname, int len) -{ - int i, j; - - for (i=0; iname) == len) && - !strncmp(extname, extensions[i]->name, len)) - break; - for (j = extensions[i]->num_aliases; --j >= 0;) - { - if ((strlen(extensions[i]->aliases[j]) == len) && - !strncmp(extname, extensions[i]->aliases[j], len)) - break; - } - if (j >= 0) break; - } - return ((i == NumExtensions) ? -1 : i); -} - -/* - * CheckExtension returns the extensions[] entry for the requested - * extension name. Maybe this could just return a Bool instead? - */ -ExtensionEntry * -CheckExtension(const char *extname) -{ - int n; - - n = FindExtension((char*)extname, strlen(extname)); - if (n != -1) - return extensions[n]; - else - return NULL; -} - -void -DeclareExtensionSecurity(char *extname, Bool secure) -{ -#ifdef XCSECURITY - int i = FindExtension(extname, strlen(extname)); - if (i >= 0) - { - int majorop = extensions[i]->base; - extensions[i]->secure = secure; - if (secure) - { - UntrustedProcVector[majorop] = ProcVector[majorop]; - SwappedUntrustedProcVector[majorop] = SwappedProcVector[majorop]; - } - else - { - UntrustedProcVector[majorop] = ProcBadRequest; - SwappedUntrustedProcVector[majorop] = ProcBadRequest; - } - } -#endif -#ifdef LBX - LbxDeclareExtensionSecurity(extname, secure); -#endif -} - -unsigned short -StandardMinorOpcode(ClientPtr client) -{ - return ((xReq *)client->requestBuffer)->data; -} - -unsigned short -MinorOpcodeOfRequest(ClientPtr client) -{ - unsigned char major; - - major = ((xReq *)client->requestBuffer)->reqType; - if (major < EXTENSION_BASE) - return 0; - major -= EXTENSION_BASE; - if (major >= NumExtensions) - return 0; - return (*extensions[major]->MinorOpcode)(client); -} - -void -CloseDownExtensions() -{ - register int i,j; - -#ifdef LBX - LbxCloseDownExtensions(); -#endif - - for (i = NumExtensions - 1; i >= 0; i--) - { - (* extensions[i]->CloseDown)(extensions[i]); - NumExtensions = i; - xfree(extensions[i]->name); - for (j = extensions[i]->num_aliases; --j >= 0;) - xfree(extensions[i]->aliases[j]); - xfree(extensions[i]->aliases); - xfree(extensions[i]); - } - xfree(extensions); - extensions = (ExtensionEntry **)NULL; - lastEvent = EXTENSION_EVENT_BASE; - lastError = FirstExtensionError; - for (i=0; inum) - { - spentry->num--; - xfree(spentry->procList[spentry->num].name); - } - xfree(spentry->procList); - spentry->procList = (ProcEntryPtr)NULL; - } -} - - -int -ProcQueryExtension(ClientPtr client) -{ - xQueryExtensionReply reply; - int i; - REQUEST(xQueryExtensionReq); - - REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes); - - reply.type = X_Reply; - reply.length = 0; - reply.major_opcode = 0; - reply.sequenceNumber = client->sequence; - - if ( ! NumExtensions ) - reply.present = xFalse; - else - { - i = FindExtension((char *)&stuff[1], stuff->nbytes); - if (i < 0 -#ifdef XCSECURITY - /* don't show insecure extensions to untrusted clients */ - || (client->trustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) -#endif - ) - reply.present = xFalse; - else - { - reply.present = xTrue; - reply.major_opcode = extensions[i]->base; - reply.first_event = extensions[i]->eventBase; - reply.first_error = extensions[i]->errorBase; - } - } - WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply); - return(client->noClientException); -} - -int -ProcListExtensions(ClientPtr client) -{ - xListExtensionsReply reply; - char *bufptr, *buffer; - int total_length = 0; - - REQUEST_SIZE_MATCH(xReq); - - reply.type = X_Reply; - reply.nExtensions = 0; - reply.length = 0; - reply.sequenceNumber = client->sequence; - buffer = NULL; - - if ( NumExtensions ) - { - register int i, j; - - for (i=0; itrustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) - continue; -#endif - total_length += strlen(extensions[i]->name) + 1; - reply.nExtensions += 1 + extensions[i]->num_aliases; - for (j = extensions[i]->num_aliases; --j >= 0;) - total_length += strlen(extensions[i]->aliases[j]) + 1; - } - reply.length = (total_length + 3) >> 2; - buffer = bufptr = (char *)ALLOCATE_LOCAL(total_length); - if (!buffer) - return(BadAlloc); - for (i=0; itrustLevel == XSecurityClientUntrusted && - !extensions[i]->secure) - continue; -#endif - *bufptr++ = len = strlen(extensions[i]->name); - memmove(bufptr, extensions[i]->name, len); - bufptr += len; - for (j = extensions[i]->num_aliases; --j >= 0;) - { - *bufptr++ = len = strlen(extensions[i]->aliases[j]); - memmove(bufptr, extensions[i]->aliases[j], len); - bufptr += len; - } - } - } - WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply); - if (reply.length) - { - WriteToClient(client, total_length, buffer); - DEALLOCATE_LOCAL(buffer); - } - return(client->noClientException); -} - - -ExtensionLookupProc -LookupProc(char *name, GCPtr pGC) -{ - register int i; - register ScreenProcEntry *spentry; - spentry = &AuxillaryScreenProcs[pGC->pScreen->myNum]; - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - return(spentry->procList[i].proc); - } - return (ExtensionLookupProc)NULL; -} - -Bool -RegisterProc(char *name, GC *pGC, ExtensionLookupProc proc) -{ - return RegisterScreenProc(name, pGC->pScreen, proc); -} - -Bool -RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc) -{ - register ScreenProcEntry *spentry; - register ProcEntryPtr procEntry = (ProcEntryPtr)NULL; - char *newname; - int i; - - spentry = &AuxillaryScreenProcs[pScreen->myNum]; - /* first replace duplicates */ - if (spentry->num) - { - for (i = 0; i < spentry->num; i++) - if (strcmp(name, spentry->procList[i].name) == 0) - { - procEntry = &spentry->procList[i]; - break; - } - } - if (procEntry) - procEntry->proc = proc; - else - { - newname = (char *)xalloc(strlen(name)+1); - if (!newname) - return FALSE; - procEntry = (ProcEntryPtr) - xrealloc(spentry->procList, - sizeof(ProcEntryRec) * (spentry->num+1)); - if (!procEntry) - { - xfree(newname); - return FALSE; - } - spentry->procList = procEntry; - procEntry += spentry->num; - procEntry->name = newname; - strcpy(newname, name); - procEntry->proc = proc; - spentry->num++; - } - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original deleted file mode 100644 index 51c547984..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original +++ /dev/null @@ -1,575 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.9 2003/09/28 20:15:43 alanh Exp $ -** The contents of this file are subject to the GLX Public License Version 1.0 -** (the "License"). You may not use this file except in compliance with the -** License. You may obtain a copy of the License at Silicon Graphics, Inc., -** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 -** or at http://www.sgi.com/software/opensource/glx/license.html. -** -** Software distributed under the License is distributed on an "AS IS" -** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY -** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR -** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific -** language governing rights and limitations under the License. -** -** The Original Software is GLX version 1.2 source code, released February, -** 1999. The developer of the Original Software is Silicon Graphics, Inc. -** Those portions of the Subject Software created by Silicon Graphics, Inc. -** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. -** -*/ - -#define NEED_REPLIES -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "glxserver.h" -#include -#include -#include -#include "g_disptab.h" -#include "unpack.h" -#include "glxutil.h" -#include "glxext.h" -#include "micmap.h" - -#include "Trap.h" - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -void GlxWrapInitVisuals(miInitVisualsProcPtr *); -void GlxSetVisualConfigs(int nconfigs, - __GLXvisualConfig *configs, void **privates); - -static __GLXextensionInfo *__glXExt /* = &__glDDXExtensionInfo */; - -/* -** Forward declarations. -*/ -static int __glXSwapDispatch(ClientPtr); -static int __glXDispatch(ClientPtr); - -/* -** Called when the extension is reset. -*/ -static void ResetExtension(ExtensionEntry* extEntry) -{ - __glXFlushContextCache(); - (*__glXExt->resetExtension)(); - __glXScreenReset(); -} - -/* -** Initialize the per-client context storage. -*/ -static void ResetClientState(int clientIndex) -{ - __GLXclientState *cl = __glXClients[clientIndex]; - - if (cl->returnBuf) __glXFree(cl->returnBuf); - if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf); - if (cl->currentContexts) __glXFree(cl->currentContexts); - __glXMemset(cl, 0, sizeof(__GLXclientState)); - /* - ** By default, assume that the client supports - ** GLX major version 1 minor version 0 protocol. - */ - cl->GLClientmajorVersion = 1; - cl->GLClientminorVersion = 0; - if (cl->GLClientextensions) __glXFree(cl->GLClientextensions); - -} - -/* -** Reset state used to keep track of large (multi-request) commands. -*/ -void __glXResetLargeCommandStatus(__GLXclientState *cl) -{ - cl->largeCmdBytesSoFar = 0; - cl->largeCmdBytesTotal = 0; - cl->largeCmdRequestsSoFar = 0; - cl->largeCmdRequestsTotal = 0; -} - -/* -** This procedure is called when the client who created the context goes -** away OR when glXDestroyContext is called. In either case, all we do is -** flag that the ID is no longer valid, and (maybe) free the context. -** use. -*/ -static int ContextGone(__GLXcontext* cx, XID id) -{ - cx->idExists = GL_FALSE; - if (!cx->isCurrent) { - __glXFreeContext(cx); - } - - return True; -} - -/* -** Free a client's state. -*/ -static int ClientGone(int clientIndex, XID id) -{ - __GLXcontext *cx; - __GLXclientState *cl = __glXClients[clientIndex]; - int i; - - if (cl) { - /* - ** Free all the contexts that are current for this client. - */ - for (i=0; i < cl->numCurrentContexts; i++) { - cx = cl->currentContexts[i]; - if (cx) { - __glXDeassociateContext(cx); - cx->isCurrent = GL_FALSE; - if (!cx->idExists) { - __glXFreeContext(cx); - } - } - } - /* - ** Re-initialize the client state structure. Don't free it because - ** we'll probably get another client with this index and use the struct - ** again. There is a maximum of MAXCLIENTS of these structures. - */ - ResetClientState(clientIndex); - } - - return True; -} - -/* -** Free a GLX Pixmap. -*/ -static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id) -{ - PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw; - - pGlxPixmap->idExists = False; - if (!pGlxPixmap->refcnt) { - /* - ** The DestroyPixmap routine should decrement the refcount and free - ** only if it's zero. - */ - (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap); - __glXFree(pGlxPixmap); - } - - return True; -} - -/* -** Free a context. -*/ -GLboolean __glXFreeContext(__GLXcontext *cx) -{ - if (cx->idExists || cx->isCurrent) return GL_FALSE; - - if (!cx->isDirect) { - if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) { - return GL_FALSE; - } - } - if (cx->feedbackBuf) __glXFree(cx->feedbackBuf); - if (cx->selectBuf) __glXFree(cx->selectBuf); - __glXFree(cx); - if (cx == __glXLastContext) { - __glXFlushContextCache(); - } - - return GL_TRUE; -} - -extern RESTYPE __glXSwapBarrierRes; - -static int SwapBarrierGone(int screen, XID drawable) -{ - if (__glXSwapBarrierFuncs && - __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc != NULL) { - __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc(screen, drawable, 0); - } - FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE); - return True; -} - -/************************************************************************/ - -/* -** These routines can be used to check whether a particular GL command -** has caused an error. Specifically, we use them to check whether a -** given query has caused an error, in which case a zero-length data -** reply is sent to the client. -*/ - -static GLboolean errorOccured = GL_FALSE; - -/* -** The GL was will call this routine if an error occurs. -*/ -void __glXErrorCallBack(__GLinterface *gc, GLenum code) -{ - errorOccured = GL_TRUE; -} - -/* -** Clear the error flag before calling the GL command. -*/ -void __glXClearErrorOccured(void) -{ - errorOccured = GL_FALSE; -} - -/* -** Check if the GL command caused an error. -*/ -GLboolean __glXErrorOccured(void) -{ - return errorOccured; -} - -/************************************************************************/ - -/* -** Initialize the GLX extension. -*/ -void GlxExtensionInit(void) -{ - ExtensionEntry *extEntry; - int i; - - __glXContextRes = CreateNewResourceType((DeleteType)ContextGone); - __glXClientRes = CreateNewResourceType((DeleteType)ClientGone); - __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone); - - /* - ** Add extension to server extensions. - */ - extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, - __GLX_NUMBER_ERRORS, __glXDispatch, - __glXSwapDispatch, ResetExtension, - StandardMinorOpcode); - if (!extEntry) { - FatalError("__glXExtensionInit: AddExtensions failed\n"); - return; - } - if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) { - ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); - return; - } - - __glXBadContext = extEntry->errorBase + GLXBadContext; - __glXBadContextState = extEntry->errorBase + GLXBadContextState; - __glXBadDrawable = extEntry->errorBase + GLXBadDrawable; - __glXBadPixmap = extEntry->errorBase + GLXBadPixmap; - __glXBadContextTag = extEntry->errorBase + GLXBadContextTag; - __glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow; - __glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest; - __glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest; - __glXUnsupportedPrivateRequest = extEntry->errorBase + - GLXUnsupportedPrivateRequest; - - __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone); - - /* - ** Initialize table of client state. There is never a client 0. - */ - for (i=1; i <= MAXCLIENTS; i++) { - __glXClients[i] = 0; - } - - /* - ** Initialize screen specific data. - */ - __glXScreenInit(screenInfo.numScreens); -} - -/************************************************************************/ - -Bool __glXCoreType(void) -{ - return __glXExt->type; -} - -/************************************************************************/ - -void GlxSetVisualConfigs(int nconfigs, - __GLXvisualConfig *configs, void **privates) -{ - (*__glXExt->setVisualConfigs)(nconfigs, configs, privates); -} - -static miInitVisualsProcPtr saveInitVisualsProc; - -Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB, - int preferredVis) -{ - Bool ret; - - if (saveInitVisualsProc) { - ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp, - rootDepthp, defaultVisp, sizes, bitsPerRGB, - preferredVis); - if (!ret) - return False; - } - (*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp, - defaultVisp, sizes, bitsPerRGB); - return True; -} - -void -GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc) -{ - saveInitVisualsProc = *initVisProc; - *initVisProc = GlxInitVisuals; - /* HACK: this shouldn't be done here but it's the earliest time */ - __glXExt = __glXglDDXExtensionInfo(); /* from GLcore */ -} - -/************************************************************************/ - -void __glXFlushContextCache(void) -{ - __glXLastContext = 0; -} - -/* -** Make a context the current one for the GL (in this implementation, there -** is only one instance of the GL, and we use it to serve all GL clients by -** switching it between different contexts). While we are at it, look up -** a context by its tag and return its (__GLXcontext *). -*/ -__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, - int *error) -{ - __GLXcontext *cx; - - /* - ** See if the context tag is legal; it is managed by the extension, - ** so if it's invalid, we have an implementation error. - */ - cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag); - if (!cx) { - cl->client->errorValue = tag; - *error = __glXBadContextTag; - return 0; - } - - if (!cx->isDirect) { - if (cx->drawPriv == NULL) { - /* - ** The drawable has vanished. It must be a window, because only - ** windows can be destroyed from under us; GLX pixmaps are - ** refcounted and don't go away until no one is using them. - */ - *error = __glXBadCurrentWindow; - return 0; - } - } - - if (cx == __glXLastContext) { - /* No need to re-bind */ - return cx; - } - - /* Make this context the current one for the GL. */ - if (!cx->isDirect) { - if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) { - /* Bind failed, and set the error code. Bummer */ - cl->client->errorValue = cx->id; - *error = __glXBadContextState; - return 0; - } - } - __glXLastContext = cx; - return cx; -} - -/************************************************************************/ - -/* -** Top level dispatcher; all commands are executed from here down. -*/ -static int __glXDispatch(ClientPtr client) -{ - int result; - - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - __glXMemset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** If we're expecting a glXRenderLarge request, this better be one. - */ - if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) { - client->errorValue = stuff->glxCode; - return __glXBadLargeRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSingleTable[opcode]; - - /* - * Report upstream that we are - * dispatching a GLX operation. - */ - - nxagentGlxTrap = 1; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - result = (*proc)(cl, (GLbyte *) stuff); - - nxagentGlxTrap = 0; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - return result; -} - -static int __glXSwapDispatch(ClientPtr client) -{ - int result; - - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - __glXMemset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSwapSingleTable[opcode]; - - /* - * Report upstream that we are - * dispatching a GLX operation. - */ - - nxagentGlxTrap = 1; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - result = (*proc)(cl, (GLbyte *) stuff); - - nxagentGlxTrap = 0; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - return result; -} - -int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc) -{ - return BadRequest; -} - -void __glXNoSuchRenderOpcode(GLbyte *pc) -{ - return; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.X.original deleted file mode 100644 index fa1382983..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.X.original +++ /dev/null @@ -1,505 +0,0 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.9 2003/09/28 20:15:43 alanh Exp $ -** The contents of this file are subject to the GLX Public License Version 1.0 -** (the "License"). You may not use this file except in compliance with the -** License. You may obtain a copy of the License at Silicon Graphics, Inc., -** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 -** or at http://www.sgi.com/software/opensource/glx/license.html. -** -** Software distributed under the License is distributed on an "AS IS" -** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY -** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR -** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific -** language governing rights and limitations under the License. -** -** The Original Software is GLX version 1.2 source code, released February, -** 1999. The developer of the Original Software is Silicon Graphics, Inc. -** Those portions of the Subject Software created by Silicon Graphics, Inc. -** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. -** -*/ - -#define NEED_REPLIES -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "glxserver.h" -#include -#include -#include -#include "g_disptab.h" -#include "unpack.h" -#include "glxutil.h" -#include "glxext.h" -#include "micmap.h" - - -void GlxWrapInitVisuals(miInitVisualsProcPtr *); -void GlxSetVisualConfigs(int nconfigs, - __GLXvisualConfig *configs, void **privates); - -static __GLXextensionInfo *__glXExt /* = &__glDDXExtensionInfo */; - -/* -** Forward declarations. -*/ -static int __glXSwapDispatch(ClientPtr); -static int __glXDispatch(ClientPtr); - -/* -** Called when the extension is reset. -*/ -static void ResetExtension(ExtensionEntry* extEntry) -{ - __glXFlushContextCache(); - (*__glXExt->resetExtension)(); - __glXScreenReset(); -} - -/* -** Initialize the per-client context storage. -*/ -static void ResetClientState(int clientIndex) -{ - __GLXclientState *cl = __glXClients[clientIndex]; - - if (cl->returnBuf) __glXFree(cl->returnBuf); - if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf); - if (cl->currentContexts) __glXFree(cl->currentContexts); - __glXMemset(cl, 0, sizeof(__GLXclientState)); - /* - ** By default, assume that the client supports - ** GLX major version 1 minor version 0 protocol. - */ - cl->GLClientmajorVersion = 1; - cl->GLClientminorVersion = 0; - if (cl->GLClientextensions) __glXFree(cl->GLClientextensions); - -} - -/* -** Reset state used to keep track of large (multi-request) commands. -*/ -void __glXResetLargeCommandStatus(__GLXclientState *cl) -{ - cl->largeCmdBytesSoFar = 0; - cl->largeCmdBytesTotal = 0; - cl->largeCmdRequestsSoFar = 0; - cl->largeCmdRequestsTotal = 0; -} - -/* -** This procedure is called when the client who created the context goes -** away OR when glXDestroyContext is called. In either case, all we do is -** flag that the ID is no longer valid, and (maybe) free the context. -** use. -*/ -static int ContextGone(__GLXcontext* cx, XID id) -{ - cx->idExists = GL_FALSE; - if (!cx->isCurrent) { - __glXFreeContext(cx); - } - - return True; -} - -/* -** Free a client's state. -*/ -static int ClientGone(int clientIndex, XID id) -{ - __GLXcontext *cx; - __GLXclientState *cl = __glXClients[clientIndex]; - int i; - - if (cl) { - /* - ** Free all the contexts that are current for this client. - */ - for (i=0; i < cl->numCurrentContexts; i++) { - cx = cl->currentContexts[i]; - if (cx) { - __glXDeassociateContext(cx); - cx->isCurrent = GL_FALSE; - if (!cx->idExists) { - __glXFreeContext(cx); - } - } - } - /* - ** Re-initialize the client state structure. Don't free it because - ** we'll probably get another client with this index and use the struct - ** again. There is a maximum of MAXCLIENTS of these structures. - */ - ResetClientState(clientIndex); - } - - return True; -} - -/* -** Free a GLX Pixmap. -*/ -static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id) -{ - PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw; - - pGlxPixmap->idExists = False; - if (!pGlxPixmap->refcnt) { - /* - ** The DestroyPixmap routine should decrement the refcount and free - ** only if it's zero. - */ - (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap); - __glXFree(pGlxPixmap); - } - - return True; -} - -/* -** Free a context. -*/ -GLboolean __glXFreeContext(__GLXcontext *cx) -{ - if (cx->idExists || cx->isCurrent) return GL_FALSE; - - if (!cx->isDirect) { - if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) { - return GL_FALSE; - } - } - if (cx->feedbackBuf) __glXFree(cx->feedbackBuf); - if (cx->selectBuf) __glXFree(cx->selectBuf); - __glXFree(cx); - if (cx == __glXLastContext) { - __glXFlushContextCache(); - } - - return GL_TRUE; -} - -extern RESTYPE __glXSwapBarrierRes; - -static int SwapBarrierGone(int screen, XID drawable) -{ - if (__glXSwapBarrierFuncs && - __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc != NULL) { - __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc(screen, drawable, 0); - } - FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE); - return True; -} - -/************************************************************************/ - -/* -** These routines can be used to check whether a particular GL command -** has caused an error. Specifically, we use them to check whether a -** given query has caused an error, in which case a zero-length data -** reply is sent to the client. -*/ - -static GLboolean errorOccured = GL_FALSE; - -/* -** The GL was will call this routine if an error occurs. -*/ -void __glXErrorCallBack(__GLinterface *gc, GLenum code) -{ - errorOccured = GL_TRUE; -} - -/* -** Clear the error flag before calling the GL command. -*/ -void __glXClearErrorOccured(void) -{ - errorOccured = GL_FALSE; -} - -/* -** Check if the GL command caused an error. -*/ -GLboolean __glXErrorOccured(void) -{ - return errorOccured; -} - -/************************************************************************/ - -/* -** Initialize the GLX extension. -*/ -void GlxExtensionInit(void) -{ - ExtensionEntry *extEntry; - int i; - - __glXContextRes = CreateNewResourceType((DeleteType)ContextGone); - __glXClientRes = CreateNewResourceType((DeleteType)ClientGone); - __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone); - - /* - ** Add extension to server extensions. - */ - extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, - __GLX_NUMBER_ERRORS, __glXDispatch, - __glXSwapDispatch, ResetExtension, - StandardMinorOpcode); - if (!extEntry) { - FatalError("__glXExtensionInit: AddExtensions failed\n"); - return; - } - if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) { - ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); - return; - } - - __glXBadContext = extEntry->errorBase + GLXBadContext; - __glXBadContextState = extEntry->errorBase + GLXBadContextState; - __glXBadDrawable = extEntry->errorBase + GLXBadDrawable; - __glXBadPixmap = extEntry->errorBase + GLXBadPixmap; - __glXBadContextTag = extEntry->errorBase + GLXBadContextTag; - __glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow; - __glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest; - __glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest; - __glXUnsupportedPrivateRequest = extEntry->errorBase + - GLXUnsupportedPrivateRequest; - - __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone); - - /* - ** Initialize table of client state. There is never a client 0. - */ - for (i=1; i <= MAXCLIENTS; i++) { - __glXClients[i] = 0; - } - - /* - ** Initialize screen specific data. - */ - __glXScreenInit(screenInfo.numScreens); -} - -/************************************************************************/ - -Bool __glXCoreType(void) -{ - return __glXExt->type; -} - -/************************************************************************/ - -void GlxSetVisualConfigs(int nconfigs, - __GLXvisualConfig *configs, void **privates) -{ - (*__glXExt->setVisualConfigs)(nconfigs, configs, privates); -} - -static miInitVisualsProcPtr saveInitVisualsProc; - -Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB, - int preferredVis) -{ - Bool ret; - - if (saveInitVisualsProc) { - ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp, - rootDepthp, defaultVisp, sizes, bitsPerRGB, - preferredVis); - if (!ret) - return False; - } - (*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp, - defaultVisp, sizes, bitsPerRGB); - return True; -} - -void -GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc) -{ - saveInitVisualsProc = *initVisProc; - *initVisProc = GlxInitVisuals; - /* HACK: this shouldn't be done here but it's the earliest time */ - __glXExt = __glXglDDXExtensionInfo(); /* from GLcore */ -} - -/************************************************************************/ - -void __glXFlushContextCache(void) -{ - __glXLastContext = 0; -} - -/* -** Make a context the current one for the GL (in this implementation, there -** is only one instance of the GL, and we use it to serve all GL clients by -** switching it between different contexts). While we are at it, look up -** a context by its tag and return its (__GLXcontext *). -*/ -__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, - int *error) -{ - __GLXcontext *cx; - - /* - ** See if the context tag is legal; it is managed by the extension, - ** so if it's invalid, we have an implementation error. - */ - cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag); - if (!cx) { - cl->client->errorValue = tag; - *error = __glXBadContextTag; - return 0; - } - - if (!cx->isDirect) { - if (cx->drawPriv == NULL) { - /* - ** The drawable has vanished. It must be a window, because only - ** windows can be destroyed from under us; GLX pixmaps are - ** refcounted and don't go away until no one is using them. - */ - *error = __glXBadCurrentWindow; - return 0; - } - } - - if (cx == __glXLastContext) { - /* No need to re-bind */ - return cx; - } - - /* Make this context the current one for the GL. */ - if (!cx->isDirect) { - if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) { - /* Bind failed, and set the error code. Bummer */ - cl->client->errorValue = cx->id; - *error = __glXBadContextState; - return 0; - } - } - __glXLastContext = cx; - return cx; -} - -/************************************************************************/ - -/* -** Top level dispatcher; all commands are executed from here down. -*/ -static int __glXDispatch(ClientPtr client) -{ - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - __glXMemset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** If we're expecting a glXRenderLarge request, this better be one. - */ - if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) { - client->errorValue = stuff->glxCode; - return __glXBadLargeRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSingleTable[opcode]; - return (*proc)(cl, (GLbyte *) stuff); -} - -static int __glXSwapDispatch(ClientPtr client) -{ - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - __glXMemset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSwapSingleTable[opcode]; - return (*proc)(cl, (GLbyte *) stuff); -} - -int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc) -{ - return BadRequest; -} - -void __glXNoSuchRenderOpcode(GLbyte *pc) -{ - return; -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original deleted file mode 100644 index cd65fdc0e..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original +++ /dev/null @@ -1,581 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/glyph.c,v 1.5 2001/01/30 07:01:22 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" - -#ifdef NXAGENT_SERVER - -#include "NXpicturestr.h" -#include "NXglyphstr.h" -#include "Render.h" - -#define PANIC -#define WARNING -#undef DEBUG -#undef TEST - -#else - -#include "picturestr.h" -#include "glyphstr.h" - -#endif - -#if HAVE_STDINT_H -#include -#elif !defined(UINT32_MAX) -#define UINT32_MAX 0xffffffffU -#endif - -/* - * From Knuth -- a good choice for hash/rehash values is p, p-2 where - * p and p-2 are both prime. These tables are sized to have an extra 10% - * free to avoid exponential performance degradation as the hash table fills - */ -static GlyphHashSetRec glyphHashSets[] = { - { 32, 43, 41 }, - { 64, 73, 71 }, - { 128, 151, 149 }, - { 256, 283, 281 }, - { 512, 571, 569 }, - { 1024, 1153, 1151 }, - { 2048, 2269, 2267 }, - { 4096, 4519, 4517 }, - { 8192, 9013, 9011 }, - { 16384, 18043, 18041 }, - { 32768, 36109, 36107 }, - { 65536, 72091, 72089 }, - { 131072, 144409, 144407 }, - { 262144, 288361, 288359 }, - { 524288, 576883, 576881 }, - { 1048576, 1153459, 1153457 }, - { 2097152, 2307163, 2307161 }, - { 4194304, 4613893, 4613891 }, - { 8388608, 9227641, 9227639 }, - { 16777216, 18455029, 18455027 }, - { 33554432, 36911011, 36911009 }, - { 67108864, 73819861, 73819859 }, - { 134217728, 147639589, 147639587 }, - { 268435456, 295279081, 295279079 }, - { 536870912, 590559793, 590559791 } -}; - -#define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0])) - -const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 }; - -GlyphHashRec globalGlyphs[GlyphFormatNum]; - -GlyphHashSetPtr -FindGlyphHashSet (CARD32 filled) -{ - int i; - - for (i = 0; i < NGLYPHHASHSETS; i++) - if (glyphHashSets[i].entries >= filled) - return &glyphHashSets[i]; - return 0; -} - -static int _GlyphSetPrivateAllocateIndex = 0; - -int -AllocateGlyphSetPrivateIndex (void) -{ - return _GlyphSetPrivateAllocateIndex++; -} - -void -ResetGlyphSetPrivateIndex (void) -{ - _GlyphSetPrivateAllocateIndex = 0; -} - -Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr) -{ - pointer *new; - - if (n > glyphSet->maxPrivate) { - if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) { - new = (pointer *) xrealloc (glyphSet->devPrivates, - (n + 1) * sizeof (pointer)); - if (!new) - return FALSE; - } else { - new = (pointer *) xalloc ((n + 1) * sizeof (pointer)); - if (!new) - return FALSE; - if (glyphSet->devPrivates) - memcpy (new, - glyphSet->devPrivates, - (glyphSet->maxPrivate + 1) * sizeof (pointer)); - } - glyphSet->devPrivates = new; - /* Zero out new, uninitialize privates */ - while (++glyphSet->maxPrivate < n) - glyphSet->devPrivates[glyphSet->maxPrivate] = (pointer)0; - } - glyphSet->devPrivates[n] = ptr; - return TRUE; -} - -Bool -GlyphInit (ScreenPtr pScreen) -{ - return TRUE; -} - -GlyphRefPtr -FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare) -{ - CARD32 elt, step, s; - GlyphPtr glyph; - GlyphRefPtr table, gr, del; - CARD32 tableSize = hash->hashSet->size; - - table = hash->table; - elt = signature % tableSize; - step = 0; - del = 0; - for (;;) - { - gr = &table[elt]; - s = gr->signature; - glyph = gr->glyph; - if (!glyph) - { - if (del) - gr = del; - break; - } - if (glyph == DeletedGlyph) - { - if (!del) - del = gr; - else if (gr == del) - break; - } - else if (s == signature && - (!match || - memcmp (&compare->info, &glyph->info, compare->size) == 0)) - { - break; - } - if (!step) - { - step = signature % hash->hashSet->rehash; - if (!step) - step = 1; - } - elt += step; - if (elt >= tableSize) - elt -= tableSize; - } - return gr; -} - -CARD32 -HashGlyph (GlyphPtr glyph) -{ - CARD32 *bits = (CARD32 *) &(glyph->info); - CARD32 hash; - int n = glyph->size / sizeof (CARD32); - - hash = 0; - while (n--) - hash ^= *bits++; - return hash; -} - -#ifdef CHECK_DUPLICATES -void -DuplicateRef (GlyphPtr glyph, char *where) -{ - ErrorF ("Duplicate Glyph 0x%x from %s\n", glyph, where); -} - -void -CheckDuplicates (GlyphHashPtr hash, char *where) -{ - GlyphPtr g; - int i, j; - - for (i = 0; i < hash->hashSet->size; i++) - { - g = hash->table[i].glyph; - if (!g || g == DeletedGlyph) - continue; - for (j = i + 1; j < hash->hashSet->size; j++) - if (hash->table[j].glyph == g) - DuplicateRef (g, where); - } -} -#else -#define CheckDuplicates(a,b) -#define DuplicateRef(a,b) -#endif - -void -FreeGlyph (GlyphPtr glyph, int format) -{ - CheckDuplicates (&globalGlyphs[format], "FreeGlyph"); - if (--glyph->refcnt == 0) - { - GlyphRefPtr gr; - int i; - int first; - - first = -1; - for (i = 0; i < globalGlyphs[format].hashSet->size; i++) - if (globalGlyphs[format].table[i].glyph == glyph) - { - if (first != -1) - DuplicateRef (glyph, "FreeGlyph check"); - first = i; - } - - gr = FindGlyphRef (&globalGlyphs[format], - HashGlyph (glyph), TRUE, glyph); - if (gr - globalGlyphs[format].table != first) - DuplicateRef (glyph, "Found wrong one"); - if (gr->glyph && gr->glyph != DeletedGlyph) - { - gr->glyph = DeletedGlyph; - gr->signature = 0; - globalGlyphs[format].tableEntries--; - } - xfree (glyph); - } -} - -void -AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) -{ - GlyphRefPtr gr; - CARD32 hash; - - CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph top global"); - /* Locate existing matching glyph */ - hash = HashGlyph (glyph); - gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph); - if (gr->glyph && gr->glyph != DeletedGlyph) - { - xfree (glyph); - glyph = gr->glyph; - } - else - { - gr->glyph = glyph; - gr->signature = hash; - globalGlyphs[glyphSet->fdepth].tableEntries++; - } - - /* Insert/replace glyphset value */ - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - ++glyph->refcnt; - if (gr->glyph && gr->glyph != DeletedGlyph) - FreeGlyph (gr->glyph, glyphSet->fdepth); - else - glyphSet->hash.tableEntries++; - gr->glyph = glyph; - gr->signature = id; - - #ifdef NXAGENT_SERVER - - gr -> corruptedGlyph = 1; - - #endif - - CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom"); -} - -Bool -DeleteGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphRefPtr gr; - GlyphPtr glyph; - - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - glyph = gr->glyph; - if (glyph && glyph != DeletedGlyph) - { - gr->glyph = DeletedGlyph; - glyphSet->hash.tableEntries--; - FreeGlyph (glyph, glyphSet->fdepth); - return TRUE; - } - return FALSE; -} - -#ifdef NXAGENT_SERVER - -GlyphPtr FindGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphRefPtr gr; - GlyphPtr glyph; - - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - glyph = gr -> glyph; - - if (glyph == DeletedGlyph) - { - glyph = 0; - } - else if (gr -> corruptedGlyph == 1) - { - #ifdef DEBUG - fprintf(stderr, "FindGlyphRef: Going to synchronize the glyph [%p] for glyphset [%p].\n", - (void *) glyph, (void *) glyphSet); - #endif - - nxagentAddGlyphs(glyphSet, &id, &(glyph -> info), 1, - (CARD8*)(glyph + 1), glyph -> size - sizeof(xGlyphInfo)); - } - - return glyph; -} - -#else - -GlyphPtr -FindGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphPtr glyph; - - glyph = FindGlyphRef (&glyphSet->hash, id, FALSE, 0)->glyph; - if (glyph == DeletedGlyph) - glyph = 0; - return glyph; -} - -#endif - -GlyphPtr -AllocateGlyph (xGlyphInfo *gi, int fdepth) -{ - int size; - GlyphPtr glyph; - size_t padded_width; - - padded_width = PixmapBytePad (gi->width, glyphDepths[fdepth]); - if (gi->height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi->height) - return 0; - size = gi->height * padded_width; - glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec)); - if (!glyph) - return 0; - glyph->refcnt = 0; - glyph->size = size + sizeof (xGlyphInfo); - glyph->info = *gi; - return glyph; -} - -Bool -AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) -{ - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); - if (!hash->table) - return FALSE; - memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); - hash->hashSet = hashSet; - hash->tableEntries = 0; - return TRUE; -} - -Bool -ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) -{ - CARD32 tableEntries; - GlyphHashSetPtr hashSet; - GlyphHashRec newHash; - GlyphRefPtr gr; - GlyphPtr glyph; - int i; - int oldSize; - CARD32 s; - - #ifdef NXAGENT_SERVER - - CARD32 c; - - #endif - - tableEntries = hash->tableEntries + change; - hashSet = FindGlyphHashSet (tableEntries); - if (hashSet == hash->hashSet) - return TRUE; - if (global) - CheckDuplicates (hash, "ResizeGlyphHash top"); - if (!AllocateGlyphHash (&newHash, hashSet)) - return FALSE; - if (hash->table) - { - oldSize = hash->hashSet->size; - for (i = 0; i < oldSize; i++) - { - glyph = hash->table[i].glyph; - if (glyph && glyph != DeletedGlyph) - { - s = hash->table[i].signature; - - #ifdef NXAGENT_SERVER - - c = hash->table[i].corruptedGlyph; - - #endif - - gr = FindGlyphRef (&newHash, s, global, glyph); - gr->signature = s; - gr->glyph = glyph; - - #ifdef NXAGENT_SERVER - - gr -> corruptedGlyph = c; - - #endif - - ++newHash.tableEntries; - } - } - xfree (hash->table); - } - *hash = newHash; - if (global) - CheckDuplicates (hash, "ResizeGlyphHash bottom"); - return TRUE; -} - -Bool -ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change) -{ - return (ResizeGlyphHash (&glyphSet->hash, change, FALSE) && - ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], change, TRUE)); -} - -GlyphSetPtr -AllocateGlyphSet (int fdepth, PictFormatPtr format) -{ - GlyphSetPtr glyphSet; - int size; - - if (!globalGlyphs[fdepth].hashSet) - { - if (!AllocateGlyphHash (&globalGlyphs[fdepth], &glyphHashSets[0])) - return FALSE; - } - - size = (sizeof (GlyphSetRec) + - (sizeof (pointer) * _GlyphSetPrivateAllocateIndex)); - glyphSet = xalloc (size); - if (!glyphSet) - return FALSE; - bzero((char *)glyphSet, size); - glyphSet->maxPrivate = _GlyphSetPrivateAllocateIndex - 1; - if (_GlyphSetPrivateAllocateIndex) - glyphSet->devPrivates = (pointer)(&glyphSet[1]); - - if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) - { - xfree (glyphSet); - return FALSE; - } - glyphSet->refcnt = 1; - glyphSet->fdepth = fdepth; - glyphSet->format = format; - return glyphSet; -} - -int -FreeGlyphSet (pointer value, - XID gid) -{ - GlyphSetPtr glyphSet = (GlyphSetPtr) value; - - if (--glyphSet->refcnt == 0) - { - CARD32 i, tableSize = glyphSet->hash.hashSet->size; - GlyphRefPtr table = glyphSet->hash.table; - GlyphPtr glyph; - - for (i = 0; i < tableSize; i++) - { - glyph = table[i].glyph; - if (glyph && glyph != DeletedGlyph) - FreeGlyph (glyph, glyphSet->fdepth); - } - if (!globalGlyphs[glyphSet->fdepth].tableEntries) - { - xfree (globalGlyphs[glyphSet->fdepth].table); - globalGlyphs[glyphSet->fdepth].table = 0; - globalGlyphs[glyphSet->fdepth].hashSet = 0; - } - else - ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE); - xfree (table); - - if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) - xfree(glyphSet->devPrivates); - - xfree (glyphSet); - } - return Success; -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.X.original deleted file mode 100644 index 9f4d1c87b..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.X.original +++ /dev/null @@ -1,488 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/glyph.c,v 1.5 2001/01/30 07:01:22 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "picturestr.h" -#include "glyphstr.h" - -#if HAVE_STDINT_H -#include -#elif !defined(UINT32_MAX) -#define UINT32_MAX 0xffffffffU -#endif - -/* - * From Knuth -- a good choice for hash/rehash values is p, p-2 where - * p and p-2 are both prime. These tables are sized to have an extra 10% - * free to avoid exponential performance degradation as the hash table fills - */ -static GlyphHashSetRec glyphHashSets[] = { - { 32, 43, 41 }, - { 64, 73, 71 }, - { 128, 151, 149 }, - { 256, 283, 281 }, - { 512, 571, 569 }, - { 1024, 1153, 1151 }, - { 2048, 2269, 2267 }, - { 4096, 4519, 4517 }, - { 8192, 9013, 9011 }, - { 16384, 18043, 18041 }, - { 32768, 36109, 36107 }, - { 65536, 72091, 72089 }, - { 131072, 144409, 144407 }, - { 262144, 288361, 288359 }, - { 524288, 576883, 576881 }, - { 1048576, 1153459, 1153457 }, - { 2097152, 2307163, 2307161 }, - { 4194304, 4613893, 4613891 }, - { 8388608, 9227641, 9227639 }, - { 16777216, 18455029, 18455027 }, - { 33554432, 36911011, 36911009 }, - { 67108864, 73819861, 73819859 }, - { 134217728, 147639589, 147639587 }, - { 268435456, 295279081, 295279079 }, - { 536870912, 590559793, 590559791 } -}; - -#define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0])) - -const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 }; - -GlyphHashRec globalGlyphs[GlyphFormatNum]; - -GlyphHashSetPtr -FindGlyphHashSet (CARD32 filled) -{ - int i; - - for (i = 0; i < NGLYPHHASHSETS; i++) - if (glyphHashSets[i].entries >= filled) - return &glyphHashSets[i]; - return 0; -} - -static int _GlyphSetPrivateAllocateIndex = 0; - -int -AllocateGlyphSetPrivateIndex (void) -{ - return _GlyphSetPrivateAllocateIndex++; -} - -void -ResetGlyphSetPrivateIndex (void) -{ - _GlyphSetPrivateAllocateIndex = 0; -} - -Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr) -{ - pointer *new; - - if (n > glyphSet->maxPrivate) { - if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) { - new = (pointer *) xrealloc (glyphSet->devPrivates, - (n + 1) * sizeof (pointer)); - if (!new) - return FALSE; - } else { - new = (pointer *) xalloc ((n + 1) * sizeof (pointer)); - if (!new) - return FALSE; - if (glyphSet->devPrivates) - memcpy (new, - glyphSet->devPrivates, - (glyphSet->maxPrivate + 1) * sizeof (pointer)); - } - glyphSet->devPrivates = new; - /* Zero out new, uninitialize privates */ - while (++glyphSet->maxPrivate < n) - glyphSet->devPrivates[glyphSet->maxPrivate] = (pointer)0; - } - glyphSet->devPrivates[n] = ptr; - return TRUE; -} - -Bool -GlyphInit (ScreenPtr pScreen) -{ - return TRUE; -} - -GlyphRefPtr -FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare) -{ - CARD32 elt, step, s; - GlyphPtr glyph; - GlyphRefPtr table, gr, del; - CARD32 tableSize = hash->hashSet->size; - - table = hash->table; - elt = signature % tableSize; - step = 0; - del = 0; - for (;;) - { - gr = &table[elt]; - s = gr->signature; - glyph = gr->glyph; - if (!glyph) - { - if (del) - gr = del; - break; - } - if (glyph == DeletedGlyph) - { - if (!del) - del = gr; - else if (gr == del) - break; - } - else if (s == signature && - (!match || - memcmp (&compare->info, &glyph->info, compare->size) == 0)) - { - break; - } - if (!step) - { - step = signature % hash->hashSet->rehash; - if (!step) - step = 1; - } - elt += step; - if (elt >= tableSize) - elt -= tableSize; - } - return gr; -} - -CARD32 -HashGlyph (GlyphPtr glyph) -{ - CARD32 *bits = (CARD32 *) &(glyph->info); - CARD32 hash; - int n = glyph->size / sizeof (CARD32); - - hash = 0; - while (n--) - hash ^= *bits++; - return hash; -} - -#ifdef CHECK_DUPLICATES -void -DuplicateRef (GlyphPtr glyph, char *where) -{ - ErrorF ("Duplicate Glyph 0x%x from %s\n", glyph, where); -} - -void -CheckDuplicates (GlyphHashPtr hash, char *where) -{ - GlyphPtr g; - int i, j; - - for (i = 0; i < hash->hashSet->size; i++) - { - g = hash->table[i].glyph; - if (!g || g == DeletedGlyph) - continue; - for (j = i + 1; j < hash->hashSet->size; j++) - if (hash->table[j].glyph == g) - DuplicateRef (g, where); - } -} -#else -#define CheckDuplicates(a,b) -#define DuplicateRef(a,b) -#endif - -void -FreeGlyph (GlyphPtr glyph, int format) -{ - CheckDuplicates (&globalGlyphs[format], "FreeGlyph"); - if (--glyph->refcnt == 0) - { - GlyphRefPtr gr; - int i; - int first; - - first = -1; - for (i = 0; i < globalGlyphs[format].hashSet->size; i++) - if (globalGlyphs[format].table[i].glyph == glyph) - { - if (first != -1) - DuplicateRef (glyph, "FreeGlyph check"); - first = i; - } - - gr = FindGlyphRef (&globalGlyphs[format], - HashGlyph (glyph), TRUE, glyph); - if (gr - globalGlyphs[format].table != first) - DuplicateRef (glyph, "Found wrong one"); - if (gr->glyph && gr->glyph != DeletedGlyph) - { - gr->glyph = DeletedGlyph; - gr->signature = 0; - globalGlyphs[format].tableEntries--; - } - xfree (glyph); - } -} - -void -AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) -{ - GlyphRefPtr gr; - CARD32 hash; - - CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph top global"); - /* Locate existing matching glyph */ - hash = HashGlyph (glyph); - gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph); - if (gr->glyph && gr->glyph != DeletedGlyph) - { - xfree (glyph); - glyph = gr->glyph; - } - else - { - gr->glyph = glyph; - gr->signature = hash; - globalGlyphs[glyphSet->fdepth].tableEntries++; - } - - /* Insert/replace glyphset value */ - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - ++glyph->refcnt; - if (gr->glyph && gr->glyph != DeletedGlyph) - FreeGlyph (gr->glyph, glyphSet->fdepth); - else - glyphSet->hash.tableEntries++; - gr->glyph = glyph; - gr->signature = id; - CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom"); -} - -Bool -DeleteGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphRefPtr gr; - GlyphPtr glyph; - - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - glyph = gr->glyph; - if (glyph && glyph != DeletedGlyph) - { - gr->glyph = DeletedGlyph; - glyphSet->hash.tableEntries--; - FreeGlyph (glyph, glyphSet->fdepth); - return TRUE; - } - return FALSE; -} - -GlyphPtr -FindGlyph (GlyphSetPtr glyphSet, Glyph id) -{ - GlyphPtr glyph; - - glyph = FindGlyphRef (&glyphSet->hash, id, FALSE, 0)->glyph; - if (glyph == DeletedGlyph) - glyph = 0; - return glyph; -} - -GlyphPtr -AllocateGlyph (xGlyphInfo *gi, int fdepth) -{ - int size; - GlyphPtr glyph; - size_t padded_width; - - padded_width = PixmapBytePad (gi->width, glyphDepths[fdepth]); - if (gi->height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi->height) - return 0; - size = gi->height * padded_width; - glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec)); - if (!glyph) - return 0; - glyph->refcnt = 0; - glyph->size = size + sizeof (xGlyphInfo); - glyph->info = *gi; - return glyph; -} - -Bool -AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) -{ - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); - if (!hash->table) - return FALSE; - memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); - hash->hashSet = hashSet; - hash->tableEntries = 0; - return TRUE; -} - -Bool -ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) -{ - CARD32 tableEntries; - GlyphHashSetPtr hashSet; - GlyphHashRec newHash; - GlyphRefPtr gr; - GlyphPtr glyph; - int i; - int oldSize; - CARD32 s; - - tableEntries = hash->tableEntries + change; - hashSet = FindGlyphHashSet (tableEntries); - if (hashSet == hash->hashSet) - return TRUE; - if (global) - CheckDuplicates (hash, "ResizeGlyphHash top"); - if (!AllocateGlyphHash (&newHash, hashSet)) - return FALSE; - if (hash->table) - { - oldSize = hash->hashSet->size; - for (i = 0; i < oldSize; i++) - { - glyph = hash->table[i].glyph; - if (glyph && glyph != DeletedGlyph) - { - s = hash->table[i].signature; - gr = FindGlyphRef (&newHash, s, global, glyph); - gr->signature = s; - gr->glyph = glyph; - ++newHash.tableEntries; - } - } - xfree (hash->table); - } - *hash = newHash; - if (global) - CheckDuplicates (hash, "ResizeGlyphHash bottom"); - return TRUE; -} - -Bool -ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change) -{ - return (ResizeGlyphHash (&glyphSet->hash, change, FALSE) && - ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], change, TRUE)); -} - -GlyphSetPtr -AllocateGlyphSet (int fdepth, PictFormatPtr format) -{ - GlyphSetPtr glyphSet; - int size; - - if (!globalGlyphs[fdepth].hashSet) - { - if (!AllocateGlyphHash (&globalGlyphs[fdepth], &glyphHashSets[0])) - return FALSE; - } - - size = (sizeof (GlyphSetRec) + - (sizeof (pointer) * _GlyphSetPrivateAllocateIndex)); - glyphSet = xalloc (size); - if (!glyphSet) - return FALSE; - bzero((char *)glyphSet, size); - glyphSet->maxPrivate = _GlyphSetPrivateAllocateIndex - 1; - if (_GlyphSetPrivateAllocateIndex) - glyphSet->devPrivates = (pointer)(&glyphSet[1]); - - if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) - { - xfree (glyphSet); - return FALSE; - } - glyphSet->refcnt = 1; - glyphSet->fdepth = fdepth; - glyphSet->format = format; - return glyphSet; -} - -int -FreeGlyphSet (pointer value, - XID gid) -{ - GlyphSetPtr glyphSet = (GlyphSetPtr) value; - - if (--glyphSet->refcnt == 0) - { - CARD32 i, tableSize = glyphSet->hash.hashSet->size; - GlyphRefPtr table = glyphSet->hash.table; - GlyphPtr glyph; - - for (i = 0; i < tableSize; i++) - { - glyph = table[i].glyph; - if (glyph && glyph != DeletedGlyph) - FreeGlyph (glyph, glyphSet->fdepth); - } - if (!globalGlyphs[glyphSet->fdepth].tableEntries) - { - xfree (globalGlyphs[glyphSet->fdepth].table); - globalGlyphs[glyphSet->fdepth].table = 0; - globalGlyphs[glyphSet->fdepth].hashSet = 0; - } - else - ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE); - xfree (table); - - if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) - xfree(glyphSet->devPrivates); - - xfree (glyphSet); - } - return Success; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original deleted file mode 100644 index 7a1d813b3..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original +++ /dev/null @@ -1,241 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/************************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ - -/* $Xorg: glyphcurs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "misc.h" -#include -#include "dixfontstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "resource.h" -#include "dix.h" -#include "cursorstr.h" -#include "opaque.h" -#include "servermd.h" - -#include "../../fb/fb.h" -#include "Pixmaps.h" - -#ifndef True -#define True 1 -#endif - -/* - get the bits out of the font in a portable way. to avoid -dealing with padding and such-like, we draw the glyph into -a bitmap, then read the bits out with GetImage, which -uses server-natural format. - since all screens return the same bitmap format, we'll just use -the first one we find. - the character origin lines up with the hotspot in the -cursor metrics. -*/ - -int -ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, unsigned char **ppbits) -{ - register ScreenPtr pScreen; - register GCPtr pGC; - xRectangle rect; - PixmapPtr ppix; - long nby; - char *pbits; - ChangeGCVal gcval[3]; - unsigned char char2b[2]; - - /* turn glyph index into a protocol-format char2b */ - char2b[0] = (unsigned char)(ch >> 8); - char2b[1] = (unsigned char)(ch & 0xff); - - pScreen = screenInfo.screens[0]; - nby = BitmapBytePad(cm->width) * (long)cm->height; - pbits = (char *)xalloc(nby); - if (!pbits) - return BadAlloc; - /* zeroing the (pad) bits seems to help some ddx cursor handling */ - bzero(pbits, nby); - - ppix = fbCreatePixmap(pScreen, cm->width, cm->height, 1); - pGC = GetScratchGC(1, pScreen); - if (!ppix || !pGC) - { - if (ppix) - fbDestroyPixmap(ppix); - if (pGC) - FreeScratchGC(pGC); - xfree(pbits); - return BadAlloc; - } - - #ifdef TEST - fprintf(stderr, "ServerBitsFromGlyph: Created virtual pixmap at [%p] with width [%d] height [%d] depth [%d].\n", - (void *) ppix, cm->width, cm->height, 1); - #endif - - nxagentPixmapPriv(ppix) -> id = 0; - nxagentPixmapPriv(ppix) -> mid = 0; - nxagentPixmapPriv(ppix) -> isVirtual = True; - nxagentPixmapPriv(ppix) -> pRealPixmap = NULL; - nxagentPixmapPriv(ppix) -> pVirtualPixmap = NULL; - - rect.x = 0; - rect.y = 0; - rect.width = cm->width; - rect.height = cm->height; - - pGC->stateChanges |= GCFunction | GCForeground | GCFont; - pGC->alu = GXcopy; - - pGC->fgPixel = 0; - - pfont->refcnt++; - - if (pGC->font) - CloseFont(pGC->font, (Font)0); - - pGC->font = pfont; - - ValidateGC((DrawablePtr)ppix, pGC); - fbPolyFillRect((DrawablePtr)ppix, pGC, 1, &rect); - - /* draw the glyph */ - gcval[0].val = 1; - pGC->fgPixel = 1; - - pGC->stateChanges |= GCForeground; - - ValidateGC((DrawablePtr)ppix, pGC); - miPolyText16((DrawablePtr)ppix, pGC, (int)cm->xhot, (int)cm->yhot, (int)1, (unsigned short*)char2b); - fbGetImage((DrawablePtr)ppix, 0, 0, cm->width, cm->height, - XYPixmap, 1, pbits); - *ppbits = (unsigned char *)pbits; - FreeScratchGC(pGC); - fbDestroyPixmap(ppix); - - #ifdef TEST - fprintf(stderr, "ServerBitsFromGlyph: Destroyed virtual pixmap at [%p].\n", - (void *) ppix); - #endif - - return Success; -} - - -Bool -CursorMetricsFromGlyph(register FontPtr pfont, unsigned ch, register CursorMetricPtr cm) -{ - CharInfoPtr pci; - unsigned long nglyphs; - CARD8 chs[2]; - FontEncoding encoding; - - chs[0] = ch >> 8; - chs[1] = ch; - encoding = (FONTLASTROW(pfont) == 0) ? Linear16Bit : TwoD16Bit; - if (encoding == Linear16Bit) - { - if (ch < pfont->info.firstCol || pfont->info.lastCol < ch) - return FALSE; - } - else - { - if (chs[0] < pfont->info.firstRow || pfont->info.lastRow < chs[0]) - return FALSE; - if (chs[1] < pfont->info.firstCol || pfont->info.lastCol < chs[1]) - return FALSE; - } - (*pfont->get_glyphs) (pfont, 1, chs, encoding, &nglyphs, &pci); - if (nglyphs == 0) - return FALSE; - cm->width = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; - cm->height = pci->metrics.descent + pci->metrics.ascent; - if (pci->metrics.leftSideBearing > 0) - { - cm->width += pci->metrics.leftSideBearing; - cm->xhot = 0; - } - else - { - cm->xhot = -pci->metrics.leftSideBearing; - if (pci->metrics.rightSideBearing < 0) - cm->width -= pci->metrics.rightSideBearing; - } - if (pci->metrics.ascent < 0) - { - cm->height -= pci->metrics.ascent; - cm->yhot = 0; - } - else - { - cm->yhot = pci->metrics.ascent; - if (pci->metrics.descent < 0) - cm->height -= pci->metrics.descent; - } - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.X.original deleted file mode 100644 index 8f8adf5ce..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.X.original +++ /dev/null @@ -1,194 +0,0 @@ -/************************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ - -/* $Xorg: glyphcurs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "misc.h" -#include -#include "dixfontstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "resource.h" -#include "dix.h" -#include "cursorstr.h" -#include "opaque.h" -#include "servermd.h" - - -/* - get the bits out of the font in a portable way. to avoid -dealing with padding and such-like, we draw the glyph into -a bitmap, then read the bits out with GetImage, which -uses server-natural format. - since all screens return the same bitmap format, we'll just use -the first one we find. - the character origin lines up with the hotspot in the -cursor metrics. -*/ - -int -ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, unsigned char **ppbits) -{ - register ScreenPtr pScreen; - register GCPtr pGC; - xRectangle rect; - PixmapPtr ppix; - long nby; - char *pbits; - ChangeGCVal gcval[3]; - unsigned char char2b[2]; - - /* turn glyph index into a protocol-format char2b */ - char2b[0] = (unsigned char)(ch >> 8); - char2b[1] = (unsigned char)(ch & 0xff); - - pScreen = screenInfo.screens[0]; - nby = BitmapBytePad(cm->width) * (long)cm->height; - pbits = (char *)xalloc(nby); - if (!pbits) - return BadAlloc; - /* zeroing the (pad) bits seems to help some ddx cursor handling */ - bzero(pbits, nby); - - ppix = (PixmapPtr)(*pScreen->CreatePixmap)(pScreen, cm->width, - cm->height, 1); - pGC = GetScratchGC(1, pScreen); - if (!ppix || !pGC) - { - if (ppix) - (*pScreen->DestroyPixmap)(ppix); - if (pGC) - FreeScratchGC(pGC); - xfree(pbits); - return BadAlloc; - } - - rect.x = 0; - rect.y = 0; - rect.width = cm->width; - rect.height = cm->height; - - /* fill the pixmap with 0 */ - gcval[0].val = GXcopy; - gcval[1].val = 0; - gcval[2].ptr = (pointer)pfont; - dixChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont, - NULL, gcval); - ValidateGC((DrawablePtr)ppix, pGC); - (*pGC->ops->PolyFillRect)((DrawablePtr)ppix, pGC, 1, &rect); - - /* draw the glyph */ - gcval[0].val = 1; - dixChangeGC(NullClient, pGC, GCForeground, NULL, gcval); - ValidateGC((DrawablePtr)ppix, pGC); - (*pGC->ops->PolyText16)((DrawablePtr)ppix, pGC, cm->xhot, cm->yhot, - 1, (unsigned short *)char2b); - (*pScreen->GetImage)((DrawablePtr)ppix, 0, 0, cm->width, cm->height, - XYPixmap, 1, pbits); - *ppbits = (unsigned char *)pbits; - FreeScratchGC(pGC); - (*pScreen->DestroyPixmap)(ppix); - return Success; -} - - -Bool -CursorMetricsFromGlyph(register FontPtr pfont, unsigned ch, register CursorMetricPtr cm) -{ - CharInfoPtr pci; - unsigned long nglyphs; - CARD8 chs[2]; - FontEncoding encoding; - - chs[0] = ch >> 8; - chs[1] = ch; - encoding = (FONTLASTROW(pfont) == 0) ? Linear16Bit : TwoD16Bit; - if (encoding == Linear16Bit) - { - if (ch < pfont->info.firstCol || pfont->info.lastCol < ch) - return FALSE; - } - else - { - if (chs[0] < pfont->info.firstRow || pfont->info.lastRow < chs[0]) - return FALSE; - if (chs[1] < pfont->info.firstCol || pfont->info.lastCol < chs[1]) - return FALSE; - } - (*pfont->get_glyphs) (pfont, 1, chs, encoding, &nglyphs, &pci); - if (nglyphs == 0) - return FALSE; - cm->width = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; - cm->height = pci->metrics.descent + pci->metrics.ascent; - if (pci->metrics.leftSideBearing > 0) - { - cm->width += pci->metrics.leftSideBearing; - cm->xhot = 0; - } - else - { - cm->xhot = -pci->metrics.leftSideBearing; - if (pci->metrics.rightSideBearing < 0) - cm->width -= pci->metrics.rightSideBearing; - } - if (pci->metrics.ascent < 0) - { - cm->height -= pci->metrics.ascent; - cm->yhot = 0; - } - else - { - cm->yhot = pci->metrics.ascent; - if (pci->metrics.descent < 0) - cm->height -= pci->metrics.descent; - } - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original deleted file mode 100644 index fa6b5fb02..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.3 2000/11/20 07:13:13 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -/* - * This must keep the same symbol as the original glyphstr.h - * or symbols will be redefined. The code here adds a field - * to _GlyphSet. This should be done by defining a new type - * and casting when appropriate. - */ - -#ifndef _GLYPHSTR_H_ -#define _GLYPHSTR_H_ - -#include -#include "../../render/picture.h" -#include "screenint.h" - -#define GlyphFormat1 0 -#define GlyphFormat4 1 -#define GlyphFormat8 2 -#define GlyphFormat16 3 -#define GlyphFormat32 4 -#define GlyphFormatNum 5 - -typedef struct _Glyph { - CARD32 refcnt; - CARD32 size; /* info + bitmap */ - xGlyphInfo info; - /* bits follow */ -} GlyphRec, *GlyphPtr; - -typedef struct _GlyphRef { - CARD32 signature; - GlyphPtr glyph; - CARD16 corruptedGlyph; -} GlyphRefRec, *GlyphRefPtr; - -#define DeletedGlyph ((GlyphPtr) 1) - -typedef struct _GlyphHashSet { - CARD32 entries; - CARD32 size; - CARD32 rehash; -} GlyphHashSetRec, *GlyphHashSetPtr; - -typedef struct _GlyphHash { - GlyphRefPtr table; - GlyphHashSetPtr hashSet; - CARD32 tableEntries; -} GlyphHashRec, *GlyphHashPtr; - -typedef struct _GlyphSet { - CARD32 refcnt; - PictFormatPtr format; - int fdepth; - GlyphHashRec hash; - int maxPrivate; - pointer *devPrivates; - CARD32 remoteID; -} GlyphSetRec, *GlyphSetPtr; - -#define GlyphSetGetPrivate(pGlyphSet,n) \ - ((n) > (pGlyphSet)->maxPrivate ? \ - (pointer) 0 : \ - (pGlyphSet)->devPrivates[n]) - -#define GlyphSetSetPrivate(pGlyphSet,n,ptr) \ - ((n) > (pGlyphSet)->maxPrivate ? \ - _GlyphSetSetNewPrivate(pGlyphSet, n, ptr) : \ - ((((pGlyphSet)->devPrivates[n] = (ptr)) != 0) || TRUE)) - -typedef struct _GlyphList { - INT16 xOff; - INT16 yOff; - CARD8 len; - PictFormatPtr format; -} GlyphListRec, *GlyphListPtr; - -extern GlyphHashRec globalGlyphs[GlyphFormatNum]; - -GlyphHashSetPtr -FindGlyphHashSet (CARD32 filled); - -int -AllocateGlyphSetPrivateIndex (void); - -void -ResetGlyphSetPrivateIndex (void); - -Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr); - -Bool -GlyphInit (ScreenPtr pScreen); - -GlyphRefPtr -FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare); - -CARD32 -HashGlyph (GlyphPtr glyph); - -void -FreeGlyph (GlyphPtr glyph, int format); - -void -AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id); - -Bool -DeleteGlyph (GlyphSetPtr glyphSet, Glyph id); - -GlyphPtr -FindGlyph (GlyphSetPtr glyphSet, Glyph id); - -GlyphPtr -AllocateGlyph (xGlyphInfo *gi, int format); - -Bool -AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet); - -Bool -ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global); - -Bool -ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change); - -GlyphSetPtr -AllocateGlyphSet (int fdepth, PictFormatPtr format); - -int -FreeGlyphSet (pointer value, - XID gid); - - - -#endif /* _GLYPHSTR_H_ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.X.original deleted file mode 100644 index f4777a248..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.X.original +++ /dev/null @@ -1,148 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.3 2000/11/20 07:13:13 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifndef _GLYPHSTR_H_ -#define _GLYPHSTR_H_ - -#include -#include "picture.h" -#include "screenint.h" - -#define GlyphFormat1 0 -#define GlyphFormat4 1 -#define GlyphFormat8 2 -#define GlyphFormat16 3 -#define GlyphFormat32 4 -#define GlyphFormatNum 5 - -typedef struct _Glyph { - CARD32 refcnt; - CARD32 size; /* info + bitmap */ - xGlyphInfo info; - /* bits follow */ -} GlyphRec, *GlyphPtr; - -typedef struct _GlyphRef { - CARD32 signature; - GlyphPtr glyph; -} GlyphRefRec, *GlyphRefPtr; - -#define DeletedGlyph ((GlyphPtr) 1) - -typedef struct _GlyphHashSet { - CARD32 entries; - CARD32 size; - CARD32 rehash; -} GlyphHashSetRec, *GlyphHashSetPtr; - -typedef struct _GlyphHash { - GlyphRefPtr table; - GlyphHashSetPtr hashSet; - CARD32 tableEntries; -} GlyphHashRec, *GlyphHashPtr; - -typedef struct _GlyphSet { - CARD32 refcnt; - PictFormatPtr format; - int fdepth; - GlyphHashRec hash; - int maxPrivate; - pointer *devPrivates; -} GlyphSetRec, *GlyphSetPtr; - -#define GlyphSetGetPrivate(pGlyphSet,n) \ - ((n) > (pGlyphSet)->maxPrivate ? \ - (pointer) 0 : \ - (pGlyphSet)->devPrivates[n]) - -#define GlyphSetSetPrivate(pGlyphSet,n,ptr) \ - ((n) > (pGlyphSet)->maxPrivate ? \ - _GlyphSetSetNewPrivate(pGlyphSet, n, ptr) : \ - ((((pGlyphSet)->devPrivates[n] = (ptr)) != 0) || TRUE)) - -typedef struct _GlyphList { - INT16 xOff; - INT16 yOff; - CARD8 len; - PictFormatPtr format; -} GlyphListRec, *GlyphListPtr; - -extern GlyphHashRec globalGlyphs[GlyphFormatNum]; - -GlyphHashSetPtr -FindGlyphHashSet (CARD32 filled); - -int -AllocateGlyphSetPrivateIndex (void); - -void -ResetGlyphSetPrivateIndex (void); - -Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr); - -Bool -GlyphInit (ScreenPtr pScreen); - -GlyphRefPtr -FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare); - -CARD32 -HashGlyph (GlyphPtr glyph); - -void -FreeGlyph (GlyphPtr glyph, int format); - -void -AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id); - -Bool -DeleteGlyph (GlyphSetPtr glyphSet, Glyph id); - -GlyphPtr -FindGlyph (GlyphSetPtr glyphSet, Glyph id); - -GlyphPtr -AllocateGlyph (xGlyphInfo *gi, int format); - -Bool -AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet); - -Bool -ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global); - -Bool -ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change); - -GlyphSetPtr -AllocateGlyphSet (int fdepth, PictFormatPtr format); - -int -FreeGlyphSet (pointer value, - XID gid); - - - -#endif /* _GLYPHSTR_H_ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original deleted file mode 100644 index 3fc73cf3b..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original +++ /dev/null @@ -1,979 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XdotOrg: xc/programs/Xserver/mi/miexpose.c,v 1.6 2005/07/03 08:53:51 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/mi/miexpose.c,v 3.9tsi Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/* $Xorg: miexpose.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#define NEED_EVENTS -#include -#include - -#include "misc.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmap.h" -#include "input.h" - -#include "dixstruct.h" -#include "mi.h" -#include - -#include "globals.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -/* - machine-independent graphics exposure code. any device that uses -the region package can call this. -*/ - -#ifdef NXAGENT_SERVER - -#include "Windows.h" - -#endif - -#ifndef RECTLIMIT -#define RECTLIMIT 25 /* pick a number, any number > 8 */ -#endif - -/* miHandleExposures - generate a region for exposures for areas that were copied from obscured or -non-existent areas to non-obscured areas of the destination. Paint the -background for the region, if the destination is a window. - -NOTE: - this should generally be called, even if graphicsExposures is false, -because this is where bits get recovered from backing store. - -NOTE: - added argument 'plane' is used to indicate how exposures from backing -store should be accomplished. If plane is 0 (i.e. no bit plane), CopyArea -should be used, else a CopyPlane of the indicated plane will be used. The -exposing is done by the backing store's GraphicsExpose function, of course. - -*/ - -RegionPtr -miHandleExposures(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, plane) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; - GCPtr pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; - unsigned long plane; -{ - register ScreenPtr pscr; - RegionPtr prgnSrcClip; /* drawable-relative source clip */ - RegionRec rgnSrcRec; - RegionPtr prgnDstClip; /* drawable-relative dest clip */ - RegionRec rgnDstRec; - BoxRec srcBox; /* unclipped source */ - RegionRec rgnExposed; /* exposed region, calculated source- - relative, made dst relative to - intersect with visible parts of - dest and send events to client, - and then screen relative to paint - the window background - */ - WindowPtr pSrcWin; - BoxRec expBox; - Bool extents; - -#ifdef NXAGENT_SERVER - - /* - * Set the elements reported by the compiler - * as uninitialized. - */ - - expBox.x1 = 0; - expBox.y1 = 0; - expBox.x2 = 0; - expBox.y2 = 0; - -#endif - - /* This prevents warning about pscr not being used. */ - pGC->pScreen = pscr = pGC->pScreen; - - /* avoid work if we can */ - if (!pGC->graphicsExposures && - (pDstDrawable->type == DRAWABLE_PIXMAP) && - ((pSrcDrawable->type == DRAWABLE_PIXMAP) || - (((WindowPtr)pSrcDrawable)->backStorage == NULL))) - return NULL; - - srcBox.x1 = srcx; - srcBox.y1 = srcy; - srcBox.x2 = srcx+width; - srcBox.y2 = srcy+height; - - if (pSrcDrawable->type != DRAWABLE_PIXMAP) - { - BoxRec TsrcBox; - - TsrcBox.x1 = srcx + pSrcDrawable->x; - TsrcBox.y1 = srcy + pSrcDrawable->y; - TsrcBox.x2 = TsrcBox.x1 + width; - TsrcBox.y2 = TsrcBox.y1 + height; - pSrcWin = (WindowPtr) pSrcDrawable; - if (pGC->subWindowMode == IncludeInferiors) - { - prgnSrcClip = NotClippedByChildren (pSrcWin); - if ((RECT_IN_REGION(pscr, prgnSrcClip, &TsrcBox)) == rgnIN) - { - REGION_DESTROY(pscr, prgnSrcClip); - return NULL; - } - } - else - { - if ((RECT_IN_REGION(pscr, &pSrcWin->clipList, &TsrcBox)) == rgnIN) - return NULL; - prgnSrcClip = &rgnSrcRec; - REGION_NULL(pscr, prgnSrcClip); - REGION_COPY(pscr, prgnSrcClip, &pSrcWin->clipList); - } - REGION_TRANSLATE(pscr, prgnSrcClip, - -pSrcDrawable->x, -pSrcDrawable->y); - } - else - { - BoxRec box; - - if ((srcBox.x1 >= 0) && (srcBox.y1 >= 0) && - (srcBox.x2 <= pSrcDrawable->width) && - (srcBox.y2 <= pSrcDrawable->height)) - return NULL; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pSrcDrawable->width; - box.y2 = pSrcDrawable->height; - prgnSrcClip = &rgnSrcRec; - REGION_INIT(pscr, prgnSrcClip, &box, 1); - pSrcWin = (WindowPtr)NULL; - } - - if (pDstDrawable == pSrcDrawable) - { - prgnDstClip = prgnSrcClip; - } - else if (pDstDrawable->type != DRAWABLE_PIXMAP) - { - if (pGC->subWindowMode == IncludeInferiors) - { - prgnDstClip = NotClippedByChildren((WindowPtr)pDstDrawable); - } - else - { - prgnDstClip = &rgnDstRec; - REGION_NULL(pscr, prgnDstClip); - REGION_COPY(pscr, prgnDstClip, - &((WindowPtr)pDstDrawable)->clipList); - } - REGION_TRANSLATE(pscr, prgnDstClip, - -pDstDrawable->x, -pDstDrawable->y); - } - else - { - BoxRec box; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pDstDrawable->width; - box.y2 = pDstDrawable->height; - prgnDstClip = &rgnDstRec; - REGION_INIT(pscr, prgnDstClip, &box, 1); - } - - /* drawable-relative source region */ - REGION_INIT(pscr, &rgnExposed, &srcBox, 1); - - /* now get the hidden parts of the source box*/ - REGION_SUBTRACT(pscr, &rgnExposed, &rgnExposed, prgnSrcClip); - - if (pSrcWin && pSrcWin->backStorage) - { - /* - * Copy any areas from the source backing store. Modifies - * rgnExposed. - */ - (* pSrcWin->drawable.pScreen->ExposeCopy) ((WindowPtr)pSrcDrawable, - pDstDrawable, - pGC, - &rgnExposed, - srcx, srcy, - dstx, dsty, - plane); - } - - /* move them over the destination */ - REGION_TRANSLATE(pscr, &rgnExposed, dstx-srcx, dsty-srcy); - - /* intersect with visible areas of dest */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip); - - /* - * If we have LOTS of rectangles, we decide to take the extents - * and force an exposure on that. This should require much less - * work overall, on both client and server. This is cheating, but - * isn't prohibited by the protocol ("spontaneous combustion" :-) - * for windows. - */ - extents = pGC->graphicsExposures && - (REGION_NUM_RECTS(&rgnExposed) > RECTLIMIT) && - (pDstDrawable->type != DRAWABLE_PIXMAP); -#ifdef SHAPE - if (pSrcWin) - { - RegionPtr region; - if (!(region = wClipShape (pSrcWin))) - region = wBoundingShape (pSrcWin); - /* - * If you try to CopyArea the extents of a shaped window, compacting the - * exposed region will undo all our work! - */ - if (extents && pSrcWin && region && - (RECT_IN_REGION(pscr, region, &srcBox) != rgnIN)) - extents = FALSE; - } -#endif - if (extents) - { - WindowPtr pWin = (WindowPtr)pDstDrawable; - - expBox = *REGION_EXTENTS(pscr, &rgnExposed); - REGION_RESET(pscr, &rgnExposed, &expBox); - /* need to clear out new areas of backing store */ - if (pWin->backStorage) - (void) (* pWin->drawable.pScreen->ClearBackingStore)( - pWin, - expBox.x1, - expBox.y1, - expBox.x2 - expBox.x1, - expBox.y2 - expBox.y1, - FALSE); - } - if ((pDstDrawable->type != DRAWABLE_PIXMAP) && - (((WindowPtr)pDstDrawable)->backgroundState != None)) - { - WindowPtr pWin = (WindowPtr)pDstDrawable; - - /* make the exposed area screen-relative */ - REGION_TRANSLATE(pscr, &rgnExposed, - pDstDrawable->x, pDstDrawable->y); - - if (extents) - { - /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList); - } - (*pWin->drawable.pScreen->PaintWindowBackground)( - (WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); - - if (extents) - { - REGION_RESET(pscr, &rgnExposed, &expBox); - } - else - REGION_TRANSLATE(pscr, &rgnExposed, - -pDstDrawable->x, -pDstDrawable->y); - } - if (prgnDstClip == &rgnDstRec) - { - REGION_UNINIT(pscr, prgnDstClip); - } - else if (prgnDstClip != prgnSrcClip) - { - REGION_DESTROY(pscr, prgnDstClip); - } - - if (prgnSrcClip == &rgnSrcRec) - { - REGION_UNINIT(pscr, prgnSrcClip); - } - else - { - REGION_DESTROY(pscr, prgnSrcClip); - } - - if (pGC->graphicsExposures) - { - /* don't look */ - RegionPtr exposed = REGION_CREATE(pscr, NullBox, 0); - *exposed = rgnExposed; - return exposed; - } - else - { - REGION_UNINIT(pscr, &rgnExposed); - return NULL; - } -} - -/* send GraphicsExpose events, or a NoExpose event, based on the region */ - -void -miSendGraphicsExpose (client, pRgn, drawable, major, minor) - ClientPtr client; - RegionPtr pRgn; - XID drawable; - int major; - int minor; -{ - if (pRgn && !REGION_NIL(pRgn)) - { - xEvent *pEvent; - register xEvent *pe; - register BoxPtr pBox; - register int i; - int numRects; - - numRects = REGION_NUM_RECTS(pRgn); - pBox = REGION_RECTS(pRgn); - if(!(pEvent = (xEvent *)ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) - return; - pe = pEvent; - - for (i=1; i<=numRects; i++, pe++, pBox++) - { - pe->u.u.type = GraphicsExpose; - pe->u.graphicsExposure.drawable = drawable; - pe->u.graphicsExposure.x = pBox->x1; - pe->u.graphicsExposure.y = pBox->y1; - pe->u.graphicsExposure.width = pBox->x2 - pBox->x1; - pe->u.graphicsExposure.height = pBox->y2 - pBox->y1; - pe->u.graphicsExposure.count = numRects - i; - pe->u.graphicsExposure.majorEvent = major; - pe->u.graphicsExposure.minorEvent = minor; - } - TryClientEvents(client, pEvent, numRects, - (Mask)0, NoEventMask, NullGrab); - DEALLOCATE_LOCAL(pEvent); - } - else - { - xEvent event; - event.u.u.type = NoExpose; - event.u.noExposure.drawable = drawable; - event.u.noExposure.majorEvent = major; - event.u.noExposure.minorEvent = minor; - TryClientEvents(client, &event, 1, - (Mask)0, NoEventMask, NullGrab); - } -} - - -void -miSendExposures(pWin, pRgn, dx, dy) - WindowPtr pWin; - RegionPtr pRgn; - register int dx, dy; -{ - register BoxPtr pBox; - int numRects; - register xEvent *pEvent, *pe; - register int i; - - pBox = REGION_RECTS(pRgn); - numRects = REGION_NUM_RECTS(pRgn); - if(!(pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) - return; - - for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++) - { - pe->u.u.type = Expose; - pe->u.expose.window = pWin->drawable.id; - pe->u.expose.x = pBox->x1 - dx; - pe->u.expose.y = pBox->y1 - dy; - pe->u.expose.width = pBox->x2 - pBox->x1; - pe->u.expose.height = pBox->y2 - pBox->y1; - pe->u.expose.count = i; - } - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int scrnum = pWin->drawable.pScreen->myNum; - int x = 0, y = 0; - XID realWin = 0; - - if(!pWin->parent) { - x = panoramiXdataPtr[scrnum].x; - y = panoramiXdataPtr[scrnum].y; - pWin = WindowTable[0]; - realWin = pWin->drawable.id; - } else if (scrnum) { - PanoramiXRes *win; - win = PanoramiXFindIDByScrnum(XRT_WINDOW, - pWin->drawable.id, scrnum); - if(!win) { - DEALLOCATE_LOCAL(pEvent); - return; - } - realWin = win->info[0].id; - pWin = LookupIDByType(realWin, RT_WINDOW); - } - if(x || y || scrnum) - for (i = 0; i < numRects; i++) { - pEvent[i].u.expose.window = realWin; - pEvent[i].u.expose.x += x; - pEvent[i].u.expose.y += y; - } - } -#endif - - DeliverEvents(pWin, pEvent, numRects, NullWindow); - - DEALLOCATE_LOCAL(pEvent); -} - -void -miWindowExposures(pWin, prgn, other_exposed) - WindowPtr pWin; - register RegionPtr prgn, other_exposed; -{ -#ifdef NXAGENT_SERVER - - int total; - -#endif - RegionPtr exposures = prgn; - if (pWin->backStorage && prgn) - /* - * in some cases, backing store will cause a different - * region to be exposed than needs to be repainted - * (like when a window is mapped). RestoreAreas is - * allowed to return a region other than prgn, - * in which case this routine will free the resultant - * region. If exposures is null, then no events will - * be sent to the client; if prgn is empty - * no areas will be repainted. - */ - exposures = (*pWin->drawable.pScreen->RestoreAreas)(pWin, prgn); - if ((prgn && !REGION_NIL(prgn)) || - (exposures && !REGION_NIL(exposures)) || other_exposed) - { - RegionRec expRec; - int clientInterested; - - /* - * Restore from backing-store FIRST. - */ - clientInterested = (pWin->eventMask|wOtherEventMasks(pWin)) & ExposureMask; - if (other_exposed) - { - if (exposures) - { - REGION_UNION(pWin->drawable.pScreen, other_exposed, - exposures, - other_exposed); - if (exposures != prgn) - REGION_DESTROY(pWin->drawable.pScreen, exposures); - } - exposures = other_exposed; - } -#ifdef NXAGENT_SERVER - - /* - * If the number of rectangles is greater - * than 4, let the function decide. - */ - - total = REGION_NUM_RECTS(exposures); - - if (clientInterested && exposures && (total > RECTLIMIT || - (total > 4 && nxagentExtentsPredicate(total) == 1))) -#else - if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT)) -#endif - { - /* - * If we have LOTS of rectangles, we decide to take the extents - * and force an exposure on that. This should require much less - * work overall, on both client and server. This is cheating, but - * isn't prohibited by the protocol ("spontaneous combustion" :-). - */ - BoxRec box; - - box = *REGION_EXTENTS( pWin->drawable.pScreen, exposures); - if (exposures == prgn) { - exposures = &expRec; - REGION_INIT( pWin->drawable.pScreen, exposures, &box, 1); - REGION_RESET( pWin->drawable.pScreen, prgn, &box); - } else { - REGION_RESET( pWin->drawable.pScreen, exposures, &box); - REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures); - } - /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList); - /* need to clear out new areas of backing store, too */ - if (pWin->backStorage) - (void) (* pWin->drawable.pScreen->ClearBackingStore)( - pWin, - box.x1 - pWin->drawable.x, - box.y1 - pWin->drawable.y, - box.x2 - box.x1, - box.y2 - box.y1, - FALSE); - } - if (prgn && !REGION_NIL(prgn)) - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !REGION_NIL(exposures)) - miSendExposures(pWin, exposures, - pWin->drawable.x, pWin->drawable.y); - if (exposures == &expRec) - { - REGION_UNINIT( pWin->drawable.pScreen, exposures); - } - else if (exposures && exposures != prgn && exposures != other_exposed) - REGION_DESTROY( pWin->drawable.pScreen, exposures); - if (prgn) - REGION_EMPTY( pWin->drawable.pScreen, prgn); - } - else if (exposures && exposures != prgn) - REGION_DESTROY( pWin->drawable.pScreen, exposures); -} - - -/* - this code is highly unlikely. it is not haile selassie. - - there is some hair here. we can't just use the window's -clip region as it is, because if we are painting the border, -the border is not in the client area and so we will be excluded -when we validate the GC, and if we are painting a parent-relative -background, the area we want to paint is in some other window. -since we trust the code calling us to tell us to paint only areas -that are really ours, we will temporarily give the window a -clipList the size of the whole screen and an origin at (0,0). -this more or less assumes that ddX code will do translation -based on the window's absolute position, and that ValidateGC will -look at clipList, and that no other fields from the -window will be used. it's not possible to just draw -in the root because it may be a different depth. - -to get the tile to align correctly we set the GC's tile origin to -be the (x,y) of the window's upper left corner, after which we -get the right bits when drawing into the root. - -because the clip_mask is being set to None, we may call DoChangeGC with -fPointer set true, thus we no longer need to install the background or -border tile in the resource table. -*/ - -static RESTYPE ResType = 0; -static int numGCs = 0; -static GCPtr screenContext[MAXSCREENS]; - -/*ARGSUSED*/ -static int -tossGC ( - pointer value, - XID id) -{ - GCPtr pGC = (GCPtr)value; - screenContext[pGC->pScreen->myNum] = (GCPtr)NULL; - FreeGC (pGC, id); - numGCs--; - if (!numGCs) - ResType = 0; - - return 0; -} - - -void -miPaintWindow(pWin, prgn, what) -register WindowPtr pWin; -RegionPtr prgn; -int what; -{ - int status; - - Bool usingScratchGC = FALSE; - WindowPtr pRoot; - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - ChangeGCVal gcval[7]; - ChangeGCVal newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - -#ifdef NXAGENT_SERVER - - /* - * Set the elements reported by the compiler - * as uninitialized. - */ - - prgnWin.extents.x1 = 0; - prgnWin.extents.y1 = 0; - prgnWin.extents.x2 = 0; - prgnWin.extents.y2 = 0; - - prgnWin.data = NULL; - - oldCorner.x = 0; - oldCorner.y = 0; - -#endif - - gcmask = 0; - - if (what == PW_BACKGROUND) - { - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground)(pWin->parent, prgn, what); - return; - case BackgroundPixel: - newValues[FOREGROUND].val = pWin->background.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE].ptr = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - break; - } - } - else - { - if (pWin->borderIsPixel) - { - newValues[FOREGROUND].val = pWin->border.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE].ptr = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * - sizeof(xRectangle)); - if (!prect) - return; - - newValues[FUNCTION].val = GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - pRoot = WindowTable[i]; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - } - - if ((pWin->drawable.depth != pRoot->drawable.depth) || - (pWin->drawable.bitsPerPixel != pRoot->drawable.bitsPerPixel)) - { - usingScratchGC = TRUE; - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if (!pGC) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if (what == PW_BORDER) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - } - else - { - newValues[ABSX].val = 0; - newValues[ABSY].val = 0; - } - } else { - /* - * draw the background to the root window - */ - if (screenContext[i] == (GCPtr)NULL) - { - if (!ResType && !(ResType = CreateNewResourceType(tossGC))) - return; - screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0, - (XID *)NULL, &status); - if (!screenContext[i]) - return; - numGCs++; - if (!AddResource(FakeClientID(0), ResType, - (pointer)screenContext[i])) - return; - } - pGC = screenContext[i]; - newValues[SUBWINDOW].val = IncludeInferiors; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - gcmask |= GCSubwindowMode; - pWin = pRoot; - } - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack); - - mask = gcmask; - gcmask = 0; - i = 0; - while (mask) { - index = lowbit (mask); - mask &= ~index; - switch (index) { - case GCFunction: - if (pGC->alu != newValues[FUNCTION].val) { - gcmask |= index; - gcval[i++].val = newValues[FUNCTION].val; - } - break; - case GCTileStipXOrigin: - if ( pGC->patOrg.x != newValues[ABSX].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSX].val; - } - break; - case GCTileStipYOrigin: - if ( pGC->patOrg.y != newValues[ABSY].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSY].val; - } - break; - case GCClipMask: - if ( pGC->clientClipType != CT_NONE) { - gcmask |= index; - gcval[i++].val = CT_NONE; - } - break; - case GCSubwindowMode: - if ( pGC->subWindowMode != newValues[SUBWINDOW].val) { - gcmask |= index; - gcval[i++].val = newValues[SUBWINDOW].val; - } - break; - case GCTile: - if (pGC->tileIsPixel || pGC->tile.pixmap != newValues[TILE].ptr) - { - gcmask |= index; - gcval[i++].ptr = newValues[TILE].ptr; - } - break; - case GCFillStyle: - if ( pGC->fillStyle != newValues[FILLSTYLE].val) { - gcmask |= index; - gcval[i++].val = newValues[FILLSTYLE].val; - } - break; - case GCForeground: - if ( pGC->fgPixel != newValues[FOREGROUND].val) { - gcmask |= index; - gcval[i++].val = newValues[FOREGROUND].val; - } - break; - } - } - - if (gcmask) - dixChangeGC(NullClient, pGC, gcmask, NULL, gcval); - - if (pWin->drawable.serialNumber != pGC->serialNumber) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(prgn); - pbox = REGION_RECTS(prgn); - for (i= numRects; --i >= 0; pbox++, prect++) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing); - - if (usingScratchGC) - { - if (what == PW_BORDER) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); - } -} - - -/* MICLEARDRAWABLE -- sets the entire drawable to the background color of - * the GC. Useful when we have a scratch drawable and need to initialize - * it. */ -void -miClearDrawable(pDraw, pGC) - DrawablePtr pDraw; - GCPtr pGC; -{ - XID fg = pGC->fgPixel; - XID bg = pGC->bgPixel; - xRectangle rect; - - rect.x = 0; - rect.y = 0; - rect.width = pDraw->width; - rect.height = pDraw->height; - DoChangeGC(pGC, GCForeground, &bg, 0); - ValidateGC(pDraw, pGC); - (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect); - DoChangeGC(pGC, GCForeground, &fg, 0); - ValidateGC(pDraw, pGC); -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.X.original deleted file mode 100644 index 9a0bd06b5..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.X.original +++ /dev/null @@ -1,905 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/mi/miexpose.c,v 1.6 2005/07/03 08:53:51 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/mi/miexpose.c,v 3.9tsi Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/* $Xorg: miexpose.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#define NEED_EVENTS -#include -#include - -#include "misc.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmap.h" -#include "input.h" - -#include "dixstruct.h" -#include "mi.h" -#include - -#include "globals.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -/* - machine-independent graphics exposure code. any device that uses -the region package can call this. -*/ - -#ifndef RECTLIMIT -#define RECTLIMIT 25 /* pick a number, any number > 8 */ -#endif - -/* miHandleExposures - generate a region for exposures for areas that were copied from obscured or -non-existent areas to non-obscured areas of the destination. Paint the -background for the region, if the destination is a window. - -NOTE: - this should generally be called, even if graphicsExposures is false, -because this is where bits get recovered from backing store. - -NOTE: - added argument 'plane' is used to indicate how exposures from backing -store should be accomplished. If plane is 0 (i.e. no bit plane), CopyArea -should be used, else a CopyPlane of the indicated plane will be used. The -exposing is done by the backing store's GraphicsExpose function, of course. - -*/ - -RegionPtr -miHandleExposures(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, plane) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; - GCPtr pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; - unsigned long plane; -{ - register ScreenPtr pscr; - RegionPtr prgnSrcClip; /* drawable-relative source clip */ - RegionRec rgnSrcRec; - RegionPtr prgnDstClip; /* drawable-relative dest clip */ - RegionRec rgnDstRec; - BoxRec srcBox; /* unclipped source */ - RegionRec rgnExposed; /* exposed region, calculated source- - relative, made dst relative to - intersect with visible parts of - dest and send events to client, - and then screen relative to paint - the window background - */ - WindowPtr pSrcWin; - BoxRec expBox; - Bool extents; - - /* This prevents warning about pscr not being used. */ - pGC->pScreen = pscr = pGC->pScreen; - - /* avoid work if we can */ - if (!pGC->graphicsExposures && - (pDstDrawable->type == DRAWABLE_PIXMAP) && - ((pSrcDrawable->type == DRAWABLE_PIXMAP) || - (((WindowPtr)pSrcDrawable)->backStorage == NULL))) - return NULL; - - srcBox.x1 = srcx; - srcBox.y1 = srcy; - srcBox.x2 = srcx+width; - srcBox.y2 = srcy+height; - - if (pSrcDrawable->type != DRAWABLE_PIXMAP) - { - BoxRec TsrcBox; - - TsrcBox.x1 = srcx + pSrcDrawable->x; - TsrcBox.y1 = srcy + pSrcDrawable->y; - TsrcBox.x2 = TsrcBox.x1 + width; - TsrcBox.y2 = TsrcBox.y1 + height; - pSrcWin = (WindowPtr) pSrcDrawable; - if (pGC->subWindowMode == IncludeInferiors) - { - prgnSrcClip = NotClippedByChildren (pSrcWin); - if ((RECT_IN_REGION(pscr, prgnSrcClip, &TsrcBox)) == rgnIN) - { - REGION_DESTROY(pscr, prgnSrcClip); - return NULL; - } - } - else - { - if ((RECT_IN_REGION(pscr, &pSrcWin->clipList, &TsrcBox)) == rgnIN) - return NULL; - prgnSrcClip = &rgnSrcRec; - REGION_NULL(pscr, prgnSrcClip); - REGION_COPY(pscr, prgnSrcClip, &pSrcWin->clipList); - } - REGION_TRANSLATE(pscr, prgnSrcClip, - -pSrcDrawable->x, -pSrcDrawable->y); - } - else - { - BoxRec box; - - if ((srcBox.x1 >= 0) && (srcBox.y1 >= 0) && - (srcBox.x2 <= pSrcDrawable->width) && - (srcBox.y2 <= pSrcDrawable->height)) - return NULL; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pSrcDrawable->width; - box.y2 = pSrcDrawable->height; - prgnSrcClip = &rgnSrcRec; - REGION_INIT(pscr, prgnSrcClip, &box, 1); - pSrcWin = (WindowPtr)NULL; - } - - if (pDstDrawable == pSrcDrawable) - { - prgnDstClip = prgnSrcClip; - } - else if (pDstDrawable->type != DRAWABLE_PIXMAP) - { - if (pGC->subWindowMode == IncludeInferiors) - { - prgnDstClip = NotClippedByChildren((WindowPtr)pDstDrawable); - } - else - { - prgnDstClip = &rgnDstRec; - REGION_NULL(pscr, prgnDstClip); - REGION_COPY(pscr, prgnDstClip, - &((WindowPtr)pDstDrawable)->clipList); - } - REGION_TRANSLATE(pscr, prgnDstClip, - -pDstDrawable->x, -pDstDrawable->y); - } - else - { - BoxRec box; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pDstDrawable->width; - box.y2 = pDstDrawable->height; - prgnDstClip = &rgnDstRec; - REGION_INIT(pscr, prgnDstClip, &box, 1); - } - - /* drawable-relative source region */ - REGION_INIT(pscr, &rgnExposed, &srcBox, 1); - - /* now get the hidden parts of the source box*/ - REGION_SUBTRACT(pscr, &rgnExposed, &rgnExposed, prgnSrcClip); - - if (pSrcWin && pSrcWin->backStorage) - { - /* - * Copy any areas from the source backing store. Modifies - * rgnExposed. - */ - (* pSrcWin->drawable.pScreen->ExposeCopy) ((WindowPtr)pSrcDrawable, - pDstDrawable, - pGC, - &rgnExposed, - srcx, srcy, - dstx, dsty, - plane); - } - - /* move them over the destination */ - REGION_TRANSLATE(pscr, &rgnExposed, dstx-srcx, dsty-srcy); - - /* intersect with visible areas of dest */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip); - - /* - * If we have LOTS of rectangles, we decide to take the extents - * and force an exposure on that. This should require much less - * work overall, on both client and server. This is cheating, but - * isn't prohibited by the protocol ("spontaneous combustion" :-) - * for windows. - */ - extents = pGC->graphicsExposures && - (REGION_NUM_RECTS(&rgnExposed) > RECTLIMIT) && - (pDstDrawable->type != DRAWABLE_PIXMAP); -#ifdef SHAPE - if (pSrcWin) - { - RegionPtr region; - if (!(region = wClipShape (pSrcWin))) - region = wBoundingShape (pSrcWin); - /* - * If you try to CopyArea the extents of a shaped window, compacting the - * exposed region will undo all our work! - */ - if (extents && pSrcWin && region && - (RECT_IN_REGION(pscr, region, &srcBox) != rgnIN)) - extents = FALSE; - } -#endif - if (extents) - { - WindowPtr pWin = (WindowPtr)pDstDrawable; - - expBox = *REGION_EXTENTS(pscr, &rgnExposed); - REGION_RESET(pscr, &rgnExposed, &expBox); - /* need to clear out new areas of backing store */ - if (pWin->backStorage) - (void) (* pWin->drawable.pScreen->ClearBackingStore)( - pWin, - expBox.x1, - expBox.y1, - expBox.x2 - expBox.x1, - expBox.y2 - expBox.y1, - FALSE); - } - if ((pDstDrawable->type != DRAWABLE_PIXMAP) && - (((WindowPtr)pDstDrawable)->backgroundState != None)) - { - WindowPtr pWin = (WindowPtr)pDstDrawable; - - /* make the exposed area screen-relative */ - REGION_TRANSLATE(pscr, &rgnExposed, - pDstDrawable->x, pDstDrawable->y); - - if (extents) - { - /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList); - } - (*pWin->drawable.pScreen->PaintWindowBackground)( - (WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); - - if (extents) - { - REGION_RESET(pscr, &rgnExposed, &expBox); - } - else - REGION_TRANSLATE(pscr, &rgnExposed, - -pDstDrawable->x, -pDstDrawable->y); - } - if (prgnDstClip == &rgnDstRec) - { - REGION_UNINIT(pscr, prgnDstClip); - } - else if (prgnDstClip != prgnSrcClip) - { - REGION_DESTROY(pscr, prgnDstClip); - } - - if (prgnSrcClip == &rgnSrcRec) - { - REGION_UNINIT(pscr, prgnSrcClip); - } - else - { - REGION_DESTROY(pscr, prgnSrcClip); - } - - if (pGC->graphicsExposures) - { - /* don't look */ - RegionPtr exposed = REGION_CREATE(pscr, NullBox, 0); - *exposed = rgnExposed; - return exposed; - } - else - { - REGION_UNINIT(pscr, &rgnExposed); - return NULL; - } -} - -/* send GraphicsExpose events, or a NoExpose event, based on the region */ - -void -miSendGraphicsExpose (client, pRgn, drawable, major, minor) - ClientPtr client; - RegionPtr pRgn; - XID drawable; - int major; - int minor; -{ - if (pRgn && !REGION_NIL(pRgn)) - { - xEvent *pEvent; - register xEvent *pe; - register BoxPtr pBox; - register int i; - int numRects; - - numRects = REGION_NUM_RECTS(pRgn); - pBox = REGION_RECTS(pRgn); - if(!(pEvent = (xEvent *)ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) - return; - pe = pEvent; - - for (i=1; i<=numRects; i++, pe++, pBox++) - { - pe->u.u.type = GraphicsExpose; - pe->u.graphicsExposure.drawable = drawable; - pe->u.graphicsExposure.x = pBox->x1; - pe->u.graphicsExposure.y = pBox->y1; - pe->u.graphicsExposure.width = pBox->x2 - pBox->x1; - pe->u.graphicsExposure.height = pBox->y2 - pBox->y1; - pe->u.graphicsExposure.count = numRects - i; - pe->u.graphicsExposure.majorEvent = major; - pe->u.graphicsExposure.minorEvent = minor; - } - TryClientEvents(client, pEvent, numRects, - (Mask)0, NoEventMask, NullGrab); - DEALLOCATE_LOCAL(pEvent); - } - else - { - xEvent event; - event.u.u.type = NoExpose; - event.u.noExposure.drawable = drawable; - event.u.noExposure.majorEvent = major; - event.u.noExposure.minorEvent = minor; - TryClientEvents(client, &event, 1, - (Mask)0, NoEventMask, NullGrab); - } -} - - -void -miSendExposures(pWin, pRgn, dx, dy) - WindowPtr pWin; - RegionPtr pRgn; - register int dx, dy; -{ - register BoxPtr pBox; - int numRects; - register xEvent *pEvent, *pe; - register int i; - - pBox = REGION_RECTS(pRgn); - numRects = REGION_NUM_RECTS(pRgn); - if(!(pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) - return; - - for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++) - { - pe->u.u.type = Expose; - pe->u.expose.window = pWin->drawable.id; - pe->u.expose.x = pBox->x1 - dx; - pe->u.expose.y = pBox->y1 - dy; - pe->u.expose.width = pBox->x2 - pBox->x1; - pe->u.expose.height = pBox->y2 - pBox->y1; - pe->u.expose.count = i; - } - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int scrnum = pWin->drawable.pScreen->myNum; - int x = 0, y = 0; - XID realWin = 0; - - if(!pWin->parent) { - x = panoramiXdataPtr[scrnum].x; - y = panoramiXdataPtr[scrnum].y; - pWin = WindowTable[0]; - realWin = pWin->drawable.id; - } else if (scrnum) { - PanoramiXRes *win; - win = PanoramiXFindIDByScrnum(XRT_WINDOW, - pWin->drawable.id, scrnum); - if(!win) { - DEALLOCATE_LOCAL(pEvent); - return; - } - realWin = win->info[0].id; - pWin = LookupIDByType(realWin, RT_WINDOW); - } - if(x || y || scrnum) - for (i = 0; i < numRects; i++) { - pEvent[i].u.expose.window = realWin; - pEvent[i].u.expose.x += x; - pEvent[i].u.expose.y += y; - } - } -#endif - - DeliverEvents(pWin, pEvent, numRects, NullWindow); - - DEALLOCATE_LOCAL(pEvent); -} - -void -miWindowExposures(pWin, prgn, other_exposed) - WindowPtr pWin; - register RegionPtr prgn, other_exposed; -{ - RegionPtr exposures = prgn; - if (pWin->backStorage && prgn) - /* - * in some cases, backing store will cause a different - * region to be exposed than needs to be repainted - * (like when a window is mapped). RestoreAreas is - * allowed to return a region other than prgn, - * in which case this routine will free the resultant - * region. If exposures is null, then no events will - * be sent to the client; if prgn is empty - * no areas will be repainted. - */ - exposures = (*pWin->drawable.pScreen->RestoreAreas)(pWin, prgn); - if ((prgn && !REGION_NIL(prgn)) || - (exposures && !REGION_NIL(exposures)) || other_exposed) - { - RegionRec expRec; - int clientInterested; - - /* - * Restore from backing-store FIRST. - */ - clientInterested = (pWin->eventMask|wOtherEventMasks(pWin)) & ExposureMask; - if (other_exposed) - { - if (exposures) - { - REGION_UNION(pWin->drawable.pScreen, other_exposed, - exposures, - other_exposed); - if (exposures != prgn) - REGION_DESTROY(pWin->drawable.pScreen, exposures); - } - exposures = other_exposed; - } - if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT)) - { - /* - * If we have LOTS of rectangles, we decide to take the extents - * and force an exposure on that. This should require much less - * work overall, on both client and server. This is cheating, but - * isn't prohibited by the protocol ("spontaneous combustion" :-). - */ - BoxRec box; - - box = *REGION_EXTENTS( pWin->drawable.pScreen, exposures); - if (exposures == prgn) { - exposures = &expRec; - REGION_INIT( pWin->drawable.pScreen, exposures, &box, 1); - REGION_RESET( pWin->drawable.pScreen, prgn, &box); - } else { - REGION_RESET( pWin->drawable.pScreen, exposures, &box); - REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures); - } - /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList); - /* need to clear out new areas of backing store, too */ - if (pWin->backStorage) - (void) (* pWin->drawable.pScreen->ClearBackingStore)( - pWin, - box.x1 - pWin->drawable.x, - box.y1 - pWin->drawable.y, - box.x2 - box.x1, - box.y2 - box.y1, - FALSE); - } - if (prgn && !REGION_NIL(prgn)) - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !REGION_NIL(exposures)) - miSendExposures(pWin, exposures, - pWin->drawable.x, pWin->drawable.y); - if (exposures == &expRec) - { - REGION_UNINIT( pWin->drawable.pScreen, exposures); - } - else if (exposures && exposures != prgn && exposures != other_exposed) - REGION_DESTROY( pWin->drawable.pScreen, exposures); - if (prgn) - REGION_EMPTY( pWin->drawable.pScreen, prgn); - } - else if (exposures && exposures != prgn) - REGION_DESTROY( pWin->drawable.pScreen, exposures); -} - - -/* - this code is highly unlikely. it is not haile selassie. - - there is some hair here. we can't just use the window's -clip region as it is, because if we are painting the border, -the border is not in the client area and so we will be excluded -when we validate the GC, and if we are painting a parent-relative -background, the area we want to paint is in some other window. -since we trust the code calling us to tell us to paint only areas -that are really ours, we will temporarily give the window a -clipList the size of the whole screen and an origin at (0,0). -this more or less assumes that ddX code will do translation -based on the window's absolute position, and that ValidateGC will -look at clipList, and that no other fields from the -window will be used. it's not possible to just draw -in the root because it may be a different depth. - -to get the tile to align correctly we set the GC's tile origin to -be the (x,y) of the window's upper left corner, after which we -get the right bits when drawing into the root. - -because the clip_mask is being set to None, we may call DoChangeGC with -fPointer set true, thus we no longer need to install the background or -border tile in the resource table. -*/ - -static RESTYPE ResType = 0; -static int numGCs = 0; -static GCPtr screenContext[MAXSCREENS]; - -/*ARGSUSED*/ -static int -tossGC ( - pointer value, - XID id) -{ - GCPtr pGC = (GCPtr)value; - screenContext[pGC->pScreen->myNum] = (GCPtr)NULL; - FreeGC (pGC, id); - numGCs--; - if (!numGCs) - ResType = 0; - - return 0; -} - - -void -miPaintWindow(pWin, prgn, what) -register WindowPtr pWin; -RegionPtr prgn; -int what; -{ - int status; - - Bool usingScratchGC = FALSE; - WindowPtr pRoot; - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - ChangeGCVal gcval[7]; - ChangeGCVal newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - - gcmask = 0; - - if (what == PW_BACKGROUND) - { - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground)(pWin->parent, prgn, what); - return; - case BackgroundPixel: - newValues[FOREGROUND].val = pWin->background.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE].ptr = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - break; - } - } - else - { - if (pWin->borderIsPixel) - { - newValues[FOREGROUND].val = pWin->border.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE].ptr = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * - sizeof(xRectangle)); - if (!prect) - return; - - newValues[FUNCTION].val = GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - pRoot = WindowTable[i]; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - } - - if ((pWin->drawable.depth != pRoot->drawable.depth) || - (pWin->drawable.bitsPerPixel != pRoot->drawable.bitsPerPixel)) - { - usingScratchGC = TRUE; - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if (!pGC) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if (what == PW_BORDER) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - } - else - { - newValues[ABSX].val = 0; - newValues[ABSY].val = 0; - } - } else { - /* - * draw the background to the root window - */ - if (screenContext[i] == (GCPtr)NULL) - { - if (!ResType && !(ResType = CreateNewResourceType(tossGC))) - return; - screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0, - (XID *)NULL, &status); - if (!screenContext[i]) - return; - numGCs++; - if (!AddResource(FakeClientID(0), ResType, - (pointer)screenContext[i])) - return; - } - pGC = screenContext[i]; - newValues[SUBWINDOW].val = IncludeInferiors; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - gcmask |= GCSubwindowMode; - pWin = pRoot; - } - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack); - - mask = gcmask; - gcmask = 0; - i = 0; - while (mask) { - index = lowbit (mask); - mask &= ~index; - switch (index) { - case GCFunction: - if (pGC->alu != newValues[FUNCTION].val) { - gcmask |= index; - gcval[i++].val = newValues[FUNCTION].val; - } - break; - case GCTileStipXOrigin: - if ( pGC->patOrg.x != newValues[ABSX].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSX].val; - } - break; - case GCTileStipYOrigin: - if ( pGC->patOrg.y != newValues[ABSY].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSY].val; - } - break; - case GCClipMask: - if ( pGC->clientClipType != CT_NONE) { - gcmask |= index; - gcval[i++].val = CT_NONE; - } - break; - case GCSubwindowMode: - if ( pGC->subWindowMode != newValues[SUBWINDOW].val) { - gcmask |= index; - gcval[i++].val = newValues[SUBWINDOW].val; - } - break; - case GCTile: - if (pGC->tileIsPixel || pGC->tile.pixmap != newValues[TILE].ptr) - { - gcmask |= index; - gcval[i++].ptr = newValues[TILE].ptr; - } - break; - case GCFillStyle: - if ( pGC->fillStyle != newValues[FILLSTYLE].val) { - gcmask |= index; - gcval[i++].val = newValues[FILLSTYLE].val; - } - break; - case GCForeground: - if ( pGC->fgPixel != newValues[FOREGROUND].val) { - gcmask |= index; - gcval[i++].val = newValues[FOREGROUND].val; - } - break; - } - } - - if (gcmask) - dixChangeGC(NullClient, pGC, gcmask, NULL, gcval); - - if (pWin->drawable.serialNumber != pGC->serialNumber) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(prgn); - pbox = REGION_RECTS(prgn); - for (i= numRects; --i >= 0; pbox++, prect++) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - - if (pWin->backStorage) - (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing); - - if (usingScratchGC) - { - if (what == PW_BORDER) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); - } -} - - -/* MICLEARDRAWABLE -- sets the entire drawable to the background color of - * the GC. Useful when we have a scratch drawable and need to initialize - * it. */ -void -miClearDrawable(pDraw, pGC) - DrawablePtr pDraw; - GCPtr pGC; -{ - XID fg = pGC->fgPixel; - XID bg = pGC->bgPixel; - xRectangle rect; - - rect.x = 0; - rect.y = 0; - rect.width = pDraw->width; - rect.height = pDraw->height; - DoChangeGC(pGC, GCForeground, &bg, 0); - ValidateGC(pDraw, pGC); - (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect); - DoChangeGC(pGC, GCForeground, &fg, 0); - ValidateGC(pDraw, pGC); -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original deleted file mode 100644 index 5f32334ae..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original +++ /dev/null @@ -1,318 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/miglyph.c,v 1.4 2000/11/20 07:13:13 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "mi.h" -#include "picturestr.h" -#include "mipict.h" - -#ifdef NXAGENT_SERVER - -#include "Render.h" - -#endif - -void -miGlyphExtents (int nlist, - GlyphListPtr list, - GlyphPtr *glyphs, - BoxPtr extents) -{ - int x1, x2, y1, y2; - int n; - GlyphPtr glyph; - int x, y; - - x = 0; - y = 0; - extents->x1 = MAXSHORT; - extents->x2 = MINSHORT; - extents->y1 = MAXSHORT; - extents->y2 = MINSHORT; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - list++; - while (n--) - { - glyph = *glyphs++; - x1 = x - glyph->info.x; - if (x1 < MINSHORT) - x1 = MINSHORT; - y1 = y - glyph->info.y; - if (y1 < MINSHORT) - y1 = MINSHORT; - x2 = x1 + glyph->info.width; - if (x2 > MAXSHORT) - x2 = MAXSHORT; - y2 = y1 + glyph->info.height; - if (y2 > MAXSHORT) - y2 = MAXSHORT; - if (x1 < extents->x1) - extents->x1 = x1; - if (x2 > extents->x2) - extents->x2 = x2; - if (y1 < extents->y1) - extents->y1 = y1; - if (y2 > extents->y2) - extents->y2 = y2; - x += glyph->info.xOff; - y += glyph->info.yOff; - } - } -} - -#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) - -void -miGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) -{ - PixmapPtr pPixmap = 0; - PicturePtr pPicture; - PixmapPtr pMaskPixmap = 0; - PicturePtr pMask; - ScreenPtr pScreen = pDst->pDrawable->pScreen; - int width = 0, height = 0; - int x, y; - int xDst = list->xOff, yDst = list->yOff; - int n; - GlyphPtr glyph; - int error; - BoxRec extents; - CARD32 component_alpha; - - #ifdef NXAGENT_SERVER - - /* - * Get rid of the warning. - */ - - extents.x1 = 0; - extents.y1 = 0; - - #endif - - if (maskFormat) - { - GCPtr pGC; - xRectangle rect; - - #ifdef NXAGENT_SERVER - - if (nxagentGlyphsExtents != NullBox) - { - memcpy(&extents, nxagentGlyphsExtents, sizeof(BoxRec)); - } - else - { - nxagentGlyphsExtents = (BoxPtr) xalloc(sizeof(BoxRec)); - - miGlyphExtents (nlist, list, glyphs, &extents); - - memcpy(nxagentGlyphsExtents, &extents, sizeof(BoxRec)); - } - - #else - - miGlyphExtents (nlist, list, glyphs, &extents); - - #endif - - if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) - return; - width = extents.x2 - extents.x1; - height = extents.y2 - extents.y1; - pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, maskFormat->depth); - - if (!pMaskPixmap) - return; - - component_alpha = NeedsComponent(maskFormat->format); - pMask = CreatePicture (0, &pMaskPixmap->drawable, - maskFormat, CPComponentAlpha, &component_alpha, - serverClient, &error); - - if (!pMask) - { - (*pScreen->DestroyPixmap) (pMaskPixmap); - return; - } - pGC = GetScratchGC (pMaskPixmap->drawable.depth, pScreen); - ValidateGC (&pMaskPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - x = -extents.x1; - y = -extents.y1; - } - else - { - pMask = pDst; - x = 0; - y = 0; - } - pPicture = 0; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - - while (n--) - { - glyph = *glyphs++; - if (!pPicture) - { - pPixmap = GetScratchPixmapHeader (pScreen, glyph->info.width, glyph->info.height, - list->format->depth, - list->format->depth, - 0, (pointer) (glyph + 1)); - if (!pPixmap) - return; - component_alpha = NeedsComponent(list->format->format); - pPicture = CreatePicture (0, &pPixmap->drawable, list->format, - CPComponentAlpha, &component_alpha, - serverClient, &error); - if (!pPicture) - { - FreeScratchPixmapHeader (pPixmap); - return; - } - } - (*pScreen->ModifyPixmapHeader) (pPixmap, - glyph->info.width, glyph->info.height, - 0, 0, -1, (pointer) (glyph + 1)); - - #ifdef NXAGENT_SERVER - - /* - * The following line fixes a problem with glyphs that appeared - * as clipped. It was a side effect due the validate function - * "ValidatePicture" that makes a check on the Drawable serial - * number instead of the picture serial number, failing thus - * the clip mask update. - */ - - pPicture->pDrawable->serialNumber = NEXT_SERIAL_NUMBER; - - #endif - - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - if (maskFormat) - { - CompositePicture (PictOpAdd, - pPicture, - None, - pMask, - 0, 0, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - else - { - CompositePicture (op, - pSrc, - pPicture, - pDst, - xSrc + (x - glyph->info.x) - xDst, - ySrc + (y - glyph->info.y) - yDst, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - x += glyph->info.xOff; - y += glyph->info.yOff; - } - - list++; - if (pPicture) - { - FreeScratchPixmapHeader (pPixmap); - FreePicture ((pointer) pPicture, 0); - pPicture = 0; - pPixmap = 0; - } - } - if (maskFormat) - { - x = extents.x1; - y = extents.y1; - CompositePicture (op, - pSrc, - pMask, - pDst, - xSrc + x - xDst, - ySrc + y - yDst, - 0, 0, - x, y, - width, height); - - FreePicture ((pointer) pMask, (XID) 0); - (*pScreen->DestroyPixmap) (pMaskPixmap); - } - -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.X.original deleted file mode 100644 index 237ec13a4..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.X.original +++ /dev/null @@ -1,243 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/miglyph.c,v 1.4 2000/11/20 07:13:13 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "mi.h" -#include "picturestr.h" -#include "mipict.h" - -void -miGlyphExtents (int nlist, - GlyphListPtr list, - GlyphPtr *glyphs, - BoxPtr extents) -{ - int x1, x2, y1, y2; - int n; - GlyphPtr glyph; - int x, y; - - x = 0; - y = 0; - extents->x1 = MAXSHORT; - extents->x2 = MINSHORT; - extents->y1 = MAXSHORT; - extents->y2 = MINSHORT; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - list++; - while (n--) - { - glyph = *glyphs++; - x1 = x - glyph->info.x; - if (x1 < MINSHORT) - x1 = MINSHORT; - y1 = y - glyph->info.y; - if (y1 < MINSHORT) - y1 = MINSHORT; - x2 = x1 + glyph->info.width; - if (x2 > MAXSHORT) - x2 = MAXSHORT; - y2 = y1 + glyph->info.height; - if (y2 > MAXSHORT) - y2 = MAXSHORT; - if (x1 < extents->x1) - extents->x1 = x1; - if (x2 > extents->x2) - extents->x2 = x2; - if (y1 < extents->y1) - extents->y1 = y1; - if (y2 > extents->y2) - extents->y2 = y2; - x += glyph->info.xOff; - y += glyph->info.yOff; - } - } -} - -#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) - -void -miGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) -{ - PixmapPtr pPixmap = 0; - PicturePtr pPicture; - PixmapPtr pMaskPixmap = 0; - PicturePtr pMask; - ScreenPtr pScreen = pDst->pDrawable->pScreen; - int width = 0, height = 0; - int x, y; - int xDst = list->xOff, yDst = list->yOff; - int n; - GlyphPtr glyph; - int error; - BoxRec extents; - CARD32 component_alpha; - - if (maskFormat) - { - GCPtr pGC; - xRectangle rect; - - miGlyphExtents (nlist, list, glyphs, &extents); - - if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) - return; - width = extents.x2 - extents.x1; - height = extents.y2 - extents.y1; - pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, maskFormat->depth); - if (!pMaskPixmap) - return; - component_alpha = NeedsComponent(maskFormat->format); - pMask = CreatePicture (0, &pMaskPixmap->drawable, - maskFormat, CPComponentAlpha, &component_alpha, - serverClient, &error); - if (!pMask) - { - (*pScreen->DestroyPixmap) (pMaskPixmap); - return; - } - pGC = GetScratchGC (pMaskPixmap->drawable.depth, pScreen); - ValidateGC (&pMaskPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - x = -extents.x1; - y = -extents.y1; - } - else - { - pMask = pDst; - x = 0; - y = 0; - } - pPicture = 0; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - while (n--) - { - glyph = *glyphs++; - if (!pPicture) - { - pPixmap = GetScratchPixmapHeader (pScreen, glyph->info.width, glyph->info.height, - list->format->depth, - list->format->depth, - 0, (pointer) (glyph + 1)); - if (!pPixmap) - return; - component_alpha = NeedsComponent(list->format->format); - pPicture = CreatePicture (0, &pPixmap->drawable, list->format, - CPComponentAlpha, &component_alpha, - serverClient, &error); - if (!pPicture) - { - FreeScratchPixmapHeader (pPixmap); - return; - } - } - (*pScreen->ModifyPixmapHeader) (pPixmap, - glyph->info.width, glyph->info.height, - 0, 0, -1, (pointer) (glyph + 1)); - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - if (maskFormat) - { - CompositePicture (PictOpAdd, - pPicture, - None, - pMask, - 0, 0, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - else - { - CompositePicture (op, - pSrc, - pPicture, - pDst, - xSrc + (x - glyph->info.x) - xDst, - ySrc + (y - glyph->info.y) - yDst, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - x += glyph->info.xOff; - y += glyph->info.yOff; - } - list++; - if (pPicture) - { - FreeScratchPixmapHeader (pPixmap); - FreePicture ((pointer) pPicture, 0); - pPicture = 0; - pPixmap = 0; - } - } - if (maskFormat) - { - x = extents.x1; - y = extents.y1; - CompositePicture (op, - pSrc, - pMask, - pDst, - xSrc + x - xDst, - ySrc + y - yDst, - 0, 0, - x, y, - width, height); - FreePicture ((pointer) pMask, (XID) 0); - (*pScreen->DestroyPixmap) (pMaskPixmap); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original deleted file mode 100644 index f418654b4..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original +++ /dev/null @@ -1,233 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.8 2002/09/03 19:28:28 keithp Exp $ - * - * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "servermd.h" -#include "mi.h" -#include "picturestr.h" -#include "mipict.h" - -#ifdef NXAGENT_SERVER - -#include "Render.h" - -#endif - -PicturePtr -miCreateAlphaPicture (ScreenPtr pScreen, - PicturePtr pDst, - PictFormatPtr pPictFormat, - CARD16 width, - CARD16 height) -{ - PixmapPtr pPixmap; - PicturePtr pPicture; - GCPtr pGC; - int error; - xRectangle rect; - - if (width > 32767 || height > 32767) - return 0; - - if (!pPictFormat) - { - if (pDst->polyEdge == PolyEdgeSharp) - pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - if (!pPictFormat) - return 0; - } - - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pPictFormat->depth); - if (!pPixmap) - return 0; - pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); - if (!pGC) - { - (*pScreen->DestroyPixmap) (pPixmap); - return 0; - } - ValidateGC (&pPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat, - 0, 0, serverClient, &error); - (*pScreen->DestroyPixmap) (pPixmap); - return pPicture; -} - -static xFixed -miLineFixedX (xLineFixed *l, xFixed y, Bool ceil) -{ - xFixed dx = l->p2.x - l->p1.x; - xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx; - xFixed dy = l->p2.y - l->p1.y; - if (ceil) - ex += (dy - 1); - return l->p1.x + (xFixed) (ex / dy); -} - -void -miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box) -{ - box->y1 = MAXSHORT; - box->y2 = MINSHORT; - box->x1 = MAXSHORT; - box->x2 = MINSHORT; - for (; ntrap; ntrap--, traps++) - { - INT16 x1, y1, x2, y2; - - if (!xTrapezoidValid(traps)) - continue; - y1 = xFixedToInt (traps->top); - if (y1 < box->y1) - box->y1 = y1; - - y2 = xFixedToInt (xFixedCeil (traps->bottom)); - if (y2 > box->y2) - box->y2 = y2; - - x1 = xFixedToInt (min (miLineFixedX (&traps->left, traps->top, FALSE), - miLineFixedX (&traps->left, traps->bottom, FALSE))); - if (x1 < box->x1) - box->x1 = x1; - - x2 = xFixedToInt (xFixedCeil (max (miLineFixedX (&traps->right, traps->top, TRUE), - miLineFixedX (&traps->right, traps->bottom, TRUE)))); - if (x2 > box->x2) - box->x2 = x2; - } -} - -void -miTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - /* - * Check for solid alpha add - */ - if (op == PictOpAdd && miIsSolidAlpha (pSrc)) - { - for (; ntrap; ntrap--, traps++) - (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0); - } - else if (maskFormat) - { - PicturePtr pPicture; - BoxRec bounds; - INT16 xDst, yDst; - INT16 xRel, yRel; - - xDst = traps[0].left.p1.x >> 16; - yDst = traps[0].left.p1.y >> 16; - - #ifdef NXAGENT_SERVER - - if (nxagentTrapezoidExtents != NullBox) - { - memcpy(&bounds, nxagentTrapezoidExtents, sizeof(BoxRec)); - } - else - { - nxagentTrapezoidExtents = (BoxPtr) xalloc(sizeof(BoxRec)); - - miTrapezoidBounds (ntrap, traps, &bounds); - - memcpy(nxagentTrapezoidExtents, &bounds, sizeof(BoxRec)); - } - - #else - - miTrapezoidBounds (ntrap, traps, &bounds); - - #endif - - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - return; - pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - if (!pPicture) - return; - for (; ntrap; ntrap--, traps++) - (*ps->RasterizeTrapezoid) (pPicture, traps, - -bounds.x1, -bounds.y1); - xRel = bounds.x1 + xSrc - xDst; - yRel = bounds.y1 + ySrc - yDst; - CompositePicture (op, pSrc, pPicture, pDst, - xRel, yRel, 0, 0, bounds.x1, bounds.y1, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); - } - else - { - if (pDst->polyEdge == PolyEdgeSharp) - maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - for (; ntrap; ntrap--, traps++) - miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.X.original deleted file mode 100644 index be1712420..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.X.original +++ /dev/null @@ -1,190 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.8 2002/09/03 19:28:28 keithp Exp $ - * - * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "servermd.h" -#include "mi.h" -#include "picturestr.h" -#include "mipict.h" - -PicturePtr -miCreateAlphaPicture (ScreenPtr pScreen, - PicturePtr pDst, - PictFormatPtr pPictFormat, - CARD16 width, - CARD16 height) -{ - PixmapPtr pPixmap; - PicturePtr pPicture; - GCPtr pGC; - int error; - xRectangle rect; - - if (width > 32767 || height > 32767) - return 0; - - if (!pPictFormat) - { - if (pDst->polyEdge == PolyEdgeSharp) - pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - if (!pPictFormat) - return 0; - } - - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pPictFormat->depth); - if (!pPixmap) - return 0; - pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); - if (!pGC) - { - (*pScreen->DestroyPixmap) (pPixmap); - return 0; - } - ValidateGC (&pPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat, - 0, 0, serverClient, &error); - (*pScreen->DestroyPixmap) (pPixmap); - return pPicture; -} - -static xFixed -miLineFixedX (xLineFixed *l, xFixed y, Bool ceil) -{ - xFixed dx = l->p2.x - l->p1.x; - xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx; - xFixed dy = l->p2.y - l->p1.y; - if (ceil) - ex += (dy - 1); - return l->p1.x + (xFixed) (ex / dy); -} - -void -miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box) -{ - box->y1 = MAXSHORT; - box->y2 = MINSHORT; - box->x1 = MAXSHORT; - box->x2 = MINSHORT; - for (; ntrap; ntrap--, traps++) - { - INT16 x1, y1, x2, y2; - - if (!xTrapezoidValid(traps)) - continue; - y1 = xFixedToInt (traps->top); - if (y1 < box->y1) - box->y1 = y1; - - y2 = xFixedToInt (xFixedCeil (traps->bottom)); - if (y2 > box->y2) - box->y2 = y2; - - x1 = xFixedToInt (min (miLineFixedX (&traps->left, traps->top, FALSE), - miLineFixedX (&traps->left, traps->bottom, FALSE))); - if (x1 < box->x1) - box->x1 = x1; - - x2 = xFixedToInt (xFixedCeil (max (miLineFixedX (&traps->right, traps->top, TRUE), - miLineFixedX (&traps->right, traps->bottom, TRUE)))); - if (x2 > box->x2) - box->x2 = x2; - } -} - -void -miTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - /* - * Check for solid alpha add - */ - if (op == PictOpAdd && miIsSolidAlpha (pSrc)) - { - for (; ntrap; ntrap--, traps++) - (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0); - } - else if (maskFormat) - { - PicturePtr pPicture; - BoxRec bounds; - INT16 xDst, yDst; - INT16 xRel, yRel; - - xDst = traps[0].left.p1.x >> 16; - yDst = traps[0].left.p1.y >> 16; - - miTrapezoidBounds (ntrap, traps, &bounds); - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - return; - pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - if (!pPicture) - return; - for (; ntrap; ntrap--, traps++) - (*ps->RasterizeTrapezoid) (pPicture, traps, - -bounds.x1, -bounds.y1); - xRel = bounds.x1 + xSrc - xDst; - yRel = bounds.y1 + ySrc - yDst; - CompositePicture (op, pSrc, pPicture, pDst, - xRel, yRel, 0, 0, bounds.x1, bounds.y1, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); - } - else - { - if (pDst->polyEdge == PolyEdgeSharp) - maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - for (; ntrap; ntrap--, traps++) - miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original deleted file mode 100644 index 190294979..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original +++ /dev/null @@ -1,1222 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/programs/Xserver/mi/miwindow.c,v 1.9tsi Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: miwindow.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "regionstr.h" -#include "region.h" -#include "mi.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "mivalidate.h" - -void -miClearToBackground(pWin, x, y, w, h, generateExposures) - WindowPtr pWin; - int x,y; - int w,h; - Bool generateExposures; -{ - BoxRec box; - RegionRec reg; - RegionPtr pBSReg = NullRegion; - ScreenPtr pScreen; - BoxPtr extents; - int x1, y1, x2, y2; - - /* compute everything using ints to avoid overflow */ - - x1 = pWin->drawable.x + x; - y1 = pWin->drawable.y + y; - if (w) - x2 = x1 + (int) w; - else - x2 = x1 + (int) pWin->drawable.width - (int) x; - if (h) - y2 = y1 + h; - else - y2 = y1 + (int) pWin->drawable.height - (int) y; - - extents = &pWin->clipList.extents; - - /* clip the resulting rectangle to the window clipList extents. This - * makes sure that the result will fit in a box, given that the - * screen is < 32768 on a side. - */ - - if (x1 < extents->x1) - x1 = extents->x1; - if (x2 > extents->x2) - x2 = extents->x2; - if (y1 < extents->y1) - y1 = extents->y1; - if (y2 > extents->y2) - y2 = extents->y2; - - if (x2 <= x1 || y2 <= y1) - { - x2 = x1 = 0; - y2 = y1 = 0; - } - - box.x1 = x1; - box.x2 = x2; - box.y1 = y1; - box.y2 = y2; - - pScreen = pWin->drawable.pScreen; - REGION_INIT(pScreen, ®, &box, 1); - if (pWin->backStorage) - { - /* - * If the window has backing-store on, call through the - * ClearToBackground vector to handle the special semantics - * (i.e. things backing store is to be cleared out and - * an Expose event is to be generated for those areas in backing - * store if generateExposures is TRUE). - */ - pBSReg = (* pScreen->ClearBackingStore)(pWin, x, y, w, h, - generateExposures); - } - - REGION_INTERSECT(pScreen, ®, ®, &pWin->clipList); - if (generateExposures) - (*pScreen->WindowExposures)(pWin, ®, pBSReg); - else if (pWin->backgroundState != None) - (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); - REGION_UNINIT(pScreen, ®); - if (pBSReg) - REGION_DESTROY(pScreen, pBSReg); -} - -/* - * For SaveUnders using backing-store. The idea is that when a window is mapped - * with saveUnder set TRUE, any windows it obscures will have its backing - * store turned on setting the DIXsaveUnder bit, - * The backing-store code must be written to allow for this - */ - -/*- - *----------------------------------------------------------------------- - * miCheckSubSaveUnder -- - * Check all the inferiors of a window for coverage by saveUnder - * windows. Called from ChangeSaveUnder and CheckSaveUnder. - * This code is very inefficient. - * - * Results: - * TRUE if any windows need to have backing-store removed. - * - * Side Effects: - * Windows may have backing-store turned on or off. - * - *----------------------------------------------------------------------- - */ -static Bool -miCheckSubSaveUnder( - register WindowPtr pParent, /* Parent to check */ - WindowPtr pFirst, /* first reconfigured window */ - RegionPtr pRegion) /* Initial area obscured by saveUnder */ -{ - register WindowPtr pChild; /* Current child */ - register ScreenPtr pScreen; /* Screen to use */ - RegionRec SubRegion; /* Area of children obscured */ - Bool res = FALSE; /* result */ - Bool subInited=FALSE;/* SubRegion initialized */ - - pScreen = pParent->drawable.pScreen; - if ( (pChild = pParent->firstChild) ) - { - /* - * build region above first changed window - */ - - for (; pChild != pFirst; pChild = pChild->nextSib) - if (pChild->viewable && pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); - - /* - * check region below and including first changed window - */ - - for (; pChild; pChild = pChild->nextSib) - { - if (pChild->viewable) - { - /* - * don't save under nephew/niece windows; - * use a separate region - */ - - if (pChild->firstChild) - { - if (!subInited) - { - REGION_NULL(pScreen, &SubRegion); - subInited = TRUE; - } - REGION_COPY(pScreen, &SubRegion, pRegion); - res |= miCheckSubSaveUnder(pChild, pChild->firstChild, - &SubRegion); - } - else - { - res |= miCheckSubSaveUnder(pChild, pChild->firstChild, - pRegion); - } - - if (pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); - } - } - - if (subInited) - REGION_UNINIT(pScreen, &SubRegion); - } - - /* - * Check the state of this window. DIX save unders are - * enabled for viewable windows with some client expressing - * exposure interest and which intersect the save under region - */ - - if (pParent->viewable && - ((pParent->eventMask | wOtherEventMasks(pParent)) & ExposureMask) && - REGION_NOTEMPTY(pScreen, &pParent->borderSize) && - RECT_IN_REGION(pScreen, pRegion, REGION_EXTENTS(pScreen, - &pParent->borderSize)) != rgnOUT) - { - if (!pParent->DIXsaveUnder) - { - pParent->DIXsaveUnder = TRUE; - (*pScreen->ChangeWindowAttributes) (pParent, CWBackingStore); - } - } - else - { - if (pParent->DIXsaveUnder) - { - res = TRUE; - pParent->DIXsaveUnder = FALSE; - } - } - return res; -} - - -/*- - *----------------------------------------------------------------------- - * miChangeSaveUnder -- - * Change the save-under state of a tree of windows. Called when - * a window with saveUnder TRUE is mapped/unmapped/reconfigured. - * - * Results: - * TRUE if any windows need to have backing-store removed (which - * means that PostChangeSaveUnder needs to be called later to - * finish the job). - * - * Side Effects: - * Windows may have backing-store turned on or off. - * - *----------------------------------------------------------------------- - */ -Bool -miChangeSaveUnder(pWin, first) - register WindowPtr pWin; - WindowPtr first; /* First window to check. - * Used when pWin was restacked */ -{ - RegionRec rgn; /* Area obscured by saveUnder windows */ - register ScreenPtr pScreen; - Bool res; - - if (!deltaSaveUndersViewable && !numSaveUndersViewable) - return FALSE; - numSaveUndersViewable += deltaSaveUndersViewable; - deltaSaveUndersViewable = 0; - pScreen = pWin->drawable.pScreen; - REGION_NULL(pScreen, &rgn); - res = miCheckSubSaveUnder (pWin->parent, - pWin->saveUnder ? first : pWin->nextSib, - &rgn); - REGION_UNINIT(pScreen, &rgn); - return res; -} - -/*- - *----------------------------------------------------------------------- - * miPostChangeSaveUnder -- - * Actually turn backing-store off for those windows that no longer - * need to have it on. - * - * Results: - * None. - * - * Side Effects: - * Backing-store and SAVE_UNDER_CHANGE_BIT are turned off for those - * windows affected. - * - *----------------------------------------------------------------------- - */ -void -miPostChangeSaveUnder(pWin, pFirst) - WindowPtr pWin; - WindowPtr pFirst; -{ - register WindowPtr pParent, pChild; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - - if (!(pParent = pWin->parent)) - return; - ChangeWindowAttributes = pParent->drawable.pScreen->ChangeWindowAttributes; - if (!pParent->DIXsaveUnder && - (pParent->backingStore == NotUseful) && pParent->backStorage) - (*ChangeWindowAttributes)(pParent, CWBackingStore); - if (!(pChild = pFirst)) - return; - while (1) - { - if (!pChild->DIXsaveUnder && - (pChild->backingStore == NotUseful) && pChild->backStorage) - (*ChangeWindowAttributes)(pChild, CWBackingStore); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib) - { - pChild = pChild->parent; - if (pChild == pParent) - return; - } - pChild = pChild->nextSib; - } -} - -void -miMarkWindow(pWin) - register WindowPtr pWin; -{ - register ValidatePtr val; - - if (pWin->valdata) - return; - val = (ValidatePtr)xnfalloc(sizeof(ValidateRec)); - val->before.oldAbsCorner.x = pWin->drawable.x; - val->before.oldAbsCorner.y = pWin->drawable.y; - val->before.borderVisible = NullRegion; - val->before.resized = FALSE; - pWin->valdata = val; -} - -Bool -miMarkOverlappedWindows(pWin, pFirst, ppLayerWin) - WindowPtr pWin; - WindowPtr pFirst; - WindowPtr *ppLayerWin; -{ - register BoxPtr box; - register WindowPtr pChild, pLast; - Bool anyMarked = FALSE; - MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow; - ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; - - /* single layered systems are easy */ - if (ppLayerWin) *ppLayerWin = pWin; - - if (pWin == pFirst) - { - /* Blindly mark pWin and all of its inferiors. This is a slight - * overkill if there are mapped windows that outside pWin's border, - * but it's better than wasting time on RectIn checks. - */ - pChild = pWin; - while (1) - { - if (pChild->viewable) - { - if (REGION_BROKEN (pScreen, &pChild->winSize)) - SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) - SetBorderSize (pChild); - (* MarkWindow)(pChild); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } - anyMarked = TRUE; - pFirst = pFirst->nextSib; - } - if ( (pChild = pFirst) ) - { - box = REGION_EXTENTS(pChild->drawable.pScreen, &pWin->borderSize); - pLast = pChild->parent->lastChild; - while (1) - { - if (pChild->viewable) - { - if (REGION_BROKEN (pScreen, &pChild->winSize)) - SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) - SetBorderSize (pChild); - if (RECT_IN_REGION(pScreen, &pChild->borderSize, box)) - { - (* MarkWindow)(pChild); - anyMarked = TRUE; - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - } - while (!pChild->nextSib && (pChild != pLast)) - pChild = pChild->parent; - if (pChild == pLast) - break; - pChild = pChild->nextSib; - } - } - if (anyMarked) - (* MarkWindow)(pWin->parent); - return anyMarked; -} - -/***** - * miHandleValidateExposures(pWin) - * starting at pWin, draw background in any windows that have exposure - * regions, translate the regions, restore any backing store, - * and then send any regions still exposed to the client - *****/ -void -miHandleValidateExposures(pWin) - WindowPtr pWin; -{ - register WindowPtr pChild; - register ValidatePtr val; - ScreenPtr pScreen; - WindowExposuresProcPtr WindowExposures; - - pScreen = pWin->drawable.pScreen; - - pChild = pWin; - WindowExposures = pChild->drawable.pScreen->WindowExposures; - while (1) - { - if ( (val = pChild->valdata) ) - { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) - (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, - &val->after.borderExposed, - PW_BORDER); - REGION_UNINIT(pScreen, &val->after.borderExposed); - (*WindowExposures)(pChild, &val->after.exposed, NullRegion); - REGION_UNINIT(pScreen, &val->after.exposed); - xfree(val); - pChild->valdata = (ValidatePtr)NULL; - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } -} - -void -miMoveWindow(pWin, x, y, pNextSib, kind) - register WindowPtr pWin; - int x,y; - WindowPtr pNextSib; - VTKind kind; -{ - WindowPtr pParent; - Bool WasViewable = (Bool)(pWin->viewable); - short bw; - RegionPtr oldRegion = NULL; - DDXPointRec oldpt; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - WindowPtr windowToValidate; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - /* if this is a root window, can't be moved */ - if (!(pParent = pWin->parent)) - return ; - pScreen = pWin->drawable.pScreen; - bw = wBorderWidth (pWin); - - oldpt.x = pWin->drawable.x; - oldpt.y = pWin->drawable.y; - if (WasViewable) - { - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->borderClip); - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); - } - pWin->origin.x = x + (int)bw; - pWin->origin.y = y + (int)bw; - x = pWin->drawable.x = pParent->drawable.x + x + (int)bw; - y = pWin->drawable.y = pParent->drawable.y + y + (int)bw; - - SetWinSize (pWin); - SetBorderSize (pWin); - - (*pScreen->PositionWindow)(pWin, x, y); - - windowToValidate = MoveWindowInStack(pWin, pNextSib); - - ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0); - - if (WasViewable) - { - if (pLayerWin == pWin) - anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, windowToValidate, (WindowPtr *)NULL); - else - anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, pLayerWin, (WindowPtr *)NULL); - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, windowToValidate); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, kind); - (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, oldRegion); - REGION_DESTROY(pScreen, oldRegion); - /* XXX need to retile border if ParentRelative origin */ - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, windowToValidate); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, kind); - } - if (pWin->realized) - WindowsRestructured (); -} - - -/* - * pValid is a region of the screen which has been - * successfully copied -- recomputed exposed regions for affected windows - */ - -static int -miRecomputeExposures ( - register WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ -{ - register ScreenPtr pScreen; - RegionPtr pValid = (RegionPtr)value; - - if (pWin->valdata) - { - pScreen = pWin->drawable.pScreen; - /* - * compute exposed regions of this window - */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, - &pWin->clipList, pValid); - /* - * compute exposed regions of the border - */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, - &pWin->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, - &pWin->valdata->after.borderExposed, pValid); - return WT_WALKCHILDREN; - } - return WT_NOMATCH; -} - -void -miSlideAndSizeWindow(pWin, x, y, w, h, pSib) - register WindowPtr pWin; - int x,y; - unsigned int w, h; - WindowPtr pSib; -{ - WindowPtr pParent; - Bool WasViewable = (Bool)(pWin->viewable); - unsigned short width = pWin->drawable.width, - height = pWin->drawable.height; - short oldx = pWin->drawable.x, - oldy = pWin->drawable.y; - int bw = wBorderWidth (pWin); - short dw, dh; - DDXPointRec oldpt; - RegionPtr oldRegion = NULL; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - WindowPtr pFirstChange; - register WindowPtr pChild; - RegionPtr gravitate[StaticGravity + 1]; - register unsigned g; - int nx, ny; /* destination x,y */ - int newx, newy; /* new inner window position */ - RegionPtr pRegion = NULL; - RegionPtr destClip; /* portions of destination already written */ - RegionPtr oldWinClip = NULL; /* old clip list for window */ - RegionPtr borderVisible = NullRegion; /* visible area of the border */ - RegionPtr bsExposed = NullRegion; /* backing store exposures */ - Bool shrunk = FALSE; /* shrunk in an inner dimension */ - Bool moved = FALSE; /* window position changed */ -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - /* if this is a root window, can't be resized */ - if (!(pParent = pWin->parent)) - return ; - - pScreen = pWin->drawable.pScreen; - newx = pParent->drawable.x + x + bw; - newy = pParent->drawable.y + y + bw; - if (WasViewable) - { - anyMarked = FALSE; - /* - * save the visible region of the window - */ - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->winSize); - - /* - * categorize child windows into regions to be moved - */ - for (g = 0; g <= StaticGravity; g++) - gravitate[g] = (RegionPtr) NULL; - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - g = pChild->winGravity; - if (g != UnmapGravity) - { - if (!gravitate[g]) - gravitate[g] = REGION_CREATE(pScreen, NullBox, 1); - REGION_UNION(pScreen, gravitate[g], - gravitate[g], &pChild->borderClip); - } - else - { - UnmapWindow(pChild, TRUE); - anyMarked = TRUE; - } - } - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - - oldWinClip = NULL; - if (pWin->bitGravity != ForgetGravity) - { - oldWinClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip, &pWin->clipList); - } - /* - * if the window is changing size, borderExposed - * can't be computed correctly without some help. - */ - if (pWin->drawable.height > h || pWin->drawable.width > w) - shrunk = TRUE; - - if (newx != oldx || newy != oldy) - moved = TRUE; - - if ((pWin->drawable.height != h || pWin->drawable.width != w) && - HasBorder (pWin)) - { - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - /* for tiled borders, we punt and draw the whole thing */ - if (pWin->borderIsPixel || !moved) - { - if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, - &pWin->winSize); - else - REGION_COPY(pScreen, borderVisible, - &pWin->borderClip); - } - } - } - pWin->origin.x = x + bw; - pWin->origin.y = y + bw; - pWin->drawable.height = h; - pWin->drawable.width = w; - - x = pWin->drawable.x = newx; - y = pWin->drawable.y = newy; - - SetWinSize (pWin); - SetBorderSize (pWin); - - dw = (int)w - (int)width; - dh = (int)h - (int)height; - ResizeChildrenWinSize(pWin, x - oldx, y - oldy, dw, dh); - - /* let the hardware adjust background and border pixmaps, if any */ - (*pScreen->PositionWindow)(pWin, x, y); - - pFirstChange = MoveWindowInStack(pWin, pSib); - - if (WasViewable) - { - pRegion = REGION_CREATE(pScreen, NullBox, 1); - if (pWin->backStorage) - REGION_COPY(pScreen, pRegion, &pWin->clipList); - - if (pLayerWin == pWin) - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, - (WindowPtr *)NULL); - else - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin, - (WindowPtr *)NULL); - - if (pWin->valdata) - { - pWin->valdata->before.resized = TRUE; - pWin->valdata->before.borderVisible = borderVisible; - } - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, VTOther); - /* - * the entire window is trashed unless bitGravity - * recovers portions of it - */ - REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList); - } - - GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pRegion = &pWin->clipList; /* a convenient empty region */ - if (pWin->bitGravity == ForgetGravity) - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, NullRegion, oldx, oldy); - else - { - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, nx - x, ny - y, pRegion, oldx, oldy); - } - } - - if (WasViewable) - { - /* avoid the border */ - if (HasBorder (pWin)) - { - int offx, offy, dx, dy; - - /* kruft to avoid double translates for each gravity */ - offx = 0; - offy = 0; - for (g = 0; g <= StaticGravity; g++) - { - if (!gravitate[g]) - continue; - - /* align winSize to gravitate[g]. - * winSize is in new coordinates, - * gravitate[g] is still in old coordinates */ - GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny); - - dx = (oldx - nx) - offx; - dy = (oldy - ny) - offy; - if (dx || dy) - { - REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy); - offx += dx; - offy += dy; - } - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], - &pWin->winSize); - } - /* get winSize back where it belongs */ - if (offx || offy) - REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy); - } - /* - * add screen bits to the appropriate bucket - */ - - if (oldWinClip) - { - /* - * clip to new clipList - */ - REGION_COPY(pScreen, pRegion, oldWinClip); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList); - /* - * don't step on any gravity bits which will be copied after this - * region. Note -- this assumes that the regions will be copied - * in gravity order. - */ - for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) - { - if (gravitate[g]) - REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip, - gravitate[g]); - } - REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny); - g = pWin->bitGravity; - if (!gravitate[g]) - gravitate[g] = oldWinClip; - else - { - REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip); - REGION_DESTROY(pScreen, oldWinClip); - } - } - - /* - * move the bits on the screen - */ - - destClip = NULL; - - for (g = 0; g <= StaticGravity; g++) - { - if (!gravitate[g]) - continue; - - GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny); - - oldpt.x = oldx + (x - nx); - oldpt.y = oldy + (y - ny); - - /* Note that gravitate[g] is *translated* by CopyWindow */ - - /* only copy the remaining useful bits */ - - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], oldRegion); - - /* clip to not overwrite already copied areas */ - - if (destClip) { - REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip); - REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y); - } - - /* and move those bits */ - - if (oldpt.x != x || oldpt.y != y -#ifdef COMPOSITE - || pWin->redirectDraw -#endif - ) - { - (*pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, gravitate[g]); - } - - /* remove any overwritten bits from the remaining useful bits */ - - REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]); - - /* - * recompute exposed regions of child windows - */ - - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - if (pChild->winGravity != g) - continue; - REGION_INTERSECT(pScreen, pRegion, - &pChild->borderClip, gravitate[g]); - TraverseTree (pChild, miRecomputeExposures, (pointer)pRegion); - } - - /* - * remove the successfully copied regions of the - * window from its exposed region - */ - - if (g == pWin->bitGravity) - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, - &pWin->valdata->after.exposed, gravitate[g]); - if (!destClip) - destClip = gravitate[g]; - else - { - REGION_UNION(pScreen, destClip, destClip, gravitate[g]); - REGION_DESTROY(pScreen, gravitate[g]); - } - } - - REGION_DESTROY(pScreen, oldRegion); - REGION_DESTROY(pScreen, pRegion); - if (destClip) - REGION_DESTROY(pScreen, destClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - if (anyMarked) - (*pScreen->HandleExposures)(pLayerWin->parent); -#ifdef DO_SAVE_UNDERS - if (dosave) - { - (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange, - VTOther); - } - else if (bsExposed) - { - (*pScreen->WindowExposures) (pWin, NullRegion, bsExposed); - REGION_DESTROY(pScreen, bsExposed); - } - if (pWin->realized) - WindowsRestructured (); -} - -WindowPtr -miGetLayerWindow(pWin) - WindowPtr pWin; -{ - return pWin->firstChild; -} - -#ifdef SHAPE -/****** - * - * miSetShape - * The border/window shape has changed. Recompute winSize/borderSize - * and send appropriate exposure events - */ - -void -miSetShape(pWin) - register WindowPtr pWin; -{ - Bool WasViewable = (Bool)(pWin->viewable); - register ScreenPtr pScreen = pWin->drawable.pScreen; - Bool anyMarked = FALSE; - RegionPtr pOldClip = NULL, bsExposed; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - if (WasViewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - SetWinSize (pWin); - SetBorderSize (pWin); - - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - if (WasViewable) - { - if (pWin->backStorage) - { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); - } - - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - (WindowPtr *)NULL); - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, VTOther); - } - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pOldClip = &pWin->clipList; /* a convenient empty region */ - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, pOldClip, - pWin->drawable.x, pWin->drawable.y); -#ifdef NXAGENT_SERVER - - /* - * We got a few, rare, segfaults here after having - * started using the backing store. It may be a - * different bug but miChangeSaveUnder() calls mi- - * CheckSubSaveUnder() that, in turn, can change - * the backing store attribute of the window. This - * means that we may try to destroy the region - * even if it was not created at the beginning of - * this function as, at the time, the backing store - * was off. miCheckSubSaveUnder() appear to get a - * pointer to the parent, so maybe doesn't change - * the attribute of the window itself. This is to - * be better investigated. - */ - - if (WasViewable && pOldClip) - REGION_DESTROY(pScreen, pOldClip); -#else - if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); -#endif - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - } - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pLayerWin->parent); -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured (); - CheckCursorConfinement(pWin); -} -#endif - -/* Keeps the same inside(!) origin */ - -void -miChangeBorderWidth(pWin, width) - register WindowPtr pWin; - unsigned int width; -{ - int oldwidth; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - Bool WasViewable = (Bool)(pWin->viewable); - Bool HadBorder; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - oldwidth = wBorderWidth (pWin); - if (oldwidth == width) - return; - HadBorder = HasBorder(pWin); - pScreen = pWin->drawable.pScreen; - if (WasViewable && width < oldwidth) - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); - - pWin->borderWidth = width; - SetBorderSize (pWin); - - if (WasViewable) - { - if (width > oldwidth) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - /* - * save the old border visible region to correctly compute - * borderExposed. - */ - if (pWin->valdata && HadBorder) - { - RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTOther); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, - VTOther); - } - if (pWin->realized) - WindowsRestructured (); -} - -void -miMarkUnrealizedWindow(pChild, pWin, fromConfigure) - WindowPtr pChild; - WindowPtr pWin; - Bool fromConfigure; -{ - if ((pChild != pWin) || fromConfigure) - { - REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList); - if (pChild->drawable.pScreen->ClipNotify) - (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0); - REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip); - } -} - -void -miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth) -{ - ScreenPtr pScreen; - WindowPtr pChild; - - pScreen = pWin->drawable.pScreen; - - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - if (pChild->drawable.depth == depth) - REGION_UNION(pScreen, pReg, pReg, &pChild->borderClip); - - if (pChild->firstChild) - miSegregateChildren(pChild, pReg, depth); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.X.original deleted file mode 100644 index 280d0f8eb..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.X.original +++ /dev/null @@ -1,1184 +0,0 @@ -/* $XFree86: xc/programs/Xserver/mi/miwindow.c,v 1.9tsi Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: miwindow.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "regionstr.h" -#include "region.h" -#include "mi.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "mivalidate.h" - -void -miClearToBackground(pWin, x, y, w, h, generateExposures) - WindowPtr pWin; - int x,y; - int w,h; - Bool generateExposures; -{ - BoxRec box; - RegionRec reg; - RegionPtr pBSReg = NullRegion; - ScreenPtr pScreen; - BoxPtr extents; - int x1, y1, x2, y2; - - /* compute everything using ints to avoid overflow */ - - x1 = pWin->drawable.x + x; - y1 = pWin->drawable.y + y; - if (w) - x2 = x1 + (int) w; - else - x2 = x1 + (int) pWin->drawable.width - (int) x; - if (h) - y2 = y1 + h; - else - y2 = y1 + (int) pWin->drawable.height - (int) y; - - extents = &pWin->clipList.extents; - - /* clip the resulting rectangle to the window clipList extents. This - * makes sure that the result will fit in a box, given that the - * screen is < 32768 on a side. - */ - - if (x1 < extents->x1) - x1 = extents->x1; - if (x2 > extents->x2) - x2 = extents->x2; - if (y1 < extents->y1) - y1 = extents->y1; - if (y2 > extents->y2) - y2 = extents->y2; - - if (x2 <= x1 || y2 <= y1) - { - x2 = x1 = 0; - y2 = y1 = 0; - } - - box.x1 = x1; - box.x2 = x2; - box.y1 = y1; - box.y2 = y2; - - pScreen = pWin->drawable.pScreen; - REGION_INIT(pScreen, ®, &box, 1); - if (pWin->backStorage) - { - /* - * If the window has backing-store on, call through the - * ClearToBackground vector to handle the special semantics - * (i.e. things backing store is to be cleared out and - * an Expose event is to be generated for those areas in backing - * store if generateExposures is TRUE). - */ - pBSReg = (* pScreen->ClearBackingStore)(pWin, x, y, w, h, - generateExposures); - } - - REGION_INTERSECT(pScreen, ®, ®, &pWin->clipList); - if (generateExposures) - (*pScreen->WindowExposures)(pWin, ®, pBSReg); - else if (pWin->backgroundState != None) - (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); - REGION_UNINIT(pScreen, ®); - if (pBSReg) - REGION_DESTROY(pScreen, pBSReg); -} - -/* - * For SaveUnders using backing-store. The idea is that when a window is mapped - * with saveUnder set TRUE, any windows it obscures will have its backing - * store turned on setting the DIXsaveUnder bit, - * The backing-store code must be written to allow for this - */ - -/*- - *----------------------------------------------------------------------- - * miCheckSubSaveUnder -- - * Check all the inferiors of a window for coverage by saveUnder - * windows. Called from ChangeSaveUnder and CheckSaveUnder. - * This code is very inefficient. - * - * Results: - * TRUE if any windows need to have backing-store removed. - * - * Side Effects: - * Windows may have backing-store turned on or off. - * - *----------------------------------------------------------------------- - */ -static Bool -miCheckSubSaveUnder( - register WindowPtr pParent, /* Parent to check */ - WindowPtr pFirst, /* first reconfigured window */ - RegionPtr pRegion) /* Initial area obscured by saveUnder */ -{ - register WindowPtr pChild; /* Current child */ - register ScreenPtr pScreen; /* Screen to use */ - RegionRec SubRegion; /* Area of children obscured */ - Bool res = FALSE; /* result */ - Bool subInited=FALSE;/* SubRegion initialized */ - - pScreen = pParent->drawable.pScreen; - if ( (pChild = pParent->firstChild) ) - { - /* - * build region above first changed window - */ - - for (; pChild != pFirst; pChild = pChild->nextSib) - if (pChild->viewable && pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); - - /* - * check region below and including first changed window - */ - - for (; pChild; pChild = pChild->nextSib) - { - if (pChild->viewable) - { - /* - * don't save under nephew/niece windows; - * use a separate region - */ - - if (pChild->firstChild) - { - if (!subInited) - { - REGION_NULL(pScreen, &SubRegion); - subInited = TRUE; - } - REGION_COPY(pScreen, &SubRegion, pRegion); - res |= miCheckSubSaveUnder(pChild, pChild->firstChild, - &SubRegion); - } - else - { - res |= miCheckSubSaveUnder(pChild, pChild->firstChild, - pRegion); - } - - if (pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); - } - } - - if (subInited) - REGION_UNINIT(pScreen, &SubRegion); - } - - /* - * Check the state of this window. DIX save unders are - * enabled for viewable windows with some client expressing - * exposure interest and which intersect the save under region - */ - - if (pParent->viewable && - ((pParent->eventMask | wOtherEventMasks(pParent)) & ExposureMask) && - REGION_NOTEMPTY(pScreen, &pParent->borderSize) && - RECT_IN_REGION(pScreen, pRegion, REGION_EXTENTS(pScreen, - &pParent->borderSize)) != rgnOUT) - { - if (!pParent->DIXsaveUnder) - { - pParent->DIXsaveUnder = TRUE; - (*pScreen->ChangeWindowAttributes) (pParent, CWBackingStore); - } - } - else - { - if (pParent->DIXsaveUnder) - { - res = TRUE; - pParent->DIXsaveUnder = FALSE; - } - } - return res; -} - - -/*- - *----------------------------------------------------------------------- - * miChangeSaveUnder -- - * Change the save-under state of a tree of windows. Called when - * a window with saveUnder TRUE is mapped/unmapped/reconfigured. - * - * Results: - * TRUE if any windows need to have backing-store removed (which - * means that PostChangeSaveUnder needs to be called later to - * finish the job). - * - * Side Effects: - * Windows may have backing-store turned on or off. - * - *----------------------------------------------------------------------- - */ -Bool -miChangeSaveUnder(pWin, first) - register WindowPtr pWin; - WindowPtr first; /* First window to check. - * Used when pWin was restacked */ -{ - RegionRec rgn; /* Area obscured by saveUnder windows */ - register ScreenPtr pScreen; - Bool res; - - if (!deltaSaveUndersViewable && !numSaveUndersViewable) - return FALSE; - numSaveUndersViewable += deltaSaveUndersViewable; - deltaSaveUndersViewable = 0; - pScreen = pWin->drawable.pScreen; - REGION_NULL(pScreen, &rgn); - res = miCheckSubSaveUnder (pWin->parent, - pWin->saveUnder ? first : pWin->nextSib, - &rgn); - REGION_UNINIT(pScreen, &rgn); - return res; -} - -/*- - *----------------------------------------------------------------------- - * miPostChangeSaveUnder -- - * Actually turn backing-store off for those windows that no longer - * need to have it on. - * - * Results: - * None. - * - * Side Effects: - * Backing-store and SAVE_UNDER_CHANGE_BIT are turned off for those - * windows affected. - * - *----------------------------------------------------------------------- - */ -void -miPostChangeSaveUnder(pWin, pFirst) - WindowPtr pWin; - WindowPtr pFirst; -{ - register WindowPtr pParent, pChild; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - - if (!(pParent = pWin->parent)) - return; - ChangeWindowAttributes = pParent->drawable.pScreen->ChangeWindowAttributes; - if (!pParent->DIXsaveUnder && - (pParent->backingStore == NotUseful) && pParent->backStorage) - (*ChangeWindowAttributes)(pParent, CWBackingStore); - if (!(pChild = pFirst)) - return; - while (1) - { - if (!pChild->DIXsaveUnder && - (pChild->backingStore == NotUseful) && pChild->backStorage) - (*ChangeWindowAttributes)(pChild, CWBackingStore); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib) - { - pChild = pChild->parent; - if (pChild == pParent) - return; - } - pChild = pChild->nextSib; - } -} - -void -miMarkWindow(pWin) - register WindowPtr pWin; -{ - register ValidatePtr val; - - if (pWin->valdata) - return; - val = (ValidatePtr)xnfalloc(sizeof(ValidateRec)); - val->before.oldAbsCorner.x = pWin->drawable.x; - val->before.oldAbsCorner.y = pWin->drawable.y; - val->before.borderVisible = NullRegion; - val->before.resized = FALSE; - pWin->valdata = val; -} - -Bool -miMarkOverlappedWindows(pWin, pFirst, ppLayerWin) - WindowPtr pWin; - WindowPtr pFirst; - WindowPtr *ppLayerWin; -{ - register BoxPtr box; - register WindowPtr pChild, pLast; - Bool anyMarked = FALSE; - MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow; - ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; - - /* single layered systems are easy */ - if (ppLayerWin) *ppLayerWin = pWin; - - if (pWin == pFirst) - { - /* Blindly mark pWin and all of its inferiors. This is a slight - * overkill if there are mapped windows that outside pWin's border, - * but it's better than wasting time on RectIn checks. - */ - pChild = pWin; - while (1) - { - if (pChild->viewable) - { - if (REGION_BROKEN (pScreen, &pChild->winSize)) - SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) - SetBorderSize (pChild); - (* MarkWindow)(pChild); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } - anyMarked = TRUE; - pFirst = pFirst->nextSib; - } - if ( (pChild = pFirst) ) - { - box = REGION_EXTENTS(pChild->drawable.pScreen, &pWin->borderSize); - pLast = pChild->parent->lastChild; - while (1) - { - if (pChild->viewable) - { - if (REGION_BROKEN (pScreen, &pChild->winSize)) - SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) - SetBorderSize (pChild); - if (RECT_IN_REGION(pScreen, &pChild->borderSize, box)) - { - (* MarkWindow)(pChild); - anyMarked = TRUE; - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - } - while (!pChild->nextSib && (pChild != pLast)) - pChild = pChild->parent; - if (pChild == pLast) - break; - pChild = pChild->nextSib; - } - } - if (anyMarked) - (* MarkWindow)(pWin->parent); - return anyMarked; -} - -/***** - * miHandleValidateExposures(pWin) - * starting at pWin, draw background in any windows that have exposure - * regions, translate the regions, restore any backing store, - * and then send any regions still exposed to the client - *****/ -void -miHandleValidateExposures(pWin) - WindowPtr pWin; -{ - register WindowPtr pChild; - register ValidatePtr val; - ScreenPtr pScreen; - WindowExposuresProcPtr WindowExposures; - - pScreen = pWin->drawable.pScreen; - - pChild = pWin; - WindowExposures = pChild->drawable.pScreen->WindowExposures; - while (1) - { - if ( (val = pChild->valdata) ) - { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) - (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, - &val->after.borderExposed, - PW_BORDER); - REGION_UNINIT(pScreen, &val->after.borderExposed); - (*WindowExposures)(pChild, &val->after.exposed, NullRegion); - REGION_UNINIT(pScreen, &val->after.exposed); - xfree(val); - pChild->valdata = (ValidatePtr)NULL; - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } -} - -void -miMoveWindow(pWin, x, y, pNextSib, kind) - register WindowPtr pWin; - int x,y; - WindowPtr pNextSib; - VTKind kind; -{ - WindowPtr pParent; - Bool WasViewable = (Bool)(pWin->viewable); - short bw; - RegionPtr oldRegion = NULL; - DDXPointRec oldpt; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - WindowPtr windowToValidate; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - /* if this is a root window, can't be moved */ - if (!(pParent = pWin->parent)) - return ; - pScreen = pWin->drawable.pScreen; - bw = wBorderWidth (pWin); - - oldpt.x = pWin->drawable.x; - oldpt.y = pWin->drawable.y; - if (WasViewable) - { - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->borderClip); - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); - } - pWin->origin.x = x + (int)bw; - pWin->origin.y = y + (int)bw; - x = pWin->drawable.x = pParent->drawable.x + x + (int)bw; - y = pWin->drawable.y = pParent->drawable.y + y + (int)bw; - - SetWinSize (pWin); - SetBorderSize (pWin); - - (*pScreen->PositionWindow)(pWin, x, y); - - windowToValidate = MoveWindowInStack(pWin, pNextSib); - - ResizeChildrenWinSize(pWin, x - oldpt.x, y - oldpt.y, 0, 0); - - if (WasViewable) - { - if (pLayerWin == pWin) - anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, windowToValidate, (WindowPtr *)NULL); - else - anyMarked |= (*pScreen->MarkOverlappedWindows) - (pWin, pLayerWin, (WindowPtr *)NULL); - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, windowToValidate); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, kind); - (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, oldRegion); - REGION_DESTROY(pScreen, oldRegion); - /* XXX need to retile border if ParentRelative origin */ - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, windowToValidate); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, kind); - } - if (pWin->realized) - WindowsRestructured (); -} - - -/* - * pValid is a region of the screen which has been - * successfully copied -- recomputed exposed regions for affected windows - */ - -static int -miRecomputeExposures ( - register WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ -{ - register ScreenPtr pScreen; - RegionPtr pValid = (RegionPtr)value; - - if (pWin->valdata) - { - pScreen = pWin->drawable.pScreen; - /* - * compute exposed regions of this window - */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, - &pWin->clipList, pValid); - /* - * compute exposed regions of the border - */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, - &pWin->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, - &pWin->valdata->after.borderExposed, pValid); - return WT_WALKCHILDREN; - } - return WT_NOMATCH; -} - -void -miSlideAndSizeWindow(pWin, x, y, w, h, pSib) - register WindowPtr pWin; - int x,y; - unsigned int w, h; - WindowPtr pSib; -{ - WindowPtr pParent; - Bool WasViewable = (Bool)(pWin->viewable); - unsigned short width = pWin->drawable.width, - height = pWin->drawable.height; - short oldx = pWin->drawable.x, - oldy = pWin->drawable.y; - int bw = wBorderWidth (pWin); - short dw, dh; - DDXPointRec oldpt; - RegionPtr oldRegion = NULL; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - WindowPtr pFirstChange; - register WindowPtr pChild; - RegionPtr gravitate[StaticGravity + 1]; - register unsigned g; - int nx, ny; /* destination x,y */ - int newx, newy; /* new inner window position */ - RegionPtr pRegion = NULL; - RegionPtr destClip; /* portions of destination already written */ - RegionPtr oldWinClip = NULL; /* old clip list for window */ - RegionPtr borderVisible = NullRegion; /* visible area of the border */ - RegionPtr bsExposed = NullRegion; /* backing store exposures */ - Bool shrunk = FALSE; /* shrunk in an inner dimension */ - Bool moved = FALSE; /* window position changed */ -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - /* if this is a root window, can't be resized */ - if (!(pParent = pWin->parent)) - return ; - - pScreen = pWin->drawable.pScreen; - newx = pParent->drawable.x + x + bw; - newy = pParent->drawable.y + y + bw; - if (WasViewable) - { - anyMarked = FALSE; - /* - * save the visible region of the window - */ - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->winSize); - - /* - * categorize child windows into regions to be moved - */ - for (g = 0; g <= StaticGravity; g++) - gravitate[g] = (RegionPtr) NULL; - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - g = pChild->winGravity; - if (g != UnmapGravity) - { - if (!gravitate[g]) - gravitate[g] = REGION_CREATE(pScreen, NullBox, 1); - REGION_UNION(pScreen, gravitate[g], - gravitate[g], &pChild->borderClip); - } - else - { - UnmapWindow(pChild, TRUE); - anyMarked = TRUE; - } - } - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - - oldWinClip = NULL; - if (pWin->bitGravity != ForgetGravity) - { - oldWinClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip, &pWin->clipList); - } - /* - * if the window is changing size, borderExposed - * can't be computed correctly without some help. - */ - if (pWin->drawable.height > h || pWin->drawable.width > w) - shrunk = TRUE; - - if (newx != oldx || newy != oldy) - moved = TRUE; - - if ((pWin->drawable.height != h || pWin->drawable.width != w) && - HasBorder (pWin)) - { - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - /* for tiled borders, we punt and draw the whole thing */ - if (pWin->borderIsPixel || !moved) - { - if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, - &pWin->winSize); - else - REGION_COPY(pScreen, borderVisible, - &pWin->borderClip); - } - } - } - pWin->origin.x = x + bw; - pWin->origin.y = y + bw; - pWin->drawable.height = h; - pWin->drawable.width = w; - - x = pWin->drawable.x = newx; - y = pWin->drawable.y = newy; - - SetWinSize (pWin); - SetBorderSize (pWin); - - dw = (int)w - (int)width; - dh = (int)h - (int)height; - ResizeChildrenWinSize(pWin, x - oldx, y - oldy, dw, dh); - - /* let the hardware adjust background and border pixmaps, if any */ - (*pScreen->PositionWindow)(pWin, x, y); - - pFirstChange = MoveWindowInStack(pWin, pSib); - - if (WasViewable) - { - pRegion = REGION_CREATE(pScreen, NullBox, 1); - if (pWin->backStorage) - REGION_COPY(pScreen, pRegion, &pWin->clipList); - - if (pLayerWin == pWin) - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, - (WindowPtr *)NULL); - else - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin, - (WindowPtr *)NULL); - - if (pWin->valdata) - { - pWin->valdata->before.resized = TRUE; - pWin->valdata->before.borderVisible = borderVisible; - } - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, VTOther); - /* - * the entire window is trashed unless bitGravity - * recovers portions of it - */ - REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList); - } - - GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pRegion = &pWin->clipList; /* a convenient empty region */ - if (pWin->bitGravity == ForgetGravity) - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, NullRegion, oldx, oldy); - else - { - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, nx - x, ny - y, pRegion, oldx, oldy); - } - } - - if (WasViewable) - { - /* avoid the border */ - if (HasBorder (pWin)) - { - int offx, offy, dx, dy; - - /* kruft to avoid double translates for each gravity */ - offx = 0; - offy = 0; - for (g = 0; g <= StaticGravity; g++) - { - if (!gravitate[g]) - continue; - - /* align winSize to gravitate[g]. - * winSize is in new coordinates, - * gravitate[g] is still in old coordinates */ - GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny); - - dx = (oldx - nx) - offx; - dy = (oldy - ny) - offy; - if (dx || dy) - { - REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy); - offx += dx; - offy += dy; - } - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], - &pWin->winSize); - } - /* get winSize back where it belongs */ - if (offx || offy) - REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy); - } - /* - * add screen bits to the appropriate bucket - */ - - if (oldWinClip) - { - /* - * clip to new clipList - */ - REGION_COPY(pScreen, pRegion, oldWinClip); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList); - /* - * don't step on any gravity bits which will be copied after this - * region. Note -- this assumes that the regions will be copied - * in gravity order. - */ - for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) - { - if (gravitate[g]) - REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip, - gravitate[g]); - } - REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny); - g = pWin->bitGravity; - if (!gravitate[g]) - gravitate[g] = oldWinClip; - else - { - REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip); - REGION_DESTROY(pScreen, oldWinClip); - } - } - - /* - * move the bits on the screen - */ - - destClip = NULL; - - for (g = 0; g <= StaticGravity; g++) - { - if (!gravitate[g]) - continue; - - GravityTranslate (x, y, oldx, oldy, dw, dh, g, &nx, &ny); - - oldpt.x = oldx + (x - nx); - oldpt.y = oldy + (y - ny); - - /* Note that gravitate[g] is *translated* by CopyWindow */ - - /* only copy the remaining useful bits */ - - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], oldRegion); - - /* clip to not overwrite already copied areas */ - - if (destClip) { - REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip); - REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y); - } - - /* and move those bits */ - - if (oldpt.x != x || oldpt.y != y -#ifdef COMPOSITE - || pWin->redirectDraw -#endif - ) - { - (*pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, gravitate[g]); - } - - /* remove any overwritten bits from the remaining useful bits */ - - REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]); - - /* - * recompute exposed regions of child windows - */ - - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - if (pChild->winGravity != g) - continue; - REGION_INTERSECT(pScreen, pRegion, - &pChild->borderClip, gravitate[g]); - TraverseTree (pChild, miRecomputeExposures, (pointer)pRegion); - } - - /* - * remove the successfully copied regions of the - * window from its exposed region - */ - - if (g == pWin->bitGravity) - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, - &pWin->valdata->after.exposed, gravitate[g]); - if (!destClip) - destClip = gravitate[g]; - else - { - REGION_UNION(pScreen, destClip, destClip, gravitate[g]); - REGION_DESTROY(pScreen, gravitate[g]); - } - } - - REGION_DESTROY(pScreen, oldRegion); - REGION_DESTROY(pScreen, pRegion); - if (destClip) - REGION_DESTROY(pScreen, destClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - if (anyMarked) - (*pScreen->HandleExposures)(pLayerWin->parent); -#ifdef DO_SAVE_UNDERS - if (dosave) - { - (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange, - VTOther); - } - else if (bsExposed) - { - (*pScreen->WindowExposures) (pWin, NullRegion, bsExposed); - REGION_DESTROY(pScreen, bsExposed); - } - if (pWin->realized) - WindowsRestructured (); -} - -WindowPtr -miGetLayerWindow(pWin) - WindowPtr pWin; -{ - return pWin->firstChild; -} - -#ifdef SHAPE -/****** - * - * miSetShape - * The border/window shape has changed. Recompute winSize/borderSize - * and send appropriate exposure events - */ - -void -miSetShape(pWin) - register WindowPtr pWin; -{ - Bool WasViewable = (Bool)(pWin->viewable); - register ScreenPtr pScreen = pWin->drawable.pScreen; - Bool anyMarked = FALSE; - RegionPtr pOldClip = NULL, bsExposed; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - if (WasViewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - SetWinSize (pWin); - SetBorderSize (pWin); - - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - if (WasViewable) - { - if (pWin->backStorage) - { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); - } - - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - (WindowPtr *)NULL); - -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, VTOther); - } - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pOldClip = &pWin->clipList; /* a convenient empty region */ - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, pOldClip, - pWin->drawable.x, pWin->drawable.y); - if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - } - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pLayerWin->parent); -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured (); - CheckCursorConfinement(pWin); -} -#endif - -/* Keeps the same inside(!) origin */ - -void -miChangeBorderWidth(pWin, width) - register WindowPtr pWin; - unsigned int width; -{ - int oldwidth; - Bool anyMarked = FALSE; - register ScreenPtr pScreen; - Bool WasViewable = (Bool)(pWin->viewable); - Bool HadBorder; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - oldwidth = wBorderWidth (pWin); - if (oldwidth == width) - return; - HadBorder = HasBorder(pWin); - pScreen = pWin->drawable.pScreen; - if (WasViewable && width < oldwidth) - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); - - pWin->borderWidth = width; - SetBorderSize (pWin); - - if (WasViewable) - { - if (width > oldwidth) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - /* - * save the old border visible region to correctly compute - * borderExposed. - */ - if (pWin->valdata && HadBorder) - { - RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib); - } -#endif /* DO_SAVE_UNDERS */ - - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTOther); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, - VTOther); - } - if (pWin->realized) - WindowsRestructured (); -} - -void -miMarkUnrealizedWindow(pChild, pWin, fromConfigure) - WindowPtr pChild; - WindowPtr pWin; - Bool fromConfigure; -{ - if ((pChild != pWin) || fromConfigure) - { - REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList); - if (pChild->drawable.pScreen->ClipNotify) - (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0); - REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip); - } -} - -void -miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth) -{ - ScreenPtr pScreen; - WindowPtr pChild; - - pScreen = pWin->drawable.pScreen; - - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - if (pChild->drawable.depth == depth) - REGION_UNION(pScreen, pReg, pReg, &pChild->borderClip); - - if (pChild->firstChild) - miSegregateChildren(pChild, pReg, depth); - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original deleted file mode 100644 index d9054b4b6..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original +++ /dev/null @@ -1,2270 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/render/picture.c,v 1.29 2002/11/23 02:38:15 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "NXpicturestr.h" - -#include "Screen.h" -#include "Pixmaps.h" -#include "Drawable.h" -#include "Render.h" - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -void *nxagentVisualFromID(ScreenPtr pScreen, VisualID visual); - -void *nxagentMatchingFormats(PictFormatPtr pForm); - -int PictureScreenPrivateIndex = -1; -int PictureWindowPrivateIndex; -int PictureGeneration; -RESTYPE PictureType; -RESTYPE PictFormatType; -RESTYPE GlyphSetType; -int PictureCmapPolicy = PictureCmapPolicyDefault; - -typedef struct _formatInit { - CARD32 format; - CARD8 depth; -} FormatInitRec, *FormatInitPtr; - -void nxagentPictureCreateDefaultFormats(ScreenPtr pScreen, FormatInitRec *formats, int *nformats); - -/* Picture Private machinery */ - -static int picturePrivateCount; - -void -ResetPicturePrivateIndex (void) -{ - picturePrivateCount = 0; -} - -int -AllocatePicturePrivateIndex (void) -{ - return picturePrivateCount++; -} - -Bool -AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - unsigned int oldamount; - - /* Round up sizes for proper alignment */ - amount = ((amount + (sizeof(long) - 1)) / sizeof(long)) * sizeof(long); - - if (index2 >= ps->PicturePrivateLen) - { - unsigned int *nsizes; - - nsizes = (unsigned int *)xrealloc(ps->PicturePrivateSizes, - (index2 + 1) * sizeof(unsigned int)); - if (!nsizes) - return FALSE; - while (ps->PicturePrivateLen <= index2) - { - nsizes[ps->PicturePrivateLen++] = 0; - ps->totalPictureSize += sizeof(DevUnion); - } - ps->PicturePrivateSizes = nsizes; - } - oldamount = ps->PicturePrivateSizes[index2]; - if (amount > oldamount) - { - ps->PicturePrivateSizes[index2] = amount; - ps->totalPictureSize += (amount - oldamount); - } - - return TRUE; -} - - -Bool -PictureDestroyWindow (WindowPtr pWindow) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - PicturePtr pPicture; - PictureScreenPtr ps = GetPictureScreen(pScreen); - Bool ret; - - while ((pPicture = GetPictureWindow(pWindow))) - { - SetPictureWindow(pWindow, pPicture->pNext); - if (pPicture->id) - FreeResource (pPicture->id, PictureType); - FreePicture ((pointer) pPicture, pPicture->id); - } - pScreen->DestroyWindow = ps->DestroyWindow; - ret = (*pScreen->DestroyWindow) (pWindow); - ps->DestroyWindow = pScreen->DestroyWindow; - pScreen->DestroyWindow = PictureDestroyWindow; - return ret; -} - -Bool -PictureCloseScreen (int index, ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - Bool ret; - int n; - - pScreen->CloseScreen = ps->CloseScreen; - ret = (*pScreen->CloseScreen) (index, pScreen); - PictureResetFilters (pScreen); - for (n = 0; n < ps->nformats; n++) - if (ps->formats[n].type == PictTypeIndexed) - (*ps->CloseIndexed) (pScreen, &ps->formats[n]); - SetPictureScreen(pScreen, 0); - if (ps->PicturePrivateSizes) - xfree (ps->PicturePrivateSizes); - xfree (ps->formats); - xfree (ps); - return ret; -} - -void -PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef) -{ - ScreenPtr pScreen = pColormap->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - pScreen->StoreColors = ps->StoreColors; - (*pScreen->StoreColors) (pColormap, ndef, pdef); - ps->StoreColors = pScreen->StoreColors; - pScreen->StoreColors = PictureStoreColors; - - if (pColormap->class == PseudoColor || pColormap->class == GrayScale) - { - PictFormatPtr format = ps->formats; - int nformats = ps->nformats; - - while (nformats--) - { - if (format->type == PictTypeIndexed && - format->index.pColormap == pColormap) - { - (*ps->UpdateIndexed) (pScreen, format, ndef, pdef); - break; - } - format++; - } - } -} - -static int -visualDepth (ScreenPtr pScreen, VisualPtr pVisual) -{ - int d, v; - DepthPtr pDepth; - - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = &pScreen->allowedDepths[d]; - for (v = 0; v < pDepth->numVids; v++) - if (pDepth->vids[v] == pVisual->vid) - return pDepth->depth; - } - return 0; -} - -static int -addFormat (FormatInitRec formats[256], - int nformat, - CARD32 format, - CARD8 depth) -{ - int n; - - for (n = 0; n < nformat; n++) - if (formats[n].format == format && formats[n].depth == depth) - return nformat; - formats[nformat].format = format; - formats[nformat].depth = depth; - - #ifdef DEBUG - fprintf(stderr, "addFormat: Added format [%lu] depth [%d].\n", format, depth); - #endif - - return ++nformat; -} - -#define Mask(n) ((n) == 32 ? 0xffffffff : ((1 << (n))-1)) - -PictFormatPtr -PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) -{ - int nformats, f; - PictFormatPtr pFormats; - FormatInitRec formats[1024]; - CARD32 format; - -#ifndef NXAGENT_SERVER - - CARD8 depth; - VisualPtr pVisual; - int v; - int bpp; - int type; - int r, g, b; - int d; - DepthPtr pDepth; - -#endif - - nformats = 0; - -#ifdef NXAGENT_SERVER - - nxagentPictureCreateDefaultFormats(pScreen, formats, &nformats); - -#else - - /* formats required by protocol */ - formats[nformats].format = PICT_a1; - formats[nformats].depth = 1; - nformats++; - formats[nformats].format = PICT_a8; - formats[nformats].depth = 8; - nformats++; - formats[nformats].format = PICT_a4; - formats[nformats].depth = 4; - nformats++; - formats[nformats].format = PICT_a8r8g8b8; - formats[nformats].depth = 32; - nformats++; - formats[nformats].format = PICT_x8r8g8b8; - formats[nformats].depth = 32; - nformats++; - - /* now look through the depths and visuals adding other formats */ - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = &pScreen->visuals[v]; - depth = visualDepth (pScreen, pVisual); - if (!depth) - continue; - bpp = BitsPerPixel (depth); - - switch (pVisual->class) { - case DirectColor: - case TrueColor: - r = Ones (pVisual->redMask); - g = Ones (pVisual->greenMask); - b = Ones (pVisual->blueMask); - type = PICT_TYPE_OTHER; - /* - * Current rendering code supports only two direct formats, - * fields must be packed together at the bottom of the pixel - * and must be either RGB or BGR - */ - if (pVisual->offsetBlue == 0 && - pVisual->offsetGreen == b && - pVisual->offsetRed == b + g) - { - type = PICT_TYPE_ARGB; - } - else if (pVisual->offsetRed == 0 && - pVisual->offsetGreen == r && - pVisual->offsetBlue == r + g) - { - type = PICT_TYPE_ABGR; - } - if (type != PICT_TYPE_OTHER) - { - format = PICT_FORMAT(bpp, type, 0, r, g, b); - nformats = addFormat (formats, nformats, format, depth); - } - break; - case StaticColor: - case PseudoColor: - format = PICT_VISFORMAT (bpp, PICT_TYPE_COLOR, v); - nformats = addFormat (formats, nformats, format, depth); - break; - case StaticGray: - case GrayScale: - format = PICT_VISFORMAT (bpp, PICT_TYPE_GRAY, v); - nformats = addFormat (formats, nformats, format, depth); - break; - } - } - - /* - * Walk supported depths and add useful Direct formats - */ - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = &pScreen->allowedDepths[d]; - bpp = BitsPerPixel (pDepth->depth); - format = 0; - - switch (bpp) { - case 16: - /* depth 12 formats */ - if (pDepth->depth >= 12) - { - nformats = addFormat (formats, nformats, - PICT_x4r4g4b4, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x4b4g4r4, pDepth->depth); - } - - /* depth 15 formats */ - if (pDepth->depth >= 15) - { - nformats = addFormat (formats, nformats, - PICT_x1r5g5b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x1b5g5r5, pDepth->depth); - } - /* depth 16 formats */ - if (pDepth->depth >= 16) - { - nformats = addFormat (formats, nformats, - PICT_a1r5g5b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a1b5g5r5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_r5g6b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_b5g6r5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a4r4g4b4, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a4b4g4r4, pDepth->depth); - } - break; - case 24: - if (pDepth->depth >= 24) - { - nformats = addFormat (formats, nformats, - PICT_r8g8b8, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_b8g8r8, pDepth->depth); - } - break; - case 32: - if (pDepth->depth >= 24) - { - nformats = addFormat (formats, nformats, - PICT_x8r8g8b8, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x8b8g8r8, pDepth->depth); - } - break; - } - } - -#endif - - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); - if (!pFormats) - return 0; - memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); - for (f = 0; f < nformats; f++) - { - pFormats[f].id = FakeClientID (0); - pFormats[f].depth = formats[f].depth; - format = formats[f].format; - pFormats[f].format = format; - switch (PICT_FORMAT_TYPE(format)) { - case PICT_TYPE_ARGB: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - if (pFormats[f].direct.alphaMask) - pFormats[f].direct.alpha = (PICT_FORMAT_R(format) + - PICT_FORMAT_G(format) + - PICT_FORMAT_B(format)); - - pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format)); - pFormats[f].direct.red = (PICT_FORMAT_G(format) + - PICT_FORMAT_B(format)); - - pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format)); - pFormats[f].direct.green = PICT_FORMAT_B(format); - - pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format)); - pFormats[f].direct.blue = 0; - break; - - case PICT_TYPE_ABGR: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - if (pFormats[f].direct.alphaMask) - pFormats[f].direct.alpha = (PICT_FORMAT_B(format) + - PICT_FORMAT_G(format) + - PICT_FORMAT_R(format)); - - pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format)); - pFormats[f].direct.blue = (PICT_FORMAT_G(format) + - PICT_FORMAT_R(format)); - - pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format)); - pFormats[f].direct.green = PICT_FORMAT_R(format); - - pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format)); - pFormats[f].direct.red = 0; - break; - - case PICT_TYPE_A: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alpha = 0; - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - - /* remaining fields already set to zero */ - break; - - case PICT_TYPE_COLOR: - case PICT_TYPE_GRAY: - pFormats[f].type = PictTypeIndexed; - pFormats[f].index.vid = pScreen->visuals[PICT_FORMAT_VIS(format)].vid; - break; - } - -#ifdef NXAGENT_SERVER - if (nxagentMatchingFormats(&pFormats[f]) != NULL) - { - #ifdef DEBUG - fprintf(stderr, "PictureCreateDefaultFormats: Format with type [%d] depth [%d] rgb [%d,%d,%d] " - "mask rgb [%d,%d,%d] alpha [%d] alpha mask [%d] matches.\n", - pFormats[f].type, pFormats[f].depth, pFormats[f].direct.red, pFormats[f].direct.green, - pFormats[f].direct.blue, pFormats[f].direct.redMask, pFormats[f].direct.greenMask, - pFormats[f].direct.blueMask, pFormats[f].direct.alpha, pFormats[f].direct.alphaMask); - #endif - } - else - { - #ifdef DEBUG - fprintf(stderr, "PictureCreateDefaultFormats: Format with type [%d] depth [%d] rgb [%d,%d,%d] " - "mask rgb [%d,%d,%d] alpha [%d] alpha mask [%d] doesn't match.\n", - pFormats[f].type, pFormats[f].depth, pFormats[f].direct.red, pFormats[f].direct.green, - pFormats[f].direct.blue, pFormats[f].direct.redMask, pFormats[f].direct.greenMask, - pFormats[f].direct.blueMask, pFormats[f].direct.alpha, pFormats[f].direct.alphaMask); - #endif - } -#endif - } - *nformatp = nformats; - return pFormats; -} - -static VisualPtr -PictureFindVisual (ScreenPtr pScreen, VisualID visual) -{ - int i; - VisualPtr pVisual; - for (i = 0, pVisual = pScreen->visuals; - i < pScreen->numVisuals; - i++, pVisual++) - { - if (pVisual->vid == visual) - return pVisual; - } - return 0; -} - -Bool -PictureInitIndexedFormats (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - - if (!ps) - return FALSE; - format = ps->formats; - nformat = ps->nformats; - while (nformat--) - { - if (format->type == PictTypeIndexed && !format->index.pColormap) - { - if (format->index.vid == pScreen->rootVisual) - format->index.pColormap = (ColormapPtr) LookupIDByType(pScreen->defColormap, - RT_COLORMAP); - else - { - VisualPtr pVisual; - - pVisual = PictureFindVisual (pScreen, format->index.vid); - if (CreateColormap (FakeClientID (0), pScreen, - pVisual, - &format->index.pColormap, AllocNone, - 0) != Success) - { - return FALSE; - } - } - if (!(*ps->InitIndexed) (pScreen, format)) - return FALSE; - } - format++; - } - return TRUE; -} - -Bool -PictureFinishInit (void) -{ - int s; - - for (s = 0; s < screenInfo.numScreens; s++) - { - if (!PictureInitIndexedFormats (screenInfo.screens[s])) - return FALSE; - (void) AnimCurInit (screenInfo.screens[s]); - } - - return TRUE; -} - -Bool -PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - if (!ps) - return FALSE; - ps->subpixel = subpixel; - return TRUE; - -} - -int -PictureGetSubpixelOrder (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - if (!ps) - return SubPixelUnknown; - return ps->subpixel; -} - -PictFormatPtr -PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - int type; - - if (!ps) - return 0; - format = ps->formats; - nformat = ps->nformats; - switch (pVisual->class) { - case StaticGray: - case GrayScale: - case StaticColor: - case PseudoColor: - type = PictTypeIndexed; - break; - case TrueColor: - case DirectColor: - type = PictTypeDirect; - break; - default: - return 0; - } - while (nformat--) - { - if (format->depth == depth && format->type == type) - { - if (type == PictTypeIndexed) - { - if (format->index.vid == pVisual->vid) - return format; - } - else - { - if (format->direct.redMask << format->direct.red == - pVisual->redMask && - format->direct.greenMask << format->direct.green == - pVisual->greenMask && - format->direct.blueMask << format->direct.blue == - pVisual->blueMask) - { - return format; - } - } - } - format++; - } - return 0; -} - -PictFormatPtr -PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 f) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - - if (!ps) - return 0; - format = ps->formats; - nformat = ps->nformats; - while (nformat--) - { - if (format->depth == depth && format->format == (f & 0xffffff)) - return format; - format++; - } - return 0; -} - -int -PictureParseCmapPolicy (const char *name) -{ - if ( strcmp (name, "default" ) == 0) - return PictureCmapPolicyDefault; - else if ( strcmp (name, "mono" ) == 0) - return PictureCmapPolicyMono; - else if ( strcmp (name, "gray" ) == 0) - return PictureCmapPolicyGray; - else if ( strcmp (name, "color" ) == 0) - return PictureCmapPolicyColor; - else if ( strcmp (name, "all" ) == 0) - return PictureCmapPolicyAll; - else - return PictureCmapPolicyInvalid; -} - -Bool -PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) -{ - PictureScreenPtr ps; - int n; - CARD32 type, a, r, g, b; - - if (PictureGeneration != serverGeneration) - { - PictureType = CreateNewResourceType (FreePicture); - if (!PictureType) - return FALSE; - PictFormatType = CreateNewResourceType (FreePictFormat); - if (!PictFormatType) - return FALSE; - GlyphSetType = CreateNewResourceType (FreeGlyphSet); - if (!GlyphSetType) - return FALSE; - PictureScreenPrivateIndex = AllocateScreenPrivateIndex(); - if (PictureScreenPrivateIndex < 0) - return FALSE; - PictureWindowPrivateIndex = AllocateWindowPrivateIndex(); - PictureGeneration = serverGeneration; -#ifdef XResExtension - RegisterResourceName (PictureType, "PICTURE"); - RegisterResourceName (PictFormatType, "PICTFORMAT"); - RegisterResourceName (GlyphSetType, "GLYPHSET"); -#endif - } - if (!AllocateWindowPrivate (pScreen, PictureWindowPrivateIndex, 0)) - return FALSE; - - if (!formats) - { - formats = PictureCreateDefaultFormats (pScreen, &nformats); - if (!formats) - return FALSE; - } - for (n = 0; n < nformats; n++) - { - if (!AddResource (formats[n].id, PictFormatType, (pointer) (formats+n))) - { - xfree (formats); - return FALSE; - } - if (formats[n].type == PictTypeIndexed) - { - VisualPtr pVisual = PictureFindVisual (pScreen, formats[n].index.vid); - if ((pVisual->class | DynamicClass) == PseudoColor) - type = PICT_TYPE_COLOR; - else - type = PICT_TYPE_GRAY; - a = r = g = b = 0; - } - else - { - if ((formats[n].direct.redMask| - formats[n].direct.blueMask| - formats[n].direct.greenMask) == 0) - type = PICT_TYPE_A; - else if (formats[n].direct.red > formats[n].direct.blue) - type = PICT_TYPE_ARGB; - else - type = PICT_TYPE_ABGR; - a = Ones (formats[n].direct.alphaMask); - r = Ones (formats[n].direct.redMask); - g = Ones (formats[n].direct.greenMask); - b = Ones (formats[n].direct.blueMask); - } - formats[n].format = PICT_FORMAT(0,type,a,r,g,b); - } - ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec)); - if (!ps) - { - xfree (formats); - return FALSE; - } - SetPictureScreen(pScreen, ps); - if (!GlyphInit (pScreen)) - { - SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); - return FALSE; - } - - ps->totalPictureSize = sizeof (PictureRec); - ps->PicturePrivateSizes = 0; - ps->PicturePrivateLen = 0; - - ps->formats = formats; - ps->fallback = formats; - ps->nformats = nformats; - - ps->filters = 0; - ps->nfilters = 0; - ps->filterAliases = 0; - ps->nfilterAliases = 0; - - ps->subpixel = SubPixelUnknown; - - ps->CloseScreen = pScreen->CloseScreen; - ps->DestroyWindow = pScreen->DestroyWindow; - ps->StoreColors = pScreen->StoreColors; - pScreen->DestroyWindow = PictureDestroyWindow; - pScreen->CloseScreen = PictureCloseScreen; - pScreen->StoreColors = PictureStoreColors; - - if (!PictureSetDefaultFilters (pScreen)) - { - PictureResetFilters (pScreen); - SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); - return FALSE; - } - - return TRUE; -} - -void -SetPictureToDefaults (PicturePtr pPicture) -{ - pPicture->refcnt = 1; - pPicture->repeat = 0; - pPicture->graphicsExposures = FALSE; - pPicture->subWindowMode = ClipByChildren; - pPicture->polyEdge = PolyEdgeSharp; - pPicture->polyMode = PolyModePrecise; - pPicture->freeCompClip = FALSE; - pPicture->clientClipType = CT_NONE; - pPicture->componentAlpha = FALSE; - pPicture->repeatType = RepeatNone; - - pPicture->alphaMap = 0; - pPicture->alphaOrigin.x = 0; - pPicture->alphaOrigin.y = 0; - - pPicture->clipOrigin.x = 0; - pPicture->clipOrigin.y = 0; - pPicture->clientClip = 0; - - pPicture->transform = 0; - - pPicture->dither = None; - pPicture->filter = PictureGetFilterId (FilterNearest, -1, TRUE); - pPicture->filter_params = 0; - pPicture->filter_nparams = 0; - - pPicture->serialNumber = GC_CHANGE_SERIAL_BIT; - pPicture->stateChanges = (1 << (CPLastBit+1)) - 1; - pPicture->pSourcePict = 0; -} - -PicturePtr -AllocatePicture (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - PicturePtr pPicture; - char *ptr; - DevUnion *ppriv; - unsigned int *sizes; - unsigned int size; - int i; - - pPicture = (PicturePtr) xalloc (ps->totalPictureSize); - if (!pPicture) - return 0; - ppriv = (DevUnion *)(pPicture + 1); - pPicture->devPrivates = ppriv; - sizes = ps->PicturePrivateSizes; - ptr = (char *)(ppriv + ps->PicturePrivateLen); - for (i = ps->PicturePrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - - nxagentPicturePriv(pPicture) -> picture = 0; - - return pPicture; -} - -/* - * Let picture always point to the virtual pixmap. - * For sure this is not the best way to deal with - * the virtual frame-buffer. - */ - -#define NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - -PicturePtr -CreatePicture (Picture pid, - DrawablePtr pDrawable, - PictFormatPtr pFormat, - Mask vmask, - XID *vlist, - ClientPtr client, - int *error) -{ - PicturePtr pPicture; - PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen); - - pPicture = AllocatePicture (pDrawable->pScreen); - if (!pPicture) - { - *error = BadAlloc; - return 0; - } - - pPicture->id = pid; - pPicture->pDrawable = pDrawable; - pPicture->pFormat = pFormat; - pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24); - if (pDrawable->type == DRAWABLE_PIXMAP) - { - #ifdef NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - - pPicture->pDrawable = nxagentVirtualDrawable(pDrawable); - - #endif - - ++((PixmapPtr)pDrawable)->refcnt; - pPicture->pNext = 0; - } - else - { - pPicture->pNext = GetPictureWindow(((WindowPtr) pDrawable)); - SetPictureWindow(((WindowPtr) pDrawable), pPicture); - } - - SetPictureToDefaults (pPicture); - - if (vmask) - *error = ChangePicture (pPicture, vmask, vlist, 0, client); - else - *error = Success; - if (*error == Success) - *error = (*ps->CreatePicture) (pPicture); - if (*error != Success) - { - FreePicture (pPicture, (XID) 0); - pPicture = 0; - } - return pPicture; -} - -static CARD32 xRenderColorToCard32(xRenderColor c) -{ - return - (c.alpha >> 8 << 24) | - (c.red >> 8 << 16) | - (c.green & 0xff00) | - (c.blue >> 8); -} - -static unsigned int premultiply(unsigned int x) -{ - unsigned int a = x >> 24; - unsigned int t = (x & 0xff00ff) * a; - t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff) * a; - x = (x + ((x >> 8) & 0xff) + 0x80); - x &= 0xff00; - x |= t | (a << 24); - return x; -} - -static unsigned int INTERPOLATE_PIXEL_256(unsigned int x, unsigned int a, - unsigned int y, unsigned int b) -{ - CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; - t >>= 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; - x &= 0xff00ff00; - x |= t; - return x; -} - -static void initGradientColorTable(SourcePictPtr pGradient, int *error) -{ - int begin_pos, end_pos; - xFixed incr, dpos; - int pos, current_stop; - PictGradientStopPtr stops = pGradient->linear.stops; - int nstops = pGradient->linear.nstops; - - /* The position where the gradient begins and ends */ - begin_pos = (stops[0].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16; - end_pos = (stops[nstops - 1].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16; - - pos = 0; /* The position in the color table. */ - - /* Up to first point */ - while (pos <= begin_pos) { - pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[0].color); - ++pos; - } - - incr = (1<<16)/ PICT_GRADIENT_STOPTABLE_SIZE; /* the double increment. */ - dpos = incr * pos; /* The position in terms of 0-1. */ - - current_stop = 0; /* We always interpolate between current and current + 1. */ - - /* Gradient area */ - while (pos < end_pos) { - unsigned int current_color = xRenderColorToCard32(stops[current_stop].color); - unsigned int next_color = xRenderColorToCard32(stops[current_stop + 1].color); - - int dist = (int)(256*(dpos - stops[current_stop].x) - / (stops[current_stop+1].x - stops[current_stop].x)); - int idist = 256 - dist; - - pGradient->linear.colorTable[pos] = premultiply(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)); - - ++pos; - dpos += incr; - - if (dpos > stops[current_stop + 1].x) - ++current_stop; - } - - /* After last point */ - while (pos < PICT_GRADIENT_STOPTABLE_SIZE) { - pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[nstops - 1].color); - ++pos; - } -} - -static void initGradient(SourcePictPtr pGradient, int stopCount, - xFixed *stopPoints, xRenderColor *stopColors, int *error) -{ - int i; - xFixed dpos; - - if (stopCount <= 0) { - *error = BadValue; - return; - } - - dpos = -1; - for (i = 0; i < stopCount; ++i) { - if (stopPoints[i] <= dpos || stopPoints[i] > (1<<16)) { - *error = BadValue; - return; - } - dpos = stopPoints[i]; - } - - pGradient->linear.stops = xalloc(stopCount*sizeof(PictGradientStop)); - if (!pGradient->linear.stops) { - *error = BadAlloc; - return; - } - - pGradient->linear.nstops = stopCount; - - for (i = 0; i < stopCount; ++i) { - pGradient->linear.stops[i].x = stopPoints[i]; - pGradient->linear.stops[i].color = stopColors[i]; - } - initGradientColorTable(pGradient, error); -} - -static PicturePtr createSourcePicture(void) -{ - PicturePtr pPicture; - - extern int nxagentPicturePrivateIndex; - - unsigned int totalPictureSize; - - DevUnion *ppriv; - - char *privPictureRecAddr; - - int i; - - /* - * Compute size of entire PictureRect, plus privates. - */ - - totalPictureSize = sizeof(PictureRec) + - picturePrivateCount * sizeof(DevUnion) + - sizeof(nxagentPrivPictureRec); - - pPicture = (PicturePtr) xalloc(totalPictureSize); - - if (pPicture != NULL) - { - ppriv = (DevUnion *) (pPicture + 1); - - for (i = 0; i < picturePrivateCount; ++i) - { - /* - * Other privates are inaccessible. - */ - - ppriv[i].ptr = NULL; - } - - privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; - - ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr; - - pPicture -> devPrivates = ppriv; - - nxagentPicturePriv(pPicture) -> picture = 0; - } - - pPicture->pDrawable = 0; - pPicture->pFormat = 0; - pPicture->pNext = 0; - - SetPictureToDefaults(pPicture); - return pPicture; -} - -PicturePtr -CreateSolidPicture (Picture pid, xRenderColor *color, int *error) -{ - PicturePtr pPicture; - pPicture = createSourcePicture(); - if (!pPicture) { - *error = BadAlloc; - return 0; - } - - pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - xfree(pPicture); - return 0; - } - pPicture->pSourcePict->type = SourcePictTypeSolidFill; - pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color); - return pPicture; -} - -PicturePtr -CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, - int nStops, xFixed *stops, xRenderColor *colors, int *error) -{ - PicturePtr pPicture; - - if (nStops < 2) { - *error = BadValue; - return 0; - } - - pPicture = createSourcePicture(); - if (!pPicture) { - *error = BadAlloc; - return 0; - } - if (p1->x == p2->x && p1->y == p2->y) { - *error = BadValue; - return 0; - } - - pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - xfree(pPicture); - return 0; - } - - pPicture->pSourcePict->linear.type = SourcePictTypeLinear; - pPicture->pSourcePict->linear.p1 = *p1; - pPicture->pSourcePict->linear.p2 = *p2; - - initGradient(pPicture->pSourcePict, nStops, stops, colors, error); - if (*error) { - xfree(pPicture); - return 0; - } - return pPicture; -} - -#define FixedToDouble(x) ((x)/65536.) - -PicturePtr -CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer, - xFixed innerRadius, xFixed outerRadius, - int nStops, xFixed *stops, xRenderColor *colors, int *error) -{ - PicturePtr pPicture; - PictRadialGradient *radial; - - if (nStops < 2) { - *error = BadValue; - return 0; - } - - pPicture = createSourcePicture(); - if (!pPicture) { - *error = BadAlloc; - return 0; - } - { - double dx = (double)(inner->x - outer->x); - double dy = (double)(inner->y - outer->y); - if (sqrt(dx*dx + dy*dy) + (double)(innerRadius) > (double)(outerRadius)) { - *error = BadValue; - return 0; - } - } - - pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - xfree(pPicture); - return 0; - } - radial = &pPicture->pSourcePict->radial; - - radial->type = SourcePictTypeRadial; - { - double x = (double)innerRadius / (double)outerRadius; - radial->dx = (outer->x - inner->x); - radial->dy = (outer->y - inner->y); - radial->fx = (inner->x) - x*radial->dx; - radial->fy = (inner->y) - x*radial->dy; - radial->m = 1./(1+x); - radial->b = -x*radial->m; - radial->dx /= 65536.; - radial->dy /= 65536.; - radial->fx /= 65536.; - radial->fy /= 65536.; - x = outerRadius/65536.; - radial->a = x*x - radial->dx*radial->dx - radial->dy*radial->dy; - } - - initGradient(pPicture->pSourcePict, nStops, stops, colors, error); - if (*error) { - xfree(pPicture); - return 0; - } - return pPicture; -} - -PicturePtr -CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle, - int nStops, xFixed *stops, xRenderColor *colors, int *error) -{ - PicturePtr pPicture; - - if (nStops < 2) { - *error = BadValue; - return 0; - } - - pPicture = createSourcePicture(); - if (!pPicture) { - *error = BadAlloc; - return 0; - } - - pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictConicalGradient)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - xfree(pPicture); - return 0; - } - - pPicture->pSourcePict->conical.type = SourcePictTypeConical; - pPicture->pSourcePict->conical.center = *center; - pPicture->pSourcePict->conical.angle = angle; - - initGradient(pPicture->pSourcePict, nStops, stops, colors, error); - if (*error) { - xfree(pPicture); - return 0; - } - return pPicture; -} - -#define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val) - -#define NEXT_PTR(_type) ((_type) ulist++->ptr) - -int -ChangePicture (PicturePtr pPicture, - Mask vmask, - XID *vlist, - DevUnion *ulist, - ClientPtr client) -{ - ScreenPtr pScreen = pPicture->pDrawable ? pPicture->pDrawable->pScreen : 0; - PictureScreenPtr ps = pScreen ? GetPictureScreen(pScreen) : 0; - BITS32 index2; - int error = 0; - BITS32 maskQ; - - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - maskQ = vmask; - while (vmask && !error) - { - index2 = (BITS32) lowbit (vmask); - vmask &= ~index2; - pPicture->stateChanges |= index2; - switch (index2) - { - case CPRepeat: - { - unsigned int newr; - newr = NEXT_VAL(unsigned int); - if (newr <= RepeatReflect) - { - pPicture->repeat = (newr != RepeatNone); - pPicture->repeatType = newr; - } - else - { - client->errorValue = newr; - error = BadValue; - } - } - break; - case CPAlphaMap: - { - PicturePtr pAlpha; - - if (vlist) - { - Picture pid = NEXT_VAL(Picture); - - if (pid == None) - pAlpha = 0; - else - { - pAlpha = (PicturePtr) SecurityLookupIDByType(client, - pid, - PictureType, - SecurityWriteAccess|SecurityReadAccess); - if (!pAlpha) - { - client->errorValue = pid; - error = BadPixmap; - break; - } - if (pAlpha->pDrawable->type != DRAWABLE_PIXMAP) - { - client->errorValue = pid; - error = BadMatch; - break; - } - } - } - else - pAlpha = NEXT_PTR(PicturePtr); - if (!error) - { - if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP) - pAlpha->refcnt++; - if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); - pPicture->alphaMap = pAlpha; - } - } - break; - case CPAlphaXOrigin: - pPicture->alphaOrigin.x = NEXT_VAL(INT16); - break; - case CPAlphaYOrigin: - pPicture->alphaOrigin.y = NEXT_VAL(INT16); - break; - case CPClipXOrigin: - pPicture->clipOrigin.x = NEXT_VAL(INT16); - break; - case CPClipYOrigin: - pPicture->clipOrigin.y = NEXT_VAL(INT16); - break; - case CPClipMask: - { - Pixmap pid; - PixmapPtr pPixmap; - int clipType; - if (!pScreen) - return BadDrawable; - - if (vlist) - { - pid = NEXT_VAL(Pixmap); - if (pid == None) - { - clipType = CT_NONE; - pPixmap = NullPixmap; - } - else - { - clipType = CT_PIXMAP; - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - pid, - RT_PIXMAP, - SecurityReadAccess); - if (!pPixmap) - { - client->errorValue = pid; - error = BadPixmap; - break; - } - } - } - else - { - pPixmap = NEXT_PTR(PixmapPtr); - if (pPixmap) - clipType = CT_PIXMAP; - else - clipType = CT_NONE; - } - - if (pPixmap) - { - if ((pPixmap->drawable.depth != 1) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - break; - } - else - { - clipType = CT_PIXMAP; - pPixmap->refcnt++; - } - } - - #ifdef DEBUG - fprintf(stderr, "ChangePicture: Going to call ChangePictureClip with clipType [%d] pPixmap [%p].\n", - clipType, (void *) pPixmap); - #endif - - error = (*ps->ChangePictureClip)(pPicture, clipType, - (pointer)pPixmap, 0); - break; - } - case CPGraphicsExposure: - { - unsigned int newe; - newe = NEXT_VAL(unsigned int); - if (newe <= xTrue) - pPicture->graphicsExposures = newe; - else - { - client->errorValue = newe; - error = BadValue; - } - } - break; - case CPSubwindowMode: - { - unsigned int news; - news = NEXT_VAL(unsigned int); - if (news == ClipByChildren || news == IncludeInferiors) - pPicture->subWindowMode = news; - else - { - client->errorValue = news; - error = BadValue; - } - } - break; - case CPPolyEdge: - { - unsigned int newe; - newe = NEXT_VAL(unsigned int); - if (newe == PolyEdgeSharp || newe == PolyEdgeSmooth) - pPicture->polyEdge = newe; - else - { - client->errorValue = newe; - error = BadValue; - } - } - break; - case CPPolyMode: - { - unsigned int newm; - newm = NEXT_VAL(unsigned int); - if (newm == PolyModePrecise || newm == PolyModeImprecise) - pPicture->polyMode = newm; - else - { - client->errorValue = newm; - error = BadValue; - } - } - break; - case CPDither: - pPicture->dither = NEXT_VAL(Atom); - break; - case CPComponentAlpha: - { - unsigned int newca; - - newca = NEXT_VAL (unsigned int); - if (newca <= xTrue) - pPicture->componentAlpha = newca; - else - { - client->errorValue = newca; - error = BadValue; - } - } - break; - default: - client->errorValue = maskQ; - error = BadValue; - break; - } - } - if (ps) - (*ps->ChangePicture) (pPicture, maskQ); - return error; -} - -int -SetPictureClipRects (PicturePtr pPicture, - int xOrigin, - int yOrigin, - int nRect, - xRectangle *rects) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - RegionPtr clientClip; - int result; - - clientClip = RECTS_TO_REGION(pScreen, - nRect, rects, CT_UNSORTED); - if (!clientClip) - return BadAlloc; - result =(*ps->ChangePictureClip) (pPicture, CT_REGION, - (pointer) clientClip, 0); - if (result == Success) - { - pPicture->clipOrigin.x = xOrigin; - pPicture->clipOrigin.y = yOrigin; - pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask; - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - } - return result; -} - -int -SetPictureClipRegion (PicturePtr pPicture, - int xOrigin, - int yOrigin, - RegionPtr pRegion) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - RegionPtr clientClip; - int result; - int type; - - if (pRegion) - { - type = CT_REGION; - clientClip = REGION_CREATE (pScreen, - REGION_EXTENTS(pScreen, pRegion), - REGION_NUM_RECTS(pRegion)); - if (!clientClip) - return BadAlloc; - if (!REGION_COPY (pSCreen, clientClip, pRegion)) - { - REGION_DESTROY (pScreen, clientClip); - return BadAlloc; - } - } - else - { - type = CT_NONE; - clientClip = 0; - } - - result =(*ps->ChangePictureClip) (pPicture, type, - (pointer) clientClip, 0); - if (result == Success) - { - pPicture->clipOrigin.x = xOrigin; - pPicture->clipOrigin.y = yOrigin; - pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask; - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - } - return result; -} - - -int -SetPictureTransform (PicturePtr pPicture, - PictTransform *transform) -{ - static const PictTransform identity = { { - { xFixed1, 0x00000, 0x00000 }, - { 0x00000, xFixed1, 0x00000 }, - { 0x00000, 0x00000, xFixed1 }, - } }; - - if (transform && memcmp (transform, &identity, sizeof (PictTransform)) == 0) - transform = 0; - - if (transform) - { - if (!pPicture->transform) - { - pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform)); - if (!pPicture->transform) - return BadAlloc; - } - *pPicture->transform = *transform; - } - else - { - if (pPicture->transform) - { - xfree (pPicture->transform); - pPicture->transform = 0; - } - } - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - - return Success; -} - -void -CopyPicture (PicturePtr pSrc, - Mask mask, - PicturePtr pDst) -{ - PictureScreenPtr ps = GetPictureScreen(pSrc->pDrawable->pScreen); - Mask origMask = mask; - - pDst->serialNumber |= GC_CHANGE_SERIAL_BIT; - pDst->stateChanges |= mask; - - while (mask) { - Mask bit = lowbit(mask); - - switch (bit) - { - case CPRepeat: - pDst->repeat = pSrc->repeat; - pDst->repeatType = pSrc->repeatType; - break; - case CPAlphaMap: - if (pSrc->alphaMap && pSrc->alphaMap->pDrawable->type == DRAWABLE_PIXMAP) - pSrc->alphaMap->refcnt++; - if (pDst->alphaMap) - FreePicture ((pointer) pDst->alphaMap, (XID) 0); - pDst->alphaMap = pSrc->alphaMap; - break; - case CPAlphaXOrigin: - pDst->alphaOrigin.x = pSrc->alphaOrigin.x; - break; - case CPAlphaYOrigin: - pDst->alphaOrigin.y = pSrc->alphaOrigin.y; - break; - case CPClipXOrigin: - pDst->clipOrigin.x = pSrc->clipOrigin.x; - break; - case CPClipYOrigin: - pDst->clipOrigin.y = pSrc->clipOrigin.y; - break; - case CPClipMask: - switch (pSrc->clientClipType) { - case CT_NONE: - (*ps->ChangePictureClip)(pDst, CT_NONE, NULL, 0); - break; - case CT_REGION: - if (!pSrc->clientClip) { - (*ps->ChangePictureClip)(pDst, CT_NONE, NULL, 0); - } else { - RegionPtr clientClip; - RegionPtr srcClientClip = (RegionPtr)pSrc->clientClip; - - clientClip = REGION_CREATE(pSrc->pDrawable->pScreen, - REGION_EXTENTS(pSrc->pDrawable->pScreen, srcClientClip), - REGION_NUM_RECTS(srcClientClip)); - (*ps->ChangePictureClip)(pDst, CT_REGION, clientClip, 0); - } - break; - default: - /* XXX: CT_PIXMAP unimplemented */ - break; - } - break; - case CPGraphicsExposure: - pDst->graphicsExposures = pSrc->graphicsExposures; - break; - case CPPolyEdge: - pDst->polyEdge = pSrc->polyEdge; - break; - case CPPolyMode: - pDst->polyMode = pSrc->polyMode; - break; - case CPDither: - pDst->dither = pSrc->dither; - break; - case CPComponentAlpha: - pDst->componentAlpha = pSrc->componentAlpha; - break; - } - mask &= ~bit; - } - - (*ps->ChangePicture)(pDst, origMask); -} - -static void -ValidateOnePicture (PicturePtr pPicture) -{ - if (pPicture->pDrawable && pPicture->serialNumber != pPicture->pDrawable->serialNumber) - { - PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen); - - (*ps->ValidatePicture) (pPicture, pPicture->stateChanges); - pPicture->stateChanges = 0; - pPicture->serialNumber = pPicture->pDrawable->serialNumber; - } -} - -void -ValidatePicture(PicturePtr pPicture) -{ - ValidateOnePicture (pPicture); - if (pPicture->alphaMap) - ValidateOnePicture (pPicture->alphaMap); -} - -int -FreePicture (pointer value, - XID pid) -{ - PicturePtr pPicture = (PicturePtr) value; - - if (--pPicture->refcnt == 0) - { -#ifdef NXAGENT_SERVER - nxagentDestroyPicture(pPicture); -#endif - - if (pPicture->transform) - xfree (pPicture->transform); - if (!pPicture->pDrawable) { - if (pPicture->pSourcePict) { - if (pPicture->pSourcePict->type != SourcePictTypeSolidFill) - xfree(pPicture->pSourcePict->linear.stops); - xfree(pPicture->pSourcePict); - } - } else { - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); - (*ps->DestroyPicture) (pPicture); - (*ps->DestroyPictureClip) (pPicture); - if (pPicture->pDrawable->type == DRAWABLE_WINDOW) - { - WindowPtr pWindow = (WindowPtr) pPicture->pDrawable; - PicturePtr *pPrev; - - for (pPrev = (PicturePtr *) &((pWindow)->devPrivates[PictureWindowPrivateIndex].ptr); - *pPrev; - pPrev = &(*pPrev)->pNext) - { - if (*pPrev == pPicture) - { - *pPrev = pPicture->pNext; - break; - } - } - } - else if (pPicture->pDrawable->type == DRAWABLE_PIXMAP) - { - (*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable); - } - } - xfree (pPicture); - } - return Success; -} - -int -FreePictFormat (pointer pPictFormat, - XID pid) -{ - return Success; -} - -void -CompositePicture (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - if (pMask) - ValidatePicture (pMask); - ValidatePicture (pDst); - (*ps->Composite) (op, - pSrc, - pMask, - pDst, - xSrc, - ySrc, - xMask, - yMask, - xDst, - yDst, - width, - height); -} - -void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr lists, - GlyphPtr *glyphs) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - - #ifdef TEST - fprintf(stderr, "CompositeGlyphs: Going to composite glyphs with " - "source at [%p] and destination at [%p].\n", - (void *) pSrc, (void *) pDst); - #endif - - (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs); -} - -void -CompositeRects (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pDst); - (*ps->CompositeRects) (op, pDst, color, nRect, rects); -} - -void -CompositeTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Trapezoids) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps); -} - -void -CompositeTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntriangles, - xTriangle *triangles) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntriangles, triangles); -} - -void -CompositeTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); -} - -void -CompositeTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); -} - -void -AddTraps (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntrap, - xTrap *traps) -{ - PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen); - - ValidatePicture (pPicture); - (*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps); -} - -#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff) -#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31)) - -Bool -PictureTransformPoint3d (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - *vector = result; - return TRUE; -} - - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - for (j = 0; j < 2; j++) - { - partial = (xFixed_48_16) result.vector[j] << 16; - v = partial / result.vector[2]; - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - vector->vector[j] = (xFixed) v; - } - vector->vector[2] = xFixed1; - return TRUE; -} - -#ifndef True -# define True 1 -#endif - -#ifndef False -# define False 0 -#endif - -void nxagentReconnectPictFormat(void*, XID, void*); - -Bool nxagentReconnectAllPictFormat(void *p) -{ - PictFormatPtr formats_old, formats; - int nformats, nformats_old; - VisualPtr pVisual; - Bool success = True; - Bool matched; - int i, n; - CARD32 type, a, r, g, b; - - #if defined(NXAGENT_RECONNECT_DEBUG) || defined(NXAGENT_RECONNECT_PICTFORMAT_DEBUG) - fprintf(stderr, "nxagentReconnectAllPictFormat\n"); - #endif - - formats_old = GetPictureScreen(nxagentDefaultScreen) -> formats; - nformats_old = GetPictureScreen(nxagentDefaultScreen) -> nformats; - - /* - * TODO: We could copy PictureCreateDefaultFormats, - * in order not to waste ID with FakeClientID(). - */ - formats = PictureCreateDefaultFormats (nxagentDefaultScreen, &nformats); - - if (!formats) - return False; - - for (n = 0; n < nformats; n++) - { - if (formats[n].type == PictTypeIndexed) - { - pVisual = nxagentVisualFromID(nxagentDefaultScreen, formats[n].index.vid); - - if ((pVisual->class | DynamicClass) == PseudoColor) - type = PICT_TYPE_COLOR; - else - type = PICT_TYPE_GRAY; - a = r = g = b = 0; - } - else - { - if ((formats[n].direct.redMask| - formats[n].direct.blueMask| - formats[n].direct.greenMask) == 0) - type = PICT_TYPE_A; - else if (formats[n].direct.red > formats[n].direct.blue) - type = PICT_TYPE_ARGB; - else - type = PICT_TYPE_ABGR; - a = Ones (formats[n].direct.alphaMask); - r = Ones (formats[n].direct.redMask); - g = Ones (formats[n].direct.greenMask); - b = Ones (formats[n].direct.blueMask); - } - formats[n].format = PICT_FORMAT(0,type,a,r,g,b); - } - - for (n = 0; n < nformats_old; n++) - { - for (i = 0, matched = False; (!matched) && (i < nformats); i++) - { - if (formats_old[n].format == formats[i].format && - formats_old[n].type == formats[i].type && - formats_old[n].direct.red == formats[i].direct.red && - formats_old[n].direct.green == formats[i].direct.green && - formats_old[n].direct.blue == formats[i].direct.blue && - formats_old[n].direct.redMask == formats[i].direct.redMask && - formats_old[n].direct.greenMask == formats[i].direct.greenMask && - formats_old[n].direct.blueMask == formats[i].direct.blueMask && - formats_old[n].direct.alpha == formats[i].direct.alpha && - formats_old[n].direct.alphaMask == formats[i].direct.alphaMask) - { - /* - * Regard depth 16 and 15 as were the same, if all other values match. - */ - - if ((formats_old[n].depth == formats[i].depth) || - ((formats_old[n].depth == 15 || formats_old[n].depth == 16) && - (formats[i].depth == 15 || formats[i].depth == 16))) - { - matched = True; - } - } - } - - if (!matched) - { - return False; - } - } - - xfree(formats); - - /* TODO: Perhaps do i have to do PictureFinishInit ?. */ - /* TODO: We have to check for new Render protocol version. */ - - for (i = 0; (i < MAXCLIENTS) && (success); i++) - { - if (clients[i]) - { - FindClientResourcesByType(clients[i], PictFormatType, nxagentReconnectPictFormat, &success); - } - } - - return success; -} - -/* - * It seem we don't have nothing - * to do for reconnect PictureFormat. - */ - -void nxagentReconnectPictFormat(void *p0, XID x1, void *p2) -{ - PictFormatPtr pFormat; - Bool *pBool; - - pFormat = (PictFormatPtr)p0; - pBool = (Bool*)p2; - - #if defined(NXAGENT_RECONNECT_DEBUG) || defined(NXAGENT_RECONNECT_PICTFORMAT_DEBUG) - fprintf(stderr, "nxagentReconnectPictFormat.\n"); - #endif -} - -/* - * The set of picture formats may change considerably - * between different X servers. This poses a problem - * while migrating NX sessions, because a requisite to - * successfully reconnect the session is that all pic- - * ture formats have to be available on the new X server. - * To reduce such problems, we use a limited set of - * pictures available on the most X servers. - */ - -void nxagentPictureCreateDefaultFormats(ScreenPtr pScreen, FormatInitRec *formats, int *nformats) -{ - DepthPtr pDepth; - VisualPtr pVisual; - - CARD32 format; - CARD8 depth; - - int r, g, b; - int bpp; - int d; - int v; - - - formats[*nformats].format = PICT_a1; - formats[*nformats].depth = 1; - *nformats += 1; - formats[*nformats].format = PICT_a4; - formats[*nformats].depth = 4; - *nformats += 1; - formats[*nformats].format = PICT_a8; - formats[*nformats].depth = 8; - *nformats += 1; - formats[*nformats].format = PICT_a8r8g8b8; - formats[*nformats].depth = 32; - *nformats += 1; - - /* - * This format should be required by the - * protocol, but it's not used by Xgl. - * - * formats[*nformats].format = PICT_x8r8g8b8; - * formats[*nformats].depth = 32; - * *nformats += 1; - */ - - /* now look through the depths and visuals adding other formats */ - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = &pScreen->visuals[v]; - depth = visualDepth (pScreen, pVisual); - if (!depth) - continue; - - bpp = BitsPerPixel (depth); - - switch (pVisual->class) - { - case DirectColor: - case TrueColor: - r = Ones (pVisual->redMask); - g = Ones (pVisual->greenMask); - b = Ones (pVisual->blueMask); - - if (pVisual->offsetBlue == 0 && - pVisual->offsetGreen == b && - pVisual->offsetRed == b + g) - { - format = PICT_FORMAT(bpp, PICT_TYPE_ARGB, 0, r, g, b); - *nformats = addFormat (formats, *nformats, format, depth); - } - break; - case StaticColor: - case PseudoColor: - case StaticGray: - case GrayScale: - break; - } - } - - for (d = 0; d < pScreen -> numDepths; d++) - { - pDepth = &pScreen -> allowedDepths[d]; - bpp = BitsPerPixel(pDepth -> depth); - - switch (bpp) { - case 16: - if (pDepth->depth == 15) - { - *nformats = addFormat (formats, *nformats, - PICT_x1r5g5b5, pDepth->depth); - } - - if (pDepth->depth == 16) - { - *nformats = addFormat (formats, *nformats, - PICT_r5g6b5, pDepth->depth); - } - break; - case 24: - if (pDepth->depth == 24) - { - *nformats = addFormat (formats, *nformats, - PICT_r8g8b8, pDepth->depth); - } - break; - case 32: - if (pDepth->depth == 24) - { - *nformats = addFormat (formats, *nformats, - PICT_x8r8g8b8, pDepth->depth); - } - break; - } - } -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.X.original deleted file mode 100644 index 3ed60310e..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.X.original +++ /dev/null @@ -1,1864 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/picture.c,v 1.29 2002/11/23 02:38:15 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "picturestr.h" - -int PictureScreenPrivateIndex = -1; -int PictureWindowPrivateIndex; -int PictureGeneration; -RESTYPE PictureType; -RESTYPE PictFormatType; -RESTYPE GlyphSetType; -int PictureCmapPolicy = PictureCmapPolicyDefault; - -/* Picture Private machinery */ - -static int picturePrivateCount; - -void -ResetPicturePrivateIndex (void) -{ - picturePrivateCount = 0; -} - -int -AllocatePicturePrivateIndex (void) -{ - return picturePrivateCount++; -} - -Bool -AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - unsigned int oldamount; - - /* Round up sizes for proper alignment */ - amount = ((amount + (sizeof(long) - 1)) / sizeof(long)) * sizeof(long); - - if (index2 >= ps->PicturePrivateLen) - { - unsigned int *nsizes; - - nsizes = (unsigned int *)xrealloc(ps->PicturePrivateSizes, - (index2 + 1) * sizeof(unsigned int)); - if (!nsizes) - return FALSE; - while (ps->PicturePrivateLen <= index2) - { - nsizes[ps->PicturePrivateLen++] = 0; - ps->totalPictureSize += sizeof(DevUnion); - } - ps->PicturePrivateSizes = nsizes; - } - oldamount = ps->PicturePrivateSizes[index2]; - if (amount > oldamount) - { - ps->PicturePrivateSizes[index2] = amount; - ps->totalPictureSize += (amount - oldamount); - } - - return TRUE; -} - - -Bool -PictureDestroyWindow (WindowPtr pWindow) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - PicturePtr pPicture; - PictureScreenPtr ps = GetPictureScreen(pScreen); - Bool ret; - - while ((pPicture = GetPictureWindow(pWindow))) - { - SetPictureWindow(pWindow, pPicture->pNext); - if (pPicture->id) - FreeResource (pPicture->id, PictureType); - FreePicture ((pointer) pPicture, pPicture->id); - } - pScreen->DestroyWindow = ps->DestroyWindow; - ret = (*pScreen->DestroyWindow) (pWindow); - ps->DestroyWindow = pScreen->DestroyWindow; - pScreen->DestroyWindow = PictureDestroyWindow; - return ret; -} - -Bool -PictureCloseScreen (int index, ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - Bool ret; - int n; - - pScreen->CloseScreen = ps->CloseScreen; - ret = (*pScreen->CloseScreen) (index, pScreen); - PictureResetFilters (pScreen); - for (n = 0; n < ps->nformats; n++) - if (ps->formats[n].type == PictTypeIndexed) - (*ps->CloseIndexed) (pScreen, &ps->formats[n]); - SetPictureScreen(pScreen, 0); - if (ps->PicturePrivateSizes) - xfree (ps->PicturePrivateSizes); - xfree (ps->formats); - xfree (ps); - return ret; -} - -void -PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef) -{ - ScreenPtr pScreen = pColormap->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - pScreen->StoreColors = ps->StoreColors; - (*pScreen->StoreColors) (pColormap, ndef, pdef); - ps->StoreColors = pScreen->StoreColors; - pScreen->StoreColors = PictureStoreColors; - - if (pColormap->class == PseudoColor || pColormap->class == GrayScale) - { - PictFormatPtr format = ps->formats; - int nformats = ps->nformats; - - while (nformats--) - { - if (format->type == PictTypeIndexed && - format->index.pColormap == pColormap) - { - (*ps->UpdateIndexed) (pScreen, format, ndef, pdef); - break; - } - format++; - } - } -} - -static int -visualDepth (ScreenPtr pScreen, VisualPtr pVisual) -{ - int d, v; - DepthPtr pDepth; - - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = &pScreen->allowedDepths[d]; - for (v = 0; v < pDepth->numVids; v++) - if (pDepth->vids[v] == pVisual->vid) - return pDepth->depth; - } - return 0; -} - -typedef struct _formatInit { - CARD32 format; - CARD8 depth; -} FormatInitRec, *FormatInitPtr; - -static int -addFormat (FormatInitRec formats[256], - int nformat, - CARD32 format, - CARD8 depth) -{ - int n; - - for (n = 0; n < nformat; n++) - if (formats[n].format == format && formats[n].depth == depth) - return nformat; - formats[nformat].format = format; - formats[nformat].depth = depth; - return ++nformat; -} - -#define Mask(n) ((n) == 32 ? 0xffffffff : ((1 << (n))-1)) - -PictFormatPtr -PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) -{ - int nformats, f; - PictFormatPtr pFormats; - FormatInitRec formats[1024]; - CARD32 format; - CARD8 depth; - VisualPtr pVisual; - int v; - int bpp; - int type; - int r, g, b; - int d; - DepthPtr pDepth; - - nformats = 0; - /* formats required by protocol */ - formats[nformats].format = PICT_a1; - formats[nformats].depth = 1; - nformats++; - formats[nformats].format = PICT_a8; - formats[nformats].depth = 8; - nformats++; - formats[nformats].format = PICT_a4; - formats[nformats].depth = 4; - nformats++; - formats[nformats].format = PICT_a8r8g8b8; - formats[nformats].depth = 32; - nformats++; - formats[nformats].format = PICT_x8r8g8b8; - formats[nformats].depth = 32; - nformats++; - - /* now look through the depths and visuals adding other formats */ - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = &pScreen->visuals[v]; - depth = visualDepth (pScreen, pVisual); - if (!depth) - continue; - bpp = BitsPerPixel (depth); - switch (pVisual->class) { - case DirectColor: - case TrueColor: - r = Ones (pVisual->redMask); - g = Ones (pVisual->greenMask); - b = Ones (pVisual->blueMask); - type = PICT_TYPE_OTHER; - /* - * Current rendering code supports only two direct formats, - * fields must be packed together at the bottom of the pixel - * and must be either RGB or BGR - */ - if (pVisual->offsetBlue == 0 && - pVisual->offsetGreen == b && - pVisual->offsetRed == b + g) - { - type = PICT_TYPE_ARGB; - } - else if (pVisual->offsetRed == 0 && - pVisual->offsetGreen == r && - pVisual->offsetBlue == r + g) - { - type = PICT_TYPE_ABGR; - } - if (type != PICT_TYPE_OTHER) - { - format = PICT_FORMAT(bpp, type, 0, r, g, b); - nformats = addFormat (formats, nformats, format, depth); - } - break; - case StaticColor: - case PseudoColor: - format = PICT_VISFORMAT (bpp, PICT_TYPE_COLOR, v); - nformats = addFormat (formats, nformats, format, depth); - break; - case StaticGray: - case GrayScale: - format = PICT_VISFORMAT (bpp, PICT_TYPE_GRAY, v); - nformats = addFormat (formats, nformats, format, depth); - break; - } - } - /* - * Walk supported depths and add useful Direct formats - */ - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = &pScreen->allowedDepths[d]; - bpp = BitsPerPixel (pDepth->depth); - format = 0; - switch (bpp) { - case 16: - /* depth 12 formats */ - if (pDepth->depth >= 12) - { - nformats = addFormat (formats, nformats, - PICT_x4r4g4b4, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x4b4g4r4, pDepth->depth); - } - /* depth 15 formats */ - if (pDepth->depth >= 15) - { - nformats = addFormat (formats, nformats, - PICT_x1r5g5b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x1b5g5r5, pDepth->depth); - } - /* depth 16 formats */ - if (pDepth->depth >= 16) - { - nformats = addFormat (formats, nformats, - PICT_a1r5g5b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a1b5g5r5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_r5g6b5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_b5g6r5, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a4r4g4b4, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_a4b4g4r4, pDepth->depth); - } - break; - case 24: - if (pDepth->depth >= 24) - { - nformats = addFormat (formats, nformats, - PICT_r8g8b8, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_b8g8r8, pDepth->depth); - } - break; - case 32: - if (pDepth->depth >= 24) - { - nformats = addFormat (formats, nformats, - PICT_x8r8g8b8, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_x8b8g8r8, pDepth->depth); - } - break; - } - } - - - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); - if (!pFormats) - return 0; - memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); - for (f = 0; f < nformats; f++) - { - pFormats[f].id = FakeClientID (0); - pFormats[f].depth = formats[f].depth; - format = formats[f].format; - pFormats[f].format = format; - switch (PICT_FORMAT_TYPE(format)) { - case PICT_TYPE_ARGB: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - if (pFormats[f].direct.alphaMask) - pFormats[f].direct.alpha = (PICT_FORMAT_R(format) + - PICT_FORMAT_G(format) + - PICT_FORMAT_B(format)); - - pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format)); - pFormats[f].direct.red = (PICT_FORMAT_G(format) + - PICT_FORMAT_B(format)); - - pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format)); - pFormats[f].direct.green = PICT_FORMAT_B(format); - - pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format)); - pFormats[f].direct.blue = 0; - break; - - case PICT_TYPE_ABGR: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - if (pFormats[f].direct.alphaMask) - pFormats[f].direct.alpha = (PICT_FORMAT_B(format) + - PICT_FORMAT_G(format) + - PICT_FORMAT_R(format)); - - pFormats[f].direct.blueMask = Mask(PICT_FORMAT_B(format)); - pFormats[f].direct.blue = (PICT_FORMAT_G(format) + - PICT_FORMAT_R(format)); - - pFormats[f].direct.greenMask = Mask(PICT_FORMAT_G(format)); - pFormats[f].direct.green = PICT_FORMAT_R(format); - - pFormats[f].direct.redMask = Mask(PICT_FORMAT_R(format)); - pFormats[f].direct.red = 0; - break; - - case PICT_TYPE_A: - pFormats[f].type = PictTypeDirect; - - pFormats[f].direct.alpha = 0; - pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); - - /* remaining fields already set to zero */ - break; - - case PICT_TYPE_COLOR: - case PICT_TYPE_GRAY: - pFormats[f].type = PictTypeIndexed; - pFormats[f].index.vid = pScreen->visuals[PICT_FORMAT_VIS(format)].vid; - break; - } - } - *nformatp = nformats; - return pFormats; -} - -static VisualPtr -PictureFindVisual (ScreenPtr pScreen, VisualID visual) -{ - int i; - VisualPtr pVisual; - for (i = 0, pVisual = pScreen->visuals; - i < pScreen->numVisuals; - i++, pVisual++) - { - if (pVisual->vid == visual) - return pVisual; - } - return 0; -} - -Bool -PictureInitIndexedFormats (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - - if (!ps) - return FALSE; - format = ps->formats; - nformat = ps->nformats; - while (nformat--) - { - if (format->type == PictTypeIndexed && !format->index.pColormap) - { - if (format->index.vid == pScreen->rootVisual) - format->index.pColormap = (ColormapPtr) LookupIDByType(pScreen->defColormap, - RT_COLORMAP); - else - { - VisualPtr pVisual; - - pVisual = PictureFindVisual (pScreen, format->index.vid); - if (CreateColormap (FakeClientID (0), pScreen, - pVisual, - &format->index.pColormap, AllocNone, - 0) != Success) - { - return FALSE; - } - } - if (!(*ps->InitIndexed) (pScreen, format)) - return FALSE; - } - format++; - } - return TRUE; -} - -Bool -PictureFinishInit (void) -{ - int s; - - for (s = 0; s < screenInfo.numScreens; s++) - { - if (!PictureInitIndexedFormats (screenInfo.screens[s])) - return FALSE; - (void) AnimCurInit (screenInfo.screens[s]); - } - - return TRUE; -} - -Bool -PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - if (!ps) - return FALSE; - ps->subpixel = subpixel; - return TRUE; - -} - -int -PictureGetSubpixelOrder (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - if (!ps) - return SubPixelUnknown; - return ps->subpixel; -} - -PictFormatPtr -PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - int type; - - if (!ps) - return 0; - format = ps->formats; - nformat = ps->nformats; - switch (pVisual->class) { - case StaticGray: - case GrayScale: - case StaticColor: - case PseudoColor: - type = PictTypeIndexed; - break; - case TrueColor: - case DirectColor: - type = PictTypeDirect; - break; - default: - return 0; - } - while (nformat--) - { - if (format->depth == depth && format->type == type) - { - if (type == PictTypeIndexed) - { - if (format->index.vid == pVisual->vid) - return format; - } - else - { - if (format->direct.redMask << format->direct.red == - pVisual->redMask && - format->direct.greenMask << format->direct.green == - pVisual->greenMask && - format->direct.blueMask << format->direct.blue == - pVisual->blueMask) - { - return format; - } - } - } - format++; - } - return 0; -} - -PictFormatPtr -PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 f) -{ - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - PictFormatPtr format; - int nformat; - - if (!ps) - return 0; - format = ps->formats; - nformat = ps->nformats; - while (nformat--) - { - if (format->depth == depth && format->format == (f & 0xffffff)) - return format; - format++; - } - return 0; -} - -int -PictureParseCmapPolicy (const char *name) -{ - if ( strcmp (name, "default" ) == 0) - return PictureCmapPolicyDefault; - else if ( strcmp (name, "mono" ) == 0) - return PictureCmapPolicyMono; - else if ( strcmp (name, "gray" ) == 0) - return PictureCmapPolicyGray; - else if ( strcmp (name, "color" ) == 0) - return PictureCmapPolicyColor; - else if ( strcmp (name, "all" ) == 0) - return PictureCmapPolicyAll; - else - return PictureCmapPolicyInvalid; -} - -Bool -PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) -{ - PictureScreenPtr ps; - int n; - CARD32 type, a, r, g, b; - - if (PictureGeneration != serverGeneration) - { - PictureType = CreateNewResourceType (FreePicture); - if (!PictureType) - return FALSE; - PictFormatType = CreateNewResourceType (FreePictFormat); - if (!PictFormatType) - return FALSE; - GlyphSetType = CreateNewResourceType (FreeGlyphSet); - if (!GlyphSetType) - return FALSE; - PictureScreenPrivateIndex = AllocateScreenPrivateIndex(); - if (PictureScreenPrivateIndex < 0) - return FALSE; - PictureWindowPrivateIndex = AllocateWindowPrivateIndex(); - PictureGeneration = serverGeneration; -#ifdef XResExtension - RegisterResourceName (PictureType, "PICTURE"); - RegisterResourceName (PictFormatType, "PICTFORMAT"); - RegisterResourceName (GlyphSetType, "GLYPHSET"); -#endif - } - if (!AllocateWindowPrivate (pScreen, PictureWindowPrivateIndex, 0)) - return FALSE; - - if (!formats) - { - formats = PictureCreateDefaultFormats (pScreen, &nformats); - if (!formats) - return FALSE; - } - for (n = 0; n < nformats; n++) - { - if (!AddResource (formats[n].id, PictFormatType, (pointer) (formats+n))) - { - xfree (formats); - return FALSE; - } - if (formats[n].type == PictTypeIndexed) - { - VisualPtr pVisual = PictureFindVisual (pScreen, formats[n].index.vid); - if ((pVisual->class | DynamicClass) == PseudoColor) - type = PICT_TYPE_COLOR; - else - type = PICT_TYPE_GRAY; - a = r = g = b = 0; - } - else - { - if ((formats[n].direct.redMask| - formats[n].direct.blueMask| - formats[n].direct.greenMask) == 0) - type = PICT_TYPE_A; - else if (formats[n].direct.red > formats[n].direct.blue) - type = PICT_TYPE_ARGB; - else - type = PICT_TYPE_ABGR; - a = Ones (formats[n].direct.alphaMask); - r = Ones (formats[n].direct.redMask); - g = Ones (formats[n].direct.greenMask); - b = Ones (formats[n].direct.blueMask); - } - formats[n].format = PICT_FORMAT(0,type,a,r,g,b); - } - ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec)); - if (!ps) - { - xfree (formats); - return FALSE; - } - SetPictureScreen(pScreen, ps); - if (!GlyphInit (pScreen)) - { - SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); - return FALSE; - } - - ps->totalPictureSize = sizeof (PictureRec); - ps->PicturePrivateSizes = 0; - ps->PicturePrivateLen = 0; - - ps->formats = formats; - ps->fallback = formats; - ps->nformats = nformats; - - ps->filters = 0; - ps->nfilters = 0; - ps->filterAliases = 0; - ps->nfilterAliases = 0; - - ps->subpixel = SubPixelUnknown; - - ps->CloseScreen = pScreen->CloseScreen; - ps->DestroyWindow = pScreen->DestroyWindow; - ps->StoreColors = pScreen->StoreColors; - pScreen->DestroyWindow = PictureDestroyWindow; - pScreen->CloseScreen = PictureCloseScreen; - pScreen->StoreColors = PictureStoreColors; - - if (!PictureSetDefaultFilters (pScreen)) - { - PictureResetFilters (pScreen); - SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); - return FALSE; - } - - return TRUE; -} - -void -SetPictureToDefaults (PicturePtr pPicture) -{ - pPicture->refcnt = 1; - pPicture->repeat = 0; - pPicture->graphicsExposures = FALSE; - pPicture->subWindowMode = ClipByChildren; - pPicture->polyEdge = PolyEdgeSharp; - pPicture->polyMode = PolyModePrecise; - pPicture->freeCompClip = FALSE; - pPicture->clientClipType = CT_NONE; - pPicture->componentAlpha = FALSE; - pPicture->repeatType = RepeatNone; - - pPicture->alphaMap = 0; - pPicture->alphaOrigin.x = 0; - pPicture->alphaOrigin.y = 0; - - pPicture->clipOrigin.x = 0; - pPicture->clipOrigin.y = 0; - pPicture->clientClip = 0; - - pPicture->transform = 0; - - pPicture->dither = None; - pPicture->filter = PictureGetFilterId (FilterNearest, -1, TRUE); - pPicture->filter_params = 0; - pPicture->filter_nparams = 0; - - pPicture->serialNumber = GC_CHANGE_SERIAL_BIT; - pPicture->stateChanges = (1 << (CPLastBit+1)) - 1; - pPicture->pSourcePict = 0; -} - -PicturePtr -AllocatePicture (ScreenPtr pScreen) -{ - PictureScreenPtr ps = GetPictureScreen(pScreen); - PicturePtr pPicture; - char *ptr; - DevUnion *ppriv; - unsigned int *sizes; - unsigned int size; - int i; - - pPicture = (PicturePtr) xalloc (ps->totalPictureSize); - if (!pPicture) - return 0; - ppriv = (DevUnion *)(pPicture + 1); - pPicture->devPrivates = ppriv; - sizes = ps->PicturePrivateSizes; - ptr = (char *)(ppriv + ps->PicturePrivateLen); - for (i = ps->PicturePrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - return pPicture; -} - -PicturePtr -CreatePicture (Picture pid, - DrawablePtr pDrawable, - PictFormatPtr pFormat, - Mask vmask, - XID *vlist, - ClientPtr client, - int *error) -{ - PicturePtr pPicture; - PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen); - - pPicture = AllocatePicture (pDrawable->pScreen); - if (!pPicture) - { - *error = BadAlloc; - return 0; - } - - pPicture->id = pid; - pPicture->pDrawable = pDrawable; - pPicture->pFormat = pFormat; - pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24); - if (pDrawable->type == DRAWABLE_PIXMAP) - { - ++((PixmapPtr)pDrawable)->refcnt; - pPicture->pNext = 0; - } - else - { - pPicture->pNext = GetPictureWindow(((WindowPtr) pDrawable)); - SetPictureWindow(((WindowPtr) pDrawable), pPicture); - } - - SetPictureToDefaults (pPicture); - - if (vmask) - *error = ChangePicture (pPicture, vmask, vlist, 0, client); - else - *error = Success; - if (*error == Success) - *error = (*ps->CreatePicture) (pPicture); - if (*error != Success) - { - FreePicture (pPicture, (XID) 0); - pPicture = 0; - } - return pPicture; -} - -static CARD32 xRenderColorToCard32(xRenderColor c) -{ - return - (c.alpha >> 8 << 24) | - (c.red >> 8 << 16) | - (c.green & 0xff00) | - (c.blue >> 8); -} - -static unsigned int premultiply(unsigned int x) -{ - unsigned int a = x >> 24; - unsigned int t = (x & 0xff00ff) * a; - t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff) * a; - x = (x + ((x >> 8) & 0xff) + 0x80); - x &= 0xff00; - x |= t | (a << 24); - return x; -} - -static unsigned int INTERPOLATE_PIXEL_256(unsigned int x, unsigned int a, - unsigned int y, unsigned int b) -{ - CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; - t >>= 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; - x &= 0xff00ff00; - x |= t; - return x; -} - -static void initGradientColorTable(SourcePictPtr pGradient, int *error) -{ - int begin_pos, end_pos; - xFixed incr, dpos; - int pos, current_stop; - PictGradientStopPtr stops = pGradient->linear.stops; - int nstops = pGradient->linear.nstops; - - /* The position where the gradient begins and ends */ - begin_pos = (stops[0].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16; - end_pos = (stops[nstops - 1].x * PICT_GRADIENT_STOPTABLE_SIZE) >> 16; - - pos = 0; /* The position in the color table. */ - - /* Up to first point */ - while (pos <= begin_pos) { - pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[0].color); - ++pos; - } - - incr = (1<<16)/ PICT_GRADIENT_STOPTABLE_SIZE; /* the double increment. */ - dpos = incr * pos; /* The position in terms of 0-1. */ - - current_stop = 0; /* We always interpolate between current and current + 1. */ - - /* Gradient area */ - while (pos < end_pos) { - unsigned int current_color = xRenderColorToCard32(stops[current_stop].color); - unsigned int next_color = xRenderColorToCard32(stops[current_stop + 1].color); - - int dist = (int)(256*(dpos - stops[current_stop].x) - / (stops[current_stop+1].x - stops[current_stop].x)); - int idist = 256 - dist; - - pGradient->linear.colorTable[pos] = premultiply(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)); - - ++pos; - dpos += incr; - - if (dpos > stops[current_stop + 1].x) - ++current_stop; - } - - /* After last point */ - while (pos < PICT_GRADIENT_STOPTABLE_SIZE) { - pGradient->linear.colorTable[pos] = xRenderColorToCard32(stops[nstops - 1].color); - ++pos; - } -} - -static void initGradient(SourcePictPtr pGradient, int stopCount, - xFixed *stopPoints, xRenderColor *stopColors, int *error) -{ - int i; - xFixed dpos; - - if (stopCount <= 0) { - *error = BadValue; - return; - } - - dpos = -1; - for (i = 0; i < stopCount; ++i) { - if (stopPoints[i] <= dpos || stopPoints[i] > (1<<16)) { - *error = BadValue; - return; - } - dpos = stopPoints[i]; - } - - pGradient->linear.stops = xalloc(stopCount*sizeof(PictGradientStop)); - if (!pGradient->linear.stops) { - *error = BadAlloc; - return; - } - - pGradient->linear.nstops = stopCount; - - for (i = 0; i < stopCount; ++i) { - pGradient->linear.stops[i].x = stopPoints[i]; - pGradient->linear.stops[i].color = stopColors[i]; - } - initGradientColorTable(pGradient, error); -} - -static PicturePtr createSourcePicture(void) -{ - PicturePtr pPicture; - pPicture = (PicturePtr) xalloc(sizeof(PictureRec)); - pPicture->pDrawable = 0; - pPicture->pFormat = 0; - pPicture->pNext = 0; - - SetPictureToDefaults(pPicture); - return pPicture; -} - -PicturePtr -CreateSolidPicture (Picture pid, xRenderColor *color, int *error) -{ - PicturePtr pPicture; - pPicture = createSourcePicture(); - if (!pPicture) { - *error = BadAlloc; - return 0; - } - - pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - xfree(pPicture); - return 0; - } - pPicture->pSourcePict->type = SourcePictTypeSolidFill; - pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color); - return pPicture; -} - -PicturePtr -CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, - int nStops, xFixed *stops, xRenderColor *colors, int *error) -{ - PicturePtr pPicture; - - if (nStops < 2) { - *error = BadValue; - return 0; - } - - pPicture = createSourcePicture(); - if (!pPicture) { - *error = BadAlloc; - return 0; - } - if (p1->x == p2->x && p1->y == p2->y) { - *error = BadValue; - return 0; - } - - pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - xfree(pPicture); - return 0; - } - - pPicture->pSourcePict->linear.type = SourcePictTypeLinear; - pPicture->pSourcePict->linear.p1 = *p1; - pPicture->pSourcePict->linear.p2 = *p2; - - initGradient(pPicture->pSourcePict, nStops, stops, colors, error); - if (*error) { - xfree(pPicture); - return 0; - } - return pPicture; -} - -#define FixedToDouble(x) ((x)/65536.) - -PicturePtr -CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer, - xFixed innerRadius, xFixed outerRadius, - int nStops, xFixed *stops, xRenderColor *colors, int *error) -{ - PicturePtr pPicture; - PictRadialGradient *radial; - - if (nStops < 2) { - *error = BadValue; - return 0; - } - - pPicture = createSourcePicture(); - if (!pPicture) { - *error = BadAlloc; - return 0; - } - { - double dx = (double)(inner->x - outer->x); - double dy = (double)(inner->y - outer->y); - if (sqrt(dx*dx + dy*dy) + (double)(innerRadius) > (double)(outerRadius)) { - *error = BadValue; - return 0; - } - } - - pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - xfree(pPicture); - return 0; - } - radial = &pPicture->pSourcePict->radial; - - radial->type = SourcePictTypeRadial; - { - double x = (double)innerRadius / (double)outerRadius; - radial->dx = (outer->x - inner->x); - radial->dy = (outer->y - inner->y); - radial->fx = (inner->x) - x*radial->dx; - radial->fy = (inner->y) - x*radial->dy; - radial->m = 1./(1+x); - radial->b = -x*radial->m; - radial->dx /= 65536.; - radial->dy /= 65536.; - radial->fx /= 65536.; - radial->fy /= 65536.; - x = outerRadius/65536.; - radial->a = x*x - radial->dx*radial->dx - radial->dy*radial->dy; - } - - initGradient(pPicture->pSourcePict, nStops, stops, colors, error); - if (*error) { - xfree(pPicture); - return 0; - } - return pPicture; -} - -PicturePtr -CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle, - int nStops, xFixed *stops, xRenderColor *colors, int *error) -{ - PicturePtr pPicture; - - if (nStops < 2) { - *error = BadValue; - return 0; - } - - pPicture = createSourcePicture(); - if (!pPicture) { - *error = BadAlloc; - return 0; - } - - pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictConicalGradient)); - if (!pPicture->pSourcePict) { - *error = BadAlloc; - xfree(pPicture); - return 0; - } - - pPicture->pSourcePict->conical.type = SourcePictTypeConical; - pPicture->pSourcePict->conical.center = *center; - pPicture->pSourcePict->conical.angle = angle; - - initGradient(pPicture->pSourcePict, nStops, stops, colors, error); - if (*error) { - xfree(pPicture); - return 0; - } - return pPicture; -} - -#define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val) - -#define NEXT_PTR(_type) ((_type) ulist++->ptr) - -int -ChangePicture (PicturePtr pPicture, - Mask vmask, - XID *vlist, - DevUnion *ulist, - ClientPtr client) -{ - ScreenPtr pScreen = pPicture->pDrawable ? pPicture->pDrawable->pScreen : 0; - PictureScreenPtr ps = pScreen ? GetPictureScreen(pScreen) : 0; - BITS32 index2; - int error = 0; - BITS32 maskQ; - - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - maskQ = vmask; - while (vmask && !error) - { - index2 = (BITS32) lowbit (vmask); - vmask &= ~index2; - pPicture->stateChanges |= index2; - switch (index2) - { - case CPRepeat: - { - unsigned int newr; - newr = NEXT_VAL(unsigned int); - if (newr <= RepeatReflect) - { - pPicture->repeat = (newr != RepeatNone); - pPicture->repeatType = newr; - } - else - { - client->errorValue = newr; - error = BadValue; - } - } - break; - case CPAlphaMap: - { - PicturePtr pAlpha; - - if (vlist) - { - Picture pid = NEXT_VAL(Picture); - - if (pid == None) - pAlpha = 0; - else - { - pAlpha = (PicturePtr) SecurityLookupIDByType(client, - pid, - PictureType, - SecurityWriteAccess|SecurityReadAccess); - if (!pAlpha) - { - client->errorValue = pid; - error = BadPixmap; - break; - } - if (pAlpha->pDrawable->type != DRAWABLE_PIXMAP) - { - client->errorValue = pid; - error = BadMatch; - break; - } - } - } - else - pAlpha = NEXT_PTR(PicturePtr); - if (!error) - { - if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP) - pAlpha->refcnt++; - if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); - pPicture->alphaMap = pAlpha; - } - } - break; - case CPAlphaXOrigin: - pPicture->alphaOrigin.x = NEXT_VAL(INT16); - break; - case CPAlphaYOrigin: - pPicture->alphaOrigin.y = NEXT_VAL(INT16); - break; - case CPClipXOrigin: - pPicture->clipOrigin.x = NEXT_VAL(INT16); - break; - case CPClipYOrigin: - pPicture->clipOrigin.y = NEXT_VAL(INT16); - break; - case CPClipMask: - { - Pixmap pid; - PixmapPtr pPixmap; - int clipType; - if (!pScreen) - return BadDrawable; - - if (vlist) - { - pid = NEXT_VAL(Pixmap); - if (pid == None) - { - clipType = CT_NONE; - pPixmap = NullPixmap; - } - else - { - clipType = CT_PIXMAP; - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - pid, - RT_PIXMAP, - SecurityReadAccess); - if (!pPixmap) - { - client->errorValue = pid; - error = BadPixmap; - break; - } - } - } - else - { - pPixmap = NEXT_PTR(PixmapPtr); - if (pPixmap) - clipType = CT_PIXMAP; - else - clipType = CT_NONE; - } - - if (pPixmap) - { - if ((pPixmap->drawable.depth != 1) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - break; - } - else - { - clipType = CT_PIXMAP; - pPixmap->refcnt++; - } - } - error = (*ps->ChangePictureClip)(pPicture, clipType, - (pointer)pPixmap, 0); - break; - } - case CPGraphicsExposure: - { - unsigned int newe; - newe = NEXT_VAL(unsigned int); - if (newe <= xTrue) - pPicture->graphicsExposures = newe; - else - { - client->errorValue = newe; - error = BadValue; - } - } - break; - case CPSubwindowMode: - { - unsigned int news; - news = NEXT_VAL(unsigned int); - if (news == ClipByChildren || news == IncludeInferiors) - pPicture->subWindowMode = news; - else - { - client->errorValue = news; - error = BadValue; - } - } - break; - case CPPolyEdge: - { - unsigned int newe; - newe = NEXT_VAL(unsigned int); - if (newe == PolyEdgeSharp || newe == PolyEdgeSmooth) - pPicture->polyEdge = newe; - else - { - client->errorValue = newe; - error = BadValue; - } - } - break; - case CPPolyMode: - { - unsigned int newm; - newm = NEXT_VAL(unsigned int); - if (newm == PolyModePrecise || newm == PolyModeImprecise) - pPicture->polyMode = newm; - else - { - client->errorValue = newm; - error = BadValue; - } - } - break; - case CPDither: - pPicture->dither = NEXT_VAL(Atom); - break; - case CPComponentAlpha: - { - unsigned int newca; - - newca = NEXT_VAL (unsigned int); - if (newca <= xTrue) - pPicture->componentAlpha = newca; - else - { - client->errorValue = newca; - error = BadValue; - } - } - break; - default: - client->errorValue = maskQ; - error = BadValue; - break; - } - } - if (ps) - (*ps->ChangePicture) (pPicture, maskQ); - return error; -} - -int -SetPictureClipRects (PicturePtr pPicture, - int xOrigin, - int yOrigin, - int nRect, - xRectangle *rects) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - RegionPtr clientClip; - int result; - - clientClip = RECTS_TO_REGION(pScreen, - nRect, rects, CT_UNSORTED); - if (!clientClip) - return BadAlloc; - result =(*ps->ChangePictureClip) (pPicture, CT_REGION, - (pointer) clientClip, 0); - if (result == Success) - { - pPicture->clipOrigin.x = xOrigin; - pPicture->clipOrigin.y = yOrigin; - pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask; - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - } - return result; -} - -int -SetPictureClipRegion (PicturePtr pPicture, - int xOrigin, - int yOrigin, - RegionPtr pRegion) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - RegionPtr clientClip; - int result; - int type; - - if (pRegion) - { - type = CT_REGION; - clientClip = REGION_CREATE (pScreen, - REGION_EXTENTS(pScreen, pRegion), - REGION_NUM_RECTS(pRegion)); - if (!clientClip) - return BadAlloc; - if (!REGION_COPY (pSCreen, clientClip, pRegion)) - { - REGION_DESTROY (pScreen, clientClip); - return BadAlloc; - } - } - else - { - type = CT_NONE; - clientClip = 0; - } - - result =(*ps->ChangePictureClip) (pPicture, type, - (pointer) clientClip, 0); - if (result == Success) - { - pPicture->clipOrigin.x = xOrigin; - pPicture->clipOrigin.y = yOrigin; - pPicture->stateChanges |= CPClipXOrigin|CPClipYOrigin|CPClipMask; - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - } - return result; -} - - -int -SetPictureTransform (PicturePtr pPicture, - PictTransform *transform) -{ - static const PictTransform identity = { { - { xFixed1, 0x00000, 0x00000 }, - { 0x00000, xFixed1, 0x00000 }, - { 0x00000, 0x00000, xFixed1 }, - } }; - - if (transform && memcmp (transform, &identity, sizeof (PictTransform)) == 0) - transform = 0; - - if (transform) - { - if (!pPicture->transform) - { - pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform)); - if (!pPicture->transform) - return BadAlloc; - } - *pPicture->transform = *transform; - } - else - { - if (pPicture->transform) - { - xfree (pPicture->transform); - pPicture->transform = 0; - } - } - pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - - return Success; -} - -void -CopyPicture (PicturePtr pSrc, - Mask mask, - PicturePtr pDst) -{ - PictureScreenPtr ps = GetPictureScreen(pSrc->pDrawable->pScreen); - Mask origMask = mask; - - pDst->serialNumber |= GC_CHANGE_SERIAL_BIT; - pDst->stateChanges |= mask; - - while (mask) { - Mask bit = lowbit(mask); - - switch (bit) - { - case CPRepeat: - pDst->repeat = pSrc->repeat; - pDst->repeatType = pSrc->repeatType; - break; - case CPAlphaMap: - if (pSrc->alphaMap && pSrc->alphaMap->pDrawable->type == DRAWABLE_PIXMAP) - pSrc->alphaMap->refcnt++; - if (pDst->alphaMap) - FreePicture ((pointer) pDst->alphaMap, (XID) 0); - pDst->alphaMap = pSrc->alphaMap; - break; - case CPAlphaXOrigin: - pDst->alphaOrigin.x = pSrc->alphaOrigin.x; - break; - case CPAlphaYOrigin: - pDst->alphaOrigin.y = pSrc->alphaOrigin.y; - break; - case CPClipXOrigin: - pDst->clipOrigin.x = pSrc->clipOrigin.x; - break; - case CPClipYOrigin: - pDst->clipOrigin.y = pSrc->clipOrigin.y; - break; - case CPClipMask: - switch (pSrc->clientClipType) { - case CT_NONE: - (*ps->ChangePictureClip)(pDst, CT_NONE, NULL, 0); - break; - case CT_REGION: - if (!pSrc->clientClip) { - (*ps->ChangePictureClip)(pDst, CT_NONE, NULL, 0); - } else { - RegionPtr clientClip; - RegionPtr srcClientClip = (RegionPtr)pSrc->clientClip; - - clientClip = REGION_CREATE(pSrc->pDrawable->pScreen, - REGION_EXTENTS(pSrc->pDrawable->pScreen, srcClientClip), - REGION_NUM_RECTS(srcClientClip)); - (*ps->ChangePictureClip)(pDst, CT_REGION, clientClip, 0); - } - break; - default: - /* XXX: CT_PIXMAP unimplemented */ - break; - } - break; - case CPGraphicsExposure: - pDst->graphicsExposures = pSrc->graphicsExposures; - break; - case CPPolyEdge: - pDst->polyEdge = pSrc->polyEdge; - break; - case CPPolyMode: - pDst->polyMode = pSrc->polyMode; - break; - case CPDither: - pDst->dither = pSrc->dither; - break; - case CPComponentAlpha: - pDst->componentAlpha = pSrc->componentAlpha; - break; - } - mask &= ~bit; - } - - (*ps->ChangePicture)(pDst, origMask); -} - -static void -ValidateOnePicture (PicturePtr pPicture) -{ - if (pPicture->pDrawable && pPicture->serialNumber != pPicture->pDrawable->serialNumber) - { - PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen); - - (*ps->ValidatePicture) (pPicture, pPicture->stateChanges); - pPicture->stateChanges = 0; - pPicture->serialNumber = pPicture->pDrawable->serialNumber; - } -} - -void -ValidatePicture(PicturePtr pPicture) -{ - ValidateOnePicture (pPicture); - if (pPicture->alphaMap) - ValidateOnePicture (pPicture->alphaMap); -} - -int -FreePicture (pointer value, - XID pid) -{ - PicturePtr pPicture = (PicturePtr) value; - - if (--pPicture->refcnt == 0) - { - if (pPicture->transform) - xfree (pPicture->transform); - if (!pPicture->pDrawable) { - if (pPicture->pSourcePict) { - if (pPicture->pSourcePict->type != SourcePictTypeSolidFill) - xfree(pPicture->pSourcePict->linear.stops); - xfree(pPicture->pSourcePict); - } - } else { - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); - (*ps->DestroyPicture) (pPicture); - (*ps->DestroyPictureClip) (pPicture); - if (pPicture->pDrawable->type == DRAWABLE_WINDOW) - { - WindowPtr pWindow = (WindowPtr) pPicture->pDrawable; - PicturePtr *pPrev; - - for (pPrev = (PicturePtr *) &((pWindow)->devPrivates[PictureWindowPrivateIndex].ptr); - *pPrev; - pPrev = &(*pPrev)->pNext) - { - if (*pPrev == pPicture) - { - *pPrev = pPicture->pNext; - break; - } - } - } - else if (pPicture->pDrawable->type == DRAWABLE_PIXMAP) - { - (*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable); - } - } - xfree (pPicture); - } - return Success; -} - -int -FreePictFormat (pointer pPictFormat, - XID pid) -{ - return Success; -} - -void -CompositePicture (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - if (pMask) - ValidatePicture (pMask); - ValidatePicture (pDst); - (*ps->Composite) (op, - pSrc, - pMask, - pDst, - xSrc, - ySrc, - xMask, - yMask, - xDst, - yDst, - width, - height); -} - -void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr lists, - GlyphPtr *glyphs) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs); -} - -void -CompositeRects (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pDst); - (*ps->CompositeRects) (op, pDst, color, nRect, rects); -} - -void -CompositeTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Trapezoids) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps); -} - -void -CompositeTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntriangles, - xTriangle *triangles) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntriangles, triangles); -} - -void -CompositeTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); -} - -void -CompositeTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); -} - -void -AddTraps (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntrap, - xTrap *traps) -{ - PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen); - - ValidatePicture (pPicture); - (*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps); -} - -#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff) -#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31)) - -Bool -PictureTransformPoint3d (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - *vector = result; - return TRUE; -} - - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - for (j = 0; j < 2; j++) - { - partial = (xFixed_48_16) result.vector[j] << 16; - v = partial / result.vector[2]; - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - vector->vector[j] = (xFixed) v; - } - vector->vector[2] = xFixed1; - return TRUE; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original deleted file mode 100644 index 0d1a8e1d8..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original +++ /dev/null @@ -1,678 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $Id: picturestr.h,v 1.15 2005/12/09 18:35:21 ajax Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -/* - * This must keep the same symbol as the original - * picturestr.h or symbols will be redefined. We - * should define a new types and cast when appro- - * priate. - */ - -#ifndef _PICTURESTR_H_ -#define _PICTURESTR_H_ - -#include "NXglyphstr.h" -#include "scrnintstr.h" -#include "resource.h" - -typedef struct _DirectFormat { - CARD16 red, redMask; - CARD16 green, greenMask; - CARD16 blue, blueMask; - CARD16 alpha, alphaMask; -} DirectFormatRec; - -typedef struct _IndexFormat { - VisualID vid; - ColormapPtr pColormap; - int nvalues; - xIndexValue *pValues; - void *devPrivate; -} IndexFormatRec; - -typedef struct _PictFormat { - CARD32 id; - CARD32 format; /* except bpp */ - unsigned char type; - unsigned char depth; - DirectFormatRec direct; - IndexFormatRec index; -} PictFormatRec; - -typedef struct _PictVector { - xFixed vector[3]; -} PictVector, *PictVectorPtr; - -typedef struct _PictTransform { - xFixed matrix[3][3]; -} PictTransform, *PictTransformPtr; - -#define PICT_GRADIENT_STOPTABLE_SIZE 1024 -#define SourcePictTypeSolidFill 0 -#define SourcePictTypeLinear 1 -#define SourcePictTypeRadial 2 -#define SourcePictTypeConical 3 - -typedef struct _PictSolidFill { - unsigned int type; - CARD32 color; -} PictSolidFill, *PictSolidFillPtr; - -typedef struct _PictGradientStop { - xFixed x; - xRenderColor color; -} PictGradientStop, *PictGradientStopPtr; - -typedef struct _PictGradient { - unsigned int type; - int nstops; - PictGradientStopPtr stops; - CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE]; -} PictGradient, *PictGradientPtr; - -typedef struct _PictLinearGradient { - unsigned int type; - int nstops; - PictGradientStopPtr stops; - CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE]; - xPointFixed p1; - xPointFixed p2; -} PictLinearGradient, *PictLinearGradientPtr; - -typedef struct _PictRadialGradient { - unsigned int type; - int nstops; - PictGradientStopPtr stops; - CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE]; - double fx; - double fy; - double dx; - double dy; - double a; - double m; - double b; -} PictRadialGradient, *PictRadialGradientPtr; - -typedef struct _PictConicalGradient { - unsigned int type; - int nstops; - PictGradientStopPtr stops; - CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE]; - xPointFixed center; - xFixed angle; -} PictConicalGradient, *PictConicalGradientPtr; - -typedef union _SourcePict { - unsigned int type; - PictSolidFill solidFill; - PictGradient gradient; - PictLinearGradient linear; - PictRadialGradient radial; - PictConicalGradient conical; -} SourcePict, *SourcePictPtr; - -typedef struct _Picture { - DrawablePtr pDrawable; - PictFormatPtr pFormat; - CARD32 format; /* PICT_FORMAT */ - int refcnt; - CARD32 id; - PicturePtr pNext; /* chain on same drawable */ - - unsigned int repeat : 1; - unsigned int graphicsExposures : 1; - unsigned int subWindowMode : 1; - unsigned int polyEdge : 1; - unsigned int polyMode : 1; - unsigned int freeCompClip : 1; - unsigned int clientClipType : 2; - unsigned int componentAlpha : 1; - unsigned int repeatType : 2; - unsigned int unused : 21; - - PicturePtr alphaMap; - DDXPointRec alphaOrigin; - - DDXPointRec clipOrigin; - pointer clientClip; - - Atom dither; - - unsigned long stateChanges; - unsigned long serialNumber; - - RegionPtr pCompositeClip; - - DevUnion *devPrivates; - - PictTransform *transform; - - int filter; - xFixed *filter_params; - int filter_nparams; - SourcePictPtr pSourcePict; -} PictureRec; - -typedef Bool (*PictFilterValidateParamsProcPtr) (PicturePtr pPicture, int id, - xFixed *params, int nparams); -typedef struct { - char *name; - int id; - PictFilterValidateParamsProcPtr ValidateParams; -} PictFilterRec, *PictFilterPtr; - -#define PictFilterNearest 0 -#define PictFilterBilinear 1 - -#define PictFilterFast 2 -#define PictFilterGood 3 -#define PictFilterBest 4 - -#define PictFilterConvolution 5 - -typedef struct { - char *alias; - int alias_id; - int filter_id; -} PictFilterAliasRec, *PictFilterAliasPtr; - -typedef int (*CreatePictureProcPtr) (PicturePtr pPicture); -typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture); -typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture, - int clipType, - pointer value, - int n); -typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture); - -typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture, - PictTransform *transform); - -typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture, - int filter, - xFixed *params, - int nparams); - -typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture); - -typedef void (*ChangePictureProcPtr) (PicturePtr pPicture, - Mask mask); -typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture, - Mask mask); -typedef void (*CompositeProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -typedef void (*GlyphsProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlists, - GlyphListPtr lists, - GlyphPtr *glyphs); - -typedef void (*CompositeRectsProcPtr) (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects); - -typedef void (*RasterizeTrapezoidProcPtr)(PicturePtr pMask, - xTrapezoid *trap, - int x_off, - int y_off); - -typedef void (*TrapezoidsProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps); - -typedef void (*TrianglesProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntri, - xTriangle *tris); - -typedef void (*TriStripProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -typedef void (*TriFanProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat); - -typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat); - -typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat, - int ndef, - xColorItem *pdef); - -typedef void (*AddTrapsProcPtr) (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntrap, - xTrap *traps); - -typedef void (*AddTrianglesProcPtr) (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntri, - xTriangle *tris); - -typedef struct _PictureScreen { - int totalPictureSize; - unsigned int *PicturePrivateSizes; - int PicturePrivateLen; - - PictFormatPtr formats; - PictFormatPtr fallback; - int nformats; - - CreatePictureProcPtr CreatePicture; - DestroyPictureProcPtr DestroyPicture; - ChangePictureClipProcPtr ChangePictureClip; - DestroyPictureClipProcPtr DestroyPictureClip; - - ChangePictureProcPtr ChangePicture; - ValidatePictureProcPtr ValidatePicture; - - CompositeProcPtr Composite; - GlyphsProcPtr Glyphs; - CompositeRectsProcPtr CompositeRects; - - DestroyWindowProcPtr DestroyWindow; - CloseScreenProcPtr CloseScreen; - - StoreColorsProcPtr StoreColors; - - InitIndexedProcPtr InitIndexed; - CloseIndexedProcPtr CloseIndexed; - UpdateIndexedProcPtr UpdateIndexed; - - int subpixel; - - PictFilterPtr filters; - int nfilters; - PictFilterAliasPtr filterAliases; - int nfilterAliases; - - ChangePictureTransformProcPtr ChangePictureTransform; - ChangePictureFilterProcPtr ChangePictureFilter; - DestroyPictureFilterProcPtr DestroyPictureFilter; - - TrapezoidsProcPtr Trapezoids; - TrianglesProcPtr Triangles; - TriStripProcPtr TriStrip; - TriFanProcPtr TriFan; - - RasterizeTrapezoidProcPtr RasterizeTrapezoid; - - AddTrianglesProcPtr AddTriangles; - - AddTrapsProcPtr AddTraps; - -} PictureScreenRec, *PictureScreenPtr; - -extern int PictureScreenPrivateIndex; -extern int PictureWindowPrivateIndex; -extern RESTYPE PictureType; -extern RESTYPE PictFormatType; -extern RESTYPE GlyphSetType; - -#define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr)) -#define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL) -#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p)) -#define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr)) -#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p)) - -#define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\ - pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\ - if (!pPicture) { \ - client->errorValue = pid; \ - return err; \ - } \ -} - -#define VERIFY_ALPHA(pPicture, pid, client, mode, err) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_PICTURE(pPicture, pid, client, mode, err); \ - } \ -} \ - -void -ResetPicturePrivateIndex (void); - -int -AllocatePicturePrivateIndex (void); - -Bool -AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount); - -Bool -PictureDestroyWindow (WindowPtr pWindow); - -Bool -PictureCloseScreen (int Index, ScreenPtr pScreen); - -void -PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef); - -Bool -PictureInitIndexedFormats (ScreenPtr pScreen); - -Bool -PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel); - -int -PictureGetSubpixelOrder (ScreenPtr pScreen); - -PictFormatPtr -PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp); - -PictFormatPtr -PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual); - -PictFormatPtr -PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format); - -Bool -PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); - -int -PictureGetFilterId (char *filter, int len, Bool makeit); - -char * -PictureGetFilterName (int id); - -int -PictureAddFilter (ScreenPtr pScreen, - char *filter, - PictFilterValidateParamsProcPtr ValidateParams); - -Bool -PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias); - -Bool -PictureSetDefaultFilters (ScreenPtr pScreen); - -void -PictureResetFilters (ScreenPtr pScreen); - -PictFilterPtr -PictureFindFilter (ScreenPtr pScreen, char *name, int len); - -int -SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams); - -Bool -PictureFinishInit (void); - -void -SetPictureToDefaults (PicturePtr pPicture); - -PicturePtr -AllocatePicture (ScreenPtr pScreen); - -#if 0 -Bool -miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); -#endif - - -PicturePtr -CreatePicture (Picture pid, - DrawablePtr pDrawable, - PictFormatPtr pFormat, - Mask mask, - XID *list, - ClientPtr client, - int *error); - -int -ChangePicture (PicturePtr pPicture, - Mask vmask, - XID *vlist, - DevUnion *ulist, - ClientPtr client); - -int -SetPictureClipRects (PicturePtr pPicture, - int xOrigin, - int yOrigin, - int nRect, - xRectangle *rects); - -int -SetPictureClipRegion (PicturePtr pPicture, - int xOrigin, - int yOrigin, - RegionPtr pRegion); - -int -SetPictureTransform (PicturePtr pPicture, - PictTransform *transform); - -void -CopyPicture (PicturePtr pSrc, - Mask mask, - PicturePtr pDst); - -void -ValidatePicture(PicturePtr pPicture); - -int -FreePicture (pointer pPicture, - XID pid); - -int -FreePictFormat (pointer pPictFormat, - XID pid); - -void -CompositePicture (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr lists, - GlyphPtr *glyphs); - -void -CompositeRects (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects); - -void -CompositeTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps); - -void -CompositeTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntriangles, - xTriangle *triangles); - -void -CompositeTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points); - -void -CompositeTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points); - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector); - -Bool -PictureTransformPoint3d (PictTransformPtr transform, - PictVectorPtr vector); - -void RenderExtensionInit (void); - -Bool -AnimCurInit (ScreenPtr pScreen); - -int -AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor); - -void -AddTraps (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntraps, - xTrap *traps); - -PicturePtr -CreateSolidPicture (Picture pid, - xRenderColor *color, - int *error); - -PicturePtr -CreateLinearGradientPicture (Picture pid, - xPointFixed *p1, - xPointFixed *p2, - int nStops, - xFixed *stops, - xRenderColor *colors, - int *error); - -PicturePtr -CreateRadialGradientPicture (Picture pid, - xPointFixed *inner, - xPointFixed *outer, - xFixed innerRadius, - xFixed outerRadius, - int nStops, - xFixed *stops, - xRenderColor *colors, - int *error); - -PicturePtr -CreateConicalGradientPicture (Picture pid, - xPointFixed *center, - xFixed angle, - int nStops, - xFixed *stops, - xRenderColor *colors, - int *error); - -#ifdef PANORAMIX -void PanoramiXRenderInit (void); -void PanoramiXRenderReset (void); -#endif - -#endif /* _PICTURESTR_H_ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.X.original deleted file mode 100644 index 4775793ab..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.X.original +++ /dev/null @@ -1,654 +0,0 @@ -/* - * $Id: picturestr.h,v 1.15 2005/12/09 18:35:21 ajax Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifndef _PICTURESTR_H_ -#define _PICTURESTR_H_ - -#include "glyphstr.h" -#include "scrnintstr.h" -#include "resource.h" - -typedef struct _DirectFormat { - CARD16 red, redMask; - CARD16 green, greenMask; - CARD16 blue, blueMask; - CARD16 alpha, alphaMask; -} DirectFormatRec; - -typedef struct _IndexFormat { - VisualID vid; - ColormapPtr pColormap; - int nvalues; - xIndexValue *pValues; - void *devPrivate; -} IndexFormatRec; - -typedef struct _PictFormat { - CARD32 id; - CARD32 format; /* except bpp */ - unsigned char type; - unsigned char depth; - DirectFormatRec direct; - IndexFormatRec index; -} PictFormatRec; - -typedef struct _PictVector { - xFixed vector[3]; -} PictVector, *PictVectorPtr; - -typedef struct _PictTransform { - xFixed matrix[3][3]; -} PictTransform, *PictTransformPtr; - -#define PICT_GRADIENT_STOPTABLE_SIZE 1024 -#define SourcePictTypeSolidFill 0 -#define SourcePictTypeLinear 1 -#define SourcePictTypeRadial 2 -#define SourcePictTypeConical 3 - -typedef struct _PictSolidFill { - unsigned int type; - CARD32 color; -} PictSolidFill, *PictSolidFillPtr; - -typedef struct _PictGradientStop { - xFixed x; - xRenderColor color; -} PictGradientStop, *PictGradientStopPtr; - -typedef struct _PictGradient { - unsigned int type; - int nstops; - PictGradientStopPtr stops; - CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE]; -} PictGradient, *PictGradientPtr; - -typedef struct _PictLinearGradient { - unsigned int type; - int nstops; - PictGradientStopPtr stops; - CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE]; - xPointFixed p1; - xPointFixed p2; -} PictLinearGradient, *PictLinearGradientPtr; - -typedef struct _PictRadialGradient { - unsigned int type; - int nstops; - PictGradientStopPtr stops; - CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE]; - double fx; - double fy; - double dx; - double dy; - double a; - double m; - double b; -} PictRadialGradient, *PictRadialGradientPtr; - -typedef struct _PictConicalGradient { - unsigned int type; - int nstops; - PictGradientStopPtr stops; - CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE]; - xPointFixed center; - xFixed angle; -} PictConicalGradient, *PictConicalGradientPtr; - -typedef union _SourcePict { - unsigned int type; - PictSolidFill solidFill; - PictGradient gradient; - PictLinearGradient linear; - PictRadialGradient radial; - PictConicalGradient conical; -} SourcePict, *SourcePictPtr; - -typedef struct _Picture { - DrawablePtr pDrawable; - PictFormatPtr pFormat; - CARD32 format; /* PICT_FORMAT */ - int refcnt; - CARD32 id; - PicturePtr pNext; /* chain on same drawable */ - - unsigned int repeat : 1; - unsigned int graphicsExposures : 1; - unsigned int subWindowMode : 1; - unsigned int polyEdge : 1; - unsigned int polyMode : 1; - unsigned int freeCompClip : 1; - unsigned int clientClipType : 2; - unsigned int componentAlpha : 1; - unsigned int repeatType : 2; - unsigned int unused : 21; - - PicturePtr alphaMap; - DDXPointRec alphaOrigin; - - DDXPointRec clipOrigin; - pointer clientClip; - - Atom dither; - - unsigned long stateChanges; - unsigned long serialNumber; - - RegionPtr pCompositeClip; - - DevUnion *devPrivates; - - PictTransform *transform; - - int filter; - xFixed *filter_params; - int filter_nparams; - SourcePictPtr pSourcePict; -} PictureRec; - -typedef Bool (*PictFilterValidateParamsProcPtr) (PicturePtr pPicture, int id, - xFixed *params, int nparams); -typedef struct { - char *name; - int id; - PictFilterValidateParamsProcPtr ValidateParams; -} PictFilterRec, *PictFilterPtr; - -#define PictFilterNearest 0 -#define PictFilterBilinear 1 - -#define PictFilterFast 2 -#define PictFilterGood 3 -#define PictFilterBest 4 - -#define PictFilterConvolution 5 - -typedef struct { - char *alias; - int alias_id; - int filter_id; -} PictFilterAliasRec, *PictFilterAliasPtr; - -typedef int (*CreatePictureProcPtr) (PicturePtr pPicture); -typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture); -typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture, - int clipType, - pointer value, - int n); -typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture); - -typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture, - PictTransform *transform); - -typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture, - int filter, - xFixed *params, - int nparams); - -typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture); - -typedef void (*ChangePictureProcPtr) (PicturePtr pPicture, - Mask mask); -typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture, - Mask mask); -typedef void (*CompositeProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -typedef void (*GlyphsProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlists, - GlyphListPtr lists, - GlyphPtr *glyphs); - -typedef void (*CompositeRectsProcPtr) (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects); - -typedef void (*RasterizeTrapezoidProcPtr)(PicturePtr pMask, - xTrapezoid *trap, - int x_off, - int y_off); - -typedef void (*TrapezoidsProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps); - -typedef void (*TrianglesProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntri, - xTriangle *tris); - -typedef void (*TriStripProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -typedef void (*TriFanProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat); - -typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat); - -typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen, - PictFormatPtr pFormat, - int ndef, - xColorItem *pdef); - -typedef void (*AddTrapsProcPtr) (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntrap, - xTrap *traps); - -typedef void (*AddTrianglesProcPtr) (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntri, - xTriangle *tris); - -typedef struct _PictureScreen { - int totalPictureSize; - unsigned int *PicturePrivateSizes; - int PicturePrivateLen; - - PictFormatPtr formats; - PictFormatPtr fallback; - int nformats; - - CreatePictureProcPtr CreatePicture; - DestroyPictureProcPtr DestroyPicture; - ChangePictureClipProcPtr ChangePictureClip; - DestroyPictureClipProcPtr DestroyPictureClip; - - ChangePictureProcPtr ChangePicture; - ValidatePictureProcPtr ValidatePicture; - - CompositeProcPtr Composite; - GlyphsProcPtr Glyphs; - CompositeRectsProcPtr CompositeRects; - - DestroyWindowProcPtr DestroyWindow; - CloseScreenProcPtr CloseScreen; - - StoreColorsProcPtr StoreColors; - - InitIndexedProcPtr InitIndexed; - CloseIndexedProcPtr CloseIndexed; - UpdateIndexedProcPtr UpdateIndexed; - - int subpixel; - - PictFilterPtr filters; - int nfilters; - PictFilterAliasPtr filterAliases; - int nfilterAliases; - - ChangePictureTransformProcPtr ChangePictureTransform; - ChangePictureFilterProcPtr ChangePictureFilter; - DestroyPictureFilterProcPtr DestroyPictureFilter; - - TrapezoidsProcPtr Trapezoids; - TrianglesProcPtr Triangles; - TriStripProcPtr TriStrip; - TriFanProcPtr TriFan; - - RasterizeTrapezoidProcPtr RasterizeTrapezoid; - - AddTrianglesProcPtr AddTriangles; - - AddTrapsProcPtr AddTraps; - -} PictureScreenRec, *PictureScreenPtr; - -extern int PictureScreenPrivateIndex; -extern int PictureWindowPrivateIndex; -extern RESTYPE PictureType; -extern RESTYPE PictFormatType; -extern RESTYPE GlyphSetType; - -#define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr)) -#define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL) -#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p)) -#define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr)) -#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p)) - -#define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\ - pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\ - if (!pPicture) { \ - client->errorValue = pid; \ - return err; \ - } \ -} - -#define VERIFY_ALPHA(pPicture, pid, client, mode, err) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_PICTURE(pPicture, pid, client, mode, err); \ - } \ -} \ - -void -ResetPicturePrivateIndex (void); - -int -AllocatePicturePrivateIndex (void); - -Bool -AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount); - -Bool -PictureDestroyWindow (WindowPtr pWindow); - -Bool -PictureCloseScreen (int Index, ScreenPtr pScreen); - -void -PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef); - -Bool -PictureInitIndexedFormats (ScreenPtr pScreen); - -Bool -PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel); - -int -PictureGetSubpixelOrder (ScreenPtr pScreen); - -PictFormatPtr -PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp); - -PictFormatPtr -PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual); - -PictFormatPtr -PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format); - -Bool -PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); - -int -PictureGetFilterId (char *filter, int len, Bool makeit); - -char * -PictureGetFilterName (int id); - -int -PictureAddFilter (ScreenPtr pScreen, - char *filter, - PictFilterValidateParamsProcPtr ValidateParams); - -Bool -PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias); - -Bool -PictureSetDefaultFilters (ScreenPtr pScreen); - -void -PictureResetFilters (ScreenPtr pScreen); - -PictFilterPtr -PictureFindFilter (ScreenPtr pScreen, char *name, int len); - -int -SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams); - -Bool -PictureFinishInit (void); - -void -SetPictureToDefaults (PicturePtr pPicture); - -PicturePtr -AllocatePicture (ScreenPtr pScreen); - -#if 0 -Bool -miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); -#endif - - -PicturePtr -CreatePicture (Picture pid, - DrawablePtr pDrawable, - PictFormatPtr pFormat, - Mask mask, - XID *list, - ClientPtr client, - int *error); - -int -ChangePicture (PicturePtr pPicture, - Mask vmask, - XID *vlist, - DevUnion *ulist, - ClientPtr client); - -int -SetPictureClipRects (PicturePtr pPicture, - int xOrigin, - int yOrigin, - int nRect, - xRectangle *rects); - -int -SetPictureClipRegion (PicturePtr pPicture, - int xOrigin, - int yOrigin, - RegionPtr pRegion); - -int -SetPictureTransform (PicturePtr pPicture, - PictTransform *transform); - -void -CopyPicture (PicturePtr pSrc, - Mask mask, - PicturePtr pDst); - -void -ValidatePicture(PicturePtr pPicture); - -int -FreePicture (pointer pPicture, - XID pid); - -int -FreePictFormat (pointer pPictFormat, - XID pid); - -void -CompositePicture (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr lists, - GlyphPtr *glyphs); - -void -CompositeRects (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects); - -void -CompositeTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps); - -void -CompositeTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntriangles, - xTriangle *triangles); - -void -CompositeTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points); - -void -CompositeTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoints, - xPointFixed *points); - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector); - -Bool -PictureTransformPoint3d (PictTransformPtr transform, - PictVectorPtr vector); - -void RenderExtensionInit (void); - -Bool -AnimCurInit (ScreenPtr pScreen); - -int -AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor); - -void -AddTraps (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntraps, - xTrap *traps); - -PicturePtr -CreateSolidPicture (Picture pid, - xRenderColor *color, - int *error); - -PicturePtr -CreateLinearGradientPicture (Picture pid, - xPointFixed *p1, - xPointFixed *p2, - int nStops, - xFixed *stops, - xRenderColor *colors, - int *error); - -PicturePtr -CreateRadialGradientPicture (Picture pid, - xPointFixed *inner, - xPointFixed *outer, - xFixed innerRadius, - xFixed outerRadius, - int nStops, - xFixed *stops, - xRenderColor *colors, - int *error); - -PicturePtr -CreateConicalGradientPicture (Picture pid, - xPointFixed *center, - xFixed angle, - int nStops, - xFixed *stops, - xRenderColor *colors, - int *error); - -#ifdef PANORAMIX -void PanoramiXRenderInit (void); -void PanoramiXRenderReset (void); -#endif - -#endif /* _PICTURESTR_H_ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original deleted file mode 100644 index cd1ec6ddd..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original +++ /dev/null @@ -1,992 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: property.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include "windowstr.h" -#include "propertyst.h" -#include "dixstruct.h" -#include "../../dix/dispatch.h" -#include "swaprep.h" -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif -#ifdef LBX -#include "lbxserve.h" -#include "lbxtags.h" -#endif - -#include "Options.h" -#include "Rootless.h" -#include "Client.h" -#include "Windows.h" - -#if defined(LBX) || defined(LBX_COMPAT) -#if 0 /* no header in X11 environment, not used in X11 environment */ -int fWriteToClient(ClientPtr client, int len, char *buf) -{ - return WriteToClient(client, len, buf); -} -#endif -#endif - -extern Atom clientCutProperty; - -#ifdef NXAGENT_SERVER -typedef struct -{ - CARD32 state; - Window icon; -} -nxagentWMStateRec; -#endif - -/***************************************************************** - * Property Stuff - * - * ChangeProperty, DeleteProperty, GetProperties, - * ListProperties - * - * Properties below to windows. A allocate slots each time - * a property is added. No fancy searching done. - * - *****************************************************************/ - -#ifdef notdef -static void -PrintPropertys(WindowPtr pWin) -{ - PropertyPtr pProp; - register int j; - - pProp = pWin->userProps; - while (pProp) - { - ErrorF( "%x %x\n", pProp->propertyName, pProp->type); - ErrorF("property format: %d\n", pProp->format); - ErrorF("property data: \n"); - for (j=0; j<(pProp->format/8)*pProp->size; j++) - ErrorF("%c\n", pProp->data[j]); - pProp = pProp->next; - } -} -#endif - -int -ProcRotateProperties(ClientPtr client) -{ - int i, j, delta; - REQUEST(xRotatePropertiesReq); - WindowPtr pWin; - register Atom * atoms; - PropertyPtr * props; /* array of pointer */ - PropertyPtr pProp; - xEvent event; - - REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2); - UpdateCurrentTime(); - pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!stuff->nAtoms) - return(Success); - atoms = (Atom *) & stuff[1]; - props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr)); - if (!props) - return(BadAlloc); - for (i = 0; i < stuff->nAtoms; i++) - { -#ifdef XCSECURITY - char action = SecurityCheckPropertyAccess(client, pWin, atoms[i], - SecurityReadAccess|SecurityWriteAccess); -#endif - if (!ValidAtom(atoms[i]) -#ifdef XCSECURITY - || (SecurityErrorOperation == action) -#endif - ) - { - DEALLOCATE_LOCAL(props); - client->errorValue = atoms[i]; - return BadAtom; - } -#ifdef XCSECURITY - if (SecurityIgnoreOperation == action) - { - DEALLOCATE_LOCAL(props); - return Success; - } -#endif - for (j = i + 1; j < stuff->nAtoms; j++) - if (atoms[j] == atoms[i]) - { - DEALLOCATE_LOCAL(props); - return BadMatch; - } - pProp = wUserProps (pWin); - while (pProp) - { - if (pProp->propertyName == atoms[i]) - goto found; - pProp = pProp->next; - } - DEALLOCATE_LOCAL(props); - return BadMatch; -found: - props[i] = pProp; - } - delta = stuff->nPositions; - - /* If the rotation is a complete 360 degrees, then moving the properties - around and generating PropertyNotify events should be skipped. */ - - if ( (stuff->nAtoms != 0) && (abs(delta) % stuff->nAtoms) != 0 ) - { - while (delta < 0) /* faster if abs value is small */ - delta += stuff->nAtoms; - for (i = 0; i < stuff->nAtoms; i++) - { - /* Generate a PropertyNotify event for each property whose value - is changed in the order in which they appear in the request. */ - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyNewValue; - event.u.property.atom = props[i]->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - - props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms]; - } - } - DEALLOCATE_LOCAL(props); - return Success; -} - -int -ProcChangeProperty(ClientPtr client) -{ - WindowPtr pWin; - char format, mode; - unsigned long len; - int sizeInBytes; - int totalSize; - int err; - REQUEST(xChangePropertyReq); - - REQUEST_AT_LEAST_SIZE(xChangePropertyReq); - UpdateCurrentTime(); - format = stuff->format; - mode = stuff->mode; - if ((mode != PropModeReplace) && (mode != PropModeAppend) && - (mode != PropModePrepend)) - { - client->errorValue = mode; - return BadValue; - } - if ((format != 8) && (format != 16) && (format != 32)) - { - client->errorValue = format; - return BadValue; - } - len = stuff->nUnits; - if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2)) - return BadLength; - sizeInBytes = format>>3; - totalSize = len * sizeInBytes; - REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); - -#ifdef NXAGENT_CLIPBOARD - { - extern WindowPtr nxagentGetClipboardWindow(Atom, WindowPtr); - - pWin = nxagentGetClipboardWindow(stuff->property, NULL); - } - - if (pWin == NULL) -#endif - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return(BadAtom); - } - if (!ValidAtom(stuff->type)) - { - client->errorValue = stuff->type; - return(BadAtom); - } - -#ifdef XCSECURITY - switch (SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityWriteAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom; - case SecurityIgnoreOperation: - return Success; - } -#endif - -#ifdef NXAGENT_ARTSD - { - /* Do not process MCOPGLOBALS property changes, - they are already set reflecting the server side settings. - Just return success. - */ - extern Atom mcop_local_atom; - if (stuff->property == mcop_local_atom) - return client->noClientException; - } -#endif - -#ifdef LBX - err = LbxChangeWindowProperty(client, pWin, stuff->property, stuff->type, - (int)format, (int)mode, len, TRUE, (pointer)&stuff[1], TRUE, NULL); -#else - err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, - (int)mode, len, (pointer)&stuff[1], TRUE); -#endif - if (err != Success) - return err; - else - { - if (nxagentOption(Rootless) == 1) - { - nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format, - (int) mode, len, (pointer) &stuff[1]); - } - - nxagentGuessClientHint(client, stuff->property, (char *) &stuff[1]); - - nxagentGuessShadowHint(client, stuff->property); - - #ifdef NX_DEBUG_INPUT - nxagentGuessDumpInputInfo(client, stuff->property, (char *) &stuff[1]); - #endif - - return client->noClientException; - } -} - -int -ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long len, pointer value, - Bool sendevent) -{ -#ifdef LBX - return LbxChangeWindowProperty(NULL, pWin, property, type, - format, mode, len, TRUE, value, - sendevent, NULL); -#else - PropertyPtr pProp; - xEvent event; - int sizeInBytes; - int totalSize; - pointer data; - int copySize; - - sizeInBytes = format>>3; - totalSize = len * sizeInBytes; - - copySize = nxagentOption(CopyBufferSize); - - if (copySize != COPY_UNLIMITED && property == clientCutProperty) - { - if (totalSize > copySize) - { - totalSize = copySize; - totalSize = totalSize - (totalSize % sizeInBytes); - len = totalSize / sizeInBytes; - } - } - - /* first see if property already exists */ - - pProp = wUserProps (pWin); - while (pProp) - { - if (pProp->propertyName == property) - break; - pProp = pProp->next; - } - if (!pProp) /* just add to list */ - { - if (!pWin->optional && !MakeWindowOptional (pWin)) - return(BadAlloc); - pProp = (PropertyPtr)xalloc(sizeof(PropertyRec)); - if (!pProp) - return(BadAlloc); - data = (pointer)xalloc(totalSize); - if (!data && len) - { - xfree(pProp); - return(BadAlloc); - } - pProp->propertyName = property; - pProp->type = type; - pProp->format = format; - pProp->data = data; - if (len) - memmove((char *)data, (char *)value, totalSize); - pProp->size = len; - pProp->next = pWin->optional->userProps; - pWin->optional->userProps = pProp; - } - else - { - /* To append or prepend to a property the request format and type - must match those of the already defined property. The - existing format and type are irrelevant when using the mode - "PropModeReplace" since they will be written over. */ - - if ((format != pProp->format) && (mode != PropModeReplace)) - return(BadMatch); - if ((pProp->type != type) && (mode != PropModeReplace)) - return(BadMatch); - if (mode == PropModeReplace) - { - if (totalSize != pProp->size * (pProp->format >> 3)) - { - data = (pointer)xrealloc(pProp->data, totalSize); - if (!data && len) - return(BadAlloc); - pProp->data = data; - } - if (len) - memmove((char *)pProp->data, (char *)value, totalSize); - pProp->size = len; - pProp->type = type; - pProp->format = format; - } - else if (len == 0) - { - /* do nothing */ - } - else if (mode == PropModeAppend) - { - data = (pointer)xrealloc(pProp->data, - sizeInBytes * (len + pProp->size)); - if (!data) - return(BadAlloc); - pProp->data = data; - memmove(&((char *)data)[pProp->size * sizeInBytes], - (char *)value, - totalSize); - pProp->size += len; - } - else if (mode == PropModePrepend) - { - data = (pointer)xalloc(sizeInBytes * (len + pProp->size)); - if (!data) - return(BadAlloc); - memmove(&((char *)data)[totalSize], (char *)pProp->data, - (int)(pProp->size * sizeInBytes)); - memmove((char *)data, (char *)value, totalSize); - xfree(pProp->data); - pProp->data = data; - pProp->size += len; - } - } - if (sendevent) - { - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyNewValue; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - return(Success); -#endif -} - -int -DeleteProperty(WindowPtr pWin, Atom propName) -{ - PropertyPtr pProp, prevProp; - xEvent event; - - if (!(pProp = wUserProps (pWin))) - return(Success); - prevProp = (PropertyPtr)NULL; - while (pProp) - { - if (pProp->propertyName == propName) - break; - prevProp = pProp; - pProp = pProp->next; - } - if (pProp) - { - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - { - prevProp->next = pProp->next; - } -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - xfree(pProp->data); - xfree(pProp); - } - return(Success); -} - -void -DeleteAllWindowProperties(WindowPtr pWin) -{ - PropertyPtr pProp, pNextProp; - xEvent event; - - pProp = wUserProps (pWin); - while (pProp) - { -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - pNextProp = pProp->next; - xfree(pProp->data); - xfree(pProp); - pProp = pNextProp; - } -} - -static int -NullPropertyReply( - ClientPtr client, - ATOM propertyType, - int format, - xGetPropertyReply *reply) -{ - reply->nItems = 0; - reply->length = 0; - reply->bytesAfter = 0; - reply->propertyType = propertyType; - reply->format = format; - WriteReplyToClient(client, sizeof(xGenericReply), reply); - return(client->noClientException); -} - -/***************** - * GetProperty - * If type Any is specified, returns the property from the specified - * window regardless of its type. If a type is specified, returns the - * property only if its type equals the specified type. - * If delete is True and a property is returned, the property is also - * deleted from the window and a PropertyNotify event is generated on the - * window. - *****************/ - -int -ProcGetProperty(ClientPtr client) -{ - #ifdef NXAGENT_SERVER - nxagentWMStateRec wmState; - nxagentWMStateRec *wmsP = &wmState; - #endif - - PropertyPtr pProp, prevProp; - unsigned long n, len, ind; - WindowPtr pWin; - xGetPropertyReply reply; - REQUEST(xGetPropertyReq); - - REQUEST_SIZE_MATCH(xGetPropertyReq); - - if (stuff->delete) - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return BadWindow; - - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return(BadAtom); - } - if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) - { - client->errorValue = stuff->delete; - return(BadValue); - } - if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) - { - client->errorValue = stuff->type; - return(BadAtom); - } - - pProp = wUserProps (pWin); - prevProp = (PropertyPtr)NULL; - while (pProp) - { - if (pProp->propertyName == stuff->property) - break; - prevProp = pProp; - pProp = pProp->next; - } - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - - #ifdef NXAGENT_SERVER - - /* - * Creating a reply for WM_STATE property if it doesn't exist. - * This is intended to allow drag & drop work in JAva 1.6 when - * the agent is connected to NXWin in multiwindow mode. - */ - - if (nxagentOption(Rootless) && - nxagentWindowTopLevel(pWin) && - (!pProp) && - strcmp(NameForAtom(stuff->property), "WM_STATE") == 0) - { - wmState.state = 1; - wmState.icon = None; - - if (ChangeWindowProperty(pWin, stuff->property, stuff->property, 32, 0, 2, &wmState, 1) == Success) - { - nxagentExportProperty(pWin, stuff->property, stuff->property, 32, 0, 2, &wmState); - } - - n = 8; - ind = stuff->longOffset << 2; - - if (n < ind) - { - client->errorValue = stuff->longOffset; - return BadValue; - } - - len = min(n - ind, 4 * stuff->longLength); - - reply.bytesAfter = n - (ind + len); - reply.length = (len + 3) >> 2; - - reply.format = 32; - reply.nItems = len / 4; - reply.propertyType = stuff->property; - - WriteReplyToClient(client, sizeof(xGenericReply), &reply); - - if (len) - { - client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; - - WriteSwappedDataToClient(client, len, (char *)wmsP + ind); - } - - return(client->noClientException); - } - #endif - - if (!pProp) - return NullPropertyReply(client, None, 0, &reply); - -#ifdef XCSECURITY - { - Mask access_mode = SecurityReadAccess; - - if (stuff->delete) - access_mode |= SecurityDestroyAccess; - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - access_mode)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return NullPropertyReply(client, pProp->type, pProp->format, - &reply); - } - } -#endif - /* If the request type and actual type don't match. Return the - property information, but not the data. */ - - if (((stuff->type != pProp->type) && - (stuff->type != AnyPropertyType)) - ) - { - reply.bytesAfter = pProp->size; - reply.format = pProp->format; - reply.length = 0; - reply.nItems = 0; - reply.propertyType = pProp->type; - WriteReplyToClient(client, sizeof(xGenericReply), &reply); - return(Success); - } -#ifdef LBX - /* make sure we have the current value */ - if (pProp->tag_id && pProp->owner_pid) { - LbxStallPropRequest(client, pProp); - return client->noClientException; - } -#endif - -/* - * Return type, format, value to client - */ - n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - ind = stuff->longOffset << 2; - - /* If longOffset is invalid such that it causes "len" to - be negative, it's a value error. */ - - if (n < ind) - { - client->errorValue = stuff->longOffset; - return BadValue; - } - - len = min(n - ind, 4 * stuff->longLength); - - reply.bytesAfter = n - (ind + len); - reply.format = pProp->format; - reply.length = (len + 3) >> 2; - reply.nItems = len / (pProp->format / 8 ); - reply.propertyType = pProp->type; - - if (stuff->delete && (reply.bytesAfter == 0)) - { /* send the event */ - xEvent event; - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - - WriteReplyToClient(client, sizeof(xGenericReply), &reply); - if (len) - { - switch (reply.format) { - case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break; - case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break; - default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break; - } - WriteSwappedDataToClient(client, len, - (char *)pProp->data + ind); - } - - if (stuff->delete && (reply.bytesAfter == 0)) - { /* delete the Property */ -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - prevProp->next = pProp->next; - xfree(pProp->data); - xfree(pProp); - } - return(client->noClientException); -} - -#ifdef NXAGENT_CLIPBOARD -/* GetWindowProperty clipboard use only */ -int -GetWindowProperty(pWin, property, longOffset, longLength, delete, - type, actualType, format, nItems, bytesAfter, propData ) - WindowPtr pWin; - Atom property; - long longOffset; - long longLength; - Bool delete; - Atom type; - Atom *actualType; - int *format; - unsigned long *nItems; - unsigned long *bytesAfter; - unsigned char **propData; -{ - PropertyPtr pProp, prevProp; - unsigned long n, len, ind; - - if (!pWin) - return BadWindow; - - - if (!ValidAtom(property)) - { - return(BadAtom); - } - if ((type != AnyPropertyType) && !ValidAtom(type)) - { - return(BadAtom); - } - - pProp = wUserProps (pWin); - prevProp = (PropertyPtr)NULL; - - while (pProp) - { - if (pProp->propertyName == property) - break; - prevProp = pProp; - pProp = pProp->next; - } - - - if (!pProp) - return (BadAtom); - - /* If the request type and actual type don't match. Return the - property information, but not the data. */ - - if (((type != pProp->type) && - (type != AnyPropertyType)) - ) - { - *bytesAfter = pProp->size; - *format = pProp->format; - *nItems = 0; - *actualType = pProp->type; - return(Success); - } - -/* - * Return type, format, value to client - */ - n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - ind = longOffset << 2; - - /* If longOffset is invalid such that it causes "len" to - be negative, it's a value error. */ - - if (n < ind) - { - return BadValue; - } - - len = min(n - ind, 4 * longLength); - - *bytesAfter = n - (ind + len); - *format = pProp->format; - *nItems = len / (pProp->format / 8 ); - *actualType = pProp->type; - - if (delete && (*bytesAfter == 0)) - { /* send the event */ - xEvent event; - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - - if (len) - { - *propData = (unsigned char *)(pProp->data) + ind; - } - - if (delete && (*bytesAfter == 0)) - { /* delete the Property */ -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - prevProp->next = pProp->next; - xfree(pProp->data); - xfree(pProp); - } - return(Success); -} -#endif - -int -ProcListProperties(ClientPtr client) -{ - Atom *pAtoms = NULL, *temppAtoms; - xListPropertiesReply xlpr; - int numProps = 0; - WindowPtr pWin; - PropertyPtr pProp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - pProp = wUserProps (pWin); - while (pProp) - { - pProp = pProp->next; - numProps++; - } - if (numProps) - if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) - return(BadAlloc); - - xlpr.type = X_Reply; - xlpr.nProperties = numProps; - xlpr.length = (numProps * sizeof(Atom)) >> 2; - xlpr.sequenceNumber = client->sequence; - pProp = wUserProps (pWin); - temppAtoms = pAtoms; - while (pProp) - { - *temppAtoms++ = pProp->propertyName; - pProp = pProp->next; - } - WriteReplyToClient(client, sizeof(xGenericReply), &xlpr); - if (numProps) - { - client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; - WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - DEALLOCATE_LOCAL(pAtoms); - } - return(client->noClientException); -} - -int -ProcDeleteProperty(register ClientPtr client) -{ - WindowPtr pWin; - REQUEST(xDeletePropertyReq); - int result; - - REQUEST_SIZE_MATCH(xDeletePropertyReq); - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return (BadAtom); - } - -#ifdef XCSECURITY - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityDestroyAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return Success; - } -#endif - - result = DeleteProperty(pWin, stuff->property); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.X.original deleted file mode 100644 index cabe46ecc..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.X.original +++ /dev/null @@ -1,729 +0,0 @@ -/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: property.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include "windowstr.h" -#include "propertyst.h" -#include "dixstruct.h" -#include "dispatch.h" -#include "swaprep.h" -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif -#ifdef LBX -#include "lbxserve.h" -#include "lbxtags.h" -#endif - -#if defined(LBX) || defined(LBX_COMPAT) -#if 0 /* no header in X11 environment, not used in X11 environment */ -int fWriteToClient(ClientPtr client, int len, char *buf) -{ - return WriteToClient(client, len, buf); -} -#endif -#endif - -/***************************************************************** - * Property Stuff - * - * ChangeProperty, DeleteProperty, GetProperties, - * ListProperties - * - * Properties below to windows. A allocate slots each time - * a property is added. No fancy searching done. - * - *****************************************************************/ - -#ifdef notdef -static void -PrintPropertys(WindowPtr pWin) -{ - PropertyPtr pProp; - register int j; - - pProp = pWin->userProps; - while (pProp) - { - ErrorF( "%x %x\n", pProp->propertyName, pProp->type); - ErrorF("property format: %d\n", pProp->format); - ErrorF("property data: \n"); - for (j=0; j<(pProp->format/8)*pProp->size; j++) - ErrorF("%c\n", pProp->data[j]); - pProp = pProp->next; - } -} -#endif - -int -ProcRotateProperties(ClientPtr client) -{ - int i, j, delta; - REQUEST(xRotatePropertiesReq); - WindowPtr pWin; - register Atom * atoms; - PropertyPtr * props; /* array of pointer */ - PropertyPtr pProp; - xEvent event; - - REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2); - UpdateCurrentTime(); - pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!stuff->nAtoms) - return(Success); - atoms = (Atom *) & stuff[1]; - props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr)); - if (!props) - return(BadAlloc); - for (i = 0; i < stuff->nAtoms; i++) - { -#ifdef XCSECURITY - char action = SecurityCheckPropertyAccess(client, pWin, atoms[i], - SecurityReadAccess|SecurityWriteAccess); -#endif - if (!ValidAtom(atoms[i]) -#ifdef XCSECURITY - || (SecurityErrorOperation == action) -#endif - ) - { - DEALLOCATE_LOCAL(props); - client->errorValue = atoms[i]; - return BadAtom; - } -#ifdef XCSECURITY - if (SecurityIgnoreOperation == action) - { - DEALLOCATE_LOCAL(props); - return Success; - } -#endif - for (j = i + 1; j < stuff->nAtoms; j++) - if (atoms[j] == atoms[i]) - { - DEALLOCATE_LOCAL(props); - return BadMatch; - } - pProp = wUserProps (pWin); - while (pProp) - { - if (pProp->propertyName == atoms[i]) - goto found; - pProp = pProp->next; - } - DEALLOCATE_LOCAL(props); - return BadMatch; -found: - props[i] = pProp; - } - delta = stuff->nPositions; - - /* If the rotation is a complete 360 degrees, then moving the properties - around and generating PropertyNotify events should be skipped. */ - - if ( (stuff->nAtoms != 0) && (abs(delta) % stuff->nAtoms) != 0 ) - { - while (delta < 0) /* faster if abs value is small */ - delta += stuff->nAtoms; - for (i = 0; i < stuff->nAtoms; i++) - { - /* Generate a PropertyNotify event for each property whose value - is changed in the order in which they appear in the request. */ - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyNewValue; - event.u.property.atom = props[i]->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - - props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms]; - } - } - DEALLOCATE_LOCAL(props); - return Success; -} - -int -ProcChangeProperty(ClientPtr client) -{ - WindowPtr pWin; - char format, mode; - unsigned long len; - int sizeInBytes; - int totalSize; - int err; - REQUEST(xChangePropertyReq); - - REQUEST_AT_LEAST_SIZE(xChangePropertyReq); - UpdateCurrentTime(); - format = stuff->format; - mode = stuff->mode; - if ((mode != PropModeReplace) && (mode != PropModeAppend) && - (mode != PropModePrepend)) - { - client->errorValue = mode; - return BadValue; - } - if ((format != 8) && (format != 16) && (format != 32)) - { - client->errorValue = format; - return BadValue; - } - len = stuff->nUnits; - if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2)) - return BadLength; - sizeInBytes = format>>3; - totalSize = len * sizeInBytes; - REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); - - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return(BadAtom); - } - if (!ValidAtom(stuff->type)) - { - client->errorValue = stuff->type; - return(BadAtom); - } - -#ifdef XCSECURITY - switch (SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityWriteAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom; - case SecurityIgnoreOperation: - return Success; - } -#endif - -#ifdef LBX - err = LbxChangeWindowProperty(client, pWin, stuff->property, stuff->type, - (int)format, (int)mode, len, TRUE, (pointer)&stuff[1], TRUE, NULL); -#else - err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, - (int)mode, len, (pointer)&stuff[1], TRUE); -#endif - if (err != Success) - return err; - else - return client->noClientException; -} - -int -ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long len, pointer value, - Bool sendevent) -{ -#ifdef LBX - return LbxChangeWindowProperty(NULL, pWin, property, type, - format, mode, len, TRUE, value, - sendevent, NULL); -#else - PropertyPtr pProp; - xEvent event; - int sizeInBytes; - int totalSize; - pointer data; - - sizeInBytes = format>>3; - totalSize = len * sizeInBytes; - - /* first see if property already exists */ - - pProp = wUserProps (pWin); - while (pProp) - { - if (pProp->propertyName == property) - break; - pProp = pProp->next; - } - if (!pProp) /* just add to list */ - { - if (!pWin->optional && !MakeWindowOptional (pWin)) - return(BadAlloc); - pProp = (PropertyPtr)xalloc(sizeof(PropertyRec)); - if (!pProp) - return(BadAlloc); - data = (pointer)xalloc(totalSize); - if (!data && len) - { - xfree(pProp); - return(BadAlloc); - } - pProp->propertyName = property; - pProp->type = type; - pProp->format = format; - pProp->data = data; - if (len) - memmove((char *)data, (char *)value, totalSize); - pProp->size = len; - pProp->next = pWin->optional->userProps; - pWin->optional->userProps = pProp; - } - else - { - /* To append or prepend to a property the request format and type - must match those of the already defined property. The - existing format and type are irrelevant when using the mode - "PropModeReplace" since they will be written over. */ - - if ((format != pProp->format) && (mode != PropModeReplace)) - return(BadMatch); - if ((pProp->type != type) && (mode != PropModeReplace)) - return(BadMatch); - if (mode == PropModeReplace) - { - if (totalSize != pProp->size * (pProp->format >> 3)) - { - data = (pointer)xrealloc(pProp->data, totalSize); - if (!data && len) - return(BadAlloc); - pProp->data = data; - } - if (len) - memmove((char *)pProp->data, (char *)value, totalSize); - pProp->size = len; - pProp->type = type; - pProp->format = format; - } - else if (len == 0) - { - /* do nothing */ - } - else if (mode == PropModeAppend) - { - data = (pointer)xrealloc(pProp->data, - sizeInBytes * (len + pProp->size)); - if (!data) - return(BadAlloc); - pProp->data = data; - memmove(&((char *)data)[pProp->size * sizeInBytes], - (char *)value, - totalSize); - pProp->size += len; - } - else if (mode == PropModePrepend) - { - data = (pointer)xalloc(sizeInBytes * (len + pProp->size)); - if (!data) - return(BadAlloc); - memmove(&((char *)data)[totalSize], (char *)pProp->data, - (int)(pProp->size * sizeInBytes)); - memmove((char *)data, (char *)value, totalSize); - xfree(pProp->data); - pProp->data = data; - pProp->size += len; - } - } - if (sendevent) - { - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyNewValue; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - return(Success); -#endif -} - -int -DeleteProperty(WindowPtr pWin, Atom propName) -{ - PropertyPtr pProp, prevProp; - xEvent event; - - if (!(pProp = wUserProps (pWin))) - return(Success); - prevProp = (PropertyPtr)NULL; - while (pProp) - { - if (pProp->propertyName == propName) - break; - prevProp = pProp; - pProp = pProp->next; - } - if (pProp) - { - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - { - prevProp->next = pProp->next; - } -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - xfree(pProp->data); - xfree(pProp); - } - return(Success); -} - -void -DeleteAllWindowProperties(WindowPtr pWin) -{ - PropertyPtr pProp, pNextProp; - xEvent event; - - pProp = wUserProps (pWin); - while (pProp) - { -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - pNextProp = pProp->next; - xfree(pProp->data); - xfree(pProp); - pProp = pNextProp; - } -} - -static int -NullPropertyReply( - ClientPtr client, - ATOM propertyType, - int format, - xGetPropertyReply *reply) -{ - reply->nItems = 0; - reply->length = 0; - reply->bytesAfter = 0; - reply->propertyType = propertyType; - reply->format = format; - WriteReplyToClient(client, sizeof(xGenericReply), reply); - return(client->noClientException); -} - -/***************** - * GetProperty - * If type Any is specified, returns the property from the specified - * window regardless of its type. If a type is specified, returns the - * property only if its type equals the specified type. - * If delete is True and a property is returned, the property is also - * deleted from the window and a PropertyNotify event is generated on the - * window. - *****************/ - -int -ProcGetProperty(ClientPtr client) -{ - PropertyPtr pProp, prevProp; - unsigned long n, len, ind; - WindowPtr pWin; - xGetPropertyReply reply; - REQUEST(xGetPropertyReq); - - REQUEST_SIZE_MATCH(xGetPropertyReq); - if (stuff->delete) - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return BadWindow; - - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return(BadAtom); - } - if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) - { - client->errorValue = stuff->delete; - return(BadValue); - } - if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) - { - client->errorValue = stuff->type; - return(BadAtom); - } - - pProp = wUserProps (pWin); - prevProp = (PropertyPtr)NULL; - while (pProp) - { - if (pProp->propertyName == stuff->property) - break; - prevProp = pProp; - pProp = pProp->next; - } - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - if (!pProp) - return NullPropertyReply(client, None, 0, &reply); - -#ifdef XCSECURITY - { - Mask access_mode = SecurityReadAccess; - - if (stuff->delete) - access_mode |= SecurityDestroyAccess; - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - access_mode)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return NullPropertyReply(client, pProp->type, pProp->format, - &reply); - } - } -#endif - /* If the request type and actual type don't match. Return the - property information, but not the data. */ - - if (((stuff->type != pProp->type) && - (stuff->type != AnyPropertyType)) - ) - { - reply.bytesAfter = pProp->size; - reply.format = pProp->format; - reply.length = 0; - reply.nItems = 0; - reply.propertyType = pProp->type; - WriteReplyToClient(client, sizeof(xGenericReply), &reply); - return(Success); - } -#ifdef LBX - /* make sure we have the current value */ - if (pProp->tag_id && pProp->owner_pid) { - LbxStallPropRequest(client, pProp); - return client->noClientException; - } -#endif - -/* - * Return type, format, value to client - */ - n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - ind = stuff->longOffset << 2; - - /* If longOffset is invalid such that it causes "len" to - be negative, it's a value error. */ - - if (n < ind) - { - client->errorValue = stuff->longOffset; - return BadValue; - } - - len = min(n - ind, 4 * stuff->longLength); - - reply.bytesAfter = n - (ind + len); - reply.format = pProp->format; - reply.length = (len + 3) >> 2; - reply.nItems = len / (pProp->format / 8 ); - reply.propertyType = pProp->type; - - if (stuff->delete && (reply.bytesAfter == 0)) - { /* send the event */ - xEvent event; - - event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = PropertyDelete; - event.u.property.atom = pProp->propertyName; - event.u.property.time = currentTime.milliseconds; - DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - } - - WriteReplyToClient(client, sizeof(xGenericReply), &reply); - if (len) - { - switch (reply.format) { - case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break; - case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break; - default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break; - } - WriteSwappedDataToClient(client, len, - (char *)pProp->data + ind); - } - - if (stuff->delete && (reply.bytesAfter == 0)) - { /* delete the Property */ -#ifdef LBX - if (pProp->tag_id) - TagDeleteTag(pProp->tag_id); -#endif - if (prevProp == (PropertyPtr)NULL) /* takes care of head */ - { - if (!(pWin->optional->userProps = pProp->next)) - CheckWindowOptionalNeed (pWin); - } - else - prevProp->next = pProp->next; - xfree(pProp->data); - xfree(pProp); - } - return(client->noClientException); -} - -int -ProcListProperties(ClientPtr client) -{ - Atom *pAtoms = NULL, *temppAtoms; - xListPropertiesReply xlpr; - int numProps = 0; - WindowPtr pWin; - PropertyPtr pProp; - REQUEST(xResourceReq); - - REQUEST_SIZE_MATCH(xResourceReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - - pProp = wUserProps (pWin); - while (pProp) - { - pProp = pProp->next; - numProps++; - } - if (numProps) - if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) - return(BadAlloc); - - xlpr.type = X_Reply; - xlpr.nProperties = numProps; - xlpr.length = (numProps * sizeof(Atom)) >> 2; - xlpr.sequenceNumber = client->sequence; - pProp = wUserProps (pWin); - temppAtoms = pAtoms; - while (pProp) - { - *temppAtoms++ = pProp->propertyName; - pProp = pProp->next; - } - WriteReplyToClient(client, sizeof(xGenericReply), &xlpr); - if (numProps) - { - client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; - WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - DEALLOCATE_LOCAL(pAtoms); - } - return(client->noClientException); -} - -int -ProcDeleteProperty(register ClientPtr client) -{ - WindowPtr pWin; - REQUEST(xDeletePropertyReq); - int result; - - REQUEST_SIZE_MATCH(xDeletePropertyReq); - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return (BadAtom); - } - -#ifdef XCSECURITY - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityDestroyAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return Success; - } -#endif - - result = DeleteProperty(pWin, stuff->property); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original deleted file mode 100644 index 89e790135..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original +++ /dev/null @@ -1,3861 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/render/render.c,v 1.12 2005/08/28 19:47:39 ajax Exp $ */ -/* - * $XFree86: xc/programs/Xserver/render/render.c,v 1.27tsi Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "colormapst.h" -#include "extnsionst.h" -#include "servermd.h" -#include -#include -#include -#include "cursorstr.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#if !defined(UINT32_MAX) -#define UINT32_MAX 0xffffffffU -#endif - -#include "NXpicturestr.h" -#include "NXglyphstr.h" - -#include "Trap.h" - -#include "Render.h" -#include "Pixmaps.h" -#include "Options.h" -#include "Screen.h" -#include "Cursor.h" - -/* - * Set here the required log level. - */ - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -#ifdef TEST -#include "Literals.h" -#endif - -/* - * From NXmiglyph.c. - */ - -void miGlyphExtents(int nlist, GlyphListPtr list, - GlyphPtr *glyphs, BoxPtr extents); - -/* - * From NXmitrap.c. - */ - -void miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box); - -/* - * Functions from Render.c. - */ - -int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); -void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); -int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); -int nxagentCreatePicture(PicturePtr, Mask); -void nxagentChangePicture(PicturePtr, Mask); -int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); -void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, - INT16, INT16, INT16, INT16, CARD16, CARD16); -void nxagentCompositeRects(CARD8, PicturePtr, xRenderColor *, int, xRectangle *); -void nxagentCreateGlyphSet(GlyphSetPtr glyphSet); -void nxagentReferenceGlyphSet(GlyphSetPtr glyphSet); -void nxagentFreeGlyphs(GlyphSetPtr glyphSet, CARD32 *gids, int nglyph); -void nxagentFreeGlyphSet(GlyphSetPtr glyphSet); -void nxagentSetPictureTransform(PicturePtr pPicture, pointer transform); -void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, - pointer params, int nparams); -void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, - INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); - -void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color); - -void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, - xPointFixed *p2, int nStops, - xFixed *stops, - xRenderColor *colors); - -void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, - xPointFixed *outer, - xFixed innerRadius, - xFixed outerRadius, - int nStops, - xFixed *stops, - xRenderColor *colors); - -void nxagentRenderCreateConicalGradient(PicturePtr pPicture, - xPointFixed *center, - xFixed angle, int nStops, - xFixed *stops, - xRenderColor *colors); - - -/* - * The void pointer is actually a XGlyphElt8. - */ - -void nxagentGlyphs(CARD8, PicturePtr, PicturePtr, PictFormatPtr, - INT16, INT16, int, void *, int, GlyphPtr *); - -static int ProcRenderQueryVersion (ClientPtr pClient); -static int ProcRenderQueryPictFormats (ClientPtr pClient); -static int ProcRenderQueryPictIndexValues (ClientPtr pClient); -static int ProcRenderQueryDithers (ClientPtr pClient); -static int ProcRenderCreatePicture (ClientPtr pClient); -static int ProcRenderChangePicture (ClientPtr pClient); -static int ProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int ProcRenderFreePicture (ClientPtr pClient); -static int ProcRenderComposite (ClientPtr pClient); -static int ProcRenderScale (ClientPtr pClient); -static int ProcRenderTrapezoids (ClientPtr pClient); -static int ProcRenderTriangles (ClientPtr pClient); -static int ProcRenderTriStrip (ClientPtr pClient); -static int ProcRenderTriFan (ClientPtr pClient); -static int ProcRenderColorTrapezoids (ClientPtr pClient); -static int ProcRenderColorTriangles (ClientPtr pClient); -static int ProcRenderTransform (ClientPtr pClient); -static int ProcRenderCreateGlyphSet (ClientPtr pClient); -static int ProcRenderReferenceGlyphSet (ClientPtr pClient); -static int ProcRenderFreeGlyphSet (ClientPtr pClient); -static int ProcRenderAddGlyphs (ClientPtr pClient); -static int ProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int ProcRenderFreeGlyphs (ClientPtr pClient); -static int ProcRenderCompositeGlyphs (ClientPtr pClient); -static int ProcRenderFillRectangles (ClientPtr pClient); -static int ProcRenderCreateCursor (ClientPtr pClient); -static int ProcRenderSetPictureTransform (ClientPtr pClient); -static int ProcRenderQueryFilters (ClientPtr pClient); -static int ProcRenderSetPictureFilter (ClientPtr pClient); -static int ProcRenderCreateAnimCursor (ClientPtr pClient); -static int ProcRenderAddTraps (ClientPtr pClient); -static int ProcRenderCreateSolidFill (ClientPtr pClient); -static int ProcRenderCreateLinearGradient (ClientPtr pClient); -static int ProcRenderCreateRadialGradient (ClientPtr pClient); -static int ProcRenderCreateConicalGradient (ClientPtr pClient); - -static int ProcRenderDispatch (ClientPtr pClient); - -static int SProcRenderQueryVersion (ClientPtr pClient); -static int SProcRenderQueryPictFormats (ClientPtr pClient); -static int SProcRenderQueryPictIndexValues (ClientPtr pClient); -static int SProcRenderQueryDithers (ClientPtr pClient); -static int SProcRenderCreatePicture (ClientPtr pClient); -static int SProcRenderChangePicture (ClientPtr pClient); -static int SProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int SProcRenderFreePicture (ClientPtr pClient); -static int SProcRenderComposite (ClientPtr pClient); -static int SProcRenderScale (ClientPtr pClient); -static int SProcRenderTrapezoids (ClientPtr pClient); -static int SProcRenderTriangles (ClientPtr pClient); -static int SProcRenderTriStrip (ClientPtr pClient); -static int SProcRenderTriFan (ClientPtr pClient); -static int SProcRenderColorTrapezoids (ClientPtr pClient); -static int SProcRenderColorTriangles (ClientPtr pClient); -static int SProcRenderTransform (ClientPtr pClient); -static int SProcRenderCreateGlyphSet (ClientPtr pClient); -static int SProcRenderReferenceGlyphSet (ClientPtr pClient); -static int SProcRenderFreeGlyphSet (ClientPtr pClient); -static int SProcRenderAddGlyphs (ClientPtr pClient); -static int SProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int SProcRenderFreeGlyphs (ClientPtr pClient); -static int SProcRenderCompositeGlyphs (ClientPtr pClient); -static int SProcRenderFillRectangles (ClientPtr pClient); -static int SProcRenderCreateCursor (ClientPtr pClient); -static int SProcRenderSetPictureTransform (ClientPtr pClient); -static int SProcRenderQueryFilters (ClientPtr pClient); -static int SProcRenderSetPictureFilter (ClientPtr pClient); -static int SProcRenderCreateAnimCursor (ClientPtr pClient); -static int SProcRenderAddTraps (ClientPtr pClient); -static int SProcRenderCreateSolidFill (ClientPtr pClient); -static int SProcRenderCreateLinearGradient (ClientPtr pClient); -static int SProcRenderCreateRadialGradient (ClientPtr pClient); -static int SProcRenderCreateConicalGradient (ClientPtr pClient); - -static int SProcRenderDispatch (ClientPtr pClient); - -int (*ProcRenderVector[RenderNumberRequests])(ClientPtr) = { - ProcRenderQueryVersion, - ProcRenderQueryPictFormats, - ProcRenderQueryPictIndexValues, - ProcRenderQueryDithers, - ProcRenderCreatePicture, - ProcRenderChangePicture, - ProcRenderSetPictureClipRectangles, - ProcRenderFreePicture, - ProcRenderComposite, - ProcRenderScale, - ProcRenderTrapezoids, - ProcRenderTriangles, - ProcRenderTriStrip, - ProcRenderTriFan, - ProcRenderColorTrapezoids, - ProcRenderColorTriangles, - ProcRenderTransform, - ProcRenderCreateGlyphSet, - ProcRenderReferenceGlyphSet, - ProcRenderFreeGlyphSet, - ProcRenderAddGlyphs, - ProcRenderAddGlyphsFromPicture, - ProcRenderFreeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderFillRectangles, - ProcRenderCreateCursor, - ProcRenderSetPictureTransform, - ProcRenderQueryFilters, - ProcRenderSetPictureFilter, - ProcRenderCreateAnimCursor, - ProcRenderAddTraps, - ProcRenderCreateSolidFill, - ProcRenderCreateLinearGradient, - ProcRenderCreateRadialGradient, - ProcRenderCreateConicalGradient -}; - -int (*SProcRenderVector[RenderNumberRequests])(ClientPtr) = { - SProcRenderQueryVersion, - SProcRenderQueryPictFormats, - SProcRenderQueryPictIndexValues, - SProcRenderQueryDithers, - SProcRenderCreatePicture, - SProcRenderChangePicture, - SProcRenderSetPictureClipRectangles, - SProcRenderFreePicture, - SProcRenderComposite, - SProcRenderScale, - SProcRenderTrapezoids, - SProcRenderTriangles, - SProcRenderTriStrip, - SProcRenderTriFan, - SProcRenderColorTrapezoids, - SProcRenderColorTriangles, - SProcRenderTransform, - SProcRenderCreateGlyphSet, - SProcRenderReferenceGlyphSet, - SProcRenderFreeGlyphSet, - SProcRenderAddGlyphs, - SProcRenderAddGlyphsFromPicture, - SProcRenderFreeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderFillRectangles, - SProcRenderCreateCursor, - SProcRenderSetPictureTransform, - SProcRenderQueryFilters, - SProcRenderSetPictureFilter, - SProcRenderCreateAnimCursor, - SProcRenderAddTraps, - SProcRenderCreateSolidFill, - SProcRenderCreateLinearGradient, - SProcRenderCreateRadialGradient, - SProcRenderCreateConicalGradient -}; - -static void -RenderResetProc (ExtensionEntry *extEntry); - -#if 0 -static CARD8 RenderReqCode; -#endif -int RenderErrBase; -int RenderClientPrivateIndex; - -typedef struct _RenderClient { - int major_version; - int minor_version; -} RenderClientRec, *RenderClientPtr; - -#define GetRenderClient(pClient) ((RenderClientPtr) (pClient)->devPrivates[RenderClientPrivateIndex].ptr) - -static void -RenderClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - RenderClientPtr pRenderClient = GetRenderClient (pClient); - - pRenderClient->major_version = 0; - pRenderClient->minor_version = 0; -} - -void -RenderExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (!PictureType) - return; - if (!PictureFinishInit ()) - return; - RenderClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RenderClientPrivateIndex, - sizeof (RenderClientRec))) - return; - if (!AddCallback (&ClientStateCallback, RenderClientCallback, 0)) - return; - - extEntry = AddExtension (RENDER_NAME, 0, RenderNumberErrors, - ProcRenderDispatch, SProcRenderDispatch, - RenderResetProc, StandardMinorOpcode); - if (!extEntry) - return; -#if 0 - RenderReqCode = (CARD8) extEntry->base; -#endif - RenderErrBase = extEntry->errorBase; -} - -static void -RenderResetProc (ExtensionEntry *extEntry) -{ - ResetPicturePrivateIndex(); - ResetGlyphSetPrivateIndex(); -} - -static int -ProcRenderQueryVersion (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryVersionReply rep; - register int n; - REQUEST(xRenderQueryVersionReq); - - pRenderClient->major_version = stuff->majorVersion; - pRenderClient->minor_version = stuff->minorVersion; - - REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = nxagentRenderVersionMajor; - rep.minorVersion = nxagentRenderVersionMinor; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -#if 0 -static int -VisualDepth (ScreenPtr pScreen, VisualPtr pVisual) -{ - DepthPtr pDepth; - int d, v; - - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = pScreen->allowedDepths + d; - for (v = 0; v < pDepth->numVids; v++) - { - if (pDepth->vids[v] == pVisual->vid) - return pDepth->depth; - } - } - return 0; -} -#endif - -static VisualPtr -findVisual (ScreenPtr pScreen, VisualID vid) -{ - VisualPtr pVisual; - int v; - - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = pScreen->visuals + v; - if (pVisual->vid == vid) - return pVisual; - } - return 0; -} - -extern char *ConnectionInfo; - -static int -ProcRenderQueryPictFormats (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryPictFormatsReply *reply; - xPictScreen *pictScreen; - xPictDepth *pictDepth; - xPictVisual *pictVisual; - xPictFormInfo *pictForm; - CARD32 *pictSubpixel; - ScreenPtr pScreen; - VisualPtr pVisual; - DepthPtr pDepth; - int v, d; - PictureScreenPtr ps; - PictFormatPtr pFormat; - int nformat; - int ndepth; - int nvisual; - int rlength; - int s; - int n; - int numScreens; - int numSubpixel; - - extern int nxagentAlphaEnabled; -/* REQUEST(xRenderQueryPictFormatsReq); */ - - REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); - -#ifdef PANORAMIX - if (noPanoramiXExtension) - numScreens = screenInfo.numScreens; - else - numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; -#else - numScreens = screenInfo.numScreens; -#endif - ndepth = nformat = nvisual = 0; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = pScreen->allowedDepths + d; - ++ndepth; - - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && PictureMatchVisual (pScreen, pDepth->depth, pVisual)) - ++nvisual; - } - } - ps = GetPictureScreenIfSet(pScreen); - if (ps) - nformat += ps->nformats; - } - if (pRenderClient->major_version == 0 && pRenderClient->minor_version < 6) - numSubpixel = 0; - else - numSubpixel = numScreens; - - rlength = (sizeof (xRenderQueryPictFormatsReply) + - nformat * sizeof (xPictFormInfo) + - numScreens * sizeof (xPictScreen) + - ndepth * sizeof (xPictDepth) + - nvisual * sizeof (xPictVisual) + - numSubpixel * sizeof (CARD32)); - reply = (xRenderQueryPictFormatsReply *) xalloc (rlength); - if (!reply) - return BadAlloc; - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->numFormats = nformat; - reply->numScreens = numScreens; - reply->numDepths = ndepth; - reply->numVisuals = nvisual; - reply->numSubpixel = numSubpixel; - - pictForm = (xPictFormInfo *) (reply + 1); - - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (nformat = 0, pFormat = ps->formats; - nformat < ps->nformats; - nformat++, pFormat++) - { - pictForm->id = pFormat->id; - pictForm->type = pFormat->type; - pictForm->depth = pFormat->depth; - pictForm->direct.red = pFormat->direct.red; - pictForm->direct.redMask = pFormat->direct.redMask; - pictForm->direct.green = pFormat->direct.green; - pictForm->direct.greenMask = pFormat->direct.greenMask; - pictForm->direct.blue = pFormat->direct.blue; - pictForm->direct.blueMask = pFormat->direct.blueMask; - pictForm->direct.alpha = nxagentAlphaEnabled ? pFormat->direct.alpha : 0; - pictForm->direct.alphaMask = pFormat->direct.alphaMask; - if (pFormat->type == PictTypeIndexed && pFormat->index.pColormap) - pictForm->colormap = pFormat->index.pColormap->mid; - else - pictForm->colormap = None; - if (client->swapped) - { - swapl (&pictForm->id, n); - swaps (&pictForm->direct.red, n); - swaps (&pictForm->direct.redMask, n); - swaps (&pictForm->direct.green, n); - swaps (&pictForm->direct.greenMask, n); - swaps (&pictForm->direct.blue, n); - swaps (&pictForm->direct.blueMask, n); - swaps (&pictForm->direct.alpha, n); - swaps (&pictForm->direct.alphaMask, n); - swapl (&pictForm->colormap, n); - } - pictForm++; - } - } - } - - pictScreen = (xPictScreen *) pictForm; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - pictDepth = (xPictDepth *) (pictScreen + 1); - ndepth = 0; - for (d = 0; d < pScreen->numDepths; d++) - { - pictVisual = (xPictVisual *) (pictDepth + 1); - pDepth = pScreen->allowedDepths + d; - - nvisual = 0; - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && (pFormat = PictureMatchVisual (pScreen, - pDepth->depth, - pVisual))) - { - pictVisual->visual = pVisual->vid; - pictVisual->format = pFormat->id; - if (client->swapped) - { - swapl (&pictVisual->visual, n); - swapl (&pictVisual->format, n); - } - pictVisual++; - nvisual++; - } - } - pictDepth->depth = pDepth->depth; - pictDepth->nPictVisuals = nvisual; - if (client->swapped) - { - swaps (&pictDepth->nPictVisuals, n); - } - ndepth++; - pictDepth = (xPictDepth *) pictVisual; - } - pictScreen->nDepth = ndepth; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - pictScreen->fallback = ps->fallback->id; - else - pictScreen->fallback = 0; - if (client->swapped) - { - swapl (&pictScreen->nDepth, n); - swapl (&pictScreen->fallback, n); - } - pictScreen = (xPictScreen *) pictDepth; - } - pictSubpixel = (CARD32 *) pictScreen; - - for (s = 0; s < numSubpixel; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - *pictSubpixel = ps->subpixel; - else - *pictSubpixel = SubPixelUnknown; - if (client->swapped) - { - swapl (pictSubpixel, n); - } - ++pictSubpixel; - } - - if (client->swapped) - { - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numFormats, n); - swapl (&reply->numScreens, n); - swapl (&reply->numDepths, n); - swapl (&reply->numVisuals, n); - swapl (&reply->numSubpixel, n); - } - WriteToClient(client, rlength, (char *) reply); - xfree (reply); - return client->noClientException; -} - -static int -ProcRenderQueryPictIndexValues (ClientPtr client) -{ - PictFormatPtr pFormat; - int num; - int rlength; - int i, n; - REQUEST(xRenderQueryPictIndexValuesReq); - xRenderQueryPictIndexValuesReply *reply; - xIndexValue *values; - - REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); - - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - - if (!pFormat) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - if (pFormat->type != PictTypeIndexed) - { - client->errorValue = stuff->format; - return BadMatch; - } - num = pFormat->index.nvalues; - rlength = (sizeof (xRenderQueryPictIndexValuesReply) + - num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength); - if (!reply) - return BadAlloc; - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->numIndexValues = num; - - values = (xIndexValue *) (reply + 1); - - memcpy (reply + 1, pFormat->index.pValues, num * sizeof (xIndexValue)); - - if (client->swapped) - { - for (i = 0; i < num; i++) - { - swapl (&values[i].pixel, n); - swaps (&values[i].red, n); - swaps (&values[i].green, n); - swaps (&values[i].blue, n); - swaps (&values[i].alpha, n); - } - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numIndexValues, n); - } - - WriteToClient(client, rlength, (char *) reply); - xfree(reply); - return (client->noClientException); -} - -static int -ProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreatePicture (ClientPtr client) -{ - PicturePtr pPicture; - DrawablePtr pDrawable; - PictFormatPtr pFormat; - int len; - int error; - REQUEST(xRenderCreatePictureReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, - SecurityWriteAccess); - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - if (pFormat->depth != pDrawable->depth) - return BadMatch; - len = client->req_len - (sizeof(xRenderCreatePictureReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - - pPicture = CreatePicture (stuff->pid, - pDrawable, - pFormat, - stuff->mask, - (XID *) (stuff + 1), - client, - &error); - if (!pPicture) - return error; - nxagentCreatePicture(pPicture, stuff -> mask); - - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int -ProcRenderChangePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderChangePictureReq); - int len; - int error; - - REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - - error = ChangePicture (pPicture, stuff->mask, (XID *) (stuff + 1), - (DevUnion *) 0, client); - - nxagentChangePicture(pPicture, stuff->mask); - - return error; -} - -static int -ProcRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - PicturePtr pPicture; - int nr; - int result; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pPicture->pDrawable) - return BadDrawable; - - /* - * The original code used sizeof(xRenderChangePictureReq). - * This was harmless, as both structures have the same size. - * - * nr = (client->req_len << 2) - sizeof(xRenderChangePictureReq); - */ - nr = (client->req_len << 2) - sizeof(xRenderSetPictureClipRectanglesReq); - if (nr & 4) - return BadLength; - nr >>= 3; - result = SetPictureClipRects (pPicture, - stuff->xOrigin, stuff->yOrigin, - nr, (xRectangle *) &stuff[1]); - nxagentChangePictureClip (pPicture, - CT_NONE, - nr, - (xRectangle *) &stuff[1], - (int)stuff -> xOrigin, - (int)stuff -> yOrigin); - - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderFreePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, - RenderErrBase + BadPicture); - - FreeResource (stuff->picture, RT_NONE); - return(client->noClientException); -} - -static Bool -PictOpValid (CARD8 op) -{ - if (/*PictOpMinimum <= op && */ op <= PictOpMaximum) - return TRUE; - if (PictOpDisjointMinimum <= op && op <= PictOpDisjointMaximum) - return TRUE; - if (PictOpConjointMinimum <= op && op <= PictOpConjointMaximum) - return TRUE; - return FALSE; -} - -/* - * Check if both pictures have drawables which are - * virtual pixmaps. See the corresponding define - * in NXpicture.c - */ - -#define NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - -#ifdef NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - -#define nxagentCompositePredicate(pSrc, pDst) TRUE - -#else - -/* - * This is still under development. The final - * goal is to let pictures point to the real - * pixmaps instead of pointing to virtuals. - */ - -int nxagentCompositePredicate(PicturePtr pSrc, PicturePtr pDst) -{ - PixmapPtr pPixmap1; - PixmapPtr pPixmap2; - - pPixmap1 = (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? - ((PixmapPtr) pSrc -> pDrawable) : NULL); - - pPixmap2 = (pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? - ((PixmapPtr) pDst -> pDrawable) : NULL); - - if (pPixmap1 == NULL || pPixmap2 == NULL) - { - #ifdef TEST - fprintf(stderr, "nxagentCompositePredicate: Case 0.\n"); - #endif - - return FALSE; - } - else - { - #ifdef TEST - fprintf(stderr, "nxagentCompositePredicate: Case 1.\n"); - #endif - - if (nxagentPixmapIsVirtual(pPixmap1) == 1 && - nxagentPixmapIsVirtual(pPixmap2) == 1) - { - #ifdef TEST - fprintf(stderr, "nxagentCompositePredicate: Case 2.\n"); - #endif - - return TRUE; - } - } - - #ifdef TEST - fprintf(stderr, "nxagentCompositePredicate: Case 3.\n"); - #endif - - return FALSE; -} - -#endif - -static int -ProcRenderComposite (ClientPtr client) -{ - PicturePtr pSrc, pMask, pDst; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, - RenderErrBase + BadPicture); -/* -FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst. - - if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || - (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) - return BadMatch; -*/ - if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || - (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen)) - return BadMatch; - - ValidatePicture (pSrc); - if (pMask) - ValidatePicture (pMask); - ValidatePicture (pDst); - - #ifdef NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL - - if (nxagentCompositePredicate(pSrc, pDst)) - { - #ifdef TEST - fprintf(stderr, "ProcRenderComposite: Going to composite with " - "source at [%p] mask at [%p] and destination at [%p].\n", - (void *) pSrc, (void *) pMask, (void *) pDst); - #endif - - CompositePicture (stuff->op, - pSrc, - pMask, - pDst, - stuff->xSrc, - stuff->ySrc, - stuff->xMask, - stuff->yMask, - stuff->xDst, - stuff->yDst, - stuff->width, - stuff->height); - } - - #else - - if (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP && - pDst -> pDrawable -> type == DRAWABLE_PIXMAP && - (!pMask || pMask -> pDrawable -> type == DRAWABLE_PIXMAP)) - { - PixmapPtr pVirtualPixmapSrc; - PixmapPtr pVirtualPixmapDst; - PixmapPtr pVirtualPixmapMask; - - PicturePtr pVirtualPictureSrc; - PicturePtr pVirtualPictureDst; - PicturePtr pVirtualPictureMask; - - pVirtualPixmapSrc = (PixmapPtr) pSrc -> pDrawable; - pVirtualPictureSrc = nxagentPixmapPriv(pVirtualPixmapSrc) -> pPicture; - - pVirtualPixmapDst = (PixmapPtr) pDst -> pDrawable; - pVirtualPictureDst = nxagentPixmapPriv(pVirtualPixmapDst) -> pPicture; - - if (pMask) - { - pVirtualPixmapMask = (PixmapPtr) pMask -> pDrawable; - pVirtualPictureMask = nxagentPixmapPriv(pVirtualPixmapMask) -> pPicture; - } - else - { - pVirtualPixmapMask = NULL; - pVirtualPictureMask = NULL; - } - - if (pVirtualPictureSrc && pVirtualPictureDst) - { - #ifdef TEST - fprintf(stderr, "ProcRenderComposite: Going to composite with " - "source at [%p] mask at [%p] and destination at [%p].\n", - (void *) pVirtualPixmapSrc, (void *) pVirtualPixmapMask, - (void *) pVirtualPixmapDst); - #endif - - CompositePicture (stuff->op, - pVirtualPictureSrc, - pVirtualPictureMask, - pVirtualPictureDst, - stuff->xSrc, - stuff->ySrc, - stuff->xMask, - stuff->yMask, - stuff->xDst, - stuff->yDst, - stuff->width, - stuff->height); - } - } - - #endif - - nxagentComposite (stuff -> op, - pSrc, - pMask, - pDst, - stuff -> xSrc, - stuff -> ySrc, - stuff -> xMask, - stuff -> yMask, - stuff -> xDst, - stuff -> yDst, - stuff -> width, - stuff -> height); - - return Success; -} - -static int -ProcRenderScale (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTrapezoids (ClientPtr client) -{ - int ntraps; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - ntraps = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); - if (ntraps % sizeof (xTrapezoid)) - return BadLength; - ntraps /= sizeof (xTrapezoid); - if (ntraps) - { - if (pFormat != NULL) - { - nxagentTrapezoidExtents = (BoxPtr) xalloc(sizeof(BoxRec)); - - miTrapezoidBounds (ntraps, (xTrapezoid *) &stuff[1], nxagentTrapezoidExtents); - } - - if (nxagentCompositePredicate(pSrc, pDst) == 1) - { - CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntraps, (xTrapezoid *) &stuff[1]); - } - - nxagentTrapezoids (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntraps, (xTrapezoid *) &stuff[1]); - - if (nxagentTrapezoidExtents != NullBox) - { - xfree(nxagentTrapezoidExtents); - - nxagentTrapezoidExtents = NullBox; - } - } - - return client->noClientException; -} - -static int -ProcRenderTriangles (ClientPtr client) -{ - int ntris; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - ntris = (client->req_len << 2) - sizeof (xRenderTrianglesReq); - if (ntris % sizeof (xTriangle)) - return BadLength; - ntris /= sizeof (xTriangle); - if (ntris) - CompositeTriangles (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntris, (xTriangle *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriStrip (ClientPtr client) -{ - int npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriStrip (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriFan (ClientPtr client) -{ - int npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriFan (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreateGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - PictFormatPtr format; - int f; - REQUEST(xRenderCreateGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - format = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - if (!format) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - switch (format->depth) { - case 1: - f = GlyphFormat1; - break; - case 4: - f = GlyphFormat4; - break; - case 8: - f = GlyphFormat8; - break; - case 16: - f = GlyphFormat16; - break; - case 32: - f = GlyphFormat32; - break; - default: - return BadMatch; - } - if (format->type != PictTypeDirect) - return BadMatch; - glyphSet = AllocateGlyphSet (f, format); - if (!glyphSet) - return BadAlloc; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - - nxagentCreateGlyphSet(glyphSet); - - return Success; -} - -static int -ProcRenderReferenceGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderReferenceGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->existing, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->existing; - return RenderErrBase + BadGlyphSet; - } - glyphSet->refcnt++; - - nxagentReferenceGlyphSet(glyphSet); - - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - return client->noClientException; -} - -#define NLOCALDELTA 64 -#define NLOCALGLYPH 256 - -static int -ProcRenderFreeGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderFreeGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityDestroyAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - nxagentFreeGlyphSet(glyphSet); - - FreeResource (stuff->glyphset, RT_NONE); - return client->noClientException; -} - -typedef struct _GlyphNew { - Glyph id; - GlyphPtr glyph; -} GlyphNewRec, *GlyphNewPtr; - -static int -ProcRenderAddGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderAddGlyphsReq); - GlyphNewRec glyphsLocal[NLOCALGLYPH]; - GlyphNewPtr glyphsBase, glyphs; - GlyphPtr glyph = NULL; - int remain, nglyphs; - CARD32 *gids; - xGlyphInfo *gi; - CARD8 *bits; - int size; - int err = BadAlloc; - - int totSizeImages; - - REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - nglyphs = stuff->nglyphs; - if (nglyphs > UINT32_MAX / sizeof(GlyphNewRec)) - return BadAlloc; - - if (nglyphs <= NLOCALGLYPH) - glyphsBase = glyphsLocal; - else - { - glyphsBase = (GlyphNewPtr) Xalloc (nglyphs * sizeof (GlyphNewRec)); - if (!glyphsBase) - return BadAlloc; - } - - remain = (client->req_len << 2) - sizeof (xRenderAddGlyphsReq); - - glyphs = glyphsBase; - - totSizeImages = 0; - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + nglyphs); - bits = (CARD8 *) (gi + nglyphs); - remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs; - - while (remain >= 0 && nglyphs) - { - glyph = AllocateGlyph (gi, glyphSet->fdepth); - if (!glyph) - { - err = BadAlloc; - goto bail; - } - - glyphs->glyph = glyph; - glyphs->id = *gids; - - size = glyph->size - sizeof (xGlyphInfo); - if (remain < size) - break; - memcpy ((CARD8 *) (glyph + 1), bits, size); - - if (size & 3) - size += 4 - (size & 3); - bits += size; - totSizeImages += size; - remain -= size; - gi++; - gids++; - glyphs++; - nglyphs--; - } - - if (nglyphs || remain) - { - err = BadLength; - goto bail; - } - nglyphs = stuff->nglyphs; - if (!ResizeGlyphSet (glyphSet, nglyphs)) - { - err = BadAlloc; - goto bail; - } - glyphs = glyphsBase; - while (nglyphs--) { - AddGlyph (glyphSet, glyphs->glyph, glyphs->id); - glyphs++; - } - - if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); - return client->noClientException; -bail: - while (glyphs != glyphsBase) - { - --glyphs; - xfree (glyphs->glyph); - } - if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); - return err; -} - -static int -ProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderFreeGlyphs (ClientPtr client) -{ - REQUEST(xRenderFreeGlyphsReq); - GlyphSetPtr glyphSet; - int nglyph; - CARD32 *gids; - CARD32 glyph; - - REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - nglyph = ((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)) >> 2; - gids = (CARD32 *) (stuff + 1); - - nxagentFreeGlyphs(glyphSet, gids, nglyph); - - while (nglyph-- > 0) - { - glyph = *gids++; - if (!DeleteGlyph (glyphSet, glyph)) - { - client->errorValue = glyph; - return RenderErrBase + BadGlyph; - } - } - return client->noClientException; -} - -typedef struct XGlyphElt8{ - GlyphSet glyphset; - _Xconst char *chars; - int nchars; - int xOff; - int yOff; -} XGlyphElt8; - -static int -ProcRenderCompositeGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - GlyphSet gs; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - GlyphListRec listsLocal[NLOCALDELTA]; - GlyphListPtr lists, listsBase; - GlyphPtr glyphsLocal[NLOCALGLYPH]; - Glyph glyph; - GlyphPtr *glyphs, *glyphsBase; - xGlyphElt *elt; - CARD8 *buffer, *end; - int nglyph; - int nlist; - int space; - int size; - int n; - - XGlyphElt8 *elements, *elementsBase; - - REQUEST(xRenderCompositeGlyphsReq); - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityReadAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - nglyph = 0; - nlist = 0; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - buffer += 4; - } - else - { - nlist++; - nglyph += elt->len; - space = size * elt->len; - if (space & 3) - space += 4 - (space & 3); - buffer += space; - } - } - if (nglyph <= NLOCALGLYPH) - glyphsBase = glyphsLocal; - else - { - glyphsBase = (GlyphPtr *) ALLOCATE_LOCAL (nglyph * sizeof (GlyphPtr)); - if (!glyphsBase) - return BadAlloc; - } - if (nlist <= NLOCALDELTA) - listsBase = listsLocal; - else - { - listsBase = (GlyphListPtr) ALLOCATE_LOCAL (nlist * sizeof (GlyphListRec)); - if (!listsBase) - return BadAlloc; - } - - elementsBase = xalloc(nlist * sizeof(XGlyphElt8)); - if (!elementsBase) - return BadAlloc; - - buffer = (CARD8 *) (stuff + 1); - glyphs = glyphsBase; - lists = listsBase; - elements = elementsBase; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - #ifdef DEBUG - fprintf(stderr, "ProcRenderCompositeGlyphs: Glyphset change with base size [%d].\n", - size); - #endif - - if (buffer + sizeof (GlyphSet) < end) - { - memcpy(&gs, buffer, sizeof(GlyphSet)); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - gs, - GlyphSetType, - SecurityReadAccess); - if (!glyphSet) - { - client->errorValue = gs; - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); - return RenderErrBase + BadGlyphSet; - } - } - buffer += 4; - } - else - { - lists->xOff = elt->deltax; - lists->yOff = elt->deltay; - lists->format = glyphSet->format; - lists->len = 0; - - if (glyphSet -> remoteID == 0) - { - #ifdef TEST - fprintf(stderr, "ProcRenderCompositeGlyphs: Going to reconnect glyphset at [%p].\n", - (void *) glyphSet); - #endif - - nxagentReconnectGlyphSet(glyphSet, (XID) 0, (void*) NULL); - } - - elements -> glyphset = glyphSet -> remoteID; - elements -> chars = (char *) buffer; - elements -> nchars = elt->len; - elements -> xOff = elt->deltax; - elements -> yOff = elt->deltay; - n = elt->len; - while (n--) - { - if (buffer + size <= end) - { - switch (size) { - case 1: - glyph = *((CARD8 *)buffer); break; - case 2: - glyph = *((CARD16 *)buffer); break; - case 4: - default: - glyph = *((CARD32 *)buffer); break; - } - if ((*glyphs = FindGlyph (glyphSet, glyph))) - { - lists->len++; - glyphs++; - } - } - buffer += size; - } - space = size * elt->len; - if (space & 3) - buffer += 4 - (space & 3); - lists++; - elements++; - } - } - if (buffer > end) - return BadLength; - - /* - * We need to know the glyphs extents to synchronize - * the drawables involved in the composite text ope- - * ration. Also we need to synchronize only the back- - * ground of the text we are going to render, so the - * operations on the framebuffer must be executed - * after the X requests. - */ - - nxagentGlyphsExtents = (BoxPtr) xalloc(sizeof(BoxRec)); - - miGlyphExtents(nlist, listsBase, glyphsBase, nxagentGlyphsExtents); - - nxagentGlyphs(stuff -> op, - pSrc, - pDst, - pFormat, - stuff -> xSrc, - stuff -> ySrc, - nlist, - elementsBase, - size, - glyphsBase); - - if (nxagentCompositePredicate(pSrc, pDst) == 1) - { - #ifdef TEST - fprintf(stderr, "ProcRenderCompositeGlyphs: Going to composite glyphs with " - "source at [%p] and destination at [%p].\n", - (void *) pSrc, (void *) pDst); - #endif - - CompositeGlyphs(stuff -> op, - pSrc, - pDst, - pFormat, - stuff -> xSrc, - stuff -> ySrc, - nlist, - listsBase, - glyphsBase); - } - - xfree(nxagentGlyphsExtents); - nxagentGlyphsExtents = NullBox; - - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); - - xfree(elementsBase); - - return client->noClientException; -} - -static int -ProcRenderFillRectangles (ClientPtr client) -{ - PicturePtr pDst; - int things; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - - things = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq); - if (things & 4) - return(BadLength); - things >>= 3; - - CompositeRects (stuff->op, - pDst, - &stuff->color, - things, - (xRectangle *) &stuff[1]); - - ValidatePicture (pDst); - nxagentCompositeRects(stuff -> op, - pDst, - &stuff -> color, - things, - (xRectangle *) &stuff[1]); - - return client->noClientException; -} - -static void -SetBit (unsigned char *line, int x, int bit) -{ - unsigned char mask; - - if (screenInfo.bitmapBitOrder == LSBFirst) - mask = (1 << (x & 7)); - else - mask = (0x80 >> (x & 7)); - /* XXX assumes byte order is host byte order */ - line += (x >> 3); - if (bit) - *line |= mask; - else - *line &= ~mask; -} - -#define DITHER_DIM 2 - -static CARD32 orderedDither[DITHER_DIM][DITHER_DIM] = { - { 1, 3, }, - { 4, 2, }, -}; - -#define DITHER_SIZE ((sizeof orderedDither / sizeof orderedDither[0][0]) + 1) - -static int -ProcRenderCreateCursor (ClientPtr client) -{ - REQUEST(xRenderCreateCursorReq); - PicturePtr pSrc; - ScreenPtr pScreen; - unsigned short width, height; - CARD32 *argbbits, *argb; - unsigned char *srcbits, *srcline; - unsigned char *mskbits, *mskline; - int stride; - int x, y; - int nbytes_mono; - CursorMetricRec cm; - CursorPtr pCursor; - CARD32 twocolor[3]; - int ncolor; - - RealizeCursorProcPtr saveRealizeCursor; - - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - if (!pSrc->pDrawable) - return BadDrawable; - pScreen = pSrc->pDrawable->pScreen; - width = pSrc->pDrawable->width; - height = pSrc->pDrawable->height; - if (height && width > UINT32_MAX/(height*sizeof(CARD32))) - return BadAlloc; - if ( stuff->x > width - || stuff->y > height ) - return (BadMatch); - argbbits = xalloc (width * height * sizeof (CARD32)); - if (!argbbits) - return (BadAlloc); - - stride = BitmapBytePad(width); - nbytes_mono = stride*height; - srcbits = (unsigned char *)xalloc(nbytes_mono); - if (!srcbits) - { - xfree (argbbits); - return (BadAlloc); - } - mskbits = (unsigned char *)xalloc(nbytes_mono); - if (!mskbits) - { - xfree(argbbits); - xfree(srcbits); - return (BadAlloc); - } - bzero ((char *) mskbits, nbytes_mono); - bzero ((char *) srcbits, nbytes_mono); - - if (pSrc->format == PICT_a8r8g8b8) - { - (*pScreen->GetImage) (pSrc->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - } - else - { - PixmapPtr pPixmap; - PicturePtr pPicture; - PictFormatPtr pFormat; - int error; - - pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); - if (!pFormat) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadImplementation); - } - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); - if (!pPixmap) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadAlloc); - } - pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0, - client, &error); - if (!pPicture) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return error; - } - (*pScreen->DestroyPixmap) (pPixmap); - CompositePicture (PictOpSrc, - pSrc, 0, pPicture, - 0, 0, 0, 0, 0, 0, width, height); - (*pScreen->GetImage) (pPicture->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - FreePicture (pPicture, 0); - } - /* - * Check whether the cursor can be directly supported by - * the core cursor code - */ - ncolor = 0; - argb = argbbits; - for (y = 0; ncolor <= 2 && y < height; y++) - { - for (x = 0; ncolor <= 2 && x < width; x++) - { - CARD32 p = *argb++; - CARD32 a = (p >> 24); - - if (a == 0) /* transparent */ - continue; - if (a == 0xff) /* opaque */ - { - int n; - for (n = 0; n < ncolor; n++) - if (p == twocolor[n]) - break; - if (n == ncolor) - twocolor[ncolor++] = p; - } - else - ncolor = 3; - } - } - - /* - * Convert argb image to two plane cursor - */ - srcline = srcbits; - mskline = mskbits; - argb = argbbits; - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - CARD32 p = *argb++; - - if (ncolor <= 2) - { - CARD32 a = ((p >> 24)); - - SetBit (mskline, x, a != 0); - SetBit (srcline, x, a != 0 && p == twocolor[0]); - } - else - { - CARD32 a = ((p >> 24) * DITHER_SIZE + 127) / 255; - CARD32 i = ((CvtR8G8B8toY15(p) >> 7) * DITHER_SIZE + 127) / 255; - CARD32 d = orderedDither[y&(DITHER_DIM-1)][x&(DITHER_DIM-1)]; - /* Set mask from dithered alpha value */ - SetBit(mskline, x, a > d); - /* Set src from dithered intensity value */ - SetBit(srcline, x, a > d && i <= d); - } - } - srcline += stride; - mskline += stride; - } - /* - * Dither to white and black if the cursor has more than two colors - */ - if (ncolor > 2) - { - twocolor[0] = 0xff000000; - twocolor[1] = 0xffffffff; - } - else - { - xfree (argbbits); - argbbits = 0; - } - -#define GetByte(p,s) (((p) >> (s)) & 0xff) -#define GetColor(p,s) (GetByte(p,s) | (GetByte(p,s) << 8)) - - cm.width = width; - cm.height = height; - cm.xhot = stuff->x; - cm.yhot = stuff->y; - - /* - * This cursor uses RENDER, so we make sure - * that it is allocated in a way that allows - * the mi and dix layers to handle it but we - * later create it on the server by mirror- - * ing the RENDER operation we got from the - * client. - */ - - saveRealizeCursor = pScreen -> RealizeCursor; - - pScreen -> RealizeCursor = nxagentCursorSaveRenderInfo; - - pCursor = AllocCursorARGB (srcbits, mskbits, argbbits, &cm, - GetColor(twocolor[0], 16), - GetColor(twocolor[0], 8), - GetColor(twocolor[0], 0), - GetColor(twocolor[1], 16), - GetColor(twocolor[1], 8), - GetColor(twocolor[1], 0)); - - pScreen -> RealizeCursor = saveRealizeCursor; - - /* - * Store into the private data members the - * information needed to recreate it at - * reconnection. This is done in two steps - * as in the first step we don't have the - * picture info. - */ - - if (pCursor == NULL) - { - return BadAlloc; - } - - nxagentCursorPostSaveRenderInfo(pCursor, pScreen, pSrc, stuff -> x, stuff -> y); - - nxagentRenderRealizeCursor(pScreen, pCursor); - - if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return (client->noClientException); - return BadAlloc; -} - -static int -ProcRenderSetPictureTransform (ClientPtr client) -{ - REQUEST(xRenderSetPictureTransformReq); - PicturePtr pPicture; - int result; - - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); - - nxagentSetPictureTransform(pPicture, &stuff->transform); - - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderQueryFilters (ClientPtr client) -{ - REQUEST (xRenderQueryFiltersReq); - DrawablePtr pDrawable; - xRenderQueryFiltersReply *reply; - int nbytesName; - int nnames; - ScreenPtr pScreen; - PictureScreenPtr ps; - int i, j; - int len; - int total_bytes; - INT16 *aliases; - char *names; - - REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess); - - pScreen = pDrawable->pScreen; - nbytesName = 0; - nnames = 0; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (i = 0; i < ps->nfilters; i++) - nbytesName += 1 + strlen (ps->filters[i].name); - for (i = 0; i < ps->nfilterAliases; i++) - nbytesName += 1 + strlen (ps->filterAliases[i].alias); - nnames = ps->nfilters + ps->nfilterAliases; - } - len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2); - total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) xalloc (total_bytes); - if (!reply) - return BadAlloc; - aliases = (INT16 *) (reply + 1); - names = (char *) (aliases + ((nnames + 1) & ~1)); - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = len; - reply->numAliases = nnames; - reply->numFilters = nnames; - if (ps) - { - - /* fill in alias values */ - for (i = 0; i < ps->nfilters; i++) - aliases[i] = FilterAliasNone; - for (i = 0; i < ps->nfilterAliases; i++) - { - for (j = 0; j < ps->nfilters; j++) - if (ps->filterAliases[i].filter_id == ps->filters[j].id) - break; - if (j == ps->nfilters) - { - for (j = 0; j < ps->nfilterAliases; j++) - if (ps->filterAliases[i].filter_id == - ps->filterAliases[j].alias_id) - { - break; - } - if (j == ps->nfilterAliases) - j = FilterAliasNone; - else - j = j + ps->nfilters; - } - aliases[i + ps->nfilters] = j; - } - - /* fill in filter names */ - for (i = 0; i < ps->nfilters; i++) - { - j = strlen (ps->filters[i].name); - *names++ = j; - strncpy (names, ps->filters[i].name, j); - names += j; - } - - /* fill in filter alias names */ - for (i = 0; i < ps->nfilterAliases; i++) - { - j = strlen (ps->filterAliases[i].alias); - *names++ = j; - strncpy (names, ps->filterAliases[i].alias, j); - names += j; - } - } - - if (client->swapped) - { - register int n; - - for (i = 0; i < (int)reply->numAliases; i++) - { - swaps (&aliases[i], n); - } - swaps(&reply->sequenceNumber, n); - swapl(&reply->length, n); - swapl(&reply->numAliases, n); - swapl(&reply->numFilters, n); - } - WriteToClient(client, total_bytes, (char *) reply); - xfree (reply); - - return(client->noClientException); -} - -static int -ProcRenderSetPictureFilter (ClientPtr client) -{ - REQUEST (xRenderSetPictureFilterReq); - PicturePtr pPicture; - int result; - xFixed *params; - int nparams; - char *name; - - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - name = (char *) (stuff + 1); - params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); - nparams = ((xFixed *) stuff + client->req_len) - params; - result = SetPictureFilter (pPicture, name, stuff->nbytes, params, nparams); - - nxagentSetPictureFilter(pPicture, name, stuff->nbytes, params, nparams); - - return result; -} - -static int -ProcRenderCreateAnimCursor (ClientPtr client) -{ - REQUEST(xRenderCreateAnimCursorReq); - CursorPtr *cursors; - CARD32 *deltas; - CursorPtr pCursor; - int ncursor; - xAnimCursorElt *elt; - int i; - int ret; - - REQUEST_AT_LEAST_SIZE(xRenderCreateAnimCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - if (client->req_len & 1) - return BadLength; - ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1; - cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); - if (!cursors) - return BadAlloc; - deltas = (CARD32 *) (cursors + ncursor); - elt = (xAnimCursorElt *) (stuff + 1); - for (i = 0; i < ncursor; i++) - { - cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursors[i]) - { - xfree (cursors); - client->errorValue = elt->cursor; - return BadCursor; - } - deltas[i] = elt->delay; - elt++; - } - ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor); - xfree (cursors); - if (ret != Success) - return ret; - - nxagentAnimCursorBits = pCursor -> bits; - - for (i = 0; i < MAXSCREENS; i++) - { - pCursor -> devPriv[i] = NULL; - } - - if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; - return BadAlloc; -} - -static int -ProcRenderAddTraps (ClientPtr client) -{ - int ntraps; - PicturePtr pPicture; - REQUEST(xRenderAddTrapsReq); - - REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pPicture->pDrawable) - return BadDrawable; - ntraps = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); - if (ntraps % sizeof (xTrap)) - return BadLength; - ntraps /= sizeof (xTrap); - if (ntraps) - AddTraps (pPicture, - stuff->xOff, stuff->yOff, - ntraps, (xTrap *) &stuff[1]); - return client->noClientException; -} - -static int ProcRenderCreateSolidFill(ClientPtr client) -{ - PicturePtr pPicture; - int error = 0; - REQUEST(xRenderCreateSolidFillReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); - if (!pPicture) - return error; - /* AGENT SERVER */ - - nxagentRenderCreateSolidFill(pPicture, &stuff -> color); - - /* AGENT SERVER */ - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int ProcRenderCreateLinearGradient (ClientPtr client) -{ - PicturePtr pPicture; - int len; - int error = 0; - xFixed *stops; - xRenderColor *colors; - REQUEST(xRenderCreateLinearGradientReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - stops = (xFixed *)(stuff + 1); - colors = (xRenderColor *)(stops + stuff->nStops); - - pPicture = CreateLinearGradientPicture (stuff->pid, &stuff->p1, &stuff->p2, - stuff->nStops, stops, colors, &error); - if (!pPicture) - return error; - /* AGENT SERVER */ - - nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2, - stuff->nStops, stops, colors); - - /* AGENT SERVER */ - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int ProcRenderCreateRadialGradient (ClientPtr client) -{ - PicturePtr pPicture; - int len; - int error = 0; - xFixed *stops; - xRenderColor *colors; - REQUEST(xRenderCreateRadialGradientReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - stops = (xFixed *)(stuff + 1); - colors = (xRenderColor *)(stops + stuff->nStops); - - pPicture = CreateRadialGradientPicture (stuff->pid, &stuff->inner, &stuff->outer, - stuff->inner_radius, stuff->outer_radius, - stuff->nStops, stops, colors, &error); - if (!pPicture) - return error; - /* AGENT SERVER */ - - nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer, - stuff->inner_radius, - stuff->outer_radius, - stuff->nStops, stops, colors); - - /* AGENT SERVER */ - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int ProcRenderCreateConicalGradient (ClientPtr client) -{ - PicturePtr pPicture; - int len; - int error = 0; - xFixed *stops; - xRenderColor *colors; - REQUEST(xRenderCreateConicalGradientReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - stops = (xFixed *)(stuff + 1); - colors = (xRenderColor *)(stops + stuff->nStops); - - pPicture = CreateConicalGradientPicture (stuff->pid, &stuff->center, stuff->angle, - stuff->nStops, stops, colors, &error); - if (!pPicture) - return error; - /* AGENT SERVER */ - - nxagentRenderCreateConicalGradient(pPicture, &stuff->center, - stuff->angle, stuff->nStops, stops, - colors); - - /* AGENT SERVER */ - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - - -static int -ProcRenderDispatch (ClientPtr client) -{ - int result; - - REQUEST(xReq); - - /* - * Let the client fail if we are - * hiding the RENDER extension. - */ - - if (nxagentRenderTrap) - { - return BadRequest; - } - - if (stuff->data < RenderNumberRequests) - { - #ifdef TEST - fprintf(stderr, "ProcRenderDispatch: Request [%s] OPCODE#%d.\n", - nxagentRenderRequestLiteral[stuff->data], stuff->data); - #endif - - /* - * Set the nxagentGCTrap flag while - * dispatching a render operation to - * avoid reentrancy in GCOps.c. - */ - - nxagentGCTrap = 1; - - result = (*ProcRenderVector[stuff->data]) (client); - - nxagentGCTrap = 0; - - return result; - } - else - return BadRequest; -} - -static int -SProcRenderQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return (*ProcRenderVector[stuff->renderReqType])(client); -} - -static int -SProcRenderQueryPictFormats (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictFormatsReq); - swaps(&stuff->length, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryPictIndexValues (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictIndexValuesReq); - swaps(&stuff->length, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreatePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreatePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swapl(&stuff->format, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderChangePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderChangePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureClipRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureClipRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderComposite (ClientPtr client) -{ - register int n; - REQUEST(xRenderCompositeReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->mask, n); - swapl(&stuff->dst, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xMask, n); - swaps(&stuff->yMask, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderScale (ClientPtr client) -{ - register int n; - REQUEST(xRenderScaleReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->colorScale, n); - swapl(&stuff->alphaScale, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTrapezoids (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriStrip (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriStripReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriFan (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriFanReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreateGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderReferenceGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderReferenceGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->existing, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreeGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphs (ClientPtr client) -{ - register int n; - register unsigned int i; - CARD32 *gids; - void *end; - xGlyphInfo *gi; - REQUEST(xRenderAddGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - swapl(&stuff->nglyphs, n); - if (stuff->nglyphs & 0xe0000000) - return BadLength; - end = (CARD8 *) stuff + (client->req_len << 2); - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + stuff->nglyphs); - if ((char *) end - (char *) (gids + stuff->nglyphs) < 0) - return BadLength; - if ((char *) end - (char *) (gi + stuff->nglyphs) < 0) - return BadLength; - for (i = 0; i < stuff->nglyphs; i++) - { - swapl (&gids[i], n); - swaps (&gi[i].width, n); - swaps (&gi[i].height, n); - swaps (&gi[i].x, n); - swaps (&gi[i].y, n); - swaps (&gi[i].xOff, n); - swaps (&gi[i].yOff, n); - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderFreeGlyphs (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCompositeGlyphs (ClientPtr client) -{ - register int n; - xGlyphElt *elt; - CARD8 *buffer; - CARD8 *end; - int space; - int i; - int size; - - REQUEST(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->maskFormat, n); - swapl(&stuff->glyphset, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - swaps (&elt->deltax, n); - swaps (&elt->deltay, n); - - i = elt->len; - if (i == 0xff) - { - swapl (buffer, n); - buffer += 4; - } - else - { - space = size * i; - switch (size) { - case 1: - buffer += i; - break; - case 2: - while (i--) - { - swaps (buffer, n); - buffer += 2; - } - break; - case 4: - while (i--) - { - swapl (buffer, n); - buffer += 4; - } - break; - } - if (space & 3) - buffer += 4 - (space & 3); - } - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFillRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->dst, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - swaps(&stuff->color.alpha, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateCursor (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateCursorReq); - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - swapl(&stuff->src, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureTransform (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureTransformReq); - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->transform.matrix11, n); - swapl(&stuff->transform.matrix12, n); - swapl(&stuff->transform.matrix13, n); - swapl(&stuff->transform.matrix21, n); - swapl(&stuff->transform.matrix22, n); - swapl(&stuff->transform.matrix23, n); - swapl(&stuff->transform.matrix31, n); - swapl(&stuff->transform.matrix32, n); - swapl(&stuff->transform.matrix33, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryFilters (ClientPtr client) -{ - register int n; - REQUEST (xRenderQueryFiltersReq); - REQUEST_SIZE_MATCH (xRenderQueryFiltersReq); - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureFilter (ClientPtr client) -{ - register int n; - REQUEST (xRenderSetPictureFilterReq); - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->nbytes, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateAnimCursor (ClientPtr client) -{ - register int n; - REQUEST (xRenderCreateAnimCursorReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddTraps (ClientPtr client) -{ - register int n; - REQUEST (xRenderAddTrapsReq); - REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->xOff, n); - swaps(&stuff->yOff, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateSolidFill(ClientPtr client) -{ - register int n; - REQUEST (xRenderCreateSolidFillReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swaps(&stuff->color.alpha, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static void swapStops(void *stuff, int num) -{ - int i, n; - CARD32 *stops; - CARD16 *colors; - stops = (CARD32 *)(stuff); - for (i = 0; i < num; ++i) { - swapl(stops, n); - ++stops; - } - colors = (CARD16 *)(stops); - for (i = 0; i < 4*num; ++i) { - swaps(stops, n); - ++stops; - } -} - -static int -SProcRenderCreateLinearGradient (ClientPtr client) -{ - register int n; - int len; - REQUEST (xRenderCreateLinearGradientReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->p1.x, n); - swapl(&stuff->p1.y, n); - swapl(&stuff->p2.x, n); - swapl(&stuff->p2.y, n); - swapl(&stuff->nStops, n); - - len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - swapStops(stuff+1, stuff->nStops); - - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateRadialGradient (ClientPtr client) -{ - register int n; - int len; - REQUEST (xRenderCreateRadialGradientReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->inner.x, n); - swapl(&stuff->inner.y, n); - swapl(&stuff->outer.x, n); - swapl(&stuff->outer.y, n); - swapl(&stuff->inner_radius, n); - swapl(&stuff->outer_radius, n); - swapl(&stuff->nStops, n); - - len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - swapStops(stuff+1, stuff->nStops); - - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateConicalGradient (ClientPtr client) -{ - register int n; - int len; - REQUEST (xRenderCreateConicalGradientReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->center.x, n); - swapl(&stuff->center.y, n); - swapl(&stuff->angle, n); - swapl(&stuff->nStops, n); - - len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - swapStops(stuff+1, stuff->nStops); - - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderDispatch (ClientPtr client) -{ - int result; - - REQUEST(xReq); - - /* - * Let the client fail if we are - * hiding the RENDER extension. - */ - - if (nxagentRenderTrap) - { - return BadRequest; - } - - if (stuff->data < RenderNumberRequests) - { - /* - * Set the nxagentGCTrap flag while - * dispatching a render operation to - * avoid reentrancy in GCOps.c. - */ - - nxagentGCTrap = 1; - - result = (*SProcRenderVector[stuff->data]) (client); - - nxagentGCTrap = 0; - - return result; - } - else - return BadRequest; -} - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - -#define VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err) {\ - pPicture = SecurityLookupIDByType(client, pid, XRT_PICTURE, mode);\ - if (!pPicture) { \ - client->errorValue = pid; \ - return err; \ - } \ -} - -#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode, err) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err); \ - } \ -} \ - -int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr); - -unsigned long XRT_PICTURE; - -static int -PanoramiXRenderCreatePicture (ClientPtr client) -{ - REQUEST(xRenderCreatePictureReq); - PanoramiXRes *refDraw, *newPict; - int result = Success, j; - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) - return BadAlloc; - newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; - - if (refDraw->type == XRT_WINDOW && - stuff->drawable == WindowTable[0]->drawable.id) - { - newPict->u.pict.root = TRUE; - } - else - newPict->u.pict.root = FALSE; - - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - - FOR_NSCREENS_BACKWARD(j) { - stuff->pid = newPict->info[j].id; - stuff->drawable = refDraw->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderCreatePicture]) (client); - if(result != Success) break; - } - - if (result == Success) - AddResource(newPict->info[0].id, XRT_PICTURE, newPict); - else - xfree(newPict); - - return (result); -} - -static int -PanoramiXRenderChangePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderChangePictureReq); - - REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderChangePicture]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureClipRectangles]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureTransform (ClientPtr client) -{ - REQUEST(xRenderSetPictureTransformReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureTransform]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureFilter (ClientPtr client) -{ - REQUEST(xRenderSetPictureFilterReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureFilter]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderFreePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - client->errorValue = stuff->picture; - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess, - RenderErrBase + BadPicture); - - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFreePicture]) (client); - if(result != Success) break; - } - - /* Since ProcRenderFreePicture is using FreeResource, it will free - our resource for us on the last pass through the loop above */ - - return (result); -} - -static int -PanoramiXRenderComposite (ClientPtr client) -{ - PanoramiXRes *src, *msk, *dst; - int result = Success, j; - xRenderCompositeReq orig; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - orig = *stuff; - - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - stuff->xDst = orig.xDst - panoramiXdataPtr[j].x; - stuff->yDst = orig.yDst - panoramiXdataPtr[j].y; - } - if (msk) - { - stuff->mask = msk->info[j].id; - if (msk->u.pict.root) - { - stuff->xMask = orig.xMask - panoramiXdataPtr[j].x; - stuff->yMask = orig.yMask - panoramiXdataPtr[j].y; - } - } - result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client); - if(result != Success) break; - } - - return result; -} - -static int -PanoramiXRenderCompositeGlyphs (ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderCompositeGlyphsReq); - xGlyphElt origElt, *elt; - INT16 xSrc, ySrc; - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) + - sizeof (xGlyphElt))) - { - elt = (xGlyphElt *) (stuff + 1); - origElt = *elt; - xSrc = stuff->xSrc; - ySrc = stuff->ySrc; - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - elt->deltax = origElt.deltax - panoramiXdataPtr[j].x; - elt->deltay = origElt.deltay - panoramiXdataPtr[j].y; - } - result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client); - if(result != Success) break; - } - } - - return result; -} - -static int -PanoramiXRenderFillRectangles (ClientPtr client) -{ - PanoramiXRes *dst; - int result = Success, j; - REQUEST(xRenderFillRectanglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) - { - memcpy (extra, stuff + 1, extra_len); - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) - { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xRectangle *rects = (xRectangle *) (stuff + 1); - int i = extra_len / sizeof (xRectangle); - - while (i--) - { - rects->x -= x_off; - rects->y -= y_off; - rects++; - } - } - } - stuff->dst = dst->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); - if(result != Success) break; - } - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderTrapezoids(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTrapezoidsReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xTrapezoid *trap = (xTrapezoid *) (stuff + 1); - int i = extra_len / sizeof (xTrapezoid); - - while (i--) { - trap->top -= y_off; - trap->bottom -= y_off; - trap->left.p1.x -= x_off; - trap->left.p1.y -= y_off; - trap->left.p2.x -= x_off; - trap->left.p2.y -= y_off; - trap->right.p1.x -= x_off; - trap->right.p1.y -= y_off; - trap->right.p2.x -= x_off; - trap->right.p2.y -= y_off; - trap++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTrapezoids]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderTriangles(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTrianglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xTriangle *tri = (xTriangle *) (stuff + 1); - int i = extra_len / sizeof (xTriangle); - - while (i--) { - tri->p1.x -= x_off; - tri->p1.y -= y_off; - tri->p2.x -= x_off; - tri->p2.y -= y_off; - tri->p3.x -= x_off; - tri->p3.y -= y_off; - tri++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTriangles]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderTriStrip(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTriStripReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTriStripReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xPointFixed *fixed = (xPointFixed *) (stuff + 1); - int i = extra_len / sizeof (xPointFixed); - - while (i--) { - fixed->x -= x_off; - fixed->y -= y_off; - fixed++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTriStrip]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderTriFan(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTriFanReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTriFanReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xPointFixed *fixed = (xPointFixed *) (stuff + 1); - int i = extra_len / sizeof (xPointFixed); - - while (i--) { - fixed->x -= x_off; - fixed->y -= y_off; - fixed++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTriFan]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -#if 0 /* Not implemented yet */ - -static int -PanoramiXRenderColorTrapezoids(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderColorTrapezoidsReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq); - - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - ....; - } - } - - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderColorTrapezoids]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderColorTriangles(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderColorTrianglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq); - - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - ....; - } - } - - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderColorTriangles]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -#endif - -static int -PanoramiXRenderAddTraps (ClientPtr client) -{ - PanoramiXRes *picture; - int result = Success, j; - REQUEST(xRenderAddTrapsReq); - char *extra; - int extra_len; - INT16 x_off, y_off; - - REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - VERIFY_XIN_PICTURE (picture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) - { - memcpy (extra, stuff + 1, extra_len); - x_off = stuff->xOff; - y_off = stuff->yOff; - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - stuff->picture = picture->info[j].id; - - if (picture->u.pict.root) - { - stuff->xOff = x_off + panoramiXdataPtr[j].x; - stuff->yOff = y_off + panoramiXdataPtr[j].y; - } - result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client); - if(result != Success) break; - } - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -void -PanoramiXRenderInit (void) -{ - int i; - - XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource); - for (i = 0; i < RenderNumberRequests; i++) - PanoramiXSaveRenderVector[i] = ProcRenderVector[i]; - /* - * Stuff in Xinerama aware request processing hooks - */ - ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture; - ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture; - ProcRenderVector[X_RenderSetPictureTransform] = PanoramiXRenderSetPictureTransform; - ProcRenderVector[X_RenderSetPictureFilter] = PanoramiXRenderSetPictureFilter; - ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles; - ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture; - ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite; - ProcRenderVector[X_RenderCompositeGlyphs8] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles; - - ProcRenderVector[X_RenderTrapezoids] = PanoramiXRenderTrapezoids; - ProcRenderVector[X_RenderTriangles] = PanoramiXRenderTriangles; - ProcRenderVector[X_RenderTriStrip] = PanoramiXRenderTriStrip; - ProcRenderVector[X_RenderTriFan] = PanoramiXRenderTriFan; - ProcRenderVector[X_RenderAddTraps] = PanoramiXRenderAddTraps; -} - -void -PanoramiXRenderReset (void) -{ - int i; - for (i = 0; i < RenderNumberRequests; i++) - ProcRenderVector[i] = PanoramiXSaveRenderVector[i]; -} - -#endif /* PANORAMIX */ - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.X.original deleted file mode 100644 index d25d49756..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.X.original +++ /dev/null @@ -1,3316 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/render/render.c,v 1.12 2005/08/28 19:47:39 ajax Exp $ */ -/* - * $XFree86: xc/programs/Xserver/render/render.c,v 1.27tsi Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "colormapst.h" -#include "extnsionst.h" -#include "servermd.h" -#include -#include -#include "picturestr.h" -#include "glyphstr.h" -#include -#include "cursorstr.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#if !defined(UINT32_MAX) -#define UINT32_MAX 0xffffffffU -#endif - -static int ProcRenderQueryVersion (ClientPtr pClient); -static int ProcRenderQueryPictFormats (ClientPtr pClient); -static int ProcRenderQueryPictIndexValues (ClientPtr pClient); -static int ProcRenderQueryDithers (ClientPtr pClient); -static int ProcRenderCreatePicture (ClientPtr pClient); -static int ProcRenderChangePicture (ClientPtr pClient); -static int ProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int ProcRenderFreePicture (ClientPtr pClient); -static int ProcRenderComposite (ClientPtr pClient); -static int ProcRenderScale (ClientPtr pClient); -static int ProcRenderTrapezoids (ClientPtr pClient); -static int ProcRenderTriangles (ClientPtr pClient); -static int ProcRenderTriStrip (ClientPtr pClient); -static int ProcRenderTriFan (ClientPtr pClient); -static int ProcRenderColorTrapezoids (ClientPtr pClient); -static int ProcRenderColorTriangles (ClientPtr pClient); -static int ProcRenderTransform (ClientPtr pClient); -static int ProcRenderCreateGlyphSet (ClientPtr pClient); -static int ProcRenderReferenceGlyphSet (ClientPtr pClient); -static int ProcRenderFreeGlyphSet (ClientPtr pClient); -static int ProcRenderAddGlyphs (ClientPtr pClient); -static int ProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int ProcRenderFreeGlyphs (ClientPtr pClient); -static int ProcRenderCompositeGlyphs (ClientPtr pClient); -static int ProcRenderFillRectangles (ClientPtr pClient); -static int ProcRenderCreateCursor (ClientPtr pClient); -static int ProcRenderSetPictureTransform (ClientPtr pClient); -static int ProcRenderQueryFilters (ClientPtr pClient); -static int ProcRenderSetPictureFilter (ClientPtr pClient); -static int ProcRenderCreateAnimCursor (ClientPtr pClient); -static int ProcRenderAddTraps (ClientPtr pClient); -static int ProcRenderCreateSolidFill (ClientPtr pClient); -static int ProcRenderCreateLinearGradient (ClientPtr pClient); -static int ProcRenderCreateRadialGradient (ClientPtr pClient); -static int ProcRenderCreateConicalGradient (ClientPtr pClient); - -static int ProcRenderDispatch (ClientPtr pClient); - -static int SProcRenderQueryVersion (ClientPtr pClient); -static int SProcRenderQueryPictFormats (ClientPtr pClient); -static int SProcRenderQueryPictIndexValues (ClientPtr pClient); -static int SProcRenderQueryDithers (ClientPtr pClient); -static int SProcRenderCreatePicture (ClientPtr pClient); -static int SProcRenderChangePicture (ClientPtr pClient); -static int SProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int SProcRenderFreePicture (ClientPtr pClient); -static int SProcRenderComposite (ClientPtr pClient); -static int SProcRenderScale (ClientPtr pClient); -static int SProcRenderTrapezoids (ClientPtr pClient); -static int SProcRenderTriangles (ClientPtr pClient); -static int SProcRenderTriStrip (ClientPtr pClient); -static int SProcRenderTriFan (ClientPtr pClient); -static int SProcRenderColorTrapezoids (ClientPtr pClient); -static int SProcRenderColorTriangles (ClientPtr pClient); -static int SProcRenderTransform (ClientPtr pClient); -static int SProcRenderCreateGlyphSet (ClientPtr pClient); -static int SProcRenderReferenceGlyphSet (ClientPtr pClient); -static int SProcRenderFreeGlyphSet (ClientPtr pClient); -static int SProcRenderAddGlyphs (ClientPtr pClient); -static int SProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int SProcRenderFreeGlyphs (ClientPtr pClient); -static int SProcRenderCompositeGlyphs (ClientPtr pClient); -static int SProcRenderFillRectangles (ClientPtr pClient); -static int SProcRenderCreateCursor (ClientPtr pClient); -static int SProcRenderSetPictureTransform (ClientPtr pClient); -static int SProcRenderQueryFilters (ClientPtr pClient); -static int SProcRenderSetPictureFilter (ClientPtr pClient); -static int SProcRenderCreateAnimCursor (ClientPtr pClient); -static int SProcRenderAddTraps (ClientPtr pClient); -static int SProcRenderCreateSolidFill (ClientPtr pClient); -static int SProcRenderCreateLinearGradient (ClientPtr pClient); -static int SProcRenderCreateRadialGradient (ClientPtr pClient); -static int SProcRenderCreateConicalGradient (ClientPtr pClient); - -static int SProcRenderDispatch (ClientPtr pClient); - -int (*ProcRenderVector[RenderNumberRequests])(ClientPtr) = { - ProcRenderQueryVersion, - ProcRenderQueryPictFormats, - ProcRenderQueryPictIndexValues, - ProcRenderQueryDithers, - ProcRenderCreatePicture, - ProcRenderChangePicture, - ProcRenderSetPictureClipRectangles, - ProcRenderFreePicture, - ProcRenderComposite, - ProcRenderScale, - ProcRenderTrapezoids, - ProcRenderTriangles, - ProcRenderTriStrip, - ProcRenderTriFan, - ProcRenderColorTrapezoids, - ProcRenderColorTriangles, - ProcRenderTransform, - ProcRenderCreateGlyphSet, - ProcRenderReferenceGlyphSet, - ProcRenderFreeGlyphSet, - ProcRenderAddGlyphs, - ProcRenderAddGlyphsFromPicture, - ProcRenderFreeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderFillRectangles, - ProcRenderCreateCursor, - ProcRenderSetPictureTransform, - ProcRenderQueryFilters, - ProcRenderSetPictureFilter, - ProcRenderCreateAnimCursor, - ProcRenderAddTraps, - ProcRenderCreateSolidFill, - ProcRenderCreateLinearGradient, - ProcRenderCreateRadialGradient, - ProcRenderCreateConicalGradient -}; - -int (*SProcRenderVector[RenderNumberRequests])(ClientPtr) = { - SProcRenderQueryVersion, - SProcRenderQueryPictFormats, - SProcRenderQueryPictIndexValues, - SProcRenderQueryDithers, - SProcRenderCreatePicture, - SProcRenderChangePicture, - SProcRenderSetPictureClipRectangles, - SProcRenderFreePicture, - SProcRenderComposite, - SProcRenderScale, - SProcRenderTrapezoids, - SProcRenderTriangles, - SProcRenderTriStrip, - SProcRenderTriFan, - SProcRenderColorTrapezoids, - SProcRenderColorTriangles, - SProcRenderTransform, - SProcRenderCreateGlyphSet, - SProcRenderReferenceGlyphSet, - SProcRenderFreeGlyphSet, - SProcRenderAddGlyphs, - SProcRenderAddGlyphsFromPicture, - SProcRenderFreeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderFillRectangles, - SProcRenderCreateCursor, - SProcRenderSetPictureTransform, - SProcRenderQueryFilters, - SProcRenderSetPictureFilter, - SProcRenderCreateAnimCursor, - SProcRenderAddTraps, - SProcRenderCreateSolidFill, - SProcRenderCreateLinearGradient, - SProcRenderCreateRadialGradient, - SProcRenderCreateConicalGradient -}; - -static void -RenderResetProc (ExtensionEntry *extEntry); - -#if 0 -static CARD8 RenderReqCode; -#endif -int RenderErrBase; -int RenderClientPrivateIndex; - -typedef struct _RenderClient { - int major_version; - int minor_version; -} RenderClientRec, *RenderClientPtr; - -#define GetRenderClient(pClient) ((RenderClientPtr) (pClient)->devPrivates[RenderClientPrivateIndex].ptr) - -static void -RenderClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - RenderClientPtr pRenderClient = GetRenderClient (pClient); - - pRenderClient->major_version = 0; - pRenderClient->minor_version = 0; -} - -void -RenderExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (!PictureType) - return; - if (!PictureFinishInit ()) - return; - RenderClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RenderClientPrivateIndex, - sizeof (RenderClientRec))) - return; - if (!AddCallback (&ClientStateCallback, RenderClientCallback, 0)) - return; - - extEntry = AddExtension (RENDER_NAME, 0, RenderNumberErrors, - ProcRenderDispatch, SProcRenderDispatch, - RenderResetProc, StandardMinorOpcode); - if (!extEntry) - return; -#if 0 - RenderReqCode = (CARD8) extEntry->base; -#endif - RenderErrBase = extEntry->errorBase; -} - -static void -RenderResetProc (ExtensionEntry *extEntry) -{ - ResetPicturePrivateIndex(); - ResetGlyphSetPrivateIndex(); -} - -static int -ProcRenderQueryVersion (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryVersionReply rep; - register int n; - REQUEST(xRenderQueryVersionReq); - - pRenderClient->major_version = stuff->majorVersion; - pRenderClient->minor_version = stuff->minorVersion; - - REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RENDER_MAJOR; - rep.minorVersion = RENDER_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -#if 0 -static int -VisualDepth (ScreenPtr pScreen, VisualPtr pVisual) -{ - DepthPtr pDepth; - int d, v; - - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = pScreen->allowedDepths + d; - for (v = 0; v < pDepth->numVids; v++) - { - if (pDepth->vids[v] == pVisual->vid) - return pDepth->depth; - } - } - return 0; -} -#endif - -static VisualPtr -findVisual (ScreenPtr pScreen, VisualID vid) -{ - VisualPtr pVisual; - int v; - - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = pScreen->visuals + v; - if (pVisual->vid == vid) - return pVisual; - } - return 0; -} - -extern char *ConnectionInfo; - -static int -ProcRenderQueryPictFormats (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryPictFormatsReply *reply; - xPictScreen *pictScreen; - xPictDepth *pictDepth; - xPictVisual *pictVisual; - xPictFormInfo *pictForm; - CARD32 *pictSubpixel; - ScreenPtr pScreen; - VisualPtr pVisual; - DepthPtr pDepth; - int v, d; - PictureScreenPtr ps; - PictFormatPtr pFormat; - int nformat; - int ndepth; - int nvisual; - int rlength; - int s; - int n; - int numScreens; - int numSubpixel; -/* REQUEST(xRenderQueryPictFormatsReq); */ - - REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); - -#ifdef PANORAMIX - if (noPanoramiXExtension) - numScreens = screenInfo.numScreens; - else - numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; -#else - numScreens = screenInfo.numScreens; -#endif - ndepth = nformat = nvisual = 0; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = pScreen->allowedDepths + d; - ++ndepth; - - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && PictureMatchVisual (pScreen, pDepth->depth, pVisual)) - ++nvisual; - } - } - ps = GetPictureScreenIfSet(pScreen); - if (ps) - nformat += ps->nformats; - } - if (pRenderClient->major_version == 0 && pRenderClient->minor_version < 6) - numSubpixel = 0; - else - numSubpixel = numScreens; - - rlength = (sizeof (xRenderQueryPictFormatsReply) + - nformat * sizeof (xPictFormInfo) + - numScreens * sizeof (xPictScreen) + - ndepth * sizeof (xPictDepth) + - nvisual * sizeof (xPictVisual) + - numSubpixel * sizeof (CARD32)); - reply = (xRenderQueryPictFormatsReply *) xalloc (rlength); - if (!reply) - return BadAlloc; - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->numFormats = nformat; - reply->numScreens = numScreens; - reply->numDepths = ndepth; - reply->numVisuals = nvisual; - reply->numSubpixel = numSubpixel; - - pictForm = (xPictFormInfo *) (reply + 1); - - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (nformat = 0, pFormat = ps->formats; - nformat < ps->nformats; - nformat++, pFormat++) - { - pictForm->id = pFormat->id; - pictForm->type = pFormat->type; - pictForm->depth = pFormat->depth; - pictForm->direct.red = pFormat->direct.red; - pictForm->direct.redMask = pFormat->direct.redMask; - pictForm->direct.green = pFormat->direct.green; - pictForm->direct.greenMask = pFormat->direct.greenMask; - pictForm->direct.blue = pFormat->direct.blue; - pictForm->direct.blueMask = pFormat->direct.blueMask; - pictForm->direct.alpha = pFormat->direct.alpha; - pictForm->direct.alphaMask = pFormat->direct.alphaMask; - if (pFormat->type == PictTypeIndexed && pFormat->index.pColormap) - pictForm->colormap = pFormat->index.pColormap->mid; - else - pictForm->colormap = None; - if (client->swapped) - { - swapl (&pictForm->id, n); - swaps (&pictForm->direct.red, n); - swaps (&pictForm->direct.redMask, n); - swaps (&pictForm->direct.green, n); - swaps (&pictForm->direct.greenMask, n); - swaps (&pictForm->direct.blue, n); - swaps (&pictForm->direct.blueMask, n); - swaps (&pictForm->direct.alpha, n); - swaps (&pictForm->direct.alphaMask, n); - swapl (&pictForm->colormap, n); - } - pictForm++; - } - } - } - - pictScreen = (xPictScreen *) pictForm; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - pictDepth = (xPictDepth *) (pictScreen + 1); - ndepth = 0; - for (d = 0; d < pScreen->numDepths; d++) - { - pictVisual = (xPictVisual *) (pictDepth + 1); - pDepth = pScreen->allowedDepths + d; - - nvisual = 0; - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && (pFormat = PictureMatchVisual (pScreen, - pDepth->depth, - pVisual))) - { - pictVisual->visual = pVisual->vid; - pictVisual->format = pFormat->id; - if (client->swapped) - { - swapl (&pictVisual->visual, n); - swapl (&pictVisual->format, n); - } - pictVisual++; - nvisual++; - } - } - pictDepth->depth = pDepth->depth; - pictDepth->nPictVisuals = nvisual; - if (client->swapped) - { - swaps (&pictDepth->nPictVisuals, n); - } - ndepth++; - pictDepth = (xPictDepth *) pictVisual; - } - pictScreen->nDepth = ndepth; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - pictScreen->fallback = ps->fallback->id; - else - pictScreen->fallback = 0; - if (client->swapped) - { - swapl (&pictScreen->nDepth, n); - swapl (&pictScreen->fallback, n); - } - pictScreen = (xPictScreen *) pictDepth; - } - pictSubpixel = (CARD32 *) pictScreen; - - for (s = 0; s < numSubpixel; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - *pictSubpixel = ps->subpixel; - else - *pictSubpixel = SubPixelUnknown; - if (client->swapped) - { - swapl (pictSubpixel, n); - } - ++pictSubpixel; - } - - if (client->swapped) - { - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numFormats, n); - swapl (&reply->numScreens, n); - swapl (&reply->numDepths, n); - swapl (&reply->numVisuals, n); - swapl (&reply->numSubpixel, n); - } - WriteToClient(client, rlength, (char *) reply); - xfree (reply); - return client->noClientException; -} - -static int -ProcRenderQueryPictIndexValues (ClientPtr client) -{ - PictFormatPtr pFormat; - int num; - int rlength; - int i, n; - REQUEST(xRenderQueryPictIndexValuesReq); - xRenderQueryPictIndexValuesReply *reply; - xIndexValue *values; - - REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); - - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - - if (!pFormat) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - if (pFormat->type != PictTypeIndexed) - { - client->errorValue = stuff->format; - return BadMatch; - } - num = pFormat->index.nvalues; - rlength = (sizeof (xRenderQueryPictIndexValuesReply) + - num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength); - if (!reply) - return BadAlloc; - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = (rlength - sizeof(xGenericReply)) >> 2; - reply->numIndexValues = num; - - values = (xIndexValue *) (reply + 1); - - memcpy (reply + 1, pFormat->index.pValues, num * sizeof (xIndexValue)); - - if (client->swapped) - { - for (i = 0; i < num; i++) - { - swapl (&values[i].pixel, n); - swaps (&values[i].red, n); - swaps (&values[i].green, n); - swaps (&values[i].blue, n); - swaps (&values[i].alpha, n); - } - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numIndexValues, n); - } - - WriteToClient(client, rlength, (char *) reply); - xfree(reply); - return (client->noClientException); -} - -static int -ProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreatePicture (ClientPtr client) -{ - PicturePtr pPicture; - DrawablePtr pDrawable; - PictFormatPtr pFormat; - int len; - int error; - REQUEST(xRenderCreatePictureReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, - SecurityWriteAccess); - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - if (pFormat->depth != pDrawable->depth) - return BadMatch; - len = client->req_len - (sizeof(xRenderCreatePictureReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - - pPicture = CreatePicture (stuff->pid, - pDrawable, - pFormat, - stuff->mask, - (XID *) (stuff + 1), - client, - &error); - if (!pPicture) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int -ProcRenderChangePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderChangePictureReq); - int len; - - REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); - if (Ones(stuff->mask) != len) - return BadLength; - - return ChangePicture (pPicture, stuff->mask, (XID *) (stuff + 1), - (DevUnion *) 0, client); -} - -static int -ProcRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - PicturePtr pPicture; - int nr; - int result; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pPicture->pDrawable) - return BadDrawable; - - nr = (client->req_len << 2) - sizeof(xRenderChangePictureReq); - if (nr & 4) - return BadLength; - nr >>= 3; - result = SetPictureClipRects (pPicture, - stuff->xOrigin, stuff->yOrigin, - nr, (xRectangle *) &stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderFreePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, - RenderErrBase + BadPicture); - FreeResource (stuff->picture, RT_NONE); - return(client->noClientException); -} - -static Bool -PictOpValid (CARD8 op) -{ - if (/*PictOpMinimum <= op && */ op <= PictOpMaximum) - return TRUE; - if (PictOpDisjointMinimum <= op && op <= PictOpDisjointMaximum) - return TRUE; - if (PictOpConjointMinimum <= op && op <= PictOpConjointMaximum) - return TRUE; - return FALSE; -} - -static int -ProcRenderComposite (ClientPtr client) -{ - PicturePtr pSrc, pMask, pDst; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, - RenderErrBase + BadPicture); - if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || - (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) - return BadMatch; - CompositePicture (stuff->op, - pSrc, - pMask, - pDst, - stuff->xSrc, - stuff->ySrc, - stuff->xMask, - stuff->yMask, - stuff->xDst, - stuff->yDst, - stuff->width, - stuff->height); - return Success; -} - -static int -ProcRenderScale (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTrapezoids (ClientPtr client) -{ - int ntraps; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - ntraps = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); - if (ntraps % sizeof (xTrapezoid)) - return BadLength; - ntraps /= sizeof (xTrapezoid); - if (ntraps) - CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntraps, (xTrapezoid *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriangles (ClientPtr client) -{ - int ntris; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - ntris = (client->req_len << 2) - sizeof (xRenderTrianglesReq); - if (ntris % sizeof (xTriangle)) - return BadLength; - ntris /= sizeof (xTriangle); - if (ntris) - CompositeTriangles (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntris, (xTriangle *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriStrip (ClientPtr client) -{ - int npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriStrip (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriFan (ClientPtr client) -{ - int npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriFan (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreateGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - PictFormatPtr format; - int f; - REQUEST(xRenderCreateGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - format = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->format, - PictFormatType, - SecurityReadAccess); - if (!format) - { - client->errorValue = stuff->format; - return RenderErrBase + BadPictFormat; - } - switch (format->depth) { - case 1: - f = GlyphFormat1; - break; - case 4: - f = GlyphFormat4; - break; - case 8: - f = GlyphFormat8; - break; - case 16: - f = GlyphFormat16; - break; - case 32: - f = GlyphFormat32; - break; - default: - return BadMatch; - } - if (format->type != PictTypeDirect) - return BadMatch; - glyphSet = AllocateGlyphSet (f, format); - if (!glyphSet) - return BadAlloc; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - return Success; -} - -static int -ProcRenderReferenceGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderReferenceGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->existing, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->existing; - return RenderErrBase + BadGlyphSet; - } - glyphSet->refcnt++; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - return client->noClientException; -} - -#define NLOCALDELTA 64 -#define NLOCALGLYPH 256 - -static int -ProcRenderFreeGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderFreeGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityDestroyAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - FreeResource (stuff->glyphset, RT_NONE); - return client->noClientException; -} - -typedef struct _GlyphNew { - Glyph id; - GlyphPtr glyph; -} GlyphNewRec, *GlyphNewPtr; - -static int -ProcRenderAddGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderAddGlyphsReq); - GlyphNewRec glyphsLocal[NLOCALGLYPH]; - GlyphNewPtr glyphsBase, glyphs; - GlyphPtr glyph; - int remain, nglyphs; - CARD32 *gids; - xGlyphInfo *gi; - CARD8 *bits; - int size; - int err = BadAlloc; - - REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - nglyphs = stuff->nglyphs; - if (nglyphs > UINT32_MAX / sizeof(GlyphNewRec)) - return BadAlloc; - - if (nglyphs <= NLOCALGLYPH) - glyphsBase = glyphsLocal; - else - { - glyphsBase = (GlyphNewPtr) Xalloc (nglyphs * sizeof (GlyphNewRec)); - if (!glyphsBase) - return BadAlloc; - } - - remain = (client->req_len << 2) - sizeof (xRenderAddGlyphsReq); - - glyphs = glyphsBase; - - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + nglyphs); - bits = (CARD8 *) (gi + nglyphs); - remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs; - while (remain >= 0 && nglyphs) - { - glyph = AllocateGlyph (gi, glyphSet->fdepth); - if (!glyph) - { - err = BadAlloc; - goto bail; - } - - glyphs->glyph = glyph; - glyphs->id = *gids; - - size = glyph->size - sizeof (xGlyphInfo); - if (remain < size) - break; - memcpy ((CARD8 *) (glyph + 1), bits, size); - - if (size & 3) - size += 4 - (size & 3); - bits += size; - remain -= size; - gi++; - gids++; - glyphs++; - nglyphs--; - } - if (nglyphs || remain) - { - err = BadLength; - goto bail; - } - nglyphs = stuff->nglyphs; - if (!ResizeGlyphSet (glyphSet, nglyphs)) - { - err = BadAlloc; - goto bail; - } - glyphs = glyphsBase; - while (nglyphs--) { - AddGlyph (glyphSet, glyphs->glyph, glyphs->id); - glyphs++; - } - - if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); - return client->noClientException; -bail: - while (glyphs != glyphsBase) - { - --glyphs; - xfree (glyphs->glyph); - } - if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); - return err; -} - -static int -ProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderFreeGlyphs (ClientPtr client) -{ - REQUEST(xRenderFreeGlyphsReq); - GlyphSetPtr glyphSet; - int nglyph; - CARD32 *gids; - CARD32 glyph; - - REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityWriteAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - nglyph = ((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)) >> 2; - gids = (CARD32 *) (stuff + 1); - while (nglyph-- > 0) - { - glyph = *gids++; - if (!DeleteGlyph (glyphSet, glyph)) - { - client->errorValue = glyph; - return RenderErrBase + BadGlyph; - } - } - return client->noClientException; -} - -static int -ProcRenderCompositeGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - GlyphSet gs; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - GlyphListRec listsLocal[NLOCALDELTA]; - GlyphListPtr lists, listsBase; - GlyphPtr glyphsLocal[NLOCALGLYPH]; - Glyph glyph; - GlyphPtr *glyphs, *glyphsBase; - xGlyphElt *elt; - CARD8 *buffer, *end; - int nglyph; - int nlist; - int space; - int size; - int n; - - REQUEST(xRenderCompositeGlyphsReq); - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - pFormat = (PictFormatPtr) SecurityLookupIDByType (client, - stuff->maskFormat, - PictFormatType, - SecurityReadAccess); - if (!pFormat) - { - client->errorValue = stuff->maskFormat; - return RenderErrBase + BadPictFormat; - } - } - else - pFormat = 0; - - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - stuff->glyphset, - GlyphSetType, - SecurityReadAccess); - if (!glyphSet) - { - client->errorValue = stuff->glyphset; - return RenderErrBase + BadGlyphSet; - } - - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - nglyph = 0; - nlist = 0; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - buffer += 4; - } - else - { - nlist++; - nglyph += elt->len; - space = size * elt->len; - if (space & 3) - space += 4 - (space & 3); - buffer += space; - } - } - if (nglyph <= NLOCALGLYPH) - glyphsBase = glyphsLocal; - else - { - glyphsBase = (GlyphPtr *) ALLOCATE_LOCAL (nglyph * sizeof (GlyphPtr)); - if (!glyphsBase) - return BadAlloc; - } - if (nlist <= NLOCALDELTA) - listsBase = listsLocal; - else - { - listsBase = (GlyphListPtr) ALLOCATE_LOCAL (nlist * sizeof (GlyphListRec)); - if (!listsBase) - return BadAlloc; - } - buffer = (CARD8 *) (stuff + 1); - glyphs = glyphsBase; - lists = listsBase; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - if (buffer + sizeof (GlyphSet) < end) - { - memcpy(&gs, buffer, sizeof(GlyphSet)); - glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, - gs, - GlyphSetType, - SecurityReadAccess); - if (!glyphSet) - { - client->errorValue = gs; - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); - return RenderErrBase + BadGlyphSet; - } - } - buffer += 4; - } - else - { - lists->xOff = elt->deltax; - lists->yOff = elt->deltay; - lists->format = glyphSet->format; - lists->len = 0; - n = elt->len; - while (n--) - { - if (buffer + size <= end) - { - switch (size) { - case 1: - glyph = *((CARD8 *)buffer); break; - case 2: - glyph = *((CARD16 *)buffer); break; - case 4: - default: - glyph = *((CARD32 *)buffer); break; - } - if ((*glyphs = FindGlyph (glyphSet, glyph))) - { - lists->len++; - glyphs++; - } - } - buffer += size; - } - space = size * elt->len; - if (space & 3) - buffer += 4 - (space & 3); - lists++; - } - } - if (buffer > end) - return BadLength; - - CompositeGlyphs (stuff->op, - pSrc, - pDst, - pFormat, - stuff->xSrc, - stuff->ySrc, - nlist, - listsBase, - glyphsBase); - - if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); - if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); - - return client->noClientException; -} - -static int -ProcRenderFillRectangles (ClientPtr client) -{ - PicturePtr pDst; - int things; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - - things = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq); - if (things & 4) - return(BadLength); - things >>= 3; - - CompositeRects (stuff->op, - pDst, - &stuff->color, - things, - (xRectangle *) &stuff[1]); - - return client->noClientException; -} - -static void -SetBit (unsigned char *line, int x, int bit) -{ - unsigned char mask; - - if (screenInfo.bitmapBitOrder == LSBFirst) - mask = (1 << (x & 7)); - else - mask = (0x80 >> (x & 7)); - /* XXX assumes byte order is host byte order */ - line += (x >> 3); - if (bit) - *line |= mask; - else - *line &= ~mask; -} - -#define DITHER_DIM 2 - -static CARD32 orderedDither[DITHER_DIM][DITHER_DIM] = { - { 1, 3, }, - { 4, 2, }, -}; - -#define DITHER_SIZE ((sizeof orderedDither / sizeof orderedDither[0][0]) + 1) - -static int -ProcRenderCreateCursor (ClientPtr client) -{ - REQUEST(xRenderCreateCursorReq); - PicturePtr pSrc; - ScreenPtr pScreen; - unsigned short width, height; - CARD32 *argbbits, *argb; - unsigned char *srcbits, *srcline; - unsigned char *mskbits, *mskline; - int stride; - int x, y; - int nbytes_mono; - CursorMetricRec cm; - CursorPtr pCursor; - CARD32 twocolor[3]; - int ncolor; - - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - if (!pSrc->pDrawable) - return BadDrawable; - pScreen = pSrc->pDrawable->pScreen; - width = pSrc->pDrawable->width; - height = pSrc->pDrawable->height; - if (height && width > UINT32_MAX/(height*sizeof(CARD32))) - return BadAlloc; - if ( stuff->x > width - || stuff->y > height ) - return (BadMatch); - argbbits = xalloc (width * height * sizeof (CARD32)); - if (!argbbits) - return (BadAlloc); - - stride = BitmapBytePad(width); - nbytes_mono = stride*height; - srcbits = (unsigned char *)xalloc(nbytes_mono); - if (!srcbits) - { - xfree (argbbits); - return (BadAlloc); - } - mskbits = (unsigned char *)xalloc(nbytes_mono); - if (!mskbits) - { - xfree(argbbits); - xfree(srcbits); - return (BadAlloc); - } - bzero ((char *) mskbits, nbytes_mono); - bzero ((char *) srcbits, nbytes_mono); - - if (pSrc->format == PICT_a8r8g8b8) - { - (*pScreen->GetImage) (pSrc->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - } - else - { - PixmapPtr pPixmap; - PicturePtr pPicture; - PictFormatPtr pFormat; - int error; - - pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); - if (!pFormat) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadImplementation); - } - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); - if (!pPixmap) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadAlloc); - } - pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0, - client, &error); - if (!pPicture) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return error; - } - (*pScreen->DestroyPixmap) (pPixmap); - CompositePicture (PictOpSrc, - pSrc, 0, pPicture, - 0, 0, 0, 0, 0, 0, width, height); - (*pScreen->GetImage) (pPicture->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - FreePicture (pPicture, 0); - } - /* - * Check whether the cursor can be directly supported by - * the core cursor code - */ - ncolor = 0; - argb = argbbits; - for (y = 0; ncolor <= 2 && y < height; y++) - { - for (x = 0; ncolor <= 2 && x < width; x++) - { - CARD32 p = *argb++; - CARD32 a = (p >> 24); - - if (a == 0) /* transparent */ - continue; - if (a == 0xff) /* opaque */ - { - int n; - for (n = 0; n < ncolor; n++) - if (p == twocolor[n]) - break; - if (n == ncolor) - twocolor[ncolor++] = p; - } - else - ncolor = 3; - } - } - - /* - * Convert argb image to two plane cursor - */ - srcline = srcbits; - mskline = mskbits; - argb = argbbits; - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - CARD32 p = *argb++; - - if (ncolor <= 2) - { - CARD32 a = ((p >> 24)); - - SetBit (mskline, x, a != 0); - SetBit (srcline, x, a != 0 && p == twocolor[0]); - } - else - { - CARD32 a = ((p >> 24) * DITHER_SIZE + 127) / 255; - CARD32 i = ((CvtR8G8B8toY15(p) >> 7) * DITHER_SIZE + 127) / 255; - CARD32 d = orderedDither[y&(DITHER_DIM-1)][x&(DITHER_DIM-1)]; - /* Set mask from dithered alpha value */ - SetBit(mskline, x, a > d); - /* Set src from dithered intensity value */ - SetBit(srcline, x, a > d && i <= d); - } - } - srcline += stride; - mskline += stride; - } - /* - * Dither to white and black if the cursor has more than two colors - */ - if (ncolor > 2) - { - twocolor[0] = 0xff000000; - twocolor[1] = 0xffffffff; - } - else - { - xfree (argbbits); - argbbits = 0; - } - -#define GetByte(p,s) (((p) >> (s)) & 0xff) -#define GetColor(p,s) (GetByte(p,s) | (GetByte(p,s) << 8)) - - cm.width = width; - cm.height = height; - cm.xhot = stuff->x; - cm.yhot = stuff->y; - pCursor = AllocCursorARGB (srcbits, mskbits, argbbits, &cm, - GetColor(twocolor[0], 16), - GetColor(twocolor[0], 8), - GetColor(twocolor[0], 0), - GetColor(twocolor[1], 16), - GetColor(twocolor[1], 8), - GetColor(twocolor[1], 0)); - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return (client->noClientException); - return BadAlloc; -} - -static int -ProcRenderSetPictureTransform (ClientPtr client) -{ - REQUEST(xRenderSetPictureTransformReq); - PicturePtr pPicture; - int result; - - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderQueryFilters (ClientPtr client) -{ - REQUEST (xRenderQueryFiltersReq); - DrawablePtr pDrawable; - xRenderQueryFiltersReply *reply; - int nbytesName; - int nnames; - ScreenPtr pScreen; - PictureScreenPtr ps; - int i, j; - int len; - int total_bytes; - INT16 *aliases; - char *names; - - REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess); - - pScreen = pDrawable->pScreen; - nbytesName = 0; - nnames = 0; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (i = 0; i < ps->nfilters; i++) - nbytesName += 1 + strlen (ps->filters[i].name); - for (i = 0; i < ps->nfilterAliases; i++) - nbytesName += 1 + strlen (ps->filterAliases[i].alias); - nnames = ps->nfilters + ps->nfilterAliases; - } - len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2); - total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) xalloc (total_bytes); - if (!reply) - return BadAlloc; - aliases = (INT16 *) (reply + 1); - names = (char *) (aliases + ((nnames + 1) & ~1)); - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = len; - reply->numAliases = nnames; - reply->numFilters = nnames; - if (ps) - { - - /* fill in alias values */ - for (i = 0; i < ps->nfilters; i++) - aliases[i] = FilterAliasNone; - for (i = 0; i < ps->nfilterAliases; i++) - { - for (j = 0; j < ps->nfilters; j++) - if (ps->filterAliases[i].filter_id == ps->filters[j].id) - break; - if (j == ps->nfilters) - { - for (j = 0; j < ps->nfilterAliases; j++) - if (ps->filterAliases[i].filter_id == - ps->filterAliases[j].alias_id) - { - break; - } - if (j == ps->nfilterAliases) - j = FilterAliasNone; - else - j = j + ps->nfilters; - } - aliases[i + ps->nfilters] = j; - } - - /* fill in filter names */ - for (i = 0; i < ps->nfilters; i++) - { - j = strlen (ps->filters[i].name); - *names++ = j; - strncpy (names, ps->filters[i].name, j); - names += j; - } - - /* fill in filter alias names */ - for (i = 0; i < ps->nfilterAliases; i++) - { - j = strlen (ps->filterAliases[i].alias); - *names++ = j; - strncpy (names, ps->filterAliases[i].alias, j); - names += j; - } - } - - if (client->swapped) - { - register int n; - - for (i = 0; i < reply->numAliases; i++) - { - swaps (&aliases[i], n); - } - swaps(&reply->sequenceNumber, n); - swapl(&reply->length, n); - swapl(&reply->numAliases, n); - swapl(&reply->numFilters, n); - } - WriteToClient(client, total_bytes, (char *) reply); - xfree (reply); - - return(client->noClientException); -} - -static int -ProcRenderSetPictureFilter (ClientPtr client) -{ - REQUEST (xRenderSetPictureFilterReq); - PicturePtr pPicture; - int result; - xFixed *params; - int nparams; - char *name; - - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - name = (char *) (stuff + 1); - params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); - nparams = ((xFixed *) stuff + client->req_len) - params; - result = SetPictureFilter (pPicture, name, stuff->nbytes, params, nparams); - return result; -} - -static int -ProcRenderCreateAnimCursor (ClientPtr client) -{ - REQUEST(xRenderCreateAnimCursorReq); - CursorPtr *cursors; - CARD32 *deltas; - CursorPtr pCursor; - int ncursor; - xAnimCursorElt *elt; - int i; - int ret; - - REQUEST_AT_LEAST_SIZE(xRenderCreateAnimCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - if (client->req_len & 1) - return BadLength; - ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1; - cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); - if (!cursors) - return BadAlloc; - deltas = (CARD32 *) (cursors + ncursor); - elt = (xAnimCursorElt *) (stuff + 1); - for (i = 0; i < ncursor; i++) - { - cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, - RT_CURSOR, SecurityReadAccess); - if (!cursors[i]) - { - xfree (cursors); - client->errorValue = elt->cursor; - return BadCursor; - } - deltas[i] = elt->delay; - elt++; - } - ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor); - xfree (cursors); - if (ret != Success) - return ret; - - if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; - return BadAlloc; -} - -static int -ProcRenderAddTraps (ClientPtr client) -{ - int ntraps; - PicturePtr pPicture; - REQUEST(xRenderAddTrapsReq); - - REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - if (!pPicture->pDrawable) - return BadDrawable; - ntraps = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); - if (ntraps % sizeof (xTrap)) - return BadLength; - ntraps /= sizeof (xTrap); - if (ntraps) - AddTraps (pPicture, - stuff->xOff, stuff->yOff, - ntraps, (xTrap *) &stuff[1]); - return client->noClientException; -} - -static int ProcRenderCreateSolidFill(ClientPtr client) -{ - PicturePtr pPicture; - int error = 0; - REQUEST(xRenderCreateSolidFillReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); - if (!pPicture) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int ProcRenderCreateLinearGradient (ClientPtr client) -{ - PicturePtr pPicture; - int len; - int error = 0; - xFixed *stops; - xRenderColor *colors; - REQUEST(xRenderCreateLinearGradientReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - stops = (xFixed *)(stuff + 1); - colors = (xRenderColor *)(stops + stuff->nStops); - - pPicture = CreateLinearGradientPicture (stuff->pid, &stuff->p1, &stuff->p2, - stuff->nStops, stops, colors, &error); - if (!pPicture) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int ProcRenderCreateRadialGradient (ClientPtr client) -{ - PicturePtr pPicture; - int len; - int error = 0; - xFixed *stops; - xRenderColor *colors; - REQUEST(xRenderCreateRadialGradientReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - stops = (xFixed *)(stuff + 1); - colors = (xRenderColor *)(stops + stuff->nStops); - - pPicture = CreateRadialGradientPicture (stuff->pid, &stuff->inner, &stuff->outer, - stuff->inner_radius, stuff->outer_radius, - stuff->nStops, stops, colors, &error); - if (!pPicture) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int ProcRenderCreateConicalGradient (ClientPtr client) -{ - PicturePtr pPicture; - int len; - int error = 0; - xFixed *stops; - xRenderColor *colors; - REQUEST(xRenderCreateConicalGradientReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - stops = (xFixed *)(stuff + 1); - colors = (xRenderColor *)(stops + stuff->nStops); - - pPicture = CreateConicalGradientPicture (stuff->pid, &stuff->center, stuff->angle, - stuff->nStops, stops, colors, &error); - if (!pPicture) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - - -static int -ProcRenderDispatch (ClientPtr client) -{ - REQUEST(xReq); - - if (stuff->data < RenderNumberRequests) - return (*ProcRenderVector[stuff->data]) (client); - else - return BadRequest; -} - -static int -SProcRenderQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return (*ProcRenderVector[stuff->renderReqType])(client); -} - -static int -SProcRenderQueryPictFormats (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictFormatsReq); - swaps(&stuff->length, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryPictIndexValues (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictIndexValuesReq); - swaps(&stuff->length, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreatePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreatePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swapl(&stuff->format, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderChangePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderChangePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureClipRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureClipRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderComposite (ClientPtr client) -{ - register int n; - REQUEST(xRenderCompositeReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->mask, n); - swapl(&stuff->dst, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xMask, n); - swaps(&stuff->yMask, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderScale (ClientPtr client) -{ - register int n; - REQUEST(xRenderScaleReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->colorScale, n); - swapl(&stuff->alphaScale, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTrapezoids (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriStrip (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriStripReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriFan (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriFanReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreateGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderReferenceGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderReferenceGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->existing, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreeGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphs (ClientPtr client) -{ - register int n; - register int i; - CARD32 *gids; - void *end; - xGlyphInfo *gi; - REQUEST(xRenderAddGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - swapl(&stuff->nglyphs, n); - if (stuff->nglyphs & 0xe0000000) - return BadLength; - end = (CARD8 *) stuff + (client->req_len << 2); - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + stuff->nglyphs); - if ((char *) end - (char *) (gids + stuff->nglyphs) < 0) - return BadLength; - if ((char *) end - (char *) (gi + stuff->nglyphs) < 0) - return BadLength; - for (i = 0; i < stuff->nglyphs; i++) - { - swapl (&gids[i], n); - swaps (&gi[i].width, n); - swaps (&gi[i].height, n); - swaps (&gi[i].x, n); - swaps (&gi[i].y, n); - swaps (&gi[i].xOff, n); - swaps (&gi[i].yOff, n); - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderFreeGlyphs (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCompositeGlyphs (ClientPtr client) -{ - register int n; - xGlyphElt *elt; - CARD8 *buffer; - CARD8 *end; - int space; - int i; - int size; - - REQUEST(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->maskFormat, n); - swapl(&stuff->glyphset, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - swaps (&elt->deltax, n); - swaps (&elt->deltay, n); - - i = elt->len; - if (i == 0xff) - { - swapl (buffer, n); - buffer += 4; - } - else - { - space = size * i; - switch (size) { - case 1: - buffer += i; - break; - case 2: - while (i--) - { - swaps (buffer, n); - buffer += 2; - } - break; - case 4: - while (i--) - { - swapl (buffer, n); - buffer += 4; - } - break; - } - if (space & 3) - buffer += 4 - (space & 3); - } - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFillRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->dst, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - swaps(&stuff->color.alpha, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateCursor (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateCursorReq); - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - swapl(&stuff->src, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureTransform (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureTransformReq); - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->transform.matrix11, n); - swapl(&stuff->transform.matrix12, n); - swapl(&stuff->transform.matrix13, n); - swapl(&stuff->transform.matrix21, n); - swapl(&stuff->transform.matrix22, n); - swapl(&stuff->transform.matrix23, n); - swapl(&stuff->transform.matrix31, n); - swapl(&stuff->transform.matrix32, n); - swapl(&stuff->transform.matrix33, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryFilters (ClientPtr client) -{ - register int n; - REQUEST (xRenderQueryFiltersReq); - REQUEST_SIZE_MATCH (xRenderQueryFiltersReq); - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureFilter (ClientPtr client) -{ - register int n; - REQUEST (xRenderSetPictureFilterReq); - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->nbytes, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateAnimCursor (ClientPtr client) -{ - register int n; - REQUEST (xRenderCreateAnimCursorReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddTraps (ClientPtr client) -{ - register int n; - REQUEST (xRenderAddTrapsReq); - REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->xOff, n); - swaps(&stuff->yOff, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateSolidFill(ClientPtr client) -{ - register int n; - REQUEST (xRenderCreateSolidFillReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swaps(&stuff->color.alpha, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static void swapStops(void *stuff, int num) -{ - int i, n; - CARD32 *stops; - CARD16 *colors; - stops = (CARD32 *)(stuff); - for (i = 0; i < num; ++i) { - swapl(stops, n); - ++stops; - } - colors = (CARD16 *)(stops); - for (i = 0; i < 4*num; ++i) { - swaps(stops, n); - ++stops; - } -} - -static int -SProcRenderCreateLinearGradient (ClientPtr client) -{ - register int n; - int len; - REQUEST (xRenderCreateLinearGradientReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->p1.x, n); - swapl(&stuff->p1.y, n); - swapl(&stuff->p2.x, n); - swapl(&stuff->p2.y, n); - swapl(&stuff->nStops, n); - - len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - swapStops(stuff+1, stuff->nStops); - - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateRadialGradient (ClientPtr client) -{ - register int n; - int len; - REQUEST (xRenderCreateRadialGradientReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->inner.x, n); - swapl(&stuff->inner.y, n); - swapl(&stuff->outer.x, n); - swapl(&stuff->outer.y, n); - swapl(&stuff->inner_radius, n); - swapl(&stuff->outer_radius, n); - swapl(&stuff->nStops, n); - - len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - swapStops(stuff+1, stuff->nStops); - - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateConicalGradient (ClientPtr client) -{ - register int n; - int len; - REQUEST (xRenderCreateConicalGradientReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->center.x, n); - swapl(&stuff->center.y, n); - swapl(&stuff->angle, n); - swapl(&stuff->nStops, n); - - len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - swapStops(stuff+1, stuff->nStops); - - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderDispatch (ClientPtr client) -{ - REQUEST(xReq); - - if (stuff->data < RenderNumberRequests) - return (*SProcRenderVector[stuff->data]) (client); - else - return BadRequest; -} - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - -#define VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err) {\ - pPicture = SecurityLookupIDByType(client, pid, XRT_PICTURE, mode);\ - if (!pPicture) { \ - client->errorValue = pid; \ - return err; \ - } \ -} - -#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode, err) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err); \ - } \ -} \ - -int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr); - -unsigned long XRT_PICTURE; - -static int -PanoramiXRenderCreatePicture (ClientPtr client) -{ - REQUEST(xRenderCreatePictureReq); - PanoramiXRes *refDraw, *newPict; - int result = Success, j; - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) - return BadAlloc; - newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; - - if (refDraw->type == XRT_WINDOW && - stuff->drawable == WindowTable[0]->drawable.id) - { - newPict->u.pict.root = TRUE; - } - else - newPict->u.pict.root = FALSE; - - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - - FOR_NSCREENS_BACKWARD(j) { - stuff->pid = newPict->info[j].id; - stuff->drawable = refDraw->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderCreatePicture]) (client); - if(result != Success) break; - } - - if (result == Success) - AddResource(newPict->info[0].id, XRT_PICTURE, newPict); - else - xfree(newPict); - - return (result); -} - -static int -PanoramiXRenderChangePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderChangePictureReq); - - REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderChangePicture]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureClipRectangles]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureTransform (ClientPtr client) -{ - REQUEST(xRenderSetPictureTransformReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureTransform]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureFilter (ClientPtr client) -{ - REQUEST(xRenderSetPictureFilterReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureFilter]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderFreePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - client->errorValue = stuff->picture; - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess, - RenderErrBase + BadPicture); - - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFreePicture]) (client); - if(result != Success) break; - } - - /* Since ProcRenderFreePicture is using FreeResource, it will free - our resource for us on the last pass through the loop above */ - - return (result); -} - -static int -PanoramiXRenderComposite (ClientPtr client) -{ - PanoramiXRes *src, *msk, *dst; - int result = Success, j; - xRenderCompositeReq orig; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - orig = *stuff; - - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - stuff->xDst = orig.xDst - panoramiXdataPtr[j].x; - stuff->yDst = orig.yDst - panoramiXdataPtr[j].y; - } - if (msk) - { - stuff->mask = msk->info[j].id; - if (msk->u.pict.root) - { - stuff->xMask = orig.xMask - panoramiXdataPtr[j].x; - stuff->yMask = orig.yMask - panoramiXdataPtr[j].y; - } - } - result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client); - if(result != Success) break; - } - - return result; -} - -static int -PanoramiXRenderCompositeGlyphs (ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderCompositeGlyphsReq); - xGlyphElt origElt, *elt; - INT16 xSrc, ySrc; - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) + - sizeof (xGlyphElt))) - { - elt = (xGlyphElt *) (stuff + 1); - origElt = *elt; - xSrc = stuff->xSrc; - ySrc = stuff->ySrc; - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - elt->deltax = origElt.deltax - panoramiXdataPtr[j].x; - elt->deltay = origElt.deltay - panoramiXdataPtr[j].y; - } - result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client); - if(result != Success) break; - } - } - - return result; -} - -static int -PanoramiXRenderFillRectangles (ClientPtr client) -{ - PanoramiXRes *dst; - int result = Success, j; - REQUEST(xRenderFillRectanglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) - { - memcpy (extra, stuff + 1, extra_len); - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) - { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xRectangle *rects = (xRectangle *) (stuff + 1); - int i = extra_len / sizeof (xRectangle); - - while (i--) - { - rects->x -= x_off; - rects->y -= y_off; - rects++; - } - } - } - stuff->dst = dst->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); - if(result != Success) break; - } - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderTrapezoids(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTrapezoidsReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xTrapezoid *trap = (xTrapezoid *) (stuff + 1); - int i = extra_len / sizeof (xTrapezoid); - - while (i--) { - trap->top -= y_off; - trap->bottom -= y_off; - trap->left.p1.x -= x_off; - trap->left.p1.y -= y_off; - trap->left.p2.x -= x_off; - trap->left.p2.y -= y_off; - trap->right.p1.x -= x_off; - trap->right.p1.y -= y_off; - trap->right.p2.x -= x_off; - trap->right.p2.y -= y_off; - trap++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTrapezoids]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderTriangles(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTrianglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xTriangle *tri = (xTriangle *) (stuff + 1); - int i = extra_len / sizeof (xTriangle); - - while (i--) { - tri->p1.x -= x_off; - tri->p1.y -= y_off; - tri->p2.x -= x_off; - tri->p2.y -= y_off; - tri->p3.x -= x_off; - tri->p3.y -= y_off; - tri++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTriangles]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderTriStrip(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTriStripReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTriStripReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xPointFixed *fixed = (xPointFixed *) (stuff + 1); - int i = extra_len / sizeof (xPointFixed); - - while (i--) { - fixed->x -= x_off; - fixed->y -= y_off; - fixed++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTriStrip]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderTriFan(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTriFanReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTriFanReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xPointFixed *fixed = (xPointFixed *) (stuff + 1); - int i = extra_len / sizeof (xPointFixed); - - while (i--) { - fixed->x -= x_off; - fixed->y -= y_off; - fixed++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTriFan]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -#if 0 /* Not implemented yet */ - -static int -PanoramiXRenderColorTrapezoids(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderColorTrapezoidsReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq); - - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - ....; - } - } - - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderColorTrapezoids]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -static int -PanoramiXRenderColorTriangles(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderColorTrianglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq); - - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq); - - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - ....; - } - } - - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderColorTriangles]) (client); - - if(result != Success) break; - } - - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -#endif - -static int -PanoramiXRenderAddTraps (ClientPtr client) -{ - PanoramiXRes *picture; - int result = Success, j; - REQUEST(xRenderAddTrapsReq); - char *extra; - int extra_len; - INT16 x_off, y_off; - - REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - VERIFY_XIN_PICTURE (picture, stuff->picture, client, SecurityWriteAccess, - RenderErrBase + BadPicture); - extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); - if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) - { - memcpy (extra, stuff + 1, extra_len); - x_off = stuff->xOff; - y_off = stuff->yOff; - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - stuff->picture = picture->info[j].id; - - if (picture->u.pict.root) - { - stuff->xOff = x_off + panoramiXdataPtr[j].x; - stuff->yOff = y_off + panoramiXdataPtr[j].y; - } - result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client); - if(result != Success) break; - } - DEALLOCATE_LOCAL(extra); - } - - return result; -} - -void -PanoramiXRenderInit (void) -{ - int i; - - XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource); - for (i = 0; i < RenderNumberRequests; i++) - PanoramiXSaveRenderVector[i] = ProcRenderVector[i]; - /* - * Stuff in Xinerama aware request processing hooks - */ - ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture; - ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture; - ProcRenderVector[X_RenderSetPictureTransform] = PanoramiXRenderSetPictureTransform; - ProcRenderVector[X_RenderSetPictureFilter] = PanoramiXRenderSetPictureFilter; - ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles; - ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture; - ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite; - ProcRenderVector[X_RenderCompositeGlyphs8] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles; - - ProcRenderVector[X_RenderTrapezoids] = PanoramiXRenderTrapezoids; - ProcRenderVector[X_RenderTriangles] = PanoramiXRenderTriangles; - ProcRenderVector[X_RenderTriStrip] = PanoramiXRenderTriStrip; - ProcRenderVector[X_RenderTriFan] = PanoramiXRenderTriFan; - ProcRenderVector[X_RenderAddTraps] = PanoramiXRenderAddTraps; -} - -void -PanoramiXRenderReset (void) -{ - int i; - for (i = 0; i < RenderNumberRequests; i++) - ProcRenderVector[i] = PanoramiXSaveRenderVector[i]; -} - -#endif /* PANORAMIX */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original deleted file mode 100644 index d1c8325f2..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original +++ /dev/null @@ -1,1250 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ -/* The panoramix components contained the following notice */ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/* $Xorg: resource.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/dix/resource.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ -/* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */ - -/* Routines to manage various kinds of resources: - * - * CreateNewResourceType, CreateNewResourceClass, InitClientResources, - * FakeClientID, AddResource, FreeResource, FreeClientResources, - * FreeAllResources, LookupIDByType, LookupIDByClass, GetXIDRange - */ - -/* - * A resource ID is a 32 bit quantity, the upper 2 bits of which are - * off-limits for client-visible resources. The next 8 bits are - * used as client ID, and the low 22 bits come from the client. - * A resource ID is "hashed" by extracting and xoring subfields - * (varying with the size of the hash table). - * - * It is sometimes necessary for the server to create an ID that looks - * like it belongs to a client. This ID, however, must not be one - * the client actually can create, or we have the potential for conflict. - * The 31st bit of the ID is reserved for the server's use for this - * purpose. By setting CLIENT_ID(id) to the client, the SERVER_BIT to - * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a - * resource "owned" by the client. - */ -/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.13 2003/09/24 02:43:13 dawes Exp $ */ - -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "os.h" -#include "resource.h" -#include "dixstruct.h" -#include "opaque.h" -#include "windowstr.h" -#include "dixfont.h" -#include "colormap.h" -#include "inputstr.h" -#include "dixevents.h" -#include "dixgrabs.h" -#include "cursor.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include - -#ifdef NXAGENT_SERVER - -#include "Agent.h" -#include "Font.h" -#include "Pixmaps.h" -#include "GCs.h" - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -#endif - -static void RebuildTable( - int /*client*/ -); - -#define SERVER_MINID 32 - -#define INITBUCKETS 64 -#define INITHASHSIZE 6 -#define MAXHASHSIZE 11 - -typedef struct _Resource { - struct _Resource *next; - XID id; - RESTYPE type; - pointer value; -} ResourceRec, *ResourcePtr; -#define NullResource ((ResourcePtr)NULL) - -typedef struct _ClientResource { - ResourcePtr *resources; - int elements; - int buckets; - int hashsize; /* log(2)(buckets) */ - XID fakeID; - XID endFakeID; - XID expectID; -} ClientResourceRec; - -RESTYPE lastResourceType; -static RESTYPE lastResourceClass; -RESTYPE TypeMask; - -static DeleteType *DeleteFuncs = (DeleteType *)NULL; - -#ifdef XResExtension - -Atom * ResourceNames = NULL; - -void RegisterResourceName (RESTYPE type, char *name) -{ - ResourceNames[type & TypeMask] = MakeAtom(name, strlen(name), TRUE); -} - -#endif - -#ifdef NXAGENT_SERVER -static int nxagentResChangedFlag = 0; -#endif - -RESTYPE -CreateNewResourceType(DeleteType deleteFunc) -{ - RESTYPE next = lastResourceType + 1; - DeleteType *funcs; - - if (next & lastResourceClass) - return 0; - funcs = (DeleteType *)xrealloc(DeleteFuncs, - (next + 1) * sizeof(DeleteType)); - if (!funcs) - return 0; - -#ifdef XResExtension - { - Atom *newnames; - newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom)); - if(!newnames) - return 0; - ResourceNames = newnames; - ResourceNames[next] = 0; - } -#endif - - lastResourceType = next; - DeleteFuncs = funcs; - DeleteFuncs[next] = deleteFunc; - return next; -} - -RESTYPE -CreateNewResourceClass() -{ - RESTYPE next = lastResourceClass >> 1; - - if (next & lastResourceType) - return 0; - lastResourceClass = next; - TypeMask = next - 1; - return next; -} - -ClientResourceRec clientTable[MAXCLIENTS]; - -/***************** - * InitClientResources - * When a new client is created, call this to allocate space - * in resource table - *****************/ - -Bool -InitClientResources(ClientPtr client) -{ - register int i, j; - - if (client == serverClient) - { - lastResourceType = RT_LASTPREDEF; - lastResourceClass = RC_LASTPREDEF; - TypeMask = RC_LASTPREDEF - 1; - if (DeleteFuncs) - xfree(DeleteFuncs); - DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) * - sizeof(DeleteType)); - if (!DeleteFuncs) - return FALSE; - DeleteFuncs[RT_NONE & TypeMask] = (DeleteType)NoopDDA; - DeleteFuncs[RT_WINDOW & TypeMask] = DeleteWindow; - DeleteFuncs[RT_PIXMAP & TypeMask] = dixDestroyPixmap; - DeleteFuncs[RT_GC & TypeMask] = FreeGC; - DeleteFuncs[RT_FONT & TypeMask] = CloseFont; - DeleteFuncs[RT_CURSOR & TypeMask] = FreeCursor; - DeleteFuncs[RT_COLORMAP & TypeMask] = FreeColormap; - DeleteFuncs[RT_CMAPENTRY & TypeMask] = FreeClientPixels; - DeleteFuncs[RT_OTHERCLIENT & TypeMask] = OtherClientGone; - DeleteFuncs[RT_PASSIVEGRAB & TypeMask] = DeletePassiveGrab; - -#ifdef XResExtension - if(ResourceNames) - xfree(ResourceNames); - ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom)); - if(!ResourceNames) - return FALSE; -#endif - } - clientTable[i = client->index].resources = - (ResourcePtr *)xalloc(INITBUCKETS*sizeof(ResourcePtr)); - if (!clientTable[i].resources) - return FALSE; - clientTable[i].buckets = INITBUCKETS; - clientTable[i].elements = 0; - clientTable[i].hashsize = INITHASHSIZE; - /* Many IDs allocated from the server client are visible to clients, - * so we don't use the SERVER_BIT for them, but we have to start - * past the magic value constants used in the protocol. For normal - * clients, we can start from zero, with SERVER_BIT set. - */ - clientTable[i].fakeID = client->clientAsMask | - (client->index ? SERVER_BIT : SERVER_MINID); - clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1; - clientTable[i].expectID = client->clientAsMask; - for (j=0; j>6) ^ (id>>12)))); - case 7: - return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13)))); - case 8: - return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16)))); - case 9: - return ((int)(0x1FF & (id ^ (id>>9)))); - case 10: - return ((int)(0x3FF & (id ^ (id>>10)))); - case 11: - return ((int)(0x7FF & (id ^ (id>>11)))); - } - return -1; -} - -static XID -AvailableID( - register int client, - register XID id, - register XID maxid, - register XID goodid) -{ - register ResourcePtr res; - - if ((goodid >= id) && (goodid <= maxid)) - return goodid; - for (; id <= maxid; id++) - { - res = clientTable[client].resources[Hash(client, id)]; - while (res && (res->id != id)) - res = res->next; - if (!res) - return id; - } - return 0; -} - -void -GetXIDRange(int client, Bool server, XID *minp, XID *maxp) -{ - register XID id, maxid; - register ResourcePtr *resp; - register ResourcePtr res; - register int i; - XID goodid; - - id = (Mask)client << CLIENTOFFSET; - if (server) - id |= client ? SERVER_BIT : SERVER_MINID; - maxid = id | RESOURCE_ID_MASK; - goodid = 0; - for (resp = clientTable[client].resources, i = clientTable[client].buckets; - --i >= 0;) - { - for (res = *resp++; res; res = res->next) - { - if ((res->id < id) || (res->id > maxid)) - continue; - if (((res->id - id) >= (maxid - res->id)) ? - (goodid = AvailableID(client, id, res->id - 1, goodid)) : - !(goodid = AvailableID(client, res->id + 1, maxid, goodid))) - maxid = res->id - 1; - else - id = res->id + 1; - } - } - if (id > maxid) - id = maxid = 0; - *minp = id; - *maxp = maxid; -} - -/** - * GetXIDList is called by the XC-MISC extension's MiscGetXIDList function. - * This function tries to find count unused XIDs for the given client. It - * puts the IDs in the array pids and returns the number found, which should - * almost always be the number requested. - * - * The circumstances that lead to a call to this function are very rare. - * Xlib must run out of IDs while trying to generate a request that wants - * multiple ID's, like the Multi-buffering CreateImageBuffers request. - * - * No rocket science in the implementation; just iterate over all - * possible IDs for the given client and pick the first count IDs - * that aren't in use. A more efficient algorithm could probably be - * invented, but this will be used so rarely that this should suffice. - */ - -unsigned int -GetXIDList(ClientPtr pClient, unsigned count, XID *pids) -{ - unsigned int found = 0; - XID id = pClient->clientAsMask; - XID maxid; - - maxid = id | RESOURCE_ID_MASK; - while ( (found < count) && (id <= maxid) ) - { - if (!LookupIDByClass(id, RC_ANY)) - { - pids[found++] = id; - } - id++; - } - return found; -} - -/* - * Return the next usable fake client ID. - * - * Normally this is just the next one in line, but if we've used the last - * in the range, we need to find a new range of safe IDs to avoid - * over-running another client. - */ - -XID -FakeClientID(register int client) -{ - XID id, maxid; - - id = clientTable[client].fakeID++; - if (id != clientTable[client].endFakeID) - return id; - GetXIDRange(client, TRUE, &id, &maxid); - if (!id) { - if (!client) - FatalError("FakeClientID: server internal ids exhausted\n"); - MarkClientException(clients[client]); - id = ((Mask)client << CLIENTOFFSET) | (SERVER_BIT * 3); - maxid = id | RESOURCE_ID_MASK; - } - clientTable[client].fakeID = id + 1; - clientTable[client].endFakeID = maxid + 1; - return id; -} - -#ifdef NXAGENT_SERVER - -int nxagentFindClientResource(int client, RESTYPE type, pointer value) -{ - ResourcePtr pResource; - ResourcePtr *resources; - - int i; - - for (i = 0; i < clientTable[client].buckets; i++) - { - resources = clientTable[client].resources; - - for (pResource = resources[i]; pResource; pResource = pResource -> next) - { - if (pResource -> type == type && pResource -> value == value) - { - #ifdef TEST - fprintf(stderr, "nxagentFindClientResource: Found resource [%p] type [%lu] " - "for client [%d].\n", (void *) value, - pResource -> type, client); - #endif - - return 1; - } - } - } - - return 0; -} - -int nxagentSwitchResourceType(int client, RESTYPE type, pointer value) -{ - ResourcePtr pResource; - ResourcePtr *resources; - - RESTYPE internalType = 0; - - int i; - - if (type == RT_PIXMAP) - { - internalType = RT_NX_PIXMAP; - } - else if (type == RT_GC) - { - internalType = RT_NX_GC; - } - else if (type == RT_FONT) - { - internalType = RT_NX_FONT; - } - else - { - return 0; - } - - if (client == serverClient -> index) - { - #ifdef TEST - fprintf(stderr, "nxagentSwitchResourceType: Requesting client is [%d]. Skipping the resource switch.\n", - client); - #endif - - return 0; - } - - for (i = 0; i < clientTable[serverClient -> index].buckets; i++) - { - resources = clientTable[serverClient -> index].resources; - - for (pResource = resources[i]; pResource; pResource = pResource -> next) - { - if (pResource -> type == internalType && - pResource -> value == value) - { - #ifdef TEST - fprintf(stderr, "nxagentSwitchResourceType: Changing resource [%p] type from [%lu] to " - "[%lu] for server client [%d].\n", (void *) value, - (unsigned long) pResource -> type, (unsigned long) type, serverClient -> index); - #endif - - FreeResource(pResource -> id, RT_NONE); - - return 1; - } - } - } - - return 0; -} - -#endif - -Bool -AddResource(XID id, RESTYPE type, pointer value) -{ - int client; - register ClientResourceRec *rrec; - register ResourcePtr res, *head; - - client = CLIENT_ID(id); - rrec = &clientTable[client]; - if (!rrec->buckets) - { - ErrorF("AddResource(%lx, %lx, %lx), client=%d \n", - (unsigned long)id, type, (unsigned long)value, client); - FatalError("client not in use\n"); - } - -#ifdef NXAGENT_SERVER - - nxagentSwitchResourceType(client, type, value); - - #ifdef TEST - fprintf(stderr, "AddResource: Adding resource for client [%d] type [%lu] value [%p] id [%lu].\n", - client, (unsigned long) type, (void *) value, (unsigned long) id); - #endif - -#endif - - if ((rrec->elements >= 4*rrec->buckets) && - (rrec->hashsize < MAXHASHSIZE)) - RebuildTable(client); - head = &rrec->resources[Hash(client, id)]; - res = (ResourcePtr)xalloc(sizeof(ResourceRec)); - if (!res) - { - (*DeleteFuncs[type & TypeMask])(value, id); - return FALSE; - } - res->next = *head; - res->id = id; - res->type = type; - res->value = value; - *head = res; - rrec->elements++; - #ifdef NXAGENT_SERVER - nxagentResChangedFlag = 1; - #endif - if (!(id & SERVER_BIT) && (id >= rrec->expectID)) - rrec->expectID = id + 1; - return TRUE; -} - -static void -RebuildTable(int client) -{ - register int j; - register ResourcePtr res, next; - ResourcePtr **tails, *resources; - register ResourcePtr **tptr, *rptr; - - /* - * For now, preserve insertion order, since some ddx layers depend - * on resources being free in the opposite order they are added. - */ - - j = 2 * clientTable[client].buckets; - tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); - if (!tails) - return; - resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr)); - if (!resources) - { - DEALLOCATE_LOCAL(tails); - return; - } - for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) - { - *rptr = NullResource; - *tptr = rptr; - } - clientTable[client].hashsize++; - for (j = clientTable[client].buckets, - rptr = clientTable[client].resources; - --j >= 0; - rptr++) - { - for (res = *rptr; res; res = next) - { - next = res->next; - res->next = NullResource; - tptr = &tails[Hash(client, res->id)]; - **tptr = res; - *tptr = &res->next; - } - } - DEALLOCATE_LOCAL(tails); - clientTable[client].buckets *= 2; - xfree(clientTable[client].resources); - clientTable[client].resources = resources; -} - -void -FreeResource(XID id, RESTYPE skipDeleteFuncType) -{ - int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - register int *eltptr; - int elements; - Bool gotOne = FALSE; - -#ifdef NXAGENT_SERVER - - #ifdef TEST - fprintf(stderr, "FreeResource: Freeing resource id [%lu].\n", (unsigned long) id); - #endif - -#endif - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - head = &clientTable[cid].resources[Hash(cid, id)]; - eltptr = &clientTable[cid].elements; - - prev = head; - while ( (res = *prev) ) - { - if (res->id == id) - { - RESTYPE rtype = res->type; - *prev = res->next; - elements = --*eltptr; - #ifdef NXAGENT_SERVER - nxagentResChangedFlag = 1; - #endif - if (rtype & RC_CACHED) - FlushClientCaches(res->id); - if (rtype != skipDeleteFuncType) - (*DeleteFuncs[rtype & TypeMask])(res->value, res->id); - xfree(res); - if (*eltptr != elements) - prev = head; /* prev may no longer be valid */ - gotOne = TRUE; - } - else - prev = &res->next; - } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; - } - } - if (!gotOne) - ErrorF("Freeing resource id=%lX which isn't there.\n", - (unsigned long)id); -} - - -void -FreeResourceByType(XID id, RESTYPE type, Bool skipFree) -{ - int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - head = &clientTable[cid].resources[Hash(cid, id)]; - - prev = head; - while ( (res = *prev) ) - { - if (res->id == id && res->type == type) - { - *prev = res->next; - #ifdef NXAGENT_SERVER - nxagentResChangedFlag = 1; - #endif - if (type & RC_CACHED) - FlushClientCaches(res->id); - if (!skipFree) - (*DeleteFuncs[type & TypeMask])(res->value, res->id); - xfree(res); - break; - } - else - prev = &res->next; - } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; - } - } -} - -/* - * Change the value associated with a resource id. Caller - * is responsible for "doing the right thing" with the old - * data - */ - -Bool -ChangeResourceValue (XID id, RESTYPE rtype, pointer value) -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - { - if (rtype & RC_CACHED) - FlushClientCaches(res->id); - res->value = value; - return TRUE; - } - } - return FALSE; -} - -/* Note: if func adds or deletes resources, then func can get called - * more than once for some resources. If func adds new resources, - * func might or might not get called for them. func cannot both - * add and delete an equal number of resources! - */ - -void -FindClientResourcesByType( - ClientPtr client, - RESTYPE type, - FindResType func, - pointer cdata -){ - register ResourcePtr *resources; - register ResourcePtr this, next; - int i, elements; - register int *eltptr; - - #ifdef NXAGENT_SERVER - register ResourcePtr **resptr; - #endif - - if (!client) - client = serverClient; - -/* - * If func triggers a resource table - * rebuild then restart the loop. - */ - -#ifdef NXAGENT_SERVER -RestartLoop: -#endif - - resources = clientTable[client->index].resources; - - #ifdef NXAGENT_SERVER - resptr = &clientTable[client->index].resources; - #endif - - eltptr = &clientTable[client->index].elements; - for (i = 0; i < clientTable[client->index].buckets; i++) - { - for (this = resources[i]; this; this = next) - { - next = this->next; - if (!type || this->type == type) { - elements = *eltptr; - - /* - * FIXME: - * It is not safe to let a function change the resource - * table we are reading! - */ - - #ifdef NXAGENT_SERVER - nxagentResChangedFlag = 0; - #endif - (*func)(this->value, this->id, cdata); - - /* - * Avoid that a call to RebuildTable() could invalidate the - * pointer. This is safe enough, because in RebuildTable() - * the new pointer is allocated just before the old one is - * freed, so it can't point to the same address. - */ - - #ifdef NXAGENT_SERVER - if (*resptr != resources) - goto RestartLoop; - #endif - - /* - * It's not enough to check if the number of elements has - * changed, beacause it could happen that the number of - * resources that have been added matches the number of - * the freed ones. - * 'nxagentResChangedFlag' is set if a resource has been - * added or freed. - */ - - #ifdef NXAGENT_SERVER - if (*eltptr != elements || nxagentResChangedFlag) - #else - if (*eltptr != elements) - #endif - next = resources[i]; /* start over */ - } - } - } -} - -void -FindAllClientResources( - ClientPtr client, - FindAllRes func, - pointer cdata -){ - register ResourcePtr *resources; - register ResourcePtr this, next; - int i, elements; - register int *eltptr; - - #ifdef NXAGENT_SERVER - register ResourcePtr **resptr; - #endif - - if (!client) - client = serverClient; - -/* - * If func triggers a resource table - * rebuild then restart the loop. - */ - -#ifdef NXAGENT_SERVER -RestartLoop: -#endif - - resources = clientTable[client->index].resources; - - #ifdef NXAGENT_SERVER - resptr = &clientTable[client->index].resources; - #endif - - eltptr = &clientTable[client->index].elements; - for (i = 0; i < clientTable[client->index].buckets; i++) - { - for (this = resources[i]; this; this = next) - { - next = this->next; - elements = *eltptr; - - /* - * FIXME: - * It is not safe to let a function change the resource - * table we are reading! - */ - - #ifdef NXAGENT_SERVER - nxagentResChangedFlag = 0; - #endif - (*func)(this->value, this->id, this->type, cdata); - - /* - * Avoid that a call to RebuildTable() could invalidate the - * pointer. This is safe enough, because in RebuildTable() - * the new pointer is allocated just before the old one is - * freed, so it can't point to the same address. - */ - - #ifdef NXAGENT_SERVER - if (*resptr != resources) - goto RestartLoop; - #endif - - /* - * It's not enough to check if the number of elements has - * changed, beacause it could happen that the number of - * resources that have been added matches the number of - * the freed ones. - * 'nxagentResChangedFlag' is set if a resource has been - * added or freed. - */ - - #ifdef NXAGENT_SERVER - if (*eltptr != elements || nxagentResChangedFlag) - #else - if (*eltptr != elements) - #endif - next = resources[i]; /* start over */ - } - } -} - - -pointer -LookupClientResourceComplex( - ClientPtr client, - RESTYPE type, - FindComplexResType func, - pointer cdata -){ - ResourcePtr *resources; - ResourcePtr this; - int i; - - #ifdef NXAGENT_SERVER - ResourcePtr **resptr; - Bool res; - #endif - - if (!client) - client = serverClient; - -/* - * If func triggers a resource table - * rebuild then restart the loop. - */ - -#ifdef NXAGENT_SERVER -RestartLoop: -#endif - - resources = clientTable[client->index].resources; - - #ifdef NXAGENT_SERVER - resptr = &clientTable[client->index].resources; - #endif - - for (i = 0; i < clientTable[client->index].buckets; i++) { - for (this = resources[i]; this; this = this->next) { - if (!type || this->type == type) { - #ifdef NXAGENT_SERVER - res = (*func)(this->value, this->id, cdata); - - if (*resptr != resources) - goto RestartLoop; - - if (res) - return this->value; - #else - if((*func)(this->value, this->id, cdata)) - return this->value; - #endif - } - } - } - return NULL; -} - - -void -FreeClientNeverRetainResources(ClientPtr client) -{ - ResourcePtr *resources; - ResourcePtr this; - ResourcePtr *prev; - int j; - - if (!client) - return; - - resources = clientTable[client->index].resources; - for (j=0; j < clientTable[client->index].buckets; j++) - { - prev = &resources[j]; - while ( (this = *prev) ) - { - RESTYPE rtype = this->type; - if (rtype & RC_NEVERRETAIN) - { - *prev = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); - (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); - } - else - prev = &this->next; - } - } -} - -void -FreeClientResources(ClientPtr client) -{ - register ResourcePtr *resources; - register ResourcePtr this; - int j; - - /* This routine shouldn't be called with a null client, but just in - case ... */ - - if (!client) - return; - - HandleSaveSet(client); - - resources = clientTable[client->index].resources; - for (j=0; j < clientTable[client->index].buckets; j++) - { - /* It may seem silly to update the head of this resource list as - we delete the members, since the entire list will be deleted any way, - but there are some resource deletion functions "FreeClientPixels" for - one which do a LookupID on another resource id (a Colormap id in this - case), so the resource list must be kept valid up to the point that - it is deleted, so every time we delete a resource, we must update the - head, just like in FreeResource. I hope that this doesn't slow down - mass deletion appreciably. PRH */ - - ResourcePtr *head; - - head = &resources[j]; - - for (this = *head; this; this = *head) - { - RESTYPE rtype = this->type; - *head = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); - (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); - } - } - xfree(clientTable[client->index].resources); - clientTable[client->index].resources = NULL; - clientTable[client->index].buckets = 0; -} - -void -FreeAllResources() -{ - int i; - - for (i = currentMaxClients; --i >= 0; ) - { - if (clientTable[i].buckets) - FreeClientResources(clients[i]); - } -} - -Bool -LegalNewID(XID id, register ClientPtr client) -{ - -#ifdef PANORAMIX - XID minid, maxid; - - if (!noPanoramiXExtension) { - minid = client->clientAsMask | (client->index ? - SERVER_BIT : SERVER_MINID); - maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; - if ((id >= minid) && (id <= maxid)) - return TRUE; - } -#endif /* PANORAMIX */ - return ((client->clientAsMask == (id & ~RESOURCE_ID_MASK)) && - ((clientTable[client->index].expectID <= id) || - !LookupIDByClass(id, RC_ANY))); -} - -#ifdef XCSECURITY - -/* SecurityLookupIDByType and SecurityLookupIDByClass: - * These are the heart of the resource ID security system. They take - * two additional arguments compared to the old LookupID functions: - * the client doing the lookup, and the access mode (see resource.h). - * The resource is returned if it exists and the client is allowed access, - * else NULL is returned. - */ - -pointer -SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) -{ - int cid; - register ResourcePtr res; - pointer retval = NULL; - - assert(client == NullClient || - (client->index <= currentMaxClients && clients[client->index] == client)); - assert( (rtype & TypeMask) <= lastResourceType); - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - { - retval = res->value; - break; - } - } - if (retval && client && client->CheckAccess) - retval = (* client->CheckAccess)(client, id, rtype, mode, retval); - return retval; -} - - -pointer -SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) -{ - int cid; - register ResourcePtr res = NULL; - pointer retval = NULL; - - assert(client == NullClient || - (client->index <= currentMaxClients && clients[client->index] == client)); - assert (classes >= lastResourceClass); - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type & classes)) - { - retval = res->value; - break; - } - } - if (retval && client && client->CheckAccess) - retval = (* client->CheckAccess)(client, id, res->type, mode, retval); - return retval; -} - -/* We can't replace the LookupIDByType and LookupIDByClass functions with - * macros because of compatibility with loadable servers. - */ - -pointer -LookupIDByType(XID id, RESTYPE rtype) -{ - return SecurityLookupIDByType(NullClient, id, rtype, - SecurityUnknownAccess); -} - -pointer -LookupIDByClass(XID id, RESTYPE classes) -{ - return SecurityLookupIDByClass(NullClient, id, classes, - SecurityUnknownAccess); -} - -#else /* not XCSECURITY */ - -/* - * LookupIDByType returns the object with the given id and type, else NULL. - */ -pointer -LookupIDByType(XID id, RESTYPE rtype) -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - return res->value; - } - return (pointer)NULL; -} - -/* - * LookupIDByClass returns the object with the given id and any one of the - * given classes, else NULL. - */ -pointer -LookupIDByClass(XID id, RESTYPE classes) -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type & classes)) - return res->value; - } - return (pointer)NULL; -} - -#endif /* XCSECURITY */ - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.X.original deleted file mode 100644 index e12bc7b67..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.X.original +++ /dev/null @@ -1,954 +0,0 @@ -/************************************************************ - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -********************************************************/ -/* The panoramix components contained the following notice */ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/* $Xorg: resource.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/dix/resource.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ -/* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */ - -/* Routines to manage various kinds of resources: - * - * CreateNewResourceType, CreateNewResourceClass, InitClientResources, - * FakeClientID, AddResource, FreeResource, FreeClientResources, - * FreeAllResources, LookupIDByType, LookupIDByClass, GetXIDRange - */ - -/* - * A resource ID is a 32 bit quantity, the upper 2 bits of which are - * off-limits for client-visible resources. The next 8 bits are - * used as client ID, and the low 22 bits come from the client. - * A resource ID is "hashed" by extracting and xoring subfields - * (varying with the size of the hash table). - * - * It is sometimes necessary for the server to create an ID that looks - * like it belongs to a client. This ID, however, must not be one - * the client actually can create, or we have the potential for conflict. - * The 31st bit of the ID is reserved for the server's use for this - * purpose. By setting CLIENT_ID(id) to the client, the SERVER_BIT to - * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a - * resource "owned" by the client. - */ -/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.13 2003/09/24 02:43:13 dawes Exp $ */ - -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "os.h" -#include "resource.h" -#include "dixstruct.h" -#include "opaque.h" -#include "windowstr.h" -#include "dixfont.h" -#include "colormap.h" -#include "inputstr.h" -#include "dixevents.h" -#include "dixgrabs.h" -#include "cursor.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include - -static void RebuildTable( - int /*client*/ -); - -#define SERVER_MINID 32 - -#define INITBUCKETS 64 -#define INITHASHSIZE 6 -#define MAXHASHSIZE 11 - -typedef struct _Resource { - struct _Resource *next; - XID id; - RESTYPE type; - pointer value; -} ResourceRec, *ResourcePtr; -#define NullResource ((ResourcePtr)NULL) - -typedef struct _ClientResource { - ResourcePtr *resources; - int elements; - int buckets; - int hashsize; /* log(2)(buckets) */ - XID fakeID; - XID endFakeID; - XID expectID; -} ClientResourceRec; - -RESTYPE lastResourceType; -static RESTYPE lastResourceClass; -RESTYPE TypeMask; - -static DeleteType *DeleteFuncs = (DeleteType *)NULL; - -#ifdef XResExtension - -Atom * ResourceNames = NULL; - -void RegisterResourceName (RESTYPE type, char *name) -{ - ResourceNames[type & TypeMask] = MakeAtom(name, strlen(name), TRUE); -} - -#endif - -RESTYPE -CreateNewResourceType(DeleteType deleteFunc) -{ - RESTYPE next = lastResourceType + 1; - DeleteType *funcs; - - if (next & lastResourceClass) - return 0; - funcs = (DeleteType *)xrealloc(DeleteFuncs, - (next + 1) * sizeof(DeleteType)); - if (!funcs) - return 0; - -#ifdef XResExtension - { - Atom *newnames; - newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom)); - if(!newnames) - return 0; - ResourceNames = newnames; - ResourceNames[next] = 0; - } -#endif - - lastResourceType = next; - DeleteFuncs = funcs; - DeleteFuncs[next] = deleteFunc; - return next; -} - -RESTYPE -CreateNewResourceClass() -{ - RESTYPE next = lastResourceClass >> 1; - - if (next & lastResourceType) - return 0; - lastResourceClass = next; - TypeMask = next - 1; - return next; -} - -ClientResourceRec clientTable[MAXCLIENTS]; - -/***************** - * InitClientResources - * When a new client is created, call this to allocate space - * in resource table - *****************/ - -Bool -InitClientResources(ClientPtr client) -{ - register int i, j; - - if (client == serverClient) - { - lastResourceType = RT_LASTPREDEF; - lastResourceClass = RC_LASTPREDEF; - TypeMask = RC_LASTPREDEF - 1; - if (DeleteFuncs) - xfree(DeleteFuncs); - DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) * - sizeof(DeleteType)); - if (!DeleteFuncs) - return FALSE; - DeleteFuncs[RT_NONE & TypeMask] = (DeleteType)NoopDDA; - DeleteFuncs[RT_WINDOW & TypeMask] = DeleteWindow; - DeleteFuncs[RT_PIXMAP & TypeMask] = dixDestroyPixmap; - DeleteFuncs[RT_GC & TypeMask] = FreeGC; - DeleteFuncs[RT_FONT & TypeMask] = CloseFont; - DeleteFuncs[RT_CURSOR & TypeMask] = FreeCursor; - DeleteFuncs[RT_COLORMAP & TypeMask] = FreeColormap; - DeleteFuncs[RT_CMAPENTRY & TypeMask] = FreeClientPixels; - DeleteFuncs[RT_OTHERCLIENT & TypeMask] = OtherClientGone; - DeleteFuncs[RT_PASSIVEGRAB & TypeMask] = DeletePassiveGrab; - -#ifdef XResExtension - if(ResourceNames) - xfree(ResourceNames); - ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom)); - if(!ResourceNames) - return FALSE; -#endif - } - clientTable[i = client->index].resources = - (ResourcePtr *)xalloc(INITBUCKETS*sizeof(ResourcePtr)); - if (!clientTable[i].resources) - return FALSE; - clientTable[i].buckets = INITBUCKETS; - clientTable[i].elements = 0; - clientTable[i].hashsize = INITHASHSIZE; - /* Many IDs allocated from the server client are visible to clients, - * so we don't use the SERVER_BIT for them, but we have to start - * past the magic value constants used in the protocol. For normal - * clients, we can start from zero, with SERVER_BIT set. - */ - clientTable[i].fakeID = client->clientAsMask | - (client->index ? SERVER_BIT : SERVER_MINID); - clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1; - clientTable[i].expectID = client->clientAsMask; - for (j=0; j>6) ^ (id>>12)))); - case 7: - return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13)))); - case 8: - return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16)))); - case 9: - return ((int)(0x1FF & (id ^ (id>>9)))); - case 10: - return ((int)(0x3FF & (id ^ (id>>10)))); - case 11: - return ((int)(0x7FF & (id ^ (id>>11)))); - } - return -1; -} - -static XID -AvailableID( - register int client, - register XID id, - register XID maxid, - register XID goodid) -{ - register ResourcePtr res; - - if ((goodid >= id) && (goodid <= maxid)) - return goodid; - for (; id <= maxid; id++) - { - res = clientTable[client].resources[Hash(client, id)]; - while (res && (res->id != id)) - res = res->next; - if (!res) - return id; - } - return 0; -} - -void -GetXIDRange(int client, Bool server, XID *minp, XID *maxp) -{ - register XID id, maxid; - register ResourcePtr *resp; - register ResourcePtr res; - register int i; - XID goodid; - - id = (Mask)client << CLIENTOFFSET; - if (server) - id |= client ? SERVER_BIT : SERVER_MINID; - maxid = id | RESOURCE_ID_MASK; - goodid = 0; - for (resp = clientTable[client].resources, i = clientTable[client].buckets; - --i >= 0;) - { - for (res = *resp++; res; res = res->next) - { - if ((res->id < id) || (res->id > maxid)) - continue; - if (((res->id - id) >= (maxid - res->id)) ? - (goodid = AvailableID(client, id, res->id - 1, goodid)) : - !(goodid = AvailableID(client, res->id + 1, maxid, goodid))) - maxid = res->id - 1; - else - id = res->id + 1; - } - } - if (id > maxid) - id = maxid = 0; - *minp = id; - *maxp = maxid; -} - -/** - * GetXIDList is called by the XC-MISC extension's MiscGetXIDList function. - * This function tries to find count unused XIDs for the given client. It - * puts the IDs in the array pids and returns the number found, which should - * almost always be the number requested. - * - * The circumstances that lead to a call to this function are very rare. - * Xlib must run out of IDs while trying to generate a request that wants - * multiple ID's, like the Multi-buffering CreateImageBuffers request. - * - * No rocket science in the implementation; just iterate over all - * possible IDs for the given client and pick the first count IDs - * that aren't in use. A more efficient algorithm could probably be - * invented, but this will be used so rarely that this should suffice. - */ - -unsigned int -GetXIDList(ClientPtr pClient, unsigned count, XID *pids) -{ - unsigned int found = 0; - XID id = pClient->clientAsMask; - XID maxid; - - maxid = id | RESOURCE_ID_MASK; - while ( (found < count) && (id <= maxid) ) - { - if (!LookupIDByClass(id, RC_ANY)) - { - pids[found++] = id; - } - id++; - } - return found; -} - -/* - * Return the next usable fake client ID. - * - * Normally this is just the next one in line, but if we've used the last - * in the range, we need to find a new range of safe IDs to avoid - * over-running another client. - */ - -XID -FakeClientID(register int client) -{ - XID id, maxid; - - id = clientTable[client].fakeID++; - if (id != clientTable[client].endFakeID) - return id; - GetXIDRange(client, TRUE, &id, &maxid); - if (!id) { - if (!client) - FatalError("FakeClientID: server internal ids exhausted\n"); - MarkClientException(clients[client]); - id = ((Mask)client << CLIENTOFFSET) | (SERVER_BIT * 3); - maxid = id | RESOURCE_ID_MASK; - } - clientTable[client].fakeID = id + 1; - clientTable[client].endFakeID = maxid + 1; - return id; -} - -Bool -AddResource(XID id, RESTYPE type, pointer value) -{ - int client; - register ClientResourceRec *rrec; - register ResourcePtr res, *head; - - client = CLIENT_ID(id); - rrec = &clientTable[client]; - if (!rrec->buckets) - { - ErrorF("AddResource(%lx, %lx, %lx), client=%d \n", - (unsigned long)id, type, (unsigned long)value, client); - FatalError("client not in use\n"); - } - if ((rrec->elements >= 4*rrec->buckets) && - (rrec->hashsize < MAXHASHSIZE)) - RebuildTable(client); - head = &rrec->resources[Hash(client, id)]; - res = (ResourcePtr)xalloc(sizeof(ResourceRec)); - if (!res) - { - (*DeleteFuncs[type & TypeMask])(value, id); - return FALSE; - } - res->next = *head; - res->id = id; - res->type = type; - res->value = value; - *head = res; - rrec->elements++; - if (!(id & SERVER_BIT) && (id >= rrec->expectID)) - rrec->expectID = id + 1; - return TRUE; -} - -static void -RebuildTable(int client) -{ - register int j; - register ResourcePtr res, next; - ResourcePtr **tails, *resources; - register ResourcePtr **tptr, *rptr; - - /* - * For now, preserve insertion order, since some ddx layers depend - * on resources being free in the opposite order they are added. - */ - - j = 2 * clientTable[client].buckets; - tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); - if (!tails) - return; - resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr)); - if (!resources) - { - DEALLOCATE_LOCAL(tails); - return; - } - for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) - { - *rptr = NullResource; - *tptr = rptr; - } - clientTable[client].hashsize++; - for (j = clientTable[client].buckets, - rptr = clientTable[client].resources; - --j >= 0; - rptr++) - { - for (res = *rptr; res; res = next) - { - next = res->next; - res->next = NullResource; - tptr = &tails[Hash(client, res->id)]; - **tptr = res; - *tptr = &res->next; - } - } - DEALLOCATE_LOCAL(tails); - clientTable[client].buckets *= 2; - xfree(clientTable[client].resources); - clientTable[client].resources = resources; -} - -void -FreeResource(XID id, RESTYPE skipDeleteFuncType) -{ - int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - register int *eltptr; - int elements; - Bool gotOne = FALSE; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - head = &clientTable[cid].resources[Hash(cid, id)]; - eltptr = &clientTable[cid].elements; - - prev = head; - while ( (res = *prev) ) - { - if (res->id == id) - { - RESTYPE rtype = res->type; - *prev = res->next; - elements = --*eltptr; - if (rtype & RC_CACHED) - FlushClientCaches(res->id); - if (rtype != skipDeleteFuncType) - (*DeleteFuncs[rtype & TypeMask])(res->value, res->id); - xfree(res); - if (*eltptr != elements) - prev = head; /* prev may no longer be valid */ - gotOne = TRUE; - } - else - prev = &res->next; - } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; - } - } - if (!gotOne) - ErrorF("Freeing resource id=%lX which isn't there.\n", - (unsigned long)id); -} - - -void -FreeResourceByType(XID id, RESTYPE type, Bool skipFree) -{ - int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - head = &clientTable[cid].resources[Hash(cid, id)]; - - prev = head; - while ( (res = *prev) ) - { - if (res->id == id && res->type == type) - { - *prev = res->next; - if (type & RC_CACHED) - FlushClientCaches(res->id); - if (!skipFree) - (*DeleteFuncs[type & TypeMask])(res->value, res->id); - xfree(res); - break; - } - else - prev = &res->next; - } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; - } - } -} - -/* - * Change the value associated with a resource id. Caller - * is responsible for "doing the right thing" with the old - * data - */ - -Bool -ChangeResourceValue (XID id, RESTYPE rtype, pointer value) -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - { - if (rtype & RC_CACHED) - FlushClientCaches(res->id); - res->value = value; - return TRUE; - } - } - return FALSE; -} - -/* Note: if func adds or deletes resources, then func can get called - * more than once for some resources. If func adds new resources, - * func might or might not get called for them. func cannot both - * add and delete an equal number of resources! - */ - -void -FindClientResourcesByType( - ClientPtr client, - RESTYPE type, - FindResType func, - pointer cdata -){ - register ResourcePtr *resources; - register ResourcePtr this, next; - int i, elements; - register int *eltptr; - - if (!client) - client = serverClient; - - resources = clientTable[client->index].resources; - eltptr = &clientTable[client->index].elements; - for (i = 0; i < clientTable[client->index].buckets; i++) - { - for (this = resources[i]; this; this = next) - { - next = this->next; - if (!type || this->type == type) { - elements = *eltptr; - (*func)(this->value, this->id, cdata); - if (*eltptr != elements) - next = resources[i]; /* start over */ - } - } - } -} - -void -FindAllClientResources( - ClientPtr client, - FindAllRes func, - pointer cdata -){ - register ResourcePtr *resources; - register ResourcePtr this, next; - int i, elements; - register int *eltptr; - - if (!client) - client = serverClient; - - resources = clientTable[client->index].resources; - eltptr = &clientTable[client->index].elements; - for (i = 0; i < clientTable[client->index].buckets; i++) - { - for (this = resources[i]; this; this = next) - { - next = this->next; - elements = *eltptr; - (*func)(this->value, this->id, this->type, cdata); - if (*eltptr != elements) - next = resources[i]; /* start over */ - } - } -} - - -pointer -LookupClientResourceComplex( - ClientPtr client, - RESTYPE type, - FindComplexResType func, - pointer cdata -){ - ResourcePtr *resources; - ResourcePtr this; - int i; - - if (!client) - client = serverClient; - - resources = clientTable[client->index].resources; - for (i = 0; i < clientTable[client->index].buckets; i++) { - for (this = resources[i]; this; this = this->next) { - if (!type || this->type == type) { - if((*func)(this->value, this->id, cdata)) - return this->value; - } - } - } - return NULL; -} - - -void -FreeClientNeverRetainResources(ClientPtr client) -{ - ResourcePtr *resources; - ResourcePtr this; - ResourcePtr *prev; - int j; - - if (!client) - return; - - resources = clientTable[client->index].resources; - for (j=0; j < clientTable[client->index].buckets; j++) - { - prev = &resources[j]; - while ( (this = *prev) ) - { - RESTYPE rtype = this->type; - if (rtype & RC_NEVERRETAIN) - { - *prev = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); - (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); - } - else - prev = &this->next; - } - } -} - -void -FreeClientResources(ClientPtr client) -{ - register ResourcePtr *resources; - register ResourcePtr this; - int j; - - /* This routine shouldn't be called with a null client, but just in - case ... */ - - if (!client) - return; - - HandleSaveSet(client); - - resources = clientTable[client->index].resources; - for (j=0; j < clientTable[client->index].buckets; j++) - { - /* It may seem silly to update the head of this resource list as - we delete the members, since the entire list will be deleted any way, - but there are some resource deletion functions "FreeClientPixels" for - one which do a LookupID on another resource id (a Colormap id in this - case), so the resource list must be kept valid up to the point that - it is deleted, so every time we delete a resource, we must update the - head, just like in FreeResource. I hope that this doesn't slow down - mass deletion appreciably. PRH */ - - ResourcePtr *head; - - head = &resources[j]; - - for (this = *head; this; this = *head) - { - RESTYPE rtype = this->type; - *head = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); - (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); - } - } - xfree(clientTable[client->index].resources); - clientTable[client->index].resources = NULL; - clientTable[client->index].buckets = 0; -} - -void -FreeAllResources() -{ - int i; - - for (i = currentMaxClients; --i >= 0; ) - { - if (clientTable[i].buckets) - FreeClientResources(clients[i]); - } -} - -Bool -LegalNewID(XID id, register ClientPtr client) -{ - -#ifdef PANORAMIX - XID minid, maxid; - - if (!noPanoramiXExtension) { - minid = client->clientAsMask | (client->index ? - SERVER_BIT : SERVER_MINID); - maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; - if ((id >= minid) && (id <= maxid)) - return TRUE; - } -#endif /* PANORAMIX */ - return ((client->clientAsMask == (id & ~RESOURCE_ID_MASK)) && - ((clientTable[client->index].expectID <= id) || - !LookupIDByClass(id, RC_ANY))); -} - -#ifdef XCSECURITY - -/* SecurityLookupIDByType and SecurityLookupIDByClass: - * These are the heart of the resource ID security system. They take - * two additional arguments compared to the old LookupID functions: - * the client doing the lookup, and the access mode (see resource.h). - * The resource is returned if it exists and the client is allowed access, - * else NULL is returned. - */ - -pointer -SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) -{ - int cid; - register ResourcePtr res; - pointer retval = NULL; - - assert(client == NullClient || - (client->index <= currentMaxClients && clients[client->index] == client)); - assert( (rtype & TypeMask) <= lastResourceType); - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - { - retval = res->value; - break; - } - } - if (retval && client && client->CheckAccess) - retval = (* client->CheckAccess)(client, id, rtype, mode, retval); - return retval; -} - - -pointer -SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) -{ - int cid; - register ResourcePtr res = NULL; - pointer retval = NULL; - - assert(client == NullClient || - (client->index <= currentMaxClients && clients[client->index] == client)); - assert (classes >= lastResourceClass); - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type & classes)) - { - retval = res->value; - break; - } - } - if (retval && client && client->CheckAccess) - retval = (* client->CheckAccess)(client, id, res->type, mode, retval); - return retval; -} - -/* We can't replace the LookupIDByType and LookupIDByClass functions with - * macros because of compatibility with loadable servers. - */ - -pointer -LookupIDByType(XID id, RESTYPE rtype) -{ - return SecurityLookupIDByType(NullClient, id, rtype, - SecurityUnknownAccess); -} - -pointer -LookupIDByClass(XID id, RESTYPE classes) -{ - return SecurityLookupIDByClass(NullClient, id, classes, - SecurityUnknownAccess); -} - -#else /* not XCSECURITY */ - -/* - * LookupIDByType returns the object with the given id and type, else NULL. - */ -pointer -LookupIDByType(XID id, RESTYPE rtype) -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type == rtype)) - return res->value; - } - return (pointer)NULL; -} - -/* - * LookupIDByClass returns the object with the given id and any one of the - * given classes, else NULL. - */ -pointer -LookupIDByClass(XID id, RESTYPE classes) -{ - int cid; - register ResourcePtr res; - - if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && - clientTable[cid].buckets) - { - res = clientTable[cid].resources[Hash(cid, id)]; - - for (; res; res = res->next) - if ((res->id == id) && (res->type & classes)) - return res->value; - } - return (pointer)NULL; -} - -#endif /* XCSECURITY */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original deleted file mode 100644 index eaaa92041..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original +++ /dev/null @@ -1,1498 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.41 2003/12/17 23:28:56 alanh Exp $ */ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -********************************************************/ - -/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ - -/* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ - -#define SHM - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#ifndef Lynx -#include -#include -#else -#include -#include -#endif -#include -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "extnsionst.h" -#include "servermd.h" -#define _XSHM_SERVER_ -#include -#include -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -#include "modinit.h" - -#include "Trap.h" -#include "Agent.h" -#include "Drawable.h" -#include "Pixmaps.h" - -/* - * Set here the required log level. - */ - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -#ifdef TEST -#include "Literals.h" -#endif - -extern void fbGetImage(DrawablePtr pDrw, int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, char *d); - -extern void fbPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, int format, - char *pImage); - -typedef struct _ShmDesc { - struct _ShmDesc *next; - int shmid; - int refcnt; - char *addr; - Bool writable; - unsigned long size; -} ShmDescRec, *ShmDescPtr; - -static void miShmPutImage(XSHM_PUT_IMAGE_ARGS); -static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS); -static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); -static int ShmDetachSegment( - pointer /* value */, - XID /* shmseg */ - ); -static void ShmResetProc( - ExtensionEntry * /* extEntry */ - ); -static void SShmCompletionEvent( - xShmCompletionEvent * /* from */, - xShmCompletionEvent * /* to */ - ); - -static Bool ShmDestroyPixmap (PixmapPtr pPixmap); - -static DISPATCH_PROC(ProcShmAttach); -static DISPATCH_PROC(ProcShmCreatePixmap); -static DISPATCH_PROC(ProcShmDetach); -static DISPATCH_PROC(ProcShmDispatch); -static DISPATCH_PROC(ProcShmGetImage); -static DISPATCH_PROC(ProcShmPutImage); -static DISPATCH_PROC(ProcShmQueryVersion); -static DISPATCH_PROC(SProcShmAttach); -static DISPATCH_PROC(SProcShmCreatePixmap); -static DISPATCH_PROC(SProcShmDetach); -static DISPATCH_PROC(SProcShmDispatch); -static DISPATCH_PROC(SProcShmGetImage); -static DISPATCH_PROC(SProcShmPutImage); -static DISPATCH_PROC(SProcShmQueryVersion); - -static unsigned char ShmReqCode; -int ShmCompletionCode; -int BadShmSegCode; -RESTYPE ShmSegType; -static ShmDescPtr Shmsegs; -static Bool sharedPixmaps; -static int pixmapFormat; -static int shmPixFormat[MAXSCREENS]; -static ShmFuncsPtr shmFuncs[MAXSCREENS]; -static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS]; -#ifdef PIXPRIV -static int shmPixmapPrivate; -#endif -static ShmFuncs miFuncs = {NULL, miShmPutImage}; -static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage}; - -#define VERIFY_SHMSEG(shmseg,shmdesc,client) \ -{ \ - shmdesc = (ShmDescPtr)LookupIDByType(shmseg, ShmSegType); \ - if (!shmdesc) \ - { \ - client->errorValue = shmseg; \ - return BadShmSegCode; \ - } \ -} - -#define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \ -{ \ - VERIFY_SHMSEG(shmseg, shmdesc, client); \ - if ((offset & 3) || (offset > shmdesc->size)) \ - { \ - client->errorValue = offset; \ - return BadValue; \ - } \ - if (needwrite && !shmdesc->writable) \ - return BadAccess; \ -} - -#define VERIFY_SHMSIZE(shmdesc,offset,len,client) \ -{ \ - if ((offset + len) > shmdesc->size) \ - { \ - return BadAccess; \ - } \ -} - - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) -#include - -static Bool badSysCall = FALSE; - -static void -SigSysHandler(signo) -int signo; -{ - badSysCall = TRUE; -} - -static Bool CheckForShmSyscall() -{ - void (*oldHandler)(); - int shmid = -1; - - /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ - oldHandler = signal(SIGSYS, SigSysHandler); - - badSysCall = FALSE; - shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); - - if (shmid != -1) - { - /* Successful allocation - clean up */ - shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL); - } - else - { - /* Allocation failed */ - badSysCall = TRUE; - } - signal(SIGSYS, oldHandler); - return(!badSysCall); -} - -#define MUST_CHECK_FOR_SHM_SYSCALL - -#endif - -void -ShmExtensionInit(INITARGS) -{ - ExtensionEntry *extEntry; - int i; - -#ifdef MUST_CHECK_FOR_SHM_SYSCALL - if (!CheckForShmSyscall()) - { - ErrorF("MIT-SHM extension disabled due to lack of kernel support\n"); - return; - } -#endif - - if (nxagentOption(SharedMemory) == False) - { - return; - } - - sharedPixmaps = xFalse; - pixmapFormat = 0; - { - sharedPixmaps = nxagentOption(SharedPixmaps); - pixmapFormat = shmPixFormat[0]; - for (i = 0; i < screenInfo.numScreens; i++) - { - if (!shmFuncs[i]) - { - #ifdef TEST - fprintf(stderr, "ShmExtensionInit: Registering shmFuncs as miFuncs.\n"); - #endif - shmFuncs[i] = &miFuncs; - } - if (!shmFuncs[i]->CreatePixmap) - sharedPixmaps = xFalse; - if (shmPixFormat[i] && (shmPixFormat[i] != pixmapFormat)) - { - sharedPixmaps = xFalse; - pixmapFormat = 0; - } - } - if (!pixmapFormat) - pixmapFormat = ZPixmap; - if (sharedPixmaps) - { - for (i = 0; i < screenInfo.numScreens; i++) - { - destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap; - screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap; - } -#ifdef PIXPRIV - shmPixmapPrivate = AllocatePixmapPrivateIndex(); - for (i = 0; i < screenInfo.numScreens; i++) - { - if (!AllocatePixmapPrivate(screenInfo.screens[i], - shmPixmapPrivate, 0)) - return; - } -#endif - } - } - ShmSegType = CreateNewResourceType(ShmDetachSegment); - if (ShmSegType && - (extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors, - ProcShmDispatch, SProcShmDispatch, - ShmResetProc, StandardMinorOpcode))) - { - ShmReqCode = (unsigned char)extEntry->base; - ShmCompletionCode = extEntry->eventBase; - BadShmSegCode = extEntry->errorBase; - EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent; - } -} - -/*ARGSUSED*/ -static void -ShmResetProc (extEntry) -ExtensionEntry *extEntry; -{ - int i; - - for (i = 0; i < MAXSCREENS; i++) - { - shmFuncs[i] = (ShmFuncsPtr)NULL; - shmPixFormat[i] = 0; - } -} - -void -ShmRegisterFuncs( - ScreenPtr pScreen, - ShmFuncsPtr funcs) -{ - shmFuncs[pScreen->myNum] = funcs; -} - -void -ShmSetPixmapFormat( - ScreenPtr pScreen, - int format) -{ - shmPixFormat[pScreen->myNum] = format; -} - -static Bool -ShmDestroyPixmap (PixmapPtr pPixmap) -{ - ScreenPtr pScreen = pPixmap->drawable.pScreen; - Bool ret; - if (pPixmap->refcnt == 1) - { - ShmDescPtr shmdesc; -#ifdef PIXPRIV - shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr; -#else - char *base = (char *) pPixmap->devPrivate.ptr; - - if (base != (pointer) (pPixmap + 1)) - { - for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next) - { - if (shmdesc->addr <= base && base <= shmdesc->addr + shmdesc->size) - break; - } - } - else - shmdesc = 0; -#endif - if (shmdesc) - ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id); - } - - pScreen->DestroyPixmap = destroyPixmap[pScreen->myNum]; - ret = (*pScreen->DestroyPixmap) (pPixmap); - destroyPixmap[pScreen->myNum] = pScreen->DestroyPixmap; - pScreen->DestroyPixmap = ShmDestroyPixmap; - return ret; -} - -void -ShmRegisterFbFuncs(pScreen) - ScreenPtr pScreen; -{ - #ifdef TEST - fprintf(stderr, "ShmRegisterFbFuncs: Registering shmFuncs as fbFuncs.\n"); - #endif - shmFuncs[pScreen->myNum] = &fbFuncs; -} - -static int -ProcShmQueryVersion(client) - register ClientPtr client; -{ - xShmQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xShmQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.sharedPixmaps = sharedPixmaps; - rep.pixmapFormat = pixmapFormat; - rep.majorVersion = SHM_MAJOR_VERSION; - rep.minorVersion = SHM_MINOR_VERSION; - rep.uid = geteuid(); - rep.gid = getegid(); - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - swaps(&rep.uid, n); - swaps(&rep.gid, n); - } - WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -/* - * Simulate the access() system call for a shared memory segement, - * using the credentials from the client if available - */ -static int -shm_access(ClientPtr client, struct ipc_perm *perm, int readonly) -{ - int uid, gid; - mode_t mask; - - if (LocalClientCred(client, &uid, &gid) != -1) { - - /* User id 0 always gets access */ - if (uid == 0) { - return 0; - } - /* Check the owner */ - if (perm->uid == uid || perm->cuid == uid) { - mask = S_IRUSR; - if (!readonly) { - mask |= S_IWUSR; - } - return (perm->mode & mask) == mask ? 0 : -1; - } - /* Check the group */ - if (perm->gid == gid || perm->cgid == gid) { - mask = S_IRGRP; - if (!readonly) { - mask |= S_IWGRP; - } - return (perm->mode & mask) == mask ? 0 : -1; - } - } - /* Otherwise, check everyone else */ - mask = S_IROTH; - if (!readonly) { - mask |= S_IWOTH; - } - return (perm->mode & mask) == mask ? 0 : -1; -} - -static int -ProcShmAttach(client) - register ClientPtr client; -{ - struct shmid_ds buf; - ShmDescPtr shmdesc; - REQUEST(xShmAttachReq); - - REQUEST_SIZE_MATCH(xShmAttachReq); - LEGAL_NEW_RESOURCE(stuff->shmseg, client); - if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) - { - client->errorValue = stuff->readOnly; - return(BadValue); - } - for (shmdesc = Shmsegs; - shmdesc && (shmdesc->shmid != stuff->shmid); - shmdesc = shmdesc->next) - ; - if (shmdesc) - { - if (!stuff->readOnly && !shmdesc->writable) - return BadAccess; - shmdesc->refcnt++; - } - else - { - shmdesc = (ShmDescPtr) xalloc(sizeof(ShmDescRec)); - if (!shmdesc) - return BadAlloc; - shmdesc->addr = shmat(stuff->shmid, 0, - stuff->readOnly ? SHM_RDONLY : 0); - if ((shmdesc->addr == ((char *)-1)) || - shmctl(stuff->shmid, IPC_STAT, &buf)) - { - xfree(shmdesc); - return BadAccess; - } - - /* The attach was performed with root privs. We must - * do manual checking of access rights for the credentials - * of the client */ - - if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) { - shmdt(shmdesc->addr); - xfree(shmdesc); - return BadAccess; - } - - shmdesc->shmid = stuff->shmid; - shmdesc->refcnt = 1; - shmdesc->writable = !stuff->readOnly; - shmdesc->size = buf.shm_segsz; - shmdesc->next = Shmsegs; - Shmsegs = shmdesc; - } - if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc)) - return BadAlloc; - return(client->noClientException); -} - -/*ARGSUSED*/ -static int -ShmDetachSegment(value, shmseg) - pointer value; /* must conform to DeleteType */ - XID shmseg; -{ - ShmDescPtr shmdesc = (ShmDescPtr)value; - ShmDescPtr *prev; - - if (--shmdesc->refcnt) - return TRUE; - shmdt(shmdesc->addr); - for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next) - ; - *prev = shmdesc->next; - xfree(shmdesc); - return Success; -} - -static int -ProcShmDetach(client) - register ClientPtr client; -{ - ShmDescPtr shmdesc; - REQUEST(xShmDetachReq); - - REQUEST_SIZE_MATCH(xShmDetachReq); - VERIFY_SHMSEG(stuff->shmseg, shmdesc, client); - FreeResource(stuff->shmseg, RT_NONE); - return(client->noClientException); -} - -static void -miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) - DrawablePtr dst; - GCPtr pGC; - int depth, w, h, sx, sy, sw, sh, dx, dy; - unsigned int format; - char *data; -{ - PixmapPtr pmap; - GCPtr putGC; - - nxagentShmTrap = 0; - putGC = GetScratchGC(depth, dst->pScreen); - if (!putGC) - { - nxagentShmTrap = 1; - return; - } - pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth); - if (!pmap) - { - nxagentShmTrap = 1; - FreeScratchGC(putGC); - return; - } - ValidateGC((DrawablePtr)pmap, putGC); - (*putGC->ops->PutImage)((DrawablePtr)pmap, putGC, depth, -sx, -sy, w, h, 0, - (format == XYPixmap) ? XYPixmap : ZPixmap, data); - FreeScratchGC(putGC); - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy, 1L); - else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy); - (*pmap->drawable.pScreen->DestroyPixmap)(pmap); - nxagentShmTrap = 1; -} - -static void -fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) - DrawablePtr dst; - GCPtr pGC; - int depth, w, h, sx, sy, sw, sh, dx, dy; - unsigned int format; - char *data; -{ - int length; - char *newdata; - extern int nxagentImageLength(int, int, int, int, int); - - #ifdef TEST - fprintf(stderr, "fbShmPutImage: Called with drawable at [%p] GC at [%p] data at [%p].\n", - (void *) dst, (void *) pGC, (void *) data); - #endif - - if ((format == ZPixmap) || (depth == 1)) - { - PixmapPtr pPixmap; - - pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, - BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data); - if (!pPixmap) - return; - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, dst, pGC, - sx, sy, sw, sh, dx, dy, 1L); - else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, dst, pGC, - sx, sy, sw, sh, dx, dy); - - /* - * We updated the internal framebuffer, - * now we want to go on the real X. - */ - - #ifdef TEST - fprintf(stderr, "fbShmPutImage: Realizing the PutImage with depth [%d] " - " format [%d] w [%d] h [%d] sx [%d] sy [%d] sw [%d] " - " sh [%d] dx [%d].\n", depth, format, w, h, - sx, sy, sw, sh, dx); - #endif - - length = nxagentImageLength(sw, sh, format, 0, depth); - - if ((newdata = xalloc(length)) != NULL) - { - fbGetImage((DrawablePtr) pPixmap, sx, sy, sw, sh, format, AllPlanes, newdata); - (*pGC->ops->PutImage)(dst, pGC, depth, dx, dy, sw, sh, 0, format, newdata); - - xfree(newdata); - } - else - { - #ifdef WARNING - fprintf(stderr, "fbShmPutImage: WARNING! Data allocation failed.\n"); - #endif - } - - FreeScratchPixmapHeader(pPixmap); - } - else - { - #ifdef TEST - fprintf(stderr, "fbShmPutImage: Calling miShmPutImage().\n"); - #endif - miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, - data); - } -} - - -#ifdef PANORAMIX -static int -ProcPanoramiXShmPutImage(register ClientPtr client) -{ - int j, result = 0, orig_x, orig_y; - PanoramiXRes *draw, *gc; - Bool sendEvent, isRoot; - - REQUEST(xShmPutImageReq); - REQUEST_SIZE_MATCH(xShmPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - orig_x = stuff->dstX; - orig_y = stuff->dstY; - sendEvent = stuff->sendEvent; - stuff->sendEvent = 0; - FOR_NSCREENS(j) { - if(!j) stuff->sendEvent = sendEvent; - stuff->drawable = draw->info[j].id; - stuff->gc = gc->info[j].id; - if (isRoot) { - stuff->dstX = orig_x - panoramiXdataPtr[j].x; - stuff->dstY = orig_y - panoramiXdataPtr[j].y; - } - result = ProcShmPutImage(client); - if(result != client->noClientException) break; - } - return(result); -} - -static int -ProcPanoramiXShmGetImage(ClientPtr client) -{ - PanoramiXRes *draw; - DrawablePtr drawables[MAXSCREENS]; - DrawablePtr pDraw; - xShmGetImageReply xgi; - ShmDescPtr shmdesc; - int i, x, y, w, h, format; - Mask plane = 0, planemask; - long lenPer = 0, length, widthBytesLine; - Bool isRoot; - - REQUEST(xShmGetImageReq); - - REQUEST_SIZE_MATCH(xShmGetImageReq); - - if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { - client->errorValue = stuff->format; - return(BadValue); - } - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if (draw->type == XRT_PIXMAP) - return ProcShmGetImage(client); - - VERIFY_DRAWABLE(pDraw, stuff->drawable, client); - - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - - x = stuff->x; - y = stuff->y; - w = stuff->width; - h = stuff->height; - format = stuff->format; - planemask = stuff->planeMask; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - if(isRoot) { - if( /* check for being onscreen */ - x < 0 || x + w > PanoramiXPixWidth || - y < 0 || y + h > PanoramiXPixHeight ) - return(BadMatch); - } else { - if( /* check for being onscreen */ - panoramiXdataPtr[0].x + pDraw->x + x < 0 || - panoramiXdataPtr[0].x + pDraw->x + x + w > PanoramiXPixWidth || - panoramiXdataPtr[0].y + pDraw->y + y < 0 || - panoramiXdataPtr[0].y + pDraw->y + y + h > PanoramiXPixHeight || - /* check for being inside of border */ - x < - wBorderWidth((WindowPtr)pDraw) || - x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - y < -wBorderWidth((WindowPtr)pDraw) || - y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height) - return(BadMatch); - } - - drawables[0] = pDraw; - for(i = 1; i < PanoramiXNumScreens; i++) - VERIFY_DRAWABLE(drawables[i], draw->info[i].id, client); - - xgi.visual = wVisual(((WindowPtr)pDraw)); - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - - if(format == ZPixmap) { - widthBytesLine = PixmapBytePad(w, pDraw->depth); - length = widthBytesLine * h; - } else { - widthBytesLine = PixmapBytePad(w, 1); - lenPer = widthBytesLine * h; - plane = ((Mask)1) << (pDraw->depth - 1); - length = lenPer * Ones(planemask & (plane | (plane - 1))); - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); - xgi.size = length; - - if (length == 0) {/* nothing to do */ } - else if (format == ZPixmap) { - XineramaGetImageData(drawables, x, y, w, h, format, planemask, - shmdesc->addr + stuff->offset, - widthBytesLine, isRoot); - } else { - - length = stuff->offset; - for (; plane; plane >>= 1) { - if (planemask & plane) { - XineramaGetImageData(drawables, x, y, w, h, - format, plane, shmdesc->addr + length, - widthBytesLine, isRoot); - length += lenPer; - } - } - } - - if (client->swapped) { - register int n; - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); - } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - - return(client->noClientException); -} - -static int -ProcPanoramiXShmCreatePixmap( - register ClientPtr client) -{ - ScreenPtr pScreen = NULL; - PixmapPtr pMap = NULL; - DrawablePtr pDraw; - DepthPtr pDepth; - int i, j, result; - ShmDescPtr shmdesc; - REQUEST(xShmCreatePixmapReq); - unsigned int width, height, depth; - unsigned long size; - PanoramiXRes *newPix; - - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - client->errorValue = stuff->pid; - if (!sharedPixmaps) - return BadImplementation; - LEGAL_NEW_RESOURCE(stuff->pid, client); - VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - - width = stuff->width; - height = stuff->height; - depth = stuff->depth; - if (!width || !height || !depth) - { - client->errorValue = 0; - return BadValue; - } - if (width > 32767 || height > 32767) - return BadAlloc; - - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } - -CreatePmap: - size = PixmapBytePad(width, depth) * height; - if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) { - if (size < width * height) - return BadAlloc; - /* thankfully, offset is unsigned */ - if (stuff->offset + size < size) - return BadAlloc; - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); - - if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) - return BadAlloc; - - newPix->type = XRT_PIXMAP; - newPix->u.pix.shared = TRUE; - newPix->info[0].id = stuff->pid; - for(j = 1; j < PanoramiXNumScreens; j++) - newPix->info[j].id = FakeClientID(client->index); - - result = (client->noClientException); - - FOR_NSCREENS(j) { - pScreen = screenInfo.screens[j]; - - pMap = (*shmFuncs[j]->CreatePixmap)(pScreen, - stuff->width, stuff->height, stuff->depth, - shmdesc->addr + stuff->offset); - - if (pMap) { -#ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif - shmdesc->refcnt++; - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = newPix->info[j].id; - if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) { - (*pScreen->DestroyPixmap)(pMap); - result = BadAlloc; - break; - } - } else { - result = BadAlloc; - break; - } - } - - if(result == BadAlloc) { - while(j--) { - (*pScreen->DestroyPixmap)(pMap); - FreeResource(newPix->info[j].id, RT_NONE); - } - xfree(newPix); - } else - AddResource(stuff->pid, XRT_PIXMAP, newPix); - - return result; -} - -#endif - -static int -ProcShmPutImage(client) - register ClientPtr client; -{ - register GCPtr pGC; - register DrawablePtr pDraw; - long length; - ShmDescPtr shmdesc; - REQUEST(xShmPutImageReq); - - REQUEST_SIZE_MATCH(xShmPutImageReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client); - if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse)) - return BadValue; - if (stuff->format == XYBitmap) - { - if (stuff->depth != 1) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, 1); - } - else if (stuff->format == XYPixmap) - { - if (pDraw->depth != stuff->depth) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, 1); - length *= stuff->depth; - } - else if (stuff->format == ZPixmap) - { - if (pDraw->depth != stuff->depth) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, stuff->depth); - } - else - { - client->errorValue = stuff->format; - return BadValue; - } - - /* - * There's a potential integer overflow in this check: - * VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight, - * client); - * the version below ought to avoid it - */ - if (stuff->totalHeight != 0 && - length > (shmdesc->size - stuff->offset)/stuff->totalHeight) { - client->errorValue = stuff->totalWidth; - return BadValue; - } - if (stuff->srcX > stuff->totalWidth) - { - client->errorValue = stuff->srcX; - return BadValue; - } - if (stuff->srcY > stuff->totalHeight) - { - client->errorValue = stuff->srcY; - return BadValue; - } - if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth) - { - client->errorValue = stuff->srcWidth; - return BadValue; - } - if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight) - { - client->errorValue = stuff->srcHeight; - return BadValue; - } - - #ifdef TEST - fprintf(stderr, "ProcShmPutImage: Format [%d] srcX [%d] srcY [%d], " - "totalWidth [%d] totalHeight [%d]\n", stuff->format, stuff->srcX, - stuff->srcY, stuff->totalWidth, stuff->totalHeight); - #endif - - #ifdef TEST - fprintf(stderr, "ProcShmPutImage: Calling (*shmFuncs[pDraw->pScreen->myNum]->PutImage)().\n"); - #endif - - (*shmFuncs[pDraw->pScreen->myNum]->PutImage)( - pDraw, pGC, stuff->depth, stuff->format, - stuff->totalWidth, stuff->totalHeight, - stuff->srcX, stuff->srcY, - stuff->srcWidth, stuff->srcHeight, - stuff->dstX, stuff->dstY, - shmdesc->addr + stuff->offset); - - if (stuff->sendEvent) - { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.sequenceNumber = client->sequence; - ev.minorEvent = X_ShmPutImage; - ev.majorEvent = ShmReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; - WriteEventsToClient(client, 1, (xEvent *) &ev); - } - - return (client->noClientException); -} - - - -static int -ProcShmGetImage(client) - register ClientPtr client; -{ - register DrawablePtr pDraw; - long lenPer = 0, length; - Mask plane = 0; - xShmGetImageReply xgi; - ShmDescPtr shmdesc; - int n; - - REQUEST(xShmGetImageReq); - - REQUEST_SIZE_MATCH(xShmGetImageReq); - if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) - { - client->errorValue = stuff->format; - return(BadValue); - } - VERIFY_DRAWABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - if (pDraw->type == DRAWABLE_WINDOW) - { - if( /* check for being viewable */ - !((WindowPtr) pDraw)->realized || - /* check for being on screen */ - pDraw->x + stuff->x < 0 || - pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width || - pDraw->y + stuff->y < 0 || - pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height || - /* check for being inside of border */ - stuff->x < - wBorderWidth((WindowPtr)pDraw) || - stuff->x + (int)stuff->width > - wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - stuff->y < -wBorderWidth((WindowPtr)pDraw) || - stuff->y + (int)stuff->height > - wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height - ) - return(BadMatch); - xgi.visual = wVisual(((WindowPtr)pDraw)); - } - else - { - if (stuff->x < 0 || - stuff->x+(int)stuff->width > pDraw->width || - stuff->y < 0 || - stuff->y+(int)stuff->height > pDraw->height - ) - return(BadMatch); - xgi.visual = None; - } - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - if(stuff->format == ZPixmap) - { - length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height; - } - else - { - lenPer = PixmapBytePad(stuff->width, 1) * stuff->height; - plane = ((Mask)1) << (pDraw->depth - 1); - /* only planes asked for */ - length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1))); - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); - xgi.size = length; - - if (length == 0) - { - /* nothing to do */ - } - else if (stuff->format == ZPixmap) - { - (*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y, - stuff->width, stuff->height, - stuff->format, stuff->planeMask, - shmdesc->addr + stuff->offset); - } - else - { - - length = stuff->offset; - for (; plane; plane >>= 1) - { - if (stuff->planeMask & plane) - { - (*pDraw->pScreen->GetImage)(pDraw, - stuff->x, stuff->y, - stuff->width, stuff->height, - stuff->format, plane, - shmdesc->addr + length); - length += lenPer; - } - } - } - - if (client->swapped) { - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); - } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - - return(client->noClientException); -} - -static PixmapPtr -fbShmCreatePixmap (pScreen, width, height, depth, addr) - ScreenPtr pScreen; - int width; - int height; - int depth; - char *addr; -{ - register PixmapPtr pPixmap; - - nxagentShmPixmapTrap = 1; - - pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, depth); - - if (!pPixmap) - { - nxagentShmPixmapTrap = 0; - - return NullPixmap; - } - - #ifdef TEST - fprintf(stderr,"fbShmCreatePixmap: Width [%d] Height [%d] Depth [%d]\n", width, height, depth); - #endif - - if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, - BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) - { - #ifdef WARNING - fprintf(stderr,"fbShmCreatePixmap: Return Null Pixmap.\n"); - #endif - - (*pScreen->DestroyPixmap)(pPixmap); - - nxagentShmPixmapTrap = 0; - - return NullPixmap; - } - - nxagentShmPixmapTrap = 0; - - return pPixmap; -} - -static int -ProcShmCreatePixmap(client) - register ClientPtr client; -{ - PixmapPtr pMap; - register DrawablePtr pDraw; - DepthPtr pDepth; - register int i; - ShmDescPtr shmdesc; - REQUEST(xShmCreatePixmapReq); - unsigned int width, height, depth; - unsigned long size; - - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - client->errorValue = stuff->pid; - if (!sharedPixmaps) - return BadImplementation; - LEGAL_NEW_RESOURCE(stuff->pid, client); - VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - - width = stuff->width; - height = stuff->height; - depth = stuff->depth; - if (!width || !height || !depth) - { - client->errorValue = 0; - return BadValue; - } - if (width > 32767 || height > 32767) - return BadAlloc; - - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } - -CreatePmap: - size = PixmapBytePad(width, depth) * height; - if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) { - if (size < width * height) - return BadAlloc; - /* thankfully, offset is unsigned */ - if (stuff->offset + size < size) - return BadAlloc; - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); - pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)( - pDraw->pScreen, stuff->width, - stuff->height, stuff->depth, - shmdesc->addr + stuff->offset); - if (pMap) - { -#ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif - shmdesc->refcnt++; - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) - { - return(client->noClientException); - } - } - return (BadAlloc); -} - -static int -ProcShmDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - - #ifdef TEST - fprintf(stderr, "ProcShmDispatch: Going to execute operation [%d] for client [%d].\n", - stuff -> data, client -> index); - - if (stuff->data <= X_ShmCreatePixmap) - { - fprintf(stderr, "ProcShmDispatch: Request [%s] OPCODE#%d.\n", - nxagentShmRequestLiteral[stuff->data], stuff->data); - } - #endif - - switch (stuff->data) - { - case X_ShmQueryVersion: - return ProcShmQueryVersion(client); - case X_ShmAttach: - return ProcShmAttach(client); - case X_ShmDetach: - return ProcShmDetach(client); - case X_ShmPutImage: - { - int result; - - #ifdef TEST - fprintf(stderr, "ProcShmDispatch: Going to execute ProcShmPutImage() for client [%d].\n", - client -> index); - #endif - - nxagentShmTrap = 1; - -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - { - result = ProcPanoramiXShmPutImage(client); - - nxagentShmTrap = 0; - - return result; - } -#endif - - result = ProcShmPutImage(client); - - nxagentShmTrap = 0; - - #ifdef TEST - fprintf(stderr, "ProcShmDispatch: Returning from ProcShmPutImage() for client [%d].\n", - client -> index); - #endif - - return result; - } - case X_ShmGetImage: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmGetImage(client); -#endif - return ProcShmGetImage(client); - case X_ShmCreatePixmap: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmCreatePixmap(client); -#endif - return ProcShmCreatePixmap(client); - default: - return BadRequest; - } -} - -static void -SShmCompletionEvent(from, to) - xShmCompletionEvent *from, *to; -{ - to->type = from->type; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->drawable, to->drawable); - cpswaps(from->minorEvent, to->minorEvent); - to->majorEvent = from->majorEvent; - cpswapl(from->shmseg, to->shmseg); - cpswapl(from->offset, to->offset); -} - -static int -SProcShmQueryVersion(client) - register ClientPtr client; -{ - register int n; - REQUEST(xShmQueryVersionReq); - - swaps(&stuff->length, n); - return ProcShmQueryVersion(client); -} - -static int -SProcShmAttach(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmAttachReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmAttachReq); - swapl(&stuff->shmseg, n); - swapl(&stuff->shmid, n); - return ProcShmAttach(client); -} - -static int -SProcShmDetach(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmDetachReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmDetachReq); - swapl(&stuff->shmseg, n); - return ProcShmDetach(client); -} - -static int -SProcShmPutImage(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmPutImageReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmPutImageReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->totalWidth, n); - swaps(&stuff->totalHeight, n); - swaps(&stuff->srcX, n); - swaps(&stuff->srcY, n); - swaps(&stuff->srcWidth, n); - swaps(&stuff->srcHeight, n); - swaps(&stuff->dstX, n); - swaps(&stuff->dstY, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmPutImage(client); -} - -static int -SProcShmGetImage(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmGetImageReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmGetImageReq); - swapl(&stuff->drawable, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->planeMask, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmGetImage(client); -} - -static int -SProcShmCreatePixmap(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmCreatePixmapReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmCreatePixmap(client); -} - -static int -SProcShmDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - - #ifdef TEST - fprintf(stderr, "SProcShmDispatch: Going to execute operation [%d] for client [%d].\n", - stuff -> data, client -> index); - #endif - - switch (stuff->data) - { - case X_ShmQueryVersion: - return SProcShmQueryVersion(client); - case X_ShmAttach: - return SProcShmAttach(client); - case X_ShmDetach: - return SProcShmDetach(client); - case X_ShmPutImage: - { - int result; - - #ifdef TEST - fprintf(stderr, "SProcShmDispatch: Going to execute SProcShmPutImage() for client [%d].\n", - client -> index); - #endif - - nxagentShmTrap = 1; - - result = SProcShmPutImage(client); - - nxagentShmTrap = 0; - - #ifdef TEST - fprintf(stderr, "SProcShmDispatch: Returning from SProcShmPutImage() for client [%d].\n", - client -> index); - #endif - - return result; - } - case X_ShmGetImage: - return SProcShmGetImage(client); - case X_ShmCreatePixmap: - return SProcShmCreatePixmap(client); - default: - return BadRequest; - } -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.X.original deleted file mode 100644 index f25bb9b5d..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.X.original +++ /dev/null @@ -1,1310 +0,0 @@ -/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.41 2003/12/17 23:28:56 alanh Exp $ */ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -********************************************************/ - -/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ - -/* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ - -#define SHM - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#ifndef Lynx -#include -#include -#else -#include -#include -#endif -#include -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "extnsionst.h" -#include "servermd.h" -#define _XSHM_SERVER_ -#include -#include -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -#include "modinit.h" - -typedef struct _ShmDesc { - struct _ShmDesc *next; - int shmid; - int refcnt; - char *addr; - Bool writable; - unsigned long size; -} ShmDescRec, *ShmDescPtr; - -static void miShmPutImage(XSHM_PUT_IMAGE_ARGS); -static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS); -static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); -static int ShmDetachSegment( - pointer /* value */, - XID /* shmseg */ - ); -static void ShmResetProc( - ExtensionEntry * /* extEntry */ - ); -static void SShmCompletionEvent( - xShmCompletionEvent * /* from */, - xShmCompletionEvent * /* to */ - ); - -static Bool ShmDestroyPixmap (PixmapPtr pPixmap); - -static DISPATCH_PROC(ProcShmAttach); -static DISPATCH_PROC(ProcShmCreatePixmap); -static DISPATCH_PROC(ProcShmDetach); -static DISPATCH_PROC(ProcShmDispatch); -static DISPATCH_PROC(ProcShmGetImage); -static DISPATCH_PROC(ProcShmPutImage); -static DISPATCH_PROC(ProcShmQueryVersion); -static DISPATCH_PROC(SProcShmAttach); -static DISPATCH_PROC(SProcShmCreatePixmap); -static DISPATCH_PROC(SProcShmDetach); -static DISPATCH_PROC(SProcShmDispatch); -static DISPATCH_PROC(SProcShmGetImage); -static DISPATCH_PROC(SProcShmPutImage); -static DISPATCH_PROC(SProcShmQueryVersion); - -static unsigned char ShmReqCode; -int ShmCompletionCode; -int BadShmSegCode; -RESTYPE ShmSegType; -static ShmDescPtr Shmsegs; -static Bool sharedPixmaps; -static int pixmapFormat; -static int shmPixFormat[MAXSCREENS]; -static ShmFuncsPtr shmFuncs[MAXSCREENS]; -static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS]; -#ifdef PIXPRIV -static int shmPixmapPrivate; -#endif -static ShmFuncs miFuncs = {NULL, miShmPutImage}; -static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage}; - -#define VERIFY_SHMSEG(shmseg,shmdesc,client) \ -{ \ - shmdesc = (ShmDescPtr)LookupIDByType(shmseg, ShmSegType); \ - if (!shmdesc) \ - { \ - client->errorValue = shmseg; \ - return BadShmSegCode; \ - } \ -} - -#define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \ -{ \ - VERIFY_SHMSEG(shmseg, shmdesc, client); \ - if ((offset & 3) || (offset > shmdesc->size)) \ - { \ - client->errorValue = offset; \ - return BadValue; \ - } \ - if (needwrite && !shmdesc->writable) \ - return BadAccess; \ -} - -#define VERIFY_SHMSIZE(shmdesc,offset,len,client) \ -{ \ - if ((offset + len) > shmdesc->size) \ - { \ - return BadAccess; \ - } \ -} - - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) -#include - -static Bool badSysCall = FALSE; - -static void -SigSysHandler(signo) -int signo; -{ - badSysCall = TRUE; -} - -static Bool CheckForShmSyscall() -{ - void (*oldHandler)(); - int shmid = -1; - - /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ - oldHandler = signal(SIGSYS, SigSysHandler); - - badSysCall = FALSE; - shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); - - if (shmid != -1) - { - /* Successful allocation - clean up */ - shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL); - } - else - { - /* Allocation failed */ - badSysCall = TRUE; - } - signal(SIGSYS, oldHandler); - return(!badSysCall); -} - -#define MUST_CHECK_FOR_SHM_SYSCALL - -#endif - -void -ShmExtensionInit(INITARGS) -{ - ExtensionEntry *extEntry; - int i; - -#ifdef MUST_CHECK_FOR_SHM_SYSCALL - if (!CheckForShmSyscall()) - { - ErrorF("MIT-SHM extension disabled due to lack of kernel support\n"); - return; - } -#endif - - sharedPixmaps = xFalse; - pixmapFormat = 0; - { - sharedPixmaps = xTrue; - pixmapFormat = shmPixFormat[0]; - for (i = 0; i < screenInfo.numScreens; i++) - { - if (!shmFuncs[i]) - shmFuncs[i] = &miFuncs; - if (!shmFuncs[i]->CreatePixmap) - sharedPixmaps = xFalse; - if (shmPixFormat[i] && (shmPixFormat[i] != pixmapFormat)) - { - sharedPixmaps = xFalse; - pixmapFormat = 0; - } - } - if (!pixmapFormat) - pixmapFormat = ZPixmap; - if (sharedPixmaps) - { - for (i = 0; i < screenInfo.numScreens; i++) - { - destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap; - screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap; - } -#ifdef PIXPRIV - shmPixmapPrivate = AllocatePixmapPrivateIndex(); - for (i = 0; i < screenInfo.numScreens; i++) - { - if (!AllocatePixmapPrivate(screenInfo.screens[i], - shmPixmapPrivate, 0)) - return; - } -#endif - } - } - ShmSegType = CreateNewResourceType(ShmDetachSegment); - if (ShmSegType && - (extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors, - ProcShmDispatch, SProcShmDispatch, - ShmResetProc, StandardMinorOpcode))) - { - ShmReqCode = (unsigned char)extEntry->base; - ShmCompletionCode = extEntry->eventBase; - BadShmSegCode = extEntry->errorBase; - EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent; - } -} - -/*ARGSUSED*/ -static void -ShmResetProc (extEntry) -ExtensionEntry *extEntry; -{ - int i; - - for (i = 0; i < MAXSCREENS; i++) - { - shmFuncs[i] = (ShmFuncsPtr)NULL; - shmPixFormat[i] = 0; - } -} - -void -ShmRegisterFuncs( - ScreenPtr pScreen, - ShmFuncsPtr funcs) -{ - shmFuncs[pScreen->myNum] = funcs; -} - -void -ShmSetPixmapFormat( - ScreenPtr pScreen, - int format) -{ - shmPixFormat[pScreen->myNum] = format; -} - -static Bool -ShmDestroyPixmap (PixmapPtr pPixmap) -{ - ScreenPtr pScreen = pPixmap->drawable.pScreen; - Bool ret; - if (pPixmap->refcnt == 1) - { - ShmDescPtr shmdesc; -#ifdef PIXPRIV - shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr; -#else - char *base = (char *) pPixmap->devPrivate.ptr; - - if (base != (pointer) (pPixmap + 1)) - { - for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next) - { - if (shmdesc->addr <= base && base <= shmdesc->addr + shmdesc->size) - break; - } - } - else - shmdesc = 0; -#endif - if (shmdesc) - ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id); - } - - pScreen->DestroyPixmap = destroyPixmap[pScreen->myNum]; - ret = (*pScreen->DestroyPixmap) (pPixmap); - destroyPixmap[pScreen->myNum] = pScreen->DestroyPixmap; - pScreen->DestroyPixmap = ShmDestroyPixmap; - return ret; -} - -void -ShmRegisterFbFuncs(pScreen) - ScreenPtr pScreen; -{ - shmFuncs[pScreen->myNum] = &fbFuncs; -} - -static int -ProcShmQueryVersion(client) - register ClientPtr client; -{ - xShmQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xShmQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.sharedPixmaps = sharedPixmaps; - rep.pixmapFormat = pixmapFormat; - rep.majorVersion = SHM_MAJOR_VERSION; - rep.minorVersion = SHM_MINOR_VERSION; - rep.uid = geteuid(); - rep.gid = getegid(); - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - swaps(&rep.uid, n); - swaps(&rep.gid, n); - } - WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -/* - * Simulate the access() system call for a shared memory segement, - * using the credentials from the client if available - */ -static int -shm_access(ClientPtr client, struct ipc_perm *perm, int readonly) -{ - int uid, gid; - mode_t mask; - - if (LocalClientCred(client, &uid, &gid) != -1) { - - /* User id 0 always gets access */ - if (uid == 0) { - return 0; - } - /* Check the owner */ - if (perm->uid == uid || perm->cuid == uid) { - mask = S_IRUSR; - if (!readonly) { - mask |= S_IWUSR; - } - return (perm->mode & mask) == mask ? 0 : -1; - } - /* Check the group */ - if (perm->gid == gid || perm->cgid == gid) { - mask = S_IRGRP; - if (!readonly) { - mask |= S_IWGRP; - } - return (perm->mode & mask) == mask ? 0 : -1; - } - } - /* Otherwise, check everyone else */ - mask = S_IROTH; - if (!readonly) { - mask |= S_IWOTH; - } - return (perm->mode & mask) == mask ? 0 : -1; -} - -static int -ProcShmAttach(client) - register ClientPtr client; -{ - struct shmid_ds buf; - ShmDescPtr shmdesc; - REQUEST(xShmAttachReq); - - REQUEST_SIZE_MATCH(xShmAttachReq); - LEGAL_NEW_RESOURCE(stuff->shmseg, client); - if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) - { - client->errorValue = stuff->readOnly; - return(BadValue); - } - for (shmdesc = Shmsegs; - shmdesc && (shmdesc->shmid != stuff->shmid); - shmdesc = shmdesc->next) - ; - if (shmdesc) - { - if (!stuff->readOnly && !shmdesc->writable) - return BadAccess; - shmdesc->refcnt++; - } - else - { - shmdesc = (ShmDescPtr) xalloc(sizeof(ShmDescRec)); - if (!shmdesc) - return BadAlloc; - shmdesc->addr = shmat(stuff->shmid, 0, - stuff->readOnly ? SHM_RDONLY : 0); - if ((shmdesc->addr == ((char *)-1)) || - shmctl(stuff->shmid, IPC_STAT, &buf)) - { - xfree(shmdesc); - return BadAccess; - } - - /* The attach was performed with root privs. We must - * do manual checking of access rights for the credentials - * of the client */ - - if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) { - shmdt(shmdesc->addr); - xfree(shmdesc); - return BadAccess; - } - - shmdesc->shmid = stuff->shmid; - shmdesc->refcnt = 1; - shmdesc->writable = !stuff->readOnly; - shmdesc->size = buf.shm_segsz; - shmdesc->next = Shmsegs; - Shmsegs = shmdesc; - } - if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc)) - return BadAlloc; - return(client->noClientException); -} - -/*ARGSUSED*/ -static int -ShmDetachSegment(value, shmseg) - pointer value; /* must conform to DeleteType */ - XID shmseg; -{ - ShmDescPtr shmdesc = (ShmDescPtr)value; - ShmDescPtr *prev; - - if (--shmdesc->refcnt) - return TRUE; - shmdt(shmdesc->addr); - for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next) - ; - *prev = shmdesc->next; - xfree(shmdesc); - return Success; -} - -static int -ProcShmDetach(client) - register ClientPtr client; -{ - ShmDescPtr shmdesc; - REQUEST(xShmDetachReq); - - REQUEST_SIZE_MATCH(xShmDetachReq); - VERIFY_SHMSEG(stuff->shmseg, shmdesc, client); - FreeResource(stuff->shmseg, RT_NONE); - return(client->noClientException); -} - -static void -miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) - DrawablePtr dst; - GCPtr pGC; - int depth, w, h, sx, sy, sw, sh, dx, dy; - unsigned int format; - char *data; -{ - PixmapPtr pmap; - GCPtr putGC; - - putGC = GetScratchGC(depth, dst->pScreen); - if (!putGC) - return; - pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth); - if (!pmap) - { - FreeScratchGC(putGC); - return; - } - ValidateGC((DrawablePtr)pmap, putGC); - (*putGC->ops->PutImage)((DrawablePtr)pmap, putGC, depth, -sx, -sy, w, h, 0, - (format == XYPixmap) ? XYPixmap : ZPixmap, data); - FreeScratchGC(putGC); - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy, 1L); - else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh, - dx, dy); - (*pmap->drawable.pScreen->DestroyPixmap)(pmap); -} - -static void -fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) - DrawablePtr dst; - GCPtr pGC; - int depth, w, h, sx, sy, sw, sh, dx, dy; - unsigned int format; - char *data; -{ - if ((format == ZPixmap) || (depth == 1)) - { - PixmapPtr pPixmap; - - pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, - BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data); - if (!pPixmap) - return; - if (format == XYBitmap) - (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, dst, pGC, - sx, sy, sw, sh, dx, dy, 1L); - else - (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, dst, pGC, - sx, sy, sw, sh, dx, dy); - FreeScratchPixmapHeader(pPixmap); - } - else - miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, - data); -} - - -#ifdef PANORAMIX -static int -ProcPanoramiXShmPutImage(register ClientPtr client) -{ - int j, result = 0, orig_x, orig_y; - PanoramiXRes *draw, *gc; - Bool sendEvent, isRoot; - - REQUEST(xShmPutImageReq); - REQUEST_SIZE_MATCH(xShmPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - orig_x = stuff->dstX; - orig_y = stuff->dstY; - sendEvent = stuff->sendEvent; - stuff->sendEvent = 0; - FOR_NSCREENS(j) { - if(!j) stuff->sendEvent = sendEvent; - stuff->drawable = draw->info[j].id; - stuff->gc = gc->info[j].id; - if (isRoot) { - stuff->dstX = orig_x - panoramiXdataPtr[j].x; - stuff->dstY = orig_y - panoramiXdataPtr[j].y; - } - result = ProcShmPutImage(client); - if(result != client->noClientException) break; - } - return(result); -} - -static int -ProcPanoramiXShmGetImage(ClientPtr client) -{ - PanoramiXRes *draw; - DrawablePtr drawables[MAXSCREENS]; - DrawablePtr pDraw; - xShmGetImageReply xgi; - ShmDescPtr shmdesc; - int i, x, y, w, h, format; - Mask plane = 0, planemask; - long lenPer = 0, length, widthBytesLine; - Bool isRoot; - - REQUEST(xShmGetImageReq); - - REQUEST_SIZE_MATCH(xShmGetImageReq); - - if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { - client->errorValue = stuff->format; - return(BadValue); - } - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if (draw->type == XRT_PIXMAP) - return ProcShmGetImage(client); - - VERIFY_DRAWABLE(pDraw, stuff->drawable, client); - - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - - x = stuff->x; - y = stuff->y; - w = stuff->width; - h = stuff->height; - format = stuff->format; - planemask = stuff->planeMask; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - if(isRoot) { - if( /* check for being onscreen */ - x < 0 || x + w > PanoramiXPixWidth || - y < 0 || y + h > PanoramiXPixHeight ) - return(BadMatch); - } else { - if( /* check for being onscreen */ - panoramiXdataPtr[0].x + pDraw->x + x < 0 || - panoramiXdataPtr[0].x + pDraw->x + x + w > PanoramiXPixWidth || - panoramiXdataPtr[0].y + pDraw->y + y < 0 || - panoramiXdataPtr[0].y + pDraw->y + y + h > PanoramiXPixHeight || - /* check for being inside of border */ - x < - wBorderWidth((WindowPtr)pDraw) || - x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - y < -wBorderWidth((WindowPtr)pDraw) || - y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height) - return(BadMatch); - } - - drawables[0] = pDraw; - for(i = 1; i < PanoramiXNumScreens; i++) - VERIFY_DRAWABLE(drawables[i], draw->info[i].id, client); - - xgi.visual = wVisual(((WindowPtr)pDraw)); - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - - if(format == ZPixmap) { - widthBytesLine = PixmapBytePad(w, pDraw->depth); - length = widthBytesLine * h; - } else { - widthBytesLine = PixmapBytePad(w, 1); - lenPer = widthBytesLine * h; - plane = ((Mask)1) << (pDraw->depth - 1); - length = lenPer * Ones(planemask & (plane | (plane - 1))); - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); - xgi.size = length; - - if (length == 0) {/* nothing to do */ } - else if (format == ZPixmap) { - XineramaGetImageData(drawables, x, y, w, h, format, planemask, - shmdesc->addr + stuff->offset, - widthBytesLine, isRoot); - } else { - - length = stuff->offset; - for (; plane; plane >>= 1) { - if (planemask & plane) { - XineramaGetImageData(drawables, x, y, w, h, - format, plane, shmdesc->addr + length, - widthBytesLine, isRoot); - length += lenPer; - } - } - } - - if (client->swapped) { - register int n; - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); - } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - - return(client->noClientException); -} - -static int -ProcPanoramiXShmCreatePixmap( - register ClientPtr client) -{ - ScreenPtr pScreen = NULL; - PixmapPtr pMap = NULL; - DrawablePtr pDraw; - DepthPtr pDepth; - int i, j, result; - ShmDescPtr shmdesc; - REQUEST(xShmCreatePixmapReq); - unsigned int width, height, depth; - unsigned long size; - PanoramiXRes *newPix; - - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - client->errorValue = stuff->pid; - if (!sharedPixmaps) - return BadImplementation; - LEGAL_NEW_RESOURCE(stuff->pid, client); - VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - - width = stuff->width; - height = stuff->height; - depth = stuff->depth; - if (!width || !height || !depth) - { - client->errorValue = 0; - return BadValue; - } - if (width > 32767 || height > 32767) - return BadAlloc; - - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } - -CreatePmap: - size = PixmapBytePad(width, depth) * height; - if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) { - if (size < width * height) - return BadAlloc; - /* thankfully, offset is unsigned */ - if (stuff->offset + size < size) - return BadAlloc; - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); - - if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) - return BadAlloc; - - newPix->type = XRT_PIXMAP; - newPix->u.pix.shared = TRUE; - newPix->info[0].id = stuff->pid; - for(j = 1; j < PanoramiXNumScreens; j++) - newPix->info[j].id = FakeClientID(client->index); - - result = (client->noClientException); - - FOR_NSCREENS(j) { - pScreen = screenInfo.screens[j]; - - pMap = (*shmFuncs[j]->CreatePixmap)(pScreen, - stuff->width, stuff->height, stuff->depth, - shmdesc->addr + stuff->offset); - - if (pMap) { -#ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif - shmdesc->refcnt++; - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = newPix->info[j].id; - if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) { - (*pScreen->DestroyPixmap)(pMap); - result = BadAlloc; - break; - } - } else { - result = BadAlloc; - break; - } - } - - if(result == BadAlloc) { - while(j--) { - (*pScreen->DestroyPixmap)(pMap); - FreeResource(newPix->info[j].id, RT_NONE); - } - xfree(newPix); - } else - AddResource(stuff->pid, XRT_PIXMAP, newPix); - - return result; -} - -#endif - -static int -ProcShmPutImage(client) - register ClientPtr client; -{ - register GCPtr pGC; - register DrawablePtr pDraw; - long length; - ShmDescPtr shmdesc; - REQUEST(xShmPutImageReq); - - REQUEST_SIZE_MATCH(xShmPutImageReq); - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client); - if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse)) - return BadValue; - if (stuff->format == XYBitmap) - { - if (stuff->depth != 1) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, 1); - } - else if (stuff->format == XYPixmap) - { - if (pDraw->depth != stuff->depth) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, 1); - length *= stuff->depth; - } - else if (stuff->format == ZPixmap) - { - if (pDraw->depth != stuff->depth) - return BadMatch; - length = PixmapBytePad(stuff->totalWidth, stuff->depth); - } - else - { - client->errorValue = stuff->format; - return BadValue; - } - - /* - * There's a potential integer overflow in this check: - * VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight, - * client); - * the version below ought to avoid it - */ - if (stuff->totalHeight != 0 && - length > (shmdesc->size - stuff->offset)/stuff->totalHeight) { - client->errorValue = stuff->totalWidth; - return BadValue; - } - if (stuff->srcX > stuff->totalWidth) - { - client->errorValue = stuff->srcX; - return BadValue; - } - if (stuff->srcY > stuff->totalHeight) - { - client->errorValue = stuff->srcY; - return BadValue; - } - if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth) - { - client->errorValue = stuff->srcWidth; - return BadValue; - } - if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight) - { - client->errorValue = stuff->srcHeight; - return BadValue; - } - - if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) || - ((stuff->format != ZPixmap) && - (stuff->srcX < screenInfo.bitmapScanlinePad) && - ((stuff->format == XYBitmap) || - ((stuff->srcY == 0) && - (stuff->srcHeight == stuff->totalHeight))))) && - ((stuff->srcX + stuff->srcWidth) == stuff->totalWidth)) - (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, - stuff->dstX, stuff->dstY, - stuff->totalWidth, stuff->srcHeight, - stuff->srcX, stuff->format, - shmdesc->addr + stuff->offset + - (stuff->srcY * length)); - else - (*shmFuncs[pDraw->pScreen->myNum]->PutImage)( - pDraw, pGC, stuff->depth, stuff->format, - stuff->totalWidth, stuff->totalHeight, - stuff->srcX, stuff->srcY, - stuff->srcWidth, stuff->srcHeight, - stuff->dstX, stuff->dstY, - shmdesc->addr + stuff->offset); - - if (stuff->sendEvent) - { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.sequenceNumber = client->sequence; - ev.minorEvent = X_ShmPutImage; - ev.majorEvent = ShmReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; - WriteEventsToClient(client, 1, (xEvent *) &ev); - } - - return (client->noClientException); -} - - - -static int -ProcShmGetImage(client) - register ClientPtr client; -{ - register DrawablePtr pDraw; - long lenPer = 0, length; - Mask plane = 0; - xShmGetImageReply xgi; - ShmDescPtr shmdesc; - int n; - - REQUEST(xShmGetImageReq); - - REQUEST_SIZE_MATCH(xShmGetImageReq); - if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) - { - client->errorValue = stuff->format; - return(BadValue); - } - VERIFY_DRAWABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - if (pDraw->type == DRAWABLE_WINDOW) - { - if( /* check for being viewable */ - !((WindowPtr) pDraw)->realized || - /* check for being on screen */ - pDraw->x + stuff->x < 0 || - pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width || - pDraw->y + stuff->y < 0 || - pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height || - /* check for being inside of border */ - stuff->x < - wBorderWidth((WindowPtr)pDraw) || - stuff->x + (int)stuff->width > - wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width || - stuff->y < -wBorderWidth((WindowPtr)pDraw) || - stuff->y + (int)stuff->height > - wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height - ) - return(BadMatch); - xgi.visual = wVisual(((WindowPtr)pDraw)); - } - else - { - if (stuff->x < 0 || - stuff->x+(int)stuff->width > pDraw->width || - stuff->y < 0 || - stuff->y+(int)stuff->height > pDraw->height - ) - return(BadMatch); - xgi.visual = None; - } - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; - if(stuff->format == ZPixmap) - { - length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height; - } - else - { - lenPer = PixmapBytePad(stuff->width, 1) * stuff->height; - plane = ((Mask)1) << (pDraw->depth - 1); - /* only planes asked for */ - length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1))); - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); - xgi.size = length; - - if (length == 0) - { - /* nothing to do */ - } - else if (stuff->format == ZPixmap) - { - (*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y, - stuff->width, stuff->height, - stuff->format, stuff->planeMask, - shmdesc->addr + stuff->offset); - } - else - { - - length = stuff->offset; - for (; plane; plane >>= 1) - { - if (stuff->planeMask & plane) - { - (*pDraw->pScreen->GetImage)(pDraw, - stuff->x, stuff->y, - stuff->width, stuff->height, - stuff->format, plane, - shmdesc->addr + length); - length += lenPer; - } - } - } - - if (client->swapped) { - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); - } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); - - return(client->noClientException); -} - -static PixmapPtr -fbShmCreatePixmap (pScreen, width, height, depth, addr) - ScreenPtr pScreen; - int width; - int height; - int depth; - char *addr; -{ - register PixmapPtr pPixmap; - - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); - if (!pPixmap) - return NullPixmap; - - if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, - BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) { - (*pScreen->DestroyPixmap)(pPixmap); - return NullPixmap; - } - return pPixmap; -} - -static int -ProcShmCreatePixmap(client) - register ClientPtr client; -{ - PixmapPtr pMap; - register DrawablePtr pDraw; - DepthPtr pDepth; - register int i; - ShmDescPtr shmdesc; - REQUEST(xShmCreatePixmapReq); - unsigned int width, height, depth; - unsigned long size; - - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - client->errorValue = stuff->pid; - if (!sharedPixmaps) - return BadImplementation; - LEGAL_NEW_RESOURCE(stuff->pid, client); - VERIFY_GEOMETRABLE(pDraw, stuff->drawable, client); - VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); - - width = stuff->width; - height = stuff->height; - depth = stuff->depth; - if (!width || !height || !depth) - { - client->errorValue = 0; - return BadValue; - } - if (width > 32767 || height > 32767) - return BadAlloc; - - if (stuff->depth != 1) - { - pDepth = pDraw->pScreen->allowedDepths; - for (i=0; ipScreen->numDepths; i++, pDepth++) - if (pDepth->depth == stuff->depth) - goto CreatePmap; - client->errorValue = stuff->depth; - return BadValue; - } - -CreatePmap: - size = PixmapBytePad(width, depth) * height; - if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) { - if (size < width * height) - return BadAlloc; - /* thankfully, offset is unsigned */ - if (stuff->offset + size < size) - return BadAlloc; - } - - VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); - pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)( - pDraw->pScreen, stuff->width, - stuff->height, stuff->depth, - shmdesc->addr + stuff->offset); - if (pMap) - { -#ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif - shmdesc->refcnt++; - pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) - { - return(client->noClientException); - } - } - return (BadAlloc); -} - -static int -ProcShmDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_ShmQueryVersion: - return ProcShmQueryVersion(client); - case X_ShmAttach: - return ProcShmAttach(client); - case X_ShmDetach: - return ProcShmDetach(client); - case X_ShmPutImage: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmPutImage(client); -#endif - return ProcShmPutImage(client); - case X_ShmGetImage: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmGetImage(client); -#endif - return ProcShmGetImage(client); - case X_ShmCreatePixmap: -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) - return ProcPanoramiXShmCreatePixmap(client); -#endif - return ProcShmCreatePixmap(client); - default: - return BadRequest; - } -} - -static void -SShmCompletionEvent(from, to) - xShmCompletionEvent *from, *to; -{ - to->type = from->type; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->drawable, to->drawable); - cpswaps(from->minorEvent, to->minorEvent); - to->majorEvent = from->majorEvent; - cpswapl(from->shmseg, to->shmseg); - cpswapl(from->offset, to->offset); -} - -static int -SProcShmQueryVersion(client) - register ClientPtr client; -{ - register int n; - REQUEST(xShmQueryVersionReq); - - swaps(&stuff->length, n); - return ProcShmQueryVersion(client); -} - -static int -SProcShmAttach(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmAttachReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmAttachReq); - swapl(&stuff->shmseg, n); - swapl(&stuff->shmid, n); - return ProcShmAttach(client); -} - -static int -SProcShmDetach(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmDetachReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmDetachReq); - swapl(&stuff->shmseg, n); - return ProcShmDetach(client); -} - -static int -SProcShmPutImage(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmPutImageReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmPutImageReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->totalWidth, n); - swaps(&stuff->totalHeight, n); - swaps(&stuff->srcX, n); - swaps(&stuff->srcY, n); - swaps(&stuff->srcWidth, n); - swaps(&stuff->srcHeight, n); - swaps(&stuff->dstX, n); - swaps(&stuff->dstY, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmPutImage(client); -} - -static int -SProcShmGetImage(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmGetImageReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmGetImageReq); - swapl(&stuff->drawable, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->planeMask, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmGetImage(client); -} - -static int -SProcShmCreatePixmap(client) - ClientPtr client; -{ - register int n; - REQUEST(xShmCreatePixmapReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); - return ProcShmCreatePixmap(client); -} - -static int -SProcShmDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_ShmQueryVersion: - return SProcShmQueryVersion(client); - case X_ShmAttach: - return SProcShmAttach(client); - case X_ShmDetach: - return SProcShmDetach(client); - case X_ShmPutImage: - return SProcShmPutImage(client); - case X_ShmGetImage: - return SProcShmGetImage(client); - case X_ShmCreatePixmap: - return SProcShmCreatePixmap(client); - default: - return BadRequest; - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original deleted file mode 100644 index 76e86fd2a..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original +++ /dev/null @@ -1,4167 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.12 2005/07/03 08:53:38 daniels Exp $ */ -/* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -/* The panoramix components contained the following notice */ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.36 2003/11/14 23:52:50 torrey Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#include "selection.h" -#ifdef PANORAMIX -#include "../../Xext/panoramiX.h" -#include "../../Xext/panoramiXsrv.h" -#endif -#include "dixevents.h" -#include "globals.h" - -#ifdef XAPPGROUP -#include -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif - -#include "Screen.h" -#include "Options.h" -#include "Atoms.h" -#include "Clipboard.h" -#include "Splash.h" -#include "Rootless.h" -#include "Composite.h" -#include "Drawable.h" -#include "Colormap.h" - -extern Bool nxagentWMIsRunning; -extern Bool nxagentScreenTrap; - -/****** - * Window stuff for server - * - * CreateRootWindow, CreateWindow, ChangeWindowAttributes, - * GetWindowAttributes, DeleteWindow, DestroySubWindows, - * HandleSaveSet, ReparentWindow, MapWindow, MapSubWindows, - * UnmapWindow, UnmapSubWindows, ConfigureWindow, CirculateWindow, - * - ******/ - -static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11}; -static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88}; - -int screenIsSaved = SCREEN_SAVER_OFF; - -ScreenSaverStuffRec savedScreenInfo[MAXSCREENS]; - -#if 0 -extern void DeleteWindowFromAnyEvents(); -extern Mask EventMaskForClient(); -extern void WindowHasNewCursor(); -extern void RecalculateDeliverableEvents(); -#endif - -static Bool TileScreenSaver(int i, int kind); - - -#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \ - CWDontPropagate | CWOverrideRedirect | CWCursor ) - -#define BOXES_OVERLAP(b1, b2) \ - (!( ((b1)->x2 <= (b2)->x1) || \ - ( ((b1)->x1 >= (b2)->x2)) || \ - ( ((b1)->y2 <= (b2)->y1)) || \ - ( ((b1)->y1 >= (b2)->y2)) ) ) - -#define RedirectSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureRedirectMask) - -#define SubSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureNotifyMask) - -#define StrSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & StructureNotifyMask) - -#define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent)) - - -/* - * Set here the required log level. - */ - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -int numSaveUndersViewable = 0; -int deltaSaveUndersViewable = 0; - -WindowPtr nxagentRootTileWindow; - -/* - * This block used the DEBUG symbol. - */ - -#ifdef WINDOW_TREE_DEBUG -/****** - * PrintWindowTree - * For debugging only - ******/ - -int -PrintChildren(WindowPtr p1, int indent) -{ - WindowPtr p2; - int i; - - while (p1) - { - p2 = p1->firstChild; - for (i=0; idrawable.id); - miPrintRegion(&p1->clipList); - PrintChildren(p2, indent+4); - p1 = p1->nextSib; - } -} - -PrintWindowTree() -{ - int i; - WindowPtr pWin, p1; - - for (i=0; iclipList); - p1 = pWin->firstChild; - PrintChildren(p1, 4); - } -} -#endif - -int -TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, pointer data) -{ - register int result; - register WindowPtr pChild; - - if (!(pChild = pWin)) - return(WT_NOMATCH); - while (1) - { - result = (* func)(pChild, data); - if (result == WT_STOPWALKING) - return(WT_STOPWALKING); - if ((result == WT_WALKCHILDREN) && pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } - return(WT_NOMATCH); -} - -/***** - * WalkTree - * Walk the window tree, for SCREEN, preforming FUNC(pWin, data) on - * each window. If FUNC returns WT_WALKCHILDREN, traverse the children, - * if it returns WT_DONTWALKCHILDREN, dont. If it returns WT_STOPWALKING - * exit WalkTree. Does depth-first traverse. - *****/ - -int -WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, pointer data) -{ - return(TraverseTree(WindowTable[pScreen->myNum], func, data)); -} - -/* hack for forcing backing store on all windows */ -int defaultBackingStore = NotUseful; -/* hack to force no backing store */ -Bool disableBackingStore = FALSE; -Bool enableBackingStore = FALSE; -/* hack to force no save unders */ -Bool disableSaveUnders = FALSE; - -static void -SetWindowToDefaults(register WindowPtr pWin) -{ - pWin->prevSib = NullWindow; - pWin->firstChild = NullWindow; - pWin->lastChild = NullWindow; - - pWin->valdata = (ValidatePtr)NULL; - pWin->optional = (WindowOptPtr)NULL; - pWin->cursorIsNone = TRUE; - - pWin->backingStore = NotUseful; - pWin->DIXsaveUnder = FALSE; - pWin->backStorage = (pointer) NULL; - - pWin->mapped = FALSE; /* off */ - pWin->realized = FALSE; /* off */ - pWin->viewable = FALSE; - pWin->visibility = VisibilityNotViewable; - pWin->overrideRedirect = FALSE; - pWin->saveUnder = FALSE; - - pWin->bitGravity = ForgetGravity; - pWin->winGravity = NorthWestGravity; - - pWin->eventMask = 0; - pWin->deliverableEvents = 0; - pWin->dontPropagate = 0; - pWin->forcedBS = FALSE; -#ifdef NEED_DBE_BUF_BITS - pWin->srcBuffer = DBE_FRONT_BUFFER; - pWin->dstBuffer = DBE_FRONT_BUFFER; -#endif -#ifdef COMPOSITE - pWin->redirectDraw = 0; -#endif -} - -#ifdef NXAGENT_SERVER - -void nxagentClearSplash(WindowPtr pW) -{ - int w, h; - ScreenPtr pScreen; - - w = pW->drawable.width; - h = pW->drawable.height; - - pScreen = pW->drawable.pScreen; - - if (pW->backgroundState == BackgroundPixmap) - { - (*pScreen->DestroyPixmap)(pW->background.pixmap); - } - - pW->backgroundState = BackgroundPixel; - pW->background.pixel = nxagentLogoBlack; - - (*pScreen->ChangeWindowAttributes)(pW, CWBackPixmap|CWBackPixel); -} - -#endif /* NXAGENT_SERVER */ - -static void -MakeRootTile(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - GCPtr pGC; - unsigned char back[128]; - int len = BitmapBytePad(sizeof(long)); - register unsigned char *from, *to; - register int i, j; - - pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4, - pScreen->rootDepth); - - pWin->backgroundState = BackgroundPixmap; - pGC = GetScratchGC(pScreen->rootDepth, pScreen); - if (!pWin->background.pixmap || !pGC) - FatalError("could not create root tile"); - - { - CARD32 attributes[2]; - - attributes[0] = pScreen->whitePixel; - attributes[1] = pScreen->blackPixel; - - (void)ChangeGC(pGC, GCForeground | GCBackground, attributes); - } - - ValidateGC((DrawablePtr)pWin->background.pixmap, pGC); - - from = (screenInfo.bitmapBitOrder == LSBFirst) ? _back_lsb : _back_msb; - to = back; - - for (i = 4; i > 0; i--, from++) - for (j = len; j > 0; j--) - *to++ = *from; - - if (blackRoot) - bzero(back, sizeof(back)); - - (*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, pGC, 1, - 0, 0, len, 4, 0, XYBitmap, (char *)back); - - FreeScratchGC(pGC); - -#ifdef NXAGENT_SERVER - nxagentRootTileWindow = pWin; -#endif /* NXAGENT_SERVER */ -} - -WindowPtr -AllocateWindow(ScreenPtr pScreen) -{ - WindowPtr pWin; - register char *ptr; - register DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; - - pWin = (WindowPtr)xalloc(pScreen->totalWindowSize); - if (pWin) - { - ppriv = (DevUnion *)(pWin + 1); - pWin->devPrivates = ppriv; - sizes = pScreen->WindowPrivateSizes; - ptr = (char *)(ppriv + pScreen->WindowPrivateLen); - for (i = pScreen->WindowPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - } - return pWin; -} - -/***** - * CreateRootWindow - * Makes a window at initialization time for specified screen - *****/ - -Bool -CreateRootWindow(ScreenPtr pScreen) -{ - WindowPtr pWin; - BoxRec box; - PixmapFormatRec *format; - - pWin = AllocateWindow(pScreen); - if (!pWin) - return FALSE; - - savedScreenInfo[pScreen->myNum].pWindow = NULL; - savedScreenInfo[pScreen->myNum].wid = FakeClientID(0); - savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL; - screenIsSaved = SCREEN_SAVER_OFF; - - WindowTable[pScreen->myNum] = pWin; - - pWin->drawable.pScreen = pScreen; - pWin->drawable.type = DRAWABLE_WINDOW; - - pWin->drawable.depth = pScreen->rootDepth; - for (format = screenInfo.formats; - format->depth != pScreen->rootDepth; - format++) - ; - pWin->drawable.bitsPerPixel = format->bitsPerPixel; - - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - pWin->parent = NullWindow; - SetWindowToDefaults(pWin); - - pWin->optional = (WindowOptRec *) xalloc (sizeof (WindowOptRec)); - if (!pWin->optional) - return FALSE; - - pWin->optional->dontPropagateMask = 0; - pWin->optional->otherEventMasks = 0; - pWin->optional->otherClients = NULL; - pWin->optional->passiveGrabs = NULL; - pWin->optional->userProps = NULL; - pWin->optional->backingBitPlanes = ~0L; - pWin->optional->backingPixel = 0; -#ifdef SHAPE - pWin->optional->boundingShape = NULL; - pWin->optional->clipShape = NULL; - pWin->optional->inputShape = NULL; -#endif -#ifdef XINPUT - pWin->optional->inputMasks = NULL; -#endif - pWin->optional->colormap = pScreen->defColormap; - pWin->optional->visual = pScreen->rootVisual; - - pWin->nextSib = NullWindow; - - pWin->drawable.id = FakeClientID(0); - - pWin->origin.x = pWin->origin.y = 0; - pWin->drawable.height = pScreen->height; - pWin->drawable.width = pScreen->width; - pWin->drawable.x = pWin->drawable.y = 0; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - REGION_INIT(pScreen, &pWin->winSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderClip, &box, 1); - - pWin->drawable.class = InputOutput; - pWin->optional->visual = pScreen->rootVisual; - - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = pScreen->whitePixel; - - pWin->borderIsPixel = TRUE; - pWin->border.pixel = pScreen->blackPixel; - pWin->borderWidth = 0; - - if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin)) - return FALSE; - - if (disableBackingStore) - { - pScreen -> backingStoreSupport = NotUseful; - } - - if (enableBackingStore) - { - pScreen -> backingStoreSupport = Always; - } - - pScreen->saveUnderSupport = False; - -#ifdef DO_SAVE_UNDERS - if ((pScreen->backingStoreSupport != NotUseful) && - (pScreen->saveUnderSupport == NotUseful)) - { - /* - * If the screen has backing-store but no save-unders, let the - * clients know we can support save-unders using backing-store. - */ - pScreen->saveUnderSupport = USE_DIX_SAVE_UNDERS; - } -#endif /* DO_SAVE_UNDERS */ - - if (disableSaveUnders) - pScreen->saveUnderSupport = NotUseful; - - return TRUE; -} - -#ifdef NXAGENT_SERVER - -void -InitRootWindow(WindowPtr pWin) -{ - ScreenPtr pScreen; - - #ifdef TEST - fprintf(stderr, "InitRootWindow: Called for window at [%p][%ld] with parent [%p].\n", - (void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); - #endif - - if (nxagentOption(Rootless)) - { - #ifdef TEST - fprintf(stderr, "InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].\n", - (void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); - #endif - - nxagentRootlessWindow = pWin; - } - - pScreen = pWin->drawable.pScreen; - - /* - * A root window is created for each screen by main - * and the pointer is saved in WindowTable as in the - * following snippet: - * - * for (i = 0; i < screenInfo.numScreens; i++) - * InitRootWindow(WindowTable[i]); - * - * Our root window on the real display was already - * created at the time the screen was opened, so it - * is unclear how this window (or the other window, - * if you prefer) fits in the big picture. - */ - - #ifdef TEST - fprintf(stderr, "InitRootWindow: Going to create window as root at [%p][%ld] with parent [%p].\n", - (void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); - #endif - - if (!(*pScreen->CreateWindow)(pWin)) - return; /* XXX */ - - #ifdef TEST - fprintf(stderr, "InitRootWindow: Created window as root at [%p][%ld] with parent [%p].\n", - (void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); - #endif - - (*pScreen->PositionWindow)(pWin, 0, 0); - - pWin->cursorIsNone = FALSE; - pWin->optional->cursor = rootCursor; - rootCursor->refcnt++; - pWin->backingStore = defaultBackingStore; - pWin->forcedBS = (defaultBackingStore != NotUseful); - - #ifdef NXAGENT_SPLASH - /* We SHOULD check for an error value here XXX */ - pWin -> background.pixel = pScreen -> blackPixel; - (*pScreen->ChangeWindowAttributes)(pWin, - CWBackPixel|CWBorderPixel|CWCursor|CWBackingStore); - #else - (*pScreen->ChangeWindowAttributes)(pWin, - CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore); - #endif - - MakeRootTile(pWin); - - /* - * Map both the root and the default agent window. - */ - - #ifdef TEST - fprintf(stderr, "InitRootWindow: Mapping default windows.\n"); - #endif - - nxagentInitAtoms(pWin); - - nxagentInitClipboard(pWin); - - nxagentMapDefaultWindows(); - - nxagentRedirectDefaultWindows(); - - #ifdef NXAGENT_ARTSD - { - char artsd_port[10]; - int nPort; - extern void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port); - nPort = atoi(display) + 7000; - sprintf(artsd_port,"%d", nPort); - nxagentPropagateArtsdProperties(pScreen, artsd_port); - } - #endif -} - -#else /* NXAGENT_SERVER */ - -void -InitRootWindow(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - if (!(*pScreen->CreateWindow)(pWin)) - return; /* XXX */ - (*pScreen->PositionWindow)(pWin, 0, 0); - - pWin->cursorIsNone = FALSE; - pWin->optional->cursor = rootCursor; - rootCursor->refcnt++; - MakeRootTile(pWin); - pWin->backingStore = defaultBackingStore; - pWin->forcedBS = (defaultBackingStore != NotUseful); - /* We SHOULD check for an error value here XXX */ - (*pScreen->ChangeWindowAttributes)(pWin, - CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore); - - MapWindow(pWin, serverClient); -} - -#endif /* NXAGENT_SERVER */ - -/* Set the region to the intersection of the rectangle and the - * window's winSize. The window is typically the parent of the - * window from which the region came. - */ - -void -ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn, - register int x, register int y, - register int w, register int h) -{ -#ifndef NXAGENT_SERVER - ScreenPtr pScreen = pWin->drawable.pScreen; -#endif /* NXAGENT_SERVER */ - BoxRec box; - - box = *(REGION_EXTENTS(pScreen, &pWin->winSize)); - /* we do these calculations to avoid overflows */ - if (x > box.x1) - box.x1 = x; - if (y > box.y1) - box.y1 = y; - x += w; - if (x < box.x2) - box.x2 = x; - y += h; - if (y < box.y2) - box.y2 = y; - if (box.x1 > box.x2) - box.x2 = box.x1; - if (box.y1 > box.y2) - box.y2 = box.y1; - REGION_RESET(pScreen, Rgn, &box); - REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize); -} - -WindowPtr -RealChildHead(register WindowPtr pWin) -{ - if (!pWin->parent && - (screenIsSaved == SCREEN_SAVER_ON) && - (HasSaverWindow (pWin->drawable.pScreen->myNum))) - return (pWin->firstChild); - else - return (NullWindow); -} - -/***** - * CreateWindow - * Makes a window in response to client request - *****/ - -WindowPtr -CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w, - unsigned h, unsigned bw, unsigned class, register Mask vmask, XID *vlist, - int depth, ClientPtr client, VisualID visual, int *error) -{ - register WindowPtr pWin; - WindowPtr pHead; - register ScreenPtr pScreen; - xEvent event; - int idepth, ivisual; - Bool fOK; - DepthPtr pDepth; - PixmapFormatRec *format; - register WindowOptPtr ancwopt; - - if (class == CopyFromParent) - class = pParent->drawable.class; - - if ((class != InputOutput) && (class != InputOnly)) - { - *error = BadValue; - client->errorValue = class; - return NullWindow; - } - - if ((class != InputOnly) && (pParent->drawable.class == InputOnly)) - { - *error = BadMatch; - return NullWindow; - } - - if ((class == InputOnly) && ((bw != 0) || (depth != 0))) - { - *error = BadMatch; - return NullWindow; - } - - pScreen = pParent->drawable.pScreen; - if ((class == InputOutput) && (depth == 0)) - depth = pParent->drawable.depth; - ancwopt = pParent->optional; - if (!ancwopt) - ancwopt = FindWindowWithOptional(pParent)->optional; - if (visual == CopyFromParent) { -#ifdef XAPPGROUP - VisualID ag_visual; - - if (client->appgroup && !pParent->parent && - (ag_visual = XagRootVisual (client))) - visual = ag_visual; - else -#endif - visual = ancwopt->visual; - } - - /* Find out if the depth and visual are acceptable for this Screen */ - if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) - { - fOK = FALSE; - for(idepth = 0; idepth < pScreen->numDepths; idepth++) - { - pDepth = (DepthPtr) &pScreen->allowedDepths[idepth]; - if ((depth == pDepth->depth) || (depth == 0)) - { - for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) - { - if (visual == pDepth->vids[ivisual]) - { - fOK = TRUE; - break; - } - } - } - } - if (fOK == FALSE) - { - *error = BadMatch; - return NullWindow; - } - } - - if (((vmask & (CWBorderPixmap | CWBorderPixel)) == 0) && - (class != InputOnly) && - (depth != pParent->drawable.depth)) - { - *error = BadMatch; - return NullWindow; - } - - if (((vmask & CWColormap) == 0) && - (class != InputOnly) && - ((visual != ancwopt->visual) || (ancwopt->colormap == None))) - { - *error = BadMatch; - return NullWindow; - } - - pWin = AllocateWindow(pScreen); - if (!pWin) - { - *error = BadAlloc; - return NullWindow; - } - pWin->drawable = pParent->drawable; - pWin->drawable.depth = depth; - if (depth == pParent->drawable.depth) - pWin->drawable.bitsPerPixel = pParent->drawable.bitsPerPixel; - else - { - for (format = screenInfo.formats; format->depth != depth; format++) - ; - pWin->drawable.bitsPerPixel = format->bitsPerPixel; - } - if (class == InputOnly) - pWin->drawable.type = (short) UNDRAWABLE_WINDOW; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - pWin->drawable.id = wid; - pWin->drawable.class = class; - - pWin->parent = pParent; - SetWindowToDefaults(pWin); - - if (visual != ancwopt->visual) - { - if (!MakeWindowOptional (pWin)) - { - xfree (pWin); - *error = BadAlloc; - return NullWindow; - } - pWin->optional->visual = visual; - pWin->optional->colormap = None; - } - - pWin->borderWidth = bw; -#ifdef XCSECURITY - /* can't let untrusted clients have background None windows; - * they make it too easy to steal window contents - */ - if (client->trustLevel != XSecurityClientTrusted) - { - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = 0; - } - else -#endif - pWin->backgroundState = None; - - pWin->borderIsPixel = pParent->borderIsPixel; - pWin->border = pParent->border; - if (pWin->borderIsPixel == FALSE) - pWin->border.pixmap->refcnt++; - - pWin->origin.x = x + (int)bw; - pWin->origin.y = y + (int)bw; - pWin->drawable.width = w; - pWin->drawable.height = h; - pWin->drawable.x = pParent->drawable.x + x + (int)bw; - pWin->drawable.y = pParent->drawable.y + y + (int)bw; - - /* set up clip list correctly for unobscured WindowPtr */ - REGION_NULL(pScreen, &pWin->clipList); - REGION_NULL(pScreen, &pWin->borderClip); - REGION_NULL(pScreen, &pWin->winSize); - REGION_NULL(pScreen, &pWin->borderSize); - - pHead = RealChildHead(pParent); - if (pHead) - { - pWin->nextSib = pHead->nextSib; - if (pHead->nextSib) - pHead->nextSib->prevSib = pWin; - else - pParent->lastChild = pWin; - pHead->nextSib = pWin; - pWin->prevSib = pHead; - } - else - { - pWin->nextSib = pParent->firstChild; - if (pParent->firstChild) - pParent->firstChild->prevSib = pWin; - else - pParent->lastChild = pWin; - pParent->firstChild = pWin; - } - - SetWinSize (pWin); - SetBorderSize (pWin); - - /* We SHOULD check for an error value here XXX */ - if (!(*pScreen->CreateWindow)(pWin)) - { - *error = BadAlloc; - DeleteWindow(pWin, None); - return NullWindow; - } - /* We SHOULD check for an error value here XXX */ - (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y); - - if (!(vmask & CWEventMask)) - RecalculateDeliverableEvents(pWin); - - if (vmask) - *error = ChangeWindowAttributes(pWin, vmask, vlist, wClient (pWin)); - else - *error = Success; - - if (*error != Success) - { - DeleteWindow(pWin, None); - return NullWindow; - } - if (!(vmask & CWBackingStore) && (defaultBackingStore != NotUseful)) - { - XID value = defaultBackingStore; - (void)ChangeWindowAttributes(pWin, CWBackingStore, &value, wClient (pWin)); - pWin->forcedBS = TRUE; - } - - if (SubSend(pParent)) - { - event.u.u.type = CreateNotify; - event.u.createNotify.window = wid; - event.u.createNotify.parent = pParent->drawable.id; - event.u.createNotify.x = x; - event.u.createNotify.y = y; - event.u.createNotify.width = w; - event.u.createNotify.height = h; - event.u.createNotify.borderWidth = bw; - event.u.createNotify.override = pWin->overrideRedirect; - DeliverEvents(pParent, &event, 1, NullWindow); - } - return pWin; -} - -static void -FreeWindowResources(register WindowPtr pWin) -{ - register ScreenPtr pScreen = pWin->drawable.pScreen; - - DeleteWindowFromAnySaveSet(pWin); - DeleteWindowFromAnySelections(pWin); - DeleteWindowFromAnyEvents(pWin, TRUE); - REGION_UNINIT(pScreen, &pWin->clipList); - REGION_UNINIT(pScreen, &pWin->winSize); - REGION_UNINIT(pScreen, &pWin->borderClip); - REGION_UNINIT(pScreen, &pWin->borderSize); -#ifdef SHAPE - if (wBoundingShape (pWin)) - REGION_DESTROY(pScreen, wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_DESTROY(pScreen, wClipShape (pWin)); - if (wInputShape (pWin)) - REGION_DESTROY(pScreen, wInputShape (pWin)); -#endif - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - - DeleteAllWindowProperties(pWin); - /* We SHOULD check for an error value here XXX */ - (*pScreen->DestroyWindow)(pWin); - DisposeWindowOptional (pWin); -} - -static void -CrushTree(WindowPtr pWin) -{ - register WindowPtr pChild, pSib, pParent; - UnrealizeWindowProcPtr UnrealizeWindow; - xEvent event; - - if (!(pChild = pWin->firstChild)) - return; - UnrealizeWindow = pWin->drawable.pScreen->UnrealizeWindow; - while (1) - { - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (1) - { - pParent = pChild->parent; - if (SubStrSend(pChild, pParent)) - { - event.u.u.type = DestroyNotify; - event.u.destroyNotify.window = pChild->drawable.id; - DeliverEvents(pChild, &event, 1, NullWindow); - } - FreeResource(pChild->drawable.id, RT_WINDOW); - pSib = pChild->nextSib; -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder && pChild->viewable) - deltaSaveUndersViewable--; -#endif - pChild->viewable = FALSE; - if (pChild->realized) - { - pChild->realized = FALSE; - (*UnrealizeWindow)(pChild); - } - FreeWindowResources(pChild); - xfree(pChild); - if ( (pChild = pSib) ) - break; - pChild = pParent; - pChild->firstChild = NullWindow; - pChild->lastChild = NullWindow; - if (pChild == pWin) - return; - } - } -} - -/***** - * DeleteWindow - * Deletes child of window then window itself - * If wid is None, don't send any events - *****/ - -int -DeleteWindow(pointer value, XID wid) - { - register WindowPtr pParent; - register WindowPtr pWin = (WindowPtr)value; - xEvent event; - - UnmapWindow(pWin, FALSE); - - CrushTree(pWin); - - pParent = pWin->parent; - if (wid && pParent && SubStrSend(pWin, pParent)) - { - event.u.u.type = DestroyNotify; - event.u.destroyNotify.window = pWin->drawable.id; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - FreeWindowResources(pWin); - if (pParent) - { - if (pParent->firstChild == pWin) - pParent->firstChild = pWin->nextSib; - if (pParent->lastChild == pWin) - pParent->lastChild = pWin->prevSib; - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - } - - if (pWin -> optional && - pWin -> optional -> colormap && - pWin -> parent) - { - nxagentSetInstalledColormapWindows(pWin -> drawable.pScreen); - } - - xfree(pWin); - return Success; -} - -void -DestroySubwindows(register WindowPtr pWin, ClientPtr client) -{ - /* XXX - * The protocol is quite clear that each window should be - * destroyed in turn, however, unmapping all of the first - * eliminates most of the calls to ValidateTree. So, - * this implementation is incorrect in that all of the - * UnmapNotifies occur before all of the DestroyNotifies. - * If you care, simply delete the call to UnmapSubwindows. - */ - UnmapSubwindows(pWin); - while (pWin->lastChild) - FreeResource(pWin->lastChild->drawable.id, RT_NONE); -} - -#define DeviceEventMasks (KeyPressMask | KeyReleaseMask | ButtonPressMask | \ - ButtonReleaseMask | PointerMotionMask) - -/***** - * ChangeWindowAttributes - * - * The value-mask specifies which attributes are to be changed; the - * value-list contains one value for each one bit in the mask, from least - * to most significant bit in the mask. - *****/ - -int -ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) -{ - register Mask index2; - register XID *pVlist; - PixmapPtr pPixmap; - Pixmap pixID; - CursorPtr pCursor, pOldCursor; - Cursor cursorID; - WindowPtr pChild; - Colormap cmap; - ColormapPtr pCmap; - xEvent xE; - int result; - register ScreenPtr pScreen; - Mask vmaskCopy = 0; - register Mask tmask; - unsigned int val; - int error; - Bool checkOptional = FALSE; - Bool borderRelative = FALSE; - WindowPtr pLayerWin; - - if ((pWin->drawable.class == InputOnly) && (vmask & (~INPUTONLY_LEGAL_MASK))) - return BadMatch; - - error = Success; - pScreen = pWin->drawable.pScreen; - pVlist = vlist; - tmask = vmask; - while (tmask) - { - index2 = (Mask) lowbit (tmask); - tmask &= ~index2; - switch (index2) - { - case CWBackPixmap: - pixID = (Pixmap )*pVlist; - pVlist++; - if (pWin->backgroundState == ParentRelative) - borderRelative = TRUE; - if (pixID == None) - { -#ifdef XCSECURITY - /* can't let untrusted clients have background None windows */ - if (client->trustLevel == XSecurityClientTrusted) - { -#endif - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - if (!pWin->parent) - MakeRootTile(pWin); - else - pWin->backgroundState = None; -#ifdef XCSECURITY - } - else - { /* didn't change the background to None, so don't tell ddx */ - index2 = 0; - } -#endif - } - else if (pixID == ParentRelative) - { - if (pWin->parent && - pWin->drawable.depth != pWin->parent->drawable.depth) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - if (!pWin->parent) - MakeRootTile(pWin); - else - pWin->backgroundState = ParentRelative; - borderRelative = TRUE; - /* Note that the parent's backgroundTile's refcnt is NOT - * incremented. */ - } - else - { - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); - if (pPixmap != (PixmapPtr) NULL) - { - if ((pPixmap->drawable.depth != pWin->drawable.depth) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - pWin->backgroundState = BackgroundPixmap; - pWin->background.pixmap = pPixmap; - pPixmap->refcnt++; - } - else - { - error = BadPixmap; - client->errorValue = pixID; - goto PatchUp; - } - } - break; - case CWBackPixel: - if (pWin->backgroundState == ParentRelative) - borderRelative = TRUE; - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = (CARD32 ) *pVlist; - /* background pixel overrides background pixmap, - so don't let the ddx layer see both bits */ - vmaskCopy &= ~CWBackPixmap; - pVlist++; - break; - case CWBorderPixmap: - pixID = (Pixmap ) *pVlist; - pVlist++; - if (pixID == CopyFromParent) - { - if (!pWin->parent || - (pWin->drawable.depth != pWin->parent->drawable.depth)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->border = pWin->parent->border; - if ((pWin->borderIsPixel = pWin->parent->borderIsPixel) == TRUE) - { - index2 = CWBorderPixel; - } - else - { - pWin->parent->border.pixmap->refcnt++; - } - } - else - { - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); - if (pPixmap) - { - if ((pPixmap->drawable.depth != pWin->drawable.depth) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->borderIsPixel = FALSE; - pWin->border.pixmap = pPixmap; - pPixmap->refcnt++; - } - else - { - error = BadPixmap; - client->errorValue = pixID; - goto PatchUp; - } - } - break; - case CWBorderPixel: - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->borderIsPixel = TRUE; - pWin->border.pixel = (CARD32) *pVlist; - /* border pixel overrides border pixmap, - so don't let the ddx layer see both bits */ - vmaskCopy &= ~CWBorderPixmap; - pVlist++; - break; - case CWBitGravity: - val = (CARD8 )*pVlist; - pVlist++; - if (val > StaticGravity) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->bitGravity = val; - break; - case CWWinGravity: - val = (CARD8 )*pVlist; - pVlist++; - if (val > StaticGravity) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->winGravity = val; - break; - case CWBackingStore: - val = (CARD8 )*pVlist; - pVlist++; - if ((val != NotUseful) && (val != WhenMapped) && (val != Always)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->backingStore = val; - - #ifdef TEST - fprintf(stderr, "ChangeWindowAttributes: Changed backing store value to %d for window at %p.\n", - val, (void*)pWin); - #endif - - pWin->forcedBS = FALSE; - break; - case CWBackingPlanes: - if (pWin->optional || ((CARD32)*pVlist != (CARD32)~0L)) { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - pWin->optional->backingBitPlanes = (CARD32) *pVlist; - if ((CARD32)*pVlist == (CARD32)~0L) - checkOptional = TRUE; - } - pVlist++; - break; - case CWBackingPixel: - if (pWin->optional || (CARD32) *pVlist) { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - pWin->optional->backingPixel = (CARD32) *pVlist; - if (!*pVlist) - checkOptional = TRUE; - } - pVlist++; - break; - case CWSaveUnder: - val = (BOOL) *pVlist; - pVlist++; - if ((val != xTrue) && (val != xFalse)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } -#ifdef DO_SAVE_UNDERS - if (pWin->parent && (pWin->saveUnder != val) && (pWin->viewable) && - DO_SAVE_UNDERS(pWin)) - { - /* - * Re-check all siblings and inferiors for obscurity or - * exposition (hee hee). - */ - if (pWin->saveUnder) - deltaSaveUndersViewable--; - else - deltaSaveUndersViewable++; - pWin->saveUnder = val; - - if (pWin->firstChild) - { - pLayerWin = (*pScreen->GetLayerWindow)(pWin); - if ((*pScreen->ChangeSaveUnder)(pLayerWin->parent, pWin->nextSib)) - (*pScreen->PostChangeSaveUnder)(pLayerWin->parent, - pWin->nextSib); - } - else - { - if ((*pScreen->ChangeSaveUnder)(pWin, pWin->nextSib)) - (*pScreen->PostChangeSaveUnder)(pWin, - pWin->nextSib); - } - } - else - { - /* If we're changing the saveUnder attribute of the root - * window, all we do is set pWin->saveUnder so that - * GetWindowAttributes returns the right value. We don't - * do the "normal" save-under processing (as above). - * Hope that doesn't cause any problems. - */ - pWin->saveUnder = val; - } -#else - pWin->saveUnder = val; -#endif /* DO_SAVE_UNDERS */ - break; - case CWEventMask: - /* - * TODO: Some applications like java bean shell - * don' t work if they cannot monitor the root - * window for Structure Redirect events. However - * this doesn't seem to be the best solution, since - * also an X server with a window manager running, - * doesn't allow to monitor for those events, but - * the java bean shell works flawlessy on this - * server. - * - * if (nxagentCheckIllegalRootMonitoring(pWin, (Mask)*pVlist)) - * { - * return BadAccess; - * } - */ - - result = EventSelectForWindow(pWin, client, (Mask )*pVlist); - if (result) - { - error = result; - goto PatchUp; - } - pVlist++; - break; - case CWDontPropagate: - result = EventSuppressForWindow(pWin, client, (Mask )*pVlist, - &checkOptional); - if (result) - { - error = result; - goto PatchUp; - } - pVlist++; - break; - case CWOverrideRedirect: - val = (BOOL ) *pVlist; - pVlist++; - if ((val != xTrue) && (val != xFalse)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->overrideRedirect = val; - break; - case CWColormap: - cmap = (Colormap) *pVlist; - pVlist++; - if (cmap == CopyFromParent) - { -#ifdef XAPPGROUP - Colormap ag_colormap; - ClientPtr win_owner; - - /* - * win_owner == client for CreateWindow, other clients - * can ChangeWindowAttributes - */ - win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - - if ( win_owner && win_owner->appgroup && - !pWin->parent->parent && - (ag_colormap = XagDefaultColormap (win_owner))) - cmap = ag_colormap; - else -#endif - if (pWin->parent && - (!pWin->optional || - pWin->optional->visual == wVisual (pWin->parent))) - { - cmap = wColormap (pWin->parent); - } - else - cmap = None; - } - if (cmap == None) - { - error = BadMatch; - goto PatchUp; - } - pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap, - RT_COLORMAP, SecurityReadAccess); - if (!pCmap) - { - error = BadColor; - client->errorValue = cmap; - goto PatchUp; - } - if (pCmap->pVisual->vid != wVisual (pWin) || - pCmap->pScreen != pScreen) - { - error = BadMatch; - goto PatchUp; - } - if (cmap != wColormap (pWin)) - { - if (!pWin->optional) - { - if (!MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - } - else if (pWin->parent && cmap == wColormap (pWin->parent)) - checkOptional = TRUE; - - /* - * propagate the original colormap to any children - * inheriting it - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (!pChild->optional && !MakeWindowOptional (pChild)) - { - error = BadAlloc; - goto PatchUp; - } - } - - pWin->optional->colormap = cmap; - - /* - * check on any children now matching the new colormap - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (pChild->optional->colormap == cmap) - CheckWindowOptionalNeed (pChild); - } - - xE.u.u.type = ColormapNotify; - xE.u.colormap.window = pWin->drawable.id; - xE.u.colormap.colormap = cmap; - xE.u.colormap.new = xTrue; - xE.u.colormap.state = IsMapInstalled(cmap, pWin); - DeliverEvents(pWin, &xE, 1, NullWindow); - } - break; - case CWCursor: - cursorID = (Cursor ) *pVlist; - pVlist++; - /* - * install the new - */ - if ( cursorID == None) - { - if (pWin == WindowTable[pWin->drawable.pScreen->myNum]) - pCursor = rootCursor; - else - pCursor = (CursorPtr) None; - } - else - { - pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID, - RT_CURSOR, SecurityReadAccess); - if (!pCursor) - { - error = BadCursor; - client->errorValue = cursorID; - goto PatchUp; - } - } - - if (pCursor != wCursor (pWin)) - { - /* - * patch up child windows so they don't lose cursors. - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (!pChild->optional && !pChild->cursorIsNone && - !MakeWindowOptional (pChild)) - { - error = BadAlloc; - goto PatchUp; - } - } - - pOldCursor = 0; - if (pCursor == (CursorPtr) None) - { - pWin->cursorIsNone = TRUE; - if (pWin->optional) - { - pOldCursor = pWin->optional->cursor; - pWin->optional->cursor = (CursorPtr) None; - checkOptional = TRUE; - } - } else { - if (!pWin->optional) - { - if (!MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - } - else if (pWin->parent && pCursor == wCursor (pWin->parent)) - checkOptional = TRUE; - pOldCursor = pWin->optional->cursor; - pWin->optional->cursor = pCursor; - pCursor->refcnt++; - pWin->cursorIsNone = FALSE; - /* - * check on any children now matching the new cursor - */ - - for (pChild=pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (pChild->optional && - (pChild->optional->cursor == pCursor)) - CheckWindowOptionalNeed (pChild); - } - } - - if (pWin->realized) - WindowHasNewCursor( pWin); - - /* Can't free cursor until here - old cursor - * is needed in WindowHasNewCursor - */ - if (pOldCursor) - FreeCursor (pOldCursor, (Cursor)0); - } - break; - default: - error = BadValue; - client->errorValue = vmask; - goto PatchUp; - } - vmaskCopy |= index2; - } -PatchUp: - if (checkOptional) - CheckWindowOptionalNeed (pWin); - - /* We SHOULD check for an error value here XXX */ - (*pScreen->ChangeWindowAttributes)(pWin, vmaskCopy); - - /* - If the border contents have changed, redraw the border. - Note that this has to be done AFTER pScreen->ChangeWindowAttributes - for the tile to be rotated, and the correct function selected. - */ - if (((vmaskCopy & (CWBorderPixel | CWBorderPixmap)) || borderRelative) - && pWin->viewable && HasBorder (pWin)) - { - RegionRec exposed; - - REGION_NULL(pScreen, &exposed); - REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize); - (*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER); - REGION_UNINIT(pScreen, &exposed); - } - return error; -} - - -/***** - * GetWindowAttributes - * Notice that this is different than ChangeWindowAttributes - *****/ - -void -GetWindowAttributes(register WindowPtr pWin, ClientPtr client, xGetWindowAttributesReply *wa) -{ - wa->type = X_Reply; - wa->bitGravity = pWin->bitGravity; - wa->winGravity = pWin->winGravity; - if (pWin->forcedBS && pWin->backingStore != Always) - wa->backingStore = NotUseful; - else - wa->backingStore = pWin->backingStore; - wa->length = (sizeof(xGetWindowAttributesReply) - - sizeof(xGenericReply)) >> 2; - wa->sequenceNumber = client->sequence; - wa->backingBitPlanes = wBackingBitPlanes (pWin); - wa->backingPixel = wBackingPixel (pWin); - wa->saveUnder = (BOOL)pWin->saveUnder; - wa->override = pWin->overrideRedirect; - if (!pWin->mapped) - wa->mapState = IsUnmapped; - else if (pWin->realized) - wa->mapState = IsViewable; - else - wa->mapState = IsUnviewable; - - wa->colormap = wColormap (pWin); - wa->mapInstalled = (wa->colormap == None) ? xFalse - : IsMapInstalled(wa->colormap, pWin); - - wa->yourEventMask = EventMaskForClient(pWin, client); - wa->allEventMasks = pWin->eventMask | wOtherEventMasks (pWin); - wa->doNotPropagateMask = wDontPropagateMask (pWin); - wa->class = pWin->drawable.class; - wa->visualID = wVisual (pWin); -} - - -WindowPtr -MoveWindowInStack(register WindowPtr pWin, register WindowPtr pNextSib) -{ - register WindowPtr pParent = pWin->parent; - WindowPtr pFirstChange = pWin; /* highest window where list changes */ - - if (pWin->nextSib != pNextSib) - { - WindowPtr pOldNextSib = pWin->nextSib; - - if (!pNextSib) /* move to bottom */ - { - if (pParent->firstChild == pWin) - pParent->firstChild = pWin->nextSib; - /* if (pWin->nextSib) */ /* is always True: pNextSib == NULL - * and pWin->nextSib != pNextSib - * therefore pWin->nextSib != NULL */ - pFirstChange = pWin->nextSib; - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pParent->lastChild->nextSib = pWin; - pWin->prevSib = pParent->lastChild; - pWin->nextSib = NullWindow; - pParent->lastChild = pWin; - } - else if (pParent->firstChild == pNextSib) /* move to top */ - { - pFirstChange = pWin; - if (pParent->lastChild == pWin) - pParent->lastChild = pWin->prevSib; - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pWin->nextSib = pParent->firstChild; - pWin->prevSib = (WindowPtr ) NULL; - pNextSib->prevSib = pWin; - pParent->firstChild = pWin; - } - else /* move in middle of list */ - { - WindowPtr pOldNext = pWin->nextSib; - - pFirstChange = NullWindow; - if (pParent->firstChild == pWin) - pFirstChange = pParent->firstChild = pWin->nextSib; - if (pParent->lastChild == pWin) { - pFirstChange = pWin; - pParent->lastChild = pWin->prevSib; - } - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pWin->nextSib = pNextSib; - pWin->prevSib = pNextSib->prevSib; - if (pNextSib->prevSib) - pNextSib->prevSib->nextSib = pWin; - pNextSib->prevSib = pWin; - if (!pFirstChange) { /* do we know it yet? */ - pFirstChange = pParent->firstChild; /* no, search from top */ - while ((pFirstChange != pWin) && (pFirstChange != pOldNext)) - pFirstChange = pFirstChange->nextSib; - } - } - if(pWin->drawable.pScreen->RestackWindow) - (*pWin->drawable.pScreen->RestackWindow)(pWin, pOldNextSib); - } - -#ifdef ROOTLESS - /* - * In rootless mode we can't optimize away window restacks. - * There may be non-X windows around, so even if the window - * is in the correct position from X's point of view, - * the underlying window system may want to reorder it. - */ - else if (pWin->drawable.pScreen->RestackWindow) - (*pWin->drawable.pScreen->RestackWindow)(pWin, pWin->nextSib); -#endif - - return( pFirstChange ); -} - -RegionPtr -CreateUnclippedWinSize (register WindowPtr pWin) -{ - RegionPtr pRgn; - BoxRec box; - - box.x1 = pWin->drawable.x; - box.y1 = pWin->drawable.y; - box.x2 = pWin->drawable.x + (int) pWin->drawable.width; - box.y2 = pWin->drawable.y + (int) pWin->drawable.height; - pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); -#ifdef SHAPE - if (wBoundingShape (pWin) || wClipShape (pWin)) { -#ifndef NXAGENT_SERVER - ScreenPtr pScreen = pWin->drawable.pScreen; -#endif /* NXAGENT_SERVER */ - REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x, - - pWin->drawable.y); - if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wClipShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x, pWin->drawable.y); - } -#endif - return pRgn; -} - -void -SetWinSize (register WindowPtr pWin) -{ -#ifdef COMPOSITE - if (pWin->redirectDraw) - { - BoxRec box; - - box.x1 = pWin->drawable.x; - box.y1 = pWin->drawable.y; - box.x2 = pWin->drawable.x + pWin->drawable.width; - box.y2 = pWin->drawable.y + pWin->drawable.height; - REGION_RESET (pScreen, &pWin->winSize, &box); - } - else -#endif - ClippedRegionFromBox(pWin->parent, &pWin->winSize, - pWin->drawable.x, pWin->drawable.y, - (int)pWin->drawable.width, - (int)pWin->drawable.height); -#ifdef SHAPE - if (wBoundingShape (pWin) || wClipShape (pWin)) { -#ifndef NXAGENT_SERVER - ScreenPtr pScreen = pWin->drawable.pScreen; -#endif /* NXAGENT_SERVER */ - REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x, - - pWin->drawable.y); - if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, - wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, - wClipShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->winSize, pWin->drawable.x, - pWin->drawable.y); - } -#endif -} - -void -SetBorderSize (register WindowPtr pWin) -{ - int bw; - - if (HasBorder (pWin)) { - bw = wBorderWidth (pWin); -#ifdef COMPOSITE - if (pWin->redirectDraw) - { - BoxRec box; - - box.x1 = pWin->drawable.x - bw; - box.y1 = pWin->drawable.y - bw; - box.x2 = pWin->drawable.x + pWin->drawable.width + bw; - box.y2 = pWin->drawable.y + pWin->drawable.height + bw; - REGION_RESET (pScreen, &pWin->borderSize, &box); - } - else -#endif - ClippedRegionFromBox(pWin->parent, &pWin->borderSize, - pWin->drawable.x - bw, pWin->drawable.y - bw, - (int)(pWin->drawable.width + (bw<<1)), - (int)(pWin->drawable.height + (bw<<1))); -#ifdef SHAPE - if (wBoundingShape (pWin)) { -#ifndef NXAGENT_SERVER - ScreenPtr pScreen = pWin->drawable.pScreen; -#endif /* NXAGENT_SERVER */ - REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x, - - pWin->drawable.y); - REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize, - wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->borderSize, pWin->drawable.x, - pWin->drawable.y); - REGION_UNION(pScreen, &pWin->borderSize, &pWin->borderSize, - &pWin->winSize); - } -#endif - } else { - REGION_COPY(pWin->drawable.pScreen, &pWin->borderSize, - &pWin->winSize); - } -} - -/** - * - * \param x,y new window position - * \param oldx,oldy old window position - * \param destx,desty position relative to gravity - */ - -void -GravityTranslate (register int x, register int y, int oldx, int oldy, - int dw, int dh, unsigned gravity, - register int *destx, register int *desty) -{ - switch (gravity) { - case NorthGravity: - *destx = x + dw / 2; - *desty = y; - break; - case NorthEastGravity: - *destx = x + dw; - *desty = y; - break; - case WestGravity: - *destx = x; - *desty = y + dh / 2; - break; - case CenterGravity: - *destx = x + dw / 2; - *desty = y + dh / 2; - break; - case EastGravity: - *destx = x + dw; - *desty = y + dh / 2; - break; - case SouthWestGravity: - *destx = x; - *desty = y + dh; - break; - case SouthGravity: - *destx = x + dw / 2; - *desty = y + dh; - break; - case SouthEastGravity: - *destx = x + dw; - *desty = y + dh; - break; - case StaticGravity: - *destx = oldx; - *desty = oldy; - break; - default: - *destx = x; - *desty = y; - break; - } -} - -/* XXX need to retile border on each window with ParentRelative origin */ -void -ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh) -{ - register ScreenPtr pScreen; - register WindowPtr pSib, pChild; - Bool resized = (dw || dh); - - pScreen = pWin->drawable.pScreen; - - for (pSib = pWin->firstChild; pSib; pSib = pSib->nextSib) - { - if (resized && (pSib->winGravity > NorthWestGravity)) - { - int cwsx, cwsy; - - cwsx = pSib->origin.x; - cwsy = pSib->origin.y; - GravityTranslate (cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh, - pSib->winGravity, &cwsx, &cwsy); - if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) - { - xEvent event; - - event.u.u.type = GravityNotify; - event.u.gravity.window = pSib->drawable.id; - event.u.gravity.x = cwsx - wBorderWidth (pSib); - event.u.gravity.y = cwsy - wBorderWidth (pSib); - DeliverEvents (pSib, &event, 1, NullWindow); - pSib->origin.x = cwsx; - pSib->origin.y = cwsy; - } - } - pSib->drawable.x = pWin->drawable.x + pSib->origin.x; - pSib->drawable.y = pWin->drawable.y + pSib->origin.y; - SetWinSize (pSib); - SetBorderSize (pSib); - - /* - * Don't force X to move children. It will position them - * according with gravity. - * - * (*pScreen->PositionWindow)(pSib, pSib->drawable.x, pSib->drawable.y); - */ - - /* - * Update pSib privates, as this window is moved by X. - */ - - nxagentAddConfiguredWindow(pSib, CW_Update); - - if ( (pChild = pSib->firstChild) ) - { - while (1) - { - pChild->drawable.x = pChild->parent->drawable.x + - pChild->origin.x; - pChild->drawable.y = pChild->parent->drawable.y + - pChild->origin.y; - SetWinSize (pChild); - SetBorderSize (pChild); - - (*pScreen->PositionWindow)(pChild, pChild->drawable.x, - pChild->drawable.y); - - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pSib)) - pChild = pChild->parent; - if (pChild == pSib) - break; - pChild = pChild->nextSib; - } - } - } -} - -#define GET_INT16(m, f) \ - if (m & mask) \ - { \ - f = (INT16) *pVlist;\ - pVlist++; \ - } -#define GET_CARD16(m, f) \ - if (m & mask) \ - { \ - f = (CARD16) *pVlist;\ - pVlist++;\ - } - -#define GET_CARD8(m, f) \ - if (m & mask) \ - { \ - f = (CARD8) *pVlist;\ - pVlist++;\ - } - -#define ChangeMask ((Mask)(CWX | CWY | CWWidth | CWHeight)) - -#define IllegalInputOnlyConfigureMask (CWBorderWidth) - -/* - * IsSiblingAboveMe - * returns Above if pSib above pMe in stack or Below otherwise - */ - -static int -IsSiblingAboveMe( - register WindowPtr pMe, - register WindowPtr pSib) -{ - register WindowPtr pWin; - - pWin = pMe->parent->firstChild; - while (pWin) - { - if (pWin == pSib) - return(Above); - else if (pWin == pMe) - return(Below); - pWin = pWin->nextSib; - } - return(Below); -} - -static BoxPtr -WindowExtents( - register WindowPtr pWin, - register BoxPtr pBox) -{ - pBox->x1 = pWin->drawable.x - wBorderWidth (pWin); - pBox->y1 = pWin->drawable.y - wBorderWidth (pWin); - pBox->x2 = pWin->drawable.x + (int)pWin->drawable.width - + wBorderWidth (pWin); - pBox->y2 = pWin->drawable.y + (int)pWin->drawable.height - + wBorderWidth (pWin); - return(pBox); -} - -#ifdef SHAPE -#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL) - -static RegionPtr -MakeBoundingRegion ( - register WindowPtr pWin, - BoxPtr pBox) -{ - RegionPtr pRgn; -#ifndef NXAGENT_SERVER - ScreenPtr pScreen = pWin->drawable.pScreen; -#endif /* NXAGENT_SERVER */ - pRgn = REGION_CREATE(pScreen, pBox, 1); - if (wBoundingShape (pWin)) { - REGION_TRANSLATE(pScreen, pRgn, -pWin->origin.x, - -pWin->origin.y); - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->origin.x, - pWin->origin.y); - } - return pRgn; -} - -static Bool -ShapeOverlap ( - WindowPtr pWin, - BoxPtr pWinBox, - WindowPtr pSib, - BoxPtr pSibBox) -{ - RegionPtr pWinRgn, pSibRgn; - register ScreenPtr pScreen; - Bool ret; - - if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib)) - return TRUE; - pScreen = pWin->drawable.pScreen; - pWinRgn = MakeBoundingRegion (pWin, pWinBox); - pSibRgn = MakeBoundingRegion (pSib, pSibBox); - REGION_INTERSECT(pScreen, pWinRgn, pWinRgn, pSibRgn); - ret = REGION_NOTEMPTY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pSibRgn); - return ret; -} -#endif - -static Bool -AnyWindowOverlapsMe( - WindowPtr pWin, - WindowPtr pHead, - register BoxPtr box) -{ - register WindowPtr pSib; - BoxRec sboxrec; - register BoxPtr sbox; - - for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib) - { - if (pSib->mapped) - { - sbox = WindowExtents(pSib, &sboxrec); - if (BOXES_OVERLAP(sbox, box) -#ifdef SHAPE - && ShapeOverlap (pWin, box, pSib, sbox) -#endif - ) - return(TRUE); - } - } - return(FALSE); -} - -static Bool -IOverlapAnyWindow( - WindowPtr pWin, - register BoxPtr box) -{ - register WindowPtr pSib; - BoxRec sboxrec; - register BoxPtr sbox; - - for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib) - { - if (pSib->mapped) - { - sbox = WindowExtents(pSib, &sboxrec); - if (BOXES_OVERLAP(sbox, box) -#ifdef SHAPE - && ShapeOverlap (pWin, box, pSib, sbox) -#endif - ) - return(TRUE); - } - } - return(FALSE); -} - -/* - * WhereDoIGoInTheStack() - * Given pWin and pSib and the relationshipe smode, return - * the window that pWin should go ABOVE. - * If a pSib is specified: - * Above: pWin is placed just above pSib - * Below: pWin is placed just below pSib - * TopIf: if pSib occludes pWin, then pWin is placed - * at the top of the stack - * BottomIf: if pWin occludes pSib, then pWin is - * placed at the bottom of the stack - * Opposite: if pSib occludes pWin, then pWin is placed at the - * top of the stack, else if pWin occludes pSib, then - * pWin is placed at the bottom of the stack - * - * If pSib is NULL: - * Above: pWin is placed at the top of the stack - * Below: pWin is placed at the bottom of the stack - * TopIf: if any sibling occludes pWin, then pWin is placed at - * the top of the stack - * BottomIf: if pWin occludes any sibline, then pWin is placed at - * the bottom of the stack - * Opposite: if any sibling occludes pWin, then pWin is placed at - * the top of the stack, else if pWin occludes any - * sibling, then pWin is placed at the bottom of the stack - * - */ - -static WindowPtr -WhereDoIGoInTheStack( - register WindowPtr pWin, - register WindowPtr pSib, - short x, - short y, - unsigned short w, - unsigned short h, - int smode) -{ - BoxRec box; - register ScreenPtr pScreen; - WindowPtr pHead, pFirst; - - if ((pWin == pWin->parent->firstChild) && - (pWin == pWin->parent->lastChild)) - return((WindowPtr ) NULL); - pHead = RealChildHead(pWin->parent); - pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild; - pScreen = pWin->drawable.pScreen; - box.x1 = x; - box.y1 = y; - box.x2 = x + (int)w; - box.y2 = y + (int)h; - switch (smode) - { - case Above: - if (pSib) - return(pSib); - else if (pWin == pFirst) - return(pWin->nextSib); - else - return(pFirst); - case Below: - if (pSib) - if (pSib->nextSib != pWin) - return(pSib->nextSib); - else - return(pWin->nextSib); - else - return NullWindow; - case TopIf: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if ((IsSiblingAboveMe(pWin, pSib) == Above) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) - return(pFirst); - else - return(pWin->nextSib); - } - else if (AnyWindowOverlapsMe(pWin, pHead, &box)) - return(pFirst); - else - return(pWin->nextSib); - case BottomIf: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if ((IsSiblingAboveMe(pWin, pSib) == Below) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) - return NullWindow; - else - return(pWin->nextSib); - } - else if (IOverlapAnyWindow(pWin, &box)) - return NullWindow; - else - return(pWin->nextSib); - case Opposite: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT) - { - if (IsSiblingAboveMe(pWin, pSib) == Above) - return(pFirst); - else - return NullWindow; - } - else - return(pWin->nextSib); - } - else if (AnyWindowOverlapsMe(pWin, pHead, &box)) - { - /* If I'm occluded, I can't possibly be the first child - * if (pWin == pWin->parent->firstChild) - * return pWin->nextSib; - */ - return(pFirst); - } - else if (IOverlapAnyWindow(pWin, &box)) - return NullWindow; - else - return pWin->nextSib; - default: - { - ErrorF("Internal error in ConfigureWindow, smode == %d\n",smode ); - return pWin->nextSib; - } - } -} - -static void -ReflectStackChange( - register WindowPtr pWin, - register WindowPtr pSib, - VTKind kind) -{ -/* Note that pSib might be NULL */ - - Bool WasViewable = (Bool)pWin->viewable; - Bool anyMarked; - WindowPtr pFirstChange; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - ScreenPtr pScreen = pWin->drawable.pScreen; - - /* if this is a root window, can't be restacked */ - if (!pWin->parent) - return; - - pFirstChange = MoveWindowInStack(pWin, pSib); - - if (WasViewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, - &pLayerWin); - if (pLayerWin != pWin) pFirstChange = pLayerWin; -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, kind); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pWin->drawable.pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange, kind); - } - if (pWin->realized) - WindowsRestructured (); -} - -/***** - * ConfigureWindow - *****/ - -int -ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientPtr client) -{ -#define RESTACK_WIN 0 -#define MOVE_WIN 1 -#define RESIZE_WIN 2 -#define REBORDER_WIN 3 - register WindowPtr pSib = NullWindow; - register WindowPtr pParent = pWin->parent; - Window sibwid = 0; - Mask index2, tmask; - register XID *pVlist; - short x, y, beforeX, beforeY; - unsigned short w = pWin->drawable.width, - h = pWin->drawable.height, - bw = pWin->borderWidth; - int action, smode = Above; -#ifdef XAPPGROUP - ClientPtr win_owner; - ClientPtr ag_leader = NULL; -#endif - xEvent event; - - if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask)) - return(BadMatch); - - if ((mask & CWSibling) && !(mask & CWStackMode)) - return(BadMatch); - - pVlist = vlist; - - if (pParent) - { - x = pWin->drawable.x - pParent->drawable.x - (int)bw; - y = pWin->drawable.y - pParent->drawable.y - (int)bw; - } - else - { - x = pWin->drawable.x; - y = pWin->drawable.y; - } - beforeX = x; - beforeY = y; - action = RESTACK_WIN; - if ((mask & (CWX | CWY)) && (!(mask & (CWHeight | CWWidth)))) - { - GET_INT16(CWX, x); - GET_INT16(CWY, y); - action = MOVE_WIN; - } - /* or should be resized */ - else if (mask & (CWX | CWY | CWWidth | CWHeight)) - { - GET_INT16(CWX, x); - GET_INT16(CWY, y); - GET_CARD16(CWWidth, w); - GET_CARD16 (CWHeight, h); - if (!w || !h) - { - client->errorValue = 0; - return BadValue; - } - action = RESIZE_WIN; - } - tmask = mask & ~ChangeMask; - while (tmask) - { - index2 = (Mask)lowbit (tmask); - tmask &= ~index2; - switch (index2) - { - case CWBorderWidth: - GET_CARD16(CWBorderWidth, bw); - break; - case CWSibling: - sibwid = (Window ) *pVlist; - pVlist++; - pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid, - RT_WINDOW, SecurityReadAccess); - if (!pSib) - { - client->errorValue = sibwid; - return(BadWindow); - } - if (pSib->parent != pParent) - return(BadMatch); - if (pSib == pWin) - return(BadMatch); - break; - case CWStackMode: - GET_CARD8(CWStackMode, smode); - if ((smode != TopIf) && (smode != BottomIf) && - (smode != Opposite) && (smode != Above) && (smode != Below)) - { - client->errorValue = smode; - return(BadValue); - } - break; - default: - client->errorValue = mask; - return(BadValue); - } - } - /* root really can't be reconfigured, so just return */ - if (!pParent) - return Success; - - /* Figure out if the window should be moved. Doesnt - make the changes to the window if event sent */ - - #ifdef TEST - if (nxagentWindowTopLevel(pWin)) - { - - fprintf(stderr, "ConfigureWindow: pWin [%p] mask [%lu] client [%p]\n", - pWin, mask, client); - - fprintf(stderr, "ConfigureWindow: x [%d] y [%d] w [%d] h [%d] CWStackMode [%d] " - "smode [%d] pSib [%p]\n", - x, y, w, h, (mask & CWStackMode) ? 1 : 0, smode, pSib); - } - #endif - - if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) && - pWin -> overrideRedirect == 0 && - nxagentScreenTrap == 0) - { - nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask); - - return Success; - } - - if (mask & CWStackMode) - pSib = WhereDoIGoInTheStack(pWin, pSib, pParent->drawable.x + x, - pParent->drawable.y + y, - w + (bw << 1), h + (bw << 1), smode); - else - pSib = pWin->nextSib; - -#ifdef XAPPGROUP - win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - ag_leader = XagLeader (win_owner); -#endif - - if ((!pWin->overrideRedirect) && - (RedirectSend(pParent) -#ifdef XAPPGROUP - || (win_owner->appgroup && ag_leader && - XagIsControlledRoot (client, pParent)) -#endif - )) - { - event.u.u.type = ConfigureRequest; - event.u.configureRequest.window = pWin->drawable.id; - if (mask & CWSibling) - event.u.configureRequest.sibling = sibwid; - else - event.u.configureRequest.sibling = None; - if (mask & CWStackMode) - event.u.u.detail = smode; - else - event.u.u.detail = Above; - event.u.configureRequest.x = x; - event.u.configureRequest.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureRequest.x += panoramiXdataPtr[0].x; - event.u.configureRequest.y += panoramiXdataPtr[0].y; - } -#endif - event.u.configureRequest.width = w; - event.u.configureRequest.height = h; - event.u.configureRequest.borderWidth = bw; - event.u.configureRequest.valueMask = mask; -#ifdef XAPPGROUP - /* make sure if the ag_leader maps the window it goes to the wm */ - if (ag_leader && ag_leader != client && - XagIsControlledRoot (client, pParent)) { - event.u.configureRequest.parent = XagId (win_owner); - (void) TryClientEvents (ag_leader, &event, 1, - NoEventMask, NoEventMask, NullGrab); - return Success; - } -#endif - event.u.configureRequest.parent = pParent->drawable.id; - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - if (action == RESIZE_WIN) - { - Bool size_change = (w != pWin->drawable.width) - || (h != pWin->drawable.height); - if (size_change && ((pWin->eventMask|wOtherEventMasks(pWin)) & ResizeRedirectMask)) - { - xEvent eventT; - eventT.u.u.type = ResizeRequest; - eventT.u.resizeRequest.window = pWin->drawable.id; - eventT.u.resizeRequest.width = w; - eventT.u.resizeRequest.height = h; - if (MaybeDeliverEventsToClient(pWin, &eventT, 1, - ResizeRedirectMask, client) == 1) - { - /* if event is delivered, leave the actual size alone. */ - w = pWin->drawable.width; - h = pWin->drawable.height; - size_change = FALSE; - } - } - if (!size_change) - { - if (mask & (CWX | CWY)) - action = MOVE_WIN; - else if (mask & (CWStackMode | CWBorderWidth)) - action = RESTACK_WIN; - else /* really nothing to do */ - return(Success) ; - } - } - - if (action == RESIZE_WIN) - /* we've already checked whether there's really a size change */ - goto ActuallyDoSomething; - if ((mask & CWX) && (x != beforeX)) - goto ActuallyDoSomething; - if ((mask & CWY) && (y != beforeY)) - goto ActuallyDoSomething; - if ((mask & CWBorderWidth) && (bw != wBorderWidth (pWin))) - goto ActuallyDoSomething; - if (mask & CWStackMode) - { -#ifndef ROOTLESS - /* See above for why we always reorder in rootless mode. */ - if (pWin->nextSib != pSib) -#endif - goto ActuallyDoSomething; - } - return(Success); - -ActuallyDoSomething: - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - if (pSib) - event.u.configureNotify.aboveSibling = pSib->drawable.id; - else - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = x; - event.u.configureNotify.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureNotify.x += panoramiXdataPtr[0].x; - event.u.configureNotify.y += panoramiXdataPtr[0].y; - } -#endif - event.u.configureNotify.width = w; - event.u.configureNotify.height = h; - event.u.configureNotify.borderWidth = bw; - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - if (mask & CWBorderWidth) - { - if (action == RESTACK_WIN) - { - action = MOVE_WIN; - pWin->borderWidth = bw; - } - else if ((action == MOVE_WIN) && - (beforeX + wBorderWidth (pWin) == x + (int)bw) && - (beforeY + wBorderWidth (pWin) == y + (int)bw)) - { - action = REBORDER_WIN; - (*pWin->drawable.pScreen->ChangeBorderWidth)(pWin, bw); - } - else - pWin->borderWidth = bw; - } - if (action == MOVE_WIN) - (*pWin->drawable.pScreen->MoveWindow)(pWin, x, y, pSib, - (mask & CWBorderWidth) ? VTOther : VTMove); - else if (action == RESIZE_WIN) - (*pWin->drawable.pScreen->ResizeWindow)(pWin, x, y, w, h, pSib); - else if (mask & CWStackMode) - ReflectStackChange(pWin, pSib, VTOther); - - if (action != RESTACK_WIN) - CheckCursorConfinement(pWin); - - nxagentFlushConfigureWindow(); - - return(Success); -#undef RESTACK_WIN -#undef MOVE_WIN -#undef RESIZE_WIN -#undef REBORDER_WIN -} - - -/****** - * - * CirculateWindow - * For RaiseLowest, raises the lowest mapped child (if any) that is - * obscured by another child to the top of the stack. For LowerHighest, - * lowers the highest mapped child (if any) that is obscuring another - * child to the bottom of the stack. Exposure processing is performed - * - ******/ - -int -CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) -{ - register WindowPtr pWin, pHead, pFirst; - xEvent event; - BoxRec box; - - #ifdef TEST - fprintf(stderr, "CirculateWindow: pParent [%p] direction [%d] client [%p]\n", - pParent, direction, client); - #endif - - /* - * if (nxagentOption(Rootless) && nxagentWMIsRunning && - * nxagentWindowTopLevel(pWin) && pWin -> overrideRedirect == 0) - * { - * nxagentCirculateRootlessWindows(direction); - * return Success; - * } - */ - - pHead = RealChildHead(pParent); - pFirst = pHead ? pHead->nextSib : pParent->firstChild; - if (direction == RaiseLowest) - { - for (pWin = pParent->lastChild; - (pWin != pHead) && - !(pWin->mapped && - AnyWindowOverlapsMe(pWin, pHead, WindowExtents(pWin, &box))); - pWin = pWin->prevSib) ; - if (pWin == pHead) - return Success; - } - else - { - for (pWin = pFirst; - pWin && - !(pWin->mapped && - IOverlapAnyWindow(pWin, WindowExtents(pWin, &box))); - pWin = pWin->nextSib) ; - if (!pWin) - return Success; - } - - event.u.circulate.window = pWin->drawable.id; - event.u.circulate.parent = pParent->drawable.id; - event.u.circulate.event = pParent->drawable.id; - if (direction == RaiseLowest) - event.u.circulate.place = PlaceOnTop; - else - event.u.circulate.place = PlaceOnBottom; - - if (RedirectSend(pParent)) - { - event.u.u.type = CirculateRequest; - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - - event.u.u.type = CirculateNotify; - DeliverEvents(pWin, &event, 1, NullWindow); - ReflectStackChange(pWin, - (direction == RaiseLowest) ? pFirst : NullWindow, - VTStack); - - return(Success); -} - -static int -CompareWIDs( - WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ -{ - Window *wid = (Window *)value; - - if (pWin->drawable.id == *wid) - return(WT_STOPWALKING); - else - return(WT_WALKCHILDREN); -} - -/***** - * ReparentWindow - *****/ - -int -ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, - int x, int y, ClientPtr client) -{ - WindowPtr pPrev, pPriorParent; - Bool WasMapped = (Bool)(pWin->mapped); - xEvent event; - int bw = wBorderWidth (pWin); - register ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; - if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING) - return(BadMatch); - if (!MakeWindowOptional(pWin)) - return(BadAlloc); - - if (WasMapped) - UnmapWindow(pWin, FALSE); - - event.u.u.type = ReparentNotify; - event.u.reparent.window = pWin->drawable.id; - event.u.reparent.parent = pParent->drawable.id; - event.u.reparent.x = x; - event.u.reparent.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pParent->parent) { - event.u.reparent.x += panoramiXdataPtr[0].x; - event.u.reparent.y += panoramiXdataPtr[0].y; - } -#endif - event.u.reparent.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, pParent); - - /* take out of sibling chain */ - - pPriorParent = pPrev = pWin->parent; - if (pPrev->firstChild == pWin) - pPrev->firstChild = pWin->nextSib; - if (pPrev->lastChild == pWin) - pPrev->lastChild = pWin->prevSib; - - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - - /* insert at begining of pParent */ - pWin->parent = pParent; - pPrev = RealChildHead(pParent); - - if (pWin->parent == WindowTable[0]) - { - nxagentSetTopLevelEventMask(pWin); - } - - if (pPrev) - { - pWin->nextSib = pPrev->nextSib; - if (pPrev->nextSib) - pPrev->nextSib->prevSib = pWin; - else - pParent->lastChild = pWin; - pPrev->nextSib = pWin; - pWin->prevSib = pPrev; - } - else - { - pWin->nextSib = pParent->firstChild; - pWin->prevSib = NullWindow; - if (pParent->firstChild) - pParent->firstChild->prevSib = pWin; - else - pParent->lastChild = pWin; - pParent->firstChild = pWin; - } - - pWin->origin.x = x + bw; - pWin->origin.y = y + bw; - pWin->drawable.x = x + bw + pParent->drawable.x; - pWin->drawable.y = y + bw + pParent->drawable.y; - - /* clip to parent */ - SetWinSize (pWin); - SetBorderSize (pWin); - - if (pScreen->ReparentWindow) - (*pScreen->ReparentWindow)(pWin, pPriorParent); - - (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y); - - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - CheckWindowOptionalNeed(pWin); - - if (WasMapped) - MapWindow(pWin, client); - RecalculateDeliverableEvents(pWin); - return(Success); -} - -static void -RealizeTree(WindowPtr pWin) -{ - register WindowPtr pChild; - RealizeWindowProcPtr Realize; - - Realize = pWin->drawable.pScreen->RealizeWindow; - pChild = pWin; - while (1) - { - if (pChild->mapped) - { - pChild->realized = TRUE; -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder) - deltaSaveUndersViewable++; -#endif - pChild->viewable = (pChild->drawable.class == InputOutput); - (* Realize)(pChild); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - return; - pChild = pChild->nextSib; - } -} - -/***** - * MapWindow - * If some other client has selected SubStructureReDirect on the parent - * and override-redirect is xFalse, then a MapRequest event is generated, - * but the window remains unmapped. Otherwise, the window is mapped and a - * MapNotify event is generated. - *****/ - -int -MapWindow(register WindowPtr pWin, ClientPtr client) -{ - register ScreenPtr pScreen; - - register WindowPtr pParent; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - #ifdef TEST - if (nxagentWindowTopLevel(pWin)) - { - fprintf(stderr, "MapWindow: pWin [%p] client [%p]\n", pWin, client); - } - #endif - - if (pWin->mapped) - return(Success); - -#ifdef XCSECURITY - /* don't let an untrusted client map a child-of-trusted-window, InputOnly - * window; too easy to steal device input - */ - if ( (client->trustLevel != XSecurityClientTrusted) && - (pWin->drawable.class == InputOnly) && - (wClient(pWin->parent)->trustLevel == XSecurityClientTrusted) ) - return Success; -#endif - - pScreen = pWin->drawable.pScreen; - if ( (pParent = pWin->parent) ) - { - xEvent event; - Bool anyMarked; -#ifdef XAPPGROUP - ClientPtr win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - ClientPtr ag_leader = XagLeader (win_owner); -#endif - - if ((!pWin->overrideRedirect) && - (RedirectSend(pParent) -#ifdef XAPPGROUP - || (win_owner->appgroup && ag_leader && - XagIsControlledRoot (client, pParent)) -#endif - )) - { - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; -#ifdef XAPPGROUP - /* make sure if the ag_leader maps the window it goes to the wm */ - if (ag_leader && ag_leader != client && - XagIsControlledRoot (client, pParent)) { - event.u.mapRequest.parent = XagId (win_owner); - (void) TryClientEvents (ag_leader, &event, 1, - NoEventMask, NoEventMask, NullGrab); - return Success; - } -#endif - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - - pWin->mapped = TRUE; - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - if (!pParent->realized) - return(Success); - RealizeTree(pWin); - if (pWin->viewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTMap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, VTMap); - } - WindowsRestructured (); - } - else - { - RegionRec temp; - - pWin->mapped = TRUE; - pWin->realized = TRUE; /* for roots */ - pWin->viewable = pWin->drawable.class == InputOutput; - /* We SHOULD check for an error value here XXX */ - (*pScreen->RealizeWindow)(pWin); - if (pScreen->ClipNotify) - (*pScreen->ClipNotify) (pWin, 0, 0); - if (pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(NullWindow, pWin, VTMap); - REGION_NULL(pScreen, &temp); - REGION_COPY(pScreen, &temp, &pWin->clipList); - (*pScreen->WindowExposures) (pWin, &temp, NullRegion); - REGION_UNINIT(pScreen, &temp); - } - - nxagentFlushConfigureWindow(); - - return(Success); -} - - -/***** - * MapSubwindows - * Performs a MapWindow all unmapped children of the window, in top - * to bottom stacking order. - *****/ - -void -MapSubwindows(register WindowPtr pParent, ClientPtr client) -{ - register WindowPtr pWin; - WindowPtr pFirstMapped = NullWindow; -#ifdef DO_SAVE_UNDERS - WindowPtr pFirstSaveUndered = NullWindow; -#endif - register ScreenPtr pScreen; - register Mask parentRedirect; - register Mask parentNotify; - xEvent event; - Bool anyMarked; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - pScreen = pParent->drawable.pScreen; - parentRedirect = RedirectSend(pParent); - parentNotify = SubSend(pParent); - anyMarked = FALSE; - for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) - { - if (!pWin->mapped) - { - if (parentRedirect && !pWin->overrideRedirect) - { - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - continue; - } - - pWin->mapped = TRUE; - if (parentNotify || StrSend(pWin)) - { - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - if (!pFirstMapped) - pFirstMapped = pWin; - if (pParent->realized) - { - RealizeTree(pWin); - if (pWin->viewable) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - (WindowPtr *)NULL); -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = TRUE; - } -#endif /* DO_SAVE_UNDERS */ - } - } - } - } - - if (pFirstMapped) - { - pLayerWin = (*pScreen->GetLayerWindow)(pParent); - if (pLayerWin->parent != pParent) { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pLayerWin, - pLayerWin, - (WindowPtr *)NULL); - pFirstMapped = pLayerWin; - } - if (anyMarked) - { -#ifdef DO_SAVE_UNDERS - if (pLayerWin->parent != pParent) - { - if (dosave || (DO_SAVE_UNDERS(pLayerWin))) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, - pLayerWin); - } - } - else if (dosave) - { - dosave = FALSE; - for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) - { - if (DO_SAVE_UNDERS(pWin)) - { - dosave |= (*pScreen->ChangeSaveUnder)(pWin, - pWin->nextSib); - if (dosave && !pFirstSaveUndered) - pFirstSaveUndered = pWin; - } - } - } -#endif /* DO_SAVE_UNDERS */ - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstMapped, VTMap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, - pFirstSaveUndered->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstMapped, - VTMap); - WindowsRestructured (); - } -} - -static void -UnrealizeTree( - WindowPtr pWin, - Bool fromConfigure) -{ - register WindowPtr pChild; - UnrealizeWindowProcPtr Unrealize; - MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; - - Unrealize = pWin->drawable.pScreen->UnrealizeWindow; - MarkUnrealizedWindow = pWin->drawable.pScreen->MarkUnrealizedWindow; - pChild = pWin; - while (1) - { - if (pChild->realized) - { - pChild->realized = FALSE; - pChild->visibility = VisibilityNotViewable; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) { - PanoramiXRes *win; - win = (PanoramiXRes*)LookupIDByType(pChild->drawable.id, - XRT_WINDOW); - if(win) - win->u.win.visibility = VisibilityNotViewable; - } -#endif - (* Unrealize)(pChild); - DeleteWindowFromAnyEvents(pChild, FALSE); - if (pChild->viewable) - { -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder) - deltaSaveUndersViewable--; -#endif - pChild->viewable = FALSE; - if (pChild->backStorage) - (*pChild->drawable.pScreen->SaveDoomedAreas)( - pChild, &pChild->clipList, 0, 0); - (* MarkUnrealizedWindow)(pChild, pWin, fromConfigure); - pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - return; - pChild = pChild->nextSib; - } -} - -/***** - * UnmapWindow - * If the window is already unmapped, this request has no effect. - * Otherwise, the window is unmapped and an UnMapNotify event is - * generated. Cannot unmap a root window. - *****/ - -int -UnmapWindow(register WindowPtr pWin, Bool fromConfigure) -{ - register WindowPtr pParent; - xEvent event; - Bool wasRealized = (Bool)pWin->realized; - Bool wasViewable = (Bool)pWin->viewable; - ScreenPtr pScreen = pWin->drawable.pScreen; - WindowPtr pLayerWin = pWin; - - #ifdef TEST - if (nxagentWindowTopLevel(pWin)) - { - fprintf(stderr, "UnmapWindow: pWin [%p] fromConfigure [%d]\n", pWin, - fromConfigure); - } - #endif - - if ((!pWin->mapped) || (!(pParent = pWin->parent))) - return(Success); - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pWin->drawable.id; - event.u.unmapNotify.fromConfigure = fromConfigure; - DeliverEvents(pWin, &event, 1, NullWindow); - } - if (wasViewable && !fromConfigure) - { - pWin->valdata = UnmapValData; - (*pScreen->MarkOverlappedWindows)(pWin, pWin->nextSib, &pLayerWin); - (*pScreen->MarkWindow)(pLayerWin->parent); - } - pWin->mapped = FALSE; - if (wasRealized) - UnrealizeTree(pWin, fromConfigure); - if (wasViewable) - { - if (!fromConfigure) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pWin, VTUnmap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib) ) - { - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); - } - } - pWin->DIXsaveUnder = FALSE; -#endif /* DO_SAVE_UNDERS */ - if (!fromConfigure && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pWin, VTUnmap); - } - if (wasRealized && !fromConfigure) - WindowsRestructured (); - return(Success); -} - -/***** - * UnmapSubwindows - * Performs an UnmapWindow request with the specified mode on all mapped - * children of the window, in bottom to top stacking order. - *****/ - -void -UnmapSubwindows(register WindowPtr pWin) -{ - register WindowPtr pChild, pHead; - xEvent event; - Bool wasRealized = (Bool)pWin->realized; - Bool wasViewable = (Bool)pWin->viewable; - Bool anyMarked = FALSE; - Mask parentNotify; - WindowPtr pLayerWin = NULL; - ScreenPtr pScreen = pWin->drawable.pScreen; - - if (!pWin->firstChild) - return; - parentNotify = SubSend(pWin); - pHead = RealChildHead(pWin); - - if (wasViewable) - pLayerWin = (*pScreen->GetLayerWindow)(pWin); - - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - { - if (pChild->mapped) - { - if (parentNotify || StrSend(pChild)) - { - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pChild->drawable.id; - event.u.unmapNotify.fromConfigure = xFalse; - DeliverEvents(pChild, &event, 1, NullWindow); - } - if (pChild->viewable) - { - pChild->valdata = UnmapValData; - anyMarked = TRUE; - } - pChild->mapped = FALSE; - if (pChild->realized) - UnrealizeTree(pChild, FALSE); - if (wasViewable) - { -#ifdef DO_SAVE_UNDERS - pChild->DIXsaveUnder = FALSE; -#endif /* DO_SAVE_UNDERS */ - if (pChild->backStorage) - (*pScreen->SaveDoomedAreas)( - pChild, &pChild->clipList, 0, 0); - } - } - } - if (wasViewable) - { - if (anyMarked) - { - if (pLayerWin->parent == pWin) - (*pScreen->MarkWindow)(pWin); - else - { - WindowPtr ptmp; - (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin, - (WindowPtr *)NULL); - (*pScreen->MarkWindow)(pLayerWin->parent); - - /* Windows between pWin and pLayerWin may not have been marked */ - ptmp = pWin; - - while (ptmp != pLayerWin->parent) - { - (*pScreen->MarkWindow)(ptmp); - ptmp = ptmp->parent; - } - pHead = pWin->firstChild; - } - (*pScreen->ValidateTree)(pLayerWin->parent, pHead, VTUnmap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin)) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pHead, VTUnmap); - } - if (wasRealized) - WindowsRestructured (); -} - - -void -HandleSaveSet(register ClientPtr client) -{ - register WindowPtr pParent, pWin; - register int j; - - for (j=0; jnumSaved; j++) - { - pWin = SaveSetWindow(client->saveSet[j]); -#ifdef XFIXES - if (SaveSetToRoot(client->saveSet[j])) - pParent = WindowTable[pWin->drawable.pScreen->myNum]; - else -#endif - { - pParent = pWin->parent; - while (pParent && (wClient (pParent) == client)) - pParent = pParent->parent; - } - if (pParent) - { - if (pParent != pWin->parent) - { - ReparentWindow(pWin, pParent, - pWin->drawable.x - wBorderWidth (pWin) - pParent->drawable.x, - pWin->drawable.y - wBorderWidth (pWin) - pParent->drawable.y, - client); - if(!pWin->realized && pWin->mapped) - pWin->mapped = FALSE; - } -#ifdef XFIXES - if (SaveSetRemap (client->saveSet[j])) -#endif - MapWindow(pWin, client); - } - } - xfree(client->saveSet); - client->numSaved = 0; - client->saveSet = (SaveSetElt *)NULL; -} - -/** - * - * \param x,y in root - * \param box "return" value - */ -Bool -VisibleBoundingBoxFromPoint(register WindowPtr pWin, int x, int y, BoxPtr box) -{ - if (!pWin->realized) - return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box)) - return(TRUE); - return(FALSE); -} - -/** - * - * \param x,y in root - */ -Bool -PointInWindowIsVisible(register WindowPtr pWin, int x, int y) -{ - BoxRec box; - - if (!pWin->realized) - return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip, - x, y, &box) - && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - wInputShape(pWin), - x - pWin->drawable.x, - y - pWin->drawable.y, &box))) - return(TRUE); - return(FALSE); -} - - -RegionPtr -NotClippedByChildren(register WindowPtr pWin) -{ - register ScreenPtr pScreen; - RegionPtr pReg; - - pScreen = pWin->drawable.pScreen; - pReg = REGION_CREATE(pScreen, NullBox, 1); - if (pWin->parent || - screenIsSaved != SCREEN_SAVER_ON || - !HasSaverWindow (pWin->drawable.pScreen->myNum)) - { - REGION_INTERSECT(pScreen, pReg, &pWin->borderClip, &pWin->winSize); - } - return(pReg); -} - -void -SendVisibilityNotify(WindowPtr pWin) -{ - xEvent event; -#ifndef NO_XINERAMA_PORT - unsigned int visibility = pWin->visibility; -#endif -#ifdef PANORAMIX - /* This is not quite correct yet, but it's close */ - if(!noPanoramiXExtension) { - PanoramiXRes *win; - WindowPtr pWin2; - int i, Scrnum; - - Scrnum = pWin->drawable.pScreen->myNum; - - win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, Scrnum); - - if(!win || (win->u.win.visibility == visibility)) - return; - - switch(visibility) { - case VisibilityUnobscured: - for(i = 0; i < PanoramiXNumScreens; i++) { - if(i == Scrnum) continue; - - pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); - - if (pWin2) { - if(pWin2->visibility == VisibilityPartiallyObscured) - return; - - if(!i) pWin = pWin2; - } - } - break; - case VisibilityPartiallyObscured: - if(Scrnum) { - pWin2 = (WindowPtr)LookupIDByType(win->info[0].id, RT_WINDOW); - if (pWin2) pWin = pWin2; - } - break; - case VisibilityFullyObscured: - for(i = 0; i < PanoramiXNumScreens; i++) { - if(i == Scrnum) continue; - - pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); - - if (pWin2) { - if(pWin2->visibility != VisibilityFullyObscured) - return; - - if(!i) pWin = pWin2; - } - } - break; - } - - win->u.win.visibility = visibility; - } -#endif - - event.u.u.type = VisibilityNotify; - event.u.visibility.window = pWin->drawable.id; - event.u.visibility.state = visibility; - DeliverEvents(pWin, &event, 1, NullWindow); -} - - -#define RANDOM_WIDTH 32 - -#ifndef NOLOGOHACK -static void DrawLogo( - WindowPtr pWin -); -#endif - -void -SaveScreens(int on, int mode) -{ - int i; - int what; - int type; - - if (on == SCREEN_SAVER_FORCER) - { - UpdateCurrentTimeIf(); - lastDeviceEventTime = currentTime; - if (mode == ScreenSaverReset) - what = SCREEN_SAVER_OFF; - else - what = SCREEN_SAVER_ON; - type = what; - } - else - { - what = on; - type = what; - if (what == screenIsSaved) - type = SCREEN_SAVER_CYCLE; - } - for (i = 0; i < screenInfo.numScreens; i++) - { - if (on == SCREEN_SAVER_FORCER) - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], on); - if (savedScreenInfo[i].ExternalScreenSaver) - { - if (nxagentOption(Timeout) != 0) - { - #ifdef TEST - fprintf(stderr, "SaveScreens: An external screen-saver handler is installed. " - "Ignoring it to let the auto-disconnect feature work.\n"); - #endif - } - else - { - if ((*savedScreenInfo[i].ExternalScreenSaver) - (screenInfo.screens[i], type, on == SCREEN_SAVER_FORCER)) - continue; - } - } - if (type == screenIsSaved) - continue; - switch (type) { - case SCREEN_SAVER_OFF: - if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED) - { - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], - what); - } - else if (HasSaverWindow (i)) - { - savedScreenInfo[i].pWindow = NullWindow; - FreeResource(savedScreenInfo[i].wid, RT_NONE); - } - break; - case SCREEN_SAVER_CYCLE: - if (savedScreenInfo[i].blanked == SCREEN_IS_TILED) - { - WindowPtr pWin = savedScreenInfo[i].pWindow; - /* make it look like screen saver is off, so that - * NotClippedByChildren will compute a clip list - * for the root window, so miPaintWindow works - */ - screenIsSaved = SCREEN_SAVER_OFF; -#ifndef NOLOGOHACK - if (logoScreenSaver) - (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, FALSE); -#endif - (*pWin->drawable.pScreen->MoveWindow)(pWin, - (short)(-(rand() % RANDOM_WIDTH)), - (short)(-(rand() % RANDOM_WIDTH)), - pWin->nextSib, VTMove); -#ifndef NOLOGOHACK - if (logoScreenSaver) - DrawLogo(pWin); -#endif - screenIsSaved = SCREEN_SAVER_ON; - } - /* - * Call the DDX saver in case it wants to do something - * at cycle time - */ - else if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED) - { - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], - type); - } - break; - case SCREEN_SAVER_ON: - if (ScreenSaverBlanking != DontPreferBlanking) - { - if ((* screenInfo.screens[i]->SaveScreen) - (screenInfo.screens[i], what)) - { - savedScreenInfo[i].blanked = SCREEN_IS_BLANKED; - continue; - } - if ((ScreenSaverAllowExposures != DontAllowExposures) && - TileScreenSaver(i, SCREEN_IS_BLACK)) - { - savedScreenInfo[i].blanked = SCREEN_IS_BLACK; - continue; - } - } - if ((ScreenSaverAllowExposures != DontAllowExposures) && - TileScreenSaver(i, SCREEN_IS_TILED)) - { - savedScreenInfo[i].blanked = SCREEN_IS_TILED; - } - else - savedScreenInfo[i].blanked = SCREEN_ISNT_SAVED; - break; - } - } - screenIsSaved = what; - if (mode == ScreenSaverReset) - SetScreenSaverTimer(); -} - -static Bool -TileScreenSaver(int i, int kind) -{ - int j; - int result; - XID attributes[3]; - Mask mask; - WindowPtr pWin; - CursorMetricRec cm; - unsigned char *srcbits, *mskbits; - CursorPtr cursor; - XID cursorID = 0; - int attri; - - mask = 0; - attri = 0; - switch (kind) { - case SCREEN_IS_TILED: - switch (WindowTable[i]->backgroundState) { - case BackgroundPixel: - attributes[attri++] = WindowTable[i]->background.pixel; - mask |= CWBackPixel; - break; - case BackgroundPixmap: - attributes[attri++] = None; - mask |= CWBackPixmap; - break; - default: - break; - } - break; - case SCREEN_IS_BLACK: - attributes[attri++] = WindowTable[i]->drawable.pScreen->blackPixel; - mask |= CWBackPixel; - break; - } - mask |= CWOverrideRedirect; - attributes[attri++] = xTrue; - - /* - * create a blank cursor - */ - - cm.width=16; - cm.height=16; - cm.xhot=8; - cm.yhot=8; - srcbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); - mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); - if (!srcbits || !mskbits) - { - xfree(srcbits); - xfree(mskbits); - cursor = 0; - } - else - { - for (j=0; jwidth + RANDOM_WIDTH, - (unsigned short)screenInfo.screens[i]->height + RANDOM_WIDTH, - 0, InputOutput, mask, attributes, 0, serverClient, - wVisual (WindowTable[i]), &result); - - if (cursor) - FreeResource (cursorID, RT_NONE); - - if (!pWin) - return FALSE; - - if (!AddResource(pWin->drawable.id, RT_WINDOW, - (pointer)savedScreenInfo[i].pWindow)) - return FALSE; - - if (mask & CWBackPixmap) - { - MakeRootTile (pWin); - (*pWin->drawable.pScreen->ChangeWindowAttributes)(pWin, CWBackPixmap); - } - MapWindow(pWin, serverClient); -#ifndef NOLOGOHACK - if (kind == SCREEN_IS_TILED && logoScreenSaver) - DrawLogo(pWin); -#endif - return TRUE; -} - -/* - * FindWindowWithOptional - * - * search ancestors of the given window for an entry containing - * a WindowOpt structure. Assumptions: some parent will - * contain the structure. - */ - -WindowPtr -FindWindowWithOptional (register WindowPtr w) -{ - do - w = w->parent; - while (!w->optional); - return w; -} - -/* - * CheckWindowOptionalNeed - * - * check each optional entry in the given window to see if - * the value is satisfied by the default rules. If so, - * release the optional record - */ - -void -CheckWindowOptionalNeed (register WindowPtr w) -{ - register WindowOptPtr optional; - register WindowOptPtr parentOptional; - - if (!w->parent) - return; - optional = w->optional; - if (optional->dontPropagateMask != DontPropagateMasks[w->dontPropagate]) - return; - if (optional->otherEventMasks != 0) - return; - if (optional->otherClients != NULL) - return; - if (optional->passiveGrabs != NULL) - return; - if (optional->userProps != NULL) - return; - if (optional->backingBitPlanes != ~0L) - return; - if (optional->backingPixel != 0) - return; -#ifdef SHAPE - if (optional->boundingShape != NULL) - return; - if (optional->clipShape != NULL) - return; - if (optional->inputShape != NULL) - return; -#endif -#ifdef XINPUT - if (optional->inputMasks != NULL) - return; -#endif - parentOptional = FindWindowWithOptional(w)->optional; - if (optional->visual != parentOptional->visual) - return; - if (optional->cursor != None && - (optional->cursor != parentOptional->cursor || - w->parent->cursorIsNone)) - return; - if (optional->colormap != parentOptional->colormap) - return; - DisposeWindowOptional (w); -} - -/* - * MakeWindowOptional - * - * create an optional record and initialize it with the default - * values. - */ - -Bool -MakeWindowOptional (register WindowPtr pWin) -{ - register WindowOptPtr optional; - register WindowOptPtr parentOptional; - - if (pWin->optional) - return TRUE; - optional = (WindowOptPtr) xalloc (sizeof (WindowOptRec)); - if (!optional) - return FALSE; - optional->dontPropagateMask = DontPropagateMasks[pWin->dontPropagate]; - optional->otherEventMasks = 0; - optional->otherClients = NULL; - optional->passiveGrabs = NULL; - optional->userProps = NULL; - optional->backingBitPlanes = ~0L; - optional->backingPixel = 0; -#ifdef SHAPE - optional->boundingShape = NULL; - optional->clipShape = NULL; - optional->inputShape = NULL; -#endif -#ifdef XINPUT - optional->inputMasks = NULL; -#endif - parentOptional = FindWindowWithOptional(pWin)->optional; - optional->visual = parentOptional->visual; - if (!pWin->cursorIsNone) - { - optional->cursor = parentOptional->cursor; - optional->cursor->refcnt++; - } - else - { - optional->cursor = None; - } - optional->colormap = parentOptional->colormap; - pWin->optional = optional; - return TRUE; -} - -void -DisposeWindowOptional (register WindowPtr pWin) -{ - if (!pWin->optional) - return; - /* - * everything is peachy. Delete the optional record - * and clean up - */ - /* - * TOG changed this code to: - * - * if (pWin->cursorIsNone == FALSE) - * FreeCursor (pWin->optional->cursor, (Cursor)0); - * pWin->cursorIsNone = TRUE; - * - * This is blatently wrong; windows without optionals can have - * two different cursor values, either None or sharing their - * parents cursor. This difference is controlled by the - * cursorIsNone value; when TRUE, the window has no cursor, - * when false, it shares its cursor with its parent; TOG - * made it impossible for a window to have a cursor without - * an optional record. - */ - if (pWin->optional->cursor) - { - FreeCursor (pWin->optional->cursor, (Cursor)0); - pWin->cursorIsNone = FALSE; - } - else - pWin->cursorIsNone = TRUE; -/* FIXME - There is an error when disposing ClientResources on Agent exit - this xfree is not valid in some window at exit -*/ - - xfree (pWin->optional); - pWin->optional = NULL; -} - -#ifndef NOLOGOHACK -static void -DrawLogo(WindowPtr pWin) -{ - DrawablePtr pDraw; - ScreenPtr pScreen; - int x, y; - unsigned int width, height, size; - GC *pGC; - int thin, gap, d31; - DDXPointRec poly[4]; - ChangeGCVal fore[2], back[2]; - xrgb rgb[2]; - BITS32 fmask, bmask; - ColormapPtr cmap; - - pDraw = (DrawablePtr)pWin; - pScreen = pDraw->pScreen; - x = -pWin->origin.x; - y = -pWin->origin.y; - width = pScreen->width; - height = pScreen->height; - pGC = GetScratchGC(pScreen->rootDepth, pScreen); - if (!pGC) - return; - - if ((rand() % 100) <= 17) /* make the probability for white fairly low */ - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; - if ((pWin->backgroundState == BackgroundPixel) && - (cmap = (ColormapPtr)LookupIDByType(wColormap (pWin), RT_COLORMAP))) { - Pixel querypixels[2]; - - querypixels[0] = fore[0].val; - querypixels[1] = pWin->background.pixel; - QueryColors(cmap, 2, querypixels, rgb); - if ((rgb[0].red == rgb[1].red) && - (rgb[0].green == rgb[1].green) && - (rgb[0].blue == rgb[1].blue)) { - if (fore[0].val == pScreen->blackPixel) - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; - } - } - fore[1].val = FillSolid; - fmask = GCForeground|GCFillStyle; - if (pWin->backgroundState == BackgroundPixel) { - back[0].val = pWin->background.pixel; - back[1].val = FillSolid; - bmask = GCForeground|GCFillStyle; - } else { - back[0].val = 0; - back[1].val = 0; - dixChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, - NULL, back); - back[0].val = FillTiled; - back[1].ptr = pWin->background.pixmap; - bmask = GCFillStyle|GCTile; - } - - /* should be the same as the reference function XmuDrawLogo() */ - - size = width; - if (height < width) - size = height; - size = RANDOM_WIDTH + rand() % (size - RANDOM_WIDTH); - size &= ~1; - x += rand() % (width - size); - y += rand() % (height - size); - -/* - * Draw what will be the thin strokes. - * - * ----- - * / / - * / / - * / / - * / / - * /____/ - * d - * - * Point d is 9/44 (~1/5) of the way across. - */ - - thin = (size / 11); - if (thin < 1) thin = 1; - gap = (thin+3) / 4; - d31 = thin + thin + gap; - poly[0].x = x + size; poly[0].y = y; - poly[1].x = x + size-d31; poly[1].y = y; - poly[2].x = x + 0; poly[2].y = y + size; - poly[3].x = x + d31; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, fmask, NULL, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for lower thin stroke. - * - * ------ - * / / - * / __ / - * / / / - * / / / - * /__/__/ - */ - - poly[0].x = x + d31/2; poly[0].y = y + size; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + d31; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, bmask, NULL, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for upper thin stroke. - * - * ------ - * / / / - * /--/ / - * / / - * / / - * /_____/ - */ - - poly[0].x = x + size - d31/2; poly[0].y = y; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + size - d31; poly[3].y = y; - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Draw thick stroke. - * Point b is 1/4 of the way across. - * - * b - * ----- - * \ \ - * \ \ - * \ \ - * \ \ - * \____\ - */ - - poly[0].x = x; poly[0].y = y; - poly[1].x = x + size/4; poly[1].y = y; - poly[2].x = x + size; poly[2].y = y + size; - poly[3].x = x + size - size/4; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, fmask, NULL, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase to create gap. - * - * / - * / - * / - * / - * / - */ - - poly[0].x = x + size- thin; poly[0].y = y; - poly[1].x = x + size-( thin+gap); poly[1].y = y; - poly[2].x = x + thin; poly[2].y = y + size; - poly[3].x = x + thin + gap; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, bmask, NULL, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - - FreeScratchGC(pGC); -} - -#endif - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.X.original deleted file mode 100644 index c060f4a23..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.X.original +++ /dev/null @@ -1,3853 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.12 2005/07/03 08:53:38 daniels Exp $ */ -/* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -/* The panoramix components contained the following notice */ -/***************************************************************** - -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. - -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. - -******************************************************************/ - -/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.36 2003/11/14 23:52:50 torrey Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "misc.h" -#include "scrnintstr.h" -#include "os.h" -#include "regionstr.h" -#include "validate.h" -#include "windowstr.h" -#include "input.h" -#include "resource.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "servermd.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif -#include "dixevents.h" -#include "globals.h" - -#ifdef XAPPGROUP -#include -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif - -/****** - * Window stuff for server - * - * CreateRootWindow, CreateWindow, ChangeWindowAttributes, - * GetWindowAttributes, DeleteWindow, DestroySubWindows, - * HandleSaveSet, ReparentWindow, MapWindow, MapSubWindows, - * UnmapWindow, UnmapSubWindows, ConfigureWindow, CirculateWindow, - * - ******/ - -static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11}; -static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88}; - -int screenIsSaved = SCREEN_SAVER_OFF; - -ScreenSaverStuffRec savedScreenInfo[MAXSCREENS]; - -#if 0 -extern void DeleteWindowFromAnyEvents(); -extern Mask EventMaskForClient(); -extern void WindowHasNewCursor(); -extern void RecalculateDeliverableEvents(); -#endif - -static Bool TileScreenSaver(int i, int kind); - - -#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \ - CWDontPropagate | CWOverrideRedirect | CWCursor ) - -#define BOXES_OVERLAP(b1, b2) \ - (!( ((b1)->x2 <= (b2)->x1) || \ - ( ((b1)->x1 >= (b2)->x2)) || \ - ( ((b1)->y2 <= (b2)->y1)) || \ - ( ((b1)->y1 >= (b2)->y2)) ) ) - -#define RedirectSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureRedirectMask) - -#define SubSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureNotifyMask) - -#define StrSend(pWin) \ - ((pWin->eventMask|wOtherEventMasks(pWin)) & StructureNotifyMask) - -#define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent)) - - -int numSaveUndersViewable = 0; -int deltaSaveUndersViewable = 0; - -#ifdef DEBUG -/****** - * PrintWindowTree - * For debugging only - ******/ - -int -PrintChildren(WindowPtr p1, int indent) -{ - WindowPtr p2; - int i; - - while (p1) - { - p2 = p1->firstChild; - for (i=0; idrawable.id); - miPrintRegion(&p1->clipList); - PrintChildren(p2, indent+4); - p1 = p1->nextSib; - } -} - -PrintWindowTree() -{ - int i; - WindowPtr pWin, p1; - - for (i=0; iclipList); - p1 = pWin->firstChild; - PrintChildren(p1, 4); - } -} -#endif - -int -TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, pointer data) -{ - register int result; - register WindowPtr pChild; - - if (!(pChild = pWin)) - return(WT_NOMATCH); - while (1) - { - result = (* func)(pChild, data); - if (result == WT_STOPWALKING) - return(WT_STOPWALKING); - if ((result == WT_WALKCHILDREN) && pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - break; - pChild = pChild->nextSib; - } - return(WT_NOMATCH); -} - -/***** - * WalkTree - * Walk the window tree, for SCREEN, preforming FUNC(pWin, data) on - * each window. If FUNC returns WT_WALKCHILDREN, traverse the children, - * if it returns WT_DONTWALKCHILDREN, dont. If it returns WT_STOPWALKING - * exit WalkTree. Does depth-first traverse. - *****/ - -int -WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, pointer data) -{ - return(TraverseTree(WindowTable[pScreen->myNum], func, data)); -} - -/* hack for forcing backing store on all windows */ -int defaultBackingStore = NotUseful; -/* hack to force no backing store */ -Bool disableBackingStore = FALSE; -Bool enableBackingStore = FALSE; -/* hack to force no save unders */ -Bool disableSaveUnders = FALSE; - -static void -SetWindowToDefaults(register WindowPtr pWin) -{ - pWin->prevSib = NullWindow; - pWin->firstChild = NullWindow; - pWin->lastChild = NullWindow; - - pWin->valdata = (ValidatePtr)NULL; - pWin->optional = (WindowOptPtr)NULL; - pWin->cursorIsNone = TRUE; - - pWin->backingStore = NotUseful; - pWin->DIXsaveUnder = FALSE; - pWin->backStorage = (pointer) NULL; - - pWin->mapped = FALSE; /* off */ - pWin->realized = FALSE; /* off */ - pWin->viewable = FALSE; - pWin->visibility = VisibilityNotViewable; - pWin->overrideRedirect = FALSE; - pWin->saveUnder = FALSE; - - pWin->bitGravity = ForgetGravity; - pWin->winGravity = NorthWestGravity; - - pWin->eventMask = 0; - pWin->deliverableEvents = 0; - pWin->dontPropagate = 0; - pWin->forcedBS = FALSE; -#ifdef NEED_DBE_BUF_BITS - pWin->srcBuffer = DBE_FRONT_BUFFER; - pWin->dstBuffer = DBE_FRONT_BUFFER; -#endif -#ifdef COMPOSITE - pWin->redirectDraw = 0; -#endif -} - -static void -MakeRootTile(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - GCPtr pGC; - unsigned char back[128]; - int len = BitmapBytePad(sizeof(long)); - register unsigned char *from, *to; - register int i, j; - - pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4, - pScreen->rootDepth); - - pWin->backgroundState = BackgroundPixmap; - pGC = GetScratchGC(pScreen->rootDepth, pScreen); - if (!pWin->background.pixmap || !pGC) - FatalError("could not create root tile"); - - { - CARD32 attributes[2]; - - attributes[0] = pScreen->whitePixel; - attributes[1] = pScreen->blackPixel; - - (void)ChangeGC(pGC, GCForeground | GCBackground, attributes); - } - - ValidateGC((DrawablePtr)pWin->background.pixmap, pGC); - - from = (screenInfo.bitmapBitOrder == LSBFirst) ? _back_lsb : _back_msb; - to = back; - - for (i = 4; i > 0; i--, from++) - for (j = len; j > 0; j--) - *to++ = *from; - - if (blackRoot) - bzero(back, sizeof(back)); - - (*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, pGC, 1, - 0, 0, len, 4, 0, XYBitmap, (char *)back); - - FreeScratchGC(pGC); - -} - -WindowPtr -AllocateWindow(ScreenPtr pScreen) -{ - WindowPtr pWin; - register char *ptr; - register DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; - - pWin = (WindowPtr)xalloc(pScreen->totalWindowSize); - if (pWin) - { - ppriv = (DevUnion *)(pWin + 1); - pWin->devPrivates = ppriv; - sizes = pScreen->WindowPrivateSizes; - ptr = (char *)(ppriv + pScreen->WindowPrivateLen); - for (i = pScreen->WindowPrivateLen; --i >= 0; ppriv++, sizes++) - { - if ( (size = *sizes) ) - { - ppriv->ptr = (pointer)ptr; - ptr += size; - } - else - ppriv->ptr = (pointer)NULL; - } - } - return pWin; -} - -/***** - * CreateRootWindow - * Makes a window at initialization time for specified screen - *****/ - -Bool -CreateRootWindow(ScreenPtr pScreen) -{ - WindowPtr pWin; - BoxRec box; - PixmapFormatRec *format; - - pWin = AllocateWindow(pScreen); - if (!pWin) - return FALSE; - - savedScreenInfo[pScreen->myNum].pWindow = NULL; - savedScreenInfo[pScreen->myNum].wid = FakeClientID(0); - savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL; - screenIsSaved = SCREEN_SAVER_OFF; - - WindowTable[pScreen->myNum] = pWin; - - pWin->drawable.pScreen = pScreen; - pWin->drawable.type = DRAWABLE_WINDOW; - - pWin->drawable.depth = pScreen->rootDepth; - for (format = screenInfo.formats; - format->depth != pScreen->rootDepth; - format++) - ; - pWin->drawable.bitsPerPixel = format->bitsPerPixel; - - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - pWin->parent = NullWindow; - SetWindowToDefaults(pWin); - - pWin->optional = (WindowOptRec *) xalloc (sizeof (WindowOptRec)); - if (!pWin->optional) - return FALSE; - - pWin->optional->dontPropagateMask = 0; - pWin->optional->otherEventMasks = 0; - pWin->optional->otherClients = NULL; - pWin->optional->passiveGrabs = NULL; - pWin->optional->userProps = NULL; - pWin->optional->backingBitPlanes = ~0L; - pWin->optional->backingPixel = 0; -#ifdef SHAPE - pWin->optional->boundingShape = NULL; - pWin->optional->clipShape = NULL; - pWin->optional->inputShape = NULL; -#endif -#ifdef XINPUT - pWin->optional->inputMasks = NULL; -#endif - pWin->optional->colormap = pScreen->defColormap; - pWin->optional->visual = pScreen->rootVisual; - - pWin->nextSib = NullWindow; - - pWin->drawable.id = FakeClientID(0); - - pWin->origin.x = pWin->origin.y = 0; - pWin->drawable.height = pScreen->height; - pWin->drawable.width = pScreen->width; - pWin->drawable.x = pWin->drawable.y = 0; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - REGION_INIT(pScreen, &pWin->winSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderClip, &box, 1); - - pWin->drawable.class = InputOutput; - pWin->optional->visual = pScreen->rootVisual; - - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = pScreen->whitePixel; - - pWin->borderIsPixel = TRUE; - pWin->border.pixel = pScreen->blackPixel; - pWin->borderWidth = 0; - - if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin)) - return FALSE; - - if (disableBackingStore) - pScreen->backingStoreSupport = NotUseful; - if (enableBackingStore) - pScreen->backingStoreSupport = Always; - -#ifdef DO_SAVE_UNDERS - if ((pScreen->backingStoreSupport != NotUseful) && - (pScreen->saveUnderSupport == NotUseful)) - { - /* - * If the screen has backing-store but no save-unders, let the - * clients know we can support save-unders using backing-store. - */ - pScreen->saveUnderSupport = USE_DIX_SAVE_UNDERS; - } -#endif /* DO_SAVE_UNDERS */ - - if (disableSaveUnders) - pScreen->saveUnderSupport = NotUseful; - - return TRUE; -} - -void -InitRootWindow(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - if (!(*pScreen->CreateWindow)(pWin)) - return; /* XXX */ - (*pScreen->PositionWindow)(pWin, 0, 0); - - pWin->cursorIsNone = FALSE; - pWin->optional->cursor = rootCursor; - rootCursor->refcnt++; - MakeRootTile(pWin); - pWin->backingStore = defaultBackingStore; - pWin->forcedBS = (defaultBackingStore != NotUseful); - /* We SHOULD check for an error value here XXX */ - (*pScreen->ChangeWindowAttributes)(pWin, - CWBackPixmap|CWBorderPixel|CWCursor|CWBackingStore); - - MapWindow(pWin, serverClient); -} - -/* Set the region to the intersection of the rectangle and the - * window's winSize. The window is typically the parent of the - * window from which the region came. - */ - -void -ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn, - register int x, register int y, - register int w, register int h) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - BoxRec box; - - box = *(REGION_EXTENTS(pScreen, &pWin->winSize)); - /* we do these calculations to avoid overflows */ - if (x > box.x1) - box.x1 = x; - if (y > box.y1) - box.y1 = y; - x += w; - if (x < box.x2) - box.x2 = x; - y += h; - if (y < box.y2) - box.y2 = y; - if (box.x1 > box.x2) - box.x2 = box.x1; - if (box.y1 > box.y2) - box.y2 = box.y1; - REGION_RESET(pScreen, Rgn, &box); - REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize); -} - -WindowPtr -RealChildHead(register WindowPtr pWin) -{ - if (!pWin->parent && - (screenIsSaved == SCREEN_SAVER_ON) && - (HasSaverWindow (pWin->drawable.pScreen->myNum))) - return (pWin->firstChild); - else - return (NullWindow); -} - -/***** - * CreateWindow - * Makes a window in response to client request - *****/ - -WindowPtr -CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w, - unsigned h, unsigned bw, unsigned class, register Mask vmask, XID *vlist, - int depth, ClientPtr client, VisualID visual, int *error) -{ - register WindowPtr pWin; - WindowPtr pHead; - register ScreenPtr pScreen; - xEvent event; - int idepth, ivisual; - Bool fOK; - DepthPtr pDepth; - PixmapFormatRec *format; - register WindowOptPtr ancwopt; - - if (class == CopyFromParent) - class = pParent->drawable.class; - - if ((class != InputOutput) && (class != InputOnly)) - { - *error = BadValue; - client->errorValue = class; - return NullWindow; - } - - if ((class != InputOnly) && (pParent->drawable.class == InputOnly)) - { - *error = BadMatch; - return NullWindow; - } - - if ((class == InputOnly) && ((bw != 0) || (depth != 0))) - { - *error = BadMatch; - return NullWindow; - } - - pScreen = pParent->drawable.pScreen; - if ((class == InputOutput) && (depth == 0)) - depth = pParent->drawable.depth; - ancwopt = pParent->optional; - if (!ancwopt) - ancwopt = FindWindowWithOptional(pParent)->optional; - if (visual == CopyFromParent) { -#ifdef XAPPGROUP - VisualID ag_visual; - - if (client->appgroup && !pParent->parent && - (ag_visual = XagRootVisual (client))) - visual = ag_visual; - else -#endif - visual = ancwopt->visual; - } - - /* Find out if the depth and visual are acceptable for this Screen */ - if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) - { - fOK = FALSE; - for(idepth = 0; idepth < pScreen->numDepths; idepth++) - { - pDepth = (DepthPtr) &pScreen->allowedDepths[idepth]; - if ((depth == pDepth->depth) || (depth == 0)) - { - for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) - { - if (visual == pDepth->vids[ivisual]) - { - fOK = TRUE; - break; - } - } - } - } - if (fOK == FALSE) - { - *error = BadMatch; - return NullWindow; - } - } - - if (((vmask & (CWBorderPixmap | CWBorderPixel)) == 0) && - (class != InputOnly) && - (depth != pParent->drawable.depth)) - { - *error = BadMatch; - return NullWindow; - } - - if (((vmask & CWColormap) == 0) && - (class != InputOnly) && - ((visual != ancwopt->visual) || (ancwopt->colormap == None))) - { - *error = BadMatch; - return NullWindow; - } - - pWin = AllocateWindow(pScreen); - if (!pWin) - { - *error = BadAlloc; - return NullWindow; - } - pWin->drawable = pParent->drawable; - pWin->drawable.depth = depth; - if (depth == pParent->drawable.depth) - pWin->drawable.bitsPerPixel = pParent->drawable.bitsPerPixel; - else - { - for (format = screenInfo.formats; format->depth != depth; format++) - ; - pWin->drawable.bitsPerPixel = format->bitsPerPixel; - } - if (class == InputOnly) - pWin->drawable.type = (short) UNDRAWABLE_WINDOW; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - pWin->drawable.id = wid; - pWin->drawable.class = class; - - pWin->parent = pParent; - SetWindowToDefaults(pWin); - - if (visual != ancwopt->visual) - { - if (!MakeWindowOptional (pWin)) - { - xfree (pWin); - *error = BadAlloc; - return NullWindow; - } - pWin->optional->visual = visual; - pWin->optional->colormap = None; - } - - pWin->borderWidth = bw; -#ifdef XCSECURITY - /* can't let untrusted clients have background None windows; - * they make it too easy to steal window contents - */ - if (client->trustLevel != XSecurityClientTrusted) - { - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = 0; - } - else -#endif - pWin->backgroundState = None; - - pWin->borderIsPixel = pParent->borderIsPixel; - pWin->border = pParent->border; - if (pWin->borderIsPixel == FALSE) - pWin->border.pixmap->refcnt++; - - pWin->origin.x = x + (int)bw; - pWin->origin.y = y + (int)bw; - pWin->drawable.width = w; - pWin->drawable.height = h; - pWin->drawable.x = pParent->drawable.x + x + (int)bw; - pWin->drawable.y = pParent->drawable.y + y + (int)bw; - - /* set up clip list correctly for unobscured WindowPtr */ - REGION_NULL(pScreen, &pWin->clipList); - REGION_NULL(pScreen, &pWin->borderClip); - REGION_NULL(pScreen, &pWin->winSize); - REGION_NULL(pScreen, &pWin->borderSize); - - pHead = RealChildHead(pParent); - if (pHead) - { - pWin->nextSib = pHead->nextSib; - if (pHead->nextSib) - pHead->nextSib->prevSib = pWin; - else - pParent->lastChild = pWin; - pHead->nextSib = pWin; - pWin->prevSib = pHead; - } - else - { - pWin->nextSib = pParent->firstChild; - if (pParent->firstChild) - pParent->firstChild->prevSib = pWin; - else - pParent->lastChild = pWin; - pParent->firstChild = pWin; - } - - SetWinSize (pWin); - SetBorderSize (pWin); - - /* We SHOULD check for an error value here XXX */ - if (!(*pScreen->CreateWindow)(pWin)) - { - *error = BadAlloc; - DeleteWindow(pWin, None); - return NullWindow; - } - /* We SHOULD check for an error value here XXX */ - (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y); - - if (!(vmask & CWEventMask)) - RecalculateDeliverableEvents(pWin); - - if (vmask) - *error = ChangeWindowAttributes(pWin, vmask, vlist, wClient (pWin)); - else - *error = Success; - - if (*error != Success) - { - DeleteWindow(pWin, None); - return NullWindow; - } - if (!(vmask & CWBackingStore) && (defaultBackingStore != NotUseful)) - { - XID value = defaultBackingStore; - (void)ChangeWindowAttributes(pWin, CWBackingStore, &value, wClient (pWin)); - pWin->forcedBS = TRUE; - } - - if (SubSend(pParent)) - { - event.u.u.type = CreateNotify; - event.u.createNotify.window = wid; - event.u.createNotify.parent = pParent->drawable.id; - event.u.createNotify.x = x; - event.u.createNotify.y = y; - event.u.createNotify.width = w; - event.u.createNotify.height = h; - event.u.createNotify.borderWidth = bw; - event.u.createNotify.override = pWin->overrideRedirect; - DeliverEvents(pParent, &event, 1, NullWindow); - } - return pWin; -} - -static void -FreeWindowResources(register WindowPtr pWin) -{ - register ScreenPtr pScreen = pWin->drawable.pScreen; - - DeleteWindowFromAnySaveSet(pWin); - DeleteWindowFromAnySelections(pWin); - DeleteWindowFromAnyEvents(pWin, TRUE); - REGION_UNINIT(pScreen, &pWin->clipList); - REGION_UNINIT(pScreen, &pWin->winSize); - REGION_UNINIT(pScreen, &pWin->borderClip); - REGION_UNINIT(pScreen, &pWin->borderSize); -#ifdef SHAPE - if (wBoundingShape (pWin)) - REGION_DESTROY(pScreen, wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_DESTROY(pScreen, wClipShape (pWin)); - if (wInputShape (pWin)) - REGION_DESTROY(pScreen, wInputShape (pWin)); -#endif - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - - DeleteAllWindowProperties(pWin); - /* We SHOULD check for an error value here XXX */ - (*pScreen->DestroyWindow)(pWin); - DisposeWindowOptional (pWin); -} - -static void -CrushTree(WindowPtr pWin) -{ - register WindowPtr pChild, pSib, pParent; - UnrealizeWindowProcPtr UnrealizeWindow; - xEvent event; - - if (!(pChild = pWin->firstChild)) - return; - UnrealizeWindow = pWin->drawable.pScreen->UnrealizeWindow; - while (1) - { - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (1) - { - pParent = pChild->parent; - if (SubStrSend(pChild, pParent)) - { - event.u.u.type = DestroyNotify; - event.u.destroyNotify.window = pChild->drawable.id; - DeliverEvents(pChild, &event, 1, NullWindow); - } - FreeResource(pChild->drawable.id, RT_WINDOW); - pSib = pChild->nextSib; -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder && pChild->viewable) - deltaSaveUndersViewable--; -#endif - pChild->viewable = FALSE; - if (pChild->realized) - { - pChild->realized = FALSE; - (*UnrealizeWindow)(pChild); - } - FreeWindowResources(pChild); - xfree(pChild); - if ( (pChild = pSib) ) - break; - pChild = pParent; - pChild->firstChild = NullWindow; - pChild->lastChild = NullWindow; - if (pChild == pWin) - return; - } - } -} - -/***** - * DeleteWindow - * Deletes child of window then window itself - * If wid is None, don't send any events - *****/ - -int -DeleteWindow(pointer value, XID wid) - { - register WindowPtr pParent; - register WindowPtr pWin = (WindowPtr)value; - xEvent event; - - UnmapWindow(pWin, FALSE); - - CrushTree(pWin); - - pParent = pWin->parent; - if (wid && pParent && SubStrSend(pWin, pParent)) - { - event.u.u.type = DestroyNotify; - event.u.destroyNotify.window = pWin->drawable.id; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - FreeWindowResources(pWin); - if (pParent) - { - if (pParent->firstChild == pWin) - pParent->firstChild = pWin->nextSib; - if (pParent->lastChild == pWin) - pParent->lastChild = pWin->prevSib; - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - } - xfree(pWin); - return Success; -} - -void -DestroySubwindows(register WindowPtr pWin, ClientPtr client) -{ - /* XXX - * The protocol is quite clear that each window should be - * destroyed in turn, however, unmapping all of the first - * eliminates most of the calls to ValidateTree. So, - * this implementation is incorrect in that all of the - * UnmapNotifies occur before all of the DestroyNotifies. - * If you care, simply delete the call to UnmapSubwindows. - */ - UnmapSubwindows(pWin); - while (pWin->lastChild) - FreeResource(pWin->lastChild->drawable.id, RT_NONE); -} - -#define DeviceEventMasks (KeyPressMask | KeyReleaseMask | ButtonPressMask | \ - ButtonReleaseMask | PointerMotionMask) - -/***** - * ChangeWindowAttributes - * - * The value-mask specifies which attributes are to be changed; the - * value-list contains one value for each one bit in the mask, from least - * to most significant bit in the mask. - *****/ - -int -ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) -{ - register Mask index2; - register XID *pVlist; - PixmapPtr pPixmap; - Pixmap pixID; - CursorPtr pCursor, pOldCursor; - Cursor cursorID; - WindowPtr pChild; - Colormap cmap; - ColormapPtr pCmap; - xEvent xE; - int result; - register ScreenPtr pScreen; - Mask vmaskCopy = 0; - register Mask tmask; - unsigned int val; - int error; - Bool checkOptional = FALSE; - Bool borderRelative = FALSE; - WindowPtr pLayerWin; - - if ((pWin->drawable.class == InputOnly) && (vmask & (~INPUTONLY_LEGAL_MASK))) - return BadMatch; - - error = Success; - pScreen = pWin->drawable.pScreen; - pVlist = vlist; - tmask = vmask; - while (tmask) - { - index2 = (Mask) lowbit (tmask); - tmask &= ~index2; - switch (index2) - { - case CWBackPixmap: - pixID = (Pixmap )*pVlist; - pVlist++; - if (pWin->backgroundState == ParentRelative) - borderRelative = TRUE; - if (pixID == None) - { -#ifdef XCSECURITY - /* can't let untrusted clients have background None windows */ - if (client->trustLevel == XSecurityClientTrusted) - { -#endif - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - if (!pWin->parent) - MakeRootTile(pWin); - else - pWin->backgroundState = None; -#ifdef XCSECURITY - } - else - { /* didn't change the background to None, so don't tell ddx */ - index2 = 0; - } -#endif - } - else if (pixID == ParentRelative) - { - if (pWin->parent && - pWin->drawable.depth != pWin->parent->drawable.depth) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - if (!pWin->parent) - MakeRootTile(pWin); - else - pWin->backgroundState = ParentRelative; - borderRelative = TRUE; - /* Note that the parent's backgroundTile's refcnt is NOT - * incremented. */ - } - else - { - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); - if (pPixmap != (PixmapPtr) NULL) - { - if ((pPixmap->drawable.depth != pWin->drawable.depth) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - pWin->backgroundState = BackgroundPixmap; - pWin->background.pixmap = pPixmap; - pPixmap->refcnt++; - } - else - { - error = BadPixmap; - client->errorValue = pixID; - goto PatchUp; - } - } - break; - case CWBackPixel: - if (pWin->backgroundState == ParentRelative) - borderRelative = TRUE; - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - pWin->backgroundState = BackgroundPixel; - pWin->background.pixel = (CARD32 ) *pVlist; - /* background pixel overrides background pixmap, - so don't let the ddx layer see both bits */ - vmaskCopy &= ~CWBackPixmap; - pVlist++; - break; - case CWBorderPixmap: - pixID = (Pixmap ) *pVlist; - pVlist++; - if (pixID == CopyFromParent) - { - if (!pWin->parent || - (pWin->drawable.depth != pWin->parent->drawable.depth)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->border = pWin->parent->border; - if ((pWin->borderIsPixel = pWin->parent->borderIsPixel) == TRUE) - { - index2 = CWBorderPixel; - } - else - { - pWin->parent->border.pixmap->refcnt++; - } - } - else - { - pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); - if (pPixmap) - { - if ((pPixmap->drawable.depth != pWin->drawable.depth) || - (pPixmap->drawable.pScreen != pScreen)) - { - error = BadMatch; - goto PatchUp; - } - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->borderIsPixel = FALSE; - pWin->border.pixmap = pPixmap; - pPixmap->refcnt++; - } - else - { - error = BadPixmap; - client->errorValue = pixID; - goto PatchUp; - } - } - break; - case CWBorderPixel: - if (pWin->borderIsPixel == FALSE) - (*pScreen->DestroyPixmap)(pWin->border.pixmap); - pWin->borderIsPixel = TRUE; - pWin->border.pixel = (CARD32) *pVlist; - /* border pixel overrides border pixmap, - so don't let the ddx layer see both bits */ - vmaskCopy &= ~CWBorderPixmap; - pVlist++; - break; - case CWBitGravity: - val = (CARD8 )*pVlist; - pVlist++; - if (val > StaticGravity) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->bitGravity = val; - break; - case CWWinGravity: - val = (CARD8 )*pVlist; - pVlist++; - if (val > StaticGravity) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->winGravity = val; - break; - case CWBackingStore: - val = (CARD8 )*pVlist; - pVlist++; - if ((val != NotUseful) && (val != WhenMapped) && (val != Always)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->backingStore = val; - pWin->forcedBS = FALSE; - break; - case CWBackingPlanes: - if (pWin->optional || ((CARD32)*pVlist != (CARD32)~0L)) { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - pWin->optional->backingBitPlanes = (CARD32) *pVlist; - if ((CARD32)*pVlist == (CARD32)~0L) - checkOptional = TRUE; - } - pVlist++; - break; - case CWBackingPixel: - if (pWin->optional || (CARD32) *pVlist) { - if (!pWin->optional && !MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - pWin->optional->backingPixel = (CARD32) *pVlist; - if (!*pVlist) - checkOptional = TRUE; - } - pVlist++; - break; - case CWSaveUnder: - val = (BOOL) *pVlist; - pVlist++; - if ((val != xTrue) && (val != xFalse)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } -#ifdef DO_SAVE_UNDERS - if (pWin->parent && (pWin->saveUnder != val) && (pWin->viewable) && - DO_SAVE_UNDERS(pWin)) - { - /* - * Re-check all siblings and inferiors for obscurity or - * exposition (hee hee). - */ - if (pWin->saveUnder) - deltaSaveUndersViewable--; - else - deltaSaveUndersViewable++; - pWin->saveUnder = val; - - if (pWin->firstChild) - { - pLayerWin = (*pScreen->GetLayerWindow)(pWin); - if ((*pScreen->ChangeSaveUnder)(pLayerWin->parent, pWin->nextSib)) - (*pScreen->PostChangeSaveUnder)(pLayerWin->parent, - pWin->nextSib); - } - else - { - if ((*pScreen->ChangeSaveUnder)(pWin, pWin->nextSib)) - (*pScreen->PostChangeSaveUnder)(pWin, - pWin->nextSib); - } - } - else - { - /* If we're changing the saveUnder attribute of the root - * window, all we do is set pWin->saveUnder so that - * GetWindowAttributes returns the right value. We don't - * do the "normal" save-under processing (as above). - * Hope that doesn't cause any problems. - */ - pWin->saveUnder = val; - } -#else - pWin->saveUnder = val; -#endif /* DO_SAVE_UNDERS */ - break; - case CWEventMask: - result = EventSelectForWindow(pWin, client, (Mask )*pVlist); - if (result) - { - error = result; - goto PatchUp; - } - pVlist++; - break; - case CWDontPropagate: - result = EventSuppressForWindow(pWin, client, (Mask )*pVlist, - &checkOptional); - if (result) - { - error = result; - goto PatchUp; - } - pVlist++; - break; - case CWOverrideRedirect: - val = (BOOL ) *pVlist; - pVlist++; - if ((val != xTrue) && (val != xFalse)) - { - error = BadValue; - client->errorValue = val; - goto PatchUp; - } - pWin->overrideRedirect = val; - break; - case CWColormap: - cmap = (Colormap) *pVlist; - pVlist++; - if (cmap == CopyFromParent) - { -#ifdef XAPPGROUP - Colormap ag_colormap; - ClientPtr win_owner; - - /* - * win_owner == client for CreateWindow, other clients - * can ChangeWindowAttributes - */ - win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - - if ( win_owner && win_owner->appgroup && - !pWin->parent->parent && - (ag_colormap = XagDefaultColormap (win_owner))) - cmap = ag_colormap; - else -#endif - if (pWin->parent && - (!pWin->optional || - pWin->optional->visual == wVisual (pWin->parent))) - { - cmap = wColormap (pWin->parent); - } - else - cmap = None; - } - if (cmap == None) - { - error = BadMatch; - goto PatchUp; - } - pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap, - RT_COLORMAP, SecurityReadAccess); - if (!pCmap) - { - error = BadColor; - client->errorValue = cmap; - goto PatchUp; - } - if (pCmap->pVisual->vid != wVisual (pWin) || - pCmap->pScreen != pScreen) - { - error = BadMatch; - goto PatchUp; - } - if (cmap != wColormap (pWin)) - { - if (!pWin->optional) - { - if (!MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - } - else if (pWin->parent && cmap == wColormap (pWin->parent)) - checkOptional = TRUE; - - /* - * propagate the original colormap to any children - * inheriting it - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (!pChild->optional && !MakeWindowOptional (pChild)) - { - error = BadAlloc; - goto PatchUp; - } - } - - pWin->optional->colormap = cmap; - - /* - * check on any children now matching the new colormap - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (pChild->optional->colormap == cmap) - CheckWindowOptionalNeed (pChild); - } - - xE.u.u.type = ColormapNotify; - xE.u.colormap.window = pWin->drawable.id; - xE.u.colormap.colormap = cmap; - xE.u.colormap.new = xTrue; - xE.u.colormap.state = IsMapInstalled(cmap, pWin); - DeliverEvents(pWin, &xE, 1, NullWindow); - } - break; - case CWCursor: - cursorID = (Cursor ) *pVlist; - pVlist++; - /* - * install the new - */ - if ( cursorID == None) - { - if (pWin == WindowTable[pWin->drawable.pScreen->myNum]) - pCursor = rootCursor; - else - pCursor = (CursorPtr) None; - } - else - { - pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID, - RT_CURSOR, SecurityReadAccess); - if (!pCursor) - { - error = BadCursor; - client->errorValue = cursorID; - goto PatchUp; - } - } - - if (pCursor != wCursor (pWin)) - { - /* - * patch up child windows so they don't lose cursors. - */ - - for (pChild = pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (!pChild->optional && !pChild->cursorIsNone && - !MakeWindowOptional (pChild)) - { - error = BadAlloc; - goto PatchUp; - } - } - - pOldCursor = 0; - if (pCursor == (CursorPtr) None) - { - pWin->cursorIsNone = TRUE; - if (pWin->optional) - { - pOldCursor = pWin->optional->cursor; - pWin->optional->cursor = (CursorPtr) None; - checkOptional = TRUE; - } - } else { - if (!pWin->optional) - { - if (!MakeWindowOptional (pWin)) - { - error = BadAlloc; - goto PatchUp; - } - } - else if (pWin->parent && pCursor == wCursor (pWin->parent)) - checkOptional = TRUE; - pOldCursor = pWin->optional->cursor; - pWin->optional->cursor = pCursor; - pCursor->refcnt++; - pWin->cursorIsNone = FALSE; - /* - * check on any children now matching the new cursor - */ - - for (pChild=pWin->firstChild; pChild; pChild=pChild->nextSib) - { - if (pChild->optional && - (pChild->optional->cursor == pCursor)) - CheckWindowOptionalNeed (pChild); - } - } - - if (pWin->realized) - WindowHasNewCursor( pWin); - - /* Can't free cursor until here - old cursor - * is needed in WindowHasNewCursor - */ - if (pOldCursor) - FreeCursor (pOldCursor, (Cursor)0); - } - break; - default: - error = BadValue; - client->errorValue = vmask; - goto PatchUp; - } - vmaskCopy |= index2; - } -PatchUp: - if (checkOptional) - CheckWindowOptionalNeed (pWin); - - /* We SHOULD check for an error value here XXX */ - (*pScreen->ChangeWindowAttributes)(pWin, vmaskCopy); - - /* - If the border contents have changed, redraw the border. - Note that this has to be done AFTER pScreen->ChangeWindowAttributes - for the tile to be rotated, and the correct function selected. - */ - if (((vmaskCopy & (CWBorderPixel | CWBorderPixmap)) || borderRelative) - && pWin->viewable && HasBorder (pWin)) - { - RegionRec exposed; - - REGION_NULL(pScreen, &exposed); - REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize); - (*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER); - REGION_UNINIT(pScreen, &exposed); - } - return error; -} - - -/***** - * GetWindowAttributes - * Notice that this is different than ChangeWindowAttributes - *****/ - -void -GetWindowAttributes(register WindowPtr pWin, ClientPtr client, xGetWindowAttributesReply *wa) -{ - wa->type = X_Reply; - wa->bitGravity = pWin->bitGravity; - wa->winGravity = pWin->winGravity; - if (pWin->forcedBS && pWin->backingStore != Always) - wa->backingStore = NotUseful; - else - wa->backingStore = pWin->backingStore; - wa->length = (sizeof(xGetWindowAttributesReply) - - sizeof(xGenericReply)) >> 2; - wa->sequenceNumber = client->sequence; - wa->backingBitPlanes = wBackingBitPlanes (pWin); - wa->backingPixel = wBackingPixel (pWin); - wa->saveUnder = (BOOL)pWin->saveUnder; - wa->override = pWin->overrideRedirect; - if (!pWin->mapped) - wa->mapState = IsUnmapped; - else if (pWin->realized) - wa->mapState = IsViewable; - else - wa->mapState = IsUnviewable; - - wa->colormap = wColormap (pWin); - wa->mapInstalled = (wa->colormap == None) ? xFalse - : IsMapInstalled(wa->colormap, pWin); - - wa->yourEventMask = EventMaskForClient(pWin, client); - wa->allEventMasks = pWin->eventMask | wOtherEventMasks (pWin); - wa->doNotPropagateMask = wDontPropagateMask (pWin); - wa->class = pWin->drawable.class; - wa->visualID = wVisual (pWin); -} - - -WindowPtr -MoveWindowInStack(register WindowPtr pWin, register WindowPtr pNextSib) -{ - register WindowPtr pParent = pWin->parent; - WindowPtr pFirstChange = pWin; /* highest window where list changes */ - - if (pWin->nextSib != pNextSib) - { - WindowPtr pOldNextSib = pWin->nextSib; - - if (!pNextSib) /* move to bottom */ - { - if (pParent->firstChild == pWin) - pParent->firstChild = pWin->nextSib; - /* if (pWin->nextSib) */ /* is always True: pNextSib == NULL - * and pWin->nextSib != pNextSib - * therefore pWin->nextSib != NULL */ - pFirstChange = pWin->nextSib; - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pParent->lastChild->nextSib = pWin; - pWin->prevSib = pParent->lastChild; - pWin->nextSib = NullWindow; - pParent->lastChild = pWin; - } - else if (pParent->firstChild == pNextSib) /* move to top */ - { - pFirstChange = pWin; - if (pParent->lastChild == pWin) - pParent->lastChild = pWin->prevSib; - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pWin->nextSib = pParent->firstChild; - pWin->prevSib = (WindowPtr ) NULL; - pNextSib->prevSib = pWin; - pParent->firstChild = pWin; - } - else /* move in middle of list */ - { - WindowPtr pOldNext = pWin->nextSib; - - pFirstChange = NullWindow; - if (pParent->firstChild == pWin) - pFirstChange = pParent->firstChild = pWin->nextSib; - if (pParent->lastChild == pWin) { - pFirstChange = pWin; - pParent->lastChild = pWin->prevSib; - } - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - pWin->nextSib = pNextSib; - pWin->prevSib = pNextSib->prevSib; - if (pNextSib->prevSib) - pNextSib->prevSib->nextSib = pWin; - pNextSib->prevSib = pWin; - if (!pFirstChange) { /* do we know it yet? */ - pFirstChange = pParent->firstChild; /* no, search from top */ - while ((pFirstChange != pWin) && (pFirstChange != pOldNext)) - pFirstChange = pFirstChange->nextSib; - } - } - if(pWin->drawable.pScreen->RestackWindow) - (*pWin->drawable.pScreen->RestackWindow)(pWin, pOldNextSib); - } - -#ifdef ROOTLESS - /* - * In rootless mode we can't optimize away window restacks. - * There may be non-X windows around, so even if the window - * is in the correct position from X's point of view, - * the underlying window system may want to reorder it. - */ - else if (pWin->drawable.pScreen->RestackWindow) - (*pWin->drawable.pScreen->RestackWindow)(pWin, pWin->nextSib); -#endif - - return( pFirstChange ); -} - -RegionPtr -CreateUnclippedWinSize (register WindowPtr pWin) -{ - RegionPtr pRgn; - BoxRec box; - - box.x1 = pWin->drawable.x; - box.y1 = pWin->drawable.y; - box.x2 = pWin->drawable.x + (int) pWin->drawable.width; - box.y2 = pWin->drawable.y + (int) pWin->drawable.height; - pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); -#ifdef SHAPE - if (wBoundingShape (pWin) || wClipShape (pWin)) { - ScreenPtr pScreen = pWin->drawable.pScreen; - - REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x, - - pWin->drawable.y); - if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wClipShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x, pWin->drawable.y); - } -#endif - return pRgn; -} - -void -SetWinSize (register WindowPtr pWin) -{ -#ifdef COMPOSITE - if (pWin->redirectDraw) - { - BoxRec box; - - box.x1 = pWin->drawable.x; - box.y1 = pWin->drawable.y; - box.x2 = pWin->drawable.x + pWin->drawable.width; - box.y2 = pWin->drawable.y + pWin->drawable.height; - REGION_RESET (pScreen, &pWin->winSize, &box); - } - else -#endif - ClippedRegionFromBox(pWin->parent, &pWin->winSize, - pWin->drawable.x, pWin->drawable.y, - (int)pWin->drawable.width, - (int)pWin->drawable.height); -#ifdef SHAPE - if (wBoundingShape (pWin) || wClipShape (pWin)) { - ScreenPtr pScreen = pWin->drawable.pScreen; - - REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x, - - pWin->drawable.y); - if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, - wBoundingShape (pWin)); - if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, - wClipShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->winSize, pWin->drawable.x, - pWin->drawable.y); - } -#endif -} - -void -SetBorderSize (register WindowPtr pWin) -{ - int bw; - - if (HasBorder (pWin)) { - bw = wBorderWidth (pWin); -#ifdef COMPOSITE - if (pWin->redirectDraw) - { - BoxRec box; - - box.x1 = pWin->drawable.x - bw; - box.y1 = pWin->drawable.y - bw; - box.x2 = pWin->drawable.x + pWin->drawable.width + bw; - box.y2 = pWin->drawable.y + pWin->drawable.height + bw; - REGION_RESET (pScreen, &pWin->borderSize, &box); - } - else -#endif - ClippedRegionFromBox(pWin->parent, &pWin->borderSize, - pWin->drawable.x - bw, pWin->drawable.y - bw, - (int)(pWin->drawable.width + (bw<<1)), - (int)(pWin->drawable.height + (bw<<1))); -#ifdef SHAPE - if (wBoundingShape (pWin)) { - ScreenPtr pScreen = pWin->drawable.pScreen; - - REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x, - - pWin->drawable.y); - REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize, - wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->borderSize, pWin->drawable.x, - pWin->drawable.y); - REGION_UNION(pScreen, &pWin->borderSize, &pWin->borderSize, - &pWin->winSize); - } -#endif - } else { - REGION_COPY(pWin->drawable.pScreen, &pWin->borderSize, - &pWin->winSize); - } -} - -/** - * - * \param x,y new window position - * \param oldx,oldy old window position - * \param destx,desty position relative to gravity - */ - -void -GravityTranslate (register int x, register int y, int oldx, int oldy, - int dw, int dh, unsigned gravity, - register int *destx, register int *desty) -{ - switch (gravity) { - case NorthGravity: - *destx = x + dw / 2; - *desty = y; - break; - case NorthEastGravity: - *destx = x + dw; - *desty = y; - break; - case WestGravity: - *destx = x; - *desty = y + dh / 2; - break; - case CenterGravity: - *destx = x + dw / 2; - *desty = y + dh / 2; - break; - case EastGravity: - *destx = x + dw; - *desty = y + dh / 2; - break; - case SouthWestGravity: - *destx = x; - *desty = y + dh; - break; - case SouthGravity: - *destx = x + dw / 2; - *desty = y + dh; - break; - case SouthEastGravity: - *destx = x + dw; - *desty = y + dh; - break; - case StaticGravity: - *destx = oldx; - *desty = oldy; - break; - default: - *destx = x; - *desty = y; - break; - } -} - -/* XXX need to retile border on each window with ParentRelative origin */ -void -ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh) -{ - register ScreenPtr pScreen; - register WindowPtr pSib, pChild; - Bool resized = (dw || dh); - - pScreen = pWin->drawable.pScreen; - - for (pSib = pWin->firstChild; pSib; pSib = pSib->nextSib) - { - if (resized && (pSib->winGravity > NorthWestGravity)) - { - int cwsx, cwsy; - - cwsx = pSib->origin.x; - cwsy = pSib->origin.y; - GravityTranslate (cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh, - pSib->winGravity, &cwsx, &cwsy); - if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) - { - xEvent event; - - event.u.u.type = GravityNotify; - event.u.gravity.window = pSib->drawable.id; - event.u.gravity.x = cwsx - wBorderWidth (pSib); - event.u.gravity.y = cwsy - wBorderWidth (pSib); - DeliverEvents (pSib, &event, 1, NullWindow); - pSib->origin.x = cwsx; - pSib->origin.y = cwsy; - } - } - pSib->drawable.x = pWin->drawable.x + pSib->origin.x; - pSib->drawable.y = pWin->drawable.y + pSib->origin.y; - SetWinSize (pSib); - SetBorderSize (pSib); - (*pScreen->PositionWindow)(pSib, pSib->drawable.x, pSib->drawable.y); - - if ( (pChild = pSib->firstChild) ) - { - while (1) - { - pChild->drawable.x = pChild->parent->drawable.x + - pChild->origin.x; - pChild->drawable.y = pChild->parent->drawable.y + - pChild->origin.y; - SetWinSize (pChild); - SetBorderSize (pChild); - (*pScreen->PositionWindow)(pChild, - pChild->drawable.x, pChild->drawable.y); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - while (!pChild->nextSib && (pChild != pSib)) - pChild = pChild->parent; - if (pChild == pSib) - break; - pChild = pChild->nextSib; - } - } - } -} - -#define GET_INT16(m, f) \ - if (m & mask) \ - { \ - f = (INT16) *pVlist;\ - pVlist++; \ - } -#define GET_CARD16(m, f) \ - if (m & mask) \ - { \ - f = (CARD16) *pVlist;\ - pVlist++;\ - } - -#define GET_CARD8(m, f) \ - if (m & mask) \ - { \ - f = (CARD8) *pVlist;\ - pVlist++;\ - } - -#define ChangeMask ((Mask)(CWX | CWY | CWWidth | CWHeight)) - -#define IllegalInputOnlyConfigureMask (CWBorderWidth) - -/* - * IsSiblingAboveMe - * returns Above if pSib above pMe in stack or Below otherwise - */ - -static int -IsSiblingAboveMe( - register WindowPtr pMe, - register WindowPtr pSib) -{ - register WindowPtr pWin; - - pWin = pMe->parent->firstChild; - while (pWin) - { - if (pWin == pSib) - return(Above); - else if (pWin == pMe) - return(Below); - pWin = pWin->nextSib; - } - return(Below); -} - -static BoxPtr -WindowExtents( - register WindowPtr pWin, - register BoxPtr pBox) -{ - pBox->x1 = pWin->drawable.x - wBorderWidth (pWin); - pBox->y1 = pWin->drawable.y - wBorderWidth (pWin); - pBox->x2 = pWin->drawable.x + (int)pWin->drawable.width - + wBorderWidth (pWin); - pBox->y2 = pWin->drawable.y + (int)pWin->drawable.height - + wBorderWidth (pWin); - return(pBox); -} - -#ifdef SHAPE -#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL) - -static RegionPtr -MakeBoundingRegion ( - register WindowPtr pWin, - BoxPtr pBox) -{ - RegionPtr pRgn; - ScreenPtr pScreen = pWin->drawable.pScreen; - - pRgn = REGION_CREATE(pScreen, pBox, 1); - if (wBoundingShape (pWin)) { - REGION_TRANSLATE(pScreen, pRgn, -pWin->origin.x, - -pWin->origin.y); - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->origin.x, - pWin->origin.y); - } - return pRgn; -} - -static Bool -ShapeOverlap ( - WindowPtr pWin, - BoxPtr pWinBox, - WindowPtr pSib, - BoxPtr pSibBox) -{ - RegionPtr pWinRgn, pSibRgn; - register ScreenPtr pScreen; - Bool ret; - - if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib)) - return TRUE; - pScreen = pWin->drawable.pScreen; - pWinRgn = MakeBoundingRegion (pWin, pWinBox); - pSibRgn = MakeBoundingRegion (pSib, pSibBox); - REGION_INTERSECT(pScreen, pWinRgn, pWinRgn, pSibRgn); - ret = REGION_NOTEMPTY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pSibRgn); - return ret; -} -#endif - -static Bool -AnyWindowOverlapsMe( - WindowPtr pWin, - WindowPtr pHead, - register BoxPtr box) -{ - register WindowPtr pSib; - BoxRec sboxrec; - register BoxPtr sbox; - - for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib) - { - if (pSib->mapped) - { - sbox = WindowExtents(pSib, &sboxrec); - if (BOXES_OVERLAP(sbox, box) -#ifdef SHAPE - && ShapeOverlap (pWin, box, pSib, sbox) -#endif - ) - return(TRUE); - } - } - return(FALSE); -} - -static Bool -IOverlapAnyWindow( - WindowPtr pWin, - register BoxPtr box) -{ - register WindowPtr pSib; - BoxRec sboxrec; - register BoxPtr sbox; - - for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib) - { - if (pSib->mapped) - { - sbox = WindowExtents(pSib, &sboxrec); - if (BOXES_OVERLAP(sbox, box) -#ifdef SHAPE - && ShapeOverlap (pWin, box, pSib, sbox) -#endif - ) - return(TRUE); - } - } - return(FALSE); -} - -/* - * WhereDoIGoInTheStack() - * Given pWin and pSib and the relationshipe smode, return - * the window that pWin should go ABOVE. - * If a pSib is specified: - * Above: pWin is placed just above pSib - * Below: pWin is placed just below pSib - * TopIf: if pSib occludes pWin, then pWin is placed - * at the top of the stack - * BottomIf: if pWin occludes pSib, then pWin is - * placed at the bottom of the stack - * Opposite: if pSib occludes pWin, then pWin is placed at the - * top of the stack, else if pWin occludes pSib, then - * pWin is placed at the bottom of the stack - * - * If pSib is NULL: - * Above: pWin is placed at the top of the stack - * Below: pWin is placed at the bottom of the stack - * TopIf: if any sibling occludes pWin, then pWin is placed at - * the top of the stack - * BottomIf: if pWin occludes any sibline, then pWin is placed at - * the bottom of the stack - * Opposite: if any sibling occludes pWin, then pWin is placed at - * the top of the stack, else if pWin occludes any - * sibling, then pWin is placed at the bottom of the stack - * - */ - -static WindowPtr -WhereDoIGoInTheStack( - register WindowPtr pWin, - register WindowPtr pSib, - short x, - short y, - unsigned short w, - unsigned short h, - int smode) -{ - BoxRec box; - register ScreenPtr pScreen; - WindowPtr pHead, pFirst; - - if ((pWin == pWin->parent->firstChild) && - (pWin == pWin->parent->lastChild)) - return((WindowPtr ) NULL); - pHead = RealChildHead(pWin->parent); - pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild; - pScreen = pWin->drawable.pScreen; - box.x1 = x; - box.y1 = y; - box.x2 = x + (int)w; - box.y2 = y + (int)h; - switch (smode) - { - case Above: - if (pSib) - return(pSib); - else if (pWin == pFirst) - return(pWin->nextSib); - else - return(pFirst); - case Below: - if (pSib) - if (pSib->nextSib != pWin) - return(pSib->nextSib); - else - return(pWin->nextSib); - else - return NullWindow; - case TopIf: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if ((IsSiblingAboveMe(pWin, pSib) == Above) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) - return(pFirst); - else - return(pWin->nextSib); - } - else if (AnyWindowOverlapsMe(pWin, pHead, &box)) - return(pFirst); - else - return(pWin->nextSib); - case BottomIf: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if ((IsSiblingAboveMe(pWin, pSib) == Below) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) - return NullWindow; - else - return(pWin->nextSib); - } - else if (IOverlapAnyWindow(pWin, &box)) - return NullWindow; - else - return(pWin->nextSib); - case Opposite: - if ((!pWin->mapped || (pSib && !pSib->mapped)) && !permitOldBugs) - return(pWin->nextSib); - else if (pSib) - { - if (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT) - { - if (IsSiblingAboveMe(pWin, pSib) == Above) - return(pFirst); - else - return NullWindow; - } - else - return(pWin->nextSib); - } - else if (AnyWindowOverlapsMe(pWin, pHead, &box)) - { - /* If I'm occluded, I can't possibly be the first child - * if (pWin == pWin->parent->firstChild) - * return pWin->nextSib; - */ - return(pFirst); - } - else if (IOverlapAnyWindow(pWin, &box)) - return NullWindow; - else - return pWin->nextSib; - default: - { - ErrorF("Internal error in ConfigureWindow, smode == %d\n",smode ); - return pWin->nextSib; - } - } -} - -static void -ReflectStackChange( - register WindowPtr pWin, - register WindowPtr pSib, - VTKind kind) -{ -/* Note that pSib might be NULL */ - - Bool WasViewable = (Bool)pWin->viewable; - Bool anyMarked; - WindowPtr pFirstChange; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - ScreenPtr pScreen = pWin->drawable.pScreen; - - /* if this is a root window, can't be restacked */ - if (!pWin->parent) - return; - - pFirstChange = MoveWindowInStack(pWin, pSib); - - if (WasViewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, - &pLayerWin); - if (pLayerWin != pWin) pFirstChange = pLayerWin; -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pFirstChange); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstChange, kind); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pFirstChange); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pWin->drawable.pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstChange, kind); - } - if (pWin->realized) - WindowsRestructured (); -} - -/***** - * ConfigureWindow - *****/ - -int -ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientPtr client) -{ -#define RESTACK_WIN 0 -#define MOVE_WIN 1 -#define RESIZE_WIN 2 -#define REBORDER_WIN 3 - register WindowPtr pSib = NullWindow; - register WindowPtr pParent = pWin->parent; - Window sibwid = 0; - Mask index2, tmask; - register XID *pVlist; - short x, y, beforeX, beforeY; - unsigned short w = pWin->drawable.width, - h = pWin->drawable.height, - bw = pWin->borderWidth; - int action, smode = Above; -#ifdef XAPPGROUP - ClientPtr win_owner; - ClientPtr ag_leader = NULL; -#endif - xEvent event; - - if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask)) - return(BadMatch); - - if ((mask & CWSibling) && !(mask & CWStackMode)) - return(BadMatch); - - pVlist = vlist; - - if (pParent) - { - x = pWin->drawable.x - pParent->drawable.x - (int)bw; - y = pWin->drawable.y - pParent->drawable.y - (int)bw; - } - else - { - x = pWin->drawable.x; - y = pWin->drawable.y; - } - beforeX = x; - beforeY = y; - action = RESTACK_WIN; - if ((mask & (CWX | CWY)) && (!(mask & (CWHeight | CWWidth)))) - { - GET_INT16(CWX, x); - GET_INT16(CWY, y); - action = MOVE_WIN; - } - /* or should be resized */ - else if (mask & (CWX | CWY | CWWidth | CWHeight)) - { - GET_INT16(CWX, x); - GET_INT16(CWY, y); - GET_CARD16(CWWidth, w); - GET_CARD16 (CWHeight, h); - if (!w || !h) - { - client->errorValue = 0; - return BadValue; - } - action = RESIZE_WIN; - } - tmask = mask & ~ChangeMask; - while (tmask) - { - index2 = (Mask)lowbit (tmask); - tmask &= ~index2; - switch (index2) - { - case CWBorderWidth: - GET_CARD16(CWBorderWidth, bw); - break; - case CWSibling: - sibwid = (Window ) *pVlist; - pVlist++; - pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid, - RT_WINDOW, SecurityReadAccess); - if (!pSib) - { - client->errorValue = sibwid; - return(BadWindow); - } - if (pSib->parent != pParent) - return(BadMatch); - if (pSib == pWin) - return(BadMatch); - break; - case CWStackMode: - GET_CARD8(CWStackMode, smode); - if ((smode != TopIf) && (smode != BottomIf) && - (smode != Opposite) && (smode != Above) && (smode != Below)) - { - client->errorValue = smode; - return(BadValue); - } - break; - default: - client->errorValue = mask; - return(BadValue); - } - } - /* root really can't be reconfigured, so just return */ - if (!pParent) - return Success; - - /* Figure out if the window should be moved. Doesnt - make the changes to the window if event sent */ - - if (mask & CWStackMode) - pSib = WhereDoIGoInTheStack(pWin, pSib, pParent->drawable.x + x, - pParent->drawable.y + y, - w + (bw << 1), h + (bw << 1), smode); - else - pSib = pWin->nextSib; - -#ifdef XAPPGROUP - win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - ag_leader = XagLeader (win_owner); -#endif - - if ((!pWin->overrideRedirect) && - (RedirectSend(pParent) -#ifdef XAPPGROUP - || (win_owner->appgroup && ag_leader && - XagIsControlledRoot (client, pParent)) -#endif - )) - { - event.u.u.type = ConfigureRequest; - event.u.configureRequest.window = pWin->drawable.id; - if (mask & CWSibling) - event.u.configureRequest.sibling = sibwid; - else - event.u.configureRequest.sibling = None; - if (mask & CWStackMode) - event.u.u.detail = smode; - else - event.u.u.detail = Above; - event.u.configureRequest.x = x; - event.u.configureRequest.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureRequest.x += panoramiXdataPtr[0].x; - event.u.configureRequest.y += panoramiXdataPtr[0].y; - } -#endif - event.u.configureRequest.width = w; - event.u.configureRequest.height = h; - event.u.configureRequest.borderWidth = bw; - event.u.configureRequest.valueMask = mask; -#ifdef XAPPGROUP - /* make sure if the ag_leader maps the window it goes to the wm */ - if (ag_leader && ag_leader != client && - XagIsControlledRoot (client, pParent)) { - event.u.configureRequest.parent = XagId (win_owner); - (void) TryClientEvents (ag_leader, &event, 1, - NoEventMask, NoEventMask, NullGrab); - return Success; - } -#endif - event.u.configureRequest.parent = pParent->drawable.id; - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - if (action == RESIZE_WIN) - { - Bool size_change = (w != pWin->drawable.width) - || (h != pWin->drawable.height); - if (size_change && ((pWin->eventMask|wOtherEventMasks(pWin)) & ResizeRedirectMask)) - { - xEvent eventT; - eventT.u.u.type = ResizeRequest; - eventT.u.resizeRequest.window = pWin->drawable.id; - eventT.u.resizeRequest.width = w; - eventT.u.resizeRequest.height = h; - if (MaybeDeliverEventsToClient(pWin, &eventT, 1, - ResizeRedirectMask, client) == 1) - { - /* if event is delivered, leave the actual size alone. */ - w = pWin->drawable.width; - h = pWin->drawable.height; - size_change = FALSE; - } - } - if (!size_change) - { - if (mask & (CWX | CWY)) - action = MOVE_WIN; - else if (mask & (CWStackMode | CWBorderWidth)) - action = RESTACK_WIN; - else /* really nothing to do */ - return(Success) ; - } - } - - if (action == RESIZE_WIN) - /* we've already checked whether there's really a size change */ - goto ActuallyDoSomething; - if ((mask & CWX) && (x != beforeX)) - goto ActuallyDoSomething; - if ((mask & CWY) && (y != beforeY)) - goto ActuallyDoSomething; - if ((mask & CWBorderWidth) && (bw != wBorderWidth (pWin))) - goto ActuallyDoSomething; - if (mask & CWStackMode) - { -#ifndef ROOTLESS - /* See above for why we always reorder in rootless mode. */ - if (pWin->nextSib != pSib) -#endif - goto ActuallyDoSomething; - } - return(Success); - -ActuallyDoSomething: - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - if (pSib) - event.u.configureNotify.aboveSibling = pSib->drawable.id; - else - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = x; - event.u.configureNotify.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureNotify.x += panoramiXdataPtr[0].x; - event.u.configureNotify.y += panoramiXdataPtr[0].y; - } -#endif - event.u.configureNotify.width = w; - event.u.configureNotify.height = h; - event.u.configureNotify.borderWidth = bw; - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - if (mask & CWBorderWidth) - { - if (action == RESTACK_WIN) - { - action = MOVE_WIN; - pWin->borderWidth = bw; - } - else if ((action == MOVE_WIN) && - (beforeX + wBorderWidth (pWin) == x + (int)bw) && - (beforeY + wBorderWidth (pWin) == y + (int)bw)) - { - action = REBORDER_WIN; - (*pWin->drawable.pScreen->ChangeBorderWidth)(pWin, bw); - } - else - pWin->borderWidth = bw; - } - if (action == MOVE_WIN) - (*pWin->drawable.pScreen->MoveWindow)(pWin, x, y, pSib, - (mask & CWBorderWidth) ? VTOther : VTMove); - else if (action == RESIZE_WIN) - (*pWin->drawable.pScreen->ResizeWindow)(pWin, x, y, w, h, pSib); - else if (mask & CWStackMode) - ReflectStackChange(pWin, pSib, VTOther); - - if (action != RESTACK_WIN) - CheckCursorConfinement(pWin); - return(Success); -#undef RESTACK_WIN -#undef MOVE_WIN -#undef RESIZE_WIN -#undef REBORDER_WIN -} - - -/****** - * - * CirculateWindow - * For RaiseLowest, raises the lowest mapped child (if any) that is - * obscured by another child to the top of the stack. For LowerHighest, - * lowers the highest mapped child (if any) that is obscuring another - * child to the bottom of the stack. Exposure processing is performed - * - ******/ - -int -CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) -{ - register WindowPtr pWin, pHead, pFirst; - xEvent event; - BoxRec box; - - pHead = RealChildHead(pParent); - pFirst = pHead ? pHead->nextSib : pParent->firstChild; - if (direction == RaiseLowest) - { - for (pWin = pParent->lastChild; - (pWin != pHead) && - !(pWin->mapped && - AnyWindowOverlapsMe(pWin, pHead, WindowExtents(pWin, &box))); - pWin = pWin->prevSib) ; - if (pWin == pHead) - return Success; - } - else - { - for (pWin = pFirst; - pWin && - !(pWin->mapped && - IOverlapAnyWindow(pWin, WindowExtents(pWin, &box))); - pWin = pWin->nextSib) ; - if (!pWin) - return Success; - } - - event.u.circulate.window = pWin->drawable.id; - event.u.circulate.parent = pParent->drawable.id; - event.u.circulate.event = pParent->drawable.id; - if (direction == RaiseLowest) - event.u.circulate.place = PlaceOnTop; - else - event.u.circulate.place = PlaceOnBottom; - - if (RedirectSend(pParent)) - { - event.u.u.type = CirculateRequest; - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - - event.u.u.type = CirculateNotify; - DeliverEvents(pWin, &event, 1, NullWindow); - ReflectStackChange(pWin, - (direction == RaiseLowest) ? pFirst : NullWindow, - VTStack); - - return(Success); -} - -static int -CompareWIDs( - WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ -{ - Window *wid = (Window *)value; - - if (pWin->drawable.id == *wid) - return(WT_STOPWALKING); - else - return(WT_WALKCHILDREN); -} - -/***** - * ReparentWindow - *****/ - -int -ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, - int x, int y, ClientPtr client) -{ - WindowPtr pPrev, pPriorParent; - Bool WasMapped = (Bool)(pWin->mapped); - xEvent event; - int bw = wBorderWidth (pWin); - register ScreenPtr pScreen; - - pScreen = pWin->drawable.pScreen; - if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING) - return(BadMatch); - if (!MakeWindowOptional(pWin)) - return(BadAlloc); - - if (WasMapped) - UnmapWindow(pWin, FALSE); - - event.u.u.type = ReparentNotify; - event.u.reparent.window = pWin->drawable.id; - event.u.reparent.parent = pParent->drawable.id; - event.u.reparent.x = x; - event.u.reparent.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pParent->parent) { - event.u.reparent.x += panoramiXdataPtr[0].x; - event.u.reparent.y += panoramiXdataPtr[0].y; - } -#endif - event.u.reparent.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, pParent); - - /* take out of sibling chain */ - - pPriorParent = pPrev = pWin->parent; - if (pPrev->firstChild == pWin) - pPrev->firstChild = pWin->nextSib; - if (pPrev->lastChild == pWin) - pPrev->lastChild = pWin->prevSib; - - if (pWin->nextSib) - pWin->nextSib->prevSib = pWin->prevSib; - if (pWin->prevSib) - pWin->prevSib->nextSib = pWin->nextSib; - - /* insert at begining of pParent */ - pWin->parent = pParent; - pPrev = RealChildHead(pParent); - if (pPrev) - { - pWin->nextSib = pPrev->nextSib; - if (pPrev->nextSib) - pPrev->nextSib->prevSib = pWin; - else - pParent->lastChild = pWin; - pPrev->nextSib = pWin; - pWin->prevSib = pPrev; - } - else - { - pWin->nextSib = pParent->firstChild; - pWin->prevSib = NullWindow; - if (pParent->firstChild) - pParent->firstChild->prevSib = pWin; - else - pParent->lastChild = pWin; - pParent->firstChild = pWin; - } - - pWin->origin.x = x + bw; - pWin->origin.y = y + bw; - pWin->drawable.x = x + bw + pParent->drawable.x; - pWin->drawable.y = y + bw + pParent->drawable.y; - - /* clip to parent */ - SetWinSize (pWin); - SetBorderSize (pWin); - - if (pScreen->ReparentWindow) - (*pScreen->ReparentWindow)(pWin, pPriorParent); - (*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y); - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - CheckWindowOptionalNeed(pWin); - - if (WasMapped) - MapWindow(pWin, client); - RecalculateDeliverableEvents(pWin); - return(Success); -} - -static void -RealizeTree(WindowPtr pWin) -{ - register WindowPtr pChild; - RealizeWindowProcPtr Realize; - - Realize = pWin->drawable.pScreen->RealizeWindow; - pChild = pWin; - while (1) - { - if (pChild->mapped) - { - pChild->realized = TRUE; -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder) - deltaSaveUndersViewable++; -#endif - pChild->viewable = (pChild->drawable.class == InputOutput); - (* Realize)(pChild); - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - return; - pChild = pChild->nextSib; - } -} - -/***** - * MapWindow - * If some other client has selected SubStructureReDirect on the parent - * and override-redirect is xFalse, then a MapRequest event is generated, - * but the window remains unmapped. Otherwise, the window is mapped and a - * MapNotify event is generated. - *****/ - -int -MapWindow(register WindowPtr pWin, ClientPtr client) -{ - register ScreenPtr pScreen; - - register WindowPtr pParent; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - if (pWin->mapped) - return(Success); - -#ifdef XCSECURITY - /* don't let an untrusted client map a child-of-trusted-window, InputOnly - * window; too easy to steal device input - */ - if ( (client->trustLevel != XSecurityClientTrusted) && - (pWin->drawable.class == InputOnly) && - (wClient(pWin->parent)->trustLevel == XSecurityClientTrusted) ) - return Success; -#endif - - pScreen = pWin->drawable.pScreen; - if ( (pParent = pWin->parent) ) - { - xEvent event; - Bool anyMarked; -#ifdef XAPPGROUP - ClientPtr win_owner = clients[CLIENT_ID(pWin->drawable.id)]; - ClientPtr ag_leader = XagLeader (win_owner); -#endif - - if ((!pWin->overrideRedirect) && - (RedirectSend(pParent) -#ifdef XAPPGROUP - || (win_owner->appgroup && ag_leader && - XagIsControlledRoot (client, pParent)) -#endif - )) - { - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; -#ifdef XAPPGROUP - /* make sure if the ag_leader maps the window it goes to the wm */ - if (ag_leader && ag_leader != client && - XagIsControlledRoot (client, pParent)) { - event.u.mapRequest.parent = XagId (win_owner); - (void) TryClientEvents (ag_leader, &event, 1, - NoEventMask, NoEventMask, NullGrab); - return Success; - } -#endif - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - return(Success); - } - - pWin->mapped = TRUE; - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - if (!pParent->realized) - return(Success); - RealizeTree(pWin); - if (pWin->viewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTMap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, VTMap); - } - WindowsRestructured (); - } - else - { - RegionRec temp; - - pWin->mapped = TRUE; - pWin->realized = TRUE; /* for roots */ - pWin->viewable = pWin->drawable.class == InputOutput; - /* We SHOULD check for an error value here XXX */ - (*pScreen->RealizeWindow)(pWin); - if (pScreen->ClipNotify) - (*pScreen->ClipNotify) (pWin, 0, 0); - if (pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(NullWindow, pWin, VTMap); - REGION_NULL(pScreen, &temp); - REGION_COPY(pScreen, &temp, &pWin->clipList); - (*pScreen->WindowExposures) (pWin, &temp, NullRegion); - REGION_UNINIT(pScreen, &temp); - } - - return(Success); -} - - -/***** - * MapSubwindows - * Performs a MapWindow all unmapped children of the window, in top - * to bottom stacking order. - *****/ - -void -MapSubwindows(register WindowPtr pParent, ClientPtr client) -{ - register WindowPtr pWin; - WindowPtr pFirstMapped = NullWindow; -#ifdef DO_SAVE_UNDERS - WindowPtr pFirstSaveUndered = NullWindow; -#endif - register ScreenPtr pScreen; - register Mask parentRedirect; - register Mask parentNotify; - xEvent event; - Bool anyMarked; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif - WindowPtr pLayerWin; - - pScreen = pParent->drawable.pScreen; - parentRedirect = RedirectSend(pParent); - parentNotify = SubSend(pParent); - anyMarked = FALSE; - for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) - { - if (!pWin->mapped) - { - if (parentRedirect && !pWin->overrideRedirect) - { - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, client) == 1) - continue; - } - - pWin->mapped = TRUE; - if (parentNotify || StrSend(pWin)) - { - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } - - if (!pFirstMapped) - pFirstMapped = pWin; - if (pParent->realized) - { - RealizeTree(pWin); - if (pWin->viewable) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - (WindowPtr *)NULL); -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = TRUE; - } -#endif /* DO_SAVE_UNDERS */ - } - } - } - } - - if (pFirstMapped) - { - pLayerWin = (*pScreen->GetLayerWindow)(pParent); - if (pLayerWin->parent != pParent) { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pLayerWin, - pLayerWin, - (WindowPtr *)NULL); - pFirstMapped = pLayerWin; - } - if (anyMarked) - { -#ifdef DO_SAVE_UNDERS - if (pLayerWin->parent != pParent) - { - if (dosave || (DO_SAVE_UNDERS(pLayerWin))) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, - pLayerWin); - } - } - else if (dosave) - { - dosave = FALSE; - for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) - { - if (DO_SAVE_UNDERS(pWin)) - { - dosave |= (*pScreen->ChangeSaveUnder)(pWin, - pWin->nextSib); - if (dosave && !pFirstSaveUndered) - pFirstSaveUndered = pWin; - } - } - } -#endif /* DO_SAVE_UNDERS */ - (*pScreen->ValidateTree)(pLayerWin->parent, pFirstMapped, VTMap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, - pFirstSaveUndered->nextSib); -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pFirstMapped, - VTMap); - WindowsRestructured (); - } -} - -static void -UnrealizeTree( - WindowPtr pWin, - Bool fromConfigure) -{ - register WindowPtr pChild; - UnrealizeWindowProcPtr Unrealize; - MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; - - Unrealize = pWin->drawable.pScreen->UnrealizeWindow; - MarkUnrealizedWindow = pWin->drawable.pScreen->MarkUnrealizedWindow; - pChild = pWin; - while (1) - { - if (pChild->realized) - { - pChild->realized = FALSE; - pChild->visibility = VisibilityNotViewable; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) { - PanoramiXRes *win; - win = (PanoramiXRes*)LookupIDByType(pChild->drawable.id, - XRT_WINDOW); - if(win) - win->u.win.visibility = VisibilityNotViewable; - } -#endif - (* Unrealize)(pChild); - DeleteWindowFromAnyEvents(pChild, FALSE); - if (pChild->viewable) - { -#ifdef DO_SAVE_UNDERS - if (pChild->saveUnder) - deltaSaveUndersViewable--; -#endif - pChild->viewable = FALSE; - if (pChild->backStorage) - (*pChild->drawable.pScreen->SaveDoomedAreas)( - pChild, &pChild->clipList, 0, 0); - (* MarkUnrealizedWindow)(pChild, pWin, fromConfigure); - pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - if (pChild->firstChild) - { - pChild = pChild->firstChild; - continue; - } - } - while (!pChild->nextSib && (pChild != pWin)) - pChild = pChild->parent; - if (pChild == pWin) - return; - pChild = pChild->nextSib; - } -} - -/***** - * UnmapWindow - * If the window is already unmapped, this request has no effect. - * Otherwise, the window is unmapped and an UnMapNotify event is - * generated. Cannot unmap a root window. - *****/ - -int -UnmapWindow(register WindowPtr pWin, Bool fromConfigure) -{ - register WindowPtr pParent; - xEvent event; - Bool wasRealized = (Bool)pWin->realized; - Bool wasViewable = (Bool)pWin->viewable; - ScreenPtr pScreen = pWin->drawable.pScreen; - WindowPtr pLayerWin = pWin; - - if ((!pWin->mapped) || (!(pParent = pWin->parent))) - return(Success); - if (SubStrSend(pWin, pParent)) - { - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pWin->drawable.id; - event.u.unmapNotify.fromConfigure = fromConfigure; - DeliverEvents(pWin, &event, 1, NullWindow); - } - if (wasViewable && !fromConfigure) - { - pWin->valdata = UnmapValData; - (*pScreen->MarkOverlappedWindows)(pWin, pWin->nextSib, &pLayerWin); - (*pScreen->MarkWindow)(pLayerWin->parent); - } - pWin->mapped = FALSE; - if (wasRealized) - UnrealizeTree(pWin, fromConfigure); - if (wasViewable) - { - if (!fromConfigure) - { - (*pScreen->ValidateTree)(pLayerWin->parent, pWin, VTUnmap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pWin->nextSib) ) - { - (*pScreen->PostChangeSaveUnder)(pLayerWin, pWin->nextSib); - } - } - pWin->DIXsaveUnder = FALSE; -#endif /* DO_SAVE_UNDERS */ - if (!fromConfigure && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pWin, VTUnmap); - } - if (wasRealized && !fromConfigure) - WindowsRestructured (); - return(Success); -} - -/***** - * UnmapSubwindows - * Performs an UnmapWindow request with the specified mode on all mapped - * children of the window, in bottom to top stacking order. - *****/ - -void -UnmapSubwindows(register WindowPtr pWin) -{ - register WindowPtr pChild, pHead; - xEvent event; - Bool wasRealized = (Bool)pWin->realized; - Bool wasViewable = (Bool)pWin->viewable; - Bool anyMarked = FALSE; - Mask parentNotify; - WindowPtr pLayerWin = NULL; - ScreenPtr pScreen = pWin->drawable.pScreen; - - if (!pWin->firstChild) - return; - parentNotify = SubSend(pWin); - pHead = RealChildHead(pWin); - - if (wasViewable) - pLayerWin = (*pScreen->GetLayerWindow)(pWin); - - for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) - { - if (pChild->mapped) - { - if (parentNotify || StrSend(pChild)) - { - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pChild->drawable.id; - event.u.unmapNotify.fromConfigure = xFalse; - DeliverEvents(pChild, &event, 1, NullWindow); - } - if (pChild->viewable) - { - pChild->valdata = UnmapValData; - anyMarked = TRUE; - } - pChild->mapped = FALSE; - if (pChild->realized) - UnrealizeTree(pChild, FALSE); - if (wasViewable) - { -#ifdef DO_SAVE_UNDERS - pChild->DIXsaveUnder = FALSE; -#endif /* DO_SAVE_UNDERS */ - if (pChild->backStorage) - (*pScreen->SaveDoomedAreas)( - pChild, &pChild->clipList, 0, 0); - } - } - } - if (wasViewable) - { - if (anyMarked) - { - if (pLayerWin->parent == pWin) - (*pScreen->MarkWindow)(pWin); - else - { - WindowPtr ptmp; - (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin, - (WindowPtr *)NULL); - (*pScreen->MarkWindow)(pLayerWin->parent); - - /* Windows between pWin and pLayerWin may not have been marked */ - ptmp = pWin; - - while (ptmp != pLayerWin->parent) - { - (*pScreen->MarkWindow)(ptmp); - ptmp = ptmp->parent; - } - pHead = pWin->firstChild; - } - (*pScreen->ValidateTree)(pLayerWin->parent, pHead, VTUnmap); - (*pScreen->HandleExposures)(pLayerWin->parent); - } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - if ( (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin)) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, pHead, VTUnmap); - } - if (wasRealized) - WindowsRestructured (); -} - - -void -HandleSaveSet(register ClientPtr client) -{ - register WindowPtr pParent, pWin; - register int j; - - for (j=0; jnumSaved; j++) - { - pWin = SaveSetWindow(client->saveSet[j]); -#ifdef XFIXES - if (SaveSetToRoot(client->saveSet[j])) - pParent = WindowTable[pWin->drawable.pScreen->myNum]; - else -#endif - { - pParent = pWin->parent; - while (pParent && (wClient (pParent) == client)) - pParent = pParent->parent; - } - if (pParent) - { - if (pParent != pWin->parent) - { - ReparentWindow(pWin, pParent, - pWin->drawable.x - wBorderWidth (pWin) - pParent->drawable.x, - pWin->drawable.y - wBorderWidth (pWin) - pParent->drawable.y, - client); - if(!pWin->realized && pWin->mapped) - pWin->mapped = FALSE; - } -#ifdef XFIXES - if (SaveSetRemap (client->saveSet[j])) -#endif - MapWindow(pWin, client); - } - } - xfree(client->saveSet); - client->numSaved = 0; - client->saveSet = (SaveSetElt *)NULL; -} - -/** - * - * \param x,y in root - * \param box "return" value - */ -Bool -VisibleBoundingBoxFromPoint(register WindowPtr pWin, int x, int y, BoxPtr box) -{ - if (!pWin->realized) - return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box)) - return(TRUE); - return(FALSE); -} - -/** - * - * \param x,y in root - */ -Bool -PointInWindowIsVisible(register WindowPtr pWin, int x, int y) -{ - BoxRec box; - - if (!pWin->realized) - return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip, - x, y, &box) - && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, - wInputShape(pWin), - x - pWin->drawable.x, - y - pWin->drawable.y, &box))) - return(TRUE); - return(FALSE); -} - - -RegionPtr -NotClippedByChildren(register WindowPtr pWin) -{ - register ScreenPtr pScreen; - RegionPtr pReg; - - pScreen = pWin->drawable.pScreen; - pReg = REGION_CREATE(pScreen, NullBox, 1); - if (pWin->parent || - screenIsSaved != SCREEN_SAVER_ON || - !HasSaverWindow (pWin->drawable.pScreen->myNum)) - { - REGION_INTERSECT(pScreen, pReg, &pWin->borderClip, &pWin->winSize); - } - return(pReg); -} - -void -SendVisibilityNotify(WindowPtr pWin) -{ - xEvent event; -#ifndef NO_XINERAMA_PORT - unsigned int visibility = pWin->visibility; -#endif -#ifdef PANORAMIX - /* This is not quite correct yet, but it's close */ - if(!noPanoramiXExtension) { - PanoramiXRes *win; - WindowPtr pWin2; - int i, Scrnum; - - Scrnum = pWin->drawable.pScreen->myNum; - - win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, Scrnum); - - if(!win || (win->u.win.visibility == visibility)) - return; - - switch(visibility) { - case VisibilityUnobscured: - for(i = 0; i < PanoramiXNumScreens; i++) { - if(i == Scrnum) continue; - - pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); - - if (pWin2) { - if(pWin2->visibility == VisibilityPartiallyObscured) - return; - - if(!i) pWin = pWin2; - } - } - break; - case VisibilityPartiallyObscured: - if(Scrnum) { - pWin2 = (WindowPtr)LookupIDByType(win->info[0].id, RT_WINDOW); - if (pWin2) pWin = pWin2; - } - break; - case VisibilityFullyObscured: - for(i = 0; i < PanoramiXNumScreens; i++) { - if(i == Scrnum) continue; - - pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); - - if (pWin2) { - if(pWin2->visibility != VisibilityFullyObscured) - return; - - if(!i) pWin = pWin2; - } - } - break; - } - - win->u.win.visibility = visibility; - } -#endif - - event.u.u.type = VisibilityNotify; - event.u.visibility.window = pWin->drawable.id; - event.u.visibility.state = visibility; - DeliverEvents(pWin, &event, 1, NullWindow); -} - - -#define RANDOM_WIDTH 32 - -#ifndef NOLOGOHACK -static void DrawLogo( - WindowPtr pWin -); -#endif - -void -SaveScreens(int on, int mode) -{ - int i; - int what; - int type; - - if (on == SCREEN_SAVER_FORCER) - { - UpdateCurrentTimeIf(); - lastDeviceEventTime = currentTime; - if (mode == ScreenSaverReset) - what = SCREEN_SAVER_OFF; - else - what = SCREEN_SAVER_ON; - type = what; - } - else - { - what = on; - type = what; - if (what == screenIsSaved) - type = SCREEN_SAVER_CYCLE; - } - for (i = 0; i < screenInfo.numScreens; i++) - { - if (on == SCREEN_SAVER_FORCER) - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], on); - if (savedScreenInfo[i].ExternalScreenSaver) - { - if ((*savedScreenInfo[i].ExternalScreenSaver) - (screenInfo.screens[i], type, on == SCREEN_SAVER_FORCER)) - continue; - } - if (type == screenIsSaved) - continue; - switch (type) { - case SCREEN_SAVER_OFF: - if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED) - { - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], - what); - } - else if (HasSaverWindow (i)) - { - savedScreenInfo[i].pWindow = NullWindow; - FreeResource(savedScreenInfo[i].wid, RT_NONE); - } - break; - case SCREEN_SAVER_CYCLE: - if (savedScreenInfo[i].blanked == SCREEN_IS_TILED) - { - WindowPtr pWin = savedScreenInfo[i].pWindow; - /* make it look like screen saver is off, so that - * NotClippedByChildren will compute a clip list - * for the root window, so miPaintWindow works - */ - screenIsSaved = SCREEN_SAVER_OFF; -#ifndef NOLOGOHACK - if (logoScreenSaver) - (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, FALSE); -#endif - (*pWin->drawable.pScreen->MoveWindow)(pWin, - (short)(-(rand() % RANDOM_WIDTH)), - (short)(-(rand() % RANDOM_WIDTH)), - pWin->nextSib, VTMove); -#ifndef NOLOGOHACK - if (logoScreenSaver) - DrawLogo(pWin); -#endif - screenIsSaved = SCREEN_SAVER_ON; - } - /* - * Call the DDX saver in case it wants to do something - * at cycle time - */ - else if (savedScreenInfo[i].blanked == SCREEN_IS_BLANKED) - { - (* screenInfo.screens[i]->SaveScreen) (screenInfo.screens[i], - type); - } - break; - case SCREEN_SAVER_ON: - if (ScreenSaverBlanking != DontPreferBlanking) - { - if ((* screenInfo.screens[i]->SaveScreen) - (screenInfo.screens[i], what)) - { - savedScreenInfo[i].blanked = SCREEN_IS_BLANKED; - continue; - } - if ((ScreenSaverAllowExposures != DontAllowExposures) && - TileScreenSaver(i, SCREEN_IS_BLACK)) - { - savedScreenInfo[i].blanked = SCREEN_IS_BLACK; - continue; - } - } - if ((ScreenSaverAllowExposures != DontAllowExposures) && - TileScreenSaver(i, SCREEN_IS_TILED)) - { - savedScreenInfo[i].blanked = SCREEN_IS_TILED; - } - else - savedScreenInfo[i].blanked = SCREEN_ISNT_SAVED; - break; - } - } - screenIsSaved = what; - if (mode == ScreenSaverReset) - SetScreenSaverTimer(); -} - -static Bool -TileScreenSaver(int i, int kind) -{ - int j; - int result; - XID attributes[3]; - Mask mask; - WindowPtr pWin; - CursorMetricRec cm; - unsigned char *srcbits, *mskbits; - CursorPtr cursor; - XID cursorID = 0; - int attri; - - mask = 0; - attri = 0; - switch (kind) { - case SCREEN_IS_TILED: - switch (WindowTable[i]->backgroundState) { - case BackgroundPixel: - attributes[attri++] = WindowTable[i]->background.pixel; - mask |= CWBackPixel; - break; - case BackgroundPixmap: - attributes[attri++] = None; - mask |= CWBackPixmap; - break; - default: - break; - } - break; - case SCREEN_IS_BLACK: - attributes[attri++] = WindowTable[i]->drawable.pScreen->blackPixel; - mask |= CWBackPixel; - break; - } - mask |= CWOverrideRedirect; - attributes[attri++] = xTrue; - - /* - * create a blank cursor - */ - - cm.width=16; - cm.height=16; - cm.xhot=8; - cm.yhot=8; - srcbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); - mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); - if (!srcbits || !mskbits) - { - xfree(srcbits); - xfree(mskbits); - cursor = 0; - } - else - { - for (j=0; jwidth + RANDOM_WIDTH, - (unsigned short)screenInfo.screens[i]->height + RANDOM_WIDTH, - 0, InputOutput, mask, attributes, 0, serverClient, - wVisual (WindowTable[i]), &result); - - if (cursor) - FreeResource (cursorID, RT_NONE); - - if (!pWin) - return FALSE; - - if (!AddResource(pWin->drawable.id, RT_WINDOW, - (pointer)savedScreenInfo[i].pWindow)) - return FALSE; - - if (mask & CWBackPixmap) - { - MakeRootTile (pWin); - (*pWin->drawable.pScreen->ChangeWindowAttributes)(pWin, CWBackPixmap); - } - MapWindow(pWin, serverClient); -#ifndef NOLOGOHACK - if (kind == SCREEN_IS_TILED && logoScreenSaver) - DrawLogo(pWin); -#endif - return TRUE; -} - -/* - * FindWindowWithOptional - * - * search ancestors of the given window for an entry containing - * a WindowOpt structure. Assumptions: some parent will - * contain the structure. - */ - -WindowPtr -FindWindowWithOptional (register WindowPtr w) -{ - do - w = w->parent; - while (!w->optional); - return w; -} - -/* - * CheckWindowOptionalNeed - * - * check each optional entry in the given window to see if - * the value is satisfied by the default rules. If so, - * release the optional record - */ - -void -CheckWindowOptionalNeed (register WindowPtr w) -{ - register WindowOptPtr optional; - register WindowOptPtr parentOptional; - - if (!w->parent) - return; - optional = w->optional; - if (optional->dontPropagateMask != DontPropagateMasks[w->dontPropagate]) - return; - if (optional->otherEventMasks != 0) - return; - if (optional->otherClients != NULL) - return; - if (optional->passiveGrabs != NULL) - return; - if (optional->userProps != NULL) - return; - if (optional->backingBitPlanes != ~0L) - return; - if (optional->backingPixel != 0) - return; -#ifdef SHAPE - if (optional->boundingShape != NULL) - return; - if (optional->clipShape != NULL) - return; - if (optional->inputShape != NULL) - return; -#endif -#ifdef XINPUT - if (optional->inputMasks != NULL) - return; -#endif - parentOptional = FindWindowWithOptional(w)->optional; - if (optional->visual != parentOptional->visual) - return; - if (optional->cursor != None && - (optional->cursor != parentOptional->cursor || - w->parent->cursorIsNone)) - return; - if (optional->colormap != parentOptional->colormap) - return; - DisposeWindowOptional (w); -} - -/* - * MakeWindowOptional - * - * create an optional record and initialize it with the default - * values. - */ - -Bool -MakeWindowOptional (register WindowPtr pWin) -{ - register WindowOptPtr optional; - register WindowOptPtr parentOptional; - - if (pWin->optional) - return TRUE; - optional = (WindowOptPtr) xalloc (sizeof (WindowOptRec)); - if (!optional) - return FALSE; - optional->dontPropagateMask = DontPropagateMasks[pWin->dontPropagate]; - optional->otherEventMasks = 0; - optional->otherClients = NULL; - optional->passiveGrabs = NULL; - optional->userProps = NULL; - optional->backingBitPlanes = ~0L; - optional->backingPixel = 0; -#ifdef SHAPE - optional->boundingShape = NULL; - optional->clipShape = NULL; - optional->inputShape = NULL; -#endif -#ifdef XINPUT - optional->inputMasks = NULL; -#endif - parentOptional = FindWindowWithOptional(pWin)->optional; - optional->visual = parentOptional->visual; - if (!pWin->cursorIsNone) - { - optional->cursor = parentOptional->cursor; - optional->cursor->refcnt++; - } - else - { - optional->cursor = None; - } - optional->colormap = parentOptional->colormap; - pWin->optional = optional; - return TRUE; -} - -void -DisposeWindowOptional (register WindowPtr pWin) -{ - if (!pWin->optional) - return; - /* - * everything is peachy. Delete the optional record - * and clean up - */ - /* - * TOG changed this code to: - * - * if (pWin->cursorIsNone == FALSE) - * FreeCursor (pWin->optional->cursor, (Cursor)0); - * pWin->cursorIsNone = TRUE; - * - * This is blatently wrong; windows without optionals can have - * two different cursor values, either None or sharing their - * parents cursor. This difference is controlled by the - * cursorIsNone value; when TRUE, the window has no cursor, - * when false, it shares its cursor with its parent; TOG - * made it impossible for a window to have a cursor without - * an optional record. - */ - if (pWin->optional->cursor) - { - FreeCursor (pWin->optional->cursor, (Cursor)0); - pWin->cursorIsNone = FALSE; - } - else - pWin->cursorIsNone = TRUE; - xfree (pWin->optional); - pWin->optional = NULL; -} - -#ifndef NOLOGOHACK -static void -DrawLogo(WindowPtr pWin) -{ - DrawablePtr pDraw; - ScreenPtr pScreen; - int x, y; - unsigned int width, height, size; - GC *pGC; - int thin, gap, d31; - DDXPointRec poly[4]; - ChangeGCVal fore[2], back[2]; - xrgb rgb[2]; - BITS32 fmask, bmask; - ColormapPtr cmap; - - pDraw = (DrawablePtr)pWin; - pScreen = pDraw->pScreen; - x = -pWin->origin.x; - y = -pWin->origin.y; - width = pScreen->width; - height = pScreen->height; - pGC = GetScratchGC(pScreen->rootDepth, pScreen); - if (!pGC) - return; - - if ((rand() % 100) <= 17) /* make the probability for white fairly low */ - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; - if ((pWin->backgroundState == BackgroundPixel) && - (cmap = (ColormapPtr)LookupIDByType(wColormap (pWin), RT_COLORMAP))) { - Pixel querypixels[2]; - - querypixels[0] = fore[0].val; - querypixels[1] = pWin->background.pixel; - QueryColors(cmap, 2, querypixels, rgb); - if ((rgb[0].red == rgb[1].red) && - (rgb[0].green == rgb[1].green) && - (rgb[0].blue == rgb[1].blue)) { - if (fore[0].val == pScreen->blackPixel) - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; - } - } - fore[1].val = FillSolid; - fmask = GCForeground|GCFillStyle; - if (pWin->backgroundState == BackgroundPixel) { - back[0].val = pWin->background.pixel; - back[1].val = FillSolid; - bmask = GCForeground|GCFillStyle; - } else { - back[0].val = 0; - back[1].val = 0; - dixChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, - NULL, back); - back[0].val = FillTiled; - back[1].ptr = pWin->background.pixmap; - bmask = GCFillStyle|GCTile; - } - - /* should be the same as the reference function XmuDrawLogo() */ - - size = width; - if (height < width) - size = height; - size = RANDOM_WIDTH + rand() % (size - RANDOM_WIDTH); - size &= ~1; - x += rand() % (width - size); - y += rand() % (height - size); - -/* - * Draw what will be the thin strokes. - * - * ----- - * / / - * / / - * / / - * / / - * /____/ - * d - * - * Point d is 9/44 (~1/5) of the way across. - */ - - thin = (size / 11); - if (thin < 1) thin = 1; - gap = (thin+3) / 4; - d31 = thin + thin + gap; - poly[0].x = x + size; poly[0].y = y; - poly[1].x = x + size-d31; poly[1].y = y; - poly[2].x = x + 0; poly[2].y = y + size; - poly[3].x = x + d31; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, fmask, NULL, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for lower thin stroke. - * - * ------ - * / / - * / __ / - * / / / - * / / / - * /__/__/ - */ - - poly[0].x = x + d31/2; poly[0].y = y + size; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + d31; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, bmask, NULL, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for upper thin stroke. - * - * ------ - * / / / - * /--/ / - * / / - * / / - * /_____/ - */ - - poly[0].x = x + size - d31/2; poly[0].y = y; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + size - d31; poly[3].y = y; - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Draw thick stroke. - * Point b is 1/4 of the way across. - * - * b - * ----- - * \ \ - * \ \ - * \ \ - * \ \ - * \____\ - */ - - poly[0].x = x; poly[0].y = y; - poly[1].x = x + size/4; poly[1].y = y; - poly[2].x = x + size; poly[2].y = y + size; - poly[3].x = x + size - size/4; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, fmask, NULL, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase to create gap. - * - * / - * / - * / - * / - * / - */ - - poly[0].x = x + size- thin; poly[0].y = y; - poly[1].x = x + size-( thin+gap); poly[1].y = y; - poly[2].x = x + thin; poly[2].y = y + size; - poly[3].x = x + thin + gap; poly[3].y = y + size; - dixChangeGC(NullClient, pGC, bmask, NULL, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - - FreeScratchGC(pGC); -} - -#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original deleted file mode 100644 index f6dad312a..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original +++ /dev/null @@ -1,2286 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* $XdotOrg: xc/programs/Xserver/Xext/xvdisp.c,v 1.6 2005/07/03 08:53:36 daniels Exp $ */ -/*********************************************************** -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, -and the Massachusetts Institute of Technology, Cambridge, 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 names of Digital or MIT not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.27 2003/07/16 01:38:31 dawes Exp $ */ - -/* -** File: -** -** xvdisp.c --- Xv server extension dispatch module. -** -** Author: -** -** David Carver (Digital Workstation Engineering/Project Athena) -** -** Revisions: -** -** 11.06.91 Carver -** - changed SetPortControl to SetPortAttribute -** - changed GetPortControl to GetPortAttribute -** - changed QueryBestSize -** -** 15.05.91 Carver -** - version 2.0 upgrade -** -** 24.01.91 Carver -** - version 1.4 upgrade -** -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "dixstruct.h" -#include "resource.h" -#include "opaque.h" - -#include -#include -#include "xvdix.h" -#ifdef MITSHM -#define _XSHM_SERVER_ -#include -#endif - -#include "Trap.h" - -#undef TEST -#undef DEBUG - -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#include "xvdisp.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - -unsigned long XvXRTPort; - -#ifdef MITSHM -static int XineramaXvShmPutImage(ClientPtr); -#endif -static int XineramaXvPutImage(ClientPtr); -static int XineramaXvPutVideo(ClientPtr); -static int XineramaXvPutStill(ClientPtr); -static int XineramaXvSetPortAttribute(ClientPtr); -static int XineramaXvStopVideo(ClientPtr); -#endif - -/* INTERNAL */ - -static int ProcXvQueryExtension(ClientPtr); -static int ProcXvQueryAdaptors(ClientPtr); -static int ProcXvQueryEncodings(ClientPtr); -static int ProcXvPutVideo(ClientPtr); -static int ProcXvPutStill(ClientPtr); -static int ProcXvGetVideo(ClientPtr); -static int ProcXvGetStill(ClientPtr); -static int ProcXvGrabPort(ClientPtr); -static int ProcXvUngrabPort(ClientPtr); -static int ProcXvSelectVideoNotify(ClientPtr); -static int ProcXvSelectPortNotify(ClientPtr); -static int ProcXvStopVideo(ClientPtr); -static int ProcXvSetPortAttribute(ClientPtr); -static int ProcXvGetPortAttribute(ClientPtr); -static int ProcXvQueryBestSize(ClientPtr); -static int ProcXvQueryPortAttributes(ClientPtr); -static int ProcXvPutImage(ClientPtr); -#ifdef MITSHM -static int ProcXvShmPutImage(ClientPtr); -#endif -static int ProcXvQueryImageAttributes(ClientPtr); -static int ProcXvListImageFormats(ClientPtr); - -static int SProcXvQueryExtension(ClientPtr); -static int SProcXvQueryAdaptors(ClientPtr); -static int SProcXvQueryEncodings(ClientPtr); -static int SProcXvPutVideo(ClientPtr); -static int SProcXvPutStill(ClientPtr); -static int SProcXvGetVideo(ClientPtr); -static int SProcXvGetStill(ClientPtr); -static int SProcXvGrabPort(ClientPtr); -static int SProcXvUngrabPort(ClientPtr); -static int SProcXvSelectVideoNotify(ClientPtr); -static int SProcXvSelectPortNotify(ClientPtr); -static int SProcXvStopVideo(ClientPtr); -static int SProcXvSetPortAttribute(ClientPtr); -static int SProcXvGetPortAttribute(ClientPtr); -static int SProcXvQueryBestSize(ClientPtr); -static int SProcXvQueryPortAttributes(ClientPtr); -static int SProcXvPutImage(ClientPtr); -#ifdef MITSHM -static int SProcXvShmPutImage(ClientPtr); -#endif -static int SProcXvQueryImageAttributes(ClientPtr); -static int SProcXvListImageFormats(ClientPtr); - -static int SWriteQueryAdaptorsReply(ClientPtr, xvQueryAdaptorsReply *); -static int SWriteQueryExtensionReply(ClientPtr, xvQueryExtensionReply *); -static int SWriteQueryEncodingsReply(ClientPtr, xvQueryEncodingsReply *); -static int SWriteAdaptorInfo(ClientPtr, xvAdaptorInfo *); -static int SWriteEncodingInfo(ClientPtr, xvEncodingInfo *); -static int SWriteFormat(ClientPtr, xvFormat *); -static int SWriteAttributeInfo(ClientPtr, xvAttributeInfo *); -static int SWriteGrabPortReply(ClientPtr, xvGrabPortReply *); -static int SWriteGetPortAttributeReply(ClientPtr, xvGetPortAttributeReply *); -static int SWriteQueryBestSizeReply(ClientPtr, xvQueryBestSizeReply *); -static int SWriteQueryPortAttributesReply( - ClientPtr, xvQueryPortAttributesReply *); -static int SWriteQueryImageAttributesReply( - ClientPtr, xvQueryImageAttributesReply*); -static int SWriteListImageFormatsReply(ClientPtr, xvListImageFormatsReply*); -static int SWriteImageFormatInfo(ClientPtr, xvImageFormatInfo*); - -#define _WriteQueryAdaptorsReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryAdaptorsReply, (char*)_d) - -#define _WriteQueryExtensionReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryExtensionReply, (char*)_d) - -#define _WriteQueryEncodingsReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryEncodingsReply, (char*)_d) - -#define _WriteAdaptorInfo(_c,_d) \ - if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAdaptorInfo, (char*)_d) - -#define _WriteAttributeInfo(_c,_d) \ - if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAttributeInfo, (char*)_d) - -#define _WriteEncodingInfo(_c,_d) \ - if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \ - else WriteToClient(_c, sz_xvEncodingInfo, (char*)_d) - -#define _WriteFormat(_c,_d) \ - if ((_c)->swapped) SWriteFormat(_c, _d); \ - else WriteToClient(_c, sz_xvFormat, (char*)_d) - -#define _WriteGrabPortReply(_c,_d) \ - if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \ - else WriteToClient(_c, sz_xvGrabPortReply, (char*)_d) - -#define _WriteGetPortAttributeReply(_c,_d) \ - if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \ - else WriteToClient(_c, sz_xvGetPortAttributeReply, (char*)_d) - -#define _WriteQueryBestSizeReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryBestSizeReply,(char*) _d) - -#define _WriteQueryPortAttributesReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryPortAttributesReply,(char*) _d) - -#define _WriteQueryImageAttributesReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryImageAttributesReply,(char*) _d) - -#define _WriteListImageFormatsReply(_c,_d) \ - if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \ - else WriteToClient(_c, sz_xvListImageFormatsReply,(char*) _d) - -#define _WriteImageFormatInfo(_c,_d) \ - if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \ - else WriteToClient(_c, sz_xvImageFormatInfo, (char*)_d) - -#define _AllocatePort(_i,_p) \ - ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success - -/* -** ProcXvDispatch -** -** -** -*/ - -int -ProcXvDispatch(ClientPtr client) -{ - int result; - - REQUEST(xReq); - - UpdateCurrentTime(); - - /* - * Report upstream that we are - * dispatching a XVideo operation. - */ - - nxagentXvTrap = 1; - - #ifdef TEST - fprintf(stderr, "ProcXvDispatch: Going to dispatch XVideo operation [%d] for client [%d].\n", - stuff->data, client -> index); - #endif - - switch (stuff->data) - { - case xv_QueryExtension: result = (ProcXvQueryExtension(client)); break; - case xv_QueryAdaptors: result = (ProcXvQueryAdaptors(client)); break; - case xv_QueryEncodings: result = (ProcXvQueryEncodings(client)); break; - case xv_PutVideo: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvPutVideo(client)); break; - else -#endif - result = (ProcXvPutVideo(client)); break; - case xv_PutStill: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvPutStill(client)); break - else -#endif - result = (ProcXvPutStill(client)); break; - case xv_GetVideo: result = (ProcXvGetVideo(client)); break; - case xv_GetStill: result = (ProcXvGetStill(client)); break; - case xv_GrabPort: result = (ProcXvGrabPort(client)); break; - case xv_UngrabPort: result = (ProcXvUngrabPort(client)); break; - case xv_SelectVideoNotify: result = (ProcXvSelectVideoNotify(client)); break; - case xv_SelectPortNotify: result = (ProcXvSelectPortNotify(client)); break; - case xv_StopVideo: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvStopVideo(client)); break; - else -#endif - result = (ProcXvStopVideo(client)); break; - case xv_SetPortAttribute: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvSetPortAttribute(client)); break; - else -#endif - result = (ProcXvSetPortAttribute(client)); break; - case xv_GetPortAttribute: result = (ProcXvGetPortAttribute(client)); break; - case xv_QueryBestSize: result = (ProcXvQueryBestSize(client)); break; - case xv_QueryPortAttributes: result = (ProcXvQueryPortAttributes(client)); break; - case xv_PutImage: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvPutImage(client)); break; - else -#endif - result = (ProcXvPutImage(client)); break; -#ifdef MITSHM - case xv_ShmPutImage: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - result = (XineramaXvShmPutImage(client)); break; - else -#endif - result = (ProcXvShmPutImage(client)); break; -#endif - case xv_QueryImageAttributes: result = (ProcXvQueryImageAttributes(client)); break; - case xv_ListImageFormats: result = (ProcXvListImageFormats(client)); break; - default: - if (stuff->data < xvNumRequests) - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, - BadImplementation); - result = (BadImplementation); break; - } - else - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); - result = (BadRequest); break; - } - } - - nxagentXvTrap = 0; - - #ifdef TEST - fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", - stuff->data, client -> index); - #endif - - return result; -} - -int -SProcXvDispatch(ClientPtr client) -{ - int result; - - REQUEST(xReq); - - UpdateCurrentTime(); - - /* - * Report upstream that we are - * dispatching a XVideo operation. - */ - - nxagentXvTrap = 1; - - #ifdef TEST - fprintf(stderr, "SProcXvDispatch: Going to dispatch XVideo operation [%d] for client [%d].\n", - stuff->data, client -> index); - #endif - - switch (stuff->data) - { - case xv_QueryExtension: result = (SProcXvQueryExtension(client)); break; - case xv_QueryAdaptors: result = (SProcXvQueryAdaptors(client)); break; - case xv_QueryEncodings: result = (SProcXvQueryEncodings(client)); break; - case xv_PutVideo: result = (SProcXvPutVideo(client)); break; - case xv_PutStill: result = (SProcXvPutStill(client)); break; - case xv_GetVideo: result = (SProcXvGetVideo(client)); break; - case xv_GetStill: result = (SProcXvGetStill(client)); break; - case xv_GrabPort: result = (SProcXvGrabPort(client)); break; - case xv_UngrabPort: result = (SProcXvUngrabPort(client)); break; - case xv_SelectVideoNotify: result = (SProcXvSelectVideoNotify(client)); break; - case xv_SelectPortNotify: result = (SProcXvSelectPortNotify(client)); break; - case xv_StopVideo: result = (SProcXvStopVideo(client)); break; - case xv_SetPortAttribute: result = (SProcXvSetPortAttribute(client)); break; - case xv_GetPortAttribute: result = (SProcXvGetPortAttribute(client)); break; - case xv_QueryBestSize: result = (SProcXvQueryBestSize(client)); break; - case xv_QueryPortAttributes: result = (SProcXvQueryPortAttributes(client)); break; - case xv_PutImage: result = (SProcXvPutImage(client)); break; -#ifdef MITSHM - case xv_ShmPutImage: result = (SProcXvShmPutImage(client)); break; -#endif - case xv_QueryImageAttributes: result = (SProcXvQueryImageAttributes(client)); break; - case xv_ListImageFormats: result = (SProcXvListImageFormats(client)); break; - default: - if (stuff->data < xvNumRequests) - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, - BadImplementation); - result = (BadImplementation); break; - } - else - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); - result = (BadRequest); break; - } - } - - nxagentXvTrap = 0; - - #ifdef TEST - fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", - stuff->data, client -> index); - #endif - - return result; -} - -static int -ProcXvQueryExtension(ClientPtr client) -{ - xvQueryExtensionReply rep; - /* REQUEST(xvQueryExtensionReq); */ - REQUEST_SIZE_MATCH(xvQueryExtensionReq); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.version = XvVersion; - rep.revision = XvRevision; - - _WriteQueryExtensionReply(client, &rep); - - return Success; - -} - -static int -ProcXvQueryAdaptors(ClientPtr client) -{ - xvFormat format; - xvAdaptorInfo ainfo; - xvQueryAdaptorsReply rep; - int totalSize; - int na; - XvAdaptorPtr pa; - int nf; - XvFormatPtr pf; - WindowPtr pWin; - ScreenPtr pScreen; - XvScreenPtr pxvs; - - REQUEST(xvQueryAdaptorsReq); - REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); - - if(!(pWin = (WindowPtr)LookupWindow(stuff->window, client) )) - { - client->errorValue = stuff->window; - return (BadWindow); - } - - pScreen = pWin->drawable.pScreen; - pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr; - - if (!pxvs) - { - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = 0; - rep.length = 0; - - _WriteQueryAdaptorsReply(client, &rep); - - return Success; - } - - (* pxvs->ddQueryAdaptors)(pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = pxvs->nAdaptors; - - /* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */ - - totalSize = pxvs->nAdaptors * sz_xvAdaptorInfo; - - /* FOR EACH ADPATOR ADD UP THE BYTES FOR ENCODINGS AND FORMATS */ - - na = pxvs->nAdaptors; - pa = pxvs->pAdaptors; - while (na--) - { - totalSize += (strlen(pa->name) + 3) & ~3; - totalSize += pa->nFormats * sz_xvFormat; - pa++; - } - - rep.length = totalSize >> 2; - - _WriteQueryAdaptorsReply(client, &rep); - - na = pxvs->nAdaptors; - pa = pxvs->pAdaptors; - while (na--) - { - - ainfo.base_id = pa->base_id; - ainfo.num_ports = pa->nPorts; - ainfo.type = pa->type; - ainfo.name_size = strlen(pa->name); - ainfo.num_formats = pa->nFormats; - - _WriteAdaptorInfo(client, &ainfo); - - WriteToClient(client, ainfo.name_size, pa->name); - - nf = pa->nFormats; - pf = pa->pFormats; - while (nf--) - { - format.depth = pf->depth; - format.visual = pf->visual; - _WriteFormat(client, &format); - pf++; - } - - pa++; - - } - - return (client->noClientException); - -} - -static int -ProcXvQueryEncodings(ClientPtr client) -{ - xvEncodingInfo einfo; - xvQueryEncodingsReply rep; - int totalSize; - XvPortPtr pPort; - int ne; - XvEncodingPtr pe; - int status; - - REQUEST(xvQueryEncodingsReq); - REQUEST_SIZE_MATCH(xvQueryEncodingsReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_encodings = pPort->pAdaptor->nEncodings; - - /* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */ - - ne = pPort->pAdaptor->nEncodings; - pe = pPort->pAdaptor->pEncodings; - totalSize = ne * sz_xvEncodingInfo; - while (ne--) - { - totalSize += (strlen(pe->name) + 3) & ~3; - pe++; - } - - rep.length = totalSize >> 2; - - _WriteQueryEncodingsReply(client, &rep); - - ne = pPort->pAdaptor->nEncodings; - pe = pPort->pAdaptor->pEncodings; - while (ne--) - { - einfo.encoding = pe->id; - einfo.name_size = strlen(pe->name); - einfo.width = pe->width; - einfo.height = pe->height; - einfo.rate.numerator = pe->rate.numerator; - einfo.rate.denominator = pe->rate.denominator; - _WriteEncodingInfo(client, &einfo); - WriteToClient(client, einfo.name_size, pe->name); - pe++; - } - - return (client->noClientException); - -} - -static int -ProcXvPutVideo(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvPutVideoReq); - REQUEST_SIZE_MATCH(xvPutVideoReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvInputMask) || - !(pPort->pAdaptor->type & XvVideoMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diPutVideo)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - -static int -ProcXvPutStill(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvPutStillReq); - REQUEST_SIZE_MATCH(xvPutStillReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvInputMask) || - !(pPort->pAdaptor->type & XvStillMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diPutStill)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - - -static int -ProcXvGetVideo(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvGetVideoReq); - REQUEST_SIZE_MATCH(xvGetVideoReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvOutputMask) || - !(pPort->pAdaptor->type & XvVideoMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diGetVideo)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - - -static int -ProcXvGetStill(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvGetStillReq); - REQUEST_SIZE_MATCH(xvGetStillReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvOutputMask) || - !(pPort->pAdaptor->type & XvStillMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diGetStill)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - -static int -ProcXvSelectVideoNotify(ClientPtr client) -{ - register DrawablePtr pDraw; - REQUEST(xvSelectVideoNotifyReq); - REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); - - if(!(pDraw = (DrawablePtr)LOOKUP_DRAWABLE(stuff->drawable, client) )) - { - client->errorValue = stuff->drawable; - return (BadWindow); - } - - return XVCALL(diSelectVideoNotify)(client, pDraw, stuff->onoff); - -} - -static int -ProcXvSelectPortNotify(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvSelectPortNotifyReq); - REQUEST_SIZE_MATCH(xvSelectPortNotifyReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - return XVCALL(diSelectPortNotify)(client, pPort, stuff->onoff); - -} - -static int -ProcXvGrabPort(ClientPtr client) -{ - int result, status; - XvPortPtr pPort; - xvGrabPortReply rep; - REQUEST(xvGrabPortReq); - REQUEST_SIZE_MATCH(xvGrabPortReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - status = XVCALL(diGrabPort)(client, pPort, stuff->time, &result); - - if (status != Success) - { - return status; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.result = result; - - _WriteGrabPortReply(client, &rep); - - return Success; - -} - -static int -ProcXvUngrabPort(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvGrabPortReq); - REQUEST_SIZE_MATCH(xvGrabPortReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - return XVCALL(diUngrabPort)(client, pPort, stuff->time); - -} - - -static int -ProcXvStopVideo(ClientPtr client) -{ - int status; - register DrawablePtr pDraw; - XvPortPtr pPort; - REQUEST(xvStopVideoReq); - REQUEST_SIZE_MATCH(xvStopVideoReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if(!(pDraw = LOOKUP_DRAWABLE(stuff->drawable, client) )) - { - client->errorValue = stuff->drawable; - return (BadDrawable); - } - - return XVCALL(diStopVideo)(client, pPort, pDraw); - -} - -static int -ProcXvSetPortAttribute(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvSetPortAttributeReq); - REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!ValidAtom(stuff->attribute)) - { - client->errorValue = stuff->attribute; - return(BadAtom); - } - - status = XVCALL(diSetPortAttribute)(client, pPort, - stuff->attribute, stuff->value); - - if (status == BadMatch) - client->errorValue = stuff->attribute; - else - client->errorValue = stuff->value; - - return status; -} - -static int -ProcXvGetPortAttribute(ClientPtr client) -{ - INT32 value; - int status; - XvPortPtr pPort; - xvGetPortAttributeReply rep; - REQUEST(xvGetPortAttributeReq); - REQUEST_SIZE_MATCH(xvGetPortAttributeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!ValidAtom(stuff->attribute)) - { - client->errorValue = stuff->attribute; - return(BadAtom); - } - - status = XVCALL(diGetPortAttribute)(client, pPort, stuff->attribute, &value); - if (status != Success) - { - client->errorValue = stuff->attribute; - return status; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.value = value; - - _WriteGetPortAttributeReply(client, &rep); - - return Success; -} - -static int -ProcXvQueryBestSize(ClientPtr client) -{ - int status; - unsigned int actual_width, actual_height; - XvPortPtr pPort; - xvQueryBestSizeReply rep; - REQUEST(xvQueryBestSizeReq); - REQUEST_SIZE_MATCH(xvQueryBestSizeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - - (* pPort->pAdaptor->ddQueryBestSize)(client, pPort, stuff->motion, - stuff->vid_w, stuff->vid_h, - stuff->drw_w, stuff->drw_h, - &actual_width, &actual_height); - - rep.actual_width = actual_width; - rep.actual_height = actual_height; - - _WriteQueryBestSizeReply(client, &rep); - - return Success; -} - - -static int -ProcXvQueryPortAttributes(ClientPtr client) -{ - int status, size, i; - XvPortPtr pPort; - XvAttributePtr pAtt; - xvQueryPortAttributesReply rep; - xvAttributeInfo Info; - REQUEST(xvQueryPortAttributesReq); - REQUEST_SIZE_MATCH(xvQueryPortAttributesReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_attributes = pPort->pAdaptor->nAttributes; - rep.text_size = 0; - - for(i = 0, pAtt = pPort->pAdaptor->pAttributes; - i < rep.num_attributes; i++, pAtt++) - { - rep.text_size += (strlen(pAtt->name) + 1 + 3) & ~3L; - } - - rep.length = (rep.num_attributes * sz_xvAttributeInfo) + rep.text_size; - rep.length >>= 2; - - _WriteQueryPortAttributesReply(client, &rep); - - for(i = 0, pAtt = pPort->pAdaptor->pAttributes; - i < rep.num_attributes; i++, pAtt++) - { - size = strlen(pAtt->name) + 1; /* pass the NULL */ - Info.flags = pAtt->flags; - Info.min = pAtt->min_value; - Info.max = pAtt->max_value; - Info.size = (size + 3) & ~3L; - - _WriteAttributeInfo(client, &Info); - - WriteToClient(client, size, pAtt->name); - } - - return Success; -} - - - -static int -ProcXvPutImage(ClientPtr client) -{ - DrawablePtr pDraw; - XvPortPtr pPort; - XvImagePtr pImage = NULL; - GCPtr pGC; - int status, i, size; - CARD16 width, height; - - REQUEST(xvPutImageReq); - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvImageMask) || - !(pPort->pAdaptor->type & XvInputMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - - if(!pImage) - return BadMatch; - - width = stuff->width; - height = stuff->height; - size = (*pPort->pAdaptor->ddQueryImageAttributes)(client, - pPort, pImage, &width, &height, NULL, NULL); - size += sizeof(xvPutImageReq); - size = (size + 3) >> 2; - - if((width < stuff->width) || (height < stuff->height)) - return BadValue; - - if(client->req_len < size) - return BadLength; - - return XVCALL(diPutImage)(client, pDraw, pPort, pGC, - stuff->src_x, stuff->src_y, - stuff->src_w, stuff->src_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h, - pImage, (unsigned char*)(&stuff[1]), FALSE, - stuff->width, stuff->height); -} - -#ifdef MITSHM -/* redefined here since it's not in any header file */ -typedef struct _ShmDesc { - struct _ShmDesc *next; - int shmid; - int refcnt; - char *addr; - Bool writable; - unsigned long size; -} ShmDescRec, *ShmDescPtr; - -extern RESTYPE ShmSegType; -extern int BadShmSegCode; -extern int ShmCompletionCode; - -static int -ProcXvShmPutImage(ClientPtr client) -{ - ShmDescPtr shmdesc; - DrawablePtr pDraw; - XvPortPtr pPort; - XvImagePtr pImage = NULL; - GCPtr pGC; - int status, size_needed, i; - CARD16 width, height; - - REQUEST(xvShmPutImageReq); - REQUEST_SIZE_MATCH(xvShmPutImageReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvImageMask) || - !(pPort->pAdaptor->type & XvInputMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - - if(!pImage) - return BadMatch; - - if(!(shmdesc = (ShmDescPtr)LookupIDByType(stuff->shmseg, ShmSegType))) - { - client->errorValue = stuff->shmseg; - return BadShmSegCode; - } - - width = stuff->width; - height = stuff->height; - size_needed = (*pPort->pAdaptor->ddQueryImageAttributes)(client, - pPort, pImage, &width, &height, NULL, NULL); - if((size_needed + stuff->offset) > shmdesc->size) - return BadAccess; - - if((width < stuff->width) || (height < stuff->height)) - return BadValue; - - status = XVCALL(diPutImage)(client, pDraw, pPort, pGC, - stuff->src_x, stuff->src_y, - stuff->src_w, stuff->src_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h, pImage, - (unsigned char *)shmdesc->addr + stuff->offset, - stuff->send_event, stuff->width, stuff->height); - - if((status == Success) && stuff->send_event) { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.sequenceNumber = client->sequence; - ev.minorEvent = xv_ShmPutImage; - ev.majorEvent = XvReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; - WriteEventsToClient(client, 1, (xEvent *) &ev); - } - - return status; -} -#endif - -#ifdef XvMCExtension -#include "xvmcext.h" -#endif - -static int -ProcXvQueryImageAttributes(ClientPtr client) -{ - xvQueryImageAttributesReply rep; - int size, num_planes, i; - CARD16 width, height; - XvImagePtr pImage = NULL; - XvPortPtr pPort; - int *offsets; - int *pitches; - REQUEST(xvQueryImageAttributesReq); - - REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - -#ifdef XvMCExtension - if(!pImage) - pImage = XvMCFindXvImage(pPort, stuff->id); -#endif - - if(!pImage) - return BadMatch; - - num_planes = pImage->num_planes; - - if(!(offsets = xalloc(num_planes << 3))) - return BadAlloc; - pitches = offsets + num_planes; - - width = stuff->width; - height = stuff->height; - - size = (*pPort->pAdaptor->ddQueryImageAttributes)(client, pPort, pImage, - &width, &height, offsets, pitches); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = num_planes << 1; - rep.num_planes = num_planes; - rep.width = width; - rep.height = height; - rep.data_size = size; - - _WriteQueryImageAttributesReply(client, &rep); - if(client->swapped) - SwapLongs((CARD32*)offsets, rep.length); - WriteToClient(client, rep.length << 2, (char*)offsets); - - xfree(offsets); - - return Success; -} - -static int -ProcXvListImageFormats(ClientPtr client) -{ - XvPortPtr pPort; - XvImagePtr pImage; - int i; - xvListImageFormatsReply rep; - xvImageFormatInfo info; - REQUEST(xvListImageFormatsReq); - - REQUEST_SIZE_MATCH(xvListImageFormatsReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_formats = pPort->pAdaptor->nImages; - rep.length = rep.num_formats * sz_xvImageFormatInfo >> 2; - - _WriteListImageFormatsReply(client, &rep); - - pImage = pPort->pAdaptor->pImages; - - for(i = 0; i < rep.num_formats; i++, pImage++) { - info.id = pImage->id; - info.type = pImage->type; - info.byte_order = pImage->byte_order; - memcpy(&info.guid, pImage->guid, 16); - info.bpp = pImage->bits_per_pixel; - info.num_planes = pImage->num_planes; - info.depth = pImage->depth; - info.red_mask = pImage->red_mask; - info.green_mask = pImage->green_mask; - info.blue_mask = pImage->blue_mask; - info.format = pImage->format; - info.y_sample_bits = pImage->y_sample_bits; - info.u_sample_bits = pImage->u_sample_bits; - info.v_sample_bits = pImage->v_sample_bits; - info.horz_y_period = pImage->horz_y_period; - info.horz_u_period = pImage->horz_u_period; - info.horz_v_period = pImage->horz_v_period; - info.vert_y_period = pImage->vert_y_period; - info.vert_u_period = pImage->vert_u_period; - info.vert_v_period = pImage->vert_v_period; - memcpy(&info.comp_order, pImage->component_order, 32); - info.scanline_order = pImage->scanline_order; - _WriteImageFormatInfo(client, &info); - } - - return Success; -} - - - -/* Swapped Procs */ - -static int -SProcXvQueryExtension(ClientPtr client) -{ - register char n; - REQUEST(xvQueryExtensionReq); - swaps(&stuff->length, n); - return ProcXvQueryExtension(client); -} - -static int -SProcXvQueryAdaptors(ClientPtr client) -{ - register char n; - REQUEST(xvQueryAdaptorsReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcXvQueryAdaptors(client); -} - -static int -SProcXvQueryEncodings(ClientPtr client) -{ - register char n; - REQUEST(xvQueryEncodingsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvQueryEncodings(client); -} - -static int -SProcXvGrabPort(ClientPtr client) -{ - register char n; - REQUEST(xvGrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); - return ProcXvGrabPort(client); -} - -static int -SProcXvUngrabPort(ClientPtr client) -{ - register char n; - REQUEST(xvUngrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); - return ProcXvUngrabPort(client); -} - -static int -SProcXvPutVideo(ClientPtr client) -{ - register char n; - REQUEST(xvPutVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvPutVideo(client); -} - -static int -SProcXvPutStill(ClientPtr client) -{ - register char n; - REQUEST(xvPutStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvPutStill(client); -} - -static int -SProcXvGetVideo(ClientPtr client) -{ - register char n; - REQUEST(xvGetVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvGetVideo(client); -} - -static int -SProcXvGetStill(ClientPtr client) -{ - register char n; - REQUEST(xvGetStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvGetStill(client); -} - -static int -SProcXvPutImage(ClientPtr client) -{ - register char n; - REQUEST(xvPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->id, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return ProcXvPutImage(client); -} - -#ifdef MITSHM -static int -SProcXvShmPutImage(ClientPtr client) -{ - register char n; - REQUEST(xvShmPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->id, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->offset, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return ProcXvShmPutImage(client); -} -#endif - - -static int -SProcXvSelectVideoNotify(ClientPtr client) -{ - register char n; - REQUEST(xvSelectVideoNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - return ProcXvSelectVideoNotify(client); -} - -static int -SProcXvSelectPortNotify(ClientPtr client) -{ - register char n; - REQUEST(xvSelectPortNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvSelectPortNotify(client); -} - -static int -SProcXvStopVideo(ClientPtr client) -{ - register char n; - REQUEST(xvStopVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - return ProcXvStopVideo(client); -} - -static int -SProcXvSetPortAttribute(ClientPtr client) -{ - register char n; - REQUEST(xvSetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); - return ProcXvSetPortAttribute(client); -} - -static int -SProcXvGetPortAttribute(ClientPtr client) -{ - register char n; - REQUEST(xvGetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); - return ProcXvGetPortAttribute(client); -} - -static int -SProcXvQueryBestSize(ClientPtr client) -{ - register char n; - REQUEST(xvQueryBestSizeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvQueryBestSize(client); -} - -static int -SProcXvQueryPortAttributes(ClientPtr client) -{ - register char n; - REQUEST(xvQueryPortAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvQueryPortAttributes(client); -} - -static int -SProcXvQueryImageAttributes(ClientPtr client) -{ - register char n; - REQUEST(xvQueryImageAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->id, n); - swaps(&stuff->width, n); - swaps(&stuff->width, n); - return ProcXvQueryImageAttributes(client); -} - -static int -SProcXvListImageFormats(ClientPtr client) -{ - register char n; - REQUEST(xvListImageFormatsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvListImageFormats(client); -} - - -static int -SWriteQueryExtensionReply( - ClientPtr client, - xvQueryExtensionReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->version, n); - swaps(&rep->revision, n); - - (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryAdaptorsReply( - ClientPtr client, - xvQueryAdaptorsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_adaptors, n); - - (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryEncodingsReply( - ClientPtr client, - xvQueryEncodingsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_encodings, n); - - (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep); - - return Success; -} - -static int -SWriteAdaptorInfo( - ClientPtr client, - xvAdaptorInfo *pAdaptor -){ - register char n; - - swapl(&pAdaptor->base_id, n); - swaps(&pAdaptor->name_size, n); - swaps(&pAdaptor->num_ports, n); - swaps(&pAdaptor->num_formats, n); - - (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor); - - return Success; -} - -static int -SWriteEncodingInfo( - ClientPtr client, - xvEncodingInfo *pEncoding -){ - register char n; - - swapl(&pEncoding->encoding, n); - swaps(&pEncoding->name_size, n); - swaps(&pEncoding->width, n); - swaps(&pEncoding->height, n); - swapl(&pEncoding->rate.numerator, n); - swapl(&pEncoding->rate.denominator, n); - (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding); - - return Success; -} - -static int -SWriteFormat( - ClientPtr client, - xvFormat *pFormat -){ - register char n; - - swapl(&pFormat->visual, n); - (void)WriteToClient(client, sz_xvFormat, (char *)pFormat); - - return Success; -} - -static int -SWriteAttributeInfo( - ClientPtr client, - xvAttributeInfo *pAtt -){ - register char n; - - swapl(&pAtt->flags, n); - swapl(&pAtt->size, n); - swapl(&pAtt->min, n); - swapl(&pAtt->max, n); - (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt); - - return Success; -} - -static int -SWriteImageFormatInfo( - ClientPtr client, - xvImageFormatInfo *pImage -){ - register char n; - - swapl(&pImage->id, n); - swapl(&pImage->red_mask, n); - swapl(&pImage->green_mask, n); - swapl(&pImage->blue_mask, n); - swapl(&pImage->y_sample_bits, n); - swapl(&pImage->u_sample_bits, n); - swapl(&pImage->v_sample_bits, n); - swapl(&pImage->horz_y_period, n); - swapl(&pImage->horz_u_period, n); - swapl(&pImage->horz_v_period, n); - swapl(&pImage->vert_y_period, n); - swapl(&pImage->vert_u_period, n); - swapl(&pImage->vert_v_period, n); - - (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage); - - return Success; -} - - - -static int -SWriteGrabPortReply( - ClientPtr client, - xvGrabPortReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - - (void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep); - - return Success; -} - -static int -SWriteGetPortAttributeReply( - ClientPtr client, - xvGetPortAttributeReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->value, n); - - (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryBestSizeReply( - ClientPtr client, - xvQueryBestSizeReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->actual_width, n); - swaps(&rep->actual_height, n); - - (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryPortAttributesReply( - ClientPtr client, - xvQueryPortAttributesReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_attributes, n); - swapl(&rep->text_size, n); - - (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryImageAttributesReply( - ClientPtr client, - xvQueryImageAttributesReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_planes, n); - swapl(&rep->data_size, n); - swaps(&rep->width, n); - swaps(&rep->height, n); - - (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep); - - return Success; -} - - -static int -SWriteListImageFormatsReply( - ClientPtr client, - xvListImageFormatsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_formats, n); - - (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep); - - return Success; -} - - -#ifdef PANORAMIX - - - - -static int -XineramaXvStopVideo(ClientPtr client) -{ - int result = Success, i; - PanoramiXRes *draw, *port; - REQUEST(xvStopVideoReq); - REQUEST_SIZE_MATCH(xvStopVideoReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - result = ProcXvStopVideo(client); - } - } - - return result; -} - -static int -XineramaXvSetPortAttribute(ClientPtr client) -{ - REQUEST(xvSetPortAttributeReq); - PanoramiXRes *port; - int result = Success, i; - - REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->port = port->info[i].id; - result = ProcXvSetPortAttribute(client); - } - } - return result; -} - - -#ifdef MITSHM -static int -XineramaXvShmPutImage(ClientPtr client) -{ - REQUEST(xvShmPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool send_event = stuff->send_event; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_SIZE_MATCH(xvShmPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - stuff->send_event = (send_event && !i) ? 1 : 0; - - result = ProcXvShmPutImage(client); - } - } - return result; -} -#endif - -static int -XineramaXvPutImage(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutImage(client); - } - } - return result; -} - -static int -XineramaXvPutVideo(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutVideoReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutVideo(client); - } - } - return result; -} - -static int -XineramaXvPutStill(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutStill(client); - } - } - return result; -} - - -void XineramifyXv(void) -{ - ScreenPtr pScreen, screen0 = screenInfo.screens[0]; - XvScreenPtr xvsp0 = (XvScreenPtr)screen0->devPrivates[XvScreenIndex].ptr; - XvAdaptorPtr refAdapt, pAdapt; - XvAttributePtr pAttr; - XvScreenPtr xvsp; - Bool isOverlay, hasOverlay; - PanoramiXRes *port; - XvAdaptorPtr MatchingAdaptors[MAXSCREENS]; - int i, j, k, l; - - XvXRTPort = CreateNewResourceType(XineramaDeleteResource); - - if(!xvsp0) return; - - for(i = 0; i < xvsp0->nAdaptors; i++) { - refAdapt = xvsp0->pAdaptors + i; - - bzero(MatchingAdaptors, sizeof(XvAdaptorPtr) * MAXSCREENS); - - MatchingAdaptors[0] = refAdapt; - - if(!(refAdapt->type & XvInputMask)) continue; - - isOverlay = FALSE; - for(j = 0; j < refAdapt->nAttributes; j++) { - pAttr = refAdapt->pAttributes + j; - if(!strcmp(pAttr->name, "XV_COLORKEY")) { - isOverlay = TRUE; - break; - } - } - - for(j = 1; j < PanoramiXNumScreens; j++) { - pScreen = screenInfo.screens[j]; - xvsp = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr; - - /* Do not try to go on if xv is not supported on this screen */ - if (xvsp==NULL) continue ; - - /* if the adaptor has the same name it's a perfect match */ - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if(!strcmp(refAdapt->name, pAdapt->name)) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - if(MatchingAdaptors[j]) continue; /* found it */ - - /* otherwise we only look for XvImage adaptors */ - if(!(refAdapt->type & XvImageMask)) continue; - if(refAdapt->nImages <= 0) continue; - - /* prefer overlay/overlay non-overlay/non-overlay pairing */ - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) { - hasOverlay = FALSE; - for(l = 0; l < pAdapt->nAttributes; l++) { - if(!strcmp(pAdapt->name, "XV_COLORKEY")) { - hasOverlay = TRUE; - break; - } - } - if(isOverlay && hasOverlay) { - MatchingAdaptors[j] = pAdapt; - break; - } - else if(!isOverlay && !hasOverlay) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - } - - if(MatchingAdaptors[j]) continue; /* found it */ - - /* but we'll take any XvImage pairing if we can get it */ - - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - } - - /* now create a resource for each port */ - for(j = 0; j < refAdapt->nPorts; j++) { - if(!(port = xalloc(sizeof(PanoramiXRes)))) - break; - port->info[0].id = MatchingAdaptors[0]->base_id + j; - AddResource(port->info[0].id, XvXRTPort, port); - - for(k = 1; k < PanoramiXNumScreens; k++) { - if(MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j)) - port->info[k].id = MatchingAdaptors[k]->base_id + j; - else - port->info[k].id = 0; - } - } - } -} - -#endif - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.X.original deleted file mode 100644 index 21ab0b6a0..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.X.original +++ /dev/null @@ -1,2217 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/xvdisp.c,v 1.6 2005/07/03 08:53:36 daniels Exp $ */ -/*********************************************************** -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, -and the Massachusetts Institute of Technology, Cambridge, 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 names of Digital or MIT not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.27 2003/07/16 01:38:31 dawes Exp $ */ - -/* -** File: -** -** xvdisp.c --- Xv server extension dispatch module. -** -** Author: -** -** David Carver (Digital Workstation Engineering/Project Athena) -** -** Revisions: -** -** 11.06.91 Carver -** - changed SetPortControl to SetPortAttribute -** - changed GetPortControl to GetPortAttribute -** - changed QueryBestSize -** -** 15.05.91 Carver -** - version 2.0 upgrade -** -** 24.01.91 Carver -** - version 1.4 upgrade -** -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "dixstruct.h" -#include "resource.h" -#include "opaque.h" - -#include -#include -#include "xvdix.h" -#ifdef MITSHM -#define _XSHM_SERVER_ -#include -#endif - -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#include "xvdisp.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - -unsigned long XvXRTPort; - -#ifdef MITSHM -static int XineramaXvShmPutImage(ClientPtr); -#endif -static int XineramaXvPutImage(ClientPtr); -static int XineramaXvPutVideo(ClientPtr); -static int XineramaXvPutStill(ClientPtr); -static int XineramaXvSetPortAttribute(ClientPtr); -static int XineramaXvStopVideo(ClientPtr); -#endif - -/* INTERNAL */ - -static int ProcXvQueryExtension(ClientPtr); -static int ProcXvQueryAdaptors(ClientPtr); -static int ProcXvQueryEncodings(ClientPtr); -static int ProcXvPutVideo(ClientPtr); -static int ProcXvPutStill(ClientPtr); -static int ProcXvGetVideo(ClientPtr); -static int ProcXvGetStill(ClientPtr); -static int ProcXvGrabPort(ClientPtr); -static int ProcXvUngrabPort(ClientPtr); -static int ProcXvSelectVideoNotify(ClientPtr); -static int ProcXvSelectPortNotify(ClientPtr); -static int ProcXvStopVideo(ClientPtr); -static int ProcXvSetPortAttribute(ClientPtr); -static int ProcXvGetPortAttribute(ClientPtr); -static int ProcXvQueryBestSize(ClientPtr); -static int ProcXvQueryPortAttributes(ClientPtr); -static int ProcXvPutImage(ClientPtr); -#ifdef MITSHM -static int ProcXvShmPutImage(ClientPtr); -#endif -static int ProcXvQueryImageAttributes(ClientPtr); -static int ProcXvListImageFormats(ClientPtr); - -static int SProcXvQueryExtension(ClientPtr); -static int SProcXvQueryAdaptors(ClientPtr); -static int SProcXvQueryEncodings(ClientPtr); -static int SProcXvPutVideo(ClientPtr); -static int SProcXvPutStill(ClientPtr); -static int SProcXvGetVideo(ClientPtr); -static int SProcXvGetStill(ClientPtr); -static int SProcXvGrabPort(ClientPtr); -static int SProcXvUngrabPort(ClientPtr); -static int SProcXvSelectVideoNotify(ClientPtr); -static int SProcXvSelectPortNotify(ClientPtr); -static int SProcXvStopVideo(ClientPtr); -static int SProcXvSetPortAttribute(ClientPtr); -static int SProcXvGetPortAttribute(ClientPtr); -static int SProcXvQueryBestSize(ClientPtr); -static int SProcXvQueryPortAttributes(ClientPtr); -static int SProcXvPutImage(ClientPtr); -#ifdef MITSHM -static int SProcXvShmPutImage(ClientPtr); -#endif -static int SProcXvQueryImageAttributes(ClientPtr); -static int SProcXvListImageFormats(ClientPtr); - -static int SWriteQueryAdaptorsReply(ClientPtr, xvQueryAdaptorsReply *); -static int SWriteQueryExtensionReply(ClientPtr, xvQueryExtensionReply *); -static int SWriteQueryEncodingsReply(ClientPtr, xvQueryEncodingsReply *); -static int SWriteAdaptorInfo(ClientPtr, xvAdaptorInfo *); -static int SWriteEncodingInfo(ClientPtr, xvEncodingInfo *); -static int SWriteFormat(ClientPtr, xvFormat *); -static int SWriteAttributeInfo(ClientPtr, xvAttributeInfo *); -static int SWriteGrabPortReply(ClientPtr, xvGrabPortReply *); -static int SWriteGetPortAttributeReply(ClientPtr, xvGetPortAttributeReply *); -static int SWriteQueryBestSizeReply(ClientPtr, xvQueryBestSizeReply *); -static int SWriteQueryPortAttributesReply( - ClientPtr, xvQueryPortAttributesReply *); -static int SWriteQueryImageAttributesReply( - ClientPtr, xvQueryImageAttributesReply*); -static int SWriteListImageFormatsReply(ClientPtr, xvListImageFormatsReply*); -static int SWriteImageFormatInfo(ClientPtr, xvImageFormatInfo*); - -#define _WriteQueryAdaptorsReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryAdaptorsReply, (char*)_d) - -#define _WriteQueryExtensionReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryExtensionReply, (char*)_d) - -#define _WriteQueryEncodingsReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryEncodingsReply, (char*)_d) - -#define _WriteAdaptorInfo(_c,_d) \ - if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAdaptorInfo, (char*)_d) - -#define _WriteAttributeInfo(_c,_d) \ - if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAttributeInfo, (char*)_d) - -#define _WriteEncodingInfo(_c,_d) \ - if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \ - else WriteToClient(_c, sz_xvEncodingInfo, (char*)_d) - -#define _WriteFormat(_c,_d) \ - if ((_c)->swapped) SWriteFormat(_c, _d); \ - else WriteToClient(_c, sz_xvFormat, (char*)_d) - -#define _WriteGrabPortReply(_c,_d) \ - if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \ - else WriteToClient(_c, sz_xvGrabPortReply, (char*)_d) - -#define _WriteGetPortAttributeReply(_c,_d) \ - if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \ - else WriteToClient(_c, sz_xvGetPortAttributeReply, (char*)_d) - -#define _WriteQueryBestSizeReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryBestSizeReply,(char*) _d) - -#define _WriteQueryPortAttributesReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryPortAttributesReply,(char*) _d) - -#define _WriteQueryImageAttributesReply(_c,_d) \ - if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryImageAttributesReply,(char*) _d) - -#define _WriteListImageFormatsReply(_c,_d) \ - if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \ - else WriteToClient(_c, sz_xvListImageFormatsReply,(char*) _d) - -#define _WriteImageFormatInfo(_c,_d) \ - if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \ - else WriteToClient(_c, sz_xvImageFormatInfo, (char*)_d) - -#define _AllocatePort(_i,_p) \ - ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success - -/* -** ProcXvDispatch -** -** -** -*/ - -int -ProcXvDispatch(ClientPtr client) -{ - REQUEST(xReq); - - UpdateCurrentTime(); - - switch (stuff->data) - { - case xv_QueryExtension: return(ProcXvQueryExtension(client)); - case xv_QueryAdaptors: return(ProcXvQueryAdaptors(client)); - case xv_QueryEncodings: return(ProcXvQueryEncodings(client)); - case xv_PutVideo: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvPutVideo(client)); - else -#endif - return(ProcXvPutVideo(client)); - case xv_PutStill: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvPutStill(client)); - else -#endif - return(ProcXvPutStill(client)); - case xv_GetVideo: return(ProcXvGetVideo(client)); - case xv_GetStill: return(ProcXvGetStill(client)); - case xv_GrabPort: return(ProcXvGrabPort(client)); - case xv_UngrabPort: return(ProcXvUngrabPort(client)); - case xv_SelectVideoNotify: return(ProcXvSelectVideoNotify(client)); - case xv_SelectPortNotify: return(ProcXvSelectPortNotify(client)); - case xv_StopVideo: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvStopVideo(client)); - else -#endif - return(ProcXvStopVideo(client)); - case xv_SetPortAttribute: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvSetPortAttribute(client)); - else -#endif - return(ProcXvSetPortAttribute(client)); - case xv_GetPortAttribute: return(ProcXvGetPortAttribute(client)); - case xv_QueryBestSize: return(ProcXvQueryBestSize(client)); - case xv_QueryPortAttributes: return(ProcXvQueryPortAttributes(client)); - case xv_PutImage: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvPutImage(client)); - else -#endif - return(ProcXvPutImage(client)); -#ifdef MITSHM - case xv_ShmPutImage: -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return(XineramaXvShmPutImage(client)); - else -#endif - return(ProcXvShmPutImage(client)); -#endif - case xv_QueryImageAttributes: return(ProcXvQueryImageAttributes(client)); - case xv_ListImageFormats: return(ProcXvListImageFormats(client)); - default: - if (stuff->data < xvNumRequests) - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, - BadImplementation); - return(BadImplementation); - } - else - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); - return(BadRequest); - } - } -} - -int -SProcXvDispatch(ClientPtr client) -{ - REQUEST(xReq); - - UpdateCurrentTime(); - - switch (stuff->data) - { - case xv_QueryExtension: return(SProcXvQueryExtension(client)); - case xv_QueryAdaptors: return(SProcXvQueryAdaptors(client)); - case xv_QueryEncodings: return(SProcXvQueryEncodings(client)); - case xv_PutVideo: return(SProcXvPutVideo(client)); - case xv_PutStill: return(SProcXvPutStill(client)); - case xv_GetVideo: return(SProcXvGetVideo(client)); - case xv_GetStill: return(SProcXvGetStill(client)); - case xv_GrabPort: return(SProcXvGrabPort(client)); - case xv_UngrabPort: return(SProcXvUngrabPort(client)); - case xv_SelectVideoNotify: return(SProcXvSelectVideoNotify(client)); - case xv_SelectPortNotify: return(SProcXvSelectPortNotify(client)); - case xv_StopVideo: return(SProcXvStopVideo(client)); - case xv_SetPortAttribute: return(SProcXvSetPortAttribute(client)); - case xv_GetPortAttribute: return(SProcXvGetPortAttribute(client)); - case xv_QueryBestSize: return(SProcXvQueryBestSize(client)); - case xv_QueryPortAttributes: return(SProcXvQueryPortAttributes(client)); - case xv_PutImage: return(SProcXvPutImage(client)); -#ifdef MITSHM - case xv_ShmPutImage: return(SProcXvShmPutImage(client)); -#endif - case xv_QueryImageAttributes: return(SProcXvQueryImageAttributes(client)); - case xv_ListImageFormats: return(SProcXvListImageFormats(client)); - default: - if (stuff->data < xvNumRequests) - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, - BadImplementation); - return(BadImplementation); - } - else - { - SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest); - return(BadRequest); - } - } -} - -static int -ProcXvQueryExtension(ClientPtr client) -{ - xvQueryExtensionReply rep; - /* REQUEST(xvQueryExtensionReq); */ - REQUEST_SIZE_MATCH(xvQueryExtensionReq); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.version = XvVersion; - rep.revision = XvRevision; - - _WriteQueryExtensionReply(client, &rep); - - return Success; - -} - -static int -ProcXvQueryAdaptors(ClientPtr client) -{ - xvFormat format; - xvAdaptorInfo ainfo; - xvQueryAdaptorsReply rep; - int totalSize; - int na; - XvAdaptorPtr pa; - int nf; - XvFormatPtr pf; - WindowPtr pWin; - ScreenPtr pScreen; - XvScreenPtr pxvs; - - REQUEST(xvQueryAdaptorsReq); - REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); - - if(!(pWin = (WindowPtr)LookupWindow(stuff->window, client) )) - { - client->errorValue = stuff->window; - return (BadWindow); - } - - pScreen = pWin->drawable.pScreen; - pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr; - - if (!pxvs) - { - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = 0; - rep.length = 0; - - _WriteQueryAdaptorsReply(client, &rep); - - return Success; - } - - (* pxvs->ddQueryAdaptors)(pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = pxvs->nAdaptors; - - /* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */ - - totalSize = pxvs->nAdaptors * sz_xvAdaptorInfo; - - /* FOR EACH ADPATOR ADD UP THE BYTES FOR ENCODINGS AND FORMATS */ - - na = pxvs->nAdaptors; - pa = pxvs->pAdaptors; - while (na--) - { - totalSize += (strlen(pa->name) + 3) & ~3; - totalSize += pa->nFormats * sz_xvFormat; - pa++; - } - - rep.length = totalSize >> 2; - - _WriteQueryAdaptorsReply(client, &rep); - - na = pxvs->nAdaptors; - pa = pxvs->pAdaptors; - while (na--) - { - - ainfo.base_id = pa->base_id; - ainfo.num_ports = pa->nPorts; - ainfo.type = pa->type; - ainfo.name_size = strlen(pa->name); - ainfo.num_formats = pa->nFormats; - - _WriteAdaptorInfo(client, &ainfo); - - WriteToClient(client, ainfo.name_size, pa->name); - - nf = pa->nFormats; - pf = pa->pFormats; - while (nf--) - { - format.depth = pf->depth; - format.visual = pf->visual; - _WriteFormat(client, &format); - pf++; - } - - pa++; - - } - - return (client->noClientException); - -} - -static int -ProcXvQueryEncodings(ClientPtr client) -{ - xvEncodingInfo einfo; - xvQueryEncodingsReply rep; - int totalSize; - XvPortPtr pPort; - int ne; - XvEncodingPtr pe; - int status; - - REQUEST(xvQueryEncodingsReq); - REQUEST_SIZE_MATCH(xvQueryEncodingsReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_encodings = pPort->pAdaptor->nEncodings; - - /* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */ - - ne = pPort->pAdaptor->nEncodings; - pe = pPort->pAdaptor->pEncodings; - totalSize = ne * sz_xvEncodingInfo; - while (ne--) - { - totalSize += (strlen(pe->name) + 3) & ~3; - pe++; - } - - rep.length = totalSize >> 2; - - _WriteQueryEncodingsReply(client, &rep); - - ne = pPort->pAdaptor->nEncodings; - pe = pPort->pAdaptor->pEncodings; - while (ne--) - { - einfo.encoding = pe->id; - einfo.name_size = strlen(pe->name); - einfo.width = pe->width; - einfo.height = pe->height; - einfo.rate.numerator = pe->rate.numerator; - einfo.rate.denominator = pe->rate.denominator; - _WriteEncodingInfo(client, &einfo); - WriteToClient(client, einfo.name_size, pe->name); - pe++; - } - - return (client->noClientException); - -} - -static int -ProcXvPutVideo(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvPutVideoReq); - REQUEST_SIZE_MATCH(xvPutVideoReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvInputMask) || - !(pPort->pAdaptor->type & XvVideoMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diPutVideo)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - -static int -ProcXvPutStill(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvPutStillReq); - REQUEST_SIZE_MATCH(xvPutStillReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvInputMask) || - !(pPort->pAdaptor->type & XvStillMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diPutStill)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - - -static int -ProcXvGetVideo(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvGetVideoReq); - REQUEST_SIZE_MATCH(xvGetVideoReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvOutputMask) || - !(pPort->pAdaptor->type & XvVideoMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diGetVideo)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - - -static int -ProcXvGetStill(ClientPtr client) -{ - register DrawablePtr pDraw; - XvPortPtr pPort; - register GCPtr pGC; - int status; - - REQUEST(xvGetStillReq); - REQUEST_SIZE_MATCH(xvGetStillReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvOutputMask) || - !(pPort->pAdaptor->type & XvStillMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - return XVCALL(diGetStill)(client, pDraw, pPort, pGC, - stuff->vid_x, stuff->vid_y, - stuff->vid_w, stuff->vid_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h); - -} - -static int -ProcXvSelectVideoNotify(ClientPtr client) -{ - register DrawablePtr pDraw; - REQUEST(xvSelectVideoNotifyReq); - REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); - - if(!(pDraw = (DrawablePtr)LOOKUP_DRAWABLE(stuff->drawable, client) )) - { - client->errorValue = stuff->drawable; - return (BadWindow); - } - - return XVCALL(diSelectVideoNotify)(client, pDraw, stuff->onoff); - -} - -static int -ProcXvSelectPortNotify(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvSelectPortNotifyReq); - REQUEST_SIZE_MATCH(xvSelectPortNotifyReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - return XVCALL(diSelectPortNotify)(client, pPort, stuff->onoff); - -} - -static int -ProcXvGrabPort(ClientPtr client) -{ - int result, status; - XvPortPtr pPort; - xvGrabPortReply rep; - REQUEST(xvGrabPortReq); - REQUEST_SIZE_MATCH(xvGrabPortReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - status = XVCALL(diGrabPort)(client, pPort, stuff->time, &result); - - if (status != Success) - { - return status; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.result = result; - - _WriteGrabPortReply(client, &rep); - - return Success; - -} - -static int -ProcXvUngrabPort(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvGrabPortReq); - REQUEST_SIZE_MATCH(xvGrabPortReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - return XVCALL(diUngrabPort)(client, pPort, stuff->time); - -} - - -static int -ProcXvStopVideo(ClientPtr client) -{ - int status; - register DrawablePtr pDraw; - XvPortPtr pPort; - REQUEST(xvStopVideoReq); - REQUEST_SIZE_MATCH(xvStopVideoReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if(!(pDraw = LOOKUP_DRAWABLE(stuff->drawable, client) )) - { - client->errorValue = stuff->drawable; - return (BadDrawable); - } - - return XVCALL(diStopVideo)(client, pPort, pDraw); - -} - -static int -ProcXvSetPortAttribute(ClientPtr client) -{ - int status; - XvPortPtr pPort; - REQUEST(xvSetPortAttributeReq); - REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!ValidAtom(stuff->attribute)) - { - client->errorValue = stuff->attribute; - return(BadAtom); - } - - status = XVCALL(diSetPortAttribute)(client, pPort, - stuff->attribute, stuff->value); - - if (status == BadMatch) - client->errorValue = stuff->attribute; - else - client->errorValue = stuff->value; - - return status; -} - -static int -ProcXvGetPortAttribute(ClientPtr client) -{ - INT32 value; - int status; - XvPortPtr pPort; - xvGetPortAttributeReply rep; - REQUEST(xvGetPortAttributeReq); - REQUEST_SIZE_MATCH(xvGetPortAttributeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!ValidAtom(stuff->attribute)) - { - client->errorValue = stuff->attribute; - return(BadAtom); - } - - status = XVCALL(diGetPortAttribute)(client, pPort, stuff->attribute, &value); - if (status != Success) - { - client->errorValue = stuff->attribute; - return status; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.value = value; - - _WriteGetPortAttributeReply(client, &rep); - - return Success; -} - -static int -ProcXvQueryBestSize(ClientPtr client) -{ - int status; - unsigned int actual_width, actual_height; - XvPortPtr pPort; - xvQueryBestSizeReply rep; - REQUEST(xvQueryBestSizeReq); - REQUEST_SIZE_MATCH(xvQueryBestSizeReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - - (* pPort->pAdaptor->ddQueryBestSize)(client, pPort, stuff->motion, - stuff->vid_w, stuff->vid_h, - stuff->drw_w, stuff->drw_h, - &actual_width, &actual_height); - - rep.actual_width = actual_width; - rep.actual_height = actual_height; - - _WriteQueryBestSizeReply(client, &rep); - - return Success; -} - - -static int -ProcXvQueryPortAttributes(ClientPtr client) -{ - int status, size, i; - XvPortPtr pPort; - XvAttributePtr pAtt; - xvQueryPortAttributesReply rep; - xvAttributeInfo Info; - REQUEST(xvQueryPortAttributesReq); - REQUEST_SIZE_MATCH(xvQueryPortAttributesReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_attributes = pPort->pAdaptor->nAttributes; - rep.text_size = 0; - - for(i = 0, pAtt = pPort->pAdaptor->pAttributes; - i < rep.num_attributes; i++, pAtt++) - { - rep.text_size += (strlen(pAtt->name) + 1 + 3) & ~3L; - } - - rep.length = (rep.num_attributes * sz_xvAttributeInfo) + rep.text_size; - rep.length >>= 2; - - _WriteQueryPortAttributesReply(client, &rep); - - for(i = 0, pAtt = pPort->pAdaptor->pAttributes; - i < rep.num_attributes; i++, pAtt++) - { - size = strlen(pAtt->name) + 1; /* pass the NULL */ - Info.flags = pAtt->flags; - Info.min = pAtt->min_value; - Info.max = pAtt->max_value; - Info.size = (size + 3) & ~3L; - - _WriteAttributeInfo(client, &Info); - - WriteToClient(client, size, pAtt->name); - } - - return Success; -} - - - -static int -ProcXvPutImage(ClientPtr client) -{ - DrawablePtr pDraw; - XvPortPtr pPort; - XvImagePtr pImage = NULL; - GCPtr pGC; - int status, i, size; - CARD16 width, height; - - REQUEST(xvPutImageReq); - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvImageMask) || - !(pPort->pAdaptor->type & XvInputMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - - if(!pImage) - return BadMatch; - - width = stuff->width; - height = stuff->height; - size = (*pPort->pAdaptor->ddQueryImageAttributes)(client, - pPort, pImage, &width, &height, NULL, NULL); - size += sizeof(xvPutImageReq); - size = (size + 3) >> 2; - - if((width < stuff->width) || (height < stuff->height)) - return BadValue; - - if(client->req_len < size) - return BadLength; - - return XVCALL(diPutImage)(client, pDraw, pPort, pGC, - stuff->src_x, stuff->src_y, - stuff->src_w, stuff->src_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h, - pImage, (unsigned char*)(&stuff[1]), FALSE, - stuff->width, stuff->height); -} - -#ifdef MITSHM -/* redefined here since it's not in any header file */ -typedef struct _ShmDesc { - struct _ShmDesc *next; - int shmid; - int refcnt; - char *addr; - Bool writable; - unsigned long size; -} ShmDescRec, *ShmDescPtr; - -extern RESTYPE ShmSegType; -extern int BadShmSegCode; -extern int ShmCompletionCode; - -static int -ProcXvShmPutImage(ClientPtr client) -{ - ShmDescPtr shmdesc; - DrawablePtr pDraw; - XvPortPtr pPort; - XvImagePtr pImage = NULL; - GCPtr pGC; - int status, size_needed, i; - CARD16 width, height; - - REQUEST(xvShmPutImageReq); - REQUEST_SIZE_MATCH(xvShmPutImageReq); - - VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - if ((status = _AllocatePort(stuff->port, pPort)) != Success) - { - client->errorValue = stuff->port; - return (status); - } - - if (!(pPort->pAdaptor->type & XvImageMask) || - !(pPort->pAdaptor->type & XvInputMask)) - { - client->errorValue = stuff->port; - return (BadMatch); - } - - status = XVCALL(diMatchPort)(pPort, pDraw); - if (status != Success) - { - return status; - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - - if(!pImage) - return BadMatch; - - if(!(shmdesc = (ShmDescPtr)LookupIDByType(stuff->shmseg, ShmSegType))) - { - client->errorValue = stuff->shmseg; - return BadShmSegCode; - } - - width = stuff->width; - height = stuff->height; - size_needed = (*pPort->pAdaptor->ddQueryImageAttributes)(client, - pPort, pImage, &width, &height, NULL, NULL); - if((size_needed + stuff->offset) > shmdesc->size) - return BadAccess; - - if((width < stuff->width) || (height < stuff->height)) - return BadValue; - - status = XVCALL(diPutImage)(client, pDraw, pPort, pGC, - stuff->src_x, stuff->src_y, - stuff->src_w, stuff->src_h, - stuff->drw_x, stuff->drw_y, - stuff->drw_w, stuff->drw_h, pImage, - (unsigned char *)shmdesc->addr + stuff->offset, - stuff->send_event, stuff->width, stuff->height); - - if((status == Success) && stuff->send_event) { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.sequenceNumber = client->sequence; - ev.minorEvent = xv_ShmPutImage; - ev.majorEvent = XvReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; - WriteEventsToClient(client, 1, (xEvent *) &ev); - } - - return status; -} -#endif - -#ifdef XvMCExtension -#include "xvmcext.h" -#endif - -static int -ProcXvQueryImageAttributes(ClientPtr client) -{ - xvQueryImageAttributesReply rep; - int size, num_planes, i; - CARD16 width, height; - XvImagePtr pImage = NULL; - XvPortPtr pPort; - int *offsets; - int *pitches; - REQUEST(xvQueryImageAttributesReq); - - REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - for(i = 0; i < pPort->pAdaptor->nImages; i++) { - if(pPort->pAdaptor->pImages[i].id == stuff->id) { - pImage = &(pPort->pAdaptor->pImages[i]); - break; - } - } - -#ifdef XvMCExtension - if(!pImage) - pImage = XvMCFindXvImage(pPort, stuff->id); -#endif - - if(!pImage) - return BadMatch; - - num_planes = pImage->num_planes; - - if(!(offsets = xalloc(num_planes << 3))) - return BadAlloc; - pitches = offsets + num_planes; - - width = stuff->width; - height = stuff->height; - - size = (*pPort->pAdaptor->ddQueryImageAttributes)(client, pPort, pImage, - &width, &height, offsets, pitches); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = num_planes << 1; - rep.num_planes = num_planes; - rep.width = width; - rep.height = height; - rep.data_size = size; - - _WriteQueryImageAttributesReply(client, &rep); - if(client->swapped) - SwapLongs((CARD32*)offsets, rep.length); - WriteToClient(client, rep.length << 2, (char*)offsets); - - xfree(offsets); - - return Success; -} - -static int -ProcXvListImageFormats(ClientPtr client) -{ - XvPortPtr pPort; - XvImagePtr pImage; - int i; - xvListImageFormatsReply rep; - xvImageFormatInfo info; - REQUEST(xvListImageFormatsReq); - - REQUEST_SIZE_MATCH(xvListImageFormatsReq); - - if(!(pPort = LOOKUP_PORT(stuff->port, client) )) - { - client->errorValue = stuff->port; - return (_XvBadPort); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_formats = pPort->pAdaptor->nImages; - rep.length = rep.num_formats * sz_xvImageFormatInfo >> 2; - - _WriteListImageFormatsReply(client, &rep); - - pImage = pPort->pAdaptor->pImages; - - for(i = 0; i < rep.num_formats; i++, pImage++) { - info.id = pImage->id; - info.type = pImage->type; - info.byte_order = pImage->byte_order; - memcpy(&info.guid, pImage->guid, 16); - info.bpp = pImage->bits_per_pixel; - info.num_planes = pImage->num_planes; - info.depth = pImage->depth; - info.red_mask = pImage->red_mask; - info.green_mask = pImage->green_mask; - info.blue_mask = pImage->blue_mask; - info.format = pImage->format; - info.y_sample_bits = pImage->y_sample_bits; - info.u_sample_bits = pImage->u_sample_bits; - info.v_sample_bits = pImage->v_sample_bits; - info.horz_y_period = pImage->horz_y_period; - info.horz_u_period = pImage->horz_u_period; - info.horz_v_period = pImage->horz_v_period; - info.vert_y_period = pImage->vert_y_period; - info.vert_u_period = pImage->vert_u_period; - info.vert_v_period = pImage->vert_v_period; - memcpy(&info.comp_order, pImage->component_order, 32); - info.scanline_order = pImage->scanline_order; - _WriteImageFormatInfo(client, &info); - } - - return Success; -} - - - -/* Swapped Procs */ - -static int -SProcXvQueryExtension(ClientPtr client) -{ - register char n; - REQUEST(xvQueryExtensionReq); - swaps(&stuff->length, n); - return ProcXvQueryExtension(client); -} - -static int -SProcXvQueryAdaptors(ClientPtr client) -{ - register char n; - REQUEST(xvQueryAdaptorsReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcXvQueryAdaptors(client); -} - -static int -SProcXvQueryEncodings(ClientPtr client) -{ - register char n; - REQUEST(xvQueryEncodingsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvQueryEncodings(client); -} - -static int -SProcXvGrabPort(ClientPtr client) -{ - register char n; - REQUEST(xvGrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); - return ProcXvGrabPort(client); -} - -static int -SProcXvUngrabPort(ClientPtr client) -{ - register char n; - REQUEST(xvUngrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); - return ProcXvUngrabPort(client); -} - -static int -SProcXvPutVideo(ClientPtr client) -{ - register char n; - REQUEST(xvPutVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvPutVideo(client); -} - -static int -SProcXvPutStill(ClientPtr client) -{ - register char n; - REQUEST(xvPutStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvPutStill(client); -} - -static int -SProcXvGetVideo(ClientPtr client) -{ - register char n; - REQUEST(xvGetVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvGetVideo(client); -} - -static int -SProcXvGetStill(ClientPtr client) -{ - register char n; - REQUEST(xvGetStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvGetStill(client); -} - -static int -SProcXvPutImage(ClientPtr client) -{ - register char n; - REQUEST(xvPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->id, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return ProcXvPutImage(client); -} - -#ifdef MITSHM -static int -SProcXvShmPutImage(ClientPtr client) -{ - register char n; - REQUEST(xvShmPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->id, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->offset, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return ProcXvShmPutImage(client); -} -#endif - - -static int -SProcXvSelectVideoNotify(ClientPtr client) -{ - register char n; - REQUEST(xvSelectVideoNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - return ProcXvSelectVideoNotify(client); -} - -static int -SProcXvSelectPortNotify(ClientPtr client) -{ - register char n; - REQUEST(xvSelectPortNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvSelectPortNotify(client); -} - -static int -SProcXvStopVideo(ClientPtr client) -{ - register char n; - REQUEST(xvStopVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - return ProcXvStopVideo(client); -} - -static int -SProcXvSetPortAttribute(ClientPtr client) -{ - register char n; - REQUEST(xvSetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); - return ProcXvSetPortAttribute(client); -} - -static int -SProcXvGetPortAttribute(ClientPtr client) -{ - register char n; - REQUEST(xvGetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); - return ProcXvGetPortAttribute(client); -} - -static int -SProcXvQueryBestSize(ClientPtr client) -{ - register char n; - REQUEST(xvQueryBestSizeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - return ProcXvQueryBestSize(client); -} - -static int -SProcXvQueryPortAttributes(ClientPtr client) -{ - register char n; - REQUEST(xvQueryPortAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvQueryPortAttributes(client); -} - -static int -SProcXvQueryImageAttributes(ClientPtr client) -{ - register char n; - REQUEST(xvQueryImageAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->id, n); - swaps(&stuff->width, n); - swaps(&stuff->width, n); - return ProcXvQueryImageAttributes(client); -} - -static int -SProcXvListImageFormats(ClientPtr client) -{ - register char n; - REQUEST(xvListImageFormatsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - return ProcXvListImageFormats(client); -} - - -static int -SWriteQueryExtensionReply( - ClientPtr client, - xvQueryExtensionReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->version, n); - swaps(&rep->revision, n); - - (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryAdaptorsReply( - ClientPtr client, - xvQueryAdaptorsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_adaptors, n); - - (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryEncodingsReply( - ClientPtr client, - xvQueryEncodingsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_encodings, n); - - (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep); - - return Success; -} - -static int -SWriteAdaptorInfo( - ClientPtr client, - xvAdaptorInfo *pAdaptor -){ - register char n; - - swapl(&pAdaptor->base_id, n); - swaps(&pAdaptor->name_size, n); - swaps(&pAdaptor->num_ports, n); - swaps(&pAdaptor->num_formats, n); - - (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor); - - return Success; -} - -static int -SWriteEncodingInfo( - ClientPtr client, - xvEncodingInfo *pEncoding -){ - register char n; - - swapl(&pEncoding->encoding, n); - swaps(&pEncoding->name_size, n); - swaps(&pEncoding->width, n); - swaps(&pEncoding->height, n); - swapl(&pEncoding->rate.numerator, n); - swapl(&pEncoding->rate.denominator, n); - (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding); - - return Success; -} - -static int -SWriteFormat( - ClientPtr client, - xvFormat *pFormat -){ - register char n; - - swapl(&pFormat->visual, n); - (void)WriteToClient(client, sz_xvFormat, (char *)pFormat); - - return Success; -} - -static int -SWriteAttributeInfo( - ClientPtr client, - xvAttributeInfo *pAtt -){ - register char n; - - swapl(&pAtt->flags, n); - swapl(&pAtt->size, n); - swapl(&pAtt->min, n); - swapl(&pAtt->max, n); - (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt); - - return Success; -} - -static int -SWriteImageFormatInfo( - ClientPtr client, - xvImageFormatInfo *pImage -){ - register char n; - - swapl(&pImage->id, n); - swapl(&pImage->red_mask, n); - swapl(&pImage->green_mask, n); - swapl(&pImage->blue_mask, n); - swapl(&pImage->y_sample_bits, n); - swapl(&pImage->u_sample_bits, n); - swapl(&pImage->v_sample_bits, n); - swapl(&pImage->horz_y_period, n); - swapl(&pImage->horz_u_period, n); - swapl(&pImage->horz_v_period, n); - swapl(&pImage->vert_y_period, n); - swapl(&pImage->vert_u_period, n); - swapl(&pImage->vert_v_period, n); - - (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage); - - return Success; -} - - - -static int -SWriteGrabPortReply( - ClientPtr client, - xvGrabPortReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - - (void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep); - - return Success; -} - -static int -SWriteGetPortAttributeReply( - ClientPtr client, - xvGetPortAttributeReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->value, n); - - (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryBestSizeReply( - ClientPtr client, - xvQueryBestSizeReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->actual_width, n); - swaps(&rep->actual_height, n); - - (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryPortAttributesReply( - ClientPtr client, - xvQueryPortAttributesReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_attributes, n); - swapl(&rep->text_size, n); - - (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep); - - return Success; -} - -static int -SWriteQueryImageAttributesReply( - ClientPtr client, - xvQueryImageAttributesReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_planes, n); - swapl(&rep->data_size, n); - swaps(&rep->width, n); - swaps(&rep->height, n); - - (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep); - - return Success; -} - - -static int -SWriteListImageFormatsReply( - ClientPtr client, - xvListImageFormatsReply *rep -){ - register char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_formats, n); - - (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep); - - return Success; -} - - -#ifdef PANORAMIX - - - - -static int -XineramaXvStopVideo(ClientPtr client) -{ - int result = Success, i; - PanoramiXRes *draw, *port; - REQUEST(xvStopVideoReq); - REQUEST_SIZE_MATCH(xvStopVideoReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - result = ProcXvStopVideo(client); - } - } - - return result; -} - -static int -XineramaXvSetPortAttribute(ClientPtr client) -{ - REQUEST(xvSetPortAttributeReq); - PanoramiXRes *port; - int result = Success, i; - - REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->port = port->info[i].id; - result = ProcXvSetPortAttribute(client); - } - } - return result; -} - - -#ifdef MITSHM -static int -XineramaXvShmPutImage(ClientPtr client) -{ - REQUEST(xvShmPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool send_event = stuff->send_event; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_SIZE_MATCH(xvShmPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - stuff->send_event = (send_event && !i) ? 1 : 0; - - result = ProcXvShmPutImage(client); - } - } - return result; -} -#endif - -static int -XineramaXvPutImage(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutImage(client); - } - } - return result; -} - -static int -XineramaXvPutVideo(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutVideoReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutVideo(client); - } - } - return result; -} - -static int -XineramaXvPutStill(ClientPtr client) -{ - REQUEST(xvPutImageReq); - PanoramiXRes *draw, *gc, *port; - Bool isRoot; - int result = Success, i, x, y; - - REQUEST_AT_LEAST_SIZE(xvPutImageReq); - - if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) - return BadDrawable; - - if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) - return BadGC; - - if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) - return _XvBadPort; - - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; - - x = stuff->drw_x; - y = stuff->drw_y; - - FOR_NSCREENS_BACKWARD(i) { - if(port->info[i].id) { - stuff->drawable = draw->info[i].id; - stuff->port = port->info[i].id; - stuff->gc = gc->info[i].id; - stuff->drw_x = x; - stuff->drw_y = y; - if(isRoot) { - stuff->drw_x -= panoramiXdataPtr[i].x; - stuff->drw_y -= panoramiXdataPtr[i].y; - } - - result = ProcXvPutStill(client); - } - } - return result; -} - - -void XineramifyXv(void) -{ - ScreenPtr pScreen, screen0 = screenInfo.screens[0]; - XvScreenPtr xvsp0 = (XvScreenPtr)screen0->devPrivates[XvScreenIndex].ptr; - XvAdaptorPtr refAdapt, pAdapt; - XvAttributePtr pAttr; - XvScreenPtr xvsp; - Bool isOverlay, hasOverlay; - PanoramiXRes *port; - XvAdaptorPtr MatchingAdaptors[MAXSCREENS]; - int i, j, k, l; - - XvXRTPort = CreateNewResourceType(XineramaDeleteResource); - - if(!xvsp0) return; - - for(i = 0; i < xvsp0->nAdaptors; i++) { - refAdapt = xvsp0->pAdaptors + i; - - bzero(MatchingAdaptors, sizeof(XvAdaptorPtr) * MAXSCREENS); - - MatchingAdaptors[0] = refAdapt; - - if(!(refAdapt->type & XvInputMask)) continue; - - isOverlay = FALSE; - for(j = 0; j < refAdapt->nAttributes; j++) { - pAttr = refAdapt->pAttributes + j; - if(!strcmp(pAttr->name, "XV_COLORKEY")) { - isOverlay = TRUE; - break; - } - } - - for(j = 1; j < PanoramiXNumScreens; j++) { - pScreen = screenInfo.screens[j]; - xvsp = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr; - - /* Do not try to go on if xv is not supported on this screen */ - if (xvsp==NULL) continue ; - - /* if the adaptor has the same name it's a perfect match */ - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if(!strcmp(refAdapt->name, pAdapt->name)) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - if(MatchingAdaptors[j]) continue; /* found it */ - - /* otherwise we only look for XvImage adaptors */ - if(!(refAdapt->type & XvImageMask)) continue; - if(refAdapt->nImages <= 0) continue; - - /* prefer overlay/overlay non-overlay/non-overlay pairing */ - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) { - hasOverlay = FALSE; - for(l = 0; l < pAdapt->nAttributes; l++) { - if(!strcmp(pAdapt->name, "XV_COLORKEY")) { - hasOverlay = TRUE; - break; - } - } - if(isOverlay && hasOverlay) { - MatchingAdaptors[j] = pAdapt; - break; - } - else if(!isOverlay && !hasOverlay) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - } - - if(MatchingAdaptors[j]) continue; /* found it */ - - /* but we'll take any XvImage pairing if we can get it */ - - for(k = 0; k < xvsp->nAdaptors; k++) { - pAdapt = xvsp->pAdaptors + k; - if((pAdapt->type & XvImageMask) && (pAdapt->nImages > 0)) { - MatchingAdaptors[j] = pAdapt; - break; - } - } - } - - /* now create a resource for each port */ - for(j = 0; j < refAdapt->nPorts; j++) { - if(!(port = xalloc(sizeof(PanoramiXRes)))) - break; - port->info[0].id = MatchingAdaptors[0]->base_id + j; - AddResource(port->info[0].id, XvXRTPort, port); - - for(k = 1; k < PanoramiXNumScreens; k++) { - if(MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j)) - port->info[k].id = MatchingAdaptors[k]->base_id + j; - else - port->info[k].id = 0; - } - } - } -} - -#endif 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 - -/* - * 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 - -/* - * 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/mi/Imakefile.NX.original b/nx-X11/programs/Xserver/mi/Imakefile.NX.original deleted file mode 100644 index b85a9f98b..000000000 --- a/nx-X11/programs/Xserver/mi/Imakefile.NX.original +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:36 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/mi/Imakefile,v 3.34 2002/05/22 21:38:31 herrb Exp $ - -#include - -#if ! HasCbrt -CBRT_SRC = cbrt.c -CBRT_OBJ = cbrt.o -#endif - -#if HasFfs -FFS_DEFINES = -DHAS_FFS -#endif - -#if DoLoadableServer -EXTRAMIINITEXTOBJ = miinitext.o -#else -MIINITEXTSRC = miinitext.c -MIINITEXTOBJ = miinitext.o -#endif - -SRCS = $(CBRT_SRC) mivaltree.c mipolyseg.c mipolyrect.c \ - mipoly.c mipolycon.c mipolygen.c mipolyutil.c \ - mifillrct.c miwideline.c mispans.c \ - miarc.c mizerarc.c mifillarc.c \ - miwindow.c micursor.c miregion.c \ - mipolytext.c mibitblt.c mipolypnt.c mipushpxl.c \ - miexpose.c miglblt.c mizerline.c mizerclip.c mifpolycon.c \ - midash.c mibstore.c mibank.c $(MIINITEXTSRC) mieq.c \ - mipointer.c misprite.c midispcur.c miscrinit.c miclipn.c migc.c \ - micmap.c mioverlay.c - -OBJS = $(CBRT_OBJ) mivaltree.o mipolyseg.o mipolyrect.o \ - mipoly.o mipolycon.o mipolygen.o mipolyutil.o \ - mifillrct.o miwideline.o mispans.o \ - miarc.o mizerarc.o mifillarc.o \ - miwindow.o micursor.o miregion.o \ - mipolytext.o mibitblt.o mipolypnt.o mipushpxl.o \ - miexpose.o miglblt.o mizerline.o mizerclip.o mifpolycon.o \ - midash.o mibstore.o mibank.o $(MIINITEXTOBJ) mieq.o \ - mipointer.o misprite.o midispcur.o miscrinit.o miclipn.o migc.o \ - micmap.o mioverlay.o - -#if (defined (XFree86Version) || defined(XorgVersion)) -/* - * Make sure XINPUT, XF86VidTune, etc aren't defined for the miinitext.o - * used by Xnest, Xvfb - */ - -#if NXLibraries - -/* - * To build the NX agent we need the XINPUT symbol - * in order to build the XInputExtension, since we - * don't use the XF86 module loader. - */ - -EXT_DEFINES = ExtensionDefines -UXF86VIDMODE -UXFreeXDGA -UXF86MISC \ - -UXFree86LOADER - -#else - -EXT_DEFINES = ExtensionDefines -UXINPUT -UXF86VIDMODE -UXFreeXDGA -UXF86MISC \ - -UXFree86LOADER - -#endif - -#endif - -INCLUDES = -I. -I../include -I../../../include/fonts -I../render \ - -I../xfixes -I../damageext -I../miext/damage \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext -LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln -DEFINES = $(FFS_DEFINES) - -NormalLibraryObjectRule() -NormalLibraryTarget(mi,$(OBJS)) -LintLibraryTarget(mi,$(SRCS)) -NormalLintTarget($(SRCS)) - -#ifndef Win32Architecture -NormalLibraryTarget(cbrt,cbrt.o) -#endif - -SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES)) -SpecialCObjectRule(miscrinit,$(ICONFIGFILES),$(EXT_DEFINES)) -#ifdef ItsyCompilerBug -SpecialCObjectRule(mipolycon,$(_NOOP_),-O0) -#endif -#if defined(OpenBSDArchitecture) && defined(Sparc64Architecture) -SpecialCObjectRule(mizerclip,NullParameter,-O0) -#endif - -AllTarget($(EXTRAMIINITEXTOBJ)) - -DependTarget() - -InstallDriverSDKNonExecFile(mi.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mibank.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mibstore.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(micmap.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(migc.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(miline.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mipointer.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mipointrst.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mizerarc.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(micoord.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/mi/Imakefile.X.original b/nx-X11/programs/Xserver/mi/Imakefile.X.original deleted file mode 100644 index a6a3c97fa..000000000 --- a/nx-X11/programs/Xserver/mi/Imakefile.X.original +++ /dev/null @@ -1,94 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:36 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/mi/Imakefile,v 3.34 2002/05/22 21:38:31 herrb Exp $ - -#include - -#if ! HasCbrt -CBRT_SRC = cbrt.c -CBRT_OBJ = cbrt.o -#endif - -#if HasFfs -FFS_DEFINES = -DHAS_FFS -#endif - -#if DoLoadableServer -EXTRAMIINITEXTOBJ = miinitext.o -#else -MIINITEXTSRC = miinitext.c -MIINITEXTOBJ = miinitext.o -#endif - -SRCS = $(CBRT_SRC) mivaltree.c mipolyseg.c mipolyrect.c \ - mipoly.c mipolycon.c mipolygen.c mipolyutil.c \ - mifillrct.c miwideline.c mispans.c \ - miarc.c mizerarc.c mifillarc.c \ - miwindow.c micursor.c miregion.c \ - mipolytext.c mibitblt.c mipolypnt.c mipushpxl.c \ - miexpose.c miglblt.c mizerline.c mizerclip.c mifpolycon.c \ - midash.c mibstore.c mibank.c $(MIINITEXTSRC) mieq.c \ - mipointer.c misprite.c midispcur.c miscrinit.c miclipn.c migc.c \ - micmap.c mioverlay.c - -OBJS = $(CBRT_OBJ) mivaltree.o mipolyseg.o mipolyrect.o \ - mipoly.o mipolycon.o mipolygen.o mipolyutil.o \ - mifillrct.o miwideline.o mispans.o \ - miarc.o mizerarc.o mifillarc.o \ - miwindow.o micursor.o miregion.o \ - mipolytext.o mibitblt.o mipolypnt.o mipushpxl.o \ - miexpose.o miglblt.o mizerline.o mizerclip.o mifpolycon.o \ - midash.o mibstore.o mibank.o $(MIINITEXTOBJ) mieq.o \ - mipointer.o misprite.o midispcur.o miscrinit.o miclipn.o migc.o \ - micmap.o mioverlay.o - -#if (defined (XFree86Version) || defined(XorgVersion)) -/* - * Make sure XINPUT, XF86VidTune, etc aren't defined for the miinitext.o - * used by Xnest, Xvfb - */ -EXT_DEFINES = ExtensionDefines -UXINPUT -UXF86VIDMODE -UXFreeXDGA -UXF86MISC \ - -UXFree86LOADER -#endif - -INCLUDES = -I. -I../include -I../../../include/fonts -I../render \ - -I../xfixes -I../damageext -I../miext/damage \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext -LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln -DEFINES = $(FFS_DEFINES) - -NormalLibraryObjectRule() -NormalLibraryTarget(mi,$(OBJS)) -LintLibraryTarget(mi,$(SRCS)) -NormalLintTarget($(SRCS)) - -#ifndef Win32Architecture -NormalLibraryTarget(cbrt,cbrt.o) -#endif - -SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES)) -SpecialCObjectRule(miscrinit,$(ICONFIGFILES),$(EXT_DEFINES)) -#ifdef ItsyCompilerBug -SpecialCObjectRule(mipolycon,$(_NOOP_),-O0) -#endif -#if defined(OpenBSDArchitecture) && defined(Sparc64Architecture) -SpecialCObjectRule(mizerclip,NullParameter,-O0) -#endif - -AllTarget($(EXTRAMIINITEXTOBJ)) - -DependTarget() - -InstallDriverSDKNonExecFile(mi.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mibank.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mibstore.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(micmap.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(migc.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(miline.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mipointer.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mipointrst.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(mizerarc.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(micoord.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/os/Imakefile.NX.original b/nx-X11/programs/Xserver/os/Imakefile.NX.original deleted file mode 100644 index 22be06074..000000000 --- a/nx-X11/programs/Xserver/os/Imakefile.NX.original +++ /dev/null @@ -1,235 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:40 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/os/Imakefile,v 3.40 2003/09/09 03:20:41 dawes Exp $ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#include - -/* - * If you have any extra files to be put into the library, define them here. - */ - -#if NXLibraries - -NX_INCLUDES = -I../../../../nxcomp - -NX_DEFINES = -DNX_TRANS_SOCKET \ - -DNX_TRANS_AUTH \ - -DNX_TRANS_FOPEN \ - -DNX_TRANS_SLEEP \ - -DNX_TRANS_EXIT \ - -DNX_TRANS_WAKEUP=1000 - -# -DNX_TRANS_WARN \ -# -DNX_TRANS_INFO \ -# -DNX_TRANS_TEST \ -# -DNX_TRANS_DEBUG \ - -#endif - -/* - * do not modify the following two definitions - */ - -#ifndef OtherSources -#define OtherSources -#endif - -#ifndef OtherObjects -#define OtherObjects -#endif - -#if HasXdmAuth -XDMAUTHDEFS = -DHASXDMAUTH -XDMAUTHOBJS = xdmauth.o -XDMAUTHSRCS = xdmauth.c -#else -XDMAUTHDEFS = -XDMAUTHOBJS = -XDMAUTHSCRS = -#endif - -#if HasSecureRPC -RPCDEFS = -DSECURE_RPC -RPCOBJS = rpcauth.o -RPCSRCS = rpcauth.c -#else -RPCDEFS = -RPCOBJS = -RPCSRCS = -#endif - -#if HasKrb5 -KRB5OBJS = k5auth.o k5encode.o -KRB5SRCS = k5auth.c k5encode.c -#endif - -#if HasBSD44Sockets - SOCK_DEFINES = -DBSD44SOCKETS -#endif - -#if HasGetIfAddrs - IFADDRS_DEFINES = -DHAS_GETIFADDRS -#endif - -#if BuildLBX - LBX_SRCS = lbxio.c - LBX_OBJS = lbxio.o -#else - LBX_SRCS = - LBX_OBJS = -#endif - -#if !defined(DDXOsColor) -COLOR_SRCS=oscolor.c -COLOR_OBJS=oscolor.o -#endif - -#if UseInternalMalloc -MALLOC_SRCS=xalloc.c -MALLOC_OBJS=xalloc.o -#endif - -#if !HasSnprintf -SNPRINTF_SRCS = snprintf.c -SNPRINTF_OBJS = snprintf.o -#endif - -#if !HasStrlcat -STRLCAT_SRCS = strlcat.c strlcpy.c -STRLCAT_OBJS = strlcat.o strlcpy.o -#endif - -#if HasGetpeerucred -GETPEER_DEFINES = -DHAS_GETPEERUCRED -#else -# if HasGetpeereid -GETPEER_DEFINES = -DHAS_GETPEEREID -# endif -#endif - -BOOTSTRAPCFLAGS = - SRCS = WaitFor.c access.c connection.c io.c $(COLOR_SRCS) \ - osinit.c utils.c log.c auth.c mitauth.c secauth.c \ - $(XDMAUTHSRCS) $(RPCSRCS) $(KRB5SRCS) xdmcp.c OtherSources \ - transport.c $(SNPRINTF_SRCS) $(STRLCAT_SRCS) \ - $(MALLOC_SRCS) $(LBX_SRCS) xprintf.c - OBJS = WaitFor.o access.o connection.o io.o $(COLOR_OBJS) \ - osinit.o utils.o log.o auth.o mitauth.o secauth.o \ - $(XDMAUTHOBJS) $(RPCOBJS) $(KRB5OBJS) xdmcp.o OtherObjects \ - transport.o $(SNPRINTF_OBJS) $(STRLCAT_OBJS) \ - $(MALLOC_OBJS) $(LBX_OBJS) xprintf.o - -#if SpecialMalloc - MEM_DEFINES = -DSPECIAL_MALLOC -#endif /* SpecialMalloc */ -#if UseInternalMalloc - MEM_DEFINES = -DINTERNAL_MALLOC -#endif -#if UseMemLeak - MEM_DEFINES = -DMEMBUG -#endif -#if UseRgbTxt - RGB_DEFINES = -DUSE_RGB_TXT -#endif - DBM_DEFINES = NdbmDefines - ADM_DEFINES = -DADMPATH=\"$(ADMDIR)/X\%smsgs\" - XDMCP_DEFINES = ServerXdmcpDefines - KRB5_DEFINES = Krb5Defines - XALLOC_DEFINES = XallocDefines - ERROR_DEFINES = ServerErrorDefines -#if HasPam && HasPamMisc - PAM_DEFINES = -DUSE_PAM -#endif - DEFINES = -DXSERV_t -DTRANS_SERVER $(CONNECTION_FLAGS) $(MEM_DEFINES) \ - $(XDMAUTHDEFS) $(RPCDEFS) $(SIGNAL_DEFINES) $(OS_DEFINES) \ - $(KRB5_DEFINES) $(RGB_DEFINES) $(GETPEER_DEFINES) \ - $(RANDOM_DEFINES) $(BUGMSG) $(XTRANS_FAILDEFINES) $(NX_DEFINES) - INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(SERVERSRC)/Xext -I$(FONTINCSRC) -I$(SERVERSRC)/render \ - -I$(TOP)/lib/Xau -I../lbx -I../Xprint Krb5Includes $(NX_INCLUDES) - DEPEND_DEFINES = $(DBM_DEFINES) $(XDMCP_DEFINES) $(EXT_DEFINES) \ - $(TRANS_INCLUDES) $(CONNECTION_FLAGS) $(GETPEER_DEFINES) \ - DependDefines - LINTLIBS = ../dix/llib-ldix.ln - -#ifdef NEED_ALLOCA_FROM_LIBPW - PWLIB = /lib/libPW.a -#endif /* NEED_ALLOCA_FROM_LIBPW */ - -NormalLibraryObjectRule() -NormalLibraryTarget(os,$(OBJS)) -LintLibraryTarget(os,$(SRCS)) -NormalLintTarget($(SRCS)) - -#ifdef NEED_ALLOCA_FROM_LIBPW -XCOMM -XCOMM And this one is to get the version of alloca that lives in /lib/libPW.a -XCOMM without getting all of the rest of the stuff in there. -XCOMM -alloca.o: $(PWLIB) - rm -f alloca.o - ar x $(PWLIB) alloca.o -#endif /* NEED_ALLOCA_FROM_LIBPW */ - -SpecialCObjectRule(access,$(ICONFIGFILES),$(XDMCP_DEFINES) $(SOCK_DEFINES) $(IFADDRS_DEFINES)) -SpecialCObjectRule(auth,$(ICONFIGFILES),$(XDMCP_DEFINES)) -SpecialCObjectRule(xdmauth,$(ICONFIGFILES),$(XDMCP_DEFINES)) -SpecialCObjectRule(xdmcp,$(ICONFIGFILES),$(SOCK_DEFINES) $(XDMCP_DEFINES)) -SpecialCObjectRule(connection,$(ICONFIGFILES),$(SOCK_DEFINES) $(XDMCP_DEFINES)) -SpecialCObjectRule(transport,$(ICONFIGFILES),$(TRANS_INCLUDES) $(CONN_DEFINES) $(SOCK_DEFINES)) -LinkSourceFile(transport.c,$(TRANSCOMMSRC)) -SpecialCObjectRule(osinit,$(ICONFIGFILES),$(ADM_DEFINES)) -SpecialCObjectRule(WaitFor,$(ICONFIGFILES),$(EXT_DEFINES)) -SpecialCObjectRule(io,$(ICONFIGFILES),$(EXT_DEFINES)) -#if BuildLBX -SpecialCObjectRule(lbxio,$(ICONFIGFILES),$(EXT_DEFINES)) -#endif -SpecialCObjectRule(utils,$(ICONFIGFILES),$(XDMCP_DEFINES) $(EXT_DEFINES) $(ERROR_DEFINES) $(PAM_DEFINES)) -SpecialCObjectRule(xalloc,$(ICONFIGFILES),$(XALLOC_DEFINES)) -#if defined(SparcArchitecture) && HasGcc && !HasGcc2 -oscolor.o: oscolor.c $(ICONFIGFILES) - $(RM) $@ - cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c -#else -SpecialCObjectRule(oscolor,$(ICONFIGFILES),$(DBM_DEFINES)) -#endif - -#if HasKrb5 -LinkSourceFile(k5encode.c,$(XAUTHSRC)) -#endif - -#if !HasSnprintf -LinkSourceFile(snprintf.c,$(LIBSRC)/misc) -#endif - -#if !HasStrlcat -LinkSourceFile(strlcat.c,$(LIBSRC)/misc) -LinkSourceFile(strlcpy.c,$(LIBSRC)/misc) -#endif - -#if DoLoadableServer -AllTarget(libcwrapper.o) -ObjectFromSpecialSource(libcwrapper,$(XF86OSSRC)/shared/libc_wrapper,-DSELF_CONTAINED_WRAPPER) -#endif - -DependTarget() diff --git a/nx-X11/programs/Xserver/os/Imakefile.X.original b/nx-X11/programs/Xserver/os/Imakefile.X.original deleted file mode 100644 index c24a016dc..000000000 --- a/nx-X11/programs/Xserver/os/Imakefile.X.original +++ /dev/null @@ -1,200 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:40 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/os/Imakefile,v 3.40 2003/09/09 03:20:41 dawes Exp $ - -#include - -/* - * If you have any extra files to be put into the library, define them here. - */ - -/* - * do not modify the following two definitions - */ - -#ifndef OtherSources -#define OtherSources -#endif - -#ifndef OtherObjects -#define OtherObjects -#endif - -#if HasXdmAuth -XDMAUTHDEFS = -DHASXDMAUTH -XDMAUTHOBJS = xdmauth.o -XDMAUTHSRCS = xdmauth.c -#else -XDMAUTHDEFS = -XDMAUTHOBJS = -XDMAUTHSCRS = -#endif - -#if HasSecureRPC -RPCDEFS = -DSECURE_RPC -RPCOBJS = rpcauth.o -RPCSRCS = rpcauth.c -#else -RPCDEFS = -RPCOBJS = -RPCSRCS = -#endif - -#if HasKrb5 -KRB5OBJS = k5auth.o k5encode.o -KRB5SRCS = k5auth.c k5encode.c -#endif - -#if HasBSD44Sockets - SOCK_DEFINES = -DBSD44SOCKETS -#endif - -#if HasGetIfAddrs - IFADDRS_DEFINES = -DHAS_GETIFADDRS -#endif - -#if BuildLBX - LBX_SRCS = lbxio.c - LBX_OBJS = lbxio.o -#else - LBX_SRCS = - LBX_OBJS = -#endif - -#if !defined(DDXOsColor) -COLOR_SRCS=oscolor.c -COLOR_OBJS=oscolor.o -#endif - -#if UseInternalMalloc -MALLOC_SRCS=xalloc.c -MALLOC_OBJS=xalloc.o -#endif - -#if !HasSnprintf -SNPRINTF_SRCS = snprintf.c -SNPRINTF_OBJS = snprintf.o -#endif - -#if !HasStrlcat -STRLCAT_SRCS = strlcat.c strlcpy.c -STRLCAT_OBJS = strlcat.o strlcpy.o -#endif - -#if HasGetpeerucred -GETPEER_DEFINES = -DHAS_GETPEERUCRED -#else -# if HasGetpeereid -GETPEER_DEFINES = -DHAS_GETPEEREID -# endif -#endif - -BOOTSTRAPCFLAGS = - SRCS = WaitFor.c access.c connection.c io.c $(COLOR_SRCS) \ - osinit.c utils.c log.c auth.c mitauth.c secauth.c \ - $(XDMAUTHSRCS) $(RPCSRCS) $(KRB5SRCS) xdmcp.c OtherSources \ - transport.c $(SNPRINTF_SRCS) $(STRLCAT_SRCS) \ - $(MALLOC_SRCS) $(LBX_SRCS) xprintf.c - OBJS = WaitFor.o access.o connection.o io.o $(COLOR_OBJS) \ - osinit.o utils.o log.o auth.o mitauth.o secauth.o \ - $(XDMAUTHOBJS) $(RPCOBJS) $(KRB5OBJS) xdmcp.o OtherObjects \ - transport.o $(SNPRINTF_OBJS) $(STRLCAT_OBJS) \ - $(MALLOC_OBJS) $(LBX_OBJS) xprintf.o - -#if SpecialMalloc - MEM_DEFINES = -DSPECIAL_MALLOC -#endif /* SpecialMalloc */ -#if UseInternalMalloc - MEM_DEFINES = -DINTERNAL_MALLOC -#endif -#if UseMemLeak - MEM_DEFINES = -DMEMBUG -#endif -#if UseRgbTxt - RGB_DEFINES = -DUSE_RGB_TXT -#endif - DBM_DEFINES = NdbmDefines - ADM_DEFINES = -DADMPATH=\"$(ADMDIR)/X\%smsgs\" - XDMCP_DEFINES = ServerXdmcpDefines - KRB5_DEFINES = Krb5Defines - XALLOC_DEFINES = XallocDefines - ERROR_DEFINES = ServerErrorDefines -#if HasPam && HasPamMisc - PAM_DEFINES = -DUSE_PAM -#endif - DEFINES = -DXSERV_t -DTRANS_SERVER $(CONNECTION_FLAGS) $(MEM_DEFINES) \ - $(XDMAUTHDEFS) $(RPCDEFS) $(SIGNAL_DEFINES) $(OS_DEFINES) \ - $(KRB5_DEFINES) $(RGB_DEFINES) $(GETPEER_DEFINES) \ - $(RANDOM_DEFINES) $(BUGMSG) $(XTRANS_FAILDEFINES) - INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(SERVERSRC)/Xext -I$(FONTINCSRC) -I$(SERVERSRC)/render \ - -I$(TOP)/lib/Xau -I../lbx -I../Xprint Krb5Includes - DEPEND_DEFINES = $(DBM_DEFINES) $(XDMCP_DEFINES) $(EXT_DEFINES) \ - $(TRANS_INCLUDES) $(CONNECTION_FLAGS) $(GETPEER_DEFINES) \ - DependDefines - LINTLIBS = ../dix/llib-ldix.ln - -#ifdef NEED_ALLOCA_FROM_LIBPW - PWLIB = /lib/libPW.a -#endif /* NEED_ALLOCA_FROM_LIBPW */ - -NormalLibraryObjectRule() -NormalLibraryTarget(os,$(OBJS)) -LintLibraryTarget(os,$(SRCS)) -NormalLintTarget($(SRCS)) - -#ifdef NEED_ALLOCA_FROM_LIBPW -XCOMM -XCOMM And this one is to get the version of alloca that lives in /lib/libPW.a -XCOMM without getting all of the rest of the stuff in there. -XCOMM -alloca.o: $(PWLIB) - rm -f alloca.o - ar x $(PWLIB) alloca.o -#endif /* NEED_ALLOCA_FROM_LIBPW */ - -SpecialCObjectRule(access,$(ICONFIGFILES),$(XDMCP_DEFINES) $(SOCK_DEFINES) $(IFADDRS_DEFINES)) -SpecialCObjectRule(auth,$(ICONFIGFILES),$(XDMCP_DEFINES)) -SpecialCObjectRule(xdmauth,$(ICONFIGFILES),$(XDMCP_DEFINES)) -SpecialCObjectRule(xdmcp,$(ICONFIGFILES),$(SOCK_DEFINES) $(XDMCP_DEFINES)) -SpecialCObjectRule(connection,$(ICONFIGFILES),$(SOCK_DEFINES) $(XDMCP_DEFINES)) -SpecialCObjectRule(transport,$(ICONFIGFILES),$(TRANS_INCLUDES) $(CONN_DEFINES) $(SOCK_DEFINES)) -LinkSourceFile(transport.c,$(TRANSCOMMSRC)) -SpecialCObjectRule(osinit,$(ICONFIGFILES),$(ADM_DEFINES)) -SpecialCObjectRule(WaitFor,$(ICONFIGFILES),$(EXT_DEFINES)) -SpecialCObjectRule(io,$(ICONFIGFILES),$(EXT_DEFINES)) -#if BuildLBX -SpecialCObjectRule(lbxio,$(ICONFIGFILES),$(EXT_DEFINES)) -#endif -SpecialCObjectRule(utils,$(ICONFIGFILES),$(XDMCP_DEFINES) $(EXT_DEFINES) $(ERROR_DEFINES) $(PAM_DEFINES)) -SpecialCObjectRule(xalloc,$(ICONFIGFILES),$(XALLOC_DEFINES)) -#if defined(SparcArchitecture) && HasGcc && !HasGcc2 -oscolor.o: oscolor.c $(ICONFIGFILES) - $(RM) $@ - cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c -#else -SpecialCObjectRule(oscolor,$(ICONFIGFILES),$(DBM_DEFINES)) -#endif - -#if HasKrb5 -LinkSourceFile(k5encode.c,$(XAUTHSRC)) -#endif - -#if !HasSnprintf -LinkSourceFile(snprintf.c,$(LIBSRC)/misc) -#endif - -#if !HasStrlcat -LinkSourceFile(strlcat.c,$(LIBSRC)/misc) -LinkSourceFile(strlcpy.c,$(LIBSRC)/misc) -#endif - -#if DoLoadableServer -AllTarget(libcwrapper.o) -ObjectFromSpecialSource(libcwrapper,$(XF86OSSRC)/shared/libc_wrapper,-DSELF_CONTAINED_WRAPPER) -#endif - -DependTarget() diff --git a/nx-X11/programs/Xserver/os/WaitFor.c.NX.original b/nx-X11/programs/Xserver/os/WaitFor.c.NX.original deleted file mode 100644 index 2ef474229..000000000 --- a/nx-X11/programs/Xserver/os/WaitFor.c.NX.original +++ /dev/null @@ -1,882 +0,0 @@ -/* $XFree86: xc/programs/Xserver/os/WaitFor.c,v 3.42 2003/10/16 01:33:35 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* $Xorg: WaitFor.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/***************************************************************** - * OS Dependent input routines: - * - * WaitForSomething - * TimerForce, TimerSet, TimerCheck, TimerFree - * - *****************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#endif -#include /* for strings, fcntl, time */ -#include -#include -#include -#include "misc.h" - -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -#endif -#include "osdep.h" -#include -#include "dixstruct.h" -#include "opaque.h" -#ifdef DPMSExtension -#include "dpmsproc.h" -#endif - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_WAKEUP) - -static unsigned long startTimeInMillis; - -#endif - -#ifdef WIN32 -/* Error codes from windows sockets differ from fileio error codes */ -#undef EINTR -#define EINTR WSAEINTR -#undef EINVAL -#define EINVAL WSAEINVAL -#undef EBADF -#define EBADF WSAENOTSOCK -/* Windows select does not set errno. Use GetErrno as wrapper for - WSAGetLastError */ -#define GetErrno WSAGetLastError -#else -/* This is just a fallback to errno to hide the differences between unix and - Windows in the code */ -#define GetErrno() errno -#endif - -/* modifications by raphael */ -int -mffs(fd_mask mask) -{ - int i; - - if (!mask) return 0; - i = 1; - while (!(mask & 1)) - { - i++; - mask >>= 1; - } - return i; -} - -#ifdef DPMSExtension -#define DPMS_SERVER -#include -#endif - -#ifdef XTESTEXT1 -/* - * defined in xtestext1dd.c - */ -extern int playback_on; -#endif /* XTESTEXT1 */ - -struct _OsTimerRec { - OsTimerPtr next; - CARD32 expires; - OsTimerCallback callback; - pointer arg; -}; - -static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev); -static OsTimerPtr timers = NULL; - -/***************** - * WaitForSomething: - * Make the server suspend until there is - * 1. data from clients or - * 2. input events available or - * 3. ddx notices something of interest (graphics - * queue ready, etc.) or - * 4. clients that have buffered replies/events are ready - * - * If the time between INPUT events is - * greater than ScreenSaverTime, the display is turned off (or - * saved, depending on the hardware). So, WaitForSomething() - * has to handle this also (that's why the select() has a timeout. - * For more info on ClientsWithInput, see ReadRequestFromClient(). - * pClientsReady is an array to store ready client->index values into. - *****************/ - -int -WaitForSomething(int *pClientsReady) -{ - int i; - struct timeval waittime, *wt; - INT32 timeout = 0; - fd_set clientsReadable; - fd_set clientsWritable; - int curclient; - int selecterr; - int nready; - fd_set devicesReadable; - CARD32 now = 0; -#ifdef SMART_SCHEDULE - Bool someReady = FALSE; -#endif - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "WaitForSomething: Got called.\n"); -#endif - - FD_ZERO(&clientsReadable); - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_WAKEUP) - - startTimeInMillis = GetTimeInMillis(); - -#endif - - /* We need a while loop here to handle - crashed connections and the screen saver timeout */ - while (1) - { - /* deal with any blocked jobs */ - if (workQueue) - ProcessWorkQueue(); - if (XFD_ANYSET (&ClientsWithInput)) - { -#ifdef SMART_SCHEDULE - if (!SmartScheduleDisable) - { - someReady = TRUE; - waittime.tv_sec = 0; - waittime.tv_usec = 0; - wt = &waittime; - } - else -#endif - { - XFD_COPYSET (&ClientsWithInput, &clientsReadable); - break; - } - } -#ifdef SMART_SCHEDULE - if (someReady) - { - XFD_COPYSET(&AllSockets, &LastSelectMask); - XFD_UNSET(&LastSelectMask, &ClientsWithInput); - } - else - { -#endif - wt = NULL; - if (timers) - { - now = GetTimeInMillis(); - timeout = timers->expires - now; - if (timeout < 0) - timeout = 0; - waittime.tv_sec = timeout / MILLI_PER_SECOND; - waittime.tv_usec = (timeout % MILLI_PER_SECOND) * - (1000000 / MILLI_PER_SECOND); - wt = &waittime; - } - XFD_COPYSET(&AllSockets, &LastSelectMask); -#ifdef SMART_SCHEDULE - } - SmartScheduleIdle = TRUE; -#endif - BlockHandler((pointer)&wt, (pointer)&LastSelectMask); - if (NewOutputPending) - FlushAllOutput(); -#ifdef XTESTEXT1 - /* XXX how does this interact with new write block handling? */ - if (playback_on) { - wt = &waittime; - XTestComputeWaitTime (&waittime); - } -#endif /* XTESTEXT1 */ - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_WAKEUP) - - /* - * If caller has marked the first element of pClientsReady[], - * bail out of select after a short timeout. We need this to - * let the NX agent remove the splash screen when the timeout - * is expired. A better option would be to use the existing - * screen-saver timeout but it can be modified by clients, so - * we would need a special handling. This hack is trivial and - * keeps WaitForSomething() backward compatible with the exis- - * ting servers. - */ - - if (pClientsReady[0] == -1) - { - unsigned long timeoutInMillis; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_WAKEUP) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "WaitForSomething: pClientsReady[0] is [%d], pClientsReady[1] is [%d].\n", - pClientsReady[0], pClientsReady[1]); -#endif - - timeoutInMillis = GetTimeInMillis(); - - if (timeoutInMillis - startTimeInMillis >= NX_TRANS_WAKEUP) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_WAKEUP) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "WaitForSomething: Returning 0 because of wakeup timeout.\n"); -#endif - return 0; - } - - timeoutInMillis = NX_TRANS_WAKEUP - (timeoutInMillis - startTimeInMillis); - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_WAKEUP) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "WaitForSomething: Milliseconds to next wakeup are %ld.\n", - timeoutInMillis); -#endif - if (wt == NULL || (wt -> tv_sec * MILLI_PER_SECOND + - wt -> tv_usec / MILLI_PER_SECOND) > timeoutInMillis) - { - if ((waittime.tv_sec * MILLI_PER_SECOND + - waittime.tv_usec / MILLI_PER_SECOND) > timeoutInMillis) - { - waittime.tv_sec = timeoutInMillis / MILLI_PER_SECOND; - waittime.tv_usec = (timeoutInMillis * MILLI_PER_SECOND) % - (MILLI_PER_SECOND * 1000); - wt = &waittime; - } - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_WAKEUP) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "WaitForSomething: Next wakeup timeout set to %ld milliseconds.\n", - (waittime.tv_sec * MILLI_PER_SECOND) + - (waittime.tv_usec / MILLI_PER_SECOND)); -#endif - } -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_WAKEUP) && defined(NX_TRANS_DEBUG) - else - { - fprintf(stderr, "WaitForSomething: Using existing timeout of %ld milliseconds.\n", - (waittime.tv_sec * MILLI_PER_SECOND) + - (waittime.tv_usec / MILLI_PER_SECOND)); - } -#endif - } -#endif - - /* keep this check close to select() call to minimize race */ -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - if (dispatchException) - { - i = -1; - - fprintf(stderr, "WaitForSomething: Value of dispatchException is true. Set i = -1.\n"); - } -#else - if (dispatchException) - i = -1; -#endif - else if (AnyClientsWriteBlocked) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - if (wt == NULL) - { - fprintf(stderr, "WaitForSomething: Executing select with LastSelectMask and " - "clientsWritable and null timeout.\n"); - } - else - { - fprintf(stderr, "WaitForSomething: Executing select with LastSelectMask, " - "clientsWritable, %ld secs and %ld usecs.\n", - wt -> tv_sec, wt -> tv_usec); - } -#endif - XFD_COPYSET(&ClientsWriteBlocked, &clientsWritable); - i = Select (MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); - } - else - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - if (wt == NULL) - { - fprintf(stderr, "WaitForSomething: Executing select with LastSelectMask and null timeout.\n"); - } - else - { - fprintf(stderr, "WaitForSomething: Executing select with LastSelectMask, %ld secs and %ld usecs.\n", - wt -> tv_sec, wt -> tv_usec); - } -#endif - i = Select (MaxClients, &LastSelectMask, NULL, NULL, wt); - } -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "WaitForSomething: Bailed out with i = [%d] and errno = [%d].\n", i, errno); - - if (i < 0) - { - fprintf(stderr, "WaitForSomething: Error is [%s].\n", strerror(errno)); - } -#endif - selecterr = GetErrno(); - WakeupHandler(i, (pointer)&LastSelectMask); -#ifdef XTESTEXT1 - if (playback_on) { - i = XTestProcessInputAction (i, &waittime); - } -#endif /* XTESTEXT1 */ -#ifdef SMART_SCHEDULE - if (i >= 0) - { - SmartScheduleIdle = FALSE; - SmartScheduleIdleCount = 0; - if (SmartScheduleTimerStopped) - (void) SmartScheduleStartTimer (); - } -#endif - if (i <= 0) /* An error or timeout occurred */ - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - if (dispatchException) - { - fprintf(stderr, "WaitForSomething: Returning 0 because of (dispatchException).\n"); - return 0; - } -#else - if (dispatchException) - return 0; -#endif - if (i < 0) - { - if (selecterr == EBADF) /* Some client disconnected */ - { - CheckConnections (); -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - if (! XFD_ANYSET (&AllClients)) - { - fprintf(stderr, "WaitForSomething: Returning 0 because of (! XFD_ANYSET (&AllClients)).\n"); - return 0; - } -#else - if (! XFD_ANYSET (&AllClients)) - return 0; -#endif - } - else if (selecterr == EINVAL) - { - FatalError("WaitForSomething(): select: errno=%d\n", - selecterr); - } - else if (selecterr != EINTR) - { - ErrorF("WaitForSomething(): select: errno=%d\n", - selecterr); - } - } -#ifdef SMART_SCHEDULE - else if (someReady) - { - /* - * If no-one else is home, bail quickly - */ - XFD_COPYSET(&ClientsWithInput, &LastSelectMask); - XFD_COPYSET(&ClientsWithInput, &clientsReadable); - break; - } -#endif -#if defined(NX_TRANS_SOCKET) - if (*checkForInput[0] != *checkForInput[1]) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "WaitForSomething: Returning 0 because of (*checkForInput[0] != *checkForInput[1]).\n"); -#endif - return 0; - } -#else - if (*checkForInput[0] != *checkForInput[1]) - return 0; -#endif - - if (timers) - { - int expired = 0; - now = GetTimeInMillis(); - if ((int) (timers->expires - now) <= 0) - expired = 1; - - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - - if (expired) - return 0; - } - } - else - { - fd_set tmp_set; - - if (*checkForInput[0] == *checkForInput[1]) { - if (timers) - { - int expired = 0; - now = GetTimeInMillis(); - if ((int) (timers->expires - now) <= 0) - expired = 1; - - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - - if (expired) - return 0; - } - } -#ifdef SMART_SCHEDULE - if (someReady) - XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask); -#endif - if (AnyClientsWriteBlocked && XFD_ANYSET (&clientsWritable)) - { - NewOutputPending = TRUE; - XFD_ORSET(&OutputPending, &clientsWritable, &OutputPending); - XFD_UNSET(&ClientsWriteBlocked, &clientsWritable); - if (! XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - } - - XFD_ANDSET(&devicesReadable, &LastSelectMask, &EnabledDevices); - XFD_ANDSET(&clientsReadable, &LastSelectMask, &AllClients); - XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections); - if (XFD_ANYSET(&tmp_set)) - QueueWorkProc(EstablishNewConnections, NULL, - (pointer)&LastSelectMask); -#ifdef DPMSExtension - if (XFD_ANYSET (&devicesReadable) && (DPMSPowerLevel != DPMSModeOn)) - DPMSSet(DPMSModeOn); -#endif - if (XFD_ANYSET (&devicesReadable) || XFD_ANYSET (&clientsReadable)) - break; -#ifdef WIN32 - /* Windows keyboard and mouse events are added to the input queue - in Block- and WakupHandlers. There is no device to check if - data is ready. So check here if new input is available */ -#if defined(NX_TRANS_SOCKET) - if (*checkForInput[0] != *checkForInput[1]) - { -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "WaitForSomething: Returning 0 because of (*checkForInput[0] != *checkForInput[1]).\n"); -#endif - return 0; - } -#else - if (*checkForInput[0] != *checkForInput[1]) - return 0; -#endif -#endif - } - } - - nready = 0; - if (XFD_ANYSET (&clientsReadable)) - { -#ifndef WIN32 - for (i=0; ipriority; - if (nready == 0 || client_priority > highest_priority) - { - /* Either we found the first client, or we found - * a client whose priority is greater than all others - * that have been found so far. Either way, we want - * to initialize the list of clients to contain just - * this client. - */ - pClientsReady[0] = client_index; - highest_priority = client_priority; - nready = 1; - } - /* the following if makes sure that multiple same-priority - * clients get batched together - */ - else if (client_priority == highest_priority) -#endif - { - pClientsReady[nready++] = client_index; - } -#ifndef WIN32 - clientsReadable.fds_bits[i] &= ~(((fd_mask)1L) << curclient); - } -#else - FD_CLR(curclient, &clientsReadable); -#endif - } - } -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG) - fprintf(stderr, "WaitForSomething: Returning nready.\n"); -#endif - return nready; -} - -#if 0 -/* - * This is not always a macro. - */ -ANYSET(FdMask *src) -{ - int i; - - for (i=0; inext; - timer->next = NULL; - newTime = (*timer->callback)(timer, now, timer->arg); - if (newTime) - TimerSet(timer, 0, newTime, timer->callback, timer->arg); -} - -OsTimerPtr -TimerSet(OsTimerPtr timer, int flags, CARD32 millis, - OsTimerCallback func, pointer arg) -{ - register OsTimerPtr *prev; - CARD32 now = GetTimeInMillis(); - - if (!timer) - { - timer = (OsTimerPtr)xalloc(sizeof(struct _OsTimerRec)); - if (!timer) - return NULL; - } - else - { - for (prev = &timers; *prev; prev = &(*prev)->next) - { - if (*prev == timer) - { - *prev = timer->next; - if (flags & TimerForceOld) - (void)(*timer->callback)(timer, now, timer->arg); - break; - } - } - } - if (!millis) - return timer; - if (!(flags & TimerAbsolute)) - millis += now; - timer->expires = millis; - timer->callback = func; - timer->arg = arg; - if ((int) (millis - now) <= 0) - { - timer->next = NULL; - millis = (*timer->callback)(timer, now, timer->arg); - if (!millis) - return timer; - } - for (prev = &timers; - *prev && (int) ((*prev)->expires - millis) <= 0; - prev = &(*prev)->next) - ; - timer->next = *prev; - *prev = timer; - return timer; -} - -Bool -TimerForce(OsTimerPtr timer) -{ - OsTimerPtr *prev; - - for (prev = &timers; *prev; prev = &(*prev)->next) - { - if (*prev == timer) - { - DoTimer(timer, GetTimeInMillis(), prev); - return TRUE; - } - } - return FALSE; -} - - -void -TimerCancel(OsTimerPtr timer) -{ - OsTimerPtr *prev; - - if (!timer) - return; - for (prev = &timers; *prev; prev = &(*prev)->next) - { - if (*prev == timer) - { - *prev = timer->next; - break; - } - } -} - -void -TimerFree(OsTimerPtr timer) -{ - if (!timer) - return; - TimerCancel(timer); - xfree(timer); -} - -void -TimerCheck(void) -{ - CARD32 now = GetTimeInMillis(); - - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); -} - -void -TimerInit(void) -{ - OsTimerPtr timer; - - while ((timer = timers)) - { - timers = timer->next; - xfree(timer); - } -} - -static CARD32 -ScreenSaverTimeoutExpire(OsTimerPtr timer,CARD32 now,pointer arg) -{ - INT32 timeout = now - lastDeviceEventTime.milliseconds; - - if (timeout < ScreenSaverTime) { - return ScreenSaverTime - timeout; - } - - ResetOsBuffers(); /* not ideal, but better than nothing */ - SaveScreens(SCREEN_SAVER_ON, ScreenSaverActive); - -#ifdef DPMSExtension - if (ScreenSaverInterval > 0 && DPMSPowerLevel == DPMSModeOn) -#else - if (ScreenSaverInterval > 0) -#endif /* DPMSExtension */ - return ScreenSaverInterval; - - return 0; -} - -static OsTimerPtr ScreenSaverTimer = NULL; - -void -FreeScreenSaverTimer(void) -{ - if (ScreenSaverTimer) { - TimerFree(ScreenSaverTimer); - ScreenSaverTimer = NULL; - } -} - -void -SetScreenSaverTimer(void) -{ - if (ScreenSaverTime > 0) { - ScreenSaverTimer = TimerSet(ScreenSaverTimer, 0, ScreenSaverTime, - ScreenSaverTimeoutExpire, NULL); - } else if (ScreenSaverTimer) { - FreeScreenSaverTimer(); - } -} - -#ifdef DPMSExtension - -static OsTimerPtr DPMSStandbyTimer = NULL; -static OsTimerPtr DPMSSuspendTimer = NULL; -static OsTimerPtr DPMSOffTimer = NULL; - -static CARD32 -DPMSStandbyTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) -{ - INT32 timeout = now - lastDeviceEventTime.milliseconds; - - if (timeout < DPMSStandbyTime) { - return DPMSStandbyTime - timeout; - } - if (DPMSPowerLevel < DPMSModeStandby) { - if (DPMSEnabled) - DPMSSet(DPMSModeStandby); - } - return DPMSStandbyTime; -} - -static CARD32 -DPMSSuspendTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) -{ - INT32 timeout = now - lastDeviceEventTime.milliseconds; - - if (timeout < DPMSSuspendTime) { - return DPMSSuspendTime - timeout; - } - if (DPMSPowerLevel < DPMSModeSuspend) { - if (DPMSEnabled) - DPMSSet(DPMSModeSuspend); - } - return DPMSSuspendTime; -} - -static CARD32 -DPMSOffTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) -{ - INT32 timeout = now - lastDeviceEventTime.milliseconds; - - if (timeout < DPMSOffTime) { - return DPMSOffTime - timeout; - } - if (DPMSPowerLevel < DPMSModeOff) { - if (DPMSEnabled) - DPMSSet(DPMSModeOff); - } - return DPMSOffTime; -} - -void -FreeDPMSTimers(void) -{ - if (DPMSStandbyTimer) { - TimerFree(DPMSStandbyTimer); - DPMSStandbyTimer = NULL; - } - if (DPMSSuspendTimer) { - TimerFree(DPMSSuspendTimer); - DPMSSuspendTimer = NULL; - } - if (DPMSOffTimer) { - TimerFree(DPMSOffTimer); - DPMSOffTimer = NULL; - } -} - -void -SetDPMSTimers(void) -{ - if (!DPMSEnabled) - return; - - DPMSStandbyTimer = TimerSet(DPMSStandbyTimer, 0, DPMSStandbyTime, - DPMSStandbyTimerExpire, NULL); - DPMSSuspendTimer = TimerSet(DPMSSuspendTimer, 0, DPMSSuspendTime, - DPMSSuspendTimerExpire, NULL); - DPMSOffTimer = TimerSet(DPMSOffTimer, 0, DPMSOffTime, - DPMSOffTimerExpire, NULL); -} -#endif diff --git a/nx-X11/programs/Xserver/os/WaitFor.c.X.original b/nx-X11/programs/Xserver/os/WaitFor.c.X.original deleted file mode 100644 index 31e16210b..000000000 --- a/nx-X11/programs/Xserver/os/WaitFor.c.X.original +++ /dev/null @@ -1,701 +0,0 @@ -/* $XFree86: xc/programs/Xserver/os/WaitFor.c,v 3.42 2003/10/16 01:33:35 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -/* $Xorg: WaitFor.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ - -/***************************************************************** - * OS Dependent input routines: - * - * WaitForSomething - * TimerForce, TimerSet, TimerCheck, TimerFree - * - *****************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#endif -#include /* for strings, fcntl, time */ -#include -#include -#include -#include "misc.h" - -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -#endif -#include "osdep.h" -#include -#include "dixstruct.h" -#include "opaque.h" -#ifdef DPMSExtension -#include "dpmsproc.h" -#endif - -#ifdef WIN32 -/* Error codes from windows sockets differ from fileio error codes */ -#undef EINTR -#define EINTR WSAEINTR -#undef EINVAL -#define EINVAL WSAEINVAL -#undef EBADF -#define EBADF WSAENOTSOCK -/* Windows select does not set errno. Use GetErrno as wrapper for - WSAGetLastError */ -#define GetErrno WSAGetLastError -#else -/* This is just a fallback to errno to hide the differences between unix and - Windows in the code */ -#define GetErrno() errno -#endif - -/* modifications by raphael */ -int -mffs(fd_mask mask) -{ - int i; - - if (!mask) return 0; - i = 1; - while (!(mask & 1)) - { - i++; - mask >>= 1; - } - return i; -} - -#ifdef DPMSExtension -#define DPMS_SERVER -#include -#endif - -#ifdef XTESTEXT1 -/* - * defined in xtestext1dd.c - */ -extern int playback_on; -#endif /* XTESTEXT1 */ - -struct _OsTimerRec { - OsTimerPtr next; - CARD32 expires; - OsTimerCallback callback; - pointer arg; -}; - -static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev); -static OsTimerPtr timers = NULL; - -/***************** - * WaitForSomething: - * Make the server suspend until there is - * 1. data from clients or - * 2. input events available or - * 3. ddx notices something of interest (graphics - * queue ready, etc.) or - * 4. clients that have buffered replies/events are ready - * - * If the time between INPUT events is - * greater than ScreenSaverTime, the display is turned off (or - * saved, depending on the hardware). So, WaitForSomething() - * has to handle this also (that's why the select() has a timeout. - * For more info on ClientsWithInput, see ReadRequestFromClient(). - * pClientsReady is an array to store ready client->index values into. - *****************/ - -int -WaitForSomething(int *pClientsReady) -{ - int i; - struct timeval waittime, *wt; - INT32 timeout = 0; - fd_set clientsReadable; - fd_set clientsWritable; - int curclient; - int selecterr; - int nready; - fd_set devicesReadable; - CARD32 now = 0; -#ifdef SMART_SCHEDULE - Bool someReady = FALSE; -#endif - - FD_ZERO(&clientsReadable); - - /* We need a while loop here to handle - crashed connections and the screen saver timeout */ - while (1) - { - /* deal with any blocked jobs */ - if (workQueue) - ProcessWorkQueue(); - if (XFD_ANYSET (&ClientsWithInput)) - { -#ifdef SMART_SCHEDULE - if (!SmartScheduleDisable) - { - someReady = TRUE; - waittime.tv_sec = 0; - waittime.tv_usec = 0; - wt = &waittime; - } - else -#endif - { - XFD_COPYSET (&ClientsWithInput, &clientsReadable); - break; - } - } -#ifdef SMART_SCHEDULE - if (someReady) - { - XFD_COPYSET(&AllSockets, &LastSelectMask); - XFD_UNSET(&LastSelectMask, &ClientsWithInput); - } - else - { -#endif - wt = NULL; - if (timers) - { - now = GetTimeInMillis(); - timeout = timers->expires - now; - if (timeout < 0) - timeout = 0; - waittime.tv_sec = timeout / MILLI_PER_SECOND; - waittime.tv_usec = (timeout % MILLI_PER_SECOND) * - (1000000 / MILLI_PER_SECOND); - wt = &waittime; - } - XFD_COPYSET(&AllSockets, &LastSelectMask); -#ifdef SMART_SCHEDULE - } - SmartScheduleIdle = TRUE; -#endif - BlockHandler((pointer)&wt, (pointer)&LastSelectMask); - if (NewOutputPending) - FlushAllOutput(); -#ifdef XTESTEXT1 - /* XXX how does this interact with new write block handling? */ - if (playback_on) { - wt = &waittime; - XTestComputeWaitTime (&waittime); - } -#endif /* XTESTEXT1 */ - /* keep this check close to select() call to minimize race */ - if (dispatchException) - i = -1; - else if (AnyClientsWriteBlocked) - { - XFD_COPYSET(&ClientsWriteBlocked, &clientsWritable); - i = Select (MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); - } - else - { - i = Select (MaxClients, &LastSelectMask, NULL, NULL, wt); - } - selecterr = GetErrno(); - WakeupHandler(i, (pointer)&LastSelectMask); -#ifdef XTESTEXT1 - if (playback_on) { - i = XTestProcessInputAction (i, &waittime); - } -#endif /* XTESTEXT1 */ -#ifdef SMART_SCHEDULE - if (i >= 0) - { - SmartScheduleIdle = FALSE; - SmartScheduleIdleCount = 0; - if (SmartScheduleTimerStopped) - (void) SmartScheduleStartTimer (); - } -#endif - if (i <= 0) /* An error or timeout occurred */ - { - if (dispatchException) - return 0; - if (i < 0) - { - if (selecterr == EBADF) /* Some client disconnected */ - { - CheckConnections (); - if (! XFD_ANYSET (&AllClients)) - return 0; - } - else if (selecterr == EINVAL) - { - FatalError("WaitForSomething(): select: errno=%d\n", - selecterr); - } - else if (selecterr != EINTR) - { - ErrorF("WaitForSomething(): select: errno=%d\n", - selecterr); - } - } -#ifdef SMART_SCHEDULE - else if (someReady) - { - /* - * If no-one else is home, bail quickly - */ - XFD_COPYSET(&ClientsWithInput, &LastSelectMask); - XFD_COPYSET(&ClientsWithInput, &clientsReadable); - break; - } -#endif - if (*checkForInput[0] != *checkForInput[1]) - return 0; - - if (timers) - { - int expired = 0; - now = GetTimeInMillis(); - if ((int) (timers->expires - now) <= 0) - expired = 1; - - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - - if (expired) - return 0; - } - } - else - { - fd_set tmp_set; - - if (*checkForInput[0] == *checkForInput[1]) { - if (timers) - { - int expired = 0; - now = GetTimeInMillis(); - if ((int) (timers->expires - now) <= 0) - expired = 1; - - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); - - if (expired) - return 0; - } - } -#ifdef SMART_SCHEDULE - if (someReady) - XFD_ORSET(&LastSelectMask, &ClientsWithInput, &LastSelectMask); -#endif - if (AnyClientsWriteBlocked && XFD_ANYSET (&clientsWritable)) - { - NewOutputPending = TRUE; - XFD_ORSET(&OutputPending, &clientsWritable, &OutputPending); - XFD_UNSET(&ClientsWriteBlocked, &clientsWritable); - if (! XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - } - - XFD_ANDSET(&devicesReadable, &LastSelectMask, &EnabledDevices); - XFD_ANDSET(&clientsReadable, &LastSelectMask, &AllClients); - XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections); - if (XFD_ANYSET(&tmp_set)) - QueueWorkProc(EstablishNewConnections, NULL, - (pointer)&LastSelectMask); -#ifdef DPMSExtension - if (XFD_ANYSET (&devicesReadable) && (DPMSPowerLevel != DPMSModeOn)) - DPMSSet(DPMSModeOn); -#endif - if (XFD_ANYSET (&devicesReadable) || XFD_ANYSET (&clientsReadable)) - break; -#ifdef WIN32 - /* Windows keyboard and mouse events are added to the input queue - in Block- and WakupHandlers. There is no device to check if - data is ready. So check here if new input is available */ - if (*checkForInput[0] != *checkForInput[1]) - return 0; -#endif - } - } - - nready = 0; - if (XFD_ANYSET (&clientsReadable)) - { -#ifndef WIN32 - for (i=0; ipriority; - if (nready == 0 || client_priority > highest_priority) - { - /* Either we found the first client, or we found - * a client whose priority is greater than all others - * that have been found so far. Either way, we want - * to initialize the list of clients to contain just - * this client. - */ - pClientsReady[0] = client_index; - highest_priority = client_priority; - nready = 1; - } - /* the following if makes sure that multiple same-priority - * clients get batched together - */ - else if (client_priority == highest_priority) -#endif - { - pClientsReady[nready++] = client_index; - } -#ifndef WIN32 - clientsReadable.fds_bits[i] &= ~(((fd_mask)1L) << curclient); - } -#else - FD_CLR(curclient, &clientsReadable); -#endif - } - } - return nready; -} - -#if 0 -/* - * This is not always a macro. - */ -ANYSET(FdMask *src) -{ - int i; - - for (i=0; inext; - timer->next = NULL; - newTime = (*timer->callback)(timer, now, timer->arg); - if (newTime) - TimerSet(timer, 0, newTime, timer->callback, timer->arg); -} - -OsTimerPtr -TimerSet(OsTimerPtr timer, int flags, CARD32 millis, - OsTimerCallback func, pointer arg) -{ - register OsTimerPtr *prev; - CARD32 now = GetTimeInMillis(); - - if (!timer) - { - timer = (OsTimerPtr)xalloc(sizeof(struct _OsTimerRec)); - if (!timer) - return NULL; - } - else - { - for (prev = &timers; *prev; prev = &(*prev)->next) - { - if (*prev == timer) - { - *prev = timer->next; - if (flags & TimerForceOld) - (void)(*timer->callback)(timer, now, timer->arg); - break; - } - } - } - if (!millis) - return timer; - if (!(flags & TimerAbsolute)) - millis += now; - timer->expires = millis; - timer->callback = func; - timer->arg = arg; - if ((int) (millis - now) <= 0) - { - timer->next = NULL; - millis = (*timer->callback)(timer, now, timer->arg); - if (!millis) - return timer; - } - for (prev = &timers; - *prev && (int) ((*prev)->expires - millis) <= 0; - prev = &(*prev)->next) - ; - timer->next = *prev; - *prev = timer; - return timer; -} - -Bool -TimerForce(OsTimerPtr timer) -{ - OsTimerPtr *prev; - - for (prev = &timers; *prev; prev = &(*prev)->next) - { - if (*prev == timer) - { - DoTimer(timer, GetTimeInMillis(), prev); - return TRUE; - } - } - return FALSE; -} - - -void -TimerCancel(OsTimerPtr timer) -{ - OsTimerPtr *prev; - - if (!timer) - return; - for (prev = &timers; *prev; prev = &(*prev)->next) - { - if (*prev == timer) - { - *prev = timer->next; - break; - } - } -} - -void -TimerFree(OsTimerPtr timer) -{ - if (!timer) - return; - TimerCancel(timer); - xfree(timer); -} - -void -TimerCheck(void) -{ - CARD32 now = GetTimeInMillis(); - - while (timers && (int) (timers->expires - now) <= 0) - DoTimer(timers, now, &timers); -} - -void -TimerInit(void) -{ - OsTimerPtr timer; - - while ((timer = timers)) - { - timers = timer->next; - xfree(timer); - } -} - -static CARD32 -ScreenSaverTimeoutExpire(OsTimerPtr timer,CARD32 now,pointer arg) -{ - INT32 timeout = now - lastDeviceEventTime.milliseconds; - - if (timeout < ScreenSaverTime) { - return ScreenSaverTime - timeout; - } - - ResetOsBuffers(); /* not ideal, but better than nothing */ - SaveScreens(SCREEN_SAVER_ON, ScreenSaverActive); - -#ifdef DPMSExtension - if (ScreenSaverInterval > 0 && DPMSPowerLevel == DPMSModeOn) -#else - if (ScreenSaverInterval > 0) -#endif /* DPMSExtension */ - return ScreenSaverInterval; - - return 0; -} - -static OsTimerPtr ScreenSaverTimer = NULL; - -void -FreeScreenSaverTimer(void) -{ - if (ScreenSaverTimer) { - TimerFree(ScreenSaverTimer); - ScreenSaverTimer = NULL; - } -} - -void -SetScreenSaverTimer(void) -{ - if (ScreenSaverTime > 0) { - ScreenSaverTimer = TimerSet(ScreenSaverTimer, 0, ScreenSaverTime, - ScreenSaverTimeoutExpire, NULL); - } else if (ScreenSaverTimer) { - FreeScreenSaverTimer(); - } -} - -#ifdef DPMSExtension - -static OsTimerPtr DPMSStandbyTimer = NULL; -static OsTimerPtr DPMSSuspendTimer = NULL; -static OsTimerPtr DPMSOffTimer = NULL; - -static CARD32 -DPMSStandbyTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) -{ - INT32 timeout = now - lastDeviceEventTime.milliseconds; - - if (timeout < DPMSStandbyTime) { - return DPMSStandbyTime - timeout; - } - if (DPMSPowerLevel < DPMSModeStandby) { - if (DPMSEnabled) - DPMSSet(DPMSModeStandby); - } - return DPMSStandbyTime; -} - -static CARD32 -DPMSSuspendTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) -{ - INT32 timeout = now - lastDeviceEventTime.milliseconds; - - if (timeout < DPMSSuspendTime) { - return DPMSSuspendTime - timeout; - } - if (DPMSPowerLevel < DPMSModeSuspend) { - if (DPMSEnabled) - DPMSSet(DPMSModeSuspend); - } - return DPMSSuspendTime; -} - -static CARD32 -DPMSOffTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) -{ - INT32 timeout = now - lastDeviceEventTime.milliseconds; - - if (timeout < DPMSOffTime) { - return DPMSOffTime - timeout; - } - if (DPMSPowerLevel < DPMSModeOff) { - if (DPMSEnabled) - DPMSSet(DPMSModeOff); - } - return DPMSOffTime; -} - -void -FreeDPMSTimers(void) -{ - if (DPMSStandbyTimer) { - TimerFree(DPMSStandbyTimer); - DPMSStandbyTimer = NULL; - } - if (DPMSSuspendTimer) { - TimerFree(DPMSSuspendTimer); - DPMSSuspendTimer = NULL; - } - if (DPMSOffTimer) { - TimerFree(DPMSOffTimer); - DPMSOffTimer = NULL; - } -} - -void -SetDPMSTimers(void) -{ - if (!DPMSEnabled) - return; - - DPMSStandbyTimer = TimerSet(DPMSStandbyTimer, 0, DPMSStandbyTime, - DPMSStandbyTimerExpire, NULL); - DPMSSuspendTimer = TimerSet(DPMSSuspendTimer, 0, DPMSSuspendTime, - DPMSSuspendTimerExpire, NULL); - DPMSOffTimer = TimerSet(DPMSOffTimer, 0, DPMSOffTime, - DPMSOffTimerExpire, NULL); -} -#endif diff --git a/nx-X11/programs/Xserver/os/auth.c.NX.original b/nx-X11/programs/Xserver/os/auth.c.NX.original deleted file mode 100644 index dfb6f8899..000000000 --- a/nx-X11/programs/Xserver/os/auth.c.NX.original +++ /dev/null @@ -1,608 +0,0 @@ -/* $Xorg: auth.c,v 1.5 2001/02/09 02:05:23 xorgcvs Exp $ */ -/* - -Copyright 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: auth.c,v 1.13 2003/04/27 21:31:08 herrb Exp $ */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * authorization hooks for the server - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef K5AUTH -# include -#endif -# include -# include -# include "misc.h" -# include "osdep.h" -# include "dixstruct.h" -# include -# include -#ifdef XCSECURITY -#define _SECURITY_SERVER -# include -#endif -#ifdef WIN32 -#include -#endif - -struct protocol { - unsigned short name_length; - char *name; - AuthAddCFunc Add; /* new authorization data */ - AuthCheckFunc Check; /* verify client authorization data */ - AuthRstCFunc Reset; /* delete all authorization data entries */ - AuthToIDFunc ToID; /* convert cookie to ID */ - AuthFromIDFunc FromID; /* convert ID to cookie */ - AuthRemCFunc Remove; /* remove a specific cookie */ -#ifdef XCSECURITY - AuthGenCFunc Generate; -#endif -}; - -static struct protocol protocols[] = { -{ (unsigned short) 18, "MIT-MAGIC-COOKIE-1", - MitAddCookie, MitCheckCookie, MitResetCookie, - MitToID, MitFromID, MitRemoveCookie, -#ifdef XCSECURITY - MitGenerateCookie -#endif -}, -#ifdef HASXDMAUTH -{ (unsigned short) 19, "XDM-AUTHORIZATION-1", - XdmAddCookie, XdmCheckCookie, XdmResetCookie, - XdmToID, XdmFromID, XdmRemoveCookie, -#ifdef XCSECURITY - NULL -#endif -}, -#endif -#ifdef SECURE_RPC -{ (unsigned short) 9, "SUN-DES-1", - SecureRPCAdd, SecureRPCCheck, SecureRPCReset, - SecureRPCToID, SecureRPCFromID,SecureRPCRemove, -#ifdef XCSECURITY - NULL -#endif -}, -#endif -#ifdef K5AUTH -{ (unsigned short) 14, "MIT-KERBEROS-5", - K5Add, K5Check, K5Reset, - K5ToID, K5FromID, K5Remove, -#ifdef XCSECURITY - NULL -#endif -}, -#endif -#ifdef XCSECURITY -{ (unsigned short) XSecurityAuthorizationNameLen, - XSecurityAuthorizationName, - NULL, AuthSecurityCheck, NULL, - NULL, NULL, NULL, - NULL -}, -#endif -}; - -# define NUM_AUTHORIZATION (sizeof (protocols) /\ - sizeof (struct protocol)) - -/* - * Initialize all classes of authorization by reading the - * specified authorization file - */ - -static char *authorization_file = (char *)NULL; - -static Bool ShouldLoadAuth = TRUE; - -void -InitAuthorization (char *file_name) -{ -#ifdef __sun - char * envBuffer; -#endif - authorization_file = file_name; -#ifdef NX_TRANS_AUTH -#ifdef NX_TRANS_TEST - fprintf(stderr, "InitAuthorization: Going to propagate auth file '%s' to the environment.\n", - authorization_file); -#endif -#ifdef __sun - envBuffer = malloc(15+strlen(authorization_file)); - sprintf(envBuffer,"NX_XAUTHORITY=%s",authorization_file); - putenv(envBuffer); -#else - setenv("NX_XAUTHORITY", authorization_file, 1); -#endif -#endif - -} - -static int -LoadAuthorization (void) -{ - FILE *f; - Xauth *auth; - int i; - int count = 0; - - ShouldLoadAuth = FALSE; - if (!authorization_file) - return 0; - -#ifdef NX_TRANS_AUTH - - /* - * We think that the way LoadAuthorization() is working is wrong. - * It doesn't reset the list of stored authorizations before reading - * the new cookies. Our take is that if a new auth file is to be - * read, the only cookies that are to be accepted are those that are - * in the new file, not those in the file -plus- those that have - * been in the file in the past. Furthermore, if the list can't be - * read or it is empty, it should assume that it ignores which co- - * okies are valid and thus it should disable any access. Your mile- - * age can vary. A less draconian approach could be to leave the old - * cookies if the file can't be read and remove them only if the - * file is empty. - * - * Adding the cookies without removing the old values for the same - * protocol has an important implication. If an user shares the co- - * okie with somebody and later wants to revoke the access to the - * display, changing the cookie will not work. This is especially - * important with NX. For security reasons, after reconnecting the - * session to a different display, it is advisable to generate a - * new set of cookies, but doing that it is useless with the current - * code, as the old cookies are going to be still accepted. On the - * same topic, consider that once an user has got access to the X - * server, he/she can freely enable host authentication from any - * host, so the safe behaviour should be to reset the host based - * authenthication at least at reconnection, and keep as valid only - * the cookies that are actually in the file. This behaviour would - * surely break many applications, among them a SSH connection run - * inside a NX session, as ssh -X reads the cookie for the display - * only at session startup and does not read the cookies again - * when the auth file is changed. - * - * Another bug (or feature, depending on how you want to consider - * it) is that if the authority file contains entries for different - * displays (as it is the norm when the authority file is the default - * .Xauthority in the user's home), the server will match -any- of - * the cookies, even cookies that are not for its own display. This - * means that you have be careful when passing an authority file to - * nxagent or Xnest and maybe keep separate files for letting nxagent - * find the cookie to be used to connect to the remote display and - * for letting it find what cookies to accept. If the file is the - * same, clients will be able to connect to nxagent with both the - * cookies. - */ - -#ifdef NX_TRANS_AUTH_RESET - - #ifdef NX_TRANS_TEST - fprintf(stderr, "LoadAuthorization: Resetting authorization info.\n"); - #endif - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].Reset) { - (*protocols[i].Reset) (); - } - } - -#endif - -#endif /* #ifdef NX_TRANS_AUTH */ - - f = Fopen (authorization_file, "r"); - if (!f) - return -1; - - while ((auth = XauReadAuth (f)) != 0) { - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == auth->name_length && - memcmp (protocols[i].name, auth->name, (int) auth->name_length) == 0 && - protocols[i].Add) - { -#ifdef NX_TRANS_AUTH - - #ifdef NX_TRANS_TEST - fprintf(stderr, "LoadAuthorization: Adding new record from file [%s].\n", - authorization_file); - #endif - -#endif - ++count; - (*protocols[i].Add) (auth->data_length, auth->data, - FakeClientID(0)); - } - } - XauDisposeAuth (auth); - } - -#ifdef NX_TRANS_AUTH - - if (count == 0) - { - fprintf(stderr, "Warning: No authorization record could be read from file '%s'.\n", - authorization_file); - - fprintf(stderr, "Warning: Please, create a valid authorization cookie using the command\n" - "Warning: 'xauth -f %s add MIT-MAGIC-COOKIE-1 '.\n", - authorization_file); - } - -#endif - -#ifdef NX_TRANS_AUTH - if (Fclose (f) != 0) - { - /* - * If the Fclose() fails, for example because of a signal, - * it's advisable to return the number of protocols read, - * if any, or otherwise the server would believe that no - * cookie is valid and eventually fall back to host based - * authentication. Note anyway that the new code in Check- - * Authorization() doesn't care the return value and gives - * a chance to the function to check the file at the next - * connection. - */ - - if (count > 0) - { - return count; - } - else - { - return -1; - } - } -#else - Fclose (f); -#endif - return count; -} - -#ifdef XDMCP -/* - * XdmcpInit calls this function to discover all authorization - * schemes supported by the display - */ -void -RegisterAuthorizations (void) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) - XdmcpRegisterAuthorization (protocols[i].name, - (int)protocols[i].name_length); -} -#endif - -XID -CheckAuthorization ( - unsigned int name_length, - char *name, - unsigned int data_length, - char *data, - ClientPtr client, - char **reason) /* failure message. NULL for default msg */ -{ - int i; - struct stat buf; - static time_t lastmod = 0; - - #ifndef NX_TRANS_AUTH - static Bool loaded = FALSE; - #endif - - if (!authorization_file || stat(authorization_file, &buf)) - { - if (lastmod != 0) { - lastmod = 0; - ShouldLoadAuth = TRUE; /* stat lost, so force reload */ - } - } - else if (buf.st_mtime > lastmod) - { - lastmod = buf.st_mtime; - ShouldLoadAuth = TRUE; - } - if (ShouldLoadAuth) - { - int loadauth = LoadAuthorization(); - - /* - * If the authorization file has at least one entry for this server, - * disable local host access. (loadauth > 0) - * - * If there are zero entries (either initially or when the - * authorization file is later reloaded), or if a valid - * authorization file was never loaded, enable local host access. - * (loadauth == 0 || !loaded) - * - * If the authorization file was loaded initially (with valid - * entries for this server), and reloading it later fails, don't - * change anything. (loadauth == -1 && loaded) - */ - -#ifdef NX_TRANS_AUTH - - /* - * The implementation of CheckAuthorization() was changed. The way - * the auth file was handled previously was questionable and could - * open the way to a vast array of security problems. There might be - * ways for an attacker to prevent the server from reading the file - * and it was enough for the server to fail reading the file once - * (because of a not blocked signal, for example) to leave the dis- - * play open to all the users running a session on the same terminal - * server. - * - * In NX we want to have only two cases: either we have to check an - * authorization file or we don't. In the first case we need to do our - * best to read the file at any new client access and never fall back - * to host based authentication. Falling back to local host access has - * no way back, as it will always take precedence over the auth cookie - * (unless the user explicitly disables, one by one, all the rules - * allowing local access, if and only if he/she becomes aware of the - * problem). In the second case we assume that user doesn't care secu- - * rity and so allow unrestricted access from the local machine. - */ - - #ifdef NX_TRANS_TEST - fprintf(stderr, "CheckAuthorization: Going to set authorization with loadauth [%d].\n", - loadauth); - #endif - - if (authorization_file) - { - #ifdef NX_TRANS_TEST - fprintf(stderr, "CheckAuthorization: Disabling local host access.\n"); - #endif - - DisableLocalHost(); - } - else - { - /* - * Enable host-based authentication only if - * the authorization file was not specified - * either on the command line or in the env- - * ironment. - */ - - #ifdef NX_TRANS_TEST - fprintf(stderr, "CheckAuthorization: Enabling local host access.\n"); - #endif - - EnableLocalHost(); - } - - /* - * Avoid the 'unused variable' warning. - */ - - loadauth = loadauth; - -#else /* #ifdef NX_TRANS_AUTH */ - - if (loadauth > 0) - { - DisableLocalHost(); /* got at least one */ - loaded = TRUE; - } - else if (loadauth == 0 || !loaded) - EnableLocalHost (); - -#endif /* #ifdef NX_TRANS_AUTH */ - } - if (name_length) { - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0) - { - return (*protocols[i].Check) (data_length, data, client, reason); - } - *reason = "Protocol not supported by server\n"; - } - } else *reason = "No protocol specified\n"; - return (XID) ~0L; -} - -void -ResetAuthorization (void) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) - if (protocols[i].Reset) - (*protocols[i].Reset)(); - ShouldLoadAuth = TRUE; -} - -XID -AuthorizationToID ( - unsigned short name_length, - char *name, - unsigned short data_length, - char *data) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0 && - protocols[i].ToID) - { - return (*protocols[i].ToID) (data_length, data); - } - } - return (XID) ~0L; -} - -int -AuthorizationFromID ( - XID id, - unsigned short *name_lenp, - char **namep, - unsigned short *data_lenp, - char **datap) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].FromID && - (*protocols[i].FromID) (id, data_lenp, datap)) { - *name_lenp = protocols[i].name_length; - *namep = protocols[i].name; - return 1; - } - } - return 0; -} - -int -RemoveAuthorization ( - unsigned short name_length, - char *name, - unsigned short data_length, - char *data) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0 && - protocols[i].Remove) - { - return (*protocols[i].Remove) (data_length, data); - } - } - return 0; -} - -int -AddAuthorization (unsigned name_length, char *name, unsigned data_length, char *data) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0 && - protocols[i].Add) - { - return (*protocols[i].Add) (data_length, data, FakeClientID(0)); - } - } - return 0; -} - -#ifdef XCSECURITY - -XID -GenerateAuthorization( - unsigned name_length, - char *name, - unsigned data_length, - char *data, - unsigned *data_length_return, - char **data_return) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0 && - protocols[i].Generate) - { - return (*protocols[i].Generate) (data_length, data, - FakeClientID(0), data_length_return, data_return); - } - } - return -1; -} - -/* A random number generator that is more unpredictable - than that shipped with some systems. - This code is taken from the C standard. */ - -static unsigned long int next = 1; - -static int -xdm_rand(void) -{ - next = next * 1103515245 + 12345; - return (unsigned int)(next/65536) % 32768; -} - -static void -xdm_srand(unsigned int seed) -{ - next = seed; -} - -void -GenerateRandomData (int len, char *buf) -{ - static int seed; - int value; - int i; - - seed += GetTimeInMillis(); - xdm_srand (seed); - for (i = 0; i < len; i++) - { - value = xdm_rand (); - buf[i] ^= (value & 0xff00) >> 8; - } - - /* XXX add getrusage, popen("ps -ale") */ -} - -#endif /* XCSECURITY */ diff --git a/nx-X11/programs/Xserver/os/auth.c.X.original b/nx-X11/programs/Xserver/os/auth.c.X.original deleted file mode 100644 index 19c5534d3..000000000 --- a/nx-X11/programs/Xserver/os/auth.c.X.original +++ /dev/null @@ -1,400 +0,0 @@ -/* $Xorg: auth.c,v 1.5 2001/02/09 02:05:23 xorgcvs Exp $ */ -/* - -Copyright 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: auth.c,v 1.13 2003/04/27 21:31:08 herrb Exp $ */ - -/* - * authorization hooks for the server - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef K5AUTH -# include -#endif -# include -# include -# include "misc.h" -# include "osdep.h" -# include "dixstruct.h" -# include -# include -#ifdef XCSECURITY -#define _SECURITY_SERVER -# include -#endif -#ifdef WIN32 -#include -#endif - -struct protocol { - unsigned short name_length; - char *name; - AuthAddCFunc Add; /* new authorization data */ - AuthCheckFunc Check; /* verify client authorization data */ - AuthRstCFunc Reset; /* delete all authorization data entries */ - AuthToIDFunc ToID; /* convert cookie to ID */ - AuthFromIDFunc FromID; /* convert ID to cookie */ - AuthRemCFunc Remove; /* remove a specific cookie */ -#ifdef XCSECURITY - AuthGenCFunc Generate; -#endif -}; - -static struct protocol protocols[] = { -{ (unsigned short) 18, "MIT-MAGIC-COOKIE-1", - MitAddCookie, MitCheckCookie, MitResetCookie, - MitToID, MitFromID, MitRemoveCookie, -#ifdef XCSECURITY - MitGenerateCookie -#endif -}, -#ifdef HASXDMAUTH -{ (unsigned short) 19, "XDM-AUTHORIZATION-1", - XdmAddCookie, XdmCheckCookie, XdmResetCookie, - XdmToID, XdmFromID, XdmRemoveCookie, -#ifdef XCSECURITY - NULL -#endif -}, -#endif -#ifdef SECURE_RPC -{ (unsigned short) 9, "SUN-DES-1", - SecureRPCAdd, SecureRPCCheck, SecureRPCReset, - SecureRPCToID, SecureRPCFromID,SecureRPCRemove, -#ifdef XCSECURITY - NULL -#endif -}, -#endif -#ifdef K5AUTH -{ (unsigned short) 14, "MIT-KERBEROS-5", - K5Add, K5Check, K5Reset, - K5ToID, K5FromID, K5Remove, -#ifdef XCSECURITY - NULL -#endif -}, -#endif -#ifdef XCSECURITY -{ (unsigned short) XSecurityAuthorizationNameLen, - XSecurityAuthorizationName, - NULL, AuthSecurityCheck, NULL, - NULL, NULL, NULL, - NULL -}, -#endif -}; - -# define NUM_AUTHORIZATION (sizeof (protocols) /\ - sizeof (struct protocol)) - -/* - * Initialize all classes of authorization by reading the - * specified authorization file - */ - -static char *authorization_file = (char *)NULL; - -static Bool ShouldLoadAuth = TRUE; - -void -InitAuthorization (char *file_name) -{ - authorization_file = file_name; -} - -static int -LoadAuthorization (void) -{ - FILE *f; - Xauth *auth; - int i; - int count = 0; - - ShouldLoadAuth = FALSE; - if (!authorization_file) - return 0; - - f = Fopen (authorization_file, "r"); - if (!f) - return -1; - - while ((auth = XauReadAuth (f)) != 0) { - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == auth->name_length && - memcmp (protocols[i].name, auth->name, (int) auth->name_length) == 0 && - protocols[i].Add) - { - ++count; - (*protocols[i].Add) (auth->data_length, auth->data, - FakeClientID(0)); - } - } - XauDisposeAuth (auth); - } - - Fclose (f); - return count; -} - -#ifdef XDMCP -/* - * XdmcpInit calls this function to discover all authorization - * schemes supported by the display - */ -void -RegisterAuthorizations (void) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) - XdmcpRegisterAuthorization (protocols[i].name, - (int)protocols[i].name_length); -} -#endif - -XID -CheckAuthorization ( - unsigned int name_length, - char *name, - unsigned int data_length, - char *data, - ClientPtr client, - char **reason) /* failure message. NULL for default msg */ -{ - int i; - struct stat buf; - static time_t lastmod = 0; - static Bool loaded = FALSE; - - if (!authorization_file || stat(authorization_file, &buf)) - { - if (lastmod != 0) { - lastmod = 0; - ShouldLoadAuth = TRUE; /* stat lost, so force reload */ - } - } - else if (buf.st_mtime > lastmod) - { - lastmod = buf.st_mtime; - ShouldLoadAuth = TRUE; - } - if (ShouldLoadAuth) - { - int loadauth = LoadAuthorization(); - - /* - * If the authorization file has at least one entry for this server, - * disable local host access. (loadauth > 0) - * - * If there are zero entries (either initially or when the - * authorization file is later reloaded), or if a valid - * authorization file was never loaded, enable local host access. - * (loadauth == 0 || !loaded) - * - * If the authorization file was loaded initially (with valid - * entries for this server), and reloading it later fails, don't - * change anything. (loadauth == -1 && loaded) - */ - - if (loadauth > 0) - { - DisableLocalHost(); /* got at least one */ - loaded = TRUE; - } - else if (loadauth == 0 || !loaded) - EnableLocalHost (); - } - if (name_length) { - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0) - { - return (*protocols[i].Check) (data_length, data, client, reason); - } - *reason = "Protocol not supported by server\n"; - } - } else *reason = "No protocol specified\n"; - return (XID) ~0L; -} - -void -ResetAuthorization (void) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) - if (protocols[i].Reset) - (*protocols[i].Reset)(); - ShouldLoadAuth = TRUE; -} - -XID -AuthorizationToID ( - unsigned short name_length, - char *name, - unsigned short data_length, - char *data) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0 && - protocols[i].ToID) - { - return (*protocols[i].ToID) (data_length, data); - } - } - return (XID) ~0L; -} - -int -AuthorizationFromID ( - XID id, - unsigned short *name_lenp, - char **namep, - unsigned short *data_lenp, - char **datap) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].FromID && - (*protocols[i].FromID) (id, data_lenp, datap)) { - *name_lenp = protocols[i].name_length; - *namep = protocols[i].name; - return 1; - } - } - return 0; -} - -int -RemoveAuthorization ( - unsigned short name_length, - char *name, - unsigned short data_length, - char *data) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0 && - protocols[i].Remove) - { - return (*protocols[i].Remove) (data_length, data); - } - } - return 0; -} - -int -AddAuthorization (unsigned name_length, char *name, unsigned data_length, char *data) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0 && - protocols[i].Add) - { - return (*protocols[i].Add) (data_length, data, FakeClientID(0)); - } - } - return 0; -} - -#ifdef XCSECURITY - -XID -GenerateAuthorization( - unsigned name_length, - char *name, - unsigned data_length, - char *data, - unsigned *data_length_return, - char **data_return) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0 && - protocols[i].Generate) - { - return (*protocols[i].Generate) (data_length, data, - FakeClientID(0), data_length_return, data_return); - } - } - return -1; -} - -/* A random number generator that is more unpredictable - than that shipped with some systems. - This code is taken from the C standard. */ - -static unsigned long int next = 1; - -static int -xdm_rand(void) -{ - next = next * 1103515245 + 12345; - return (unsigned int)(next/65536) % 32768; -} - -static void -xdm_srand(unsigned int seed) -{ - next = seed; -} - -void -GenerateRandomData (int len, char *buf) -{ - static int seed; - int value; - int i; - - seed += GetTimeInMillis(); - xdm_srand (seed); - for (i = 0; i < len; i++) - { - value = xdm_rand (); - buf[i] ^= (value & 0xff00) >> 8; - } - - /* XXX add getrusage, popen("ps -ale") */ -} - -#endif /* XCSECURITY */ diff --git a/nx-X11/programs/Xserver/os/connection.c.NX.original b/nx-X11/programs/Xserver/os/connection.c.NX.original deleted file mode 100644 index e3319b338..000000000 --- a/nx-X11/programs/Xserver/os/connection.c.NX.original +++ /dev/null @@ -1,1424 +0,0 @@ -/* $Xorg: connection.c,v 1.6 2001/02/09 02:05:23 xorgcvs Exp $ */ -/*********************************************************** - -Copyright 1987, 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/os/connection.c,v 3.64 2003/10/07 22:50:42 herrb Exp $ */ -/***************************************************************** - * Stuff to create connections --- OS dependent - * - * EstablishNewConnections, CreateWellKnownSockets, ResetWellKnownSockets, - * CloseDownConnection, CheckConnections, AddEnabledDevice, - * RemoveEnabledDevice, OnlyListToOneClient, - * ListenToAllClients, - * - * (WaitForSomething is in its own file) - * - * In this implementation, a client socket table is not kept. - * Instead, what would be the index into the table is just the - * file descriptor of the socket. This won't work for if the - * socket ids aren't small nums (0 - 2^8) - * - *****************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#endif -#include -#include -#define XSERV_t -#define TRANS_SERVER -#define TRANS_REOPEN -#include -#include -#include -#include -#include - -#ifndef WIN32 -#if defined(Lynx) -#include -#else -#include -#endif - -#ifdef hpux -#include -#include -#endif - -#if defined(DGUX) -#include -#include -#include -#include -#include -#include -#include -#include -#endif - - -#ifdef AIXV3 -#include -#endif - -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -extern __const__ int _nfiles; -#endif - -#if defined(TCPCONN) || defined(STREAMSCONN) -# include -# include -# if !defined(hpux) -# ifdef apollo -# ifndef NO_TCP_H -# include -# endif -# else -# ifdef CSRG_BASED -# include -# endif -# ifndef __UNIXOS2__ -# include -# endif -# endif -# endif -# include -#endif - -#if !defined(__UNIXOS2__) -#ifndef Lynx -#include -#else -#include -#endif -#endif -#endif /* WIN32 */ -#include "misc.h" /* for typedef of pointer */ -#include "osdep.h" -#include -#include "opaque.h" -#include "dixstruct.h" -#ifdef XAPPGROUP -#include -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif -#ifdef LBX -#include "colormapst.h" -#include "propertyst.h" -#include "lbxserve.h" -#include "osdep.h" -#endif - -#ifdef X_NOT_POSIX -#define Pid_t int -#else -#define Pid_t pid_t -#endif - -#ifdef DNETCONN -#include -#endif /* DNETCONN */ - -int lastfdesc; /* maximum file descriptor */ - -fd_set WellKnownConnections; /* Listener mask */ -fd_set EnabledDevices; /* mask for input devices that are on */ -fd_set AllSockets; /* select on this */ -fd_set AllClients; /* available clients */ -fd_set LastSelectMask; /* mask returned from last select call */ -fd_set ClientsWithInput; /* clients with FULL requests in buffer */ -fd_set ClientsWriteBlocked; /* clients who cannot receive output */ -fd_set OutputPending; /* clients with reply/event data ready to go */ -int MaxClients = 0; -Bool NewOutputPending; /* not yet attempted to write some new output */ -Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ - -Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ -Bool PartialNetwork; /* continue even if unable to bind all addrs */ -static Pid_t ParentProcess; -#ifdef __UNIXOS2__ -Pid_t GetPPID(Pid_t pid); -#endif - -static Bool debug_conns = FALSE; - -fd_set IgnoredClientsWithInput; -static fd_set GrabImperviousClients; -static fd_set SavedAllClients; -static fd_set SavedAllSockets; -static fd_set SavedClientsWithInput; -int GrabInProgress = 0; - -#if !defined(WIN32) -int *ConnectionTranslation = NULL; -#else -/* - * On NT fds are not between 0 and MAXSOCKS, they are unrelated, and there is - * not even a known maximum value, so use something quite arbitrary for now. - * Do storage is a hash table of size 256. Collisions are handled in a linked - * list. - */ - -#undef MAXSOCKS -#define MAXSOCKS 500 -#undef MAXSELECT -#define MAXSELECT 500 -#define MAXFD 500 - -struct _ct_node { - struct _ct_node *next; - int key; - int value; -}; - -struct _ct_node *ct_head[256]; - -void InitConnectionTranslation(void) -{ - bzero(ct_head, sizeof(ct_head)); -} - -int GetConnectionTranslation(int conn) -{ - struct _ct_node *node = ct_head[conn & 0xff]; - while (node != NULL) - { - if (node->key == conn) - return node->value; - node = node->next; - } - return 0; -} - -void SetConnectionTranslation(int conn, int client) -{ - struct _ct_node **node = ct_head + (conn & 0xff); - if (client == 0) /* remove entry */ - { - while (*node != NULL) - { - if ((*node)->key == conn) - { - struct _ct_node *temp = *node; - *node = (*node)->next; - free(temp); - return; - } - node = &((*node)->next); - } - return; - } else - { - while (*node != NULL) - { - if ((*node)->key == conn) - { - (*node)->value = client; - return; - } - node = &((*node)->next); - } - *node = (struct _ct_node*)xalloc(sizeof(struct _ct_node)); - (*node)->next = NULL; - (*node)->key = conn; - (*node)->value = client; - return; - } -} - -void ClearConnectionTranslation(void) -{ - unsigned i; - for (i = 0; i < 256; i++) - { - struct _ct_node *node = ct_head[i]; - while (node != NULL) - { - struct _ct_node *temp = node; - node = node->next; - xfree(temp); - } - } -} -#endif - -XtransConnInfo *ListenTransConns = NULL; -int *ListenTransFds = NULL; -int ListenTransCount; - -static void ErrorConnMax(XtransConnInfo /* trans_conn */); - -#ifndef LBX -static -void CloseDownFileDescriptor( - OsCommPtr /*oc*/ -); -#endif - - -static XtransConnInfo -lookup_trans_conn (int fd) -{ - if (ListenTransFds) - { - int i; - for (i = 0; i < ListenTransCount; i++) - if (ListenTransFds[i] == fd) - return ListenTransConns[i]; - } - - return (NULL); -} - -/* Set MaxClients and lastfdesc, and allocate ConnectionTranslation */ - -void -InitConnectionLimits(void) -{ - lastfdesc = -1; - -#ifndef __CYGWIN__ - -#ifndef __UNIXOS2__ - -#if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX) - lastfdesc = sysconf(_SC_OPEN_MAX) - 1; -#endif - -#ifdef HAS_GETDTABLESIZE - if (lastfdesc < 0) - lastfdesc = getdtablesize() - 1; -#endif - -#ifdef _NFILE - if (lastfdesc < 0) - lastfdesc = _NFILE - 1; -#endif - -#else /* __UNIXOS2__ */ - lastfdesc = _nfiles - 1; -#endif - -#endif /* __CYGWIN__ */ - - /* This is the fallback */ - if (lastfdesc < 0) - lastfdesc = MAXSOCKS; - - if (lastfdesc > MAXSELECT) - lastfdesc = MAXSELECT; - - if (lastfdesc > MAXCLIENTS) - { - lastfdesc = MAXCLIENTS; - if (debug_conns) - ErrorF( "REACHED MAXIMUM CLIENTS LIMIT %d\n", MAXCLIENTS); - } - MaxClients = lastfdesc; - -#ifdef DEBUG - ErrorF("InitConnectionLimits: MaxClients = %d\n", MaxClients); -#endif - -#if !defined(WIN32) - ConnectionTranslation = (int *)xnfalloc(sizeof(int)*(lastfdesc + 1)); -#else - InitConnectionTranslation(); -#endif -} - - -/***************** - * CreateWellKnownSockets - * At initialization, create the sockets to listen on for new clients. - *****************/ - -void -CreateWellKnownSockets(void) -{ - int i; - int partial; - char port[20]; - OsSigHandlerPtr handler; - - FD_ZERO(&AllSockets); - FD_ZERO(&AllClients); - FD_ZERO(&LastSelectMask); - FD_ZERO(&ClientsWithInput); - -#if !defined(WIN32) - for (i=0; i= 0) && - (ListenTransCount >= 1)) - { - if (!PartialNetwork && partial) - { - FatalError ("Failed to establish all listening sockets"); - } - else - { - ListenTransFds = (int *) xalloc (ListenTransCount * sizeof (int)); - - for (i = 0; i < ListenTransCount; i++) - { - int fd = _XSERVTransGetConnectionNumber (ListenTransConns[i]); - - ListenTransFds[i] = fd; - FD_SET (fd, &WellKnownConnections); - - if (!_XSERVTransIsLocal (ListenTransConns[i])) - { - DefineSelf (fd); - } - } - } - } - - if (!XFD_ANYSET (&WellKnownConnections)) - FatalError ("Cannot establish any listening sockets - Make sure an X server isn't already running"); -#if !defined(WIN32) - OsSignal (SIGPIPE, SIG_IGN); - OsSignal (SIGHUP, AutoResetServer); -#endif - OsSignal (SIGINT, GiveUp); - OsSignal (SIGTERM, GiveUp); - XFD_COPYSET (&WellKnownConnections, &AllSockets); - ResetHosts(display); - /* - * Magic: If SIGUSR1 was set to SIG_IGN when - * the server started, assume that either - * - * a- The parent process is ignoring SIGUSR1 - * - * or - * - * b- The parent process is expecting a SIGUSR1 - * when the server is ready to accept connections - * - * In the first case, the signal will be harmless, - * in the second case, the signal will be quite - * useful - */ -#if !defined(WIN32) - handler = OsSignal (SIGUSR1, SIG_IGN); - if ( handler == SIG_IGN) - RunFromSmartParent = TRUE; - OsSignal(SIGUSR1, handler); - ParentProcess = getppid (); -#ifdef __UNIXOS2__ - /* - * fg030505: under OS/2, xinit is not the parent process but - * the "grant parent" process of the server because execvpe() - * presents us an additional process number; - * GetPPID(pid) is part of libemxfix - */ - ParentProcess = GetPPID (ParentProcess); -#endif /* __UNIXOS2__ */ - if (RunFromSmartParent) { - if (ParentProcess > 1) { - kill (ParentProcess, SIGUSR1); - } - } -#endif -#ifdef XDMCP - XdmcpInit (); -#endif -} - -#ifdef NX_TRANS_SOCKET - -/* - * The following block is now defined also - * under Cygwin to support this environment. - */ - -#ifndef __DARWIN__ - -/* - * This is defined in Xtranssock.c and must - * be called explicitly as it doesn't share - * a pointer in the transport function table. - */ - -extern void _XSERVTransSocketRejectConnection(XtransConnInfo); - -void -RejectWellKnownSockets () -{ - int i; - - for (i = 0; i < ListenTransCount; i++) - { - _XSERVTransSocketRejectConnection(ListenTransConns[i]); - } -} - -#endif /* #ifndef __DARWIN__ */ - -#else /* #ifdef NX_TRANS_SOCKET */ - -void -RejectWellKnownSockets () -{ -} - -#endif /* #ifdef NX_TRANS_SOCKET */ - -void -ResetWellKnownSockets (void) -{ - int i; - - ResetOsBuffers(); - - for (i = 0; i < ListenTransCount; i++) - { - int status = _XSERVTransResetListener (ListenTransConns[i]); - - if (status != TRANS_RESET_NOOP) - { - if (status == TRANS_RESET_FAILURE) - { - /* - * ListenTransConns[i] freed by xtrans. - * Remove it from out list. - */ - - FD_CLR (ListenTransFds[i], &WellKnownConnections); - ListenTransFds[i] = ListenTransFds[ListenTransCount - 1]; - ListenTransConns[i] = ListenTransConns[ListenTransCount - 1]; - ListenTransCount -= 1; - i -= 1; - } - else if (status == TRANS_RESET_NEW_FD) - { - /* - * A new file descriptor was allocated (the old one was closed) - */ - - int newfd = _XSERVTransGetConnectionNumber (ListenTransConns[i]); - - FD_CLR (ListenTransFds[i], &WellKnownConnections); - ListenTransFds[i] = newfd; - FD_SET(newfd, &WellKnownConnections); - } - } - } - - ResetAuthorization (); - ResetHosts(display); - /* - * See above in CreateWellKnownSockets about SIGUSR1 - */ -#if !defined(WIN32) - if (RunFromSmartParent) { - if (ParentProcess > 1) { - kill (ParentProcess, SIGUSR1); - } - } -#endif - /* - * restart XDMCP - */ -#ifdef XDMCP - XdmcpReset (); -#endif -} - -void -CloseWellKnownConnections(void) -{ - int i; - - for (i = 0; i < ListenTransCount; i++) - _XSERVTransClose (ListenTransConns[i]); -} - -static void -AuthAudit (ClientPtr client, Bool letin, - struct sockaddr *saddr, int len, - unsigned int proto_n, char *auth_proto, int auth_id) -{ - char addr[128]; - char *out = addr; - - if (!((OsCommPtr)client->osPrivate)->trans_conn) { - strcpy(addr, "LBX proxy at "); - out += strlen(addr); - } - if (!len) - strcpy(out, "local host"); - else - switch (saddr->sa_family) - { - case AF_UNSPEC: -#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) - case AF_UNIX: -#endif - strcpy(out, "local host"); - break; -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN) - case AF_INET: - sprintf(out, "IP %s", - inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr)); - break; -#if defined(IPv6) && defined(AF_INET6) - case AF_INET6: { - char ipaddr[INET6_ADDRSTRLEN]; - inet_ntop(AF_INET6, &((struct sockaddr_in6 *) saddr)->sin6_addr, - ipaddr, sizeof(ipaddr)); - sprintf(out, "IP %s", ipaddr); - } - break; -#endif -#endif -#ifdef DNETCONN - case AF_DECnet: - sprintf(out, "DN %s", - dnet_ntoa(&((struct sockaddr_dn *) saddr)->sdn_add)); - break; -#endif - default: - strcpy(out, "unknown address"); - } - - if (proto_n) - AuditF("client %d %s from %s\n Auth name: %.*s ID: %d\n", - client->index, letin ? "connected" : "rejected", addr, - (int)proto_n, auth_proto, auth_id); - else - AuditF("client %d %s from %s\n", - client->index, letin ? "connected" : "rejected", addr); -} - -XID -AuthorizationIDOfClient(ClientPtr client) -{ - if (client->osPrivate) - return ((OsCommPtr)client->osPrivate)->auth_id; - else - return None; -} - - -/***************************************************************** - * ClientAuthorized - * - * Sent by the client at connection setup: - * typedef struct _xConnClientPrefix { - * CARD8 byteOrder; - * BYTE pad; - * CARD16 majorVersion, minorVersion; - * CARD16 nbytesAuthProto; - * CARD16 nbytesAuthString; - * } xConnClientPrefix; - * - * It is hoped that eventually one protocol will be agreed upon. In the - * mean time, a server that implements a different protocol than the - * client expects, or a server that only implements the host-based - * mechanism, will simply ignore this information. - * - *****************************************************************/ - -char * -ClientAuthorized(ClientPtr client, - unsigned int proto_n, char *auth_proto, - unsigned int string_n, char *auth_string) -{ - OsCommPtr priv; - Xtransaddr *from = NULL; - int family; - int fromlen; - XID auth_id; - char *reason = NULL; - XtransConnInfo trans_conn; - int restore_trans_conn = 0; - ClientPtr lbxpc = NULL; - - priv = (OsCommPtr)client->osPrivate; - trans_conn = priv->trans_conn; - -#ifdef LBX - if (!trans_conn) { - /* - * Since trans_conn is NULL, this must be a proxy's client for - * which we have NO address. Therefore, we will temporarily - * set the client's trans_conn to the proxy's trans_conn and - * after CheckAuthorization the client's trans_conn will be - * restored. - * - * If XDM-AUTHORIZATION-1 is being used, CheckAuthorization - * will eventually call XdmAuthorizationValidate and this - * later function may use the client's trans_conn to get the - * client's address. Since a XDM-AUTH-1 auth string includes - * the client's address, this address is compared to the address - * in the client's trans_conn. If the proxy and client are - * on the same host, the comparison will fail; otherwise the - * comparison will fail and the client will not be authorized - * to connect to the server. - * - * The basis for this additional code is to prevent a - * NULL pointer dereference of the client's trans_conn. - * The fundamental problem - the fact that the client's - * trans_conn is NULL - is because the NewClient - * request in version 1.0 of the LBX protocol does not - * send the client's address to the server. When the - * spec is changed and the client's address is sent to - * server in the NewClient request, this additional code - * should be removed. - * - * See defect number XWSog08218 for more information. - */ - lbxpc = LbxProxyClient(priv->proxy); - trans_conn = ((OsCommPtr)lbxpc->osPrivate)->trans_conn; - priv->trans_conn = trans_conn; - restore_trans_conn = 1; - } -#endif - - auth_id = CheckAuthorization (proto_n, auth_proto, - string_n, auth_string, client, &reason); - -#ifdef LBX - if (! priv->trans_conn) { - if (auth_id == (XID) ~0L && !GetAccessControl()) - auth_id = ((OsCommPtr)lbxpc->osPrivate)->auth_id; -#ifdef XCSECURITY - else if (auth_id != (XID) ~0L && !SecuritySameLevel(lbxpc, auth_id)) { - auth_id = (XID) ~0L; - reason = "Client trust level differs from that of LBX Proxy"; - } -#endif - } -#endif - if (auth_id == (XID) ~0L) - { - if ( -#ifdef XCSECURITY - (proto_n == 0 || - strncmp (auth_proto, XSecurityAuthorizationName, proto_n) != 0) && -#endif - _XSERVTransGetPeerAddr (trans_conn, - &family, &fromlen, &from) != -1) - { - if ( -#ifdef LBX - !trans_conn || -#endif - InvalidHost ((struct sockaddr *) from, fromlen, client)) - AuthAudit(client, FALSE, (struct sockaddr *) from, - fromlen, proto_n, auth_proto, auth_id); - else - { - auth_id = (XID) 0; - if (auditTrailLevel > 1) - AuthAudit(client, TRUE, - (struct sockaddr *) from, fromlen, - proto_n, auth_proto, auth_id); - } - - xfree ((char *) from); - } - - if (auth_id == (XID) ~0L) { -#ifdef LBX - /* - * Restore client's trans_conn state - */ - if (restore_trans_conn) { - priv->trans_conn = NULL; - } -#endif - if (reason) - return reason; - else - return "Client is not authorized to connect to Server"; - } - } - else if (auditTrailLevel > 1) - { - if (_XSERVTransGetPeerAddr (trans_conn, - &family, &fromlen, &from) != -1) - { - AuthAudit(client, TRUE, (struct sockaddr *) from, fromlen, - proto_n, auth_proto, auth_id); - - xfree ((char *) from); - } - } - priv->auth_id = auth_id; - priv->conn_time = 0; - -#ifdef XDMCP - /* indicate to Xdmcp protocol that we've opened new client */ - XdmcpOpenDisplay(priv->fd); -#endif /* XDMCP */ -#ifdef XAPPGROUP - if (ClientStateCallback) - XagCallClientStateChange (client); -#endif - /* At this point, if the client is authorized to change the access control - * list, we should getpeername() information, and add the client to - * the selfhosts list. It's not really the host machine, but the - * true purpose of the selfhosts list is to see who may change the - * access control list. - */ -#ifdef LBX - if (restore_trans_conn) { - priv->trans_conn = NULL; - } -#endif - return((char *)NULL); -} - -static ClientPtr -#ifdef LBX -AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time, - int (*Flush)( - ClientPtr /*who*/, OsCommPtr /*oc*/, - char * /*extraBuf*/, int /*extraCount*/), - void (*Close)( - ClientPtr /*client*/), - LbxProxyPtr proxy) -#else -AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) -#endif -{ - OsCommPtr oc; - ClientPtr client; - - if ( -#ifdef LBX - trans_conn && -#endif -#ifndef WIN32 - fd >= lastfdesc -#else - XFD_SETCOUNT(&AllClients) >= MaxClients -#endif - ) - return NullClient; - oc = (OsCommPtr)xalloc(sizeof(OsCommRec)); - if (!oc) - return NullClient; - oc->trans_conn = trans_conn; - oc->fd = fd; - oc->input = (ConnectionInputPtr)NULL; - oc->output = (ConnectionOutputPtr)NULL; - oc->auth_id = None; - oc->conn_time = conn_time; -#ifdef LBX - oc->proxy = proxy; - oc->Flush = Flush; - oc->Close = Close; - oc->largereq = (ConnectionInputPtr) NULL; -#endif - if (!(client = NextAvailableClient((pointer)oc))) - { - xfree (oc); - return NullClient; - } -#ifdef LBX - if (trans_conn) -#endif - { -#if !defined(WIN32) - ConnectionTranslation[fd] = client->index; -#else - SetConnectionTranslation(fd, client->index); -#endif - if (GrabInProgress) - { - FD_SET(fd, &SavedAllClients); - FD_SET(fd, &SavedAllSockets); - } - else - { - FD_SET(fd, &AllClients); - FD_SET(fd, &AllSockets); - } - } - -#ifdef DEBUG - ErrorF("AllocNewConnection: client index = %d, socket fd = %d\n", - client->index, fd); -#endif - - return client; -} - -#ifdef LBX - -int -ClientConnectionNumber (ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr) client->osPrivate; - - return oc->fd; -} - -ClientPtr -AllocLbxClientConnection (ClientPtr client, LbxProxyPtr proxy) -{ - OsCommPtr oc = (OsCommPtr) client->osPrivate; - - return AllocNewConnection ((XtransConnInfo)NULL, oc->fd, GetTimeInMillis(), - LbxFlushClient, LbxCloseClient, proxy); -} - -void -LbxProxyConnection (ClientPtr client, LbxProxyPtr proxy) -{ - OsCommPtr oc = (OsCommPtr) client->osPrivate; - - FlushClient(client, oc, (char *)NULL, 0); - oc->proxy = proxy; - oc->Flush = LbxFlushClient; - oc->Close = LbxCloseClient; - LbxPrimeInput(client, proxy); -} - -#endif - -/***************** - * EstablishNewConnections - * If anyone is waiting on listened sockets, accept them. - * Returns a mask with indices of new clients. Updates AllClients - * and AllSockets. - *****************/ - -/*ARGSUSED*/ -Bool -EstablishNewConnections(ClientPtr clientUnused, pointer closure) -{ - fd_set readyconnections; /* set of listeners that are ready */ - int curconn; /* fd of listener that's ready */ - register int newconn; /* fd of new client */ - CARD32 connect_time; - register int i; - register ClientPtr client; - register OsCommPtr oc; - fd_set tmask; - - XFD_ANDSET (&tmask, (fd_set*)closure, &WellKnownConnections); - XFD_COPYSET(&tmask, &readyconnections); - if (!XFD_ANYSET(&readyconnections)) - return TRUE; - connect_time = GetTimeInMillis(); - /* kill off stragglers */ - for (i=1; iosPrivate); - if ((oc && (oc->conn_time != 0) && - (connect_time - oc->conn_time) >= TimeOutValue) || - (client->noClientException != Success && !client->clientGone)) - CloseDownClient(client); - } - } -#ifndef WIN32 - for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) - { - while (readyconnections.fds_bits[i]) -#else - for (i = 0; i < XFD_SETCOUNT(&readyconnections); i++) -#endif - { - XtransConnInfo trans_conn, new_trans_conn; - int status; - -#ifndef WIN32 - curconn = ffs (readyconnections.fds_bits[i]) - 1; - readyconnections.fds_bits[i] &= ~((fd_mask)1 << curconn); - curconn += (i * (sizeof(fd_mask)*8)); -#else - curconn = XFD_FD(&readyconnections, i); -#endif - - if ((trans_conn = lookup_trans_conn (curconn)) == NULL) - continue; - - if ((new_trans_conn = _XSERVTransAccept (trans_conn, &status)) == NULL) - continue; - - newconn = _XSERVTransGetConnectionNumber (new_trans_conn); - - if (newconn < lastfdesc) - { - int clientid; -#if !defined(WIN32) - clientid = ConnectionTranslation[newconn]; -#else - clientid = GetConnectionTranslation(newconn); -#endif - if(clientid && (client = clients[clientid])) - CloseDownClient(client); - } - - _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); - - if (!AllocNewConnection (new_trans_conn, newconn, connect_time -#ifdef LBX - , StandardFlushClient, - CloseDownFileDescriptor, (LbxProxyPtr)NULL -#endif - )) - { - ErrorConnMax(new_trans_conn); - _XSERVTransClose(new_trans_conn); - } - } -#ifndef WIN32 - } -#endif - return TRUE; -} - -#define NOROOM "Maximum number of clients reached" - -/************ - * ErrorConnMax - * Fail a connection due to lack of client or file descriptor space - ************/ - -static void -ErrorConnMax(XtransConnInfo trans_conn) -{ - int fd = _XSERVTransGetConnectionNumber (trans_conn); - xConnSetupPrefix csp; - char pad[3]; - struct iovec iov[3]; - char byteOrder = 0; - int whichbyte = 1; - struct timeval waittime; - fd_set mask; - - /* if these seems like a lot of trouble to go to, it probably is */ - waittime.tv_sec = BOTIMEOUT / MILLI_PER_SECOND; - waittime.tv_usec = (BOTIMEOUT % MILLI_PER_SECOND) * - (1000000 / MILLI_PER_SECOND); - FD_ZERO(&mask); - FD_SET(fd, &mask); - (void)Select(fd + 1, &mask, NULL, NULL, &waittime); - /* try to read the byte-order of the connection */ - (void)_XSERVTransRead(trans_conn, &byteOrder, 1); - if ((byteOrder == 'l') || (byteOrder == 'B')) - { - csp.success = xFalse; - csp.lengthReason = sizeof(NOROOM) - 1; - csp.length = (sizeof(NOROOM) + 2) >> 2; - csp.majorVersion = X_PROTOCOL; - csp.minorVersion = X_PROTOCOL_REVISION; - if (((*(char *) &whichbyte) && (byteOrder == 'B')) || - (!(*(char *) &whichbyte) && (byteOrder == 'l'))) - { - swaps(&csp.majorVersion, whichbyte); - swaps(&csp.minorVersion, whichbyte); - swaps(&csp.length, whichbyte); - } - iov[0].iov_len = sz_xConnSetupPrefix; - iov[0].iov_base = (char *) &csp; - iov[1].iov_len = csp.lengthReason; - iov[1].iov_base = NOROOM; - iov[2].iov_len = (4 - (csp.lengthReason & 3)) & 3; - iov[2].iov_base = pad; - (void)_XSERVTransWritev(trans_conn, iov, 3); - } -} - -/************ - * CloseDownFileDescriptor: - * Remove this file descriptor and it's I/O buffers, etc. - ************/ - -#ifdef LBX -void -CloseDownFileDescriptor(ClientPtr client) -#else -static void -CloseDownFileDescriptor(OsCommPtr oc) -#endif -{ -#ifdef LBX - OsCommPtr oc = (OsCommPtr) client->osPrivate; -#endif - int connection = oc->fd; - - if (oc->trans_conn) { - _XSERVTransDisconnect(oc->trans_conn); - _XSERVTransClose(oc->trans_conn); - } -#ifndef LBX - FreeOsBuffers(oc); - xfree(oc); -#endif -#ifndef WIN32 - ConnectionTranslation[connection] = 0; -#else - SetConnectionTranslation(connection, 0); -#endif - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - FD_CLR(connection, &ClientsWithInput); - FD_CLR(connection, &GrabImperviousClients); - if (GrabInProgress) - { - FD_CLR(connection, &SavedAllSockets); - FD_CLR(connection, &SavedAllClients); - FD_CLR(connection, &SavedClientsWithInput); - } - FD_CLR(connection, &ClientsWriteBlocked); - if (!XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - FD_CLR(connection, &OutputPending); -} - -/***************** - * CheckConnections - * Some connection has died, go find which one and shut it down - * The file descriptor has been closed, but is still in AllClients. - * If would truly be wonderful if select() would put the bogus - * file descriptors in the exception mask, but nooooo. So we have - * to check each and every socket individually. - *****************/ - -void -CheckConnections(void) -{ -#ifndef WIN32 - fd_mask mask; -#endif - fd_set tmask; - int curclient, curoff; - int i; - struct timeval notime; - int r; -#ifdef WIN32 - fd_set savedAllClients; -#endif - - notime.tv_sec = 0; - notime.tv_usec = 0; - -#ifndef WIN32 - for (i=0; iosPrivate; - - if (oc->output && oc->output->count) - FlushClient(client, oc, (char *)NULL, 0); -#ifdef XDMCP - XdmcpCloseDisplay(oc->fd); -#endif -#ifndef LBX - CloseDownFileDescriptor(oc); -#else - (*oc->Close) (client); - FreeOsBuffers(oc); - xfree(oc); -#endif - client->osPrivate = (pointer)NULL; - if (auditTrailLevel > 1) - AuditF("client %d disconnected\n", client->index); -} - -void -AddEnabledDevice(int fd) -{ - FD_SET(fd, &EnabledDevices); - FD_SET(fd, &AllSockets); - if (GrabInProgress) - FD_SET(fd, &SavedAllSockets); -} - -void -RemoveEnabledDevice(int fd) -{ - FD_CLR(fd, &EnabledDevices); - FD_CLR(fd, &AllSockets); - if (GrabInProgress) - FD_CLR(fd, &SavedAllSockets); -} - -/***************** - * OnlyListenToOneClient: - * Only accept requests from one client. Continue to handle new - * connections, but don't take any protocol requests from the new - * ones. Note that if GrabInProgress is set, EstablishNewConnections - * needs to put new clients into SavedAllSockets and SavedAllClients. - * Note also that there is no timeout for this in the protocol. - * This routine is "undone" by ListenToAllClients() - *****************/ - -void -OnlyListenToOneClient(ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; - - if (! GrabInProgress) - { - XFD_COPYSET(&ClientsWithInput, &SavedClientsWithInput); - XFD_ANDSET(&ClientsWithInput, - &ClientsWithInput, &GrabImperviousClients); - if (FD_ISSET(connection, &SavedClientsWithInput)) - { - FD_CLR(connection, &SavedClientsWithInput); - FD_SET(connection, &ClientsWithInput); - } - XFD_UNSET(&SavedClientsWithInput, &GrabImperviousClients); - XFD_COPYSET(&AllSockets, &SavedAllSockets); - XFD_COPYSET(&AllClients, &SavedAllClients); - XFD_UNSET(&AllSockets, &AllClients); - XFD_ANDSET(&AllClients, &AllClients, &GrabImperviousClients); - FD_SET(connection, &AllClients); - XFD_ORSET(&AllSockets, &AllSockets, &AllClients); - GrabInProgress = client->index; - } -} - -/**************** - * ListenToAllClients: - * Undoes OnlyListentToOneClient() - ****************/ - -void -ListenToAllClients(void) -{ - if (GrabInProgress) - { - XFD_ORSET(&AllSockets, &AllSockets, &SavedAllSockets); - XFD_ORSET(&AllClients, &AllClients, &SavedAllClients); - XFD_ORSET(&ClientsWithInput, &ClientsWithInput, &SavedClientsWithInput); - GrabInProgress = 0; - } -} - -/**************** - * IgnoreClient - * Removes one client from input masks. - * Must have cooresponding call to AttendClient. - ****************/ - -void -IgnoreClient (ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; -#ifdef LBX - LbxClientPtr lbxClient = LbxClient(client); -#endif - - isItTimeToYield = TRUE; -#ifdef LBX - if (lbxClient) { - lbxClient->ignored = TRUE; - return; - } -#endif - if (!GrabInProgress || FD_ISSET(connection, &AllClients)) - { - if (FD_ISSET (connection, &ClientsWithInput)) - FD_SET(connection, &IgnoredClientsWithInput); - else - FD_CLR(connection, &IgnoredClientsWithInput); - FD_CLR(connection, &ClientsWithInput); - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - FD_CLR(connection, &LastSelectMask); - } - else - { - if (FD_ISSET (connection, &SavedClientsWithInput)) - FD_SET(connection, &IgnoredClientsWithInput); - else - FD_CLR(connection, &IgnoredClientsWithInput); - FD_CLR(connection, &SavedClientsWithInput); - FD_CLR(connection, &SavedAllSockets); - FD_CLR(connection, &SavedAllClients); - } -} - -/**************** - * AttendClient - * Adds one client back into the input masks. - ****************/ - -void -AttendClient (ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; -#ifdef LBX - LbxClientPtr lbxClient = LbxClient(client); - - if (lbxClient) { - lbxClient->ignored = FALSE; - return; - } -#endif - if (!GrabInProgress || GrabInProgress == client->index || - FD_ISSET(connection, &GrabImperviousClients)) - { - FD_SET(connection, &AllClients); - FD_SET(connection, &AllSockets); - FD_SET(connection, &LastSelectMask); - if (FD_ISSET (connection, &IgnoredClientsWithInput)) - FD_SET(connection, &ClientsWithInput); - } - else - { - FD_SET(connection, &SavedAllClients); - FD_SET(connection, &SavedAllSockets); - if (FD_ISSET(connection, &IgnoredClientsWithInput)) - FD_SET(connection, &SavedClientsWithInput); - } -} - -/* make client impervious to grabs; assume only executing client calls this */ - -void -MakeClientGrabImpervious(ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; - - FD_SET(connection, &GrabImperviousClients); - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = CLIENT_IMPERVIOUS; - CallCallbacks(&ServerGrabCallback, &grabinfo); - } -} - -/* make client pervious to grabs; assume only executing client calls this */ - -void -MakeClientGrabPervious(ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; - - FD_CLR(connection, &GrabImperviousClients); - if (GrabInProgress && (GrabInProgress != client->index)) - { - if (FD_ISSET(connection, &ClientsWithInput)) - { - FD_SET(connection, &SavedClientsWithInput); - FD_CLR(connection, &ClientsWithInput); - } - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - isItTimeToYield = TRUE; - } - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = CLIENT_PERVIOUS; - CallCallbacks(&ServerGrabCallback, &grabinfo); - } -} - diff --git a/nx-X11/programs/Xserver/os/connection.c.X.original b/nx-X11/programs/Xserver/os/connection.c.X.original deleted file mode 100644 index 0a12c655d..000000000 --- a/nx-X11/programs/Xserver/os/connection.c.X.original +++ /dev/null @@ -1,1385 +0,0 @@ -/* $Xorg: connection.c,v 1.6 2001/02/09 02:05:23 xorgcvs Exp $ */ -/*********************************************************** - -Copyright 1987, 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/programs/Xserver/os/connection.c,v 3.64 2003/10/07 22:50:42 herrb Exp $ */ -/***************************************************************** - * Stuff to create connections --- OS dependent - * - * EstablishNewConnections, CreateWellKnownSockets, ResetWellKnownSockets, - * CloseDownConnection, CheckConnections, AddEnabledDevice, - * RemoveEnabledDevice, OnlyListToOneClient, - * ListenToAllClients, - * - * (WaitForSomething is in its own file) - * - * In this implementation, a client socket table is not kept. - * Instead, what would be the index into the table is just the - * file descriptor of the socket. This won't work for if the - * socket ids aren't small nums (0 - 2^8) - * - *****************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#endif -#include -#include -#define XSERV_t -#define TRANS_SERVER -#define TRANS_REOPEN -#include -#include -#include -#include -#include - -#ifndef WIN32 -#if defined(Lynx) -#include -#else -#include -#endif - -#ifdef hpux -#include -#include -#endif - -#if defined(DGUX) -#include -#include -#include -#include -#include -#include -#include -#include -#endif - - -#ifdef AIXV3 -#include -#endif - -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -extern __const__ int _nfiles; -#endif - -#if defined(TCPCONN) || defined(STREAMSCONN) -# include -# include -# if !defined(hpux) -# ifdef apollo -# ifndef NO_TCP_H -# include -# endif -# else -# ifdef CSRG_BASED -# include -# endif -# ifndef __UNIXOS2__ -# include -# endif -# endif -# endif -# include -#endif - -#if !defined(__UNIXOS2__) -#ifndef Lynx -#include -#else -#include -#endif -#endif -#endif /* WIN32 */ -#include "misc.h" /* for typedef of pointer */ -#include "osdep.h" -#include -#include "opaque.h" -#include "dixstruct.h" -#ifdef XAPPGROUP -#include -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif -#ifdef LBX -#include "colormapst.h" -#include "propertyst.h" -#include "lbxserve.h" -#include "osdep.h" -#endif - -#ifdef X_NOT_POSIX -#define Pid_t int -#else -#define Pid_t pid_t -#endif - -#ifdef DNETCONN -#include -#endif /* DNETCONN */ - -int lastfdesc; /* maximum file descriptor */ - -fd_set WellKnownConnections; /* Listener mask */ -fd_set EnabledDevices; /* mask for input devices that are on */ -fd_set AllSockets; /* select on this */ -fd_set AllClients; /* available clients */ -fd_set LastSelectMask; /* mask returned from last select call */ -fd_set ClientsWithInput; /* clients with FULL requests in buffer */ -fd_set ClientsWriteBlocked; /* clients who cannot receive output */ -fd_set OutputPending; /* clients with reply/event data ready to go */ -int MaxClients = 0; -Bool NewOutputPending; /* not yet attempted to write some new output */ -Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ - -Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ -Bool PartialNetwork; /* continue even if unable to bind all addrs */ -static Pid_t ParentProcess; -#ifdef __UNIXOS2__ -Pid_t GetPPID(Pid_t pid); -#endif - -static Bool debug_conns = FALSE; - -fd_set IgnoredClientsWithInput; -static fd_set GrabImperviousClients; -static fd_set SavedAllClients; -static fd_set SavedAllSockets; -static fd_set SavedClientsWithInput; -int GrabInProgress = 0; - -#if !defined(WIN32) -int *ConnectionTranslation = NULL; -#else -/* - * On NT fds are not between 0 and MAXSOCKS, they are unrelated, and there is - * not even a known maximum value, so use something quite arbitrary for now. - * Do storage is a hash table of size 256. Collisions are handled in a linked - * list. - */ - -#undef MAXSOCKS -#define MAXSOCKS 500 -#undef MAXSELECT -#define MAXSELECT 500 -#define MAXFD 500 - -struct _ct_node { - struct _ct_node *next; - int key; - int value; -}; - -struct _ct_node *ct_head[256]; - -void InitConnectionTranslation(void) -{ - bzero(ct_head, sizeof(ct_head)); -} - -int GetConnectionTranslation(int conn) -{ - struct _ct_node *node = ct_head[conn & 0xff]; - while (node != NULL) - { - if (node->key == conn) - return node->value; - node = node->next; - } - return 0; -} - -void SetConnectionTranslation(int conn, int client) -{ - struct _ct_node **node = ct_head + (conn & 0xff); - if (client == 0) /* remove entry */ - { - while (*node != NULL) - { - if ((*node)->key == conn) - { - struct _ct_node *temp = *node; - *node = (*node)->next; - free(temp); - return; - } - node = &((*node)->next); - } - return; - } else - { - while (*node != NULL) - { - if ((*node)->key == conn) - { - (*node)->value = client; - return; - } - node = &((*node)->next); - } - *node = (struct _ct_node*)xalloc(sizeof(struct _ct_node)); - (*node)->next = NULL; - (*node)->key = conn; - (*node)->value = client; - return; - } -} - -void ClearConnectionTranslation(void) -{ - unsigned i; - for (i = 0; i < 256; i++) - { - struct _ct_node *node = ct_head[i]; - while (node != NULL) - { - struct _ct_node *temp = node; - node = node->next; - xfree(temp); - } - } -} -#endif - -XtransConnInfo *ListenTransConns = NULL; -int *ListenTransFds = NULL; -int ListenTransCount; - -static void ErrorConnMax(XtransConnInfo /* trans_conn */); - -#ifndef LBX -static -void CloseDownFileDescriptor( - OsCommPtr /*oc*/ -); -#endif - - -static XtransConnInfo -lookup_trans_conn (int fd) -{ - if (ListenTransFds) - { - int i; - for (i = 0; i < ListenTransCount; i++) - if (ListenTransFds[i] == fd) - return ListenTransConns[i]; - } - - return (NULL); -} - -/* Set MaxClients and lastfdesc, and allocate ConnectionTranslation */ - -void -InitConnectionLimits(void) -{ - lastfdesc = -1; - -#ifndef __CYGWIN__ - -#ifndef __UNIXOS2__ - -#if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX) - lastfdesc = sysconf(_SC_OPEN_MAX) - 1; -#endif - -#ifdef HAS_GETDTABLESIZE - if (lastfdesc < 0) - lastfdesc = getdtablesize() - 1; -#endif - -#ifdef _NFILE - if (lastfdesc < 0) - lastfdesc = _NFILE - 1; -#endif - -#else /* __UNIXOS2__ */ - lastfdesc = _nfiles - 1; -#endif - -#endif /* __CYGWIN__ */ - - /* This is the fallback */ - if (lastfdesc < 0) - lastfdesc = MAXSOCKS; - - if (lastfdesc > MAXSELECT) - lastfdesc = MAXSELECT; - - if (lastfdesc > MAXCLIENTS) - { - lastfdesc = MAXCLIENTS; - if (debug_conns) - ErrorF( "REACHED MAXIMUM CLIENTS LIMIT %d\n", MAXCLIENTS); - } - MaxClients = lastfdesc; - -#ifdef DEBUG - ErrorF("InitConnectionLimits: MaxClients = %d\n", MaxClients); -#endif - -#if !defined(WIN32) - ConnectionTranslation = (int *)xnfalloc(sizeof(int)*(lastfdesc + 1)); -#else - InitConnectionTranslation(); -#endif -} - - -/***************** - * CreateWellKnownSockets - * At initialization, create the sockets to listen on for new clients. - *****************/ - -void -CreateWellKnownSockets(void) -{ - int i; - int partial; - char port[20]; - OsSigHandlerPtr handler; - - FD_ZERO(&AllSockets); - FD_ZERO(&AllClients); - FD_ZERO(&LastSelectMask); - FD_ZERO(&ClientsWithInput); - -#if !defined(WIN32) - for (i=0; i= 0) && - (ListenTransCount >= 1)) - { - if (!PartialNetwork && partial) - { - FatalError ("Failed to establish all listening sockets"); - } - else - { - ListenTransFds = (int *) xalloc (ListenTransCount * sizeof (int)); - - for (i = 0; i < ListenTransCount; i++) - { - int fd = _XSERVTransGetConnectionNumber (ListenTransConns[i]); - - ListenTransFds[i] = fd; - FD_SET (fd, &WellKnownConnections); - - if (!_XSERVTransIsLocal (ListenTransConns[i])) - { - DefineSelf (fd); - } - } - } - } - - if (!XFD_ANYSET (&WellKnownConnections)) - FatalError ("Cannot establish any listening sockets - Make sure an X server isn't already running"); -#if !defined(WIN32) - OsSignal (SIGPIPE, SIG_IGN); - OsSignal (SIGHUP, AutoResetServer); -#endif - OsSignal (SIGINT, GiveUp); - OsSignal (SIGTERM, GiveUp); - XFD_COPYSET (&WellKnownConnections, &AllSockets); - ResetHosts(display); - /* - * Magic: If SIGUSR1 was set to SIG_IGN when - * the server started, assume that either - * - * a- The parent process is ignoring SIGUSR1 - * - * or - * - * b- The parent process is expecting a SIGUSR1 - * when the server is ready to accept connections - * - * In the first case, the signal will be harmless, - * in the second case, the signal will be quite - * useful - */ -#if !defined(WIN32) - handler = OsSignal (SIGUSR1, SIG_IGN); - if ( handler == SIG_IGN) - RunFromSmartParent = TRUE; - OsSignal(SIGUSR1, handler); - ParentProcess = getppid (); -#ifdef __UNIXOS2__ - /* - * fg030505: under OS/2, xinit is not the parent process but - * the "grant parent" process of the server because execvpe() - * presents us an additional process number; - * GetPPID(pid) is part of libemxfix - */ - ParentProcess = GetPPID (ParentProcess); -#endif /* __UNIXOS2__ */ - if (RunFromSmartParent) { - if (ParentProcess > 1) { - kill (ParentProcess, SIGUSR1); - } - } -#endif -#ifdef XDMCP - XdmcpInit (); -#endif -} - -void -ResetWellKnownSockets (void) -{ - int i; - - ResetOsBuffers(); - - for (i = 0; i < ListenTransCount; i++) - { - int status = _XSERVTransResetListener (ListenTransConns[i]); - - if (status != TRANS_RESET_NOOP) - { - if (status == TRANS_RESET_FAILURE) - { - /* - * ListenTransConns[i] freed by xtrans. - * Remove it from out list. - */ - - FD_CLR (ListenTransFds[i], &WellKnownConnections); - ListenTransFds[i] = ListenTransFds[ListenTransCount - 1]; - ListenTransConns[i] = ListenTransConns[ListenTransCount - 1]; - ListenTransCount -= 1; - i -= 1; - } - else if (status == TRANS_RESET_NEW_FD) - { - /* - * A new file descriptor was allocated (the old one was closed) - */ - - int newfd = _XSERVTransGetConnectionNumber (ListenTransConns[i]); - - FD_CLR (ListenTransFds[i], &WellKnownConnections); - ListenTransFds[i] = newfd; - FD_SET(newfd, &WellKnownConnections); - } - } - } - - ResetAuthorization (); - ResetHosts(display); - /* - * See above in CreateWellKnownSockets about SIGUSR1 - */ -#if !defined(WIN32) - if (RunFromSmartParent) { - if (ParentProcess > 1) { - kill (ParentProcess, SIGUSR1); - } - } -#endif - /* - * restart XDMCP - */ -#ifdef XDMCP - XdmcpReset (); -#endif -} - -void -CloseWellKnownConnections(void) -{ - int i; - - for (i = 0; i < ListenTransCount; i++) - _XSERVTransClose (ListenTransConns[i]); -} - -static void -AuthAudit (ClientPtr client, Bool letin, - struct sockaddr *saddr, int len, - unsigned int proto_n, char *auth_proto, int auth_id) -{ - char addr[128]; - char *out = addr; - - if (!((OsCommPtr)client->osPrivate)->trans_conn) { - strcpy(addr, "LBX proxy at "); - out += strlen(addr); - } - if (!len) - strcpy(out, "local host"); - else - switch (saddr->sa_family) - { - case AF_UNSPEC: -#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) - case AF_UNIX: -#endif - strcpy(out, "local host"); - break; -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN) - case AF_INET: - sprintf(out, "IP %s", - inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr)); - break; -#if defined(IPv6) && defined(AF_INET6) - case AF_INET6: { - char ipaddr[INET6_ADDRSTRLEN]; - inet_ntop(AF_INET6, &((struct sockaddr_in6 *) saddr)->sin6_addr, - ipaddr, sizeof(ipaddr)); - sprintf(out, "IP %s", ipaddr); - } - break; -#endif -#endif -#ifdef DNETCONN - case AF_DECnet: - sprintf(out, "DN %s", - dnet_ntoa(&((struct sockaddr_dn *) saddr)->sdn_add)); - break; -#endif - default: - strcpy(out, "unknown address"); - } - - if (proto_n) - AuditF("client %d %s from %s\n Auth name: %.*s ID: %d\n", - client->index, letin ? "connected" : "rejected", addr, - (int)proto_n, auth_proto, auth_id); - else - AuditF("client %d %s from %s\n", - client->index, letin ? "connected" : "rejected", addr); -} - -XID -AuthorizationIDOfClient(ClientPtr client) -{ - if (client->osPrivate) - return ((OsCommPtr)client->osPrivate)->auth_id; - else - return None; -} - - -/***************************************************************** - * ClientAuthorized - * - * Sent by the client at connection setup: - * typedef struct _xConnClientPrefix { - * CARD8 byteOrder; - * BYTE pad; - * CARD16 majorVersion, minorVersion; - * CARD16 nbytesAuthProto; - * CARD16 nbytesAuthString; - * } xConnClientPrefix; - * - * It is hoped that eventually one protocol will be agreed upon. In the - * mean time, a server that implements a different protocol than the - * client expects, or a server that only implements the host-based - * mechanism, will simply ignore this information. - * - *****************************************************************/ - -char * -ClientAuthorized(ClientPtr client, - unsigned int proto_n, char *auth_proto, - unsigned int string_n, char *auth_string) -{ - OsCommPtr priv; - Xtransaddr *from = NULL; - int family; - int fromlen; - XID auth_id; - char *reason = NULL; - XtransConnInfo trans_conn; - int restore_trans_conn = 0; - ClientPtr lbxpc = NULL; - - priv = (OsCommPtr)client->osPrivate; - trans_conn = priv->trans_conn; - -#ifdef LBX - if (!trans_conn) { - /* - * Since trans_conn is NULL, this must be a proxy's client for - * which we have NO address. Therefore, we will temporarily - * set the client's trans_conn to the proxy's trans_conn and - * after CheckAuthorization the client's trans_conn will be - * restored. - * - * If XDM-AUTHORIZATION-1 is being used, CheckAuthorization - * will eventually call XdmAuthorizationValidate and this - * later function may use the client's trans_conn to get the - * client's address. Since a XDM-AUTH-1 auth string includes - * the client's address, this address is compared to the address - * in the client's trans_conn. If the proxy and client are - * on the same host, the comparison will fail; otherwise the - * comparison will fail and the client will not be authorized - * to connect to the server. - * - * The basis for this additional code is to prevent a - * NULL pointer dereference of the client's trans_conn. - * The fundamental problem - the fact that the client's - * trans_conn is NULL - is because the NewClient - * request in version 1.0 of the LBX protocol does not - * send the client's address to the server. When the - * spec is changed and the client's address is sent to - * server in the NewClient request, this additional code - * should be removed. - * - * See defect number XWSog08218 for more information. - */ - lbxpc = LbxProxyClient(priv->proxy); - trans_conn = ((OsCommPtr)lbxpc->osPrivate)->trans_conn; - priv->trans_conn = trans_conn; - restore_trans_conn = 1; - } -#endif - - auth_id = CheckAuthorization (proto_n, auth_proto, - string_n, auth_string, client, &reason); - -#ifdef LBX - if (! priv->trans_conn) { - if (auth_id == (XID) ~0L && !GetAccessControl()) - auth_id = ((OsCommPtr)lbxpc->osPrivate)->auth_id; -#ifdef XCSECURITY - else if (auth_id != (XID) ~0L && !SecuritySameLevel(lbxpc, auth_id)) { - auth_id = (XID) ~0L; - reason = "Client trust level differs from that of LBX Proxy"; - } -#endif - } -#endif - if (auth_id == (XID) ~0L) - { - if ( -#ifdef XCSECURITY - (proto_n == 0 || - strncmp (auth_proto, XSecurityAuthorizationName, proto_n) != 0) && -#endif - _XSERVTransGetPeerAddr (trans_conn, - &family, &fromlen, &from) != -1) - { - if ( -#ifdef LBX - !trans_conn || -#endif - InvalidHost ((struct sockaddr *) from, fromlen, client)) - AuthAudit(client, FALSE, (struct sockaddr *) from, - fromlen, proto_n, auth_proto, auth_id); - else - { - auth_id = (XID) 0; - if (auditTrailLevel > 1) - AuthAudit(client, TRUE, - (struct sockaddr *) from, fromlen, - proto_n, auth_proto, auth_id); - } - - xfree ((char *) from); - } - - if (auth_id == (XID) ~0L) { -#ifdef LBX - /* - * Restore client's trans_conn state - */ - if (restore_trans_conn) { - priv->trans_conn = NULL; - } -#endif - if (reason) - return reason; - else - return "Client is not authorized to connect to Server"; - } - } - else if (auditTrailLevel > 1) - { - if (_XSERVTransGetPeerAddr (trans_conn, - &family, &fromlen, &from) != -1) - { - AuthAudit(client, TRUE, (struct sockaddr *) from, fromlen, - proto_n, auth_proto, auth_id); - - xfree ((char *) from); - } - } - priv->auth_id = auth_id; - priv->conn_time = 0; - -#ifdef XDMCP - /* indicate to Xdmcp protocol that we've opened new client */ - XdmcpOpenDisplay(priv->fd); -#endif /* XDMCP */ -#ifdef XAPPGROUP - if (ClientStateCallback) - XagCallClientStateChange (client); -#endif - /* At this point, if the client is authorized to change the access control - * list, we should getpeername() information, and add the client to - * the selfhosts list. It's not really the host machine, but the - * true purpose of the selfhosts list is to see who may change the - * access control list. - */ -#ifdef LBX - if (restore_trans_conn) { - priv->trans_conn = NULL; - } -#endif - return((char *)NULL); -} - -static ClientPtr -#ifdef LBX -AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time, - int (*Flush)( - ClientPtr /*who*/, OsCommPtr /*oc*/, - char * /*extraBuf*/, int /*extraCount*/), - void (*Close)( - ClientPtr /*client*/), - LbxProxyPtr proxy) -#else -AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) -#endif -{ - OsCommPtr oc; - ClientPtr client; - - if ( -#ifdef LBX - trans_conn && -#endif -#ifndef WIN32 - fd >= lastfdesc -#else - XFD_SETCOUNT(&AllClients) >= MaxClients -#endif - ) - return NullClient; - oc = (OsCommPtr)xalloc(sizeof(OsCommRec)); - if (!oc) - return NullClient; - oc->trans_conn = trans_conn; - oc->fd = fd; - oc->input = (ConnectionInputPtr)NULL; - oc->output = (ConnectionOutputPtr)NULL; - oc->auth_id = None; - oc->conn_time = conn_time; -#ifdef LBX - oc->proxy = proxy; - oc->Flush = Flush; - oc->Close = Close; - oc->largereq = (ConnectionInputPtr) NULL; -#endif - if (!(client = NextAvailableClient((pointer)oc))) - { - xfree (oc); - return NullClient; - } -#ifdef LBX - if (trans_conn) -#endif - { -#if !defined(WIN32) - ConnectionTranslation[fd] = client->index; -#else - SetConnectionTranslation(fd, client->index); -#endif - if (GrabInProgress) - { - FD_SET(fd, &SavedAllClients); - FD_SET(fd, &SavedAllSockets); - } - else - { - FD_SET(fd, &AllClients); - FD_SET(fd, &AllSockets); - } - } - -#ifdef DEBUG - ErrorF("AllocNewConnection: client index = %d, socket fd = %d\n", - client->index, fd); -#endif - - return client; -} - -#ifdef LBX - -int -ClientConnectionNumber (ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr) client->osPrivate; - - return oc->fd; -} - -ClientPtr -AllocLbxClientConnection (ClientPtr client, LbxProxyPtr proxy) -{ - OsCommPtr oc = (OsCommPtr) client->osPrivate; - - return AllocNewConnection ((XtransConnInfo)NULL, oc->fd, GetTimeInMillis(), - LbxFlushClient, LbxCloseClient, proxy); -} - -void -LbxProxyConnection (ClientPtr client, LbxProxyPtr proxy) -{ - OsCommPtr oc = (OsCommPtr) client->osPrivate; - - FlushClient(client, oc, (char *)NULL, 0); - oc->proxy = proxy; - oc->Flush = LbxFlushClient; - oc->Close = LbxCloseClient; - LbxPrimeInput(client, proxy); -} - -#endif - -/***************** - * EstablishNewConnections - * If anyone is waiting on listened sockets, accept them. - * Returns a mask with indices of new clients. Updates AllClients - * and AllSockets. - *****************/ - -/*ARGSUSED*/ -Bool -EstablishNewConnections(ClientPtr clientUnused, pointer closure) -{ - fd_set readyconnections; /* set of listeners that are ready */ - int curconn; /* fd of listener that's ready */ - register int newconn; /* fd of new client */ - CARD32 connect_time; - register int i; - register ClientPtr client; - register OsCommPtr oc; - fd_set tmask; - - XFD_ANDSET (&tmask, (fd_set*)closure, &WellKnownConnections); - XFD_COPYSET(&tmask, &readyconnections); - if (!XFD_ANYSET(&readyconnections)) - return TRUE; - connect_time = GetTimeInMillis(); - /* kill off stragglers */ - for (i=1; iosPrivate); - if ((oc && (oc->conn_time != 0) && - (connect_time - oc->conn_time) >= TimeOutValue) || - (client->noClientException != Success && !client->clientGone)) - CloseDownClient(client); - } - } -#ifndef WIN32 - for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) - { - while (readyconnections.fds_bits[i]) -#else - for (i = 0; i < XFD_SETCOUNT(&readyconnections); i++) -#endif - { - XtransConnInfo trans_conn, new_trans_conn; - int status; - -#ifndef WIN32 - curconn = ffs (readyconnections.fds_bits[i]) - 1; - readyconnections.fds_bits[i] &= ~((fd_mask)1 << curconn); - curconn += (i * (sizeof(fd_mask)*8)); -#else - curconn = XFD_FD(&readyconnections, i); -#endif - - if ((trans_conn = lookup_trans_conn (curconn)) == NULL) - continue; - - if ((new_trans_conn = _XSERVTransAccept (trans_conn, &status)) == NULL) - continue; - - newconn = _XSERVTransGetConnectionNumber (new_trans_conn); - - if (newconn < lastfdesc) - { - int clientid; -#if !defined(WIN32) - clientid = ConnectionTranslation[newconn]; -#else - clientid = GetConnectionTranslation(newconn); -#endif - if(clientid && (client = clients[clientid])) - CloseDownClient(client); - } - - _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); - - if (!AllocNewConnection (new_trans_conn, newconn, connect_time -#ifdef LBX - , StandardFlushClient, - CloseDownFileDescriptor, (LbxProxyPtr)NULL -#endif - )) - { - ErrorConnMax(new_trans_conn); - _XSERVTransClose(new_trans_conn); - } - } -#ifndef WIN32 - } -#endif - return TRUE; -} - -#define NOROOM "Maximum number of clients reached" - -/************ - * ErrorConnMax - * Fail a connection due to lack of client or file descriptor space - ************/ - -static void -ErrorConnMax(XtransConnInfo trans_conn) -{ - int fd = _XSERVTransGetConnectionNumber (trans_conn); - xConnSetupPrefix csp; - char pad[3]; - struct iovec iov[3]; - char byteOrder = 0; - int whichbyte = 1; - struct timeval waittime; - fd_set mask; - - /* if these seems like a lot of trouble to go to, it probably is */ - waittime.tv_sec = BOTIMEOUT / MILLI_PER_SECOND; - waittime.tv_usec = (BOTIMEOUT % MILLI_PER_SECOND) * - (1000000 / MILLI_PER_SECOND); - FD_ZERO(&mask); - FD_SET(fd, &mask); - (void)Select(fd + 1, &mask, NULL, NULL, &waittime); - /* try to read the byte-order of the connection */ - (void)_XSERVTransRead(trans_conn, &byteOrder, 1); - if ((byteOrder == 'l') || (byteOrder == 'B')) - { - csp.success = xFalse; - csp.lengthReason = sizeof(NOROOM) - 1; - csp.length = (sizeof(NOROOM) + 2) >> 2; - csp.majorVersion = X_PROTOCOL; - csp.minorVersion = X_PROTOCOL_REVISION; - if (((*(char *) &whichbyte) && (byteOrder == 'B')) || - (!(*(char *) &whichbyte) && (byteOrder == 'l'))) - { - swaps(&csp.majorVersion, whichbyte); - swaps(&csp.minorVersion, whichbyte); - swaps(&csp.length, whichbyte); - } - iov[0].iov_len = sz_xConnSetupPrefix; - iov[0].iov_base = (char *) &csp; - iov[1].iov_len = csp.lengthReason; - iov[1].iov_base = NOROOM; - iov[2].iov_len = (4 - (csp.lengthReason & 3)) & 3; - iov[2].iov_base = pad; - (void)_XSERVTransWritev(trans_conn, iov, 3); - } -} - -/************ - * CloseDownFileDescriptor: - * Remove this file descriptor and it's I/O buffers, etc. - ************/ - -#ifdef LBX -void -CloseDownFileDescriptor(ClientPtr client) -#else -static void -CloseDownFileDescriptor(OsCommPtr oc) -#endif -{ -#ifdef LBX - OsCommPtr oc = (OsCommPtr) client->osPrivate; -#endif - int connection = oc->fd; - - if (oc->trans_conn) { - _XSERVTransDisconnect(oc->trans_conn); - _XSERVTransClose(oc->trans_conn); - } -#ifndef LBX - FreeOsBuffers(oc); - xfree(oc); -#endif -#ifndef WIN32 - ConnectionTranslation[connection] = 0; -#else - SetConnectionTranslation(connection, 0); -#endif - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - FD_CLR(connection, &ClientsWithInput); - FD_CLR(connection, &GrabImperviousClients); - if (GrabInProgress) - { - FD_CLR(connection, &SavedAllSockets); - FD_CLR(connection, &SavedAllClients); - FD_CLR(connection, &SavedClientsWithInput); - } - FD_CLR(connection, &ClientsWriteBlocked); - if (!XFD_ANYSET(&ClientsWriteBlocked)) - AnyClientsWriteBlocked = FALSE; - FD_CLR(connection, &OutputPending); -} - -/***************** - * CheckConnections - * Some connection has died, go find which one and shut it down - * The file descriptor has been closed, but is still in AllClients. - * If would truly be wonderful if select() would put the bogus - * file descriptors in the exception mask, but nooooo. So we have - * to check each and every socket individually. - *****************/ - -void -CheckConnections(void) -{ -#ifndef WIN32 - fd_mask mask; -#endif - fd_set tmask; - int curclient, curoff; - int i; - struct timeval notime; - int r; -#ifdef WIN32 - fd_set savedAllClients; -#endif - - notime.tv_sec = 0; - notime.tv_usec = 0; - -#ifndef WIN32 - for (i=0; iosPrivate; - - if (oc->output && oc->output->count) - FlushClient(client, oc, (char *)NULL, 0); -#ifdef XDMCP - XdmcpCloseDisplay(oc->fd); -#endif -#ifndef LBX - CloseDownFileDescriptor(oc); -#else - (*oc->Close) (client); - FreeOsBuffers(oc); - xfree(oc); -#endif - client->osPrivate = (pointer)NULL; - if (auditTrailLevel > 1) - AuditF("client %d disconnected\n", client->index); -} - -void -AddEnabledDevice(int fd) -{ - FD_SET(fd, &EnabledDevices); - FD_SET(fd, &AllSockets); - if (GrabInProgress) - FD_SET(fd, &SavedAllSockets); -} - -void -RemoveEnabledDevice(int fd) -{ - FD_CLR(fd, &EnabledDevices); - FD_CLR(fd, &AllSockets); - if (GrabInProgress) - FD_CLR(fd, &SavedAllSockets); -} - -/***************** - * OnlyListenToOneClient: - * Only accept requests from one client. Continue to handle new - * connections, but don't take any protocol requests from the new - * ones. Note that if GrabInProgress is set, EstablishNewConnections - * needs to put new clients into SavedAllSockets and SavedAllClients. - * Note also that there is no timeout for this in the protocol. - * This routine is "undone" by ListenToAllClients() - *****************/ - -void -OnlyListenToOneClient(ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; - - if (! GrabInProgress) - { - XFD_COPYSET(&ClientsWithInput, &SavedClientsWithInput); - XFD_ANDSET(&ClientsWithInput, - &ClientsWithInput, &GrabImperviousClients); - if (FD_ISSET(connection, &SavedClientsWithInput)) - { - FD_CLR(connection, &SavedClientsWithInput); - FD_SET(connection, &ClientsWithInput); - } - XFD_UNSET(&SavedClientsWithInput, &GrabImperviousClients); - XFD_COPYSET(&AllSockets, &SavedAllSockets); - XFD_COPYSET(&AllClients, &SavedAllClients); - XFD_UNSET(&AllSockets, &AllClients); - XFD_ANDSET(&AllClients, &AllClients, &GrabImperviousClients); - FD_SET(connection, &AllClients); - XFD_ORSET(&AllSockets, &AllSockets, &AllClients); - GrabInProgress = client->index; - } -} - -/**************** - * ListenToAllClients: - * Undoes OnlyListentToOneClient() - ****************/ - -void -ListenToAllClients(void) -{ - if (GrabInProgress) - { - XFD_ORSET(&AllSockets, &AllSockets, &SavedAllSockets); - XFD_ORSET(&AllClients, &AllClients, &SavedAllClients); - XFD_ORSET(&ClientsWithInput, &ClientsWithInput, &SavedClientsWithInput); - GrabInProgress = 0; - } -} - -/**************** - * IgnoreClient - * Removes one client from input masks. - * Must have cooresponding call to AttendClient. - ****************/ - -void -IgnoreClient (ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; -#ifdef LBX - LbxClientPtr lbxClient = LbxClient(client); -#endif - - isItTimeToYield = TRUE; -#ifdef LBX - if (lbxClient) { - lbxClient->ignored = TRUE; - return; - } -#endif - if (!GrabInProgress || FD_ISSET(connection, &AllClients)) - { - if (FD_ISSET (connection, &ClientsWithInput)) - FD_SET(connection, &IgnoredClientsWithInput); - else - FD_CLR(connection, &IgnoredClientsWithInput); - FD_CLR(connection, &ClientsWithInput); - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - FD_CLR(connection, &LastSelectMask); - } - else - { - if (FD_ISSET (connection, &SavedClientsWithInput)) - FD_SET(connection, &IgnoredClientsWithInput); - else - FD_CLR(connection, &IgnoredClientsWithInput); - FD_CLR(connection, &SavedClientsWithInput); - FD_CLR(connection, &SavedAllSockets); - FD_CLR(connection, &SavedAllClients); - } -} - -/**************** - * AttendClient - * Adds one client back into the input masks. - ****************/ - -void -AttendClient (ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; -#ifdef LBX - LbxClientPtr lbxClient = LbxClient(client); - - if (lbxClient) { - lbxClient->ignored = FALSE; - return; - } -#endif - if (!GrabInProgress || GrabInProgress == client->index || - FD_ISSET(connection, &GrabImperviousClients)) - { - FD_SET(connection, &AllClients); - FD_SET(connection, &AllSockets); - FD_SET(connection, &LastSelectMask); - if (FD_ISSET (connection, &IgnoredClientsWithInput)) - FD_SET(connection, &ClientsWithInput); - } - else - { - FD_SET(connection, &SavedAllClients); - FD_SET(connection, &SavedAllSockets); - if (FD_ISSET(connection, &IgnoredClientsWithInput)) - FD_SET(connection, &SavedClientsWithInput); - } -} - -/* make client impervious to grabs; assume only executing client calls this */ - -void -MakeClientGrabImpervious(ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; - - FD_SET(connection, &GrabImperviousClients); - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = CLIENT_IMPERVIOUS; - CallCallbacks(&ServerGrabCallback, &grabinfo); - } -} - -/* make client pervious to grabs; assume only executing client calls this */ - -void -MakeClientGrabPervious(ClientPtr client) -{ - OsCommPtr oc = (OsCommPtr)client->osPrivate; - int connection = oc->fd; - - FD_CLR(connection, &GrabImperviousClients); - if (GrabInProgress && (GrabInProgress != client->index)) - { - if (FD_ISSET(connection, &ClientsWithInput)) - { - FD_SET(connection, &SavedClientsWithInput); - FD_CLR(connection, &ClientsWithInput); - } - FD_CLR(connection, &AllSockets); - FD_CLR(connection, &AllClients); - isItTimeToYield = TRUE; - } - - if (ServerGrabCallback) - { - ServerGrabInfoRec grabinfo; - grabinfo.client = client; - grabinfo.grabstate = CLIENT_PERVIOUS; - CallCallbacks(&ServerGrabCallback, &grabinfo); - } -} - diff --git a/nx-X11/programs/Xserver/os/log.c.NX.original b/nx-X11/programs/Xserver/os/log.c.NX.original deleted file mode 100644 index 04e24b8df..000000000 --- a/nx-X11/programs/Xserver/os/log.c.NX.original +++ /dev/null @@ -1,716 +0,0 @@ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, -Copyright 1994 Quarterdeck Office Systems. - - 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 names of Digital and -Quarterdeck not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT -OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE -OR PERFORMANCE OF THIS SOFTWARE. - -*/ - -/* - * Copyright (c) 1997-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* $XFree86: xc/programs/Xserver/os/log.c,v 1.6 2003/11/07 13:45:27 tsi Exp $ */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include /* for malloc() */ -#include - -#include "site.h" -#include "opaque.h" - -#ifdef WIN32 -#include -#define getpid(x) _getpid(x) -#endif - -#ifdef NX_TRANS_SOCKET - -#include "NX.h" - -#endif - -#ifdef DDXOSVERRORF -void (*OsVendorVErrorFProc)(const char *, va_list args) = NULL; -#ifdef NX_TRANS_EXIT -int OsVendorVErrorFFatal = 0; -#endif -#endif - -static FILE *logFile = NULL; -static Bool logFlush = FALSE; -static Bool logSync = FALSE; -static int logVerbosity = DEFAULT_LOG_VERBOSITY; -static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY; - -/* Buffer to information logged before the log file is opened. */ -static char *saveBuffer = NULL; -static int bufferSize = 0, bufferUnused = 0, bufferPos = 0; -static Bool needBuffer = TRUE; - -/* Prefix strings for log messages. */ -#ifndef X_UNKNOWN_STRING -#define X_UNKNOWN_STRING "(\?\?)" -#endif -#ifndef X_PROBE_STRING -#define X_PROBE_STRING "(--)" -#endif -#ifndef X_CONFIG_STRING -#define X_CONFIG_STRING "(**)" -#endif -#ifndef X_DEFAULT_STRING -#define X_DEFAULT_STRING "(==)" -#endif -#ifndef X_CMDLINE_STRING -#define X_CMDLINE_STRING "(++)" -#endif -#ifndef X_NOTICE_STRING -#define X_NOTICE_STRING "(!!)" -#endif -#ifndef X_ERROR_STRING -#define X_ERROR_STRING "(EE)" -#endif -#ifndef X_WARNING_STRING -#define X_WARNING_STRING "(WW)" -#endif -#ifndef X_INFO_STRING -#define X_INFO_STRING "(II)" -#endif -#ifndef X_NOT_IMPLEMENTED_STRING -#define X_NOT_IMPLEMENTED_STRING "(NI)" -#endif - -/* - * LogInit is called to start logging to a file. It is also called (with - * NULL arguments) when logging to a file is not wanted. It must always be - * called, otherwise log messages will continue to accumulate in a buffer. - * - * %s, if present in the fname or backup strings, is expanded to the display - * string. - */ - -const char * -LogInit(const char *fname, const char *backup) -{ - char *logFileName = NULL; - - if (fname && *fname) { - /* xalloc() can't be used yet. */ - logFileName = malloc(strlen(fname) + strlen(display) + 1); - if (!logFileName) - FatalError("Cannot allocate space for the log file name\n"); - sprintf(logFileName, fname, display); - - if (backup && *backup) { - struct stat buf; - - if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) { - char *suffix; - char *oldLog; - - oldLog = malloc(strlen(logFileName) + strlen(backup) + - strlen(display) + 1); - suffix = malloc(strlen(backup) + strlen(display) + 1); - if (!oldLog || !suffix) - FatalError("Cannot allocate space for the log file name\n"); - sprintf(suffix, backup, display); - sprintf(oldLog, "%s%s", logFileName, suffix); - free(suffix); -#ifdef __UNIXOS2__ - remove(oldLog); -#endif - if (rename(logFileName, oldLog) == -1) { - FatalError("Cannot move old log file (\"%s\" to \"%s\"\n", - logFileName, oldLog); - } - free(oldLog); - } - } - if ((logFile = fopen(logFileName, "w")) == NULL) - FatalError("Cannot open log file \"%s\"\n", logFileName); - setvbuf(logFile, NULL, _IONBF, 0); - - /* Flush saved log information. */ - if (saveBuffer && bufferSize > 0) { - fwrite(saveBuffer, bufferPos, 1, logFile); - fflush(logFile); -#ifndef WIN32 - fsync(fileno(logFile)); -#endif - } - } - - /* - * Unconditionally free the buffer, and flag that the buffer is no longer - * needed. - */ - if (saveBuffer && bufferSize > 0) { - free(saveBuffer); /* Must be free(), not xfree() */ - saveBuffer = NULL; - bufferSize = 0; - } - needBuffer = FALSE; - - return logFileName; -} - -void -LogClose() -{ - if (logFile) { - fclose(logFile); - logFile = NULL; - } -} - -Bool -LogSetParameter(LogParameter param, int value) -{ - switch (param) { - case XLOG_FLUSH: - logFlush = value ? TRUE : FALSE; - return TRUE; - case XLOG_SYNC: - logSync = value ? TRUE : FALSE; - return TRUE; - case XLOG_VERBOSITY: - logVerbosity = value; - return TRUE; - case XLOG_FILE_VERBOSITY: - logFileVerbosity = value; - return TRUE; - default: - return FALSE; - } -} - -/* This function does the actual log message writes. */ - -void -LogVWrite(int verb, const char *f, va_list args) -{ - static char tmpBuffer[1024]; - int len = 0; - - /* - * Since a va_list can only be processed once, write the string to a - * buffer, and then write the buffer out to the appropriate output - * stream(s). - */ - if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) { - vsnprintf(tmpBuffer, sizeof(tmpBuffer), f, args); -#ifdef NX_TRANS_EXIT - /* - * Beautify the message. Make the - * first letter uppercase. - */ - - *tmpBuffer = toupper(*tmpBuffer); - - /* - * Remove the trailing newline. - */ - - if (strlen(tmpBuffer) > 0 && - *(tmpBuffer + strlen(tmpBuffer) - 1) == '\n') { - *(tmpBuffer + strlen(tmpBuffer) - 1) = '\0'; - } - - /* - * Remove the trailing full-stop. - */ - - if (strlen(tmpBuffer) > 0 && - *(tmpBuffer + strlen(tmpBuffer) - 1) == '.') { - *(tmpBuffer + strlen(tmpBuffer) - 1) = '\0'; - } -#endif /* #ifdef NX_TRANS_EXIT */ - len = strlen(tmpBuffer); - } - if ((verb < 0 || logVerbosity >= verb) && len > 0) - fwrite(tmpBuffer, len, 1, stderr); - if ((verb < 0 || logFileVerbosity >= verb) && len > 0) { - if (logFile) { - fwrite(tmpBuffer, len, 1, logFile); - if (logFlush) { - fflush(logFile); -#ifndef WIN32 - if (logSync) - fsync(fileno(logFile)); -#endif - } - } else if (needBuffer) { - /* - * Note, this code is used before OsInit() has been called, so - * xalloc() and friends can't be used. - */ - if (len > bufferUnused) { - bufferSize += 1024; - bufferUnused += 1024; - if (saveBuffer) - saveBuffer = realloc(saveBuffer, bufferSize); - else - saveBuffer = malloc(bufferSize); - if (!saveBuffer) - FatalError("realloc() failed while saving log messages\n"); - } - bufferUnused -= len; - memcpy(saveBuffer + bufferPos, tmpBuffer, len); - bufferPos += len; - } - } -} - -void -LogWrite(int verb, const char *f, ...) -{ - va_list args; - - va_start(args, f); - LogVWrite(verb, f, args); - va_end(args); -} - -void -LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) -{ - const char *s = X_UNKNOWN_STRING; - char *tmpBuf = NULL; - - /* Ignore verbosity for X_ERROR */ - if (logVerbosity >= verb || logFileVerbosity >= verb || type == X_ERROR) { - switch (type) { - case X_PROBED: - s = X_PROBE_STRING; - break; - case X_CONFIG: - s = X_CONFIG_STRING; - break; - case X_DEFAULT: - s = X_DEFAULT_STRING; - break; - case X_CMDLINE: - s = X_CMDLINE_STRING; - break; - case X_NOTICE: - s = X_NOTICE_STRING; - break; - case X_ERROR: - s = X_ERROR_STRING; - if (verb > 0) - verb = 0; - break; - case X_WARNING: - s = X_WARNING_STRING; - break; - case X_INFO: - s = X_INFO_STRING; - break; - case X_NOT_IMPLEMENTED: - s = X_NOT_IMPLEMENTED_STRING; - break; - case X_UNKNOWN: - s = X_UNKNOWN_STRING; - break; - case X_NONE: - s = NULL; - break; - } - - /* - * Prefix the format string with the message type. We do it this way - * so that LogVWrite() is only called once per message. - */ - if (s) { - tmpBuf = malloc(strlen(format) + strlen(s) + 1 + 1); - /* Silently return if malloc fails here. */ - if (!tmpBuf) - return; - sprintf(tmpBuf, "%s ", s); - strcat(tmpBuf, format); - LogVWrite(verb, tmpBuf, args); - free(tmpBuf); - } else - LogVWrite(verb, format, args); - } -} - -/* Log message with verbosity level specified. */ -void -LogMessageVerb(MessageType type, int verb, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, verb, format, ap); - va_end(ap); -} - -/* Log a message with the standard verbosity level of 1. */ -void -LogMessage(MessageType type, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, 1, format, ap); - va_end(ap); -} - -#ifdef __GNUC__ -void AbortServer(void) __attribute__((noreturn)); -#endif - -void -AbortServer(void) -{ -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "AbortServer: Going to abort the current server.\n"); -#endif - OsCleanup(TRUE); - AbortDDX(); - fflush(stderr); - if (CoreDump) - abort(); -#ifdef NX_TRANS_EXIT -#ifdef NX_TRANS_TEST - fprintf(stderr, "AbortServer: Going to clean up NX resources and exit.\n"); -#endif - NXTransExit(1); -#else /* #ifdef NX_TRANS_EXIT */ - exit (1); -#endif -} - -#ifndef AUDIT_PREFIX -#define AUDIT_PREFIX "AUDIT: %s: %ld %s: " -#endif -#ifndef AUDIT_TIMEOUT -#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */ -#endif - -static int nrepeat = 0; -static int oldlen = -1; -static OsTimerPtr auditTimer = NULL; - -void -FreeAuditTimer(void) -{ - if (auditTimer != NULL) { - /* Force output of pending messages */ - TimerForce(auditTimer); - TimerFree(auditTimer); - auditTimer = NULL; - } -} - -static char * -AuditPrefix(void) -{ - time_t tm; - char *autime, *s; - char *tmpBuf; - int len; - - time(&tm); - autime = ctime(&tm); - if ((s = strchr(autime, '\n'))) - *s = '\0'; - if ((s = strrchr(argvGlobal[0], '/'))) - s++; - else - s = argvGlobal[0]; - len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + strlen(s) + 1; - tmpBuf = malloc(len); - if (!tmpBuf) - return NULL; - snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid(), s); - return tmpBuf; -} - -void -AuditF(const char * f, ...) -{ - va_list args; - - va_start(args, f); - - VAuditF(f, args); - va_end(args); -} - -static CARD32 -AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg) -{ - char *prefix; - - if (nrepeat > 0) { - prefix = AuditPrefix(); - ErrorF("%slast message repeated %d times\n", - prefix != NULL ? prefix : "", nrepeat); - nrepeat = 0; - if (prefix != NULL) - free(prefix); - return AUDIT_TIMEOUT; - } else { - /* if the timer expires without anything to print, flush the message */ - oldlen = -1; - return 0; - } -} - -void -VAuditF(const char *f, va_list args) -{ - char *prefix; - char buf[1024]; - int len; - static char oldbuf[1024]; - - prefix = AuditPrefix(); - len = vsnprintf(buf, sizeof(buf), f, args); - -#if 1 - /* XXX Compressing duplicated messages is temporarily disabled to - * work around bugzilla 964: - * https://freedesktop.org/bugzilla/show_bug.cgi?id=964 - */ - ErrorF("%s%s", prefix != NULL ? prefix : "", buf); - oldlen = -1; - nrepeat = 0; -#else - if (len == oldlen && strcmp(buf, oldbuf) == 0) { - /* Message already seen */ - nrepeat++; - } else { - /* new message */ - if (auditTimer != NULL) - TimerForce(auditTimer); - ErrorF("%s%s", prefix != NULL ? prefix : "", buf); - strlcpy(oldbuf, buf, sizeof(oldbuf)); - oldlen = len; - nrepeat = 0; - auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); - } -#endif - if (prefix != NULL) - free(prefix); -} - -void -FatalError(const char *f, ...) -{ - va_list args; - static Bool beenhere = FALSE; - -#ifdef NX_TRANS_EXIT - if (beenhere) { - fprintf(stderr, "Error: Aborting session with fatal error function reentered.\n"); - } - else { - /* - * Tell to the log function that this - * is a fatal error. - */ - - OsVendorVErrorFFatal = 1; - - fprintf(stderr, "Error: Aborting session with '"); - - va_start(args, f); - VErrorF(f, args); - va_end(args); - - fprintf(stderr, "'.\n"); - } -#else /* #ifdef NX_TRANS_EXIT */ - if (beenhere) - ErrorF("\nFatalError re-entered, aborting\n"); - else - ErrorF("\nFatal server error:\n"); - - va_start(args, f); - VErrorF(f, args); - va_end(args); - ErrorF("\n"); -#endif /* #ifdef NX_TRANS_EXIT */ -#ifdef DDXOSFATALERROR - if (!beenhere) - OsVendorFatalError(); -#endif -#ifdef ABORTONFATALERROR - abort(); -#endif - if (!beenhere) { - beenhere = TRUE; - AbortServer(); - } else - abort(); - /*NOTREACHED*/ -} - -void -VErrorF(const char *f, va_list args) -{ -#ifdef DDXOSVERRORF - if (OsVendorVErrorFProc) - OsVendorVErrorFProc(f, args); - else - LogVWrite(-1, f, args); -#else - LogVWrite(-1, f, args); -#endif -} - -void -ErrorF(const char * f, ...) -{ - va_list args; - - va_start(args, f); - VErrorF(f, args); - va_end(args); -} - -/* A perror() workalike. */ - -#ifndef NEED_STRERROR -#ifdef SYSV -#if !defined(ISC) || defined(ISC202) || defined(ISC22) -#define NEED_STRERROR -#endif -#endif -#endif - -#if defined(NEED_STRERROR) && !defined(strerror) -extern char *sys_errlist[]; -extern int sys_nerr; -#define strerror(n) \ - ((n) >= 0 && (n) < sys_nerr) ? sys_errlist[(n)] : "unknown error" -#endif - -void -Error(char *str) -{ - char *err = NULL; - int saveErrno = errno; - - if (str) { - err = malloc(strlen(strerror(saveErrno)) + strlen(str) + 2 + 1); - if (!err) - return; - sprintf(err, "%s: ", str); - strcat(err, strerror(saveErrno)); - LogWrite(-1, err); - } else - LogWrite(-1, strerror(saveErrno)); -} - -void -LogPrintMarkers() -{ - /* Show what the message marker symbols mean. */ - ErrorF("Markers: "); - LogMessageVerb(X_PROBED, -1, "probed, "); - LogMessageVerb(X_CONFIG, -1, "from config file, "); - LogMessageVerb(X_DEFAULT, -1, "default setting,\n\t"); - LogMessageVerb(X_CMDLINE, -1, "from command line, "); - LogMessageVerb(X_NOTICE, -1, "notice, "); - LogMessageVerb(X_INFO, -1, "informational,\n\t"); - LogMessageVerb(X_WARNING, -1, "warning, "); - LogMessageVerb(X_ERROR, -1, "error, "); - LogMessageVerb(X_NOT_IMPLEMENTED, -1, "not implemented, "); - LogMessageVerb(X_UNKNOWN, -1, "unknown.\n"); -} - diff --git a/nx-X11/programs/Xserver/os/log.c.X.original b/nx-X11/programs/Xserver/os/log.c.X.original deleted file mode 100644 index 4bebbe784..000000000 --- a/nx-X11/programs/Xserver/os/log.c.X.original +++ /dev/null @@ -1,633 +0,0 @@ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, -Copyright 1994 Quarterdeck Office Systems. - - 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 names of Digital and -Quarterdeck not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT -OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE -OR PERFORMANCE OF THIS SOFTWARE. - -*/ - -/* - * Copyright (c) 1997-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* $XFree86: xc/programs/Xserver/os/log.c,v 1.6 2003/11/07 13:45:27 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include /* for malloc() */ -#include - -#include "site.h" -#include "opaque.h" - -#ifdef WIN32 -#include -#define getpid(x) _getpid(x) -#endif - - -#ifdef DDXOSVERRORF -void (*OsVendorVErrorFProc)(const char *, va_list args) = NULL; -#endif - -static FILE *logFile = NULL; -static Bool logFlush = FALSE; -static Bool logSync = FALSE; -static int logVerbosity = DEFAULT_LOG_VERBOSITY; -static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY; - -/* Buffer to information logged before the log file is opened. */ -static char *saveBuffer = NULL; -static int bufferSize = 0, bufferUnused = 0, bufferPos = 0; -static Bool needBuffer = TRUE; - -/* Prefix strings for log messages. */ -#ifndef X_UNKNOWN_STRING -#define X_UNKNOWN_STRING "(\?\?)" -#endif -#ifndef X_PROBE_STRING -#define X_PROBE_STRING "(--)" -#endif -#ifndef X_CONFIG_STRING -#define X_CONFIG_STRING "(**)" -#endif -#ifndef X_DEFAULT_STRING -#define X_DEFAULT_STRING "(==)" -#endif -#ifndef X_CMDLINE_STRING -#define X_CMDLINE_STRING "(++)" -#endif -#ifndef X_NOTICE_STRING -#define X_NOTICE_STRING "(!!)" -#endif -#ifndef X_ERROR_STRING -#define X_ERROR_STRING "(EE)" -#endif -#ifndef X_WARNING_STRING -#define X_WARNING_STRING "(WW)" -#endif -#ifndef X_INFO_STRING -#define X_INFO_STRING "(II)" -#endif -#ifndef X_NOT_IMPLEMENTED_STRING -#define X_NOT_IMPLEMENTED_STRING "(NI)" -#endif - -/* - * LogInit is called to start logging to a file. It is also called (with - * NULL arguments) when logging to a file is not wanted. It must always be - * called, otherwise log messages will continue to accumulate in a buffer. - * - * %s, if present in the fname or backup strings, is expanded to the display - * string. - */ - -const char * -LogInit(const char *fname, const char *backup) -{ - char *logFileName = NULL; - - if (fname && *fname) { - /* xalloc() can't be used yet. */ - logFileName = malloc(strlen(fname) + strlen(display) + 1); - if (!logFileName) - FatalError("Cannot allocate space for the log file name\n"); - sprintf(logFileName, fname, display); - - if (backup && *backup) { - struct stat buf; - - if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) { - char *suffix; - char *oldLog; - - oldLog = malloc(strlen(logFileName) + strlen(backup) + - strlen(display) + 1); - suffix = malloc(strlen(backup) + strlen(display) + 1); - if (!oldLog || !suffix) - FatalError("Cannot allocate space for the log file name\n"); - sprintf(suffix, backup, display); - sprintf(oldLog, "%s%s", logFileName, suffix); - free(suffix); -#ifdef __UNIXOS2__ - remove(oldLog); -#endif - if (rename(logFileName, oldLog) == -1) { - FatalError("Cannot move old log file (\"%s\" to \"%s\"\n", - logFileName, oldLog); - } - free(oldLog); - } - } - if ((logFile = fopen(logFileName, "w")) == NULL) - FatalError("Cannot open log file \"%s\"\n", logFileName); - setvbuf(logFile, NULL, _IONBF, 0); - - /* Flush saved log information. */ - if (saveBuffer && bufferSize > 0) { - fwrite(saveBuffer, bufferPos, 1, logFile); - fflush(logFile); -#ifndef WIN32 - fsync(fileno(logFile)); -#endif - } - } - - /* - * Unconditionally free the buffer, and flag that the buffer is no longer - * needed. - */ - if (saveBuffer && bufferSize > 0) { - free(saveBuffer); /* Must be free(), not xfree() */ - saveBuffer = NULL; - bufferSize = 0; - } - needBuffer = FALSE; - - return logFileName; -} - -void -LogClose() -{ - if (logFile) { - fclose(logFile); - logFile = NULL; - } -} - -Bool -LogSetParameter(LogParameter param, int value) -{ - switch (param) { - case XLOG_FLUSH: - logFlush = value ? TRUE : FALSE; - return TRUE; - case XLOG_SYNC: - logSync = value ? TRUE : FALSE; - return TRUE; - case XLOG_VERBOSITY: - logVerbosity = value; - return TRUE; - case XLOG_FILE_VERBOSITY: - logFileVerbosity = value; - return TRUE; - default: - return FALSE; - } -} - -/* This function does the actual log message writes. */ - -void -LogVWrite(int verb, const char *f, va_list args) -{ - static char tmpBuffer[1024]; - int len = 0; - - /* - * Since a va_list can only be processed once, write the string to a - * buffer, and then write the buffer out to the appropriate output - * stream(s). - */ - if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) { - vsnprintf(tmpBuffer, sizeof(tmpBuffer), f, args); - len = strlen(tmpBuffer); - } - if ((verb < 0 || logVerbosity >= verb) && len > 0) - fwrite(tmpBuffer, len, 1, stderr); - if ((verb < 0 || logFileVerbosity >= verb) && len > 0) { - if (logFile) { - fwrite(tmpBuffer, len, 1, logFile); - if (logFlush) { - fflush(logFile); -#ifndef WIN32 - if (logSync) - fsync(fileno(logFile)); -#endif - } - } else if (needBuffer) { - /* - * Note, this code is used before OsInit() has been called, so - * xalloc() and friends can't be used. - */ - if (len > bufferUnused) { - bufferSize += 1024; - bufferUnused += 1024; - if (saveBuffer) - saveBuffer = realloc(saveBuffer, bufferSize); - else - saveBuffer = malloc(bufferSize); - if (!saveBuffer) - FatalError("realloc() failed while saving log messages\n"); - } - bufferUnused -= len; - memcpy(saveBuffer + bufferPos, tmpBuffer, len); - bufferPos += len; - } - } -} - -void -LogWrite(int verb, const char *f, ...) -{ - va_list args; - - va_start(args, f); - LogVWrite(verb, f, args); - va_end(args); -} - -void -LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) -{ - const char *s = X_UNKNOWN_STRING; - char *tmpBuf = NULL; - - /* Ignore verbosity for X_ERROR */ - if (logVerbosity >= verb || logFileVerbosity >= verb || type == X_ERROR) { - switch (type) { - case X_PROBED: - s = X_PROBE_STRING; - break; - case X_CONFIG: - s = X_CONFIG_STRING; - break; - case X_DEFAULT: - s = X_DEFAULT_STRING; - break; - case X_CMDLINE: - s = X_CMDLINE_STRING; - break; - case X_NOTICE: - s = X_NOTICE_STRING; - break; - case X_ERROR: - s = X_ERROR_STRING; - if (verb > 0) - verb = 0; - break; - case X_WARNING: - s = X_WARNING_STRING; - break; - case X_INFO: - s = X_INFO_STRING; - break; - case X_NOT_IMPLEMENTED: - s = X_NOT_IMPLEMENTED_STRING; - break; - case X_UNKNOWN: - s = X_UNKNOWN_STRING; - break; - case X_NONE: - s = NULL; - break; - } - - /* - * Prefix the format string with the message type. We do it this way - * so that LogVWrite() is only called once per message. - */ - if (s) { - tmpBuf = malloc(strlen(format) + strlen(s) + 1 + 1); - /* Silently return if malloc fails here. */ - if (!tmpBuf) - return; - sprintf(tmpBuf, "%s ", s); - strcat(tmpBuf, format); - LogVWrite(verb, tmpBuf, args); - free(tmpBuf); - } else - LogVWrite(verb, format, args); - } -} - -/* Log message with verbosity level specified. */ -void -LogMessageVerb(MessageType type, int verb, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, verb, format, ap); - va_end(ap); -} - -/* Log a message with the standard verbosity level of 1. */ -void -LogMessage(MessageType type, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, 1, format, ap); - va_end(ap); -} - -#ifdef __GNUC__ -void AbortServer(void) __attribute__((noreturn)); -#endif - -void -AbortServer(void) -{ - OsCleanup(TRUE); - AbortDDX(); - fflush(stderr); - if (CoreDump) - abort(); - exit (1); -} - -#ifndef AUDIT_PREFIX -#define AUDIT_PREFIX "AUDIT: %s: %ld %s: " -#endif -#ifndef AUDIT_TIMEOUT -#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */ -#endif - -static int nrepeat = 0; -static int oldlen = -1; -static OsTimerPtr auditTimer = NULL; - -void -FreeAuditTimer(void) -{ - if (auditTimer != NULL) { - /* Force output of pending messages */ - TimerForce(auditTimer); - TimerFree(auditTimer); - auditTimer = NULL; - } -} - -static char * -AuditPrefix(void) -{ - time_t tm; - char *autime, *s; - char *tmpBuf; - int len; - - time(&tm); - autime = ctime(&tm); - if ((s = strchr(autime, '\n'))) - *s = '\0'; - if ((s = strrchr(argvGlobal[0], '/'))) - s++; - else - s = argvGlobal[0]; - len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + strlen(s) + 1; - tmpBuf = malloc(len); - if (!tmpBuf) - return NULL; - snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid(), s); - return tmpBuf; -} - -void -AuditF(const char * f, ...) -{ - va_list args; - - va_start(args, f); - - VAuditF(f, args); - va_end(args); -} - -static CARD32 -AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg) -{ - char *prefix; - - if (nrepeat > 0) { - prefix = AuditPrefix(); - ErrorF("%slast message repeated %d times\n", - prefix != NULL ? prefix : "", nrepeat); - nrepeat = 0; - if (prefix != NULL) - free(prefix); - return AUDIT_TIMEOUT; - } else { - /* if the timer expires without anything to print, flush the message */ - oldlen = -1; - return 0; - } -} - -void -VAuditF(const char *f, va_list args) -{ - char *prefix; - char buf[1024]; - int len; - static char oldbuf[1024]; - - prefix = AuditPrefix(); - len = vsnprintf(buf, sizeof(buf), f, args); - -#if 1 - /* XXX Compressing duplicated messages is temporarily disabled to - * work around bugzilla 964: - * https://freedesktop.org/bugzilla/show_bug.cgi?id=964 - */ - ErrorF("%s%s", prefix != NULL ? prefix : "", buf); - oldlen = -1; - nrepeat = 0; -#else - if (len == oldlen && strcmp(buf, oldbuf) == 0) { - /* Message already seen */ - nrepeat++; - } else { - /* new message */ - if (auditTimer != NULL) - TimerForce(auditTimer); - ErrorF("%s%s", prefix != NULL ? prefix : "", buf); - strlcpy(oldbuf, buf, sizeof(oldbuf)); - oldlen = len; - nrepeat = 0; - auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); - } -#endif - if (prefix != NULL) - free(prefix); -} - -void -FatalError(const char *f, ...) -{ - va_list args; - static Bool beenhere = FALSE; - - if (beenhere) - ErrorF("\nFatalError re-entered, aborting\n"); - else - ErrorF("\nFatal server error:\n"); - - va_start(args, f); - VErrorF(f, args); - va_end(args); - ErrorF("\n"); -#ifdef DDXOSFATALERROR - if (!beenhere) - OsVendorFatalError(); -#endif -#ifdef ABORTONFATALERROR - abort(); -#endif - if (!beenhere) { - beenhere = TRUE; - AbortServer(); - } else - abort(); - /*NOTREACHED*/ -} - -void -VErrorF(const char *f, va_list args) -{ -#ifdef DDXOSVERRORF - if (OsVendorVErrorFProc) - OsVendorVErrorFProc(f, args); - else - LogVWrite(-1, f, args); -#else - LogVWrite(-1, f, args); -#endif -} - -void -ErrorF(const char * f, ...) -{ - va_list args; - - va_start(args, f); - VErrorF(f, args); - va_end(args); -} - -/* A perror() workalike. */ - -#ifndef NEED_STRERROR -#ifdef SYSV -#if !defined(ISC) || defined(ISC202) || defined(ISC22) -#define NEED_STRERROR -#endif -#endif -#endif - -#if defined(NEED_STRERROR) && !defined(strerror) -extern char *sys_errlist[]; -extern int sys_nerr; -#define strerror(n) \ - ((n) >= 0 && (n) < sys_nerr) ? sys_errlist[(n)] : "unknown error" -#endif - -void -Error(char *str) -{ - char *err = NULL; - int saveErrno = errno; - - if (str) { - err = malloc(strlen(strerror(saveErrno)) + strlen(str) + 2 + 1); - if (!err) - return; - sprintf(err, "%s: ", str); - strcat(err, strerror(saveErrno)); - LogWrite(-1, err); - } else - LogWrite(-1, strerror(saveErrno)); -} - -void -LogPrintMarkers() -{ - /* Show what the message marker symbols mean. */ - ErrorF("Markers: "); - LogMessageVerb(X_PROBED, -1, "probed, "); - LogMessageVerb(X_CONFIG, -1, "from config file, "); - LogMessageVerb(X_DEFAULT, -1, "default setting,\n\t"); - LogMessageVerb(X_CMDLINE, -1, "from command line, "); - LogMessageVerb(X_NOTICE, -1, "notice, "); - LogMessageVerb(X_INFO, -1, "informational,\n\t"); - LogMessageVerb(X_WARNING, -1, "warning, "); - LogMessageVerb(X_ERROR, -1, "error, "); - LogMessageVerb(X_NOT_IMPLEMENTED, -1, "not implemented, "); - LogMessageVerb(X_UNKNOWN, -1, "unknown.\n"); -} - diff --git a/nx-X11/programs/Xserver/os/oscolor.c.NX.original b/nx-X11/programs/Xserver/os/oscolor.c.NX.original deleted file mode 100644 index cf79857f4..000000000 --- a/nx-X11/programs/Xserver/os/oscolor.c.NX.original +++ /dev/null @@ -1,483 +0,0 @@ -/* $XFree86: xc/programs/Xserver/os/oscolor.c,v 3.10 2003/07/16 01:39:03 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: oscolor.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */ - -#ifdef NX_TRANS_SOCKET - -#include -#include -#include - -static char* nxAltRgbPaths[] = {"/usr/NX/share/rgb", "/usr/share/X11/rgb", "/etc/X11/rgb"}; -static char _NXRgbPath[1024]; - -#endif - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef USE_RGB_TXT - -#ifdef NDBM -#include -#else -#ifdef SVR4 -#include -#else -#include -#endif -#endif -#include "rgb.h" -#include "os.h" -#include "opaque.h" - -/* Note that we are assuming there is only one database for all the screens. */ - -#ifdef NDBM -DBM *rgb_dbm = (DBM *)NULL; -#else -int rgb_dbm = 0; -#endif - -extern void CopyISOLatin1Lowered( - unsigned char * /*dest*/, - unsigned char * /*source*/, - int /*length*/); - -int -OsInitColors(void) -{ - if (!rgb_dbm) - { -#ifdef NDBM - rgb_dbm = dbm_open(rgbPath, 0, 0); -#else - if (dbminit(rgbPath) == 0) - rgb_dbm = 1; -#endif - if (!rgb_dbm) { - ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); - return FALSE; - } - } - return TRUE; -} - -/*ARGSUSED*/ -int -OsLookupColor(int screen, char *name, unsigned int len, - unsigned short *pred, unsigned short *pgreen, unsigned short *pblue) -{ - datum dbent; - RGB rgb; - char buf[64]; - char *lowername; - - if(!rgb_dbm) - return(0); - - /* we use xalloc here so that we can compile with cc without alloca - * when otherwise using gcc */ - if (len < sizeof(buf)) - lowername = buf; - else if (!(lowername = (char *)xalloc(len + 1))) - return(0); - CopyISOLatin1Lowered ((unsigned char *) lowername, (unsigned char *) name, - (int)len); - - dbent.dptr = lowername; - dbent.dsize = len; -#ifdef NDBM - dbent = dbm_fetch(rgb_dbm, dbent); -#else - dbent = fetch (dbent); -#endif - - if (len >= sizeof(buf)) - xfree(lowername); - - if(dbent.dptr) - { - memmove((char *) &rgb, dbent.dptr, sizeof (RGB)); - *pred = rgb.red; - *pgreen = rgb.green; - *pblue = rgb.blue; - return (1); - } - return(0); -} - -#else /* USE_RGB_TXT */ - - -/* - * The dbm routines are a porting hassle. This implementation will do - * the same thing by reading the rgb.txt file directly, which is much - * more portable. - */ - -#include -#include "os.h" -#include "opaque.h" - -#define HASHSIZE 511 - -typedef struct _dbEntry * dbEntryPtr; -typedef struct _dbEntry { - dbEntryPtr link; - unsigned short red; - unsigned short green; - unsigned short blue; - char name[1]; /* some compilers complain if [0] */ -} dbEntry; - - -extern void CopyISOLatin1Lowered( - unsigned char * /*dest*/, - unsigned char * /*source*/, - int /*length*/); - -static dbEntryPtr hashTab[HASHSIZE]; - -#ifdef NX_TRANS_SOCKET - -static int NXVerifyRgbPath(char *path) -{ - int size; - char *rgbPath; - struct stat rgbFileStat; - - /* - * Check if rgb file is present. - */ - - size = strlen(path) + strlen(".txt") + 1; - - rgbPath = (char *) ALLOCATE_LOCAL(size + 1); - - strcpy(rgbPath, path); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: Looking for [%s] file.\n", - rgbPath); - #endif - - if (stat(rgbPath, &rgbFileStat) != 0) - { - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: Can't find the rgb file [%s].\n", - rgbPath); - #endif - - strcat(rgbPath, ".txt"); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: Looking for [%s] file.\n", - rgbPath); - #endif - - if (stat(rgbPath, &rgbFileStat) != 0) - { - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: Can't find the rgb file [%s].\n", - rgbPath); - #endif - - DEALLOCATE_LOCAL(rgbPath); - - return 0; - } - } - - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyRgbPath: rgb path [%s] is valid.\n", - path); - #endif - - DEALLOCATE_LOCAL(rgbPath); - - return 1; -} - -static const char *_NXGetRgbPath(const char *path) -{ - const char *systemEnv; - char rgbPath[1024]; - int numAltRgbPaths; - int i; - - /* - * Check the environment only once. - */ - - if (*_NXRgbPath != '\0') - { - return _NXRgbPath; - } - - systemEnv = getenv("NX_SYSTEM"); - - if (systemEnv != NULL && *systemEnv != '\0') - { - if (strlen(systemEnv) + strlen("/share/rgb") + 1 > 1024) - { - - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: WARNING! Maximum length of rgb file path exceeded.\n"); - #endif - - goto _NXGetRgbPathError; - } - - strcpy(rgbPath, systemEnv); - strcat(rgbPath, "/share/rgb"); - - if (NXVerifyRgbPath(rgbPath) == 1) - { - strcpy(_NXRgbPath, systemEnv); - strcat(_NXRgbPath, "/share/rgb"); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: Using rgb file path [%s].\n", - _NXRgbPath); - #endif - - return _NXRgbPath; - } - } - - numAltRgbPaths = sizeof(nxAltRgbPaths) / sizeof(*nxAltRgbPaths); - - for (i = 0; i < numAltRgbPaths; i++) - { - if (NXVerifyRgbPath(nxAltRgbPaths[i]) == 1) - { - if (strlen(nxAltRgbPaths[i]) + 1 > 1024) - { - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: WARNING! Maximum length of rgb file path exceeded.\n"); - #endif - - goto _NXGetRgbPathError; - } - - strcpy(_NXRgbPath, nxAltRgbPaths[i]); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: Using rgb file path [%s].\n", - _NXRgbPath); - #endif - - return _NXRgbPath; - } - } - -_NXGetRgbPathError: - - strcpy(_NXRgbPath, path); - - #ifdef NX_TRANS_TEST - fprintf(stderr, "_NXGetRgbPath: Using default rgb file path [%s].\n", - _NXRgbPath); - #endif - - return _NXRgbPath; -} - -#endif - -static dbEntryPtr -lookup(char *name, int len, Bool create) -{ - unsigned int h = 0, g; - dbEntryPtr entry, *prev = NULL; - char *str = name; - - if (!(name = (char*)ALLOCATE_LOCAL(len +1))) return NULL; - CopyISOLatin1Lowered((unsigned char *)name, (unsigned char *)str, len); - name[len] = '\0'; - - for(str = name; *str; str++) { - h = (h << 4) + *str; - if ((g = h) & 0xf0000000) h ^= (g >> 24); - h &= g; - } - h %= HASHSIZE; - - if ( (entry = hashTab[h]) ) - { - for( ; entry; prev = (dbEntryPtr*)entry, entry = entry->link ) - if (! strcmp(name, entry->name) ) break; - } - else - prev = &(hashTab[h]); - - if (!entry && create && (entry = (dbEntryPtr)xalloc(sizeof(dbEntry) +len))) - { - *prev = entry; - entry->link = NULL; - strcpy( entry->name, name ); - } - - DEALLOCATE_LOCAL(name); - - return entry; -} - - -Bool -OsInitColors(void) -{ - FILE *rgb; - char *path; - char line[BUFSIZ]; - char name[BUFSIZ]; - int red, green, blue, lineno = 0; - dbEntryPtr entry; - - static Bool was_here = FALSE; - - if (!was_here) - { -#ifndef __UNIXOS2__ -#ifdef NX_TRANS_SOCKET - /* - * Add the trailing '.txt' if a - * 'rgb' file is not found. - */ - - struct stat statbuf; - - path = (char*)ALLOCATE_LOCAL(strlen(_NXGetRgbPath(rgbPath)) + 5); - strcpy(path, _NXGetRgbPath(rgbPath)); - - if (stat(path, &statbuf) != 0) - { - strcat(path, ".txt"); - } -#else - path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5); - strcpy(path, rgbPath); - strcat(path, ".txt"); -#endif -#else - char *tmp = (char*)__XOS2RedirRoot(rgbPath); - path = (char*)ALLOCATE_LOCAL(strlen(tmp) +5); - strcpy(path, tmp); - strcat(path, ".txt"); -#endif - if (!(rgb = fopen(path, "r"))) - { -#ifdef NX_TRANS_SOCKET - ErrorF( "Couldn't open RGB_DB '%s'\n", _NXGetRgbPath(rgbPath)); -#else - ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); -#endif - DEALLOCATE_LOCAL(path); - return FALSE; - } - - while(fgets(line, sizeof(line), rgb)) - { - lineno++; -#ifndef __UNIXOS2__ - if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) -#else - if (sscanf(line,"%d %d %d %[^\n\r]\n", &red, &green, &blue, name) == 4) -#endif - { - if (red >= 0 && red <= 0xff && - green >= 0 && green <= 0xff && - blue >= 0 && blue <= 0xff) - { - if ((entry = lookup(name, strlen(name), TRUE))) - { - entry->red = (red * 65535) / 255; - entry->green = (green * 65535) / 255; - entry->blue = (blue * 65535) / 255; - } - } - else - ErrorF("Value out of range: %s:%d\n", path, lineno); - } - else if (*line && *line != '#' && *line != '!') - ErrorF("Syntax Error: %s:%d\n", path, lineno); - } - - fclose(rgb); - DEALLOCATE_LOCAL(path); - - was_here = TRUE; - } - - return TRUE; -} - - - -Bool -OsLookupColor(int screen, char *name, unsigned int len, - unsigned short *pred, unsigned short *pgreen, unsigned short *pblue) -{ - dbEntryPtr entry; - - if ((entry = lookup(name, len, FALSE))) - { - *pred = entry->red; - *pgreen = entry->green; - *pblue = entry->blue; - return TRUE; - } - - return FALSE; -} - -#endif /* USE_RGB_TXT */ diff --git a/nx-X11/programs/Xserver/os/oscolor.c.X.original b/nx-X11/programs/Xserver/os/oscolor.c.X.original deleted file mode 100644 index fdbde7906..000000000 --- a/nx-X11/programs/Xserver/os/oscolor.c.X.original +++ /dev/null @@ -1,303 +0,0 @@ -/* $XFree86: xc/programs/Xserver/os/oscolor.c,v 3.10 2003/07/16 01:39:03 dawes Exp $ */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $Xorg: oscolor.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef USE_RGB_TXT - -#ifdef NDBM -#include -#else -#ifdef SVR4 -#include -#else -#include -#endif -#endif -#include "rgb.h" -#include "os.h" -#include "opaque.h" - -/* Note that we are assuming there is only one database for all the screens. */ - -#ifdef NDBM -DBM *rgb_dbm = (DBM *)NULL; -#else -int rgb_dbm = 0; -#endif - -extern void CopyISOLatin1Lowered( - unsigned char * /*dest*/, - unsigned char * /*source*/, - int /*length*/); - -int -OsInitColors(void) -{ - if (!rgb_dbm) - { -#ifdef NDBM - rgb_dbm = dbm_open(rgbPath, 0, 0); -#else - if (dbminit(rgbPath) == 0) - rgb_dbm = 1; -#endif - if (!rgb_dbm) { - ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); - return FALSE; - } - } - return TRUE; -} - -/*ARGSUSED*/ -int -OsLookupColor(int screen, char *name, unsigned int len, - unsigned short *pred, unsigned short *pgreen, unsigned short *pblue) -{ - datum dbent; - RGB rgb; - char buf[64]; - char *lowername; - - if(!rgb_dbm) - return(0); - - /* we use xalloc here so that we can compile with cc without alloca - * when otherwise using gcc */ - if (len < sizeof(buf)) - lowername = buf; - else if (!(lowername = (char *)xalloc(len + 1))) - return(0); - CopyISOLatin1Lowered ((unsigned char *) lowername, (unsigned char *) name, - (int)len); - - dbent.dptr = lowername; - dbent.dsize = len; -#ifdef NDBM - dbent = dbm_fetch(rgb_dbm, dbent); -#else - dbent = fetch (dbent); -#endif - - if (len >= sizeof(buf)) - xfree(lowername); - - if(dbent.dptr) - { - memmove((char *) &rgb, dbent.dptr, sizeof (RGB)); - *pred = rgb.red; - *pgreen = rgb.green; - *pblue = rgb.blue; - return (1); - } - return(0); -} - -#else /* USE_RGB_TXT */ - - -/* - * The dbm routines are a porting hassle. This implementation will do - * the same thing by reading the rgb.txt file directly, which is much - * more portable. - */ - -#include -#include "os.h" -#include "opaque.h" - -#define HASHSIZE 511 - -typedef struct _dbEntry * dbEntryPtr; -typedef struct _dbEntry { - dbEntryPtr link; - unsigned short red; - unsigned short green; - unsigned short blue; - char name[1]; /* some compilers complain if [0] */ -} dbEntry; - - -extern void CopyISOLatin1Lowered( - unsigned char * /*dest*/, - unsigned char * /*source*/, - int /*length*/); - -static dbEntryPtr hashTab[HASHSIZE]; - - -static dbEntryPtr -lookup(char *name, int len, Bool create) -{ - unsigned int h = 0, g; - dbEntryPtr entry, *prev = NULL; - char *str = name; - - if (!(name = (char*)ALLOCATE_LOCAL(len +1))) return NULL; - CopyISOLatin1Lowered((unsigned char *)name, (unsigned char *)str, len); - name[len] = '\0'; - - for(str = name; *str; str++) { - h = (h << 4) + *str; - if ((g = h) & 0xf0000000) h ^= (g >> 24); - h &= g; - } - h %= HASHSIZE; - - if ( (entry = hashTab[h]) ) - { - for( ; entry; prev = (dbEntryPtr*)entry, entry = entry->link ) - if (! strcmp(name, entry->name) ) break; - } - else - prev = &(hashTab[h]); - - if (!entry && create && (entry = (dbEntryPtr)xalloc(sizeof(dbEntry) +len))) - { - *prev = entry; - entry->link = NULL; - strcpy( entry->name, name ); - } - - DEALLOCATE_LOCAL(name); - - return entry; -} - - -Bool -OsInitColors(void) -{ - FILE *rgb; - char *path; - char line[BUFSIZ]; - char name[BUFSIZ]; - int red, green, blue, lineno = 0; - dbEntryPtr entry; - - static Bool was_here = FALSE; - - if (!was_here) - { -#ifndef __UNIXOS2__ - path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5); - strcpy(path, rgbPath); - strcat(path, ".txt"); -#else - char *tmp = (char*)__XOS2RedirRoot(rgbPath); - path = (char*)ALLOCATE_LOCAL(strlen(tmp) +5); - strcpy(path, tmp); - strcat(path, ".txt"); -#endif - if (!(rgb = fopen(path, "r"))) - { - ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); - DEALLOCATE_LOCAL(path); - return FALSE; - } - - while(fgets(line, sizeof(line), rgb)) - { - lineno++; -#ifndef __UNIXOS2__ - if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) -#else - if (sscanf(line,"%d %d %d %[^\n\r]\n", &red, &green, &blue, name) == 4) -#endif - { - if (red >= 0 && red <= 0xff && - green >= 0 && green <= 0xff && - blue >= 0 && blue <= 0xff) - { - if ((entry = lookup(name, strlen(name), TRUE))) - { - entry->red = (red * 65535) / 255; - entry->green = (green * 65535) / 255; - entry->blue = (blue * 65535) / 255; - } - } - else - ErrorF("Value out of range: %s:%d\n", path, lineno); - } - else if (*line && *line != '#' && *line != '!') - ErrorF("Syntax Error: %s:%d\n", path, lineno); - } - - fclose(rgb); - DEALLOCATE_LOCAL(path); - - was_here = TRUE; - } - - return TRUE; -} - - - -Bool -OsLookupColor(int screen, char *name, unsigned int len, - unsigned short *pred, unsigned short *pgreen, unsigned short *pblue) -{ - dbEntryPtr entry; - - if ((entry = lookup(name, len, FALSE))) - { - *pred = entry->red; - *pgreen = entry->green; - *pblue = entry->blue; - return TRUE; - } - - return FALSE; -} - -#endif /* USE_RGB_TXT */ diff --git a/nx-X11/programs/Xserver/os/utils.c.NX.original b/nx-X11/programs/Xserver/os/utils.c.NX.original deleted file mode 100644 index 7e626542e..000000000 --- a/nx-X11/programs/Xserver/os/utils.c.NX.original +++ /dev/null @@ -1,2440 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/os/utils.c,v 1.21 2005/11/08 06:33:30 jkj Exp $ */ -/* $Xorg: utils.c,v 1.5 2001/02/09 02:05:24 xorgcvs Exp $ */ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, -Copyright 1994 Quarterdeck Office Systems. - - 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 names of Digital and -Quarterdeck not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT -OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE -OR PERFORMANCE OF THIS SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/os/utils.c,v 3.96 2004/01/07 04:16:37 dawes Exp $ */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef __CYGWIN__ -#include -#include -#endif - -#if defined(WIN32) && !defined(__CYGWIN__) -#include -#endif -#include -#include -#include "misc.h" -#include -#include -#include "input.h" -#include "dixfont.h" -#include "osdep.h" -#ifdef X_POSIX_C_SOURCE -#define _POSIX_C_SOURCE X_POSIX_C_SOURCE -#include -#undef _POSIX_C_SOURCE -#else -#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE) -#include -#else -#define _POSIX_SOURCE -#include -#undef _POSIX_SOURCE -#endif -#endif -#ifndef WIN32 -#include -#endif -#if !defined(SYSV) && !defined(WIN32) && !defined(Lynx) && !defined(QNX4) -#include -#endif -#include -#include -#include /* for isspace */ -#include - -#if defined(DGUX) -#include -#include -#endif - -#include /* for malloc() */ - -#if defined(TCPCONN) || defined(STREAMSCONN) -# ifndef WIN32 -# include -# endif -#endif - -#include "opaque.h" - -#ifdef SMART_SCHEDULE -#include "dixstruct.h" -#endif - -#ifdef XKB -#include -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif - -#ifdef RENDER -#include "picture.h" -#endif - -#ifdef XPRINT -#include "DiPrint.h" -#endif - -Bool noTestExtensions; -#ifdef BIGREQS -Bool noBigReqExtension = FALSE; -#endif -#ifdef COMPOSITE -/* COMPOSITE is disabled by default for now until the - * interface is stable */ -Bool noCompositeExtension = TRUE; -#endif -#ifdef DAMAGE -Bool noDamageExtension = FALSE; -#endif -#ifdef DBE -Bool noDbeExtension = FALSE; -#endif -#ifdef DPSEXT -Bool noDPSExtension = FALSE; -#endif -#ifdef DPMSExtension -Bool noDPMSExtension = FALSE; -#endif -#ifdef EVI -Bool noEVIExtension = FALSE; -#endif -#ifdef FONTCACHE -Bool noFontCacheExtension = FALSE; -#endif -#ifdef GLXEXT -Bool noGlxExtension = FALSE; -#endif -#ifdef LBX -Bool noLbxExtension = FALSE; -#endif -#ifdef SCREENSAVER -Bool noScreenSaverExtension = FALSE; -#endif -#ifdef MITSHM -Bool noMITShmExtension = FALSE; -#endif -#ifdef MITMISC -Bool noMITMiscExtension = FALSE; -#endif -#ifdef MULTIBUFFER -Bool noMultibufferExtension = FALSE; -#endif -#ifdef RANDR -Bool noRRExtension = FALSE; -#endif -#ifdef RENDER -Bool noRenderExtension = FALSE; -#endif -#ifdef SHAPE -Bool noShapeExtension = FALSE; -#endif -#ifdef XCSECURITY -Bool noSecurityExtension = FALSE; -#endif -#ifdef XSYNC -Bool noSyncExtension = FALSE; -#endif -#ifdef TOGCUP -Bool noXcupExtension = FALSE; -#endif -#ifdef RES -Bool noResExtension = FALSE; -#endif -#ifdef XAPPGROUP -Bool noXagExtension = FALSE; -#endif -#ifdef XCMISC -Bool noXCMiscExtension = FALSE; -#endif -#ifdef XEVIE -/* Xevie is disabled by default for now until the - * interface is stable */ -Bool noXevieExtension = TRUE; -#endif -#ifdef XF86BIGFONT -Bool noXFree86BigfontExtension = FALSE; -#endif -#ifdef XFreeXDGA -Bool noXFree86DGAExtension = FALSE; -#endif -#ifdef XF86DRI -Bool noXFree86DRIExtension = FALSE; -#endif -#ifdef XF86MISC -Bool noXFree86MiscExtension = FALSE; -#endif -#ifdef XF86VIDMODE -Bool noXFree86VidModeExtension = FALSE; -#endif -#ifdef XFIXES -Bool noXFixesExtension = FALSE; -#endif -/* |noXkbExtension| is defined in xc/programs/Xserver/xkb/xkbInit.c */ -#ifdef PANORAMIX -/* Xinerama is disabled by default unless enabled via +xinerama */ -Bool noPanoramiXExtension = TRUE; -#endif -#ifdef XINPUT -Bool noXInputExtension = FALSE; -#endif -#ifdef XIDLE -Bool noXIdleExtension = FALSE; -#endif -#ifdef XV -Bool noXvExtension = FALSE; -#endif - -#define X_INCLUDE_NETDB_H -#include - -#include - -#ifdef NX_TRANS_SOCKET - -#include "NX.h" -#include "NXvars.h" - -#endif - -#ifdef NX_TRANS_EXIT - -void (*OsVendorStartRedirectErrorFProc)() = NULL; -void (*OsVendorEndRedirectErrorFProc)() = NULL; - -#endif - -Bool CoreDump; - -#ifdef PANORAMIX -Bool PanoramiXVisibilityNotifySent = FALSE; -Bool PanoramiXMapped = FALSE; -Bool PanoramiXWindowExposureSent = FALSE; -Bool PanoramiXOneExposeRequest = FALSE; -Bool PanoramiXExtensionDisabledHack = FALSE; -#endif - -int auditTrailLevel = 1; - -Bool Must_have_memory = FALSE; - -#ifdef AIXV3 -int SyncOn = 0; -extern int SelectWaitTime; -#endif - -#ifdef DEBUG -#ifndef SPECIAL_MALLOC -#define MEMBUG -#endif -#endif - -#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED) -#define HAS_SAVED_IDS_AND_SETEUID -#endif - -#ifdef MEMBUG -#define MEM_FAIL_SCALE 100000 -long Memory_fail = 0; -#include /* for random() */ -#endif - -#ifdef sgi -int userdefinedfontpath = 0; -#endif /* sgi */ - -char *dev_tty_from_init = NULL; /* since we need to parse it anyway */ - -extern char dispatchExceptionAtReset; - -/* Extension enable/disable in miinitext.c */ -extern Bool EnableDisableExtension(char *name, Bool enable); -extern void EnableDisableExtensionError(char *name, Bool enable); - -OsSigHandlerPtr -OsSignal(sig, handler) - int sig; - OsSigHandlerPtr handler; -{ -#ifdef X_NOT_POSIX - return signal(sig, handler); -#else - struct sigaction act, oact; - - sigemptyset(&act.sa_mask); - if (handler != SIG_IGN) - sigaddset(&act.sa_mask, sig); - act.sa_flags = 0; - act.sa_handler = handler; - sigaction(sig, &act, &oact); - return oact.sa_handler; -#endif -} - -#ifdef SERVER_LOCK -/* - * Explicit support for a server lock file like the ones used for UUCP. - * For architectures with virtual terminals that can run more than one - * server at a time. This keeps the servers from stomping on each other - * if the user forgets to give them different display numbers. - */ -#ifndef __UNIXOS2__ -#define LOCK_DIR "/tmp" -#endif -#define LOCK_TMP_PREFIX "/.tX" -#define LOCK_PREFIX "/.X" -#define LOCK_SUFFIX "-lock" - -#if defined(DGUX) -#include -#include -#endif - -#ifdef __UNIXOS2__ -#define link rename -#endif - -#ifndef PATH_MAX -#ifndef Lynx -#include -#else -#include -#endif -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif -#endif -#endif - -static Bool StillLocking = FALSE; -static char LockFile[PATH_MAX]; -static Bool nolock = FALSE; - -/* - * LockServer -- - * Check if the server lock file exists. If so, check if the PID - * contained inside is valid. If so, then die. Otherwise, create - * the lock file containing the PID. - */ -void -LockServer(void) -{ - char tmp[PATH_MAX], pid_str[12]; - int lfd, i, haslock, l_pid, t; - char *tmppath = NULL; - int len; - char port[20]; - - if (nolock) return; - /* - * Path names - */ -#ifndef __UNIXOS2__ - tmppath = LOCK_DIR; -#else - /* OS/2 uses TMP directory, must also prepare for 8.3 names */ - tmppath = getenv("TMP"); - if (!tmppath) - FatalError("No TMP dir found\n"); -#endif - - sprintf(port, "%d", atoi(display)); - len = strlen(LOCK_PREFIX) > strlen(LOCK_TMP_PREFIX) ? strlen(LOCK_PREFIX) : - strlen(LOCK_TMP_PREFIX); - len += strlen(tmppath) + strlen(port) + strlen(LOCK_SUFFIX) + 1; - if (len > sizeof(LockFile)) - FatalError("Display name `%s' is too long\n", port); - (void)sprintf(tmp, "%s" LOCK_TMP_PREFIX "%s" LOCK_SUFFIX, tmppath, port); - (void)sprintf(LockFile, "%s" LOCK_PREFIX "%s" LOCK_SUFFIX, tmppath, port); - - /* - * Create a temporary file containing our PID. Attempt three times - * to create the file. - */ - StillLocking = TRUE; - i = 0; - do { - i++; - lfd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0644); - if (lfd < 0) - sleep(2); - else - break; - } while (i < 3); - if (lfd < 0) { - unlink(tmp); - i = 0; - do { - i++; - lfd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0644); - if (lfd < 0) - sleep(2); - else - break; - } while (i < 3); - } - if (lfd < 0) - FatalError("Could not create lock file in %s\n", tmp); - (void) sprintf(pid_str, "%10ld\n", (long)getpid()); - (void) write(lfd, pid_str, 11); -#ifndef __UNIXOS2__ -#ifndef USE_CHMOD - (void) fchmod(lfd, 0444); -#else - (void) chmod(tmp, 0444); -#endif -#endif - (void) close(lfd); - - /* - * OK. Now the tmp file exists. Try three times to move it in place - * for the lock. - */ - i = 0; - haslock = 0; - while ((!haslock) && (i++ < 3)) { - haslock = (link(tmp,LockFile) == 0); - if (haslock) { - /* - * We're done. - */ - break; - } - else { - /* - * Read the pid from the existing file - */ - lfd = open(LockFile, O_RDONLY); - if (lfd < 0) { - unlink(tmp); - FatalError("Can't read lock file %s\n", LockFile); - } - pid_str[0] = '\0'; - if (read(lfd, pid_str, 11) != 11) { - /* - * Bogus lock file. - */ - unlink(LockFile); - close(lfd); - continue; - } - pid_str[11] = '\0'; - sscanf(pid_str, "%d", &l_pid); - close(lfd); - - /* - * Now try to kill the PID to see if it exists. - */ - errno = 0; - t = kill(l_pid, 0); - if ((t< 0) && (errno == ESRCH)) { - /* - * Stale lock file. - */ - unlink(LockFile); - continue; - } - else if (((t < 0) && (errno == EPERM)) || (t == 0)) { - /* - * Process is still active. - */ - unlink(tmp); - FatalError("Server is already active for display %s\n%s %s\n%s\n", - port, "\tIf this server is no longer running, remove", - LockFile, "\tand start again."); - } - } - } - unlink(tmp); - if (!haslock) - FatalError("Could not create server lock file: %s\n", LockFile); - StillLocking = FALSE; -} - -/* - * UnlockServer -- - * Remove the server lock file. - */ -void -UnlockServer(void) -{ - if (nolock) return; - - if (!StillLocking){ - -#ifdef __UNIXOS2__ - (void) chmod(LockFile,S_IREAD|S_IWRITE); -#endif /* __UNIXOS2__ */ - (void) unlink(LockFile); - } -} -#endif /* SERVER_LOCK */ - -/* Force connections to close on SIGHUP from init */ - -/*ARGSUSED*/ -SIGVAL -AutoResetServer (int sig) -{ - int olderrno = errno; - - dispatchException |= DE_RESET; - isItTimeToYield = TRUE; -#ifdef GPROF - chdir ("/tmp"); - exit (0); -#endif -#if defined(SYSV) && defined(X_NOT_POSIX) - OsSignal (SIGHUP, AutoResetServer); -#endif - errno = olderrno; -} - -/* Force connections to close and then exit on SIGTERM, SIGINT */ - -/*ARGSUSED*/ -SIGVAL -GiveUp(int sig) -{ - int olderrno = errno; - -#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "GiveUp: Called with signal [%d].\n", sig); -#endif - - dispatchException |= DE_TERMINATE; - isItTimeToYield = TRUE; -#if defined(SYSV) && defined(X_NOT_POSIX) - if (sig) - OsSignal(sig, SIG_IGN); -#endif - errno = olderrno; -} - -#ifndef DDXTIME -CARD32 -GetTimeInMillis(void) -{ - struct timeval tp; - - X_GETTIMEOFDAY(&tp); - return(tp.tv_sec * 1000) + (tp.tv_usec / 1000); -} -#endif - -void -AdjustWaitForDelay (pointer waitTime, unsigned long newdelay) -{ - static struct timeval delay_val; - struct timeval **wt = (struct timeval **) waitTime; - unsigned long olddelay; - - if (*wt == NULL) - { - delay_val.tv_sec = newdelay / 1000; - delay_val.tv_usec = 1000 * (newdelay % 1000); - *wt = &delay_val; - } - else - { - olddelay = (*wt)->tv_sec * 1000 + (*wt)->tv_usec / 1000; - if (newdelay < olddelay) - { - (*wt)->tv_sec = newdelay / 1000; - (*wt)->tv_usec = 1000 * (newdelay % 1000); - } - } -} - -void UseMsg(void) -{ -#if !defined(AIXrt) && !defined(AIX386) - ErrorF("use: X [:] [option]\n"); - ErrorF("-a # mouse acceleration (pixels)\n"); - ErrorF("-ac disable access control restrictions\n"); -#ifdef MEMBUG - ErrorF("-alloc int chance alloc should fail\n"); -#endif - ErrorF("-audit int set audit trail level\n"); - ErrorF("-auth file select authorization file\n"); - ErrorF("bc enable bug compatibility\n"); - ErrorF("-br create root window with black background\n"); - ErrorF("+bs enable any backing store support\n"); - ErrorF("-bs disable any backing store support\n"); - ErrorF("-c turns off key-click\n"); - ErrorF("c # key-click volume (0-100)\n"); - ErrorF("-cc int default color visual class\n"); - ErrorF("-co file color database file\n"); -#ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS - ErrorF("-config file read options from file\n"); -#endif - ErrorF("-core generate core dump on fatal error\n"); - ErrorF("-dpi int screen resolution in dots per inch\n"); -#ifdef DPMSExtension - ErrorF("dpms enables VESA DPMS monitor control\n"); - ErrorF("-dpms disables VESA DPMS monitor control\n"); -#endif - ErrorF("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n"); - ErrorF("-f # bell base (0-100)\n"); - ErrorF("-fc string cursor font\n"); - ErrorF("-fn string default font name\n"); - ErrorF("-fp string default font path\n"); - ErrorF("-help prints message with these options\n"); - ErrorF("-I ignore all remaining arguments\n"); -#ifdef RLIMIT_DATA - ErrorF("-ld int limit data space to N Kb\n"); -#endif -#ifdef RLIMIT_NOFILE - ErrorF("-lf int limit number of open files to N\n"); -#endif -#ifdef RLIMIT_STACK - ErrorF("-ls int limit stack space to N Kb\n"); -#endif -#ifdef SERVER_LOCK - ErrorF("-nolock disable the locking mechanism\n"); -#endif -#ifndef NOLOGOHACK - ErrorF("-logo enable logo in screen saver\n"); - ErrorF("nologo disable logo in screen saver\n"); -#endif - ErrorF("-nolisten string don't listen on protocol\n"); - ErrorF("-noreset don't reset after last client exists\n"); - ErrorF("-reset reset after last client exists\n"); - ErrorF("-p # screen-saver pattern duration (minutes)\n"); - ErrorF("-pn accept failure to listen on all ports\n"); - ErrorF("-nopn reject failure to listen on all ports\n"); - ErrorF("-r turns off auto-repeat\n"); - ErrorF("r turns on auto-repeat \n"); -#ifdef RENDER - ErrorF("-render [default|mono|gray|color] set render color alloc policy\n"); -#endif - ErrorF("-s # screen-saver timeout (minutes)\n"); -#ifdef XCSECURITY - ErrorF("-sp file security policy file\n"); -#endif -#ifdef XPRINT - PrinterUseMsg(); -#endif - ErrorF("-su disable any save under support\n"); - ErrorF("-t # mouse threshold (pixels)\n"); - ErrorF("-terminate terminate at server reset\n"); - ErrorF("-to # connection time out\n"); - ErrorF("-tst disable testing extensions\n"); - ErrorF("ttyxx server started from init on /dev/ttyxx\n"); - ErrorF("v video blanking for screen-saver\n"); - ErrorF("-v screen-saver without video blanking\n"); - ErrorF("-wm WhenMapped default backing-store\n"); - ErrorF("-x string loads named extension at init time \n"); - ErrorF("-maxbigreqsize set maximal bigrequest size \n"); -#ifdef PANORAMIX - ErrorF("+xinerama Enable XINERAMA extension\n"); - ErrorF("-xinerama Disable XINERAMA extension\n"); -#endif -#ifdef SMART_SCHEDULE - ErrorF("-dumbSched Disable smart scheduling, enable old behavior\n"); - ErrorF("-schedInterval int Set scheduler interval in msec\n"); -#endif - ErrorF("+extension name Enable extension\n"); - ErrorF("-extension name Disable extension\n"); -#ifdef XDMCP - XdmcpUseMsg(); -#endif -#endif /* !AIXrt && ! AIX386 */ -#ifdef XKB - XkbUseMsg(); -#endif - ddxUseMsg(); -} - -/* This function performs a rudimentary sanity check - * on the display name passed in on the command-line, - * since this string is used to generate filenames. - * It is especially important that the display name - * not contain a "/" and not start with a "-". - * --kvajk - */ -static int -VerifyDisplayName(const char *d) -{ - if ( d == (char *)0 ) return( 0 ); /* null */ - if ( *d == '\0' ) return( 0 ); /* empty */ - if ( *d == '-' ) return( 0 ); /* could be confused for an option */ - if ( *d == '.' ) return( 0 ); /* must not equal "." or ".." */ - if ( strchr(d, '/') != (char *)0 ) return( 0 ); /* very important!!! */ - return( 1 ); -} - -/* - * This function is responsible for doing initalisation of any global - * variables at an very early point of server startup (even before - * |ProcessCommandLine()|. - */ -void InitGlobals(void) -{ - ddxInitGlobals(); -} - - -/* - * This function parses the command line. Handles device-independent fields - * and allows ddx to handle additional fields. It is not allowed to modify - * argc or any of the strings pointed to by argv. - */ -void -ProcessCommandLine(int argc, char *argv[]) -{ - int i, skip; - - defaultKeyboardControl.autoRepeat = TRUE; - -#ifdef NO_PART_NET - PartialNetwork = FALSE; -#else - PartialNetwork = TRUE; -#endif - - for ( i = 1; i < argc; i++ ) - { - /* call ddx first, so it can peek/override if it wants */ - if((skip = ddxProcessArgument(argc, argv, i))) - { - i += (skip - 1); - } - else if(argv[i][0] == ':') - { - /* initialize display */ - display = argv[i]; - display++; - if( ! VerifyDisplayName( display ) ) { - ErrorF("Bad display name: %s\n", display); - UseMsg(); - FatalError("Bad display name, exiting: %s\n", display); - } - } - else if ( strcmp( argv[i], "-a") == 0) - { - if(++i < argc) - defaultPointerControl.num = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-ac") == 0) - { - defeatAccessControl = TRUE; - } -#ifdef MEMBUG - else if ( strcmp( argv[i], "-alloc") == 0) - { - if(++i < argc) - Memory_fail = atoi(argv[i]); - else - UseMsg(); - } -#endif - else if ( strcmp( argv[i], "-audit") == 0) - { - if(++i < argc) - auditTrailLevel = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-auth") == 0) - { - if(++i < argc) - InitAuthorization (argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "bc") == 0) - permitOldBugs = TRUE; - else if ( strcmp( argv[i], "-br") == 0) - blackRoot = TRUE; - else if ( strcmp( argv[i], "+bs") == 0) - enableBackingStore = TRUE; - else if ( strcmp( argv[i], "-bs") == 0) - disableBackingStore = TRUE; - else if ( strcmp( argv[i], "c") == 0) - { - if(++i < argc) - defaultKeyboardControl.click = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-c") == 0) - { - defaultKeyboardControl.click = 0; - } - else if ( strcmp( argv[i], "-cc") == 0) - { - if(++i < argc) - defaultColorVisualClass = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-co") == 0) - { - if(++i < argc) - rgbPath = argv[i]; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-core") == 0) - CoreDump = TRUE; - else if ( strcmp( argv[i], "-dpi") == 0) - { - if(++i < argc) - monitorResolution = atoi(argv[i]); - else - UseMsg(); - } -#ifdef DPMSExtension - else if ( strcmp( argv[i], "dpms") == 0) - DPMSEnabledSwitch = TRUE; - else if ( strcmp( argv[i], "-dpms") == 0) - DPMSDisabledSwitch = TRUE; -#endif - else if ( strcmp( argv[i], "-deferglyphs") == 0) - { - if(++i >= argc || !ParseGlyphCachingMode(argv[i])) - UseMsg(); - } - else if ( strcmp( argv[i], "-f") == 0) - { - if(++i < argc) - defaultKeyboardControl.bell = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-fc") == 0) - { - if(++i < argc) - defaultCursorFont = argv[i]; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-fn") == 0) - { - if(++i < argc) - defaultTextFont = argv[i]; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-fp") == 0) - { - if(++i < argc) - { -#ifdef sgi - userdefinedfontpath = 1; -#endif /* sgi */ - defaultFontPath = argv[i]; - } - else - UseMsg(); - } - else if ( strcmp( argv[i], "-help") == 0) - { - UseMsg(); - exit(0); - } -#ifdef XKB - else if ( (skip=XkbProcessArguments(argc,argv,i))!=0 ) { - if (skip>0) - i+= skip-1; - else UseMsg(); - } -#endif -#ifdef RLIMIT_DATA - else if ( strcmp( argv[i], "-ld") == 0) - { - if(++i < argc) - { - limitDataSpace = atoi(argv[i]); - if (limitDataSpace > 0) - limitDataSpace *= 1024; - } - else - UseMsg(); - } -#endif -#ifdef RLIMIT_NOFILE - else if ( strcmp( argv[i], "-lf") == 0) - { - if(++i < argc) - limitNoFile = atoi(argv[i]); - else - UseMsg(); - } -#endif -#ifdef RLIMIT_STACK - else if ( strcmp( argv[i], "-ls") == 0) - { - if(++i < argc) - { - limitStackSpace = atoi(argv[i]); - if (limitStackSpace > 0) - limitStackSpace *= 1024; - } - else - UseMsg(); - } -#endif -#ifdef SERVER_LOCK - else if ( strcmp ( argv[i], "-nolock") == 0) - { -#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__) - if (getuid() != 0) - ErrorF("Warning: the -nolock option can only be used by root\n"); - else -#endif - nolock = TRUE; - } -#endif -#ifndef NOLOGOHACK - else if ( strcmp( argv[i], "-logo") == 0) - { - logoScreenSaver = 1; - } - else if ( strcmp( argv[i], "nologo") == 0) - { - logoScreenSaver = 0; - } -#endif - else if ( strcmp( argv[i], "-nolisten") == 0) - { - if(++i < argc) { - if (_XSERVTransNoListen(argv[i])) - FatalError ("Failed to disable listen for %s transport", - argv[i]); - } else - UseMsg(); - } - else if ( strcmp( argv[i], "-noreset") == 0) - { - dispatchExceptionAtReset = 0; - } - else if ( strcmp( argv[i], "-reset") == 0) - { - dispatchExceptionAtReset = DE_RESET; - } - else if ( strcmp( argv[i], "-p") == 0) - { - if(++i < argc) - defaultScreenSaverInterval = ((CARD32)atoi(argv[i])) * - MILLI_PER_MIN; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-pn") == 0) - PartialNetwork = TRUE; - else if ( strcmp( argv[i], "-nopn") == 0) - PartialNetwork = FALSE; - else if ( strcmp( argv[i], "r") == 0) - defaultKeyboardControl.autoRepeat = TRUE; - else if ( strcmp( argv[i], "-r") == 0) - defaultKeyboardControl.autoRepeat = FALSE; - else if ( strcmp( argv[i], "-s") == 0) - { - if(++i < argc) - defaultScreenSaverTime = ((CARD32)atoi(argv[i])) * - MILLI_PER_MIN; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-su") == 0) - disableSaveUnders = TRUE; - else if ( strcmp( argv[i], "-t") == 0) - { - if(++i < argc) - defaultPointerControl.threshold = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-terminate") == 0) - { - dispatchExceptionAtReset = DE_TERMINATE; - } - else if ( strcmp( argv[i], "-to") == 0) - { - if(++i < argc) - TimeOutValue = ((CARD32)atoi(argv[i])) * MILLI_PER_SECOND; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-tst") == 0) - { - noTestExtensions = TRUE; - } - else if ( strcmp( argv[i], "v") == 0) - defaultScreenSaverBlanking = PreferBlanking; - else if ( strcmp( argv[i], "-v") == 0) - defaultScreenSaverBlanking = DontPreferBlanking; - else if ( strcmp( argv[i], "-wm") == 0) - defaultBackingStore = WhenMapped; - else if ( strcmp( argv[i], "-maxbigreqsize") == 0) { - if(++i < argc) { - long reqSizeArg = atol(argv[i]); - - /* Request size > 128MB does not make much sense... */ - if( reqSizeArg > 0L && reqSizeArg < 128L ) { - maxBigRequestSize = (reqSizeArg * 1048576L) - 1L; - } - else - { - UseMsg(); - } - } - else - { - UseMsg(); - } - } -#ifdef PANORAMIX - else if ( strcmp( argv[i], "+xinerama") == 0){ - noPanoramiXExtension = FALSE; - } - else if ( strcmp( argv[i], "-xinerama") == 0){ - noPanoramiXExtension = TRUE; - } - else if ( strcmp( argv[i], "-disablexineramaextension") == 0){ - PanoramiXExtensionDisabledHack = TRUE; - } -#endif - else if ( strcmp( argv[i], "-x") == 0) - { - if(++i >= argc) - UseMsg(); - /* For U**x, which doesn't support dynamic loading, there's nothing - * to do when we see a -x. Either the extension is linked in or - * it isn't */ - } - else if ( strcmp( argv[i], "-I") == 0) - { - /* ignore all remaining arguments */ - break; - } - else if (strncmp (argv[i], "tty", 3) == 0) - { - /* just in case any body is interested */ - dev_tty_from_init = argv[i]; - } -#ifdef XDMCP - else if ((skip = XdmcpOptions(argc, argv, i)) != i) - { - i = skip - 1; - } -#endif -#ifdef XPRINT - else if ((skip = PrinterOptions(argc, argv, i)) != i) - { - i = skip - 1; - } -#endif -#ifdef XCSECURITY - else if ((skip = XSecurityOptions(argc, argv, i)) != i) - { - i = skip - 1; - } -#endif -#ifdef AIXV3 - else if ( strcmp( argv[i], "-timeout") == 0) - { - if(++i < argc) - SelectWaitTime = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-sync") == 0) - { - SyncOn++; - } -#endif -#ifdef SMART_SCHEDULE - else if ( strcmp( argv[i], "-dumbSched") == 0) - { - SmartScheduleDisable = TRUE; - } - else if ( strcmp( argv[i], "-schedInterval") == 0) - { - if (++i < argc) - { - SmartScheduleInterval = atoi(argv[i]); - SmartScheduleSlice = SmartScheduleInterval; - } - else - UseMsg(); - } - else if ( strcmp( argv[i], "-schedMax") == 0) - { - if (++i < argc) - { - SmartScheduleMaxSlice = atoi(argv[i]); - } - else - UseMsg(); - } -#endif -#ifdef RENDER - else if ( strcmp( argv[i], "-render" ) == 0) - { - if (++i < argc) - { - int policy = PictureParseCmapPolicy (argv[i]); - - if (policy != PictureCmapPolicyInvalid) - PictureCmapPolicy = policy; - else - UseMsg (); - } - else - UseMsg (); - } -#endif - else if ( strcmp( argv[i], "+extension") == 0) - { - if (++i < argc) - { - if (!EnableDisableExtension(argv[i], TRUE)) - EnableDisableExtensionError(argv[i], TRUE); - } - else - UseMsg(); - } - else if ( strcmp( argv[i], "-extension") == 0) - { - if (++i < argc) - { - if (!EnableDisableExtension(argv[i], FALSE)) - EnableDisableExtensionError(argv[i], FALSE); - } - else - UseMsg(); - } - else - { - ErrorF("Unrecognized option: %s\n", argv[i]); - UseMsg(); - FatalError("Unrecognized option: %s\n", argv[i]); - } - } -} - -#ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS -static void -InsertFileIntoCommandLine( - int *resargc, char ***resargv, - int prefix_argc, char **prefix_argv, - char *filename, - int suffix_argc, char **suffix_argv) -{ - struct stat st; - FILE *f; - char *p; - char *q; - int insert_argc; - char *buf; - int len; - int i; - - f = fopen(filename, "r"); - if (!f) - FatalError("Can't open option file %s\n", filename); - - fstat(fileno(f), &st); - - buf = (char *) xalloc((unsigned) st.st_size + 1); - if (!buf) - FatalError("Out of Memory\n"); - - len = fread(buf, 1, (unsigned) st.st_size, f); - - fclose(f); - - if (len < 0) - FatalError("Error reading option file %s\n", filename); - - buf[len] = '\0'; - - p = buf; - q = buf; - insert_argc = 0; - - while (*p) - { - while (isspace(*p)) - p++; - if (!*p) - break; - if (*p == '#') - { - while (*p && *p != '\n') - p++; - } else - { - while (*p && !isspace(*p)) - *q++ = *p++; - /* Since p and q might still be pointing at the same place, we */ - /* need to step p over the whitespace now before we add the null. */ - if (*p) - p++; - *q++ = '\0'; - insert_argc++; - } - } - - buf = (char *) xrealloc(buf, q - buf); - if (!buf) - FatalError("Out of memory reallocing option buf\n"); - - *resargc = prefix_argc + insert_argc + suffix_argc; - *resargv = (char **) xalloc((*resargc + 1) * sizeof(char *)); - if (!*resargv) - FatalError("Out of Memory\n"); - - memcpy(*resargv, prefix_argv, prefix_argc * sizeof(char *)); - - p = buf; - for (i = 0; i < insert_argc; i++) - { - (*resargv)[prefix_argc + i] = p; - p += strlen(p) + 1; - } - - memcpy(*resargv + prefix_argc + insert_argc, - suffix_argv, suffix_argc * sizeof(char *)); - - (*resargv)[*resargc] = NULL; -} /* end InsertFileIntoCommandLine */ - - -void -ExpandCommandLine(int *pargc, char ***pargv) -{ - int i; - -#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__) - if (getuid() != geteuid()) - return; -#endif - - for (i = 1; i < *pargc; i++) - { - if ( (0 == strcmp((*pargv)[i], "-config")) && (i < (*pargc - 1)) ) - { - InsertFileIntoCommandLine(pargc, pargv, - i, *pargv, - (*pargv)[i+1], /* filename */ - *pargc - i - 2, *pargv + i + 2); - i--; - } - } -} /* end ExpandCommandLine */ -#endif - -/* Implement a simple-minded font authorization scheme. The authorization - name is "hp-hostname-1", the contents are simply the host name. */ -int -set_font_authorizations(char **authorizations, int *authlen, pointer client) -{ -#define AUTHORIZATION_NAME "hp-hostname-1" -#if defined(TCPCONN) || defined(STREAMSCONN) - static char *result = NULL; - static char *p = NULL; - - if (p == NULL) - { - char hname[1024], *hnameptr; - unsigned int len; -#if defined(IPv6) && defined(AF_INET6) - struct addrinfo hints, *ai = NULL; -#else - struct hostent *host; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgethostbynameparams hparams; -#endif -#endif - - gethostname(hname, 1024); -#if defined(IPv6) && defined(AF_INET6) - bzero(&hints, sizeof(hints)); - hints.ai_flags = AI_CANONNAME; - if (getaddrinfo(hname, NULL, &hints, &ai) == 0) { - hnameptr = ai->ai_canonname; - } else { - hnameptr = hname; - } -#else - host = _XGethostbyname(hname, hparams); - if (host == NULL) - hnameptr = hname; - else - hnameptr = host->h_name; -#endif - - len = strlen(hnameptr) + 1; - result = xalloc(len + sizeof(AUTHORIZATION_NAME) + 4); - - p = result; - *p++ = sizeof(AUTHORIZATION_NAME) >> 8; - *p++ = sizeof(AUTHORIZATION_NAME) & 0xff; - *p++ = (len) >> 8; - *p++ = (len & 0xff); - - memmove(p, AUTHORIZATION_NAME, sizeof(AUTHORIZATION_NAME)); - p += sizeof(AUTHORIZATION_NAME); - memmove(p, hnameptr, len); - p += len; -#if defined(IPv6) && defined(AF_INET6) - if (ai) { - freeaddrinfo(ai); - } -#endif - } - *authlen = p - result; - *authorizations = result; - return 1; -#else /* TCPCONN */ - return 0; -#endif /* TCPCONN */ -} - -/* XALLOC -- X's internal memory allocator. Why does it return unsigned - * long * instead of the more common char *? Well, if you read K&R you'll - * see they say that alloc must return a pointer "suitable for conversion" - * to whatever type you really want. In a full-blown generic allocator - * there's no way to solve the alignment problems without potentially - * wasting lots of space. But we have a more limited problem. We know - * we're only ever returning pointers to structures which will have to - * be long word aligned. So we are making a stronger guarantee. It might - * have made sense to make Xalloc return char * to conform with people's - * expectations of malloc, but this makes lint happier. - */ - -#ifndef INTERNAL_MALLOC - -void * -Xalloc(unsigned long amount) -{ - register pointer ptr; - - if ((long)amount <= 0) { - return (unsigned long *)NULL; - } - /* aligned extra on long word boundary */ - amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); -#ifdef MEMBUG - if (!Must_have_memory && Memory_fail && - ((random() % MEM_FAIL_SCALE) < Memory_fail)) - return (unsigned long *)NULL; -#endif - if ((ptr = (pointer)malloc(amount))) { - return (unsigned long *)ptr; - } - if (Must_have_memory) - FatalError("Out of memory"); - return (unsigned long *)NULL; -} - -/***************** - * XNFalloc - * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory - *****************/ - -void * -XNFalloc(unsigned long amount) -{ - register pointer ptr; - - if ((long)amount <= 0) - { - return (unsigned long *)NULL; - } - /* aligned extra on long word boundary */ - amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); - ptr = (pointer)malloc(amount); - if (!ptr) - { - FatalError("Out of memory"); - } - return ((unsigned long *)ptr); -} - -/***************** - * Xcalloc - *****************/ - -void * -Xcalloc(unsigned long amount) -{ - unsigned long *ret; - - ret = Xalloc (amount); - if (ret) - bzero ((char *) ret, (int) amount); - return ret; -} - -/***************** - * XNFcalloc - *****************/ - -void * -XNFcalloc(unsigned long amount) -{ - unsigned long *ret; - - ret = Xalloc (amount); - if (ret) - bzero ((char *) ret, (int) amount); - else if ((long)amount > 0) - FatalError("Out of memory"); - return ret; -} - -/***************** - * Xrealloc - *****************/ - -void * -Xrealloc(pointer ptr, unsigned long amount) -{ -#ifdef MEMBUG - if (!Must_have_memory && Memory_fail && - ((random() % MEM_FAIL_SCALE) < Memory_fail)) - return (unsigned long *)NULL; -#endif - if ((long)amount <= 0) - { - if (ptr && !amount) - free(ptr); - return (unsigned long *)NULL; - } - amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); - if (ptr) - ptr = (pointer)realloc((char *)ptr, amount); - else - ptr = (pointer)malloc(amount); - if (ptr) - return (unsigned long *)ptr; - if (Must_have_memory) - FatalError("Out of memory"); - return (unsigned long *)NULL; -} - -/***************** - * XNFrealloc - * "no failure" realloc, alternate interface to Xrealloc w/o Must_have_memory - *****************/ - -void * -XNFrealloc(pointer ptr, unsigned long amount) -{ - if (( ptr = (pointer)Xrealloc( ptr, amount ) ) == NULL) - { - if ((long)amount > 0) - FatalError( "Out of memory" ); - } - return ((unsigned long *)ptr); -} - -/***************** - * Xfree - * calls free - *****************/ - -void -Xfree(pointer ptr) -{ - if (ptr) - free((char *)ptr); -} - -void -OsInitAllocator (void) -{ -#ifdef MEMBUG - static int been_here; - - /* Check the memory system after each generation */ - if (been_here) - CheckMemory (); - else - been_here = 1; -#endif -} -#endif /* !INTERNAL_MALLOC */ - - -char * -Xstrdup(const char *s) -{ - char *sd; - - if (s == NULL) - return NULL; - - sd = (char *)Xalloc(strlen(s) + 1); - if (sd != NULL) - strcpy(sd, s); - return sd; -} - - -char * -XNFstrdup(const char *s) -{ - char *sd; - - if (s == NULL) - return NULL; - - sd = (char *)XNFalloc(strlen(s) + 1); - strcpy(sd, s); - return sd; -} - -#ifdef SMART_SCHEDULE - -unsigned long SmartScheduleIdleCount; -Bool SmartScheduleIdle; -Bool SmartScheduleTimerStopped; - -#ifdef SIGVTALRM -#define SMART_SCHEDULE_POSSIBLE -#endif - -#ifdef SMART_SCHEDULE_POSSIBLE -#define SMART_SCHEDULE_SIGNAL SIGALRM -#define SMART_SCHEDULE_TIMER ITIMER_REAL -#endif - -#ifdef NX_TRANS_SOCKET -void -SmartScheduleStopTimer (void) -#else -static void -SmartScheduleStopTimer (void) -#endif -{ -#ifdef SMART_SCHEDULE_POSSIBLE - struct itimerval timer; - - #ifdef NX_TRANS_TEST - fprintf(stderr, "SmartScheduleStopTimer: Stopping timer.\n"); - #endif - - timer.it_interval.tv_sec = 0; - timer.it_interval.tv_usec = 0; - timer.it_value.tv_sec = 0; - timer.it_value.tv_usec = 0; - (void) setitimer (ITIMER_REAL, &timer, 0); - SmartScheduleTimerStopped = TRUE; -#endif -} - -Bool -SmartScheduleStartTimer (void) -{ -#ifdef SMART_SCHEDULE_POSSIBLE - struct itimerval timer; - - #ifdef NX_TRANS_SOCKET - - if (SmartScheduleDisable) - { - return FALSE; - } - - #endif - - #ifdef NX_TRANS_TEST - fprintf(stderr, "SmartScheduleStartTimer: Starting timer with [%ld] ms.\n", - SmartScheduleInterval); - #endif - - SmartScheduleTimerStopped = FALSE; - timer.it_interval.tv_sec = 0; - timer.it_interval.tv_usec = SmartScheduleInterval * 1000; - timer.it_value.tv_sec = 0; - timer.it_value.tv_usec = SmartScheduleInterval * 1000; - return setitimer (ITIMER_REAL, &timer, 0) >= 0; -#endif - return FALSE; -} - -#ifdef SMART_SCHEDULE_POSSIBLE -static void -SmartScheduleTimer (int sig) -{ - int olderrno = errno; - - SmartScheduleTime += SmartScheduleInterval; - - #ifdef NX_TRANS_TEST - fprintf(stderr, "SmartScheduleTimer: Got timer with time [%ld] ms.\n", - SmartScheduleTime); - #endif - - if (SmartScheduleIdle) - { - SmartScheduleStopTimer (); - } - errno = olderrno; -} -#endif - -Bool -SmartScheduleInit (void) -{ -#ifdef SMART_SCHEDULE_POSSIBLE - struct sigaction act; - - if (SmartScheduleDisable) - return TRUE; - - #ifdef NX_TRANS_TEST - fprintf(stderr, "SmartScheduleInit: Initializing the smart scheduler.\n"); - #endif - - bzero ((char *) &act, sizeof(struct sigaction)); - - /* Set up the timer signal function */ - act.sa_handler = SmartScheduleTimer; - sigemptyset (&act.sa_mask); - sigaddset (&act.sa_mask, SMART_SCHEDULE_SIGNAL); - if (sigaction (SMART_SCHEDULE_SIGNAL, &act, 0) < 0) - { - perror ("sigaction for smart scheduler"); - return FALSE; - } - /* Set up the virtual timer */ - if (!SmartScheduleStartTimer ()) - { - perror ("scheduling timer"); - return FALSE; - } - /* stop the timer and wait for WaitForSomething to start it */ - SmartScheduleStopTimer (); - return TRUE; -#else - return FALSE; -#endif -} -#endif - -#ifdef SIG_BLOCK -static sigset_t PreviousSignalMask; -static int BlockedSignalCount; -#endif - -void -OsBlockSignals (void) -{ -#ifdef SIG_BLOCK - if (BlockedSignalCount++ == 0) - { - sigset_t set; - - sigemptyset (&set); -#ifdef SIGALRM - sigaddset (&set, SIGALRM); -#endif -#ifdef SIGVTALRM - sigaddset (&set, SIGVTALRM); -#endif -#ifdef SIGWINCH - sigaddset (&set, SIGWINCH); -#endif -#ifdef SIGIO - sigaddset (&set, SIGIO); -#endif -#ifdef SIGTSTP - sigaddset (&set, SIGTSTP); -#endif -#ifdef SIGTTIN - sigaddset (&set, SIGTTIN); -#endif -#ifdef SIGTTOU - sigaddset (&set, SIGTTOU); -#endif -#ifdef SIGCHLD - sigaddset (&set, SIGCHLD); -#endif - sigprocmask (SIG_BLOCK, &set, &PreviousSignalMask); - } -#endif -} - -void -OsReleaseSignals (void) -{ -#ifdef SIG_BLOCK - if (--BlockedSignalCount == 0) - { - sigprocmask (SIG_SETMASK, &PreviousSignalMask, 0); - } -#endif -} - -#if !defined(WIN32) && !defined(__UNIXOS2__) -/* - * "safer" versions of system(3), popen(3) and pclose(3) which give up - * all privs before running a command. - * - * This is based on the code in FreeBSD 2.2 libc. - * - * XXX It'd be good to redirect stderr so that it ends up in the log file - * as well. As it is now, xkbcomp messages don't end up in the log file. - */ - -int -System(char *command) -{ - int pid, p; -#ifdef SIGCHLD - void (*csig)(int); -#endif - int status; - - if (!command) - return(1); - -#ifdef SIGCHLD - csig = signal(SIGCHLD, SIG_DFL); -#endif - -#ifdef DEBUG - ErrorF("System: `%s'\n", command); -#endif - -#ifdef NX_TRANS_EXIT - if (OsVendorStartRedirectErrorFProc != NULL) { - OsVendorStartRedirectErrorFProc(); - } -#endif - switch (pid = fork()) { - case -1: /* error */ - p = -1; - case 0: /* child */ - if (setgid(getgid()) == -1) - _exit(127); - if (setuid(getuid()) == -1) - _exit(127); - execl("/bin/sh", "sh", "-c", command, (char *)NULL); - _exit(127); - default: /* parent */ - do { - p = waitpid(pid, &status, 0); - } while (p == -1 && errno == EINTR); - - } -#ifdef NX_TRANS_EXIT - if (OsVendorEndRedirectErrorFProc != NULL) { - OsVendorEndRedirectErrorFProc(); - } -#endif - -#ifdef SIGCHLD - signal(SIGCHLD, csig); -#endif - - return p == -1 ? -1 : status; -} - -static struct pid { - struct pid *next; - FILE *fp; - int pid; -} *pidlist; - -pointer -Popen(char *command, char *type) -{ - struct pid *cur; - FILE *iop; - int pdes[2], pid; - - if (command == NULL || type == NULL) - return NULL; - - if ((*type != 'r' && *type != 'w') || type[1]) - return NULL; - - if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL) - return NULL; - - if (pipe(pdes) < 0) { - xfree(cur); - return NULL; - } - -#ifdef NX_TRANS_EXIT - if (OsVendorStartRedirectErrorFProc != NULL) { - OsVendorStartRedirectErrorFProc(); - } - OsBlockSignals (); -#endif - switch (pid = fork()) { - case -1: /* error */ - close(pdes[0]); - close(pdes[1]); - xfree(cur); -#ifdef NX_TRANS_EXIT - if (OsVendorEndRedirectErrorFProc != NULL) { - OsVendorEndRedirectErrorFProc(); - } - OsReleaseSignals (); -#endif - return NULL; - case 0: /* child */ - if (setgid(getgid()) == -1) - _exit(127); - if (setuid(getuid()) == -1) - _exit(127); - if (*type == 'r') { - if (pdes[1] != 1) { - /* stdout */ - dup2(pdes[1], 1); - close(pdes[1]); - } - close(pdes[0]); - } else { - if (pdes[0] != 0) { - /* stdin */ - dup2(pdes[0], 0); - close(pdes[0]); - } - close(pdes[1]); - } - - #ifdef NX_TRANS_SOCKET - - /* - * Check if the child process should not - * use the parent's libraries. - */ - - if (_NXUnsetLibraryPath) - { - #ifndef __sun - - unsetenv ("LD_LIBRARY_PATH"); - - #else - - extern char **environ; - - char **ep = environ; - - ep = environ; - - while (*ep) - { - if (!strncmp("LD_LIBRARY_PATH=", *ep, strlen("LD_LIBRARY_PATH="))) - { - break; - } - - *ep++; - } - - while (*ep) - { - *ep = *(ep + 1); - ep++; - } - - #endif - } - - #endif - - #ifdef NX_TRANS_EXIT - OsReleaseSignals (); - #endif - - execl("/bin/sh", "sh", "-c", command, (char *)NULL); - _exit(127); - } - -#ifndef NX_TRANS_EXIT - /* Avoid EINTR during stdio calls */ - OsBlockSignals (); -#endif - - /* parent */ - if (*type == 'r') { - iop = fdopen(pdes[0], type); - close(pdes[1]); - } else { - iop = fdopen(pdes[1], type); - close(pdes[0]); - } - - cur->fp = iop; - cur->pid = pid; - cur->next = pidlist; - pidlist = cur; - -#ifdef DEBUG - ErrorF("Popen: `%s', fp = %p\n", command, iop); -#endif - - return iop; -} - -/* fopen that drops privileges */ -pointer -Fopen(char *file, char *type) -{ - FILE *iop; -#ifndef HAS_SAVED_IDS_AND_SETEUID - struct pid *cur; - int pdes[2], pid; - - if (file == NULL || type == NULL) - return NULL; - - if ((*type != 'r' && *type != 'w') || type[1]) - return NULL; - - if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL) - return NULL; - - if (pipe(pdes) < 0) { - xfree(cur); - return NULL; - } - - switch (pid = fork()) { - case -1: /* error */ - close(pdes[0]); - close(pdes[1]); - xfree(cur); - return NULL; - case 0: /* child */ - if (setgid(getgid()) == -1) - _exit(127); - if (setuid(getuid()) == -1) - _exit(127); - if (*type == 'r') { - if (pdes[1] != 1) { - /* stdout */ - dup2(pdes[1], 1); - close(pdes[1]); - } - close(pdes[0]); - } else { - if (pdes[0] != 0) { - /* stdin */ - dup2(pdes[0], 0); - close(pdes[0]); - } - close(pdes[1]); - } - execl("/bin/cat", "cat", file, (char *)NULL); - _exit(127); - } - - /* Avoid EINTR during stdio calls */ - OsBlockSignals (); - - /* parent */ - if (*type == 'r') { - iop = fdopen(pdes[0], type); - close(pdes[1]); - } else { - iop = fdopen(pdes[1], type); - close(pdes[0]); - } - - cur->fp = iop; - cur->pid = pid; - cur->next = pidlist; - pidlist = cur; - -#ifdef DEBUG - ErrorF("Popen: `%s', fp = %p\n", command, iop); -#endif - - return iop; -#else - int ruid, euid; - - ruid = getuid(); - euid = geteuid(); - - if (seteuid(ruid) == -1) { - return NULL; - } - iop = fopen(file, type); - - if (seteuid(euid) == -1) { - fclose(iop); - return NULL; - } - return iop; -#endif /* HAS_SAVED_IDS_AND_SETEUID */ -} - -int -Pclose(pointer iop) -{ - struct pid *cur, *last; - int pstat; - int pid; - -#ifdef DEBUG - ErrorF("Pclose: fp = %p\n", iop); -#endif - - fclose(iop); - - for (last = NULL, cur = pidlist; cur; last = cur, cur = cur->next) - if (cur->fp == iop) - break; - if (cur == NULL) - return -1; - - do { - pid = waitpid(cur->pid, &pstat, 0); - } while (pid == -1 && errno == EINTR); - - if (last == NULL) - pidlist = cur->next; - else - last->next = cur->next; - xfree(cur); - - /* allow EINTR again */ - OsReleaseSignals (); - -#ifdef NX_TRANS_EXIT - if (OsVendorEndRedirectErrorFProc != NULL) { - OsVendorEndRedirectErrorFProc(); - } -#endif - return pid == -1 ? -1 : pstat; -} - -int -Fclose(pointer iop) -{ -#ifdef HAS_SAVED_IDS_AND_SETEUID - return fclose(iop); -#else - return Pclose(iop); -#endif -} - -#endif /* !WIN32 && !__UNIXOS2__ */ - - -/* - * CheckUserParameters: check for long command line arguments and long - * environment variables. By default, these checks are only done when - * the server's euid != ruid. In 3.3.x, these checks were done in an - * external wrapper utility. - */ - -/* Consider LD* variables insecure? */ -#ifndef REMOVE_ENV_LD -#define REMOVE_ENV_LD 1 -#endif - -/* Remove long environment variables? */ -#ifndef REMOVE_LONG_ENV -#define REMOVE_LONG_ENV 1 -#endif - -/* - * Disallow stdout or stderr as pipes? It's possible to block the X server - * when piping stdout+stderr to a pipe. - * - * Don't enable this because it looks like it's going to cause problems. - */ -#ifndef NO_OUTPUT_PIPES -#define NO_OUTPUT_PIPES 0 -#endif - - -/* Check args and env only if running setuid (euid == 0 && euid != uid) ? */ -#ifndef CHECK_EUID -#ifndef WIN32 -#define CHECK_EUID 1 -#else -#define CHECK_EUID 0 -#endif -#endif - -/* - * Maybe the locale can be faked to make isprint(3) report that everything - * is printable? Avoid it by default. - */ -#ifndef USE_ISPRINT -#define USE_ISPRINT 0 -#endif - -#define MAX_ARG_LENGTH 128 -#define MAX_ENV_LENGTH 256 -#define MAX_ENV_PATH_LENGTH 2048 /* Limit for *PATH and TERMCAP */ - -#if USE_ISPRINT -#include -#define checkPrintable(c) isprint(c) -#else -#define checkPrintable(c) (((c) & 0x7f) >= 0x20 && ((c) & 0x7f) != 0x7f) -#endif - -enum BadCode { - NotBad = 0, - UnsafeArg, - ArgTooLong, - UnprintableArg, - EnvTooLong, - OutputIsPipe, - InternalError -}; - -#if defined(VENDORSUPPORT) -#define BUGADDRESS VENDORSUPPORT -#elif defined(BUILDERADDR) -#define BUGADDRESS BUILDERADDR -#else -#define BUGADDRESS "xorg@freedesktop.org" -#endif - -#define ARGMSG \ - "\nIf the arguments used are valid, and have been rejected incorrectly\n" \ - "please send details of the arguments and why they are valid to\n" \ - "%s. In the meantime, you can start the Xserver as\n" \ - "the \"super user\" (root).\n" - -#define ENVMSG \ - "\nIf the environment is valid, and have been rejected incorrectly\n" \ - "please send details of the environment and why it is valid to\n" \ - "%s. In the meantime, you can start the Xserver as\n" \ - "the \"super user\" (root).\n" - -void -CheckUserParameters(int argc, char **argv, char **envp) -{ - enum BadCode bad = NotBad; - int i = 0, j; - char *a, *e = NULL; -#if defined(__QNX__) && !defined(__QNXNTO__) - char cmd_name[64]; -#endif - -#if CHECK_EUID - if (geteuid() == 0 && getuid() != geteuid()) -#endif - { - /* Check each argv[] */ - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-fp") == 0) - { - i++; /* continue with next argument. skip the length check */ - if (i >= argc) - break; - } else - { - if (strlen(argv[i]) > MAX_ARG_LENGTH) { - bad = ArgTooLong; - break; - } - } - a = argv[i]; - while (*a) { - if (checkPrintable(*a) == 0) { - bad = UnprintableArg; - break; - } - a++; - } - if (bad) - break; - } - if (!bad) { - /* Check each envp[] */ - for (i = 0; envp[i]; i++) { - - /* Check for bad environment variables and values */ -#if REMOVE_ENV_LD - while (envp[i] && (strncmp(envp[i], "LD", 2) == 0)) { -#ifdef ENVDEBUG - ErrorF("CheckUserParameters: removing %s from the " - "environment\n", strtok(envp[i], "=")); -#endif - for (j = i; envp[j]; j++) { - envp[j] = envp[j+1]; - } - } -#endif - if (envp[i] && (strlen(envp[i]) > MAX_ENV_LENGTH)) { -#if REMOVE_LONG_ENV -#ifdef ENVDEBUG - ErrorF("CheckUserParameters: removing %s from the " - "environment\n", strtok(envp[i], "=")); -#endif - for (j = i; envp[j]; j++) { - envp[j] = envp[j+1]; - } - i--; -#else - char *eq; - int len; - - eq = strchr(envp[i], '='); - if (!eq) - continue; - len = eq - envp[i]; - e = malloc(len + 1); - if (!e) { - bad = InternalError; - break; - } - strncpy(e, envp[i], len); - e[len] = 0; - if (len >= 4 && - (strcmp(e + len - 4, "PATH") == 0 || - strcmp(e, "TERMCAP") == 0)) { - if (strlen(envp[i]) > MAX_ENV_PATH_LENGTH) { - bad = EnvTooLong; - break; - } else { - free(e); - } - } else { - bad = EnvTooLong; - break; - } -#endif - } - } - } -#if NO_OUTPUT_PIPES - if (!bad) { - struct stat buf; - - if (fstat(fileno(stdout), &buf) == 0 && S_ISFIFO(buf.st_mode)) - bad = OutputIsPipe; - if (fstat(fileno(stderr), &buf) == 0 && S_ISFIFO(buf.st_mode)) - bad = OutputIsPipe; - } -#endif - } - switch (bad) { - case NotBad: - return; - case UnsafeArg: - ErrorF("Command line argument number %d is unsafe\n", i); - ErrorF(ARGMSG, BUGADDRESS); - break; - case ArgTooLong: - ErrorF("Command line argument number %d is too long\n", i); - ErrorF(ARGMSG, BUGADDRESS); - break; - case UnprintableArg: - ErrorF("Command line argument number %d contains unprintable" - " characters\n", i); - ErrorF(ARGMSG, BUGADDRESS); - break; - case EnvTooLong: - ErrorF("Environment variable `%s' is too long\n", e); - ErrorF(ENVMSG, BUGADDRESS); - break; - case OutputIsPipe: - ErrorF("Stdout and/or stderr is a pipe\n"); - break; - case InternalError: - ErrorF("Internal Error\n"); - break; - default: - ErrorF("Unknown error\n"); - ErrorF(ARGMSG, BUGADDRESS); - ErrorF(ENVMSG, BUGADDRESS); - break; - } - FatalError("X server aborted because of unsafe environment\n"); -} - -/* - * CheckUserAuthorization: check if the user is allowed to start the - * X server. This usually means some sort of PAM checking, and it is - * usually only done for setuid servers (uid != euid). - */ - -#ifdef USE_PAM -#include -#include -#include -#endif /* USE_PAM */ - -void -CheckUserAuthorization(void) -{ -#ifdef USE_PAM - static struct pam_conv conv = { - misc_conv, - NULL - }; - - pam_handle_t *pamh = NULL; - struct passwd *pw; - int retval; - - if (getuid() != geteuid()) { - pw = getpwuid(getuid()); - if (pw == NULL) - FatalError("getpwuid() failed for uid %d\n", getuid()); - - retval = pam_start("xserver", pw->pw_name, &conv, &pamh); - if (retval != PAM_SUCCESS) - FatalError("pam_start() failed.\n" - "\tMissing or mangled PAM config file or module?\n"); - - retval = pam_authenticate(pamh, 0); - if (retval != PAM_SUCCESS) { - pam_end(pamh, retval); - FatalError("PAM authentication failed, cannot start X server.\n" - "\tPerhaps you do not have console ownership?\n"); - } - - retval = pam_acct_mgmt(pamh, 0); - if (retval != PAM_SUCCESS) { - pam_end(pamh, retval); - FatalError("PAM authentication failed, cannot start X server.\n" - "\tPerhaps you do not have console ownership?\n"); - } - - /* this is not a session, so do not do session management */ - pam_end(pamh, PAM_SUCCESS); - } -#endif -} - -#ifdef __SCO__ -#include - -static void -lockit (int fd, short what) -{ - struct flock lck; - - lck.l_whence = 0; - lck.l_start = 0; - lck.l_len = 1; - lck.l_type = what; - - (void)fcntl (fd, F_SETLKW, &lck); -} - -/* SCO OpenServer 5 lacks pread/pwrite. Emulate them. */ -ssize_t -pread (int fd, void *buf, size_t nbytes, off_t offset) -{ - off_t saved; - ssize_t ret; - - lockit (fd, F_RDLCK); - saved = lseek (fd, 0, SEEK_CUR); - lseek (fd, offset, SEEK_SET); - ret = read (fd, buf, nbytes); - lseek (fd, saved, SEEK_SET); - lockit (fd, F_UNLCK); - - return ret; -} - -ssize_t -pwrite (int fd, const void *buf, size_t nbytes, off_t offset) -{ - off_t saved; - ssize_t ret; - - lockit (fd, F_WRLCK); - saved = lseek (fd, 0, SEEK_CUR); - lseek (fd, offset, SEEK_SET); - ret = write (fd, buf, nbytes); - lseek (fd, saved, SEEK_SET); - lockit (fd, F_UNLCK); - - return ret; -} -#endif /* __SCO__ */ diff --git a/nx-X11/programs/Xserver/os/utils.c.X.original b/nx-X11/programs/Xserver/os/utils.c.X.original deleted file mode 100644 index b0a806fd7..000000000 --- a/nx-X11/programs/Xserver/os/utils.c.X.original +++ /dev/null @@ -1,2296 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/os/utils.c,v 1.21 2005/11/08 06:33:30 jkj Exp $ */ -/* $Xorg: utils.c,v 1.5 2001/02/09 02:05:24 xorgcvs Exp $ */ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, -Copyright 1994 Quarterdeck Office Systems. - - 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 names of Digital and -Quarterdeck not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT -OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE -OR PERFORMANCE OF THIS SOFTWARE. - -*/ -/* $XFree86: xc/programs/Xserver/os/utils.c,v 3.96 2004/01/07 04:16:37 dawes Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef __CYGWIN__ -#include -#include -#endif - -#if defined(WIN32) && !defined(__CYGWIN__) -#include -#endif -#include -#include -#include "misc.h" -#include -#include -#include "input.h" -#include "dixfont.h" -#include "osdep.h" -#ifdef X_POSIX_C_SOURCE -#define _POSIX_C_SOURCE X_POSIX_C_SOURCE -#include -#undef _POSIX_C_SOURCE -#else -#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE) -#include -#else -#define _POSIX_SOURCE -#include -#undef _POSIX_SOURCE -#endif -#endif -#ifndef WIN32 -#include -#endif -#if !defined(SYSV) && !defined(WIN32) && !defined(Lynx) && !defined(QNX4) -#include -#endif -#include -#include -#include /* for isspace */ -#include - -#if defined(DGUX) -#include -#include -#endif - -#include /* for malloc() */ - -#if defined(TCPCONN) || defined(STREAMSCONN) -# ifndef WIN32 -# include -# endif -#endif - -#include "opaque.h" - -#ifdef SMART_SCHEDULE -#include "dixstruct.h" -#endif - -#ifdef XKB -#include -#endif -#ifdef XCSECURITY -#define _SECURITY_SERVER -#include -#endif - -#ifdef RENDER -#include "picture.h" -#endif - -#ifdef XPRINT -#include "DiPrint.h" -#endif - -Bool noTestExtensions; -#ifdef BIGREQS -Bool noBigReqExtension = FALSE; -#endif -#ifdef COMPOSITE -/* COMPOSITE is disabled by default for now until the - * interface is stable */ -Bool noCompositeExtension = TRUE; -#endif -#ifdef DAMAGE -Bool noDamageExtension = FALSE; -#endif -#ifdef DBE -Bool noDbeExtension = FALSE; -#endif -#ifdef DPSEXT -Bool noDPSExtension = FALSE; -#endif -#ifdef DPMSExtension -Bool noDPMSExtension = FALSE; -#endif -#ifdef EVI -Bool noEVIExtension = FALSE; -#endif -#ifdef FONTCACHE -Bool noFontCacheExtension = FALSE; -#endif -#ifdef GLXEXT -Bool noGlxExtension = FALSE; -#endif -#ifdef LBX -Bool noLbxExtension = FALSE; -#endif -#ifdef SCREENSAVER -Bool noScreenSaverExtension = FALSE; -#endif -#ifdef MITSHM -Bool noMITShmExtension = FALSE; -#endif -#ifdef MITMISC -Bool noMITMiscExtension = FALSE; -#endif -#ifdef MULTIBUFFER -Bool noMultibufferExtension = FALSE; -#endif -#ifdef RANDR -Bool noRRExtension = FALSE; -#endif -#ifdef RENDER -Bool noRenderExtension = FALSE; -#endif -#ifdef SHAPE -Bool noShapeExtension = FALSE; -#endif -#ifdef XCSECURITY -Bool noSecurityExtension = FALSE; -#endif -#ifdef XSYNC -Bool noSyncExtension = FALSE; -#endif -#ifdef TOGCUP -Bool noXcupExtension = FALSE; -#endif -#ifdef RES -Bool noResExtension = FALSE; -#endif -#ifdef XAPPGROUP -Bool noXagExtension = FALSE; -#endif -#ifdef XCMISC -Bool noXCMiscExtension = FALSE; -#endif -#ifdef XEVIE -/* Xevie is disabled by default for now until the - * interface is stable */ -Bool noXevieExtension = TRUE; -#endif -#ifdef XF86BIGFONT -Bool noXFree86BigfontExtension = FALSE; -#endif -#ifdef XFreeXDGA -Bool noXFree86DGAExtension = FALSE; -#endif -#ifdef XF86DRI -Bool noXFree86DRIExtension = FALSE; -#endif -#ifdef XF86MISC -Bool noXFree86MiscExtension = FALSE; -#endif -#ifdef XF86VIDMODE -Bool noXFree86VidModeExtension = FALSE; -#endif -#ifdef XFIXES -Bool noXFixesExtension = FALSE; -#endif -/* |noXkbExtension| is defined in xc/programs/Xserver/xkb/xkbInit.c */ -#ifdef PANORAMIX -/* Xinerama is disabled by default unless enabled via +xinerama */ -Bool noPanoramiXExtension = TRUE; -#endif -#ifdef XINPUT -Bool noXInputExtension = FALSE; -#endif -#ifdef XIDLE -Bool noXIdleExtension = FALSE; -#endif -#ifdef XV -Bool noXvExtension = FALSE; -#endif - -#define X_INCLUDE_NETDB_H -#include - -#include - -Bool CoreDump; - -#ifdef PANORAMIX -Bool PanoramiXVisibilityNotifySent = FALSE; -Bool PanoramiXMapped = FALSE; -Bool PanoramiXWindowExposureSent = FALSE; -Bool PanoramiXOneExposeRequest = FALSE; -Bool PanoramiXExtensionDisabledHack = FALSE; -#endif - -int auditTrailLevel = 1; - -Bool Must_have_memory = FALSE; - -#ifdef AIXV3 -int SyncOn = 0; -extern int SelectWaitTime; -#endif - -#ifdef DEBUG -#ifndef SPECIAL_MALLOC -#define MEMBUG -#endif -#endif - -#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED) -#define HAS_SAVED_IDS_AND_SETEUID -#endif - -#ifdef MEMBUG -#define MEM_FAIL_SCALE 100000 -long Memory_fail = 0; -#include /* for random() */ -#endif - -#ifdef sgi -int userdefinedfontpath = 0; -#endif /* sgi */ - -char *dev_tty_from_init = NULL; /* since we need to parse it anyway */ - -extern char dispatchExceptionAtReset; - -/* Extension enable/disable in miinitext.c */ -extern Bool EnableDisableExtension(char *name, Bool enable); -extern void EnableDisableExtensionError(char *name, Bool enable); - -OsSigHandlerPtr -OsSignal(sig, handler) - int sig; - OsSigHandlerPtr handler; -{ -#ifdef X_NOT_POSIX - return signal(sig, handler); -#else - struct sigaction act, oact; - - sigemptyset(&act.sa_mask); - if (handler != SIG_IGN) - sigaddset(&act.sa_mask, sig); - act.sa_flags = 0; - act.sa_handler = handler; - sigaction(sig, &act, &oact); - return oact.sa_handler; -#endif -} - -#ifdef SERVER_LOCK -/* - * Explicit support for a server lock file like the ones used for UUCP. - * For architectures with virtual terminals that can run more than one - * server at a time. This keeps the servers from stomping on each other - * if the user forgets to give them different display numbers. - */ -#ifndef __UNIXOS2__ -#define LOCK_DIR "/tmp" -#endif -#define LOCK_TMP_PREFIX "/.tX" -#define LOCK_PREFIX "/.X" -#define LOCK_SUFFIX "-lock" - -#if defined(DGUX) -#include -#include -#endif - -#ifdef __UNIXOS2__ -#define link rename -#endif - -#ifndef PATH_MAX -#ifndef Lynx -#include -#else -#include -#endif -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif -#endif -#endif - -static Bool StillLocking = FALSE; -static char LockFile[PATH_MAX]; -static Bool nolock = FALSE; - -/* - * LockServer -- - * Check if the server lock file exists. If so, check if the PID - * contained inside is valid. If so, then die. Otherwise, create - * the lock file containing the PID. - */ -void -LockServer(void) -{ - char tmp[PATH_MAX], pid_str[12]; - int lfd, i, haslock, l_pid, t; - char *tmppath = NULL; - int len; - char port[20]; - - if (nolock) return; - /* - * Path names - */ -#ifndef __UNIXOS2__ - tmppath = LOCK_DIR; -#else - /* OS/2 uses TMP directory, must also prepare for 8.3 names */ - tmppath = getenv("TMP"); - if (!tmppath) - FatalError("No TMP dir found\n"); -#endif - - sprintf(port, "%d", atoi(display)); - len = strlen(LOCK_PREFIX) > strlen(LOCK_TMP_PREFIX) ? strlen(LOCK_PREFIX) : - strlen(LOCK_TMP_PREFIX); - len += strlen(tmppath) + strlen(port) + strlen(LOCK_SUFFIX) + 1; - if (len > sizeof(LockFile)) - FatalError("Display name `%s' is too long\n", port); - (void)sprintf(tmp, "%s" LOCK_TMP_PREFIX "%s" LOCK_SUFFIX, tmppath, port); - (void)sprintf(LockFile, "%s" LOCK_PREFIX "%s" LOCK_SUFFIX, tmppath, port); - - /* - * Create a temporary file containing our PID. Attempt three times - * to create the file. - */ - StillLocking = TRUE; - i = 0; - do { - i++; - lfd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0644); - if (lfd < 0) - sleep(2); - else - break; - } while (i < 3); - if (lfd < 0) { - unlink(tmp); - i = 0; - do { - i++; - lfd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0644); - if (lfd < 0) - sleep(2); - else - break; - } while (i < 3); - } - if (lfd < 0) - FatalError("Could not create lock file in %s\n", tmp); - (void) sprintf(pid_str, "%10ld\n", (long)getpid()); - (void) write(lfd, pid_str, 11); -#ifndef __UNIXOS2__ -#ifndef USE_CHMOD - (void) fchmod(lfd, 0444); -#else - (void) chmod(tmp, 0444); -#endif -#endif - (void) close(lfd); - - /* - * OK. Now the tmp file exists. Try three times to move it in place - * for the lock. - */ - i = 0; - haslock = 0; - while ((!haslock) && (i++ < 3)) { - haslock = (link(tmp,LockFile) == 0); - if (haslock) { - /* - * We're done. - */ - break; - } - else { - /* - * Read the pid from the existing file - */ - lfd = open(LockFile, O_RDONLY); - if (lfd < 0) { - unlink(tmp); - FatalError("Can't read lock file %s\n", LockFile); - } - pid_str[0] = '\0'; - if (read(lfd, pid_str, 11) != 11) { - /* - * Bogus lock file. - */ - unlink(LockFile); - close(lfd); - continue; - } - pid_str[11] = '\0'; - sscanf(pid_str, "%d", &l_pid); - close(lfd); - - /* - * Now try to kill the PID to see if it exists. - */ - errno = 0; - t = kill(l_pid, 0); - if ((t< 0) && (errno == ESRCH)) { - /* - * Stale lock file. - */ - unlink(LockFile); - continue; - } - else if (((t < 0) && (errno == EPERM)) || (t == 0)) { - /* - * Process is still active. - */ - unlink(tmp); - FatalError("Server is already active for display %s\n%s %s\n%s\n", - port, "\tIf this server is no longer running, remove", - LockFile, "\tand start again."); - } - } - } - unlink(tmp); - if (!haslock) - FatalError("Could not create server lock file: %s\n", LockFile); - StillLocking = FALSE; -} - -/* - * UnlockServer -- - * Remove the server lock file. - */ -void -UnlockServer(void) -{ - if (nolock) return; - - if (!StillLocking){ - -#ifdef __UNIXOS2__ - (void) chmod(LockFile,S_IREAD|S_IWRITE); -#endif /* __UNIXOS2__ */ - (void) unlink(LockFile); - } -} -#endif /* SERVER_LOCK */ - -/* Force connections to close on SIGHUP from init */ - -/*ARGSUSED*/ -SIGVAL -AutoResetServer (int sig) -{ - int olderrno = errno; - - dispatchException |= DE_RESET; - isItTimeToYield = TRUE; -#ifdef GPROF - chdir ("/tmp"); - exit (0); -#endif -#if defined(SYSV) && defined(X_NOT_POSIX) - OsSignal (SIGHUP, AutoResetServer); -#endif - errno = olderrno; -} - -/* Force connections to close and then exit on SIGTERM, SIGINT */ - -/*ARGSUSED*/ -SIGVAL -GiveUp(int sig) -{ - int olderrno = errno; - - dispatchException |= DE_TERMINATE; - isItTimeToYield = TRUE; -#if defined(SYSV) && defined(X_NOT_POSIX) - if (sig) - OsSignal(sig, SIG_IGN); -#endif - errno = olderrno; -} - -#ifndef DDXTIME -CARD32 -GetTimeInMillis(void) -{ - struct timeval tp; - - X_GETTIMEOFDAY(&tp); - return(tp.tv_sec * 1000) + (tp.tv_usec / 1000); -} -#endif - -void -AdjustWaitForDelay (pointer waitTime, unsigned long newdelay) -{ - static struct timeval delay_val; - struct timeval **wt = (struct timeval **) waitTime; - unsigned long olddelay; - - if (*wt == NULL) - { - delay_val.tv_sec = newdelay / 1000; - delay_val.tv_usec = 1000 * (newdelay % 1000); - *wt = &delay_val; - } - else - { - olddelay = (*wt)->tv_sec * 1000 + (*wt)->tv_usec / 1000; - if (newdelay < olddelay) - { - (*wt)->tv_sec = newdelay / 1000; - (*wt)->tv_usec = 1000 * (newdelay % 1000); - } - } -} - -void UseMsg(void) -{ -#if !defined(AIXrt) && !defined(AIX386) - ErrorF("use: X [:] [option]\n"); - ErrorF("-a # mouse acceleration (pixels)\n"); - ErrorF("-ac disable access control restrictions\n"); -#ifdef MEMBUG - ErrorF("-alloc int chance alloc should fail\n"); -#endif - ErrorF("-audit int set audit trail level\n"); - ErrorF("-auth file select authorization file\n"); - ErrorF("bc enable bug compatibility\n"); - ErrorF("-br create root window with black background\n"); - ErrorF("+bs enable any backing store support\n"); - ErrorF("-bs disable any backing store support\n"); - ErrorF("-c turns off key-click\n"); - ErrorF("c # key-click volume (0-100)\n"); - ErrorF("-cc int default color visual class\n"); - ErrorF("-co file color database file\n"); -#ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS - ErrorF("-config file read options from file\n"); -#endif - ErrorF("-core generate core dump on fatal error\n"); - ErrorF("-dpi int screen resolution in dots per inch\n"); -#ifdef DPMSExtension - ErrorF("dpms enables VESA DPMS monitor control\n"); - ErrorF("-dpms disables VESA DPMS monitor control\n"); -#endif - ErrorF("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n"); - ErrorF("-f # bell base (0-100)\n"); - ErrorF("-fc string cursor font\n"); - ErrorF("-fn string default font name\n"); - ErrorF("-fp string default font path\n"); - ErrorF("-help prints message with these options\n"); - ErrorF("-I ignore all remaining arguments\n"); -#ifdef RLIMIT_DATA - ErrorF("-ld int limit data space to N Kb\n"); -#endif -#ifdef RLIMIT_NOFILE - ErrorF("-lf int limit number of open files to N\n"); -#endif -#ifdef RLIMIT_STACK - ErrorF("-ls int limit stack space to N Kb\n"); -#endif -#ifdef SERVER_LOCK - ErrorF("-nolock disable the locking mechanism\n"); -#endif -#ifndef NOLOGOHACK - ErrorF("-logo enable logo in screen saver\n"); - ErrorF("nologo disable logo in screen saver\n"); -#endif - ErrorF("-nolisten string don't listen on protocol\n"); - ErrorF("-noreset don't reset after last client exists\n"); - ErrorF("-reset reset after last client exists\n"); - ErrorF("-p # screen-saver pattern duration (minutes)\n"); - ErrorF("-pn accept failure to listen on all ports\n"); - ErrorF("-nopn reject failure to listen on all ports\n"); - ErrorF("-r turns off auto-repeat\n"); - ErrorF("r turns on auto-repeat \n"); -#ifdef RENDER - ErrorF("-render [default|mono|gray|color] set render color alloc policy\n"); -#endif - ErrorF("-s # screen-saver timeout (minutes)\n"); -#ifdef XCSECURITY - ErrorF("-sp file security policy file\n"); -#endif -#ifdef XPRINT - PrinterUseMsg(); -#endif - ErrorF("-su disable any save under support\n"); - ErrorF("-t # mouse threshold (pixels)\n"); - ErrorF("-terminate terminate at server reset\n"); - ErrorF("-to # connection time out\n"); - ErrorF("-tst disable testing extensions\n"); - ErrorF("ttyxx server started from init on /dev/ttyxx\n"); - ErrorF("v video blanking for screen-saver\n"); - ErrorF("-v screen-saver without video blanking\n"); - ErrorF("-wm WhenMapped default backing-store\n"); - ErrorF("-x string loads named extension at init time \n"); - ErrorF("-maxbigreqsize set maximal bigrequest size \n"); -#ifdef PANORAMIX - ErrorF("+xinerama Enable XINERAMA extension\n"); - ErrorF("-xinerama Disable XINERAMA extension\n"); -#endif -#ifdef SMART_SCHEDULE - ErrorF("-dumbSched Disable smart scheduling, enable old behavior\n"); - ErrorF("-schedInterval int Set scheduler interval in msec\n"); -#endif - ErrorF("+extension name Enable extension\n"); - ErrorF("-extension name Disable extension\n"); -#ifdef XDMCP - XdmcpUseMsg(); -#endif -#endif /* !AIXrt && ! AIX386 */ -#ifdef XKB - XkbUseMsg(); -#endif - ddxUseMsg(); -} - -/* This function performs a rudimentary sanity check - * on the display name passed in on the command-line, - * since this string is used to generate filenames. - * It is especially important that the display name - * not contain a "/" and not start with a "-". - * --kvajk - */ -static int -VerifyDisplayName(const char *d) -{ - if ( d == (char *)0 ) return( 0 ); /* null */ - if ( *d == '\0' ) return( 0 ); /* empty */ - if ( *d == '-' ) return( 0 ); /* could be confused for an option */ - if ( *d == '.' ) return( 0 ); /* must not equal "." or ".." */ - if ( strchr(d, '/') != (char *)0 ) return( 0 ); /* very important!!! */ - return( 1 ); -} - -/* - * This function is responsible for doing initalisation of any global - * variables at an very early point of server startup (even before - * |ProcessCommandLine()|. - */ -void InitGlobals(void) -{ - ddxInitGlobals(); -} - - -/* - * This function parses the command line. Handles device-independent fields - * and allows ddx to handle additional fields. It is not allowed to modify - * argc or any of the strings pointed to by argv. - */ -void -ProcessCommandLine(int argc, char *argv[]) -{ - int i, skip; - - defaultKeyboardControl.autoRepeat = TRUE; - -#ifdef NO_PART_NET - PartialNetwork = FALSE; -#else - PartialNetwork = TRUE; -#endif - - for ( i = 1; i < argc; i++ ) - { - /* call ddx first, so it can peek/override if it wants */ - if((skip = ddxProcessArgument(argc, argv, i))) - { - i += (skip - 1); - } - else if(argv[i][0] == ':') - { - /* initialize display */ - display = argv[i]; - display++; - if( ! VerifyDisplayName( display ) ) { - ErrorF("Bad display name: %s\n", display); - UseMsg(); - FatalError("Bad display name, exiting: %s\n", display); - } - } - else if ( strcmp( argv[i], "-a") == 0) - { - if(++i < argc) - defaultPointerControl.num = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-ac") == 0) - { - defeatAccessControl = TRUE; - } -#ifdef MEMBUG - else if ( strcmp( argv[i], "-alloc") == 0) - { - if(++i < argc) - Memory_fail = atoi(argv[i]); - else - UseMsg(); - } -#endif - else if ( strcmp( argv[i], "-audit") == 0) - { - if(++i < argc) - auditTrailLevel = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-auth") == 0) - { - if(++i < argc) - InitAuthorization (argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "bc") == 0) - permitOldBugs = TRUE; - else if ( strcmp( argv[i], "-br") == 0) - blackRoot = TRUE; - else if ( strcmp( argv[i], "+bs") == 0) - enableBackingStore = TRUE; - else if ( strcmp( argv[i], "-bs") == 0) - disableBackingStore = TRUE; - else if ( strcmp( argv[i], "c") == 0) - { - if(++i < argc) - defaultKeyboardControl.click = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-c") == 0) - { - defaultKeyboardControl.click = 0; - } - else if ( strcmp( argv[i], "-cc") == 0) - { - if(++i < argc) - defaultColorVisualClass = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-co") == 0) - { - if(++i < argc) - rgbPath = argv[i]; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-core") == 0) - CoreDump = TRUE; - else if ( strcmp( argv[i], "-dpi") == 0) - { - if(++i < argc) - monitorResolution = atoi(argv[i]); - else - UseMsg(); - } -#ifdef DPMSExtension - else if ( strcmp( argv[i], "dpms") == 0) - DPMSEnabledSwitch = TRUE; - else if ( strcmp( argv[i], "-dpms") == 0) - DPMSDisabledSwitch = TRUE; -#endif - else if ( strcmp( argv[i], "-deferglyphs") == 0) - { - if(++i >= argc || !ParseGlyphCachingMode(argv[i])) - UseMsg(); - } - else if ( strcmp( argv[i], "-f") == 0) - { - if(++i < argc) - defaultKeyboardControl.bell = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-fc") == 0) - { - if(++i < argc) - defaultCursorFont = argv[i]; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-fn") == 0) - { - if(++i < argc) - defaultTextFont = argv[i]; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-fp") == 0) - { - if(++i < argc) - { -#ifdef sgi - userdefinedfontpath = 1; -#endif /* sgi */ - defaultFontPath = argv[i]; - } - else - UseMsg(); - } - else if ( strcmp( argv[i], "-help") == 0) - { - UseMsg(); - exit(0); - } -#ifdef XKB - else if ( (skip=XkbProcessArguments(argc,argv,i))!=0 ) { - if (skip>0) - i+= skip-1; - else UseMsg(); - } -#endif -#ifdef RLIMIT_DATA - else if ( strcmp( argv[i], "-ld") == 0) - { - if(++i < argc) - { - limitDataSpace = atoi(argv[i]); - if (limitDataSpace > 0) - limitDataSpace *= 1024; - } - else - UseMsg(); - } -#endif -#ifdef RLIMIT_NOFILE - else if ( strcmp( argv[i], "-lf") == 0) - { - if(++i < argc) - limitNoFile = atoi(argv[i]); - else - UseMsg(); - } -#endif -#ifdef RLIMIT_STACK - else if ( strcmp( argv[i], "-ls") == 0) - { - if(++i < argc) - { - limitStackSpace = atoi(argv[i]); - if (limitStackSpace > 0) - limitStackSpace *= 1024; - } - else - UseMsg(); - } -#endif -#ifdef SERVER_LOCK - else if ( strcmp ( argv[i], "-nolock") == 0) - { -#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__) - if (getuid() != 0) - ErrorF("Warning: the -nolock option can only be used by root\n"); - else -#endif - nolock = TRUE; - } -#endif -#ifndef NOLOGOHACK - else if ( strcmp( argv[i], "-logo") == 0) - { - logoScreenSaver = 1; - } - else if ( strcmp( argv[i], "nologo") == 0) - { - logoScreenSaver = 0; - } -#endif - else if ( strcmp( argv[i], "-nolisten") == 0) - { - if(++i < argc) { - if (_XSERVTransNoListen(argv[i])) - FatalError ("Failed to disable listen for %s transport", - argv[i]); - } else - UseMsg(); - } - else if ( strcmp( argv[i], "-noreset") == 0) - { - dispatchExceptionAtReset = 0; - } - else if ( strcmp( argv[i], "-reset") == 0) - { - dispatchExceptionAtReset = DE_RESET; - } - else if ( strcmp( argv[i], "-p") == 0) - { - if(++i < argc) - defaultScreenSaverInterval = ((CARD32)atoi(argv[i])) * - MILLI_PER_MIN; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-pn") == 0) - PartialNetwork = TRUE; - else if ( strcmp( argv[i], "-nopn") == 0) - PartialNetwork = FALSE; - else if ( strcmp( argv[i], "r") == 0) - defaultKeyboardControl.autoRepeat = TRUE; - else if ( strcmp( argv[i], "-r") == 0) - defaultKeyboardControl.autoRepeat = FALSE; - else if ( strcmp( argv[i], "-s") == 0) - { - if(++i < argc) - defaultScreenSaverTime = ((CARD32)atoi(argv[i])) * - MILLI_PER_MIN; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-su") == 0) - disableSaveUnders = TRUE; - else if ( strcmp( argv[i], "-t") == 0) - { - if(++i < argc) - defaultPointerControl.threshold = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-terminate") == 0) - { - dispatchExceptionAtReset = DE_TERMINATE; - } - else if ( strcmp( argv[i], "-to") == 0) - { - if(++i < argc) - TimeOutValue = ((CARD32)atoi(argv[i])) * MILLI_PER_SECOND; - else - UseMsg(); - } - else if ( strcmp( argv[i], "-tst") == 0) - { - noTestExtensions = TRUE; - } - else if ( strcmp( argv[i], "v") == 0) - defaultScreenSaverBlanking = PreferBlanking; - else if ( strcmp( argv[i], "-v") == 0) - defaultScreenSaverBlanking = DontPreferBlanking; - else if ( strcmp( argv[i], "-wm") == 0) - defaultBackingStore = WhenMapped; - else if ( strcmp( argv[i], "-maxbigreqsize") == 0) { - if(++i < argc) { - long reqSizeArg = atol(argv[i]); - - /* Request size > 128MB does not make much sense... */ - if( reqSizeArg > 0L && reqSizeArg < 128L ) { - maxBigRequestSize = (reqSizeArg * 1048576L) - 1L; - } - else - { - UseMsg(); - } - } - else - { - UseMsg(); - } - } -#ifdef PANORAMIX - else if ( strcmp( argv[i], "+xinerama") == 0){ - noPanoramiXExtension = FALSE; - } - else if ( strcmp( argv[i], "-xinerama") == 0){ - noPanoramiXExtension = TRUE; - } - else if ( strcmp( argv[i], "-disablexineramaextension") == 0){ - PanoramiXExtensionDisabledHack = TRUE; - } -#endif - else if ( strcmp( argv[i], "-x") == 0) - { - if(++i >= argc) - UseMsg(); - /* For U**x, which doesn't support dynamic loading, there's nothing - * to do when we see a -x. Either the extension is linked in or - * it isn't */ - } - else if ( strcmp( argv[i], "-I") == 0) - { - /* ignore all remaining arguments */ - break; - } - else if (strncmp (argv[i], "tty", 3) == 0) - { - /* just in case any body is interested */ - dev_tty_from_init = argv[i]; - } -#ifdef XDMCP - else if ((skip = XdmcpOptions(argc, argv, i)) != i) - { - i = skip - 1; - } -#endif -#ifdef XPRINT - else if ((skip = PrinterOptions(argc, argv, i)) != i) - { - i = skip - 1; - } -#endif -#ifdef XCSECURITY - else if ((skip = XSecurityOptions(argc, argv, i)) != i) - { - i = skip - 1; - } -#endif -#ifdef AIXV3 - else if ( strcmp( argv[i], "-timeout") == 0) - { - if(++i < argc) - SelectWaitTime = atoi(argv[i]); - else - UseMsg(); - } - else if ( strcmp( argv[i], "-sync") == 0) - { - SyncOn++; - } -#endif -#ifdef SMART_SCHEDULE - else if ( strcmp( argv[i], "-dumbSched") == 0) - { - SmartScheduleDisable = TRUE; - } - else if ( strcmp( argv[i], "-schedInterval") == 0) - { - if (++i < argc) - { - SmartScheduleInterval = atoi(argv[i]); - SmartScheduleSlice = SmartScheduleInterval; - } - else - UseMsg(); - } - else if ( strcmp( argv[i], "-schedMax") == 0) - { - if (++i < argc) - { - SmartScheduleMaxSlice = atoi(argv[i]); - } - else - UseMsg(); - } -#endif -#ifdef RENDER - else if ( strcmp( argv[i], "-render" ) == 0) - { - if (++i < argc) - { - int policy = PictureParseCmapPolicy (argv[i]); - - if (policy != PictureCmapPolicyInvalid) - PictureCmapPolicy = policy; - else - UseMsg (); - } - else - UseMsg (); - } -#endif - else if ( strcmp( argv[i], "+extension") == 0) - { - if (++i < argc) - { - if (!EnableDisableExtension(argv[i], TRUE)) - EnableDisableExtensionError(argv[i], TRUE); - } - else - UseMsg(); - } - else if ( strcmp( argv[i], "-extension") == 0) - { - if (++i < argc) - { - if (!EnableDisableExtension(argv[i], FALSE)) - EnableDisableExtensionError(argv[i], FALSE); - } - else - UseMsg(); - } - else - { - ErrorF("Unrecognized option: %s\n", argv[i]); - UseMsg(); - FatalError("Unrecognized option: %s\n", argv[i]); - } - } -} - -#ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS -static void -InsertFileIntoCommandLine( - int *resargc, char ***resargv, - int prefix_argc, char **prefix_argv, - char *filename, - int suffix_argc, char **suffix_argv) -{ - struct stat st; - FILE *f; - char *p; - char *q; - int insert_argc; - char *buf; - int len; - int i; - - f = fopen(filename, "r"); - if (!f) - FatalError("Can't open option file %s\n", filename); - - fstat(fileno(f), &st); - - buf = (char *) xalloc((unsigned) st.st_size + 1); - if (!buf) - FatalError("Out of Memory\n"); - - len = fread(buf, 1, (unsigned) st.st_size, f); - - fclose(f); - - if (len < 0) - FatalError("Error reading option file %s\n", filename); - - buf[len] = '\0'; - - p = buf; - q = buf; - insert_argc = 0; - - while (*p) - { - while (isspace(*p)) - p++; - if (!*p) - break; - if (*p == '#') - { - while (*p && *p != '\n') - p++; - } else - { - while (*p && !isspace(*p)) - *q++ = *p++; - /* Since p and q might still be pointing at the same place, we */ - /* need to step p over the whitespace now before we add the null. */ - if (*p) - p++; - *q++ = '\0'; - insert_argc++; - } - } - - buf = (char *) xrealloc(buf, q - buf); - if (!buf) - FatalError("Out of memory reallocing option buf\n"); - - *resargc = prefix_argc + insert_argc + suffix_argc; - *resargv = (char **) xalloc((*resargc + 1) * sizeof(char *)); - if (!*resargv) - FatalError("Out of Memory\n"); - - memcpy(*resargv, prefix_argv, prefix_argc * sizeof(char *)); - - p = buf; - for (i = 0; i < insert_argc; i++) - { - (*resargv)[prefix_argc + i] = p; - p += strlen(p) + 1; - } - - memcpy(*resargv + prefix_argc + insert_argc, - suffix_argv, suffix_argc * sizeof(char *)); - - (*resargv)[*resargc] = NULL; -} /* end InsertFileIntoCommandLine */ - - -void -ExpandCommandLine(int *pargc, char ***pargv) -{ - int i; - -#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__) - if (getuid() != geteuid()) - return; -#endif - - for (i = 1; i < *pargc; i++) - { - if ( (0 == strcmp((*pargv)[i], "-config")) && (i < (*pargc - 1)) ) - { - InsertFileIntoCommandLine(pargc, pargv, - i, *pargv, - (*pargv)[i+1], /* filename */ - *pargc - i - 2, *pargv + i + 2); - i--; - } - } -} /* end ExpandCommandLine */ -#endif - -/* Implement a simple-minded font authorization scheme. The authorization - name is "hp-hostname-1", the contents are simply the host name. */ -int -set_font_authorizations(char **authorizations, int *authlen, pointer client) -{ -#define AUTHORIZATION_NAME "hp-hostname-1" -#if defined(TCPCONN) || defined(STREAMSCONN) - static char *result = NULL; - static char *p = NULL; - - if (p == NULL) - { - char hname[1024], *hnameptr; - unsigned int len; -#if defined(IPv6) && defined(AF_INET6) - struct addrinfo hints, *ai = NULL; -#else - struct hostent *host; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgethostbynameparams hparams; -#endif -#endif - - gethostname(hname, 1024); -#if defined(IPv6) && defined(AF_INET6) - bzero(&hints, sizeof(hints)); - hints.ai_flags = AI_CANONNAME; - if (getaddrinfo(hname, NULL, &hints, &ai) == 0) { - hnameptr = ai->ai_canonname; - } else { - hnameptr = hname; - } -#else - host = _XGethostbyname(hname, hparams); - if (host == NULL) - hnameptr = hname; - else - hnameptr = host->h_name; -#endif - - len = strlen(hnameptr) + 1; - result = xalloc(len + sizeof(AUTHORIZATION_NAME) + 4); - - p = result; - *p++ = sizeof(AUTHORIZATION_NAME) >> 8; - *p++ = sizeof(AUTHORIZATION_NAME) & 0xff; - *p++ = (len) >> 8; - *p++ = (len & 0xff); - - memmove(p, AUTHORIZATION_NAME, sizeof(AUTHORIZATION_NAME)); - p += sizeof(AUTHORIZATION_NAME); - memmove(p, hnameptr, len); - p += len; -#if defined(IPv6) && defined(AF_INET6) - if (ai) { - freeaddrinfo(ai); - } -#endif - } - *authlen = p - result; - *authorizations = result; - return 1; -#else /* TCPCONN */ - return 0; -#endif /* TCPCONN */ -} - -/* XALLOC -- X's internal memory allocator. Why does it return unsigned - * long * instead of the more common char *? Well, if you read K&R you'll - * see they say that alloc must return a pointer "suitable for conversion" - * to whatever type you really want. In a full-blown generic allocator - * there's no way to solve the alignment problems without potentially - * wasting lots of space. But we have a more limited problem. We know - * we're only ever returning pointers to structures which will have to - * be long word aligned. So we are making a stronger guarantee. It might - * have made sense to make Xalloc return char * to conform with people's - * expectations of malloc, but this makes lint happier. - */ - -#ifndef INTERNAL_MALLOC - -void * -Xalloc(unsigned long amount) -{ - register pointer ptr; - - if ((long)amount <= 0) { - return (unsigned long *)NULL; - } - /* aligned extra on long word boundary */ - amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); -#ifdef MEMBUG - if (!Must_have_memory && Memory_fail && - ((random() % MEM_FAIL_SCALE) < Memory_fail)) - return (unsigned long *)NULL; -#endif - if ((ptr = (pointer)malloc(amount))) { - return (unsigned long *)ptr; - } - if (Must_have_memory) - FatalError("Out of memory"); - return (unsigned long *)NULL; -} - -/***************** - * XNFalloc - * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory - *****************/ - -void * -XNFalloc(unsigned long amount) -{ - register pointer ptr; - - if ((long)amount <= 0) - { - return (unsigned long *)NULL; - } - /* aligned extra on long word boundary */ - amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); - ptr = (pointer)malloc(amount); - if (!ptr) - { - FatalError("Out of memory"); - } - return ((unsigned long *)ptr); -} - -/***************** - * Xcalloc - *****************/ - -void * -Xcalloc(unsigned long amount) -{ - unsigned long *ret; - - ret = Xalloc (amount); - if (ret) - bzero ((char *) ret, (int) amount); - return ret; -} - -/***************** - * XNFcalloc - *****************/ - -void * -XNFcalloc(unsigned long amount) -{ - unsigned long *ret; - - ret = Xalloc (amount); - if (ret) - bzero ((char *) ret, (int) amount); - else if ((long)amount > 0) - FatalError("Out of memory"); - return ret; -} - -/***************** - * Xrealloc - *****************/ - -void * -Xrealloc(pointer ptr, unsigned long amount) -{ -#ifdef MEMBUG - if (!Must_have_memory && Memory_fail && - ((random() % MEM_FAIL_SCALE) < Memory_fail)) - return (unsigned long *)NULL; -#endif - if ((long)amount <= 0) - { - if (ptr && !amount) - free(ptr); - return (unsigned long *)NULL; - } - amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); - if (ptr) - ptr = (pointer)realloc((char *)ptr, amount); - else - ptr = (pointer)malloc(amount); - if (ptr) - return (unsigned long *)ptr; - if (Must_have_memory) - FatalError("Out of memory"); - return (unsigned long *)NULL; -} - -/***************** - * XNFrealloc - * "no failure" realloc, alternate interface to Xrealloc w/o Must_have_memory - *****************/ - -void * -XNFrealloc(pointer ptr, unsigned long amount) -{ - if (( ptr = (pointer)Xrealloc( ptr, amount ) ) == NULL) - { - if ((long)amount > 0) - FatalError( "Out of memory" ); - } - return ((unsigned long *)ptr); -} - -/***************** - * Xfree - * calls free - *****************/ - -void -Xfree(pointer ptr) -{ - if (ptr) - free((char *)ptr); -} - -void -OsInitAllocator (void) -{ -#ifdef MEMBUG - static int been_here; - - /* Check the memory system after each generation */ - if (been_here) - CheckMemory (); - else - been_here = 1; -#endif -} -#endif /* !INTERNAL_MALLOC */ - - -char * -Xstrdup(const char *s) -{ - char *sd; - - if (s == NULL) - return NULL; - - sd = (char *)Xalloc(strlen(s) + 1); - if (sd != NULL) - strcpy(sd, s); - return sd; -} - - -char * -XNFstrdup(const char *s) -{ - char *sd; - - if (s == NULL) - return NULL; - - sd = (char *)XNFalloc(strlen(s) + 1); - strcpy(sd, s); - return sd; -} - -#ifdef SMART_SCHEDULE - -unsigned long SmartScheduleIdleCount; -Bool SmartScheduleIdle; -Bool SmartScheduleTimerStopped; - -#ifdef SIGVTALRM -#define SMART_SCHEDULE_POSSIBLE -#endif - -#ifdef SMART_SCHEDULE_POSSIBLE -#define SMART_SCHEDULE_SIGNAL SIGALRM -#define SMART_SCHEDULE_TIMER ITIMER_REAL -#endif - -static void -SmartScheduleStopTimer (void) -{ -#ifdef SMART_SCHEDULE_POSSIBLE - struct itimerval timer; - - timer.it_interval.tv_sec = 0; - timer.it_interval.tv_usec = 0; - timer.it_value.tv_sec = 0; - timer.it_value.tv_usec = 0; - (void) setitimer (ITIMER_REAL, &timer, 0); - SmartScheduleTimerStopped = TRUE; -#endif -} - -Bool -SmartScheduleStartTimer (void) -{ -#ifdef SMART_SCHEDULE_POSSIBLE - struct itimerval timer; - - SmartScheduleTimerStopped = FALSE; - timer.it_interval.tv_sec = 0; - timer.it_interval.tv_usec = SmartScheduleInterval * 1000; - timer.it_value.tv_sec = 0; - timer.it_value.tv_usec = SmartScheduleInterval * 1000; - return setitimer (ITIMER_REAL, &timer, 0) >= 0; -#endif - return FALSE; -} - -#ifdef SMART_SCHEDULE_POSSIBLE -static void -SmartScheduleTimer (int sig) -{ - int olderrno = errno; - - SmartScheduleTime += SmartScheduleInterval; - if (SmartScheduleIdle) - { - SmartScheduleStopTimer (); - } - errno = olderrno; -} -#endif - -Bool -SmartScheduleInit (void) -{ -#ifdef SMART_SCHEDULE_POSSIBLE - struct sigaction act; - - if (SmartScheduleDisable) - return TRUE; - - bzero ((char *) &act, sizeof(struct sigaction)); - - /* Set up the timer signal function */ - act.sa_handler = SmartScheduleTimer; - sigemptyset (&act.sa_mask); - sigaddset (&act.sa_mask, SMART_SCHEDULE_SIGNAL); - if (sigaction (SMART_SCHEDULE_SIGNAL, &act, 0) < 0) - { - perror ("sigaction for smart scheduler"); - return FALSE; - } - /* Set up the virtual timer */ - if (!SmartScheduleStartTimer ()) - { - perror ("scheduling timer"); - return FALSE; - } - /* stop the timer and wait for WaitForSomething to start it */ - SmartScheduleStopTimer (); - return TRUE; -#else - return FALSE; -#endif -} -#endif - -#ifdef SIG_BLOCK -static sigset_t PreviousSignalMask; -static int BlockedSignalCount; -#endif - -void -OsBlockSignals (void) -{ -#ifdef SIG_BLOCK - if (BlockedSignalCount++ == 0) - { - sigset_t set; - - sigemptyset (&set); -#ifdef SIGALRM - sigaddset (&set, SIGALRM); -#endif -#ifdef SIGVTALRM - sigaddset (&set, SIGVTALRM); -#endif -#ifdef SIGWINCH - sigaddset (&set, SIGWINCH); -#endif -#ifdef SIGIO - sigaddset (&set, SIGIO); -#endif -#ifdef SIGTSTP - sigaddset (&set, SIGTSTP); -#endif -#ifdef SIGTTIN - sigaddset (&set, SIGTTIN); -#endif -#ifdef SIGTTOU - sigaddset (&set, SIGTTOU); -#endif -#ifdef SIGCHLD - sigaddset (&set, SIGCHLD); -#endif - sigprocmask (SIG_BLOCK, &set, &PreviousSignalMask); - } -#endif -} - -void -OsReleaseSignals (void) -{ -#ifdef SIG_BLOCK - if (--BlockedSignalCount == 0) - { - sigprocmask (SIG_SETMASK, &PreviousSignalMask, 0); - } -#endif -} - -#if !defined(WIN32) && !defined(__UNIXOS2__) -/* - * "safer" versions of system(3), popen(3) and pclose(3) which give up - * all privs before running a command. - * - * This is based on the code in FreeBSD 2.2 libc. - * - * XXX It'd be good to redirect stderr so that it ends up in the log file - * as well. As it is now, xkbcomp messages don't end up in the log file. - */ - -int -System(char *command) -{ - int pid, p; -#ifdef SIGCHLD - void (*csig)(int); -#endif - int status; - - if (!command) - return(1); - -#ifdef SIGCHLD - csig = signal(SIGCHLD, SIG_DFL); -#endif - -#ifdef DEBUG - ErrorF("System: `%s'\n", command); -#endif - - switch (pid = fork()) { - case -1: /* error */ - p = -1; - case 0: /* child */ - if (setgid(getgid()) == -1) - _exit(127); - if (setuid(getuid()) == -1) - _exit(127); - execl("/bin/sh", "sh", "-c", command, (char *)NULL); - _exit(127); - default: /* parent */ - do { - p = waitpid(pid, &status, 0); - } while (p == -1 && errno == EINTR); - - } - -#ifdef SIGCHLD - signal(SIGCHLD, csig); -#endif - - return p == -1 ? -1 : status; -} - -static struct pid { - struct pid *next; - FILE *fp; - int pid; -} *pidlist; - -pointer -Popen(char *command, char *type) -{ - struct pid *cur; - FILE *iop; - int pdes[2], pid; - - if (command == NULL || type == NULL) - return NULL; - - if ((*type != 'r' && *type != 'w') || type[1]) - return NULL; - - if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL) - return NULL; - - if (pipe(pdes) < 0) { - xfree(cur); - return NULL; - } - - switch (pid = fork()) { - case -1: /* error */ - close(pdes[0]); - close(pdes[1]); - xfree(cur); - return NULL; - case 0: /* child */ - if (setgid(getgid()) == -1) - _exit(127); - if (setuid(getuid()) == -1) - _exit(127); - if (*type == 'r') { - if (pdes[1] != 1) { - /* stdout */ - dup2(pdes[1], 1); - close(pdes[1]); - } - close(pdes[0]); - } else { - if (pdes[0] != 0) { - /* stdin */ - dup2(pdes[0], 0); - close(pdes[0]); - } - close(pdes[1]); - } - execl("/bin/sh", "sh", "-c", command, (char *)NULL); - _exit(127); - } - - /* Avoid EINTR during stdio calls */ - OsBlockSignals (); - - /* parent */ - if (*type == 'r') { - iop = fdopen(pdes[0], type); - close(pdes[1]); - } else { - iop = fdopen(pdes[1], type); - close(pdes[0]); - } - - cur->fp = iop; - cur->pid = pid; - cur->next = pidlist; - pidlist = cur; - -#ifdef DEBUG - ErrorF("Popen: `%s', fp = %p\n", command, iop); -#endif - - return iop; -} - -/* fopen that drops privileges */ -pointer -Fopen(char *file, char *type) -{ - FILE *iop; -#ifndef HAS_SAVED_IDS_AND_SETEUID - struct pid *cur; - int pdes[2], pid; - - if (file == NULL || type == NULL) - return NULL; - - if ((*type != 'r' && *type != 'w') || type[1]) - return NULL; - - if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL) - return NULL; - - if (pipe(pdes) < 0) { - xfree(cur); - return NULL; - } - - switch (pid = fork()) { - case -1: /* error */ - close(pdes[0]); - close(pdes[1]); - xfree(cur); - return NULL; - case 0: /* child */ - if (setgid(getgid()) == -1) - _exit(127); - if (setuid(getuid()) == -1) - _exit(127); - if (*type == 'r') { - if (pdes[1] != 1) { - /* stdout */ - dup2(pdes[1], 1); - close(pdes[1]); - } - close(pdes[0]); - } else { - if (pdes[0] != 0) { - /* stdin */ - dup2(pdes[0], 0); - close(pdes[0]); - } - close(pdes[1]); - } - execl("/bin/cat", "cat", file, (char *)NULL); - _exit(127); - } - - /* Avoid EINTR during stdio calls */ - OsBlockSignals (); - - /* parent */ - if (*type == 'r') { - iop = fdopen(pdes[0], type); - close(pdes[1]); - } else { - iop = fdopen(pdes[1], type); - close(pdes[0]); - } - - cur->fp = iop; - cur->pid = pid; - cur->next = pidlist; - pidlist = cur; - -#ifdef DEBUG - ErrorF("Popen: `%s', fp = %p\n", command, iop); -#endif - - return iop; -#else - int ruid, euid; - - ruid = getuid(); - euid = geteuid(); - - if (seteuid(ruid) == -1) { - return NULL; - } - iop = fopen(file, type); - - if (seteuid(euid) == -1) { - fclose(iop); - return NULL; - } - return iop; -#endif /* HAS_SAVED_IDS_AND_SETEUID */ -} - -int -Pclose(pointer iop) -{ - struct pid *cur, *last; - int pstat; - int pid; - -#ifdef DEBUG - ErrorF("Pclose: fp = %p\n", iop); -#endif - - fclose(iop); - - for (last = NULL, cur = pidlist; cur; last = cur, cur = cur->next) - if (cur->fp == iop) - break; - if (cur == NULL) - return -1; - - do { - pid = waitpid(cur->pid, &pstat, 0); - } while (pid == -1 && errno == EINTR); - - if (last == NULL) - pidlist = cur->next; - else - last->next = cur->next; - xfree(cur); - - /* allow EINTR again */ - OsReleaseSignals (); - - return pid == -1 ? -1 : pstat; -} - -int -Fclose(pointer iop) -{ -#ifdef HAS_SAVED_IDS_AND_SETEUID - return fclose(iop); -#else - return Pclose(iop); -#endif -} - -#endif /* !WIN32 && !__UNIXOS2__ */ - - -/* - * CheckUserParameters: check for long command line arguments and long - * environment variables. By default, these checks are only done when - * the server's euid != ruid. In 3.3.x, these checks were done in an - * external wrapper utility. - */ - -/* Consider LD* variables insecure? */ -#ifndef REMOVE_ENV_LD -#define REMOVE_ENV_LD 1 -#endif - -/* Remove long environment variables? */ -#ifndef REMOVE_LONG_ENV -#define REMOVE_LONG_ENV 1 -#endif - -/* - * Disallow stdout or stderr as pipes? It's possible to block the X server - * when piping stdout+stderr to a pipe. - * - * Don't enable this because it looks like it's going to cause problems. - */ -#ifndef NO_OUTPUT_PIPES -#define NO_OUTPUT_PIPES 0 -#endif - - -/* Check args and env only if running setuid (euid == 0 && euid != uid) ? */ -#ifndef CHECK_EUID -#ifndef WIN32 -#define CHECK_EUID 1 -#else -#define CHECK_EUID 0 -#endif -#endif - -/* - * Maybe the locale can be faked to make isprint(3) report that everything - * is printable? Avoid it by default. - */ -#ifndef USE_ISPRINT -#define USE_ISPRINT 0 -#endif - -#define MAX_ARG_LENGTH 128 -#define MAX_ENV_LENGTH 256 -#define MAX_ENV_PATH_LENGTH 2048 /* Limit for *PATH and TERMCAP */ - -#if USE_ISPRINT -#include -#define checkPrintable(c) isprint(c) -#else -#define checkPrintable(c) (((c) & 0x7f) >= 0x20 && ((c) & 0x7f) != 0x7f) -#endif - -enum BadCode { - NotBad = 0, - UnsafeArg, - ArgTooLong, - UnprintableArg, - EnvTooLong, - OutputIsPipe, - InternalError -}; - -#if defined(VENDORSUPPORT) -#define BUGADDRESS VENDORSUPPORT -#elif defined(BUILDERADDR) -#define BUGADDRESS BUILDERADDR -#else -#define BUGADDRESS "xorg@freedesktop.org" -#endif - -#define ARGMSG \ - "\nIf the arguments used are valid, and have been rejected incorrectly\n" \ - "please send details of the arguments and why they are valid to\n" \ - "%s. In the meantime, you can start the Xserver as\n" \ - "the \"super user\" (root).\n" - -#define ENVMSG \ - "\nIf the environment is valid, and have been rejected incorrectly\n" \ - "please send details of the environment and why it is valid to\n" \ - "%s. In the meantime, you can start the Xserver as\n" \ - "the \"super user\" (root).\n" - -void -CheckUserParameters(int argc, char **argv, char **envp) -{ - enum BadCode bad = NotBad; - int i = 0, j; - char *a, *e = NULL; -#if defined(__QNX__) && !defined(__QNXNTO__) - char cmd_name[64]; -#endif - -#if CHECK_EUID - if (geteuid() == 0 && getuid() != geteuid()) -#endif - { - /* Check each argv[] */ - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-fp") == 0) - { - i++; /* continue with next argument. skip the length check */ - if (i >= argc) - break; - } else - { - if (strlen(argv[i]) > MAX_ARG_LENGTH) { - bad = ArgTooLong; - break; - } - } - a = argv[i]; - while (*a) { - if (checkPrintable(*a) == 0) { - bad = UnprintableArg; - break; - } - a++; - } - if (bad) - break; - } - if (!bad) { - /* Check each envp[] */ - for (i = 0; envp[i]; i++) { - - /* Check for bad environment variables and values */ -#if REMOVE_ENV_LD - while (envp[i] && (strncmp(envp[i], "LD", 2) == 0)) { -#ifdef ENVDEBUG - ErrorF("CheckUserParameters: removing %s from the " - "environment\n", strtok(envp[i], "=")); -#endif - for (j = i; envp[j]; j++) { - envp[j] = envp[j+1]; - } - } -#endif - if (envp[i] && (strlen(envp[i]) > MAX_ENV_LENGTH)) { -#if REMOVE_LONG_ENV -#ifdef ENVDEBUG - ErrorF("CheckUserParameters: removing %s from the " - "environment\n", strtok(envp[i], "=")); -#endif - for (j = i; envp[j]; j++) { - envp[j] = envp[j+1]; - } - i--; -#else - char *eq; - int len; - - eq = strchr(envp[i], '='); - if (!eq) - continue; - len = eq - envp[i]; - e = malloc(len + 1); - if (!e) { - bad = InternalError; - break; - } - strncpy(e, envp[i], len); - e[len] = 0; - if (len >= 4 && - (strcmp(e + len - 4, "PATH") == 0 || - strcmp(e, "TERMCAP") == 0)) { - if (strlen(envp[i]) > MAX_ENV_PATH_LENGTH) { - bad = EnvTooLong; - break; - } else { - free(e); - } - } else { - bad = EnvTooLong; - break; - } -#endif - } - } - } -#if NO_OUTPUT_PIPES - if (!bad) { - struct stat buf; - - if (fstat(fileno(stdout), &buf) == 0 && S_ISFIFO(buf.st_mode)) - bad = OutputIsPipe; - if (fstat(fileno(stderr), &buf) == 0 && S_ISFIFO(buf.st_mode)) - bad = OutputIsPipe; - } -#endif - } - switch (bad) { - case NotBad: - return; - case UnsafeArg: - ErrorF("Command line argument number %d is unsafe\n", i); - ErrorF(ARGMSG, BUGADDRESS); - break; - case ArgTooLong: - ErrorF("Command line argument number %d is too long\n", i); - ErrorF(ARGMSG, BUGADDRESS); - break; - case UnprintableArg: - ErrorF("Command line argument number %d contains unprintable" - " characters\n", i); - ErrorF(ARGMSG, BUGADDRESS); - break; - case EnvTooLong: - ErrorF("Environment variable `%s' is too long\n", e); - ErrorF(ENVMSG, BUGADDRESS); - break; - case OutputIsPipe: - ErrorF("Stdout and/or stderr is a pipe\n"); - break; - case InternalError: - ErrorF("Internal Error\n"); - break; - default: - ErrorF("Unknown error\n"); - ErrorF(ARGMSG, BUGADDRESS); - ErrorF(ENVMSG, BUGADDRESS); - break; - } - FatalError("X server aborted because of unsafe environment\n"); -} - -/* - * CheckUserAuthorization: check if the user is allowed to start the - * X server. This usually means some sort of PAM checking, and it is - * usually only done for setuid servers (uid != euid). - */ - -#ifdef USE_PAM -#include -#include -#include -#endif /* USE_PAM */ - -void -CheckUserAuthorization(void) -{ -#ifdef USE_PAM - static struct pam_conv conv = { - misc_conv, - NULL - }; - - pam_handle_t *pamh = NULL; - struct passwd *pw; - int retval; - - if (getuid() != geteuid()) { - pw = getpwuid(getuid()); - if (pw == NULL) - FatalError("getpwuid() failed for uid %d\n", getuid()); - - retval = pam_start("xserver", pw->pw_name, &conv, &pamh); - if (retval != PAM_SUCCESS) - FatalError("pam_start() failed.\n" - "\tMissing or mangled PAM config file or module?\n"); - - retval = pam_authenticate(pamh, 0); - if (retval != PAM_SUCCESS) { - pam_end(pamh, retval); - FatalError("PAM authentication failed, cannot start X server.\n" - "\tPerhaps you do not have console ownership?\n"); - } - - retval = pam_acct_mgmt(pamh, 0); - if (retval != PAM_SUCCESS) { - pam_end(pamh, retval); - FatalError("PAM authentication failed, cannot start X server.\n" - "\tPerhaps you do not have console ownership?\n"); - } - - /* this is not a session, so do not do session management */ - pam_end(pamh, PAM_SUCCESS); - } -#endif -} - -#ifdef __SCO__ -#include - -static void -lockit (int fd, short what) -{ - struct flock lck; - - lck.l_whence = 0; - lck.l_start = 0; - lck.l_len = 1; - lck.l_type = what; - - (void)fcntl (fd, F_SETLKW, &lck); -} - -/* SCO OpenServer 5 lacks pread/pwrite. Emulate them. */ -ssize_t -pread (int fd, void *buf, size_t nbytes, off_t offset) -{ - off_t saved; - ssize_t ret; - - lockit (fd, F_RDLCK); - saved = lseek (fd, 0, SEEK_CUR); - lseek (fd, offset, SEEK_SET); - ret = read (fd, buf, nbytes); - lseek (fd, saved, SEEK_SET); - lockit (fd, F_UNLCK); - - return ret; -} - -ssize_t -pwrite (int fd, const void *buf, size_t nbytes, off_t offset) -{ - off_t saved; - ssize_t ret; - - lockit (fd, F_WRLCK); - saved = lseek (fd, 0, SEEK_CUR); - lseek (fd, offset, SEEK_SET); - ret = write (fd, buf, nbytes); - lseek (fd, saved, SEEK_SET); - lockit (fd, F_UNLCK); - - return ret; -} -#endif /* __SCO__ */ diff --git a/nx-X11/programs/Xserver/os/xdmcp.c.NX.original b/nx-X11/programs/Xserver/os/xdmcp.c.NX.original deleted file mode 100644 index 032d58f15..000000000 --- a/nx-X11/programs/Xserver/os/xdmcp.c.NX.original +++ /dev/null @@ -1,1710 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/os/xdmcp.c,v 1.10 2005/07/03 08:53:52 daniels Exp $ */ -/* $Xorg: xdmcp.c,v 1.4 2001/01/31 13:37:19 pookie Exp $ */ -/* - * Copyright 1989 Network Computing Devices, Inc., Mountain View, California. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of N.C.D. not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. N.C.D. makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - */ -/* $XFree86: xc/programs/Xserver/os/xdmcp.c,v 3.31 2003/12/30 21:24:32 herrb Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#endif - -#include - -#if !defined(WIN32) -#ifndef Lynx -#include -#include -#else -#include -#endif -#include -#include -#endif - -#include -#include -#include -#include -#include "misc.h" -#include -#include "osdep.h" -#include "input.h" -#include "dixstruct.h" -#include "opaque.h" - -#if defined(DGUX) -#include -#include -#endif - -#ifdef STREAMSCONN -#include -#include -#include -#endif - -#ifndef NX_TRANS_SOCKET - -#define NX_TRANS_SOCKET -#define NX_TRANS_TEST - -#endif - -#ifdef XDMCP -#undef REQUEST - -#ifdef XDMCP_NO_IPV6 -#undef IPv6 -#endif - -#include - -#define X_INCLUDE_NETDB_H -#include - -#ifdef NX_TRANS_SOCKET - -xdmcp_states XdmcpState; - -int XdmcpStartTime; -int XdmcpTimeOutRtx; - -#endif - -extern char *defaultDisplayClass; - -static int xdmcpSocket, sessionSocket; -static xdmcp_states state; -#if defined(IPv6) && defined(AF_INET6) -static int xdmcpSocket6; -static struct sockaddr_storage req_sockaddr; -#else -static struct sockaddr_in req_sockaddr; -#endif -static int req_socklen; -static CARD32 SessionID; -static CARD32 timeOutTime; -static int timeOutRtx; -static CARD32 defaultKeepaliveDormancy = XDM_DEF_DORMANCY; -static CARD32 keepaliveDormancy = XDM_DEF_DORMANCY; -static CARD16 DisplayNumber; -static xdmcp_states XDM_INIT_STATE = XDM_OFF; -#ifdef HASXDMAUTH -static char *xdmAuthCookie; -#endif - -static XdmcpBuffer buffer; - -#if defined(IPv6) && defined(AF_INET6) - -static struct addrinfo *mgrAddr; -static struct addrinfo *mgrAddrFirst; - -#define SOCKADDR_TYPE struct sockaddr_storage -#define SOCKADDR_FAMILY(s) ((struct sockaddr *)&(s))->sa_family - -#ifdef BSD44SOCKETS -#define SOCKLEN_FIELD(s) ((struct sockaddr *)&(s))->sa_len -#define SOCKLEN_TYPE unsigned char -#else -#define SOCKLEN_TYPE unsigned int -#endif - -#else - -#define SOCKADDR_TYPE struct sockaddr_in -#define SOCKADDR_FAMILY(s) (s).sin_family - -#ifdef BSD44SOCKETS -#define SOCKLEN_FIELD(s) (s).sin_len -#define SOCKLEN_TYPE unsigned char -#else -#define SOCKLEN_TYPE size_t -#endif - -#endif - -static SOCKADDR_TYPE ManagerAddress; -static SOCKADDR_TYPE FromAddress; - -#ifdef SOCKLEN_FIELD -#define ManagerAddressLen SOCKLEN_FIELD(ManagerAddress) -#define FromAddressLen SOCKLEN_FIELD(FromAddress) -#else -static SOCKLEN_TYPE ManagerAddressLen, FromAddressLen; -#endif - -#if defined(IPv6) && defined(AF_INET6) -static struct multicastinfo { - struct multicastinfo *next; - struct addrinfo *ai; - int hops; -} *mcastlist; -#endif - -static void XdmcpAddHost( - struct sockaddr *from, - int fromlen, - ARRAY8Ptr AuthenticationName, - ARRAY8Ptr hostname, - ARRAY8Ptr status); - -static void XdmcpSelectHost( - struct sockaddr *host_sockaddr, - int host_len, - ARRAY8Ptr AuthenticationName); - -static void get_xdmcp_sock(void); - -static void send_query_msg(void); - -static void recv_willing_msg( - struct sockaddr * /*from*/, - int /*fromlen*/, - unsigned /*length*/); - -static void send_request_msg(void); - -static void recv_accept_msg(unsigned /*length*/); - -static void recv_decline_msg(unsigned /*length*/); - -static void send_manage_msg(void); - -static void recv_refuse_msg(unsigned /*length*/); - -static void recv_failed_msg(unsigned /*length*/); - -static void send_keepalive_msg(void); - -static void recv_alive_msg(unsigned /*length*/); - -static void XdmcpFatal( - char * /*type*/, - ARRAY8Ptr /*status*/); - -static void XdmcpWarning(char * /*str*/); - -static void get_manager_by_name( - int /*argc*/, - char ** /*argv*/, - int /*i*/); - -static void get_fromaddr_by_name(int /*argc*/, char ** /*argv*/, int /*i*/); - -#if defined(IPv6) && defined(AF_INET6) -static int get_mcast_options(int /*argc*/, char ** /*argv*/, int /*i*/); -#endif - -static void receive_packet(int /*socketfd*/); - -static void send_packet(void); - -extern void XdmcpDeadSession(char * /*reason*/); - -static void timeout(void); - -static void restart(void); - -static void XdmcpBlockHandler( - pointer /*data*/, - struct timeval ** /*wt*/, - pointer /*LastSelectMask*/); - -static void XdmcpWakeupHandler( - pointer /*data*/, - int /*i*/, - pointer /*LastSelectMask*/); - -void XdmcpRegisterManufacturerDisplayID( - char * /*name*/, - int /*length*/); - - -static unsigned short xdm_udp_port = XDM_UDP_PORT; -static Bool OneSession = FALSE; -static const char *xdm_from = NULL; - -void -XdmcpUseMsg (void) -{ - ErrorF("-query host-name contact named host for XDMCP\n"); - ErrorF("-broadcast broadcast for XDMCP\n"); -#if defined(IPv6) && defined(AF_INET6) - ErrorF("-multicast [addr [hops]] IPv6 multicast for XDMCP\n"); -#endif - ErrorF("-indirect host-name contact named host for indirect XDMCP\n"); - ErrorF("-port port-num UDP port number to send messages to\n"); - ErrorF("-from local-address specify the local address to connect from\n"); - ErrorF("-once Terminate server after one session\n"); - ErrorF("-class display-class specify display class to send in manage\n"); -#ifdef HASXDMAUTH - ErrorF("-cookie xdm-auth-bits specify the magic cookie for XDMCP\n"); -#endif - ErrorF("-displayID display-id manufacturer display ID for request\n"); -} - -int -XdmcpOptions(int argc, char **argv, int i) -{ - if (strcmp(argv[i], "-query") == 0) { - get_manager_by_name(argc, argv, i++); - XDM_INIT_STATE = XDM_QUERY; - AccessUsingXdmcp (); - return (i + 1); - } - if (strcmp(argv[i], "-broadcast") == 0) { - XDM_INIT_STATE = XDM_BROADCAST; - AccessUsingXdmcp (); - return (i + 1); - } -#if defined(IPv6) && defined(AF_INET6) - if (strcmp(argv[i], "-multicast") == 0) { - i = get_mcast_options(argc, argv, ++i); - XDM_INIT_STATE = XDM_MULTICAST; - AccessUsingXdmcp (); - return (i + 1); - } -#endif - if (strcmp(argv[i], "-indirect") == 0) { - get_manager_by_name(argc, argv, i++); - XDM_INIT_STATE = XDM_INDIRECT; - AccessUsingXdmcp (); - return (i + 1); - } - if (strcmp(argv[i], "-port") == 0) { - if (++i == argc) { - FatalError("Xserver: missing port number in command line\n"); - } - xdm_udp_port = (unsigned short) atoi(argv[i]); - return (i + 1); - } - if (strcmp(argv[i], "-from") == 0) { - get_fromaddr_by_name(argc, argv, ++i); - return (i + 1); - } - if (strcmp(argv[i], "-once") == 0) { - OneSession = TRUE; - return (i + 1); - } - if (strcmp(argv[i], "-class") == 0) { - if (++i == argc) { - FatalError("Xserver: missing class name in command line\n"); - } - defaultDisplayClass = argv[i]; - return (i + 1); - } -#ifdef HASXDMAUTH - if (strcmp(argv[i], "-cookie") == 0) { - if (++i == argc) { - FatalError("Xserver: missing cookie data in command line\n"); - } - xdmAuthCookie = argv[i]; - return (i + 1); - } -#endif - if (strcmp(argv[i], "-displayID") == 0) { - if (++i == argc) { - FatalError("Xserver: missing displayID in command line\n"); - } - XdmcpRegisterManufacturerDisplayID (argv[i], strlen (argv[i])); - return (i + 1); - } - return (i); -} - -/* - * This section is a collection of routines for - * registering server-specific data with the XDMCP - * state machine. - */ - - -/* - * Save all broadcast addresses away so BroadcastQuery - * packets get sent everywhere - */ - -#define MAX_BROADCAST 10 - -/* This stays sockaddr_in since IPv6 doesn't support broadcast */ -static struct sockaddr_in BroadcastAddresses[MAX_BROADCAST]; -static int NumBroadcastAddresses; - -void -XdmcpRegisterBroadcastAddress (struct sockaddr_in *addr) -{ - struct sockaddr_in *bcast; - if (NumBroadcastAddresses >= MAX_BROADCAST) - return; - bcast = &BroadcastAddresses[NumBroadcastAddresses++]; - bzero (bcast, sizeof (struct sockaddr_in)); -#ifdef BSD44SOCKETS - bcast->sin_len = addr->sin_len; -#endif - bcast->sin_family = addr->sin_family; - bcast->sin_port = htons (xdm_udp_port); - bcast->sin_addr = addr->sin_addr; -} - -/* - * Each authentication type is registered here; Validator - * will be called to check all access attempts using - * the specified authentication type - */ - -static ARRAYofARRAY8 AuthenticationNames, AuthenticationDatas; -typedef struct _AuthenticationFuncs { - ValidatorFunc Validator; - GeneratorFunc Generator; - AddAuthorFunc AddAuth; -} AuthenticationFuncsRec, *AuthenticationFuncsPtr; - -static AuthenticationFuncsPtr AuthenticationFuncsList; - -void -XdmcpRegisterAuthentication ( - char *name, - int namelen, - char *data, - int datalen, - ValidatorFunc Validator, - GeneratorFunc Generator, - AddAuthorFunc AddAuth) -{ - int i; - ARRAY8 AuthenticationName, AuthenticationData; - static AuthenticationFuncsPtr newFuncs; - - if (!XdmcpAllocARRAY8 (&AuthenticationName, namelen)) - return; - if (!XdmcpAllocARRAY8 (&AuthenticationData, datalen)) - { - XdmcpDisposeARRAY8 (&AuthenticationName); - return; - } - for (i = 0; i < namelen; i++) - AuthenticationName.data[i] = name[i]; - for (i = 0; i < datalen; i++) - AuthenticationData.data[i] = data[i]; - if (!(XdmcpReallocARRAYofARRAY8 (&AuthenticationNames, - AuthenticationNames.length + 1) && - XdmcpReallocARRAYofARRAY8 (&AuthenticationDatas, - AuthenticationDatas.length + 1) && - (newFuncs = (AuthenticationFuncsPtr) xalloc ( - (AuthenticationNames.length + 1) * sizeof (AuthenticationFuncsRec))))) - { - XdmcpDisposeARRAY8 (&AuthenticationName); - XdmcpDisposeARRAY8 (&AuthenticationData); - return; - } - for (i = 0; i < AuthenticationNames.length - 1; i++) - newFuncs[i] = AuthenticationFuncsList[i]; - newFuncs[AuthenticationNames.length-1].Validator = Validator; - newFuncs[AuthenticationNames.length-1].Generator = Generator; - newFuncs[AuthenticationNames.length-1].AddAuth = AddAuth; - xfree (AuthenticationFuncsList); - AuthenticationFuncsList = newFuncs; - AuthenticationNames.data[AuthenticationNames.length-1] = AuthenticationName; - AuthenticationDatas.data[AuthenticationDatas.length-1] = AuthenticationData; -} - -/* - * Select the authentication type to be used; this is - * set by the manager of the host to be connected to. - */ - -ARRAY8 noAuthenticationName = {(CARD16) 0, (CARD8Ptr) 0}; -ARRAY8 noAuthenticationData = {(CARD16) 0, (CARD8Ptr) 0}; -ARRAY8Ptr AuthenticationName = &noAuthenticationName; -ARRAY8Ptr AuthenticationData = &noAuthenticationData; -AuthenticationFuncsPtr AuthenticationFuncs; - -void -XdmcpSetAuthentication (ARRAY8Ptr name) -{ - int i; - - for (i = 0; i < AuthenticationNames.length; i++) - if (XdmcpARRAY8Equal (&AuthenticationNames.data[i], name)) - { - AuthenticationName = &AuthenticationNames.data[i]; - AuthenticationData = &AuthenticationDatas.data[i]; - AuthenticationFuncs = &AuthenticationFuncsList[i]; - break; - } -} - -/* - * Register the host address for the display - */ - -static ARRAY16 ConnectionTypes; -static ARRAYofARRAY8 ConnectionAddresses; -static long xdmcpGeneration; - -void -XdmcpRegisterConnection ( - int type, - char *address, - int addrlen) -{ - int i; - CARD8 *newAddress; - - if (xdmcpGeneration != serverGeneration) - { - XdmcpDisposeARRAY16 (&ConnectionTypes); - XdmcpDisposeARRAYofARRAY8 (&ConnectionAddresses); - xdmcpGeneration = serverGeneration; - } - if (xdm_from != NULL) { /* Only register the requested address */ - const void *regAddr = address; - const void *fromAddr = NULL; - int regAddrlen = addrlen; - - if (addrlen == sizeof(struct in_addr)) { - if (SOCKADDR_FAMILY(FromAddress) == AF_INET) { - fromAddr = &((struct sockaddr_in *)&FromAddress)->sin_addr; - } -#if defined(IPv6) && defined(AF_INET6) - else if ((SOCKADDR_FAMILY(FromAddress) == AF_INET6) && - IN6_IS_ADDR_V4MAPPED( - &((struct sockaddr_in6 *)&FromAddress)->sin6_addr)) { - fromAddr = &((struct sockaddr_in6 *)&FromAddress)->sin6_addr.s6_addr[12]; - } -#endif - } -#if defined(IPv6) && defined(AF_INET6) - else if (addrlen == sizeof(struct in6_addr)) { - if (SOCKADDR_FAMILY(FromAddress) == AF_INET6) { - fromAddr = &((struct sockaddr_in6 *)&FromAddress)->sin6_addr; - } else if ((SOCKADDR_FAMILY(FromAddress) == AF_INET) && - IN6_IS_ADDR_V4MAPPED((struct in6_addr *) address)) { - fromAddr = &((struct sockaddr_in *)&FromAddress)->sin_addr; - regAddr = &((struct sockaddr_in6 *)&address)->sin6_addr.s6_addr[12]; - regAddrlen = sizeof(struct in_addr); - } - } -#endif - if (fromAddr && memcmp(regAddr, fromAddr, regAddrlen) != 0) { - return; - } - } - newAddress = (CARD8 *) xalloc (addrlen * sizeof (CARD8)); - if (!newAddress) - return; - if (!XdmcpReallocARRAY16 (&ConnectionTypes, ConnectionTypes.length + 1)) - { - xfree (newAddress); - return; - } - if (!XdmcpReallocARRAYofARRAY8 (&ConnectionAddresses, - ConnectionAddresses.length + 1)) - { - xfree (newAddress); - return; - } - ConnectionTypes.data[ConnectionTypes.length - 1] = (CARD16) type; - for (i = 0; i < addrlen; i++) - newAddress[i] = address[i]; - ConnectionAddresses.data[ConnectionAddresses.length-1].data = newAddress; - ConnectionAddresses.data[ConnectionAddresses.length-1].length = addrlen; -} - -/* - * Register an Authorization Name. XDMCP advertises this list - * to the manager. - */ - -static ARRAYofARRAY8 AuthorizationNames; - -void -XdmcpRegisterAuthorizations (void) -{ - XdmcpDisposeARRAYofARRAY8 (&AuthorizationNames); - RegisterAuthorizations (); -} - -void -XdmcpRegisterAuthorization (char *name, int namelen) -{ - ARRAY8 authName; - int i; - - authName.data = (CARD8 *) xalloc (namelen * sizeof (CARD8)); - if (!authName.data) - return; - if (!XdmcpReallocARRAYofARRAY8 (&AuthorizationNames, AuthorizationNames.length +1)) - { - xfree (authName.data); - return; - } - for (i = 0; i < namelen; i++) - authName.data[i] = (CARD8) name[i]; - authName.length = namelen; - AuthorizationNames.data[AuthorizationNames.length-1] = authName; -} - -/* - * Register the DisplayClass string - */ - -ARRAY8 DisplayClass; - -void -XdmcpRegisterDisplayClass (char *name, int length) -{ - int i; - - XdmcpDisposeARRAY8 (&DisplayClass); - if (!XdmcpAllocARRAY8 (&DisplayClass, length)) - return; - for (i = 0; i < length; i++) - DisplayClass.data[i] = (CARD8) name[i]; -} - -/* - * Register the Manufacturer display ID - */ - -ARRAY8 ManufacturerDisplayID; - -void -XdmcpRegisterManufacturerDisplayID (char *name, int length) -{ - int i; - - XdmcpDisposeARRAY8 (&ManufacturerDisplayID); - if (!XdmcpAllocARRAY8 (&ManufacturerDisplayID, length)) - return; - for (i = 0; i < length; i++) - ManufacturerDisplayID.data[i] = (CARD8) name[i]; -} - -/* - * initialize XDMCP; create the socket, compute the display - * number, set up the state machine - */ - -void -XdmcpInit(void) -{ -#ifdef NX_TRANS_SOCKET - - XdmcpStartTime = GetTimeInMillis(); - -#endif - - state = XDM_INIT_STATE; -#ifdef HASXDMAUTH - if (xdmAuthCookie) - XdmAuthenticationInit (xdmAuthCookie, strlen (xdmAuthCookie)); -#endif - if (state != XDM_OFF) - { - XdmcpRegisterAuthorizations(); - XdmcpRegisterDisplayClass (defaultDisplayClass, strlen (defaultDisplayClass)); - AccessUsingXdmcp(); - RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler, - (pointer) 0); - timeOutRtx = 0; - DisplayNumber = (CARD16) atoi(display); - get_xdmcp_sock(); - send_packet(); - } -} - -void -XdmcpReset (void) -{ - state = XDM_INIT_STATE; - if (state != XDM_OFF) - { - RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler, - (pointer) 0); - timeOutRtx = 0; - send_packet(); - } -} - -/* - * Called whenever a new connection is created; notices the - * first connection and saves it to terminate the session - * when it is closed - */ - -void -XdmcpOpenDisplay(int sock) -{ - if (state != XDM_AWAIT_MANAGE_RESPONSE) - return; - state = XDM_RUN_SESSION; - sessionSocket = sock; -} - -void -XdmcpCloseDisplay(int sock) -{ - if ((state != XDM_RUN_SESSION && state != XDM_AWAIT_ALIVE_RESPONSE) - || sessionSocket != sock) - return; - state = XDM_INIT_STATE; - if (OneSession) - dispatchException |= DE_TERMINATE; - else - dispatchException |= DE_RESET; - isItTimeToYield = TRUE; -} - -/* - * called before going to sleep, this routine - * may modify the timeout value about to be sent - * to select; in this way XDMCP can do appropriate things - * dynamically while starting up - */ - -/*ARGSUSED*/ -static void -XdmcpBlockHandler( - pointer data, /* unused */ - struct timeval **wt, - pointer pReadmask) -{ - fd_set *LastSelectMask = (fd_set*)pReadmask; - CARD32 millisToGo; - - if (state == XDM_OFF) - return; - FD_SET(xdmcpSocket, LastSelectMask); -#if defined(IPv6) && defined(AF_INET6) - if (xdmcpSocket6 >= 0) - FD_SET(xdmcpSocket6, LastSelectMask); -#endif - if (timeOutTime == 0) - return; - millisToGo = timeOutTime - GetTimeInMillis(); - if ((int) millisToGo < 0) - millisToGo = 0; - AdjustWaitForDelay (wt, millisToGo); -} - -/* - * called after select returns; this routine will - * recognise when XDMCP packets await and - * process them appropriately - */ - -/*ARGSUSED*/ -static void -XdmcpWakeupHandler( - pointer data, /* unused */ - int i, - pointer pReadmask) -{ - fd_set* LastSelectMask = (fd_set*)pReadmask; - fd_set devicesReadable; - -#ifdef NX_TRANS_SOCKET - - XdmcpState = state; - XdmcpTimeOutRtx = timeOutRtx; - -#endif - - if (state == XDM_OFF) - return; - if (i > 0) - { - if (FD_ISSET(xdmcpSocket, LastSelectMask)) - { - receive_packet(xdmcpSocket); - FD_CLR(xdmcpSocket, LastSelectMask); - } -#if defined(IPv6) && defined(AF_INET6) - if (xdmcpSocket6 >= 0 && FD_ISSET(xdmcpSocket6, LastSelectMask)) - { - receive_packet(xdmcpSocket6); - FD_CLR(xdmcpSocket6, LastSelectMask); - } -#endif - XFD_ANDSET(&devicesReadable, LastSelectMask, &EnabledDevices); - if (XFD_ANYSET(&devicesReadable)) - { - if (state == XDM_AWAIT_USER_INPUT) - restart(); - else if (state == XDM_RUN_SESSION) - keepaliveDormancy = defaultKeepaliveDormancy; - } - if (XFD_ANYSET(&AllClients) && state == XDM_RUN_SESSION) - timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; - } - else if (timeOutTime && (int) (GetTimeInMillis() - timeOutTime) >= 0) - { - if (state == XDM_RUN_SESSION) - { - state = XDM_KEEPALIVE; - send_packet(); - } - else - timeout(); - } -} - -/* - * This routine should be called from the routine that drives the - * user's host menu when the user selects a host - */ - -static void -XdmcpSelectHost( - struct sockaddr *host_sockaddr, - int host_len, - ARRAY8Ptr AuthenticationName) -{ - state = XDM_START_CONNECTION; - memmove(&req_sockaddr, host_sockaddr, host_len); - req_socklen = host_len; - XdmcpSetAuthentication (AuthenticationName); - send_packet(); -} - -/* - * !!! this routine should be replaced by a routine that adds - * the host to the user's host menu. the current version just - * selects the first host to respond with willing message. - */ - -/*ARGSUSED*/ -static void -XdmcpAddHost( - struct sockaddr *from, - int fromlen, - ARRAY8Ptr AuthenticationName, - ARRAY8Ptr hostname, - ARRAY8Ptr status) -{ - XdmcpSelectHost(from, fromlen, AuthenticationName); -} - -/* - * A message is queued on the socket; read it and - * do the appropriate thing - */ - -ARRAY8 UnwillingMessage = { (CARD8) 14, (CARD8 *) "Host unwilling" }; - -static void -receive_packet(int socketfd) -{ -#if defined(IPv6) && defined(AF_INET6) - struct sockaddr_storage from; -#else - struct sockaddr_in from; -#endif - int fromlen = sizeof(from); - XdmcpHeader header; - - /* read message off socket */ - if (!XdmcpFill (socketfd, &buffer, (XdmcpNetaddr) &from, &fromlen)) - return; - - /* reset retransmission backoff */ - timeOutRtx = 0; - - if (!XdmcpReadHeader (&buffer, &header)) - return; - - if (header.version != XDM_PROTOCOL_VERSION) - return; - - switch (header.opcode) { - case WILLING: - recv_willing_msg((struct sockaddr *) &from, fromlen, header.length); - break; - case UNWILLING: - XdmcpFatal("Manager unwilling", &UnwillingMessage); - break; - case ACCEPT: - recv_accept_msg(header.length); - break; - case DECLINE: - recv_decline_msg(header.length); - break; - case REFUSE: - recv_refuse_msg(header.length); - break; - case FAILED: - recv_failed_msg(header.length); - break; - case ALIVE: - recv_alive_msg(header.length); - break; - } -} - -/* - * send the appropriate message given the current state - */ - -static void -send_packet(void) -{ - int rtx; - switch (state) { - case XDM_QUERY: - case XDM_BROADCAST: - case XDM_INDIRECT: -#if defined(IPv6) && defined(AF_INET6) - case XDM_MULTICAST: -#endif - send_query_msg(); - break; - case XDM_START_CONNECTION: - send_request_msg(); - break; - case XDM_MANAGE: - send_manage_msg(); - break; - case XDM_KEEPALIVE: - send_keepalive_msg(); - break; - default: - break; - } - rtx = (XDM_MIN_RTX << timeOutRtx); - if (rtx > XDM_MAX_RTX) - rtx = XDM_MAX_RTX; - timeOutTime = GetTimeInMillis() + rtx * 1000; -} - -/* - * The session is declared dead for some reason; too many - * timeouts, or Keepalive failure. - */ - -void -XdmcpDeadSession (char *reason) -{ - ErrorF ("XDM: %s, declaring session dead\n", reason); - state = XDM_INIT_STATE; - isItTimeToYield = TRUE; - dispatchException |= DE_RESET; - timeOutTime = 0; - timeOutRtx = 0; - send_packet(); -} - -/* - * Timeout waiting for an XDMCP response. - */ - -static void -timeout(void) -{ - timeOutRtx++; - if (state == XDM_AWAIT_ALIVE_RESPONSE && timeOutRtx >= XDM_KA_RTX_LIMIT ) - { - XdmcpDeadSession ("too many keepalive retransmissions"); - return; - } - else if (timeOutRtx >= XDM_RTX_LIMIT) - { - /* Quit if "-once" specified, otherwise reset and try again. */ - if (OneSession) { - dispatchException |= DE_TERMINATE; - ErrorF("XDM: too many retransmissions\n"); - } else { - XdmcpDeadSession("too many retransmissions"); - } - return; - } - -#if defined(IPv6) && defined(AF_INET6) - if (state == XDM_COLLECT_QUERY || state == XDM_COLLECT_INDIRECT_QUERY) { - /* Try next address */ - for (mgrAddr = mgrAddr->ai_next; ; mgrAddr = mgrAddr->ai_next) { - if (mgrAddr == NULL) { - mgrAddr = mgrAddrFirst; - } - if (mgrAddr->ai_family == AF_INET - || mgrAddr->ai_family == AF_INET6) - break; - } -#ifndef SIN6_LEN - ManagerAddressLen = mgrAddr->ai_addrlen; -#endif - memcpy(&ManagerAddress, mgrAddr->ai_addr, mgrAddr->ai_addrlen); - } -#endif - - switch (state) { - case XDM_COLLECT_QUERY: - state = XDM_QUERY; - break; - case XDM_COLLECT_BROADCAST_QUERY: - state = XDM_BROADCAST; - break; -#if defined(IPv6) && defined(AF_INET6) - case XDM_COLLECT_MULTICAST_QUERY: - state = XDM_MULTICAST; - break; -#endif - case XDM_COLLECT_INDIRECT_QUERY: - state = XDM_INDIRECT; - break; - case XDM_AWAIT_REQUEST_RESPONSE: - state = XDM_START_CONNECTION; - break; - case XDM_AWAIT_MANAGE_RESPONSE: - state = XDM_MANAGE; - break; - case XDM_AWAIT_ALIVE_RESPONSE: - state = XDM_KEEPALIVE; - break; - default: - break; - } - send_packet(); -} - -static void -restart(void) -{ - state = XDM_INIT_STATE; - timeOutRtx = 0; - send_packet(); -} - -int -XdmcpCheckAuthentication ( - ARRAY8Ptr Name, - ARRAY8Ptr Data, - int packet_type) -{ - return (XdmcpARRAY8Equal (Name, AuthenticationName) && - (AuthenticationName->length == 0 || - (*AuthenticationFuncs->Validator) (AuthenticationData, Data, packet_type))); -} - -int -XdmcpAddAuthorization ( - ARRAY8Ptr name, - ARRAY8Ptr data) -{ - AddAuthorFunc AddAuth; - - if (AuthenticationFuncs && AuthenticationFuncs->AddAuth) - AddAuth = AuthenticationFuncs->AddAuth; - else - AddAuth = AddAuthorization; - return (*AddAuth) ((unsigned short)name->length, - (char *)name->data, - (unsigned short)data->length, - (char *)data->data); -} - -/* - * from here to the end of this file are routines private - * to the state machine. - */ - -static void -get_xdmcp_sock(void) -{ -#ifdef STREAMSCONN - struct netconfig *nconf; - - if ((xdmcpSocket = t_open("/dev/udp", O_RDWR, 0)) < 0) { - XdmcpWarning("t_open() of /dev/udp failed"); - return; - } - - if( t_bind(xdmcpSocket,NULL,NULL) < 0 ) { - XdmcpWarning("UDP socket creation failed"); - t_error("t_bind(xdmcpSocket) failed" ); - t_close(xdmcpSocket); - return; - } - - /* - * This part of the code looks contrived. It will actually fit in nicely - * when the CLTS part of Xtrans is implemented. - */ - - if( (nconf=getnetconfigent("udp")) == NULL ) { - XdmcpWarning("UDP socket creation failed: getnetconfigent()"); - t_unbind(xdmcpSocket); - t_close(xdmcpSocket); - return; - } - - if( netdir_options(nconf, ND_SET_BROADCAST, xdmcpSocket, NULL) ) { - XdmcpWarning("UDP set broadcast option failed: netdir_options()"); - freenetconfigent(nconf); - t_unbind(xdmcpSocket); - t_close(xdmcpSocket); - return; - } - - freenetconfigent(nconf); -#else - int soopts = 1; - -#if defined(IPv6) && defined(AF_INET6) - if ((xdmcpSocket6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) - XdmcpWarning("INET6 UDP socket creation failed"); -#endif - if ((xdmcpSocket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - XdmcpWarning("UDP socket creation failed"); -#ifdef SO_BROADCAST - else if (setsockopt(xdmcpSocket, SOL_SOCKET, SO_BROADCAST, (char *)&soopts, - sizeof(soopts)) < 0) - XdmcpWarning("UDP set broadcast socket-option failed"); -#endif /* SO_BROADCAST */ - if (xdmcpSocket >= 0 && xdm_from != NULL) { - if (bind(xdmcpSocket, (struct sockaddr *)&FromAddress, - FromAddressLen) < 0) { - FatalError("Xserver: failed to bind to -from address: %s\n", xdm_from); - } - } -#endif /* STREAMSCONN */ -} - -static void -send_query_msg(void) -{ - XdmcpHeader header; - Bool broadcast = FALSE; -#if defined(IPv6) && defined(AF_INET6) - Bool multicast = FALSE; -#endif - int i; - int socketfd = xdmcpSocket; - - header.version = XDM_PROTOCOL_VERSION; - switch(state){ - case XDM_QUERY: - header.opcode = (CARD16) QUERY; - state = XDM_COLLECT_QUERY; - break; - case XDM_BROADCAST: - header.opcode = (CARD16) BROADCAST_QUERY; - state = XDM_COLLECT_BROADCAST_QUERY; - broadcast = TRUE; - break; -#if defined(IPv6) && defined(AF_INET6) - case XDM_MULTICAST: - header.opcode = (CARD16) BROADCAST_QUERY; - state = XDM_COLLECT_MULTICAST_QUERY; - multicast = TRUE; - break; -#endif - case XDM_INDIRECT: - header.opcode = (CARD16) INDIRECT_QUERY; - state = XDM_COLLECT_INDIRECT_QUERY; - break; - default: - break; - } - header.length = 1; - for (i = 0; i < AuthenticationNames.length; i++) - header.length += 2 + AuthenticationNames.data[i].length; - - XdmcpWriteHeader (&buffer, &header); - XdmcpWriteARRAYofARRAY8 (&buffer, &AuthenticationNames); - if (broadcast) - { - int i; - - for (i = 0; i < NumBroadcastAddresses; i++) - XdmcpFlush (xdmcpSocket, &buffer, (XdmcpNetaddr) &BroadcastAddresses[i], - sizeof (struct sockaddr_in)); - } -#if defined(IPv6) && defined(AF_INET6) - else if (multicast) - { - struct multicastinfo *mcl; - struct addrinfo *ai; - - for (mcl = mcastlist; mcl != NULL; mcl = mcl->next) { - for (ai = mcl->ai ; ai != NULL; ai = ai->ai_next) { - if (ai->ai_family == AF_INET) { - unsigned char hopflag = (unsigned char) mcl->hops; - socketfd = xdmcpSocket; - setsockopt(socketfd, IPPROTO_IP, IP_MULTICAST_TTL, - &hopflag, sizeof(hopflag)); - } else if (ai->ai_family == AF_INET6) { - int hopflag6 = mcl->hops; - socketfd = xdmcpSocket6; - setsockopt(socketfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, - &hopflag6, sizeof(hopflag6)); - } else { - continue; - } - XdmcpFlush (socketfd, &buffer, - (XdmcpNetaddr) ai->ai_addr, ai->ai_addrlen); - break; - } - } - } -#endif - else - { -#if defined(IPv6) && defined(AF_INET6) - if (SOCKADDR_FAMILY(ManagerAddress) == AF_INET6) - socketfd = xdmcpSocket6; -#endif - XdmcpFlush (socketfd, &buffer, (XdmcpNetaddr) &ManagerAddress, - ManagerAddressLen); - } -} - -static void -recv_willing_msg( - struct sockaddr *from, - int fromlen, - unsigned length) -{ - ARRAY8 authenticationName; - ARRAY8 hostname; - ARRAY8 status; - - authenticationName.data = 0; - hostname.data = 0; - status.data = 0; - if (XdmcpReadARRAY8 (&buffer, &authenticationName) && - XdmcpReadARRAY8 (&buffer, &hostname) && - XdmcpReadARRAY8 (&buffer, &status)) - { - if (length == 6 + authenticationName.length + - hostname.length + status.length) - { - switch (state) - { - case XDM_COLLECT_QUERY: - XdmcpSelectHost(from, fromlen, &authenticationName); - break; - case XDM_COLLECT_BROADCAST_QUERY: -#if defined(IPv6) && defined(AF_INET6) - case XDM_COLLECT_MULTICAST_QUERY: -#endif - case XDM_COLLECT_INDIRECT_QUERY: - XdmcpAddHost(from, fromlen, &authenticationName, &hostname, &status); - break; - default: - break; - } - } - } - XdmcpDisposeARRAY8 (&authenticationName); - XdmcpDisposeARRAY8 (&hostname); - XdmcpDisposeARRAY8 (&status); -} - -static void -send_request_msg(void) -{ - XdmcpHeader header; - int length; - int i; - CARD16 XdmcpConnectionType; - ARRAY8 authenticationData; - int socketfd = xdmcpSocket; - - switch (SOCKADDR_FAMILY(ManagerAddress)) - { - case AF_INET: XdmcpConnectionType=FamilyInternet; break; -#if defined(IPv6) && defined(AF_INET6) - case AF_INET6: XdmcpConnectionType=FamilyInternet6; break; -#endif - default: XdmcpConnectionType=0xffff; break; - } - - header.version = XDM_PROTOCOL_VERSION; - header.opcode = (CARD16) REQUEST; - - length = 2; /* display number */ - length += 1 + 2 * ConnectionTypes.length; /* connection types */ - length += 1; /* connection addresses */ - for (i = 0; i < ConnectionAddresses.length; i++) - length += 2 + ConnectionAddresses.data[i].length; - authenticationData.length = 0; - authenticationData.data = 0; - if (AuthenticationFuncs) - { - (*AuthenticationFuncs->Generator) (AuthenticationData, - &authenticationData, - REQUEST); - } - length += 2 + AuthenticationName->length; /* authentication name */ - length += 2 + authenticationData.length; /* authentication data */ - length += 1; /* authorization names */ - for (i = 0; i < AuthorizationNames.length; i++) - length += 2 + AuthorizationNames.data[i].length; - length += 2 + ManufacturerDisplayID.length; /* display ID */ - header.length = length; - - if (!XdmcpWriteHeader (&buffer, &header)) - { - XdmcpDisposeARRAY8 (&authenticationData); - return; - } - XdmcpWriteCARD16 (&buffer, DisplayNumber); - XdmcpWriteCARD8 (&buffer, ConnectionTypes.length); - - /* The connection array is send reordered, so that connections of */ - /* the same address type as the XDMCP manager connection are send */ - /* first. This works around a bug in xdm. mario@klebsch.de */ - for (i = 0; i < (int)ConnectionTypes.length; i++) - if (ConnectionTypes.data[i]==XdmcpConnectionType) - XdmcpWriteCARD16 (&buffer, ConnectionTypes.data[i]); - for (i = 0; i < (int)ConnectionTypes.length; i++) - if (ConnectionTypes.data[i]!=XdmcpConnectionType) - XdmcpWriteCARD16 (&buffer, ConnectionTypes.data[i]); - - XdmcpWriteCARD8 (&buffer, ConnectionAddresses.length); - for (i = 0; i < (int)ConnectionAddresses.length; i++) - if ( (i=ConnectionTypes.length) || - (ConnectionTypes.data[i]!=XdmcpConnectionType) ) - XdmcpWriteARRAY8 (&buffer, &ConnectionAddresses.data[i]); - - XdmcpWriteARRAY8 (&buffer, AuthenticationName); - XdmcpWriteARRAY8 (&buffer, &authenticationData); - XdmcpDisposeARRAY8 (&authenticationData); - XdmcpWriteARRAYofARRAY8 (&buffer, &AuthorizationNames); - XdmcpWriteARRAY8 (&buffer, &ManufacturerDisplayID); -#if defined(IPv6) && defined(AF_INET6) - if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) - socketfd = xdmcpSocket6; -#endif - if (XdmcpFlush (socketfd, &buffer, - (XdmcpNetaddr) &req_sockaddr, req_socklen)) - state = XDM_AWAIT_REQUEST_RESPONSE; -} - -static void -recv_accept_msg(unsigned length) -{ - CARD32 AcceptSessionID; - ARRAY8 AcceptAuthenticationName, AcceptAuthenticationData; - ARRAY8 AcceptAuthorizationName, AcceptAuthorizationData; - - if (state != XDM_AWAIT_REQUEST_RESPONSE) - return; - AcceptAuthenticationName.data = 0; - AcceptAuthenticationData.data = 0; - AcceptAuthorizationName.data = 0; - AcceptAuthorizationData.data = 0; - if (XdmcpReadCARD32 (&buffer, &AcceptSessionID) && - XdmcpReadARRAY8 (&buffer, &AcceptAuthenticationName) && - XdmcpReadARRAY8 (&buffer, &AcceptAuthenticationData) && - XdmcpReadARRAY8 (&buffer, &AcceptAuthorizationName) && - XdmcpReadARRAY8 (&buffer, &AcceptAuthorizationData)) - { - if (length == 12 + AcceptAuthenticationName.length + - AcceptAuthenticationData.length + - AcceptAuthorizationName.length + - AcceptAuthorizationData.length) - { - if (!XdmcpCheckAuthentication (&AcceptAuthenticationName, - &AcceptAuthenticationData, ACCEPT)) - { - XdmcpFatal ("Authentication Failure", &AcceptAuthenticationName); - } - /* permit access control manipulations from this host */ - AugmentSelf (&req_sockaddr, req_socklen); - /* if the authorization specified in the packet fails - * to be acceptable, enable the local addresses - */ - if (!XdmcpAddAuthorization (&AcceptAuthorizationName, - &AcceptAuthorizationData)) - { - AddLocalHosts (); - } - SessionID = AcceptSessionID; - state = XDM_MANAGE; - send_packet(); - } - } - XdmcpDisposeARRAY8 (&AcceptAuthenticationName); - XdmcpDisposeARRAY8 (&AcceptAuthenticationData); - XdmcpDisposeARRAY8 (&AcceptAuthorizationName); - XdmcpDisposeARRAY8 (&AcceptAuthorizationData); -} - -static void -recv_decline_msg(unsigned length) -{ - ARRAY8 status, DeclineAuthenticationName, DeclineAuthenticationData; - - status.data = 0; - DeclineAuthenticationName.data = 0; - DeclineAuthenticationData.data = 0; - if (XdmcpReadARRAY8 (&buffer, &status) && - XdmcpReadARRAY8 (&buffer, &DeclineAuthenticationName) && - XdmcpReadARRAY8 (&buffer, &DeclineAuthenticationData)) - { - if (length == 6 + status.length + - DeclineAuthenticationName.length + - DeclineAuthenticationData.length && - XdmcpCheckAuthentication (&DeclineAuthenticationName, - &DeclineAuthenticationData, DECLINE)) - { - XdmcpFatal ("Session declined", &status); - } - } - XdmcpDisposeARRAY8 (&status); - XdmcpDisposeARRAY8 (&DeclineAuthenticationName); - XdmcpDisposeARRAY8 (&DeclineAuthenticationData); -} - -static void -send_manage_msg(void) -{ - XdmcpHeader header; - int socketfd = xdmcpSocket; - - header.version = XDM_PROTOCOL_VERSION; - header.opcode = (CARD16) MANAGE; - header.length = 8 + DisplayClass.length; - - if (!XdmcpWriteHeader (&buffer, &header)) - return; - XdmcpWriteCARD32 (&buffer, SessionID); - XdmcpWriteCARD16 (&buffer, DisplayNumber); - XdmcpWriteARRAY8 (&buffer, &DisplayClass); - state = XDM_AWAIT_MANAGE_RESPONSE; -#if defined(IPv6) && defined(AF_INET6) - if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) - socketfd = xdmcpSocket6; -#endif - XdmcpFlush (socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen); -} - -static void -recv_refuse_msg(unsigned length) -{ - CARD32 RefusedSessionID; - - if (state != XDM_AWAIT_MANAGE_RESPONSE) - return; - if (length != 4) - return; - if (XdmcpReadCARD32 (&buffer, &RefusedSessionID)) - { - if (RefusedSessionID == SessionID) - { - state = XDM_START_CONNECTION; - send_packet(); - } - } -} - -static void -recv_failed_msg(unsigned length) -{ - CARD32 FailedSessionID; - ARRAY8 status; - - if (state != XDM_AWAIT_MANAGE_RESPONSE) - return; - status.data = 0; - if (XdmcpReadCARD32 (&buffer, &FailedSessionID) && - XdmcpReadARRAY8 (&buffer, &status)) - { - if (length == 6 + status.length && - SessionID == FailedSessionID) - { - XdmcpFatal ("Session failed", &status); - } - } - XdmcpDisposeARRAY8 (&status); -} - -static void -send_keepalive_msg(void) -{ - XdmcpHeader header; - int socketfd = xdmcpSocket; - - header.version = XDM_PROTOCOL_VERSION; - header.opcode = (CARD16) KEEPALIVE; - header.length = 6; - - XdmcpWriteHeader (&buffer, &header); - XdmcpWriteCARD16 (&buffer, DisplayNumber); - XdmcpWriteCARD32 (&buffer, SessionID); - - state = XDM_AWAIT_ALIVE_RESPONSE; -#if defined(IPv6) && defined(AF_INET6) - if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) - socketfd = xdmcpSocket6; -#endif - XdmcpFlush (socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen); -} - -static void -recv_alive_msg (unsigned length) -{ - CARD8 SessionRunning; - CARD32 AliveSessionID; - - if (state != XDM_AWAIT_ALIVE_RESPONSE) - return; - if (length != 5) - return; - if (XdmcpReadCARD8 (&buffer, &SessionRunning) && - XdmcpReadCARD32 (&buffer, &AliveSessionID)) - { - if (SessionRunning && AliveSessionID == SessionID) - { - /* backoff dormancy period */ - state = XDM_RUN_SESSION; - if ((GetTimeInMillis() - lastDeviceEventTime.milliseconds) > - keepaliveDormancy * 1000) - { - keepaliveDormancy <<= 1; - if (keepaliveDormancy > XDM_MAX_DORMANCY) - keepaliveDormancy = XDM_MAX_DORMANCY; - } - timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; - } - else - { - XdmcpDeadSession ("Alive response indicates session dead"); - } - } -} - -static void -XdmcpFatal ( - char *type, - ARRAY8Ptr status) -{ - FatalError ("XDMCP fatal error: %s %*.*s\n", type, - status->length, status->length, status->data); -} - -static void -XdmcpWarning(char *str) -{ - ErrorF("XDMCP warning: %s\n", str); -} - -static void -get_addr_by_name( - char * argtype, - char * namestr, - int port, - int socktype, - SOCKADDR_TYPE *addr, - SOCKLEN_TYPE *addrlen -#if defined(IPv6) && defined(AF_INET6) - , - struct addrinfo **aip, - struct addrinfo **aifirstp -#endif - ) -{ -#if defined(IPv6) && defined(AF_INET6) - struct addrinfo *ai; - struct addrinfo hints; - char portstr[6]; - char *pport = portstr; - int gaierr; - - bzero(&hints, sizeof(hints)); - hints.ai_socktype = socktype; - - if (port == 0) { - pport = NULL; - } else if (port > 0 && port < 65535) { - sprintf(portstr, "%d", port); - } else { - FatalError("Xserver: port out of range: %d\n", port); - } - - if (*aifirstp != NULL) { - freeaddrinfo(*aifirstp); - *aifirstp = NULL; - } - - if ((gaierr = getaddrinfo(namestr, pport, &hints, aifirstp)) == 0) { - for (ai = *aifirstp; ai != NULL; ai = ai->ai_next) { - if (ai->ai_family == AF_INET || ai->ai_family == AF_INET6) - break; - } - if ((ai == NULL) || (ai->ai_addrlen > sizeof(SOCKADDR_TYPE))) { - FatalError ("Xserver: %s host %s not on supported network type\n", - argtype, namestr); - } else { - *aip = ai; - *addrlen = ai->ai_addrlen; - memcpy(addr, ai->ai_addr, ai->ai_addrlen); - } - } else { - FatalError("Xserver: %s: %s %s\n", gai_strerror(gaierr), argtype, namestr); - } -#else - struct hostent *hep; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgethostbynameparams hparams; -#endif -#if defined(WIN32) && (defined(TCPCONN) || defined(DNETCONN)) - _XSERVTransWSAStartup(); -#endif - if (!(hep = _XGethostbyname(namestr, hparams))) - { - FatalError("Xserver: %s unknown host: %s\n", argtype, namestr); - } - if (hep->h_length == sizeof (struct in_addr)) - { - memmove(&addr->sin_addr, hep->h_addr, hep->h_length); - *addrlen = sizeof(struct sockaddr_in); - addr->sin_family = AF_INET; - addr->sin_port = htons (port); - } - else - { - FatalError("Xserver: %s host on strange network %s\n", argtype, namestr); - } -#endif -} - -static void -get_manager_by_name( - int argc, - char **argv, - int i) -{ - - if ((i + 1) == argc) - { - FatalError("Xserver: missing %s host name in command line\n", argv[i]); - } - - get_addr_by_name(argv[i], argv[i+1], xdm_udp_port, SOCK_DGRAM, - &ManagerAddress, &ManagerAddressLen -#if defined(IPv6) && defined(AF_INET6) - , &mgrAddr, &mgrAddrFirst -#endif - ); -} - - -static void -get_fromaddr_by_name( - int argc, - char **argv, - int i) -{ -#if defined(IPv6) && defined(AF_INET6) - struct addrinfo *ai = NULL; - struct addrinfo *aifirst = NULL; -#endif - if (i == argc) - { - FatalError("Xserver: missing -from host name in command line\n"); - } - get_addr_by_name("-from", argv[i], 0, 0, &FromAddress, &FromAddressLen -#if defined(IPv6) && defined(AF_INET6) - , &ai, &aifirst -#endif - ); - xdm_from = argv[i]; -} - - -#if defined(IPv6) && defined(AF_INET6) -static int -get_mcast_options(argc, argv, i) - int argc, i; - char **argv; -{ - char *address = XDM_DEFAULT_MCAST_ADDR6; - int hopcount = 1; - struct addrinfo hints; - char portstr[6]; - int gaierr; - struct addrinfo *ai, *firstai; - - if ((i < argc) && (argv[i][0] != '-') && (argv[i][0] != '+')) { - address = argv[i++]; - if ((i < argc) && (argv[i][0] != '-') && (argv[i][0] != '+')) { - hopcount = strtol(argv[i++], NULL, 10); - if ((hopcount < 1) || (hopcount > 255)) { - FatalError("Xserver: multicast hop count out of range: %d\n", - hopcount); - } - } - } - - if (xdm_udp_port > 0 && xdm_udp_port < 65535) { - sprintf(portstr, "%d", xdm_udp_port); - } else { - FatalError("Xserver: port out of range: %d\n", xdm_udp_port); - } - bzero(&hints, sizeof(hints)); - hints.ai_socktype = SOCK_DGRAM; - - if ((gaierr = getaddrinfo(address, portstr, &hints, &firstai)) == 0) { - for (ai = firstai; ai != NULL; ai = ai->ai_next) { - if (((ai->ai_family == AF_INET) && - IN_MULTICAST(((struct sockaddr_in *) ai->ai_addr) - ->sin_addr.s_addr)) - || ((ai->ai_family == AF_INET6) && - IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *) ai->ai_addr) - ->sin6_addr))) - break; - } - if (ai == NULL) { - FatalError ("Xserver: address not supported multicast type %s\n", - address); - } else { - struct multicastinfo *mcastinfo, *mcl; - - mcastinfo = malloc(sizeof(struct multicastinfo)); - mcastinfo->next = NULL; - mcastinfo->ai = firstai; - mcastinfo->hops = hopcount; - - if (mcastlist == NULL) { - mcastlist = mcastinfo; - } else { - for (mcl = mcastlist; mcl->next != NULL; mcl = mcl->next) { - /* Do nothing - just find end of list */ - } - mcl->next = mcastinfo; - } - } - } else { - FatalError("Xserver: %s: %s\n", gai_strerror(gaierr), address); - } - return i; -} -#endif - -#else -static int xdmcp_non_empty; /* avoid complaint by ranlib */ -#endif /* XDMCP */ diff --git a/nx-X11/programs/Xserver/os/xdmcp.c.X.original b/nx-X11/programs/Xserver/os/xdmcp.c.X.original deleted file mode 100644 index 19a62a56b..000000000 --- a/nx-X11/programs/Xserver/os/xdmcp.c.X.original +++ /dev/null @@ -1,1681 +0,0 @@ -/* $XdotOrg: xc/programs/Xserver/os/xdmcp.c,v 1.10 2005/07/03 08:53:52 daniels Exp $ */ -/* $Xorg: xdmcp.c,v 1.4 2001/01/31 13:37:19 pookie Exp $ */ -/* - * Copyright 1989 Network Computing Devices, Inc., Mountain View, California. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of N.C.D. not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. N.C.D. makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - */ -/* $XFree86: xc/programs/Xserver/os/xdmcp.c,v 3.31 2003/12/30 21:24:32 herrb Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#endif - -#include - -#if !defined(WIN32) -#ifndef Lynx -#include -#include -#else -#include -#endif -#include -#include -#endif - -#include -#include -#include -#include -#include "misc.h" -#include -#include "osdep.h" -#include "input.h" -#include "dixstruct.h" -#include "opaque.h" - -#if defined(DGUX) -#include -#include -#endif - -#ifdef STREAMSCONN -#include -#include -#include -#endif - -#ifdef XDMCP -#undef REQUEST - -#ifdef XDMCP_NO_IPV6 -#undef IPv6 -#endif - -#include - -#define X_INCLUDE_NETDB_H -#include - -extern char *defaultDisplayClass; - -static int xdmcpSocket, sessionSocket; -static xdmcp_states state; -#if defined(IPv6) && defined(AF_INET6) -static int xdmcpSocket6; -static struct sockaddr_storage req_sockaddr; -#else -static struct sockaddr_in req_sockaddr; -#endif -static int req_socklen; -static CARD32 SessionID; -static CARD32 timeOutTime; -static int timeOutRtx; -static CARD32 defaultKeepaliveDormancy = XDM_DEF_DORMANCY; -static CARD32 keepaliveDormancy = XDM_DEF_DORMANCY; -static CARD16 DisplayNumber; -static xdmcp_states XDM_INIT_STATE = XDM_OFF; -#ifdef HASXDMAUTH -static char *xdmAuthCookie; -#endif - -static XdmcpBuffer buffer; - -#if defined(IPv6) && defined(AF_INET6) - -static struct addrinfo *mgrAddr; -static struct addrinfo *mgrAddrFirst; - -#define SOCKADDR_TYPE struct sockaddr_storage -#define SOCKADDR_FAMILY(s) ((struct sockaddr *)&(s))->sa_family - -#ifdef BSD44SOCKETS -#define SOCKLEN_FIELD(s) ((struct sockaddr *)&(s))->sa_len -#define SOCKLEN_TYPE unsigned char -#else -#define SOCKLEN_TYPE unsigned int -#endif - -#else - -#define SOCKADDR_TYPE struct sockaddr_in -#define SOCKADDR_FAMILY(s) (s).sin_family - -#ifdef BSD44SOCKETS -#define SOCKLEN_FIELD(s) (s).sin_len -#define SOCKLEN_TYPE unsigned char -#else -#define SOCKLEN_TYPE size_t -#endif - -#endif - -static SOCKADDR_TYPE ManagerAddress; -static SOCKADDR_TYPE FromAddress; - -#ifdef SOCKLEN_FIELD -#define ManagerAddressLen SOCKLEN_FIELD(ManagerAddress) -#define FromAddressLen SOCKLEN_FIELD(FromAddress) -#else -static SOCKLEN_TYPE ManagerAddressLen, FromAddressLen; -#endif - -#if defined(IPv6) && defined(AF_INET6) -static struct multicastinfo { - struct multicastinfo *next; - struct addrinfo *ai; - int hops; -} *mcastlist; -#endif - -static void XdmcpAddHost( - struct sockaddr *from, - int fromlen, - ARRAY8Ptr AuthenticationName, - ARRAY8Ptr hostname, - ARRAY8Ptr status); - -static void XdmcpSelectHost( - struct sockaddr *host_sockaddr, - int host_len, - ARRAY8Ptr AuthenticationName); - -static void get_xdmcp_sock(void); - -static void send_query_msg(void); - -static void recv_willing_msg( - struct sockaddr * /*from*/, - int /*fromlen*/, - unsigned /*length*/); - -static void send_request_msg(void); - -static void recv_accept_msg(unsigned /*length*/); - -static void recv_decline_msg(unsigned /*length*/); - -static void send_manage_msg(void); - -static void recv_refuse_msg(unsigned /*length*/); - -static void recv_failed_msg(unsigned /*length*/); - -static void send_keepalive_msg(void); - -static void recv_alive_msg(unsigned /*length*/); - -static void XdmcpFatal( - char * /*type*/, - ARRAY8Ptr /*status*/); - -static void XdmcpWarning(char * /*str*/); - -static void get_manager_by_name( - int /*argc*/, - char ** /*argv*/, - int /*i*/); - -static void get_fromaddr_by_name(int /*argc*/, char ** /*argv*/, int /*i*/); - -#if defined(IPv6) && defined(AF_INET6) -static int get_mcast_options(int /*argc*/, char ** /*argv*/, int /*i*/); -#endif - -static void receive_packet(int /*socketfd*/); - -static void send_packet(void); - -extern void XdmcpDeadSession(char * /*reason*/); - -static void timeout(void); - -static void restart(void); - -static void XdmcpBlockHandler( - pointer /*data*/, - struct timeval ** /*wt*/, - pointer /*LastSelectMask*/); - -static void XdmcpWakeupHandler( - pointer /*data*/, - int /*i*/, - pointer /*LastSelectMask*/); - -void XdmcpRegisterManufacturerDisplayID( - char * /*name*/, - int /*length*/); - - -static unsigned short xdm_udp_port = XDM_UDP_PORT; -static Bool OneSession = FALSE; -static const char *xdm_from = NULL; - -void -XdmcpUseMsg (void) -{ - ErrorF("-query host-name contact named host for XDMCP\n"); - ErrorF("-broadcast broadcast for XDMCP\n"); -#if defined(IPv6) && defined(AF_INET6) - ErrorF("-multicast [addr [hops]] IPv6 multicast for XDMCP\n"); -#endif - ErrorF("-indirect host-name contact named host for indirect XDMCP\n"); - ErrorF("-port port-num UDP port number to send messages to\n"); - ErrorF("-from local-address specify the local address to connect from\n"); - ErrorF("-once Terminate server after one session\n"); - ErrorF("-class display-class specify display class to send in manage\n"); -#ifdef HASXDMAUTH - ErrorF("-cookie xdm-auth-bits specify the magic cookie for XDMCP\n"); -#endif - ErrorF("-displayID display-id manufacturer display ID for request\n"); -} - -int -XdmcpOptions(int argc, char **argv, int i) -{ - if (strcmp(argv[i], "-query") == 0) { - get_manager_by_name(argc, argv, i++); - XDM_INIT_STATE = XDM_QUERY; - AccessUsingXdmcp (); - return (i + 1); - } - if (strcmp(argv[i], "-broadcast") == 0) { - XDM_INIT_STATE = XDM_BROADCAST; - AccessUsingXdmcp (); - return (i + 1); - } -#if defined(IPv6) && defined(AF_INET6) - if (strcmp(argv[i], "-multicast") == 0) { - i = get_mcast_options(argc, argv, ++i); - XDM_INIT_STATE = XDM_MULTICAST; - AccessUsingXdmcp (); - return (i + 1); - } -#endif - if (strcmp(argv[i], "-indirect") == 0) { - get_manager_by_name(argc, argv, i++); - XDM_INIT_STATE = XDM_INDIRECT; - AccessUsingXdmcp (); - return (i + 1); - } - if (strcmp(argv[i], "-port") == 0) { - if (++i == argc) { - FatalError("Xserver: missing port number in command line\n"); - } - xdm_udp_port = (unsigned short) atoi(argv[i]); - return (i + 1); - } - if (strcmp(argv[i], "-from") == 0) { - get_fromaddr_by_name(argc, argv, ++i); - return (i + 1); - } - if (strcmp(argv[i], "-once") == 0) { - OneSession = TRUE; - return (i + 1); - } - if (strcmp(argv[i], "-class") == 0) { - if (++i == argc) { - FatalError("Xserver: missing class name in command line\n"); - } - defaultDisplayClass = argv[i]; - return (i + 1); - } -#ifdef HASXDMAUTH - if (strcmp(argv[i], "-cookie") == 0) { - if (++i == argc) { - FatalError("Xserver: missing cookie data in command line\n"); - } - xdmAuthCookie = argv[i]; - return (i + 1); - } -#endif - if (strcmp(argv[i], "-displayID") == 0) { - if (++i == argc) { - FatalError("Xserver: missing displayID in command line\n"); - } - XdmcpRegisterManufacturerDisplayID (argv[i], strlen (argv[i])); - return (i + 1); - } - return (i); -} - -/* - * This section is a collection of routines for - * registering server-specific data with the XDMCP - * state machine. - */ - - -/* - * Save all broadcast addresses away so BroadcastQuery - * packets get sent everywhere - */ - -#define MAX_BROADCAST 10 - -/* This stays sockaddr_in since IPv6 doesn't support broadcast */ -static struct sockaddr_in BroadcastAddresses[MAX_BROADCAST]; -static int NumBroadcastAddresses; - -void -XdmcpRegisterBroadcastAddress (struct sockaddr_in *addr) -{ - struct sockaddr_in *bcast; - if (NumBroadcastAddresses >= MAX_BROADCAST) - return; - bcast = &BroadcastAddresses[NumBroadcastAddresses++]; - bzero (bcast, sizeof (struct sockaddr_in)); -#ifdef BSD44SOCKETS - bcast->sin_len = addr->sin_len; -#endif - bcast->sin_family = addr->sin_family; - bcast->sin_port = htons (xdm_udp_port); - bcast->sin_addr = addr->sin_addr; -} - -/* - * Each authentication type is registered here; Validator - * will be called to check all access attempts using - * the specified authentication type - */ - -static ARRAYofARRAY8 AuthenticationNames, AuthenticationDatas; -typedef struct _AuthenticationFuncs { - ValidatorFunc Validator; - GeneratorFunc Generator; - AddAuthorFunc AddAuth; -} AuthenticationFuncsRec, *AuthenticationFuncsPtr; - -static AuthenticationFuncsPtr AuthenticationFuncsList; - -void -XdmcpRegisterAuthentication ( - char *name, - int namelen, - char *data, - int datalen, - ValidatorFunc Validator, - GeneratorFunc Generator, - AddAuthorFunc AddAuth) -{ - int i; - ARRAY8 AuthenticationName, AuthenticationData; - static AuthenticationFuncsPtr newFuncs; - - if (!XdmcpAllocARRAY8 (&AuthenticationName, namelen)) - return; - if (!XdmcpAllocARRAY8 (&AuthenticationData, datalen)) - { - XdmcpDisposeARRAY8 (&AuthenticationName); - return; - } - for (i = 0; i < namelen; i++) - AuthenticationName.data[i] = name[i]; - for (i = 0; i < datalen; i++) - AuthenticationData.data[i] = data[i]; - if (!(XdmcpReallocARRAYofARRAY8 (&AuthenticationNames, - AuthenticationNames.length + 1) && - XdmcpReallocARRAYofARRAY8 (&AuthenticationDatas, - AuthenticationDatas.length + 1) && - (newFuncs = (AuthenticationFuncsPtr) xalloc ( - (AuthenticationNames.length + 1) * sizeof (AuthenticationFuncsRec))))) - { - XdmcpDisposeARRAY8 (&AuthenticationName); - XdmcpDisposeARRAY8 (&AuthenticationData); - return; - } - for (i = 0; i < AuthenticationNames.length - 1; i++) - newFuncs[i] = AuthenticationFuncsList[i]; - newFuncs[AuthenticationNames.length-1].Validator = Validator; - newFuncs[AuthenticationNames.length-1].Generator = Generator; - newFuncs[AuthenticationNames.length-1].AddAuth = AddAuth; - xfree (AuthenticationFuncsList); - AuthenticationFuncsList = newFuncs; - AuthenticationNames.data[AuthenticationNames.length-1] = AuthenticationName; - AuthenticationDatas.data[AuthenticationDatas.length-1] = AuthenticationData; -} - -/* - * Select the authentication type to be used; this is - * set by the manager of the host to be connected to. - */ - -ARRAY8 noAuthenticationName = {(CARD16) 0, (CARD8Ptr) 0}; -ARRAY8 noAuthenticationData = {(CARD16) 0, (CARD8Ptr) 0}; -ARRAY8Ptr AuthenticationName = &noAuthenticationName; -ARRAY8Ptr AuthenticationData = &noAuthenticationData; -AuthenticationFuncsPtr AuthenticationFuncs; - -void -XdmcpSetAuthentication (ARRAY8Ptr name) -{ - int i; - - for (i = 0; i < AuthenticationNames.length; i++) - if (XdmcpARRAY8Equal (&AuthenticationNames.data[i], name)) - { - AuthenticationName = &AuthenticationNames.data[i]; - AuthenticationData = &AuthenticationDatas.data[i]; - AuthenticationFuncs = &AuthenticationFuncsList[i]; - break; - } -} - -/* - * Register the host address for the display - */ - -static ARRAY16 ConnectionTypes; -static ARRAYofARRAY8 ConnectionAddresses; -static long xdmcpGeneration; - -void -XdmcpRegisterConnection ( - int type, - char *address, - int addrlen) -{ - int i; - CARD8 *newAddress; - - if (xdmcpGeneration != serverGeneration) - { - XdmcpDisposeARRAY16 (&ConnectionTypes); - XdmcpDisposeARRAYofARRAY8 (&ConnectionAddresses); - xdmcpGeneration = serverGeneration; - } - if (xdm_from != NULL) { /* Only register the requested address */ - const void *regAddr = address; - const void *fromAddr = NULL; - int regAddrlen = addrlen; - - if (addrlen == sizeof(struct in_addr)) { - if (SOCKADDR_FAMILY(FromAddress) == AF_INET) { - fromAddr = &((struct sockaddr_in *)&FromAddress)->sin_addr; - } -#if defined(IPv6) && defined(AF_INET6) - else if ((SOCKADDR_FAMILY(FromAddress) == AF_INET6) && - IN6_IS_ADDR_V4MAPPED( - &((struct sockaddr_in6 *)&FromAddress)->sin6_addr)) { - fromAddr = &((struct sockaddr_in6 *)&FromAddress)->sin6_addr.s6_addr[12]; - } -#endif - } -#if defined(IPv6) && defined(AF_INET6) - else if (addrlen == sizeof(struct in6_addr)) { - if (SOCKADDR_FAMILY(FromAddress) == AF_INET6) { - fromAddr = &((struct sockaddr_in6 *)&FromAddress)->sin6_addr; - } else if ((SOCKADDR_FAMILY(FromAddress) == AF_INET) && - IN6_IS_ADDR_V4MAPPED((struct in6_addr *) address)) { - fromAddr = &((struct sockaddr_in *)&FromAddress)->sin_addr; - regAddr = &((struct sockaddr_in6 *)&address)->sin6_addr.s6_addr[12]; - regAddrlen = sizeof(struct in_addr); - } - } -#endif - if (fromAddr && memcmp(regAddr, fromAddr, regAddrlen) != 0) { - return; - } - } - newAddress = (CARD8 *) xalloc (addrlen * sizeof (CARD8)); - if (!newAddress) - return; - if (!XdmcpReallocARRAY16 (&ConnectionTypes, ConnectionTypes.length + 1)) - { - xfree (newAddress); - return; - } - if (!XdmcpReallocARRAYofARRAY8 (&ConnectionAddresses, - ConnectionAddresses.length + 1)) - { - xfree (newAddress); - return; - } - ConnectionTypes.data[ConnectionTypes.length - 1] = (CARD16) type; - for (i = 0; i < addrlen; i++) - newAddress[i] = address[i]; - ConnectionAddresses.data[ConnectionAddresses.length-1].data = newAddress; - ConnectionAddresses.data[ConnectionAddresses.length-1].length = addrlen; -} - -/* - * Register an Authorization Name. XDMCP advertises this list - * to the manager. - */ - -static ARRAYofARRAY8 AuthorizationNames; - -void -XdmcpRegisterAuthorizations (void) -{ - XdmcpDisposeARRAYofARRAY8 (&AuthorizationNames); - RegisterAuthorizations (); -} - -void -XdmcpRegisterAuthorization (char *name, int namelen) -{ - ARRAY8 authName; - int i; - - authName.data = (CARD8 *) xalloc (namelen * sizeof (CARD8)); - if (!authName.data) - return; - if (!XdmcpReallocARRAYofARRAY8 (&AuthorizationNames, AuthorizationNames.length +1)) - { - xfree (authName.data); - return; - } - for (i = 0; i < namelen; i++) - authName.data[i] = (CARD8) name[i]; - authName.length = namelen; - AuthorizationNames.data[AuthorizationNames.length-1] = authName; -} - -/* - * Register the DisplayClass string - */ - -ARRAY8 DisplayClass; - -void -XdmcpRegisterDisplayClass (char *name, int length) -{ - int i; - - XdmcpDisposeARRAY8 (&DisplayClass); - if (!XdmcpAllocARRAY8 (&DisplayClass, length)) - return; - for (i = 0; i < length; i++) - DisplayClass.data[i] = (CARD8) name[i]; -} - -/* - * Register the Manufacturer display ID - */ - -ARRAY8 ManufacturerDisplayID; - -void -XdmcpRegisterManufacturerDisplayID (char *name, int length) -{ - int i; - - XdmcpDisposeARRAY8 (&ManufacturerDisplayID); - if (!XdmcpAllocARRAY8 (&ManufacturerDisplayID, length)) - return; - for (i = 0; i < length; i++) - ManufacturerDisplayID.data[i] = (CARD8) name[i]; -} - -/* - * initialize XDMCP; create the socket, compute the display - * number, set up the state machine - */ - -void -XdmcpInit(void) -{ - state = XDM_INIT_STATE; -#ifdef HASXDMAUTH - if (xdmAuthCookie) - XdmAuthenticationInit (xdmAuthCookie, strlen (xdmAuthCookie)); -#endif - if (state != XDM_OFF) - { - XdmcpRegisterAuthorizations(); - XdmcpRegisterDisplayClass (defaultDisplayClass, strlen (defaultDisplayClass)); - AccessUsingXdmcp(); - RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler, - (pointer) 0); - timeOutRtx = 0; - DisplayNumber = (CARD16) atoi(display); - get_xdmcp_sock(); - send_packet(); - } -} - -void -XdmcpReset (void) -{ - state = XDM_INIT_STATE; - if (state != XDM_OFF) - { - RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler, - (pointer) 0); - timeOutRtx = 0; - send_packet(); - } -} - -/* - * Called whenever a new connection is created; notices the - * first connection and saves it to terminate the session - * when it is closed - */ - -void -XdmcpOpenDisplay(int sock) -{ - if (state != XDM_AWAIT_MANAGE_RESPONSE) - return; - state = XDM_RUN_SESSION; - sessionSocket = sock; -} - -void -XdmcpCloseDisplay(int sock) -{ - if ((state != XDM_RUN_SESSION && state != XDM_AWAIT_ALIVE_RESPONSE) - || sessionSocket != sock) - return; - state = XDM_INIT_STATE; - if (OneSession) - dispatchException |= DE_TERMINATE; - else - dispatchException |= DE_RESET; - isItTimeToYield = TRUE; -} - -/* - * called before going to sleep, this routine - * may modify the timeout value about to be sent - * to select; in this way XDMCP can do appropriate things - * dynamically while starting up - */ - -/*ARGSUSED*/ -static void -XdmcpBlockHandler( - pointer data, /* unused */ - struct timeval **wt, - pointer pReadmask) -{ - fd_set *LastSelectMask = (fd_set*)pReadmask; - CARD32 millisToGo; - - if (state == XDM_OFF) - return; - FD_SET(xdmcpSocket, LastSelectMask); -#if defined(IPv6) && defined(AF_INET6) - if (xdmcpSocket6 >= 0) - FD_SET(xdmcpSocket6, LastSelectMask); -#endif - if (timeOutTime == 0) - return; - millisToGo = timeOutTime - GetTimeInMillis(); - if ((int) millisToGo < 0) - millisToGo = 0; - AdjustWaitForDelay (wt, millisToGo); -} - -/* - * called after select returns; this routine will - * recognise when XDMCP packets await and - * process them appropriately - */ - -/*ARGSUSED*/ -static void -XdmcpWakeupHandler( - pointer data, /* unused */ - int i, - pointer pReadmask) -{ - fd_set* LastSelectMask = (fd_set*)pReadmask; - fd_set devicesReadable; - - if (state == XDM_OFF) - return; - if (i > 0) - { - if (FD_ISSET(xdmcpSocket, LastSelectMask)) - { - receive_packet(xdmcpSocket); - FD_CLR(xdmcpSocket, LastSelectMask); - } -#if defined(IPv6) && defined(AF_INET6) - if (xdmcpSocket6 >= 0 && FD_ISSET(xdmcpSocket6, LastSelectMask)) - { - receive_packet(xdmcpSocket6); - FD_CLR(xdmcpSocket6, LastSelectMask); - } -#endif - XFD_ANDSET(&devicesReadable, LastSelectMask, &EnabledDevices); - if (XFD_ANYSET(&devicesReadable)) - { - if (state == XDM_AWAIT_USER_INPUT) - restart(); - else if (state == XDM_RUN_SESSION) - keepaliveDormancy = defaultKeepaliveDormancy; - } - if (XFD_ANYSET(&AllClients) && state == XDM_RUN_SESSION) - timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; - } - else if (timeOutTime && (int) (GetTimeInMillis() - timeOutTime) >= 0) - { - if (state == XDM_RUN_SESSION) - { - state = XDM_KEEPALIVE; - send_packet(); - } - else - timeout(); - } -} - -/* - * This routine should be called from the routine that drives the - * user's host menu when the user selects a host - */ - -static void -XdmcpSelectHost( - struct sockaddr *host_sockaddr, - int host_len, - ARRAY8Ptr AuthenticationName) -{ - state = XDM_START_CONNECTION; - memmove(&req_sockaddr, host_sockaddr, host_len); - req_socklen = host_len; - XdmcpSetAuthentication (AuthenticationName); - send_packet(); -} - -/* - * !!! this routine should be replaced by a routine that adds - * the host to the user's host menu. the current version just - * selects the first host to respond with willing message. - */ - -/*ARGSUSED*/ -static void -XdmcpAddHost( - struct sockaddr *from, - int fromlen, - ARRAY8Ptr AuthenticationName, - ARRAY8Ptr hostname, - ARRAY8Ptr status) -{ - XdmcpSelectHost(from, fromlen, AuthenticationName); -} - -/* - * A message is queued on the socket; read it and - * do the appropriate thing - */ - -ARRAY8 UnwillingMessage = { (CARD8) 14, (CARD8 *) "Host unwilling" }; - -static void -receive_packet(int socketfd) -{ -#if defined(IPv6) && defined(AF_INET6) - struct sockaddr_storage from; -#else - struct sockaddr_in from; -#endif - int fromlen = sizeof(from); - XdmcpHeader header; - - /* read message off socket */ - if (!XdmcpFill (socketfd, &buffer, (XdmcpNetaddr) &from, &fromlen)) - return; - - /* reset retransmission backoff */ - timeOutRtx = 0; - - if (!XdmcpReadHeader (&buffer, &header)) - return; - - if (header.version != XDM_PROTOCOL_VERSION) - return; - - switch (header.opcode) { - case WILLING: - recv_willing_msg((struct sockaddr *) &from, fromlen, header.length); - break; - case UNWILLING: - XdmcpFatal("Manager unwilling", &UnwillingMessage); - break; - case ACCEPT: - recv_accept_msg(header.length); - break; - case DECLINE: - recv_decline_msg(header.length); - break; - case REFUSE: - recv_refuse_msg(header.length); - break; - case FAILED: - recv_failed_msg(header.length); - break; - case ALIVE: - recv_alive_msg(header.length); - break; - } -} - -/* - * send the appropriate message given the current state - */ - -static void -send_packet(void) -{ - int rtx; - switch (state) { - case XDM_QUERY: - case XDM_BROADCAST: - case XDM_INDIRECT: -#if defined(IPv6) && defined(AF_INET6) - case XDM_MULTICAST: -#endif - send_query_msg(); - break; - case XDM_START_CONNECTION: - send_request_msg(); - break; - case XDM_MANAGE: - send_manage_msg(); - break; - case XDM_KEEPALIVE: - send_keepalive_msg(); - break; - default: - break; - } - rtx = (XDM_MIN_RTX << timeOutRtx); - if (rtx > XDM_MAX_RTX) - rtx = XDM_MAX_RTX; - timeOutTime = GetTimeInMillis() + rtx * 1000; -} - -/* - * The session is declared dead for some reason; too many - * timeouts, or Keepalive failure. - */ - -void -XdmcpDeadSession (char *reason) -{ - ErrorF ("XDM: %s, declaring session dead\n", reason); - state = XDM_INIT_STATE; - isItTimeToYield = TRUE; - dispatchException |= DE_RESET; - timeOutTime = 0; - timeOutRtx = 0; - send_packet(); -} - -/* - * Timeout waiting for an XDMCP response. - */ - -static void -timeout(void) -{ - timeOutRtx++; - if (state == XDM_AWAIT_ALIVE_RESPONSE && timeOutRtx >= XDM_KA_RTX_LIMIT ) - { - XdmcpDeadSession ("too many keepalive retransmissions"); - return; - } - else if (timeOutRtx >= XDM_RTX_LIMIT) - { - /* Quit if "-once" specified, otherwise reset and try again. */ - if (OneSession) { - dispatchException |= DE_TERMINATE; - ErrorF("XDM: too many retransmissions\n"); - } else { - XdmcpDeadSession("too many retransmissions"); - } - return; - } - -#if defined(IPv6) && defined(AF_INET6) - if (state == XDM_COLLECT_QUERY || state == XDM_COLLECT_INDIRECT_QUERY) { - /* Try next address */ - for (mgrAddr = mgrAddr->ai_next; ; mgrAddr = mgrAddr->ai_next) { - if (mgrAddr == NULL) { - mgrAddr = mgrAddrFirst; - } - if (mgrAddr->ai_family == AF_INET - || mgrAddr->ai_family == AF_INET6) - break; - } -#ifndef SIN6_LEN - ManagerAddressLen = mgrAddr->ai_addrlen; -#endif - memcpy(&ManagerAddress, mgrAddr->ai_addr, mgrAddr->ai_addrlen); - } -#endif - - switch (state) { - case XDM_COLLECT_QUERY: - state = XDM_QUERY; - break; - case XDM_COLLECT_BROADCAST_QUERY: - state = XDM_BROADCAST; - break; -#if defined(IPv6) && defined(AF_INET6) - case XDM_COLLECT_MULTICAST_QUERY: - state = XDM_MULTICAST; - break; -#endif - case XDM_COLLECT_INDIRECT_QUERY: - state = XDM_INDIRECT; - break; - case XDM_AWAIT_REQUEST_RESPONSE: - state = XDM_START_CONNECTION; - break; - case XDM_AWAIT_MANAGE_RESPONSE: - state = XDM_MANAGE; - break; - case XDM_AWAIT_ALIVE_RESPONSE: - state = XDM_KEEPALIVE; - break; - default: - break; - } - send_packet(); -} - -static void -restart(void) -{ - state = XDM_INIT_STATE; - timeOutRtx = 0; - send_packet(); -} - -int -XdmcpCheckAuthentication ( - ARRAY8Ptr Name, - ARRAY8Ptr Data, - int packet_type) -{ - return (XdmcpARRAY8Equal (Name, AuthenticationName) && - (AuthenticationName->length == 0 || - (*AuthenticationFuncs->Validator) (AuthenticationData, Data, packet_type))); -} - -int -XdmcpAddAuthorization ( - ARRAY8Ptr name, - ARRAY8Ptr data) -{ - AddAuthorFunc AddAuth; - - if (AuthenticationFuncs && AuthenticationFuncs->AddAuth) - AddAuth = AuthenticationFuncs->AddAuth; - else - AddAuth = AddAuthorization; - return (*AddAuth) ((unsigned short)name->length, - (char *)name->data, - (unsigned short)data->length, - (char *)data->data); -} - -/* - * from here to the end of this file are routines private - * to the state machine. - */ - -static void -get_xdmcp_sock(void) -{ -#ifdef STREAMSCONN - struct netconfig *nconf; - - if ((xdmcpSocket = t_open("/dev/udp", O_RDWR, 0)) < 0) { - XdmcpWarning("t_open() of /dev/udp failed"); - return; - } - - if( t_bind(xdmcpSocket,NULL,NULL) < 0 ) { - XdmcpWarning("UDP socket creation failed"); - t_error("t_bind(xdmcpSocket) failed" ); - t_close(xdmcpSocket); - return; - } - - /* - * This part of the code looks contrived. It will actually fit in nicely - * when the CLTS part of Xtrans is implemented. - */ - - if( (nconf=getnetconfigent("udp")) == NULL ) { - XdmcpWarning("UDP socket creation failed: getnetconfigent()"); - t_unbind(xdmcpSocket); - t_close(xdmcpSocket); - return; - } - - if( netdir_options(nconf, ND_SET_BROADCAST, xdmcpSocket, NULL) ) { - XdmcpWarning("UDP set broadcast option failed: netdir_options()"); - freenetconfigent(nconf); - t_unbind(xdmcpSocket); - t_close(xdmcpSocket); - return; - } - - freenetconfigent(nconf); -#else - int soopts = 1; - -#if defined(IPv6) && defined(AF_INET6) - if ((xdmcpSocket6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) - XdmcpWarning("INET6 UDP socket creation failed"); -#endif - if ((xdmcpSocket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - XdmcpWarning("UDP socket creation failed"); -#ifdef SO_BROADCAST - else if (setsockopt(xdmcpSocket, SOL_SOCKET, SO_BROADCAST, (char *)&soopts, - sizeof(soopts)) < 0) - XdmcpWarning("UDP set broadcast socket-option failed"); -#endif /* SO_BROADCAST */ - if (xdmcpSocket >= 0 && xdm_from != NULL) { - if (bind(xdmcpSocket, (struct sockaddr *)&FromAddress, - FromAddressLen) < 0) { - FatalError("Xserver: failed to bind to -from address: %s\n", xdm_from); - } - } -#endif /* STREAMSCONN */ -} - -static void -send_query_msg(void) -{ - XdmcpHeader header; - Bool broadcast = FALSE; -#if defined(IPv6) && defined(AF_INET6) - Bool multicast = FALSE; -#endif - int i; - int socketfd = xdmcpSocket; - - header.version = XDM_PROTOCOL_VERSION; - switch(state){ - case XDM_QUERY: - header.opcode = (CARD16) QUERY; - state = XDM_COLLECT_QUERY; - break; - case XDM_BROADCAST: - header.opcode = (CARD16) BROADCAST_QUERY; - state = XDM_COLLECT_BROADCAST_QUERY; - broadcast = TRUE; - break; -#if defined(IPv6) && defined(AF_INET6) - case XDM_MULTICAST: - header.opcode = (CARD16) BROADCAST_QUERY; - state = XDM_COLLECT_MULTICAST_QUERY; - multicast = TRUE; - break; -#endif - case XDM_INDIRECT: - header.opcode = (CARD16) INDIRECT_QUERY; - state = XDM_COLLECT_INDIRECT_QUERY; - break; - default: - break; - } - header.length = 1; - for (i = 0; i < AuthenticationNames.length; i++) - header.length += 2 + AuthenticationNames.data[i].length; - - XdmcpWriteHeader (&buffer, &header); - XdmcpWriteARRAYofARRAY8 (&buffer, &AuthenticationNames); - if (broadcast) - { - int i; - - for (i = 0; i < NumBroadcastAddresses; i++) - XdmcpFlush (xdmcpSocket, &buffer, (XdmcpNetaddr) &BroadcastAddresses[i], - sizeof (struct sockaddr_in)); - } -#if defined(IPv6) && defined(AF_INET6) - else if (multicast) - { - struct multicastinfo *mcl; - struct addrinfo *ai; - - for (mcl = mcastlist; mcl != NULL; mcl = mcl->next) { - for (ai = mcl->ai ; ai != NULL; ai = ai->ai_next) { - if (ai->ai_family == AF_INET) { - unsigned char hopflag = (unsigned char) mcl->hops; - socketfd = xdmcpSocket; - setsockopt(socketfd, IPPROTO_IP, IP_MULTICAST_TTL, - &hopflag, sizeof(hopflag)); - } else if (ai->ai_family == AF_INET6) { - int hopflag6 = mcl->hops; - socketfd = xdmcpSocket6; - setsockopt(socketfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, - &hopflag6, sizeof(hopflag6)); - } else { - continue; - } - XdmcpFlush (socketfd, &buffer, - (XdmcpNetaddr) ai->ai_addr, ai->ai_addrlen); - break; - } - } - } -#endif - else - { -#if defined(IPv6) && defined(AF_INET6) - if (SOCKADDR_FAMILY(ManagerAddress) == AF_INET6) - socketfd = xdmcpSocket6; -#endif - XdmcpFlush (socketfd, &buffer, (XdmcpNetaddr) &ManagerAddress, - ManagerAddressLen); - } -} - -static void -recv_willing_msg( - struct sockaddr *from, - int fromlen, - unsigned length) -{ - ARRAY8 authenticationName; - ARRAY8 hostname; - ARRAY8 status; - - authenticationName.data = 0; - hostname.data = 0; - status.data = 0; - if (XdmcpReadARRAY8 (&buffer, &authenticationName) && - XdmcpReadARRAY8 (&buffer, &hostname) && - XdmcpReadARRAY8 (&buffer, &status)) - { - if (length == 6 + authenticationName.length + - hostname.length + status.length) - { - switch (state) - { - case XDM_COLLECT_QUERY: - XdmcpSelectHost(from, fromlen, &authenticationName); - break; - case XDM_COLLECT_BROADCAST_QUERY: -#if defined(IPv6) && defined(AF_INET6) - case XDM_COLLECT_MULTICAST_QUERY: -#endif - case XDM_COLLECT_INDIRECT_QUERY: - XdmcpAddHost(from, fromlen, &authenticationName, &hostname, &status); - break; - default: - break; - } - } - } - XdmcpDisposeARRAY8 (&authenticationName); - XdmcpDisposeARRAY8 (&hostname); - XdmcpDisposeARRAY8 (&status); -} - -static void -send_request_msg(void) -{ - XdmcpHeader header; - int length; - int i; - CARD16 XdmcpConnectionType; - ARRAY8 authenticationData; - int socketfd = xdmcpSocket; - - switch (SOCKADDR_FAMILY(ManagerAddress)) - { - case AF_INET: XdmcpConnectionType=FamilyInternet; break; -#if defined(IPv6) && defined(AF_INET6) - case AF_INET6: XdmcpConnectionType=FamilyInternet6; break; -#endif - default: XdmcpConnectionType=0xffff; break; - } - - header.version = XDM_PROTOCOL_VERSION; - header.opcode = (CARD16) REQUEST; - - length = 2; /* display number */ - length += 1 + 2 * ConnectionTypes.length; /* connection types */ - length += 1; /* connection addresses */ - for (i = 0; i < ConnectionAddresses.length; i++) - length += 2 + ConnectionAddresses.data[i].length; - authenticationData.length = 0; - authenticationData.data = 0; - if (AuthenticationFuncs) - { - (*AuthenticationFuncs->Generator) (AuthenticationData, - &authenticationData, - REQUEST); - } - length += 2 + AuthenticationName->length; /* authentication name */ - length += 2 + authenticationData.length; /* authentication data */ - length += 1; /* authorization names */ - for (i = 0; i < AuthorizationNames.length; i++) - length += 2 + AuthorizationNames.data[i].length; - length += 2 + ManufacturerDisplayID.length; /* display ID */ - header.length = length; - - if (!XdmcpWriteHeader (&buffer, &header)) - { - XdmcpDisposeARRAY8 (&authenticationData); - return; - } - XdmcpWriteCARD16 (&buffer, DisplayNumber); - XdmcpWriteCARD8 (&buffer, ConnectionTypes.length); - - /* The connection array is send reordered, so that connections of */ - /* the same address type as the XDMCP manager connection are send */ - /* first. This works around a bug in xdm. mario@klebsch.de */ - for (i = 0; i < (int)ConnectionTypes.length; i++) - if (ConnectionTypes.data[i]==XdmcpConnectionType) - XdmcpWriteCARD16 (&buffer, ConnectionTypes.data[i]); - for (i = 0; i < (int)ConnectionTypes.length; i++) - if (ConnectionTypes.data[i]!=XdmcpConnectionType) - XdmcpWriteCARD16 (&buffer, ConnectionTypes.data[i]); - - XdmcpWriteCARD8 (&buffer, ConnectionAddresses.length); - for (i = 0; i < (int)ConnectionAddresses.length; i++) - if ( (i=ConnectionTypes.length) || - (ConnectionTypes.data[i]!=XdmcpConnectionType) ) - XdmcpWriteARRAY8 (&buffer, &ConnectionAddresses.data[i]); - - XdmcpWriteARRAY8 (&buffer, AuthenticationName); - XdmcpWriteARRAY8 (&buffer, &authenticationData); - XdmcpDisposeARRAY8 (&authenticationData); - XdmcpWriteARRAYofARRAY8 (&buffer, &AuthorizationNames); - XdmcpWriteARRAY8 (&buffer, &ManufacturerDisplayID); -#if defined(IPv6) && defined(AF_INET6) - if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) - socketfd = xdmcpSocket6; -#endif - if (XdmcpFlush (socketfd, &buffer, - (XdmcpNetaddr) &req_sockaddr, req_socklen)) - state = XDM_AWAIT_REQUEST_RESPONSE; -} - -static void -recv_accept_msg(unsigned length) -{ - CARD32 AcceptSessionID; - ARRAY8 AcceptAuthenticationName, AcceptAuthenticationData; - ARRAY8 AcceptAuthorizationName, AcceptAuthorizationData; - - if (state != XDM_AWAIT_REQUEST_RESPONSE) - return; - AcceptAuthenticationName.data = 0; - AcceptAuthenticationData.data = 0; - AcceptAuthorizationName.data = 0; - AcceptAuthorizationData.data = 0; - if (XdmcpReadCARD32 (&buffer, &AcceptSessionID) && - XdmcpReadARRAY8 (&buffer, &AcceptAuthenticationName) && - XdmcpReadARRAY8 (&buffer, &AcceptAuthenticationData) && - XdmcpReadARRAY8 (&buffer, &AcceptAuthorizationName) && - XdmcpReadARRAY8 (&buffer, &AcceptAuthorizationData)) - { - if (length == 12 + AcceptAuthenticationName.length + - AcceptAuthenticationData.length + - AcceptAuthorizationName.length + - AcceptAuthorizationData.length) - { - if (!XdmcpCheckAuthentication (&AcceptAuthenticationName, - &AcceptAuthenticationData, ACCEPT)) - { - XdmcpFatal ("Authentication Failure", &AcceptAuthenticationName); - } - /* permit access control manipulations from this host */ - AugmentSelf (&req_sockaddr, req_socklen); - /* if the authorization specified in the packet fails - * to be acceptable, enable the local addresses - */ - if (!XdmcpAddAuthorization (&AcceptAuthorizationName, - &AcceptAuthorizationData)) - { - AddLocalHosts (); - } - SessionID = AcceptSessionID; - state = XDM_MANAGE; - send_packet(); - } - } - XdmcpDisposeARRAY8 (&AcceptAuthenticationName); - XdmcpDisposeARRAY8 (&AcceptAuthenticationData); - XdmcpDisposeARRAY8 (&AcceptAuthorizationName); - XdmcpDisposeARRAY8 (&AcceptAuthorizationData); -} - -static void -recv_decline_msg(unsigned length) -{ - ARRAY8 status, DeclineAuthenticationName, DeclineAuthenticationData; - - status.data = 0; - DeclineAuthenticationName.data = 0; - DeclineAuthenticationData.data = 0; - if (XdmcpReadARRAY8 (&buffer, &status) && - XdmcpReadARRAY8 (&buffer, &DeclineAuthenticationName) && - XdmcpReadARRAY8 (&buffer, &DeclineAuthenticationData)) - { - if (length == 6 + status.length + - DeclineAuthenticationName.length + - DeclineAuthenticationData.length && - XdmcpCheckAuthentication (&DeclineAuthenticationName, - &DeclineAuthenticationData, DECLINE)) - { - XdmcpFatal ("Session declined", &status); - } - } - XdmcpDisposeARRAY8 (&status); - XdmcpDisposeARRAY8 (&DeclineAuthenticationName); - XdmcpDisposeARRAY8 (&DeclineAuthenticationData); -} - -static void -send_manage_msg(void) -{ - XdmcpHeader header; - int socketfd = xdmcpSocket; - - header.version = XDM_PROTOCOL_VERSION; - header.opcode = (CARD16) MANAGE; - header.length = 8 + DisplayClass.length; - - if (!XdmcpWriteHeader (&buffer, &header)) - return; - XdmcpWriteCARD32 (&buffer, SessionID); - XdmcpWriteCARD16 (&buffer, DisplayNumber); - XdmcpWriteARRAY8 (&buffer, &DisplayClass); - state = XDM_AWAIT_MANAGE_RESPONSE; -#if defined(IPv6) && defined(AF_INET6) - if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) - socketfd = xdmcpSocket6; -#endif - XdmcpFlush (socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen); -} - -static void -recv_refuse_msg(unsigned length) -{ - CARD32 RefusedSessionID; - - if (state != XDM_AWAIT_MANAGE_RESPONSE) - return; - if (length != 4) - return; - if (XdmcpReadCARD32 (&buffer, &RefusedSessionID)) - { - if (RefusedSessionID == SessionID) - { - state = XDM_START_CONNECTION; - send_packet(); - } - } -} - -static void -recv_failed_msg(unsigned length) -{ - CARD32 FailedSessionID; - ARRAY8 status; - - if (state != XDM_AWAIT_MANAGE_RESPONSE) - return; - status.data = 0; - if (XdmcpReadCARD32 (&buffer, &FailedSessionID) && - XdmcpReadARRAY8 (&buffer, &status)) - { - if (length == 6 + status.length && - SessionID == FailedSessionID) - { - XdmcpFatal ("Session failed", &status); - } - } - XdmcpDisposeARRAY8 (&status); -} - -static void -send_keepalive_msg(void) -{ - XdmcpHeader header; - int socketfd = xdmcpSocket; - - header.version = XDM_PROTOCOL_VERSION; - header.opcode = (CARD16) KEEPALIVE; - header.length = 6; - - XdmcpWriteHeader (&buffer, &header); - XdmcpWriteCARD16 (&buffer, DisplayNumber); - XdmcpWriteCARD32 (&buffer, SessionID); - - state = XDM_AWAIT_ALIVE_RESPONSE; -#if defined(IPv6) && defined(AF_INET6) - if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) - socketfd = xdmcpSocket6; -#endif - XdmcpFlush (socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen); -} - -static void -recv_alive_msg (unsigned length) -{ - CARD8 SessionRunning; - CARD32 AliveSessionID; - - if (state != XDM_AWAIT_ALIVE_RESPONSE) - return; - if (length != 5) - return; - if (XdmcpReadCARD8 (&buffer, &SessionRunning) && - XdmcpReadCARD32 (&buffer, &AliveSessionID)) - { - if (SessionRunning && AliveSessionID == SessionID) - { - /* backoff dormancy period */ - state = XDM_RUN_SESSION; - if ((GetTimeInMillis() - lastDeviceEventTime.milliseconds) > - keepaliveDormancy * 1000) - { - keepaliveDormancy <<= 1; - if (keepaliveDormancy > XDM_MAX_DORMANCY) - keepaliveDormancy = XDM_MAX_DORMANCY; - } - timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; - } - else - { - XdmcpDeadSession ("Alive response indicates session dead"); - } - } -} - -static void -XdmcpFatal ( - char *type, - ARRAY8Ptr status) -{ - FatalError ("XDMCP fatal error: %s %*.*s\n", type, - status->length, status->length, status->data); -} - -static void -XdmcpWarning(char *str) -{ - ErrorF("XDMCP warning: %s\n", str); -} - -static void -get_addr_by_name( - char * argtype, - char * namestr, - int port, - int socktype, - SOCKADDR_TYPE *addr, - SOCKLEN_TYPE *addrlen -#if defined(IPv6) && defined(AF_INET6) - , - struct addrinfo **aip, - struct addrinfo **aifirstp -#endif - ) -{ -#if defined(IPv6) && defined(AF_INET6) - struct addrinfo *ai; - struct addrinfo hints; - char portstr[6]; - char *pport = portstr; - int gaierr; - - bzero(&hints, sizeof(hints)); - hints.ai_socktype = socktype; - - if (port == 0) { - pport = NULL; - } else if (port > 0 && port < 65535) { - sprintf(portstr, "%d", port); - } else { - FatalError("Xserver: port out of range: %d\n", port); - } - - if (*aifirstp != NULL) { - freeaddrinfo(*aifirstp); - *aifirstp = NULL; - } - - if ((gaierr = getaddrinfo(namestr, pport, &hints, aifirstp)) == 0) { - for (ai = *aifirstp; ai != NULL; ai = ai->ai_next) { - if (ai->ai_family == AF_INET || ai->ai_family == AF_INET6) - break; - } - if ((ai == NULL) || (ai->ai_addrlen > sizeof(SOCKADDR_TYPE))) { - FatalError ("Xserver: %s host %s not on supported network type\n", - argtype, namestr); - } else { - *aip = ai; - *addrlen = ai->ai_addrlen; - memcpy(addr, ai->ai_addr, ai->ai_addrlen); - } - } else { - FatalError("Xserver: %s: %s %s\n", gai_strerror(gaierr), argtype, namestr); - } -#else - struct hostent *hep; -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgethostbynameparams hparams; -#endif -#if defined(WIN32) && (defined(TCPCONN) || defined(DNETCONN)) - _XSERVTransWSAStartup(); -#endif - if (!(hep = _XGethostbyname(namestr, hparams))) - { - FatalError("Xserver: %s unknown host: %s\n", argtype, namestr); - } - if (hep->h_length == sizeof (struct in_addr)) - { - memmove(&addr->sin_addr, hep->h_addr, hep->h_length); - *addrlen = sizeof(struct sockaddr_in); - addr->sin_family = AF_INET; - addr->sin_port = htons (port); - } - else - { - FatalError("Xserver: %s host on strange network %s\n", argtype, namestr); - } -#endif -} - -static void -get_manager_by_name( - int argc, - char **argv, - int i) -{ - - if ((i + 1) == argc) - { - FatalError("Xserver: missing %s host name in command line\n", argv[i]); - } - - get_addr_by_name(argv[i], argv[i+1], xdm_udp_port, SOCK_DGRAM, - &ManagerAddress, &ManagerAddressLen -#if defined(IPv6) && defined(AF_INET6) - , &mgrAddr, &mgrAddrFirst -#endif - ); -} - - -static void -get_fromaddr_by_name( - int argc, - char **argv, - int i) -{ -#if defined(IPv6) && defined(AF_INET6) - struct addrinfo *ai = NULL; - struct addrinfo *aifirst = NULL; -#endif - if (i == argc) - { - FatalError("Xserver: missing -from host name in command line\n"); - } - get_addr_by_name("-from", argv[i], 0, 0, &FromAddress, &FromAddressLen -#if defined(IPv6) && defined(AF_INET6) - , &ai, &aifirst -#endif - ); - xdm_from = argv[i]; -} - - -#if defined(IPv6) && defined(AF_INET6) -static int -get_mcast_options(argc, argv, i) - int argc, i; - char **argv; -{ - char *address = XDM_DEFAULT_MCAST_ADDR6; - int hopcount = 1; - struct addrinfo hints; - char portstr[6]; - int gaierr; - struct addrinfo *ai, *firstai; - - if ((i < argc) && (argv[i][0] != '-') && (argv[i][0] != '+')) { - address = argv[i++]; - if ((i < argc) && (argv[i][0] != '-') && (argv[i][0] != '+')) { - hopcount = strtol(argv[i++], NULL, 10); - if ((hopcount < 1) || (hopcount > 255)) { - FatalError("Xserver: multicast hop count out of range: %d\n", - hopcount); - } - } - } - - if (xdm_udp_port > 0 && xdm_udp_port < 65535) { - sprintf(portstr, "%d", xdm_udp_port); - } else { - FatalError("Xserver: port out of range: %d\n", xdm_udp_port); - } - bzero(&hints, sizeof(hints)); - hints.ai_socktype = SOCK_DGRAM; - - if ((gaierr = getaddrinfo(address, portstr, &hints, &firstai)) == 0) { - for (ai = firstai; ai != NULL; ai = ai->ai_next) { - if (((ai->ai_family == AF_INET) && - IN_MULTICAST(((struct sockaddr_in *) ai->ai_addr) - ->sin_addr.s_addr)) - || ((ai->ai_family == AF_INET6) && - IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *) ai->ai_addr) - ->sin6_addr))) - break; - } - if (ai == NULL) { - FatalError ("Xserver: address not supported multicast type %s\n", - address); - } else { - struct multicastinfo *mcastinfo, *mcl; - - mcastinfo = malloc(sizeof(struct multicastinfo)); - mcastinfo->next = NULL; - mcastinfo->ai = firstai; - mcastinfo->hops = hopcount; - - if (mcastlist == NULL) { - mcastlist = mcastinfo; - } else { - for (mcl = mcastlist; mcl->next != NULL; mcl = mcl->next) { - /* Do nothing - just find end of list */ - } - mcl->next = mcastinfo; - } - } - } else { - FatalError("Xserver: %s: %s\n", gai_strerror(gaierr), address); - } - return i; -} -#endif - -#else -static int xdmcp_non_empty; /* avoid complaint by ranlib */ -#endif /* XDMCP */ diff --git a/nx-X11/programs/Xserver/os/xprintf.c.NX.original b/nx-X11/programs/Xserver/os/xprintf.c.NX.original deleted file mode 100644 index 54bbeefe2..000000000 --- a/nx-X11/programs/Xserver/os/xprintf.c.NX.original +++ /dev/null @@ -1,163 +0,0 @@ -/* - * printf routines which xalloc their buffer - */ -/* - * Copyright (c) 2004 Alexander Gottwald - * - * 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 ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "os.h" -#include -#include - -#ifndef va_copy -# ifdef __va_copy -# define va_copy __va_copy -# else -# error "no working va_copy was found" -# endif -#endif - -#ifdef NX_TRANS_SOCKET - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -#define START_SIZE 256 -#define END_SIZE 2048 - -char * -Xvprintf(const char *format, va_list va) -{ - char *ret; - char *newret; - int size; - int r; - - size = 0; - - for (;;) - { - if (size == 0) - { - ret = (char *)malloc(START_SIZE); - if (ret == NULL) - return NULL; - size = START_SIZE; - } - else if (size < END_SIZE && - (newret = (char *) realloc(ret, 2 * size)) != NULL) - { - ret = newret; - size = 2 * size; - } - else - { - free(ret); - return NULL; - } - - r = vsnprintf(ret, size, format, va); - - if (r == -1 || r == size || r > size || r == size - 1) - { - continue; - } - else - { - ret[r] = 0; - return ret; - } - } -} - -#else - -char * -Xvprintf(const char *format, va_list va) -{ - char *ret; - int size; - va_list va2; - - va_copy(va2, va); - size = vsnprintf(NULL, 0, format, va2); - va_end(va2); - - ret = (char *)Xalloc(size + 1); - if (ret == NULL) - return NULL; - - vsnprintf(ret, size + 1, format, va); - ret[size] = 0; - return ret; -} - -#endif - -char *Xprintf(const char *format, ...) -{ - char *ret; - va_list va; - va_start(va, format); - ret = Xvprintf(format, va); - va_end(va); - return ret; -} - -char * -XNFvprintf(const char *format, va_list va) -{ - char *ret; - int size; - va_list va2; - - va_copy(va2, va); - size = vsnprintf(NULL, 0, format, va2); - va_end(va2); - - ret = (char *)XNFalloc(size + 1); - if (ret == NULL) - return NULL; - - vsnprintf(ret, size + 1, format, va); - ret[size] = 0; - return ret; -} - -char *XNFprintf(const char *format, ...) -{ - char *ret; - va_list va; - va_start(va, format); - ret = XNFvprintf(format, va); - va_end(va); - return ret; -} diff --git a/nx-X11/programs/Xserver/os/xprintf.c.X.original b/nx-X11/programs/Xserver/os/xprintf.c.X.original deleted file mode 100644 index 07eaa1f58..000000000 --- a/nx-X11/programs/Xserver/os/xprintf.c.X.original +++ /dev/null @@ -1,104 +0,0 @@ -/* - * printf routines which xalloc their buffer - */ -/* - * Copyright (c) 2004 Alexander Gottwald - * - * 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 ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include "os.h" -#include -#include - -#ifndef va_copy -# ifdef __va_copy -# define va_copy __va_copy -# else -# error "no working va_copy was found" -# endif -#endif - -char * -Xvprintf(const char *format, va_list va) -{ - char *ret; - int size; - va_list va2; - - va_copy(va2, va); - size = vsnprintf(NULL, 0, format, va2); - va_end(va2); - - ret = (char *)Xalloc(size + 1); - if (ret == NULL) - return NULL; - - vsnprintf(ret, size + 1, format, va); - ret[size] = 0; - return ret; -} - -char *Xprintf(const char *format, ...) -{ - char *ret; - va_list va; - va_start(va, format); - ret = Xvprintf(format, va); - va_end(va); - return ret; -} - -char * -XNFvprintf(const char *format, va_list va) -{ - char *ret; - int size; - va_list va2; - - va_copy(va2, va); - size = vsnprintf(NULL, 0, format, va2); - va_end(va2); - - ret = (char *)XNFalloc(size + 1); - if (ret == NULL) - return NULL; - - vsnprintf(ret, size + 1, format, va); - ret[size] = 0; - return ret; -} - -char *XNFprintf(const char *format, ...) -{ - char *ret; - va_list va; - va_start(va, format); - ret = XNFvprintf(format, va); - va_end(va); - return ret; -} diff --git a/nx-X11/programs/Xserver/randr.X.original/Imakefile b/nx-X11/programs/Xserver/randr.X.original/Imakefile deleted file mode 100644 index 73b0dfbba..000000000 --- a/nx-X11/programs/Xserver/randr.X.original/Imakefile +++ /dev/null @@ -1,18 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/randr/Imakefile,v 1.1 2001/05/23 03:29:44 keithp Exp $ -#include - - SRCS = randr.c mirandr.c - - OBJS = randr.o mirandr.o - - INCLUDES = -I../include -I../mi -I../../../include/fonts \ - -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I../render - LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln - -NormalLibraryTarget(randr,$(OBJS)) -NormalLibraryObjectRule() -LintLibraryTarget(randr,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/programs/Xserver/randr.X.original/mirandr.c b/nx-X11/programs/Xserver/randr.X.original/mirandr.c deleted file mode 100644 index b1e19a746..000000000 --- a/nx-X11/programs/Xserver/randr.X.original/mirandr.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/randr/mirandr.c,v 1.5 2001/06/04 09:45:40 keithp Exp $ - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "scrnintstr.h" -#include "mi.h" -#include -#include "randrstr.h" -#include - -/* - * This function assumes that only a single depth can be - * displayed at a time, but that all visuals of that depth - * can be displayed simultaneously. It further assumes that - * only a single size is available. Hardware providing - * additional capabilties should use different code. - * XXX what to do here.... - */ - -Bool -miRRGetInfo (ScreenPtr pScreen, Rotation *rotations) -{ - int i; - Bool setConfig = FALSE; - - *rotations = RR_Rotate_0; - for (i = 0; i < pScreen->numDepths; i++) - { - if (pScreen->allowedDepths[i].numVids) - { - RRScreenSizePtr pSize; - - pSize = RRRegisterSize (pScreen, - pScreen->width, - pScreen->height, - pScreen->mmWidth, - pScreen->mmHeight); - if (!pSize) - return FALSE; - if (!setConfig) - { - RRSetCurrentConfig (pScreen, RR_Rotate_0, 0, pSize); - setConfig = TRUE; - } - } - } - return TRUE; -} - -/* - * Any hardware that can actually change anything will need something - * different here - */ -Bool -miRRSetConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - return TRUE; -} - - -Bool -miRandRInit (ScreenPtr pScreen) -{ - rrScrPrivPtr rp; - - if (!RRScreenInit (pScreen)) - return FALSE; - rp = rrGetScrPriv(pScreen); - rp->rrGetInfo = miRRGetInfo; - rp->rrSetConfig = miRRSetConfig; - return TRUE; -} diff --git a/nx-X11/programs/Xserver/randr.X.original/randr.c b/nx-X11/programs/Xserver/randr.X.original/randr.c deleted file mode 100644 index 3911a3498..000000000 --- a/nx-X11/programs/Xserver/randr.X.original/randr.c +++ /dev/null @@ -1,1319 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/randr/randr.c,v 1.21tsi Exp $ - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - */ - - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "servermd.h" -#include -#include -#include "randrstr.h" -#ifdef RENDER -#include /* we share subpixel order information */ -#include "picturestr.h" -#endif -#include -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -/* From render.h */ -#ifndef SubPixelUnknown -#define SubPixelUnknown 0 -#endif - -#define RR_VALIDATE -int RRGeneration; -int RRNScreens; - -static int ProcRRQueryVersion (ClientPtr pClient); -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); -static int SProcRRQueryVersion (ClientPtr pClient); - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -#if 0 -static CARD8 RRReqCode; -static int RRErrBase; -#endif -static int RREventBase; -static RESTYPE ClientType, EventType; /* resource types for event masks */ -static int RRClientPrivateIndex; - -typedef struct _RRTimes { - TimeStamp setTime; - TimeStamp configTime; -} RRTimesRec, *RRTimesPtr; - -typedef struct _RRClient { - int major_version; - int minor_version; -/* RRTimesRec times[0]; */ -} RRClientRec, *RRClientPtr; - -/* - * each window has a list of clients requesting - * RRNotify events. Each client has a resource - * for each window it selects RRNotify input for, - * this resource is used to delete the RRNotifyRec - * entry from the per-window queue. - */ - -typedef struct _RREvent *RREventPtr; - -typedef struct _RREvent { - RREventPtr next; - ClientPtr client; - WindowPtr window; - XID clientResource; - int mask; -} RREventRec; - -int rrPrivIndex = -1; - -#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr) -#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) - -static Bool -RRClientKnowsRates (ClientPtr pClient) -{ - rrClientPriv(pClient); - - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); -} - -static void -RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - rrClientPriv(pClient); - RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1); - int i; - - pRRClient->major_version = 0; - pRRClient->minor_version = 0; - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - rrScrPriv(pScreen); - - if (pScrPriv) - { - pTimes[i].setTime = pScrPriv->lastSetTime; - pTimes[i].configTime = pScrPriv->lastConfigTime; - } - } -} - -static void -RRResetProc (ExtensionEntry *extEntry) -{ -} - -static Bool -RRCloseScreen (int i, ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - - unwrap (pScrPriv, pScreen, CloseScreen); - if (pScrPriv->pSizes) - xfree (pScrPriv->pSizes); - xfree (pScrPriv); - RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, - xRRScreenChangeNotifyEvent *to) -{ - to->type = from->type; - to->rotation = from->rotation; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->root, to->root); - cpswapl(from->window, to->window); - cpswaps(from->sizeID, to->sizeID); - cpswaps(from->widthInPixels, to->widthInPixels); - cpswaps(from->heightInPixels, to->heightInPixels); - cpswaps(from->widthInMillimeters, to->widthInMillimeters); - cpswaps(from->heightInMillimeters, to->heightInMillimeters); - cpswaps(from->subpixelOrder, to->subpixelOrder); -} - -Bool RRScreenInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (RRGeneration != serverGeneration) - { - if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - RRGeneration = serverGeneration; - } - - pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec)); - if (!pScrPriv) - return FALSE; - - SetRRScreen(pScreen, pScrPriv); - - /* - * Calling function best set these function vectors - */ - pScrPriv->rrSetConfig = 0; - pScrPriv->rrGetInfo = 0; - /* - * This value doesn't really matter -- any client must call - * GetScreenInfo before reading it which will automatically update - * the time - */ - pScrPriv->lastSetTime = currentTime; - pScrPriv->lastConfigTime = currentTime; - - wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - - pScrPriv->rotations = RR_Rotate_0; - - pScrPriv->nSizes = 0; - pScrPriv->nSizesInUse = 0; - pScrPriv->pSizes = 0; - - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->size = -1; - - RRNScreens += 1; /* keep count of screens that implement randr */ - return TRUE; -} - -/*ARGSUSED*/ -static int -RRFreeClient (pointer data, XID id) -{ - RREventPtr pRREvent; - WindowPtr pWin; - RREventPtr *pHead, pCur, pPrev; - - pRREvent = (RREventPtr) data; - pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, EventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) - { - if (pPrev) - pPrev->next = pRREvent->next; - else - *pHead = pRREvent->next; - } - } - xfree ((pointer) pRREvent); - return 1; -} - -/*ARGSUSED*/ -static int -RRFreeEvents (pointer data, XID id) -{ - RREventPtr *pHead, pCur, pNext; - - pHead = (RREventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - return 1; -} - -void -RRExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (RRNScreens == 0) return; - - RRClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RRClientPrivateIndex, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) - return; - - ClientType = CreateNewResourceType(RRFreeClient); - if (!ClientType) - return; - EventType = CreateNewResourceType(RRFreeEvents); - if (!EventType) - return; - extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, - ProcRRDispatch, SProcRRDispatch, - RRResetProc, StandardMinorOpcode); - if (!extEntry) - return; -#if 0 - RRReqCode = (CARD8) extEntry->base; - RRErrBase = extEntry->errorBase; -#endif - RREventBase = extEntry->eventBase; - EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; - - return; -} - -static int -TellChanged (WindowPtr pWin, pointer value) -{ - RREventPtr *pHead, pRREvent; - ClientPtr client; - xRRScreenChangeNotifyEvent se; - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv(pScreen); - RRScreenSizePtr pSize; - WindowPtr pRoot = WindowTable[pScreen->myNum]; - - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, EventType); - if (!pHead) - return WT_WALKCHILDREN; - - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) pScrPriv->rotation; - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; -#ifdef RENDER - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); -#else - se.subpixelOrder = SubPixelUnknown; -#endif - if (pScrPriv->size >= 0) - { - pSize = &pScrPriv->pSizes[pScrPriv->size]; - se.sizeID = pSize->id; - se.widthInPixels = pSize->width; - se.heightInPixels = pSize->height; - se.widthInMillimeters = pSize->mmWidth; - se.heightInMillimeters = pSize->mmHeight; - } - else - { - /* - * This "shouldn't happen", but a broken DDX can - * forget to set the current configuration on GetInfo - */ - se.sizeID = 0xffff; - se.widthInPixels = 0; - se.heightInPixels = 0; - se.widthInMillimeters = 0; - se.heightInMillimeters = 0; - } - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - { - client = pRREvent->client; - if (client == serverClient || client->clientGone) - continue; - se.sequenceNumber = client->sequence; - if(pRREvent->mask & RRScreenChangeNotifyMask) - WriteEventsToClient (client, 1, (xEvent *) &se); - } - return WT_WALKCHILDREN; -} - -static Bool -RRGetInfo (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i, j, k, l; - Bool changed; - Rotation rotations; - RRScreenSizePtr pSize; - RRScreenRatePtr pRate; - - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - pSize->oldReferenced = pSize->referenced; - pSize->referenced = FALSE; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - pRate->oldReferenced = pRate->referenced; - pRate->referenced = FALSE; - } - } - if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) - return FALSE; - - changed = FALSE; - - /* - * Check whether anything changed and simultaneously generate - * the protocol id values for the objects - */ - if (rotations != pScrPriv->rotations) - { - pScrPriv->rotations = rotations; - changed = TRUE; - } - - j = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->oldReferenced != pSize->referenced) - changed = TRUE; - if (pSize->referenced) - pSize->id = j++; - l = 0; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - if (pRate->oldReferenced != pRate->referenced) - changed = TRUE; - if (pRate->referenced) - l++; - } - pSize->nRatesInUse = l; - } - pScrPriv->nSizesInUse = j; - if (changed) - { - UpdateCurrentTime (); - pScrPriv->lastConfigTime = currentTime; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - } - return TRUE; -} - -static void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -static int -ProcRRQueryVersion (ClientPtr client) -{ - xRRQueryVersionReply rep; - register int n; - REQUEST(xRRQueryVersionReq); - rrClientPriv(client); - - REQUEST_SIZE_MATCH(xRRQueryVersionReq); - pRRClient->major_version = stuff->majorVersion; - pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RANDR_MAJOR; - rep.minorVersion = RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -static void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -static int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - unsigned long extraLen; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - - if (!pWin) - return BadWindow; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - if (!pScrPriv) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - - RRGetInfo (pScreen); - - rep.type = X_Reply; - rep.setOfRotations = pScrPriv->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = pScrPriv->rotation; - rep.nSizes = pScrPriv->nSizesInUse; - rep.rate = pScrPriv->rate; - rep.nrateEnts = 0; - if (has_rate) - { - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - rep.nrateEnts += (1 + pSize->nRatesInUse); - } - } - } - - if (pScrPriv->size >= 0) - rep.sizeID = pScrPriv->pSizes[pScrPriv->size].id; - else - return BadImplementation; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - return BadAlloc; - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRatesInUse; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - RRScreenRatePtr pRate = &pSize->pRates[j]; - if (pRate->referenced) - { - *rates = pRate->rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } - } - } - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n", - (unsigned long)(data8 - (CARD8 *) extra), extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); - } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); -} - -static int -ProcRRSetScreenConfig (ClientPtr client) -{ - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp configTime; - TimeStamp time; - RRScreenSizePtr pSize; - int i; - Rotation rotation; - int rate; - short oldWidth, oldHeight; - Bool has_rate; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, - SecurityWriteAccess); - - pScreen = pDraw->pScreen; - - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - /* - * Search for the requested size - */ - pSize = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced && pSize->id == stuff->sizeID) - { - break; - } - } - if (i == pScrPriv->nSizes) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - return BadValue; - } - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - client->errorValue = rate; - return BadValue; - } - } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - rep.status = RRSetConfigFailed; - goto sendReply; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - pScrPriv->lastSetTime = time; - - /* - * Report Success - */ - rep.status = RRSetConfigSuccess; - -sendReply: - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); -} - -int -RRSetScreenConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPrivPtr pScrPriv; - int i; - short oldWidth, oldHeight; - - pScrPriv = rrGetScrPriv(pScreen); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * Validate requested rotation - */ - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - return BadValue; - } - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - return BadImplementation; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - - return Success; -} - -static int -ProcRRSelectInput (ClientPtr client) -{ - REQUEST(xRRSelectInputReq); - rrClientPriv(client); - RRTimesPtr pTimes; - WindowPtr pWin; - RREventPtr pRREvent, pNewRREvent, *pHead; - XID clientResource; - - REQUEST_SIZE_MATCH(xRRSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; - pHead = (RREventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, - SecurityWriteAccess); - - if (stuff->enable & (RRScreenChangeNotifyMask)) - { - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - - if (pHead) - { - /* check for existing entry. */ - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - if (pRREvent->client == client) - return Success; - } - - /* build the entry */ - pNewRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); - if (!pNewRREvent) - return BadAlloc; - pNewRREvent->next = 0; - pNewRREvent->client = client; - pNewRREvent->window = pWin; - pNewRREvent->mask = stuff->enable; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pNewRREvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewRREvent)) - return BadAlloc; - /* - * create a resource to contain a pointer to the list - * of clients selecting input. This must be indirect as - * the list may be arbitrarily rearranged which cannot be - * done through the resource database. - */ - if (!pHead) - { - pHead = (RREventPtr *) xalloc (sizeof (RREventPtr)); - if (!pHead || - !AddResource (pWin->drawable.id, EventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pNewRREvent->next = *pHead; - *pHead = pNewRREvent; - /* - * Now see if the client needs an event - */ - if (pScrPriv) - { - pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; - if (CompareTimeStamps (pTimes->setTime, - pScrPriv->lastSetTime) != 0 || - CompareTimeStamps (pTimes->configTime, - pScrPriv->lastConfigTime) != 0) - { - TellChanged (pWin, (pointer) pScreen); - } - } - } - else if (stuff->enable == xFalse) - { - /* delete the interest */ - if (pHead) { - pNewRREvent = 0; - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { - if (pRREvent->client == client) - break; - pNewRREvent = pRREvent; - } - if (pRREvent) { - FreeResource (pRREvent->clientResource, ClientType); - if (pNewRREvent) - pNewRREvent->next = pRREvent->next; - else - *pHead = pRREvent->next; - xfree (pRREvent); - } - } - } - else - { - client->errorValue = stuff->enable; - return BadValue; - } - return Success; -} - - -static int -ProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return ProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return ProcRRSetScreenConfig(client); - case X_RRSelectInput: - return ProcRRSelectInput(client); - case X_RRGetScreenInfo: - return ProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - -static int -SProcRRQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRRQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return ProcRRQueryVersion(client); -} - -static int -SProcRRGetScreenInfo (ClientPtr client) -{ - register int n; - REQUEST(xRRGetScreenInfoReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRGetScreenInfo(client); -} - -static int -SProcRRSetScreenConfig (ClientPtr client) -{ - register int n; - REQUEST(xRRSetScreenConfigReq); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - swaps (&stuff->rate, n); - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - } - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->sizeID, n); - swaps(&stuff->rotation, n); - return ProcRRSetScreenConfig(client); -} - -static int -SProcRRSelectInput (ClientPtr client) -{ - register int n; - REQUEST(xRRSelectInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRSelectInput(client); -} - - -static int -SProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return SProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return SProcRRSetScreenConfig(client); - case X_RRSelectInput: - return SProcRRSelectInput(client); - case X_RRGetScreenInfo: - return SProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - - -static Bool -RRScreenSizeMatches (RRScreenSizePtr a, - RRScreenSizePtr b) -{ - if (a->width != b->width) - return FALSE; - if (a->height != b->height) - return FALSE; - if (a->mmWidth != b->mmWidth) - return FALSE; - if (a->mmHeight != b->mmHeight) - return FALSE; - return TRUE; -} - -RRScreenSizePtr -RRRegisterSize (ScreenPtr pScreen, - short width, - short height, - short mmWidth, - short mmHeight) -{ - rrScrPriv (pScreen); - int i; - RRScreenSize tmp; - RRScreenSizePtr pNew; - - if (!pScrPriv) - return 0; - - tmp.width = width; - tmp.height= height; - tmp.mmWidth = mmWidth; - tmp.mmHeight = mmHeight; - tmp.pRates = 0; - tmp.nRates = 0; - tmp.nRatesInUse = 0; - tmp.referenced = TRUE; - tmp.oldReferenced = FALSE; - for (i = 0; i < pScrPriv->nSizes; i++) - if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i])) - { - pScrPriv->pSizes[i].referenced = TRUE; - return &pScrPriv->pSizes[i]; - } - pNew = xrealloc (pScrPriv->pSizes, - (pScrPriv->nSizes + 1) * sizeof (RRScreenSize)); - if (!pNew) - return 0; - pNew[pScrPriv->nSizes++] = tmp; - pScrPriv->pSizes = pNew; - return &pNew[pScrPriv->nSizes-1]; -} - -Bool RRRegisterRate (ScreenPtr pScreen, - RRScreenSizePtr pSize, - int rate) -{ - rrScrPriv(pScreen); - int i; - RRScreenRatePtr pNew, pRate; - - if (!pScrPriv) - return FALSE; - - for (i = 0; i < pSize->nRates; i++) - { - pRate = &pSize->pRates[i]; - if (pRate->rate == rate) - { - pRate->referenced = TRUE; - return TRUE; - } - } - - pNew = xrealloc (pSize->pRates, - (pSize->nRates + 1) * sizeof (RRScreenRate)); - if (!pNew) - return FALSE; - pRate = &pNew[pSize->nRates++]; - pRate->rate = rate; - pRate->referenced = TRUE; - pRate->oldReferenced = FALSE; - pSize->pRates = pNew; - return TRUE; -} - -void -RRSetCurrentConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPriv (pScreen); - - if (!pScrPriv) - return; - - pScrPriv->rotation = rotation; - pScrPriv->size = pSize - pScrPriv->pSizes; - pScrPriv->rate = rate; -} diff --git a/nx-X11/programs/Xserver/randr.X.original/randrstr.h b/nx-X11/programs/Xserver/randr.X.original/randrstr.h deleted file mode 100644 index cd4ce3846..000000000 --- a/nx-X11/programs/Xserver/randr.X.original/randrstr.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/randr/randrstr.h,v 1.5 2002/09/29 23:39:45 keithp Exp $ - * - * Copyright © 2000 Compaq Computer Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Compaq makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * COMPAQ DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL COMPAQ BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _RANDRSTR_H_ -#define _RANDRSTR_H_ - -#include - -typedef struct _rrScreenRate { - int rate; - Bool referenced; - Bool oldReferenced; -} RRScreenRate, *RRScreenRatePtr; - -typedef struct _rrScreenSize { - int id; - short width, height; - short mmWidth, mmHeight; - RRScreenRatePtr pRates; - int nRates; - int nRatesInUse; - Bool referenced; - Bool oldReferenced; -} RRScreenSize, *RRScreenSizePtr; - -typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize); - -typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations); -typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen); - -typedef struct _rrScrPriv { - RRSetConfigProcPtr rrSetConfig; - RRGetInfoProcPtr rrGetInfo; - - TimeStamp lastSetTime; /* last changed by client */ - TimeStamp lastConfigTime; /* possible configs changed */ - RRCloseScreenProcPtr CloseScreen; - - /* - * Configuration information - */ - Rotation rotations; - - int nSizes; - int nSizesInUse; - RRScreenSizePtr pSizes; - - /* - * Current state - */ - Rotation rotation; - int size; - int rate; -} rrScrPrivRec, *rrScrPrivPtr; - -extern int rrPrivIndex; - -#define rrGetScrPriv(pScr) ((rrScrPrivPtr) (pScr)->devPrivates[rrPrivIndex].ptr) -#define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr) -#define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p)) - -/* Initialize the extension */ -void -RRExtensionInit (void); - -/* - * Then, register the specific size with the screen - */ - -RRScreenSizePtr -RRRegisterSize (ScreenPtr pScreen, - short width, - short height, - short mmWidth, - short mmHeight); - -Bool RRRegisterRate (ScreenPtr pScreen, - RRScreenSizePtr pSize, - int rate); - -/* - * Finally, set the current configuration of the screen - */ - -void -RRSetCurrentConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize); - -Bool RRScreenInit(ScreenPtr pScreen); - -int -RRSetScreenConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize); - -Bool -miRandRInit (ScreenPtr pScreen); - -Bool -miRRGetInfo (ScreenPtr pScreen, Rotation *rotations); - -Bool -miRRSetConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr size); - -Bool -miRRGetScreenInfo (ScreenPtr pScreen); - -#endif /* _RANDRSTR_H_ */ diff --git a/nx-X11/programs/Xserver/randr/Imakefile.NX.original b/nx-X11/programs/Xserver/randr/Imakefile.NX.original deleted file mode 100644 index 2eff07fee..000000000 --- a/nx-X11/programs/Xserver/randr/Imakefile.NX.original +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ -XCOMM $XFree86: xc/programs/Xserver/randr/Imakefile,v 1.1 2001/05/23 03:29:44 keithp Exp $ -#include - - SRCS = mirandr.c randr.c rrcrtc.c rrdispatch.c rrinfo.c rrmode.c rroutput.c rrpointer.c rrproperty.c rrscreen.c rrsdispatch.c rrxinerama.c - - OBJS = mirandr.o randr.o rrcrtc.o rrdispatch.o rrinfo.o rrmode.o rroutput.o rrpointer.o rrproperty.o rrscreen.o rrsdispatch.o rrxinerama.o - - INCLUDES = -I../include -I../mi -I../../../include/fonts \ - -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I../render - LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln - - DEFINES = -DNXAGENT_SERVER - -NormalLibraryTarget(randr,$(OBJS)) -NormalLibraryObjectRule() -LintLibraryTarget(randr,$(SRCS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/programs/Xserver/randr/Imakefile.X.original b/nx-X11/programs/Xserver/randr/Imakefile.X.original deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/programs/Xserver/randr/panoramiXproto.h.NX.original b/nx-X11/programs/Xserver/randr/panoramiXproto.h.NX.original deleted file mode 100644 index 6b27c56eb..000000000 --- a/nx-X11/programs/Xserver/randr/panoramiXproto.h.NX.original +++ /dev/null @@ -1,192 +0,0 @@ -/* $Xorg: panoramiXproto.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */ -/***************************************************************** -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. -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. - -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 -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. -******************************************************************/ -/* $XFree86: xc/include/extensions/panoramiXproto.h,v 3.5 2000/03/01 01:04:21 dawes Exp $ */ - -/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ - -#ifndef _PANORAMIXPROTO_H_ -#define _PANORAMIXPROTO_H_ - -#define PANORAMIX_PROTOCOL_NAME "XINERAMA" - -#define X_PanoramiXQueryVersion 0 -#define X_PanoramiXGetState 1 -#define X_PanoramiXGetScreenCount 2 -#define X_PanoramiXGetScreenSize 3 - -#define X_XineramaIsActive 4 -#define X_XineramaQueryScreens 5 - -typedef struct _PanoramiXQueryVersion { - CARD8 reqType; /* always PanoramiXReqCode */ - CARD8 panoramiXReqType; /* always X_PanoramiXQueryVersion */ - CARD16 length B16; - CARD8 clientMajor; - CARD8 clientMinor; - CARD16 unused B16; -} xPanoramiXQueryVersionReq; - -#define sz_xPanoramiXQueryVersionReq 8 - -typedef struct { - CARD8 type; /* must be X_Reply */ - CARD8 pad1; /* unused */ - CARD16 sequenceNumber B16; /* last sequence number */ - CARD32 length B32; /* 0 */ - CARD16 majorVersion B16; - CARD16 minorVersion B16; - CARD32 pad2 B32; /* unused */ - CARD32 pad3 B32; /* unused */ - CARD32 pad4 B32; /* unused */ - CARD32 pad5 B32; /* unused */ - CARD32 pad6 B32; /* unused */ -} xPanoramiXQueryVersionReply; - -#define sz_xPanoramiXQueryVersionReply 32 - - -typedef struct _PanoramiXGetState { - CARD8 reqType; /* always PanoramiXReqCode */ - CARD8 panoramiXReqType; /* always X_PanoramiXGetState */ - CARD16 length B16; - CARD32 window B32; -} xPanoramiXGetStateReq; -#define sz_xPanoramiXGetStateReq 8 - -typedef struct { - BYTE type; - BYTE state; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 window B32; - CARD32 pad1 B32; /* unused */ - CARD32 pad2 B32; /* unused */ - CARD32 pad3 B32; /* unused */ - CARD32 pad4 B32; /* unused */ - CARD32 pad5 B32; /* unused */ -} xPanoramiXGetStateReply; - -#define sz_panoramiXGetStateReply 32 - -typedef struct _PanoramiXGetScreenCount { - CARD8 reqType; /* always PanoramiXReqCode */ - CARD8 panoramiXReqType; /* always X_PanoramiXGetScreenCount */ - CARD16 length B16; - CARD32 window B32; -} xPanoramiXGetScreenCountReq; -#define sz_xPanoramiXGetScreenCountReq 8 - -typedef struct { - BYTE type; - BYTE ScreenCount; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 window B32; - CARD32 pad1 B32; /* unused */ - CARD32 pad2 B32; /* unused */ - CARD32 pad3 B32; /* unused */ - CARD32 pad4 B32; /* unused */ - CARD32 pad5 B32; /* unused */ -} xPanoramiXGetScreenCountReply; -#define sz_panoramiXGetScreenCountReply 32 - -typedef struct _PanoramiXGetScreenSize { - CARD8 reqType; /* always PanoramiXReqCode */ - CARD8 panoramiXReqType; /* always X_PanoramiXGetState */ - CARD16 length B16; - CARD32 window B32; - CARD32 screen B32; -} xPanoramiXGetScreenSizeReq; -#define sz_xPanoramiXGetScreenSizeReq 12 - -typedef struct { - BYTE type; - CARD8 pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 width B32; - CARD32 height B32; - CARD32 window B32; - CARD32 screen B32; - CARD32 pad2 B32; /* unused */ - CARD32 pad3 B32; /* unused */ -} xPanoramiXGetScreenSizeReply; -#define sz_panoramiXGetScreenSizeReply 32 - -/************ Alternate protocol ******************/ - -typedef struct { - CARD8 reqType; - CARD8 panoramiXReqType; - CARD16 length B16; -} xXineramaIsActiveReq; -#define sz_xXineramaIsActiveReq 4 - -typedef struct { - BYTE type; - CARD8 pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 state B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXineramaIsActiveReply; -#define sz_XineramaIsActiveReply 32 - - -typedef struct { - CARD8 reqType; - CARD8 panoramiXReqType; - CARD16 length B16; -} xXineramaQueryScreensReq; -#define sz_xXineramaQueryScreensReq 4 - -typedef struct { - BYTE type; - CARD8 pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 number B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXineramaQueryScreensReply; -#define sz_XineramaQueryScreensReply 32 - -typedef struct { - INT16 x_org B16; - INT16 y_org B16; - CARD16 width B16; - CARD16 height B16; -} xXineramaScreenInfo; -#define sz_XineramaScreenInfo 8 - -#endif diff --git a/nx-X11/programs/Xserver/randr/panoramiXproto.h.X.original b/nx-X11/programs/Xserver/randr/panoramiXproto.h.X.original deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/programs/Xserver/randr/randr.c.NX.original b/nx-X11/programs/Xserver/randr/randr.c.NX.original deleted file mode 100644 index 81df406a6..000000000 --- a/nx-X11/programs/Xserver/randr/randr.c.NX.original +++ /dev/null @@ -1,521 +0,0 @@ -/* - * Copyright © 2000 Compaq Computer Corporation - * Copyright © 2002 Hewlett-Packard Company - * Copyright © 2006 Intel Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * Author: Jim Gettys, Hewlett-Packard Company, Inc. - * Keith Packard, Intel Corporation - */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "randrstr.h" - -/* From render.h */ -#ifndef SubPixelUnknown -#define SubPixelUnknown 0 -#endif - -#define RR_VALIDATE -static int RRNScreens; - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); - -int RREventBase; -int RRErrorBase; -RESTYPE RRClientType, RREventType; /* resource types for event masks */ - -#ifndef NXAGENT_SERVER -DevPrivateKey RRClientPrivateKey = &RRClientPrivateKey; -DevPrivateKey rrPrivKey = &rrPrivKey; -#else -int RRClientPrivateIndex; -int rrPrivIndex = -1; -#endif - -static void -RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - rrClientPriv(pClient); - RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1); - int i; - - pRRClient->major_version = 0; - pRRClient->minor_version = 0; - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - rrScrPriv(pScreen); - - if (pScrPriv) - { - pTimes[i].setTime = pScrPriv->lastSetTime; - pTimes[i].configTime = pScrPriv->lastConfigTime; - } - } -} - -static void -RRResetProc (ExtensionEntry *extEntry) -{ -} - -static Bool -RRCloseScreen (int i, ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - int j; - - unwrap (pScrPriv, pScreen, CloseScreen); - for (j = pScrPriv->numCrtcs - 1; j >= 0; j--) - RRCrtcDestroy (pScrPriv->crtcs[j]); - for (j = pScrPriv->numOutputs - 1; j >= 0; j--) - RROutputDestroy (pScrPriv->outputs[j]); - - xfree (pScrPriv); - RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, - xRRScreenChangeNotifyEvent *to) -{ - to->type = from->type; - to->rotation = from->rotation; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->root, to->root); - cpswapl(from->window, to->window); - cpswaps(from->sizeID, to->sizeID); - cpswaps(from->widthInPixels, to->widthInPixels); - cpswaps(from->heightInPixels, to->heightInPixels); - cpswaps(from->widthInMillimeters, to->widthInMillimeters); - cpswaps(from->heightInMillimeters, to->heightInMillimeters); - cpswaps(from->subpixelOrder, to->subpixelOrder); -} - -static void -SRRCrtcChangeNotifyEvent(xRRCrtcChangeNotifyEvent *from, - xRRCrtcChangeNotifyEvent *to) -{ - to->type = from->type; - to->subCode = from->subCode; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->window, to->window); - cpswapl(from->crtc, to->crtc); - cpswapl(from->mode, to->mode); - cpswapl(from->window, to->window); - cpswaps(from->rotation, to->rotation); - cpswaps(from->x, to->x); - cpswaps(from->y, to->y); - cpswaps(from->width, to->width); - cpswaps(from->height, to->height); -} - -static void -SRROutputChangeNotifyEvent(xRROutputChangeNotifyEvent *from, - xRROutputChangeNotifyEvent *to) -{ - to->type = from->type; - to->subCode = from->subCode; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->window, to->window); - cpswapl(from->output, to->output); - cpswapl(from->crtc, to->crtc); - cpswapl(from->mode, to->mode); - cpswaps(from->rotation, to->rotation); -} - -static void -SRROutputPropertyNotifyEvent(xRROutputPropertyNotifyEvent *from, - xRROutputPropertyNotifyEvent *to) -{ - to->type = from->type; - to->subCode = from->subCode; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->window, to->window); - cpswapl(from->output, to->output); - cpswapl(from->atom, to->atom); - cpswapl(from->timestamp, to->timestamp); -} - -static void -SRRNotifyEvent (xEvent *from, - xEvent *to) -{ - switch (from->u.u.detail) { - case RRNotify_CrtcChange: - SRRCrtcChangeNotifyEvent ((xRRCrtcChangeNotifyEvent *) from, - (xRRCrtcChangeNotifyEvent *) to); - break; - case RRNotify_OutputChange: - SRROutputChangeNotifyEvent ((xRROutputChangeNotifyEvent *) from, - (xRROutputChangeNotifyEvent *) to); - break; - case RRNotify_OutputProperty: - SRROutputPropertyNotifyEvent ((xRROutputPropertyNotifyEvent *) from, - (xRROutputPropertyNotifyEvent *) to); - break; - default: - break; - } -} - -static int RRGeneration; - -Bool RRInit (void) -{ - if (RRGeneration != serverGeneration) - { - #ifdef NXAGENT_SERVER - if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - #endif - if (!RRModeInit ()) - return FALSE; - if (!RRCrtcInit ()) - return FALSE; - if (!RROutputInit ()) - return FALSE; - RRGeneration = serverGeneration; - } - return TRUE; -} - -Bool RRScreenInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (!RRInit ()) - return FALSE; - - pScrPriv = (rrScrPrivPtr) xcalloc (1, sizeof (rrScrPrivRec)); - if (!pScrPriv) - return FALSE; - - SetRRScreen(pScreen, pScrPriv); - - /* - * Calling function best set these function vectors - */ - pScrPriv->rrGetInfo = 0; - pScrPriv->maxWidth = pScrPriv->minWidth = pScreen->width; - pScrPriv->maxHeight = pScrPriv->minHeight = pScreen->height; - - pScrPriv->width = pScreen->width; - pScrPriv->height = pScreen->height; - pScrPriv->mmWidth = pScreen->mmWidth; - pScrPriv->mmHeight = pScreen->mmHeight; -#if RANDR_12_INTERFACE - pScrPriv->rrScreenSetSize = NULL; - pScrPriv->rrCrtcSet = NULL; - pScrPriv->rrCrtcSetGamma = NULL; -#endif -#if RANDR_10_INTERFACE - pScrPriv->rrSetConfig = 0; - pScrPriv->rotations = RR_Rotate_0; - pScrPriv->reqWidth = pScreen->width; - pScrPriv->reqHeight = pScreen->height; - pScrPriv->nSizes = 0; - pScrPriv->pSizes = NULL; - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->rate = 0; - pScrPriv->size = 0; -#endif - - /* - * This value doesn't really matter -- any client must call - * GetScreenInfo before reading it which will automatically update - * the time - */ - pScrPriv->lastSetTime = currentTime; - pScrPriv->lastConfigTime = currentTime; - - wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - - pScrPriv->numOutputs = 0; - pScrPriv->outputs = NULL; - pScrPriv->numCrtcs = 0; - pScrPriv->crtcs = NULL; - - RRNScreens += 1; /* keep count of screens that implement randr */ - return TRUE; -} - -/*ARGSUSED*/ -static int -RRFreeClient (pointer data, XID id) -{ - RREventPtr pRREvent; - WindowPtr pWin; - RREventPtr *pHead, pCur, pPrev; - - pRREvent = (RREventPtr) data; - pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, RREventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) - { - if (pPrev) - pPrev->next = pRREvent->next; - else - *pHead = pRREvent->next; - } - } - xfree ((pointer) pRREvent); - return 1; -} - -/*ARGSUSED*/ -static int -RRFreeEvents (pointer data, XID id) -{ - RREventPtr *pHead, pCur, pNext; - - pHead = (RREventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, RRClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - return 1; -} - -void -RRExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (RRNScreens == 0) return; - - #ifndef NXAGENT_SERVER - if (!dixRequestPrivate(RRClientPrivateKey, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - #else - RRClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RRClientPrivateIndex, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - #endif - if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) - return; - - RRClientType = CreateNewResourceType(RRFreeClient); - if (!RRClientType) - return; - RREventType = CreateNewResourceType(RRFreeEvents); - if (!RREventType) - return; - extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, - ProcRRDispatch, SProcRRDispatch, - RRResetProc, StandardMinorOpcode); - if (!extEntry) - return; - RRErrorBase = extEntry->errorBase; - RREventBase = extEntry->eventBase; - EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; - EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr) - SRRNotifyEvent; -#ifdef PANORAMIX - RRXineramaExtensionInit(); -#endif -} - -static int -TellChanged (WindowPtr pWin, pointer value) -{ - RREventPtr *pHead, pRREvent; - ClientPtr client; - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv(pScreen); - int i; - - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, RREventType); - if (!pHead) - return WT_WALKCHILDREN; - - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - { - client = pRREvent->client; - if (client == serverClient || client->clientGone) - continue; - - if (pRREvent->mask & RRScreenChangeNotifyMask) - RRDeliverScreenEvent (client, pWin, pScreen); - - if (pRREvent->mask & RRCrtcChangeNotifyMask) - { - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - RRCrtcPtr crtc = pScrPriv->crtcs[i]; - if (crtc->changed) - RRDeliverCrtcEvent (client, pWin, crtc); - } - } - - if (pRREvent->mask & RROutputChangeNotifyMask) - { - for (i = 0; i < pScrPriv->numOutputs; i++) - { - RROutputPtr output = pScrPriv->outputs[i]; - if (output->changed) - RRDeliverOutputEvent (client, pWin, output); - } - } - } - return WT_WALKCHILDREN; -} - -/* - * Something changed; send events and adjust pointer position - */ -void -RRTellChanged (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i; - - if (pScrPriv->changed) - { - UpdateCurrentTime (); - if (pScrPriv->configChanged) - { - pScrPriv->lastConfigTime = currentTime; - pScrPriv->configChanged = FALSE; - } - pScrPriv->changed = FALSE; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - for (i = 0; i < pScrPriv->numOutputs; i++) - pScrPriv->outputs[i]->changed = FALSE; - for (i = 0; i < pScrPriv->numCrtcs; i++) - pScrPriv->crtcs[i]->changed = FALSE; - if (pScrPriv->layoutChanged) - { - pScrPriv->layoutChanged = FALSE; - RRPointerScreenConfigured (pScreen); - RRSendConfigNotify (pScreen); - } - } -} - -/* - * Return the first output which is connected to an active CRTC - * Used in emulating 1.0 behaviour - */ -RROutputPtr -RRFirstOutput (ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - RROutputPtr output; - int i, j; - - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - RRCrtcPtr crtc = pScrPriv->crtcs[i]; - for (j = 0; j < pScrPriv->numOutputs; j++) - { - output = pScrPriv->outputs[j]; - if (output->crtc == crtc) - return output; - } - } - return NULL; -} - -CARD16 -RRVerticalRefresh (xRRModeInfo *mode) -{ - CARD32 refresh; - CARD32 dots = mode->hTotal * mode->vTotal; - if (!dots) - return 0; - refresh = (mode->dotClock + dots/2) / dots; - if (refresh > 0xffff) - refresh = 0xffff; - return (CARD16) refresh; -} - -static int -ProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data]) - return BadRequest; - return (*ProcRandrVector[stuff->data]) (client); -} - -static int -SProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data]) - return BadRequest; - return (*SProcRandrVector[stuff->data]) (client); -} - diff --git a/nx-X11/programs/Xserver/randr/randr.c.X.original b/nx-X11/programs/Xserver/randr/randr.c.X.original deleted file mode 100644 index bc2b995d2..000000000 --- a/nx-X11/programs/Xserver/randr/randr.c.X.original +++ /dev/null @@ -1,487 +0,0 @@ -/* - * Copyright © 2000 Compaq Computer Corporation - * Copyright © 2002 Hewlett-Packard Company - * Copyright © 2006 Intel Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * Author: Jim Gettys, Hewlett-Packard Company, Inc. - * Keith Packard, Intel Corporation - */ - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "randrstr.h" - -/* From render.h */ -#ifndef SubPixelUnknown -#define SubPixelUnknown 0 -#endif - -#define RR_VALIDATE -static int RRNScreens; - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); - -int RREventBase; -int RRErrorBase; -RESTYPE RRClientType, RREventType; /* resource types for event masks */ -DevPrivateKey RRClientPrivateKey = &RRClientPrivateKey; - -DevPrivateKey rrPrivKey = &rrPrivKey; - -static void -RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - rrClientPriv(pClient); - RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1); - int i; - - pRRClient->major_version = 0; - pRRClient->minor_version = 0; - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - rrScrPriv(pScreen); - - if (pScrPriv) - { - pTimes[i].setTime = pScrPriv->lastSetTime; - pTimes[i].configTime = pScrPriv->lastConfigTime; - } - } -} - -static void -RRResetProc (ExtensionEntry *extEntry) -{ -} - -static Bool -RRCloseScreen (int i, ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - int j; - - unwrap (pScrPriv, pScreen, CloseScreen); - for (j = pScrPriv->numCrtcs - 1; j >= 0; j--) - RRCrtcDestroy (pScrPriv->crtcs[j]); - for (j = pScrPriv->numOutputs - 1; j >= 0; j--) - RROutputDestroy (pScrPriv->outputs[j]); - - xfree (pScrPriv); - RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, - xRRScreenChangeNotifyEvent *to) -{ - to->type = from->type; - to->rotation = from->rotation; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->root, to->root); - cpswapl(from->window, to->window); - cpswaps(from->sizeID, to->sizeID); - cpswaps(from->widthInPixels, to->widthInPixels); - cpswaps(from->heightInPixels, to->heightInPixels); - cpswaps(from->widthInMillimeters, to->widthInMillimeters); - cpswaps(from->heightInMillimeters, to->heightInMillimeters); - cpswaps(from->subpixelOrder, to->subpixelOrder); -} - -static void -SRRCrtcChangeNotifyEvent(xRRCrtcChangeNotifyEvent *from, - xRRCrtcChangeNotifyEvent *to) -{ - to->type = from->type; - to->subCode = from->subCode; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->window, to->window); - cpswapl(from->crtc, to->crtc); - cpswapl(from->mode, to->mode); - cpswapl(from->window, to->window); - cpswaps(from->rotation, to->rotation); - cpswaps(from->x, to->x); - cpswaps(from->y, to->y); - cpswaps(from->width, to->width); - cpswaps(from->height, to->height); -} - -static void -SRROutputChangeNotifyEvent(xRROutputChangeNotifyEvent *from, - xRROutputChangeNotifyEvent *to) -{ - to->type = from->type; - to->subCode = from->subCode; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->window, to->window); - cpswapl(from->output, to->output); - cpswapl(from->crtc, to->crtc); - cpswapl(from->mode, to->mode); - cpswaps(from->rotation, to->rotation); -} - -static void -SRROutputPropertyNotifyEvent(xRROutputPropertyNotifyEvent *from, - xRROutputPropertyNotifyEvent *to) -{ - to->type = from->type; - to->subCode = from->subCode; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->window, to->window); - cpswapl(from->output, to->output); - cpswapl(from->atom, to->atom); - cpswapl(from->timestamp, to->timestamp); -} - -static void -SRRNotifyEvent (xEvent *from, - xEvent *to) -{ - switch (from->u.u.detail) { - case RRNotify_CrtcChange: - SRRCrtcChangeNotifyEvent ((xRRCrtcChangeNotifyEvent *) from, - (xRRCrtcChangeNotifyEvent *) to); - break; - case RRNotify_OutputChange: - SRROutputChangeNotifyEvent ((xRROutputChangeNotifyEvent *) from, - (xRROutputChangeNotifyEvent *) to); - break; - case RRNotify_OutputProperty: - SRROutputPropertyNotifyEvent ((xRROutputPropertyNotifyEvent *) from, - (xRROutputPropertyNotifyEvent *) to); - break; - default: - break; - } -} - -static int RRGeneration; - -Bool RRInit (void) -{ - if (RRGeneration != serverGeneration) - { - if (!RRModeInit ()) - return FALSE; - if (!RRCrtcInit ()) - return FALSE; - if (!RROutputInit ()) - return FALSE; - RRGeneration = serverGeneration; - } - return TRUE; -} - -Bool RRScreenInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (!RRInit ()) - return FALSE; - - pScrPriv = (rrScrPrivPtr) xcalloc (1, sizeof (rrScrPrivRec)); - if (!pScrPriv) - return FALSE; - - SetRRScreen(pScreen, pScrPriv); - - /* - * Calling function best set these function vectors - */ - pScrPriv->rrGetInfo = 0; - pScrPriv->maxWidth = pScrPriv->minWidth = pScreen->width; - pScrPriv->maxHeight = pScrPriv->minHeight = pScreen->height; - - pScrPriv->width = pScreen->width; - pScrPriv->height = pScreen->height; - pScrPriv->mmWidth = pScreen->mmWidth; - pScrPriv->mmHeight = pScreen->mmHeight; -#if RANDR_12_INTERFACE - pScrPriv->rrScreenSetSize = NULL; - pScrPriv->rrCrtcSet = NULL; - pScrPriv->rrCrtcSetGamma = NULL; -#endif -#if RANDR_10_INTERFACE - pScrPriv->rrSetConfig = 0; - pScrPriv->rotations = RR_Rotate_0; - pScrPriv->reqWidth = pScreen->width; - pScrPriv->reqHeight = pScreen->height; - pScrPriv->nSizes = 0; - pScrPriv->pSizes = NULL; - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->rate = 0; - pScrPriv->size = 0; -#endif - - /* - * This value doesn't really matter -- any client must call - * GetScreenInfo before reading it which will automatically update - * the time - */ - pScrPriv->lastSetTime = currentTime; - pScrPriv->lastConfigTime = currentTime; - - wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - - pScrPriv->numOutputs = 0; - pScrPriv->outputs = NULL; - pScrPriv->numCrtcs = 0; - pScrPriv->crtcs = NULL; - - RRNScreens += 1; /* keep count of screens that implement randr */ - return TRUE; -} - -/*ARGSUSED*/ -static int -RRFreeClient (pointer data, XID id) -{ - RREventPtr pRREvent; - WindowPtr pWin; - RREventPtr *pHead, pCur, pPrev; - - pRREvent = (RREventPtr) data; - pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, RREventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) - { - if (pPrev) - pPrev->next = pRREvent->next; - else - *pHead = pRREvent->next; - } - } - xfree ((pointer) pRREvent); - return 1; -} - -/*ARGSUSED*/ -static int -RRFreeEvents (pointer data, XID id) -{ - RREventPtr *pHead, pCur, pNext; - - pHead = (RREventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, RRClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - return 1; -} - -void -RRExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (RRNScreens == 0) return; - - if (!dixRequestPrivate(RRClientPrivateKey, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) - return; - - RRClientType = CreateNewResourceType(RRFreeClient); - if (!RRClientType) - return; - RREventType = CreateNewResourceType(RRFreeEvents); - if (!RREventType) - return; - extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, - ProcRRDispatch, SProcRRDispatch, - RRResetProc, StandardMinorOpcode); - if (!extEntry) - return; - RRErrorBase = extEntry->errorBase; - RREventBase = extEntry->eventBase; - EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; - EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr) - SRRNotifyEvent; -#ifdef PANORAMIX - RRXineramaExtensionInit(); -#endif -} - -static int -TellChanged (WindowPtr pWin, pointer value) -{ - RREventPtr *pHead, pRREvent; - ClientPtr client; - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv(pScreen); - int i; - - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, RREventType); - if (!pHead) - return WT_WALKCHILDREN; - - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - { - client = pRREvent->client; - if (client == serverClient || client->clientGone) - continue; - - if (pRREvent->mask & RRScreenChangeNotifyMask) - RRDeliverScreenEvent (client, pWin, pScreen); - - if (pRREvent->mask & RRCrtcChangeNotifyMask) - { - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - RRCrtcPtr crtc = pScrPriv->crtcs[i]; - if (crtc->changed) - RRDeliverCrtcEvent (client, pWin, crtc); - } - } - - if (pRREvent->mask & RROutputChangeNotifyMask) - { - for (i = 0; i < pScrPriv->numOutputs; i++) - { - RROutputPtr output = pScrPriv->outputs[i]; - if (output->changed) - RRDeliverOutputEvent (client, pWin, output); - } - } - } - return WT_WALKCHILDREN; -} - -/* - * Something changed; send events and adjust pointer position - */ -void -RRTellChanged (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i; - - if (pScrPriv->changed) - { - UpdateCurrentTime (); - if (pScrPriv->configChanged) - { - pScrPriv->lastConfigTime = currentTime; - pScrPriv->configChanged = FALSE; - } - pScrPriv->changed = FALSE; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - for (i = 0; i < pScrPriv->numOutputs; i++) - pScrPriv->outputs[i]->changed = FALSE; - for (i = 0; i < pScrPriv->numCrtcs; i++) - pScrPriv->crtcs[i]->changed = FALSE; - if (pScrPriv->layoutChanged) - { - pScrPriv->layoutChanged = FALSE; - RRPointerScreenConfigured (pScreen); - RRSendConfigNotify (pScreen); - } - } -} - -/* - * Return the first output which is connected to an active CRTC - * Used in emulating 1.0 behaviour - */ -RROutputPtr -RRFirstOutput (ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - RROutputPtr output; - int i, j; - - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - RRCrtcPtr crtc = pScrPriv->crtcs[i]; - for (j = 0; j < pScrPriv->numOutputs; j++) - { - output = pScrPriv->outputs[j]; - if (output->crtc == crtc) - return output; - } - } - return NULL; -} - -CARD16 -RRVerticalRefresh (xRRModeInfo *mode) -{ - CARD32 refresh; - CARD32 dots = mode->hTotal * mode->vTotal; - if (!dots) - return 0; - refresh = (mode->dotClock + dots/2) / dots; - if (refresh > 0xffff) - refresh = 0xffff; - return (CARD16) refresh; -} - -static int -ProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data]) - return BadRequest; - return (*ProcRandrVector[stuff->data]) (client); -} - -static int -SProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data]) - return BadRequest; - return (*SProcRandrVector[stuff->data]) (client); -} - diff --git a/nx-X11/programs/Xserver/randr/randr.h.NX.original b/nx-X11/programs/Xserver/randr/randr.h.NX.original deleted file mode 100644 index 17e6ef9f6..000000000 --- a/nx-X11/programs/Xserver/randr/randr.h.NX.original +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright © 2000 Compaq Computer Corporation - * Copyright © 2002 Hewlett Packard Company - * Copyright © 2006 Intel Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - * Keith Packard, Intel Corporation - */ - -#ifndef _RANDR_H_ -#define _RANDR_H_ - -typedef unsigned short Rotation; -typedef unsigned short SizeID; -typedef unsigned short SubpixelOrder; -typedef unsigned short Connection; -typedef unsigned short XRandrRotation; -typedef unsigned short XRandrSizeID; -typedef unsigned short XRandrSubpixelOrder; -typedef unsigned long XRandrModeFlags; - -#define RANDR_NAME "RANDR" -#define RANDR_MAJOR 1 -#define RANDR_MINOR 2 - -#define RRNumberErrors 3 -#define RRNumberEvents 2 -#define RRNumberRequests 25 - -#define X_RRQueryVersion 0 -/* we skip 1 to make old clients fail pretty immediately */ -#define X_RROldGetScreenInfo 1 -#define X_RR1_0SetScreenConfig 2 -/* V1.0 apps share the same set screen config request id */ -#define X_RRSetScreenConfig 2 -#define X_RROldScreenChangeSelectInput 3 -/* 3 used to be ScreenChangeSelectInput; deprecated */ -#define X_RRSelectInput 4 -#define X_RRGetScreenInfo 5 - -/* V1.2 additions */ -#define X_RRGetScreenSizeRange 6 -#define X_RRSetScreenSize 7 -#define X_RRGetScreenResources 8 -#define X_RRGetOutputInfo 9 -#define X_RRListOutputProperties 10 -#define X_RRQueryOutputProperty 11 -#define X_RRConfigureOutputProperty 12 -#define X_RRChangeOutputProperty 13 -#define X_RRDeleteOutputProperty 14 -#define X_RRGetOutputProperty 15 -#define X_RRCreateMode 16 -#define X_RRDestroyMode 17 -#define X_RRAddOutputMode 18 -#define X_RRDeleteOutputMode 19 -#define X_RRGetCrtcInfo 20 -#define X_RRSetCrtcConfig 21 -#define X_RRGetCrtcGammaSize 22 -#define X_RRGetCrtcGamma 23 -#define X_RRSetCrtcGamma 24 - -/* Event selection bits */ -#define RRScreenChangeNotifyMask (1L << 0) -/* V1.2 additions */ -#define RRCrtcChangeNotifyMask (1L << 1) -#define RROutputChangeNotifyMask (1L << 2) -#define RROutputPropertyNotifyMask (1L << 3) - -/* Event codes */ -#define RRScreenChangeNotify 0 -/* V1.2 additions */ -#define RRNotify 1 -/* RRNotify Subcodes */ -#define RRNotify_CrtcChange 0 -#define RRNotify_OutputChange 1 -#define RRNotify_OutputProperty 2 - -/* used in the rotation field; rotation and reflection in 0.1 proto. */ -#define RR_Rotate_0 1 -#define RR_Rotate_90 2 -#define RR_Rotate_180 4 -#define RR_Rotate_270 8 - -/* new in 1.0 protocol, to allow reflection of screen */ - -#define RR_Reflect_X 16 -#define RR_Reflect_Y 32 - -#define RRSetConfigSuccess 0 -#define RRSetConfigInvalidConfigTime 1 -#define RRSetConfigInvalidTime 2 -#define RRSetConfigFailed 3 - -/* new in 1.2 protocol */ - -#define RR_HSyncPositive 0x00000001 -#define RR_HSyncNegative 0x00000002 -#define RR_VSyncPositive 0x00000004 -#define RR_VSyncNegative 0x00000008 -#define RR_Interlace 0x00000010 -#define RR_DoubleScan 0x00000020 -#define RR_CSync 0x00000040 -#define RR_CSyncPositive 0x00000080 -#define RR_CSyncNegative 0x00000100 -#define RR_HSkewPresent 0x00000200 -#define RR_BCast 0x00000400 -#define RR_PixelMultiplex 0x00000800 -#define RR_DoubleClock 0x00001000 -#define RR_ClockDivideBy2 0x00002000 - -#define RR_Connected 0 -#define RR_Disconnected 1 -#define RR_UnknownConnection 2 - -#define BadRROutput 0 -#define BadRRCrtc 1 -#define BadRRMode 2 - -/* Conventional RandR output properties */ - -#define RR_PROPERTY_RANDR_EDID "RANDR_EDID" - -#endif /* _RANDR_H_ */ diff --git a/nx-X11/programs/Xserver/randr/randr.h.X.original b/nx-X11/programs/Xserver/randr/randr.h.X.original deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/programs/Xserver/randr/randrproto.h.NX.original b/nx-X11/programs/Xserver/randr/randrproto.h.NX.original deleted file mode 100644 index 7d5c139e9..000000000 --- a/nx-X11/programs/Xserver/randr/randrproto.h.NX.original +++ /dev/null @@ -1,655 +0,0 @@ -/* - * Copyright © 2000 Compaq Computer Corporation - * Copyright © 2002 Hewlett-Packard Company - * Copyright © 2006 Intel Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * Author: Jim Gettys, Hewlett-Packard Company, Inc. - * Keith Packard, Intel Corporation - */ - -/* note that RANDR 1.0 is incompatible with version 0.0, or 0.1 */ -/* V1.0 removes depth switching from the protocol */ -#ifndef _XRANDRP_H_ -#define _XRANDRP_H_ - -/*#include */ -#include "randr.h" - -#define Window CARD32 -#define Drawable CARD32 -#define Font CARD32 -#define Pixmap CARD32 -#define Cursor CARD32 -#define Colormap CARD32 -#define GContext CARD32 -#define Atom CARD32 -#define Time CARD32 -#define KeyCode CARD8 -#define KeySym CARD32 -#define RROutput CARD32 -#define RRMode CARD32 -#define RRCrtc CARD32 -#define RRModeFlags CARD32 - -#define Rotation CARD16 -#define SizeID CARD16 -#define SubpixelOrder CARD16 - -/* - * data structures - */ - -typedef struct { - CARD16 widthInPixels B16; - CARD16 heightInPixels B16; - CARD16 widthInMillimeters B16; - CARD16 heightInMillimeters B16; -} xScreenSizes; -#define sz_xScreenSizes 8 - -/* - * requests and replies - */ - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - CARD32 majorVersion B32; - CARD32 minorVersion B32; -} xRRQueryVersionReq; -#define sz_xRRQueryVersionReq 12 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 majorVersion B32; - CARD32 minorVersion B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xRRQueryVersionReply; -#define sz_xRRQueryVersionReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Window window B32; -} xRRGetScreenInfoReq; -#define sz_xRRGetScreenInfoReq 8 - -/* - * the xRRScreenInfoReply structure is followed by: - * - * the size information - */ - - -typedef struct { - BYTE type; /* X_Reply */ - BYTE setOfRotations; - CARD16 sequenceNumber B16; - CARD32 length B32; - Window root B32; - Time timestamp B32; - Time configTimestamp B32; - CARD16 nSizes B16; - SizeID sizeID B16; - Rotation rotation B16; - CARD16 rate B16; - CARD16 nrateEnts B16; - CARD16 pad B16; -} xRRGetScreenInfoReply; -#define sz_xRRGetScreenInfoReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Drawable drawable B32; - Time timestamp B32; - Time configTimestamp B32; - SizeID sizeID B16; - Rotation rotation B16; -} xRR1_0SetScreenConfigReq; -#define sz_xRR1_0SetScreenConfigReq 20 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Drawable drawable B32; - Time timestamp B32; - Time configTimestamp B32; - SizeID sizeID B16; - Rotation rotation B16; - CARD16 rate B16; - CARD16 pad B16; -} xRRSetScreenConfigReq; -#define sz_xRRSetScreenConfigReq 24 - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 status; - CARD16 sequenceNumber B16; - CARD32 length B32; - Time newTimestamp B32; - Time newConfigTimestamp B32; - Window root; - CARD16 subpixelOrder B16; - CARD16 pad4 B16; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xRRSetScreenConfigReply; -#define sz_xRRSetScreenConfigReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Window window B32; - CARD16 enable B16; - CARD16 pad2 B16; -} xRRSelectInputReq; -#define sz_xRRSelectInputReq 12 - -/* - * Additions for version 1.2 - */ - -typedef struct _xRRModeInfo { - RRMode id B32; - CARD16 width B16; - CARD16 height B16; - CARD32 dotClock B32; - CARD16 hSyncStart B16; - CARD16 hSyncEnd B16; - CARD16 hTotal B16; - CARD16 hSkew B16; - CARD16 vSyncStart B16; - CARD16 vSyncEnd B16; - CARD16 vTotal B16; - CARD16 nameLength B16; - RRModeFlags modeFlags B32; -} xRRModeInfo; -#define sz_xRRModeInfo 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Window window B32; -} xRRGetScreenSizeRangeReq; -#define sz_xRRGetScreenSizeRangeReq 8 - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 pad; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 minWidth B16; - CARD16 minHeight B16; - CARD16 maxWidth B16; - CARD16 maxHeight B16; - CARD32 pad0 B32; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; -} xRRGetScreenSizeRangeReply; -#define sz_xRRGetScreenSizeRangeReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Window window B32; - CARD16 width B16; - CARD16 height B16; - CARD32 widthInMillimeters B32; - CARD32 heightInMillimeters B32; -} xRRSetScreenSizeReq; -#define sz_xRRSetScreenSizeReq 20 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Window window B32; -} xRRGetScreenResourcesReq; -#define sz_xRRGetScreenResourcesReq 8 - -typedef struct { - BYTE type; - CARD8 pad; - CARD16 sequenceNumber B16; - CARD32 length B32; - Time timestamp B32; - Time configTimestamp B32; - CARD16 nCrtcs B16; - CARD16 nOutputs B16; - CARD16 nModes B16; - CARD16 nbytesNames B16; - CARD32 pad1 B32; - CARD32 pad2 B32; -} xRRGetScreenResourcesReply; -#define sz_xRRGetScreenResourcesReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RROutput output B32; - Time configTimestamp B32; -} xRRGetOutputInfoReq; -#define sz_xRRGetOutputInfoReq 12 - -typedef struct { - BYTE type; - CARD8 status; - CARD16 sequenceNumber B16; - CARD32 length B32; - Time timestamp B32; - RRCrtc crtc B32; - CARD32 mmWidth B32; - CARD32 mmHeight B32; - CARD8 connection; - CARD8 subpixelOrder; - CARD16 nCrtcs B16; - CARD16 nModes B16; - CARD16 nPreferred B16; - CARD16 nClones B16; - CARD16 nameLength B16; -} xRRGetOutputInfoReply; -#define sz_xRRGetOutputInfoReply 36 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RROutput output B32; -} xRRListOutputPropertiesReq; -#define sz_xRRListOutputPropertiesReq 8 - -typedef struct { - BYTE type; - CARD8 pad0; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 nAtoms B16; - CARD16 pad1 B16; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xRRListOutputPropertiesReply; -#define sz_xRRListOutputPropertiesReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RROutput output B32; - Atom property B32; -} xRRQueryOutputPropertyReq; -#define sz_xRRQueryOutputPropertyReq 12 - -typedef struct { - BYTE type; - BYTE pad0; - CARD16 sequenceNumber B16; - CARD32 length B32; - BOOL pending; - BOOL range; - BOOL immutable; - BYTE pad1; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xRRQueryOutputPropertyReply; -#define sz_xRRQueryOutputPropertyReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RROutput output B32; - Atom property B32; - BOOL pending; - BOOL range; - CARD16 pad B16; -} xRRConfigureOutputPropertyReq; -#define sz_xRRConfigureOutputPropertyReq 16 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RROutput output B32; - Atom property B32; - Atom type B32; - CARD8 format; - CARD8 mode; - CARD16 pad; - CARD32 nUnits B32; -} xRRChangeOutputPropertyReq; -#define sz_xRRChangeOutputPropertyReq 24 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RROutput output B32; - Atom property B32; -} xRRDeleteOutputPropertyReq; -#define sz_xRRDeleteOutputPropertyReq 12 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RROutput output B32; - Atom property B32; - Atom type B32; - CARD32 longOffset B32; - CARD32 longLength B32; -#ifdef __cplusplus - BOOL _delete; -#else - BOOL delete; -#endif - BOOL pending; - CARD16 pad1 B16; -} xRRGetOutputPropertyReq; -#define sz_xRRGetOutputPropertyReq 28 - -typedef struct { - BYTE type; - CARD8 format; - CARD16 sequenceNumber B16; - CARD32 length B32; - Atom propertyType B32; - CARD32 bytesAfter B32; - CARD32 nItems B32; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; -} xRRGetOutputPropertyReply; -#define sz_xRRGetOutputPropertyReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - Window window B32; - xRRModeInfo modeInfo; -} xRRCreateModeReq; -#define sz_xRRCreateModeReq 40 - -typedef struct { - BYTE type; - CARD8 pad0; - CARD16 sequenceNumber B16; - CARD32 length B32; - RRMode mode B32; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xRRCreateModeReply; -#define sz_xRRCreateModeReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RRMode mode B32; -} xRRDestroyModeReq; -#define sz_xRRDestroyModeReq 8 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RROutput output B32; - RRMode mode B32; -} xRRAddOutputModeReq; -#define sz_xRRAddOutputModeReq 12 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RROutput output B32; - RRMode mode B32; -} xRRDeleteOutputModeReq; -#define sz_xRRDeleteOutputModeReq 12 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RRCrtc crtc B32; - Time configTimestamp B32; -} xRRGetCrtcInfoReq; -#define sz_xRRGetCrtcInfoReq 12 - -typedef struct { - BYTE type; - CARD8 status; - CARD16 sequenceNumber B16; - CARD32 length B32; - Time timestamp B32; - INT16 x B16; - INT16 y B16; - CARD16 width B16; - CARD16 height B16; - RRMode mode B32; - Rotation rotation B16; - Rotation rotations B16; - CARD16 nOutput B16; - CARD16 nPossibleOutput B16; -} xRRGetCrtcInfoReply; -#define sz_xRRGetCrtcInfoReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RRCrtc crtc B32; - Time timestamp B32; - Time configTimestamp B32; - INT16 x B16; - INT16 y B16; - RRMode mode B32; - Rotation rotation B16; - CARD16 pad B16; -} xRRSetCrtcConfigReq; -#define sz_xRRSetCrtcConfigReq 28 - -typedef struct { - BYTE type; - CARD8 status; - CARD16 sequenceNumber B16; - CARD32 length B32; - Time newTimestamp B32; - CARD32 pad1 B32; - CARD32 pad2 B16; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xRRSetCrtcConfigReply; -#define sz_xRRSetCrtcConfigReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RRCrtc crtc B32; -} xRRGetCrtcGammaSizeReq; -#define sz_xRRGetCrtcGammaSizeReq 8 - -typedef struct { - BYTE type; - CARD8 status; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 size B16; - CARD16 pad1 B16; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xRRGetCrtcGammaSizeReply; -#define sz_xRRGetCrtcGammaSizeReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RRCrtc crtc B32; -} xRRGetCrtcGammaReq; -#define sz_xRRGetCrtcGammaReq 8 - -typedef struct { - BYTE type; - CARD8 status; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 size B16; - CARD16 pad1 B16; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xRRGetCrtcGammaReply; -#define sz_xRRGetCrtcGammaReply 32 - -typedef struct { - CARD8 reqType; - CARD8 randrReqType; - CARD16 length B16; - RRCrtc crtc B32; - CARD16 size B16; - CARD16 pad1 B16; -} xRRSetCrtcGammaReq; -#define sz_xRRSetCrtcGammaReq 12 - -/* - * event - */ -typedef struct { - CARD8 type; /* always evBase + ScreenChangeNotify */ - CARD8 rotation; /* new rotation */ - CARD16 sequenceNumber B16; - Time timestamp B32; /* time screen was changed */ - Time configTimestamp B32; /* time config data was changed */ - Window root B32; /* root window */ - Window window B32; /* window requesting notification */ - SizeID sizeID B16; /* new size ID */ - CARD16 subpixelOrder B16; /* subpixel order */ - CARD16 widthInPixels B16; /* new size */ - CARD16 heightInPixels B16; - CARD16 widthInMillimeters B16; - CARD16 heightInMillimeters B16; -} xRRScreenChangeNotifyEvent; -#define sz_xRRScreenChangeNotifyEvent 32 - -typedef struct { - CARD8 type; /* always evBase + RRNotify */ - CARD8 subCode; /* RRNotify_CrtcChange */ - CARD16 sequenceNumber B16; - Time timestamp B32; /* time crtc was changed */ - Window window B32; /* window requesting notification */ - RRCrtc crtc B32; /* affected CRTC */ - RRMode mode B32; /* current mode */ - CARD16 rotation B16; /* rotation and reflection */ - CARD16 pad1 B16; /* unused */ - INT16 x B16; /* new location */ - INT16 y B16; - CARD16 width B16; /* new size */ - CARD16 height B16; -} xRRCrtcChangeNotifyEvent; -#define sz_xRRCrtcChangeNotifyEvent 32 - -typedef struct { - CARD8 type; /* always evBase + RRNotify */ - CARD8 subCode; /* RRNotify_OutputChange */ - CARD16 sequenceNumber B16; - Time timestamp B32; /* time crtc was changed */ - Time configTimestamp B32; /* time crtc was changed */ - Window window B32; /* window requesting notification */ - RROutput output B32; /* affected output */ - RRCrtc crtc B32; /* current crtc */ - RRMode mode B32; /* current mode */ - CARD16 rotation B16; /* rotation and reflection */ - CARD8 connection; /* connection status */ - CARD8 subpixelOrder; /* subpixel order */ -} xRROutputChangeNotifyEvent; -#define sz_xRROutputChangeNotifyEvent 32 - -typedef struct { - CARD8 type; /* always evBase + RRNotify */ - CARD8 subCode; /* RRNotify_OutputProperty */ - CARD16 sequenceNumber B16; - Window window B32; /* window requesting notification */ - RROutput output B32; /* affected output */ - Atom atom B32; /* property name */ - Time timestamp B32; /* time crtc was changed */ - CARD8 state; /* NewValue or Deleted */ - CARD8 pad1; - CARD16 pad2 B16; - CARD32 pad3 B32; - CARD32 pad4 B32; -} xRROutputPropertyNotifyEvent; -#define sz_xRROutputPropertyNotifyEvent 32 - -#undef RRModeFlags -#undef RRCrtc -#undef RRMode -#undef RROutput -#undef RRMode -#undef RRCrtc -#undef Drawable -#undef Window -#undef Font -#undef Pixmap -#undef Cursor -#undef Colormap -#undef GContext -#undef Atom -#undef Time -#undef KeyCode -#undef KeySym -#undef Rotation -#undef SizeID -#undef SubpixelOrder - -#endif /* _XRANDRP_H_ */ diff --git a/nx-X11/programs/Xserver/randr/randrproto.h.X.original b/nx-X11/programs/Xserver/randr/randrproto.h.X.original deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/programs/Xserver/randr/registry.h.NX.original b/nx-X11/programs/Xserver/randr/registry.h.NX.original deleted file mode 100644 index 29e5fdfd3..000000000 --- a/nx-X11/programs/Xserver/randr/registry.h.NX.original +++ /dev/null @@ -1,64 +0,0 @@ -/*********************************************************** - -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 -AUTHOR 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 DIX_REGISTRY_H -#define DIX_REGISTRY_H - -/* - * Result returned from any unsuccessful lookup - */ -#define XREGISTRY_UNKNOWN "" - -#ifdef XREGISTRY - -#include "resource.h" -#include "extnsionst.h" - -/* Internal string registry - for auditing, debugging, security, etc. */ - -/* - * Registration functions. The name string is not copied, so it must - * not be a stack variable. - */ -void RegisterResourceName(RESTYPE type, char *name); -void RegisterExtensionNames(ExtensionEntry *ext); - -/* - * Lookup functions. The returned string must not be modified or freed. - */ -const char *LookupMajorName(int major); -const char *LookupRequestName(int major, int minor); -const char *LookupEventName(int event); -const char *LookupErrorName(int error); -const char *LookupResourceName(RESTYPE rtype); - -/* - * Setup and teardown - */ -void dixResetRegistry(void); - -#else /* XREGISTRY */ - -/* Define calls away when the registry is not being built. */ - -#define RegisterResourceName(a, b) { ; } -#define RegisterExtensionNames(a) { ; } - -#define LookupMajorName(a) XREGISTRY_UNKNOWN -#define LookupRequestName(a, b) XREGISTRY_UNKNOWN -#define LookupEventName(a) XREGISTRY_UNKNOWN -#define LookupErrorName(a) XREGISTRY_UNKNOWN -#define LookupResourceName(a) XREGISTRY_UNKNOWN - -#define dixResetRegistry() { ; } - -#endif /* XREGISTRY */ -#endif /* DIX_REGISTRY_H */ diff --git a/nx-X11/programs/Xserver/randr/registry.h.X.original b/nx-X11/programs/Xserver/randr/registry.h.X.original deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c.NX.original b/nx-X11/programs/Xserver/randr/rrcrtc.c.NX.original deleted file mode 100644 index fb82a80df..000000000 --- a/nx-X11/programs/Xserver/randr/rrcrtc.c.NX.original +++ /dev/null @@ -1,984 +0,0 @@ -/* - * Copyright © 2006 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#include "randrstr.h" -#include "swaprep.h" -#include "registry.h" - -RESTYPE RRCrtcType; - -/* - * Notify the CRTC of some change - */ -void -RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged) -{ - ScreenPtr pScreen = crtc->pScreen; - - crtc->changed = TRUE; - if (pScreen) - { - rrScrPriv(pScreen); - - pScrPriv->changed = TRUE; - /* - * Send ConfigureNotify on any layout change - */ - if (layoutChanged) - pScrPriv->layoutChanged = TRUE; - } -} - -/* - * Create a CRTC - */ -RRCrtcPtr -RRCrtcCreate (ScreenPtr pScreen, void *devPrivate) -{ - RRCrtcPtr crtc; - RRCrtcPtr *crtcs; - rrScrPrivPtr pScrPriv; - - if (!RRInit()) - return NULL; - - pScrPriv = rrGetScrPriv(pScreen); - - /* make space for the crtc pointer */ - if (pScrPriv->numCrtcs) - crtcs = xrealloc (pScrPriv->crtcs, - (pScrPriv->numCrtcs + 1) * sizeof (RRCrtcPtr)); - else - crtcs = xalloc (sizeof (RRCrtcPtr)); - if (!crtcs) - return FALSE; - pScrPriv->crtcs = crtcs; - - crtc = xcalloc (1, sizeof (RRCrtcRec)); - if (!crtc) - return NULL; - crtc->id = FakeClientID (0); - crtc->pScreen = pScreen; - crtc->mode = NULL; - crtc->x = 0; - crtc->y = 0; - crtc->rotation = RR_Rotate_0; - crtc->rotations = RR_Rotate_0; - crtc->outputs = NULL; - crtc->numOutputs = 0; - crtc->gammaSize = 0; - crtc->gammaRed = crtc->gammaBlue = crtc->gammaGreen = NULL; - crtc->changed = FALSE; - crtc->devPrivate = devPrivate; - - if (!AddResource (crtc->id, RRCrtcType, (pointer) crtc)) - return NULL; - - /* attach the screen and crtc together */ - crtc->pScreen = pScreen; - pScrPriv->crtcs[pScrPriv->numCrtcs++] = crtc; - - return crtc; -} - -/* - * Set the allowed rotations on a CRTC - */ -void -RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations) -{ - crtc->rotations = rotations; -} - -/* - * Notify the extension that the Crtc has been reconfigured, - * the driver calls this whenever it has updated the mode - */ -Bool -RRCrtcNotify (RRCrtcPtr crtc, - RRModePtr mode, - int x, - int y, - Rotation rotation, - int numOutputs, - RROutputPtr *outputs) -{ - int i, j; - - /* - * Check to see if any of the new outputs were - * not in the old list and mark them as changed - */ - for (i = 0; i < numOutputs; i++) - { - for (j = 0; j < crtc->numOutputs; j++) - if (outputs[i] == crtc->outputs[j]) - break; - if (j == crtc->numOutputs) - { - outputs[i]->crtc = crtc; - RROutputChanged (outputs[i], FALSE); - RRCrtcChanged (crtc, FALSE); - } - } - /* - * Check to see if any of the old outputs are - * not in the new list and mark them as changed - */ - for (j = 0; j < crtc->numOutputs; j++) - { - for (i = 0; i < numOutputs; i++) - if (outputs[i] == crtc->outputs[j]) - break; - if (i == numOutputs) - { - if (crtc->outputs[j]->crtc == crtc) - crtc->outputs[j]->crtc = NULL; - RROutputChanged (crtc->outputs[j], FALSE); - RRCrtcChanged (crtc, FALSE); - } - } - /* - * Reallocate the crtc output array if necessary - */ - if (numOutputs != crtc->numOutputs) - { - RROutputPtr *newoutputs; - - if (numOutputs) - { - if (crtc->numOutputs) - newoutputs = xrealloc (crtc->outputs, - numOutputs * sizeof (RROutputPtr)); - else - newoutputs = xalloc (numOutputs * sizeof (RROutputPtr)); - if (!newoutputs) - return FALSE; - } - else - { - if (crtc->outputs) - xfree (crtc->outputs); - newoutputs = NULL; - } - crtc->outputs = newoutputs; - crtc->numOutputs = numOutputs; - } - /* - * Copy the new list of outputs into the crtc - */ - memcpy (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr)); - /* - * Update remaining crtc fields - */ - if (mode != crtc->mode) - { - if (crtc->mode) - RRModeDestroy (crtc->mode); - crtc->mode = mode; - if (mode != NULL) - mode->refcnt++; - RRCrtcChanged (crtc, TRUE); - } - if (x != crtc->x) - { - crtc->x = x; - RRCrtcChanged (crtc, TRUE); - } - if (y != crtc->y) - { - crtc->y = y; - RRCrtcChanged (crtc, TRUE); - } - if (rotation != crtc->rotation) - { - crtc->rotation = rotation; - RRCrtcChanged (crtc, TRUE); - } - return TRUE; -} - -void -RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - xRRCrtcChangeNotifyEvent ce; - RRModePtr mode = crtc->mode; - - ce.type = RRNotify + RREventBase; - ce.subCode = RRNotify_CrtcChange; - ce.sequenceNumber = client->sequence; - ce.timestamp = pScrPriv->lastSetTime.milliseconds; - ce.window = pWin->drawable.id; - ce.crtc = crtc->id; - ce.rotation = crtc->rotation; - if (mode) - { - ce.mode = mode->mode.id; - ce.x = crtc->x; - ce.y = crtc->y; - ce.width = mode->mode.width; - ce.height = mode->mode.height; - } - else - { - ce.mode = None; - ce.x = 0; - ce.y = 0; - ce.width = 0; - ce.height = 0; - } - WriteEventsToClient (client, 1, (xEvent *) &ce); -} - -static Bool -RRCrtcPendingProperties (RRCrtcPtr crtc) -{ - ScreenPtr pScreen = crtc->pScreen; - rrScrPriv(pScreen); - int o; - - for (o = 0; o < pScrPriv->numOutputs; o++) - { - RROutputPtr output = pScrPriv->outputs[o]; - if (output->crtc == crtc && output->pendingProperties) - return TRUE; - } - return FALSE; -} - -/* - * Request that the Crtc be reconfigured - */ -Bool -RRCrtcSet (RRCrtcPtr crtc, - RRModePtr mode, - int x, - int y, - Rotation rotation, - int numOutputs, - RROutputPtr *outputs) -{ - ScreenPtr pScreen = crtc->pScreen; - Bool ret = FALSE; - rrScrPriv(pScreen); - - /* See if nothing changed */ - if (crtc->mode == mode && - crtc->x == x && - crtc->y == y && - crtc->rotation == rotation && - crtc->numOutputs == numOutputs && - !memcmp (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr)) && - !RRCrtcPendingProperties (crtc)) - { - ret = TRUE; - } - else - { -#if RANDR_12_INTERFACE - if (pScrPriv->rrCrtcSet) - { - ret = (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y, - rotation, numOutputs, outputs); - } - else -#endif - { -#if RANDR_10_INTERFACE - if (pScrPriv->rrSetConfig) - { - RRScreenSize size; - RRScreenRate rate; - - if (!mode) - { - RRCrtcNotify (crtc, NULL, x, y, rotation, 0, NULL); - ret = TRUE; - } - else - { - size.width = mode->mode.width; - size.height = mode->mode.height; - if (outputs[0]->mmWidth && outputs[0]->mmHeight) - { - size.mmWidth = outputs[0]->mmWidth; - size.mmHeight = outputs[0]->mmHeight; - } - else - { - size.mmWidth = pScreen->mmWidth; - size.mmHeight = pScreen->mmHeight; - } - size.nRates = 1; - rate.rate = RRVerticalRefresh (&mode->mode); - size.pRates = &rate; - ret = (*pScrPriv->rrSetConfig) (pScreen, rotation, rate.rate, &size); - /* - * Old 1.0 interface tied screen size to mode size - */ - if (ret) - { - RRCrtcNotify (crtc, mode, x, y, rotation, 1, outputs); - RRScreenSizeNotify (pScreen); - } - } - } -#endif - } - if (ret) - { - int o; - RRTellChanged (pScreen); - - for (o = 0; o < numOutputs; o++) - RRPostPendingProperties (outputs[o]); - } - } - return ret; -} - -/* - * Destroy a Crtc at shutdown - */ -void -RRCrtcDestroy (RRCrtcPtr crtc) -{ - FreeResource (crtc->id, 0); -} - -static int -RRCrtcDestroyResource (pointer value, XID pid) -{ - RRCrtcPtr crtc = (RRCrtcPtr) value; - ScreenPtr pScreen = crtc->pScreen; - - if (pScreen) - { - rrScrPriv(pScreen); - int i; - - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - if (pScrPriv->crtcs[i] == crtc) - { - memmove (pScrPriv->crtcs + i, pScrPriv->crtcs + i + 1, - (pScrPriv->numCrtcs - (i + 1)) * sizeof (RRCrtcPtr)); - --pScrPriv->numCrtcs; - break; - } - } - } - if (crtc->gammaRed) - xfree (crtc->gammaRed); - if (crtc->mode) - RRModeDestroy (crtc->mode); - xfree (crtc); - return 1; -} - -/* - * Request that the Crtc gamma be changed - */ - -Bool -RRCrtcGammaSet (RRCrtcPtr crtc, - CARD16 *red, - CARD16 *green, - CARD16 *blue) -{ - Bool ret = TRUE; -#if RANDR_12_INTERFACE - ScreenPtr pScreen = crtc->pScreen; -#endif - - memcpy (crtc->gammaRed, red, crtc->gammaSize * sizeof (CARD16)); - memcpy (crtc->gammaGreen, green, crtc->gammaSize * sizeof (CARD16)); - memcpy (crtc->gammaBlue, blue, crtc->gammaSize * sizeof (CARD16)); -#if RANDR_12_INTERFACE - if (pScreen) - { - rrScrPriv(pScreen); - if (pScrPriv->rrCrtcSetGamma) - ret = (*pScrPriv->rrCrtcSetGamma) (pScreen, crtc); - } -#endif - return ret; -} - -/* - * Notify the extension that the Crtc gamma has been changed - * The driver calls this whenever it has changed the gamma values - * in the RRCrtcRec - */ - -Bool -RRCrtcGammaNotify (RRCrtcPtr crtc) -{ - return TRUE; /* not much going on here */ -} - -/** - * Returns the width/height that the crtc scans out from the framebuffer - */ -void -RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height) -{ - if (crtc->mode == NULL) { - *width = 0; - *height = 0; - return; - } - - switch (crtc->rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_180: - *width = crtc->mode->mode.width; - *height = crtc->mode->mode.height; - break; - case RR_Rotate_90: - case RR_Rotate_270: - *width = crtc->mode->mode.height; - *height = crtc->mode->mode.width; - break; - } -} - -/* - * Set the size of the gamma table at server startup time - */ - -Bool -RRCrtcGammaSetSize (RRCrtcPtr crtc, - int size) -{ - CARD16 *gamma; - - if (size == crtc->gammaSize) - return TRUE; - if (size) - { - gamma = xalloc (size * 3 * sizeof (CARD16)); - if (!gamma) - return FALSE; - } - else - gamma = NULL; - if (crtc->gammaRed) - xfree (crtc->gammaRed); - crtc->gammaRed = gamma; - crtc->gammaGreen = gamma + size; - crtc->gammaBlue = gamma + size*2; - crtc->gammaSize = size; - return TRUE; -} - -/* - * Initialize crtc type - */ -Bool -RRCrtcInit (void) -{ - RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource); - if (!RRCrtcType) - return FALSE; - RegisterResourceName (RRCrtcType, "CRTC"); - return TRUE; -} - -int -ProcRRGetCrtcInfo (ClientPtr client) -{ - REQUEST(xRRGetCrtcInfoReq); - xRRGetCrtcInfoReply rep; - RRCrtcPtr crtc; - CARD8 *extra; - unsigned long extraLen; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - RRModePtr mode; - RROutput *outputs; - RROutput *possible; - int i, j, k, n; - int width, height; - - REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); - crtc = LookupCrtc(client, stuff->crtc, DixReadAccess); - - if (!crtc) - return RRErrorBase + BadRRCrtc; - - /* All crtcs must be associated with screens before client - * requests are processed - */ - pScreen = crtc->pScreen; - pScrPriv = rrGetScrPriv(pScreen); - - mode = crtc->mode; - - rep.type = X_Reply; - rep.status = RRSetConfigSuccess; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.x = crtc->x; - rep.y = crtc->y; - RRCrtcGetScanoutSize (crtc, &width, &height); - rep.width = width; - rep.height = height; - rep.mode = mode ? mode->mode.id : 0; - rep.rotation = crtc->rotation; - rep.rotations = crtc->rotations; - rep.nOutput = crtc->numOutputs; - k = 0; - for (i = 0; i < pScrPriv->numOutputs; i++) - for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) - if (pScrPriv->outputs[i]->crtcs[j] == crtc) - k++; - rep.nPossibleOutput = k; - - rep.length = rep.nOutput + rep.nPossibleOutput; - - extraLen = rep.length << 2; - if (extraLen) - { - extra = xalloc (extraLen); - if (!extra) - return BadAlloc; - } - else - extra = NULL; - - outputs = (RROutput *) extra; - possible = (RROutput *) (outputs + rep.nOutput); - - for (i = 0; i < crtc->numOutputs; i++) - { - outputs[i] = crtc->outputs[i]->id; - if (client->swapped) - swapl (&outputs[i], n); - } - k = 0; - for (i = 0; i < pScrPriv->numOutputs; i++) - for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) - if (pScrPriv->outputs[i]->crtcs[j] == crtc) - { - possible[k] = pScrPriv->outputs[i]->id; - if (client->swapped) - swapl (&possible[k], n); - k++; - } - - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.x, n); - swaps(&rep.y, n); - swaps(&rep.width, n); - swaps(&rep.height, n); - swapl(&rep.mode, n); - swaps(&rep.rotation, n); - swaps(&rep.rotations, n); - swaps(&rep.nOutput, n); - swaps(&rep.nPossibleOutput, n); - } - WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - - return client->noClientException; -} - -int -ProcRRSetCrtcConfig (ClientPtr client) -{ - REQUEST(xRRSetCrtcConfigReq); - xRRSetCrtcConfigReply rep; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - RRCrtcPtr crtc; - RRModePtr mode; - int numOutputs; - RROutputPtr *outputs = NULL; - RROutput *outputIds; - TimeStamp configTime; - TimeStamp time; - Rotation rotation; - int i, j; - - REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); - numOutputs = (stuff->length - (SIZEOF (xRRSetCrtcConfigReq) >> 2)); - - crtc = LookupIDByType (stuff->crtc, RRCrtcType); - if (!crtc) - { - client->errorValue = stuff->crtc; - return RRErrorBase + BadRRCrtc; - } - if (stuff->mode == None) - { - mode = NULL; - if (numOutputs > 0) - return BadMatch; - } - else - { - mode = LookupIDByType (stuff->mode, RRModeType); - if (!mode) - { - client->errorValue = stuff->mode; - return RRErrorBase + BadRRMode; - } - if (numOutputs == 0) - return BadMatch; - } - if (numOutputs) - { - outputs = xalloc (numOutputs * sizeof (RROutputPtr)); - if (!outputs) - return BadAlloc; - } - else - outputs = NULL; - - outputIds = (RROutput *) (stuff + 1); - for (i = 0; i < numOutputs; i++) - { - outputs[i] = (RROutputPtr) LookupIDByType (outputIds[i], RROutputType); - if (!outputs[i]) - { - client->errorValue = outputIds[i]; - if (outputs) - xfree (outputs); - return RRErrorBase + BadRROutput; - } - /* validate crtc for this output */ - for (j = 0; j < outputs[i]->numCrtcs; j++) - if (outputs[i]->crtcs[j] == crtc) - break; - if (j == outputs[i]->numCrtcs) - { - if (outputs) - xfree (outputs); - return BadMatch; - } - /* validate mode for this output */ - for (j = 0; j < outputs[i]->numModes + outputs[i]->numUserModes; j++) - { - RRModePtr m = (j < outputs[i]->numModes ? - outputs[i]->modes[j] : - outputs[i]->userModes[j - outputs[i]->numModes]); - if (m == mode) - break; - } - if (j == outputs[i]->numModes + outputs[i]->numUserModes) - { - if (outputs) - xfree (outputs); - return BadMatch; - } - } - /* validate clones */ - for (i = 0; i < numOutputs; i++) - { - for (j = 0; j < numOutputs; j++) - { - int k; - if (i == j) - continue; - for (k = 0; k < outputs[i]->numClones; k++) - { - if (outputs[i]->clones[k] == outputs[j]) - break; - } - if (k == outputs[i]->numClones) - { - if (outputs) - xfree (outputs); - return BadMatch; - } - } - } - - pScreen = crtc->pScreen; - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - -#if 0 - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } -#endif - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - if (outputs) - xfree (outputs); - return BadValue; - } - - if (mode) - { - if ((~crtc->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - if (outputs) - xfree (outputs); - return BadMatch; - } - -#ifdef RANDR_12_INTERFACE - /* - * Check screen size bounds if the DDX provides a 1.2 interface - * for setting screen size. Else, assume the CrtcSet sets - * the size along with the mode - */ - if (pScrPriv->rrScreenSetSize) - { - int source_width = mode->mode.width; - int source_height = mode->mode.height; - - if ((rotation & 0xf) == RR_Rotate_90 || (rotation & 0xf) == RR_Rotate_270) - { - source_width = mode->mode.height; - source_height = mode->mode.width; - } - if (stuff->x + source_width > pScreen->width) - { - client->errorValue = stuff->x; - if (outputs) - xfree (outputs); - return BadValue; - } - - if (stuff->y + source_height > pScreen->height) - { - client->errorValue = stuff->y; - if (outputs) - xfree (outputs); - return BadValue; - } - } -#endif - } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - if (!RRCrtcSet (crtc, mode, stuff->x, stuff->y, - rotation, numOutputs, outputs)) - { - rep.status = RRSetConfigFailed; - goto sendReply; - } - #ifdef NXAGENT_SERVER /* Bug 21987 */ - pScrPriv->lastSetTime = time; - #endif - rep.status = RRSetConfigSuccess; - -sendReply: - if (outputs) - xfree (outputs); - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - #ifndef NXAGENT_SERVER /* Bug 21987 */ - rep.newTimestamp = pScrPriv->lastConfigTime.milliseconds; - #else - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - #endif - - if (client->swapped) - { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - } - WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep); - - return client->noClientException; -} - -int -ProcRRGetCrtcGammaSize (ClientPtr client) -{ - REQUEST(xRRGetCrtcGammaSizeReq); - xRRGetCrtcGammaSizeReply reply; - RRCrtcPtr crtc; - int n; - - REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); - crtc = LookupCrtc (client, stuff->crtc, DixReadAccess); - if (!crtc) - return RRErrorBase + BadRRCrtc; - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = 0; - reply.size = crtc->gammaSize; - if (client->swapped) { - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swaps (&reply.size, n); - } - WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply); - return client->noClientException; -} - -int -ProcRRGetCrtcGamma (ClientPtr client) -{ - REQUEST(xRRGetCrtcGammaReq); - xRRGetCrtcGammaReply reply; - RRCrtcPtr crtc; - int n; - unsigned long len; - char *extra; - - REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); - crtc = LookupCrtc (client, stuff->crtc, DixReadAccess); - if (!crtc) - return RRErrorBase + BadRRCrtc; - - len = crtc->gammaSize * 3 * 2; - - if (crtc->gammaSize) { - extra = xalloc(len); - if (!extra) - return BadAlloc; - } - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = (len + 3) >> 2; - reply.size = crtc->gammaSize; - if (client->swapped) { - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swaps (&reply.size, n); - } - WriteToClient (client, sizeof (xRRGetCrtcGammaReply), (char *) &reply); - if (crtc->gammaSize) - { - memcpy(extra, crtc->gammaRed, len); - client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; - WriteSwappedDataToClient (client, len, extra); - xfree(extra); - } - return client->noClientException; -} - -int -ProcRRSetCrtcGamma (ClientPtr client) -{ - REQUEST(xRRSetCrtcGammaReq); - RRCrtcPtr crtc; - unsigned long len; - CARD16 *red, *green, *blue; - - REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq); - crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess); - if (!crtc) - return RRErrorBase + BadRRCrtc; - - len = client->req_len - (sizeof (xRRSetCrtcGammaReq) >> 2); - if (len < (stuff->size * 3 + 1) >> 1) - return BadLength; - - if (stuff->size != crtc->gammaSize) - return BadMatch; - - red = (CARD16 *) (stuff + 1); - green = red + crtc->gammaSize; - blue = green + crtc->gammaSize; - - RRCrtcGammaSet (crtc, red, green, blue); - - return Success; -} - diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c.X.original b/nx-X11/programs/Xserver/randr/rrcrtc.c.X.original deleted file mode 100644 index ec65a040e..000000000 --- a/nx-X11/programs/Xserver/randr/rrcrtc.c.X.original +++ /dev/null @@ -1,960 +0,0 @@ -/* - * Copyright © 2006 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "randrstr.h" -#include "swaprep.h" -#include "registry.h" - -RESTYPE RRCrtcType; - -/* - * Notify the CRTC of some change - */ -void -RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged) -{ - ScreenPtr pScreen = crtc->pScreen; - - crtc->changed = TRUE; - if (pScreen) - { - rrScrPriv(pScreen); - - pScrPriv->changed = TRUE; - /* - * Send ConfigureNotify on any layout change - */ - if (layoutChanged) - pScrPriv->layoutChanged = TRUE; - } -} - -/* - * Create a CRTC - */ -RRCrtcPtr -RRCrtcCreate (ScreenPtr pScreen, void *devPrivate) -{ - RRCrtcPtr crtc; - RRCrtcPtr *crtcs; - rrScrPrivPtr pScrPriv; - - if (!RRInit()) - return NULL; - - pScrPriv = rrGetScrPriv(pScreen); - - /* make space for the crtc pointer */ - if (pScrPriv->numCrtcs) - crtcs = xrealloc (pScrPriv->crtcs, - (pScrPriv->numCrtcs + 1) * sizeof (RRCrtcPtr)); - else - crtcs = xalloc (sizeof (RRCrtcPtr)); - if (!crtcs) - return FALSE; - pScrPriv->crtcs = crtcs; - - crtc = xcalloc (1, sizeof (RRCrtcRec)); - if (!crtc) - return NULL; - crtc->id = FakeClientID (0); - crtc->pScreen = pScreen; - crtc->mode = NULL; - crtc->x = 0; - crtc->y = 0; - crtc->rotation = RR_Rotate_0; - crtc->rotations = RR_Rotate_0; - crtc->outputs = NULL; - crtc->numOutputs = 0; - crtc->gammaSize = 0; - crtc->gammaRed = crtc->gammaBlue = crtc->gammaGreen = NULL; - crtc->changed = FALSE; - crtc->devPrivate = devPrivate; - - if (!AddResource (crtc->id, RRCrtcType, (pointer) crtc)) - return NULL; - - /* attach the screen and crtc together */ - crtc->pScreen = pScreen; - pScrPriv->crtcs[pScrPriv->numCrtcs++] = crtc; - - return crtc; -} - -/* - * Set the allowed rotations on a CRTC - */ -void -RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations) -{ - crtc->rotations = rotations; -} - -/* - * Notify the extension that the Crtc has been reconfigured, - * the driver calls this whenever it has updated the mode - */ -Bool -RRCrtcNotify (RRCrtcPtr crtc, - RRModePtr mode, - int x, - int y, - Rotation rotation, - int numOutputs, - RROutputPtr *outputs) -{ - int i, j; - - /* - * Check to see if any of the new outputs were - * not in the old list and mark them as changed - */ - for (i = 0; i < numOutputs; i++) - { - for (j = 0; j < crtc->numOutputs; j++) - if (outputs[i] == crtc->outputs[j]) - break; - if (j == crtc->numOutputs) - { - outputs[i]->crtc = crtc; - RROutputChanged (outputs[i], FALSE); - RRCrtcChanged (crtc, FALSE); - } - } - /* - * Check to see if any of the old outputs are - * not in the new list and mark them as changed - */ - for (j = 0; j < crtc->numOutputs; j++) - { - for (i = 0; i < numOutputs; i++) - if (outputs[i] == crtc->outputs[j]) - break; - if (i == numOutputs) - { - if (crtc->outputs[j]->crtc == crtc) - crtc->outputs[j]->crtc = NULL; - RROutputChanged (crtc->outputs[j], FALSE); - RRCrtcChanged (crtc, FALSE); - } - } - /* - * Reallocate the crtc output array if necessary - */ - if (numOutputs != crtc->numOutputs) - { - RROutputPtr *newoutputs; - - if (numOutputs) - { - if (crtc->numOutputs) - newoutputs = xrealloc (crtc->outputs, - numOutputs * sizeof (RROutputPtr)); - else - newoutputs = xalloc (numOutputs * sizeof (RROutputPtr)); - if (!newoutputs) - return FALSE; - } - else - { - if (crtc->outputs) - xfree (crtc->outputs); - newoutputs = NULL; - } - crtc->outputs = newoutputs; - crtc->numOutputs = numOutputs; - } - /* - * Copy the new list of outputs into the crtc - */ - memcpy (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr)); - /* - * Update remaining crtc fields - */ - if (mode != crtc->mode) - { - if (crtc->mode) - RRModeDestroy (crtc->mode); - crtc->mode = mode; - if (mode != NULL) - mode->refcnt++; - RRCrtcChanged (crtc, TRUE); - } - if (x != crtc->x) - { - crtc->x = x; - RRCrtcChanged (crtc, TRUE); - } - if (y != crtc->y) - { - crtc->y = y; - RRCrtcChanged (crtc, TRUE); - } - if (rotation != crtc->rotation) - { - crtc->rotation = rotation; - RRCrtcChanged (crtc, TRUE); - } - return TRUE; -} - -void -RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - xRRCrtcChangeNotifyEvent ce; - RRModePtr mode = crtc->mode; - - ce.type = RRNotify + RREventBase; - ce.subCode = RRNotify_CrtcChange; - ce.sequenceNumber = client->sequence; - ce.timestamp = pScrPriv->lastSetTime.milliseconds; - ce.window = pWin->drawable.id; - ce.crtc = crtc->id; - ce.rotation = crtc->rotation; - if (mode) - { - ce.mode = mode->mode.id; - ce.x = crtc->x; - ce.y = crtc->y; - ce.width = mode->mode.width; - ce.height = mode->mode.height; - } - else - { - ce.mode = None; - ce.x = 0; - ce.y = 0; - ce.width = 0; - ce.height = 0; - } - WriteEventsToClient (client, 1, (xEvent *) &ce); -} - -static Bool -RRCrtcPendingProperties (RRCrtcPtr crtc) -{ - ScreenPtr pScreen = crtc->pScreen; - rrScrPriv(pScreen); - int o; - - for (o = 0; o < pScrPriv->numOutputs; o++) - { - RROutputPtr output = pScrPriv->outputs[o]; - if (output->crtc == crtc && output->pendingProperties) - return TRUE; - } - return FALSE; -} - -/* - * Request that the Crtc be reconfigured - */ -Bool -RRCrtcSet (RRCrtcPtr crtc, - RRModePtr mode, - int x, - int y, - Rotation rotation, - int numOutputs, - RROutputPtr *outputs) -{ - ScreenPtr pScreen = crtc->pScreen; - Bool ret = FALSE; - rrScrPriv(pScreen); - - /* See if nothing changed */ - if (crtc->mode == mode && - crtc->x == x && - crtc->y == y && - crtc->rotation == rotation && - crtc->numOutputs == numOutputs && - !memcmp (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr)) && - !RRCrtcPendingProperties (crtc)) - { - ret = TRUE; - } - else - { -#if RANDR_12_INTERFACE - if (pScrPriv->rrCrtcSet) - { - ret = (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y, - rotation, numOutputs, outputs); - } - else -#endif - { -#if RANDR_10_INTERFACE - if (pScrPriv->rrSetConfig) - { - RRScreenSize size; - RRScreenRate rate; - - if (!mode) - { - RRCrtcNotify (crtc, NULL, x, y, rotation, 0, NULL); - ret = TRUE; - } - else - { - size.width = mode->mode.width; - size.height = mode->mode.height; - if (outputs[0]->mmWidth && outputs[0]->mmHeight) - { - size.mmWidth = outputs[0]->mmWidth; - size.mmHeight = outputs[0]->mmHeight; - } - else - { - size.mmWidth = pScreen->mmWidth; - size.mmHeight = pScreen->mmHeight; - } - size.nRates = 1; - rate.rate = RRVerticalRefresh (&mode->mode); - size.pRates = &rate; - ret = (*pScrPriv->rrSetConfig) (pScreen, rotation, rate.rate, &size); - /* - * Old 1.0 interface tied screen size to mode size - */ - if (ret) - { - RRCrtcNotify (crtc, mode, x, y, rotation, 1, outputs); - RRScreenSizeNotify (pScreen); - } - } - } -#endif - } - if (ret) - { - int o; - RRTellChanged (pScreen); - - for (o = 0; o < numOutputs; o++) - RRPostPendingProperties (outputs[o]); - } - } - return ret; -} - -/* - * Destroy a Crtc at shutdown - */ -void -RRCrtcDestroy (RRCrtcPtr crtc) -{ - FreeResource (crtc->id, 0); -} - -static int -RRCrtcDestroyResource (pointer value, XID pid) -{ - RRCrtcPtr crtc = (RRCrtcPtr) value; - ScreenPtr pScreen = crtc->pScreen; - - if (pScreen) - { - rrScrPriv(pScreen); - int i; - - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - if (pScrPriv->crtcs[i] == crtc) - { - memmove (pScrPriv->crtcs + i, pScrPriv->crtcs + i + 1, - (pScrPriv->numCrtcs - (i + 1)) * sizeof (RRCrtcPtr)); - --pScrPriv->numCrtcs; - break; - } - } - } - if (crtc->gammaRed) - xfree (crtc->gammaRed); - if (crtc->mode) - RRModeDestroy (crtc->mode); - xfree (crtc); - return 1; -} - -/* - * Request that the Crtc gamma be changed - */ - -Bool -RRCrtcGammaSet (RRCrtcPtr crtc, - CARD16 *red, - CARD16 *green, - CARD16 *blue) -{ - Bool ret = TRUE; -#if RANDR_12_INTERFACE - ScreenPtr pScreen = crtc->pScreen; -#endif - - memcpy (crtc->gammaRed, red, crtc->gammaSize * sizeof (CARD16)); - memcpy (crtc->gammaGreen, green, crtc->gammaSize * sizeof (CARD16)); - memcpy (crtc->gammaBlue, blue, crtc->gammaSize * sizeof (CARD16)); -#if RANDR_12_INTERFACE - if (pScreen) - { - rrScrPriv(pScreen); - if (pScrPriv->rrCrtcSetGamma) - ret = (*pScrPriv->rrCrtcSetGamma) (pScreen, crtc); - } -#endif - return ret; -} - -/* - * Notify the extension that the Crtc gamma has been changed - * The driver calls this whenever it has changed the gamma values - * in the RRCrtcRec - */ - -Bool -RRCrtcGammaNotify (RRCrtcPtr crtc) -{ - return TRUE; /* not much going on here */ -} - -/** - * Returns the width/height that the crtc scans out from the framebuffer - */ -void -RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height) -{ - if (crtc->mode == NULL) { - *width = 0; - *height = 0; - return; - } - - switch (crtc->rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_180: - *width = crtc->mode->mode.width; - *height = crtc->mode->mode.height; - break; - case RR_Rotate_90: - case RR_Rotate_270: - *width = crtc->mode->mode.height; - *height = crtc->mode->mode.width; - break; - } -} - -/* - * Set the size of the gamma table at server startup time - */ - -Bool -RRCrtcGammaSetSize (RRCrtcPtr crtc, - int size) -{ - CARD16 *gamma; - - if (size == crtc->gammaSize) - return TRUE; - if (size) - { - gamma = xalloc (size * 3 * sizeof (CARD16)); - if (!gamma) - return FALSE; - } - else - gamma = NULL; - if (crtc->gammaRed) - xfree (crtc->gammaRed); - crtc->gammaRed = gamma; - crtc->gammaGreen = gamma + size; - crtc->gammaBlue = gamma + size*2; - crtc->gammaSize = size; - return TRUE; -} - -/* - * Initialize crtc type - */ -Bool -RRCrtcInit (void) -{ - RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource); - if (!RRCrtcType) - return FALSE; - RegisterResourceName (RRCrtcType, "CRTC"); - return TRUE; -} - -int -ProcRRGetCrtcInfo (ClientPtr client) -{ - REQUEST(xRRGetCrtcInfoReq); - xRRGetCrtcInfoReply rep; - RRCrtcPtr crtc; - CARD8 *extra; - unsigned long extraLen; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - RRModePtr mode; - RROutput *outputs; - RROutput *possible; - int i, j, k, n; - int width, height; - - REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); - crtc = LookupCrtc(client, stuff->crtc, DixReadAccess); - - if (!crtc) - return RRErrorBase + BadRRCrtc; - - /* All crtcs must be associated with screens before client - * requests are processed - */ - pScreen = crtc->pScreen; - pScrPriv = rrGetScrPriv(pScreen); - - mode = crtc->mode; - - rep.type = X_Reply; - rep.status = RRSetConfigSuccess; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.x = crtc->x; - rep.y = crtc->y; - RRCrtcGetScanoutSize (crtc, &width, &height); - rep.width = width; - rep.height = height; - rep.mode = mode ? mode->mode.id : 0; - rep.rotation = crtc->rotation; - rep.rotations = crtc->rotations; - rep.nOutput = crtc->numOutputs; - k = 0; - for (i = 0; i < pScrPriv->numOutputs; i++) - for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) - if (pScrPriv->outputs[i]->crtcs[j] == crtc) - k++; - rep.nPossibleOutput = k; - - rep.length = rep.nOutput + rep.nPossibleOutput; - - extraLen = rep.length << 2; - if (extraLen) - { - extra = xalloc (extraLen); - if (!extra) - return BadAlloc; - } - else - extra = NULL; - - outputs = (RROutput *) extra; - possible = (RROutput *) (outputs + rep.nOutput); - - for (i = 0; i < crtc->numOutputs; i++) - { - outputs[i] = crtc->outputs[i]->id; - if (client->swapped) - swapl (&outputs[i], n); - } - k = 0; - for (i = 0; i < pScrPriv->numOutputs; i++) - for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) - if (pScrPriv->outputs[i]->crtcs[j] == crtc) - { - possible[k] = pScrPriv->outputs[i]->id; - if (client->swapped) - swapl (&possible[k], n); - k++; - } - - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.x, n); - swaps(&rep.y, n); - swaps(&rep.width, n); - swaps(&rep.height, n); - swapl(&rep.mode, n); - swaps(&rep.rotation, n); - swaps(&rep.rotations, n); - swaps(&rep.nOutput, n); - swaps(&rep.nPossibleOutput, n); - } - WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - - return client->noClientException; -} - -int -ProcRRSetCrtcConfig (ClientPtr client) -{ - REQUEST(xRRSetCrtcConfigReq); - xRRSetCrtcConfigReply rep; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - RRCrtcPtr crtc; - RRModePtr mode; - int numOutputs; - RROutputPtr *outputs = NULL; - RROutput *outputIds; - TimeStamp configTime; - TimeStamp time; - Rotation rotation; - int i, j; - - REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); - numOutputs = (stuff->length - (SIZEOF (xRRSetCrtcConfigReq) >> 2)); - - crtc = LookupIDByType (stuff->crtc, RRCrtcType); - if (!crtc) - { - client->errorValue = stuff->crtc; - return RRErrorBase + BadRRCrtc; - } - if (stuff->mode == None) - { - mode = NULL; - if (numOutputs > 0) - return BadMatch; - } - else - { - mode = LookupIDByType (stuff->mode, RRModeType); - if (!mode) - { - client->errorValue = stuff->mode; - return RRErrorBase + BadRRMode; - } - if (numOutputs == 0) - return BadMatch; - } - if (numOutputs) - { - outputs = xalloc (numOutputs * sizeof (RROutputPtr)); - if (!outputs) - return BadAlloc; - } - else - outputs = NULL; - - outputIds = (RROutput *) (stuff + 1); - for (i = 0; i < numOutputs; i++) - { - outputs[i] = (RROutputPtr) LookupIDByType (outputIds[i], RROutputType); - if (!outputs[i]) - { - client->errorValue = outputIds[i]; - if (outputs) - xfree (outputs); - return RRErrorBase + BadRROutput; - } - /* validate crtc for this output */ - for (j = 0; j < outputs[i]->numCrtcs; j++) - if (outputs[i]->crtcs[j] == crtc) - break; - if (j == outputs[i]->numCrtcs) - { - if (outputs) - xfree (outputs); - return BadMatch; - } - /* validate mode for this output */ - for (j = 0; j < outputs[i]->numModes + outputs[i]->numUserModes; j++) - { - RRModePtr m = (j < outputs[i]->numModes ? - outputs[i]->modes[j] : - outputs[i]->userModes[j - outputs[i]->numModes]); - if (m == mode) - break; - } - if (j == outputs[i]->numModes + outputs[i]->numUserModes) - { - if (outputs) - xfree (outputs); - return BadMatch; - } - } - /* validate clones */ - for (i = 0; i < numOutputs; i++) - { - for (j = 0; j < numOutputs; j++) - { - int k; - if (i == j) - continue; - for (k = 0; k < outputs[i]->numClones; k++) - { - if (outputs[i]->clones[k] == outputs[j]) - break; - } - if (k == outputs[i]->numClones) - { - if (outputs) - xfree (outputs); - return BadMatch; - } - } - } - - pScreen = crtc->pScreen; - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - -#if 0 - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } -#endif - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - if (outputs) - xfree (outputs); - return BadValue; - } - - if (mode) - { - if ((~crtc->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - if (outputs) - xfree (outputs); - return BadMatch; - } - -#ifdef RANDR_12_INTERFACE - /* - * Check screen size bounds if the DDX provides a 1.2 interface - * for setting screen size. Else, assume the CrtcSet sets - * the size along with the mode - */ - if (pScrPriv->rrScreenSetSize) - { - int source_width = mode->mode.width; - int source_height = mode->mode.height; - - if ((rotation & 0xf) == RR_Rotate_90 || (rotation & 0xf) == RR_Rotate_270) - { - source_width = mode->mode.height; - source_height = mode->mode.width; - } - if (stuff->x + source_width > pScreen->width) - { - client->errorValue = stuff->x; - if (outputs) - xfree (outputs); - return BadValue; - } - - if (stuff->y + source_height > pScreen->height) - { - client->errorValue = stuff->y; - if (outputs) - xfree (outputs); - return BadValue; - } - } -#endif - } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - if (!RRCrtcSet (crtc, mode, stuff->x, stuff->y, - rotation, numOutputs, outputs)) - { - rep.status = RRSetConfigFailed; - goto sendReply; - } - rep.status = RRSetConfigSuccess; - -sendReply: - if (outputs) - xfree (outputs); - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.newTimestamp = pScrPriv->lastConfigTime.milliseconds; - - if (client->swapped) - { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - } - WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep); - - return client->noClientException; -} - -int -ProcRRGetCrtcGammaSize (ClientPtr client) -{ - REQUEST(xRRGetCrtcGammaSizeReq); - xRRGetCrtcGammaSizeReply reply; - RRCrtcPtr crtc; - int n; - - REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); - crtc = LookupCrtc (client, stuff->crtc, DixReadAccess); - if (!crtc) - return RRErrorBase + BadRRCrtc; - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = 0; - reply.size = crtc->gammaSize; - if (client->swapped) { - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swaps (&reply.size, n); - } - WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply); - return client->noClientException; -} - -int -ProcRRGetCrtcGamma (ClientPtr client) -{ - REQUEST(xRRGetCrtcGammaReq); - xRRGetCrtcGammaReply reply; - RRCrtcPtr crtc; - int n; - unsigned long len; - char *extra; - - REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); - crtc = LookupCrtc (client, stuff->crtc, DixReadAccess); - if (!crtc) - return RRErrorBase + BadRRCrtc; - - len = crtc->gammaSize * 3 * 2; - - if (crtc->gammaSize) { - extra = xalloc(len); - if (!extra) - return BadAlloc; - } - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = (len + 3) >> 2; - reply.size = crtc->gammaSize; - if (client->swapped) { - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swaps (&reply.size, n); - } - WriteToClient (client, sizeof (xRRGetCrtcGammaReply), (char *) &reply); - if (crtc->gammaSize) - { - memcpy(extra, crtc->gammaRed, len); - client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; - WriteSwappedDataToClient (client, len, extra); - xfree(extra); - } - return client->noClientException; -} - -int -ProcRRSetCrtcGamma (ClientPtr client) -{ - REQUEST(xRRSetCrtcGammaReq); - RRCrtcPtr crtc; - unsigned long len; - CARD16 *red, *green, *blue; - - REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq); - crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess); - if (!crtc) - return RRErrorBase + BadRRCrtc; - - len = client->req_len - (sizeof (xRRSetCrtcGammaReq) >> 2); - if (len < (stuff->size * 3 + 1) >> 1) - return BadLength; - - if (stuff->size != crtc->gammaSize) - return BadMatch; - - red = (CARD16 *) (stuff + 1); - green = red + crtc->gammaSize; - blue = green + crtc->gammaSize; - - RRCrtcGammaSet (crtc, red, green, blue); - - return Success; -} - diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c.X.original b/nx-X11/programs/Xserver/randr/rrdispatch.c.X.original deleted file mode 100644 index 5525427f6..000000000 --- a/nx-X11/programs/Xserver/randr/rrdispatch.c.X.original +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright © 2006 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "randrstr.h" - -#define SERVER_RANDR_MAJOR 1 -#define SERVER_RANDR_MINOR 2 - -Bool -RRClientKnowsRates (ClientPtr pClient) -{ - rrClientPriv(pClient); - - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); -} - -static int -ProcRRQueryVersion (ClientPtr client) -{ - xRRQueryVersionReply rep; - register int n; - REQUEST(xRRQueryVersionReq); - rrClientPriv(client); - - REQUEST_SIZE_MATCH(xRRQueryVersionReq); - pRRClient->major_version = stuff->majorVersion; - pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - /* - * Report the current version; the current - * spec says they're all compatible after 1.0 - */ - rep.majorVersion = SERVER_RANDR_MAJOR; - rep.minorVersion = SERVER_RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcRRSelectInput (ClientPtr client) -{ - REQUEST(xRRSelectInputReq); - rrClientPriv(client); - RRTimesPtr pTimes; - WindowPtr pWin; - RREventPtr pRREvent, *pHead; - XID clientResource; - int rc; - - REQUEST_SIZE_MATCH(xRRSelectInputReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess); - if (rc != Success) - return rc; - pHead = (RREventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, RREventType, - DixWriteAccess); - - if (stuff->enable & (RRScreenChangeNotifyMask| - RRCrtcChangeNotifyMask| - RROutputChangeNotifyMask)) - { - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - - pRREvent = NULL; - if (pHead) - { - /* check for existing entry. */ - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - if (pRREvent->client == client) - break; - } - - if (!pRREvent) - { - /* build the entry */ - pRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); - if (!pRREvent) - return BadAlloc; - pRREvent->next = 0; - pRREvent->client = client; - pRREvent->window = pWin; - pRREvent->mask = stuff->enable; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pRREvent->clientResource = clientResource; - if (!AddResource (clientResource, RRClientType, (pointer)pRREvent)) - return BadAlloc; - /* - * create a resource to contain a pointer to the list - * of clients selecting input. This must be indirect as - * the list may be arbitrarily rearranged which cannot be - * done through the resource database. - */ - if (!pHead) - { - pHead = (RREventPtr *) xalloc (sizeof (RREventPtr)); - if (!pHead || - !AddResource (pWin->drawable.id, RREventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pRREvent->next = *pHead; - *pHead = pRREvent; - } - /* - * Now see if the client needs an event - */ - if (pScrPriv && (pRREvent->mask & RRScreenChangeNotifyMask)) - { - pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; - if (CompareTimeStamps (pTimes->setTime, - pScrPriv->lastSetTime) != 0 || - CompareTimeStamps (pTimes->configTime, - pScrPriv->lastConfigTime) != 0) - { - RRDeliverScreenEvent (client, pWin, pScreen); - } - } - } - else if (stuff->enable == 0) - { - /* delete the interest */ - if (pHead) { - RREventPtr pNewRREvent = 0; - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { - if (pRREvent->client == client) - break; - pNewRREvent = pRREvent; - } - if (pRREvent) { - FreeResource (pRREvent->clientResource, RRClientType); - if (pNewRREvent) - pNewRREvent->next = pRREvent->next; - else - *pHead = pRREvent->next; - xfree (pRREvent); - } - } - } - else - { - client->errorValue = stuff->enable; - return BadValue; - } - return Success; -} - -int (*ProcRandrVector[RRNumberRequests])(ClientPtr) = { - ProcRRQueryVersion, /* 0 */ -/* we skip 1 to make old clients fail pretty immediately */ - NULL, /* 1 ProcRandrOldGetScreenInfo */ -/* V1.0 apps share the same set screen config request id */ - ProcRRSetScreenConfig, /* 2 */ - NULL, /* 3 ProcRandrOldScreenChangeSelectInput */ -/* 3 used to be ScreenChangeSelectInput; deprecated */ - ProcRRSelectInput, /* 4 */ - ProcRRGetScreenInfo, /* 5 */ -/* V1.2 additions */ - ProcRRGetScreenSizeRange, /* 6 */ - ProcRRSetScreenSize, /* 7 */ - ProcRRGetScreenResources, /* 8 */ - ProcRRGetOutputInfo, /* 9 */ - ProcRRListOutputProperties, /* 10 */ - ProcRRQueryOutputProperty, /* 11 */ - ProcRRConfigureOutputProperty, /* 12 */ - ProcRRChangeOutputProperty, /* 13 */ - ProcRRDeleteOutputProperty, /* 14 */ - ProcRRGetOutputProperty, /* 15 */ - ProcRRCreateMode, /* 16 */ - ProcRRDestroyMode, /* 17 */ - ProcRRAddOutputMode, /* 18 */ - ProcRRDeleteOutputMode, /* 19 */ - ProcRRGetCrtcInfo, /* 20 */ - ProcRRSetCrtcConfig, /* 21 */ - ProcRRGetCrtcGammaSize, /* 22 */ - ProcRRGetCrtcGamma, /* 23 */ - ProcRRSetCrtcGamma, /* 24 */ -}; - diff --git a/nx-X11/programs/Xserver/randr/rrmode.c.NX.original b/nx-X11/programs/Xserver/randr/rrmode.c.NX.original deleted file mode 100644 index 62c01485a..000000000 --- a/nx-X11/programs/Xserver/randr/rrmode.c.NX.original +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright © 2006 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#include "randrstr.h" -#include "registry.h" - -RESTYPE RRModeType; - -static Bool -RRModeEqual (xRRModeInfo *a, xRRModeInfo *b) -{ - if (a->width != b->width) return FALSE; - if (a->height != b->height) return FALSE; - if (a->dotClock != b->dotClock) return FALSE; - if (a->hSyncStart != b->hSyncStart) return FALSE; - if (a->hSyncEnd != b->hSyncEnd) return FALSE; - if (a->hTotal != b->hTotal) return FALSE; - if (a->hSkew != b->hSkew) return FALSE; - if (a->vSyncStart != b->vSyncStart) return FALSE; - if (a->vSyncEnd != b->vSyncEnd) return FALSE; - if (a->vTotal != b->vTotal) return FALSE; - if (a->nameLength != b->nameLength) return FALSE; - if (a->modeFlags != b->modeFlags) return FALSE; - return TRUE; -} - -/* - * Keep a list so it's easy to find modes in the resource database. - */ -static int num_modes; -static RRModePtr *modes; - -static RRModePtr -RRModeCreate (xRRModeInfo *modeInfo, - const char *name, - ScreenPtr userScreen) -{ - RRModePtr mode, *newModes; - - if (!RRInit ()) - return NULL; - - mode = xalloc (sizeof (RRModeRec) + modeInfo->nameLength + 1); - if (!mode) - return NULL; - mode->refcnt = 1; - mode->mode = *modeInfo; - mode->name = (char *) (mode + 1); - memcpy (mode->name, name, modeInfo->nameLength); - mode->name[modeInfo->nameLength] = '\0'; - mode->userScreen = userScreen; - - if (num_modes) - newModes = xrealloc (modes, (num_modes + 1) * sizeof (RRModePtr)); - else - newModes = xalloc (sizeof (RRModePtr)); - - if (!newModes) - { - xfree (mode); - return NULL; - } - - mode->mode.id = FakeClientID(0); - if (!AddResource (mode->mode.id, RRModeType, (pointer) mode)) - return NULL; - modes = newModes; - modes[num_modes++] = mode; - - /* - * give the caller a reference to this mode - */ - ++mode->refcnt; - return mode; -} - -static RRModePtr -RRModeFindByName (const char *name, - CARD16 nameLength) -{ - int i; - RRModePtr mode; - - for (i = 0; i < num_modes; i++) - { - mode = modes[i]; - if (mode->mode.nameLength == nameLength && - !memcmp (name, mode->name, nameLength)) - { - return mode; - } - } - return NULL; -} - -RRModePtr -RRModeGet (xRRModeInfo *modeInfo, - const char *name) -{ - int i; - - for (i = 0; i < num_modes; i++) - { - RRModePtr mode = modes[i]; - if (RRModeEqual (&mode->mode, modeInfo) && - !memcmp (name, mode->name, modeInfo->nameLength)) - { - ++mode->refcnt; - return mode; - } - } - - return RRModeCreate (modeInfo, name, NULL); -} - -static RRModePtr -RRModeCreateUser (ScreenPtr pScreen, - xRRModeInfo *modeInfo, - const char *name, - int *error) -{ - RRModePtr mode; - - mode = RRModeFindByName (name, modeInfo->nameLength); - if (mode) - { - *error = BadName; - return NULL; - } - - mode = RRModeCreate (modeInfo, name, pScreen); - if (!mode) - { - *error = BadAlloc; - return NULL; - } - *error = Success; - return mode; -} - -RRModePtr * -RRModesForScreen (ScreenPtr pScreen, int *num_ret) -{ - rrScrPriv(pScreen); - int o, c, m; - RRModePtr *screen_modes; - int num_screen_modes = 0; - - screen_modes = xalloc ((num_modes ? num_modes : 1) * sizeof (RRModePtr)); - if (!screen_modes) - return NULL; - - /* - * Add modes from all outputs - */ - for (o = 0; o < pScrPriv->numOutputs; o++) - { - RROutputPtr output = pScrPriv->outputs[o]; - int m, n; - - for (m = 0; m < output->numModes + output->numUserModes; m++) - { - RRModePtr mode = (m < output->numModes ? - output->modes[m] : - output->userModes[m-output->numModes]); - for (n = 0; n < num_screen_modes; n++) - if (screen_modes[n] == mode) - break; - if (n == num_screen_modes) - screen_modes[num_screen_modes++] = mode; - } - } - /* - * Add modes from all crtcs. The goal is to - * make sure all available and active modes - * are visible to the client - */ - for (c = 0; c < pScrPriv->numCrtcs; c++) - { - RRCrtcPtr crtc = pScrPriv->crtcs[c]; - RRModePtr mode = crtc->mode; - int n; - - if (!mode) continue; - for (n = 0; n < num_screen_modes; n++) - if (screen_modes[n] == mode) - break; - if (n == num_screen_modes) - screen_modes[num_screen_modes++] = mode; - } - /* - * Add all user modes for this screen - */ - for (m = 0; m < num_modes; m++) - { - RRModePtr mode = modes[m]; - int n; - - if (mode->userScreen != pScreen) - continue; - for (n = 0; n < num_screen_modes; n++) - if (screen_modes[n] == mode) - break; - if (n == num_screen_modes) - screen_modes[num_screen_modes++] = mode; - } - - *num_ret = num_screen_modes; - return screen_modes; -} - -void -RRModeDestroy (RRModePtr mode) -{ - int m; - - if (--mode->refcnt > 0) - return; - for (m = 0; m < num_modes; m++) - { - if (modes[m] == mode) - { - memmove (modes + m, modes + m + 1, - (num_modes - m - 1) * sizeof (RRModePtr)); - num_modes--; - if (!num_modes) - { - xfree (modes); - modes = NULL; - } - break; - } - } - - xfree (mode); -} - -static int -RRModeDestroyResource (pointer value, XID pid) -{ - RRModeDestroy ((RRModePtr) value); - return 1; -} - -Bool -RRModeInit (void) -{ - assert (num_modes == 0); - assert (modes == NULL); - RRModeType = CreateNewResourceType (RRModeDestroyResource); - if (!RRModeType) - return FALSE; - RegisterResourceName (RRModeType, "MODE"); - return TRUE; -} - -int -ProcRRCreateMode (ClientPtr client) -{ - REQUEST(xRRCreateModeReq); - xRRCreateModeReply rep; - WindowPtr pWin; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - xRRModeInfo *modeInfo; - long units_after; - char *name; - int error, rc; - RRModePtr mode; - - REQUEST_AT_LEAST_SIZE (xRRCreateModeReq); - #ifndef NXAGENT_SERVER - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); - rc = pWin ? Success : BadWindow; - #endif - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - - modeInfo = &stuff->modeInfo; - name = (char *) (stuff + 1); - units_after = (stuff->length - (sizeof (xRRCreateModeReq) >> 2)); - - /* check to make sure requested name fits within the data provided */ - if ((int) (modeInfo->nameLength + 3) >> 2 > units_after) - return BadLength; - - mode = RRModeCreateUser (pScreen, modeInfo, name, &error); - if (!mode) - return error; - - rep.type = X_Reply; - rep.pad0 = 0; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.mode = mode->mode.id; - if (client->swapped) - { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.mode, n); - } - WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep); - - return client->noClientException; -} - -int -ProcRRDestroyMode (ClientPtr client) -{ - REQUEST(xRRDestroyModeReq); - RRModePtr mode; - - REQUEST_SIZE_MATCH(xRRDestroyModeReq); - mode = LookupIDByType (stuff->mode, RRModeType); - if (!mode) - { - client->errorValue = stuff->mode; - return RRErrorBase + BadRRMode; - } - if (!mode->userScreen) - return BadMatch; - if (mode->refcnt > 1) - return BadAccess; - FreeResource (stuff->mode, 0); - return Success; -} - -int -ProcRRAddOutputMode (ClientPtr client) -{ - REQUEST(xRRAddOutputModeReq); - RRModePtr mode; - RROutputPtr output; - - REQUEST_SIZE_MATCH(xRRAddOutputModeReq); - output = LookupOutput(client, stuff->output, DixReadAccess); - - if (!output) - { - client->errorValue = stuff->output; - return RRErrorBase + BadRROutput; - } - - mode = LookupIDByType (stuff->mode, RRModeType); - if (!mode) - { - client->errorValue = stuff->mode; - return RRErrorBase + BadRRMode; - } - - return RROutputAddUserMode (output, mode); -} - -int -ProcRRDeleteOutputMode (ClientPtr client) -{ - REQUEST(xRRDeleteOutputModeReq); - RRModePtr mode; - RROutputPtr output; - - REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq); - output = LookupOutput(client, stuff->output, DixReadAccess); - - if (!output) - { - client->errorValue = stuff->output; - return RRErrorBase + BadRROutput; - } - - mode = LookupIDByType (stuff->mode, RRModeType); - if (!mode) - { - client->errorValue = stuff->mode; - return RRErrorBase + BadRRMode; - } - - return RROutputDeleteUserMode (output, mode); -} diff --git a/nx-X11/programs/Xserver/randr/rrmode.c.X.original b/nx-X11/programs/Xserver/randr/rrmode.c.X.original deleted file mode 100644 index d5072084a..000000000 --- a/nx-X11/programs/Xserver/randr/rrmode.c.X.original +++ /dev/null @@ -1,398 +0,0 @@ -/* - * Copyright © 2006 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "randrstr.h" -#include "registry.h" - -RESTYPE RRModeType; - -static Bool -RRModeEqual (xRRModeInfo *a, xRRModeInfo *b) -{ - if (a->width != b->width) return FALSE; - if (a->height != b->height) return FALSE; - if (a->dotClock != b->dotClock) return FALSE; - if (a->hSyncStart != b->hSyncStart) return FALSE; - if (a->hSyncEnd != b->hSyncEnd) return FALSE; - if (a->hTotal != b->hTotal) return FALSE; - if (a->hSkew != b->hSkew) return FALSE; - if (a->vSyncStart != b->vSyncStart) return FALSE; - if (a->vSyncEnd != b->vSyncEnd) return FALSE; - if (a->vTotal != b->vTotal) return FALSE; - if (a->nameLength != b->nameLength) return FALSE; - if (a->modeFlags != b->modeFlags) return FALSE; - return TRUE; -} - -/* - * Keep a list so it's easy to find modes in the resource database. - */ -static int num_modes; -static RRModePtr *modes; - -static RRModePtr -RRModeCreate (xRRModeInfo *modeInfo, - const char *name, - ScreenPtr userScreen) -{ - RRModePtr mode, *newModes; - - if (!RRInit ()) - return NULL; - - mode = xalloc (sizeof (RRModeRec) + modeInfo->nameLength + 1); - if (!mode) - return NULL; - mode->refcnt = 1; - mode->mode = *modeInfo; - mode->name = (char *) (mode + 1); - memcpy (mode->name, name, modeInfo->nameLength); - mode->name[modeInfo->nameLength] = '\0'; - mode->userScreen = userScreen; - - if (num_modes) - newModes = xrealloc (modes, (num_modes + 1) * sizeof (RRModePtr)); - else - newModes = xalloc (sizeof (RRModePtr)); - - if (!newModes) - { - xfree (mode); - return NULL; - } - - mode->mode.id = FakeClientID(0); - if (!AddResource (mode->mode.id, RRModeType, (pointer) mode)) - return NULL; - modes = newModes; - modes[num_modes++] = mode; - - /* - * give the caller a reference to this mode - */ - ++mode->refcnt; - return mode; -} - -static RRModePtr -RRModeFindByName (const char *name, - CARD16 nameLength) -{ - int i; - RRModePtr mode; - - for (i = 0; i < num_modes; i++) - { - mode = modes[i]; - if (mode->mode.nameLength == nameLength && - !memcmp (name, mode->name, nameLength)) - { - return mode; - } - } - return NULL; -} - -RRModePtr -RRModeGet (xRRModeInfo *modeInfo, - const char *name) -{ - int i; - - for (i = 0; i < num_modes; i++) - { - RRModePtr mode = modes[i]; - if (RRModeEqual (&mode->mode, modeInfo) && - !memcmp (name, mode->name, modeInfo->nameLength)) - { - ++mode->refcnt; - return mode; - } - } - - return RRModeCreate (modeInfo, name, NULL); -} - -static RRModePtr -RRModeCreateUser (ScreenPtr pScreen, - xRRModeInfo *modeInfo, - const char *name, - int *error) -{ - RRModePtr mode; - - mode = RRModeFindByName (name, modeInfo->nameLength); - if (mode) - { - *error = BadName; - return NULL; - } - - mode = RRModeCreate (modeInfo, name, pScreen); - if (!mode) - { - *error = BadAlloc; - return NULL; - } - *error = Success; - return mode; -} - -RRModePtr * -RRModesForScreen (ScreenPtr pScreen, int *num_ret) -{ - rrScrPriv(pScreen); - int o, c, m; - RRModePtr *screen_modes; - int num_screen_modes = 0; - - screen_modes = xalloc ((num_modes ? num_modes : 1) * sizeof (RRModePtr)); - if (!screen_modes) - return NULL; - - /* - * Add modes from all outputs - */ - for (o = 0; o < pScrPriv->numOutputs; o++) - { - RROutputPtr output = pScrPriv->outputs[o]; - int m, n; - - for (m = 0; m < output->numModes + output->numUserModes; m++) - { - RRModePtr mode = (m < output->numModes ? - output->modes[m] : - output->userModes[m-output->numModes]); - for (n = 0; n < num_screen_modes; n++) - if (screen_modes[n] == mode) - break; - if (n == num_screen_modes) - screen_modes[num_screen_modes++] = mode; - } - } - /* - * Add modes from all crtcs. The goal is to - * make sure all available and active modes - * are visible to the client - */ - for (c = 0; c < pScrPriv->numCrtcs; c++) - { - RRCrtcPtr crtc = pScrPriv->crtcs[c]; - RRModePtr mode = crtc->mode; - int n; - - if (!mode) continue; - for (n = 0; n < num_screen_modes; n++) - if (screen_modes[n] == mode) - break; - if (n == num_screen_modes) - screen_modes[num_screen_modes++] = mode; - } - /* - * Add all user modes for this screen - */ - for (m = 0; m < num_modes; m++) - { - RRModePtr mode = modes[m]; - int n; - - if (mode->userScreen != pScreen) - continue; - for (n = 0; n < num_screen_modes; n++) - if (screen_modes[n] == mode) - break; - if (n == num_screen_modes) - screen_modes[num_screen_modes++] = mode; - } - - *num_ret = num_screen_modes; - return screen_modes; -} - -void -RRModeDestroy (RRModePtr mode) -{ - int m; - - if (--mode->refcnt > 0) - return; - for (m = 0; m < num_modes; m++) - { - if (modes[m] == mode) - { - memmove (modes + m, modes + m + 1, - (num_modes - m - 1) * sizeof (RRModePtr)); - num_modes--; - if (!num_modes) - { - xfree (modes); - modes = NULL; - } - break; - } - } - - xfree (mode); -} - -static int -RRModeDestroyResource (pointer value, XID pid) -{ - RRModeDestroy ((RRModePtr) value); - return 1; -} - -Bool -RRModeInit (void) -{ - assert (num_modes == 0); - assert (modes == NULL); - RRModeType = CreateNewResourceType (RRModeDestroyResource); - if (!RRModeType) - return FALSE; - RegisterResourceName (RRModeType, "MODE"); - return TRUE; -} - -int -ProcRRCreateMode (ClientPtr client) -{ - REQUEST(xRRCreateModeReq); - xRRCreateModeReply rep; - WindowPtr pWin; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - xRRModeInfo *modeInfo; - long units_after; - char *name; - int error, rc; - RRModePtr mode; - - REQUEST_AT_LEAST_SIZE (xRRCreateModeReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - - modeInfo = &stuff->modeInfo; - name = (char *) (stuff + 1); - units_after = (stuff->length - (sizeof (xRRCreateModeReq) >> 2)); - - /* check to make sure requested name fits within the data provided */ - if ((int) (modeInfo->nameLength + 3) >> 2 > units_after) - return BadLength; - - mode = RRModeCreateUser (pScreen, modeInfo, name, &error); - if (!mode) - return error; - - rep.type = X_Reply; - rep.pad0 = 0; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.mode = mode->mode.id; - if (client->swapped) - { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.mode, n); - } - WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep); - - return client->noClientException; -} - -int -ProcRRDestroyMode (ClientPtr client) -{ - REQUEST(xRRDestroyModeReq); - RRModePtr mode; - - REQUEST_SIZE_MATCH(xRRDestroyModeReq); - mode = LookupIDByType (stuff->mode, RRModeType); - if (!mode) - { - client->errorValue = stuff->mode; - return RRErrorBase + BadRRMode; - } - if (!mode->userScreen) - return BadMatch; - if (mode->refcnt > 1) - return BadAccess; - FreeResource (stuff->mode, 0); - return Success; -} - -int -ProcRRAddOutputMode (ClientPtr client) -{ - REQUEST(xRRAddOutputModeReq); - RRModePtr mode; - RROutputPtr output; - - REQUEST_SIZE_MATCH(xRRAddOutputModeReq); - output = LookupOutput(client, stuff->output, DixReadAccess); - - if (!output) - { - client->errorValue = stuff->output; - return RRErrorBase + BadRROutput; - } - - mode = LookupIDByType (stuff->mode, RRModeType); - if (!mode) - { - client->errorValue = stuff->mode; - return RRErrorBase + BadRRMode; - } - - return RROutputAddUserMode (output, mode); -} - -int -ProcRRDeleteOutputMode (ClientPtr client) -{ - REQUEST(xRRDeleteOutputModeReq); - RRModePtr mode; - RROutputPtr output; - - REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq); - output = LookupOutput(client, stuff->output, DixReadAccess); - - if (!output) - { - client->errorValue = stuff->output; - return RRErrorBase + BadRROutput; - } - - mode = LookupIDByType (stuff->mode, RRModeType); - if (!mode) - { - client->errorValue = stuff->mode; - return RRErrorBase + BadRRMode; - } - - return RROutputDeleteUserMode (output, mode); -} diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c.NX.original b/nx-X11/programs/Xserver/randr/rrscreen.c.NX.original deleted file mode 100644 index 9b3935e03..000000000 --- a/nx-X11/programs/Xserver/randr/rrscreen.c.NX.original +++ /dev/null @@ -1,1030 +0,0 @@ -/* - * Copyright © 2006 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#include "randrstr.h" - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -static CARD16 -RR10CurrentSizeID (ScreenPtr pScreen); - -/* - * Edit connection information block so that new clients - * see the current screen size on connect - */ -static void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -void -RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - xRRScreenChangeNotifyEvent se; - RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL; - WindowPtr pRoot = WindowTable[pScreen->myNum]; - - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.sequenceNumber = client->sequence; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; -#ifdef RENDER - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); -#else - se.subpixelOrder = SubPixelUnknown; -#endif - - se.sequenceNumber = client->sequence; - se.sizeID = RR10CurrentSizeID (pScreen); - - if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) { - se.widthInPixels = pScreen->height; - se.heightInPixels = pScreen->width; - se.widthInMillimeters = pScreen->mmHeight; - se.heightInMillimeters = pScreen->mmWidth; - } else { - se.widthInPixels = pScreen->width; - se.heightInPixels = pScreen->height; - se.widthInMillimeters = pScreen->mmWidth; - se.heightInMillimeters = pScreen->mmHeight; - } - - WriteEventsToClient (client, 1, (xEvent *) &se); -} - -/* - * Notify the extension that the screen size has been changed. - * The driver is responsible for calling this whenever it has changed - * the size of the screen - */ -void -RRScreenSizeNotify (ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (pScrPriv->width == pScreen->width && - pScrPriv->height == pScreen->height && - pScrPriv->mmWidth == pScreen->mmWidth && - pScrPriv->mmHeight == pScreen->mmHeight) - return; - - pScrPriv->width = pScreen->width; - pScrPriv->height = pScreen->height; - pScrPriv->mmWidth = pScreen->mmWidth; - pScrPriv->mmHeight = pScreen->mmHeight; - pScrPriv->changed = TRUE; -/* pScrPriv->sizeChanged = TRUE; */ - - RRTellChanged (pScreen); - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - RRPointerScreenConfigured (pScreen); - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); -} - -/* - * Request that the screen be resized - */ -Bool -RRScreenSizeSet (ScreenPtr pScreen, - CARD16 width, - CARD16 height, - CARD32 mmWidth, - CARD32 mmHeight) -{ - rrScrPriv(pScreen); - -#if RANDR_12_INTERFACE - if (pScrPriv->rrScreenSetSize) - { - return (*pScrPriv->rrScreenSetSize) (pScreen, - width, height, - mmWidth, mmHeight); - } -#endif -#if RANDR_10_INTERFACE - if (pScrPriv->rrSetConfig) - { - return TRUE; /* can't set size separately */ - } -#endif - return FALSE; -} - -/* - * Retrieve valid screen size range - */ -int -ProcRRGetScreenSizeRange (ClientPtr client) -{ - REQUEST(xRRGetScreenSizeRangeReq); - xRRGetScreenSizeRangeReply rep; - WindowPtr pWin; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - int rc; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - #ifndef NXAGENT_SERVER - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); - rc = pWin ? Success : BadWindow; - #endif - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - - rep.type = X_Reply; - rep.pad = 0; - rep.sequenceNumber = client->sequence; - rep.length = 0; - - if (pScrPriv) - { - if (!RRGetInfo (pScreen)) - return BadAlloc; - rep.minWidth = pScrPriv->minWidth; - rep.minHeight = pScrPriv->minHeight; - rep.maxWidth = pScrPriv->maxWidth; - rep.maxHeight = pScrPriv->maxHeight; - } - else - { - rep.maxWidth = rep.minWidth = pScreen->width; - rep.maxHeight = rep.minHeight = pScreen->height; - } - if (client->swapped) - { - int n; - - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.minWidth, n); - swaps(&rep.minHeight, n); - swaps(&rep.maxWidth, n); - swaps(&rep.maxHeight, n); - } - WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep); - return (client->noClientException); -} - -int -ProcRRSetScreenSize (ClientPtr client) -{ - REQUEST(xRRSetScreenSizeReq); - WindowPtr pWin; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - int i, rc; - - REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); - #ifndef NXAGENT_SERVER - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); - rc = pWin ? Success : BadWindow; - #endif - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - if (stuff->width < pScrPriv->minWidth || pScrPriv->maxWidth < stuff->width) - { - client->errorValue = stuff->width; - return BadValue; - } - if (stuff->height < pScrPriv->minHeight || - pScrPriv->maxHeight < stuff->height) - { - client->errorValue = stuff->height; - return BadValue; - } - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - RRCrtcPtr crtc = pScrPriv->crtcs[i]; - RRModePtr mode = crtc->mode; - if (mode) - { - int source_width = mode->mode.width; - int source_height = mode->mode.height; - Rotation rotation = crtc->rotation; - - if (rotation == RR_Rotate_90 || rotation == RR_Rotate_270) - { - source_width = mode->mode.height; - source_height = mode->mode.width; - } - - if (crtc->x + source_width > stuff->width || - crtc->y + source_height > stuff->height) - return BadMatch; - } - } - if (stuff->widthInMillimeters == 0 || stuff->heightInMillimeters == 0) - { - client->errorValue = 0; - return BadValue; - } - if (!RRScreenSizeSet (pScreen, - stuff->width, stuff->height, - stuff->widthInMillimeters, - stuff->heightInMillimeters)) - { - return BadMatch; - } - return Success; -} - -int -ProcRRGetScreenResources (ClientPtr client) -{ - REQUEST(xRRGetScreenResourcesReq); - xRRGetScreenResourcesReply rep; - WindowPtr pWin; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - unsigned long extraLen; - int i, n, rc; - RRCrtc *crtcs; - RROutput *outputs; - xRRModeInfo *modeinfos; - CARD8 *names; - - REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); - #ifndef NXAGENT_SERVER - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); - rc = pWin ? Success : BadWindow; - #endif - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - - if (pScrPriv) - if (!RRGetInfo (pScreen)) - return BadAlloc; - - if (!pScrPriv) - { - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nCrtcs = 0; - rep.nOutputs = 0; - rep.nModes = 0; - rep.nbytesNames = 0; - extra = NULL; - extraLen = 0; - } - else - { - RRModePtr *modes; - int num_modes; - - modes = RRModesForScreen (pScreen, &num_modes); - if (!modes) - return BadAlloc; - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.nCrtcs = pScrPriv->numCrtcs; - rep.nOutputs = pScrPriv->numOutputs; - rep.nModes = num_modes; - rep.nbytesNames = 0; - - for (i = 0; i < num_modes; i++) - rep.nbytesNames += modes[i]->mode.nameLength; - - rep.length = (pScrPriv->numCrtcs + - pScrPriv->numOutputs + - num_modes * (SIZEOF(xRRModeInfo) >> 2) + - ((rep.nbytesNames + 3) >> 2)); - - extraLen = rep.length << 2; - if (extraLen) - { - extra = xalloc (extraLen); - if (!extra) - { - xfree (modes); - return BadAlloc; - } - } - else - extra = NULL; - - crtcs = (RRCrtc *) extra; - outputs = (RROutput *) (crtcs + pScrPriv->numCrtcs); - modeinfos = (xRRModeInfo *) (outputs + pScrPriv->numOutputs); - names = (CARD8 *) (modeinfos + num_modes); - - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - crtcs[i] = pScrPriv->crtcs[i]->id; - if (client->swapped) - swapl (&crtcs[i], n); - } - - for (i = 0; i < pScrPriv->numOutputs; i++) - { - outputs[i] = pScrPriv->outputs[i]->id; - if (client->swapped) - swapl (&outputs[i], n); - } - - for (i = 0; i < num_modes; i++) - { - RRModePtr mode = modes[i]; - modeinfos[i] = mode->mode; - if (client->swapped) - { - swapl (&modeinfos[i].id, n); - swaps (&modeinfos[i].width, n); - swaps (&modeinfos[i].height, n); - swapl (&modeinfos[i].dotClock, n); - swaps (&modeinfos[i].hSyncStart, n); - swaps (&modeinfos[i].hSyncEnd, n); - swaps (&modeinfos[i].hTotal, n); - swaps (&modeinfos[i].hSkew, n); - swaps (&modeinfos[i].vSyncStart, n); - swaps (&modeinfos[i].vSyncEnd, n); - swaps (&modeinfos[i].vTotal, n); - swaps (&modeinfos[i].nameLength, n); - swapl (&modeinfos[i].modeFlags, n); - } - memcpy (names, mode->name, - mode->mode.nameLength); - names += mode->mode.nameLength; - } - xfree (modes); - assert (((((char *) names - (char *) extra) + 3) >> 2) == rep.length); - } - - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swapl(&rep.configTimestamp, n); - swaps(&rep.nCrtcs, n); - swaps(&rep.nOutputs, n); - swaps(&rep.nModes, n); - swaps(&rep.nbytesNames, n); - } - WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return client->noClientException; -} - -typedef struct _RR10Data { - RRScreenSizePtr sizes; - int nsize; - int nrefresh; - int size; - CARD16 refresh; -} RR10DataRec, *RR10DataPtr; - -/* - * Convert 1.2 monitor data into 1.0 screen data - */ -static RR10DataPtr -RR10GetData (ScreenPtr pScreen, RROutputPtr output) -{ - RR10DataPtr data; - RRScreenSizePtr size; - int nmode = output->numModes + output->numUserModes; - int o, os, l, r; - RRScreenRatePtr refresh; - CARD16 vRefresh; - RRModePtr mode; - Bool *used; - - /* Make sure there is plenty of space for any combination */ - data = malloc (sizeof (RR10DataRec) + - sizeof (RRScreenSize) * nmode + - sizeof (RRScreenRate) * nmode + - sizeof (Bool) * nmode); - if (!data) - return NULL; - size = (RRScreenSizePtr) (data + 1); - refresh = (RRScreenRatePtr) (size + nmode); - used = (Bool *) (refresh + nmode); - memset (used, '\0', sizeof (Bool) * nmode); - data->sizes = size; - data->nsize = 0; - data->nrefresh = 0; - data->size = 0; - data->refresh = 0; - - /* - * find modes not yet listed - */ - for (o = 0; o < output->numModes + output->numUserModes; o++) - { - if (used[o]) continue; - - if (o < output->numModes) - mode = output->modes[o]; - else - mode = output->userModes[o - output->numModes]; - - l = data->nsize; - size[l].id = data->nsize; - size[l].width = mode->mode.width; - size[l].height = mode->mode.height; - if (output->mmWidth && output->mmHeight) { - size[l].mmWidth = output->mmWidth; - size[l].mmHeight = output->mmHeight; - } else { - size[l].mmWidth = pScreen->mmWidth; - size[l].mmHeight = pScreen->mmHeight; - } - size[l].nRates = 0; - size[l].pRates = &refresh[data->nrefresh]; - data->nsize++; - - /* - * Find all modes with matching size - */ - for (os = o; os < output->numModes + output->numUserModes; os++) - { - if (os < output->numModes) - mode = output->modes[os]; - else - mode = output->userModes[os - output->numModes]; - if (mode->mode.width == size[l].width && - mode->mode.height == size[l].height) - { - vRefresh = RRVerticalRefresh (&mode->mode); - used[os] = TRUE; - - for (r = 0; r < size[l].nRates; r++) - if (vRefresh == size[l].pRates[r].rate) - break; - if (r == size[l].nRates) - { - size[l].pRates[r].rate = vRefresh; - size[l].pRates[r].mode = mode; - size[l].nRates++; - data->nrefresh++; - } - if (mode == output->crtc->mode) - { - data->size = l; - data->refresh = vRefresh; - } - } - } - } - return data; -} - -int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n, rc; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - unsigned long extraLen; - RROutputPtr output; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - #ifndef NXAGENT_SERVER - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); - rc = pWin ? Success : BadWindow; - #endif - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - - if (pScrPriv) - if (!RRGetInfo (pScreen)) - return BadAlloc; - - output = RRFirstOutput (pScreen); - - if (!pScrPriv || !output) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - RR10DataPtr pData; - RRScreenSizePtr pSize; - - pData = RR10GetData (pScreen, output); - if (!pData) - return BadAlloc; - - rep.type = X_Reply; - rep.setOfRotations = output->crtc->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = output->crtc->rotation; - rep.nSizes = pData->nsize; - rep.nrateEnts = pData->nrefresh + pData->nsize; - rep.sizeID = pData->size; - rep.rate = pData->refresh; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - if (extraLen) - { - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - { - xfree (pData); - return BadAlloc; - } - } - else - extra = NULL; - - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pData->nsize; i++) - { - pSize = &pData->sizes[i]; - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRates; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - *rates = pSize->pRates[j].rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } - xfree (pData); - - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n", - (unsigned long)(data8 - (CARD8 *) extra), extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); - } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); -} - -int -ProcRRSetScreenConfig (ClientPtr client) -{ - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n, rc; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp time; - int i; - Rotation rotation; - int rate; - Bool has_rate; - RROutputPtr output; - RRCrtcPtr crtc; - RRModePtr mode; - RR10DataPtr pData = NULL; - RRScreenSizePtr pSize; - int width, height; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - #ifndef NXAGENT_SERVER - rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess); - #else - pDraw = SecurityLookupDrawable(stuff->drawable, client, SecurityWriteAccess); - rc = pDraw ? Success : BadDrawable; - #endif - if (rc != Success) - return rc; - - pScreen = pDraw->pScreen; - - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - output = RRFirstOutput (pScreen); - if (!output) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - - crtc = output->crtc; - - /* - * If the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated. - * - * Note that the client only knows about the milliseconds part of the - * timestamp, so using CompareTimeStamps here would cause randr to suddenly - * stop working after several hours have passed (freedesktop bug #6502). - */ - if (stuff->configTimestamp != pScrPriv->lastConfigTime.milliseconds) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - pData = RR10GetData (pScreen, output); - if (!pData) - return BadAlloc; - - if (stuff->sizeID >= pData->nsize) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - xfree (pData); - return BadValue; - } - pSize = &pData->sizes[stuff->sizeID]; - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - xfree (pData); - return BadValue; - } - - if ((~crtc->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - xfree (pData); - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - if (pSize->pRates[i].rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - client->errorValue = rate; - xfree (pData); - return BadValue; - } - mode = pSize->pRates[i].mode; - } - else - mode = pSize->pRates[0].mode; - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * If the screen size is changing, adjust all of the other outputs - * to fit the new size, mirroring as much as possible - */ - width = mode->mode.width; - height = mode->mode.height; - if (rotation & (RR_Rotate_90|RR_Rotate_270)) - { - width = mode->mode.height; - height = mode->mode.width; - } - if (width != pScreen->width || height != pScreen->height) - { - int c; - - for (c = 0; c < pScrPriv->numCrtcs; c++) - { - if (!RRCrtcSet (pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0, - 0, NULL)) - { - rep.status = RRSetConfigFailed; - /* XXX recover from failure */ - goto sendReply; - } - } - if (!RRScreenSizeSet (pScreen, width, height, - pScreen->mmWidth, pScreen->mmHeight)) - { - rep.status = RRSetConfigFailed; - /* XXX recover from failure */ - goto sendReply; - } - } - - if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output)) - rep.status = RRSetConfigFailed; - #ifndef NXAGENT_SERVER /* Bug 21987 */ - else - rep.status = RRSetConfigSuccess; - #else - else { - rep.status = RRSetConfigSuccess; - pScrPriv->lastSetTime = time; - } - #endif - - /* - * XXX Configure other crtcs to mirror as much as possible - */ - -sendReply: - - if (pData) - xfree (pData); - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); -} - -static CARD16 -RR10CurrentSizeID (ScreenPtr pScreen) -{ - CARD16 sizeID = 0xffff; - RROutputPtr output = RRFirstOutput (pScreen); - - if (output) - { - RR10DataPtr data = RR10GetData (pScreen, output); - if (data) - { - int i; - for (i = 0; i < data->nsize; i++) - if (data->sizes[i].width == pScreen->width && - data->sizes[i].height == pScreen->height) - { - sizeID = (CARD16) i; - break; - } - xfree (data); - } - } - return sizeID; -} diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c.X.original b/nx-X11/programs/Xserver/randr/rrscreen.c.X.original deleted file mode 100644 index f39197337..000000000 --- a/nx-X11/programs/Xserver/randr/rrscreen.c.X.original +++ /dev/null @@ -1,981 +0,0 @@ -/* - * Copyright © 2006 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "randrstr.h" - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -static CARD16 -RR10CurrentSizeID (ScreenPtr pScreen); - -/* - * Edit connection information block so that new clients - * see the current screen size on connect - */ -static void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -void -RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - xRRScreenChangeNotifyEvent se; - RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL; - WindowPtr pRoot = WindowTable[pScreen->myNum]; - - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.sequenceNumber = client->sequence; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; -#ifdef RENDER - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); -#else - se.subpixelOrder = SubPixelUnknown; -#endif - - se.sequenceNumber = client->sequence; - se.sizeID = RR10CurrentSizeID (pScreen); - - if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) { - se.widthInPixels = pScreen->height; - se.heightInPixels = pScreen->width; - se.widthInMillimeters = pScreen->mmHeight; - se.heightInMillimeters = pScreen->mmWidth; - } else { - se.widthInPixels = pScreen->width; - se.heightInPixels = pScreen->height; - se.widthInMillimeters = pScreen->mmWidth; - se.heightInMillimeters = pScreen->mmHeight; - } - - WriteEventsToClient (client, 1, (xEvent *) &se); -} - -/* - * Notify the extension that the screen size has been changed. - * The driver is responsible for calling this whenever it has changed - * the size of the screen - */ -void -RRScreenSizeNotify (ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (pScrPriv->width == pScreen->width && - pScrPriv->height == pScreen->height && - pScrPriv->mmWidth == pScreen->mmWidth && - pScrPriv->mmHeight == pScreen->mmHeight) - return; - - pScrPriv->width = pScreen->width; - pScrPriv->height = pScreen->height; - pScrPriv->mmWidth = pScreen->mmWidth; - pScrPriv->mmHeight = pScreen->mmHeight; - pScrPriv->changed = TRUE; -/* pScrPriv->sizeChanged = TRUE; */ - - RRTellChanged (pScreen); - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - RRPointerScreenConfigured (pScreen); - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); -} - -/* - * Request that the screen be resized - */ -Bool -RRScreenSizeSet (ScreenPtr pScreen, - CARD16 width, - CARD16 height, - CARD32 mmWidth, - CARD32 mmHeight) -{ - rrScrPriv(pScreen); - -#if RANDR_12_INTERFACE - if (pScrPriv->rrScreenSetSize) - { - return (*pScrPriv->rrScreenSetSize) (pScreen, - width, height, - mmWidth, mmHeight); - } -#endif -#if RANDR_10_INTERFACE - if (pScrPriv->rrSetConfig) - { - return TRUE; /* can't set size separately */ - } -#endif - return FALSE; -} - -/* - * Retrieve valid screen size range - */ -int -ProcRRGetScreenSizeRange (ClientPtr client) -{ - REQUEST(xRRGetScreenSizeRangeReq); - xRRGetScreenSizeRangeReply rep; - WindowPtr pWin; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - int rc; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - - rep.type = X_Reply; - rep.pad = 0; - rep.sequenceNumber = client->sequence; - rep.length = 0; - - if (pScrPriv) - { - if (!RRGetInfo (pScreen)) - return BadAlloc; - rep.minWidth = pScrPriv->minWidth; - rep.minHeight = pScrPriv->minHeight; - rep.maxWidth = pScrPriv->maxWidth; - rep.maxHeight = pScrPriv->maxHeight; - } - else - { - rep.maxWidth = rep.minWidth = pScreen->width; - rep.maxHeight = rep.minHeight = pScreen->height; - } - if (client->swapped) - { - int n; - - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.minWidth, n); - swaps(&rep.minHeight, n); - swaps(&rep.maxWidth, n); - swaps(&rep.maxHeight, n); - } - WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep); - return (client->noClientException); -} - -int -ProcRRSetScreenSize (ClientPtr client) -{ - REQUEST(xRRSetScreenSizeReq); - WindowPtr pWin; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - int i, rc; - - REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - if (stuff->width < pScrPriv->minWidth || pScrPriv->maxWidth < stuff->width) - { - client->errorValue = stuff->width; - return BadValue; - } - if (stuff->height < pScrPriv->minHeight || - pScrPriv->maxHeight < stuff->height) - { - client->errorValue = stuff->height; - return BadValue; - } - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - RRCrtcPtr crtc = pScrPriv->crtcs[i]; - RRModePtr mode = crtc->mode; - if (mode) - { - int source_width = mode->mode.width; - int source_height = mode->mode.height; - Rotation rotation = crtc->rotation; - - if (rotation == RR_Rotate_90 || rotation == RR_Rotate_270) - { - source_width = mode->mode.height; - source_height = mode->mode.width; - } - - if (crtc->x + source_width > stuff->width || - crtc->y + source_height > stuff->height) - return BadMatch; - } - } - if (stuff->widthInMillimeters == 0 || stuff->heightInMillimeters == 0) - { - client->errorValue = 0; - return BadValue; - } - if (!RRScreenSizeSet (pScreen, - stuff->width, stuff->height, - stuff->widthInMillimeters, - stuff->heightInMillimeters)) - { - return BadMatch; - } - return Success; -} - -int -ProcRRGetScreenResources (ClientPtr client) -{ - REQUEST(xRRGetScreenResourcesReq); - xRRGetScreenResourcesReply rep; - WindowPtr pWin; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - unsigned long extraLen; - int i, n, rc; - RRCrtc *crtcs; - RROutput *outputs; - xRRModeInfo *modeinfos; - CARD8 *names; - - REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - - if (pScrPriv) - if (!RRGetInfo (pScreen)) - return BadAlloc; - - if (!pScrPriv) - { - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nCrtcs = 0; - rep.nOutputs = 0; - rep.nModes = 0; - rep.nbytesNames = 0; - extra = NULL; - extraLen = 0; - } - else - { - RRModePtr *modes; - int num_modes; - - modes = RRModesForScreen (pScreen, &num_modes); - if (!modes) - return BadAlloc; - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.nCrtcs = pScrPriv->numCrtcs; - rep.nOutputs = pScrPriv->numOutputs; - rep.nModes = num_modes; - rep.nbytesNames = 0; - - for (i = 0; i < num_modes; i++) - rep.nbytesNames += modes[i]->mode.nameLength; - - rep.length = (pScrPriv->numCrtcs + - pScrPriv->numOutputs + - num_modes * (SIZEOF(xRRModeInfo) >> 2) + - ((rep.nbytesNames + 3) >> 2)); - - extraLen = rep.length << 2; - if (extraLen) - { - extra = xalloc (extraLen); - if (!extra) - { - xfree (modes); - return BadAlloc; - } - } - else - extra = NULL; - - crtcs = (RRCrtc *) extra; - outputs = (RROutput *) (crtcs + pScrPriv->numCrtcs); - modeinfos = (xRRModeInfo *) (outputs + pScrPriv->numOutputs); - names = (CARD8 *) (modeinfos + num_modes); - - for (i = 0; i < pScrPriv->numCrtcs; i++) - { - crtcs[i] = pScrPriv->crtcs[i]->id; - if (client->swapped) - swapl (&crtcs[i], n); - } - - for (i = 0; i < pScrPriv->numOutputs; i++) - { - outputs[i] = pScrPriv->outputs[i]->id; - if (client->swapped) - swapl (&outputs[i], n); - } - - for (i = 0; i < num_modes; i++) - { - RRModePtr mode = modes[i]; - modeinfos[i] = mode->mode; - if (client->swapped) - { - swapl (&modeinfos[i].id, n); - swaps (&modeinfos[i].width, n); - swaps (&modeinfos[i].height, n); - swapl (&modeinfos[i].dotClock, n); - swaps (&modeinfos[i].hSyncStart, n); - swaps (&modeinfos[i].hSyncEnd, n); - swaps (&modeinfos[i].hTotal, n); - swaps (&modeinfos[i].hSkew, n); - swaps (&modeinfos[i].vSyncStart, n); - swaps (&modeinfos[i].vSyncEnd, n); - swaps (&modeinfos[i].vTotal, n); - swaps (&modeinfos[i].nameLength, n); - swapl (&modeinfos[i].modeFlags, n); - } - memcpy (names, mode->name, - mode->mode.nameLength); - names += mode->mode.nameLength; - } - xfree (modes); - assert (((((char *) names - (char *) extra) + 3) >> 2) == rep.length); - } - - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swapl(&rep.configTimestamp, n); - swaps(&rep.nCrtcs, n); - swaps(&rep.nOutputs, n); - swaps(&rep.nModes, n); - swaps(&rep.nbytesNames, n); - } - WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return client->noClientException; -} - -typedef struct _RR10Data { - RRScreenSizePtr sizes; - int nsize; - int nrefresh; - int size; - CARD16 refresh; -} RR10DataRec, *RR10DataPtr; - -/* - * Convert 1.2 monitor data into 1.0 screen data - */ -static RR10DataPtr -RR10GetData (ScreenPtr pScreen, RROutputPtr output) -{ - RR10DataPtr data; - RRScreenSizePtr size; - int nmode = output->numModes + output->numUserModes; - int o, os, l, r; - RRScreenRatePtr refresh; - CARD16 vRefresh; - RRModePtr mode; - Bool *used; - - /* Make sure there is plenty of space for any combination */ - data = malloc (sizeof (RR10DataRec) + - sizeof (RRScreenSize) * nmode + - sizeof (RRScreenRate) * nmode + - sizeof (Bool) * nmode); - if (!data) - return NULL; - size = (RRScreenSizePtr) (data + 1); - refresh = (RRScreenRatePtr) (size + nmode); - used = (Bool *) (refresh + nmode); - memset (used, '\0', sizeof (Bool) * nmode); - data->sizes = size; - data->nsize = 0; - data->nrefresh = 0; - data->size = 0; - data->refresh = 0; - - /* - * find modes not yet listed - */ - for (o = 0; o < output->numModes + output->numUserModes; o++) - { - if (used[o]) continue; - - if (o < output->numModes) - mode = output->modes[o]; - else - mode = output->userModes[o - output->numModes]; - - l = data->nsize; - size[l].id = data->nsize; - size[l].width = mode->mode.width; - size[l].height = mode->mode.height; - if (output->mmWidth && output->mmHeight) { - size[l].mmWidth = output->mmWidth; - size[l].mmHeight = output->mmHeight; - } else { - size[l].mmWidth = pScreen->mmWidth; - size[l].mmHeight = pScreen->mmHeight; - } - size[l].nRates = 0; - size[l].pRates = &refresh[data->nrefresh]; - data->nsize++; - - /* - * Find all modes with matching size - */ - for (os = o; os < output->numModes + output->numUserModes; os++) - { - if (os < output->numModes) - mode = output->modes[os]; - else - mode = output->userModes[os - output->numModes]; - if (mode->mode.width == size[l].width && - mode->mode.height == size[l].height) - { - vRefresh = RRVerticalRefresh (&mode->mode); - used[os] = TRUE; - - for (r = 0; r < size[l].nRates; r++) - if (vRefresh == size[l].pRates[r].rate) - break; - if (r == size[l].nRates) - { - size[l].pRates[r].rate = vRefresh; - size[l].pRates[r].mode = mode; - size[l].nRates++; - data->nrefresh++; - } - if (mode == output->crtc->mode) - { - data->size = l; - data->refresh = vRefresh; - } - } - } - } - return data; -} - -int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n, rc; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - unsigned long extraLen; - RROutputPtr output; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - - if (pScrPriv) - if (!RRGetInfo (pScreen)) - return BadAlloc; - - output = RRFirstOutput (pScreen); - - if (!pScrPriv || !output) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - RR10DataPtr pData; - RRScreenSizePtr pSize; - - pData = RR10GetData (pScreen, output); - if (!pData) - return BadAlloc; - - rep.type = X_Reply; - rep.setOfRotations = output->crtc->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = output->crtc->rotation; - rep.nSizes = pData->nsize; - rep.nrateEnts = pData->nrefresh + pData->nsize; - rep.sizeID = pData->size; - rep.rate = pData->refresh; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - if (extraLen) - { - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - { - xfree (pData); - return BadAlloc; - } - } - else - extra = NULL; - - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pData->nsize; i++) - { - pSize = &pData->sizes[i]; - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRates; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - *rates = pSize->pRates[j].rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } - xfree (pData); - - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n", - (unsigned long)(data8 - (CARD8 *) extra), extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); - } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); -} - -int -ProcRRSetScreenConfig (ClientPtr client) -{ - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n, rc; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp time; - int i; - Rotation rotation; - int rate; - Bool has_rate; - RROutputPtr output; - RRCrtcPtr crtc; - RRModePtr mode; - RR10DataPtr pData = NULL; - RRScreenSizePtr pSize; - int width, height; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess); - if (rc != Success) - return rc; - - pScreen = pDraw->pScreen; - - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - output = RRFirstOutput (pScreen); - if (!output) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - - crtc = output->crtc; - - /* - * If the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated. - * - * Note that the client only knows about the milliseconds part of the - * timestamp, so using CompareTimeStamps here would cause randr to suddenly - * stop working after several hours have passed (freedesktop bug #6502). - */ - if (stuff->configTimestamp != pScrPriv->lastConfigTime.milliseconds) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - pData = RR10GetData (pScreen, output); - if (!pData) - return BadAlloc; - - if (stuff->sizeID >= pData->nsize) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - xfree (pData); - return BadValue; - } - pSize = &pData->sizes[stuff->sizeID]; - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - xfree (pData); - return BadValue; - } - - if ((~crtc->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - xfree (pData); - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - if (pSize->pRates[i].rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - client->errorValue = rate; - xfree (pData); - return BadValue; - } - mode = pSize->pRates[i].mode; - } - else - mode = pSize->pRates[0].mode; - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * If the screen size is changing, adjust all of the other outputs - * to fit the new size, mirroring as much as possible - */ - width = mode->mode.width; - height = mode->mode.height; - if (rotation & (RR_Rotate_90|RR_Rotate_270)) - { - width = mode->mode.height; - height = mode->mode.width; - } - if (width != pScreen->width || height != pScreen->height) - { - int c; - - for (c = 0; c < pScrPriv->numCrtcs; c++) - { - if (!RRCrtcSet (pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0, - 0, NULL)) - { - rep.status = RRSetConfigFailed; - /* XXX recover from failure */ - goto sendReply; - } - } - if (!RRScreenSizeSet (pScreen, width, height, - pScreen->mmWidth, pScreen->mmHeight)) - { - rep.status = RRSetConfigFailed; - /* XXX recover from failure */ - goto sendReply; - } - } - - if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output)) - rep.status = RRSetConfigFailed; - else - rep.status = RRSetConfigSuccess; - - /* - * XXX Configure other crtcs to mirror as much as possible - */ - -sendReply: - - if (pData) - xfree (pData); - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); -} - -static CARD16 -RR10CurrentSizeID (ScreenPtr pScreen) -{ - CARD16 sizeID = 0xffff; - RROutputPtr output = RRFirstOutput (pScreen); - - if (output) - { - RR10DataPtr data = RR10GetData (pScreen, output); - if (data) - { - int i; - for (i = 0; i < data->nsize; i++) - if (data->sizes[i].width == pScreen->width && - data->sizes[i].height == pScreen->height) - { - sizeID = (CARD16) i; - break; - } - xfree (data); - } - } - return sizeID; -} diff --git a/nx-X11/programs/Xserver/randr/rrxinerama.c.NX.original b/nx-X11/programs/Xserver/randr/rrxinerama.c.NX.original deleted file mode 100644 index 9f11279db..000000000 --- a/nx-X11/programs/Xserver/randr/rrxinerama.c.NX.original +++ /dev/null @@ -1,490 +0,0 @@ -/* - * Copyright © 2006 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ -/* - * This Xinerama implementation comes from the SiS driver which has - * the following notice: - */ -/* - * SiS driver main code - * - * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1) Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2) Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3) The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Thomas Winischhofer - * - driver entirely rewritten since 2001, only basic structure taken from - * old code (except sis_dri.c, sis_shadow.c, sis_accel.c and parts of - * sis_dga.c; these were mostly taken over; sis_dri.c was changed for - * new versions of the DRI layer) - * - * This notice covers the entire driver code unless indicated otherwise. - * - * Formerly based on code which was - * Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England. - * Written by: - * Alan Hourihane , - * Mike Chapman , - * Juanjo Santamarta , - * Mitani Hiroshi , - * David Thomas . - */ - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NX-X11, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#include "randrstr.h" -#include "swaprep.h" -#ifndef NXAGENT_SERVER -#include -#else -#include "panoramiXproto.h" -#endif - -#define RR_XINERAMA_MAJOR_VERSION 1 -#define RR_XINERAMA_MINOR_VERSION 1 - -/* Xinerama is not multi-screen capable; just report about screen 0 */ -#define RR_XINERAMA_SCREEN 0 - -static int ProcRRXineramaQueryVersion(ClientPtr client); -static int ProcRRXineramaGetState(ClientPtr client); -static int ProcRRXineramaGetScreenCount(ClientPtr client); -static int ProcRRXineramaGetScreenSize(ClientPtr client); -static int ProcRRXineramaIsActive(ClientPtr client); -static int ProcRRXineramaQueryScreens(ClientPtr client); -static int SProcRRXineramaDispatch(ClientPtr client); - -/* Proc */ - -int -ProcRRXineramaQueryVersion(ClientPtr client) -{ - xPanoramiXQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RR_XINERAMA_MAJOR_VERSION; - rep.minorVersion = RR_XINERAMA_MINOR_VERSION; - if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -int -ProcRRXineramaGetState(ClientPtr client) -{ - REQUEST(xPanoramiXGetStateReq); - WindowPtr pWin; - xPanoramiXGetStateReply rep; - register int n, rc; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - Bool active = FALSE; - - REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - #ifndef NXAGENT_SERVER - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); - rc = pWin ? Success : BadWindow; - #endif - if(rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - if (pScrPriv) - { - /* XXX do we need more than this? */ - active = TRUE; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.state = active; - rep.window = stuff->window; - if(client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swapl (&rep.window, n); - } - WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); - return client->noClientException; -} - -static Bool -RRXineramaCrtcActive (RRCrtcPtr crtc) -{ - return crtc->mode != NULL && crtc->numOutputs > 0; -} - -static int -RRXineramaScreenCount (ScreenPtr pScreen) -{ - int i, n; - - n = 0; - if (rrGetScrPriv (pScreen)) - { - rrScrPriv(pScreen); - for (i = 0; i < pScrPriv->numCrtcs; i++) - if (RRXineramaCrtcActive (pScrPriv->crtcs[i])) - n++; - } - return n; -} - -static Bool -RRXineramaScreenActive (ScreenPtr pScreen) -{ - return RRXineramaScreenCount (pScreen) > 0; -} - -int -ProcRRXineramaGetScreenCount(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenCountReq); - WindowPtr pWin; - xPanoramiXGetScreenCountReply rep; - register int n, rc; - - REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - #ifndef NXAGENT_SERVER - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); - rc = pWin ? Success : BadWindow; - #endif - if (rc != Success) - return rc; - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.ScreenCount = RRXineramaScreenCount (pWin->drawable.pScreen); - rep.window = stuff->window; - if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.window, n); - } - WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); - return client->noClientException; -} - -int -ProcRRXineramaGetScreenSize(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenSizeReq); - WindowPtr pWin, pRoot; - ScreenPtr pScreen; - xPanoramiXGetScreenSizeReply rep; - register int n, rc; - - REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - #ifndef NXAGENT_SERVER - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); - rc = pWin ? Success : BadWindow; - #endif - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pRoot = WindowTable[pScreen->myNum]; - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.width = pRoot->drawable.width; - rep.height = pRoot->drawable.height; - rep.window = stuff->window; - rep.screen = stuff->screen; - if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.width, n); - swapl(&rep.height, n); - swapl(&rep.window, n); - swapl(&rep.screen, n); - } - WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); - return client->noClientException; -} - -int -ProcRRXineramaIsActive(ClientPtr client) -{ - xXineramaIsActiveReply rep; - - REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.state = RRXineramaScreenActive (screenInfo.screens[RR_XINERAMA_SCREEN]); - if(client->swapped) { - register int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.state, n); - } - WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); - return client->noClientException; -} - -int -ProcRRXineramaQueryScreens(ClientPtr client) -{ - xXineramaQueryScreensReply rep; - ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN]; - - REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); - - if (RRXineramaScreenActive (pScreen)) - { - rrScrPriv(pScreen); - if (pScrPriv->numCrtcs == 0 || pScrPriv->numOutputs == 0) - RRGetInfo (pScreen); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.number = RRXineramaScreenCount (pScreen); - rep.length = rep.number * sz_XineramaScreenInfo >> 2; - if(client->swapped) { - register int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.number, n); - } - WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep); - - if(rep.number) { - rrScrPriv(pScreen); - xXineramaScreenInfo scratch; - int i; - - for(i = 0; i < pScrPriv->numCrtcs; i++) { - RRCrtcPtr crtc = pScrPriv->crtcs[i]; - if (RRXineramaCrtcActive (crtc)) - { - int width, height; - RRCrtcGetScanoutSize (crtc, &width, &height); - scratch.x_org = crtc->x; - scratch.y_org = crtc->y; - scratch.width = width; - scratch.height = height; - if(client->swapped) { - register int n; - swaps(&scratch.x_org, n); - swaps(&scratch.y_org, n); - swaps(&scratch.width, n); - swaps(&scratch.height, n); - } - WriteToClient(client, sz_XineramaScreenInfo, (char *)&scratch); - } - } - } - - return client->noClientException; -} - -static int -ProcRRXineramaDispatch(ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) { - case X_PanoramiXQueryVersion: - return ProcRRXineramaQueryVersion(client); - case X_PanoramiXGetState: - return ProcRRXineramaGetState(client); - case X_PanoramiXGetScreenCount: - return ProcRRXineramaGetScreenCount(client); - case X_PanoramiXGetScreenSize: - return ProcRRXineramaGetScreenSize(client); - case X_XineramaIsActive: - return ProcRRXineramaIsActive(client); - case X_XineramaQueryScreens: - return ProcRRXineramaQueryScreens(client); - } - return BadRequest; -} - -/* SProc */ - -static int -SProcRRXineramaQueryVersion (ClientPtr client) -{ - REQUEST(xPanoramiXQueryVersionReq); - register int n; - swaps(&stuff->length,n); - REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); - return ProcRRXineramaQueryVersion(client); -} - -static int -SProcRRXineramaGetState(ClientPtr client) -{ - REQUEST(xPanoramiXGetStateReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - swapl (&stuff->window, n); - return ProcRRXineramaGetState(client); -} - -static int -SProcRRXineramaGetScreenCount(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenCountReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - swapl (&stuff->window, n); - return ProcRRXineramaGetScreenCount(client); -} - -static int -SProcRRXineramaGetScreenSize(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenSizeReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - swapl (&stuff->window, n); - swapl (&stuff->screen, n); - return ProcRRXineramaGetScreenSize(client); -} - -static int -SProcRRXineramaIsActive(ClientPtr client) -{ - REQUEST(xXineramaIsActiveReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - return ProcRRXineramaIsActive(client); -} - -static int -SProcRRXineramaQueryScreens(ClientPtr client) -{ - REQUEST(xXineramaQueryScreensReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); - return ProcRRXineramaQueryScreens(client); -} - -int -SProcRRXineramaDispatch(ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) { - case X_PanoramiXQueryVersion: - return SProcRRXineramaQueryVersion(client); - case X_PanoramiXGetState: - return SProcRRXineramaGetState(client); - case X_PanoramiXGetScreenCount: - return SProcRRXineramaGetScreenCount(client); - case X_PanoramiXGetScreenSize: - return SProcRRXineramaGetScreenSize(client); - case X_XineramaIsActive: - return SProcRRXineramaIsActive(client); - case X_XineramaQueryScreens: - return SProcRRXineramaQueryScreens(client); - } - return BadRequest; -} - -static void -RRXineramaResetProc(ExtensionEntry* extEntry) -{ -} - -void -RRXineramaExtensionInit(void) -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return; -#endif - - /* - * Xinerama isn't capable enough to have multiple protocol screens each - * with their own output geometry. So if there's more than one protocol - * screen, just don't even try. - */ - if (screenInfo.numScreens > 1) - return; - - (void) AddExtension(PANORAMIX_PROTOCOL_NAME, 0,0, - ProcRRXineramaDispatch, - SProcRRXineramaDispatch, - RRXineramaResetProc, - StandardMinorOpcode); -} diff --git a/nx-X11/programs/Xserver/randr/rrxinerama.c.X.original b/nx-X11/programs/Xserver/randr/rrxinerama.c.X.original deleted file mode 100644 index e6acd5e57..000000000 --- a/nx-X11/programs/Xserver/randr/rrxinerama.c.X.original +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright © 2006 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ -/* - * This Xinerama implementation comes from the SiS driver which has - * the following notice: - */ -/* - * SiS driver main code - * - * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1) Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2) Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3) The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Thomas Winischhofer - * - driver entirely rewritten since 2001, only basic structure taken from - * old code (except sis_dri.c, sis_shadow.c, sis_accel.c and parts of - * sis_dga.c; these were mostly taken over; sis_dri.c was changed for - * new versions of the DRI layer) - * - * This notice covers the entire driver code unless indicated otherwise. - * - * Formerly based on code which was - * Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England. - * Written by: - * Alan Hourihane , - * Mike Chapman , - * Juanjo Santamarta , - * Mitani Hiroshi , - * David Thomas . - */ - -#include "randrstr.h" -#include "swaprep.h" -#include - -#define RR_XINERAMA_MAJOR_VERSION 1 -#define RR_XINERAMA_MINOR_VERSION 1 - -/* Xinerama is not multi-screen capable; just report about screen 0 */ -#define RR_XINERAMA_SCREEN 0 - -static int ProcRRXineramaQueryVersion(ClientPtr client); -static int ProcRRXineramaGetState(ClientPtr client); -static int ProcRRXineramaGetScreenCount(ClientPtr client); -static int ProcRRXineramaGetScreenSize(ClientPtr client); -static int ProcRRXineramaIsActive(ClientPtr client); -static int ProcRRXineramaQueryScreens(ClientPtr client); -static int SProcRRXineramaDispatch(ClientPtr client); - -/* Proc */ - -int -ProcRRXineramaQueryVersion(ClientPtr client) -{ - xPanoramiXQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RR_XINERAMA_MAJOR_VERSION; - rep.minorVersion = RR_XINERAMA_MINOR_VERSION; - if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -int -ProcRRXineramaGetState(ClientPtr client) -{ - REQUEST(xPanoramiXGetStateReq); - WindowPtr pWin; - xPanoramiXGetStateReply rep; - register int n, rc; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - Bool active = FALSE; - - REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - if(rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - if (pScrPriv) - { - /* XXX do we need more than this? */ - active = TRUE; - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.state = active; - rep.window = stuff->window; - if(client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swapl (&rep.window, n); - } - WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); - return client->noClientException; -} - -static Bool -RRXineramaCrtcActive (RRCrtcPtr crtc) -{ - return crtc->mode != NULL && crtc->numOutputs > 0; -} - -static int -RRXineramaScreenCount (ScreenPtr pScreen) -{ - int i, n; - - n = 0; - if (rrGetScrPriv (pScreen)) - { - rrScrPriv(pScreen); - for (i = 0; i < pScrPriv->numCrtcs; i++) - if (RRXineramaCrtcActive (pScrPriv->crtcs[i])) - n++; - } - return n; -} - -static Bool -RRXineramaScreenActive (ScreenPtr pScreen) -{ - return RRXineramaScreenCount (pScreen) > 0; -} - -int -ProcRRXineramaGetScreenCount(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenCountReq); - WindowPtr pWin; - xPanoramiXGetScreenCountReply rep; - register int n, rc; - - REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - if (rc != Success) - return rc; - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.ScreenCount = RRXineramaScreenCount (pWin->drawable.pScreen); - rep.window = stuff->window; - if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.window, n); - } - WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); - return client->noClientException; -} - -int -ProcRRXineramaGetScreenSize(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenSizeReq); - WindowPtr pWin, pRoot; - ScreenPtr pScreen; - xPanoramiXGetScreenSizeReply rep; - register int n, rc; - - REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - if (rc != Success) - return rc; - - pScreen = pWin->drawable.pScreen; - pRoot = WindowTable[pScreen->myNum]; - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.width = pRoot->drawable.width; - rep.height = pRoot->drawable.height; - rep.window = stuff->window; - rep.screen = stuff->screen; - if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.width, n); - swapl(&rep.height, n); - swapl(&rep.window, n); - swapl(&rep.screen, n); - } - WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); - return client->noClientException; -} - -int -ProcRRXineramaIsActive(ClientPtr client) -{ - xXineramaIsActiveReply rep; - - REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.state = RRXineramaScreenActive (screenInfo.screens[RR_XINERAMA_SCREEN]); - if(client->swapped) { - register int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.state, n); - } - WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); - return client->noClientException; -} - -int -ProcRRXineramaQueryScreens(ClientPtr client) -{ - xXineramaQueryScreensReply rep; - ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN]; - - REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); - - if (RRXineramaScreenActive (pScreen)) - { - rrScrPriv(pScreen); - if (pScrPriv->numCrtcs == 0 || pScrPriv->numOutputs == 0) - RRGetInfo (pScreen); - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.number = RRXineramaScreenCount (pScreen); - rep.length = rep.number * sz_XineramaScreenInfo >> 2; - if(client->swapped) { - register int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.number, n); - } - WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep); - - if(rep.number) { - rrScrPriv(pScreen); - xXineramaScreenInfo scratch; - int i; - - for(i = 0; i < pScrPriv->numCrtcs; i++) { - RRCrtcPtr crtc = pScrPriv->crtcs[i]; - if (RRXineramaCrtcActive (crtc)) - { - int width, height; - RRCrtcGetScanoutSize (crtc, &width, &height); - scratch.x_org = crtc->x; - scratch.y_org = crtc->y; - scratch.width = width; - scratch.height = height; - if(client->swapped) { - register int n; - swaps(&scratch.x_org, n); - swaps(&scratch.y_org, n); - swaps(&scratch.width, n); - swaps(&scratch.height, n); - } - WriteToClient(client, sz_XineramaScreenInfo, (char *)&scratch); - } - } - } - - return client->noClientException; -} - -static int -ProcRRXineramaDispatch(ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) { - case X_PanoramiXQueryVersion: - return ProcRRXineramaQueryVersion(client); - case X_PanoramiXGetState: - return ProcRRXineramaGetState(client); - case X_PanoramiXGetScreenCount: - return ProcRRXineramaGetScreenCount(client); - case X_PanoramiXGetScreenSize: - return ProcRRXineramaGetScreenSize(client); - case X_XineramaIsActive: - return ProcRRXineramaIsActive(client); - case X_XineramaQueryScreens: - return ProcRRXineramaQueryScreens(client); - } - return BadRequest; -} - -/* SProc */ - -static int -SProcRRXineramaQueryVersion (ClientPtr client) -{ - REQUEST(xPanoramiXQueryVersionReq); - register int n; - swaps(&stuff->length,n); - REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); - return ProcRRXineramaQueryVersion(client); -} - -static int -SProcRRXineramaGetState(ClientPtr client) -{ - REQUEST(xPanoramiXGetStateReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - swapl (&stuff->window, n); - return ProcRRXineramaGetState(client); -} - -static int -SProcRRXineramaGetScreenCount(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenCountReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - swapl (&stuff->window, n); - return ProcRRXineramaGetScreenCount(client); -} - -static int -SProcRRXineramaGetScreenSize(ClientPtr client) -{ - REQUEST(xPanoramiXGetScreenSizeReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - swapl (&stuff->window, n); - swapl (&stuff->screen, n); - return ProcRRXineramaGetScreenSize(client); -} - -static int -SProcRRXineramaIsActive(ClientPtr client) -{ - REQUEST(xXineramaIsActiveReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - return ProcRRXineramaIsActive(client); -} - -static int -SProcRRXineramaQueryScreens(ClientPtr client) -{ - REQUEST(xXineramaQueryScreensReq); - register int n; - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); - return ProcRRXineramaQueryScreens(client); -} - -int -SProcRRXineramaDispatch(ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) { - case X_PanoramiXQueryVersion: - return SProcRRXineramaQueryVersion(client); - case X_PanoramiXGetState: - return SProcRRXineramaGetState(client); - case X_PanoramiXGetScreenCount: - return SProcRRXineramaGetScreenCount(client); - case X_PanoramiXGetScreenSize: - return SProcRRXineramaGetScreenSize(client); - case X_XineramaIsActive: - return SProcRRXineramaIsActive(client); - case X_XineramaQueryScreens: - return SProcRRXineramaQueryScreens(client); - } - return BadRequest; -} - -static void -RRXineramaResetProc(ExtensionEntry* extEntry) -{ -} - -void -RRXineramaExtensionInit(void) -{ -#ifdef PANORAMIX - if(!noPanoramiXExtension) - return; -#endif - - /* - * Xinerama isn't capable enough to have multiple protocol screens each - * with their own output geometry. So if there's more than one protocol - * screen, just don't even try. - */ - if (screenInfo.numScreens > 1) - return; - - (void) AddExtension(PANORAMIX_PROTOCOL_NAME, 0,0, - ProcRRXineramaDispatch, - SProcRRXineramaDispatch, - RRXineramaResetProc, - StandardMinorOpcode); -} diff --git a/nx-X11/programs/Xserver/render/renderedge.c.NX.original b/nx-X11/programs/Xserver/render/renderedge.c.NX.original deleted file mode 100644 index f095038e5..000000000 --- a/nx-X11/programs/Xserver/render/renderedge.c.NX.original +++ /dev/null @@ -1,202 +0,0 @@ -/* - * $Id: renderedge.c,v 1.4 2005/07/03 07:02:08 daniels Exp $ - * - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "renderedge.h" - -/* - * Compute the smallest value no less than y which is on a - * grid row - */ - -xFixed -RenderSampleCeilY (xFixed y, int n) -{ - xFixed f = xFixedFrac(y); - xFixed i = xFixedFloor(y); - - f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); - if (f > Y_FRAC_LAST(n)) - { - f = Y_FRAC_FIRST(n); - i += xFixed1; - } - return (i | f); -} - -#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b))) - -/* - * Compute the largest value no greater than y which is on a - * grid row - */ -xFixed -RenderSampleFloorY (xFixed y, int n) -{ - xFixed f = xFixedFrac(y); - xFixed i = xFixedFloor (y); - - f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); - if (f < Y_FRAC_FIRST(n)) - { - f = Y_FRAC_LAST(n); - i -= xFixed1; - } - return (i | f); -} - -/* - * Step an edge by any amount (including negative values) - */ -void -RenderEdgeStep (RenderEdge *e, int n) -{ - xFixed_48_16 ne; - - e->x += n * e->stepx; - - ne = e->e + n * (xFixed_48_16) e->dx; - - if (n >= 0) - { - if (ne > 0) - { - int nx = (ne + e->dy - 1) / e->dy; - e->e = ne - nx * (xFixed_48_16) e->dy; - e->x += nx * e->signdx; - } - } - else - { - if (ne <= -e->dy) - { - int nx = (-ne) / e->dy; - e->e = ne + nx * (xFixed_48_16) e->dy; - e->x -= nx * e->signdx; - } - } -} - -/* - * A private routine to initialize the multi-step - * elements of an edge structure - */ -static void -_RenderEdgeMultiInit (RenderEdge *e, int n, xFixed *stepx_p, xFixed *dx_p) -{ - xFixed stepx; - xFixed_48_16 ne; - - ne = n * (xFixed_48_16) e->dx; - stepx = n * e->stepx; - if (ne > 0) - { - int nx = ne / e->dy; - ne -= nx * e->dy; - stepx += nx * e->signdx; - } - *dx_p = ne; - *stepx_p = stepx; -} - -/* - * Initialize one edge structure given the line endpoints and a - * starting y value - */ -void -RenderEdgeInit (RenderEdge *e, - int n, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot) -{ - xFixed dx, dy; - - e->x = x_top; - e->e = 0; - dx = x_bot - x_top; - dy = y_bot - y_top; - e->dy = dy; - e->dx = 0; - if (dy) - { - if (dx >= 0) - { - e->signdx = 1; - e->stepx = dx / dy; - e->dx = dx % dy; - e->e = -dy; - } - else - { - e->signdx = -1; - e->stepx = -(-dx / dy); - e->dx = -dx % dy; - e->e = 0; - } - - _RenderEdgeMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small); - _RenderEdgeMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big); - } - RenderEdgeStep (e, y_start - y_top); -} - -/* - * Initialize one edge structure given a line, starting y value - * and a pixel offset for the line - */ -void -RenderLineFixedEdgeInit (RenderEdge *e, - int n, - xFixed y, - xLineFixed *line, - int x_off, - int y_off) -{ - xFixed x_off_fixed = IntToxFixed(x_off); - xFixed y_off_fixed = IntToxFixed(y_off); - xPointFixed *top, *bot; - - if (line->p1.y <= line->p2.y) - { - top = &line->p1; - bot = &line->p2; - } - else - { - top = &line->p2; - bot = &line->p1; - } - RenderEdgeInit (e, n, y, - top->x + x_off_fixed, - top->y + y_off_fixed, - bot->x + x_off_fixed, - bot->y + y_off_fixed); -} - diff --git a/nx-X11/programs/Xserver/render/renderedge.c.X.original b/nx-X11/programs/Xserver/render/renderedge.c.X.original deleted file mode 100644 index b4031944d..000000000 --- a/nx-X11/programs/Xserver/render/renderedge.c.X.original +++ /dev/null @@ -1,201 +0,0 @@ -/* - * $Id: renderedge.c,v 1.4 2005/07/03 07:02:08 daniels Exp $ - * - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "renderedge.h" - -/* - * Compute the smallest value no less than y which is on a - * grid row - */ - -xFixed -RenderSampleCeilY (xFixed y, int n) -{ - xFixed f = xFixedFrac(y); - xFixed i = xFixedFloor(y); - - f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); - if (f > Y_FRAC_LAST(n)) - { - f = Y_FRAC_FIRST(n); - i += xFixed1; - } - return (i | f); -} - -#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b))) - -/* - * Compute the largest value no greater than y which is on a - * grid row - */ -xFixed -RenderSampleFloorY (xFixed y, int n) -{ - xFixed f = xFixedFrac(y); - xFixed i = xFixedFloor (y); - - f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); - if (f < Y_FRAC_FIRST(n)) - { - f = Y_FRAC_LAST(n); - i -= xFixed1; - } - return (i | f); -} - -/* - * Step an edge by any amount (including negative values) - */ -void -RenderEdgeStep (RenderEdge *e, int n) -{ - xFixed_48_16 ne; - - e->x += n * e->stepx; - - ne = e->e + n * (xFixed_48_16) e->dx; - - if (n >= 0) - { - if (ne > 0) - { - int nx = (ne + e->dy - 1) / e->dy; - e->e = ne - nx * (xFixed_48_16) e->dy; - e->x += nx * e->signdx; - } - } - else - { - if (ne <= -e->dy) - { - int nx = (-ne) / e->dy; - e->e = ne + nx * (xFixed_48_16) e->dy; - e->x -= nx * e->signdx; - } - } -} - -/* - * A private routine to initialize the multi-step - * elements of an edge structure - */ -static void -_RenderEdgeMultiInit (RenderEdge *e, int n, xFixed *stepx_p, xFixed *dx_p) -{ - xFixed stepx; - xFixed_48_16 ne; - - ne = n * (xFixed_48_16) e->dx; - stepx = n * e->stepx; - if (ne > 0) - { - int nx = ne / e->dy; - ne -= nx * e->dy; - stepx += nx * e->signdx; - } - *dx_p = ne; - *stepx_p = stepx; -} - -/* - * Initialize one edge structure given the line endpoints and a - * starting y value - */ -void -RenderEdgeInit (RenderEdge *e, - int n, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot) -{ - xFixed dx, dy; - - e->x = x_top; - e->e = 0; - dx = x_bot - x_top; - dy = y_bot - y_top; - e->dy = dy; - if (dy) - { - if (dx >= 0) - { - e->signdx = 1; - e->stepx = dx / dy; - e->dx = dx % dy; - e->e = -dy; - } - else - { - e->signdx = -1; - e->stepx = -(-dx / dy); - e->dx = -dx % dy; - e->e = 0; - } - - _RenderEdgeMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small); - _RenderEdgeMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big); - } - RenderEdgeStep (e, y_start - y_top); -} - -/* - * Initialize one edge structure given a line, starting y value - * and a pixel offset for the line - */ -void -RenderLineFixedEdgeInit (RenderEdge *e, - int n, - xFixed y, - xLineFixed *line, - int x_off, - int y_off) -{ - xFixed x_off_fixed = IntToxFixed(x_off); - xFixed y_off_fixed = IntToxFixed(y_off); - xPointFixed *top, *bot; - - if (line->p1.y <= line->p2.y) - { - top = &line->p1; - bot = &line->p2; - } - else - { - top = &line->p2; - bot = &line->p1; - } - RenderEdgeInit (e, n, y, - top->x + x_off_fixed, - top->y + y_off_fixed, - bot->x + x_off_fixed, - bot->y + y_off_fixed); -} - diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c.NX.original b/nx-X11/programs/Xserver/xfixes/cursor.c.NX.original deleted file mode 100755 index f6895d193..000000000 --- a/nx-X11/programs/Xserver/xfixes/cursor.c.NX.original +++ /dev/null @@ -1,754 +0,0 @@ -/* - * $Id: cursor.c,v 1.6 2005/07/03 07:37:35 daniels Exp $ - * - * Copyright © 2002 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "xfixesint.h" -#include "scrnintstr.h" -#include "cursorstr.h" -#include "dixevents.h" -#include "servermd.h" -#include "inputstr.h" -#include "windowstr.h" - -static RESTYPE CursorClientType; -static RESTYPE CursorWindowType; -static int CursorScreenPrivateIndex = -1; -static int CursorGeneration; -static CursorPtr CursorCurrent; - -#define VERIFY_CURSOR(pCursor, cursor, client, access) { \ - pCursor = (CursorPtr)SecurityLookupIDByType((client), (cursor), \ - RT_CURSOR, (access)); \ - if (!pCursor) { \ - (client)->errorValue = (cursor); \ - return BadCursor; \ - } \ -} - -/* - * There is a global list of windows selecting for cursor events - */ - -typedef struct _CursorEvent *CursorEventPtr; - -typedef struct _CursorEvent { - CursorEventPtr next; - CARD32 eventMask; - ClientPtr pClient; - WindowPtr pWindow; - XID clientResource; -} CursorEventRec; - -static CursorEventPtr cursorEvents; - -/* - * Wrap DisplayCursor to catch cursor change events - */ - -typedef struct _CursorScreen { - DisplayCursorProcPtr DisplayCursor; - CloseScreenProcPtr CloseScreen; -} CursorScreenRec, *CursorScreenPtr; - -#define GetCursorScreen(s) ((CursorScreenPtr) ((s)->devPrivates[CursorScreenPrivateIndex].ptr)) -#define GetCursorScreenIfSet(s) ((CursorScreenPrivateIndex != -1) ? GetCursorScreen(s) : NULL) -#define SetCursorScreen(s,p) ((s)->devPrivates[CursorScreenPrivateIndex].ptr = (pointer) (p)) -#define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) -#define Unwrap(as,s,elt) ((s)->elt = (as)->elt) - -static Bool -CursorDisplayCursor (ScreenPtr pScreen, - CursorPtr pCursor) -{ - CursorScreenPtr cs = GetCursorScreen(pScreen); - Bool ret; - - Unwrap (cs, pScreen, DisplayCursor); - ret = (*pScreen->DisplayCursor) (pScreen, pCursor); - if (pCursor != CursorCurrent) - { - CursorEventPtr e; - - CursorCurrent = pCursor; - for (e = cursorEvents; e; e = e->next) - { - if ((e->eventMask & XFixesDisplayCursorNotifyMask) && - !e->pClient->clientGone) - { - xXFixesCursorNotifyEvent ev; - ev.type = XFixesEventBase + XFixesCursorNotify; - ev.subtype = XFixesDisplayCursorNotify; - ev.sequenceNumber = e->pClient->sequence; - ev.window = e->pWindow->drawable.id; - ev.cursorSerial = pCursor->serialNumber; - ev.timestamp = currentTime.milliseconds; - ev.name = pCursor->name; - WriteEventsToClient (e->pClient, 1, (xEvent *) &ev); - } - } - } - Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor); - return ret; -} - -static Bool -CursorCloseScreen (int index, ScreenPtr pScreen) -{ - CursorScreenPtr cs = GetCursorScreen (pScreen); - Bool ret; - - Unwrap (cs, pScreen, CloseScreen); - Unwrap (cs, pScreen, DisplayCursor); - ret = (*pScreen->CloseScreen) (index, pScreen); - xfree (cs); - if (index == 0) - CursorScreenPrivateIndex = -1; - return ret; -} - -#define CursorAllEvents (XFixesDisplayCursorNotifyMask) - -static int -XFixesSelectCursorInput (ClientPtr pClient, - WindowPtr pWindow, - CARD32 eventMask) -{ - CursorEventPtr *prev, e; - - for (prev = &cursorEvents; (e = *prev); prev = &e->next) - { - if (e->pClient == pClient && - e->pWindow == pWindow) - { - break; - } - } - if (!eventMask) - { - if (e) - { - FreeResource (e->clientResource, 0); - } - return Success; - } - if (!e) - { - e = (CursorEventPtr) xalloc (sizeof (CursorEventRec)); - if (!e) - return BadAlloc; - - e->next = 0; - e->pClient = pClient; - e->pWindow = pWindow; - e->clientResource = FakeClientID(pClient->index); - - /* - * Add a resource hanging from the window to - * catch window destroy - */ - if (!LookupIDByType(pWindow->drawable.id, CursorWindowType)) - if (!AddResource (pWindow->drawable.id, CursorWindowType, - (pointer) pWindow)) - { - xfree (e); - return BadAlloc; - } - - if (!AddResource (e->clientResource, CursorClientType, (pointer) e)) - return BadAlloc; - - *prev = e; - } - e->eventMask = eventMask; - return Success; -} - -int -ProcXFixesSelectCursorInput (ClientPtr client) -{ - REQUEST (xXFixesSelectCursorInputReq); - WindowPtr pWin; - - REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - if (stuff->eventMask & ~CursorAllEvents) - { - client->errorValue = stuff->eventMask; - return( BadValue ); - } - return XFixesSelectCursorInput (client, pWin, stuff->eventMask); -} - -static int -GetBit (unsigned char *line, int x) -{ - unsigned char mask; - - if (screenInfo.bitmapBitOrder == LSBFirst) - mask = (1 << (x & 7)); - else - mask = (0x80 >> (x & 7)); - /* XXX assumes byte order is host byte order */ - line += (x >> 3); - if (*line & mask) - return 1; - return 0; -} - -int -SProcXFixesSelectCursorInput (ClientPtr client) -{ - register int n; - REQUEST(xXFixesSelectCursorInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swapl(&stuff->eventMask, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -void -SXFixesCursorNotifyEvent (xXFixesCursorNotifyEvent *from, - xXFixesCursorNotifyEvent *to) -{ - to->type = from->type; - cpswaps (from->sequenceNumber, to->sequenceNumber); - cpswapl (from->window, to->window); - cpswapl (from->cursorSerial, to->cursorSerial); - cpswapl (from->timestamp, to->timestamp); - cpswapl (from->name, to->name); -} - -static void -CopyCursorToImage (CursorPtr pCursor, CARD32 *image) -{ - int width = pCursor->bits->width; - int height = pCursor->bits->height; - int npixels = width * height; - -#ifdef ARGB_CURSOR - if (pCursor->bits->argb) - memcpy (image, pCursor->bits->argb, npixels * sizeof (CARD32)); - else -#endif - { - unsigned char *srcLine = pCursor->bits->source; - unsigned char *mskLine = pCursor->bits->mask; - int stride = BitmapBytePad (width); - int x, y; - CARD32 fg, bg; - - fg = (0xff000000 | - ((pCursor->foreRed & 0xff00) << 8) | - (pCursor->foreGreen & 0xff00) | - (pCursor->foreBlue >> 8)); - bg = (0xff000000 | - ((pCursor->backRed & 0xff00) << 8) | - (pCursor->backGreen & 0xff00) | - (pCursor->backBlue >> 8)); - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - if (GetBit (mskLine, x)) - { - if (GetBit (srcLine, x)) - *image++ = fg; - else - *image++ = bg; - } - else - *image++ = 0; - } - srcLine += stride; - mskLine += stride; - } - } -} - -int -ProcXFixesGetCursorImage (ClientPtr client) -{ -/* REQUEST(xXFixesGetCursorImageReq); */ - xXFixesGetCursorImageReply *rep; - CursorPtr pCursor; - CARD32 *image; - int npixels; - int width, height; - int x, y; - - REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq); - pCursor = CursorCurrent; - if (!pCursor) - return BadCursor; - GetSpritePosition (&x, &y); - width = pCursor->bits->width; - height = pCursor->bits->height; - npixels = width * height; - rep = xalloc (sizeof (xXFixesGetCursorImageReply) + - npixels * sizeof (CARD32)); - if (!rep) - return BadAlloc; - - rep->type = X_Reply; - rep->sequenceNumber = client->sequence; - rep->length = npixels; - rep->width = width; - rep->height = height; - rep->x = x; - rep->y = y; - rep->xhot = pCursor->bits->xhot; - rep->yhot = pCursor->bits->yhot; - rep->cursorSerial = pCursor->serialNumber; - - image = (CARD32 *) (rep + 1); - CopyCursorToImage (pCursor, image); - if (client->swapped) - { - int n; - swaps (&rep->sequenceNumber, n); - swapl (&rep->length, n); - swaps (&rep->x, n); - swaps (&rep->y, n); - swaps (&rep->width, n); - swaps (&rep->height, n); - swaps (&rep->xhot, n); - swaps (&rep->yhot, n); - swapl (&rep->cursorSerial, n); - SwapLongs (image, npixels); - } - (void) WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + - (npixels << 2), (char *) rep); - xfree (rep); - return client->noClientException; -} - -int -SProcXFixesGetCursorImage (ClientPtr client) -{ - int n; - REQUEST(xXFixesGetCursorImageReq); - swaps (&stuff->length, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -int -ProcXFixesSetCursorName (ClientPtr client) -{ - CursorPtr pCursor; - char *tchar; - REQUEST(xXFixesSetCursorNameReq); - Atom atom; - - REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); - VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityWriteAccess); - tchar = (char *) &stuff[1]; - atom = MakeAtom (tchar, stuff->nbytes, TRUE); - if (atom == BAD_RESOURCE) - return BadAlloc; - - pCursor->name = atom; - return(client->noClientException); -} - -int -SProcXFixesSetCursorName (ClientPtr client) -{ - int n; - REQUEST(xXFixesSetCursorNameReq); - - swaps (&stuff->length, n); - REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); - swapl (&stuff->cursor, n); - swaps (&stuff->nbytes, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -int -ProcXFixesGetCursorName (ClientPtr client) -{ - CursorPtr pCursor; - xXFixesGetCursorNameReply reply; - REQUEST(xXFixesGetCursorNameReq); - char *str; - int len; - - REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); - VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityReadAccess); - if (pCursor->name) - str = NameForAtom (pCursor->name); - else - str = ""; - len = strlen (str); - - reply.type = X_Reply; - reply.length = (len + 3) >> 2; - reply.sequenceNumber = client->sequence; - reply.atom = pCursor->name; - reply.nbytes = len; - if (client->swapped) - { - int n; - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swapl (&reply.atom, n); - swaps (&reply.nbytes, n); - } - WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply); - (void)WriteToClient(client, len, str); - - return(client->noClientException); -} - -int -SProcXFixesGetCursorName (ClientPtr client) -{ - int n; - REQUEST(xXFixesSetCursorNameReq); - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); - swapl (&stuff->cursor, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -int -ProcXFixesGetCursorImageAndName (ClientPtr client) -{ -/* REQUEST(xXFixesGetCursorImageAndNameReq); */ - xXFixesGetCursorImageAndNameReply *rep; - CursorPtr pCursor; - CARD32 *image; - int npixels; - char *name; - int nbytes, nbytesRound; - int width, height; - int x, y; - - REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq); - pCursor = CursorCurrent; - if (!pCursor) - return BadCursor; - GetSpritePosition (&x, &y); - width = pCursor->bits->width; - height = pCursor->bits->height; - npixels = width * height; - name = pCursor->name ? NameForAtom (pCursor->name) : ""; - nbytes = strlen (name); - nbytesRound = (nbytes + 3) & ~3; - rep = xalloc (sizeof (xXFixesGetCursorImageAndNameReply) + - npixels * sizeof (CARD32) + nbytesRound); - if (!rep) - return BadAlloc; - - rep->type = X_Reply; - rep->sequenceNumber = client->sequence; - rep->length = npixels + (nbytesRound >> 2); - rep->width = width; - rep->height = height; - rep->x = x; - rep->y = y; - rep->xhot = pCursor->bits->xhot; - rep->yhot = pCursor->bits->yhot; - rep->cursorSerial = pCursor->serialNumber; - rep->cursorName = pCursor->name; - rep->nbytes = nbytes; - - image = (CARD32 *) (rep + 1); - CopyCursorToImage (pCursor, image); - memcpy ((image + npixels), name, nbytes); - if (client->swapped) - { - int n; - swaps (&rep->sequenceNumber, n); - swapl (&rep->length, n); - swaps (&rep->x, n); - swaps (&rep->y, n); - swaps (&rep->width, n); - swaps (&rep->height, n); - swaps (&rep->xhot, n); - swaps (&rep->yhot, n); - swapl (&rep->cursorSerial, n); - swapl (&rep->cursorName, n); - swaps (&rep->nbytes, n); - SwapLongs (image, npixels); - } - (void) WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + - (npixels << 2) + nbytesRound, (char *) rep); - xfree (rep); - return client->noClientException; -} - -int -SProcXFixesGetCursorImageAndName (ClientPtr client) -{ - int n; - REQUEST(xXFixesGetCursorImageAndNameReq); - swaps (&stuff->length, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -/* - * Find every cursor reference in the system, ask testCursor - * whether it should be replaced with a reference to pCursor. - */ - -typedef Bool (*TestCursorFunc) (CursorPtr pOld, pointer closure); - -typedef struct { - RESTYPE type; - TestCursorFunc testCursor; - CursorPtr pNew; - pointer closure; -} ReplaceCursorLookupRec, *ReplaceCursorLookupPtr; - -static const RESTYPE CursorRestypes[] = { - RT_WINDOW, RT_PASSIVEGRAB, RT_CURSOR -}; - -#define NUM_CURSOR_RESTYPES (sizeof (CursorRestypes) / sizeof (CursorRestypes[0])) - -static Bool -ReplaceCursorLookup (pointer value, XID id, pointer closure) -{ - ReplaceCursorLookupPtr rcl = (ReplaceCursorLookupPtr) closure; - WindowPtr pWin; - GrabPtr pGrab; - CursorPtr pCursor = 0, *pCursorRef = 0; - XID cursor = 0; - - switch (rcl->type) { - case RT_WINDOW: - pWin = (WindowPtr) value; - if (pWin->optional) - { - pCursorRef = &pWin->optional->cursor; - pCursor = *pCursorRef; - } - break; - case RT_PASSIVEGRAB: - pGrab = (GrabPtr) value; - pCursorRef = &pGrab->cursor; - pCursor = *pCursorRef; - break; - case RT_CURSOR: - pCursorRef = 0; - pCursor = (CursorPtr) value; - cursor = id; - break; - } - if (pCursor && pCursor != rcl->pNew) - { - if ((*rcl->testCursor) (pCursor, rcl->closure)) - { - rcl->pNew->refcnt++; - /* either redirect reference or update resource database */ - if (pCursorRef) - *pCursorRef = rcl->pNew; - else - ChangeResourceValue (id, RT_CURSOR, rcl->pNew); - FreeCursor (pCursor, cursor); - } - } - return FALSE; /* keep walking */ -} - -static void -ReplaceCursor (CursorPtr pCursor, - TestCursorFunc testCursor, - pointer closure) -{ - int clientIndex; - int resIndex; - ReplaceCursorLookupRec rcl; - - /* - * Cursors exist only in the resource database, windows and grabs. - * All of these are always pointed at by the resource database. Walk - * the whole thing looking for cursors - */ - rcl.testCursor = testCursor; - rcl.pNew = pCursor; - rcl.closure = closure; - - /* for each client */ - for (clientIndex = 0; clientIndex < currentMaxClients; clientIndex++) - { - if (!clients[clientIndex]) - continue; - for (resIndex = 0; resIndex < NUM_CURSOR_RESTYPES; resIndex++) - { - rcl.type = CursorRestypes[resIndex]; - /* - * This function walks the entire client resource database - */ - LookupClientResourceComplex (clients[clientIndex], - rcl.type, - ReplaceCursorLookup, - (pointer) &rcl); - } - } - /* this "knows" that WindowHasNewCursor doesn't depend on it's argument */ - WindowHasNewCursor (WindowTable[0]); -} - -static Bool -TestForCursor (CursorPtr pCursor, pointer closure) -{ - return (pCursor == (CursorPtr) closure); -} - -int -ProcXFixesChangeCursor (ClientPtr client) -{ - CursorPtr pSource, pDestination; - REQUEST(xXFixesChangeCursorReq); - - REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); - VERIFY_CURSOR (pSource, stuff->source, client, SecurityReadAccess); - VERIFY_CURSOR (pDestination, stuff->destination, client, SecurityWriteAccess); - - ReplaceCursor (pSource, TestForCursor, (pointer) pDestination); - return (client->noClientException); -} - -int -SProcXFixesChangeCursor (ClientPtr client) -{ - int n; - REQUEST(xXFixesChangeCursorReq); - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -static Bool -TestForCursorName (CursorPtr pCursor, pointer closure) -{ - return (pCursor->name == (Atom) closure); -} - -int -ProcXFixesChangeCursorByName (ClientPtr client) -{ - CursorPtr pSource; - Atom name; - char *tchar; - REQUEST(xXFixesChangeCursorByNameReq); - - REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes); - VERIFY_CURSOR(pSource, stuff->source, client, SecurityReadAccess); - tchar = (char *) &stuff[1]; - name = MakeAtom (tchar, stuff->nbytes, FALSE); - if (name) - ReplaceCursor (pSource, TestForCursorName, (pointer) name); - return (client->noClientException); -} - -int -SProcXFixesChangeCursorByName (ClientPtr client) -{ - int n; - REQUEST(xXFixesChangeCursorByNameReq); - - swaps (&stuff->length, n); - REQUEST_AT_LEAST_SIZE (xXFixesChangeCursorByNameReq); - swapl (&stuff->source, n); - swaps (&stuff->nbytes, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -static int -CursorFreeClient (pointer data, XID id) -{ - CursorEventPtr old = (CursorEventPtr) data; - CursorEventPtr *prev, e; - - for (prev = &cursorEvents; (e = *prev); prev = &e->next) - { - if (e == old) - { - *prev = e->next; - xfree (e); - break; - } - } - return 1; -} - -static int -CursorFreeWindow (pointer data, XID id) -{ - WindowPtr pWindow = (WindowPtr) data; - CursorEventPtr e, next; - - for (e = cursorEvents; e; e = next) - { - next = e->next; - if (e->pWindow == pWindow) - { - FreeResource (e->clientResource, 0); - } - } - return 1; -} - -Bool -XFixesCursorInit (void) -{ - int i; - - if (CursorGeneration != serverGeneration) - { - CursorScreenPrivateIndex = AllocateScreenPrivateIndex (); - if (CursorScreenPrivateIndex < 0) - return FALSE; - CursorGeneration = serverGeneration; - } - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - CursorScreenPtr cs; - - cs = (CursorScreenPtr) xalloc (sizeof (CursorScreenRec)); - if (!cs) - return FALSE; - Wrap (cs, pScreen, CloseScreen, CursorCloseScreen); - Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor); - SetCursorScreen (pScreen, cs); - } - CursorClientType = CreateNewResourceType(CursorFreeClient); - CursorWindowType = CreateNewResourceType(CursorFreeWindow); - return CursorClientType && CursorWindowType; -} - diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c.X.original b/nx-X11/programs/Xserver/xfixes/cursor.c.X.original deleted file mode 100755 index bcc1ab962..000000000 --- a/nx-X11/programs/Xserver/xfixes/cursor.c.X.original +++ /dev/null @@ -1,753 +0,0 @@ -/* - * $Id: cursor.c,v 1.6 2005/07/03 07:37:35 daniels Exp $ - * - * Copyright © 2002 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "xfixesint.h" -#include "scrnintstr.h" -#include "cursorstr.h" -#include "dixevents.h" -#include "servermd.h" -#include "inputstr.h" -#include "windowstr.h" - -static RESTYPE CursorClientType; -static RESTYPE CursorWindowType; -static int CursorScreenPrivateIndex = -1; -static int CursorGeneration; -static CursorPtr CursorCurrent; - -#define VERIFY_CURSOR(pCursor, cursor, client, access) { \ - pCursor = (CursorPtr)SecurityLookupIDByType((client), (cursor), \ - RT_CURSOR, (access)); \ - if (!pCursor) { \ - (client)->errorValue = (cursor); \ - return BadCursor; \ - } \ -} - -/* - * There is a global list of windows selecting for cursor events - */ - -typedef struct _CursorEvent *CursorEventPtr; - -typedef struct _CursorEvent { - CursorEventPtr next; - CARD32 eventMask; - ClientPtr pClient; - WindowPtr pWindow; - XID clientResource; -} CursorEventRec; - -static CursorEventPtr cursorEvents; - -/* - * Wrap DisplayCursor to catch cursor change events - */ - -typedef struct _CursorScreen { - DisplayCursorProcPtr DisplayCursor; - CloseScreenProcPtr CloseScreen; -} CursorScreenRec, *CursorScreenPtr; - -#define GetCursorScreen(s) ((CursorScreenPtr) ((s)->devPrivates[CursorScreenPrivateIndex].ptr)) -#define GetCursorScreenIfSet(s) ((CursorScreenPrivateIndex != -1) ? GetCursorScreen(s) : NULL) -#define SetCursorScreen(s,p) ((s)->devPrivates[CursorScreenPrivateIndex].ptr = (pointer) (p)) -#define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) -#define Unwrap(as,s,elt) ((s)->elt = (as)->elt) - -static Bool -CursorDisplayCursor (ScreenPtr pScreen, - CursorPtr pCursor) -{ - CursorScreenPtr cs = GetCursorScreen(pScreen); - Bool ret; - - Unwrap (cs, pScreen, DisplayCursor); - ret = (*pScreen->DisplayCursor) (pScreen, pCursor); - if (pCursor != CursorCurrent) - { - CursorEventPtr e; - - CursorCurrent = pCursor; - for (e = cursorEvents; e; e = e->next) - { - if (e->eventMask & XFixesDisplayCursorNotifyMask) - { - xXFixesCursorNotifyEvent ev; - ev.type = XFixesEventBase + XFixesCursorNotify; - ev.subtype = XFixesDisplayCursorNotify; - ev.sequenceNumber = e->pClient->sequence; - ev.window = e->pWindow->drawable.id; - ev.cursorSerial = pCursor->serialNumber; - ev.timestamp = currentTime.milliseconds; - ev.name = pCursor->name; - WriteEventsToClient (e->pClient, 1, (xEvent *) &ev); - } - } - } - Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor); - return ret; -} - -static Bool -CursorCloseScreen (int index, ScreenPtr pScreen) -{ - CursorScreenPtr cs = GetCursorScreen (pScreen); - Bool ret; - - Unwrap (cs, pScreen, CloseScreen); - Unwrap (cs, pScreen, DisplayCursor); - ret = (*pScreen->CloseScreen) (index, pScreen); - xfree (cs); - if (index == 0) - CursorScreenPrivateIndex = -1; - return ret; -} - -#define CursorAllEvents (XFixesDisplayCursorNotifyMask) - -static int -XFixesSelectCursorInput (ClientPtr pClient, - WindowPtr pWindow, - CARD32 eventMask) -{ - CursorEventPtr *prev, e; - - for (prev = &cursorEvents; (e = *prev); prev = &e->next) - { - if (e->pClient == pClient && - e->pWindow == pWindow) - { - break; - } - } - if (!eventMask) - { - if (e) - { - FreeResource (e->clientResource, 0); - } - return Success; - } - if (!e) - { - e = (CursorEventPtr) xalloc (sizeof (CursorEventRec)); - if (!e) - return BadAlloc; - - e->next = 0; - e->pClient = pClient; - e->pWindow = pWindow; - e->clientResource = FakeClientID(pClient->index); - - /* - * Add a resource hanging from the window to - * catch window destroy - */ - if (!LookupIDByType(pWindow->drawable.id, CursorWindowType)) - if (!AddResource (pWindow->drawable.id, CursorWindowType, - (pointer) pWindow)) - { - xfree (e); - return BadAlloc; - } - - if (!AddResource (e->clientResource, CursorClientType, (pointer) e)) - return BadAlloc; - - *prev = e; - } - e->eventMask = eventMask; - return Success; -} - -int -ProcXFixesSelectCursorInput (ClientPtr client) -{ - REQUEST (xXFixesSelectCursorInputReq); - WindowPtr pWin; - - REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - if (stuff->eventMask & ~CursorAllEvents) - { - client->errorValue = stuff->eventMask; - return( BadValue ); - } - return XFixesSelectCursorInput (client, pWin, stuff->eventMask); -} - -static int -GetBit (unsigned char *line, int x) -{ - unsigned char mask; - - if (screenInfo.bitmapBitOrder == LSBFirst) - mask = (1 << (x & 7)); - else - mask = (0x80 >> (x & 7)); - /* XXX assumes byte order is host byte order */ - line += (x >> 3); - if (*line & mask) - return 1; - return 0; -} - -int -SProcXFixesSelectCursorInput (ClientPtr client) -{ - register int n; - REQUEST(xXFixesSelectCursorInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swapl(&stuff->eventMask, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -void -SXFixesCursorNotifyEvent (xXFixesCursorNotifyEvent *from, - xXFixesCursorNotifyEvent *to) -{ - to->type = from->type; - cpswaps (from->sequenceNumber, to->sequenceNumber); - cpswapl (from->window, to->window); - cpswapl (from->cursorSerial, to->cursorSerial); - cpswapl (from->timestamp, to->timestamp); - cpswapl (from->name, to->name); -} - -static void -CopyCursorToImage (CursorPtr pCursor, CARD32 *image) -{ - int width = pCursor->bits->width; - int height = pCursor->bits->height; - int npixels = width * height; - -#ifdef ARGB_CURSOR - if (pCursor->bits->argb) - memcpy (image, pCursor->bits->argb, npixels * sizeof (CARD32)); - else -#endif - { - unsigned char *srcLine = pCursor->bits->source; - unsigned char *mskLine = pCursor->bits->mask; - int stride = BitmapBytePad (width); - int x, y; - CARD32 fg, bg; - - fg = (0xff000000 | - ((pCursor->foreRed & 0xff00) << 8) | - (pCursor->foreGreen & 0xff00) | - (pCursor->foreBlue >> 8)); - bg = (0xff000000 | - ((pCursor->backRed & 0xff00) << 8) | - (pCursor->backGreen & 0xff00) | - (pCursor->backBlue >> 8)); - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - if (GetBit (mskLine, x)) - { - if (GetBit (srcLine, x)) - *image++ = fg; - else - *image++ = bg; - } - else - *image++ = 0; - } - srcLine += stride; - mskLine += stride; - } - } -} - -int -ProcXFixesGetCursorImage (ClientPtr client) -{ -/* REQUEST(xXFixesGetCursorImageReq); */ - xXFixesGetCursorImageReply *rep; - CursorPtr pCursor; - CARD32 *image; - int npixels; - int width, height; - int x, y; - - REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq); - pCursor = CursorCurrent; - if (!pCursor) - return BadCursor; - GetSpritePosition (&x, &y); - width = pCursor->bits->width; - height = pCursor->bits->height; - npixels = width * height; - rep = xalloc (sizeof (xXFixesGetCursorImageReply) + - npixels * sizeof (CARD32)); - if (!rep) - return BadAlloc; - - rep->type = X_Reply; - rep->sequenceNumber = client->sequence; - rep->length = npixels; - rep->width = width; - rep->height = height; - rep->x = x; - rep->y = y; - rep->xhot = pCursor->bits->xhot; - rep->yhot = pCursor->bits->yhot; - rep->cursorSerial = pCursor->serialNumber; - - image = (CARD32 *) (rep + 1); - CopyCursorToImage (pCursor, image); - if (client->swapped) - { - int n; - swaps (&rep->sequenceNumber, n); - swapl (&rep->length, n); - swaps (&rep->x, n); - swaps (&rep->y, n); - swaps (&rep->width, n); - swaps (&rep->height, n); - swaps (&rep->xhot, n); - swaps (&rep->yhot, n); - swapl (&rep->cursorSerial, n); - SwapLongs (image, npixels); - } - (void) WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + - (npixels << 2), (char *) rep); - xfree (rep); - return client->noClientException; -} - -int -SProcXFixesGetCursorImage (ClientPtr client) -{ - int n; - REQUEST(xXFixesGetCursorImageReq); - swaps (&stuff->length, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -int -ProcXFixesSetCursorName (ClientPtr client) -{ - CursorPtr pCursor; - char *tchar; - REQUEST(xXFixesSetCursorNameReq); - Atom atom; - - REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); - VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityWriteAccess); - tchar = (char *) &stuff[1]; - atom = MakeAtom (tchar, stuff->nbytes, TRUE); - if (atom == BAD_RESOURCE) - return BadAlloc; - - pCursor->name = atom; - return(client->noClientException); -} - -int -SProcXFixesSetCursorName (ClientPtr client) -{ - int n; - REQUEST(xXFixesSetCursorNameReq); - - swaps (&stuff->length, n); - REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); - swapl (&stuff->cursor, n); - swaps (&stuff->nbytes, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -int -ProcXFixesGetCursorName (ClientPtr client) -{ - CursorPtr pCursor; - xXFixesGetCursorNameReply reply; - REQUEST(xXFixesGetCursorNameReq); - char *str; - int len; - - REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); - VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityReadAccess); - if (pCursor->name) - str = NameForAtom (pCursor->name); - else - str = ""; - len = strlen (str); - - reply.type = X_Reply; - reply.length = (len + 3) >> 2; - reply.sequenceNumber = client->sequence; - reply.atom = pCursor->name; - reply.nbytes = len; - if (client->swapped) - { - int n; - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swapl (&reply.atom, n); - swaps (&reply.nbytes, n); - } - WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply); - (void)WriteToClient(client, len, str); - - return(client->noClientException); -} - -int -SProcXFixesGetCursorName (ClientPtr client) -{ - int n; - REQUEST(xXFixesSetCursorNameReq); - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); - swapl (&stuff->cursor, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -int -ProcXFixesGetCursorImageAndName (ClientPtr client) -{ -/* REQUEST(xXFixesGetCursorImageAndNameReq); */ - xXFixesGetCursorImageAndNameReply *rep; - CursorPtr pCursor; - CARD32 *image; - int npixels; - char *name; - int nbytes, nbytesRound; - int width, height; - int x, y; - - REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq); - pCursor = CursorCurrent; - if (!pCursor) - return BadCursor; - GetSpritePosition (&x, &y); - width = pCursor->bits->width; - height = pCursor->bits->height; - npixels = width * height; - name = pCursor->name ? NameForAtom (pCursor->name) : ""; - nbytes = strlen (name); - nbytesRound = (nbytes + 3) & ~3; - rep = xalloc (sizeof (xXFixesGetCursorImageAndNameReply) + - npixels * sizeof (CARD32) + nbytesRound); - if (!rep) - return BadAlloc; - - rep->type = X_Reply; - rep->sequenceNumber = client->sequence; - rep->length = npixels + (nbytesRound >> 2); - rep->width = width; - rep->height = height; - rep->x = x; - rep->y = y; - rep->xhot = pCursor->bits->xhot; - rep->yhot = pCursor->bits->yhot; - rep->cursorSerial = pCursor->serialNumber; - rep->cursorName = pCursor->name; - rep->nbytes = nbytes; - - image = (CARD32 *) (rep + 1); - CopyCursorToImage (pCursor, image); - memcpy ((image + npixels), name, nbytes); - if (client->swapped) - { - int n; - swaps (&rep->sequenceNumber, n); - swapl (&rep->length, n); - swaps (&rep->x, n); - swaps (&rep->y, n); - swaps (&rep->width, n); - swaps (&rep->height, n); - swaps (&rep->xhot, n); - swaps (&rep->yhot, n); - swapl (&rep->cursorSerial, n); - swapl (&rep->cursorName, n); - swaps (&rep->nbytes, n); - SwapLongs (image, npixels); - } - (void) WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + - (npixels << 2) + nbytesRound, (char *) rep); - xfree (rep); - return client->noClientException; -} - -int -SProcXFixesGetCursorImageAndName (ClientPtr client) -{ - int n; - REQUEST(xXFixesGetCursorImageAndNameReq); - swaps (&stuff->length, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -/* - * Find every cursor reference in the system, ask testCursor - * whether it should be replaced with a reference to pCursor. - */ - -typedef Bool (*TestCursorFunc) (CursorPtr pOld, pointer closure); - -typedef struct { - RESTYPE type; - TestCursorFunc testCursor; - CursorPtr pNew; - pointer closure; -} ReplaceCursorLookupRec, *ReplaceCursorLookupPtr; - -static const RESTYPE CursorRestypes[] = { - RT_WINDOW, RT_PASSIVEGRAB, RT_CURSOR -}; - -#define NUM_CURSOR_RESTYPES (sizeof (CursorRestypes) / sizeof (CursorRestypes[0])) - -static Bool -ReplaceCursorLookup (pointer value, XID id, pointer closure) -{ - ReplaceCursorLookupPtr rcl = (ReplaceCursorLookupPtr) closure; - WindowPtr pWin; - GrabPtr pGrab; - CursorPtr pCursor = 0, *pCursorRef = 0; - XID cursor = 0; - - switch (rcl->type) { - case RT_WINDOW: - pWin = (WindowPtr) value; - if (pWin->optional) - { - pCursorRef = &pWin->optional->cursor; - pCursor = *pCursorRef; - } - break; - case RT_PASSIVEGRAB: - pGrab = (GrabPtr) value; - pCursorRef = &pGrab->cursor; - pCursor = *pCursorRef; - break; - case RT_CURSOR: - pCursorRef = 0; - pCursor = (CursorPtr) value; - cursor = id; - break; - } - if (pCursor && pCursor != rcl->pNew) - { - if ((*rcl->testCursor) (pCursor, rcl->closure)) - { - rcl->pNew->refcnt++; - /* either redirect reference or update resource database */ - if (pCursorRef) - *pCursorRef = rcl->pNew; - else - ChangeResourceValue (id, RT_CURSOR, rcl->pNew); - FreeCursor (pCursor, cursor); - } - } - return FALSE; /* keep walking */ -} - -static void -ReplaceCursor (CursorPtr pCursor, - TestCursorFunc testCursor, - pointer closure) -{ - int clientIndex; - int resIndex; - ReplaceCursorLookupRec rcl; - - /* - * Cursors exist only in the resource database, windows and grabs. - * All of these are always pointed at by the resource database. Walk - * the whole thing looking for cursors - */ - rcl.testCursor = testCursor; - rcl.pNew = pCursor; - rcl.closure = closure; - - /* for each client */ - for (clientIndex = 0; clientIndex < currentMaxClients; clientIndex++) - { - if (!clients[clientIndex]) - continue; - for (resIndex = 0; resIndex < NUM_CURSOR_RESTYPES; resIndex++) - { - rcl.type = CursorRestypes[resIndex]; - /* - * This function walks the entire client resource database - */ - LookupClientResourceComplex (clients[clientIndex], - rcl.type, - ReplaceCursorLookup, - (pointer) &rcl); - } - } - /* this "knows" that WindowHasNewCursor doesn't depend on it's argument */ - WindowHasNewCursor (WindowTable[0]); -} - -static Bool -TestForCursor (CursorPtr pCursor, pointer closure) -{ - return (pCursor == (CursorPtr) closure); -} - -int -ProcXFixesChangeCursor (ClientPtr client) -{ - CursorPtr pSource, pDestination; - REQUEST(xXFixesChangeCursorReq); - - REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); - VERIFY_CURSOR (pSource, stuff->source, client, SecurityReadAccess); - VERIFY_CURSOR (pDestination, stuff->destination, client, SecurityWriteAccess); - - ReplaceCursor (pSource, TestForCursor, (pointer) pDestination); - return (client->noClientException); -} - -int -SProcXFixesChangeCursor (ClientPtr client) -{ - int n; - REQUEST(xXFixesChangeCursorReq); - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -static Bool -TestForCursorName (CursorPtr pCursor, pointer closure) -{ - return (pCursor->name == (Atom) closure); -} - -int -ProcXFixesChangeCursorByName (ClientPtr client) -{ - CursorPtr pSource; - Atom name; - char *tchar; - REQUEST(xXFixesChangeCursorByNameReq); - - REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes); - VERIFY_CURSOR(pSource, stuff->source, client, SecurityReadAccess); - tchar = (char *) &stuff[1]; - name = MakeAtom (tchar, stuff->nbytes, FALSE); - if (name) - ReplaceCursor (pSource, TestForCursorName, (pointer) name); - return (client->noClientException); -} - -int -SProcXFixesChangeCursorByName (ClientPtr client) -{ - int n; - REQUEST(xXFixesChangeCursorByNameReq); - - swaps (&stuff->length, n); - REQUEST_AT_LEAST_SIZE (xXFixesChangeCursorByNameReq); - swapl (&stuff->source, n); - swaps (&stuff->nbytes, n); - return (*ProcXFixesVector[stuff->xfixesReqType]) (client); -} - -static int -CursorFreeClient (pointer data, XID id) -{ - CursorEventPtr old = (CursorEventPtr) data; - CursorEventPtr *prev, e; - - for (prev = &cursorEvents; (e = *prev); prev = &e->next) - { - if (e == old) - { - *prev = e->next; - xfree (e); - break; - } - } - return 1; -} - -static int -CursorFreeWindow (pointer data, XID id) -{ - WindowPtr pWindow = (WindowPtr) data; - CursorEventPtr e, next; - - for (e = cursorEvents; e; e = next) - { - next = e->next; - if (e->pWindow == pWindow) - { - FreeResource (e->clientResource, 0); - } - } - return 1; -} - -Bool -XFixesCursorInit (void) -{ - int i; - - if (CursorGeneration != serverGeneration) - { - CursorScreenPrivateIndex = AllocateScreenPrivateIndex (); - if (CursorScreenPrivateIndex < 0) - return FALSE; - CursorGeneration = serverGeneration; - } - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - CursorScreenPtr cs; - - cs = (CursorScreenPtr) xalloc (sizeof (CursorScreenRec)); - if (!cs) - return FALSE; - Wrap (cs, pScreen, CloseScreen, CursorCloseScreen); - Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor); - SetCursorScreen (pScreen, cs); - } - CursorClientType = CreateNewResourceType(CursorFreeClient); - CursorWindowType = CreateNewResourceType(CursorFreeWindow); - return CursorClientType && CursorWindowType; -} - diff --git a/nx-X11/programs/Xserver/xfixes/select.c.NX.original b/nx-X11/programs/Xserver/xfixes/select.c.NX.original deleted file mode 100755 index c72e19e9a..000000000 --- a/nx-X11/programs/Xserver/xfixes/select.c.NX.original +++ /dev/null @@ -1,281 +0,0 @@ -/* - * $Id: select.c,v 1.6 2005/07/03 07:37:35 daniels Exp $ - * - * Copyright © 2002 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "xfixesint.h" - -static RESTYPE SelectionClientType, SelectionWindowType; -static Bool SelectionCallbackRegistered = FALSE; - -/* - * There is a global list of windows selecting for selection events - * on every selection. This should be plenty efficient for the - * expected usage, if it does become a problem, it should be easily - * replaced with a hash table of some kind keyed off the selection atom - */ - -typedef struct _SelectionEvent *SelectionEventPtr; - -typedef struct _SelectionEvent { - SelectionEventPtr next; - Atom selection; - CARD32 eventMask; - ClientPtr pClient; - WindowPtr pWindow; - XID clientResource; -} SelectionEventRec; - -static SelectionEventPtr selectionEvents; - -static void -XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args) -{ - SelectionEventPtr e; - SelectionInfoRec *info = (SelectionInfoRec *) args; - Selection *selection = info->selection; - int subtype; - CARD32 eventMask; - - switch (info->kind) { - case SelectionSetOwner: - subtype = XFixesSetSelectionOwnerNotify; - eventMask = XFixesSetSelectionOwnerNotifyMask; - break; - case SelectionWindowDestroy: - subtype = XFixesSelectionWindowDestroyNotify; - eventMask = XFixesSelectionWindowDestroyNotifyMask; - break; - case SelectionClientClose: - subtype = XFixesSelectionClientCloseNotify; - eventMask = XFixesSelectionClientCloseNotifyMask; - break; - default: - return; - } - for (e = selectionEvents; e; e = e->next) - { - if (e->selection == selection->selection && - (e->eventMask & eventMask) && - !e->pClient->clientGone) - { - xXFixesSelectionNotifyEvent ev; - - ev.type = XFixesEventBase + XFixesSelectionNotify; - ev.subtype = subtype; - ev.sequenceNumber = e->pClient->sequence; - ev.window = e->pWindow->drawable.id; - if (subtype == XFixesSetSelectionOwnerNotify) - ev.owner = selection->window; - else - ev.owner = 0; - ev.selection = e->selection; - ev.timestamp = currentTime.milliseconds; - ev.selectionTimestamp = selection->lastTimeChanged.milliseconds; - WriteEventsToClient (e->pClient, 1, (xEvent *) &ev); - } - } -} - -static Bool -CheckSelectionCallback (void) -{ - if (selectionEvents) - { - if (!SelectionCallbackRegistered) - { - if (!AddCallback (&SelectionCallback, XFixesSelectionCallback, NULL)) - return FALSE; - SelectionCallbackRegistered = TRUE; - } - } - else - { - if (SelectionCallbackRegistered) - { - DeleteCallback (&SelectionCallback, XFixesSelectionCallback, NULL); - SelectionCallbackRegistered = FALSE; - } - } - return TRUE; -} - -#define SelectionAllEvents (XFixesSetSelectionOwnerNotifyMask |\ - XFixesSelectionWindowDestroyNotifyMask |\ - XFixesSelectionClientCloseNotifyMask) - -static int -XFixesSelectSelectionInput (ClientPtr pClient, - Atom selection, - WindowPtr pWindow, - CARD32 eventMask) -{ - SelectionEventPtr *prev, e; - - for (prev = &selectionEvents; (e = *prev); prev = &e->next) - { - if (e->selection == selection && - e->pClient == pClient && - e->pWindow == pWindow) - { - break; - } - } - if (!eventMask) - { - if (e) - { - FreeResource (e->clientResource, 0); - } - return Success; - } - if (!e) - { - e = (SelectionEventPtr) xalloc (sizeof (SelectionEventRec)); - if (!e) - return BadAlloc; - - e->next = 0; - e->selection = selection; - e->pClient = pClient; - e->pWindow = pWindow; - e->clientResource = FakeClientID(pClient->index); - - /* - * Add a resource hanging from the window to - * catch window destroy - */ - if (!LookupIDByType(pWindow->drawable.id, SelectionWindowType)) - if (!AddResource (pWindow->drawable.id, SelectionWindowType, - (pointer) pWindow)) - { - xfree (e); - return BadAlloc; - } - - if (!AddResource (e->clientResource, SelectionClientType, (pointer) e)) - return BadAlloc; - - *prev = e; - if (!CheckSelectionCallback ()) - { - FreeResource (e->clientResource, 0); - return BadAlloc; - } - } - e->eventMask = eventMask; - return Success; -} - -int -ProcXFixesSelectSelectionInput (ClientPtr client) -{ - REQUEST (xXFixesSelectSelectionInputReq); - WindowPtr pWin; - - REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - if (stuff->eventMask & ~SelectionAllEvents) - { - client->errorValue = stuff->eventMask; - return( BadValue ); - } - return XFixesSelectSelectionInput (client, stuff->selection, - pWin, stuff->eventMask); -} - -int -SProcXFixesSelectSelectionInput (ClientPtr client) -{ - register int n; - REQUEST(xXFixesSelectSelectionInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swapl(&stuff->selection, n); - swapl(&stuff->eventMask, n); - return ProcXFixesSelectSelectionInput(client); -} - -void -SXFixesSelectionNotifyEvent (xXFixesSelectionNotifyEvent *from, - xXFixesSelectionNotifyEvent *to) -{ - to->type = from->type; - cpswaps (from->sequenceNumber, to->sequenceNumber); - cpswapl (from->window, to->window); - cpswapl (from->owner, to->owner); - cpswapl (from->selection, to->selection); - cpswapl (from->timestamp, to->timestamp); - cpswapl (from->selectionTimestamp, to->selectionTimestamp); -} - -static int -SelectionFreeClient (pointer data, XID id) -{ - SelectionEventPtr old = (SelectionEventPtr) data; - SelectionEventPtr *prev, e; - - for (prev = &selectionEvents; (e = *prev); prev = &e->next) - { - if (e == old) - { - *prev = e->next; - xfree (e); - CheckSelectionCallback (); - break; - } - } - return 1; -} - -static int -SelectionFreeWindow (pointer data, XID id) -{ - WindowPtr pWindow = (WindowPtr) data; - SelectionEventPtr e, next; - - for (e = selectionEvents; e; e = next) - { - next = e->next; - if (e->pWindow == pWindow) - { - FreeResource (e->clientResource, 0); - } - } - return 1; -} - -Bool -XFixesSelectionInit (void) -{ - SelectionClientType = CreateNewResourceType(SelectionFreeClient); - SelectionWindowType = CreateNewResourceType(SelectionFreeWindow); - return SelectionClientType && SelectionWindowType; -} diff --git a/nx-X11/programs/Xserver/xfixes/select.c.X.original b/nx-X11/programs/Xserver/xfixes/select.c.X.original deleted file mode 100755 index 6a28da93b..000000000 --- a/nx-X11/programs/Xserver/xfixes/select.c.X.original +++ /dev/null @@ -1,279 +0,0 @@ -/* - * $Id: select.c,v 1.6 2005/07/03 07:37:35 daniels Exp $ - * - * Copyright © 2002 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "xfixesint.h" - -static RESTYPE SelectionClientType, SelectionWindowType; -static Bool SelectionCallbackRegistered = FALSE; - -/* - * There is a global list of windows selecting for selection events - * on every selection. This should be plenty efficient for the - * expected usage, if it does become a problem, it should be easily - * replaced with a hash table of some kind keyed off the selection atom - */ - -typedef struct _SelectionEvent *SelectionEventPtr; - -typedef struct _SelectionEvent { - SelectionEventPtr next; - Atom selection; - CARD32 eventMask; - ClientPtr pClient; - WindowPtr pWindow; - XID clientResource; -} SelectionEventRec; - -static SelectionEventPtr selectionEvents; - -static void -XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args) -{ - SelectionEventPtr e; - SelectionInfoRec *info = (SelectionInfoRec *) args; - Selection *selection = info->selection; - int subtype; - CARD32 eventMask; - - switch (info->kind) { - case SelectionSetOwner: - subtype = XFixesSetSelectionOwnerNotify; - eventMask = XFixesSetSelectionOwnerNotifyMask; - break; - case SelectionWindowDestroy: - subtype = XFixesSelectionWindowDestroyNotify; - eventMask = XFixesSelectionWindowDestroyNotifyMask; - break; - case SelectionClientClose: - subtype = XFixesSelectionClientCloseNotify; - eventMask = XFixesSelectionClientCloseNotifyMask; - break; - default: - return; - } - for (e = selectionEvents; e; e = e->next) - { - if (e->selection == selection->selection && (e->eventMask & eventMask)) - { - xXFixesSelectionNotifyEvent ev; - - ev.type = XFixesEventBase + XFixesSelectionNotify; - ev.subtype = subtype; - ev.sequenceNumber = e->pClient->sequence; - ev.window = e->pWindow->drawable.id; - if (subtype == XFixesSetSelectionOwnerNotify) - ev.owner = selection->window; - else - ev.owner = 0; - ev.selection = e->selection; - ev.timestamp = currentTime.milliseconds; - ev.selectionTimestamp = selection->lastTimeChanged.milliseconds; - WriteEventsToClient (e->pClient, 1, (xEvent *) &ev); - } - } -} - -static Bool -CheckSelectionCallback (void) -{ - if (selectionEvents) - { - if (!SelectionCallbackRegistered) - { - if (!AddCallback (&SelectionCallback, XFixesSelectionCallback, NULL)) - return FALSE; - SelectionCallbackRegistered = TRUE; - } - } - else - { - if (SelectionCallbackRegistered) - { - DeleteCallback (&SelectionCallback, XFixesSelectionCallback, NULL); - SelectionCallbackRegistered = FALSE; - } - } - return TRUE; -} - -#define SelectionAllEvents (XFixesSetSelectionOwnerNotifyMask |\ - XFixesSelectionWindowDestroyNotifyMask |\ - XFixesSelectionClientCloseNotifyMask) - -static int -XFixesSelectSelectionInput (ClientPtr pClient, - Atom selection, - WindowPtr pWindow, - CARD32 eventMask) -{ - SelectionEventPtr *prev, e; - - for (prev = &selectionEvents; (e = *prev); prev = &e->next) - { - if (e->selection == selection && - e->pClient == pClient && - e->pWindow == pWindow) - { - break; - } - } - if (!eventMask) - { - if (e) - { - FreeResource (e->clientResource, 0); - } - return Success; - } - if (!e) - { - e = (SelectionEventPtr) xalloc (sizeof (SelectionEventRec)); - if (!e) - return BadAlloc; - - e->next = 0; - e->selection = selection; - e->pClient = pClient; - e->pWindow = pWindow; - e->clientResource = FakeClientID(pClient->index); - - /* - * Add a resource hanging from the window to - * catch window destroy - */ - if (!LookupIDByType(pWindow->drawable.id, SelectionWindowType)) - if (!AddResource (pWindow->drawable.id, SelectionWindowType, - (pointer) pWindow)) - { - xfree (e); - return BadAlloc; - } - - if (!AddResource (e->clientResource, SelectionClientType, (pointer) e)) - return BadAlloc; - - *prev = e; - if (!CheckSelectionCallback ()) - { - FreeResource (e->clientResource, 0); - return BadAlloc; - } - } - e->eventMask = eventMask; - return Success; -} - -int -ProcXFixesSelectSelectionInput (ClientPtr client) -{ - REQUEST (xXFixesSelectSelectionInputReq); - WindowPtr pWin; - - REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - if (!pWin) - return(BadWindow); - if (stuff->eventMask & ~SelectionAllEvents) - { - client->errorValue = stuff->eventMask; - return( BadValue ); - } - return XFixesSelectSelectionInput (client, stuff->selection, - pWin, stuff->eventMask); -} - -int -SProcXFixesSelectSelectionInput (ClientPtr client) -{ - register int n; - REQUEST(xXFixesSelectSelectionInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swapl(&stuff->selection, n); - swapl(&stuff->eventMask, n); - return ProcXFixesSelectSelectionInput(client); -} - -void -SXFixesSelectionNotifyEvent (xXFixesSelectionNotifyEvent *from, - xXFixesSelectionNotifyEvent *to) -{ - to->type = from->type; - cpswaps (from->sequenceNumber, to->sequenceNumber); - cpswapl (from->window, to->window); - cpswapl (from->owner, to->owner); - cpswapl (from->selection, to->selection); - cpswapl (from->timestamp, to->timestamp); - cpswapl (from->selectionTimestamp, to->selectionTimestamp); -} - -static int -SelectionFreeClient (pointer data, XID id) -{ - SelectionEventPtr old = (SelectionEventPtr) data; - SelectionEventPtr *prev, e; - - for (prev = &selectionEvents; (e = *prev); prev = &e->next) - { - if (e == old) - { - *prev = e->next; - xfree (e); - CheckSelectionCallback (); - break; - } - } - return 1; -} - -static int -SelectionFreeWindow (pointer data, XID id) -{ - WindowPtr pWindow = (WindowPtr) data; - SelectionEventPtr e, next; - - for (e = selectionEvents; e; e = next) - { - next = e->next; - if (e->pWindow == pWindow) - { - FreeResource (e->clientResource, 0); - } - } - return 1; -} - -Bool -XFixesSelectionInit (void) -{ - SelectionClientType = CreateNewResourceType(SelectionFreeClient); - SelectionWindowType = CreateNewResourceType(SelectionFreeWindow); - return SelectionClientType && SelectionWindowType; -} diff --git a/nx-X11/programs/Xserver/xkb/Imakefile.NX.original b/nx-X11/programs/Xserver/xkb/Imakefile.NX.original deleted file mode 100644 index a718545b1..000000000 --- a/nx-X11/programs/Xserver/xkb/Imakefile.NX.original +++ /dev/null @@ -1,106 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/xkb/Imakefile,v 3.21 2002/12/09 23:00:42 dawes Exp $ - -#define SGIHyperOpt -#include - -#ifdef SGIArchitecture -EXTRA_ALLOC_DEFINES = -DFORCE_ALLOCA -#endif - -#if BuildXInputExt -XKBXI_SRCS = xkbPrOtherEv.c -XKBXI_OBJS = xkbPrOtherEv.o -#endif - -#ifdef DfltDisableXKB -XKB_DISABLE = -DXKB_DFLT_DISABLED=1 -#else -XKB_DISABLE = -DXKB_DFLT_DISABLED=0 -#endif - -XKB_DDXDEFS = XkbServerDefines - -#if defined(NXAgentServer) && NXAgentServer -NX_DEFINES = -DNXAGENT_SERVER -#endif - -#if (defined(XF86Server) && XF86Server) || (defined(XorgServer) && XorgServer) -XF86INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) - XF86_OBJS = xf86KillSrv.o xf86VT.o xf86Private.o -#endif - - DDX_SRCS = ddxBeep.c ddxCtrls.c ddxFakeBtn.c ddxFakeMtn.c ddxInit.c \ - ddxKeyClick.c ddxKillSrv.c ddxLEDs.c ddxVT.c ddxLoad.c \ - ddxList.c ddxConfig.c ddxDevBtn.c ddxPrivate.c xkbconfig.c - DDX_OBJS = ddxBeep.o ddxCtrls.o ddxFakeBtn.o ddxFakeMtn.o ddxInit.o \ - ddxKeyClick.o ddxKillSrv.o ddxLEDs.o ddxVT.o ddxLoad.o \ - ddxList.o ddxConfig.o ddxDevBtn.o ddxPrivate.o xkbconfig.o - SRCS = xkb.c xkbUtils.c xkbEvents.c xkbAccessX.c xkbSwap.c \ - xkbLEDs.c xkbInit.c xkbActions.c xkbPrKeyEv.c \ - xkmread.c xkbtext.c xkbfmisc.c xkberrs.c xkbout.c maprules.c \ - XKBMisc.c XKBMAlloc.c XKBAlloc.c XKBGAlloc.c \ - $(XKBXI_SRCS) $(DDX_SRCS) - OBJS = xkb.o xkbUtils.o xkbEvents.o xkbAccessX.o xkbSwap.o \ - xkbLEDs.o xkbInit.o xkbActions.o xkbPrKeyEv.o \ - xkmread.o xkbtext.o xkbfmisc.o xkberrs.o xkbout.o maprules.o \ - XKBMisc.o XKBMAlloc.o XKBAlloc.o XKBGAlloc.o \ - $(XKBXI_OBJS) $(DDX_OBJS) - INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/mi $(XF86INCLUDES) - LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln - -DEFINES = -DXKB_IN_SERVER $(EXTRA_ALLOC_DEFINES) $(XKB_DDXDEFS) $(NX_DEFINES) -XKB_DEFINES = -DXKB_BASE_DIRECTORY=\"$(LIBDIR)/xkb\" $(XKB_DISABLE) - -NormalLibraryObjectRule() -NormalLibraryTarget(xkb,$(OBJS)) -LintLibraryTarget(xkb,$(SRCS)) -NormalLintTarget($(SRCS)) - -#if (defined(XF86Server) && XF86Server) || (defined(XorgServer) && XorgServer) -ObjectFromSpecialSource(xf86KillSrv,ddxKillSrv,-DXF86DDXACTIONS) -ObjectFromSpecialSource(xf86VT,ddxVT,-DXF86DDXACTIONS) -ObjectFromSpecialSource(xf86Private,ddxPrivate,-DXF86DDXACTIONS) -AllTarget($(XF86_OBJS)) -#endif - -SpecialCObjectRule(xkbInit,$(ICONFIGFILES),$(XKB_DEFINES)) - -LinkSourceFile(maprules.c,$(XKBFILELIBSRC)) -LinkSourceFile(xkmread.c,$(XKBFILELIBSRC)) -LinkSourceFile(xkbtext.c,$(XKBFILELIBSRC)) -XCOMM avoid clash between XKBMisc.c and xkbmisc.c on NT -LinkFile(xkbfmisc.c,$(XKBFILELIBSRC)/xkbmisc.c) -LinkSourceFile(xkberrs.c,$(XKBFILELIBSRC)) -LinkSourceFile(xkbconfig.c,$(XKBFILELIBSRC)) -LinkSourceFile(xkbout.c,$(XKBFILELIBSRC)) -LinkSourceFile(XKBMisc.c,$(XLIBSRC)) -LinkSourceFile(XKBMAlloc.c,$(XLIBSRC)) -LinkSourceFile(XKBAlloc.c,$(XLIBSRC)) -LinkSourceFile(XKBGAlloc.c,$(XLIBSRC)) - -LinkSourceFile(modinit.h,../Xext/extmod) - -#if BuildLibraries -#if UseConfDirForXkb -LinkConfDirectory(xkb,.,xkb,.) -ODIR = $(CONFDIR) -#else -ODIR = $(LIBDIR) -#endif -#ifdef VarDbDirectory -NDIR = $(VARDBDIR) -#else -NDIR = $(CONFDIR) -#endif -#if !UseConfDirForXkb || defined(VarDbDirectory) -LinkConfDirectoryLong(xkb,xkb,compiled,compiled,$(ODIR),$(NDIR)) -#endif -#endif - -DependTarget() diff --git a/nx-X11/programs/Xserver/xkb/Imakefile.X.original b/nx-X11/programs/Xserver/xkb/Imakefile.X.original deleted file mode 100644 index a91f8ff86..000000000 --- a/nx-X11/programs/Xserver/xkb/Imakefile.X.original +++ /dev/null @@ -1,102 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/xkb/Imakefile,v 3.21 2002/12/09 23:00:42 dawes Exp $ - -#define SGIHyperOpt -#include - -#ifdef SGIArchitecture -EXTRA_ALLOC_DEFINES = -DFORCE_ALLOCA -#endif - -#if BuildXInputExt -XKBXI_SRCS = xkbPrOtherEv.c -XKBXI_OBJS = xkbPrOtherEv.o -#endif - -#ifdef DfltDisableXKB -XKB_DISABLE = -DXKB_DFLT_DISABLED=1 -#else -XKB_DISABLE = -DXKB_DFLT_DISABLED=0 -#endif - -XKB_DDXDEFS = XkbServerDefines - -#if (defined(XF86Server) && XF86Server) || (defined(XorgServer) && XorgServer) -XF86INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) - XF86_OBJS = xf86KillSrv.o xf86VT.o xf86Private.o -#endif - - DDX_SRCS = ddxBeep.c ddxCtrls.c ddxFakeBtn.c ddxFakeMtn.c ddxInit.c \ - ddxKeyClick.c ddxKillSrv.c ddxLEDs.c ddxVT.c ddxLoad.c \ - ddxList.c ddxConfig.c ddxDevBtn.c ddxPrivate.c xkbconfig.c - DDX_OBJS = ddxBeep.o ddxCtrls.o ddxFakeBtn.o ddxFakeMtn.o ddxInit.o \ - ddxKeyClick.o ddxKillSrv.o ddxLEDs.o ddxVT.o ddxLoad.o \ - ddxList.o ddxConfig.o ddxDevBtn.o ddxPrivate.o xkbconfig.o - SRCS = xkb.c xkbUtils.c xkbEvents.c xkbAccessX.c xkbSwap.c \ - xkbLEDs.c xkbInit.c xkbActions.c xkbPrKeyEv.c \ - xkmread.c xkbtext.c xkbfmisc.c xkberrs.c xkbout.c maprules.c \ - XKBMisc.c XKBMAlloc.c XKBAlloc.c XKBGAlloc.c \ - $(XKBXI_SRCS) $(DDX_SRCS) - OBJS = xkb.o xkbUtils.o xkbEvents.o xkbAccessX.o xkbSwap.o \ - xkbLEDs.o xkbInit.o xkbActions.o xkbPrKeyEv.o \ - xkmread.o xkbtext.o xkbfmisc.o xkberrs.o xkbout.o maprules.o \ - XKBMisc.o XKBMAlloc.o XKBAlloc.o XKBGAlloc.o \ - $(XKBXI_OBJS) $(DDX_OBJS) - INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/mi $(XF86INCLUDES) - LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln - -DEFINES = -DXKB_IN_SERVER $(EXTRA_ALLOC_DEFINES) $(XKB_DDXDEFS) -XKB_DEFINES = -DXKB_BASE_DIRECTORY=\"$(LIBDIR)/xkb\" $(XKB_DISABLE) - -NormalLibraryObjectRule() -NormalLibraryTarget(xkb,$(OBJS)) -LintLibraryTarget(xkb,$(SRCS)) -NormalLintTarget($(SRCS)) - -#if (defined(XF86Server) && XF86Server) || (defined(XorgServer) && XorgServer) -ObjectFromSpecialSource(xf86KillSrv,ddxKillSrv,-DXF86DDXACTIONS) -ObjectFromSpecialSource(xf86VT,ddxVT,-DXF86DDXACTIONS) -ObjectFromSpecialSource(xf86Private,ddxPrivate,-DXF86DDXACTIONS) -AllTarget($(XF86_OBJS)) -#endif - -SpecialCObjectRule(xkbInit,$(ICONFIGFILES),$(XKB_DEFINES)) - -LinkSourceFile(maprules.c,$(XKBFILELIBSRC)) -LinkSourceFile(xkmread.c,$(XKBFILELIBSRC)) -LinkSourceFile(xkbtext.c,$(XKBFILELIBSRC)) -XCOMM avoid clash between XKBMisc.c and xkbmisc.c on NT -LinkFile(xkbfmisc.c,$(XKBFILELIBSRC)/xkbmisc.c) -LinkSourceFile(xkberrs.c,$(XKBFILELIBSRC)) -LinkSourceFile(xkbconfig.c,$(XKBFILELIBSRC)) -LinkSourceFile(xkbout.c,$(XKBFILELIBSRC)) -LinkSourceFile(XKBMisc.c,$(XLIBSRC)) -LinkSourceFile(XKBMAlloc.c,$(XLIBSRC)) -LinkSourceFile(XKBAlloc.c,$(XLIBSRC)) -LinkSourceFile(XKBGAlloc.c,$(XLIBSRC)) - -LinkSourceFile(modinit.h,../Xext/extmod) - -#if BuildLibraries -#if UseConfDirForXkb -LinkConfDirectory(xkb,.,xkb,.) -ODIR = $(CONFDIR) -#else -ODIR = $(LIBDIR) -#endif -#ifdef VarDbDirectory -NDIR = $(VARDBDIR) -#else -NDIR = $(CONFDIR) -#endif -#if !UseConfDirForXkb || defined(VarDbDirectory) -LinkConfDirectoryLong(xkb,xkb,compiled,compiled,$(ODIR),$(NDIR)) -#endif -#endif - -DependTarget() diff --git a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c.NX.original b/nx-X11/programs/Xserver/xkb/ddxKillSrv.c.NX.original deleted file mode 100644 index b78dc420d..000000000 --- a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c.NX.original +++ /dev/null @@ -1,69 +0,0 @@ -/* $Xorg: ddxKillSrv.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ -/************************************************************ -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. - -********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxKillSrv.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#define NEED_EVENTS 1 -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include -#include - -#ifdef XF86DDXACTIONS -#include "xf86.h" -#endif - -int -XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) -{ -#ifdef NXAGENT_SERVER - - return 0; - -#else - -#ifdef XF86DDXACTIONS - xf86ProcessActionEvent(ACTION_TERMINATE, NULL); -#else - GiveUp(1); -#endif - return 0; - -#endif /* NXAGENT_SERVER */ -} diff --git a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c.X.original b/nx-X11/programs/Xserver/xkb/ddxKillSrv.c.X.original deleted file mode 100644 index ee0acb028..000000000 --- a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c.X.original +++ /dev/null @@ -1,61 +0,0 @@ -/* $Xorg: ddxKillSrv.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ -/************************************************************ -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. - -********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxKillSrv.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#define NEED_EVENTS 1 -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include -#include - -#ifdef XF86DDXACTIONS -#include "xf86.h" -#endif - -int -XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) -{ -#ifdef XF86DDXACTIONS - xf86ProcessActionEvent(ACTION_TERMINATE, NULL); -#else - GiveUp(1); -#endif - return 0; -} diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c.NX.original b/nx-X11/programs/Xserver/xkb/ddxLoad.c.NX.original deleted file mode 100644 index e69d95670..000000000 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c.NX.original +++ /dev/null @@ -1,970 +0,0 @@ -/* $Xorg: ddxLoad.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ -/************************************************************ -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. - -********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxLoad.c,v 3.35 2003/10/02 13:30:12 eich Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef HAVE_XKB_CONFIG_H -#include -#endif - -#include -#include -#include -#define NEED_EVENTS 1 -#include -#include -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#define XKBSRV_NEED_FILE_FUNCS -#include -#include -#include "xkb.h" - -#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(AIXV3) || defined(__osf__) || defined(__GNU__) -#include -#endif - -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif -#endif - - /* - * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is - * relative to the top-level XKB configuration directory. - * Making the server write to a subdirectory of that directory - * requires some work in the general case (install procedure - * has to create links to /var or somesuch on many machines), - * so we just compile into /usr/tmp for now. - */ -#ifndef XKM_OUTPUT_DIR -#define XKM_OUTPUT_DIR "compiled/" -#endif - -#define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\"" -#define ERROR_PREFIX "\"> \"" -#define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" -#define POST_ERROR_MSG2 "\"End of messages from xkbcomp\"" - -#if defined(__UNIXOS2__) || defined(WIN32) -#define PATHSEPARATOR "\\" -#else -#define PATHSEPARATOR "/" -#endif - -#ifdef WIN32 - -#include -const char* -Win32TempDir() -{ - static char buffer[PATH_MAX]; - if (GetTempPath(sizeof(buffer), buffer)) - { - int len; - buffer[sizeof(buffer)-1] = 0; - len = strlen(buffer); - if (len > 0) - if (buffer[len-1] == '\\') - buffer[len-1] = 0; - return buffer; - } - if (getenv("TEMP") != NULL) - return getenv("TEMP"); - else if (getenv("TMP") != NULL) - return getenv("TEMP"); - else - return "/tmp"; -} - -int -Win32System(const char *cmdline) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - DWORD dwExitCode; - char *cmd = xstrdup(cmdline); - - ZeroMemory( &si, sizeof(si) ); - si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - - if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - { - LPVOID buffer; - if (!FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &buffer, - 0, - NULL )) - { - ErrorF("Starting '%s' failed!\n", cmdline); - } - else - { - ErrorF("Starting '%s' failed: %s", cmdline, (char *)buffer); - LocalFree(buffer); - } - - xfree(cmd); - return -1; - } - /* Wait until child process exits. */ - WaitForSingleObject( pi.hProcess, INFINITE ); - - GetExitCodeProcess( pi.hProcess, &dwExitCode); - - /* Close process and thread handles. */ - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); - xfree(cmd); - - return dwExitCode; -} -#undef System -#define System(x) Win32System(x) -#endif - -#ifdef MAKE_XKM_OUTPUT_DIR -/* Borrow trans_mkdir from Xtransutil.c to more safely make directories */ -# undef X11_t -# define TRANS_SERVER -# define PRMSG(lvl,x,a,b,c) \ - if (lvl <= 1) { LogMessage(X_ERROR,x,a,b,c); } else ((void)0) -# include -# ifndef XKM_OUTPUT_DIR_MODE -# define XKM_OUTPUT_DIR_MODE 0755 -# endif -#endif - -#ifdef NXAGENT_SERVER - -#define NX_XKB_BASE_DIRECTORY "/usr/lib/X11/xkb" -#define NX_XKB_ALTERNATE_BASE_DIRECTORY "/usr/share/X11/xkb" -#define NX_KEYMAP_DIR_FILE "keymap.dir" -#define NX_ALT_XKBCOMP_PATH "/usr/bin" - -static char _NXXkbBasePath[PATH_MAX]; -static char _NXXkbCompPath[PATH_MAX]; - -static int NXVerifyXkbBaseDirectory(const char *dirPath) -{ - int size; - char *keymapDirFilePath; - struct stat keymapDirFileStat; - - /* - * If keymap.dir file - * is not present into - * Xkb Base Directory, - * we suppose that the - * path is not valid. - */ - - size = strlen(dirPath) + strlen("/") + - strlen(NX_KEYMAP_DIR_FILE) + 1; - - if ((keymapDirFilePath = malloc((size + 1) * sizeof(char))) == NULL) - { - FatalError("NXVerifyXkbBaseDirectory: malloc failed.\n"); - } - - strcpy(keymapDirFilePath, dirPath); - strcat(keymapDirFilePath, "/"); - strcat(keymapDirFilePath, NX_KEYMAP_DIR_FILE); - - #ifdef TEST - fprintf(stderr, "NXVerifyXkbBaseDirectory: Looking for [%s] file.\n", - keymapDirFilePath); - #endif - - if (stat(keymapDirFilePath, &keymapDirFileStat) != 0) - { - - #ifdef TEST - fprintf(stderr, "NXVerifyXkbBaseDirectory: Can't find the keymap.dir file [%s].\n", - keymapDirFilePath); - #endif - - free(keymapDirFilePath); - - return 0; - } - - #ifdef TEST - fprintf(stderr, "NXVerifyXkbBaseDirectory: Xkb Base Directory [%s] is valid.\n", - dirPath); - #endif - - free(keymapDirFilePath); - - return 1; -} - -/* - * This function returns the directory - * containing the configuration files. - * This directory is referred by Xkb- - * BaseDirectory variable (generally - * it contains the hardcoded path at - * compile time). If the directory - * does not exist, the function will - * try a set of well known directories. - */ - -char *_NXGetXkbBasePath(const char *path) -{ - /* - * Check the xkb base directory only once. - */ - - if (*_NXXkbBasePath != '\0') - { - return _NXXkbBasePath; - } - - if (NXVerifyXkbBaseDirectory(XkbBaseDirectory) == 1) - { - if (strlen(XkbBaseDirectory) + 1 > PATH_MAX) - { - #ifdef TEST - fprintf(stderr, "_NXGetXkbBasePath: WARNING! Maximum length of xkb base path exceeded.\n"); - #endif - - goto _NXGetXkbBasePathError; - } - - strcpy(_NXXkbBasePath, XkbBaseDirectory); - - #ifdef TEST - fprintf(stderr, "_NXGetXkbBasePath: Using NX xkb base directory path [%s].\n", - _NXXkbBasePath); - #endif - - return _NXXkbBasePath; - } - - if (NXVerifyXkbBaseDirectory(NX_XKB_BASE_DIRECTORY) == 1) - { - if (strlen(NX_XKB_BASE_DIRECTORY) + 1 > PATH_MAX) - { - #ifdef TEST - fprintf(stderr, "_NXGetXkbBasePath: WARNING! Maximum length of xkb base path exceeded.\n"); - #endif - - goto _NXGetXkbBasePathError; - } - - strcpy(_NXXkbBasePath, NX_XKB_BASE_DIRECTORY); - - #ifdef TEST - fprintf(stderr, "_NXGetXkbBasePath: Using NX xkb base directory path [%s].\n", - _NXXkbBasePath); - #endif - - return _NXXkbBasePath; - } - - if (NXVerifyXkbBaseDirectory(NX_XKB_ALTERNATE_BASE_DIRECTORY) == 1) - { - if (strlen(NX_XKB_ALTERNATE_BASE_DIRECTORY) + 1 > PATH_MAX) - { - #ifdef TEST - fprintf(stderr, "_NXGetXkbBasePath: WARNING! Maximum length of xkb base path exceeded.\n"); - #endif - - goto _NXGetXkbBasePathError; - } - - strcpy(_NXXkbBasePath, NX_XKB_ALTERNATE_BASE_DIRECTORY); - - #ifdef TEST - fprintf(stderr, "_NXGetXkbBasePath: Using NX xkb base directory path [%s].\n", - _NXXkbBasePath); - #endif - - return _NXXkbBasePath; - } - -_NXGetXkbBasePathError: - - if (strlen(path) + 1 > PATH_MAX) - { - #ifdef TEST - fprintf(stderr, "_NXGetXkbBasePath: WARNING! Maximum length of xkb base path exceeded.\n"); - #endif - } - - strcpy(_NXXkbBasePath, path); - - #ifdef TEST - fprintf(stderr, "_NXGetXkbBasePath: Using default xkb base path [%s].\n", - _NXXkbBasePath); - #endif - - return _NXXkbBasePath; -} - -static int NXVerifyXkbCompPath(char *path) -{ - char *xkbCompPath; - int xkbCompPathSize; - struct stat xkbCompPathStat; - - if (path == NULL) - { - return 0; - } - - xkbCompPathSize = strlen(path) + strlen("/") + - strlen("xkbcomp") + 1; - - if ((xkbCompPath = malloc((xkbCompPathSize + 1) * sizeof(char))) == NULL) - { - FatalError("NXVerifyXkbCompPath: WARNING! malloc failed.\n"); - - return 0; - } - - strcpy(xkbCompPath, path); - strcat(xkbCompPath, "/"); - strcat(xkbCompPath, "xkbcomp"); - - if (stat(xkbCompPath, &xkbCompPathStat) != 0) - { - #ifdef NX_TRANS_TEST - fprintf(stderr, "NXVerifyXkbCompPath: WARNING! Failed to stat xkbcomp path [%s].\n", - xkbCompPath); - #endif - - free(xkbCompPath); - - return 0; - } - - free(xkbCompPath); - - return 1; -} - -/* - * This function returns the directory - * containing the xkbcomp executable. - * The function will first try to locate - * the executable in the hardcoded path - * (the same path as the "base" xkb one) - * and, if the xkbcomp file couldn't be - * found, the function will not include - * an explicit path and will rely on the - * PATH environment to list the directory. - */ - -char *_NXGetXkbCompPath(const char *path) -{ - - char * xkbCompPath; - - /* - * Check the xkbcomp executable - * directory only once. - */ - - if (*_NXXkbCompPath != '\0') - { - return _NXXkbCompPath; - } - - xkbCompPath = _NXGetXkbBasePath(path); - - if (NXVerifyXkbCompPath(xkbCompPath) == 1) - { - if (strlen(xkbCompPath) + 1 > PATH_MAX) - { - #ifdef TEST - fprintf(stderr, "_NXGetXkbCompPath: WARNING! Maximum length of xkbcomp path exceeded.\n"); - #endif - - goto _NXGetXkbCompPathError; - } - - strcpy(_NXXkbCompPath, xkbCompPath); - - #ifdef TEST - fprintf(stderr, "_NXGetXkbCompPath: Using xkbcomp path [%s].\n", - _NXXkbCompPath); - #endif - - return _NXXkbCompPath; - } - - xkbCompPath = NX_ALT_XKBCOMP_PATH; - - if (NXVerifyXkbCompPath(xkbCompPath) == 1) - { - if (strlen(xkbCompPath) + 1 > PATH_MAX) - { - #ifdef TEST - fprintf(stderr, "_NXGetXkbCompPath: WARNING! Maximum length of xkbcomp path exceeded.\n"); - #endif - - goto _NXGetXkbCompPathError; - } - - strcpy(_NXXkbCompPath, xkbCompPath); - - #ifdef TEST - fprintf(stderr, "_NXGetXkbCompPath: Using NX xkbcomp path [%s].\n", - _NXXkbCompPath); - #endif - - return _NXXkbCompPath; - } - -_NXGetXkbCompPathError: - - if (strlen(path) + 1 > PATH_MAX) - { - #ifdef TEST - fprintf(stderr, "_NXGetXkbCompPath: WARNING! Maximum length of xkbcomp path exceeded.\n"); - #endif - } - - strcpy(_NXXkbCompPath, path); - - #ifdef TEST - fprintf(stderr, "_NXGetXkbCompPath: Using default xkbcomp path [%s].\n", - _NXXkbCompPath); - #endif - - return _NXXkbCompPath; -} - -#endif - -static void -OutputDirectory( - char* outdir, - size_t size) -{ -#ifndef WIN32 - if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size) -#ifdef MAKE_XKM_OUTPUT_DIR - && (trans_mkdir(XKM_OUTPUT_DIR, XKM_OUTPUT_DIR_MODE) == 0) -#endif - ) - { - /* if server running as root it *may* be able to write */ - /* FIXME: check whether directory is writable at all */ - (void) strcpy (outdir, XKM_OUTPUT_DIR); - } else -#endif -#ifdef _PATH_VARTMP - if ((strlen(_PATH_VARTMP) + 1) < size) - { - (void) strcpy (outdir, _PATH_VARTMP); - if (outdir[strlen(outdir) - 1] != '/') /* Hi IBM, Digital */ - (void) strcat (outdir, "/"); - } else -#endif -#ifdef WIN32 - if (strlen(Win32TempDir()) + 1 < size) - { - (void) strcpy(outdir, Win32TempDir()); - (void) strcat(outdir, "\\"); - } else -#endif - if (strlen("/tmp/") < size) - { - (void) strcpy (outdir, "/tmp/"); - } -} - -Bool -XkbDDXCompileNamedKeymap( XkbDescPtr xkb, - XkbComponentNamesPtr names, - char * nameRtrn, - int nameRtrnLen) -{ -char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; - - if (names->keymap==NULL) - return False; - strncpy(file,names->keymap,PATH_MAX); file[PATH_MAX-1]= '\0'; - if ((map= strrchr(file,'('))!=NULL) { - char *tmp; - if ((tmp= strrchr(map,')'))!=NULL) { - *map++= '\0'; - *tmp= '\0'; - } - else { - map= NULL; - } - } - if ((outFile= strrchr(file,'/'))!=NULL) - outFile= _XkbDupString(&outFile[1]); - else outFile= _XkbDupString(file); - XkbEnsureSafeMapName(outFile); - OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); - -#ifdef NXAGENT_SERVER - - if (_NXGetXkbCompPath(XkbBaseDirectory) != NULL) - { - -#else - - if (XkbBaseDirectory!=NULL) { - -#endif - -#ifndef __UNIXOS2__ - -#ifdef NXAGENT_SERVER - char *xkbbasedir = _NXGetXkbBasePath(XkbBaseDirectory); - char *xkbbindir = _NXGetXkbCompPath(XkbBinDirectory); -#else - char *xkbbasedir = XkbBaseDirectory; - char *xkbbindir = XkbBinDirectory; -#endif - -#else - /* relocate the basedir and replace the slashes with backslashes */ -#ifdef NXAGENT_SERVER - char *xkbbasedir = (char*)__XOS2RedirRoot(_NXGetXkbBasePath(XkbBaseDirectory)); - char *xkbbindir = (char*)__XOS2RedirRoot(_NXGetXkbCompPath(XkbBinDirectory)); -#else - char *xkbbasedir = (char*)__XOS2RedirRoot(XkbBaseDirectory); - char *xkbbindir = (char*)__XOS2RedirRoot(XkbBinDirectory); -#endif - int i; - - for (i=0; i10)?10:(int)xkbDebugFlags)), - xkbbasedir,(map?"-m ":""),(map?map:""), - PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,file, - xkm_output_dir,outFile); - } - else { - cmd = Xprintf("xkbcomp -w %d -xkm %s%s -em1 %s -emp %s -eml %s keymap/%s \"%s%s.xkm\"", - ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)), - (map?"-m ":""),(map?map:""), - PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,file, - xkm_output_dir,outFile); - } -#ifdef DEBUG - if (xkbDebugFlags) { - ErrorF("XkbDDXCompileNamedKeymap compiling keymap using:\n"); - ErrorF(" \"cmd\"\n"); - } -#endif -#ifdef DEBUG_CMD - ErrorF("xkb executes: %s\n",cmd); -#endif - if (System(cmd)==0) { - if (nameRtrn) { - strncpy(nameRtrn,outFile,nameRtrnLen); - nameRtrn[nameRtrnLen-1]= '\0'; - } - if (outFile!=NULL) - _XkbFree(outFile); - if (cmd!=NULL) - xfree(cmd); - return True; - } -#ifdef DEBUG - ErrorF("Error compiling keymap (%s)\n",names->keymap); -#endif - if (outFile!=NULL) - _XkbFree(outFile); - if (cmd!=NULL) - xfree(cmd); - return False; -} - -Bool -XkbDDXCompileKeymapByNames( XkbDescPtr xkb, - XkbComponentNamesPtr names, - unsigned want, - unsigned need, - char * nameRtrn, - int nameRtrnLen) -{ -FILE * out; -char *buf = NULL, keymap[PATH_MAX],xkm_output_dir[PATH_MAX]; - -#ifdef WIN32 -char tmpname[PATH_MAX]; -#endif - if ((names->keymap==NULL)||(names->keymap[0]=='\0')) { - sprintf(keymap,"server-%s",display); - } - else { - if (strlen(names->keymap) > PATH_MAX - 1) { - ErrorF("name of keymap (%s) exceeds max length\n", names->keymap); - return False; - } - strcpy(keymap,names->keymap); - } - - XkbEnsureSafeMapName(keymap); - OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); -#ifdef WIN32 - strcpy(tmpname, Win32TempDir()); - strcat(tmpname, "\\xkb_XXXXXX"); - (void) mktemp(tmpname); -#endif - -#ifdef NXAGENT_SERVER - if (_NXGetXkbCompPath(XkbBaseDirectory)!=NULL) { -#else - if (XkbBaseDirectory!=NULL) { -#endif - -#ifndef WIN32 - char *xkmfile = "-"; -#else - /* WIN32 has no popen. The input must be stored in a file which is used as input - for xkbcomp. xkbcomp does not read from stdin. */ - char *xkmfile = tmpname; -#endif -#ifndef __UNIXOS2__ -#ifdef NXAGENT_SERVER - char *xkbbasedir = _NXGetXkbBasePath(XkbBaseDirectory); - char *xkbbindir = _NXGetXkbCompPath(XkbBinDirectory); -#else - char *xkbbasedir = XkbBaseDirectory; - char *xkbbindir = XkbBinDirectory; -#endif -#else - int i; -#ifdef NXAGENT_SERVER - char *xkbbasedir = (char*)__XOS2RedirRoot(_NXGetXkbBasePath(XkbBaseDirectory)); - char *xkbbindir = (char*)__XOS2RedirRoot(_NXGetXkbCompPath(XkbBinDirectory)); -#else - char *xkbbasedir = (char*)__XOS2RedirRoot(XkbBaseDirectory); - char *xkbbindir = (char*)__XOS2RedirRoot(XkbBinDirectory); -#endif - for (i=0; i10)?10:(int)xkbDebugFlags)), - xkbbasedir, xkmfile, - PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1, - xkm_output_dir,keymap); - } - else { -#ifndef WIN32 - char *xkmfile = "-"; -#else - char *xkmfile = tmpname; -#endif - buf = Xprintf( - "xkbcomp -w %d -xkm \"%s\" -em1 %s -emp %s -eml %s \"%s%s.xkm\"", - ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)), - xkmfile, - PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1, - xkm_output_dir,keymap); - } - - #ifdef TEST - if (buf != NULL) - fprintf(stderr, "XkbDDXCompileKeymapByNames: " - "Executing command [%s].\n", buf); - else - fprintf(stderr, "XkbDDXCompileKeymapByNames: " - "Callin Popen() with null command.\n"); - #endif - -#ifndef WIN32 - out= Popen(buf,"w"); -#else - out= fopen(tmpname, "w"); -#endif - - if (out!=NULL) { -#ifdef DEBUG - if (xkbDebugFlags) { - ErrorF("XkbDDXCompileKeymapByNames compiling keymap:\n"); - XkbWriteXKBKeymapForNames(stderr,names,NULL,xkb,want,need); - } -#endif - XkbWriteXKBKeymapForNames(out,names,NULL,xkb,want,need); -#ifndef WIN32 -#ifdef __sun - if (Pclose(out) != 0) - { - ErrorF("Warning: Spurious failure reported in Pclose() runnning 'xkbcomp'.\n"); - } - if (1) -#else - if (Pclose(out)==0) -#endif -#else - if (fclose(out)==0 && System(buf) >= 0) -#endif - { -#ifdef DEBUG_CMD - ErrorF("xkb executes: %s\n",buf); - ErrorF("xkbcomp input:\n"); - XkbWriteXKBKeymapForNames(stderr,names,NULL,xkb,want,need); - ErrorF("end xkbcomp input\n"); -#endif - if (nameRtrn) { - strncpy(nameRtrn,keymap,nameRtrnLen); - nameRtrn[nameRtrnLen-1]= '\0'; - } -#if defined(Lynx) && defined(__i386__) && defined(NEED_POPEN_WORKAROUND) - /* somehow popen/pclose is broken on LynxOS AT 2.3.0/2.4.0! - * the problem usually shows up with XF86Setup - * this hack waits at max 5 seconds after pclose() returns - * for the output of the xkbcomp output file. - * I didn't manage to get a patch in time for the 3.2 release - */ - { - int i; - char name[PATH_MAX]; -#ifdef NXAGENT_SERVER - if (_NXGetXkbCompPath(XkbBaseDirectory)!=NULL) - sprintf(name,"%s/%s%s.xkm", _NXGetXkbCompPath(XkbBaseDirectory) - ,xkm_output_dir, keymap); -#else - if (XkbBaseDirectory!=NULL) - sprintf(name,"%s/%s%s.xkm", XkbBaseDirectory - ,xkm_output_dir, keymap); -#endif - else - sprintf(name,"%s%s.xkm", xkm_output_dir, keymap); - for (i = 0; i < 10; i++) { - if (access(name, 0) == 0) break; - usleep(500000); - } -#ifdef DEBUG - if (i) ErrorF(">>>> Waited %d times for %s\n", i, name); -#endif - } -#endif - if (buf != NULL) - xfree (buf); - return True; - } -#ifdef DEBUG - else - ErrorF("Error compiling keymap (%s)\n",keymap); -#endif -#ifdef WIN32 - /* remove the temporary file */ - unlink(tmpname); -#endif - } -#ifdef DEBUG - else { -#ifndef WIN32 - ErrorF("Could not invoke keymap compiler\n"); -#else - ErrorF("Could not open file %s\n", tmpname); -#endif - } -#endif - if (nameRtrn) - nameRtrn[0]= '\0'; - if (buf != NULL) - xfree (buf); - return False; -} - -FILE * -XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen) -{ -char buf[PATH_MAX],xkm_output_dir[PATH_MAX]; -FILE * file; - - buf[0]= '\0'; - if (mapName!=NULL) { - OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); - if ((XkbBaseDirectory!=NULL)&&(xkm_output_dir[0]!='/') -#ifdef WIN32 - &&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':') -#endif - ) { - if (strlen(XkbBaseDirectory)+strlen(xkm_output_dir) - +strlen(mapName)+6 <= PATH_MAX) - { - sprintf(buf,"%s/%s%s.xkm",XkbBaseDirectory, - xkm_output_dir,mapName); - } - } - else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX) - sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName); - if (buf[0] != '\0') - file= fopen(buf,"rb"); - else file= NULL; - } - else file= NULL; - if ((fileNameRtrn!=NULL)&&(fileNameRtrnLen>0)) { - strncpy(fileNameRtrn,buf,fileNameRtrnLen); - buf[fileNameRtrnLen-1]= '\0'; - } - return file; -} - -unsigned -XkbDDXLoadKeymapByNames( DeviceIntPtr keybd, - XkbComponentNamesPtr names, - unsigned want, - unsigned need, - XkbFileInfo * finfoRtrn, - char * nameRtrn, - int nameRtrnLen) -{ -XkbDescPtr xkb; -FILE * file; -char fileName[PATH_MAX]; -unsigned missing; - - bzero(finfoRtrn,sizeof(XkbFileInfo)); - if ((keybd==NULL)||(keybd->key==NULL)||(keybd->key->xkbInfo==NULL)) - xkb= NULL; - else xkb= keybd->key->xkbInfo->desc; - if ((names->keycodes==NULL)&&(names->types==NULL)&& - (names->compat==NULL)&&(names->symbols==NULL)&& - (names->geometry==NULL)) { - if (names->keymap==NULL) { - bzero(finfoRtrn,sizeof(XkbFileInfo)); - if (xkb && XkbDetermineFileType(finfoRtrn,XkbXKMFile,NULL) && - ((finfoRtrn->defined&need)==need) ) { - finfoRtrn->xkb= xkb; - nameRtrn[0]= '\0'; - return finfoRtrn->defined; - } - return 0; - } - else if (!XkbDDXCompileNamedKeymap(xkb,names,nameRtrn,nameRtrnLen)) { -#ifdef NOISY - ErrorF("Couldn't compile keymap file\n"); -#endif - return 0; - } - } - else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need, - nameRtrn,nameRtrnLen)){ -#ifdef NOISY - ErrorF("Couldn't compile keymap file\n"); -#endif - return 0; - } - file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX); - if (file==NULL) { - LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n",fileName); - return 0; - } - missing= XkmReadFile(file,need,want,finfoRtrn); - if (finfoRtrn->xkb==NULL) { - LogMessage(X_ERROR, "Error loading keymap %s\n",fileName); - fclose(file); - (void) unlink (fileName); - return 0; - } -#ifdef DEBUG - else if (xkbDebugFlags) { - ErrorF("Loaded %s, defined=0x%x\n",fileName,finfoRtrn->defined); - } -#endif - fclose(file); - (void) unlink (fileName); - return (need|want)&(~missing); -} - -Bool -XkbDDXNamesFromRules( DeviceIntPtr keybd, - char * rules_name, - XkbRF_VarDefsPtr defs, - XkbComponentNamesPtr names) -{ -char buf[PATH_MAX]; -FILE * file; -Bool complete; -XkbRF_RulesPtr rules; - - if (!rules_name) - return False; - if (XkbBaseDirectory==NULL) { - if (strlen(rules_name)+7 > PATH_MAX) - return False; - sprintf(buf,"rules/%s",rules_name); - } - else { - if (strlen(XkbBaseDirectory)+strlen(rules_name)+8 > PATH_MAX) - return False; - sprintf(buf,"%s/rules/%s",XkbBaseDirectory,rules_name); - } - if ((file= fopen(buf,"r"))==NULL) - return False; - if ((rules= XkbRF_Create(0,0))==NULL) { - fclose(file); - return False; - } - if (!XkbRF_LoadRules(file,rules)) { - fclose(file); - XkbRF_Free(rules,True); - return False; - } - bzero((char *)names,sizeof(XkbComponentNamesRec)); - complete= XkbRF_GetComponents(rules,defs,names); - fclose(file); - XkbRF_Free(rules,True); - return complete; -} - - diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c.X.original b/nx-X11/programs/Xserver/xkb/ddxLoad.c.X.original deleted file mode 100644 index e355b1796..000000000 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c.X.original +++ /dev/null @@ -1,604 +0,0 @@ -/* $Xorg: ddxLoad.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ -/************************************************************ -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. - -********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxLoad.c,v 3.35 2003/10/02 13:30:12 eich Exp $ */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef HAVE_XKB_CONFIG_H -#include -#endif - -#include -#include -#define NEED_EVENTS 1 -#include -#include -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#define XKBSRV_NEED_FILE_FUNCS -#include -#include -#include "xkb.h" - -#if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(AIXV3) || defined(__osf__) || defined(__GNU__) -#include -#endif - -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif -#endif - - /* - * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is - * relative to the top-level XKB configuration directory. - * Making the server write to a subdirectory of that directory - * requires some work in the general case (install procedure - * has to create links to /var or somesuch on many machines), - * so we just compile into /usr/tmp for now. - */ -#ifndef XKM_OUTPUT_DIR -#define XKM_OUTPUT_DIR "compiled/" -#endif - -#define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\"" -#define ERROR_PREFIX "\"> \"" -#define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" -#define POST_ERROR_MSG2 "\"End of messages from xkbcomp\"" - -#if defined(__UNIXOS2__) || defined(WIN32) -#define PATHSEPARATOR "\\" -#else -#define PATHSEPARATOR "/" -#endif - -#ifdef WIN32 - -#include -const char* -Win32TempDir() -{ - static char buffer[PATH_MAX]; - if (GetTempPath(sizeof(buffer), buffer)) - { - int len; - buffer[sizeof(buffer)-1] = 0; - len = strlen(buffer); - if (len > 0) - if (buffer[len-1] == '\\') - buffer[len-1] = 0; - return buffer; - } - if (getenv("TEMP") != NULL) - return getenv("TEMP"); - else if (getenv("TMP") != NULL) - return getenv("TEMP"); - else - return "/tmp"; -} - -int -Win32System(const char *cmdline) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - DWORD dwExitCode; - char *cmd = xstrdup(cmdline); - - ZeroMemory( &si, sizeof(si) ); - si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - - if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - { - LPVOID buffer; - if (!FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &buffer, - 0, - NULL )) - { - ErrorF("Starting '%s' failed!\n", cmdline); - } - else - { - ErrorF("Starting '%s' failed: %s", cmdline, (char *)buffer); - LocalFree(buffer); - } - - xfree(cmd); - return -1; - } - /* Wait until child process exits. */ - WaitForSingleObject( pi.hProcess, INFINITE ); - - GetExitCodeProcess( pi.hProcess, &dwExitCode); - - /* Close process and thread handles. */ - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); - xfree(cmd); - - return dwExitCode; -} -#undef System -#define System(x) Win32System(x) -#endif - -#ifdef MAKE_XKM_OUTPUT_DIR -/* Borrow trans_mkdir from Xtransutil.c to more safely make directories */ -# undef X11_t -# define TRANS_SERVER -# define PRMSG(lvl,x,a,b,c) \ - if (lvl <= 1) { LogMessage(X_ERROR,x,a,b,c); } else ((void)0) -# include -# ifndef XKM_OUTPUT_DIR_MODE -# define XKM_OUTPUT_DIR_MODE 0755 -# endif -#endif - -static void -OutputDirectory( - char* outdir, - size_t size) -{ -#ifndef WIN32 - if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size) -#ifdef MAKE_XKM_OUTPUT_DIR - && (trans_mkdir(XKM_OUTPUT_DIR, XKM_OUTPUT_DIR_MODE) == 0) -#endif - ) - { - /* if server running as root it *may* be able to write */ - /* FIXME: check whether directory is writable at all */ - (void) strcpy (outdir, XKM_OUTPUT_DIR); - } else -#endif -#ifdef _PATH_VARTMP - if ((strlen(_PATH_VARTMP) + 1) < size) - { - (void) strcpy (outdir, _PATH_VARTMP); - if (outdir[strlen(outdir) - 1] != '/') /* Hi IBM, Digital */ - (void) strcat (outdir, "/"); - } else -#endif -#ifdef WIN32 - if (strlen(Win32TempDir()) + 1 < size) - { - (void) strcpy(outdir, Win32TempDir()); - (void) strcat(outdir, "\\"); - } else -#endif - if (strlen("/tmp/") < size) - { - (void) strcpy (outdir, "/tmp/"); - } -} - -Bool -XkbDDXCompileNamedKeymap( XkbDescPtr xkb, - XkbComponentNamesPtr names, - char * nameRtrn, - int nameRtrnLen) -{ -char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; - - if (names->keymap==NULL) - return False; - strncpy(file,names->keymap,PATH_MAX); file[PATH_MAX-1]= '\0'; - if ((map= strrchr(file,'('))!=NULL) { - char *tmp; - if ((tmp= strrchr(map,')'))!=NULL) { - *map++= '\0'; - *tmp= '\0'; - } - else { - map= NULL; - } - } - if ((outFile= strrchr(file,'/'))!=NULL) - outFile= _XkbDupString(&outFile[1]); - else outFile= _XkbDupString(file); - XkbEnsureSafeMapName(outFile); - OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); - - if (XkbBaseDirectory!=NULL) { -#ifndef __UNIXOS2__ - char *xkbbasedir = XkbBaseDirectory; - char *xkbbindir = XkbBinDirectory; -#else - /* relocate the basedir and replace the slashes with backslashes */ - char *xkbbasedir = (char*)__XOS2RedirRoot(XkbBaseDirectory); - char *xkbbindir = (char*)__XOS2RedirRoot(XkbBinDirectory); - int i; - - for (i=0; i10)?10:(int)xkbDebugFlags)), - xkbbasedir,(map?"-m ":""),(map?map:""), - PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,file, - xkm_output_dir,outFile); - } - else { - cmd = Xprintf("xkbcomp -w %d -xkm %s%s -em1 %s -emp %s -eml %s keymap/%s \"%s%s.xkm\"", - ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)), - (map?"-m ":""),(map?map:""), - PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1,file, - xkm_output_dir,outFile); - } -#ifdef DEBUG - if (xkbDebugFlags) { - ErrorF("XkbDDXCompileNamedKeymap compiling keymap using:\n"); - ErrorF(" \"cmd\"\n"); - } -#endif -#ifdef DEBUG_CMD - ErrorF("xkb executes: %s\n",cmd); -#endif - if (System(cmd)==0) { - if (nameRtrn) { - strncpy(nameRtrn,outFile,nameRtrnLen); - nameRtrn[nameRtrnLen-1]= '\0'; - } - if (outFile!=NULL) - _XkbFree(outFile); - if (cmd!=NULL) - xfree(cmd); - return True; - } -#ifdef DEBUG - ErrorF("Error compiling keymap (%s)\n",names->keymap); -#endif - if (outFile!=NULL) - _XkbFree(outFile); - if (cmd!=NULL) - xfree(cmd); - return False; -} - -Bool -XkbDDXCompileKeymapByNames( XkbDescPtr xkb, - XkbComponentNamesPtr names, - unsigned want, - unsigned need, - char * nameRtrn, - int nameRtrnLen) -{ -FILE * out; -char *buf = NULL, keymap[PATH_MAX],xkm_output_dir[PATH_MAX]; - -#ifdef WIN32 -char tmpname[PATH_MAX]; -#endif - if ((names->keymap==NULL)||(names->keymap[0]=='\0')) { - sprintf(keymap,"server-%s",display); - } - else { - if (strlen(names->keymap) > PATH_MAX - 1) { - ErrorF("name of keymap (%s) exceeds max length\n", names->keymap); - return False; - } - strcpy(keymap,names->keymap); - } - - XkbEnsureSafeMapName(keymap); - OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); -#ifdef WIN32 - strcpy(tmpname, Win32TempDir()); - strcat(tmpname, "\\xkb_XXXXXX"); - (void) mktemp(tmpname); -#endif - if (XkbBaseDirectory!=NULL) { -#ifndef WIN32 - char *xkmfile = "-"; -#else - /* WIN32 has no popen. The input must be stored in a file which is used as input - for xkbcomp. xkbcomp does not read from stdin. */ - char *xkmfile = tmpname; -#endif -#ifndef __UNIXOS2__ - char *xkbbasedir = XkbBaseDirectory; - char *xkbbindir = XkbBinDirectory; -#else - int i; - char *xkbbasedir = (char*)__XOS2RedirRoot(XkbBaseDirectory); - char *xkbbindir = (char*)__XOS2RedirRoot(XkbBinDirectory); - for (i=0; i10)?10:(int)xkbDebugFlags)), - xkbbasedir, xkmfile, - PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1, - xkm_output_dir,keymap); - } - else { -#ifndef WIN32 - char *xkmfile = "-"; -#else - char *xkmfile = tmpname; -#endif - buf = Xprintf( - "xkbcomp -w %d -xkm \"%s\" -em1 %s -emp %s -eml %s \"%s%s.xkm\"", - ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)), - xkmfile, - PRE_ERROR_MSG,ERROR_PREFIX,POST_ERROR_MSG1, - xkm_output_dir,keymap); - } - -#ifndef WIN32 - out= Popen(buf,"w"); -#else - out= fopen(tmpname, "w"); -#endif - - if (out!=NULL) { -#ifdef DEBUG - if (xkbDebugFlags) { - ErrorF("XkbDDXCompileKeymapByNames compiling keymap:\n"); - XkbWriteXKBKeymapForNames(stderr,names,NULL,xkb,want,need); - } -#endif - XkbWriteXKBKeymapForNames(out,names,NULL,xkb,want,need); -#ifndef WIN32 - if (Pclose(out)==0) -#else - if (fclose(out)==0 && System(buf) >= 0) -#endif - { -#ifdef DEBUG_CMD - ErrorF("xkb executes: %s\n",buf); - ErrorF("xkbcomp input:\n"); - XkbWriteXKBKeymapForNames(stderr,names,NULL,xkb,want,need); - ErrorF("end xkbcomp input\n"); -#endif - if (nameRtrn) { - strncpy(nameRtrn,keymap,nameRtrnLen); - nameRtrn[nameRtrnLen-1]= '\0'; - } -#if defined(Lynx) && defined(__i386__) && defined(NEED_POPEN_WORKAROUND) - /* somehow popen/pclose is broken on LynxOS AT 2.3.0/2.4.0! - * the problem usually shows up with XF86Setup - * this hack waits at max 5 seconds after pclose() returns - * for the output of the xkbcomp output file. - * I didn't manage to get a patch in time for the 3.2 release - */ - { - int i; - char name[PATH_MAX]; - if (XkbBaseDirectory!=NULL) - sprintf(name,"%s/%s%s.xkm", XkbBaseDirectory - ,xkm_output_dir, keymap); - else - sprintf(name,"%s%s.xkm", xkm_output_dir, keymap); - for (i = 0; i < 10; i++) { - if (access(name, 0) == 0) break; - usleep(500000); - } -#ifdef DEBUG - if (i) ErrorF(">>>> Waited %d times for %s\n", i, name); -#endif - } -#endif - if (buf != NULL) - xfree (buf); - return True; - } -#ifdef DEBUG - else - ErrorF("Error compiling keymap (%s)\n",keymap); -#endif -#ifdef WIN32 - /* remove the temporary file */ - unlink(tmpname); -#endif - } -#ifdef DEBUG - else { -#ifndef WIN32 - ErrorF("Could not invoke keymap compiler\n"); -#else - ErrorF("Could not open file %s\n", tmpname); -#endif - } -#endif - if (nameRtrn) - nameRtrn[0]= '\0'; - if (buf != NULL) - xfree (buf); - return False; -} - -FILE * -XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen) -{ -char buf[PATH_MAX],xkm_output_dir[PATH_MAX]; -FILE * file; - - buf[0]= '\0'; - if (mapName!=NULL) { - OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); - if ((XkbBaseDirectory!=NULL)&&(xkm_output_dir[0]!='/') -#ifdef WIN32 - &&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':') -#endif - ) { - if (strlen(XkbBaseDirectory)+strlen(xkm_output_dir) - +strlen(mapName)+6 <= PATH_MAX) - { - sprintf(buf,"%s/%s%s.xkm",XkbBaseDirectory, - xkm_output_dir,mapName); - } - } - else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX) - sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName); - if (buf[0] != '\0') - file= fopen(buf,"rb"); - else file= NULL; - } - else file= NULL; - if ((fileNameRtrn!=NULL)&&(fileNameRtrnLen>0)) { - strncpy(fileNameRtrn,buf,fileNameRtrnLen); - buf[fileNameRtrnLen-1]= '\0'; - } - return file; -} - -unsigned -XkbDDXLoadKeymapByNames( DeviceIntPtr keybd, - XkbComponentNamesPtr names, - unsigned want, - unsigned need, - XkbFileInfo * finfoRtrn, - char * nameRtrn, - int nameRtrnLen) -{ -XkbDescPtr xkb; -FILE * file; -char fileName[PATH_MAX]; -unsigned missing; - - bzero(finfoRtrn,sizeof(XkbFileInfo)); - if ((keybd==NULL)||(keybd->key==NULL)||(keybd->key->xkbInfo==NULL)) - xkb= NULL; - else xkb= keybd->key->xkbInfo->desc; - if ((names->keycodes==NULL)&&(names->types==NULL)&& - (names->compat==NULL)&&(names->symbols==NULL)&& - (names->geometry==NULL)) { - if (names->keymap==NULL) { - bzero(finfoRtrn,sizeof(XkbFileInfo)); - if (xkb && XkbDetermineFileType(finfoRtrn,XkbXKMFile,NULL) && - ((finfoRtrn->defined&need)==need) ) { - finfoRtrn->xkb= xkb; - nameRtrn[0]= '\0'; - return finfoRtrn->defined; - } - return 0; - } - else if (!XkbDDXCompileNamedKeymap(xkb,names,nameRtrn,nameRtrnLen)) { -#ifdef NOISY - ErrorF("Couldn't compile keymap file\n"); -#endif - return 0; - } - } - else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need, - nameRtrn,nameRtrnLen)){ -#ifdef NOISY - ErrorF("Couldn't compile keymap file\n"); -#endif - return 0; - } - file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX); - if (file==NULL) { - LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n",fileName); - return 0; - } - missing= XkmReadFile(file,need,want,finfoRtrn); - if (finfoRtrn->xkb==NULL) { - LogMessage(X_ERROR, "Error loading keymap %s\n",fileName); - fclose(file); - (void) unlink (fileName); - return 0; - } -#ifdef DEBUG - else if (xkbDebugFlags) { - ErrorF("Loaded %s, defined=0x%x\n",fileName,finfoRtrn->defined); - } -#endif - fclose(file); - (void) unlink (fileName); - return (need|want)&(~missing); -} - -Bool -XkbDDXNamesFromRules( DeviceIntPtr keybd, - char * rules_name, - XkbRF_VarDefsPtr defs, - XkbComponentNamesPtr names) -{ -char buf[PATH_MAX]; -FILE * file; -Bool complete; -XkbRF_RulesPtr rules; - - if (!rules_name) - return False; - if (XkbBaseDirectory==NULL) { - if (strlen(rules_name)+7 > PATH_MAX) - return False; - sprintf(buf,"rules/%s",rules_name); - } - else { - if (strlen(XkbBaseDirectory)+strlen(rules_name)+8 > PATH_MAX) - return False; - sprintf(buf,"%s/rules/%s",XkbBaseDirectory,rules_name); - } - if ((file= fopen(buf,"r"))==NULL) - return False; - if ((rules= XkbRF_Create(0,0))==NULL) { - fclose(file); - return False; - } - if (!XkbRF_LoadRules(file,rules)) { - fclose(file); - XkbRF_Free(rules,True); - return False; - } - bzero((char *)names,sizeof(XkbComponentNamesRec)); - complete= XkbRF_GetComponents(rules,defs,names); - fclose(file); - XkbRF_Free(rules,True); - return complete; -} - - diff --git a/nx-X11/programs/Xserver/xkb/xkbDflts.h.NX.original b/nx-X11/programs/Xserver/xkb/xkbDflts.h.NX.original deleted file mode 100644 index e0b54c55b..000000000 --- a/nx-X11/programs/Xserver/xkb/xkbDflts.h.NX.original +++ /dev/null @@ -1,524 +0,0 @@ -/* $Xorg: xkbDflts.h,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */ -/* $XFree86: xc/programs/Xserver/xkb/xkbDflts.h,v 1.2 2001/10/28 03:34:20 tsi Exp $ */ -/* This file generated automatically by xkbcomp */ -/* DO NOT EDIT */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef DEFAULT_H -#define DEFAULT_H 1 - -#ifndef XKB_IN_SERVER -#define GET_ATOM(d,s) XInternAtom(d,s,0) -#define DPYTYPE Display * -#else -#define GET_ATOM(d,s) MakeAtom(s,strlen(s),1) -#define DPYTYPE char * -#endif -#define NUM_KEYS 1 - -#define vmod_NumLock 0 -#define vmod_Alt 1 -#define vmod_LevelThree 2 -#define vmod_AltGr 3 -#define vmod_ScrollLock 4 - -#define vmod_NumLockMask (1<<0) -#define vmod_AltMask (1<<1) -#define vmod_LevelThreeMask (1<<2) -#define vmod_AltGrMask (1<<3) -#define vmod_ScrollLockMask (1<<4) - -/* types name is "default" */ -static Atom lnames_ONE_LEVEL[1]; - -static XkbKTMapEntryRec map_TWO_LEVEL[1]= { - { 1, 1, { ShiftMask, ShiftMask, 0 } } -}; -static Atom lnames_TWO_LEVEL[2]; - -static XkbKTMapEntryRec map_ALPHABETIC[2]= { - { 1, 1, { ShiftMask, ShiftMask, 0 } }, - { 1, 0, { LockMask, LockMask, 0 } } -}; -static XkbModsRec preserve_ALPHABETIC[2]= { - { 0, 0, 0 }, - { LockMask, LockMask, 0 } -}; -static Atom lnames_ALPHABETIC[2]; - -static XkbKTMapEntryRec map_KEYPAD[2]= { - { 1, 1, { ShiftMask, ShiftMask, 0 } }, - { 0, 1, { 0, 0, vmod_NumLockMask } } -}; -static Atom lnames_KEYPAD[2]; - -static XkbKTMapEntryRec map_PC_BREAK[1]= { - { 1, 1, { ControlMask, ControlMask, 0 } } -}; -static Atom lnames_PC_BREAK[2]; - -static XkbKTMapEntryRec map_PC_SYSRQ[1]= { - { 0, 1, { 0, 0, vmod_AltMask } } -}; -static Atom lnames_PC_SYSRQ[2]; - -static XkbKTMapEntryRec map_CTRL_ALT[1]= { - { 0, 1, { ControlMask, ControlMask, vmod_AltMask } } -}; -static Atom lnames_CTRL_ALT[2]; - -static XkbKTMapEntryRec map_THREE_LEVEL[3]= { - { 1, 1, { ShiftMask, ShiftMask, 0 } }, - { 0, 2, { 0, 0, vmod_LevelThreeMask } }, - { 0, 2, { ShiftMask, ShiftMask, vmod_LevelThreeMask } } -}; -static Atom lnames_THREE_LEVEL[3]; - -static XkbKTMapEntryRec map_SHIFT_ALT[1]= { - { 0, 1, { ShiftMask, ShiftMask, vmod_AltMask } } -}; -static Atom lnames_SHIFT_ALT[2]; - -static XkbKeyTypeRec dflt_types[]= { - { - { 0, 0, 0 }, - 1, - 0, NULL, NULL, - None, lnames_ONE_LEVEL - }, - { - { ShiftMask, ShiftMask, 0 }, - 2, - 1, map_TWO_LEVEL, NULL, - None, lnames_TWO_LEVEL - }, - { - { ShiftMask|LockMask, ShiftMask|LockMask, 0 }, - 2, - 2, map_ALPHABETIC, preserve_ALPHABETIC, - None, lnames_ALPHABETIC - }, - { - { ShiftMask, ShiftMask, vmod_NumLockMask }, - 2, - 2, map_KEYPAD, NULL, - None, lnames_KEYPAD - }, - { - { ControlMask, ControlMask, 0 }, - 2, - 1, map_PC_BREAK, NULL, - None, lnames_PC_BREAK - }, - { - { 0, 0, vmod_AltMask }, - 2, - 1, map_PC_SYSRQ, NULL, - None, lnames_PC_SYSRQ - }, - { - { ControlMask, ControlMask, vmod_AltMask }, - 2, - 1, map_CTRL_ALT, NULL, - None, lnames_CTRL_ALT - }, - { - { ShiftMask, ShiftMask, vmod_LevelThreeMask }, - 3, - 3, map_THREE_LEVEL, NULL, - None, lnames_THREE_LEVEL - }, - { - { ShiftMask, ShiftMask, vmod_AltMask }, - 2, - 1, map_SHIFT_ALT, NULL, - None, lnames_SHIFT_ALT - } -}; -#define num_dflt_types (sizeof(dflt_types)/sizeof(XkbKeyTypeRec)) - - -static void -initTypeNames(DPYTYPE dpy) -{ - dflt_types[0].name= GET_ATOM(dpy,"ONE_LEVEL"); - lnames_ONE_LEVEL[0]= GET_ATOM(dpy,"Any"); - dflt_types[1].name= GET_ATOM(dpy,"TWO_LEVEL"); - lnames_TWO_LEVEL[0]= GET_ATOM(dpy,"Base"); - lnames_TWO_LEVEL[1]= GET_ATOM(dpy,"Shift"); - dflt_types[2].name= GET_ATOM(dpy,"ALPHABETIC"); - lnames_ALPHABETIC[0]= GET_ATOM(dpy,"Base"); - lnames_ALPHABETIC[1]= GET_ATOM(dpy,"Caps"); - dflt_types[3].name= GET_ATOM(dpy,"KEYPAD"); - lnames_KEYPAD[0]= GET_ATOM(dpy,"Base"); - lnames_KEYPAD[1]= GET_ATOM(dpy,"Number"); - dflt_types[4].name= GET_ATOM(dpy,"PC_BREAK"); - lnames_PC_BREAK[0]= GET_ATOM(dpy,"Base"); - lnames_PC_BREAK[1]= GET_ATOM(dpy,"Control"); - dflt_types[5].name= GET_ATOM(dpy,"PC_SYSRQ"); - lnames_PC_SYSRQ[0]= GET_ATOM(dpy,"Base"); - lnames_PC_SYSRQ[1]= GET_ATOM(dpy,"Alt"); - dflt_types[6].name= GET_ATOM(dpy,"CTRL+ALT"); - lnames_CTRL_ALT[0]= GET_ATOM(dpy,"Base"); - lnames_CTRL_ALT[1]= GET_ATOM(dpy,"Ctrl+Alt"); - dflt_types[7].name= GET_ATOM(dpy,"THREE_LEVEL"); - lnames_THREE_LEVEL[0]= GET_ATOM(dpy,"Base"); - lnames_THREE_LEVEL[1]= GET_ATOM(dpy,"Shift"); - lnames_THREE_LEVEL[2]= GET_ATOM(dpy,"Level3"); - dflt_types[8].name= GET_ATOM(dpy,"SHIFT+ALT"); - lnames_SHIFT_ALT[0]= GET_ATOM(dpy,"Base"); - lnames_SHIFT_ALT[1]= GET_ATOM(dpy,"Shift+Alt"); -} -/* compat name is "default" */ -static XkbSymInterpretRec dfltSI[69]= { - { XK_ISO_Level2_Latch, 0x0000, - XkbSI_LevelOneOnly|XkbSI_Exactly, ShiftMask, - 255, - { XkbSA_LatchMods, { 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Eisu_Shift, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Eisu_toggle, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Kana_Shift, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Kana_Lock, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Shift_Lock, 0x0000, - XkbSI_AnyOf, ShiftMask|LockMask, - 255, - { XkbSA_LockMods, { 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Num_Lock, 0x0000, - XkbSI_AnyOf, 0xff, - 0, - { XkbSA_LockMods, { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_Alt_L, 0x0000, - XkbSI_AnyOf, 0xff, - 1, - { XkbSA_SetMods, { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Alt_R, 0x0000, - XkbSI_AnyOf, 0xff, - 1, - { XkbSA_SetMods, { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Scroll_Lock, 0x0000, - XkbSI_AnyOf, 0xff, - 4, - { XkbSA_LockMods, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Lock, 0x0000, - XkbSI_AnyOf, 0xff, - 255, - { XkbSA_ISOLock, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Level3_Shift, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOf, 0xff, - 2, - { XkbSA_SetMods, { 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00 } } }, - { XK_ISO_Level3_Latch, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOf, 0xff, - 2, - { XkbSA_LatchMods, { 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00 } } }, - { XK_Mode_switch, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff, - 3, - { XkbSA_SetGroup, { 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_1, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_End, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_2, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_Down, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_3, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_Next, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_4, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Left, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_6, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Right, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_7, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_Home, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_8, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_Up, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_9, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_Prior, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_5, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Begin, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_F1, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Divide, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_F2, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Multiply, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_F3, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Subtract, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Separator, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Add, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_0, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Insert, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Decimal, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Delete, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Button_Dflt, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Button1, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Button2, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Button3, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DblClick_Dflt, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DblClick1, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DblClick2, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DblClick3, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Drag_Dflt, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Drag1, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Drag2, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Drag3, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_EnableKeys, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00 } } }, - { XK_Pointer_Accelerate, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00 } } }, - { XK_Pointer_DfltBtnNext, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DfltBtnPrev, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_AccessX_Enable, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00 } } }, - -#ifndef NX_TRANS_SOCKET - - /* - * Make sure that the server can't be killed - * by pressing this key-sequence. - */ - - { XK_Terminate_Server, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_Terminate, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - -#endif - - { XK_ISO_Group_Latch, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff, - 3, - { XkbSA_LatchGroup, { 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Next_Group, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff, - 3, - { XkbSA_LockGroup, { 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Prev_Group, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff, - 3, - { XkbSA_LockGroup, { 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_First_Group, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockGroup, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Last_Group, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockGroup, { 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { NoSymbol, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_LockMods, { 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { NoSymbol, 0x0000, - XkbSI_AnyOf, 0xff, - 255, - { XkbSA_SetMods, { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } } -}; -#define num_dfltSI (sizeof(dfltSI)/sizeof(XkbSymInterpretRec)) - -static XkbCompatMapRec compatMap= { - dfltSI, - { /* group compatibility */ - { 0, 0, 0 }, - { 0, 0, vmod_AltGrMask }, - { 0, 0, vmod_AltGrMask }, - { 0, 0, vmod_AltGrMask } - }, - num_dfltSI, num_dfltSI -}; - -static XkbIndicatorRec indicators= { - 0x0, - { - { 0x80, 0, 0x00, XkbIM_UseEffective, { LockMask, LockMask, 0 }, 0 }, - { 0x80, 0, 0x00, XkbIM_UseEffective, { 0, 0, vmod_NumLockMask }, 0 }, - { 0x80, 0, 0x00, XkbIM_UseLocked, { ShiftMask, ShiftMask, 0 }, 0 }, - { 0x80, 0, 0x00, 0, { 0, 0, 0 }, XkbMouseKeysMask }, - { 0x80, 0, 0x00, XkbIM_UseLocked, { 0, 0, vmod_ScrollLockMask }, 0 }, - { 0x80, XkbIM_UseEffective, 0xfe, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 } - } -}; -static void -initIndicatorNames(DPYTYPE dpy,XkbDescPtr xkb) -{ - xkb->names->indicators[ 0]= GET_ATOM(dpy,"Caps Lock"); - xkb->names->indicators[ 1]= GET_ATOM(dpy,"Num Lock"); - xkb->names->indicators[ 2]= GET_ATOM(dpy,"Shift Lock"); - xkb->names->indicators[ 3]= GET_ATOM(dpy,"Mouse Keys"); - xkb->names->indicators[ 4]= GET_ATOM(dpy,"Scroll Lock"); - xkb->names->indicators[ 5]= GET_ATOM(dpy,"Group 2"); -} -#endif /* DEFAULT_H */ diff --git a/nx-X11/programs/Xserver/xkb/xkbDflts.h.X.original b/nx-X11/programs/Xserver/xkb/xkbDflts.h.X.original deleted file mode 100644 index e3dd9cdda..000000000 --- a/nx-X11/programs/Xserver/xkb/xkbDflts.h.X.original +++ /dev/null @@ -1,513 +0,0 @@ -/* $Xorg: xkbDflts.h,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */ -/* $XFree86: xc/programs/Xserver/xkb/xkbDflts.h,v 1.2 2001/10/28 03:34:20 tsi Exp $ */ -/* This file generated automatically by xkbcomp */ -/* DO NOT EDIT */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef DEFAULT_H -#define DEFAULT_H 1 - -#ifndef XKB_IN_SERVER -#define GET_ATOM(d,s) XInternAtom(d,s,0) -#define DPYTYPE Display * -#else -#define GET_ATOM(d,s) MakeAtom(s,strlen(s),1) -#define DPYTYPE char * -#endif -#define NUM_KEYS 1 - -#define vmod_NumLock 0 -#define vmod_Alt 1 -#define vmod_LevelThree 2 -#define vmod_AltGr 3 -#define vmod_ScrollLock 4 - -#define vmod_NumLockMask (1<<0) -#define vmod_AltMask (1<<1) -#define vmod_LevelThreeMask (1<<2) -#define vmod_AltGrMask (1<<3) -#define vmod_ScrollLockMask (1<<4) - -/* types name is "default" */ -static Atom lnames_ONE_LEVEL[1]; - -static XkbKTMapEntryRec map_TWO_LEVEL[1]= { - { 1, 1, { ShiftMask, ShiftMask, 0 } } -}; -static Atom lnames_TWO_LEVEL[2]; - -static XkbKTMapEntryRec map_ALPHABETIC[2]= { - { 1, 1, { ShiftMask, ShiftMask, 0 } }, - { 1, 0, { LockMask, LockMask, 0 } } -}; -static XkbModsRec preserve_ALPHABETIC[2]= { - { 0, 0, 0 }, - { LockMask, LockMask, 0 } -}; -static Atom lnames_ALPHABETIC[2]; - -static XkbKTMapEntryRec map_KEYPAD[2]= { - { 1, 1, { ShiftMask, ShiftMask, 0 } }, - { 0, 1, { 0, 0, vmod_NumLockMask } } -}; -static Atom lnames_KEYPAD[2]; - -static XkbKTMapEntryRec map_PC_BREAK[1]= { - { 1, 1, { ControlMask, ControlMask, 0 } } -}; -static Atom lnames_PC_BREAK[2]; - -static XkbKTMapEntryRec map_PC_SYSRQ[1]= { - { 0, 1, { 0, 0, vmod_AltMask } } -}; -static Atom lnames_PC_SYSRQ[2]; - -static XkbKTMapEntryRec map_CTRL_ALT[1]= { - { 0, 1, { ControlMask, ControlMask, vmod_AltMask } } -}; -static Atom lnames_CTRL_ALT[2]; - -static XkbKTMapEntryRec map_THREE_LEVEL[3]= { - { 1, 1, { ShiftMask, ShiftMask, 0 } }, - { 0, 2, { 0, 0, vmod_LevelThreeMask } }, - { 0, 2, { ShiftMask, ShiftMask, vmod_LevelThreeMask } } -}; -static Atom lnames_THREE_LEVEL[3]; - -static XkbKTMapEntryRec map_SHIFT_ALT[1]= { - { 0, 1, { ShiftMask, ShiftMask, vmod_AltMask } } -}; -static Atom lnames_SHIFT_ALT[2]; - -static XkbKeyTypeRec dflt_types[]= { - { - { 0, 0, 0 }, - 1, - 0, NULL, NULL, - None, lnames_ONE_LEVEL - }, - { - { ShiftMask, ShiftMask, 0 }, - 2, - 1, map_TWO_LEVEL, NULL, - None, lnames_TWO_LEVEL - }, - { - { ShiftMask|LockMask, ShiftMask|LockMask, 0 }, - 2, - 2, map_ALPHABETIC, preserve_ALPHABETIC, - None, lnames_ALPHABETIC - }, - { - { ShiftMask, ShiftMask, vmod_NumLockMask }, - 2, - 2, map_KEYPAD, NULL, - None, lnames_KEYPAD - }, - { - { ControlMask, ControlMask, 0 }, - 2, - 1, map_PC_BREAK, NULL, - None, lnames_PC_BREAK - }, - { - { 0, 0, vmod_AltMask }, - 2, - 1, map_PC_SYSRQ, NULL, - None, lnames_PC_SYSRQ - }, - { - { ControlMask, ControlMask, vmod_AltMask }, - 2, - 1, map_CTRL_ALT, NULL, - None, lnames_CTRL_ALT - }, - { - { ShiftMask, ShiftMask, vmod_LevelThreeMask }, - 3, - 3, map_THREE_LEVEL, NULL, - None, lnames_THREE_LEVEL - }, - { - { ShiftMask, ShiftMask, vmod_AltMask }, - 2, - 1, map_SHIFT_ALT, NULL, - None, lnames_SHIFT_ALT - } -}; -#define num_dflt_types (sizeof(dflt_types)/sizeof(XkbKeyTypeRec)) - - -static void -initTypeNames(DPYTYPE dpy) -{ - dflt_types[0].name= GET_ATOM(dpy,"ONE_LEVEL"); - lnames_ONE_LEVEL[0]= GET_ATOM(dpy,"Any"); - dflt_types[1].name= GET_ATOM(dpy,"TWO_LEVEL"); - lnames_TWO_LEVEL[0]= GET_ATOM(dpy,"Base"); - lnames_TWO_LEVEL[1]= GET_ATOM(dpy,"Shift"); - dflt_types[2].name= GET_ATOM(dpy,"ALPHABETIC"); - lnames_ALPHABETIC[0]= GET_ATOM(dpy,"Base"); - lnames_ALPHABETIC[1]= GET_ATOM(dpy,"Caps"); - dflt_types[3].name= GET_ATOM(dpy,"KEYPAD"); - lnames_KEYPAD[0]= GET_ATOM(dpy,"Base"); - lnames_KEYPAD[1]= GET_ATOM(dpy,"Number"); - dflt_types[4].name= GET_ATOM(dpy,"PC_BREAK"); - lnames_PC_BREAK[0]= GET_ATOM(dpy,"Base"); - lnames_PC_BREAK[1]= GET_ATOM(dpy,"Control"); - dflt_types[5].name= GET_ATOM(dpy,"PC_SYSRQ"); - lnames_PC_SYSRQ[0]= GET_ATOM(dpy,"Base"); - lnames_PC_SYSRQ[1]= GET_ATOM(dpy,"Alt"); - dflt_types[6].name= GET_ATOM(dpy,"CTRL+ALT"); - lnames_CTRL_ALT[0]= GET_ATOM(dpy,"Base"); - lnames_CTRL_ALT[1]= GET_ATOM(dpy,"Ctrl+Alt"); - dflt_types[7].name= GET_ATOM(dpy,"THREE_LEVEL"); - lnames_THREE_LEVEL[0]= GET_ATOM(dpy,"Base"); - lnames_THREE_LEVEL[1]= GET_ATOM(dpy,"Shift"); - lnames_THREE_LEVEL[2]= GET_ATOM(dpy,"Level3"); - dflt_types[8].name= GET_ATOM(dpy,"SHIFT+ALT"); - lnames_SHIFT_ALT[0]= GET_ATOM(dpy,"Base"); - lnames_SHIFT_ALT[1]= GET_ATOM(dpy,"Shift+Alt"); -} -/* compat name is "default" */ -static XkbSymInterpretRec dfltSI[69]= { - { XK_ISO_Level2_Latch, 0x0000, - XkbSI_LevelOneOnly|XkbSI_Exactly, ShiftMask, - 255, - { XkbSA_LatchMods, { 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Eisu_Shift, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Eisu_toggle, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Kana_Shift, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Kana_Lock, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_NoAction, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Shift_Lock, 0x0000, - XkbSI_AnyOf, ShiftMask|LockMask, - 255, - { XkbSA_LockMods, { 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Num_Lock, 0x0000, - XkbSI_AnyOf, 0xff, - 0, - { XkbSA_LockMods, { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_Alt_L, 0x0000, - XkbSI_AnyOf, 0xff, - 1, - { XkbSA_SetMods, { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Alt_R, 0x0000, - XkbSI_AnyOf, 0xff, - 1, - { XkbSA_SetMods, { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Scroll_Lock, 0x0000, - XkbSI_AnyOf, 0xff, - 4, - { XkbSA_LockMods, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Lock, 0x0000, - XkbSI_AnyOf, 0xff, - 255, - { XkbSA_ISOLock, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Level3_Shift, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOf, 0xff, - 2, - { XkbSA_SetMods, { 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00 } } }, - { XK_ISO_Level3_Latch, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOf, 0xff, - 2, - { XkbSA_LatchMods, { 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00 } } }, - { XK_Mode_switch, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff, - 3, - { XkbSA_SetGroup, { 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_1, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_End, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_2, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_Down, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_3, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_Next, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00 } } }, - { XK_KP_4, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Left, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_6, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Right, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_7, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_Home, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_8, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_Up, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_9, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_Prior, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_MovePtr, { 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00 } } }, - { XK_KP_5, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Begin, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_F1, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Divide, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_F2, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Multiply, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_F3, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Subtract, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Separator, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Add, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_0, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Insert, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Decimal, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_KP_Delete, 0x0001, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Button_Dflt, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Button1, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Button2, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Button3, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DblClick_Dflt, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DblClick1, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DblClick2, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DblClick3, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_PtrBtn, { 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Drag_Dflt, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Drag1, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Drag2, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_Drag3, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockPtrBtn, { 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_EnableKeys, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00 } } }, - { XK_Pointer_Accelerate, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00 } } }, - { XK_Pointer_DfltBtnNext, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_Pointer_DfltBtnPrev, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_SetPtrDflt, { 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_AccessX_Enable, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00 } } }, - { XK_Terminate_Server, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_Terminate, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Group_Latch, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff, - 3, - { XkbSA_LatchGroup, { 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Next_Group, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff, - 3, - { XkbSA_LockGroup, { 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Prev_Group, 0x0000, - XkbSI_LevelOneOnly|XkbSI_AnyOfOrNone, 0xff, - 3, - { XkbSA_LockGroup, { 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_First_Group, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockGroup, { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { XK_ISO_Last_Group, 0x0000, - XkbSI_AnyOfOrNone, 0xff, - 255, - { XkbSA_LockGroup, { 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, - { NoSymbol, 0x0000, - XkbSI_Exactly, LockMask, - 255, - { XkbSA_LockMods, { 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 } } }, - { NoSymbol, 0x0000, - XkbSI_AnyOf, 0xff, - 255, - { XkbSA_SetMods, { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } } -}; -#define num_dfltSI (sizeof(dfltSI)/sizeof(XkbSymInterpretRec)) - -static XkbCompatMapRec compatMap= { - dfltSI, - { /* group compatibility */ - { 0, 0, 0 }, - { 0, 0, vmod_AltGrMask }, - { 0, 0, vmod_AltGrMask }, - { 0, 0, vmod_AltGrMask } - }, - num_dfltSI, num_dfltSI -}; - -static XkbIndicatorRec indicators= { - 0x0, - { - { 0x80, 0, 0x00, XkbIM_UseEffective, { LockMask, LockMask, 0 }, 0 }, - { 0x80, 0, 0x00, XkbIM_UseEffective, { 0, 0, vmod_NumLockMask }, 0 }, - { 0x80, 0, 0x00, XkbIM_UseLocked, { ShiftMask, ShiftMask, 0 }, 0 }, - { 0x80, 0, 0x00, 0, { 0, 0, 0 }, XkbMouseKeysMask }, - { 0x80, 0, 0x00, XkbIM_UseLocked, { 0, 0, vmod_ScrollLockMask }, 0 }, - { 0x80, XkbIM_UseEffective, 0xfe, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }, - { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 } - } -}; -static void -initIndicatorNames(DPYTYPE dpy,XkbDescPtr xkb) -{ - xkb->names->indicators[ 0]= GET_ATOM(dpy,"Caps Lock"); - xkb->names->indicators[ 1]= GET_ATOM(dpy,"Num Lock"); - xkb->names->indicators[ 2]= GET_ATOM(dpy,"Shift Lock"); - xkb->names->indicators[ 3]= GET_ATOM(dpy,"Mouse Keys"); - xkb->names->indicators[ 4]= GET_ATOM(dpy,"Scroll Lock"); - xkb->names->indicators[ 5]= GET_ATOM(dpy,"Group 2"); -} -#endif /* DEFAULT_H */ -- cgit v1.2.3 From 4dac57f3db5b283eb419f1e108cc8510bad1b0af Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 9 Feb 2015 15:58:22 +0100 Subject: Fix -Werror=format-security errors (056_nx-X11_Werror-format-security.full.patch). The below patch fixes more -Werror=format-security errors. Interestingly, most of the errors only showed up on our arm builds. No idea why. --- .../056_nx-X11_Werror-format-security.full.patch | 107 --------------------- debian/patches/series | 1 - nx-X11/lib/xtrans/Xtransint.h | 8 +- nx-X11/programs/Xserver/GL/glx/glximports.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Error.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- nx-X11/programs/Xserver/os/log.c | 4 +- nx-X11/programs/nxauth/process.c | 2 +- 8 files changed, 11 insertions(+), 119 deletions(-) delete mode 100644 debian/patches/056_nx-X11_Werror-format-security.full.patch (limited to 'nx-X11/programs/Xserver/GL') diff --git a/debian/patches/056_nx-X11_Werror-format-security.full.patch b/debian/patches/056_nx-X11_Werror-format-security.full.patch deleted file mode 100644 index a047de774..000000000 --- a/debian/patches/056_nx-X11_Werror-format-security.full.patch +++ /dev/null @@ -1,107 +0,0 @@ -Description: Fix -Werror=format-security errors -Author: Orion Poplawski -Abstract: - The below patch fixes more -Werror=format-security errors. - Interestingly, most of the errors only showed up on our arm builds. No - idea why. ---- a/nx-X11/lib/xtrans/Xtransint.h -+++ b/nx-X11/lib/xtrans/Xtransint.h -@@ -444,7 +444,7 @@ - int hack= 0, saveerrno=errno; \ - struct timeval tp;\ - gettimeofday(&tp,0); \ -- ErrorF(__xtransname); \ -+ ErrorF("%s",__xtransname); \ - ErrorF(x+hack,a,b,c); \ - ErrorF("timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ - errno=saveerrno; \ -@@ -454,7 +454,7 @@ - int hack= 0, saveerrno=errno; \ - struct timeval tp;\ - gettimeofday(&tp,0); \ -- fprintf(stderr, __xtransname); fflush(stderr); \ -+ fprintf(stderr, "%s",__xtransname); fflush(stderr); \ - fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ - fprintf(stderr, "timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ - fflush(stderr); \ -@@ -466,14 +466,14 @@ - /* Use ErrorF() for the X server */ - #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ - int hack= 0, saveerrno=errno; \ -- ErrorF(__xtransname); \ -+ ErrorF("%s",__xtransname); \ - ErrorF(x+hack,a,b,c); \ - errno=saveerrno; \ - } else ((void)0) - #else - #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ - int hack= 0, saveerrno=errno; \ -- fprintf(stderr, __xtransname); fflush(stderr); \ -+ fprintf(stderr, "%s",__xtransname); fflush(stderr); \ - fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ - errno=saveerrno; \ - } else ((void)0) ---- a/nx-X11/programs/nxauth/process.c -+++ b/nx-X11/programs/nxauth/process.c -@@ -974,7 +974,7 @@ - char *hex; - - hex = bintohex(len, cp); -- fprintf(fp, hex); -+ fprintf(fp, "%s", hex); - free(hex); - } - ---- a/nx-X11/programs/Xserver/GL/glx/glximports.c -+++ b/nx-X11/programs/Xserver/GL/glx/glximports.c -@@ -110,12 +110,12 @@ - - void __glXImpWarning(__GLcontext *gc, char *msg) - { -- ErrorF((char *)msg); -+ ErrorF("%s",(char *)msg); - } - - void __glXImpFatal(__GLcontext *gc, char *msg) - { -- ErrorF((char *)msg); -+ ErrorF("%s",(char *)msg); - __glXAbort(); - } - ---- a/nx-X11/programs/Xserver/hw/nxagent/Error.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c -@@ -232,7 +232,7 @@ - - int nxagentExitHandler(const char *message) - { -- FatalError(message); -+ FatalError("%s", message); - - return 0; - } ---- a/nx-X11/programs/Xserver/hw/nxagent/Init.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c -@@ -481,7 +481,7 @@ - - nxagentStartRedirectToClientsLog(); - -- fprintf(stderr, buffer); -+ fprintf(stderr, "%s", buffer); - - nxagentEndRedirectToClientsLog(); - } ---- a/nx-X11/programs/Xserver/os/log.c -+++ b/nx-X11/programs/Xserver/os/log.c -@@ -692,9 +692,9 @@ - return; - sprintf(err, "%s: ", str); - strcat(err, strerror(saveErrno)); -- LogWrite(-1, err); -+ LogWrite(-1, "%s", err); - } else -- LogWrite(-1, strerror(saveErrno)); -+ LogWrite(-1, "%s", strerror(saveErrno)); - } - - void diff --git a/debian/patches/series b/debian/patches/series index afae768fa..ef4671ef7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,3 @@ -056_nx-X11_Werror-format-security.full.patch 057_nx-X11_sanitize-eventmasks.full.patch 101_nxagent_set-rgb-path.full.patch 102_xserver-xext_set-securitypolicy-path.full.patch diff --git a/nx-X11/lib/xtrans/Xtransint.h b/nx-X11/lib/xtrans/Xtransint.h index 1e63a1406..5ca0d9328 100644 --- a/nx-X11/lib/xtrans/Xtransint.h +++ b/nx-X11/lib/xtrans/Xtransint.h @@ -444,7 +444,7 @@ static int trans_mkdir ( int hack= 0, saveerrno=errno; \ struct timeval tp;\ gettimeofday(&tp,0); \ - ErrorF(__xtransname); \ + ErrorF("%s",__xtransname); \ ErrorF(x+hack,a,b,c); \ ErrorF("timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ errno=saveerrno; \ @@ -454,7 +454,7 @@ static int trans_mkdir ( int hack= 0, saveerrno=errno; \ struct timeval tp;\ gettimeofday(&tp,0); \ - fprintf(stderr, __xtransname); fflush(stderr); \ + fprintf(stderr, "%s",__xtransname); fflush(stderr); \ fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ fprintf(stderr, "timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ fflush(stderr); \ @@ -466,14 +466,14 @@ static int trans_mkdir ( /* Use ErrorF() for the X server */ #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ int hack= 0, saveerrno=errno; \ - ErrorF(__xtransname); \ + ErrorF("%s",__xtransname); \ ErrorF(x+hack,a,b,c); \ errno=saveerrno; \ } else ((void)0) #else #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ int hack= 0, saveerrno=errno; \ - fprintf(stderr, __xtransname); fflush(stderr); \ + fprintf(stderr, "%s",__xtransname); fflush(stderr); \ fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ errno=saveerrno; \ } else ((void)0) diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.c b/nx-X11/programs/Xserver/GL/glx/glximports.c index fae2346b9..435caca58 100644 --- a/nx-X11/programs/Xserver/GL/glx/glximports.c +++ b/nx-X11/programs/Xserver/GL/glx/glximports.c @@ -110,12 +110,12 @@ void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize) void __glXImpWarning(__GLcontext *gc, char *msg) { - ErrorF((char *)msg); + ErrorF("%s",(char *)msg); } void __glXImpFatal(__GLcontext *gc, char *msg) { - ErrorF((char *)msg); + ErrorF("%s",(char *)msg); __glXAbort(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c b/nx-X11/programs/Xserver/hw/nxagent/Error.c index 43bf85900..d9016436e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c @@ -232,7 +232,7 @@ static int nxagentPrintError(dpy, event, fp) int nxagentExitHandler(const char *message) { - FatalError(message); + FatalError("%s", message); return 0; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index a50e8a5fc..acd5d419c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -481,7 +481,7 @@ void OsVendorVErrorFFunction(const char *f, va_list args) nxagentStartRedirectToClientsLog(); - fprintf(stderr, buffer); + fprintf(stderr, "%s", buffer); nxagentEndRedirectToClientsLog(); } diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c index 04e24b8df..1b28bb141 100644 --- a/nx-X11/programs/Xserver/os/log.c +++ b/nx-X11/programs/Xserver/os/log.c @@ -692,9 +692,9 @@ Error(char *str) return; sprintf(err, "%s: ", str); strcat(err, strerror(saveErrno)); - LogWrite(-1, err); + LogWrite(-1, "%s", err); } else - LogWrite(-1, strerror(saveErrno)); + LogWrite(-1, "%s", strerror(saveErrno)); } void diff --git a/nx-X11/programs/nxauth/process.c b/nx-X11/programs/nxauth/process.c index 57090e23e..76259d76a 100644 --- a/nx-X11/programs/nxauth/process.c +++ b/nx-X11/programs/nxauth/process.c @@ -974,7 +974,7 @@ fprintfhex(register FILE *fp, int len, char *cp) char *hex; hex = bintohex(len, cp); - fprintf(fp, hex); + fprintf(fp, "%s", hex); free(hex); } -- cgit v1.2.3 From 5c43bb2484414b37115dac56dc76f1ecf4c05837 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Nov 2014 12:13:36 -0500 Subject: glx: Be more paranoid about variable-length requests [CVE-2014-8093 1/6] (v2) If the size computation routine returns -1 we should just reject the request outright. Clamping it to zero could give an attacker the opportunity to also mangle cmdlen in such a way that the subsequent length check passes, and the request would get executed, thus passing data we wanted to reject to the renderer. v3: backport to nx-libs 3.6.x (Mike DePaulo) v2: backport to RHEL5 - fix swap paths Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie fixup swaps --- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 4 ++-- nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index ca5eee82a..02f3ba7f2 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -1484,7 +1484,7 @@ int __glXRender(__GLXclientState *cl, GLbyte *pc) /* variable size command */ extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, False); if (extra < 0) { - extra = 0; + return BadLength; } if (cmdlen != __GLX_PAD(entry->bytes + extra)) { return BadLength; @@ -1601,7 +1601,7 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) */ extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, False); if (extra < 0) { - extra = 0; + return BadLength; } /* large command's header is 4 bytes longer, so add 4 */ if (cmdlen != __GLX_PAD(entry->bytes + 4 + extra)) { diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c index 595e814e5..027cba709 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c @@ -535,7 +535,7 @@ int __glXSwapRender(__GLXclientState *cl, GLbyte *pc) /* variable size command */ extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True); if (extra < 0) { - extra = 0; + return BadLength; } if (cmdlen != __GLX_PAD(entry->bytes + extra)) { return BadLength; @@ -659,7 +659,7 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) */ extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, True); if (extra < 0) { - extra = 0; + return BadLength; } /* large command's header is 4 bytes longer, so add 4 */ if (cmdlen != __GLX_PAD(entry->bytes + 4 + extra)) { -- cgit v1.2.3 From cdf0c3e65670c797a4fd0617d44d2bdff4011815 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Nov 2014 12:13:37 -0500 Subject: glx: Be more strict about rejecting invalid image sizes [CVE-2014-8093 2/6] Before this we'd just clamp the image size to 0, which was just hideously stupid; if the parameters were such that they'd overflow an integer, you'd allocate a small buffer, then pass huge values into (say) ReadPixels, and now you're scribbling over arbitrary server memory. v2: backport to nx-libs 3.6.x (Mike DePaulo) Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie --- nx-X11/programs/Xserver/GL/glx/singlepix.c | 14 +++++++------- nx-X11/programs/Xserver/GL/glx/singlepixswap.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/singlepix.c b/nx-X11/programs/Xserver/GL/glx/singlepix.c index 845c46a64..be804d82e 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlepix.c +++ b/nx-X11/programs/Xserver/GL/glx/singlepix.c @@ -70,7 +70,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc) swapBytes = *(GLboolean *)(pc + 24); lsbFirst = *(GLboolean *)(pc + 25); compsize = __glReadPixels_size(format,type,width,height); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst); @@ -130,7 +130,7 @@ int __glXDisp_GetTexImage(__GLXclientState *cl, GLbyte *pc) * are illegal, but then width, height, and depth would still be zero anyway. */ compsize = __glGetTexImage_size(target,level,format,type,width,height,depth); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); @@ -227,7 +227,7 @@ int __glXDisp_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc) compsize = __glGetTexImage_size(target,1,format,type,width,1,1); compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; if (compsize2 < 0) compsize2 = 0; compsize = __GLX_PAD(compsize); compsize2 = __GLX_PAD(compsize2); @@ -291,7 +291,7 @@ int __glXDisp_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc) * are illegal, but then width and height would still be zero anyway. */ compsize = __glGetTexImage_size(target,1,format,type,width,height,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); @@ -346,7 +346,7 @@ int __glXDisp_GetHistogram(__GLXclientState *cl, GLbyte *pc) * are illegal, but then width would still be zero anyway. */ compsize = __glGetTexImage_size(target,1,format,type,width,1,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); @@ -389,7 +389,7 @@ int __glXDisp_GetMinmax(__GLXclientState *cl, GLbyte *pc) reset = *(GLboolean *)(pc + 13); compsize = __glGetTexImage_size(target,1,format,type,2,1,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); @@ -436,7 +436,7 @@ int __glXDisp_GetColorTable(__GLXclientState *cl, GLbyte *pc) * are illegal, but then width would still be zero anyway. */ compsize = __glGetTexImage_size(target,1,format,type,width,1,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); diff --git a/nx-X11/programs/Xserver/GL/glx/singlepixswap.c b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c index ff68ecedf..cdc6f164e 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlepixswap.c +++ b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c @@ -79,7 +79,7 @@ int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc) swapBytes = *(GLboolean *)(pc + 24); lsbFirst = *(GLboolean *)(pc + 25); compsize = __glReadPixels_size(format,type,width,height); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst); @@ -148,7 +148,7 @@ int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc) * are illegal, but then width, height, and depth would still be zero anyway. */ compsize = __glGetTexImage_size(target,level,format,type,width,height,depth); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); @@ -257,7 +257,7 @@ int __glXDispSwap_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc) compsize = __glGetTexImage_size(target,1,format,type,width,1,1); compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; if (compsize2 < 0) compsize2 = 0; compsize = __GLX_PAD(compsize); compsize2 = __GLX_PAD(compsize2); @@ -328,7 +328,7 @@ int __glXDispSwap_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc) * are illegal, but then width and height would still be zero anyway. */ compsize = __glGetTexImage_size(target,1,format,type,width,height,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); @@ -390,7 +390,7 @@ int __glXDispSwap_GetHistogram(__GLXclientState *cl, GLbyte *pc) * are illegal, but then width would still be zero anyway. */ compsize = __glGetTexImage_size(target,1,format,type,width,1,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); @@ -439,7 +439,7 @@ int __glXDispSwap_GetMinmax(__GLXclientState *cl, GLbyte *pc) reset = *(GLboolean *)(pc + 13); compsize = __glGetTexImage_size(target,1,format,type,2,1,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); @@ -491,7 +491,7 @@ int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc) * are illegal, but then width would still be zero anyway. */ compsize = __glGetTexImage_size(target,1,format,type,width,1,1); - if (compsize < 0) compsize = 0; + if (compsize < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1); -- cgit v1.2.3 From d0fcbc8a6ca82df82c410d0f8f9062b05fa5ec8d Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Nov 2014 12:13:38 -0500 Subject: glx: Additional paranoia in __glXGetAnswerBuffer / __GLX_GET_ANSWER_BUFFER (v2) [CVE-2014-8093 3/6] If the computed reply size is negative, something went wrong, treat it as an error. v2: Be more careful about size_t being unsigned (Matthieu Herrb) v3: SIZE_MAX not SIZE_T_MAX (Alan Coopersmith) v4: backport to nx-libs 3.6.x (Mike DePaulo) Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie --- nx-X11/programs/Xserver/GL/glx/unpack.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/unpack.h b/nx-X11/programs/Xserver/GL/glx/unpack.h index 723fb85f3..94bdae8f9 100644 --- a/nx-X11/programs/Xserver/GL/glx/unpack.h +++ b/nx-X11/programs/Xserver/GL/glx/unpack.h @@ -89,7 +89,8 @@ extern xGLXSingleReply __glXReply; ** pointer. */ #define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \ - if ((size) > sizeof(answerBuffer)) { \ + if (size < 0) return BadLength; \ + else if ((size) > sizeof(answerBuffer)) { \ int bump; \ if ((cl)->returnBufSize < (size)+(align)) { \ (cl)->returnBuf = (GLbyte*)Xrealloc((cl)->returnBuf, \ -- cgit v1.2.3 From 1a9f23118787be611b6db51e4eac864c43c702d9 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Nov 2014 12:13:40 -0500 Subject: glx: Add safe_{add,mul,pad} (v3) [CVE-2014-8093 4/6] (v4) These are paranoid about integer overflow, and will return -1 if their operation would overflow a (signed) integer or if either argument is negative. Note that RenderLarge requests are sized with a uint32_t so in principle this could be sketchy there, but dix limits bigreqs to 128M so you shouldn't ever notice, and honestly if you're sending more than 2G of rendering commands you're already doing something very wrong. v2: Use INT_MAX for consistency with the rest of the server (jcristau) v3: Reject negative arguments (anholt) v4: RHEL5: add limits.h, use inline v5: backport to nx-libs 3.6.x (Mike DePaulo) Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie --- nx-X11/programs/Xserver/GL/glx/glxserver.h | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxserver.h b/nx-X11/programs/Xserver/GL/glx/glxserver.h index e8449b2bb..404757405 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxserver.h +++ b/nx-X11/programs/Xserver/GL/glx/glxserver.h @@ -54,6 +54,7 @@ #include "GL/glx_ansic.h" +#include /* ** The X header misc.h defines these math functions. */ @@ -223,6 +224,46 @@ extern void glxSwapQueryServerStringReply(ClientPtr client, /* * Routines for computing the size of variably-sized rendering commands. */ +static __inline__ int +safe_add(int a, int b) +{ + if (a < 0 || b < 0) + return -1; + + if (INT_MAX - a < b) + return -1; + + return a + b; +} + +static __inline__ int +safe_mul(int a, int b) +{ + if (a < 0 || b < 0) + return -1; + + if (a == 0 || b == 0) + return 0; + + if (a > INT_MAX / b) + return -1; + + return a * b; +} + +static __inline__ int +safe_pad(int a) +{ + int ret; + + if (a < 0) + return -1; + + if ((ret = safe_add(a, 3)) < 0) + return -1; + + return ret & (GLuint)~3; +} extern int __glXTypeSize(GLenum enm); extern int __glXImageSize(GLenum format, GLenum type, -- cgit v1.2.3 From 78b38a8a37e6105360c82a710ef62c92643ea4c1 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 10 Nov 2014 12:13:41 -0500 Subject: glx: Length checking for GLXRender requests (v2) [CVE-2014-8098 2/8] (v3) v2: Remove can't-happen comparison for cmdlen < 0 (Michal Srb) v3: backport to RHEL5 hit old paths v4: backport to nx-libs 3.6.x (Mike DePaulo) Reviewed-by: Adam Jackson Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Julien Cristau Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie --- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 20 ++++++++++---------- nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index 02f3ba7f2..831c65bec 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -1443,7 +1443,7 @@ int __glXRender(__GLXclientState *cl, GLbyte *pc) left = (req->length << 2) - sz_xGLXRenderReq; while (left > 0) { __GLXrenderSizeData *entry; - int extra; + int extra = 0; void (* proc)(GLbyte *); /* @@ -1454,6 +1454,9 @@ int __glXRender(__GLXclientState *cl, GLbyte *pc) cmdlen = hdr->length; opcode = hdr->opcode; + if (left < cmdlen) + return BadLength; + /* ** Check for core opcodes and grab entry data. */ @@ -1480,22 +1483,19 @@ int __glXRender(__GLXclientState *cl, GLbyte *pc) client->errorValue = commandsDone; return __glXBadRenderRequest; } + + if (cmdlen < entry->bytes) { + return BadLength; + } + if (entry->varsize) { /* variable size command */ extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, False); if (extra < 0) { return BadLength; } - if (cmdlen != __GLX_PAD(entry->bytes + extra)) { - return BadLength; - } - } else { - /* constant size command */ - if (cmdlen != __GLX_PAD(entry->bytes)) { - return BadLength; - } } - if (left < cmdlen) { + if (cmdlen != safe_pad(safe_add(entry->bytes, extra))) { return BadLength; } diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c index 027cba709..7174fdaec 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c @@ -498,7 +498,7 @@ int __glXSwapRender(__GLXclientState *cl, GLbyte *pc) left = (req->length << 2) - sz_xGLXRenderReq; while (left > 0) { __GLXrenderSizeData *entry; - int extra; + int extra = 0; void (* proc)(GLbyte *); /* @@ -511,6 +511,9 @@ int __glXSwapRender(__GLXclientState *cl, GLbyte *pc) cmdlen = hdr->length; opcode = hdr->opcode; + if (left < cmdlen) + return BadLength; + if ( (opcode >= __GLX_MIN_RENDER_OPCODE) && (opcode <= __GLX_MAX_RENDER_OPCODE) ) { entry = &__glXRenderSizeTable[opcode]; @@ -531,22 +534,19 @@ int __glXSwapRender(__GLXclientState *cl, GLbyte *pc) client->errorValue = commandsDone; return __glXBadRenderRequest; } + + if (cmdlen < entry->bytes) { + return BadLength; + } + if (entry->varsize) { /* variable size command */ extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True); if (extra < 0) { return BadLength; } - if (cmdlen != __GLX_PAD(entry->bytes + extra)) { - return BadLength; - } - } else { - /* constant size command */ - if (cmdlen != __GLX_PAD(entry->bytes)) { - return BadLength; - } } - if (left < cmdlen) { + if (cmdlen != safe_pad(safe_add(entry->bytes, extra))) { return BadLength; } -- cgit v1.2.3 From ddb1235bc621d06bf28309be70c173ae06131edf Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Nov 2014 12:13:42 -0500 Subject: glx: Integer overflow protection for non-generated render requests (v3) [CVE-2014-8093 5/6] v2: Fix constants in __glXMap2fReqSize (Michal Srb) Validate w/h/d for proxy targets too (Keith Packard) v3: Fix Map[12]Size to correctly reject order == 0 (Julien Cristau) v4: backport to nx-libs 3.6.x (Mike DePaulo) Reviewed-by: Keith Packard Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie --- nx-X11/programs/Xserver/GL/glx/rensize.c | 68 +++++++++++++++++--------------- 1 file changed, 37 insertions(+), 31 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/rensize.c b/nx-X11/programs/Xserver/GL/glx/rensize.c index 7ab02d257..9bf0d00e9 100644 --- a/nx-X11/programs/Xserver/GL/glx/rensize.c +++ b/nx-X11/programs/Xserver/GL/glx/rensize.c @@ -167,16 +167,10 @@ int __glXTexEnvivReqSize(GLbyte *pc, Bool swap ) return __glXTexEnvfvReqSize( pc, swap ); } -static int Map1Size( GLint k, GLint order) -{ - if (order <= 0 || k < 0) return -1; - return k * order; -} - int __glXMap1dReqSize(GLbyte *pc, Bool swap ) { GLenum target; - GLint order, k; + GLint order; target = *(GLenum*) (pc + 16); order = *(GLint*) (pc + 20); @@ -184,14 +178,15 @@ int __glXMap1dReqSize(GLbyte *pc, Bool swap ) target = SWAPL( target ); order = SWAPL( order ); } - k = __glMap1d_size( target ); - return 8 * Map1Size( k, order ); + if (order < 1) + return -1; + return safe_mul(8, safe_mul(__glMap1d_size(target), order)); } int __glXMap1fReqSize(GLbyte *pc, Bool swap ) { GLenum target; - GLint order, k; + GLint order; target = *(GLenum *)(pc + 0); order = *(GLint *)(pc + 12); @@ -199,20 +194,21 @@ int __glXMap1fReqSize(GLbyte *pc, Bool swap ) target = SWAPL( target ); order = SWAPL( order ); } - k = __glMap1f_size(target); - return 4 * Map1Size(k, order); + if (order < 1) + return -1; + return safe_mul(4, safe_mul(__glMap1f_size(target), order)); } static int Map2Size(int k, int majorOrder, int minorOrder) { - if (majorOrder <= 0 || minorOrder <= 0 || k < 0) return -1; - return k * majorOrder * minorOrder; + if (majorOrder < 1 || minorOrder < 1) return -1; + return safe_mul(k, safe_mul(majorOrder, minorOrder)); } int __glXMap2dReqSize(GLbyte *pc, Bool swap ) { GLenum target; - GLint uorder, vorder, k; + GLint uorder, vorder; target = *(GLenum *)(pc + 32); uorder = *(GLint *)(pc + 36); @@ -222,14 +218,13 @@ int __glXMap2dReqSize(GLbyte *pc, Bool swap ) uorder = SWAPL( uorder ); vorder = SWAPL( vorder ); } - k = __glMap2d_size( target ); - return 8 * Map2Size( k, uorder, vorder ); + return safe_mul(8, Map2Size(__glMap2d_size(target), uorder, vorder)); } int __glXMap2fReqSize(GLbyte *pc, Bool swap ) { GLenum target; - GLint uorder, vorder, k; + GLint uorder, vorder; target = *(GLenum *)(pc + 0); uorder = *(GLint *)(pc + 12); @@ -239,8 +234,7 @@ int __glXMap2fReqSize(GLbyte *pc, Bool swap ) uorder = SWAPL( uorder ); vorder = SWAPL( vorder ); } - k = __glMap2f_size( target ); - return 4 * Map2Size( k, uorder, vorder ); + return safe_mul(4, Map2Size(__glMap2f_size(target), uorder, vorder)); } int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap ) @@ -315,13 +309,16 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target, GLint bytesPerElement, elementsPerGroup, groupsPerRow; GLint groupSize, rowSize, padding, imageSize; + if (w == 0 || h == 0 || d == 0) + return 0; + if (w < 0 || h < 0 || d < 0 || (type == GL_BITMAP && (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) { return -1; } - if (w==0 || h==0 || d == 0) return 0; + /* proxy targets have no data */ switch( target ) { case GL_PROXY_TEXTURE_1D: case GL_PROXY_TEXTURE_2D: @@ -338,6 +335,12 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target, return 0; } + /* real data has to have real sizes */ + if (imageHeight < 0 || rowLength < 0 || skipImages < 0 || skipRows < 0) + return -1; + if (alignment != 1 && alignment != 2 && alignment != 4 && alignment != 8) + return -1; + if (type == GL_BITMAP) { if (rowLength > 0) { groupsPerRow = rowLength; @@ -345,11 +348,13 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target, groupsPerRow = w; } rowSize = (groupsPerRow + 7) >> 3; + if (rowSize < 0) + return -1; padding = (rowSize % alignment); if (padding) { rowSize += alignment - padding; } - return ((h + skipRows) * rowSize); + return safe_mul(safe_add(h, skipRows), rowSize); } else { switch(format) { case GL_COLOR_INDEX: @@ -430,23 +435,25 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target, default: return -1; } + /* known safe by the switches above, not checked */ groupSize = bytesPerElement * elementsPerGroup; if (rowLength > 0) { groupsPerRow = rowLength; } else { groupsPerRow = w; } - rowSize = groupsPerRow * groupSize; + if ((rowSize = safe_mul(groupsPerRow, groupSize)) < 0) + return -1; padding = (rowSize % alignment); if (padding) { rowSize += alignment - padding; } - if (imageHeight > 0) { - imageSize = (imageHeight + skipRows) * rowSize; - } else { - imageSize = (h + skipRows) * rowSize; - } - return ((d + skipImages) * imageSize); + if (imageHeight > 0) + h = imageHeight; + h = safe_add(h, skipRows); + + imageSize = safe_mul(h, rowSize); + return safe_mul(safe_add(d, skipImages), imageSize); } } @@ -873,10 +880,9 @@ int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap ) /* XXX Should rowLength be used for either or both image? */ image1size = __glXImageSize( format, type, 0, w, 1, 1, 0, rowLength, 0, 0, alignment ); - image1size = __GLX_PAD(image1size); image2size = __glXImageSize( format, type, 0, h, 1, 1, 0, rowLength, 0, 0, alignment ); - return image1size + image2size; + return safe_add(safe_pad(image1size), image2size); } -- cgit v1.2.3 From ad29acd7697e18333e164b1746f61c5a9e29a436 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Nov 2014 12:13:44 -0500 Subject: glx: Top-level length checking for swapped VendorPrivate requests [CVE-2014-8098 4/8] v2: backport to nx-libs 3.6.x (Mike DePaulo) Reviewed-by: Keith Packard Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie --- nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c index 7174fdaec..2685355c0 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c @@ -797,10 +797,12 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXVendorPrivateReq *req; GLint vendorcode; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); req = (xGLXVendorPrivateReq *) pc; __GLX_SWAP_SHORT(&req->length); @@ -835,10 +837,12 @@ int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc) int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXVendorPrivateWithReplyReq *req; GLint vendorcode; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateWithReplyReq); req = (xGLXVendorPrivateWithReplyReq *) pc; __GLX_SWAP_SHORT(&req->length); -- cgit v1.2.3 From 8931066077a04999d973932e04da577bd6906c82 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Nov 2014 12:13:47 -0500 Subject: glx: Length checking for non-generated single requests (v2) [CVE-2014-8098 7/8] v2: Fix single versus vendor-private length checking for ARB_imaging subset extensions. (Julien Cristau) v3: Fix single versus vendor-private length checking for ARB_imaging subset extensions. (Julien Cristau) v4: backport to nx-libs 3.6.x (Mike DePaulo) Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Julien Cristau Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie fix safe_Add --- nx-X11/programs/Xserver/GL/glx/single2.c | 21 +++++++++++++++------ nx-X11/programs/Xserver/GL/glx/single2swap.c | 15 +++++++++++---- nx-X11/programs/Xserver/GL/glx/singlepix.c | 19 ++++++++++++++----- nx-X11/programs/Xserver/GL/glx/singlepixswap.c | 17 ++++++++++++----- 4 files changed, 52 insertions(+), 20 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/single2.c b/nx-X11/programs/Xserver/GL/glx/single2.c index 9fee5ff49..10152c37c 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2.c +++ b/nx-X11/programs/Xserver/GL/glx/single2.c @@ -48,11 +48,14 @@ int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; GLsizei size; GLenum type; __GLXcontext *cx; int error; + REQUEST_FIXED_SIZE(xGLXSingleReq, 8); + cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -78,10 +81,12 @@ int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; __GLXcontext *cx; GLsizei size; int error; + REQUEST_FIXED_SIZE(xGLXSingleReq, 4); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -106,7 +111,7 @@ int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc) int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc) { - ClientPtr client; + ClientPtr client = cl->client; xGLXRenderModeReply reply; __GLXcontext *cx; GLint nitems=0, retBytes=0, retval, newModeCheck; @@ -114,6 +119,8 @@ int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc) GLenum newMode; int error; + REQUEST_FIXED_SIZE(xGLXSingleReq, 4); + cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -188,7 +195,6 @@ int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc) ** selection array, as per the API for glRenderMode itself. */ noChangeAllowed:; - client = cl->client; reply.length = nitems; reply.type = X_Reply; reply.sequenceNumber = client->sequence; @@ -204,9 +210,11 @@ int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc) int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; __GLXcontext *cx; int error; + REQUEST_SIZE_MATCH(xGLXSingleReq); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -219,10 +227,11 @@ int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc) int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; __GLXcontext *cx; - ClientPtr client; int error; + REQUEST_SIZE_MATCH(xGLXSingleReq); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -233,7 +242,6 @@ int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc) __GLX_NOTE_FLUSHED_CMDS(cx); /* Send empty reply packet to indicate finish is finished */ - client = cl->client; __GLX_BEGIN_REPLY(0); __GLX_SEND_HEADER(); return Success; @@ -302,7 +310,7 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string) int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) { - ClientPtr client; + ClientPtr client = cl->client; __GLXcontext *cx; GLenum name; const char *string; @@ -311,6 +319,8 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) char *buf = NULL, *buf1 = NULL; GLint length = 0; + REQUEST_FIXED_SIZE(xGLXSingleReq, 4); + /* If the client has the opposite byte order, swap the contextTag and * the name. */ @@ -327,7 +337,6 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) pc += __GLX_SINGLE_HDR_SIZE; name = *(GLenum *)(pc + 0); string = (const char *)glGetString(name); - client = cl->client; /* ** Restrict extensions to those that are supported by both the diff --git a/nx-X11/programs/Xserver/GL/glx/single2swap.c b/nx-X11/programs/Xserver/GL/glx/single2swap.c index dab98ade9..4b8541bf2 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2swap.c +++ b/nx-X11/programs/Xserver/GL/glx/single2swap.c @@ -48,12 +48,14 @@ int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; GLsizei size; GLenum type; __GLX_DECLARE_SWAP_VARIABLES; __GLXcontext *cx; int error; + REQUEST_FIXED_SIZE(xGLXSingleReq, 8); __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { @@ -82,11 +84,13 @@ int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; __GLXcontext *cx; GLsizei size; __GLX_DECLARE_SWAP_VARIABLES; int error; + REQUEST_FIXED_SIZE(xGLXSingleReq, 4); __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { @@ -113,7 +117,7 @@ int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc) { - ClientPtr client; + ClientPtr client = cl->client; __GLXcontext *cx; xGLXRenderModeReply reply; GLint nitems=0, retBytes=0, retval, newModeCheck; @@ -123,6 +127,8 @@ int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc) __GLX_DECLARE_SWAP_ARRAY_VARIABLES; int error; + REQUEST_FIXED_SIZE(xGLXSingleReq, 4); + __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { @@ -201,7 +207,6 @@ int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc) ** selection array, as per the API for glRenderMode itself. */ noChangeAllowed:; - client = cl->client; reply.length = nitems; reply.type = X_Reply; reply.sequenceNumber = client->sequence; @@ -222,10 +227,12 @@ int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; __GLXcontext *cx; int error; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXSingleReq); __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { @@ -239,11 +246,12 @@ int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; __GLXcontext *cx; - ClientPtr client; int error; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXSingleReq); __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { @@ -255,7 +263,6 @@ int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc) __GLX_NOTE_FLUSHED_CMDS(cx); /* Send empty reply packet to indicate finish is finished */ - client = cl->client; __GLX_BEGIN_REPLY(0); __GLX_PUT_RETVAL(0); __GLX_SWAP_REPLY_HEADER(); diff --git a/nx-X11/programs/Xserver/GL/glx/singlepix.c b/nx-X11/programs/Xserver/GL/glx/singlepix.c index be804d82e..a156db5d3 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlepix.c +++ b/nx-X11/programs/Xserver/GL/glx/singlepix.c @@ -57,6 +57,8 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc) int error; char *answer, answerBuffer[200]; + REQUEST_FIXED_SIZE(xGLXSingleReq, 28); + cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -108,6 +110,7 @@ int __glXDisp_GetTexImage(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0, height=0, depth=1; + REQUEST_FIXED_SIZE(xGLXSingleReq, 20); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -204,6 +207,7 @@ int __glXDisp_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0, height=0; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -227,13 +231,11 @@ int __glXDisp_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc) compsize = __glGetTexImage_size(target,1,format,type,width,1,1); compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1); - if (compsize < 0) return BadLength; - if (compsize2 < 0) compsize2 = 0; - compsize = __GLX_PAD(compsize); - compsize2 = __GLX_PAD(compsize2); + if ((compsize = safe_pad(compsize)) < 0) return BadLength; + if ((compsize2 = safe_pad(compsize2)) < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes); - __GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1); + __GLX_GET_ANSWER_BUFFER(answer,cl,safe_add(compsize, compsize2),1); __glXClearErrorOccured(); glGetSeparableFilter( *(GLenum *)(pc + 0), @@ -269,6 +271,7 @@ int __glXDisp_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0, height=0; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -328,6 +331,8 @@ int __glXDisp_GetHistogram(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); + cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -376,6 +381,8 @@ int __glXDisp_GetMinmax(__GLXclientState *cl, GLbyte *pc) int error; char *answer, answerBuffer[200]; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); + cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -419,6 +426,8 @@ int __glXDisp_GetColorTable(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); + cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; diff --git a/nx-X11/programs/Xserver/GL/glx/singlepixswap.c b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c index cdc6f164e..24f2e76e8 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlepixswap.c +++ b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c @@ -58,6 +58,8 @@ int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc) int error; char *answer, answerBuffer[200]; + REQUEST_FIXED_SIZE(xGLXSingleReq, 28); + __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { @@ -120,6 +122,7 @@ int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0, height=0, depth=1; + REQUEST_FIXED_SIZE(xGLXSingleReq, 24); __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { @@ -190,6 +193,7 @@ int __glXDispSwap_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc) char *answer; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_FIXED_SIZE(xGLXSingleReq, 4); __GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { @@ -230,6 +234,7 @@ int __glXDispSwap_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0, height=0; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -257,13 +262,11 @@ int __glXDispSwap_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc) compsize = __glGetTexImage_size(target,1,format,type,width,1,1); compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1); - if (compsize < 0) return BadLength; - if (compsize2 < 0) compsize2 = 0; - compsize = __GLX_PAD(compsize); - compsize2 = __GLX_PAD(compsize2); + if ((compsize = safe_pad(compsize)) < 0) return BadLength; + if ((compsize2 = safe_pad(compsize2)) < 0) return BadLength; glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes); - __GLX_GET_ANSWER_BUFFER(answer,cl,compsize + compsize2,1); + __GLX_GET_ANSWER_BUFFER(answer,cl,safe_add(compsize, compsize2),1); __glXClearErrorOccured(); glGetSeparableFilter( *(GLenum *)(pc + 0), @@ -302,6 +305,7 @@ int __glXDispSwap_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0, height=0; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -368,6 +372,7 @@ int __glXDispSwap_GetHistogram(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -422,6 +427,7 @@ int __glXDispSwap_GetMinmax(__GLXclientState *cl, GLbyte *pc) __GLX_DECLARE_SWAP_VARIABLES; char *answer, answerBuffer[200]; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; @@ -470,6 +476,7 @@ int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc) char *answer, answerBuffer[200]; GLint width=0; + REQUEST_FIXED_SIZE(xGLXSingleReq, 16); cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error); if (!cx) { return error; -- cgit v1.2.3 From 9c558f9ca2c0d4e34fa71dff272ed1c39c22cd9d Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Nov 2014 12:13:43 -0500 Subject: glx: Length checking for RenderLarge requests (v2) [CVE-2014-8098 3/8] (v3) This is a half-measure until we start passing request length into the varsize function, but it's better than the nothing we had before. v2: Verify that there's at least a large render header's worth of dataBytes (Julien Cristau) v3: backport to RHEL5 v4: backport to nx-libs 3.6.x (Mike DePaulo) Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie fixup swap --- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 58 ++++++++++++++++----------- nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c | 59 +++++++++++++++++----------- 2 files changed, 71 insertions(+), 46 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index 831c65bec..20c12f3f9 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -1535,6 +1535,8 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) ** duplicated there. */ + REQUEST_AT_LEAST_SIZE(xGLXRenderLargeReq); + req = (xGLXRenderLargeReq *) pc; glxc = __glXForceCurrent(cl, req->contextTag, &error); if (!glxc) { @@ -1542,12 +1544,15 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) __glXResetLargeCommandStatus(cl); return error; } + if (safe_pad(req->dataBytes) < 0) + return BadLength; + dataBytes = req->dataBytes; /* ** Check the request length. */ - if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) { + if ((req->length << 2) != safe_pad(dataBytes) + sz_xGLXRenderLargeReq) { client->errorValue = req->length; /* Reset in case this isn't 1st request. */ __glXResetLargeCommandStatus(cl); @@ -1557,7 +1562,7 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) if (cl->largeCmdRequestsSoFar == 0) { __GLXrenderSizeData *entry; - int extra, cmdlen; + int extra = 0, cmdlen; /* ** This is the first request of a multi request command. ** Make enough space in the buffer, then copy the entire request. @@ -1567,9 +1572,13 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) return __glXBadLargeRequest; } + if (dataBytes < __GLX_RENDER_LARGE_HDR_SIZE) + return BadLength; + hdr = (__GLXrenderLargeHeader *) pc; - cmdlen = hdr->length; opcode = hdr->opcode; + if ((cmdlen = safe_pad(hdr->length)) < 0) + return BadLength; /* ** Check for core opcodes and grab entry data. @@ -1603,16 +1612,13 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) if (extra < 0) { return BadLength; } - /* large command's header is 4 bytes longer, so add 4 */ - if (cmdlen != __GLX_PAD(entry->bytes + 4 + extra)) { - return BadLength; - } - } else { - /* constant size command */ - if (cmdlen != __GLX_PAD(entry->bytes + 4)) { - return BadLength; - } } + + /* the +4 is safe because we know entry.bytes is small */ + if (cmdlen != safe_pad(safe_add(entry->bytes + 4, extra))) { + return BadLength; + } + /* ** Make enough space in the buffer, then copy the entire request. */ @@ -1641,6 +1647,7 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) ** We are receiving subsequent (i.e. not the first) requests of a ** multi request command. */ + int bytesSoFar; /* including this packet */ /* ** Check the request number and the total request count. @@ -1659,7 +1666,13 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) /* ** Check that we didn't get too much data. */ - if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) { + if ((bytesSoFar = safe_add(cl->largeCmdBytesSoFar, dataBytes)) < 0) { + client->errorValue = dataBytes; + __glXResetLargeCommandStatus(cl); + return __glXBadLargeRequest; + } + + if (bytesSoFar > cl->largeCmdBytesTotal) { client->errorValue = dataBytes; __glXResetLargeCommandStatus(cl); return __glXBadLargeRequest; @@ -1673,17 +1686,16 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) ** This is the last request; it must have enough bytes to complete ** the command. */ - /* NOTE: the two pad macros have been added below; they are needed - ** because the client library pads the total byte count, but not - ** the per-request byte counts. The Protocol Encoding says the - ** total byte count should not be padded, so a proposal will be - ** made to the ARB to relax the padding constraint on the total - ** byte count, thus preserving backward compatibility. Meanwhile, - ** the padding done below fixes a bug that did not allow - ** large commands of odd sizes to be accepted by the server. + /* NOTE: the pad macro below is needed because the client library + ** pads the total byte count, but not the per-request byte counts. + ** The Protocol Encoding says the total byte count should not be + ** padded, so a proposal will be made to the ARB to relax the + ** padding constraint on the total byte count, thus preserving + ** backward compatibility. Meanwhile, the padding done below + ** fixes a bug that did not allow large commands of odd sizes to + ** be accepted by the server. */ - if (__GLX_PAD(cl->largeCmdBytesSoFar) != - __GLX_PAD(cl->largeCmdBytesTotal)) { + if (safe_pad(cl->largeCmdBytesSoFar) != cl->largeCmdBytesTotal) { client->errorValue = dataBytes; __glXResetLargeCommandStatus(cl); return __glXBadLargeRequest; diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c index 2685355c0..2e228c083 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c @@ -587,6 +587,8 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) ** duplicated there. */ + REQUEST_AT_LEAST_SIZE(xGLXRenderLargeReq); + req = (xGLXRenderLargeReq *) pc; __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); @@ -599,12 +601,15 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) __glXResetLargeCommandStatus(cl); return error; } + if (safe_pad(req->dataBytes) < 0) + return BadLength; + dataBytes = req->dataBytes; /* ** Check the request length. */ - if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) { + if ((req->length << 2) != safe_pad(dataBytes) + sz_xGLXRenderLargeReq) { client->errorValue = req->length; /* Reset in case this isn't 1st request. */ __glXResetLargeCommandStatus(cl); @@ -614,7 +619,7 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) if (cl->largeCmdRequestsSoFar == 0) { __GLXrenderSizeData *entry; - int extra; + int extra = 0; size_t cmdlen; /* ** This is the first request of a multi request command. @@ -624,12 +629,17 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) client->errorValue = req->requestNumber; return __glXBadLargeRequest; } + if (dataBytes < __GLX_RENDER_LARGE_HDR_SIZE) + return BadLength; + hdr = (__GLXrenderLargeHeader *) pc; __GLX_SWAP_INT(&hdr->length); __GLX_SWAP_INT(&hdr->opcode); - cmdlen = hdr->length; opcode = hdr->opcode; + if ((cmdlen = safe_pad(hdr->length)) < 0) + return BadLength; + if ( (opcode >= __GLX_MIN_RENDER_OPCODE) && (opcode <= __GLX_MAX_RENDER_OPCODE) ) { entry = &__glXRenderSizeTable[opcode]; @@ -661,16 +671,12 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) if (extra < 0) { return BadLength; } - /* large command's header is 4 bytes longer, so add 4 */ - if (cmdlen != __GLX_PAD(entry->bytes + 4 + extra)) { - return BadLength; - } - } else { - /* constant size command */ - if (cmdlen != __GLX_PAD(entry->bytes + 4)) { - return BadLength; - } } + /* the +4 is safe because we know entry->bytes is small */ + if (cmdlen != safe_pad(safe_add(entry->bytes + 4, extra))) { + return BadLength; + } + /* ** Make enough space in the buffer, then copy the entire request. */ @@ -698,6 +704,7 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) ** We are receiving subsequent (i.e. not the first) requests of a ** multi request command. */ + int bytesSoFar; /* including this packet */ /* ** Check the request number and the total request count. @@ -716,7 +723,13 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) /* ** Check that we didn't get too much data. */ - if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) { + if ((bytesSoFar = safe_add(cl->largeCmdBytesSoFar, dataBytes)) < 0) { + client->errorValue = dataBytes; + __glXResetLargeCommandStatus(cl); + return __glXBadLargeRequest; + } + + if (bytesSoFar > cl->largeCmdBytesTotal) { client->errorValue = dataBytes; __glXResetLargeCommandStatus(cl); return __glXBadLargeRequest; @@ -730,17 +743,17 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) ** This is the last request; it must have enough bytes to complete ** the command. */ - /* NOTE: the two pad macros have been added below; they are needed - ** because the client library pads the total byte count, but not - ** the per-request byte counts. The Protocol Encoding says the - ** total byte count should not be padded, so a proposal will be - ** made to the ARB to relax the padding constraint on the total - ** byte count, thus preserving backward compatibility. Meanwhile, - ** the padding done below fixes a bug that did not allow - ** large commands of odd sizes to be accepted by the server. + /* NOTE: the pad macro below is needed because the client library + ** pads the total byte count, but not the per-request byte counts. + ** The Protocol Encoding says the total byte count should not be + ** padded, so a proposal will be made to the ARB to relax the + ** padding constraint on the total byte count, thus preserving + ** backward compatibility. Meanwhile, the padding done below + ** fixes a bug that did not allow large commands of odd sizes to + ** be accepted by the server. */ - if (__GLX_PAD(cl->largeCmdBytesSoFar) != - __GLX_PAD(cl->largeCmdBytesTotal)) { + + if (safe_pad(cl->largeCmdBytesSoFar) != cl->largeCmdBytesTotal) { client->errorValue = dataBytes; __glXResetLargeCommandStatus(cl); return __glXBadLargeRequest; -- cgit v1.2.3 From 1ea1cd8c4f93b0c03e5b34fe174b3fc9f27c7dfa Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 10 Nov 2014 12:13:48 -0500 Subject: glx: Pass remaining request length into ->varsize (v2) [CVE-2014-8098 8/8] (V3) v2: Handle more multiplies in indirect_reqsize.c (Julien Cristau) v3: RHEL5 backport v4: backport to nx-libs 3.6.x (Mike DePaulo) Reviewed-by: Julien Cristau Reviewed-by: Michal Srb Reviewed-by: Andy Ritger Signed-off-by: Adam Jackson Signed-off-by: Alan Coopersmith Signed-off-by: Fedora X Ninjas Signed-off-by: Dave Airlie --- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 6 +- nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c | 7 +- nx-X11/programs/Xserver/GL/glx/glxserver.h | 90 +++++++++---------- nx-X11/programs/Xserver/GL/glx/rensize.c | 125 ++++++++++++++------------- 4 files changed, 121 insertions(+), 107 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index 20c12f3f9..a1bb25975 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -1490,7 +1490,7 @@ int __glXRender(__GLXclientState *cl, GLbyte *pc) if (entry->varsize) { /* variable size command */ - extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, False); + extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, False, left - __GLX_RENDER_HDR_SIZE); if (extra < 0) { return BadLength; } @@ -1563,6 +1563,7 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) if (cl->largeCmdRequestsSoFar == 0) { __GLXrenderSizeData *entry; int extra = 0, cmdlen; + int left = (req->length << 2) - sz_xGLXRenderLargeReq; /* ** This is the first request of a multi request command. ** Make enough space in the buffer, then copy the entire request. @@ -1608,7 +1609,8 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) ** be computed from its parameters), all the parameters needed ** will be in the 1st request, so it's okay to do this. */ - extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, False); + extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, False, + left - __GLX_RENDER_LARGE_HDR_SIZE); if (extra < 0) { return BadLength; } diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c index 2e228c083..33a748a24 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c @@ -541,7 +541,8 @@ int __glXSwapRender(__GLXclientState *cl, GLbyte *pc) if (entry->varsize) { /* variable size command */ - extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True); + extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True, + left - __GLX_RENDER_HDR_SIZE); if (extra < 0) { return BadLength; } @@ -620,6 +621,7 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) if (cl->largeCmdRequestsSoFar == 0) { __GLXrenderSizeData *entry; int extra = 0; + int left = (req->length << 2) - sz_xGLXRenderLargeReq; size_t cmdlen; /* ** This is the first request of a multi request command. @@ -667,7 +669,8 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) ** be computed from its parameters), all the parameters needed ** will be in the 1st request, so it's okay to do this. */ - extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, True); + extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, True, + left - __GLX_RENDER_LARGE_HDR_SIZE); if (extra < 0) { return BadLength; } diff --git a/nx-X11/programs/Xserver/GL/glx/glxserver.h b/nx-X11/programs/Xserver/GL/glx/glxserver.h index 404757405..193ebcb6f 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxserver.h +++ b/nx-X11/programs/Xserver/GL/glx/glxserver.h @@ -179,7 +179,7 @@ extern __GLXprocPtr __glXProcTable[]; */ typedef struct { int bytes; - int (*varsize)(GLbyte *pc, Bool swap); + int (*varsize)(GLbyte *pc, Bool swap, int left); } __GLXrenderSizeData; extern __GLXrenderSizeData __glXRenderSizeTable[]; extern __GLXrenderSizeData __glXRenderSizeTable_EXT[]; @@ -271,48 +271,48 @@ extern int __glXImageSize(GLenum format, GLenum type, GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows, GLint alignment); -extern int __glXCallListsReqSize(GLbyte *pc, Bool swap); -extern int __glXBitmapReqSize(GLbyte *pc, Bool swap); -extern int __glXFogfvReqSize(GLbyte *pc, Bool swap); -extern int __glXFogivReqSize(GLbyte *pc, Bool swap); -extern int __glXLightfvReqSize(GLbyte *pc, Bool swap); -extern int __glXLightivReqSize(GLbyte *pc, Bool swap); -extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap); -extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap); -extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap); -extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap); -extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap); -extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap); -extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap); -extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap); -extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap); -extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap); -extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap); -extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap); -extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap); -extern int __glXMap1dReqSize(GLbyte *pc, Bool swap); -extern int __glXMap1fReqSize(GLbyte *pc, Bool swap); -extern int __glXMap2dReqSize(GLbyte *pc, Bool swap); -extern int __glXMap2fReqSize(GLbyte *pc, Bool swap); -extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap); -extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap); -extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap); -extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap); -extern int __glXDrawArraysSize(GLbyte *pc, Bool swap); -extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap); -extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap); -extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap); -extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap ); -extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap); -extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap); -extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap); -extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap); -extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap); -extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap); -extern int __glXColorTableReqSize(GLbyte *pc, Bool swap); -extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap); -extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap); -extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap); +extern int __glXCallListsReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXBitmapReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXFogfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXFogivReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXLightfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXLightivReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXMap1dReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXMap1fReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXMap2dReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXMap2fReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXDrawArraysSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap, int reqlen ); +extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXColorTableReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap, int reqlen); /* * Routines for computing the size of returned data. @@ -322,7 +322,7 @@ extern int __glXConvolutionParameterfvSize(GLenum pname); extern int __glXColorTableParameterfvSize(GLenum pname); extern int __glXColorTableParameterivSize(GLenum pname); -extern int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap); -extern int __glXPointParameterivReqSize(GLbyte *pc, Bool swap); +extern int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap, int reqlen); +extern int __glXPointParameterivReqSize(GLbyte *pc, Bool swap, int reqlen); #endif /* !__GLX_server_h__ */ diff --git a/nx-X11/programs/Xserver/GL/glx/rensize.c b/nx-X11/programs/Xserver/GL/glx/rensize.c index 9bf0d00e9..dc3475e7f 100644 --- a/nx-X11/programs/Xserver/GL/glx/rensize.c +++ b/nx-X11/programs/Xserver/GL/glx/rensize.c @@ -48,7 +48,7 @@ (((a & 0xff000000U)>>24) | ((a & 0xff0000U)>>8) | \ ((a & 0xff00U)<<8) | ((a & 0xffU)<<24)) -int __glXCallListsReqSize(GLbyte *pc, Bool swap ) +int __glXCallListsReqSize(GLbyte *pc, Bool swap, int reqlen) { GLsizei n = *(GLsizei *)(pc + 0); GLenum type = *(GLenum *)(pc + 4); @@ -60,7 +60,7 @@ int __glXCallListsReqSize(GLbyte *pc, Bool swap ) return n * __glCallLists_size( type ); } -int __glXFogivReqSize(GLbyte *pc, Bool swap ) +int __glXFogivReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 0); if (swap) { @@ -69,12 +69,12 @@ int __glXFogivReqSize(GLbyte *pc, Bool swap ) return 4 * __glFogiv_size( pname ); /* defined in samplegl lib */ } -int __glXFogfvReqSize(GLbyte *pc, Bool swap ) +int __glXFogfvReqSize(GLbyte *pc, Bool swap, int reqlen) { - return __glXFogivReqSize( pc, swap ); + return __glXFogivReqSize( pc, swap, reqlen); } -int __glXLightfvReqSize(GLbyte *pc, Bool swap ) +int __glXLightfvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 4); if (swap) { @@ -83,12 +83,12 @@ int __glXLightfvReqSize(GLbyte *pc, Bool swap ) return 4 * __glLightfv_size( pname ); /* defined in samplegl lib */ } -int __glXLightivReqSize(GLbyte *pc, Bool swap ) +int __glXLightivReqSize(GLbyte *pc, Bool swap, int reqlen) { - return __glXLightfvReqSize( pc, swap ); + return __glXLightfvReqSize( pc, swap, reqlen); } -int __glXLightModelfvReqSize(GLbyte *pc, Bool swap ) +int __glXLightModelfvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 0); if (swap) { @@ -97,12 +97,12 @@ int __glXLightModelfvReqSize(GLbyte *pc, Bool swap ) return 4 * __glLightModelfv_size( pname ); /* defined in samplegl lib */ } -int __glXLightModelivReqSize(GLbyte *pc, Bool swap ) +int __glXLightModelivReqSize(GLbyte *pc, Bool swap, int reqlen) { - return __glXLightModelfvReqSize( pc, swap ); + return __glXLightModelfvReqSize( pc, swap, reqlen); } -int __glXMaterialfvReqSize(GLbyte *pc, Bool swap ) +int __glXMaterialfvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 4); if (swap) { @@ -111,12 +111,12 @@ int __glXMaterialfvReqSize(GLbyte *pc, Bool swap ) return 4 * __glMaterialfv_size( pname ); /* defined in samplegl lib */ } -int __glXMaterialivReqSize(GLbyte *pc, Bool swap ) +int __glXMaterialivReqSize(GLbyte *pc, Bool swap, int reqlen) { - return __glXMaterialfvReqSize( pc, swap ); + return __glXMaterialfvReqSize( pc, swap, reqlen); } -int __glXTexGendvReqSize(GLbyte *pc, Bool swap ) +int __glXTexGendvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 4); if (swap) { @@ -125,7 +125,7 @@ int __glXTexGendvReqSize(GLbyte *pc, Bool swap ) return 8 * __glTexGendv_size( pname ); /* defined in samplegl lib */ } -int __glXTexGenfvReqSize(GLbyte *pc, Bool swap ) +int __glXTexGenfvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 4); if (swap) { @@ -134,12 +134,12 @@ int __glXTexGenfvReqSize(GLbyte *pc, Bool swap ) return 4 * __glTexGenfv_size( pname ); /* defined in samplegl lib */ } -int __glXTexGenivReqSize(GLbyte *pc, Bool swap ) +int __glXTexGenivReqSize(GLbyte *pc, Bool swap, int reqlen) { - return __glXTexGenfvReqSize( pc, swap ); + return __glXTexGenfvReqSize( pc, swap, reqlen); } -int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap ) +int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 4); if (swap) { @@ -148,12 +148,12 @@ int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap ) return 4 * __glTexParameterfv_size( pname ); /* defined in samplegl lib */ } -int __glXTexParameterivReqSize(GLbyte *pc, Bool swap ) +int __glXTexParameterivReqSize(GLbyte *pc, Bool swap, int reqlen) { - return __glXTexParameterfvReqSize( pc, swap ); + return __glXTexParameterfvReqSize( pc, swap, reqlen); } -int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap ) +int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 4); if (swap) { @@ -162,12 +162,12 @@ int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap ) return 4 * __glTexEnvfv_size( pname ); /* defined in samplegl lib */ } -int __glXTexEnvivReqSize(GLbyte *pc, Bool swap ) +int __glXTexEnvivReqSize(GLbyte *pc, Bool swap, int reqlen ) { - return __glXTexEnvfvReqSize( pc, swap ); + return __glXTexEnvfvReqSize( pc, swap, reqlen); } -int __glXMap1dReqSize(GLbyte *pc, Bool swap ) +int __glXMap1dReqSize(GLbyte *pc, Bool swap, int reqlen ) { GLenum target; GLint order; @@ -183,7 +183,7 @@ int __glXMap1dReqSize(GLbyte *pc, Bool swap ) return safe_mul(8, safe_mul(__glMap1d_size(target), order)); } -int __glXMap1fReqSize(GLbyte *pc, Bool swap ) +int __glXMap1fReqSize(GLbyte *pc, Bool swap, int reqlen ) { GLenum target; GLint order; @@ -205,7 +205,7 @@ static int Map2Size(int k, int majorOrder, int minorOrder) return safe_mul(k, safe_mul(majorOrder, minorOrder)); } -int __glXMap2dReqSize(GLbyte *pc, Bool swap ) +int __glXMap2dReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum target; GLint uorder, vorder; @@ -221,7 +221,7 @@ int __glXMap2dReqSize(GLbyte *pc, Bool swap ) return safe_mul(8, Map2Size(__glMap2d_size(target), uorder, vorder)); } -int __glXMap2fReqSize(GLbyte *pc, Bool swap ) +int __glXMap2fReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum target; GLint uorder, vorder; @@ -237,7 +237,7 @@ int __glXMap2fReqSize(GLbyte *pc, Bool swap ) return safe_mul(4, Map2Size(__glMap2f_size(target), uorder, vorder)); } -int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap ) +int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLint mapsize; mapsize = *(GLint *)(pc + 4); @@ -247,12 +247,12 @@ int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap ) return 4 * mapsize; } -int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap ) +int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap, int reqlen) { - return __glXPixelMapfvReqSize( pc, swap ); + return __glXPixelMapfvReqSize( pc, swap, reqlen); } -int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap ) +int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLint mapsize; mapsize = *(GLint *)(pc + 4); @@ -458,7 +458,7 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target, } -int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap ) +int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc; GLenum format = hdr->format; @@ -482,7 +482,7 @@ int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap ) 0, rowLength, 0, skipRows, alignment ); } -int __glXBitmapReqSize(GLbyte *pc, Bool swap ) +int __glXBitmapReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc; GLint w = hdr->width; @@ -502,7 +502,7 @@ int __glXBitmapReqSize(GLbyte *pc, Bool swap ) 0, rowLength, 0, skipRows, alignment ); } -int __glXTexImage1DReqSize(GLbyte *pc, Bool swap ) +int __glXTexImage1DReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc; GLenum target = hdr->target; @@ -531,7 +531,7 @@ int __glXTexImage1DReqSize(GLbyte *pc, Bool swap ) 0, rowLength, 0, skipRows, alignment ); } -int __glXTexImage2DReqSize(GLbyte *pc, Bool swap ) +int __glXTexImage2DReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc; GLenum target = hdr->target; @@ -578,13 +578,14 @@ int __glXTypeSize(GLenum enm) } } -int __glXDrawArraysSize( GLbyte *pc, Bool swap ) +int __glXDrawArraysSize( GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc; __GLXdispatchDrawArraysComponentHeader *compHeader; GLint numVertexes = hdr->numVertexes; GLint numComponents = hdr->numComponents; GLint arrayElementSize = 0; + GLint x, size; int i; if (swap) { @@ -593,6 +594,13 @@ int __glXDrawArraysSize( GLbyte *pc, Bool swap ) } pc += sizeof(__GLXdispatchDrawArraysHeader); + reqlen -= sizeof(__GLXdispatchDrawArraysHeader); + + size = safe_mul(sizeof(__GLXdispatchDrawArraysComponentHeader), + numComponents); + if (size < 0 || reqlen < 0 || reqlen < size) + return -1; + compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc; for (i=0; iformat; @@ -674,7 +683,7 @@ int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap ) 0, rowLength, 0, skipRows, alignment ); } -int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap ) +int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc; GLenum format = hdr->format; @@ -698,7 +707,7 @@ int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap ) 0, rowLength, 0, skipRows, alignment ); } -int __glXTexImage3DReqSize(GLbyte *pc, Bool swap ) +int __glXTexImage3DReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc; GLenum target = hdr->target; @@ -735,7 +744,7 @@ int __glXTexImage3DReqSize(GLbyte *pc, Bool swap ) } } -int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap ) +int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchTexSubImage3DHeader *hdr = (__GLXdispatchTexSubImage3DHeader *) pc; @@ -772,7 +781,7 @@ int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap ) } } -int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap ) +int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchConvolutionFilterHeader *hdr = (__GLXdispatchConvolutionFilterHeader *) pc; @@ -795,7 +804,7 @@ int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap ) 0, rowLength, 0, 0, alignment ); } -int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap ) +int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchConvolutionFilterHeader *hdr = (__GLXdispatchConvolutionFilterHeader *) pc; @@ -841,7 +850,7 @@ int __glXConvolutionParameterfvSize(GLenum pname) return __glXConvolutionParameterivSize(pname); } -int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap ) +int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 4); if (swap) { @@ -850,12 +859,12 @@ int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap ) return 4 * __glXConvolutionParameterivSize( pname ); } -int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap ) +int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen) { - return __glXConvolutionParameterivReqSize( pc, swap ); + return __glXConvolutionParameterivReqSize( pc, swap, reqlen); } -int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap ) +int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchConvolutionFilterHeader *hdr = (__GLXdispatchConvolutionFilterHeader *) pc; @@ -904,7 +913,7 @@ int __glXColorTableParameterivSize(GLenum pname) return __glXColorTableParameterfvSize(pname); } -int __glXColorTableReqSize(GLbyte *pc, Bool swap ) +int __glXColorTableReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchColorTableHeader *hdr = (__GLXdispatchColorTableHeader *) pc; @@ -939,7 +948,7 @@ int __glXColorTableReqSize(GLbyte *pc, Bool swap ) 0, rowLength, 0, 0, alignment ); } -int __glXColorSubTableReqSize(GLbyte *pc, Bool swap ) +int __glXColorSubTableReqSize(GLbyte *pc, Bool swap, int reqlen) { __GLXdispatchColorSubTableHeader *hdr = (__GLXdispatchColorSubTableHeader *) pc; @@ -962,7 +971,7 @@ int __glXColorSubTableReqSize(GLbyte *pc, Bool swap ) 0, rowLength, 0, 0, alignment ); } -int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap ) +int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 4); if (swap) { @@ -971,13 +980,13 @@ int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap ) return 4 * __glXColorTableParameterfvSize(pname); } -int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap ) +int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap, int reqlen) { /* no difference between fv and iv versions */ - return __glXColorTableParameterfvReqSize(pc, swap); + return __glXColorTableParameterfvReqSize(pc, swap, reqlen); } -int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap ) +int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap, int reqlen) { GLenum pname = *(GLenum *)(pc + 0); if (swap) { @@ -986,8 +995,8 @@ int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap ) return 4 * __glPointParameterfvEXT_size( pname ); } -int __glXPointParameterivReqSize(GLbyte *pc, Bool swap ) +int __glXPointParameterivReqSize(GLbyte *pc, Bool swap, int reqlen) { /* no difference between fv and iv versions */ - return __glXPointParameterfvARBReqSize(pc, swap); + return __glXPointParameterfvARBReqSize(pc, swap, reqlen); } -- cgit v1.2.3 From 70b77a0fc329e2e205a596a738c7307d354e7b1c Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 14 Apr 2015 09:24:55 +0200 Subject: library clean-up: Don't build and link libXfont.a anymore. Use system's libXfont shared library and link dynamically. --- debian/control | 4 +- debian/rules | 1 - nx-X11/Imakefile | 3 - nx-X11/config/cf/Imake.rules | 21 - nx-X11/config/cf/Imake.tmpl | 8 - nx-X11/config/cf/README | 8 - nx-X11/config/cf/X11.tmpl | 1036 +------ nx-X11/config/cf/host.def | 150 - nx-X11/config/cf/linux.cf | 8 - nx-X11/config/cf/xf86site.def | 111 - nx-X11/config/cf/xfree86.cf | 52 - nx-X11/config/cf/xorg.cf | 52 - nx-X11/config/cf/xorgsite.def | 137 - nx-X11/include/Imakefile | 2 +- nx-X11/include/extensions/Imakefile | 2 +- nx-X11/include/fonts/FS.h | 132 - nx-X11/include/fonts/FSproto.h | 816 ------ nx-X11/include/fonts/Imakefile | 22 - nx-X11/include/fonts/font.h | 169 -- nx-X11/include/fonts/fontproto.h | 93 - nx-X11/include/fonts/fontstruct.h | 295 -- nx-X11/include/fonts/fsmasks.h | 98 - nx-X11/lib/Imakefile | 36 +- nx-X11/lib/Xrender/Imakefile | 7 - nx-X11/lib/font/Imakefile | 178 -- nx-X11/lib/font/Speedo/Imakefile | 46 - nx-X11/lib/font/Speedo/adobe-iso.h | 200 -- nx-X11/lib/font/Speedo/bics-iso.h | 224 -- nx-X11/lib/font/Speedo/bics-unicode.c | 138 - nx-X11/lib/font/Speedo/bics-unicode.h | 3 - nx-X11/lib/font/Speedo/do_char.c | 1016 ------- nx-X11/lib/font/Speedo/do_trns.c | 512 ---- nx-X11/lib/font/Speedo/htest.c | 361 --- nx-X11/lib/font/Speedo/iface.c | 650 ----- nx-X11/lib/font/Speedo/keys.h | 56 - nx-X11/lib/font/Speedo/module/Imakefile | 47 - nx-X11/lib/font/Speedo/module/speedomod.c | 72 - nx-X11/lib/font/Speedo/nsample.c | 745 ----- nx-X11/lib/font/Speedo/out_bl2d.c | 772 ----- nx-X11/lib/font/Speedo/out_blk.c | 706 ----- nx-X11/lib/font/Speedo/out_outl.c | 290 -- nx-X11/lib/font/Speedo/out_scrn.c | 1090 ------- nx-X11/lib/font/Speedo/out_util.c | 341 --- nx-X11/lib/font/Speedo/reset.c | 131 - nx-X11/lib/font/Speedo/set_spcs.c | 773 ----- nx-X11/lib/font/Speedo/set_trns.c | 1324 --------- nx-X11/lib/font/Speedo/spdo_prv.h | 421 --- nx-X11/lib/font/Speedo/speedo.h | 890 ------ nx-X11/lib/font/Speedo/spencode.c | 67 - nx-X11/lib/font/Speedo/sperr.c | 127 - nx-X11/lib/font/Speedo/spfile.c | 460 --- nx-X11/lib/font/Speedo/spfont.c | 453 --- nx-X11/lib/font/Speedo/spfuncs.c | 167 -- nx-X11/lib/font/Speedo/spglyph.c | 399 --- nx-X11/lib/font/Speedo/spinfo.c | 462 --- nx-X11/lib/font/Speedo/spint.h | 180 -- nx-X11/lib/font/Speedo/sptobdf.c | 678 ----- nx-X11/lib/font/Speedo/useropt.h | 41 - nx-X11/lib/font/Type1/AFM.h | 62 - nx-X11/lib/font/Type1/Imakefile | 91 - nx-X11/lib/font/Type1/afm.c | 200 -- nx-X11/lib/font/Type1/arith.c | 486 ---- nx-X11/lib/font/Type1/arith.h | 77 - nx-X11/lib/font/Type1/blues.h | 95 - nx-X11/lib/font/Type1/cidchar.c | 621 ---- nx-X11/lib/font/Type1/cluts.h | 35 - nx-X11/lib/font/Type1/curves.c | 228 -- nx-X11/lib/font/Type1/curves.h | 44 - nx-X11/lib/font/Type1/digit.h | 64 - nx-X11/lib/font/Type1/fontfcn.c | 709 ----- nx-X11/lib/font/Type1/fontfcn.h | 250 -- nx-X11/lib/font/Type1/fonts.h | 49 - nx-X11/lib/font/Type1/hdigit.h | 94 - nx-X11/lib/font/Type1/hints.c | 890 ------ nx-X11/lib/font/Type1/hints.h | 48 - nx-X11/lib/font/Type1/lines.c | 189 -- nx-X11/lib/font/Type1/lines.h | 39 - nx-X11/lib/font/Type1/minimain.c | 48 - nx-X11/lib/font/Type1/module/Imakefile | 99 - nx-X11/lib/font/Type1/module/type1mod.c | 91 - nx-X11/lib/font/Type1/objects.c | 1101 ------- nx-X11/lib/font/Type1/objects.h | 354 --- nx-X11/lib/font/Type1/paths.c | 1406 --------- nx-X11/lib/font/Type1/paths.h | 239 -- nx-X11/lib/font/Type1/pictures.h | 50 - nx-X11/lib/font/Type1/range.h | 48 - nx-X11/lib/font/Type1/regions.c | 1651 ----------- nx-X11/lib/font/Type1/regions.h | 250 -- nx-X11/lib/font/Type1/scanfont.c | 2370 --------------- nx-X11/lib/font/Type1/spaces.c | 998 ------- nx-X11/lib/font/Type1/spaces.h | 172 -- nx-X11/lib/font/Type1/strokes.h | 38 - nx-X11/lib/font/Type1/t1funcs.c | 1668 ----------- nx-X11/lib/font/Type1/t1hdigit.h | 40 - nx-X11/lib/font/Type1/t1imager.h | 84 - nx-X11/lib/font/Type1/t1info.c | 1096 ------- nx-X11/lib/font/Type1/t1intf.h | 143 - nx-X11/lib/font/Type1/t1io.c | 388 --- nx-X11/lib/font/Type1/t1malloc.c | 759 ----- nx-X11/lib/font/Type1/t1snap.c | 85 - nx-X11/lib/font/Type1/t1stdio.h | 101 - nx-X11/lib/font/Type1/t1stub.c | 56 - nx-X11/lib/font/Type1/t1test.c | 246 -- nx-X11/lib/font/Type1/t1unicode.c | 251 -- nx-X11/lib/font/Type1/t1unicode.h | 25 - nx-X11/lib/font/Type1/token.c | 1208 -------- nx-X11/lib/font/Type1/token.h | 79 - nx-X11/lib/font/Type1/tokst.h | 510 ---- nx-X11/lib/font/Type1/trig.h | 41 - nx-X11/lib/font/Type1/type1.c | 1892 ------------ nx-X11/lib/font/Type1/util.c | 222 -- nx-X11/lib/font/Type1/util.h | 217 -- nx-X11/lib/font/bitmap/Imakefile | 71 - nx-X11/lib/font/bitmap/bdfint.h | 90 - nx-X11/lib/font/bitmap/bdfread.c | 967 ------- nx-X11/lib/font/bitmap/bdfutils.c | 340 --- nx-X11/lib/font/bitmap/bitmap.c | 160 -- nx-X11/lib/font/bitmap/bitmapfunc.c | 240 -- nx-X11/lib/font/bitmap/bitmaputil.c | 232 -- nx-X11/lib/font/bitmap/bitscale.c | 1978 ------------- nx-X11/lib/font/bitmap/fontink.c | 219 -- nx-X11/lib/font/bitmap/module/Imakefile | 45 - nx-X11/lib/font/bitmap/module/bitmapmod.c | 76 - nx-X11/lib/font/bitmap/pcf.h | 100 - nx-X11/lib/font/bitmap/pcfread.c | 997 ------- nx-X11/lib/font/bitmap/pcfwrite.c | 468 --- nx-X11/lib/font/bitmap/snfread.c | 514 ---- nx-X11/lib/font/bitmap/snfstr.h | 185 -- nx-X11/lib/font/builtins/Imakefile | 17 - nx-X11/lib/font/builtins/buildfont | 14 - nx-X11/lib/font/builtins/builtin.h | 60 - nx-X11/lib/font/builtins/dir.c | 64 - nx-X11/lib/font/builtins/file.c | 139 - nx-X11/lib/font/builtins/fonts.c | 2438 ---------------- nx-X11/lib/font/builtins/fpe.c | 98 - nx-X11/lib/font/builtins/render.c | 114 - nx-X11/lib/font/fc/Imakefile | 31 - nx-X11/lib/font/fc/fsconvert.c | 774 ----- nx-X11/lib/font/fc/fserve.c | 3480 ----------------------- nx-X11/lib/font/fc/fserve.h | 96 - nx-X11/lib/font/fc/fservestr.h | 211 -- nx-X11/lib/font/fc/fsio.c | 516 ---- nx-X11/lib/font/fc/fsio.h | 187 -- nx-X11/lib/font/fc/fsio.h.NX.reference | 191 -- nx-X11/lib/font/fc/fsio.h.XF86.reference | 187 -- nx-X11/lib/font/fc/fslibos.h | 216 -- nx-X11/lib/font/fontcache/Imakefile | 29 - nx-X11/lib/font/fontcache/fcqueue.h | 133 - nx-X11/lib/font/fontcache/fontcache.c | 1022 ------- nx-X11/lib/font/fontcache/fontcache.h | 121 - nx-X11/lib/font/fontfile/Imakefile | 81 - nx-X11/lib/font/fontfile/bitsource.c | 174 -- nx-X11/lib/font/fontfile/bufio.c | 212 -- nx-X11/lib/font/fontfile/decompress.c | 415 --- nx-X11/lib/font/fontfile/defaults.c | 77 - nx-X11/lib/font/fontfile/dirfile.c | 495 ---- nx-X11/lib/font/fontfile/encparse.c | 966 ------- nx-X11/lib/font/fontfile/ffcheck.c | 171 -- nx-X11/lib/font/fontfile/fileio.c | 90 - nx-X11/lib/font/fontfile/filewr.c | 65 - nx-X11/lib/font/fontfile/fontdir.c | 832 ------ nx-X11/lib/font/fontfile/fontenc.c | 952 ------- nx-X11/lib/font/fontfile/fontencI.h | 46 - nx-X11/lib/font/fontfile/fontencc.c | 77 - nx-X11/lib/font/fontfile/fontfile.c | 1147 -------- nx-X11/lib/font/fontfile/fontscale.c | 447 --- nx-X11/lib/font/fontfile/gunzip.c | 227 -- nx-X11/lib/font/fontfile/module/Imakefile | 21 - nx-X11/lib/font/fontfile/printerfont.c | 178 -- nx-X11/lib/font/fontfile/register.c | 107 - nx-X11/lib/font/fontfile/renderers.c | 117 - nx-X11/lib/font/include/Imakefile | 11 - nx-X11/lib/font/include/bitmap.h | 116 - nx-X11/lib/font/include/bufio.h | 92 - nx-X11/lib/font/include/fntfil.h | 178 -- nx-X11/lib/font/include/fntfilio.h | 56 - nx-X11/lib/font/include/fntfilst.h | 198 -- nx-X11/lib/font/include/fontencc.h | 36 - nx-X11/lib/font/include/fontmisc.h | 133 - nx-X11/lib/font/include/fontmod.h | 16 - nx-X11/lib/font/include/fontshow.h | 37 - nx-X11/lib/font/include/fontutil.h | 26 - nx-X11/lib/font/include/fontxlfd.h | 100 - nx-X11/lib/font/stubs/Imakefile | 25 - nx-X11/lib/font/stubs/cauthgen.c | 14 - nx-X11/lib/font/stubs/csignal.c | 14 - nx-X11/lib/font/stubs/delfntcid.c | 13 - nx-X11/lib/font/stubs/errorf.c | 13 - nx-X11/lib/font/stubs/fatalerror.c | 13 - nx-X11/lib/font/stubs/findoldfnt.c | 14 - nx-X11/lib/font/stubs/getcres.c | 14 - nx-X11/lib/font/stubs/getdefptsize.c | 14 - nx-X11/lib/font/stubs/getnewfntcid.c | 14 - nx-X11/lib/font/stubs/gettime.c | 14 - nx-X11/lib/font/stubs/initfshdl.c | 15 - nx-X11/lib/font/stubs/regfpefunc.c | 28 - nx-X11/lib/font/stubs/rmfshdl.c | 15 - nx-X11/lib/font/stubs/servclient.c | 3 - nx-X11/lib/font/stubs/setfntauth.c | 14 - nx-X11/lib/font/stubs/stfntcfnt.c | 14 - nx-X11/lib/font/stubs/stubs.h | 27 - nx-X11/lib/font/stubs/xpstubs.c | 24 - nx-X11/lib/font/util/Imakefile | 43 - nx-X11/lib/font/util/atom.c | 233 -- nx-X11/lib/font/util/fontaccel.c | 107 - nx-X11/lib/font/util/fontnames.c | 123 - nx-X11/lib/font/util/fontutil.c | 443 --- nx-X11/lib/font/util/fontxlfd.c | 637 ----- nx-X11/lib/font/util/format.c | 126 - nx-X11/lib/font/util/miscutil.c | 99 - nx-X11/lib/font/util/patcache.c | 221 -- nx-X11/lib/font/util/private.c | 107 - nx-X11/lib/font/util/utilbitmap.c | 188 -- nx-X11/programs/Xserver/GL/glx/Imakefile | 2 +- nx-X11/programs/Xserver/Imakefile | 26 +- nx-X11/programs/Xserver/Xext/Imakefile | 4 +- nx-X11/programs/Xserver/Xext/extmod/Imakefile | 2 +- nx-X11/programs/Xserver/composite/Imakefile | 2 +- nx-X11/programs/Xserver/dix/Imakefile | 2 +- nx-X11/programs/Xserver/dix/dixfonts.c | 17 +- nx-X11/programs/Xserver/fb/Imakefile | 2 +- nx-X11/programs/Xserver/hw/nxagent/Font.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Font.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/GC.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 13 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 18 +- nx-X11/programs/Xserver/mi/Imakefile | 4 +- nx-X11/programs/Xserver/miext/damage/Imakefile | 2 +- nx-X11/programs/Xserver/os/Imakefile | 2 +- nx-X11/programs/Xserver/randr/Imakefile | 4 +- nx-X11/programs/Xserver/render/Imakefile | 4 +- nx-libs.spec | 33 +- 233 files changed, 50 insertions(+), 67022 deletions(-) delete mode 100644 nx-X11/include/fonts/FS.h delete mode 100644 nx-X11/include/fonts/FSproto.h delete mode 100644 nx-X11/include/fonts/Imakefile delete mode 100644 nx-X11/include/fonts/font.h delete mode 100644 nx-X11/include/fonts/fontproto.h delete mode 100644 nx-X11/include/fonts/fontstruct.h delete mode 100644 nx-X11/include/fonts/fsmasks.h delete mode 100644 nx-X11/lib/font/Imakefile delete mode 100644 nx-X11/lib/font/Speedo/Imakefile delete mode 100644 nx-X11/lib/font/Speedo/adobe-iso.h delete mode 100644 nx-X11/lib/font/Speedo/bics-iso.h delete mode 100644 nx-X11/lib/font/Speedo/bics-unicode.c delete mode 100644 nx-X11/lib/font/Speedo/bics-unicode.h delete mode 100644 nx-X11/lib/font/Speedo/do_char.c delete mode 100644 nx-X11/lib/font/Speedo/do_trns.c delete mode 100644 nx-X11/lib/font/Speedo/htest.c delete mode 100644 nx-X11/lib/font/Speedo/iface.c delete mode 100644 nx-X11/lib/font/Speedo/keys.h delete mode 100644 nx-X11/lib/font/Speedo/module/Imakefile delete mode 100644 nx-X11/lib/font/Speedo/module/speedomod.c delete mode 100644 nx-X11/lib/font/Speedo/nsample.c delete mode 100644 nx-X11/lib/font/Speedo/out_bl2d.c delete mode 100644 nx-X11/lib/font/Speedo/out_blk.c delete mode 100644 nx-X11/lib/font/Speedo/out_outl.c delete mode 100644 nx-X11/lib/font/Speedo/out_scrn.c delete mode 100644 nx-X11/lib/font/Speedo/out_util.c delete mode 100644 nx-X11/lib/font/Speedo/reset.c delete mode 100644 nx-X11/lib/font/Speedo/set_spcs.c delete mode 100644 nx-X11/lib/font/Speedo/set_trns.c delete mode 100644 nx-X11/lib/font/Speedo/spdo_prv.h delete mode 100644 nx-X11/lib/font/Speedo/speedo.h delete mode 100644 nx-X11/lib/font/Speedo/spencode.c delete mode 100644 nx-X11/lib/font/Speedo/sperr.c delete mode 100644 nx-X11/lib/font/Speedo/spfile.c delete mode 100644 nx-X11/lib/font/Speedo/spfont.c delete mode 100644 nx-X11/lib/font/Speedo/spfuncs.c delete mode 100644 nx-X11/lib/font/Speedo/spglyph.c delete mode 100644 nx-X11/lib/font/Speedo/spinfo.c delete mode 100644 nx-X11/lib/font/Speedo/spint.h delete mode 100644 nx-X11/lib/font/Speedo/sptobdf.c delete mode 100644 nx-X11/lib/font/Speedo/useropt.h delete mode 100644 nx-X11/lib/font/Type1/AFM.h delete mode 100644 nx-X11/lib/font/Type1/Imakefile delete mode 100644 nx-X11/lib/font/Type1/afm.c delete mode 100644 nx-X11/lib/font/Type1/arith.c delete mode 100644 nx-X11/lib/font/Type1/arith.h delete mode 100644 nx-X11/lib/font/Type1/blues.h delete mode 100644 nx-X11/lib/font/Type1/cidchar.c delete mode 100644 nx-X11/lib/font/Type1/cluts.h delete mode 100644 nx-X11/lib/font/Type1/curves.c delete mode 100644 nx-X11/lib/font/Type1/curves.h delete mode 100644 nx-X11/lib/font/Type1/digit.h delete mode 100644 nx-X11/lib/font/Type1/fontfcn.c delete mode 100644 nx-X11/lib/font/Type1/fontfcn.h delete mode 100644 nx-X11/lib/font/Type1/fonts.h delete mode 100644 nx-X11/lib/font/Type1/hdigit.h delete mode 100644 nx-X11/lib/font/Type1/hints.c delete mode 100644 nx-X11/lib/font/Type1/hints.h delete mode 100644 nx-X11/lib/font/Type1/lines.c delete mode 100644 nx-X11/lib/font/Type1/lines.h delete mode 100644 nx-X11/lib/font/Type1/minimain.c delete mode 100644 nx-X11/lib/font/Type1/module/Imakefile delete mode 100644 nx-X11/lib/font/Type1/module/type1mod.c delete mode 100644 nx-X11/lib/font/Type1/objects.c delete mode 100644 nx-X11/lib/font/Type1/objects.h delete mode 100644 nx-X11/lib/font/Type1/paths.c delete mode 100644 nx-X11/lib/font/Type1/paths.h delete mode 100644 nx-X11/lib/font/Type1/pictures.h delete mode 100644 nx-X11/lib/font/Type1/range.h delete mode 100644 nx-X11/lib/font/Type1/regions.c delete mode 100644 nx-X11/lib/font/Type1/regions.h delete mode 100644 nx-X11/lib/font/Type1/scanfont.c delete mode 100644 nx-X11/lib/font/Type1/spaces.c delete mode 100644 nx-X11/lib/font/Type1/spaces.h delete mode 100644 nx-X11/lib/font/Type1/strokes.h delete mode 100644 nx-X11/lib/font/Type1/t1funcs.c delete mode 100644 nx-X11/lib/font/Type1/t1hdigit.h delete mode 100644 nx-X11/lib/font/Type1/t1imager.h delete mode 100644 nx-X11/lib/font/Type1/t1info.c delete mode 100644 nx-X11/lib/font/Type1/t1intf.h delete mode 100644 nx-X11/lib/font/Type1/t1io.c delete mode 100644 nx-X11/lib/font/Type1/t1malloc.c delete mode 100644 nx-X11/lib/font/Type1/t1snap.c delete mode 100644 nx-X11/lib/font/Type1/t1stdio.h delete mode 100644 nx-X11/lib/font/Type1/t1stub.c delete mode 100644 nx-X11/lib/font/Type1/t1test.c delete mode 100644 nx-X11/lib/font/Type1/t1unicode.c delete mode 100644 nx-X11/lib/font/Type1/t1unicode.h delete mode 100644 nx-X11/lib/font/Type1/token.c delete mode 100644 nx-X11/lib/font/Type1/token.h delete mode 100644 nx-X11/lib/font/Type1/tokst.h delete mode 100644 nx-X11/lib/font/Type1/trig.h delete mode 100644 nx-X11/lib/font/Type1/type1.c delete mode 100644 nx-X11/lib/font/Type1/util.c delete mode 100644 nx-X11/lib/font/Type1/util.h delete mode 100644 nx-X11/lib/font/bitmap/Imakefile delete mode 100644 nx-X11/lib/font/bitmap/bdfint.h delete mode 100644 nx-X11/lib/font/bitmap/bdfread.c delete mode 100644 nx-X11/lib/font/bitmap/bdfutils.c delete mode 100644 nx-X11/lib/font/bitmap/bitmap.c delete mode 100644 nx-X11/lib/font/bitmap/bitmapfunc.c delete mode 100644 nx-X11/lib/font/bitmap/bitmaputil.c delete mode 100644 nx-X11/lib/font/bitmap/bitscale.c delete mode 100644 nx-X11/lib/font/bitmap/fontink.c delete mode 100644 nx-X11/lib/font/bitmap/module/Imakefile delete mode 100644 nx-X11/lib/font/bitmap/module/bitmapmod.c delete mode 100644 nx-X11/lib/font/bitmap/pcf.h delete mode 100644 nx-X11/lib/font/bitmap/pcfread.c delete mode 100644 nx-X11/lib/font/bitmap/pcfwrite.c delete mode 100644 nx-X11/lib/font/bitmap/snfread.c delete mode 100644 nx-X11/lib/font/bitmap/snfstr.h delete mode 100644 nx-X11/lib/font/builtins/Imakefile delete mode 100644 nx-X11/lib/font/builtins/buildfont delete mode 100644 nx-X11/lib/font/builtins/builtin.h delete mode 100644 nx-X11/lib/font/builtins/dir.c delete mode 100644 nx-X11/lib/font/builtins/file.c delete mode 100644 nx-X11/lib/font/builtins/fonts.c delete mode 100644 nx-X11/lib/font/builtins/fpe.c delete mode 100644 nx-X11/lib/font/builtins/render.c delete mode 100644 nx-X11/lib/font/fc/Imakefile delete mode 100644 nx-X11/lib/font/fc/fsconvert.c delete mode 100644 nx-X11/lib/font/fc/fserve.c delete mode 100644 nx-X11/lib/font/fc/fserve.h delete mode 100644 nx-X11/lib/font/fc/fservestr.h delete mode 100644 nx-X11/lib/font/fc/fsio.c delete mode 100644 nx-X11/lib/font/fc/fsio.h delete mode 100644 nx-X11/lib/font/fc/fsio.h.NX.reference delete mode 100644 nx-X11/lib/font/fc/fsio.h.XF86.reference delete mode 100644 nx-X11/lib/font/fc/fslibos.h delete mode 100644 nx-X11/lib/font/fontcache/Imakefile delete mode 100644 nx-X11/lib/font/fontcache/fcqueue.h delete mode 100644 nx-X11/lib/font/fontcache/fontcache.c delete mode 100644 nx-X11/lib/font/fontcache/fontcache.h delete mode 100644 nx-X11/lib/font/fontfile/Imakefile delete mode 100644 nx-X11/lib/font/fontfile/bitsource.c delete mode 100644 nx-X11/lib/font/fontfile/bufio.c delete mode 100644 nx-X11/lib/font/fontfile/decompress.c delete mode 100644 nx-X11/lib/font/fontfile/defaults.c delete mode 100644 nx-X11/lib/font/fontfile/dirfile.c delete mode 100644 nx-X11/lib/font/fontfile/encparse.c delete mode 100644 nx-X11/lib/font/fontfile/ffcheck.c delete mode 100644 nx-X11/lib/font/fontfile/fileio.c delete mode 100644 nx-X11/lib/font/fontfile/filewr.c delete mode 100644 nx-X11/lib/font/fontfile/fontdir.c delete mode 100644 nx-X11/lib/font/fontfile/fontenc.c delete mode 100644 nx-X11/lib/font/fontfile/fontencI.h delete mode 100644 nx-X11/lib/font/fontfile/fontencc.c delete mode 100644 nx-X11/lib/font/fontfile/fontfile.c delete mode 100644 nx-X11/lib/font/fontfile/fontscale.c delete mode 100644 nx-X11/lib/font/fontfile/gunzip.c delete mode 100644 nx-X11/lib/font/fontfile/module/Imakefile delete mode 100644 nx-X11/lib/font/fontfile/printerfont.c delete mode 100644 nx-X11/lib/font/fontfile/register.c delete mode 100644 nx-X11/lib/font/fontfile/renderers.c delete mode 100644 nx-X11/lib/font/include/Imakefile delete mode 100644 nx-X11/lib/font/include/bitmap.h delete mode 100644 nx-X11/lib/font/include/bufio.h delete mode 100644 nx-X11/lib/font/include/fntfil.h delete mode 100644 nx-X11/lib/font/include/fntfilio.h delete mode 100644 nx-X11/lib/font/include/fntfilst.h delete mode 100644 nx-X11/lib/font/include/fontencc.h delete mode 100644 nx-X11/lib/font/include/fontmisc.h delete mode 100644 nx-X11/lib/font/include/fontmod.h delete mode 100644 nx-X11/lib/font/include/fontshow.h delete mode 100644 nx-X11/lib/font/include/fontutil.h delete mode 100644 nx-X11/lib/font/include/fontxlfd.h delete mode 100644 nx-X11/lib/font/stubs/Imakefile delete mode 100644 nx-X11/lib/font/stubs/cauthgen.c delete mode 100644 nx-X11/lib/font/stubs/csignal.c delete mode 100644 nx-X11/lib/font/stubs/delfntcid.c delete mode 100644 nx-X11/lib/font/stubs/errorf.c delete mode 100644 nx-X11/lib/font/stubs/fatalerror.c delete mode 100644 nx-X11/lib/font/stubs/findoldfnt.c delete mode 100644 nx-X11/lib/font/stubs/getcres.c delete mode 100644 nx-X11/lib/font/stubs/getdefptsize.c delete mode 100644 nx-X11/lib/font/stubs/getnewfntcid.c delete mode 100644 nx-X11/lib/font/stubs/gettime.c delete mode 100644 nx-X11/lib/font/stubs/initfshdl.c delete mode 100644 nx-X11/lib/font/stubs/regfpefunc.c delete mode 100644 nx-X11/lib/font/stubs/rmfshdl.c delete mode 100644 nx-X11/lib/font/stubs/servclient.c delete mode 100644 nx-X11/lib/font/stubs/setfntauth.c delete mode 100644 nx-X11/lib/font/stubs/stfntcfnt.c delete mode 100644 nx-X11/lib/font/stubs/stubs.h delete mode 100644 nx-X11/lib/font/stubs/xpstubs.c delete mode 100644 nx-X11/lib/font/util/Imakefile delete mode 100644 nx-X11/lib/font/util/atom.c delete mode 100644 nx-X11/lib/font/util/fontaccel.c delete mode 100644 nx-X11/lib/font/util/fontnames.c delete mode 100644 nx-X11/lib/font/util/fontutil.c delete mode 100644 nx-X11/lib/font/util/fontxlfd.c delete mode 100644 nx-X11/lib/font/util/format.c delete mode 100644 nx-X11/lib/font/util/miscutil.c delete mode 100644 nx-X11/lib/font/util/patcache.c delete mode 100644 nx-X11/lib/font/util/private.c delete mode 100644 nx-X11/lib/font/util/utilbitmap.c (limited to 'nx-X11/programs/Xserver/GL') diff --git a/debian/control b/debian/control index 65a8f9433..9572f7ce7 100644 --- a/debian/control +++ b/debian/control @@ -12,12 +12,10 @@ Build-Depends: libjpeg-dev, zlib1g-dev, quilt (>= 0.46-7~), - libfontconfig1-dev, - libfontenc-dev, - libfreetype6-dev, libxmltok1-dev, libxml2-dev, libxpm-dev, + libxfont-dev, autoconf, pkg-config, x11proto-core-dev, diff --git a/debian/rules b/debian/rules index e58b79121..6d076a1c4 100755 --- a/debian/rules +++ b/debian/rules @@ -64,7 +64,6 @@ override_dh_install: rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86bigfstr.h rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86bigfont.h rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/XI.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/fonts/ rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/Xtrans/ dh_install --fail-missing diff --git a/nx-X11/Imakefile b/nx-X11/Imakefile index 3cb1e1bc3..46ca9e70c 100644 --- a/nx-X11/Imakefile +++ b/nx-X11/Imakefile @@ -15,9 +15,6 @@ RELEASE = XOrgReleaseString #endif #if !BuildServersOnly -#if BuildFonts - FONTSDIR = fonts -#endif #ifndef Win32Architecture #if BuildDocs DOCSDIR = doc diff --git a/nx-X11/config/cf/Imake.rules b/nx-X11/config/cf/Imake.rules index 3923e4a10..e023b6d26 100644 --- a/nx-X11/config/cf/Imake.rules +++ b/nx-X11/config/cf/Imake.rules @@ -2117,16 +2117,6 @@ ProjectUnsharedLibReferences(varname,libname,libsource,$(BUILDLIBDIR)) Concat3(DEP,varname,LIB) = _UseCat($(USRLIBDIR)/,buildlibdir/,LibraryTargetName(libname)) @@\ Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\ LintLibReferences(varname,libname,libsource) -#endif - - /* - * ProjectUnsharedFontLibReferences - unshared font libraries - */ -#ifndef ProjectUnsharedFontLibReferences -#define ProjectUnsharedFontLibReferences() @@\ -DEPFONTLIB = _UseCat($(USRLIBDIR)/,XBuildLibDir/,LibraryTargetName(NX_Xfont)) @@\ -FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lNX_Xfont @@\ -LintLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC)) #endif /* @@ -2136,17 +2126,6 @@ LintLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC)) #define SharedLibDependencies(libname,libsource,revname) /**/ #endif -/* - * SharedFontLibReferences - shared font libraries - */ -#ifndef SharedFontLibReferences -#define SharedFontLibReferences() @@\ -SOFONTREV = SharedFontRev @@\ -DEPFONTLIB = SharedLibDependencies(NX_Xfont,$(FONTLIBSRC),SOFONTREV) @@\ -FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lNX_Xfont @@\ -LintLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC)) -#endif - /* * SharedDSLibDependencies - shared library dependencies with data separation */ diff --git a/nx-X11/config/cf/Imake.tmpl b/nx-X11/config/cf/Imake.tmpl index 595617267..4a9e98598 100644 --- a/nx-X11/config/cf/Imake.tmpl +++ b/nx-X11/config/cf/Imake.tmpl @@ -602,14 +602,6 @@ XCOMM deprecated; please strongly consider using vendor-supplied packages. #ifndef GzipLibrary /* if OS config didn't define it, assume it's -lz */ #define GzipLibrary -lz #endif -/* If the system has the Freetype2 library - if NO, the copy in extras is built */ -#ifndef HasFreetype2 -#define HasFreetype2 YES -#endif -/* If the system has the Fontconfig library - if NO, the copy in extras is built */ -#ifndef HasFontconfig -#define HasFontconfig NO -#endif /* If the system has the PNG library - if NO, xcursorgen is not built */ #ifndef HasLibpng #define HasLibpng NO diff --git a/nx-X11/config/cf/README b/nx-X11/config/cf/README index a31490377..80113a9e3 100644 --- a/nx-X11/config/cf/README +++ b/nx-X11/config/cf/README @@ -178,7 +178,6 @@ X11.tmpl provides defaults for the following variables: BuildDBE build DOUBLE-BUFFER extension BuildDmx build Distributed Multihead X server and extension BuildDPMS build Display Power Management Signaling extension - BuildFonts build pcf fonts BuildIncRoot relative path to location of headers in build BuildIncTop path from build includes directory to top BuildEVI build EVI server extension @@ -214,7 +213,6 @@ X11.tmpl provides defaults for the following variables: DebugLibXag build libXag_d.a DebugOldX build liboldX_d.a DefaultCursorTheme name of default cursor theme - DefaultFSConfigFile default font server config file DefaultFontPath default server font path DefaultRGBDatabase default server rgb color database DefaultSystemPath default system xdm PATH environment variable @@ -226,13 +224,7 @@ X11.tmpl provides defaults for the following variables: DriverManSuffix man suffix for driver pages ExtensionDefines -D's for universal extensions ExtensionOSDefines -D's for additional extensions - FontCompilerFlags flags for bdftosnf - FontDefines -D's to turn on font options - FontDir directory in which to install fonts - FontFilters -D's to specify font conversion filters - FontOSDefines -D's for which fonts to support ForceNormalLib force building of .a in addition to shared lib - GzipFontCompression boolean for using gzip instead of compress HasXdmAuth boolean for using XDM-AUTHORIZATION-1; needs Wraphelp.c, see Release Notes InstallAppDefFiles install new app defaults files over old? diff --git a/nx-X11/config/cf/X11.tmpl b/nx-X11/config/cf/X11.tmpl index b6ff72e1f..30b04510b 100644 --- a/nx-X11/config/cf/X11.tmpl +++ b/nx-X11/config/cf/X11.tmpl @@ -23,20 +23,6 @@ XCOMM $XFree86: xc/config/cf/X11.tmpl,v 1.248 2004/02/16 04:07:37 dawes Exp $ * * InstallAppDefaults (class) * InstallAppDefaultsLong (file,class) - * MakeFontsDir (deplist) - * MakeFcCache (deplist) - * MakeFonts () - * InstallFontObjs (objs,dest) - * InstallFonts (dest) - * InstallFontAliases (dest) - * InstallFcCache (dest) - * FontSrc (basename) - * FontBaseObj (basename) - * InstallFontScale (dest) - * UncompressedFontTarget (basename) - * CompressedFontTarget (basename) - * FontTarget (basename) - * FontObj (basename) * MakeXkbDir (basedir,subdir) */ @@ -144,144 +130,6 @@ XORGRELSTRING = XorgManVersionString #ifndef BuildLibrariesForXServers #define BuildLibrariesForXServers BuildServer #endif -#ifndef XserverStaticFontLib -#define XserverStaticFontLib YES -#endif -#ifndef BuildSpeedo -#define BuildSpeedo NO -#endif -#ifndef BuildType1 -#define BuildType1 NO -#endif -#ifndef BuildCID -#define BuildCID YES -#endif -#ifndef BuildFreeType -#define BuildFreeType NO -#endif -#ifndef BuildBuiltinFonts -#define BuildBuiltinFonts NO -#endif -#ifndef BuildFonts -#define BuildFonts BuildServer -#endif -#ifndef Build75DpiFonts -#define Build75DpiFonts YES -#endif -#ifndef Build100DpiFonts -#define Build100DpiFonts YES -#endif -#ifndef BuildSpeedoFonts -#define BuildSpeedoFonts NO -#endif -#ifndef BuildType1Fonts -#define BuildType1Fonts YES -#endif -#ifndef BuildCIDFonts -#define BuildCIDFonts YES -#endif -#ifndef BuildTrueTypeFonts -#define BuildTrueTypeFonts YES -#endif -#ifndef BuildBethMarduthoFonts -#define BuildBethMarduthoFonts NO -#endif -#ifndef BuildEthiopicFonts -#define BuildEthiopicFonts NO -#endif -#ifndef BuildCyrillicFonts -#define BuildCyrillicFonts YES -#endif -/* Some bdf font generation details. The scripts for this require perl. */ -#ifndef TruncateUCSFonts -#define TruncateUCSFonts HasPerl5 -#endif -#ifndef MaxUCSChar -#define MaxUCSChar 0x3200 -#endif -#ifndef DerivedUCSFonts -#define DerivedUCSFonts YES -#endif -/* These primarily control generation of derived 8-bit fonts. */ -#ifndef BuildUCSFonts -#define BuildUCSFonts YES -#endif -/* Setting BuildISO8859_1Fonts to NO may result in problems. */ -#ifndef BuildISO8859_1Fonts -#define BuildISO8859_1Fonts YES -#endif -#ifndef BuildISO8859_2Fonts -#define BuildISO8859_2Fonts YES -#endif -#ifndef BuildISO8859_3Fonts -#define BuildISO8859_3Fonts YES -#endif -#ifndef BuildISO8859_4Fonts -#define BuildISO8859_4Fonts YES -#endif -#ifndef BuildISO8859_5Fonts -#define BuildISO8859_5Fonts BuildCyrillicFonts -#endif -#ifndef BuildArabicFonts -#define BuildArabicFonts YES -#endif -#ifndef BuildISO8859_6Fonts -#define BuildISO8859_6Fonts BuildArabicFonts -#endif -#ifndef BuildGreekFonts -#define BuildGreekFonts YES -#endif -#ifndef BuildISO8859_7Fonts -#define BuildISO8859_7Fonts BuildGreekFonts -#endif -#ifndef BuildHebrewFonts -#define BuildHebrewFonts YES -#endif -#ifndef BuildISO8859_8Fonts -#define BuildISO8859_8Fonts BuildHebrewFonts -#endif -#ifndef BuildISO8859_9Fonts -#define BuildISO8859_9Fonts YES -#endif -#ifndef BuildISO8859_10Fonts -#define BuildISO8859_10Fonts YES -#endif -#ifndef BuildThaiFonts -#define BuildThaiFonts YES -#endif -#ifndef BuildISO8859_11Fonts -#define BuildISO8859_11Fonts BuildThaiFonts -#endif -#ifndef BuildISO8859_13Fonts -#define BuildISO8859_13Fonts YES -#endif -#ifndef BuildISO8859_14Fonts -#define BuildISO8859_14Fonts YES -#endif -#ifndef BuildISO8859_15Fonts -#define BuildISO8859_15Fonts YES -#endif -#ifndef BuildISO8859_16Fonts -#define BuildISO8859_16Fonts YES -#endif -#ifndef BuildKOI8_RFonts -#define BuildKOI8_RFonts BuildCyrillicFonts -#endif -#ifndef BuildJapaneseFonts -#define BuildJapaneseFonts YES -#endif -#ifndef BuildJISX0201Fonts -#define BuildJISX0201Fonts BuildJapaneseFonts -#endif -#ifndef BuildKoreanFonts -#define BuildKoreanFonts YES -#endif -#ifndef BuildChineseFonts -#define BuildChineseFonts YES -#endif -#ifndef MakeLocalFontDir -#define MakeLocalFontDir YES -#endif #ifndef HasXAudio #define HasXAudio NO #endif @@ -366,35 +214,9 @@ XORGRELSTRING = XorgManVersionString #ifndef BuildDPMS #define BuildDPMS YES #endif -#ifndef BuildFontLib -#if (!defined(XF86Server) || !XF86Server) && (!defined (XorgServer) || !XorgServer) -#define BuildFontLib (BuildLibraries || BuildServer) -#else -#define BuildFontLib (BuildLibraries || (BuildServer && !DoLoadableServer)) -#endif -#endif #ifndef BuildFontCache #define BuildFontCache NO #endif -#ifndef BuildFontCacheLib -#define BuildFontCacheLib (BuildFontCache && !BuildServersOnly) -#endif -#ifndef BuildFontEncLib -#define BuildFontEncLib BuildLibraries -#endif -/* - * This enables binary compatibility with the older (XFree86 <= 4.1) fontenc - * entry points in the Xfont library (and X server). If this is turned off, - * then SharedFontRev should have it's major revision bumped, and the - * XFree86 font module ABI (in xfree86/common/xf86Module.h) should have it's - * major revision bumped. - * - * Note: this does not enable those older functions in the separate libfontenc - * library (which didn't exist previously). - */ -#ifndef FontencCompatibility -#define FontencCompatibility YES -#endif #ifndef BuildLBX #define BuildLBX YES #endif @@ -580,40 +402,16 @@ XORGRELSTRING = XorgManVersionString #ifndef BuildRenderLibrary #define BuildRenderLibrary !BuildServersOnly #endif -#ifndef BuildXftLibrary -#define BuildXftLibrary BuildRenderLibrary -#endif -#ifndef BuildXft1Library -#define BuildXft1Library BuildRenderLibrary -#endif -#ifndef UseFontconfig -#define UseFontconfig BuildXftLibrary -#endif -#ifndef BuildFontconfigLibrary -#define BuildFontconfigLibrary (UseFontconfig && !HasFontconfig) -#endif -#ifndef UseFreetype2 -#define UseFreetype2 (BuildXftLibrary || BuildXft1Library || \ - UseFontconfig || BuildFreeType) -#endif -#ifndef InstallFontconfigLibrary -# define InstallFontconfigLibrary YES -#endif + #ifndef HasExpat #define HasExpat YES #endif #ifndef UseExpat -#define UseExpat (UseFontconfig || BuildXF86DRI) +#define UseExpat BuildXF86DRI #endif #ifndef BuildExpatLibrary #define BuildExpatLibrary (UseExpat && !HasExpat) #endif -#ifndef BuildFreetype2Library -#define BuildFreetype2Library (UseFreetype2 && !HasFreetype2) -#endif -#ifndef Freetype2BuildDefines -#define Freetype2BuildDefines /**/ -#endif #ifndef BuildRandR #define BuildRandR YES @@ -739,9 +537,6 @@ XORGRELSTRING = XorgManVersionString #ifndef UseConfDirForXkb #define UseConfDirForXkb YES #endif -#ifndef CompressAllFonts -#define CompressAllFonts NO -#endif #ifndef ThreadedX #if HasPosixThreads || HasCThreads #define ThreadedX YES /* multi-threaded libraries */ @@ -795,9 +590,6 @@ XORGRELSTRING = XorgManVersionString #ifndef ServerErrorDefines #define ServerErrorDefines /**/ #endif -#ifndef FontCompilerFlags -#define FontCompilerFlags -t -#endif /* * NOTE: IPv6Flags could be tacked on to either ConnectionFlags or * ExtraConnectionDefs. Here, we choose the later in order to @@ -849,12 +641,6 @@ FCHOWN_DEFINES = -DHAS_FCHOWN #ifndef ProjectThreadsDefines #define ProjectThreadsDefines -DXTHREADS #endif -#ifndef FontOSDefines -#define FontOSDefines /**/ -#endif -#ifndef FontDefines -#define FontDefines -DFONT_SNF -DFONT_BDF -DFONT_PCF -DCOMPRESSED_FONTS FontOSDefines -#endif #ifndef XawI18nDefines #if SystemV4 #define XawI18nDefines -DHAS_WCTYPE_H @@ -1627,44 +1413,26 @@ XCOMM X Window System make variables; these need to be coordinated with rules LBXPROXYDIR = LbxproxyDir /* lbxproxy files */ PROXYMANAGERDIR = ProxyManagerDir /* proxy manager config files */ XAPPLOADDIR = XAppLoadDir /* application default resource dir */ - FONTCFLAGS = FontCompilerFlags INSTAPPFLAGS = $(INSTDATFLAGS) /* XXX - this should go away - XXX */ #if UseInstalledX11 RGB = $(XBINDIR)/rgb - FONTC = $(XBINDIR)/bdftopcf - MKFONTSCALE = $(XBINDIR)/mkfontscale - MKFONTDIR = $(XBINDIR)/mkfontdir MKHTMLINDEX = $(XBINDIR)/mkhtmlindex - UCS2ANY = $(XBINDIR)/ProgramTargetName(ucs2any) - BDFTRUNCATE = $(XBINDIR)/bdftruncate - UCSMAPPREFIX = $(FONTDIR)/util/map- XCURSORGEN = $(XBINDIR)/xcursorgen #else RGB = $(CLIENTENVSETUP) $(XBUILDBINDIR)/rgb # if !CrossCompiling - FONTC = $(CLIENTENVSETUP) $(PRELOADFONTSETUP) $(XBUILDBINDIR)/bdftopcf - MKFONTSCALE = $(CLIENTENVSETUP) $(PRELOADFREETYPESETUP) $(XBUILDBINDIR)/mkfontscale - MKFONTDIR = $(MKFONTSCALE) -b -s -l XCURSORGEN = $(CLIENTENVSETUP) $(PRELOADSETUP) $(XBUILDBINDIR)/xcursorgen - UCS2ANY = $(XBUILDBINDIR)/ProgramTargetName(ucs2any) # elif UseInstalledOnCrossCompile - MKFONTDIR = $(XBINDIR)/mkfontdir - MKFONTSCALE = $(XBINDIR)/mkfontscale - FONTC = $(XBINDIR)/bdftopcf XCURSORGEN = $(XBINDIR)/xcursorgen - UCS2ANY = $(XBINDIR)/ucs2any # endif # if HasPerl MKHTMLINDEX = RunPerlScript($(CONFIGSRC)/util/mkhtmlindex.pl,) # else MKHTMLINDEX = $(SHELL) $(CONFIGSRC)/util/mkhtmlindex.sh # endif - BDFTRUNCATE = $(FONTSRC)/util/bdftruncate.pl - UCSMAPPREFIX = $(FONTSRC)/util/map- #endif - HTMLINDEXCMD = HtmlIndexCmd DOCUTILSRC = $(XTOP)/doc/util @@ -1674,8 +1442,6 @@ XCOMM X Window System make variables; these need to be coordinated with rules XIDXMACROS = $(DOCUTILSRC)/indexmacros.t PROGRAMSRC = $(TOP)/programs LIBSRC = $(XTOP)/lib - FONTSRC = $(XTOP)/fonts - ENCODINGSSRC = $(FONTSRC)/encodings INCLUDESRC = BuildIncDir XINCLUDESRC = $(INCLUDESRC)/X11 SERVERSRC = $(XTOP)/programs/Xserver @@ -1683,11 +1449,7 @@ XCOMM X Window System make variables; these need to be coordinated with rules UNSUPPORTEDSRC = UnsupportedDir DOCSRC = $(XTOP)/doc RGBSRC = $(XTOP)/programs/rgb - BDFTOPCFSRC = $(PROGRAMSRC)/bdftopcf - MKFONTDIRSRC = $(PROGRAMSRC)/mkfontdir - FONTINCSRC = $(XTOP)/include/fonts EXTINCSRC = $(XTOP)/include/extensions - FTSOURCEDIR = FreeTypeSrcDir DRMSRCDIR = DRMSrcDir MESASRCDIR = MesaSrcDir OGLSAMPLESRCDIR = OglSampleSrcDir @@ -1740,15 +1502,6 @@ VENDORSUPPORTDEFS = VendorSupportDefines #ifdef PreloadSetup PRELOADSETUP = PreloadSetup #endif -#ifdef PreloadFontSetup - PRELOADFONTSETUP = PreloadFontSetup -#endif -#ifdef PreloadFreetypeSetup - PRELOADFREETYPESETUP = PreloadFreetypeSetup -#endif -#ifdef PreloadXFTSetup - PRELOADXFTSETUP = PreloadXFTSetup -#endif #ifndef ShLibIncludeFile /* need this to make ANSI-style preprocessors happy */ @@ -2663,29 +2416,6 @@ SharedLibReferences(WINDOWSWM,NX_WindowsWM,$(WINDOWSWMLIBSRC),SOWINDOWSWMREV,Sha ProjectUnsharedLibReferences(WINDOWSWM,NX_WindowsWM,$(WINDOWSWMLIBSRC),XBuildLibDir) #endif -# ifndef SharedLibXfontcache -# define SharedLibXfontcache HasSharedLibraries -# endif -# ifndef NormalLibXfontcache -# define NormalLibXfontcache (!SharedLibXfontcache || ForceNormalLib) -# endif -# ifndef DebugLibXfontcache -# define DebugLibXfontcache NO -# endif -# ifndef ProfileLibXfontcache -# define ProfileLibXfontcache NO -# endif - - XFONTCACHELIBSRC = $(LIBSRC)/Xfontcache -#if SharedLibXfontcache -#ifndef SharedXfontcacheRev -#define SharedXfontcacheRev 1.2 -#endif -SharedLibReferences(XFONTCACHE,NX_Xfontcache,$(XFONTCACHELIBSRC),SOXFONTCACHEREV,SharedXfontcacheRev) -#else -ProjectUnsharedLibReferences(XFONTCACHE,NX_Xfontcache,$(XFONTCACHELIBSRC),XBuildLibDir) -#endif - #ifndef SharedLibXau #define SharedLibXau YES #endif @@ -3107,58 +2837,6 @@ SharedLibReferences(FS,NX_FS,$(FSLIBSRC),SOFSREV,SharedFSRev) ProjectUnsharedLibReferences(FS,NX_FS,$(FSLIBSRC),XBuildLibDir) #endif -#ifndef SharedLibFont -#define SharedLibFont HasSharedLibraries -#endif -#ifndef NormalLibFont -#define NormalLibFont (!SharedLibFont | ForceNormalLib | XserverStaticFontLib) -#endif -#ifndef DebugLibFont -#define DebugLibFont NO /* debugged Font library */ -#endif -#ifndef ProfileLibFont -#define ProfileLibFont NO /* profiled Font library */ -#endif - FONTLIBSRC = $(LIBSRC)/font -#if SharedLibFont -#ifndef SharedFontRev -#define SharedFontRev 1.5 -#endif -SharedFontLibReferences() -XCOMM SharedLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC),SOFONTREV,SharedFontRev) -#else -ProjectUnsharedFontLibReferences() -XCOMM ProjectUnsharedLibReferences(XFONT,NX_Xfont,$(FONTLIBSRC),XBuildLibDir) -#endif - - FONTSTUBLIBSRC = $(FONTLIBSRC)/stubs -ProjectUnsharedLibReferences(FONTSTUB,NX_fntstubs,$(FONTSUBLIBSRC),XBuildLibDir) - DEPFONTLIB = $(DEPXFONTLIB) $(DEPFONTSTUBLIB) - FONTLIB = $(XFONTLIB) $(FONTSTUBLIB) $(FREETYPE2LIB) - - -#ifndef SharedLibFontEnc -#define SharedLibFontEnc HasSharedLibraries -#endif -#ifndef NormalLibFontEnc -#define NormalLibFontEnc (!SharedLibFontEnc | ForceNormalLib) -#endif -#ifndef DebugLibFontEnc -#define DebugLibFontEnc NO /* debugged fontenc library */ -#endif -#ifndef ProfileLibFontEnc -#define ProfileLibFontEnc NO /* profiled fontenc library */ -#endif - FONTENCLIBSRC = $(LIBSRC)/fontenc -#if SharedLibFontEnc -#ifndef SharedFontEncRev -#define SharedFontEncRev 1.0 -#endif -SharedLibReferences(XFONTENC,NX_fontenc,$(FONTENCLIBSRC),SOFONTENCREV,SharedFontEncRev) -#else -ProjectUnsharedLibReferences(XFONTENC,NX_fontenc,$(FONTENCLIBSRC),XBuildLibDir) -#endif - #ifndef SharedLibXpm #define SharedLibXpm HasSharedLibraries #endif @@ -3181,121 +2859,6 @@ SharedLibReferences(XPM,Xpm,$(XPMLIBSRC),SOXPMREV,SharedXpmRev) ProjectUnsharedLibReferences(XPM,Xpm,$(XPMLIBSRC),XBuildLibDir) #endif -#if UseFreetype2 - -#if BuildFreetype2Library - -#ifndef SharedLibFreetype2 -#define SharedLibFreetype2 HasSharedLibraries -#endif -#ifndef NormalLibFreetype2 -#define NormalLibFreetype2 (!SharedLibFreetype2 | ForceNormalLib) -#endif -#ifndef DebugLibFreetype2 -#define DebugLibFreetype2 NO -#endif -#ifndef ProfileLibFreetype2 -#define ProfileLibFreetype2 NO -#endif - FREETYPE2LIBSRC = $(LIBSRC)/freetype2 - -/* - * FreeType 2.1.9 - * - * Get the library version information from version_info in - * in xc/extras/freetype2/builds/unix/configure.ac. - * - * current:revision:age = 9:7:3 - * - * The LibtoolMinorVersions revision is "(current - age).age". - * The !LibtoolMinorVersions revision is "current.0". - * Freetype2Version should be set to "current.revision.age" - */ -#ifndef Freetype2Version -#define Freetype2Version 9.7.3 -#endif - -#if SharedLibFreetype2 -#ifndef SharedLibtoolFreetype2Rev -#define SharedLibtoolFreetype2Rev 9:7:3 -#endif -#ifndef SharedFreetype2Rev -#if LibtoolMinorVersions -#define SharedFreetype2Rev 6.3.8 -#else -#define SharedFreetype2Rev 9.0 -#endif -#endif -SharedLibReferences(FREETYPE2,NX_freetype,$(FREETYPE2LIBSRC),SOFREETYPE2REV,SharedFreetype2Rev) -#else -ProjectUnsharedLibReferences(FREETYPE2,NX_freetype,$(FREETYPE2LIBSRC),XBuildLibDir) -#endif - -#ifdef UseInstalled -FREETYPE2INCDIR=$(INCDIR) -#else -FREETYPE2INCDIR=$(BUILDINCDIR) -#endif - -#else /* BuildFreetype2Library */ - -#if HasFreetype2 - -#ifndef Freetype2Dir -#define Freetype2Dir /usr -#ifndef Freetype2DirStandard -# define Freetype2DirStandard YES -#endif -#endif -#ifndef Freetype2DirStandard -#define Freetype2DirStandard NO -#endif - -#ifndef Freetype2LibDir -#define Freetype2LibDir Freetype2Dir/LibDirName -# if Freetype2DirStandard -# define Freetype2LibDirStandard YES -# endif -#endif -#ifndef Freetype2LibDirStandard -# define Freetype2LibDirStandard NO -#endif - -#ifndef Freetype2IncDir -#define Freetype2IncDir Freetype2Dir/include -# if Freetype2DirStandard -# define Freetype2IncDirStandard YES -# endif -#endif - -FREETYPE2DIR = Freetype2Dir -FREETYPE2LIBDIR = Freetype2LibDir -FREETYPE2INCDIR = Freetype2IncDir -#if Freetype2LibDirStandard -FREETYPE2LIB = -lfreetype -#else -FREETYPE2LIB = -L$(FREETYPE2LIBDIR) LinkerRuntimeLibraryPathFlag($(FREETYPE2LIBDIR)) -lfreetype -#endif - -#endif /* HasFreetype2 */ - -#endif /* else BuildFreetype2Library */ - -#ifndef Freetype2IncDirStandard -# define Freetype2IncDirStandard NO -#endif - -#if BuildFreetype2Library || HasFreetype2 -#if Freetype2IncDirStandard -FREETYPE2INCLUDES = -I$(FREETYPE2INCDIR)/freetype2 -I$(FREETYPE2INCDIR)/freetype2/config -#else -FREETYPE2INCLUDES = -I$(FREETYPE2INCDIR) -I$(FREETYPE2INCDIR)/freetype2 -I$(FREETYPE2INCDIR)/freetype2/config -#endif -FREETYPE2DEFINES = -DFREETYPE2 -#endif - -#endif /* UseFreetype2 */ - #if HasMotif #ifndef MotifDir @@ -3448,188 +3011,6 @@ EXPATDEFINES = -DEXPAT #endif /* UseExpat */ -#ifndef SharedLibXft1 -#define SharedLibXft1 HasSharedLibraries -#endif -#ifndef NormalLibXft1 -#define NormalLibXft1 NO -#endif -#ifndef DebugLibXft1 -#define DebugLibXft1 NO -#endif -#ifndef ProfileLibXft1 -#define ProfileLibXft1 NO -#endif - XFT1LIBSRC = $(LIBSRC)/Xft1 -#if SharedLibXft1 -#ifndef SharedXft1Rev -#define SharedXft1Rev 1.1 -#endif -SharedLibReferences(XFT1,NX_Xft,$(XFT1LIBSRC),SOXFT1REV,SharedXft1Rev) -#else -ProjectUnsharedLibReferences(XFT1,NX_Xft,$(XFT1LIBSRC),XBuildLibDir) -#endif - -#ifndef Xft1ClientDepLibs -#if UseFreetype2 -#define Xft1ClientDepLibs $(DEPXFT1LIB) $(DEPFREETYPE2LIB) $(DEPXRENDERLIB) -#else -#define Xft1ClientDepLibs $(DEPXFT1LIB) $(DEPXRENDERLIB) -#endif -#endif -#ifndef Xft1ClientLibs -#if UseFreetype2 -#define Xft1ClientLibs $(XFT1LIB) $(FREETYPE2LIB) $(XRENDERLIB) -#else -#define Xft1ClientLibs $(XFT1LIB) $(XRENDERLIB) -#endif -#endif - -#ifndef SharedLibXft -#define SharedLibXft HasSharedLibraries -#endif -#ifndef NormalLibXft -#define NormalLibXft (!SharedLibXft | ForceNormalLib) -#endif -#ifndef DebugLibXft -#define DebugLibXft NO -#endif -#ifndef ProfileLibXft -#define ProfileLibXft NO -#endif - XFTLIBSRC = $(LIBSRC)/Xft -#if SharedLibXft -#ifndef SharedXftRev -#define SharedXftRev 2.1.2 -#endif -SharedLibReferences(XFT,NX_Xft,$(XFTLIBSRC),SOXFTREV,SharedXftRev) -#else -ProjectUnsharedLibReferences(XFT,NX_Xft,$(XFTLIBSRC),XBuildLibDir) -#endif - -#ifndef XftClientDepLibs -#define XftClientDepLibs $(DEPXFTLIB) FontconfigClientDepLibs $(DEPXRENDERLIB) -#endif -#ifndef XftClientLibs -#define XftClientLibs $(XFTLIB) FontconfigClientLibs $(XRENDERLIB) -#endif - -#if UseFontconfig - -#if BuildFontconfigLibrary - -#ifndef SharedLibFontconfig -#define SharedLibFontconfig HasSharedLibraries -#endif -#ifndef NormalLibFontconfig -#define NormalLibFontconfig (!SharedLibFontconfig | ForceNormalLib) -#endif -#ifndef DebugLibFontconfig -#define DebugLibFontconfig NO -#endif -#ifndef ProfileLibFontconfig -#define ProfileLibFontconfig NO -#endif - FONTCONFIGLIBSRC = $(LIBSRC)/fontconfig -#if SharedLibFontconfig -#ifndef SharedFontconfigRev -#define SharedFontconfigRev 1.0.4 -#endif -SharedLibReferences(FONTCONFIG,NX_fontconfig,$(FONTCONFIGLIBSRC),SOFONTCONFIGREV,SharedFontconfigRev) -#else -ProjectUnsharedLibReferences(FONTCONFIG,NX_fontconfig,$(FONTCONFIGLIBSRC),XBuildLibDir) -#endif - -#ifdef UseInstalled -FONTCONFIGINCDIR=$(INCDIR) -#else -FONTCONFIGINCDIR=$(BUILDINCDIR) -#endif - -FONTCONFIGINCLUDES = -I$(FONTCONFIGINCDIR) - -#if UseInstalledX11 -FCCACHE = $(BINDIR)/fc-cache -#else -FCCACHE = set -x; $(CLIENTENVSETUP) $(PRELOADXFTSETUP) FONTCONFIG_PATH=$(FONTCONFIGLIBSRC) $(XBUILDBINDIR)/fc-cache -#endif - -#else /* BuildFontconfigLibrary */ - -#if HasFontconfig - -#ifndef FontconfigDir -# define FontconfigDir /usr -# ifndef FontconfigDirStandard -# define FontconfigDirStandard YES -# endif -#endif - -#ifndef FontconfigDirStandard -# define FontconfigDirStandard NO -#endif - -#ifndef FontconfigLibDir -# define FontconfigLibDir FontconfigDir/LibDirName -# if FontconfigDirStandard -# define FontconfigLibDirStandard YES -# endif -#endif -#ifndef FontconfigLibDirStandard -# define FontconfigLibDirStandard NO -#endif - -#ifndef FontconfigBinDir -# define FontconfigBinDir FontconfigDir/bin -#endif - -#ifndef FontconfigIncDir -# define FontconfigIncDir FontconfigDir/include -# if FontconfigDirStandard -# define FontconfigIncDirStandard YES -# endif -#endif - -#ifndef FontconfigIncDirStandard -# define FontconfigIncDirStandard NO -#endif - -FONTCONFIGDIR = FontconfigDir -FONTCONFIGLIBDIR = FontconfigLibDir -FONTCONFIGINCDIR = FontconfigIncDir -FONTCONFIGBINDIR = FontconfigBinDir -#if FontconfigLibDirStandard -FONTCONFIGLIB = -lfontconfig -#else -FONTCONFIGLIB = -L$(FONTCONFIGLIBDIR) LinkerRuntimeLibraryPathFlag($(FONTCONFIGLIBDIR)) -lfontconfig -#endif - -#if FontconfigIncDirStandard -FONTCONFIGINCLUDES = -#else -FONTCONFIGINCLUDES = -I$(FONTCONFIGINCDIR) -#endif - -FCCACHE = $(FONTCONFIGBINDIR)/fc-cache - -#endif /* HasFontconfig */ - -#endif /* else BuildFontconfigLibrary */ - -#if BuildFontconfigLibrary || HasFontconfig -FONTCONFIGDEFINES = -DFONTCONFIG -#endif - -#ifndef FontconfigClientDepLibs -#define FontconfigClientDepLibs $(DEPFONTCONFIGLIB) $(DEPFREETYPE2LIB) ExpatClientDepLibs -#endif -#ifndef FontconfigClientLibs -#define FontconfigClientLibs $(FONTCONFIGLIB) $(FREETYPE2LIB) ExpatClientLibs -#endif - -#endif /* UseFontconfig */ - -XFTINCLUDES=$(FONTCONFIGINCLUDES) $(FREETYPE2INCLUDES) #ifdef HasLibpng @@ -3951,383 +3332,6 @@ InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class #endif /* UseConfDirForAppDefaults */ #endif /* InstallAppDefaultsLong */ -/* - * MakeFcCache - generate rules to build fontconfig cache database - */ - -#if defined UseFreetype2 && !CrossCompiling - -# ifndef MakeFcCache -# define MakeFcCache(deplist) @@\ -all:: fonts.cache @@\ - @@\ -fonts.cache: deplist @@\ - RunProgram(FCCACHE, $(FCCACHEOPTS) .) @@\ - @@\ -clean:: @@\ - RemoveFiles(fonts.cache*) -# endif /* MakeFcCache */ - -# ifndef InstallFcCache -# define InstallFcCache(dest) @@\ -install:: @@\ - RunProgram(FCCACHE, $(FCCACHEOPTS) $(DESTDIR)dest) -# endif /* InstallFcCache */ - -#else - -#ifndef MakeFcCache -#define MakeFcCache(deplist) -#endif - -#ifndef InstallFcCache -#define InstallFcCache(dest) -#endif - -#endif - -/* - * MakeFontsScale - generate rules to build fonts.scale database. - */ -#ifndef MakeFontsScale -# if !CrossCompiling || UseInstalledOnCrossCompile -# define MakeFontsScale(deplist) @@\ -all:: fonts.scale @@\ - @@\ -fonts.scale: deplist @@\ - RemoveFile(fonts.scale) @@\ - RunProgram(MKFONTSCALE, .) @@\ - @@\ -clean:: @@\ - RemoveFile(fonts.scale) -# else -# define MakeFontsScale(deplist) @@\ -clean:: @@\ - RemoveFile(fonts.scale) -# endif -#endif /* MakeFontsScale */ - -/* - * MakeFontsDir - generate rules to build fonts.dir database. - */ -#ifndef MakeFontsDir -# if !CrossCompiling || UseInstalledOnCrossCompile -# define MakeFontsDir(deplist) @@\ -all:: fonts.dir @@\ - @@\ -fonts.dir: deplist @@\ - RemoveFile(fonts.dir) @@\ - RunProgram(MKFONTDIR, $(MKFONTDIROPTS) .) @@\ - @@\ -clean:: @@\ - RemoveFile(fonts.dir) -# else -# define MakeFontsDir(deplist) @@\ -clean:: @@\ - RemoveFile(fonts.dir) -# endif -#endif /* MakeFontsDir */ - - -/* - * MakeFonts - generate rules to build font database. - */ -#ifndef MakeFonts -# if !CrossCompiling || UseInstalledOnCrossCompile -# define MakeFonts() @@\ -all:: $(OBJS) @@\ - @@\ -MakeFontsDir($(OBJS)) @@\ - @@\ -clean:: @@\ - RemoveFiles(*.pcf *.pcf.Z *.pcf.gz) -# else -# define MakeFonts() @@\ -MakeFontsDir($(OBJS)) @@\ - @@\ -clean:: @@\ - RemoveFiles(*.pcf *.pcf.Z *.pcf.gz) -# endif -#endif /* MakeFonts */ - -#ifndef InstallFontsDir -# if !CrossCompiling || UseInstalledOnCrossCompile -# define InstallFontsDir(dest) @@\ -install:: @@\ - MakeDir($(DESTDIR)dest) @@\ - @if [ X$(STATIC_FONTS_SCALE) = X ]; then (set -x; \ @@\ - RemoveFile($(DESTDIR)dest/fonts.scale); \ @@\ - RunProgram(MKFONTSCALE, $(DESTDIR)dest)); \ @@\ - else (set -x; \ @@\ - InstallInline(fonts.scale,$(INSTDATFLAGS),dest)); \ @@\ - fi @@\ - RemoveFile($(DESTDIR)dest/fonts.dir) @@\ - RunProgram(MKFONTDIR, $(MKFONTDIROPTS) $(DESTDIR)dest) -# else -# define InstallFontsDir(dest) -# endif -#endif - -/* - * InstallFontObjs - generate rules to install font files - */ -#ifndef InstallFontObjs -# if !CrossCompiling || UseInstalledOnCrossCompile -# define InstallFontObjs(objs,dest) @@\ -InstallMultipleFlags(objs,dest,$(INSTDATFLAGS)) @@\ - @@\ -InstallFontsDir(dest) -# else -# define InstallFontObjs(objs,dest) -# endif -#endif /* InstallFontObjs */ - - -/* - * InstallFonts - generate rules to install font files - */ -#ifndef InstallFonts -#define InstallFonts(dest) @@\ -InstallFontObjs($(OBJS),dest) -#endif /* InstallFonts */ - - -/* - * InstallFontAliases - generate rules to install font aliases databases. - */ -#ifndef InstallFontAliases -#define InstallFontAliases(dest) @@\ -InstallTarget(install,fonts.alias,$(INSTDATFLAGS),dest) -#endif /* InstallFontAliases */ - -#ifndef InstallNamedFontAliases -#define InstallNamedFontAliases(src,dest) @@\ -InstallNamedTarget(install,src,$(INSTDATFLAGS),dest,fonts.alias) -#endif /* InstallNamedFontAliases */ - -#ifndef FontSrc -#define FontSrc(basename) basename.bdf -#endif - -#ifndef FontBaseObj -#define FontBaseObj(basename)basename.pcf -#endif - -/* - * InstallFontScale - generate rules to install font scale database. - */ -#ifndef InstallFontScale -#define InstallFontScale(dest) @@\ -InstallTarget(install,fonts.scale,$(INSTDATFLAGS),dest) -#endif /* InstallFontScale */ - -/* - * UncompressedFontTargetLong - */ -#if ! CrossCompiling || UseInstalledOnCrossCompile -# ifndef UncompressedFontTargetLong -# define UncompressedFontTargetLong(sname,tname) @@\ -FontBaseObj(tname): FontSrc(sname) @@\ - RunProgram(FONTC,$(FONTCFLAGS) $? -o $@) -# endif /* UncompressedFontTargetLong */ -#else -# ifndef UncompressedFontTargetLong -# define UncompressedFontTargetLong(sname,tname) -# endif -#endif - -/* - * CompressedFontTarget - */ -#ifndef GzipFontCompression -#define GzipFontCompression NO -#endif - -#if ! CrossCompiling || UseInstalledOnCrossCompile -# ifndef CompressedFontTargetLong -# if GzipFontCompression -# define CompressedFontTargetLong(sname,tname) @@\ -FontBaseObj(tname).gz: FontSrc(sname) @@\ - RunProgram(FONTC,$(FONTCFLAGS) $?) | $(GZIPCMD) > $@ -# else -# define CompressedFontTargetLong(sname,tname) @@\ -FontBaseObj(tname).Z: FontSrc(sname) @@\ - RunProgram(FONTC,$(FONTCFLAGS) $?) | $(COMPRESS) > $@ -# endif -# endif /* CompressedFontTargetLong */ -#else -# define CompressedFontTargetLong(sname,tname) -#endif - -/* - * UncompressedFontTarget - */ -#ifndef UncompressedFontTarget -#define UncompressedFontTarget(basename) UncompressedFontTargetLong(basename,basename) -#endif /* UncompressedFontTarget */ - -#ifndef CompressedFontTarget -#define CompressedFontTarget(basename) CompressedFontTargetLong(basename,basename) -#endif /* CompressedFontTarget */ - -#if !defined(FontTarget) && !defined(FontObj) -#if CompressAllFonts -#define FontTargetLong(sname,tname) CompressedFontTargetLong(sname,tname) -#define FontTarget(basename) CompressedFontTarget(basename) -#if GzipFontCompression -#define FontObj(basename) FontBaseObj(basename).gz -#else -#define FontObj(basename) FontBaseObj(basename).Z -#endif -#else -#define FontTargetLong(sname,tname) UncompressedFontTargetLong(sname,tname) -#define FontTarget(basename) UncompressedFontTarget(basename) -#define FontObj(basename) FontBaseObj(basename) -#endif /* CompressAllFonts */ -#endif - - -#ifndef EncObj -#define EncObj(basename) basename.enc -#endif -#ifndef EncObjComp -#if GzipFontCompression -#define EncObjComp(basename) basename.enc.gz -#else -#define EncObjComp(basename) basename.enc.Z -#endif -#endif - -#ifndef EncodingTarget -#define EncodingTarget(basename) /**/ -#endif - -#ifndef CompEncodingTarget -#if GzipFontCompression -#define CompEncodingTarget(basename) @@\ -EncObjComp(basename): EncObj(basename) @@\ - cat $? | $(GZIPCMD) > $@ -#else -#define CompEncodingTarget(basename) @@\ -EncObjComp(basename): EncObj(basename) @@\ - cat $? | $(COMPRESS) > $@ -#endif -#endif - -#ifndef MakeEncDir -# if !CrossCompiling || UseInstalledOnCrossCompile -# define MakeEncDir(deplist,inst,dirlist ) @@\ -AllTarget(encodings.dir) @@\ - @@\ -encodings.dir: deplist @@\ - RemoveFiles(encodings.dir fonts.dir) @@\ - @(E=; for i in dirlist; do \ @@\ - E="$$E -e $$i"; done; \ @@\ - set -x; \ @@\ - RunProgram(MKFONTDIR, -n -r -p inst/ $$E .)) @@\ - @@\ -clean:: @@\ - RemoveFiles(fonts.dir encodings.dir) -# else -# define MakeEncDir(deplist,inst,dirlist ) @@\ -clean:: @@\ - RemoveFiles(fonts.dir encodings.dir) -# endif -#endif - -#ifndef MakeEncodings -#define MakeEncodings(deplist,inst,dirlist) @@\ - @@\ -MakeEncDir(deplist $(OBJS),inst,dirlist) @@\ - @@\ -clean:: @@\ - RemoveFiles(*.enc.Z *.enc.gz) -#endif /* MakeEncodings */ - -#ifndef InstallEncObjs -# if !CrossCompiling || UseInstalledOnCrossCompile -# define InstallEncObjs(objs,dest) @@\ -InstallMultipleFlags(objs,dest,$(INSTDATFLAGS)) @@\ - @@\ -InstallTarget(install,encodings.dir,$(INSTDATFLAGS),dest) -# else -# define InstallEncObjs(objs,dest) -# endif -#endif /* InstallEncObjs */ - -#ifndef InstallEncodings -#define InstallEncodings(dest) @@\ -InstallEncObjs($(OBJS),dest) -#endif /* InstallEncodings */ - -#ifndef InstallEncodingsDir -# if !CrossCompiling || UseInstalledOnCrossCompile -# define InstallEncodingsDir(edir,fdir) @@\ -InstallNamedTarget(install,edir/encodings.dir,$(INSTDATFLAGS),fdir,encodings.dir) -# else -# define InstallEncodingsDir(edir,fdir) -# endif -#endif - - -#ifndef MakeBdfFontFromUCSMaster -#define MakeBdfFontFromUCSMaster(font,enc) @@\ -font-enc.bdf: font.bdf $(UCS2ANY) @@\ - RemoveFile($@) @@\ - $(UCS2ANY) font.bdf $(UCSMAPPREFIX)enc enc @@\ - @@\ -clean:: @@\ - RemoveFile(font-enc.bdf) -#endif - -#ifndef MakeTruncatedUCSBdfFont -#if HasPerl5 -#define MakeTruncatedUCSBdfFont(font,trunc,name) @@\ -name.bdf: font.bdf $(BDFTRUNCATE) @@\ - RemoveFile($@) @@\ - RunPerlScript($(BDFTRUNCATE),trunc < font.bdf > name.bdf) @@\ - @@\ -clean:: @@\ - RemoveFile(name.bdf) -#endif -#endif - -/* - * InstallXpPMFLink - install link for a Xprint PMF "font" from one - * print model to another - */ -#ifndef InstallXpPMFLink -#define InstallXpPMFLink(fontfilename,srcmodelfontdir,destmodelfontdir) @@\ - InstallLink(install,srcmodelfontdir/fontfilename,fontfilename,destmodelfontdir) -#endif /* InstallXpPMFLink */ -/* - * InstallXpMultiplePMFLinks - install multiple links for PMF fonts - * from one print model to another - */ -#ifndef InstallXpMultiplePMFLinks -#define InstallXpMultiplePMFLinks(list,srcmodelfontdir,destmodelfontdir) @@\ -install:: @@\ - MakeDir($(DESTDIR)destmodelfontdir) @@\ - for i in list ; do \ @@\ - $(RM) $(DESTDIR)destmodelfontdir/$$i ; \ @@\ - $(LN) -s -f srcmodelfontdir/$$i $(DESTDIR)destmodelfontdir/$$i ; \ @@\ - done -#endif /* InstallXpPMFLink */ - -/* - * InstallXpPMFFontsDir - make and install a fonts.dir index for model-config fonts - */ -#ifndef InstallXpPMFFontsDir -#if BuildServersOnly -#define InstallXpPMFFontsDir(destmodelfontdir) /**/ -#else -#define InstallXpPMFFontsDir(destmodelfontdir) @@\ -install:: @@\ - ($(MKFONTSCALE) -b -s -l $(DESTDIR)destmodelfontdir) -#endif -#endif /* InstallXpPMFFontsDir */ - - /* * MakeXkbDir */ @@ -4647,42 +3651,6 @@ clean:: @@\ InstallDoc(name,deps) #endif -/* - * Rule for maintainers to use to updated generated copies of fonts in the - * source tree. Use with care. - */ - -#ifndef UpdateDerivedFont -#define UpdateDerivedFont(src,dst) @@\ -update.fonts:: src @@\ - -@if [ -f dst ]; then \ @@\ - if [ "$(FORCEUPDATE)" = yes ]; then \ @@\ - if [ "$(FOLLOWLINK)" = no ]; then \ @@\ - (set -x; $(RM) dst); \ @@\ - fi; \ @@\ - set -x; cp src dst; \ @@\ - else \ @@\ - grep -v "XFree86:" src > __tmp1__; \ @@\ - grep -v "XFree86:" dst > __tmp2__; \ @@\ - if diff __tmp1__ __tmp2__ > /dev/null 2>&1; then :; \ @@\ - else \ @@\ - if [ "$(FOLLOWLINK)" = no ]; then \ @@\ - (set -x; $(RM) dst); \ @@\ - fi; \ @@\ - set -x; cp src dst; \ @@\ - fi; \ @@\ - fi; \ @@\ - fi @@\ - @$(RM) __tmp1__ __tmp2__ -#endif - -#if !HasFreetype2 - FT2PRELOADPATTERN = libfreetype.so.? -#endif -#if !HasFontconfig - FCPRELOADPATTERN = libfontconfig.so.? -#endif - XFTPRELOADPATTERN = libXft.so.? XRENDERPRELOADPATTERN = libXrender.so.? XFONTPRELOADPATTERN = libXfont*.so.? diff --git a/nx-X11/config/cf/host.def b/nx-X11/config/cf/host.def index 58b3df923..76318b4f8 100644 --- a/nx-X11/config/cf/host.def +++ b/nx-X11/config/cf/host.def @@ -91,9 +91,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #ifdef NXAgentServer #define BuildRenderLibrary YES -#define SharedLibFreetype2 YES -#define NormalLibFreetype2 YES -#define FontLibSharedFreeType YES #endif /* @@ -240,101 +237,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define BuildMatroxHal YES */ -/* - * Speedo fonts have been disabled by default in this release. - * To re-enable support for Speedo fonts, uncomment this. - * -#define BuildSpeedo YES - */ - -/* - * To disable support for CID fonts, uncomment this. - * -#define BuildCID NO - */ - -/* - * To disable support for TrueType fonts, uncomment these. - * -#define BuildFreeType NO - */ -#define BuildFreeType NO - -/* - * To set non-default build options for the underlying FreeType libraries, - * add them here and uncomment. - * -#define Freetype2BuildDefines -DFREETYPE_BUILD_DEFINES - */ - -/* - * To build the FreeType libraries with the TrueType byte code interpreter - * enabled, uncomment this. Note that there are patent issues related to the - * TrueType byte code interpreter, and we only recommend you enabling this - * if you are sure that there are no legal impediments to you doing so. See - * for further information. - * -#define Freetype2BuildDefines -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER - */ - -/* - * Do you want to Build Fonts (Usually you only want to build and install - * fonts once, if this is a first time install you will want to build the - * fonts) - * -#define BuildFonts NO - */ -#define BuildFonts NO - -/* - * To not build/install the 75dpi fonts, uncomment the following - * -#define Build75DpiFonts NO - */ - -/* - * To not build/install the 100dpi fonts, uncomment the following - * -#define Build100DpiFonts NO - */ - -/* - * To build/install the Speedo fonts, uncomment the following - * (see setting above about Speedo support as well) - * -#define BuildSpeedoFonts YES - */ - -/* - * To not build/install the Type1 fonts, uncomment the following - * -#define BuildType1Fonts NO - */ - -/* - * To not build/install the CID fonts, uncomment the following - * -#define BuildCIDFonts NO - */ - -/* - * To not build/install the True Type fonts, uncomment the following - * -#define BuildTrueTypeFonts NO - */ - -/* - * To not build/install the Cyrillic fonts, uncomment the following - * -#define BuildCyrillicFonts NO - */ - -/* - * To not install the local font directory, uncomment the following - * -#define MakeLocalFontDir NO - */ - /* * Include True Type Fonts to default font path. It is safe to do * this by default as NX intaller carries only misc and TTF in the @@ -368,7 +270,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ * #define InstallXinitConfig YES #define InstallXdmConfig YES -#define InstallFSConfig YES */ /* @@ -591,21 +492,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define XFree86ConsoleDefines -DSYSCONS_SUPPORT -DPCVT_SUPPORT */ -/* - * To link the X server with a dynamic version of the Xfont library, - * uncomment this. - * -#define XserverStaticFontLib NO - */ -#define XserverStaticFontLib YES - -/* - * To enable binary compatibility with previous versions of the font - * encoding support, uncomment this. - * -#define FontencCompatibility YES - */ - /* * To disable building XInput support, uncomment this * @@ -834,38 +720,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define X86EMU_LIBPATH /usr/local/lib */ -/* - * Most platforms default to using an already installed FreeType 2 library. - * To use the one included in this release instead, uncomment the following. - * -#define HasFreetype2 NO - */ -#define HasFreetype2 YES - -/* - * To use a FreeType library already installed outside the default search - * paths, uncomment the following and set the path as needed. - * -#define HasFreetype2 YES -#define Freetype2Dir /usr/local - */ - - -/* - * Most platforms default to using an already installed Fontconfig library. - * To use the one included in this release instead, uncomment the following. - * -#define HasFontconfig NO - */ -#define HasFontconfig YES - -/* - * To use a Fontconfig library already installed outside the default search - * paths, uncomment the following and set the path as needed. -#define HasFontconfig YES -#define FontconfigDir /usr/local - */ - /* * Most platforms default to using an already installed Expat library. @@ -912,9 +766,5 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define BuildXaw7 NO #define BuildRman NO -#define BuildFontEncLib NO #define BuildXcursorLibrary NO -#define BuildXftLibrary NO -#define BuildXft1Library NO -#define SharedLibFont NO #define BuildLoadableXlibI18n NO diff --git a/nx-X11/config/cf/linux.cf b/nx-X11/config/cf/linux.cf index 32b7a8658..fa18feb4e 100644 --- a/nx-X11/config/cf/linux.cf +++ b/nx-X11/config/cf/linux.cf @@ -116,7 +116,6 @@ InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class # define SharedLibXdmGreet NO # define LinkGLToUsrInclude NO # define LinkGLToUsrLib NO -# define SharedLibFont NO # define SharedLibGlu YES # define NormalLibGlu YES # define FSUseSyslog YES @@ -156,9 +155,6 @@ InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class # define BuildRman NO # define BuildHtmlManPages NO -/* we build-depend on libfreetype6-dev (FreeType 2.x) */ -# define BuildFreetype2Library NO -# define HasFreetype2 YES /* m68k has no 2.4 kernel yet */ # ifndef Mc68020Architecture # define HasLinuxInput YES @@ -539,10 +535,6 @@ InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class # define HasExpat YES #endif -#ifndef HasFreetype2 -# define HasFreetype2 YES -#endif - #define AvoidNullMakeCommand YES #ifndef DebuggableLibraries #define DebuggableLibraries NO diff --git a/nx-X11/config/cf/xf86site.def b/nx-X11/config/cf/xf86site.def index 39d8980b6..3f48cd124 100644 --- a/nx-X11/config/cf/xf86site.def +++ b/nx-X11/config/cf/xf86site.def @@ -138,103 +138,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define BuildMatroxHal YES */ -/* - * To disable support for Speedo fonts, uncomment this. - * -#define BuildSpeedo NO - */ - -/* - * To disable support for Type1 fonts, uncomment this. - * -#define BuildType1 NO - */ - -/* - * To disable support for CID fonts, uncomment this. - * -#define BuildCID NO - */ - -/* - * To disable support for TrueType fonts, uncomment these. - * -#define BuildFreeType NO - */ - -/* - * To set non-default build options for the underlying FreeType libraries, - * add them here and uncomment. - * -#define Freetype2BuildDefines -DFREETYPE_BUILD_DEFINES - */ - -/* - * To build the FreeType libraries with the TrueType byte code interpreter - * enabled, uncomment this. Note that there are patent issues related to the - * TrueType byte code interpreter, and we only recommend you enabling this - * if you are sure that there are no legal impediments to you doing so. See - * for further information. - * -#define Freetype2BuildDefines -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER - */ - -/* - * Do you want to Build Fonts (Usually you only want to build and install - * fonts once, if this is a first time install you will want to build the - * fonts) - * -#define BuildFonts NO - */ - -/* - * To not build/install the 75dpi fonts, uncomment the following - * -#define Build75DpiFonts NO - */ - -/* - * To not build/install the 100dpi fonts, uncomment the following - * -#define Build100DpiFonts NO - */ - -/* - * To not build/install the Speedo fonts, uncomment the following - * -#define BuildSpeedoFonts NO - */ - -/* - * To not build/install the Type1 fonts, uncomment the following - * -#define BuildType1Fonts NO - */ - -/* - * To not build/install the CID fonts, uncomment the following - * -#define BuildCIDFonts NO - */ - -/* - * To not build/install the True Type fonts, uncomment the following - * -#define BuildTrueTypeFonts NO - */ - -/* - * To not build/install the Cyrillic fonts, uncomment the following - * -#define BuildCyrillicFonts NO - */ - -/* - * To not install the local font directory, uncomment the following - * -#define MakeLocalFontDir NO - */ - /* * To build only the servers with a cut-down source tree, uncomment * this. @@ -455,20 +358,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define XFree86ConsoleDefines -DSYSCONS_SUPPORT -DPCVT_SUPPORT */ -/* - * To link the X server with a dynamic version of the Xfont library, - * uncomment this. - * -#define XserverStaticFontLib NO - */ - -/* - * To enable binary compatibility with previous versions of the font - * encoding support, uncomment this. - * -#define FontencCompatibility YES - */ - /* * To disable building XInput support, uncomment this * diff --git a/nx-X11/config/cf/xfree86.cf b/nx-X11/config/cf/xfree86.cf index 0348c0302..41790c019 100644 --- a/nx-X11/config/cf/xfree86.cf +++ b/nx-X11/config/cf/xfree86.cf @@ -1683,50 +1683,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 # define HasMTRRSupport NO #endif -/* - * Include fonts support - */ -#ifndef BuildSpeedo -# define BuildSpeedo NO -#endif - -#ifndef BuildType1 -# define BuildType1 NO -#endif - -#ifndef BuildCID -# define BuildCID YES -#endif - -#ifndef BuildFreeType -# define BuildFreeType YES -#endif - -/* - * By default, build all of the fonts. - */ -#ifndef Build75DpiFonts -# define Build75DpiFonts YES -#endif -#ifndef Build100DpiFonts -# define Build100DpiFonts YES -#endif -#ifndef BuildSpeedoFonts -# define BuildSpeedoFonts NO -#endif -#ifndef BuildType1Fonts -# define BuildType1Fonts YES -#endif -#ifndef BuildCIDFonts -# define BuildCIDFonts YES -#endif -#ifndef BuildTrueTypeFonts -# define BuildTrueTypeFonts YES -#endif -#ifndef BuildCyrillicFonts -# define BuildCyrillicFonts YES -#endif - /* * Build scanpci? */ @@ -1748,14 +1704,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 # endif #endif -#ifndef CompressAllFonts -# define CompressAllFonts YES -#endif - -#ifndef GzipFontCompression -# define GzipFontCompression YES -#endif - /* Disable stripping installed programs for this release. */ #ifndef StripInstalledPrograms # define StripInstalledPrograms NO diff --git a/nx-X11/config/cf/xorg.cf b/nx-X11/config/cf/xorg.cf index 3f922359e..9fb2f6589 100644 --- a/nx-X11/config/cf/xorg.cf +++ b/nx-X11/config/cf/xorg.cf @@ -1247,50 +1247,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 # define HasMTRRSupport NO #endif -/* - * Include fonts support - */ -#ifndef BuildSpeedo -# define BuildSpeedo NO -#endif - -#ifndef BuildType1 -# define BuildType1 NO -#endif - -#ifndef BuildCID -# define BuildCID YES -#endif - -#ifndef BuildFreeType -# define BuildFreeType YES -#endif - -/* - * By default, build all of the fonts. - */ -#ifndef Build75DpiFonts -# define Build75DpiFonts YES -#endif -#ifndef Build100DpiFonts -# define Build100DpiFonts YES -#endif -#ifndef BuildSpeedoFonts -# define BuildSpeedoFonts NO -#endif -#ifndef BuildType1Fonts -# define BuildType1Fonts YES -#endif -#ifndef BuildCIDFonts -# define BuildCIDFonts YES -#endif -#ifndef BuildTrueTypeFonts -# define BuildTrueTypeFonts YES -#endif -#ifndef BuildCyrillicFonts -# define BuildCyrillicFonts YES -#endif - /* * Build scanpci? */ @@ -1312,14 +1268,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 # endif #endif -#ifndef CompressAllFonts -# define CompressAllFonts YES -#endif - -#ifndef GzipFontCompression -# define GzipFontCompression YES -#endif - /* Disable stripping installed programs for this release. */ #ifndef StripInstalledPrograms # define StripInstalledPrograms NO diff --git a/nx-X11/config/cf/xorgsite.def b/nx-X11/config/cf/xorgsite.def index eeaffa496..eca20fab4 100644 --- a/nx-X11/config/cf/xorgsite.def +++ b/nx-X11/config/cf/xorgsite.def @@ -152,99 +152,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define BuildMatroxHal YES */ -/* - * Speedo fonts have been disabled by default in this release. - * To re-enable support for Speedo fonts, uncomment this. - * -#define BuildSpeedo YES - */ - -/* - * To disable support for CID fonts, uncomment this. - * -#define BuildCID NO - */ - -/* - * To disable support for TrueType fonts, uncomment these. - * -#define BuildFreeType NO - */ - -/* - * To set non-default build options for the underlying FreeType libraries, - * add them here and uncomment. - * -#define Freetype2BuildDefines -DFREETYPE_BUILD_DEFINES - */ - -/* - * To build the FreeType libraries with the TrueType byte code interpreter - * enabled, uncomment this. Note that there are patent issues related to the - * TrueType byte code interpreter, and we only recommend you enabling this - * if you are sure that there are no legal impediments to you doing so. See - * for further information. - * -#define Freetype2BuildDefines -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER - */ - -/* - * Do you want to Build Fonts (Usually you only want to build and install - * fonts once, if this is a first time install you will want to build the - * fonts) - * -#define BuildFonts NO - */ - -/* - * To not build/install the 75dpi fonts, uncomment the following - * -#define Build75DpiFonts NO - */ - -/* - * To not build/install the 100dpi fonts, uncomment the following - * -#define Build100DpiFonts NO - */ - -/* - * To build/install the Speedo fonts, uncomment the following - * (see setting above about Speedo support as well) - * -#define BuildSpeedoFonts YES - */ - -/* - * To not build/install the Type1 fonts, uncomment the following - * -#define BuildType1Fonts NO - */ - -/* - * To not build/install the CID fonts, uncomment the following - * -#define BuildCIDFonts NO - */ - -/* - * To not build/install the True Type fonts, uncomment the following - * -#define BuildTrueTypeFonts NO - */ - -/* - * To not build/install the Cyrillic fonts, uncomment the following - * -#define BuildCyrillicFonts NO - */ - -/* - * To not install the local font directory, uncomment the following - * -#define MakeLocalFontDir NO - */ - /* * To build only the servers with a cut-down source tree, uncomment * this. @@ -463,20 +370,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define XFree86ConsoleDefines -DSYSCONS_SUPPORT -DPCVT_SUPPORT */ -/* - * To link the X server with a dynamic version of the Xfont library, - * uncomment this. - * -#define XserverStaticFontLib NO - */ - -/* - * To enable binary compatibility with previous versions of the font - * encoding support, uncomment this. - * -#define FontencCompatibility YES - */ - /* * To disable building XInput support, uncomment this * @@ -669,36 +562,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define X86EMU_LIBPATH /usr/local/lib */ -/* - * Most platforms default to using an already installed FreeType 2 library. - * To use the one included in this release instead, uncomment the following. - * -#define HasFreetype2 NO - */ - -/* - * To use a FreeType library already installed outside the default search - * paths, uncomment the following and set the path as needed. - * -#define HasFreetype2 YES -#define Freetype2Dir /usr/local - */ - - -/* - * Most platforms default to using an already installed Fontconfig library. - * To use the one included in this release instead, uncomment the following. - * -#define HasFontconfig NO - */ - -/* - * To use a Fontconfig library already installed outside the default search - * paths, uncomment the following and set the path as needed. -#define HasFontconfig YES -#define FontconfigDir /usr/local - */ - /* * Most platforms default to using an already installed Expat library. diff --git a/nx-X11/include/Imakefile b/nx-X11/include/Imakefile index 8bdfd4ab7..39d330d04 100644 --- a/nx-X11/include/Imakefile +++ b/nx-X11/include/Imakefile @@ -15,7 +15,7 @@ GLXDIR = GL DPSDIR = DPS #endif -SUBDIRS = bitmaps extensions fonts $(GLXDIR) $(DPSDIR) +SUBDIRS = bitmaps extensions $(GLXDIR) $(DPSDIR) #ifdef Win32Architecture EXTRA_HEADERS = Xw32defs.h Xwinsock.h Xwindows.h diff --git a/nx-X11/include/extensions/Imakefile b/nx-X11/include/extensions/Imakefile index 63b9365dc..24c034103 100644 --- a/nx-X11/include/extensions/Imakefile +++ b/nx-X11/include/extensions/Imakefile @@ -39,7 +39,7 @@ FONTCACHEHEADERS = fontcache.h fontcacheP.h fontcachstr.h #if BuildXinerama || BuildXineramaLibrary XINERAMAHEADERS = Xinerama.h panoramiXext.h panoramiXproto.h #endif -#if BuildRender || BuildXftLibrary +#if BuildRender RENDERHEADERS = render.h renderproto.h #endif #if BuildXfixes || BuildXfixesLibrary diff --git a/nx-X11/include/fonts/FS.h b/nx-X11/include/fonts/FS.h deleted file mode 100644 index e90752233..000000000 --- a/nx-X11/include/fonts/FS.h +++ /dev/null @@ -1,132 +0,0 @@ -/* $Xorg: FS.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ - -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution - * of the software without specific, written prior permission. - * Network Computing Devices and Digital make no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES - * OR 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. - */ - -/* - -Portions Copyright 1987, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/include/fonts/FS.h,v 1.9 2003/07/09 15:27:28 tsi Exp $ */ - -#ifndef _FS_H_ -#define _FS_H_ - -#include -#include - -#define FS_PROTOCOL 2 -#define FS_PROTOCOL_MINOR 0 - -#ifndef X_PROTOCOL -/* protocol familes */ -#define FamilyInternet 0 -#define FamilyDECnet 1 -#define FamilyChaos 2 -#define FamilyInternet6 6 - - -typedef unsigned int FSDrawDirection; -#endif - -#ifndef None -#define None 0L -#endif - -#define LeftToRightDrawDirection 0 -#define RightToLeftDrawDirection 1 - -/* font info flags */ -#define FontInfoAllCharsExist (1L << 0) -#define FontInfoInkInside (1L << 1) -#define FontInfoHorizontalOverlap (1L << 2) - -/* auth status flags */ -#define AuthSuccess 0 -#define AuthContinue 1 -#define AuthBusy 2 -#define AuthDenied 3 - -/* property types */ -#define PropTypeString 0 -#define PropTypeUnsigned 1 -#define PropTypeSigned 2 - -#ifndef LSBFirst -/* byte order */ -#define LSBFirst 0 -#define MSBFirst 1 -#endif - -/* event masks */ -#define CatalogueChangeNotifyMask (1L << 0) -#define FontChangeNotifyMask (1L << 1) - -/* errors */ -#define FSSuccess -1 -#define FSBadRequest 0 -#define FSBadFormat 1 -#define FSBadFont 2 -#define FSBadRange 3 -#define FSBadEventMask 4 -#define FSBadAccessContext 5 -#define FSBadIDChoice 6 -#define FSBadName 7 -#define FSBadResolution 8 -#define FSBadAlloc 9 -#define FSBadLength 10 -#define FSBadImplementation 11 - -#define FirstExtensionError 128 -#define LastExtensionError 255 - -/* events */ -#define KeepAlive 0 -#define CatalogueChangeNotify 1 -#define FontChangeNotify 2 -#define FSLASTEvent 3 - -#endif /* _FS_H_ */ diff --git a/nx-X11/include/fonts/FSproto.h b/nx-X11/include/fonts/FSproto.h deleted file mode 100644 index 03b28089f..000000000 --- a/nx-X11/include/fonts/FSproto.h +++ /dev/null @@ -1,816 +0,0 @@ -/* $Xorg: FSproto.h,v 1.4 2001/02/09 02:03:25 xorgcvs Exp $ */ -/* - -Copyright 1990, 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices, or Digital - * not be used in advertising or publicity pertaining to distribution - * of the software without specific, written prior permission. - * - * NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, - * OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/include/fonts/FSproto.h,v 1.2 2001/08/01 00:44:37 tsi Exp $ */ - -#ifndef _FS_PROTO_H_ -#define _FS_PROTO_H_ - -#include - -#define sz_fsPropOffset 20 -#define sz_fsPropInfo 8 -#define sz_fsResolution 6 - -#define sz_fsChar2b 2 -#define sz_fsChar2b_version1 2 -#define sz_fsOffset32 8 -#define sz_fsRange 4 - -#define sz_fsXCharInfo 12 -#define sz_fsXFontInfoHeader 40 - -#define sz_fsConnClientPrefix 8 -#define sz_fsConnSetup 12 -#define sz_fsConnSetupExtra 8 -#define sz_fsConnSetupAccept 12 - -/* request sizes */ -#define sz_fsReq 4 -#define sz_fsListExtensionsReq 4 -#define sz_fsResourceReq 8 - -#define sz_fsNoopReq 4 -#define sz_fsListExtensionReq 4 -#define sz_fsQueryExtensionReq 4 -#define sz_fsListCataloguesReq 12 -#define sz_fsSetCataloguesReq 4 -#define sz_fsGetCataloguesReq 4 -#define sz_fsSetEventMaskReq 8 -#define sz_fsGetEventMaskReq 4 -#define sz_fsCreateACReq 8 -#define sz_fsFreeACReq 8 -#define sz_fsSetAuthorizationReq 8 -#define sz_fsSetResolutionReq 4 -#define sz_fsGetResolutionReq 4 -#define sz_fsListFontsReq 12 -#define sz_fsListFontsWithXInfoReq 12 -#define sz_fsOpenBitmapFontReq 16 -#define sz_fsQueryXInfoReq 8 -#define sz_fsQueryXExtents8Req 12 -#define sz_fsQueryXExtents16Req 12 -#define sz_fsQueryXBitmaps8Req 16 -#define sz_fsQueryXBitmaps16Req 16 -#define sz_fsCloseReq 8 - -/* reply sizes */ -#define sz_fsReply 8 -#define sz_fsGenericReply 8 - -#define sz_fsListExtensionsReply 8 -#define sz_fsQueryExtensionReply 20 -#define sz_fsListCataloguesReply 16 -#define sz_fsGetCataloguesReply 8 -#define sz_fsGetEventMaskReply 12 -#define sz_fsCreateACReply 12 -#define sz_fsGetResolutionReply 8 -#define sz_fsListFontsReply 16 -#define sz_fsListFontsWithXInfoReply (12 + sz_fsXFontInfoHeader) -#define sz_fsOpenBitmapFontReply 16 -#define sz_fsQueryXInfoReply (8 + sz_fsXFontInfoHeader) -#define sz_fsQueryXExtents8Reply 12 -#define sz_fsQueryXExtents16Reply 12 -#define sz_fsQueryXBitmaps8Reply 20 -#define sz_fsQueryXBitmaps16Reply 20 - -#define sz_fsError 16 -#define sz_fsEvent 12 -#define sz_fsKeepAliveEvent 12 - -#define fsTrue 1 -#define fsFalse 0 - -/* temp decls */ -#define Mask CARD32 -#define Font CARD32 -#define AccContext CARD32 - -typedef CARD32 fsTimestamp; - -#ifdef NOTDEF /* in fsmasks.h */ -typedef CARD32 fsBitmapFormat; -typedef CARD32 fsBitmapFormatMask; -#endif - -#define sz_fsBitmapFormat 4 - -typedef struct { - INT16 left B16, - right B16; - INT16 width B16; - INT16 ascent B16, - descent B16; - CARD16 attributes B16; -} fsXCharInfo; - -typedef struct { - CARD8 high; - CARD8 low; -} fsChar2b; - -typedef struct { - CARD8 low; - CARD8 high; -} fsChar2b_version1; - -typedef struct { - CARD8 min_char_high; - CARD8 min_char_low; - CARD8 max_char_high; - CARD8 max_char_low; -} fsRange; - -typedef struct { - CARD32 position B32; - CARD32 length B32; -} fsOffset32; - -typedef struct { - fsOffset32 name; - fsOffset32 value; - CARD8 type; - BYTE pad0; - CARD16 pad1 B16; -} fsPropOffset; - -typedef struct { - CARD32 num_offsets B32; - CARD32 data_len B32; - /* offsets */ - /* data */ -} fsPropInfo; - -typedef struct { - CARD16 x_resolution B16; - CARD16 y_resolution B16; - CARD16 point_size B16; -} fsResolution; - - -typedef struct { - CARD32 flags B32; - CARD8 char_range_min_char_high; - CARD8 char_range_min_char_low; - CARD8 char_range_max_char_high; - CARD8 char_range_max_char_low; - - CARD8 draw_direction; - CARD8 pad; - CARD8 default_char_high; - CARD8 default_char_low; - INT16 min_bounds_left B16; - INT16 min_bounds_right B16; - - INT16 min_bounds_width B16; - INT16 min_bounds_ascent B16; - INT16 min_bounds_descent B16; - CARD16 min_bounds_attributes B16; - - INT16 max_bounds_left B16; - INT16 max_bounds_right B16; - INT16 max_bounds_width B16; - INT16 max_bounds_ascent B16; - - INT16 max_bounds_descent B16; - CARD16 max_bounds_attributes B16; - INT16 font_ascent B16; - INT16 font_descent B16; - /* propinfo */ -} fsXFontInfoHeader; - - -/* requests */ - -typedef struct { - BYTE byteOrder; - CARD8 num_auths; - CARD16 major_version B16; - CARD16 minor_version B16; - CARD16 auth_len B16; - /* auth data */ -} fsConnClientPrefix; - -typedef struct { - CARD16 status B16; - CARD16 major_version B16; - CARD16 minor_version B16; - CARD8 num_alternates; - CARD8 auth_index; - CARD16 alternate_len B16; - CARD16 auth_len B16; - /* alternates */ - /* auth data */ -} fsConnSetup; - -typedef struct { - CARD32 length B32; - CARD16 status B16; - CARD16 pad B16; - /* more auth data */ -} fsConnSetupExtra; - -typedef struct { - CARD32 length B32; - CARD16 max_request_len B16; - CARD16 vendor_len B16; - CARD32 release_number B32; - /* vendor string */ -} fsConnSetupAccept; - -typedef struct { - CARD8 reqType; - CARD8 data; - CARD16 length B16; -} fsReq; - -/* - * The fsFakeReq structure is never used in the protocol; it is prepended - * to incoming packets when setting up a connection so we can index - * through InitialVector. To avoid alignment problems, it is padded - * to the size of a word on the largest machine this code runs on. - * Hence no sz_fsFakeReq constant is necessary. - */ -typedef struct { - CARD8 reqType; - CARD8 data; - CARD16 length B16; - CARD32 pad B32; /* to fill out to multiple of 64 bits */ -} fsFakeReq; - -typedef struct { - CARD8 reqType; - BYTE pad; - CARD16 length B16; - Font id B32; -} fsResourceReq; - -typedef fsReq fsNoopReq; -typedef fsReq fsListExtensionsReq; - -typedef struct { - CARD8 reqType; - BYTE nbytes; - CARD16 length B16; - /* name */ -} fsQueryExtensionReq; - -typedef struct { - CARD8 reqType; - CARD8 data; - CARD16 length B16; - CARD32 maxNames B32; - CARD16 nbytes B16; - CARD16 pad2 B16; - /* pattern */ -} fsListCataloguesReq; - -typedef struct { - CARD8 reqType; - BYTE num_catalogues; - CARD16 length B16; - /* catalogues */ -} fsSetCataloguesReq; - -typedef fsReq fsGetCataloguesReq; - -typedef struct { - CARD8 reqType; - CARD8 ext_opcode; - CARD16 length B16; - Mask event_mask; -} fsSetEventMaskReq; - -typedef struct { - CARD8 reqType; - CARD8 ext_opcode; - CARD16 length B16; -} fsGetEventMaskReq; - -typedef struct { - CARD8 reqType; - BYTE num_auths; - CARD16 length B16; - AccContext acid B32; - /* auth protocols */ -} fsCreateACReq; - -typedef fsResourceReq fsFreeACReq; -typedef fsResourceReq fsSetAuthorizationReq; - -typedef struct { - CARD8 reqType; - BYTE num_resolutions; - CARD16 length B16; - /* resolutions */ -} fsSetResolutionReq; - -typedef fsReq fsGetResolutionReq; - -typedef struct { - CARD8 reqType; - BYTE pad; - CARD16 length B16; - CARD32 maxNames B32; - CARD16 nbytes B16; - CARD16 pad2 B16; - /* pattern */ -} fsListFontsReq; - -typedef fsListFontsReq fsListFontsWithXInfoReq; - -typedef struct { - CARD8 reqType; - BYTE pad; - CARD16 length B16; - Font fid B32; - fsBitmapFormatMask format_mask B32; - fsBitmapFormat format_hint B32; - /* pattern */ -} fsOpenBitmapFontReq; - -typedef fsResourceReq fsQueryXInfoReq; - -typedef struct { - CARD8 reqType; - BOOL range; - CARD16 length B16; - Font fid B32; - CARD32 num_ranges B32; - /* list of chars */ -} fsQueryXExtents8Req; - -typedef fsQueryXExtents8Req fsQueryXExtents16Req; - -typedef struct { - CARD8 reqType; - BOOL range; - CARD16 length B16; - Font fid B32; - fsBitmapFormat format B32; - CARD32 num_ranges B32; - /* list of chars */ -} fsQueryXBitmaps8Req; - -typedef fsQueryXBitmaps8Req fsQueryXBitmaps16Req; - -typedef fsResourceReq fsCloseReq; - - -/* replies */ -typedef struct { - BYTE type; - BYTE data1; - CARD16 sequenceNumber B16; - CARD32 length B32; -} fsGenericReply; - -typedef struct { - BYTE type; - CARD8 nExtensions; - CARD16 sequenceNumber B16; - CARD32 length B32; - /* extension names */ -} fsListExtensionsReply; - -typedef struct { - BYTE type; - CARD8 present; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 major_version B16; - CARD16 minor_version B16; - CARD8 major_opcode; - CARD8 first_event; - CARD8 num_events; - CARD8 first_error; - CARD8 num_errors; - CARD8 pad1; - CARD16 pad2 B16; -} fsQueryExtensionReply; - -typedef struct { - BYTE type; - BYTE pad; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 num_replies B32; - CARD32 num_catalogues B32; - /* catalog names */ -} fsListCataloguesReply; - -typedef struct { - BYTE type; - CARD8 num_catalogues; - CARD16 sequenceNumber B16; - CARD32 length B32; - /* catalogue names */ -} fsGetCataloguesReply; - -typedef struct { - BYTE type; - BYTE pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 event_mask B32; -} fsGetEventMaskReply; - -typedef struct { - BYTE type; - CARD8 auth_index; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 status B16; - CARD16 pad B16; - /* auth data */ -} fsCreateACReply; - -typedef struct { - CARD32 length B32; - CARD16 status B16; - CARD16 pad B16; - /* auth data */ -} fsCreateACExtraReply; - -typedef struct { - BYTE type; - CARD8 num_resolutions; - CARD16 sequenceNumber B16; - CARD32 length B32; - /* resolutions */ -} fsGetResolutionReply; - -typedef struct { - BYTE type; - BYTE pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 following B32; - CARD32 nFonts B32; - /* font names */ -} fsListFontsReply; - -/* - * this one is messy. the reply itself is variable length (unknown - * number of replies) and the contents of each is variable (unknown - * number of properties) - * - */ - -typedef struct { - BYTE type; - CARD8 nameLength; /* 0 is end-of-reply */ - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 nReplies B32; - CARD32 font_header_flags B32; - CARD8 font_hdr_char_range_min_char_high; - CARD8 font_hdr_char_range_min_char_low; - CARD8 font_hdr_char_range_max_char_high; - CARD8 font_hdr_char_range_max_char_low; - CARD8 font_header_draw_direction; - CARD8 font_header_pad; - CARD8 font_header_default_char_high; - CARD8 font_header_default_char_low; - INT16 font_header_min_bounds_left B16; - INT16 font_header_min_bounds_right B16; - INT16 font_header_min_bounds_width B16; - INT16 font_header_min_bounds_ascent B16; - INT16 font_header_min_bounds_descent B16; - CARD16 font_header_min_bounds_attributes B16; - INT16 font_header_max_bounds_left B16; - INT16 font_header_max_bounds_right B16; - INT16 font_header_max_bounds_width B16; - INT16 font_header_max_bounds_ascent B16; - INT16 font_header_max_bounds_descent B16; - CARD16 font_header_max_bounds_attributes B16; - INT16 font_header_font_ascent B16; - INT16 font_header_font_descent B16; - /* propinfo */ - /* name */ -} fsListFontsWithXInfoReply; - -typedef struct { - BYTE type; - CARD8 otherid_valid; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 otherid B32; - BYTE cachable; - BYTE pad1; - CARD16 pad2 B16; -} fsOpenBitmapFontReply; - -typedef struct { - BYTE type; - CARD8 pad0; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 font_header_flags B32; - CARD8 font_hdr_char_range_min_char_high; - CARD8 font_hdr_char_range_min_char_low; - CARD8 font_hdr_char_range_max_char_high; - CARD8 font_hdr_char_range_max_char_low; - CARD8 font_header_draw_direction; - CARD8 font_header_pad; - CARD8 font_header_default_char_high; - CARD8 font_header_default_char_low; - INT16 font_header_min_bounds_left B16; - INT16 font_header_min_bounds_right B16; - INT16 font_header_min_bounds_width B16; - INT16 font_header_min_bounds_ascent B16; - INT16 font_header_min_bounds_descent B16; - CARD16 font_header_min_bounds_attributes B16; - INT16 font_header_max_bounds_left B16; - INT16 font_header_max_bounds_right B16; - INT16 font_header_max_bounds_width B16; - INT16 font_header_max_bounds_ascent B16; - INT16 font_header_max_bounds_descent B16; - CARD16 font_header_max_bounds_attributes B16; - INT16 font_header_font_ascent B16; - INT16 font_header_font_descent B16; - /* propinfo */ -} fsQueryXInfoReply; - -typedef struct { - BYTE type; - CARD8 pad0; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 num_extents B32; - /* extents */ -} fsQueryXExtents8Reply; - -typedef fsQueryXExtents8Reply fsQueryXExtents16Reply; - -typedef struct { - BYTE type; - CARD8 pad0; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 replies_hint B32; - CARD32 num_chars B32; - CARD32 nbytes B32; - /* offsets */ - /* glyphs */ -} fsQueryXBitmaps8Reply; - -typedef fsQueryXBitmaps8Reply fsQueryXBitmaps16Reply; - -typedef union { - fsGenericReply generic; - fsListExtensionsReply extensions; - fsGetResolutionReply getres; -} fsReply; - -/* errors */ -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; -} fsError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; -} fsRequestError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; - fsBitmapFormat format B32; -} fsFormatError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; - Font fontid; -} fsFontError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; - fsRange range; -} fsRangeError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; - Mask event_mask; -} fsEventMaskError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; - AccContext acid; -} fsAccessContextError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; - Font fontid; -} fsIDChoiceError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; -} fsNameError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - fsResolution resolution; -} fsResolutionError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; -} fsAllocError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; - CARD32 bad_length B32; -} fsLengthError; - -typedef struct { - BYTE type; - BYTE request; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - CARD8 major_opcode; - CARD8 minor_opcode; - CARD16 pad B16; -} fsImplementationError; - -/* events */ -typedef struct { - BYTE type; - BYTE event_code; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; -} fsKeepAliveEvent; - -typedef struct { - BYTE type; - BYTE event_code; - CARD16 sequenceNumber B16; - CARD32 length B32; - fsTimestamp timestamp; - BOOL added; - BOOL deleted; - CARD16 pad B16; -} fsCatalogueChangeNotifyEvent; - -typedef fsCatalogueChangeNotifyEvent fsFontChangeNotifyEvent; - -typedef fsCatalogueChangeNotifyEvent fsEvent; - -/* reply codes */ -#define FS_Reply 0 /* normal reply */ -#define FS_Error 1 /* error */ -#define FS_Event 2 - -/* request codes */ -#define FS_Noop 0 -#define FS_ListExtensions 1 -#define FS_QueryExtension 2 -#define FS_ListCatalogues 3 -#define FS_SetCatalogues 4 -#define FS_GetCatalogues 5 -#define FS_SetEventMask 6 -#define FS_GetEventMask 7 -#define FS_CreateAC 8 -#define FS_FreeAC 9 -#define FS_SetAuthorization 10 -#define FS_SetResolution 11 -#define FS_GetResolution 12 -#define FS_ListFonts 13 -#define FS_ListFontsWithXInfo 14 -#define FS_OpenBitmapFont 15 -#define FS_QueryXInfo 16 -#define FS_QueryXExtents8 17 -#define FS_QueryXExtents16 18 -#define FS_QueryXBitmaps8 19 -#define FS_QueryXBitmaps16 20 -#define FS_CloseFont 21 - -/* restore decls */ -#undef Mask -#undef Font -#undef AccContext - -#endif /* _FS_PROTO_H_ */ diff --git a/nx-X11/include/fonts/Imakefile b/nx-X11/include/fonts/Imakefile deleted file mode 100644 index 0eae8a3bc..000000000 --- a/nx-X11/include/fonts/Imakefile +++ /dev/null @@ -1,22 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/18 04:05:44 coskrey Exp $ - - - - -XCOMM $XFree86: xc/include/fonts/Imakefile,v 3.7 2001/01/17 17:53:26 dawes Exp $ - - HEADERS = FS.h FSproto.h font.h fontstruct.h fsmasks.h - -all:: - -BuildIncludes($(HEADERS),X11/fonts,../..) - -#if BuildLibraries -InstallMultipleFlags($(HEADERS),$(INCDIR)/X11/fonts,$(INSTINCFLAGS)) -#endif - - -InstallDriverSDKNonExecFile(font.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(fontproto.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(fontstruct.h,$(DRIVERSDKINCLUDEDIR)) -InstallDriverSDKNonExecFile(fsmasks.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/include/fonts/font.h b/nx-X11/include/fonts/font.h deleted file mode 100644 index e6a00cddb..000000000 --- a/nx-X11/include/fonts/font.h +++ /dev/null @@ -1,169 +0,0 @@ -/* $Xorg: font.h,v 1.3 2000/08/18 04:05:44 coskrey 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. - -******************************************************************/ -/* $XFree86: xc/include/fonts/font.h,v 3.4 2000/11/27 00:10:02 dawes Exp $ */ -/* $NCDXorg: @(#)font.h,v 1.7 1991/06/24 17:00:23 lemke Exp $ */ - -#ifndef FONT_H -#define FONT_H - -#ifndef BitmapFormatByteOrderMask -#include "fsmasks.h" -#endif - -/* data structures */ -#ifndef _XTYPEDEF_FONTPTR -typedef struct _Font *FontPtr; -#define _XTYPEDEF_FONTPTR -#endif - -typedef struct _FontInfo *FontInfoPtr; -typedef struct _FontProp *FontPropPtr; -typedef struct _ExtentInfo *ExtentInfoPtr; -typedef struct _FontPathElement *FontPathElementPtr; - -#ifndef _XTYPEDEF_CHARINFOPTR -typedef struct _CharInfo *CharInfoPtr; -#define _XTYPEDEF_CHARINFOPTR -#endif - -typedef struct _FontNames *FontNamesPtr; -typedef struct _FontResolution *FontResolutionPtr; - -#define NullCharInfo ((CharInfoPtr) 0) -#define NullFont ((FontPtr) 0) -#define NullFontInfo ((FontInfoPtr) 0) - - /* draw direction */ -#define LeftToRight 0 -#define RightToLeft 1 -#define BottomToTop 2 -#define TopToBottom 3 -typedef int DrawDirection; - -#define NO_SUCH_CHAR -1 - - -#define FontAliasType 0x1000 - -#define AllocError 80 -#define StillWorking 81 -#define FontNameAlias 82 -#define BadFontName 83 -#define Suspended 84 -#define Successful 85 -#define BadFontPath 86 -#define BadCharRange 87 -#define BadFontFormat 88 -#define FPEResetFailed 89 /* for when an FPE reset won't work */ - -/* OpenFont flags */ -#define FontLoadInfo 0x0001 -#define FontLoadProps 0x0002 -#define FontLoadMetrics 0x0004 -#define FontLoadBitmaps 0x0008 -#define FontLoadAll 0x000f -#define FontOpenSync 0x0010 -#define FontReopen 0x0020 - -/* Query flags */ -#define LoadAll 0x1 -#define FinishRamge 0x2 -#define EightBitFont 0x4 -#define SixteenBitFont 0x8 - -/* Glyph Caching Modes */ -#define CACHING_OFF 0 -#define CACHE_16_BIT_GLYPHS 1 -#define CACHE_ALL_GLYPHS 2 -#define DEFAULT_GLYPH_CACHING_MODE CACHE_16_BIT_GLYPHS -extern int glyphCachingMode; - -struct _Client; - -extern int StartListFontsWithInfo( - struct _Client * /*client*/, - int /*length*/, - unsigned char * /*pattern*/, - int /*max_names*/ -); - -extern FontNamesPtr MakeFontNamesRecord( - unsigned /* size */ -); - -extern void FreeFontNames( - FontNamesPtr /* pFN*/ -); - -extern int AddFontNamesName( - FontNamesPtr /* names */, - char * /* name */, - int /* length */ -); - -#if 0 /* unused */ -extern int FontToFSError(); -extern FontResolutionPtr GetClientResolution(); -#endif - -typedef struct _FontPatternCache *FontPatternCachePtr; - -extern FontPatternCachePtr MakeFontPatternCache ( - void -); - -extern void FreeFontPatternCache ( - FontPatternCachePtr /* cache */ -); - -extern void EmptyFontPatternCache ( - FontPatternCachePtr /* cache */ -); - -extern void CacheFontPattern ( - FontPatternCachePtr /* cache */, - char * /* pattern */, - int /* patlen */, - FontPtr /* pFont */ -); -extern FontResolutionPtr GetClientResolutions( - int * /* num */ -); - -extern FontPtr FindCachedFontPattern ( - FontPatternCachePtr /* cache */, - char * /* pattern */, - int /* patlen */ -); - -extern void RemoveCachedFontPattern ( - FontPatternCachePtr /* cache */, - FontPtr /* pFont */ -); - -typedef enum { - Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit -} FontEncoding; - -#endif /* FONT_H */ diff --git a/nx-X11/include/fonts/fontproto.h b/nx-X11/include/fonts/fontproto.h deleted file mode 100644 index 83c9a00c0..000000000 --- a/nx-X11/include/fonts/fontproto.h +++ /dev/null @@ -1,93 +0,0 @@ -/* $XFree86: xc/include/fonts/fontproto.h,v 1.2 1999/09/04 09:14:08 dawes Exp $ */ - -/*********************************************************** - -Copyright (c) 1999 The XFree86 Project Inc. - -All Rights Reserved. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The XFree86 Project -Inc. shall not be used in advertising or otherwise to promote the -sale, use or other dealings in this Software without prior written -authorization from The XFree86 Project Inc.. - -*/ -#ifndef _FONTPROTO_H -#define _FONTPROTO_H - -/* Externally provided functions required by libXfont */ - -extern int RegisterFPEFunctions ( NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func); - -extern int GetDefaultPointSize ( void ); - -extern int init_fs_handlers ( FontPathElementPtr fpe, - BlockHandlerProcPtr block_handler); -extern void remove_fs_handlers ( FontPathElementPtr fpe, - BlockHandlerProcPtr block_handler, - Bool all ); - -extern int client_auth_generation ( ClientPtr client ); - -#ifndef ___CLIENTSIGNAL_DEFINED___ -#define ___CLIENTSIGNAL_DEFINED___ -extern Bool ClientSignal ( ClientPtr client ); -#endif /* ___CLIENTSIGNAL_DEFINED___ */ - -extern void DeleteFontClientID ( Font id ); -extern Font GetNewFontClientID ( void ); -extern int StoreFontClientFont ( FontPtr pfont, Font id ); -extern void FontFileRegisterFpeFunctions ( void ); -extern void FontFileCheckRegisterFpeFunctions ( void ); - -extern Bool XpClientIsBitmapClient ( ClientPtr client ); -extern Bool XpClientIsPrintClient( ClientPtr client, FontPathElementPtr fpe ); -extern void PrinterFontRegisterFpeFunctions ( void ); - -extern void fs_register_fpe_functions ( void ); -extern void check_fs_register_fpe_functions ( void ); - -/* util/private.c */ -extern FontPtr CreateFontRec (void); -extern void DestroyFontRec (FontPtr font); -extern Bool _FontSetNewPrivate (FontPtr /* pFont */, - int /* n */, - pointer /* ptr */); -extern int AllocateFontPrivateIndex (void); -extern void ResetFontPrivateIndex (void); - -/* Type1/t1funcs.c */ -extern void Type1RegisterFontFileFunctions(void); -extern void CIDRegisterFontFileFunctions(void); - -/* Speedo/spfuncs.c */ -extern void SpeedoRegisterFontFileFunctions(void); - -/* FreeType/ftfuncs.c */ -extern void FreeTypeRegisterFontFileFunctions(void); - -#endif diff --git a/nx-X11/include/fonts/fontstruct.h b/nx-X11/include/fonts/fontstruct.h deleted file mode 100644 index 451ed6a12..000000000 --- a/nx-X11/include/fonts/fontstruct.h +++ /dev/null @@ -1,295 +0,0 @@ -/* $Xorg: fontstruct.h,v 1.3 2000/08/18 04:05:44 coskrey 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. - -******************************************************************/ -/* $XFree86: xc/include/fonts/fontstruct.h,v 3.3 1999/08/21 13:47:34 dawes Exp $ */ - -#ifndef FONTSTR_H -#define FONTSTR_H - -#include -#include "font.h" -#include -#include - -/* - * This version of the server font data strucutre is only for describing - * the in memory data structure. The file structure is not necessarily a - * copy of this. That is up to the compiler and the OS layer font loading - * machinery. - */ - -#define GLYPHPADOPTIONS 4 /* 1, 2, 4, or 8 */ - -typedef struct _FontProp { - long name; - long value; /* assumes ATOM is not larger than INT32 */ -} FontPropRec; - -typedef struct _FontResolution { - unsigned short x_resolution; - unsigned short y_resolution; - unsigned short point_size; -} FontResolutionRec; - -typedef struct _ExtentInfo { - DrawDirection drawDirection; - int fontAscent; - int fontDescent; - int overallAscent; - int overallDescent; - int overallWidth; - int overallLeft; - int overallRight; -} ExtentInfoRec; - -typedef struct _CharInfo { - xCharInfo metrics; /* info preformatted for Queries */ - char *bits; /* pointer to glyph image */ -} CharInfoRec; - -/* - * Font is created at font load time. It is specific to a single encoding. - * e.g. not all of the glyphs in a font may be part of a single encoding. - */ - -typedef struct _FontInfo { - unsigned short firstCol; - unsigned short lastCol; - unsigned short firstRow; - unsigned short lastRow; - unsigned short defaultCh; - unsigned int noOverlap:1; - unsigned int terminalFont:1; - unsigned int constantMetrics:1; - unsigned int constantWidth:1; - unsigned int inkInside:1; - unsigned int inkMetrics:1; - unsigned int allExist:1; - unsigned int drawDirection:2; - unsigned int cachable:1; - unsigned int anamorphic:1; - short maxOverlap; - short pad; - xCharInfo maxbounds; - xCharInfo minbounds; - xCharInfo ink_maxbounds; - xCharInfo ink_minbounds; - short fontAscent; - short fontDescent; - int nprops; - FontPropPtr props; - char *isStringProp; -} FontInfoRec; - -typedef struct _Font { - int refcnt; - FontInfoRec info; - char bit; - char byte; - char glyph; - char scan; - fsBitmapFormat format; - int (*get_glyphs) (FontPtr /* font */, - unsigned long /* count */, - unsigned char * /* chars */, - FontEncoding /* encoding */, - unsigned long * /* count */, - CharInfoPtr * /* glyphs */); - int (*get_metrics) (FontPtr /* font */, - unsigned long /* count */, - unsigned char * /* chars */, - FontEncoding /* encoding */, - unsigned long * /* count */, - xCharInfo ** /* glyphs */); - void (*unload_font) (FontPtr /* font */); - void (*unload_glyphs) (FontPtr /* font */); - FontPathElementPtr fpe; - pointer svrPrivate; - pointer fontPrivate; - pointer fpePrivate; - int maxPrivate; - pointer *devPrivates; -} FontRec; - -#define FontGetPrivate(pFont,n) ((n) > (pFont)->maxPrivate ? (pointer) 0 : \ - (pFont)->devPrivates[n]) - -#define FontSetPrivate(pFont,n,ptr) ((n) > (pFont)->maxPrivate ? \ - _FontSetNewPrivate (pFont, n, ptr) : \ - ((((pFont)->devPrivates[n] = (ptr)) != 0) || TRUE)) - -typedef struct _FontNames { - int nnames; - int size; - int *length; - char **names; -} FontNamesRec; - -/* External view of font paths */ -typedef struct _FontPathElement { - int name_length; - char *name; - int type; - int refcount; - pointer private; -} FontPathElementRec; - -typedef Bool (*NameCheckFunc) (char *name); -typedef int (*InitFpeFunc) (FontPathElementPtr fpe); -typedef int (*FreeFpeFunc) (FontPathElementPtr fpe); -typedef int (*ResetFpeFunc) (FontPathElementPtr fpe); -typedef int (*OpenFontFunc) ( pointer client, - FontPathElementPtr fpe, - Mask flags, - char* name, - int namelen, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - XID id, - FontPtr* pFont, - char** aliasName, - FontPtr non_cachable_font); -typedef void (*CloseFontFunc) (FontPathElementPtr fpe, FontPtr pFont); -typedef int (*ListFontsFunc) (pointer client, - FontPathElementPtr fpe, - char* pat, - int len, - int max, - FontNamesPtr names); - -typedef int (*StartLfwiFunc) (pointer client, - FontPathElementPtr fpe, - char* pat, - int len, - int max, - pointer* privatep); - -typedef int (*NextLfwiFunc) (pointer client, - FontPathElementPtr fpe, - char** name, - int* namelen, - FontInfoPtr* info, - int* numFonts, - pointer private); - -typedef int (*WakeupFpeFunc) (FontPathElementPtr fpe, - unsigned long* LastSelectMask); - -typedef void (*ClientDiedFunc) (pointer client, - FontPathElementPtr fpe); - -typedef int (*LoadGlyphsFunc) (pointer client, - FontPtr pfont, - Bool range_flag, - unsigned int nchars, - int item_size, - unsigned char* data); - -typedef int (*StartLaFunc) (pointer client, - FontPathElementPtr fpe, - char* pat, - int len, - int max, - pointer* privatep); - -typedef int (*NextLaFunc) (pointer client, - FontPathElementPtr fpe, - char** namep, - int* namelenp, - char** resolvedp, - int* resolvedlenp, - pointer private); - -typedef void (*SetPathFunc)(void); - -typedef struct _FPEFunctions { - NameCheckFunc name_check; - InitFpeFunc init_fpe; - ResetFpeFunc reset_fpe; - FreeFpeFunc free_fpe; - OpenFontFunc open_font; - CloseFontFunc close_font; - ListFontsFunc list_fonts; - StartLaFunc start_list_fonts_and_aliases; - NextLaFunc list_next_font_or_alias; - StartLfwiFunc start_list_fonts_with_info; - NextLfwiFunc list_next_font_with_info; - WakeupFpeFunc wakeup_fpe; - ClientDiedFunc client_died; - /* for load_glyphs, range_flag = 0 -> - nchars = # of characters in data - item_size = bytes/char - data = list of characters - range_flag = 1 -> - nchars = # of fsChar2b's in data - item_size is ignored - data = list of fsChar2b's */ - LoadGlyphsFunc load_glyphs; - SetPathFunc set_path_hook; -} FPEFunctionsRec, FPEFunctions; - -/* - * Various macros for computing values based on contents of - * the above structures - */ - -#define GLYPHWIDTHPIXELS(pci) \ - ((pci)->metrics.rightSideBearing - (pci)->metrics.leftSideBearing) - -#define GLYPHHEIGHTPIXELS(pci) \ - ((pci)->metrics.ascent + (pci)->metrics.descent) - -#define GLYPHWIDTHBYTES(pci) (((GLYPHWIDTHPIXELS(pci))+7) >> 3) - -#define GLYPHWIDTHPADDED(bc) (((bc)+7) & ~0x7) - -#define BYTES_PER_ROW(bits, nbytes) \ - ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \ - :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \ - :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \ - :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \ - : 0) - -#define BYTES_FOR_GLYPH(ci,pad) (GLYPHHEIGHTPIXELS(ci) * \ - BYTES_PER_ROW(GLYPHWIDTHPIXELS(ci),pad)) -/* - * Macros for computing different bounding boxes for fonts; from - * the font protocol - */ - -#define FONT_MAX_ASCENT(pi) ((pi)->fontAscent > (pi)->ink_maxbounds.ascent ? \ - (pi)->fontAscent : (pi)->ink_maxbounds.ascent) -#define FONT_MAX_DESCENT(pi) ((pi)->fontDescent > (pi)->ink_maxbounds.descent ? \ - (pi)->fontDescent : (pi)->ink_maxbounds.descent) -#define FONT_MAX_HEIGHT(pi) (FONT_MAX_ASCENT(pi) + FONT_MAX_DESCENT(pi)) -#define FONT_MIN_LEFT(pi) ((pi)->ink_minbounds.leftSideBearing < 0 ? \ - (pi)->ink_minbounds.leftSideBearing : 0) -#define FONT_MAX_RIGHT(pi) ((pi)->ink_maxbounds.rightSideBearing > \ - (pi)->ink_maxbounds.characterWidth ? \ - (pi)->ink_maxbounds.rightSideBearing : \ - (pi)->ink_maxbounds.characterWidth) -#define FONT_MAX_WIDTH(pi) (FONT_MAX_RIGHT(pi) - FONT_MIN_LEFT(pi)) - -#include "fontproto.h" - -#endif /* FONTSTR_H */ diff --git a/nx-X11/include/fonts/fsmasks.h b/nx-X11/include/fonts/fsmasks.h deleted file mode 100644 index 434ee97b5..000000000 --- a/nx-X11/include/fonts/fsmasks.h +++ /dev/null @@ -1,98 +0,0 @@ -/* $Xorg: fsmasks.h,v 1.4 2001/02/09 02:03:25 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution - * of the software without specific, written prior permission. - * Network Computing Devices and Digital make no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES - * OR 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. - */ - -/* - -Portions Copyright 1987, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - - -/* - * masks & values used by the font lib and the font server - */ - -#ifndef _FSMASKS_H_ -#define _FSMASKS_H_ - -#include - -/* font format macros */ -#define BitmapFormatByteOrderMask (1L << 0) -#define BitmapFormatBitOrderMask (1L << 1) -#define BitmapFormatImageRectMask (3L << 2) -#define BitmapFormatScanlinePadMask (3L << 8) -#define BitmapFormatScanlineUnitMask (3L << 12) - -#define BitmapFormatByteOrderLSB (0) -#define BitmapFormatByteOrderMSB (1L << 0) -#define BitmapFormatBitOrderLSB (0) -#define BitmapFormatBitOrderMSB (1L << 1) - -#define BitmapFormatImageRectMin (0L << 2) -#define BitmapFormatImageRectMaxWidth (1L << 2) -#define BitmapFormatImageRectMax (2L << 2) - -#define BitmapFormatScanlinePad8 (0L << 8) -#define BitmapFormatScanlinePad16 (1L << 8) -#define BitmapFormatScanlinePad32 (2L << 8) -#define BitmapFormatScanlinePad64 (3L << 8) - -#define BitmapFormatScanlineUnit8 (0L << 12) -#define BitmapFormatScanlineUnit16 (1L << 12) -#define BitmapFormatScanlineUnit32 (2L << 12) -#define BitmapFormatScanlineUnit64 (3L << 12) - -#define BitmapFormatMaskByte (1L << 0) -#define BitmapFormatMaskBit (1L << 1) -#define BitmapFormatMaskImageRectangle (1L << 2) -#define BitmapFormatMaskScanLinePad (1L << 3) -#define BitmapFormatMaskScanLineUnit (1L << 4) - -typedef CARD32 fsBitmapFormat; -typedef CARD32 fsBitmapFormatMask; - -#endif /* _FSMASKS_H_ */ diff --git a/nx-X11/lib/Imakefile b/nx-X11/lib/Imakefile index 599ea643f..2c7f17472 100644 --- a/nx-X11/lib/Imakefile +++ b/nx-X11/lib/Imakefile @@ -106,22 +106,6 @@ RENDERLIBDIR = Xrender EXPATBUILDDIR = expat #endif -#if BuildFreetype2Library -FREETYPE2BUILDDIR = freetype2 -#endif - -#if BuildFontconfigLibrary -FONTCONFIGBUILDDIR = fontconfig -#endif - -#if BuildXftLibrary -XFTLIBDIR = Xft -#endif - -#if BuildXft1Library -XFT1LIBDIR = Xft1 -#endif - #if BuildRandRLibrary RANDRLIBDIR = Xrandr #endif @@ -165,7 +149,7 @@ XF86EXTLIBS = $(XF86MISCLIBDIR) $(XF86VMLIBDIR) \ LBXUTILDIR = lbxutil #endif -#if (BuildLBX || GzipFontCompression) && !HasZlib +#if BuildLBX && !HasZlib ZLIBDIR = zlib #endif @@ -177,16 +161,6 @@ REGEXDIR = regex XALIBDIR = Xa #endif -#if BuildFontCacheLib -FONTCACHELIBDIR = Xfontcache -#endif - -FONTSUBDIR = font - -#if BuildFontEncLib -FONTENCSUBDIR = fontenc -#endif - #if BuildXauLib XAULIBDIR = Xau #endif @@ -218,15 +192,13 @@ LINTSUBDIRS = $(XAULIBDIR) $(XDMCPLIBDIR) $(X11LIBDIR) \ $(XKBUILIBDIR) $(LBXUTILDIR) $(XALIBDIR) $(EXPATBUILDDIR) \ $(XVLIBDIR) $(GLXLIBDIR) $(GLULIBDIR) $(GLWLIBDIR) \ $(DPSLIBDIR) $(PSRESLIBDIR) $(DPSTKLIBDIR) $(XINERAMADIR) \ - $(ZLIBDIR) $(REGEXDIR) $(RENDERLIBDIR) $(FREETYPE2BUILDDIR) \ - $(FONTCONFIGBUILDDIR) $(XFT1LIBDIR) \ - $(XFTLIBDIR) $(XVMCLIBDIR) $(RANDRLIBDIR) $(XTRAPLIBDIR) \ + $(ZLIBDIR) $(REGEXDIR) $(RENDERLIBDIR) \ + $(XVMCLIBDIR) $(RANDRLIBDIR) $(XTRAPLIBDIR) \ $(XRESLIBDIR) $(APPLELIBDIR) $(DMXLIBDIR) $(WINDOWSLIBDIR) \ $(XEVIELIBDIR) $(XFIXESLIBDIR) $(DAMAGELIBDIR) \ $(XCURSORLIBDIR) $(COMPOSITELIBDIR) -SUBDIRS = $(BERKDIR) xtrans $(LINTSUBDIRS) $(FONTSUBDIR) $(FONTENCSUBDIR) \ - $(FONTCACHELIBDIR) +SUBDIRS = $(BERKDIR) xtrans $(LINTSUBDIRS) MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/lib/Xrender/Imakefile b/nx-X11/lib/Xrender/Imakefile index 86ac94f3e..72d149a20 100644 --- a/nx-X11/lib/Xrender/Imakefile +++ b/nx-X11/lib/Xrender/Imakefile @@ -26,13 +26,6 @@ XCOMM NONSTANDARD_HEADERS below. #define SharedXrenderRev 1.1 SOXRENDERREV = SharedXrenderRev -#if SharedLibXrender -#define SharedXft1Rev 1.2 -SharedLibReferences(XFT1,Xft,$(XFT1SRC),SOXFT1REV,SharedXft1Rev) -#else -ProjectUnsharedLibReferences(XFT1,Xft,$(XFT1SRC),BuildLibDir) -#endif - #undef LinkBuildLibrary #define LinkBuildLibrary(lib) MakeDir($(BUILDLIBDIR)) @@\ RemoveFile($(BUILDLIBDIR)/lib) @@\ diff --git a/nx-X11/lib/font/Imakefile b/nx-X11/lib/font/Imakefile deleted file mode 100644 index f47fe963c..000000000 --- a/nx-X11/lib/font/Imakefile +++ /dev/null @@ -1,178 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:24 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/lib/font/Imakefile,v 3.37 2003/10/24 16:21:12 tsi Exp $ - -#include - -#define IHaveSubdirs - -#define DoNormalLib NormalLibFont -#define DoSharedLib SharedLibFont -#define DoExtraLib SharedLibFont -#define DoDebugLib DebugLibFont -#define DoProfileLib ProfileLibFont - -#if !BuildFontLib -#define LibCreate NO -#else -#define LibCreate YES -#endif - -#if BuildLibraries -#define LibInstall YES -#else -#define LibInstall NO -#endif - -#if BuildLibraries -STUBDIRS = stubs -#endif - -LIBNAME = NX_Xfont -SOREV = $(SOFONTREV) - -#ifndef SeparateSharedCompile -#define SeparateSharedCompile YES -#endif -#if NormalLibFont && SharedLibFont && SeparateSharedCompile -STATIC_OBJSDIR = unshared/ -#endif - -#ifdef SharedXfontReqs -REQUIREDLIBS = SharedXfontReqs -#endif - -#if BuildSpeedo - SPEEDODIRS = Speedo - SPEEDOSHAREDOBJS = Speedo/?*.o - SPEEDOSTATICOBJS = Speedo/$(STATIC_OBJSDIR)?*.o - SPEEDODEBUGOBJS = Speedo/debugger/?*.o - SPEEDOPROFILEOBJS = Speedo/profiled/?*.o - SPEEDODONES = Speedo/DONE -#endif -#if BuildType1 || BuildCID - TYPE1DIRS = Type1 - TYPE1SHAREDOBJS = Type1/?*.o - TYPE1STATICOBJS = Type1/$(STATIC_OBJSDIR)?*.o - TYPE1DEBUGOBJS = Type1/debugger/?*.o - TYPE1PROFILEOBJS = Type1/profiled/?*.o - TYPE1DONES = Type1/DONE -#endif -#if BuildFreeType || BuildFreetype2Library - FREETYPEDIRS = FreeType - FREETYPESHAREDOBJS = FreeType/?*.o - FREETYPESTATICOBJS = FreeType/$(STATIC_OBJSDIR)?*.o - FREETYPEDEBUGOBJS = FreeType/debugger/?*.o -FREETYPEPROFILEOBJS = FreeType/profiled/?*.o - FREETYPEDONES = FreeType/DONE -#endif -#if BuildBuiltinFonts - BUILTINDIRS = builtins - BUILTINSHAREDOBJS = builtins/?*.o - BUILTINSTATICOBJS = builtins/$(STATIC_OBJSDIR)?*.o - BUILTINDEBUGOBJS = builtins/debugger/?*.o - BUILTINPROFILEOBJS = builtins/profiled/?*.o - BUILTINDONES = builtins/DONE -#endif -#if BuildFontCache - FONTCACHEDIRS = fontcache -FONTCACHESHAREDOBJS = fontcache/?*.o -FONTCACHESTATICOBJS = fontcache/$(STATIC_OBJSDIR)?*.o - FONTCACHEDEBUGOBJS = fontcache/debugger/?*.o -FONTCACHEPROFILEOBJS = fontcache/profiled/?*.o - FONTCACHEDONES = fontcache/DONE -#endif - - SUBDIRS = bitmap fontfile fc $(FONTCACHEDIRS) \ - $(SPEEDODIRS) $(TYPE1DIRS) \ - $(FREETYPEDIRS) $(BUILTINDIRS) \ - util $(STUBDIRS) include - SHARED_OBJS = bitmap/?*.o fontfile/?*.o fc/?*.o $(FONTCACHESHAREDOBJS) \ - $(SPEEDOSHAREDOBJS) $(TYPE1SHAREDOBJS) \ - $(FREETYPESHAREDOBJS) \ - $(BUILTINSHAREDOBJS) util/?*.o - STATIC_OBJS = bitmap/$(STATIC_OBJSDIR)?*.o fontfile/$(STATIC_OBJSDIR)?*.o \ - fc/$(STATIC_OBJSDIR)?*.o $(FONTCACHESTATICOBJS) \ - $(SPEEDOSTATICOBJS) $(TYPE1STATICOBJS) \ - $(FREETYPESTATICOBJS) \ - $(BUILTINSTATICOBJS) util/$(STATIC_OBJSDIR)?*.o - DEBUG_OBJS = bitmap/debugger/?*.o fontfile/debugger/?*.o fc/debugger/?*.o \ - $(FONTCACHEDEBUGOBJS) \ - $(SPEEDODEBUGOBJS) $(TYPE1DEBUGOBJS) \ - $(FREETYPEDEBUGOBJS) \ - $(BUILTINDEBUGOBJS) util/debugger/?*.o - PROFILE_OBJS = bitmap/profiled/?*.o fontfile/profiled/?*.o fc/profiled/?*.o \ - $(FONTCACHEPROFILEOBJS) \ - $(SPEEDOPROFILEOBJS) $(TYPE1PROFILEOBJS) \ - $(FREETYPEPROFILEOBJS) \ - $(BUILTINPROFILEOBJS) util/profiled/?*.o - DONES = bitmap/DONE fontfile/DONE fc/DONE $(FONTCACHEDONES) \ - $(SPEEDODONES) $(TYPE1DONES) \ - $(FREETYPEDONES) \ - $(BUILTINDONES) util/DONE - -#if BuildServer && DoLoadableServer - BASEDIRS = fontfile fc util $(FONTCACHEDIRS) - BASELIBOBJS = fontfile/$(STATIC_OBJSDIR)?*.o fc/$(STATIC_OBJSDIR)?*.o \ - util/$(STATIC_OBJSDIR)?*.o $(FONTCACHESTATICOBJS) - BASEOBJS = fontfile/module/ffcheck.o fontfile/module/register.o \ - util/private.o - BASEDONES = fontfile/DONE fontfile/module/DONE fc/DONE util/DONE \ - $(FONTCACHEDONES) -#endif - -#if HasParallelMake -MakeMutex($(SUBDIRS) $(DONES)) -#endif - -#if HasGnuMake || HasBsdMake -$(DONES): $(SUBDIRS) -#endif - -#include - -#undef _LinkBuildLibrary -#define _LinkBuildLibrary(lib) LinkBuildLibrary(lib) - -#if LibCreate -#if NormalLibFont -NormalDepLibraryTarget($(LIBNAME),$(SUBDIRS) $(DONES),$(STATIC_OBJS)) -#if LibInstall -InstallLibrary($(LIBNAME),$(USRLIBDIR)) -#endif /* LibInstall */ -#endif /* NormalLibFont */ - -#if SharedLibFont -SharedDepLibraryTarget($(LIBNAME),$(SOREV),$(SUBDIRS) $(DONES),$(SHARED_OBJS),.,.) -#if LibInstall -InstallSharedLibrary($(LIBNAME),$(SOREV),$(SHLIBDIR)) -#endif /* LibInstall */ -#endif /* SharedLibFont */ - -#if DebugLibFont -DebuggedDepLibraryTarget($(LIBNAME),$(SUBDIRS) $(DONES),$(DEBUG_OBJS)) -#if LibInstall -InstallLibrary($(LIBNAME)_d,$(USRLIBDIR)) -#endif /* LibInstall */ -#endif /* DebugLibFont */ - -#if ProfileLibFont -ProfiledDepLibraryTarget($(LIBNAME),$(SUBDIRS) $(DONES),$(PROFILE_OBJS)) -#if LibInstall -InstallLibrary($(LIBNAME)_p,$(USRLIBDIR)) -#endif /* LibInstall */ -#endif /* ProfileLibFont */ -#endif /* LibCreate */ - -#if BuildServer && DoLoadableServer -NormalDepLibraryTarget(fontbase,$(BASEDIRS) $(BASEDONES),$(BASELIBOBJS)) -NormalDepRelocatableTarget(fontbase,$(BASEDIRS) $(BASEDONES),$(BASEOBJS)) -#endif - - -ForceSubdirs($(SUBDIRS)) - -DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/lib/font/Speedo/Imakefile b/nx-X11/lib/font/Speedo/Imakefile deleted file mode 100644 index e2d9dcdeb..000000000 --- a/nx-X11/lib/font/Speedo/Imakefile +++ /dev/null @@ -1,46 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:24 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/lib/font/Speedo/Imakefile,v 1.10 2001/01/19 08:13:29 dawes Exp $ - -#if BuildServer && DoLoadableServer -#define IHaveSubdirs -#define NoLibSubdirs -#define PassCDebugFlags -SUBDIRS = module -#endif - - INCLUDES = -I$(FONTINCSRC) -I../include -I$(SERVERSRC)/include - HEADERS = - SPEEDOSRCS = do_char.c do_trns.c out_bl2d.c out_blk.c \ - out_scrn.c out_util.c reset.c set_spcs.c set_trns.c - SPEEDOOBJS = do_char.o do_trns.o out_bl2d.o out_blk.o \ - out_scrn.o out_util.o reset.o set_spcs.o set_trns.o - - SRCS = spfuncs.c spfile.c spinfo.c sperr.c spfont.c spglyph.c \ - spencode.c bics-unicode.c \ - $(SPEEDOSRCS) - OBJS = spfuncs.o spfile.o spinfo.o sperr.o spfont.o spglyph.o \ - spencode.o bics-unicode.o \ - $(SPEEDOOBJS) - -#if BuildFontLib -#define DoNormalLib NormalLibFont -#define DoSharedLib SharedLibFont -#define DoDebugLib DebugLibFont -#define DoProfileLib ProfileLibFont -#include -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) -#endif - -#if BuildServer && DoLoadableServer -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -DependTarget() diff --git a/nx-X11/lib/font/Speedo/adobe-iso.h b/nx-X11/lib/font/Speedo/adobe-iso.h deleted file mode 100644 index e1eeef1c5..000000000 --- a/nx-X11/lib/font/Speedo/adobe-iso.h +++ /dev/null @@ -1,200 +0,0 @@ -/* $Xorg: adobe-iso.h,v 1.3 2000/08/17 19:46:24 cpqbld Exp $ */ - -/* - * Latin 1 format from masterset format 11 (ps) - * 0 implies no valid mapping - */ - -int adobe_map[] = { - 32, 32, - 33, 33, - 34, 34, - 35, 35, - 36, 36, - 37, 37, - 38, 38, - 39, 169, - 40, 40, - 41, 41, - 42, 42, - 43, 43, - 44, 44, - 45, 45, - 46, 46, - 47, 47, - 48, 48, - 49, 49, - 50, 50, - 51, 51, - 52, 52, - 53, 53, - 54, 54, - 55, 55, - 56, 56, - 57, 57, - 58, 58, - 59, 59, - 60, 60, - 61, 61, - 62, 62, - 63, 63, - 64, 64, - 65, 65, - 66, 66, - 67, 67, - 68, 68, - 69, 69, - 70, 70, - 71, 71, - 72, 72, - 73, 73, - 74, 74, - 75, 75, - 76, 76, - 77, 77, - 78, 78, - 79, 79, - 80, 80, - 81, 81, - 82, 82, - 83, 83, - 84, 84, - 85, 85, - 86, 86, - 87, 87, - 88, 88, - 89, 89, - 90, 90, - 91, 91, - 92, 92, - 93, 93, - 94, 195, - 95, 95, - 96, 193, - 97, 97, - 98, 98, - 99, 99, - 100, 100, - 101, 101, - 102, 102, - 103, 103, - 104, 104, - 105, 105, - 106, 106, - 107, 107, - 108, 108, - 109, 109, - 110, 110, - 111, 111, - 112, 112, - 113, 113, - 114, 114, - 115, 115, - 116, 116, - 117, 117, - 118, 118, - 119, 119, - 120, 120, - 121, 121, - 122, 122, - 123, 123, - 124, 124, - 125, 125, - 126, 196, /* lc tilde */ - 127, 0, /* */ - 161, 161, /* invert exclamation */ - 162, 162, /* cent */ - 163, 163, /* pound sterling */ - 164, 168, /* intl currency */ - 165, 165, /* yen */ - 166, 320, /* split vert bar */ - 167, 167, /* section mark */ - 168, 200, /* dierisis */ - 169, 0, /* superior copyright */ - 170, 0, /* feminine ordinal */ - 171, 171, /* dbl left guillemot */ - 172, 314, /* math not */ - 173, 0, /* hyphen ? */ - 174, 0, /* superior registered */ - 175, 0, /* overscore */ - 176, 321, /* degree */ - 177, 329, /* math +- */ - 178, 333, /* superior 2 */ - 179, 332, /* superior 3 */ - 180, 194, /* lc acute */ - 181, 324, /* greek lc mu */ - 182, 182, /* Paragraph */ - 183, 180, /* center dot */ - 184, 203, /* cedilla lc */ - 185, 328, /* superior 1 */ - 186, 0, /* masculine ordinal(using superior o) */ - 187, 187, /* right dbl guillemot */ - 188, 327, /* 1/4 */ - 189, 326, /* 1/2 */ - 190, 331, /* 3/4 */ - 191, 191, /* invert question */ - 192, 259, /* A grave */ - 193, 256, /* A acute */ - 194, 257, /* A circumflex */ - 195, 261, /* A tilde */ - 196, 258, /* A dierisis */ - 197, 260, /* A angstrom */ - 198, 225, /* AE ligature */ - 199, 262, /* C cedilla */ - 200, 266, /* E grave */ - 201, 263, /* E acute */ - 202, 264, /* E circumflex */ - 203, 265, /* E dierisis */ - 204, 270, /* I grave */ - 205, 267, /* I acute */ - 206, 268, /* I circumflex */ - 207, 269, /* I dierisis */ - 208, 317, /* D bar */ - 209, 271, /* N tilde */ - 210, 275, /* O grave */ - 211, 272, /* O acute */ - 212, 273, /* O circumflex */ - 213, 276, /* O tilde */ - 214, 274, /* O dierisis */ - 215, 325, /* math multiply */ - 216, 233, /* O bar */ - 217, 281, /* U grave */ - 218, 278, /* U acute */ - 219, 279, /* U circumflex */ - 220, 280, /* U dierisis */ - 221, 319, /* Y acute */ - 222, 318, /* icelandic thorn lc */ - 223, 251, /* German dbl s */ - 224, 287, /* a grave */ - 225, 284, /* a acute */ - 226, 285, /* a circumflex */ - 227, 289, /* a tilde */ - 228, 286, /* a dierisis */ - 229, 288, /* a angstrom */ - 230, 241, /* ae ligature */ - 231, 290, /* c cedilla */ - 232, 294, /* e grave */ - 233, 291, /* e acute */ - 234, 292, /* e circumflex */ - 235, 293, /* e dierisis */ - 236, 298, /* i grave */ - 237, 295, /* i acute */ - 238, 296, /* i circumflex */ - 239, 297, /* i dierisis */ - 240, 323, /* icelandic eth lc */ - 241, 299, /* n tilde */ - 242, 303, /* o grave */ - 243, 300, /* o acute */ - 244, 301, /* o circumflex */ - 245, 304, /* o tilde */ - 246, 302, /* o dierisis */ - 247, 322, /* math divide */ - 248, 249, /* o bar */ - 249, 309, /* u grave */ - 250, 306, /* u acute */ - 251, 307, /* u circumflex */ - 252, 308, /* u dierisis */ - 253, 334, /* y acute */ - 254, 330, /* icelandic thorn uc */ - 255, 310, /* y dierisis */ -}; diff --git a/nx-X11/lib/font/Speedo/bics-iso.h b/nx-X11/lib/font/Speedo/bics-iso.h deleted file mode 100644 index 4964fa34e..000000000 --- a/nx-X11/lib/font/Speedo/bics-iso.h +++ /dev/null @@ -1,224 +0,0 @@ -/* $Xorg: bics-iso.h,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - -Copyright 1993, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/Speedo/bics-iso.h,v 1.6 2001/01/17 19:43:17 dawes Exp $ */ - -int sp_bics_map[] = { - 32, 0, - 33, 1, - 34, 2, - 35, 3, - 36, 4, - 37, 5, - 38, 6, - 39, 264, - 40, 8, - 41, 9, - 42, 10, - 43, 11, - 44, 12, - 45, 13, - 46, 14, - 47, 15, - 48, 16, - 49, 17, - 50, 18, - 51, 19, - 52, 20, - 53, 21, - 54, 22, - 55, 23, - 56, 24, - 57, 25, - 58, 26, - 59, 27, - 60, 28, - 61, 29, - 62, 30, - 63, 31, - 64, 32, - 65, 33, - 66, 34, - 67, 35, - 68, 36, - 69, 37, - 70, 38, - 71, 39, - 72, 40, - 73, 41, - 74, 42, - 75, 43, - 76, 44, - 77, 45, - 78, 46, - 79, 47, - 80, 48, - 81, 49, - 82, 50, - 83, 51, - 84, 52, - 85, 53, - 86, 54, - 87, 55, - 88, 56, - 89, 57, - 90, 58, - 91, 59, - 92, 60, - 93, 61, - 94, 133, - 95, 63, - 96, 131, - 97, 65, - 98, 66, - 99, 67, - 100, 68, - 101, 69, - 102, 70, - 103, 71, - 104, 72, - 105, 73, - 106, 74, - 107, 75, - 108, 76, - 109, 77, - 110, 78, - 111, 79, - 112, 80, - 113, 81, - 114, 82, - 115, 83, - 116, 84, - 117, 85, - 118, 86, - 119, 87, - 120, 88, - 121, 89, - 122, 90, - 123, 91, - 124, 92, - 125, 93, - 126, 137, - 127, 358, - 161, 128, - 162, 98, - 163, 97, - 164, 278, - 165, 274, - 166, 277, - 167, 110, - 168, 135, - 169, 503, - 170, 538, - 171, 125, - 172, 309, - 173, 191, - 174, 504, - 175, 230, - 176, 339, - 177, 286, - 178, 160, - 179, 161, - 180, 129, - 181, 325, - 182, 279, - 183, 102, - 184, 141, - 185, 159, - 186, 544, - 187, 126, - 188, 151, - 189, 153, - 190, 155, - 191, 127, - 192, 259, - 193, 261, - 194, 257, - 195, 253, - 196, 255, - 197, 113, - 198, 114, - 199, 148, - 200, 249, - 201, 251, - 202, 247, - 203, 245, - 204, 239, - 205, 241, - 206, 237, - 207, 235, - 208, 169, - 209, 196, - 210, 202, - 211, 200, - 212, 204, - 213, 208, - 214, 206, - 215, 284, - 216, 115, - 217, 212, - 218, 210, - 219, 214, - 220, 216, - 221, 224, - 222, 271, - 223, 121, - 224, 260, - 225, 262, - 226, 258, - 227, 254, - 228, 256, - 229, 117, - 230, 118, - 231, 149, - 232, 250, - 233, 252, - 234, 248, - 235, 246, - 236, 240, - 237, 242, - 238, 238, - 239, 236, - 240, 273, - 241, 195, - 242, 201, - 243, 199, - 244, 203, - 245, 207, - 246, 205, - 247, 285, - 248, 119, - 249, 211, - 250, 209, - 251, 213, - 252, 215, - 253, 223, - 254, 272, - 255, 221, -}; - diff --git a/nx-X11/lib/font/Speedo/bics-unicode.c b/nx-X11/lib/font/Speedo/bics-unicode.c deleted file mode 100644 index 735508268..000000000 --- a/nx-X11/lib/font/Speedo/bics-unicode.c +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright (c) 1998 by Juliusz Chroboczek - -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. -*/ - -/* $XFree86$ */ - -/* These data are very dodgy. */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "bics-unicode.h" - -static short table_160[]= -{0, 128, 98, 97, 278, 274, 277, 110, 135, 503, 538, 125, 309, 191, 504, - 230, 339, 286, 160, 161, 129, 325, 279, 102, 141, 159, 544, 126, 151, - 153, 155, 127, 259, 261, 257, 253, 255, 113, 114, 148, 249, 251, 247, - 245, 239, 241, 237, 235, 169, 196, 202, 200, 204, 208, 206, 284, 115, - 212, 210, 214, 216, 224, 271, 121, 260, 262, 258, 254, 256, 117, 118, - 149, 250, 252, 248, 246, 240, 242, 238, 236, 273, 195, 201, 199, 203, - 207, 205, 285, 119, 211, 209, 213, 215, 223, 272, 221, 477, 476, 374, - 373, 171, 177, 376, 375, -1, -1, -1, -1, 378, 377, 379, -1, 169, 173, - 383, 382, -1, -1, -1, -1, 172, 178, 243, 244, -1, -1, -1, -1, -1, -1, - 385, -1, -1, -1, -1, -1, 233, 234, 387, 386, -1, -1, 391, 390, 389, - 122, 276, 275, -1, -1, 393, 392, -1, 395, 394, 399, 398, -1, -1, -1, - -1, 170, 174, 194, 193, 402, 401, 198, 197, 263, -1, -1, -1, -1, -1, - -1, 404, 403, 116, 120, -1, -1, 408, 407, 406, 405, 410, 409, -1, -1, - 486, 485, 412, 411, 419, 418, 364, 363, -1, -1, 218, 217, 421, 420, -1, - -1, 220, 219, 423, 422, -1, 268, 425, 424, -1, -1, 222, 368, 367, 372, - 371, 370, 369}; - -static short table_728[]={144, 181, 146, 731, 137, 183}; - -static short table_915[]= -{313, 314, -1, -1, -1, 315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 316, -1, -1, 317, -1, -1, 318, -1, -1, -1, -1, -1, -1, -1, 319, 320, - -1, 321, 322, -1, 323, 324, -1, -1, -1, 325, -1, -1, -1, 326, -1, -1, - 327, 328, -1, 329}; - -static short table_8211[]= -{111, 112, -1, -1, -1, -1, -1, 106, -1, 103, 105, 107, 104, 108, 109, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 100, -1, -1, - -1, -1, -1, -1, -1, -1, 123, 124, -1, 265}; - -static short table_8319[]= -{543, 475, 466, 467, 468, 469, 470, 471, 472, 473, 474, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 491, -1, -1, -1, 266}; - -static short table_8592[]={293, 295, 294, 292, 297, 296}; - -static short table_8712[]= -{298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 492, -1, -1, -1, -1, -1, - -1, 302, -1, -1, -1, 303, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 299, - -1, -1, -1, -1, 428}; - - -static short table_8800[]={288, -1, -1, -1, 291, 290}; - -static short table_9600[]= -{304, -1, -1, -1, 305, -1, -1, -1, 308, -1, -1, -1, 306, -1, -1, -1, - 307, 357, 358, 359, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 335, 336, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 348, -1, -1, -1, 345, -1, -1, -1, -1, -1, 347, -1, -1, -1, 346, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 339, -1, -1, -1, 342, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 344}; - -static short table_9784[]={360, -1, 361, 362, -1, -1, -1, -1, 350, -1, 349}; - -static short table_9824[]= -{354, -1, -1, 352, -1, 351, 353, -1, -1, -1, 330, 331}; - -static short table_64256[]={282, 95, 96, 281}; - -int -unicode_to_bics(unsigned code) -{ - if(code<32) return -1; - else if(code<127) return code-32; - else if(code<160) return -1; - else if(code<383) return table_160[code-160]; - else if(code==402) return 99; - else if(code==486) return 480; - else if(code==487) return 379; - else if(code==501) return 384; - else if(code==711) return 139; - else if(code<728) return -1; - else if(code<734) return table_728[code-728]; - else if(code<915) return -1; - else if(code<967) return table_915[code-915]; - else if(code<8211) return -1; - else if(code<8253) return table_8211[code-8211]; - else if(code<8319) return -1; - else if(code<8360) return table_8319[code-8319]; - else if(code<8592) return -1; - else if(code<8598) return table_8592[code-8592]; - else if(code==8616) return 340; - else if(code<8712) return -1; - else if(code<8751) return table_8712[code-8712]; - else if(code<8800) return -1; - else if(code<8806) return table_8800[code-8800]; - else if(code==8976) return 310; - else if(code==8992) return 300; - else if(code==8993) return 301; - else if(code==9400) return 332; - else if(code==9415) return 333; - else if(code==9473) return 355; - else if(code==9475) return 356; - else if(code<9600) return -1; - else if(code<9690) return table_9600[code-9600]; - else if(code==9711) return 343; - else if(code<9784) return -1; - else if(code<9795) return table_9784[code-9784]; - else if(code<9824) return -1; - else if(code<9836) return table_9824[code-9824]; - else if(code<64256) return -1; - else if(code<64261) return table_64256[code-64256]; - else return -1; -} - diff --git a/nx-X11/lib/font/Speedo/bics-unicode.h b/nx-X11/lib/font/Speedo/bics-unicode.h deleted file mode 100644 index 90fa1885b..000000000 --- a/nx-X11/lib/font/Speedo/bics-unicode.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $XFree86$ */ - -int unicode_to_bics(unsigned); diff --git a/nx-X11/lib/font/Speedo/do_char.c b/nx-X11/lib/font/Speedo/do_char.c deleted file mode 100644 index 410d6339a..000000000 --- a/nx-X11/lib/font/Speedo/do_char.c +++ /dev/null @@ -1,1016 +0,0 @@ -/* $Xorg: do_char.c,v 1.3 2000/08/17 19:46:24 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/do_char.c,v 1.3 2001/01/17 19:43:17 dawes Exp $ */ - -/***************************** D O - C H A R . C ***************************** - * * - * This is the top level module for processing one simple or composite * - * character. - * * - ****************************************************************************/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spdo_prv.h" /* General definitions for Speedo */ - -#define DEBUG 0 - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - -/***** EXTERNAL VARIABLES *****/ - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC VARIABLES *****/ - -/***** STATIC FUNCTIONS *****/ - -static boolean sp_make_simp_char(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8 format); -static boolean sp_make_comp_char(PROTO_DECL2 ufix8 FONTFAR *pointer); -static ufix8 FONTFAR *sp_get_char_org(PROTO_DECL2 ufix16 char_index,boolean top_level); -static fix15 sp_get_posn_arg(PROTO_DECL2 ufix8 FONTFAR *STACKFAR *ppointer,ufix8 format); -static fix15 sp_get_scale_arg(PROTO_DECL2 ufix8 FONTFAR *STACKFAR *ppointer,ufix8 format); - - -FUNCTION ufix16 get_char_id( -GDECL -ufix16 char_index) /* Index to character in char directory */ -/* - * Returns character id for specified character index in currently - * selected font. - * Reports Error 10 and returns 0 if no font selected. - * Reports Error 12 and returns 0 if character data not available. - */ -{ -ufix8 FONTFAR *pointer; /* Pointer to character data */ - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return (ufix16)0; /* Return zero character id */ - } - -pointer = sp_get_char_org(char_index, TRUE); /* Get pointer to character data */ -if (pointer == NULL) /* Character data not available? */ - { - report_error(12); /* Report character data not avail */ - return (ufix16)0; /* Return zero character id */ - } - -return 0xffff & NEXT_WORD(pointer); /* Return character id */ -} - - -#if INCL_METRICS -FUNCTION fix31 get_char_width( -GDECL -ufix16 char_index) /* Index to character in char directory */ -/* - * Returns character set width for specified character index in currently - * selected font in units of 1/65536 em. - * Reports Error 10 and returns 0 if no font selected. - * Reports Error 12 and returns 0 if character data not available. - */ -{ -ufix8 FONTFAR *pointer; /* Pointer to character data */ -fix31 set_width; /* Set width of character */ - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return (fix31)0; /* Return zero character width */ - } - -pointer = sp_get_char_org(char_index, TRUE); /* Get pointer to character data */ -if (pointer == NULL) /* Character data not available? */ - { - report_error(12); /* Report character data not avail */ - return (fix31)0; /* Return zero character width */ - } - -pointer += 2; /* Skip over character id */ -set_width = (fix31)NEXT_WORD(pointer); /* Read set width and Convert units */ -set_width = ((set_width << 16) + (sp_globals.metric_resolution >> 1)) / sp_globals.metric_resolution; -return set_width; /* Return in 1/65536 em units */ -} -#endif - -#if INCL_METRICS -FUNCTION fix15 get_track_kern( -GDECL -fix15 track, /* Track required (0 - 3) */ -fix15 point_size) /* Point size (units of whole points) */ -/* - * Returns inter-character spacing adjustment in units of 1/256 - * points for the specified kerning track and point size. - * If the specified point size is larger than the maximum point - * size for the specified track, the adjustment for the maximum - * point size is used. - * If the specified point size is smaller than the minimum point - * size for the specified track, the adjustment for the minimum - * point size is used. - * If the specified point size is between the minimum point size - * and the maximum point size for the specified track, the - * adjustment is interpolated linearly between the minimum and - * maximum adjustments. - * Reports Error 10 and returns 0 if no font selected. - * Reports Error 13 and returns 0 if track kerning data not in font. - */ -{ -ufix8 FONTFAR *pointer; /* Pointer to character data */ -fix15 no_tracks; /* Number of kerning tracks in font */ -ufix8 format; /* Track kerning format byte */ -fix15 i; /* Track counter */ -fix15 min_pt_size = 0; /* Minimum point size for track */ -fix15 max_pt_size = 0; /* Maximum point size for track */ -fix15 min_adj = 0; /* Adjustment for min point size */ -fix15 max_adj = 0; /* Adjustment for max point size */ -fix31 delta_pt_size; /* Max point size - min point size */ -fix31 delta_adj; /* Min adjustment - max adjustment */ -fix15 adj = 0; /* Interpolated adjustment */ - -if (track == 0) /* Track zero selected? */ - { - return adj; /* Return zero track kerning adjustment */ - } - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return adj; /* Return zero track kerning adjustment */ - } - -no_tracks = sp_globals.kern.no_tracks; /* Number of kerning tracks */ -if (track > no_tracks) /* Required track not available? */ - { - report_error(13); /* Report track kerning data not avail */ - return adj; /* Return zero track kerning adjustment */ - } - -pointer = sp_globals.kern.tkorg; /* Point to start of track kern data */ -for (i = 0; i < track; i++) /* Read until track required is read */ - { - format = NEXT_BYTE(pointer); /* Read track kerning format byte */ - min_pt_size = (format & BIT0)? - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer); - min_adj = (format & BIT1)? - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer); - max_pt_size = (format & BIT2)? - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer); - max_adj = (format & BIT3)? - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer); - } - -if (point_size <= min_pt_size) /* Smaller than minimum point size? */ - { - return min_adj; /* Return minimum adjustment (1/256 points) */ - } - -if (point_size >= max_pt_size) /* Larger than maximum point size? */ - { - return max_adj; /* Return maximum adjustment (1/256 points) */ - } - -delta_pt_size = (fix31)(max_pt_size - min_pt_size); -delta_adj = (fix31)(min_adj - max_adj); -adj = (fix15)(min_adj - - (((fix31)(point_size - min_pt_size) * delta_adj + - (delta_pt_size >> 1)) / delta_pt_size)); -return adj; /* Return interpolated adjustment (1/256 points) */ -} -#endif - -#if INCL_METRICS -FUNCTION fix31 get_pair_kern( -GDECL -ufix16 char_index1, /* Index to first character in char directory */ -ufix16 char_index2) /* Index to second character in char directory */ -/* - * Returns inter-character spacing adjustment in units of 1/65536 em - * for the specified pair of characters. - * Reports Error 10 and returns 0 if no font selected. - * Reports Error 14 and returns 0 if pair kerning data not in font. - */ -{ -ufix8 FONTFAR *origin; /* Pointer to first kerning pair record */ -ufix8 FONTFAR *pointer; /* Pointer to character data */ -ufix16 tmpufix16; /* Temporary workspace */ -fix15 no_pairs; /* Number of kerning pairs in font */ -ufix8 format; /* Track kerning format byte */ -boolean long_id; /* TRUE if 2-byte character ids */ -fix15 rec_size; /* Number of bytes in kern pair record */ -fix15 n; /* Number of remaining kern pairs */ -fix15 nn; /* Number of kern pairs in first partition */ -fix15 base; /* Index to first record in rem kern pairs */ -fix15 i; /* Index to kern pair being tested */ -fix31 adj = 0; /* Returned value of adjustment */ -fix15 adj_base = 0; /* Adjustment base for relative adjustments */ - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return adj; /* Return zero pair kerning adjustment */ - } - -no_pairs = sp_globals.kern.no_pairs; /* Number of kerning pairs */ -if (no_pairs == 0) /* Pair kerning data not available? */ - { - report_error(14); /* Report pair kerning data not avail */ - return adj; /* Return zero pair kerning adjustment */ - } - -pointer = sp_globals.kern.pkorg; /* Point to start of pair kern data */ -format = NEXT_BYTE(pointer); /* Read pair kerning format byte */ -if (!(format & BIT0)) /* One-byte adjustment values? */ - adj_base = NEXT_WORD(pointer); /* Read base adjustment */ -origin = pointer; /* First byte of kerning pair data */ -rec_size = format + 3; /* Compute kerning pair record size */ -long_id = format & BIT1; /* Set flag for 2-byte char index */ - -n = no_pairs; /* Consider all kerning pairs */ -base = 0; /* Set base at first kern pair record */ -while (n != 0) /* While 1 or more kern pairs remain ... */ - { - nn = n >> 1; /* Size of first partition */ - i = base + nn; /* Index to record to be tested */ - pointer = origin + (i * rec_size); - tmpufix16 = NEXT_CHNDX(pointer, long_id); - if (char_index1 < tmpufix16) - { - n = nn; /* Number remaining in first partition */ - continue; - } - if (char_index1 > tmpufix16) - { - n -= nn + 1; /* Number remaining in second partition */ - base = i + 1; /* Base index for second partition */ - continue; - } - tmpufix16 = NEXT_CHNDX(pointer, long_id); - if (char_index2 < tmpufix16) - { - n = nn; /* Number remaining in first partition */ - continue; - } - if (char_index2 > tmpufix16) - { - n -= nn + 1; /* Number remaining in second partition */ - base = i + 1; /* Base index for second partition */ - continue; - } - adj = (format & BIT0)? - (fix31)NEXT_WORD(pointer): - (fix31)(adj_base + (fix15)NEXT_BYTE(pointer)); - adj = ((adj << 16) + (sp_globals.orus_per_em >> 1)) / sp_globals.orus_per_em; /* Convert units */ - n = 0; /* No more to consider */ - } -return adj; /* Return pair kerning adjustment */ -} -#endif - - -#if INCL_METRICS -#ifdef old -FUNCTION boolean get_char_bbox( -GDECL -ufix16 char_index, -bbox_t *bbox) -{ -/* - * returns true if character exists, false if it doesn't - * provides transformed character bounding box in 1/65536 pixels - * in the provided bbox_t structure. Bounding box may be - * conservative in the event that the transformation is not - * normal or the character is compound. - */ - -ufix8 FONTFAR *pointer; -fix15 tmp; -point_t Pmin, Pmax; - -#if REENTRANT_ALLOC -plaid_t plaid; -sp_globals.plaid = &plaid; -#endif - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return FALSE; /* Error return */ - } - -init_tcb(); /* Initialize transformation control block */ - -pointer = sp_get_char_org(char_index, TRUE); /* Point to start of character data */ -if (pointer == NULL) /* Character data not available? */ - { - report_error(12); /* Report character data not avail */ - return FALSE; /* Error return */ - } - -pointer += 2; /* Skip over character id */ -tmp = NEXT_WORD(pointer); /* Read set width */ - -tmp = NEXT_BYTE(pointer); -if (tmp & BIT1) /* Optional data in header? */ - { - tmp = (ufix8)NEXT_BYTE(pointer); /* Read size of optional data */ - pointer += tmp; /* Skip optional data */ - } - -pointer = plaid_tcb(pointer, tmp); /* Process plaid data */ -pointer = read_bbox(pointer, &Pmin, &Pmax,(boolean)FALSE); /* Read bounding box */ -bbox->xmin = (fix31)Pmin.x << sp_globals.poshift; -bbox->xmax = (fix31)Pmax.x << sp_globals.poshift; -bbox->ymin = (fix31)Pmin.y << sp_globals.poshift; -bbox->ymax = (fix31)Pmax.y << sp_globals.poshift; -return TRUE; -} - -#else /* new code, 4/25/91 */ - -FUNCTION boolean get_char_bbox( -GDECL -ufix16 char_index, -bbox_t *bbox) -{ -/* - * returns true if character exists, false if it doesn't - * provides transformed character bounding box in 1/65536 pixels - * in the provided bbox_t structure. Bounding box may be - * conservative in the event that the transformation is not - * normal or the character is compound. - */ - -ufix8 FONTFAR *pointer; -fix15 tmp; -fix15 format; -ufix16 pix_adj; -point_t Pmin, Pmax; - -#if REENTRANT_ALLOC -plaid_t plaid; -sp_globals.plaid = &plaid; -#endif - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return FALSE; /* Error return */ - } - -init_tcb(); /* Initialize transformation control block */ - -pointer = sp_get_char_org(char_index, TRUE); /* Point to start of character data */ -if (pointer == NULL) /* Character data not available? */ - { - report_error(12); /* Report character data not avail */ - return FALSE; /* Error return */ - } - -pointer += 2; /* Skip over character id */ -tmp = NEXT_WORD(pointer); /* Read set width */ - -format = NEXT_BYTE(pointer); -if (format & BIT1) /* Optional data in header? */ - { - tmp = (ufix8)NEXT_BYTE(pointer); /* Read size of optional data */ - pointer += tmp; /* Skip optional data */ - } - -if (format & BIT0) - { - pix_adj = sp_globals.onepix << 1; /* Allow 2 pixel expansion ... */ - } -else - { - pix_adj = 0; - } - -pointer = plaid_tcb(pointer, format); /* Process plaid data */ -pointer = read_bbox(pointer, &Pmin, &Pmax,(boolean)FALSE); /* Read bounding box */ - -Pmin.x -= pix_adj; /* ... of components of ... */ -Pmin.y -= pix_adj; /* ... compound ... */ -Pmax.x += pix_adj; /* ... character ... */ -Pmax.y += pix_adj; /* ... bounding box. */ - - -bbox->xmin = (fix31)Pmin.x << sp_globals.poshift; -bbox->xmax = (fix31)Pmax.x << sp_globals.poshift; -bbox->ymin = (fix31)Pmin.y << sp_globals.poshift; -bbox->ymax = (fix31)Pmax.y << sp_globals.poshift; -return TRUE; -} -#endif /* new code */ - -#endif - - -#if INCL_ISW -FUNCTION boolean make_char_isw( -GDECL -ufix16 char_index, -ufix32 imported_setwidth) -{ -fix15 xmin; /* Minimum X ORU value in font */ -fix15 xmax; /* Maximum X ORU value in font */ -fix15 ymin; /* Minimum Y ORU value in font */ -fix15 ymax; /* Maximum Y ORU value in font */ -ufix16 return_value; - -sp_globals.import_setwidth_act = TRUE; -/* convert imported width to orus */ -sp_globals.imported_width = (sp_globals.metric_resolution * - imported_setwidth) >> 16; -return_value = do_make_char(char_index); - -if (sp_globals.isw_modified_constants) - { - /* reset fixed point constants */ - xmin = read_word_u(sp_globals.font_org + FH_FXMIN); - ymin = read_word_u(sp_globals.font_org + FH_FYMIN); - ymax = read_word_u(sp_globals.font_org + FH_FYMAX); - sp_globals.constr.data_valid = FALSE; - xmax = read_word_u(sp_globals.font_org + FH_FXMAX); - if (!setup_consts(xmin,xmax,ymin,ymax)) - { - report_error(3); /* Requested specs out of range */ - return FALSE; - } - } -return (return_value); -} - -FUNCTION boolean make_char( -GDECL -ufix16 char_index) /* Index to character in char directory */ -{ -sp_globals.import_setwidth_act = FALSE; -return (do_make_char(char_index)); -} - -FUNCTION static boolean do_make_char(GDECL ufix16 char_index) -#else -FUNCTION boolean make_char(GDECL ufix16 char_index) -#endif -/* - * Outputs specified character using the currently selected font and - * scaling and output specifications. - * Reports Error 10 and returns FALSE if no font specifications - * previously set. - * Reports Error 12 and returns FALSE if character data not available. - */ -{ -ufix8 FONTFAR *pointer; /* Pointer to character data */ -fix15 x_orus; -fix15 tmpfix15; -ufix8 format; - -#if INCL_ISW -sp_globals.isw_modified_constants = FALSE; -#endif - -#if REENTRANT_ALLOC - -plaid_t plaid; - -#if INCL_BLACK || INCL_SCREEN || INCL_2D -intercepts_t intercepts; -sp_globals.intercepts = &intercepts; -#endif - -sp_globals.plaid = &plaid; -#endif - -if (!sp_globals.specs_valid) /* Font specs not defined? */ - { - report_error(10); /* Report font not specified */ - return FALSE; /* Error return */ - } - -#if INCL_MULTIDEV -#if INCL_OUTLINE -if (sp_globals.output_mode == MODE_OUTLINE && !sp_globals.outline_device_set) - { - report_error(2); - return FALSE; - } -else -#endif - if (!sp_globals.bitmap_device_set) - { - report_error(2); - return FALSE; - } -#endif - - -init_tcb(); /* Initialize transformation control block */ - -pointer = sp_get_char_org(char_index, TRUE); /* Point to start of character data */ -SHOW(pointer); -if (pointer == NULL) /* Character data not available? */ - { - report_error(12); /* Report character data not avail */ - return FALSE; /* Error return */ - } - -pointer += 2; /* Skip over character id */ -x_orus = NEXT_WORD(pointer); /* Read set width */ -#if INCL_SQUEEZING || INCL_ISW -sp_globals.setwidth_orus = x_orus; -#endif - -#if INCL_ISW -if (sp_globals.import_setwidth_act) - x_orus = sp_globals.imported_width; -#endif -sp_globals.Psw.x = (fix15)((fix31) - (((fix31)x_orus * (sp_globals.specs.xxmult>>16) + - ( ((fix31)x_orus * (sp_globals.specs.xxmult&0xffffL) )>>16) - ) << sp_globals.pixshift) / sp_globals.metric_resolution); - -sp_globals.Psw.y = (fix15)( - (fix31)( - ((fix31)x_orus * (sp_globals.specs.yxmult>>16) + - ( ((fix31)x_orus * (sp_globals.specs.yxmult&0xffffL) )>>16) - ) << sp_globals.pixshift) / sp_globals.metric_resolution); - -format = NEXT_BYTE(pointer); -if (format & BIT1) /* Optional data in header? */ - { - tmpfix15 = (ufix8)NEXT_BYTE(pointer); /* Read size of optional data */ - pointer += tmpfix15; /* Skip optional data */ - } -if (format & BIT0) - { - return sp_make_comp_char(pointer); /* Output compound character */ - } -else - { - return sp_make_simp_char(pointer, format); /* Output simple character */ - } -} - -FUNCTION static boolean sp_make_simp_char( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to first byte of position argument */ -ufix8 format) /* Character format byte */ -/* - * Called by sp_make_char() to output a simple (non-compound) character. - * Returns TRUE on completion. - */ -{ -point_t Pmin, Pmax; /* Transformed corners of bounding box */ -#if INCL_SQUEEZING || INCL_ISW -ufix8 FONTFAR *save_pointer; -#endif -#if INCL_ISW -fix31 char_width; -fix31 isw_scale; -#endif - -#if INCL_SQUEEZING -sp_globals.squeezing_compound = FALSE; -if ((sp_globals.pspecs->flags & SQUEEZE_LEFT) || - (sp_globals.pspecs->flags & SQUEEZE_RIGHT) || - (sp_globals.pspecs->flags & SQUEEZE_TOP) || - (sp_globals.pspecs->flags & SQUEEZE_BOTTOM) ) - { - /* get the bounding box data before processing the character */ - save_pointer = pointer; - preview_bounding_box (pointer, format); - pointer = save_pointer; - } -#endif -#if (INCL_ISW) -if (sp_globals.import_setwidth_act) - { - save_pointer = pointer; - preview_bounding_box (pointer, format); - pointer = save_pointer; - /* make sure I'm not going to get fixed point overflow */ - isw_scale = compute_isw_scale(); - if (sp_globals.bbox_xmin_orus < 0) - char_width = SQUEEZE_MULT((sp_globals.bbox_xmax_orus - sp_globals.bbox_xmin_orus), isw_scale); - else - char_width = SQUEEZE_MULT(sp_globals.bbox_xmax_orus, isw_scale); - if (char_width >= sp_globals.isw_xmax) - if (!reset_xmax(char_width)) - return FALSE; - } -#endif -pointer = plaid_tcb(pointer, format); /* Process plaid data */ -pointer = read_bbox(pointer, &Pmin, &Pmax, FALSE); /* Read bounding box */ -if (fn_begin_char(sp_globals.Psw, Pmin, Pmax)) /* Signal start of character output */ - { - do - { - proc_outl_data(pointer); /* Process outline data */ - } - while (!fn_end_char()); /* Repeat if not done */ - } -return TRUE; -} - -FUNCTION static boolean sp_make_comp_char( -GDECL -ufix8 FONTFAR *pointer) /* Pointer to first byte of position argument */ -/* - * Called by sp_make_char() to output a compound character. - * Returns FALSE if data for any sub-character is not available. - * Returns TRUE if output completed with no error. - */ -{ -point_t Pmin, Pmax; /* Transformed corners of bounding box */ -point_t Pssw; /* Transformed escapement vector */ -ufix8 FONTFAR *pointer_sav; /* Saved pointer to compound character data */ -ufix8 FONTFAR *sub_pointer; /* Pointer to sub-character data */ -ufix8 format; /* Format of DOCH instruction */ -ufix16 sub_char_index; /* Index to sub-character in character directory */ -fix15 x_posn; /* X position of sub-character (outline res units) */ -fix15 y_posn; /* Y position of sub-character (outline res units) */ -fix15 x_scale; /* X scale factor of sub-character (scale units) */ -fix15 y_scale; /* Y scale factor of sub-character (scale units) */ -fix15 tmpfix15; /* Temporary workspace */ -fix15 x_orus; /* Set width in outline resolution units */ -fix15 pix_adj; /* Pixel adjustment to compound char bounding box */ -#if INCL_SQUEEZING -fix31 x_factor, x_offset, top_scale, bottom_scale; -boolean squeezed_x, squeezed_y; -#endif -#if INCL_SQUEEZING || INCL_ISW -fix15 x_offset_pix; -#endif -#if INCL_ISW -fix31 char_width; -fix31 isw_scale; -#endif - - -#if INCL_SQUEEZING -sp_globals.squeezing_compound = TRUE; -#endif -pointer = read_bbox(pointer, &Pmin, &Pmax, TRUE); /* Read bounding box data */ -pix_adj = sp_globals.onepix << 1; /* Allow 2 pixel expansion ... */ -Pmin.x -= pix_adj; /* ... of components of ... */ -Pmin.y -= pix_adj; /* ... compound ... */ -Pmax.x += pix_adj; /* ... character ... */ -Pmax.y += pix_adj; /* ... bounding box. */ - -#if INCL_SQUEEZING -/* scale the bounding box if necessary before calling begin_char */ -squeezed_x = calculate_x_scale(&x_factor, &x_offset, 0); -squeezed_y = calculate_y_scale(&top_scale, &bottom_scale,0,0); - -if (squeezed_x) - { /* scale the x coordinates of the bbox */ - x_offset_pix = (fix15)(((x_offset >> 16) * sp_globals.tcb0.xppo) - >> sp_globals.mpshift); - if ((x_offset_pix >0) && (x_offset_pix < sp_globals.onepix)) - x_offset_pix = sp_globals.onepix; - Pmin.x = SQUEEZE_MULT (x_factor, Pmin.x) + x_offset_pix - pix_adj; - Pmax.x = SQUEEZE_MULT (x_factor, Pmax.x) + x_offset_pix + pix_adj; - } -if (squeezed_y) - { /* scale the y coordinates of the bbox */ - if ((Pmin.y) < 0) - Pmin.y = SQUEEZE_MULT (bottom_scale, Pmin.y) - pix_adj; - else - Pmin.y = SQUEEZE_MULT (top_scale, Pmin.y) - pix_adj; - if ((Pmax.y) < 0) - Pmax.y = SQUEEZE_MULT (bottom_scale, Pmax.y) + pix_adj; - else - Pmax.y = SQUEEZE_MULT (top_scale, Pmax.y) + pix_adj; - } -#endif -#if (INCL_ISW) -if (sp_globals.import_setwidth_act) - { - /* make sure I'm not going to get fixed point overflow */ - isw_scale = ((fix31)sp_globals.imported_width << 16)/ - (fix31)sp_globals.setwidth_orus; - char_width = SQUEEZE_MULT((sp_globals.bbox_xmax_orus - - sp_globals.bbox_xmin_orus), -isw_scale); - if (char_width >= sp_globals.isw_xmax) - if (!reset_xmax(char_width)) - return FALSE; - } -#endif - -if (fn_begin_char(sp_globals.Psw, Pmin, Pmax)) /* Signal start of character data */ - { - pointer_sav = pointer; - do - { - pointer = pointer_sav; /* Point to next DOCH or END instruction */ - while ((format = NEXT_BYTE(pointer))) /* DOCH instruction? */ - { - init_tcb(); /* Initialize transformation control block */ - x_posn = sp_get_posn_arg(&pointer, format); - y_posn = sp_get_posn_arg(&pointer, (ufix8)(format >> 2)); - x_scale = sp_get_scale_arg(&pointer, (ufix8)(format & BIT4)); - y_scale = sp_get_scale_arg(&pointer, (ufix8)(format & BIT5)); - scale_tcb(&sp_globals.tcb, x_posn, y_posn, x_scale, y_scale); /* Scale for sub-char */ - sub_char_index = (format & BIT6)? /* Read sub-char index */ - 0xffff & NEXT_WORD(pointer): - 0xffff & NEXT_BYTE(pointer); - sub_pointer = sp_get_char_org(sub_char_index, FALSE); /* Point to start of sub-char */ - if (sub_pointer == NULL) /* Character data not available? */ - { - return FALSE; /* Abort character output */ - } - sub_pointer += 2; /* Skip over character id */ - x_orus = NEXT_WORD(sub_pointer); /* Read set_width of sub-character */ - - Pssw.x = (fix15)( - (fix31)( - ((fix31)x_orus * (sp_globals.specs.xxmult>>16) + - ( ((fix31)x_orus * (sp_globals.specs.xxmult&0xffffL) )>>16) - ) << sp_globals.pixshift) / sp_globals.metric_resolution); - Pssw.y = (fix15)( - (fix31)( - ((fix31)x_orus * (sp_globals.specs.yxmult>>16) + - ( ((fix31)x_orus * (sp_globals.specs.yxmult&0xffffL) )>>16) - ) << sp_globals.pixshift) / sp_globals.metric_resolution); - - format = NEXT_BYTE(sub_pointer); /* Read sub-character format */ - if (format & BIT1) /* Optional data in header? */ - { - tmpfix15 = (ufix8)NEXT_BYTE(sub_pointer); /* Read size of optional data */ - sub_pointer += tmpfix15; /* Skip optional data */ - } - sub_pointer = plaid_tcb(sub_pointer, format); /* Process sub-character plaid data */ - sub_pointer = read_bbox(sub_pointer, &Pmin, &Pmax, FALSE); /* Read bounding box */ - fn_begin_sub_char(Pssw, Pmin, Pmax); /* Signal start of sub-character data */ - proc_outl_data(sub_pointer); /* Process sub-character data */ - fn_end_sub_char(); /* Signal end of sub-character data */ - } - } - while (!fn_end_char()); /* Signal end of character; repeat if required */ - } -return TRUE; -} - -#if INCL_LCD /* Dynamic load character data supported? */ -FUNCTION static ufix8 FONTFAR *sp_get_char_org( -GDECL -ufix16 char_index, /* Index of character to be accessed */ -boolean top_level) /* Not a compound character element */ -/* - * Called by sp_get_char_id(), sp_get_char_width(), sp_make_char() and - * sp_make_comp_char() to get a pointer to the start of the character data - * for the specified character index. - * Version for configuration supporting dynamic character data loading. - * Calls load_char_data() to load character data if not already loaded - * as part of the original font buffer. - * Returns NULL if character data not available - */ -{ -buff_t *pchar_data; /* Buffer descriptor requested */ -ufix8 FONTFAR *pointer; /* Pointer into character directory */ -ufix8 format; /* Character directory format byte */ -fix31 char_offset; /* Offset of char data from start of font file */ -fix31 next_char_offset; /* Offset of char data from start of font file */ -fix15 no_bytes; /* Number of bytes required for char data */ - -if (top_level) /* Not element of compound char? */ - { - if (char_index < sp_globals.first_char_idx) /* Before start of character set? */ - return NULL; - char_index -= sp_globals.first_char_idx; - if (char_index >= sp_globals.no_chars_avail) /* Beyond end of character set? */ - return NULL; - sp_globals.cb_offset = 0; /* Reset char buffer offset */ - } - -pointer = sp_globals.pchar_dir; -format = NEXT_BYTE(pointer); /* Read character directory format byte */ -pointer += char_index << 1; /* Point to indexed character entry */ -if (format) /* 3-byte entries in char directory? */ - { - pointer += char_index; /* Adjust for 3-byte entries */ - char_offset = read_long(pointer); /* Read file offset to char data */ - next_char_offset = read_long(pointer + 3); /* Read offset to next char */ - } -else - { - char_offset = (fix31)(0xffff & NEXT_WORD(pointer)); /* Read file offset to char data */ - next_char_offset = (fix31)(0xffff & NEXT_WORD(pointer)); /* Read offset to next char */ - } - -no_bytes = next_char_offset - char_offset; -if (no_bytes == 0) /* Character not in directory? */ - return NULL; - -if (next_char_offset <= sp_globals.font_buff_size)/* Character data already in font buffer? */ - return sp_globals.pfont->org + char_offset; /* Return pointer into font buffer */ - -pchar_data = load_char_data(char_offset, no_bytes, sp_globals.cb_offset); /* Request char data load */ -if (pchar_data->no_bytes < no_bytes) /* Correct number of bytes loaded? */ - return NULL; - -if (top_level) /* Not element of compound char? */ - { - sp_globals.cb_offset = no_bytes; - } - -return pchar_data->org; /* Return pointer into character data buffer */ -} -#endif - -#if INCL_LCD -#else /* Dynamic load character data not supported? */ -FUNCTION static ufix8 FONTFAR *sp_get_char_org( -GDECL -ufix16 char_index, /* Index of character to be accessed */ -boolean top_level) /* Not a compound character element */ -/* - * Called by sp_get_char_id(), sp_get_char_width(), sp_make_char() and - * sp_make_comp_char() to get a pointer to the start of the character data - * for the specified character index. - * Version for configuration not supporting dynamic character data loading. - * Returns NULL if character data not available - */ -{ -ufix8 FONTFAR *pointer; /* Pointer into character directory */ -ufix8 format; /* Character directory format byte */ -fix31 char_offset; /* Offset of char data from start of font file */ -fix31 next_char_offset; /* Offset of char data from start of font file */ -fix15 no_bytes; /* Number of bytes required for char data */ - -if (top_level) /* Not element of compound char? */ - { - if (char_index < sp_globals.first_char_idx) /* Before start of character set? */ - return NULL; - char_index -= sp_globals.first_char_idx; - if (char_index >= sp_globals.no_chars_avail) /* Beyond end of character set? */ - return NULL; - } - -pointer = sp_globals.pchar_dir; -format = NEXT_BYTE(pointer); /* Read character directory format byte */ -pointer += char_index << 1; /* Point to indexed character entry */ -if (format) /* 3-byte entries in char directory? */ - { - pointer += char_index; /* Adjust for 3-byte entries */ - char_offset = read_long(pointer); /* Read file offset to char data */ - next_char_offset = read_long(pointer + 3); /* Read offset to next char */ - } -else - { - char_offset = (fix31)(0xffff & NEXT_WORD(pointer)); /* Read file offset to char data */ - next_char_offset = (fix31)(0xffff & NEXT_WORD(pointer)); /* Read offset to next char */ - } - -no_bytes = next_char_offset - char_offset; -if (no_bytes == 0) /* Character not in directory? */ - return NULL; - -return sp_globals.pfont->org + char_offset; /* Return pointer into font buffer */ -} -#endif - - -FUNCTION static fix15 sp_get_posn_arg( -GDECL -ufix8 FONTFAR * STACKFAR *ppointer, /* Pointer to first byte of position argument */ -ufix8 format) /* Format of DOCH arguments */ -/* - * Called by sp_make_comp_char() to read a position argument from the - * specified point in the font/char buffer. - * Updates pointer to byte following position argument. - * Returns value of position argument in outline resolution units - */ -{ -switch (format & 0x03) - { -case 1: - return NEXT_WORD(*ppointer); - -case 2: - return (fix15)((fix7)NEXT_BYTE(*ppointer)); - -default: - return (fix15)0; - } -} - -FUNCTION static fix15 sp_get_scale_arg( -GDECL -ufix8 FONTFAR *STACKFAR *ppointer, /* Pointer to first byte of position argument */ -ufix8 format) /* Format of DOCH arguments */ -/* - * Called by sp_make_comp_char() to read a scale argument from the - * specified point in the font/char buffer. - * Updates pointer to byte following scale argument. - * Returns value of scale argument in scale units (normally 1/4096) - */ -{ -if (format) - return NEXT_WORD(*ppointer); -else - return (fix15)ONE_SCALE; -} -#if INCL_ISW || INCL_SQUEEZING -FUNCTION static void preview_bounding_box( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to first byte of position argument */ -ufix8 format) /* Character format byte */ -{ -point_t Pmin, Pmax; /* Transformed corners of bounding box */ - - sp_globals.no_X_orus = (format & BIT2)? - (fix15)NEXT_BYTE(pointer): - 0; - sp_globals.no_Y_orus = (format & BIT3)? - (fix15)NEXT_BYTE(pointer): - 0; - pointer = read_oru_table(pointer); - - /* Skip over control zone table */ - pointer = skip_control_zone(pointer,format); - - /* Skip over interpolation table */ - pointer = skip_interpolation_table(pointer,format); - /* get_args has a pathological need for this value to be set */ - sp_globals.Y_edge_org = sp_globals.no_X_orus; - pointer = read_bbox(pointer, &Pmin, &Pmax, TRUE); /* Read bounding bo -x */ - -} -#endif -#if INCL_ISW -FUNCTION static boolean reset_xmax( -GDECL -fix31 xmax) - -{ -fix15 xmin; /* Minimum X ORU value in font */ -fix15 ymin; /* Minimum Y ORU value in font */ -fix15 ymax; /* Maximum Y ORU value in font */ - - -sp_globals.isw_modified_constants = TRUE; -xmin = read_word_u(sp_globals.font_org + FH_FXMIN); -ymin = read_word_u(sp_globals.font_org + FH_FYMIN); -ymax = read_word_u(sp_globals.font_org + FH_FYMAX); - -if (!setup_consts(xmin,xmax,ymin,ymax)) - { - report_error(3); /* Requested specs out of range */ - return FALSE; - } -sp_globals.constr.data_valid = FALSE; -/* recompute setwidth */ -sp_globals.Psw.x = (fix15)((fix31)( - ((fix31)sp_globals.imported_width * (sp_globals.specs.xxmult>>16) + - ( ((fix31)sp_globals.imported_width * - (sp_globals.specs.xxmult&0xffffL) )>>16) - ) << sp_globals.pixshift) / sp_globals.metric_resolution); -sp_globals.Psw.y = (fix15)( - (fix31)( - ((fix31)sp_globals.imported_width * (sp_globals.specs.yxmult>>16) + - ( ((fix31)sp_globals.imported_width * (sp_globals.specs.yxmult&0xffffL) )>>16) - ) << sp_globals.pixshift) / sp_globals.metric_resolution); - -return TRUE; -} -#endif diff --git a/nx-X11/lib/font/Speedo/do_trns.c b/nx-X11/lib/font/Speedo/do_trns.c deleted file mode 100644 index 2e0f1dbed..000000000 --- a/nx-X11/lib/font/Speedo/do_trns.c +++ /dev/null @@ -1,512 +0,0 @@ -/* $Xorg: do_trns.c,v 1.3 2000/08/17 19:46:25 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/do_trns.c,v 1.3 2001/01/17 19:43:17 dawes Exp $ */ - -/**************************** D O _ T R N S . C ****************************** - * * - * This module is responsible for executing all intelligent transformation * - * for bounding box and outline data * - * * - ****************************************************************************/ - - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spdo_prv.h" /* General definitions for Speedo */ - -#define DEBUG 0 - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - -/***** EXTERNAL VARIABLES *****/ - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC VARIABLES *****/ - -/***** STATIC FUNCTIONS *****/ - -static void sp_split_curve(PROTO_DECL2 point_t P1,point_t P2,point_t P3,fix15 depth); -static ufix8 FONTFAR *sp_get_args(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8 format,point_t STACKFAR *pP); - - -FUNCTION ufix8 FONTFAR *read_bbox( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ -point_t STACKFAR *pPmin, /* Lower left corner of bounding box */ -point_t STACKFAR *pPmax, /* Upper right corner of bounding box */ -boolean set_flag) /* flag to indicate whether global oru bbox should be saved */ -/* - * Called by make_simp_char() and make_comp_char() to read the - * bounding box data from the font. - * Sets Pmin and Pmax to the bottom left and top right corners - * of the bounding box after transformation into device space. - * The units of Pmin and Pmax are sub-pixels. - * Updates *ppointer to point to the byte following the - * bounding box data. - */ -{ -ufix8 format1; -ufix8 format = 0; -fix15 i; -point_t P; - -sp_globals.x_int = 0; -sp_globals.y_int = sp_globals.Y_int_org; -sp_globals.x_orus = sp_globals.y_orus = 0; -format1 = NEXT_BYTE(pointer); -pointer = sp_get_args(pointer, format1, pPmin); -#if INCL_SQUEEZING || INCL_ISW -if (set_flag) - { - sp_globals.bbox_xmin_orus = sp_globals.x_orus; - sp_globals.bbox_ymin_orus = sp_globals.y_orus; - } -#endif -*pPmax = *pPmin; -for (i = 1; i < 4; i++) - { - switch(i) - { - case 1: - if (format1 & BIT6) /* Xmax requires X int zone 1? */ - sp_globals.x_int++; - format = (format1 >> 4) | 0x0c; - break; - - case 2: - if (format1 & BIT7) /* Ymax requires Y int zone 1? */ - sp_globals.y_int++; - format = NEXT_BYTE(pointer); - break; - - case 3: - sp_globals.x_int = 0; - format >>= 4; - break; - - default: - break; - } - - pointer = sp_get_args(pointer, format, &P); -#if INCL_SQUEEZING || INCL_ISW - if (set_flag && (i==2)) - { - sp_globals.bbox_xmax_orus = sp_globals.x_orus; - sp_globals.bbox_ymax_orus = sp_globals.y_orus; - } -#endif - if ((i == 2) || (!sp_globals.normal)) - { - if (P.x < pPmin->x) - pPmin->x = P.x; - if (P.y < pPmin->y) - pPmin->y = P.y; - if (P.x > pPmax->x) - pPmax->x = P.x; - if (P.y > pPmax->y) - pPmax->y = P.y; - } - } - -#if DEBUG -printf("BBOX %6.1f(Xint 0), %6.1f(Yint 0), %6.1f(Xint %d), %6.1f(Yint %d)\n", - (real)pPmin->x / (real)sp_globals.onepix, - (real)pPmin->y / (real)sp_globals.onepix, - (real)pPmax->x / (real)sp_globals.onepix, - (format1 >> 6) & 0x01, - (real)pPmax->y / (real)sp_globals.onepix, - (format1 >> 7) & 0x01); - -#endif -return pointer; -} - -FUNCTION void proc_outl_data( -GDECL -ufix8 FONTFAR *pointer) /* Pointer to next byte in char data */ -/* - * Called by make_simp_char() and make_comp_char() to read the - * outline data from the font. - * The outline data is parsed, transformed into device coordinates - * and passed to an output module for further processing. - * Note that pointer is not updated to facilitate repeated - * processing of the outline data when banding mode is in effect. - */ -{ -ufix8 format1, format2; -point_t P0, P1, P2, P3; -fix15 depth; -fix15 curve_count; - -sp_globals.x_int = 0; -sp_globals.y_int = sp_globals.Y_int_org; -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -record_xint((fix15)sp_globals.x_int); /* Record xint data */ -record_yint((fix15)(sp_globals.y_int - sp_globals.Y_int_org)); /* Record yint data */ -#endif - -sp_globals.x_orus = sp_globals.y_orus = 0; -curve_count = 0; -while(TRUE) - { - format1 = NEXT_BYTE(pointer); - switch(format1 >> 4) - { - case 0: /* LINE */ - pointer = sp_get_args(pointer, format1, &P1); -#if DEBUG - printf("LINE %6.1f, %6.1f\n", - (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix); -#endif - fn_line(P1); - sp_globals.P0 = P1; - continue; - - case 1: /* Short XINT */ - sp_globals.x_int = format1 & 0x0f; -#if DEBUG - printf("XINT %d\n", sp_globals.x_int); -#endif -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -record_xint((fix15)sp_globals.x_int); /* Record xint data */ -#endif - continue; - - case 2: /* Short YINT */ - sp_globals.y_int = sp_globals.Y_int_org + (format1 & 0x0f); -#if DEBUG - printf("YINT %d\n", sp_globals.y_int - sp_globals.Y_int_org); -#endif -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -record_yint((fix15)(sp_globals.y_int - sp_globals.Y_int_org)); /* Record yint data */ -#endif - continue; - - case 3: /* Miscellaneous */ - switch(format1 & 0x0f) - { - case 0: /* END */ - if (curve_count) - { - fn_end_contour(); - } - return; - - case 1: /* Long XINT */ - sp_globals.x_int = NEXT_BYTE(pointer); -#if DEBUG - printf("XINT %d\n", sp_globals.x_int); -#endif -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -record_xint((fix15)sp_globals.x_int); /* Record xint data */ -#endif - continue; - - case 2: /* Long YINT */ - sp_globals.y_int = sp_globals.Y_int_org + NEXT_BYTE(pointer); -#if DEBUG - printf("YINT %d\n", sp_globals.y_int - sp_globals.Y_int_org); -#endif -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -record_yint((fix15)(sp_globals.y_int - sp_globals.Y_int_org)); /* Record yint data */ -#endif - continue; - - default: /* Not used */ - continue; - } - - case 4: /* MOVE Inside */ - case 5: /* MOVE Outside */ - if (curve_count++) - { - fn_end_contour(); - } - - pointer = sp_get_args(pointer, format1, &P0); - sp_globals.P0 = P0; -#if DEBUG - printf("MOVE %6.1f, %6.1f\n", - (real)sp_globals.P0.x / (real)sp_globals.onepix, (real)sp_globals.P0.y / (real)sp_globals.onepix); -#endif - fn_begin_contour(sp_globals.P0, (boolean)(format1 & BIT4)); - continue; - - case 6: /* Undefined */ -#if DEBUG - printf("*** Undefined instruction (Hex %4x)\n", format1); -#endif - continue; - - case 7: /* Undefined */ -#if DEBUG - printf("*** Undefined instruction (Hex %4x)\n", format1); -#endif - continue; - - default: /* CRVE */ - format2 = NEXT_BYTE(pointer); - pointer = sp_get_args(pointer, format1, &P1); - pointer = sp_get_args(pointer, format2, &P2); - pointer = sp_get_args(pointer, (ufix8)(format2 >> 4), &P3); - depth = (format1 >> 4) & 0x07; -#if DEBUG - printf("CRVE %6.1f, %6.1f, %6.1f, %6.1f, %6.1f, %6.1f, %d\n", - (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix, - (real)P2.x / (real)sp_globals.onepix, (real)P2.y / (real)sp_globals.onepix, - (real)P3.x / (real)sp_globals.onepix, (real)P3.y / (real)sp_globals.onepix, - depth); -#endif - depth += sp_globals.depth_adj; - if (sp_globals.curves_out) - { - fn_curve(P1, P2, P3, depth); - sp_globals.P0 = P3; - continue; - } - if (depth <= 0) - { - fn_line(P3); - sp_globals.P0 = P3; - continue; - } - sp_split_curve(P1, P2, P3, depth); - continue; - } - } -} - -FUNCTION static void sp_split_curve( -GDECL -point_t P1, /* First control point of Bezier curve */ -point_t P2, /* Second control point of Bezier curve */ -point_t P3, /* End point of Bezier curve */ -fix15 depth) /* Levels of recursive subdivision required */ -/* - * Called by proc_outl_data() to subdivide Bezier curves into an - * appropriate number of vectors, whenever curves are not enabled - * for output to the currently selected output module. - * sp_split_curve() calls itself recursively to the depth specified - * at which point it calls line() to deliver each vector resulting - * from the spliting process. - */ -{ -fix31 X0 = (fix31)sp_globals.P0.x; -fix31 Y0 = (fix31)sp_globals.P0.y; -fix31 X1 = (fix31)P1.x; -fix31 Y1 = (fix31)P1.y; -fix31 X2 = (fix31)P2.x; -fix31 Y2 = (fix31)P2.y; -fix31 X3 = (fix31)P3.x; -fix31 Y3 = (fix31)P3.y; -point_t Pmid; -point_t Pctrl1; -point_t Pctrl2; - -#if DEBUG -printf("CRVE(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f)\n", - (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix, - (real)P2.x / (real)sp_globals.onepix, (real)P2.y / (real)sp_globals.onepix, - (real)P3.x / (real)sp_globals.onepix, (real)P3.y / (real)sp_globals.onepix); -#endif - - -Pmid.x = (X0 + (X1 + X2) * 3 + X3 + 4) >> 3; -Pmid.y = (Y0 + (Y1 + Y2) * 3 + Y3 + 4) >> 3; -if ((--depth) <= 0) - { - fn_line(Pmid); - sp_globals.P0 = Pmid; - fn_line(P3); - sp_globals.P0 = P3; - } -else - { - Pctrl1.x = (X0 + X1 + 1) >> 1; - Pctrl1.y = (Y0 + Y1 + 1) >> 1; - Pctrl2.x = (X0 + (X1 << 1) + X2 + 2) >> 2; - Pctrl2.y = (Y0 + (Y1 << 1) + Y2 + 2) >> 2; - sp_split_curve(Pctrl1, Pctrl2, Pmid, depth); - Pctrl1.x = (X1 + (X2 << 1) + X3 + 2) >> 2; - Pctrl1.y = (Y1 + (Y2 << 1) + Y3 + 2) >> 2; - Pctrl2.x = (X2 + X3 + 1) >> 1; - Pctrl2.y = (Y2 + Y3 + 1) >> 1; - sp_split_curve(Pctrl1, Pctrl2, P3, depth); - } -} - -FUNCTION static ufix8 FONTFAR *sp_get_args( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ -ufix8 format, /* Format specifiaction of argument pair */ -point_t STACKFAR *pP) /* Resulting transformed point */ -/* - * Called by read_bbox() and proc_outl_data() to read an X Y argument - * pair from the font. - * The format is specified as follows: - * Bits 0-1: Type of X argument. - * Bits 2-3: Type of Y argument. - * where the 4 possible argument types are: - * Type 0: Controlled coordinate represented by one byte - * index into the X or Y controlled coordinate table. - * Type 1: Interpolated coordinate represented by a two-byte - * signed integer. - * Type 2: Interpolated coordinate represented by a one-byte - * signed increment/decrement relative to the - * proceding X or Y coordinate. - * Type 3: Repeat of preceding X or Y argument value and type. - * The units of P are sub-pixels. - * Updates *ppointer to point to the byte following the - * argument pair. - */ -{ -ufix8 edge; - -/* Read X argument */ -switch(format & 0x03) - { -case 0: /* Index to controlled oru */ - edge = NEXT_BYTE(pointer); - sp_globals.x_orus = sp_plaid.orus[edge]; -#if INCL_RULES - sp_globals.x_pix = sp_plaid.pix[edge]; -#endif - break; - -case 1: /* 2 byte interpolated oru value */ - sp_globals.x_orus = NEXT_WORD(pointer); - goto L1; - -case 2: /* 1 byte signed oru increment */ - sp_globals.x_orus += (fix15)((fix7)NEXT_BYTE(pointer)); -L1: -#if INCL_RULES - sp_globals.x_pix = TRANS(sp_globals.x_orus, sp_plaid.mult[sp_globals.x_int], sp_plaid.offset[sp_globals.x_int], sp_globals.mpshift); -#endif - break; - -default: /* No change in X value */ - break; - } - -/* Read Y argument */ -switch((format >> 2) & 0x03) - { -case 0: /* Index to controlled oru */ - edge = sp_globals.Y_edge_org + NEXT_BYTE(pointer); - sp_globals.y_orus = sp_plaid.orus[edge]; -#if INCL_RULES - sp_globals.y_pix = sp_plaid.pix[edge]; -#endif - break; - -case 1: /* 2 byte interpolated oru value */ - sp_globals.y_orus = NEXT_WORD(pointer); - goto L2; - -case 2: /* 1 byte signed oru increment */ - sp_globals.y_orus += (fix15)((fix7)NEXT_BYTE(pointer)); -L2: -#if INCL_RULES - sp_globals.y_pix = TRANS(sp_globals.y_orus, sp_plaid.mult[sp_globals.y_int], sp_plaid.offset[sp_globals.y_int], sp_globals.mpshift); -#endif - break; - -default: /* No change in X value */ - break; - } - -#if INCL_RULES -switch(sp_globals.tcb.xmode) - { -case 0: /* X mode 0 */ - pP->x = sp_globals.x_pix; - break; - -case 1: /* X mode 1 */ - pP->x = -sp_globals.x_pix; - break; - -case 2: /* X mode 2 */ - pP->x = sp_globals.y_pix; - break; - -case 3: /* X mode 3 */ - pP->x = -sp_globals.y_pix; - break; - -default: /* X mode 4 */ -#endif - pP->x = (MULT16(sp_globals.x_orus, sp_globals.tcb.xxmult) + - MULT16(sp_globals.y_orus, sp_globals.tcb.xymult) + - sp_globals.tcb.xoffset) >> sp_globals.mpshift; -#if INCL_RULES - break; - } - -switch(sp_globals.tcb.ymode) - { -case 0: /* Y mode 0 */ - pP->y = sp_globals.y_pix; - break; - -case 1: /* Y mode 1 */ - pP->y = -sp_globals.y_pix; - break; - -case 2: /* Y mode 2 */ - pP->y = sp_globals.x_pix; - break; - -case 3: /* Y mode 3 */ - pP->y = -sp_globals.x_pix; - break; - -default: /* Y mode 4 */ -#endif - pP->y = (MULT16(sp_globals.x_orus, sp_globals.tcb.yxmult) + - MULT16(sp_globals.y_orus, sp_globals.tcb.yymult) + - sp_globals.tcb.yoffset) >> sp_globals.mpshift; -#if INCL_RULES - break; - } -#endif - -return pointer; -} - - - diff --git a/nx-X11/lib/font/Speedo/htest.c b/nx-X11/lib/font/Speedo/htest.c deleted file mode 100644 index 235b76560..000000000 --- a/nx-X11/lib/font/Speedo/htest.c +++ /dev/null @@ -1,361 +0,0 @@ -/* $Xorg: htest.c,v 1.3 2000/08/17 19:46:25 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ - -/****************************** H T E S T . C ******************************** - * * - * SPEEDO FONT HEADER TEST MODULE * - * * - ****************************************************************************/ - - -#include "speedo.h" /* General definition for make_bmap */ -#include - -#define DEBUG 0 - -#if DEBUG -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - -#define FONT_BUFFER_SIZE 1000 - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC VARIABLES *****/ -static char pathname[100]; /* Name of font file to be output */ -static ufix8 font_buffer[FONT_BUFFER_SIZE]; /* Font buffer */ -static FILE *fdescr; /* Speedo outline file descriptor */ - - - -FUNCTION main(argc,argv) -int argc; -char *argv[]; -{ -int bytes_read; /* Number of bytes read from font file */ -ufix8 tmpufix8; /* Temporary workspace */ -fix15 tmpfix15; /* Temporary workspace */ -ufix16 tmpufix16; /* Temporary workspace */ -ufix32 tmpufix32; /* Temporary workspace */ -ufix8 *pvt_header_org; /* Origin of provate header data */ - -ufix8 read_1b(); /* Read 1 byte field from font header */ -fix15 read_2b(); /* Read 2 byte field from font header */ -fix31 read_4b(); /* Read 4 byte field from font header */ - -if (argc != 2) - { - fprintf(stderr,"Usage: htest {fontfile}\n\n"); - exit (1); - } - -sprintf(pathname, argv[1]); - -/* Initialization */ -printf("\n SPEEDO FONT FILE HEADER DATA\n"); -printf(" -------------------------\n\n"); -/* Load Speedo outline file */ -fdescr = fopen (pathname, "rb"); -if (fdescr == NULL) - { - printf("****** Cannot open file %s\n", pathname); - return; - } - -bytes_read = fread(font_buffer, sizeof(ufix8), sizeof(font_buffer), fdescr); -if (bytes_read == 0) - { - printf("****** Error on reading %s: %x\n", pathname, bytes_read); - fclose(fdescr); - return; - } - -printf("Format Identifier ...................... %.4s\n", font_buffer + FH_FMVER); - -tmpufix32 = (ufix32)read_4b(font_buffer + FH_FMVER + 4); -printf("CR-LF-NULL-NULL data ............... %8.8lx %s\n", tmpufix32, (tmpufix32 != 0x0d0a0000)? "(incorrect)": " "); - -printf("Font Size .............................. %4ld\n", (ufix32)read_4b(font_buffer + FH_FNTSZ)); - -printf("Minimum Font Buffer Size ............... %4ld\n", (ufix32)read_4b(font_buffer + FH_FBFSZ)); - -printf("Minimum Character Buffer Size .......... %4d\n", (ufix16)read_2b(font_buffer + FH_CBFSZ)); - -printf("Header Size ............................ %4d\n", (ufix16)read_2b(font_buffer + FH_HEDSZ)); - -printf("Font ID ................................ %4.4d\n", (ufix16)read_2b(font_buffer + FH_FNTID)); - -printf("Font Version Number .................... %4d\n", (ufix16)read_1b(font_buffer + FH_SFVNR)); - -printf("Font Full Name:\n %.70s\n", font_buffer + FH_FNTNM); - -printf("Manufacturing Date ................ %10.10s\n", font_buffer + FH_MDATE); - -printf("Character Set Name:\n %s\n", font_buffer + FH_LAYNM); - -printf("Character Set ID: ...................... %.4s\n", font_buffer + FH_LAYNM + 66); - -printf("Copyright Notice:\n %.70s\n", font_buffer + FH_CPYRT); - -printf("Number of Char. Indexes in Char. Set ... %4d\n", (ufix16)read_2b(font_buffer + FH_NCHRL)); - -printf("Total number of Char. Indexes in Font .. %4d\n", (ufix16)read_2b(font_buffer + FH_NCHRF)); - -printf("Index of First Character ............... %4d\n", (ufix16)read_2b(font_buffer + FH_FCHRF)); - -printf("Number of Kerning Tracks ............... %4d\n", (ufix16)read_2b(font_buffer + FH_NKTKS)); - -printf("Number of Kerning Pairs ................ %4d\n", (ufix16)read_2b(font_buffer + FH_NKPRS)); - -printf("Font Flags:\n"); -tmpufix8 = read_1b(font_buffer + FH_FLAGS); -printf(" Extended font ...................... %s\n", (tmpufix8 & BIT0)? " Yes": " No"); - -printf("Classification Flags:\n"); -tmpufix8 = read_1b(font_buffer + FH_CLFGS); -printf(" Italic ............................. %s\n", (tmpufix8 & BIT0)? " Yes": " No"); -printf(" Monospace .......................... %s\n", (tmpufix8 & BIT1)? " Yes": " No"); -printf(" Serif .............................. %s\n", (tmpufix8 & BIT2)? " Yes": " No"); -printf(" Display ............................ %s\n", (tmpufix8 & BIT3)? " Yes": " No"); - -tmpufix8 = read_1b(font_buffer + FH_FAMCL); -printf("Family Classification .................. %4d ", tmpufix8); -switch (tmpufix8) - { -case 0: - printf("(Don't care)\n"); - break; -case 1: - printf("(Serif)\n"); - break; -case 2: - printf("(Sans serif)\n"); - break; -case 3: - printf("(Monospace)\n"); - break; -case 4: - printf("(Script or calligraphic)\n"); - break; -case 5: - printf("(Decorative)\n"); - break; -default: - printf("\n"); - break; - } - -printf("Font Form Classification:\n"); -tmpufix8 = read_1b(font_buffer + FH_FRMCL); -printf(" Width Type ......................... %4d ", (tmpufix8 & 0x0f)); -switch (tmpufix8 & 0x0f) - { -case 4: - printf("(Condensed)\n"); - break; -case 6: - printf("(Semi-condensed)\n"); - break; -case 8: - printf("(Normal)\n"); - break; -case 10: - printf("(Semi-expanded)\n"); - break; -case 12: - printf("(Expanded)\n"); - break; -default: - printf("\n"); - break; - } -printf(" Weight ............................. %4d ", (tmpufix8 >> 4)); -switch (tmpufix8 >> 4) - { -case 1: - printf("(Thin)\n"); - break; -case 2: - printf("(Ultralight)\n"); - break; -case 3: - printf("(Extra light)\n"); - break; -case 4: - printf("(Light)\n"); - break; -case 5: - printf("(Book)\n"); - break; -case 6: - printf("(Normal)\n"); - break; -case 7: - printf("(Medium)\n"); - break; -case 8: - printf("(Semibold)\n"); - break; -case 9: - printf("(Demibold)\n"); - break; -case 10: - printf("(Bold)\n"); - break; -case 11: - printf("(Extrabold)\n"); - break; -case 12: - printf("(Ultrabold)\n"); - break; -case 13: - printf("(Heavy)\n"); - break; -case 14: - printf("(Black)\n"); - break; -default: - printf("\n"); - break; - } - -printf("Short Font Name ........................ %.16s\n", font_buffer + FH_SFNTN); - -printf("Short Face Name ........................ %.16s\n", font_buffer + FH_SFACN); - -printf("Font Form .............................. %.14s\n", font_buffer + FH_FNTFM); - -printf("Italic Angle ........................... %7.2f\n", ((real)read_2b(font_buffer + FH_ITANG) / 256.0)); - -printf("ORUs per Em ............................ %4d\n", (ufix16)read_2b(font_buffer + FH_ORUPM)); - -printf("Width of Word Space .................... %4d\n", (ufix16)read_2b(font_buffer + FH_WDWTH)); - -printf("Width of Em Space ...................... %4d\n", (ufix16)read_2b(font_buffer + FH_EMWTH)); - -printf("Width of En Space ...................... %4d\n", (ufix16)read_2b(font_buffer + FH_ENWTH)); - -printf("Width of Thin Space .................... %4d\n", (ufix16)read_2b(font_buffer + FH_TNWTH)); - -printf("Width of Figure Space .................. %4d\n", (ufix16)read_2b(font_buffer + FH_FGWTH)); - -printf("Min X coordinate in font ............... %4d\n", (fix15)read_2b(font_buffer + FH_FXMIN)); - -printf("Min Y coordinate in font ............... %4d\n", (fix15)read_2b(font_buffer + FH_FYMIN)); - -printf("Max X coordinate in font ............... %4d\n", (fix15)read_2b(font_buffer + FH_FXMAX)); - -printf("Max Y coordinate in font ............... %4d\n", (fix15)read_2b(font_buffer + FH_FYMAX)); - -printf("Underline Position ..................... %4d\n", (fix15)read_2b(font_buffer + FH_ULPOS)); - -printf("Underline Thickness .................... %4d\n", (fix15)read_2b(font_buffer + FH_ULTHK)); - -printf("Small Caps Y position .................. %4d\n", (fix15)read_2b(font_buffer + FH_SMCTR)); -printf("Small Caps X scale ..................... %7.2f\n", ((real)read_2b(font_buffer + FH_SMCTR + 2) / 4096.0)); -printf("Small Caps Y scale ..................... %7.2f\n", ((real)(fix15)read_2b(font_buffer + FH_SMCTR + 4) / 4096.0)); - -printf("Display Superiors Y position ........... %4d\n", (fix15)read_2b(font_buffer + FH_SMCTR)); -printf("Display Superiors X scale .............. %7.2f\n", ((real)read_2b(font_buffer + FH_SMCTR + 2) / 4096.0)); -printf("Display Superiors Y scale .............. %7.2f\n", ((real)read_2b(font_buffer + FH_SMCTR + 4) / 4096.0)); - -printf("Footnote Superiors Y position .......... %4d\n", (fix15)read_2b(font_buffer + FH_FNSTR)); -printf("Footnote Superiors X scale ............. %7.2f\n", ((real)read_2b(font_buffer + FH_FNSTR + 2) / 4096.0)); -printf("Footnote Superiors Y scale ............. %7.2f\n", ((real)read_2b(font_buffer + FH_FNSTR + 4) / 4096.0)); - -printf("Alpha Superiors Y position ............. %4d\n", (fix15)read_2b(font_buffer + FH_ALSTR)); -printf("Alpha Superiors X scale ................ %7.2f\n", ((real)read_2b(font_buffer + FH_ALSTR + 2) / 4096.0)); -printf("Alpha Superiors Y scale ................ %7.2f\n", ((real)read_2b(font_buffer + FH_ALSTR + 4) / 4096.0)); - -printf("Chemical Inferiors Y position .......... %4d\n", (fix15)read_2b(font_buffer + FH_CMITR)); -printf("Chemical Inferiors X scale ............. %7.2f\n", ((real)read_2b(font_buffer + FH_CMITR + 2) / 4096.0)); -printf("Chemical Inferiors Y scale ............. %7.2f\n", ((real)read_2b(font_buffer + FH_CMITR + 4) / 4096.0)); - -printf("Small Numerators Y position ............ %4d\n", (fix15)read_2b(font_buffer + FH_SNMTR)); -printf("Small Numerators X scale ............... %7.2f\n", ((real)read_2b(font_buffer + FH_SNMTR + 2) / 4096.0)); -printf("Small Numerators Y scale ............... %7.2f\n", ((real)read_2b(font_buffer + FH_SNMTR + 4) / 4096.0)); - -printf("Small Denominators Y position .......... %4d\n", (fix15)read_2b(font_buffer + FH_SDNTR)); -printf("Small Denominators X scale ............. %7.2f\n", ((real)read_2b(font_buffer + FH_SDNTR + 2) / 4096.0)); -printf("Small Denominators Y scale ............. %7.2f\n", ((real)read_2b(font_buffer + FH_SDNTR + 4) / 4096.0)); - -printf("Medium Numerators Y position ........... %4d\n", (fix15)read_2b(font_buffer + FH_MNMTR)); -printf("Medium Numerators X scale .............. %7.2f\n", ((real)read_2b(font_buffer + FH_MNMTR + 2) / 4096.0)); -printf("Medium Numerators Y scale .............. %7.2f\n", ((real)read_2b(font_buffer + FH_MNMTR + 4) / 4096.0)); - -printf("Medium Denominators Y position ......... %4d\n", (fix15)read_2b(font_buffer + FH_MDNTR)); -printf("Medium Denominators X scale ............ %7.2f\n", ((real)read_2b(font_buffer + FH_MDNTR + 2) / 4096.0)); -printf("Medium Denominators Y scale ............ %7.2f\n", ((real)read_2b(font_buffer + FH_MDNTR + 4) / 4096.0)); - -printf("Large Numerators Y position ............ %4d\n", (fix15)read_2b(font_buffer + FH_LNMTR)); -printf("Large Numerators X scale ............... %7.2f\n", ((real)read_2b(font_buffer + FH_LNMTR + 2) / 4096.0)); -printf("Large Numerators Y scale ............... %7.2f\n", ((real)read_2b(font_buffer + FH_LNMTR + 4) / 4096.0)); - -printf("Large Denominators Y position .......... %4d\n", (fix15)read_2b(font_buffer + FH_LDNTR)); -printf("Large Denominators X scale ............. %7.2f\n", ((real)read_2b(font_buffer + FH_LDNTR + 2) / 4096.0)); -printf("Large Denominators Y scale ............. %7.2f\n", ((real)read_2b(font_buffer + FH_LDNTR + 4) / 4096.0)); - -fclose(fdescr); -} - - -FUNCTION ufix8 read_1b(pointer) -ufix8 *pointer; -/* - * Reads 1-byte field from font buffer - */ -{ -return *pointer; -} - -FUNCTION fix15 read_2b(pointer) -ufix8 *pointer; -/* - * Reads 2-byte field from font buffer - */ -{ -fix31 temp; - -temp = *pointer++; -temp = (temp << 8) + *(pointer); -return temp; -} - -FUNCTION fix31 read_4b(pointer) -ufix8 *pointer; -/* - * Reads 4-byte field from font buffer - */ -{ -fix31 temp; - -temp = *pointer++; -temp = (temp << 8) + *(pointer++); -temp = (temp << 8) + *(pointer++); -temp = (temp << 8) + *(pointer); -return temp; -} - diff --git a/nx-X11/lib/font/Speedo/iface.c b/nx-X11/lib/font/Speedo/iface.c deleted file mode 100644 index 1dad5ae48..000000000 --- a/nx-X11/lib/font/Speedo/iface.c +++ /dev/null @@ -1,650 +0,0 @@ -/* $Xorg: iface.c,v 1.3 2000/08/17 19:46:25 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/iface.c,v 1.2 1998/07/25 06:56:53 dawes Exp $ */ - -/***************************** I F A C E . C ********************************* - * * - * This module provides a layer to make Speedo function calls to and * - * from it compatible with Fontware 2.X function calls. * - * * - ****************************************************************************/ - -#include "speedo.h" /* General definitions for Speedo */ -#ifndef FONTMODULE -#include -#else -#include "xf86_ansic.h" -#endif - -#define DEBUG 0 - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - -#define PI 3.1415926536 /* pi */ -#define PTPERINCH 72.2892 /* nbr points per inch, exactly! */ - -#define BIT8 0x0100 -#define BIT9 0x0200 -#define BIT10 0x0400 -#define BIT11 0x0800 -#define BIT12 0x1000 -#define BIT13 0x2000 -#define BIT14 0x4000 -#define BIT15 0x8000 - -#define READ 0 - -typedef short bool16; -typedef int bool; - -typedef -struct - { - bool16 left; - bool16 right; - bool16 top; - bool16 bottom; - } lrtb; - - -typedef -struct - { - buff_t *pfont; /* Pointer to font data */ - ufix16 mode; /* what mode is the font generator in */ - real point_size_x; /* Point size in X dimension */ - real point_size_y; /* Point size in Y dimension */ - real res_hor; /* Horizontal resolution of output device */ - real res_ver; /* Vertical resolution of output device */ - real rot_angle; /* Rotation angle in degrees (clockwise) */ - real obl_angle; /* Obliquing angle in degrees (clockwise) */ - bool16 whitewrite; /* if T, generate bitmaps for whitewriters */ - fix15 thresh; /* Scan conversion threshold * - * Thickens characters on each edge by * - * sub-pixels */ - bool16 import_widths; /* Use imported width table */ - lrtb clip; /* Clip to standard character cell */ - lrtb squeeze; /* Squeeze to standard character cell */ - bool16 bogus_mode; /* if T, ignore plaid data */ - } comp_char_desc; /* character attributes for scan conv */ - -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - fw_reset(); /* Fontware 2.X reset call */ - fw_set_specs(); /* Fontware 2.X set specs call */ -bool fw_make_char(); /* Fontware 2.X make character call */ - -/***** EXTERNAL VARIABLES *****/ - -/***** EXTERNAL FUNCTIONS *****/ -void _open_bitmap(); -void _close_bitmap(); -void _set_bitmap_bits(); -void _open_outline(); -void _open_outline(); -void _start_new_char(); -void _start_curve(); -void _line_to(); -void _close_curve(); -void _close_outline(); - -/***** STATIC VARIABLES *****/ -static specs_t *pspecs; -static buff_t *pfont; -static buff_t char_data; -static fix15 set_width_x; -static specs_t specsarg; - -/***** STATIC FUNCTIONS *****/ -static fix31 make_mult(); - - -FUNCTION fw_reset() -{ -sp_reset(); -} - -FUNCTION fw_set_specs(pspecs) -comp_char_desc *pspecs; /* Pointer to scan conversion parameters structure */ - -/* Fontware 2.X character generator call to set font specifications - * compc -- pointer to structure containing scan conversion parameters. - * ->compf -- compressed font data structure - * ->point_size_x -- x pointsize - * ->point_size_y -- y pointsize - * ->res_hor -- horizontal pixels per inch - * ->res_ver -- vertical pixels per inch - * ->rot_angle -- rotation angle in degrees (clockwise) - * ->obl_angle -- obliquing angle in degrees (clockwise) - * ->whitewrite -- if true, generate bitmaps for whitewriters - * ->thresh -- scan-conversion threshold - * ->import_widths -- if true, use external width table - * ->clip.left -- clips min x at left of emsquare - * ->clip.right -- clips max x at right of emsquare - * ->clip.bottom -- clips min x at bottom of emsquare - * ->clip.top -- clips max x at top of emsquare - * ->squeeze.left -- squeezes min x at left of emsquare - * ->squeeze.right, .top, .bottom &c - * ->sw_fixed -- if TRUE, match pixel widths to scaled outline widths - * ->bogus_mode -- ignore plaid data if TRUE - */ - -{ -fix15 irot; -fix15 iobl; -fix15 x_trans_type; -fix15 y_trans_type; -fix31 xx_mult; -fix31 xy_mult; -fix31 yx_mult; -fix31 yy_mult; -real sinrot, cosrot, tanobl; -real x_distortion; -real pixperem_h; -real pixperem_v; -real point_size_x; -real point_size_y; -real res_hor; -real res_ver; -fix15 mode; - -specsarg.pfont = pspecs->pfont; - -irot = floor(pspecs->rot_angle + 0.5); -iobl = floor(pspecs->obl_angle + 0.5); -if (iobl > 85) - iobl = 85; -if (iobl < -85) - iobl = -85; -if ((irot % 90) == 0) - { - x_trans_type = y_trans_type = irot / 90 & 0x0003; - if (iobl != 0) - { - if (x_trans_type & 0x01) - y_trans_type = 4; - else - x_trans_type = 4; - } - } -else if (((irot + iobl) % 90) == 0) - { - x_trans_type = y_trans_type = (irot + iobl) / 90 & 0x0003; - if (iobl != 0) - { - if (x_trans_type & 0x01) - x_trans_type = 4; - else - y_trans_type = 4; - } - } -else - { - x_trans_type = y_trans_type = 4; - } - -point_size_x = pspecs->point_size_x; -point_size_y = pspecs->point_size_y; -res_hor = pspecs->res_hor; -res_ver = pspecs->res_ver; - -switch (x_trans_type) - { -case 0: - xx_mult = make_mult(point_size_x, res_hor); - xy_mult = 0; - break; - -case 1: - xx_mult = 0; - xy_mult = make_mult(point_size_y, res_hor); - break; - -case 2: - xx_mult = -make_mult(point_size_x, res_hor); - xy_mult = 0; - break; - -case 3: - xx_mult = 0; - xy_mult = -make_mult(point_size_y, res_hor); - break; - -default: - sinrot = sin((real)irot * PI / 180.); - cosrot = cos((real)irot * PI / 180.); - tanobl = tan((real)iobl * PI / 180.); - x_distortion = point_size_x / point_size_y; - pixperem_h = point_size_y * res_hor / (real)PTPERINCH; /* this is NOT a bug */ - xx_mult = floor(cosrot * x_distortion * pixperem_h * 65536.0 + 0.5); - xy_mult = floor((sinrot + cosrot * tanobl) * pixperem_h * 65536.0 + 0.5); - break; - } - -switch (y_trans_type) - { -case 0: - yx_mult = 0; - yy_mult = make_mult(point_size_y, res_ver); - break; - -case 1: - yx_mult = -make_mult(point_size_x, res_hor); - yy_mult = 0; - break; - -case 2: - yx_mult = 0; - yy_mult = -make_mult(point_size_y, res_ver); - break; - -case 3: - yx_mult = make_mult(point_size_x, res_ver); - yy_mult = 0; - break; - -default: - sinrot = sin((real)irot * PI / 180.); - cosrot = cos((real)irot * PI / 180.); - tanobl = tan((real)iobl * PI / 180.); - x_distortion = point_size_x / point_size_y; - pixperem_v = point_size_y * res_ver / (real)PTPERINCH; - yx_mult = floor(-sinrot * x_distortion * pixperem_v * 65536.0 + 0.5); - yy_mult = floor((cosrot - sinrot * tanobl) * pixperem_v * 65536.0 + 0.5); - break; - } - -specsarg.xxmult = xx_mult; -specsarg.xymult = xy_mult; -specsarg.xoffset = 0; -specsarg.yxmult = yx_mult; -specsarg.yymult = yy_mult; -specsarg.yoffset = 0; -specsarg.out_info = 0; - -/* Select processing mode */ -switch (pspecs->mode) - { -case 1: - if (pspecs->whitewrite) /* White-write requested? */ - { - mode = 1; - } - else - { - mode = 0; - } - break; - -case 2: - mode = 2; - break; - -default: - mode = pspecs->mode; - break; - } - -if (pspecs->bogus_mode) /* Linear transformation requested? */ - { - mode |= BIT4; /* Set linear tranformation flag */ - } - -if (pspecs->import_widths) /* Imported widths requested? */ - { - mode |= BIT6; /* Set imported width flag */ - } - -if (pspecs->clip.left) /* Clip left requested? */ - { - mode |= BIT8; /* Set clip left flag */ - } - -if (pspecs->clip.right) /* Clip right requested? */ - { - mode |= BIT9; /* Set clip right flag */ - } - -if (pspecs->clip.top) /* Clip top requested? */ - { - mode |= BIT10; /* Set clip top flag */ - } - -if (pspecs->clip.bottom) /* Clip bottom requested? */ - { - mode |= BIT11; /* Set clip bottom flag */ - } - -if (pspecs->squeeze.left) /* Squeeze left requested? */ - { - mode |= BIT12; /* Set squeeze left flag */ - } - -if (pspecs->squeeze.right) /* Squeeze right requested? */ - { - mode |= BIT13; /* Set squeeze right flag */ - } - -if (pspecs->squeeze.top) /* Squeeze top requested? */ - { - mode |= BIT14; /* Set squeeze top flag */ - } - -if (pspecs->squeeze.bottom) /* Squeeze bottom requested? */ - { - mode |= BIT15; /* Set squeeze bottom flag */ - } - -specsarg.flags = mode; - -sp_set_specs(&specsarg); -} - -FUNCTION static fix31 make_mult(point_size, resolution) -real point_size; -real resolution; -{ -real ms_factor; - -return (fix31)floor((point_size * resolution * 65536.0) / (real)PTPERINCH + 0.5); -} - -FUNCTION bool fw_make_char(char_index) -ufix16 char_index; -{ -return sp_make_char(char_index); -} - -FUNCTION buff_t *sp_load_char_data(file_offset, no_bytes, cb_offset) -fix31 file_offset; -fix15 no_bytes; -fix15 cb_offset; -/* - * Called by Speedo character generator to request that character - * data be loaded from the font file. - * This is a dummy function that assumes that the entire font has - * been loaded. - */ -{ -#if DEBUG -printf("load_char_data(%d, %d, %d)\n", file_offset, no_bytes, char_offset); -#endif -char_data.org = pfont->org + file_offset; -char_data.no_bytes = no_bytes; -return &char_data; -} - -FUNCTION void sp_report_error(n) -fix15 n; /* Error identification number */ -/* - * Called by Speedo character generator to report an error. - */ -{ -switch(n) - { -case 1: - printf("Insufficient font data loaded\n"); - break; - -case 3: - printf("Transformation matrix out of range\n"); - break; - -case 4: - printf("Font format error\n"); - break; - -case 5: - printf("Requested specs not compatible with output module\n"); - break; - -case 7: - printf("Intelligent transformation requested but not supported\n"); - break; - -case 8: - printf("Unsupported output mode requested\n"); - break; - -case 9: - printf("Extended font loaded but only compact fonts supported\n"); - break; - -case 10: - printf("Font specs not set prior to use of font\n"); - break; - -case 12: - printf("Character data not available()\n"); - break; - -case 13: - printf("Track kerning data not available()\n"); - break; - -case 14: - printf("Pair kerning data not available()\n"); - break; - -default: - printf("report_error(%d)\n", n); - break; - } -} - - - -FUNCTION void sp_open_bitmap(sw_x, sw_y, xorg, yorg, xsize, ysize) -fix31 sw_x; /* X component of escapement vector */ -fix31 sw_y; /* Y component of escapement vector */ -fix31 xorg; /* X origin */ -fix31 yorg; /* Y origin */ -fix15 xsize; /* width of bitmap */ -fix15 ysize; /* height of bitmap */ -/* - * Called by Speedo character generator to initialize a buffer prior - * to receiving bitmap data. - */ -{ - -fix15 xmin,xmax,ymin,ymax; - -#if DEBUG -printf("sp_open_bitmap:\n"); -printf(" X component of set width vector = %3.1f\n", (real)sw_x / 65536.0); -printf(" Y component of set width vector = %3.1f\n", (real)sw_y / 65536.0); -printf(" Bounding box is (%d, %d, %d, %d)\n", xmin, ymin, xmax, ymax); -#endif - -xmin = xorg >> 16; -ymin = yorg >> 16; -xmax = xmin + xsize; -ymax = ymin + ysize; - -set_width_x = ((sw_x >> 15) + 1) >> 1; -open_bitmap(set_width_x, xmin, xmax, ymin, ymax); -} - -FUNCTION void sp_set_bitmap_bits(y, x1, x2) -fix15 y, x1, x2; -/* - * Called by Speedo character generator to write one row of pixels - * into the generated bitmap character. - */ -{ -#if DEBUG -printf("set_bitmap_bits(%d, %d, %d)\n", y, x1, x2); -#endif - -set_bitmap_bits(y, x1, x2); -} - -FUNCTION void sp_close_bitmap() -/* - * Called by Speedo character generator to indicate all bitmap data - * has been generated. - */ -{ -#if DEBUG -printf("close_bitmap()\n"); -#endif - -close_bitmap(); -} - -FUNCTION void sp_open_outline(sw_x, sw_y, xmin, xmax, ymin, ymax) -fix31 sw_x; /* X component of escapement vector */ -fix31 sw_y; /* Y component of escapement vector */ -fix31 xmin; /* Minimum X value in outline */ -fix31 xmax; /* Maximum X value in outline */ -fix31 ymin; /* Minimum Y value in outline */ -fix31 ymax; /* Maximum Y value in outline */ -/* - * Called by Speedo character generator to initialize prior to - * outputting scaled outline data. - */ -{ -#if DEBUG -printf("open_outline(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f)\n", - (real)sw_x / 65536.0, (real)sw_y / 65536.0, - (real)xmin / 65536.0, (real)xmax / 65536.0, (real)ymin / 65536.0, (real)ymax / 65536.0); -#endif - -set_width_x = ((sw_x >> 15) + 1) >> 1; -open_outline(set_width_x); -} - -FUNCTION void sp_start_new_char() -/* - * Called by Speedo character generator to initialize prior to - * outputting scaled outline data for a sub-character in a compound - * character. - */ -{ -#if DEBUG -printf("start_new_char()\n"); -#endif - -start_new_char(); -} - -FUNCTION void sp_start_contour(x, y, outside) -fix31 x; /* X coordinate of start point in 1/65536 pixels */ -fix31 y; /* Y coordinate of start point in 1/65536 pixels */ -boolean outside; /* TRUE if curve encloses ink (Counter-clockwise) */ -/* - * Called by Speedo character generator at the start of each contour - * in the outline data of the character. - */ -{ -real realx, realy; - -realx = (real)x / 65536.0; -realy = (real)y / 65536.0; - -#if DEBUG -printf("start_curve(%3.1f, %3.1f, %s)\n", - realx, realy, - outside? "outside": "inside"); -#endif - -start_curve(realx, realy, outside); -} - -FUNCTION void sp_curve_to(x1, y1, x2, y2, x3, y3) -fix31 x1; /* X coordinate of first control point in 1/65536 pixels */ -fix31 y1; /* Y coordinate of first control point in 1/65536 pixels */ -fix31 x2; /* X coordinate of second control point in 1/65536 pixels */ -fix31 y2; /* Y coordinate of second control point in 1/65536 pixels */ -fix31 x3; /* X coordinate of curve end point in 1/65536 pixels */ -fix31 y3; /* Y coordinate of curve end point in 1/65536 pixels */ -/* - * Called by Speedo character generator once for each curve in the - * scaled outline data of the character. This function is only called if curve - * output is enabled in the set_specs() call. - */ -{ -#if DEBUG -printf("curve_to(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f)\n", - (real)x1 / 65536.0, (real)y1 / 65536.0, - (real)x2 / 65536.0, (real)y2 / 65536.0, - (real)x3 / 65536.0, (real)y3 / 65536.0); -#endif -} - -FUNCTION void sp_line_to(x, y) -fix31 x; /* X coordinate of vector end point in 1/65536 pixels */ -fix31 y; /* Y coordinate of vector end point in 1/65536 pixels */ -/* - * Called by Speedo character generator onece for each vector in the - * scaled outline data for the character. This include curve data that has - * been sub-divided into vectors if curve output has not been enabled - * in the set_specs() call. - */ -{ -real realx, realy; - -realx = (real)x / 65536.0; -realy = (real)y / 65536.0; - -#if DEBUG -printf("line_to(%3.1f, %3.1f)\n", - realx, realy); -#endif - -line_to(realx, realy); -} - -FUNCTION void sp_close_contour() -/* - * Called by Speedo character generator at the end of each contour - * in the outline data of the character. - */ -{ -#if DEBUG -printf("close_curve()\n"); -#endif - -close_curve(); -} - -FUNCTION void sp_close_outline() -/* - * Called by Speedo character generator at the end of output of the - * scaled outline of the character. - */ -{ -#if DEBUG -printf("close_outline()\n"); -#endif - -close_outline(set_width_x); -} - diff --git a/nx-X11/lib/font/Speedo/keys.h b/nx-X11/lib/font/Speedo/keys.h deleted file mode 100644 index dd9d0bff7..000000000 --- a/nx-X11/lib/font/Speedo/keys.h +++ /dev/null @@ -1,56 +0,0 @@ -/* $Xorg: keys.h,v 1.3 2000/08/17 19:46:25 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ - - -/***** DECRYPTION KEY CONSTANTS (PC Platform) *****/ - -#define CUS0 432 /* Customer number */ - -#define KEY0 0 /* Decryption key 0 */ -#define KEY1 72 /* Decryption key 1 */ -#define KEY2 123 /* Decryption key 2 */ -#define KEY3 1 /* Decryption key 3 */ -#define KEY4 222 /* Decryption key 4 */ -#define KEY5 194 /* Decryption key 5 */ -#define KEY6 113 /* Decryption key 6 */ -#define KEY7 119 /* Decryption key 7 */ -#define KEY8 52 /* Decryption key 8 */ - -/***** DECRYPTION KEY CONSTANTS (Sample) *****/ - -#define XSAMPLEFONTS - -#define XCUS0 0 /* Customer number */ - -#define XKEY0 0 /* Decryption key 0 */ -#define XKEY1 0 /* Decryption key 1 */ -#define XKEY2 0 /* Decryption key 2 */ -#define XKEY3 0 /* Decryption key 3 */ -#define XKEY4 0 /* Decryption key 4 */ -#define XKEY5 0 /* Decryption key 5 */ -#define XKEY6 0 /* Decryption key 6 */ -#define XKEY7 0 /* Decryption key 7 */ -#define XKEY8 0 /* Decryption key 8 */ - - diff --git a/nx-X11/lib/font/Speedo/module/Imakefile b/nx-X11/lib/font/Speedo/module/Imakefile deleted file mode 100644 index e517707c5..000000000 --- a/nx-X11/lib/font/Speedo/module/Imakefile +++ /dev/null @@ -1,47 +0,0 @@ -XCOMM $XFree86: xc/lib/font/Speedo/module/Imakefile,v 1.5 1999/08/14 10:49:18 dawes Exp $ - -#define IHaveModules -#include - - INCLUDES = -I$(FONTINCSRC) -I../../include -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) -I../ - HEADERS = - DEFINES = -DFONTMODULE - - SPEEDOSRCS = do_char.c do_trns.c out_bl2d.c out_blk.c speedomod.c \ - out_scrn.c out_util.c reset.c set_spcs.c set_trns.c - SPEEDOOBJS = do_char.o do_trns.o out_bl2d.o out_blk.o speedomod.o \ - out_scrn.o out_util.o reset.o set_spcs.o set_trns.o - - SRCS = spfuncs.c spfile.c spinfo.c sperr.c spfont.c spglyph.c \ - spencode.c bics-unicode.c \ - $(SPEEDOSRCS) - OBJS = spfuncs.o spfile.o spinfo.o sperr.o spfont.o spglyph.o \ - spencode.o bics-unicode.o \ - $(SPEEDOOBJS) - -LinkSourceFile(bics-unicode.c,..) -LinkSourceFile(do_char.c,..) -LinkSourceFile(do_trns.c,..) -LinkSourceFile(out_bl2d.c,..) -LinkSourceFile(out_blk.c,..) -LinkSourceFile(out_scrn.c,..) -LinkSourceFile(out_util.c,..) -LinkSourceFile(reset.c,..) -LinkSourceFile(set_spcs.c,..) -LinkSourceFile(set_trns.c,..) -LinkSourceFile(spfuncs.c,..) -LinkSourceFile(spfile.c,..) -LinkSourceFile(spinfo.c,..) -LinkSourceFile(sperr.c,..) -LinkSourceFile(spfont.c,..) -LinkSourceFile(spglyph.c,..) -LinkSourceFile(spencode.c,..) - -ModuleObjectRule() -LibraryModuleTarget(speedo,$(OBJS)) -InstallLibraryModule(speedo,$(MODULEDIR),fonts) - -DependTarget() - -InstallDriverSDKLibraryModule(speedo,$(DRIVERSDKMODULEDIR),fonts) diff --git a/nx-X11/lib/font/Speedo/module/speedomod.c b/nx-X11/lib/font/Speedo/module/speedomod.c deleted file mode 100644 index 94820fe44..000000000 --- a/nx-X11/lib/font/Speedo/module/speedomod.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice 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 - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ -/* $XFree86: xc/lib/font/Speedo/module/speedomod.c,v 1.8 2001/09/04 13:49:16 dawes Exp $ */ - -#include "misc.h" - -#include -#include "xf86Module.h" - -static MODULESETUPPROTO(speedoSetup); - - /* - * This is the module data function that is accessed when loading - * libspeedo as a module. - */ - -static XF86ModuleVersionInfo VersRec = -{ - "speedo", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 1, - ABI_CLASS_FONT, /* A font module */ - ABI_FONT_VERSION, - MOD_CLASS_FONT, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData speedoModuleData = { &VersRec, speedoSetup, NULL }; - -extern void SpeedoRegisterFontFileFunctions(void); - -FontModule speedoModule = { - SpeedoRegisterFontFileFunctions, - "Speedo", - NULL -}; - -static pointer -speedoSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - speedoModule.module = module; - LoadFont(&speedoModule); - - /* Need a non-NULL return */ - return (pointer)1; -} diff --git a/nx-X11/lib/font/Speedo/nsample.c b/nx-X11/lib/font/Speedo/nsample.c deleted file mode 100644 index a90367f0a..000000000 --- a/nx-X11/lib/font/Speedo/nsample.c +++ /dev/null @@ -1,745 +0,0 @@ -/* $Xorg: nsample.c,v 1.3 2000/08/17 19:46:26 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ - - -/*************************** N S A M P L E . C ******************************* - * * - * SPEEDO CHARACTER GENERATOR TEST MODULE * - * * - * This is an illustration of what external resources are required to * - * load a Speedo outline and use the Speedo character generator to generate * - * bitmaps or scaled outlines according to the desired specification. * * - * * - * This program loads a Speedo outline, defines a set of character * - * generation specifications, generates bitmap (or outline) data for each * - * character in the font and prints them on the standard output. * - * * - * If the font buffer is too small to hold the entire font, the first * - * part of the font is loaded. Character data is then loaded dynamically * - * as required. * - * * - ****************************************************************************/ - -#include -#if PROTOS_AVAIL -#include -#include -#include -void main(int argc,char *argv[]); -#else -void* malloc(); -#endif - -#include "speedo.h" /* General definition for make_bmap */ -#include "keys.h" /* Font decryption keys */ - -#define DEBUG 0 - -#if DEBUG -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - -#define MAX_BITS 256 /* Max line length of generated bitmap */ - -/***** GLOBAL FUNCTIONS *****/ - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC FUNCTIONS *****/ - -#if PROTOS_AVAIL -fix31 read_4b(ufix8 FONTFAR *ptr); -fix15 read_2b(ufix8 FONTFAR *ptr); -#else -fix31 read_4b(); -fix15 read_2b(); -#endif -/***** STATIC VARIABLES *****/ -static char pathname[100]; /* Name of font file to be output */ -static ufix8 FONTFAR *font_buffer; /* Pointer to allocated Font buffer */ -static ufix8 FONTFAR *char_buffer; /* Pointer to allocate Character buffer */ -static buff_t font; /* Buffer descriptor for font data */ -#if INCL_LCD -static buff_t char_data; /* Buffer descriptor for character data */ -#endif -static FILE *fdescr; /* Speedo outline file descriptor */ -static ufix16 char_index; /* Index of character to be generated */ -static ufix16 char_id; /* Character ID */ -static ufix16 minchrsz; /* minimum character buffer size */ - -static ufix8 key[] = - { - KEY0, - KEY1, - KEY2, - KEY3, - KEY4, - KEY5, - KEY6, - KEY7, - KEY8 - }; /* Font decryption key */ - -static fix15 raswid; /* raster width */ -static fix15 rashgt; /* raster height */ -static fix15 offhor; /* horizontal offset from left edge of emsquare */ -static fix15 offver; /* vertical offset from baseline */ -static fix15 set_width; /* character set width */ -static fix15 y_cur; /* Current y value being generated and printed */ -static char line_of_bits[2 * MAX_BITS + 1]; /* Buffer for row of generated bits */ - -#if INCL_MULTIDEV -#if INCL_BLACK || INCL_SCREEN || INCL_2D -bitmap_t bfuncs = { sp_open_bitmap, sp_set_bitmap_bits, sp_close_bitmap }; -#endif -#if INCL_OUTLINE -outline_t ofuncs = { sp_open_outline, sp_start_new_char, sp_start_contour, sp_curve_to, - sp_line_to, sp_close_contour, sp_close_outline }; -#endif -#endif - - -ufix8 temp[16]; /* temp buffer for first 16 bytes of font */ - - -FUNCTION void main(argc,argv) -int argc; -char *argv[]; -{ -ufix16 bytes_read; /* Number of bytes read from font file */ -specs_t specs; /* Bundle of character generation specs */ -int first_char_index; /* Index of first character in font */ -int no_layout_chars; /* number of characters in layout */ -ufix32 i; -ufix32 minbufsz; /* minimum font buffer size to allocate */ -ufix16 cust_no; -ufix8 FONTFAR *byte_ptr; - -#if REENTRANT_ALLOC -SPEEDO_GLOBALS* sp_global_ptr; -#endif - - -if (argc != 2) - { - fprintf(stderr,"Usage: nsample {fontfile}\n\n"); - exit (1); - } - -sprintf(pathname, argv[1]); - -/* Load Speedo outline file */ -fdescr = fopen (pathname, "rb"); -if (fdescr == NULL) - { - printf("****** Cannot open file %s\n", pathname); - return; - } - -/* get minimum font buffer size - read first 16 bytes to get the minimum - size field from the header, then allocate buffer dynamically */ - -bytes_read = fread(temp, sizeof(ufix8), 16, fdescr); - -if (bytes_read != 16) - { - printf("****** Error on reading %s: %x\n", pathname, bytes_read); - fclose(fdescr); - return; - } -#if INCL_LCD -minbufsz = (ufix32)read_4b(temp+FH_FBFSZ); -#else -minbufsz = (ufix32)read_4b(temp+FH_FNTSZ); -if (minbufsz >= 0x10000) - { - printf("****** Cannot process fonts greater than 64K - use dynamic character loading configuration option\n"); - fclose(fdescr); - return; - } -#endif - -#if (defined(M_I86SM) || defined(M_I86MM)) -font_buffer = (ufix8 FONTFAR *)_fmalloc((ufix16)minbufsz); -#else -font_buffer = (ufix8 *)malloc((ufix16)minbufsz); -#endif - -if (font_buffer == NULL) - { - printf("****** Unable to allocate memory for font buffer\n"); - fclose(fdescr); - return; - } - -#if DEBUG -printf("Loading font file %s\n", pathname); -#endif - -fseek(fdescr, (ufix32)0, 0); -#if (defined(M_I86SM) || (defined(M_I86MM))) -byte_ptr = font_buffer; -for (i=0; i< minbufsz; i++){ - int ch; - ch = getc(fdescr); - if (ch == EOF) - {printf ("Premature EOF in reading font buffer, %ld bytes read\n",i); - exit(2);} - *byte_ptr=(ufix8)ch; - byte_ptr++; - } -bytes_read = i; -#else -bytes_read = fread((ufix8 *)font_buffer, sizeof(ufix8), (ufix16)minbufsz, fdescr); -if (bytes_read == 0) - { - printf("****** Error on reading %s: %x\n", pathname, bytes_read); - fclose(fdescr); - return; - } -#endif - -#if INCL_LCD -/* now allocate minimum character buffer */ - -minchrsz = read_2b(font_buffer+FH_CBFSZ); -#if (defined(M_I86SM) || (defined(M_I86MM))) -char_buffer = (ufix8 FONTFAR *)_fmalloc(minchrsz); -#else -char_buffer = (ufix8*)malloc(minchrsz); -#endif - -if (char_buffer == NULL) - { - printf("****** Unable to allocate memory for character buffer\n"); - fclose(fdescr); - return; - } -#endif - -#if DYNAMIC_ALLOC || REENTRANT_ALLOC - sp_global_ptr = (SPEEDO_GLOBALS *)malloc(sizeof(SPEEDO_GLOBALS)); - memset(sp_global_ptr,(ufix8)0,sizeof(SPEEDO_GLOBALS)); -#endif - - -/* Initialization */ -#if REENTRANT_ALLOC -sp_reset(sp_global_ptr); /* Reset Speedo character generator */ -#else -sp_reset(); /* Reset Speedo character generator */ -#endif - -font.org = font_buffer; -font.no_bytes = bytes_read; - -#if REENTRANT_ALLOC -if ((cust_no=sp_get_cust_no(sp_global_ptr,font)) != CUS0 && /* NOT STANDARD ENCRYPTION */ -#else -if ((cust_no=sp_get_cust_no(font)) != CUS0 && /* NOT STANDARD ENCRYPTION */ -#endif - cust_no != 0) - { -#if REENTRANT_ALLOC - printf("Unable to use fonts for customer number %d\n", - sp_get_cust_no(sp_global_ptr(font))); -#else - printf("Unable to use fonts for customer number %d\n", - sp_get_cust_no(font)); -#endif - fclose(fdescr); - return; - } - -#if INCL_KEYS -#if REENTRANT_ALLOC -sp_set_key(sp_global_ptr,key); /* Set decryption key */ -#else -sp_set_key(key); /* Set decryption key */ -#endif -#endif - -#if INCL_MULTIDEV -#if INCL_BLACK || INCL_SCREEN || INCL_2D -#if REENTRANT_ALLOC -sp_set_bitmap_device(sp_global_ptr,&bfuncs,sizeof(bfuncs)); /* Set decryption key */ -#else -sp_set_bitmap_device(&bfuncs,sizeof(bfuncs)); /* Set decryption key */ -#endif -#endif -#if INCL_OUTLINE -#if REENTRANT_ALLOC -sp_set_outline_device(sp_global_ptr,&ofuncs,sizeof(ofuncs)); /* Set decryption key */ -#else -sp_set_outline_device(&ofuncs,sizeof(ofuncs)); /* Set decryption key */ -#endif -#endif -#endif - -first_char_index = read_2b(font_buffer + FH_FCHRF); -no_layout_chars = read_2b(font_buffer + FH_NCHRL); - -/* Set specifications for character to be generated */ -specs.pfont = &font; /* Pointer to Speedo outline structure */ -specs.xxmult = 25L << 16; /* Coeff of X to calculate X pixels */ -specs.xymult = 0L << 16; /* Coeff of Y to calculate X pixels */ -specs.xoffset = 0L << 16; /* Position of X origin */ -specs.yxmult = 0L << 16; /* Coeff of X to calculate Y pixels */ -specs.yymult = 25L << 16; /* Coeff of Y to calculate Y pixels */ -specs.yoffset = 0L << 16; /* Position of Y origin */ -specs.flags = 0; /* Mode flags */ -specs.out_info = NULL; - - -#if REENTRANT_ALLOC -if (!sp_set_specs(sp_global_ptr,&specs)) /* Set character generation specifications */ -#else -if (!sp_set_specs(&specs)) /* Set character generation specifications */ -#endif - { - printf("****** Cannot set requested specs\n"); - } -else - { - for (i = 0; i < no_layout_chars; i++) /* For each character in font */ - { - char_index = i + first_char_index; -#if REENTRANT_ALLOC - char_id = sp_get_char_id(sp_global_ptr,char_index); -#else - char_id = sp_get_char_id(char_index); -#endif - if (char_id != 0) - { -#if REENTRANT_ALLOC - if (!sp_make_char(sp_global_ptr,char_index)) -#else - if (!sp_make_char(char_index)) -#endif - { - printf("****** Cannot generate character %d\n", char_index); - } - } - } - } - -fclose(fdescr); -} - -#if INCL_LCD -#if REENTRANT_ALLOC -FUNCTION buff_t *sp_load_char_data(sp_global_ptr, file_offset, no_bytes, cb_offset) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION buff_t *sp_load_char_data(file_offset, no_bytes, cb_offset) -#endif -fix31 file_offset; /* Offset in bytes from the start of the font file */ -fix15 no_bytes; /* Number of bytes to be loaded */ -fix15 cb_offset; /* Offset in bytes from start of char buffer */ -/* - * Called by Speedo character generator to request that character - * data be loaded from the font file into a character data buffer. - * The character buffer offset is zero for all characters except elements - * of compound characters. If a single buffer is allocated for character - * data, cb_offset ensures that sub-character data is loaded after the - * top-level compound character. - * Returns a pointer to a buffer descriptor. - */ -{ -int bytes_read; - -#if DEBUG -printf("\nCharacter data(%d, %d, %d) requested\n", file_offset, no_bytes, cb_offset); -#endif -if (fseek(fdescr, (long)file_offset, (int)0) != 0) - { - printf("****** Error in seeking character\n"); - fclose(fdescr); - exit(1); - } - -if ((no_bytes + cb_offset) > minchrsz) - { - printf("****** Character buffer overflow\n"); - fclose(fdescr); - exit(3); - } - -bytes_read = fread((char_buffer + cb_offset), sizeof(ufix8), no_bytes, fdescr); -if (bytes_read != no_bytes) - { - printf("****** Error on reading character data\n"); - fclose(fdescr); - exit(2); - } - -#if DEBUG -printf("Character data loaded\n"); -#endif - -char_data.org = (ufix8 FONTFAR *)char_buffer + cb_offset; -char_data.no_bytes = no_bytes; -return &char_data; -} -#endif - - -#if REENTRANT_ALLOC -FUNCTION void sp_report_error(sp_global_ptr,n) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_report_error(n) -#endif -fix15 n; /* Error identification number */ -/* - * Called by Speedo character generator to report an error. - * - * Since character data not available is one of those errors - * that happens many times, don't report it to user - */ -{ - -switch(n) - { -case 1: - printf("Insufficient font data loaded\n"); - break; - -case 3: - printf("Transformation matrix out of range\n"); - break; - -case 4: - printf("Font format error\n"); - break; - -case 5: - printf("Requested specs not compatible with output module\n"); - break; - -case 7: - printf("Intelligent transformation requested but not supported\n"); - break; - -case 8: - printf("Unsupported output mode requested\n"); - break; - -case 9: - printf("Extended font loaded but only compact fonts supported\n"); - break; - -case 10: - printf("Font specs not set prior to use of font\n"); - break; - -case 12: - break; - -case 13: - printf("Track kerning data not available()\n"); - break; - -case 14: - printf("Pair kerning data not available()\n"); - break; - -default: - printf("report_error(%d)\n", n); - break; - } -} - -#if REENTRANT_ALLOC -FUNCTION void sp_open_bitmap(sp_global_ptr, x_set_width, y_set_width, xorg, yorg, xsize, ysize) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_open_bitmap(x_set_width, y_set_width, xorg, yorg, xsize, ysize) -#endif -fix31 x_set_width; -fix31 y_set_width; /* Set width vector */ -fix31 xorg; /* Pixel boundary at left extent of bitmap character */ -fix31 yorg; /* Pixel boundary at right extent of bitmap character */ -fix15 xsize; /* Pixel boundary of bottom extent of bitmap character */ -fix15 ysize; /* Pixel boundary of top extent of bitmap character */ -/* - * Called by Speedo character generator to initialize a buffer prior - * to receiving bitmap data. - */ -{ -fix15 i; - -#if DEBUG -printf("open_bitmap(%3.1f, %3.1f, %3.1f, %3.1f, %d, %d)\n", - (real)x_set_width / 65536.0, (real)y_set_width / 65536.0, - (real)xorg / 65536.0, (real)yorg / 65536.0, (int)xsize, (int)ysize); -#endif -raswid = xsize; -rashgt = ysize; -offhor = (fix15)(xorg >> 16); -offver = (fix15)(yorg >> 16); - -if (raswid > MAX_BITS) - raswid = MAX_BITS; - -printf("\nCharacter index = %d, ID = %d\n", char_index, char_id); -printf("set width = %3.1f, %3.1f\n", (real)x_set_width / 65536.0, (real)y_set_width / 65536.0); -printf("X offset = %d\n", offhor); -printf("Y offset = %d\n\n", offver); -for (i = 0; i < raswid; i++) - { - line_of_bits[i << 1] = '.'; - line_of_bits[(i << 1) + 1] = ' '; - } -line_of_bits[raswid << 1] = '\0'; -y_cur = 0; -} - -#if REENTRANT_ALLOC -FUNCTION void sp_set_bitmap_bits (sp_global_ptr, y, xbit1, xbit2) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_set_bitmap_bits (y, xbit1, xbit2) -#endif - fix15 y; /* Scan line (0 = first row above baseline) */ - fix15 xbit1; /* Pixel boundary where run starts */ - fix15 xbit2; /* Pixel boundary where run ends */ - -/* - * Called by Speedo character generator to write one row of pixels - * into the generated bitmap character. - */ - -{ -fix15 i; - -#if DEBUG -printf("set_bitmap_bits(%d, %d, %d)\n", (int)y, (int)xbit1, (int)xbit2); -#endif -/* Clip runs beyond end of buffer */ -if (xbit1 > MAX_BITS) - xbit1 = MAX_BITS; - -if (xbit2 > MAX_BITS) - xbit2 = MAX_BITS; - -/* Output backlog lines if any */ -while (y_cur != y) - { - printf(" %s\n", line_of_bits); - for (i = 0; i < raswid; i++) - { - line_of_bits[i << 1] = '.'; - } - y_cur++; - } - -/* Add bits to current line */ -for (i = xbit1; i < xbit2; i++) - { - line_of_bits[i << 1] = 'X'; - } -} - -#if REENTRANT_ALLOC -FUNCTION void sp_close_bitmap(sp_global_ptr) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_close_bitmap() -#endif -/* - * Called by Speedo character generator to indicate all bitmap data - * has been generated. - */ -{ -#if DEBUG -printf("close_bitmap()\n"); -#endif -printf(" %s\n", line_of_bits); -} - -#if INCL_OUTLINE -#if REENTRANT_ALLOC -FUNCTION void sp_open_outline(sp_global_ptr, x_set_width, y_set_width, xmin, xmax, ymin, ymax) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#endif -fix31 x_set_width; -fix31 y_set_width; /* Transformed escapement vector */ -fix31 xmin; /* Minimum X value in outline */ -fix31 xmax; /* Maximum X value in outline */ -fix31 ymin; /* Minimum Y value in outline */ -fix31 ymax; /* Maximum Y value in outline */ -/* - * Called by Speedo character generator to initialize prior to - * outputting scaled outline data. - */ -{ -printf("\nopen_outline(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f)\n", - (real)x_set_width / 65536.0, (real)y_set_width / 65536.0, - (real)xmin / 65536.0, (real)xmax / 65536.0, (real)ymin / 65536.0, (real)ymax / 65536.0); -} - - -#if REENTRANT_ALLOC -FUNCTION void sp_start_new_char(sp_global_ptr) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_start_new_char() -#endif -/* - * Called by Speedo character generator to initialize prior to - * outputting scaled outline data for a sub-character in a compound - * character. - */ -{ -printf("start_new_char()\n"); -} - -#if REENTRANT_ALLOC -FUNCTION void sp_start_contour(sp_global_ptr, x, y, outside) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_start_contour(x, y, outside) -#endif -fix31 x; /* X coordinate of start point in 1/65536 pixels */ -fix31 y; /* Y coordinate of start point in 1/65536 pixels */ -boolean outside; /* TRUE if curve encloses ink (Counter-clockwise) */ -/* - * Called by Speedo character generator at the start of each contour - * in the outline data of the character. - */ -{ -printf("start_contour(%3.1f, %3.1f, %s)\n", - (real)x / 65536.0, (real)y / 65536.0, - outside? "outside": "inside"); -} - -#if REENTRANT_ALLOC -FUNCTION void sp_curve_to(sp_global_ptr, x1, y1, x2, y2, x3, y3) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_curve_to(x1, y1, x2, y2, x3, y3) -#endif -fix31 x1; /* X coordinate of first control point in 1/65536 pixels */ -fix31 y1; /* Y coordinate of first control point in 1/65536 pixels */ -fix31 x2; /* X coordinate of second control point in 1/65536 pixels */ -fix31 y2; /* Y coordinate of second control point in 1/65536 pixels */ -fix31 x3; /* X coordinate of curve end point in 1/65536 pixels */ -fix31 y3; /* Y coordinate of curve end point in 1/65536 pixels */ -/* - * Called by Speedo character generator onece for each curve in the - * scaled outline data of the character. This function is only called if curve - * output is enabled in the set_specs() call. - */ -{ -printf("curve_to(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f)\n", - (real)x1 / 65536.0, (real)y1 / 65536.0, - (real)x2 / 65536.0, (real)y2 / 65536.0, - (real)x3 / 65536.0, (real)y3 / 65536.0); -} - -#if REENTRANT_ALLOC -FUNCTION void sp_line_to(sp_global_ptr, x, y) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_line_to(x, y) -#endif -fix31 x; /* X coordinate of vector end point in 1/65536 pixels */ -fix31 y; /* Y coordinate of vector end point in 1/65536 pixels */ -/* - * Called by Speedo character generator onece for each vector in the - * scaled outline data for the character. This include curve data that has - * been sub-divided into vectors if curve output has not been enabled - * in the set_specs() call. - */ -{ -printf("line_to(%3.1f, %3.1f)\n", - (real)x / 65536.0, (real)y / 65536.0); -} - - -#if REENTRANT_ALLOC -FUNCTION void sp_close_contour(sp_global_ptr) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_close_contour() -#endif -/* - * Called by Speedo character generator at the end of each contour - * in the outline data of the character. - */ -{ -printf("close_contour()\n"); -} - -#if REENTRANT_ALLOC -FUNCTION void sp_close_outline(sp_global_ptr) -SPEEDO_GLOBALS *sp_global_ptr; -#else -FUNCTION void sp_close_outline() -#endif -/* - * Called by Speedo character generator at the end of output of the - * scaled outline of the character. - */ -{ -printf("close_outline()\n"); -} - -#endif - -FUNCTION fix15 read_2b(pointer) -ufix8 FONTFAR *pointer; -/* - * Reads 2-byte field from font buffer - */ -{ -fix15 temp; - -temp = *pointer++; -temp = (temp << 8) + *(pointer); -return temp; -} - - - FUNCTION fix31 read_4b(pointer) -ufix8 FONTFAR *pointer; -/* - * Reads 4-byte field from font buffer - */ -{ -fix31 temp; - -temp = *pointer++; -temp = (temp << 8) + *(pointer++); -temp = (temp << 8) + *(pointer++); -temp = (temp << 8) + *(pointer); -return temp; -} - - diff --git a/nx-X11/lib/font/Speedo/out_bl2d.c b/nx-X11/lib/font/Speedo/out_bl2d.c deleted file mode 100644 index 6c38cb30d..000000000 --- a/nx-X11/lib/font/Speedo/out_bl2d.c +++ /dev/null @@ -1,772 +0,0 @@ -/* $Xorg: out_bl2d.c,v 1.3 2000/08/17 19:46:26 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/out_bl2d.c,v 1.3 1999/02/07 11:47:14 dawes Exp $ */ - -/*************************** O U T _ B L 2 D . C ***************************** - * * - * This is an output module for screen writer using two dimensional scanning * - ****************************************************************************/ - - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spdo_prv.h" /* General definitions for speedo */ - -#define CLOCKWISE 1 -#define DEBUG 0 -#define ABS(X) ( (X < 0) ? -X : X) - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - -/***** EXTERNAL VARIABLES *****/ - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC VARIABLES *****/ - -/***** STATIC FUNCTIONS *****/ - -#if INCL_2D -static void sp_draw_vector_to_2d(PROTO_DECL2 fix15 x0,fix15 y0,fix15 x1,fix15 y1,band_t GLOBALFAR *band); -static void sp_add_intercept_2d(PROTO_DECL2 fix15 y,fix15 x); -static void sp_proc_intercepts_2d(PROTO_DECL1); -#endif - -#if INCL_2D -FUNCTION boolean init_2d( -GDECL -specs_t GLOBALFAR *specsarg) -/* - * init_out_2d() is called by sp_set_specs() to initialize the output module. - * Returns TRUE if output module can accept requested specifications. - * Returns FALSE otherwise. - */ -{ - -if (specsarg->flags & CURVES_OUT) - return FALSE; /* Curves out, clipping not supported */ - -#if DEBUG -printf("INIT_OUT__2d()\n"); -#endif -return TRUE; -} -#endif - -#if INCL_2D -FUNCTION boolean begin_char_2d( -GDECL -point_t Psw, -point_t Pmin, -point_t Pmax) -/* Called once at the start of the character generation process - * Initializes intercept table, either calculates pixel maxima or - * decides that they need to be collected - */ -{ -#if DEBUG -printf("BEGIN_CHAR__2d(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f\n", - (real)Psw.x / (real)sp_globals.onepix, (real)Psw.y / (real)sp_globals.onepix, - (real)Pmin.x / (real)sp_globals.onepix, (real)Pmin.y / (real)sp_globals.onepix, - (real)Pmax.x / (real)sp_globals.onepix, (real)Pmax.y / (real)sp_globals.onepix); -#endif -/* Convert PIX.FRAC to 16.16 form */ -sp_globals.x_scan_active = TRUE; /* Assume x-scanning from the start */ - -init_char_out(Psw,Pmin,Pmax); -return TRUE; -} -#endif - - -#if INCL_2D -FUNCTION void begin_contour_2d( -GDECL -point_t P1, -boolean outside) -/* Called at the start of each contour - */ -{ - -#if DEBUG -printf("BEGIN_CONTOUR__2d(%3.4f, %3.4f, %s)\n", - (real)P1.x / (real)sp_globals.onepix, - (real)P1.y / (real)sp_globals.onepix, - outside? "outside": "inside"); -#endif -sp_globals.x0_spxl = P1.x; -sp_globals.y0_spxl = P1.y; -} -#endif - -#if INCL_2D -FUNCTION void line_2d( -GDECL -point_t P1) -/* - * Called for each vector in the transformed character - * "draws" vector into intercept table - */ -{ - -#if DEBUG -printf("LINE_0(%3.4f, %3.4f)\n", - (real)P1.x / (real)sp_globals.onepix, - (real)P1.y / (real)sp_globals.onepix); -#endif - -if (sp_globals.extents_running) - { - if (sp_globals.x0_spxl > sp_globals.bmap_xmax) - sp_globals.bmap_xmax = sp_globals.x0_spxl; - if (sp_globals.x0_spxl < sp_globals.bmap_xmin) - sp_globals.bmap_xmin = sp_globals.x0_spxl; - if (sp_globals.y0_spxl > sp_globals.bmap_ymax) - sp_globals.bmap_ymax = sp_globals.y0_spxl; - if (sp_globals.y0_spxl < sp_globals.bmap_ymin) - sp_globals.bmap_ymin = sp_globals.y0_spxl; - } - -if (!sp_globals.intercept_oflo) - { - sp_draw_vector_to_2d(sp_globals.x0_spxl, - sp_globals.y0_spxl, - P1.x, - P1.y, - &sp_globals.y_band); /* y-scan */ - - if (sp_globals.x_scan_active) - sp_draw_vector_to_2d(sp_globals.y0_spxl, - sp_globals.x0_spxl, - P1.y, - P1.x, - &sp_globals.x_band); /* x-scan if selected */ - } - -sp_globals.x0_spxl = P1.x; -sp_globals.y0_spxl = P1.y; /* update endpoint */ -} - -FUNCTION static void sp_draw_vector_to_2d( -GDECL -fix15 x0, /* X coordinate */ -fix15 y0, /* Y coordinate */ -fix15 x1, -fix15 y1, -band_t GLOBALFAR *band) -{ -register fix15 how_many_y; /* # of intercepts at y = n + 1/2 */ -register fix15 yc; /* Current scan-line */ - fix15 temp1; /* various uses */ - fix15 temp2; /* various uses */ -register fix31 dx_dy; /* slope of line in 16.16 form */ -register fix31 xc; /* high-precision (16.16) x coordinate */ - fix15 y_pxl; - -yc = (y0 + sp_globals.pixrnd) >> sp_globals.pixshift; /* current scan line = end of last line */ -y_pxl = (y1 + sp_globals.pixrnd) >> sp_globals.pixshift; /* calculate new end-scan line */ - -if ((how_many_y = y_pxl - yc) == 0) return; /* Don't draw a null line */ - -if (how_many_y < 0) yc--; /* Predecrment downward lines */ - -if (yc > band->band_max) /* Is start point above band? */ - { - if (y_pxl > band->band_max) return; /* line has to go down! */ - how_many_y = y_pxl - (yc = band->band_max) - 1; /* Yes, limit it */ - } - -if (yc < band->band_min) /* Is start point below band? */ - { - if (y_pxl < band->band_min) return; /* line has to go up! */ - how_many_y = y_pxl - (yc = band->band_min); /* Yes, limit it */ - } - -xc = (fix31)(x0 + sp_globals.pixrnd) << 16; /* Original x coordinate with built in */ - /* rounding. int.16 + pixshift form */ - -if ( (temp1 = (x1 - x0)) == 0) /* check for vertical line */ - { - dx_dy = 0L; /* Zero slope, leave xc alone */ - goto skip_calc; - } - -/* calculate dx_dy at 16.16 fixed point */ - -dx_dy = ( (fix31)temp1 << 16 )/(fix31)(y1 - y0); - -/* We have to check for a @#$%@# possible multiply overflow */ -/* by doing another @#$*& multiply. In assembly language, */ -/* the program could just check the OVerflow flag or whatever*/ -/* works on the particular processor. This C code is meant */ -/* to be processor independent. */ - -temp1 = (yc << sp_globals.pixshift) - y0 + sp_globals.pixrnd; -/* This sees if the sign bits start at bit 15 */ -/* if they do, no overflow has occurred */ - -temp2 = (fix15)(MULT16(temp1,(fix15)(dx_dy >> 16)) >> 15); - -if ( (temp2 != (fix15)0xFFFF) && - (temp2 != 0x0000) ) - { /* Overflow. Pick point closest to yc + .5 */ - if (ABS(temp1) < ABS((yc << sp_globals.pixshift) - y1 + sp_globals.pixrnd)) - { /* use x1 instead of x0 */ - xc = (fix31)(x1 + sp_globals.pixrnd) << (16 - sp_globals.pixshift); - } - goto skip_calc; - } -/* calculate new xc at the center of the *current* scan line */ -/* due to banding, yc may be several lines away from y0 */ -/* xc += (yc + .5 - y0) * dx_dy */ -/* This multiply generates a subpixel delta. */ -/* So we leave it as an int.pixshift + 16 delta */ - -xc += (fix31)temp1 * dx_dy; -dx_dy <<= sp_globals.pixshift; -skip_calc: - -yc -= band->band_array_offset; /* yc is now an offset relative to the band */ - -if (how_many_y < 0) - { /* Vector down */ - if ((how_many_y += yc + 1) < band->band_floor) - how_many_y = band->band_floor; /* can't go below floor */ - while(yc >= how_many_y) - { - temp1 = (fix15)(xc >> 16); - sp_add_intercept_2d(yc--,temp1); - xc -= dx_dy; - } - } - else - { /* Vector up */ - /* check to see that line doesn't extend beyond top of band */ - if ((how_many_y += yc) > band->band_ceiling) - how_many_y = band->band_ceiling; - while(yc < how_many_y) - { - temp1 = (fix15)(xc >> 16); - sp_add_intercept_2d(yc++,temp1); - xc += dx_dy; - } - } -} - -#endif - -#if INCL_2D -FUNCTION boolean end_char_2d() -/* Called when all character data has been output - * Return TRUE if output process is complete - * Return FALSE to repeat output of the transformed data beginning - * with the first contour - */ -{ - -fix31 xorg; -fix31 yorg; -#if INCL_CLIPPING -fix31 em_max, em_min, bmap_max, bmap_min; -#endif - -#if DEBUG -printf("END_CHAR__2d()\n"); -#endif - -if (sp_globals.first_pass) - { - if (sp_globals.bmap_xmax >= sp_globals.bmap_xmin) - { - sp_globals.xmin = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - sp_globals.xmax = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift; - } - else - { - sp_globals.xmin = sp_globals.xmax = 0; - } - if (sp_globals.bmap_ymax >= sp_globals.bmap_ymin) - { - -#if INCL_CLIPPING - switch(sp_globals.tcb0.xtype) - { - case 1: /* 180 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_min = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - sp_globals.clip_ymin = -1 * sp_globals.clip_ymin; - if (bmap_min < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - else - sp_globals.ymin = bmap_min; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift; - if (bmap_max < sp_globals.clip_ymax) - sp_globals.ymax = bmap_max; - else - sp_globals.ymax = sp_globals.clip_ymax; - } - sp_globals.clip_xmax = -sp_globals.xmin; - sp_globals.clip_xmin = ((sp_globals.set_width.x+32768L) >> 16) - - sp_globals.xmin; - break; - case 2: /* 90 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_xmin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_xmin = -1 * sp_globals.clip_xmin; - bmap_min = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - if (bmap_min > sp_globals.clip_xmin) - sp_globals.clip_xmin = bmap_min; - - /* normalize to x origin */ - sp_globals.clip_xmin -= sp_globals.xmin; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_xmax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift; - if (bmap_max < sp_globals.clip_xmax) - sp_globals.xmax = bmap_max; - else - sp_globals.xmax = sp_globals.clip_xmax; - sp_globals.clip_ymax = 0; - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - /* normalize to x origin */ - sp_globals.clip_xmax -= sp_globals.xmin; - } - break; - case 3: /* 270 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_xmin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_xmin = -1 * sp_globals.clip_xmin; - bmap_min = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - - /* let the minimum be the larger of these two values */ - if (bmap_min > sp_globals.clip_xmin) - sp_globals.clip_xmin = bmap_min; - - /* normalize the x value to new xorgin */ - sp_globals.clip_xmin -= sp_globals.xmin; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_xmax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift; - - /* let the max be the lesser of these two values */ - if (bmap_max < sp_globals.clip_xmax) - { - sp_globals.xmax = bmap_max; - sp_globals.clip_xmax = bmap_max; - } - else - sp_globals.xmax = sp_globals.clip_xmax; - - /* normalize the x value to new x origin */ - sp_globals.clip_xmax -= sp_globals.xmin; - } - /* compute y clip values */ - sp_globals.clip_ymax = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = 0; - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - break; - default: /* this is for zero degree rotation and arbitrary rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift; - if (bmap_max > sp_globals.clip_ymax) - sp_globals.ymax = bmap_max; - else - sp_globals.ymax = sp_globals.clip_ymax; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_ymin = - sp_globals.clip_ymin; - bmap_min = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - if (bmap_min < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - else - sp_globals.ymin = bmap_min; - } - sp_globals.clip_xmin = -sp_globals.xmin; - sp_globals.clip_xmax = ((sp_globals.set_width.x+32768L) >> 16) - - sp_globals.xmin; - break; - } -if ( !(sp_globals.specs.flags & CLIP_TOP)) -#endif - sp_globals.ymax = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift; - -#if INCL_CLIPPING -if ( !(sp_globals.specs.flags & CLIP_BOTTOM)) -#endif - sp_globals.ymin = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - } - else - { - sp_globals.ymin = sp_globals.ymax = 0; - } - - /* add in the rounded out part (from xform.) of the left edge */ - if (sp_globals.tcb.xmode == 0) /* for X pix is function of X orus only add the round */ - xorg = (((fix31)sp_globals.xmin << 16) + (sp_globals.rnd_xmin << sp_globals.poshift)); - else - if (sp_globals.tcb.xmode == 1) /* for X pix is function of -X orus only, subtr. round */ - xorg = (((fix31)sp_globals.xmin << 16) - (sp_globals.rnd_xmin << sp_globals.poshift)) ; - else - xorg = (fix31)sp_globals.xmin << 16; /* for other cases don't use round on x */ - - if (sp_globals.tcb.ymode == 2) /* for Y pix is function of X orus only, add round error */ - yorg = (((fix31)sp_globals.ymin << 16) + (sp_globals.rnd_xmin << sp_globals.poshift)); - else - if (sp_globals.tcb.ymode == 3) /* for Y pix is function of -X orus only, sub round */ - yorg = (((fix31)sp_globals.ymin << 16) - (sp_globals.rnd_xmin << sp_globals.poshift)); - else /* all other cases have no round error on yorg */ - yorg = (fix31)sp_globals.ymin << 16; - - open_bitmap(sp_globals.set_width.x, sp_globals.set_width.y, xorg, yorg, - sp_globals.xmax - sp_globals.xmin, sp_globals.ymax - sp_globals.ymin); - if (sp_globals.intercept_oflo) - { - sp_globals.y_band.band_min = sp_globals.ymin; - sp_globals.y_band.band_max = sp_globals.ymax; - sp_globals.x_scan_active = FALSE; - sp_globals.no_x_lists = 0; - init_intercepts_out(); - sp_globals.first_pass = FALSE; - sp_globals.extents_running = FALSE; - return FALSE; - } - else - { - sp_proc_intercepts_2d(); - close_bitmap(); - return TRUE; - } - } -else - { - if (sp_globals.intercept_oflo) - { - reduce_band_size_out(); - init_intercepts_out(); - return FALSE; - } - else - { - sp_proc_intercepts_2d(); - if (next_band_out()) - { - init_intercepts_out(); - return FALSE; - } - close_bitmap(); - return TRUE; - } - } -} -#endif - -#if INCL_2D -FUNCTION static void sp_add_intercept_2d( -GDECL -fix15 y, /* Y coordinate in relative pixel units */ - /* (0 is lowest sample in band) */ -fix15 x) /* X coordinate of intercept in subpixel units */ - -/* Called by line() to add an intercept to the intercept list structure - */ - -{ -register fix15 from; /* Insertion pointers for the linked list sort */ -register fix15 to; - -#if DEBUG -/* Bounds checking IS done in debug mode */ -if ((y >= MAX_INTERCEPTS) || (y < 0)) - { - printf("Intercept out of table!!!!! (%d)\n",y); - return; - } - -if (y >= sp_globals.no_y_lists) - { - printf(" Add x intercept(%2d, %f)\n", - y + sp_globals.x_band.band_min - sp_globals.no_y_lists, - (real)x/(real)sp_globals.onepix); - if (y > (sp_globals.no_x_lists + sp_globals.no_y_lists)) - { - printf(" Intercept too big for band!!!!!\007\n"); - return; - } - } - else - { - printf(" Add y intercept(%2d, %f)\n", y + sp_globals.y_band.band_min,(real)x/(real)sp_globals.onepix); - } - -if (y < 0) /* Y value below bottom of current band? */ - { - printf(" Intecerpt less than 0!!!\007\n"); - return; - } -#endif - -/* Store new values */ - -sp_intercepts.car[sp_globals.next_offset] = x; - -/* Find slot to insert new element (between from and to) */ - -from = y; /* Start at list head */ - -while( (to = sp_intercepts.cdr[from]) >= sp_globals.first_offset) /* Until to == end of list */ - { - if (x <= sp_intercepts.car[to]) /* If next item is larger than or same as this one... */ - goto insert_element; /* ... drop out and insert here */ - from = to; /* move forward in list */ - } - -insert_element: /* insert element "next_offset" between elements "from" */ - /* and "to" */ - -sp_intercepts.cdr[from] = sp_globals.next_offset; -sp_intercepts.cdr[sp_globals.next_offset] = to; - -if (++sp_globals.next_offset >= MAX_INTERCEPTS) /* Intercept buffer full? */ - { - sp_globals.intercept_oflo = TRUE; -/* There may be a few more calls to "add_intercept" from the current line */ -/* To avoid problems, we set next_offset to a safe value. We don't care */ -/* if the intercept table gets trashed at this point */ - sp_globals.next_offset = sp_globals.first_offset; - } -} - -#endif - -#if INCL_2D -FUNCTION static void sp_proc_intercepts_2d() -/* Called by sp_make_char to output accumulated intercept lists - * Clips output to xmin, xmax, sp_globals.ymin, ymax boundaries - */ -{ -register fix15 i; -register fix15 from, to; /* Start and end of run in pixel units - relative to left extent of character */ -register fix15 y; -register fix15 scan_line; - fix15 local_bmap_xmin; - fix15 local_bmap_xmax; - fix15 first_y, last_y; - fix15 j,k; - -#if INCL_CLIPPING -if ((sp_globals.specs.flags & CLIP_LEFT) != 0) - clipleft = TRUE; -else - clipleft = FALSE; -if ((sp_globals.specs.flags & CLIP_RIGHT) != 0) - clipright = TRUE; -else - clipright = FALSE; -if (clipleft || clipright) - { - xmax = sp_globals.clip_xmax << sp_globals.pixshift; - xmin = sp_globals.clip_xmin << sp_globals.pixshift; - } -if (!clipright) - xmax = ((sp_globals.set_width.x+32768L) >> 16); -#endif - -if (sp_globals.x_scan_active) /* If xscanning, we need to make sure we don't miss any important pixels */ - { - first_y = sp_globals.x_band.band_floor; /* start of x lists */ - last_y = sp_globals.x_band.band_ceiling; /* end of x lists */ - for (y = first_y; y != last_y; y++) /* scan all xlists */ - { - i = sp_intercepts.cdr[y]; /* Index head of intercept list */ - while (i != 0) /* Link to next intercept if present */ - { - from = sp_intercepts.car[i]; - j = i; - i = sp_intercepts.cdr[i]; /* Link to next intercept */ - if (i == 0) /* End of list? */ - { -#if DEBUG - printf("****** proc_intercepts: odd number of intercepts in x list\n"); -#endif - break; - } - to = sp_intercepts.car[i]; - k = sp_intercepts.cdr[i]; - if (((to >> sp_globals.pixshift) >= (from >> sp_globals.pixshift)) && - ((to - from) < (sp_globals.onepix + 1))) - { - from = ((fix31)to + (fix31)from - (fix31)sp_globals.onepix) >> (sp_globals.pixshift + 1); - if (from > sp_globals.y_band.band_max) - from = sp_globals.y_band.band_max; - if ((from -= sp_globals.y_band.band_min) < 0) - from = 0; - to = ((y - sp_globals.x_band.band_floor + sp_globals.x_band.band_min) - << sp_globals.pixshift) - + sp_globals.pixrnd; - sp_intercepts.car[j] = to; - sp_intercepts.car[i] = to + sp_globals.onepix; - sp_intercepts.cdr[i] = sp_intercepts.cdr[from]; - sp_intercepts.cdr[from] = j; - } - i = k; - } - } - } -#if DEBUG -printf("\nIntercept lists:\n"); -#endif - -if ((first_y = sp_globals.y_band.band_max) >= sp_globals.ymax) - first_y = sp_globals.ymax - 1; /* Clip to ymax boundary */ - -if ((last_y = sp_globals.y_band.band_min) < sp_globals.ymin) - last_y = sp_globals.ymin; /* Clip to sp_globals.ymin boundary */ - -last_y -= sp_globals.y_band.band_array_offset; - -local_bmap_xmin = sp_globals.xmin << sp_globals.pixshift; -local_bmap_xmax = (sp_globals.xmax << sp_globals.pixshift) + sp_globals.pixrnd; - -#if DEBUG -/* Print out all of the intercept info */ -scan_line = sp_globals.ymax - first_y - 1; - -for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--, scan_line++) - { - i = y; /* Index head of intercept list */ - while ((i = sp_intercepts.cdr[i]) != 0) /* Link to next intercept if present */ - { - if ((from = sp_intercepts.car[i] - local_bmap_xmin) < 0) - from = 0; /* Clip to xmin boundary */ - i = sp_intercepts.cdr[i]; /* Link to next intercept */ - if (i == 0) /* End of list? */ - { - printf("****** proc_intercepts: odd number of intercepts\n"); - break; - } - if ((to = sp_intercepts.car[i]) > sp_globals.bmap_xmax) - to = sp_globals.bmap_xmax - local_bmap_xmin; /* Clip to xmax boundary */ - else - to -= local_bmap_xmin; - printf(" Y = %2d (scanline %2d): %3.4f %3.4f:\n", - y + sp_globals.y_band.band_min, - scan_line, - (real)from / (real)sp_globals.onepix, - (real)to / (real)sp_globals.onepix); - } - } -#endif - -/* Draw the image */ -scan_line = sp_globals.ymax - first_y - 1; - -for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--, scan_line++) - { - i = y; /* Index head of intercept list */ - while ((i = sp_intercepts.cdr[i]) != 0) /* Link to next intercept if present */ - { - if ((from = sp_intercepts.car[i] - local_bmap_xmin) < 0) - from = 0; /* Clip to xmin boundary */ - i = sp_intercepts.cdr[i]; /* Link to next intercept */ - - if ((to = sp_intercepts.car[i]) > local_bmap_xmax) - to = sp_globals.bmap_xmax - local_bmap_xmin; /* Clip to xmax boundary */ - else - to -= local_bmap_xmin; -#if INCL_CLIPPING - if (clipleft) - { - if (to <= xmin) - continue; - if (from < xmin) - from = xmin; - } - if (clipright) - { - if (from >= xmax) - continue; - if (to > xmax) - to = xmax; - } -#endif - if ( (to - from) <= sp_globals.onepix) - { - from = (to + from - sp_globals.onepix) >> (sp_globals.pixshift + 1); - set_bitmap_bits(scan_line, from, from + 1); - } - else - { - set_bitmap_bits(scan_line, from >> sp_globals.pixshift, to >> sp_globals.pixshift); - } - } - } -} - -#endif diff --git a/nx-X11/lib/font/Speedo/out_blk.c b/nx-X11/lib/font/Speedo/out_blk.c deleted file mode 100644 index a5b669b2a..000000000 --- a/nx-X11/lib/font/Speedo/out_blk.c +++ /dev/null @@ -1,706 +0,0 @@ -/* $Xorg: out_blk.c,v 1.3 2000/08/17 19:46:26 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/out_blk.c,v 1.2 1999/02/07 06:18:16 dawes Exp $ */ - - -/*************************** O U T _ B L K . C ********************************* - * * - * This is an output module for black-writer mode. * - * * - *****************************************************************************/ - - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spdo_prv.h" /* General definitions for Speedo */ - -#define DEBUG 0 -#define LOCAL static -#define ABS(X) ( (X < 0) ? -X : X) - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - - -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - -/***** EXTERNAL VARIABLES *****/ - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC VARIABLES *****/ - -/***** STATIC FUNCTIONS *****/ - -#if INCL_BLACK -static void sp_add_intercept_black(PROTO_DECL2 fix15 y, fix15 x); -static void sp_proc_intercepts_black(PROTO_DECL1); -#endif - - -#if INCL_BLACK -FUNCTION boolean init_black( -GDECL -specs_t GLOBALFAR *specsarg) -/* - * init_out0() is called by sp_set_specs() to initialize the output module. - * Returns TRUE if output module can accept requested specifications. - * Returns FALSE otherwise. - */ -{ -#if DEBUG -printf("INIT_BLK()\n"); -#endif -if (specsarg->flags & CURVES_OUT) - return FALSE; /* Curves out not supported */ -return (TRUE); -} -#endif - - -#if INCL_BLACK -FUNCTION boolean begin_char_black( -GDECL -point_t Psw, -point_t Pmin, -point_t Pmax) -/* Called once at the start of the character generation process - */ -{ -#if DEBUG -printf("BEGIN_CHAR_BLACK(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f\n", - (real)Psw.x / (real)sp_globals.onepix, (real)Psw.y / (real)sp_globals.onepix, - (real)Pmin.x / (real)sp_globals.onepix, (real)Pmin.y / (real)sp_globals.onepix, - (real)Pmax.x / (real)sp_globals.onepix, (real)Pmax.y / (real)sp_globals.onepix); -#endif -init_char_out(Psw,Pmin,Pmax); -return TRUE; -} -#endif - - -#if INCL_BLACK -FUNCTION void begin_contour_black( -GDECL -point_t P1, -boolean outside) -/* Called at the start of each contour - */ -{ - -#if DEBUG -printf("BEGIN_CONTOUR_BLACK(%3.1f, %3.1f, %s)\n", - (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix, outside? "outside": "inside"); -#endif -sp_globals.x0_spxl = P1.x; -sp_globals.y0_spxl = P1.y; -sp_globals.y_pxl = (sp_globals.y0_spxl + sp_globals.pixrnd) >> sp_globals.pixshift; -} -#endif - -#if INCL_BLACK -FUNCTION void line_black( -GDECL -point_t P1) -/* Called for each vector in the transformed character - */ -{ -register fix15 how_many_y; /* # of intercepts at y = n + 1/2 */ -register fix15 yc, i; /* Current scan-line */ - fix15 temp1; /* various uses */ - fix15 temp2; /* various uses */ -register fix31 dx_dy; /* slope of line in 16.16 form */ -register fix31 xc; /* high-precision (16.16) x coordinate */ - fix15 x0,y0,x1,y1; /* PIX.FRAC start and endpoints */ - -x0 = sp_globals.x0_spxl; /* get start of line (== current point) */ -y0 = sp_globals.y0_spxl; -sp_globals.x0_spxl = x1 = P1.x; /* end of line */ -sp_globals.y0_spxl = y1 = P1.y; /* (also update current point to end of line) */ - -yc = sp_globals.y_pxl; /* current scan line = end of last line */ -sp_globals.y_pxl = (y1 + sp_globals.pixrnd) >> sp_globals.pixshift; /* calculate new end-scan sp_globals.line */ - - -#if DEBUG -printf("LINE_BLACK(%3.4f, %3.4f)\n", - (real)P1.x/(real)sp_globals.onepix, - (real)P1.y/(real)sp_globals.onepix); -#endif - -if (sp_globals.extents_running) - { - if (sp_globals.x0_spxl > sp_globals.bmap_xmax) - sp_globals.bmap_xmax = sp_globals.x0_spxl; - if (sp_globals.x0_spxl < sp_globals.bmap_xmin) - sp_globals.bmap_xmin = sp_globals.x0_spxl; - if (sp_globals.y0_spxl > sp_globals.bmap_ymax) - sp_globals.bmap_ymax = sp_globals.y0_spxl; - if (sp_globals.y0_spxl < sp_globals.bmap_ymin) - sp_globals.bmap_ymin = sp_globals.y0_spxl; - } - -if (sp_globals.intercept_oflo) return; - -if ((how_many_y = sp_globals.y_pxl - yc) == 0) return; /* Don't draw a null line */ - -if (how_many_y < 0) yc--; /* Predecrment downward lines */ - -if (yc > sp_globals.y_band.band_max) /* Is start point above band? */ - { - if (sp_globals.y_pxl > sp_globals.y_band.band_max) return; /* line has to go down! */ - how_many_y = sp_globals.y_pxl - (yc = sp_globals.y_band.band_max) - 1; /* Yes, limit it */ - } - -if (yc < sp_globals.y_band.band_min) /* Is start point below band? */ - { - if (sp_globals.y_pxl < sp_globals.y_band.band_min) return; /* line has to go up! */ - how_many_y = sp_globals.y_pxl - (yc = sp_globals.y_band.band_min); /* Yes, limit it */ - } - -xc = (fix31)(x0 + sp_globals.pixrnd) << (16 - sp_globals.pixshift); /* Original x coordinate with built in */ - /* rounding. 16.16 form */ - - -if ( (temp1 = (x1 - x0)) == 0) /* check for vertical line */ - { - yc -= sp_globals.y_band.band_min; /* yc is now an offset relative to the band */ - temp1 = (fix15)(xc >> 16); - if (how_many_y < 0) - { /* Vector down */ - if ((how_many_y += yc + 1) < 0) how_many_y = 0; /* can't go below 0 */ - for (i = yc; i >= how_many_y; i--) - sp_add_intercept_black(i,temp1); - } - else - { /* Vector up */ - /* check to see that line doesn't extend beyond top of band */ - if ((how_many_y += yc) > sp_globals.no_y_lists) how_many_y = sp_globals.no_y_lists; - for (i = yc; i != how_many_y; i++) - sp_add_intercept_black(i,temp1); - } - return; - } - -/* calculate dx_dy at 16.16 fixed point */ - -dx_dy = ( (fix31)temp1 << 16 )/(fix31)(y1 - y0); - -/* We have to check for a @#$%@# possible multiply overflow */ -/* by doing another @#$*& multiply. In assembly language, */ -/* the program could just check the OVerflow flag or whatever*/ -/* works on the particular processor. This C code is meant */ -/* to be processor independant. */ - -temp1 = (yc << sp_globals.pixshift) - y0 + sp_globals.pixrnd; -/* This sees if the sign bits start at bit 15 */ -/* if they do, no overflow has occurred */ - -temp2 = (fix15)(MULT16(temp1,(fix15)(dx_dy >> 16)) >> 15); - -if ( (temp2 != (fix15)0xFFFF) && - (temp2 != 0x0000) && - /* Overflow. Pick point closest to yc + .5 */ - (ABS(temp1) < ABS((yc << sp_globals.pixshift) - y1 + sp_globals.pixrnd)) ) - { /* use x1 instead of x0 */ - xc = (fix31)(x1 + sp_globals.pixrnd) << (16 - sp_globals.pixshift); - } -else - { -/* calculate new xc at the center of the *current* scan line */ -/* due to banding, yc may be several lines away from y0 */ -/* xc += (yc + .5 - y0) * dx_dy */ -/* This multiply generates a subpixel delta. */ -/* So we shift it to be a 16.16 delta */ - - xc += ((fix31)temp1 * dx_dy) >> sp_globals.pixshift; - } - -yc -= sp_globals.y_band.band_min; /* yc is now an offset relative to the band */ - -if (how_many_y < 0) - { /* Vector down */ - if (how_many_y == -1) - sp_add_intercept_black(yc, (fix15) (xc >> 16)); - else - { - if ((how_many_y += yc + 1) < 0) how_many_y = 0; /* can't go below 0 */ - for (i = yc; i >= how_many_y; i--) - { - temp1 = (fix15)(xc >> 16); - sp_add_intercept_black(i,temp1); - xc -= dx_dy; - } - } - } - else - { /* Vector up */ - /* check to see that line doesn't extend beyond top of band */ - if (how_many_y == 1) - sp_add_intercept_black(yc, (fix15) (xc >> 16)); - else - { - if ((how_many_y += yc) > sp_globals.no_y_lists) how_many_y = sp_globals.no_y_lists; - for (i = yc; i != how_many_y; i++) - { - temp1 = (fix15)(xc >> 16); - sp_add_intercept_black(i,temp1); - xc += dx_dy; - } - } - } -} -#endif -#if INCL_BLACK -FUNCTION boolean end_char_black() -GDECL -/* Called when all character data has been output - * Return TRUE if output process is complete - * Return FALSE to repeat output of the transformed data beginning - * with the first contour - */ -{ - -fix31 xorg; -fix31 yorg; -#if INCL_CLIPPING -fix31 bmap_max, bmap_min; -#endif - -#if DEBUG -printf("END_CHAR_BLACK()\n"); -#endif - -if (sp_globals.first_pass) - { - if (sp_globals.bmap_xmax >= sp_globals.bmap_xmin) - { - sp_globals.xmin = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - sp_globals.xmax = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift; - } - else - { - sp_globals.xmin = sp_globals.xmax = 0; - } - if (sp_globals.bmap_ymax >= sp_globals.bmap_ymin) - { - -#if INCL_CLIPPING - switch(sp_globals.tcb0.xtype) - { - case 1: /* 180 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_min = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - sp_globals.clip_ymin = -1 * sp_globals.clip_ymin; - if (bmap_min < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - else - sp_globals.ymin = bmap_min; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift; - if (bmap_max < sp_globals.clip_ymax) - sp_globals.ymax = bmap_max; - else - sp_globals.ymax = sp_globals.clip_ymax; - } - sp_globals.clip_xmax = -sp_globals.xmin; - sp_globals.clip_xmin = ((sp_globals.set_width.x+32768L) >> 16) - - sp_globals.xmin; - break; - case 2: /* 90 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_xmin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_xmin = -1 * sp_globals.clip_xmin; - bmap_min = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - if (bmap_min > sp_globals.clip_xmin) - sp_globals.clip_xmin = bmap_min; - - /* normalize to x origin */ - sp_globals.clip_xmin -= sp_globals.xmin; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_xmax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift; - if (bmap_max < sp_globals.clip_xmax) - sp_globals.xmax = bmap_max; - else - sp_globals.xmax = sp_globals.clip_xmax; - sp_globals.clip_ymax = 0; - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - /* normalize to x origin */ - sp_globals.clip_xmax -= sp_globals.xmin; - } - break; - case 3: /* 270 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_xmin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_xmin = -1 * sp_globals.clip_xmin; - bmap_min = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - - /* let the minimum be the larger of these two values */ - if (bmap_min > sp_globals.clip_xmin) - sp_globals.clip_xmin = bmap_min; - - /* normalize the x value to new xorgin */ - sp_globals.clip_xmin -= sp_globals.xmin; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_xmax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift; - - /* let the max be the lesser of these two values */ - if (bmap_max < sp_globals.clip_xmax) - { - sp_globals.xmax = bmap_max; - sp_globals.clip_xmax = bmap_max; - } - else - sp_globals.xmax = sp_globals.clip_xmax; - - /* normalize the x value to new x origin */ - sp_globals.clip_xmax -= sp_globals.xmin; - } - /* compute y clip values */ - sp_globals.clip_ymax = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = 0; - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - break; - default: /* this is for zero degree rotation and arbitrary rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift; - if (bmap_max > sp_globals.clip_ymax) - sp_globals.ymax = bmap_max; - else - sp_globals.ymax = sp_globals.clip_ymax; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_ymin = - sp_globals.clip_ymin; - bmap_min = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - if (bmap_min < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - else - sp_globals.ymin = bmap_min; - } - sp_globals.clip_xmin = -sp_globals.xmin; - sp_globals.clip_xmax = ((sp_globals.set_width.x+32768L) >> 16) - - sp_globals.xmin; - break; - } -if ( !(sp_globals.specs.flags & CLIP_TOP)) -#endif - sp_globals.ymax = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift; - -#if INCL_CLIPPING -if ( !(sp_globals.specs.flags & CLIP_BOTTOM)) -#endif - - sp_globals.ymin = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - } - else - { - sp_globals.ymin = sp_globals.ymax = 0; - } - - /* add in the rounded out part (from xform.) of the left edge */ - if (sp_globals.tcb.xmode == 0) /* for X pix is function of X orus only add the round */ - xorg = (((fix31)sp_globals.xmin << 16) + (sp_globals.rnd_xmin << sp_globals.poshift)); - else - if (sp_globals.tcb.xmode == 1) /* for X pix is function of -X orus only, subtr. round */ - xorg = (((fix31)sp_globals.xmin << 16) - (sp_globals.rnd_xmin << sp_globals.poshift)) ; - else - xorg = (fix31)sp_globals.xmin << 16; /* for other cases don't use round on x */ - - if (sp_globals.tcb.ymode == 2) /* for Y pix is function of X orus only, add round error */ - yorg = (((fix31)sp_globals.ymin << 16) + (sp_globals.rnd_xmin << sp_globals.poshift)); - else - if (sp_globals.tcb.ymode == 3) /* for Y pix is function of -X orus only, sub round */ - yorg = (((fix31)sp_globals.ymin << 16) - (sp_globals.rnd_xmin << sp_globals.poshift)); - else /* all other cases have no round error on yorg */ - yorg = (fix31)sp_globals.ymin << 16; - - open_bitmap(sp_globals.set_width.x, sp_globals.set_width.y, xorg, yorg, - sp_globals.xmax - sp_globals.xmin, sp_globals.ymax - sp_globals.ymin); - if (sp_globals.intercept_oflo) - { - sp_globals.y_band.band_min = sp_globals.ymin; - sp_globals.y_band.band_max = sp_globals.ymax; - init_intercepts_out(); - sp_globals.first_pass = FALSE; - sp_globals.extents_running = FALSE; - return FALSE; - } - else - { - sp_proc_intercepts_black(); - close_bitmap(); - return TRUE; - } - } -else - { - if (sp_globals.intercept_oflo) - { - reduce_band_size_out(); - init_intercepts_out(); - return FALSE; - } - else - { - sp_proc_intercepts_black(); - if (next_band_out()) - { - init_intercepts_out(); - return FALSE; - } - close_bitmap(); - return TRUE; - } - } -} -#endif - -#if INCL_BLACK -FUNCTION LOCAL void sp_add_intercept_black( -GDECL -fix15 y, /* Y coordinate in relative pixel units */ - /* (0 is lowest sample in band) */ -fix15 x) /* X coordinate of intercept in subpixel units */ - -/* Called by line() to add an intercept to the intercept list structure - */ - -{ -register fix15 from; /* Insertion pointers for the linked list sort */ -register fix15 to; - -#if DEBUG -printf(" Add intercept(%2d, %d)\n", y + sp_globals.y_band.band_min,x); - -/* Bounds checking IS done in debug mode */ -if (y < 0) /* Y value below bottom of current band? */ - { - printf(" Intecerpt less than 0!!!\007\n"); - return; - } - -if (y > (sp_globals.no_y_lists - 1)) /* Y value above top of current band? */ - { - printf(" Intercept too big for band!!!!!\007\n"); - return; - } -#endif - -/* Store new values */ - -sp_intercepts.car[sp_globals.next_offset] = x; - -/* Find slot to insert new element (between from and to) */ - -from = y; /* Start at list head */ - -while( (to = sp_intercepts.cdr[from]) >= sp_globals.first_offset) /* Until to == end of list */ - { - if (x <= sp_intercepts.car[to]) /* If next item is larger than or same as this one... */ - goto insert_element; /* ... drop out and insert here */ - from = to; /* move forward in list */ - } - -insert_element: /* insert element "sp_globals.next_offset" between elements "from" */ - /* and "to" */ - -sp_intercepts.cdr[from] = sp_globals.next_offset; -sp_intercepts.cdr[sp_globals.next_offset] = to; - -if (++sp_globals.next_offset >= MAX_INTERCEPTS) /* Intercept buffer full? */ - { - sp_globals.intercept_oflo = TRUE; -/* There may be a few more calls to "add_intercept" from the current line */ -/* To avoid problems, we set next_offset to a safe value. We don't care */ -/* if the intercept table gets trashed at this point */ - sp_globals.next_offset = sp_globals.first_offset; - } -} - -#endif - -#if INCL_BLACK -FUNCTION LOCAL void sp_proc_intercepts_black() -GDECL - -/* Called by sp_make_char to output accumulated intercept lists - * Clips output to sp_globals.xmin, sp_globals.xmax, sp_globals.ymin, sp_globals.ymax boundaries - */ -{ -register fix15 i; -register fix15 from, to; /* Start and end of run in pixel units - relative to left extent of character */ -register fix15 y; -register fix15 scan_line; - fix15 first_y, last_y; - -#if DEBUG -printf("\nIntercept lists:\n"); -#endif - -#if INCL_CLIPPING -if ((sp_globals.specs.flags & CLIP_LEFT) != 0) - clipleft = TRUE; -else - clipleft = FALSE; -if ((sp_globals.specs.flags & CLIP_RIGHT) != 0) - clipright = TRUE; -else - clipright = FALSE; -if (clipleft || clipright) - { - xmax = sp_globals.clip_xmax; - xmin = sp_globals.clip_xmin; - } -if (!clipright) - xmax = ((sp_globals.set_width.x+32768L) >> 16); -#endif - -if ((first_y = sp_globals.y_band.band_max) >= sp_globals.ymax) - first_y = sp_globals.ymax - 1; /* Clip to sp_globals.ymax boundary */ - -if ((last_y = sp_globals.y_band.band_min) < sp_globals.ymin) - last_y = sp_globals.ymin; /* Clip to sp_globals.ymin boundary */ - -last_y -= sp_globals.y_band.band_min; -#if DEBUG -/* Print out all of the intercept info */ -scan_line = sp_globals.ymax - first_y - 1; - -for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--, scan_line++) - { - i = y; /* Index head of intercept list */ - while ((i = sp_intercepts.cdr[i]) != 0) /* Link to next intercept if present */ - { - if ((from = sp_intercepts.car[i] - sp_globals.xmin) < 0) - from = 0; /* Clip to sp_globals.xmin boundary */ - i = sp_intercepts.cdr[i]; /* Link to next intercept */ - if (i == 0) /* End of list? */ - { - printf("****** proc_intercepts: odd number of intercepts\n"); - break; - } - if ((to = sp_intercepts.car[i]) > sp_globals.xmax) - to = sp_globals.xmax - sp_globals.xmin; /* Clip to sp_globals.xmax boundary */ - else - to -= sp_globals.xmin; - printf(" Y = %2d (scanline %2d): %d %d:\n", - y + sp_globals.y_band.band_min, scan_line, from, to); - } - } -#endif - -/* Draw the image */ -scan_line = sp_globals.ymax - first_y - 1; - -for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--, scan_line++) - { - i = y; /* Index head of intercept list */ - while ((i = sp_intercepts.cdr[i]) != 0) /* Link to next intercept if present */ - { - if ((from = sp_intercepts.car[i] - sp_globals.xmin) < 0) - from = 0; /* Clip to sp_globals.xmin boundary */ - i = sp_intercepts.cdr[i]; /* Link to next intercept */ - - if ((to = sp_intercepts.car[i]) > sp_globals.xmax) - to = sp_globals.xmax - sp_globals.xmin; /* Clip to sp_globals.xmax boundary */ - else - to -= sp_globals.xmin; - if (from >= to) - { - if (from >= sp_globals.xmax - sp_globals.xmin) - { - --from ; - } - to = from+1; - } -#if INCL_CLIPPING - if (clipleft) - { - if (to <= xmin) - continue; - if (from < xmin) - from = xmin; - } - if (clipright) - { - if (from >= xmax) - continue; - if (to > xmax) - to = xmax; - } -#endif - set_bitmap_bits(scan_line, from, to); - } - } -} - -#endif - - - - diff --git a/nx-X11/lib/font/Speedo/out_outl.c b/nx-X11/lib/font/Speedo/out_outl.c deleted file mode 100644 index 013901092..000000000 --- a/nx-X11/lib/font/Speedo/out_outl.c +++ /dev/null @@ -1,290 +0,0 @@ -/* $Xorg: out_outl.c,v 1.3 2000/08/17 19:46:26 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ - - -/**************************** O U T _ 2 _ 1 . C ****************************** - * * - * This is the standard output module for vector output mode. * - * * - ****************************************************************************/ - - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spdo_prv.h" /* General definitions for Speedo */ - - -#define DEBUG 0 - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - -/* the following macro is used to limit points on the outline to the bounding box */ - -#define RANGECHECK(value,min,max) (((value) >= (min) ? (value) : (min)) < (max) ? (value) : (max)) -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - -/***** EXTERNAL VARIABLES *****/ - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC VARIABLES *****/ - -/***** STATIC FUNCTIONS *****/ - - -#if INCL_OUTLINE -FUNCTION boolean init_outline(specsarg) -GDECL -specs_t GLOBALFAR *specsarg; -/* - * init_out2() is called by sp_set_specs() to initialize the output module. - * Returns TRUE if output module can accept requested specifications. - * Returns FALSE otherwise. - */ -{ -#if DEBUG -printf("INIT_OUT_2()\n"); -#endif -if (specsarg->flags & (CLIP_LEFT + CLIP_RIGHT + CLIP_TOP + CLIP_BOTTOM)) - return FALSE; /* Clipping not supported */ -return (TRUE); -} -#endif - -#if INCL_OUTLINE -FUNCTION boolean begin_char_outline(Psw, Pmin, Pmax) -GDECL -point_t Psw; /* End of escapement vector (sub-pixels) */ -point_t Pmin; /* Bottom left corner of bounding box */ -point_t Pmax; /* Top right corner of bounding box */ -/* - * If two or more output modules are included in the configuration, begin_char2() - * is called by begin_char() to signal the start of character output data. - * If only one output module is included in the configuration, begin_char() is - * called by make_simp_char() and make_comp_char(). - */ -{ -fix31 set_width_x; -fix31 set_width_y; -fix31 xmin; -fix31 xmax; -fix31 ymin; -fix31 ymax; - -#if DEBUG -printf("BEGIN_CHAR_2(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f\n", - (real)Psw.x / (real)onepix, (real)Psw.y / (real)onepix, - (real)Pmin.x / (real)onepix, (real)Pmin.y / (real)onepix, - (real)Pmax.x / (real)onepix, (real)Pmax.y / (real)onepix); -#endif -sp_globals.poshift = 16 - sp_globals.pixshift; -set_width_x = (fix31)Psw.x << sp_globals.poshift; -set_width_y = (fix31)Psw.y << sp_globals.poshift; -xmin = (fix31)Pmin.x << sp_globals.poshift; -xmax = (fix31)Pmax.x << sp_globals.poshift; -ymin = (fix31)Pmin.y << sp_globals.poshift; -ymax = (fix31)Pmax.y << sp_globals.poshift; -sp_globals.xmin = Pmin.x; -sp_globals.xmax = Pmax.x; -sp_globals.ymin = Pmin.y; -sp_globals.ymax = Pmax.y; -open_outline(set_width_x, set_width_y, xmin, xmax, ymin, ymax); -return TRUE; -} -#endif - -#if INCL_OUTLINE -FUNCTION void begin_sub_char_outline(Psw, Pmin, Pmax) -GDECL -point_t Psw; /* End of sub-char escapement vector */ -point_t Pmin; /* Bottom left corner of sub-char bounding box */ -point_t Pmax; /* Top right corner of sub-char bounding box */ -/* - * If two or more output modules are included in the configuration, begin_sub_char2() - * is called by begin_sub_char() to signal the start of sub-character output data. - * If only one output module is included in the configuration, begin_sub_char() is - * called by make_comp_char(). - */ -{ -#if DEBUG -printf("BEGIN_SUB_CHAR_2(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f\n", - (real)Psw.x / (real)onepix, (real)Psw.y / (real)onepix, - (real)Pmin.x / (real)onepix, (real)Pmin.y / (real)onepix, - (real)Pmax.x / (real)onepix, (real)Pmax.y / (real)onepix); -#endif -start_new_char(); -} -#endif - - -#if INCL_OUTLINE -FUNCTION void begin_contour_outline(P1, outside) -GDECL -point_t P1; /* Start point of contour */ -boolean outside; /* TRUE if outside (counter-clockwise) contour */ -/* - * If two or more output modules are included in the configuration, begin_contour2() - * is called by begin_contour() to define the start point of a new contour - * and to indicate whether it is an outside (counter-clockwise) contour - * or an inside (clockwise) contour. - * If only one output module is included in the configuration, begin_sub_char() is - * called by proc_outl_data(). - */ -{ -fix15 x,y; -#if DEBUG -printf("BEGIN_CONTOUR_2(%3.1f, %3.1f, %s)\n", - (real)P1.x / (real)onepix, (real)P1.y / (real)onepix, outside? "outside": "inside"); -#endif -x = RANGECHECK(P1.x,sp_globals.xmin,sp_globals.xmax); -y = RANGECHECK(P1.y,sp_globals.ymin,sp_globals.ymax); - -start_contour((fix31)x << sp_globals.poshift, (fix31)y << sp_globals.poshift, outside); -} -#endif - -#if INCL_OUTLINE -FUNCTION void curve_outline(P1, P2, P3,depth) -GDECL -point_t P1; /* First control point of Bezier curve */ -point_t P2; /* Second control point of Bezier curve */ -point_t P3; /* End point of Bezier curve */ -fix15 depth; -/* - * If two or more output modules are included in the configuration, curve2() - * is called by curve() to output one curve segment. - * If only one output module is included in the configuration, curve() is - * called by proc_outl_data(). - * This function is only called when curve output is enabled. - */ -{ -fix15 x1,y1,x2,y2,x3,y3; -#if DEBUG -printf("CURVE_2(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f)\n", - (real)P1.x / (real)onepix, (real)P1.y / (real)onepix, - (real)P2.x / (real)onepix, (real)P2.y / (real)onepix, - (real)P3.x / (real)onepix, (real)P3.y / (real)onepix); -#endif -x1= RANGECHECK(P1.x,sp_globals.xmin,sp_globals.xmax); -y1= RANGECHECK(P1.y,sp_globals.ymin,sp_globals.ymax); - -x2= RANGECHECK(P2.x,sp_globals.xmin,sp_globals.xmax); -y2= RANGECHECK(P2.y,sp_globals.ymin,sp_globals.ymax); - -x3= RANGECHECK(P3.x,sp_globals.xmin,sp_globals.xmax); -y3= RANGECHECK(P3.y,sp_globals.ymin,sp_globals.ymax); - -curve_to((fix31)x1 << sp_globals.poshift, (fix31)y1 << sp_globals.poshift, - (fix31)x2<< sp_globals.poshift, (fix31)y2 << sp_globals.poshift, - (fix31)x3 << sp_globals.poshift, (fix31)y3 << sp_globals.poshift); -} -#endif - -#if INCL_OUTLINE -FUNCTION void line_outline(P1) -GDECL -point_t P1; /* End point of vector */ -/* - * If two or more output modules are included in the configuration, line2() - * is called by line() to output one vector. - * If only one output module is included in the configuration, line() is - * called by proc_outl_data(). If curve output is enabled, line() is also - * called by split_curve(). - */ -{ -fix15 x1,y1; -#if DEBUG -printf("LINE_2(%3.1f, %3.1f)\n", (real)P1.x / (real)onepix, (real)P1.y / (real)onepix); -#endif -x1= RANGECHECK(P1.x,sp_globals.xmin,sp_globals.xmax); -y1= RANGECHECK(P1.y,sp_globals.ymin,sp_globals.ymax); - -line_to((fix31)x1 << sp_globals.poshift, (fix31)y1 << sp_globals.poshift); -} -#endif - -#if INCL_OUTLINE -FUNCTION void end_contour_outline() -GDECL -/* - * If two or more output modules are included in the configuration, end_contour2() - * is called by end_contour() to signal the end of a contour. - * If only one output module is included in the configuration, end_contour() is - * called by proc_outl_data(). - */ -{ -#if DEBUG -printf("END_CONTOUR_2()\n"); -#endif -close_contour(); -} -#endif - - -#if INCL_OUTLINE -FUNCTION void end_sub_char_outline() -GDECL -/* - * If two or more output modules are included in the configuration, end_sub_char2() - * is called by end_sub_char() to signal the end of sub-character data. - * If only one output module is included in the configuration, end_sub_char() is - * called by make_comp_char(). - */ -{ -#if DEBUG -printf("END_SUB_CHAR_2()\n"); -#endif -} -#endif - - -#if INCL_OUTLINE -FUNCTION boolean end_char_outline() -GDECL -/* - * If two or more output modules are included in the configuration, end_char2() - * is called by end_char() to signal the end of the character data. - * If only one output module is included in the configuration, end_char() is - * called by make_simp_char() and make_comp_char(). - * Returns TRUE if output process is complete - * Returns FALSE to repeat output of the transformed data beginning - * with the first contour (of the first sub-char if compound). - */ -{ -#if DEBUG -printf("END_CHAR_2()\n"); -#endif -close_outline(); -return TRUE; -} -#endif - diff --git a/nx-X11/lib/font/Speedo/out_scrn.c b/nx-X11/lib/font/Speedo/out_scrn.c deleted file mode 100644 index 0ea3b1976..000000000 --- a/nx-X11/lib/font/Speedo/out_scrn.c +++ /dev/null @@ -1,1090 +0,0 @@ -/* $Xorg: out_scrn.c,v 1.3 2000/08/17 19:46:26 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/out_scrn.c,v 1.4 1999/12/27 00:39:25 robin Exp $ */ - - -/*************************** O U T _ S C R N . C ***************************** - * * - * This is an output module for screen-writer mode. * - * * - *****************************************************************************/ - - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spdo_prv.h" /* General definitions for Speedo */ - -#define DEBUG 0 -#define LOCAL static -#define ABS(X) ( (X < 0) ? -X : X) - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - - -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - -/***** EXTERNAL VARIABLES *****/ - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC VARIABLES *****/ - -/***** STATIC FUNCTIONS *****/ - -static void sp_add_intercept_screen(PROTO_DECL2 fix15 y,fix31 x); -static void sp_proc_intercepts_screen(PROTO_DECL1); - - -#if INCL_SCREEN -FUNCTION boolean init_screen( -GDECL -specs_t FONTFAR *specsarg) -/* - * init_out0() is called by sp_set_specs() to initialize the output module. - * Returns TRUE if output module can accept requested specifications. - * Returns FALSE otherwise. - */ -{ -#if DEBUG -printf("INIT_SCREEN()\n"); -#endif -return (TRUE); -} -#endif - - -#if INCL_SCREEN -FUNCTION boolean begin_char_screen( -GDECL -point_t Psw, -point_t Pmin, -point_t Pmax) -/* Called once at the start of the character generation process - */ -{ -#if DEBUG -printf("BEGIN_CHAR_SCREEN(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f\n", - (real)Psw.x / (real)sp_globals.onepix, (real)Psw.y / (real)sp_globals.onepix, - (real)Pmin.x / (real)sp_globals.onepix, (real)Pmin.y / (real)sp_globals.onepix, - (real)Pmax.x / (real)sp_globals.onepix, (real)Pmax.y / (real)sp_globals.onepix); -#endif -if (sp_globals.pixshift > 8) - sp_intercepts.fracpix = sp_globals.onepix << (8 - sp_globals.pixshift); -else - sp_intercepts.fracpix = sp_globals.onepix >> (sp_globals.pixshift - 8); - -init_char_out(Psw,Pmin,Pmax); - -return TRUE; -} -#endif - - -#if INCL_SCREEN -FUNCTION void begin_contour_screen( -GDECL -point_t P1, -boolean outside) -/* Called at the start of each contour - */ -{ - -#if DEBUG -printf("BEGIN_CONTOUR_SCREEN(%3.1f, %3.1f, %s)\n", - (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix, outside? "outside": "inside"); -#endif -sp_globals.x0_spxl = P1.x; -sp_globals.y0_spxl = P1.y; -sp_globals.y_pxl = (sp_globals.y0_spxl + sp_globals.pixrnd) >> sp_globals.pixshift; -} -#endif - -#if INCL_SCREEN -FUNCTION void curve_screen( -GDECL -point_t P1, point_t P2, point_t P3, -fix15 depth) -{ -fix31 X0; -fix31 Y0; -fix31 X1; -fix31 Y1; -fix31 X2; -fix31 Y2; -fix31 X3; -fix31 Y3; -#if DEBUG -printf("CURVE_SCREEN(%6.4f, %6.4f, %6.4f, %6.4f, %6.4f, %6.4f)\n", - (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix, - (real)P2.x / (real)sp_globals.onepix, (real)P2.y / (real)sp_globals.onepix, - (real)P3.x / (real)sp_globals.onepix, (real)P3.y / (real)sp_globals.onepix); -#endif - - -if (sp_globals.extents_running) /* Accumulate actual character extents if required */ - { - if (P3.x > sp_globals.bmap_xmax) - sp_globals.bmap_xmax = P3.x; - if (P3.x < sp_globals.bmap_xmin) - sp_globals.bmap_xmin = P3.x; - if (P3.y > sp_globals.bmap_ymax) - sp_globals.bmap_ymax = P3.y; - if (P3.y < sp_globals.bmap_ymin) - sp_globals.bmap_ymin = P3.y; - } - -X0 = ((fix31)sp_globals.x0_spxl << sp_globals.poshift) + (fix31)32768; -Y0 = ((fix31)sp_globals.y0_spxl << sp_globals.poshift) + (fix31)32768; -X1 = ((fix31)P1.x << sp_globals.poshift) + (fix31)32768; -Y1 = ((fix31)P1.y << sp_globals.poshift) + (fix31)32768; -X2 = ((fix31)P2.x << sp_globals.poshift) + (fix31)32768; -Y2 = ((fix31)P2.y << sp_globals.poshift) + (fix31)32768; -X3 = ((fix31)P3.x << sp_globals.poshift) + (fix31)32768; -Y3 = ((fix31)P3.y << sp_globals.poshift) + (fix31)32768; - -if (((Y0 - Y3) * sp_globals.tcb.mirror) > 0) - { - sp_intercepts.leftedge = LEFT_INT; - } -else - { - sp_intercepts.leftedge = 0; - } - -scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3); -sp_globals.x0_spxl = P3.x; -sp_globals.y0_spxl = P3.y; -sp_globals.y_pxl = (P3.y + sp_globals.pixrnd) >> sp_globals.pixshift; /* calculate new end-scan sp_globals.line */ -} - -FUNCTION void scan_curve_screen( -GDECL -fix31 X0, fix31 Y0, fix31 X1, fix31 Y1, fix31 X2, fix31 Y2, fix31 X3, fix31 Y3) -/* Called for each curve in the transformed character if curves out enabled - */ -{ -fix31 Pmidx; -fix31 Pmidy; -fix31 Pctrl1x; -fix31 Pctrl1y; -fix31 Pctrl2x; -fix31 Pctrl2y; - -#ifdef DBGCRV -printf("SCAN_CURVE_SCREEN(%6.4f, %6.4f, %6.4f, %6.4f, %6.4f, %6.4f, %6.4f, %6.4f)\n", - (real)(X0-32768) / 65536.0, (real)(Y0-32768) / 65536.0, - (real)(X1-32768) / 65536.0, (real)(Y1-32768) / 65536.0, - (real)(X2-32768) / 65536.0, (real)(Y2-32768) / 65536.0, - (real)(X3-32768) / 65536.0, (real)(Y3-32768) / 65536.0); -#endif - -if (((Y3 >> 16)) == (Y0 >> 16) || (Y3+1) == Y0 || Y3 == (Y0+1)) - { - return; - } -if ((X3 >> 16) == (X0 >> 16)) - { - vert_line_screen(X3,(fix15)(Y0>>16),(fix15)(Y3>>16)); - return; - } -Pmidx = (X0 + (X1 + X2) * 3 + X3 + 4 ) >> 3; -Pmidy = (Y0 + (Y1 + Y2) * 3 + Y3 + 4 ) >> 3; - -Pctrl1x = (X0 + X1 + 1 ) >> 1; -Pctrl1y = (Y0 + Y1 + 1) >> 1; -Pctrl2x = (X0 + (X1 << 1) + X2 + 2 ) >> 2; -Pctrl2y = (Y0 + (Y1 << 1) + Y2 + 2 ) >> 2; -scan_curve_screen(X0,Y0, Pctrl1x, Pctrl1y, Pctrl2x,Pctrl2y, Pmidx,Pmidy); - -Pctrl1x = (X1 + (X2 << 1) + X3 + 2 ) >> 2; -Pctrl1y = (Y1 + (Y2 << 1) + Y3 + 2 ) >> 2; -Pctrl2x = (X2 + X3 + 1 ) >> 1; -Pctrl2y = (Y2 + Y3 + 1 ) >> 1; -scan_curve_screen(Pmidx,Pmidy, Pctrl1x,Pctrl1y, Pctrl2x,Pctrl2y, X3,Y3); -} - -FUNCTION void vert_line_screen( -GDECL -fix31 x, -fix15 y1, fix15 y2) -{ - -#ifdef DBGCRV -printf("VERT_LINE_SCREEN(%6.4f, %6.4f, %6.4f)\n", - (real)(x - 32768) / 65536.0, - (real)(y1 - 32768) / 65536.0, - (real)(y2 - 32768) / 65536.0); -#endif - -if (sp_globals.intercept_oflo) - return; - -if (y1 > y2) /* Line goes downwards ? */ - { - if (y1 > (sp_globals.y_band.band_max + 1)) /* Start point above top of band? */ - y1 = sp_globals.y_band.band_max + 1; /* Adjust start point to top of band */ - if (y2 < sp_globals.y_band.band_min) /* End point below bottom of band? */ - y2 = sp_globals.y_band.band_min; /* Adjust end point bottom of band */ - - y1 -= sp_globals.y_band.band_min; /* Translate start point to band origin */ - y2 -= sp_globals.y_band.band_min; /* Translate end point to band origin */ - - while (y2 < y1) /* At least one intercept left? */ - { - sp_add_intercept_screen(--y1, x); /* Add intercept */ - } - } -else if (y2 > y1) /* Line goes upwards ? */ - { - if (y1 < sp_globals.y_band.band_min) /* Start point below bottom of band? */ - y1 = sp_globals.y_band.band_min; /* Adjust start point to bottom of band */ - if (y2 > (sp_globals.y_band.band_max + 1)) /* End point above top of band? */ - y2 = sp_globals.y_band.band_max + 1; /* Adjust end point to top of band */ - - y1 -= sp_globals.y_band.band_min; /* Translate start point to band origin */ - y2 -= sp_globals.y_band.band_min; /* Translate end point to band origin */ - - while (y1 < y2) /* At least one intercept left? */ - { - sp_add_intercept_screen(y1++, x); /* Add intercept */ - } - } - - -} - -#endif - - -#if INCL_SCREEN -FUNCTION void line_screen( -GDECL -point_t P1) -/* Called for each vector in the transformed character - */ -{ -register fix15 how_many_y; /* # of intercepts at y = n + 1/2 */ -register fix15 yc; /* Current scan-line */ - fix15 temp1; /* various uses */ - fix15 temp2; /* various uses */ -register fix31 dx_dy; /* slope of line in 16.16 form */ -register fix31 xc; /* high-precision (16.16) x coordinate */ - fix15 x0,y0,x1,y1; /* PIX.FRAC start and endpoints */ - -x0 = sp_globals.x0_spxl; /* get start of line (== current point) */ -y0 = sp_globals.y0_spxl; -sp_globals.x0_spxl = x1 = P1.x; /* end of line */ -sp_globals.y0_spxl = y1 = P1.y; /* (also update current point to end of line) */ - -yc = sp_globals.y_pxl; /* current scan line = end of last line */ -sp_globals.y_pxl = (y1 + sp_globals.pixrnd) >> sp_globals.pixshift; /* calculate new end-scan sp_globals.line */ - - -#if DEBUG -printf("LINE_SCREEN(%3.4f, %3.4f)\n", - (real)P1.x/(real)sp_globals.onepix, - (real)P1.y/(real)sp_globals.onepix); -#endif - -if (sp_globals.extents_running) - { - if (sp_globals.x0_spxl > sp_globals.bmap_xmax) - sp_globals.bmap_xmax = sp_globals.x0_spxl; - if (sp_globals.x0_spxl < sp_globals.bmap_xmin) - sp_globals.bmap_xmin = sp_globals.x0_spxl; - if (sp_globals.y0_spxl > sp_globals.bmap_ymax) - sp_globals.bmap_ymax = sp_globals.y0_spxl; - if (sp_globals.y0_spxl < sp_globals.bmap_ymin) - sp_globals.bmap_ymin = sp_globals.y0_spxl; - } - -if (sp_globals.intercept_oflo) return; - -if ((how_many_y = sp_globals.y_pxl - yc) == 0) return; /* Don't draw a null line */ - -xc = (fix31)(x0 + sp_globals.pixrnd) << (16 - sp_globals.pixshift); /* Original x coordinate with built in */ - /* rounding. 16.16 form */ - -if (how_many_y < 0) - { - yc--; /* Predecrment downward lines */ - } - -if ((how_many_y * sp_globals.tcb.mirror) < 0) - { - sp_intercepts.leftedge = LEFT_INT; - } -else - { - sp_intercepts.leftedge = 0; - } - -if (yc > sp_globals.y_band.band_max) /* Is start point above band? */ - { - if (sp_globals.y_pxl > sp_globals.y_band.band_max) return; /* line has to go down! */ - how_many_y = sp_globals.y_pxl - (yc = sp_globals.y_band.band_max) - 1; /* Yes, limit it */ - } - -if (yc < sp_globals.y_band.band_min) /* Is start point below band? */ - { - if (sp_globals.y_pxl < sp_globals.y_band.band_min) return; /* line has to go up! */ - how_many_y = sp_globals.y_pxl - (yc = sp_globals.y_band.band_min); /* Yes, limit it */ - } - -if ( (temp1 = (x1 - x0)) == 0) /* check for vertical line */ - { - dx_dy = 0L; /* Zero slope, leave xc alone */ - goto skip_calc; - } - -/* calculate dx_dy at 16.16 fixed point */ - -dx_dy = ( (fix31)temp1 << 16 )/(fix31)(y1 - y0); - -/* We have to check for a @#$%@# possible multiply overflow */ -/* by doing another @#$*& multiply. In assembly language, */ -/* the program could just check the OVerflow flag or whatever*/ -/* works on the particular processor. This C code is meant */ -/* to be processor independant. */ - -temp1 = (yc << sp_globals.pixshift) - y0 + sp_globals.pixrnd; -/* This sees if the sign bits start at bit 15 */ -/* if they do, no overflow has occurred */ - -temp2 = (fix15)(MULT16(temp1,(fix15)(dx_dy >> 16)) >> 15); - -if ( (temp2 != (fix15)-1) && - (temp2 != 0x0000) ) - { /* Overflow. Pick point closest to yc + .5 */ - if (ABS(temp1) < ABS((yc << sp_globals.pixshift) - y1 + sp_globals.pixrnd)) - { /* use x1 instead of x0 */ - xc = (fix31)(x1 + sp_globals.pixrnd) << (16 - sp_globals.pixshift); - } - goto skip_calc; - } -/* calculate new xc at the center of the *current* scan line */ -/* due to banding, yc may be several lines away from y0 */ -/* xc += (yc + .5 - y0) * dx_dy */ -/* This multiply generates a subpixel delta. */ -/* So we shift it to be a 16.16 delta */ - -xc += ((fix31)temp1 * dx_dy) >> sp_globals.pixshift; - -skip_calc: - -yc -= sp_globals.y_band.band_min; /* yc is now an offset relative to the band */ - -if (how_many_y < 0) - { /* Vector down */ - if ((how_many_y += yc + 1) < 0) how_many_y = 0; /* can't go below 0 */ - while(yc >= how_many_y) - { - sp_add_intercept_screen(yc--,xc); - xc -= dx_dy; - } - } - else - { /* Vector up */ - /* check to see that line doesn't extend beyond top of band */ - if ((how_many_y += yc) > sp_globals.no_y_lists) how_many_y = sp_globals.no_y_lists; - while(yc != how_many_y) - { - sp_add_intercept_screen(yc++,xc); - xc += dx_dy; - } - } -} -#endif - -#if INCL_SCREEN -FUNCTION void end_contour_screen() -GDECL -/* Called after the last vector in each contour - */ -{ -#if DEBUG -printf("END_CONTOUR_SCREEN()\n"); -#endif -sp_intercepts.inttype[sp_globals.next_offset-1] |= END_INT; -} -#endif - - - -#if INCL_SCREEN -FUNCTION boolean end_char_screen() -GDECL -/* Called when all character data has been output - * Return TRUE if output process is complete - * Return FALSE to repeat output of the transformed data beginning - * with the first contour - */ -{ - -fix31 xorg; -fix31 yorg; - -#if INCL_CLIPPING -fix31 em_max, em_min, bmap_max, bmap_min; -#endif - -#if DEBUG -printf("END_CHAR_SCREEN()\n"); -#endif - -if (sp_globals.first_pass) - { - if (sp_globals.bmap_xmax >= sp_globals.bmap_xmin) - { - sp_globals.xmin = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - sp_globals.xmax = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift; - } - else - { - sp_globals.xmin = sp_globals.xmax = 0; - } - if (sp_globals.bmap_ymax >= sp_globals.bmap_ymin) - { - -#if INCL_CLIPPING - switch(sp_globals.tcb0.xtype) - { - case 1: /* 180 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_min = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - sp_globals.clip_ymin = -1 * sp_globals.clip_ymin; - if (bmap_min < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - else - sp_globals.ymin = bmap_min; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift; - if (bmap_max < sp_globals.clip_ymax) - sp_globals.ymax = bmap_max; - else - sp_globals.ymax = sp_globals.clip_ymax; - } - sp_globals.clip_xmax = -sp_globals.xmin; - sp_globals.clip_xmin = ((sp_globals.set_width.x+32768L) >> 16) - - sp_globals.xmin; - break; - case 2: /* 90 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_xmin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_xmin = -1 * sp_globals.clip_xmin; - bmap_min = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - if (bmap_min > sp_globals.clip_xmin) - sp_globals.clip_xmin = bmap_min; - - /* normalize to x origin */ - sp_globals.clip_xmin -= sp_globals.xmin; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_xmax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift; - if (bmap_max < sp_globals.clip_xmax) - sp_globals.xmax = bmap_max; - else - sp_globals.xmax = sp_globals.clip_xmax; - sp_globals.clip_ymax = 0; - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - /* normalize to x origin */ - sp_globals.clip_xmax -= sp_globals.xmin; - } - break; - case 3: /* 270 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_xmin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_xmin = -1 * sp_globals.clip_xmin; - bmap_min = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - - /* let the minimum be the larger of these two values */ - if (bmap_min > sp_globals.clip_xmin) - sp_globals.clip_xmin = bmap_min; - - /* normalize the x value to new xorgin */ - sp_globals.clip_xmin -= sp_globals.xmin; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_xmax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift; - - /* let the max be the lesser of these two values */ - if (bmap_max < sp_globals.clip_xmax) - { - sp_globals.xmax = bmap_max; - sp_globals.clip_xmax = bmap_max; - } - else - sp_globals.xmax = sp_globals.clip_xmax; - - /* normalize the x value to new x origin */ - sp_globals.clip_xmax -= sp_globals.xmin; - } - /* compute y clip values */ - sp_globals.clip_ymax = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = 0; - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - break; - default: /* this is for zero degree rotation and arbitrary rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - bmap_max = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift; - if (bmap_max > sp_globals.clip_ymax) - sp_globals.ymax = bmap_max; - else - sp_globals.ymax = sp_globals.clip_ymax; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_ymin = - sp_globals.clip_ymin; - bmap_min = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - if (bmap_min < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - else - sp_globals.ymin = bmap_min; - } - sp_globals.clip_xmin = -sp_globals.xmin; - sp_globals.clip_xmax = ((sp_globals.set_width.x+32768L) >> 16) - - sp_globals.xmin; - break; - } -if ( !(sp_globals.specs.flags & CLIP_TOP)) -#endif - sp_globals.ymax = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift; - -#if INCL_CLIPPING -if ( !(sp_globals.specs.flags & CLIP_BOTTOM)) -#endif - - sp_globals.ymin = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift; - } - else - { - sp_globals.ymin = sp_globals.ymax = 0; - } - - /* add in the rounded out part (from xform.) of the left edge */ - if (sp_globals.tcb.xmode == 0) /* for X pix is function of X orus only add the round */ - xorg = (((fix31)sp_globals.xmin << 16) + (sp_globals.rnd_xmin << sp_globals.poshift)); - else - if (sp_globals.tcb.xmode == 1) /* for X pix is function of -X orus only, subtr. round */ - xorg = (((fix31)sp_globals.xmin << 16) - (sp_globals.rnd_xmin << sp_globals.poshift)) ; - else - xorg = (fix31)sp_globals.xmin << 16; /* for other cases don't use round on x */ - - if (sp_globals.tcb.ymode == 2) /* for Y pix is function of X orus only, add round error */ - yorg = (((fix31)sp_globals.ymin << 16) + (sp_globals.rnd_xmin << sp_globals.poshift)); - else - if (sp_globals.tcb.ymode == 3) /* for Y pix is function of -X orus only, sub round */ - yorg = (((fix31)sp_globals.ymin << 16) - (sp_globals.rnd_xmin << sp_globals.poshift)); - else /* all other cases have no round error on yorg */ - yorg = (fix31)sp_globals.ymin << 16; - - open_bitmap(sp_globals.set_width.x, sp_globals.set_width.y, xorg, yorg, - sp_globals.xmax - sp_globals.xmin, sp_globals.ymax - sp_globals.ymin); - if (sp_globals.intercept_oflo) - { - sp_globals.y_band.band_min = sp_globals.ymin; - sp_globals.y_band.band_max = sp_globals.ymax; - init_intercepts_out(); - sp_globals.first_pass = FALSE; - sp_globals.extents_running = FALSE; - return FALSE; - } - else - { - sp_proc_intercepts_screen(); - close_bitmap(); - return TRUE; - } - } -else - { - if (sp_globals.intercept_oflo) - { - reduce_band_size_out(); - init_intercepts_out(); - return FALSE; - } - else - { - sp_proc_intercepts_screen(); - if (next_band_out()) - { - init_intercepts_out(); - return FALSE; - } - close_bitmap(); - return TRUE; - } - } -} -#endif - -#if INCL_SCREEN -FUNCTION LOCAL void sp_add_intercept_screen( -GDECL -fix15 y, /* Y coordinate in relative pixel units */ - /* (0 is lowest sample in band) */ -fix31 x) /* X coordinate of intercept in subpixel units */ - -/* Called by line() to add an intercept to the intercept list structure - */ - -{ -register fix15 from; /* Insertion pointers for the linked list sort */ -register fix15 to; -register fix15 xloc; -register fix15 xfrac; - -#if DEBUG -printf(" Add intercept(%2d, %x)\n", y + sp_globals.y_band.band_min, x); - -/* Bounds checking IS done in debug mode */ -if (y < 0) /* Y value below bottom of current band? */ - { - printf(" Intecerpt less than 0!!!\007\n"); - return; - } - -if (y > (sp_globals.no_y_lists - 1)) /* Y value above top of current band? */ - { - printf(" Intercept too big for band!!!!!\007\n"); - return; - } -#endif - -/* Store new values */ - -sp_intercepts.car[sp_globals.next_offset] = xloc = (fix15)(x >> 16); -sp_intercepts.inttype[sp_globals.next_offset] = sp_intercepts.leftedge | (xfrac = ((x >> 8) & FRACTION)); - -/* Find slot to insert new element (between from and to) */ - -from = y; /* Start at list head */ - -while( (to = sp_intercepts.cdr[from]) != 0) /* Until to == end of list */ - { - if (xloc < sp_intercepts.car[to]) /* If next item is larger than or same as this one... */ - goto insert_element; /* ... drop out and insert here */ - else if (xloc == sp_intercepts.car[to] && xfrac < (sp_intercepts.inttype[to] & FRACTION)) - goto insert_element; /* ... drop out and insert here */ - from = to; /* move forward in list */ - } - -insert_element: /* insert element "sp_globals.next_offset" between elements "from" */ - /* and "to" */ - -sp_intercepts.cdr[from] = sp_globals.next_offset; -sp_intercepts.cdr[sp_globals.next_offset] = to; - -if (++sp_globals.next_offset >= MAX_INTERCEPTS) /* Intercept buffer full? */ - { - sp_globals.intercept_oflo = TRUE; -/* There may be a few more calls to "add_intercept" from the current line */ -/* To avoid problems, we set next_offset to a safe value. We don't care */ -/* if the intercept table gets trashed at this point */ - sp_globals.next_offset = sp_globals.first_offset; - } -} - -#endif - -#if INCL_SCREEN -FUNCTION LOCAL void sp_proc_intercepts_screen() -GDECL - -/* Called by sp_make_char to output accumulated intercept lists - * Clips output to sp_globals.xmin, sp_globals.xmax, sp_globals.ymin, sp_globals.ymax boundaries - */ -{ -register fix15 i,j, jplus1, iminus1; -fix15 k,nextk, previ; -register fix15 from, to; /* Start and end of run in pixel units - relative to left extent of character */ -register fix15 y; -register fix15 scan_line; - fix15 first_y, last_y; - fix15 xsave; - - -fix15 diff; - -#if DEBUG -printf("\nPROC_INTERCEPTS_SCREEN: Intercept lists before:\n"); -#endif - -#if INCL_CLIPPING -if ((sp_globals.specs.flags & CLIP_LEFT) != 0) - clipleft = TRUE; -else - clipleft = FALSE; -if ((sp_globals.specs.flags & CLIP_RIGHT) != 0) - clipright = TRUE; -else - clipright = FALSE; -if (clipleft || clipright) - { - xmax = sp_globals.clip_xmax + sp_globals.xmin; - xmin = sp_globals.clip_xmin + sp_globals.xmin; - } -if (!clipright) - xmax = ((sp_globals.set_width.x+32768L) >> 16); -#endif - -if ((first_y = sp_globals.y_band.band_max) >= sp_globals.ymax) - first_y = sp_globals.ymax - 1; /* Clip to sp_globals.ymax boundary */ - -if ((last_y = sp_globals.y_band.band_min) < sp_globals.ymin) - last_y = sp_globals.ymin; /* Clip to sp_globals.ymin boundary */ - -last_y -= sp_globals.y_band.band_min; - -#if DEBUG -/* Print out all of the intercept info */ -scan_line = sp_globals.ymax - first_y - 1; - -for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--, scan_line++) - { - i = y; /* Index head of intercept list */ - while ((i = sp_intercepts.cdr[i]) != 0) /* Link to next intercept if present */ - { - if ((from = sp_intercepts.car[i] - sp_globals.xmin) < 0) - from = 0; /* Clip to sp_globals.xmin boundary */ - i = sp_intercepts.cdr[i]; /* Link to next intercept */ - if (i == 0) /* End of list? */ - { - printf("****** proc_intercepts: odd number of intercepts\n"); - break; - } - if ((to = sp_intercepts.car[i]) > sp_globals.xmax) - to = sp_globals.xmax - sp_globals.xmin; /* Clip to sp_globals.xmax boundary */ - else - to -= sp_globals.xmin; - printf(" Y = %2d (scanline %2d): %d %d:\n", - y + sp_globals.y_band.band_min, scan_line, from, to); - } - } -#endif - -/* CHECK INTERCEPT LIST FOR DROPOUT AND WINDING, FIX IF NECESSARY */ - -for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--) - { - previ = y; - i = sp_intercepts.cdr[y]; /* Index head of intercept list */ - while (i != 0) /* Link to next intercept if present */ - { - j = i; - i = sp_intercepts.cdr[i]; /* Link to next intercept */ - if (sp_intercepts.inttype[i] & LEFT_INT) - { - if (sp_intercepts.inttype[j] & LEFT_INT) - { - do { i = sp_intercepts.cdr[i]; } while (sp_intercepts.inttype[i] & LEFT_INT); - do { i = sp_intercepts.cdr[i]; } while (sp_intercepts.cdr[i] && !(sp_intercepts.inttype[sp_intercepts.cdr[i]] & LEFT_INT)); - sp_intercepts.cdr[j] = i; - } - else - { - xsave = sp_intercepts.car[j]; - sp_intercepts.car[j] = sp_intercepts.car[i]; - sp_intercepts.car[i] = xsave; - - xsave = sp_intercepts.inttype[j]; - sp_intercepts.inttype[j] = sp_intercepts.inttype[i] & FRACTION; - sp_intercepts.inttype[i] = xsave | LEFT_INT; - - sp_intercepts.cdr[previ] = i; - sp_intercepts.cdr[j] = sp_intercepts.cdr[i]; - sp_intercepts.cdr[i] = j; - i = j; - j = sp_intercepts.cdr[previ]; - } - } - - if (sp_intercepts.car[j] < sp_globals.xmin) - sp_intercepts.car[j] = sp_globals.xmin; /* Clip to sp_globals.xmin boundary */ - - if (sp_intercepts.car[i] > sp_globals.xmax) - sp_intercepts.car[i] = sp_globals.xmax; - - if (sp_intercepts.car[j] >= sp_intercepts.car[i]) - { - if ((ufix16)(sp_intercepts.inttype[j] & FRACTION) + (ufix16)(sp_intercepts.inttype[i] & FRACTION) > sp_intercepts.fracpix) - ++sp_intercepts.car[i]; - else - --sp_intercepts.car[j]; - } - if (sp_globals.first_pass) - { - if (sp_intercepts.inttype[i-1] & END_INT) - { - for (iminus1 = i+1; !(sp_intercepts.inttype[iminus1] & END_INT); iminus1++) - ; - } - else - iminus1 = i-1; - - if (sp_intercepts.inttype[j] & END_INT) - { - for (jplus1 = j-1; !(sp_intercepts.inttype[jplus1] & END_INT); jplus1--) - ; - jplus1++; - } - else - jplus1 = j+1; - - if ((sp_intercepts.inttype[iminus1] & LEFT_INT)) - { - if ( sp_intercepts.car[jplus1] > sp_intercepts.car[i]) - { - diff = sp_intercepts.car[jplus1] - sp_intercepts.car[i]; - sp_intercepts.car[i] += diff/2; - sp_intercepts.car[jplus1] -= diff/2; - if (diff & 1) - { - if ((ufix16)(sp_intercepts.inttype[i] & FRACTION) + (ufix16)(sp_intercepts.inttype[jplus1] & FRACTION) > sp_intercepts.fracpix) - sp_intercepts.car[i] ++; - else - sp_intercepts.car[jplus1]--; - } - } - } - else if (!(sp_intercepts.inttype[jplus1] & LEFT_INT)) - { - if (sp_intercepts.car[iminus1] < sp_intercepts.car[j]) - { - diff = sp_intercepts.car[j] - sp_intercepts.car[iminus1]; - sp_intercepts.car[j] -= diff/2; - sp_intercepts.car[iminus1] += diff/2; - if (diff & 1) - { - if ((ufix16)(sp_intercepts.inttype[j] & FRACTION) + - (ufix16)(sp_intercepts.inttype[iminus1] & FRACTION) > sp_intercepts.fracpix) - sp_intercepts.car[iminus1]++; - else - sp_intercepts.car[j]--; - } - } - } - if (sp_globals.tcb.mirror == -1) - { - if (sp_intercepts.inttype[j-1] & END_INT) - { - for (jplus1 = j+1; !(sp_intercepts.inttype[jplus1] & END_INT); jplus1++) - ; - } - else - { - jplus1 = j-1; - } - } - - if (!(sp_intercepts.inttype[jplus1] & LEFT_INT) && - sp_intercepts.car[j] > sp_intercepts.car[jplus1]) - { - k = sp_intercepts.cdr[y - 1]; - while (k > 0) - { - nextk = sp_intercepts.cdr[k]; - if (!(sp_intercepts.inttype[k] & LEFT_INT) && - (sp_intercepts.inttype[nextk] & LEFT_INT) && - sp_intercepts.car[nextk] > sp_intercepts.car[jplus1]) - { - if ((diff=sp_intercepts.car[j] - sp_intercepts.car[k]) > 0) - { - if (diff <= (sp_intercepts.car[nextk] - sp_intercepts.car[jplus1])) - { - sp_intercepts.car[j] -= diff/2; - sp_intercepts.car[k] += diff/2; - if (diff & 1) - { - if ((ufix16)(sp_intercepts.inttype[j] & FRACTION) + - (ufix16)(sp_intercepts.inttype[k] & FRACTION) > sp_intercepts.fracpix) - sp_intercepts.car[j]--; - else - sp_intercepts.car[k]++; - } - } - else - { - diff = sp_intercepts.car[nextk] - sp_intercepts.car[jplus1]; - sp_intercepts.car[nextk] -= diff/2; - sp_intercepts.car[jplus1] += diff/2; - if (diff & 1) - { - if ((ufix16)(sp_intercepts.inttype[jplus1] & FRACTION) + - (ufix16)(sp_intercepts.inttype[nextk] & FRACTION) > sp_intercepts.fracpix) - sp_intercepts.car[nextk]--; - else - sp_intercepts.car[jplus1]++; - } - } - } - break; - } - k = nextk; - } - } - if (j > 0 && sp_intercepts.car[j-1] > sp_intercepts.car[i] && !(sp_intercepts.inttype[j-1] & END_INT)) - { - diff = sp_intercepts.car[j-1] - sp_intercepts.car[i]; - sp_intercepts.car[i] += diff/2; - sp_intercepts.car[j-1] -= diff/2; - if (diff & 1) - { - if ((ufix16)(sp_intercepts.inttype[i] & FRACTION) + (ufix16)(sp_intercepts.inttype[j-1] & FRACTION) > sp_intercepts.fracpix) - sp_intercepts.car[i]++; - else - sp_intercepts.car[j-1]--; - } - } - if (sp_intercepts.car[i+1] < sp_intercepts.car[j] && !(sp_intercepts.inttype[i] & END_INT)) - { - diff = sp_intercepts.car[j] - sp_intercepts.car[i+1]; - sp_intercepts.car[j] -= diff/2; - sp_intercepts.car[i+1] += diff/2; - if (diff & 1) - { - if ((ufix16)(sp_intercepts.inttype[j] & FRACTION) + (ufix16)(sp_intercepts.inttype[i+1] & FRACTION) > sp_intercepts.fracpix) - sp_intercepts.car[i+1]++; - else - sp_intercepts.car[j]--; - } - - } - previ = i; - } - i = sp_intercepts.cdr[i]; - } - } - -#if DEBUG -printf("\nPROC_INTERCEPTS_SCREEN: Intercept lists after:\n"); -/* Print out all of the intercept info */ -scan_line = sp_globals.ymax - first_y - 1; - -for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--, scan_line++) - { - i = y; /* Index head of intercept list */ - while ((i = sp_intercepts.cdr[i]) != 0) /* Link to next intercept if present */ - { - if ((from = sp_intercepts.car[i] - sp_globals.xmin) < 0) - from = 0; /* Clip to sp_globals.xmin boundary */ - i = sp_intercepts.cdr[i]; /* Link to next intercept */ - if (i == 0) /* End of list? */ - { - printf("****** proc_intercepts: odd number of intercepts\n"); - break; - } - if ((to = sp_intercepts.car[i]) > sp_globals.xmax) - to = sp_globals.xmax - sp_globals.xmin; /* Clip to sp_globals.xmax boundary */ - else - to -= sp_globals.xmin; - printf(" Y = %2d (scanline %2d): %d %d:\n", - y + sp_globals.y_band.band_min, scan_line, from, to); - } - } -#endif - -/* INTERCEPTS ALL PATCHED, NOW DRAW THE IMAGE */ -scan_line = sp_globals.ymax - first_y - 1; - -for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--, scan_line++) - { - i = sp_intercepts.cdr[y]; /* Index head of intercept list */ - while (i != 0) /* Link to next intercept if present */ - { - from = sp_intercepts.car[i]; - i = sp_intercepts.cdr[i]; /* Link to next intercept */ - to = sp_intercepts.car[i]; -#if INCL_CLIPPING - if (clipleft) - { - if (to <= xmin) - { - i = sp_intercepts.cdr[i]; - continue; - } - if (from < xmin) - from = xmin; - } - if (clipright) - { - if (from >= xmax) - { - i = sp_intercepts.cdr[i]; - continue; - } - if (to > xmax) - to = xmax; - } -#endif - set_bitmap_bits(scan_line, from-sp_globals.xmin, to-sp_globals.xmin); - i = sp_intercepts.cdr[i]; - } - } -} - -#endif diff --git a/nx-X11/lib/font/Speedo/out_util.c b/nx-X11/lib/font/Speedo/out_util.c deleted file mode 100644 index 171241030..000000000 --- a/nx-X11/lib/font/Speedo/out_util.c +++ /dev/null @@ -1,341 +0,0 @@ -/* $Xorg: out_util.c,v 1.3 2000/08/17 19:46:26 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/out_util.c,v 1.2 1999/02/07 06:18:17 dawes Exp $ */ - - -#ifdef HAVE_CONFIG_H -#include -#endif -#define DEBUG 0 - -/*************************** O U T _ U T I L . C ***************************** - * * - * This is a utility module share by all bitmap output modules * - * * - *****************************************************************************/ - - -#include "spdo_prv.h" /* General definitions for Speedo */ -/* absolute value function */ -#define ABS(X) ( (X < 0) ? -X : X) -#if INCL_BLACK || INCL_2D || INCL_SCREEN - -FUNCTION void init_char_out( -GDECL -point_t Psw, point_t Pmin, point_t Pmax) -{ -sp_globals.set_width.x = (fix31)Psw.x << sp_globals.poshift; -sp_globals.set_width.y = (fix31)Psw.y << sp_globals.poshift; -set_first_band_out(Pmin, Pmax); -init_intercepts_out(); -if (sp_globals.normal) - { - sp_globals.bmap_xmin = Pmin.x; - sp_globals.bmap_xmax = Pmax.x; - sp_globals.bmap_ymin = Pmin.y; - sp_globals.bmap_ymax = Pmax.y; - sp_globals.extents_running = FALSE; - } -else - { - sp_globals.bmap_xmin = 32000; - sp_globals.bmap_xmax = -32000; - sp_globals.bmap_ymin = 32000; - sp_globals.bmap_ymax = -32000; - sp_globals.extents_running = TRUE; - } -sp_globals.first_pass = TRUE; -} - -FUNCTION void begin_sub_char_out( -GDECL -point_t Psw, -point_t Pmin, -point_t Pmax) -/* Called at the start of each sub-character in a composite character - */ -{ -#if DEBUG -printf("BEGIN_SUB_CHAR_out(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f\n", - (real)Psw.x / (real)sp_globals.onepix, (real)Psw.y / (real)sp_globals.onepix, - (real)Pmin.x / (real)sp_globals.onepix, (real)Pmin.y / (real)sp_globals.onepix, - (real)Pmax.x / (real)sp_globals.onepix, (real)Pmax.y / (real)sp_globals.onepix); -#endif -restart_intercepts_out(); -if (!sp_globals.extents_running) - { - sp_globals.bmap_xmin = 32000; - sp_globals.bmap_xmax = -32000; - sp_globals.bmap_ymin = 32000; - sp_globals.bmap_ymax = -32000; - sp_globals.extents_running = TRUE; - } -} - -FUNCTION void curve_out( -GDECL -point_t P1, point_t P2, point_t P3, -fix15 depth) -/* Called for each curve in the transformed character if curves out enabled - */ -{ -#if DEBUG -printf("CURVE_OUT(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f)\n", - (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix, - (real)P2.x / (real)sp_globals.onepix, (real)P2.y / (real)sp_globals.onepix, - (real)P3.x / (real)sp_globals.onepix, (real)P3.y / (real)sp_globals.onepix); -#endif -} - - - -FUNCTION void end_contour_out() -GDECL -/* Called after the last vector in each contour - */ -{ -#if DEBUG -printf("END_CONTOUR_OUT()\n"); -#endif -} - - -FUNCTION void end_sub_char_out() -GDECL -/* Called after the last contour in each sub-character in a compound character - */ -{ -#if DEBUG -printf("END_SUB_CHAR_OUT()\n"); -#endif -} - - -FUNCTION void init_intercepts_out() -GDECL -/* Called to initialize intercept storage data structure - */ - -{ -fix15 i; -fix15 no_lists; - -#if DEBUG -printf(" Init intercepts (Y band from %d to %d)\n", sp_globals.y_band.band_min, sp_globals.y_band.band_max); -if (sp_globals.x_scan_active) - printf(" (X band from %d to %d)\n", sp_globals.x_band.band_min, sp_globals.x_band.band_max); -#endif - -sp_globals.intercept_oflo = FALSE; - -sp_globals.no_y_lists = sp_globals.y_band.band_max - sp_globals.y_band.band_min + 1; -#if INCL_2D -if (sp_globals.output_mode == MODE_2D) - { - sp_globals.no_x_lists = sp_globals.x_scan_active ? - sp_globals.x_band.band_max - sp_globals.x_band.band_min + 1 : 0; - no_lists = sp_globals.no_y_lists + sp_globals.no_x_lists; - } -else -#endif - no_lists = sp_globals.no_y_lists; - -#if INCL_2D -sp_globals.y_band.band_floor = 0; -sp_globals.y_band.band_ceiling = sp_globals.no_y_lists; -#endif - -if (no_lists >= MAX_INTERCEPTS) /* Not enough room for list table? */ - { - no_lists = sp_globals.no_y_lists = MAX_INTERCEPTS; - sp_globals.intercept_oflo = TRUE; - sp_globals.y_band.band_min = sp_globals.y_band.band_max - sp_globals.no_y_lists + 1; -#if INCL_2D - sp_globals.y_band.band_array_offset = sp_globals.y_band.band_min; - sp_globals.y_band.band_ceiling = sp_globals.no_y_lists; - sp_globals.no_x_lists = 0; - sp_globals.x_scan_active = FALSE; -#endif - } - -for (i = 0; i < no_lists; i++) /* For each active value... */ - { -#if INCL_SCREEN - if (sp_globals.output_mode == MODE_SCREEN) - sp_intercepts.inttype[i]=0; -#endif - sp_intercepts.cdr[i] = 0; /* Mark each intercept list empty */ - } - -sp_globals.first_offset = sp_globals.next_offset = no_lists; - -#if INCL_2D -sp_globals.y_band.band_array_offset = sp_globals.y_band.band_min; -sp_globals.x_band.band_array_offset = sp_globals.x_band.band_min - sp_globals.no_y_lists; -sp_globals.x_band.band_floor = sp_globals.no_y_lists; -sp_globals.x_band.band_ceiling = no_lists; -#endif -#if INCL_SCREEN -sp_intercepts.inttype[sp_globals.no_y_lists-1] = END_INT; -#endif - -} - - -FUNCTION void restart_intercepts_out() -GDECL - -/* Called by sp_make_char when a new sub character is started - * Freezes current sorted lists - */ - -{ - -#if DEBUG -printf(" Restart intercepts:\n"); -#endif -sp_globals.first_offset = sp_globals.next_offset; -} - - - -FUNCTION void set_first_band_out( -GDECL -point_t Pmin, -point_t Pmax) -{ - -sp_globals.ymin = Pmin.y; -sp_globals.ymax = Pmax.y; - -sp_globals.ymin = (sp_globals.ymin - sp_globals.onepix + 1) >> sp_globals.pixshift; -sp_globals.ymax = (sp_globals.ymax + sp_globals.onepix - 1) >> sp_globals.pixshift; - -#if INCL_CLIPPING - switch(sp_globals.tcb0.xtype) - { - case 1: /* 180 degree rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_ymin = -1* sp_globals.clip_ymin; - if (sp_globals.ymin < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - if (sp_globals.ymax > sp_globals.clip_ymax) - sp_globals.ymax = sp_globals.clip_ymax; - } - break; - case 2: /* 90 degree rotation */ - sp_globals.clip_ymax = 0; - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - break; - case 3: /* 270 degree rotation */ - sp_globals.clip_ymax = ((sp_globals.set_width.y+32768L) >> 16); - if ((sp_globals.specs.flags & CLIP_TOP) && - (sp_globals.ymax > sp_globals.clip_ymax)) - sp_globals.ymax = sp_globals.clip_ymax; - sp_globals.clip_ymin = 0; - if ((sp_globals.specs.flags & CLIP_BOTTOM) && - (sp_globals.ymin < sp_globals.clip_ymin)) - sp_globals.ymin = sp_globals.clip_ymin; - break; - default: /* this is for zero degree rotation and arbitrary rotation */ - if (sp_globals.specs.flags & CLIP_TOP) - { - sp_globals.clip_ymax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - if (sp_globals.ymax > sp_globals.clip_ymax) - sp_globals.ymax = sp_globals.clip_ymax; - } - if (sp_globals.specs.flags & CLIP_BOTTOM) - { - sp_globals.clip_ymin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<> sp_globals.multshift; - sp_globals.clip_ymin = - sp_globals.clip_ymin; - if (sp_globals.ymin < sp_globals.clip_ymin) - sp_globals.ymin = sp_globals.clip_ymin; - } - break; - } -#endif -sp_globals.y_band.band_min = sp_globals.ymin; -sp_globals.y_band.band_max = sp_globals.ymax - 1; - -sp_globals.xmin = (Pmin.x + sp_globals.pixrnd) >> sp_globals.pixshift; -sp_globals.xmax = (Pmax.x + sp_globals.pixrnd) >> sp_globals.pixshift; - - -#if INCL_2D -sp_globals.x_band.band_min = sp_globals.xmin - 1; /* subtract one pixel of "safety margin" */ -sp_globals.x_band.band_max = sp_globals.xmax /* - 1 + 1 */; /* Add one pixel of "safety margin" */ -#endif -} - - - - - - - -FUNCTION void reduce_band_size_out() -GDECL -{ -sp_globals.y_band.band_min = sp_globals.y_band.band_max - ((sp_globals.y_band.band_max - sp_globals.y_band.band_min) >> 1); -#if INCL_2D -sp_globals.y_band.band_array_offset = sp_globals.y_band.band_min; -#endif -} - - -FUNCTION boolean next_band_out() -GDECL -{ -fix15 tmpfix15; - -if (sp_globals.y_band.band_min <= sp_globals.ymin) - return FALSE; -tmpfix15 = sp_globals.y_band.band_max - sp_globals.y_band.band_min; -sp_globals.y_band.band_max = sp_globals.y_band.band_min - 1; -sp_globals.y_band.band_min = sp_globals.y_band.band_max - tmpfix15; -if (sp_globals.y_band.band_min < sp_globals.ymin) - sp_globals.y_band.band_min = sp_globals.ymin; -#if INCL_2D -sp_globals.y_band.band_array_offset = sp_globals.y_band.band_min; -#endif -return TRUE; -} -#endif - diff --git a/nx-X11/lib/font/Speedo/reset.c b/nx-X11/lib/font/Speedo/reset.c deleted file mode 100644 index 4cb9f7de0..000000000 --- a/nx-X11/lib/font/Speedo/reset.c +++ /dev/null @@ -1,131 +0,0 @@ -/* $Xorg: reset.c,v 1.3 2000/08/17 19:46:26 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/reset.c,v 1.2 1999/02/07 06:18:17 dawes Exp $ */ - - - -/******************************* R E S E T . C ******************************* - * * - * This module provides initialization functions. * - * * - ****************************************************************************/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spdo_prv.h" /* General definitions for Speedo */ -#include "keys.h" /* Font decryption keys */ - -#define DEBUG 0 - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - -/***** EXTERNAL VARIABLES *****/ - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC VARIABLES *****/ - -/***** STATIC FUNCTIONS *****/ - - -FUNCTION void reset() -GDECL -/* - * Called by the host software to intialize the Speedo mechanism - */ -{ -sp_globals.specs_valid = FALSE; /* Flag specs not valid */ - -/* Reset decryption key */ -sp_globals.key32 = (KEY3 << 8) | KEY2; -sp_globals.key4 = KEY4; -sp_globals.key6 = KEY6; -sp_globals.key7 = KEY7; -sp_globals.key8 = KEY8; - -#if INCL_RULES -sp_globals.constr.font_id_valid = FALSE; -#endif - -#if INCL_MULTIDEV -#if INCL_BLACK || INCL_SCREEN || INCL_2D -sp_globals.bitmap_device_set = FALSE; -#endif -#if INCL_OUTLINE -sp_globals.outline_device_set = FALSE; -#endif -#endif -} - -#if INCL_KEYS -FUNCTION void set_key( -GDECL -ufix8 key[]) /* Specified decryption key */ -/* - * Dynamically sets font decryption key. - */ -{ -sp_globals.key32 = ((ufix16)key[3] << 8) | key[2]; -sp_globals.key4 = key[4]; -sp_globals.key6 = key[6]; -sp_globals.key7 = key[7]; -sp_globals.key8 = key[8]; -} -#endif - - - -FUNCTION ufix16 get_cust_no( -GDECL -buff_t font_buff) -/* - returns customer number from font -*/ -{ -ufix8 FONTFAR *hdr2_org; -ufix16 private_off; - -private_off = read_word_u(font_buff.org + FH_HEDSZ); -if (private_off + FH_CUSNR > font_buff.no_bytes) - { - report_error(1); /* Insufficient font data loaded */ - return FALSE; - } - -hdr2_org = font_buff.org + private_off; - -return (read_word_u(hdr2_org + FH_CUSNR)); -} - - diff --git a/nx-X11/lib/font/Speedo/set_spcs.c b/nx-X11/lib/font/Speedo/set_spcs.c deleted file mode 100644 index b69b13f34..000000000 --- a/nx-X11/lib/font/Speedo/set_spcs.c +++ /dev/null @@ -1,773 +0,0 @@ -/* $Xorg: set_spcs.c,v 1.3 2000/08/17 19:46:26 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/set_spcs.c,v 1.3 2001/01/17 19:43:17 dawes Exp $ */ - - -/*************************** S E T _ S P C S . C ***************************** - * * - * This module implements all sp_set_specs() functionality. * - * * - ****************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif -#define SET_SPCS -#include "spdo_prv.h" /* General definitions for Speedo */ -#include "keys.h" - -#define DEBUG 0 - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif - -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - -/****** EXTERNAL VARIABLES *****/ - -/***** STATIC VARIABLES *****/ - - -/****** STATIC FUNCTIONS *****/ - -static boolean sp_setup_consts(PROTO_DECL2 fix15 xmin, fix15 xmax, - fix15 ymin, fix15 ymax); -static void sp_setup_tcb(PROTO_DECL2 tcb_t GLOBALFAR *ptcb); -static fix15 sp_setup_mult(PROTO_DECL2 fix31 input_mult); -static fix31 sp_setup_offset(PROTO_DECL2 fix31 input_offset); - - - -FUNCTION boolean set_specs( -GDECL -specs_t STACKFAR *specsarg) /* Bundle of conversion specifications */ -/* - * Called by host software to set character generation specifications - */ -{ -fix31 offcd; /* Offset to start of character directory */ -fix31 ofcns; /* Offset to start of constraint data */ -fix31 cd_size; /* Size of character directory */ -fix31 no_bytes_min; /* Min number of bytes in font buffer */ -ufix16 font_id; /* Font ID */ -ufix16 private_off; /* offset to private header */ -fix15 xmin; /* Minimum X ORU value in font */ -fix15 xmax; /* Maximum X ORU value in font */ -fix15 ymin; /* Minimum Y ORU value in font */ -fix15 ymax; /* Maximum Y ORU value in font */ - -sp_globals.specs_valid = FALSE; /* Flag specs not valid */ - -sp_globals.specs = *specsarg; /* copy specs structure into sp_globals */ -sp_globals.pspecs = &sp_globals.specs; -sp_globals.font = *sp_globals.pspecs->pfont; -sp_globals.pfont = &sp_globals.font; -sp_globals.font_org = sp_globals.font.org; - -if (read_word_u(sp_globals.font_org + FH_FMVER + 4) != 0x0d0a) - { - report_error(4); /* Font format error */ - return FALSE; - } -if (read_word_u(sp_globals.font_org + FH_FMVER + 6) != 0x0000) - { - report_error(4); /* Font format error */ - return FALSE; - } - -if (get_cust_no(*specsarg->pfont) == 0) - { - sp_globals.key32 = 0; - sp_globals.key4 = 0; - sp_globals.key6 = 0; - sp_globals.key7 = 0; - sp_globals.key8 = 0; - } -else - { - sp_globals.key32 = (KEY3 << 8) | KEY2; - sp_globals.key4 = KEY4; - sp_globals.key6 = KEY6; - sp_globals.key7 = KEY7; - sp_globals.key8 = KEY8; - } - - -sp_globals.no_chars_avail = read_word_u(sp_globals.font_org + FH_NCHRF); - -/* Read sp_globals.orus per em from font header */ -sp_globals.orus_per_em = read_word_u(sp_globals.font_org + FH_ORUPM); - -/* compute address of private header */ -private_off = read_word_u(sp_globals.font_org + FH_HEDSZ); -sp_globals.hdr2_org = sp_globals.font_org + private_off; - -/* set metric resolution if specified, default to outline res otherwise */ -if (private_off > EXP_FH_METRES) - { - sp_globals.metric_resolution = read_word_u(sp_globals.font_org + EXP_FH_METRES); - } -else - { - sp_globals.metric_resolution = sp_globals.orus_per_em; - } - -#if INCL_METRICS -sp_globals.kern.tkorg = sp_globals.font_org + read_long(sp_globals.hdr2_org + FH_OFFTK); -sp_globals.kern.pkorg = sp_globals.font_org + read_long(sp_globals.hdr2_org + FH_OFFPK); -sp_globals.kern.no_tracks = read_word_u(sp_globals.font_org + FH_NKTKS); -sp_globals.kern.no_pairs = read_word_u(sp_globals.font_org + FH_NKPRS); -#endif - -offcd = read_long(sp_globals.hdr2_org + FH_OFFCD); /* Read offset to character directory */ -ofcns = read_long(sp_globals.hdr2_org + FH_OFCNS); /* Read offset to constraint data */ -cd_size = ofcns - offcd; -if ((((sp_globals.no_chars_avail << 1) + 3) != cd_size) && - (((sp_globals.no_chars_avail * 3) + 4) != cd_size)) - { - report_error(4); /* Font format error */ - return FALSE; - } - -#if INCL_LCD /* Dynamic character data load suppoorted? */ -#if INCL_METRICS -no_bytes_min = read_long(sp_globals.hdr2_org + FH_OCHRD); /* Offset to character data */ -#else /* Dynamic character data load not supported? */ -no_bytes_min = read_long(sp_globals.hdr2_org + FH_OFFTK); /* Offset to track kerning data */ -#endif -#else /* Dynamic character data load not supported? */ -no_bytes_min = read_long(sp_globals.hdr2_org + FH_NBYTE); /* Offset to EOF + 1 */ -#endif - -sp_globals.font_buff_size = sp_globals.pfont->no_bytes; -if (sp_globals.font_buff_size < no_bytes_min) /* Minimum data not loaded? */ - { - report_error(1); /* Insufficient font data loaded */ - return FALSE; - } - -sp_globals.pchar_dir = sp_globals.font_org + offcd; -sp_globals.first_char_idx = read_word_u(sp_globals.font_org + FH_FCHRF); - -/* Register font name with sp_globals.constraint mechanism */ -#if INCL_RULES -font_id = read_word_u(sp_globals.font_org + FH_FNTID); -if (!(sp_globals.constr.font_id_valid) || (sp_globals.constr.font_id != font_id)) - { - sp_globals.constr.font_id = font_id; - sp_globals.constr.font_id_valid = TRUE; - sp_globals.constr.data_valid = FALSE; - } -sp_globals.constr.org = sp_globals.font_org + ofcns; -sp_globals.constr.active = ((sp_globals.pspecs->flags & CONSTR_OFF) == 0); -#endif - -/* Set up sliding point constants */ -/* Set pixel shift to accomodate largest transformed pixel value */ -xmin = read_word_u(sp_globals.font_org + FH_FXMIN); -xmax = read_word_u(sp_globals.font_org + FH_FXMAX); -ymin = read_word_u(sp_globals.font_org + FH_FYMIN); -ymax = read_word_u(sp_globals.font_org + FH_FYMAX); - -if (!sp_setup_consts(xmin,xmax,ymin,ymax)) - { - report_error(3); /* Requested specs out of range */ - return FALSE; - } -#if INCL_ISW -/* save the value of the max x oru that the fixed point constants are based on*/ -sp_globals.isw_xmax = xmax; -#endif - -/* Setup transformation control block */ -sp_setup_tcb(&sp_globals.tcb0); - - -/* Select output module */ -sp_globals.output_mode = sp_globals.pspecs->flags & 0x0007; - -#if INCL_USEROUT -if (!init_userout(sp_globals.pspecs)) -#endif - -switch (sp_globals.output_mode) - { -#if INCL_BLACK -case MODE_BLACK: /* Output mode 0 (Black writer) */ - sp_globals.init_out = sp_init_black; - sp_globals.begin_char = sp_begin_char_black; - sp_globals.begin_sub_char = sp_begin_sub_char_out; - sp_globals.begin_contour = sp_begin_contour_black; - sp_globals.curve = sp_curve_out; - sp_globals.line = sp_line_black; - sp_globals.end_contour = sp_end_contour_out; - sp_globals.end_sub_char = sp_end_sub_char_out; - sp_globals.end_char = sp_end_char_black; - break; -#endif - -#if INCL_SCREEN -case MODE_SCREEN: /* Output mode 1 (Screen writer) */ - sp_globals.init_out = sp_init_screen; - sp_globals.begin_char = sp_begin_char_screen; - sp_globals.begin_sub_char = sp_begin_sub_char_out; - sp_globals.begin_contour = sp_begin_contour_screen; - sp_globals.curve = sp_curve_screen; - sp_globals.line = sp_line_screen; - sp_globals.end_contour = sp_end_contour_screen; - sp_globals.end_sub_char = sp_end_sub_char_out; - sp_globals.end_char = sp_end_char_screen; - break; -#endif - -#if INCL_OUTLINE -case MODE_OUTLINE: /* Output mode 2 (Vector) */ - sp_globals.init_out = sp_init_outline; - sp_globals.begin_char = sp_begin_char_outline; - sp_globals.begin_sub_char = sp_begin_sub_char_outline; - sp_globals.begin_contour = sp_begin_contour_outline; - sp_globals.curve = sp_curve_outline; - sp_globals.line = sp_line_outline; - sp_globals.end_contour = sp_end_contour_outline; - sp_globals.end_sub_char = sp_end_sub_char_outline; - sp_globals.end_char = sp_end_char_outline; - break; -#endif - -#if INCL_2D -case MODE_2D: /* Output mode 3 */ - sp_globals.init_out = sp_init_2d; - sp_globals.begin_char = sp_begin_char_2d; - sp_globals.begin_sub_char = sp_begin_sub_char_out; - sp_globals.begin_contour = sp_begin_contour_2d; - sp_globals.curve = sp_curve_out; - sp_globals.line = sp_line_2d; - sp_globals.end_contour = sp_end_contour_out; - sp_globals.end_sub_char = sp_end_sub_char_out; - sp_globals.end_char = sp_end_char_2d; - break; -#endif - -default: - report_error(8); /* Unsupported mode requested */ - return FALSE; - } - - if (!fn_init_out(sp_globals.pspecs)) - { - report_error(5); - return FALSE; - } - - -sp_globals.curves_out = sp_globals.pspecs->flags & CURVES_OUT; - -if (sp_globals.pspecs->flags & BOGUS_MODE) /* Linear transformation requested? */ - { - sp_globals.tcb0.xtype = sp_globals.tcb0.ytype = 4; - } -else /* Intelligent transformation requested? */ - { -#if INCL_RULES -#else - report_error(7); /* Rules requested; not supported */ - return FALSE; -#endif - } - -if ((sp_globals.pspecs->flags & SQUEEZE_LEFT) || - (sp_globals.pspecs->flags & SQUEEZE_RIGHT) || - (sp_globals.pspecs->flags & SQUEEZE_TOP) || - (sp_globals.pspecs->flags & SQUEEZE_BOTTOM) ) - { -#if (INCL_SQUEEZING) -#else - report_error(11); - return FALSE; -#endif - } - -if ((sp_globals.pspecs->flags & CLIP_LEFT) || - (sp_globals.pspecs->flags & CLIP_RIGHT) || - (sp_globals.pspecs->flags & CLIP_TOP) || - (sp_globals.pspecs->flags & CLIP_BOTTOM) ) - { -#if (INCL_CLIPPING) -#else - report_error(11); - return FALSE; -#endif - } - -sp_globals.specs_valid = TRUE; -return TRUE; -} - - - -#if INCL_MULTIDEV -#if INCL_BLACK || INCL_SCREEN || INCL_2D -FUNCTION boolean set_bitmap_device( -GDECL -bitmap_t *bfuncs, -ufix16 size) -{ - -if (size != sizeof(sp_globals.bitmap_device)) - return FALSE; - -sp_globals.bitmap_device = *bfuncs; -sp_globals.bitmap_device_set = TRUE; -} -#endif - -#if INCL_OUTLINE -FUNCTION boolean set_outline_device( -GDECL -outline_t *ofuncs, -ufix16 size) -{ - -if (size != sizeof(sp_globals.outline_device)) - return FALSE; - -sp_globals.outline_device = *ofuncs; -sp_globals.outline_device_set = TRUE; -} -#endif -#endif - - -#ifdef old -FUNCTION boolean sp_setup_consts( -GDECL -fix15 xmin, /* Minimum X ORU value in font */ -fix15 xmax, /* Maximum X ORU value in font */ -fix15 ymin, /* Minimum Y ORU value in font */ -fix15 ymax) /* Maximum Y ORU value in font */ -#else -static FUNCTION boolean sp_setup_consts( -GDECL -fix15 xmin, /* Minimum X ORU value in font */ -fix15 xmax, /* Maximum X ORU value in font */ -fix15 ymin, /* Minimum Y ORU value in font */ -fix15 ymax) /* Maximum Y ORU value in font */ -#endif -/* - * Sets the following constants used for fixed point arithmetic: - * sp_globals.multshift multipliers and products; range is 14 to 8 - * sp_globals.pixshift pixels: range is 0 to 8 - * sp_globals.mpshift shift from product to sub-pixels (sp_globals.multshift - sp_globals.pixshift) - * sp_globals.multrnd rounding for products - * sp_globals.pixrnd rounding for pixels - * sp_globals.mprnd rounding for sub-pixels - * sp_globals.onepix 1 pixel in shifted pixel units - * sp_globals.pixfix mask to eliminate fractional bits of shifted pixels - * sp_globals.depth_adj curve splitting depth adjustment - * Returns FALSE if specs are out of range - */ -{ -fix31 mult; /* Successive multiplier values */ -ufix32 num; /* Numerator of largest multiplier value */ -ufix32 numcopy; /* Copy of numerator */ -ufix32 denom; /* Denominator of largest multiplier value */ -ufix32 denomcopy; /* Copy of denominator */ -ufix32 pix_max; /* Maximum pixel rounding error */ -fix31 xmult; /* Coefficient of X oru value in transformation */ -fix31 ymult; /* Coefficient of Y oru value in transformation */ -fix31 offset; /* Constant in transformation */ -fix15 i; /* Loop counter */ -fix15 x, y; /* Successive corners of bounding box in ORUs */ -fix31 pixval; /* Successive pixel values multiplied by orus per em */ -fix15 xx = 0, yy = 0;/* Bounding box corner that produces max pixel value */ - -/* Determine numerator and denominator of largest multiplier value */ -mult = sp_globals.pspecs->xxmult >> 16; -if (mult < 0) - mult = -mult; -num = mult; - -mult = sp_globals.pspecs->xymult >> 16; -if (mult < 0) - mult = -mult; -if (mult > num) - num = mult; - -mult = sp_globals.pspecs->yxmult >> 16; -if (mult < 0) - mult = -mult; -if (mult > num) - num = mult; - -mult = sp_globals.pspecs->yymult >> 16; -if (mult < 0) - mult = -mult; -if (mult > num) - num = mult; -num++; /* Max absolute pixels per em (rounded up) */ -denom = (ufix32)sp_globals.orus_per_em; - -/* Set curve splitting depth adjustment to accomodate largest multiplier value */ -sp_globals.depth_adj = 0; /* 0 = 0.5 pel, 1 = 0.13 pel, 2 = 0.04 pel accuracy */ -denomcopy = denom; -/* The following two occurances of a strange method of shifting twice by 1 - are intentional and should not be changed to a single shift by 2. - It prevents MicroSoft C 5.1 from generating functions calls to do the shift. - Worse, using the REENTRANT_ALLOC option in conjunction with the /AC compiler - option, the function appears to be called incorrectly, causing depth_adj to always - be set to -7, causing very angular characters. */ - -while ((num > denomcopy) && (sp_globals.depth_adj < 5)) /* > 1, 4, 16, ... pixels per oru? */ - { - denomcopy <<= 1; - denomcopy <<= 1; - sp_globals.depth_adj++; /* Add 1, 2, 3, ... to depth adjustment */ - } -numcopy = num << 2; -while ((numcopy <= denom) && (sp_globals.depth_adj > -4)) /* <= 1/4, 1/16, 1/64 pix per oru? */ - { - numcopy <<= 1; - numcopy <<= 1; - sp_globals.depth_adj--; /* Subtract 1, 2, 3, ... from depth adjustment */ - } -SHOW(sp_globals.depth_adj); - -/* Set multiplier shift to accomodate largest multiplier value */ -sp_globals.multshift = 14; -numcopy = num; -while (numcopy >= denom) /* More than 1, 2, 4, ... pix per oru? */ - { - numcopy >>= 1; - sp_globals.multshift--; /* sp_globals.multshift is 13, 12, 11, ... */ - } - -sp_globals.multrnd = ((fix31)1 << sp_globals.multshift) >> 1; -SHOW(sp_globals.multshift); - - -pix_max = (ufix32)( 0xffff & read_word_u(sp_globals.hdr2_org + FH_PIXMX)); - -num = 0; -xmult = ((sp_globals.pspecs->xxmult >> 16) + 1) >> 1; -ymult = ((sp_globals.pspecs->xymult >> 16) + 1) >> 1; -offset = ((sp_globals.pspecs->xoffset >> 16) + 1) >> 1; -for (i = 0; i < 8; i++) - { - if (i == 4) - { - xmult = ((sp_globals.pspecs->yxmult >> 16) + 1) >> 1; - ymult = ((sp_globals.pspecs->yymult >> 16) + 1) >> 1; - offset = ((sp_globals.pspecs->yoffset >> 16) + 1) >> 1; - } - x = (i & BIT1)? xmin: xmax; - y = (i & BIT0)? ymin: ymax; - pixval = (fix31)x * xmult + (fix31)y * ymult + offset * denom; - if (pixval < 0) - pixval = -pixval; - if (pixval > num) - { - num = pixval; - xx = x; - yy = y; - } - } -if (xx < 0) - xx = -xx; -if (yy < 0) - yy = -yy; -num += xx + yy + ((pix_max + 2) * denom); - /* Allow (with 2:1 safety margin) for 1 pixel rounding errors in */ - /* xmult, ymult and offset values, pix_max pixel expansion */ - /* due to intelligent scaling, and */ - /* 1 pixel rounding of overall character position */ -denom = denom << 14; /* Note num is in units of half pixels times orus per em */ - -sp_globals.pixshift = -1; -while ((num <= denom) && (sp_globals.pixshift < 8)) /* Max pixels <= 32768, 16384, 8192, ... pixels? */ - { - num <<= 1; - sp_globals.pixshift++; /* sp_globals.pixshift = 0, 1, 2, ... */ - } -if (sp_globals.pixshift < 0) - return FALSE; - -SHOW(sp_globals.pixshift); -sp_globals.poshift = 16 - sp_globals.pixshift; - -sp_globals.onepix = (fix15)1 << sp_globals.pixshift; -sp_globals.pixrnd = sp_globals.onepix >> 1; -sp_globals.pixfix = ~0 << sp_globals.pixshift; - -sp_globals.mpshift = sp_globals.multshift - sp_globals.pixshift; -if (sp_globals.mpshift < 0) - return FALSE; -sp_globals.mprnd = ((fix31)1 << sp_globals.mpshift) >> 1; - -return TRUE; -} - -#ifdef old -FUNCTION void sp_setup_tcb( -GDECL -tcb_t GLOBALFAR *ptcb) /* Pointer to transformation control bloxk */ -#else -static FUNCTION void sp_setup_tcb( -GDECL -tcb_t GLOBALFAR *ptcb) /* Pointer to transformation control bloxk */ -#endif -/* - * Convert transformation coeffs to internal form - */ -{ - -ptcb->xxmult = sp_setup_mult(sp_globals.pspecs->xxmult); -ptcb->xymult = sp_setup_mult(sp_globals.pspecs->xymult); -ptcb->xoffset = sp_setup_offset(sp_globals.pspecs->xoffset); -ptcb->yxmult = sp_setup_mult(sp_globals.pspecs->yxmult); -ptcb->yymult = sp_setup_mult(sp_globals.pspecs->yymult); -ptcb->yoffset = sp_setup_offset(sp_globals.pspecs->yoffset); - -SHOW(ptcb->xxmult); -SHOW(ptcb->xymult); -SHOW(ptcb->xoffset); -SHOW(ptcb->yxmult); -SHOW(ptcb->yymult); -SHOW(ptcb->yoffset); - -type_tcb(ptcb); /* Classify transformation type */ -} - -FUNCTION static fix15 sp_setup_mult( -GDECL -fix31 input_mult) /* Multiplier in input format */ -/* - * Called by sp_setup_tcb() to convert multiplier in transformation - * matrix from external to internal form. - */ -{ -fix15 imshift; /* Right shift to internal format */ -fix31 imdenom; /* Divisor to internal format */ -fix31 imrnd; /* Rounding for division operation */ - -imshift = 15 - sp_globals.multshift; -imdenom = (fix31)sp_globals.orus_per_em << imshift; -imrnd = imdenom >> 1; - -input_mult >>= 1; -if (input_mult >= 0) - return (fix15)((input_mult + imrnd) / imdenom); -else - return -(fix15)((-input_mult + imrnd) / imdenom); -} - -FUNCTION static fix31 sp_setup_offset( -GDECL -fix31 input_offset) /* Multiplier in input format */ -/* - * Called by sp_setup_tcb() to convert offset in transformation - * matrix from external to internal form. - */ -{ -fix15 imshift; /* Right shift to internal format */ -fix31 imrnd; /* Rounding for right shift operation */ - -imshift = 15 - sp_globals.multshift; -imrnd = ((fix31)1 << imshift) >> 1; - -return (((input_offset >> 1) + imrnd) >> imshift) + sp_globals.mprnd; -} - -FUNCTION void type_tcb( -GDECL -tcb_t GLOBALFAR *ptcb) /* Pointer to transformation control bloxk */ -{ -fix15 x_trans_type; -fix15 y_trans_type; -fix15 xx_mult; -fix15 xy_mult; -fix15 yx_mult; -fix15 yy_mult; -fix15 h_pos; -fix15 v_pos; -fix15 x_ppo; -fix15 y_ppo; -fix15 x_pos; -fix15 y_pos; - -/* check for mirror image transformations */ -xx_mult = ptcb->xxmult; -xy_mult = ptcb->xymult; -yx_mult = ptcb->yxmult; -yy_mult = ptcb->yymult; - -ptcb->mirror = ((((fix31)xx_mult*(fix31)yy_mult)- - ((fix31)xy_mult*(fix31)yx_mult)) < 0) ? -1 : 1; - -if (sp_globals.pspecs->flags & BOGUS_MODE) /* Linear transformation requested? */ - { - ptcb->xtype = 4; - ptcb->ytype = 4; - - ptcb->xppo = 0; - ptcb->yppo = 0; - ptcb->xpos = 0; - ptcb->ypos = 0; - } -else /* Intelligent tranformation requested? */ - { - h_pos = ((ptcb->xoffset >> sp_globals.mpshift) + sp_globals.pixrnd) & sp_globals.pixfix; - v_pos = ((ptcb->yoffset >> sp_globals.mpshift) + sp_globals.pixrnd) & sp_globals.pixfix; - - x_trans_type = 4; - x_ppo = 0; - x_pos = 0; - - y_trans_type = 4; - y_ppo = 0; - y_pos = 0; - - if (xy_mult == 0) - { - if (xx_mult >= 0) - { - x_trans_type = 0; /* X pix is function of X orus only */ - x_ppo = xx_mult; - x_pos = h_pos; - } - else - { - x_trans_type = 1; /* X pix is function of -X orus only */ - x_ppo = -xx_mult; - x_pos = -h_pos; - } - } - - else if (xx_mult == 0) - { - if (xy_mult >= 0) - { - x_trans_type = 2; /* X pix is function of Y orus only */ - y_ppo = xy_mult; - y_pos = h_pos; - } - else - { - x_trans_type = 3; /* X pix is function of -Y orus only */ - y_ppo = -xy_mult; - y_pos = -h_pos; - } - } - - if (yx_mult == 0) - { - if (yy_mult >= 0) - { - y_trans_type = 0; /* Y pix is function of Y orus only */ - y_ppo = yy_mult; - y_pos = v_pos; - } - else - { - y_trans_type = 1; /* Y pix is function of -Y orus only */ - y_ppo = -yy_mult; - y_pos = -v_pos; - } - } - else if (yy_mult == 0) - { - if (yx_mult >= 0) - { - y_trans_type = 2; /* Y pix is function of X orus only */ - x_ppo = yx_mult; - x_pos = v_pos; - } - else - { - y_trans_type = 3; /* Y pix is function of -X orus only */ - x_ppo = -yx_mult; - x_pos = -v_pos; - } - } - - ptcb->xtype = x_trans_type; - ptcb->ytype = y_trans_type; - - ptcb->xppo = x_ppo; - ptcb->yppo = y_ppo; - ptcb->xpos = x_pos; - ptcb->ypos = y_pos; - } - -sp_globals.normal = (ptcb->xtype != 4) && (ptcb->ytype != 4); - -ptcb->xmode = 4; -ptcb->ymode = 4; - -SHOW(ptcb->xtype); -SHOW(ptcb->ytype); -SHOW(ptcb->xppo); -SHOW(ptcb->yppo); -SHOW(ptcb->xpos); -SHOW(ptcb->ypos); -} - -FUNCTION fix31 read_long( -GDECL -ufix8 FONTFAR *pointer) /* Pointer to first byte of encrypted 3-byte integer */ -/* - * Reads a 3-byte encrypted integer from the byte string starting at - * the specified point. - * Returns the decrypted value read as a signed integer. - */ -{ -fix31 tmpfix31; - -tmpfix31 = (fix31)((*pointer++) ^ sp_globals.key4) << 8; /* Read middle byte */ -tmpfix31 += (fix31)(*pointer++) << 16; /* Read most significant byte */ -tmpfix31 += (fix31)((*pointer) ^ sp_globals.key6); /* Read least significant byte */ -return tmpfix31; -} - -FUNCTION fix15 read_word_u( -GDECL -ufix8 FONTFAR *pointer) /* Pointer to first byte of unencrypted 2-byte integer */ -/* - * Reads a 2-byte unencrypted integer from the byte string starting at - * the specified point. - * Returns the decrypted value read as a signed integer. - */ -{ -fix15 tmpfix15; - -tmpfix15 = (fix15)(*pointer++) << 8; /* Read most significant byte */ -tmpfix15 += (fix15)(*pointer); /* Add least significant byte */ -return tmpfix15; -} - - diff --git a/nx-X11/lib/font/Speedo/set_trns.c b/nx-X11/lib/font/Speedo/set_trns.c deleted file mode 100644 index 3b8f60378..000000000 --- a/nx-X11/lib/font/Speedo/set_trns.c +++ /dev/null @@ -1,1324 +0,0 @@ -/* $Xorg: set_trns.c,v 1.3 2000/08/17 19:46:27 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/set_trns.c,v 1.5tsi Exp $ */ - - - -/*************************** S E T _ T R N S . C ***************************** - * * - * This module is called from do_char.c to set up the intelligent * - * transformation for one character (or sub-character of a composite * - * character. - * * - ****************************************************************************/ - - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spdo_prv.h" /* General definitions for Speedo */ - -#define DEBUG 0 - -#if DEBUG -#include -#define SHOW(X) printf("X = %d\n", X) -#else -#define SHOW(X) -#endif -/***** LOCAL MACROS *****/ - -#define SQUEEZE_X_ORU(A,B,C) ((((fix31)A * (fix31)B) + C) >> 16) -#define ABS(A) ((A < 0)? -A:A) /* absolute value */ -#define IMPORT_FACTOR \ - shift = 16;\ - while (*x_factor > (0x7fffffffL / (isw_scale >> (16 - shift))))\ - shift--;\ - *x_factor = (*x_factor * (isw_scale>>(16-shift))) >> shift; - -/***** GLOBAL VARIABLES *****/ - -/***** GLOBAL FUNCTIONS *****/ - -/***** EXTERNAL VARIABLES *****/ - -/***** EXTERNAL FUNCTIONS *****/ - -/***** STATIC VARIABLES *****/ - -/***** STATIC FUNCTIONS *****/ - -static void sp_constr_update(PROTO_DECL1); -static ufix8 FONTFAR *sp_setup_pix_table(PROTO_DECL2 ufix8 FONTFAR *pointer,boolean short_form,fix15 no_X_ctrl_zones,fix15 no_Y_ctrl_zones); -static ufix8 FONTFAR *sp_setup_int_table(PROTO_DECL2 ufix8 FONTFAR *pointer,fix15 no_X_int_zones,fix15 no_Y_int_zones); - - -FUNCTION void init_tcb() -GDECL -/* - * Called by sp_make_char() and make_comp_char() to initialize the current - * transformation control block to the top level transformation. - */ -{ -sp_globals.tcb = sp_globals.tcb0; -} - -FUNCTION void scale_tcb( -GDECL -tcb_t GLOBALFAR *ptcb, /* Transformation control block */ -fix15 x_pos, /* X position (outline res units) */ -fix15 y_pos, /* Y position (outline res units) */ -fix15 x_scale, /* X scale factor * ONE_SCALE */ -fix15 y_scale) /* Y scale factor * ONE_SCALE */ -/* - * Called by make_comp_char() to apply position and scale for each of the - * components of a compound character. - */ -{ -fix15 xx_mult = ptcb->xxmult; -fix15 xy_mult = ptcb->xymult; -fix31 x_offset = ptcb->xoffset; -fix15 yx_mult = ptcb->yxmult; -fix15 yy_mult = ptcb->yymult; -fix31 y_offset = ptcb->yoffset; - -ptcb->xxmult = TRANS(xx_mult, x_scale, (fix31)SCALE_RND, SCALE_SHIFT); -ptcb->xymult = TRANS(xy_mult, y_scale, (fix31)SCALE_RND, SCALE_SHIFT); -ptcb->xoffset = MULT16(xx_mult, x_pos) + MULT16(xy_mult, y_pos) + x_offset; -ptcb->yxmult = TRANS(yx_mult, x_scale, (fix31)SCALE_RND, SCALE_SHIFT); -ptcb->yymult = TRANS(yy_mult, y_scale, (fix31)SCALE_RND, SCALE_SHIFT); -ptcb->yoffset = MULT16(yx_mult, x_pos) + MULT16(yy_mult, y_pos) + y_offset; - -type_tcb(ptcb); /* Reclassify transformation types */ -} - -FUNCTION ufix8 FONTFAR *skip_interpolation_table( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ -ufix8 format) /* Character format byte */ -{ -fix15 i,n; -ufix8 intsize[9]; - -intsize[0] = 1; -intsize[1] = 2; -intsize[2] = 3; -intsize[3] = 1; -intsize[4] = 2; -intsize[5] = 1; -intsize[6] = 2; -intsize[7] = 0; -intsize[8] = 0; - -n = ((format & BIT6)? (fix15)NEXT_BYTE(pointer): 0); -n += ((format & BIT7)? (fix15)NEXT_BYTE(pointer): 0); -for (i = 0; i < n; i++) /* For each entry in int table ... */ - { - format = NEXT_BYTE(pointer); /* Read format byte */ - if (format & BIT7) /* Short Start/End point spec? */ - { - pointer++; /* Skip Start/End point byte */ - } - else - { - pointer += intsize[format & 0x7]; /* Skip Start point spec */ - pointer += intsize[(format >> 3) & 0x7]; /* Skip End point spec */ - } - } -return pointer; -} -FUNCTION ufix8 FONTFAR *skip_control_zone( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ -ufix8 format) /* Character format byte */ -{ -fix15 i,n; -ufix16 tmpufix16; - -n = sp_globals.no_X_orus + sp_globals.no_Y_orus - 2; -for (i = 0; i < n; i++) /* For each entry in control table ... */ - { - if (format & BIT4) - pointer++; /* Skip short form From/To fields */ - else - pointer += 2; /* Skip FROM and TO fields */ - /* skip constraints field */ - NEXT_BYTES (pointer, tmpufix16); - - } -return pointer; -} - -#if INCL_RULES -#else -FUNCTION ufix8 FONTFAR *plaid_tcb( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ -ufix8 format) /* Character format byte */ -/* - * Called by make_simp_char() and make_comp_char() to set up the controlled - * coordinate table and skip all other intelligent scaling rules embedded - * in the character data. - * Updates pointer to first byte after plaid data. - * This is used only if intelligent scaling is not supported in the - * configuration definitions. - */ -{ -fix15 i, n; - - - -sp_globals.no_X_orus = (format & BIT2)? - (fix15)NEXT_BYTE(pointer): - 0; -sp_globals.no_Y_orus = (format & BIT3)? - (fix15)NEXT_BYTE(pointer): - 0; -pointer = read_oru_table(pointer); /* Updates no_X/Y/orus */ -sp_globals.Y_edge_org = sp_globals.no_X_orus; - -/* Skip over control zone table */ -pointer = skip_control_zone(pointer,format); - -/* Skip over interpolation table */ -pointer = skip_interpolation_table(pointer,format); -return pointer; -} -#endif - -#if INCL_RULES -FUNCTION ufix8 FONTFAR *plaid_tcb( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to next byte in char data */ -ufix8 format) /* Character format byte */ -/* - * Called by make_simp_char() and make_comp_char() to set up the controlled - * coordinate table and process all intelligent scaling rules embedded - * in the character data. - * Updates pointer to first byte after plaid data. - * This is used only if intelligent scaling is enabled in the - * configuration definitions. - */ -{ -fix15 no_X_ctrl_zones; -fix15 no_Y_ctrl_zones; -fix15 no_X_int_zones; -fix15 no_Y_int_zones; - -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -begin_plaid_data(); -#endif - -sp_constr_update(); /* Update constraint table if required */ - -sp_globals.no_X_orus = (format & BIT2)? - (fix15)NEXT_BYTE(pointer): - 0; -sp_globals.no_Y_orus = (format & BIT3)? - (fix15)NEXT_BYTE(pointer): - 0; -pointer = read_oru_table(pointer); /* Updates no_X/Y/orus to include zero values */ -sp_globals.Y_edge_org = sp_globals.no_X_orus; -if (sp_globals.no_X_orus > 1) /* 2 or more controlled X coordinates? */ - sp_globals.tcb.xmode = sp_globals.tcb.xtype; /* Enable intelligent scaling in X */ - -if (sp_globals.no_Y_orus > 1) /* 2 or more controlled Y coordinates? */ - sp_globals.tcb.ymode = sp_globals.tcb.ytype; /* Enable intelligent scaling in Y */ - -no_X_ctrl_zones = sp_globals.no_X_orus - 1; -no_Y_ctrl_zones = sp_globals.no_Y_orus - 1; -pointer = sp_setup_pix_table(pointer, (boolean)(format & BIT4), - no_X_ctrl_zones, no_Y_ctrl_zones); - -no_X_int_zones = (format & BIT6)? - (fix15)NEXT_BYTE(pointer): - 0; -no_Y_int_zones = (format & BIT7)? - (fix15)NEXT_BYTE(pointer): - 0; -sp_globals.Y_int_org = no_X_int_zones; -pointer = sp_setup_int_table(pointer, no_X_int_zones, no_Y_int_zones); - -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -end_plaid_data(); -#endif - -return pointer; -} -#endif - -#if INCL_RULES -FUNCTION static void sp_constr_update() -GDECL -/* - * Called by plaid_tcb() to update the constraint table for the current - * transformation. - * This is always carried out whenever a character is generated following - * a change of font or scale factor or after initialization. - */ -{ -fix31 ppo; -fix15 xppo; -fix15 yppo; -ufix8 FONTFAR *pointer; -fix15 no_X_constr; -fix15 no_Y_constr; -fix15 i, j, k, l, n; -fix15 ppm; -ufix8 format; -ufix8 format1; -fix15 limit; -ufix16 constr_org; -fix15 constr_nr; -fix15 size; -fix31 off; -fix15 min; -fix15 orus; -fix15 pix; -ufix16 tmpufix16; /* in extended mode, macro uses secnd term */ - -if (sp_globals.constr.data_valid && /* Constr table already done and ... */ - (sp_globals.tcb.xppo == sp_globals.constr.xppo) && /* ... X pix per oru unchanged and ... */ - (sp_globals.tcb.yppo == sp_globals.constr.yppo)) /* ... Y pix per oru unchanged? */ - { - return; /* No need to update constraint table */ - } - -sp_globals.constr.xppo = xppo = sp_globals.tcb.xppo; /* Update X pixels per oru indicator */ -sp_globals.constr.yppo = yppo = sp_globals.tcb.yppo; /* Update Y pixels per oru indicator */ -sp_globals.constr.data_valid = TRUE; /* Mark constraint table valid */ - -pointer = sp_globals.constr.org; /* Point to first byte of constraint data */ -no_X_constr = NEXT_BYTES(pointer, tmpufix16); /* Read nmbr of X constraints */ -no_Y_constr = NEXT_BYTES(pointer, tmpufix16); /* Read nmbr of Y constraints */ - -i = 0; -constr_org = 0; -n = no_X_constr; -ppo = xppo; -for (j = 0; ; j++) - { - sp_globals.c_act[i] = FALSE; /* Flag constraint 0 not active */ - sp_globals.c_pix[i++] = 0; /* Constraint 0 implies no minimum */ - sp_globals.c_act[i] = FALSE; /* Flag constraint 1 not active */ - sp_globals.c_pix[i++] = sp_globals.onepix; /* Constraint 1 implies min 1 pixel*/ - ppm = (ppo * (fix31)sp_globals.orus_per_em) >> sp_globals.multshift; - for (k = 0; k < n; k++) - { - format = NEXT_BYTE(pointer); /* Read format byte */ - limit = (fix15)NEXT_BYTE(pointer); /* Read limit field */ - sp_globals.c_act[i] = - ((ppm < limit) || (limit == 255)) && - sp_globals.constr.active; - if (sp_globals.c_act[i]) /* Constraint active? */ - { - if ((format & BIT1) && /* Constraint specified and ... */ - (constr_nr = constr_org + - ((format & BIT0)? /* Read unsigned constraint value */ - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer)), - sp_globals.c_act[constr_nr])) /* ... and specified constraint active? */ - { - pix = sp_globals.c_pix[constr_nr]; /* Use constrained pixel value */ - format1 = format; - for (l = 2; l > 0; l--) /* Skip 2 arguments */ - { - format1 >>= 2; - if ((size = format1 & 0x03)) - pointer += size - 1; - } - } - else /* Constraint absent or inactive? */ - { - orus = (format & BIT2)? /* Read unsigned oru value */ - NEXT_WORD(pointer): - (fix15)NEXT_BYTE(pointer); - - if (format & BIT5) /* Specified offset value? */ - { - off = (fix31)((format & BIT4)? /* Read offset value */ - NEXT_WORD(pointer): - (fix7)NEXT_BYTE(pointer)); - off = (off << (sp_globals.multshift - 6)) + sp_globals.multrnd; - } - else /* Unspecified (zero) offset value? */ - { - off = sp_globals.multrnd; - } - - pix = (fix15)(((fix31)orus * ppo + off) / (1 << sp_globals.mpshift)) & sp_globals.pixfix; - } - } - else /* Constraint inactive? */ - { - format1 = format; - for (l = 3; l > 0; l--) /* Skip over 3 arguments */ - { - if ((size = format1 & 0x03)) - pointer += size - 1; - format1 >>= 2; - } - pix = 0; - } - - if (format & 0xc0) /* Specified minimum value? */ - { - min = (format & BIT7)? /* Read unsigned minimum value */ - (fix15)NEXT_BYTE(pointer) << sp_globals.pixshift: - sp_globals.onepix; - } - else /* Unspecified (zero) minimum value? */ - { - min = 0; - } - - sp_globals.c_pix[i] = (pix < min)? min: pix; - i++; - } - if (j) break; /* Finished if second time around loop */ - constr_org = sp_globals.Y_constr_org = i; - n = no_Y_constr; - ppo = yppo; - } - -#if DEBUG -printf("\nCONSTRAINT TABLE\n"); -n = no_X_constr + 2; -for (i = 0; i < n; i++) - { - printf("%3d ", i); - if (sp_globals.c_act[i]) - { - printf("T "); - } - else - { - printf("F "); - } - printf("%5.1f\n", ((real)sp_globals.c_pix[i] / (real)sp_globals.onepix)); - } -printf("--------------\n"); -n = no_Y_constr + 2; -for (i = 0; i < n; i++) - { - j = i + sp_globals.Y_constr_org; - printf("%3d ", i); - if (sp_globals.c_act[j]) - { - printf("T "); - } - else - { - printf("F "); - } - printf("%5.1f\n", ((real)sp_globals.c_pix[j] / (real)sp_globals.onepix)); - } -#endif - -} -#endif - -FUNCTION ufix8 FONTFAR *read_oru_table( -GDECL -ufix8 FONTFAR *pointer) /* Pointer to first byte in controlled coord table */ -/* - * Called by plaid_tcb() to read the controlled coordinate table from the - * character data in the font. - * Updates the pointer to the byte following the controlled coordinate - * data. - */ -{ -fix15 i, j, k, n; -boolean zero_not_in; -boolean zero_added; -fix15 oru; - -#if INCL_RULES -fix15 pos; -#endif - -i = 0; -n = sp_globals.no_X_orus; -#if INCL_RULES -pos = sp_globals.tcb.xpos; -#endif -for (j = 0; ; j++) - { - zero_not_in = TRUE; - zero_added = FALSE; - for (k = 0; k < n; k++) - { - oru = NEXT_WORD(pointer); - if (zero_not_in && (oru >= 0)) /* First positive oru value? */ - { -#if INCL_RULES - sp_plaid.pix[i] = pos; /* Insert position in pix array */ -#endif - if (oru != 0) /* Zero oru value omitted? */ - { - sp_plaid.orus[i++] = 0; /* Insert zero value in oru array */ - zero_added = TRUE; /* Remember to increment size of array */ - } - zero_not_in = FALSE; /* Inhibit further testing for zero ins */ - } - sp_plaid.orus[i++] = oru; /* Add specified oru value to array */ - } - if (zero_not_in) /* All specified oru values negative? */ - { -#if INCL_RULES - sp_plaid.pix[i] = pos; /* Insert position in pix array */ -#endif - sp_plaid.orus[i++] = 0; /* Add zero oru value */ - zero_added = TRUE; /* Remember to increment size of array */ - } - if (j) /* Both X and Y orus read? */ - break; - if (zero_added) - sp_globals.no_X_orus++; /* Increment X array size */ - n = sp_globals.no_Y_orus; /* Prepare to read Y oru values */ -#if INCL_RULES - pos = sp_globals.tcb.ypos; -#endif - } -if (zero_added) /* Zero Y oru value added to array? */ - sp_globals.no_Y_orus++; /* Increment Y array size */ - -#if DEBUG -printf("\nX ORUS\n"); -n = sp_globals.no_X_orus; -for (i = 0; i < n; i++) - { - printf("%2d %4d\n", i, sp_plaid.orus[i]); - } -printf("\nY ORUS\n"); -n = sp_globals.no_Y_orus; -for (i = 0; i < n; i++) - { - printf("%2d %4d\n", i, sp_plaid.orus[i + sp_globals.no_X_orus]); - } -#endif - -return pointer; /* Update pointer */ -} -#if INCL_SQUEEZING || INCL_ISW -FUNCTION static void calculate_x_pix( -GDECL -ufix8 start_edge, ufix8 end_edge, -ufix16 constr_nr, -fix31 x_scale, -fix31 x_offset, -fix31 ppo, -fix15 setwidth_pix) -/* - * Called by sp_setup_pix_table() when X squeezing is necessary - * to insert the correct edge in the global pix array - */ -{ -fix15 zone_pix; -fix15 start_oru, end_oru; - -/* compute scaled oru coordinates */ -start_oru= (fix15)(SQUEEZE_X_ORU(sp_plaid.orus[start_edge], x_scale, x_offset)); -end_oru = (fix15)(SQUEEZE_X_ORU(sp_plaid.orus[end_edge], x_scale, x_offset)); - -if (!sp_globals.c_act[constr_nr]) /* constraint inactive */ - { - /* calculate zone width */ - zone_pix = (fix15)(((((fix31)end_oru - (fix31)start_oru) * ppo) / - (1< 0) && (zone_pix < 0)) - zone_pix = 0x7ffff; - /* check for minimum */ - if ((ABS(zone_pix)) >= sp_globals.c_pix[constr_nr]) - goto Lx; - } -/* use the zone size from the constr table - scale it */ -zone_pix = (fix15)(((SQUEEZE_MULT(x_scale,sp_globals.c_pix[constr_nr])) - + sp_globals.pixrnd) & sp_globals.pixfix); - -/* look for overflow */ -if ((sp_globals.c_pix[constr_nr] > 0) && (zone_pix < 0)) - zone_pix = 0x7fff; - -if (start_edge > end_edge) - { - zone_pix = -zone_pix; - } -Lx: -/* assign pixel value to global pix array */ -sp_plaid.pix[end_edge]=sp_plaid.pix[start_edge] + zone_pix; - -/* check for overflow */ -if (((sp_plaid.pix[start_edge] >0) && (zone_pix >0)) && - (sp_plaid.pix[end_edge] < 0)) - sp_plaid.pix[end_edge] = 0x7fff; /* set it to the max */ - -/* be sure to be in the setwidth !*/ -#if INCL_ISW -if (!sp_globals.import_setwidth_act) /* only check left edge if not isw only */ -#endif -if ((sp_globals.pspecs->flags & SQUEEZE_LEFT) && (sp_plaid.pix[end_edge] < 0)) - sp_plaid.pix[end_edge] = 0; -if ((sp_globals.pspecs->flags & SQUEEZE_RIGHT) && - (sp_plaid.pix[end_edge] > setwidth_pix)) - sp_plaid.pix[end_edge] = setwidth_pix; - -} -#endif - -#if INCL_SQUEEZING -FUNCTION static void calculate_y_pix( -GDECL -ufix8 start_edge, ufix8 end_edge, -ufix16 constr_nr, -fix31 top_scale, fix31 bottom_scale, -fix31 ppo, -fix15 em_top_pix, fix15 em_bot_pix) - -/* - * Called by sp_setup_pix_table() when Y squeezing is necessary - * to insert the correct edge in the global pix array - */ -{ -fix15 zone_pix; -fix15 start_oru, end_oru; -fix31 zone_width, above_base, below_base; - -/* check whether edge is above or below the baseline */ -/* and apply appropriate scale factor to get scaled oru coordinates */ -if (sp_plaid.orus[start_edge] < 0) - start_oru =(fix15)(SQUEEZE_MULT(sp_plaid.orus[start_edge], bottom_scale)); -else - start_oru =(fix15)(SQUEEZE_MULT(sp_plaid.orus[start_edge], top_scale)); - -if (sp_plaid.orus[end_edge] < 0) - end_oru =(fix15)(SQUEEZE_MULT(sp_plaid.orus[end_edge], bottom_scale)); -else - end_oru =(fix15)(SQUEEZE_MULT(sp_plaid.orus[end_edge], top_scale)); - -if (!sp_globals.c_act[constr_nr]) /* Constraint inactive? */ - { - /* calculate zone width */ - zone_pix = (fix15)(((((fix31)end_oru - (fix31)start_oru) * ppo) - >> sp_globals.mpshift)+ sp_globals.pixrnd) & sp_globals.pixfix; - /* check minimum */ - if ((ABS(zone_pix)) >= sp_globals.c_pix[constr_nr]) - goto Ly; - } - -/* Use zone size from constr table */ -if ((end_oru >= 0) && (start_oru >=0)) - /* all above baseline */ - zone_pix = (fix15)(SQUEEZE_MULT(top_scale, sp_globals.c_pix[constr_nr])); -else if ((end_oru <= 0) && (start_oru <=0)) - /* all below baseline */ - zone_pix = (fix15)(SQUEEZE_MULT(bottom_scale, sp_globals.c_pix[constr_nr])); -else - { - /* mixture */ - if (start_oru > 0) - { - zone_width = start_oru - end_oru; - /* get % above baseline in 16.16 fixed point */ - above_base = (((fix31)start_oru) << 16) / - ((fix31)zone_width) ; - /* get % below baseline in 16.16 fixed point */ - below_base = (((fix31)-end_oru) << 16) / - ((fix31)zone_width) ; - } - else - { - zone_width = end_oru - start_oru; - /* get % above baseline in 16.16 fixed point */ - above_base = (((fix31)-start_oru) << 16) / - ((fix31)zone_width) ; - /* get % below baseline in 16.16 fixed point */ - below_base = (((fix31)end_oru) << 16) / - ((fix31)zone_width) ; - } - /* % above baseline * total zone * top_scale + */ - /* % below baseline * total zone * bottom_scale */ - zone_pix = ((((above_base * (fix31)sp_globals.c_pix[constr_nr]) >> 16) * - top_scale) + - (((below_base * (fix31)sp_globals.c_pix[constr_nr]) >> 16) * - bottom_scale)) >> 16; - } - -/* make this zone pix fall on a pixel boundary */ -zone_pix = (zone_pix + sp_globals.pixrnd) & sp_globals.pixfix; - -/* if minimum is in effect make the zone one pixel */ -if ((sp_globals.c_pix[constr_nr] != 0) && (zone_pix < sp_globals.onepix)) - zone_pix = sp_globals.onepix; - -if (start_edge > end_edge) - { - zone_pix = -zone_pix; /* Use negatve zone size */ - } -Ly: -/* assign global pix value */ -sp_plaid.pix[end_edge] = sp_plaid.pix[start_edge] + zone_pix; /* Insert end pixels */ - -/* make sure it is in the EM !*/ -if ((sp_globals.pspecs->flags & SQUEEZE_TOP) && - (sp_plaid.pix[end_edge] > em_top_pix)) - sp_plaid.pix[end_edge] = em_top_pix; -if ((sp_globals.pspecs->flags & SQUEEZE_BOTTOM) && - (sp_plaid.pix[end_edge] < em_bot_pix)) - sp_plaid.pix[end_edge] = em_bot_pix; -} - -FUNCTION boolean calculate_x_scale(x_factor, x_offset, no_X_ctrl_zones) -GDECL -fix31 *x_factor, -fix31 *x_offset, -fix15 no_X_ctrl_zones) /* Number of X control zones */ -/* - * Called by sp_setup_pix_table() when squeezing is included - * to determine whether X scaling is necessary. If it is, the - * scale factor and offset are computed. This function returns - * a boolean value TRUE = X squeezind is necessary, FALSE = no - * X squeezing is necessary. - */ -{ -boolean squeeze_left, squeeze_right; -boolean out_on_right, out_on_left; -fix15 bbox_width,set_width; -fix15 bbox_xmin, bbox_xmax; -fix15 x_offset_pix; -fix15 i; -#if INCL_ISW -fix31 isw_scale; -fix15 shift; -#endif - - -/* set up some flags and common calculations */ -squeeze_left = (sp_globals.pspecs->flags & SQUEEZE_LEFT)? TRUE:FALSE; -squeeze_right = (sp_globals.pspecs->flags & SQUEEZE_RIGHT)? TRUE:FALSE; -bbox_xmin = sp_globals.bbox_xmin_orus; -bbox_xmax = sp_globals.bbox_xmax_orus; -set_width = sp_globals.setwidth_orus; - -if (bbox_xmax > set_width) - out_on_right = TRUE; -else - out_on_right = FALSE; -if (bbox_xmin < 0) - out_on_left = TRUE; -else - out_on_left = FALSE; -bbox_width =bbox_xmax - bbox_xmin; - -/* - * don't need X squeezing if: - * - X squeezing not enabled - * - bbox doesn't violate on left or right - * - left squeezing only is enabled and char isn't out on left - * - right squeezing only is enabled and char isn't out on right - */ - -if ((!squeeze_left && !squeeze_right) || - (!out_on_right && !out_on_left) || - (squeeze_left && !squeeze_right && !out_on_left) || - (squeeze_right && !squeeze_left && !out_on_right)) - return FALSE; - -#if INCL_ISW -if (sp_globals.import_setwidth_act) - { - /* if both isw and squeezing is going on - let the imported */ - /* setwidth factor be factored in with the squeeze */ - isw_scale = compute_isw_scale(); - /*sp_globals.setwidth_orus = sp_globals.imported_width;*/ - } -else - isw_scale = 0x10000L; /* 1 in 16.16 notation */ -#endif - -/* squeezing on left and right ? */ -if (squeeze_left && squeeze_right) - { - /* calculate scale factor */ - if (bbox_width < set_width) - *x_factor = 0x10000L; /* 1 in 16.16 notation */ - else - *x_factor = ((fix31)set_width<<16)/(fix31)bbox_width; -#if INCL_ISW - IMPORT_FACTOR -#endif - /* calculate offset */ - if (out_on_left) /* fall out on left ? */ - *x_offset = -(fix31)*x_factor * (fix31)bbox_xmin; - /* fall out on right and I am shifting only ? */ - else if (out_on_right && (*x_factor == 0x10000L)) - *x_offset = -(fix31)*x_factor * (fix31)(bbox_xmax - set_width); - else - *x_offset = 0x0L; /* 0 in 16.16 notation */ - } -/* squeezing on left only and violates left */ -else if (squeeze_left) - { - if (bbox_width < set_width) /* will it fit if I shift it ? */ - *x_factor = 0x10000L; /* 1 in 16.16 notation */ - else if (out_on_right) - *x_factor = ((fix31)set_width<<16)/(fix31)bbox_width; - else - *x_factor = ((fix31)set_width<<16)/ - (fix31)(bbox_width - (bbox_xmax-set_width)); -#if INCL_ISW - IMPORT_FACTOR -#endif - *x_offset = (fix31)-*x_factor * (fix31)bbox_xmin; - } - -/* I must be squeezing on right, and violates right */ -else - { - if (bbox_width < set_width) /* will it fit if I shift it ? */ - { /* just shift it left - it will fit in the bbox */ - *x_factor = 0x10000L; /* 1 in 16.16 notation */ -#if INCL_ISW - IMPORT_FACTOR -#endif - *x_offset = (fix31)-*x_factor * (fix31)bbox_xmin; - } - else if (out_on_left) - { - *x_factor = ((fix31)set_width<<16)/(fix31)bbox_width; -#if INCL_ISW - IMPORT_FACTOR -#endif - *x_offset = 0x0L; /* 0 in 16.16 notation */ - } - else - { - *x_factor = ((fix31)set_width<<16)/(fix31)bbox_xmax; -#if INCL_ISW - IMPORT_FACTOR -#endif - *x_offset = 0x0L; /* 0 in 16.16 notation */ - } - } - -x_offset_pix = (fix15)(((*x_offset >> 16) * sp_globals.tcb0.xppo) - / (1<0) && (x_offset_pix < sp_globals.onepix)) - x_offset_pix = sp_globals.onepix; - -/* look for the first non-negative oru value, scale and add the offset */ -/* to the corresponding pixel value - note that the pixel value */ -/* is set in read_oru_table. */ - -/* look at all the X edges */ -for (i=0; i < (no_X_ctrl_zones+1); i++) - if (sp_plaid.orus[i] >= 0) - { - sp_plaid.pix[i] = (SQUEEZE_MULT(sp_plaid.pix[i], *x_factor) - +sp_globals.pixrnd + x_offset_pix) & sp_globals.pixfix; - break; - } - -return TRUE; -} - -FUNCTION boolean calculate_y_scale( -GDECL -fix31 *top_scale, fix31 *bottom_scale, -fix15 first_Y_zone, -fix15 no_Y_ctrl_zones) -/* - * Called by sp_setup_pix_table() when squeezing is included - * to determine whether Y scaling is necessary. If it is, - * two scale factors are computed, one for above the baseline, - * and one for below the basline. - * This function returns a boolean value TRUE = Y squeezind is necessary, - * FALSE = no Y squeezing is necessary. - */ -{ -boolean squeeze_top, squeeze_bottom; -boolean out_on_top, out_on_bottom; -fix15 bbox_top, bbox_bottom; -fix15 bbox_height; -fix15 i; - -/* set up some flags and common calculations */ -squeeze_top = (sp_globals.pspecs->flags & SQUEEZE_TOP)? TRUE:FALSE; -squeeze_bottom = (sp_globals.pspecs->flags & SQUEEZE_BOTTOM)? TRUE:FALSE; -bbox_top = sp_globals.bbox_ymax_orus; -bbox_bottom = sp_globals.bbox_ymin_orus; -bbox_height = bbox_top - bbox_bottom; - -if (bbox_top > EM_TOP) - out_on_top = TRUE; -else - out_on_top = FALSE; - -if (bbox_bottom < EM_BOT) - out_on_bottom = TRUE; -else - out_on_bottom = FALSE; - -/* - * don't need Y squeezing if: - * - Y squeezing not enabled - * - bbox doesn't violate on top or bottom - * - top squeezing only is enabled and char isn't out on top - * - bottom squeezing only is enabled and char isn't out on bottom - */ -if ((!squeeze_top && !squeeze_bottom) || - (!out_on_top && !out_on_bottom) || - (squeeze_top && !squeeze_bottom && !out_on_top) || - (squeeze_bottom && !squeeze_top && !out_on_bottom)) - return FALSE; - -if (squeeze_top && (bbox_top > EM_TOP)) - *top_scale = ((fix31)EM_TOP << 16)/(fix31)(bbox_top); -else - *top_scale = 0x10000L; /* 1 in 16.16 fixed point */ - -if (squeeze_bottom && (bbox_bottom < EM_BOT)) - *bottom_scale = ((fix31)-(EM_BOT) << 16)/(fix31)-bbox_bottom; -else - *bottom_scale = 0x10000L; - -if (sp_globals.squeezing_compound) - { - for (i=first_Y_zone; i < (first_Y_zone + no_Y_ctrl_zones + 1); i++) - { - if (sp_plaid.orus[i] >= 0) - sp_plaid.pix[i] = (SQUEEZE_MULT(sp_plaid.pix[i], *top_scale) - +sp_globals.pixrnd) & sp_globals.pixfix; - else - sp_plaid.pix[i] = (SQUEEZE_MULT(sp_plaid.pix[i], *bottom_scale) - +sp_globals.pixrnd) & sp_globals.pixfix; - } - } -return TRUE; -} -#endif - -#if INCL_RULES -FUNCTION static ufix8 FONTFAR *sp_setup_pix_table( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to first byte in control zone table */ -boolean short_form, /* TRUE if 1 byte from/to specification */ -fix15 no_X_ctrl_zones, /* Number of X control zones */ -fix15 no_Y_ctrl_zones) /* Number of Y control zones */ -/* - * Called by plaid_tcb() to read the control zone table from the - * character data in the font. - * Sets up a table of pixel values for all controlled coordinates. - * Updates the pointer to the byte following the control zone - * data. - */ -{ -fix15 i, j, n; -fix31 ppo; -#if INCL_SQUEEZING || INCL_ISW -fix31 xppo0; /* top level pixels per oru */ -fix31 yppo0; /* top level pixels per oru */ -#endif -ufix8 edge_org; -ufix8 edge; -ufix8 start_edge; -ufix8 end_edge; -ufix16 constr_org; -fix15 constr_nr; -fix15 zone_pix; -fix31 whole_zone; /* non-transformed value of the first X zone */ -ufix16 tmpufix16; /* in extended mode, macro uses secnd term */ -#if INCL_SQUEEZING -fix31 x_scale; -fix31 y_top_scale, y_bottom_scale; -fix31 x_offset; -boolean squeezed_y; -fix15 setwidth_pix, em_top_pix, em_bot_pix; -#endif - -#if INCL_ISW -boolean imported_width; -fix31 isw_scale; -fix15 isw_setwidth_pix; -#endif - -#if INCL_ISW || INCL_SQUEEZING -boolean squeezed_x; -#endif - -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -begin_ctrl_zones(no_X_ctrl_zones, no_Y_ctrl_zones); -#endif - - -edge_org = 0; -constr_org = 0; -sp_globals.rnd_xmin = 0; /* initialize the error for chars with no zone */ -n = no_X_ctrl_zones; -ppo = sp_globals.tcb.xppo; -#if INCL_SQUEEZING || INCL_ISW -xppo0 = sp_globals.tcb0.xppo; -yppo0 = sp_globals.tcb0.yppo; -squeezed_x = FALSE; -#endif - -#if INCL_SQUEEZING -squeezed_x = calculate_x_scale (&x_scale, &x_offset, no_X_ctrl_zones); -squeezed_y = calculate_y_scale(&y_top_scale,&y_bottom_scale,(n+1), - no_Y_ctrl_zones); -#if INCL_ISW -if (sp_globals.import_setwidth_act == TRUE) -setwidth_pix = ((fix15)(((fix31)sp_globals.imported_width * xppo0) >> - sp_globals.mpshift) + sp_globals.pixrnd) & sp_globals.pixfix; - -else -#endif -setwidth_pix = ((fix15)(((fix31)sp_globals.setwidth_orus * xppo0) >> - sp_globals.mpshift) + sp_globals.pixrnd) & sp_globals.pixfix; -/* check for overflow */ -if (setwidth_pix < 0) - setwidth_pix = 0x7fff; /* set to maximum */ -em_bot_pix = ((fix15)(((fix31)EM_BOT * yppo0) >> - sp_globals.mpshift) + sp_globals.pixrnd) & sp_globals.pixfix; -em_top_pix = ((fix15)(((fix31)EM_TOP * yppo0) >> - sp_globals.mpshift) + sp_globals.pixrnd) & sp_globals.pixfix; -#endif - -#if INCL_ISW -/* convert to pixels */ -isw_setwidth_pix = ((fix15)(((fix31)sp_globals.imported_width * xppo0) >> - sp_globals.mpshift) + sp_globals.pixrnd) & sp_globals.pixfix; -/* check for overflow */ -if (isw_setwidth_pix < 0) - isw_setwidth_pix = 0x7fff; /* set to maximum */ -if (!squeezed_x && ((imported_width = sp_globals.import_setwidth_act) == TRUE)) - { - isw_scale = compute_isw_scale(); - - /* look for the first non-negative oru value, scale and add the offset */ - /* to the corresponding pixel value - note that the pixel value */ - /* is set in read_oru_table. */ - - /* look at all the X edges */ - for (i=0; i < (no_X_ctrl_zones+1); i++) - if (sp_plaid.orus[i] >= 0) - { - sp_plaid.pix[i] = (SQUEEZE_MULT(sp_plaid.pix[i], isw_scale) - +sp_globals.pixrnd) & sp_globals.pixfix; - break; - } - - } -#endif - -for (i = 0; ; i++) /* For X and Y control zones... */ - { - for (j = 0; j < n; j++) /* For each zone in X or Y... */ - { - if (short_form) /* 1 byte from/to specification? */ - { - edge = NEXT_BYTE(pointer); /* Read packed from/to spec */ - start_edge = edge_org + (edge & 0x0f); /* Extract start edge */ - end_edge = edge_org + (edge >> 4); /* Extract end edge */ - } - else /* 2 byte from/to specification? */ - { - start_edge = edge_org + NEXT_BYTE(pointer); /* Read start edge */ - end_edge = edge_org + NEXT_BYTE(pointer); /* read end edge */ - } - constr_nr = constr_org + - NEXT_BYTES(pointer, tmpufix16); /* Read constraint number */ -#if INCL_SQUEEZING - if (i == 0 && squeezed_x) - calculate_x_pix(start_edge, end_edge, constr_nr, - x_scale, x_offset, ppo, setwidth_pix); - else if (i == 1 && squeezed_y) - calculate_y_pix(start_edge, end_edge,constr_nr, - y_top_scale, y_bottom_scale, ppo, em_top_pix, em_bot_pix); - else - { -#endif -#if INCL_ISW - if (i==0 && imported_width) - calculate_x_pix(start_edge, end_edge, constr_nr, - isw_scale, 0, ppo, isw_setwidth_pix); - else - { -#endif - if (!sp_globals.c_act[constr_nr]) /* Constraint inactive? */ - { - zone_pix = ((fix15)((((fix31)sp_plaid.orus[end_edge] - - (fix31)sp_plaid.orus[start_edge]) * ppo) / - (1<= sp_globals.c_pix[constr_nr]) - goto L1; - } - zone_pix = sp_globals.c_pix[constr_nr]; /* Use zone size from constr table */ - if (start_edge > end_edge) /* sp_plaid.orus[start_edge] > sp_plaid.orus[end_edge]? */ - { - zone_pix = -zone_pix; /* Use negatve zone size */ - } - L1: - /* inter-character spacing fix */ - if ((j == 0) && (i == 0)) /* if this is the 1st X zone, save rounding error */ - { /* get the non-xformed - xformed zone, in right direction */ - whole_zone = (((fix31)sp_plaid.orus[end_edge] - - (fix31)sp_plaid.orus[start_edge]) * - ppo) / (1<flags & SQUEEZE_LEFT) && - (sp_plaid.pix[end_edge] < 0)) - sp_plaid.pix[end_edge] = 0; - if ((sp_globals.pspecs->flags & SQUEEZE_RIGHT) && - (sp_plaid.pix[end_edge] > setwidth_pix)) - sp_plaid.pix[end_edge] = setwidth_pix; - } - if (i == 1) /* in the y direction */ - { /* brute force squeeze */ - if ((sp_globals.pspecs->flags & SQUEEZE_TOP) && - (sp_plaid.pix[end_edge] > em_top_pix)) - sp_plaid.pix[end_edge] = em_top_pix; - if ((sp_globals.pspecs->flags & SQUEEZE_BOTTOM) && - (sp_plaid.pix[end_edge] < em_bot_pix)) - sp_plaid.pix[end_edge] = em_bot_pix; - } -#endif -#if INCL_SQUEEZING - } -#endif -#if INCL_ISW - } -#endif -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ - record_ctrl_zone( - (fix31)sp_plaid.pix[start_edge] << (16 - sp_globals.pixshift), - (fix31)sp_plaid.pix[end_edge] << (16 - sp_globals.pixshift), - (fix15)(constr_nr - constr_org)); -#endif - } - if (i) /* Y pixels done? */ - break; - edge_org = sp_globals.Y_edge_org; /* Prepare to process Y ctrl zones */ - constr_org = sp_globals.Y_constr_org; - n = no_Y_ctrl_zones; - ppo = sp_globals.tcb.yppo; - } - -#if DEBUG -printf("\nX PIX TABLE\n"); -n = no_X_ctrl_zones + 1; -for (i = 0; i < n; i++) - printf("%2d %6.1f\n", i, (real)sp_plaid.pix[i] / (real)sp_globals.onepix); -printf("\nY PIX TABLE\n"); -n = no_Y_ctrl_zones + 1; -for (i = 0; i < n; i++) - { - j = i + no_X_ctrl_zones + 1; - printf("%2d %6.1f\n", i, (real)sp_plaid.pix[j] / (real)sp_globals.onepix); - } -#endif - -return pointer; -} -#endif - - -#if INCL_RULES -FUNCTION static ufix8 FONTFAR *sp_setup_int_table( -GDECL -ufix8 FONTFAR *pointer, /* Pointer to first byte in interpolation zone table */ -fix15 no_X_int_zones, /* Number of X interpolation zones */ -fix15 no_Y_int_zones) /* Number of X interpolation zones */ -/* - * Called by plaid_tcb() to read the interpolation zone table from the - * character data in the font. - * Sets up a table of interpolation coefficients with one entry for - * every X or Y interpolation zone. - * Updates the pointer to the byte following the interpolation zone - * data. - */ -{ -fix15 i, j, k, l, n; -ufix8 format; -ufix8 format_copy; -ufix8 tmpufix8; -fix15 start_orus = 0; -ufix8 edge_org; -ufix8 edge; -ufix16 adj_factor; -fix15 adj_orus; -fix15 end_orus = 0; -fix31 zone_orus; -fix15 start_pix = 0; -fix15 end_pix = 0; - - -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -begin_int_zones(no_X_int_zones, no_Y_int_zones); -#endif - -i = 0; -edge_org = 0; -n = no_X_int_zones; -for (j = 0; ; j++) - { - for (k = 0; k < n; k++) - { - format = NEXT_BYTE(pointer); - if (format & BIT7) /* Short start/end point spec? */ - { - tmpufix8 = NEXT_BYTE(pointer); - edge = edge_org + (tmpufix8 & 0xf); - start_orus = sp_plaid.orus[edge]; - start_pix = sp_plaid.pix[edge]; - edge = edge_org + (tmpufix8 >> 4); - end_orus = sp_plaid.orus[edge]; - end_pix = sp_plaid.pix[edge]; - } - else /* Standard start and end point spec? */ - { - format_copy = format; - for (l = 0; ; l++) /* Loop for start and end point */ - { - switch (format_copy & 0x7) /* Decode start/end point format */ - { - - case 0: /* Index to control edge */ - edge = edge_org + NEXT_BYTE(pointer); - end_orus = sp_plaid.orus[edge]; - end_pix = sp_plaid.pix[edge]; - break; - - case 1: /* 1 byte fractional distance to next edge */ - adj_factor = 0xffff & NEXT_BYTE(pointer) << 8; - goto L1; - - - case 2: /* 2 byte fractional distance to next edge */ - adj_factor = 0xffff & NEXT_WORD(pointer); - L1: edge = edge_org + NEXT_BYTE(pointer); - end_orus = sp_plaid.orus[edge] + - ((((fix31)sp_plaid.orus[edge + 1] - (fix31)sp_plaid.orus[edge]) * - (ufix32)adj_factor + (fix31)32768) >> 16); - end_pix = sp_plaid.pix[edge] + - ((((fix31)sp_plaid.pix[edge + 1] - (fix31)sp_plaid.pix[edge]) * - (ufix32)adj_factor + (fix31)32768) >> 16); - break; - - case 3: /* 1 byte delta orus before first edge */ - adj_orus = -(fix15)NEXT_BYTE(pointer); - goto L2; - - case 4: /* 2 byte delta orus before first edge */ - adj_orus = -NEXT_WORD(pointer); - L2: edge = edge_org; - goto L4; - - case 5: /* 1 byte delta orus after last edge */ - adj_orus = (fix15)NEXT_BYTE(pointer); - goto L3; - - case 6: /* 2 byte delta orus after last edge */ - adj_orus = NEXT_WORD(pointer); - L3: edge = j? sp_globals.Y_edge_org + sp_globals.no_Y_orus - 1: sp_globals.no_X_orus - 1; - L4: end_orus = sp_plaid.orus[edge] + adj_orus; - end_pix = sp_plaid.pix[edge] + - (((fix31)adj_orus * (fix31)(j? sp_globals.tcb.yppo: sp_globals.tcb.xppo) + - sp_globals.mprnd) / (1<>= 3; /* Adj format to decode end point format */ - start_orus = end_orus; /* Save start point oru value */ - start_pix = end_pix; /* Save start point pixel value */ - } - } -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ - record_int_zone( - (fix31)start_pix << (16 - sp_globals.pixshift), - (fix31)end_pix << (16 - sp_globals.pixshift)); -#endif - zone_orus = (fix31)end_orus - (fix31)start_orus; - sp_plaid.mult[i] = ((((fix31)end_pix - (fix31)start_pix) << sp_globals.mpshift) + - (zone_orus / 2)) / zone_orus; - sp_plaid.offset[i] = - (((((fix31)start_pix + (fix31)end_pix) << sp_globals.mpshift) - - ((fix31)sp_plaid.mult[i] * ((fix31)start_orus + (fix31)end_orus))) / 2) + - sp_globals.mprnd; - i++; - } - if (j) /* Finished? */ - break; - edge_org = sp_globals.Y_edge_org; /* Prepare to process Y ctrl zones */ - n = no_Y_int_zones; - } - -#if DEBUG -printf("\nX INT TABLE\n"); -n = no_X_int_zones; -for (i = 0; i < n; i++) - { - printf("%2d %7.4f %7.4f\n", i, - (real)sp_plaid.mult[i] / (real)(1 << sp_globals.multshift), - (real)sp_plaid.offset[i] / (real)(1 << sp_globals.multshift)); - } -printf("\nY INT TABLE\n"); -n = no_Y_int_zones; -for (i = 0; i < n; i++) - { - j = i + no_X_int_zones; - printf("%2d %7.4f %7.4f\n", i, - (real)sp_plaid.mult[j] / (real)(1 << sp_globals.multshift), - (real)sp_plaid.offset[j] / (real)(1 << sp_globals.multshift)); - } -#endif - -return pointer; -} -#endif -#if INCL_ISW -FUNCTION fix31 compute_isw_scale() -GDECL -{ -fix31 isw_scale; - -if (sp_globals.setwidth_orus == 0) - isw_scale = 0x00010000; -else - isw_scale = ((fix31)sp_globals.imported_width << 16)/ - (fix31)sp_globals.setwidth_orus; -return isw_scale; -} -#endif diff --git a/nx-X11/lib/font/Speedo/spdo_prv.h b/nx-X11/lib/font/Speedo/spdo_prv.h deleted file mode 100644 index 162c0fddd..000000000 --- a/nx-X11/lib/font/Speedo/spdo_prv.h +++ /dev/null @@ -1,421 +0,0 @@ -/* $Xorg: spdo_prv.h,v 1.3 2000/08/17 19:46:27 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/spdo_prv.h,v 1.4 1999/03/14 03:21:17 dawes Exp $ */ - - - -/***************************** S P D O _ P R V . H *******************************/ - -#include "speedo.h" /* include public definitions */ - -/***** CONFIGURATION DEFINITIONS *****/ - - -/***** PRIVATE FONT HEADER OFFSET CONSTANTS *****/ -#define FH_ORUMX 0 /* U Max ORU value 2 bytes */ -#define FH_PIXMX 2 /* U Max Pixel value 2 bytes */ -#define FH_CUSNR 4 /* U Customer Number 2 bytes */ -#define FH_OFFCD 6 /* E Offset to Char Directory 3 bytes */ -#define FH_OFCNS 9 /* E Offset to Constraint Data 3 bytes */ -#define FH_OFFTK 12 /* E Offset to Track Kerning 3 bytes */ -#define FH_OFFPK 15 /* E Offset to Pair Kerning 3 bytes */ -#define FH_OCHRD 18 /* E Offset to Character Data 3 bytes */ -#define FH_NBYTE 21 /* E Number of Bytes in File 3 bytes */ - - -/***** MODE FLAGS CONSTANTS *****/ -#define CURVES_OUT 0X0008 /* Output module accepts curves */ -#define BOGUS_MODE 0X0010 /* Linear scaling mode */ -#define CONSTR_OFF 0X0020 /* Inhibit constraint table */ -#define IMPORT_WIDTHS 0X0040 /* Imported width mode */ -#define SQUEEZE_LEFT 0X0100 /* Squeeze left mode */ -#define SQUEEZE_RIGHT 0X0200 /* Squeeze right mode */ -#define SQUEEZE_TOP 0X0400 /* Squeeze top mode */ -#define SQUEEZE_BOTTOM 0X0800 /* Squeeze bottom mode */ -#define CLIP_LEFT 0X1000 /* Clip left mode */ -#define CLIP_RIGHT 0X2000 /* Clip right mode */ -#define CLIP_TOP 0X4000 /* Clip top mode */ -#define CLIP_BOTTOM 0X8000 /* Clip bottom mode */ - - -/***** MACRO DEFINITIONS *****/ - -#define SQUEEZE_MULT(A,B) (((fix31)A * (fix31)B) / (1 << 16)) - -#define NEXT_BYTE(A) (*(A)++) - -#define NEXT_WORD(A) \ - ((fix15)(sp_globals.key32 ^ ((A) += 2, \ - ((fix15)((A)[-1]) << 8) | (fix15)((A)[-2]) | \ - ((A)[-1] & 0x80? ~0xFFFF : 0)))) - -#if INCL_EXT /* Extended fonts supported? */ - -#define NEXT_BYTES(A, B) \ - (((B = (ufix16)(*(A)++) ^ sp_globals.key7) >= 248)? \ - ((ufix16)(B & 0x07) << 8) + ((*(A)++) ^ sp_globals.key8) + 248: \ - B) - -#else /* Compact fonts only supported? */ - -#define NEXT_BYTES(A, B) ((*(A)++) ^ sp_globals.key7) - -#endif - - -#define NEXT_BYTE_U(A) (*(A)++) - -#define NEXT_WORD_U(A, B) \ - (fix15)(B = (*(A)++) << 8, (fix15)(*(A)++) + B) - -#define NEXT_CHNDX(A, B) \ - ((B)? (ufix16)NEXT_WORD(A): (ufix16)NEXT_BYTE(A)) - -/* Multiply (fix15)X by (fix15)Y to produce (fix31)product */ -#define MULT16(X, Y) \ - ((fix31)X * (fix31)Y) - -/* Multiply (fix15)X by (fix15)MULT, add (fix31)OFFSET, - * shift right SHIFT bits to produce (fix15)result */ -#define TRANS(X, MULT, OFFSET, SHIFT) \ - ((fix15)((((fix31)X * (fix31)MULT) + OFFSET) / (1 << SHIFT))) - -/****************************************************************************** - * - * the following block of definitions redefines every function - * reference to be prefixed with an "sp_". In addition, if this - * is a reentrant version, the parameter sp_globals will be added - * as the first parameter. - * - *****************************************************************************/ - -#if STATIC_ALLOC || DYNAMIC_ALLOC - -#define GDECL - -#define get_char_id(char_index) sp_get_char_id(char_index) -#define get_char_width(char_index) sp_get_char_width(char_index) -#define get_track_kern(track,point_size) sp_get_track_kern(track,point_size) -#define get_pair_kern(char_index1,char_index2) sp_get_pair_kern(char_index1,char_index2) -#define get_char_bbox(char_index,bbox) sp_get_char_bbox(char_index,bbox) -#define make_char(char_index) sp_make_char(char_index) -#if INCL_ISW -#define compute_isw_scale() sp_compute_isw_scale() -#define do_make_char(char_index) sp_do_make_char(char_index) -#define make_char_isw(char_index,imported_width) sp_make_char_isw(char_index,imported_width) -#define reset_xmax(xmax) sp_reset_xmax(xmax) -#endif -#if INCL_ISW || INCL_SQUEEZING -#define preview_bounding_box(pointer,format) sp_preview_bounding_box(pointer,format) -#endif -#define make_simp_char(pointer,format) sp_make_simp_char(pointer,format) -#define make_comp_char(pointer) sp_make_comp_char(pointer) -#define get_char_org(char_index,top_level) sp_get_char_org(char_index,top_level) -#define get_posn_arg(ppointer,format) sp_get_posn_arg(ppointer,format) -#define get_scale_arg(ppointer,format) sp_get_scale_arg(ppointer,format) -#define read_bbox(ppointer,pPmin,pPmax,set_flag) sp_read_bbox(ppointer,pPmin,pPmax,set_flag) -#define proc_outl_data(pointer) sp_proc_outl_data(pointer) -#define split_curve(P1,P2,P3,depth) sp_split_curve(P1,P2,P3,depth) -#define get_args(ppointer,format,pP) sp_get_args(ppointer,format,pP) - -#define init_black(specsarg) sp_init_black(specsarg) -#define begin_char_black(Psw,Pmin,Pmax) sp_begin_char_black(Psw,Pmin,Pmax) -#define begin_contour_black(P1,outside) sp_begin_contour_black(P1,outside) -#define line_black(P1) sp_line_black(P1) -#define end_char_black() sp_end_char_black() -#define add_intercept_black(y,x) sp_add_intercept_black(y,x) -#define proc_intercepts_black() sp_proc_intercepts_black() - -#define init_screen(specsarg) sp_init_screen(specsarg) -#define begin_char_screen(Psw,Pmin,Pmax) sp_begin_char_screen(Psw,Pmin,Pmax) -#define begin_contour_screen(P1,outside) sp_begin_contour_screen(P1,outside) -#define curve_screen(P1,P2,P3,depth) sp_curve_screen(P1,P2,P3,depth) -#define scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3) sp_scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3) -#define vert_line_screen(x,y1,y2) sp_vert_line_screen(x,y1,y2) -#define line_screen(P1) sp_line_screen(P1) -#define end_contour_screen() sp_end_contour_screen() -#define end_char_screen() sp_end_char_screen() -#define add_intercept_screen(y,x) sp_add_intercept_screen(y,x) -#define proc_intercepts_screen() sp_proc_intercepts_screen() - -#define init_outline(specsarg) sp_init_outline(specsarg) -#define begin_char_outline(Psw,Pmin,Pmax) sp_begin_char_outline(Psw,Pmin,Pmax) -#define begin_sub_char_outline(Psw,Pmin,Pmax) sp_begin_sub_char_outline(Psw,Pmin,Pmax) -#define begin_contour_outline(P1,outside) sp_begin_contour_outline(P1,outside) -#define curve_outline(P1,P2,P3,depth) sp_curve_outline(P1,P2,P3,depth) -#define line_outline(P1) sp_line_outline(P1) -#define end_contour_outline() sp_end_contour_outline() -#define end_sub_char_outline() sp_end_sub_char_outline() -#define end_char_outline() sp_end_char_outline() - -#define init_2d(specsarg) sp_init_2d(specsarg) -#define begin_char_2d(Psw, Pmin, Pmax) sp_begin_char_2d(Psw, Pmin, Pmax) -#define begin_contour_2d(P1, outside) sp_begin_contour_2d(P1, outside) -#define line_2d(P1) sp_line_2d(P1) -#define end_char_2d() sp_end_char_2d() -#define add_intercept_2d(y, x) sp_add_intercept_2d(y, x) -#define proc_intercepts_2d() sp_proc_intercepts_2d() -#define draw_vector_to_2d(x0, y0, x1, y1, band) sp_draw_vector_to_2d(x0, y0, x1, y1, band) - -#define init_char_out(Psw,Pmin,Pmax) sp_init_char_out(Psw,Pmin,Pmax) -#define begin_sub_char_out(Psw,Pmin,Pmax) sp_begin_sub_char_out(Psw,Pmin,Pmax) -#define curve_out(P1,P2,P3,depth) sp_curve_out(P1,P2,P3,depth) -#define end_contour_out() sp_end_contour_out() -#define end_sub_char_out() sp_end_sub_char_out() -#define init_intercepts_out() sp_init_intercepts_out() -#define restart_intercepts_out() sp_restart_intercepts_out() -#define set_first_band_out(Pmin,Pmax) sp_set_first_band_out(Pmin,Pmax) -#define reduce_band_size_out() sp_reduce_band_size_out() -#define next_band_out() sp_next_band_out() - -#define init_userout(specsarg) sp_init_userout(specsarg) - -#define reset() sp_reset() -#define set_key(key) sp_set_key(key) -#define get_cust_no(font_buff) sp_get_cust_no(font_buff) -#define set_specs(specsarg) sp_set_specs(specsarg) -#define setup_consts(xmin,xmax,ymin,ymax) sp_setup_consts(xmin,xmax,ymin,ymax) -#define setup_tcb(ptcb) sp_setup_tcb(ptcb) -#define setup_mult(input_mult) sp_setup_mult(input_mult) -#define setup_offset(input_offset) sp_setup_offset(input_offset) -#define type_tcb(ptcb) sp_type_tcb(ptcb) -#define read_long(pointer) sp_read_long(pointer) -#define read_word_u(pointer) sp_read_word_u(pointer) -#define init_tcb() sp_init_tcb() -#define scale_tcb(ptcb,x_pos,y_pos,x_scale,y_scale) sp_scale_tcb(ptcb,x_pos,y_pos,x_scale,y_scale) -#define plaid_tcb(ppointer,format) sp_plaid_tcb(ppointer,format) -#define skip_orus(ppointer,short_form,no_ctrl_zones) sp_skip_orus(ppointer,short_form,no_ctrl_zones) -#define skip_interpolation_table(ppointer,format) sp_skip_interpolation_table(ppointer,format) -#define skip_control_zone(ppointer,format) sp_skip_control_zone(ppointer,format) -#define constr_update() sp_constr_update() -#define read_oru_table(ppointer) sp_read_oru_table(ppointer) -#define calculate_x_pix(start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix) sp_calculate_x_pix(start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix) -#define calculate_y_pix(start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix) sp_calculate_y_pix(start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix) -#define calculate_x_scale(x_factor,x_offset,no_x_ctrl_zones) sp_calculate_x_scale(x_factor,x_offset,no_x_ctrl_zones) -#define calculate_y_scale(top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) sp_calculate_y_scale(top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) -#define setup_pix_table(ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones) sp_setup_pix_table(ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones) -#define setup_int_table(ppointer,no_X_int_zones, no_Y_int_zones) sp_setup_int_table(ppointer,no_X_int_zones, no_Y_int_zones) - -#define fn_init_out(specsarg) (*sp_globals.init_out)(specsarg) -#define fn_begin_char(Psw,Pmin,Pmax) (*sp_globals.begin_char)(Psw,Pmin,Pmax) -#define fn_begin_sub_char(Psw,Pmin,Pmax) (*sp_globals.begin_sub_char)(Psw,Pmin,Pmax) -#define fn_end_sub_char() (*sp_globals.end_sub_char)() -#define fn_end_char() (*sp_globals.end_char)() -#define fn_line(P1) (*sp_globals.line)(P1) -#define fn_end_contour() (*sp_globals.end_contour)() -#define fn_begin_contour(P0,fmt) (*sp_globals.begin_contour)(P0,fmt) -#define fn_curve(P1,P2,P3,depth) (*sp_globals.curve)(P1,P2,P3,depth) - -#define load_char_data(offset, no_bytes, buff_off) sp_load_char_data(offset, no_bytes, buff_off) -#define report_error(n) sp_report_error(n) - -#if INCL_MULTIDEV - -#define set_bitmap_device(bfuncs,size) sp_set_bitmap_device(bfuncs,size) -#define set_outline_device(ofuncs,size) sp_set_outline_device(ofuncs,size) - -#define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax) (*sp_globals.bitmap_device.p_open_bitmap)(x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define set_bitmap_bits(y, xbit1, xbit2) (*sp_globals.bitmap_device.p_set_bits)(y, xbit1, xbit2) -#define close_bitmap() (*sp_globals.bitmap_device.p_close_bitmap)() - -#define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax) (*sp_globals.outline_device.p_open_outline)(x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define start_new_char() (*sp_globals.outline_device.p_start_char)() -#define start_contour(x,y,outside) (*sp_globals.outline_device.p_start_contour)(x,y,outside) -#define curve_to(x1,y1,x2,y2,x3,y3) (*sp_globals.outline_device.p_curve)(x1,y1,x2,y2,x3,y3) -#define line_to(x,y) (*sp_globals.outline_device.p_line)(x,y) -#define close_contour() (*sp_globals.outline_device.p_close_contour)() -#define close_outline() (*sp_globals.outline_device.p_close_outline)() - -#else - -#define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define set_bitmap_bits(y, xbit1, xbit2) sp_set_bitmap_bits(y, xbit1, xbit2) -#define close_bitmap() sp_close_bitmap() - -#define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define start_new_char() sp_start_new_char() -#define start_contour(x,y,outside) sp_start_contour(x,y,outside) -#define curve_to(x1,y1,x2,y2,x3,y3) sp_curve_to(x1,y1,x2,y2,x3,y3) -#define line_to(x,y) sp_line_to(x,y) -#define close_contour() sp_close_contour() -#define close_outline() sp_close_outline() - -#endif - -#else - -#define GDECL SPEEDO_GLOBALS* sp_global_ptr, - -#define get_char_id(char_index) sp_get_char_id(sp_global_ptr,char_index) -#define get_char_width(char_index) sp_get_char_width(sp_global_ptr,char_index) -#define get_track_kern(track,point_size) sp_get_track_kern(sp_global_ptr,track,point_size) -#define get_pair_kern(char_index1,char_index2) sp_get_pair_kern(sp_global_ptr,char_index1,char_index2) -#define get_char_bbox(char_index,bbox) sp_get_char_bbox(sp_global_ptr,char_index,bbox) -#define make_char(char_index) sp_make_char(sp_global_ptr,char_index) -#if INCL_ISW -#define compute_isw_scale() sp_compute_isw_scale(sp_global_ptr) -#define do_make_char(char_index) sp_do_make_char(sp_global_ptr,char_index) -#define make_char_isw(char_index,imported_width) sp_make_char_isw(sp_global_ptr,char_index,imported_width) -#define reset_xmax(xmax) sp_reset_xmax(sp_global_ptr,xmax) -#endif -#if INCL_ISW || INCL_SQUEEZING -#define preview_bounding_box(pointer,format) sp_preview_bounding_box(sp_global_ptr,pointer,format) -#endif -#define make_simp_char(pointer,format) sp_make_simp_char(sp_global_ptr,pointer,format) -#define make_comp_char(pointer) sp_make_comp_char(sp_global_ptr,pointer) -#define get_char_org(char_index,top_level) sp_get_char_org(sp_global_ptr,char_index,top_level) -#define get_posn_arg(ppointer,format) sp_get_posn_arg(sp_global_ptr,ppointer,format) -#define get_scale_arg(ppointer,format) sp_get_scale_arg(sp_global_ptr,ppointer,format) -#define read_bbox(ppointer,pPmin,pPmax,set_flag) sp_read_bbox(sp_global_ptr,ppointer,pPmin,pPmax,set_flag) -#define proc_outl_data(pointer) sp_proc_outl_data(sp_global_ptr,pointer) -#define split_curve(P1,P2,P3,depth) sp_split_curve(sp_global_ptr,P1,P2,P3,depth) -#define get_args(ppointer,format,pP) sp_get_args(sp_global_ptr,ppointer,format,pP) - -#define init_black(specsarg) sp_init_black(sp_global_ptr,specsarg) -#define begin_char_black(Psw,Pmin,Pmax) sp_begin_char_black(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_contour_black(P1,outside) sp_begin_contour_black(sp_global_ptr,P1,outside) -#define line_black(P1) sp_line_black(sp_global_ptr,P1) -#define end_char_black() sp_end_char_black(sp_global_ptr) -#define add_intercept_black(y,x) sp_add_intercept_black(sp_global_ptr,y,x) -#define proc_intercepts_black() sp_proc_intercepts_black(sp_global_ptr) - -#define init_screen(specsarg) sp_init_screen(sp_global_ptr,specsarg) -#define begin_char_screen(Psw,Pmin,Pmax) sp_begin_char_screen(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_contour_screen(P1,outside) sp_begin_contour_screen(sp_global_ptr,P1,outside) -#define curve_screen(P1,P2,P3,depth) sp_curve_screen(sp_global_ptr,P1,P2,P3,depth) -#define scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3) sp_scan_curve_screen(sp_global_ptr,X0,Y0,X1,Y1,X2,Y2,X3,Y3) -#define vert_line_screen(x,y1,y2) sp_vert_line_screen(sp_global_ptr,x,y1,y2) -#define line_screen(P1) sp_line_screen(sp_global_ptr,P1) -#define end_char_screen() sp_end_char_screen(sp_global_ptr) -#define end_contour_screen() sp_end_contour_screen(sp_global_ptr) -#define add_intercept_screen(y,x) sp_add_intercept_screen(sp_global_ptr,y,x) -#define proc_intercepts_screen() sp_proc_intercepts_screen(sp_global_ptr) - -#define init_outline(specsarg) sp_init_outline(sp_global_ptr,specsarg) -#define begin_char_outline(Psw,Pmin,Pmax) sp_begin_char_outline(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_sub_char_outline(Psw,Pmin,Pmax) sp_begin_sub_char_outline(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_contour_outline(P1,outside) sp_begin_contour_outline(sp_global_ptr,P1,outside) -#define curve_outline(P1,P2,P3,depth) sp_curve_outline(sp_global_ptr,P1,P2,P3,depth) -#define line_outline(P1) sp_line_outline(sp_global_ptr,P1) -#define end_contour_outline() sp_end_contour_outline(sp_global_ptr) -#define end_sub_char_outline() sp_end_sub_char_outline(sp_global_ptr) -#define end_char_outline() sp_end_char_outline(sp_global_ptr) - -#define init_2d(specsarg) sp_init_2d(sp_global_ptr,specsarg) -#define begin_char_2d(Psw, Pmin, Pmax) sp_begin_char_2d(sp_global_ptr,Psw, Pmin, Pmax) -#define begin_contour_2d(P1, outside) sp_begin_contour_2d(sp_global_ptr,P1, outside) -#define line_2d(P1) sp_line_2d(sp_global_ptr,P1) -#define end_char_2d() sp_end_char_2d(sp_global_ptr) -#define add_intercept_2d(y, x) sp_add_intercept_2d(sp_global_ptr,y, x) -#define proc_intercepts_2d() sp_proc_intercepts_2d(sp_global_ptr) -#define draw_vector_to_2d(x0, y0, x1, y1, band) sp_draw_vector_to_2d(sp_global_ptr,x0, y0, x1, y1, band) - -#define init_char_out(Psw,Pmin,Pmax) sp_init_char_out(sp_global_ptr,Psw,Pmin,Pmax) -#define begin_sub_char_out(Psw,Pmin,Pmax) sp_begin_sub_char_out(sp_global_ptr,Psw,Pmin,Pmax) -#define curve_out(P1,P2,P3,depth) sp_curve_out(sp_global_ptr,P1,P2,P3,depth) -#define end_contour_out() sp_end_contour_out(sp_global_ptr) -#define end_sub_char_out() sp_end_sub_char_out(sp_global_ptr) -#define init_intercepts_out() sp_init_intercepts_out(sp_global_ptr) -#define restart_intercepts_out() sp_restart_intercepts_out(sp_global_ptr) -#define set_first_band_out(Pmin,Pmax) sp_set_first_band_out(sp_global_ptr,Pmin,Pmax) -#define reduce_band_size_out() sp_reduce_band_size_out(sp_global_ptr) -#define next_band_out() sp_next_band_out(sp_global_ptr) - -#define init_userout(specsarg) sp_init_userout(sp_global_ptr,specsarg) - -#define reset() sp_reset(sp_global_ptr) -#define set_key(key) sp_set_key(sp_global_ptr,key) -#define get_cust_no(font_buff) sp_get_cust_no(sp_global_ptr,font_buff) -#define set_specs(specsarg) sp_set_specs(sp_global_ptr,specsarg) -#define setup_consts(xmin,xmax,ymin,ymax) sp_setup_consts(sp_global_ptr,xmin,xmax,ymin,ymax) -#define setup_tcb(ptcb) sp_setup_tcb(sp_global_ptr,ptcb) -#define setup_mult(input_mult) sp_setup_mult(sp_global_ptr,input_mult) -#define setup_offset(input_offset) sp_setup_offset(sp_global_ptr,input_offset) -#define type_tcb(ptcb) sp_type_tcb(sp_global_ptr,ptcb) -#define read_long(pointer) sp_read_long(sp_global_ptr,pointer) -#define read_word_u(pointer) sp_read_word_u(sp_global_ptr,pointer) -#define init_tcb() sp_init_tcb(sp_global_ptr) -#define scale_tcb(ptcb,x_pos,y_pos,x_scale,y_scale) sp_scale_tcb(sp_global_ptr,ptcb,x_pos,y_pos,x_scale,y_scale) -#define plaid_tcb(ppointer,format) sp_plaid_tcb(sp_global_ptr,ppointer,format) -#define skip_orus(ppointer,short_form,no_ctrl_zones) sp_skip_orus(sp_global_ptr,ppointer,short_form,no_ctrl_zones) -#define skip_interpolation_table(ppointer,format) sp_skip_interpolation_table(sp_global_ptr,ppointer,format) -#define skip_control_zone(ppointer,format) sp_skip_control_zone(sp_global_ptr,ppointer,format) -#define constr_update() sp_constr_update(sp_global_ptr) -#define read_oru_table(ppointer) sp_read_oru_table(sp_global_ptr,ppointer) -#define calculate_x_pix(start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix) sp_calculate_x_pix(sp_global_ptr,start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix) -#define calculate_y_pix(start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix) sp_calculate_y_pix(sp_global_ptr,start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix) -#define calculate_x_scale(x_factor,x_offset,no_x_ctrl_zones) sp_calculate_x_scale(sp_global_ptr,x_factor,x_offset,no_x_ctrl_zones) -#define calculate_y_scale(top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) sp_calculate_y_scale(sp_global_ptr,top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) -#define setup_pix_table(ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones) sp_setup_pix_table(sp_global_ptr,ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones) -#define setup_int_table(ppointer,no_X_int_zones, no_Y_int_zones) sp_setup_int_table(sp_global_ptr,ppointer,no_X_int_zones, no_Y_int_zones) - -#define fn_init_out(specsarg) (*sp_globals.init_out)(sp_global_ptr,specsarg) -#define fn_begin_char(Psw,Pmin,Pmax) (*sp_globals.begin_char)(sp_global_ptr,Psw,Pmin,Pmax) -#define fn_begin_sub_char(Psw,Pmin,Pmax) (*sp_globals.begin_sub_char)(sp_global_ptr,Psw,Pmin,Pmax) -#define fn_end_sub_char() (*sp_globals.end_sub_char)(sp_global_ptr) -#define fn_end_char() (*sp_globals.end_char)(sp_global_ptr) -#define fn_line(P1) (*sp_globals.line)(sp_global_ptr,P1) -#define fn_end_contour() (*sp_globals.end_contour)(sp_global_ptr) -#define fn_begin_contour(P0,fmt) (*sp_globals.begin_contour)(sp_global_ptr,P0,fmt) -#define fn_curve(P1,P2,P3,depth) (*sp_globals.curve)(sp_global_ptr,P1,P2,P3,depth) - - -#define load_char_data(offset, no_bytes, buff_off) sp_load_char_data(sp_global_ptr, offset, no_bytes, buff_off) -#define report_error(n) sp_report_error(sp_global_ptr, n) - -#if INCL_MULTIDEV - -#define set_bitmap_device(bfuncs,size) sp_set_bitmap_device(sp_global_ptr,bfuncs,size) -#define set_outline_device(ofuncs,size) sp_set_outline_device(sp_global_ptr,ofuncs,size) - -#define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax)(*sp_globals.bitmap_device.p_open_bitmap)(sp_global_ptr,x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define set_bitmap_bits(y, xbit1, xbit2)(*sp_globals.bitmap_device.p_set_bits)(sp_global_ptr,y, xbit1, xbit2) -#define close_bitmap()(*sp_globals.bitmap_device.p_close_bitmap)(sp_global_ptr) - -#define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax)(*sp_globals.outline_device.p_open_outline)(sp_global_ptr,x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define start_new_char()(*sp_globals.outline_device.p_start_char)(sp_global_ptr) -#define start_contour(x,y,outside)(*sp_globals.outline_device.p_start_contour)(sp_global_ptr,x,y,outside) -#define curve_to(x1,y1,x2,y2,x3,y3)(*sp_globals.outline_device.p_curve)(sp_global_ptr,x1,y1,x2,y2,x3,y3) -#define line_to(x,y)(*sp_globals.outline_device.p_line)(sp_global_ptr,x,y) -#define close_contour()(*sp_globals.outline_device.p_close_contour)(sp_global_ptr) -#define close_outline()(*sp_globals.outline_device.p_close_outline)(sp_global_ptr) - -#else - -#define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_bitmap(sp_global_ptr, x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define set_bitmap_bits(y, xbit1, xbit2) sp_set_bitmap_bits(sp_global_ptr, y, xbit1, xbit2) -#define close_bitmap() sp_close_bitmap(sp_global_ptr) - -#define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_outline(sp_global_ptr, x_set_width, y_set_width, xmin, xmax, ymin, ymax) -#define start_new_char() sp_start_new_char(sp_global_ptr ) -#define start_contour(x,y,outside) sp_start_contour(sp_global_ptr, x,y,outside) -#define curve_to(x1,y1,x2,y2,x3,y3) sp_curve_to(sp_global_ptr, x1,y1,x2,y2,x3,y3) -#define line_to(x,y) sp_line_to(sp_global_ptr, x,y) -#define close_contour() sp_close_contour(sp_global_ptr) -#define close_outline() sp_close_outline(sp_global_ptr) - -#endif -#endif - - diff --git a/nx-X11/lib/font/Speedo/speedo.h b/nx-X11/lib/font/Speedo/speedo.h deleted file mode 100644 index 5eb516c1c..000000000 --- a/nx-X11/lib/font/Speedo/speedo.h +++ /dev/null @@ -1,890 +0,0 @@ -/* $Xorg: speedo.h,v 1.3 2000/08/17 19:46:27 cpqbld Exp $ */ - -/* - -Copyright 1989-1991, Bitstream Inc., Cambridge, MA. -You are hereby granted permission under all Bitstream propriety rights to -use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo -software and the Bitstream Charter outline font for any purpose and without -restrictions; provided, that this notice is left intact on all copies of such -software or font and that Bitstream's trademark is acknowledged as shown below -on all unmodified copies of such font. - -BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - - -BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT -DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER -INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED -WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT. - -*/ -/* $XFree86: xc/lib/font/Speedo/speedo.h,v 3.5 2001/01/17 19:43:18 dawes Exp $ */ - -#ifndef _SPEEDO_H_ -#define _SPEEDO_H_ - -#include - -/***************************** S P E E D O . H ******************************* - ****************************************************************************/ - -/***** USER OPTIONS OVERRIDE DEFAULTS ******/ -#include "useropt.h" - -/***** CONFIGURATION DEFINITIONS *****/ - -#ifndef INCL_CLIPPING -#define INCL_CLIPPING 0 /* 0 indicates CLIPPING code is not compiled in*/ -#endif - -#ifndef INCL_SQUEEZING -#define INCL_SQUEEZING 0 /* 0 indicates SQUEEZE code is not compiled in*/ -#endif - -#ifndef INCL_EXT -#define INCL_EXT 1 /* 1 to include extended font support */ -#endif /* 0 to omit extended font support */ - -#ifndef INCL_RULES -#define INCL_RULES 1 /* 1 to include intelligent scaling support */ -#endif /* 0 to omit intelligent scaling support */ - -#ifndef INCL_BLACK -#define INCL_BLACK 1 /* 1 to include blackwriter output support */ -#endif /* 0 to omit output mode 0 support */ - -#ifndef INCL_SCREEN -#define INCL_SCREEN 0 /* 1 to include screen writeroutput support */ -#endif /* 0 to omit support */ - -#ifndef INCL_OUTLINE -#define INCL_OUTLINE 0 /* 1 to include outline output support */ -#endif /* 0 to omit output mode 2 support */ - -#ifndef INCL_2D -#define INCL_2D 0 /* 1 to include 2d blackwriter output support */ -#endif /* 0 to omit output mode 3 support */ - -#ifndef INCL_USEROUT -#define INCL_USEROUT 0 /* 1 to include user defined output module support */ -#endif /* 0 to omit user defined output module support */ - -#ifndef INCL_LCD -#define INCL_LCD 1 /* 1 to include load char data support*/ -#endif /* 0 to omit load char data support */ -#ifndef INCL_ISW -#define INCL_ISW 0 /* 1 to include imported width support */ -#endif /* 0 to omit imported width support */ - -#ifndef INCL_METRICS -#define INCL_METRICS 1 /* 1 to include metrics support */ -#endif /* 0 to omit metrics support */ - -#ifndef INCL_KEYS -#define INCL_KEYS 0 /* 1 to include multi key support */ -#endif /* 0 to omit multi key support */ - -#ifndef INCL_MULTIDEV -#define INCL_MULTIDEV 0 /* 1 to include multiple output device support */ -#endif /* 0 to omit multi device support */ - -#ifndef SHORT_LISTS -#define SHORT_LISTS 1 /* 1 to allocate small intercept lists */ -#endif - -#ifndef INCL_PLAID_OUT -#define INCL_PLAID_OUT 0 /* 1 to include plaid data monitoring */ -#endif /* 0 to omit plaid data monitoring */ - -#ifndef FONTFAR /* if Intel mixed memory model implementation */ -#define FONTFAR /* pointer type modifier for font buffer */ -#endif - -#ifndef STACKFAR /* if Intel mixed memory model implementation */ -#define STACKFAR /* pointer type modifier for font buffer */ -#endif - -#ifndef GLOBALFAR -#define GLOBALFAR -#endif - -#define MODE_BLACK 0 -#define MODE_SCREEN MODE_BLACK + INCL_BLACK -#define MODE_OUTLINE MODE_SCREEN + INCL_SCREEN -#define MODE_2D MODE_OUTLINE + INCL_OUTLINE - -#ifdef DYNAMIC_ALLOC -#if DYNAMIC_ALLOC -#define STATIC_ALLOC 0 -#endif -#endif - -#ifdef REENTRANT_ALLOC -#if REENTRANT_ALLOC -#define STATIC_ALLOC 0 -#endif -#endif - -#ifndef STATIC_ALLOC -#define STATIC_ALLOC 1 -#endif - -#ifndef DYNAMIC_ALLOC -#define DYNAMIC_ALLOC 0 -#endif - -#ifndef REENTRANT_ALLOC -#define REENTRANT_ALLOC 0 -#endif - -/***** TYPE DEFINITIONS *****/ - -#ifndef STDEF -#ifndef SPD_BMAP - -typedef INT8 fix7; - -typedef double real; - -typedef CARD8 ufix8; -#ifndef VFONT -typedef CARD8 boolean; -#endif -#endif - -typedef INT16 fix15; - -typedef CARD16 ufix16; - -typedef INT32 fix31; - -typedef CARD32 ufix32; -#endif - -/***** GENERAL CONSTANTS *****/ - -#ifndef FALSE -#define FALSE 0 -#define TRUE 1 -#endif - -#ifndef NULL -#include -#endif - -#define FUNCTION - -#define BIT0 0x01 -#define BIT1 0x02 -#define BIT2 0x04 -#define BIT3 0x08 -#define BIT4 0x10 -#define BIT5 0x20 -#define BIT6 0x40 -#define BIT7 0x80 - -#if INCL_EXT /* Extended fonts supported? */ - -#define MAX_CONSTR 750 /* Max constraints (incl 4 dummies) */ -#define MAX_CTRL_ZONES 256 /* Max number of controlled orus */ -#define MAX_INT_ZONES 256 /* Max number of interpolation zones */ - -#else /* Compact fonts only supported */ - -#define MAX_CONSTR 512 /* Max constraints (incl 4 dummies) */ -#define MAX_CTRL_ZONES 64 /* Max number of controlled orus */ -#define MAX_INT_ZONES 64 /* Max number of interpolation zones */ - -#endif - -#define SCALE_SHIFT 12 /* Binary point positiion for scale values */ -#define SCALE_RND 2048 /* Rounding bit for scaling transformation */ -#define ONE_SCALE 4096 /* Unity scale value */ - -#ifdef INCL_SCREEN /* constants used by Screenwriter module */ -#define LEFT_INT 1 /* left intercept */ -#define END_INT 2 /* last intercept */ -#define FRACTION 0xFC /* fractional portion of intercept type list */ -#endif - -#if INCL_SQUEEZING || INCL_CLIPPING /* constants used by SQUEEZEing code */ -#define EM_TOP 764 -#define EM_BOT -236 -#endif - -/***** STRUCTURE DEFINITIONS *****/ -#if REENTRANT_ALLOC -#define PROTO_DECL1 struct speedo_global_data GLOBALFAR *sp_global_ptr -#define PROTO_DECL2 PROTO_DECL1 , -#else -#define PROTO_DECL1 void -#define PROTO_DECL2 -#endif - -typedef -struct buff_tag - { - ufix8 FONTFAR *org; /* Pointer to start of buffer */ - ufix32 no_bytes; /* Size of buffer in bytes */ - } -buff_t; /* Buffer descriptor */ - -typedef struct constr_tag - { - ufix8 FONTFAR *org; /* Pointer to first byte in constr data */ - ufix16 font_id; /* Font id for calculated data */ - fix15 xppo; /* X pixels per oru for calculated data */ - fix15 yppo; /* Y pixels per oru for calculated data */ - boolean font_id_valid; /* TRUE if font id valid */ - boolean data_valid; /* TRUE if calculated data valid */ - boolean active; /* TRUE if constraints enabled */ - } -constr_t; /* Constraint data state */ - -typedef struct kern_tag - { - ufix8 FONTFAR *tkorg; /* First byte of track kerning data */ - ufix8 FONTFAR *pkorg; /* First byte of pair kerning data */ - fix15 no_tracks; /* Number of kerning tracks */ - fix15 no_pairs; /* Number of kerning pairs */ - } -kern_t; /* Kerning control block */ - -typedef struct specs_tag - { - buff_t STACKFAR *pfont; /* Pointer to font data */ - fix31 xxmult; /* Coeff of X orus to compute X pix */ - fix31 xymult; /* Coeff of Y orus to compute X pix */ - fix31 xoffset; /* Constant to compute X pix */ - fix31 yxmult; /* Coeff of X orus to compute Y pix */ - fix31 yymult; /* Coeff of Y orus to compute Y pix */ - fix31 yoffset; /* Constant to compute Y pix */ - ufix32 flags; /* Mode flags: */ - /* Bit 0 - 2: Output module selector: */ - /* Bit 3: Send curves to output module*/ - /* Bit 4: Use linear scaling if set */ - /* Bit 5: Inhibit constraint table */ - /* Bit 6: Import set width if set */ - /* Bit 7: not used */ - /* Bit 8: Squeeze left if set */ - /* Bit 9: Squeeze right if set */ - /* Bit 10: Squeeze top if set */ - /* Bit 11: Squeeze bottom if set */ - /* Bit 12: Clip left if set */ - /* Bit 13: Clip right if set */ - /* Bit 14: Clip top if set */ - /* Bit 15: Clip bottom if set */ - /* Bits 16-31 not used */ - void *out_info; /* information for output module */ - } -specs_t; /* Specs structure for fw_set_specs */ - -typedef struct tcb_tag - { - fix15 xxmult; /* Linear coeff of Xorus to compute Xpix */ - fix15 xymult; /* Linear coeff of Yorus to compute Xpix */ - fix31 xoffset; /* Linear constant to compute Xpix */ - fix15 yxmult; /* Linear coeff of Xorus to compute Ypix */ - fix15 yymult; /* Linear coeff of Yorus to compute Ypix */ - fix31 yoffset; /* Linear constant to compute Ypix */ - fix15 xppo; /* Pixels per oru in X dimension of char */ - fix15 yppo; /* Pixels per oru in Y dimension of char */ - fix15 xpos; /* Origin in X dimension of character */ - fix15 ypos; /* Origin in Y dimension of character */ - ufix16 xtype; /* Transformation type for X oru coords */ - ufix16 ytype; /* Transformation type for Y oru coords */ - ufix16 xmode; /* Transformation mode for X oru coords */ - ufix16 ymode; /* Transformation mode for Y oru coords */ - fix15 mirror; /* Transformation creates mirror image */ - } -tcb_t; /* Transformation control block */ - -typedef struct point_tag - { - fix15 x; /* X coord of point (shifted pixels) */ - fix15 y; /* Y coord of point (shifted pixels) */ - } -point_t; /* Point in device space */ - -typedef struct band_tag - { - fix15 band_max; - fix15 band_min; - fix15 band_array_offset; - fix15 band_floor; - fix15 band_ceiling; - } band_t; - -typedef struct bbox_tag - { - fix31 xmin; - fix31 xmax; - fix31 ymin; - fix31 ymax; - } bbox_t; - -#if SHORT_LISTS -#define MAX_INTERCEPTS 256 /* Max storage for intercepts */ -typedef ufix8 cdr_t; /* 8 bit links in intercept chains */ -#else -#define MAX_INTERCEPTS 1000 /* Max storage for intercepts */ -typedef ufix16 cdr_t; /* 16 bit links in intercept chains */ -#endif - -#if REENTRANT_ALLOC - -typedef struct intercepts_tag - { - fix15 car[MAX_INTERCEPTS]; - fix15 cdr[MAX_INTERCEPTS]; -#if INCL_SCREEN - ufix8 inttype[MAX_INTERCEPTS]; - ufix8 leftedge; - ufix16 fracpix; -#endif - } intercepts_t; - -typedef struct plaid_tag - { - fix15 orus[MAX_CTRL_ZONES]; /* Controlled coordinate table (orus) */ -#if INCL_RULES - fix15 pix[MAX_CTRL_ZONES]; /* Controlled coordinate table (sub-pixels) */ - fix15 mult[MAX_INT_ZONES]; /* Interpolation multiplier table */ - fix31 offset[MAX_INT_ZONES]; /* Interpolation offset table */ -#endif - } plaid_t; -#endif - -#if INCL_MULTIDEV -typedef struct bitmap_tag - { - void (*p_open_bitmap)(PROTO_DECL2 fix31 x_set_width, fix31 y_set_width, fix31 xorg, fix31 yorg, fix15 xsize,fix15 ysize); - void (*p_set_bits)(PROTO_DECL2 fix15 y, fix15 xbit1, fix15 xbit2); - void (*p_close_bitmap)(PROTO_DECL1); - } bitmap_t; - -typedef struct outline_tag - { - void (*p_open_outline)(PROTO_DECL2 fix31 x_set_width, fix31 y_set_width, fix31 xmin, fix31 xmax, fix31 ymin,fix31 ymax); - void (*p_start_char)(PROTO_DECL1); - void (*p_start_contour)(PROTO_DECL2 fix31 x,fix31 y,boolean outside); - void (*p_curve)(PROTO_DECL2 fix31 x1, fix31 y1, fix31 x2, fix31 y2, fix31 x3, fix31 y3); - void (*p_line)(PROTO_DECL2 fix31 x, fix31 y); - void (*p_close_contour)(PROTO_DECL1); - void (*p_close_outline)(PROTO_DECL1); - } outline_t; -#endif - -/* ---------------------------------------------------*/ -/**** MAIN GLOBAL DATA STRUCTURE, SPEEDO_GLOBALS *****/ - -typedef struct speedo_global_data - { -/* do_char.c data definitions */ -#if INCL_METRICS /* Metrics functions supported? */ - kern_t kern; /* Kerning control block */ -#endif /* endif incl_metrics */ - point_t Psw; /* End of escapement vector (1/65536 pixel units) */ - -#if INCL_LCD /* Dynamic load character data supported? */ - fix15 cb_offset; /* Offset to sub-char data in char buffer */ -#endif /* endif incl_lcd */ - -/* do_trns.c data definitions */ - point_t P0; /* Current point (sub-pixels) */ - fix15 x_orus; /* Current X argument (orus) */ - fix15 y_orus; /* Current Y argument (orus) */ - fix15 x_pix; /* Current X argument (sub-pixels) */ - fix15 y_pix; /* Current Y argument (sub-pixels) */ - ufix8 x_int; /* Current X interpolation zone */ - ufix8 y_int; /* Current Y interpolation zone */ - -#if INCL_MULTIDEV && INCL_OUTLINE - outline_t outline_device; - boolean outline_device_set; -#endif - -#if INCL_BLACK || INCL_SCREEN || INCL_2D -#if INCL_MULTIDEV - bitmap_t bitmap_device; - boolean bitmap_device_set; -#endif - band_t y_band; /* Y current band(whole pixels) */ - - struct set_width_tag - { - fix31 x; - fix31 y; - } set_width; /* Character escapement vector */ - - boolean first_pass; /* TRUE during first pass thru outline data */ - boolean extents_running; /* T if extent accumulation for each vector */ - fix15 x0_spxl; /* X coord of current point (sub pixels) */ - fix15 y0_spxl; /* Y coord of current point (sub pixels) */ - fix15 y_pxl; /* Y coord of current point (whole pixels) */ -#if REENTRANT_ALLOC - intercepts_t STACKFAR *intercepts; -#else /* else if not reentrant */ - fix15 car[MAX_INTERCEPTS]; /* Data field of intercept storage */ - cdr_t cdr[MAX_INTERCEPTS]; /* Link field of intercept storage */ -#if INCL_SCREEN - ufix8 inttype[MAX_INTERCEPTS]; - ufix8 leftedge; - ufix16 fracpix; -#endif /* endif incl_screen */ -#endif /* endif reentrant */ - fix15 bmap_xmin; /* Min X value (sub-pixel units) */ - fix15 bmap_xmax; /* Max X value (sub-pixel units) */ - fix15 bmap_ymin; /* Min Y value (sub-pixel units) */ - fix15 bmap_ymax; /* Max Y value (sub-pixel units) */ - fix15 no_y_lists; /* Number of active intercept lists */ - fix15 first_offset; /* Index of first active list cell */ - fix15 next_offset; /* Index of next free list cell */ - boolean intercept_oflo; /* TRUE if intercepts data lost */ -#endif /* endif incl_black, incl_screen, incl_2d */ - -/* bounding box now used by all output modules, including outline */ - fix15 xmin; /* Min X value in whole character */ - fix15 xmax; /* Max X value in whole character */ - fix15 ymin; /* Min Y value in whole character */ - fix15 ymax; /* Max Y value in whole character */ - -#if INCL_2D - fix15 no_x_lists; /* Number of active x intercept lists */ - band_t x_band; /* X current band(whole pixels) */ - boolean x_scan_active; /* X scan flag during scan conversion */ -#endif - -/* reset.c data definitions */ - ufix16 key32; /* Decryption keys 3,2 combined */ - ufix8 key4; /* Decryption key 4 */ - ufix8 key6; /* Decryption key 6 */ - ufix8 key7; /* Decryption key 7 */ - ufix8 key8; /* Decryption key 8 */ - -/* set_spcs.c data definitions */ - buff_t font; - buff_t GLOBALFAR *pfont; /* Pointer to font buffer structure */ - fix31 font_buff_size; /* Number of bytes loaded in font buffer */ - ufix8 FONTFAR *pchar_dir; /* Pointer to character directory */ - fix15 first_char_idx; /* Index to first character in font */ - fix15 no_chars_avail; /* Total characters in font layout */ - fix15 orus_per_em; /* Outline resolution */ - fix15 metric_resolution; /* metric resolution for setwidths, kerning pairs - (defaults to orus_per_em) */ - tcb_t tcb0; /* Top level transformation control block */ - - boolean specs_valid; /* TRUE if fw_set_specs() successful */ - - fix15 depth_adj; /* Curve splitting depth adjustment */ - boolean curves_out; /* Allow curves to output module */ - fix15 output_mode; /* Output module selector */ - fix15 thresh; /* Scan conversion threshold (sub-pixels) */ - boolean normal; /* TRUE if 0 obl and mult of 90 deg rot */ - - fix15 multshift; /* Fixed point shift for multipliers */ - fix15 pixshift; /* Fixed point shift for sub-pixels */ - fix15 poshift; /* Left shift from pixel to output format */ - fix15 mpshift; /* Fixed point shift for mult to sub-pixels */ - fix31 multrnd; /* 0.5 in multiplier units */ - fix15 pixrnd; /* 0.5 in sub-pixel units */ - fix31 mprnd; /* 0.5 sub-pixels in multiplier units */ - fix15 pixfix; /* Mask to remove fractional pixels */ - fix15 onepix; /* 1.0 pixels in sub-pixel units */ - - boolean (*init_out)(PROTO_DECL2 specs_t GLOBALFAR *specsarg); - boolean (*begin_char)(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax); - void (*begin_sub_char)(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax); - void (*begin_contour)(PROTO_DECL2 point_t P1,boolean outside); - void (*curve)(PROTO_DECL2 point_t P1, point_t P2, point_t P3, fix15 depth); - void (*line)(PROTO_DECL2 point_t P1); - void (*end_contour)(PROTO_DECL1); - void (*end_sub_char)(PROTO_DECL1); - boolean (*end_char)(PROTO_DECL1); - specs_t GLOBALFAR *pspecs; /* Pointer to specifications bundle */ - specs_t specs; /* copy specs onto stack */ - ufix8 FONTFAR *font_org; /* Pointer to start of font data */ - ufix8 FONTFAR *hdr2_org; /* Pointer to start of private header data */ - -/* set_trns.c data definitions */ - tcb_t tcb; /* Current transformation control block */ - ufix8 Y_edge_org; /* Index to first Y controlled coordinate */ - ufix8 Y_int_org; /* Index to first Y interpolation zone */ - fix31 rnd_xmin; /* rounded out value of xmin for int-char spac. fix */ - -#if REENTRANT_ALLOC - plaid_t STACKFAR *plaid; -#else /* if not reentrant */ - fix15 orus[MAX_CTRL_ZONES]; /* Controlled coordinate table (orus) */ -#if INCL_RULES - fix15 pix[MAX_CTRL_ZONES]; /* Controlled coordinate table (sub-pixels) */ - fix15 mult[MAX_INT_ZONES]; /* Interpolation multiplier table */ - fix31 offset[MAX_INT_ZONES]; /* Interpolation offset table */ -#endif /* endif incl_rules */ -#endif /* endif not reentrant */ - - fix15 no_X_orus; /* Number of X controlled coordinates */ - fix15 no_Y_orus; /* Number of Y controlled coordinates */ - ufix16 Y_constr_org; /* Origin of constraint table in font data */ - -#if INCL_RULES - constr_t constr; /* Constraint data state */ - boolean c_act[MAX_CONSTR]; /* TRUE if constraint currently active */ - fix15 c_pix[MAX_CONSTR]; /* Size of constrained zone if active */ -#endif -#if INCL_ISW - boolean import_setwidth_act; /* boolean to indicate imported setwidth */ - boolean isw_modified_constants; - ufix32 imported_width; /* value of imported setwidth */ - fix15 isw_xmax; /* maximum oru value for constants*/ -#endif -#if INCL_SQUEEZING || INCL_ISW - fix15 setwidth_orus; /* setwidth value in orus */ - /* bounding box in orus for squeezing */ - fix15 bbox_xmin_orus; /* X minimum in orus */ - fix15 bbox_xmax_orus; /* X maximum in orus */ - fix15 bbox_ymin_orus; /* Y minimum in orus */ - fix15 bbox_ymax_orus; /* Y maximum in orus */ -#endif -#ifdef INCL_SQUEEZING - boolean squeezing_compound; /* flag to indicate a compound character*/ -#endif -#ifdef INCL_CLIPPING - fix31 clip_xmax; - fix31 clip_ymax; - fix31 clip_xmin; - fix31 clip_ymin; -#endif - } SPEEDO_GLOBALS; - -/*********************************************************************************** - * - * Speedo global data structure allocation - * - ***********************************************************************************/ - -#ifdef SET_SPCS -#define EXTERN -#else -#define EXTERN extern -#endif -#if STATIC_ALLOC -EXTERN SPEEDO_GLOBALS GLOBALFAR sp_globals; -#define sp_intercepts sp_globals -#define sp_plaid sp_globals -#else -#if DYNAMIC_ALLOC -EXTERN SPEEDO_GLOBALS GLOBALFAR *sp_global_ptr; -#define sp_globals (*sp_global_ptr) -#define sp_intercepts (*sp_global_ptr) -#define sp_plaid (*sp_global_ptr) -#else -#if REENTRANT_ALLOC -#define sp_globals (*sp_global_ptr) -#define sp_intercepts (*(*sp_global_ptr).intercepts) -#define sp_plaid (*(*sp_global_ptr).plaid) -#endif -#endif -#endif -#ifdef EXTERN -#undef EXTERN -#endif - - -/***** PUBLIC FONT HEADER OFFSET CONSTANTS *****/ -#define FH_FMVER 0 /* U D4.0 CR LF NULL NULL 8 bytes */ -#define FH_FNTSZ 8 /* U Font size (bytes) 4 bytes */ -#define FH_FBFSZ 12 /* U Min font buffer size (bytes) 4 bytes */ -#define FH_CBFSZ 16 /* U Min char buffer size (bytes) 2 bytes */ -#define FH_HEDSZ 18 /* U Header size (bytes) 2 bytes */ -#define FH_FNTID 20 /* U Source Font ID 2 bytes */ -#define FH_SFVNR 22 /* U Source Font Version Number 2 bytes */ -#define FH_FNTNM 24 /* U Source Font Name 70 bytes */ -#define FH_MDATE 94 /* U Manufacturing Date 10 bytes */ -#define FH_LAYNM 104 /* U Layout Name 70 bytes */ -#define FH_CPYRT 174 /* U Copyright Notice 78 bytes */ -#define FH_NCHRL 252 /* U Number of Chars in Layout 2 bytes */ -#define FH_NCHRF 254 /* U Total Number of Chars in Font 2 bytes */ -#define FH_FCHRF 256 /* U Index of first char in Font 2 bytes */ -#define FH_NKTKS 258 /* U Number of kerning tracks in font 2 bytes */ -#define FH_NKPRS 260 /* U Number of kerning pairs in font 2 bytes */ -#define FH_FLAGS 262 /* U Font flags 1 byte: */ - /* Bit 0: Extended font */ - /* Bit 1: not used */ - /* Bit 2: not used */ - /* Bit 3: not used */ - /* Bit 4: not used */ - /* Bit 5: not used */ - /* Bit 6: not used */ - /* Bit 7: not used */ -#define FH_CLFGS 263 /* U Classification flags 1 byte: */ - /* Bit 0: Italic */ - /* Bit 1: Monospace */ - /* Bit 2: Serif */ - /* Bit 3: Display */ - /* Bit 4: not used */ - /* Bit 5: not used */ - /* Bit 6: not used */ - /* Bit 7: not used */ -#define FH_FAMCL 264 /* U Family Classification 1 byte: */ - /* 0: Don't care */ - /* 1: Serif */ - /* 2: Sans serif */ - /* 3: Monospace */ - /* 4: Script or calligraphic */ - /* 5: Decorative */ - /* 6-255: not used */ -#define FH_FRMCL 265 /* U Font form Classification 1 byte: */ - /* Bits 0-3 (width type): */ - /* 0-3: not used */ - /* 4: Condensed */ - /* 5: not used */ - /* 6: Semi-condensed */ - /* 7: not used */ - /* 8: Normal */ - /* 9: not used */ - /* 10: Semi-expanded */ - /* 11: not used */ - /* 12: Expanded */ - /* 13-15: not used */ - /* Bits 4-7 (Weight): */ - /* 0: not used */ - /* 1: Thin */ - /* 2: Ultralight */ - /* 3: Extralight */ - /* 4: Light */ - /* 5: Book */ - /* 6: Normal */ - /* 7: Medium */ - /* 8: Semibold */ - /* 9: Demibold */ - /* 10: Bold */ - /* 11: Extrabold */ - /* 12: Ultrabold */ - /* 13: Heavy */ - /* 14: Black */ - /* 15-16: not used */ -#define FH_SFNTN 266 /* U Short Font Name 32 bytes */ -#define FH_SFACN 298 /* U Short Face Name 16 bytes */ -#define FH_FNTFM 314 /* U Font form 14 bytes */ -#define FH_ITANG 328 /* U Italic angle 2 bytes (1/256th deg) */ -#define FH_ORUPM 330 /* U Number of ORUs per em 2 bytes */ -#define FH_WDWTH 332 /* U Width of Wordspace 2 bytes */ -#define FH_EMWTH 334 /* U Width of Emspace 2 bytes */ -#define FH_ENWTH 336 /* U Width of Enspace 2 bytes */ -#define FH_TNWTH 338 /* U Width of Thinspace 2 bytes */ -#define FH_FGWTH 340 /* U Width of Figspace 2 bytes */ -#define FH_FXMIN 342 /* U Font-wide min X value 2 bytes */ -#define FH_FYMIN 344 /* U Font-wide min Y value 2 bytes */ -#define FH_FXMAX 346 /* U Font-wide max X value 2 bytes */ -#define FH_FYMAX 348 /* U Font-wide max Y value 2 bytes */ -#define FH_ULPOS 350 /* U Underline position 2 bytes */ -#define FH_ULTHK 352 /* U Underline thickness 2 bytes */ -#define FH_SMCTR 354 /* U Small caps transformation 6 bytes */ -#define FH_DPSTR 360 /* U Display sups transformation 6 bytes */ -#define FH_FNSTR 366 /* U Footnote sups transformation 6 bytes */ -#define FH_ALSTR 372 /* U Alpha sups transformation 6 bytes */ -#define FH_CMITR 378 /* U Chemical infs transformation 6 bytes */ -#define FH_SNMTR 384 /* U Small nums transformation 6 bytes */ -#define FH_SDNTR 390 /* U Small denoms transformation 6 bytes */ -#define FH_MNMTR 396 /* U Medium nums transformation 6 bytes */ -#define FH_MDNTR 402 /* U Medium denoms transformation 6 bytes */ -#define FH_LNMTR 408 /* U Large nums transformation 6 bytes */ -#define FH_LDNTR 414 /* U Large denoms transformation 6 bytes */ - /* Transformation data format: */ - /* Y position 2 bytes */ - /* X scale 2 bytes (1/4096ths) */ - /* Y scale 2 bytes (1/4096ths) */ -#define SIZE_FW FH_LDNTR + 6 /* size of nominal font header */ -#define EXP_FH_METRES SIZE_FW /* offset to expansion field metric resolution (optional) */ - - - -/***** MODE FLAGS CONSTANTS *****/ -#define CURVES_OUT 0X0008 /* Output module accepts curves */ -#define BOGUS_MODE 0X0010 /* Linear scaling mode */ -#define CONSTR_OFF 0X0020 /* Inhibit constraint table */ -#define IMPORT_WIDTHS 0X0040 /* Imported width mode */ -#define SQUEEZE_LEFT 0X0100 /* Squeeze left mode */ -#define SQUEEZE_RIGHT 0X0200 /* Squeeze right mode */ -#define SQUEEZE_TOP 0X0400 /* Squeeze top mode */ -#define SQUEEZE_BOTTOM 0X0800 /* Squeeze bottom mode */ -#define CLIP_LEFT 0X1000 /* Clip left mode */ -#define CLIP_RIGHT 0X2000 /* Clip right mode */ -#define CLIP_TOP 0X4000 /* Clip top mode */ -#define CLIP_BOTTOM 0X8000 /* Clip bottom mode */ - -/*********************************************************************************** - * - * Speedo function declarations - use prototypes if available - * - ***********************************************************************************/ - -/* do_char.c functions */ -ufix16 sp_get_char_id(PROTO_DECL2 ufix16 char_index); -boolean sp_make_char(PROTO_DECL2 ufix16 char_index); -#if INCL_ISW -fix31 sp_compute_isw_scale(PROTO_DECL2); -static boolean sp_do_make_char(PROTO_DECL2 ufix16 char_index); -boolean sp_make_char_isw(PROTO_DECL2 ufix16 char_index, ufix32 imported_width); -static boolean sp_reset_xmax(PROTO_DECL2 fix31 xmax); -#endif -#if INCL_ISW || INCL_SQUEEZING -static void sp_preview_bounding_box(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8 format); -#endif - -#if INCL_METRICS /* Metrics functions supported? */ -fix31 sp_get_char_width(PROTO_DECL2 ufix16 char_index); -fix15 sp_get_track_kern(PROTO_DECL2 fix15 track,fix15 point_size); -fix31 sp_get_pair_kern(PROTO_DECL2 ufix16 char_index1,ufix16 char_index2); -boolean sp_get_char_bbox(PROTO_DECL2 ufix16 char_index, bbox_t *bbox); -#endif - -/* do_trns.c functions */ -ufix8 FONTFAR *sp_read_bbox(PROTO_DECL2 ufix8 FONTFAR *pointer,point_t STACKFAR *pPmin,point_t STACKFAR *pPmax,boolean set_flag); -void sp_proc_outl_data(PROTO_DECL2 ufix8 FONTFAR *pointer); - -/* out_blk.c functions */ -#if INCL_BLACK -boolean sp_init_black(PROTO_DECL2 specs_t GLOBALFAR *specsarg); -boolean sp_begin_char_black(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax); -void sp_begin_contour_black(PROTO_DECL2 point_t P1,boolean outside); -void sp_line_black(PROTO_DECL2 point_t P1); -boolean sp_end_char_black(PROTO_DECL1); -#endif - -/* out_scrn.c functions */ -#if INCL_SCREEN -boolean sp_init_screen(PROTO_DECL2 specs_t GLOBALFAR *specsarg); -boolean sp_begin_char_screen(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax); -void sp_begin_contour_screen(PROTO_DECL2 point_t P1,boolean outside); -void sp_curve_screen(PROTO_DECL2 point_t P1,point_t P2,point_t P3, fix15 depth); -void sp_scan_curve_screen(PROTO_DECL2 fix31 X0,fix31 Y0,fix31 X1,fix31 Y1,fix31 X2,fix31 Y2,fix31 X3,fix31 Y3); -void sp_vert_line_screen(PROTO_DECL2 fix31 x, fix15 y1, fix15 y2); -void sp_line_screen(PROTO_DECL2 point_t P1); -void sp_end_contour_screen(PROTO_DECL1); -boolean sp_end_char_screen(PROTO_DECL1); -#endif - -/* out_outl.c functions */ -#if INCL_OUTLINE -#if INCL_MULTIDEV -boolean sp_set_outline_device(PROTO_DECL2 outline_t *ofuncs, ufix16 size); -#endif - - -boolean sp_init_outline(PROTO_DECL2 specs_t GLOBALFAR *specsarg); -boolean sp_begin_char_outline(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax); -void sp_begin_sub_char_outline(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax); -void sp_begin_contour_outline(PROTO_DECL2 point_t P1,boolean outside); -void sp_curve_outline(PROTO_DECL2 point_t P1,point_t P2,point_t P3, fix15 depth); -void sp_line_outline(PROTO_DECL2 point_t P1); -void sp_end_contour_outline(PROTO_DECL1); -void sp_end_sub_char_outline(PROTO_DECL1); -boolean sp_end_char_outline(PROTO_DECL1); -#endif - -/* out_bl2d.c functions */ -#if INCL_2D -boolean sp_init_2d(PROTO_DECL2 specs_t GLOBALFAR *specsarg); -boolean sp_begin_char_2d(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax); -void sp_begin_contour_2d(PROTO_DECL2 point_t P1,boolean outside); -void sp_line_2d(PROTO_DECL2 point_t P1); -boolean sp_end_char_2d(PROTO_DECL1); -#endif - -/* out_util.c functions */ -#if INCL_BLACK || INCL_SCREEN || INCL_2D - -#if INCL_MULTIDEV -boolean sp_set_bitmap_device(PROTO_DECL2 bitmap_t *bfuncs, ufix16 size); -#endif - -void sp_init_char_out(PROTO_DECL2 point_t Psw, point_t Pmin, point_t Pmax); -void sp_begin_sub_char_out(PROTO_DECL2 point_t Psw, point_t Pmin, point_t Pmax); -void sp_curve_out(PROTO_DECL2 point_t P1, point_t P2, point_t P3, fix15 depth); -void sp_end_contour_out(PROTO_DECL1); -void sp_end_sub_char_out(PROTO_DECL1); -void sp_init_intercepts_out(PROTO_DECL1); -void sp_restart_intercepts_out(PROTO_DECL1); -void sp_set_first_band_out(PROTO_DECL2 point_t Pmin, point_t Pmax); -void sp_reduce_band_size_out(PROTO_DECL1); -boolean sp_next_band_out(PROTO_DECL1); -#endif - -#if INCL_USEROUT -boolean sp_init_userout(specs_t *specsarg); -#endif - - -/* reset.c functions */ -void sp_reset(PROTO_DECL1); -#if INCL_KEYS -void sp_set_key(PROTO_DECL2 ufix8 key[]); -#endif -ufix16 sp_get_cust_no(PROTO_DECL2 buff_t font_buff); - -/* set_spcs.c functions */ -boolean sp_set_specs(PROTO_DECL2 specs_t STACKFAR *specsarg); -void sp_type_tcb(PROTO_DECL2 tcb_t GLOBALFAR *ptcb); - -fix31 sp_read_long(PROTO_DECL2 ufix8 FONTFAR *pointer); -fix15 sp_read_word_u(PROTO_DECL2 ufix8 FONTFAR *pointer); - -/* set_trns.c functions */ -void sp_init_tcb(PROTO_DECL1); -void sp_scale_tcb(PROTO_DECL2 tcb_t GLOBALFAR *ptcb,fix15 x_pos,fix15 y_pos,fix15 x_scale,fix15 y_scale); -ufix8 FONTFAR *sp_plaid_tcb(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8 format); -ufix8 FONTFAR *sp_skip_interpolation_table(PROTO_DECL2 ufix8 FONTFAR *pointer, ufix8 format); -ufix8 FONTFAR *sp_skip_control_zone(PROTO_DECL2 ufix8 FONTFAR *pointer, ufix8 format); - -ufix8 FONTFAR *sp_read_oru_table(PROTO_DECL2 ufix8 FONTFAR *pointer); -#if INCL_SQUEEZING || INCL_ISW -static void sp_calculate_x_pix(PROTO_DECL2 ufix8 start_edge,ufix8 end_edge,ufix16 constr_nr,fix31 x_scale,fix31 x_offset,fix31 ppo,fix15 setwidth_pix); -#endif -#if INCL_SQUEEZING -static void sp_calculate_y_pix(PROTO_DECL2 ufix8 start_edge,ufix8 end_edge,ufix16 constr_nr,fix31 top_scale,fix31 bottom_scale,fix31 ppo,fix15 emtop_pix,fix15 embot_pix); -boolean sp_calculate_x_scale(PROTO_DECL2 fix31 *x_factor,fix31 *x_offset,fix15 no_x_ctrl_zones); -boolean sp_calculate_y_scale(PROTO_DECL2 fix31 *top_scale,fix31 *bottom_scale,fix15 first_y_zone, fix15 no_Y_ctrl_zones); -#endif - - -/* user defined functions */ - -void sp_report_error(PROTO_DECL2 fix15 n); - -#if INCL_BLACK || INCL_SCREEN || INCL_2D -void sp_open_bitmap(PROTO_DECL2 fix31 x_set_width, fix31 y_set_width, fix31 xorg, fix31 yorg, fix15 xsize,fix15 ysize); -void sp_set_bitmap_bits(PROTO_DECL2 fix15 y, fix15 xbit1, fix15 xbit2); -void sp_close_bitmap(PROTO_DECL1); -#endif - -#if INCL_OUTLINE -void sp_open_outline(PROTO_DECL2 fix31 x_set_width, fix31 y_set_width, fix31 xmin, fix31 xmax, fix31 ymin,fix31 ymax); -void sp_start_new_char(PROTO_DECL1); -void sp_start_contour(PROTO_DECL2 fix31 x,fix31 y,boolean outside); -void sp_curve_to(PROTO_DECL2 fix31 x1, fix31 y1, fix31 x2, fix31 y2, fix31 x3, fix31 y3); -void sp_line_to(PROTO_DECL2 fix31 x, fix31 y); -void sp_close_contour(PROTO_DECL1); -void sp_close_outline(PROTO_DECL1); -#endif - -#if INCL_LCD /* Dynamic load character data supported? */ -buff_t *sp_load_char_data(PROTO_DECL2 fix31 file_offset,fix15 no_bytes,fix15 cb_offset); /* Load character data from font file */ -#endif - -#if INCL_PLAID_OUT /* Plaid data monitoring included? */ -void sp_record_xint(PROTO_DECL2 fix15 int_num); /* Record xint data */ -void sp_record_yint(PROTO_DECL2 fix15 int_num); /* Record yint data */ -void sp_begin_plaid_data(PROTO_DECL1); /* Signal start of plaid data */ -void sp_begin_ctrl_zones(PROTO_DECL2 fix15, no_X_zones, fix15 no_Y_zones); /* Signal start of control zones */ -void sp_record_ctrl_zone(PROTO_DECL2 fix31 start, fix31 end, fix15 constr); /* Record control zone data */ -void sp_begin_int_zones(PROTO_DECL2 fix15 no_X_int_zones, fix15 no_Y_int_zones); /* Signal start of interpolation zones */ -void sp_record_int_zone(PROTO_DECL2 fix31 start, fix31 end); /* Record interpolation zone data */ -void sp_end_plaid_data(PROTO_DECL1); /* Signal end of plaid data */ -#endif - -#endif /* _SPEEDO_H_ */ diff --git a/nx-X11/lib/font/Speedo/spencode.c b/nx-X11/lib/font/Speedo/spencode.c deleted file mode 100644 index 96a13504a..000000000 --- a/nx-X11/lib/font/Speedo/spencode.c +++ /dev/null @@ -1,67 +0,0 @@ -/* $Xorg: spencode.c,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/Speedo/spencode.c,v 1.6 2001/01/17 19:43:18 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spint.h" - -/* No longer needed with new encoding code */ -/* #include "bics-iso.h" - -int sp_bics_map_size = (sizeof(sp_bics_map) / (sizeof(int) * 2));*/ - -#ifdef EXTRAFONTS -#include "adobe-iso.h" - -int adobe_map_size = (sizeof(adobe_map) / (sizeof(int) * 2)); - -#endif /* EXTRAFONTS */ diff --git a/nx-X11/lib/font/Speedo/sperr.c b/nx-X11/lib/font/Speedo/sperr.c deleted file mode 100644 index 36ce51125..000000000 --- a/nx-X11/lib/font/Speedo/sperr.c +++ /dev/null @@ -1,127 +0,0 @@ -/* $Xorg: sperr.c,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of M.I.T., Network Computing Devices, - * or Digital not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. M.I.T. Network Computing Devices, or Digital - * make no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * NETWORK COMPUTING DEVICES, DIGITAL AND MIT DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, DIGITAL OR MIT BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/Speedo/sperr.c,v 1.6 2001/12/14 19:56:41 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "spint.h" - -#ifndef FONTMODULE -#include -#endif - -extern void ErrorF(const char* f, ...); - -void -SpeedoErr(char *str, ...) -{ - va_list v; - int a1; - - va_start(v, str); - ErrorF("Speedo: "); - a1 = va_arg(v, int); - ErrorF(str, a1); - va_end(v); -} - -/* - * Called by Speedo character generator to report an error. - * - * Since character data not available is one of those errors - * that happens many times, don't report it to user - */ -void -sp_report_error(fix15 n) -{ - switch (n) { - case 1: - SpeedoErr("Insufficient font data loaded\n"); - break; - case 3: - SpeedoErr("Transformation matrix out of range\n"); - break; - case 4: - SpeedoErr("Font format error\n"); - break; - case 5: - SpeedoErr("Requested specs not compatible with output module\n"); - break; - case 7: - SpeedoErr("Intelligent transformation requested but not supported\n"); - break; - case 8: - SpeedoErr("Unsupported output mode requested\n"); - break; - case 9: - SpeedoErr("Extended font loaded but only compact fonts supported\n"); - break; - case 10: - SpeedoErr("Font specs not set prior to use of font\n"); - break; - case 12: - break; - case 13: - SpeedoErr("Track kerning data not available()\n"); - break; - case 14: - SpeedoErr("Pair kerning data not available()\n"); - break; - default: - SpeedoErr("report_error(%d)\n", n); - break; - } -} diff --git a/nx-X11/lib/font/Speedo/spfile.c b/nx-X11/lib/font/Speedo/spfile.c deleted file mode 100644 index c58c0e471..000000000 --- a/nx-X11/lib/font/Speedo/spfile.c +++ /dev/null @@ -1,460 +0,0 @@ -/* $Xorg: spfile.c,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices Inc - */ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/Speedo/spfile.c,v 1.13 2001/08/13 21:46:47 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#ifndef FONTMODULE -#include -#else -#include "xf86_ansic.h" -#endif - -#include "spint.h" -#include "bics-unicode.h" - -SpeedoFontPtr sp_fp_cur = (SpeedoFontPtr) 0; - -#ifdef EXTRAFONTS -#include "ncdkeys.h" -#endif - -#include "keys.h" - -#ifdef EXTRAFONTS -static ufix8 skey[] = -{ - SKEY0, - SKEY1, - SKEY2, - SKEY3, - SKEY4, - SKEY5, - SKEY6, - SKEY7, - SKEY8 -}; /* Sample Font decryption key */ - -static ufix8 rkey[] = -{ - RKEY0, - RKEY1, - RKEY2, - RKEY3, - RKEY4, - RKEY5, - RKEY6, - RKEY7, - RKEY8 -}; /* Retail Font decryption key */ - -#endif /* EXTRAFONTS */ - -#ifdef XSAMPLEFONTS -static ufix8 xkey[] = -{ - XKEY0, - XKEY1, - XKEY2, - XKEY3, - XKEY4, - XKEY5, - XKEY6, - XKEY7, - XKEY8 -}; /* Sample Font decryption key */ -#endif - -static ufix8 mkey[] = -{ - KEY0, - KEY1, - KEY2, - KEY3, - KEY4, - KEY5, - KEY6, - KEY7, - KEY8 -}; /* Font decryption key */ - - -static fix15 -read_2b(ufix8 *ptr) -{ - fix15 tmp; - - tmp = *ptr++; - tmp = (tmp << 8) + *ptr; - return tmp; -} - -static fix31 -read_4b(ufix8 *ptr) -{ - fix31 tmp; - - tmp = *ptr++; - tmp = (tmp << 8) + *ptr++; - tmp = (tmp << 8) + *ptr++; - tmp = (tmp << 8) + *ptr; - return tmp; -} - -/* - * loads the specified char's data - */ -buff_t * -sp_load_char_data(fix31 file_offset, fix15 num, fix15 cb_offset) -{ - SpeedoMasterFontPtr master = sp_fp_cur->master; - - if (fseek(master->fp, (long) file_offset, (int) 0)) { - SpeedoErr("can't seek to char\n"); - } - if ((num + cb_offset) > master->mincharsize) { - SpeedoErr("char buf overflow\n"); - } - if (fread((master->c_buffer + cb_offset), sizeof(ufix8), num, - master->fp) != num) { - SpeedoErr("can't get char data\n"); - } - master->char_data.org = (ufix8 *) master->c_buffer + cb_offset; - master->char_data.no_bytes = num; - - return &master->char_data; -} - -struct speedo_encoding { - char *name; - int *enc; - int enc_size; -}; - -/* Takes care of caching encodings already referenced */ -static int -find_encoding(const char *fontname, const char *filename, - int **enc, int *enc_size) -{ - static struct speedo_encoding *known_encodings=0; - static int number_known_encodings=0; - static int known_encodings_size=0; - - char *encoding_name; - int iso8859_1; - FontMapPtr mapping; - int i, j, k, size; - struct speedo_encoding *temp; - int *new_enc; - char *new_name; - - iso8859_1 = 0; - - encoding_name = FontEncFromXLFD(fontname, strlen(fontname)); - if(!encoding_name) { - encoding_name="iso8859-1"; - iso8859_1=1; - } - /* We don't go through the font library if asked for Latin-1 */ - iso8859_1 = iso8859_1 || !strcmp(encoding_name, "iso8859-1"); - - for(i=0; i= known_encodings_size) { - if((temp= - (struct speedo_encoding*)xrealloc(known_encodings, - 2*sizeof(struct speedo_encoding)* - known_encodings_size))==0) - return AllocError; - known_encodings=temp; - known_encodings_size*=2; - } - - mapping=0; - if(!iso8859_1) { - mapping = FontEncMapFind(encoding_name, - FONT_ENCODING_UNICODE, -1, -1, - filename); - } -#define SPEEDO_RECODE(c) \ - (mapping? \ - unicode_to_bics(FontEncRecode(c, mapping)): \ - unicode_to_bics(c)) - - if((new_name = (char*)xalloc(strlen(encoding_name)))==0) - return AllocError; - strcpy(new_name, encoding_name); - - /* For now, we limit ourselves to 256 glyphs */ - size=0; - for(i=0; i < (mapping?mapping->encoding->size:256) && i < 256; i++) - if(SPEEDO_RECODE(i)>=0) - size++; - new_enc = (int*)xalloc(2*size*sizeof(int)); - if(!new_enc) { - xfree(new_name); - return AllocError; - } - for(i=j=0; i < (mapping?mapping->encoding->size:256) && i < 256; i++) - if((k = SPEEDO_RECODE(i))>=0) { - new_enc[2*j] = i; - new_enc[2*j+1] = k; - j++; - } - known_encodings[number_known_encodings].name = new_name; - known_encodings[number_known_encodings].enc = new_enc; - known_encodings[number_known_encodings].enc_size = size; - number_known_encodings++; - - *enc = new_enc; - *enc_size = size; - return Successful; -#undef SPEEDO_RECODE -} - -int -sp_open_master(const char *fontname, const char *filename, - SpeedoMasterFontPtr *master) -{ - SpeedoMasterFontPtr spmf; - ufix8 tmp[16]; - ufix16 cust_no; - FILE *fp; - ufix32 minbufsize; - ufix16 mincharsize; - ufix8 *f_buffer; - ufix8 *c_buffer; - int ret; - ufix8 *key; - - spmf = (SpeedoMasterFontPtr) xalloc(sizeof(SpeedoMasterFontRec)); - if (!spmf) - return AllocError; - bzero(spmf, sizeof(SpeedoMasterFontRec)); - spmf->entry = NULL; - spmf->f_buffer = NULL; - spmf->c_buffer = NULL; - - /* open font */ - spmf->fname = (char *) xalloc(strlen(filename) + 1); - if (!spmf->fname) - return AllocError; - fp = fopen(filename, "r"); - if (!fp) { - ret = BadFontName; - goto cleanup; - } - strcpy(spmf->fname, filename); - spmf->fp = fp; - spmf->state |= MasterFileOpen; - - if (fread(tmp, sizeof(ufix8), 16, fp) != 16) { - ret = BadFontName; - goto cleanup; - } - minbufsize = (ufix32) read_4b(tmp + FH_FBFSZ); - f_buffer = (ufix8 *) xalloc(minbufsize); - if (!f_buffer) { - ret = AllocError; - goto cleanup; - } - spmf->f_buffer = f_buffer; - - fseek(fp, (ufix32) 0, 0); - - /* read in the font */ - if (fread(f_buffer, sizeof(ufix8), (ufix16) minbufsize, fp) != minbufsize) { - ret = BadFontName; - goto cleanup; - } - spmf->copyright = (char *) (f_buffer + FH_CPYRT); - spmf->mincharsize = mincharsize = read_2b(f_buffer + FH_CBFSZ); - - c_buffer = (ufix8 *) xalloc(mincharsize); - if (!c_buffer) { - ret = AllocError; - goto cleanup; - } - spmf->c_buffer = c_buffer; - - spmf->font.org = spmf->f_buffer; - spmf->font.no_bytes = minbufsize; - - cust_no = sp_get_cust_no(spmf->font); - - /* XXX add custom encryption stuff here */ - -#ifdef EXTRAFONTS - if (cust_no == SCUS0) { - key = skey; - } else if (cust_no == RCUS0) { - key = rkey; - } else -#endif - -#ifdef XSAMPLEFONTS - if (cust_no == XCUS0) { - key = xkey; - } else -#endif - - if (cust_no == CUS0) { - key = mkey; - } else { - SpeedoErr("Non - standard encryption for \"%s\"\n", filename); - ret = BadFontName; - goto cleanup; - } - spmf->key = key; - sp_set_key(key); - - spmf->first_char_id = read_2b(f_buffer + FH_FCHRF); - spmf->num_chars = read_2b(f_buffer + FH_NCHRL); - - - spmf->enc = 0; - spmf->enc_size = 0; - -#ifdef EXTRAFONTS - { /* choose the proper encoding */ - char *f; - - f = strrchr(filename, '/'); - if (f) { - f++; - if (strncmp(f, "bx113", 5) == 0) { - spmf->enc = adobe_map; - spmf->enc_size = adobe_map_size; - } - } - } -#endif - - if(!spmf->enc) - if((ret=find_encoding(fontname, filename, &spmf->enc, &spmf->enc_size)) - !=Successful) - goto cleanup; - - spmf->first_char_id = spmf->enc[0]; - /* size of extents array */ - spmf->max_id = spmf->enc[(spmf->enc_size - 1) * 2]; - spmf->num_chars = spmf->enc_size; - - *master = spmf; - - return Successful; - -cleanup: - *master = (SpeedoMasterFontPtr) 0; - sp_close_master_font(spmf); - return ret; -} - -void -sp_close_master_font(SpeedoMasterFontPtr spmf) -{ - if (!spmf) - return; - if (spmf->state & MasterFileOpen) - fclose(spmf->fp); - if (spmf->entry) - spmf->entry->u.scalable.extra->private = NULL; - xfree(spmf->fname); - xfree(spmf->f_buffer); - xfree(spmf->c_buffer); - xfree(spmf); -} - -void -sp_close_master_file(SpeedoMasterFontPtr spmf) -{ - (void) fclose(spmf->fp); - spmf->state &= ~MasterFileOpen; -} - - -/* - * reset the encryption key, and make sure the file is opened - */ -void -sp_reset_master(SpeedoMasterFontPtr spmf) -{ - sp_set_key(spmf->key); - if (!(spmf->state & MasterFileOpen)) { - spmf->fp = fopen(spmf->fname, "r"); - /* XXX -- what to do if we can't open the file? */ - spmf->state |= MasterFileOpen; - } - fseek(spmf->fp, 0, 0); -} diff --git a/nx-X11/lib/font/Speedo/spfont.c b/nx-X11/lib/font/Speedo/spfont.c deleted file mode 100644 index c209d5a51..000000000 --- a/nx-X11/lib/font/Speedo/spfont.c +++ /dev/null @@ -1,453 +0,0 @@ -/* $Xorg: spfont.c,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices Inc - */ -/* $XFree86: xc/lib/font/Speedo/spfont.c,v 3.12tsi Exp $ */ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/* - * Speedo font loading - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include "spint.h" -#include -#ifndef FONTMODULE -#ifdef _XOPEN_SOURCE -#include -#else -#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */ -#include -#undef _XOPEN_SOURCE -#endif -#else -#include "servermd.h" -#include "xf86_ansic.h" -#endif - -#ifndef M_PI -#define M_PI 3.14159 -#endif /* M_PI */ -#ifndef DEFAULT_BIT_ORDER - -#ifdef BITMAP_BIT_ORDER -#define DEFAULT_BIT_ORDER BITMAP_BIT_ORDER -#else -#define DEFAULT_BIT_ORDER UNKNOWN_BIT_ORDER -#endif - -#endif - -static void SpeedoCloseFont(FontPtr pfont); - -static int -sp_get_glyphs( - FontPtr pFont, - unsigned long count, - register unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - CharInfoPtr *glyphs) /* RETURN */ -{ - SpeedoFontPtr spf; - unsigned int firstCol; - register unsigned int numCols; - unsigned int firstRow; - unsigned int numRows; - CharInfoPtr *glyphsBase; - register unsigned int c; - register CharInfoPtr pci; - unsigned int r; - CharInfoPtr encoding; - CharInfoPtr pDefault; -#ifdef notyet - int itemSize; -#endif - int err = Successful; - - spf = (SpeedoFontPtr) pFont->fontPrivate; - encoding = spf->encoding; - pDefault = spf->pDefault; - firstCol = pFont->info.firstCol; - numCols = pFont->info.lastCol - firstCol + 1; - glyphsBase = glyphs; - - - /* XXX - this should be much smarter */ - /* make sure the glyphs are there */ -#ifdef notyet - if (charEncoding == Linear8Bit || charEncoding == TwoD8Bit) - itemSize = 1; - else - itemSize = 2; - - if (!fsd->complete) - err = fs_load_glyphs(NULL, pFont, count, itemSize, chars); -#endif - - if (err != Successful) - return err; - - switch (charEncoding) { - - case Linear8Bit: - case TwoD8Bit: - if (pFont->info.firstRow > 0) - break; - if (pFont->info.allExist && pDefault) { - while (count--) { - c = (*chars++) - firstCol; - if (c < numCols) - *glyphs++ = &encoding[c]; - else - *glyphs++ = pDefault; - } - } else { - while (count--) { - c = (*chars++) - firstCol; - if (c < numCols && (pci = &encoding[c])->bits) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - } - break; - case Linear16Bit: - if (pFont->info.allExist && pDefault) { - while (count--) { - c = *chars++ << 8; - c = (c | *chars++) - firstCol; - if (c < numCols) - *glyphs++ = &encoding[c]; - else - *glyphs++ = pDefault; - } - } else { - while (count--) { - c = *chars++ << 8; - c = (c | *chars++) - firstCol; - if (c < numCols && (pci = &encoding[c])->bits) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - } - break; - - case TwoD16Bit: - firstRow = pFont->info.firstRow; - numRows = pFont->info.lastRow - firstRow + 1; - while (count--) { - r = (*chars++) - firstRow; - c = (*chars++) - firstCol; - if (r < numRows && c < numCols && - (pci = &encoding[r * numCols + c])->bits) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - break; - } - *glyphCount = glyphs - glyphsBase; - return Successful; -} - -static CharInfoRec nonExistantChar; - -static int -sp_get_metrics( - FontPtr pFont, - unsigned long count, - register unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - xCharInfo **glyphs) /* RETURN */ -{ - int ret; - SpeedoFontPtr spf; - CharInfoPtr oldDefault; - - spf = (SpeedoFontPtr) pFont->fontPrivate; - oldDefault = spf->pDefault; - spf->pDefault = &nonExistantChar; - ret = sp_get_glyphs(pFont, count, chars, charEncoding, - glyphCount, (CharInfoPtr *) glyphs); - - spf->pDefault = oldDefault; - return ret; -} - -int -sp_open_font( - char *fontname, - char *filename, - FontEntryPtr entry, - FontScalablePtr vals, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - Mask flags, - SpeedoFontPtr *spfont) -{ - SpeedoFontPtr spf; - SpeedoMasterFontPtr spmf; - int ret; - specs_t specs; - int xx8, xy8, yx8, yy8; - - /* find a master (create it if necessary) */ - spmf = (SpeedoMasterFontPtr) entry->u.scalable.extra->private; - if (!spmf) - { - ret = sp_open_master(fontname, filename, &spmf); - if (ret != Successful) - return ret; - entry->u.scalable.extra->private = (pointer) spmf; - spmf->entry = entry; - } - - spf = (SpeedoFontPtr) xalloc(sizeof(SpeedoFontRec)); - if (!spf) - return AllocError; - bzero((char *) spf, sizeof(SpeedoFontRec)); - - *spfont = spf; - - /* clobber everything -- this may be leaking, but other wise evil - * stuff is left behind -- succesive transformed fonts get mangled */ - bzero((char *)&sp_globals, sizeof(sp_globals)); - - spf->master = spmf; - spf->entry = entry; - spmf->refcount++; - sp_reset_master(spmf); - /* now we've done enough that if we bail out we must call sp_close_font */ - - spf->vals = *vals; - - /* set up specs */ - - specs.pfont = &spmf->font; - - specs.xxmult = (int)(vals->pixel_matrix[0] * (double)(1L << 16)); - specs.xymult = (int)(vals->pixel_matrix[2] * (double)(1L << 16)); - specs.yxmult = (int)(vals->pixel_matrix[1] * (double)(1L << 16)); - specs.yymult = (int)(vals->pixel_matrix[3] * (double)(1L << 16)); - - specs.xoffset = 0L << 16; /* XXX tweak? */ - specs.yoffset = 0L << 16; /* XXX tweak? */ - - specs.flags = MODE_SCREEN; - specs.out_info = NULL; - - /* When Speedo tries to generate a very small font bitmap, it - often crashes or goes into an infinite loop. - Don't know why this is so, but until we can fix it properly, - return BadFontName for anything smaller than 4 pixels. - */ -#define TINY_FACTOR (16 << 16) - xx8 = specs.xxmult >> 8; - xy8 = specs.xymult >> 8; - yx8 = specs.yxmult >> 8; - yy8 = specs.yymult >> 8; - if (xx8 * xx8 + xy8 * xy8 < TINY_FACTOR || - yx8 * yx8 + yy8 * yy8 < TINY_FACTOR) - { - sp_close_font(spf); - return BadFontName; - } - - /* clobber global state to avoid wrecking future transformed fonts */ - bzero ((char *) &sp_globals, sizeof(sp_globals)); - - if (!sp_set_specs(&specs)) - { - sp_close_font(spf); - return BadFontName; - } - - spf->specs = specs; - spf->master = spmf; - - *spfont = spf; - return Successful; -} - -static int -sp_load_font( - char *fontname, - char *filename, - FontEntryPtr entry, - FontScalablePtr vals, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - FontPtr pfont, - Mask flags) -{ - SpeedoFontPtr spf; - SpeedoMasterFontPtr spmf; - int esize; - int ret; - long sWidth; - - ret = sp_open_font(fontname, filename, entry, vals, format, fmask, - flags, &spf); - - if (ret != Successful) - return ret; - - spmf = spf->master; - sp_reset_master(spmf); - esize = sizeof(CharInfoRec) * (spmf->max_id - spmf->first_char_id + 1); - - spf->encoding = (CharInfoPtr) xalloc(esize); - if (!spf->encoding) { - sp_close_font(spf); - return AllocError; - } - bzero((char *) spf->encoding, esize); - - sp_fp_cur = spf; - - sp_make_header(spf, &pfont->info); - - sp_compute_bounds(spf, &pfont->info, SaveMetrics, &sWidth); - - sp_compute_props(spf, fontname, &pfont->info, sWidth); - - pfont->fontPrivate = (pointer) spf; - -/* XXX */ - flags |= FontLoadBitmaps; - - if (flags & FontLoadBitmaps) { - sp_fp_cur = spf; - ret = sp_build_all_bitmaps(pfont, format, fmask); - } - if (ret != Successful) - return ret; - - /* compute remaining accelerators */ - FontComputeInfoAccelerators(&pfont->info); - - pfont->format = format; - - pfont->get_metrics = sp_get_metrics; - pfont->get_glyphs = sp_get_glyphs; - pfont->unload_font = SpeedoCloseFont; - pfont->unload_glyphs = NULL; - pfont->refcnt = 0; - - /* have to hold on to master for min/max id */ - sp_close_master_file(spmf); - - return ret; -} - -int -SpeedoFontLoad( - FontPtr *ppfont, - char *fontname, - char *filename, - FontEntryPtr entry, - FontScalablePtr vals, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - Mask flags) -{ - FontPtr pfont; - int ret; - - /* Reject ridiculously small sizes that will blow up the math */ - if (hypot(vals->pixel_matrix[0], vals->pixel_matrix[1]) < 1.0 || - hypot(vals->pixel_matrix[2], vals->pixel_matrix[3]) < 1.0) - return BadFontName; - - if (!(pfont = CreateFontRec())) - return AllocError; - - ret = sp_load_font(fontname, filename, entry, vals, format, fmask, - pfont, flags); - - if (ret == Successful) - *ppfont = pfont; - else - DestroyFontRec (pfont); - - return ret; -} - -void -sp_close_font(SpeedoFontPtr spf) -{ - SpeedoMasterFontPtr spmf; - - spmf = spf->master; - --spmf->refcount; - if (spmf->refcount == 0) - sp_close_master_font (spmf); - xfree(spf->encoding); - xfree(spf->bitmaps); - xfree(spf); -} - -static void -SpeedoCloseFont(FontPtr pfont) -{ - SpeedoFontPtr spf; - - spf = (SpeedoFontPtr) pfont->fontPrivate; - sp_close_font(spf); - xfree(pfont->info.isStringProp); - xfree(pfont->info.props); - DestroyFontRec(pfont); - -} diff --git a/nx-X11/lib/font/Speedo/spfuncs.c b/nx-X11/lib/font/Speedo/spfuncs.c deleted file mode 100644 index da4d5c55e..000000000 --- a/nx-X11/lib/font/Speedo/spfuncs.c +++ /dev/null @@ -1,167 +0,0 @@ -/* $Xorg: spfuncs.c,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - */ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/Speedo/spfuncs.c,v 1.7 2001/08/27 19:49:51 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifndef FONTMODULE -#include -#endif -#include -#include -#include "spint.h" - -/* ARGSUSED */ -static int -SpeedoOpenScalable ( - FontPathElementPtr fpe, - FontPtr *pFont, - int flags, - FontEntryPtr entry, - char *fileName, - FontScalablePtr vals, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - FontPtr non_cachable_font) /* We don't do licensing */ -{ - char fullName[MAXFONTNAMELEN]; - - strcpy (fullName, entry->name.name); - return SpeedoFontLoad (pFont, fullName, fileName, entry, vals, - format, fmask, flags); -} - -/* - * XXX - * - * this does a lot more then i'd like, but it has to get the bitmaps - * in order to get accurate metrics (which it *must* have). - * - * a possible optimization is to avoid allocating the glyph memory - * and to simply save the values without doing the work. - */ -static int -get_font_info( - FontInfoPtr pinfo, - char *fontname, - char *filename, - FontEntryPtr entry, - FontScalablePtr vals, - SpeedoFontPtr *spfont) -{ - SpeedoFontPtr spf; - int err; - long sWidth; - - err = sp_open_font(fontname, filename, entry, vals, - (fsBitmapFormat) 0, (fsBitmapFormatMask) 0, (unsigned long) 0, - &spf); - - if (err != Successful) - return err; - - sp_fp_cur = spf; - sp_reset_master(spf->master); - - sp_make_header(spf, pinfo); - - sp_compute_bounds(spf, pinfo, (unsigned long) 0, &sWidth); - - sp_compute_props(spf, fontname, pinfo, sWidth); - - /* compute remaining accelerators */ - FontComputeInfoAccelerators (pinfo); - - *spfont = spf; - - return Successful; -} - -/* ARGSUSED */ -static int -SpeedoGetInfoScaleable( - FontPathElementPtr fpe, - FontInfoPtr pFontInfo, - FontEntryPtr entry, - FontNamePtr fontName, - char *fileName, - FontScalablePtr vals) -{ - SpeedoFontPtr spf = NULL; - char fullName[MAXFONTNAMELEN]; - int err; - - strcpy(fullName, entry->name.name); - FontParseXLFDName(fullName, vals, FONT_XLFD_REPLACE_VALUE); - - err = get_font_info(pFontInfo, fullName, fileName, entry, vals, &spf); - - if (spf) - sp_close_font(spf); - - return err; -} - -static FontRendererRec renderer = { - ".spd", 4, NULL, SpeedoOpenScalable, - NULL, SpeedoGetInfoScaleable, 0 - , CAP_MATRIX | CAP_CHARSUBSETTING -}; - -void -SpeedoRegisterFontFileFunctions() -{ - sp_make_standard_props(); - sp_reset(); - FontFileRegisterRenderer(&renderer); -} diff --git a/nx-X11/lib/font/Speedo/spglyph.c b/nx-X11/lib/font/Speedo/spglyph.c deleted file mode 100644 index 3577f5567..000000000 --- a/nx-X11/lib/font/Speedo/spglyph.c +++ /dev/null @@ -1,399 +0,0 @@ -/* $Xorg: spglyph.c,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices Inc - */ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/Speedo/spglyph.c,v 1.6 2001/01/17 19:43:20 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include /* for bit order #defines */ -#include "spint.h" -#include - -#undef CLIP_BBOX_NOISE - -static CurrentFontValuesRec current_font_values; -static CurrentFontValuesPtr cfv = ¤t_font_values; -static int bit_order, - byte_order, - scan; - -unsigned long -sp_compute_data_size( - FontPtr pfont, - int mappad, - int scanlinepad, - unsigned long start, - unsigned long end) -{ - unsigned long ch; - unsigned long size = 0; - int bpr; - SpeedoFontPtr spf = (SpeedoFontPtr) pfont->fontPrivate; - FontInfoPtr pinfo = &pfont->info; - int firstChar; - - firstChar = spf->master->first_char_id; - - /* allocate the space */ - switch (mappad) { - int charsize; - CharInfoPtr ci; - xCharInfo *cim; - - case BitmapFormatImageRectMin: - cfv->bpr = 0; - for (ch = start; ch <= end; ch++) { - ci = &spf->encoding[ch - firstChar]; - if (!ci) - ci = spf->pDefault; - cim = &ci->metrics; - charsize = GLYPH_SIZE(ci, scanlinepad); - charsize *= cim->ascent + cim->descent; - size += charsize; - } - break; - case BitmapFormatImageRectMaxWidth: - bpr = GLWIDTHBYTESPADDED(FONT_MAX_WIDTH(pinfo), scanlinepad); - cfv->bpr = bpr; - for (ch = start; ch <= end; ch++) { - ci = &spf->encoding[ch - firstChar]; - if (!ci) - ci = spf->pDefault; - cim = &ci->metrics; - charsize = bpr * (cim->ascent + cim->descent); - size += charsize; - } - break; - case BitmapFormatImageRectMax: - bpr = GLWIDTHBYTESPADDED(FONT_MAX_WIDTH(pinfo), scanlinepad); - cfv->bpr = bpr; - size = (end - start + 1) * bpr * FONT_MAX_HEIGHT(pinfo); - break; - default: - assert(0); - } - - return size; -} - -static void -finish_line(SpeedoFontPtr spf) -{ - int bpr = cfv->bpr; - CharInfoPtr ci = &spf->encoding[cfv->char_id - spf->master->first_char_id]; - - if (bpr == 0) { - bpr = GLYPH_SIZE(ci, cfv->scanpad); - } - if (bpr) { /* char may not have any metrics... */ - cfv->bp = (char *)cfv->bp + bpr; - } - assert(cfv->bp - sp_fp_cur->bitmaps <= sp_fp_cur->bitmap_size); -} - - -void -sp_set_bitmap_bits(fix15 y, fix15 xbit1, fix15 xbit2) -{ - int nmiddle; - CARD8 startmask, - endmask; - CARD8 *dst; - - if (xbit1 > cfv->bit_width) { - -#ifdef CLIP_BBOX_NOISE - SpeedoErr("Run wider than bitmap width -- truncated\n"); -#endif - - xbit1 = cfv->bit_width; - } - if (xbit2 > cfv->bit_width) { - -#ifdef CLIP_BBOX_NOISE - SpeedoErr("Run wider than bitmap width -- truncated\n"); -#endif - - xbit2 = cfv->bit_width; - } - - if (xbit2 < xbit1) { - xbit2 = xbit1; - } - - while (cfv->cur_y != y) { - finish_line(sp_fp_cur); - cfv->cur_y++; - } - - cfv->last_y = y; - if (y >= cfv->bit_height) { - -#ifdef CLIP_BBOX_NOISE - SpeedoErr("Y larger than bitmap height -- truncated\n"); -#endif - - cfv->trunc = 1; - return; - } - if (xbit1 < 0) /* XXX this is more than a little bit rude... */ - xbit1 = 0; - - nmiddle = (xbit1 >> 3); - dst = (CARD8 *)cfv->bp + nmiddle; - xbit2 -= (xbit1 & ~7); - nmiddle = (xbit2 >> 3); - xbit1 &= 7; - xbit2 &= 7; - if (bit_order == MSBFirst) { - startmask = ((CARD8) ~0) >> xbit1; - endmask = ~(((CARD8) ~0) >> xbit2); - } else { - startmask = ((CARD8) ~0) << xbit1; - endmask = ~(((CARD8) ~0) << xbit2); - } - if (nmiddle == 0) - *dst |= endmask & startmask; - else { - *dst++ |= startmask; - while (--nmiddle) - *dst++ = (CARD8)~0; - *dst |= endmask; - } -} - -/* ARGSUSED */ -void -sp_open_bitmap(fix31 x_set_width, fix31 y_set_width, fix31 xorg, fix31 yorg, - fix15 xsize, fix15 ysize) -{ - CharInfoPtr ci = &sp_fp_cur->encoding[cfv->char_id - sp_fp_cur->master->first_char_id]; - -/*- - * this is set to provide better quality bitmaps. since the Speedo - * sp_get_bbox() function returns an approximate (but guarenteed to contain) - * set of metrics, some of the bitmaps can be place poorly inside and - * look bad. - * - * with this set, the actual bitmap values are used instead of the bboxes. - * it makes things look better, but causes two possible problems: - * - * 1 - the reported min & max bounds may not correspond to the extents - * reported - * 2 - if the extents are reported before the character is generated, - * a client could see them change. this currently never happens, - * but will when a desired enhancement (don't reneder till needed) - * is made. - */ - -#define BBOX_FIXUP 1 - -#ifdef BBOX_FIXUP - int off_horz; - int off_vert; - - if (xorg < 0) - off_horz = (fix15) ((xorg - 32768L) / 65536); - else - off_horz = (fix15) ((xorg + 32768L) / 65536); - if (yorg < 0) - off_vert = (fix15) ((yorg - 32768L) / 65536); - else - off_vert = (fix15) ((yorg + 32768L) / 65536); - if (xsize != 0 || ysize != 0 || ci->metrics.characterWidth) - { - ci->metrics.leftSideBearing = off_horz; - ci->metrics.descent = -off_vert; - ci->metrics.rightSideBearing = xsize + off_horz; - ci->metrics.ascent = ysize + off_vert; - } - else - { - /* If setting the proper size would cause the character to appear to - be non-existent, fudge things by giving it a pixel to occupy. */ - xsize = ysize = 1; - ci->metrics.leftSideBearing = ci->metrics.descent = 0; - ci->metrics.rightSideBearing = ci->metrics.ascent = 1; - } - - cfv->bit_width = xsize; - cfv->bit_height = ysize; -#else - cfv->bit_width = ci->metrics.rightSideBearing - - ci->metrics.leftSideBearing; - cfv->bit_height = ci->metrics.ascent + ci->metrics.descent; -#endif - - assert(cfv->bp - sp_fp_cur->bitmaps <= sp_fp_cur->bitmap_size); - ci->bits = (char *) cfv->bp; - - cfv->cur_y = 0; -} - -void -sp_close_bitmap() -{ - CharInfoPtr ci = &sp_fp_cur->encoding[cfv->char_id - sp_fp_cur->master->first_char_id]; - int bpr = cfv->bpr; - - if (bpr == 0) - bpr = GLYPH_SIZE(ci, cfv->scanpad); - if (!cfv->trunc) - finish_line(sp_fp_cur); - cfv->trunc = 0; - cfv->last_y++; - while (cfv->last_y < cfv->bit_height) { - finish_line(sp_fp_cur); - cfv->last_y++; - } - if (byte_order != bit_order) { - switch (scan) { - case 1: - break; - case 2: - TwoByteSwap(cfv->bp, bpr * cfv->bit_height); - break; - case 4: - FourByteSwap(cfv->bp, bpr * cfv->bit_height); - break; - } - } -} - -int -sp_build_all_bitmaps( - FontPtr pfont, - fsBitmapFormat format, - fsBitmapFormatMask fmask) -{ - int ret, - glyph = 1, - image = BitmapFormatImageRectMin; - unsigned long glyph_size; - SpeedoFontPtr spf = (SpeedoFontPtr) pfont->fontPrivate; - SpeedoMasterFontPtr spmf = spf->master; - pointer bitmaps; - int start, - end, - i; - - scan = 1; - ret = CheckFSFormat(format, fmask, - &bit_order, &byte_order, &scan, &glyph, &image); - - pfont->bit = bit_order; - pfont->byte = byte_order; - pfont->glyph = glyph; - pfont->scan = scan; - if (ret != Successful) - return BadFontFormat; - - start = spmf->first_char_id; - end = spmf->max_id; - glyph_size = sp_compute_data_size(pfont, image, glyph, start, end); - - /* XXX -- MONDO KLUDGE -- add some slop */ - /* - * not sure why this is wanted, but it keeps the packer from going off the - * end and toasting us down the line - */ - glyph_size += 20; - -#ifdef DEBUG - spf->bitmap_size = glyph_size; -#endif - - bitmaps = (pointer) xalloc(glyph_size); - if (!bitmaps) - return AllocError; - bzero((char *) bitmaps, glyph_size); - - /* set up some state */ - sp_fp_cur = spf; - spf->bitmaps = bitmaps; - cfv->format = format; - cfv->scanpad = glyph; - cfv->bp = bitmaps; - - for (i = 0; i < spmf->num_chars; i++) { - int j; - cfv->char_index = spmf->enc[i * 2 + 1]; - cfv->char_id = spmf->enc[i * 2]; -#ifdef DEBUG -fprintf(stderr, "build_all_sp_bitmaps:i = %d, Char ID = %d\n", i, cfv->char_id); -#endif - if (!cfv->char_id) - continue; - - /* - * See if this character is in the list of ranges specified in the - * XLFD name - */ - for (j = 0; j < spf->vals.nranges; j++) - if (cfv->char_id >= mincharno(spf->vals.ranges[j]) && - cfv->char_id <= maxcharno(spf->vals.ranges[j])) - break; - - /* If not, don't realize it. */ - if (spf->vals.nranges && j == spf->vals.nranges) - continue; - - if (!sp_make_char(cfv->char_index)) { - -#ifdef DEBUG /* can be very common with some encodings */ - SpeedoErr("Can't make char %d\n", cfv->char_index); -#endif - } - } - - return Successful; -} diff --git a/nx-X11/lib/font/Speedo/spinfo.c b/nx-X11/lib/font/Speedo/spinfo.c deleted file mode 100644 index d7a1edd98..000000000 --- a/nx-X11/lib/font/Speedo/spinfo.c +++ /dev/null @@ -1,462 +0,0 @@ -/* $Xorg: spinfo.c,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - */ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/Speedo/spinfo.c,v 1.12 2001/12/14 19:56:42 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include "spint.h" -#ifndef FONTMODULE -#include -#else -#include "xf86_ansic.h" -#endif - -/* percentage of pointsize used to specify ascent & descent */ -#define STRETCH_FACTOR 120 - -enum scaleType { - atom, truncate_atom, pixel_size, point_size, resolution_x, - resolution_y, average_width -}; - -typedef struct _fontProp { - char *name; - long atom; - enum scaleType type; -} fontProp; - -static fontProp fontNamePropTable[] = { - { "FOUNDRY", 0, atom }, - { "FAMILY_NAME", 0, atom }, - { "WEIGHT_NAME", 0, atom }, - { "SLANT", 0, atom }, - { "SETWIDTH_NAME", 0, atom }, - { "ADD_STYLE_NAME", 0, atom }, - { "PIXEL_SIZE", 0, pixel_size }, - { "POINT_SIZE", 0, point_size }, - { "RESOLUTION_X", 0, resolution_x }, - { "RESOLUTION_Y", 0, resolution_y }, - { "SPACING", 0, atom }, - { "AVERAGE_WIDTH", 0, average_width }, - { "CHARSET_REGISTRY", 0, atom }, - { "CHARSET_ENCODING", 0, truncate_atom } -}; - -/* Warning: following array is closely related to the sequence of - defines after it. */ - -static fontProp extraProps[] = { - { "FONT", 0, }, - { "COPYRIGHT", 0, }, - { "RAW_PIXEL_SIZE", 0, }, - { "RAW_POINT_SIZE", 0, }, - { "RAW_ASCENT", 0, }, - { "RAW_DESCENT", 0, }, - { "RAW_AVERAGE_WIDTH", 0, }, - { "FONT_TYPE", 0, }, - { "RASTERIZER_NAME", 0, } -}; - -/* this is a bit kludgy */ -#define FONTPROP 0 -#define COPYRIGHTPROP 1 -#define RAWPIXELPROP 2 -#define RAWPOINTPROP 3 -#define RAWASCENTPROP 4 -#define RAWDESCENTPROP 5 -#define RAWWIDTHPROP 6 -#define FONT_TYPEPROP 7 -#define RASTERIZER_NAMEPROP 8 - -#define NNAMEPROPS (sizeof(fontNamePropTable) / sizeof(fontProp)) -#define NEXTRAPROPS (sizeof(extraProps) / sizeof(fontProp)) - -#define NPROPS (NNAMEPROPS + NEXTRAPROPS) - -void -sp_make_standard_props() -{ - int i; - fontProp *t; - - i = sizeof(fontNamePropTable) / sizeof(fontProp); - for (t = fontNamePropTable; i; i--, t++) - t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE); - i = sizeof(extraProps) / sizeof(fontProp); - for (t = extraProps; i; i--, t++) - t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE); -} - -void -sp_make_header( - SpeedoFontPtr spf, - FontInfoPtr pinfo) -{ - int pixel_size; - SpeedoMasterFontPtr spmf = spf->master; - - pinfo->firstCol = spmf->first_char_id & 0xff; - pinfo->firstRow = spmf->first_char_id >> 8; - pinfo->lastCol = spmf->max_id & 0xff; - pinfo->lastRow = spmf->max_id >> 8; - - /* XXX -- hackery here */ - pinfo->defaultCh = 0; -/* computed by FontComputeInfoAccelerators: - * noOverlap - * constantMetrics - * terminalFont - * constantWidth - * inkInside - */ - pinfo->inkMetrics = 0; - pinfo->allExist = 0; - pinfo->drawDirection = LeftToRight; - pinfo->cachable = 1; - if (spf->specs.xxmult != spf->specs.yymult) - pinfo->anamorphic = TRUE; - else - pinfo->anamorphic = FALSE; -/* computed by sp_compute_bounds: - * maxOverlap - * maxbounds - * minbounds - * ink_maxbounds - * ink_minbounds - */ - pixel_size = spf->vals.pixel_matrix[3] * STRETCH_FACTOR / 100; - pinfo->fontAscent = pixel_size * 764 / 1000; /* 764 == EM_TOP */ - pinfo->fontDescent = pixel_size - pinfo->fontAscent; -} - -static void -adjust_min_max( - xCharInfo *minc, - xCharInfo *maxc, - xCharInfo *tmp) -{ -#define MINMAX(field,ci) \ - if (minc->field > (ci)->field) \ - minc->field = (ci)->field; \ - if (maxc->field < (ci)->field) \ - maxc->field = (ci)->field; - - MINMAX(ascent, tmp); - MINMAX(descent, tmp); - MINMAX(leftSideBearing, tmp); - MINMAX(rightSideBearing, tmp); - MINMAX(characterWidth, tmp); - - if ((INT16)minc->attributes > (INT16)tmp->attributes) - minc->attributes = tmp->attributes; - if ((INT16)maxc->attributes < (INT16)tmp->attributes) - maxc->attributes = tmp->attributes; - -#undef MINMAX -} - - -void -sp_compute_bounds( - SpeedoFontPtr spf, - FontInfoPtr pinfo, - unsigned long flags, - long *sWidth) -{ - int i, - id, - index, - maxOverlap, - overlap, - total_width = 0; - xCharInfo minchar, - maxchar, - tmpchar; - bbox_t bbox; - fix31 width; - double pix_width; - SpeedoMasterFontPtr spmf = spf->master; - int firstChar; - int num_chars = 0; - - firstChar = spmf->first_char_id; - minchar.ascent = minchar.descent = - minchar.leftSideBearing = minchar.rightSideBearing = - minchar.characterWidth = minchar.attributes = 32767; - maxchar.ascent = maxchar.descent = - maxchar.leftSideBearing = maxchar.rightSideBearing = - maxchar.characterWidth = maxchar.attributes = -32767; - maxOverlap = -32767; - *sWidth = 0; - for (i = 0; i < spmf->num_chars; i++) { - int j; - int char_id; - - index = spmf->enc[i * 2 + 1]; - char_id = spmf->enc[i * 2]; - /* - * See if this character is in the list of ranges specified in the - * XLFD name - */ - for (j = 0; j < spf->vals.nranges; j++) - if (char_id >= mincharno(spf->vals.ranges[j]) && - char_id <= maxcharno(spf->vals.ranges[j])) - break; - if (spf->vals.nranges && j == spf->vals.nranges) - continue; - num_chars++; - - if (!(flags & ComputeBoundsOnly)) { - - width = sp_get_char_width(index); - - /* convert to pixel coords */ - pix_width = (int)width * (spf->specs.xxmult / 65536L) + - ((int) width * (spf->specs.xxmult % 65536L)) - / 65536L; - pix_width /= 65536L; - - (void) sp_get_char_bbox(index, &bbox); - bbox.ymax = (bbox.ymax + 32768L) >> 16; - bbox.ymin = (bbox.ymin + 32768L) >> 16; - bbox.xmin = (bbox.xmin + 32768L) >> 16; - bbox.xmax = (bbox.xmax + 32768L) >> 16; - tmpchar.ascent = bbox.ymax; - tmpchar.descent = -bbox.ymin; - tmpchar.characterWidth = (int)(pix_width + /* round */ - (pix_width > 0 ? 0.5 : -0.5)); - tmpchar.rightSideBearing = bbox.xmax; - tmpchar.leftSideBearing = bbox.xmin; - - if (!tmpchar.characterWidth && - tmpchar.ascent == -tmpchar.descent && - tmpchar.rightSideBearing == tmpchar.leftSideBearing) - { - /* Character appears non-existent, probably as a result - of the transformation. Let's give it one pixel in - the universe so it's not mistaken for non-existent. */ - tmpchar.leftSideBearing = tmpchar.descent = 0; - tmpchar.rightSideBearing = tmpchar.ascent = 1; - } - - tmpchar.attributes = (int)((double)(int)width / 65.536 + .5); - } - else - tmpchar = spf->encoding[char_id - firstChar].metrics; - - adjust_min_max(&minchar, &maxchar, &tmpchar); - overlap = tmpchar.rightSideBearing - tmpchar.characterWidth; - if (maxOverlap < overlap) - maxOverlap = overlap; - - total_width += ((int)(INT16)tmpchar.attributes); - *sWidth += abs((int)(INT16)tmpchar.attributes); - - if (flags & SaveMetrics) { - id = spmf->enc[i * 2] - firstChar; - assert(id <= spmf->max_id - firstChar); - spf->encoding[id].metrics = tmpchar; - } - } - - - if (num_chars > 0) - { - *sWidth = (int)(((double)*sWidth * 10.0 + (double)num_chars / 2.0) / - num_chars); - if (total_width < 0) - { - /* Predominant direction is R->L */ - *sWidth = -*sWidth; - } - spf->vals.width = (int)((double)*sWidth * spf->vals.pixel_matrix[0] / - 1000.0 + - (spf->vals.pixel_matrix[0] > 0 ? .5 : -.5)); - } - else - { - spf->vals.width = 0; - } - pinfo->maxbounds = maxchar; - pinfo->minbounds = minchar; - pinfo->ink_maxbounds = maxchar; - pinfo->ink_minbounds = minchar; - pinfo->maxOverlap = maxOverlap; -} - -void -sp_compute_props( - SpeedoFontPtr spf, - char *fontname, - FontInfoPtr pinfo, - long sWidth) -{ - FontPropPtr pp; - int i, - nprops; - fontProp *fpt; - char *is_str; - char *ptr1 = NULL, - *ptr2; - char *ptr3; - char tmpname[1024]; - FontScalableRec tmpvals; - - nprops = pinfo->nprops = NPROPS; - pinfo->isStringProp = (char *) xalloc(sizeof(char) * nprops); - pinfo->props = (FontPropPtr) xalloc(sizeof(FontPropRec) * nprops); - if (!pinfo->isStringProp || !pinfo->props) { - xfree(pinfo->isStringProp); - pinfo->isStringProp = (char *) 0; - xfree(pinfo->props); - pinfo->props = (FontPropPtr) 0; - pinfo->nprops = 0; - return; - } - bzero(pinfo->isStringProp, (sizeof(char) * nprops)); - - ptr2 = fontname; - for (i = NNAMEPROPS, pp = pinfo->props, fpt = fontNamePropTable, - is_str = pinfo->isStringProp; - i; - i--, pp++, fpt++, is_str++) { - - if (*ptr2) - { - ptr1 = ptr2 + 1; - if (!(ptr2 = strchr(ptr1, '-'))) ptr2 = strchr(ptr1, '\0'); - } - - pp->name = fpt->atom; - switch (fpt->type) { - case atom: - *is_str = TRUE; - pp->value = MakeAtom(ptr1, ptr2 - ptr1, TRUE); - break; - case truncate_atom: - *is_str = TRUE; - for (ptr3 = ptr1; *ptr3; ptr3++) - if (*ptr3 == '[') - break; - pp->value = MakeAtom(ptr1, ptr3 - ptr1, TRUE); - break; - case pixel_size: - pp->value = (int)(spf->vals.pixel_matrix[3] + - (spf->vals.pixel_matrix[3] > 0 ? .5 : -.5)); - break; - case point_size: - pp->value = (int)(spf->vals.point_matrix[3] * 10.0 + - (spf->vals.point_matrix[3] > 0 ? .5 : -.5)); - break; - case resolution_x: - pp->value = spf->vals.x; - break; - case resolution_y: - pp->value = spf->vals.y; - break; - case average_width: - pp->value = spf->vals.width; - break; - } - } - - for (i = 0, fpt = extraProps; i < NEXTRAPROPS; i++, is_str++, pp++, fpt++) { - pp->name = fpt->atom; - switch (i) { - case FONTPROP: - *is_str = TRUE; - strcpy(tmpname, fontname); - FontParseXLFDName(tmpname, &tmpvals, FONT_XLFD_REPLACE_ZERO); - FontParseXLFDName(tmpname, &spf->vals, FONT_XLFD_REPLACE_VALUE); - pp->value = MakeAtom(tmpname, strlen(tmpname), TRUE); - break; - case COPYRIGHTPROP: - *is_str = TRUE; - pp->value = MakeAtom(spf->master->copyright, - strlen(spf->master->copyright), TRUE); - break; - case FONT_TYPEPROP: - *is_str = TRUE; - pp->value = MakeAtom("Speedo", strlen("Speedo"), TRUE); - break; - case RASTERIZER_NAMEPROP: - *is_str = TRUE; - pp->value = MakeAtom("X Consortium Speedo Rasterizer", - strlen("X Consortium Speedo Rasterizer"), - TRUE); - break; - case RAWPIXELPROP: - *is_str = FALSE; - pp->value = 1000; - break; - case RAWPOINTPROP: - *is_str = FALSE; - pp->value = (long)(72270.0 / (double)spf->vals.y + .5); - break; - case RAWASCENTPROP: - *is_str = FALSE; - pp->value = STRETCH_FACTOR * 764 / 100; - break; - case RAWDESCENTPROP: - *is_str = FALSE; - pp->value = STRETCH_FACTOR * 236 / 100; - break; - case RAWWIDTHPROP: - *is_str = FALSE; - pp->value = sWidth; - break; - } - } -} diff --git a/nx-X11/lib/font/Speedo/spint.h b/nx-X11/lib/font/Speedo/spint.h deleted file mode 100644 index 118ea8f42..000000000 --- a/nx-X11/lib/font/Speedo/spint.h +++ /dev/null @@ -1,180 +0,0 @@ -/* $Xorg: spint.h,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/Speedo/spint.h,v 1.9 2001/01/17 19:43:20 dawes Exp $ */ - -#ifndef _SPINT_H_ -#define _SPINT_H_ - -#include -#ifndef XFree86LOADER -#include -#else -#include -#endif -#include -#include "speedo.h" - -#define SaveMetrics 0x1 -#define ComputeBoundsOnly 0x2 - -#define GLWIDTHBYTESPADDED(bits,nbytes) \ - ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \ - :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \ - :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \ - :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \ - : 0) - -#define GLYPH_SIZE(ch, nbytes) \ - GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \ - (ch)->metrics.leftSideBearing, (nbytes)) - -#define mincharno(p) ((p).min_char_low + ((p).min_char_high << 8)) -#define maxcharno(p) ((p).max_char_low + ((p).max_char_high << 8)) - -#define MasterFileOpen 0x1 - -typedef struct _sp_master { - FontEntryPtr entry; /* back pointer */ - FILE *fp; - char *fname; - ufix8 *f_buffer; - ufix8 *c_buffer; - char *copyright; - ufix8 *key; - buff_t font; - buff_t char_data; - ufix16 mincharsize; - int first_char_id; - int num_chars; - int max_id; - int state; /* open, closed */ - int refcount; /* number of instances */ - int *enc; - int enc_size; -} SpeedoMasterFontRec, *SpeedoMasterFontPtr; - -typedef struct _cur_font_stats { - fsBitmapFormat format; - /* current glyph info */ - ufix16 char_index; - ufix16 char_id; - - fix15 bit_width, - bit_height; - fix15 cur_y; - int bpr; - - /* - * since Speedo returns extents that are not identical to what it feeds to - * the bitmap builder, and we want to be able to use the extents for - * preformance reasons, some of the bitmaps require padding out. the next - * two flags keep track of this. - */ - fix15 last_y; - int trunc; - - pointer bp; - int scanpad; -} CurrentFontValuesRec, *CurrentFontValuesPtr; - - -typedef struct _sp_font { - struct _sp_master *master; - specs_t specs; - - FontEntryPtr entry; - - FontScalableRec vals; - - /* char & metric data */ - CharInfoPtr encoding; - CharInfoPtr pDefault; - pointer bitmaps; - -#ifdef DEBUG - unsigned long bitmap_size; -#endif - -} SpeedoFontRec, *SpeedoFontPtr; - -extern SpeedoFontPtr sp_fp_cur; - -extern int sp_open_font(char *, char *, FontEntryPtr, FontScalablePtr, - fsBitmapFormat, fsBitmapFormatMask, Mask, - SpeedoFontPtr *); -extern int sp_open_master(const char *, const char *, SpeedoMasterFontPtr *); -extern void sp_close_font(SpeedoFontPtr); -extern void sp_close_master_font(SpeedoMasterFontPtr); -extern void sp_close_master_file(SpeedoMasterFontPtr); -extern void sp_reset_master(SpeedoMasterFontPtr); -extern void SpeedoErr(char *fmt, ...); - -extern void sp_make_standard_props(void); -extern void sp_make_header(SpeedoFontPtr, FontInfoPtr); -extern void sp_compute_bounds(SpeedoFontPtr, FontInfoPtr, unsigned long, long *); -extern void sp_compute_props(SpeedoFontPtr, char *, FontInfoPtr, long); -extern int sp_build_all_bitmaps(FontPtr, fsBitmapFormat, fsBitmapFormatMask); -extern unsigned long sp_compute_data_size(FontPtr, int, int, unsigned long, - unsigned long); - -extern int SpeedoFontLoad(FontPtr *, char *, char *, FontEntryPtr, - FontScalablePtr, fsBitmapFormat, fsBitmapFormatMask, - Mask); - -extern int sp_bics_map[]; -extern int sp_bics_map_size; - -#ifdef EXTRAFONTS -extern int adobe_map[]; -extern int adobe_map_size; - -#endif - -#endif /* _SPINT_H_ */ diff --git a/nx-X11/lib/font/Speedo/sptobdf.c b/nx-X11/lib/font/Speedo/sptobdf.c deleted file mode 100644 index ca3caa515..000000000 --- a/nx-X11/lib/font/Speedo/sptobdf.c +++ /dev/null @@ -1,678 +0,0 @@ -/* $Xorg: sptobdf.c,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices and - * Digital not be used in advertising or publicity pertaining to - * distribution of the software without specific, written prior permission. - * Network Computing Devices and Digital make no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR 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. - * - * Dave Lemke - */ - -/* - -Copyright 1987, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/* - * Speedo outline to BFD format converter - */ - -#include -#include "speedo.h" - -#ifdef EXTRAFONTS -#include "ncdkeys.h" -#else -#include "keys.h" -#endif - -#include "iso8859.h" - -#define MAX_BITS 1024 - -#define BBOX_CLIP - -static char line_of_bits[MAX_BITS + 1]; - -static FILE *fp; -static ufix16 char_index, - char_id; -static buff_t font; -static buff_t char_data; -static ufix8 *f_buffer, - *c_buffer; -static ufix16 mincharsize; -static fix15 cur_y; -static fix15 bit_width, - bit_height; - -static ufix8 key[] = -{ - KEY0, - KEY1, - KEY2, - KEY3, - KEY4, - KEY5, - KEY6, - KEY7, - KEY8 -}; /* Font decryption key */ - - -static char *progname; -static char *fontname = NULL; -static char *fontfile = NULL; - -static int point_size = 120; -static int x_res = 72; -static int y_res = 72; -static int quality = 0; -static int iso_encoding = 1; - -static int num_props = 7; -static int stretch = 120; - -static specs_t specs; - -static void dump_header(); - -static void -usage() -{ - fprintf(stderr, "Usage: %s [-xres x resolution] [-yres y resolution]\n\t[-ptsize pointsize] [-fn fontname] [-q quality (0-1)] fontfile\n", progname); - fprintf(stderr, "Where:\n"); - fprintf(stderr, "-xres specifies the X resolution (72)\n"); - fprintf(stderr, "-yres specifies the Y resolution (72)\n"); - fprintf(stderr, "-pts specifies the pointsize in decipoints (120)\n"); - fprintf(stderr, "-fn specifies the font name (full Bitstream name)\n"); - fprintf(stderr, "-q specifies the font quality [0-1] (0)\n"); - fprintf(stderr, "\n"); - exit(0); -} - -static fix15 -read_2b(ptr) - ufix8 *ptr; -{ - fix15 tmp; - - tmp = *ptr++; - tmp = (tmp << 8) + *ptr; - return tmp; -} - -static fix31 -read_4b(ptr) - ufix8 *ptr; -{ - fix31 tmp; - - tmp = *ptr++; - tmp = (tmp << 8) + *ptr++; - tmp = (tmp << 8) + *ptr++; - tmp = (tmp << 8) + *ptr; - return tmp; -} - -static void -process_args(ac, av) - int ac; - char **av; -{ - int i; - - for (i = 1; i < ac; i++) { - if (!strncmp(av[i], "-xr", 3)) { - if (av[i + 1]) { - x_res = atoi(av[++i]); - } else - usage(); - } else if (!strncmp(av[i], "-yr", 3)) { - if (av[i + 1]) { - y_res = atoi(av[++i]); - } else - usage(); - } else if (!strncmp(av[i], "-pt", 3)) { - if (av[i + 1]) { - point_size = atoi(av[++i]); - } else - usage(); - } else if (!strncmp(av[i], "-fn", 3)) { - if (av[i + 1]) { - fontname = av[++i]; - } else - usage(); - } else if (!strncmp(av[i], "-q", 2)) { - if (av[i + 1]) { - quality = atoi(av[++i]); - } else - usage(); - } else if (!strncmp(av[i], "-st", 3)) { - if (av[i + 1]) { - stretch = atoi(av[++i]); - } else - usage(); - } else if (!strncmp(av[i], "-noni", 5)) { - iso_encoding = 0; - } else if (*av[i] == '-') { - usage(); - } else - fontfile = av[i]; - } - if (!fontfile) - usage(); -} - -void -main(argc, argv) - int argc; - char **argv; -{ - ufix32 i; - ufix8 tmp[16]; - ufix32 minbufsize; - ufix16 cust_no; - int first_char_index, - num_chars; - - progname = argv[0]; - process_args(argc, argv); - fp = fopen(fontfile, "r"); - if (!fp) { - fprintf(stderr, "No such font file, \"%s\"\n", fontfile); - exit(-1); - } - if (fread(tmp, sizeof(ufix8), 16, fp) != 16) { - fprintf(stderr, "error reading \"%s\"\n", fontfile); - exit(-1); - } - minbufsize = (ufix32) read_4b(tmp + FH_FBFSZ); - f_buffer = (ufix8 *) malloc(minbufsize); - if (!f_buffer) { - fprintf(stderr, "can't get %x bytes of memory\n", minbufsize); - exit(-1); - } - fseek(fp, (ufix32) 0, 0); - - if (fread(f_buffer, sizeof(ufix8), (ufix16) minbufsize, fp) != minbufsize) { - fprintf(stderr, "error reading file \"%s\"\n", fontfile); - exit(-1); - } - mincharsize = read_2b(f_buffer + FH_CBFSZ); - - c_buffer = (ufix8 *) malloc(mincharsize); - if (!c_buffer) { - fprintf(stderr, "can't get %x bytes for char buffer\n", mincharsize); - exit(-1); - } - /* init */ - sp_reset(); - - font.org = f_buffer; - font.no_bytes = minbufsize; - - if ((cust_no = sp_get_cust_no(font)) != CUS0) { - fprintf(stderr, "Non-standard encryption for \"%s\"\n", fontfile); - exit(-1); - } - sp_set_key(key); - - first_char_index = read_2b(f_buffer + FH_FCHRF); - num_chars = read_2b(f_buffer + FH_NCHRL); - - /* set up specs */ - /* Note that point size is in decipoints */ - specs.pfont = &font; - /* XXX beware of overflow */ - specs.xxmult = point_size * x_res / 720 * (1 << 16); - specs.xymult = 0L << 16; - specs.xoffset = 0L << 16; - specs.yxmult = 0L << 16; - specs.yymult = point_size * y_res / 720 * (1 << 16); - specs.yoffset = 0L << 16; - switch (quality) { - case 0: - specs.flags = 0; - break; - case 1: - specs.flags = MODE_SCREEN; - break; - case 2: - specs.flags = MODE_2D; - break; - default: - fprintf(stderr, "bogus quality value %d\n", quality); - break; - } - specs.out_info = NULL; - - if (!fontname) { - fontname = (char *) (f_buffer + FH_FNTNM); - } - if (iso_encoding) - num_chars = num_iso_chars; - dump_header(num_chars); - - if (!sp_set_specs(&specs)) { - fprintf(stderr, "can't set specs\n"); - } else { - if (iso_encoding) { - for (i = 0; i < num_iso_chars * 2; i += 2) { - char_index = iso_map[i + 1]; - char_id = iso_map[i]; - if (!sp_make_char(char_index)) { - fprintf(stderr, "can't make char %x\n", char_index); - } - } - } else { - for (i = 0; i < num_chars; i++) { - char_index = i + first_char_index; - char_id = sp_get_char_id(char_index); - if (char_id) { - if (!sp_make_char(char_index)) { - fprintf(stderr, "can't make char %x\n", char_index); - } - } - } - } - } - - (void) fclose(fp); - - printf("ENDFONT\n"); - exit(0); -} - -static void -dump_header(num_chars) - ufix32 num_chars; -{ - fix15 xmin, - ymin, - xmax, - ymax; - fix15 ascent, - descent; - fix15 pixel_size; - - xmin = read_2b(f_buffer + FH_FXMIN); - ymin = read_2b(f_buffer + FH_FYMIN); - xmax = read_2b(f_buffer + FH_FXMAX); - ymax = read_2b(f_buffer + FH_FYMAX); - pixel_size = point_size * x_res / 720; - - printf("STARTFONT 2.1\n"); - printf("COMMENT\n"); - printf("COMMENT Generated from Bitstream Speedo outlines via sptobdf\n"); - printf("COMMENT\n"); - printf("FONT %s\n", fontname); - printf("SIZE %d %d %d\n", pixel_size, x_res, y_res); - printf("FONTBOUNDINGBOX %d %d %d %d\n", xmin, ymin, xmax, ymax); - printf("STARTPROPERTIES %d\n", num_props); - - printf("RESOLUTION_X %d\n", x_res); - printf("RESOLUTION_Y %d\n", y_res); - printf("POINT_SIZE %d\n", point_size); - printf("PIXEL_SIZE %d\n", pixel_size); - printf("COPYRIGHT \"%s\"\n", f_buffer + FH_CPYRT); - - /* do some stretching here so that its isn't too tight */ - pixel_size = pixel_size * stretch / 100; - ascent = pixel_size * 764 / 1000; /* 764 == EM_TOP */ - descent = pixel_size - ascent; - printf("FONT_ASCENT %d\n", ascent); - printf("FONT_DESCENT %d\n", descent); - - printf("ENDPROPERTIES\n"); - printf("CHARS %d\n", num_chars); -} - -buff_t * -sp_load_char_data(file_offset, num, cb_offset) - fix31 file_offset; - fix15 num; - fix15 cb_offset; -{ - if (fseek(fp, (long) file_offset, (int) 0)) { - fprintf(stderr, "can't seek to char\n"); - (void) fclose(fp); - exit(-1); - } - if ((num + cb_offset) > mincharsize) { - fprintf(stderr, "char buf overflow\n"); - (void) fclose(fp); - exit(-2); - } - if (fread((c_buffer + cb_offset), sizeof(ufix8), num, fp) != num) { - fprintf(stderr, "can't get char data\n"); - exit(-1); - } - char_data.org = (ufix8 *) c_buffer + cb_offset; - char_data.no_bytes = num; - - return &char_data; -} - -/* - * Called by Speedo character generator to report an error. - * - * Since character data not available is one of those errors - * that happens many times, don't report it to user - */ -void -sp_report_error(n) - fix15 n; -{ - switch (n) { - case 1: - fprintf(stderr, "Insufficient font data loaded\n"); - break; - case 3: - fprintf(stderr, "Transformation matrix out of range\n"); - break; - case 4: - fprintf(stderr, "Font format error\n"); - break; - case 5: - fprintf(stderr, "Requested specs not compatible with output module\n"); - break; - case 7: - fprintf(stderr, "Intelligent transformation requested but not supported\n"); - break; - case 8: - fprintf(stderr, "Unsupported output mode requested\n"); - break; - case 9: - fprintf(stderr, "Extended font loaded but only compact fonts supported\n"); - break; - case 10: - fprintf(stderr, "Font specs not set prior to use of font\n"); - break; - case 12: - break; - case 13: - fprintf(stderr, "Track kerning data not available()\n"); - break; - case 14: - fprintf(stderr, "Pair kerning data not available()\n"); - break; - default: - fprintf(stderr, "report_error(%d)\n", n); - break; - } -} - -void -sp_open_bitmap(x_set_width, y_set_width, xorg, yorg, xsize, ysize) - fix31 x_set_width; - fix31 y_set_width; - fix31 xorg; - fix31 yorg; - fix15 xsize; - fix15 ysize; -{ - fix15 i; - fix15 off_horz; - fix15 off_vert; - fix31 width, - pix_width; - bbox_t bb; - - bit_width = xsize; - - bit_height = ysize; - off_horz = (fix15) ((xorg + 32768L) >> 16); - off_vert = (fix15) ((yorg + 32768L) >> 16); - - if (bit_width > MAX_BITS) { - -#ifdef DEBUG - fprintf(stderr, "char wider than max bits -- truncated\n"); -#endif - - bit_width = MAX_BITS; - } - width = sp_get_char_width(char_index); - pix_width = width * (specs.xxmult / 65536L) + - ((ufix32) width * ((ufix32) specs.xxmult & 0xffff)) / 65536L; - pix_width /= 65536L; - - width = (pix_width * 7200L) / (point_size * y_res); - - (void) sp_get_char_bbox(char_index, &bb); - bb.xmin >>= 16; - bb.ymin >>= 16; - bb.xmax >>= 16; - bb.ymax >>= 16; - -#ifdef DEBUG - if ((bb.xmax - bb.xmin) != bit_width) - fprintf(stderr, "bbox & width mismatch 0x%x (%d) (%d vs %d)\n", - char_index, char_id, (bb.xmax - bb.xmin), bit_width); - if ((bb.ymax - bb.ymin) != bit_height) - fprintf(stderr, "bbox & height mismatch 0x%x (%d) (%d vs %d)\n", - char_index, char_id, (bb.ymax - bb.ymin), bit_height); - if (bb.xmin != off_horz) - fprintf(stderr, "x min mismatch 0x%x (%d) (%d vs %d)\n", - char_index, char_id, bb.xmin, off_horz); - if (bb.ymin != off_vert) - fprintf(stderr, "y min mismatch 0x%x (%d) (%d vs %d)\n", - char_index, char_id, bb.ymin, off_vert); -#endif - -#ifdef BBOX_CLIP - bit_width = bb.xmax - bb.xmin; - bit_height = bb.ymax - bb.ymin; - off_horz = bb.xmin; - off_vert = bb.ymin; -#endif - - /* XXX kludge to handle space */ - if (bb.xmin == 0 && bb.ymin == 0 && bb.xmax == 0 && bb.ymax == 0 && - width) { - bit_width = 1; - bit_height = 1; - } - printf("STARTCHAR %d\n", char_id); - printf("ENCODING %d\n", char_id); - printf("SWIDTH %d 0\n", width); - printf("DWIDTH %d 0\n", pix_width); - printf("BBX %d %d %d %d\n", bit_width, bit_height, off_horz, off_vert); - printf("BITMAP\n"); - - for (i = 0; i < bit_width; i++) { - line_of_bits[i] = '.'; - } - line_of_bits[bit_width] = '\0'; - cur_y = 0; -} - -static void -dump_line(line) - ufix8 *line; -{ - int bit; - unsigned byte; - - byte = 0; - for (bit = 0; bit < bit_width; bit++) { - if (line[bit] == 'X') - byte |= (1 << (7 - (bit & 7))); - if ((bit & 7) == 7) { - printf("%02X", byte); - byte = 0; - } - } - if ((bit & 7) != 0) - printf("%02X", byte); - printf("\n"); -} - -#ifdef BBOX_CLIP -static fix15 last_y; -static int trunc = 0; - -#endif - -void -sp_set_bitmap_bits(y, xbit1, xbit2) - fix15 y; - fix15 xbit1; - fix15 xbit2; -{ - fix15 i; - - if (xbit1 > MAX_BITS) { - -#ifdef DEBUG - fprintf(stderr, "run wider than max bits -- truncated\n"); -#endif - - xbit1 = MAX_BITS; - } - if (xbit2 > MAX_BITS) { - -#ifdef DEBUG - fprintf(stderr, "run wider than max bits -- truncated\n"); -#endif - - xbit2 = MAX_BITS; - } - while (cur_y != y) { - dump_line(line_of_bits); - for (i = 0; i < bit_width; i++) { - line_of_bits[i] = '.'; - } - cur_y++; - } - -#ifdef BBOX_CLIP - last_y = y; - if (y >= bit_height) { - -#ifdef DEBUG - fprintf(stderr, - "y value is larger than height 0x%x (%d) -- truncated\n", - char_index, char_id); -#endif - - trunc = 1; - return; - } -#endif /* BBOX_CLIP */ - - for (i = xbit1; i < xbit2; i++) { - line_of_bits[i] = 'X'; - } -} - -void -sp_close_bitmap() -{ - -#ifdef BBOX_CLIP - int i; - - if (!trunc) - dump_line(line_of_bits); - trunc = 0; - - - last_y++; - while (last_y < bit_height) { - -#ifdef DEBUG - fprintf(stderr, "padding out height for 0x%x (%d)\n", - char_index, char_id); -#endif - - for (i = 0; i < bit_width; i++) { - line_of_bits[i] = '.'; - } - dump_line(line_of_bits); - last_y++; - } - -#else - dump_line(line_of_bits); -#endif - - printf("ENDCHAR\n"); -} - -/* outline stubs */ -void -sp_open_outline() -{ -} - -void -sp_start_new_char() -{ -} - -void -sp_start_contour() -{ -} - -void -sp_curve_to() -{ -} - -void -sp_line_to() -{ -} - -void -sp_close_contour() -{ -} - -void -sp_close_outline() -{ -} diff --git a/nx-X11/lib/font/Speedo/useropt.h b/nx-X11/lib/font/Speedo/useropt.h deleted file mode 100644 index e879aae96..000000000 --- a/nx-X11/lib/font/Speedo/useropt.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Xorg: useropt.h,v 1.4 2001/02/09 02:04:00 xorgcvs Exp $ */ -/* - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -#define INCL_LCD 1 -#define STATIC_ALLOC 1 - -#define INCL_BLACK 1 -#define INCL_SCREEN 1 -#define INCL_2D 1 -#define SHORT_LISTS 0 - -#define INCL_RULES 1 -#define INCL_METRICS 1 - -#define INCL_KEYS 1 diff --git a/nx-X11/lib/font/Type1/AFM.h b/nx-X11/lib/font/Type1/AFM.h deleted file mode 100644 index f2c997a3f..000000000 --- a/nx-X11/lib/font/Type1/AFM.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#if XFONT_CID -#ifndef AFM_H -#define AFM_H - -/* Bounding box definition. Used for the Font BBox as well as the - * Character BBox. - */ -typedef struct -{ - int llx; /* lower left x-position */ - int lly; /* lower left y-position */ - int urx; /* upper right x-position */ - int ury; /* upper right y-position */ -} BBox; - -/* Character Metric Information. This structure is used only if ALL - * character metric information is requested. If only the character - * widths is requested, then only an array of the character x-widths - * is returned. - * - * The key that each field is associated with is in comments. For an - * explanation about each key and its value please refer to the - * Character Metrics section of the AFM documentation (full title - * & version given above). - */ -typedef struct -{ - long code; /* CID code */ - int wx; /* key: WX or W0X */ - BBox charBBox; /* key: B */ -} Metrics; - -typedef struct -{ - int nChars; /* number of entries in char metrics array */ - Metrics *metrics; /* ptr to char metrics array */ -} FontInfo; - -int CIDAFM(FILE *, FontInfo **); -#endif /* AFM_H */ -#endif diff --git a/nx-X11/lib/font/Type1/Imakefile b/nx-X11/lib/font/Type1/Imakefile deleted file mode 100644 index 3b10c0399..000000000 --- a/nx-X11/lib/font/Type1/Imakefile +++ /dev/null @@ -1,91 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:28 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/lib/font/Type1/Imakefile,v 1.12 2002/02/13 21:32:48 dawes Exp $ - -#if BuildServer && DoLoadableServer -#define IHaveSubdirs -#define NoLibSubdirs -#define PassCDebugFlags -SUBDIRS = module -#endif - -INCLUDES = -I$(FONTINCSRC) -I../include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/include - -#if BuildCID -CIDSRCS = cidchar.c afm.c -CIDOBJS = cidchar.o afm.o -#if HasUsableFileMmap -MMAPDEFINES = -DUSE_MMAP -#endif -DEFINES = -DBUILDCID -DHAVE_CFM $(MMAPDEFINES) -#endif - -SRCS = \ - arith.c \ - curves.c \ - fontfcn.c \ - hints.c \ - lines.c \ - objects.c \ - paths.c \ - regions.c \ - scanfont.c \ - spaces.c \ - t1funcs.c \ - t1info.c \ - t1io.c \ - t1malloc.c \ - t1snap.c \ - t1stub.c \ - token.c \ - type1.c \ - util.c \ - $(CIDSRCS) \ - t1unicode.c - - -OBJS = \ - arith.o \ - curves.o \ - fontfcn.o \ - hints.o \ - lines.o \ - objects.o \ - paths.o \ - regions.o \ - scanfont.o \ - spaces.o \ - t1funcs.o \ - t1info.o \ - t1io.o \ - t1malloc.o \ - t1snap.o \ - t1stub.o \ - token.o \ - type1.o \ - util.o \ - $(CIDOBJS) \ - t1unicode.o - -#if BuildFontLib -#define DoNormalLib NormalLibFont -#define DoSharedLib SharedLibFont -#define DoDebugLib DebugLibFont -#define DoProfileLib ProfileLibFont -#include -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) -#endif - -#if BuildServer && DoLoadableServer -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -DependTarget() diff --git a/nx-X11/lib/font/Type1/afm.c b/nx-X11/lib/font/Type1/afm.c deleted file mode 100644 index 9a6dafee7..000000000 --- a/nx-X11/lib/font/Type1/afm.c +++ /dev/null @@ -1,200 +0,0 @@ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/afm.c,v 1.2 1999/08/21 13:47:38 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#ifdef XFONT_CID -#ifndef FONTMODULE -#include -#include -#include -#include -#else -#include "Xmd.h" /* For INT32 declaration */ -#include "Xdefs.h" /* For Bool */ -#include "xf86_ansic.h" -#endif -#include /* for xalloc/xfree */ -#include "AFM.h" - -#define PBUF 256 -#define KBUF 20 - -char *gettoken(FILE *); - -static char *afmbuf = NULL; - -char *gettoken(FILE *fd) { - char *bp; - int c, found; - - bp = afmbuf; - found = 0; - - while((c = getc(fd)) != EOF) { - if (found == 0 && (c == ' ' || c == '\t' || c == '\n' || c == '\r' || - c == ';' || c == ',')) continue; - found = 1; - if (c != ' ' && c != '\t' && c != '\n' && c != '\r' && c != ';') { - *bp++ = c; - if (bp - afmbuf >= PBUF) { - bp = afmbuf; - break; - } - } else - break; - } - - *bp = 0; - return(afmbuf); -} - -int CIDAFM(FILE *fd, FontInfo **pfi) { - char *p = 0; - int i, j, k = 0, found = 0; - FontInfo *fi; - - if (fd == NULL || pfi == NULL) return(1); - - *pfi = NULL; - - if ((afmbuf = (char *)xalloc(PBUF)) == NULL) - return(1); - - while(1) { - if (!(p = gettoken(fd))) { - xfree(afmbuf); - return(1); - } - - if (strncmp(p, "StartFontMetrics", 16) == 0) { - if (!(p = gettoken(fd))) { - xfree(afmbuf); - return(1); - } - if (strncmp(p, "4", 1) < 0) { - free(afmbuf); - return(1); - } - found = 1; - } else if (strncmp(p, "StartCharMetrics", 16) == 0) { - if (!found) { - xfree(afmbuf); - return(1); - } - - if (!(p = gettoken(fd))) { - xfree(afmbuf); - return(1); - } - - fi = (FontInfo *)xalloc(sizeof(FontInfo)); - - if (fi == NULL) { - xfree(afmbuf); - return(1); - } - bzero(fi, sizeof(FontInfo)); - - fi->nChars = atoi(p); - - if (fi->nChars < 0 || fi->nChars > INT_MAX / sizeof(Metrics)) { - xfree(afmbuf); - xfree(fi); - return(1); - } - fi->metrics = (Metrics *)xalloc(fi->nChars * - sizeof(Metrics)); - if (fi->metrics == NULL) { - xfree(afmbuf); - xfree(fi); - return(1); - } - - j = 0; - for (i = 0; i < fi->nChars; i++) { - k = 0; - while(1) { - if (!(p = gettoken(fd))) { - k = KBUF; - break; - } - if (strncmp(p, "W0X", 3) == 0) { - if (!(p = gettoken(fd))) { - k = KBUF; - break; - } - fi->metrics[j].wx = atoi(p); - } else if (strncmp(p, "N", 1) == 0) { - if (!(p = gettoken(fd))) { - k = KBUF; - break; - } - fi->metrics[j].code = (long)atoi(p); - } else if (strncmp(p, "B", 1) == 0) { - if (!(p = gettoken(fd))) { - k = KBUF; - break; - } - fi->metrics[j].charBBox.llx = atoi(p); - if (!(p = gettoken(fd))) { - k = KBUF; - break; - } - fi->metrics[j].charBBox.lly = atoi(p); - if (!(p = gettoken(fd))) { - k = KBUF; - break; - } - fi->metrics[j].charBBox.urx = atoi(p); - if (!(p = gettoken(fd))) { - k = KBUF; - break; - } - fi->metrics[j].charBBox.ury = atoi(p); - j++; - break; - } - k++; - if (k >= KBUF) break; - } - if (k >= KBUF) break; - } - if (k >= KBUF || j != fi->nChars) { - xfree(fi->metrics); - xfree(fi); - xfree(afmbuf); - return(1); - } else { - *pfi = fi; - xfree(afmbuf); - return(0); - } - } - } - - xfree(afmbuf); - return(1); -} -#endif diff --git a/nx-X11/lib/font/Type1/arith.c b/nx-X11/lib/font/Type1/arith.c deleted file mode 100644 index 961154335..000000000 --- a/nx-X11/lib/font/Type1/arith.c +++ /dev/null @@ -1,486 +0,0 @@ -/* $Xorg: arith.c,v 1.3 2000/08/17 19:46:29 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/arith.c,v 1.6tsi Exp $ */ - - /* ARITH CWEB V0006 ******** */ -/* -:h1.ARITH Module - Portable Module for Multiple Precision Fixed Point Arithmetic - -This module provides division and multiplication of 64-bit fixed point -numbers. (To be more precise, the module works on numbers that take -two 'longs' to store. That is almost always equivalent to saying 64-bit -numbers.) - -Note: it is frequently easy and desirable to recode these functions in -assembly language for the particular processor being used, because -assembly language, unlike C, will have 64-bit multiply products and -64-bit dividends. This module is offered as a portable version. - -&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) and Sten F. Andler - - -:h3.Include Files - -The included files are: -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef FONTMODULE -# include "os.h" -#endif -#include "objects.h" -#include "spaces.h" -#include "arith.h" - - -/* -:h3. -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -Reference for all algorithms: Donald E. Knuth, "The Art of Computer -Programming, Volume 2, Semi-Numerical Algorithms," Addison-Wesley Co., -Massachusetts, 1969, pp. 229-279. - -Knuth talks about a 'digit' being an arbitrary sized unit and a number -being a sequence of digits. We'll take a digit to be a 'short'. -The following assumption must be valid for these algorithms to work: -:ol. -:li.A 'long' is two 'short's. -:eol. -The following code is INDEPENDENT of: -:ol. -:li.The actual size of a short. -:li.Whether shorts and longs are stored most significant byte -first or least significant byte first. -:eol. - -SHORTSIZE is the number of bits in a short; LONGSIZE is the number of -bits in a long; MAXSHORT is the maximum unsigned short: -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -ASSEMBLE concatenates two shorts to form a long: -*/ -#define ASSEMBLE(hi,lo) ((((unsigned long)hi)<>SHORTSIZE) -#define LOWDIGIT(u) ((u)&MAXSHORT) - -/* -SIGNBITON tests the high order bit of a long 'w': -*/ -#define SIGNBITON(w) (((long)w)<0) - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h2.Double Long Arithmetic - -:h3.DLmult() - Multiply Two Longs to Yield a Double Long - -The two multiplicands must be positive. -*/ - -void -DLmult(doublelong *product, unsigned long u, unsigned long v) -{ -#ifdef LONG64 -/* printf("DLmult(? ?, %lx, %lx)\n", u, v); */ - *product = u*v; -/* printf("DLmult returns %lx\n", *product); */ -#else - register unsigned long u1, u2; /* the digits of u */ - register unsigned long v1, v2; /* the digits of v */ - register unsigned int w1, w2, w3, w4; /* the digits of w */ - register unsigned long t; /* temporary variable */ -/* printf("DLmult(? ?, %x, %x)\n", u, v); */ - u1 = HIGHDIGIT(u); - u2 = LOWDIGIT(u); - v1 = HIGHDIGIT(v); - v2 = LOWDIGIT(v); - - if (v2 == 0) w4 = w3 = w2 = 0; - else - { - t = u2 * v2; - w4 = LOWDIGIT(t); - t = u1 * v2 + HIGHDIGIT(t); - w3 = LOWDIGIT(t); - w2 = HIGHDIGIT(t); - } - - if (v1 == 0) w1 = 0; - else - { - t = u2 * v1 + w3; - w3 = LOWDIGIT(t); - t = u1 * v1 + w2 + HIGHDIGIT(t); - w2 = LOWDIGIT(t); - w1 = HIGHDIGIT(t); - } - - product->high = ASSEMBLE(w1, w2); - product->low = ASSEMBLE(w3, w4); -#endif /* LONG64 else */ -} - -/* -:h2.DLdiv() - Divide Two Longs by One Long, Yielding Two Longs - -Both the dividend and the divisor must be positive. -*/ - -void -DLdiv(doublelong *quotient, /* also where dividend is, originally */ - unsigned long divisor) -{ -#ifdef LONG64 -/* printf("DLdiv(%lx %lx)\n", quotient, divisor); */ - *quotient /= divisor; -/* printf("DLdiv returns %lx\n", *quotient); */ -#else - register unsigned long u1u2 = quotient->high; - register unsigned long u3u4 = quotient->low; - register long u3; /* single digit of dividend */ - register int v1,v2; /* divisor in registers */ - register long t; /* signed copy of u1u2 */ - register int qhat; /* guess at the quotient digit */ - register unsigned long q3q4; /* low two digits of quotient */ - register int shift; /* holds the shift value for normalizing */ - register int j; /* loop variable */ - -/* printf("DLdiv(%x %x, %x)\n", quotient->high, quotient->low, divisor); */ - /* - * Knuth's algorithm works if the dividend is smaller than the - * divisor. We can get to that state quickly: - */ - if (u1u2 >= divisor) { - quotient->high = u1u2 / divisor; - u1u2 %= divisor; - } - else - quotient->high = 0; - - if (divisor <= MAXSHORT) { - - /* - * This is the case where the divisor is contained in one - * 'short'. It is worthwhile making this fast: - */ - u1u2 = ASSEMBLE(u1u2, HIGHDIGIT(u3u4)); - q3q4 = u1u2 / divisor; - u1u2 %= divisor; - u1u2 = ASSEMBLE(u1u2, LOWDIGIT(u3u4)); - quotient->low = ASSEMBLE(q3q4, u1u2 / divisor); - return; - } - - - /* - * At this point the divisor is a true 'long' so we must use - * Knuth's algorithm. - * - * Step D1: Normalize divisor and dividend (this makes our 'qhat' - * guesses more accurate): - */ - for (shift=0; !SIGNBITON(divisor); shift++, divisor <<= 1) { ; } - shift--; - divisor >>= 1; - - if ((u1u2 >> (LONGSIZE - shift)) != 0 && shift != 0) - Abort("DLdiv: dividend too large"); - u1u2 = (u1u2 << shift) + ((shift == 0) ? 0 : u3u4 >> (LONGSIZE - shift)); - u3u4 <<= shift; - - /* - * Step D2: Begin Loop through digits, dividing u1,u2,u3 by v1,v2, - * then shifting U left by 1 digit: - */ - v1 = HIGHDIGIT(divisor); - v2 = LOWDIGIT(divisor); - q3q4 = 0; - u3 = HIGHDIGIT(u3u4); - - for (j=0; j < 2; j++) { - - /* - * Step D3: make a guess (qhat) at the next quotient denominator: - */ - qhat = (HIGHDIGIT(u1u2) == v1) ? MAXSHORT : u1u2 / v1; - /* - * At this point Knuth would have us further refine our - * guess, since we know qhat is too big if - * - * v2 * qhat > ASSEMBLE(u1u2 % v, u3) - * - * That would make sense if u1u2 % v was easy to find, as it - * would be in assembly language. I ignore this step, and - * repeat step D6 if qhat is too big. - */ - - /* - * Step D4: Multiply v1,v2 times qhat and subtract it from - * u1,u2,u3: - */ - u3 -= qhat * v2; - /* - * The high digit of u3 now contains the "borrow" for the - * rest of the substraction from u1,u2. - * Sometimes we can lose the sign bit with the above. - * If so, we have to force the high digit negative: - */ - t = HIGHDIGIT(u3); - if (t > 0) - t |= -1 << SHORTSIZE; - t += u1u2 - qhat * v1; -/* printf("..>divide step qhat=%x t=%x u3=%x u1u2=%x v1=%x v2=%x\n", - qhat, t, u3, u1u2, v1, v2); */ - while (t < 0) { /* Test is Step D5. */ - - /* - * D6: Oops, qhat was too big. Add back in v1,v2 and - * decrease qhat by 1: - */ - u3 = LOWDIGIT(u3) + v2; - t += HIGHDIGIT(u3) + v1; - qhat--; -/* printf("..>>qhat correction t=%x u3=%x qhat=%x\n", t, u3, qhat); */ - } - /* - * Step D7: shift U left one digit and loop: - */ - u1u2 = t; - if (HIGHDIGIT(u1u2) != 0) - Abort("divide algorithm error"); - u1u2 = ASSEMBLE(u1u2, LOWDIGIT(u3)); - u3 = LOWDIGIT(u3u4); - q3q4 = ASSEMBLE(q3q4, qhat); - } - quotient->low = q3q4; -/* printf("DLdiv returns %x %x\n", quotient->high, quotient->low); */ -#endif /* !LONG64 */ - return; -} - -/* -:h3.DLadd() - Add Two Double Longs - -In this case, the doublelongs may be signed. The algorithm takes the -piecewise sum of the high and low longs, with the possibility that the -high should be incremented if there is a carry out of the low. How to -tell if there is a carry? Alex Harbury suggested that if the sum of -the lows is less than the max of the lows, there must have been a -carry. Conversely, if there was a carry, the sum of the lows must be -less than the max of the lows. So, the test is "if and only if". -*/ - -void -DLadd(doublelong *u, /* u = u + v */ - doublelong *v) -{ -#ifdef LONG64 -/* printf("DLadd(%lx %lx)\n", *u, *v); */ - *u = *u + *v; -/* printf("DLadd returns %lx\n", *u); */ -#else - register unsigned long lowmax = MAX(u->low, v->low); - -/* printf("DLadd(%x %x, %x %x)\n", u->high, u->low, v->high, v->low); */ - u->high += v->high; - u->low += v->low; - if (lowmax > u->low) - u->high++; -#endif -} -/* -:h3.DLsub() - Subtract Two Double Longs - -Testing for a borrow is even easier. If the v.low is greater than -u.low, there must be a borrow. -*/ - -void -DLsub(doublelong *u, /* u = u - v */ - doublelong *v) -{ -#ifdef LONG64 -/* printf("DLsub(%lx %lx)\n", *u, *v); */ - *u = *u - *v; -/* printf("DLsub returns %lx\n", *u); */ -#else -/* printf("DLsub(%x %x, %x %x)\n", u->high, u->low, v->high, v->low);*/ - u->high -= v->high; - if (v->low > u->low) - u->high--; - u->low -= v->low; -#endif -} -/* -:h3.DLrightshift() - Macro to Shift Double Long Right by N -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h2.Fractional Pel Arithmetic -*/ -/* -:h3.FPmult() - Multiply Two Fractional Pel Values - -This funtion first calculates w = u * v to "doublelong" precision. -It then shifts w right by FRACTBITS bits, and checks that no -overflow will occur when the resulting value is passed back as -a fractpel. -*/ - -fractpel -FPmult(fractpel u, fractpel v) -{ - doublelong w; - register int negative = FALSE; /* sign flag */ -#ifdef LONG64 - register fractpel ret; -#endif - - if ((u == 0) || (v == 0)) return (0); - - - if (u < 0) {u = -u; negative = TRUE;} - if (v < 0) {v = -v; negative = !negative;} - - if (u == TOFRACTPEL(1)) return ((negative) ? -v : v); - if (v == TOFRACTPEL(1)) return ((negative) ? -u : u); - - DLmult(&w, u, v); - DLrightshift(w, FRACTBITS); -#ifndef LONG64 - if (w.high != 0 || SIGNBITON(w.low)) { - w.low = TOFRACTPEL(MAXSHORT); - } - - return ((negative) ? -w.low : w.low); -#else - if (w & 0xffffffff80000000L ) { - ret = TOFRACTPEL(MAXSHORT); - } - else - ret = (fractpel)w; - - return ((negative) ? -ret : ret); -#endif -} - -/* -:h3.FPdiv() - Divide Two Fractional Pel Values - -These values may be signed. The function returns the quotient. -*/ - -fractpel -FPdiv(fractpel dividend, fractpel divisor) -{ - doublelong w; /* result will be built here */ - int negative = FALSE; /* flag for sign bit */ -#ifdef LONG64 - register fractpel ret; -#endif - - if (dividend < 0) { - dividend = -dividend; - negative = TRUE; - } - if (divisor < 0) { - divisor = -divisor; - negative = !negative; - } -#ifndef LONG64 - w.low = dividend << FRACTBITS; - w.high = dividend >> (LONGSIZE - FRACTBITS); - DLdiv(&w, divisor); - if (w.high != 0 || SIGNBITON(w.low)) { - w.low = TOFRACTPEL(MAXSHORT); - } - return( (negative) ? -w.low : w.low); -#else - w = ((long)dividend) << FRACTBITS; - DLdiv(&w, divisor); - if (w & 0xffffffff80000000L ) { - ret = TOFRACTPEL(MAXSHORT); - } - else - ret = (fractpel)w; - return( (negative) ? -ret : ret); -#endif -} - -/* -:h3.FPstarslash() - Multiply then Divide - -Borrowing a chapter from the language Forth, it is useful to define -an operator that first multiplies by one constant then divides by -another, keeping the intermediate result in extended precision. -*/ - -fractpel -FPstarslash(fractpel a, /* result = a * b / c */ - fractpel b, - fractpel c) -{ - doublelong w; /* result will be built here */ - int negative = FALSE; -#ifdef LONG64 - register fractpel ret; -#endif - - if (a < 0) { a = -a; negative = TRUE; } - if (b < 0) { b = -b; negative = !negative; } - if (c < 0) { c = -c; negative = !negative; } - - DLmult(&w, a, b); - DLdiv(&w, c); -#ifndef LONG64 - if (w.high != 0 || SIGNBITON(w.low)) { - w.low = TOFRACTPEL(MAXSHORT); - } - return((negative) ? -w.low : w.low); -#else - if (w & 0xffffffff80000000L ) { - ret = TOFRACTPEL(MAXSHORT); - } - else - ret = (fractpel)w; - return( (negative) ? -ret : ret); -#endif -} diff --git a/nx-X11/lib/font/Type1/arith.h b/nx-X11/lib/font/Type1/arith.h deleted file mode 100644 index 6c810b946..000000000 --- a/nx-X11/lib/font/Type1/arith.h +++ /dev/null @@ -1,77 +0,0 @@ -/* $Xorg: arith.h,v 1.3 2000/08/17 19:46:29 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/arith.h,v 1.4 1999/08/21 13:47:39 dawes Exp $ */ - -/*SHARED*/ - -#include /* LONG64 */ - -/*END SHARED*/ -/*SHARED*/ - -#undef SHORTSIZE -#define SHORTSIZE (sizeof(short)*8) -#undef LONGSIZE -#define LONGSIZE (SHORTSIZE*2) -#undef MAXSHORT -#define MAXSHORT ((1<>= (N)) -#else -#define DLrightshift(dl,N) { \ - dl.low = (dl.low >> N) + (((unsigned long) dl.high) << (LONGSIZE - N)); \ - dl.high >>= N; \ -} -#endif - -extern void DLmult ( doublelong *product, unsigned long u, unsigned long v ); -extern void DLdiv ( doublelong *quotient, unsigned long divisor ); -extern void DLadd ( doublelong *u, doublelong *v ); -extern void DLsub ( doublelong *u, doublelong *v ); -extern fractpel FPmult ( fractpel u, fractpel v ); -extern fractpel FPdiv ( fractpel dividend, fractpel divisor ); -extern fractpel FPstarslash ( fractpel a, fractpel b, fractpel c ); - -/*END SHARED*/ diff --git a/nx-X11/lib/font/Type1/blues.h b/nx-X11/lib/font/Type1/blues.h deleted file mode 100644 index 88602f79e..000000000 --- a/nx-X11/lib/font/Type1/blues.h +++ /dev/null @@ -1,95 +0,0 @@ -/* $Xorg: blues.h,v 1.3 2000/08/17 19:46:29 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * Portions Copyright (c) 1990 Adobe Systems Incorporated. - * All Rights Reserved - * - * License 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 IBM or Lexmark or Adobe - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. - * - * IBM, LEXMARK, AND ADOBE PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY - * WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE - * ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING - * ANY DUTY TO SUPPORT OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY - * PORTION OF THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM, - * LEXMARK, OR ADOBE) ASSUMES THE ENTIRE COST OF ALL SERVICING, REPAIR AND - * CORRECTION. IN NO EVENT SHALL IBM, LEXMARK, OR ADOBE BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/blues.h,v 1.3 1999/08/22 08:58:49 dawes Exp $ */ - - -extern psobj *GetType1CharString ( psfont *fontP, unsigned char code ); - -#define TOPLEFT 1 -#define BOTTOMRIGHT 2 - -#define NUMBLUEVALUES 14 -#define NUMOTHERBLUES 10 -#define NUMFAMILYBLUES 14 -#define NUMFAMILYOTHERBLUES 10 -#define NUMSTEMSNAPH 12 -#define NUMSTEMSNAPV 12 -#define NUMSTDHW 1 -#define NUMSTDVW 1 - -#define DEFAULTBOLDSTEMWIDTH 2.0 - -#define MAXALIGNMENTZONES ((NUMBLUEVALUES+NUMOTHERBLUES)/2) -#define DEFAULTBLUESCALE 0.039625 -#define DEFAULTBLUESHIFT 7 -#define DEFAULTBLUEFUZZ 1 -#define DEFAULTSTDHW 0 -#define DEFAULTSTDVW 0 -#define DEFAULTFORCEBOLD FALSE -#define DEFAULTLANGUAGEGROUP 0 -#define DEFAULTRNDSTEMUP FALSE -#define DEFAULTLENIV 4 -#define DEFAULTEXPANSIONFACTOR 0.06 - -/* see Type 1 Font Format book for explanations of these values */ -/* Note that we're currently doing nothing for minfeature and password. */ -struct blues_struct { - struct blues_struct *next; /* ptr to next Blues structure in list */ - int numBlueValues; /* # of BlueValues in following array */ - int BlueValues[NUMBLUEVALUES]; - int numOtherBlues; /* # of OtherBlues values in following array */ - int OtherBlues[NUMOTHERBLUES]; - int numFamilyBlues; /* # of FamilyBlues values in following array */ - int FamilyBlues[NUMFAMILYBLUES]; - int numFamilyOtherBlues; /* # of FamilyOtherBlues values in */ - int FamilyOtherBlues[NUMFAMILYOTHERBLUES]; /* this array */ - double BlueScale; - int BlueShift; - int BlueFuzz; - double StdHW; - double StdVW; - int numStemSnapH; /* # of StemSnapH values in following array */ - double StemSnapH[NUMSTEMSNAPH]; - int numStemSnapV; /* # of StemSnapV values in following array */ - double StemSnapV[NUMSTEMSNAPV]; - int ForceBold; - int LanguageGroup; - int RndStemUp; - int lenIV; - double ExpansionFactor; -}; - -/* the alignment zone structure -- somewhat similar to the stem structure */ -/* see Adobe Type1 Font Format book about the terms used in this structure */ -struct alignmentzone { - int topzone; /* TRUE if a topzone, FALSE if a bottom zone */ - double bottomy, topy; /* interval of this alignment zone */ -}; diff --git a/nx-X11/lib/font/Type1/cidchar.c b/nx-X11/lib/font/Type1/cidchar.c deleted file mode 100644 index 20d26650c..000000000 --- a/nx-X11/lib/font/Type1/cidchar.c +++ /dev/null @@ -1,621 +0,0 @@ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/cidchar.c,v 1.9tsi Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#if XFONT_CID -#ifndef FONTMODULE -#include -#include -#include -#ifdef USE_MMAP -#include -#ifndef MAP_FAILED -#define MAP_FAILED ((caddr_t)(-1)) -#endif -#endif -#else -#include "Xmd.h" /* For INT32 declaration */ -#include "Xdefs.h" /* For Bool */ -#include "xf86_ansic.h" -#endif -#ifndef FONTMODULE -#ifdef _XOPEN_SOURCE -#include -#else -#define _XOPEN_SOURCE -#include -#undef _XOPEN_SOURCE -#endif -#endif -#include -#include "objects.h" -#include "spaces.h" -#include "range.h" -#include "util.h" -#include "fontfcn.h" -#include "blues.h" -#include "AFM.h" -#include "t1intf.h" - -#define BSIZE 4096 - -extern cidfont *CIDFontP; -extern psfont *FDArrayP; -extern psfont *FontP; - -static unsigned char sd[] = "StartData"; - -CharInfoPtr -CIDGetGlyphInfo(FontPtr pFont, unsigned int cidcode, CharInfoPtr pci, int *rc) -{ - CharInfoPtr cp = NULL; -#ifdef USE_MMAP - int fd; - unsigned char *buf; - long total_len = 0; -#else - FILE *fp; - unsigned char buf[BSIZE]; - unsigned int count = 0; -#endif - cidglyphs *cid; - unsigned char *p1 = NULL; -#ifndef USE_MMAP - unsigned char *p2; -#endif - register int i = 0, j; - long byteoffset; - int FDindex, FDBytes, GDBytes, SDBytes, SubrCount, CIDMapOffset, len; - psobj *arrayP; - psobj charstring; - long *subroffsets = NULL, cstringoffset, nextcstringoffset; - struct blues_struct *blues; - - cid = (cidglyphs *)pFont->fontPrivate; - -#ifdef USE_MMAP - if (!cid->CIDdata) { - if (!(fd = open(cid->CIDFontName, O_RDONLY, 0))) { - *rc = BadFontName; - return(cp); - } - cid->CIDsize = lseek(fd, 0, SEEK_END); - cid->CIDdata = (unsigned char *) - mmap(0, (size_t)cid->CIDsize, PROT_READ, MAP_SHARED, fd, 0); - close(fd); - if (cid->CIDdata == (unsigned char *)MAP_FAILED) { - *rc = AllocError; - cid->CIDdata = NULL; - return (cp); - } - } -#else - if (!(fp = fopen(cid->CIDFontName,"rb"))) { - *rc = BadFontName; - return(cp); - } -#endif - -#ifdef USE_MMAP - if (cid->dataoffset == 0) { - if ((p1 = (unsigned char *)strstr((char *)cid->CIDdata, (char *)sd)) - != NULL) { - cid->dataoffset = (p1 - cid->CIDdata) + strlen((char *)sd); - } - else { - *rc = BadFontFormat; - return(cp); - } - } -#else /* USE_MMAP */ - if (cid->dataoffset == 0) { - p2 = sd; - - /* find "StartData" */ - while (*p2) { - cid->dataoffset += count; - if ((count = fread(buf, 1, BSIZE, fp)) == 0) - break; - p1 = buf; - for (i=0; i < count && *p2; i++) { - if (*p1 == *p2) - p2++; - else { - p2 = sd; - if (*p1 == *p2) - p2++; - } - p1++; - } - } - - /* if "StartData" not found, or end of file */ - if (*p2 || count == 0) { - *rc = BadFontFormat; - fclose(fp); - return(cp); - } - - if (i >= count) { - cid->dataoffset += count; - count = fread(buf, 1, BSIZE, fp); - p1 = buf; - } else { - cid->dataoffset += p1 - buf; - count = count - (p1 - buf); - } - } else { - if (fseek(fp, cid->dataoffset, SEEK_SET)) { - *rc = BadFontFormat; - fclose(fp); - return(cp); - } - if ((count = fread(buf, 1, BSIZE, fp)) == 0) { - *rc = BadFontFormat; - fclose(fp); - return(cp); - } - p1 = buf; - } - - /* if "StartData" not found, or "Binary" data and the next character */ - /* is not the space character (0x20) */ - - if (count == 0 || (CIDFontP->binarydata && (*p1 != ' '))) { - *rc = BadFontFormat; - fclose(fp); - return(cp); - } -#endif /* USE_MMAP */ - - FDBytes = CIDFontP->CIDfontInfoP[CIDFDBYTES].value.data.integer; - GDBytes = CIDFontP->CIDfontInfoP[CIDGDBYTES].value.data.integer; - CIDMapOffset = CIDFontP->CIDfontInfoP[CIDMAPOFFSET].value.data.integer; - byteoffset = cid->dataoffset + 1 + CIDMapOffset + - cidcode * (FDBytes + GDBytes); -#ifdef USE_MMAP - buf = &cid->CIDdata[byteoffset]; -#else - if (fseek(fp, byteoffset, SEEK_SET)) { - *rc = BadFontFormat; - fclose(fp); - return(cp); - } - if ((count = fread(buf, 1, BSIZE, fp)) < 2*(FDBytes + GDBytes)) { - *rc = BadFontFormat; - fclose(fp); - return(cp); - } -#endif - - /* if FDBytes is equal to 0, the CIDMap contains no FD indices, and the */ - /* FD index of 0 is assumed. */ - if (FDBytes == 0) - FDindex = 0; - else { - FDindex = 0; - for (i = 0; i < FDBytes; i++) - FDindex += (unsigned char)buf[i] << (8 * (FDBytes - 1 - i)); - } - - if (FDindex >= CIDFontP->CIDfontInfoP[CIDFDARRAY].value.len) { - *rc = BadFontFormat; -#ifndef USE_MMAP - fclose(fp); -#endif - return(cp); - } - - cstringoffset = 0; - for (i = 0; i < GDBytes; i++) - cstringoffset += (unsigned char)buf[FDBytes + i] << - (8 * (GDBytes - 1 - i)); - - nextcstringoffset = 0; - for (i = 0; i < GDBytes; i++) - nextcstringoffset += (unsigned char)buf[2*FDBytes + GDBytes + i] << - (8 * (GDBytes - 1 - i)); - - len = nextcstringoffset - cstringoffset; - - if (len <= 0) { /* empty interval, missing glyph */ - *rc = BadFontFormat; -#ifndef USE_MMAP - fclose(fp); -#endif - return(cp); - } - - FontP = &FDArrayP[FDindex]; - - charstring.type = OBJ_INTEGER; - charstring.len = len; - -#ifndef USE_MMAP - if (!(charstring.data.stringP = (unsigned char *)xalloc(len))) { - *rc = AllocError; - fclose(fp); - return(cp); - } -#endif - - byteoffset = cid->dataoffset + 1 + cstringoffset; - -#ifdef USE_MMAP - charstring.data.stringP = &cid->CIDdata[byteoffset]; -#else - if (fseek(fp, byteoffset, SEEK_SET)) { - *rc = BadFontFormat; - xfree(charstring.data.stringP); - fclose(fp); - return(cp); - } - - if ((count = fread(charstring.data.stringP, 1, len, fp)) != len) { - *rc = BadFontFormat; - xfree(charstring.data.stringP); - fclose(fp); - return(cp); - } -#endif - - if (FontP->Subrs.data.arrayP == NULL) { - /* get subroutine data */ - byteoffset = cid->dataoffset + 1 + - FDArrayP[FDindex].Private[CIDT1SUBMAPOFF].value.data.integer; - - SDBytes = FDArrayP[FDindex].Private[CIDT1SDBYTES].value.data.integer; - - SubrCount = FDArrayP[FDindex].Private[CIDT1SUBRCNT].value.data.integer; -#ifdef USE_MMAP - buf = &cid->CIDdata[byteoffset]; -#else - if (fseek(fp, byteoffset, SEEK_SET)) { - *rc = BadFontFormat; - fclose(fp); - return(cp); - } - - if ((count = fread(buf, 1, BSIZE, fp)) < SDBytes * (SubrCount + 1)) { - *rc = BadFontFormat; - fclose(fp); - return(cp); - } -#endif - - arrayP = (psobj *)vm_alloc(SubrCount*sizeof(psobj)); - if (!arrayP) { - *rc = AllocError; -#ifndef USE_MMAP - fclose(fp); -#endif - return(cp); - } - - if (!(subroffsets = (long *)xalloc((SubrCount + 1)*sizeof(long)))) { - *rc = AllocError; -#ifndef USE_MMAP - fclose(fp); -#endif - return(cp); - } - - for (i = 0; i <= SubrCount; i++) { - subroffsets[i] = 0; - for (j = 0; j < SDBytes; j++) - subroffsets[i] += (unsigned char)buf[i * SDBytes + j] << - (8 * (SDBytes - 1 - j)); - } - - byteoffset = cid->dataoffset + 1 + subroffsets[0]; - - /* get subroutine info */ -#ifndef USE_MMAP - if (fseek(fp, byteoffset, SEEK_SET)) { - *rc = BadFontFormat; - xfree(subroffsets); - fclose(fp); - return(cp); - } -#else - total_len = byteoffset; -#endif - for (i = 0; i < SubrCount; i++) { - len = subroffsets[i + 1] - subroffsets[i]; -#ifndef USE_MMAP - arrayP[i].data.valueP = vm_alloc(len); - if (!arrayP[i].data.valueP) { - *rc = AllocError; - xfree(subroffsets); - fclose(fp); - return(cp); - } -#endif - arrayP[i].len = len; -#ifdef USE_MMAP - arrayP[i].data.valueP = (char *)&cid->CIDdata[total_len]; - total_len += len; -#else - if ((count = fread(arrayP[i].data.valueP, 1, len, fp)) != len) { - *rc = BadFontFormat; - xfree(subroffsets); - fclose(fp); - return(cp); - } -#endif - } - - FontP->Subrs.len = SubrCount; - FontP->Subrs.data.arrayP = arrayP; - xfree(subroffsets); - } - - if (FontP->BluesP == NULL) { - blues = (struct blues_struct *) vm_alloc(sizeof(struct blues_struct)); - if (!blues) { - *rc = AllocError; -#ifndef USE_MMAP - xfree(subroffsets); - fclose(fp); -#endif - return(cp); - } - bzero(blues, sizeof(struct blues_struct)); - blues->numBlueValues = - FDArrayP[FDindex].Private[CIDT1BLUEVALUES].value.len; - for (i = 0; i < blues->numBlueValues; i++) - blues->BlueValues[i] = - FDArrayP[FDindex].Private[CIDT1BLUEVALUES].value.data.arrayP[i].data.integer; - blues->numOtherBlues = - FDArrayP[FDindex].Private[CIDT1OTHERBLUES].value.len; - for (i = 0; i < blues->numOtherBlues; i++) - blues->OtherBlues[i] = - FDArrayP[FDindex].Private[CIDT1OTHERBLUES].value.data.arrayP[i].data.integer; - blues->numFamilyBlues = - FDArrayP[FDindex].Private[CIDT1FAMBLUES].value.len; - for (i = 0; i < blues->numFamilyBlues; i++) - blues->FamilyBlues[i] = - FDArrayP[FDindex].Private[CIDT1FAMBLUES].value.data.arrayP[i].data.integer; - blues->numFamilyOtherBlues = - FDArrayP[FDindex].Private[CIDT1FAMOTHERBLUES].value.len; - for (i = 0; i < blues->numFamilyOtherBlues; i++) - blues->FamilyOtherBlues[i] = - FDArrayP[FDindex].Private[CIDT1FAMOTHERBLUES].value.data.arrayP[i].data.integer; - blues->BlueScale = FDArrayP[FDindex].Private[CIDT1BLUESCALE].value.data.real; - blues->BlueShift = FDArrayP[FDindex].Private[CIDT1BLUESHIFT].value.data.integer; - blues->BlueFuzz = FDArrayP[FDindex].Private[CIDT1BLUEFUZZ].value.data.integer; - blues->StdHW = (double)FDArrayP[FDindex].Private[CIDT1STDHW].value.data.arrayP[0].data.integer; - blues->StdVW = (double)FDArrayP[FDindex].Private[CIDT1STDVW].value.data.arrayP[0].data.integer; - - blues->numStemSnapH = - FDArrayP[FDindex].Private[CIDT1STEMSNAPH].value.len; - for (i = 0; i < blues->numStemSnapH; i++) - blues->StemSnapH[i] = - FDArrayP[FDindex].Private[CIDT1STEMSNAPH].value.data.arrayP[i].data.integer; - blues->numStemSnapV = - FDArrayP[FDindex].Private[CIDT1STEMSNAPV].value.len; - for (i = 0; i < blues->numStemSnapV; i++) - blues->StemSnapV[i] = - FDArrayP[FDindex].Private[CIDT1STEMSNAPV].value.data.arrayP[i].data.integer; - blues->ForceBold = - FDArrayP[FDindex].Private[CIDT1FORCEBOLD].value.data.boolean; - - blues->LanguageGroup = - FDArrayP[FDindex].Private[CIDT1LANGGROUP].value.data.integer; - - blues->RndStemUp = - FDArrayP[FDindex].Private[CIDT1RNDSTEMUP].value.data.boolean; - - blues->lenIV = - FDArrayP[FDindex].Private[CIDT1LENIV].value.data.integer; - - blues->ExpansionFactor = - FDArrayP[FDindex].Private[CIDT1EXPFACTOR].value.data.real; - - FontP->BluesP = blues; - } - - cp = CIDRenderGlyph(pFont, &charstring, &FontP->Subrs, FontP->BluesP, pci, rc); - -#ifndef USE_MMAP - xfree(charstring.data.stringP); - - fclose(fp); -#endif - return(cp); -} - -static int -node_compare(const void *node1, const void *node2) -{ - return (((Metrics *)node1)->code - ((Metrics *)node2)->code); -} - -static CharInfoRec * -CIDGetCharMetrics(FontPtr pFont, FontInfo *fi, unsigned int charcode, double sxmult) -{ - CharInfoPtr cp; - Metrics *p, node; - unsigned int cidcode; - - cidcode = node.code = getCID(pFont, charcode); - if ((cidcode < fi->nChars) && (cidcode == fi->metrics[cidcode].code)) - p = &fi->metrics[cidcode]; - else - p = (Metrics *)bsearch(&node, fi->metrics, fi->nChars, sizeof(Metrics), node_compare); - - if (!p) - p = &fi->metrics[0]; - - if (!(cp = (CharInfoRec *)Xalloc(sizeof(CharInfoRec)))) - return NULL; - bzero(cp, sizeof(CharInfoRec)); - - /* indicate that character bitmap is not defined */ - cp->bits = (char *)CID_BITMAP_UNDEFINED; - - - /* get metric data for this CID code from the CID AFM file */ - cp->metrics.leftSideBearing = - floor(p->charBBox.llx / sxmult + 0.5); - cp->metrics.rightSideBearing = - floor(p->charBBox.urx / sxmult + 0.5); - cp->metrics.characterWidth = floor(p->wx / sxmult + 0.5); - cp->metrics.ascent = floor(p->charBBox.ury / sxmult + 0.5); - cp->metrics.descent = -floor(p->charBBox.lly / sxmult + 0.5); - - cp->metrics.attributes = p->wx; - - return cp; -} - -int -CIDGetAFM(FontPtr pFont, unsigned long count, unsigned char *chars, FontEncoding charEncoding, unsigned long *glyphCount, CharInfoPtr *glyphs, char *cidafmfile) -{ - FILE *fp; - FontInfo *fi = NULL; - cidglyphs *cid; - CharInfoPtr *glyphsBase; - register unsigned int c; - - register CharInfoPtr pci; - CharInfoPtr pDefault; - unsigned int firstCol, code, char_row, char_col; - double sxmult; - - cid = (cidglyphs *)pFont->fontPrivate; - - if (cid->AFMinfo == NULL) { - if (!(fp = fopen(cidafmfile, "rb"))) - return(BadFontName); - - if (CIDAFM(fp, &fi) != 0) { - fprintf(stderr, - "There is something wrong with Adobe Font Metric file %s.\n", - cidafmfile); - fclose(fp); - return(BadFontName); - } - fclose(fp); - cid->AFMinfo = fi; - } - fi = cid->AFMinfo; - - firstCol = pFont->info.firstCol; - pDefault = cid->pDefault; - glyphsBase = glyphs; - - /* multiplier for computation of raw values */ - sxmult = hypot(cid->pixel_matrix[0], cid->pixel_matrix[1]); - if (sxmult > EPS) sxmult = 1000.0 / sxmult; - if (sxmult == 0.0) return(0); - - switch (charEncoding) { - -#define EXIST(pci) \ - ((pci)->metrics.attributes || \ - (pci)->metrics.ascent != -(pci)->metrics.descent || \ - (pci)->metrics.leftSideBearing != (pci)->metrics.rightSideBearing) - - case Linear8Bit: - case TwoD8Bit: - if (pFont->info.firstRow > 0) - break; - while (count--) { - c = (*chars++); - if (c >= firstCol && c <= pFont->info.lastCol) { - code = c - firstCol; - if (!(pci = (CharInfoRec *)cid->glyphs[code])) - pci = CIDGetCharMetrics(pFont, fi, c, sxmult); - if (pci && EXIST(pci)) { - *glyphs++ = pci; - cid->glyphs[code] = pci; - } - } else if (pDefault) - *glyphs++ = pDefault; - } - break; - case Linear16Bit: - while (count--) { - char_row = *chars++; - char_col = *chars++; - c = char_row << 8; - c = (c | char_col); - if (pFont->info.firstRow <= char_row && char_row <= - pFont->info.lastRow && pFont->info.firstCol <= char_col && - char_col <= pFont->info.lastCol) { - code = pFont->info.lastCol - pFont->info.firstCol + 1; - char_row = char_row - pFont->info.firstRow; - char_col = char_col - pFont->info.firstCol; - code = char_row * code + char_col; - if (!(pci = (CharInfoRec *)cid->glyphs[code])) - pci = CIDGetCharMetrics(pFont, fi, c, sxmult); - if (pci && EXIST(pci)) { - *glyphs++ = pci; - cid->glyphs[code] = pci; - } else if (pDefault) { - *glyphs++ = pDefault; - cid->glyphs[code] = pDefault; - } - } else if (pDefault) - *glyphs++ = pDefault; - } - break; - - case TwoD16Bit: - while (count--) { - char_row = (*chars++); - char_col = (*chars++); - c = char_row << 8; - c = (c | char_col); - if (pFont->info.firstRow <= char_row && char_row <= - pFont->info.lastRow && pFont->info.firstCol <= char_col && - char_col <= pFont->info.lastCol) { - code = pFont->info.lastCol - pFont->info.firstCol + 1; - char_row = char_row - pFont->info.firstRow; - char_col = char_col - pFont->info.firstCol; - code = char_row * code + char_col; - if (!(pci = (CharInfoRec *)cid->glyphs[code])) - pci = CIDGetCharMetrics(pFont, fi, c, sxmult); - if (pci && EXIST(pci)) { - *glyphs++ = pci; - cid->glyphs[code] = pci; - } else if (pDefault) { - *glyphs++ = pDefault; - cid->glyphs[code] = pDefault; - } - } else if (pDefault) - *glyphs++ = pDefault; - } - break; - } - *glyphCount = glyphs - glyphsBase; - -#undef EXIST - - return Successful; - -} -#endif diff --git a/nx-X11/lib/font/Type1/cluts.h b/nx-X11/lib/font/Type1/cluts.h deleted file mode 100644 index 67d930324..000000000 --- a/nx-X11/lib/font/Type1/cluts.h +++ /dev/null @@ -1,35 +0,0 @@ -/* $Xorg: cluts.h,v 1.3 2000/08/17 19:46:29 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM 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. - */ -/* STUB */ - -#define KillCLUT(T) -#define CopyCLUT(T) T -#define UniqueCLUT(T) - diff --git a/nx-X11/lib/font/Type1/curves.c b/nx-X11/lib/font/Type1/curves.c deleted file mode 100644 index 9d0c3f8cc..000000000 --- a/nx-X11/lib/font/Type1/curves.c +++ /dev/null @@ -1,228 +0,0 @@ -/* $Xorg: curves.c,v 1.3 2000/08/17 19:46:29 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 */ -/* All Rights Reserved */ - -/* License to use, copy, modify, and distribute this software */ -/* and its documentation for any purpose and without fee is */ -/* hereby granted, provided that licensee provides a license to */ -/* IBM, Corp. to use, copy, modify, and distribute derivative */ -/* works and their documentation for any purpose and without */ -/* fee, 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 IBM not be used in advertising or publicity pertaining to */ -/* distribution of the software without specific, written prior */ -/* permission. */ - -/* IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES */ -/* OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT */ -/* LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, */ -/* FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF */ -/* THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND */ -/* PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT */ -/* OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF */ -/* THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES */ -/* THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN */ -/* NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR */ -/* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING */ -/* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF */ -/* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT */ -/* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS */ -/* SOFTWARE. */ -/* $XFree86: xc/lib/font/Type1/curves.c,v 1.7 2001/08/27 19:49:52 dawes Exp $ */ - -/* -:h1.CURVES Module - Stepping Beziers - -This module is responsible for "rasterizing" -third order curves. That is, it changes the high level curve -specification into a list of pels that that curve travels -through. - -:h3.Include Files - -Include files needed: -*/ -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef FONTMODULE -# include "os.h" -#endif -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "regions.h" -#include "curves.h" -#include "lines.h" -#include "arith.h" - - -/* -:h3.Functions Provided to Other Modules - -External entry points: -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -Note that "stepping" and "flattening" are so similiar that they use the -same routine. When the "region" parameter is NULL, that is a flag that -we are flattening instead of stepping. -*/ -/* -:h2.Bezier Third Order Curves -*/ -/* -:h3.The "bezierinfo" Structure - -This structure is used to store information used when we subdivide -Bezier curves. -*/ - -struct bezierinfo { - struct region *region; /* the region being built or NULL */ - struct fractpoint last; /* not used yet; maybe could save some work */ - struct fractpoint origin; /* the origin of the bezier */ -} ; - -/* - Checking for termination of the subdivision process: - This is the stupidest test in the world, just check if the coordinatewise - distance from an end control point to the next control point is less than - one half pel. If so, we must be done. - This returns 1 if the subdivision is terminated and 0 if you still need - to subdivide. -*/ - -static int -BezierTerminationTest(fractpel xa, fractpel ya, - fractpel xb, fractpel yb, - fractpel xc, fractpel yc, - fractpel xd, fractpel yd) -{ - fractpel dmax; - dmax = ABS(xa - xb); - dmax = MAX(dmax,ABS(ya - yb)); - dmax = MAX(dmax,ABS(xd - xc)); - dmax = MAX(dmax,ABS(yd - yc)); - if(dmax > FPHALF) - return(0); /* not done yet */ - else - return(1); /* done */ -} - -/* -:h3.StepBezierRecurse() - The Recursive Logic in StepBezier() - -The recursion involves dividing the control polygon into two smaller -control polygons by finding the midpoints of the lines. This idea is -described in any graphics text book and its simplicity is what caused -Bezier to define his curves as he did. If the input region 'R' is NULL, -the result is a path that is the 'flattened' curve; otherwise StepBezier -returns nothing special. -*/ -static struct segment * -StepBezierRecurse(struct bezierinfo *I, /* Region under construction or NULL */ - fractpel xA, fractpel yA, /* A control point */ - fractpel xB, fractpel yB, /* B control point */ - fractpel xC, fractpel yC, /* C control point */ - fractpel xD, fractpel yD) /* D control point */ -{ - if (BezierTerminationTest(xA,yA,xB,yB,xC,yC,xD,yD)) - { - if (I->region == NULL) - return(PathSegment(LINETYPE, xD - xA, yD - yA)); - else - StepLine(I->region, I->origin.x + xA, I->origin.y + yA, - I->origin.x + xD, I->origin.y + yD); - } - else - { - fractpel xAB,yAB; - fractpel xBC,yBC; - fractpel xCD,yCD; - fractpel xABC,yABC; - fractpel xBCD,yBCD; - fractpel xABCD,yABCD; - - xAB = xA + xB; yAB = yA + yB; - xBC = xB + xC; yBC = yB + yC; - xCD = xC + xD; yCD = yC + yD; - - xABC = xAB + xBC; yABC = yAB + yBC; - xBCD = xBC + xCD; yBCD = yBC + yCD; - - xABCD = xABC + xBCD; yABCD = yABC + yBCD; - - xAB >>= 1; yAB >>= 1; - xBC >>= 1; yBC >>= 1; - xCD >>= 1; yCD >>= 1; - xABC >>= 2; yABC >>= 2; - xBCD >>= 2; yBCD >>= 2; - xABCD >>= 3; yABCD >>= 3; - - if (I->region == NULL) - { - return( Join( - StepBezierRecurse(I, xA, yA, xAB, yAB, xABC, yABC, xABCD, yABCD), - StepBezierRecurse(I, xABCD, yABCD, xBCD, yBCD, xCD, yCD, xD, yD) - ) - ); - } - else - { - StepBezierRecurse(I, xA, yA, xAB, yAB, xABC, yABC, xABCD, yABCD); - StepBezierRecurse(I, xABCD, yABCD, xBCD, yBCD, xCD, yCD, xD, yD); - } - } - return NULL; - /*NOTREACHED*/ -} - -/* -:h3.TOOBIG() - Macro to Test if a Coordinate is Too Big to Bezier SubDivide Normally - -Intermediate values in the Bezier subdivision are 8 times bigger than -the starting values. If this overflows, a 'long', we are in trouble: -*/ - -#undef BITS -#define BITS (sizeof(long)*8) -#define HIGHTEST(p) (((p)>>(BITS-4)) != 0) /* includes sign bit */ -#define TOOBIG(xy) ((xy < 0) ? HIGHTEST(-xy) : HIGHTEST(xy)) - -/* -:h3.StepBezier() - Produce Run Ends for a Bezier Curve - -This is the entry point called from outside the module. -*/ - -struct segment * -StepBezier(struct region *R, /* Region under construction or NULL */ - fractpel xA, fractpel yA, /* A control point */ - fractpel xB, fractpel yB, /* B control point */ - fractpel xC, fractpel yC, /* C control point */ - fractpel xD, fractpel yD) /* D control point */ -{ - struct bezierinfo Info; - - Info.region = R; - Info.origin.x = xA; - Info.origin.y = yA; - - xB -= xA; - xC -= xA; - xD -= xA; - yB -= yA; - yC -= yA; - yD -= yA; - - if ( TOOBIG(xB) || TOOBIG(yB) || TOOBIG(xC) || TOOBIG(yC) - || TOOBIG(xD) || TOOBIG(yD) ) - Abort("Beziers this big not yet supported"); - - return(StepBezierRecurse(&Info, - (fractpel) 0, (fractpel) 0, xB, yB, xC, yC, xD, yD)); -} - diff --git a/nx-X11/lib/font/Type1/curves.h b/nx-X11/lib/font/Type1/curves.h deleted file mode 100644 index ca54bad62..000000000 --- a/nx-X11/lib/font/Type1/curves.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $Xorg: curves.h,v 1.3 2000/08/17 19:46:29 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/curves.h,v 1.3 1999/08/22 08:58:50 dawes Exp $ */ - -/*SHARED*/ - -#define StepConic(R,xA,yA,xB,yB,xC,yC,r) t1_StepConic(R,xA,yA,xB,yB,xC,yC,r) -#define StepBezier(R,xA,yA,xB,yB,xC,yC,xD,yD) t1_StepBezier(R,xA,yA,xB,yB,xC,yC,xD,yD) - -#define FlattenConic(xM,yM,xC,yC,r) t1_StepConic(NULL,(fractpel)0,(fractpel)0,xM,yM,xC,yC,r) -#define FlattenBezier(xB,yB,xC,yC,xD,yD) t1_StepBezier(NULL,(fractpel)0,(fractpel)0,xB,yB,xC,yC,xD,yD) - -#if 0 -struct segment *t1_StepConic(); -#endif -extern struct segment *t1_StepBezier ( struct region *R, fractpel xA, fractpel yA, fractpel xB, fractpel yB, fractpel xC, fractpel yC, fractpel xD, fractpel yD ); - -/*END SHARED*/ diff --git a/nx-X11/lib/font/Type1/digit.h b/nx-X11/lib/font/Type1/digit.h deleted file mode 100644 index c69380954..000000000 --- a/nx-X11/lib/font/Type1/digit.h +++ /dev/null @@ -1,64 +0,0 @@ -/* $Xorg: digit.h,v 1.3 2000/08/17 19:46:29 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM 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. - */ -/* -------------------------------------- */ -/* --- MACHINE GENERATED, DO NOT EDIT --- */ -/* -------------------------------------- */ - -#ifndef DIGIT -#define DIGIT 1 - -/* - * Digit Value Table -- - * - * The entries in the Digit Value Table map character - * codes in the set {0-9,a-z,A-Z} to their numeric - * values as part of numbers of radix 2-36. - * - */ -unsigned char digit_value[256] = { -0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18, - 0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18, - 0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF -}; - -#endif diff --git a/nx-X11/lib/font/Type1/fontfcn.c b/nx-X11/lib/font/Type1/fontfcn.c deleted file mode 100644 index 9b48b9834..000000000 --- a/nx-X11/lib/font/Type1/fontfcn.c +++ /dev/null @@ -1,709 +0,0 @@ -/* $Xorg: fontfcn.c,v 1.4 2000/08/17 19:46:30 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* Author: Katherine A. Hitchcock IBM Almaden Research Laboratory */ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/fontfcn.c,v 1.10 2001/04/05 17:42:27 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#ifndef FONTMODULE -#include -#include -#else -#include "Xmd.h" /* For INT32 declaration */ -#include "Xdefs.h" /* For Bool */ -#include "xf86_ansic.h" -#endif -#include "t1imager.h" -#include "util.h" -#if XFONT_CID -#include "range.h" -#include -#endif -#include -#include "fontfcn.h" - -extern struct segment *Type1Char ( char *env, XYspace S, - psobj *charstrP, psobj *subrsP, - psobj *osubrsP, - struct blues_struct *bluesP, int *modeP ); - -#if XFONT_CID -extern struct xobject *CIDChar ( char *env, XYspace S, - psobj *charstrP, psobj *subrsP, - psobj *osubrsP, - struct blues_struct *bluesP, int *modeP ); -static boolean initCIDFont( int cnt ); -#endif - -/***================================================================***/ -/* GLOBALS */ -/***================================================================***/ -char CurFontName[120]; -char *CurFontEnv; -char *vm_base = NULL; -psfont *FontP = NULL; -psfont TheCurrentFont; -#if XFONT_CID -char CurCIDFontName[CID_PATH_MAX]; -char CurCMapName[CID_PATH_MAX]; -cidfont *CIDFontP = NULL; -cmapres *CMapP = NULL; -cidfont TheCurrentCIDFont; -cmapres TheCurrentCMap; -psfont *FDArrayP = NULL; -int FDArrayIndex = 0; -#endif - -/***================================================================***/ -/* SearchDict - look for name */ -/* - compare for match on len and string */ -/* return 0 - not found. */ -/* return n - nth element in dictionary. */ -/***================================================================***/ -int -SearchDictName(psdict *dictP, psobj *keyP) -{ - int i,n; - - - n = dictP[0].key.len; - for (i=1;i<=n;i++) { /* scan the intire dictionary */ - if ( - (dictP[i].key.len == keyP->len ) - && - (strncmp(dictP[i].key.data.valueP, - keyP->data.valueP, - keyP->len) == 0 - ) - ) return(i); - } - return(0); -} - -#if XFONT_CID -static boolean -initCIDFont(int cnt) -{ - if (!(vm_init(cnt))) return(FALSE); - vm_base = vm_next_byte(); - strcpy(CurCIDFontName, ""); /* initialize to none */ - strcpy(CurCMapName, ""); /* initialize to none */ - /* cause a font data reset on the next Type 1 font */ - strcpy(CurFontName, ""); /* initialize to none */ - CIDFontP = &TheCurrentCIDFont; - CMapP = &TheCurrentCMap; - CIDFontP->vm_start = vm_next_byte(); - CIDFontP->spacerangecnt = 0; - CIDFontP->notdefrangecnt = 0; - CIDFontP->cidrangecnt = 0; - CIDFontP->spacerangeP = NULL; - CIDFontP->notdefrangeP = NULL; - CIDFontP->cidrangeP = NULL; - CIDFontP->CIDFontFileName.len = 0; - CIDFontP->CIDFontFileName.data.valueP = CurCIDFontName; - CMapP->CMapFileName.len = 0; - CMapP->CMapFileName.data.valueP = CurCMapName; - CMapP->firstRow = 0xFFFF; - CMapP->firstCol = 0xFFFF; - CMapP->lastRow = 0; - CMapP->lastCol = 0; - return(TRUE); -} - -/***================================================================***/ -boolean -initCIDType1Font(void) -{ - strcpy(CurFontName, ""); /* initialize to none */ - FontP = &FDArrayP[FDArrayIndex]; - FontP->vm_start = vm_next_byte(); - FontP->FontFileName.len = 0; - FontP->FontFileName.data.valueP = CurFontName; - FontP->Subrs.len = 0; - FontP->Subrs.data.stringP = NULL; - FontP->CharStringsP = NULL; - FontP->Private = NULL; - FontP->fontInfoP = NULL; - FontP->BluesP = NULL; - return(TRUE); -} -#endif - -boolean -initFont(int cnt) -{ - - if (!(vm_init(cnt))) return(FALSE); - vm_base = vm_next_byte(); - if (!(Init_BuiltInEncoding())) return(FALSE); - strcpy(CurFontName, ""); /* iniitialize to none */ -#if XFONT_CID - /* cause a font data reset on the next CID-keyed font */ - strcpy(CurCIDFontName, ""); /* initialize to none */ -#endif - FontP = &TheCurrentFont; - FontP->vm_start = vm_next_byte(); - FontP->FontFileName.len = 0; - FontP->FontFileName.data.valueP = CurFontName; - return(TRUE); -} -/***================================================================***/ -#if XFONT_CID -static void -resetCIDFont(char *cidfontname, char *cmapfile) -{ - - vm_next = CIDFontP->vm_start; - vm_free = vm_size - ( vm_next - vm_base); - CIDFontP->spacerangecnt = 0; - CIDFontP->notdefrangecnt = 0; - CIDFontP->cidrangecnt = 0; - CIDFontP->spacerangeP = NULL; - CIDFontP->notdefrangeP = NULL; - CIDFontP->cidrangeP = NULL; - CIDFontP->CIDfontInfoP = NULL; - /* This will load the font into the FontP */ - strcpy(CurCIDFontName,cidfontname); - strcpy(CurCMapName,cmapfile); - CIDFontP->CIDFontFileName.len = strlen(CurCIDFontName); - CIDFontP->CIDFontFileName.data.valueP = CurCIDFontName; - CMapP->CMapFileName.len = strlen(CurCMapName); - CMapP->CMapFileName.data.valueP = CurCMapName; - CMapP->firstRow = 0xFFFF; - CMapP->firstCol = 0xFFFF; - CMapP->lastRow = 0; - CMapP->lastCol = 0; -} - -static void -resetCIDType1Font(void) -{ - - vm_next = FontP->vm_start; - vm_free = vm_size - ( vm_next - vm_base); - FontP->Subrs.len = 0; - FontP->Subrs.data.stringP = NULL; - FontP->CharStringsP = NULL; - FontP->Private = NULL; - FontP->fontInfoP = NULL; - FontP->BluesP = NULL; - /* This will load the font into the FontP */ - FontP->FontFileName.len = strlen(CurFontName); - FontP->FontFileName.data.valueP = CurFontName; -} -#endif - -static void -resetFont(char *env) -{ - - vm_next = FontP->vm_start; - vm_free = vm_size - ( vm_next - vm_base); - FontP->Subrs.len = 0; - FontP->Subrs.data.stringP = NULL; - FontP->CharStringsP = NULL; - FontP->Private = NULL; - FontP->fontInfoP = NULL; - FontP->BluesP = NULL; - /* This will load the font into the FontP */ - strcpy(CurFontName,env); - FontP->FontFileName.len = strlen(CurFontName); - FontP->FontFileName.data.valueP = CurFontName; - -} - -#if XFONT_CID -/***================================================================***/ -int -readCIDFont(char *cidfontname, char *cmapfile) -{ - int rcode; - - /* restore the virtual memory and eliminate old font */ - resetCIDFont(cidfontname, cmapfile); - /* This will load the font into the FontP */ - rcode = scan_cidfont(CIDFontP, CMapP); - if (rcode == SCAN_OUT_OF_MEMORY) { - /* free the memory and start again */ - if (!(initCIDFont(vm_size * 2))) { - /* we are really out of memory */ - return(SCAN_OUT_OF_MEMORY); - } - resetCIDFont(cidfontname, cmapfile); - rcode = scan_cidfont(CIDFontP, CMapP); - /* only double the memory twice, then report error */ - if (rcode == SCAN_OUT_OF_MEMORY) { - /* free the memory and start again */ - if (!(initCIDFont(vm_size * 2))) { - /* we are really out of memory */ - return(SCAN_OUT_OF_MEMORY); - } - resetCIDFont(cidfontname, cmapfile); - rcode = scan_cidfont(CIDFontP, CMapP); - } - } - return(rcode); -} - -int -readCIDType1Font(void) -{ - int rcode; - - resetCIDType1Font(); - - /* This will load the font into the FontP */ - rcode = scan_cidtype1font(FontP); - return(rcode); -} -#endif - -int -readFont(char *env) -{ - int rcode; - - /* restore the virtual memory and eliminate old font */ - resetFont(env); - /* This will load the font into the FontP */ - rcode = scan_font(FontP); - if (rcode == SCAN_OUT_OF_MEMORY) { - /* free the memory and start again */ -#if XFONT_CID - /* xfree(vm_base); */ -#else - xfree(vm_base); -#endif - if (!(initFont(vm_size * 2))) { - /* we are really out of memory */ - return(SCAN_OUT_OF_MEMORY); - } - resetFont(env); - rcode = scan_font(FontP); -#if XFONT_CID - /* only double the memory twice, then report error */ - if (rcode == SCAN_OUT_OF_MEMORY) { - /* free the memory and start again */ - /* xfree(vm_base) */ - if (!(initFont(vm_size * 2))) { - /* we are really out of memory */ - return(SCAN_OUT_OF_MEMORY); - } - resetFont(env); - rcode = scan_font(FontP); - } -#else - /* only double the memory once, then report error */ -#endif - } - return(rcode); -} -/***================================================================***/ -struct xobject * -fontfcnB(struct XYspace *S, unsigned char *code, int *lenP, int *mode) -{ - psobj *charnameP; /* points to psobj that is name of character*/ - int N; - psdict *CharStringsDictP; /* dictionary with char strings */ - psobj CodeName; /* used to store the translation of the name*/ - psobj *SubrsArrayP; - psobj *theStringP; - - struct xobject *charpath; /* the path for this character */ - - charnameP = &CodeName; - charnameP->len = *lenP; - charnameP->data.stringP = code; - - CharStringsDictP = FontP->CharStringsP; - - /* search the chars string for this charname as key */ - N = SearchDictName(CharStringsDictP,charnameP); - if (N<=0) { - *mode = FF_PARSE_ERROR; - return(NULL); - } - /* ok, the nth item is the psobj that is the string for this char */ - theStringP = &(CharStringsDictP[N].value); - - /* get the dictionary pointers to the Subrs */ - - SubrsArrayP = &(FontP->Subrs); - /* scale the Adobe fonts to 1 unit high */ - /* call the type 1 routine to rasterize the character */ - charpath = (struct xobject *)Type1Char((char *)FontP,S,theStringP, - SubrsArrayP,NULL, - FontP->BluesP , mode); - /* if Type1Char reported an error, then return */ - if ( *mode == FF_PARSE_ERROR) return(NULL); - /* fill with winding rule unless path was requested */ - if (*mode != FF_PATH) { - charpath = (struct xobject *)Interior((struct segment *)charpath, - WINDINGRULE+CONTINUITY); - } - return(charpath); -} - -#if XFONT_CID -/***================================================================***/ -/* CIDfontfcnA(cidfontname, cmapfile, mode) */ -/* */ -/* 1) initialize the font - global indicates it has been done */ -/* 2) load the font */ -/***================================================================***/ -Bool -CIDfontfcnA(char *cidfontname, char *cmapfile, int *mode) -{ - int rcode, cidinit; - - cidinit = 0; - if (CIDFontP == NULL || strcmp(CurCIDFontName, "") == 0) { - InitImager(); - if (!(initCIDFont(VM_SIZE))) { - /* we are really out of memory */ - *mode = SCAN_OUT_OF_MEMORY; - return(FALSE); - } - cidinit = 1; - } - - /* if the cidfontname is null, then use font already loaded */ - - /* if not the same font name */ - if (cidinit || (cidfontname && strcmp(cidfontname,CurCIDFontName) != 0) || - (cmapfile && strcmp(cmapfile,CurCMapName) != 0)) { - /* restore the virtual memory and eliminate old font, read new one */ - rcode = readCIDFont(cidfontname, cmapfile); - if (rcode != 0 ) { - strcpy(CurCIDFontName, ""); /* no CIDFont loaded */ - strcpy(CurCMapName, ""); /* no CMap loaded */ - *mode = rcode; - return(FALSE); - } - } - return(TRUE); - -} - -/***================================================================***/ -/* CIDType1fontfcnA(mode) */ -/* */ -/* 1) initialize the font - global indicates it has been done */ -/* 2) load the font */ -/***================================================================***/ -Bool -CIDType1fontfcnA(int *mode) -{ - int rcode; - - if (!(initCIDType1Font())) { - /* we are really out of memory */ - *mode = SCAN_OUT_OF_MEMORY; - return(FALSE); - } - - if ((rcode = readCIDType1Font()) != 0) { - strcpy(CurFontName, ""); /* no font loaded */ - *mode = rcode; - return(FALSE); - } - return(TRUE); - -} -#endif - -/***================================================================***/ -/* fontfcnA(env, mode) */ -/* */ -/* env is a pointer to a string that contains the fontname. */ -/* */ -/* 1) initialize the font - global indicates it has been done */ -/* 2) load the font */ -/***================================================================***/ -Bool -fontfcnA(char *env, int *mode) -{ - int rc; - - /* Has the FontP initialized? If not, then */ - /* Initialize */ -#if XFONT_CID - if (FontP == NULL || strcmp(CurFontName, "") == 0) { -#else - if (FontP == NULL) { -#endif - InitImager(); - if (!(initFont(VM_SIZE))) { - /* we are really out of memory */ - *mode = SCAN_OUT_OF_MEMORY; - return(FALSE); - } - } - - /* if the env is null, then use font already loaded */ - - /* if the not same font name */ - if ( (env) && (strcmp(env,CurFontName) != 0 ) ) { - /* restore the virtual memory and eliminate old font, read new one */ - rc = readFont(env); - if (rc != 0 ) { - strcpy(CurFontName, ""); /* no font loaded */ - *mode = rc; - return(FALSE); - } - } - return(TRUE); - -} - -#if XFONT_CID -/***================================================================***/ -/* CIDQueryFontLib(cidfontname,cmapfile,infoName,infoValue,rcodeP) */ -/* */ -/* cidfontname is a pointer to a string that contains the fontname. */ -/* */ -/* 1) initialize the font - global indicates it has been done */ -/* 2) load the font */ -/* 3) use the font to call getInfo for that value. */ -/***================================================================***/ - -void -CIDQueryFontLib(char *cidfontname, char *cmapfile, char *infoName, - pointer infoValue, /* parameter returned here */ - int *rcodeP) -{ - int rc,N,i,cidinit; - psdict *dictP; - psobj nameObj; - psobj *valueP; - - /* Has the CIDFontP initialized? If not, then */ - /* Initialize */ - cidinit = 0; - if (CIDFontP == NULL || strcmp(CurCIDFontName, "") == 0) { - InitImager(); - if (!(initCIDFont(VM_SIZE))) { - *rcodeP = 1; - return; - } - cidinit = 1; - } - /* if the file name is null, then use font already loaded */ - /* if the not same font name, reset and load next font */ - if (cidinit || (cidfontname && strcmp(cidfontname,CurCIDFontName) != 0) || - (cmapfile && strcmp(cmapfile,CurCMapName) != 0)) { - /* restore the virtual memory and eliminate old font */ - rc = readCIDFont(cidfontname, cmapfile); - if (rc != 0 ) { - strcpy(CurCIDFontName, ""); /* no font loaded */ - strcpy(CurCMapName, ""); /* no font loaded */ - *rcodeP = 1; - return; - } - } - dictP = CIDFontP->CIDfontInfoP; - objFormatName(&nameObj,strlen(infoName),infoName); - N = SearchDictName(dictP,&nameObj); - /* if found */ - if ( N > 0 ) { - *rcodeP = 0; - switch (dictP[N].value.type) { - case OBJ_ARRAY: - valueP = dictP[N].value.data.arrayP; - /* Just double check valueP. H.J. */ - if (valueP == NULL) break; - if (strcmp(infoName,"FontMatrix") == 0) { - /* 6 elments, return them as floats */ - for (i=0;i<6;i++) { - if (valueP->type == OBJ_INTEGER ) - ((float *)infoValue)[i] = valueP->data.integer; - else - ((float *)infoValue)[i] = valueP->data.real; - valueP++; - } - } - if (strcmp(infoName,"FontBBox") == 0) { - /* 4 elments for Bounding Box. all integers */ - for (i=0;i<4;i++) { - ((int *)infoValue)[i] = valueP->data.integer; - valueP++; - } - break; - case OBJ_INTEGER: - case OBJ_BOOLEAN: - *((int *)infoValue) = dictP[N].value.data.integer; - break; - case OBJ_REAL: - *((float *)infoValue) = dictP[N].value.data.real; - break; - case OBJ_NAME: - case OBJ_STRING: - *((char **)infoValue) = dictP[N].value.data.valueP; - break; - default: - *rcodeP = 1; - break; - } - } - } - else *rcodeP = 1; -} -#endif - -/***================================================================***/ -/* QueryFontLib(env, infoName,infoValue,rcodeP) */ -/* */ -/* env is a pointer to a string that contains the fontname. */ -/* */ -/* 1) initialize the font - global indicates it has been done */ -/* 2) load the font */ -/* 3) use the font to call getInfo for that value. */ -/***================================================================***/ - -void -QueryFontLib(char *env, char *infoName, - pointer infoValue, /* parameter returned here */ - int *rcodeP) -{ - int rc,N,i; - psdict *dictP; - psobj nameObj; - psobj *valueP; - - /* Has the FontP initialized? If not, then */ - /* Initialize */ - if (FontP == NULL) { - InitImager(); - if (!(initFont(VM_SIZE))) { - *rcodeP = 1; - return; - } - } - /* if the env is null, then use font already loaded */ - /* if the not same font name, reset and load next font */ - if ( (env) && (strcmp(env,CurFontName) != 0 ) ) { - /* restore the virtual memory and eliminate old font */ - rc = readFont(env); - if (rc != 0 ) { - strcpy(CurFontName, ""); /* no font loaded */ - *rcodeP = 1; - return; - } - } - dictP = FontP->fontInfoP; - objFormatName(&nameObj,strlen(infoName),infoName); - N = SearchDictName(dictP,&nameObj); - /* if found */ - if ( N > 0 ) { - *rcodeP = 0; - switch (dictP[N].value.type) { - case OBJ_ARRAY: - valueP = dictP[N].value.data.arrayP; - /* Just double check valueP. H.J. */ - if (valueP == NULL) break; - if (strcmp(infoName,"FontMatrix") == 0) { - /* 6 elments, return them as floats */ - for (i=0;i<6;i++) { - if (valueP->type == OBJ_INTEGER ) - ((float *)infoValue)[i] = valueP->data.integer; - else - ((float *)infoValue)[i] = valueP->data.real; - valueP++; - } - } - if (strcmp(infoName,"FontBBox") == 0) { - /* 4 elments for Bounding Box. all integers */ - for (i=0;i<4;i++) { - ((int *)infoValue)[i] = valueP->data.integer; - valueP++; - } - break; - case OBJ_INTEGER: - case OBJ_BOOLEAN: - *((int *)infoValue) = dictP[N].value.data.integer; - break; - case OBJ_REAL: - *((float *)infoValue) = dictP[N].value.data.real; - break; - case OBJ_NAME: - case OBJ_STRING: - *((char **)infoValue) = dictP[N].value.data.valueP; - break; - default: - *rcodeP = 1; - break; - } - } - } - else *rcodeP = 1; -} - -#if XFONT_CID -struct xobject * -CIDfontfcnC(struct XYspace *S, psobj *theStringP, - psobj *SubrsArrayP, struct blues_struct *BluesP, - int *lenP, int *mode) -{ - struct xobject *charpath; /* the path for this character */ - - charpath = (struct xobject *)CIDChar((char *)FontP,S,theStringP, - SubrsArrayP,NULL,BluesP,mode); - /* if Type1Char reported an error, then return */ - if ( *mode == FF_PARSE_ERROR) return(NULL); - /* fill with winding rule unless path was requested */ - if (*mode != FF_PATH) { - charpath = (struct xobject *)Interior((struct segment *)charpath, - WINDINGRULE+CONTINUITY); - } - return(charpath); -} -#endif diff --git a/nx-X11/lib/font/Type1/fontfcn.h b/nx-X11/lib/font/Type1/fontfcn.h deleted file mode 100644 index 1409eb9a9..000000000 --- a/nx-X11/lib/font/Type1/fontfcn.h +++ /dev/null @@ -1,250 +0,0 @@ -/* $Xorg: fontfcn.h,v 1.3 2000/08/17 19:46:30 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/fontfcn.h,v 1.4 1999/08/22 08:58:50 dawes Exp $ */ - - -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -/* modular config.h defines VERSION as libXfont version */ -#ifdef VERSION -#undef VERSION -#endif - -#if XFONT_CID -/* Definition of a PostScript CIDFont resource */ -typedef struct cid_font { - char *vm_start; - int spacerangecnt; - int notdefrangecnt; - int cidrangecnt; - spacerange *spacerangeP; - cidrange *notdefrangeP; - cidrange *cidrangeP; - int binarydata; /* 1=binary data, 0=hex data */ - long bytecnt; - psobj CIDFontFileName; - psdict *CIDfontInfoP; -} cidfont; - -/* Definition of a PostScript CMap resource */ -typedef struct cmap_res { - unsigned short firstCol; - unsigned short lastCol; - unsigned short firstRow; - unsigned short lastRow; - psobj CMapFileName; - psdict *CMapInfoP; -} cmapres; -#endif - -/* Definition of a PostScript FONT */ -typedef struct ps_font { - char *vm_start; - psobj FontFileName; - psobj Subrs; - psdict *CharStringsP; - psdict *Private; - psdict *fontInfoP; -struct blues_struct *BluesP; -} psfont; -/***================================================================***/ -/* Routines in scan_font */ -/***================================================================***/ - -extern boolean Init_BuiltInEncoding ( void ); -#if XFONT_CID -extern int scan_cidfont ( cidfont *CIDFontP, cmapres *CMapP ); -extern int scan_cidtype1font ( psfont *FontP ); -#endif -extern int scan_font ( psfont *FontP ); -/***================================================================***/ -/* Return codes from scan_font */ -/***================================================================***/ -#define SCAN_OK 0 -#define SCAN_FILE_EOF -1 -#define SCAN_ERROR -2 -#define SCAN_OUT_OF_MEMORY -3 -#define SCAN_FILE_OPEN_ERROR -4 -#define SCAN_TRUE -5 -#define SCAN_FALSE -6 -#define SCAN_END -7 - -#if XFONT_CID -/***================================================================***/ -/* Name of CID FontInfo fields */ -/***================================================================***/ -#define CIDCOUNT 1 -#define CIDFONTNAME 2 -#define CIDFONTTYPE 3 -#define CIDVERSION 4 -#define CIDREGISTRY 5 -#define CIDORDERING 6 -#define CIDSUPPLEMENT 7 -#define CIDMAPOFFSET 8 -#define CIDFDARRAY 9 -#define CIDFDBYTES 10 -#define CIDFONTBBOX 11 -#define CIDFULLNAME 12 -#define CIDFAMILYNAME 13 -#define CIDWEIGHT 14 -#define CIDNOTICE 15 -#define CIDGDBYTES 16 -#define CIDUIDBASE 17 -#define CIDXUID 18 - -/***================================================================***/ -/* Name of CMapInfo fields */ -/***================================================================***/ -#define CMAPREGISTRY 1 -#define CMAPORDERING 2 -#define CMAPSUPPLEMENT 3 -#define CMAPNAME 4 -#define CMAPVERSION 5 -#define CMAPTYPE 6 -#define CMAPWMODE 7 -#define CMAPCIDCOUNT 8 -#endif - -/***================================================================***/ -/* Name of FontInfo fields */ -/***================================================================***/ - -#define FONTNAME 1 -#define PAINTTYPE 2 -#define FONTTYPENUM 3 -#define FONTMATRIX 4 -#define FONTBBOX 5 -#define UNIQUEID 6 -#define STROKEWIDTH 7 -#define VERSION 8 -#define NOTICE 9 -#define FULLNAME 10 -#define FAMILYNAME 11 -#define WEIGHT 12 -#define ITALICANGLE 13 -#define ISFIXEDPITCH 14 -#define UNDERLINEPOSITION 15 -#define UNDERLINETHICKNESS 16 -#define ENCODING 17 -/***================================================================***/ -/* Name of Private values */ -/***================================================================***/ -#define BLUEVALUES 1 -#define OTHERBLUES 2 -#define FAMILYBLUES 3 -#define FAMILYOTHERBLUES 4 -#define BLUESCALE 5 -#define BLUESHIFT 6 -#define BLUEFUZZ 7 -#define STDHW 8 -#define STDVW 9 -#define STEMSNAPH 10 -#define STEMSNAPV 11 -#define FORCEBOLD 12 -#define LANGUAGEGROUP 13 -#define LENIV 14 -#define RNDSTEMUP 15 -#define EXPANSIONFACTOR 16 - -#if XFONT_CID -/***================================================================***/ -/* Name of CID Type 1 Private values */ -/***================================================================***/ -#define CIDT1MINFEATURE 1 -#define CIDT1LENIV 2 -#define CIDT1LANGGROUP 3 -#define CIDT1BLUEVALUES 4 -#define CIDT1OTHERBLUES 5 -#define CIDT1BLUESCALE 6 -#define CIDT1BLUEFUZZ 7 -#define CIDT1BLUESHIFT 8 -#define CIDT1FAMBLUES 9 -#define CIDT1FAMOTHERBLUES 10 -#define CIDT1STDHW 11 -#define CIDT1STDVW 12 -#define CIDT1STEMSNAPH 13 -#define CIDT1STEMSNAPV 14 -#define CIDT1SUBMAPOFF 15 -#define CIDT1SDBYTES 16 -#define CIDT1SUBRCNT 17 -#define CIDT1FORCEBOLD 18 -#define CIDT1RNDSTEMUP 19 -#define CIDT1EXPFACTOR 20 - -#define CID_BITMAP_UNDEFINED 0 -extern int SearchDictName ( psdict *dictP, psobj *keyP ); -#if XFONT_CID -extern boolean initCIDType1Font ( void ); -#endif -extern boolean initFont ( int cnt ); -#if XFONT_CID -extern int readCIDFont ( char *cidfontname, char *cmapfile ); -extern int readCIDType1Font ( void ); -#endif -extern int readFont ( char *env ); -extern struct xobject *fontfcnB ( struct XYspace *S, unsigned char *code, - int *lenP, int *mode ); -#if XFONT_CID -extern Bool CIDfontfcnA ( char *cidfontname, char *cmapfile, int *mode ); -extern Bool CIDType1fontfcnA ( int *mode ); -#endif -extern Bool fontfcnA ( char *env, int *mode ); -#if XFONT_CID -extern void CIDQueryFontLib ( char *cidfontname, char *cmapfile, - char *infoName, pointer infoValue, int *rcodeP ); -#endif -extern void QueryFontLib ( char *env, char *infoName, pointer infoValue, - int *rcodeP ); -#if XFONT_CID -extern struct xobject *CIDfontfcnC ( struct XYspace *S, psobj *theStringP, - psobj *SubrsArrayP, - struct blues_struct *BluesP, int *lenP, - int *mode ); -#endif -#endif diff --git a/nx-X11/lib/font/Type1/fonts.h b/nx-X11/lib/font/Type1/fonts.h deleted file mode 100644 index 7215e0f7a..000000000 --- a/nx-X11/lib/font/Type1/fonts.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Xorg: fonts.h,v 1.3 2000/08/17 19:46:30 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM 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. - */ - -/* STUB */ - -#define CopyFont(f) f -#define UniqueFont(f) f -#define KillFont(f) -#define KillText(t) -#define CopyText(t) t -#define I_DumpText(t) -#define CoerceText(t) t -#define TextDelta(t,pt) -#define XformText(p,s) -#define GimeSpace() FALSE - -#define LibInit() -#define InitFonts() -#define InitFiles() -#define TraceClose() - -#define FF_PARSE_ERROR -1 diff --git a/nx-X11/lib/font/Type1/hdigit.h b/nx-X11/lib/font/Type1/hdigit.h deleted file mode 100644 index fbaa9c1db..000000000 --- a/nx-X11/lib/font/Type1/hdigit.h +++ /dev/null @@ -1,94 +0,0 @@ -/* $Xorg: hdigit.h,v 1.3 2000/08/17 19:46:30 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM 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. - */ -/* -------------------------------------- */ -/* --- MACHINE GENERATED, DO NOT EDIT --- */ -/* -------------------------------------- */ - -#ifndef HDIGIT -#define HDIGIT 1 - -/* - * Hex Digit Value Table -- - * - * The entries in the Digit Value Table map character codes in the set - * {0-9,a-f,A-F} to their numeric values for readhexstring - * (00 10...F0 for the high hex digit and 00 01...0F for the low). - * The white-space and hex string termination characters are. - * mapped to codes > 0xf0 to enable usage by several modules. - * 2 tables are build HighHex and LowHex. - * - */ - -/* Indicators for special characters in these tables */ -#define HERROR (0xfe) -#define HWHITE_SPACE (0xfd) -#define HRIGHT_ANGLE (0xfc) -#define LAST_HDIGIT (0xf0) - -#define HighHexP (HighHex+1) -unsigned char HighHex[257] = { 0xFF, - 0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFD,0xFD,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xFE,0xFE,0xFE,0xFE,0xFC,0xFE, - 0xFE,0xA0,0xB0,0xC0,0xD0,0xE0,0xF0,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xA0,0xB0,0xC0,0xD0,0xE0,0xF0,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE -}; -#define LowHexP (LowHex+1) -unsigned char LowHex[257] = { 0xFF, - 0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFD,0xFD,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0xFE,0xFE,0xFE,0xFE,0xFC,0xFE, - 0xFE,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE, - 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE -}; - -#endif diff --git a/nx-X11/lib/font/Type1/hints.c b/nx-X11/lib/font/Type1/hints.c deleted file mode 100644 index 14deac229..000000000 --- a/nx-X11/lib/font/Type1/hints.c +++ /dev/null @@ -1,890 +0,0 @@ -/* $Xorg: hints.c,v 1.3 2000/08/17 19:46:30 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/hints.c,v 1.7tsi Exp $ */ - - /* HINTS CWEB V0006 ******** */ -/* -:h1.HINTS Module - Processing Rasterization Hints - -&author. Sten F. Andler; continuity by Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) and Duaine -W. Pryor, Jr. - - -:h3.Include Files - -The included files are: -*/ -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef FONTMODULE -# include "os.h" -#endif -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "regions.h" -#include "hints.h" - -/* -:h3.Functions Provided to the TYPE1IMAGER User - -None. -*/ - -/* -:h3.Functions Provided to Other Modules - -This module provides the following entry point to other modules: -*/ - - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h3.Macros Provided to Other Modules - -None. -*/ - -/* -:h2.InitHints() - Initialize hint data structure -*/ - -#define MAXLABEL 20 -static struct { - int inuse; - int computed; - struct fractpoint hint; -} oldHint[MAXLABEL]; - -#define ODD(x) (((int)(x)) & 01) -#define FPFLOOR(fp) TOFRACTPEL((fp) >> FRACTBITS) -#define FPROUND(fp) FPFLOOR((fp) + FPHALF) - -void -InitHints(void) -{ - int i; - - for (i = 0; i < MAXLABEL; i++) - { - oldHint[i].inuse = FALSE; - oldHint[i].computed = FALSE; - } -} - -/* -:h3.CloseHints(hintP) - Reverse hints that are still open -*/ - -void -CloseHints(struct fractpoint *hintP) -{ - int i; - - for (i = 0; i < MAXLABEL; i++) - { - if (oldHint[i].inuse) - { - hintP->x -= oldHint[i].hint.x; - hintP->y -= oldHint[i].hint.y; - - oldHint[i].inuse = FALSE; - } - } -} - -/* -:h3.ComputeHint(hP, currX, currY, hintP) - Compute the value of a hint -*/ - -static void -ComputeHint(struct hintsegment *hP, - fractpel currX, fractpel currY, - struct fractpoint *hintP) -{ - fractpel currRef, currWidth; - int idealWidth; - fractpel hintValue; - char orientation; - -/* -By construction, width is never zero. Therefore we can use the -width value to determine if the hint has been rotated by a -multiple of 90 degrees. -*/ - - if (hP->width.y == 0) - { - orientation = 'v'; /* vertical */ - } - else if (hP->width.x == 0) - { - orientation = 'h'; /* horizontal */ - } - else - { - hintP->x = hintP->y = 0; - return; - } - - /* Compute currRef and currWidth with a unit of 1 pel */ - if (orientation == 'v') /* vertical */ - { - currRef = hP->ref.x + currX; - currWidth = ABS(hP->width.x); - } - else if (orientation == 'h') /* horizontal */ - { - currRef = hP->ref.y + currY; - currWidth = ABS(hP->width.y); - } - else /* error */ - { - Abort("ComputeHint: invalid orientation"); - } - - if ((hP->hinttype == 'b') /* Bar or stem */ - || (hP->hinttype == 's')) /* Serif */ - { - idealWidth = NEARESTPEL(currWidth); - if (idealWidth == 0) idealWidth = 1; - if (ODD(idealWidth)) /* Is ideal width odd? */ - { - /* center "ref" over pel */ - hintValue = FPFLOOR(currRef) + FPHALF - currRef; - } - else - { - /* align "ref" on pel boundary */ - hintValue = FPROUND(currRef) - currRef; - } - } - else if (hP->hinttype == 'c') /* Curve extrema */ - { - /* align "ref" on pel boundary */ - hintValue = FPROUND(currRef) - currRef; - } - else /* error */ - { - Abort("ComputeHint: invalid hinttype"); - } - - if (orientation == 'v') /* vertical */ - { - hintP->x = hintValue; - hintP->y = 0; - } - else if (orientation == 'h') /* horizontal */ - { - hintP->x = 0; - hintP->y = hintValue; - } - else /* error */ - { - Abort("ComputeHint: invalid orientation"); - } -} - -/* -:h3.ProcessHint(hP, currX, currY, hintP) - Process a rasterization hint -*/ - -void -ProcessHint(struct hintsegment *hP, - fractpel currX, fractpel currY, - struct fractpoint *hintP) -{ - struct fractpoint thisHint; - - if ((hP->adjusttype == 'm') /* Move */ - || (hP->adjusttype == 'a')) /* Adjust */ - { - /* Look up hint in oldHint table */ - if ((hP->label >= 0) && (hP->label < MAXLABEL)) - { - if (oldHint[hP->label].computed) - /* Use old hint value if already computed */ - { - thisHint.x = oldHint[hP->label].hint.x; - thisHint.y = oldHint[hP->label].hint.y; - oldHint[hP->label].inuse = TRUE; - } - else - /* Compute new value for hint and store it for future use */ - { - ComputeHint(hP, currX, currY, &thisHint); - - oldHint[hP->label].hint.x = thisHint.x; - oldHint[hP->label].hint.y = thisHint.y; - oldHint[hP->label].inuse = TRUE; - oldHint[hP->label].computed = TRUE; - } - } - else /* error */ - { - Abort("ProcessHint: invalid label"); - } - } - else if (hP->adjusttype == 'r') /* Reverse */ - { - /* Use the inverse of the existing hint value to reverse hint */ - if ((hP->label >= 0) && (hP->label < MAXLABEL)) - { - if (oldHint[hP->label].inuse) - { - thisHint.x = -oldHint[hP->label].hint.x; - thisHint.y = -oldHint[hP->label].hint.y; - oldHint[hP->label].inuse = FALSE; - } - else /* error */ - { - Abort("ProcessHint: label is not in use"); - } - } - else /* error */ - { - Abort("ProcessHint: invalid label"); - } - - } - else /* error */ - { - Abort("ProcessHint: invalid adjusttype"); - } - - hintP->x += thisHint.x; - hintP->y += thisHint.y; -} - -/* -:h2 id=subpath.Navigation Through Edge Lists - -For continuity checking purposes, we need to navigate through edge -lists by the "subpath" chains and answer questions about edges. The -subpath chain links together edges that were part of the same subpath -(no intervening move segments) when the interior of the path was -calculated. Here we use the term "edge" to mean every edge list -that was created in between changes of direction. - -The subpath chains are singly-linked circular chains. For the convenience -of building them, they direction of the list (from edge to edge) is the -reverse of the order in which they were built. Within any single edge, -the subpath chain goes from top-to-bottom. (There might be a violation -of this because of the way the user started the first chain; see -:hdref refid=fixsubp..). - -:h3.ISTOP() and ISBOTTOM() - Flag Bits for Edge Lists at the Top and -Bottom of Their SubPaths -*/ - -#define ISTOP(flag) ((flag)&0x20) -#define ISBOTTOM(flag) ((flag)&0x10) -/* -:h3.ISLEFT() - Flag Bit for Left Edges -*/ - -#define ISLEFT(flag) ((flag)&0x08) - -/* -:h3.XofY() - Macro to Find X Value at Given Y - -This macro can only be used if it is known that the Y is within the -given edgelist's ymin and ymax. -*/ - -#define XofY(edge, y) edge->xvalues[y - edge->ymin] - -/* -:h3.findXofY() - Like XofY(), Except not Restricted - -If the Y is out of bounds of the given edgelist, this macro will -call SearchXofY to search the edge's subpath chain for the correct -Y range. If the Y value is off the edge, MINPEL is returned. -*/ -#define findXofY(edge, y) ((y < edge->ymin || y >= edge->ymax) ? SearchXofY(edge, y) : XofY(edge, y)) - -/* -:h4.SearchXofY() - Routine Called by FindXofY() for Difficult Cases - -The concept of this routine is to follow the subpath chain to find the -edge just below (i.e., next in chain) or just above (i.e., immediately -before in chain. It is assumed that the Y value is no more than one -off of the edge's range; XofY() could be replace by FindXofY() to -call ourselves recursively if this were not true. -*/ - -static pel -SearchXofY(register struct edgelist *edge, /* represents edge */ - register pel y) /* 'y' value to find edge for */ -{ - register struct edgelist *e; /* loop variable */ - - if (y < edge->ymin) { - if (ISTOP(edge->flag)) - return(MINPEL); - for (e = edge->subpath; e->subpath != edge; e = e->subpath) { ; } - if (e->ymax == edge->ymin) - return(XofY(e, y)); - } - else if (y >= edge->ymax) { - if (ISBOTTOM(edge->flag)) - return(MINPEL); - e = edge->subpath; - if (e->ymin == edge->ymax) - return(XofY(e, y)); - } - else - return(XofY(edge, y)); - - Abort("bad subpath chain"); - /*NOTREACHED*/ -} -/* -:h3.ISBREAK() Macro - Tests if an Edge List is at a "Break" - -The subpath chains are organized top to bottom. When the bottom of -a given edge is reached, the subpath chain points to the top of the -next edge. We call this a "break" in the chain. The following macro -is the simple test for the break condition: -*/ - -#define ISBREAK(top,bot) (top->ymax != bot->ymin) - - -/* -:h3.ImpliedHorizontalLine() - Tests for Horizontal Connectivity - -This function returns true if two edges are connected horizontally. -They are connected horizontally if they are consecutive in the subpath, -and either we are at the bottom and the first edge is going down or we -are at the top and the first edge is going up. -*/ - -#define BLACKABOVE -1 -#define BLACKBELOW +1 -#define NONE 0 - -static int -ImpliedHorizontalLine(struct edgelist *e1, /* two edges to check */ - struct edgelist *e2, - int y) /* y where they might be connected */ -{ - register struct edgelist *e3,*e4; - - if (ISDOWN(e1->flag) == ISDOWN(e2->flag)) - return(NONE); /* can't be consecutive unless different directions */ -/* -Now we check for consecutiveness: Can we get from 'e1' to 'e2' with -only one intervening break? Can we get from 'e2' to 'e1' with only one -intervening break? 'e3' will be as far as we can get after 'e1'; 'e4' -will be has far as we can get after 'e2': -*/ - for (e3 = e1; !ISBREAK(e3, e3->subpath); e3 = e3->subpath) { ; } - for (e3 = e3->subpath; e3 != e2; e3 = e3->subpath) - if (ISBREAK(e3, e3->subpath)) - break; - - for (e4 = e2; !ISBREAK(e4, e4->subpath); e4 = e4->subpath) { ; } - for (e4 = e4->subpath; e4 != e1; e4 = e4->subpath) - if (ISBREAK(e4, e4->subpath)) - break; -/* -If the edges are mutually consecutive, we must have horizontal lines -both top and bottom: -*/ - if (e3 == e2 && e4 == e1) - return(TRUE); -/* -If the edges are not consecutive either way, no horizontal lines are -possible: -*/ - if (e3 != e2 && e4 != e1) - return(NONE); -/* -Now let's swap 'e1' and 'e2' if necessary to enforce the rule that 'e2' -follows 'e1'. Remember that subpath chains go in the opposite direction -from the way the subpaths were built; this led to the simplest way -do build them. -*/ - if (e4 != e1) { - e2 = e1; - e1 = e3; /* remember e3 == e2, this just swaps 'e1' and 'e2' */ - } -/* -Now we have everything to return the answer: -*/ - if (ISTOP(e1->flag) && y == e1->ymin) - return(ISDOWN(e2->flag)); - else if (ISBOTTOM(e1->flag) && y == e1->ymax) - return(!ISDOWN(e2->flag)); - else - Abort("ImpliedHorizontalLine: why ask?"); - /*NOTREACHED*/ -} - -/* -:h3 id=fixsubp.FixSubPaths() - Must be Called to Organize Subpath Chains - -The region-building code in Interior(), in particular splitedge(), -maintains the rule that sub-paths are linked top-to-bottom except -at breaks. However, it is possible that there may be a "false break" -because the user started the subpath in the middle of an edge (and -went in the "wrong" direction from there, up instead of down). This -routine finds and fixes false breaks. - -Also, this routine sets the ISTOP and ISBOTTOM flags in the edge lists. -*/ - -static void -FixSubPaths(struct region *R) /* anchor of region */ -{ - register struct edgelist *e; /* fast loop variable */ - register struct edgelist *edge; /* current edge in region */ - register struct edgelist *next; /* next in subpath after 'edge' */ - register struct edgelist *break1; /* first break after 'next' */ - register struct edgelist *break2 = NULL; /* last break before 'edge' */ - register struct edgelist *prev; /* previous edge for fixing links */ - int left = TRUE; - - for (edge = R->anchor; edge != NULL; edge = edge->link) { - - if (left) - edge->flag |= ISLEFT(ON); - left = !left; - - next = edge->subpath; - - if (!ISBREAK(edge, next)) - continue; - if (edge->ymax < next->ymin) - Abort("disjoint subpath?"); -/* -'edge' now contains an edgelist at the bottom of an edge, and 'next' -contains the next subsequent edgelist in the subpath, which must be at -the top. We refer to this a "break" in the subpath. -*/ - next->flag |= ISTOP(ON); - edge->flag |= ISBOTTOM(ON); - - if (ISDOWN(edge->flag) != ISDOWN(next->flag)) - continue; -/* -We are now in the unusual case; both edges are going in the same -direction so this must be a "false break" due to the way that the user -created the path. We'll have to fix it. -*/ - for (break1 = next; !ISBREAK(break1, break1->subpath); break1 = break1->subpath) { ; } - - for (e = break1->subpath; e != edge; e = e->subpath) - if (ISBREAK(e, e->subpath)) - break2 = e; -/* -Now we've set up 'break1' and 'break2'. I've found the following -diagram invaluable. 'break1' is the first break after 'next'. 'break2' -is the LAST break before 'edge'. -&drawing. - next - +------+ +---->+------+ - +--->| >-----+ | | >-----+ - | | | | | | | | - | +-------------+ | +-------------+ - | | |break1| | | | | - | +->| >-------+ +->| >-----+ - | | | | | | - | | | +-------------+ - | +------+ | | | - | +----------------+ | | | - | | +------+ | +->| >-----+ - | +->| >-----+ | | | | - | | | | | +-------------+ - | +-------------+ | | | | - | | |edge | | | |break2| - | +->| >-----+ | +->| >-----+ - | | | | | | | | - | | | | | | | | - | | | | | | | | - | +------+ | | +------+ | - | | | | - +---------------+ +---------------+ - -&edrawing. -We want to fix this situation by having 'edge' point to where 'break1' -now points, and having 'break1' point to where 'break2' now points. -Finally, 'break2' should point to 'next'. Also, we observe that -'break1' can't be a bottom, and is also not a top unless it is the same -as 'next': -*/ - edge->subpath = break1->subpath; - - break1->subpath = break2->subpath; - if (ISBREAK(break1, break1->subpath)) - Abort("unable to fix subpath break?"); - - break2->subpath = next; - - break1->flag &= ~ISBOTTOM(ON); - if (break1 != next) - break1->flag &= ~ISTOP(ON); - } -/* -This region might contain "ambiguous" edges; edges exactly equal to -edge->link. Due to the random dynamics of where they get sorted into -the list, they can yield false crossings, where the edges appear -to cross. This confuses our continuity logic no end. Since we can -swap them without changing the region, we do. -*/ - for (edge = R->anchor, prev = NULL; VALIDEDGE(edge); prev = edge, edge = prev->link) { - - if (! ISAMBIGUOUS(edge->flag)) - continue; - - next = edge->subpath; - - while (ISAMBIGUOUS(next->flag) && next != edge) - next = next->subpath; -/* -We've finally found a non-ambiguous edge; we make sure it is left/right -compatible with 'edge': -*/ - if ( (ISLEFT(edge->flag) == ISLEFT(next->flag) && ISDOWN(edge->flag) == ISDOWN(next->flag) ) - || (ISLEFT(edge->flag) != ISLEFT(next->flag) && ISDOWN(edge->flag) != ISDOWN(next->flag) ) ) - continue; - -/* -Incompatible, we will swap 'edge' and the following edge in the list. -You may think that there must be a next edge in this swath. So did I. -No! If there is a totally ambiguous inner loop, for example, we could -get all the way to the outside without resolving ambiguity. -*/ - next = edge->link; /* note new meaning of 'next' */ - if (next == NULL || edge->ymin != next->ymin) - continue; - if (prev == NULL) - R->anchor = next; - else - prev->link = next; - edge->link = next->link; - next->link = edge; - edge->flag ^= ISLEFT(ON); - edge->flag &= ~ISAMBIGUOUS(ON); - next->flag ^= ISLEFT(ON); - next->flag &= ~ISAMBIGUOUS(ON); - edge = next; - } -} -/* -:h3.DumpSubPaths() - -A debug tool. -*/ - -static struct edgelist *before(struct edgelist *e); /* subroutine of DumpSubPaths */ - -static void -DumpSubPaths(struct edgelist *anchor) -{ - - register struct edgelist *edge,*e,*e2; - pel y; - - for (edge = anchor; VALIDEDGE(edge); edge = edge->link) { - if (ISPERMANENT(edge->flag)) - continue; - for (e2 = edge; !ISPERMANENT(e2->flag);) { - if (ISDOWN(e2->flag)) { - for (e = e2;; e = e->subpath) { - for (y=e->ymin+1; y < e->ymax; y++) - e->flag |= ISPERMANENT(ON); - if (ISBREAK(e, e->subpath)) - break; - } - } - else { - for (e = e2; !ISBREAK(e, e->subpath); e = e->subpath) { ; } - for (;; e=before(e)) { - for (y=e->ymax-2; y >= e->ymin; y--) - e->flag |= ISPERMANENT(ON); - if (e == e2) - break; - } - } - do { - e2 = before(e2); - } while (!ISBREAK(before(e2), e2)); - } - } -} - -static struct edgelist * -before(struct edgelist *e) -{ - struct edgelist *r; - for (r = e->subpath; r->subpath != e; r = r->subpath) { ; } - return(r); -} - -/* -:h2.Fixing Region Continuity Problems - -Small regions may become disconnected when their connecting segments are -less than a pel wide. This may be correct in some applications, but in -many (especially small font characters), it is more pleasing to keep -connectivity. ApplyContinuity() (invoked by +CONTINUITY on the -Interior() fill rule) fixes connection breaks. The resulting region -is geometrically less accurate, but may be more pleasing to the eye. -*/ -/* -Here are some macros which we will need: -*/ - -#define IsValidPel(j) (j!=MINPEL) - -/* -:h3.writeXofY() - Stuffs an X Value Into an "edgelist" - -writeXofY writes an x value into an edge at position 'y'. It must -update the edge's xmin and xmax. If there is a possibility that this -new x might exceed the region's bounds, updating those are the -responsibility of the caller. -*/ - -static void -writeXofY(struct edgelist *e,/* relevant edgelist */ - int y, /* y value */ - int x) /* new x value */ -{ - if (e->xmin > x) e->xmin = x; - if (e->xmax < x) e->xmax = x; - e->xvalues[y - e->ymin] = x; -} - -/*-------------------------------------------------------------------------*/ -/* the following three macros tell us whether we are at a birth point, a */ -/* death point, or simply in the middle of the character */ -/*-------------------------------------------------------------------------*/ -#define WeAreAtTop(e,i) (ISTOP(e->flag) && e->ymin == i) -#define WeAreAtBottom(e,i) (ISBOTTOM(e->flag) && e->ymax-1 == i) -#define WeAreInMiddle(e,i) \ - ((!ISTOP(e->flag) && !ISBOTTOM(e->flag))||(i < e->ymax-1 && i > e->ymin)) -/* -The following macro tests if two "edgelist" structures are in the same -swath: -*/ -#define SAMESWATH(e1,e2) (e1->ymin == e2->ymin) - -/* -:h3.CollapseWhiteRun() - Subroutine of ApplyContinuity() - -When we have a white run with an implied horizontal line above or -below it, we better have black on the other side of this line. This -function both tests to see if black is there, and adjusts the end -points (collapses) the white run as necessary if it is not. The -goal is to collapse the white run as little as possible. -*/ - -static void -CollapseWhiteRun(struct edgelist *anchor, /* anchor of edge list */ - pel yblack, /* y of (hopefully) black run above or below */ - struct edgelist *left, /* edgelist at left of WHITE run */ - struct edgelist *right, /* edgelist at right of WHITE run */ - pel ywhite) /* y location of white run */ -{ - struct edgelist *edge; - struct edgelist *swathstart = anchor; - register pel x; - - if (XofY(left, ywhite) >= XofY(right, ywhite)) - return; -/* -Find the swath with 'yblack'. If we don't find it, completely collapse -the white run and return: -*/ - while (VALIDEDGE(swathstart)) { - if (yblack < swathstart->ymin) { - writeXofY(left, ywhite, XofY(right, ywhite)); - return; - } - if (yblack < swathstart->ymax) break; - swathstart = swathstart->link->link; - } - if(!VALIDEDGE(swathstart)) { - writeXofY(left, ywhite, XofY(right, ywhite)); - return; - } -/* -Now we are in the swath that contains 'y', the reference line above -or below that we are trying to maintain continuity with. If black -in this line begins in the middle of our white run, we must collapse -the white run from the left to that point. If black ends in the -middle of our white run, we must collapse the white run from the right -to that point. -*/ - for (edge = swathstart; VALIDEDGE(edge); edge = edge->link) { - - if (!SAMESWATH(swathstart,edge)) - break; - if( XofY(edge, yblack) > XofY(left, ywhite)) { - if (ISLEFT(edge->flag)) { - x = XofY(edge, yblack); - if (XofY(right, ywhite) < x) - x = XofY(right, ywhite); - writeXofY(left, ywhite, x); - } - else { - x = XofY(edge, yblack); - while (edge->link != NULL && SAMESWATH(edge, edge->link) - && x >= XofY(edge->link, yblack) ) { - edge = edge->link->link; - x = XofY(edge, yblack); - } - if (x < XofY(right, ywhite)) - writeXofY(right, ywhite, x); - return; - } - } - } - writeXofY(left, ywhite, XofY(right, ywhite)); -} - -/* -:h3.ApplyContinuity() - Fix False Breaks in a Region - -This is the externally visible routine called from the REGIONS module -when the +CONTINUITY flag is on the Interior() fill rule. -*/ - -void -ApplyContinuity(struct region *R) -{ - struct edgelist *left; - struct edgelist *right; - struct edgelist *edge,*e2; - pel rightXabove,rightXbelow,leftXabove,leftXbelow; - pel leftX,rightX; - int i; - long newcenter,abovecenter,belowcenter; - - FixSubPaths(R); - if (RegionDebug >= 3) - DumpSubPaths(R->anchor); - left = R->anchor; -/* loop through and do all of the easy checking. ( no tops or bottoms) */ - while(VALIDEDGE(left)) - { - right = left->link; - for(i=left->ymin;iymax;++i) - { - leftX = findXofY(left,i); - rightX = findXofY(right,i); - leftXbelow = findXofY(left,i+1); - rightXbelow = findXofY(right,i+1); - if(rightX <= leftX) - { -/* then, we have a break in a near vertical line */ - leftXabove = findXofY(left,i-1); - rightXabove = findXofY(right,i-1); - if( IsValidPel(leftXabove) && IsValidPel(rightXabove) ) - { - abovecenter = leftXabove + rightXabove; - } - else - { - abovecenter = leftX + rightX; - } - if( IsValidPel(leftXbelow) && IsValidPel(rightXbelow) ) - { - belowcenter = leftXbelow + rightXbelow; - } - else - { - belowcenter = leftX + rightX; - } - newcenter = abovecenter + belowcenter; - if( newcenter > 4*leftX ) - { - rightX = rightX + 1; - } - else if( newcenter < 4*leftX) - { - leftX = leftX - 1; - } - else - { - rightX = rightX + 1; - } - writeXofY(right,i,rightX); - writeXofY(left,i,leftX); - if(rightX > R->xmax) {R->xmax = rightX;} - if(leftX < R->xmin) {R->xmin = leftX;} - } - if( !WeAreAtBottom(left,i) && (leftXbelow>=rightX)) - { -/* then we have a break in a near horizontal line in the middle */ - writeXofY(right,i,leftXbelow); - } - if( !WeAreAtBottom(right,i) && (leftX >=rightXbelow)) - { -/* then we have a break in a near horizontal line in the middle */ - writeXofY(left,i,rightXbelow); - } - } - left = right->link; - } -/* -There may be "implied horizontal lines" between edges that have -implications for continuity. This loop looks for white runs that -have implied horizontal lines on the top or bottom, and calls -CollapseWhiteRuns to check and fix any continuity problems from -them. -*/ - for (edge = R->anchor; VALIDEDGE(edge); edge = edge->link) { - if ((!ISTOP(edge->flag) && !ISBOTTOM(edge->flag)) || ISLEFT(edge->flag)) - continue; /* at some future date we may want left edge logic here too */ - for (e2 = edge->link; VALIDEDGE(e2) && SAMESWATH(edge,e2); e2 = e2->link) { - if (ISTOP(e2->flag) && ISTOP(edge->flag) - && NONE != ImpliedHorizontalLine(edge,e2,edge->ymin)) { - if (ISLEFT(e2->flag)) - CollapseWhiteRun(R->anchor, edge->ymin-1, - edge, e2, edge->ymin); - } - if (ISBOTTOM(e2->flag) && ISBOTTOM(edge->flag) - && NONE != ImpliedHorizontalLine(edge,e2, edge->ymax)) { - if (ISLEFT(e2->flag)) - CollapseWhiteRun(R->anchor, edge->ymax, - edge, e2, edge->ymax-1); - } - } - } -} - - - - diff --git a/nx-X11/lib/font/Type1/hints.h b/nx-X11/lib/font/Type1/hints.h deleted file mode 100644 index 8e2ae2ade..000000000 --- a/nx-X11/lib/font/Type1/hints.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Xorg: hints.h,v 1.3 2000/08/17 19:46:30 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/hints.h,v 1.3 1999/08/22 08:58:51 dawes Exp $ */ - -/*SHARED*/ - -#define InitHints t1_InitHints -extern void t1_InitHints ( void ); /* Initialize hint data structure */ - -#define CloseHints(hintP) t1_CloseHints(hintP) -/* Reverse hints that are still open */ -extern void t1_CloseHints ( struct fractpoint *hintP ); - -#define ProcessHint(hP, currX, currY, hintP) t1_ProcessHint(hP, currX, currY, hintP) -/* Process a rasterization hint */ -extern void t1_ProcessHint ( struct hintsegment *hP, fractpel currX, fractpel currY, struct fractpoint *hintP ); - -#define ApplyContinuity(R) t1_ApplyContinuity(R) -/* fix false connection breaks in a region */ -extern void t1_ApplyContinuity ( struct region *R ); - -/*END SHARED*/ diff --git a/nx-X11/lib/font/Type1/lines.c b/nx-X11/lib/font/Type1/lines.c deleted file mode 100644 index 835afc6ed..000000000 --- a/nx-X11/lib/font/Type1/lines.c +++ /dev/null @@ -1,189 +0,0 @@ -/* $Xorg: lines.c,v 1.3 2000/08/17 19:46:30 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/lines.c,v 1.4tsi Exp $ */ - - /* LINES CWEB V0003 ******** */ -/* -:h1.LINES Module - Rasterizing Lines - -&author. Duaine W. Pryor, Jr. and Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) - - -:h3.Include Files - -The included files are: -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "regions.h" -#include "lines.h" - -/* -:h3.Functions Provided to the TYPE1IMAGER User - -None. -*/ - -/* -:h3.Functions Provided to Other Modules - -This module provides the following entry point to other modules: -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h3.Macros Provided to Other Modules - -None. -*/ - -/* -:h2.StepLine() - Produces Run Ends for a Line After Checks - -The main work is done by Bresenham(); here we just perform checks and -get the line so that its Y direction is always increasing: -*/ - -void StepLine(R, x1, y1, x2, y2) - register struct region *R; /* region being built */ - register fractpel x1,y1; /* starting point */ - register fractpel x2,y2; /* ending point */ -{ - register fractpel dy; - - dy = y2 - y1; - -/* -We execute the "GOING_TO" macro to call back the REGIONS module, if -necessary (like if the Y direction of the edge has changed): -*/ - GOING_TO(R, x1, y1, x2, y2, dy); - - if (dy == 0) - return; - - if (dy < 0) - Bresenham(R->edge, x2, y2, x1, y1); - else - Bresenham(R->edge, x1, y1, x2, y2); - return; -} -/* -:h3.Bresenham() - Actually Produces Run Ends - -This routine runs a Bresenham line-stepping -algorithm. See, for example, Newman and Sproul, :hp1/Principles -of Interactive Computer Graphics/, pp. 25-27. -When we enter this, we -are guaranteed that dy is positive. -We'd like to work in 8 bit precision, so we'll define some macros and -constants to let us do that: -*/ - -#define PREC 8 /* we'll keep fraction pels in 8 bit precision */ -/* -RoundFP() rounds down by 'b' bits: -*/ -#define RoundFP(xy,b) (((xy)+(1<<((b)-1)))>>(b)) - -/* -TruncFP() truncates down by 'b' bits: -*/ -#define TruncFP(xy,b) ((xy)>>(b)) - - -void Bresenham(edgeP,x1,y1,x2,y2) - register pel *edgeP; /* pointer to top of list (y == 0) */ - register fractpel x1,y1; /* starting point on line */ - register fractpel x2,y2; /* ending point on the line (down) */ -{ - register long dx,dy; /* change in x and y, in my own precision */ - register long x,y; /* integer pel starting point */ - register int count; /* integer pel delta y */ - register long d; /* the Bresenham algorithm error term */ - - x1 = TruncFP(x1, FRACTBITS-PREC); - y1 = TruncFP(y1, FRACTBITS-PREC); - x2 = TruncFP(x2, FRACTBITS-PREC); - y2 = TruncFP(y2, FRACTBITS-PREC); - - dx = x2 - x1; - dy = y2 - y1; -/* -Find the starting x and y integer pel coordinates: -*/ - - x = RoundFP(x1,PREC); - y = RoundFP(y1,PREC); - edgeP += y; - count = RoundFP(y2,PREC) - y; -/*------------------------------------------------------------------*/ -/* Force dx to be positive so that dfy will be negative */ -/* this means that vertical moves will decrease d */ -/*------------------------------------------------------------------*/ - if (dx<0) - { - dx = -dx; -#define P PREC - d=(dy*(x1-(x<>P; -#undef P - while(--count >= 0 ) - { - while(d<0) - { - --x; - d += dy; - } - *(edgeP++) = x; - d -= dx; - } - } - else /* positive dx */ - { -#define P PREC - d = (dy*((x<>P; -#undef P - while(--count >= 0 ) - { - while(d<0) - { - ++x; - d += dy; - } - *(edgeP++) = x; - d -= dx; - } - } -} diff --git a/nx-X11/lib/font/Type1/lines.h b/nx-X11/lib/font/Type1/lines.h deleted file mode 100644 index f8ffd3a43..000000000 --- a/nx-X11/lib/font/Type1/lines.h +++ /dev/null @@ -1,39 +0,0 @@ -/* $Xorg: lines.h,v 1.3 2000/08/17 19:46:30 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/lines.h,v 1.3 1999/08/22 08:58:52 dawes Exp $ */ - -/*SHARED*/ - -#define StepLine(R,x1,y1,x2,y2) t1_StepLine(R,x1,y1,x2,y2) -#define Bresenham(e,x1,y1,x2,y2) t1_Bresenham(e,x1,y1,x2,y2) - -extern void t1_StepLine ( struct region *R, fractpel x1, fractpel y1, fractpel x2, fractpel y2 ); -extern void t1_Bresenham ( pel *edgeP, fractpel x1, fractpel y1, fractpel x2, fractpel y2 ); - -/*END SHARED*/ diff --git a/nx-X11/lib/font/Type1/minimain.c b/nx-X11/lib/font/Type1/minimain.c deleted file mode 100644 index 4aa826dc1..000000000 --- a/nx-X11/lib/font/Type1/minimain.c +++ /dev/null @@ -1,48 +0,0 @@ -/* $Xorg: minimain.c,v 1.4 2001/02/09 02:04:01 xorgcvs Exp $ */ - -/* - -Copyright 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -#include "ximager5.h" - -main() -{ - XYspace S; - path p; - - InitImager(); - S = Scale(IDENTITY, 300.0, -300.0); - p = Join(Line(Loc(S, 0.0, 1.0)), Line(Loc(S, 1.0, 0.0))); - Interior(ClosePath(p), EVENODDRULE); -} - -void Trace() -{ -} - -void *DEFAULTDEVICE; diff --git a/nx-X11/lib/font/Type1/module/Imakefile b/nx-X11/lib/font/Type1/module/Imakefile deleted file mode 100644 index db8ab54f7..000000000 --- a/nx-X11/lib/font/Type1/module/Imakefile +++ /dev/null @@ -1,99 +0,0 @@ -XCOMM $XFree86: xc/lib/font/Type1/module/Imakefile,v 1.6 1999/08/14 10:49:18 dawes Exp $ - -#define IHaveModules -#include - -INCLUDES = -I$(FONTINCSRC) -I../ -I../../include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/include - -#if BuildCID -CIDSRCS = cidchar.c afm.c -CIDOBJS = cidchar.o afm.o -#if HasUsableFileMmap -MMAPDEFINES = -DUSE_MMAP -#endif -CIDDEFINES = -DBUILDCID -DHAVE_CFM $(MMAPDEFINES) -#endif - -DEFINES = -DFONTMODULE $(CIDDEFINES) - -SRCS = \ - arith.c \ - curves.c \ - fontfcn.c \ - hints.c \ - lines.c \ - objects.c \ - paths.c \ - regions.c \ - scanfont.c \ - spaces.c \ - t1funcs.c \ - t1info.c \ - t1io.c \ - t1malloc.c \ - t1snap.c \ - t1stub.c \ - token.c \ - type1.c \ - util.c \ - t1unicode.c \ - $(CIDSRCS) \ - type1mod.c - -OBJS = \ - arith.o \ - curves.o \ - fontfcn.o \ - hints.o \ - lines.o \ - objects.o \ - paths.o \ - regions.o \ - scanfont.o \ - spaces.o \ - t1funcs.o \ - t1info.o \ - t1io.o \ - t1malloc.o \ - t1snap.o \ - t1stub.o \ - token.o \ - type1.o \ - util.o \ - t1unicode.o \ - $(CIDOBJS) \ - type1mod.o - -LinkSourceFile(arith.c,..) -LinkSourceFile(curves.c,..) -LinkSourceFile(fontfcn.c,..) -LinkSourceFile(hints.c,..) -LinkSourceFile(lines.c,..) -LinkSourceFile(objects.c,..) -LinkSourceFile(paths.c,..) -LinkSourceFile(regions.c,..) -LinkSourceFile(scanfont.c,..) -LinkSourceFile(spaces.c,..) -LinkSourceFile(t1funcs.c,..) -LinkSourceFile(t1info.c,..) -LinkSourceFile(t1io.c,..) -LinkSourceFile(t1malloc.c,..) -LinkSourceFile(t1snap.c,..) -LinkSourceFile(t1stub.c,..) -LinkSourceFile(t1unicode.c,..) -LinkSourceFile(token.c,..) -LinkSourceFile(type1.c,..) -LinkSourceFile(util.c,..) -#if BuildCID -LinkSourceFile(afm.c,..) -LinkSourceFile(cidchar.c,..) -#endif - -ModuleObjectRule() -LibraryModuleTarget(type1,$(OBJS)) -InstallLibraryModule(type1,$(MODULEDIR),fonts) - -DependTarget() - -InstallDriverSDKLibraryModule(type1,$(DRIVERSDKMODULEDIR),fonts) diff --git a/nx-X11/lib/font/Type1/module/type1mod.c b/nx-X11/lib/font/Type1/module/type1mod.c deleted file mode 100644 index e652591a2..000000000 --- a/nx-X11/lib/font/Type1/module/type1mod.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice 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 - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ -/* $XFree86: xc/lib/font/Type1/module/type1mod.c,v 1.10 2002/12/09 17:29:59 dawes Exp $ */ - -#include "misc.h" - -#include -#include "xf86Module.h" - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -static MODULESETUPPROTO(type1Setup); - - /* - * This is the module data function that is accessed when loading - * libtype1 as a module. - */ - -static XF86ModuleVersionInfo VersRec = -{ - "type1", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 2, - ABI_CLASS_FONT, /* Font module */ - ABI_FONT_VERSION, - MOD_CLASS_FONT, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData type1ModuleData = { &VersRec, type1Setup, NULL }; - -extern void Type1RegisterFontFileFunctions(void); -#ifdef BUILDCID -extern void CIDRegisterFontFileFunctions(void); -#endif - -FontModule type1Module = { - Type1RegisterFontFileFunctions, - "Type1", - NULL -}; - -#ifdef BUILDCID -FontModule CIDModule = { - CIDRegisterFontFileFunctions, - "CID", - NULL -}; -#endif - -static pointer -type1Setup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - type1Module.module = module; - LoadFont(&type1Module); -#ifdef BUILDCID - CIDModule.module = module; - LoadFont(&CIDModule); -#endif - - /* Need a non-NULL return */ - return (pointer)1; -} diff --git a/nx-X11/lib/font/Type1/objects.c b/nx-X11/lib/font/Type1/objects.c deleted file mode 100644 index c86587dba..000000000 --- a/nx-X11/lib/font/Type1/objects.c +++ /dev/null @@ -1,1101 +0,0 @@ -/* $Xorg: objects.c,v 1.3 2000/08/17 19:46:30 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/objects.c,v 1.10tsi Exp $ */ - /* OBJECTS CWEB V0025 ******** */ -/* -:h1.OBJECTS Module - TYPE1IMAGER Objects Common Routines - -This module defines and implements the C structures that represent -objects in the TYPE1IMAGER. All common routines for manipulating these -objects are defined in this module. Specific routines for -specific objects are defined in the modules that deal with that -object type. - - -&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) - - -:h3.Include Files - -The included files are: -*/ -#ifdef HAVE_CONFIG_H -#include -#endif -#define GLOBALS 1 /* see :hdref refid=debugvar. */ -/* -The following two includes are C standards; we include them because we -use 'toupper' and the 'str'-type functions in this module. Potentially -these may be defined as macros; if these ".h" files do not exist on your -system it is a pretty safe bet that these are external entry points and -you do do not need to include these header files. -*/ - -#ifndef FONTMODULE -#include -#include -#include -#include -#else -#include "Xdefs.h" /* Bool declaration */ -#include "Xmd.h" /* INT32 declaration */ -#include "os.h" -#include "xf86_ansic.h" -#endif - -/* -override incorrect system functions; for example you might define -a macro for "strcpy" that diverts it to "my_strcpy". -*/ - - /* moved these includes from above the */ - /* was included first (it contains com- */ - /* piler defines). dsr 081291 */ -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "regions.h" -#include "fonts.h" -#include "pictures.h" -#include "strokes.h" -#include "cluts.h" - - -static char *TypeFmt(int type); - -/* -:h3.The "pointer" Macro - Define a Generic Pointer - -Sadly, many compilers will give a warning message when a pointer to -one structure is assigned to a pointer to another. We've even seen -some that give severe errors (when the wrong pointer type is used as -an initializer or returned from a function). TYPE1IMAGER has routines -like Dup and Allocate that are perfectly willing to duplicate or -allocate any of a number of different types of structures. How to -declare them in a truely portable way? - -Well, there is no single good answer that I've found. You can always -beg the question and "cast" everything. I find this distracting and the -resulting code ugly. On the other hand, we have found at least one -compiler that will accept "void *" as a generic pointer that can -assigned to any other pointer type without error or warning (apparently -this is also the ANSI standard). So, we define "void *" to be a generic -pointer. (You might have to change this for your compiler; the "ifndef" -allows the change to be made on the command line if you want.) -:i1/portability assumptions/ -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.Functions Provided to the TYPE1IMAGER User - -This module provides the following TYPE1IMAGER entry points: -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -Note that entry points that are intended for use external to TYPE1IMAGER -begin with the characters :q/xi/. Macros are used to make the names -more mnemonic. -*/ - -/* -:h3.Functions Provided to Other Modules - -This module provides the following functions for other modules: -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -Note that entry points that intended for use within TYPE1IMAGER, but -which must be global because they are used across module boundaries, -begin with the characters :q/I_/. Macros are used to make the names -more mnemonic. - -Entry points totally within a module use mnemonic names and are -declared :hp2/static/. One of the compilers I used had a bug when -static functions were passed as addresses. Thus, some functions -which are logically "static" are not so declared. - -Note also the trick of declaring routines, like Consume(), with a -variable number of arguments. To avoid the restrictions on variable -numbers of arguments in the macro processor, we just replace the -text 'Consume' with 'I_Consume'. -*/ -/* -:h3.Macros Provided to Other Modules - -This is the module where we define all the useful constants like -TRUE, FALSE, and NULL, and simple expressions like MIN(), MAX(), and ABS(). -We might as well get to it right here: -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -Notice that upper case is used for constant values and macro -definitions. I generally follow that convention. - -Many more global macros are defined later in this module. -*/ -/* -:h2.Basic TYPE1IMAGER Object Structure - -All TYPE1IMAGER objects which are available to the user have a common -header. This header is defined below: -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -The following define is an attempt to centralize the definition of the -common xobject data shared by structures that are derived from the -generic xobject structure. For example, the structure font, defined in -fonts.shr : -&code. - struct font { - char type; - char flag; - int references; - ... other data types & structs ... - } -&ecode. -would now be defined as: -&code. - struct font { - XOBJ_COMMON - ... other data types & structs ... - } -&ecode. -Thus we have a better-structured inheritance mechanism. 3-26-91 PNM -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.Object Type Definitions - -These constants define the values which go in the 'type' field of -an TYPE1IMAGER object structure: -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.Flag Byte Definitions - -Many programmers define flag bits as a mask (for example, 0x04), and -test, set, and reset them as follows: - -&code. - if ((flag & PERMANENT) != 0) - - flag |= PERMANENT; - flag &= &inv.PERMANENT; -:exmp. - -I favor a style where the 'if' statement can ask a question: - -&code. - if (ISPERMANENT(flag)) - - flag |= ISPERMANENT(ON); - flag &= &inv.ISPERMANENT(ON); - -:exmp. -This said, we now define two bit settings of the flag byte of the -object. "ISPERMANENT" will be set by the user, when he calls -Permanent(). "ISIMMORTAL" will be used for compiled-in objects -that we don't want the user to ever destroy. -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -Flag bit definitions that apply to all objects are assigned -starting with the least significant (0x01) bit. Flag bit definitions -specific to a certain object type are assigned starting with the -most significant (0x80) bit. We hope they never meet. -*/ -/* -:h3 id=preserve.PRESERVE() Macro - -Occasionally an TYPE1IMAGER operator is implemented by calling other -TYPE1IMAGER operators. For example, Arc2() calls Conic(). When we -call more than one operator as a subroutine, we have to be careful -of temporary objects. A temporary object will be consumed by the -subroutine operator and then is no longer available for the caller. -This can be prevented simply by bumping a temporary object's reference -count. -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h3.RefRoll() Macro to Detect References Count Rollover - -The following macro is designed to check for reference count rollover. -A return value of TRUE means rollover has not occurred; a return value -of FALSE means we cannot increment the reference count. Note also that -those functions that use this macro must decrement the reference count -afterwards. 3-26-91 PNM -*/ - -#define RefRoll(obj) (++(obj)->references > 0) - -/* -:h2.TYPE1IMAGER Object Functions - -:h3.LONGCOPY() - Macro to Copy "long" Aligned Data - -Copying arbitrary bytes in C is a bit of a problem. "strcpy" can't be -used, because 0 bytes are special-cased. Most environments have a -routine "memcopy" or "bcopy" or "bytecopy" that copies memory containing -zero bytes. Sadly, there is no standard on the name of such a routine, -which makes it impossible to write truely portable code to use it. - -It turns out that TYPE1IMAGER, when it wants to copy data, frequently -knows that both the source and destination are aligned on "long" -boundaries. This allows us to copy by using "long *" pointers. This -is usually very efficient on almost all processors. Frequently, it -is more efficient than using general-purpose assembly language routines. -So, we define a macro to do this in a portable way. "dest" and "source" -must be long-aligned, and "bytes" must be a multiple of "sizeof(long)": -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.Allocate() - Allocating a Memory Block - -Allocate returns a pointer to memory object that is a copy of -the template passed (if any). In addition, extra bytes may be -allocated contiguously with the object. (This may be useful for -variable size objects such as edge lists. See :hdref refid=regions..) - -Allocate() always returns a non-immortal object, even if the template is -immortal. Therefore a non-NULL template must have a "flag" byte. - -If the template is NULL, then 'size' bytes are cleared to all NULLs. - -If the template is non-NULL, a new object is allocated in memory. -It therefore seems logical that its reference count field should be -set to 1. So, a nun-NULL template must also have a "references" field. -PNM 3-26-91 -*/ - -struct xobject * -t1_Allocate(int size, /* number of bytes to allocate & initialize */ - pointer ptr, /* example structure to allocate */ - int extra) /* any extra uninitialized bytes needed contiguously */ -{ - register struct xobject *template = (struct xobject *)ptr; - register struct xobject *r; - - /* - * round up 'size' and 'extra' to be an integer number of 'long's: - */ - size = (size + sizeof(long) - 1) & -(int)sizeof(long); - extra = (extra + sizeof(long) - 1) & -(int)sizeof(long); - if (size + extra <= 0) - Abort("Non-positive allocate?"); - r = (struct xobject *) xiMalloc(size + extra); - - while (r == NULL) { - if (!GimeSpace()) { - Abort("We have REALLY run out of memory"); - } - r = (struct xobject *) xiMalloc(size + extra); - } - - /* - * copy the template into the new memory: - */ - if (template != NULL) { - /* Added references count decrement if template is not permanent. - This is for the case where Allocate is called by a Dupxxxx - function, which was in turn called by Unique(). (PNM) */ - if (!ISPERMANENT(template->flag)) - --template->references; - LONGCOPY(r, template, size); - r->flag &= ~(ISPERMANENT(ON) | ISIMMORTAL(ON)); - /* added reference field 3-2-6-91 PNM */ - r->references = 1; - } - else { - register char **p1; - - for (p1=(char **)r; size > 0; size -= sizeof(char *)) - *p1++ = NULL; - } - - return(r); -} - -/* -:h3.Free() - Frees an Allocated Object - -This routine makes a sanity check to make sure the "type" field of the -standard object structure has not been cleared. If the object is -not a standard structure, then the macro "NonObjectFree" is available -that does not perform this check. - -In either case, the object must not be the NULL pointer. This preserves -portability, as the C system xiFree() will not always accept NULL. -*/ - -void -Free(pointer objPtr) -{ - struct xobject *obj = (struct xobject *)objPtr; /* structure to free */ - - if (obj->type == INVALIDTYPE) - Abort("Free of already freed object?"); - obj->type = INVALIDTYPE; - - xiFree((long *)obj); -} - -/* -:h3.Permanent() - Makes an Object Permanent - -Real simple--just set a flag. Every routine that consumes its objects -(which is almost every user entry) must check this flag, and not consume -the object if it is set. - -If a temporary object is made permanent, and there is more than one -reference to it, we must first Copy() it, then set the ISPERMANENT -flag. Note also that the reference count must be incremented when an -object is changed from temporary to permanent (see the ISUNIQUE macro). - -Note that the purpose of this function is to convert an object into a -permanent object: - If it was permanent to begin with, we do nothing; - If it was temporary and unique, we set the PERMANENT flag and increment -the reference count; - If it was temporary and nonunique, we must make a unique Copy(), set -the PERMANENT flag, and set the reference count to 2. We must also -decrement the original object's reference count, because what we have -done is to change one of the old temporary handles to a permanent one. -3-26-91 PNM -*/ - -struct xobject * -t1_Permanent(pointer objPtr) -{ - struct xobject *obj = (struct xobject *)objPtr; /* object to be made permanent */ - - if ( (obj != NULL) && ( !(ISPERMANENT(obj->flag)) ) ) - { - /* there is a non-NULL, temporary object to be made permanent. - If there are multiple references to this object, first get - a new COPY(). - Note also that we have to decrement the reference count if - we do a Copy() here, because we are consuming the temporary - argument passed, and returning a unique, permanent one. - */ - if ( obj->references > 1) - { - obj = Copy(obj); - } - /* now set the permanent flag, and increment the reference - count, since a temporary object has now become permanent. */ - obj->references++; - obj->flag |= ISPERMANENT(ON); - } - return(obj); -} - -#ifdef notused -/* -:h3.Temporary() - Undoes the Effect of "Permanent()" - -This simply resets the "ISPERMANENT" flag. - -If a permanent object is made temporary, and there is more than one reference -to it, we must first Copy() it, then reset the ISPERMANENT flag. However, -if the permanent object has obly one reference, we need only decrement the -reference count ( and reset the flag). - -Note that this function, in the case of a PERMANENT argument, basically -converts the PERMANENT handle to a TEMPORARY one. Thus, in the case of -a nonunique, permanent argument passed, we not only make a Copy(), -we also decrement the reference count, to reflect the fact that we have -lost a permanent handle and gained a temporary one. -PNM 3-2-6-91 -*/ - -struct xobject * -xiTemporary(pointer objPtr) -{ - register struct xobject *obj - = (struct xobject *)objPtr; /* object to be made permanent */ - if (obj != NULL) { - /* if it's already temporary, there's nothing to do. */ - if ISPERMANENT(obj->flag) - { - /* if there are multiple references to this object, get a - Copy we can safely alter. Recall that the reference count - is incremented for permanent objects. - Recall further that Copy returns an object with the - same flag state and a reference count of 2 (for PERMANENT - objects). - Thus, regardless of whether or not we need to copy a - permanent object, we still decrement its reference - count and reset the flag. - */ - if (obj->references != 2 || ISIMMORTAL(obj->flag)) - { - /* not unique; consume handle, get a temporary Copy! */ - obj = Copy(obj); - } - /* else decrement the reference count (since it's going from - permanent to temporary) and clear the flag. */ - else { - obj->references--; - obj->flag &= ~ISPERMANENT(ON); - } - } - } - return(obj); -} -#endif /* notused */ - -/* -:h3.Dup() - Duplicate an Object - -Dup will increment the reference count of an object, only making a -Copy() if needed. -Note that Dup() retains the state of the permanent flag. -3-26-91 PNM -*/ - - -struct xobject * -t1_Dup(pointer objPtr) -{ - register struct xobject *obj - = (struct xobject *)objPtr; /* object to be duplicated */ - register char oldflag; /* copy of original object's flag byte */ - - if (obj == NULL) - return(NULL); - /* An immortal object must be Copy'ed, so that we get a mortal - copy of it, since we try not to destroy immortal objects. */ - if (ISIMMORTAL(obj->flag)) - return(Copy(obj)); - - /* if incrementing the reference count doesn't cause the count - to wrap, simply return the object with the count bumped. Note - that the RefRoll macro increments the count to perform the - rollover check, so we must decrement the count. */ - if (RefRoll(obj)) - return(obj); - - /* that didn't work out, so put the count back and call Copy(). */ - --obj->references; - oldflag = obj->flag; - obj = Copy(obj); - if (ISPERMANENT(oldflag)) - obj = Permanent(obj); - return(obj); -} - -/* -:h3.Copy() - Make a New Copy of an Object - -This is the generic Copy() where the object type is unknown. There -are specific Copyxxx functions for known object types. - -Copy will create a NEW temporary object, and WILL NOT simply bump the -reference count. - -Sometimes duplicating an object is just as simple as Allocating with it -as a template. But other objects are complicated linked lists. So, we -let each module provide us a routine (or macro) that duplicates the -objects it knows about. -*/ - -struct xobject * -t1_Copy(pointer objPtr) -{ - register struct xobject *obj - = (struct xobject *)objPtr; /* object to be Copy'ed */ - if (obj == NULL) - return(NULL); - - if (ISPATHTYPE(obj->type)) - obj = (struct xobject *) CopyPath((struct segment *)obj); - else - switch (obj->type) { - case SPACETYPE: - obj = (struct xobject *) - CopySpace((struct XYspace *)obj); - break; - case FONTTYPE: - obj = (struct xobject *) CopyFont(obj); break; - case REGIONTYPE: - obj = (struct xobject *) - CopyRegion((struct region *)obj); - break; - case PICTURETYPE: - obj = (struct xobject *) CopyPicture(obj); break; - case LINESTYLETYPE: - obj = (struct xobject *) CopyLineStyle(obj); break; - case STROKEPATHTYPE: - obj = (struct xobject *) CopyStrokePath(obj); break; - case CLUTTYPE: - obj = (struct xobject *) CopyCLUT(obj); break; - default: - return(ArgErr("Copy: invalid object", obj, NULL)); - } - - return(obj); -} - -/* -:h3.Destroy() - Destroys an Object - -This can get complicated. Just like with Copy(), we let the experts -handle it. -*/ -struct xobject * -Destroy(pointer objPtr) -{ - register struct xobject *obj - = (struct xobject *)objPtr; /* object to be destroyed */ - if (obj == NULL) - return(NULL); - if (ISIMMORTAL(obj->flag)) { - return(NULL); - } - if (ISPATHTYPE(obj->type)) - KillPath((struct segment *)obj); - else { - switch (obj->type) { - case REGIONTYPE: - KillRegion((struct region *)obj); - break; - case SPACETYPE: - KillSpace(obj); - break; - case LINESTYLETYPE: - KillLineStyle(obj); - break; - case FONTTYPE: - KillFont(obj); - break; - case PICTURETYPE: - KillPicture(obj); - break; - case STROKEPATHTYPE: - KillStrokePath(obj); - break; - case CLUTTYPE: - KillCLUT(obj); - break; - default: - return(ArgErr("Destroy: invalid object", obj, NULL)); - } - } - return(NULL); -} -/* -:h2.Generally Useful Macros - -:h3.FOLLOWING() - Macro to Point to the Data Following a Structure - -There are several places in TYPE1IMAGER where we will allocate variable -data that belongs to a structure immediately after that structure. -This is a performance technique, because it reduces the number of -trips we have to take through xiMalloc() and xiFree(). It turns out C has -a very convenient way to point past a structure--if 'p' is a pointer -to a structure, 'p+1' is a pointer to the data after it. This -behavior of C is somewhat startling and somewhat hard to follow, if -you are not used to it, so we define a macro to point to the data -following a structure: -*/ -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.TYPECHECK() - Verify the Type of an Argument - -This macro tests the type of an argument. If the test fails, it consumes -any other arguments as necessary and causes the imbedding routine to -return the value 'whenBAD'. - -Note that the consumeables list should be an argument list itself, for -example (0) or (2,A,B). See :hdref refid=consume. below. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.ARGCHECK() - Perform an Arbitrary Check on an Argument - -This macro is a generalization of TYPECHECK to take an arbitrary -predicate. If the error occurs (i.e., the predicate is true), the -arbitrary message 'msg' is returned. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.TYPENULLCHECK() - Extension of TYPECHECK() for NULL arguments - -Many routines allow NULLs to be passed as arguments. 'whenBAD' will -be returned in this case, too. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.MAKECONSUME() - Create a "Consume"-type Macro - -Consuming an object means destroying it if it is not permanent. This -logic is so common to all the routines, that it is immortalized in this -macro. For example, ConsumePath(p) can be simply defined as -MAKECONSUME(p,KillPath(p)). In effect, this macro operates on a -meta-level. -:i1/consuming objects/ -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h3.MAKEUNIQUE() - Create a "Unique"-type Macro - -Many routines are written to modify their arguments in place. Thus, -they want to insure that they duplicate an object if it is permanent. -This is called making an object "unique". For example, UniquePath(p) -can be simply defined as MAKEUNIQUE(p,DupPath(p)). -:i1/unique objects/ -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -An object is unique (and directly alterable) if there is only one -reference to it, and it is not permanent (in which case we increment -the reference count, so we don't have to check the permanent bit). -3-26-91 PNM - -Note the rules for making a unique object: -&drawing. - IF (obj->references = 1) return(obj); - ELSE (references > 1) - IF (ISPERMANENT(obj->flag)) return(Dupxxx(obj)); - ELSE (nonunique, temporary object!) - obj->references--; return(Dupxxx(obj)); -&edrawing. -If we must make a Copy of a nonunique, temporary object, we decrement -reference count of the original object! -*/ - -/* -:h3.Unique() - Make a Unique Object - -Here is a generic 'Unique' function if the object type is not known. -Why didn't we build it with the MAKEUNIQUE macro, you ask? Well, we -used to, but there is at least one damn compiler in the world that -raises errors if the types of an "(a) ? b : c" expression do not match. -Also, when we changed Dup() to retain the permanent/temporary flag, we -wanted to make sure "Unique" always returned a temporary object. - -Note that we cannot use Dup() to create a copy of the object in question, -because Dup() may simply bump the reference count, and not return a -unique copy to us. That is why we use t1_Copy(). - -The purpose of this function is to make sure we have a copy of an object -that we can safely alter: -:ol. -:li.If we have a unique, temporary object, we simply return the argument. -:li.If we have a nonunique, temporary object, we have to make a new copy -of it, and decrement the reference count of the original object, to reflect -the fact that we traded temporary handles. -:li.If we have a permanent object, we make a temporary copy of it, but -we do not decrement the reference count of the original permanent object, -because permanent objects, by definition, are persistent. 3-2-6-91 PNM -:eol. -*/ - -struct xobject * -t1_Unique(pointer objPtr) -{ - struct xobject *obj = (struct xobject *)objPtr; - - /* if the original object is not already unique, make a unique - copy...Note also that if the object was not permanent, we must - consume the old handle! 3-26-91 PNM - NOTE : consumption of the old handle moved to Allocate. 4-18-91 */ - if (!obj || obj->references == 1) - return(obj); - - obj = Copy(obj); - /* and make sure we return a temporary object ! */ - if (ISPERMANENT(obj->flag)) - { - obj->flag &= ~ISPERMANENT(ON); - obj->references--; - } - return(obj); -} - - -/* -:h2.Initialization, Error, and Debug Routines - -:h3 id=debugvar.Declarations for Debug Purposes - -We declare all the debug flags here. Some link editors make the not -unreasonable restriction that only one module may declare and -initialize global variables; all the rest must declare the variable -'extern'. This is logical, but is somewhat awkward to implement with -C include files. We solve the problem by temporarily making the name -'extern' a null name if GLOBALS is defined. (GLOBALS is only defined -in this OBJECTS module.) Since 'externs' can't be initialized, we -have to handle that with #defines too. -:i1/GLOBALS (&#define.)/ -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -static char *ErrorMessage = NULL; - -/* -:h3.Pragmatics() - Set/Reset Debug Flags - -We provide a controlled way for the TYPE1IMAGER user to set and reset -our debugging and tracing: -*/ -void -Pragmatics(char *username, /* name of the flag */ - int value) /* value to set it to */ -{ - register char *p; /* temporary loop variable */ -#define NAMESIZE 40 - char name[NAMESIZE]; /* buffer to store my copy of 'username' */ - - if (strlen(username) >= (unsigned)NAMESIZE) - Abort("Pragmatics name too large"); - strcpy(name, username); - for (p = name; *p != '\0'; p++) - *p = toupper(*p); - - if (!strcmp(name, "ALL")) - MustTraceCalls = InternalTrace = /* MustCrash = */ - LineIOTrace = value; - - else if (!strcmp(name, "LINEIOTRACE")) - LineIOTrace = value; - - else if (!strcmp(name, "TRACECALLS")) - MustTraceCalls = value; - - else if (!strcmp(name, "CHECKARGS")) - MustCheckArgs = value; - - else if (!strcmp(name, "PROCESSHINTS")) - ProcessHints = value; - - else if (!strcmp(name, "SAVEFONTPATHS")) - SaveFontPaths = value; - - else if (!strcmp(name, "CRASTERCOMPRESSIONTYPE")) - CRASTERCompressionType = value; - - else if (!strcmp(name, "CRASHONUSERERROR")) - MustCrash = value; - - else if (!strcmp(name, "DEBUG")) - StrokeDebug = SpaceDebug = PathDebug = ConicDebug = LineDebug = - RegionDebug = MemoryDebug = FontDebug = - HintDebug = ImageDebug = OffPageDebug = value; - - else if (!strcmp(name, "CONICDEBUG")) - ConicDebug = value; - - else if (!strcmp(name, "LINEDEBUG")) - LineDebug = value; - - else if (!strcmp(name, "REGIONDEBUG")) - RegionDebug = value; - - else if (!strcmp(name, "PATHDEBUG")) - PathDebug = value; - - else if (!strcmp(name, "SPACEDEBUG")) - SpaceDebug = value; - - else if (!strcmp(name, "STROKEDEBUG")) - StrokeDebug = value; - - else if (!strcmp(name, "MEMORYDEBUG")) - MemoryDebug = value; - - else if (!strcmp(name, "FONTDEBUG")) - FontDebug = value; - - else if (!strcmp(name, "HINTDEBUG")) - HintDebug = value; - - else if (!strcmp(name, "IMAGEDEBUG")) - ImageDebug = value; - - else if (!strcmp(name, "OFFPAGEDEBUG")) - OffPageDebug = value; - -#ifdef MC68000 -/* -The following pragmatics flag turns on or off instruction histograming -for performance analysis. It is only defined in the Delta card -environment. -*/ - else if (!strcmp(name, "PROFILE")) { - if (value) - StartProfile(); - else - StopProfile(); - } -#endif - else if (!strcmp(name, "FLUSHCACHE")) { -#ifdef notdef - while (GimeSpace()) { ; } -#endif - } - - else if (!strcmp(name, "CACHEDCHARS")) - CachedChars = (value <= 0) ? 1 : value; - - else if (!strcmp(name, "CACHEDFONTS")) - CachedFonts = (value <= 0) ? 1 : value; - - else if (!strcmp(name, "CACHEBLIMIT")) - CacheBLimit = value; - - else if (!strcmp(name, "CONTINUITY")) - Continuity = value; - - - else { - printf("Pragmatics flag = '%s'\n", name); - ArgErr("Pragmatics: flag not known", NULL, NULL); - } - return; -} - -/* -:h3.Consume() - Consume a List of Arguments - -This general purpose routine is provided in the case where the object -type(s) to be consumed are unknown or not yet verified, and/or it is -not known whether the object is permanent. - -If the type of the argument is known, it is faster to directly consume -that type, for example, ConsumeRegion() or ConsumePath(). Furthermore, -if it is already known that the object is temporary, it is faster to -just kill it rather than consume it, for example, KillSpace(). -*/ - -void -Consume(int n, ...) -{ - struct xobject *obj; - va_list ap; - - va_start(ap, n); - - while (n-- > 0) { - obj = va_arg(ap, struct xobject *); - if (obj != NULL && !ISPERMANENT(obj->flag)) - Destroy(obj); - } -} - -/* -:h3.TypeErr() - Handles "Invalid Object Type" Errors -*/ - -struct xobject * -TypeErr(char *name, /* Name of routine (for error message) */ - pointer objPtr, /* Object in error */ - int expect, /* type expected */ - pointer retPtr) /* object to return to caller */ -{ - struct xobject *obj = (struct xobject *)objPtr; - struct xobject *ret = (struct xobject *)retPtr; - /* - * This buffer must be large enough to hold 'name' plus - * two of the largest strings that can be returned by TypeFmt. - * The largest value of 'name' is currently 9 ("ClosePath") - * and the longest strings in TypeFmt are 30 characters. - */ - static char typemsg[115]; - - if (MustCrash) - LineIOTrace = TRUE; - - sprintf(typemsg, "Wrong object type in %s. Expected %s; was %s.\n", - name, TypeFmt(expect), TypeFmt(obj->type)); - - if (MustCrash) - Abort("Terminating because of CrashOnUserError..."); - else - ErrorMessage = typemsg; - -/* changed ISPERMANENT to ret->references > 1 3-26-91 PNM */ - if (ret != NULL && (ret->references > 1)) - ret = Dup(ret); - return(ret); -} - -/* -:h4.TypeFmt() - Returns Pointer to English Name of Object Type - -This is a subroutine of TypeErr(). -*/ - -static char * -TypeFmt(int type) /* type field */ -{ - char *r; - - if (ISPATHTYPE(type)) - if (type == TEXTTYPE) - r = "path or region (from TextPath)"; - else - r = "path"; - else { - switch (type) { - case INVALIDTYPE: - r = "INVALID (previously consumed?)"; - break; - case REGIONTYPE: - r = "region"; - break; - case SPACETYPE: - r = "XYspace"; - break; - case LINESTYLETYPE: - r = "linestyle"; - break; - case FONTTYPE: - r = "font"; - break; - case PICTURETYPE: - r = "picture"; - break; - case STROKEPATHTYPE: - r = "path (from StrokePath)"; - break; - default: - r = "UNKNOWN"; - break; - } - } - return(r); -} -/* -:h3.ArgErr() - Invalid Argument Passed to a Routine - -A common routine to report argument errors. It is usually called -is returned to the caller in case MustCrash is FALSE and ArgErr -returns to its caller. -*/ - -struct xobject * -ArgErr(char *string, /* description of error */ - pointer objPtr, /* object, if any, that was in error */ - pointer retPtr) /* object returned to caller or NULL */ -{ - struct xobject *ret = (struct xobject *)retPtr; - - if (MustCrash) - LineIOTrace = TRUE; - - if (MustCrash) - Abort("Terminating because of CrashOnUserError..."); - else - ErrorMessage = string; - return(ret); -} - -/* -:h3.Abort() - Crash Due to Error - -Defined in objects.h to be FatalError(), the server's abort routine. -*/ - -/* -:h3.REAL Miscellaneous Stuff - -:h4.ErrorMsg() - Return the User an Error Message -*/ - -char * -ErrorMsg(void) -{ - register char *r; - - r = ErrorMessage; - ErrorMessage = NULL; - return(r); -} - -/* -:h4.InitImager() - Initialize TYPE1IMAGER - -We check that a short is 16 bits and a long 32 bits; we have made -those assumptions elsewhere in the code. (This is almost a C standard, -anyway.) Note that TYPE1IMAGER makes no assumptions about the size of an -'int'! -:i1/portability assumptions/ -*/ - -void -InitImager(void) -{ - -/* Check to see if we have been using our own malloc. If so,*/ -/* Undef malloc so that we can get to the system call. */ -/* All other calls to malloc are defined to xiMalloc. */ - - -/* if (sizeof(short) != 2 || sizeof(INT32) != 4) - Abort("Fundamental TYPE1IMAGER assumptions invalid in this port"); -*/ - InitSpaces(); - InitFonts(); - InitFiles(); -/* -In some environments, constants and/or exception handling need to be -*/ - LibInit(); -} -/* -:h4.TermImager() - Terminate TYPE1IMAGER - -This only makes sense in a server environment; true TYPE1IMAGER needs do -nothing. -*/ -void -TermImager(void) -{ - return; -} -#ifdef notused -/* -:h4.reportusage() - A Stub to Get a Clean Link with Portable PMP -*/ -void -reportusage(void) -{ - return; -} -#endif diff --git a/nx-X11/lib/font/Type1/objects.h b/nx-X11/lib/font/Type1/objects.h deleted file mode 100644 index 7552f98d9..000000000 --- a/nx-X11/lib/font/Type1/objects.h +++ /dev/null @@ -1,354 +0,0 @@ -/* $Xorg: objects.h,v 1.3 2000/08/17 19:46:31 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/objects.h,v 1.14tsi Exp $ */ -/*SHARED*/ - -/*END SHARED*/ -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#include -#include -#ifndef FONTMODULE -#include -#endif -/*SHARED*/ - -#define Permanent(obj) t1_Permanent(obj) -#ifdef notused -#define Temporary(obj) t1_Temporary(obj) -#endif -#define Destroy(obj) t1_Destroy(obj) -#define Dup(obj) t1_Dup(obj) -#define InitImager t1_InitImager -#define TermImager t1_TermImager -#define Pragmatics(f,v) t1_Pragmatics(f,v) -#define ErrorMsg t1_ErrorMsg - -/* make an object permanent */ -extern struct xobject *t1_Permanent ( pointer obj ); - -#ifdef notused -/* make an object temporary */ -extern struct xobject *t1_Temporary( pointer obj ); -#endif - -/* destroy an object */ -extern struct xobject *t1_Destroy ( pointer obj ); - -/* duplicate an object */ -extern struct xobject *t1_Dup ( pointer obj ); - - -extern void t1_InitImager ( void ); /* initialize TYPE1IMAGER */ -extern void t1_TermImager ( void ); /* terminate TYPE1IMAGER */ -/* set debug flags, etc. */ -extern void t1_Pragmatics ( char *username, int value ); - -/* return last TYPE1IMAGER error message */ -extern char *t1_ErrorMsg ( void ); - -/*END SHARED*/ -/*SHARED*/ -extern void xiFree ( long *addr ); -extern char *xiMalloc ( unsigned Size ); -extern void addmemory ( long *addr, long size ); -extern void delmemory ( void ); - -#ifndef OS_H -extern void FatalError(const char *f, ...) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4))) -__attribute((noreturn)) -#endif -; - -extern void ErrorF(const char *f, ...); -#endif - -#define Abort(line) FatalError(line) -#define Allocate(n,t,s) t1_Allocate(n,t,s) -#define Free(obj) t1_Free(obj) -#define NonObjectFree(a) xiFree((long *)(a)) -#define Consume t1_Consume -#define ArgErr(s,o,r) t1_ArgErr(s,o,r) -#define TypeErr(n,o,e,r) t1_TypeErr(n,o,e,r) -#define Copy(obj) t1_Copy(obj) -#define Unique(obj) t1_Unique(obj) - -/* allocate memory */ -extern struct xobject *t1_Allocate( int size, pointer template, - int extra ); - -/* free memory */ -extern void t1_Free ( pointer obj ); - -/* make a unique temporary copy of an object */ -extern struct xobject *t1_Unique ( pointer obj ); - -/* handle argument errors */ -extern struct xobject *t1_ArgErr ( char *string, pointer obj, pointer ret ); - -/* handle 'bad type' argument errors */ -extern struct xobject *t1_TypeErr ( char *name, pointer obj, - int expect, pointer ret ); - -/* consume a variable number of arguments */ -extern void t1_Consume ( int n, ... ); - -/* make a new copy, not reference bump PNM */ -extern struct xobject *t1_Copy ( pointer obj ); - - -/*END SHARED*/ -/*SHARED*/ - -#define ON (~0) /* all bits on */ -#ifndef FALSE -#define FALSE 0 /* handy zero value */ -#endif -#ifndef TRUE -#define TRUE 1 /* handy non-zero value */ -#endif - -#ifndef NULL -#include -/* -The NULL pointer is system specific. (Most systems, however, use 0.) -TYPE1IMAGER could have its own NULL, independent of the rest of the system, -were it not for malloc(). The system call malloc() returns NULL when -out of memory. -:i1/portibility assumptions/ -*/ -#endif - -#ifndef MIN -#define MIN(a,b) (((a)<(b)) ? a : b) -#endif -#ifndef MAX -#define MAX(a,b) (((a)>(b)) ? a : b) -#endif -#ifndef ABS -#define ABS(a) (((a)>=0)?(a):-(a)) -#endif - -/*END SHARED*/ -/*SHARED*/ - -struct xobject { - char type; /* encoded type of object */ - unsigned char flag; /* flag byte for temporary object characteristics*/ - short references; /* count of pointers to this object - (plus 1 for permanent objects) PNM */ -} ; - -/*END SHARED*/ -/*SHARED*/ - -#define XOBJ_COMMON char type; unsigned char flag; short references; - -/*END SHARED*/ -/*SHARED*/ - - -#define INVALIDTYPE 0 -#define FONTTYPE 1 -#define REGIONTYPE 3 -#define PICTURETYPE 4 -#define SPACETYPE 5 -#define LINESTYLETYPE 6 -#define EDGETYPE 7 -#define STROKEPATHTYPE 8 -#define CLUTTYPE 9 - -#define ISPATHTYPE(type) ((type)&0x10) /* all path segments have this bit on */ -#define LINETYPE (0+ISPATHTYPE(ON)) -#define CONICTYPE (1+ISPATHTYPE(ON)) -#define BEZIERTYPE (2+ISPATHTYPE(ON)) -#define HINTTYPE (3+ISPATHTYPE(ON)) - -#define MOVETYPE (5+ISPATHTYPE(ON)) -#define TEXTTYPE (6+ISPATHTYPE(ON)) - -/*END SHARED*/ -/*SHARED*/ - -#define ISPERMANENT(flag) ((flag)&0x01) -#define ISIMMORTAL(flag) ((flag)&0x02) - -/*END SHARED*/ -/*SHARED*/ - -#define PRESERVE(obj) if (!ISPERMANENT((obj)->flag)) \ - (obj)->references++; - -/*END SHARED*/ -/*SHARED*/ - -#define LONGCOPY(dest,source,bytes) { \ - register long *p1 = (long *)dest; register long *p2 = (long *)source; \ - register int count = (bytes) / sizeof(long); \ - while (--count >= 0) *p1++ = *p2++; } - - -/*END SHARED*/ -/*SHARED*/ - -#define FOLLOWING(p) ((p)+1) - -/*END SHARED*/ -/*SHARED*/ - -#define TYPECHECK(name, obj, expect, whenBAD, consumables, rettype) { \ - if (obj->type != expect) { \ - (Consume)consumables; \ - return((rettype)TypeErr(name, obj, expect, whenBAD)); \ - } \ -} - -/*END SHARED*/ -/*SHARED*/ - -#define ARGCHECK(test,msg,obj,whenBAD,consumables,rettype) { \ - if (test) { \ - (Consume)consumables; \ - return((rettype)ArgErr(msg, obj, whenBAD)); \ - } \ -} - -/*END SHARED*/ -/*SHARED*/ - -/* Changed use of Dup() below to Temporary(Copy()) because Dup() does not - necessarily return a Unique Copy anymore! 3-26-91 */ -#define TYPENULLCHECK(name, obj, expect, whenBAD, consumables,rettype) \ - if (obj == NULL) { \ - (Consume)consumables; \ - if (whenBAD != NULL && ISPERMANENT(whenBAD->flag)) \ - return((rettype)Temporary(Copy(whenBAD))); \ - else return((rettype)whenBAD); \ - } else { \ - if (obj->type != expect) { \ - (Consume)consumables; \ - return((rettype)TypeErr(name, obj, expect, whenBAD)); \ - } \ - } -/*END SHARED*/ -/*SHARED*/ - -#define MAKECONSUME(obj,stmt) { if (!ISPERMANENT(obj->flag)) stmt; } - -/*END SHARED*/ -/*SHARED*/ - -#define MAKEUNIQUE(obj,stmt) ( ( (obj)->references > 1 ) ? stmt : obj ) - -/*END SHARED*/ -/*SHARED*/ - -#ifdef GLOBALS - -#define extern -#define INITIALIZED(value) = value - -#else - -#define INITIALIZED(value) - -#endif - -extern char MustCheckArgs INITIALIZED(TRUE); -extern char MustTraceCalls INITIALIZED(FALSE); -#if XFONT_CID -extern char MustCrash INITIALIZED(FALSE); -#else -extern char MustCrash INITIALIZED(TRUE); -#endif -extern char InternalTrace INITIALIZED(TRUE); -extern char LineIOTrace INITIALIZED(TRUE); - -extern char ProcessHints INITIALIZED(TRUE); - -extern char SaveFontPaths INITIALIZED(TRUE); - -extern short CRASTERCompressionType INITIALIZED(1); - -extern char ConicDebug INITIALIZED(0); -extern char LineDebug INITIALIZED(0); -extern char RegionDebug INITIALIZED(0); -extern char PathDebug INITIALIZED(0); -extern char FontDebug INITIALIZED(0); -extern char SpaceDebug INITIALIZED(0); -extern char StrokeDebug INITIALIZED(0); -extern char MemoryDebug INITIALIZED(0); -extern char HintDebug INITIALIZED(0); -extern char ImageDebug INITIALIZED(0); -extern char OffPageDebug INITIALIZED(0); - -extern short CachedChars INITIALIZED(0x7FFF); -extern short CachedFonts INITIALIZED(0x7FFF); -extern int CacheBLimit INITIALIZED(12500); -extern char Continuity INITIALIZED(2); - -#ifdef extern -#undef extern -#endif - -/* -We define other routines formatting parameters -*/ -#define DumpArea(area) t1_DumpArea(area) -#define DumpText(text) t1_DumpText(text) -#define DumpPath(path) t1_DumpPath(path) -#define DumpSpace(space) t1_DumpSpace(space) -#define DumpEdges(e) t1_DumpEdges(e) -#define FormatFP(s,p) t1_FormatFP(s,p) - -/* dump a textpath structure */ -extern void t1_DumpText(void); - -/*END SHARED*/ diff --git a/nx-X11/lib/font/Type1/paths.c b/nx-X11/lib/font/Type1/paths.c deleted file mode 100644 index 1ab25ecef..000000000 --- a/nx-X11/lib/font/Type1/paths.c +++ /dev/null @@ -1,1406 +0,0 @@ -/* $Xorg: paths.c,v 1.3 2000/08/17 19:46:31 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/paths.c,v 1.7tsi Exp $ */ - - /* PATHS CWEB V0021 ******** */ -/* -:h1 id=paths.PATHS Module - Path Operator Handler - -This is the module that is responsible for building and transforming -path lists. - -&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) - - -:h3.Include Files - -The included files are: -*/ - - /* after the system includes (dsr) */ -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef FONTMODULE -# include "os.h" -#endif -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "regions.h" /* understands about Union */ -#include "fonts.h" /* understands about TEXTTYPEs */ -#include "pictures.h" /* understands about handles */ -#include "strokes.h" /* understands how to coerce stroke paths */ -#include "trig.h" - - -/* -:h3.Routines Available to the TYPE1IMAGER User - -The PATHS routines that are made available to the outside user are: -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.Functions Provided to Other Modules - -The path routines that are made available to other TYPE1IMAGER modules -are defined here: -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -NOTE: because of the casts put in the macros for Loc, ArcCA, Conic, -RoundConic, PathSegment, and JoinSegment, we cannot use the macro names -when the functions are actually defined. We have to use the unique -names with their unique first two characters. Thus, if anyone in the -future ever decided to change the first two characters, it would not be -enough just to change the macro (as it would for most other functions). -He would have to also change the function definition. -*/ -/* -:h3.Macros Provided to Other Modules - -The CONCAT macro is defined here and used in the STROKES module. See -:hdref refid=pathmac.. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h2.Path Segment Structures - -A path is represented as a linked list of the following structure: -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -When 'link' is NULL, we are at the last segment in the path (surprise!). - -'last' is only non-NULL on the first segment of a path, -for all the other segments 'last' == NULL. We test for a non-NULL -'last' (ISPATHANCHOR predicate) when we are given an alleged path -to make sure the user is not trying to pull a fast one on us. - -A path may be a collection of disjoint paths. Every break in the -disjoint path is represented by a MOVETYPE segment. - -Closed paths are discussed in :hdref refid=close.. - -:h3.CopyPath() - Physically Duplicating a Path - -This simple function illustrates moving through the path linked list. -Duplicating a segment just involves making a copy of it, except for -text, which has some auxilliary things involved. We don't feel -competent to duplicate text in this module, so we call someone who -knows how (in the FONTS module). -*/ -struct segment * -CopyPath(struct segment *p0) /* path to duplicate */ -{ - register struct segment *p,*n = NULL,*last = NULL,*anchor; - - for (p = p0, anchor = NULL; p != NULL; p = p->link) { - - ARGCHECK((!ISPATHTYPE(p->type) || (p != p0 && p->last != NULL)), - "CopyPath: invalid segment", p, NULL, (0), struct segment *); - - if (p->type == TEXTTYPE) - n = (struct segment *) CopyText(p); - else - n = (struct segment *)Allocate(p->size, p, 0); - n->last = NULL; - if (anchor == NULL) - anchor = n; - else - last->link = n; - last = n; - } -/* -At this point we have a chain of newly allocated segments hanging off -'anchor'. We need to make sure the first segment points to the last: -*/ - if (anchor != NULL) { - n->link = NULL; - anchor->last = n; - } - - return(anchor); -} -/* -:h3.KillPath() - Destroying a Path - -Destroying a path is simply a matter of freeing each segment in the -linked list. Again, we let the experts handle text. -*/ -void -KillPath(struct segment *p) /* path to destroy */ -{ - register struct segment *linkp; /* temp register holding next segment*/ - - /* return conditional based on reference count 3-26-91 PNM */ - if ( (--(p->references) > 1) || - ( (p->references == 1) && !ISPERMANENT(p->flag) ) ) - return; - - while (p != NULL) { - if (!ISPATHTYPE(p->type)) { - ArgErr("KillPath: bad segment", p, NULL); - return; - } - linkp = p->link; - if (p->type == TEXTTYPE) - KillText(p); - else - Free(p); - p = linkp; - } -} - -/* -:h2 id=location."location" Objects - -The TYPE1IMAGER user creates and destroys objects of type "location". These -objects locate points for the primitive path operators. We play a trick -here and store these objects in the same "segment" structure used for -paths, with a type field == MOVETYPE. - -This allows the Line() operator, for example, to be very trivial: -It merely stamps its input structure as a LINETYPE and returns it to the -caller--assuming, of course, the input structure was not permanent (as -it usually isn't). - -:h3.The "movesegment" Template Structure - -This template is used as a generic segment structure for Allocate: -*/ - -/* added reference field 1 to temporary template below 3-26-91 PNM */ -static struct segment movetemplate = { MOVETYPE, 0, 1, sizeof(struct segment), 0, - NULL, NULL, {0, 0} }; -/* -:h3.Loc() - Create an "Invisible Line" Between (0,0) and a Point - -*/ - -struct segment * -t1_Loc(struct XYspace *S, /* coordinate space to interpret X,Y */ - double x, double y) /* destination point */ -{ - register struct segment *r; - - - r = (struct segment *)Allocate(sizeof(struct segment), &movetemplate, 0); - TYPECHECK("Loc", S, SPACETYPE, r, (0), struct segment *); - - r->last = r; - r->context = S->context; - (*S->convert)(&r->dest, S, x, y); - ConsumeSpace(S); - return(r); -} -/* -:h3.ILoc() - Loc() With Integer Arguments - -*/ -struct segment * -ILoc(struct XYspace *S, /* coordinate space to interpret X,Y */ - int x, int y) /* destination point */ -{ - register struct segment *r; - - r = (struct segment *)Allocate(sizeof(struct segment), &movetemplate, 0); - TYPECHECK("Loc", S, SPACETYPE, r, (0), struct segment *); - - r->last = r; - r->context = S->context; - (*S->iconvert)(&r->dest, S, (long) x, (long) y); - ConsumeSpace(S); - return(r); -} - -/* -:h3.SubLoc() - Vector Subtraction of Two Locition Objects - -This user operator subtracts two location objects, yielding a new -location object that is the result. - -The symmetrical function AddLoc() is totally redundent with Join(), -so it is not provided. -*/ - -struct segment * -SubLoc(struct segment *p1, struct segment *p2) -{ - ARGCHECK(!ISLOCATION(p1), "SubLoc: bad first arg", p1, NULL, (0), struct segment *); - ARGCHECK(!ISLOCATION(p2), "SubLoc: bad second arg", p2, NULL, (0), struct segment *); - p1 = UniquePath(p1); - p1->dest.x -= p2->dest.x; - p1->dest.y -= p2->dest.y; - ConsumePath(p2); - return(p1); -} - -/* -:h2.Straight Line Segments - -:h3.PathSegment() - Create a Generic Path Segment - -Many routines need a LINETYPE or MOVETYPE path segment, but do not -want to go through the external user's interface, because, for example, -they already know the "fractpel" destination of the segment and the -conversion is unnecessary. PathSegment() is an internal routine -provided to the rest of TYPE1IMAGER for handling these cases. -*/ - -struct segment * -t1_PathSegment(int type, /* LINETYPE or MOVETYPE */ - fractpel x, fractpel y) /* where to go to, if known */ -{ - register struct segment *r; /* newly created segment */ - - r = (struct segment *)Allocate(sizeof(struct segment), &movetemplate, 0); - r->type = type; - r->last = r; /* last points to itself for singleton */ - r->dest.x = x; - r->dest.y = y; - return(r); -} -/* -:h3.Line() - Create a Line Segment Between (0,0) and a Point P - -This involves just creating and filling out a segment structure: -*/ -struct segment * -Line(struct segment *P) /* relevant coordinate space */ -{ - ARGCHECK(!ISLOCATION(P), "Line: arg not a location", P, NULL, (0), struct segment *); - - P = UniquePath(P); - P->type = LINETYPE; - return(P); -} -/* -:h2.Curved Path Segments - -We need more points to describe curves. So, the structures for curved -path segments are slightly different. The first part is identical; -the curved structures are larger with the extra points on the end. - -:h3.Bezier Segment Structure - -We support third order Bezier curves. They are specified with four -control points A, B, C, and D. The curve starts at A with slope AB -and ends at D with slope CD. The curvature at the point A is inversely -related to the length |AB|, and the curvature at the point D is -inversely related to the length |CD|. Point A is always point (0,0). - -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.Bezier() - Generate a Bezier Segment - -This is just a simple matter of filling out a 'beziersegment' structure: -*/ - -struct beziersegment * -Bezier(struct segment *B, /* second control point */ - struct segment *C, /* third control point */ - struct segment *D) /* fourth control point (ending point) */ -{ -/* added reference field of 1 to temporary template below 3-26-91 PNM */ - static struct beziersegment template = - { BEZIERTYPE, 0, 1, sizeof(struct beziersegment), 0, - NULL, NULL, { 0, 0 }, { 0, 0 }, { 0, 0 } }; - - register struct beziersegment *r; /* output segment */ - - ARGCHECK(!ISLOCATION(B), "Bezier: bad B", B, NULL, (2,C,D), struct beziersegment *); - ARGCHECK(!ISLOCATION(C), "Bezier: bad C", C, NULL, (2,B,D), struct beziersegment *); - ARGCHECK(!ISLOCATION(D), "Bezier: bad D", D, NULL, (2,B,C), struct beziersegment *); - - r = (struct beziersegment *)Allocate(sizeof(struct beziersegment), &template, 0); - r->last = (struct segment *) r; - r->dest.x = D->dest.x; - r->dest.y = D->dest.y; - r->B.x = B->dest.x; - r->B.y = B->dest.y; - r->C.x = C->dest.x; - r->C.y = C->dest.y; - - ConsumePath(B); - ConsumePath(C); - ConsumePath(D); - return(r); -} - -/* -:h2.Font "Hint" Segments - -:h3.Hint() - A Font 'Hint' Segment - -This is temporary code while we experiment with hints. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -struct hintsegment * -Hint(struct XYspace *S, float ref, float width, - char orientation, char hinttype, char adjusttype, char direction, - int label) -{ -/* added reference field of 1 to hintsegment template below 3-26-91 PNM */ - static struct hintsegment template = { HINTTYPE, 0, 1, sizeof(struct hintsegment), 0, - NULL, NULL, { 0, 0 }, { 0, 0 }, { 0, 0 }, - ' ', ' ', ' ', ' ', 0}; - - register struct hintsegment *r; - - r = (struct hintsegment *)Allocate(sizeof(struct hintsegment), &template, 0); - - r->orientation = orientation; - if (width == 0.0) width = 1.0; - - if (orientation == 'h') { - (*S->convert)(&r->ref, S, 0.0, ref); - (*S->convert)(&r->width, S, 0.0, width); - } - else if (orientation == 'v') { - (*S->convert)(&r->ref, S, ref, 0.0); - (*S->convert)(&r->width, S, width, 0.0); - } - else - return((struct hintsegment *)ArgErr("Hint: orient not 'h' or 'v'", NULL, NULL)); - if (r->width.x < 0) r->width.x = - r->width.x; - if (r->width.y < 0) r->width.y = - r->width.y; - r->hinttype = hinttype; - r->adjusttype = adjusttype; - r->direction = direction; - r->label = label; - r->last = (struct segment *) r; - ConsumeSpace(S); - return(r); -} - -/* -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -POP removes the first segment in a path 'p' and Frees it. 'p' is left -pointing to the end of the path: -*/ -#define POP(p) \ - { register struct segment *linkp; \ - linkp = p->link; \ - if (linkp != NULL) \ - linkp->last = p->last; \ - Free(p); \ - p = linkp; } -/* -INSERT inserts a single segment in the middle of a chain. 'b' is -the segment before, 'p' the segment to be inserted, and 'a' the -segment after. -*/ -#define INSERT(b,p,a) b->link=p; p->link=a; p->last=NULL - -/* -:h3.Join() - Join Two Objects Together - -If these are paths, this operator simply invokes the CONCAT macro. -Why so much code then, you ask? Well we have to check for object -types other than paths, and also check for certain path consistency -rules. -*/ - -struct segment * -Join(struct segment *p1, struct segment *p2) -{ -/* -We start with a whole bunch of very straightforward argument tests: -*/ - if (p2 != NULL) { - if (!ISPATHTYPE(p2->type)) { - - if (p1 == NULL) - return((struct segment *)Unique(p2)); - - switch (p1->type) { - - case REGIONTYPE: - - case STROKEPATHTYPE: - p1 = CoercePath(p1); - break; - - default: - return((struct segment *)BegHandle(p1, p2)); - } - } - - ARGCHECK((p2->last == NULL), "Join: right arg not anchor", p2, NULL, (1,p1), struct segment *); - p2 = UniquePath(p2); - -/* -In certain circumstances, we don't have to duplicate a permanent -location. (We would just end up destroying it anyway). These cases -are when 'p2' begins with a move-type segment: -*/ - if (p2->type == TEXTTYPE || p2->type == MOVETYPE) { - if (p1 == NULL) - return(p2); - if (ISLOCATION(p1)) { - p2->dest.x += p1->dest.x; - p2->dest.y += p1->dest.y; - ConsumePath(p1); - return(p2); - } - } - } - else - return((struct segment *)Unique(p1)); - - if (p1 != NULL) { - if (!ISPATHTYPE(p1->type)) - - switch (p2->type) { - - case REGIONTYPE: - - case STROKEPATHTYPE: - p2 = CoercePath(p2); - break; - - default: - return((struct segment *)EndHandle(p1, p2)); - } - - ARGCHECK((p1->last == NULL), "Join: left arg not anchor", p1, NULL, (1,p2), struct segment *); - p1 = UniquePath(p1); - } - else - return(p2); - -/* -At this point all the checking is done. We have two temporary non-null -path types in 'p1' and 'p2'. If p1 ends with a MOVE, and p2 begins with -a MOVE, we collapse the two MOVEs into one. We enforce the rule that -there may not be two MOVEs in a row: -*/ - - if (p1->last->type == MOVETYPE && p2->type == MOVETYPE) { - p1->last->flag |= p2->flag; - p1->last->dest.x += p2->dest.x; - p1->last->dest.y += p2->dest.y; - POP(p2); - if (p2 == NULL) - return(p1); - } -/* -Now we check for another silly rule. If a path has any TEXTTYPEs, -then it must have only TEXTTYPEs and MOVETYPEs, and furthermore, -it must begin with a TEXTTYPE. This rule makes it easy to check -for the special case of text. If necessary, we will coerce -TEXTTYPEs into paths so we don't mix TEXTTYPEs with normal paths. -*/ - if (p1->type == TEXTTYPE) { - if (p2->type != TEXTTYPE && !ISLOCATION(p2)) - p1 = CoerceText(p1); - } - else { - if (p2->type == TEXTTYPE) { - if (ISLOCATION(p1)) { - p2->dest.x += p1->dest.x; - p2->dest.y += p1->dest.y; - Free(p1); - return(p2); - } - else - p2 = CoerceText(p2); - } - } -/* -Thank God! Finally! It's hard to believe, but we are now able to -actually do the join. This is just invoking the CONCAT macro: -*/ - CONCAT(p1, p2); - - return(p1); -} - -/* -:h3.JoinSegment() - Create a Path Segment and Join It to a Known Path - -This internal function is quicker than a full-fledged join because -it can do much less checking. -*/ - -struct segment * -t1_JoinSegment(struct segment *before, /* path to join before new segment */ - int type, /* type of new segment (MOVETYPE or LINETYPE) */ - fractpel x, fractpel y, /* x,y of new segment */ - struct segment *after) /* path to join after new segment */ -{ - register struct segment *r; /* returned path built here */ - - r = PathSegment(type, x, y); - if (before != NULL) { - CONCAT(before, r); - r = before; - } - else - r->context = after->context; - if (after != NULL) - CONCAT(r, after); - return(r); -} - -/* -:h2.Other Path Functions - -*/ - - -struct segment * -t1_ClosePath(struct segment *p0, /* path to close */ - int lastonly) /* flag deciding to close all subpaths or... */ -{ - register struct segment *p,*last = NULL,*start; /* used in looping through path */ - register fractpel x,y; /* current position in path */ - register fractpel firstx = 0,firsty = 0; /* start position of sub path */ - register struct segment *lastnonhint = NULL; /* last non-hint segment in path */ - - if (p0 != NULL && p0->type == TEXTTYPE) - return(UniquePath(p0)); - if (p0->type == STROKEPATHTYPE) - return((struct segment *)Unique(p0)); - /* - * NOTE: a null closed path is different from a null open path - * and is denoted by a closed (0,0) move segment. We make - * sure this path begins and ends with a MOVETYPE: - */ - if (p0 == NULL || p0->type != MOVETYPE) - p0 = JoinSegment(NULL, MOVETYPE, 0, 0, p0); - TYPECHECK("ClosePath", p0, MOVETYPE, NULL, (0), struct segment *); - if (p0->last->type != MOVETYPE) - p0 = JoinSegment(p0, MOVETYPE, 0, 0, NULL); - - p0 = UniquePath(p0); - -/* -We now begin a loop through the path, -incrementing current 'x' and 'y'. We are searching -for MOVETYPE segments (breaks in the path) that are not already closed. -At each break, we insert a close segment. -*/ - for (p = p0, x = y = 0, start = NULL; - p != NULL; - x += p->dest.x, y += p->dest.y, last = p, p = p->link) - { - - if (p->type == MOVETYPE) { - if (start != NULL && (lastonly?p->link==NULL:TRUE) && - !(ISCLOSED(start->flag) && LASTCLOSED(last->flag))) { - register struct segment *r; /* newly created */ - - start->flag |= ISCLOSED(ON); - r = PathSegment(LINETYPE, firstx - x, - firsty - y); - INSERT(last, r, p); - r->flag |= LASTCLOSED(ON); - /*< adjust 'last' if possible for a 0,0 close >*/ -{ - -#define CLOSEFUDGE 3 /* if we are this close, let's change last segment */ - - if (r->dest.x != 0 || r->dest.y != 0) { - if (r->dest.x <= CLOSEFUDGE && r->dest.x >= -CLOSEFUDGE - && r->dest.y <= CLOSEFUDGE && r->dest.y >= -CLOSEFUDGE) { - lastnonhint->dest.x += r->dest.x; - lastnonhint->dest.y += r->dest.y; - r->dest.x = r->dest.y = 0; - } - } -} - if (p->link != NULL) { - p->dest.x += x - firstx; - p->dest.y += y - firsty; - x = firstx; - y = firsty; - } - } - start = p; - firstx = x + p->dest.x; - firsty = y + p->dest.y; - } - else if (p->type != HINTTYPE) - lastnonhint = p; - } - return(p0); -} -/* -*/ -/* -:h2.Reversing the Direction of a Path - -This turned out to be more difficult than I thought at first. The -trickiness was due to the fact that closed paths must remain closed, -etc. - -We need three subroutines: -*/ - -/* break a path at any point */ -static struct segment *SplitPath ( struct segment *anchor, - struct segment *before ); -/* breaks a path after first sub-path */ -static struct segment *DropSubPath ( struct segment *p0 ); -/* reverses a single sub-path */ -static struct segment *ReverseSubPath ( struct segment *p ); - -/* -:h3.Reverse() - User Operator to Reverse a Path - -This operator reverses the entire path. -*/ - -struct segment * -Reverse(struct segment *p) /* full path to reverse */ -{ - register struct segment *r; /* output path built here */ - register struct segment *nextp; /* contains next sub-path */ - - if (p == NULL) - return(NULL); - - ARGCHECK(!ISPATHANCHOR(p), "Reverse: invalid path", p, NULL, (0), struct segment *); - - if (p->type == TEXTTYPE) - p = CoerceText(p); - p = UniquePath(p); - - r = NULL; - - do { - nextp = DropSubPath(p); - p = ReverseSubPath(p); - r = Join(p, r); - p = nextp; - - } while (p != NULL); - - return(r); -} - -/* -:h4.ReverseSubPath() - Subroutine to Reverse a Single Sub-Path -*/ - -static struct segment * -ReverseSubPath(struct segment *p) /* input path */ -{ - register struct segment *r; /* reversed path will be created here */ - register struct segment *nextp; /* temporary variable used in loop */ - register int wasclosed; /* flag, path was closed */ - - if (p == NULL) - return(NULL); - - wasclosed = ISCLOSED(p->flag); - r = NULL; - - do { -/* -First we reverse the direction of this segment and clean up its flags: -*/ - p->dest.x = - p->dest.x; p->dest.y = - p->dest.y; - p->flag &= ~(ISCLOSED(ON) | LASTCLOSED(ON)); - - switch (p->type) { - - case LINETYPE: - case MOVETYPE: - break; - - case CONICTYPE: - { -/* -The logic of this is that the new M point (stored relative to the new -beginning) is (M - C). However, C ("dest") has already been reversed -So, we add "dest" instead of subtracting it: -*/ - register struct conicsegment *cp = (struct conicsegment *) p; - - cp->M.x += cp->dest.x; cp->M.y += cp->dest.y; - } - break; - - case BEZIERTYPE: - { - register struct beziersegment *bp = (struct beziersegment *) p; - - bp->B.x += bp->dest.x; bp->B.y += bp->dest.y; - bp->C.x += bp->dest.x; bp->C.y += bp->dest.y; - } - break; - - case HINTTYPE: - { - register struct hintsegment *hp = (struct hintsegment *) p; - - hp->ref.x = -hp->ref.x; hp->ref.y = -hp->ref.y; - } - break; - - default: - Abort("Reverse: bad path segment"); - } -/* -We need to reverse the order of segments too, so we break this segment -off of the input path, and tack it on the front of the growing path -in 'r': -*/ - nextp = p->link; - p->link = NULL; - p->last = p; - if (r != NULL) - CONCAT(p,r); /* leaves result in 'p'... not what we want */ - r = p; - p = nextp; /* advance to next segment in input path */ - - } while (p != NULL); - - if (wasclosed) - r = ClosePath(r); - - return(r); -} - -/* -:h4.DropSubPath() - Drops the First Sub-Path Off a Path - -This subroutine returns the remaining sub-path(s). While doing so, it -breaks the input path after the first sub-path so that a pointer to -the original path now contains the first sub-path only. -*/ - -static struct segment * -DropSubPath(struct segment *p0) /* original path */ -{ - register struct segment *p; /* returned remainder here */ - - for (p = p0; p->link != NULL; p = p->link) { - if (p->link->type == MOVETYPE) - break; - } - - return(SplitPath(p0, p)); -} - -static struct segment * -SplitPath(struct segment *anchor, struct segment *before) -{ - register struct segment *r; - - if (before == anchor->last) - return(NULL); - - r = before->link; - r->last = anchor->last; - anchor->last = before; - before->link = NULL; - - return(r); -} - -static void -UnClose(struct segment *p0) -{ - register struct segment *p; - - for (p=p0; p->link->link != NULL; p=p->link) { ; } - - if (!LASTCLOSED(p->link->flag)) - Abort("UnClose: no LASTCLOSED"); - - Free(SplitPath(p0, p)); - p0->flag &= ~ISCLOSED(ON); -} - -/* -:h3.ReverseSubPaths() - Reverse the Direction of Sub-paths Within a Path - -This user operator reverses the sub-paths in a path, but leaves the -'move' segments unchanged. It builds on top of the subroutines -already established. -*/ - -struct segment * -ReverseSubPaths(struct segment *p) /* input path */ -{ - register struct segment *r; /* reversed path will be created here */ - register struct segment *nextp; /* temporary variable used in loop */ - int wasclosed; /* flag; subpath was closed */ - register struct segment *nomove; /* the part of sub-path without move segment */ - struct fractpoint delta; - - if (p == NULL) - return(NULL); - - ARGCHECK(!ISPATHANCHOR(p), "ReverseSubPaths: invalid path", p, NULL, (0), struct segment *); - - if (p->type == TEXTTYPE) - p = CoerceText(p); - if (p->type != MOVETYPE) - p = JoinSegment(NULL, MOVETYPE, 0, 0, p); - - p = UniquePath(p); - - r = NULL; - - for (; p != NULL;) { - nextp = DropSubPath(p); - wasclosed = ISCLOSED(p->flag); - if (wasclosed) - UnClose(p); - - nomove = SplitPath(p, p); - r = Join(r, p); - - PathDelta(nomove, &delta); - - nomove = ReverseSubPath(nomove); - p->dest.x += delta.x; - p->dest.y += delta.y; - if (nextp != NULL) { - nextp->dest.x += delta.x; - nextp->dest.y += delta.y; - } - if (wasclosed) { - nomove = ClosePath(nomove); - nextp->dest.x -= delta.x; - nextp->dest.y -= delta.y; - } - r = Join(r, nomove); - p = nextp; - - } - - return(r); -} - -/* -:h2.Transforming and Putting Handles on Paths - -:h3.PathTransform() - Transform a Path - -Transforming a path involves transforming all the points. In order -that closed paths do not become "unclosed" when their relative -positions are slightly changed due to loss of arithmetic precision, -all point transformations are in absolute coordinates. - -(It might be better to reset the "absolute" coordinates every time a -move segment is encountered. This would mean that we could accumulate -error from subpath to subpath, but we would be less likely to make -the "big error" where our fixed point arithmetic "wraps". However, I -think I'll keep it this way until something happens to convince me -otherwise.) - -The transform is described as a "space", that way we can use our -old friend the "iconvert" function, which should be very efficient. -*/ - -struct segment * -PathTransform(struct segment *p0, /* path to transform */ - struct XYspace *S) /* pseudo space to transform in */ -{ - register struct segment *p; /* to loop through path with */ - register fractpel newx,newy; /* current transformed position in path */ - register fractpel oldx,oldy; /* current untransformed position in path */ - register fractpel savex,savey; /* save path delta x,y */ - - p0 = UniquePath(p0); - - newx = newy = oldx = oldy = 0; - - for (p=p0; p != NULL; p=p->link) { - - savex = p->dest.x; savey = p->dest.y; - - (*S->iconvert)(&p->dest, S, p->dest.x + oldx, p->dest.y + oldy); - p->dest.x -= newx; - p->dest.y -= newy; - - switch (p->type) { - - case LINETYPE: - case MOVETYPE: - break; - - case CONICTYPE: - { - register struct conicsegment *cp = (struct conicsegment *) p; - - (*S->iconvert)(&cp->M, S, cp->M.x + oldx, cp->M.y + oldy); - cp->M.x -= newx; - cp->M.y -= newy; - /* - * Note roundness doesn't change... linear transform - */ - break; - } - - - case BEZIERTYPE: - { - register struct beziersegment *bp = (struct beziersegment *) p; - - (*S->iconvert)(&bp->B, S, bp->B.x + oldx, bp->B.y + oldy); - bp->B.x -= newx; - bp->B.y -= newy; - (*S->iconvert)(&bp->C, S, bp->C.x + oldx, bp->C.y + oldy); - bp->C.x -= newx; - bp->C.y -= newy; - break; - } - - case HINTTYPE: - { - register struct hintsegment *hp = (struct hintsegment *) p; - - (*S->iconvert)(&hp->ref, S, hp->ref.x + oldx, hp->ref.y + oldy); - hp->ref.x -= newx; - hp->ref.y -= newy; - (*S->iconvert)(&hp->width, S, hp->width.x, hp->width.y); - /* Note: width is not relative to origin */ - break; - } - - case TEXTTYPE: - { - XformText(p,S); - break; - } - - default: - Abort("PathTransform: invalid segment"); - } - oldx += savex; - oldy += savey; - newx += p->dest.x; - newy += p->dest.y; - } - return(p0); -} - -/* -:h3.PathDelta() - Return a Path's Ending Point -*/ - -void -PathDelta(struct segment *p, /* input path */ - struct fractpoint *pt) /* pointer to x,y to set */ -{ - struct fractpoint mypoint; /* I pass this to TextDelta */ - register fractpel x,y; /* working variables for path current point */ - - for (x=y=0; p != NULL; p=p->link) { - x += p->dest.x; - y += p->dest.y; - if (p->type == TEXTTYPE) { - TextDelta(p, &mypoint); - x += mypoint.x; - y += mypoint.y; - } - } - - pt->x = x; - pt->y = y; -} - -/* -:h3.BoundingBox() - Produce a Bounding Box Path - -This function is called by image code, when we know the size of the -image in pels, and need to get a bounding box path that surrounds it. -The starting/ending handle is in the lower right hand corner. -*/ -struct segment * -BoundingBox(pel h, pel w) /* size of box */ -{ - register struct segment *path; - - path = PathSegment(LINETYPE, -TOFRACTPEL(w), 0); - path = JoinSegment(NULL, LINETYPE, 0, -TOFRACTPEL(h), path); - path = JoinSegment(NULL, LINETYPE, TOFRACTPEL(w), 0, path); - path = ClosePath(path); - - return(path); -} - -/* -:h2.Querying Locations and Paths - -:h3.QueryLoc() - Return the X,Y of a Locition -*/ - -void -QueryLoc(struct segment *P, /* location to query, not consumed */ - struct XYspace *S, /* XY space to return coordinates in */ - double *xP, double *yP) /* coordinates returned here */ -{ - if (!ISLOCATION(P)) { - ArgErr("QueryLoc: first arg not a location", P, NULL); - return; - } - if (S->type != SPACETYPE) { - ArgErr("QueryLoc: second arg not a space", S, NULL); - return; - } - UnConvert(S, &P->dest, xP, yP); -} -/* -:h3.QueryPath() - Find Out the Type of Segment at the Head of a Path - -This is a very simple routine that looks at the first segment of a -path and tells the caller what it is, as well as returning the control -point(s) of the path segment. Different path segments have different -number of control points. If the caller knows that the segment is -a move segment, for example, he only needs to pass pointers to return -one control point. -*/ - -void -QueryPath(struct segment *path, /* path to check */ - int *typeP, /* return the type of path here */ - struct segment **Bp, /* return location of first point */ - struct segment **Cp, /* return location of second point */ - struct segment **Dp, /* return location of third point */ - double *fP) /* return Conic sharpness */ -{ - register int coerced = FALSE; /* did I coerce a text path? */ - - if (path == NULL) { - *typeP = -1; - return; - } - if (!ISPATHANCHOR(path)) { - ArgErr("QueryPath: arg not a valid path", path, NULL); - } - if (path->type == TEXTTYPE) { - path = CoerceText(path); - coerced = TRUE; - } - - switch (path->type) { - - case MOVETYPE: - *typeP = 0; - *Bp = PathSegment(MOVETYPE, path->dest.x, path->dest.y); - break; - - case LINETYPE: - *typeP = (LASTCLOSED(path->flag)) ? 4 : 1; - *Bp = PathSegment(MOVETYPE, path->dest.x, path->dest.y); - break; - - case CONICTYPE: - { - register struct conicsegment *cp = (struct conicsegment *) path; - - *typeP = 2; - *Bp = PathSegment(MOVETYPE, cp->M.x, cp->M.y); - *Cp = PathSegment(MOVETYPE, cp->dest.x, cp->dest.y); - *fP = cp->roundness; - } - break; - - case BEZIERTYPE: - { - register struct beziersegment *bp = (struct beziersegment *) path; - - *typeP = 3; - *Bp = PathSegment(MOVETYPE, bp->B.x, bp->B.y); - *Cp = PathSegment(MOVETYPE, bp->C.x, bp->C.y); - *Dp = PathSegment(MOVETYPE, bp->dest.x, bp->dest.y); - } - break; - - case HINTTYPE: - *typeP = 5; - break; - - default: - Abort("QueryPath: unknown segment"); - } - if (coerced) - KillPath(path); -} -/* -:h3.QueryBounds() - Return the Bounding Box of a Path - -Returns the bounding box by setting the user's variables. -*/ - -void -QueryBounds(struct segment *p0, /* object to check for bound */ - struct XYspace *S, /* coordinate space of returned values */ - double *xminP, /* lower left hand corner (set by routine) */ - double *yminP, - double *xmaxP, /* upper right hand corner (set by routine) */ - double *ymaxP) -{ - register struct segment *path; /* loop variable for path segments */ - register fractpel lastx,lasty; /* loop variables: previous endingpoint */ - register fractpel x,y; /* loop variables: current ending point */ - struct fractpoint min; /* registers to keep lower left hand corner */ - struct fractpoint max; /* registers to keep upper right hand corner */ - int coerced = FALSE; /* we have coerced the path from another object */ - double x1,y1,x2,y2,x3,y3,x4,y4; /* corners of rectangle in space X */ - - if (S->type != SPACETYPE) { - ArgErr("QueryBounds: bad XYspace", S, NULL); - return; - } - - min.x = min.y = max.x = max.y = 0; - if (p0 != NULL) { - if (!ISPATHANCHOR(p0)) { - switch(p0->type) { - case STROKEPATHTYPE: - /* replaced DupStrokePath() with Dup() 3-26-91 PNM */ - p0 = (struct segment *) DoStroke(Dup(p0)); - /* no break here, we have a region in p0 */ - case REGIONTYPE: - p0 = RegionBounds((struct region *)p0); - break; - - case PICTURETYPE: - p0 = PictureBounds(p0); - break; - - default: - ArgErr("QueryBounds: bad object", p0, NULL); - return; - } - coerced = TRUE; - } - if (p0->type == TEXTTYPE) { - /* replaced CopyPath() with Dup() 3-26-91 PNM */ - p0 = (struct segment *)CoerceText(Dup(p0)); /* there are faster ways */ - coerced = TRUE; - } - if (p0->type == MOVETYPE) { - min.x = max.x = p0->dest.x; - min.y = max.y = p0->dest.y; - } - } - lastx = lasty = 0; - - for (path = p0; path != NULL; path = path->link) { - - x = lastx + path->dest.x; - y = lasty + path->dest.y; - - switch (path->type) { - - case LINETYPE: - break; - - case CONICTYPE: - { - register struct conicsegment *cp = (struct conicsegment *) path; - register fractpel Mx = lastx + cp->M.x; - register fractpel My = lasty + cp->M.y; - register fractpel deltax = 0.5 * cp->roundness * cp->dest.x; - register fractpel deltay = 0.5 * cp->roundness * cp->dest.y; - register fractpel Px = Mx - deltax; - register fractpel Py = My - deltay; - register fractpel Qx = Mx + deltax; - register fractpel Qy = My + deltay; - - - if (Mx < min.x) min.x = Mx; - else if (Mx > max.x) max.x = Mx; - if (My < min.y) min.y = My; - else if (My > max.y) max.y = My; - - if (Px < min.x) min.x = Px; - else if (Px > max.x) max.x = Px; - if (Py < min.y) min.y = Py; - else if (Py > max.y) max.y = Py; - - if (Qx < min.x) min.x = Qx; - else if (Qx > max.x) max.x = Qx; - if (Qy < min.y) min.y = Qy; - else if (Qy > max.y) max.y = Qy; - } - break; - - - case MOVETYPE: - /* - * We can't risk adding trailing Moves to the - * bounding box: - */ - if (path->link == NULL) - goto done; /* God forgive me */ - break; - - case BEZIERTYPE: - { - register struct beziersegment *bp = (struct beziersegment *) path; - register fractpel Bx = lastx + bp->B.x; - register fractpel By = lasty + bp->B.y; - register fractpel Cx = lastx + bp->C.x; - register fractpel Cy = lasty + bp->C.y; - - if (Bx < min.x) min.x = Bx; - else if (Bx > max.x) max.x = Bx; - if (By < min.y) min.y = By; - else if (By > max.y) max.y = By; - - if (Cx < min.x) min.x = Cx; - else if (Cx > max.x) max.x = Cx; - if (Cy < min.y) min.y = Cy; - else if (Cy > max.y) max.y = Cy; - } - break; - - case HINTTYPE: - break; - default: - Abort("QueryBounds: unknown type"); - } - - if (x < min.x) min.x = x; - else if (x > max.x) max.x = x; - if (y < min.y) min.y = y; - else if (y > max.y) max.y = y; - - lastx = x; lasty = y; - } -done: - UnConvert(S, &min, &x1, &y1); - UnConvert(S, &max, &x4, &y4); - x = min.x; min.x = max.x; max.x = x; - UnConvert(S, &min, &x2, &y2); - UnConvert(S, &max, &x3, &y3); - - *xminP = *xmaxP = x1; - if (x2 < *xminP) *xminP = x2; - else if (x2 > *xmaxP) *xmaxP = x2; - if (x3 < *xminP) *xminP = x3; - else if (x3 > *xmaxP) *xmaxP = x3; - if (x4 < *xminP) *xminP = x4; - else if (x4 > *xmaxP) *xmaxP = x4; - - *yminP = *ymaxP = y1; - if (y2 < *yminP) *yminP = y2; - else if (y2 > *ymaxP) *ymaxP = y2; - if (y3 < *yminP) *yminP = y3; - else if (y3 > *ymaxP) *ymaxP = y3; - if (y4 < *yminP) *yminP = y4; - else if (y4 > *ymaxP) *ymaxP = y4; - - if (coerced) - Destroy(p0); -} -/* -:h3.BoxPath() -*/ -struct segment * -BoxPath(struct XYspace *S, int h, int w) -{ - struct segment *path; - - path = Join( Line(ILoc(S, w, 0)), Line(ILoc(S, 0, h)) ); - path = JoinSegment(path, LINETYPE, -path->dest.x, -path->dest.y, NULL); - return(ClosePath(path)); -} - -/* -:h3.DropSegment() - Drop the First Segment in a Path - -This routine takes the path and returns a new path that is one segment -shorter. It can be used in conjunction with QueryPath(), for example, -to ask about an entire path. -*/ - -struct segment * -DropSegment(struct segment *path) -{ - if (path != NULL && path->type == STROKEPATHTYPE) - path = CoercePath(path); - ARGCHECK((path == NULL || !ISPATHANCHOR(path)), - "DropSegment: arg not a non-null path", path, path, (0), struct segment *); - if (path->type == TEXTTYPE) - path = CoerceText(path); - path = UniquePath(path); - - POP(path); - return(path); -} -/* -:h3.HeadSegment() - Return the First Segment in a Path - -This routine takes the path and returns a new path consists of the -first segment only. -*/ - -struct segment * -HeadSegment(struct segment *path) /* input path */ -{ - if (path == NULL) - return(NULL); - if (path->type == STROKEPATHTYPE) - path = CoercePath(path); - ARGCHECK(!ISPATHANCHOR(path), "HeadSegment: arg not a path", path, path, (0), struct segment *); - if (path->type == TEXTTYPE) - path = CoerceText(path); - path = UniquePath(path); - - if (path->link != NULL) - KillPath(path->link); - path->link = NULL; - path->last = path; - return(path); -} - -/* -:h2.Path Debug Routines - -:h3.DumpPath() - Display a Path on the Trace File -*/ - -void -DumpPath(struct segment *p) -{ -} diff --git a/nx-X11/lib/font/Type1/paths.h b/nx-X11/lib/font/Type1/paths.h deleted file mode 100644 index b61275b9c..000000000 --- a/nx-X11/lib/font/Type1/paths.h +++ /dev/null @@ -1,239 +0,0 @@ -/* $Xorg: paths.h,v 1.3 2000/08/17 19:46:31 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/paths.h,v 1.3 1999/08/22 08:58:53 dawes Exp $ */ - -/*SHARED*/ - -#define Loc(S,x,y) t1_Loc(S,(double)x,(double)y) -#define ILoc(S,x,y) t1_ILoc(S,x,y) -#define Line(P) t1_Line(P) -#define Join(p1,p2) t1_Join(p1,p2) -#define ClosePath(p) t1_ClosePath(p,0) -#define CloseLastSubPath(p) t1_ClosePath(p,1) -#define Conic(B,C,s) t1_Conic(B,C,(double)s) -#define RoundConic(M,C,r) t1_RoundConic(M,C,(double)r) -#define ArcP3(S,P2,P3) t1_ArcP3(S,P2,P3) -#define ArcCA(S,C,d) t1_ArcCA(S,C,(double)d) -#define Bezier(B,C,D) t1_Bezier(B,C,D) -#define Hint(S,r,w,o,h,a,d,l) t1_Hint(S,r,w,o,h,a,d,l) -#define Reverse(p) t1_Reverse(p) -#define ReverseSubPaths(p) t1_ReverseSubPaths(p) -#define AddLoc(p1,p2) t1_Join(p1,p2) -#define SubLoc(p1,p2) t1_SubLoc(p1,p2) -#define DropSegment(p) t1_DropSegment(p) -#define HeadSegment(p) t1_HeadSegment(p) -#define QueryLoc(P,S,x,y) t1_QueryLoc(P,S,x,y) -#define QueryPath(p,t,B,C,D,r) t1_QueryPath(p,t,B,C,D,r) -#define QueryBounds(p,S,x1,y1,x2,y2) t1_QueryBounds(p,S,x1,y1,x2,y2) - - -/* create a location object (or "move" segment) */ -extern struct segment *t1_Loc ( struct XYspace *S, double x, double y ); -/* integer argument version of same */ -extern struct segment *t1_ILoc ( struct XYspace *S, int x, int y ); -/* straight line path segment */ -extern struct segment *t1_Line ( struct segment *P ); -/* join two paths or regions together */ -extern struct segment *t1_Join ( struct segment *p1, struct segment *p2 ); -/* close a path or path set */ -extern struct segment *t1_ClosePath ( struct segment *p0, int lastonly ); -#if 0 -struct conicsegment *t1_Conic(); /* conic curve path segment */ - -struct conicsegment *t1_RoundConic(); /* ditto, specified another way */ -struct conicsegment *t1_ArcP3(); /* circular path segment with three points */ -struct conicsegment *t1_ArcCA(); /* ditto, with center point and angle */ -#endif -/* Bezier third order curve path segment */ -extern struct beziersegment *t1_Bezier ( struct segment *B, struct segment *C, - struct segment *D ); -/* produce a font 'hint' path segment */ -extern struct hintsegment *t1_Hint ( struct XYspace *S, float ref, float width, - char orientation, char hinttype, - char adjusttype, char direction, - int label ); -/* reverse the complete order of paths */ -extern struct segment *t1_Reverse ( struct segment *p ); -/* reverse only sub-paths; moves unchanged */ -extern struct segment *t1_ReverseSubPaths ( struct segment *p ); -/* subtract two location objects */ -extern struct segment *t1_SubLoc ( struct segment *p1, struct segment *p2 ); -/* Drop the first segment in a path */ -extern struct segment *t1_DropSegment ( struct segment *path ); -/* return the first segment in a path */ -extern struct segment *t1_HeadSegment ( struct segment *path ); -/* Query location; return its (x,y) */ -extern void t1_QueryLoc ( struct segment *P, struct XYspace *S, double *xP, - double *yP ); -/* Query segment at head of a path */ -extern void t1_QueryPath ( struct segment *path, int *typeP, - struct segment **Bp, struct segment **Cp, - struct segment **Dp, double *fP ); -/* Query the bounding box of a path */ -extern void t1_QueryBounds ( struct segment *p0, struct XYspace *S, - double *xminP, double *yminP, - double *xmaxP, double *ymaxP ); - -/*END SHARED*/ -/*SHARED*/ - -#define CopyPath(p) t1_CopyPath(p) -#define KillPath(p) t1_KillPath(p) -#define PathTransform(p,m) t1_PathXform(p,m) -#define PathDelta(p,pt) t1_PathDelta(p,pt) -#define BoundingBox(h,w) t1_BoundingBox(h,w) -#define PathSegment(t,x,y) t1_PathSegment(t,(fractpel)x,(fractpel)y) -#define JoinSegment(b,t,x,y,a) t1_JoinSegment(b,t,(fractpel)x,(fractpel)y,a) -#define Hypoteneuse(dx,dy) t1_Hypoteneuse(dx,dy) -#define BoxPath(S,h,w) t1_BoxPath(S,h,w) - -/* duplicate a path */ -extern struct segment *t1_CopyPath ( struct segment *p0 ); -/* destroy a path */ -extern void t1_KillPath ( struct segment *p ); -/* transform a path arbitrarily */ -extern struct segment *t1_PathXform ( struct segment *p0, struct XYspace *S ); -/* calculate the ending point of a path */ -extern void t1_PathDelta ( struct segment *p, struct fractpoint *pt ); -/* */ -extern struct segment *t1_BoundingBox ( pel h, pel w ); -/* produce a MOVE or LINE segment */ -extern struct segment *t1_PathSegment ( int type, fractpel x, fractpel y ); -/* join a MOVE or LINE segment to a path */ -extern struct segment *t1_JoinSegment ( struct segment *before, int type, fractpel x, fractpel y, struct segment *after ); -#if 0 -double t1_Hypoteneuse(); /* returns the length of a line */ -#endif -/* returns a rectangular path */ -extern struct segment *t1_BoxPath ( struct XYspace *S, int h, int w ); - -/*END SHARED*/ -/*SHARED*/ - -#define ConsumePath(p) MAKECONSUME(p,KillPath(p)) -#define UniquePath(p) MAKEUNIQUE(p,CopyPath(p)) - -/*END SHARED*/ -/*SHARED*/ - -struct segment { - XOBJ_COMMON /* xobject common data define 3-26-91 PNM */ - unsigned char size; /* size of the structure */ - unsigned char context; /* index to device context */ - struct segment *link; /* pointer to next structure in linked list */ - struct segment *last; /* pointer to last structure in list */ - struct fractpoint dest; /* relative ending location of path segment */ -} ; - -#define ISCLOSED(flag) ((flag)&0x80) /* subpath is closed */ -#define LASTCLOSED(flag) ((flag)&0x40) /* last segment in closed subpath */ - -/* -NOTE: The ISCLOSED flag is set on the MOVETYPE segment before the -subpath proper; the LASTCLOSED flag is set on the last segment (LINETYPE) -in the subpath - -We define the ISPATHANCHOR predicate to test that a path handle -passed by the user is valid: -*/ - -#define ISPATHANCHOR(p) (ISPATHTYPE(p->type)&&p->last!=NULL) - -/* -For performance reasons, a user's "location" object is identical to -a path whose only segment is a move segment. We define a predicate -to test for this case. See also :hdref refid=location.. -*/ - -#define ISLOCATION(p) ((p)->type == MOVETYPE && (p)->link == NULL) - -/*END SHARED*/ -/*SHARED*/ - -struct conicsegment { - XOBJ_COMMON /* xobject common data define 3-26-91 PNM */ - /* type = CONICTYPE */ - unsigned char size; /* as with any 'segment' type */ - unsigned char context; /* as with any 'segment' type */ - struct segment *link; /* as with any 'segment' type */ - struct segment *last; /* as with any 'segment' type */ - struct fractpoint dest; /* Ending point (C point) */ - struct fractpoint M; /* "midpoint" of conic explained above */ - float roundness; /* explained above */ -} ; -/*END SHARED*/ -/*SHARED*/ - -struct beziersegment { - XOBJ_COMMON /* xobject common data define 3-26-91 PNM */ - /* type = BEZIERTYPE */ - unsigned char size; /* as with any 'segment' type */ - unsigned char context; /* as with any 'segment' type */ - struct segment *link; /* as with any 'segment' type */ - struct segment *last; /* as with any 'segment' type */ - struct fractpoint dest; /* ending point (D) */ - struct fractpoint B; /* control point B */ - struct fractpoint C; /* control point C */ -} ; - -/*END SHARED*/ -/*SHARED*/ - -struct hintsegment { - XOBJ_COMMON /* xobject common data define 3-26-91 PNM */ - /* type = HINTTYPE */ - unsigned char size; /* size of the structure */ - unsigned char context; /* device context */ - struct segment *link; /* pointer to next structure in linked list */ - struct segment *last; /* pointer to last structure in list */ - struct fractpoint dest; /* ALWAYS 0,0 */ - struct fractpoint ref; - struct fractpoint width; - char orientation; - char hinttype; - char adjusttype; - char direction; - int label; -} ; - -/*END SHARED*/ -/*SHARED*/ - -/* -CONCAT links the 'p2' path chain on the end of the 'p1' chain. (This macro -is also used by the STROKES module.) -*/ -#define CONCAT(p1, p2) { \ - p1->last->link = p2; /* link p2 on end of p1 */ \ - p1->last = p2->last; /* last of new is last of p2 */ \ - p2->last = NULL; } /* only first segment has non-NULL "last" */ - -/*END SHARED*/ -/* dump a path list */ -extern void t1_DumpPath ( struct segment *p ); diff --git a/nx-X11/lib/font/Type1/pictures.h b/nx-X11/lib/font/Type1/pictures.h deleted file mode 100644 index 0abc715ce..000000000 --- a/nx-X11/lib/font/Type1/pictures.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Xorg: pictures.h,v 1.3 2000/08/17 19:46:31 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/pictures.h,v 1.3 1999/08/22 08:58:53 dawes Exp $ */ - -/* STUB */ - -#define CopyPicture(p) p -#define UniquePicture(p) p -#define KillPicture(p) -#define BegHandle(o,m) o -#define EndHandle(o,m) o -#define PictureBounds(P) P - -struct picture { - struct fractpoint origin; - struct fractpoint ending; -}; - -#define Phantom(o) t1_Phantom(o) -#define Snap(o) t1_Snap(o) - -extern struct segment *t1_Phantom ( struct segment *p ); -extern struct segment *t1_Snap ( struct segment *p ); diff --git a/nx-X11/lib/font/Type1/range.h b/nx-X11/lib/font/Type1/range.h deleted file mode 100644 index 496f000da..000000000 --- a/nx-X11/lib/font/Type1/range.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#if XFONT_CID -#define CID_NAME_MAX 255 /* max # of characters in a file name */ -#define CID_PATH_MAX 1024 /* max # of characters in a path name */ - -typedef struct spacerange_code { - unsigned int srcCodeLo; - unsigned int srcCodeHi; -} spacerangecode; - -typedef struct space_range { - struct space_range *next; - int rangecnt; - struct spacerange_code *spacecode; -} spacerange; - -typedef struct cidrange_code { - unsigned int srcCodeLo; - unsigned int srcCodeHi; - unsigned int dstCIDLo; -} cidrangecode; - -typedef struct cid_range { - struct cid_range *next; - int rangecnt; - struct cidrange_code *range; -} cidrange; -#endif diff --git a/nx-X11/lib/font/Type1/regions.c b/nx-X11/lib/font/Type1/regions.c deleted file mode 100644 index f8875dafb..000000000 --- a/nx-X11/lib/font/Type1/regions.c +++ /dev/null @@ -1,1651 +0,0 @@ -/* $Xorg: regions.c,v 1.3 2000/08/17 19:46:31 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/regions.c,v 3.8tsi Exp $ */ - /* REGIONS CWEB V0023 LOTS */ -/* -:h1 id=regions.REGIONS Module - Regions Operator Handler - -This module is responsible for creating and manipulating regions. - -&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) - - -:h3.Include Files - -The included files are: -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef FONTMODULE -# include "os.h" -#endif -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "regions.h" -#include "curves.h" -#include "lines.h" -#include "pictures.h" -#include "fonts.h" -#include "hints.h" -#include "strokes.h" /* to pick up 'DoStroke' */ - - -static void newfilledge ( struct region *R, fractpel xmin, fractpel xmax, - fractpel ymin, fractpel ymax, int isdown ); -static struct edgelist *splitedge ( struct edgelist *list, pel y ); -static void vertjoin ( struct edgelist *top, struct edgelist *bottom ); -static int touches ( int h, pel *left, pel *right ); -static int crosses ( int h, pel *left, pel *right ); -static void edgemin ( int h, pel *e1, pel *e2 ); -static void edgemax ( int h, pel *e1, pel *e2 ); -static struct edgelist *NewEdge ( pel xmin, pel xmax, pel ymin, pel ymax, - pel *xvalues, int isdown ); -static struct edgelist *swathxsort ( struct edgelist *before0, - struct edgelist *edge ); -/* -:h3.Functions Provided to the TYPE1IMAGER User - -This module provides the following TYPE1IMAGER entry points: -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.Functions Provided to Other Modules - -This module provides the following entry points to other modules: -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.Macros Provided to Other Modules - -:h4.GOING_TO() - Macro Predicate Needed for Changing Direction, Etc. - -The actual generation of run end lists (edge boundaries) is left -to the low level rasterizing modules, LINES and CURVES. There -are some global region-type -questions that occur when doing a low-level -rasterization: -:ol. -:li.Did we just change direction in Y and therefore need to start -a new edge? -:li.Did we run out of allocated edge space? -:li.Do the minimum or maximum X values for the current edge need -updating? -:eol. -In general the REGIONS is not smart enough to answer those questions -itself. (For example, determining if and when a curve changes direction -may need detailed curve knowledge.) Yet, this must be done efficiently. -We provide a macro "GOING_TO" where the invoker tells us where it is -heading for (x2,y2), plus where it is now (x1,y1), plus the current -region under construction, and the macro answers the questions above. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h2.Data Structures Used to Represent Regions - -:h3.The "region" Structure - -The region structure is an anchor for a linked list of "edgelist" -structures (see :hdref refid=edgelist..). It also summarizes the -information in the edgelist structures (for example, the bounding -box of the region). And, it contains scratch areas used during -the creation of a region. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -The ISOPTIMIZED flag tells us if we've put a permanent region in -'optimal' form. -*/ -#define ISOPTIMIZED(flag) ((flag)&0x10) - -/* -The ISRECTANGULAR flag tells us if a region is a rectangle. We don't -always notice rectangles--if this flag is set, the region definitely -is a rectangle, but some rectangular regions will not have the flag -set. The flag is used to optimize some paths. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h4."TT_INFINITY" - A Constant Region Structure of Infinite Extent - -Infinity is the complement of a null area: -Note - removed the refcount = 1 init, replaced with references = 2 3-26-91 PNM -*/ -static struct region _infinity = { REGIONTYPE, - ISCOMPLEMENT(ON)+ISINFINITE(ON)+ISPERMANENT(ON)+ISIMMORTAL(ON), 2, - {0, 0}, {0, 0}, - 0, 0, 0, 0, - NULL, NULL, - 0, 0, 0, 0, 0, NULL, NULL, - NULL, 0, NULL, NULL }; -struct region *TT_INFINITY = &_infinity; - -/* -:h4."EmptyRegion" - A Region Structure with Zero Area - -This structure is used to initialize the region to be built in -Interior(): -Note - replaced refcount = 1 init with references = 2 3-26-91 PNM -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -struct region EmptyRegion = { REGIONTYPE, - ISPERMANENT(ON)+ISIMMORTAL(ON), 2, - {0, 0}, {0, 0}, - MAXPEL, MAXPEL, MINPEL, MINPEL, - NULL, NULL, - 0, 0, 0, 0, 0, NULL, NULL, - NULL, 0, NULL, NULL }; - -/* -:h3 id=edgelist.The "edgelist" Structure - -Regions are represented by a linked list of 'edgelist' structures. -When a region is complete, the structures are paired, one for the -left and one for the right edge. While a region is being built, -this rule may be violated temporarily. - -An 'edgelist' structure contains the X values for a given span -of Y values. The (X,Y) pairs define an edge. We use the crack -and edge coordinate system, so that integer values of X and Y -go between pels. The edge is defined between the minimum Y and -maximum Y. - -The linked list is kept sorted from top to bottom, that is, in -increasing y. Also, if 'e1' is an edgelist structure and 'e2' is the -next one in the list, they must have exactly the same ymin,ymax values -or be totally disjoint. These two requirements mean that if e2's ymin -is less than e1's ymax, it must be exactly equal to e1's ymin. A -sublist of structures with identical ymin and ymax values is called a -'swath'. - -In addition, edgelist structures are separately linked together based -on what subpath originally created them; each subpath is kept as a -separate circular linked list. This information is ignored unless -continuity checking is invoked. See :hdref refid=subpath. for a -complete description of this. -*/ - - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -The "edgelist" structure follows the convention of TYPE1IMAGER user -objects, having a type field and a flag field as the first two -elements. However, the user never sees "edgelist" structures -directly; he is given handles to "region" structures only. - -By having a type field, we can use the "copy" feature of Allocate() -to duplicate edge lists quickly. - -We also define two flag bits for this structure. The ISDOWN bit is set -if the edge is going in the direction of increasing Y. The ISAMBIGUOUS -bit is set if the edge is identical to its neighbor (edge->link); such -edges may be "left" when they should be "right", or vice versa, -unnecessarily confusing the continuity checking logic. The FixSubPaths() -routine in HINTS will swap ambiguous edges if that avoids crossing edges; -see :hdref refid=fixsubp.. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h3.KillRegion() - Destroys a Region - -KillRegion nominally just decrements the reference count to that region. -If the reference count becomes 0, all memory associated with it is -freed. We just follow the linked list, freeing as we go, then kill any -associated (thresholded) picture. -Note - added conditional return based on references 3-26-91 PNM -*/ - -void -KillRegion(struct region *area) /* area to free */ -{ - register struct edgelist *p; /* loop variable */ - register struct edgelist *next; /* loop variable */ - - if (area->references < 0) - Abort("KillRegion: negative reference count"); - if ( (--(area->references) > 1) || - ( (area->references == 1) && !ISPERMANENT(area->flag) ) ) - return; - - for (p=area->anchor; p != NULL; p=next) { - next = p->link; - Free(p); - } - if (area->thresholded != NULL) - KillPicture(area->thresholded); - Free(area); -} -/* -:h3.CopyRegion() - Makes a Copy of a Region -*/ -struct region * -CopyRegion(struct region *area) /* region to duplicate */ -{ - register struct region *r; /* output region built here */ - register struct edgelist *last = NULL; /* loop variable */ - register struct edgelist *p,*newp; /* loop variables */ - - r = (struct region *)Allocate(sizeof(struct region), area, 0); - r->anchor = NULL; - - for (p=area->anchor; VALIDEDGE(p); p=p->link) { - - newp = NewEdge(p->xmin, p->xmax, p->ymin, p->ymax, p->xvalues, ISDOWN(p->flag)); - if (r->anchor == NULL) - r->anchor = last = newp; - else - last->link = newp; - - last = newp; - } - if (area->thresholded != NULL) - /* replaced DupPicture with Dup() 3-26-91 PNM */ - r->thresholded = (struct picture *)Dup(area->thresholded); - return(r); -} -/* -:h4.NewEdge() - Allocates and Returns a New "edgelist" Structure - -We allocate space for the X values contiguously with the 'edgelist' -structure that locates them. That way, we only have to free the -edgelist structure to free all memory associated with it. Damn -clever, huh? -*/ - -static struct edgelist * -NewEdge(pel xmin, pel xmax, /* X extent of edge */ - pel ymin, pel ymax, /* Y extent of edge */ - pel *xvalues, /* list of X values for entire edge */ - int isdown) /* flag: TRUE means edge progresses downward */ -{ - static struct edgelist template = { - EDGETYPE, 0, 1, NULL, NULL, - 0, 0, 0, 0, NULL }; - - register struct edgelist *r; /* returned structure */ - register int iy; /* ymin adjusted for 'long' alignment purposes */ - - if (ymin >= ymax) - Abort("newedge: height not positive"); -/* -We are going to copy the xvalues into a newly allocated area. It -helps performance if the values are all "long" aligned. We can test -if the xvalues are long aligned by ANDing the address with the -(sizeof(long) - 1)--if non zero, the xvalues are not aligned well. We -set 'iy' to the ymin value that would give us good alignment: -*/ - iy = ymin - (((unsigned long)xvalues) & (sizeof(long)-1)) / sizeof(pel); - - r = (struct edgelist *)Allocate(sizeof(struct edgelist), &template, - (ymax - iy) * sizeof(pel)); - - if (isdown) r->flag = ISDOWN(ON); - r->xmin = xmin; - r->xmax = xmax; - r->ymin = ymin; - r->ymax = ymax; - - r->xvalues = (pel *) FOLLOWING(r); - if (ymin != iy) { - r->xvalues += ymin - iy; - xvalues -= ymin - iy; - } - -/* -We must round up (ymax - iy) so we get the ceiling of the number of -longs. The destination must be able to hold these extra bytes because -Allocate() makes everything it allocates be in multiples of longs. -*/ - LONGCOPY(&r[1], xvalues, (ymax - iy) * sizeof(pel) + sizeof(long) - 1); - - return(r); -} - -/* -:h3 id=discard.discard() - Discard All Edges Between Two Edges - -At first glance it would seem that we could discard an edgelist -structure merely by unlinking it from the list and freeing it. You are -wrong, region-breath! For performance, the X values associated with an -edge are allocated contiguously with it. So, we free the X values when -we free a structure. However, once an edge has been split, we are no -longer sure which control block actually is part of the memory block -that contains the edges. Rather than trying to decide, we play it safe -and never free part of a region. - -So, to mark a 'edgelist' structure as discarded, we move it to the end -of the list and set ymin=ymax. -*/ - -static void -discard(struct edgelist *left, /* all edges between here exclusive */ - struct edgelist *right) /* should be discarded */ -{ - register struct edgelist *beg,*end,*p; - - beg = left->link; - if (beg == right) - return; - - for (p = beg; p != right; p = p->link) { - if (p->link == NULL && right != NULL) - Abort("discard(): ran off end"); - p->ymin = p->ymax = 32767; - end = p; - } - /* - * now put the chain beg/end at the end of right, if it is not - * already there: - */ - if (right != NULL) { - left->link = right; - while (right->link != NULL) - right = right->link; - right->link = beg; - } - end->link = NULL; -} - -/* -:h4.Unwind() - Discards Edges That Fail the Winding Rule Test - -The winding rule says that upward going edges should be paired with -downward going edges only, and vice versa. So, if two upward edges -or two downward edges are nominally left/right pairs, Unwind() should -discard the second one. Everything should balance; we should discard -an even number of edges; of course, we abort if we don't. -*/ -static void -Unwind(struct edgelist *area) /* input area modified in place */ -{ - register struct edgelist *last = NULL,*next; /* struct before and after current one */ - register int y; /* ymin of current swath */ - register int count,newcount; /* winding count registers */ - - while (VALIDEDGE(area)) { - - count = 0; - y = area->ymin; - - do { - next = area->link; - - if (ISDOWN(area->flag)) - newcount = count + 1; - else - newcount = count - 1; - - if (count == 0 || newcount == 0) - last = area; - else - discard(last, next); - - count = newcount; - area = next; - - } while (area != NULL && area->ymin == y); - - if (count != 0) - Abort("Unwind: uneven edges"); - } -} -/* -:h2.Building Regions - -:h3.Interior() - Iterate Through a Path, Building a Region - -This routine is the workhorse driver routine that iterates through a -path, calling the appropriate stepping routines to actually produce the -run end "edgelist" structures. - -:ol. -:li."Interior" calls StepLine or StepConic or StepBezier as appropriate -to produce run ends. -:li.Occasionally these routines will notice a change in Y direction -and will call ChangeDirection (through the GOING_TO macro); this is -a call back to the REGIONS module. -:li.ChangeDirection will call whatever function is in the region -structure; for Interior, this function is 'newfilledge'. -:li.Newfilledge will call NewEdge to create a new edgelist structure, -then, call SortSwath to sort it onto the linked list being built at -the region "anchor". -:eol. - -By making the function called by ChangeDirection be a parameter of the -region, we allow the same ChangeDirection logic to be used by stroking. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -struct region * -Interior(struct segment *p, /* take interior of this path */ - int fillrule) /* rule to follow if path crosses itself */ -{ - register fractpel x,y; /* keeps ending point of path segment */ - fractpel lastx,lasty; /* previous x,y from path segment before */ - register struct region *R; /* region I will build */ - register struct segment *nextP; /* next segment of path */ - struct fractpoint hint; /* accumulated hint value */ - char tempflag; /* flag; is path temporary? */ - char Cflag; /* flag; should we apply continuity? */ - - if (p == NULL) - return(NULL); -/* -Establish the 'Cflag' continuity flag based on user's fill rule and -our own 'Continuity' pragmatic (0: never do continuity, 1: do what -user asked, >1: do it regardless). -*/ - if (fillrule > 0) { - Cflag = Continuity > 0; - fillrule -= CONTINUITY; - } - else - Cflag = Continuity > 1; - - ARGCHECK((fillrule != WINDINGRULE && fillrule != EVENODDRULE), - "Interior: bad fill rule", NULL, NULL, (1,p), struct region *); - - if (p->type == TEXTTYPE) -/* if (fillrule != EVENODDRULE) - else */ - return((struct region *)UniquePath(p)); - if (p->type == STROKEPATHTYPE) { - if (fillrule == WINDINGRULE) - return((struct region *)DoStroke(p)); - else - p = CoercePath(p); - } - - R = (struct region *)Allocate(sizeof(struct region), &EmptyRegion, 0); - - ARGCHECK(!ISPATHANCHOR(p), "Interior: bad path", p, R, (0), struct region *); - ARGCHECK((p->type != MOVETYPE), "Interior: path not closed", p, R, (0), struct region *); - - -/* changed definition from !ISPERMANENT to references <= 1 3-26-91 PNM */ - tempflag = (p->references <= 1); /* only first segment in path is so marked */ - if (!ISPERMANENT(p->flag)) p->references -= 1; - - R->newedgefcn = newfilledge; -/* -Believe it or not, "R" is now completely initialized. We are counting -on the copy of template to get other fields the way we want them, -namely -:ol. -:li.anchor = NULL -:li.xmin, ymin, xmax, ymax, to minimum and maximum values respectively. -:eol. -Anchor = NULL is very -important to ChangeDirection. -See :hdref refid=CD.. - -To minimize problems of "wrapping" in our pel arithmetic, we keep an -origin of the region which is the first move. Hopefully, that keeps -numbers within plus or minus 32K pels. -*/ - R->origin.x = 0/*TOFRACTPEL(NEARESTPEL(p->dest.x))*/; - R->origin.y = 0/*TOFRACTPEL(NEARESTPEL(p->dest.y))*/; - lastx = - R->origin.x; - lasty = - R->origin.y; -/* -ChangeDirection initializes other important fields in R, such as -lastdy, edge, edgeYstop, edgexmin, and edgexmax. The first segment -is a MOVETYPE, so it will be called first. -*/ -/* -The hints data structure must be initialized once for each path. -*/ - - if (ProcessHints) - InitHints(); /* initialize hint data structure */ - - while (p != NULL) { - - x = lastx + p->dest.x; - y = lasty + p->dest.y; - - nextP = p->link; - -/* -Here we start the hints processing by initializing the hint value to -zero. If ProcessHints is FALSE, the value will remain zero. -Otherwise, hint accumulates the computed hint values. -*/ - - hint.x = hint.y = 0; - -/* -If we are processing hints, and this is a MOVE segment (other than -the first on the path), we need to close (reverse) any open hints. -*/ - - if (ProcessHints) - if ((p->type == MOVETYPE) && (p->last == NULL)) { - CloseHints(&hint); - } - -/* -Next we run through all the hint segments (if any) attached to this -segment. If ProcessHints is TRUE, we will accumulate computed hint -values. In either case, nextP will be advanced to the first non-HINT -segment (or NULL), and each hint segment will be freed if necessary. -*/ - - while ((nextP != NULL) && (nextP->type == HINTTYPE)) { - if (ProcessHints) - ProcessHint((struct hintsegment *)nextP, - x + hint.x, y + hint.y, &hint); - - { - register struct segment *saveP = nextP; - - nextP = nextP->link; - if (tempflag) - Free(saveP); - } - } - -/* -We now apply the full hint value to the ending point of the path segment. -*/ - - x += hint.x; - y += hint.y; - - switch(p->type) { - - case LINETYPE: - StepLine(R, lastx, lasty, x, y); - break; - - case CONICTYPE: - { - -/* -For a conic curve, we apply half the hint value to the conic midpoint. -*/ - - } - break; - - case BEZIERTYPE: - { - register struct beziersegment *bp = (struct beziersegment *) p; - -/* -For a Bezier curve, we apply the full hint value to the Bezier C point. -*/ - - StepBezier(R, lastx, lasty, - lastx + bp->B.x, lasty + bp->B.y, - lastx + bp->C.x + hint.x, - lasty + bp->C.y + hint.y, - x, y); - } - break; - - case MOVETYPE: -/* -At this point we have encountered a MOVE segment. This breaks the -path, making it disjoint. -*/ - if (p->last == NULL) /* i.e., not first in path */ - ChangeDirection(CD_LAST, R, lastx, lasty, (fractpel) 0); - - ChangeDirection(CD_FIRST, R, x, y, (fractpel) 0); -/* -We'll just double check for closure here. We forgive an appended -MOVETYPE at the end of the path, if it isn't closed: -*/ - if (!ISCLOSED(p->flag) && p->link != NULL) - return((struct region *)ArgErr("Fill: sub-path not closed", p, NULL)); - break; - - default: - Abort("Interior: path type error"); - } -/* -We're done with this segment. Advance to the next path segment in -the list, freeing this one if necessary: -*/ - lastx = x; lasty = y; - - if (tempflag) - Free(p); - p = nextP; - } - ChangeDirection(CD_LAST, R, lastx, lasty, (fractpel) 0); - R->ending.x = lastx; - R->ending.y = lasty; -/* -Finally, clean up the region's based on the user's 'fillrule' request: -*/ - if (Cflag) - ApplyContinuity(R); - if (fillrule == WINDINGRULE) - Unwind(R->anchor); - return(R); -} -/* -:h3."workedge" Array - -This is a statically allocated array where edges are built -before being copied into more permanent storage by NewEdge(). -*/ - -#ifndef MAXEDGE -#define MAXEDGE 1000 -#endif - -static pel workedge[MAXEDGE]; -static pel *currentworkarea = workedge; -static pel currentsize = MAXEDGE; - -/* -:h3 id=cd.ChangeDirection() - Called When Y Direction Changes - -The rasterizing routines call this entry point when they detect -a change in Y. We then build the current edge and sort it into -emerging edgelist at 'anchor' by calling whatever "newedgefcn" -is appropriate. -*/ - -void -ChangeDirection(int type, /* CD_FIRST, CD_CONTINUE, or CD_LAST */ - struct region *R, /* region in which we are changing direction */ - fractpel x, fractpel y, /* current beginning x,y */ - fractpel dy) /* direction and magnitude of change in y */ -{ - register fractpel ymin,ymax; /* minimum and maximum Y since last call */ - register pel iy; /* nearest integer pel to 'y' */ - register pel idy; /* nearest integer pel to 'dy' */ - register int ydiff; /* allowed Y difference in 'currentworkarea' */ - - if (type != CD_FIRST) { - - if (R->lastdy > 0) { - ymin = R->firsty; - ymax = y; - } - else { - ymin = y; - ymax = R->firsty; - } - - if (ymax < ymin) - Abort("negative sized edge?"); - - - (*R->newedgefcn)(R, R->edgexmin, R->edgexmax, ymin, ymax, - R->lastdy > 0); - - } - - R->firsty = y; - R->firstx = x; - R->lastdy = dy; - - iy = NEARESTPEL(y); - idy = NEARESTPEL(dy); - if (currentworkarea != workedge && idy < MAXEDGE && idy > -MAXEDGE) { - NonObjectFree(currentworkarea); - currentworkarea = workedge; - currentsize = MAXEDGE; - } - ydiff = currentsize - 1; - if (dy > 0) { - R->edge = ¤tworkarea[-iy]; - R->edgeYstop = TOFRACTPEL(ydiff + iy) + FPHALF; - } - else { - R->edge = ¤tworkarea[ydiff - iy]; - R->edgeYstop = TOFRACTPEL(iy - ydiff) - FPHALF; - } - R->edgexmax = R->edgexmin = x; -/* -If this is the end of a subpath, we complete the subpath circular -chain: -*/ - if (type == CD_LAST && R->lastedge != NULL) { - register struct edgelist *e = R->firstedge; - - while (e->subpath != NULL) - e = e->subpath; - e->subpath = R->lastedge; - R->lastedge = R->firstedge = NULL; - } -} -/* -:h3 id=newfill.newfilledge() - Called When We Have a New Edge While Filling - -This is the prototypical "newedge" function passed to "Rasterize" and -stored in "newedgefcn" in the region being built. - -If the edge is non-null, we sort it onto the list of edges we are -building at "anchor". - -This function also has to keep the bounding box of the region -up to date. -*/ - -static void -newfilledge(struct region *R, /* region being built */ - fractpel xmin, fractpel xmax, /* X range of this edge */ - fractpel ymin, fractpel ymax, /* Y range of this edge */ - int isdown) /* flag: TRUE means edge goes down, else up */ -{ - - register pel pelxmin,pelymin,pelxmax,pelymax; /* pel versions of bounds */ - register struct edgelist *edge; /* newly created edge */ - - pelymin = NEARESTPEL(ymin); - pelymax = NEARESTPEL(ymax); - if (pelymin == pelymax) - return; - - pelxmin = NEARESTPEL(xmin); - pelxmax = NEARESTPEL(xmax); - - if (pelxmin < R->xmin) R->xmin = pelxmin; - if (pelxmax > R->xmax) R->xmax = pelxmax; - if (pelymin < R->ymin) R->ymin = pelymin; - if (pelymax > R->ymax) R->ymax = pelymax; - - edge = NewEdge(pelxmin, pelxmax, pelymin, pelymax, &R->edge[pelymin], isdown); - edge->subpath = R->lastedge; - R->lastedge = edge; - if (R->firstedge == NULL) - R->firstedge = edge; - - R->anchor = SortSwath(R->anchor, edge, swathxsort); - -} - -/* -:h2.Sorting Edges - -:h3.SortSwath() - Vertically Sort an Edge into a Region - -This routine sorts an edge or a pair of edges into a growing region, -so that the region maintains its top-to-bottom, left-to-right form. -The rules for sorting horizontally may vary depending on what you -are doing, but the rules for vertical sorting are always the same. -This routine is passed an argument that is a function that will -perform the horizontal sort on demand (for example, swathxsort() or -SwathUnion()). - -This is a recursive routine. A new edge (or edge pair) may overlap -the list I am building in strange and wonderful ways. Edges may -cross. When this happens, my strategy is to split the incoming edge -(or the growing list) in two at that point, execute the actual sort on -the top part of the split, and recursively call myself to figure out -exactly where the bottom part belongs. -*/ - -#define TOP(e) ((e)->ymin) /* the top of an edge (for readability */ -#define BOTTOM(e) ((e)->ymax) /* the bottom of an edge (for readability */ - -struct edgelist * -SortSwath(struct edgelist *anchor, /* list being built */ - struct edgelist *edge, /* incoming edge or pair of edges */ - SwathFunc swathfcn) /* horizontal sorter */ -{ - register struct edgelist *before,*after; - struct edgelist base; - - if (anchor == NULL) - return(edge); - - before = &base; - before->ymin = before->ymax = MINPEL; - before->link = after = anchor; - -/* -If the incoming edge is above the current list, we connect the current -list to the bottom of the incoming edge. One slight complication is -if the incoming edge overlaps into the current list. Then, we -first split the incoming edge in two at the point of overlap and recursively -call ourselves to sort the bottom of the split into the current list: -*/ - if (TOP(edge) < TOP(after)) { - if (BOTTOM(edge) > TOP(after)) { - - after = SortSwath(after, splitedge(edge, TOP(after)), swathfcn); - } - vertjoin(edge, after); - return(edge); - } -/* -At this point the top of edge is not higher than the top of the list, -which we keep in 'after'. We move the 'after' point down the list, -until the top of the edge occurs in the swath beginning with 'after'. - -If the bottom of 'after' is below the bottom of the edge, we have to -split the 'after' swath into two parts, at the bottom of the edge. -If the bottom of 'after' is above the bottom of the swath, -*/ - - while (VALIDEDGE(after)) { - - if (TOP(after) == TOP(edge)) { - if (BOTTOM(after) > BOTTOM(edge)) - vertjoin(after, splitedge(after, BOTTOM(edge))); - else if (BOTTOM(after) < BOTTOM(edge)) { - after = SortSwath(after, - splitedge(edge, BOTTOM(after)), swathfcn); - } - break; - } - else if (TOP(after) > TOP(edge)) { - if (BOTTOM(edge) > TOP(after)) { - after = SortSwath(after, - splitedge(edge, TOP(after)), swathfcn); - } - break; - } - else if (BOTTOM(after) > TOP(edge)) - vertjoin(after, splitedge(after, TOP(edge))); - - before = after; - after = after->link; - } - -/* -At this point 'edge' exactly corresponds in height to the current -swath pointed to by 'after'. -*/ - if (after != NULL && TOP(after) == TOP(edge)) { - before = (*swathfcn)(before, edge); - after = before->link; - } -/* -At this point 'after' contains all the edges after 'edge', and 'before' -contains all the edges before. Whew! A simple matter now of adding -'edge' to the linked list in its rightful place: -*/ - before->link = edge; - if (RegionDebug > 1) { - while (edge->link != NULL) { - edge = edge->link; - } - } - else - for (; edge->link != NULL; edge = edge->link) { ; } - - edge->link = after; - return(base.link); -} - -/* -:h3.splitedge() - Split an Edge or Swath in Two at a Given Y Value - -This function returns the edge or swath beginning at the Y value, and -is guaranteed not to change the address of the old swath while splitting -it. -*/ - -static struct edgelist * -splitedge(struct edgelist *list, /* area to split */ - pel y) /* Y value to split list at */ -{ - register struct edgelist *new; /* anchor for newly built list */ - register struct edgelist *last = NULL; /* end of newly built list */ - register struct edgelist *r; /* temp pointer to new structure */ - register struct edgelist *lastlist; /* temp pointer to last 'list' value */ - - lastlist = new = NULL; - - while (list != NULL) { - if (y < list->ymin) - break; - if (y >= list->ymax) - Abort("splitedge: above top of list"); - if (y == list->ymin) - Abort("splitedge: would be null"); - - r = (struct edgelist *)Allocate(sizeof(struct edgelist), list, 0); -/* -At this point 'r' points to a copy of the single structure at 'list'. -We will make 'r' be the new split 'edgelist'--the lower half. -We don't bother to correct 'xmin' and 'xmax', we'll take the -the pessimistic answer that results from using the old values. -*/ - r->ymin = y; - r->xvalues = list->xvalues + (y - list->ymin); -/* -Note that we do not need to allocate new memory for the X values, -they can remain with the old "edgelist" structure. We do have to -update that old structure so it is not as high: -*/ - list->ymax = y; -/* -Insert 'r' in the subpath chain: -*/ - r->subpath = list->subpath; - list->subpath = r; -/* -Now attach 'r' to the list we are building at 'new', and advance -'list' to point to the next element in the old list: -*/ - if (new == NULL) - new = r; - else - last->link = r; - last = r; - lastlist = list; - list = list->link; - } -/* -At this point we have a new list built at 'new'. We break the old -list at 'lastlist', and add the broken off part to the end of 'new'. -Then, we return the caller a pointer to 'new': -*/ - if (new == NULL) - Abort("null splitedge"); - lastlist->link = NULL; - last->link = list; - return(new); -} - -/* -:h3.vertjoin() - Join Two Disjoint Edge Lists Vertically - -The two edges must be disjoint vertically. -*/ -static void vertjoin(top, bottom) - register struct edgelist *top; /* uppermost region */ - register struct edgelist *bottom; /* bottommost region */ -{ - if (BOTTOM(top) > TOP(bottom)) - Abort("vertjoin not disjoint"); - - for (; top->link != NULL; top=top->link) { ; } - - top->link = bottom; - return; -} - -/* -:h3.swathxsort() - Sorting by X Values - -We need to sort 'edge' into its rightful -place in the swath by X value, taking care that we do not accidentally -advance to the next swath while searching for the correct X value. Like -all swath functions, this function returns a pointer to the edge -BEFORE the given edge in the sort. -*/ - -static struct edgelist * -swathxsort(struct edgelist *before0, /* edge before this swath */ - struct edgelist *edge) /* input edge */ -{ - register struct edgelist *before; - register struct edgelist *after; - register pel y = 0; - - before = before0; - after = before->link; - - while (after != NULL && TOP(after) == TOP(edge)) { - - register pel *x1,*x2; - - y = TOP(edge); - x1 = after->xvalues; - x2 = edge->xvalues; - - while (y < BOTTOM(edge) && *x1 == *x2) { - x1++; x2++; y++; - } - if (y >= BOTTOM(edge)) { - edge->flag |= ISAMBIGUOUS(ON); - after->flag |= ISAMBIGUOUS(ON); - break; - } - - if (*x1 >= *x2) - break; - - before = after; - after = after->link; - } - -/* -At this point, 'edge' is between 'before' and 'after'. If 'edge' didn't -cross either of those other edges, we would be done. We check for -crossing. If it does cross, we split the problem up by calling SortSwath -recursively with the part of the edge that is below the crossing point: -*/ -{ - register int h0,h; /* height of edge--number of scans */ - - h0 = h = BOTTOM(edge) - y; - y -= TOP(edge); - - if (h0 <= 0) { - return(before); - } - - if (TOP(before) == TOP(edge)) - h -= crosses(h, &before->xvalues[y], &edge->xvalues[y]); - if (after != NULL && TOP(after) == TOP(edge)) - h -= crosses(h, &edge->xvalues[y], &after->xvalues[y]); - - if (h < h0) { - SortSwath(before0->link, - splitedge(edge, TOP(edge) + y + h), - swathxsort); - - } -} - - return(before); -} -/* -:h3.SwathUnion() - Union Two Edges by X Value - -We have a left and right edge that must be unioned into a growing -swath. If they are totally disjoint, they are just added in. The -fun comes in they overlap the existing edges. Then some edges -will disappear. -*/ - -struct edgelist * -SwathUnion(struct edgelist *before0, /* edge before the swath */ - struct edgelist *edge) /* list of two edges to be unioned */ -{ - register int h; /* saves height of edge */ - register struct edgelist *rightedge; /* saves right edge of 'edge' */ - register struct edgelist *before,*after; /* edge before and after */ - int h0; /* saves initial height */ - - h0 = h = edge->ymax - edge->ymin; - if (h <= 0) - Abort("SwathUnion: 0 height swath?"); - - before = before0; - after = before->link; - - while (after != NULL && TOP(after) == TOP(edge)) { - register struct edgelist *right; - - right = after->link; - if (right->xvalues[0] >= edge->xvalues[0]) - break; - before = right; - after = before->link; - } -/* -This is the picture at this point. 'L' indicates a left hand edge, -'R' indicates the right hand edge. -'<--->' indicates the degree of uncertainty as to its placement -relative to other edges: -:xmp atomic. - before after - R <---L----> R L R L R - <---L---> <------R--------------------------> - edge -:exmp. -In case the left of 'edge' touches 'before', we need to reduce -the height by that amount. -*/ - if (TOP(before) == TOP(edge)) - h -= touches(h, before->xvalues, edge->xvalues); - - rightedge = edge->link; - - if (after == NULL || TOP(after) != TOP(edge) || - after->xvalues[0] > rightedge->xvalues[0]) { -/* -On this side of the the above 'if', the new edge is disjoint from the -existing edges in the swath. This is the picture: -:xmp atomic. - before after - R L R L R L R - L R - edge -:exmp. -We will verify it remains disjoint for the entire height. If the -situation changes somewhere down the edge, we split the edge at that -point and recursively call ourselves (through 'SortSwath') to figure -out the new situation: -*/ - if (after != NULL && TOP(after) == TOP(edge)) - h -= touches(h, rightedge->xvalues, after->xvalues); - if (h < h0) - SortSwath(before0->link, splitedge(edge, edge->ymin + h), t1_SwathUnion); - /* go to "return" this edge pair; it is totally disjoint */ - } - else { -/* -At this point, at the 'else', we know that the -new edge overlaps one or more pairs in the existing swath. Here is -a picture of our knowledge and uncertainties: -:xmp atomic. - before after - R L R L R L R - <---L---> <---R-------------------> - edge -:exmp. -We need to move 'after' along until it is to the right of the -right of 'edge'. ('After' should always point to a left edge of a pair:) -*/ - register struct edgelist *left; /* variable to keep left edge in */ - - do { - left = after; - after = (after->link)->link; - - } while (after != NULL && TOP(after) == TOP(edge) - && after->xvalues[0] <= rightedge->xvalues[0]); -/* -At this point this is the picture: -:xmp atomic. - before left after - R L R L R L R - <---L---> <---R---> - edge -:exmp. -We need to verify that the situation stays like this all the way -down the edge. Again, if the -situation changes somewhere down the edge, we split the edge at that -point and recursively call ourselves (through 'SortSwath') to figure -out the new situation: -*/ - - h -= crosses(h, left->xvalues, rightedge->xvalues); - h -= crosses(h, edge->xvalues, ((before->link)->link)->xvalues); - - if (after != NULL && TOP(after) == TOP(edge)) - - h -= touches(h, rightedge->xvalues, after->xvalues); - -/* -OK, if we touched either of our neighbors we need to split at that point -and recursively sort the split edge onto the list. One tricky part -is that when we recursively sort, 'after' will change if it was not -in our current swath: -*/ - if (h < h0) { - SortSwath(before0->link, - splitedge(edge, edge->ymin + h), - t1_SwathUnion); - - if (after == NULL || TOP(after) != TOP(edge)) - for (after = before0->link; - TOP(after) == TOP(edge); - after = after->link) { ; } - } -/* -Now we need to augment 'edge' by the left and right of the overlapped -swath, and to discard all edges between before and after, because they -were overlapped and have been combined with the new incoming 'edge': -*/ - edge->xmin = MIN(edge->xmin, (before->link)->xmin); - edge->xmax = MIN(edge->xmax, (before->link)->xmax); - edgemin(h, edge->xvalues, (before->link)->xvalues); - rightedge->xmin = MAX(rightedge->xmin, (left->link)->xmin); - rightedge->xmax = MAX(rightedge->xmax, (left->link)->xmax); - edgemax(h, rightedge->xvalues, (left->link)->xvalues); - discard(before, after); - } - return(before); -} -#ifdef notused -/* -:h3.swathrightmost() - Simply Sorts New Edge to Rightmost of Swath - -Like all swath functions, this function returns a pointer to the edge -BEFORE the given edge in the sort. -*/ - -static struct edgelist * -swathrightmost(struct edgelist *before, /* edge before this swath */ - struct edgelist *edge) /* input edge */ -{ - register struct edgelist *after; - - after = before->link; - - while (after != NULL && TOP(after) == TOP(edge)) { - before = after; - after = after->link; - } - - return(before); - -} -#endif -/* -:h3.touches() - Returns the Remaining Height When Two Edges Touch - -So, it will return 0 if they never touch. Allows incredibly(?) mnemonic -if (touches(...)) construct. -*/ - -static int -touches(int h, pel *left, pel *right) -{ - for (; h > 0; h--) - if (*left++ >= *right++) - break; - return(h); -} -/* -:h3.crosses() - Returns the Remaining Height When Two Edges Cross - -So, it will return 0 if they never cross. -*/ - -static int -crosses(int h, pel *left, pel *right) -{ - for (; h > 0; h--) - if (*left++ > *right++) - break; - return(h); -} -/* -:h3.cedgemin() - Stores the Mininum of an Edge and an X Value -*/ - -static void -cedgemin(int h, pel *e1, pel x) -{ - for (; --h >= 0; e1++) - if (*e1 > x) - *e1 = x; -} -/* -:h3.cedgemax() - Stores the Maximum of an Edge and an X Value -*/ - -static void -cedgemax(int h, pel *e1, pel x) -{ - for (; --h >= 0; e1++) - if (*e1 < x) - *e1 = x; -} -/* -:h3.edgemin() - Stores the Mininum of Two Edges in First Edge -*/ - -static void -edgemin(int h, pel *e1, pel *e2) -{ - for (; --h >= 0; e1++,e2++) - if (*e1 > *e2) - *e1 = *e2; -} -/* -:h3.edgemax() - Stores the Maximum of Two Edges in First Edge -*/ - -static void -edgemax(int h, pel *e1, pel *e2) -{ - for (; --h >= 0; e1++,e2++) - if (*e1 < *e2) - *e1 = *e2; -} - -/* -:h2.Changing the Representation of Regions - -For convenience and/or performance, we sometimes like to change the way -regions are represented. This does not change the object itself, just -the representation, so these transformations can be made on a permanent -region. - -*/ - -void -MoveEdges(struct region *R, /* region to modify */ - fractpel dx, fractpel dy) /* delta X and Y to move edge list by */ -{ - register struct edgelist *edge; /* for looping through edges */ - - R->origin.x += dx; - R->origin.y += dy; - R->ending.x += dx; - R->ending.y += dy; - if (R->thresholded != NULL) { - R->thresholded->origin.x -= dx; - R->thresholded->origin.y -= dy; - } -/* -From now on we will deal with dx and dy as integer pel values: -*/ - dx = NEARESTPEL(dx); - dy = NEARESTPEL(dy); - if (dx == 0 && dy == 0) - return; - - R->xmin += dx; - R->xmax += dx; - R->ymin += dy; - R->ymax += dy; - - for (edge = R->anchor; VALIDEDGE(edge); edge = edge->link) { - edge->ymin += dy; - edge->ymax += dy; - if (dx != 0) { - register int h; /* loop index; height of edge */ - register pel *Xp; /* loop pointer to X values */ - - edge->xmin += dx; - edge->xmax += dx; - for (Xp = edge->xvalues, h = edge->ymax - edge->ymin; - --h >= 0; ) - *Xp++ += dx; - } - } -} - -/* -:h3.UnJumble() - Sort a Region Top to Bottom - -It is an open question whether it pays in general to do this. -*/ - -void -UnJumble(struct region *region) /* region to sort */ -{ - register struct edgelist *anchor; /* new lists built here */ - register struct edgelist *edge; /* edge pointer for loop */ - register struct edgelist *next; /* ditto */ - - anchor = NULL; - - for (edge=region->anchor; VALIDEDGE(edge); edge=next) { - if (edge->link == NULL) - Abort("UnJumble: unpaired edge?"); - next = edge->link->link; - edge->link->link = NULL; - anchor = SortSwath(anchor, edge, t1_SwathUnion); - } - - if (edge != NULL) - vertjoin(anchor, edge); - - region->anchor = anchor; - region->flag &= ~ISJUMBLED(ON); -} - -/* -*/ -#ifdef notused -static void -OptimizeRegion(struct region *R) /* region to optimize */ -{ - register pel *xP; /* pel pointer for inner loop */ - register int x; /* holds X value */ - register int xmin,xmax; /* holds X range */ - register int h; /* loop counter */ - register struct edgelist *e; /* edgelist pointer for loop */ - - R->flag |= ISRECTANGULAR(ON); - - for (e = R->anchor; VALIDEDGE(e); e=e->link) { - xmin = MAXPEL; - xmax = MINPEL; - for (h = e->ymax - e->ymin, xP = e->xvalues; --h >= 0;) { - x = *xP++; - if (x < xmin) xmin = x; - if (x > xmax) xmax = x; - } - if (xmin != xmax || (xmin != R->xmin && xmax != R->xmax)) - R->flag &= ~ISRECTANGULAR(ON); - if (xmin < e->xmin || xmax > e->xmax) - Abort("Tighten: existing edge bound was bad"); - if (xmin < R->xmin || xmax > R->xmax) - Abort("Tighten: existing region bound was bad"); - e->xmin = xmin; - e->xmax = xmax; - } - R->flag |= ISOPTIMIZED(ON); -} -#endif - -/* -:h2.Miscelaneous Routines - -:h3.MoreWorkArea() - Allocate New Space for "edge" - -Our strategy is to temporarily allocate an array to hold this -unexpectedly large edge. ChangeDirection frees this array any time -it gets a shorter 'dy'. -*/ - -/*ARGSUSED*/ -void -MoreWorkArea(struct region *R, /* region we are generating */ - fractpel x1, fractpel y1, /* starting point of line */ - fractpel x2, fractpel y2) /* ending point of line */ -{ - register int idy; /* integer dy of line */ - - idy = NEARESTPEL(y1) - NEARESTPEL(y2); - if (idy < 0) idy = - idy; - - /* - * we must add one to the delta for the number of run ends we - * need to store: - */ - if (++idy > currentsize) { - if (currentworkarea != workedge) - NonObjectFree(currentworkarea); - currentworkarea = (pel *)Allocate(0, NULL, idy * sizeof(pel)); - currentsize = idy; - } - ChangeDirection(CD_CONTINUE, R, x1, y1, y2 - y1); -} - -/* -:h3.BoxClip() - Clip a Region to a Rectangle - -BoxClip also duplicates the region if it is permanent. Note the -clipping box is specified in REGION coordinates, that is, in -coordinates relative to the region (0,0) point -*/ - -struct region * -BoxClip(struct region *R, /* region to clip */ - pel xmin, pel ymin, /* upper left hand corner of rectangle */ - pel xmax, pel ymax) /* lower right hand corner */ -{ - struct edgelist anchor; /* pretend edgelist to facilitate discards */ - register struct edgelist *e,*laste; - - R = UniqueRegion(R); - - if (xmin > R->xmin) { - R->xmin = xmin; - } - if (xmax < R->xmax) { - R->xmax = xmax; - } - - if (ymin > R->ymin) { - R->ymin = ymin; - } - if (ymax < R->ymax) { - R->ymax = ymax; - } - - - laste = &anchor; - anchor.link = R->anchor; - - for (e = R->anchor; VALIDEDGE(e); e = e->link) { - if (TOP(e) < ymin) { - e->xvalues += ymin - e->ymin; - e->ymin = ymin; - } - if (BOTTOM(e) > ymax) - e->ymax = ymax; - if (TOP(e) >= BOTTOM(e)) { - discard(laste, e->link->link); - e = laste; - continue; - } - if (e->xmin < xmin) { - cedgemax(BOTTOM(e) - TOP(e), e->xvalues, xmin); - e->xmin = xmin; - e->xmax = MAX(e->xmax, xmin); - } - if (e->xmax > xmax) { - cedgemin(BOTTOM(e) - TOP(e), e->xvalues, xmax); - e->xmin = MIN(e->xmin, xmax); - e->xmax = xmax; - } - laste = e; - } - - R->anchor = anchor.link; - - return(R); -} - -#ifdef notdef -/* -:h3.CoerceRegion() - Force a TextPath Structure to Become a Region - -We also save the newly created region in the textpath structure, if the -structure was permanent. Then we don't have to do this again. Why not -save it all the time? Well, we certainly could, but I suspect it -wouldn't pay. We would have to make this region permanent (because we -couldn't have it be consumed) and this would probably require -unnecessary CopyRegions in most cases. -*/ - -struct region * -CoerceRegion(struct textpath *tp) /* input TEXTTYPE */ -{ - struct segment *path; /* temporary character path */ - struct region *R; /* returned region */ - - - R = Interior(path, EVENODDRULE); - return(R); -} -#endif - -/* -:h3.RegionBounds() - Returns Bounding Box of a Region -*/ - -struct segment * -RegionBounds(struct region *R) -{ - register struct segment *path; /* returned path */ - - path = BoxPath(IDENTITY, R->ymax - R->ymin, R->xmax - R->xmin); - path = Join(PathSegment(MOVETYPE, R->origin.x + TOFRACTPEL(R->xmin), - R->origin.y + TOFRACTPEL(R->ymin) ), - path); - return(path); -} - -/* -:h2.Formatting/Dump Routines for Debug - -:h3.DumpArea() - Display a Region -*/ -void -DumpArea(struct region *area) -{ - DumpEdges(area->anchor); -} - -#define INSWATH(p, y0, y1) (p != NULL && p->ymin == y0 && p->ymax == y1) -/* -:h3.DumpEdges() - Display Run End Lists (Edge Lists) -*/ - -/* -:h3.edgecheck() - For Debug, Verify that an Edge Obeys the Rules -*/ - -/*ARGSUSED*/ -static void -edgecheck(struct edgelist *edge, int oldmin, int oldmax) -{ - if (edge->type != EDGETYPE) - Abort("EDGE ERROR: non EDGETYPE in list"); -/* -The following check is not valid if the region is jumbled so I took it -out: -*/ -/* if (edge->ymin < oldmax && edge->ymin != oldmin) - Abort("EDGE ERROR: overlapping swaths"); */ -} - -void -DumpEdges(struct edgelist *edges) -{ - register struct edgelist *p,*p2; - register pel ymin = MINPEL; - register pel ymax = MINPEL; - - if (edges == NULL) { - return; - } - if (RegionDebug <= 1) { - for (p=edges; p != NULL; p = p->link) { - edgecheck(p, ymin, ymax); - ymin = p->ymin; ymax = p->ymax; - } - } - else { - - for (p2=edges; p2 != NULL; ) { - - edgecheck(p2, ymin, ymax); - ymin = p2->ymin; - ymax = p2->ymax; - - while (INSWATH(p2, ymin, ymax)) - p2 = p2->link; - } - } -} diff --git a/nx-X11/lib/font/Type1/regions.h b/nx-X11/lib/font/Type1/regions.h deleted file mode 100644 index 96ad1a53a..000000000 --- a/nx-X11/lib/font/Type1/regions.h +++ /dev/null @@ -1,250 +0,0 @@ -/* $Xorg: regions.h,v 1.3 2000/08/17 19:46:32 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/regions.h,v 1.7 2001/01/17 19:43:23 dawes Exp $ */ -/*SHARED*/ - -#define Interior(p,rule) t1_Interior(p,rule) -#define Union(a1,a2) t1_Union(a1,a2) -#define Intersect(a1,a2) t1_Intersect(a1,a2) -#define Complement(area) t1_Complement(area) -#define Overlap(a1,a2) t1_OverLap(a1,a2) - - -/* returns the interior of a closed path */ -extern struct region *t1_Interior ( struct segment *p, int fillrule ); -#if 0 -struct region *t1_Union(); /* set union of paths or regions */ -struct region *t1_Intersect(); /* set intersection of regions */ -struct region *t1_Complement(); /* complement of a region */ -int t1_Overlap(); /* returns a Boolean; TRUE if regions overlap */ -#endif - -#define TT_INFINITY t1_Infinity - -/*END SHARED*/ -/*SHARED*/ - -#define ChangeDirection(type,R,x,y,dy) t1_ChangeDirection(type,R,x,y,dy) - -/* called when we change direction in Y */ -extern void t1_ChangeDirection ( int type, struct region *R, fractpel x, - fractpel y, fractpel dy ); -#define CD_FIRST -1 /* enumeration of ChangeDirection type */ -#define CD_CONTINUE 0 /* enumeration of ChangeDirection type */ -#define CD_LAST 1 /* enumeration of ChangeDirection type */ - -#define MoreWorkArea(R,x1,y1,x2,y2) t1_MoreWorkArea(R,x1,y1,x2,y2) -#define KillRegion(area) t1_KillRegion(area) -#define CopyRegion(area) t1_CopyRegion(area) -#define BoxClip(R,xmin,ymin,xmax,ymax) t1_BoxClip(R,xmin,ymin,xmax,ymax) -#define SortSwath(a,p,f) t1_SortSwath(a,p,f) -#define SwathUnion(b,e) t1_SwathUnion(b,e) -#define RegionBounds(r) t1_RegionBounds(r) -#define CoerceRegion(p) t1_CoerceRegion(p) -#define MoveEdges(R,dx,dy) t1_MoveEdges(R,dx,dy) -#define UnJumble(R) t1_UnJumble(R) - -typedef struct edgelist *(*SwathFunc)(struct edgelist *, struct edgelist *); - -/* get longer edge list for stepping */ -extern void t1_MoreWorkArea ( struct region *R, fractpel x1, fractpel y1, - fractpel x2, fractpel y2 ); -/* duplicate a region */ -extern struct region *t1_CopyRegion ( struct region *area ); -/* destroy a region */ -extern void t1_KillRegion ( struct region *area ); -/* clip a region to a rectangle */ -extern struct region *t1_BoxClip ( struct region *R, pel xmin, pel ymin, - pel xmax, pel ymax ); -/* sort edges onto growing edge list */ -extern struct edgelist *t1_SortSwath ( struct edgelist *anchor, - struct edgelist *edge, - SwathFunc swathfcn ); -/* 'union' two edges into a swath */ -extern struct edgelist *t1_SwathUnion ( struct edgelist *before0, - struct edgelist *edge ); -/* returns bounding box of a region */ -extern struct segment *t1_RegionBounds ( struct region *R ); -#ifdef notdef -/* force text to become a true region */ -struct region *t1_CoerceRegion(struct textpath *tp); -#endif -/* moves the edge values in a region */ -extern void t1_MoveEdges ( struct region *R, fractpel dx, fractpel dy ); -/* sort the edges and reset the jumbled flag */ -extern void t1_UnJumble ( struct region *region ); - - -/*END SHARED*/ -/*SHARED*/ - -#define GOING_TO(R, x1, y1, x2, y2, dy) { \ - if (dy < 0) { \ - if (R->lastdy >= 0) \ - ChangeDirection(CD_CONTINUE, R, x1, y1, dy); \ - if (y2 < R->edgeYstop) \ - MoreWorkArea(R, x1, y1, x2, y2); \ - } \ - else if (dy > 0) { \ - if (R->lastdy <= 0) \ - ChangeDirection(CD_CONTINUE, R, x1, y1, dy); \ - if (y2 > R->edgeYstop) \ - MoreWorkArea(R, x1, y1, x2, y2); \ - } \ - else /* dy == 0 */ ChangeDirection(CD_CONTINUE, R, x1, y1, dy); \ - if (x2 < R->edgexmin) R->edgexmin = x2; \ - else if (x2 > R->edgexmax) R->edgexmax = x2; \ -} - -#ifndef FONTMODULE -#ifndef __sxg__ -#include -#endif -#endif -#ifdef SHRT_MIN -#define MINPEL SHRT_MIN -#else -#define MINPEL ((pel)(-1<<(8*sizeof(pel)-1))) /* smallest value fitting in a pel */ -#endif -#ifdef SHRT_MAX -#define MAXPEL SHRT_MAX -#else -#define MAXPEL ((pel)((1<<(8*sizeof(pel)-1))-1))/* largest value fitting in a pel */ -#endif - -/* -The "Unique"-type macro is different (unique?) for regions, because some -regions structures are shared among several objects, and might have -to be made unique for that reason (i.e., references > 1). -*/ - -#define ConsumeRegion(R) MAKECONSUME(R,KillRegion(R)) -#define UniqueRegion(R) MAKEUNIQUE(R,CopyRegion(R)) - - -/*END SHARED*/ -/*SHARED*/ - -typedef void (*NewEdgeFunc)(struct region *, - fractpel, fractpel, fractpel, fractpel, int); - -struct region { - XOBJ_COMMON /* xobject common data define 3-26-91 PNM */ - /* type = REGIONTYPE */ - struct fractpoint origin; /* beginning handle: X,Y origin of region */ - struct fractpoint ending; /* ending handle: X,Y change after painting region */ - pel xmin,ymin; /* minimum X,Y of region */ - pel xmax,ymax; /* mat1_mum X,Y of region */ - struct edgelist *anchor; /* list of edges that bound the region */ - struct picture *thresholded; /* region defined by thresholded picture*/ -/* -Note that the ending handle and the bounding box values are stored -relative to 'origin'. - -The above elements describe a region. The following elements are -scratchpad areas used while the region is being built: -*/ - fractpel lastdy; /* direction of last segment */ - fractpel firstx,firsty; /* starting point of current edge */ - fractpel edgexmin,edgexmax; /* x extent of current edge */ - struct edgelist *lastedge,*firstedge; /* last and first edges in subpath */ - pel *edge; /* pointer to array of X values for edge */ - fractpel edgeYstop; /* Y value where 'edges' array ends */ - NewEdgeFunc newedgefcn; /* function to use when building a new edge */ - struct strokeinfo *strokeinfo; /* scratchpad info during stroking only */ -} ; -/* -The ISCOMPLEMENT flag indicates the region is reversed--it is the -"outside" of the nominal region. -*/ -#define ISCOMPLEMENT(flag) ((flag)&0x80) -/* -The ISJUMBLED flag indicates the region is not sorted top-to-bottom. -*/ -#define ISJUMBLED(flag) ((flag)&0x40) -/* -The ISINFINITE flag allows a quick check for an INFINITE region, which -is frequently intersected. -*/ -#define ISINFINITE(flag) ((flag)&0x20) - -/*END SHARED*/ -/*SHARED*/ - -#define ISRECTANGULAR(flag) ((flag)&0x08) - -/*END SHARED*/ -/*SHARED*/ - -#define EmptyRegion t1_EmptyRegion - -/*END SHARED*/ -/*SHARED*/ - -struct edgelist { - XOBJ_COMMON /* xobject common data define 3-26-91 PNM */ - /* type = EDGETYPE */ - struct edgelist *link; /* pointer to next in linked list */ - struct edgelist *subpath; /* informational link for "same subpath" */ - pel xmin,xmax; /* range of edge in X */ - pel ymin,ymax; /* range of edge in Y */ - pel *xvalues; /* pointer to ymax-ymin X values */ -} ; -/* -The end of the list is marked by either "link" being NULL, or by -ymin == ymax. See :hdref refid=discard.. We define the VALIDEDGE -predicate to test for the opposite of these conditions: -*/ - -#define VALIDEDGE(p) ((p)!=NULL&&(p)->ymin<(p)->ymax) - -/*END SHARED*/ -/*SHARED*/ - -#define ISDOWN(f) ((f)&0x80) - -#define ISAMBIGUOUS(f) ((f)&0x40) - -/*END SHARED*/ -/*SHARED*/ - -/* -Interior() rule enumerations: -*/ -#define WINDINGRULE -2 -#define EVENODDRULE -3 - -#define CONTINUITY 0x80 /* can be added to above rules; e.g. WINDINGRULE+CONTINUITY */ - -/*END SHARED*/ - -/* dump a region structure */ -extern void t1_DumpArea ( struct region *area ); -/* dump a region's edge list */ -extern void t1_DumpEdges ( struct edgelist *edges ); diff --git a/nx-X11/lib/font/Type1/scanfont.c b/nx-X11/lib/font/Type1/scanfont.c deleted file mode 100644 index 8db497959..000000000 --- a/nx-X11/lib/font/Type1/scanfont.c +++ /dev/null @@ -1,2370 +0,0 @@ -/* $XdotOrg: xc/lib/font/Type1/scanfont.c,v 1.5 2005/07/09 23:30:06 keithp Exp $ */ -/* $Xorg: scanfont.c,v 1.3 2000/08/17 19:46:32 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* Author: Katherine A. Hitchcock IBM Almaden Research Laboratory */ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/scanfont.c,v 1.16 2003/05/27 22:26:46 tsi Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#ifndef FONTMODULE -#include -#include -#else -#include "Xdefs.h" /* Bool declaration */ -#include "Xmd.h" /* INT32 declaration */ -#include "xf86_ansic.h" -#endif -#include "t1stdio.h" -#include "util.h" -#include "token.h" -#if XFONT_CID -#include "range.h" -#endif -#include "objects.h" -#include "spaces.h" -#include "fontfcn.h" -#include "blues.h" - -#if XFONT_CID -#define CID_BUFSIZE 80 - -extern psfont *FDArrayP; -static spacerange *spacerangeP; -static cidrange *notdefrangeP; -static cidrange *cidrangeP; -extern int FDArrayIndex; -static boolean CIDWantFontInfo; -static psobj inputFile1; -#endif - -static int rc; -static boolean InPrivateDict; -static boolean WantFontInfo; -static boolean TwoSubrs; -static psobj inputFile; -static psobj filterFile; -static psobj *inputP; - - -/**********************************************************************/ -/* Init_BuiltInEncoding() */ -/* */ -/* Initializes the StandardEncoding and ISOLatin1Encoding vector. */ -/* */ -/**********************************************************************/ -typedef struct /* Builtin Standard Encoding */ -{ - int index; - char *name; -} EncodingTable; - -static EncodingTable StdEnc[] = { - { 040 , "space" }, - { 041 , "exclam" }, - { 042 , "quotedbl" }, - { 043 , "numbersign" }, - { 044 , "dollar" }, - { 045 , "percent" }, - { 046 , "ampersand" }, - { 047 , "quoteright" }, - { 050 , "parenleft" }, - { 051 , "parenright" }, - { 052 , "asterisk" }, - { 053 , "plus" }, - { 054 , "comma" }, - { 055 , "hyphen" }, - { 056 , "period" }, - { 057 , "slash" }, - { 060 , "zero" }, - { 061 , "one" }, - { 062 , "two" }, - { 063 , "three" }, - { 064 , "four" }, - { 065 , "five" }, - { 066 , "six" }, - { 067 , "seven" }, - { 070 , "eight" }, - { 071 , "nine" }, - { 072 , "colon" }, - { 073 , "semicolon" }, - { 074 , "less" }, - { 075 , "equal" }, - { 076 , "greater" }, - { 077 , "question" }, - { 0100 , "at" }, - { 0101 , "A" }, - { 0102 , "B" }, - { 0103 , "C" }, - { 0104 , "D" }, - { 0105 , "E" }, - { 0106 , "F" }, - { 0107 , "G" }, - { 0110 , "H" }, - { 0111 , "I" }, - { 0112 , "J" }, - { 0113 , "K" }, - { 0114 , "L" }, - { 0115 , "M" }, - { 0116 , "N" }, - { 0117 , "O" }, - { 0120 , "P" }, - { 0121 , "Q" }, - { 0122 , "R" }, - { 0123 , "S" }, - { 0124 , "T" }, - { 0125 , "U" }, - { 0126 , "V" }, - { 0127 , "W" }, - { 0130 , "X" }, - { 0131 , "Y" }, - { 0132 , "Z" }, - { 0133 , "bracketleft" }, - { 0134 , "backslash" }, - { 0135 , "bracketright" }, - { 0136 , "asciicircum" }, - { 0137 , "underscore" }, - { 0140 , "quoteleft" }, - { 0141 , "a" }, - { 0142 , "b" }, - { 0143 , "c" }, - { 0144 , "d" }, - { 0145 , "e" }, - { 0146 , "f" }, - { 0147 , "g" }, - { 0150 , "h" }, - { 0151 , "i" }, - { 0152 , "j" }, - { 0153 , "k" }, - { 0154 , "l" }, - { 0155 , "m" }, - { 0156 , "n" }, - { 0157 , "o" }, - { 0160 , "p" }, - { 0161 , "q" }, - { 0162 , "r" }, - { 0163 , "s" }, - { 0164 , "t" }, - { 0165 , "u" }, - { 0166 , "v" }, - { 0167 , "w" }, - { 0170 , "x" }, - { 0171 , "y" }, - { 0172 , "z" }, - { 0173 , "braceleft" }, - { 0174 , "bar" }, - { 0175 , "braceright" }, - { 0176 , "asciitilde" }, - { 0241 , "exclamdown" }, - { 0242 , "cent" }, - { 0243 , "sterling" }, - { 0244 , "fraction" }, - { 0245 , "yen" }, - { 0246 , "florin" }, - { 0247 , "section" }, - { 0250 , "currency" }, - { 0251 , "quotesingle" }, - { 0252 , "quotedblleft" }, - { 0253 , "guillemotleft" }, - { 0254 , "guilsinglleft" }, - { 0255 , "guilsinglright" }, - { 0256 , "fi" }, - { 0257 , "fl" }, - { 0261 , "endash" }, - { 0262 , "dagger" }, - { 0263 , "daggerdbl" }, - { 0264 , "periodcentered" }, - { 0266 , "paragraph" }, - { 0267 , "bullet" }, - { 0270 , "quotesinglbase" }, - { 0271 , "quotedblbase" }, - { 0272 , "quotedblright" }, - { 0273 , "guillemotright" }, - { 0274 , "ellipsis" }, - { 0275 , "perthousand" }, - { 0277 , "questiondown" }, - { 0301 , "grave" }, - { 0302 , "acute" }, - { 0303 , "circumflex" }, - { 0304 , "tilde" }, - { 0305 , "macron" }, - { 0306 , "breve" }, - { 0307 , "dotaccent" }, - { 0310 , "dieresis" }, - { 0312 , "ring" }, - { 0313 , "cedilla" }, - { 0315 , "hungarumlaut" }, - { 0316 , "ogonek" }, - { 0317 , "caron" }, - { 0320 , "emdash" }, - { 0341 , "AE" }, - { 0343 , "ordfeminine" }, - { 0350 , "Lslash" }, - { 0351 , "Oslash" }, - { 0352 , "OE" }, - { 0353 , "ordmasculine" }, - { 0361 , "ae" }, - { 0365 , "dotlessi" }, - { 0370 , "lslash" }, - { 0371 , "oslash" }, - { 0372 , "oe" }, - { 0373 , "germandbls" }, - { 0, 0 } -}; - -static EncodingTable ISO8859Enc[] = { - { 32, "space" }, - { 33, "exclam" }, - { 34, "quotedbl" }, - { 35, "numbersign" }, - { 36, "dollar" }, - { 37, "percent" }, - { 38, "ampersand" }, - { 39, "quoteright" }, - { 40, "parenleft" }, - { 41, "parenright" }, - { 42, "asterisk" }, - { 43, "plus" }, - { 44, "comma" }, - { 45, "minus" }, - { 46, "period" }, - { 47, "slash" }, - { 48, "zero" }, - { 49, "one" }, - { 50, "two" }, - { 51, "three" }, - { 52, "four" }, - { 53, "five" }, - { 54, "six" }, - { 55, "seven" }, - { 56, "eight" }, - { 57, "nine" }, - { 58, "colon" }, - { 59, "semicolon" }, - { 60, "less" }, - { 61, "equal" }, - { 62, "greater" }, - { 63, "question" }, - { 64, "at" }, - { 65, "A" }, - { 66, "B" }, - { 67, "C" }, - { 68, "D" }, - { 69, "E" }, - { 70, "F" }, - { 71, "G" }, - { 72, "H" }, - { 73, "I" }, - { 74, "J" }, - { 75, "K" }, - { 76, "L" }, - { 77, "M" }, - { 78, "N" }, - { 79, "O" }, - { 80, "P" }, - { 81, "Q" }, - { 82, "R" }, - { 83, "S" }, - { 84, "T" }, - { 85, "U" }, - { 86, "V" }, - { 87, "W" }, - { 88, "X" }, - { 89, "Y" }, - { 90, "Z" }, - { 91, "bracketleft" }, - { 92, "backslash" }, - { 93, "bracketright" }, - { 94, "asciicircum" }, - { 95, "underscore" }, - { 96, "quoteleft" }, - { 97, "a" }, - { 98, "b" }, - { 99, "c" }, - { 100, "d" }, - { 101, "e" }, - { 102, "f" }, - { 103, "g" }, - { 104, "h" }, - { 105, "i" }, - { 106, "j" }, - { 107, "k" }, - { 108, "l" }, - { 109, "m" }, - { 110, "n" }, - { 111, "o" }, - { 112, "p" }, - { 113, "q" }, - { 114, "r" }, - { 115, "s" }, - { 116, "t" }, - { 117, "u" }, - { 118, "v" }, - { 119, "w" }, - { 120, "x" }, - { 121, "y" }, - { 122, "z" }, - { 123, "braceleft" }, - { 124, "bar" }, - { 125, "braceright" }, - { 126, "asciitilde" }, - { 160, "space" }, - { 161, "exclamdown" }, - { 162, "cent" }, - { 163, "sterling" }, - { 164, "currency" }, - { 165, "yen" }, - { 166, "brokenbar" }, - { 167, "section" }, - { 168, "dieresis" }, - { 169, "copyright" }, - { 170, "ordfeminine" }, - { 171, "guillemotleft" }, - { 172, "logicalnot" }, - { 173, "hyphen" }, - { 174, "registered" }, - { 175, "macron" }, - { 176, "degree" }, - { 177, "plusminus" }, - { 178, "twosuperior" }, - { 179, "threesuperior" }, - { 180, "acute" }, - { 181, "mu" }, - { 182, "paragraph" }, - { 183, "periodcentered" }, - { 184, "cedilla" }, - { 185, "onesuperior" }, - { 186, "ordmasculine" }, - { 187, "guillemotright" }, - { 188, "onequarter" }, - { 189, "onehalf" }, - { 190, "threequarters" }, - { 191, "questiondown" }, - { 192, "Agrave" }, - { 193, "Aacute" }, - { 194, "Acircumflex" }, - { 195, "Atilde" }, - { 196, "Adieresis" }, - { 197, "Aring" }, - { 198, "AE" }, - { 199, "Ccedilla" }, - { 200, "Egrave" }, - { 201, "Eacute" }, - { 202, "Ecircumflex" }, - { 203, "Edieresis" }, - { 204, "Igrave" }, - { 205, "Iacute" }, - { 206, "Icircumflex" }, - { 207, "Idieresis" }, - { 208, "Eth" }, - { 209, "Ntilde" }, - { 210, "Ograve" }, - { 211, "Oacute" }, - { 212, "Ocircumflex" }, - { 213, "Otilde" }, - { 214, "Odieresis" }, - { 215, "multiply" }, - { 216, "Oslash" }, - { 217, "Ugrave" }, - { 218, "Uacute" }, - { 219, "Ucircumflex" }, - { 220, "Udieresis" }, - { 221, "Yacute" }, - { 222, "Thorn" }, - { 223, "germandbls" }, - { 224, "agrave" }, - { 225, "aacute" }, - { 226, "acircumflex" }, - { 227, "atilde" }, - { 228, "adieresis" }, - { 229, "aring" }, - { 230, "ae" }, - { 231, "ccedilla" }, - { 232, "egrave" }, - { 233, "eacute" }, - { 234, "ecircumflex" }, - { 235, "edieresis" }, - { 236, "igrave" }, - { 237, "iacute" }, - { 238, "icircumflex" }, - { 239, "idieresis" }, - { 240, "eth" }, - { 241, "ntilde" }, - { 242, "ograve" }, - { 243, "oacute" }, - { 244, "ocircumflex" }, - { 245, "otilde" }, - { 246, "odieresis" }, - { 247, "divide" }, - { 248, "oslash" }, - { 249, "ugrave" }, - { 250, "uacute" }, - { 251, "ucircumflex" }, - { 252, "udieresis" }, - { 253, "yacute" }, - { 254, "thorn" }, - { 255, "ydieresis" }, - { 0, 0 } -}; - -static psobj *StdEncArrayP = NULL; -psobj *ISOLatin1EncArrayP = NULL; - -static psobj * -MakeEncodingArrayP(EncodingTable *encodingTable) -{ - int i; - psobj *encodingArrayP; - - encodingArrayP = (psobj *)vm_alloc(256*(sizeof(psobj))); - if (!encodingArrayP) - return NULL; - - /* initialize everything to .notdef */ - for (i=0; i<256;i++) - objFormatName(&(encodingArrayP[i]),7, ".notdef"); - - for (i=0; encodingTable[i].name; i++) - { - objFormatName(&(encodingArrayP[encodingTable[i].index]), - strlen(encodingTable[i].name), - encodingTable[i].name); - } - - return(encodingArrayP); -} - -boolean -Init_BuiltInEncoding(void) -{ - StdEncArrayP = MakeEncodingArrayP(StdEnc); - ISOLatin1EncArrayP = MakeEncodingArrayP(ISO8859Enc); - return (StdEncArrayP && ISOLatin1EncArrayP); -} - -/********************************************************************/ -/***================================================================***/ -static int -getNextValue(int valueType) -{ - scan_token(inputP); - if (tokenType != valueType) { - return(SCAN_ERROR); - } - return(SCAN_OK); - -} -/***================================================================***/ -/* This routine will set the global rc if there is an error */ -/***================================================================***/ -static int -getInt(void) -{ - scan_token(inputP); - if (tokenType != TOKEN_INTEGER) { - rc = SCAN_ERROR; - return(0); - } - else { - return( tokenValue.integer); - } - -} -/***================================================================***/ -/* - * See Sec 10.3 of ``Adobe Type 1 Font Format'' v1.1, - * for parsing Encoding. - */ -static int -getEncoding(psobj *arrayP) -{ - scan_token(inputP); - if ((tokenType == TOKEN_NAME && (tokenLength==16 || tokenLength==17))) - { - if((tokenLength==16) && (!strncmp(tokenStartP,"StandardEncoding",16))) - arrayP->data.valueP = (char *) StdEncArrayP; - else - arrayP->data.valueP = (char *) ISOLatin1EncArrayP; - arrayP->len = 256; - return(SCAN_OK); - } - else if ( (tokenType == TOKEN_LEFT_BRACE) || - (tokenType == TOKEN_LEFT_BRACKET) ) - { - /* Array of literal names */ - - psobj *objP; - int i; - - objP = (psobj *)vm_alloc(256*(sizeof(psobj))); - if (!(objP)) return(SCAN_OUT_OF_MEMORY); - - arrayP->data.valueP = (char *) objP; - arrayP->len = 256; - - for (i=0; i<256; i++, objP++) - { - scan_token(inputP); - - if (tokenType != TOKEN_LITERAL_NAME) - return(SCAN_ERROR); - - if (!(vm_alloc(tokenLength)) ) return(SCAN_OUT_OF_MEMORY); - objFormatName(objP,tokenLength,tokenStartP); - } - - scan_token(inputP); - if ( (tokenType == TOKEN_RIGHT_BRACE) || - (tokenType == TOKEN_RIGHT_BRACKET) ) - return(SCAN_OK); - } - else - { - /* Must be sequences of ``dup put" */ - - psobj *objP; - int i; - - objP = (psobj *)vm_alloc(256*(sizeof(psobj))); - if (!(objP)) return(SCAN_OUT_OF_MEMORY); - - arrayP->data.valueP = (char *) objP; - arrayP->len = 256; - - for (i=0; i<256; i++) - objFormatName(objP + i, 7, ".notdef"); - - while (TRUE) - { - scan_token(inputP); - - switch (tokenType) - { - case TOKEN_NAME: - if (tokenLength == 3) - { - if (strncmp(tokenStartP,"dup",3) == 0) - { - /* get */ - scan_token(inputP); - if (tokenType != TOKEN_INTEGER || - tokenValue.integer < 0 || - tokenValue.integer > 255) - return (SCAN_ERROR); - i = tokenValue.integer; - - /* get */ - scan_token(inputP); - if (tokenType != TOKEN_LITERAL_NAME) - return(SCAN_ERROR); - - if (!(vm_alloc(tokenLength)) ) - return(SCAN_OUT_OF_MEMORY); - objFormatName(objP + i,tokenLength,tokenStartP); - - /* get "put" */ - scan_token(inputP); - if (tokenType != TOKEN_NAME) - return(SCAN_ERROR); - } - else if (strncmp(tokenStartP,"def",3) == 0) - return (SCAN_OK); - } - break; - case TOKEN_EOF: - case TOKEN_NONE: - case TOKEN_INVALID: - return (SCAN_ERROR); - } - } - } - - return (SCAN_ERROR); -} -/***================================================================***/ -#if XFONT_CID -static int -getFDArray(psobj *arrayP) -{ - int rc; - - /* get the number of items in the FDArray */ - scan_token(inputP); - if (tokenType == TOKEN_INTEGER) { - /* an FD array must contain at least one element */ - if (tokenValue.integer <= 0) - return(SCAN_ERROR); - arrayP->len = tokenValue.integer; - } else - return(SCAN_ERROR); - - /* get the token "array" */ - scan_token(inputP); - if (tokenType != TOKEN_NAME || strncmp(tokenStartP, "array", 5) != 0) - return(SCAN_ERROR); - - /* format the array in memory, save pointer to the beginning */ - arrayP->data.valueP = tokenStartP; - - /* allocate FDArray */ - /* No integer overflow since arrayP->len is unsigned short */ - FDArrayP = (psfont *)vm_alloc(arrayP->len*(sizeof(psfont))); - if (!(FDArrayP)) return(SCAN_OUT_OF_MEMORY); - - /* get a specified number of font dictionaries */ - for (FDArrayIndex = 0; FDArrayIndex < arrayP->len; FDArrayIndex++) { - /* get "dup" */ - scan_token(inputP); - if (tokenType != TOKEN_NAME || strncmp(tokenStartP, "dup", 3) != 0) - return(SCAN_ERROR); - /* get an integer digit */ - scan_token(inputP); - if (tokenType != TOKEN_INTEGER) - return(SCAN_ERROR); - - /* read a CID version of a Type 1 font */ - if (!CIDType1fontfcnA(&rc)) - return(rc); - - /* get "put" */ - scan_token(inputP); - if (tokenType != TOKEN_NAME || strncmp(tokenStartP, "put", 3) != 0) - return(SCAN_ERROR); - } - return(SCAN_OK); -} -#endif - -static int -getArray(psobj *arrayP) -{ - int N; /* count the items in the array */ - psobj *objP; - - /* That is totally a kludge. If some stupid font file has - * /foo/foo # ftp://ftp.cdrom.com/pub/os2/fonts/future.zip - * we will treat it as /foo. - * H.J. */ - char tmp [1024]; - - strncpy (tmp, tokenStartP, sizeof (tmp)); - tmp [sizeof (tmp) - 1] = '\0'; - -restart: - scan_token(inputP); - switch (tokenType) - { - case TOKEN_LEFT_BRACE: - case TOKEN_LEFT_BRACKET: - break; - - case TOKEN_LITERAL_NAME: - tokenStartP[tokenLength] = '\0'; - if (strcmp (tokenStartP, tmp) == 0) - { - /* Ok, We see /foo/foo. Let's restart. */ - goto restart; - } - - default: - return(SCAN_ERROR); - } - /* format the array in memory, save pointer to the beginning */ - arrayP->data.valueP = tokenStartP; - /* loop, picking up next object, until right BRACE or BRACKET */ - N = 0; - do { - scan_token(inputP); - if ( (tokenType == TOKEN_RIGHT_BRACE) || - (tokenType == TOKEN_RIGHT_BRACKET) ) { - /* save then number of items in the array */ - arrayP->len = N; - return(SCAN_OK); - } - /* allocate the space for the object */ - objP = (psobj *)vm_alloc(sizeof(psobj)); - if (!(objP)) return(SCAN_OUT_OF_MEMORY); - - /* array is an array of numbers, (real or integer) */ - if (tokenType == TOKEN_REAL) { - objFormatReal(objP, tokenValue.real); - } - else - if (tokenType == TOKEN_INTEGER) { - objFormatInteger(objP, tokenValue.integer); - } - else return(SCAN_ERROR); - N++; - } while ( 1>0 ); - /* NOTREACHED*/ -} -/***================================================================***/ -static int -getName(char *nameP) -{ - do { - scan_token(inputP); - if (tokenType <= TOKEN_NONE) { - if (tokenTooLong) return(SCAN_OUT_OF_MEMORY); - return(SCAN_ERROR); - } - } while ((tokenType != TOKEN_NAME) || - (0 != strncmp(tokenStartP,nameP,strlen(nameP))) ); - /* found */ - return(SCAN_OK); -} -/***================================================================***/ -static int -getNbytes(int N) -{ - int I; - - - tokenStartP = vm_next_byte(); - tokenMaxP = tokenStartP + MIN(vm_free_bytes(), MAX_STRING_LEN); - if (N > vm_free_bytes()) { - return(SCAN_OUT_OF_MEMORY); - } - I = T1Read(tokenStartP,1,N,inputP->data.fileP); - if ( I != N ) return(SCAN_FILE_EOF); - return(SCAN_OK); -} - -/***================================================================***/ -/* getLiteralName(nameObjP) */ -/* scan for next literal. */ -/* if we encounter the name 'end' then terminate and say ok. */ -/* It means that the CharStrings does not have as many characters */ -/* as the dictionary said it would and that is ok. */ -/***================================================================***/ -static int -getLiteralName(psobj *nameObjP) -{ - do { - scan_token(inputP); - if (tokenType <= TOKEN_NONE) { - if (tokenTooLong) return(SCAN_OUT_OF_MEMORY); - return(SCAN_ERROR); - } - if (tokenType == TOKEN_NAME) { - if (0 == strncmp(tokenStartP,"end",3) ) { - return(SCAN_END); - } - } - } while (tokenType != TOKEN_LITERAL_NAME) ; - nameObjP->len = tokenLength; - /* allocate all the names in the CharStrings Structure */ - if (!(vm_alloc(tokenLength)) ) return(SCAN_OUT_OF_MEMORY); - nameObjP->data.valueP = tokenStartP; - /* found */ - return(SCAN_OK); -} - -/***================================================================***/ -/* - * BuildSubrs routine - */ -/***================================================================***/ - -static int -BuildSubrs(psfont *FontP) -{ - int N; /* number of values in Subrs */ - int I; /* index into Subrs */ - int i; /* loop thru Subrs */ - int J; /* length of Subrs entry */ - psobj *arrayP; - - /* next token should be a positive int */ - /* note: rc is set by getInt. */ - N = getInt(); - if (rc) return(rc); - if (N < 0 ) return(SCAN_ERROR); - /* if we already have a Subrs, then skip the second one */ - /* The second one is for hiresolution devices. */ - if (FontP->Subrs.data.arrayP != NULL) { - TwoSubrs = TRUE; - /* process all the Subrs, but do not update anything */ - /* can not just skip them because of the binary data */ - for (i=0;i INT_MAX / sizeof(psobj)) - return (SCAN_ERROR); - arrayP = (psobj *)vm_alloc(N*sizeof(psobj)); - if (!(arrayP) ) return(SCAN_OUT_OF_MEMORY); - FontP->Subrs.len = N; - FontP->Subrs.data.arrayP = arrayP; - /* get N values for Subrs */ - for (i=0;i INT_MAX / sizeof(psdict)) return(SCAN_ERROR); - /* save number of entries in the dictionary */ - - dictP = (psdict *)vm_alloc((N+1)*sizeof(psdict)); - if (!(dictP)) return(SCAN_OUT_OF_MEMORY); - FontP->CharStringsP = dictP; - dictP[0].key.len = N; - /* get N values for CharStrings */ - for (i=1;i<=N;i++) { - /* look for next literal name */ - rc = getLiteralName(&(dictP[i].key)); - if (rc) return(rc); - /* get 1 integer */ - J = getInt(); - if (rc) return(rc); /* if next token was not an Int */ - if (J<0) return (SCAN_ERROR); - dictP[i].value.len = J; - /* get the next token, it should be RD or -|, either is ok */ - rc = getNextValue(TOKEN_NAME); - if ( rc != SCAN_OK ) return(rc); - rc = getNbytes(J); - if (rc == SCAN_OK) { - dictP[i].value.data.valueP = tokenStartP; - if ( !(vm_alloc(J)) ) return(SCAN_OUT_OF_MEMORY); - } - else return(rc); - } - return(SCAN_OK); - -} -/***================================================================***/ -#if XFONT_CID -/***================================================================***/ -/* - * BuildCIDFontInfo Dictionary - */ -/***================================================================***/ -static int -BuildCIDFontInfo(cidfont *CIDfontP) -{ - psdict *dictP; - - /* allocate the private dictionary (max number of entries + 1) */ - dictP = (psdict *)vm_alloc(20*sizeof(psdict)); - if (!(dictP)) return(SCAN_OUT_OF_MEMORY); - - CIDfontP->CIDfontInfoP = dictP; - CIDfontP->CIDfontInfoP[0].key.len = 18; /* number of actual entries */ - objFormatName(&(dictP[CIDCOUNT].key),8,"CIDCount"); - objFormatInteger(&(dictP[CIDCOUNT].value),-1); - objFormatName(&(dictP[CIDFONTNAME].key),11,"CIDFontName"); - objFormatName(&(dictP[CIDFONTNAME].value),0,NULL); - objFormatName(&(dictP[CIDFONTTYPE].key),11,"CIDFontType"); - objFormatInteger(&(dictP[CIDFONTTYPE].value),-1); - objFormatName(&(dictP[CIDVERSION].key),14,"CIDFontVersion"); - objFormatInteger(&(dictP[CIDVERSION].value),-1); - objFormatName(&(dictP[CIDREGISTRY].key),8,"Registry"); - objFormatString(&(dictP[CIDREGISTRY].value),0,NULL); - objFormatName(&(dictP[CIDORDERING].key),8,"Ordering"); - objFormatString(&(dictP[CIDORDERING].value),0,NULL); - objFormatName(&(dictP[CIDSUPPLEMENT].key),10,"Supplement"); - objFormatInteger(&(dictP[CIDSUPPLEMENT].value),-1); - objFormatName(&(dictP[CIDMAPOFFSET].key),12,"CIDMapOffset"); - objFormatInteger(&(dictP[CIDMAPOFFSET].value),-1); - objFormatName(&(dictP[CIDFDARRAY].key),7,"FDArray"); - objFormatArray(&(dictP[CIDFDARRAY].value),0,NULL); - objFormatName(&(dictP[CIDFDBYTES].key),7,"FDBytes"); - objFormatInteger(&(dictP[CIDFDBYTES].value),-1); - objFormatName(&(dictP[CIDFONTBBOX].key),8,"FontBBox"); - objFormatArray(&(dictP[CIDFONTBBOX].value),0,NULL); - objFormatName(&(dictP[CIDFULLNAME].key),8,"FullName"); - objFormatString(&(dictP[CIDFULLNAME].value),0,NULL); - objFormatName(&(dictP[CIDFAMILYNAME].key),10,"FamilyName"); - objFormatString(&(dictP[CIDFAMILYNAME].value),0,NULL); - objFormatName(&(dictP[CIDWEIGHT].key),6,"Weight"); - objFormatString(&(dictP[CIDWEIGHT].value),0,NULL); - objFormatName(&(dictP[CIDNOTICE].key),6,"Notice"); - objFormatString(&(dictP[CIDNOTICE].value),0,NULL); - objFormatName(&(dictP[CIDGDBYTES].key),7,"GDBytes"); - objFormatInteger(&(dictP[CIDGDBYTES].value),-1); - objFormatName(&(dictP[CIDUIDBASE].key),7,"UIDBase"); - objFormatInteger(&(dictP[CIDUIDBASE].value),0); - objFormatName(&(dictP[CIDXUID].key),4,"XUID"); - objFormatInteger(&(dictP[CIDXUID].value),0); - return(SCAN_OK); -} -/***================================================================***/ -/* - * BuildCMapInfo Dictionary - */ -/***================================================================***/ -static int -BuildCMapInfo(cmapres *CMapP) -{ - psdict *dictP; - - /* allocate the private dictionary (max number of entries + 1) */ - dictP = (psdict *)vm_alloc(20*sizeof(psdict)); - if (!(dictP)) return(SCAN_OUT_OF_MEMORY); - - CMapP->CMapInfoP = dictP; - CMapP->CMapInfoP[0].key.len = 8; /* number of actual entries */ - objFormatName(&(dictP[CMAPREGISTRY].key),8,"Registry"); - objFormatString(&(dictP[CMAPREGISTRY].value),0,NULL); - objFormatName(&(dictP[CMAPORDERING].key),8,"Ordering"); - objFormatString(&(dictP[CMAPORDERING].value),0,NULL); - objFormatName(&(dictP[CMAPSUPPLEMENT].key),10,"Supplement"); - objFormatInteger(&(dictP[CMAPSUPPLEMENT].value),-1); - objFormatName(&(dictP[CMAPNAME].key),8,"CMapName"); - objFormatString(&(dictP[CMAPNAME].value),0,NULL); - objFormatName(&(dictP[CMAPVERSION].key),11,"CMapVersion"); - objFormatInteger(&(dictP[CMAPVERSION].value),-1); - objFormatName(&(dictP[CMAPTYPE].key),8,"CMapType"); - objFormatInteger(&(dictP[CMAPTYPE].value),-1); - objFormatName(&(dictP[CMAPWMODE].key),5,"WMode"); - objFormatInteger(&(dictP[CMAPWMODE].value),-1); - objFormatName(&(dictP[CMAPCIDCOUNT].key),8,"CIDCount"); - objFormatInteger(&(dictP[CMAPCIDCOUNT].value),-1); - return(SCAN_OK); -} -#endif - -/***================================================================***/ -/* - * BuildFontInfo Dictionary - */ -/***================================================================***/ -static int -BuildFontInfo(psfont *fontP) -{ - psdict *dictP; - - /* allocate the private dictionary */ - dictP = (psdict *)vm_alloc(20*sizeof(psdict)); - if (!(dictP)) return(SCAN_OUT_OF_MEMORY); - - fontP->fontInfoP = dictP; - fontP->fontInfoP[0].key.len = 17; /* number of actual entries */ - objFormatName(&(dictP[FONTNAME].key),8,"FontName"); - objFormatName(&(dictP[FONTNAME].value),0,NULL); - objFormatName(&(dictP[PAINTTYPE].key),9,"PaintType"); - objFormatInteger(&(dictP[PAINTTYPE].value),0); - objFormatName(&(dictP[FONTTYPENUM].key),8,"FontType"); - objFormatInteger(&(dictP[FONTTYPENUM].value),0); - objFormatName(&(dictP[FONTMATRIX].key),10,"FontMatrix"); - objFormatArray(&(dictP[FONTMATRIX].value),0,NULL); - objFormatName(&(dictP[FONTBBOX].key),8,"FontBBox"); - objFormatArray(&(dictP[FONTBBOX].value),0,NULL); - objFormatName(&(dictP[ENCODING].key),8,"Encoding"); - objFormatEncoding(&(dictP[ENCODING].value),0,NULL); - objFormatName(&(dictP[UNIQUEID].key),8,"UniqueID"); - objFormatInteger(&(dictP[UNIQUEID].value),0); - objFormatName(&(dictP[STROKEWIDTH].key),11,"StrokeWidth"); - objFormatReal(&(dictP[STROKEWIDTH].value),0.0); - objFormatName(&(dictP[VERSION].key),7,"version"); - objFormatString(&(dictP[VERSION].value),0,NULL); - objFormatName(&(dictP[NOTICE].key),6,"Notice"); - objFormatString(&(dictP[NOTICE].value),0,NULL); - objFormatName(&(dictP[FULLNAME].key),8,"FullName"); - objFormatString(&(dictP[FULLNAME].value),0,NULL); - objFormatName(&(dictP[FAMILYNAME].key),10,"FamilyName"); - objFormatString(&(dictP[FAMILYNAME].value),0,NULL); - objFormatName(&(dictP[WEIGHT].key),6,"Weight"); - objFormatString(&(dictP[WEIGHT].value),0,NULL); - objFormatName(&(dictP[ITALICANGLE].key),11,"ItalicAngle"); - objFormatReal(&(dictP[ITALICANGLE].value),0.0); - objFormatName(&(dictP[ISFIXEDPITCH].key),12,"isFixedPitch"); - objFormatBoolean(&(dictP[ISFIXEDPITCH].value),FALSE); - objFormatName(&(dictP[UNDERLINEPOSITION].key),17,"UnderlinePosition"); - objFormatReal(&(dictP[UNDERLINEPOSITION].value),0.0); - objFormatName(&(dictP[UNDERLINETHICKNESS].key),18,"UnderlineThickness"); - objFormatReal(&(dictP[UNDERLINETHICKNESS].value),0.0); - return(SCAN_OK); -} -#if XFONT_CID -/***================================================================***/ -/* - * BuildCIDType1Private Dictionary - */ -/***================================================================***/ -static int -BuildCIDType1Private(psfont *fontP) -{ - psdict *Private; - - /* allocate the private dictionary */ - Private = (psdict *)vm_alloc(21*sizeof(psdict)); - - if (!(Private)) return(SCAN_OUT_OF_MEMORY); - - fontP->Private = Private; - fontP->Private[0].key.len = 20; /* number of actual entries */ - - objFormatName(&(Private[CIDT1MINFEATURE].key),10,"MinFeature"); - objFormatArray(&(Private[CIDT1MINFEATURE].value),0,NULL); - objFormatName(&(Private[CIDT1LENIV].key),5,"lenIV"); - objFormatInteger(&(Private[CIDT1LENIV].value),DEFAULTLENIV); - objFormatName(&(Private[CIDT1LANGGROUP].key),13,"LanguageGroup"); - objFormatInteger(&(Private[CIDT1LANGGROUP].value),DEFAULTLANGUAGEGROUP); - objFormatName(&(Private[CIDT1BLUEVALUES].key),10,"BlueValues"); - objFormatArray(&(Private[CIDT1BLUEVALUES].value),0,NULL); - objFormatName(&(Private[CIDT1OTHERBLUES].key),10,"OtherBlues"); - objFormatArray(&(Private[CIDT1OTHERBLUES].value),0,NULL); - objFormatName(&(Private[CIDT1BLUESCALE].key),9,"BlueScale"); - objFormatReal(&(Private[CIDT1BLUESCALE].value),DEFAULTBLUESCALE); - objFormatName(&(Private[CIDT1BLUEFUZZ].key),8,"BlueFuzz"); - objFormatInteger(&(Private[CIDT1BLUEFUZZ].value),DEFAULTBLUEFUZZ); - objFormatName(&(Private[CIDT1BLUESHIFT].key),9,"BlueShift"); - objFormatInteger(&(Private[CIDT1BLUESHIFT].value),DEFAULTBLUESHIFT); - objFormatName(&(Private[CIDT1FAMBLUES].key),11,"FamilyBlues"); - objFormatArray(&(Private[CIDT1FAMBLUES].value),0,NULL); - objFormatName(&(Private[CIDT1FAMOTHERBLUES].key),16,"FamilyOtherBlues"); - objFormatArray(&(Private[CIDT1FAMOTHERBLUES].value),0,NULL); - objFormatName(&(Private[CIDT1STDHW].key),5,"StdHW"); - objFormatArray(&(Private[CIDT1STDHW].value),0,NULL); - objFormatName(&(Private[CIDT1STDVW].key),5,"StdVW"); - objFormatArray(&(Private[CIDT1STDVW].value),0,NULL); - objFormatName(&(Private[CIDT1STEMSNAPH].key),9,"StemSnapH"); - objFormatArray(&(Private[CIDT1STEMSNAPH].value),0,NULL); - objFormatName(&(Private[CIDT1STEMSNAPV].key),9,"StemSnapV"); - objFormatArray(&(Private[CIDT1STEMSNAPV].value),0,NULL); - /* skip password */ - objFormatName(&(Private[CIDT1SUBMAPOFF].key),13,"SubrMapOffset"); - objFormatInteger(&(Private[CIDT1SUBMAPOFF].value),0); - objFormatName(&(Private[CIDT1SDBYTES].key),7,"SDBytes"); - objFormatInteger(&(Private[CIDT1SDBYTES].value),0); - objFormatName(&(Private[CIDT1SUBRCNT].key),9,"SubrCount"); - objFormatInteger(&(Private[CIDT1SUBRCNT].value),0); - objFormatName(&(Private[CIDT1FORCEBOLD].key),9,"ForceBold"); - objFormatBoolean(&(Private[CIDT1FORCEBOLD].value),DEFAULTFORCEBOLD); - objFormatName(&(Private[CIDT1RNDSTEMUP].key),9,"RndStemUp"); - objFormatBoolean(&(Private[CIDT1RNDSTEMUP].value),DEFAULTRNDSTEMUP); - objFormatName(&(Private[CIDT1EXPFACTOR].key),15,"ExpansionFactor"); - objFormatReal(&(Private[CIDT1EXPFACTOR].value), - DEFAULTEXPANSIONFACTOR); - return(SCAN_OK); -} -#endif -/***================================================================***/ -/* - * BuildPrivate Dictionary - */ -/***================================================================***/ -static int -BuildPrivate(psfont *fontP) -{ - psdict *Private; - - /* allocate the private dictionary */ - Private = (psdict *)vm_alloc(20*sizeof(psdict)); - - if (!(Private)) return(SCAN_OUT_OF_MEMORY); - - fontP->Private = Private; - fontP->Private[0].key.len = 16; /* number of actual entries */ - - objFormatName(&(Private[BLUEVALUES].key),10,"BlueValues"); - objFormatArray(&(Private[BLUEVALUES].value),0,NULL); - objFormatName(&(Private[OTHERBLUES].key),10,"OtherBlues"); - objFormatArray(&(Private[OTHERBLUES].value),0,NULL); - objFormatName(&(Private[FAMILYBLUES].key),11,"FamilyBlues"); - objFormatArray(&(Private[FAMILYBLUES].value),0,NULL); - objFormatName(&(Private[FAMILYOTHERBLUES].key),16,"FamilyOtherBlues"); - objFormatArray(&(Private[FAMILYOTHERBLUES].value),0,NULL); - objFormatName(&(Private[BLUESCALE].key),9,"BlueScale"); - objFormatReal(&(Private[BLUESCALE].value),DEFAULTBLUESCALE); - objFormatName(&(Private[BLUESHIFT].key),9,"BlueShift"); - objFormatInteger(&(Private[BLUESHIFT].value),DEFAULTBLUESHIFT); - objFormatName(&(Private[BLUEFUZZ].key),8,"BlueFuzz"); - objFormatInteger(&(Private[BLUEFUZZ].value),DEFAULTBLUEFUZZ); - objFormatName(&(Private[STDHW].key),5,"StdHW"); - objFormatArray(&(Private[STDHW].value),0,NULL); - objFormatName(&(Private[STDVW].key),5,"StdVW"); - objFormatArray(&(Private[STDVW].value),0,NULL); - objFormatName(&(Private[STEMSNAPH].key),9,"StemSnapH"); - objFormatArray(&(Private[STEMSNAPH].value),0,NULL); - objFormatName(&(Private[STEMSNAPV].key),9,"StemSnapV"); - objFormatArray(&(Private[STEMSNAPV].value),0,NULL); - objFormatName(&(Private[FORCEBOLD].key),9,"ForceBold"); - objFormatBoolean(&(Private[FORCEBOLD].value),DEFAULTFORCEBOLD); - objFormatName(&(Private[LANGUAGEGROUP].key),13,"LanguageGroup"); - objFormatInteger(&(Private[LANGUAGEGROUP].value),DEFAULTLANGUAGEGROUP); - objFormatName(&(Private[LENIV].key),5,"lenIV"); - objFormatInteger(&(Private[LENIV].value),DEFAULTLENIV); - objFormatName(&(Private[RNDSTEMUP].key),9,"RndStemUp"); - objFormatBoolean(&(Private[RNDSTEMUP].value),DEFAULTRNDSTEMUP); - objFormatName(&(Private[EXPANSIONFACTOR].key),9,"ExpansionFactor"); - objFormatReal(&(Private[EXPANSIONFACTOR].value), - DEFAULTEXPANSIONFACTOR); - return(SCAN_OK); -} -/***================================================================***/ -/**********************************************************************/ -/* GetType1Blues(fontP) */ -/* */ -/* Routine to support font-level hints. */ -/* */ -/* Gets all the Blues information from the Private dictionary */ -/* for the font. */ -/* */ -/* */ -/**********************************************************************/ -static int -GetType1Blues(psfont *fontP) -{ - psdict *PrivateDictP; /* the Private dict relating to hints */ - struct blues_struct *blues; /* ptr for the blues struct we will allocate */ - int i; - psobj *HintEntryP; - - - - /* get the Private dictionary pointer */ - PrivateDictP = fontP->Private; - - /* allocate the memory for the blues structure */ - blues = (struct blues_struct *) vm_alloc(sizeof(struct blues_struct)); - - if (!blues) return(SCAN_OUT_OF_MEMORY); - - /* Make fontP's blues ptr point to this newly allocated structure. */ - fontP->BluesP = blues; - - /* fill in the BlueValues array */ - HintEntryP = &(PrivateDictP[BLUEVALUES].value); - /* check to see if the entry exists and if it's an array */ - if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 )) - blues->numBlueValues = 0; - else { - /* get the number of values in the array */ - if (HintEntryP->len > NUMBLUEVALUES) { - blues->numBlueValues = NUMBLUEVALUES; - } else - blues->numBlueValues = HintEntryP->len; - for (i = 0; i<= blues->numBlueValues-1; ++i) { - if (objPIsInteger(&HintEntryP->data.arrayP[i])) - blues->BlueValues[i] = - HintEntryP->data.arrayP[i].data.integer; - else if (objPIsReal(&HintEntryP->data.arrayP[i])) - blues->BlueValues[i] = - HintEntryP->data.arrayP[i].data.real; - else - blues->BlueValues[i] = 0; - } - } - - /* fill in the OtherBlues array */ - HintEntryP = &(PrivateDictP[OTHERBLUES].value); - /* check to see if the entry exists and if it's an array */ - if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 )) - blues->numOtherBlues = 0; - else { - /* get the number of values in the array */ - if (HintEntryP->len > NUMOTHERBLUES) { - blues->numOtherBlues = NUMOTHERBLUES; - } else - blues->numOtherBlues = HintEntryP->len; - for (i = 0; i<= blues->numOtherBlues-1; ++i) { - if (objPIsInteger(&HintEntryP->data.arrayP[i])) - blues->OtherBlues[i] = - HintEntryP->data.arrayP[i].data.integer; - else if (objPIsReal(&HintEntryP->data.arrayP[i])) - blues->OtherBlues[i] = - HintEntryP->data.arrayP[i].data.real; - else - blues->OtherBlues[i] = 0; - } - } - - /* fill in the FamilyBlues array */ - HintEntryP = &(PrivateDictP[FAMILYBLUES].value); - /* check to see if the entry exists and if it's an array */ - if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 )) - blues->numFamilyBlues = 0; - else { - /* get the number of values in the array */ - if (HintEntryP->len > NUMFAMILYBLUES) { - blues->numFamilyBlues = NUMFAMILYBLUES; - } else - blues->numFamilyBlues = HintEntryP->len; - for (i = 0; i<= blues->numFamilyBlues-1; ++i) { - if (objPIsInteger(&HintEntryP->data.arrayP[i])) - blues->FamilyBlues[i] = - HintEntryP->data.arrayP[i].data.integer; - else if (objPIsReal(&HintEntryP->data.arrayP[i])) - blues->FamilyBlues[i] = - HintEntryP->data.arrayP[i].data.real; - else - blues->FamilyBlues[i] = 0; - } - } - - /* fill in the FamilyOtherBlues array */ - HintEntryP = &(PrivateDictP[FAMILYOTHERBLUES].value); - /* check to see if the entry exists and if it's an array */ - if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 )) - blues->numFamilyOtherBlues = 0; - else { - /* get the number of values in the array */ - if (HintEntryP->len > NUMFAMILYOTHERBLUES) { - blues->numFamilyOtherBlues = NUMFAMILYOTHERBLUES; - } else - blues->numFamilyOtherBlues = HintEntryP->len; - for (i = 0; i<= blues->numFamilyOtherBlues-1; ++i) { - if (objPIsInteger(&HintEntryP->data.arrayP[i])) - blues->FamilyOtherBlues[i] = - HintEntryP->data.arrayP[i].data.integer; - else if (objPIsReal(&HintEntryP->data.arrayP[i])) - blues->FamilyOtherBlues[i] = - HintEntryP->data.arrayP[i].data.real; - else - blues->FamilyOtherBlues[i] = 0; - } - } - - /* fill in the StemSnapH array */ - HintEntryP = &(PrivateDictP[STEMSNAPH].value); - /* check to see if the entry exists and if it's an array */ - if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 )) - blues->numStemSnapH = 0; - else { - /* get the number of values in the array */ - if (HintEntryP->len > NUMSTEMSNAPH) { - blues->numStemSnapH = NUMSTEMSNAPH; - } else - blues->numStemSnapH = HintEntryP->len; - for (i = 0; i<= blues->numStemSnapH-1; ++i) { - if (objPIsInteger(&HintEntryP->data.arrayP[i])) - blues->StemSnapH[i] = - HintEntryP->data.arrayP[i].data.integer; - else if (objPIsReal(&HintEntryP->data.arrayP[i])) - blues->StemSnapH[i] = - HintEntryP->data.arrayP[i].data.real; - else - blues->StemSnapH[i] = 0; - } - } - - /* fill in the StemSnapV array */ - HintEntryP = &(PrivateDictP[STEMSNAPV].value); - /* check to see if the entry exists and if it's an array */ - if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 )) - blues->numStemSnapV = 0; - else { - /* get the number of values in the array */ - if (HintEntryP->len > NUMSTEMSNAPV) { - blues->numStemSnapV = NUMSTEMSNAPV; - } else - blues->numStemSnapV = HintEntryP->len; - for (i = 0; i<= blues->numStemSnapV-1; ++i) { - if (objPIsInteger(&HintEntryP->data.arrayP[i])) - blues->StemSnapV[i] = - HintEntryP->data.arrayP[i].data.integer; - else if (objPIsReal(&HintEntryP->data.arrayP[i])) - blues->StemSnapV[i] = - HintEntryP->data.arrayP[i].data.real; - else - blues->StemSnapV[i] = 0; - } - } - - /* fill in the StdVW array */ - HintEntryP = &(PrivateDictP[STDVW].value); - /* check to see if the entry exists and if it's an array */ - if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 )) - /* a value of zero signifies no entry */ - blues->StdVW = 0; - else { - if (HintEntryP->len > NUMSTDVW) { - } - if (objPIsInteger(&HintEntryP->data.arrayP[0])) - blues->StdVW = HintEntryP->data.arrayP[0].data.integer; - else if (objPIsReal(&HintEntryP->data.arrayP[0])) - blues->StdVW = HintEntryP->data.arrayP[0].data.real; - else - blues->StdVW = 0; - } - - /* fill in the StdHW array */ - HintEntryP = &(PrivateDictP[STDHW].value); - /* check to see if the entry exists and if it's an array */ - if ( !objPIsArray(HintEntryP) || (HintEntryP->len == 0 )) - /* a value of zero signifies no entry */ - blues->StdHW = 0; - else { - if (HintEntryP->len > NUMSTDHW) { - } - if (objPIsInteger(&HintEntryP->data.arrayP[0])) - blues->StdHW = HintEntryP->data.arrayP[0].data.integer; - else if (objPIsReal(&HintEntryP->data.arrayP[0])) - blues->StdHW = HintEntryP->data.arrayP[0].data.real; - else - blues->StdHW = 0; - } - - - /* get the ptr to the BlueScale entry */ - HintEntryP = &(PrivateDictP[BLUESCALE].value); - /* put the BlueScale in the blues structure */ - if (objPIsInteger(HintEntryP)) /* Must be integer! */ - blues->BlueScale = HintEntryP->data.integer; - else if (objPIsReal(HintEntryP)) /* Error? */ - blues->BlueScale = HintEntryP->data.real; - else - blues->BlueScale = DEFAULTBLUESCALE; - - /* get the ptr to the BlueShift entry */ - HintEntryP = &(PrivateDictP[BLUESHIFT].value); - if (objPIsInteger(HintEntryP)) /* Must be integer! */ - blues->BlueShift = HintEntryP->data.integer; - else if (objPIsReal(HintEntryP)) /* Error? */ - blues->BlueShift = HintEntryP->data.real; - else - blues->BlueShift = DEFAULTBLUESHIFT; - - /* get the ptr to the BlueFuzz entry */ - HintEntryP = &(PrivateDictP[BLUEFUZZ].value); - if (objPIsInteger(HintEntryP)) /* Must be integer! */ - blues->BlueFuzz = HintEntryP->data.integer; - else if (objPIsReal(HintEntryP)) /* Error? */ - blues->BlueFuzz = HintEntryP->data.real; - else - blues->BlueFuzz = DEFAULTBLUEFUZZ; - - /* get the ptr to the ForceBold entry */ - HintEntryP = &(PrivateDictP[FORCEBOLD].value); - if (objPIsBoolean(HintEntryP)) /* Must be integer! */ - blues->ForceBold = HintEntryP->data.boolean; - else - blues->ForceBold = DEFAULTFORCEBOLD; - - /* get the ptr to the LanguageGroup entry */ - HintEntryP = &(PrivateDictP[LANGUAGEGROUP].value); - if (objPIsInteger(HintEntryP)) /* Must be integer! */ - blues->LanguageGroup = HintEntryP->data.integer; - else - blues->LanguageGroup = DEFAULTLANGUAGEGROUP; - - /* get the ptr to the RndStemUp entry */ - HintEntryP = &(PrivateDictP[RNDSTEMUP].value); - if (objPIsBoolean(HintEntryP)) /* Must be integer! */ - blues->RndStemUp = HintEntryP->data.boolean; - else - blues->RndStemUp = DEFAULTRNDSTEMUP; - - /* get the ptr to the lenIV entry */ - HintEntryP = &(PrivateDictP[LENIV].value); - if (objPIsInteger(HintEntryP)) /* Must be integer! */ - blues->lenIV = HintEntryP->data.integer; - else - blues->lenIV = DEFAULTLENIV; - - /* get the ptr to the ExpansionFactor entry */ - HintEntryP = &(PrivateDictP[EXPANSIONFACTOR].value); - if (objPIsInteger(HintEntryP)) - blues->ExpansionFactor = HintEntryP->data.integer; - else if (objPIsReal(HintEntryP)) - blues->ExpansionFactor = HintEntryP->data.real; - else - blues->ExpansionFactor = DEFAULTEXPANSIONFACTOR; - return(SCAN_OK); -} -/**********************************************************************/ -/* GetType1CharString(fontP,code) */ -/* */ -/* Look up code in the standard encoding vector and return */ -/* the charstring associated with the character name. */ -/* */ -/* fontP is the psfont structure. */ -/* */ -/* Returns a psobj (string) */ -/**********************************************************************/ -psobj * -GetType1CharString(psfont *fontP, unsigned char code) -{ - int N; /* the 'Nth' entry in the CharStrings */ - psobj *charnameP; /* points to psobj that is name of character*/ - - psdict *CharStringsDictP; /* dictionary with char strings */ - psobj *theStringP; /* the definition for the code */ - - - - if (StdEncArrayP == NULL) { - return(NULL); - } - /* use the code to index into the standard encoding vector */ - charnameP = &(StdEncArrayP[code]); - - /* test if the encoding array points to a name */ - if (!(objPIsName(charnameP)) ) { - return(NULL); - } - - /* Now that we have the character name out of the standardencoding */ - /* get the character definition out of the current font */ - CharStringsDictP = fontP->CharStringsP; - - /* search the chars string for this charname as key */ - N = SearchDictName(CharStringsDictP,charnameP); - if (N<=0) { - return(NULL); - } - /* OK, the nth item is the psobj that is the string for this char */ - theStringP = &(CharStringsDictP[N].value); - - return(theStringP); -} - -/***================================================================***/ -/* - * FindDictValue - */ -/***================================================================***/ - -static int -FindDictValue(psdict *dictP) -{ - psobj LitName; - int N; - int V; - - /* we have just scanned a token and it is a literal name */ - /* need to check if that name is in Private dictionary */ - objFormatName(&LitName,tokenLength,tokenStartP); - /* is it in the dictP */ - N = SearchDictName(dictP,&LitName); - /* if found */ - if ( N > 0 ) { - /* what type */ - switch (dictP[N].value.type) { - case OBJ_ENCODING: - V = getEncoding(&(dictP[N].value)); - if ( V != SCAN_OK ) return(V); - break; - case OBJ_ARRAY: -#if XFONT_CID - if (0 == strncmp(tokenStartP,"FDArray",7)) - V = getFDArray(&(dictP[N].value)); - else - V = getArray(&(dictP[N].value)); -#else - V = getArray(&(dictP[N].value)); -#endif - if ( V != SCAN_OK ) return(V); - break; - case OBJ_INTEGER: - /* next value in integer */ - dictP[N].value.data.integer = getInt(); - if (rc) return(rc); /* if next token was not an Int */ - break; - case OBJ_REAL: - /* next value must be real or int, store as a real */ - scan_token(inputP); - if (tokenType == TOKEN_REAL) { - dictP[N].value.data.real = tokenValue.real; - } - else - if (tokenType == TOKEN_INTEGER) { - dictP[N].value.data.real = tokenValue.integer; - } - else return(SCAN_ERROR); - break; - case OBJ_NAME: - V = getNextValue(TOKEN_LITERAL_NAME); - if ( V != SCAN_OK ) return(V); - if (!(vm_alloc(tokenLength)) ) return(SCAN_OUT_OF_MEMORY); - objFormatName(&(dictP[N].value),tokenLength,tokenStartP); - break; - case OBJ_STRING: - V = getNextValue(TOKEN_STRING); - if ( V != SCAN_OK ) return(V); - if (!(vm_alloc(tokenLength)) ) return(SCAN_OUT_OF_MEMORY); - objFormatString(&(dictP[N].value),tokenLength,tokenStartP); - break; - case OBJ_BOOLEAN: - scan_token(inputP); - if (tokenType != TOKEN_NAME) { - return(SCAN_ERROR); - } - if (0 == strncmp(tokenStartP,"true",4) ) { - dictP[N].value.data.boolean =TRUE; - } - else - if (0 == strncmp(tokenStartP,"false",5) ) { - dictP[N].value.data.boolean =FALSE; - } - else return(SCAN_ERROR); - break; - - default: - return(SCAN_ERROR); - } - } - /* Name is not in dictionary. That is ok. */ - return(SCAN_OK); - -} -/***================================================================***/ - -#if XFONT_CID -/* - * ------------------------------------------------------------------- - * Scan the next token and convert it into an object - * Result is placed on the Operand Stack as next object - * ------------------------------------------------------------------- - */ -int -scan_cidfont(cidfont *CIDFontP, cmapres *CMapP) -{ - char filename[CID_PATH_MAX]; - char cmapfile[CID_PATH_MAX]; - char buf[CID_BUFSIZE]; - char filetype[3]; - FILE *fileP; - FILE *fileP1; - char *nameP; - int namelen; - int i, j; - int cread, rangecnt; - unsigned int char_row, char_col; - - filetype[0] = 'r'; - filetype[1] = 'b'; - filetype[2] = '\0'; - - /* copy the filename and remove leading or trailing blanks */ - /* point to name and search for leading blanks */ - nameP= CIDFontP->CIDFontFileName.data.nameP; - namelen = CIDFontP->CIDFontFileName.len; - while (nameP[0] == ' ') { - nameP++; - namelen--; - } - /* now remove any trailing blanks */ - while ((namelen>0) && ( nameP[namelen-1] == ' ')) { - namelen--; - } - strncpy(filename,nameP,namelen); - filename[namelen] = '\0'; - /* file name is now constructed */ - inputFile.data.fileP = NULL; - filterFile.data.fileP = NULL; - - /* check whether a CIDFont file */ - if ((fileP = fopen(filename,filetype))) { - cread = fread(buf, 1, CID_BUFSIZE, fileP); - fclose(fileP); - if (cread > 17) { - if (strncmp(buf, "%!", 2) || - strstr(buf, "Resource-CIDFont") == NULL) - return(SCAN_FILE_OPEN_ERROR); - } else - return(SCAN_FILE_OPEN_ERROR); - } else - return(SCAN_FILE_OPEN_ERROR); - - /* copy the CMap file name and remove leading or trailing blanks */ - /* point to name and search for leading blanks */ - nameP = CMapP->CMapFileName.data.nameP; - namelen = CMapP->CMapFileName.len; - while (nameP[0] == ' ') { - nameP++; - namelen--; - } - /* now remove any trailing blanks */ - while ((namelen>0) && ( nameP[namelen-1] == ' ')) { - namelen--; - } - strncpy(cmapfile,nameP,namelen); - cmapfile[namelen] = '\0'; - /* CMap file name is now constructed */ - inputFile1.data.fileP = NULL; - - /* check whether a CMap file */ - if ((fileP1 = fopen(cmapfile,filetype))) { - cread = fread(buf, 1, CID_BUFSIZE, fileP1); - fclose(fileP1); - if (cread > 17) { - if (strncmp(buf, "%!", 2) || - strstr(buf, "Resource-CMap") == NULL) - return(SCAN_FILE_OPEN_ERROR); - } else - return(SCAN_FILE_OPEN_ERROR); - } else - return(SCAN_FILE_OPEN_ERROR); - - /* read the specified CMap file */ - inputP = &inputFile1; - - if (!(fileP1 = fopen(cmapfile,filetype))) - return(SCAN_FILE_OPEN_ERROR); - - objFormatFile(inputP,fileP1); - - if ((rc = BuildCMapInfo(CMapP)) != 0) - return(rc); - - /* Assume everything will be OK */ - rc = 0; - rangecnt = 0; - - do { - /* Scan the next token */ - scan_token(inputP); - if (tokenType == TOKEN_INTEGER) - rangecnt = tokenValue.integer; - - if (rangecnt < 0 || rangecnt > INT_MAX / sizeof(spacerangecode)) { - rc = SCAN_ERROR; - break; - } - /* ==> tokenLength, tokenTooLong, tokenType, and */ - /* tokenValue are now set */ - - switch (tokenType) { - case TOKEN_EOF: - case TOKEN_NONE: - case TOKEN_INVALID: - /* in this case we are done */ - if (tokenTooLong) return(SCAN_OUT_OF_MEMORY); - rc = SCAN_ERROR; - break; - case TOKEN_LITERAL_NAME: - /* Look up the name */ - tokenStartP[tokenLength] = '\0'; - - rc = FindDictValue(CMapP->CMapInfoP); - /* we are not going to report errors except out of memory */ - if (rc != SCAN_OUT_OF_MEMORY) - rc = SCAN_OK; - break; - case TOKEN_NAME: - if (0 == strncmp(tokenStartP,"begincodespacerange",19)) { - CIDFontP->spacerangecnt++; - spacerangeP = (spacerange *)vm_alloc(sizeof(spacerange)); - if (!spacerangeP) { - rc = SCAN_OUT_OF_MEMORY; - break; - } - spacerangeP->next = NULL; - spacerangeP->rangecnt = rangecnt; - spacerangeP->spacecode = - (spacerangecode *)vm_alloc(rangecnt*sizeof(spacerangecode)); - if (!spacerangeP->spacecode) { - rc = SCAN_OUT_OF_MEMORY; - break; - } - for (i = 0; i < rangecnt; i++) { - scan_token(inputP); - if (tokenType != TOKEN_HEX_STRING) { - rc = SCAN_ERROR; - break; - } - spacerangeP->spacecode[i].srcCodeLo = 0; - for (j = 0; j < tokenLength; j++) - spacerangeP->spacecode[i].srcCodeLo += - (unsigned char)tokenStartP[j] << (8 * (tokenLength - 1 - j)); - - scan_token(inputP); - if (tokenType != TOKEN_HEX_STRING) { - rc = SCAN_ERROR; - break; - } - spacerangeP->spacecode[i].srcCodeHi = 0; - for (j = 0; j < tokenLength; j++) - spacerangeP->spacecode[i].srcCodeHi += - (unsigned char)tokenStartP[j] << (8 * (tokenLength - 1 - j)); - } - - if (CIDFontP->spacerangeP) { - if (CIDFontP->spacerangeP->next == NULL) - CIDFontP->spacerangeP->next = spacerangeP; - else { - spacerangeP->next = CIDFontP->spacerangeP->next; - CIDFontP->spacerangeP->next = spacerangeP; - } - } else - CIDFontP->spacerangeP = spacerangeP; - - /* read "endcodespacerange" */ - scan_token(inputP); - if (tokenType != TOKEN_NAME || (tokenType == TOKEN_NAME && - (strncmp(tokenStartP,"endcodespacerange",17) != 0))) { - rc = SCAN_ERROR; - break; - } - } - if (0 == strncmp(tokenStartP,"begincidrange",13)) { - CIDFontP->cidrangecnt++; - cidrangeP = (cidrange *)vm_alloc(sizeof(cidrange)); - if (!cidrangeP) { - rc = SCAN_OUT_OF_MEMORY; - break; - } - cidrangeP->next = NULL; - cidrangeP->rangecnt = rangecnt; - cidrangeP->range = - (cidrangecode *)vm_alloc(rangecnt*sizeof(cidrangecode)); - if (!cidrangeP->range) { - rc = SCAN_OUT_OF_MEMORY; - break; - } - for (i = 0; i < rangecnt; i++) { - scan_token(inputP); - if (tokenType != TOKEN_HEX_STRING) { - rc = SCAN_ERROR; - break; - } - cidrangeP->range[i].srcCodeLo = 0; - for (j = 0; j < tokenLength; j++) - cidrangeP->range[i].srcCodeLo += - (unsigned char)tokenStartP[j] << (8 * (tokenLength - 1 - j)); - char_row = (cidrangeP->range[i].srcCodeLo >> 8) & 0xff; - char_col = cidrangeP->range[i].srcCodeLo & 0xff; - if (char_row < CMapP->firstRow) - CMapP->firstRow = char_row; - if (char_row > CMapP->lastRow) - CMapP->lastRow = char_row; - if (char_col < CMapP->firstCol) - CMapP->firstCol = char_col; - if (char_col > CMapP->lastCol) - CMapP->lastCol = char_col; - scan_token(inputP); - if (tokenType != TOKEN_HEX_STRING) { - rc = SCAN_ERROR; - break; - } - cidrangeP->range[i].srcCodeHi = 0; - for (j = 0; j < tokenLength; j++) - cidrangeP->range[i].srcCodeHi += - (unsigned char)tokenStartP[j] << (8 * (tokenLength - 1 - j)); - char_row = (cidrangeP->range[i].srcCodeHi >> 8) & 0xff; - char_col = cidrangeP->range[i].srcCodeHi & 0xff; - if (char_row < CMapP->firstRow) - CMapP->firstRow = char_row; - if (char_row > CMapP->lastRow) - CMapP->lastRow = char_row; - if (char_col < CMapP->firstCol) - CMapP->firstCol = char_col; - if (char_col > CMapP->lastCol) - CMapP->lastCol = char_col; - scan_token(inputP); - if (tokenType != TOKEN_INTEGER) { - rc = SCAN_ERROR; - break; - } - cidrangeP->range[i].dstCIDLo = tokenValue.integer; - } - - if (CIDFontP->cidrangeP) { - if (CIDFontP->cidrangeP->next == NULL) - CIDFontP->cidrangeP->next = cidrangeP; - else { - cidrangeP->next = CIDFontP->cidrangeP->next; - CIDFontP->cidrangeP->next = cidrangeP; - } - } else - CIDFontP->cidrangeP = cidrangeP; - - /* read "endcidrange" */ - scan_token(inputP); - if (tokenType != TOKEN_NAME || (tokenType == TOKEN_NAME && - (strncmp(tokenStartP,"endcidrange",11) != 0))) { - rc = SCAN_ERROR; - break; - } - } - - if (0 == strncmp(tokenStartP,"beginnotdefrange",16)) { - CIDFontP->notdefrangecnt++; - notdefrangeP = (cidrange *)vm_alloc(sizeof(cidrange)); - if (!notdefrangeP) { - rc = SCAN_OUT_OF_MEMORY; - break; - } - notdefrangeP->next = 0; - notdefrangeP->rangecnt = rangecnt; - notdefrangeP->range = - (cidrangecode *)vm_alloc(rangecnt*sizeof(cidrangecode)); - if (!notdefrangeP->range) { - rc = SCAN_OUT_OF_MEMORY; - break; - } - for (i = 0; i < rangecnt; i++) { - scan_token(inputP); - if (tokenType != TOKEN_HEX_STRING) { - rc = SCAN_ERROR; - break; - } - notdefrangeP->range[i].srcCodeLo = 0; - for (j = 0; j < tokenLength; j++) - notdefrangeP->range[i].srcCodeLo = (int)(tokenStartP[j] << - (8 * (tokenLength - 1 - j))); - scan_token(inputP); - if (tokenType != TOKEN_HEX_STRING) { - rc = SCAN_ERROR; - break; - } - notdefrangeP->range[i].srcCodeHi = 0; - for (j = 0; j < tokenLength; j++) - notdefrangeP->range[i].srcCodeHi = (int)(tokenStartP[j] << - (8 * (tokenLength - 1 - j))); - scan_token(inputP); - if (tokenType != TOKEN_INTEGER) { - rc = SCAN_ERROR; - break; - } - notdefrangeP->range[i].dstCIDLo = tokenValue.integer; - } - if (CIDFontP->notdefrangeP) { - if (CIDFontP->notdefrangeP->next == NULL) - CIDFontP->notdefrangeP->next = notdefrangeP; - else { - notdefrangeP->next = CIDFontP->notdefrangeP->next; - CIDFontP->notdefrangeP->next = notdefrangeP; - } - } else - CIDFontP->notdefrangeP = notdefrangeP; - - /* read "endnotdefrange" */ - scan_token(inputP); - if (tokenType != TOKEN_NAME || (tokenType == TOKEN_NAME && - (strncmp(tokenStartP,"endnotdefrange",14) != 0))) { - rc = SCAN_ERROR; - break; - } - } - - if (0 == strncmp(tokenStartP,"endcmap",7)) { - if (CMapP->CMapInfoP[CMAPREGISTRY].value.data.valueP == NULL || - CMapP->CMapInfoP[CMAPORDERING].value.data.valueP == NULL || - CMapP->CMapInfoP[CMAPSUPPLEMENT].value.data.integer == -1) { - rc = SCAN_ERROR; - break; - } else { - rc = SCAN_FILE_EOF; - break; - } - } - break; - } - } - while (rc == 0); - fclose(inputP->data.fileP); - if (tokenTooLong) - rc = SCAN_OUT_OF_MEMORY; - if (rc == SCAN_OUT_OF_MEMORY) return(rc); - - /* open the specified CIDFont file */ - if (!(fileP = fopen(filename,filetype))) - return(SCAN_FILE_OPEN_ERROR); - - inputP = &inputFile; - objFormatFile(inputP,fileP); - CIDWantFontInfo = TRUE; - TwoSubrs = FALSE; - rc = BuildCIDFontInfo(CIDFontP); - if (rc != 0) return(rc); - - /* Assume everything will be OK */ - rc = 0; - - /* Loop until complete font is read */ - do { - /* Scan the next token */ - scan_token(inputP); - - /* ==> tokenLength, tokenTooLong, tokenType, and tokenValue are */ - /* now set */ - - switch (tokenType) { - case TOKEN_EOF: - case TOKEN_NONE: - case TOKEN_INVALID: - /* in this case we are done */ - if (tokenTooLong) return(SCAN_OUT_OF_MEMORY); - rc = SCAN_ERROR; - break; - case TOKEN_LITERAL_NAME: - /* Look up the name */ - tokenStartP[tokenLength] = '\0'; - - if (CIDWantFontInfo) { - rc = FindDictValue(CIDFontP->CIDfontInfoP); - /* we are not going to report errors except out of memory */ - if (rc != SCAN_OUT_OF_MEMORY) - rc = SCAN_OK; - break; - } - break; - case TOKEN_STRING: - tokenStartP[tokenLength] = '\0'; - if (0 == strncmp(tokenStartP,"Binary",6)) { - CIDFontP->binarydata = 1; - scan_token(inputP); - if (tokenType == TOKEN_INTEGER) - CIDFontP->bytecnt = tokenValue.integer; - else { - rc = SCAN_ERROR; - break; - } - } else if (0 == strncmp(tokenStartP,"Hex",3)) { - /* not yet supported */ - rc = SCAN_ERROR; - break; -#if 0 - /* uncomment when the hex format is supported */ - CIDFontP->binarydata = 0; - scan_token(inputP); - if (tokenType == TOKEN_INTEGER) - CIDFontP->bytecnt = tokenValue.integer; - else { - rc = SCAN_ERROR; - break; - } -#endif - } - break; - case TOKEN_NAME: - /* end of PostScript and beginning of data */ - if (0 == strncmp(tokenStartP,"StartData",9)) { - /* every CIDFont must have an FDArray */ - /* check whether other required dictionary entries were found */ - if (CIDFontP->CIDfontInfoP[CIDFDARRAY].value.data.arrayP == NULL || - CIDFontP->CIDfontInfoP[CIDFONTNAME].value.data.nameP == NULL || - CIDFontP->CIDfontInfoP[CIDFONTTYPE].value.data.integer == -1 || - CIDFontP->CIDfontInfoP[CIDVERSION].value.data.integer == -1 || - CIDFontP->CIDfontInfoP[CIDREGISTRY].value.data.valueP == NULL || - CIDFontP->CIDfontInfoP[CIDORDERING].value.data.valueP == NULL || - CIDFontP->CIDfontInfoP[CIDSUPPLEMENT].value.data.integer == -1 || - CIDFontP->CIDfontInfoP[CIDFONTBBOX].value.data.arrayP == NULL || - CIDFontP->CIDfontInfoP[CIDMAPOFFSET].value.data.integer == -1 || - CIDFontP->CIDfontInfoP[CIDFDBYTES].value.data.integer == -1 || - CIDFontP->CIDfontInfoP[CIDGDBYTES].value.data.integer == -1 || - CIDFontP->CIDfontInfoP[CIDCOUNT].value.data.integer == -1) { - rc = SCAN_ERROR; - break; - } else { - /* do Registry and Ordering entries match? */ - if (strcmp(CIDFontP->CIDfontInfoP[CIDREGISTRY].value.data.valueP, - CMapP->CMapInfoP[CMAPREGISTRY].value.data.valueP) != 0 || - strcmp(CIDFontP->CIDfontInfoP[CIDORDERING].value.data.valueP, - CMapP->CMapInfoP[CMAPORDERING].value.data.valueP) != 0) { - rc = SCAN_ERROR; - break; - } else { - fclose(inputP->data.fileP); - return(SCAN_OK); - } - } - } - break; - } - - } - while (rc ==0); - fclose(inputP->data.fileP); - if (tokenTooLong) return(SCAN_OUT_OF_MEMORY); - return(rc); -} - -/* - * ------------------------------------------------------------------- - * Scan the next token and convert it into an object - * Result is placed on the Operand Stack as next object - * ------------------------------------------------------------------- - */ -int -scan_cidtype1font(psfont *FontP) -{ - int i; - int begincnt = 0; /* counter for the number of unpaired begin operators */ - int currentfilefound = 0; - - WantFontInfo = TRUE; - InPrivateDict = FALSE; - TwoSubrs = FALSE; - rc = BuildFontInfo(FontP); - if (rc != 0) return(rc); - - /* Assume everything will be OK */ - rc = 0; - filterFile.data.fileP = NULL; - - /* Loop until complete font is read */ - do { - /* Scan the next token */ - scan_token(inputP); - - /* ==> tokenLength, tokenTooLong, tokenType, and tokenValue are */ - /* now set */ - - switch (tokenType) { - case TOKEN_EOF: - case TOKEN_NONE: - case TOKEN_INVALID: - /* in this case we are done */ - if (tokenTooLong) return(SCAN_OUT_OF_MEMORY); - rc = SCAN_ERROR; - break; - case TOKEN_LITERAL_NAME: - /* Look up the name */ - tokenStartP[tokenLength] = '\0'; - if (InPrivateDict ) { - rc = FindDictValue(FontP->Private); - /* we are not going to report errors */ - /* Sometimes the font file may test a value such as */ - /* testing to see if the font is alreadly loaded with */ - /* same UniqueID. We would faile on /UniqueID get */ - /* because we are expecting a int to follow UniqueID*/ - /* If the correct object type does not follow a Name*/ - /* then we will skip over it without reporting error except */ - /* out of memory */ - if (rc != SCAN_OUT_OF_MEMORY) - rc = SCAN_OK; - break; - } /* end of reading Private dictionary */ - else - if (0 == strncmp(tokenStartP,"Private",7) ) { - InPrivateDict = TRUE; - rc = BuildCIDType1Private(FontP); - break; - } - else - if (WantFontInfo) { - rc = FindDictValue(FontP->fontInfoP); - /* we are not going to report errors except out of memory */ - if (rc != SCAN_OUT_OF_MEMORY) - rc = SCAN_OK; - break; - } - break; - case TOKEN_NAME: - if (0 == strncmp(tokenStartP,"currentfile",11)) { - currentfilefound = 1; - break; - } else if (0 == strncmp(tokenStartP,"eexec",5)) { - if (currentfilefound == 1) { - currentfilefound = 0; - filterFile.data.fileP = CIDeexec(inputP->data.fileP); - if (filterFile.data.fileP == NULL) { - fclose(inputFile.data.fileP); - return(SCAN_FILE_OPEN_ERROR); - } - inputP = &filterFile; - } else { - rc = SCAN_ERROR; - break; - } - } else if (0 == strncmp(tokenStartP,"begin",5)) { - begincnt++; - currentfilefound = 0; - } else if (0 == strncmp(tokenStartP,"end",3)) { - currentfilefound = 0; - begincnt--; - if (begincnt == 0) { - if (filterFile.data.fileP != NULL) { - scan_token(inputP); /* get 'currentfile' */ - scan_token(inputP); /* get 'closefile' */ - inputP = &inputFile; - resetDecrypt(); - inputP->data.fileP->b_cnt = - F_BUFSIZ - (inputP->data.fileP->b_ptr - - inputP->data.fileP->b_base); - if (inputP->data.fileP->b_cnt > 0) { - for (i = 0; i < inputP->data.fileP->b_cnt; i++) - if (*(inputP->data.fileP->b_ptr + i) == '%') - break; - if (i < inputP->data.fileP->b_cnt) { - inputP->data.fileP->b_cnt -= i; - inputP->data.fileP->b_ptr += i; - } else - inputP->data.fileP->b_cnt = 0; - } - } - rc = SCAN_OK; - return(rc); - } - if (begincnt < 0) { - rc = SCAN_ERROR; - break; - } - } - break; - } - - } - while (rc == 0); - if (tokenTooLong) return(SCAN_OUT_OF_MEMORY); - return(rc); -} -#endif - -/* - * ------------------------------------------------------------------- - * Scan the next token and convert it into an object - * Result is placed on the Operand Stack as next object - * ------------------------------------------------------------------- - */ -int -scan_font(psfont *FontP) -{ - - - char filename[128]; - char filetype[3]; - FILE *fileP; - char *nameP; - int namelen; - int V; - int i; - boolean starthex80; - - starthex80 = FALSE; - filetype[0] = 'r'; - filetype[1] = 'b'; - filetype[2] = '\0'; - /* copy the filename and remove leading or trailing blanks */ - /* point to name and search for leading blanks */ - nameP= FontP->FontFileName.data.nameP; - namelen = FontP->FontFileName.len; - while (nameP[0] == ' ') { - nameP++; - namelen--; - } - /* now remove any trailing blanks */ - while ((namelen>0) && ( nameP[namelen-1] == ' ')) { - namelen--; - } - strncpy(filename,nameP,namelen); - filename[namelen] = '\0'; - /* file name is now constructed */ - inputFile.data.fileP = NULL; - filterFile.data.fileP = NULL; - - inputP = &inputFile; - if ((fileP = T1Open(filename,filetype))) { - /* get the first byte of file */ - V = _XT1getc(fileP); - /* if file starts with x'80' then skip next 5 bytes */ - if ( V == 0X80 ) { - for (i=0;i<5;i++) V = _XT1getc(fileP); - starthex80 = TRUE; - } - else T1Ungetc(V,fileP); - objFormatFile(inputP,fileP); - } - else { - return(SCAN_FILE_OPEN_ERROR); - }; - - WantFontInfo = TRUE; - InPrivateDict = FALSE; - TwoSubrs = FALSE; - rc = BuildFontInfo(FontP); - if (rc != 0) return(rc); - - /* Assume everything will be OK */ - rc = 0; - - /* Loop until complete font is read */ - do { - /* Scan the next token */ - scan_token(inputP); - - /* ==> tokenLength, tokenTooLong, tokenType, and tokenValue are */ - /* now set */ - - switch (tokenType) { - case TOKEN_EOF: - case TOKEN_NONE: - case TOKEN_INVALID: - /* in this case we are done */ - if (tokenTooLong) return(SCAN_OUT_OF_MEMORY); - rc = SCAN_ERROR; - break; - case TOKEN_LITERAL_NAME: - /* Look up the name */ - tokenStartP[tokenLength] = '\0'; - if (InPrivateDict ) { - if (0== strncmp(tokenStartP,"Subrs",5) ) { - rc = BuildSubrs(FontP); - break; - } - if (0== strncmp(tokenStartP,"CharStrings",11) ) { - rc = BuildCharStrings(FontP); - if ( (rc == SCAN_OK) ||(rc == SCAN_END) ) { - T1Close(inputP->data.fileP); - /* Build the Blues Structure */ - rc = GetType1Blues(FontP); - /* whatever the return code, return it */ - /* all the work is done. This is the normal exit.*/ - return(rc); - } - break; - } - rc = FindDictValue(FontP->Private); - /* we are not going to report errors */ - /* Sometimes the font file may test a value such as */ - /* testing to see if the font is alreadly loaded with */ - /* same UniqueID. We would faile on /UniqueID get */ - /* because we are expecting a int to follow UniqueID*/ - /* If the correct object type does not follow a Name*/ - /* then we will skip over it without reporting error except */ - /* when out of memory */ - if (rc != SCAN_OUT_OF_MEMORY) - rc = SCAN_OK; - break; - } /* end of reading Private dictionary */ - else - if (0== strncmp(tokenStartP,"Private",7) ) { - InPrivateDict = TRUE; - rc = BuildPrivate(FontP); - break; - } - else - if (WantFontInfo) { - rc = FindDictValue(FontP->fontInfoP); - /* we are not going to report errors except out of memory */ - if (rc != SCAN_OUT_OF_MEMORY) - rc = SCAN_OK; - break; - } - break; - case TOKEN_NAME: - if (0 == strncmp(tokenStartP,"eexec",5) ) { - /* if file started with x'80', check next 5 bytes */ - if (starthex80) { - V = _XT1getc(fileP); - if ( V == 0X80 ) { - for (i=0;i<5;i++) V = _XT1getc(fileP); - } - else T1Ungetc(V,fileP); - } - filterFile.data.fileP = T1eexec(inputP->data.fileP); - if (filterFile.data.fileP == NULL) { - T1Close(inputFile.data.fileP); - return(SCAN_FILE_OPEN_ERROR); - } - inputP = &filterFile; - - WantFontInfo = FALSE; - } - break; - } - - } - while (rc ==0); - T1Close(inputP->data.fileP); - if (tokenTooLong) return(SCAN_OUT_OF_MEMORY); - return(rc); -} - diff --git a/nx-X11/lib/font/Type1/spaces.c b/nx-X11/lib/font/Type1/spaces.c deleted file mode 100644 index 55cc96f67..000000000 --- a/nx-X11/lib/font/Type1/spaces.c +++ /dev/null @@ -1,998 +0,0 @@ -/* $Xorg: spaces.c,v 1.4 2000/08/17 19:46:32 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/spaces.c,v 3.10tsi Exp $ */ - /* SPACES CWEB V0021 ******** */ -/* -:h1 id=spaces.SPACES Module - Handles Coordinate Spaces - -This module is responsible for handling the TYPE1IMAGER "XYspace" object. - -&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) - - -:h3.Include Files -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef FONTMODULE -#include "Xdefs.h" /* Bool declaration ??? */ -#include "Xmd.h" /* INT32 declaration ??? */ -#include "os.h" -#include "xf86_ansic.h" -#else -#include "X11/Xos.h" -#include -#endif -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "pictures.h" -#include "fonts.h" -#include "arith.h" -#include "trig.h" - -static void FindFfcn ( double cx, double cy, - convertFunc *fcnP ); -static void FindIfcn ( double cx, double cy, - fractpel *icxP, fractpel *icyP, - iconvertFunc *fcnP ); - -/* -:h3.Entry Points Provided to the TYPE1IMAGER User -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h3.Entry Points Provided to Other Modules -*/ - -/* -In addition, other modules call the SPACES module through function -vectors in the "XYspace" structure. The entry points accessed that -way are "FConvert()", "IConvert()", and "ForceFloat()". -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h3.Macros and Typedefs Provided to Other Modules - -:h4.Duplicating and Killing Spaces - -Destroying XYspaces is so simple we can do it with a -macro: -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -On the other hand, duplicating XYspaces is slightly more difficult -because of the need to keep a unique ID in the space, see -:hdref refid=dupspace.. - -:h4.Fixed Point Pel Representation - -We represent pel positions with fixed point numbers. This does NOT -mean integer, but truly means fixed point, with a certain number -of binary digits (FRACTBITS) representing the fractional part of the -pel. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -/* -:h2.Data Structures for Coordinate Spaces and Points -*/ -/* -:h3 id=matrix.Matrices - -TYPE1IMAGER uses 2x2 transformation matrices. We'll use C notation for -such a matrix (M[2][2]), the first index being rows, the second columns. -*/ - -/* -:h3.The "doublematrix" Structure - -We frequently find it desirable to store both a matrix and its -inverse. We store these in a "doublematrix" structure. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h3.The "XYspace" Structure - -The XYspace structure represents the XYspace object. -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ -#define RESERVED 10 /* 'n' IDs are reserved for invalid & immortal spaces */ -/* -*/ -#define NEXTID ((SpaceID < RESERVED) ? (SpaceID = RESERVED) : ++SpaceID) - -static unsigned int SpaceID = 1; - -struct XYspace * -CopySpace(struct XYspace *S) -{ - S = (struct XYspace *)Allocate(sizeof(struct XYspace), S, 0); - S->ID = NEXTID; - return(S); -} -/* -:h3.The "fractpoint" Structure - -A fractional point is just a "fractpel" x and y: -*/ - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h3.Lazy Evaluation of Matrix Inverses - -Calculating the inverse of a matrix is somewhat involved, and we usually -do not need them. So, we flag whether or not the space has the inverse -already calculated: -*/ - -#define HASINVERSE(flag) ((flag)&0x80) - -/* -The following macro forces a space to have an inverse: -*/ - -#define CoerceInverse(S) if (!HASINVERSE((S)->flag)) { \ - MatrixInvert((S)->tofract.normal, (S)->tofract.inverse); (S)->flag |= HASINVERSE(ON); } -/* -:h3.IDENTITY Space - -IDENTITY space is (logically) the space corresponding to the identity -transformation matrix. However, since all our transformation matrices -have a common FRACTFLOAT scale factor to convert to 'fractpel's, that -is actually what we store in 'tofract' matrix of IDENTITY: -*/ - -static struct XYspace identity = { SPACETYPE, ISPERMANENT(ON) + ISIMMORTAL(ON) - + HASINVERSE(ON), 2, /* added 3-26-91 PNM */ - NULL, NULL, - NULL, NULL, NULL, NULL, - INVALIDID + 1, 0, - {{{FRACTFLOAT, 0.0}, {0.0, FRACTFLOAT}}, - {{1.0/FRACTFLOAT, 0.0}, {0.0, 1.0/FRACTFLOAT}}}, - {{0, 0}, {0, 0}}}; -struct XYspace *IDENTITY = &identity; - -/* -*/ -#define MAXCONTEXTS 16 - -static struct doublematrix contexts[MAXCONTEXTS]; - -#ifdef notdef - -static int nextcontext = 1; - -/*SHARED LINE(S) ORIGINATED HERE*/ - -/* -:h3.FindDeviceContext() - Find the Context Given a Device - -This routine, given a device, returns the index of the device's -transformation matrix in the context array. If it cannot find it, -it will allocate a new array entry and fill it out. -*/ - -static int -FindDeviceContext(pointer device) /* device token */ -{ - double M[2][2]; /* temporary matrix */ - float Xres,Yres; /* device resolution */ - int orient = -1; /* device orientation */ - int rc = -1; /* return code for QueryDeviceState */ - - if (rc != 0) /* we only bother with this check once */ - Abort("Context: QueryDeviceState didn't work"); - - M[0][0] = M[1][0] = M[0][1] = M[1][1] = 0.0; - - switch (orient) { - case 0: - M[0][0] = Xres; M[1][1] = -Yres; - break; - case 1: - M[1][0] = Yres; M[0][1] = Xres; - break; - case 2: - M[0][0] = -Xres; M[1][1] = Yres; - break; - case 3: - M[1][0] = -Yres; M[0][1] = -Xres; - break; - default: - Abort("QueryDeviceState returned invalid orientation"); - } - return(FindContext(M)); -} - -/* -:h3.FindContext() - Find the Context Given a Matrix - -This routine, given a matrix, returns the index of that matrix matrix in -the context array. If it cannot find it, it will allocate a new array -entry and fill it out. -*/ - -int -FindContext(double M[2][2]) /* array to search for */ -{ - register int i; /* loop variable for search */ - for (i=0; i < nextcontext; i++) - if (M[0][0] == contexts[i].normal[0][0] && M[1][0] == contexts[i].normal[1][0] - && M[0][1] == contexts[i].normal[0][1] && M[1][1] == contexts[i].normal[1][1]) - break; - - if (i >= nextcontext) { - if (i >= MAXCONTEXTS) - Abort("Context: out of them"); - LONGCOPY(contexts[i].normal, M, sizeof(contexts[i].normal)); - MatrixInvert(M, contexts[i].inverse); - nextcontext++; - } - - return(i); -} - -/* -:h3.Context() - Create a Coordinate Space for a Device - -This user operator is implemented by first finding the device context -array index, then transforming IDENTITY space to create an appropriate -cooridnate space. -*/ - -struct XYspace * -Context(pointer device, /* device token */ - double units) /* multiples of one inch */ -{ - double M[2][2]; /* device transformation matrix */ - register int n; /* will hold device context number */ - register struct XYspace *S; /* XYspace constructed */ - - ARGCHECK((device == NULL), "Context of NULLDEVICE not allowed", - NULL, IDENTITY, (0), struct XYspace *); - ARGCHECK((units == 0.0), "Context: bad units", NULL, IDENTITY, (0), struct XYspace *); - - n = FindDeviceContext(device); - - LONGCOPY(M, contexts[n].normal, sizeof(M)); - - M[0][0] *= units; - M[0][1] *= units; - M[1][0] *= units; - M[1][1] *= units; - - S = (struct XYspace *)Xform(IDENTITY, M); - - S->context = n; - return(S); -} -#endif - -/* -:h3.ConsiderContext() - Adjust a Matrix to Take Out Device Transform - -Remember, we have :f/x times U times D/ and :f/M/ and and we want :f/x -times U times M times D/. An easy way to do this is to calculate -:f/D sup <-1> times M times D/, because: -:formula. -x times U times D times D sup <-1> times M times D = x times U times M times D -:formula. -So this subroutine, given an :f/M/and an object, finds the :f/D/ for that -object and modifies :f/M/ so it is :f/D sup <-1> times M times D/. -*/ - -static void -ConsiderContext(struct xobject *obj, /* object to be transformed */ - double M[2][2]) /* matrix (may be changed) */ -{ - register int context = 0; /* index in contexts array */ - - if (obj == NULL) return; - - if (ISPATHTYPE(obj->type)) { - struct segment *path = (struct segment *) obj; - - context = path->context; - } - else if (obj->type == SPACETYPE) { - struct XYspace *S = (struct XYspace *) obj; - - context = S->context; - } - else if (obj->type == PICTURETYPE) { - - } - else - context = NULLCONTEXT; - - if (context != NULLCONTEXT) { - MatrixMultiply(contexts[context].inverse, M, M); - MatrixMultiply(M, contexts[context].normal, M); - } -} - -/* -:h2.Conversion from User's X,Y to "fractpel" X,Y - -When the user is building paths (lines, moves, curves, etc.) he passes -the control points (x,y) for the paths together with an XYspace. We -must convert from the user's (x,y) to our internal representation -which is in pels (fractpels, actually). This involves transforming -the user's (x,y) under the coordinate space transformation. It is -important that we do this quickly. So, we store pointers to different -conversion functions right in the XYspace structure. This allows us -to have simpler special case functions for the more commonly -encountered types of transformations. - -:h3.Convert(), IConvert(), and ForceFloat() - Called Through "XYspace" Structure - -These are functions that fit in the "convert" and "iconvert" function -pointers in the XYspace structure. They call the "xconvert", "yconvert", -"ixconvert", and "iyconvert" as appropriate to actually do the work. -These secondary routines come in many flavors to handle different -special cases as quickly as possible. -*/ - -static void -FXYConvert(struct fractpoint *pt, /* point to set */ - struct XYspace *S, /* relevant coordinate space */ - double x, double y) /* user's coordinates of point */ -{ - pt->x = (*S->xconvert)(S->tofract.normal[0][0], S->tofract.normal[1][0], x, y); - pt->y = (*S->yconvert)(S->tofract.normal[0][1], S->tofract.normal[1][1], x, y); -} - -static void -IXYConvert(struct fractpoint *pt, /* point to set */ - struct XYspace *S, /* relevant coordinate space */ - long x, long y) /* user's coordinates of point */ -{ - pt->x = (*S->ixconvert)(S->itofract[0][0], S->itofract[1][0], x, y); - pt->y = (*S->iyconvert)(S->itofract[0][1], S->itofract[1][1], x, y); -} - -/* -ForceFloat is a substitute for IConvert(), when we just do not have -enough significant digits in the coefficients to get high enough -precision in the answer with fixed point arithmetic. So, we force the -integers to floats, and do the arithmetic all with floats: -*/ - -static void -ForceFloat(struct fractpoint *pt, /* point to set */ - struct XYspace *S, /* relevant coordinate space */ - long x, long y) /* user's coordinates of point */ -{ - (*S->convert)(pt, S, (double) x, (double) y); -} - -/* -:h3.FXYboth(), FXonly(), FYonly() - Floating Point Conversion - -These are the routines we use when the user has given us floating -point numbers for x and y. FXYboth() is the general purpose routine; -FXonly() and FYonly() are special cases when one of the coefficients -is 0.0. -*/ - -static fractpel -FXYboth(double cx, double cy, /* x and y coefficients */ - double x, double y) /* user x,y */ -{ - register double r; /* temporary float */ - - r = x * cx + y * cy; - return((fractpel) r); -} - -/*ARGSUSED*/ -static fractpel -FXonly(double cx, double cy, /* x and y coefficients */ - double x, double y) /* user x,y */ -{ - register double r; /* temporary float */ - - r = x * cx; - return((fractpel) r); -} - -/*ARGSUSED*/ -static fractpel -FYonly(double cx, double cy, /* x and y coefficients */ - double x, double y) /* user x,y */ -{ - register double r; /* temporary float */ - - r = y * cy; - return((fractpel) r); -} - -/* -:h3.IXYboth(), IXonly(), IYonly() - Simple Integer Conversion - -These are the routines we use when the user has given us integers for -x and y, and the coefficients have enough significant digits to -provide precise answers with only "long" (32 bit?) multiplication. -IXYboth() is the general purpose routine; IXonly() and IYonly() are -special cases when one of the coefficients is 0. -*/ - -static fractpel -IXYboth(fractpel cx, fractpel cy, /* x and y coefficients */ - long x, long y) /* user x,y */ -{ - return(x * cx + y * cy); -} - -/*ARGSUSED*/ -static fractpel -IXonly(fractpel cx, fractpel cy, /* x and y coefficients */ - long x, long y) /* user x,y */ -{ - return(x * cx); -} - -/*ARGSUSED*/ -static fractpel -IYonly(fractpel cx, fractpel cy, /* x and y coefficients */ - long x, long y) /* user x,y */ -{ - return(y * cy); -} - - -/* -:h3.FPXYboth(), FPXonly(), FPYonly() - More Involved Integer Conversion - -These are the routines we use when the user has given us integers for -x and y, but the coefficients do not have enough significant digits to -provide precise answers with only "long" (32 bit?) multiplication. -We have increased the number of significant bits in the coefficients -by FRACTBITS; therefore we must use "double long" (64 bit?) -multiplication by calling FPmult(). FPXYboth() is the general purpose -routine; FPXonly() and FPYonly() are special cases when one of the -coefficients is 0. - -Note that it is perfectly possible for us to calculate X with the -"FP" method and Y with the "I" method, or vice versa. It all depends -on how the functions in the XYspace structure are filled out. -*/ - -static fractpel -FPXYboth(fractpel cx, fractpel cy, /* x and y coefficients */ - long x, long y) /* user x,y */ -{ - return( FPmult(x, cx) + FPmult(y, cy) ); -} - -/*ARGSUSED*/ -static fractpel -FPXonly(fractpel cx, fractpel cy, /* x and y coefficients */ - long x, long y) /* user x,y */ -{ - return( FPmult(x, cx) ); -} - -/*ARGSUSED*/ -static fractpel -FPYonly(fractpel cx, fractpel cy, /* x and y coefficients */ - long x, long y) /* user x,y */ -{ - return( FPmult(y, cy) ); -} - - - -/* -:h3.FillOutFcns() - Determine the Appropriate Functions to Use for Conversion - -This function fills out the "convert" and "iconvert" function pointers -in an XYspace structure, and also fills the "helper" -functions that actually do the work. -*/ - -static void -FillOutFcns(struct XYspace *S) /* functions will be set in this structure */ -{ - S->convert = FXYConvert; - S->iconvert = IXYConvert; - - FindFfcn(S->tofract.normal[0][0], S->tofract.normal[1][0], &S->xconvert); - FindFfcn(S->tofract.normal[0][1], S->tofract.normal[1][1], &S->yconvert); - FindIfcn(S->tofract.normal[0][0], S->tofract.normal[1][0], - &S->itofract[0][0], &S->itofract[1][0], &S->ixconvert); - FindIfcn(S->tofract.normal[0][1], S->tofract.normal[1][1], - &S->itofract[0][1], &S->itofract[1][1], &S->iyconvert); - - if (S->ixconvert == NULL || S->iyconvert == NULL) - S->iconvert = ForceFloat; -} - -/* -:h4.FindFfcn() - Subroutine of FillOutFcns() to Fill Out Floating Functions - -This function tests for the special case of one of the coefficients -being zero: -*/ - -static void -FindFfcn(double cx, double cy, /* x and y coefficients */ - convertFunc *fcnP) /* pointer to function to set */ -{ - if (cx == 0.0) - *fcnP = FYonly; - else if (cy == 0.0) - *fcnP = FXonly; - else - *fcnP = FXYboth; -} - -/* -:h4.FindIfcn() - Subroutine of FillOutFcns() to Fill Out Integer Functions - -There are two types of integer functions, the 'I' type and the 'FP' type. -We use the I type functions when we are satisfied with simple integer -arithmetic. We used the FP functions when we feel we need higher -precision (but still fixed point) arithmetic. If all else fails, -we store a NULL indicating that this we should do the conversion in -floating point. -*/ - -static void -FindIfcn(double cx, double cy, /* x and y coefficients */ - fractpel *icxP, fractpel *icyP, /* fixed point coefficients to set */ - iconvertFunc *fcnP) /* pointer to function to set */ -{ - register fractpel imax; /* maximum of cx and cy */ - - *icxP = cx; - *icyP = cy; - - if (cx != (float) (*icxP) || cy != (float) (*icyP)) { -/* -At this point we know our integer approximations of the coefficients -are not exact. However, we will still use them if the maximum -coefficient will not fit in a 'fractpel'. Of course, we have little -choice at that point, but we haven't lost that much precision by -staying with integer arithmetic. We have enough significant digits -so that -any error we introduce is less than one part in 2:sup/16/. -*/ - - imax = MAX(ABS(*icxP), ABS(*icyP)); - if (imax < (fractpel) (1<<(FRACTBITS-1)) ) { -/* -At this point we know our integer approximations just do not have -enough significant digits for accuracy. We will add FRACTBITS -significant digits to the coefficients (by multiplying them by -1<x; - y = pt->y; - *xp = S->tofract.inverse[0][0] * x + S->tofract.inverse[1][0] * y; - *yp = S->tofract.inverse[0][1] * x + S->tofract.inverse[1][1] * y; -} - -/* -:h2.Transformations -*/ -/* -:h3 id=xform.Xform() - Transform Object in X and Y - -TYPE1IMAGER wants transformations of objects like paths to be identical -to transformations of spaces. For example, if you scale a line(1,1) -by 10 it should yield the same result as generating the line(1,1) in -a coordinate space that has been scaled by 10. - -We handle fonts by storing the accumulated transform, for example, SR -(accumulating on the right). Then when we map the font through space TD, -for example, we multiply the accumulated font transform on the left by -the space transform on the right, yielding SRTD in this case. We will -get the same result if we did S, then R, then T on the space and mapping -an unmodified font through that space. -*/ - -struct xobject * -t1_Xform(struct xobject *obj, /* object to transform */ - double M[2][2]) /* transformation matrix */ -{ - if (obj == NULL) - return(NULL); - - if (obj->type == FONTTYPE) { - register struct font *F = (struct font *) obj; - - F = UniqueFont(F); - return((struct xobject*)F); - } - if (obj->type == PICTURETYPE) { -/* -In the case of a picture, we choose both to update the picture's -transformation matrix and keep the handles up to date. -*/ - register struct picture *P = (struct picture *) obj; - register struct segment *handles; /* temporary path to transform handles */ - - P = UniquePicture(P); - handles = PathSegment(LINETYPE, P->origin.x, P->origin.y); - handles = Join(handles, - PathSegment(LINETYPE, P->ending.x, P->ending.y) ); - handles = (struct segment *)Xform((struct xobject *) handles, M); - P->origin = handles->dest; - P->ending = handles->link->dest; - KillPath(handles); - return((struct xobject *)P); - } - - if (ISPATHTYPE(obj->type)) { - struct XYspace pseudo; /* local temporary space */ - PseudoSpace(&pseudo, M); - return((struct xobject *) PathTransform((struct segment *)obj, - &pseudo)); - } - - - if (obj->type == SPACETYPE) { - register struct XYspace *S = (struct XYspace *) obj; - -/* replaced ISPERMANENT(S->flag) with S->references > 1 3-26-91 PNM */ - if (S->references > 1) - S = CopySpace(S); - else - S->ID = NEXTID; - - MatrixMultiply(S->tofract.normal, M, S->tofract.normal); - /* - * mark inverted matrix invalid: - */ - S->flag &= ~HASINVERSE(ON); - - FillOutFcns(S); - return((struct xobject *) S); - } - - return(ArgErr("Untransformable object", obj, obj)); -} - -/* -:h3.Transform() - Transform an Object - -This is the external user's entry point. -*/ -struct xobject * -t1_Transform(struct xobject *obj, - double cxx, double cyx, /* 2x2 transform matrix elements */ - double cxy, double cyy) /* in row order */ -{ - double M[2][2]; - - M[0][0] = cxx; - M[0][1] = cyx; - M[1][0] = cxy; - M[1][1] = cyy; - ConsiderContext(obj, M); - return(Xform(obj, M)); -} -/* -:h3.Scale() - Special Case of Transform() - -This is a user operator. -*/ - -struct xobject * -t1_Scale(struct xobject *obj, /* object to scale */ - double sx, double sy) /* scale factors in x and y */ -{ - double M[2][2]; - - M[0][0] = sx; - M[1][1] = sy; - M[1][0] = M[0][1] = 0.0; - ConsiderContext(obj, M); - return(Xform(obj, M)); -} - -/* -:h3 id=rotate.Rotate() - Special Case of Transform() - -We special-case different settings of 'degrees' for performance -and accuracy within the DegreeSin() and DegreeCos() routines themselves. -*/ - -#ifdef notdef -struct xobject * -xiRotate(struct xobject *obj, /* object to be transformed */ - double degrees) /* degrees of COUNTER-clockwise rotation */ -{ - double M[2][2]; - - M[0][0] = M[1][1] = DegreeCos(degrees); - M[1][0] = - (M[0][1] = DegreeSin(degrees)); - ConsiderContext(obj, M); - return(Xform(obj, M)); -} -#endif - -/* -:h3.PseudoSpace() - Build a Coordinate Space from a Matrix - -Since we have built all this optimized code that, given an (x,y) and -a coordinate space, yield transformed (x,y), it seems a shame not to -use the same logic when we need to multiply an (x,y) by an arbitrary -matrix that is not (initially) part of a coordinate space. This -subroutine takes the arbitrary matrix and builds a coordinate -space, with all its nifty function pointers. -*/ - -void -PseudoSpace(struct XYspace *S, /* coordinate space structure to fill out */ - double M[2][2]) /* matrix that will become 'tofract.normal' */ -{ - S->type = SPACETYPE; - S->flag = ISPERMANENT(ON) + ISIMMORTAL(ON); - S->references = 2; /* 3-26-91 added PNM */ - S->tofract.normal[0][0] = M[0][0]; - S->tofract.normal[1][0] = M[1][0]; - S->tofract.normal[0][1] = M[0][1]; - S->tofract.normal[1][1] = M[1][1]; - - FillOutFcns(S); -} - -/* -:h2 id=matrixa.Matrix Arithmetic - -Following the convention in Newman and Sproull, :hp1/Interactive -Computer Graphics/, -matrices are organized: -:xmp. - | cxx cyx | - | cxy cyy | -:exmp. -A point is horizontal, for example: -:xmp. - [ x y ] -:exmp. -This means that: -:formula/x prime = cxx times x + cxy times y/ -:formula/y prime = cyx times x + cyy times y/ -I've seen the other convention, where transform matrices are -transposed, equally often in the literature. -*/ - -/* -:h3.MatrixMultiply() - Implements Multiplication of Two Matrices - -Implements matrix multiplication, A * B = C. - -To remind myself, matrix multiplication goes rows of A times columns -of B. -The output matrix may be the same as one of the input matrices. -*/ -void -MatrixMultiply(double A[2][2], double B[2][2], /* input matrices */ - double C[2][2]) /* output matrix */ -{ - register double txx,txy,tyx,tyy; - - txx = A[0][0] * B[0][0] + A[0][1] * B[1][0]; - txy = A[1][0] * B[0][0] + A[1][1] * B[1][0]; - tyx = A[0][0] * B[0][1] + A[0][1] * B[1][1]; - tyy = A[1][0] * B[0][1] + A[1][1] * B[1][1]; - - C[0][0] = txx; - C[1][0] = txy; - C[0][1] = tyx; - C[1][1] = tyy; -} -/* -:h3.MatrixInvert() - Invert a Matrix - -My reference for matrix inversion was :hp1/Elementary Linear Algebra/ -by Paul C. Shields, Worth Publishers, Inc., 1968. -*/ -void -MatrixInvert(double M[2][2], /* input matrix */ - double Mprime[2][2]) /* output inverted matrix */ -{ - register double D; /* determinant of matrix M */ - register double txx,txy,tyx,tyy; - - txx = M[0][0]; - txy = M[1][0]; - tyx = M[0][1]; - tyy = M[1][1]; - - D = M[1][1] * M[0][0] - M[1][0] * M[0][1]; - if (D == 0.0) - Abort("MatrixInvert: can't"); - - Mprime[0][0] = tyy / D; - Mprime[1][0] = -txy / D; - Mprime[0][1] = -tyx / D; - Mprime[1][1] = txx / D; -} -/* -:h2.Initialization, Queries, and Debug -*/ -/* -:h3.InitSpaces() - Initialize Constant Spaces - -For compatibility, we initialize a coordinate space called USER which -maps 72nds of an inch to pels on the default device. -*/ - -struct XYspace *USER = &identity; - -void -InitSpaces(void) -{ - IDENTITY->type = SPACETYPE; - FillOutFcns(IDENTITY); - - contexts[NULLCONTEXT].normal[1][0] - = contexts[NULLCONTEXT].normal[0][1] - = contexts[NULLCONTEXT].inverse[1][0] - = contexts[NULLCONTEXT].inverse[0][1] = 0.0; - contexts[NULLCONTEXT].normal[0][0] - = contexts[NULLCONTEXT].normal[1][1] - = contexts[NULLCONTEXT].inverse[0][0] - = contexts[NULLCONTEXT].inverse[1][1] = 1.0; - - USER->flag |= ISIMMORTAL(ON); - CoerceInverse(USER); -} -/* -:h3.QuerySpace() - Returns the Transformation Matrix of a Space - -Since the tofract matrix of an XYspace includes the scale factor -necessary to produce fractpel results (i.e., FRACTFLOAT), this -must be taken out before we return the matrix to the user. Fortunately, -this is simple: just multiply by the inverse of IDENTITY! -*/ - -void -QuerySpace(struct XYspace *S, /* space asked about */ - double *cxxP, double *cyxP, /* where to put answer */ - double *cxyP, double *cyyP) -{ - double M[2][2]; /* temp matrix to build user's answer */ - - if (S->type != SPACETYPE) { - ArgErr("QuerySpace: not a space", S, NULL); - return; - } - MatrixMultiply(S->tofract.normal, IDENTITY->tofract.inverse, M); - *cxxP = M[0][0]; - *cxyP = M[1][0]; - *cyxP = M[0][1]; - *cyyP = M[1][1]; -} - -/* -:h3.FormatFP() - Format a Fixed Point Pel - -We format the pel as "dddd.XXXX", where XX's are hexidecimal digits, -and the dd's are decimal digits. This might be a little confusing -mixing hexidecimal and decimal like that, but it is convenient -to use for debug. - -We make sure we have N (FRACTBITS/4) digits past the decimal point. -*/ -#define FRACTMASK ((1<> FRACTBITS), s); -} - -/* -:h3.DumpSpace() - Display a Coordinate Space -*/ -/*ARGSUSED*/ -void -DumpSpace(struct XYspace *S) -{ -} diff --git a/nx-X11/lib/font/Type1/spaces.h b/nx-X11/lib/font/Type1/spaces.h deleted file mode 100644 index ef78f2f47..000000000 --- a/nx-X11/lib/font/Type1/spaces.h +++ /dev/null @@ -1,172 +0,0 @@ -/* $Xorg: spaces.h,v 1.3 2000/08/17 19:46:32 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/spaces.h,v 3.3 1999/08/22 08:58:53 dawes Exp $ */ - -/*SHARED*/ - -#define USER t1_User -#define IDENTITY t1_Identity - -#define Context(d,u) t1_Context(d,u) -#define Transform(o,f1,f2,f3,f4) t1_Transform(o,f1,f2,f3,f4) -#define Rotate(o,d) t1_Rotate(o,d) -#define Scale(o,sx,sy) t1_Scale(o,sx,sy) -#define QuerySpace(S,f1,f2,f3,f4) t1_QuerySpace(S,f1,f2,f3,f4) -#define Warp(s1,o,s2) t1_Warp(s1,o,s2) - -/* IDENTITY space */ -extern struct XYspace *IDENTITY; - -/* creates a coordinate space for a device */ -extern struct XYspace *Context(pointer device, double units); -/* transform an object */ -extern struct xobject *t1_Transform ( struct xobject *obj, double cxx, - double cyx, double cxy, double cyy ); -#if 0 -struct xobject *t1_Rotate(); /* rotate an object */ -#endif -/* scale an object */ -extern struct xobject *t1_Scale ( struct xobject *obj, double sx, double sy ); -#if 0 -struct xobject *t1_Warp(); /* transform like delta of two spaces */ -#endif -/* returns coordinate space matrix */ -extern void t1_QuerySpace ( struct XYspace *S, double *cxxP, double *cyxP, - double *cxyP, double *cyyP ); - -/*END SHARED*/ -/*SHARED*/ - -/* #define KillSpace(s) Free(s) -Note - redefined KillSpace() to check references ! -3-26-91 PNM */ - -#define KillSpace(s) if ( (--(s->references) == 0) ||\ - ( (s->references == 1) && ISPERMANENT(s->flag) ) )\ - Free(s) - -#define ConsumeSpace(s) MAKECONSUME(s,KillSpace(s)) -#define UniqueSpace(s) MAKEUNIQUE(s,CopySpace(s)) - -/*END SHARED*/ -/*SHARED*/ - -typedef short pel; /* integer pel locations */ -typedef long fractpel; /* fractional pel locations */ - -#define FRACTBITS 16 /* number of fractional bits in 'fractpel' */ -/* -We define the following macros to convert from 'fractpel' to 'pel' and -vice versa: -*/ -#define TOFRACTPEL(p) (((fractpel)p)<>FRACTBITS) -#define FRACTFLOAT (double)(1L< -#endif -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#ifndef FONTMODULE -#include -#if XFONT_CID -#include -#include -#include -#endif -#ifdef _XOPEN_SOURCE -#include -#else -#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */ -#include -#undef _XOPEN_SOURCE -#endif -#include "X11/Xfuncs.h" -#ifdef USE_MMAP -#include -#include -#endif -#else -#include "Xmd.h" -#include "Xdefs.h" -#endif - -#ifdef FONTMODULE -#include "os.h" -#include "xf86_ansic.h" -#endif - -#include -#include -#include -#include -#include "t1unicode.h" - -#if XFONT_CID -#include "range.h" -#endif - -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "regions.h" -#include "t1stdio.h" -#include "util.h" -#include "fontfcn.h" -#include "t1intf.h" - - -static int Type1GetGlyphs ( FontPtr pFont, unsigned long count, - unsigned char *chars, FontEncoding charEncoding, - unsigned long *glyphCount, CharInfoPtr *glyphs ); - -#if XFONT_CID -#define CMapDir "/CMap/" -#define CFMDir "/CFM/" -#define CIDFontDir "/CIDFont/" -#endif - -static int Type1GetMetrics ( FontPtr pFont, unsigned long count, - unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, - xCharInfo **glyphs ); - - -#define minchar(p) ((p).min_char_low + ((p).min_char_high << 8)) -#define maxchar(p) ((p).max_char_low + ((p).max_char_high << 8)) - -static void fillrun ( char *p, pel x0, pel x1, int bit ); - -extern psfont *FontP; -extern psobj *ISOLatin1EncArrayP; - -#if XFONT_CID -extern char CurCIDFontName[]; -extern char CurCMapName[]; - -static CharInfoPtr CIDGetGlyph ( FontPtr pFont, unsigned int charcode, - CharInfoPtr pci ); - -extern cidfont *CIDFontP; -extern cmapres *CMapP; -#endif - -static void fill ( char *dest, int h, int w, struct region *area, int byte, - int bit, int wordsize ); - -#if XFONT_CID -int -CIDOpenScalable (FontPathElementPtr fpe, - FontPtr *ppFont, - int flags, - FontEntryPtr entry, - char *fileName, - FontScalablePtr vals, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - FontPtr non_cachable_font) /* We don't do licensing */ -{ - FontPtr pFont; - int bit, - byte, - glyph, - scan, - image; - long *pool; /* memory pool for ximager objects */ - int size; /* for memory size calculations */ - struct XYspace *S; /* coordinate space for character */ - register int i; - int nchars, len, rc; - cidglyphs *cid; - char *p; - double t1 = .001, t2 = 0.0, t3 = 0.0, t4 = .001; - double sxmult; - char CIDFontName[CID_NAME_MAX]; - char CMapName[CID_NAME_MAX]; - char cidfontname[CID_PATH_MAX]; - char cmapname[CID_PATH_MAX]; - char *path; - char cidfontpath[CID_PATH_MAX]; - char cmappath[CID_PATH_MAX]; -#if defined(HAVE_CFM) || defined(CID_ALL_CHARS) - char cfmdir[CID_PATH_MAX]; - char cfmfilename[CID_NAME_MAX]; -#endif -#if defined(CID_ALL_CHARS) - char *cf; -#else - long sAscent, sDescent; -#endif - - /* check the font name */ - len = strlen(fileName); - if (len <= 0 || len > CID_NAME_MAX - 1) - return BadFontName; - -#if defined(HAVE_CFM) || defined(CID_ALL_CHARS) - strcpy(cfmdir, fileName); - p = strrchr(cfmdir, '/'); - if (p) *p = '\0'; -#endif - - path = fileName; - if (!(fileName = strrchr(fileName, '/'))) - return BadFontName; - - len = fileName - path; - strncpy(cidfontpath, path, len); - cidfontpath[len] = '\0'; - strcpy(cmappath, cidfontpath); - strcat(cmappath, CMapDir); -#ifdef HAVE_CFM - strcpy(cfmdir, cidfontpath); - strcat(cfmdir, CFMDir); -#endif - strcat(cidfontpath, CIDFontDir); - - fileName++; - - /* extract the CIDFontName and CMapName from the font name */ - /* check for -- */ - if ((p = strstr(fileName, "--"))) { - if (p == fileName) - return BadFontName; - else { - strcpy(CIDFontName, fileName); - CIDFontName[p - fileName] = '\0'; - p += 2; - i = 0; - while (*p && *p != '.') - CMapName[i++] = *p++; - CMapName[i] = '\0'; - if ((len = strlen(CMapName)) <= 0) - return BadFontName; - } - } else - return BadFontName; - - /* The CMap files whose names end with -V are not yet supported */ - len = strlen(CMapName); - if ((len >= 2 && CMapName[len - 2] == '-' && CMapName[len - 1] == 'V') || - (len == 1 && CMapName[len - 1] == 'V')) - return BadFontName; - - /* Reject ridiculously small font sizes that will blow up the math */ - if (hypot(vals->pixel_matrix[0], vals->pixel_matrix[1]) < 1.0 || - hypot(vals->pixel_matrix[2], vals->pixel_matrix[3]) < 1.0) - return BadFontName; - -#ifdef CID_ALL_CHARS - if ((cf = getenv("CFMDIR")) == NULL) - strcat(cfmdir, CFMDir); - else { - strcpy(cfmdir, cf); - strcat(cfmdir, "/"); - } -#endif - -#if defined(HAVE_CFM) || defined(CID_ALL_CHARS) - strcpy(cfmfilename, cfmdir); - strcat(cfmfilename, CIDFontName); - strcat(cfmfilename, "--"); - strcat(cfmfilename, CMapName); - strcat(cfmfilename, ".cfm"); -#endif - - /* create a full-path name for a CIDFont file */ - if (strlen(cidfontpath) + strlen(CIDFontName) + 2 > - CID_PATH_MAX) - return BadFontName; - strcpy(cidfontname, cidfontpath); - strcat(cidfontname, CIDFontName); - - /* create a full-path name for a CMap file */ - if (strlen(cmappath) + strlen(CMapName) + 2 > CID_PATH_MAX) - return BadFontName; - strcpy(cmapname, cmappath); - strcat(cmapname, CMapName); - - /* set up default values */ - FontDefaultFormat(&bit, &byte, &glyph, &scan); - /* get any changes made from above */ - rc = CheckFSFormat(format, fmask, &bit, &byte, &scan, &glyph, &image); - if (rc != Successful) - return rc; - -#define PAD(bits, pad) (((bits)+(pad)-1)&-(pad)) - - if (!(pFont = CreateFontRec())) - return AllocError; - - cid = (cidglyphs *)xalloc(sizeof(cidglyphs)); - if (cid == NULL) { - DestroyFontRec(pFont); - return AllocError; - } - bzero(cid, sizeof(cidglyphs)); - - /* heuristic for "maximum" size of pool we'll need: */ - size = 200000 + 600 * - (int)hypot(vals->pixel_matrix[2], vals->pixel_matrix[3]) - * sizeof(short); - if (size < 0 || NULL == (pool = (long *) xalloc(size))) { - xfree(cid); - DestroyFontRec(pFont); - return AllocError; - } - - addmemory(pool, size); - - /* load font if not already loaded */ - if (!CIDfontfcnA(cidfontname, cmapname, &rc)) { - FontP = NULL; - delmemory(); - xfree(pool); - xfree(cid); - DestroyFontRec(pFont); - return Type1ReturnCodeToXReturnCode(rc); - } - - FontP = NULL; - - S = (struct XYspace *) t1_Transform((struct xobject *)IDENTITY, - t1, t2, t3, t4); - - S = (struct XYspace *) Permanent(t1_Transform((struct xobject *)S, - vals->pixel_matrix[0], - -vals->pixel_matrix[1], - vals->pixel_matrix[2], - -vals->pixel_matrix[3])); - - /* multiplier for computation of raw values */ - sxmult = hypot(vals->pixel_matrix[0], vals->pixel_matrix[1]); - if (sxmult > EPS) sxmult = 1000.0 / sxmult; - - pFont->info.firstRow = CMapP->firstRow; - pFont->info.firstCol = CMapP->firstCol; - pFont->info.lastRow = CMapP->lastRow; - pFont->info.lastCol = CMapP->lastCol; - - nchars = (pFont->info.lastRow - pFont->info.firstRow + 1) * - (pFont->info.lastCol - pFont->info.firstCol + 1); - - delmemory(); - xfree(pool); - - if (pFont->info.firstCol > pFont->info.lastCol) - { - xfree(cid); - DestroyFontRec(pFont); - return BadFontName; - } - - cid->glyphs = (CharInfoRec **)xalloc(nchars*sizeof(CharInfoRec *)); - if (cid->glyphs == NULL) { - xfree(cid); - DestroyFontRec(pFont); - return AllocError; - } - bzero(cid->glyphs, nchars*sizeof(CharInfoRec *)); - - pFont->info.defaultCh = 0; - pFont->format = format; - - pFont->bit = bit; - pFont->byte = byte; - pFont->glyph = glyph; - pFont->scan = scan; - - pFont->get_metrics = CIDGetMetrics; - pFont->get_glyphs = CIDGetGlyphs; - pFont->unload_font = CIDCloseFont; - pFont->unload_glyphs = NULL; - pFont->refcnt = 0; - - len = strlen(cidfontname); - cid->CIDFontName = (char *)xalloc(len + 1); - if (cid->CIDFontName == NULL) { - xfree(cid->glyphs); - xfree(cid); - DestroyFontRec(pFont); - return AllocError; - } - strcpy(cid->CIDFontName, cidfontname); - - len = strlen(cmapname); - cid->CMapName = (char *)xalloc(len + 1); - if (cid->CMapName == NULL) { - xfree(cid->CIDFontName); - xfree(cid->glyphs); - xfree(cid); - DestroyFontRec(pFont); - return AllocError; - } - strcpy(cid->CMapName, cmapname); - - cid->pixel_matrix[0] = vals->pixel_matrix[0]; - cid->pixel_matrix[1] = vals->pixel_matrix[1]; - cid->pixel_matrix[2] = vals->pixel_matrix[2]; - cid->pixel_matrix[3] = vals->pixel_matrix[3]; - - pFont->fontPrivate = (unsigned char *)cid; - - pFont->info.fontAscent = - (CIDFontP->CIDfontInfoP[CIDFONTBBOX].value.data.arrayP[3].data.integer * - vals->pixel_matrix[3] + - (CIDFontP->CIDfontInfoP[CIDFONTBBOX].value.data.arrayP[3].data.integer > - 0 ? 500 : -500)) / 1000; - - pFont->info.fontDescent = - -(int)((double)CIDFontP->CIDfontInfoP[CIDFONTBBOX].value.data.arrayP[1].data.integer - * vals->pixel_matrix[3] + - (CIDFontP->CIDfontInfoP[CIDFONTBBOX].value.data.arrayP[1].data.integer > - 0 ? 500 : -500)) / 1000; - - /* Adobe does not put isFixedPitch entries in CID-keyed fonts. */ - /* CID-keyed are not constant-width fonts. */ - pFont->info.constantWidth = 0; - -#ifndef CID_ALL_CHARS - sAscent = CIDFontP->CIDfontInfoP[CIDFONTBBOX].value.data.arrayP[3].data.integer; - sDescent = -CIDFontP->CIDfontInfoP[CIDFONTBBOX].value.data.arrayP[1].data.integer; -#endif - - if (strncmp(entry->name.name, "-bogus", 6)) { -#ifdef CID_ALL_CHARS - ComputeBoundsAllChars(pFont, cfmfilename, sxmult); -#else -#ifdef HAVE_CFM - CIDFillFontInfo(pFont, vals, cidfontname, entry->name.name, cmapname, - cfmfilename, sAscent, sDescent, sxmult); -#else - CIDFillFontInfo(pFont, vals, cidfontname, entry->name.name, cmapname, - sAscent, sDescent, sxmult); -#endif /* HAVE_CFM */ -#endif /* CID_ALL_CHARS */ - } - - *ppFont = pFont; - - return Successful; -} -#endif - -/*ARGSUSED*/ -int -Type1OpenScalable (FontPathElementPtr fpe, - FontPtr *ppFont, - int flags, - FontEntryPtr entry, - char *fileName, - FontScalablePtr vals, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - FontPtr non_cachable_font) /* We don't do licensing */ -{ - FontPtr pFont; - int bit, - byte, - glyph, - scan, - image; - int pad,wordsize; /* scan & image in bits */ - long *pool; /* memory pool for ximager objects */ - int size; /* for memory size calculations */ - struct XYspace *S; /* coordinate space for character */ - struct region *area; - CharInfoRec *glyphs; - int len, rc, count = 0, i = 0; - struct type1font *type1; - char *p; - FontMapPtr mapping = NULL; - int no_mapping; - psobj *fontmatrix; - long x0, total_width = 0, total_raw_width = 0; - double x1, y1, t1 = .001, t2 = 0.0, t3 = 0.0, t4 = .001; - double sxmult; - - /* Reject ridiculously small font sizes that will blow up the math */ - if (hypot(vals->pixel_matrix[0], vals->pixel_matrix[1]) < 1.0 || - hypot(vals->pixel_matrix[2], vals->pixel_matrix[3]) < 1.0) - return BadFontName; - - /* set up default values */ - FontDefaultFormat(&bit, &byte, &glyph, &scan); - /* get any changes made from above */ - rc = CheckFSFormat(format, fmask, &bit, &byte, &scan, &glyph, &image); - if (rc != Successful) - return rc; - - pad = glyph * 8; - wordsize = scan * 8; - -#define PAD(bits, pad) (((bits)+(pad)-1)&-(pad)) - - pFont = CreateFontRec(); - if (pFont == NULL) - return AllocError; - - type1 = (struct type1font *)xalloc(sizeof(struct type1font)); - if (type1 == NULL) { - DestroyFontRec(pFont); - return AllocError; - } - bzero(type1, sizeof(struct type1font)); - - /* heuristic for "maximum" size of pool we'll need: */ -#if XFONT_CID - size = 400000 + 600 * -#else - size = 200000 + 600 * -#endif - (int)hypot(vals->pixel_matrix[2], vals->pixel_matrix[3]) - * sizeof(short); - if (size < 0 || NULL == (pool = (long *) xalloc(size))) { - xfree(type1); - DestroyFontRec(pFont); - return AllocError; - } - - addmemory(pool, size); - - - glyphs = type1->glyphs; - - /* load font if not already loaded */ - if (!fontfcnA(fileName, &rc)) { - delmemory(); - xfree(type1); - DestroyFontRec(pFont); - xfree(pool); - return Type1ReturnCodeToXReturnCode(rc); - } - - fontmatrix = &FontP->fontInfoP[FONTMATRIX].value; - if (objPIsArray(fontmatrix) && fontmatrix->len == 6) - { -#define assign(n,d,f) if (objPIsInteger(fontmatrix->data.arrayP + n)) \ - d = fontmatrix->data.arrayP[n].data.integer; \ - else if (objPIsReal(fontmatrix->data.arrayP + n)) \ - d = fontmatrix->data.arrayP[n].data.real; \ - else d = f; - - assign(0, t1, .001); - assign(1, t2, 0.0); - assign(2, t3, 0.0); - assign(3, t4, .001); - } - - S = (struct XYspace *) t1_Transform((struct xobject *)IDENTITY, - t1, t2, t3, t4); - - S = (struct XYspace *) Permanent(t1_Transform((struct xobject *)S, - vals->pixel_matrix[0], - -vals->pixel_matrix[1], - vals->pixel_matrix[2], - -vals->pixel_matrix[3])); - - - /* multiplier for computation of raw values */ - sxmult = hypot(vals->pixel_matrix[0], vals->pixel_matrix[1]); - if (sxmult > EPS) sxmult = 1000.0 / sxmult; - - no_mapping=0; - p = FontEncFromXLFD(entry->name.name, entry->name.length); - - if(p==0) { /* XLFD does not specify an encoding */ - mapping=0; - no_mapping=2; /* ISO 8859-1 */ - } - - if(!strcmp(p, "adobe-fontspecific")) { - mapping=0; - no_mapping=1; /* font's native encoding vector */ - } - - pFont->info.firstCol = 255; - pFont->info.lastCol = 0; - - if(!no_mapping) { - mapping = FontEncMapFind(p, - FONT_ENCODING_POSTSCRIPT, -1, -1, - fileName); - if(!mapping) - mapping = FontEncMapFind(p, - FONT_ENCODING_UNICODE, -1, -1, - fileName); - if(!mapping) - goto NoEncoding; - else - no_mapping=0; - } - - for (i=0; i < 256; i++) { - long h,w; - long paddedW; - int j; - char *codename; - - if(no_mapping == 1) { - codename = FontP->fontInfoP[ENCODING]. - value.data.arrayP[i].data.valueP; - len = FontP->fontInfoP[ENCODING]. - value.data.arrayP[i].len; - } else if(no_mapping) { - codename = unicodetoPSname(i); - len = codename ? strlen(codename) : 0; - } else { - if(mapping->type == FONT_ENCODING_UNICODE) { - codename = unicodetoPSname(FontEncRecode(i, mapping)); - } else - codename = FontEncName(i, mapping); - len=codename?strlen(codename):0; - } - - /* Avoid multiply rasterising the undefined glyph */ - if(len==7 && !strncmp(codename, ".notdef", 7)) { - len=0; - codename=0; - } - - /* But do rasterise it at least once */ - if(len==0) { - if(i==0) { - codename=".notdef"; - len=7; - } else - continue; - } - - /* See if this character is in the list of ranges specified - in the XLFD name */ - if(i!=0) { - for (j = 0; j < vals->nranges; j++) - if (i >= minchar(vals->ranges[j]) && - i <= maxchar(vals->ranges[j])) - break; - - /* If not, don't realize it. */ - if (vals->nranges && j == vals->nranges) - continue; - } - - rc = 0; - area = (struct region *)fontfcnB(S, (unsigned char *)codename, - &len, &rc); - if (rc < 0) { - rc = Type1ReturnCodeToXReturnCode(rc); - break; - } - else if (rc > 0) - continue; - - if (area == NULL) - continue; - - if (pFont->info.firstCol > i) - pFont->info.firstCol = i; - if (pFont->info.lastCol < i) - pFont->info.lastCol = i; - - h = area->ymax - area->ymin; - w = area->xmax - area->xmin; - paddedW = PAD(w, pad); - - if (h > 0 && w > 0) { - size = h * paddedW / 8; - glyphs[i].bits = (char *)xalloc(size); - if (glyphs[i].bits == NULL) { - rc = AllocError; - break; - } - } - else { - size = 0; - h = w = 0; - area->xmin = area->xmax = 0; - area->ymax = area->ymax = 0; - } - - glyphs[i].metrics.leftSideBearing = area->xmin; - x1 = (double)(x0 = area->ending.x - area->origin.x); - y1 = (double)(area->ending.y - area->origin.y); - glyphs[i].metrics.characterWidth = - (x0 + (x0 > 0 ? FPHALF : -FPHALF)) / (1 << FRACTBITS); - if (!glyphs[i].metrics.characterWidth && size == 0) - { - /* Zero size and zero extents: presumably caused by - the choice of transformation. Let's create a - small bitmap so we're not mistaken for an undefined - character. */ - h = w = 1; - size = paddedW = PAD(w, pad); - glyphs[i].bits = (char *)xalloc(size); - if (glyphs[i].bits == NULL) { - rc = AllocError; - break; - } - } - glyphs[i].metrics.attributes = - NEARESTPEL((long)(hypot(x1, y1) * sxmult)); - total_width += glyphs[i].metrics.attributes; - total_raw_width += abs((int)(INT16)glyphs[i].metrics.attributes); - count++; - glyphs[i].metrics.rightSideBearing = w + area->xmin; - glyphs[i].metrics.descent = area->ymax - NEARESTPEL(area->origin.y); - glyphs[i].metrics.ascent = h - glyphs[i].metrics.descent; - - - bzero(glyphs[i].bits, size); - if (h > 0 && w > 0) { - fill(glyphs[i].bits, h, paddedW, area, byte, bit, wordsize ); - } - - Destroy(area); - } - NoEncoding: - - delmemory(); - xfree(pool); - - if (pFont->info.firstCol > pFont->info.lastCol) - { - xfree(type1); - DestroyFontRec(pFont); - return BadFontName; - } - - if (i != 256) { - for (i--; i >= 0; i--) - if (glyphs[i].bits != NULL) - xfree(glyphs[i].bits); - xfree(type1); - DestroyFontRec(pFont); - return rc; - } - type1->pDefault = NULL; - - pFont->format = format; - - pFont->bit = bit; - pFont->byte = byte; - pFont->glyph = glyph; - pFont->scan = scan; - - pFont->info.firstRow = 0; - pFont->info.lastRow = 0; - - pFont->get_metrics = Type1GetMetrics; - pFont->get_glyphs = Type1GetGlyphs; - pFont->unload_font = Type1CloseFont; - pFont->unload_glyphs = NULL; - pFont->refcnt = 0; - - pFont->fontPrivate = (unsigned char *) type1; - - if (count) - { - total_raw_width = (total_raw_width * 10 + count / 2) / count; - if (total_width < 0) - { - /* Predominant direction is R->L */ - total_raw_width = -total_raw_width; - } - vals->width = (int)((double)total_raw_width * - vals->pixel_matrix[0] / 1000.0 + - (vals->pixel_matrix[0] > 0 ? .5 : -.5)); - } - - T1FillFontInfo(pFont, vals, fileName, entry->name.name, total_raw_width); - - *ppFont = pFont; - return Successful; -} - -#if XFONT_CID -unsigned int -getCID(FontPtr pFont, unsigned int charcode) -{ - unsigned int cidcode = 0; - Bool charvalid = FALSE; - cidglyphs *cid; - int i, j; - unsigned int char_row, char_col, rangelo_row, rangelo_col, k; - unsigned int rangehi_row, rangehi_col; - spacerange *spacerangeP; - cidrange *notdefrangeP, *cidrangeP; - - cid = (cidglyphs *)pFont->fontPrivate; - - if (cid == NULL) - return cidcode; - - char_row = (charcode >> 8) & 0xff; - char_col = charcode & 0xff; - - spacerangeP = CIDFontP->spacerangeP; - for (i = 0; i < CIDFontP->spacerangecnt; i++) { - for (j = 0; j < spacerangeP->rangecnt; j++) { - rangelo_row = - (spacerangeP->spacecode[j].srcCodeLo >> 8) & 0xff; - rangelo_col = spacerangeP->spacecode[j].srcCodeLo & 0xff; - rangehi_row = - (spacerangeP->spacecode[j].srcCodeHi >> 8) & 0xff; - rangehi_col = spacerangeP->spacecode[j].srcCodeHi & 0xff; - if (char_row >= rangelo_row && char_row <= rangehi_row && - char_col >= rangelo_col && char_col <= rangehi_col) { - charvalid = TRUE; - break; - } - } - if (charvalid) break; - spacerangeP = spacerangeP->next; - } - - if (charvalid) { - charvalid = FALSE; - cidrangeP = CIDFontP->cidrangeP; - for (i = 0; i < CIDFontP->cidrangecnt; i++) { - for (j = 0; j < cidrangeP->rangecnt; j++) { - rangelo_row = - (cidrangeP->range[j].srcCodeLo >> 8) & 0xff; - rangelo_col = cidrangeP->range[j].srcCodeLo & 0xff; - rangehi_row = - (cidrangeP->range[j].srcCodeHi >> 8) & 0xff; - rangehi_col = cidrangeP->range[j].srcCodeHi & 0xff; - if (char_row >= rangelo_row && char_row <= rangehi_row && - char_col >= rangelo_col && char_col <= rangehi_col) { - charvalid = TRUE; - for (k = cidrangeP->range[j].srcCodeLo; - k <= cidrangeP->range[j].srcCodeHi; k++) { - if (k == charcode) - cidcode = cidrangeP->range[j].dstCIDLo + k - - cidrangeP->range[j].srcCodeLo; - } - break; - } - } - if (charvalid) break; - cidrangeP = cidrangeP->next; - } - } - - if (charvalid) { - charvalid = FALSE; - notdefrangeP = CIDFontP->notdefrangeP; - for (i = 0; i < CIDFontP->notdefrangecnt; i++) { - for (j = 0; j < notdefrangeP->rangecnt; j++) { - rangelo_row = - (notdefrangeP->range[j].srcCodeLo >> 8) & 0xff; - rangelo_col = notdefrangeP->range[j].srcCodeLo & 0xff; - rangehi_row = - (notdefrangeP->range[j].srcCodeHi >> 8) & 0xff; - rangehi_col = notdefrangeP->range[j].srcCodeHi & 0xff; - if (char_row >= rangelo_row && char_row <= rangehi_row && - char_col >= rangelo_col && char_col <= rangehi_col) { - charvalid = TRUE; - for (k = notdefrangeP->range[j].srcCodeLo; - k <= notdefrangeP->range[j].srcCodeHi; k++) { - if (k == charcode) - /* the whole range is mapped to a single CID code */ - cidcode = notdefrangeP->range[j].dstCIDLo; - } - break; - } - } - if (charvalid) break; - notdefrangeP = notdefrangeP->next; - } - } - - /* If you specify a CMap that has more CIDs than a specified CIDFont, */ - /* the program could go beyond the number of entries in CIDMap. Make */ - /* sure that that does not happen. */ - if (cidcode < CIDFontP->CIDfontInfoP[CIDCOUNT].value.data.integer) - return cidcode; - else - return 0; -} - -static CharInfoPtr -CIDGetGlyph(FontPtr pFont, unsigned int charcode, CharInfoPtr pci) -{ - int rc; - CharInfoPtr cp = NULL; - unsigned int cidcode; - - /* character code -> CID */ - cidcode = getCID(pFont, charcode); - - cp = CIDGetGlyphInfo(pFont, cidcode, pci, &rc); - - if (rc != Successful && cidcode) { - cidcode = 0; - cp = CIDGetGlyphInfo(pFont, cidcode, pci, &rc); - } - - return cp; -} - -int -CIDGetGlyphs(FontPtr pFont, - unsigned long count, - unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - CharInfoPtr *glyphs) /* RETURN */ -{ - unsigned int code, char_row, char_col; - CharInfoPtr *glyphsBase; - register unsigned int c; - CharInfoPtr pci; - CharInfoPtr pDefault; - cidglyphs *cid; - register int firstCol; - int rc = 0; - int cid_valid = 0; - - cid = (cidglyphs *)pFont->fontPrivate; - - FontP = NULL; - - firstCol = pFont->info.firstCol; - pDefault = cid->pDefault; - glyphsBase = glyphs; - - switch (charEncoding) { - -#define EXIST(pci) \ - ((pci)->metrics.attributes || \ - (pci)->metrics.ascent != -(pci)->metrics.descent || \ - (pci)->metrics.leftSideBearing != (pci)->metrics.rightSideBearing) - - case Linear8Bit: - case TwoD8Bit: - if (pFont->info.firstRow > 0) - break; - while (count--) { - c = (*chars++); - if (c >= firstCol && c <= pFont->info.lastCol) { - code = c - firstCol; - if (!(pci = (CharInfoRec *)cid->glyphs[code]) || - ((long)pci->bits == CID_BITMAP_UNDEFINED)) { - /* load font if not already loaded */ - if(!cid_valid) { - if(!CIDfontfcnA(cid->CIDFontName, cid->CMapName, &rc)) { FontP = NULL; - return Type1ReturnCodeToXReturnCode(rc); - } - cid_valid = 1; - } - pci = CIDGetGlyph(pFont, c, pci); - } - if (pci && EXIST(pci)) { - *glyphs++ = pci; - cid->glyphs[code] = pci; - } else if (pDefault) { - *glyphs++ = pDefault; - cid->glyphs[code] = pDefault; - } - } else if (pDefault) - *glyphs++ = pDefault; - } - break; - case Linear16Bit: - while (count--) { - char_row = *chars++; - char_col = *chars++; - c = char_row << 8; - c = (c | char_col); - if (pFont->info.firstRow <= char_row && char_row <= - pFont->info.lastRow && pFont->info.firstCol <= char_col && - char_col <= pFont->info.lastCol) { - code = pFont->info.lastCol - pFont->info.firstCol + 1; - char_row = char_row - pFont->info.firstRow; - char_col = char_col - pFont->info.firstCol; - code = char_row * code + char_col; - if (!(pci = (CharInfoRec *)cid->glyphs[code]) || - ((long)pci->bits == CID_BITMAP_UNDEFINED)) { - /* load font if not already loaded */ - if(!cid_valid) { - if(!CIDfontfcnA(cid->CIDFontName, cid->CMapName, &rc)) { FontP = NULL; - return Type1ReturnCodeToXReturnCode(rc); - } - cid_valid = 1; - } - pci = CIDGetGlyph(pFont, c, pci); - } - if (pci && EXIST(pci)) { - *glyphs++ = pci; - cid->glyphs[code] = pci; - } else if (pDefault) { - *glyphs++ = pDefault; - cid->glyphs[code] = pDefault; - } - } else if (pDefault) - *glyphs++ = pDefault; - } - break; - - case TwoD16Bit: - while (count--) { - char_row = (*chars++); - char_col = (*chars++); - c = char_row << 8; - c = (c | char_col); - if (pFont->info.firstRow <= char_row && char_row <= - pFont->info.lastRow && pFont->info.firstCol <= char_col && - char_col <= pFont->info.lastCol) { - code = pFont->info.lastCol - pFont->info.firstCol + 1; - char_row = char_row - pFont->info.firstRow; - char_col = char_col - pFont->info.firstCol; - code = char_row * code + char_col; - if (!(pci = (CharInfoRec *)cid->glyphs[code]) || - ((long)pci->bits == CID_BITMAP_UNDEFINED)) { - /* load font if not already loaded */ - if(!cid_valid) { - if(!CIDfontfcnA(cid->CIDFontName, cid->CMapName, &rc)) { FontP = NULL; - return Type1ReturnCodeToXReturnCode(rc); - } - cid_valid = 1; - } - pci = CIDGetGlyph(pFont, c, pci); - } - if (pci && EXIST(pci)) { - *glyphs++ = pci; - cid->glyphs[code] = pci; - } else if (pDefault) { - *glyphs++ = pDefault; - cid->glyphs[code] = pDefault; - } - } else if (pDefault) - *glyphs++ = pDefault; - } - break; - } - *glyphCount = glyphs - glyphsBase; - return Successful; - -#undef EXIST -} -#endif - -static int -Type1GetGlyphs(FontPtr pFont, - unsigned long count, - unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - CharInfoPtr *glyphs) /* RETURN */ -{ - unsigned int firstRow; - unsigned int numRows; - CharInfoPtr *glyphsBase; - register unsigned int c; - register CharInfoPtr pci; - unsigned int r; - CharInfoPtr pDefault; - register struct type1font *type1Font; - register int firstCol; - - type1Font = (struct type1font *) pFont->fontPrivate; - firstCol = pFont->info.firstCol; - pDefault = type1Font->pDefault; - glyphsBase = glyphs; - - switch (charEncoding) { - -#define EXIST(pci) \ - ((pci)->metrics.attributes || \ - (pci)->metrics.ascent != -(pci)->metrics.descent || \ - (pci)->metrics.leftSideBearing != (pci)->metrics.rightSideBearing) - - case Linear8Bit: - case TwoD8Bit: - if (pFont->info.firstRow > 0) - break; - while (count--) { - c = (*chars++); - if (c >= firstCol && - (pci = &type1Font->glyphs[c]) && - EXIST(pci)) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - break; - case Linear16Bit: - while (count--) { - c = *chars++ << 8; - c = (c | *chars++); - if (c < 256 && c >= firstCol && - (pci = &type1Font->glyphs[c]) && - EXIST(pci)) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - break; - - case TwoD16Bit: - firstRow = pFont->info.firstRow; - numRows = pFont->info.lastRow - firstRow + 1; - while (count--) { - r = (*chars++) - firstRow; - c = (*chars++); - if (r < numRows && c < 256 && c >= firstCol && - (pci = &type1Font->glyphs[(r << 8) + c]) && - EXIST(pci)) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - break; - } - *glyphCount = glyphs - glyphsBase; - return Successful; - -#undef EXIST -} - -#if XFONT_CID -static CharInfoRec nonExistantChar; - -int -CIDGetMetrics(FontPtr pFont, - unsigned long count, - unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - xCharInfo **glyphs) /* RETURN */ -{ - int ret; - cidglyphs *cid; - CharInfoPtr oldDefault; - char cidafmname[CID_PATH_MAX]; - char CIDFontName[CID_NAME_MAX]; - char *ptr; - - cid = (cidglyphs *)pFont->fontPrivate; - - strcpy(cidafmname, cid->CIDFontName); - if (!(ptr = strrchr(cidafmname, '/'))) - return BadFontName; - - *ptr = '\0'; - - strcpy(CIDFontName, ptr + 1); - - if (!(ptr = strrchr(cidafmname, '/'))) - return BadFontName; - - *ptr = '\0'; - - strcat(cidafmname, "/AFM/"); - strcat(cidafmname, CIDFontName); - - strcat(cidafmname, ".afm"); - - oldDefault = cid->pDefault; - cid->pDefault = &nonExistantChar; - - ret = CIDGetAFM(pFont, count, chars, charEncoding, glyphCount, (CharInfoPtr -*)glyphs, cidafmname); - if (ret != Successful) - ret = CIDGetGlyphs(pFont, count, chars, charEncoding, glyphCount, - (CharInfoPtr *)glyphs); - - *ptr = 0; - cid->pDefault = oldDefault; - return ret; -} -#endif - -static int -Type1GetMetrics(FontPtr pFont, - unsigned long count, - unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - xCharInfo **glyphs) /* RETURN */ -{ - static CharInfoRec nonExistantChar; - - int ret; - struct type1font *type1Font; - CharInfoPtr oldDefault; - - type1Font = (struct type1font *) pFont->fontPrivate; - oldDefault = type1Font->pDefault; - type1Font->pDefault = &nonExistantChar; - ret = Type1GetGlyphs(pFont, count, chars, charEncoding, glyphCount, (CharInfoPtr *) glyphs); - type1Font->pDefault = oldDefault; - return ret; -} - -#if XFONT_CID -void -CIDCloseFont(FontPtr pFont) -{ - register int i; - cidglyphs *cid; - int nchars; - - if (pFont) { - - cid = (cidglyphs *)pFont->fontPrivate; - - if (cid) { - - if (cid->CIDFontName && !strcmp(cid->CIDFontName, CurCIDFontName) - && cid->CMapName && !strcmp(cid->CMapName, CurCMapName)){ - strcpy(CurCIDFontName, ""); /* initialize to none */ - strcpy(CurCMapName, ""); /* initialize to none */ - } - - if (cid->CIDFontName) - xfree(cid->CIDFontName); - - if (cid->CMapName) - xfree(cid->CMapName); - - nchars = (pFont->info.lastRow - pFont->info.firstRow + 1) * - (pFont->info.lastCol - pFont->info.firstCol + 1); - - for (i = 0; i < nchars; i++) { - if (cid->glyphs[i] && (cid->glyphs[i] != &nonExistantChar)) { - if (cid->glyphs[i]->bits) - xfree(cid->glyphs[i]->bits); - xfree(cid->glyphs[i]); - } - } - - if (cid->glyphs) - xfree(cid->glyphs); - - if (cid->AFMinfo) - xfree(cid->AFMinfo); -#ifdef USE_MMAP - if (cid->CIDdata) - munmap(cid->CIDdata, cid->CIDsize); -#endif - xfree(cid); - } - - if (pFont->info.props) - xfree(pFont->info.props); - - if (pFont->info.isStringProp) - xfree(pFont->info.isStringProp); - - DestroyFontRec(pFont); - } -} -#endif - -void -Type1CloseFont(FontPtr pFont) -{ - register int i; - struct type1font *type1; - - type1 = (struct type1font *) pFont->fontPrivate; - for (i=0; i < 256; i++) - if (type1->glyphs[i].bits != NULL) - xfree(type1->glyphs[i].bits); - xfree(type1); - - if (pFont->info.props) - xfree(pFont->info.props); - - if (pFont->info.isStringProp) - xfree(pFont->info.isStringProp); - - DestroyFontRec(pFont); -} - -static void -fill(char *dest, /* destination bitmap */ - int h, int w, /* dimensions of 'dest', w padded */ - struct region *area, /* region to write to 'dest' */ - int byte, int bit, /* flags; LSBFirst or MSBFirst */ - int wordsize) /* number of bits per word for LSB/MSB purposes */ -{ - register struct edgelist *edge; /* for looping through edges */ - register char *p; /* current scan line in 'dest' */ - register int y; /* for looping through scans */ - register int wbytes = w / 8; /* number of bytes in width */ - register pel *leftP,*rightP; /* pointers to X values, left and right */ - int xmin = area->xmin; /* upper left X */ - int ymin = area->ymin; /* upper left Y */ - - for (edge = area->anchor; VALIDEDGE(edge); edge = edge->link->link) { - - p = dest + (edge->ymin - ymin) * wbytes; - leftP = edge->xvalues; - rightP = edge->link->xvalues; - - for (y = edge->ymin; y < edge->ymax; y++) { - fillrun(p, *leftP++ - xmin, *rightP++ - xmin, bit); - p += wbytes; - } - } -/* -Now, as an afterthought, we'll go reorganize if odd byte order requires -it: -*/ - if (byte == LSBFirst && wordsize != 8) { - register int i; - - switch (wordsize) { - case 16: - { - register unsigned short data,*p; - - p = (unsigned short *) dest; - - for (i = h * w /16; --i >= 0;) { - data = *p; - *p++ = (data << 8) + (data >> 8); - } - break; - } - case 64: - case 32: - { - register unsigned long data,*p; - - p = (unsigned long *) dest; - - for (i = h * w / 32; --i >= 0;) { - data = *p; - *p++ = (data << 24) + (data >> 24) - + (0xFF00 & (data >> 8)) - + (0xFF0000 & (data << 8)); - } - if (wordsize == 64) { - - p = (unsigned long *) dest; - - for (i = h * w / 64; --i >= 0;) { - data = *p++; - p[-1] = p[0]; - *p++ = data; - } - } - break; - } - default: - Abort("xiFill: unknown format"); - } - } - -} - -#define ALLONES 0xFF - -static void -fillrun(char *p, /* address of this scan line */ - pel x0, pel x1, /* left and right X */ - int bit) /* format: LSBFirst or MSBFirst */ -{ - register int startmask,endmask; /* bits to set in first and last char*/ - register int middle; /* number of chars between start and end + 1 */ - - if (x1 <= x0) - return; - middle = x1/8 - x0/8; - p += x0/8; - x0 &= 7; x1 &= 7; - if (bit == LSBFirst) { - startmask = ALLONES << x0; - endmask = ~(ALLONES << x1); - } - else { - startmask = ALLONES >> x0; - endmask = ~(ALLONES >> x1); - } - if (middle == 0) - *p++ |= startmask & endmask; - else { - *p++ |= startmask; - while (--middle > 0) - *p++ = (char)ALLONES; - *p |= endmask; - } -} - -#define CAPABILITIES (CAP_MATRIX | CAP_CHARSUBSETTING) - -#if XFONT_CID -FontRendererRec CIDRendererInfo[] = { - { ".cid", 4, NULL, CIDOpenScalable, - NULL, CIDGetInfoScalable, 0, CAPABILITIES } -}; -#endif - -#if XFONT_CID -FontRendererRec Type1RendererInfo[] = { -#else -static FontRendererRec renderers[] = { -#endif - { ".pfa", 4, NULL, Type1OpenScalable, - NULL, Type1GetInfoScalable, 0, CAPABILITIES }, - { ".pfb", 4, NULL, Type1OpenScalable, - NULL, Type1GetInfoScalable, 0, CAPABILITIES } -}; - -#if XFONT_CID -void -CIDRegisterFontFileFunctions(void) -{ - int i; - - Type1InitStdProps(); - for (i=0; i < sizeof(CIDRendererInfo) / sizeof(FontRendererRec); i++) - FontFileRegisterRenderer(&CIDRendererInfo[i]); -} -#endif - -void -Type1RegisterFontFileFunctions(void) -{ - int i; - -#if XFONT_CID - Type1InitStdProps(); - for (i=0; i < sizeof(Type1RendererInfo) / sizeof(FontRendererRec); i++) - FontFilePriorityRegisterRenderer(&Type1RendererInfo[i], -10); -#else - T1InitStdProps(); - for (i=0; i < sizeof(renderers) / sizeof(FontRendererRec); i++) - FontFilePriorityRegisterRenderer(&renderers[i], -10); -#endif -} - -int -Type1ReturnCodeToXReturnCode(int rc) -{ - switch(rc) { - case SCAN_OK: - return Successful; - case SCAN_FILE_EOF: - /* fall through to BadFontFormat */ - case SCAN_ERROR: - return BadFontFormat; - case SCAN_OUT_OF_MEMORY: - return AllocError; - case SCAN_FILE_OPEN_ERROR: - return BadFontName; - case SCAN_TRUE: - case SCAN_FALSE: - case SCAN_END: - /* fall through */ - default: - /* this should not happen */ -#if XFONT_CID - ErrorF("Font return code cannot be converted to X return code: %d\n", rc); -#else - ErrorF("Type1 return code not convertable to X return code: %d\n", rc); -#endif - return rc; - } -} - -#if XFONT_CID -CharInfoPtr -CIDRenderGlyph(FontPtr pFont, psobj *charstringP, psobj *subarrayP, - struct blues_struct *bluesP, CharInfoPtr pci, int *mode) -{ - int bit, - byte, - glyph, - scan, - image; - int pad,wordsize; /* scan & image in bits */ - long *pool; /* memory pool for ximager objects */ - int size; /* for memory size calculations */ - struct XYspace *S; /* coordinate space for character */ - struct region *area; - CharInfoRec *glyphs; - int len, rc; - long x0; - double x1, y1, t1 = .001, t2 = 0.0, t3 = 0.0, t4 = .001; - double sxmult; - long h,w; - long paddedW; - cidglyphs *cid; - fsBitmapFormat format = 0; - fsBitmapFormatMask fmask = 0; - - cid = (cidglyphs *)pFont->fontPrivate; - - /* set up default values */ - FontDefaultFormat(&bit, &byte, &glyph, &scan); - /* get any changes made from above */ - rc = CheckFSFormat(format, fmask, &bit, &byte, &scan, &glyph, &image); - if (rc != Successful) { - *mode = rc; - return(NULL); - } - - pad = glyph * 8; - wordsize = scan * 8; - -#define PAD(bits, pad) (((bits)+(pad)-1)&-(pad)) - - /* heuristic for "maximum" size of pool we'll need: */ - size = 200000 + 600 * - (int)hypot(cid->pixel_matrix[2], cid->pixel_matrix[3]) - * sizeof(short); - if (size < 0 || NULL == (pool = (long *) xalloc(size))) { - *mode = AllocError; - return(NULL); - } - - addmemory(pool, size); - - if (pci && (long)pci->bits == CID_BITMAP_UNDEFINED) - glyphs = pci; - else { - if (!(glyphs = (CharInfoRec *)xalloc(sizeof(CharInfoRec)))) { - delmemory(); - xfree(pool); - *mode = AllocError; - return(NULL); - } - bzero(glyphs, sizeof(CharInfoRec)); - } - - S = (struct XYspace *) t1_Transform((struct xobject *)IDENTITY, - t1, t2, t3, t4); - - S = (struct XYspace *) Permanent(t1_Transform((struct xobject *)S, - cid->pixel_matrix[0], - -cid->pixel_matrix[1], - cid->pixel_matrix[2], - -cid->pixel_matrix[3])); - - /* multiplier for computation of raw values */ - sxmult = hypot(cid->pixel_matrix[0], cid->pixel_matrix[1]); - if (sxmult > EPS) sxmult = 1000.0 / sxmult; - - rc = 0; - area = (struct region *)CIDfontfcnC(S, charstringP, subarrayP, bluesP, - &len, &rc); - if (rc < 0 || area == NULL) { - delmemory(); - xfree(pool); - if (pci != glyphs) xfree(glyphs); - *mode = Type1ReturnCodeToXReturnCode(rc); - return(NULL); - } - - h = area->ymax - area->ymin; - w = area->xmax - area->xmin; - paddedW = PAD(w, pad); - - if (h > 0 && w > 0) { - size = h * paddedW / 8; - glyphs[0].bits = (char *)xalloc(size); - if (glyphs[0].bits == NULL) { - Destroy(area); - delmemory(); - xfree(pool); - if (pci != glyphs) xfree(glyphs); - *mode = AllocError; - return(NULL); - } - bzero(glyphs[0].bits, size); - } - else { - size = 0; - h = w = 0; - area->xmin = area->xmax = 0; - area->ymax = area->ymax = 0; - glyphs[0].bits = NULL; - } - - glyphs[0].metrics.leftSideBearing = area->xmin; - x1 = (double)(x0 = area->ending.x - area->origin.x); - y1 = (double)(area->ending.y - area->origin.y); - glyphs[0].metrics.characterWidth = - (x0 + (x0 > 0 ? FPHALF : -FPHALF)) / (1 << FRACTBITS); - if (!glyphs[0].metrics.characterWidth && size == 0) - { - /* Zero size and zero extents: presumably caused by - the choice of transformation. Let's create a - small bitmap so we're not mistaken for an undefined - character. */ - h = w = 1; - size = paddedW = PAD(w, pad); - glyphs[0].bits = (char *)xalloc(size); - if (glyphs[0].bits == NULL) { - Destroy(area); - delmemory(); - xfree(pool); - if (pci != glyphs) xfree(glyphs); - *mode = AllocError; - return(NULL); - } - bzero(glyphs[0].bits, size); - } - glyphs[0].metrics.attributes = - NEARESTPEL((long)(hypot(x1, y1) * sxmult)); - glyphs[0].metrics.rightSideBearing = w + area->xmin; - glyphs[0].metrics.descent = area->ymax - NEARESTPEL(area->origin.y); - glyphs[0].metrics.ascent = h - glyphs[0].metrics.descent; - - if (h > 0 && w > 0) - fill(glyphs[0].bits, h, paddedW, area, byte, bit, wordsize); - Destroy(area); - delmemory(); - xfree(pool); - *mode = Successful; - return(glyphs); -} -#endif diff --git a/nx-X11/lib/font/Type1/t1hdigit.h b/nx-X11/lib/font/Type1/t1hdigit.h deleted file mode 100644 index e05f0de5d..000000000 --- a/nx-X11/lib/font/Type1/t1hdigit.h +++ /dev/null @@ -1,40 +0,0 @@ -/* $Xorg: t1hdigit.h,v 1.3 2000/08/17 19:46:33 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM 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. - */ -/* Indicators for special characters in the p_hdigit.h tables */ -#define HERROR (0xfe) -#define HWHITE_SPACE (0xfd) -#define HRIGHT_ANGLE (0xfc) -#define LAST_HDIGIT (0xf0) - -/* Declarations for the tables */ -#define HighHexP (HighHex+1) -extern unsigned char HighHex[]; -#define LowHexP (LowHex+1) -extern unsigned char LowHex[]; diff --git a/nx-X11/lib/font/Type1/t1imager.h b/nx-X11/lib/font/Type1/t1imager.h deleted file mode 100644 index 9730f9a47..000000000 --- a/nx-X11/lib/font/Type1/t1imager.h +++ /dev/null @@ -1,84 +0,0 @@ -/* $Xorg: t1imager.h,v 1.3 2000/08/17 19:46:33 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/t1imager.h,v 1.4 2001/01/17 19:43:23 dawes Exp $ */ - - -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "regions.h" - -typedef struct xobject *xobject; -typedef struct segment *path; -typedef struct region *region; -typedef struct XYspace *XYspace; - - -#ifndef NULL -#include -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - - -#define WINDINGRULE -2 -#define EVENODDRULE -3 - -#define CONTINUITY 0x80 /* can be added to above rules; e.g. WINDINGRULE+CONTINUITY */ - - -/* -Generic null object definition: -*/ -#define NULLOBJECT ((xobject)NULL) - -/* -Null path definition: -*/ -#define NULLPATH NULLOBJECT - -/* -Full page and null region definition: -*/ -#define INFINITY t1_Infinity -#ifndef NOEXTERNS -extern region *INFINITY; -#endif -#define NULLREGION NULLOBJECT - -#define FF_PARSE_ERROR 5 -#define FF_PATH 1 - diff --git a/nx-X11/lib/font/Type1/t1info.c b/nx-X11/lib/font/Type1/t1info.c deleted file mode 100644 index 322572ee2..000000000 --- a/nx-X11/lib/font/Type1/t1info.c +++ /dev/null @@ -1,1096 +0,0 @@ -/* $Xorg: t1info.c,v 1.4 2001/02/09 02:04:01 xorgcvs Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License, subject to the license given below, 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software - * without specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - * Author: Carol H. Thompson IBM Almaden Research Center - * Modeled on spinfo.c by Dave Lemke, Network Computing Devices, Inc - * which contains the following copyright and permission notices: - * - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. Network Computing - * Devices and Digital make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or - * implied warranty. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/t1info.c,v 1.18tsi Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#include -#include -#ifndef FONTMODULE -#include -#ifndef BUILDCID -#include -#endif -#else -#include "xf86_ansic.h" -#endif -#include - -#if XFONT_CID -#ifndef FONTMODULE -#ifdef _XOPEN_SOURCE -#include -#else -#define _XOPEN_SOURCE -#include -#undef _XOPEN_SOURCE -#endif -#endif -#include "objects.h" -#include "spaces.h" -#include "range.h" -#endif - -#if XFONT_CID -#include "util.h" -#include "fontfcn.h" - -#if defined(HAVE_CFM) || defined(CID_ALL_CHARS) -#ifndef DEFAULT_CFM_DIR -#define DEFAULT_CFM_DIR "./" -#endif -char cfmDefaultDir[] = DEFAULT_CFM_DIR; -#define CFMMAGIC 0x91239123 -#endif -#endif -#include "t1intf.h" - -#define DECIPOINTSPERINCH 722.7 -#define DEFAULTRES 75 -#define DEFAULTPOINTSIZE 120 - -enum scaleType { - atom, truncate_atom, pixel_size, point_size, resolution_x, - resolution_y, average_width -}; - -#if XFONT_CID -extern cidfont *CIDFontP; -static int stdpropsinit = 0; - -typedef struct cfm_rec { - xCharInfo maxbounds; - xCharInfo minbounds; - xCharInfo ink_maxbounds; - xCharInfo ink_minbounds; - INT32 totalrw; - INT16 maxo; - INT16 alle; -} cfmrec; -#endif - -typedef struct _fontProp { - char *name; - long atom; - enum scaleType type; -} fontProp; - -static fontProp fontNamePropTable[] = { /* Example: */ - { "FOUNDRY", 0, atom }, /* adobe */ - { "FAMILY_NAME", 0, atom }, /* times roman */ - { "WEIGHT_NAME", 0, atom }, /* bold */ - { "SLANT", 0, atom }, /* i */ - { "SETWIDTH_NAME", 0, atom }, /* normal */ - { "ADD_STYLE_NAME", 0, atom }, /* */ - { "PIXEL_SIZE", 0, pixel_size }, /* 18 */ - { "POINT_SIZE", 0, point_size }, /* 180 */ - { "RESOLUTION_X", 0, resolution_x }, /* 72 */ - { "RESOLUTION_Y", 0, resolution_y }, /* 72 */ - { "SPACING", 0, atom }, /* p */ - { "AVERAGE_WIDTH", 0, average_width }, /* 0 */ - { "CHARSET_REGISTRY", 0, atom }, /* ISO8859 */ - { "CHARSET_ENCODING", 0, truncate_atom } /* 1 */ -}; - -/* NOTICE: Following array is closely related to the sequence of defines - following it. */ -static fontProp extraProps[] = { - { "FONT", 0, }, - { "COPYRIGHT", 0, }, - { "RAW_PIXEL_SIZE", 0, }, - { "RAW_POINT_SIZE", 0, }, - { "RAW_ASCENT", 0, }, - { "RAW_DESCENT", 0, }, - { "RAW_AVERAGE_WIDTH", 0, }, - { "FACE_NAME", 0, }, - { "FONT_TYPE", 0, }, - { "RASTERIZER_NAME", 0, } -}; - -/* this is a bit kludgy */ -#define FONTPROP 0 -#define COPYRIGHTPROP 1 -#define RAWPIXELPROP 2 -#define RAWPOINTPROP 3 -#define RAWASCENTPROP 4 -#define RAWDESCENTPROP 5 -#define RAWWIDTHPROP 6 -#define FACE_NAMEPROP 7 -#define FONT_TYPEPROP 8 -#define RASTERIZER_NAMEPROP 9 - -#define NNAMEPROPS (sizeof(fontNamePropTable) / sizeof(fontProp)) -#define NEXTRAPROPS (sizeof(extraProps) / sizeof(fontProp)) - -#define NPROPS (NNAMEPROPS + NEXTRAPROPS) - -/*ARGSUSED*/ -static void -FillHeader(FontInfoPtr pInfo, FontScalablePtr Vals) -{ - /* OpenScalable in T1FUNCS sets the following: - pInfo->firstCol, - pInfo->firstRow, - pInfo->lastCol, and - pInfo->lastRow. */ - /* the following are ununsed - pInfo->pad. */ - - /* Items we should handle better someday +++ */ - pInfo->defaultCh = 0; - pInfo->drawDirection = LeftToRight; - if (Vals->point_matrix[0] == Vals->point_matrix[3]) - pInfo->anamorphic = 0; - else - pInfo->anamorphic = 1; - pInfo->inkMetrics = 0; /* no ink metrics here */ - pInfo->cachable = 1; /* no licensing (yet) */ -} - -static void -adjust_min_max(xCharInfo *minc, xCharInfo *maxc, xCharInfo *tmp) -{ -#define MINMAX(field,ci) \ - if (minc->field > (ci)->field) \ - minc->field = (ci)->field; \ - if (maxc->field < (ci)->field) \ - maxc->field = (ci)->field; - - MINMAX(ascent, tmp); - MINMAX(descent, tmp); - MINMAX(leftSideBearing, tmp); - MINMAX(rightSideBearing, tmp); - MINMAX(characterWidth, tmp); - - /* Do MINMAX for attributes field. Since that field is CARD16, - we'll cast to a signed integer */ - if ((INT16)minc->attributes > (INT16)tmp->attributes) - minc->attributes = tmp->attributes; - if ((INT16)maxc->attributes < (INT16)tmp->attributes) - maxc->attributes = tmp->attributes; - -#undef MINMAX -} - -static void -ComputeBounds(FontInfoPtr pInfo, CharInfoPtr pChars, FontScalablePtr Vals) -{ - int i; - xCharInfo minchar, maxchar; - int numchars = 0; - int totchars; - int overlap; - int maxlap; - - minchar.ascent = minchar.descent = - minchar.leftSideBearing = minchar.rightSideBearing = - minchar.characterWidth = minchar.attributes = 32767; - maxchar.ascent = maxchar.descent = - maxchar.leftSideBearing = maxchar.rightSideBearing = - maxchar.characterWidth = maxchar.attributes = -32767; - - maxlap = -32767; - totchars = pInfo->lastCol - pInfo->firstCol + 1; - pChars += pInfo->firstCol; - pInfo->allExist = 1; - for (i = 0; i < totchars; i++,pChars++) { - xCharInfo *pmetrics = &pChars->metrics; - - if (pmetrics->attributes || - pmetrics->ascent != -pmetrics->descent || - pmetrics->leftSideBearing != pmetrics->rightSideBearing) { - numchars++; - adjust_min_max(&minchar, &maxchar, pmetrics); - overlap = pmetrics->rightSideBearing - pmetrics->characterWidth; - if (overlap > maxlap) maxlap = overlap; - } - else pInfo->allExist = 0; - } - - /* If we're monospaced, round the average width field to the - nearest pixel */ - if (minchar.characterWidth == maxchar.characterWidth) - Vals->width = minchar.characterWidth * 10; - - pInfo->maxbounds = maxchar; - pInfo->minbounds = minchar; - pInfo->ink_maxbounds = maxchar; - pInfo->ink_minbounds = minchar; - pInfo->maxOverlap = maxlap + -(minchar.leftSideBearing); - - /* Set the pInfo flags */ - /* Properties set by FontComputeInfoAccelerators: - pInfo->noOverlap; - pInfo->terminalFont; - pInfo->constantMetrics; - pInfo->constantWidth; - pInfo->inkInside; - - */ - FontComputeInfoAccelerators (pInfo); -} - -#if XFONT_CID -#ifdef CID_ALL_CHARS -void -ComputeBoundsAllChars(FontPtr pFont, char *cfmfilename, double sxmult) -{ - FILE *cfm; - CARD32 magic; - int count = 0; - int maxlap, overlap, i, j, k, ret; - xCharInfo minchar, maxchar; - cidrange *cidrangeP; - unsigned char ccode[2]; - unsigned long ccount; - xCharInfo *pmetrics; - long total_raw_width = 0, total_width = 0; - char cfmd[CID_PATH_MAX]; - cfmrec *cfmp; - char *p; - - if (!(cfm = fopen(cfmfilename, "w"))) { - fprintf(stderr, - "Unable to open the file %s. You are probably not logged in as root.\n", - cfmfilename); - p = strrchr(cfmfilename, '/'); - if (p == NULL) exit(1); - strcpy(cfmd, cfmDefaultDir); - strcat(cfmd, p + 1); - if (!(cfm = fopen(cfmd, "w"))) { - fprintf(stderr, - "Switching to current directory. Unable to open the file %s.\n", - cfmd); - exit(1); - } - } - - if ((cfmp = (cfmrec *)xalloc(sizeof(cfmrec))) == NULL) { - fprintf(stderr, "Unable to allocate memory."); - exit(1); - } - bzero(cfmp, sizeof(cfmrec)); - - minchar.ascent = minchar.descent = - minchar.leftSideBearing = minchar.rightSideBearing = - minchar.characterWidth = minchar.attributes = 32767; - maxchar.ascent = maxchar.descent = - maxchar.leftSideBearing = maxchar.rightSideBearing = - maxchar.characterWidth = maxchar.attributes = -32767; - - maxlap = -32767; - cfmp->alle = 1; - cidrangeP = CIDFontP->cidrangeP; - - /* go through all character codes specified in a given CMap */ - for (i = 0; i < CIDFontP->cidrangecnt; i++) { - for (j = 0; j < cidrangeP->rangecnt; j++) { - for (k = cidrangeP->range[j].srcCodeLo; - k <= cidrangeP->range[j].srcCodeHi; k++) { - ccode[0] = (k >> 8) & 0xff; - ccode[1] = k & 0xff; - ret = CIDGetMetrics(pFont, 1, ccode, Linear16Bit, &ccount, &pmetrics); - if (ret != Successful || (ret == Successful && pmetrics == NULL)) - continue; - total_width += pmetrics->attributes; - total_raw_width += abs((int)(INT16)pmetrics->attributes); - if (pmetrics->attributes || - pmetrics->ascent != -pmetrics->descent || - pmetrics->leftSideBearing != pmetrics->rightSideBearing) { - count++; - adjust_min_max(&minchar, &maxchar, pmetrics); - overlap = pmetrics->rightSideBearing - pmetrics->characterWidth; - if (overlap > maxlap) maxlap = overlap; - } - else cfmp->alle = 0; - } - } - } - - if (count) - { - total_raw_width = (total_raw_width * 10 + count / 2) / count; - if (total_width < 0) - { - /* Predominant direction is R->L */ - total_raw_width = -total_raw_width; - } - } - - cfmp->totalrw = (INT32)total_raw_width; - - cfmp->maxbounds.leftSideBearing = - floor((double)maxchar.leftSideBearing * sxmult + 0.5); - cfmp->maxbounds.rightSideBearing = - floor((double)maxchar.rightSideBearing * sxmult + 0.5); - cfmp->maxbounds.characterWidth = - floor((double)maxchar.characterWidth * sxmult + 0.5); - cfmp->maxbounds.ascent = - floor((double)maxchar.ascent * sxmult + 0.5); - cfmp->maxbounds.descent = - floor((double)maxchar.descent * sxmult); - cfmp->maxbounds.attributes = maxchar.attributes; - - cfmp->minbounds.leftSideBearing = - floor((double)minchar.leftSideBearing * sxmult + 0.5); - cfmp->minbounds.rightSideBearing = - floor((double)minchar.rightSideBearing * sxmult + 0.5); - cfmp->minbounds.characterWidth = - floor((double)minchar.characterWidth * sxmult + 0.5); - cfmp->minbounds.ascent = - floor((double)minchar.ascent * sxmult + 0.5); - cfmp->minbounds.descent = - floor((double)minchar.descent * sxmult + 0.5); - cfmp->minbounds.attributes = minchar.attributes; - - cfmp->ink_maxbounds.leftSideBearing = - floor((double)maxchar.leftSideBearing * sxmult + 0.5); - cfmp->ink_maxbounds.rightSideBearing = - floor((double)maxchar.rightSideBearing * sxmult + 0.5); - cfmp->ink_maxbounds.characterWidth = - floor((double)maxchar.characterWidth * sxmult + 0.5); - cfmp->ink_maxbounds.ascent = - floor((double)maxchar.ascent * sxmult + 0.5); - cfmp->ink_maxbounds.descent = - floor((double)maxchar.descent * sxmult + 0.5); - cfmp->ink_maxbounds.attributes = maxchar.attributes; - - cfmp->ink_minbounds.leftSideBearing = - floor((double)minchar.leftSideBearing * sxmult + 0.5); - cfmp->ink_minbounds.rightSideBearing = - floor((double)minchar.rightSideBearing * sxmult + 0.5); - cfmp->ink_minbounds.characterWidth = - floor((double)minchar.characterWidth * sxmult + 0.5); - cfmp->ink_minbounds.ascent = - floor((double)minchar.ascent * sxmult + 0.5); - cfmp->ink_minbounds.descent = - floor((double)minchar.descent * sxmult + 0.5); - cfmp->ink_minbounds.attributes = minchar.attributes; - - cfmp->maxo = (INT32)(maxlap + -(minchar.leftSideBearing)); - - magic = CFMMAGIC; - fwrite(&magic, sizeof(CARD32), 1, cfm); - fwrite(cfmp, sizeof(cfmrec), 1, cfm); - xfree(cfmp); - fclose(cfm); -} -#else -static long -ComputeBoundsAll(FontPtr pFont) -{ - int count = 0; - int maxlap, overlap, i, j, k, ret; - xCharInfo minchar, maxchar; - cidrange *cidrangeP; - unsigned char ccode[2]; - unsigned long ccount; - xCharInfo *pmetrics; - CharInfoRec *cinfo[1]; - long total_raw_width = 0, total_width = 0; - FontInfoPtr pInfo = &(pFont->info); - - minchar.ascent = minchar.descent = - minchar.leftSideBearing = minchar.rightSideBearing = - minchar.characterWidth = minchar.attributes = 32767; - maxchar.ascent = maxchar.descent = - maxchar.leftSideBearing = maxchar.rightSideBearing = - maxchar.characterWidth = maxchar.attributes = -32767; - - maxlap = -32767; - pInfo->allExist = 1; - cidrangeP = CIDFontP->cidrangeP; - - /* go through all character codes specified in a given CMap */ - for (i = 0; i < CIDFontP->cidrangecnt; i++) { - for (j = 0; j < cidrangeP->rangecnt; j++) { - for (k = cidrangeP->range[j].srcCodeLo; - k <= cidrangeP->range[j].srcCodeHi; k++) { - ccode[0] = (k >> 8) & 0xff; - ccode[1] = k & 0xff; - ret = CIDGetMetrics(pFont, 1, ccode, Linear16Bit, &ccount, (xCharInfo **)cinfo); - if (ret != Successful || cinfo == NULL) - continue; - pmetrics = &cinfo[0]->metrics; - total_width += pmetrics->attributes; - total_raw_width += abs((int)(INT16)pmetrics->attributes); - if (pmetrics->attributes || - pmetrics->ascent != -pmetrics->descent || - pmetrics->leftSideBearing != pmetrics->rightSideBearing) { - count++; - adjust_min_max(&minchar, &maxchar, pmetrics); - overlap = pmetrics->rightSideBearing - pmetrics->characterWidth; - if (overlap > maxlap) maxlap = overlap; - } - else pInfo->allExist = 0; - } - } - } - - if (count) - { - total_raw_width = (total_raw_width * 10 + count / 2) / count; - if (total_width < 0) - { - /* Predominant direction is R->L */ - total_raw_width = -total_raw_width; - } - } - - pInfo->maxbounds.leftSideBearing = maxchar.leftSideBearing; - pInfo->maxbounds.rightSideBearing = maxchar.rightSideBearing; - pInfo->maxbounds.characterWidth = maxchar.characterWidth; - pInfo->maxbounds.ascent = maxchar.ascent; - pInfo->maxbounds.descent = maxchar.descent; - pInfo->maxbounds.attributes = maxchar.attributes; - - pInfo->minbounds.leftSideBearing = minchar.leftSideBearing; - pInfo->minbounds.rightSideBearing = minchar.rightSideBearing; - pInfo->minbounds.characterWidth = minchar.characterWidth; - pInfo->minbounds.ascent = minchar.ascent; - pInfo->minbounds.descent = minchar.descent; - pInfo->minbounds.attributes = minchar.attributes; - - pInfo->ink_maxbounds.leftSideBearing = maxchar.leftSideBearing; - pInfo->ink_maxbounds.rightSideBearing = maxchar.rightSideBearing; - pInfo->ink_maxbounds.characterWidth = maxchar.characterWidth; - pInfo->ink_maxbounds.ascent = maxchar.ascent; - pInfo->ink_maxbounds.descent = maxchar.descent; - pInfo->ink_maxbounds.attributes = maxchar.attributes; - - pInfo->ink_minbounds.leftSideBearing = minchar.leftSideBearing; - pInfo->ink_minbounds.rightSideBearing = minchar.rightSideBearing; - pInfo->ink_minbounds.characterWidth = minchar.characterWidth; - pInfo->ink_minbounds.ascent = minchar.ascent; - pInfo->ink_minbounds.descent = minchar.descent; - pInfo->ink_minbounds.attributes = minchar.attributes; - - pInfo->maxOverlap = maxlap + -(minchar.leftSideBearing); - - return total_raw_width; -} -#endif -#endif - -static void -ComputeProps(FontInfoPtr pInfo, FontScalablePtr Vals, char *Filename, - long *sAscent, long *sDescent) -{ - int infoint; - int infoBBox[4]; - int rc; - - QueryFontLib(Filename, "isFixedPitch", &infoint, &rc); - if (!rc) { - pInfo->constantWidth = infoint; - } - QueryFontLib((char *)0, "FontBBox", infoBBox, &rc); - if (!rc) { - pInfo->fontAscent = - (int)((double)infoBBox[3] * Vals->pixel_matrix[3] + - (infoBBox[3] > 0 ? 500 : -500)) / 1000; - pInfo->fontDescent = - -(int)((double)infoBBox[1] * Vals->pixel_matrix[3] + - (infoBBox[1] > 0 ? 500 : -500)) / 1000; - *sAscent = infoBBox[3]; - *sDescent = -infoBBox[1]; - } -} - -#if XFONT_CID -#ifndef CID_ALL_CHARS -static void -CIDComputeStdProps(FontInfoPtr pInfo, FontScalablePtr Vals, - char *Filename, char *Cmapname, char *Fontname, - long sAscent, long sDescent, long sWidth) -{ - FontPropPtr pp; - int i, - nprops; - fontProp *fpt; - char *is_str; - char *ptr1 = NULL, - *ptr2; - char *ptr3; - char *infostrP; - int rc; - char scaledName[CID_PATH_MAX]; - - strcpy (scaledName, Fontname); - /* Fill in our copy of the fontname from the Vals structure */ - FontParseXLFDName (scaledName, Vals, FONT_XLFD_REPLACE_VALUE); - - /* This form of the properties is used by the X-client; the X-server - doesn't care what they are. */ - nprops = pInfo->nprops = NPROPS; - pInfo->isStringProp = (char *) xalloc(sizeof(char) * nprops); - pInfo->props = (FontPropPtr) xalloc(sizeof(FontPropRec) * nprops); - if (!pInfo->isStringProp || !pInfo->props) { - xfree(pInfo->isStringProp); - pInfo->isStringProp = (char *) 0; - xfree(pInfo->props); - pInfo->props = (FontPropPtr) 0; - pInfo->nprops = 0; - return; - } - bzero(pInfo->isStringProp, (sizeof(char) * nprops)); - - ptr2 = scaledName; - for (i = NNAMEPROPS, pp = pInfo->props, fpt = fontNamePropTable, is_str = pInfo->isStringProp; - i; - i--, pp++, fpt++, is_str++) { - - if (*ptr2) - { - ptr1 = ptr2 + 1; - if (!(ptr2 = strchr(ptr1, '-'))) ptr2 = strchr(ptr1, '\0'); - } - - pp->name = fpt->atom; - switch (fpt->type) { - case atom: /* Just copy info from scaledName */ - *is_str = TRUE; - pp->value = MakeAtom(ptr1, ptr2 - ptr1, TRUE); - break; - case truncate_atom: - *is_str = TRUE; - for (ptr3 = ptr1; *ptr3; ptr3++) - if (*ptr3 == '[') - break; - pp->value = MakeAtom(ptr1, ptr3 - ptr1, TRUE); - break; - case pixel_size: - pp->value = (int)(fabs(Vals->pixel_matrix[3]) + .5); - break; - case point_size: - pp->value = (int)(fabs(Vals->point_matrix[3]) * 10.0 + .5); - break; - case resolution_x: - pp->value = Vals->x; - break; - case resolution_y: - pp->value = Vals->y; - break; - case average_width: - pp->value = Vals->width; - break; - } - } - - for (i = 0, fpt = extraProps; - i < NEXTRAPROPS; - i++, is_str++, pp++, fpt++) { - pp->name = fpt->atom; - switch (i) { - case FONTPROP: - *is_str = TRUE; - pp->value = MakeAtom(scaledName, strlen(scaledName), TRUE); - break; - case COPYRIGHTPROP: - *is_str = TRUE; - CIDQueryFontLib(Filename, Cmapname, "Notice", &infostrP, &rc); - if (rc || !infostrP) { - infostrP = "Copyright Notice not available"; - } - pp->value = MakeAtom(infostrP, strlen(infostrP), TRUE); - break; - case FACE_NAMEPROP: - *is_str = TRUE; - CIDQueryFontLib(Filename, Cmapname, "CIDFontName", &infostrP, &rc); - if (rc || !infostrP) { - infostrP = "(unknown)"; - } - pp->value = MakeAtom(infostrP, strlen(infostrP), TRUE); - break; - case FONT_TYPEPROP: - *is_str = TRUE; - infostrP = "CIDFont"; - pp->value = MakeAtom(infostrP, strlen(infostrP), TRUE); - break; - case RASTERIZER_NAMEPROP: - *is_str = TRUE; - infostrP = "X Consortium Type 1 Rasterizer"; - pp->value = MakeAtom(infostrP, strlen(infostrP), TRUE); - break; - case RAWPIXELPROP: - *is_str = FALSE; - pp->value = 1000; - break; - case RAWPOINTPROP: - *is_str = FALSE; - pp->value = (long)(72270.0 / (double)Vals->y + .5); - break; - case RAWASCENTPROP: - *is_str = FALSE; - pp->value = sAscent; - break; - case RAWDESCENTPROP: - *is_str = FALSE; - pp->value = sDescent; - break; - case RAWWIDTHPROP: - *is_str = FALSE; - pp->value = sWidth; - break; - } - } -} -#endif -#endif - -static void -ComputeStdProps(FontInfoPtr pInfo, FontScalablePtr Vals, - char *Filename, char *Fontname, - long sAscent, long sDescent, long sWidth) -{ - FontPropPtr pp; - int i, - nprops; - fontProp *fpt; - char *is_str; - char *ptr1 = NULL, - *ptr2; - char *ptr3; - char *infostrP; - int rc; - char scaledName[MAXFONTNAMELEN]; - - strcpy (scaledName, Fontname); - /* Fill in our copy of the fontname from the Vals structure */ - FontParseXLFDName (scaledName, Vals, FONT_XLFD_REPLACE_VALUE); - - /* This form of the properties is used by the X-client; the X-server - doesn't care what they are. */ - nprops = pInfo->nprops = NPROPS; - pInfo->isStringProp = (char *) xalloc(sizeof(char) * nprops); - pInfo->props = (FontPropPtr) xalloc(sizeof(FontPropRec) * nprops); - if (!pInfo->isStringProp || !pInfo->props) { - xfree(pInfo->isStringProp); - pInfo->isStringProp = (char *) 0; - xfree(pInfo->props); - pInfo->props = (FontPropPtr) 0; - return; - } - bzero(pInfo->isStringProp, (sizeof(char) * nprops)); - - ptr2 = scaledName; - for (i = NNAMEPROPS, pp = pInfo->props, fpt = fontNamePropTable, is_str = pInfo->isStringProp; - i; - i--, pp++, fpt++, is_str++) { - - if (*ptr2) - { - ptr1 = ptr2 + 1; - if (!(ptr2 = strchr(ptr1, '-'))) ptr2 = strchr(ptr1, '\0'); - } - - pp->name = fpt->atom; - switch (fpt->type) { - case atom: /* Just copy info from scaledName */ - *is_str = TRUE; - pp->value = MakeAtom(ptr1, ptr2 - ptr1, TRUE); - break; - case truncate_atom: - *is_str = TRUE; - for (ptr3 = ptr1; *ptr3; ptr3++) - if (*ptr3 == '[') - break; - pp->value = MakeAtom(ptr1, ptr3 - ptr1, TRUE); - break; - case pixel_size: - pp->value = (int)(fabs(Vals->pixel_matrix[3]) + .5); - break; - case point_size: - pp->value = (int)(fabs(Vals->point_matrix[3]) * 10.0 + .5); - break; - case resolution_x: - pp->value = Vals->x; - break; - case resolution_y: - pp->value = Vals->y; - break; - case average_width: - pp->value = Vals->width; - break; - } - } - - for (i = 0, fpt = extraProps; - i < NEXTRAPROPS; - i++, is_str++, pp++, fpt++) { - pp->name = fpt->atom; - switch (i) { - case FONTPROP: - *is_str = TRUE; - pp->value = MakeAtom(scaledName, strlen(scaledName), TRUE); - break; - case COPYRIGHTPROP: - *is_str = TRUE; - QueryFontLib(Filename, "Notice", &infostrP, &rc); - if (rc || !infostrP) { - infostrP = "Copyright Notice not available"; - } - pp->value = MakeAtom(infostrP, strlen(infostrP), TRUE); - break; - case FACE_NAMEPROP: - *is_str = TRUE; - QueryFontLib(Filename, "FontName", &infostrP, &rc); - if (rc || !infostrP) { - infostrP = "(unknown)"; - } - pp->value = MakeAtom(infostrP, strlen(infostrP), TRUE); - break; - case FONT_TYPEPROP: - *is_str = TRUE; - infostrP = "Type 1"; - pp->value = MakeAtom(infostrP, strlen(infostrP), TRUE); - break; - case RASTERIZER_NAMEPROP: - *is_str = TRUE; - infostrP = "X Consortium Type 1 Rasterizer"; - pp->value = MakeAtom(infostrP, strlen(infostrP), TRUE); - break; - case RAWPIXELPROP: - *is_str = FALSE; - pp->value = 1000; - break; - case RAWPOINTPROP: - *is_str = FALSE; - pp->value = (long)(72270.0 / (double)Vals->y + .5); - break; - case RAWASCENTPROP: - *is_str = FALSE; - pp->value = sAscent; - break; - case RAWDESCENTPROP: - *is_str = FALSE; - pp->value = sDescent; - break; - case RAWWIDTHPROP: - *is_str = FALSE; - pp->value = sWidth; - break; - } - } -} - -#if XFONT_CID -/*ARGSUSED*/ -int -CIDGetInfoScalable(FontPathElementPtr fpe, - FontInfoPtr pInfo, - FontEntryPtr entry, - FontNamePtr fontName, - char *fileName, - FontScalablePtr Vals) -{ - FontPtr pfont; - int flags = 0; - long format = 0; /* It doesn't matter what format for just info */ - long fmask = 0; - int ret; - - ret = CIDOpenScalable(fpe, &pfont, flags, entry, fileName, Vals, - format, fmask, NULL); - if (ret != Successful) - return ret; - *pInfo = pfont->info; - - /* XXX - Set pointers in pfont->info to NULL so they are not freed. */ - pfont->info.props = NULL; - pfont->info.isStringProp = NULL; - - CIDCloseFont(pfont); - return Successful; -} -#endif - -/*ARGSUSED*/ -int -Type1GetInfoScalable(FontPathElementPtr fpe, - FontInfoPtr pInfo, - FontEntryPtr entry, - FontNamePtr fontName, - char *fileName, - FontScalablePtr Vals) -{ - FontPtr pfont; - int flags = 0; - long format = 0; /* It doesn't matter what format for just info */ - long fmask = 0; - int ret; - - ret = Type1OpenScalable(fpe, &pfont, flags, entry, fileName, Vals, - format, fmask , NULL); - if (ret != Successful) - return ret; - *pInfo = pfont->info; - - /* XXX - Set pointers in pfont->info to NULL so they are not freed. */ - pfont->info.props = NULL; - pfont->info.isStringProp = NULL; - - Type1CloseFont(pfont); - return Successful; -} - -#if XFONT_CID -#ifndef CID_ALL_CHARS -void -CIDFillFontInfo(FontPtr pFont, FontScalablePtr Vals, - char *Filename, char *Fontname, char *Cmapname, -#ifdef HAVE_CFM - char *cfmfilename, -#endif - long sAscent, long sDescent, double sxmult) -{ -#ifdef HAVE_CFM - FILE *cfm; - cfmrec *cfmp; - int gotcfm = 0; - CARD32 magic; -#endif - long sWidth = 0; - FontInfoPtr pInfo = &pFont->info; - - FillHeader(pInfo, Vals); - -#ifdef HAVE_CFM - if ((cfm = fopen(cfmfilename,"r"))) { - fread(&magic,sizeof(CARD32),1,cfm); - if(magic == CFMMAGIC) { - if ((cfmp = (cfmrec *)xalloc(sizeof(cfmrec))) != NULL) { - fread(cfmp,sizeof(cfmrec),1,cfm); - sWidth = (long)cfmp->totalrw; - pInfo->allExist = cfmp->alle; - if (sxmult != 0) { - pInfo->maxbounds.leftSideBearing = - floor((double)cfmp->maxbounds.leftSideBearing / - sxmult + 0.5); - pInfo->maxbounds.rightSideBearing = - floor((double)cfmp->maxbounds.rightSideBearing / - sxmult + 0.5); - pInfo->maxbounds.characterWidth = - floor((double)cfmp->maxbounds.characterWidth / - sxmult + 0.5); - pInfo->maxbounds.ascent = - floor((double)cfmp->maxbounds.ascent / - sxmult + 0.5); - pInfo->maxbounds.descent = - floor((double)cfmp->maxbounds.descent / - sxmult + 0.5); - pInfo->maxbounds.attributes = - cfmp->maxbounds.attributes; - - pInfo->minbounds.leftSideBearing = - cfmp->minbounds.leftSideBearing / sxmult; - pInfo->minbounds.rightSideBearing = - cfmp->minbounds.rightSideBearing / sxmult; - pInfo->minbounds.characterWidth = - cfmp->minbounds.characterWidth / sxmult; - pInfo->minbounds.ascent = - cfmp->minbounds.ascent / sxmult; - pInfo->minbounds.descent = - cfmp->minbounds.descent / sxmult; - pInfo->minbounds.attributes = cfmp->minbounds.attributes; - - pInfo->ink_maxbounds.leftSideBearing = - cfmp->ink_maxbounds.leftSideBearing / sxmult; - pInfo->ink_maxbounds.rightSideBearing = - cfmp->ink_maxbounds.rightSideBearing / sxmult; - pInfo->ink_maxbounds.characterWidth = - cfmp->ink_maxbounds.characterWidth / sxmult; - pInfo->ink_maxbounds.ascent = - cfmp->ink_maxbounds.ascent / sxmult; - pInfo->ink_maxbounds.descent = - cfmp->ink_maxbounds.descent / sxmult; - pInfo->ink_maxbounds.attributes = - cfmp->ink_maxbounds.attributes; - - pInfo->ink_minbounds.leftSideBearing = - cfmp->ink_minbounds.leftSideBearing / sxmult; - pInfo->ink_minbounds.rightSideBearing = - cfmp->ink_minbounds.rightSideBearing / sxmult; - pInfo->ink_minbounds.characterWidth = - cfmp->ink_minbounds.characterWidth / sxmult; - pInfo->ink_minbounds.ascent = - cfmp->ink_minbounds.ascent / sxmult; - pInfo->ink_minbounds.descent = - cfmp->ink_minbounds.descent / sxmult; - pInfo->ink_minbounds.attributes = - cfmp->ink_minbounds.attributes; - pInfo->ink_minbounds.attributes = - cfmp->ink_minbounds.attributes; - - pInfo->maxOverlap = (short)cfmp->maxo; - - gotcfm = 1; - } - xfree(cfmp); - } - } - fclose(cfm); - } - - if (!gotcfm) -#endif - sWidth = ComputeBoundsAll(pFont); - - FontComputeInfoAccelerators(pInfo); - - CIDComputeStdProps(pInfo, Vals, Filename, Cmapname, Fontname, sAscent, - sDescent, sWidth); -} -#endif /* CID_ALL_CHARS */ -#endif /* BUILDCID */ - -void -T1FillFontInfo(FontPtr pFont, FontScalablePtr Vals, - char *Filename, char *Fontname, long sWidth) -{ - FontInfoPtr pInfo = &pFont->info; - struct type1font *p = (struct type1font *)pFont->fontPrivate; - long sAscent, sDescent; /* Scalable 1000-pixel values */ - - FillHeader(pInfo, Vals); - - ComputeBounds(pInfo, p->glyphs, Vals); - - ComputeProps(pInfo, Vals, Filename, &sAscent, &sDescent); - ComputeStdProps(pInfo, Vals, Filename, Fontname, sAscent, sDescent, sWidth); -} - -/* Called once, at renderer registration time */ -void -#if XFONT_CID -Type1InitStdProps(void) -#else -T1InitStdProps(void) -#endif -{ - int i; - fontProp *t; - -#if XFONT_CID - if (!stdpropsinit) { - stdpropsinit = 1; - i = sizeof(fontNamePropTable) / sizeof(fontProp); - for (t = fontNamePropTable; i; i--, t++) - t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE); - i = sizeof(extraProps) / sizeof(fontProp); - for (t = extraProps; i; i--, t++) - t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE); - } -#else - i = sizeof(fontNamePropTable) / sizeof(fontProp); - for (t = fontNamePropTable; i; i--, t++) - t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE); - i = sizeof(extraProps) / sizeof(fontProp); - for (t = extraProps; i; i--, t++) - t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE); -#endif -} diff --git a/nx-X11/lib/font/Type1/t1intf.h b/nx-X11/lib/font/Type1/t1intf.h deleted file mode 100644 index 831acc55d..000000000 --- a/nx-X11/lib/font/Type1/t1intf.h +++ /dev/null @@ -1,143 +0,0 @@ -/* $Xorg: t1intf.h,v 1.3 2000/08/17 19:46:33 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/t1intf.h,v 1.6 2001/01/17 19:43:23 dawes Exp $ */ - -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#if XFONT_CID -#include "AFM.h" -#endif - -struct type1font { - CharInfoPtr pDefault; - CharInfoRec glyphs[256]; -}; - -#if XFONT_CID -typedef struct cid_glyphs { - char *CIDFontName; - char *CMapName; - long dataoffset; - double pixel_matrix[4]; - CharInfoPtr pDefault; - CharInfoRec **glyphs; - FontInfo *AFMinfo; -#ifdef USE_MMAP - unsigned char *CIDdata; - long CIDsize; -#endif -} cidglyphs; -#endif - -/* - * Function prototypes - */ -/* t1funcs.c */ -#if XFONT_CID -extern int CIDOpenScalable ( FontPathElementPtr fpe, FontPtr *ppFont, - int flags, FontEntryPtr entry, char *fileName, - FontScalablePtr vals, fsBitmapFormat format, - fsBitmapFormatMask fmask, - FontPtr non_cachable_font ); -#endif -extern int Type1OpenScalable ( FontPathElementPtr fpe, FontPtr *ppFont, - int flags, FontEntryPtr entry, char *fileName, - FontScalablePtr vals, fsBitmapFormat format, - fsBitmapFormatMask fmask, - FontPtr non_cachable_font ); -#if XFONT_CID -extern unsigned int getCID ( FontPtr pFont, unsigned int charcode ); -extern int CIDGetGlyphs ( FontPtr pFont, unsigned long count, - unsigned char *chars, FontEncoding charEncoding, - unsigned long *glyphCount, CharInfoPtr *glyphs ); -extern int CIDGetMetrics ( FontPtr pFont, unsigned long count, - unsigned char *chars, FontEncoding charEncoding, - unsigned long *glyphCount, xCharInfo **glyphs ); -extern void CIDCloseFont ( FontPtr pFont ); -#endif -extern void Type1CloseFont ( FontPtr pFont ); -extern int Type1ReturnCodeToXReturnCode ( int rc ); -#if XFONT_CID -extern CharInfoPtr CIDRenderGlyph ( FontPtr pFont, psobj *charstringP, - psobj *subarrayP, - struct blues_struct *bluesP, - CharInfoPtr pci, int *mode ); -#endif - -/* t1info.c */ -#ifdef CID_ALL_CHARS -extern void ComputeBoundsAllChars ( FontPtr pFont, char *cfmfilename, double sxmult ); -#endif -#if XFONT_CID -extern int CIDGetInfoScalable ( FontPathElementPtr fpe, FontInfoPtr pInfo, - FontEntryPtr entry, FontNamePtr fontName, - char *fileName, FontScalablePtr Vals ); -#endif -extern int Type1GetInfoScalable ( FontPathElementPtr fpe, FontInfoPtr pInfo, - FontEntryPtr entry, FontNamePtr fontName, - char *fileName, FontScalablePtr Vals ); -#if XFONT_CID -extern void CIDFillFontInfo ( FontPtr pFont, FontScalablePtr Vals, - char *Filename, char *Fontname, char *Cmapname, -#ifdef HAVE_CFM - char *cfmfilename, -#endif - long sAscent, long sDescent, double sxmult ); -#endif -extern void T1FillFontInfo ( FontPtr pFont, FontScalablePtr Vals, - char *Filename, char *Fontname, long sWidth ); -extern void Type1InitStdProps ( void ); - -/* cidchar.c */ -extern CharInfoPtr CIDGetGlyphInfo ( FontPtr pFont, unsigned int cidcode, - CharInfoPtr pci, int *rc ); -extern int CIDGetAFM ( FontPtr pFont, unsigned long count, - unsigned char *chars, FontEncoding charEncoding, - unsigned long *glyphCount, CharInfoPtr *glyphs, - char *cidafmfile ); diff --git a/nx-X11/lib/font/Type1/t1io.c b/nx-X11/lib/font/Type1/t1io.c deleted file mode 100644 index 42b8bb6be..000000000 --- a/nx-X11/lib/font/Type1/t1io.c +++ /dev/null @@ -1,388 +0,0 @@ -/* $Xorg: t1io.c,v 1.3 2000/08/17 19:46:33 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * Author: Carol H. Thompson IBM Almaden Research Center - */ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/t1io.c,v 3.8 2001/01/17 19:43:23 dawes Exp $ */ -/******************************************************************* -* I/O package for Type 1 font reading -********************************************************************/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#ifndef STATIC -#define STATIC static -#endif - -#ifndef FONTMODULE -#include -#include -#else -#include "Xdefs.h" -#include "Xmd.h" /* INT32 declaration */ -#include "xf86_ansic.h" -#endif -#include "t1stdio.h" -#include "t1hdigit.h" -#ifdef WIN32 -#include -#endif -#include - -/* Constants and variables used in the decryption */ -#define c1 ((unsigned short)52845) -#define c2 ((unsigned short)22719) -static unsigned short r; -static int asc, Decrypt; -static int extrach; -static int haveextrach; - -/* Our single FILE structure and buffer for this package */ -STATIC F_FILE TheFile; -STATIC unsigned char TheBuffer[F_BUFSIZ]; - -/* Our routines */ -static int T1Decrypt ( unsigned char *p, int len ); -static int T1Fill ( F_FILE *f ); - -#if XFONT_CID -void -resetDecrypt(void) -{ - Decrypt = 0; -} -#endif - -/* -------------------------------------------------------------- */ -/*ARGSUSED*/ -F_FILE * -T1Open(char *fn, /* Pointer to filename */ - char *mode) /* Pointer to open mode string */ -{ - F_FILE *of = &TheFile; - int oflags = O_RDONLY; /* We know we are only reading */ - - Decrypt = 0; - -#ifdef O_BINARY /* VMS or DOS */ - oflags |= O_BINARY; -#endif - of->fd = open(fn, oflags, 0); - if (of->fd < 0) - return NULL; - - /* Initialize the buffer information of our file descriptor */ - of->b_base = TheBuffer; - of->b_size = F_BUFSIZ; - of->b_ptr = NULL; - of->b_cnt = 0; - of->flags = 0; - of->error = 0; - haveextrach = 0; - return &TheFile; -} /* end Open */ - -/* -------------------------------------------------------------- */ -int /* Read one character */ -T1Getc(F_FILE *f) /* Stream descriptor */ -{ - if (f->b_base == NULL) return EOF; /* already closed */ - - if (f->flags & UNGOTTENC) { /* there is an ungotten c */ - f->flags &= ~UNGOTTENC; - return (int) f->ungotc; - } - - if (f->b_cnt == 0) /* Buffer needs to be (re)filled */ - f->b_cnt = T1Fill(f); - if (f->b_cnt > 0) return (f->b_cnt--, (int) *(f->b_ptr++)); - else { - f->flags |= FIOEOF; - return EOF; - } -} /* end Getc */ - -/* -------------------------------------------------------------- */ -int /* Put back one character */ -T1Ungetc(int c, - F_FILE *f) /* Stream descriptor */ -{ - if (c != EOF) { - f->ungotc = c; - f->flags |= UNGOTTENC; /* set flag */ - f->flags &= ~FIOEOF; /* reset EOF */ - } - return c; -} /* end Ungetc */ - -/* -------------------------------------------------------------- */ -int /* Read n items into caller's buffer */ -T1Read(char *buffP, /* Buffer to be filled */ - int size, /* Size of each item */ - int n, /* Number of items to read */ - F_FILE *f) /* Stream descriptor */ -{ - int bytelen, cnt, i; - F_char *p = (F_char *)buffP; - int icnt; /* Number of characters to read */ - - if (f->b_base == NULL) return 0; /* closed */ - icnt = (size!=1)?n*size:n; /* Number of bytes we want */ - - if (f->flags & UNGOTTENC) { /* there is an ungotten c */ - f->flags &= ~UNGOTTENC; - *(p++) = f->ungotc; - icnt--; bytelen = 1; - } - else bytelen = 0; - - while (icnt > 0) { - /* First use any bytes we have buffered in the stream buffer */ - if ((cnt=f->b_cnt) > 0) { - if (cnt > icnt) cnt = icnt; - for (i=0; ib_ptr++); - f->b_cnt -= cnt; - icnt -= cnt; - bytelen += cnt; - } - - if ((icnt == 0) || (f->flags & FIOEOF)) break; - - f->b_cnt = T1Fill(f); - } - return ((size!=1)?bytelen/size:bytelen); -} /* end Read */ - -/* -------------------------------------------------------------- */ -int /* Close the file */ -T1Close(F_FILE *f) /* Stream descriptor */ -{ - if (f->b_base == NULL) return 0; /* already closed */ - f->b_base = NULL; /* no valid stream */ - return close(f->fd); -} /* end Close */ - - -/* -------------------------------------------------------------- */ -F_FILE * /* Initialization */ -T1eexec(F_FILE *f) /* Stream descriptor */ -{ - int i, c; - int H; - unsigned char *p; - unsigned char randomP[8]; - - r = 55665; /* initial key */ - asc = 1; /* indicate ASCII form */ - - /* Consume the 4 random bytes, determining if we are also to - ASCIIDecodeHex as we process our input. (See pages 63-64 - of the Adobe Type 1 Font Format book.) */ - - /* Skip over any initial white space chars */ - while (HighHexP[c=_XT1getc(f)] == HWHITE_SPACE) ; - - /* If ASCII, the next 7 chars are guaranteed consecutive */ - randomP[0] = c; /* store first non white space char */ - T1Read((pointer)(randomP+1), 1, 3, f); /* read 3 more, for a total of 4 */ - /* store first four chars */ - for (i=0,p=randomP; i<4; i++) { /* Check 4 valid ASCIIEncode chars */ - if (HighHexP[*p++] > LAST_HDIGIT) { /* non-ASCII byte */ - asc = 0; - break; - } - } - if (asc) { /* ASCII form, convert first eight bytes to binary */ - T1Read((pointer)(randomP+4), 1, 4, f); /* Need four more */ - for (i=0,p=randomP; i<4; i++) { /* Convert */ - H = HighHexP[*p++]; - randomP[i] = H | LowHexP[*p++]; - } - } - - /* Adjust our key */ - for (i=0,p=randomP; i<4; i++) { - r = (*p++ + r) * c1 + c2; - } - - /* Decrypt the remaining buffered bytes */ - f->b_cnt = T1Decrypt(f->b_ptr, f->b_cnt); - Decrypt = 1; - return (T1Feof(f))?NULL:f; -} /* end eexec */ - -#if XFONT_CID -F_FILE * /* Initialization */ -CIDeexec(F_FILE *f) /* Stream descriptor */ -{ - int i, c; - int H; - unsigned char *p; - unsigned char randomP[8]; - - r = 55665; /* initial key */ - asc = 1; /* indicate ASCII form */ - - /* Consume the 4 random bytes, determining if we are also to - ASCIIDecodeHex as we process our input. (See pages 63-64 - of the Adobe Type 1 Font Format book.) */ - - /* Skip over any initial white space chars */ - while (HighHexP[c=_XT1getc(f)] == HWHITE_SPACE) ; - - /* If ASCII, the next 7 chars are guaranteed consecutive */ - randomP[0] = c; /* store first non white space char */ - T1Read((pointer)(randomP+1), 1, 3, f); /* read 3 more, for a total of 4 */ - /* store first four chars */ - for (i=0,p=randomP; i<4; i++) { /* Check 4 valid ASCIIEncode chars */ - if (HighHexP[*p++] > LAST_HDIGIT) { /* non-ASCII byte */ - asc = 0; - break; - } - } - if (asc) { /* ASCII form, convert first eight bytes to binary */ - T1Read((pointer)(randomP+4), 1, 4, f); /* Need four more */ - for (i=0,p=randomP; i<4; i++) { /* Convert */ - H = HighHexP[*p++]; - randomP[i] = H | LowHexP[*p++]; - } - } - - /* Adjust our key */ - for (i=0,p=randomP; i<4; i++) { - r = (*p++ + r) * c1 + c2; - } - - /* Decrypt up to, but not including, the first '%' sign */ - if (f->b_cnt > 0) { - for (i = 0; i < f->b_cnt; i++) - if (*(f->b_ptr + i) == '%') - break; - - if (i < f->b_cnt) { - if (i == 0) - f->b_cnt = 0; - else - f->b_cnt = T1Decrypt(f->b_ptr, i); - } else - f->b_cnt = T1Decrypt(f->b_ptr, f->b_cnt); - } - Decrypt = 1; - return (T1Feof(f))?NULL:f; -} /* end eexec */ -#endif - -/* -------------------------------------------------------------- */ -STATIC int -T1Decrypt(unsigned char *p, int len) -{ - int n; - int H = 0, L; - unsigned char *inp = p; - unsigned char *tblP; - - if (asc) { - if (haveextrach) { - H = extrach; - tblP = LowHexP; - } - else tblP = HighHexP; - for (n=0; len>0; len--) { - L = tblP[*inp++]; - if (L == HWHITE_SPACE) continue; - if (L > LAST_HDIGIT) break; - if (tblP == HighHexP) { /* Got first hexit value */ - H = L; - tblP = LowHexP; - } else { /* Got second hexit value; compute value and store it */ - n++; - tblP = HighHexP; - H |= L; - /* H is an int, 0 <= H <= 255, so all of this will work */ - *p++ = H ^ (r >> 8); - r = (H + r) * c1 + c2; - } - } - if (tblP != HighHexP) { /* We had an odd number of hexits */ - extrach = H; - haveextrach = 1; - } else haveextrach = 0; - return n; - } else { - for (n = len; n>0; n--) { - H = *inp++; - *p++ = H ^ (r >> 8); - r = (H + r) * c1 + c2; - } - return len; - } -} /* end Decrypt */ - -/* -------------------------------------------------------------- */ -STATIC int /* Refill stream buffer */ -T1Fill(F_FILE *f) /* Stream descriptor */ -{ - int rc; - - rc = read(f->fd, f->b_base, F_BUFSIZ); - /* propagate any error or eof to current file */ - if (rc <= 0) { - if (rc == 0) /* means EOF */ - f->flags |= FIOEOF; - else { - f->error = (short)-rc; - f->flags |= FIOERROR; - rc = 0; - } - } - f->b_ptr = f->b_base; - if (Decrypt) rc = T1Decrypt(f->b_base, rc); - return rc; -} /* end Fill */ diff --git a/nx-X11/lib/font/Type1/t1malloc.c b/nx-X11/lib/font/Type1/t1malloc.c deleted file mode 100644 index 20d4212cd..000000000 --- a/nx-X11/lib/font/Type1/t1malloc.c +++ /dev/null @@ -1,759 +0,0 @@ -/* $Xorg: t1malloc.c,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * - * License 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 IBM or Lexmark not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM AND LEXMARK PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES OF - * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - * AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE - * QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF THE - * SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM OR LEXMARK) ASSUMES THE - * ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN NO EVENT SHALL - * IBM OR LEXMARK BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/t1malloc.c,v 1.11 2002/02/18 20:51:57 herrb Exp $ */ - /* MALLOC CWEB V0004 LOTS */ -/* -:h1.MALLOC - Fast Memory Allocation - -This module is meant to provide portable C-style memory allocation -routines (malloc/free). - -&author. Jeffrey B. Lotspiech (lotspiech@almaden.ibm.com) - -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifndef FONTMODULE -#include -#else -#include "Xdefs.h" /* Bool declaration */ -#include "Xmd.h" /* INT32 declaration */ -#include "os.h" -#include "xf86_ansic.h" -#endif -#include "objects.h" /* get #define for Abort() */ - - -/* -:h3.Define NULL - -In the beginning, C compilers made no assumptions about NULL. It was -even theoretically possible that NULL would not be 0. ANSI has tied -this down a bit. The following definition seems to be the most -popular (in terms of reducing compiler complaints), however, if your -compiler is unhappy about it, you can redefine it on the command line: -*/ -#ifndef NULL -#include -#endif -/* -Of course, NULL is important because xiMalloc() is defined to return -NULL when out of memory. - -:h2.Data Structures Used to Manage Free Memory - -:h3.The "freeblock" Structure - -The list of available memory blocks is a doubly-linked list. Each -block begins with the following structure: -*/ - -struct freeblock { - long size; /* number of 'longs' in block, - including this header */ - struct freeblock *fore; /* forward in doubly-linked list */ - struct freeblock *back; /* backward in doubly-linked list */ -} ; -/* -In addition, each free block has a TRAILER that is simply the 'size' -repeated. Thus 'size' is found at the beginning of the block and at the -end of the block (size-1 longs away). 'size' includes both the header -and the trailer. - -When a block is allocated, its 'size' is turned negative (both at the -beginning and at the end). Thus, checking whether two blocks may be -combined is very simple. We merely examine both neighboring blocks' -size to see if they are positive (and hence available for combination). - -The memory address returned to the user is therefore one "long" below the -size, and one extra "long" is added to the end of the block (beyond what -the user requested) to store the trailing size. - -:h3."firstfree" and "lastfree", the Anchors to the Free List - -"firstfree" points to the first available free block; "lastfree" points -to the end of the chain of available blocks. These are linked together -by initialization code; see :hdref refid=addmem.. -*/ - -static struct freeblock firstfree = { 0L, NULL, NULL }; -static struct freeblock lastfree = { 0L, NULL, NULL }; - -/* -:h3."firstcombined" and "uncombined", Keeping Track of Uncombined Blocks - -This module is designed to make the combining of adjacent free memory -blocks be very fast. Nonetheless, combining blocks is naturally the -most expensive part of any memory system. In an X system, -it is worthwhile to defer the combination for a while, because -frequently we will end up asking for a block of exactly the same -size that we recently returned and we can save ourselves some work. - -"MAXUNCOMBINED" is the maximum number of uncombined blocks that we will -allow at any time: -*/ - -#define MAXUNCOMBINED 3 - -/* -"firstcombined" is a pointer into the free list. The uncombined blocks -are always at the front of the list. "firstcombined" points to the -first block that has been combined. -*/ -static struct freeblock *firstcombined = &lastfree; -static short uncombined = 0; /* current number of uncombined blocks */ - -/* -Uncombined blocks have a negative 'size'; in this they are like -allocated blocks. - -We store a distinctive hex pattern in 'size' when we combine a block -to help us debug: -*/ -#define COMBINED 0xBADBAD - -/* -:h3.DEBUGWORDS - Extra Memory Saved With Each Block for Debug - -We add 'DEBUGWORDS' words to each allocated block to put interesting -debug information: -*/ -#ifndef DEBUGWORDS -#define DEBUGWORDS 0 -#endif - -/* -:h3.MINEXCESS - Amount of "Excess" We Would be Willing to Ignore - -When we search the free list to find memory for a user request, we -frequently find an area that is bigger than what the user has asked for. -Normally we put the remaining words (the excess) back on the free list. -However, if the area is just slightly bigger than what the user needs, -it is counter-productive to do this, as the small amount recovered tends -to hurt by increasing memory fragmentation rather than help by providing -more available memory. "MINEXCESS" is the number of words that must be -recovered before we would bother to put the excess back on the free -list. If there is not enough excess, we just give the user more than he -asked for. -*/ - -#define MINEXCESS (7 + DEBUGWORDS) - -/* -:h3.Some Flags for Debug -*/ - -long AvailableWords = 0; /* number of words available in memory */ -char mallocdebug = 0; /* a flag that enables some chatty printf's */ - -/* -:h3.Prototypes of static functions -*/ - -static void combine ( void ); -static void freeuncombinable ( long *addr, long size ); -static void unhook ( struct freeblock *p ); -static void dumpchain ( void ); -#ifdef notused -static void reportarea ( long *area ); -#endif - -/* -:h3.whocalledme() - Debug for Memory Leaks - -This routine is 68000-specific; it copies the value of the application's -curOper variable (which is often a pointer to a character string), and -the first part of the stack at the time malloc was called into the -DEBUGWORDS area reserved with each block. -We use it to see who is malloc-ing memory without free-ing it. -*/ - -#if DEBUGWORDS - -static void -whocalledme(long *addr, /* address of memory block */ - long *stack) /* address of malloc's parameter on stack */ -{ - register long size; /* size of memory block */ - register int i; /* loop index */ - extern char *curOper; /* ptr to last operator (kept by appl.) */ - - stack--; - size = - *addr; - - addr += size - 1 - DEBUGWORDS; - *addr++ = (long) curOper; - for (i=0; i < DEBUGWORDS-1; i++) - *addr++ = *stack++; -} -#else - -#define whocalledme(addr, stack) - -#endif -/* -:h2.xiFree() - User-Callable "Return Memory" Routine - -The actual beginning of the block is one 'long' before the address we -gave to the user. The block begins and ends with '-size' in words. -*/ - -void -xiFree(long *addr) /* user's memory to be returned */ -{ - register long size; /* amount of memory in this block */ - register struct freeblock *p; /* identical to 'addr' */ - - if (addr == NULL) { /* common "mistake", so allow it (CHT) */ - printf("\nxiFree(NULL)?\n"); - return; - } - - size = *--addr; -/* -Make sure this address looks OK; 'size' must be less than zero (meaning -the block is allocated) and should be repeated at the end of the block. -*/ - if (size >= 0) - Abort("free: bad size"); - if (addr[-1 - size] != size) - Abort("free: mismatched size"); -/* -Now make this a 'freeblock' structure and tack it on the FRONT of the -free list (where uncombined blocks go): -*/ - AvailableWords -= size; /* actually INCREASES AvailableWords */ - p = (struct freeblock *) addr; - p->back = &firstfree; - (p->fore = firstfree.fore)->back = p; - firstfree.fore = p; -/* -If we have too many uncombined blocks, call combine() to combine one. -*/ - if (++uncombined > MAXUNCOMBINED) { - combine(); - if (mallocdebug) { - printf("xiFree(%p) with combine, ", (void *)addr); - dumpchain(); - } - } - else { - if (mallocdebug) { - printf("xiFree(%p), ", (void *)addr); - dumpchain(); - } - } - - return; -} - -/* -:h3.combine() - Subroutine of xiFree() to Combine Blocks - -This routine tries to combine the block just before 'firstcombined'. -In any event, that block will be moved to the end of the list (after -'firstcombined'). -*/ - -static void -combine(void) -{ - register struct freeblock *p; /* block we will try to combine */ - register long *addr; /* identical to 'p' for 'long' access */ - register long size; /* size of this block */ - register long size2; /* size of potential combinee */ - - p = firstcombined->back; - if (p == &firstfree) - Abort("why are we combining?"); - - addr = (long *) p; - size = - p->size; - if (--uncombined < 0) - Abort("too many combine()s"); - - if (addr[-1] < 0 && addr[size] < 0) { -/* -We special case the situation where no combining can be done. Then, we -just mark the chain "combined" (i.e., positive size), move the -'firstcombined' pointer back in the chain, and return. -*/ - addr[0] = addr[size - 1] = size; - firstcombined = (struct freeblock *) addr; - return; - } -/* -Otherwise, we unhook this pointer from the chain: -*/ - unhook(p); -/* -First we attempt to combine this with the block immediately above: -*/ - size2 = addr[-1]; - if (size2 > 0) { /* i.e., block above is free */ - *addr = COMBINED; /* might help debug */ - addr -= size2; - if (addr[0] != size2) - Abort("bad block above"); - unhook((struct freeblock *)addr); - size += size2; - } -/* -At this point 'addr' and 'size' may be the original block, or it may be -the newly combined block. Now we attempt to combine it with the block -below: -*/ - p = (struct freeblock *) (addr + size); - size2 = p->size; - - if (size2 > 0) { /* i.e., block below is free */ - p->size = COMBINED; - if (size2 != ((long *) p)[size2 - 1]) - Abort("bad block below"); - unhook(p); - size += size2; - } -/* -Finally we take the newly combined block and put it on the end of the -chain by calling the "freeuncombinable" subroutine: -*/ - freeuncombinable(addr, size); -} - -/* -:h3.freeuncombinable() - Free a Block That Need Not be Combined - -This block is "uncombinable" either because we have already combined -it with its eligible neighbors, or perhaps because we know it has -no neighbors. -*/ - -static void -freeuncombinable(long *addr, /* address of the block to be freed */ - long size) /* size of block in words */ -{ - register struct freeblock *p; /* a convenient synonym for 'addr' */ - -/* -Mark block allocated and combined by setting its 'size' positive: -*/ - addr[size - 1] = addr[0] = size; -/* -Now tack the block on the end of the doubly-linked free list: -*/ - p = (struct freeblock *) addr; - p->fore = &lastfree; - (p->back = lastfree.back)->fore = p; - lastfree.back = p; -/* -If we have previously had no combined blocks, we must update -'firstcombined' to point to this block: -*/ - if (firstcombined->fore == NULL) - firstcombined = p; -} - -/* -:h3.unhook() - Unhook a Block from the Doubly-linked List - -The only tricky thing here is to make sure that 'firstcombined' is -updated if this block happened to be the old 'firstcombined'. (We -would never be unhooking 'firstfree' or 'lastfree', so we do not -have to worry about the end cases.) -*/ - -static void -unhook(struct freeblock *p) /* block to unhook */ -{ - p->back->fore = p->fore; - p->fore->back = p->back; - - if (firstcombined == p) - firstcombined = p->fore; -} -/* -:h2.xiMalloc() - Main User Entry Point for Getting Memory - -We have two slightly different versions of xiMalloc(). In the case -where we have TYPE1IMAGER and a font cache, we are prepared, when nominally -out of memory, to loop calling TYPE1IMAGER's GimeSpace() to release font -cache. -*/ - -/* The following code put in by MDC on 11/10/90 */ - -#ifdef TYPE1IMAGER - -static char *malloc_local(unsigned size); - -char * -xiMalloc(unsigned size) -{ - char *memaddr; - - while ( (memaddr = malloc_local(size)) == NULL ) { - /* Ask TYPE1IMAGER to give us some of its cache back */ - if ( I_GimeSpace() == 0 ) break; /* We are really, really, out of memory */ - } - - return(memaddr); -} -#endif - -/* -Now begins the real workhorse xiMalloc() (called 'malloc_local' if -we are taking advantage of TYPE1IMAGER). Its argument is an unsigned; -at least that lets users with 16-bit integers get a 64K chunk of -memory, and it is also compatible with the definition of a "size_t" -in most systems. -*/ -#ifdef TYPE1IMAGER -static char * -malloc_local(unsigned Size) /* number of bytes the user requested */ -#else -char * -xiMalloc(unsigned Size) -#endif -{ - register long size = (long)Size; /* a working register for size */ - register struct freeblock *p; /* tentative block to be returned */ - register long excess; /* words in excess of user request */ - register long *area; /* a convenient synonym for 'p' */ - -/* -First, we increase 'size' to allow for the two size fields we will -save with the block, plus any information for debug purposes. -Then we ensure that the block will be large enough to hold our -'freeblock' information. Finally we convert it to be in words -(longs), not bytes, increased to span an integral number of double -words, so that all memory blocks dispensed with be properly aligned. -*/ - size += 2*sizeof(long) + DEBUGWORDS*sizeof(long); - if (size < sizeof(struct freeblock) + sizeof(long)) - size = sizeof(struct freeblock) + sizeof(long); - size = ((unsigned) (size + sizeof(double) - 1) / sizeof(double)) * (sizeof(double)/sizeof(long)); - -/* -For speed, we will try first to give the user back a very recently -returned block--one that is on the front of the chain before -'firstcombined'. These blocks still have negative sizes, and need -only to be "unhook"ed: -*/ - size = -size; - for (p=firstfree.fore; p != firstcombined; p=p->fore) { - if (p->size == size) { - unhook(p); - uncombined--; - if (mallocdebug) { - printf("fast xiMalloc(%ld) = %p, ", size, - (void *)p); - dumpchain(); - } - AvailableWords += size; /* decreases AvailableWords */ - whocalledme(p, &Size); - return((char *)&p->fore); - } - } -/* -Well, if we get here, there are no uncombined blocks matching the user's -request. So, we search the rest of the chain for a block that is big -enough. ('size' becomes positive again): -*/ - size = -size; - for (;; p = p->fore) { -/* -If we hit the end of the chain (p->size == 0), we are probably out of -memory. However, we should first try to combine any memory that has -not yet been combined before we give that pessimistic answer. If -we succeed in combining, we can call ourselves recursively to try to -allocate the requested amount: -*/ - if (p->size == 0) { - if (uncombined <= 0) - return(NULL); - while (firstfree.fore != firstcombined) - combine(); - return(xiMalloc(sizeof(long) * (size - 2 - DEBUGWORDS))); - } -/* -Otherwise, we keep searching until we find a big enough block: -*/ - if (p->size >= size) - break; - } -/* -At this point, 'p' contains a block at least as big as what the user -requested, so we take it off the free chain. If it is excessively big, -we return the excess to the free chain: -*/ - unhook(p); - excess = p->size - size; - area = (long *) p; - - if (excess > MINEXCESS) - freeuncombinable(area + size, excess); - else - size = p->size; - - AvailableWords -= size; -/* -Mark first and last word of block with the negative of the size, to -flag that this block is allocated: -*/ - area[size - 1] = area[0] = - size; - - if (mallocdebug) { - printf("slow xiMalloc(%ld) @ %p, ", size, (void *)area); - dumpchain(); - } - whocalledme(area, &Size); -/* -The address we return to the user is one 'long' BELOW the address of -the block. This protects our 'size' field, so we can tell the size -of the block when he returns it to us with xiFree(). Also, he better not -touch the 'size' field at the end of the block either. (That would be -nasty of him, as he would be touching memory outside of the bytes he -requested). -*/ - return((char *) (area + 1)); -} - -/* -:h2 id=addmem.addmemory() - Initialize Free Memory - -This routine should be called at initialization to initialize the -free chain. There is no standard way to do this in C. -We want the memory dispensed by malloc to be aligned on a double word -boundary (because some machines either require alignment, or are -more efficient if accesses are aligned). Since the total size of -any block created by malloc is an integral number of double words, -all we have to do to ensure alignment is to adjust each large block -added to the free chain to start on an odd long-word boundary. -(Malloc's size field will occupy the odd long and the user's memory -will then begin on an even boundary.) Since we fill in additional -size fields at the beginning and end of each of the large freeblocks, -we need only adjust the address passed to addmemory to a double word -boundary. -*/ - -#define MAXAREAS 10 /* there can be this many calls to addmemory() */ - -static long *freearea[MAXAREAS] = { NULL }; /* so we can report later */ - -void -addmemory(long *addr, /* beginning of free area */ - long size) /* number of bytes of free area */ -{ - register int i; /* loop index variable */ - register long *aaddr; /* aligned beginning of free area */ - -#if DEBUGWORDS - printf("malloc has DEBUGWORDS=%d\n", DEBUGWORDS); -#endif -/* -First link together firstfree and lastfree if necessary: -*/ - if (firstfree.fore == NULL) { - firstfree.fore = &lastfree; - lastfree.back = &firstfree; - } -/* -We'll record where the area was that was given to us for later reports: -*/ - for (i=0; i < MAXAREAS; i++) - if (freearea[i] == NULL) break; - if (i >= MAXAREAS) - Abort("too many addmemory()s"); - aaddr = (long *) ( ((long) addr + sizeof(double) - 1) & - (long)sizeof(double) ); - size -= (char *) aaddr - (char *) addr; - freearea[i] = aaddr; -/* -Convert 'size' to number of longs, and store '-size' guards at the -beginning and end of this area so we will not accidentally recombine the -first or last block: -*/ - size /= sizeof(long); - - AvailableWords += size - 2; - - aaddr[size - 1] = aaddr[0] = -size; -/* -Finally, call 'freeuncombinable' to put the remaining memory on the -free list: -*/ - freeuncombinable(aaddr + 1, size - 2); -} - -/* -:h3.delmemory() - Delete Memory Pool -*/ -void -delmemory(void) -{ - register int i; - - AvailableWords = 0; - firstfree.fore = &lastfree; - lastfree.back = &firstfree; - firstcombined = &lastfree; - uncombined = 0; - for (i=0; ifore) { - if (--i < 0) - Abort("too many uncombined areas"); - size = p->size; - printf(". . . area @ %p, size = %ld\n", (void *)p, -size); - if (size >= 0 || size != ((int *) p)[-1 - size]) - Abort("dumpchain: bad size"); - if (p->back != back) - Abort("dumpchain: bad back"); - back = p; - } - printf("DUMPING COMBINED FREE LIST:\n"); - for (; p != &lastfree; p = p->fore) { - size = p->size; - printf(". . . area @ %p, size = %ld\n", (void *)p, size); - if (size <= 0 || size != ((int *) p)[size - 1]) - Abort("dumpchain: bad size"); - if (p->back != back) - Abort("dumpchain: bad back"); - back = p; - } - if (back != lastfree.back) - Abort("dumpchain: bad lastfree"); -} - -#ifdef notused -/* -:h3.reportarea() - Display a Contiguous Set of Memory Blocks -*/ - -static void -reportarea(long *area) /* start of blocks (from addmemory) */ -{ - register long size; /* size of current block */ - register long wholesize; /* size of original area */ - register struct freeblock *p; /* pointer to block */ - - if (area == NULL) - return; - wholesize = - *area++; - wholesize -= 2; - - while (wholesize > 0) { - size = *area; - if (size < 0) { - register int i,j; - - size = -size; - printf("Allocated %5ld bytes at %p, first words=%08lx %08lx\n", - size * sizeof(long), area + 1, area[1], area[2]); -#if DEBUGWORDS - printf(" ...Last operator: %s\n", - (char *)area[size-DEBUGWORDS-1]); -#endif - for (i = size - DEBUGWORDS; i < size - 2; i += 8) { - printf(" ..."); - for (j=0; j<8; j++) - printf(" %08lx", area[i+j]); - printf("\n"); - } - - } - else { - printf("Free %ld bytes at %p\n", size * sizeof(long), - area); - if (size == 0) - Abort("zero sized memory block"); - - for (p = firstfree.fore; p != NULL; p = p->fore) - if ((long *) p == area) break; - if ((long *) p != area) - Abort("not found on forward chain"); - - for (p = lastfree.back; p != NULL; p = p->back) - if ((long *) p == area) break; - if ((long *) p != area) - Abort("not found on backward chain"); - } - if (area[0] != area[size - 1]) - Abort("unmatched check sizes"); - area += size; - wholesize -= size; - } -} - -/* -:h3.MemReport() - Display All of Memory -*/ - -void -MemReport(void) -{ - register int i; - - dumpchain(); - - for (i=0; i -#endif -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "pictures.h" - -/* -:h2.Handle Functions - -:h3.Phantom() - Returns a Move Segment Equivalent to Handles - -This is a user operator. Its new name is QueryHandle. -*/ - -struct segment * -t1_Phantom(struct segment *p) /* object to take the Phantom of */ -{ - struct fractpoint pt; /* handle size will built here */ - - if (p == NULL) - pt.x = pt.y = 0; - else - PathDelta(p, &pt); - - return(PathSegment(MOVETYPE, pt.x, pt.y)); -} - -/* -:h3.Snap() - Force Ending Handle of Object to Origin - -This is a user operator. -*/ - -struct segment * -t1_Snap(struct segment *p) /* path to snap */ -{ - struct fractpoint pt; /* for finding length of path */ - - if (p == NULL) - return(NULL); - p = UniquePath(p); - - PathDelta(p, &pt); - if (p->last->type == MOVETYPE) { - p->last->dest.x -= pt.x; - p->last->dest.y -= pt.y; - } - else - p = JoinSegment(p, MOVETYPE, -pt.x, -pt.y, NULL); - return(p); -} diff --git a/nx-X11/lib/font/Type1/t1stdio.h b/nx-X11/lib/font/Type1/t1stdio.h deleted file mode 100644 index 2ed083253..000000000 --- a/nx-X11/lib/font/Type1/t1stdio.h +++ /dev/null @@ -1,101 +0,0 @@ -/* $Xorg: t1stdio.h,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/t1stdio.h,v 1.9 2001/01/17 19:43:24 dawes Exp $ */ -/* T1IO FILE structure and related stuff */ -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#ifdef XFree86LOADER -#undef FILE -#endif -#define FILE F_FILE -typedef unsigned char F_char; - -typedef struct F_FILE { - F_char *b_base; /* Pointer to beginning of buffer */ - long b_size; /* Size of the buffer */ - F_char *b_ptr; /* Pointer to next char in buffer */ - long b_cnt; /* Number of chars remaining in buffer */ - F_char flags; /* other flags; != 0 means getc must call fgetc */ - F_char ungotc; /* Place for ungotten char; flag set if present */ - short error; /* error status */ - int fd; /* underlying file descriptor */ -} F_FILE; - - -/* defines for flags */ -#define UNGOTTENC (0x01) -#define FIOEOF (0x80) -#define FIOERROR (0x40) - -#ifndef NULL -#include -#endif - -#define EOF (-1) /* end of file */ -#define F_BUFSIZ (512) - -#define _XT1getc(f) \ - ( \ - ( ((f)->b_cnt > 0) && ((f)->flags == 0) ) ? \ - ( (f)->b_cnt--, (unsigned int)*( (f)->b_ptr++ ) ) : \ - T1Getc(f) \ - ) - -#define T1Feof(f) (((f)->flags & FIOEOF) && ((f)->b_cnt==0)) - -#if XFONT_CID -extern F_FILE *CIDeexec ( FILE *f ); -#endif - -extern FILE *T1Open ( char *fn, char *mode ); -extern int T1Getc ( FILE *f ); -extern int T1Ungetc ( int c, FILE *f ); -extern int T1Read ( char *buffP, int size, int n, FILE *f ); -extern int T1Close ( FILE *f ); -extern FILE *T1eexec ( FILE *f ); -extern void resetDecrypt ( void ); - -#undef fclose -#undef fopen -#undef ungetc -#undef fgetc -#undef fread -#undef feof -#undef ferror -#define fclose(f) T1Close(f) -#define fopen(name,mode) T1Open(name,mode) -#define ungetc(c,f) T1Ungetc(c,f) -#define fgetc(f) T1Getc(f) - -#define fread(bufP,size,n,f) T1Read(bufP,size,n,f) -#define feof(f) (((f)->flags & FIOEOF) && ((f)->b_cnt==0)) -#define ferror(f) (((f)->flags & FIOERROR)?(f)->error:0) diff --git a/nx-X11/lib/font/Type1/t1stub.c b/nx-X11/lib/font/Type1/t1stub.c deleted file mode 100644 index 2fb1d797f..000000000 --- a/nx-X11/lib/font/Type1/t1stub.c +++ /dev/null @@ -1,56 +0,0 @@ -/* $Xorg: t1stub.c,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/t1stub.c,v 1.8 2001/01/17 19:43:24 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef FONTMODULE -#include "Xdefs.h" /* Bool declaration */ -#include "Xmd.h" /* INT32 declaration */ -#include "os.h" -#include "xf86_ansic.h" -#else -#include -#endif -#include "objects.h" /* get #define for Abort() */ - -static void -xiStub(void) -{ - printf("xiStub called\n"); - Abort("xiStub called"); -} - -void -t1_DumpText(void) -{ - xiStub(); -} diff --git a/nx-X11/lib/font/Type1/t1test.c b/nx-X11/lib/font/Type1/t1test.c deleted file mode 100644 index 1da74168f..000000000 --- a/nx-X11/lib/font/Type1/t1test.c +++ /dev/null @@ -1,246 +0,0 @@ -/* $Xorg: t1test.c,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -#include -#include - -#define DECIPOINTSPERINCH 722.7 -#define DEFAULTRES 75 -#define DEFAULTPOINTSIZE 120 - -FontScalableRec vals; -FontEntryRec entry; - -int main(argc, argv) - int argc; - char *argv[]; -{ - int h; - char temp[80]; - char file[80]; - char glyphcode[1]; - FontPtr fontptr; - CharInfoRec *glyphs[1]; - int count; - int code; - int rc = -1; - - T1FillVals(&vals); - Type1RegisterFontFileFunctions(); - entry.name.name = "-adobe-utopia-medium-r-normal--0-0-0-0-p-0-iso8859-1"; - - for (;;) { - printf("T1TEST: "); - gets(temp); - glyphcode[0] = '\0'; - - switch(temp[0]) { - - case 'c': - if (1 != sscanf(&temp[2], "%c", glyphcode)) - printf("glyph code?\n"); - break; - - case 'x': - if (1 != sscanf(&temp[2], "%x", &code)) - printf("glyph code?\n"); - else - glyphcode[0] = code; - break; - - case 'd': - if (1 != sscanf(&temp[2], "%d", &code)) - printf("glyph code?\n"); - else - glyphcode[0] = code; - break; - - case 'h': - if (1 != sscanf(&temp[2], "%d", &h)) - printf("height?\n"); - vals.pixel = h; - rc = Type1OpenScalable(NULL, &fontptr, 0, &entry, file, &vals, 0, 0); - break; - - case 'f': - if (1 != sscanf(&temp[2], "%s", file)) - printf("file name?\n"); - rc = Type1OpenScalable(NULL, &fontptr, 0, &entry, file, &vals, 0, 0); - break; - - case 't': - if (1 != sscanf(&temp[2], "%s", file)) - printf("file name?\n"); - vals.pixel = 8; - rc = Type1OpenScalable(NULL, &fontptr, 0, &entry, file, &vals, 0, 0); - if (rc != Successful) break; - vals.pixel = 20; - rc = Type1OpenScalable(NULL, &fontptr, 0, &entry, file, &vals, 0, 0); - if (rc != Successful) break; - vals.pixel = 50; - rc = Type1OpenScalable(NULL, &fontptr, 0, &entry, file, &vals, 0, 0); - glyphcode[0] = 'A'; - printf("From font '%s':\n", file); - break; - - case 'q': - return 0; - - default: - printf("unknown command '%c', must one of 'qfchdxt'\n", temp[0]); - - } - if (rc == Successful) { - if (glyphcode[0] != '\0') { - (*fontptr->get_glyphs)(fontptr, 1, glyphcode, 0, &count, glyphs); - if (count > 0) - Display(glyphs[0]); - else - printf("Code %x not valid in this font\n", glyphcode[0]); - } - } - else - printf("Bad font (rc = %d, file='%s')\n", rc, file); - } -} - -static void Display(glyph) - CharInfoRec *glyph; -{ - int h,w; - unsigned char *p; - int data; - int i; - - p = glyph->bits; - - printf("Metrics: left=%d, right=%d, w=%d, above=%d, below=%d\n", - glyph->metrics.leftSideBearing, - glyph->metrics.rightSideBearing, - glyph->metrics.characterWidth, - glyph->metrics.ascent, - glyph->metrics.descent); - - for (h=glyph->metrics.ascent + glyph->metrics.descent; --h >= 0;) { - w = glyph->metrics.rightSideBearing - glyph->metrics.leftSideBearing; - while (w > 0) { - data = *p++; - for (i=0; i<8; i++) { - if (--w < 0) - break; - if (data & 0x80) - printf("X"); - else - printf("."); - data <<= 1; - } - } - printf("\n"); - } -} - -T1FillVals(vals) - FontScalablePtr vals; -{ - FontResolutionPtr res; - int x_res = DEFAULTRES; - int y_res = DEFAULTRES; - int pointsize = DEFAULTPOINTSIZE; /* decipoints */ - int num_res; - - /* Must have x, y, and pixel */ - if (!vals->x || !vals->y || !vals->pixel) { - res = GetClientResolutions(&num_res); - if (num_res) { - if (res->x_resolution) - x_res = res->x_resolution; - if (res->y_resolution) - y_res = res->y_resolution; - if (res->point_size) - pointsize = res->point_size; - } - if (!vals->x) - vals->x = x_res; - if (!vals->y) - vals->y = y_res; - if (!vals->point) { - if (!vals->pixel) vals->point = pointsize; - else vals->point = (vals->pixel * DECIPOINTSPERINCH) / vals->y; - } - if (!vals->pixel) - vals->pixel = (vals->point * vals->y) / DECIPOINTSPERINCH; - /* Make sure above arithmetic is normally in range and will - round properly. +++ */ - } -} - -int CheckFSFormat(format, fmask, bit, byte, scan, glyph, image) - int format,fmask,*bit,*byte,*scan,*glyph,*image; -{ - *bit = *byte = 1; - *glyph = *scan = *image = 1; - return Successful; - -} - -char *MakeAtom(p) - char *p; -{ - return p; -} - - -FontResolutionPtr GetClientResolutions(resP) - int *resP; -{ - *resP = 0; -}; - -char *Xalloc(size) - int size; -{ - extern char *malloc(); - return(malloc(size)); -} - -void Xfree() -{ - free(); -} - -FontDefaultFormat() { ; } - -FontFileRegisterRenderer() { ; } - -GenericGetBitmaps() { ; } -GenericGetExtents() { ; } - -FontParseXLFDName() { ; } -FontComputeInfoAccelerators() { ; } diff --git a/nx-X11/lib/font/Type1/t1unicode.c b/nx-X11/lib/font/Type1/t1unicode.c deleted file mode 100644 index 136cc4441..000000000 --- a/nx-X11/lib/font/Type1/t1unicode.c +++ /dev/null @@ -1,251 +0,0 @@ -/* -Copyright (c) 1998 by Juliusz Chroboczek - -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. -*/ - -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "t1unicode.h" - -static char* table_32[] = -{ "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", - "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", - "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", - "three", "four", "five", "six", "seven", "eight", "nine", "colon", - "semicolon", "less", "equal", "greater", "question", "at", "A", "B", - "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", - "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", - "backslash", "bracketright", "asciicircum", "underscore", "grave", - "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", - "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", - "braceleft", "bar", "braceright", "asciitilde", 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, "space", "exclamdown", "cent", "sterling", "currency", "yen", - "brokenbar", "section", "dieresis", "copyright", "ordfeminine", - "guillemotleft", "logicalnot", "hyphen", "registered", "macron", - "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", - "paragraph", "periodcentered", "cedilla", "onesuperior", - "ordmasculine", "guillemotright", "onequarter", "onehalf", - "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", - "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", - "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", - "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", - "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", - "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", - "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", - "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", - "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", - "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", - "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", - "ydieresis", "Amacron", "amacron", "Abreve", "abreve", "Aogonek", - "aogonek", "Cacute", "cacute", "Ccircumflex", "ccircumflex", - "Cdotaccent", "cdotaccent", "Ccaron", "ccaron", "Dcaron", "dcaron", - "Dcroat", "dcroat", "Emacron", "emacron", "Ebreve", "ebreve", - "Edotaccent", "edotaccent", "Eogonek", "eogonek", "Ecaron", "ecaron", - "Gcircumflex", "gcircumflex", "Gbreve", "gbreve", "Gdotaccent", - "gdotaccent", "Gcommaaccent", "gcommaaccent", "Hcircumflex", - "hcircumflex", "Hbar", "hbar", "Itilde", "itilde", "Imacron", - "imacron", "Ibreve", "ibreve", "Iogonek", "iogonek", "Idotaccent", - "dotlessi", "IJ", "ij", "Jcircumflex", "jcircumflex", "Kcommaaccent", - "kcommaaccent", "kgreenlandic", "Lacute", "lacute", "Lcommaaccent", - "lcommaaccent", "Lcaron", "lcaron", "Ldot", "ldot", "Lslash", - "lslash", "Nacute", "nacute", "Ncommaaccent", "ncommaaccent", - "Ncaron", "ncaron", "napostrophe", "Eng", "eng", "Omacron", "omacron", - "Obreve", "obreve", "Ohungarumlaut", "ohungarumlaut", "OE", "oe", - "Racute", "racute", "Rcommaaccent", "rcommaaccent", "Rcaron", - "rcaron", "Sacute", "sacute", "Scircumflex", "scircumflex", - "Scommaaccent", "scommaaccent", "Scaron", "scaron", "Tcommaaccent", - "tcommaaccent", "Tcaron", "tcaron", "Tbar", "tbar", "Utilde", - "utilde", "Umacron", "umacron", "Ubreve", "ubreve", "Uring", "uring", - "Uhungarumlaut", "uhungarumlaut", "Uogonek", "uogonek", "Wcircumflex", - "wcircumflex", "Ycircumflex", "ycircumflex", "Ydieresis", "Zacute", - "zacute", "Zdotaccent", "zdotaccent", "Zcaron", "zcaron", "longs", 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "florin", 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Ohorn", "ohorn", 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, "Uhorn", "uhorn", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Gcaron", - "gcaron", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - "Aringacute", "aringacute", "AEacute", "aeacute", "Oslashacute", - "oslashacute", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii57929", "afii64937", 0, 0, 0, 0, 0, 0, - 0, 0, "circumflex", "caron", 0, "macron", 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, "breve", "dotaccent", "ring", "ogonek", "tilde", - "hungarumlaut", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "gravecomb", - "acutecomb", 0, "tildecomb", 0, 0, 0, 0, 0, "hookabovecomb", 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - "dotbelowcomb", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, "tonos", "dieresistonos", "Alphatonos", - "anoteleia", "Epsilontonos", "Etatonos", "Iotatonos", 0, - "Omicrontonos", 0, "Upsilontonos", "Omegatonos", "iotadieresistonos", - "Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", - "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", - 0, "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega", - "Iotadieresis", "Upsilondieresis", "alphatonos", "epsilontonos", - "etatonos", "iotatonos", "upsilondieresistonos", "alpha", "beta", - "gamma", "delta", "epsilon", "zeta", "eta", "theta", "iota", "kappa", - "lambda", "mu", "nu", "xi", "omicron", "pi", "rho", "sigma1", "sigma", - "tau", "upsilon", "phi", "chi", "psi", "omega", "iotadieresis", - "upsilondieresis", "omicrontonos", "upsilontonos", "omegatonos", 0, 0, - "theta1", "Upsilon1", 0, 0, "phi1", "omega1", 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii10023", "afii10051", - "afii10052", "afii10053", "afii10054", "afii10055", "afii10056", - "afii10057", "afii10058", "afii10059", "afii10060", "afii10061", 0, - "afii10062", "afii10145", "afii10017", "afii10018", "afii10019", - "afii10020", "afii10021", "afii10022", "afii10024", "afii10025", - "afii10026", "afii10027", "afii10028", "afii10029", "afii10030", - "afii10031", "afii10032", "afii10033", "afii10034", "afii10035", - "afii10036", "afii10037", "afii10038", "afii10039", "afii10040", - "afii10041", "afii10042", "afii10043", "afii10044", "afii10045", - "afii10046", "afii10047", "afii10048", "afii10049", "afii10065", - "afii10066", "afii10067", "afii10068", "afii10069", "afii10070", - "afii10072", "afii10073", "afii10074", "afii10075", "afii10076", - "afii10077", "afii10078", "afii10079", "afii10080", "afii10081", - "afii10082", "afii10083", "afii10084", "afii10085", "afii10086", - "afii10087", "afii10088", "afii10089", "afii10090", "afii10091", - "afii10092", "afii10093", "afii10094", "afii10095", "afii10096", - "afii10097", 0, "afii10071", "afii10099", "afii10100", "afii10101", - "afii10102", "afii10103", "afii10104", "afii10105", "afii10106", - "afii10107", "afii10108", "afii10109", 0, "afii10110", "afii10193", 0, - 0, "afii10146", "afii10194", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - "afii10147", "afii10195", "afii10148", "afii10196", 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - "afii10050", "afii10098", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii10846", 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - "afii57799", "afii57801", "afii57800", "afii57802", "afii57793", - "afii57794", "afii57795", "afii57798", "afii57797", "afii57806", 0, - "afii57796", "afii57807", "afii57839", "afii57645", "afii57841", - "afii57842", "afii57804", "afii57803", "afii57658", 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, "afii57664", "afii57665", "afii57666", "afii57667", - "afii57668", "afii57669", "afii57670", "afii57671", "afii57672", - "afii57673", "afii57674", "afii57675", "afii57676", "afii57677", - "afii57678", "afii57679", "afii57680", "afii57681", "afii57682", - "afii57683", "afii57684", "afii57685", "afii57686", "afii57687", - "afii57688", "afii57689", "afii57690", 0, 0, 0, 0, 0, "afii57716", - "afii57717", "afii57718", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii57388", 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, "afii57403", 0, 0, 0, "afii57407", 0, "afii57409", - "afii57410", "afii57411", "afii57412", "afii57413", "afii57414", - "afii57415", "afii57416", "afii57417", "afii57418", "afii57419", - "afii57420", "afii57421", "afii57422", "afii57423", "afii57424", - "afii57425", "afii57426", "afii57427", "afii57428", "afii57429", - "afii57430", "afii57431", "afii57432", "afii57433", "afii57434", 0, 0, - 0, 0, 0, "afii57440", "afii57441", "afii57442", "afii57443", - "afii57444", "afii57445", "afii57446", "afii57470", "afii57448", - "afii57449", "afii57450", "afii57451", "afii57452", "afii57453", - "afii57454", "afii57455", "afii57456", "afii57457", "afii57458", 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii57392", "afii57393", - "afii57394", "afii57395", "afii57396", "afii57397", "afii57398", - "afii57399", "afii57400", "afii57401", "afii57381", 0, 0, "afii63167", - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii57511", 0, 0, 0, 0, "afii57506", - 0, 0, 0, 0, 0, 0, 0, "afii57507", 0, "afii57512", 0, 0, 0, 0, 0, 0, 0, - 0, "afii57513", 0, 0, 0, 0, 0, 0, "afii57508", 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, "afii57505", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii57509", 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, "afii57514", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii57519", 0, 0, "afii57534", 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - -static char* table_2000[] = /* general punctuation, s*scripts, currency */ -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii61664", "afii301", "afii299", - "afii300", 0, 0, "figuredash", "endash", "emdash", "afii00208", 0, - "underscoredbl", "quoteleft", "quoteright", "quotesinglbase", - "quotereversed", "quotedblleft", "quotedblright", "quotedblbase", 0, - "dagger", "daggerdbl", "bullet", 0, "onedotenleader", - "twodotenleader", "ellipsis", 0, 0, 0, 0, 0, "afii61573", "afii61574", - "afii61575", 0, "perthousand", 0, "minute", "second", 0, 0, 0, 0, 0, - "guilsinglleft", "guilsinglright", 0, "exclamdbl", 0, 0, 0, 0, 0, 0, - 0, "fraction", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, "zerosuperior", 0, 0, 0, "foursuperior", "fivesuperior", - "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", 0, 0, - 0, "parenleftsuperior", "parenrightsuperior", "nsuperior", - "zeroinferior", "oneinferior", "twoinferior", "threeinferior", - "fourinferior", "fiveinferior", "sixinferior", "seveninferior", - "eightinferior", "nineinferior", 0, 0, 0, "parenleftinferior", - "parenrightinferior", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, "colonmonetary", 0, "franc", "lira", 0, 0, "peseta", 0, 0, - "afii57636", "dong", "Euro", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - -static char* table_2500[]= /* line and box drawing */ -{ "SF100000", 0, "SF110000", 0, 0, 0, 0, 0, 0, 0, 0, 0, "SF010000", 0, - 0, 0, "SF030000", 0, 0, 0, "SF020000", 0, 0, 0, "SF040000", 0, 0, 0, - "SF080000", 0, 0, 0, 0, 0, 0, 0, "SF090000", 0, 0, 0, 0, 0, 0, 0, - "SF060000", 0, 0, 0, 0, 0, 0, 0, "SF070000", 0, 0, 0, 0, 0, 0, 0, - "SF050000", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - "SF430000", "SF240000", "SF510000", "SF520000", "SF390000", - "SF220000", "SF210000", "SF250000", "SF500000", "SF490000", - "SF380000", "SF280000", "SF270000", "SF260000", "SF360000", - "SF370000", "SF420000", "SF190000", "SF200000", "SF230000", - "SF470000", "SF480000", "SF410000", "SF450000", "SF460000", - "SF400000", "SF540000", "SF530000", "SF440000", 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "upblock", 0, 0, 0, "dnblock", 0, - 0, 0, "block", 0, 0, 0, "lfblock", 0, 0, 0, "rtblock", "ltshade", - "shade", "dkshade", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - -static char* table_FB00[] = /* alphabetic presentation forms */ -{ "ff", "fi", "fl", "ffi", "ffl", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "afii57705", 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, "afii57694", "afii57695", 0, 0, 0, 0, 0, 0, 0, 0, 0, - "afii57723", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, "afii57700", 0, 0, 0, 0 }; - -char* -unicodetoPSname(unsigned short code) -{ - if(code<32) return 0; - else if(code<0x6FF) return table_32[code-32]; - else if(code<0x2000) return 0; - else if(code<0x20D0) return table_2000[code-0x2000]; - else if(code==0x2116) return "afii61352"; /* numero sign, for Koi */ - else if(code==0x2122) return "trademark"; - else if(code<0x2500) return 0; - else if(code<0x25A0) return table_2500[code-0x2500]; - else if(code<0xFB00) return 0; - else if(code<0xFB50) return table_FB00[code-0xFB00]; - else return 0; -} diff --git a/nx-X11/lib/font/Type1/t1unicode.h b/nx-X11/lib/font/Type1/t1unicode.h deleted file mode 100644 index bad0274a0..000000000 --- a/nx-X11/lib/font/Type1/t1unicode.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (c) 1998 by Juliusz Chroboczek - -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. -*/ - -/* $XFree86$ */ - -char *unicodetoPSname(unsigned short code); diff --git a/nx-X11/lib/font/Type1/token.c b/nx-X11/lib/font/Type1/token.c deleted file mode 100644 index 71a968b30..000000000 --- a/nx-X11/lib/font/Type1/token.c +++ /dev/null @@ -1,1208 +0,0 @@ -/* $Xorg: token.c,v 1.4 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/token.c,v 1.5tsi Exp $ */ -/* Authors: Sig Nin & Carol Thompson IBM Almaden Research Laboratory */ -#ifdef HAVE_CONFIG_H -#include -#endif -#include "t1stdio.h" -#include "util.h" -#include "digit.h" -#include "token.h" -#include "tokst.h" -#include "hdigit.h" - -/* - * ------------------------------------------------------------------- - * Globals - * ------------------------------------------------------------------- - */ - -/* These variables are set by the caller */ -char *tokenStartP; /* Pointer to token buffer in VM */ -char *tokenMaxP; /* Pointer to last byte in buffer + 1 */ - -/* These variables are set by TOKEN */ -int tokenLength; /* Characters in token */ -boolean tokenTooLong; /* Token too long for buffer */ -int tokenType; /* Type of token identified */ -psvalue tokenValue; /* Token value */ - -/* - * ------------------------------------------------------------------- - * Private variables - * ------------------------------------------------------------------- - */ - -static FILE *inputFileP; /* Current input file */ - - -/* Token */ -static char *tokenCharP; /* Pointer to next character in token */ - -/* - * ------------------------------------------------------------------- - * Private routines for manipulating numbers - * ------------------------------------------------------------------- - */ - -#define Exp10(e) \ -((e) == 0\ - ? (double)(1.0)\ - : (-64 <= (e) && (e) <= 63\ - ? Exp10T[(e)+64]\ - : P10(e)\ - )\ -) - -static double Exp10T[128] = { - 1e-64, 1e-63, 1e-62, 1e-61, 1e-60, 1e-59, 1e-58, 1e-57, - 1e-56, 1e-55, 1e-54, 1e-53, 1e-52, 1e-51, 1e-50, 1e-49, - 1e-48, 1e-47, 1e-46, 1e-45, 1e-44, 1e-43, 1e-42, 1e-41, - 1e-40, 1e-39, 1e-38, 1e-37, 1e-36, 1e-35, 1e-34, 1e-33, - 1e-32, 1e-31, 1e-30, 1e-29, 1e-28, 1e-27, 1e-26, 1e-25, - 1e-24, 1e-23, 1e-22, 1e-21, 1e-20, 1e-19, 1e-18, 1e-17, - 1e-16, 1e-15, 1e-14, 1e-13, 1e-12, 1e-11, 1e-10, 1e-9, - 1e-8, 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, - 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, - 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22, 1e23, - 1e24, 1e25, 1e26, 1e27, 1e28, 1e29, 1e30, 1e31, - 1e32, 1e33, 1e34, 1e35, 1e36, 1e37, 1e38, 1e39, - 1e40, 1e41, 1e42, 1e43, 1e44, 1e45, 1e46, 1e47, - 1e48, 1e49, 1e50, 1e51, 1e52, 1e53, 1e54, 1e55, - 1e56, 1e57, 1e58, 1e59, 1e60, 1e61, 1e62, 1e63 -}; - -static double -P10(long exponent) -{ - double value, power; - - if (exponent < 0) { - power = 0.1; - value = (exponent & 1 ? power : 1.0); - exponent++; - exponent = -(exponent >> 1); /* portable C for -(exponent/2) */ - } - else { - power = 10.0; - value = (exponent & 1 ? power : 1.0); - exponent = exponent >> 1; - } - - while(exponent > 0) { - power *= power; - if (exponent & 1) - value *= power; - exponent >>= 1; - } - - return(value); -} - -/* - * ------------------------------------------------------------------- - * Private routines and macros for manipulating the input - * ------------------------------------------------------------------- - */ - -/* Get next character from the input -- - * - */ -#define next_ch() (_XT1getc(inputFileP)) - -/* Push a character back into the input -- - * - * Ungetc of EOF will fail, but that's ok: the next getc will - * return EOF. - * - * NOTE: These macros are presently written to return the character - * pushed, or EOF if none was pushed. However, they are not - * required to return anything in particular, and callers should - * not rely on the returned value. - */ -#define back_ch(ch) (T1Ungetc(ch, inputFileP)) - -/* Push a character back into the input if it was not white space. - * If it is a carriage return (\r) then check next char for - * linefeed and consume them both, otherwise put next char back. - * - */ -#define back_ch_not_white(ch) \ -(\ -isWHITE_SPACE(ch)\ - ? ((ch == '\r')\ - ? (((ch = next_ch()) == '\n')\ - ? EOF\ - : back_ch(ch)\ - )\ - : EOF\ - )\ - : back_ch(ch)\ -) - -/* - * ------------------------------------------------------------------- - * Private routines and macros for manipulating the token buffer - * ------------------------------------------------------------------- - */ - -/* Add a character to the token - * ---- use ONLY when you KNOW that this character will - * be stored within the token buffer. - */ -#define save_unsafe_ch(ch) (*tokenCharP++ = ch) - -/* Add a character to the token, if not too long to fit */ -#define save_ch(ch) \ -((tokenCharP < tokenMaxP)\ - ? save_unsafe_ch(ch)\ - : (tokenTooLong = TRUE)\ -) - -#define save_ch_no_inc(ch) \ -if (tokenCharP < tokenMaxP) *tokenCharP = ch - -/* - * ------------------------------------------------------------------- - * Action Routines - * - * These routines all - * -- take int ch as a parameter - * -- return int ch if no token was recognized, DONE otherwise - * -- leave the next character in the input, if returning DONE - * ------------------------------------------------------------------- - */ - -#define DONE (256) - -/* Get the next input character */ -static int -next_char(int ch) -{ - return(next_ch()); -} - -/* Add character to token */ -static int -add_char(int ch) -{ - save_ch(ch); - return(next_ch()); -} - - -/* ------------------------------------------------------------------- - * Skip white space and comments - */ - -/* Skip white space */ -static int -skip_space(int ch) -{ - do { - ch = next_ch(); - } while(isWHITE_SPACE(ch)); - return(ch); -} - -/* Skip comments */ -static int -skip_comment(int ch) -{ - do { - ch = next_ch(); - } while(isCOMMENT(ch)); - return(ch); -} - -/* ------------------------------------------------------------------- - * Collect value elements for a number - */ - -/* decimal integer or real number mantissa */ -static int m_sign; -static long m_value; -static long m_scale; - -/* real number exponent */ -static int e_sign; -static long e_value; - -/* radix number */ -static long r_base; -static long r_value; -static long r_scale; - -static int -add_sign(int ch) -{ - m_sign = ch; - save_unsafe_ch(ch); - return(next_ch()); -} - -static int -add_1st_digits(int ch) -{ - m_sign = '+'; - return(add_digits(ch)); -} - -static int -add_digits(int ch) -{ - long value, p_value, scale; - int digit; - - /* On entry, expect m_sign to be set to '+' or '-'; - * ch is a decimal digit. - * Expect at most one character saved at this point, - * a sign. This routine will save up to 10 more - * characters without checking the buffer boundary. - */ - - value = ch - '0'; - save_unsafe_ch(ch); - ch = next_ch(); - - while(isDECIMAL_DIGIT(ch) && value < (MAX_INTEGER/10)) { - value = (value << 3) + (value << 1) + (ch - '0'); - save_unsafe_ch(ch); - ch = next_ch(); - } - - /* Quick exit for small integers -- - * |x| <= 10*((MAX_INTEGER/10)-1)+9 - * |x| <= 2,147,483,639 for 32 bit integers - */ - if (isNUMBER_ENDER(ch)) { - back_ch_not_white(ch); - tokenValue.integer = (m_sign == '-' ? -value : value); - tokenType = TOKEN_INTEGER; - return(DONE); - } - - /* Handle additional digits. Beyond the boundary case, - * 10*(MAX_INTEGER/10) <= |number| <= MAX_INTEGER - * just count the digits: the number is too large to - * represent as an integer and will be returned as a real. - * The mantissa of a real holds fewer bits than an integer. - */ - p_value = value; - value = (m_sign == '-' ? -value : value); - scale = 0; - - if (isDECIMAL_DIGIT(ch)) { - - /* Handle the boundary case */ - if (p_value == (MAX_INTEGER/10)) { - digit = ch - '0'; - - /* Must handle positive and negative values separately */ - /* for 2's complement arithmetic */ - if (value > 0) { - if (digit <= MAX_INTEGER%10) - value = (value << 3) + (value << 1) + digit; - else - ++scale; /* Too big, just count it */ - } - else { - /* Use positive % operands for portability */ - if (digit <= -(MIN_INTEGER+10)%10) - value = (value << 3) + (value << 1) - digit; - else - ++scale; /* Too big, just count it */ - } - } - else - ++scale; /* Not boundary case, just count digit */ - - save_unsafe_ch(ch); - ch = next_ch(); - - /* Continue scanning digits, but can't store them */ - while(isDECIMAL_DIGIT(ch)) { - ++scale; - save_ch(ch); - ch = next_ch(); - } - } - - /* Continue from here scanning radix integer or real */ - m_value = value; - m_scale = scale; - - /* Initialize for possible real */ - e_sign = '+'; - e_value = 0; - - return(ch); -} - -static int -add_1st_decpt(int ch) -{ - m_sign = '+'; - return(add_decpt(ch)); -} - -static int -add_decpt(int ch) -{ - /* On entry, expect m_sign to be set to '+' or '-' */ - m_value = 0; - m_scale = 0; - save_unsafe_ch(ch); - return(next_ch()); -} - -static int -add_fraction(int ch) -{ - long value, scale; - int digit; - - /* On entry, expect m_value and m_scale to be initialized, - * and m_sign to be set to '+' or '-'. Expect m_value and m_sign - * to be consistent (this is not checked). - */ - value = m_value; - scale = m_scale; - - /* Scan leading zeroes */ - if (value == 0) { - while(ch == '0') { - --scale; - save_ch(ch); - ch = next_ch(); - } - - /* Scan first significant digit */ - if (isDECIMAL_DIGIT(ch)) { - --scale; - value = ch - '0'; - value = (m_sign == '-' ? -value : value); - save_ch(ch); - ch = next_ch(); - } - else - /* no significant digits -- number is zero */ - scale = 0; - } - /* value != 0 || value == 0 && !isDECIMAL_DIGIT(ch) */ - - /* Scan additional significant digits */ - if (isDECIMAL_DIGIT(ch)) { - if (value > 0) { - while(isDECIMAL_DIGIT(ch) && value < (MAX_INTEGER/10)) { - --scale; - value = (value << 3) + (value << 1) + (ch - '0'); - save_ch(ch); - ch = next_ch(); - } - /* Check boundary case */ - if (isDECIMAL_DIGIT(ch) && value == (MAX_INTEGER/10)) { - digit = ch - '0'; - if (digit <= MAX_INTEGER%10) { - --scale; - value = (value << 3) + (value << 1) + digit; - save_ch(ch); - ch = next_ch(); - } - } - } - else { - /* value < 0 */ - while(isDECIMAL_DIGIT(ch) && value > -(-(MIN_INTEGER+10)/10+1)) { - /* Use positive / operands for portability */ - --scale; - value = (value << 3) + (value << 1) - (ch - '0'); - save_ch(ch); - ch = next_ch(); - } - /* Check boundary case */ - if (isDECIMAL_DIGIT(ch) - && value == -(-(MIN_INTEGER+10)/10+1)) { - digit = ch - '0'; - if (digit <= -(MIN_INTEGER+10)%10) { - /* Use positive % operands for portability */ - --scale; - value = (value << 3) + (value << 1) - digit; - save_ch(ch); - ch = next_ch(); - } - } - } - - /* Additional digits can be discarded */ - while(isDECIMAL_DIGIT(ch)) { - save_ch(ch); - ch = next_ch(); - } - } - - /* Store results */ - m_value = value; - m_scale = scale; - - /* Initialize for possible real */ - e_sign = '+'; - e_value = 0; - - return(ch); -} - -static int -add_e_sign(int ch) -{ - e_sign = ch; - save_ch(ch); - return(next_ch()); -} - -static int -add_exponent(int ch) -{ - long value, p_value; - long scale = 0; - int digit; - - /* On entry, expect e_sign to be set to '+' or '-' */ - - value = ch - '0'; - save_ch(ch); - ch = next_ch(); - - while(isDECIMAL_DIGIT(ch) && value < (MAX_INTEGER/10)) { - value = (value << 3) + (value << 1) + (ch - '0'); - save_ch(ch); - ch = next_ch(); - } - - p_value = value; - value = (e_sign == '-' ? -value : value); - - /* Handle additional digits. Beyond the boundary case, - * 10*(MAX_INTEGER/10) <= |number| <= MAX_INTEGER - * just count the digits: the number is too large to - * represent as an integer. - */ - if (isDECIMAL_DIGIT(ch)) { - - /* Examine boundary case */ - if (p_value == (MAX_INTEGER/10)) { - digit = ch - '0'; - - /* Must handle positive and negative values separately */ - /* for 2's complement arithmetic */ - if (value > 0) { - if (digit <= MAX_INTEGER%10) - value = (value << 3) + (value << 1) + digit; - else - ++scale; /* Too big, just count it */ - } - else { - /* Use positive % operands for portability */ - if (digit <= -(MIN_INTEGER+10)%10) - value = (value << 3) + (value << 1) - digit; - else - ++scale; /* Too big, just count it */ - } - } - else - ++scale; /* Not boundary case, just count digit */ - - save_ch(ch); - ch = next_ch(); - - /* Continue scanning digits, but can't store any more */ - while(isDECIMAL_DIGIT(ch)) { - ++scale; - save_ch(ch); - ch = next_ch(); - } - } - - /* Store results */ - e_value = value; - - return(ch); -} - -static int -add_radix(int ch) -{ - if (2 <= m_value && m_value <= 36 && m_scale == 0) { - r_base = m_value; - save_ch(ch); - return(next_ch()); - } - else { - /* Radix invalid, complete a name token */ - return(AAH_NAME(ch)); - } -} - -static int -add_r_digits(int ch) -{ - unsigned long value; - long radix, scale; - int digit; - - /* NOTE: The syntax of a radix number allows only for - * values of zero or more. The value will be stored as - * a 32 bit integer, which PostScript then interprets - * as signed. This means, for example, that the numbers: - * - * 8#37777777777 - * 10#4294967295 - * 16#FFFFFFFF - * 36#1Z141Z3 - * - * are all interpreted as -1. This routine implements this - * idea explicitly: it accumulates the number's value - * as unsigned, then casts it to signed when done. - */ - - /* Expect r_base to be initialized */ - radix = r_base; - value = 0; - scale = 0; - - /* Scan leading zeroes */ - while(ch == '0') { - save_ch(ch); - ch = next_ch(); - } - - /* Handle first non-zero digit */ - if ((digit=digit_value[ch]) < radix) { - value = digit; - save_ch(ch); - ch = next_ch(); - - /* Add digits until boundary case reached */ - while((digit=digit_value[ch]) < radix - && value < (MAX_ULONG / radix)) { - value = value * radix + digit; - save_ch(ch); - ch = next_ch(); - }; - - /* Scan remaining digits */ - if ((digit=digit_value[ch]) < radix) { - - /* Examine boundary case --- - * radix*(MAX_ULONG/radix) <= number <= MAX_ULONG - */ - if (value == (MAX_ULONG/radix) && digit <= MAX_ULONG%radix) - value = value * radix + digit; - else - ++scale; - - /* Continue scanning digits, but can't store them */ - save_ch(ch); - ch = next_ch(); - while(digit_value[ch] < radix) { - ++scale; - save_ch(ch); - ch = next_ch(); - } - } - } - - /* Store result */ - r_value = (long) value; /* result is signed */ - r_scale = scale; - - return(ch); -} - -/* ------------------------------------------------------------------- - * Complete a number; set token type and done flag. - * Put current input character back, if it is not white space. - */ - -/* Done: Radix Number */ -static int -RADIX_NUMBER(int ch) -{ - back_ch_not_white(ch); - if (r_scale == 0) { - tokenValue.integer = r_value; - tokenType = TOKEN_INTEGER; - } - else { - tokenType = TOKEN_NAME; - } - return(DONE); -} - -/* Done: Integer */ -static int -INTEGER(int ch) -{ - back_ch_not_white(ch); - if (m_scale == 0) { - tokenValue.integer = m_value; - tokenType = TOKEN_INTEGER; - } - else { - tokenValue.real = (double)(m_value) * Exp10(m_scale); - tokenType = TOKEN_REAL; - } - return(DONE); -} - -/* Done: Real */ -static int -REAL(int ch) -{ - double temp; - - back_ch_not_white(ch); - - /* HAZARD: exponent overflow of intermediate result - * (e.g., in 370 floating point); this should not be a problem - * with IEEE floating point. Reduce exponent overflow hazard by - * combining m_scale and e_value first, if they have different signs, - * or multiplying m_value and one of the other factors, if both - * m_scale and e_value are negative. - */ - if ((m_scale >= 0 && e_value <= 0) - || (m_scale <= 0 && e_value >= 0)) { - tokenValue.real = (double)(m_value) * Exp10(m_scale + e_value); - } - else { - temp = (double)(m_value) * Exp10(m_scale); - tokenValue.real = temp * Exp10(e_value); - } - - tokenType = TOKEN_REAL; - return(DONE); -} - - -/* ------------------------------------------------------------------- - * Assemble a hex string; set token type and done flag. - */ - -/* Done: Hex String */ -static int -HEX_STRING(int ch) -{ - int value; - - while(TRUE) { - - /* Process odd digit */ - ch = next_ch(); - if (!isHEX_DIGIT(ch)) { - - /* Skip white space */ - while(isWHITE_SPACE(ch)) - ch = next_ch(); - - /* Check for terminator */ - if (!isHEX_DIGIT(ch)) { - break; - } - } - value = digit_value[ch] << 4; - - /* Process even digit */ - ch = next_ch(); - if (!isHEX_DIGIT(ch)) { - - /* Skip white space */ - while(isWHITE_SPACE(ch)) - ch = next_ch(); - - /* Check for terminator */ - if (!isHEX_DIGIT(ch)) { - save_ch(value); - break; - } - } - save_ch(value + digit_value[ch]); - } - - /* Classify result, based on why loop ended */ - if (ch == '>') - tokenType = TOKEN_HEX_STRING; - else { - /* save the invalid character for error reporting */ - save_ch(ch); - tokenType = TOKEN_INVALID; - } - - return(DONE); -} - -/* ------------------------------------------------------------------- - * Assemble a string; set token type and done flag - */ - -/* Save a backslash-coded character in a string -- - * - * Store the proper character for special cases - * "\b", "\f", "\n", "\r", and "\t". - * - * Decode and store octal-coded character, up to - * three octal digits, "\o", "\oo", and "\ooo". - * - * The sequence "\" is a line continuation, - * so consume both without storing anything. - * - * The sequence "\" is an error; exit without - * storing anything and let the caller handle it. - * - * For other characters, including the sequences - * "\\", "\(", and "\)", simply store the second - * character. - */ -static void -save_digraph(int ch) -{ - int value; - - switch (ch) { - - case 'b': /* backspace */ - ch = '\b'; - break; - - case 'f': /* formfeed */ - ch = '\f'; - break; - - case 'n': /* newline */ - ch = '\n'; - break; - - case 'r': /* carriage return */ - ch = '\r'; - break; - - case 't': /* horizontal tab */ - ch = '\t'; - break; - - case '\n': /* line continuation -- consume it */ - return; - - case '\r': /* carriage return -- consume it */ - ch = next_ch(); /* look at next character, is it \n? */ - if (ch == '\n') return; - back_ch(ch); /* if not a line feed, then return it */ - return; - - case EOF: /* end of file -- forget it */ - return; - - default: - /* scan up to three octal digits to get value */ - if (isOCTAL_DIGIT(ch)) { - value = digit_value[ch]; - ch = next_ch(); - if (isOCTAL_DIGIT(ch)) { - value = (value << 3) + digit_value[ch]; - ch = next_ch(); - if (isOCTAL_DIGIT(ch)) - value = (value << 3) + digit_value[ch]; - else - back_ch(ch); - } - else - back_ch(ch); - ch = value; - } - } - - /* Found a character to save */ - save_ch(ch); -} - -/* Done: String */ -static int -STRING(int ch) -{ - int nest_level = 1; - - tokenType = TOKEN_STRING; - - do { - - ch = next_ch(); - while(!isSTRING_SPECIAL(ch)) { - save_ch(ch); - ch = next_ch(); - }; - - switch (ch) { - - case '(': - ++nest_level; - save_ch(ch); - break; - - case ')': - if (--nest_level > 0) - save_ch(ch); - break; - - case '\\': - save_digraph(next_ch()); - break; - - case '\r': - /* All carriage returns (\r) are turned into linefeeds (\n)*/ - ch = next_ch(); /* get the next one, is it \n? */ - if (ch != '\n') { /* if not, then put it back. */ - back_ch(ch); - } - save_ch('\n'); /* in either case, save a linefeed */ - break; - - - case EOF: - tokenType = TOKEN_INVALID; /* Unterminated string */ - nest_level = 0; - break; - } - - } while(nest_level > 0); - - /* If there's room, add a 0-byte termination without increasing string - length. This fixes certain dependencies on 0-terminated strings */ - save_ch_no_inc(0); - - return(DONE); -} - - -/* ------------------------------------------------------------------- - * Assemble a name; set token type and done flag. - * Put current input character back, if it is not white space. - */ - -/* Done: Name - * (Safe version used to complete name tokens that - * start out looking like something else). - */ - -static int -AAH_NAME(int ch) -{ - do { - save_ch(ch); - ch = next_ch(); - } while(isNAME(ch)); - - back_ch_not_white(ch); - tokenType = TOKEN_NAME; - return(DONE); -} - -/* Done: Name */ -static int -NAME(int ch) -{ - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - while(isNAME(ch)) { - save_ch(ch); - ch = next_ch(); - } - } - } - } - } - } - } - - back_ch_not_white(ch); - tokenType = TOKEN_NAME; - return(DONE); -} - -/* Done: Literal Name */ -static int -LITERAL_NAME(int ch) -{ - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - while(isNAME(ch)) { - save_ch(ch); - ch = next_ch(); - } - } - } - } - } - } - } - - back_ch_not_white(ch); - tokenType = TOKEN_LITERAL_NAME; - return(DONE); -} - -/* Done: immediate Name */ -static int -IMMED_NAME(int ch) -{ - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - if (isNAME(ch)) { - save_unsafe_ch(ch); - ch = next_ch(); - while(isNAME(ch)) { - save_ch(ch); - ch = next_ch(); - } - } - } - } - } - } - } - - back_ch_not_white(ch); - tokenType = TOKEN_IMMED_NAME; - return(DONE); -} - -/* Done: Name found while looking for something else */ -static int -OOPS_NAME(int ch) -{ - back_ch_not_white(ch); - tokenType = TOKEN_NAME; - return(DONE); -} - - -/* ------------------------------------------------------------------- - * Complete a miscellaneous token; set token type and done flag. - */ - -/* Done: Unmatched Right Angle-Bracket */ -static int -RIGHT_ANGLE(int ch) -{ - tokenType = TOKEN_RIGHT_ANGLE; - return(DONE); -} - -/* Done: Unmatched Right Parenthesis */ -static int -RIGHT_PAREN(int ch) -{ - tokenType = TOKEN_RIGHT_PAREN; - return(DONE); -} - -/* Done: Left Brace */ -static int -LEFT_BRACE(int ch) -{ - tokenType = TOKEN_LEFT_BRACE; - return(DONE); -} - -/* Done: Right Brace */ -static int -RIGHT_BRACE(int ch) -{ - tokenType = TOKEN_RIGHT_BRACE; - return(DONE); -} - -/* Done: Left Bracket */ -static int -LEFT_BRACKET(int ch) -{ - save_unsafe_ch(ch); - tokenType = TOKEN_LEFT_BRACKET; - return(DONE); -} - -/* Done: Right Bracket */ -static int -RIGHT_BRACKET(int ch) -{ - save_unsafe_ch(ch); - tokenType = TOKEN_RIGHT_BRACKET; - return(DONE); -} - -/* Done: Break */ -static int -BREAK_SIGNAL(int ch) -{ - tokenType = TOKEN_BREAK; - return(DONE); -} - -/* Done: No Token Found */ -static int -NO_TOKEN(int ch) -{ - tokenType = TOKEN_EOF; - return(DONE); -} - - -/* - * ------------------------------------------------------------------- - * scan_token -- scan one token from the input. It uses a simple - * finite state machine to recognize token classes. - * - * The input is from a file. - * - * On entry -- - * - * inputP -> input PostScript object, a file. - * tokenStartP -> buffer in VM for accumulating the token. - * tokenMaxP -> last character in the token buffer - * - * On exit -- - * - * tokenLength = number of characters in the token - * tokenTooLong = TRUE if the token did not fit in the buffer - * tokenType = code for the type of token parsed. - * tokenValue = converted value of a numeric token. - * - * - * ------------------------------------------------------------------- - */ -void -scan_token(psobj *inputP) -{ - int ch; - unsigned char *stateP = s0; - unsigned char entry; - int (*actionP)(int); - - /* Define input source */ - inputFileP = inputP->data.fileP; - if (inputFileP == NULL) { - tokenType = TOKEN_EOF; - return; - } - - /* Ensure enough space for most cases - * (so we don't have to keep checking) - * The length needs to cover the maximum number - * of save_unsafe_ch() calls that might be executed. - * That number is 11 (a sign and 10 decimal digits, e.g., - * when scanning -2147483648), but use MAX_NAME_LEN - * in case someone changes that without checking. - */ - tokenStartP = vm_next_byte(); - tokenMaxP = tokenStartP + MIN(vm_free_bytes(), MAX_STRING_LEN); - - if ((tokenMaxP-tokenStartP) < (MAX_NAME_LEN)) { - tokenLength = 0; - tokenTooLong = TRUE; - tokenType = TOKEN_NONE; - tokenValue.integer = 0; - return; - } - - /* Reset token */ - tokenCharP = tokenStartP; - tokenTooLong = FALSE; - - /* Scan one token */ - ch = next_ch(); - do { - entry = stateP[ch]; - stateP = classActionTable[entry].nextStateP; - actionP = classActionTable[entry].actionRoutineP; - ch = (*actionP)(ch); - } while(ch != DONE); - - - /* Return results */ - tokenLength = tokenCharP - tokenStartP; -} diff --git a/nx-X11/lib/font/Type1/token.h b/nx-X11/lib/font/Type1/token.h deleted file mode 100644 index 663982889..000000000 --- a/nx-X11/lib/font/Type1/token.h +++ /dev/null @@ -1,79 +0,0 @@ -/* $Xorg: token.h,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/token.h,v 1.3 1999/08/22 08:58:54 dawes Exp $ */ - -#ifndef TOKEN_H -#define TOKEN_H - -/* Special characters */ -#define CONTROL_C (3) - -/* Token type codes */ -#define TOKEN_INVALID (-3) -#define TOKEN_BREAK (-2) -#define TOKEN_EOF (-1) -#define TOKEN_NONE (0) -#define TOKEN_LEFT_PAREN (1) -#define TOKEN_RIGHT_PAREN (2) -#define TOKEN_LEFT_ANGLE (3) -#define TOKEN_RIGHT_ANGLE (4) -#define TOKEN_LEFT_BRACE (5) -#define TOKEN_RIGHT_BRACE (6) -#define TOKEN_LEFT_BRACKET (7) -#define TOKEN_RIGHT_BRACKET (8) -#define TOKEN_NAME (9) -#define TOKEN_LITERAL_NAME (10) -#define TOKEN_INTEGER (11) -#define TOKEN_REAL (12) -#define TOKEN_RADIX_NUMBER (13) -#define TOKEN_HEX_STRING (14) -#define TOKEN_STRING (15) -#define TOKEN_IMMED_NAME (16) - -/* Token routines */ -extern void scan_token( psobj *inputP ); - -/* - * ------------------------------------------------------------------------- - * Globals shared -- (everyone else KEEP YOUR MITTS OFF THEM!) - * ------------------------------------------------------------------------- - */ - -/* These variables are set by the caller */ -extern char *tokenStartP; /* Pointer to token buffer in VM */ -extern char *tokenMaxP; /* Pointer to end of VM we may use + 1 */ - -/* These variables are set by P_TOKEN */ -extern int tokenLength; /* Characters in token */ -extern boolean tokenTooLong; /* Token too long for space available */ -extern int tokenType; /* Type of token identified */ -extern psvalue tokenValue; /* Token value */ - -#endif /* TOKEN_H */ diff --git a/nx-X11/lib/font/Type1/tokst.h b/nx-X11/lib/font/Type1/tokst.h deleted file mode 100644 index 02166afde..000000000 --- a/nx-X11/lib/font/Type1/tokst.h +++ /dev/null @@ -1,510 +0,0 @@ -/* $Xorg: tokst.h,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* $XFree86: xc/lib/font/Type1/tokst.h,v 1.3 1999/08/22 08:58:54 dawes Exp $ */ - -/* -------------------------------------- */ -/* --- MACHINE GENERATED, DO NOT EDIT --- */ -/* -------------------------------------- */ - -#ifndef TOKST -#define TOKST 1 - -/* - * State Index Tables -- - * - * These tables map the input character to the - * proper entry in the Class Action Table. - * There is one table for each state. - * - */ -#define s0 (si0+2) -static unsigned char si0[258] = { 0x10,0x11, - 0x02,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x02,0x02,0x0F,0x0F,0x02,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, - 0x02,0x0F,0x0F,0x0F,0x0F,0x03,0x0F,0x0F,0x05,0x0B,0x0F,0x0D,0x0F,0x0D,0x0E,0x04, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0F,0x0F,0x08,0x0F,0x0C,0x0F, - 0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0F,0x0A,0x0F,0x0F, - 0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0F,0x09,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F -}; - -#define s1 (si1+2) -static unsigned char si1[258] = { 0x14,0x15, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x12, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, - 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13 -}; - -#define s2 (si2+2) -static unsigned char si2[258] = { 0x1B,0x1C, - 0x16,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x16,0x16,0x1A,0x1A,0x16,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x16,0x1A,0x1A,0x1A,0x1A,0x17,0x1A,0x1A,0x17,0x17,0x1A,0x1A,0x1A,0x1A,0x19,0x17, - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1A,0x1A,0x17,0x1A,0x17,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x17,0x1A,0x17,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x17,0x1A,0x17,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, - 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A -}; - -#define s3 (si3+2) -static unsigned char si3[258] = { 0x23,0x24, - 0x1D,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x1D,0x1D,0x22,0x22,0x1D,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x1D,0x22,0x22,0x20,0x22,0x1E,0x22,0x22,0x1E,0x1E,0x22,0x22,0x22,0x22,0x1F,0x1E, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x1E,0x22,0x1E,0x22, - 0x22,0x22,0x22,0x22,0x22,0x21,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x1E,0x22,0x1E,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x21,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x1E,0x22,0x1E,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, - 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22 -}; - -#define s4 (si4+2) -static unsigned char si4[258] = { 0x29,0x2A, - 0x25,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x25,0x25,0x28,0x28,0x25,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x25,0x28,0x28,0x28,0x28,0x26,0x28,0x28,0x26,0x26,0x28,0x28,0x28,0x28,0x28,0x26, - 0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x27,0x28,0x28,0x26,0x28,0x26,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x26,0x28,0x26,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x26,0x28,0x26,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28 -}; - -#define s5 (si5+2) -static unsigned char si5[258] = { 0x30,0x31, - 0x2B,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2B,0x2B,0x2F,0x2F,0x2B,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2B,0x2F,0x2F,0x2F,0x2F,0x2C,0x2F,0x2F,0x2C,0x2C,0x2F,0x2F,0x2F,0x2F,0x2F,0x2C, - 0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2E,0x2F,0x2F,0x2C,0x2F,0x2C,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2D,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2C,0x2F,0x2C,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2D,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2C,0x2F,0x2C,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F, - 0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F,0x2F -}; - -#define s6 (si6+2) -static unsigned char si6[258] = { 0x36,0x37, - 0x32,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x32,0x32,0x35,0x35,0x32,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x32,0x35,0x35,0x35,0x35,0x33,0x35,0x35,0x33,0x33,0x35,0x35,0x35,0x35,0x35,0x33, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x33,0x35,0x33,0x35, - 0x35,0x35,0x35,0x35,0x35,0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x33,0x35,0x33,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x33,0x35,0x33,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, - 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35 -}; - -#define s7 (si7+2) -static unsigned char si7[258] = { 0x3D,0x3E, - 0x38,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x38,0x38,0x3C,0x3C,0x38,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x38,0x3C,0x3C,0x3C,0x3C,0x39,0x3C,0x3C,0x39,0x39,0x3C,0x3A,0x3C,0x3A,0x3C,0x39, - 0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3C,0x3C,0x39,0x3C,0x39,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x39,0x3C,0x39,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x39,0x3C,0x39,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, - 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C -}; - -#define s8 (si8+2) -static unsigned char si8[258] = { 0x43,0x44, - 0x3F,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3F,0x3F,0x42,0x42,0x3F,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x3F,0x42,0x42,0x42,0x42,0x40,0x42,0x42,0x40,0x40,0x42,0x42,0x42,0x42,0x42,0x40, - 0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x42,0x42,0x40,0x42,0x40,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x40,0x42,0x40,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x40,0x42,0x40,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42 -}; - -#define s9 (si9+2) -static unsigned char si9[258] = { 0x48,0x49, - 0x45,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x45,0x45,0x47,0x47,0x45,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x45,0x47,0x47,0x47,0x47,0x46,0x47,0x47,0x46,0x46,0x47,0x47,0x47,0x47,0x47,0x46, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x46,0x47,0x46,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x46,0x47,0x46,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x46,0x47,0x46,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47, - 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47 -}; - -#define s10 (si10+2) -static unsigned char si10[258] = { 0x4E,0x4F, - 0x4A,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4A,0x4A,0x4D,0x4D,0x4A,0x4D,0x4D, - 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D, - 0x4A,0x4D,0x4D,0x4D,0x4D,0x4B,0x4D,0x4D,0x4B,0x4B,0x4D,0x4D,0x4D,0x4D,0x4D,0x4B, - 0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4D,0x4D,0x4B,0x4D,0x4B,0x4D, - 0x4D,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C, - 0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4B,0x4D,0x4B,0x4D,0x4D, - 0x4D,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C, - 0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4C,0x4B,0x4D,0x4B,0x4D,0x4D, - 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D, - 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D, - 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D, - 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D, - 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D, - 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D, - 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D, - 0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D -}; - -#define s11 (si11+2) -static unsigned char si11[258] = { 0x53,0x54, - 0x50,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x50,0x50,0x52,0x52,0x50,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x50,0x52,0x52,0x52,0x52,0x51,0x52,0x52,0x51,0x51,0x52,0x52,0x52,0x52,0x52,0x51, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x51,0x52,0x51,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x51,0x52,0x51,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x51,0x52,0x51,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, - 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52 -}; - -/* - * Class Action Table -- - * - * The entries in the Class Action Table indicate the - * action routine to be called, and the next state to - * enter, for each relevant character class in each. - * state. There are several entries for each state. - * - */ -static int AAH_NAME ( int ch ); -static int BREAK_SIGNAL ( int ch ); -static int HEX_STRING ( int ch ); -static int IMMED_NAME ( int ch ); -static int INTEGER ( int ch ); -static int LEFT_BRACE ( int ch ); -static int LEFT_BRACKET ( int ch ); -static int LITERAL_NAME ( int ch ); -static int NAME ( int ch ); -static int NO_TOKEN ( int ch ); -static int OOPS_NAME ( int ch ); -static int RADIX_NUMBER ( int ch ); -static int REAL ( int ch ); -static int RIGHT_ANGLE ( int ch ); -static int RIGHT_BRACE ( int ch ); -static int RIGHT_BRACKET ( int ch ); -static int RIGHT_PAREN ( int ch ); -static int STRING ( int ch ); -static int add_1st_decpt ( int ch ); -static int add_1st_digits ( int ch ); -static int add_char ( int ch ); -static int add_decpt ( int ch ); -static int add_digits ( int ch ); -static int add_exponent ( int ch ); -static int add_e_sign ( int ch ); -static int add_fraction ( int ch ); -static int add_radix ( int ch ); -static int add_r_digits ( int ch ); -static int add_sign ( int ch ); -static int next_char ( int ch ); -static int skip_comment ( int ch ); -static int skip_space ( int ch ); - -static struct cat { - int (*actionRoutineP)(int); - unsigned char *nextStateP; -} classActionTable[] = { - - /* s0: Classify initial character */ - /* 00 ALPHA */ {NAME, s0}, /* executable name */ - /* 01 DIGIT */ {add_1st_digits, s3}, /* number? */ - /* 02 WHITE_SPACE */ {skip_space, s0}, /* skip white space */ - /* 03 PERCENT */ {skip_comment, s0}, /* comment? */ - /* 04 SLASH */ {next_char, s1}, /* literal or imm name */ - /* 05 LEFT_PAREN */ {STRING, s0}, /* string */ - /* 06 LEFT_BRACE */ {LEFT_BRACE, s0}, /* begin procedure body */ - /* 07 LEFT_BRACKET */ {LEFT_BRACKET, s0}, /* begin array */ - /* 08 LEFT_ANGLE */ {HEX_STRING, s0}, /* hex string? */ - /* 09 RIGHT_BRACE */ {RIGHT_BRACE, s0}, /* end procedure body */ - /* 0A RIGHT_BRACKET */ {RIGHT_BRACKET, s0}, /* end array */ - /* 0B RIGHT_PAREN */ {RIGHT_PAREN, s0}, /* unmatched right paren */ - /* 0C RIGHT_ANGLE */ {RIGHT_ANGLE, s0}, /* unmatched right angle */ - /* 0D SIGN */ {add_sign, s2}, /* signed number? */ - /* 0E DECIMAL_POINT */ {add_1st_decpt, s4}, /* real number? */ - /* 0F ANY */ {NAME, s0}, /* executable name */ - /* 10 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 11 EOF */ {NO_TOKEN, s0}, /* no token found */ - - /* s1: Further classify a '/' */ - /* 12 SLASH */ {IMMED_NAME, s0}, /* immediate name */ - /* 13 ANY */ {LITERAL_NAME, s0}, /* literal name */ - /* 14 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 15 EOF */ {OOPS_NAME, s0}, /* isolated sign */ - - /* s2: sign */ - /* 16 WHITE_SPACE */ {OOPS_NAME, s0}, /* isolated sign */ - /* 17 SPECIAL */ {OOPS_NAME, s0}, /* isolated sign */ - /* 18 DIGIT */ {add_digits, s3}, /* number? */ - /* 19 DECIMAL_POINT */ {add_decpt, s4}, /* real number? */ - /* 1A ANY */ {NAME, s0}, /* executable name */ - /* 1B BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 1C EOF */ {OOPS_NAME, s0}, /* isolated sign */ - - /* s3: sign? digit+ */ - /* 1D WHITE_SPACE */ {INTEGER, s0}, /* n-digit integer */ - /* 1E SPECIAL */ {INTEGER, s0}, /* n-digit integer */ - /* 1F DECIMAL_POINT */ {add_char, s5}, /* real number? */ - /* 20 POUND */ {add_radix, s10}, /* radix number? */ - /* 21 eE */ {add_char, s7}, /* real with exponent? */ - /* 22 ANY */ {AAH_NAME, s0}, /* executable name */ - /* 23 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 24 EOF */ {INTEGER, s0}, /* n-digit integer */ - - /* s4: sign? . */ - /* 25 WHITE_SPACE */ {OOPS_NAME, s0}, /* isolated +. or -. */ - /* 26 SPECIAL */ {OOPS_NAME, s0}, /* isolated +. or -. */ - /* 27 DIGIT */ {add_fraction, s6}, /* number? */ - /* 28 ANY */ {NAME, s0}, /* executable name */ - /* 29 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 2A EOF */ {OOPS_NAME, s0}, /* isolated +. or -. */ - - /* s5: sign? digit+ . */ - /* 2B WHITE_SPACE */ {REAL, s0}, /* real with fraction */ - /* 2C SPECIAL */ {REAL, s0}, /* real with fraction */ - /* 2D eE */ {add_char, s7}, /* real with exponent? */ - /* 2E DIGIT */ {add_fraction, s6}, /* number? */ - /* 2F ANY */ {AAH_NAME, s0}, /* executable name */ - /* 30 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 31 EOF */ {REAL, s0}, /* real with fraction */ - - /* s6: sign? (digit+ . digit+) | (. digit+) */ - /* 32 WHITE_SPACE */ {REAL, s0}, /* real with fraction */ - /* 33 SPECIAL */ {REAL, s0}, /* real with fraction */ - /* 34 eE */ {add_char, s7}, /* real with exponent? */ - /* 35 ANY */ {AAH_NAME, s0}, /* executable name */ - /* 36 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 37 EOF */ {REAL, s0}, /* real with fraction */ - - /* s7: sign? ((digit+ (. digit*)?) | (. digit+)) Ee */ - /* 38 WHITE_SPACE */ {OOPS_NAME, s0}, /* invalid real number */ - /* 39 SPECIAL */ {OOPS_NAME, s0}, /* invalid real number */ - /* 3A SIGN */ {add_e_sign, s8}, /* real w signed exponent? */ - /* 3B DIGIT */ {add_exponent, s9}, /* real w exponent ? */ - /* 3C ANY */ {AAH_NAME, s0}, /* executable name */ - /* 3D BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 3E EOF */ {OOPS_NAME, s0}, /* invalid real number */ - - /* s8: sign? (digit+ (. digit*)? | (digit* . digit+) Ee sign */ - /* 3F WHITE_SPACE */ {OOPS_NAME, s0}, /* invalid real number */ - /* 40 SPECIAL */ {OOPS_NAME, s0}, /* invalid real number */ - /* 41 DIGIT */ {add_exponent, s9}, /* real w exponent? */ - /* 42 ANY */ {AAH_NAME, s0}, /* executable name */ - /* 43 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 44 EOF */ {OOPS_NAME, s0}, /* invalid real number */ - - /* s9: sign? (digit+ (. digit*)? | (digit* . digit+) Ee sign? digit+ */ - /* 45 WHITE_SPACE */ {REAL, s0}, /* real w exponent */ - /* 46 SPECIAL */ {REAL, s0}, /* real w exponent */ - /* 47 ANY */ {AAH_NAME, s0}, /* executable name */ - /* 48 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 49 EOF */ {REAL, s0}, /* real w exponent */ - - /* s10: digit+ # */ - /* 4A WHITE_SPACE */ {OOPS_NAME, s0}, /* invalid radix number */ - /* 4B SPECIAL */ {OOPS_NAME, s0}, /* invalid radix number */ - /* 4C R_DIGIT */ {add_r_digits, s11}, /* radix number? */ - /* 4D ANY */ {AAH_NAME, s0}, /* executable name */ - /* 4E BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 4F EOF */ {OOPS_NAME, s0}, /* invalid radix number */ - - /* s11: digit+ # r_digit+ */ - /* 50 WHITE_SPACE */ {RADIX_NUMBER, s0}, /* radix number */ - /* 51 SPECIAL */ {RADIX_NUMBER, s0}, /* radix number */ - /* 52 ANY */ {AAH_NAME, s0}, /* executable name */ - /* 53 BREAK */ {BREAK_SIGNAL, s0}, /* break signalled */ - /* 54 EOF */ {RADIX_NUMBER, s0} /* radix number */ -}; - -/* - * Character Classification Tables -- - * - * The entries in the Character Classification Tables - * map character codes to character classes. The - * tables contains one entry per code. The bits in - * each entry indicate which classes the character - * code belongs to. - * - * The macros 'isInCLASS(ch)' generate code to test - * whether 'ch' is a character in 'CLASS'. - * - */ -/* Membership macros for classes defined in table 1 ... */ -#define isRADIX_DIGIT(c) ((isInP1[c] & 0x80) != 0) -#define isHEX_DIGIT(c) ((isInP1[c] & 0x40) != 0) -#define isDECIMAL_DIGIT(c) ((isInP1[c] & 0x10) != 0) -#define isOCTAL_DIGIT(c) ((isInP1[c] & 0x20) != 0) - -/* Membership macros for classes defined in table 2 ... */ -#define isWHITE_SPACE(c) ((isInP2[c] & 0x80) != 0) -#define isCOMMENT(c) ((isInP2[c] & 0x40) != 0) -#define isNAME(c) ((isInP2[c] & 0x20) != 0) -#define isSTRING_SPECIAL(c) ((isInP2[c] & 0x10) != 0) -#define isNUMBER_ENDER(c) ((isInP2[c] & 0x08) != 0) - -#define isInP1 (isInT1+2) -static unsigned char isInT1[258] = { 0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xD0,0xD0,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00, - 0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -#define isInP2 (isInT2+2) -static unsigned char isInT2[258] = { 0x18,0x18, - 0xC8,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xC8,0x88,0x60,0x60,0x98,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0xC8,0x60,0x60,0x60,0x60,0x48,0x60,0x60,0x58,0x58,0x60,0x60,0x60,0x60,0x60,0x48, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x48,0x60,0x48,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x48,0x70,0x48,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x48,0x60,0x48,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60 -}; - -#endif diff --git a/nx-X11/lib/font/Type1/trig.h b/nx-X11/lib/font/Type1/trig.h deleted file mode 100644 index d569ed067..000000000 --- a/nx-X11/lib/font/Type1/trig.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Xorg: trig.h,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM 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. - */ -/*SHARED*/ - -/* $XFree86: xc/lib/font/Type1/trig.h,v 1.2 1998/07/25 06:57:00 dawes Exp $ */ - -#undef DegreeCos -#undef DegreeSin -#undef sqrt - -#define DegreeCos(d) xiStub() -#define DegreeSin(d) xiStub() -#define sqrt(d) xiStub() - diff --git a/nx-X11/lib/font/Type1/type1.c b/nx-X11/lib/font/Type1/type1.c deleted file mode 100644 index b3fa4965a..000000000 --- a/nx-X11/lib/font/Type1/type1.c +++ /dev/null @@ -1,1892 +0,0 @@ -/* $Xorg: type1.c,v 1.4 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines, Corp. 1991 - * All Rights Reserved - * Copyright Lexmark International, Inc. 1991 - * All Rights Reserved - * Portions Copyright (c) 1990 Adobe Systems Incorporated. - * All Rights Reserved - * - * License 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 IBM or Lexmark or Adobe - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. - * - * IBM, LEXMARK, AND ADOBE PROVIDE THIS SOFTWARE "AS IS", WITHOUT ANY - * WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE - * ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE, INCLUDING - * ANY DUTY TO SUPPORT OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY - * PORTION OF THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM, - * LEXMARK, OR ADOBE) ASSUMES THE ENTIRE COST OF ALL SERVICING, REPAIR AND - * CORRECTION. IN NO EVENT SHALL IBM, LEXMARK, OR ADOBE BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/type1.c,v 1.9tsi Exp $ */ - -/*********************************************************************/ -/* */ -/* Type 1 module - Converting fonts in Adobe Type 1 Font Format */ -/* to scaled and hinted paths for rasterization. */ -/* Files: type1.c, type1.h, and blues.h. */ -/* */ -/* Authors: Sten F. Andler, IBM Almaden Research Center */ -/* (Type 1 interpreter, stem & flex hints) */ -/* */ -/* Patrick A. Casey, Lexmark International, Inc. */ -/* (Font level hints & stem hints) */ -/* */ -/*********************************************************************/ - -/******************/ -/* Include Files: */ -/******************/ -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#ifndef FONTMODULE -#include /* a system-dependent include, usually */ -#include -#else -#include "Xdefs.h" -#include "Xmd.h" -#include "xf86_ansic.h" -#endif -#include "objects.h" -#include "spaces.h" -#include "paths.h" -#include "fonts.h" /* understands about TEXTTYPEs */ -#include "pictures.h" /* understands about handles */ -#include "range.h" - -typedef struct xobject xobject; -#include "util.h" /* PostScript objects */ -#include "fontfcn.h" -#include "blues.h" /* Blues structure for font-level hints */ - -/**********************************/ -/* Type1 Constants and Structures */ -/**********************************/ -#define MAXSTACK 24 /* Adobe Type1 limit */ -#define MAXCALLSTACK 10 /* Adobe Type1 limit */ -#define MAXPSFAKESTACK 32 /* Max depth of fake PostScript stack (local) */ -#define MAXSTRLEN 512 /* Max length of a Type 1 string (local) */ -#define MAXLABEL 256 /* Maximum number of new hints */ -#if XFONT_CID -#define MAXSTEMS 500 /* Maximum number of VSTEM and HSTEM hints */ -#else -#define MAXSTEMS 128 /* Maximum number of VSTEM and HSTEM hints */ -#endif -#define EPS 0.001 /* Small number for comparisons */ - -/************************************/ -/* Adobe Type 1 CharString commands */ -/************************************/ -#define HSTEM 1 -#define VSTEM 3 -#define VMOVETO 4 -#define RLINETO 5 -#define HLINETO 6 -#define VLINETO 7 -#define RRCURVETO 8 -#define CLOSEPATH 9 -#define CALLSUBR 10 -#define RETURN 11 -#define ESCAPE 12 -#define HSBW 13 -#define ENDCHAR 14 -#define RMOVETO 21 -#define HMOVETO 22 -#define VHCURVETO 30 -#define HVCURVETO 31 - -/*******************************************/ -/* Adobe Type 1 CharString Escape commands */ -/*******************************************/ -#define DOTSECTION 0 -#define VSTEM3 1 -#define HSTEM3 2 -#define SEAC 6 -#define SBW 7 -#define DIV 12 -#define CALLOTHERSUBR 16 -#define POP 17 -#define SETCURRENTPOINT 33 - -/*****************/ -/* Useful macros */ -/*****************/ - -#define FABS(x) fabs(x) - -#define CEIL(x) ceil(x) - -#define FLOOR(x) floor(x) - -#define ROUND(x) FLOOR((x) + 0.5) - -#define ODD(x) (((int)(x)) & 01) - -#define Error {errflag = TRUE; return;} -#define ErrorRet(ret) {errflag = TRUE; return (ret);} - -/********************/ -/* global variables */ -/********************/ -struct stem { /* representation of a STEM hint */ - int vertical; /* TRUE if vertical, FALSE otherwise */ - double x, dx; /* interval of vertical stem */ - double y, dy; /* interval of horizontal stem */ - struct segment *lbhint, *lbrevhint; /* left or bottom hint adjustment */ - struct segment *rthint, *rtrevhint; /* right or top hint adjustment */ -}; - -struct xobject *Type1Char(char *env, struct XYspace *S, - psobj *charstrP, psobj *subrsP, psobj *osubrsP, - struct blues_struct *bluesP, int *modeP); -#if XFONT_CID -struct xobject *CIDChar(char *env, struct XYspace *S, - psobj *charstrP, psobj *subrsP, psobj *osubrsP, - struct blues_struct *bluesP, int *modeP); -#endif - -static double escapementX, escapementY; -static double sidebearingX, sidebearingY; -static double accentoffsetX, accentoffsetY; - -static struct segment *path; -static int errflag; - -/*************************************************/ -/* Global variables to hold Type1Char parameters */ -/*************************************************/ -static char *Environment; -static struct XYspace *CharSpace; -static psobj *CharStringP, *SubrsP; - -/************************/ -/* Forward declarations */ -/************************/ -static struct segment *Applyhint ( struct segment *p, int stemnumber, - int half ); -static struct segment *Applyrevhint ( struct segment *p, int stemnumber, - int half ); -static void CallOtherSubr ( int othersubrno ); -static void CallSubr ( int subrno ); -static struct segment *CenterStem ( double edge1, double edge2 ); -static void ClearCallStack ( void ); -static void ClearPSFakeStack ( void ); -static void ClearStack ( void ); -static void ComputeAlignmentZones ( void ); -static void ComputeStem ( int stemno ); -static void Decode ( int Code ); -static unsigned char Decrypt ( unsigned char cipher ); -static double Div ( double num1, double num2 ); -static void DoClosePath ( void ); -static void DoCommand ( int Code ); -static int DoRead ( int *CodeP ); -static void DotSection ( void ); -static void EndChar ( void ); -static void Escape ( int Code ); -static struct segment *FindStems ( double x, double y, double dx, double dy ); -static void FinitStems ( void ); -static void FlxProc ( double c1x2, double c1y2, double c3x0, double c3y0, - double c3x1, double c3y1, double c3x2, double c3y2, - double c4x0, double c4y0, double c4x1, double c4y1, - double c4x2, double c4y2, double epY, double epX, - int idmin ); -static void FlxProc1 ( void ); -static void FlxProc2 ( void ); -static void HintReplace ( void ); -static void HStem ( double y, double dy ); -static void InitStems ( void ); -static void PopCall ( psobj **CurrStrPP, int *CurrIndexP, - unsigned short *CurrKeyP ); -static double PSFakePop ( void ); -static void PSFakePush ( double Num ); -static void Push ( double Num ); -static void PushCall ( psobj *CurrStrP, int CurrIndex, - unsigned short CurrKey ); -static void Return ( void ); -static void RLineTo ( double dx, double dy ); -static void RMoveTo ( double dx, double dy ); -static void RRCurveTo ( double dx1, double dy1, double dx2, double dy2, - double dx3, double dy3 ); -static void Sbw ( double sbx, double sby, double wx, double wy ); -static void Seac ( double asb, double adx, double ady, unsigned char bchar, - unsigned char achar ); -static void SetCurrentPoint ( double x, double y ); -static void StartDecrypt ( void ); -static void VStem ( double x, double dx ); - -/*****************************************/ -/* statics for Flex procedures (FlxProc) */ -/*****************************************/ -static struct segment *FlxOldPath; /* save path before Flex feature */ - -/******************************************************/ -/* statics for Font level hints (Blues) (see blues.h) */ -/******************************************************/ -static struct blues_struct *blues; /* the blues structure */ -static struct alignmentzone alignmentzones[MAXALIGNMENTZONES]; -static int numalignmentzones; /* total number of alignment zones */ - -/****************************************************************/ -/* Subroutines for the Font level hints (Alignment zones, etc.) */ -/****************************************************************/ - -/******************************************/ -/* Fill in the alignment zone structures. */ -/******************************************/ -static void -ComputeAlignmentZones(void) -{ - int i; - double dummy, bluezonepixels, familyzonepixels; - struct segment *p; - - numalignmentzones = 0; /* initialize total # of zones */ - - /* do the BlueValues zones */ - for (i = 0; i < blues->numBlueValues; i +=2, ++numalignmentzones) { - /* the 0th & 1st numbers in BlueValues are for a bottom zone */ - /* the rest are topzones */ - if (i == 0) /* bottom zone */ - alignmentzones[numalignmentzones].topzone = FALSE; - else /* top zone */ - alignmentzones[numalignmentzones].topzone = TRUE; - if (i < blues->numFamilyBlues) { /* we must consider FamilyBlues */ - p = ILoc(CharSpace,0,blues->BlueValues[i] - blues->BlueValues[i+1]); - QueryLoc(p, IDENTITY, &dummy, &bluezonepixels); - Destroy(p); - p = ILoc(CharSpace,0,blues->FamilyBlues[i]-blues->FamilyBlues[i+1]); - QueryLoc(p, IDENTITY, &dummy, &familyzonepixels); - Destroy(p); - /* is the difference in size of the zones less than 1 pixel? */ - if (FABS(bluezonepixels - familyzonepixels) < 1.0) { - /* use the Family zones */ - alignmentzones[numalignmentzones].bottomy = - blues->FamilyBlues[i]; - alignmentzones[numalignmentzones].topy = - blues->FamilyBlues[i+1]; - continue; - } - } - /* use this font's Blue zones */ - alignmentzones[numalignmentzones].bottomy = blues->BlueValues[i]; - alignmentzones[numalignmentzones].topy = blues->BlueValues[i+1]; - } - - /* do the OtherBlues zones */ - for (i = 0; i < blues->numOtherBlues; i +=2, ++numalignmentzones) { - /* all of the OtherBlues zones are bottom zones */ - alignmentzones[numalignmentzones].topzone = FALSE; - if (i < blues->numFamilyOtherBlues) {/* consider FamilyOtherBlues */ - p = ILoc(CharSpace,0,blues->OtherBlues[i] - blues->OtherBlues[i+1]); - QueryLoc(p, IDENTITY, &dummy, &bluezonepixels); - Destroy(p); - p = ILoc(CharSpace,0,blues->FamilyOtherBlues[i] - - blues->FamilyOtherBlues[i+1]); - QueryLoc(p, IDENTITY, &dummy, &familyzonepixels); - Destroy(p); - /* is the difference in size of the zones less than 1 pixel? */ - if (FABS(bluezonepixels - familyzonepixels) < 1.0) { - /* use the Family zones */ - alignmentzones[numalignmentzones].bottomy = - blues->FamilyOtherBlues[i]; - alignmentzones[numalignmentzones].topy = - blues->FamilyOtherBlues[i+1]; - continue; - } - } - /* use this font's Blue zones (as opposed to the Family Blues */ - alignmentzones[numalignmentzones].bottomy = blues->OtherBlues[i]; - alignmentzones[numalignmentzones].topy = blues->OtherBlues[i+1]; - } -} - -/**********************************************************************/ -/* Subroutines and statics for handling of the VSTEM and HSTEM hints. */ -/**********************************************************************/ -static int InDotSection; /* DotSection flag */ -static struct stem stems[MAXSTEMS]; /* All STEM hints */ -static int numstems; /* Number of STEM hints */ -static int currstartstem; /* The current starting stem. */ -static int oldvert, oldhor; /* Remember hint in effect */ -static int oldhorhalf, oldverthalf; /* Remember which half of the stem */ -static double wsoffsetX, wsoffsetY; /* White space offset - for VSTEM3,HSTEM3 */ -static int wsset; /* Flag for whether we've set wsoffsetX,Y */ - -static void -InitStems(void) /* Initialize the STEM hint data structures */ -{ - InDotSection = FALSE; - currstartstem = numstems = 0; - oldvert = oldhor = -1; -} - -static void -FinitStems(void) /* Terminate the STEM hint data structures */ -{ - int i; - - for (i = 0; i < numstems; i++) { - Destroy(stems[i].lbhint); - Destroy(stems[i].lbrevhint); - Destroy(stems[i].rthint); - Destroy(stems[i].rtrevhint); - } -} - -/*******************************************************************/ -/* Compute the dislocation that a stemhint should cause for points */ -/* inside the stem. */ -/*******************************************************************/ -static void -ComputeStem(int stemno) -{ - int verticalondevice, idealwidth; - double stemstart, stemwidth; - struct segment *p; - int i; - double stembottom, stemtop, flatposition; - double Xpixels, Ypixels; - double unitpixels, onepixel; - int suppressovershoot, enforceovershoot; - double stemshift, flatpospixels, overshoot; - double widthdiff; /* Number of character space units to adjust width */ - double lbhintvalue, rthintvalue; - double cxx, cyx, cxy, cyy; /* Transformation matrix */ - int rotated; /* TRUE if character is on the side, FALSE if upright */ - - /************************************************/ - /* DETERMINE ORIENTATION OF CHARACTER ON DEVICE */ - /************************************************/ - - QuerySpace(CharSpace, &cxx, &cyx, &cxy, &cyy); /* Transformation matrix */ - - if (FABS(cxx) < 0.00001 || FABS(cyy) < 0.00001) - rotated = TRUE; /* Char is on side (90 or 270 degrees), possibly oblique. */ - else if (FABS(cyx) < 0.00001 || FABS(cxy) < 0.00001) - rotated = FALSE; /* Char is upright (0 or 180 degrees), possibly oblique. */ - else { - stems[stemno].lbhint = NULL; /* Char is at non-axial angle, ignore hints. */ - stems[stemno].lbrevhint = NULL; - stems[stemno].rthint = NULL; - stems[stemno].rtrevhint = NULL; - return; - } - - /* Determine orientation of stem */ - - if (stems[stemno].vertical) { - verticalondevice = !rotated; - stemstart = stems[stemno].x; - stemwidth = stems[stemno].dx; - } else { - verticalondevice = rotated; - stemstart = stems[stemno].y; - stemwidth = stems[stemno].dy; - } - - /* Determine how many pixels (non-negative) correspond to 1 character space - unit (unitpixels), and how many character space units (non-negative) - correspond to one pixel (onepixel). */ - - if (stems[stemno].vertical) - p = ILoc(CharSpace, 1, 0); - else - p = ILoc(CharSpace, 0, 1); - QueryLoc(p, IDENTITY, &Xpixels, &Ypixels); - Destroy(p); - if (verticalondevice) - unitpixels = FABS(Xpixels); - else - unitpixels = FABS(Ypixels); - - onepixel = 1.0 / unitpixels; - - /**********************/ - /* ADJUST STEM WIDTHS */ - /**********************/ - - widthdiff = 0.0; - - /* Find standard stem with smallest width difference from this stem */ - if (stems[stemno].vertical) { /* vertical stem */ - if (blues->StdVW != 0) /* there is an entry for StdVW */ - widthdiff = blues->StdVW - stemwidth; - for (i = 0; i < blues->numStemSnapV; ++i) { /* now look at StemSnapV */ - if (blues->StemSnapV[i] - stemwidth < widthdiff) - /* this standard width is the best match so far for this stem */ - widthdiff = blues->StemSnapV[i] - stemwidth; - } - } else { /* horizontal stem */ - if (blues->StdHW != 0) /* there is an entry for StdHW */ - widthdiff = blues->StdHW - stemwidth; - for (i = 0; i < blues->numStemSnapH; ++i) { /* now look at StemSnapH */ - if (blues->StemSnapH[i] - stemwidth < widthdiff) - /* this standard width is the best match so far for this stem */ - widthdiff = blues->StemSnapH[i] - stemwidth; - } - } - - /* Only expand or contract stems if they differ by less than 1 pixel from - the closest standard width, otherwise make the width difference = 0. */ - if (FABS(widthdiff) > onepixel) - widthdiff = 0.0; - - /* Expand or contract stem to the nearest integral number of pixels. */ - idealwidth = ROUND((stemwidth + widthdiff) * unitpixels); - /* Ensure that all stems are at least one pixel wide. */ - if (idealwidth == 0) - idealwidth = 1; - /* Apply ForceBold to vertical stems. */ - if (blues->ForceBold && stems[stemno].vertical) - /* Force this vertical stem to be at least DEFAULTBOLDSTEMWIDTH wide. */ - if (idealwidth < DEFAULTBOLDSTEMWIDTH) - idealwidth = DEFAULTBOLDSTEMWIDTH; - /* Now compute the number of character space units necessary */ - widthdiff = idealwidth * onepixel - stemwidth; - - /*********************************************************************/ - /* ALIGNMENT ZONES AND OVERSHOOT SUPPRESSION - HORIZONTAL STEMS ONLY */ - /*********************************************************************/ - - stemshift = 0.0; - - if (!stems[stemno].vertical) { - - /* Get bottom and top boundaries of the stem. */ - stembottom = stemstart; - stemtop = stemstart + stemwidth; - - /* Find out if this stem intersects an alignment zone (the BlueFuzz */ - /* entry in the Private dictionary specifies the number of character */ - /* units to extend (in both directions) the effect of an alignment */ - /* zone on a horizontal stem. The default value of BlueFuzz is 1. */ - for (i = 0; i < numalignmentzones; ++i) { - if (alignmentzones[i].topzone) { - if (stemtop >= alignmentzones[i].bottomy && - stemtop <= alignmentzones[i].topy + blues->BlueFuzz) { - break; /* We found a top-zone */ - } - } else { - if (stembottom <= alignmentzones[i].topy && - stembottom >= alignmentzones[i].bottomy - blues->BlueFuzz) { - break; /* We found a bottom-zone */ - } - } - } - - if (i < numalignmentzones) { /* We found an intersecting zone (number i). */ - suppressovershoot = FALSE; - enforceovershoot = FALSE; - - /* When 1 character space unit is rendered smaller than BlueScale - device units (pixels), we must SUPPRESS overshoots. Otherwise, - if the top (or bottom) of this stem is more than BlueShift character - space units away from the flat position, we must ENFORCE overshoot. */ - - if (unitpixels < blues->BlueScale) - suppressovershoot = TRUE; - else - if (alignmentzones[i].topzone) { - if (stemtop >= alignmentzones[i].bottomy + blues->BlueShift) - enforceovershoot = TRUE; - } else - if (stembottom <= alignmentzones[i].topy - blues->BlueShift) - enforceovershoot = TRUE; - - /*************************************************/ - /* ALIGN THE FLAT POSITION OF THE ALIGNMENT ZONE */ - /*************************************************/ - - /* Compute the position of the alignment zone's flat position in - device space and the amount of shift needed to align it on a - pixel boundary. Move all stems this amount. */ - - if (alignmentzones[i].topzone) - flatposition = alignmentzones[i].bottomy; - else - flatposition = alignmentzones[i].topy; - - /* Find the flat position in pixels */ - flatpospixels = flatposition * unitpixels; - - /* Find the stem shift necessary to align the flat - position on a pixel boundary, and use this shift for all stems */ - stemshift = (ROUND(flatpospixels) - flatpospixels) * onepixel; - - /************************************************/ - /* HANDLE OVERSHOOT ENFORCEMENT AND SUPPRESSION */ - /************************************************/ - - /* Compute overshoot amount (non-negative) */ - if (alignmentzones[i].topzone) - overshoot = stemtop - flatposition; - else - overshoot = flatposition - stembottom; - - if (overshoot > 0.0) { - /* ENFORCE overshoot by shifting the entire stem (if necessary) so that - it falls at least one pixel beyond the flat position. */ - - if (enforceovershoot) - if (overshoot < onepixel) { - if (alignmentzones[i].topzone) - stemshift += onepixel - overshoot; - else - stemshift -= onepixel - overshoot; - } - /* SUPPRESS overshoot by aligning the stem to the alignment zone's - flat position. */ - - if (suppressovershoot) { - if (alignmentzones[i].topzone) - stemshift -= overshoot; - else - stemshift += overshoot; - } - } - - /************************************************************/ - /* COMPUTE HINT VALUES FOR EACH SIDE OF THE HORIZONTAL STEM */ - /************************************************************/ - - /* If the stem was aligned by a topzone, we expand or contract the stem - only at the bottom - since the stem top was aligned by the zone. - If the stem was aligned by a bottomzone, we expand or contract the stem - only at the top - since the stem bottom was aligned by the zone. */ - if (alignmentzones[i].topzone) { - lbhintvalue = stemshift - widthdiff; /* bottom */ - rthintvalue = stemshift; /* top */ - } else { - lbhintvalue = stemshift; /* bottom */ - rthintvalue = stemshift + widthdiff; /* top */ - } - - stems[stemno].lbhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, lbhintvalue)); - stems[stemno].lbrevhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, -lbhintvalue)); - stems[stemno].rthint = (struct segment *)Permanent(Loc(CharSpace, 0.0, rthintvalue)); - stems[stemno].rtrevhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, -rthintvalue)); - - return; - - } /* endif (i < numalignmentzones) */ - - /* We didn't find any alignment zones intersecting this stem, so - proceed with normal stem alignment below. */ - - } /* endif (!stems[stemno].vertical) */ - - /* Align stem with pixel boundaries on device */ - stemstart = stemstart - widthdiff / 2; - stemshift = ROUND(stemstart * unitpixels) * onepixel - stemstart; - - /* Adjust the boundaries of the stem */ - lbhintvalue = stemshift - widthdiff / 2; /* left or bottom */ - rthintvalue = stemshift + widthdiff / 2; /* right or top */ - - if (stems[stemno].vertical) { - stems[stemno].lbhint = (struct segment *)Permanent(Loc(CharSpace, lbhintvalue, 0.0)); - stems[stemno].lbrevhint = (struct segment *)Permanent(Loc(CharSpace, -lbhintvalue, 0.0)); - stems[stemno].rthint = (struct segment *)Permanent(Loc(CharSpace, rthintvalue, 0.0)); - stems[stemno].rtrevhint = (struct segment *)Permanent(Loc(CharSpace, -rthintvalue, 0.0)); - } else { - stems[stemno].lbhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, lbhintvalue)); - stems[stemno].lbrevhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, -lbhintvalue)); - stems[stemno].rthint = (struct segment *)Permanent(Loc(CharSpace, 0.0, rthintvalue)); - stems[stemno].rtrevhint = (struct segment *)Permanent(Loc(CharSpace, 0.0, -rthintvalue)); - } -} - -#define LEFT 1 -#define RIGHT 2 -#define BOTTOM 3 -#define TOP 4 - -/*********************************************************************/ -/* Adjust a point using the given stem hint. Use the left/bottom */ -/* hint value or the right/top hint value depending on where the */ -/* point lies in the stem. */ -/*********************************************************************/ -static struct segment * -Applyhint(struct segment *p, int stemnumber, int half) -{ - if (half == LEFT || half == BOTTOM) - return Join(p, stems[stemnumber].lbhint); /* left or bottom hint */ - else - return Join(p, stems[stemnumber].rthint); /* right or top hint */ -} - -/*********************************************************************/ -/* Adjust a point using the given reverse hint. Use the left/bottom */ -/* hint value or the right/top hint value depending on where the */ -/* point lies in the stem. */ -/*********************************************************************/ -static struct segment * -Applyrevhint(struct segment *p, int stemnumber, int half) -{ - if (half == LEFT || half == BOTTOM) - return Join(p, stems[stemnumber].lbrevhint); /* left or bottom hint */ - else - return Join(p, stems[stemnumber].rtrevhint); /* right or top hint */ -} - -/***********************************************************************/ -/* Find the vertical and horizontal stems that the current point */ -/* (x, y) may be involved in. At most one horizontal and one vertical */ -/* stem can apply to a single point, since there are no overlaps */ -/* allowed. */ -/* The actual hintvalue is returned as a location. */ -/* Hints are ignored inside a DotSection. */ -/***********************************************************************/ -static struct segment * -FindStems(double x, double y, double dx, double dy) -{ - int i; - int newvert, newhor; - struct segment *p; - int newhorhalf, newverthalf; - - if (InDotSection) return(NULL); - - newvert = newhor = -1; - newhorhalf = newverthalf = -1; - - for (i = currstartstem; i < numstems; i++) { - if (stems[i].vertical) { /* VSTEM hint */ - if ((x >= stems[i].x - EPS) && - (x <= stems[i].x+stems[i].dx + EPS)) { - newvert = i; - if (dy != 0.0) { - if (dy < 0) newverthalf = LEFT; - else newverthalf = RIGHT; - } else { - if (x < stems[i].x+stems[i].dx / 2) newverthalf = LEFT; - else newverthalf = RIGHT; - } - } - } else { /* HSTEM hint */ - if ((y >= stems[i].y - EPS) && - (y <= stems[i].y+stems[i].dy + EPS)) { - newhor = i; - if (dx != 0.0) { - if (dx < 0) newhorhalf = TOP; - else newhorhalf = BOTTOM; - } else { - if (y < stems[i].y+stems[i].dy / 2) newhorhalf = BOTTOM; - else newhorhalf = TOP; - } - } - } - } - - p = NULL; - - if (newvert == -1 && oldvert == -1) ; /* Outside of any hints */ - else if (newvert == oldvert && - newverthalf == oldverthalf); /* No hint change */ - else if (oldvert == -1) { /* New vertical hint in effect */ - p = Applyhint(p, newvert, newverthalf); - } else if (newvert == -1) { /* Old vertical hint no longer in effect */ - p = Applyrevhint(p, oldvert, oldverthalf); - } else { /* New vertical hint in effect, old hint no longer in effect */ - p = Applyrevhint(p, oldvert, oldverthalf); - p = Applyhint(p, newvert, newverthalf); - } - - if (newhor == -1 && oldhor == -1) ; /* Outside of any hints */ - else if (newhor == oldhor && - newhorhalf == oldhorhalf) ; /* No hint change */ - else if (oldhor == -1) { /* New horizontal hint in effect */ - p = Applyhint(p, newhor, newhorhalf); - } else if (newhor == -1) { /* Old horizontal hint no longer in effect */ - p = Applyrevhint(p, oldhor, oldhorhalf); - } - else { /* New horizontal hint in effect, old hint no longer in effect */ - p = Applyrevhint(p, oldhor, oldhorhalf); - p = Applyhint(p, newhor, newhorhalf); - } - - oldvert = newvert; oldverthalf = newverthalf; - oldhor = newhor; oldhorhalf = newhorhalf; - - return p; -} - -/******************************************************/ -/* Subroutines and statics for the Type1Char routines */ -/******************************************************/ - -static int strindex; /* index into PostScript string being interpreted */ -static double currx, curry; /* accumulated x and y values for hints */ - -struct callstackentry { - psobj *currstrP; /* current CharStringP */ - int currindex; /* current strindex */ - unsigned short currkey; /* current decryption key */ - }; - -static double Stack[MAXSTACK]; -static int Top; -static struct callstackentry CallStack[MAXCALLSTACK]; -static int CallTop; -static double PSFakeStack[MAXPSFAKESTACK]; -static int PSFakeTop; - -static void -ClearStack(void) -{ - Top = -1; -} - -static void -Push(double Num) -{ - if (++Top < MAXSTACK) Stack[Top] = Num; - else Error; -} - -static void -ClearCallStack(void) -{ - CallTop = -1; -} - -static void -PushCall(psobj *CurrStrP, int CurrIndex, unsigned short CurrKey) -{ - if (++CallTop < MAXCALLSTACK) { - CallStack[CallTop].currstrP = CurrStrP; /* save CharString pointer */ - CallStack[CallTop].currindex = CurrIndex; /* save CharString index */ - CallStack[CallTop].currkey = CurrKey; /* save decryption key */ - } - else Error; -} - -static void -PopCall(psobj **CurrStrPP, int *CurrIndexP, unsigned short *CurrKeyP) -{ - if (CallTop >= 0) { - *CurrStrPP = CallStack[CallTop].currstrP; /* restore CharString pointer */ - *CurrIndexP = CallStack[CallTop].currindex; /* restore CharString index */ - *CurrKeyP = CallStack[CallTop--].currkey; /* restore decryption key */ - } - else Error; -} - -static void -ClearPSFakeStack(void) -{ - PSFakeTop = -1; -} - -/* PSFakePush: Pushes a number onto the fake PostScript stack */ -static void -PSFakePush(double Num) -{ - if (++PSFakeTop < MAXPSFAKESTACK) PSFakeStack[PSFakeTop] = Num; - else Error; -} - -/* PSFakePop: Removes a number from the top of the fake PostScript stack */ -static double -PSFakePop (void) -{ - if (PSFakeTop >= 0) return(PSFakeStack[PSFakeTop--]); - else ErrorRet(0.0); - /*NOTREACHED*/ -} - -/***********************************************************************/ -/* Center a stem on the pixel grid -- used by HStem3 and VStem3 */ -/***********************************************************************/ -static struct segment * -CenterStem(double edge1, double edge2) -{ - int idealwidth, verticalondevice; - double leftx, lefty, rightx, righty, center, width; - double widthx, widthy; - double shift, shiftx, shifty; - double Xpixels, Ypixels; - struct segment *p; - - p = Loc(CharSpace, edge1, 0.0); - QueryLoc(p, IDENTITY, &leftx, &lefty); - - p = Join(p, Loc(CharSpace, edge2, 0.0)); - QueryLoc(p, IDENTITY, &rightx, &righty); - Destroy(p); - - widthx = FABS(rightx - leftx); - widthy = FABS(righty - lefty); - - if (widthy <= EPS) { /* verticalondevice hint */ - verticalondevice = TRUE; - center = (rightx + leftx) / 2.0; - width = widthx; - } - else if (widthx <= EPS) { /* horizontal hint */ - verticalondevice = FALSE; - center = (righty + lefty) / 2.0; - width = widthy; - } - else { /* neither horizontal nor verticalondevice and not oblique */ - return (NULL); - } - - idealwidth = ROUND(width); - if (idealwidth == 0) idealwidth = 1; - if (ODD(idealwidth)) { /* is ideal width odd? */ - /* center stem over pixel */ - shift = FLOOR(center) + 0.5 - center; - } - else { - /* align stem on pixel boundary */ - shift = ROUND(center) - center; - } - - if (verticalondevice) { - shiftx = shift; - shifty = 0.0; - } else { - shifty = shift; - shiftx = 0.0; - } - - p = Loc(IDENTITY, shiftx, shifty); - QueryLoc(p, CharSpace, &Xpixels, &Ypixels); - wsoffsetX = Xpixels; wsoffsetY = Ypixels; - currx += wsoffsetX; curry += wsoffsetY; - - return (p); -} - -/*----------------------------------------------------------------------- - Decrypt - From Adobe Type 1 book page 63, with some modifications ------------------------------------------------------------------------*/ -#define KEY 4330 /* Initial key (seed) for CharStrings decryption */ -#define C1 52845 /* Multiplier for pseudo-random number generator */ -#define C2 22719 /* Constant for pseudo-random number generator */ - -static unsigned short r; /* Pseudo-random sequence of keys */ - -static unsigned char -Decrypt(unsigned char cipher) -{ - unsigned char plain; - - plain = cipher ^ (r >> 8); - r = (cipher + r) * C1 + C2; - return plain; -} - -/* Get the next byte from the codestring being interpreted */ -static int -DoRead(int *CodeP) -{ - if (strindex >= CharStringP->len) return(FALSE); /* end of string */ - *CodeP = Decrypt((unsigned char) CharStringP->data.stringP[strindex++]); - return(TRUE); -} - -/* Strip blues->lenIV bytes from CharString and update encryption key */ -/* (the lenIV entry in the Private dictionary specifies the number of */ -/* random bytes at the beginning of each CharString; default is 4) */ -static void -StartDecrypt(void) -{ - int Code; - - r = KEY; /* Initial key (seed) for CharStrings decryption */ - for (strindex = 0; strindex < blues->lenIV;) - if (!DoRead(&Code)) /* Read a byte and update decryption key */ - Error; -} - -static void -Decode(int Code) -{ - int Code1, Code2, Code3, Code4; - - if (Code <= 31) /* Code is [0,31] */ - DoCommand(Code); - else if (Code <= 246) /* Code is [32,246] */ - Push((double)(Code - 139)); - else if (Code <= 250) { /* Code is [247,250] */ - if (!DoRead(&Code2)) goto ended; - Push((double)(((Code - 247) << 8) + Code2 + 108)); - } - else if (Code <= 254) { /* Code is [251,254] */ - if (!DoRead(&Code2)) goto ended; - Push((double)( -((Code - 251) << 8) - Code2 - 108)); - } - else { /* Code is 255 */ - if (!DoRead(&Code1)) goto ended; - if (!DoRead(&Code2)) goto ended; - if (!DoRead(&Code3)) goto ended; - if (!DoRead(&Code4)) goto ended; - Push((double)((((((Code1<<8) + Code2)<<8) + Code3)<<8) + Code4)); - } - return; - -ended: Error; -} - -/* Interpret a command code */ -static void -DoCommand(int Code) -{ - switch(Code) { - case HSTEM: /* |- y dy HSTEM |- */ - /* Vertical range of a horizontal stem zone */ - if (Top < 1) Error; - HStem(Stack[0], Stack[1]); - ClearStack(); - break; - case VSTEM: /* |- x dx VSTEM |- */ - /* Horizontal range of a vertical stem zone */ - if (Top < 1) Error; - VStem(Stack[0], Stack[1]); - ClearStack(); - break; - case VMOVETO: /* |- dy VMOVETO |- */ - /* Vertical MOVETO, equivalent to 0 dy RMOVETO */ - if (Top < 0) Error; - RMoveTo(0.0, Stack[0]); - ClearStack(); - break; - case RLINETO: /* |- dx dy RLINETO |- */ - /* Like RLINETO in PostScript */ - if (Top < 1) Error; - RLineTo(Stack[0], Stack[1]); - ClearStack(); - break; - case HLINETO: /* |- dx HLINETO |- */ - /* Horizontal LINETO, equivalent to dx 0 RLINETO */ - if (Top < 0) Error; - RLineTo(Stack[0], 0.0); - ClearStack(); - break; - case VLINETO: /* |- dy VLINETO |- */ - /* Vertical LINETO, equivalent to 0 dy RLINETO */ - if (Top < 0) Error; - RLineTo(0.0, Stack[0]); - ClearStack(); - break; - case RRCURVETO: - /* |- dx1 dy1 dx2 dy2 dx3 dy3 RRCURVETO |- */ - /* Relative RCURVETO, equivalent to dx1 dy1 */ - /* (dx1+dx2) (dy1+dy2) (dx1+dx2+dx3) */ - /* (dy1+dy2+dy3) RCURVETO in PostScript */ - if (Top < 5) Error; - RRCurveTo(Stack[0], Stack[1], Stack[2], Stack[3], - Stack[4], Stack[5]); - ClearStack(); - break; - case CLOSEPATH: /* - CLOSEPATH |- */ - /* Closes a subpath without repositioning the */ - /* current point */ - DoClosePath(); - ClearStack(); - break; - case CALLSUBR: /* subr# CALLSUBR - */ - /* Calls a CharString subroutine with index */ - /* subr# from the Subrs array */ - if (Top < 0) Error; - CallSubr((int)Stack[Top--]); - break; - case RETURN: /* - RETURN - */ - /* Returns from a Subrs array CharString */ - /* subroutine called with CALLSUBR */ - Return(); - break; - case ESCAPE: /* ESCAPE to two-byte command code */ - if (!DoRead(&Code)) Error; - Escape(Code); - break; - case HSBW: /* |- sbx wx HSBW |- */ - /* Set the left sidebearing point to (sbx,0), */ - /* set the character width vector to (wx,0). */ - /* Equivalent to sbx 0 wx 0 SBW. Space */ - /* character should have sbx = 0 */ - if (Top < 1) Error; - Sbw(Stack[0], 0.0, Stack[1], 0.0); - ClearStack(); - break; - case ENDCHAR: /* - ENDCHAR |- */ - /* Finishes a CharString outline */ - EndChar(); - ClearStack(); - break; - case RMOVETO: /* |- dx dy RMOVETO |- */ - /* Behaves like RMOVETO in PostScript */ - if (Top < 1) Error; - RMoveTo(Stack[0], Stack[1]); - ClearStack(); - break; - case HMOVETO: /* |- dx HMOVETO |- */ - /* Horizontal MOVETO. Equivalent to dx 0 RMOVETO */ - if (Top < 0) Error; - RMoveTo(Stack[0], 0.0); - ClearStack(); - break; - case VHCURVETO: /* |- dy1 dx2 dy2 dx3 VHCURVETO |- */ - /* Vertical-Horizontal CURVETO, equivalent to */ - /* 0 dy1 dx2 dy2 dx3 0 RRCURVETO */ - if (Top < 3) Error; - RRCurveTo(0.0, Stack[0], Stack[1], Stack[2], - Stack[3], 0.0); - ClearStack(); - break; - case HVCURVETO: /* |- dx1 dx2 dy2 dy3 HVCURVETO |- */ - /* Horizontal-Vertical CURVETO, equivalent to */ - /* dx1 0 dx2 dy2 0 dy3 RRCURVETO */ - if (Top < 3) Error; - RRCurveTo(Stack[0], 0.0, Stack[1], Stack[2], 0.0, Stack[3]); - ClearStack(); - break; - default: /* Unassigned command code */ - ClearStack(); - Error; - } -} - -static void -Escape(int Code) -{ - int i, Num; - struct segment *p; - - switch(Code) { - case DOTSECTION: /* - DOTSECTION |- */ - /* Brackets an outline section for the dots in */ - /* letters such as "i", "j", and "!". */ - DotSection(); - ClearStack(); - break; - case VSTEM3: /* |- x0 dx0 x1 dx1 x2 dx2 VSTEM3 |- */ - /* Declares the horizontal ranges of three */ - /* vertical stem zones between x0 and x0+dx0, */ - /* x1 and x1+dx1, and x2 and x2+dx2. */ - if (Top < 5) Error; - if (!wsset && ProcessHints) { - /* Shift the whole character so that the middle stem is centered. */ - p = CenterStem(Stack[2] + sidebearingX, Stack[3]); - path = Join(path, p); - wsset = 1; - } - - VStem(Stack[0], Stack[1]); - VStem(Stack[2], Stack[3]); - VStem(Stack[4], Stack[5]); - ClearStack(); - break; - case HSTEM3: /* |- y0 dy0 y1 dy1 y2 dy2 HSTEM3 |- */ - /* Declares the vertical ranges of three hori- */ - /* zontal stem zones between y0 and y0+dy0, */ - /* y1 and y1+dy1, and y2 and y2+dy2. */ - if (Top < 5) Error; - HStem(Stack[0], Stack[1]); - HStem(Stack[2], Stack[3]); - HStem(Stack[4], Stack[5]); - ClearStack(); - break; - case SEAC: /* |- asb adx ady bchar achar SEAC |- */ - /* Standard Encoding Accented Character. */ - if (Top < 4) Error; - Seac(Stack[0], Stack[1], Stack[2], - (unsigned char) Stack[3], - (unsigned char) Stack[4]); - ClearStack(); - break; - case SBW: /* |- sbx sby wx wy SBW |- */ - /* Set the left sidebearing point to (sbx,sby), */ - /* set the character width vector to (wx,wy). */ - if (Top < 3) Error; - Sbw(Stack[0], Stack[1], Stack[2], Stack[3]); - ClearStack(); - break; - case DIV: /* num1 num2 DIV quotient */ - /* Behaves like DIV in the PostScript language */ - if (Top < 1) Error; - Stack[Top-1] = Div(Stack[Top-1], Stack[Top]); - Top--; - break; - case CALLOTHERSUBR: - /* arg1 ... argn n othersubr# CALLOTHERSUBR - */ - /* Make calls on the PostScript interpreter */ - if (Top < 1) Error; - Num = Stack[Top-1]; - if (Top < Num+1) Error; - for (i = 0; i < Num; i++) PSFakePush(Stack[Top - i - 2]); - Top -= Num + 2; -#if XFONT_CID - if ((int)Stack[Top + Num + 2] > 3) - ClearPSFakeStack(); - else - CallOtherSubr((int)Stack[Top + Num + 2]); -#else - CallOtherSubr((int)Stack[Top + Num + 2]); -#endif - break; - case POP: /* - POP number */ - /* Removes a number from the top of the */ - /* PostScript interpreter stack and pushes it */ - /* onto the Type 1 BuildChar operand stack */ - Push(PSFakePop()); - break; - case SETCURRENTPOINT: /* |- x y SETCURRENTPOINT |- */ - /* Sets the current point to (x,y) in absolute */ - /* character space coordinates without per- */ - /* forming a CharString MOVETO command */ - if (Top < 1) Error; - SetCurrentPoint(Stack[0], Stack[1]); - ClearStack(); - break; - default: /* Unassigned escape code command */ - ClearStack(); - Error; - } -} - -/* |- y dy HSTEM |- */ -/* Declares the vertical range of a horizontal stem zone */ -/* between coordinates y and y + dy */ -/* y is relative to the left sidebearing point */ -static void -HStem(double y, double dy) -{ - if (ProcessHints) { - if (numstems >= MAXSTEMS) Error; - if (dy < 0.0) {y += dy; dy = -dy;} - stems[numstems].vertical = FALSE; - stems[numstems].x = 0.0; - stems[numstems].y = sidebearingY + y + wsoffsetY; - stems[numstems].dx = 0.0; - stems[numstems].dy = dy; - ComputeStem(numstems); - numstems++; - } -} - -/* |- x dx VSTEM |- */ -/* Declares the horizontal range of a vertical stem zone */ -/* between coordinates x and x + dx */ -/* x is relative to the left sidebearing point */ - -static void -VStem(double x, double dx) -{ - if (ProcessHints) { - if (numstems >= MAXSTEMS) Error; - if (dx < 0.0) {x += dx; dx = -dx;} - stems[numstems].vertical = TRUE; - stems[numstems].x = sidebearingX + x + wsoffsetX; - stems[numstems].y = 0.0; - stems[numstems].dx = dx; - stems[numstems].dy = 0.0; - ComputeStem(numstems); - numstems++; - } -} - -/* |- dx dy RLINETO |- */ -/* Behaves like RLINETO in PostScript */ -static void -RLineTo(double dx, double dy) -{ - struct segment *B; - - B = Loc(CharSpace, dx, dy); - - if (ProcessHints) { - currx += dx; - curry += dy; - /* B = Join(B, FindStems(currx, curry)); */ - B = Join(B, FindStems(currx, curry, dx, dy)); - } - - path = Join(path, Line(B)); -} - -/* |- dx1 dy1 dx2 dy2 dx3 dy3 RRCURVETO |- */ -/* Relative RCURVETO, equivalent to dx1 dy1 */ -/* (dx1+dx2) (dy1+dy2) (dx1+dx2+dx3) */ -/* (dy1+dy2+dy3) RCURVETO in PostScript */ -static void -RRCurveTo(double dx1, double dy1, double dx2, double dy2, - double dx3, double dy3) -{ - struct segment *B, *C, *D; - - B = Loc(CharSpace, dx1, dy1); - C = Loc(CharSpace, dx2, dy2); - D = Loc(CharSpace, dx3, dy3); - - if (ProcessHints) { - /* For a Bezier curve, we apply the full hint value to - the Bezier C point (and thereby D point). */ - currx += dx1 + dx2 + dx3; - curry += dy1 + dy2 + dy3; - /* C = Join(C, FindStems(currx, curry)); */ - C = Join(C, FindStems(currx, curry, dx3, dy3)); - } - - /* Since XIMAGER is not completely relative, */ - /* we need to add up the delta values */ - - C = Join(C, (struct segment *)Dup(B)); - D = Join(D, (struct segment *)Dup(C)); - - path = Join(path, (struct segment *)Bezier(B, C, D)); -} - -/* - CLOSEPATH |- */ -/* Closes a subpath WITHOUT repositioning the */ -/* current point */ -static void -DoClosePath(void) -{ - struct segment *CurrentPoint; - - CurrentPoint = Phantom(path); - path = ClosePath(path); - path = Join(Snap(path), CurrentPoint); -} - -/* subr# CALLSUBR - */ -/* Calls a CharString subroutine with index */ -/* subr# from the Subrs array */ -static void -CallSubr(int subrno) -{ - if ((subrno < 0) || (subrno >= SubrsP->len)) - Error; - PushCall(CharStringP, strindex, r); - CharStringP = &SubrsP->data.arrayP[subrno]; - StartDecrypt(); -} - -/* - RETURN - */ -/* Returns from a Subrs array CharString */ -/* subroutine called with CALLSUBR */ -static void -Return(void) -{ - PopCall(&CharStringP, &strindex, &r); -} - -/* - ENDCHAR |- */ -/* Finishes a CharString outline */ -/* Executes SETCHACHEDEVICE using a bounding box */ -/* it computes directly from the character outline */ -/* and using the width information acquired from a previous */ -/* HSBW or SBW. It then calls a special version of FILL */ -/* or STROKE depending on the value of PaintType in the */ -/* font dictionary */ -static void -EndChar(void) -{ - /* There is no need to compute and set bounding box for - the cache, since XIMAGER does that on the fly. */ - - /* Perform a Closepath just in case the command was left out */ - path = ClosePath(path); - - /* Set character width */ - path = Join(Snap(path), Loc(CharSpace, escapementX, escapementY)); - -} - -/* |- dx dy RMOVETO |- */ -/* Behaves like RMOVETO in PostScript */ -static void -RMoveTo(double dx, double dy) -{ - struct segment *B; - - B = Loc(CharSpace, dx, dy); - - if (ProcessHints) { - currx += dx; - curry += dy; - /* B = Join(B, FindStems(currx, curry)); */ - B = Join(B, FindStems(currx, curry, 0.0, 0.0)); - } - - path = Join(path, B); -} - -/* - DOTSECTION |- */ -/* Brackets an outline section for the dots in */ -/* letters such as "i", "j", and "!". */ -static void -DotSection(void) -{ - InDotSection = !InDotSection; -} - -/* |- asb adx ady bchar achar SEAC |- */ -/* Standard Encoding Accented Character. */ -static void -Seac(double asb, double adx, double ady, - unsigned char bchar, unsigned char achar) -{ - int Code; - struct segment *mypath; - - /* Move adx - asb, ady over and up from base char's sbpoint. */ - /* (We use adx - asb to counteract the accents sb shift.) */ - /* The variables accentoffsetX/Y modify sidebearingX/Y in Sbw(). */ - /* Note that these incorporate the base character's sidebearing shift by */ - /* using the current sidebearingX, Y values. */ - accentoffsetX = sidebearingX + adx - asb; - accentoffsetY = sidebearingY + ady; - - /* Set path = NULL to avoid complaints from Sbw(). */ - path = NULL; - - /* Go find the CharString for the accent's code via an upcall */ - CharStringP = GetType1CharString((psfont *)Environment, achar); - StartDecrypt(); - - ClearStack(); - ClearPSFakeStack(); - ClearCallStack(); - - for (;;) { - if (!DoRead(&Code)) break; - Decode(Code); - if (errflag) return; - } - /* Copy snapped path to mypath and set path to NULL as above. */ - mypath = Snap(path); - path = NULL; - - /* We must reset these to null now. */ - accentoffsetX = accentoffsetY = 0; - - /* go find the CharString for the base char's code via an upcall */ - CharStringP = GetType1CharString((psfont *)Environment, bchar); - StartDecrypt(); - - ClearStack(); - ClearPSFakeStack(); - ClearCallStack(); - - FinitStems(); - InitStems(); - - for (;;) { - if (!DoRead(&Code)) break; - Decode(Code); - if (errflag) return; - } - path = Join(mypath, path); -} - - -/* |- sbx sby wx wy SBW |- */ -/* Set the left sidebearing point to (sbx,sby), */ -/* set the character width vector to (wx,wy). */ -static void -Sbw(double sbx, double sby, double wx, double wy) -{ - escapementX = wx; /* Character width vector */ - escapementY = wy; - - /* Sidebearing values are sbx, sby args, plus accent offset from Seac(). */ - sidebearingX = sbx + accentoffsetX; - sidebearingY = sby + accentoffsetY; - - path = Join(path, Loc(CharSpace, sidebearingX, sidebearingY)); - if (ProcessHints) {currx = sidebearingX; curry = sidebearingY;} -} - - /* num1 num2 DIV quotient */ -/* Behaves like DIV in the PostScript language */ -static double -Div(double num1, double num2) -{ - return(num1 / num2); -} - -/* - The following four subroutines (FlxProc, FlxProc1, FlxProc2, and - HintReplace) are C versions of the OtherSubrs Programs, which were - were published in the Adobe Type 1 Font Format book. - - The Flex outline fragment is described by - c1: (x0, y0) = c3: (x0, yshrink(y0)) or (xshrink(x0), y0) - " (x1, y1) = " (x1, yshrink(y1)) or (xshrink(x1), y1) - " (x2, y2) - reference point - c2: (x0, y0) = c4: (x0, yshrink(y0)) or (xshrink(x0), y0) - " (x1, y1) = " (x1, yshrink(y1)) or (xshrink(x1), y1) - " (x2, y2) = " (x2, y2), rightmost endpoint - c3: (x0, y0) - control point, 1st Bezier curve - " (x1, y1) - control point, -"- - " (x2, y2) - end point, -"- - c4: (x0, y0) - control point, 2nd Bezier curve - " (x1, y1) - control point, -"- - " (x2, y2) - end point, -"- - ep: (epY, epX) - final endpoint (should be same as c4: (x2, y2)) - idmin - minimum Flex height (1/100 pixel) at which to render curves -*/ - -#define dtransform(dxusr,dyusr,dxdev,dydev) { \ - register struct segment *point = Loc(CharSpace, dxusr, dyusr); \ - QueryLoc(point, IDENTITY, dxdev, dydev); \ - Destroy(point); \ -} - -#define itransform(xdev,ydev,xusr,yusr) { \ - register struct segment *point = Loc(IDENTITY, xdev, ydev); \ - QueryLoc(point, CharSpace, xusr, yusr); \ - Destroy(point); \ -} - -#define transform(xusr,yusr,xdev,ydev) dtransform(xusr,yusr,xdev,ydev) - -#define PaintType (0) - -#define lineto(x,y) { \ - struct segment *CurrentPoint; \ - double CurrentX, CurrentY; \ - CurrentPoint = Phantom(path); \ - QueryLoc(CurrentPoint, CharSpace, &CurrentX, &CurrentY); \ - Destroy(CurrentPoint); \ - RLineTo(x - CurrentX, y - CurrentY); \ -} - -#define curveto(x0,y0,x1,y1,x2,y2) { \ - struct segment *CurrentPoint; \ - double CurrentX, CurrentY; \ - CurrentPoint = Phantom(path); \ - QueryLoc(CurrentPoint, CharSpace, &CurrentX, &CurrentY); \ - Destroy(CurrentPoint); \ - RRCurveTo(x0 - CurrentX, y0 - CurrentY, x1 - x0, y1 - y0, x2 - x1, y2 - y1); \ -} - -#define xshrink(x) ((x - c4x2) * shrink +c4x2) -#define yshrink(y) ((y - c4y2) * shrink +c4y2) - -#define PickCoords(flag) \ - if (flag) { /* Pick "shrunk" coordinates */ \ - x0 = c1x0; y0 = c1y0; \ - x1 = c1x1; y1 = c1y1; \ - x2 = c1x2; y2 = c1y2; \ - x3 = c2x0; y3 = c2y0; \ - x4 = c2x1; y4 = c2y1; \ - x5 = c2x2; y5 = c2y2; \ - } else { /* Pick original coordinates */ \ - x0 = c3x0; y0 = c3y0; \ - x1 = c3x1; y1 = c3y1; \ - x2 = c3x2; y2 = c3y2; \ - x3 = c4x0; y3 = c4y0; \ - x4 = c4x1; y4 = c4y1; \ - x5 = c4x2; y5 = c4y2; \ - } - -/* FlxProc() = OtherSubrs[0]; Main part of Flex */ -/* Calling sequence: 'idmin epX epY 3 0 callothersubr' */ -/* Computes Flex values, and renders the Flex path, */ -/* and returns (leaves) ending coordinates on stack */ -static void -FlxProc(double c1x2, double c1y2, double c3x0, double c3y0, - double c3x1, double c3y1, double c3x2, double c3y2, - double c4x0, double c4y0, double c4x1, double c4y1, - double c4x2, double c4y2, double epY, double epX, int idmin) -{ - double dmin; - double c1x0, c1y0, c1x1, c1y1; - double c2x0, c2y0, c2x1, c2y1, c2x2, c2y2; - char yflag; - double x0, y0, x1, y1, x2, y2, x3, y3, x4, y4, x5, y5; - double cxx, cyx, cxy, cyy; /* Transformation matrix */ - int flipXY; - double x, y; - double erosion = 1; /* Device parameter */ - /* Erosion may have different value specified in 'internaldict' */ - double shrink; - double dX, dY; - char erode; - double eShift; - double cx, cy; - double ex, ey; - - c1x0 = c1y0 = c1x1 = c1y1 = c2x0 = c2y0 = c2x1 = c2y1 = c2x2 = c2y2 = 0.0; - - Destroy(path); - path = FlxOldPath; /* Restore previous path (stored in FlxProc1) */ - - if (ProcessHints) { - dmin = ABS(idmin) / 100.0; /* Minimum Flex height in pixels */ - - c2x2 = c4x2; c2y2 = c4y2; /* Point c2 = c4 */ - - yflag = FABS(c1y2 - c3y2) > FABS(c1x2 - c3x2); /* Flex horizontal? */ - - QuerySpace(CharSpace, &cxx, &cyx, &cxy, &cyy); /* Transformation matrix */ - - if (FABS(cxx) < 0.00001 || FABS(cyy) < 0.00001) - flipXY = -1; /* Char on side */ - else if (FABS(cyx) < 0.00001 || FABS(cxy) < 0.00001) - flipXY = 1; /* Char upright */ - else - flipXY = 0; /* Char at angle */ - - if (yflag) { /* Flex horizontal */ - if (flipXY == 0 || c3y2 == c4y2) { /* Char at angle or Flex height = 0 */ - PickCoords(FALSE); /* Pick original control points */ - } else { - shrink = FABS((c1y2 - c4y2) / (c3y2 - c4y2)); /* Slope */ - - c1x0 = c3x0; c1y0 = yshrink(c3y0); - c1x1 = c3x1; c1y1 = yshrink(c3y1); - c2x0 = c4x0; c2y0 = yshrink(c4y0); - c2x1 = c4x1; c2y1 = yshrink(c4y1); - - dtransform(0.0, ROUND(c3y2-c1y2), &x, &y); /* Flex height in pixels */ - dY = FABS((flipXY == 1) ? y : x); - PickCoords(dY < dmin); /* If Flex small, pick 'shrunk' control points */ - - if (FABS(y2 - c1y2) > 0.001) { /* Flex 'non-zero'? */ - transform(c1x2, c1y2, &x, &y); - - if (flipXY == 1) { - cx = x; cy = y; - } else { - cx = y; cy = x; - } - - dtransform(0.0, ROUND(y2-c1y2), &x, &y); - dY = (flipXY == 1) ? y : x; - if (ROUND(dY) != 0) - dY = ROUND(dY); - else - dY = (dY < 0) ? -1 : 1; - - erode = PaintType != 2 && erosion >= 0.5; - if (erode) - cy -= 0.5; - ey = cy + dY; - ey = CEIL(ey) - ey; - ey = ey + FLOOR(cy + dY); - if (erode) - ey += 0.5; - - if (flipXY == 1) { - itransform(cx, ey, &x, &y); - } else { - itransform(ey, cx, &x, &y); - } - - eShift = y - y2; - y1 += eShift; - y2 += eShift; - y3 += eShift; - } - } - } else { /* Flex vertical */ - if (flipXY == 0 || c3x2 == c4x2) { /* Char at angle or Flex height = 0 */ - PickCoords(FALSE); /* Pick original control points */ - } else { - shrink = FABS((c1x2 - c4x2) / (c3x2 - c4x2)); /* Slope */ - - c1x0 = xshrink(c3x0); c1y0 = c3y0; - c1x1 = xshrink(c3x1); c1y1 = c3y1; - c2x0 = xshrink(c4x0); c2y0 = c4y0; - c2x1 = xshrink(c4x1); c2y1 = c4y1; - - dtransform(ROUND(c3x2 - c1x2), 0.0, &x, &y); /* Flex height in pixels */ - dX = FABS((flipXY == -1) ? y : x); - PickCoords(dX < dmin); /* If Flex small, pick 'shrunk' control points */ - - if (FABS(x2 - c1x2) > 0.001) { - transform(c1x2, c1y2, &x, &y); - if (flipXY == -1) { - cx = y; cy = x; - } else { - cx = x; cy = y; - } - - dtransform(ROUND(x2-c1x2), 0.0, &x, &y); - dX = (flipXY == -1) ? y : x; - if (ROUND(dX) != 0) - dX = ROUND(dX); - else - dX = (dX < 0) ? -1 : 1; - - erode = PaintType != 2 && erosion >= 0.5; - if (erode) - cx -= 0.5; - ex = cx + dX; - ex = CEIL(ex) - ex; - ex = ex + FLOOR(cx + dX); - if (erode) - ex += 0.5; - - if (flipXY == -1) { - itransform(cy, ex, &x, &y); - } else { - itransform(ex, cy, &x, &y); - } - - eShift = x - x2; - x1 += eShift; - x2 += eShift; - x3 += eShift; - } - } - } - - if (x2 == x5 || y2 == y5) { - lineto(x5, y5); - } else { - curveto(x0, y0, x1, y1, x2, y2); - curveto(x3, y3, x4, y4, x5, y5); - } - } else { /* ProcessHints is off */ - PickCoords(FALSE); /* Pick original control points */ - curveto(x0, y0, x1, y1, x2, y2); - curveto(x3, y3, x4, y4, x5, y5); - } - - PSFakePush(epY); - PSFakePush(epX); -} - -/* FlxProc1() = OtherSubrs[1]; Part of Flex */ -/* Calling sequence: '0 1 callothersubr' */ -/* Saves and clears path, then restores currentpoint */ -static void -FlxProc1(void) -{ - struct segment *CurrentPoint; - - CurrentPoint = Phantom(path); - - FlxOldPath = path; - path = CurrentPoint; -} - -/* FlxProc2() = OtherSubrs[2]; Part of Flex */ -/* Calling sequence: '0 2 callothersubr' */ -/* Returns currentpoint on stack */ -static void -FlxProc2(void) -{ - struct segment *CurrentPoint; - double CurrentX, CurrentY; - - CurrentPoint = Phantom(path); - QueryLoc(CurrentPoint, CharSpace, &CurrentX, &CurrentY); - Destroy(CurrentPoint); - - /* Push CurrentPoint on fake PostScript stack */ - PSFakePush(CurrentX); - PSFakePush(CurrentY); -} - -/* HintReplace() = OtherSubrs[3]; Hint Replacement */ -/* Calling sequence: 'subr# 1 3 callothersubr pop callsubr' */ -/* Reinitializes stem hint structure */ -static void -HintReplace(void) -{ - /* Effectively retire the current stems, but keep them around for */ - /* revhint use in case we are in a stem when we replace hints. */ - currstartstem = numstems; - - /* 'subr#' is left on PostScript stack (for 'pop callsubr') */ -} - -/* arg1 ... argn n othersubr# CALLOTHERSUBR - */ -/* Make calls on the PostScript interpreter (or call equivalent C code) */ -/* NOTE: The n arguments have been pushed on the fake PostScript stack */ -static void -CallOtherSubr(int othersubrno) -{ - switch(othersubrno) { - case 0: /* OtherSubrs[0]; Main part of Flex */ - if (PSFakeTop < 16) Error; - ClearPSFakeStack(); - FlxProc( - PSFakeStack[0], PSFakeStack[1], PSFakeStack[2], PSFakeStack[3], - PSFakeStack[4], PSFakeStack[5], PSFakeStack[6], PSFakeStack[7], - PSFakeStack[8], PSFakeStack[9], PSFakeStack[10], PSFakeStack[11], - PSFakeStack[12], PSFakeStack[13], PSFakeStack[14], PSFakeStack[15], - (int) PSFakeStack[16] - ); - break; - case 1: /* OtherSubrs[1]; Part of Flex */ - FlxProc1(); - break; - case 2: /* OtherSubrs[2]; Part of Flex */ - FlxProc2(); - break; - case 3: /* OtherSubrs[3]; Hint Replacement */ - HintReplace(); - break; - default: { /* call OtherSubrs[4] or higher if PostScript is present */ - } - } -} - -/* |- x y SETCURRENTPOINT |- */ -/* Sets the current point to (x,y) in absolute */ -/* character space coordinates without per- */ -/* forming a CharString MOVETO command */ -static void -SetCurrentPoint(double x, double y) -{ - currx = x; - curry = y; -} - -/* The Type1Char routine for use by PostScript. */ -/************************************************/ -struct xobject * -Type1Char(char *env, struct XYspace *S, psobj *charstrP, psobj *subrsP, - psobj *osubrsP, - struct blues_struct *bluesP, /* FontID's ptr to the blues struct */ - int *modeP) -{ - int Code; - - path = NULL; - errflag = FALSE; - - /* Make parameters available to all Type1 routines */ - Environment = env; - CharSpace = S; /* used when creating path elements */ - CharStringP = charstrP; - SubrsP = subrsP; - - blues = bluesP; - - /* compute the alignment zones */ - ComputeAlignmentZones(); - - StartDecrypt(); - - ClearStack(); - ClearPSFakeStack(); - ClearCallStack(); - - InitStems(); - - currx = curry = 0; - escapementX = escapementY = 0; - sidebearingX = sidebearingY = 0; - accentoffsetX = accentoffsetY = 0; - wsoffsetX = wsoffsetY = 0; /* No shift to preserve whitspace. */ - wsset = 0; /* wsoffsetX,Y haven't been set yet. */ - - for (;;) { - if (!DoRead(&Code)) break; - Decode(Code); - if (errflag) break; - } - - FinitStems(); - - - /* Clean up if an error has occurred */ - if (errflag) { - if (path != NULL) { - Destroy(path); /* Reclaim storage */ - path = NULL; /* Indicate that character could not be built */ - } - } - - return((struct xobject *) path); -} - -#if XFONT_CID -struct xobject * -CIDChar(char *env, struct XYspace *S, - psobj *charstrP, psobj *subrsP, psobj *osubrsP, - struct blues_struct *bluesP, /* FontID's ptr to the blues struct */ - int *modeP) -{ - int Code; - - path = NULL; - errflag = FALSE; - - /* Make parameters available to all CID routines */ - Environment = env; - CharSpace = S; /* used when creating path elements */ - CharStringP = charstrP; - SubrsP = subrsP; - - blues = bluesP; - - /* compute the alignment zones */ - ComputeAlignmentZones(); - - StartDecrypt(); - - ClearStack(); - ClearPSFakeStack(); - ClearCallStack(); - - InitStems(); - - currx = curry = 0; - escapementX = escapementY = 0; - sidebearingX = sidebearingY = 0; - accentoffsetX = accentoffsetY = 0; - wsoffsetX = wsoffsetY = 0; /* No shift to preserve whitspace. */ - wsset = 0; /* wsoffsetX,Y haven't been set yet. */ - - for (;;) { - if (!DoRead(&Code)) break; - Decode(Code); - if (errflag) break; - } - - FinitStems(); - - /* Clean up if an error has occurred */ - if (errflag) { - if (path != NULL) { - Destroy(path); /* Reclaim storage */ - path = NULL; /* Indicate that character could not be built */ - } - } - - return((struct xobject *) path); -} -#endif diff --git a/nx-X11/lib/font/Type1/util.c b/nx-X11/lib/font/Type1/util.c deleted file mode 100644 index 7c5a81dee..000000000 --- a/nx-X11/lib/font/Type1/util.c +++ /dev/null @@ -1,222 +0,0 @@ -/* $Xorg: util.c,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/util.c,v 1.5 1999/08/21 13:47:53 dawes Exp $ */ -/* Author: Katherine A. Hitchcock IBM Almaden Research Laboratory */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#ifndef FONTMODULE -#include -#else -#include "Xdefs.h" -#include "Xmd.h" -#include "xf86_ansic.h" -#endif -#include "util.h" -#include /* for xalloc/xfree */ - -static char *vm_base = NULL; /* Start of virtual memory area */ - char *vm_next = NULL; /* Pointer to first free byte */ - long vm_free = 0; /* Count of free bytes */ - long vm_size = 0; /* Total size of memory */ - -/* - * Initialize memory. - */ -boolean -vm_init(int cnt) -{ -#if XFONT_CID - if (vm_base == NULL || (vm_base != NULL && vm_size != cnt)) { - if (vm_base != NULL) xfree(vm_base); - vm_next = vm_base = (char *)xalloc (cnt); - } else - vm_next = vm_base; -#else - vm_next = vm_base = (char *)xalloc (cnt); -#endif - - if (vm_base != NULL) { - vm_free = cnt; - vm_size = cnt; - return(TRUE); - } - else - return(FALSE); - -} - -char * -vm_alloc(int bytes) -{ - char *answer; - - /* Round to next word multiple */ - bytes = (bytes + 7) & ~7; - - /* Allocate the space, if it is available */ - if (bytes > 0 && bytes <= vm_free) { - answer = vm_next; - vm_free -= bytes; - vm_next += bytes; - } - else - answer = NULL; - - return(answer); -} - -/* - * Format an Integer object - */ -void -objFormatInteger(psobj *objP, int value) -{ - if (objP != NULL) { - objP->type = OBJ_INTEGER; - objP->len = 0; - objP->data.integer = value; - } -} - -/* - * Format a Real object - */ -void -objFormatReal(psobj *objP, float value) -{ - if (objP != NULL) { - objP->type = OBJ_REAL; - objP->len = 0; - objP->data.real = value; - } -} - -/* - * Format a Boolean object - */ -void -objFormatBoolean(psobj *objP, boolean value) -{ - if (objP != NULL) { - objP->type = OBJ_BOOLEAN; - objP->len = 0; - objP->data.boolean = value; - } -} - -/* - * Format an Encoding object - */ -void -objFormatEncoding(psobj *objP, int length, psobj *valueP) -{ - if (objP != NULL) { - objP->type = OBJ_ENCODING; - objP->len = length; - objP->data.arrayP = valueP; - } -} - -/* - * Format an Array object - */ -void -objFormatArray(psobj *objP, int length, psobj *valueP) -{ - if (objP != NULL) { - objP->type = OBJ_ARRAY; - objP->len = length; - objP->data.arrayP = valueP; - } -} - - -/* - * Format a String object - */ -void -objFormatString(psobj *objP, int length, char *valueP) -{ - if (objP != NULL) { - objP->type = OBJ_STRING; - objP->len = length; - objP->data.valueP = valueP; - } -} - -/* - * Format a Name object - */ -void -objFormatName(psobj *objP, int length, char *valueP) -{ - if (objP != NULL) { - objP->type = OBJ_NAME; - objP->len = length; - objP->data.nameP = valueP; - } -} - -/* - * Format a File object - */ -void -objFormatFile(psobj *objP, FILE *valueP) -{ - if (objP != NULL) { - objP->type = OBJ_FILE; - objP->len = 0; - objP->data.fileP = valueP; - } -} - diff --git a/nx-X11/lib/font/Type1/util.h b/nx-X11/lib/font/Type1/util.h deleted file mode 100644 index a1a8b3e6b..000000000 --- a/nx-X11/lib/font/Type1/util.h +++ /dev/null @@ -1,217 +0,0 @@ -/* $Xorg: util.h,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ */ -/* Copyright International Business Machines,Corp. 1991 - * All Rights Reserved - * - * License 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 IBM not be used in advertising or - * publicity pertaining to distribution of the software without - * specific, written prior permission. - * - * IBM PROVIDES THIS SOFTWARE "AS IS", WITHOUT ANY WARRANTIES - * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT - * LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND - * PERFORMANCE OF THE SOFTWARE, INCLUDING ANY DUTY TO SUPPORT - * OR MAINTAIN, BELONGS TO THE LICENSEE. SHOULD ANY PORTION OF - * THE SOFTWARE PROVE DEFECTIVE, THE LICENSEE (NOT IBM) ASSUMES - * THE ENTIRE COST OF ALL SERVICING, REPAIR AND CORRECTION. IN - * NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ -/* Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - * - * The contents of this file are subject to the CID Font Code Public Licence - * Version 1.0 (the "License"). You may not use this file except in compliance - * with the Licence. You may obtain a copy of the License at Silicon Graphics, - * Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA - * 94043 or at http://www.sgi.com/software/opensource/cid/license.html. - * - * Software distributed under the License is distributed on an "AS IS" basis. - * ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - * WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - * NON-INFRINGEMENT. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Software is CID font code that was developed by Silicon - * Graphics, Inc. - */ -/* $XFree86: xc/lib/font/Type1/util.h,v 1.4 1999/08/22 08:58:55 dawes Exp $ */ - -#ifndef UTIL_H -#define UTIL_H - -#ifdef BUILDCID -#define XFONT_CID 1 -#endif - -#ifndef boolean -typedef int boolean; -#endif - -#ifndef TRUE -#define TRUE (1) -#endif - -#ifndef FALSE -#define FALSE (0) -#endif - -/***================================================================***/ -/* Portable definitions for 2's complement machines. - * NOTE: These really should be based on PostScript types, - * for example, sizeof(ps_integer), or sizeof(ps_unsigned) - */ -#define MAX_ULONG (~(unsigned long)(0)) -/* This code is portable, assuming K&R C and 2's complement arithmetic */ -#define MAX_INTEGER \ - ((long)((((unsigned long) 1)<<(sizeof(unsigned long)*8-1))-1)) -#define MIN_INTEGER ((-MAX_INTEGER)-1) - -#define MAX_ARRAY_CNT (65535) -#define MAX_DICT_CNT (65535) -#define MAX_STRING_LEN (65535) -#define MAX_NAME_LEN (128) - -/* this is the size of memory allocated for reading fonts */ - -#if XFONT_CID -#define VM_SIZE (100*1024) -#else -#define VM_SIZE (50*1024) -#endif -/***================================================================***/ - -#ifndef MIN -#define MIN(a,b) (((a)<(b)) ? a : b ) -#endif - -/***================================================================***/ -/* Routines for managing virtual memory */ -/***================================================================***/ - -extern boolean vm_init ( int cnt ); -extern long vm_free; -extern long vm_size; -extern char *vm_next; -extern char *vm_alloc ( int bytes ); - -/***================================================================***/ -/* Macros for managing virtual memory */ -/***================================================================***/ -#define vm_next_byte() (vm_next) -#define vm_free_bytes() (vm_free) -#define vm_avail(B) (B <= vm_free) - - - -/***================================================================***/ -/* Types of PostScript objects */ -/***================================================================***/ -#define OBJ_INTEGER (0) -#define OBJ_REAL (1) -#define OBJ_BOOLEAN (2) -#define OBJ_ARRAY (3) -#define OBJ_STRING (4) -#define OBJ_NAME (5) -#define OBJ_FILE (6) -#define OBJ_ENCODING (7) - -/***================================================================***/ -/* Value of PostScript objects */ -/***================================================================***/ -typedef union ps_value { - char *valueP; /* value pointer for unspecified type */ - int value; /* value for unspecified type */ - int integer; /* when type is OBJ_INTEGER */ - float real; /* when type is OBJ_REAL */ - int boolean; /* when type is OBJ_BOOLEAN */ - struct ps_obj *arrayP; /* when type is OBJ_ARRAY */ - unsigned char *stringP; /* when type is OBJ_STRING */ - char *nameP; /* when type is OBJ_NAME */ - FILE *fileP; /* when type is OBJ_FILE */ -} psvalue; - -/***================================================================***/ -/* Definition of a PostScript object */ -/***================================================================***/ -typedef struct ps_obj { - char type; - char unused; - unsigned short len; - union ps_value data; -} psobj; - -/***================================================================***/ -/* Definition of a PostScript Dictionary Entry */ -/***================================================================***/ -typedef struct ps_dict { - psobj key; - psobj value; -} psdict; - -/***================================================================***/ -/* Macros for testing type of PostScript objects */ -/***================================================================***/ -#define objIsInteger(o) ((o).type == OBJ_INTEGER) -#define objIsReal(o) ((o).type == OBJ_REAL) -#define objIsBoolean(o) ((o).type == OBJ_BOOLEAN) -#define objIsArray(o) ((o).type == OBJ_ARRAY) -#define objIsString(o) ((o).type == OBJ_STRING) -#define objIsName(o) ((o).type == OBJ_NAME) -#define objIsFile(o) ((o).type == OBJ_FILE) - -/***================================================================***/ -/* Macros for setting type of PostScript objects */ -/***================================================================***/ -#define objSetInteger(o) ((o).type = OBJ_INTEGER) -#define objSetReal(o) ((o).type = OBJ_REAL) -#define objSetBoolean(o) ((o).type = OBJ_BOOLEAN) -#define objSetArray(o) ((o).type = OBJ_ARRAY) -#define objSetString(o) ((o).type = OBJ_STRING) -#define objSetName(o) ((o).type = OBJ_NAME) -#define objSetFile(o) ((o).type = OBJ_FILE) - -/***================================================================***/ -/* Macros for testing type of PostScript objects (pointer access) */ -/***================================================================***/ -#define objPIsInteger(o) ((o)->type == OBJ_INTEGER) -#define objPIsReal(o) ((o)->type == OBJ_REAL) -#define objPIsBoolean(o) ((o)->type == OBJ_BOOLEAN) -#define objPIsArray(o) ((o)->type == OBJ_ARRAY) -#define objPIsString(o) ((o)->type == OBJ_STRING) -#define objPIsName(o) ((o)->type == OBJ_NAME) -#define objPIsFile(o) ((o)->type == OBJ_FILE) - -/***================================================================***/ -/* Macros for setting type of PostScript objects (pointer access) */ -/***================================================================***/ -#define objPSetInteger(o) ((o)->type = OBJ_INTEGER) -#define objPSetReal(o) ((o)->type = OBJ_REAL) -#define objPSetBoolean(o) ((o)->type = OBJ_BOOLEAN) -#define objPSetArray(o) ((o)->type = OBJ_ARRAY) -#define objPSetString(o) ((o)->type = OBJ_STRING) -#define objPSetName(o) ((o)->type = OBJ_NAME) -#define objPSetFile(o) ((o)->type = OBJ_FILE) - -/***================================================================***/ -/* Prototypes of object formatting functions */ -/***================================================================***/ -extern void objFormatInteger ( psobj *objP, int value ); -extern void objFormatReal ( psobj *objP, float value ); -extern void objFormatBoolean ( psobj *objP, boolean value ); -extern void objFormatEncoding ( psobj *objP, int length, psobj *valueP ); -extern void objFormatArray ( psobj *objP, int length, psobj *valueP ); -extern void objFormatString ( psobj *objP, int length, char *valueP ); -extern void objFormatName ( psobj *objP, int length, char *valueP ); -extern void objFormatFile ( psobj *objP, FILE *valueP ); - -#endif diff --git a/nx-X11/lib/font/bitmap/Imakefile b/nx-X11/lib/font/bitmap/Imakefile deleted file mode 100644 index 9acbe7796..000000000 --- a/nx-X11/lib/font/bitmap/Imakefile +++ /dev/null @@ -1,71 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:34 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/lib/font/bitmap/Imakefile,v 1.11 2001/04/03 17:51:59 paulo Exp $ - -#if BuildServer && DoLoadableServer -#define IHaveSubdirs -#define NoLibSubdirs -#define PassCDebugFlags -SUBDIRS = module -#endif - -BDFSRCS=bdfread.c bdfutils.c -BDFOBJS=bdfread.o bdfutils.o -#ifndef KDriveXServer -BDFDEFS=-DBDFFORMAT - -SNFSRCS=snfread.c -SNFOBJS=snfread.o -SNFDEFS=-DSNFFORMAT -#endif - -PCFSRCS=pcfread.c pcfwrite.c -PCFOBJS=pcfread.o pcfwrite.o -PCFDEFS=-DPCFFORMAT - - - INCLUDES = -I$(FONTINCSRC) -I../include - HEADERS = bdfint.h pcf.h -#ifdef FontFormatDefines - FORMAT_DEFS = FontFormatDefines -#endif -#if GzipFontCompression - GZIP_DEFS = -DX_GZIP_FONT_COMPRESSION -#endif - DEFINES = $(BDFDEFS) $(PCFDEFS) $(SNFDEFS) - - SRCS = $(BDFSRCS) bitmap.c bitmaputil.c bitscale.c \ - bitmapfunc.c $(PCFSRCS) $(SNFSRCS) \ - fontink.c - - OBJS = $(BDFOBJS) bitmap.o bitmaputil.o bitscale.o \ - bitmapfunc.o $(PCFOBJS) $(SNFOBJS) \ - fontink.o - -#if BuildFontLib -#define DoNormalLib NormalLibFont -#define DoSharedLib SharedLibFont -#define DoDebugLib DebugLibFont -#define DoProfileLib ProfileLibFont -#include -LibraryObjectRule() - -SpecialCLibObjectRule(bitmapfunc,$(ICONFIGFILES),$(GZIP_DEFS)) -SpecialCLibObjectRule(bitscale,$(ICONFIGFILES),$(GZIP_DEFS)) - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) -#endif - -#if BuildServer && DoLoadableServer -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -BuildIncludes($(HEADERS),X11/fonts,../..) -InstallMultipleFlags($(HEADERS),$(INCDIR)/X11/fonts,$(INSTINCFLAGS)) - -DependTarget() diff --git a/nx-X11/lib/font/bitmap/bdfint.h b/nx-X11/lib/font/bitmap/bdfint.h deleted file mode 100644 index d41c4a556..000000000 --- a/nx-X11/lib/font/bitmap/bdfint.h +++ /dev/null @@ -1,90 +0,0 @@ -/* $Xorg: bdfint.h,v 1.4 2001/02/09 02:04:01 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/bdfint.h,v 1.4 2001/01/17 19:43:26 dawes Exp $ */ - -#ifndef BDFINT_H -#define BDFINT_H - -#define bdfIsPrefix(buf,str) (!strncmp((char *)buf,str,strlen(str))) -#define bdfStrEqual(s1,s2) (!strcmp(s1,s2)) - -#define BDF_GENPROPS 6 -#define NullProperty ((FontPropPtr)0) - -/* - * This structure holds some properties we need to generate if they aren't - * specified in the BDF file and some other values read from the file - * that we'll need to calculate them. We need to keep track of whether - * or not we've read them. - */ -typedef struct BDFSTAT { - int linenum; - char *fileName; - char fontName[MAXFONTNAMELEN]; - float pointSize; - int resolution_x; - int resolution_y; - int digitCount; - int digitWidths; - int exHeight; - - FontPropPtr fontProp; - FontPropPtr pointSizeProp; - FontPropPtr resolutionXProp; - FontPropPtr resolutionYProp; - FontPropPtr resolutionProp; - FontPropPtr xHeightProp; - FontPropPtr weightProp; - FontPropPtr quadWidthProp; - BOOL haveFontAscent; - BOOL haveFontDescent; - BOOL haveDefaultCh; -} bdfFileState; - -extern void bdfError ( char * message, ... ); -extern void bdfWarning ( char *message, ... ); -extern unsigned char * bdfGetLine ( FontFilePtr file, unsigned char *buf, - int len ); -extern Atom bdfForceMakeAtom ( char *str, int *size ); -extern Atom bdfGetPropertyValue ( char *s ); -extern int bdfIsInteger ( char *str ); -extern unsigned char bdfHexByte ( unsigned char *s ); -extern Bool bdfSpecialProperty ( FontPtr pFont, FontPropPtr prop, - char isString, bdfFileState *bdfState ); -extern int bdfReadFont( FontPtr pFont, FontFilePtr file, - int bit, int byte, int glyph, int scan ); -extern int bdfReadFontInfo( FontInfoPtr pFontInfo, FontFilePtr file ); - -extern void FontCharInkMetrics ( FontPtr pFont, CharInfoPtr pCI, - xCharInfo *pInk ); -extern void FontCharReshape ( FontPtr pFont, CharInfoPtr pSrc, - CharInfoPtr pDst ); - -#endif /* BDFINT_H */ diff --git a/nx-X11/lib/font/bitmap/bdfread.c b/nx-X11/lib/font/bitmap/bdfread.c deleted file mode 100644 index bccabd7df..000000000 --- a/nx-X11/lib/font/bitmap/bdfread.c +++ /dev/null @@ -1,967 +0,0 @@ -/* $Xorg: bdfread.c,v 1.5 2001/02/09 02:04:01 xorgcvs Exp $ */ - -/************************************************************************ -Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ - -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/bdfread.c,v 1.12tsi Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef FONTMODULE -#include -#endif -#include -#include -/* use bitmap structure */ -#include -#include - -#if HAVE_STDINT_H -#include -#elif !defined(INT32_MAX) -#define INT32_MAX 0x7fffffff -#endif - -#define INDICES 256 -#define MAXENCODING 0xFFFF -#define BDFLINELEN 1024 - -static Bool bdfPadToTerminal(FontPtr pFont); -extern int bdfFileLineNum; - -/***====================================================================***/ - -static Bool -bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte, - int glyph, int scan, CARD32 *sizes) -{ - int widthBits, - widthBytes, - widthHexChars; - int height, - row; - int i, - inLineLen, - nextByte; - unsigned char *pInBits, - *picture, - *line = NULL; - unsigned char lineBuf[BDFLINELEN]; - - widthBits = GLYPHWIDTHPIXELS(pCI); - height = GLYPHHEIGHTPIXELS(pCI); - - widthBytes = BYTES_PER_ROW(widthBits, glyph); - if (widthBytes * height > 0) { - picture = (unsigned char *) xalloc(widthBytes * height); - if (!picture) { - bdfError("Couldn't allocate picture (%d*%d)\n", widthBytes, height); - goto BAILOUT; - } - } else - picture = NULL; - pCI->bits = (char *) picture; - - if (sizes) { - for (i = 0; i < GLYPHPADOPTIONS; i++) - sizes[i] += BYTES_PER_ROW(widthBits, (1 << i)) * height; - } - nextByte = 0; - widthHexChars = BYTES_PER_ROW(widthBits, 1); - -/* 5/31/89 (ef) -- hack, hack, hack. what *am* I supposed to do with */ -/* 0 width characters? */ - - for (row = 0; row < height; row++) { - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if (!line) - break; - - if (widthBits == 0) { - if ((!line) || (bdfIsPrefix(line, "ENDCHAR"))) - break; - else - continue; - } - pInBits = line; - inLineLen = strlen((char *) pInBits); - - if (inLineLen & 1) { - bdfError("odd number of characters in hex encoding\n"); - line[inLineLen++] = '0'; - line[inLineLen] = '\0'; - } - inLineLen >>= 1; - i = inLineLen; - if (i > widthHexChars) - i = widthHexChars; - for (; i > 0; i--, pInBits += 2) - picture[nextByte++] = bdfHexByte(pInBits); - - /* pad if line is too short */ - if (inLineLen < widthHexChars) { - for (i = widthHexChars - inLineLen; i > 0; i--) - picture[nextByte++] = 0; - } else { - unsigned char mask; - - mask = 0xff << (8 - (widthBits & 0x7)); - if (mask && picture[nextByte - 1] & ~mask) { - picture[nextByte - 1] &= mask; - } - } - - if (widthBytes > widthHexChars) { - i = widthBytes - widthHexChars; - while (i-- > 0) - picture[nextByte++] = 0; - } - } - - if ((line && (!bdfIsPrefix(line, "ENDCHAR"))) || (height == 0)) - line = bdfGetLine(file, lineBuf, BDFLINELEN); - - if ((!line) || (!bdfIsPrefix(line, "ENDCHAR"))) { - bdfError("missing 'ENDCHAR'\n"); - goto BAILOUT; - } - if (nextByte != height * widthBytes) { - bdfError("bytes != rows * bytes_per_row (%d != %d * %d)\n", - nextByte, height, widthBytes); - goto BAILOUT; - } - if (picture != NULL) { - if (bit == LSBFirst) - BitOrderInvert(picture, nextByte); - if (bit != byte) { - if (scan == 2) - TwoByteSwap(picture, nextByte); - else if (scan == 4) - FourByteSwap(picture, nextByte); - } - } - return (TRUE); -BAILOUT: - if (picture) - xfree(picture); - pCI->bits = NULL; - return (FALSE); -} - -/***====================================================================***/ - -static Bool -bdfSkipBitmap(FontFilePtr file, int height) -{ - unsigned char *line; - int i = 0; - unsigned char lineBuf[BDFLINELEN]; - - do { - line = bdfGetLine(file, lineBuf, BDFLINELEN); - i++; - } while (line && !bdfIsPrefix(line, "ENDCHAR") && i <= height); - - if (i > 1 && line && !bdfIsPrefix(line, "ENDCHAR")) { - bdfError("Error in bitmap, missing 'ENDCHAR'\n"); - return (FALSE); - } - return (TRUE); -} - -/***====================================================================***/ - -static void -bdfFreeFontBits(FontPtr pFont) -{ - BitmapFontPtr bitmapFont; - BitmapExtraPtr bitmapExtra; - int i, nencoding; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - bitmapExtra = (BitmapExtraPtr) bitmapFont->bitmapExtra; - xfree(bitmapFont->ink_metrics); - if(bitmapFont->encoding) { - nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) * - (pFont->info.lastRow - pFont->info.firstRow + 1); - for(i=0; iencoding[i]); - } - xfree(bitmapFont->encoding); - for (i = 0; i < bitmapFont->num_chars; i++) - xfree(bitmapFont->metrics[i].bits); - xfree(bitmapFont->metrics); - if (bitmapExtra) - { - xfree (bitmapExtra->glyphNames); - xfree (bitmapExtra->sWidths); - xfree (bitmapExtra); - } - xfree(pFont->info.props); - xfree(bitmapFont); -} - - -static Bool -bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState, - int bit, int byte, int glyph, int scan) -{ - unsigned char *line; - register CharInfoPtr ci; - int i, - ndx, - nchars, - nignored; - unsigned int char_row, char_col; - int numEncodedGlyphs = 0; - CharInfoPtr *bdfEncoding[256]; - BitmapFontPtr bitmapFont; - BitmapExtraPtr bitmapExtra; - CARD32 *bitmapsSizes; - unsigned char lineBuf[BDFLINELEN]; - int nencoding; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - bitmapExtra = (BitmapExtraPtr) bitmapFont->bitmapExtra; - - if (bitmapExtra) { - bitmapsSizes = bitmapExtra->bitmapsSizes; - for (i = 0; i < GLYPHPADOPTIONS; i++) - bitmapsSizes[i] = 0; - } else - bitmapsSizes = NULL; - - bzero(bdfEncoding, sizeof(bdfEncoding)); - bitmapFont->metrics = NULL; - ndx = 0; - - line = bdfGetLine(file, lineBuf, BDFLINELEN); - - if ((!line) || (sscanf((char *) line, "CHARS %d", &nchars) != 1)) { - bdfError("bad 'CHARS' in bdf file\n"); - return (FALSE); - } - if (nchars < 1) { - bdfError("invalid number of CHARS in BDF file\n"); - return (FALSE); - } - if (nchars > INT32_MAX / sizeof(CharInfoRec)) { - bdfError("Couldn't allocate pCI (%d*%d)\n", nchars, - sizeof(CharInfoRec)); - goto BAILOUT; - } - ci = (CharInfoPtr) xalloc(nchars * sizeof(CharInfoRec)); - if (!ci) { - bdfError("Couldn't allocate pCI (%d*%d)\n", nchars, - sizeof(CharInfoRec)); - goto BAILOUT; - } - bzero((char *)ci, nchars * sizeof(CharInfoRec)); - bitmapFont->metrics = ci; - - if (bitmapExtra) { - bitmapExtra->glyphNames = (Atom *) xalloc(nchars * sizeof(Atom)); - if (!bitmapExtra->glyphNames) { - bdfError("Couldn't allocate glyphNames (%d*%d)\n", - nchars, sizeof(Atom)); - goto BAILOUT; - } - } - if (bitmapExtra) { - bitmapExtra->sWidths = (int *) xalloc(nchars * sizeof(int)); - if (!bitmapExtra->sWidths) { - bdfError("Couldn't allocate sWidth (%d *%d)\n", - nchars, sizeof(int)); - return FALSE; - } - } - line = bdfGetLine(file, lineBuf, BDFLINELEN); - pFont->info.firstRow = 256; - pFont->info.lastRow = 0; - pFont->info.firstCol = 256; - pFont->info.lastCol = 0; - nignored = 0; - for (ndx = 0; (ndx < nchars) && (line) && (bdfIsPrefix(line, "STARTCHAR"));) { - int t; - int wx; /* x component of width */ - int wy; /* y component of width */ - int bw; /* bounding-box width */ - int bh; /* bounding-box height */ - int bl; /* bounding-box left */ - int bb; /* bounding-box bottom */ - int enc, - enc2; /* encoding */ - unsigned char *p; /* temp pointer into line */ - char charName[100]; - int ignore; - - if (sscanf((char *) line, "STARTCHAR %99s", charName) != 1) { - bdfError("bad character name in BDF file\n"); - goto BAILOUT; /* bottom of function, free and return error */ - } - if (bitmapExtra) - bitmapExtra->glyphNames[ndx] = bdfForceMakeAtom(charName, NULL); - - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if (!line || (t = sscanf((char *) line, "ENCODING %d %d", &enc, &enc2)) < 1) { - bdfError("bad 'ENCODING' in BDF file\n"); - goto BAILOUT; - } - if (enc < -1 || (t == 2 && enc2 < -1)) { - bdfError("bad ENCODING value"); - goto BAILOUT; - } - if (t == 2 && enc == -1) - enc = enc2; - ignore = 0; - if (enc == -1) { - if (!bitmapExtra) { - nignored++; - ignore = 1; - } - } else if (enc > MAXENCODING) { - bdfError("char '%s' has encoding too large (%d)\n", - charName, enc); - } else { - char_row = (enc >> 8) & 0xFF; - char_col = enc & 0xFF; - if (char_row < pFont->info.firstRow) - pFont->info.firstRow = char_row; - if (char_row > pFont->info.lastRow) - pFont->info.lastRow = char_row; - if (char_col < pFont->info.firstCol) - pFont->info.firstCol = char_col; - if (char_col > pFont->info.lastCol) - pFont->info.lastCol = char_col; - if (bdfEncoding[char_row] == (CharInfoPtr *) NULL) { - bdfEncoding[char_row] = - (CharInfoPtr *) xalloc(256 * sizeof(CharInfoPtr)); - if (!bdfEncoding[char_row]) { - bdfError("Couldn't allocate row %d of encoding (%d*%d)\n", - char_row, INDICES, sizeof(CharInfoPtr)); - goto BAILOUT; - } - for (i = 0; i < 256; i++) - bdfEncoding[char_row][i] = (CharInfoPtr) NULL; - } - if (bdfEncoding[char_row] != NULL) { - bdfEncoding[char_row][char_col] = ci; - numEncodedGlyphs++; - } - } - - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if ((!line) || (sscanf((char *) line, "SWIDTH %d %d", &wx, &wy) != 2)) { - bdfError("bad 'SWIDTH'\n"); - goto BAILOUT; - } - if (wy != 0) { - bdfError("SWIDTH y value must be zero\n"); - goto BAILOUT; - } - if (bitmapExtra) - bitmapExtra->sWidths[ndx] = wx; - -/* 5/31/89 (ef) -- we should be able to ditch the character and recover */ -/* from all of these. */ - - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if ((!line) || (sscanf((char *) line, "DWIDTH %d %d", &wx, &wy) != 2)) { - bdfError("bad 'DWIDTH'\n"); - goto BAILOUT; - } - if (wy != 0) { - bdfError("DWIDTH y value must be zero\n"); - goto BAILOUT; - } - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if ((!line) || (sscanf((char *) line, "BBX %d %d %d %d", &bw, &bh, &bl, &bb) != 4)) { - bdfError("bad 'BBX'\n"); - goto BAILOUT; - } - if ((bh < 0) || (bw < 0)) { - bdfError("character '%s' has a negative sized bitmap, %dx%d\n", - charName, bw, bh); - goto BAILOUT; - } - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if ((line) && (bdfIsPrefix(line, "ATTRIBUTES"))) { - for (p = line + strlen("ATTRIBUTES "); - (*p == ' ') || (*p == '\t'); - p++) - /* empty for loop */ ; - ci->metrics.attributes = (bdfHexByte(p) << 8) + bdfHexByte(p + 2); - line = bdfGetLine(file, lineBuf, BDFLINELEN); - } else - ci->metrics.attributes = 0; - - if (!line || !bdfIsPrefix(line, "BITMAP")) { - bdfError("missing 'BITMAP'\n"); - goto BAILOUT; - } - /* collect data for generated properties */ - if ((strlen(charName) == 1)) { - if ((charName[0] >= '0') && (charName[0] <= '9')) { - pState->digitWidths += wx; - pState->digitCount++; - } else if (charName[0] == 'x') { - pState->exHeight = (bh + bb) <= 0 ? bh : bh + bb; - } - } - if (!ignore) { - ci->metrics.leftSideBearing = bl; - ci->metrics.rightSideBearing = bl + bw; - ci->metrics.ascent = bh + bb; - ci->metrics.descent = -bb; - ci->metrics.characterWidth = wx; - ci->bits = NULL; - bdfReadBitmap(ci, file, bit, byte, glyph, scan, bitmapsSizes); - ci++; - ndx++; - } else - bdfSkipBitmap(file, bh); - - line = bdfGetLine(file, lineBuf, BDFLINELEN); /* get STARTCHAR or - * ENDFONT */ - } - - if (ndx + nignored != nchars) { - bdfError("%d too few characters\n", nchars - (ndx + nignored)); - goto BAILOUT; - } - nchars = ndx; - bitmapFont->num_chars = nchars; - if ((line) && (bdfIsPrefix(line, "STARTCHAR"))) { - bdfError("more characters than specified\n"); - goto BAILOUT; - } - if ((!line) || (!bdfIsPrefix(line, "ENDFONT"))) { - bdfError("missing 'ENDFONT'\n"); - goto BAILOUT; - } - if (numEncodedGlyphs == 0) - bdfWarning("No characters with valid encodings\n"); - - nencoding = (pFont->info.lastRow - pFont->info.firstRow + 1) * - (pFont->info.lastCol - pFont->info.firstCol + 1); - bitmapFont->encoding = - (CharInfoPtr **) xcalloc(NUM_SEGMENTS(nencoding), - sizeof(CharInfoPtr*)); - if (!bitmapFont->encoding) { - bdfError("Couldn't allocate ppCI (%d,%d)\n", - NUM_SEGMENTS(nencoding), - sizeof(CharInfoPtr*)); - goto BAILOUT; - } - pFont->info.allExist = TRUE; - i = 0; - for (char_row = pFont->info.firstRow; - char_row <= pFont->info.lastRow; - char_row++) { - if (bdfEncoding[char_row] == (CharInfoPtr *) NULL) { - pFont->info.allExist = FALSE; - i += pFont->info.lastCol - pFont->info.firstCol + 1; - } else { - for (char_col = pFont->info.firstCol; - char_col <= pFont->info.lastCol; - char_col++) { - if (!bdfEncoding[char_row][char_col]) - pFont->info.allExist = FALSE; - else { - if (!bitmapFont->encoding[SEGMENT_MAJOR(i)]) { - bitmapFont->encoding[SEGMENT_MAJOR(i)]= - (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE, - sizeof(CharInfoPtr)); - if (!bitmapFont->encoding[SEGMENT_MAJOR(i)]) - goto BAILOUT; - } - ACCESSENCODINGL(bitmapFont->encoding,i) = - bdfEncoding[char_row][char_col]; - } - i++; - } - } - } - for (i = 0; i < 256; i++) - if (bdfEncoding[i]) - xfree(bdfEncoding[i]); - return (TRUE); -BAILOUT: - for (i = 0; i < 256; i++) - if (bdfEncoding[i]) - xfree(bdfEncoding[i]); - /* bdfFreeFontBits will clean up the rest */ - return (FALSE); -} - -/***====================================================================***/ - -static Bool -bdfReadHeader(FontFilePtr file, bdfFileState *pState) -{ - unsigned char *line; - char namebuf[BDFLINELEN]; - unsigned char lineBuf[BDFLINELEN]; - - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if (!line || sscanf((char *) line, "STARTFONT %s", namebuf) != 1 || - !bdfStrEqual(namebuf, "2.1")) { - bdfError("bad 'STARTFONT'\n"); - return (FALSE); - } - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if (!line || sscanf((char *) line, "FONT %[^\n]", pState->fontName) != 1) { - bdfError("bad 'FONT'\n"); - return (FALSE); - } - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if (!line || !bdfIsPrefix(line, "SIZE")) { - bdfError("missing 'SIZE'\n"); - return (FALSE); - } - if (sscanf((char *) line, "SIZE %f%d%d", &pState->pointSize, - &pState->resolution_x, &pState->resolution_y) != 3) { - bdfError("bad 'SIZE'\n"); - return (FALSE); - } - if (pState->pointSize < 1 || - pState->resolution_x < 1 || pState->resolution_y < 1) { - bdfError("SIZE values must be > 0\n"); - return (FALSE); - } - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if (!line || !bdfIsPrefix(line, "FONTBOUNDINGBOX")) { - bdfError("missing 'FONTBOUNDINGBOX'\n"); - return (FALSE); - } - return (TRUE); -} - -/***====================================================================***/ - -static Bool -bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState) -{ - int nProps, props_left, - nextProp; - char *stringProps; - FontPropPtr props; - char namebuf[BDFLINELEN], - secondbuf[BDFLINELEN], - thirdbuf[BDFLINELEN]; - unsigned char *line; - unsigned char lineBuf[BDFLINELEN]; - BitmapFontPtr bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if (!line || !bdfIsPrefix(line, "STARTPROPERTIES")) { - bdfError("missing 'STARTPROPERTIES'\n"); - return (FALSE); - } - if (sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) { - bdfError("bad 'STARTPROPERTIES'\n"); - return (FALSE); - } - pFont->info.isStringProp = NULL; - pFont->info.props = NULL; - pFont->info.nprops = 0; - - stringProps = (char *) xalloc((nProps + BDF_GENPROPS) * sizeof(char)); - pFont->info.isStringProp = stringProps; - if (stringProps == NULL) { - bdfError("Couldn't allocate stringProps (%d*%d)\n", - (nProps + BDF_GENPROPS), sizeof(Bool)); - goto BAILOUT; - } - pFont->info.props = props = (FontPropPtr) xalloc((nProps + BDF_GENPROPS) * - sizeof(FontPropRec)); - if (props == NULL) { - bdfError("Couldn't allocate props (%d*%d)\n", nProps + BDF_GENPROPS, - sizeof(FontPropRec)); - goto BAILOUT; - } - bzero((char *)props, (nProps + BDF_GENPROPS) * sizeof(FontPropRec)); - - nextProp = 0; - props_left = nProps; - while (props_left-- > 0) { - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if (line == NULL || bdfIsPrefix(line, "ENDPROPERTIES")) { - bdfError("\"STARTPROPERTIES %d\" followed by only %d properties\n", - nProps, nProps - props_left - 1); - goto BAILOUT; - } - while (*line && isspace(*line)) - line++; - - switch (sscanf((char *) line, "%s%s%s", namebuf, secondbuf, thirdbuf)) { - default: - bdfError("missing '%s' parameter value\n", namebuf); - goto BAILOUT; - - case 2: - /* - * Possibilites include: valid quoted string with no white space - * valid integer value invalid value - */ - if (secondbuf[0] == '"') { - stringProps[nextProp] = TRUE; - props[nextProp].value = - bdfGetPropertyValue((char *)line + strlen(namebuf) + 1); - if (!props[nextProp].value) - goto BAILOUT; - break; - } else if (bdfIsInteger(secondbuf)) { - stringProps[nextProp] = FALSE; - props[nextProp].value = atoi(secondbuf); - break; - } else { - bdfError("invalid '%s' parameter value\n", namebuf); - goto BAILOUT; - } - - case 3: - /* - * Possibilites include: valid quoted string with some white space - * invalid value (reject even if second string is integer) - */ - if (secondbuf[0] == '"') { - stringProps[nextProp] = TRUE; - props[nextProp].value = - bdfGetPropertyValue((char *)line + strlen(namebuf) + 1); - if (!props[nextProp].value) - goto BAILOUT; - break; - } else { - bdfError("invalid '%s' parameter value\n", namebuf); - goto BAILOUT; - } - } - props[nextProp].name = bdfForceMakeAtom(namebuf, NULL); - if (props[nextProp].name == None) { - bdfError("Empty property name.\n"); - goto BAILOUT; - } - if (!bdfSpecialProperty(pFont, &props[nextProp], - stringProps[nextProp], pState)) - nextProp++; - } - - line = bdfGetLine(file, lineBuf, BDFLINELEN); - if (!line || !bdfIsPrefix(line, "ENDPROPERTIES")) { - bdfError("missing 'ENDPROPERTIES'\n"); - goto BAILOUT; - } - if (!pState->haveFontAscent || !pState->haveFontDescent) { - bdfError("missing 'FONT_ASCENT' or 'FONT_DESCENT' properties\n"); - goto BAILOUT; - } - if (bitmapFont->bitmapExtra) { - bitmapFont->bitmapExtra->info.fontAscent = pFont->info.fontAscent; - bitmapFont->bitmapExtra->info.fontDescent = pFont->info.fontDescent; - } - if (!pState->pointSizeProp) { - props[nextProp].name = bdfForceMakeAtom("POINT_SIZE", NULL); - props[nextProp].value = (INT32) (pState->pointSize * 10.0); - stringProps[nextProp] = FALSE; - pState->pointSizeProp = &props[nextProp]; - nextProp++; - } - if (!pState->fontProp) { - props[nextProp].name = bdfForceMakeAtom("FONT", NULL); - props[nextProp].value = (INT32) bdfForceMakeAtom(pState->fontName, NULL); - stringProps[nextProp] = TRUE; - pState->fontProp = &props[nextProp]; - nextProp++; - } - if (!pState->weightProp) { - props[nextProp].name = bdfForceMakeAtom("WEIGHT", NULL); - props[nextProp].value = -1; /* computed later */ - stringProps[nextProp] = FALSE; - pState->weightProp = &props[nextProp]; - nextProp++; - } - if (!pState->resolutionProp && - pState->resolution_x == pState->resolution_y) { - props[nextProp].name = bdfForceMakeAtom("RESOLUTION", NULL); - props[nextProp].value = (INT32) ((pState->resolution_x * 100.0) / 72.27); - stringProps[nextProp] = FALSE; - pState->resolutionProp = &props[nextProp]; - nextProp++; - } - if (!pState->resolutionXProp) { - props[nextProp].name = bdfForceMakeAtom("RESOLUTION_X", NULL); - props[nextProp].value = (INT32) pState->resolution_x; - stringProps[nextProp] = FALSE; - pState->resolutionProp = &props[nextProp]; - nextProp++; - } - if (!pState->resolutionYProp) { - props[nextProp].name = bdfForceMakeAtom("RESOLUTION_Y", NULL); - props[nextProp].value = (INT32) pState->resolution_y; - stringProps[nextProp] = FALSE; - pState->resolutionProp = &props[nextProp]; - nextProp++; - } - if (!pState->xHeightProp) { - props[nextProp].name = bdfForceMakeAtom("X_HEIGHT", NULL); - props[nextProp].value = -1; /* computed later */ - stringProps[nextProp] = FALSE; - pState->xHeightProp = &props[nextProp]; - nextProp++; - } - if (!pState->quadWidthProp) { - props[nextProp].name = bdfForceMakeAtom("QUAD_WIDTH", NULL); - props[nextProp].value = -1; /* computed later */ - stringProps[nextProp] = FALSE; - pState->quadWidthProp = &props[nextProp]; - nextProp++; - } - pFont->info.nprops = nextProp; - return (TRUE); -BAILOUT: - if (pFont->info.isStringProp) { - xfree(pFont->info.isStringProp); - pFont->info.isStringProp = NULL; - } - if (pFont->info.props) { - xfree(pFont->info.props); - pFont->info.props = NULL; - } - while (line && bdfIsPrefix(line, "ENDPROPERTIES")) - line = bdfGetLine(file, lineBuf, BDFLINELEN); - return (FALSE); -} - -/***====================================================================***/ - -static void -bdfUnloadFont(FontPtr pFont) -{ - bdfFreeFontBits (pFont); - DestroyFontRec(pFont); -} - -int -bdfReadFont(FontPtr pFont, FontFilePtr file, - int bit, int byte, int glyph, int scan) -{ - bdfFileState state; - xCharInfo *min, - *max; - BitmapFontPtr bitmapFont; - - pFont->fontPrivate = 0; - - bzero(&state, sizeof(bdfFileState)); - bdfFileLineNum = 0; - - if (!bdfReadHeader(file, &state)) - goto BAILOUT; - - bitmapFont = (BitmapFontPtr) xalloc(sizeof(BitmapFontRec)); - if (!bitmapFont) { - bdfError("Couldn't allocate bitmapFontRec (%d)\n", sizeof(BitmapFontRec)); - goto BAILOUT; - } - bzero((char *)bitmapFont, sizeof(BitmapFontRec)); - - pFont->fontPrivate = (pointer) bitmapFont; - bitmapFont->metrics = 0; - bitmapFont->ink_metrics = 0; - bitmapFont->bitmaps = 0; - bitmapFont->encoding = 0; - bitmapFont->pDefault = NULL; - - bitmapFont->bitmapExtra = (BitmapExtraPtr) xalloc(sizeof(BitmapExtraRec)); - if (!bitmapFont->bitmapExtra) { - bdfError("Couldn't allocate bitmapExtra (%d)\n", sizeof(BitmapExtraRec)); - goto BAILOUT; - } - bzero((char *)bitmapFont->bitmapExtra, sizeof(BitmapExtraRec)); - - bitmapFont->bitmapExtra->glyphNames = 0; - bitmapFont->bitmapExtra->sWidths = 0; - - if (!bdfReadProperties(file, pFont, &state)) - goto BAILOUT; - - if (!bdfReadCharacters(file, pFont, &state, bit, byte, glyph, scan)) - goto BAILOUT; - - if (state.haveDefaultCh) { - unsigned int r, c, cols; - - r = pFont->info.defaultCh >> 8; - c = pFont->info.defaultCh & 0xFF; - if (pFont->info.firstRow <= r && r <= pFont->info.lastRow && - pFont->info.firstCol <= c && c <= pFont->info.lastCol) { - cols = pFont->info.lastCol - pFont->info.firstCol + 1; - r = r - pFont->info.firstRow; - c = c - pFont->info.firstCol; - bitmapFont->pDefault = ACCESSENCODING(bitmapFont->encoding, - r * cols + c); - } - } - pFont->bit = bit; - pFont->byte = byte; - pFont->glyph = glyph; - pFont->scan = scan; - pFont->info.anamorphic = FALSE; - pFont->info.cachable = TRUE; - bitmapComputeFontBounds(pFont); - if (FontCouldBeTerminal(&pFont->info)) { - bdfPadToTerminal(pFont); - bitmapComputeFontBounds(pFont); - } - FontComputeInfoAccelerators(&pFont->info); - if (bitmapFont->bitmapExtra) - FontComputeInfoAccelerators(&bitmapFont->bitmapExtra->info); - if (pFont->info.constantMetrics) { - if (!bitmapAddInkMetrics(pFont)) { - bdfError("Failed to add bitmap ink metrics\n"); - goto BAILOUT; - } - } - if (bitmapFont->bitmapExtra) - bitmapFont->bitmapExtra->info.inkMetrics = pFont->info.inkMetrics; - - bitmapComputeFontInkBounds(pFont); -/* ComputeFontAccelerators (pFont); */ - - /* generate properties */ - min = &pFont->info.ink_minbounds; - max = &pFont->info.ink_maxbounds; - if (state.xHeightProp && (state.xHeightProp->value == -1)) - state.xHeightProp->value = state.exHeight ? - state.exHeight : min->ascent; - - if (state.quadWidthProp && (state.quadWidthProp->value == -1)) - state.quadWidthProp->value = state.digitCount ? - (INT32) (state.digitWidths / state.digitCount) : - (min->characterWidth + max->characterWidth) / 2; - - if (state.weightProp && (state.weightProp->value == -1)) - state.weightProp->value = bitmapComputeWeight(pFont); - - pFont->get_glyphs = bitmapGetGlyphs; - pFont->get_metrics = bitmapGetMetrics; - pFont->unload_font = bdfUnloadFont; - pFont->unload_glyphs = NULL; - return Successful; -BAILOUT: - if (pFont->fontPrivate) - bdfFreeFontBits (pFont); - return AllocError; -} - -int -bdfReadFontInfo(FontInfoPtr pFontInfo, FontFilePtr file) -{ - FontRec font; - int ret; - - bzero(&font, sizeof (FontRec)); - - ret = bdfReadFont(&font, file, MSBFirst, LSBFirst, 1, 1); - if (ret == Successful) { - *pFontInfo = font.info; - font.info.props = 0; - font.info.isStringProp = 0; - font.info.nprops = 0; - bdfFreeFontBits (&font); - } - return ret; -} - -static Bool -bdfPadToTerminal(FontPtr pFont) -{ - BitmapFontPtr bitmapFont; - BitmapExtraPtr bitmapExtra; - int i; - int new_size; - CharInfoRec new; - int w, - h; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - - bzero(&new, sizeof(CharInfoRec)); - new.metrics.ascent = pFont->info.fontAscent; - new.metrics.descent = pFont->info.fontDescent; - new.metrics.leftSideBearing = 0; - new.metrics.rightSideBearing = pFont->info.minbounds.characterWidth; - new.metrics.characterWidth = new.metrics.rightSideBearing; - new_size = BYTES_FOR_GLYPH(&new, pFont->glyph); - - for (i = 0; i < bitmapFont->num_chars; i++) { - new.bits = (char *) xalloc(new_size); - if (!new.bits) { - bdfError("Couldn't allocate bits (%d)\n", new_size); - return FALSE; - } - FontCharReshape(pFont, &bitmapFont->metrics[i], &new); - new.metrics.attributes = bitmapFont->metrics[i].metrics.attributes; - xfree(bitmapFont->metrics[i].bits); - bitmapFont->metrics[i] = new; - } - bitmapExtra = bitmapFont->bitmapExtra; - if (bitmapExtra) { - w = GLYPHWIDTHPIXELS(&new); - h = GLYPHHEIGHTPIXELS(&new); - for (i = 0; i < GLYPHPADOPTIONS; i++) - bitmapExtra->bitmapsSizes[i] = bitmapFont->num_chars * - (BYTES_PER_ROW(w, 1 << i) * h); - } - return TRUE; -} diff --git a/nx-X11/lib/font/bitmap/bdfutils.c b/nx-X11/lib/font/bitmap/bdfutils.c deleted file mode 100644 index a0c5ae949..000000000 --- a/nx-X11/lib/font/bitmap/bdfutils.c +++ /dev/null @@ -1,340 +0,0 @@ -/* $Xorg: bdfutils.c,v 1.5 2001/02/09 02:04:02 xorgcvs Exp $ */ -/************************************************************************ -Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ - -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/bdfutils.c,v 1.10 2001/12/14 19:56:45 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef FONTMODULE -#include -#include -#include -#endif - -#include -#include -/* use bitmap structure */ -#include -#include - -int bdfFileLineNum; - -/***====================================================================***/ - -void -bdfError(char* message, ...) -{ - va_list args; - - va_start (args, message); - fprintf(stderr, "BDF Error on line %d: ", bdfFileLineNum); - vfprintf(stderr, message, args); - va_end (args); -} - -/***====================================================================***/ - -void -bdfWarning(char *message, ...) -{ - va_list args; - - va_start (args, message); - fprintf(stderr, "BDF Warning on line %d: ", bdfFileLineNum); - vfprintf(stderr, message, args); - va_end (args); -} - -/* - * read the next (non-comment) line and keep a count for error messages. - * Returns buf, or NULL if EOF. - */ - -unsigned char * -bdfGetLine(FontFilePtr file, unsigned char *buf, int len) -{ - int c; - unsigned char *b; - - for (;;) { - b = buf; - while ((c = FontFileGetc(file)) != FontFileEOF) { - if (c == '\r') - continue; - if (c == '\n') { - bdfFileLineNum++; - break; - } - if (b - buf >= (len - 1)) - break; - *b++ = c; - } - *b = '\0'; - if (c == FontFileEOF) - return NULL; - if (b != buf && !bdfIsPrefix(buf, "COMMENT")) - break; - } - return buf; -} - -/***====================================================================***/ - -Atom -bdfForceMakeAtom(char *str, int *size) -{ - register int len = strlen(str); - Atom the_atom; - - if (size != NULL) - *size += len + 1; - the_atom = MakeAtom(str, len, TRUE); - if (the_atom == None) - bdfError("Atom allocation failed\n"); - return the_atom; -} - -/***====================================================================***/ - -/* - * Handle quoted strings. - */ - -Atom -bdfGetPropertyValue(char *s) -{ - register char *p, - *pp; - char *orig_s = s; - Atom atom; - - /* strip leading white space */ - while (*s && (*s == ' ' || *s == '\t')) - s++; - if (*s == 0) { - return bdfForceMakeAtom(s, NULL); - } - if (*s != '"') { - pp = s; - /* no white space in value */ - for (pp = s; *pp; pp++) - if (*pp == ' ' || *pp == '\t' || *pp == '\015' || *pp == '\n') { - *pp = 0; - break; - } - return bdfForceMakeAtom(s, NULL); - } - /* quoted string: strip outer quotes and undouble inner quotes */ - s++; - pp = p = (char *) xalloc((unsigned) strlen(s) + 1); - if (pp == NULL) { - bdfError("Couldn't allocate property value string (%d)\n", strlen(s) + 1); - return None; - } - while (*s) { - if (*s == '"') { - if (*(s + 1) != '"') { - *p++ = 0; - atom = bdfForceMakeAtom(pp, NULL); - xfree(pp); - return atom; - } else { - s++; - } - } - *p++ = *s++; - } - xfree (pp); - bdfError("unterminated quoted string property: %s\n", (pointer) orig_s); - return None; -} - -/***====================================================================***/ - -/* - * return TRUE if string is a valid integer - */ -int -bdfIsInteger(char *str) -{ - char c; - - c = *str++; - if (!(isdigit(c) || c == '-' || c == '+')) - return (FALSE); - - while ((c = *str++)) - if (!isdigit(c)) - return (FALSE); - - return (TRUE); -} - -/***====================================================================***/ - -/* - * make a byte from the first two hex characters in glyph picture - */ - -unsigned char -bdfHexByte(unsigned char *s) -{ - unsigned char b = 0; - register char c; - int i; - - for (i = 2; i; i--) { - c = *s++; - if ((c >= '0') && (c <= '9')) - b = (b << 4) + (c - '0'); - else if ((c >= 'A') && (c <= 'F')) - b = (b << 4) + 10 + (c - 'A'); - else if ((c >= 'a') && (c <= 'f')) - b = (b << 4) + 10 + (c - 'a'); - else - bdfError("bad hex char '%c'", c); - } - return b; -} - -/***====================================================================***/ - -/* - * check for known special property values - */ - -static char *SpecialAtoms[] = { - "FONT_ASCENT", -#define BDF_FONT_ASCENT 0 - "FONT_DESCENT", -#define BDF_FONT_DESCENT 1 - "DEFAULT_CHAR", -#define BDF_DEFAULT_CHAR 2 - "POINT_SIZE", -#define BDF_POINT_SIZE 3 - "RESOLUTION", -#define BDF_RESOLUTION 4 - "X_HEIGHT", -#define BDF_X_HEIGHT 5 - "WEIGHT", -#define BDF_WEIGHT 6 - "QUAD_WIDTH", -#define BDF_QUAD_WIDTH 7 - "FONT", -#define BDF_FONT 8 - "RESOLUTION_X", -#define BDF_RESOLUTION_X 9 - "RESOLUTION_Y", -#define BDF_RESOLUTION_Y 10 - 0, -}; - -Bool -bdfSpecialProperty(FontPtr pFont, FontPropPtr prop, - char isString, bdfFileState *bdfState) -{ - char **special; - char *name; - - name = NameForAtom(prop->name); - for (special = SpecialAtoms; *special; special++) - if (!strcmp(name, *special)) - break; - - switch (special - SpecialAtoms) { - case BDF_FONT_ASCENT: - if (!isString) { - pFont->info.fontAscent = prop->value; - bdfState->haveFontAscent = TRUE; - } - return TRUE; - case BDF_FONT_DESCENT: - if (!isString) { - pFont->info.fontDescent = prop->value; - bdfState->haveFontDescent = TRUE; - } - return TRUE; - case BDF_DEFAULT_CHAR: - if (!isString) { - pFont->info.defaultCh = prop->value; - bdfState->haveDefaultCh = TRUE; - } - return TRUE; - case BDF_POINT_SIZE: - bdfState->pointSizeProp = prop; - return FALSE; - case BDF_RESOLUTION: - bdfState->resolutionProp = prop; - return FALSE; - case BDF_X_HEIGHT: - bdfState->xHeightProp = prop; - return FALSE; - case BDF_WEIGHT: - bdfState->weightProp = prop; - return FALSE; - case BDF_QUAD_WIDTH: - bdfState->quadWidthProp = prop; - return FALSE; - case BDF_FONT: - bdfState->fontProp = prop; - return FALSE; - case BDF_RESOLUTION_X: - bdfState->resolutionXProp = prop; - return FALSE; - case BDF_RESOLUTION_Y: - bdfState->resolutionYProp = prop; - return FALSE; - default: - return FALSE; - } -} diff --git a/nx-X11/lib/font/bitmap/bitmap.c b/nx-X11/lib/font/bitmap/bitmap.c deleted file mode 100644 index d238f4d30..000000000 --- a/nx-X11/lib/font/bitmap/bitmap.c +++ /dev/null @@ -1,160 +0,0 @@ -/* $Xorg: bitmap.c,v 1.4 2001/02/09 02:04:02 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/bitmap.c,v 1.6 2001/01/17 19:43:27 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -int -bitmapGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - CharInfoPtr *glyphs) /* RETURN */ -{ - BitmapFontPtr bitmapFont; - unsigned int firstCol; - register unsigned int numCols; - unsigned int firstRow; - unsigned int numRows; - CharInfoPtr *glyphsBase; - register unsigned int c; - register CharInfoPtr pci; - unsigned int r; - CharInfoPtr **encoding; - CharInfoPtr pDefault; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - encoding = bitmapFont->encoding; - pDefault = bitmapFont->pDefault; - firstCol = pFont->info.firstCol; - numCols = pFont->info.lastCol - firstCol + 1; - glyphsBase = glyphs; - switch (charEncoding) { - - case Linear8Bit: - case TwoD8Bit: - if (pFont->info.firstRow > 0) - break; - if (pFont->info.allExist && pDefault) { - while (count--) { - c = (*chars++) - firstCol; - if (c < numCols) - *glyphs++ = ACCESSENCODING(encoding,c); - else - *glyphs++ = pDefault; - } - } else { - while (count--) { - c = (*chars++) - firstCol; - if (c < numCols && (pci = ACCESSENCODING(encoding,c))) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - } - break; - case Linear16Bit: - if (pFont->info.allExist && pDefault) { - while (count--) { - c = *chars++ << 8; - c = (c | *chars++) - firstCol; - if (c < numCols) - *glyphs++ = ACCESSENCODING(encoding,c); - else - *glyphs++ = pDefault; - } - } else { - while (count--) { - c = *chars++ << 8; - c = (c | *chars++) - firstCol; - if (c < numCols && (pci = ACCESSENCODING(encoding,c))) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - } - break; - - case TwoD16Bit: - firstRow = pFont->info.firstRow; - numRows = pFont->info.lastRow - firstRow + 1; - while (count--) { - r = (*chars++) - firstRow; - c = (*chars++) - firstCol; - if (r < numRows && c < numCols && - (pci = ACCESSENCODING(encoding, r * numCols + c))) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - break; - } - *glyphCount = glyphs - glyphsBase; - return Successful; -} - -static CharInfoRec nonExistantChar; - -int -bitmapGetMetrics(FontPtr pFont, unsigned long count, unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - xCharInfo **glyphs) /* RETURN */ -{ - int ret; - xCharInfo *ink_metrics; - CharInfoPtr metrics; - BitmapFontPtr bitmapFont; - CharInfoPtr oldDefault; - int i; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - oldDefault = bitmapFont->pDefault; - bitmapFont->pDefault = &nonExistantChar; - ret = bitmapGetGlyphs(pFont, count, chars, charEncoding, glyphCount, (CharInfoPtr *) glyphs); - if (ret == Successful) { - if (bitmapFont->ink_metrics) { - metrics = bitmapFont->metrics; - ink_metrics = bitmapFont->ink_metrics; - for (i = 0; i < *glyphCount; i++) { - if (glyphs[i] != (xCharInfo *) & nonExistantChar) - glyphs[i] = ink_metrics + (((CharInfoPtr) glyphs[i]) - metrics); - } - } - } - bitmapFont->pDefault = oldDefault; - return ret; -} diff --git a/nx-X11/lib/font/bitmap/bitmapfunc.c b/nx-X11/lib/font/bitmap/bitmapfunc.c deleted file mode 100644 index e6187e5ee..000000000 --- a/nx-X11/lib/font/bitmap/bitmapfunc.c +++ /dev/null @@ -1,240 +0,0 @@ -/* $Xorg: bitmapfunc.c,v 1.5 2001/02/09 02:04:02 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -/* $XFree86: xc/lib/font/bitmap/bitmapfunc.c,v 3.17 2002/09/19 13:21:58 tsi Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* - * Translate monolithic #defines to modular definitions - */ - -#ifdef PCFFORMAT -#define XFONT_PCFFORMAT 1 -#endif - -#ifdef SNFFORMAT -#define XFONT_SNFFORMAT 1 -#endif - -#ifdef BDFFORMAT -#define XFONT_BDFFORMAT 1 -#endif - -#include -#include -#include -#include -#include -#include "snfstr.h" - -typedef struct _BitmapFileFunctions { - int (*ReadFont) (FontPtr /* pFont */, FontFilePtr /* file */, - int /* bit */, int /* byte */, - int /* glyph */, int /* scan */); - int (*ReadInfo) ( FontInfoPtr /* pFontInfo */, - FontFilePtr /* file */ ); -} BitmapFileFunctionsRec, *BitmapFileFunctionsPtr; - - -/* - * the readers[] and renderers[] arrays must be in the same order, - * and also in the same order as scale[] and find_scale[] in bitscale.c - * - */ -static BitmapFileFunctionsRec readers[] = { -#if XFONT_PCFFORMAT - { pcfReadFont, pcfReadFontInfo} , - { pcfReadFont, pcfReadFontInfo} , -#ifdef X_GZIP_FONT_COMPRESSION - { pcfReadFont, pcfReadFontInfo} , -#endif -#endif -#if XFONT_SNFFORMAT - { snfReadFont, snfReadFontInfo}, - { snfReadFont, snfReadFontInfo}, -#ifdef X_GZIP_FONT_COMPRESSION - { snfReadFont, snfReadFontInfo} , -#endif -#endif -#if XFONT_BDFFORMAT - { bdfReadFont, bdfReadFontInfo} , - { bdfReadFont, bdfReadFontInfo} , -#ifdef X_GZIP_FONT_COMPRESSION - { bdfReadFont, bdfReadFontInfo} , -#endif -#endif -#if XFONT_PCFFORMAT - { pmfReadFont, pcfReadFontInfo} , -#endif -}; - - -#define CAPABILITIES (CAP_MATRIX | CAP_CHARSUBSETTING) - -static FontRendererRec renderers[] = { -#if XFONT_PCFFORMAT - { ".pcf", 4, BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES }, - { ".pcf.Z", 6, BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES }, -#ifdef X_GZIP_FONT_COMPRESSION - { ".pcf.gz", 7, - BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES }, -#endif -#endif -#if XFONT_SNFFORMAT - { ".snf", 4, BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES }, - { ".snf.Z", 6, BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES }, -#ifdef X_GZIP_FONT_COMPRESSION - { ".snf.gz", 7, BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES }, -#endif -#endif -#if XFONT_BDFFORMAT - { ".bdf", 4, BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES }, - { ".bdf.Z", 6, BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES }, -#ifdef X_GZIP_FONT_COMPRESSION - { ".bdf.gz", 7, BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES }, -#endif -#endif -#if XFONT_PCFFORMAT - { ".pmf", 4, BitmapOpenBitmap, BitmapOpenScalable, - BitmapGetInfoBitmap, BitmapGetInfoScalable, 0, - CAPABILITIES } -#endif -}; - -int -BitmapOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags, - FontEntryPtr entry, char *fileName, - fsBitmapFormat format, fsBitmapFormatMask fmask, - FontPtr non_cachable_font) /* We don't do licensing */ -{ - FontFilePtr file; - FontPtr pFont; - int i; - int ret; - int bit, - byte, - glyph, - scan, - image; - - i = BitmapGetRenderIndex(entry->u.bitmap.renderer); - file = FontFileOpen (fileName); - if (!file) - return BadFontName; - if (!(pFont = CreateFontRec())) { - fprintf(stderr, "Error: Couldn't allocate pFont (%ld)\n", - (unsigned long)sizeof(FontRec)); - FontFileClose (file); - return AllocError; - } - /* set up default values */ - FontDefaultFormat(&bit, &byte, &glyph, &scan); - /* get any changes made from above */ - ret = CheckFSFormat(format, fmask, &bit, &byte, &scan, &glyph, &image); - - /* Fill in font record. Data format filled in by reader. */ - pFont->refcnt = 0; - - ret = (*readers[i].ReadFont) (pFont, file, bit, byte, glyph, scan); - - FontFileClose (file); - if (ret != Successful) { - xfree(pFont); - } else { - *ppFont = pFont; - } - return ret; -} - -int -BitmapGetInfoBitmap (FontPathElementPtr fpe, FontInfoPtr pFontInfo, - FontEntryPtr entry, char *fileName) -{ - FontFilePtr file; - int i; - int ret; - FontRendererPtr renderer; - - renderer = FontFileMatchRenderer (fileName); - if (!renderer) - return BadFontName; - i = BitmapGetRenderIndex(renderer); - file = FontFileOpen (fileName); - if (!file) - return BadFontName; - ret = (*readers[i].ReadInfo) (pFontInfo, file); - FontFileClose (file); - return ret; -} - -#define numRenderers (sizeof renderers / sizeof renderers[0]) - -void -BitmapRegisterFontFileFunctions (void) -{ - int i; - - for (i = 0; i < numRenderers; i++) - FontFileRegisterRenderer (&renderers[i]); -} - -/* - * compute offset into renderers array - used to find the font reader, - * the font info reader, and the bitmap scaling routine. All users - * of this routine must be kept in step with the renderer array. - */ -int -BitmapGetRenderIndex(FontRendererPtr renderer) -{ - return renderer - renderers; -} diff --git a/nx-X11/lib/font/bitmap/bitmaputil.c b/nx-X11/lib/font/bitmap/bitmaputil.c deleted file mode 100644 index 3487f7f92..000000000 --- a/nx-X11/lib/font/bitmap/bitmaputil.c +++ /dev/null @@ -1,232 +0,0 @@ -/* $Xorg: bitmaputil.c,v 1.5 2001/02/09 02:04:02 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/bitmaputil.c,v 1.10 2002/09/24 20:52:48 tsi Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#ifndef MAXSHORT -#define MAXSHORT 32767 -#endif - -#ifndef MINSHORT -#define MINSHORT -32768 -#endif - -static xCharInfo initMinMetrics = { -MAXSHORT, MAXSHORT, MAXSHORT, MAXSHORT, MAXSHORT, 0xFFFF}; -static xCharInfo initMaxMetrics = { -MINSHORT, MINSHORT, MINSHORT, MINSHORT, MINSHORT, 0x0000}; - -#define MINMAX(field,ci) \ - if (minbounds->field > (ci)->field) \ - minbounds->field = (ci)->field; \ - if (maxbounds->field < (ci)->field) \ - maxbounds->field = (ci)->field; - -#define COMPUTE_MINMAX(ci) \ - if ((ci)->ascent || (ci)->descent || \ - (ci)->leftSideBearing || (ci)->rightSideBearing || \ - (ci)->characterWidth) \ - { \ - MINMAX(ascent, (ci)); \ - MINMAX(descent, (ci)); \ - MINMAX(leftSideBearing, (ci)); \ - MINMAX(rightSideBearing, (ci)); \ - MINMAX(characterWidth, (ci)); \ - } - -void -bitmapComputeFontBounds(FontPtr pFont) -{ - BitmapFontPtr bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - int nchars; - int r, - c; - CharInfoPtr ci; - int maxOverlap; - int overlap; - xCharInfo *minbounds, - *maxbounds; - int i; - int numneg = 0, numpos = 0; - - if (bitmapFont->bitmapExtra) { - minbounds = &bitmapFont->bitmapExtra->info.minbounds; - maxbounds = &bitmapFont->bitmapExtra->info.maxbounds; - } else { - minbounds = &pFont->info.minbounds; - maxbounds = &pFont->info.maxbounds; - } - *minbounds = initMinMetrics; - *maxbounds = initMaxMetrics; - maxOverlap = MINSHORT; - nchars = bitmapFont->num_chars; - for (i = 0, ci = bitmapFont->metrics; i < nchars; i++, ci++) { - COMPUTE_MINMAX(&ci->metrics); - if (ci->metrics.characterWidth < 0) - numneg++; - else - numpos++; - minbounds->attributes &= ci->metrics.attributes; - maxbounds->attributes |= ci->metrics.attributes; - overlap = ci->metrics.rightSideBearing - ci->metrics.characterWidth; - if (maxOverlap < overlap) - maxOverlap = overlap; - } - if (bitmapFont->bitmapExtra) { - if (numneg > numpos) - bitmapFont->bitmapExtra->info.drawDirection = RightToLeft; - else - bitmapFont->bitmapExtra->info.drawDirection = LeftToRight; - bitmapFont->bitmapExtra->info.maxOverlap = maxOverlap; - minbounds = &pFont->info.minbounds; - maxbounds = &pFont->info.maxbounds; - *minbounds = initMinMetrics; - *maxbounds = initMaxMetrics; - i = 0; - maxOverlap = MINSHORT; - for (r = pFont->info.firstRow; r <= pFont->info.lastRow; r++) { - for (c = pFont->info.firstCol; c <= pFont->info.lastCol; c++) { - ci = ACCESSENCODING(bitmapFont->encoding, i); - if (ci) { - COMPUTE_MINMAX(&ci->metrics); - if (ci->metrics.characterWidth < 0) - numneg++; - else - numpos++; - minbounds->attributes &= ci->metrics.attributes; - maxbounds->attributes |= ci->metrics.attributes; - overlap = ci->metrics.rightSideBearing - - ci->metrics.characterWidth; - if (maxOverlap < overlap) - maxOverlap = overlap; - } - i++; - } - } - } - if (numneg > numpos) - pFont->info.drawDirection = RightToLeft; - else - pFont->info.drawDirection = LeftToRight; - pFont->info.maxOverlap = maxOverlap; -} - -void -bitmapComputeFontInkBounds(FontPtr pFont) -{ - BitmapFontPtr bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - int nchars; - int r, - c; - CharInfoPtr cit; - xCharInfo *ci; - int offset; - xCharInfo *minbounds, - *maxbounds; - int i; - - if (!bitmapFont->ink_metrics) { - if (bitmapFont->bitmapExtra) { - bitmapFont->bitmapExtra->info.ink_minbounds = bitmapFont->bitmapExtra->info.minbounds; - bitmapFont->bitmapExtra->info.ink_maxbounds = bitmapFont->bitmapExtra->info.maxbounds; - } - pFont->info.ink_minbounds = pFont->info.minbounds; - pFont->info.ink_maxbounds = pFont->info.maxbounds; - } else { - if (bitmapFont->bitmapExtra) { - minbounds = &bitmapFont->bitmapExtra->info.ink_minbounds; - maxbounds = &bitmapFont->bitmapExtra->info.ink_maxbounds; - } else { - minbounds = &pFont->info.ink_minbounds; - maxbounds = &pFont->info.ink_maxbounds; - } - *minbounds = initMinMetrics; - *maxbounds = initMaxMetrics; - nchars = bitmapFont->num_chars; - for (i = 0, ci = bitmapFont->ink_metrics; i < nchars; i++, ci++) { - COMPUTE_MINMAX(ci); - minbounds->attributes &= ci->attributes; - maxbounds->attributes |= ci->attributes; - } - if (bitmapFont->bitmapExtra) { - minbounds = &pFont->info.ink_minbounds; - maxbounds = &pFont->info.ink_maxbounds; - *minbounds = initMinMetrics; - *maxbounds = initMaxMetrics; - i=0; - for (r = pFont->info.firstRow; r <= pFont->info.lastRow; r++) { - for (c = pFont->info.firstCol; c <= pFont->info.lastCol; c++) { - cit = ACCESSENCODING(bitmapFont->encoding, i); - if (cit) { - offset = cit - bitmapFont->metrics; - ci = &bitmapFont->ink_metrics[offset]; - COMPUTE_MINMAX(ci); - minbounds->attributes &= ci->attributes; - maxbounds->attributes |= ci->attributes; - } - i++; - } - } - } - } -} - -Bool -bitmapAddInkMetrics(FontPtr pFont) -{ - BitmapFontPtr bitmapFont; - int i; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - bitmapFont->ink_metrics = (xCharInfo *) xalloc(bitmapFont->num_chars * sizeof(xCharInfo)); - if (!bitmapFont->ink_metrics) { - fprintf(stderr, "Error: Couldn't allocate ink_metrics (%d*%ld)\n", - bitmapFont->num_chars, (unsigned long)sizeof(xCharInfo)); - return FALSE; - } - for (i = 0; i < bitmapFont->num_chars; i++) - FontCharInkMetrics(pFont, &bitmapFont->metrics[i], &bitmapFont->ink_metrics[i]); - pFont->info.inkMetrics = TRUE; - return TRUE; -} - -/* ARGSUSED */ -int -bitmapComputeWeight(FontPtr pFont) -{ - return 10; -} diff --git a/nx-X11/lib/font/bitmap/bitscale.c b/nx-X11/lib/font/bitmap/bitscale.c deleted file mode 100644 index 8f7247eaf..000000000 --- a/nx-X11/lib/font/bitmap/bitscale.c +++ /dev/null @@ -1,1978 +0,0 @@ -/* $Xorg: bitscale.c,v 1.5 2001/02/09 02:04:02 xorgcvs Exp $ */ -/* - -Copyright 1991, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/bitscale.c,v 3.29tsi Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* - * Translate monolithic #defines to modular definitions - */ - -#ifdef PCFFORMAT -#define XFONT_PCFFORMAT 1 -#endif - -#ifdef SNFFORMAT -#define XFONT_SNFFORMAT 1 -#endif - -#ifdef BDFFORMAT -#define XFONT_BDFFORMAT 1 -#endif - -#include -#include -#include -#ifndef FONTMODULE -#ifdef _XOPEN_SOURCE -#include -#else -#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */ -#include -#undef _XOPEN_SOURCE -#endif -#endif - -#ifndef MAX -#define MAX(a,b) (((a)>(b)) ? a : b) -#endif - -/* Should get this from elsewhere */ -extern unsigned long serverGeneration; - -static void bitmapUnloadScalable (FontPtr pFont); -static void ScaleBitmap ( FontPtr pFont, CharInfoPtr opci, - CharInfoPtr pci, double *inv_xform, - double widthMult, double heightMult ); -static FontPtr BitmapScaleBitmaps(FontPtr pf, FontPtr opf, - double widthMult, double heightMult, - FontScalablePtr vals); -static FontPtr PrinterScaleBitmaps(FontPtr pf, FontPtr opf, - double widthMult, double heightMult, - FontScalablePtr vals); - -enum scaleType { - atom, truncate_atom, pixel_size, point_size, resolution_x, - resolution_y, average_width, scaledX, scaledY, unscaled, fontname, - raw_ascent, raw_descent, raw_pixelsize, raw_pointsize, - raw_average_width, uncomputed -}; - -typedef struct _fontProp { - char *name; - Atom atom; - enum scaleType type; -} fontProp; - -typedef FontPtr (*ScaleFunc) ( FontPtr /* pf */, - FontPtr /* opf */, - double /* widthMult */, - double /* heightMult */, - FontScalablePtr /* vals */); - -/* These next two arrays must be kept in step with the renderer array */ -ScaleFunc scale[] = -{ -#if XFONT_PCFFORMAT - BitmapScaleBitmaps, - BitmapScaleBitmaps, -#ifdef X_GZIP_FONT_COMPRESSION - BitmapScaleBitmaps, -#endif -#endif -#if XFONT_SNFFORMAT - BitmapScaleBitmaps, - BitmapScaleBitmaps, -#ifdef X_GZIP_FONT_COMPRESSION - BitmapScaleBitmaps, -#endif -#endif -#if XFONT_BDFFORMAT - BitmapScaleBitmaps, - BitmapScaleBitmaps, -#ifdef X_GZIP_FONT_COMPRESSION - BitmapScaleBitmaps, -#endif -#endif -#if XFONT_PCFFORMAT - PrinterScaleBitmaps, -#endif -}; - -static FontEntryPtr FindBestToScale ( FontPathElementPtr fpe, - FontEntryPtr entry, - FontScalablePtr vals, - FontScalablePtr best, - double *dxp, double *dyp, - double *sdxp, double *sdyp, - FontPathElementPtr *fpep ); -static FontEntryPtr FindPmfToScale ( FontPathElementPtr fpe, - FontEntryPtr entry, - FontScalablePtr vals, - FontScalablePtr best, - double *dxp, double *dyp, - double *sdxp, double *sdyp, - FontPathElementPtr *fpep ); - -typedef FontEntryPtr (*FindToScale) (FontPathElementPtr fpe, - FontEntryPtr entry, - FontScalablePtr vals, - FontScalablePtr best, - double *dxp, double *dyp, - double *sdxp, double *sdyp, - FontPathElementPtr *fpep); -FindToScale find_scale[] = -{ -#if XFONT_PCFFORMAT - FindBestToScale, - FindBestToScale, -#ifdef X_GZIP_FONT_COMPRESSION - FindBestToScale, -#endif -#endif -#if XFONT_SNFFORMAT - FindBestToScale, - FindBestToScale, -#ifdef X_GZIP_FONT_COMPRESSION - FindBestToScale, -#endif -#endif -#if XFONT_BDFFORMAT - FindBestToScale, - FindBestToScale, -#ifdef X_GZIP_FONT_COMPRESSION - FindBestToScale, -#endif -#endif -#if XFONT_PCFFORMAT - FindPmfToScale, -#endif -}; - -static unsigned long bitscaleGeneration = 0; /* initialization flag */ - -static fontProp fontNamePropTable[] = { - { "FOUNDRY", 0, atom }, - { "FAMILY_NAME", 0, atom }, - { "WEIGHT_NAME", 0, atom }, - { "SLANT", 0, atom }, - { "SETWIDTH_NAME", 0, atom }, - { "ADD_STYLE_NAME", 0, atom }, - { "PIXEL_SIZE", 0, pixel_size }, - { "POINT_SIZE", 0, point_size }, - { "RESOLUTION_X", 0, resolution_x }, - { "RESOLUTION_Y", 0, resolution_y }, - { "SPACING", 0, atom }, - { "AVERAGE_WIDTH", 0, average_width }, - { "CHARSET_REGISTRY", 0, atom }, - { "CHARSET_ENCODING", 0, truncate_atom }, - { "FONT", 0, fontname }, - { "RAW_ASCENT", 0, raw_ascent }, - { "RAW_DESCENT", 0, raw_descent }, - { "RAW_PIXEL_SIZE", 0, raw_pixelsize }, - { "RAW_POINT_SIZE", 0, raw_pointsize }, - { "RAW_AVERAGE_WIDTH", 0, raw_average_width } -}; - -#define TRANSFORM_POINT(matrix, x, y, dest) \ - ((dest)[0] = (matrix)[0] * (x) + (matrix)[2] * (y), \ - (dest)[1] = (matrix)[1] * (x) + (matrix)[3] * (y)) - -#define CHECK_EXTENT(lsb, rsb, desc, asc, data) \ - ((lsb) > (data)[0] ? (lsb) = (data)[0] : 0 , \ - (rsb) < (data)[0] ? (rsb) = (data)[0] : 0, \ - (-desc) > (data)[1] ? (desc) = -(data)[1] : 0 , \ - (asc) < (data)[1] ? (asc) = (data)[1] : 0) - -#define NPROPS (sizeof(fontNamePropTable) / sizeof(fontProp)) - -/* Warning: order of the next two tables is critically interdependent. - Location of "unscaled" properties at the end of fontPropTable[] - is important. */ - -static fontProp fontPropTable[] = { - { "MIN_SPACE", 0, scaledX }, - { "NORM_SPACE", 0, scaledX }, - { "MAX_SPACE", 0, scaledX }, - { "END_SPACE", 0, scaledX }, - { "AVG_CAPITAL_WIDTH", 0, scaledX }, - { "AVG_LOWERCASE_WIDTH", 0, scaledX }, - { "QUAD_WIDTH", 0, scaledX }, - { "FIGURE_WIDTH", 0, scaledX }, - { "SUPERSCRIPT_X", 0, scaledX }, - { "SUPERSCRIPT_Y", 0, scaledY }, - { "SUBSCRIPT_X", 0, scaledX }, - { "SUBSCRIPT_Y", 0, scaledY }, - { "SUPERSCRIPT_SIZE", 0, scaledY }, - { "SUBSCRIPT_SIZE", 0, scaledY }, - { "SMALL_CAP_SIZE", 0, scaledY }, - { "UNDERLINE_POSITION", 0, scaledY }, - { "UNDERLINE_THICKNESS", 0, scaledY }, - { "STRIKEOUT_ASCENT", 0, scaledY }, - { "STRIKEOUT_DESCENT", 0, scaledY }, - { "CAP_HEIGHT", 0, scaledY }, - { "X_HEIGHT", 0, scaledY }, - { "ITALIC_ANGLE", 0, unscaled }, - { "RELATIVE_SETWIDTH", 0, unscaled }, - { "RELATIVE_WEIGHT", 0, unscaled }, - { "WEIGHT", 0, unscaled }, - { "DESTINATION", 0, unscaled }, - { "PCL_FONT_NAME", 0, unscaled }, - { "_ADOBE_POSTSCRIPT_FONTNAME", 0, unscaled } -}; - -/* sleazy way to shut up the compiler */ -#define zerohack (enum scaleType)0 - -static fontProp rawFontPropTable[] = { - { "RAW_MIN_SPACE", 0, }, - { "RAW_NORM_SPACE", 0, }, - { "RAW_MAX_SPACE", 0, }, - { "RAW_END_SPACE", 0, }, - { "RAW_AVG_CAPITAL_WIDTH", 0, }, - { "RAW_AVG_LOWERCASE_WIDTH", 0, }, - { "RAW_QUAD_WIDTH", 0, }, - { "RAW_FIGURE_WIDTH", 0, }, - { "RAW_SUPERSCRIPT_X", 0, }, - { "RAW_SUPERSCRIPT_Y", 0, }, - { "RAW_SUBSCRIPT_X", 0, }, - { "RAW_SUBSCRIPT_Y", 0, }, - { "RAW_SUPERSCRIPT_SIZE", 0, }, - { "RAW_SUBSCRIPT_SIZE", 0, }, - { "RAW_SMALL_CAP_SIZE", 0, }, - { "RAW_UNDERLINE_POSITION", 0, }, - { "RAW_UNDERLINE_THICKNESS", 0, }, - { "RAW_STRIKEOUT_ASCENT", 0, }, - { "RAW_STRIKEOUT_DESCENT", 0, }, - { "RAW_CAP_HEIGHT", 0, }, - { "RAW_X_HEIGHT", 0, } -}; - -static void -initFontPropTable(void) -{ - int i; - fontProp *t; - - i = sizeof(fontNamePropTable) / sizeof(fontProp); - for (t = fontNamePropTable; i; i--, t++) - t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE); - - i = sizeof(fontPropTable) / sizeof(fontProp); - for (t = fontPropTable; i; i--, t++) - t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE); - - i = sizeof(rawFontPropTable) / sizeof(fontProp); - for (t = rawFontPropTable; i; i--, t++) - t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), TRUE); -} - -#if 0 -static FontEntryPtr -GetScalableEntry (FontPathElementPtr fpe, FontNamePtr name) -{ - FontDirectoryPtr dir; - - dir = (FontDirectoryPtr) fpe->private; - return FontFileFindNameInDir (&dir->scalable, name); -} -#endif - -static double -get_matrix_horizontal_component(double *matrix) -{ - return hypot(matrix[0], matrix[1]); -} - -static double -get_matrix_vertical_component(double *matrix) -{ - return hypot(matrix[2], matrix[3]); -} - - -static Bool -ComputeScaleFactors(FontScalablePtr from, FontScalablePtr to, - double *dx, double *dy, double *sdx, double *sdy, - double *rescale_x) -{ - double srcpixelset, destpixelset, srcpixel, destpixel; - - srcpixelset = get_matrix_horizontal_component(from->pixel_matrix); - destpixelset = get_matrix_horizontal_component(to->pixel_matrix); - srcpixel = get_matrix_vertical_component(from->pixel_matrix); - destpixel = get_matrix_vertical_component(to->pixel_matrix); - - if (srcpixelset >= EPS) - { - *dx = destpixelset / srcpixelset; - *sdx = 1000.0 / srcpixelset; - } - else - *sdx = *dx = 0; - - *rescale_x = 1.0; - - /* If client specified a width, it overrides setsize; in this - context, we interpret width as applying to the font before any - rotation, even though that's not what is ultimately returned in - the width field. */ - if (from->width > 0 && to->width > 0 && fabs(*dx) > EPS) - { - double rescale = (double)to->width / (double)from->width; - - /* If the client specified a transformation matrix, the rescaling - for width does *not* override the setsize. Instead, just check - for consistency between the setsize from the matrix and the - setsize that would result from rescaling according to the width. - This assumes (perhaps naively) that the width is correctly - reported in the name. As an interesting side effect, this test - may result in choosing a different source bitmap (one that - scales consistently between the setsize *and* the width) than it - would choose if a width were not specified. Sort of a hidden - multiple-master functionality. */ - if ((to->values_supplied & PIXELSIZE_MASK) == PIXELSIZE_ARRAY || - (to->values_supplied & POINTSIZE_MASK) == POINTSIZE_ARRAY) - { - /* Reject if resulting width difference is >= 1 pixel */ - if (fabs(rescale * from->width - *dx * from->width) >= 10) - return FALSE; - } - else - { - *rescale_x = rescale/(*dx); - *dx = rescale; - } - } - - if (srcpixel >= EPS) - { - *dy = destpixel / srcpixel; - *sdy = 1000.0 / srcpixel; - } - else - *sdy = *dy = 0; - - return TRUE; -} - -/* favor enlargement over reduction because of aliasing resulting - from reduction */ -#define SCORE(m,s) \ -if (m >= 1.0) { \ - if (m == 1.0) \ - score += (16 * s); \ - else if (m == 2.0) \ - score += (4 * s); \ - else \ - score += (int)(((double)(3 * s)) / m); \ -} else { \ - score += (int)(((double)(2 * s)) * m); \ -} - -/* don't need to favor enlargement when looking for bitmap that can - be used unscalable */ -#define SCORE2(m,s) \ -if (m >= 1.0) \ - score += (int)(((double)(8 * s)) / m); \ -else \ - score += (int)(((double)(8 * s)) * m); - -static FontEntryPtr -FindBestToScale(FontPathElementPtr fpe, FontEntryPtr entry, - FontScalablePtr vals, FontScalablePtr best, - double *dxp, double *dyp, - double *sdxp, double *sdyp, - FontPathElementPtr *fpep) -{ - FontScalableRec temp; - int source, i; - int best_score, best_unscaled_score, - score; - double dx = 0.0, sdx = 0.0, dx_amount = 0.0, - dy = 0.0, sdy = 0.0, dy_amount = 0.0, - best_dx = 0.0, best_sdx = 0.0, best_dx_amount = 0.0, - best_dy = 0.0, best_sdy = 0.0, best_dy_amount = 0.0, - best_unscaled_sdx = 0.0, best_unscaled_sdy = 0.0, - rescale_x = 0.0, best_rescale_x = 0.0, - best_unscaled_rescale_x = 0.0; - FontEntryPtr zero; - FontNameRec zeroName; - char zeroChars[MAXFONTNAMELEN]; - FontDirectoryPtr dir; - FontScaledPtr scaled; - FontScalableExtraPtr extra; - FontScaledPtr best_scaled, best_unscaled; - FontPathElementPtr best_fpe = NULL, best_unscaled_fpe = NULL; - FontEntryPtr bitmap = NULL; - FontEntryPtr result; - int aliascount = 20; - FontPathElementPtr bitmap_fpe = NULL; - FontNameRec xlfdName; - - /* find the best match */ - rescale_x = 1.0; - best_scaled = 0; - best_score = 0; - best_unscaled = 0; - best_unscaled_score = -1; - best_dx_amount = best_dy_amount = HUGE_VAL; - memcpy (zeroChars, entry->name.name, entry->name.length); - zeroChars[entry->name.length] = '\0'; - zeroName.name = zeroChars; - FontParseXLFDName (zeroChars, &temp, FONT_XLFD_REPLACE_ZERO); - zeroName.length = strlen (zeroChars); - zeroName.ndashes = entry->name.ndashes; - xlfdName.name = vals->xlfdName; - xlfdName.length = strlen(xlfdName.name); - xlfdName.ndashes = FontFileCountDashes(xlfdName.name, xlfdName.length); - restart_bestscale_loop: ; - /* - * Look through all the registered bitmap sources for - * the same zero name as ours; entries along that one - * can be scaled as desired. - */ - for (source = 0; source < FontFileBitmapSources.count; source++) - { - /* There might already be a bitmap that satisfies the request - but didn't have a zero name that was found by the scalable - font matching logic. Keep track if there is. */ - if (bitmap == NULL && vals->xlfdName != NULL) - { - bitmap_fpe = FontFileBitmapSources.fpe[source]; - dir = (FontDirectoryPtr) bitmap_fpe->private; - bitmap = FontFileFindNameInDir (&dir->nonScalable, &xlfdName); - if (bitmap && bitmap->type != FONT_ENTRY_BITMAP) - { - if (bitmap->type == FONT_ENTRY_ALIAS && aliascount > 0) - { - aliascount--; - xlfdName.name = bitmap->u.alias.resolved; - xlfdName.length = strlen(xlfdName.name); - xlfdName.ndashes = FontFileCountDashes(xlfdName.name, - xlfdName.length); - bitmap = NULL; - goto restart_bestscale_loop; - } - else - bitmap = NULL; - } - } - - if (FontFileBitmapSources.fpe[source] == fpe) - zero = entry; - else - { - dir = (FontDirectoryPtr) FontFileBitmapSources.fpe[source]->private; - zero = FontFileFindNameInDir (&dir->scalable, &zeroName); - if (!zero) - continue; - } - extra = zero->u.scalable.extra; - for (i = 0; i < extra->numScaled; i++) - { - scaled = &extra->scaled[i]; - if (!scaled->bitmap) - continue; - if (!ComputeScaleFactors(&scaled->vals, vals, &dx, &dy, &sdx, &sdy, - &rescale_x)) - continue; - score = 0; - dx_amount = dx; - dy_amount = dy; - SCORE(dy_amount, 10); - SCORE(dx_amount, 1); - if ((score > best_score) || - ((score == best_score) && - ((dy_amount < best_dy_amount) || - ((dy_amount == best_dy_amount) && - (dx_amount < best_dx_amount))))) - { - best_fpe = FontFileBitmapSources.fpe[source]; - best_scaled = scaled; - best_score = score; - best_dx = dx; - best_dy = dy; - best_sdx = sdx; - best_sdy = sdy; - best_dx_amount = dx_amount; - best_dy_amount = dy_amount; - best_rescale_x = rescale_x; - } - /* Is this font a candidate for use without ugly rescaling? */ - if (fabs(dx) > EPS && fabs(dy) > EPS && - fabs(vals->pixel_matrix[0] * rescale_x - - scaled->vals.pixel_matrix[0]) < 1 && - fabs(vals->pixel_matrix[1] * rescale_x - - scaled->vals.pixel_matrix[1]) < EPS && - fabs(vals->pixel_matrix[2] - - scaled->vals.pixel_matrix[2]) < EPS && - fabs(vals->pixel_matrix[3] - - scaled->vals.pixel_matrix[3]) < 1) - { - /* Yes. The pixel sizes are close on the diagonal and - extremely close off the diagonal. */ - score = 0; - SCORE2(vals->pixel_matrix[3] / - scaled->vals.pixel_matrix[3], 10); - SCORE2(vals->pixel_matrix[0] * rescale_x / - scaled->vals.pixel_matrix[0], 1); - if (score > best_unscaled_score) - { - best_unscaled_fpe = FontFileBitmapSources.fpe[source]; - best_unscaled = scaled; - best_unscaled_sdx = sdx / dx; - best_unscaled_sdy = sdy / dy; - best_unscaled_score = score; - best_unscaled_rescale_x = rescale_x; - } - } - } - } - if (best_unscaled) - { - *best = best_unscaled->vals; - *fpep = best_unscaled_fpe; - *dxp = 1.0; - *dyp = 1.0; - *sdxp = best_unscaled_sdx; - *sdyp = best_unscaled_sdy; - rescale_x = best_unscaled_rescale_x; - result = best_unscaled->bitmap; - } - else if (best_scaled) - { - *best = best_scaled->vals; - *fpep = best_fpe; - *dxp = best_dx; - *dyp = best_dy; - *sdxp = best_sdx; - *sdyp = best_sdy; - rescale_x = best_rescale_x; - result = best_scaled->bitmap; - } - else - result = NULL; - - if (bitmap != NULL && (result == NULL || *dxp != 1.0 || *dyp != 1.0)) - { - *fpep = bitmap_fpe; - FontParseXLFDName (bitmap->name.name, best, FONT_XLFD_REPLACE_NONE); - if (ComputeScaleFactors(best, best, dxp, dyp, sdxp, sdyp, &rescale_x)) - result = bitmap; - else - result = NULL; - } - - if (result && rescale_x != 1.0) - { - /* We have rescaled horizontally due to an XLFD width field. Change - the matrix appropriately */ - vals->pixel_matrix[0] *= rescale_x; - vals->pixel_matrix[1] *= rescale_x; -#ifdef NOTDEF - /* This would force the pointsize and pixelsize fields in the - FONT property to display as matrices to more accurately - report the font being supplied. It might also break existing - applications that expect a single number in that field. */ - vals->values_supplied = - vals->values_supplied & ~(PIXELSIZE_MASK | POINTSIZE_MASK) | - PIXELSIZE_ARRAY; -#else /* NOTDEF */ - vals->values_supplied = vals->values_supplied & ~POINTSIZE_MASK; -#endif /* NOTDEF */ - /* Recompute and reround the FontScalablePtr values after - rescaling for the new width. */ - FontFileCompleteXLFD(vals, vals); - } - - return result; -} - -static FontEntryPtr -FindPmfToScale(FontPathElementPtr fpe, FontEntryPtr entry, - FontScalablePtr vals, FontScalablePtr best, - double *dxp, double *dyp, - double *sdxp, double *sdyp, - FontPathElementPtr *fpep) -{ - FontEntryPtr result = NULL; - FontScaledPtr scaled; - FontScalableExtraPtr extra; - int i; - - extra = entry->u.scalable.extra; - for (i = 0; i < extra->numScaled; i++) - { - double rescale_x; - - scaled = &extra->scaled[i]; - if (!scaled->bitmap) - continue; - if (!ComputeScaleFactors(&scaled->vals, vals, dxp, dyp, sdxp, sdyp, - &rescale_x)) - continue; - *best = scaled->vals; - *fpep = fpe; - result = scaled->bitmap; - if (rescale_x != 1.0) - { - /* We have rescaled horizontally due to an XLFD width field. Change - the matrix appropriately */ - vals->pixel_matrix[0] *= rescale_x; - vals->pixel_matrix[1] *= rescale_x; -#ifdef NOTDEF - /* This would force the pointsize and pixelsize fields in the - FONT property to display as matrices to more accurately - report the font being supplied. It might also break existing - applications that expect a single number in that field. */ - vals->values_supplied = - vals->values_supplied & ~(PIXELSIZE_MASK | POINTSIZE_MASK) | - PIXELSIZE_ARRAY; -#else /* NOTDEF */ - vals->values_supplied = vals->values_supplied & ~POINTSIZE_MASK; -#endif /* NOTDEF */ - /* Recompute and reround the FontScalablePtr values after - rescaling for the new width. */ - FontFileCompleteXLFD(vals, vals); - } - break; - } - return result; -} - -static long -doround(double x) -{ - return (x >= 0) ? (long)(x + .5) : (long)(x - .5); -} - -static int -computeProps(FontPropPtr pf, char *wasStringProp, - FontPropPtr npf, char *isStringProp, - unsigned int nprops, double xfactor, double yfactor, - double sXfactor, double sYfactor) -{ - int n; - int count; - fontProp *t; - double rawfactor = 0.0; - - for (count = 0; nprops > 0; nprops--, pf++, wasStringProp++) { - n = sizeof(fontPropTable) / sizeof(fontProp); - for (t = fontPropTable; n && (t->atom != pf->name); n--, t++); - if (!n) - continue; - - switch (t->type) { - case scaledX: - npf->value = doround(xfactor * (double)pf->value); - rawfactor = sXfactor; - break; - case scaledY: - npf->value = doround(yfactor * (double)pf->value); - rawfactor = sYfactor; - break; - case unscaled: - npf->value = pf->value; - npf->name = pf->name; - npf++; - count++; - *isStringProp++ = *wasStringProp; - break; - default: - break; - } - if (t->type != unscaled) - { - npf->name = pf->name; - npf++; - count++; - npf->value = doround(rawfactor * (double)pf->value); - npf->name = rawFontPropTable[t - fontPropTable].atom; - npf++; - count++; - *isStringProp++ = *wasStringProp; - *isStringProp++ = *wasStringProp; - } - } - return count; -} - - -static int -ComputeScaledProperties(FontInfoPtr sourceFontInfo, /* the font to be scaled */ - char *name, /* name of resulting font */ - FontScalablePtr vals, - double dx, double dy, /* scale factors in x and y */ - double sdx, double sdy, /* directions */ - long sWidth, /* 1000-pixel average width */ - FontPropPtr *pProps, /* returns properties; - preallocated */ - char **pIsStringProp) /* return booleans; - preallocated */ -{ - int n; - char *ptr1 = NULL, *ptr2 = NULL; - char *ptr3; - FontPropPtr fp; - fontProp *fpt; - char *isStringProp; - int nProps; - - if (bitscaleGeneration != serverGeneration) { - initFontPropTable(); - bitscaleGeneration = serverGeneration; - } - nProps = NPROPS + 1 + sizeof(fontPropTable) / sizeof(fontProp) + - sizeof(rawFontPropTable) / sizeof(fontProp); - fp = (FontPropPtr) xalloc(sizeof(FontPropRec) * nProps); - *pProps = fp; - if (!fp) { - fprintf(stderr, "Error: Couldn't allocate font properties (%ld*%d)\n", - (unsigned long)sizeof(FontPropRec), nProps); - return 1; - } - isStringProp = (char *) xalloc (nProps); - *pIsStringProp = isStringProp; - if (!isStringProp) - { - fprintf(stderr, "Error: Couldn't allocate isStringProp (%d)\n", nProps); - xfree (fp); - return 1; - } - ptr2 = name; - for (fpt = fontNamePropTable, n = NPROPS; - n; - fp++, fpt++, n--, isStringProp++) - { - - if (*ptr2) - { - ptr1 = ptr2 + 1; - if (!(ptr2 = strchr(ptr1, '-'))) ptr2 = strchr(ptr1, '\0'); - } - - *isStringProp = 0; - switch (fpt->type) { - case atom: - fp->value = MakeAtom(ptr1, ptr2 - ptr1, TRUE); - *isStringProp = 1; - break; - case truncate_atom: - for (ptr3 = ptr1; *ptr3; ptr3++) - if (*ptr3 == '[') - break; - if (!*ptr3) ptr3 = ptr2; - fp->value = MakeAtom(ptr1, ptr3 - ptr1, TRUE); - *isStringProp = 1; - break; - case pixel_size: - fp->value = doround(vals->pixel_matrix[3]); - break; - case point_size: - fp->value = doround(vals->point_matrix[3] * 10.0); - break; - case resolution_x: - fp->value = vals->x; - break; - case resolution_y: - fp->value = vals->y; - break; - case average_width: - fp->value = vals->width; - break; - case fontname: - fp->value = MakeAtom(name, strlen(name), TRUE); - *isStringProp = 1; - break; - case raw_ascent: - fp->value = sourceFontInfo->fontAscent * sdy; - break; - case raw_descent: - fp->value = sourceFontInfo->fontDescent * sdy; - break; - case raw_pointsize: - fp->value = (long)(72270.0 / (double)vals->y + .5); - break; - case raw_pixelsize: - fp->value = 1000; - break; - case raw_average_width: - fp->value = sWidth; - break; - default: - break; - } - fp->name = fpt->atom; - } - n = NPROPS; - n += computeProps(sourceFontInfo->props, sourceFontInfo->isStringProp, - fp, isStringProp, sourceFontInfo->nprops, dx, dy, - sdx, sdy); - return n; -} - - -static int -compute_xform_matrix(FontScalablePtr vals, double dx, double dy, - double *xform, double *inv_xform, - double *xmult, double *ymult) -{ - double det; - double pixel = get_matrix_vertical_component(vals->pixel_matrix); - double pixelset = get_matrix_horizontal_component(vals->pixel_matrix); - - if (pixel < EPS || pixelset < EPS) return 0; - - /* Initialize the transformation matrix to the scaling factors */ - xform[0] = dx / pixelset; - xform[1] = xform[2] = 0.0; - xform[3] = dy / pixel; - -/* Inline matrix multiply -- somewhat ugly to minimize register usage */ -#define MULTIPLY_XFORM(a,b,c,d) \ -{ \ - register double aa = (a), bb = (b), cc = (c), dd = (d); \ - register double temp; \ - temp = aa * xform[0] + cc * xform[1]; \ - aa = aa * xform[2] + cc * xform[3]; \ - xform[1] = bb * xform[0] + dd * xform[1]; \ - xform[3] = bb * xform[2] + dd * xform[3]; \ - xform[0] = temp; \ - xform[2] = aa; \ -} - - /* Rescale the transformation matrix for size of source font */ - MULTIPLY_XFORM(vals->pixel_matrix[0], - vals->pixel_matrix[1], - vals->pixel_matrix[2], - vals->pixel_matrix[3]); - - *xmult = xform[0]; - *ymult = xform[3]; - - - if (inv_xform == NULL) return 1; - - /* Compute the determinant for use in inverting the matrix. */ - det = xform[0] * xform[3] - xform[1] * xform[2]; - - /* If the determinant is tiny or zero, give up */ - if (fabs(det) < EPS) return 0; - - /* Compute the inverse */ - inv_xform[0] = xform[3] / det; - inv_xform[1] = -xform[1] / det; - inv_xform[2] = -xform[2] / det; - inv_xform[3] = xform[0] / det; - - return 1; -} - -/* - * ScaleFont - * returns a pointer to the new scaled font, or NULL (due to AllocError). - */ -static FontPtr -ScaleFont(FontPtr opf, /* originating font */ - double widthMult, /* glyphs width scale factor */ - double heightMult, /* glyphs height scale factor */ - double sWidthMult, /* scalable glyphs width scale factor */ - double sHeightMult, /* scalable glyphs height scale factor */ - FontScalablePtr vals, - double *newWidthMult, /* return: X component of glyphs width - scale factor */ - double *newHeightMult, /* return: Y component of glyphs height - scale factor */ - long *sWidth) /* return: average 1000-pixel width */ -{ - FontPtr pf; - FontInfoPtr pfi, - opfi; - BitmapFontPtr bitmapFont, - obitmapFont; - CharInfoPtr pci, - opci; - int nchars = 0; /* how many characters in the font */ - int i; - int firstCol, lastCol, firstRow, lastRow; - double xform[4], inv_xform[4]; - double xmult, ymult; - int totalwidth = 0, totalchars = 0; -#define OLDINDEX(i) (((i)/(lastCol - firstCol + 1) + \ - firstRow - opf->info.firstRow) * \ - (opf->info.lastCol - opf->info.firstCol + 1) + \ - (i)%(lastCol - firstCol + 1) + \ - firstCol - opf->info.firstCol) - - *sWidth = 0; - - opfi = &opf->info; - obitmapFont = (BitmapFontPtr) opf->fontPrivate; - - bitmapFont = 0; - if (!(pf = CreateFontRec())) { - fprintf(stderr, "Error: Couldn't allocate FontRec (%ld)\n", - (unsigned long)sizeof(FontRec)); - goto bail; - } - pf->refcnt = 0; - pf->bit = opf->bit; - pf->byte = opf->byte; - pf->glyph = opf->glyph; - pf->scan = opf->scan; - - pf->get_glyphs = bitmapGetGlyphs; - pf->get_metrics = bitmapGetMetrics; - pf->unload_font = bitmapUnloadScalable; - pf->unload_glyphs = NULL; - - pfi = &pf->info; - *pfi = *opfi; - /* If charset subsetting specified in vals, determine what our range - needs to be for the output font */ - if (vals->nranges) - { - int i; - - pfi->allExist = 0; - firstCol = 255; - lastCol = 0; - firstRow = 255; - lastRow = 0; - - for (i = 0; i < vals->nranges; i++) - { - if (vals->ranges[i].min_char_high != vals->ranges[i].max_char_high) - { - firstCol = opfi->firstCol; - lastCol = opfi->lastCol; - } - if (firstCol > vals->ranges[i].min_char_low) - firstCol = vals->ranges[i].min_char_low; - if (lastCol < vals->ranges[i].max_char_low) - lastCol = vals->ranges[i].max_char_low; - if (firstRow > vals->ranges[i].min_char_high) - firstRow = vals->ranges[i].min_char_high; - if (lastRow < vals->ranges[i].max_char_high) - lastRow = vals->ranges[i].max_char_high; - } - - if (firstCol > lastCol || firstRow > lastRow) - goto bail; - - if (firstCol < opfi->firstCol) - firstCol = opfi->firstCol; - if (lastCol > opfi->lastCol) - lastCol = opfi->lastCol; - if (firstRow < opfi->firstRow) - firstRow = opfi->firstRow; - if (lastRow > opfi->lastRow) - lastRow = opfi->lastRow; - } - else - { - firstCol = opfi->firstCol; - lastCol = opfi->lastCol; - firstRow = opfi->firstRow; - lastRow = opfi->lastRow; - } - - bitmapFont = (BitmapFontPtr) xalloc(sizeof(BitmapFontRec)); - if (!bitmapFont) { - fprintf(stderr, "Error: Couldn't allocate bitmapFont (%ld)\n", - (unsigned long)sizeof(BitmapFontRec)); - goto bail; - } - nchars = (lastRow - firstRow + 1) * (lastCol - firstCol + 1); - pfi->firstRow = firstRow; - pfi->lastRow = lastRow; - pfi->firstCol = firstCol; - pfi->lastCol = lastCol; - pf->fontPrivate = (pointer) bitmapFont; - bitmapFont->version_num = obitmapFont->version_num; - bitmapFont->num_chars = nchars; - bitmapFont->num_tables = obitmapFont->num_tables; - bitmapFont->metrics = 0; - bitmapFont->ink_metrics = 0; - bitmapFont->bitmaps = 0; - bitmapFont->encoding = 0; - bitmapFont->bitmapExtra = 0; - bitmapFont->pDefault = 0; - bitmapFont->metrics = (CharInfoPtr) xalloc(nchars * sizeof(CharInfoRec)); - if (!bitmapFont->metrics) { - fprintf(stderr, "Error: Couldn't allocate metrics (%d*%ld)\n", - nchars, (unsigned long)sizeof(CharInfoRec)); - goto bail; - } - bitmapFont->encoding = - (CharInfoPtr **) xcalloc(NUM_SEGMENTS(nchars), - sizeof(CharInfoPtr*)); - if (!bitmapFont->encoding) { - fprintf(stderr, "Error: Couldn't allocate encoding (%d*%ld)\n", - nchars, (unsigned long)sizeof(CharInfoPtr)); - goto bail; - } - -#undef MAXSHORT -#define MAXSHORT 32767 -#undef MINSHORT -#define MINSHORT -32768 - - pfi->anamorphic = FALSE; - if (heightMult != widthMult) - pfi->anamorphic = TRUE; - pfi->cachable = TRUE; - - if (!compute_xform_matrix(vals, widthMult, heightMult, xform, - inv_xform, &xmult, &ymult)) - goto bail; - - pfi->fontAscent = opfi->fontAscent * ymult; - pfi->fontDescent = opfi->fontDescent * ymult; - - pfi->minbounds.leftSideBearing = MAXSHORT; - pfi->minbounds.rightSideBearing = MAXSHORT; - pfi->minbounds.ascent = MAXSHORT; - pfi->minbounds.descent = MAXSHORT; - pfi->minbounds.characterWidth = MAXSHORT; - pfi->minbounds.attributes = MAXSHORT; - - pfi->maxbounds.leftSideBearing = MINSHORT; - pfi->maxbounds.rightSideBearing = MINSHORT; - pfi->maxbounds.ascent = MINSHORT; - pfi->maxbounds.descent = MINSHORT; - pfi->maxbounds.characterWidth = MINSHORT; - pfi->maxbounds.attributes = MINSHORT; - - /* Compute the transformation and inverse transformation matrices. - Can fail if the determinant is zero. */ - - pci = bitmapFont->metrics; - for (i = 0; i < nchars; i++) - { - if ((opci = ACCESSENCODING(obitmapFont->encoding,OLDINDEX(i)))) - { - double newlsb, newrsb, newdesc, newasc, point[2]; - -#define minchar(p) ((p).min_char_low + ((p).min_char_high << 8)) -#define maxchar(p) ((p).max_char_low + ((p).max_char_high << 8)) - - if (vals->nranges) - { - int row = i / (lastCol - firstCol + 1) + firstRow; - int col = i % (lastCol - firstCol + 1) + firstCol; - int ch = (row << 8) + col; - int j; - for (j = 0; j < vals->nranges; j++) - if (ch >= minchar(vals->ranges[j]) && - ch <= maxchar(vals->ranges[j])) - break; - if (j == vals->nranges) - { - continue; - } - } - - if (opci->metrics.leftSideBearing == 0 && - opci->metrics.rightSideBearing == 0 && - opci->metrics.ascent == 0 && - opci->metrics.descent == 0 && - opci->metrics.characterWidth == 0) - { - continue; - } - - if(!bitmapFont->encoding[SEGMENT_MAJOR(i)]) { - bitmapFont->encoding[SEGMENT_MAJOR(i)]= - (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE, - sizeof(CharInfoPtr)); - if(!bitmapFont->encoding[SEGMENT_MAJOR(i)]) - goto bail; - } - ACCESSENCODINGL(bitmapFont->encoding, i) = pci; - - /* Compute new extents for this glyph */ - TRANSFORM_POINT(xform, - opci->metrics.leftSideBearing, - -opci->metrics.descent, - point); - newlsb = point[0]; - newrsb = newlsb; - newdesc = -point[1]; - newasc = -newdesc; - TRANSFORM_POINT(xform, - opci->metrics.leftSideBearing, - opci->metrics.ascent, - point); - CHECK_EXTENT(newlsb, newrsb, newdesc, newasc, point); - TRANSFORM_POINT(xform, - opci->metrics.rightSideBearing, - -opci->metrics.descent, - point); - CHECK_EXTENT(newlsb, newrsb, newdesc, newasc, point); - TRANSFORM_POINT(xform, - opci->metrics.rightSideBearing, - opci->metrics.ascent, - point); - CHECK_EXTENT(newlsb, newrsb, newdesc, newasc, point); - - pci->metrics.leftSideBearing = (int)floor(newlsb); - pci->metrics.rightSideBearing = (int)floor(newrsb + .5); - pci->metrics.descent = (int)ceil(newdesc); - pci->metrics.ascent = (int)floor(newasc + .5); - /* Accumulate total width of characters before transformation, - to ascertain predominant direction of font. */ - totalwidth += opci->metrics.characterWidth; - pci->metrics.characterWidth = - doround((double)opci->metrics.characterWidth * xmult); - pci->metrics.attributes = - doround((double)opci->metrics.characterWidth * sWidthMult); - if (!pci->metrics.characterWidth) - { - /* Since transformation may shrink width, height, and - escapement to zero, make sure existing characters - are not mistaken for undefined characters. */ - - if (pci->metrics.rightSideBearing == - pci->metrics.leftSideBearing) - pci->metrics.rightSideBearing++; - if (pci->metrics.ascent == -pci->metrics.descent) - pci->metrics.ascent++; - } - - pci++; - } - } - - - /* - * For each character, set the per-character metrics, scale the glyph, and - * check per-font minbounds and maxbounds character information. - */ - - pci = bitmapFont->metrics; - for (i = 0; i < nchars; i++) - { - if ((pci = ACCESSENCODING(bitmapFont->encoding,i)) && - (opci = ACCESSENCODING(obitmapFont->encoding,OLDINDEX(i)))) - { - totalchars++; - *sWidth += abs((int)(INT16)pci->metrics.attributes); -#define MINMAX(field) \ - if (pfi->minbounds.field > pci->metrics.field) \ - pfi->minbounds.field = pci->metrics.field; \ - if (pfi->maxbounds.field < pci->metrics.field) \ - pfi->maxbounds.field = pci->metrics.field - - MINMAX(leftSideBearing); - MINMAX(rightSideBearing); - MINMAX(ascent); - MINMAX(descent); - MINMAX(characterWidth); - - /* Hack: Cast attributes into a signed quantity. Tread lightly - for now and don't go changing the global Xproto.h file */ - if ((INT16)pfi->minbounds.attributes > - (INT16)pci->metrics.attributes) - pfi->minbounds.attributes = pci->metrics.attributes; - if ((INT16)pfi->maxbounds.attributes < - (INT16)pci->metrics.attributes) - pfi->maxbounds.attributes = pci->metrics.attributes; -#undef MINMAX - } - } - pfi->ink_minbounds = pfi->minbounds; - pfi->ink_maxbounds = pfi->maxbounds; - if (totalchars) - { - *sWidth = (*sWidth * 10 + totalchars / 2) / totalchars; - if (totalwidth < 0) - { - /* Dominant direction is R->L */ - *sWidth = -*sWidth; - } - - if (pfi->minbounds.characterWidth == pfi->maxbounds.characterWidth) - vals->width = pfi->minbounds.characterWidth * 10; - else - vals->width = doround((double)*sWidth * vals->pixel_matrix[0] / - 1000.0); - } - else - { - vals->width = 0; - *sWidth = 0; - } - FontComputeInfoAccelerators (pfi); - - if (pfi->defaultCh != (unsigned short) NO_SUCH_CHAR) { - unsigned int r, - c, - cols; - - r = pfi->defaultCh >> 8; - c = pfi->defaultCh & 0xFF; - if (pfi->firstRow <= r && r <= pfi->lastRow && - pfi->firstCol <= c && c <= pfi->lastCol) { - cols = pfi->lastCol - pfi->firstCol + 1; - r = r - pfi->firstRow; - c = c - pfi->firstCol; - bitmapFont->pDefault = - ACCESSENCODING(bitmapFont->encoding, r * cols + c); - } - } - - *newWidthMult = xmult; - *newHeightMult = ymult; - return pf; -bail: - if (pf) - xfree(pf); - if (bitmapFont) { - xfree(bitmapFont->metrics); - xfree(bitmapFont->ink_metrics); - xfree(bitmapFont->bitmaps); - if(bitmapFont->encoding) - for(i=0; iencoding[i]); - xfree(bitmapFont->encoding); - } - return NULL; -} - -static void -ScaleBitmap(FontPtr pFont, CharInfoPtr opci, CharInfoPtr pci, - double *inv_xform, double widthMult, double heightMult) -{ - register char *bitmap, /* The bits */ - *newBitmap; - register int bpr, /* Padding information */ - newBpr; - int width, /* Extents information */ - height, - newWidth, - newHeight; - register int row, /* Loop variables */ - col; - INT32 deltaX, /* Increments for resampling loop */ - deltaY; - INT32 xValue, /* Subscripts for resampling loop */ - yValue; - double point[2]; - unsigned char *char_grayscale = 0; - INT32 *diffusion_workspace = NULL, *thisrow = NULL, - *nextrow = NULL, pixmult = 0; - int box_x = 0, box_y = 0; - - static unsigned char masklsb[] = - { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 }; - static unsigned char maskmsb[] = - { 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1 }; - unsigned char *mask = (pFont->bit == LSBFirst ? masklsb : maskmsb); - - - bitmap = opci->bits; - newBitmap = pci->bits; - width = GLYPHWIDTHPIXELS(opci); - height = GLYPHHEIGHTPIXELS(opci); - newWidth = GLYPHWIDTHPIXELS(pci); - newHeight = GLYPHHEIGHTPIXELS(pci); - if (!newWidth || !newHeight || !width || !height) - return; - - bpr = BYTES_PER_ROW(width, pFont->glyph); - newBpr = BYTES_PER_ROW(newWidth, pFont->glyph); - - if (widthMult > 0.0 && heightMult > 0.0 && - (widthMult < 1.0 || heightMult < 1.0)) - { - /* We are reducing in one or both dimensions. In an attempt to - reduce aliasing, we'll antialias by passing the original - glyph through a low-pass box filter (which results in a - grayscale image), then use error diffusion to create bitonal - output in the resampling loop. */ - - /* First compute the sizes of the box filter */ - widthMult = ceil(1.0 / widthMult); - heightMult = ceil(1.0 / heightMult); - box_x = width / 2; - box_y = height / 2; - if (widthMult < (double)box_x) box_x = (int)widthMult; - if (heightMult < (double)box_y) box_y = (int)heightMult; - /* The pixmult value (below) is used to darken the image before - we perform error diffusion: a necessary concession to the - fact that it's very difficult to generate readable halftoned - glyphs. The degree of darkening is proportional to the size - of the blurring filter, hence inversely proportional to the - darkness of the lightest gray that results from antialiasing. - The result is that characters that exercise this logic (those - generated by reducing from a larger source font) tend to err - on the side of being too bold instead of being too light to - be readable. */ - pixmult = box_x * box_y * 192; - - if (box_x > 1 || box_y > 1) - { - /* Looks like we need to anti-alias. Create a workspace to - contain the grayscale character plus an additional row and - column for scratch */ - char_grayscale = - (unsigned char *)xalloc((width + 1) * (height + 1)); - if (char_grayscale) - { - diffusion_workspace = - (INT32 *)xalloc((newWidth + 2) * 2 * sizeof(int)); - if (!diffusion_workspace) - { - fprintf(stderr, "Warning: Couldn't allocate diffusion" - " workspace (%ld)\n", - (newWidth + 2) * 2 * (unsigned long)sizeof(int)); - xfree(char_grayscale); - char_grayscale = (unsigned char *)0; - } - /* Initialize our error diffusion workspace for later use */ - bzero((char *)diffusion_workspace + sizeof(INT32), - (newWidth + 3) * sizeof(int)); - thisrow = diffusion_workspace + 1; - nextrow = diffusion_workspace + newWidth + 3; - } else { - fprintf(stderr, "Warning: Couldn't allocate character grayscale (%d)\n", (width + 1) * (height + 1)); - } - } - } - - if (char_grayscale) - { - /* We will be doing antialiasing. First copy the bitmap into - our buffer, mapping input range [0,1] to output range - [0,255]. */ - register unsigned char *srcptr, *dstptr; - srcptr = (unsigned char *)bitmap; - dstptr = char_grayscale; - for (row = 0; row < height; row++) - { - for (col = 0; col < width; col++) - *dstptr++ = (srcptr[col >> 3] & mask[col & 0x7]) ? 255 : 0; - srcptr += bpr; /* On to next row of source */ - dstptr++; /* Skip scratch column in dest */ - } - if (box_x > 1) - { - /* Our box filter has a width > 1... let's filter the rows */ - - int right_width = box_x / 2; - int left_width = box_x - right_width - 1; - - for (row = 0; row < height; row++) - { - int sum = 0; - int left_size = 0, right_size = 0; - - srcptr = char_grayscale + (width + 1) * row; - dstptr = char_grayscale + (width + 1) * height; /* scratch */ - - /* We've computed the shape of our full box filter. Now - compute the right-hand part of the moving sum */ - for (right_size = 0; right_size < right_width; right_size++) - sum += srcptr[right_size]; - - /* Now start moving the sum, growing the box filter, and - dropping averages into our scratch buffer */ - for (left_size = 0; left_size < left_width; left_size++) - { - sum += srcptr[right_width]; - *dstptr++ = sum / (left_size + right_width + 1); - srcptr++; - } - - /* The box filter has reached full width... continue - computation of moving average until the right side - hits the wall. */ - for (col = left_size; col + right_size < width; col++) - { - sum += srcptr[right_width]; - *dstptr++ = sum / box_x; - sum -= srcptr[-left_width]; - srcptr++; - } - - /* Collapse the right side of the box filter */ - for (; right_size > 0; right_size--) - { - *dstptr++ = sum / (left_width + right_size); - sum -= srcptr[-left_width]; - srcptr++; - } - - /* Done with the row... copy dest back over source */ - memmove(char_grayscale + (width + 1) * row, - char_grayscale + (width + 1) * height, - width); - } - } - if (box_y > 1) - { - /* Our box filter has a height > 1... let's filter the columns */ - - int bottom_height = box_y / 2; - int top_height = box_y - bottom_height - 1; - - for (col = 0; col < width; col++) - { - int sum = 0; - int top_size = 0, bottom_size = 0; - - srcptr = char_grayscale + col; - dstptr = char_grayscale + width; /* scratch */ - - /* We've computed the shape of our full box filter. Now - compute the bottom part of the moving sum */ - for (bottom_size = 0; - bottom_size < bottom_height; - bottom_size++) - sum += srcptr[bottom_size * (width + 1)]; - - /* Now start moving the sum, growing the box filter, and - dropping averages into our scratch buffer */ - for (top_size = 0; top_size < top_height; top_size++) - { - sum += srcptr[bottom_height * (width + 1)]; - *dstptr = sum / (top_size + bottom_height + 1); - dstptr += width + 1; - srcptr += width + 1; - } - - /* The box filter has reached full height... continue - computation of moving average until the bottom - hits the wall. */ - for (row = top_size; row + bottom_size < height; row++) - { - sum += srcptr[bottom_height * (width + 1)]; - *dstptr = sum / box_y; - dstptr += width + 1; - sum -= srcptr[-top_height * (width + 1)]; - srcptr += width + 1; - } - - /* Collapse the bottom of the box filter */ - for (; bottom_size > 0; bottom_size--) - { - *dstptr = sum / (top_height + bottom_size); - dstptr += width + 1; - sum -= srcptr[-top_height * (width + 1)]; - srcptr += width + 1; - } - - /* Done with the column... copy dest back over source */ - - dstptr = char_grayscale + col; - srcptr = char_grayscale + width; /* scratch */ - for (row = 0; row < height; row++) - { - *dstptr = *srcptr; - dstptr += width + 1; - srcptr += width + 1; - } - } - } - - /* Increase the grayvalue to increase ink a bit */ - srcptr = char_grayscale; - for (row = 0; row < height; row++) - { - for (col = 0; col < width; col++) - { - register int pixvalue = (int)*srcptr * pixmult / 256; - if (pixvalue > 255) pixvalue = 255; - *srcptr = pixvalue; - srcptr++; - } - srcptr++; - } - } - - /* Compute the increment values for the resampling loop */ - TRANSFORM_POINT(inv_xform, 1, 0, point); - deltaX = (INT32)(point[0] * 65536.0); - deltaY = (INT32)(-point[1] * 65536.0); - - /* Resampling loop: resamples original glyph for generation of new - glyph in transformed coordinate system. */ - - for (row = 0; row < newHeight; row++) - { - /* Compute inverse transformation for start of this row */ - TRANSFORM_POINT(inv_xform, - (double)(pci->metrics.leftSideBearing) + .5, - (double)(pci->metrics.ascent - row) - .5, - point); - - /* Adjust for coordinate system to get resampling point */ - point[0] -= opci->metrics.leftSideBearing; - point[1] = opci->metrics.ascent - point[1]; - - /* Convert to integer coordinates */ - xValue = (INT32)(point[0] * 65536.0); - yValue = (INT32)(point[1] * 65536.0); - - if (char_grayscale) - { - INT32 *temp; - for (col = 0; col < newWidth; col++) - { - register int x = xValue >> 16, y = yValue >> 16; - int pixvalue, error; - - pixvalue = ((x >= 0 && x < width && y >= 0 && y < height) ? - char_grayscale[x + y * (width + 1)] : 0) + - thisrow[col] / 16; - if (pixvalue > 255) pixvalue = 255; - else if (pixvalue < 0) pixvalue = 0; - - /* Choose the bit value and set resulting error value */ - if (pixvalue >= 128) - { - newBitmap[(col >> 3) + row * newBpr] |= mask[col & 0x7]; - error = pixvalue - 255; - } - else - error = -pixvalue; - - /* Diffuse the error */ - thisrow[col + 1] += error * 7; - nextrow[col - 1] += error * 3; - nextrow[col] += error * 5; - nextrow[col + 1] = error; - - xValue += deltaX; - yValue += deltaY; - } - - /* Add in error values that fell off either end */ - nextrow[0] += nextrow[-1]; - nextrow[newWidth - 2] += thisrow[newWidth]; - nextrow[newWidth - 1] += nextrow[newWidth]; - nextrow[newWidth] = 0; - - temp = nextrow; - nextrow = thisrow; - thisrow = temp; - nextrow[-1] = nextrow[0] = 0; - } - else - { - for (col = 0; col < newWidth; col++) - { - register int x = xValue >> 16, y = yValue >> 16; - - if (x >= 0 && x < width && y >= 0 && y < height) - { - /* Use point-sampling for rescaling. */ - - if (bitmap[(x >> 3) + y * bpr] & mask[x & 0x7]) - newBitmap[(col >> 3) + row * newBpr] |= mask[col & 0x7]; - } - - xValue += deltaX; - yValue += deltaY; - } - } - } - - - if (char_grayscale) - { - xfree(char_grayscale); - xfree(diffusion_workspace); - } -} - -static FontPtr -BitmapScaleBitmaps(FontPtr pf, /* scaled font */ - FontPtr opf, /* originating font */ - double widthMult, /* glyphs width scale factor */ - double heightMult, /* glyphs height scale factor */ - FontScalablePtr vals) -{ - register int i; - int nchars = 0; - char *glyphBytes; - BitmapFontPtr bitmapFont, - obitmapFont; - CharInfoPtr pci, - opci; - FontInfoPtr pfi; - int glyph; - unsigned bytestoalloc = 0; - int firstCol, lastCol, firstRow, lastRow; - - double xform[4], inv_xform[4]; - double xmult, ymult; - - bitmapFont = (BitmapFontPtr) pf->fontPrivate; - obitmapFont = (BitmapFontPtr) opf->fontPrivate; - - if (!compute_xform_matrix(vals, widthMult, heightMult, xform, - inv_xform, &xmult, &ymult)) - goto bail; - - pfi = &pf->info; - firstCol = pfi->firstCol; - lastCol = pfi->lastCol; - firstRow = pfi->firstRow; - lastRow = pfi->lastRow; - - nchars = (lastRow - firstRow + 1) * (lastCol - firstCol + 1); - glyph = pf->glyph; - for (i = 0; i < nchars; i++) - { - if ((pci = ACCESSENCODING(bitmapFont->encoding, i))) - bytestoalloc += BYTES_FOR_GLYPH(pci, glyph); - } - - /* Do we add the font malloc stuff for VALUE ADDED ? */ - /* Will need to remember to free in the Unload routine */ - - - bitmapFont->bitmaps = (char *) xalloc(bytestoalloc); - if (!bitmapFont->bitmaps) { - fprintf(stderr, "Error: Couldn't allocate bitmaps (%d)\n", bytestoalloc); - goto bail; - } - bzero(bitmapFont->bitmaps, bytestoalloc); - - glyphBytes = bitmapFont->bitmaps; - for (i = 0; i < nchars; i++) - { - if ((pci = ACCESSENCODING(bitmapFont->encoding, i)) && - (opci = ACCESSENCODING(obitmapFont->encoding, OLDINDEX(i)))) - { - pci->bits = glyphBytes; - ScaleBitmap (pf, opci, pci, inv_xform, - widthMult, heightMult); - glyphBytes += BYTES_FOR_GLYPH(pci, glyph); - } - } - return pf; - -bail: - if (pf) - xfree(pf); - if (bitmapFont) { - xfree(bitmapFont->metrics); - xfree(bitmapFont->ink_metrics); - xfree(bitmapFont->bitmaps); - if(bitmapFont->encoding) - for(i=0; iencoding[i]); - xfree(bitmapFont->encoding); - } - return NULL; -} - -static FontPtr -PrinterScaleBitmaps(FontPtr pf, /* scaled font */ - FontPtr opf, /* originating font */ - double widthMult, /* glyphs width scale factor */ - double heightMult, /* glyphs height scale factor */ - FontScalablePtr vals) -{ - register int i; - int nchars = 0; - char *glyphBytes; - BitmapFontPtr bitmapFont, - obitmapFont; - CharInfoPtr pci; - FontInfoPtr pfi; - int glyph; - unsigned bytestoalloc = 0; - int firstCol, lastCol, firstRow, lastRow; - - double xform[4], inv_xform[4]; - double xmult, ymult; - - bitmapFont = (BitmapFontPtr) pf->fontPrivate; - obitmapFont = (BitmapFontPtr) opf->fontPrivate; - - if (!compute_xform_matrix(vals, widthMult, heightMult, xform, - inv_xform, &xmult, &ymult)) - goto bail; - - pfi = &pf->info; - firstCol = pfi->firstCol; - lastCol = pfi->lastCol; - firstRow = pfi->firstRow; - lastRow = pfi->lastRow; - - nchars = (lastRow - firstRow + 1) * (lastCol - firstCol + 1); - glyph = pf->glyph; - for (i = 0; i < nchars; i++) - { - if ((pci = ACCESSENCODING(bitmapFont->encoding, i))) - bytestoalloc = MAX(bytestoalloc,BYTES_FOR_GLYPH(pci, glyph)); - } - - /* Do we add the font malloc stuff for VALUE ADDED ? */ - /* Will need to remember to free in the Unload routine */ - - - bitmapFont->bitmaps = (char *) xalloc(bytestoalloc); - if (!bitmapFont->bitmaps) { - fprintf(stderr, "Error: Couldn't allocate bitmaps (%d)\n", bytestoalloc); - goto bail; - } - bzero(bitmapFont->bitmaps, bytestoalloc); - - glyphBytes = bitmapFont->bitmaps; - for (i = 0; i < nchars; i++) - { - if ((pci = ACCESSENCODING(bitmapFont->encoding, i)) && - (ACCESSENCODING(obitmapFont->encoding, OLDINDEX(i)))) - { - pci->bits = glyphBytes; - } - } - return pf; - -bail: - if (pf) - xfree(pf); - if (bitmapFont) { - xfree(bitmapFont->metrics); - xfree(bitmapFont->ink_metrics); - xfree(bitmapFont->bitmaps); - if(bitmapFont->encoding) - for(i=0; iencoding[i]); - xfree(bitmapFont->encoding); - } - return NULL; -} - -#ifdef NOTDEF -/* - * exported interfaces - */ - -FontFileLoadName(FontFileDirPtr *dirs, int ndirs, char *name, FontPtr *pfont, - fsBitmapFormat format, fsBitmapFormatMask fmask) -{ - FontFileNamePtr fname; - char full_name[1024]; - int ret = BadFontName; - int i; - - i = 0; - while (i < ndirs) { - if (fname = FontFileFindNameInDir(dirs[i], name)) { - if (!fname->alias) { - if (!fname->font) { - strcpy(full_name, dirs[i]->dir); - strcat(full_name, fname->file); - ret = FontFileLoad(pfont, full_name, format, fmask); - if (ret == Successful) { - fname->font = *pfont; - (*pfont)->fpePrivate = (pointer) fname; - } - return ret; - } - *pfont = fname->font; - return Successful; - } - name = fname->file; - i = 0; - } else - i++; - } - return BadFontName; -} -#endif - -/* ARGSUSED */ -int -BitmapOpenScalable (FontPathElementPtr fpe, - FontPtr *pFont, - int flags, - FontEntryPtr entry, - char *fileName, /* unused */ - FontScalablePtr vals, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - FontPtr non_cachable_font) /* We don't do licensing */ -{ - FontScalableRec best; - FontPtr font = NullFont; - double dx, sdx, - dy, sdy, - savedX, savedY; - FontPropPtr props; - char *isStringProp; - int propCount; - int status; - long sWidth; - - FontEntryPtr scaleFrom; - FontPathElementPtr scaleFPE; - FontPtr sourceFont; - char fontName[MAXFONTNAMELEN]; - - /* Can't deal with mix-endian fonts yet */ - -#ifdef NOTDEF /* XXX need better test */ - if ((format & BitmapFormatByteOrderMask) != - (format & BitmapFormatBitOrderMask)) - return NullFontFileName; -#endif - - /* Reject outrageously small font sizes to keep the math from - blowing up. */ - if (get_matrix_vertical_component(vals->pixel_matrix) < 1.0 || - get_matrix_horizontal_component(vals->pixel_matrix) < 1.0) - return BadFontName; - - scaleFrom = (*find_scale[BitmapGetRenderIndex(entry->u.bitmap.renderer)]) - (fpe, entry, vals, &best, &dx, &dy, &sdx, &sdy, &scaleFPE); - - if (!scaleFrom) - return BadFontName; - - status = FontFileOpenBitmap(scaleFPE, &sourceFont, LoadAll, scaleFrom, - format, fmask); - - if (status != Successful) - return BadFontName; - - if (!vals->width) - vals->width = best.width * dx; - - /* Compute the scaled font */ - - savedX = dx; - savedY = dy; - font = ScaleFont(sourceFont, dx, dy, sdx, sdy, vals, &dx, &dy, &sWidth); - if (font) - font = (*scale[ BitmapGetRenderIndex(entry->u.bitmap.renderer) ]) - (font, sourceFont, savedX, savedY, vals); - - if (!font) - { - if (!sourceFont->refcnt) - FontFileCloseFont((FontPathElementPtr) 0, sourceFont); - return AllocError; - } - - /* Prepare font properties for the new font */ - - strcpy (fontName, scaleFrom->name.name); - FontParseXLFDName (fontName, vals, FONT_XLFD_REPLACE_VALUE); - - propCount = ComputeScaledProperties(&sourceFont->info, fontName, vals, - dx, dy, sdx, sdy, sWidth, &props, - &isStringProp); - - if (!sourceFont->refcnt) - FontFileCloseFont((FontPathElementPtr) 0, sourceFont); - - if (propCount && (!props || !isStringProp)) - { - font->info.nprops = 0; - font->info.props = (FontPropPtr)0; - font->info.isStringProp = (char *)0; - bitmapUnloadScalable(font); - return AllocError; - } - - font->info.props = props; - font->info.nprops = propCount; - font->info.isStringProp = isStringProp; - - *pFont = font; - return Successful; -} - -int -BitmapGetInfoScalable (FontPathElementPtr fpe, - FontInfoPtr pFontInfo, - FontEntryPtr entry, - FontNamePtr fontName, - char *fileName, - FontScalablePtr vals) -{ - FontPtr pfont; - int flags = 0; - long format = 0; /* It doesn't matter what format for just info */ - long fmask = 0; - int ret; - - ret = BitmapOpenScalable(fpe, &pfont, flags, entry, fileName, vals, - format, fmask, NULL); - if (ret != Successful) - return ret; - *pFontInfo = pfont->info; - - pfont->info.nprops = 0; - pfont->info.props = NULL; - pfont->info.isStringProp = NULL; - - (*pfont->unload_font)(pfont); - return Successful; -} - -static void -bitmapUnloadScalable (FontPtr pFont) -{ - BitmapFontPtr bitmapFont; - FontInfoPtr pfi; - int i, nencoding; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - pfi = &pFont->info; - xfree (pfi->props); - xfree (pfi->isStringProp); - if(bitmapFont->encoding) { - nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) * - (pFont->info.lastRow - pFont->info.firstRow + 1); - for(i=0; iencoding[i]); - } - xfree (bitmapFont->encoding); - xfree (bitmapFont->bitmaps); - xfree (bitmapFont->ink_metrics); - xfree (bitmapFont->metrics); - xfree (pFont->fontPrivate); - DestroyFontRec (pFont); -} diff --git a/nx-X11/lib/font/bitmap/fontink.c b/nx-X11/lib/font/bitmap/fontink.c deleted file mode 100644 index a9606f039..000000000 --- a/nx-X11/lib/font/bitmap/fontink.c +++ /dev/null @@ -1,219 +0,0 @@ -/* $Xorg: fontink.c,v 1.4 2001/02/09 02:04:02 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/fontink.c,v 1.6 2001/01/17 19:43:27 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -static unsigned char ink_mask_msb[8] = { - 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, -}; - -static unsigned char ink_mask_lsb[8] = { - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, -}; - -void -FontCharInkMetrics(FontPtr pFont, CharInfoPtr pCI, xCharInfo *pInk) -{ - int leftBearing, - ascent, - descent; - register int vpos, - hpos, - bpos = 0; - int bitmapByteWidth, - bitmapByteWidthPadded; - int bitmapBitWidth; - int span; - register unsigned char *p; - unsigned char *ink_mask = 0; - register int bmax; - register unsigned char charbits; - - if (pFont->bit == MSBFirst) - ink_mask = ink_mask_msb; - else if (pFont->bit == LSBFirst) - ink_mask = ink_mask_lsb; - pInk->characterWidth = pCI->metrics.characterWidth; - pInk->attributes = pCI->metrics.attributes; - - leftBearing = pCI->metrics.leftSideBearing; - ascent = pCI->metrics.ascent; - descent = pCI->metrics.descent; - bitmapBitWidth = GLYPHWIDTHPIXELS(pCI); - bitmapByteWidth = GLYPHWIDTHBYTES(pCI); - bitmapByteWidthPadded = BYTES_PER_ROW(bitmapBitWidth, pFont->glyph); - span = bitmapByteWidthPadded - bitmapByteWidth; - - p = (unsigned char *) pCI->bits; - for (vpos = descent + ascent; --vpos >= 0;) { - for (hpos = bitmapByteWidth; --hpos >= 0;) { - if (*p++ != 0) - goto found_ascent; - } - p += span; - } - /* - * special case -- font with no bits gets all zeros - */ - pInk->leftSideBearing = leftBearing; - pInk->rightSideBearing = leftBearing; - pInk->ascent = 0; - pInk->descent = 0; - return; -found_ascent: - pInk->ascent = vpos - descent + 1; - - p = ((unsigned char *) pCI->bits) + bitmapByteWidthPadded * - (descent + ascent - 1) + bitmapByteWidth; - - for (vpos = descent + ascent; --vpos >= 0;) { - for (hpos = bitmapByteWidth; --hpos >= 0;) { - if (*--p != 0) - goto found_descent; - } - p -= span; - } -found_descent: - pInk->descent = vpos - ascent + 1; - - bmax = 8; - for (hpos = 0; hpos < bitmapByteWidth; hpos++) { - charbits = 0; - p = (unsigned char *) pCI->bits + hpos; - for (vpos = descent + ascent; --vpos >= 0; p += bitmapByteWidthPadded) - charbits |= *p; - if (charbits) { - if (hpos == bitmapByteWidth - 1) - bmax = bitmapBitWidth - (hpos << 3); - p = ink_mask; - for (bpos = bmax; --bpos >= 0;) { - if (charbits & *p++) - goto found_left; - } - } - } -found_left: - pInk->leftSideBearing = leftBearing + (hpos << 3) + bmax - bpos - 1; - - bmax = bitmapBitWidth - ((bitmapByteWidth - 1) << 3); - for (hpos = bitmapByteWidth; --hpos >= 0;) { - charbits = 0; - p = (unsigned char *) pCI->bits + hpos; - for (vpos = descent + ascent; --vpos >= 0; p += bitmapByteWidthPadded) - charbits |= *p; - if (charbits) { - p = ink_mask + bmax; - for (bpos = bmax; --bpos >= 0;) { - if (charbits & *--p) - goto found_right; - } - } - bmax = 8; - } -found_right: - pInk->rightSideBearing = leftBearing + (hpos << 3) + bpos + 1; -} - -#define ISBITONMSB(x, line) ((line)[(x)/8] & (1 << (7-((x)%8)))) -#define SETBITMSB(x, line) ((line)[(x)/8] |= (1 << (7-((x)%8)))) -#define ISBITONLSB(x, line) ((line)[(x)/8] & (1 << ((x)%8))) -#define SETBITLSB(x, line) ((line)[(x)/8] |= (1 << ((x)%8))) - -#define Min(a,b) ((a)<(b)?(a):(b)) -#define Max(a,b) ((a)>(b)?(a):(b)) - -void -FontCharReshape(FontPtr pFont, CharInfoPtr pSrc, CharInfoPtr pDst) -{ - int x, - y; - unsigned char *in_line, - *out_line; - unsigned char *oldglyph, - *newglyph; - int inwidth; - int outwidth, - outheight; - int out_bytes, - in_bytes; - int y_min, - y_max, - x_min, - x_max; - - newglyph = (unsigned char *) pDst->bits; - outwidth = pDst->metrics.rightSideBearing - pDst->metrics.leftSideBearing; - outheight = pDst->metrics.descent + pDst->metrics.ascent; - out_bytes = BYTES_PER_ROW(outwidth, pFont->glyph); - - oldglyph = (unsigned char *) pSrc->bits; - inwidth = pSrc->metrics.rightSideBearing - pSrc->metrics.leftSideBearing; - in_bytes = BYTES_PER_ROW(inwidth, pFont->glyph); - - bzero(newglyph, out_bytes * outheight); - in_line = oldglyph; - out_line = newglyph; - y_min = Max(-pSrc->metrics.ascent, -pDst->metrics.ascent); - y_max = Min(pSrc->metrics.descent, pDst->metrics.descent); - x_min = Max(pSrc->metrics.leftSideBearing, pDst->metrics.leftSideBearing); - x_max = Min(pSrc->metrics.rightSideBearing, pDst->metrics.rightSideBearing); - in_line += (y_min + pSrc->metrics.ascent) * in_bytes; - out_line += (y_min + pDst->metrics.ascent) * out_bytes; - if (pFont->bit == MSBFirst) { - for (y = y_min; y < y_max; y++) { - for (x = x_min; x < x_max; x++) { - if (ISBITONMSB(x - pSrc->metrics.leftSideBearing, in_line)) - SETBITMSB(x - pDst->metrics.leftSideBearing, out_line); - } - in_line += in_bytes; - out_line += out_bytes; - } - } else { - for (y = y_min; y < y_max; y++) { - for (x = x_min; x < x_max; x++) { - if (ISBITONLSB(x - pSrc->metrics.leftSideBearing, in_line)) - SETBITLSB(x - pDst->metrics.leftSideBearing, out_line); - } - in_line += in_bytes; - out_line += out_bytes; - } - } -} diff --git a/nx-X11/lib/font/bitmap/module/Imakefile b/nx-X11/lib/font/bitmap/module/Imakefile deleted file mode 100644 index 29a49c644..000000000 --- a/nx-X11/lib/font/bitmap/module/Imakefile +++ /dev/null @@ -1,45 +0,0 @@ -XCOMM $XFree86: xc/lib/font/bitmap/module/Imakefile,v 1.5 1999/12/03 19:17:18 eich Exp $ - -#define IHaveModules -#include - - INCLUDES = -I$(FONTINCSRC) -I../../include -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) -I../ - HEADERS = - DEFINES = -DFONTMODULE -DBDFFORMAT -DSNFFORMAT -DPCFFORMAT - -#ifdef FontFormatDefines - FORMAT_DEFS = FontFormatDefines -#endif -#if GzipFontCompression - GZIP_DEFS = -DX_GZIP_FONT_COMPRESSION -#endif - - SRCS = bdfread.c bdfutils.c bitmap.c bitmaputil.c bitscale.c \ - bitmapfunc.c pcfread.c pcfwrite.c snfread.c \ - fontink.c bitmapmod.c - - OBJS = bdfread.o bdfutils.o bitmap.o bitmaputil.o bitscale.o \ - bitmapfunc.o pcfread.o pcfwrite.o snfread.o \ - fontink.o bitmapmod.o - -SpecialCObjectRule(bitmapfunc,$(ICONFIGFILES),$(GZIP_DEFS)) - -LinkSourceFile(bdfread.c,..) -LinkSourceFile(bdfutils.c,..) -LinkSourceFile(bitmap.c,..) -LinkSourceFile(bitmaputil.c,..) -LinkSourceFile(bitscale.c,..) -LinkSourceFile(bitmapfunc.c,..) -LinkSourceFile(pcfread.c,..) -LinkSourceFile(pcfwrite.c,..) -LinkSourceFile(snfread.c,..) -LinkSourceFile(fontink.c,..) - -ModuleObjectRule() -LibraryModuleTarget(bitmap,$(OBJS)) -InstallLibraryModule(bitmap,$(MODULEDIR),fonts) - -DependTarget() - -InstallDriverSDKLibraryModule(bitmap,$(DRIVERSDKMODULEDIR),fonts) diff --git a/nx-X11/lib/font/bitmap/module/bitmapmod.c b/nx-X11/lib/font/bitmap/module/bitmapmod.c deleted file mode 100644 index 0ae9ff7ad..000000000 --- a/nx-X11/lib/font/bitmap/module/bitmapmod.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice 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 - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ -/* $XFree86: xc/lib/font/bitmap/module/bitmapmod.c,v 1.7 1999/01/26 05:53:47 dawes Exp $ */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include -#include "xf86Module.h" - -static MODULESETUPPROTO(bitmapSetup); - - /* - * This is the module data function that is accessed when loading - * libbitmap as a module. - */ - -static XF86ModuleVersionInfo VersRec = -{ - "bitmap", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_FONT, /* Font module */ - ABI_FONT_VERSION, - MOD_CLASS_FONT, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData bitmapModuleData = { &VersRec, bitmapSetup, NULL }; - -extern void BitmapRegisterFontFileFunctions(void); - -FontModule bitmapModule = { - BitmapRegisterFontFileFunctions, - "Bitmap", - NULL -}; - -static pointer -bitmapSetup(pointer mod, pointer opts, int *errmaj, int *errmin) -{ - bitmapModule.module = mod; - LoadFont(&bitmapModule); - - /* Need a non-NULL return */ - return (pointer)1; -} diff --git a/nx-X11/lib/font/bitmap/pcf.h b/nx-X11/lib/font/bitmap/pcf.h deleted file mode 100644 index 33b0ceff1..000000000 --- a/nx-X11/lib/font/bitmap/pcf.h +++ /dev/null @@ -1,100 +0,0 @@ -/* $Xorg: pcf.h,v 1.4 2001/02/09 02:04:02 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/pcf.h,v 1.4 2001/12/14 19:56:47 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifndef _PCF_H_ -#define _PCF_H_ - -/* - * Information used to read/write PCF fonts - */ - -typedef struct _PCFTable { - CARD32 type; - CARD32 format; - CARD32 size; - CARD32 offset; -} PCFTableRec, *PCFTablePtr; - -#define PCF_FILE_VERSION (('p'<<24)|('c'<<16)|('f'<<8)|1) -#define PCF_FORMAT_MASK 0xffffff00 - -#define PCF_DEFAULT_FORMAT 0x00000000 -#define PCF_INKBOUNDS 0x00000200 -#define PCF_ACCEL_W_INKBOUNDS 0x00000100 -#define PCF_COMPRESSED_METRICS 0x00000100 - -#define PCF_FORMAT_MATCH(a,b) (((a)&PCF_FORMAT_MASK) == ((b)&PCF_FORMAT_MASK)) - -#define PCF_GLYPH_PAD_MASK (3<<0) -#define PCF_BYTE_MASK (1<<2) -#define PCF_BIT_MASK (1<<3) -#define PCF_SCAN_UNIT_MASK (3<<4) - -#define PCF_BYTE_ORDER(f) (((f) & PCF_BYTE_MASK)?MSBFirst:LSBFirst) -#define PCF_BIT_ORDER(f) (((f) & PCF_BIT_MASK)?MSBFirst:LSBFirst) -#define PCF_GLYPH_PAD_INDEX(f) ((f) & PCF_GLYPH_PAD_MASK) -#define PCF_GLYPH_PAD(f) (1<> 4) -#define PCF_SCAN_UNIT(f) (1< -#endif - -#include -#include -#include - -#ifndef MAX -#define MAX(a,b) (((a)>(b)) ? a : b) -#endif - -#include - -void -pcfError(const char* message, ...) -{ - va_list args; - - va_start(args, message); - - fprintf(stderr, "PCF Error: "); - vfprintf(stderr, message, args); - va_end(args); -} - -/* Read PCF font files */ - -static void pcfUnloadFont ( FontPtr pFont ); -static int position; - - -#define IS_EOF(file) ((file)->eof == BUFFILEEOF) - -#define FONT_FILE_GETC_ERR(f) (tmp = FontFileGetc(f), BAIL_ON_EOF) - -static int -pcfGetLSB32(FontFilePtr file) -{ - int c; - - c = FontFileGetc(file); - c |= FontFileGetc(file) << 8; - c |= FontFileGetc(file) << 16; - c |= FontFileGetc(file) << 24; - position += 4; - return c; -} - -static int -pcfGetINT32(FontFilePtr file, CARD32 format) -{ - int c; - - if (PCF_BYTE_ORDER(format) == MSBFirst) { - c = FontFileGetc(file) << 24; - c |= FontFileGetc(file) << 16; - c |= FontFileGetc(file) << 8; - c |= FontFileGetc(file); - } else { - c = FontFileGetc(file); - c |= FontFileGetc(file) << 8; - c |= FontFileGetc(file) << 16; - c |= FontFileGetc(file) << 24; - } - position += 4; - return c; -} - -static int -pcfGetINT16(FontFilePtr file, CARD32 format) -{ - int c; - - if (PCF_BYTE_ORDER(format) == MSBFirst) { - c = FontFileGetc(file) << 8; - c |= FontFileGetc(file); - } else { - c = FontFileGetc(file); - c |= FontFileGetc(file) << 8; - } - position += 2; - return c; -} - -#define pcfGetINT8(file, format) (position++, FontFileGetc(file)) - -static PCFTablePtr -pcfReadTOC(FontFilePtr file, int *countp) -{ - CARD32 version; - PCFTablePtr tables; - int count; - int i; - - position = 0; - version = pcfGetLSB32(file); - if (version != PCF_FILE_VERSION) - return (PCFTablePtr) NULL; - count = pcfGetLSB32(file); - if (IS_EOF(file)) return (PCFTablePtr) NULL; - tables = (PCFTablePtr) xalloc(count * sizeof(PCFTableRec)); - if (!tables) { - pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n", count, sizeof(PCFTableRec)); - return (PCFTablePtr) NULL; - } - for (i = 0; i < count; i++) { - tables[i].type = pcfGetLSB32(file); - tables[i].format = pcfGetLSB32(file); - tables[i].size = pcfGetLSB32(file); - tables[i].offset = pcfGetLSB32(file); - if (IS_EOF(file)) goto Bail; - } - - *countp = count; - return tables; - - Bail: - xfree(tables); - return (PCFTablePtr) NULL; -} - -/* - * PCF supports two formats for metrics, both the regular - * jumbo size, and 'lite' metrics, which are useful - * for most fonts which have even vaguely reasonable - * metrics - */ - -static Bool -pcfGetMetric(FontFilePtr file, CARD32 format, xCharInfo *metric) -{ - metric->leftSideBearing = pcfGetINT16(file, format); - metric->rightSideBearing = pcfGetINT16(file, format); - metric->characterWidth = pcfGetINT16(file, format); - metric->ascent = pcfGetINT16(file, format); - metric->descent = pcfGetINT16(file, format); - metric->attributes = pcfGetINT16(file, format); - if (IS_EOF(file)) return FALSE; - - return TRUE; -} - -static Bool -pcfGetCompressedMetric(FontFilePtr file, CARD32 format, xCharInfo *metric) -{ - metric->leftSideBearing = pcfGetINT8(file, format) - 0x80; - metric->rightSideBearing = pcfGetINT8(file, format) - 0x80; - metric->characterWidth = pcfGetINT8(file, format) - 0x80; - metric->ascent = pcfGetINT8(file, format) - 0x80; - metric->descent = pcfGetINT8(file, format) - 0x80; - metric->attributes = 0; - if (IS_EOF(file)) return FALSE; - - return TRUE; -} - -/* - * Position the file to the begining of the specified table - * in the font file - */ -static Bool -pcfSeekToType(FontFilePtr file, PCFTablePtr tables, int ntables, - CARD32 type, CARD32 *formatp, CARD32 *sizep) -{ - int i; - - for (i = 0; i < ntables; i++) - if (tables[i].type == type) { - if (position > tables[i].offset) - return FALSE; - if (!FontFileSkip(file, tables[i].offset - position)) - return FALSE; - position = tables[i].offset; - *sizep = tables[i].size; - *formatp = tables[i].format; - return TRUE; - } - return FALSE; -} - -static Bool -pcfHasType (PCFTablePtr tables, int ntables, CARD32 type) -{ - int i; - - for (i = 0; i < ntables; i++) - if (tables[i].type == type) - return TRUE; - return FALSE; -} - -/* - * pcfGetProperties - * - * Reads the font properties from the font file, filling in the FontInfo rec - * supplied. Used by by both ReadFont and ReadFontInfo routines. - */ - -static Bool -pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file, - PCFTablePtr tables, int ntables) -{ - FontPropPtr props = 0; - int nprops; - char *isStringProp = 0; - CARD32 format; - int i; - CARD32 size; - int string_size; - char *strings; - - /* font properties */ - - if (!pcfSeekToType(file, tables, ntables, PCF_PROPERTIES, &format, &size)) - goto Bail; - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) - goto Bail; - nprops = pcfGetINT32(file, format); - if (IS_EOF(file)) goto Bail; - props = (FontPropPtr) xalloc(nprops * sizeof(FontPropRec)); - if (!props) { - pcfError("pcfGetProperties(): Couldn't allocate props (%d*%d)\n", nprops, sizeof(FontPropRec)); - goto Bail; - } - isStringProp = (char *) xalloc(nprops * sizeof(char)); - if (!isStringProp) { - pcfError("pcfGetProperties(): Couldn't allocate isStringProp (%d*%d)\n", nprops, sizeof(char)); - goto Bail; - } - for (i = 0; i < nprops; i++) { - props[i].name = pcfGetINT32(file, format); - isStringProp[i] = pcfGetINT8(file, format); - props[i].value = pcfGetINT32(file, format); - if (IS_EOF(file)) goto Bail; - } - /* pad the property array */ - /* - * clever here - nprops is the same as the number of odd-units read, as - * only isStringProp are odd length - */ - if (nprops & 3) - { - i = 4 - (nprops & 3); - (void)FontFileSkip(file, i); - position += i; - } - if (IS_EOF(file)) goto Bail; - string_size = pcfGetINT32(file, format); - if (IS_EOF(file)) goto Bail; - strings = (char *) xalloc(string_size); - if (!strings) { - pcfError("pcfGetProperties(): Couldn't allocate strings (%d)\n", string_size); - goto Bail; - } - FontFileRead(file, strings, string_size); - if (IS_EOF(file)) goto Bail; - position += string_size; - for (i = 0; i < nprops; i++) { - props[i].name = MakeAtom(strings + props[i].name, - strlen(strings + props[i].name), TRUE); - if (isStringProp[i]) { - props[i].value = MakeAtom(strings + props[i].value, - strlen(strings + props[i].value), TRUE); - } - } - xfree(strings); - pFontInfo->isStringProp = isStringProp; - pFontInfo->props = props; - pFontInfo->nprops = nprops; - return TRUE; -Bail: - xfree(isStringProp); - xfree(props); - return FALSE; -} - - -/* - * pcfReadAccel - * - * Fill in the accelerator information from the font file; used - * to read both BDF_ACCELERATORS and old style ACCELERATORS - */ - -static Bool -pcfGetAccel(FontInfoPtr pFontInfo, FontFilePtr file, - PCFTablePtr tables, int ntables, CARD32 type) -{ - CARD32 format; - CARD32 size; - - if (!pcfSeekToType(file, tables, ntables, type, &format, &size) || - IS_EOF(file)) - goto Bail; - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) && - !PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS)) - { - goto Bail; - } - pFontInfo->noOverlap = pcfGetINT8(file, format); - pFontInfo->constantMetrics = pcfGetINT8(file, format); - pFontInfo->terminalFont = pcfGetINT8(file, format); - pFontInfo->constantWidth = pcfGetINT8(file, format); - pFontInfo->inkInside = pcfGetINT8(file, format); - pFontInfo->inkMetrics = pcfGetINT8(file, format); - pFontInfo->drawDirection = pcfGetINT8(file, format); - pFontInfo->anamorphic = FALSE; - pFontInfo->cachable = TRUE; - /* natural alignment */ pcfGetINT8(file, format); - pFontInfo->fontAscent = pcfGetINT32(file, format); - pFontInfo->fontDescent = pcfGetINT32(file, format); - pFontInfo->maxOverlap = pcfGetINT32(file, format); - if (IS_EOF(file)) goto Bail; - if (!pcfGetMetric(file, format, &pFontInfo->minbounds)) - goto Bail; - if (!pcfGetMetric(file, format, &pFontInfo->maxbounds)) - goto Bail; - if (PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS)) { - if (!pcfGetMetric(file, format, &pFontInfo->ink_minbounds)) - goto Bail; - if (!pcfGetMetric(file, format, &pFontInfo->ink_maxbounds)) - goto Bail; - } else { - pFontInfo->ink_minbounds = pFontInfo->minbounds; - pFontInfo->ink_maxbounds = pFontInfo->maxbounds; - } - return TRUE; -Bail: - return FALSE; -} - -int -pcfReadFont(FontPtr pFont, FontFilePtr file, - int bit, int byte, int glyph, int scan) -{ - CARD32 format; - CARD32 size; - BitmapFontPtr bitmapFont = 0; - int i; - PCFTablePtr tables = 0; - int ntables; - int nmetrics; - int nbitmaps; - int sizebitmaps; - int nink_metrics; - CharInfoPtr metrics = 0; - xCharInfo *ink_metrics = 0; - char *bitmaps = 0; - CharInfoPtr **encoding = 0; - int nencoding = 0; - int encodingOffset; - CARD32 bitmapSizes[GLYPHPADOPTIONS]; - CARD32 *offsets = 0; - Bool hasBDFAccelerators; - - pFont->info.nprops = 0; - pFont->info.props = 0; - if (!(tables = pcfReadTOC(file, &ntables))) - goto Bail; - - /* properties */ - - if (!pcfGetProperties(&pFont->info, file, tables, ntables)) - goto Bail; - - /* Use the old accelerators if no BDF accelerators are in the file */ - - hasBDFAccelerators = pcfHasType (tables, ntables, PCF_BDF_ACCELERATORS); - if (!hasBDFAccelerators) - if (!pcfGetAccel (&pFont->info, file, tables, ntables, PCF_ACCELERATORS)) - goto Bail; - - /* metrics */ - - if (!pcfSeekToType(file, tables, ntables, PCF_METRICS, &format, &size)) { - goto Bail; - } - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) && - !PCF_FORMAT_MATCH(format, PCF_COMPRESSED_METRICS)) { - goto Bail; - } - if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) - nmetrics = pcfGetINT32(file, format); - else - nmetrics = pcfGetINT16(file, format); - if (IS_EOF(file)) goto Bail; - metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec)); - if (!metrics) { - pcfError("pcfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec)); - goto Bail; - } - for (i = 0; i < nmetrics; i++) - if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) { - if (!pcfGetMetric(file, format, &(metrics + i)->metrics)) - goto Bail; - } else { - if (!pcfGetCompressedMetric(file, format, &(metrics + i)->metrics)) - goto Bail; - } - - /* bitmaps */ - - if (!pcfSeekToType(file, tables, ntables, PCF_BITMAPS, &format, &size)) - goto Bail; - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) - goto Bail; - - nbitmaps = pcfGetINT32(file, format); - if (nbitmaps != nmetrics || IS_EOF(file)) - goto Bail; - - offsets = (CARD32 *) xalloc(nbitmaps * sizeof(CARD32)); - if (!offsets) { - pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n", nbitmaps, sizeof(CARD32)); - goto Bail; - } - for (i = 0; i < nbitmaps; i++) { - offsets[i] = pcfGetINT32(file, format); - if (IS_EOF(file)) goto Bail; - } - - for (i = 0; i < GLYPHPADOPTIONS; i++) { - bitmapSizes[i] = pcfGetINT32(file, format); - if (IS_EOF(file)) goto Bail; - } - - sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)]; - /* guard against completely empty font */ - bitmaps = xalloc(sizebitmaps ? sizebitmaps : 1); - if (!bitmaps) { - pcfError("pcfReadFont(): Couldn't allocate bitmaps (%d)\n", sizebitmaps ? sizebitmaps : 1); - goto Bail; - } - FontFileRead(file, bitmaps, sizebitmaps); - if (IS_EOF(file)) goto Bail; - position += sizebitmaps; - - if (PCF_BIT_ORDER(format) != bit) - BitOrderInvert((unsigned char *)bitmaps, sizebitmaps); - if ((PCF_BYTE_ORDER(format) == PCF_BIT_ORDER(format)) != (bit == byte)) { - switch (bit == byte ? PCF_SCAN_UNIT(format) : scan) { - case 1: - break; - case 2: - TwoByteSwap((unsigned char *)bitmaps, sizebitmaps); - break; - case 4: - FourByteSwap((unsigned char *)bitmaps, sizebitmaps); - break; - } - } - if (PCF_GLYPH_PAD(format) != glyph) { - char *padbitmaps; - int sizepadbitmaps; - int old, - new; - xCharInfo *metric; - - sizepadbitmaps = bitmapSizes[PCF_SIZE_TO_INDEX(glyph)]; - padbitmaps = (char *) xalloc(sizepadbitmaps); - if (!padbitmaps) { - pcfError("pcfReadFont(): Couldn't allocate padbitmaps (%d)\n", sizepadbitmaps); - goto Bail; - } - new = 0; - for (i = 0; i < nbitmaps; i++) { - old = offsets[i]; - metric = &metrics[i].metrics; - offsets[i] = new; - new += RepadBitmap(bitmaps + old, padbitmaps + new, - PCF_GLYPH_PAD(format), glyph, - metric->rightSideBearing - metric->leftSideBearing, - metric->ascent + metric->descent); - } - xfree(bitmaps); - bitmaps = padbitmaps; - } - for (i = 0; i < nbitmaps; i++) - metrics[i].bits = bitmaps + offsets[i]; - - xfree(offsets); - offsets = NULL; - - /* ink metrics ? */ - - ink_metrics = NULL; - if (pcfSeekToType(file, tables, ntables, PCF_INK_METRICS, &format, &size)) { - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) && - !PCF_FORMAT_MATCH(format, PCF_COMPRESSED_METRICS)) { - goto Bail; - } - if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) - nink_metrics = pcfGetINT32(file, format); - else - nink_metrics = pcfGetINT16(file, format); - if (IS_EOF(file)) goto Bail; - if (nink_metrics != nmetrics) - goto Bail; - ink_metrics = (xCharInfo *) xalloc(nink_metrics * sizeof(xCharInfo)); - if (!ink_metrics) { - pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo)); - goto Bail; - } - for (i = 0; i < nink_metrics; i++) - if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) { - if (!pcfGetMetric(file, format, ink_metrics + i)) - goto Bail; - } else { - if (!pcfGetCompressedMetric(file, format, ink_metrics + i)) - goto Bail; - } - } - - /* encoding */ - - if (!pcfSeekToType(file, tables, ntables, PCF_BDF_ENCODINGS, &format, &size)) - goto Bail; - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) - goto Bail; - - pFont->info.firstCol = pcfGetINT16(file, format); - pFont->info.lastCol = pcfGetINT16(file, format); - pFont->info.firstRow = pcfGetINT16(file, format); - pFont->info.lastRow = pcfGetINT16(file, format); - pFont->info.defaultCh = pcfGetINT16(file, format); - if (IS_EOF(file)) goto Bail; - if (pFont->info.firstCol > pFont->info.lastCol || - pFont->info.firstRow > pFont->info.lastRow || - pFont->info.lastCol-pFont->info.firstCol > 255) goto Bail; - - nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) * - (pFont->info.lastRow - pFont->info.firstRow + 1); - - encoding = (CharInfoPtr **) xcalloc(NUM_SEGMENTS(nencoding), - sizeof(CharInfoPtr*)); - if (!encoding) { - pcfError("pcfReadFont(): Couldn't allocate encoding (%d*%d)\n", nencoding, sizeof(CharInfoPtr)); - goto Bail; - } - - pFont->info.allExist = TRUE; - for (i = 0; i < nencoding; i++) { - encodingOffset = pcfGetINT16(file, format); - if (IS_EOF(file)) goto Bail; - if (encodingOffset == 0xFFFF) { - pFont->info.allExist = FALSE; - } else { - if(!encoding[SEGMENT_MAJOR(i)]) { - encoding[SEGMENT_MAJOR(i)]= - (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE, - sizeof(CharInfoPtr)); - if(!encoding[SEGMENT_MAJOR(i)]) - goto Bail; - } - ACCESSENCODINGL(encoding, i) = metrics + encodingOffset; - } - } - - /* BDF style accelerators (i.e. bounds based on encoded glyphs) */ - - if (hasBDFAccelerators) - if (!pcfGetAccel (&pFont->info, file, tables, ntables, PCF_BDF_ACCELERATORS)) - goto Bail; - - bitmapFont = (BitmapFontPtr) xalloc(sizeof *bitmapFont); - if (!bitmapFont) { - pcfError("pcfReadFont(): Couldn't allocate bitmapFont (%d)\n", sizeof *bitmapFont); - goto Bail; - } - - bitmapFont->version_num = PCF_FILE_VERSION; - bitmapFont->num_chars = nmetrics; - bitmapFont->num_tables = ntables; - bitmapFont->metrics = metrics; - bitmapFont->ink_metrics = ink_metrics; - bitmapFont->bitmaps = bitmaps; - bitmapFont->encoding = encoding; - bitmapFont->pDefault = (CharInfoPtr) 0; - if (pFont->info.defaultCh != (unsigned short) NO_SUCH_CHAR) { - unsigned int r, - c, - cols; - - r = pFont->info.defaultCh >> 8; - c = pFont->info.defaultCh & 0xFF; - if (pFont->info.firstRow <= r && r <= pFont->info.lastRow && - pFont->info.firstCol <= c && c <= pFont->info.lastCol) { - cols = pFont->info.lastCol - pFont->info.firstCol + 1; - r = r - pFont->info.firstRow; - c = c - pFont->info.firstCol; - bitmapFont->pDefault = ACCESSENCODING(encoding, r * cols + c); - } - } - bitmapFont->bitmapExtra = (BitmapExtraPtr) 0; - pFont->fontPrivate = (pointer) bitmapFont; - pFont->get_glyphs = bitmapGetGlyphs; - pFont->get_metrics = bitmapGetMetrics; - pFont->unload_font = pcfUnloadFont; - pFont->unload_glyphs = NULL; - pFont->bit = bit; - pFont->byte = byte; - pFont->glyph = glyph; - pFont->scan = scan; - xfree(tables); - return Successful; -Bail: - xfree(ink_metrics); - if(encoding) { - for(i=0; iinfo.props); - pFont->info.nprops = 0; - pFont->info.props = 0; - xfree (pFont->info.isStringProp); - xfree(bitmapFont); - xfree(tables); - xfree(offsets); - return AllocError; -} - -int -pcfReadFontInfo(FontInfoPtr pFontInfo, FontFilePtr file) -{ - PCFTablePtr tables; - int ntables; - CARD32 format; - CARD32 size; - int nencoding; - Bool hasBDFAccelerators; - - pFontInfo->isStringProp = NULL; - pFontInfo->props = NULL; - pFontInfo->nprops = 0; - - if (!(tables = pcfReadTOC(file, &ntables))) - goto Bail; - - /* properties */ - - if (!pcfGetProperties(pFontInfo, file, tables, ntables)) - goto Bail; - - /* Use the old accelerators if no BDF accelerators are in the file */ - - hasBDFAccelerators = pcfHasType (tables, ntables, PCF_BDF_ACCELERATORS); - if (!hasBDFAccelerators) - if (!pcfGetAccel (pFontInfo, file, tables, ntables, PCF_ACCELERATORS)) - goto Bail; - - /* encoding */ - - if (!pcfSeekToType(file, tables, ntables, PCF_BDF_ENCODINGS, &format, &size)) - goto Bail; - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) - goto Bail; - - pFontInfo->firstCol = pcfGetINT16(file, format); - pFontInfo->lastCol = pcfGetINT16(file, format); - pFontInfo->firstRow = pcfGetINT16(file, format); - pFontInfo->lastRow = pcfGetINT16(file, format); - pFontInfo->defaultCh = pcfGetINT16(file, format); - if (IS_EOF(file)) goto Bail; - if (pFontInfo->firstCol > pFontInfo->lastCol || - pFontInfo->firstRow > pFontInfo->lastRow || - pFontInfo->lastCol-pFontInfo->firstCol > 255) goto Bail; - - nencoding = (pFontInfo->lastCol - pFontInfo->firstCol + 1) * - (pFontInfo->lastRow - pFontInfo->firstRow + 1); - - pFontInfo->allExist = TRUE; - while (nencoding--) { - if (pcfGetINT16(file, format) == 0xFFFF) - pFontInfo->allExist = FALSE; - if (IS_EOF(file)) goto Bail; - } - if (IS_EOF(file)) goto Bail; - - /* BDF style accelerators (i.e. bounds based on encoded glyphs) */ - - if (hasBDFAccelerators) - if (!pcfGetAccel (pFontInfo, file, tables, ntables, PCF_BDF_ACCELERATORS)) - goto Bail; - - xfree(tables); - return Successful; -Bail: - pFontInfo->nprops = 0; - xfree (pFontInfo->props); - xfree (pFontInfo->isStringProp); - xfree(tables); - return AllocError; -} - -static void -pcfUnloadFont(FontPtr pFont) -{ - BitmapFontPtr bitmapFont; - int i,nencoding; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - xfree(bitmapFont->ink_metrics); - if(bitmapFont->encoding) { - nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) * - (pFont->info.lastRow - pFont->info.firstRow + 1); - for(i=0; iencoding[i]); - } - xfree(bitmapFont->encoding); - xfree(bitmapFont->bitmaps); - xfree(bitmapFont->metrics); - xfree(pFont->info.isStringProp); - xfree(pFont->info.props); - xfree(bitmapFont); - DestroyFontRec(pFont); -} - -int -pmfReadFont(FontPtr pFont, FontFilePtr file, - int bit, int byte, int glyph, int scan) -{ - CARD32 format; - CARD32 size; - BitmapFontPtr bitmapFont = 0; - int i; - PCFTablePtr tables = 0; - int ntables; - int nmetrics; - int sizebitmaps; - int nink_metrics; - CharInfoPtr metrics = 0; - xCharInfo *ink_metrics = 0; - char *bitmaps = 0; - CharInfoPtr **encoding = 0; - int nencoding = 0; - int encodingOffset; - Bool hasBDFAccelerators; - CharInfoPtr pci; - - pFont->info.nprops = 0; - pFont->info.props = 0; - - if (!(tables = pcfReadTOC(file, &ntables))) - goto Bail; - - /* properties */ - - if (!pcfGetProperties(&pFont->info, file, tables, ntables)) - goto Bail; - - /* Use the old accelerators if no BDF accelerators are in the file */ - - hasBDFAccelerators = pcfHasType (tables, ntables, PCF_BDF_ACCELERATORS); - if (!hasBDFAccelerators) - if (!pcfGetAccel (&pFont->info, file, tables, ntables, PCF_ACCELERATORS)) - goto Bail; - - /* metrics */ - - if (!pcfSeekToType(file, tables, ntables, PCF_METRICS, &format, &size)) { - goto Bail; - } - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) && - !PCF_FORMAT_MATCH(format, PCF_COMPRESSED_METRICS)) { - goto Bail; - } - if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) - nmetrics = pcfGetINT32(file, format); - else - nmetrics = pcfGetINT16(file, format); - if (IS_EOF(file)) goto Bail; - metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec)); - if (!metrics) { - pcfError("pmfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec)); - goto Bail; - } - for (i = 0; i < nmetrics; i++) - if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) { - if (!pcfGetMetric(file, format, &(metrics + i)->metrics)) - goto Bail; - } else { - if (!pcfGetCompressedMetric(file, format, &(metrics + i)->metrics)) - goto Bail; - } - - /* Set the bitmaps to all point to the same zero filled array - * that is the size of the largest bitmap. - */ - - pci = metrics; - sizebitmaps = 0; - for (i = 0; i < nmetrics; i++) - { - sizebitmaps = MAX(sizebitmaps,BYTES_FOR_GLYPH(pci, glyph)); - pci++; - } - -#ifdef FONTMODULE - sizebitmaps = 1024; /* Default - we xalloc the size anyway */ -#else - sizebitmaps = BUFSIZ; -#endif - /* guard against completely empty font */ - bitmaps = (char *) xalloc(sizebitmaps); - if (!bitmaps) { - pcfError("pmfReadFont(): Couldn't allocate bitmaps (%d)\n", sizebitmaps); - goto Bail; - } - - memset(bitmaps,0,sizebitmaps); - for (i = 0; i < nmetrics; i++) - metrics[i].bits = bitmaps; - - /* ink metrics ? */ - - ink_metrics = NULL; - if (pcfSeekToType(file, tables, ntables, PCF_INK_METRICS, &format, &size)) { - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) && - !PCF_FORMAT_MATCH(format, PCF_COMPRESSED_METRICS)) { - goto Bail; - } - if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) - nink_metrics = pcfGetINT32(file, format); - else - nink_metrics = pcfGetINT16(file, format); - if (nink_metrics != nmetrics) - goto Bail; - if (IS_EOF(file)) goto Bail; - ink_metrics = (xCharInfo *) xalloc(nink_metrics * sizeof(xCharInfo)); - if (!ink_metrics) { - pcfError("pmfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo)); - goto Bail; - } - for (i = 0; i < nink_metrics; i++) - if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) { - if (!pcfGetMetric(file, format, ink_metrics + i)) - goto Bail; - } else { - if (!pcfGetCompressedMetric(file, format, ink_metrics + i)) - goto Bail; - } - } - - /* encoding */ - - if (!pcfSeekToType(file, tables, ntables, PCF_BDF_ENCODINGS, &format, &size)) - goto Bail; - format = pcfGetLSB32(file); - if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) - goto Bail; - - pFont->info.firstCol = pcfGetINT16(file, format); - pFont->info.lastCol = pcfGetINT16(file, format); - pFont->info.firstRow = pcfGetINT16(file, format); - pFont->info.lastRow = pcfGetINT16(file, format); - pFont->info.defaultCh = pcfGetINT16(file, format); - if (IS_EOF(file)) goto Bail; - - nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) * - (pFont->info.lastRow - pFont->info.firstRow + 1); - - encoding = (CharInfoPtr **) xcalloc(NUM_SEGMENTS(nencoding), - sizeof(CharInfoPtr*)); - if (!encoding) { - pcfError("pmfReadFont(): Couldn't allocate encoding (%d*%d)\n", nencoding, sizeof(CharInfoPtr)); - goto Bail; - } - pFont->info.allExist = TRUE; - for (i = 0; i < nencoding; i++) { - encodingOffset = pcfGetINT16(file, format); - if (IS_EOF(file)) goto Bail; - if (encodingOffset == 0xFFFF) { - pFont->info.allExist = FALSE; - } else { - if(!encoding[SEGMENT_MAJOR(i)]) { - encoding[SEGMENT_MAJOR(i)]= - (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE, - sizeof(CharInfoPtr)); - if(!encoding[SEGMENT_MAJOR(i)]) - goto Bail; - } - ACCESSENCODINGL(encoding, i) = metrics + encodingOffset; - } - } - if (IS_EOF(file)) goto Bail; - - /* BDF style accelerators (i.e. bounds based on encoded glyphs) */ - - if (hasBDFAccelerators) - if (!pcfGetAccel (&pFont->info, file, tables, ntables, PCF_BDF_ACCELERATORS)) - goto Bail; - - bitmapFont = (BitmapFontPtr) xalloc(sizeof *bitmapFont); - if (!bitmapFont) { - pcfError("pmfReadFont(): Couldn't allocate bitmapFont (%d)\n", sizeof *bitmapFont); - goto Bail; - } - - bitmapFont->version_num = PCF_FILE_VERSION; - bitmapFont->num_chars = nmetrics; - bitmapFont->num_tables = ntables; - bitmapFont->metrics = metrics; - bitmapFont->ink_metrics = ink_metrics; - bitmapFont->bitmaps = bitmaps; - bitmapFont->encoding = encoding; - bitmapFont->pDefault = (CharInfoPtr) 0; - if (pFont->info.defaultCh != (unsigned short) NO_SUCH_CHAR) { - unsigned int r, - c, - cols; - - r = pFont->info.defaultCh >> 8; - c = pFont->info.defaultCh & 0xFF; - if (pFont->info.firstRow <= r && r <= pFont->info.lastRow && - pFont->info.firstCol <= c && c <= pFont->info.lastCol) { - cols = pFont->info.lastCol - pFont->info.firstCol + 1; - r = r - pFont->info.firstRow; - c = c - pFont->info.firstCol; - bitmapFont->pDefault = ACCESSENCODING(encoding, r * cols + c); - } - } - bitmapFont->bitmapExtra = (BitmapExtraPtr) 0; - pFont->fontPrivate = (pointer) bitmapFont; - pFont->get_glyphs = bitmapGetGlyphs; - pFont->get_metrics = bitmapGetMetrics; - pFont->unload_font = pcfUnloadFont; - pFont->unload_glyphs = NULL; - pFont->bit = bit; - pFont->byte = byte; - pFont->glyph = glyph; - pFont->scan = scan; - xfree(tables); - return Successful; -Bail: - xfree(ink_metrics); - if(encoding) { - for(i=0; iinfo.props); - pFont->info.nprops = 0; - pFont->info.props = 0; - xfree (pFont->info.isStringProp); - xfree(bitmapFont); - xfree(tables); - return AllocError; -} diff --git a/nx-X11/lib/font/bitmap/pcfwrite.c b/nx-X11/lib/font/bitmap/pcfwrite.c deleted file mode 100644 index 8d5e9425f..000000000 --- a/nx-X11/lib/font/bitmap/pcfwrite.c +++ /dev/null @@ -1,468 +0,0 @@ -/* $Xorg: pcfwrite.c,v 1.5 2001/02/09 02:04:02 xorgcvs Exp $ */ -/* - -Copyright 1990, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/pcfwrite.c,v 1.11 2003/11/17 22:20:22 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -/* Write PCF font files */ - -static CARD32 current_position; - -static int -pcfWrite(FontFilePtr file, char *b, int c) -{ - current_position += c; - return FontFileWrite(file, b, c); -} - -static int -pcfPutLSB32(FontFilePtr file, int c) -{ - current_position += 4; - (void) FontFilePutc(c, file); - (void) FontFilePutc(c >> 8, file); - (void) FontFilePutc(c >> 16, file); - return FontFilePutc(c >> 24, file); -} - -static int -pcfPutINT32(FontFilePtr file, CARD32 format, int c) -{ - current_position += 4; - if (PCF_BYTE_ORDER(format) == MSBFirst) { - (void) FontFilePutc(c >> 24, file); - (void) FontFilePutc(c >> 16, file); - (void) FontFilePutc(c >> 8, file); - return FontFilePutc(c, file); - } else { - (void) FontFilePutc(c, file); - (void) FontFilePutc(c >> 8, file); - (void) FontFilePutc(c >> 16, file); - return FontFilePutc(c >> 24, file); - } -} - -static int -pcfPutINT16(FontFilePtr file, CARD32 format, int c) -{ - current_position += 2; - if (PCF_BYTE_ORDER(format) == MSBFirst) { - (void) FontFilePutc(c >> 8, file); - return FontFilePutc(c, file); - } else { - (void) FontFilePutc(c, file); - return FontFilePutc(c >> 8, file); - } -} - -/*ARGSUSED*/ -static int -pcfPutINT8(FontFilePtr file, CARD32 format, int c) -{ - current_position += 1; - return FontFilePutc(c, file); -} - -static void -pcfWriteTOC(FontFilePtr file, PCFTablePtr table, int count) -{ - CARD32 version; - int i; - - version = PCF_FILE_VERSION; - pcfPutLSB32(file, version); - pcfPutLSB32(file, count); - for (i = 0; i < count; i++) { - pcfPutLSB32(file, table->type); - pcfPutLSB32(file, table->format); - pcfPutLSB32(file, table->size); - pcfPutLSB32(file, table->offset); - table++; - } -} - -static void -pcfPutCompressedMetric(FontFilePtr file, CARD32 format, xCharInfo *metric) -{ - pcfPutINT8(file, format, metric->leftSideBearing + 0x80); - pcfPutINT8(file, format, metric->rightSideBearing + 0x80); - pcfPutINT8(file, format, metric->characterWidth + 0x80); - pcfPutINT8(file, format, metric->ascent + 0x80); - pcfPutINT8(file, format, metric->descent + 0x80); -} - -static void -pcfPutMetric(FontFilePtr file, CARD32 format, xCharInfo *metric) -{ - pcfPutINT16(file, format, metric->leftSideBearing); - pcfPutINT16(file, format, metric->rightSideBearing); - pcfPutINT16(file, format, metric->characterWidth); - pcfPutINT16(file, format, metric->ascent); - pcfPutINT16(file, format, metric->descent); - pcfPutINT16(file, format, metric->attributes); -} - -static void -pcfPutBitmap(FontFilePtr file, CARD32 format, CharInfoPtr pCI) -{ - int count; - unsigned char *bits; - - count = BYTES_FOR_GLYPH(pCI, PCF_GLYPH_PAD(format)); - bits = (unsigned char *) pCI->bits; - current_position += count; - while (count--) - FontFilePutc(*bits++, file); -} - -static void -pcfPutAccel(FontFilePtr file, CARD32 format, FontInfoPtr pFontInfo) -{ - pcfPutINT8(file, format, pFontInfo->noOverlap); - pcfPutINT8(file, format, pFontInfo->constantMetrics); - pcfPutINT8(file, format, pFontInfo->terminalFont); - pcfPutINT8(file, format, pFontInfo->constantWidth); - pcfPutINT8(file, format, pFontInfo->inkInside); - pcfPutINT8(file, format, pFontInfo->inkMetrics); - pcfPutINT8(file, format, pFontInfo->drawDirection); - pcfPutINT8(file, format, 0); - pcfPutINT32(file, format, pFontInfo->fontAscent); - pcfPutINT32(file, format, pFontInfo->fontDescent); - pcfPutINT32(file, format, pFontInfo->maxOverlap); - pcfPutMetric(file, format, &pFontInfo->minbounds); - pcfPutMetric(file, format, &pFontInfo->maxbounds); - if (PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS)) { - pcfPutMetric(file, format, &pFontInfo->ink_minbounds); - pcfPutMetric(file, format, &pFontInfo->ink_maxbounds); - } -} - -#define S32 4 -#define S16 2 -#define S8 1 - -#define Pad(s) (RoundUp(s) - (s)) -#define RoundUp(s) (((s) + 3) & ~3) - -#define Compressable(i) (-128 <= (i) && (i) <= 127) - -#define CanCompressMetric(m) (Compressable((m)->leftSideBearing) && \ - Compressable((m)->rightSideBearing) && \ - Compressable((m)->characterWidth) && \ - Compressable((m)->ascent) && \ - Compressable((m)->descent) && \ - (m)->attributes == 0) - -#define CanCompressMetrics(min,max) (CanCompressMetric(min) && CanCompressMetric(max)) - -static char * -pcfNameForAtom(Atom a) -{ - return NameForAtom(a); -} - -int -pcfWriteFont(FontPtr pFont, FontFilePtr file) -{ - PCFTableRec tables[32], - *table; - CARD32 mask, - bit; - int ntables; - int size; - CARD32 format; - int i; - int cur_table; - int prop_string_size; - int glyph_string_size; - xCharInfo *minbounds, - *maxbounds; - xCharInfo *ink_minbounds, - *ink_maxbounds; - BitmapFontPtr bitmapFont; - int nencodings = 0; - int header_size; - FontPropPtr offsetProps; - int prop_pad = 0; - char *atom_name; - int glyph; - CARD32 offset; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - if (bitmapFont->bitmapExtra) { - minbounds = &bitmapFont->bitmapExtra->info.minbounds; - maxbounds = &bitmapFont->bitmapExtra->info.maxbounds; - ink_minbounds = &bitmapFont->bitmapExtra->info.ink_minbounds; - ink_maxbounds = &bitmapFont->bitmapExtra->info.ink_maxbounds; - } else { - minbounds = &pFont->info.minbounds; - maxbounds = &pFont->info.maxbounds; - ink_minbounds = &pFont->info.ink_minbounds; - ink_maxbounds = &pFont->info.ink_maxbounds; - } - offsetProps = (FontPropPtr) xalloc(pFont->info.nprops * sizeof(FontPropRec)); - if (!offsetProps) { - pcfError("pcfWriteFont(): Couldn't allocate offsetProps (%d*%d)", pFont->info.nprops, sizeof(FontPropRec)); - return AllocError; - } - prop_string_size = 0; - for (i = 0; i < pFont->info.nprops; i++) { - offsetProps[i].name = prop_string_size; - prop_string_size += strlen(pcfNameForAtom(pFont->info.props[i].name)) + 1; - if (pFont->info.isStringProp[i]) { - offsetProps[i].value = prop_string_size; - prop_string_size += strlen(pcfNameForAtom(pFont->info.props[i].value)) + 1; - } else - offsetProps[i].value = pFont->info.props[i].value; - } - format = PCF_FORMAT(pFont->bit, pFont->byte, pFont->glyph, pFont->scan); - mask = 0xFFFFFFF; - ntables = 0; - table = tables; - while (mask) { - bit = lowbit(mask); - mask &= ~bit; - table->type = bit; - switch (bit) { - case PCF_PROPERTIES: - table->format = PCF_DEFAULT_FORMAT | format; - size = S32 + S32 + (S32 + S8 + S32) * pFont->info.nprops; - prop_pad = Pad(size); - table->size = RoundUp(size) + S32 + - RoundUp(prop_string_size); - table++; - break; - case PCF_ACCELERATORS: - if (bitmapFont->bitmapExtra->info.inkMetrics) - table->format = PCF_ACCEL_W_INKBOUNDS | format; - else - table->format = PCF_DEFAULT_FORMAT | format; - table->size = 100; - table++; - break; - case PCF_METRICS: - if (CanCompressMetrics(minbounds, maxbounds)) { - table->format = PCF_COMPRESSED_METRICS | format; - size = S32 + S16 + bitmapFont->num_chars * (5 * S8); - table->size = RoundUp(size); - } else { - table->format = PCF_DEFAULT_FORMAT | format; - table->size = S32 + S32 + bitmapFont->num_chars * (6 * S16); - } - table++; - break; - case PCF_BITMAPS: - table->format = PCF_DEFAULT_FORMAT | format; - size = S32 + S32 + bitmapFont->num_chars * S32 + - GLYPHPADOPTIONS * S32 + - bitmapFont->bitmapExtra->bitmapsSizes[PCF_GLYPH_PAD_INDEX(format)]; - table->size = RoundUp(size); - table++; - break; - case PCF_INK_METRICS: - if (bitmapFont->ink_metrics) { - if (CanCompressMetrics(ink_minbounds, ink_maxbounds)) { - table->format = PCF_COMPRESSED_METRICS | format; - size = S32 + S16 + bitmapFont->num_chars * (5 * S8); - table->size = RoundUp(size); - } else { - table->format = PCF_DEFAULT_FORMAT | format; - table->size = S32 + S32 + bitmapFont->num_chars * (6 * S16); - } - table++; - } - break; - case PCF_BDF_ENCODINGS: - table->format = PCF_DEFAULT_FORMAT | format; - nencodings = (pFont->info.lastRow - pFont->info.firstRow + 1) * - (pFont->info.lastCol - pFont->info.firstCol + 1); - size = S32 + 5 * S16 + nencodings * S16; - table->size = RoundUp(size); - table++; - break; - case PCF_SWIDTHS: - table->format = PCF_DEFAULT_FORMAT | format; - table->size = S32 + S32 + bitmapFont->num_chars * S32; - table++; - break; - case PCF_GLYPH_NAMES: - table->format = PCF_DEFAULT_FORMAT | format; - glyph_string_size = 0; - for (i = 0; i < bitmapFont->num_chars; i++) - glyph_string_size += strlen(pcfNameForAtom(bitmapFont->bitmapExtra->glyphNames[i])) + 1; - table->size = S32 + S32 + bitmapFont->num_chars * S32 + - S32 + RoundUp(glyph_string_size); - table++; - break; - case PCF_BDF_ACCELERATORS: - if (pFont->info.inkMetrics) - table->format = PCF_ACCEL_W_INKBOUNDS | format; - else - table->format = PCF_DEFAULT_FORMAT | format; - table->size = 100; - table++; - break; - } - } - ntables = table - tables; - offset = 0; - header_size = S32 + S32 + ntables * (4 * S32); - offset = header_size; - for (cur_table = 0, table = tables; - cur_table < ntables; - cur_table++, table++) { - table->offset = offset; - offset += table->size; - } - current_position = 0; - pcfWriteTOC(file, tables, ntables); - for (cur_table = 0, table = tables; - cur_table < ntables; - cur_table++, table++) { - if (current_position > table->offset) { - printf("can't go backwards... %d > %d\n", - (int)current_position, (int)table->offset); - xfree(offsetProps); - return BadFontName; - } - while (current_position < table->offset) - pcfPutINT8(file, format, '\0'); - pcfPutLSB32(file, table->format); - switch (table->type) { - case PCF_PROPERTIES: - pcfPutINT32(file, format, pFont->info.nprops); - for (i = 0; i < pFont->info.nprops; i++) { - pcfPutINT32(file, format, offsetProps[i].name); - pcfPutINT8(file, format, pFont->info.isStringProp[i]); - pcfPutINT32(file, format, offsetProps[i].value); - } - for (i = 0; i < prop_pad; i++) - pcfPutINT8(file, format, 0); - pcfPutINT32(file, format, prop_string_size); - for (i = 0; i < pFont->info.nprops; i++) { - atom_name = pcfNameForAtom(pFont->info.props[i].name); - pcfWrite(file, atom_name, strlen(atom_name) + 1); - if (pFont->info.isStringProp[i]) { - atom_name = pcfNameForAtom(pFont->info.props[i].value); - pcfWrite(file, atom_name, strlen(atom_name) + 1); - } - } - break; - case PCF_ACCELERATORS: - pcfPutAccel(file, table->format, &bitmapFont->bitmapExtra->info); - break; - case PCF_METRICS: - if (PCF_FORMAT_MATCH(table->format, PCF_COMPRESSED_METRICS)) { - pcfPutINT16(file, format, bitmapFont->num_chars); - for (i = 0; i < bitmapFont->num_chars; i++) - pcfPutCompressedMetric(file, format, &bitmapFont->metrics[i].metrics); - } else { - pcfPutINT32(file, format, bitmapFont->num_chars); - for (i = 0; i < bitmapFont->num_chars; i++) - pcfPutMetric(file, format, &bitmapFont->metrics[i].metrics); - } - break; - case PCF_BITMAPS: - pcfPutINT32(file, format, bitmapFont->num_chars); - glyph = PCF_GLYPH_PAD(format); - offset = 0; - for (i = 0; i < bitmapFont->num_chars; i++) { - pcfPutINT32(file, format, offset); - offset += BYTES_FOR_GLYPH(&bitmapFont->metrics[i], glyph); - } - for (i = 0; i < GLYPHPADOPTIONS; i++) { - pcfPutINT32(file, format, - bitmapFont->bitmapExtra->bitmapsSizes[i]); - } - for (i = 0; i < bitmapFont->num_chars; i++) - pcfPutBitmap(file, format, &bitmapFont->metrics[i]); - break; - case PCF_INK_METRICS: - if (PCF_FORMAT_MATCH(table->format, PCF_COMPRESSED_METRICS)) { - pcfPutINT16(file, format, bitmapFont->num_chars); - for (i = 0; i < bitmapFont->num_chars; i++) - pcfPutCompressedMetric(file, format, &bitmapFont->ink_metrics[i]); - } else { - pcfPutINT32(file, format, bitmapFont->num_chars); - for (i = 0; i < bitmapFont->num_chars; i++) - pcfPutMetric(file, format, &bitmapFont->ink_metrics[i]); - } - break; - case PCF_BDF_ENCODINGS: - pcfPutINT16(file, format, pFont->info.firstCol); - pcfPutINT16(file, format, pFont->info.lastCol); - pcfPutINT16(file, format, pFont->info.firstRow); - pcfPutINT16(file, format, pFont->info.lastRow); - pcfPutINT16(file, format, pFont->info.defaultCh); - for (i = 0; i < nencodings; i++) { - if (ACCESSENCODING(bitmapFont->encoding,i)) - pcfPutINT16(file, format, - ACCESSENCODING(bitmapFont->encoding, i) - - bitmapFont->metrics); - else - pcfPutINT16(file, format, 0xFFFF); - } - break; - case PCF_SWIDTHS: - pcfPutINT32(file, format, bitmapFont->num_chars); - for (i = 0; i < bitmapFont->num_chars; i++) - pcfPutINT32(file, format, bitmapFont->bitmapExtra->sWidths[i]); - break; - case PCF_GLYPH_NAMES: - pcfPutINT32(file, format, bitmapFont->num_chars); - offset = 0; - for (i = 0; i < bitmapFont->num_chars; i++) { - pcfPutINT32(file, format, offset); - offset += strlen(pcfNameForAtom(bitmapFont->bitmapExtra->glyphNames[i])) + 1; - } - pcfPutINT32(file, format, offset); - for (i = 0; i < bitmapFont->num_chars; i++) { - atom_name = pcfNameForAtom(bitmapFont->bitmapExtra->glyphNames[i]); - pcfWrite(file, atom_name, strlen(atom_name) + 1); - } - break; - case PCF_BDF_ACCELERATORS: - pcfPutAccel(file, table->format, &pFont->info); - break; - } - } - - xfree(offsetProps); - return Successful; -} diff --git a/nx-X11/lib/font/bitmap/snfread.c b/nx-X11/lib/font/bitmap/snfread.c deleted file mode 100644 index 01b6bf382..000000000 --- a/nx-X11/lib/font/bitmap/snfread.c +++ /dev/null @@ -1,514 +0,0 @@ -/* $Xorg: snfread.c,v 1.5 2001/02/09 02:04:02 xorgcvs Exp $ */ -/************************************************************************ -Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ - -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/snfread.c,v 1.12 2003/11/17 22:20:22 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef FONTMODULE -#include -#endif - -#include -#include -#include "snfstr.h" - -#include - -void -snfError(const char* message, ...) -{ - va_list args; - - va_start(args, message); - - fprintf(stderr, "SNF Error: "); - vfprintf(stderr, message, args); - va_end(args); -} - -static void snfUnloadFont(FontPtr pFont); - -static int -snfReadCharInfo(FontFilePtr file, CharInfoPtr charInfo, char *base) -{ - snfCharInfoRec snfCharInfo; - -#define Width(m) ((m).rightSideBearing - (m).leftSideBearing) -#define Height(m) ((m).ascent + (m).descent) - - if (FontFileRead(file, (char *) &snfCharInfo, sizeof snfCharInfo) != - sizeof(snfCharInfo)) { - return BadFontName; - } - charInfo->metrics = snfCharInfo.metrics; - if (snfCharInfo.exists) - charInfo->bits = base + snfCharInfo.byteOffset; - else - charInfo->bits = 0; - return Successful; -} - -static int -snfReadxCharInfo(FontFilePtr file, xCharInfo *charInfo) -{ - snfCharInfoRec snfCharInfo; - - if (FontFileRead(file, (char *) &snfCharInfo, sizeof snfCharInfo) != - sizeof(snfCharInfo)) { - return BadFontName; - } - *charInfo = snfCharInfo.metrics; - return Successful; -} - -static void -snfCopyInfo(snfFontInfoPtr snfInfo, FontInfoPtr pFontInfo) -{ - pFontInfo->firstCol = snfInfo->firstCol; - pFontInfo->lastCol = snfInfo->lastCol; - pFontInfo->firstRow = snfInfo->firstRow; - pFontInfo->lastRow = snfInfo->lastRow; - pFontInfo->defaultCh = snfInfo->chDefault; - pFontInfo->noOverlap = snfInfo->noOverlap; - pFontInfo->terminalFont = snfInfo->terminalFont; - pFontInfo->constantMetrics = snfInfo->constantMetrics; - pFontInfo->constantWidth = snfInfo->constantWidth; - pFontInfo->inkInside = snfInfo->inkInside; - pFontInfo->inkMetrics = snfInfo->inkMetrics; - pFontInfo->allExist = snfInfo->allExist; - pFontInfo->drawDirection = snfInfo->drawDirection; - pFontInfo->anamorphic = FALSE; - pFontInfo->cachable = TRUE; - pFontInfo->maxOverlap = 0; - pFontInfo->minbounds = snfInfo->minbounds.metrics; - pFontInfo->maxbounds = snfInfo->maxbounds.metrics; - pFontInfo->fontAscent = snfInfo->fontAscent; - pFontInfo->fontDescent = snfInfo->fontDescent; - pFontInfo->nprops = snfInfo->nProps; -} - -static int -snfReadProps(snfFontInfoPtr snfInfo, FontInfoPtr pFontInfo, FontFilePtr file) -{ - char *strings; - FontPropPtr pfp; - snfFontPropPtr psnfp; - char *propspace; - int bytestoalloc; - int i; - - bytestoalloc = snfInfo->nProps * sizeof(snfFontPropRec) + - BYTESOFSTRINGINFO(snfInfo); - propspace = (char *) xalloc(bytestoalloc); - if (!propspace) { - snfError("snfReadProps(): Couldn't allocate propspace (%d)\n", bytestoalloc); - return AllocError; - } - - if (FontFileRead(file, propspace, bytestoalloc) != bytestoalloc) { - xfree(propspace); - return BadFontName; - } - psnfp = (snfFontPropPtr) propspace; - - strings = propspace + BYTESOFPROPINFO(snfInfo); - - for (i = 0, pfp = pFontInfo->props; i < snfInfo->nProps; i++, pfp++, psnfp++) { - pfp->name = MakeAtom(&strings[psnfp->name], - (unsigned) strlen(&strings[psnfp->name]), 1); - pFontInfo->isStringProp[i] = psnfp->indirect; - if (psnfp->indirect) - pfp->value = (INT32) MakeAtom(&strings[psnfp->value], - (unsigned) strlen(&strings[psnfp->value]), 1); - else - pfp->value = psnfp->value; - } - - xfree(propspace); - return Successful; -} - -static int -snfReadHeader(snfFontInfoPtr snfInfo, FontFilePtr file) -{ - if (FontFileRead(file, (char *) snfInfo, sizeof *snfInfo) != sizeof *snfInfo) - return BadFontName; - - if (snfInfo->version1 != FONT_FILE_VERSION || - snfInfo->version2 != FONT_FILE_VERSION) - return BadFontName; - return Successful; -} - -static int snf_set; -static int snf_bit, snf_byte, snf_glyph, snf_scan; - -void -SnfSetFormat (int bit, int byte, int glyph, int scan) -{ - snf_bit = bit; - snf_byte = byte; - snf_glyph = glyph; - snf_scan = scan; - snf_set = 1; -} - -static void -SnfGetFormat (int *bit, int *byte, int *glyph, int *scan) -{ - if (!snf_set) - FontDefaultFormat (&snf_bit, &snf_byte, &snf_glyph, &snf_scan); - *bit = snf_bit; - *byte = snf_byte; - *glyph = snf_glyph; - *scan = snf_scan; -} - -int -snfReadFont(FontPtr pFont, FontFilePtr file, - int bit, int byte, int glyph, int scan) -{ - snfFontInfoRec fi; - unsigned bytestoalloc; - int i, j; - char *fontspace; - BitmapFontPtr bitmapFont; - int num_chars; - int bitmapsSize; - int ret; - int metrics_off; - int encoding_off; - int props_off; - int isStringProp_off; - int ink_off; - char *bitmaps; - int def_bit, def_byte, def_glyph, def_scan; - - ret = snfReadHeader(&fi, file); - if (ret != Successful) - return ret; - - SnfGetFormat (&def_bit, &def_byte, &def_glyph, &def_scan); - - /* - * we'll allocate one chunk of memory and split it among the various parts - * of the font: - * - * BitmapFontRec CharInfoRec's Glyphs Encoding DIX Properties Ink CharInfoRec's - * - * If the glyphpad is not the same as the font file, then the glyphs - * are allocated separately, to be later realloc'ed when we know - * how big to make them. - */ - - bitmapsSize = BYTESOFGLYPHINFO(&fi); - num_chars = n2dChars(&fi); - bytestoalloc = sizeof(BitmapFontRec); /* bitmapFont */ - metrics_off = bytestoalloc; - bytestoalloc += num_chars * sizeof(CharInfoRec); /* metrics */ - encoding_off = bytestoalloc; - bytestoalloc += NUM_SEGMENTS(num_chars) * sizeof(CharInfoPtr**); - /* encoding */ - props_off = bytestoalloc; - bytestoalloc += fi.nProps * sizeof(FontPropRec); /* props */ - isStringProp_off = bytestoalloc; - bytestoalloc += fi.nProps * sizeof(char); /* isStringProp */ - bytestoalloc = (bytestoalloc + 3) & ~3; - ink_off = bytestoalloc; - if (fi.inkMetrics) - bytestoalloc += num_chars * sizeof(xCharInfo); /* ink_metrics */ - - fontspace = (char *) xalloc(bytestoalloc); - if (!fontspace) { - snfError("snfReadFont(): Couldn't allocate fontspace (%d)\n", bytestoalloc); - return AllocError; - } - bitmaps = (char *) xalloc (bitmapsSize); - if (!bitmaps) - { - snfError("snfReadFont(): Couldn't allocate bitmaps (%d)\n", bitmapsSize); - xfree (fontspace); - return AllocError; - } - /* - * now fix up pointers - */ - - bitmapFont = (BitmapFontPtr) fontspace; - bitmapFont->num_chars = num_chars; - bitmapFont->metrics = (CharInfoPtr) (fontspace + metrics_off); - bitmapFont->encoding = (CharInfoPtr **) (fontspace + encoding_off); - bitmapFont->bitmaps = bitmaps; - bitmapFont->pDefault = NULL; - bitmapFont->bitmapExtra = NULL; - pFont->info.props = (FontPropPtr) (fontspace + props_off); - pFont->info.isStringProp = (char *) (fontspace + isStringProp_off); - if (fi.inkMetrics) - bitmapFont->ink_metrics = (xCharInfo *) (fontspace + ink_off); - else - bitmapFont->ink_metrics = 0; - - /* - * read the CharInfo - */ - - ret = Successful; - memset(bitmapFont->encoding, 0, - NUM_SEGMENTS(num_chars)*sizeof(CharInfoPtr*)); - for (i = 0; ret == Successful && i < num_chars; i++) { - ret = snfReadCharInfo(file, &bitmapFont->metrics[i], bitmaps); - if (bitmapFont->metrics[i].bits) { - if (!bitmapFont->encoding[SEGMENT_MAJOR(i)]) { - bitmapFont->encoding[SEGMENT_MAJOR(i)]= - (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE, - sizeof(CharInfoPtr)); - if (!bitmapFont->encoding[SEGMENT_MAJOR(i)]) { - ret = AllocError; - break; - } - } - ACCESSENCODINGL(bitmapFont->encoding,i) = &bitmapFont->metrics[i]; - } - } - - if (ret != Successful) { - xfree(bitmaps); - if(bitmapFont->encoding) { - for(j=0; jencoding[i]); - } - xfree(fontspace); - return ret; - } - /* - * read the glyphs - */ - - if (FontFileRead(file, bitmaps, bitmapsSize) != bitmapsSize) { - xfree(bitmaps); - xfree(fontspace); - return BadFontName; - } - - if (def_bit != bit) - BitOrderInvert((unsigned char *)bitmaps, bitmapsSize); - if ((def_byte == def_bit) != (bit == byte)) { - switch (bit == byte ? def_scan : scan) { - case 1: - break; - case 2: - TwoByteSwap((unsigned char *)bitmaps, bitmapsSize); - break; - case 4: - FourByteSwap((unsigned char *)bitmaps, bitmapsSize); - break; - } - } - if (def_glyph != glyph) { - char *padbitmaps; - int sizepadbitmaps; - int sizechar; - CharInfoPtr metric; - - sizepadbitmaps = 0; - metric = bitmapFont->metrics; - for (i = 0; i < num_chars; i++) - { - if (metric->bits) - sizepadbitmaps += BYTES_FOR_GLYPH(metric,glyph); - metric++; - } - padbitmaps = (char *) xalloc(sizepadbitmaps); - if (!padbitmaps) { - snfError("snfReadFont(): Couldn't allocate padbitmaps (%d)\n", sizepadbitmaps); - xfree (bitmaps); - xfree (fontspace); - return AllocError; - } - metric = bitmapFont->metrics; - bitmapFont->bitmaps = padbitmaps; - for (i = 0; i < num_chars; i++) { - sizechar = RepadBitmap(metric->bits, padbitmaps, - def_glyph, glyph, - metric->metrics.rightSideBearing - - metric->metrics.leftSideBearing, - metric->metrics.ascent + metric->metrics.descent); - metric->bits = padbitmaps; - padbitmaps += sizechar; - metric++; - } - xfree(bitmaps); - } - - /* now read and atom'ize properties */ - - ret = snfReadProps(&fi, &pFont->info, file); - if (ret != Successful) { - xfree(fontspace); - return ret; - } - snfCopyInfo(&fi, &pFont->info); - - /* finally, read the ink metrics if the exist */ - - if (fi.inkMetrics) { - ret = Successful; - ret = snfReadxCharInfo(file, &pFont->info.ink_minbounds); - ret = snfReadxCharInfo(file, &pFont->info.ink_maxbounds); - for (i = 0; ret == Successful && i < num_chars; i++) - ret = snfReadxCharInfo(file, &bitmapFont->ink_metrics[i]); - if (ret != Successful) { - xfree(fontspace); - return ret; - } - } else { - pFont->info.ink_minbounds = pFont->info.minbounds; - pFont->info.ink_maxbounds = pFont->info.maxbounds; - } - - if (pFont->info.defaultCh != (unsigned short) NO_SUCH_CHAR) { - unsigned int r, - c, - cols; - - r = pFont->info.defaultCh >> 8; - c = pFont->info.defaultCh & 0xFF; - if (pFont->info.firstRow <= r && r <= pFont->info.lastRow && - pFont->info.firstCol <= c && c <= pFont->info.lastCol) { - cols = pFont->info.lastCol - pFont->info.firstCol + 1; - r = r - pFont->info.firstRow; - c = c - pFont->info.firstCol; - bitmapFont->pDefault = &bitmapFont->metrics[r * cols + c]; - } - } - bitmapFont->bitmapExtra = (BitmapExtraPtr) 0; - pFont->fontPrivate = (pointer) bitmapFont; - pFont->get_glyphs = bitmapGetGlyphs; - pFont->get_metrics = bitmapGetMetrics; - pFont->unload_font = snfUnloadFont; - pFont->unload_glyphs = NULL; - pFont->bit = bit; - pFont->byte = byte; - pFont->glyph = glyph; - pFont->scan = scan; - return Successful; -} - -int -snfReadFontInfo(FontInfoPtr pFontInfo, FontFilePtr file) -{ - int ret; - snfFontInfoRec fi; - int bytestoskip; - int num_chars; - - ret = snfReadHeader(&fi, file); - if (ret != Successful) - return ret; - snfCopyInfo(&fi, pFontInfo); - - pFontInfo->props = (FontPropPtr) xalloc(fi.nProps * sizeof(FontPropRec)); - if (!pFontInfo->props) { - snfError("snfReadFontInfo(): Couldn't allocate props (%d*%d)\n", fi.nProps, sizeof(FontPropRec)); - return AllocError; - } - pFontInfo->isStringProp = (char *) xalloc(fi.nProps * sizeof(char)); - if (!pFontInfo->isStringProp) { - snfError("snfReadFontInfo(): Couldn't allocate isStringProp (%d*%d)\n", fi.nProps, sizeof(char)); - xfree(pFontInfo->props); - return AllocError; - } - num_chars = n2dChars(&fi); - bytestoskip = num_chars * sizeof(snfCharInfoRec); /* charinfos */ - bytestoskip += BYTESOFGLYPHINFO(&fi); - (void)FontFileSkip(file, bytestoskip); - - ret = snfReadProps(&fi, pFontInfo, file); - if (ret != Successful) { - xfree(pFontInfo->props); - xfree(pFontInfo->isStringProp); - return ret; - } - if (fi.inkMetrics) { - ret = snfReadxCharInfo(file, &pFontInfo->ink_minbounds); - if (ret != Successful) { - xfree(pFontInfo->props); - xfree(pFontInfo->isStringProp); - return ret; - } - ret = snfReadxCharInfo(file, &pFontInfo->ink_maxbounds); - if (ret != Successful) { - xfree(pFontInfo->props); - xfree(pFontInfo->isStringProp); - return ret; - } - } else { - pFontInfo->ink_minbounds = pFontInfo->minbounds; - pFontInfo->ink_maxbounds = pFontInfo->maxbounds; - } - return Successful; - -} - -static void -snfUnloadFont(FontPtr pFont) -{ - BitmapFontPtr bitmapFont; - - bitmapFont = (BitmapFontPtr) pFont->fontPrivate; - xfree (bitmapFont->bitmaps); - xfree (bitmapFont); - DestroyFontRec (pFont); -} - diff --git a/nx-X11/lib/font/bitmap/snfstr.h b/nx-X11/lib/font/bitmap/snfstr.h deleted file mode 100644 index 8158089bf..000000000 --- a/nx-X11/lib/font/bitmap/snfstr.h +++ /dev/null @@ -1,185 +0,0 @@ -/* $Xorg: snfstr.h,v 1.4 2001/02/09 02:04:02 xorgcvs 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. - -******************************************************************/ - -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/bitmap/snfstr.h,v 1.5 2001/12/14 19:56:47 dawes Exp $ */ - -#ifndef SNFSTR_H -#define SNFSTR_H 1 - -#include - -/*- - * This file describes the Server Natural Font format. - * SNF fonts are both CPU-dependent and frame buffer bit order dependent. - * This file is used by: - * 1) the server, to hold font information read out of font files. - * 2) font converters - * - * Each font file contains the following - * data structures, with no padding in-between. - * - * 1) The XFONTINFO structure - * hand-padded to a two-short boundary. - * maxbounds.byteoffset is the total number of bytes in the - * glpyh array - * maxbounds.bitOffset is thetotal width of the unpadded font - * - * 2) The XCHARINFO array - * indexed directly with character codes, both on disk - * and in memory. - * - * 3) Character glyphs - * padded in the server-natural way, and - * ordered in the device-natural way. - * End of glyphs padded to 32-bit boundary. - * - * 4) nProps font properties - * - * 5) a sequence of null-terminated strings, for font properties - */ - -#define FONT_FILE_VERSION 4 - -typedef struct _snfFontProp { - CARD32 name; /* offset of string */ - INT32 value; /* number or offset of string */ - Bool indirect; /* value is a string offset */ -} snfFontPropRec; - -/* - * the following macro definitions describe a font file image in memory - */ -#define ADDRCharInfoRec( pfi) \ - ((snfCharInfoRec *) &(pfi)[1]) - -#define ADDRCHARGLYPHS( pfi) \ - (((char *) &(pfi)[1]) + BYTESOFCHARINFO(pfi)) - -/* - * pad out glyphs to a CARD32 boundary - */ -#define ADDRXFONTPROPS( pfi) \ - ((snfFontPropRec *) ((char *)ADDRCHARGLYPHS( pfi) + BYTESOFGLYPHINFO(pfi))) - -#define ADDRSTRINGTAB( pfi) \ - ((char *)ADDRXFONTPROPS( pfi) + BYTESOFPROPINFO(pfi)) - -#define n2dChars(pfi) (((pfi)->lastRow - (pfi)->firstRow + 1) * \ - ((pfi)->lastCol - (pfi)->firstCol + 1)) -#define BYTESOFFONTINFO(pfi) (sizeof(snfFontInfoRec)) -#define BYTESOFCHARINFO(pfi) (sizeof(snfCharInfoRec) * n2dChars(pfi)) -#define BYTESOFPROPINFO(pfi) (sizeof(snfFontPropRec) * (pfi)->nProps) -#define BYTESOFSTRINGINFO(pfi) ((pfi)->lenStrings) -#define BYTESOFGLYPHINFO(pfi) (((pfi)->maxbounds.byteOffset+3) & ~0x3) -#define BYTESOFINKINFO(pfi) (sizeof(snfCharInfoRec) * n2dChars(pfi)) - -typedef struct _snfFontProp *snfFontPropPtr; -typedef struct _snfCharInfo *snfCharInfoPtr; -typedef struct _snfFontInfo *snfFontInfoPtr; - -typedef struct _snfCharInfo { - xCharInfo metrics; /* info preformatted for Queries */ - unsigned byteOffset:24; /* byte offset of the raster from pGlyphs */ - unsigned exists:1; /* true iff glyph exists for this char */ - unsigned pad:7; /* must be zero for now */ -} snfCharInfoRec; - -typedef struct _snfFontInfo { - unsigned int version1; /* version stamp */ - unsigned int allExist; - unsigned int drawDirection; - unsigned int noOverlap; /* true if: - * max(rightSideBearing-characterWidth) <= - * minbounds->metrics.leftSideBearing */ - unsigned int constantMetrics; - unsigned int terminalFont; /* Should be deprecated! true if: constant - * metrics && leftSideBearing == 0 && - * rightSideBearing == characterWidth && - * ascent == fontAscent && descent == - * fontDescent */ - unsigned int linear:1; /* true if firstRow == lastRow */ - unsigned int constantWidth:1; /* true if - * minbounds->metrics.characterWidth - * == - * maxbounds->metrics.characterWidth */ - unsigned int inkInside:1; /* true if for all defined glyphs: - * leftSideBearing >= 0 && rightSideBearing <= - * characterWidth && -fontDescent <= ascent <= - * fontAscent && -fontAscent <= descent <= - * fontDescent */ - unsigned int inkMetrics:1; /* ink metrics != bitmap metrics */ - /* used with terminalFont */ - /* see font's pInk{CI,Min,Max} */ - unsigned int padding:28; - unsigned int firstCol; - unsigned int lastCol; - unsigned int firstRow; - unsigned int lastRow; - unsigned int nProps; - unsigned int lenStrings; /* length in bytes of string table */ - unsigned int chDefault; /* default character */ - int fontDescent; /* minimum for quality typography */ - int fontAscent; /* minimum for quality typography */ - snfCharInfoRec minbounds; /* MIN of glyph metrics over all chars */ - snfCharInfoRec maxbounds; /* MAX of glyph metrics over all chars */ - unsigned int pixDepth; /* intensity bits per pixel */ - unsigned int glyphSets; /* number of sets of glyphs, for sub-pixel - * positioning */ - unsigned int version2; /* version stamp double-check */ -} snfFontInfoRec; - -extern void SnfSetFormat ( int bit, int byte, int glyph, int scan ); -extern int snfReadFont ( FontPtr pFont, FontFilePtr file, - int bit, int byte, int glyph, int scan ); -extern int snfReadFontInfo ( FontInfoPtr pFontInfo, FontFilePtr file ); -extern void snfError( const char* message, ... ); - -#endif /* SNFSTR_H */ diff --git a/nx-X11/lib/font/builtins/Imakefile b/nx-X11/lib/font/builtins/Imakefile deleted file mode 100644 index f70434865..000000000 --- a/nx-X11/lib/font/builtins/Imakefile +++ /dev/null @@ -1,17 +0,0 @@ -XCOMM $XFree86: xc/lib/font/builtins/Imakefile,v 1.2 1999/11/19 14:59:08 hohndel Exp $ -XCOMM -XCOMM -XCOMM $XConsortium: Imakefile /main/14 1996/11/03 19:58:41 kaleb $ -#include - - INCLUDES = -I$(FONTINCSRC) -I../include -I$(SERVERSRC)/include - HEADERS = - - SRCS = dir.c file.c fonts.c fpe.c render.c - OBJS = dir.o file.o fonts.o fpe.o render.o - -SubdirLibraryRule($(OBJS)) -NormalLibraryObjectRule() -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/font/builtins/buildfont b/nx-X11/lib/font/builtins/buildfont deleted file mode 100644 index aa4602ff8..000000000 --- a/nx-X11/lib/font/builtins/buildfont +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# Convert a bdf file into C-code suitable for inclusion in -# builtin fonts -# -FONT=$1 -NAME=$2 -echo 'static const char file_'$NAME'[] = {' -bdftopcf -p1 -u1 $1 | - compress -b 12 | - od -b -v -w8 | - sed 's/^[0-9]*\( *\)/\1\1\1\1/' | - sed 's/\([0-9][0-9]*\)/'"'"'\\\1'"'"',/g' -echo '};' diff --git a/nx-X11/lib/font/builtins/builtin.h b/nx-X11/lib/font/builtins/builtin.h deleted file mode 100644 index ea98407eb..000000000 --- a/nx-X11/lib/font/builtins/builtin.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Id: builtin.h,v 1.2 1999/11/02 06:16:47 keithp Exp $ - * - * Copyright 1999 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ -/* $XFree86: xc/lib/font/builtins/builtin.h,v 1.3 1999/12/30 02:29:49 robin Exp $ */ - -#include -#include -#include -#include -#include -#include - -typedef struct _BuiltinFile { - const char *name; - int len; - const char *bits; -} BuiltinFileRec, *BuiltinFilePtr; - -typedef struct _BuiltinDir { - char *file_name; - char *font_name; -} BuiltinDirRec, *BuiltinDirPtr; - -typedef struct _BuiltinAlias { - char *alias_name; - char *font_name; -} BuiltinAliasRec, *BuiltinAliasPtr; - -extern const BuiltinFileRec builtin_files[]; -extern const int builtin_files_count; - -extern const BuiltinDirRec builtin_dir[]; -extern const int builtin_dir_count; - -extern const BuiltinAliasRec builtin_alias[]; -extern const int builtin_alias_count; - -extern FontFilePtr BuiltinFileOpen (); -extern int BuiltinFileClose (); diff --git a/nx-X11/lib/font/builtins/dir.c b/nx-X11/lib/font/builtins/dir.c deleted file mode 100644 index fb2f82c41..000000000 --- a/nx-X11/lib/font/builtins/dir.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Id: dir.c,v 1.2 1999/11/02 06:16:47 keithp Exp $ - * - * Copyright 1999 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ -/* $XFree86: xc/lib/font/builtins/dir.c,v 1.3 1999/12/30 02:29:49 robin Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "builtin.h" - -int -BuiltinReadDirectory (directory, pdir) - char *directory; - FontDirectoryPtr *pdir; -{ - FontDirectoryPtr dir; - int i; - - dir = FontFileMakeDir ("", builtin_dir_count); - for (i = 0; i < builtin_dir_count; i++) - { - if (!FontFileAddFontFile (dir, - (char *) builtin_dir[i].font_name, - (char *) builtin_dir[i].file_name)) - { - FontFileFreeDir (dir); - return BadFontPath; - } - } - for (i = 0; i < builtin_alias_count; i++) - { - if (!FontFileAddFontAlias (dir, - (char *) builtin_alias[i].alias_name, - (char *) builtin_alias[i].font_name)) - { - FontFileFreeDir (dir); - return BadFontPath; - } - } - FontFileSortDir (dir); - *pdir = dir; - return Successful; -} diff --git a/nx-X11/lib/font/builtins/file.c b/nx-X11/lib/font/builtins/file.c deleted file mode 100644 index 024c35343..000000000 --- a/nx-X11/lib/font/builtins/file.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Id: file.c,v 1.2 1999/11/02 06:16:47 keithp Exp $ - * - * Copyright 1999 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ -/* $XFree86: xc/lib/font/builtins/file.c,v 1.3 1999/12/30 02:29:49 robin Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "builtin.h" - -typedef struct _BuiltinIO { - int offset; - BuiltinFilePtr file; -} BuiltinIORec, *BuiltinIOPtr; - -static int -BuiltinFill (f) - BufFilePtr f; -{ - int left, len; - BuiltinIOPtr io = ((BuiltinIOPtr) f->private); - - left = io->file->len - io->offset; - if (left <= 0) - { - f->left = 0; - return BUFFILEEOF; - } - len = BUFFILESIZE; - if (len > left) - len = left; - bcopy (io->file->bits + io->offset, f->buffer, len); - io->offset += len; - f->left = len - 1; - f->bufp = f->buffer + 1; - return f->buffer[0]; -} - -static int -BuiltinSkip (f, count) - BufFilePtr f; - int count; -{ - BuiltinIOPtr io = ((BuiltinIOPtr) f->private); - int curoff; - int fileoff; - int todo; - int left; - - curoff = f->bufp - f->buffer; - fileoff = curoff + f->left; - if (curoff + count <= fileoff) { - f->bufp += count; - f->left -= count; - } else { - todo = count - (fileoff - curoff); - io->offset += todo; - if (io->offset > io->file->len) - io->offset = io->file->len; - if (io->offset < 0) - io->offset = 0; - f->left = 0; - } - return count; -} - -static int -BuiltinClose (f, doClose) - BufFilePtr f; -{ - BuiltinIOPtr io = ((BuiltinIOPtr) f->private); - - xfree (io); - return 1; -} - - -FontFilePtr -BuiltinFileOpen (name) - char *name; -{ - int i; - BuiltinIOPtr io; - BufFilePtr raw, cooked; - - if (*name == '/') name++; - for (i = 0; i < builtin_files_count; i++) - if (!strcmp (name, builtin_files[i].name)) - break; - if (i == builtin_files_count) - return NULL; - io = (BuiltinIOPtr) xalloc (sizeof (BuiltinIORec)); - if (!io) - return NULL; - io->offset = 0; - io->file = (void *) &builtin_files[i]; - raw = BufFileCreate ((char *) io, BuiltinFill, 0, BuiltinSkip, BuiltinClose); - if (!raw) - { - xfree (io); - return NULL; - } - if (cooked = BufFilePushCompressed (raw)) - raw = cooked; - else - { - raw->left += raw->bufp - raw->buffer; - raw->bufp = raw->buffer; - } - return (FontFilePtr) raw; -} - -int -BuiltinFileClose (f) - FontFilePtr f; -{ - return BufFileClose ((BufFilePtr) f, TRUE); -} diff --git a/nx-X11/lib/font/builtins/fonts.c b/nx-X11/lib/font/builtins/fonts.c deleted file mode 100644 index 30c762f7f..000000000 --- a/nx-X11/lib/font/builtins/fonts.c +++ /dev/null @@ -1,2438 +0,0 @@ -/* - * Id: fonts.c,v 1.2 1999/11/02 06:16:47 keithp Exp $ - * - * Copyright 1999 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ -/* $XFree86: xc/lib/font/builtins/fonts.c,v 1.3 1999/12/30 02:29:49 robin Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "builtin.h" - -static const char file_6x13[] = { - '\037', '\235', '\214', '\001', '\314', '\214', '\201', '\223', - '\000', '\200', '\301', '\000', '\006', '\023', '\032', '\244', - '\042', '\300', '\040', '\246', '\204', '\015', '\023', '\042', - '\004', '\100', '\046', '\041', '\273', '\210', '\004', '\024', - '\116', '\104', '\223', '\021', '\000', '\224', '\001', '\006', - '\021', '\050', '\114', '\210', '\317', '\201', '\101', '\134', - '\007', '\014', '\102', '\320', '\150', '\220', '\243', '\101', - '\130', '\026', '\014', '\202', '\030', '\251', '\062', '\042', - '\206', '\015', '\006', '\201', '\320', '\004', '\200', '\010', - '\044', '\000', '\024', '\035', '\014', '\002', '\332', '\211', - '\104', '\044', '\000', '\130', '\063', '\017', '\112', '\064', - '\130', '\321', '\040', '\076', '\024', '\064', '\053', '\354', - '\014', '\040', '\041', '\341', '\004', '\211', '\070', '\145', - '\112', '\144', '\221', '\120', '\206', '\104', '\037', '\011', - '\213', '\110', '\134', '\222', '\260', '\211', '\304', '\055', - '\011', '\323', '\110', '\304', '\223', '\060', '\217', '\302', - '\006', '\011', '\011', '\051', '\144', '\153', '\360', '\221', - '\102', '\262', '\006', '\071', '\335', '\115', '\230', '\112', - '\142', '\254', '\204', '\263', '\024', '\362', '\110', '\030', - '\114', '\242', '\264', '\204', '\332', '\044', '\256', '\113', - '\330', '\116', '\342', '\275', '\204', '\035', '\046', '\006', - '\020', '\061', '\121', '\314', '\104', '\000', '\012', '\322', - '\136', '\136', '\223', '\220', '\316', '\345', '\005', '\011', - '\373', '\134', '\066', '\100', '\023', '\321', '\104', '\043', - '\117', '\234', '\120', '\161', '\022', '\244', '\111', '\221', - '\057', '\122', '\212', '\034', '\111', '\062', '\205', '\212', - '\224', '\054', '\006', '\121', '\127', '\161', '\102', '\344', - '\066', '\200', '\046', '\151', '\346', '\214', '\001', '\140', - '\244', '\165', '\022', '\046', '\131', '\276', '\260', '\166', - '\115', '\074', '\015', '\236', '\062', '\025', '\257', '\024', - '\111', '\162', '\004', '\011', '\025', '\345', '\255', '\305', - '\066', '\201', '\236', '\246', '\116', '\033', '\000', '\123', - '\230', '\004', '\121', '\015', '\100', '\012', '\370', '\042', - '\124', '\256', '\044', '\041', '\102', '\005', '\011', '\166', - '\346', '\123', '\312', '\264', '\111', '\063', '\344', '\215', - '\033', '\062', '\145', '\334', '\314', '\201', '\016', '\040', - '\010', '\021', '\042', '\137', '\324', '\226', '\005', '\023', - '\257', '\055', '\047', '\226', '\107', '\111', '\140', '\121', - '\004', '\023', '\001', '\046', '\241', '\205', '\130', '\120', - '\074', '\221', '\204', '\152', '\015', '\076', '\130', '\136', - '\021', '\123', '\074', '\301', '\104', '\025', '\124', '\044', - '\221', '\332', '\027', '\130', '\134', '\230', '\341', '\206', - '\035', '\176', '\210', '\333', '\024', '\120', '\004', '\061', - '\304', '\204', '\107', '\000', '\060', '\104', '\177', '\126', - '\024', '\041', '\105', '\020', '\107', '\274', '\246', '\036', - '\173', '\110', '\270', '\210', '\104', '\020', '\122', '\114', - '\201', '\036', '\154', '\262', '\321', '\146', '\033', '\156', - '\264', '\075', '\201', '\003', '\016', '\065', '\344', '\240', - '\043', '\217', '\076', '\136', '\127', '\204', '\023', '\103', - '\074', '\101', '\004', '\213', '\000', '\304', '\340', '\342', - '\023', '\120', '\144', '\041', '\005', '\165', '\326', '\171', - '\124', '\207', '\030', '\154', '\244', '\061', '\006', '\010', - '\144', '\274', '\321', '\106', '\030', '\151', '\270', '\001', - '\202', '\031', '\366', '\321', '\341', '\002', '\010', '\040', - '\114', '\201', '\106', '\030', '\162', '\224', '\001', '\102', - '\030', '\367', '\201', '\220', '\237', '\032', '\157', '\344', - '\341', '\002', '\161', '\251', '\121', '\001', '\100', '\013', - '\300', '\011', '\327', '\202', '\021', '\316', '\101', '\107', - '\050', '\167', '\336', '\265', '\040', '\105', '\013', '\361', - '\315', '\127', '\337', '\175', '\371', '\355', '\107', '\106', - '\013', '\055', '\304', '\060', '\103', '\246', '\062', '\300', - '\320', '\302', '\015', '\065', '\174', '\032', '\352', '\020', - '\055', '\330', '\340', '\151', '\221', '\107', '\046', '\231', - '\051', '\000', '\322', '\161', '\051', '\150', '\154', '\043', - '\162', '\350', '\241', '\023', '\000', '\140', '\361', '\005', - '\022', '\323', '\125', '\047', '\150', '\024', '\125', '\370', - '\367', '\305', '\215', '\355', '\051', '\005', '\100', '\000', - '\304', '\026', '\153', '\020', '\150', '\006', '\105', '\264', - '\023', '\151', '\244', '\201', '\246', '\254', '\101', '\314', - '\002', '\340', '\354', '\262', '\044', '\375', '\223', '\054', - '\000', '\321', '\116', '\273', '\323', '\266', '\334', '\116', - '\145', '\020', '\070', '\000', '\000', '\142', '\210', '\041', - '\213', '\010', '\042', '\056', '\271', '\346', '\216', '\133', - '\356', '\271', '\353', '\252', '\233', '\056', '\272', '\354', - '\276', '\333', '\056', '\274', '\356', '\306', '\153', '\157', - '\275', '\370', '\322', '\253', '\357', '\274', '\374', '\312', - '\353', '\357', '\275', '\373', '\376', '\233', '\157', '\277', - '\000', '\023', '\074', '\260', '\300', '\001', '\027', '\214', - '\260', '\301', '\011', '\037', '\254', '\360', '\303', '\016', - '\107', '\334', '\360', '\304', '\014', '\127', '\274', '\360', - '\305', '\020', '\123', '\214', '\261', '\304', '\026', '\147', - '\334', '\061', '\307', '\033', '\153', '\354', '\161', '\310', - '\037', '\213', '\014', '\362', '\310', '\050', '\237', '\254', - '\262', '\311', '\054', '\227', '\354', '\062', '\311', '\060', - '\247', '\334', '\162', '\314', '\053', '\277', '\054', '\263', - '\315', '\065', '\323', '\074', '\363', '\315', '\072', '\343', - '\274', '\163', '\316', '\074', '\007', '\015', '\364', '\320', - '\077', '\027', '\355', '\363', '\321', '\376', '\322', '\004', - '\056', '\115', '\160', '\031', '\244', '\101', '\102', '\047', - '\044', '\104', '\103', '\102', '\101', '\044', '\104', '\253', - '\101', '\150', '\265', '\224', '\120', '\035', '\011', '\011', - '\222', '\220', '\135', '\171', '\361', '\225', '\220', '\055', - '\011', '\015', '\223', '\020', '\064', '\011', '\165', '\223', - '\220', '\072', '\011', '\075', '\146', '\020', '\001', '\023', - '\105', '\060', '\221', '\007', '\023', '\255', '\060', '\021', - '\016', '\023', '\025', '\061', '\221', '\024', '\023', '\175', - '\061', '\021', '\033', '\023', '\345', '\061', '\221', '\041', - '\023', '\115', '\062', '\021', '\050', '\023', '\265', '\062', - '\221', '\056', '\023', '\035', '\063', '\021', '\065', '\023', - '\205', '\063', '\221', '\073', '\023', '\355', '\063', '\021', - '\002', '\021', '\125', '\020', '\221', '\010', '\021', '\275', - '\020', '\021', '\017', '\021', '\045', '\021', '\221', '\025', - '\021', '\215', '\021', '\021', '\034', '\021', '\365', '\021', - '\221', '\042', '\021', '\135', '\022', '\021', '\051', '\021', - '\305', '\022', '\221', '\057', '\021', '\055', '\023', '\021', - '\066', '\021', '\225', '\023', '\221', '\074', '\021', '\375', - '\023', '\021', '\003', '\076', '\145', '\340', '\223', '\011', - '\076', '\315', '\340', '\023', '\020', '\076', '\065', '\341', - '\223', '\026', '\076', '\235', '\341', '\023', '\035', '\076', - '\005', '\342', '\223', '\043', '\076', '\155', '\342', '\023', - '\052', '\076', '\325', '\342', '\223', '\060', '\076', '\075', - '\343', '\023', '\067', '\076', '\245', '\343', '\223', '\075', - '\076', '\015', '\320', '\021', '\004', '\035', '\165', '\320', - '\221', '\012', '\035', '\335', '\320', '\021', '\021', '\035', - '\105', '\321', '\221', '\027', '\035', '\255', '\321', '\021', - '\036', '\035', '\025', '\322', '\221', '\044', '\035', '\175', - '\322', '\021', '\053', '\035', '\311', '\105', '\107', '\214', - '\321', '\221', '\151', '\164', '\004', '\034', '\035', '\151', - '\107', '\107', '\364', '\321', '\221', '\003', '\024', '\300', - '\040', '\024', '\170', '\040', '\000', '\102', '\040', '\101', - '\027', '\110', '\160', '\007', '\022', '\104', '\202', '\004', - '\253', '\040', '\101', '\061', '\110', '\360', '\015', '\022', - '\344', '\203', '\004', '\023', '\041', '\101', '\113', '\110', - '\160', '\024', '\022', '\204', '\205', '\004', '\173', '\041', - '\101', '\145', '\110', '\360', '\032', '\022', '\044', '\207', - '\004', '\343', '\041', '\101', '\177', '\110', '\160', '\001', - '\244', '\001', '\000', '\006', '\162', '\130', '\202', '\034', - '\312', '\040', '\207', '\077', '\310', '\041', '\023', '\162', - '\230', '\205', '\034', '\232', '\041', '\207', '\163', '\310', - '\041', '\040', '\162', '\330', '\210', '\034', '\152', '\042', - '\207', '\247', '\310', '\041', '\055', '\162', '\030', '\214', - '\034', '\072', '\043', '\207', '\333', '\310', '\041', '\072', - '\162', '\130', '\217', '\034', '\012', '\040', '\045', '\000', - '\170', '\000', '\030', '\071', '\000', '\306', '\024', '\200', - '\321', '\006', '\140', '\034', '\002', '\030', '\241', '\000', - '\306', '\056', '\200', '\121', '\015', '\140', '\274', '\003', - '\030', '\011', '\001', '\306', '\110', '\200', '\321', '\023', - '\140', '\134', '\005', '\030', '\121', '\142', '\220', '\142', - '\200', '\121', '\032', '\140', '\374', '\006', '\030', '\331', - '\001', '\306', '\174', '\200', '\321', '\000', '\106', '\231', - '\200', '\121', '\100', '\140', '\224', '\026', '\030', '\105', - '\007', '\106', '\071', '\202', '\121', '\250', '\140', '\224', - '\060', '\030', '\305', '\015', '\106', '\331', '\203', '\121', - '\020', '\141', '\224', '\112', '\030', '\105', '\024', '\106', - '\171', '\205', '\121', '\170', '\141', '\224', '\144', '\030', - '\305', '\032', '\106', '\031', '\207', '\121', '\340', '\141', - '\224', '\176', '\030', '\105', '\001', '\005', '\001', '\300', - '\005', '\142', '\111', '\202', '\130', '\306', '\040', '\226', - '\076', '\210', '\345', '\022', '\142', '\211', '\205', '\130', - '\226', '\041', '\226', '\162', '\210', '\345', '\037', '\142', - '\311', '\210', '\130', '\146', '\042', '\226', '\246', '\210', - '\345', '\054', '\142', '\011', '\214', '\130', '\066', '\043', - '\226', '\332', '\210', '\345', '\071', '\142', '\111', '\217', - '\130', '\006', '\040', '\063', '\000', '\160', '\000', '\066', - '\067', '\200', '\115', '\024', '\140', '\263', '\006', '\330', - '\024', '\002', '\066', '\237', '\200', '\115', '\056', '\140', - '\063', '\015', '\330', '\264', '\003', '\066', '\007', '\201', - '\115', '\110', '\140', '\263', '\023', '\330', '\124', '\005', - '\066', '\157', '\201', '\115', '\142', '\140', '\063', '\032', - '\330', '\364', '\006', '\066', '\327', '\201', '\115', '\174', - '\140', '\263', '\000', '\310', '\222', '\000', '\262', '\076', - '\200', '\054', '\026', '\040', '\053', '\007', '\310', '\062', - '\002', '\262', '\246', '\200', '\054', '\060', '\040', '\013', - '\030', '\061', '\011', '\127', '\013', '\022', '\222', '\065', - '\000', '\170', '\340', '\242', '\030', '\315', '\250', '\007', - '\150', '\102', '\000', '\007', '\174', '\300', '\001', '\035', - '\061', '\210', '\012', '\052', '\060', '\322', '\222', '\222', - '\364', '\244', '\012', '\051', '\100', '\001', '\034', '\130', - '\000', '\220', '\022', '\040', '\244', '\000', '\070', '\100', - '\000', '\006', '\020', '\200', '\007', '\010', '\300', '\000', - '\002', '\170', '\226', '\003', '\210', '\345', '\000', '\007', - '\110', '\100', '\233', '\125', '\221', '\010', '\261', '\016', - '\340', '\200', '\233', '\346', '\024', '\132', '\011', '\110', - '\100', '\016', '\271', '\365', '\322', '\017', '\274', '\024', - '\000', '\037', '\240', '\111', '\004', '\046', '\120', '\201', - '\014', '\104', '\040', '\247', '\002', '\330', '\150', '\102', - '\042', '\020', '\001', '\005', '\144', '\304', '\251', '\057', - '\015', '\253', '\130', '\301', '\330', '\255', '\003', '\210', - '\025', '\246', '\011', '\341', '\301', '\131', '\327', '\112', - '\200', '\301', '\050', '\204', '\255', '\077', '\070', '\153', - '\102', '\176', '\320', '\055', '\205', '\320', '\265', '\256', - '\006', '\271', '\053', '\136', '\365', '\132', '\127', '\272', - '\262', '\125', '\255', '\154', '\035', '\153', '\140', '\305', - '\312', '\327', '\155', '\305', '\165', '\260', '\201', '\115', - '\010', '\004', '\020', '\100', '\000', '\001', '\020', '\000', - '\001', '\020', '\210', '\252', '\106', '\034', '\313', '\130', - '\001', '\004', '\100', '\262', '\043', '\371', '\200', '\002', - '\066', '\013', '\313', '\235', '\104', '\226', '\000', '\037', - '\270', '\214', '\101', '\030', '\040', '\201', '\234', '\036', - '\040', '\247', '\022', '\150', '\332', '\266', '\320', '\212', - '\327', '\267', '\255', '\025', '\000', '\060', '\345', '\154', - '\135', '\067', '\253', '\131', '\315', '\142', '\063', '\041', - '\004', '\360', '\200', '\112', '\035', '\100', '\001', '\012', - '\074', '\000', '\246', '\022', '\250', '\200', '\002', '\052', - '\253', '\200', '\012', '\304', '\062', '\131', '\052', '\025', - '\100', '\001', '\062', '\220', '\200', '\210', '\046', '\204', - '\001', '\215', '\355', '\026', '\143', '\033', '\233', '\323', - '\227', '\032', '\045', '\131', '\326', '\105', '\300', '\164', - '\237', '\005', '\333', '\012', '\174', '\364', '\003', '\025', - '\140', '\055', '\154', '\101', '\373', '\124', '\274', '\102', - '\227', '\273', '\006', '\301', '\054', '\136', '\073', '\032', - '\122', '\010', '\054', '\266', '\262', '\226', '\025', '\055', - '\001', '\024', '\300', '\325', '\372', '\172', '\365', '\255', - '\006', '\050', '\300', '\131', '\325', '\353', '\000', '\256', - '\056', '\266', '\261', '\227', '\125', '\310', '\007', '\376', - '\353', '\000', '\367', '\106', '\300', '\044', '\011', '\321', - '\056', '\003', '\066', '\233', '\200', '\017', '\150', '\127', - '\300', '\304', '\152', '\300', '\004', '\014', '\214', '\140', - '\203', '\364', '\227', '\130', '\017', '\250', '\157', '\205', - '\241', '\372', '\336', '\227', '\142', '\125', '\041', '\375', - '\345', '\152', '\210', '\017', '\014', '\342', '\372', '\172', - '\200', '\302', '\034', '\005', '\351', '\333', '\124', '\374', - '\126', '\026', '\237', '\127', '\261', '\225', '\015', '\000', - '\145', '\127', '\102', '\023', '\311', '\252', '\367', '\040', - '\063', '\216', '\161', '\211', '\043', '\360', '\337', '\214', - '\300', '\064', '\304', '\031', '\250', '\100', '\005', '\032', - '\020', '\000', '\255', '\276', '\215', '\276', '\134', '\375', - '\100', '\175', '\025', '\362', '\000', '\011', '\070', '\331', - '\247', '\116', '\176', '\100', '\211', '\213', '\105', '\054', - '\022', '\047', '\244', '\311', '\116', '\316', '\262', '\004', - '\244', '\234', '\220', '\320', '\142', '\270', '\130', '\352', - '\365', '\162', '\115', '\251', '\074', '\145', '\142', '\131', - '\325', '\312', '\006', '\251', '\157', '\004', '\224', '\274', - '\344', '\204', '\270', '\364', '\254', '\033', '\346', '\200', - '\166', '\347', '\214', '\000', '\245', '\052', '\204', '\253', - '\011', '\050', '\300', '\000', '\012', '\220', '\000', '\256', - '\152', '\204', '\312', '\140', '\276', '\163', '\004', '\066', - '\040', '\144', '\065', '\337', '\171', '\002', '\124', '\255', - '\352', '\231', '\167', '\254', '\146', '\064', '\207', '\261', - '\276', '\017', '\040', '\263', '\233', '\033', '\035', '\201', - '\012', '\024', '\370', '\312', '\220', '\346', '\263', '\237', - '\047', '\315', '\123', '\024', '\167', '\071', '\261', '\133', - '\245', '\264', '\243', '\325', '\314', '\331', '\362', '\246', - '\271', '\276', '\102', '\256', '\300', '\006', '\042', '\040', - '\350', '\315', '\316', '\027', '\311', '\255', '\366', '\252', - '\130', '\005', '\334', '\341', '\234', '\006', '\330', '\315', - '\130', '\315', '\365', '\206', '\211', '\125', '\135', '\355', - '\272', '\027', '\304', '\164', '\236', '\363', '\206', '\347', - '\313', '\352', '\326', '\146', '\366', '\271', '\220', '\155', - '\155', '\201', '\075', '\300', '\125', '\043', '\017', '\013', - '\303', '\152', '\346', '\362', '\110', '\056', '\034', '\000', - '\107', '\273', '\027', '\002', '\314', '\066', '\361', '\116', - '\372', '\033', '\132', '\107', '\223', '\066', '\247', '\066', - '\375', '\060', '\115', '\106', '\174', '\142', '\053', '\027', - '\113', '\302', '\206', '\176', '\053', '\266', '\304', '\272', - '\141', '\000', '\210', '\204', '\001', '\164', '\116', '\152', - '\016', '\213', '\225', '\347', '\075', '\367', '\131', '\041', - '\006', '\140', '\153', '\273', '\217', '\225', '\352', '\012', - '\024', '\173', '\044', '\350', '\156', '\363', '\264', '\325', - '\274', '\357', '\107', '\163', '\065', '\322', '\304', '\032', - '\111', '\266', '\043', '\160', '\342', '\137', '\277', '\145', - '\002', '\222', '\036', '\070', '\042', '\035', '\015', '\000', - '\160', '\143', '\125', '\002', '\014', '\330', '\211', '\232', - '\063', '\340', '\134', '\101', '\167', '\365', '\276', '\122', - '\255', '\264', '\220', '\157', '\173', '\147', '\131', '\323', - '\127', '\343', '\134', '\345', '\070', '\004', '\050', '\356', - '\140', '\000', '\253', '\027', '\003', '\141', '\065', '\337', - '\113', '\061', '\360', '\126', '\120', '\033', '\104', '\346', - '\004', '\200', '\371', '\113', '\175', '\142', '\220', '\340', - '\036', '\327', '\330', '\100', '\127', '\067', '\133', '\133', - '\134', '\001', '\225', '\132', '\032', '\255', '\337', '\376', - '\042', '\152', '\125', '\273', '\125', '\155', '\052', '\240', - '\277', '\043', '\341', '\052', '\155', '\311', '\013', '\323', - '\131', '\317', '\172', '\264', '\245', '\045', '\055', '\306', - '\041', '\200', '\161', '\205', '\144', '\205', '\133', '\375', - '\125', '\365', '\004', '\010', '\115', '\361', '\145', '\063', - '\034', '\252', '\333', '\242', '\200', '\002', '\124', '\252', - '\000', '\012', '\160', '\153', '\300', '\064', '\336', '\326', - '\215', '\055', '\034', '\201', '\013', '\154', '\140', '\003', - '\166', '\147', '\271', '\171', '\235', '\234', '\161', '\246', - '\122', '\035', '\355', '\020', '\321', '\357', '\027', '\267', - '\245', '\134', '\307', '\362', '\174', '\044', '\214', '\005', - '\372', '\306', '\057', '\160', '\031', '\017', '\134', '\340', - '\361', '\027', '\260', '\100', '\157', '\335', '\276', '\223', - '\276', '\003', '\075', '\361', '\002', '\030', '\200', '\151', - '\271', '\245', '\365', '\214', '\073', '\173', '\044', '\005', - '\150', '\273', '\332', '\045', '\230', '\054', '\315', '\177', - '\021', '\002', '\030', '\240', '\000', '\007', '\342', '\236', - '\171', '\323', '\042', '\200', '\002', '\213', '\345', '\100', - '\340', '\035', '\133', '\000', '\011', '\244', '\176', '\365', - '\102', '\007', '\260', '\210', '\161', '\053', '\022', '\142', - '\257', '\171', '\323', '\356', '\366', '\061', '\222', '\331', - '\374', '\334', '\252', '\370', '\236', '\370', '\020', '\314', - '\314', '\361', '\201', '\277', '\131', '\330', '\016', '\037', - '\370', '\363', '\175', '\351', '\363', '\377', '\015', '\000', - '\015', '\250', '\264', '\000', '\015', '\140', '\151', '\120', - '\070', '\115', '\345', '\003', '\107', '\367', '\261', '\120', - '\375', '\362', '\255', '\203', '\037', '\376', '\061', '\217', - '\337', '\000', '\005', '\361', '\062', '\302', '\061', '\333', - '\174', '\365', '\023', '\013', '\263', '\340', '\007', '\153', - '\130', '\061', '\233', '\170', '\371', '\067', '\265', '\370', - '\120', '\335', '\157', '\102', '\332', '\257', '\377', '\053', - '\147', '\371', '\002', '\131', '\046', '\155', '\152', '\007', - '\000', '\134', '\105', '\125', '\213', '\366', '\066', '\042', - '\061', '\142', '\273', '\027', '\022', '\031', '\241', '\200', - '\150', '\106', '\132', '\331', '\324', '\150', '\025', '\066', - '\200', '\016', '\130', '\141', '\315', '\127', '\201', '\032', - '\347', '\125', '\047', '\247', '\130', '\016', '\220', '\001', - '\101', '\046', '\144', '\210', '\266', '\123', '\010', '\110', - '\200', '\022', '\230', '\140', '\031', '\101', '\151', '\025', - '\006', '\201', '\050', '\270', '\177', '\231', '\261', '\202', - '\014', '\110', '\202', '\262', '\146', '\152', '\303', '\222', - '\141', '\007', '\147', '\054', '\073', '\106', '\203', '\023', - '\100', '\144', '\043', '\230', '\115', '\330', '\026', '\001', - '\034', '\147', '\202', '\026', '\326', '\203', '\077', '\210', - '\165', '\101', '\310', '\154', '\103', '\010', '\000', '\003', - '\310', '\203', '\106', '\350', '\134', '\315', '\247', '\204', - '\076', '\350', '\134', '\244', '\225', '\161', '\146', '\167', - '\204', '\040', '\106', '\001', '\016', '\120', '\000', '\302', - '\265', '\155', '\162', '\123', '\155', '\040', '\325', '\020', - '\340', '\027', '\201', '\335', '\126', '\141', '\211', '\007', - '\206', '\134', '\210', '\177', '\144', '\210', '\146', '\115', - '\310', '\155', '\145', '\270', '\203', '\371', '\066', '\177', - '\100', '\270', '\156', '\156', '\110', '\204', '\160', '\170', - '\177', '\006', '\321', '\204', '\155', '\110', '\207', '\230', - '\101', '\000', '\210', '\244', '\200', '\023', '\210', '\115', - '\001', '\007', '\175', '\106', '\301', '\207', '\157', '\050', - '\210', '\162', '\110', '\210', '\110', '\210', '\115', '\206', - '\230', '\206', '\004', '\067', '\022', '\117', '\025', '\125', - '\062', '\310', '\201', '\037', '\070', '\001', '\042', '\010', - '\133', '\106', '\321', '\150', '\106', '\066', '\206', '\226', - '\150', '\206', '\231', '\130', '\207', '\330', '\264', '\211', - '\344', '\107', '\202', '\117', '\270', '\162', '\025', '\026', - '\141', '\023', '\120', '\200', '\104', '\206', '\020', '\115', - '\130', '\137', '\052', '\107', '\142', '\023', '\001', '\056', - '\201', '\120', '\010', '\206', '\240', '\010', '\201', '\000', - '\010', '\260', '\150', '\010', '\177', '\160', '\056', '\212', - '\140', '\056', '\204', '\140', '\010', '\207', '\240', '\213', - '\274', '\150', '\056', '\260', '\330', '\213', '\200', '\260', - '\213', '\302', '\270', '\213', '\211', '\260', '\007', '\264', - '\310', '\213', '\200', '\220', '\214', '\302', '\030', '\214', - '\346', '\062', '\010', '\344', '\322', '\007', '\200', '\000', - '\215', '\204', '\040', '\010', '\202', '\060', '\056', '\325', - '\170', '\215', '\321', '\010', '\060', '\210', '\220', '\007', - '\347', '\142', '\010', '\310', '\210', '\215', '\322', '\070', - '\056', '\202', '\160', '\213', '\343', '\002', '\010', '\201', - '\240', '\215', '\353', '\002', '\215', '\374', '\062', '\216', - '\206', '\220', '\215', '\354', '\010', '\214', '\206', '\200', - '\010', '\313', '\010', '\213', '\364', '\230', '\214', '\206', - '\120', '\217', '\343', '\162', '\213', '\260', '\230', '\010', - '\200', '\040', '\010', '\320', '\070', '\010', '\176', '\260', - '\214', '\371', '\370', '\217', '\320', '\350', '\217', '\201', - '\140', '\214', '\172', '\220', '\214', '\210', '\300', '\217', - '\206', '\340', '\217', '\311', '\010', '\221', '\375', '\370', - '\007', '\011', '\371', '\220', '\172', '\120', '\221', '\010', - '\151', '\214', '\372', '\330', '\220', '\314', '\350', '\007', - '\025', '\051', '\010', '\263', '\010', '\213', '\205', '\300', - '\007', '\037', '\031', '\222', '\017', '\251', '\217', '\022', - '\171', '\222', '\021', '\211', '\222', '\054', '\271', '\222', - '\056', '\331', '\217', '\055', '\011', '\223', '\025', '\171', - '\010', '\201', '\060', '\223', '\046', '\231', '\222', '\206', - '\060', '\220', '\060', '\371', '\222', '\052', '\271', '\223', - '\076', '\331', '\223', '\100', '\231', '\222', '\102', '\311', - '\222', '\030', '\031', '\223', '\101', '\151', '\224', '\103', - '\311', '\223', '\211', '\160', '\223', '\110', '\331', '\224', - '\112', '\331', '\224', '\105', '\271', '\222', '\121', '\331', - '\217', '\013', '\011', '\213', '\350', '\050', '\010', '\124', - '\211', '\217', '\106', '\131', '\220', '\077', '\311', '\225', - '\100', '\151', '\010', '\362', '\230', '\221', '\363', '\270', - '\214', '\273', '\210', '\010', '\141', '\211', '\216', '\032', - '\251', '\225', '\152', '\131', '\213', '\372', '\010', '\226', - '\370', '\050', '\217', '\136', '\351', '\225', '\367', '\310', - '\226', '\153', '\171', '\216', '\165', '\351', '\226', '\164', - '\011', '\223', '\000', '\171', '\224', '\021', '\271', '\220', - '\342', '\262', '\214', '\004', '\271', '\214', '\173', '\051', - '\224', '\016', '\231', '\222', '\207', '\120', '\230', '\006', - '\171', '\222', '\257', '\030', '\213', '\050', '\211', '\007', - '\311', '\250', '\010', '\205', '\251', '\223', '\274', '\350', - '\220', '\205', '\040', '\231', '\043', '\371', '\230', '\205', - '\211', '\007', '\213', '\171', '\214', '\014', '\171', '\213', - '\320', '\250', '\010', '\310', '\370', '\231', '\173', '\040', - '\010', '\273', '\250', '\010', '\216', '\131', '\213', '\114', - '\111', '\232', '\206', '\060', '\222', '\252', '\371', '\217', - '\323', '\030', '\213', '\173', '\260', '\231', '\322', '\030', - '\214', '\016', '\251', '\010', '\372', '\150', '\233', '\217', - '\151', '\224', '\270', '\011', '\213', '\273', '\311', '\230', - '\271', '\371', '\233', '\274', '\211', '\224', '\362', '\330', - '\233', '\304', '\171', '\233', '\306', '\011', '\234', '\276', - '\031', '\234', '\074', '\131', '\234', '\310', '\311', '\234', - '\312', '\131', '\213', '\265', '\151', '\222', '\316', '\231', - '\234', '\324', '\331', '\233', '\051', '\211', '\010', '\322', - '\171', '\234', '\317', '\131', '\235', '\332', '\151', '\227', - '\265', '\070', '\234', '\335', '\071', '\235', '\342', '\031', - '\236', '\344', '\331', '\234', '\345', '\151', '\217', '\016', - '\111', '\223', '\346', '\271', '\236', '\274', '\051', '\217', - '\146', '\371', '\230', '\136', '\263', '\023', '\326', '\262', - '\055', '\010', '\321', '\020', '\040', '\221', '\021', '\017', - '\104', '\032', '\051', '\041', '\022', '\005', '\221', '\031', - '\240', '\221', '\161', '\160', '\141', '\022', '\122', '\266', - '\022', '\254', '\126', '\025', '\127', '\341', '\166', '\122', - '\021', '\023', '\027', '\240', '\103', '\000', '\220', '\001', - '\325', '\007', '\000', '\070', '\041', '\173', '\101', '\261', - '\121', '\121', '\065', '\023', '\041', '\000', '\000', '\042', - '\000', '\000', '\043', '\000', '\000', '\044', '\000', '\000', - '\045', '\000', '\000', '\046', '\000', '\000', '\121', '\003', - '\025', '\051', '\000', '\000', '\052', '\000', '\000', '\053', - '\000', '\000', '\134', '\061', '\121', '\177', '\362', '\002', - '\000', '\000', '\003', '\125', '\002', '\000', '\136', '\061', - '\003', '\000', '\060', '\065', '\065', '\000', '\000', '\066', - '\000', '\000', '\067', '\000', '\000', '\070', '\000', '\000', - '\112', '\242', '\003', '\000', '\260', '\003', '\000', '\060', - '\030', '\075', '\000', '\000', '\140', '\101', '\127', '\072', - '\121', '\065', '\102', '\340', '\042', '\000', '\100', '\004', - '\000', '\040', '\026', '\106', '\000', '\000', '\055', '\222', - '\043', '\111', '\000', '\000', '\112', '\000', '\000', '\144', - '\301', '\004', '\277', '\001', '\000', '\264', '\362', '\004', - '\036', '\001', '\000', '\121', '\120', '\036', '\340', '\001', - '\000', '\202', '\122', '\005', '\000', '\140', '\005', '\254', - '\122', '\053', '\000', '\200', '\033', '\132', '\000', '\000', - '\150', '\301', '\005', '\000', '\320', '\005', '\000', '\340', - '\005', '\000', '\360', '\005', '\000', '\000', '\006', '\000', - '\020', '\006', '\000', '\040', '\006', '\000', '\060', '\034', - '\025', '\121', '\006', '\000', '\140', '\006', '\000', '\160', - '\006', '\000', '\200', '\006', '\000', '\240', '\026', '\152', - '\000', '\000', '\234', '\301', '\006', '\000', '\360', '\035', - '\156', '\000', '\000', '\157', '\000', '\000', '\160', '\000', - '\000', '\161', '\000', '\000', '\162', '\000', '\000', '\163', - '\000', '\000', '\164', '\000', '\000', '\134', '\143', '\007', - '\000', '\160', '\007', '\000', '\300', '\026', '\156', '\241', - '\007', '\000', '\260', '\007', '\000', '\300', '\007', '\000', - '\320', '\007', '\000', '\340', '\007', '\000', '\360', '\007', - '\000', '\360', '\017', '\260', '\032', '\253', '\262', '\072', - '\253', '\264', '\132', '\253', '\266', '\172', '\253', '\270', - '\172', '\253', '\103', '\021', '\010', '\000', '\340', '\065', - '\203', '\000', '\000', '\162', '\121', '\010', '\000', '\140', - '\010', '\000', '\160', '\010', '\074', '\001', '\000', '\211', - '\000', '\000', '\212', '\000', '\000', '\213', '\000', '\000', - '\214', '\000', '\000', '\215', '\000', '\000', '\216', '\000', - '\000', '\166', '\001', '\011', '\000', '\020', '\011', '\000', - '\040', '\011', '\000', '\060', '\011', '\000', '\100', '\011', - '\000', '\120', '\011', '\000', '\140', '\011', '\000', '\160', - '\011', '\000', '\360', '\020', '\231', '\000', '\000', '\232', - '\000', '\000', '\233', '\000', '\000', '\172', '\321', '\011', - '\000', '\340', '\011', '\000', '\360', '\011', '\000', '\000', - '\012', '\000', '\020', '\012', '\000', '\040', '\012', '\000', - '\060', '\012', '\000', '\100', '\012', '\000', '\120', '\012', - '\000', '\140', '\012', '\000', '\160', '\012', '\000', '\200', - '\012', '\000', '\320', '\027', '\252', '\000', '\000', '\253', - '\000', '\000', '\254', '\000', '\000', '\255', '\000', '\000', - '\256', '\000', '\000', '\257', '\160', '\024', '\000', '\360', - '\027', '\262', '\000', '\000', '\201', '\101', '\013', '\000', - '\120', '\013', '\000', '\100', '\066', '\267', '\000', '\000', - '\270', '\000', '\000', '\271', '\000', '\000', '\272', '\000', - '\000', '\273', '\000', '\000', '\274', '\000', '\000', '\275', - '\000', '\000', '\276', '\000', '\000', '\277', '\000', '\000', - '\300', '\000', '\000', '\205', '\041', '\014', '\000', '\140', - '\066', '\304', '\000', '\000', '\305', '\000', '\000', '\306', - '\000', '\000', '\307', '\000', '\000', '\310', '\000', '\000', - '\311', '\000', '\000', '\312', '\000', '\000', '\313', '\000', - '\000', '\314', '\000', '\000', '\315', '\000', '\000', '\316', - '\000', '\000', '\317', '\000', '\000', '\150', '\023', '\015', - '\000', '\160', '\030', '\323', '\000', '\000', '\324', '\000', - '\000', '\325', '\000', '\000', '\326', '\000', '\000', '\327', - '\000', '\000', '\330', '\000', '\000', '\331', '\000', '\000', - '\211', '\261', '\015', '\000', '\300', '\015', '\000', '\240', - '\066', '\336', '\000', '\000', '\337', '\260', '\023', '\113', - '\143', '\264', '\023', '\321', '\014', '\153', '\333', '\266', - '\006', '\301', '\266', '\157', '\353', '\266', '\152', '\033', - '\267', '\164', '\073', '\267', '\166', '\013', '\267', '\167', - '\053', '\267', '\170', '\273', '\267', '\172', '\333', '\267', - '\165', '\313', '\267', '\177', '\353', '\267', '\171', '\033', - '\270', '\204', '\073', '\270', '\206', '\013', '\270', '\207', - '\053', '\270', '\210', '\273', '\270', '\212', '\333', '\270', - '\205', '\313', '\270', '\217', '\353', '\270', '\211', '\033', - '\271', '\224', '\073', '\271', '\226', '\013', '\271', '\227', - '\053', '\271', '\230', '\273', '\271', '\232', '\333', '\271', - '\225', '\313', '\271', '\237', '\353', '\271', '\231', '\033', - '\272', '\244', '\073', '\272', '\246', '\013', '\272', '\247', - '\053', '\272', '\250', '\273', '\272', '\252', '\333', '\272', - '\245', '\313', '\272', '\257', '\353', '\272', '\251', '\033', - '\273', '\264', '\073', '\273', '\266', '\213', '\272', '\012', - '\221', '\266', '\012', '\161', '\134', '\101', '\005', '\241', - '\011', '\321', '\241', '\006', '\061', '\121', '\006', '\221', - '\243', '\171', '\225', '\020', '\071', '\142', '\020', '\141', - '\152', '\020', '\155', '\152', '\020', '\303', '\141', '\020', - '\214', '\152', '\020', '\134', '\143', '\020', '\254', '\152', - '\020', '\306', '\152', '\020', '\326', '\152', '\020', '\347', - '\152', '\020', '\370', '\152', '\020', '\011', '\153', '\020', - '\030', '\153', '\020', '\051', '\153', '\020', '\071', '\153', - '\020', '\113', '\153', '\020', '\133', '\153', '\020', '\341', - '\260', '\066', '\011', '\061', '\017', '\011', '\301', '\017', - '\011', '\121', '\000', '\023', '\061', '\211', '\214', '\047', - '\023', '\023', '\141', '\002', '\023', '\321', '\002', '\023', - '\141', '\003', '\023', '\021', '\004', '\023', '\201', '\004', - '\023', '\001', '\005', '\023', '\241', '\005', '\023', '\121', - '\006', '\023', '\361', '\006', '\023', '\241', '\007', '\023', - '\061', '\010', '\023', '\141', '\032', '\006', '\341', '\010', - '\023', '\121', '\011', '\023', '\301', '\011', '\023', '\041', - '\012', '\023', '\161', '\012', '\023', '\261', '\012', '\023', - '\361', '\012', '\023', '\121', '\013', '\213', '\063', '\021', - '\277', '\060', '\021', '\303', '\060', '\021', '\311', '\060', - '\021', '\317', '\360', '\070', '\023', '\241', '\015', '\023', - '\101', '\016', '\023', '\221', '\016', '\023', '\361', '\016', - '\023', '\161', '\017', '\227', '\021', '\021', '\232', '\147', - '\020', '\005', '\020', '\021', '\247', '\145', '\020', '\011', - '\020', '\021', '\013', '\020', '\021', '\015', '\020', '\021', - '\066', '\225', '\146', '\021', '\061', '\001', '\231', '\023', - '\021', '\027', '\020', '\021', '\031', '\020', '\021', '\033', - '\020', '\021', '\035', '\020', '\021', '\037', '\020', '\021', - '\041', '\020', '\021', '\043', '\020', '\021', '\045', '\020', - '\021', '\047', '\020', '\021', '\051', '\020', '\021', '\053', - '\020', '\021', '\055', '\320', '\071', '\021', '\021', '\003', - '\021', '\061', '\003', '\021', '\121', '\003', '\021', '\161', - '\003', '\021', '\041', '\004', '\021', '\301', '\004', '\021', - '\221', '\005', '\021', '\121', '\006', '\247', '\023', '\021', - '\172', '\020', '\021', '\174', '\020', '\021', '\176', '\020', - '\021', '\200', '\020', '\021', '\202', '\020', '\021', '\204', - '\020', '\021', '\206', '\020', '\021', '\210', '\260', '\072', - '\021', '\301', '\010', '\021', '\341', '\010', '\021', '\001', - '\011', '\021', '\041', '\011', '\021', '\101', '\011', '\021', - '\141', '\011', '\021', '\201', '\011', '\021', '\241', '\011', - '\021', '\301', '\011', '\021', '\341', '\011', '\021', '\001', - '\012', '\021', '\041', '\012', '\257', '\023', '\021', '\246', - '\020', '\021', '\250', '\020', '\021', '\252', '\020', '\021', - '\254', '\020', '\021', '\256', '\020', '\021', '\270', '\020', - '\021', '\274', '\020', '\021', '\307', '\020', '\021', '\322', - '\020', '\021', '\333', '\020', '\021', '\340', '\220', '\073', - '\021', '\241', '\016', '\021', '\361', '\016', '\021', '\101', - '\017', '\021', '\221', '\017', '\021', '\341', '\017', '\062', - '\354', '\023', '\010', '\340', '\023', '\015', '\340', '\023', - '\022', '\340', '\023', '\027', '\340', '\023', '\034', '\340', - '\023', '\041', '\060', '\074', '\076', '\261', '\002', '\076', - '\001', '\003', '\076', '\121', '\003', '\076', '\241', '\003', - '\076', '\361', '\003', '\076', '\101', '\004', '\076', '\221', - '\004', '\076', '\341', '\004', '\076', '\061', '\005', '\076', - '\201', '\005', '\076', '\321', '\005', '\076', '\041', '\006', - '\315', '\343', '\023', '\154', '\340', '\023', '\161', '\340', - '\023', '\166', '\340', '\023', '\173', '\340', '\023', '\200', - '\340', '\023', '\205', '\340', '\023', '\212', '\340', '\023', - '\217', '\340', '\023', '\224', '\340', '\023', '\231', '\340', - '\023', '\236', '\340', '\023', '\243', '\160', '\075', '\076', - '\321', '\012', '\076', '\041', '\013', '\076', '\161', '\013', - '\076', '\301', '\013', '\076', '\021', '\014', '\076', '\141', - '\014', '\076', '\261', '\014', '\076', '\001', '\015', '\076', - '\121', '\015', '\076', '\241', '\015', '\076', '\361', '\015', - '\076', '\101', '\016', '\341', '\343', '\023', '\356', '\340', - '\023', '\363', '\340', '\023', '\370', '\340', '\023', '\375', - '\340', '\023', '\216', '\145', '\020', '\146', '\065', '\132', - '\035', '\021', '\001', '\035', '\141', '\001', '\035', '\261', - '\001', '\035', '\001', '\002', '\035', '\121', '\002', '\353', - '\323', '\021', '\057', '\320', '\021', '\064', '\320', '\021', - '\071', '\320', '\021', '\076', '\320', '\021', '\103', '\320', - '\021', '\110', '\320', '\021', '\115', '\320', '\021', '\122', - '\320', '\021', '\127', '\320', '\021', '\134', '\320', '\021', - '\141', '\320', '\021', '\146', '\120', '\077', '\035', '\001', - '\007', '\035', '\121', '\007', '\035', '\241', '\007', '\035', - '\361', '\007', '\035', '\101', '\010', '\035', '\221', '\010', - '\035', '\341', '\010', '\035', '\061', '\011', '\035', '\201', - '\011', '\035', '\321', '\011', '\035', '\041', '\012', '\035', - '\161', '\012', '\377', '\323', '\021', '\261', '\320', '\021', - '\266', '\320', '\021', '\273', '\340', '\323', '\302', '\221', - '\006', '\151', '\000', '\003', '\146', '\235', '\247', '\143', - '\135', '\326', '\060', '\140', '\045', '\141', '\220', '\326', - '\146', '\355', '\025', '\155', '\075', '\006', '\144', '\155', - '\326', '\064', '\032', '\327', '\163', '\015', '\003', '\123', - '\143', '\327', '\152', '\175', '\243', '\172', '\155', '\326', - '\071', '\332', '\327', '\060', '\260', '\243', '\175', '\035', - '\003', '\060', '\072', '\330', '\154', '\355', '\326', '\061', - '\000', '\327', '\210', '\135', '\327', '\210', '\235', '\327', - '\210', '\315', '\327', '\210', '\375', '\327', '\210', '\055', - '\330', '\156', '\335', '\051', '\150', '\055', '\327', '\145', - '\055', '\003', '\207', '\215', '\331', '\060', '\040', '\003', - '\212', '\315', '\331', '\062', '\300', '\330', '\240', '\355', - '\330', '\240', '\015', '\331', '\240', '\055', '\331', '\240', - '\115', '\331', '\234', '\075', '\003', '\205', '\355', '\326', - '\063', '\260', '\331', '\163', '\075', '\003', '\237', '\035', - '\333', '\242', '\035', '\333', '\244', '\035', '\333', '\246', - '\035', '\333', '\250', '\035', '\333', '\073', '\072', '\007', - '\160', '\020', '\006', '\143', '\000', '\250', '\145', '\200', - '\007', '\143', '\300', '\006', '\141', '\360', '\035', '\161', - '\120', '\007', '\157', '\100', '\007', '\320', '\001', '\046', - '\000', '\340', '\006', '\336', '\041', '\006', '\145', '\040', - '\007', '\163', '\220', '\006', '\147', '\360', '\250', '\145', - '\302', '\006', '\306', '\175', '\251', '\160', '\060', '\335', - '\301', '\355', '\006', '\233', '\172', '\334', '\335', '\115', - '\335', '\170', '\122', '\021', '\311', '\275', '\334', '\323', - '\155', '\335', '\150', '\260', '\251', '\277', '\135', '\047', - '\156', '\300', '\006', '\145', '\140', '\006', '\354', '\115', - '\047', '\371', '\041', '\007', '\352', '\035', '\336', '\163', - '\300', '\334', '\366', '\075', '\007', '\234', '\001', '\007', - '\154', '\120', '\007', '\231', '\072', '\006', '\146', '\162', - '\046', '\205', '\232', '\007', '\160', '\200', '\006', '\371', - '\041', '\251', '\351', '\375', '\006', '\025', '\061', '\007', - '\306', '\075', '\007', '\206', '\252', '\007', '\323', '\035', - '\251', '\366', '\001', '\250', '\164', '\160', '\007', '\221', - '\112', '\007', '\150', '\120', '\047', '\200', '\312', '\046', - '\165', '\160', '\251', '\146', '\220', '\006', '\166', '\000', - '\250', '\325', '\315', '\026', '\373', '\061', '\342', '\217', - '\132', '\006', '\367', '\375', '\334', '\151', '\002', '\250', - '\002', '\316', '\006', '\366', '\201', '\251', '\362', '\041', - '\046', '\157', '\000', '\343', '\217', '\012', '\337', '\163', - '\220', '\251', '\145', '\220', '\334', '\141', '\300', '\250', - '\147', '\120', '\047', '\141', '\240', '\337', '\224', '\132', - '\007', '\145', '\220', '\337', '\151', '\020', '\343', '\101', - '\336', '\037', '\000', '\260', '\244', '\057', '\342', '\244', - '\120', '\052', '\245', '\000', '\100', '\245', '\126', '\212', - '\245', '\000', '\240', '\245', '\146', '\321', '\245', '\137', - '\032', '\246', '\346', '\061', '\005', '\144', '\012', '\000', - '\146', '\212', '\246', '\127', '\240', '\246', '\154', '\272', - '\247', '\162', '\020', '\006', '\153', '\120', '\006', '\164', - '\000', '\337', '\362', '\275', '\247', '\300', '\275', '\006', - '\016', '\336', '\326', '\206', '\052', '\006', '\145', '\076', - '\006', '\147', '\116', '\007', '\366', '\175', '\006', '\353', - '\175', '\331', '\144', '\055', '\327', '\162', '\060', '\006', - '\336', '\301', '\251', '\224', '\102', '\335', '\002', '\136', - '\047', '\103', '\216', '\336', '\152', '\036', '\336', '\173', - '\332', '\247', '\024', '\001', '\000', '\035', '\076', '\250', - '\205', '\172', '\250', '\000', '\220', '\250', '\213', '\332', - '\250', '\317', '\015', '\251', '\222', '\112', '\251', '\226', - '\212', '\251', '\232', '\312', '\251', '\000', '\340', '\251', - '\240', '\052', '\252', '\000', '\100', '\252', '\162', '\016', - '\334', '\145', '\160', '\350', '\154', '\176', '\251', '\243', - '\036', '\334', '\167', '\236', '\347', '\172', '\115', '\007', - '\151', '\300', '\006', '\370', '\241', '\347', '\151', '\020', - '\003', '\067', '\260', '\243', '\146', '\035', '\006', '\060', - '\172', '\353', '\126', '\162', '\353', '\136', '\161', '\353', - '\064', '\172', '\353', '\123', '\163', '\353', '\067', '\172', - '\353', '\071', '\172', '\353', '\266', '\016', '\003', '\141', - '\320', '\243', '\267', '\256', '\044', '\267', '\256', '\247', - '\267', '\316', '\247', '\267', '\076', '\034', '\267', '\136', - '\021', '\267', '\016', '\250', '\267', '\056', '\250', '\146', - '\055', '\006', '\271', '\016', '\003', '\142', '\260', '\353', - '\334', '\336', '\353', '\334', '\376', '\353', '\334', '\036', - '\354', '\334', '\076', '\354', '\334', '\136', '\354', '\334', - '\176', '\354', '\142', '\240', '\354', '\334', '\316', '\354', - '\334', '\356', '\354', '\334', '\016', '\355', '\334', '\056', - '\355', '\334', '\116', '\355', '\334', '\156', '\355', '\334', - '\216', '\355', '\060', '\060', '\006', '\333', '\076', '\006', - '\336', '\076', '\006', '\340', '\076', '\006', '\342', '\076', - '\006', '\344', '\076', '\006', '\346', '\076', '\006', '\350', - '\076', '\006', '\307', '\076', '\006', '\354', '\076', '\006', - '\356', '\076', '\006', '\360', '\076', '\006', '\362', '\076', - '\006', '\364', '\076', '\006', '\366', '\036', '\334', '\057', - '\272', '\357', '\372', '\116', '\006', '\333', '\116', '\006', - '\336', '\116', '\006', '\340', '\116', '\006', '\342', '\116', - '\006', '\344', '\116', '\006', '\346', '\116', '\006', '\350', - '\116', '\006', '\307', '\116', '\006', '\354', '\116', '\006', - '\356', '\116', '\006', '\360', '\116', '\006', '\362', '\116', - '\006', '\364', '\116', '\006', '\366', '\036', '\353', '\146', - '\115', '\006', '\372', '\136', '\006', '\333', '\136', '\006', - '\336', '\136', '\006', '\340', '\136', '\006', '\342', '\136', - '\006', '\344', '\136', '\006', '\346', '\136', '\006', '\350', - '\136', '\006', '\307', '\136', '\006', '\354', '\136', '\006', - '\356', '\136', '\006', '\360', '\136', '\006', '\362', '\136', - '\006', '\364', '\316', '\037', '\146', '\135', '\006', '\370', - '\036', '\337', '\031', '\157', '\006', '\333', '\156', '\006', - '\336', '\156', '\006', '\340', '\156', '\006', '\342', '\156', - '\006', '\344', '\156', '\006', '\346', '\156', '\006', '\350', - '\156', '\006', '\307', '\156', '\006', '\354', '\156', '\006', - '\356', '\156', '\006', '\360', '\156', '\006', '\362', '\056', - '\020', '\133', '\157', '\357', '\146', '\200', '\357', '\146', - '\040', '\250', '\302', '\002', '\150', '\023', '\201', '\054', - '\025', '\307', '\055', '\331', '\362', '\367', '\370', '\206', - '\055', '\322', '\042', '\370', '\043', '\261', '\124', '\370', - '\060', '\237', '\015', '\021', '\370', '\312', '\002', - -}; - -static const char file_cursor[] = { - '\037', '\235', '\214', '\001', '\314', '\214', '\201', '\203', - '\000', '\200', '\301', '\000', '\006', '\023', '\032', '\044', - '\227', '\020', '\121', '\102', '\001', '\012', '\023', '\222', - '\111', '\310', '\006', '\041', '\000', '\002', '\012', '\055', - '\042', '\030', '\140', '\020', '\232', '\306', '\210', '\006', - '\151', '\114', '\060', '\210', '\015', '\043', '\000', '\020', - '\040', '\001', '\020', '\261', '\310', '\000', '\203', '\101', - '\040', '\051', '\341', '\100', '\004', '\000', '\045', '\203', - '\101', '\100', '\051', '\321', '\045', '\060', '\010', '\154', - '\103', '\102', '\213', '\012', '\047', '\032', '\104', '\125', - '\002', '\344', '\116', '\220', '\001', '\024', '\044', '\124', - '\241', '\320', '\206', '\305', '\032', '\077', '\165', '\044', - '\014', '\242', '\120', '\251', '\101', '\044', '\012', '\327', - '\044', '\234', '\242', '\320', '\111', '\102', '\060', '\135', - '\023', '\266', '\121', '\370', '\257', '\354', '\077', '\073', - '\012', '\033', '\200', '\014', '\224', '\160', '\310', '\023', - '\050', '\131', '\244', '\044', '\071', '\202', '\204', '\012', - '\000', '\052', '\150', '\312', '\314', '\051', '\003', '\102', - '\304', '\031', '\066', '\171', '\340', '\240', '\231', '\043', - '\002', '\104', '\030', '\071', '\174', '\353', '\270', '\051', - '\343', '\146', '\114', '\235', '\066', '\142', '\312', '\040', - '\236', '\010', '\345', '\111', '\022', '\047', '\124', '\276', - '\114', '\111', '\242', '\245', '\010', '\000', '\043', '\117', - '\060', '\003', '\160', '\054', '\147', '\316', '\033', '\071', - '\000', '\256', '\024', '\231', '\133', '\027', '\200', '\224', - '\042', '\123', '\236', '\060', '\251', '\102', '\045', '\111', - '\150', '\327', '\260', '\145', '\323', '\266', '\355', '\344', - '\013', '\026', '\334', '\261', '\147', '\327', '\016', '\375', - '\045', '\013', '\000', '\054', '\137', '\220', '\254', '\246', - '\153', '\067', '\112', '\225', '\040', '\104', '\276', '\134', - '\111', '\102', '\204', '\012', '\326', '\224', '\330', '\041', - '\044', '\214', '\220', '\320', '\354', '\277', '\170', '\377', - '\014', '\052', '\055', '\233', '\021', '\200', '\166', '\356', - '\017', '\314', '\143', '\137', '\317', '\276', '\275', '\173', - '\244', '\006', '\065', '\001', '\320', '\203', '\050', '\222', - '\041', '\104', '\171', '\022', '\105', '\072', '\224', '\150', - '\116', '\240', '\110', '\200', '\070', '\042', '\207', '\040', - '\221', '\004', '\362', '\110', '\037', '\205', '\104', '\222', - '\110', '\040', '\174', '\030', '\022', '\211', '\042', '\202', - '\040', '\250', '\040', '\203', '\016', '\102', '\070', '\140', - '\044', '\203', '\024', '\162', '\041', '\041', '\205', '\350', - '\161', '\210', '\175', '\370', '\325', '\307', '\137', '\200', - '\221', '\064', '\022', '\310', '\037', '\217', '\104', '\342', - '\210', '\040', '\376', '\225', '\030', '\310', '\205', '\053', - '\172', '\350', '\142', '\036', '\365', '\255', '\230', '\307', - '\207', '\013', '\342', '\121', '\037', '\204', '\170', '\174', - '\210', '\010', '\042', '\072', '\106', '\362', '\143', '\203', - '\000', '\072', '\262', '\307', '\207', '\006', '\336', '\270', - '\337', '\041', '\101', '\376', '\110', '\037', '\206', '\215', - '\350', '\241', '\337', '\040', '\215', '\320', '\250', '\340', - '\041', '\371', '\135', '\231', '\345', '\041', '\370', '\351', - '\307', '\337', '\226', '\135', '\356', '\027', '\046', '\227', - '\133', '\046', '\142', '\045', '\231', '\136', '\046', '\262', - '\107', '\202', '\205', '\164', '\350', '\240', '\041', '\206', - '\350', '\341', '\140', '\041', '\130', '\176', '\170', '\337', - '\232', '\113', '\312', '\051', '\044', '\042', '\162', '\374', - '\007', '\310', '\043', '\175', '\002', '\010', '\111', '\240', - '\177', '\022', '\372', '\210', '\236', '\164', '\052', '\171', - '\337', '\223', '\367', '\225', '\251', '\344', '\041', '\114', - '\326', '\367', '\343', '\205', '\202', '\064', '\162', '\041', - '\225', '\176', '\070', '\042', '\150', '\246', '\202', '\322', - '\341', '\047', '\044', '\236', '\012', '\372', '\147', '\221', - '\200', '\100', '\122', '\340', '\241', '\372', '\041', '\022', - '\147', '\252', '\206', '\064', '\011', '\244', '\244', '\370', - '\331', '\371', '\352', '\176', '\211', '\000', '\122', '\137', - '\200', '\177', '\350', '\147', '\040', '\211', '\206', '\034', - '\202', '\242', '\230', '\200', '\050', '\262', '\344', '\037', - '\213', '\354', '\351', '\152', '\217', '\173', '\006', '\073', - '\041', '\261', '\017', '\012', '\162', '\307', '\177', '\013', - '\332', '\101', '\240', '\205', '\004', '\026', '\262', '\310', - '\205', '\326', '\036', '\353', '\043', '\042', '\174', '\024', - '\033', '\110', '\043', '\174', '\060', '\162', '\252', '\035', - '\377', '\075', '\022', '\110', '\035', '\004', '\232', '\153', - '\045', '\043', '\204', '\144', '\311', '\056', '\221', '\155', - '\036', '\151', '\237', '\041', '\174', '\044', '\310', '\345', - '\036', '\016', '\376', '\230', '\207', '\237', '\216', '\340', - '\101', '\240', '\201', '\055', '\366', '\172', '\041', '\227', - '\317', '\056', '\051', '\255', '\261', '\260', '\042', '\353', - '\144', '\175', '\215', '\246', '\251', '\347', '\037', '\375', - '\336', '\012', '\111', '\037', '\204', '\104', '\362', '\010', - '\040', '\365', '\132', '\034', '\210', '\225', '\203', '\264', - '\133', '\037', '\207', '\201', '\230', '\332', '\161', '\251', - '\221', '\160', '\030', '\007', '\040', '\030', '\022', '\022', - '\307', '\177', '\034', '\122', '\034', '\311', '\037', '\220', - '\144', '\134', '\252', '\313', '\134', '\146', '\314', '\245', - '\035', '\011', '\226', '\132', '\107', '\316', '\220', '\074', - '\032', '\351', '\236', '\172', '\010', '\313', '\137', '\320', - '\264', '\336', '\101', '\240', '\040', '\216', '\034', '\214', - '\364', '\231', '\146', '\246', '\151', '\145', '\257', '\133', - '\036', '\342', '\041', '\044', '\120', '\043', '\002', '\011', - '\227', '\044', '\342', '\232', '\342', '\256', '\232', '\152', - '\175', '\152', '\213', '\001', '\136', '\150', '\240', '\214', - '\001', '\132', '\231', '\344', '\207', '\301', '\006', '\031', - '\310', '\042', '\056', '\227', '\052', '\063', '\044', '\312', - '\006', '\313', '\354', '\332', '\112', '\012', '\302', '\110', - '\220', '\110', '\027', '\034', '\354', '\301', '\153', '\257', - '\174', '\245', '\337', '\211', '\034', '\102', '\261', '\042', - '\220', '\326', '\253', '\310', '\217', '\012', '\311', '\007', - '\022', '\007', '\011', '\361', '\220', '\320', '\157', '\006', - '\341', '\221', '\220', '\040', '\011', '\051', '\016', '\000', - '\051', '\011', '\361', '\222', '\020', '\063', '\011', '\171', - '\223', '\220', '\076', '\011', '\151', '\140', '\221', '\123', - '\006', '\131', '\141', '\221', '\034', '\026', '\111', '\142', - '\221', '\053', '\026', '\071', '\143', '\221', '\070', '\026', - '\351', '\143', '\221', '\006', '\063', '\351', '\060', '\223', - '\025', '\063', '\331', '\061', '\223', '\044', '\063', '\311', - '\062', '\223', '\064', '\063', '\311', '\063', '\223', '\004', - '\034', '\001', '\040', '\103', '\361', '\120', '\024', '\017', - '\107', '\361', '\216', '\024', '\317', '\112', '\361', '\312', - '\024', '\257', '\116', '\361', '\010', '\230', '\204', '\202', - '\111', '\074', '\230', '\104', '\205', '\111', '\154', '\230', - '\204', '\210', '\111', '\244', '\230', '\104', '\214', '\111', - '\342', '\230', '\044', '\100', '\001', '\006', '\201', '\200', - '\076', '\000', '\076', '\254', '\157', '\305', '\372', '\162', - '\254', '\357', '\310', '\372', '\256', '\254', '\257', '\314', - '\372', '\352', '\254', '\217', '\200', '\001', '\006', '\241', - '\300', '\077', '\000', '\110', '\370', '\037', '\032', '\376', - '\207', '\210', '\377', '\241', '\342', '\177', '\304', '\370', - '\037', '\071', '\376', '\007', '\200', '\003', '\030', '\204', - '\003', '\016', '\004', '\000', '\017', '\042', '\310', '\205', - '\010', '\342', '\041', '\202', '\230', '\210', '\240', '\051', - '\042', '\150', '\214', '\010', '\202', '\043', '\202', '\376', - '\210', '\240', '\006', '\012', '\002', '\000', '\035', '\220', - '\120', '\013', '\044', '\324', '\003', '\011', '\035', '\101', - '\102', '\123', '\220', '\120', '\027', '\044', '\224', '\006', - '\011', '\345', '\101', '\102', '\011', '\034', '\105', '\006', - '\107', '\221', '\302', '\121', '\334', '\160', '\024', '\107', - '\034', '\305', '\025', '\107', '\161', '\306', '\121', '\334', - '\161', '\024', '\007', '\130', '\105', '\004', '\126', '\321', - '\201', '\125', '\260', '\140', '\025', '\074', '\130', '\305', - '\020', '\126', '\061', '\205', '\125', '\200', '\141', '\025', - '\157', '\130', '\105', '\037', '\126', '\321', '\300', '\002', - '\014', '\242', '\203', '\055', '\002', '\100', '\013', '\136', - '\264', '\203', '\027', '\055', '\341', '\105', '\130', '\170', - '\021', '\032', '\136', '\374', '\206', '\027', '\377', '\341', - '\305', '\006', '\060', '\300', '\040', '\037', '\170', '\043', - '\000', '\132', '\040', '\307', '\037', '\310', '\261', '\011', - '\162', '\374', '\202', '\034', '\335', '\040', '\107', '\107', - '\310', '\261', '\023', '\162', '\334', '\205', '\034', '\267', - '\041', '\307', '\175', '\310', '\361', '\002', '\152', '\001', - '\300', '\015', '\022', '\171', '\205', '\104', '\336', '\041', - '\221', '\227', '\110', '\344', '\055', '\022', '\171', '\215', - '\104', '\336', '\043', '\221', '\021', '\160', '\200', '\101', - '\132', '\240', '\111', '\000', '\034', '\241', '\223', '\145', - '\350', '\144', '\040', '\072', '\031', '\212', '\116', '\366', - '\242', '\223', '\335', '\350', '\144', '\076', '\072', '\231', - '\201', '\364', '\000', '\240', '\006', '\256', '\254', '\202', - '\053', '\323', '\340', '\312', '\100', '\270', '\062', '\022', - '\256', '\214', '\205', '\053', '\213', '\341', '\312', '\156', - '\270', '\062', '\037', '\256', '\314', '\200', '\166', '\346', - '\070', '\314', '\042', '\014', '\263', '\014', '\303', '\054', - '\304', '\060', '\047', '\061', '\314', '\131', '\014', '\323', - '\005', '\334', '\001', '\000', '\027', '\104', '\140', '\020', - '\134', '\020', '\301', '\040', '\007', '\300', '\301', '\003', - '\170', '\360', '\001', '\037', '\370', '\340', '\003', '\374', - '\170', '\000', '\076', '\016', '\000', '\217', '\001', '\224', - '\163', '\234', '\341', '\374', '\146', '\067', '\267', '\231', - '\315', '\007', '\300', '\343', '\003', '\370', '\370', '\001', - '\077', '\376', '\340', '\017', '\177', '\374', '\201', '\037', - '\077', '\300', '\307', '\007', '\340', '\341', '\116', '\161', - '\202', '\363', '\007', '\366', '\244', '\247', '\074', '\341', - '\351', '\116', '\000', '\300', '\100', '\202', '\000', '\370', - '\000', '\060', '\366', '\371', '\200', '\160', '\002', '\343', - '\000', '\037', '\134', '\036', '\016', '\006', '\300', '\201', - '\000', '\070', '\040', '\000', '\016', '\234', '\011', '\070', - '\000', '\200', '\017', '\000', '\370', '\003', '\020', '\177', - '\000', '\307', '\037', '\342', '\211', '\117', '\176', '\174', - '\000', '\034', '\014', '\305', '\307', '\003', '\370', '\160', - '\000', '\037', '\034', '\340', '\003', '\002', '\320', '\044', - '\106', '\302', '\363', '\017', '\014', '\330', '\024', '\003', - '\132', '\340', '\001', '\006', '\376', '\061', '\000', '\236', - '\372', '\264', '\247', '\003', '\220', '\234', '\344', '\374', - '\021', '\000', '\242', '\022', '\225', '\037', '\000', '\220', - '\034', '\006', '\170', '\240', '\205', '\233', '\356', '\024', - '\000', '\377', '\070', '\350', '\120', '\213', '\112', '\125', - '\241', '\102', '\025', '\250', '\077', '\345', '\051', '\116', - '\300', '\061', '\200', '\010', '\030', '\200', '\074', '\056', - '\301', '\210', '\000', '\170', '\272', '\321', '\162', '\346', - '\343', '\000', '\336', '\061', '\313', '\007', '\376', '\201', - '\326', '\001', '\034', '\201', '\003', '\104', '\040', '\100', - '\134', '\343', '\372', '\217', '\017', '\024', '\201', '\002', - '\167', '\315', '\053', '\005', '\352', '\072', '\127', '\271', - '\022', '\340', '\255', '\337', '\350', '\103', '\140', '\003', - '\313', '\215', '\016', '\374', '\343', '\017', '\207', '\075', - '\354', '\140', '\373', '\220', '\130', '\304', '\376', '\241', - '\260', '\213', '\015', '\054', '\107', '\070', '\062', '\002', - '\004', '\214', '\200', '\000', '\043', '\020', '\300', '\010', - '\002', '\060', '\212', '\321', '\000', '\140', '\034', '\017', - '\230', '\054', '\000', '\070', '\362', '\217', '\037', '\224', - '\066', '\075', '\351', '\171', '\007', '\014', '\336', '\201', - '\203', '\167', '\160', '\340', '\035', '\016', '\170', '\307', - '\001', '\336', '\061', '\200', '\167', '\374', '\300', '\266', - '\266', '\115', '\117', '\132', '\315', '\142', '\120', '\203', - '\022', '\040', '\006', '\010', '\210', '\001', '\004', '\142', - '\000', '\202', '\030', '\000', '\041', '\006', '\200', '\210', - '\001', '\077', '\142', '\320', '\333', '\203', '\302', '\240', - '\264', '\245', '\005', '\000', '\074', '\244', '\313', '\200', - '\173', '\160', '\340', '\036', '\070', '\270', '\007', '\034', - '\356', '\001', '\216', '\173', '\000', '\343', '\036', '\374', - '\000', '\257', '\170', '\245', '\273', '\333', '\262', '\300', - '\344', '\274', '\000', '\100', '\057', '\114', '\342', '\212', - '\004', '\001', '\100', '\041', '\000', '\033', '\205', '\211', - '\101', '\352', '\132', '\127', '\140', '\004', '\300', '\276', - '\370', '\275', '\257', '\176', '\231', '\221', '\201', '\302', - '\252', '\024', '\036', '\020', '\035', '\200', '\175', '\033', - '\333', '\130', '\140', '\000', '\300', '\300', '\010', '\076', - '\260', '\202', '\023', '\014', '\335', '\037', '\000', '\103', - '\300', '\020', '\176', '\260', '\204', '\043', '\334', '\323', - '\362', '\036', '\026', '\041', '\375', '\370', '\103', '\001', - '\200', '\120', '\217', '\057', '\124', '\000', '\012', '\325', - '\270', '\002', '\155', '\252', '\120', '\205', '\152', '\124', - '\241', '\002', '\124', '\250', '\307', '\025', '\012', '\000', - '\205', '\176', '\174', '\041', '\000', '\100', '\110', '\254', - '\205', '\147', '\114', '\143', '\357', '\070', '\067', '\251', - '\070', '\106', '\052', '\122', '\215', '\032', '\200', '\031', - '\014', '\040', '\006', '\002', '\270', '\361', '\215', '\247', - '\073', '\135', '\174', '\004', '\300', '\310', '\374', '\030', - '\100', '\222', '\103', '\030', '\302', '\177', '\074', '\300', - '\311', '\116', '\276', '\207', '\003', '\210', '\054', '\335', - '\052', '\203', '\343', '\310', '\007', '\010', '\247', '\007', - '\074', '\340', '\000', '\010', '\342', '\040', '\233', '\140', - '\306', '\101', '\227', '\267', '\034', '\316', '\161', '\136', - '\371', '\203', '\372', '\304', '\247', '\075', '\355', '\071', - '\120', '\175', '\272', '\031', '\236', '\362', '\134', '\363', - '\075', '\363', '\171', '\322', '\054', '\077', '\300', '\034', - '\031', '\230', '\300', '\014', '\222', '\101', '\202', '\074', - '\220', '\040', '\002', '\042', '\030', '\107', '\014', '\374', - '\361', '\001', '\145', '\120', '\300', '\320', '\206', '\126', - '\107', '\005', '\226', '\101', '\203', '\155', '\066', '\230', - '\320', '\367', '\310', '\301', '\066', '\356', '\320', '\216', - '\066', '\364', '\343', '\015', '\371', '\060', '\303', '\074', - '\346', '\120', '\332', '\165', '\324', '\300', '\323', '\236', - '\336', '\307', '\015', '\326', '\121', '\207', '\147', '\360', - '\241', '\261', '\052', '\045', '\000', '\004', '\014', '\000', - '\006', '\005', '\140', '\101', '\036', '\107', '\030', '\000', - '\020', '\144', '\055', '\000', '\040', '\324', '\132', '\023', - '\130', '\260', '\102', '\025', '\256', '\121', '\205', '\055', - '\144', '\241', '\326', '\265', '\306', '\247', '\112', '\115', - '\352', '\217', '\177', '\024', '\333', '\302', '\305', '\076', - '\166', '\171', '\213', '\215', '\117', '\040', '\300', '\370', - '\331', '\316', '\216', '\166', '\000', '\020', '\153', '\020', - '\304', '\112', '\373', '\332', '\317', '\346', '\252', '\266', - '\007', '\260', '\155', '\032', '\157', '\373', '\333', '\334', - '\036', '\200', '\020', '\102', '\120', '\204', '\050', '\050', - '\041', '\005', '\124', '\250', '\000', '\032', '\026', '\000', - '\205', '\002', '\374', '\302', '\037', '\316', '\176', '\167', - '\273', '\327', '\235', '\356', '\163', '\227', '\173', '\334', - '\146', '\230', '\101', '\033', '\266', '\261', '\207', '\067', - '\330', '\341', '\006', '\154', '\330', '\300', '\027', '\372', - '\001', '\120', '\234', '\000', '\164', '\340', '\001', '\377', - '\167', '\277', '\367', '\235', '\157', '\234', '\070', '\034', - '\000', '\017', '\177', '\070', '\142', '\043', '\016', '\361', - '\212', '\077', '\074', '\277', '\030', '\327', '\357', '\156', - '\063', '\316', '\361', '\147', '\203', '\141', '\000', '\355', - '\106', '\102', '\002', '\210', '\020', '\201', '\161', '\377', - '\341', '\017', '\325', '\376', '\303', '\270', '\111', '\056', - '\362', '\166', '\177', '\334', '\331', '\134', '\005', '\260', - '\112', '\013', '\353', '\214', '\034', '\034', '\043', '\016', - '\145', '\101', '\154', '\131', '\156', '\136', '\163', '\377', - '\272', '\063', '\300', '\366', '\235', '\052', '\121', '\263', - '\012', '\124', '\036', '\113', '\316', '\310', '\114', '\106', - '\353', '\223', '\227', '\016', '\345', '\245', '\047', '\335', - '\310', '\116', '\016', '\000', '\002', '\244', '\116', '\165', - '\004', '\204', '\301', '\352', '\123', '\317', '\172', '\325', - '\241', '\154', '\332', '\256', '\207', '\371', '\034', '\071', - '\000', '\273', '\330', '\163', '\020', '\346', '\006', '\227', - '\126', '\252', '\000', '\100', '\252', '\055', '\172', '\074', - '\000', '\041', '\367', '\326', '\307', '\153', '\107', '\252', - '\344', '\016', '\132', '\344', '\000', '\054', '\131', '\351', - '\115', '\247', '\162', '\323', '\235', '\034', '\302', '\044', - '\033', '\171', '\272', '\351', '\355', '\255', '\343', '\024', - '\312', '\320', '\160', '\002', '\342', '\000', '\100', '\070', - '\000', '\010', '\006', '\000', '\201', '\001', '\114', '\235', - '\000', '\001', '\200', '\210', '\105', '\300', '\042', '\071', - '\077', '\000', '\342', '\007', '\050', '\325', '\247', '\077', - '\036', '\260', '\371', '\017', '\002', '\030', '\027', '\003', - '\340', '\304', '\000', '\034', '\021', '\200', '\103', '\004', - '\200', '\043', '\026', '\201', '\311', '\101', '\007', '\277', - '\120', '\000', '\150', '\262', '\001', '\200', '\040', '\000', - '\020', '\010', '\200', '\022', '\355', '\024', '\104', '\254', - '\000', '\230', '\074', '\216', '\175', '\160', '\171', '\224', - '\242', '\024', '\020', '\017', '\000', '\306', '\003', '\300', - '\141', '\000', '\231', '\340', '\000', '\000', '\214', '\323', - '\244', '\003', '\111', '\373', '\200', '\110', '\040', '\040', - '\023', '\011', '\150', '\300', '\002', '\016', '\340', '\200', - '\253', '\137', '\235', '\372', '\322', '\207', '\276', '\363', - '\271', '\136', '\332', '\171', '\314', '\100', '\324', '\077', - '\370', '\301', '\067', '\174', '\360', '\216', '\036', '\224', - '\177', '\374', '\341', '\027', '\265', '\367', '\033', '\034', - '\217', '\001', '\354', '\343', '\245', '\014', '\110', '\000', - '\002', '\154', '\362', '\003', '\220', '\324', '\337', '\004', - '\004', '\040', '\001', '\003', '\174', '\200', '\217', '\033', - '\300', '\143', '\004', '\343', '\160', '\000', '\367', '\360', - '\144', '\153', '\025', '\176', '\070', '\020', '\125', '\064', - '\065', '\137', '\120', '\305', '\000', '\376', '\300', '\001', - '\374', '\300', '\017', '\377', '\200', '\017', '\377', '\000', - '\017', '\357', '\000', '\016', '\307', '\140', '\140', '\127', - '\126', '\116', '\006', '\106', '\014', '\010', '\140', '\014', - '\073', '\325', '\165', '\036', '\310', '\201', '\006', '\126', - '\116', '\127', '\206', '\140', '\002', '\006', '\121', '\344', - '\364', '\000', '\350', '\160', '\001', '\334', '\260', '\003', - '\026', '\326', '\202', '\053', '\310', '\117', '\037', '\064', - '\141', '\000', '\340', '\001', '\256', '\027', '\000', '\314', - '\220', '\017', '\015', '\340', '\144', '\177', '\300', '\000', - '\166', '\144', '\000', '\214', '\043', '\116', '\007', '\240', - '\035', '\104', '\250', '\036', '\222', '\003', '\000', '\365', - '\367', '\003', '\025', '\346', '\035', '\135', '\147', '\166', - '\000', '\105', '\120', '\307', '\167', '\174', '\072', '\226', - '\166', '\000', '\060', '\165', '\023', '\040', '\000', '\053', - '\066', '\001', '\004', '\060', '\015', '\005', '\360', '\001', - '\074', '\340', '\200', '\020', '\100', '\016', '\141', '\010', - '\011', '\364', '\000', '\011', '\344', '\000', '\011', '\004', - '\200', '\010', '\010', '\100', '\010', '\020', '\300', '\007', - '\340', '\004', '\000', '\373', '\020', '\000', '\367', '\320', - '\123', '\002', '\050', '\200', '\246', '\245', '\163', '\341', - '\005', '\017', '\367', '\000', '\017', '\023', '\270', '\207', - '\347', '\060', '\154', '\037', '\340', '\206', '\000', '\340', - '\022', '\036', '\160', '\170', '\017', '\226', '\201', '\003', - '\060', '\116', '\372', '\100', '\207', '\375', '\100', '\116', - '\346', '\024', '\000', '\051', '\000', '\000', '\043', '\000', - '\000', '\026', '\000', '\000', '\162', '\304', '\070', '\012', - '\065', '\174', '\216', '\070', '\116', '\233', '\267', '\167', - '\117', '\326', '\126', '\377', '\060', '\155', '\110', '\130', - '\203', '\036', '\025', '\000', '\221', '\347', '\007', '\004', - '\200', '\000', '\010', '\100', '\020', '\252', '\010', '\007', - '\024', '\200', '\000', '\042', '\000', '\003', '\101', '\000', - '\014', '\040', '\000', '\004', '\022', '\000', '\010', '\005', - '\201', '\076', '\002', '\060', '\164', '\164', '\310', '\167', - '\360', '\004', '\116', '\160', '\066', '\117', '\022', '\010', - '\017', '\041', '\345', '\140', '\037', '\000', '\174', '\015', - '\004', '\000', '\002', '\340', '\206', '\306', '\020', '\003', - '\203', '\000', '\006', '\320', '\006', '\155', '\003', '\000', - '\006', '\006', '\000', '\003', '\055', '\201', '\001', '\014', - '\000', '\003', '\254', '\046', '\140', '\001', '\340', '\206', - '\376', '\360', '\003', '\067', '\367', '\214', '\323', '\070', - '\215', '\103', '\020', '\006', '\207', '\000', '\007', '\016', - '\200', '\003', '\034', '\300', '\001', '\142', '\006', '\140', - '\134', '\065', '\140', '\377', '\260', '\012', '\252', '\120', - '\142', '\362', '\130', '\000', '\150', '\004', '\012', '\366', - '\270', '\000', '\370', '\170', '\217', '\371', '\010', '\012', - '\364', '\070', '\217', '\325', '\120', '\143', '\002', '\131', - '\143', '\204', '\026', '\116', '\371', '\160', '\002', '\336', - '\007', '\166', '\317', '\300', '\003', '\015', '\266', '\220', - '\140', '\347', '\175', '\007', '\031', '\116', '\005', '\011', - '\120', '\364', '\244', '\163', '\003', '\231', '\126', '\162', - '\206', '\117', '\247', '\167', '\000', '\017', '\360', '\001', - '\077', '\200', '\130', '\037', '\260', '\001', '\061', '\000', - '\003', '\140', '\360', '\161', '\311', '\230', '\036', '\037', - '\060', '\212', '\050', '\107', '\123', '\001', '\360', '\123', - '\050', '\167', '\017', '\000', '\060', '\017', '\000', '\160', - '\146', '\367', '\065', '\132', '\066', '\071', '\010', '\000', - '\060', '\004', '\222', '\010', '\000', '\043', '\261', '\017', - '\077', '\060', '\022', '\223', '\250', '\223', '\070', '\051', - '\132', '\250', '\005', '\000', '\241', '\365', '\010', '\003', - '\360', '\014', '\001', '\360', '\016', '\120', '\225', '\126', - '\114', '\251', '\224', '\110', '\031', '\132', '\105', '\051', - '\132', '\124', '\151', '\223', '\077', '\125', '\225', '\125', - '\131', '\224', '\132', '\151', '\224', '\120', '\305', '\164', - '\113', '\267', '\225', '\133', '\171', '\137', '\376', '\360', - '\156', '\277', '\040', '\002', '\242', '\040', '\012', '\252', - '\200', '\226', '\152', '\251', '\012', '\146', '\071', '\226', - '\156', '\111', '\226', '\157', '\051', '\226', '\167', '\110', - '\140', '\216', '\105', '\227', '\166', '\131', '\227', '\002', - '\205', '\225', '\066', '\131', '\225', '\077', '\005', '\226', - '\134', '\271', '\225', '\236', '\350', '\144', '\173', '\071', - '\230', '\130', '\371', '\123', '\177', '\171', '\230', '\140', - '\031', '\230', '\301', '\027', '\000', '\170', '\360', '\000', - '\316', '\306', '\026', '\302', '\020', '\016', '\044', '\040', - '\015', '\270', '\340', '\000', '\240', '\040', '\000', '\040', - '\120', '\153', '\001', '\220', '\231', '\150', '\050', '\162', - '\050', '\240', '\000', '\036', '\300', '\115', '\374', '\200', - '\116', '\015', '\365', '\001', '\303', '\020', '\004', '\347', - '\060', '\016', '\314', '\366', '\015', '\052', '\365', '\101', - '\061', '\167', '\000', '\200', '\350', '\007', '\341', '\367', - '\215', '\104', '\005', '\014', '\157', '\151', '\226', '\052', - '\240', '\012', '\271', '\271', '\233', '\154', '\051', '\012', - '\157', '\371', '\233', '\144', '\051', '\227', '\167', '\071', - '\234', '\170', '\111', '\227', '\337', '\270', '\121', '\007', - '\005', '\026', '\006', '\106', '\150', '\233', '\331', '\014', - '\154', '\340', '\234', '\316', '\031', '\000', '\320', '\110', - '\215', '\070', '\200', '\001', '\006', '\220', '\201', '\214', - '\151', '\145', '\036', '\125', '\200', '\002', '\311', '\017', - '\357', '\060', '\116', '\044', '\150', '\121', '\000', '\300', - '\035', '\314', '\045', '\005', '\000', '\340', '\005', '\000', - '\100', '\010', '\000', '\340', '\020', '\123', '\007', '\001', - '\001', '\000', '\003', '\230', '\131', '\153', '\004', '\160', - '\170', '\311', '\310', '\077', '\004', '\120', '\177', '\053', - '\351', '\121', '\151', '\147', '\167', '\107', '\146', '\116', - '\346', '\204', '\202', '\340', '\020', '\174', '\307', '\230', - '\222', '\051', '\151', '\203', '\034', '\200', '\210', '\343', - '\304', '\014', '\014', '\240', '\240', '\340', '\311', '\155', - '\001', '\020', '\016', '\041', '\020', '\016', '\141', '\040', - '\014', '\020', '\300', '\001', '\016', '\160', '\145', '\370', - '\160', '\004', '\053', '\265', '\231', '\347', '\144', '\147', - '\204', '\126', '\220', '\102', '\030', '\017', '\203', '\020', - '\017', '\343', '\060', '\017', '\363', '\360', '\016', '\071', - '\260', '\145', '\127', '\346', '\017', '\307', '\120', '\026', - '\053', '\345', '\166', '\007', '\365', '\123', '\060', '\132', - '\145', '\124', '\066', '\135', '\212', '\131', '\243', '\125', - '\306', '\007', '\372', '\171', '\014', '\001', '\060', '\010', - '\245', '\027', '\000', '\306', '\000', '\137', '\070', '\166', - '\174', '\050', '\000', '\000', '\105', '\352', '\016', '\000', - '\300', '\006', '\000', '\160', '\174', '\332', '\321', '\121', - '\374', '\120', '\124', '\164', '\370', '\010', '\007', '\360', - '\011', '\007', '\340', '\015', '\131', '\226', '\210', '\107', - '\306', '\121', '\373', '\351', '\017', '\112', '\226', '\245', - '\160', '\000', '\161', '\300', '\000', '\016', '\360', '\200', - '\017', '\374', '\120', '\154', '\370', '\200', '\015', '\214', - '\300', '\000', '\006', '\300', '\077', '\003', '\000', '\010', - '\020', '\026', '\163', '\211', '\250', '\144', '\003', '\300', - '\245', '\077', '\205', '\017', '\003', '\300', '\013', '\003', - '\300', '\003', '\003', '\140', '\203', '\066', '\050', '\107', - '\316', '\005', '\004', '\060', '\000', '\010', '\007', '\305', - '\134', '\062', '\360', '\017', '\067', '\140', '\074', '\000', - '\200', '\134', '\060', '\000', '\250', '\315', '\105', '\243', - '\300', '\000', '\017', '\300', '\020', '\017', '\200', '\040', - '\223', '\367', '\260', '\133', '\000', '\160', '\017', '\223', - '\032', '\251', '\217', '\112', '\243', '\204', '\111', '\230', - '\206', '\251', '\227', '\104', '\211', '\230', '\177', '\251', - '\230', '\242', '\252', '\225', '\142', '\111', '\226', '\146', - '\231', '\226', '\252', '\252', '\226', '\155', '\011', '\227', - '\256', '\072', '\226', '\302', '\131', '\234', '\262', '\112', - '\234', '\215', '\365', '\215', '\245', '\025', '\000', '\042', - '\200', '\253', '\270', '\372', '\017', '\043', '\000', '\150', - '\276', '\052', '\002', '\200', '\026', '\017', '\077', '\020', - '\001', '\040', '\100', '\254', '\304', '\012', '\135', '\151', - '\165', '\000', '\356', '\360', '\017', '\357', '\300', '\254', - '\314', '\172', '\007', '\356', '\000', '\255', '\225', '\072', - '\255', '\377', '\160', '\007', '\340', '\260', '\133', '\017', - '\007', '\012', '\001', '\240', '\255', '\260', '\020', '\000', - '\260', '\060', '\000', '\240', '\007', '\172', '\274', '\160', - '\000', '\343', '\352', '\013', '\007', '\340', '\013', '\035', - '\271', '\174', '\015', '\144', '\210', '\301', '\067', '\174', - '\303', '\267', '\117', '\360', '\032', '\117', '\044', '\045', - '\117', '\306', '\126', '\026', '\037', '\020', '\102', '\024', - '\220', '\257', '\372', '\272', '\257', '\024', '\360', '\007', - '\076', '\300', '\001', '\010', '\240', '\243', '\002', '\013', - '\000', '\003', '\133', '\260', '\004', '\173', '\260', '\241', - '\030', '\212', '\376', '\160', '\260', '\114', '\132', '\205', - '\010', '\320', '\022', '\337', '\370', '\000', '\170', '\360', - '\215', '\055', '\241', '\212', '\330', '\270', '\216', '\266', - '\212', '\227', '\337', '\270', '\216', '\330', '\130', '\020', - '\157', '\144', '\117', '\351', '\141', '\117', '\157', '\124', - '\020', '\007', '\045', '\205', '\365', '\132', '\026', '\314', - '\366', '\017', '\307', '\167', '\120', '\125', '\070', '\210', - '\321', '\205', '\007', '\321', '\345', '\022', '\036', '\213', - '\174', '\320', '\145', '\221', '\210', '\125', '\177', '\214', - '\303', '\000', '\010', '\300', '\001', '\076', '\360', '\007', - '\374', '\372', '\263', '\332', '\161', '\174', '\072', '\272', - '\260', '\011', '\333', '\215', '\007', '\153', '\260', '\110', - '\173', '\260', '\073', '\333', '\263', '\077', '\333', '\257', - '\377', '\212', '\000', '\102', '\253', '\237', '\105', '\233', - '\264', '\072', '\132', '\264', '\013', '\253', '\243', '\307', - '\167', '\021', '\256', '\227', '\120', '\200', '\260', '\007', - '\240', '\260', '\007', '\220', '\260', '\007', '\210', '\040', - '\266', '\144', '\073', '\266', '\214', '\260', '\007', '\106', - '\362', '\013', '\173', '\200', '\001', '\334', '\321', '\247', - '\310', '\307', '\076', '\000', '\260', '\222', '\140', '\360', - '\017', '\160', '\360', '\017', '\060', '\173', '\267', '\166', - '\373', '\017', '\247', '\346', '\007', '\211', '\345', '\007', - '\177', '\000', '\003', '\176', '\040', '\101', '\341', '\201', - '\020', '\204', '\013', '\000', '\355', '\027', '\001', '\002', - '\360', '\253', '\020', '\040', '\002', '\377', '\007', '\000', - '\044', '\140', '\244', '\006', '\005', '\014', '\246', '\205', - '\125', '\003', '\340', '\100', '\003', '\170', '\271', '\357', - '\000', '\255', '\322', '\372', '\016', '\024', '\310', '\207', - '\034', '\005', '\014', '\377', '\000', '\272', '\240', '\233', - '\212', '\325', '\123', '\075', '\020', '\040', '\000', '\247', - '\033', '\016', '\341', '\200', '\147', '\343', '\064', '\116', - '\170', '\246', '\272', '\247', '\173', '\272', '\245', '\113', - '\000', '\251', '\150', '\000', '\330', '\250', '\263', '\004', - '\140', '\235', '\042', '\152', '\242', '\366', '\260', '\003', - '\341', '\304', '\017', '\007', '\140', '\017', '\037', '\140', - '\242', '\042', '\212', '\001', '\002', '\140', '\235', '\014', - '\240', '\246', '\056', '\141', '\000', '\070', '\301', '\002', - '\006', '\340', '\011', '\224', '\150', '\000', '\365', '\027', - '\002', '\000', '\160', '\002', '\000', '\120', '\024', '\326', - '\213', '\275', '\325', '\013', '\000', '\324', '\113', '\275', - '\365', '\147', '\211', '\030', '\320', '\000', '\174', '\040', - '\276', '\015', '\340', '\007', '\073', '\010', '\125', '\350', - '\233', '\200', '\352', '\233', '\276', '\350', '\213', '\023', - '\330', '\226', '\231', '\360', '\053', '\000', '\234', '\300', - '\001', '\323', '\270', '\216', '\235', '\231', '\000', '\044', - '\040', '\001', '\371', '\332', '\022', '\252', '\206', '\023', - '\371', '\365', '\161', '\037', '\247', '\215', '\070', '\340', - '\001', '\237', '\300', '\007', '\334', '\026', '\210', '\363', - '\313', '\137', '\371', '\146', '\003', '\066', '\020', '\232', - '\351', '\150', '\137', '\000', '\046', '\146', '\055', '\121', - '\215', '\317', '\130', '\216', '\317', '\130', '\215', '\055', - '\321', '\216', '\007', '\140', '\137', '\257', '\251', '\122', - '\074', '\300', '\145', '\070', '\160', '\216', '\303', '\020', - '\016', '\143', '\060', '\016', '\043', '\174', '\216', '\351', - '\370', '\301', '\255', '\051', '\153', '\201', '\247', '\136', - '\201', '\127', '\127', '\056', '\354', '\302', '\035', '\227', - '\137', '\164', '\071', '\303', '\372', '\305', '\021', '\351', - '\341', '\003', '\372', '\231', '\144', '\145', '\246', '\245', - '\060', '\360', '\236', '\230', '\111', '\173', '\005', '\241', - '\035', '\040', '\340', '\100', '\051', '\211', '\162', '\106', - '\225', '\145', '\362', '\224', '\117', '\371', '\364', '\237', - '\360', '\160', '\241', '\007', '\212', '\003', '\340', '\360', - '\245', '\033', '\005', '\272', '\135', '\127', '\225', '\240', - '\065', '\006', '\000', '\320', '\131', '\233', '\225', '\131', - '\227', '\125', '\131', '\242', '\145', '\141', '\251', '\165', - '\133', '\144', '\114', '\133', '\262', '\005', '\133', '\256', - '\305', '\132', '\252', '\125', '\224', '\015', '\326', '\250', - '\060', '\260', '\134', '\311', '\165', '\134', '\305', '\065', - '\134', '\301', '\365', '\133', '\315', '\145', '\141', '\322', - '\025', '\136', '\172', '\354', '\135', '\334', '\245', '\135', - '\330', '\145', '\135', '\367', '\120', '\135', '\064', '\112', - '\137', '\051', '\031', '\170', '\033', '\365', '\136', '\355', - '\025', '\127', '\061', '\334', '\302', '\120', '\045', '\253', - '\034', '\374', '\237', '\063', '\327', '\001', '\374', '\145', - '\303', '\003', '\326', '\165', '\011', '\166', '\311', '\013', - '\246', '\140', '\026', '\066', '\141', '\234', '\114', '\141', - '\017', '\126', '\020', '\074', '\373', '\007', '\167', '\340', - '\257', '\000', '\333', '\005', '\153', '\220', '\004', '\101', - '\220', '\312', '\121', '\170', '\260', '\104', '\333', '\222', - '\256', '\174', '\265', '\000', '\240', '\013', '\120', '\345', - '\312', '\241', '\170', '\015', '\001', '\140', '\313', '\074', - '\172', '\225', '\235', '\252', '\227', '\212', '\351', '\227', - '\176', '\371', '\075', '\040', '\240', '\000', '\311', '\040', - '\003', '\362', '\220', '\000', '\114', '\140', '\000', '\103', - '\200', '\001', '\213', '\174', '\136', '\317', '\206', '\023', - '\350', '\140', '\007', '\373', '\360', '\015', '\004', '\167', - '\154', '\246', '\365', '\017', '\317', '\220', '\007', '\063', - '\274', '\301', '\332', '\374', '\120', '\156', '\372', '\251', - '\273', '\354', '\251', '\136', '\051', '\230', '\276', '\214', - '\230', '\255', '\013', '\233', '\166', '\146', '\010', '\030', - '\060', '\010', '\060', '\020', '\010', '\340', '\020', '\014', - '\341', '\340', '\316', '\041', '\000', '\016', '\023', '\240', - '\215', '\030', '\120', '\146', '\346', '\114', '\232', '\277', - '\313', '\171', '\334', '\051', '\220', '\117', '\230', '\317', - '\341', '\164', '\007', '\000', '\253', '\212', '\002', '\075', - '\320', '\034', '\160', '\007', '\357', '\100', '\313', '\106', - '\273', '\312', '\012', '\275', '\244', '\014', '\035', '\265', - '\105', '\173', '\320', '\051', '\221', '\011', '\021', '\001', - '\004', '\216', '\160', '\020', '\312', '\150', '\223', '\030', - '\201', '\076', '\374', '\343', '\100', '\005', '\261', '\023', - '\112', '\261', '\105', '\157', '\244', '\026', '\232', '\224', - '\036', '\347', '\001', '\000', '\022', '\300', '\223', '\000', - '\100', '\001', '\000', '\120', '\001', '\224', '\010', '\000', - '\027', '\060', '\210', '\000', '\140', '\023', '\032', '\000', - '\000', '\076', '\301', '\070', '\035', '\100', '\212', '\051', - '\211', '\022', '\324', '\113', '\115', '\223', '\370', '\270', - '\105', '\141', '\002', '\333', '\133', '\244', '\221', '\310', - '\024', '\053', '\000', '\000', '\054', '\060', '\107', '\000', - '\340', '\002', '\000', '\360', '\002', '\275', '\105', '\250', - '\000', '\060', '\003', '\000', '\100', '\003', '\257', '\004', - '\000', '\066', '\240', '\110', '\014', '\235', '\003', '\045', - '\004', '\000', '\073', '\200', '\120', '\075', '\000', '\267', - '\365', '\007', '\023', '\124', '\041', '\004', '\071', '\251', - '\022', '\000', '\340', '\031', '\106', '\340', '\111', '\000', - '\004', '\000', '\111', '\000', '\000', '\112', '\000', '\000', - '\113', '\000', '\000', '\114', '\000', '\000', '\115', '\000', - '\000', '\136', '\361', '\004', '\064', '\001', '\000', '\121', - '\340', '\032', '\000', '\300', '\025', '\166', '\121', '\005', - '\000', '\140', '\005', '\251', '\161', '\034', '\000', '\140', - '\034', '\132', '\000', '\000', '\133', '\040', '\115', '\000', - '\320', '\005', '\347', '\011', '\000', '\137', '\000', '\000', - '\140', '\021', '\006', '\000', '\040', '\006', '\236', '\065', - '\021', '\145', '\000', '\000', '\146', '\000', '\000', '\147', - '\000', '\000', '\150', '\000', '\000', '\151', '\000', '\000', - '\152', '\000', '\000', '\132', '\241', '\244', '\143', '\341', - '\006', '\000', '\360', '\006', '\000', '\360', '\245', '\161', - '\000', '\000', '\250', '\061', '\007', '\000', '\100', '\007', - '\000', '\120', '\007', '\000', '\200', '\026', '\167', '\200', - '\143', '\171', '\060', '\037', '\000', '\260', '\007', '\007', - '\333', '\007', '\000', '\020', '\270', '\050', '\207', '\023', - '\154', '\101', '\071', '\070', '\251', '\236', '\205', '\000', - '\000', '\206', '\000', '\000', '\207', '\260', '\236', '\000', - '\220', '\010', '\000', '\240', '\010', '\000', '\260', '\010', - '\000', '\300', '\010', '\000', '\320', '\010', '\000', '\120', - '\321', '\217', '\000', '\000', '\220', '\000', '\000', '\221', - '\000', '\000', '\222', '\000', '\000', '\223', '\000', '\000', - '\224', '\000', '\000', '\225', '\000', '\000', '\226', '\000', - '\000', '\227', '\000', '\000', '\230', '\000', '\000', '\022', - '\015', '\022', '\226', '\103', '\002', '\063', '\301', '\336', - '\006', '\341', '\336', '\216', '\333', '\336', '\362', '\375', - '\336', '\363', '\035', '\337', '\364', '\175', '\337', '\366', - '\235', '\337', '\360', '\275', '\337', '\365', '\315', '\337', - '\370', '\355', '\337', '\372', '\335', '\337', '\002', '\376', - '\337', '\003', '\036', '\340', '\004', '\176', '\340', '\006', - '\236', '\340', '\000', '\276', '\340', '\005', '\316', '\340', - '\010', '\356', '\340', '\012', '\336', '\340', '\022', '\376', - '\340', '\023', '\036', '\341', '\024', '\176', '\341', '\026', - '\236', '\341', '\020', '\276', '\341', '\025', '\316', '\341', - '\030', '\356', '\341', '\032', '\336', '\341', '\042', '\376', - '\341', '\043', '\236', '\340', '\004', '\060', '\023', '\047', - '\116', '\342', '\052', '\036', '\342', '\053', '\016', '\342', - '\102', '\140', '\021', '\057', '\256', '\336', '\051', '\161', - '\024', '\056', '\235', '\020', '\067', '\335', '\077', '\011', - '\201', '\325', '\006', '\141', '\327', '\006', '\201', '\236', - '\006', '\201', '\032', '\006', '\061', '\333', '\006', '\301', - '\026', '\006', '\301', '\334', '\006', '\161', '\336', '\006', - '\261', '\012', '\011', '\061', '\014', '\011', '\161', '\015', - '\011', '\001', '\170', '\124', '\150', '\020', '\015', '\140', - '\021', '\030', '\140', '\021', '\050', '\140', '\021', '\063', - '\140', '\021', '\103', '\140', '\021', '\116', '\140', '\021', - '\136', '\140', '\021', '\145', '\140', '\021', '\161', '\140', - '\021', '\167', '\140', '\021', '\202', '\140', '\021', '\215', - '\140', '\021', '\235', '\140', '\021', '\243', '\260', '\072', - '\026', '\301', '\013', '\026', '\241', '\224', '\006', '\221', - '\015', '\026', '\201', '\016', '\026', '\141', '\017', '\026', - '\221', '\000', '\063', '\321', '\000', '\063', '\141', '\001', - '\063', '\321', '\001', '\063', '\221', '\002', '\063', '\141', - '\003', '\063', '\321', '\136', '\006', '\101', '\005', '\063', - '\121', '\006', '\063', '\021', '\007', '\063', '\041', '\010', - '\063', '\321', '\010', '\063', '\321', '\011', '\063', '\141', - '\012', '\063', '\101', '\013', '\063', '\241', '\013', '\063', - '\121', '\014', '\063', '\321', '\014', '\063', '\241', '\015', - '\032', '\065', '\023', '\353', '\060', '\023', '\361', '\060', - '\023', '\374', '\060', '\023', '\002', '\120', '\074', '\015', - '\120', '\074', '\023', '\120', '\074', '\036', '\120', '\074', - '\043', '\120', '\074', '\055', '\120', '\074', '\023', '\165', - '\025', '\305', '\023', '\005', '\305', '\363', '\005', '\305', - '\223', '\006', '\305', '\203', '\007', '\305', '\023', '\010', - '\305', '\203', '\224', '\361', '\121', '\074', '\252', '\120', - '\074', '\263', '\120', '\074', '\301', '\000', '\075', '\305', - '\203', '\015', '\305', '\303', '\015', '\305', '\123', '\016', - '\305', '\043', '\017', '\305', '\103', '\273', '\342', '\141', - '\022', '\025', '\140', '\022', '\034', '\140', '\075', '\046', - '\361', '\002', '\046', '\261', '\003', '\046', '\061', '\173', - '\006', '\241', '\004', '\046', '\221', '\005', '\046', '\321', - '\006', '\046', '\161', '\007', '\046', '\141', '\010', '\046', - '\021', '\011', '\046', '\021', '\012', '\046', '\261', '\012', - '\046', '\241', '\013', '\046', '\141', '\014', '\046', '\161', - '\015', '\046', '\001', '\016', '\046', '\341', '\016', '\046', - '\161', '\017', '\046', '\121', '\000', '\353', '\063', '\001', - '\353', '\143', '\002', '\353', '\203', '\003', '\353', '\363', - '\004', '\353', '\323', '\005', '\353', '\003', '\007', '\353', - '\243', '\141', '\006', '\061', '\011', '\353', '\363', '\011', - '\353', '\003', '\013', '\353', '\043', '\014', '\353', '\223', - '\015', '\353', '\023', '\016', '\353', '\343', '\016', '\353', - '\123', '\017', '\353', '\023', '\000', '\377', '\263', '\077', - '\006', '\101', '\001', '\377', '\323', '\001', '\377', '\263', - '\002', '\377', '\243', '\215', '\134', '\364', '\077', '\101', - '\360', '\077', '\115', '\360', '\077', '\124', '\360', '\077', - '\324', '\150', '\020', '\157', '\360', '\077', '\203', '\360', - '\077', '\223', '\140', '\100', '\377', '\223', '\013', '\377', - '\363', '\014', '\377', '\203', '\015', '\377', '\143', '\016', - '\377', '\343', '\016', '\377', '\263', '\017', '\014', '\024', - '\101', '\012', '\020', '\101', '\023', '\020', '\101', '\041', - '\020', '\101', '\052', '\020', '\101', '\137', '\146', '\020', - '\101', '\020', '\101', '\117', '\020', '\101', '\125', '\020', - '\101', '\140', '\020', '\101', '\146', '\020', '\101', '\161', - '\020', '\101', '\310', '\101', '\032', '\246', '\201', '\032', - '\133', '\137', '\007', '\245', '\161', '\032', '\137', '\320', - '\006', '\141', '\060', '\007', '\132', '\161', '\030', '\162', - '\360', '\006', '\263', '\215', '\366', '\152', '\077', '\366', - '\145', '\257', '\025', '\142', '\120', '\366', '\145', '\100', - '\006', '\137', '\300', '\366', '\167', '\360', '\005', '\144', - '\240', '\366', '\244', '\035', '\367', '\173', '\101', '\367', - '\166', '\217', '\367', '\172', '\357', '\366', '\146', '\037', - '\331', '\162', '\357', '\367', '\162', '\220', '\366', '\167', - '\137', '\007', '\137', '\312', '\367', '\163', '\137', '\367', - '\207', '\337', '\366', '\212', '\057', '\370', '\160', '\377', - '\006', '\141', '\340', '\332', '\142', '\100', '\371', '\164', - '\040', '\371', '\221', '\375', '\006', '\147', '\360', '\006', - '\163', '\220', '\006', '\164', '\120', '\333', '\227', '\337', - '\371', '\237', '\037', '\372', '\232', '\177', '\371', '\164', - '\100', '\007', '\157', '\320', '\006', '\137', '\300', '\006', - '\145', '\140', '\006', '\231', '\077', '\006', '\247', '\261', - '\030', '\250', '\201', '\372', '\252', '\317', '\372', '\256', - '\017', '\373', '\137', '\040', '\373', '\162', '\100', '\373', - '\247', '\377', '\006', '\251', '\277', '\372', '\137', '\040', - '\007', '\151', '\160', '\006', '\150', '\020', '\373', '\263', - '\057', '\031', '\233', '\037', '\374', '\254', '\117', '\374', - '\306', '\217', '\374', '\275', '\057', '\031', '\277', '\317', - '\374', '\137', '\360', '\371', '\144', '\120', '\331', '\266', - '\057', '\374', '\326', '\137', '\006', '\323', '\177', '\373', - '\137', '\100', '\007', '\145', '\200', '\375', '\300', '\357', - '\375', '\340', '\317', '\375', '\144', '\077', '\370', '\227', - '\217', '\007', '\325', '\017', '\007', '\151', '\040', '\007', - '\141', '\240', '\244', '\351', '\277', '\376', '\355', '\377', - '\376', '\232', '\077', '\006', '\214', '\001', '\376', '\162', - '\360', '\005', '\160', '\100', '\007', '\250', '\141', '\377', - '\156', '\200', '\377', '\372', '\317', '\377', '\365', '\337', - '\376', '\143', '\340', '\372', '\243', '\321', '\376', '\143', - '\340', '\372', '\365', '\317', '\006', '\157', '\060', '\006', - '\132', '\061', '\006', '\154', '\360', '\006', '\143', '\260', - '\006', '\365', '\377', '\006', '\146', '\140', '\006', '\341', - '\077', '\366', '\165', '\220', '\331', '\262', '\157', '\006', - '\146', '\020', '\376', '\143', '\137', '\007', '\147', '\120', - '\377', '\151', '\077', '\007', '\254', '\075', '\006', '\151', - '\077', '\007', '\163', '\120', '\377', '\151', '\077', '\007', - '\163', '\060', '\374', '\145', '\140', '\007', '\222', '\261', - '\027', '\243', '\221', '\366', '\163', '\060', '\007', '\303', - '\137', '\006', '\166', '\040', '\031', '\173', '\121', '\377', - '\151', '\077', '\007', '\163', '\200', '\006', '\141', '\320', - '\376', '\243', '\221', '\366', '\163', '\060', '\007', '\150', - '\020', '\006', '\355', '\257', '\371', '\144', '\220', '\006', - '\141', '\320', '\006', '\157', '\340', '\006', '\164', '\077', - '\006', '\151', '\077', '\007', '\254', '\115', '\006', '\151', - '\020', '\006', '\155', '\360', '\006', '\156', '\100', '\367', - '\143', '\220', '\366', '\163', '\060', '\007', '\232', '\237', - '\367', '\256', '\235', '\367', '\231', '\177', '\376', '\132', - '\221', '\367', '\164', '\220', '\376', '\000', '\220', '\367', - '\164', '\020', '\377', '\347', '\257', '\025', '\171', '\137', - '\007', '\142', '\340', '\372', '\216', '\217', '\370', '\000', - '\220', '\367', '\165', '\040', '\006', '\256', '\357', '\370', - '\210', '\257', '\371', '\144', '\340', '\376', '\272', '\317', - '\006', '\207', '\161', '\006', '\225', '\115', '\006', '\356', - '\257', '\373', '\154', '\160', '\030', '\147', '\140', '\376', - '\157', '\017', '\000', '\144', '\340', '\376', '\272', '\077', - '\007', '\144', '\317', '\006', '\112', '\112', '\006', '\356', - '\257', '\373', '\163', '\100', '\366', '\154', '\300', '\006', - '\232', '\117', '\006', '\356', '\017', '\007', '\215', '\237', - '\376', '\000', '\100', '\006', '\356', '\017', '\007', '\215', - '\037', '\377', '\347', '\257', '\025', '\145', '\200', '\007', - '\143', '\200', '\006', '\141', '\340', '\006', '\147', '\120', - '\331', '\145', '\200', '\007', '\143', '\200', '\006', '\141', - '\340', '\006', '\147', '\140', '\376', '\157', '\157', '\331', - '\256', '\017', '\366', '\226', '\355', '\372', '\140', '\257', - '\371', '\235', '\057', '\006', '\142', '\340', '\372', '\250', - '\321', '\371', '\142', '\040', '\006', '\256', '\237', '\377', - '\347', '\257', '\025', '\147', '\360', '\030', '\142', '\120', - '\333', '\147', '\360', '\030', '\142', '\220', '\007', '\232', - '\217', '\006', '\141', '\340', '\006', '\144', '\300', '\134', - '\150', '\020', '\006', '\156', '\100', '\006', '\061', '\240', - '\371', '\150', '\020', '\006', '\156', '\100', '\006', '\062', - '\240', '\331', '\141', '\340', '\006', '\144', '\040', '\003', - '\232', '\237', '\027', '\207', '\341', '\332', '\171', '\161', - '\030', '\231', '\177', '\376', '\132', '\221', '\006', '\262', - '\117', '\332', '\151', '\040', '\373', '\156', '\240', '\371', - '\355', '\377', '\006', '\156', '\260', '\373', '\151', '\077', - '\007', '\254', '\335', '\376', '\157', '\340', '\006', '\273', - '\237', '\366', '\163', '\060', '\007', '\232', '\237', '\373', - '\231', '\277', '\377', '\250', '\221', '\373', '\231', '\277', - '\377', '\371', '\177', '\376', '\241', '\375', '\372', '\231', - '\277', '\375', '\111', '\372', '\372', '\231', '\277', '\375', - '\232', '\237', '\373', '\231', '\137', '\376', '\111', '\372', - '\372', '\231', '\137', '\376', '\232', '\237', '\373', '\164', - '\040', '\006', '\165', '\020', '\374', '\244', '\235', '\373', - '\164', '\040', '\006', '\165', '\020', '\374', '\156', '\240', - '\371', '\154', '\300', '\006', '\165', '\357', '\006', '\177', - '\121', '\331', '\154', '\300', '\006', '\165', '\357', '\006', - '\177', '\141', '\376', '\157', '\237', '\244', '\371', '\037', - '\006', '\156', '\360', '\027', '\225', '\315', '\006', '\371', - '\037', '\006', '\156', '\360', '\027', '\346', '\377', '\366', - '\000', '\100', '\366', '\244', '\115', '\366', '\156', '\240', - '\371', '\155', '\220', '\006', '\144', '\100', '\006', '\256', - '\057', '\006', '\165', '\020', '\374', '\244', '\335', '\006', - '\151', '\100', '\006', '\144', '\340', '\372', '\142', '\120', - '\007', '\301', '\357', '\006', '\232', '\337', '\006', '\157', - '\120', '\007', '\173', '\001', '\000', '\155', '\360', '\006', - '\165', '\260', '\027', '\232', '\017', '\007', '\214', '\061', - '\006', '\151', '\240', '\244', '\160', '\300', '\030', '\143', - '\220', '\006', '\154', '\240', '\371', '\354', '\357', '\376', - '\340', '\177', '\332', '\363', '\017', '\376', '\232', '\017', - '\007', '\154', '\120', '\007', '\254', '\015', '\007', '\154', - '\120', '\007', '\163', '\240', '\371', '\161', '\120', '\007', - '\172', '\101', '\007', '\151', '\360', '\006', '\156', '\340', - '\370', '\210', '\017', '\000', '\161', '\120', '\007', '\172', - '\101', '\007', '\151', '\360', '\006', '\156', '\340', '\370', - '\210', '\257', '\371', '\316', '\177', '\374', '\372', '\317', - '\377', '\252', '\135', '\374', '\307', '\257', '\377', '\374', - '\257', '\371', '\316', '\177', '\374', '\325', '\237', '\006', - '\327', '\257', '\332', '\305', '\177', '\374', '\325', '\237', - '\006', '\327', '\257', '\371', '\316', '\177', '\374', '\337', - '\037', '\376', '\252', '\135', '\374', '\307', '\377', '\375', - '\341', '\257', '\371', '\316', '\177', '\374', '\142', '\120', - '\007', '\301', '\117', '\332', '\316', '\177', '\374', '\142', - '\120', '\007', '\301', '\357', '\006', '\232', '\057', '\007', - '\164', '\300', '\006', '\255', '\317', '\371', '\246', '\055', - '\007', '\164', '\300', '\006', '\255', '\317', '\371', '\157', - '\240', '\371', '\163', '\020', '\006', '\151', '\300', '\006', - '\227', '\137', '\371', '\000', '\060', '\007', '\141', '\220', - '\006', '\154', '\160', '\371', '\225', '\257', '\371', '\163', - '\040', '\006', '\200', '\177', '\007', '\156', '\340', '\370', - '\210', '\017', '\000', '\163', '\040', '\006', '\200', '\177', - '\007', '\156', '\340', '\370', '\210', '\257', '\371', '\163', - '\040', '\006', '\137', '\200', '\006', '\200', '\137', '\007', - '\142', '\340', '\372', '\216', '\217', '\370', '\000', '\060', - '\007', '\142', '\360', '\005', '\150', '\000', '\370', '\165', - '\040', '\006', '\256', '\357', '\370', '\210', '\257', '\371', - '\163', '\040', '\006', '\255', '\377', '\372', '\231', '\157', - '\367', '\000', '\060', '\007', '\142', '\320', '\372', '\257', - '\237', '\371', '\177', '\177', '\376', '\132', '\061', '\007', - '\142', '\060', '\374', '\305', '\177', '\374', '\216', '\217', - '\370', '\000', '\060', '\007', '\142', '\060', '\374', '\305', - '\177', '\374', '\216', '\217', '\370', '\232', '\077', '\007', - '\142', '\360', '\005', '\221', '\157', '\367', '\000', '\060', - '\007', '\142', '\360', '\005', '\221', '\377', '\367', '\347', - '\257', '\025', '\163', '\040', '\006', '\137', '\140', '\007', - '\200', '\137', '\007', '\142', '\340', '\372', '\216', '\217', - '\370', '\000', '\060', '\007', '\142', '\360', '\005', '\166', - '\000', '\370', '\165', '\040', '\006', '\256', '\357', '\370', - '\210', '\257', '\371', '\163', '\200', '\006', '\165', '\220', - '\372', '\256', '\017', '\000', '\163', '\200', '\006', '\165', - '\220', '\372', '\256', '\257', '\371', '\237', '\257', '\007', - '\151', '\340', '\006', '\231', '\375', '\371', '\172', '\220', - '\006', '\156', '\160', '\006', '\232', '\077', '\007', '\354', - '\177', '\375', '\253', '\315', '\376', '\327', '\237', '\377', - '\347', '\257', '\025', '\163', '\000', '\007', '\356', '\237', - '\007', '\143', '\020', '\006', '\244', '\075', '\007', '\160', - '\340', '\376', '\171', '\060', '\006', '\141', '\340', '\006', - '\232', '\077', '\007', '\164', '\160', '\030', '\000', '\060', - '\007', '\164', '\160', '\030', '\232', '\117', '\007', '\207', - '\161', '\006', '\145', '\340', '\332', '\164', '\160', '\030', - '\147', '\120', '\006', '\231', '\177', '\376', '\132', '\101', - '\007', '\143', '\220', '\366', '\163', '\300', '\332', '\164', - '\060', '\006', '\151', '\077', '\007', '\163', '\240', '\371', - '\252', '\017', '\007', '\255', '\377', '\372', '\231', '\157', - '\367', '\255', '\375', '\006', '\160', '\320', '\372', '\257', - '\237', '\371', '\177', '\177', '\376', '\132', '\241', '\372', - '\160', '\320', '\372', '\257', '\017', '\375', '\264', '\337', - '\332', '\157', '\000', '\007', '\255', '\377', '\372', '\320', - '\357', '\373', '\347', '\257', '\025', '\252', '\017', '\007', - '\303', '\137', '\374', '\307', '\277', '\373', '\311', '\217', - '\032', '\252', '\017', '\007', '\303', '\137', '\374', '\307', - '\277', '\373', '\311', '\237', '\377', '\347', '\257', '\025', - '\252', '\017', '\007', '\325', '\237', '\006', '\327', '\337', - '\332', '\157', '\000', '\007', '\325', '\237', '\006', '\327', - '\257', '\371', '\252', '\017', '\007', '\337', '\037', '\376', - '\255', '\375', '\006', '\160', '\360', '\375', '\341', '\257', - '\371', '\374', '\137', '\006', '\132', '\301', '\377', '\145', - '\260', '\006', '\232', '\137', '\007', '\154', '\120', '\367', - '\156', '\360', '\027', '\225', '\135', '\007', '\154', '\120', - '\367', '\156', '\360', '\027', '\346', '\377', '\366', '\257', - '\015', '\031', '\210', '\301', '\006', '\154', '\000', '\331', - '\217', '\041', '\006', '\210', '\301', '\006', '\154', '\020', - '\006', '\232', '\017', '\366', '\165', '\357', '\006', '\177', - '\121', '\331', '\140', '\137', '\367', '\156', '\360', '\027', - '\346', '\377', '\366', '\000', '\160', '\007', '\225', '\077', - '\006', '\233', '\175', '\007', '\225', '\077', '\006', '\150', - '\240', '\371', '\170', '\200', '\377', '\143', '\201', '\007', - '\370', '\317', '\372', '\347', '\257', '\025', '\357', '\141', - '\020', '\303', '\064', '\236', '\335', '\141', '\026', '\340', - '\041', '\036', '\115', '\131', '\036', '\045', '\115', '\322', - '\011', '\001', - -}; - -static const char file_5x7[] = { - '\037', '\235', '\214', '\001', '\314', '\214', '\201', '\203', - '\000', '\200', '\301', '\000', '\006', '\023', '\032', '\244', - '\043', '\300', '\040', '\242', '\204', '\015', '\025', '\032', - '\044', '\223', '\220', '\137', '\104', '\002', '\012', '\021', - '\002', '\100', '\203', '\021', '\000', '\230', '\001', '\006', - '\013', '\112', '\004', '\200', '\053', '\201', '\101', '\144', - '\007', '\014', '\202', '\030', '\011', '\000', '\102', '\104', - '\100', '\021', '\014', '\002', '\141', '\211', '\010', '\044', - '\000', '\110', '\023', '\014', '\002', '\142', '\111', '\316', - '\200', '\101', '\014', '\027', '\022', '\152', '\124', '\110', - '\321', '\040', '\277', '\016', '\043', '\203', '\216', '\014', - '\040', '\041', '\141', '\316', '\203', '\033', '\022', '\256', - '\074', '\310', '\042', '\241', '\014', '\241', '\076', '\022', - '\026', '\021', '\272', '\044', '\141', '\023', '\241', '\133', - '\022', '\212', '\021', '\032', '\047', '\241', '\034', '\205', - '\051', '\015', '\366', '\121', '\150', '\044', '\341', '\303', - '\204', '\135', '\015', '\126', '\122', '\030', '\027', '\200', - '\050', '\241', '\252', '\022', '\262', '\122', '\170', '\325', - '\240', '\056', '\241', '\313', '\022', '\116', '\023', '\112', - '\056', '\241', '\071', '\226', '\000', '\362', '\145', '\114', - '\130', '\100', '\143', '\200', '\007', '\032', '\147', '\070', - '\306', '\241', '\361', '\315', '\120', '\005', '\011', '\355', - '\014', '\075', '\223', '\060', '\320', '\120', '\237', '\006', - '\025', '\015', '\055', '\240', '\260', '\222', '\106', '\043', - '\117', '\234', '\120', '\161', '\022', '\244', '\111', '\221', - '\057', '\122', '\212', '\034', '\111', '\062', '\205', '\212', - '\224', '\054', '\006', '\121', '\127', '\161', '\102', '\344', - '\066', '\200', '\046', '\151', '\346', '\214', '\001', '\140', - '\244', '\165', '\022', '\046', '\131', '\276', '\260', '\166', - '\115', '\074', '\015', '\236', '\062', '\024', '\257', '\024', - '\111', '\162', '\004', '\011', '\025', '\345', '\255', '\267', - '\066', '\201', '\236', '\246', '\116', '\033', '\000', '\123', - '\230', '\004', '\121', '\015', '\100', '\012', '\370', '\042', - '\124', '\256', '\044', '\041', '\102', '\005', '\011', '\166', - '\346', '\116', '\336', '\310', '\151', '\023', '\206', '\015', - '\200', '\040', '\104', '\210', '\174', '\251', '\235', '\205', - '\311', '\353', '\345', '\133', '\001', '\000', '\105', '\022', - '\130', '\024', '\301', '\304', '\176', '\111', '\150', '\261', - '\025', '\024', '\117', '\044', '\241', '\032', '\202', '\012', - '\226', '\127', '\304', '\024', '\117', '\060', '\121', '\005', - '\025', '\111', '\244', '\366', '\005', '\026', '\022', '\122', - '\150', '\041', '\206', '\032', '\342', '\066', '\005', '\024', - '\101', '\014', '\341', '\340', '\021', '\000', '\014', '\161', - '\237', '\025', '\105', '\110', '\021', '\304', '\021', '\257', - '\251', '\307', '\036', '\022', '\051', '\042', '\021', '\204', - '\024', '\123', '\240', '\007', '\233', '\154', '\264', '\331', - '\206', '\033', '\155', '\117', '\340', '\200', '\103', '\015', - '\071', '\324', '\170', '\143', '\216', '\327', '\025', '\341', - '\304', '\020', '\117', '\020', '\161', '\042', '\000', '\061', - '\000', '\260', '\033', '\021', '\055', '\062', '\341', '\340', - '\153', '\014', '\116', '\221', '\004', '\210', '\116', '\000', - '\100', '\145', '\155', '\016', '\006', '\301', '\145', '\212', - '\117', '\100', '\221', '\205', '\024', '\324', '\131', '\227', - '\342', '\033', '\160', '\344', '\041', '\107', '\032', '\147', - '\240', '\101', '\007', '\010', '\061', '\344', '\220', '\103', - '\014', '\054', '\320', '\151', '\047', '\016', '\040', '\120', - '\201', '\106', '\031', '\040', '\074', '\001', '\107', '\031', - '\156', '\200', '\160', '\204', '\034', '\157', '\324', '\001', - '\007', '\161', '\251', '\121', '\001', '\100', '\013', '\300', - '\011', '\327', '\202', '\021', '\316', '\101', '\007', '\051', - '\167', '\336', '\265', '\040', '\105', '\013', '\361', '\315', - '\127', '\137', '\013', '\055', '\334', '\020', '\052', '\014', - '\241', '\326', '\120', '\152', '\013', '\103', '\264', '\120', - '\003', '\251', '\100', '\012', '\111', '\144', '\013', '\121', - '\112', '\227', '\246', '\243', '\261', '\171', '\170', '\141', - '\206', '\135', '\142', '\361', '\005', '\022', '\323', '\125', - '\347', '\150', '\024', '\125', '\340', '\367', '\205', '\214', - '\355', '\041', '\046', '\224', '\102', '\240', '\001', '\060', - '\324', '\120', '\006', '\221', '\106', '\232', '\117', '\314', - '\002', '\340', '\323', '\263', '\312', '\032', '\153', '\355', - '\265', '\330', '\146', '\133', '\055', '\000', '\340', '\000', - '\000', '\110', '\041', '\205', '\030', '\022', '\310', '\267', - '\341', '\216', '\013', '\256', '\270', '\344', '\242', '\173', - '\256', '\271', '\345', '\246', '\313', '\256', '\272', '\355', - '\256', '\353', '\356', '\274', '\362', '\326', '\033', '\357', - '\275', '\350', '\032', '\202', '\357', '\273', '\374', '\322', - '\333', '\256', '\276', '\360', '\006', '\334', '\257', '\275', - '\002', '\373', '\133', '\060', '\301', '\003', '\357', '\153', - '\160', '\302', '\007', '\053', '\214', '\360', '\302', '\020', - '\077', '\054', '\261', '\303', '\024', '\067', '\154', '\061', - '\303', '\030', '\107', '\134', '\161', '\306', '\023', '\137', - '\254', '\261', '\307', '\035', '\163', '\274', '\361', '\307', - '\042', '\203', '\074', '\162', '\310', '\044', '\247', '\374', - '\060', '\300', '\045', '\267', '\234', '\062', '\313', '\052', - '\237', '\054', '\263', '\311', '\064', '\273', '\214', '\362', - '\315', '\063', '\333', '\234', '\163', '\314', '\065', '\363', - '\254', '\163', '\317', '\070', '\003', '\275', '\163', '\320', - '\077', '\027', '\355', '\363', '\321', '\104', '\043', '\075', - '\164', '\271', '\043', '\165', '\073', '\122', '\132', '\000', - '\070', '\220', '\120', '\005', '\011', '\161', '\220', '\320', - '\010', '\011', '\251', '\220', '\120', '\224', '\006', '\341', - '\220', '\320', '\017', '\011', '\265', '\145', '\320', '\127', - '\006', '\071', '\152', '\120', '\130', '\006', '\215', '\145', - '\120', '\032', '\011', '\055', '\152', '\320', '\035', '\011', - '\371', '\221', '\120', '\041', '\011', '\061', '\222', '\320', - '\044', '\011', '\151', '\222', '\120', '\050', '\011', '\241', - '\222', '\320', '\053', '\011', '\331', '\222', '\120', '\057', - '\011', '\021', '\223', '\120', '\140', '\006', '\111', '\223', - '\120', '\066', '\011', '\071', '\015', '\300', '\071', '\011', - '\271', '\223', '\120', '\075', '\025', '\045', '\064', '\200', - '\106', '\012', '\150', '\024', '\201', '\106', '\030', '\150', - '\364', '\201', '\106', '\046', '\150', '\324', '\202', '\106', - '\064', '\150', '\264', '\203', '\106', '\102', '\150', '\224', - '\204', '\106', '\120', '\150', '\164', '\205', '\106', '\136', - '\150', '\124', '\206', '\106', '\154', '\150', '\064', '\207', - '\106', '\172', '\150', '\344', '\231', '\103', '\032', '\075', - '\242', '\221', '\045', '\032', '\165', '\242', '\021', '\051', - '\032', '\255', '\242', '\221', '\054', '\032', '\345', '\242', - '\021', '\060', '\032', '\035', '\243', '\221', '\063', '\032', - '\125', '\243', '\021', '\067', '\032', '\215', '\243', '\221', - '\072', '\032', '\305', '\243', '\021', '\076', '\032', '\375', - '\243', '\221', '\001', '\021', '\065', '\020', '\021', '\005', - '\021', '\155', '\020', '\221', '\010', '\021', '\245', '\020', - '\021', '\014', '\021', '\335', '\020', '\221', '\017', '\021', - '\025', '\021', '\021', '\023', '\021', '\115', '\021', '\221', - '\026', '\021', '\205', '\021', '\021', '\032', '\021', '\275', - '\021', '\221', '\035', '\021', '\351', '\103', '\104', '\010', - '\021', '\221', '\105', '\104', '\104', '\022', '\021', '\311', - '\104', '\104', '\100', '\021', '\221', '\123', '\104', '\304', - '\025', '\021', '\251', '\105', '\104', '\170', '\021', '\221', - '\141', '\104', '\104', '\031', '\021', '\211', '\106', '\104', - '\260', '\021', '\221', '\157', '\104', '\304', '\034', '\021', - '\151', '\107', '\104', '\350', '\021', '\221', '\175', '\104', - '\104', '\000', '\066', '\111', '\200', '\115', '\040', '\140', - '\223', '\013', '\330', '\304', '\003', '\066', '\051', '\201', - '\115', '\130', '\140', '\223', '\031', '\330', '\104', '\007', - '\066', '\011', '\202', '\115', '\220', '\140', '\223', '\047', - '\330', '\304', '\012', '\066', '\351', '\202', '\115', '\310', - '\140', '\223', '\065', '\330', '\104', '\016', '\066', '\311', - '\203', '\115', '\000', '\141', '\223', '\103', '\330', '\304', - '\021', '\066', '\251', '\204', '\115', '\070', '\141', '\223', - '\121', '\330', '\104', '\025', '\066', '\211', '\205', '\115', - '\160', '\141', '\223', '\137', '\330', '\304', '\030', '\066', - '\151', '\206', '\115', '\250', '\141', '\223', '\155', '\330', - '\104', '\034', '\066', '\111', '\207', '\115', '\340', '\141', - '\223', '\173', '\330', '\304', '\037', '\066', '\051', '\100', - '\107', '\030', '\320', '\221', '\011', '\164', '\104', '\003', - '\035', '\011', '\101', '\107', '\120', '\320', '\221', '\027', - '\164', '\304', '\006', '\035', '\351', '\101', '\107', '\210', - '\320', '\221', '\045', '\164', '\104', '\012', '\035', '\311', - '\102', '\107', '\300', '\320', '\221', '\063', '\164', '\304', - '\015', '\035', '\251', '\103', '\107', '\370', '\320', '\221', - '\101', '\164', '\104', '\021', '\035', '\211', '\104', '\107', - '\060', '\321', '\221', '\117', '\164', '\304', '\024', '\035', - '\151', '\105', '\107', '\150', '\321', '\221', '\135', '\164', - '\104', '\030', '\035', '\111', '\106', '\107', '\240', '\321', - '\221', '\153', '\164', '\304', '\033', '\035', '\051', '\107', - '\107', '\330', '\321', '\221', '\171', '\164', '\104', '\037', - '\035', '\011', '\000', '\151', '\000', '\200', '\200', '\135', - '\076', '\140', '\227', '\026', '\330', '\145', '\007', '\166', - '\111', '\202', '\135', '\256', '\140', '\227', '\062', '\330', - '\145', '\016', '\166', '\011', '\204', '\135', '\036', '\141', - '\227', '\116', '\330', '\145', '\025', '\166', '\311', '\205', - '\135', '\216', '\141', '\227', '\152', '\330', '\145', '\034', - '\166', '\211', '\207', '\135', '\376', '\141', '\227', '\206', - '\330', '\145', '\043', '\166', '\111', '\211', '\135', '\156', - '\142', '\227', '\242', '\330', '\145', '\052', '\166', '\011', - '\213', '\135', '\336', '\142', '\227', '\276', '\330', '\145', - '\061', '\166', '\311', '\214', '\135', '\116', '\143', '\227', - '\332', '\330', '\145', '\070', '\166', '\211', '\216', '\135', - '\276', '\143', '\227', '\366', '\330', '\145', '\077', '\166', - '\111', '\000', '\320', '\054', '\000', '\064', '\022', '\000', - '\115', '\006', '\100', '\003', '\002', '\320', '\000', '\201', - '\001', '\072', '\301', '\300', '\326', '\014', '\362', '\200', - '\212', '\132', '\324', '\040', '\004', '\160', '\300', '\007', - '\034', '\200', '\021', '\005', '\024', '\300', '\243', '\036', - '\005', '\100', '\001', '\016', '\120', '\200', '\002', '\160', - '\224', '\000', '\227', '\033', '\100', '\003', '\010', '\100', - '\307', '\224', '\032', '\100', '\001', '\057', '\015', '\100', - '\000', '\006', '\100', '\107', '\072', '\022', '\100', '\001', - '\035', '\301', '\050', '\107', '\243', '\146', '\220', '\004', - '\054', '\240', '\001', '\011', '\040', '\000', '\113', '\113', - '\132', '\000', '\001', '\234', '\124', '\250', '\004', '\200', - '\132', '\102', '\016', '\200', '\324', '\252', '\041', '\025', - '\251', '\126', '\303', '\250', '\120', '\077', '\320', '\324', - '\017', '\260', '\304', '\252', '\043', '\301', '\252', '\104', - '\264', '\252', '\020', '\253', '\102', '\365', '\251', '\102', - '\145', '\052', '\130', '\271', '\152', '\020', '\252', '\202', - '\365', '\251', '\010', '\040', '\200', '\000', '\010', '\200', - '\000', '\251', '\255', '\065', '\255', '\106', '\115', '\210', - '\003', '\024', '\100', '\327', '\220', '\160', '\324', '\001', - '\021', '\141', '\200', '\000', '\016', '\040', '\200', '\006', - '\050', '\044', '\247', '\054', '\171', '\052', '\000', '\072', - '\132', '\127', '\205', '\050', '\340', '\003', '\207', '\305', - '\114', '\324', '\114', '\112', '\001', '\251', '\005', '\040', - '\250', '\002', '\110', '\200', '\110', '\004', '\120', '\324', - '\217', '\112', '\113', '\000', '\314', '\122', '\253', '\000', - '\066', '\213', '\221', '\265', '\042', '\065', '\042', '\105', - '\345', '\053', '\101', '\011', '\140', '\126', '\211', '\200', - '\157', '\050', '\017', '\140', '\211', '\001', '\100', '\003', - '\127', '\215', '\120', '\226', '\250', '\015', '\101', '\341', - '\146', '\367', '\052', '\055', '\311', '\252', '\065', '\265', - '\017', '\100', '\200', '\001', '\020', '\220', '\000', '\237', - '\024', '\264', '\000', '\017', '\020', '\052', '\000', '\040', - '\163', '\000', '\336', '\372', '\304', '\000', '\001', '\070', - '\100', '\002', '\172', '\073', '\334', '\264', '\152', '\266', - '\266', '\006', '\130', '\356', '\161', '\227', '\353', '\000', - '\335', '\032', '\144', '\265', '\322', '\002', '\015', '\166', - '\117', '\073', '\130', '\314', '\256', '\065', '\041', '\270', - '\025', '\312', '\132', '\061', '\013', '\000', '\312', '\252', - '\265', '\274', '\265', '\155', '\100', '\003', '\002', '\060', - '\335', '\004', '\074', '\140', '\271', '\000', '\120', '\256', - '\162', '\023', '\220', '\222', '\350', '\312', '\224', '\271', - '\363', '\135', '\156', '\112', '\210', '\053', '\123', '\334', - '\046', '\127', '\246', '\010', '\261', '\057', '\120', '\245', - '\266', '\334', '\367', '\302', '\227', '\257', '\263', '\115', - '\011', '\002', '\026', '\154', '\134', '\000', '\044', '\240', - '\000', '\003', '\030', '\100', '\001', '\114', '\002', '\340', - '\376', '\072', '\270', '\242', '\313', '\065', '\211', '\117', - '\177', '\012', '\324', '\332', '\146', '\330', '\047', '\363', - '\075', '\200', '\114', '\075', '\354', '\323', '\335', '\206', - '\170', '\302', '\265', '\135', '\053', '\176', '\147', '\273', - '\131', '\007', '\147', '\230', '\271', '\057', '\306', '\156', - '\206', '\061', '\354', '\342', '\325', '\302', '\027', '\266', - '\055', '\316', '\255', '\132', '\037', '\023', '\337', '\012', - '\247', '\045', '\000', '\157', '\065', '\210', '\130', '\303', - '\132', '\336', '\135', '\042', '\046', '\265', '\003', '\370', - '\256', '\104', '\034', '\220', '\200', '\006', '\140', '\106', - '\246', '\041', '\116', '\010', '\162', '\331', '\313', '\313', - '\266', '\122', '\127', '\312', '\015', '\030', '\200', '\157', - '\025', '\260', '\327', '\026', '\033', '\204', '\311', '\310', - '\165', '\000', '\224', '\063', '\214', '\336', '\044', '\323', - '\026', '\043', '\110', '\055', '\252', '\114', '\041', '\214', - '\142', '\063', '\157', '\026', '\152', '\300', '\205', '\257', - '\220', '\311', '\174', '\135', '\351', '\056', '\125', '\277', - '\032', '\141', '\162', '\002', '\252', '\073', '\347', '\021', - '\177', '\231', '\246', '\051', '\171', '\363', '\146', '\041', - '\332', '\323', '\053', '\067', '\253', '\244', '\021', '\161', - '\161', '\105', '\023', '\322', '\333', '\350', '\062', '\072', - '\001', '\070', '\215', '\110', '\160', '\005', '\220', '\132', - '\265', '\232', '\271', '\263', '\054', '\156', '\010', '\220', - '\301', '\107', '\336', '\220', '\152', '\353', '\257', '\203', - '\155', '\352', '\140', '\035', '\120', '\322', '\235', '\352', - '\225', '\257', '\176', '\005', '\100', '\004', '\346', '\352', - '\200', '\230', '\040', '\032', '\301', '\122', '\015', '\065', - '\000', '\364', '\372', '\122', '\006', '\350', '\126', '\261', - '\012', '\151', '\165', '\005', '\046', '\120', '\201', '\125', - '\033', '\240', '\000', '\311', '\112', '\210', '\004', '\022', - '\320', '\024', '\360', '\212', '\104', '\041', '\251', '\375', - '\162', '\004', '\056', '\060', '\201', '\011', '\254', '\072', - '\331', '\177', '\305', '\351', '\137', '\111', '\073', '\125', - '\151', '\251', '\065', '\131', '\253', '\055', '\150', '\102', - '\316', '\073', '\222', '\014', '\213', '\330', '\001', '\013', - '\130', '\000', '\135', '\025', '\213', '\135', '\304', '\250', - '\265', '\240', '\031', '\205', '\110', '\121', '\273', '\075', - '\354', '\203', '\334', '\227', '\001', '\325', '\005', '\160', - '\003', '\322', '\312', '\200', '\010', '\013', '\140', '\001', - '\360', '\106', '\100', '\154', '\165', '\331', '\220', '\350', - '\272', '\027', '\276', '\376', '\066', '\260', '\207', '\005', - '\036', '\160', '\200', '\027', '\330', '\340', '\377', '\066', - '\011', '\251', '\033', '\100', '\122', '\277', '\332', '\367', - '\261', '\340', '\343', '\057', '\217', '\045', '\356', '\137', - '\021', '\117', '\374', '\277', '\074', '\106', '\360', '\233', - '\343', '\313', '\342', '\224', '\150', '\234', '\266', '\037', - '\367', '\270', '\002', '\304', '\255', '\200', '\224', '\000', - '\225', '\303', '\046', '\361', '\267', '\235', '\125', '\316', - '\134', '\226', '\267', '\167', '\345', '\061', '\146', '\264', - '\215', '\243', '\246', '\336', '\160', '\247', '\344', '\305', - '\060', '\216', '\071', '\316', '\175', '\262', '\163', '\221', - '\042', '\272', '\305', '\311', '\245', '\357', '\210', '\243', - '\253', '\334', '\005', '\064', '\146', '\255', '\114', '\166', - '\162', '\167', '\223', '\216', '\231', '\233', '\062', '\035', - '\000', '\036', '\175', '\072', '\146', '\236', '\276', '\332', - '\247', '\177', '\271', '\001', '\046', '\225', '\262', '\114', - '\071', '\135', '\320', '\054', '\373', '\126', '\000', '\006', - '\360', '\172', '\221', '\303', '\256', '\145', '\221', '\112', - '\113', '\354', '\100', '\066', '\163', '\240', '\147', '\272', - '\161', '\312', '\252', '\335', '\354', '\157', '\027', '\000', - '\003', '\374', '\355', '\023', '\217', '\346', '\267', '\274', - '\005', '\265', '\363', '\265', '\127', '\356', '\341', '\272', - '\003', '\333', '\316', '\317', '\262', '\263', '\264', '\206', - '\073', '\370', '\253', '\057', '\040', '\320', '\004', '\310', - '\260', '\324', '\324', '\252', '\370', '\301', '\067', '\036', - '\063', '\215', '\147', '\074', '\244', '\317', '\033', '\164', - '\241', '\103', '\176', '\362', '\211', '\116', '\310', '\077', - '\214', '\205', '\220', '\206', '\200', '\004', '\043', '\324', - '\122', '\260', '\203', '\241', '\016', '\200', '\005', '\314', - '\032', '\000', '\176', '\225', '\132', '\152', '\041', '\240', - '\152', '\000', '\064', '\045', '\047', '\024', '\000', '\000', - '\325', '\054', '\000', '\200', '\240', '\110', '\064', '\003', - '\000', '\320', '\000', '\000', '\242', '\142', '\065', '\244', - '\170', '\000', '\000', '\126', '\135', '\111', '\010', '\000', - '\040', '\002', '\000', '\140', '\215', '\004', '\000', '\050', - '\001', '\000', '\114', '\000', '\200', '\023', '\000', '\000', - '\005', '\000', '\110', '\001', '\000', '\264', '\266', '\002', - '\000', '\124', '\245', '\005', '\000', '\160', '\001', '\000', - '\136', '\000', '\000', '\030', '\100', '\011', '\000', '\127', - '\231', '\001', '\000', '\150', '\000', '\200', '\032', '\000', - '\300', '\006', '\000', '\270', '\001', '\000', '\274', '\126', - '\044', '\035', '\000', '\140', '\007', '\000', '\340', '\001', - '\000', '\172', '\000', '\200', '\254', '\200', '\155', '\046', - '\101', '\000', '\200', '\020', '\122', '\344', '\045', '\000', - '\154', '\245', '\055', '\050', '\102', '\043', '\111', '\000', - '\000', '\112', '\000', '\000', '\135', '\301', '\004', '\277', - '\001', '\000', '\135', '\362', '\004', '\002', '\002', '\000', - '\121', '\120', '\036', '\340', '\001', '\000', '\216', '\122', - '\005', '\000', '\140', '\005', '\000', '\160', '\005', '\000', - '\300', '\041', '\270', '\241', '\005', '\000', '\020', '\026', - '\134', '\000', '\000', '\135', '\000', '\000', '\136', '\000', - '\000', '\137', '\340', '\021', '\000', '\020', '\006', '\000', - '\060', '\026', '\303', '\101', '\021', '\145', '\000', '\000', - '\146', '\000', '\000', '\234', '\201', '\006', '\000', '\300', - '\066', '\152', '\000', '\000', '\153', '\000', '\000', '\366', - '\361', '\035', '\156', '\000', '\000', '\157', '\000', '\000', - '\213', '\122', '\026', '\147', '\061', '\007', '\000', '\100', - '\007', '\000', '\120', '\007', '\000', '\140', '\007', '\000', - '\000', '\067', '\170', '\000', '\000', '\171', '\000', '\000', - '\172', '\000', '\000', '\173', '\000', '\000', '\174', '\000', - '\000', '\153', '\041', '\067', '\177', '\000', '\000', '\377', - '\220', '\205', '\132', '\270', '\205', '\134', '\330', '\205', - '\136', '\370', '\205', '\140', '\030', '\206', '\140', '\270', - '\023', '\201', '\000', '\000', '\202', '\000', '\000', '\203', - '\000', '\000', '\204', '\000', '\000', '\164', '\143', '\010', - '\000', '\160', '\010', '\000', '\360', '\020', '\211', '\000', - '\000', '\212', '\000', '\000', '\213', '\000', '\000', '\166', - '\323', '\010', '\000', '\340', '\010', '\000', '\360', '\010', - '\067', '\001', '\000', '\221', '\000', '\000', '\222', '\000', - '\000', '\170', '\103', '\011', '\000', '\060', '\027', '\226', - '\000', '\000', '\227', '\000', '\000', '\230', '\000', '\000', - '\231', '\000', '\000', '\172', '\263', '\011', '\000', '\300', - '\011', '\000', '\320', '\011', '\000', '\340', '\011', '\000', - '\360', '\011', '\000', '\000', '\012', '\000', '\300', '\067', - '\167', '\061', '\012', '\000', '\100', '\012', '\000', '\120', - '\012', '\000', '\140', '\012', '\000', '\160', '\012', '\000', - '\340', '\067', '\251', '\000', '\000', '\171', '\261', '\012', - '\000', '\260', '\027', '\255', '\000', '\000', '\256', '\000', - '\000', '\200', '\003', '\013', '\000', '\020', '\013', '\000', - '\040', '\013', '\000', '\060', '\013', '\000', '\100', '\013', - '\000', '\120', '\013', '\000', '\040', '\070', '\267', '\100', - '\022', '\000', '\220', '\013', '\000', '\360', '\027', '\273', - '\000', '\000', '\274', '\000', '\000', '\204', '\343', '\013', - '\000', '\360', '\013', '\000', '\000', '\014', '\000', '\020', - '\014', '\000', '\040', '\014', '\000', '\060', '\014', '\000', - '\140', '\070', '\305', '\000', '\000', '\306', '\000', '\000', - '\307', '\000', '\000', '\310', '\000', '\000', '\311', '\000', - '\000', '\312', '\000', '\000', '\201', '\301', '\014', '\000', - '\320', '\014', '\000', '\340', '\014', '\000', '\360', '\014', - '\000', '\000', '\015', '\000', '\020', '\015', '\000', '\240', - '\070', '\203', '\101', '\015', '\000', '\120', '\015', '\000', - '\140', '\015', '\000', '\160', '\015', '\000', '\200', '\015', - '\000', '\300', '\070', '\332', '\000', '\000', '\333', '\000', - '\000', '\334', '\000', '\000', '\335', '\000', '\000', '\336', - '\000', '\000', '\337', '\300', '\022', '\216', '\003', '\101', - '\006', '\341', '\220', '\262', '\370', '\100', '\022', '\371', - '\220', '\023', '\031', '\221', '\024', '\171', '\221', '\026', - '\231', '\221', '\020', '\271', '\221', '\025', '\311', '\221', - '\030', '\351', '\221', '\032', '\331', '\221', '\042', '\371', - '\221', '\043', '\031', '\222', '\044', '\171', '\222', '\046', - '\231', '\222', '\040', '\271', '\222', '\045', '\311', '\222', - '\050', '\351', '\222', '\052', '\331', '\222', '\062', '\371', - '\222', '\063', '\031', '\223', '\064', '\171', '\223', '\066', - '\231', '\223', '\060', '\271', '\223', '\065', '\311', '\223', - '\070', '\351', '\223', '\072', '\331', '\223', '\102', '\371', - '\223', '\103', '\031', '\224', '\104', '\171', '\224', '\106', - '\231', '\224', '\100', '\271', '\224', '\105', '\311', '\224', - '\110', '\351', '\224', '\112', '\331', '\224', '\122', '\371', - '\224', '\123', '\031', '\225', '\124', '\171', '\225', '\126', - '\231', '\225', '\012', '\341', '\070', '\012', '\141', '\144', - '\270', '\006', '\155', '\261', '\147', '\020', '\270', '\147', - '\020', '\277', '\147', '\020', '\130', '\143', '\020', '\320', - '\147', '\020', '\330', '\147', '\020', '\175', '\221', '\176', - '\011', '\041', '\177', '\006', '\221', '\177', '\271', '\001', - '\027', '\011', '\001', '\005', '\011', '\101', '\201', '\006', - '\301', '\201', '\006', '\121', '\202', '\023', '\221', '\020', - '\154', '\143', '\020', '\073', '\150', '\020', '\102', '\150', - '\020', '\113', '\250', '\026', '\011', '\161', '\206', '\006', - '\001', '\207', '\006', '\141', '\067', '\006', '\021', '\210', - '\006', '\221', '\210', '\006', '\041', '\211', '\006', '\301', - '\211', '\006', '\101', '\212', '\006', '\201', '\212', '\006', - '\261', '\212', '\006', '\341', '\212', '\006', '\021', '\213', - '\006', '\001', '\070', '\006', '\201', '\213', '\006', '\301', - '\213', '\006', '\001', '\214', '\006', '\061', '\214', '\006', - '\141', '\214', '\006', '\221', '\214', '\006', '\101', '\070', - '\006', '\001', '\215', '\006', '\101', '\215', '\006', '\201', - '\215', '\006', '\261', '\215', '\006', '\361', '\215', '\006', - '\061', '\216', '\006', '\201', '\070', '\351', '\230', '\020', - '\356', '\150', '\020', '\362', '\150', '\020', '\203', '\141', - '\020', '\370', '\150', '\020', '\374', '\150', '\020', '\214', - '\143', '\020', '\003', '\151', '\020', '\007', '\151', '\020', - '\013', '\151', '\020', '\341', '\220', '\020', '\343', '\220', - '\020', '\345', '\220', '\020', '\220', '\143', '\020', '\351', - '\220', '\020', '\353', '\220', '\020', '\355', '\220', '\020', - '\357', '\220', '\020', '\361', '\220', '\020', '\363', '\060', - '\071', '\011', '\161', '\017', '\011', '\241', '\030', '\006', - '\261', '\017', '\011', '\321', '\017', '\232', '\047', '\024', - '\032', '\161', '\071', '\315', '\242', '\021', '\042', '\326', - '\123', '\032', '\261', '\000', '\032', '\261', '\136', '\024', - '\245', '\071', '\032', '\061', '\001', '\032', '\121', '\001', - '\032', '\161', '\001', '\032', '\221', '\001', '\032', '\261', - '\001', '\032', '\321', '\001', '\236', '\243', '\021', '\041', - '\240', '\021', '\043', '\240', '\021', '\045', '\240', '\021', - '\047', '\240', '\021', '\051', '\240', '\021', '\053', '\040', - '\072', '\032', '\361', '\002', '\032', '\021', '\003', '\221', - '\241', '\021', '\065', '\240', '\021', '\067', '\240', '\021', - '\071', '\140', '\072', '\032', '\321', '\003', '\032', '\361', - '\003', '\032', '\021', '\004', '\032', '\061', '\004', '\032', - '\121', '\004', '\032', '\161', '\004', '\252', '\243', '\021', - '\113', '\240', '\021', '\115', '\240', '\021', '\117', '\240', - '\021', '\121', '\240', '\021', '\123', '\240', '\021', '\125', - '\340', '\072', '\032', '\221', '\005', '\032', '\261', '\005', - '\032', '\321', '\005', '\032', '\361', '\005', '\032', '\021', - '\006', '\032', '\161', '\006', '\264', '\243', '\021', '\161', - '\240', '\021', '\232', '\141', '\020', '\173', '\240', '\021', - '\200', '\240', '\021', '\205', '\240', '\021', '\242', '\141', - '\020', '\276', '\143', '\020', '\224', '\240', '\021', '\231', - '\240', '\021', '\236', '\240', '\021', '\243', '\240', '\021', - '\250', '\240', '\021', '\255', '\160', '\074', '\032', '\161', - '\013', '\032', '\301', '\013', '\032', '\021', '\014', '\032', - '\141', '\014', '\032', '\261', '\014', '\032', '\001', '\015', - '\321', '\243', '\021', '\332', '\240', '\021', '\337', '\240', - '\021', '\344', '\240', '\021', '\351', '\240', '\021', '\356', - '\240', '\021', '\363', '\260', '\075', '\032', '\321', '\017', - '\256', '\025', '\021', '\174', '\365', '\145', '\021', '\061', - '\001', '\021', '\201', '\001', '\021', '\321', '\001', '\347', - '\023', '\021', '\047', '\020', '\021', '\054', '\020', '\021', - '\061', '\020', '\021', '\070', '\020', '\021', '\075', '\020', - '\021', '\102', '\020', '\021', '\107', '\060', '\077', '\021', - '\021', '\005', '\021', '\141', '\005', '\021', '\261', '\005', - '\021', '\001', '\006', '\021', '\121', '\006', '\021', '\301', - '\006', '\021', '\021', '\007', '\377', '\023', '\021', '\173', - '\360', '\022', '\021', '\121', '\010', '\021', '\241', '\010', - '\021', '\021', '\011', '\021', '\141', '\011', '\021', '\261', - '\011', '\013', '\024', '\021', '\245', '\020', '\021', '\252', - '\020', '\021', '\257', '\020', '\021', '\267', '\060', '\101', - '\021', '\021', '\014', '\021', '\141', '\014', '\021', '\261', - '\014', '\021', '\001', '\015', '\021', '\121', '\015', '\021', - '\241', '\015', '\021', '\041', '\016', '\021', '\161', '\016', - '\021', '\301', '\016', '\021', '\021', '\017', '\021', '\141', - '\017', '\045', '\224', '\150', '\161', '\144', '\023', '\012', - '\140', '\023', '\017', '\140', '\023', '\024', '\140', '\023', - '\031', '\360', '\102', '\066', '\061', '\002', '\066', '\201', - '\002', '\066', '\321', '\002', '\066', '\041', '\003', '\066', - '\161', '\003', '\066', '\301', '\003', '\071', '\144', '\023', - '\106', '\140', '\023', '\113', '\140', '\023', '\120', '\140', - '\023', '\125', '\140', '\023', '\103', '\000', '\003', '\370', - '\232', '\042', '\370', '\032', '\045', '\367', '\012', '\003', - '\127', '\321', '\257', '\342', '\327', '\257', '\344', '\327', - '\257', '\346', '\327', '\257', '\350', '\327', '\257', '\352', - '\167', '\257', '\061', '\340', '\175', '\012', '\313', '\257', - '\060', '\020', '\003', '\377', '\372', '\260', '\001', '\373', - '\260', '\003', '\373', '\260', '\005', '\373', '\260', '\007', - '\373', '\260', '\011', '\353', '\257', '\014', '\353', '\257', - '\016', '\053', '\003', '\021', '\053', '\003', '\023', '\053', - '\003', '\025', '\053', '\003', '\027', '\053', '\003', '\031', - '\053', '\003', '\033', '\073', '\003', '\035', '\073', '\003', - '\016', '\073', '\003', '\021', '\073', '\003', '\023', '\073', - '\003', '\025', '\073', '\003', '\027', '\073', '\003', '\031', - '\073', '\003', '\033', '\113', '\003', '\336', '\067', '\174', - '\305', '\167', '\174', '\311', '\267', '\174', '\315', '\367', - '\174', '\321', '\067', '\175', '\000', '\120', '\175', '\327', - '\227', '\175', '\333', '\327', '\175', '\337', '\027', '\176', - '\343', '\127', '\176', '\347', '\347', '\226', '\354', '\007', - '\000', '\356', '\007', '\177', '\362', '\107', '\177', '\366', - '\007', '\000', '\370', '\247', '\177', '\374', '\107', '\004', - '\376', '\107', '\034', '\000', '\020', '\200', '\000', '\060', - '\200', '\005', '\170', '\200', '\011', '\270', '\200', '\015', - '\370', '\200', '\346', '\061', '\005', '\022', '\050', '\045', - '\025', '\170', '\201', '\031', '\010', '\000', '\033', '\330', - '\201', '\000', '\360', '\201', '\041', '\070', '\202', '\045', - '\010', '\006', '\047', '\230', '\202', '\000', '\260', '\202', - '\000', '\320', '\202', '\057', '\030', '\203', '\063', '\010', - '\000', '\065', '\170', '\203', '\071', '\010', '\000', '\073', - '\330', '\203', '\077', '\010', '\000', '\101', '\070', '\204', - '\105', '\170', '\204', '\111', '\010', '\000', '\113', '\330', - '\204', '\117', '\030', '\205', '\123', '\130', '\205', '\372', - '\307', '\006', '\141', '\340', '\006', '\067', '\070', '\004', - '\061', '\140', '\003', '\014', '\373', '\271', '\374', '\372', - '\271', '\377', '\372', '\271', '\001', '\373', '\271', '\003', - '\373', '\271', '\005', '\373', '\271', '\007', '\373', '\271', - '\011', '\373', '\271', '\136', '\343', '\271', '\066', '\120', - '\044', '\236', '\173', '\003', '\241', '\173', '\003', '\243', - '\173', '\003', '\245', '\173', '\003', '\247', '\173', '\003', - '\251', '\173', '\003', '\253', '\173', '\003', '\255', '\173', - '\003', '\257', '\173', '\003', '\261', '\033', '\003', '\067', - '\100', '\273', '\061', '\200', '\003', '\241', '\213', '\003', - '\243', '\213', '\003', '\245', '\213', '\003', '\247', '\213', - '\003', '\251', '\073', '\044', '\051', '\262', '\274', '\255', - '\213', '\003', '\257', '\053', '\044', '\327', '\213', '\003', - '\312', '\233', '\003', '\241', '\173', '\047', '\367', '\161', - '\006', '\162', '\020', '\006', '\166', '\320', '\202', '\236', - '\233', '\003', '\247', '\233', '\003', '\251', '\233', '\003', - '\253', '\233', '\003', '\255', '\233', '\003', '\257', '\233', - '\003', '\307', '\153', '\047', '\376', '\107', '\276', '\346', - '\213', '\276', '\062', '\360', '\260', '\051', '\262', '\277', - '\377', '\272', '\277', '\001', '\273', '\277', '\003', '\273', - '\277', '\005', '\273', '\277', '\007', '\273', '\277', '\011', - '\273', '\277', '\261', '\273', '\277', '\105', '\362', '\004', - '\370', '\173', '\276', '\375', '\033', '\003', '\374', '\052', - '\003', '\020', '\033', '\301', '\001', '\034', '\003', '\003', - '\034', '\003', '\005', '\374', '\271', '\122', '\362', '\300', - '\372', '\273', '\274', '\021', '\114', '\273', '\040', '\313', - '\260', '\040', '\073', '\301', '\040', '\333', '\277', '\042', - '\173', '\202', '\055', '\340', '\301', '\050', '\134', '\300', - '\050', '\213', '\302', '\011', '\054', '\003', '\013', '\054', - '\003', '\042', '\314', '\262', '\375', '\353', '\262', '\177', - '\273', '\302', '\345', '\013', '\301', '\103', '\040', '\262', - '\001', '\114', '\263', '\067', '\134', '\300', '\070', '\173', - '\303', '\011', '\074', '\003', '\013', '\074', '\003', '\042', - '\314', '\263', '\375', '\113', '\003', '\023', '\114', '\003', - '\377', '\113', '\003', '\001', '\114', '\003', '\003', '\114', - '\003', '\005', '\114', '\003', '\007', '\114', '\003', '\011', - '\114', '\003', '\013', '\114', '\003', '\042', '\274', '\052', - '\375', '\133', '\003', '\023', '\134', '\003', '\377', '\133', - '\003', '\001', '\134', '\003', '\003', '\134', '\003', '\346', - '\147', '\055', '\314', '\222', '\054', '\313', '\042', '\021', - '\316', '\062', '\170', '\321', '\062', '\055', '\160', '\234', - '\020', - -}; - -static const char file_5x8[] = { - '\037', '\235', '\214', '\001', '\314', '\214', '\201', '\223', - '\000', '\200', '\301', '\000', '\006', '\023', '\032', '\144', - '\042', '\300', '\040', '\246', '\204', '\015', '\023', '\042', - '\004', '\100', '\046', '\041', '\271', '\210', '\004', '\024', - '\116', '\104', '\024', '\021', '\311', '\000', '\203', '\010', - '\024', '\046', '\304', '\140', '\300', '\040', '\264', '\002', - '\006', '\041', '\150', '\064', '\310', '\321', '\040', '\272', - '\005', '\006', '\101', '\210', '\114', '\071', '\021', '\216', - '\003', '\203', '\100', '\146', '\002', '\100', '\020', '\021', - '\320', '\003', '\203', '\200', '\164', '\322', '\371', '\010', - '\000', '\121', '\004', '\211', '\110', '\051', '\046', '\344', - '\107', '\141', '\146', '\005', '\235', '\001', '\044', '\044', - '\234', '\040', '\161', '\103', '\102', '\231', '\007', '\131', - '\044', '\224', '\041', '\321', '\107', '\302', '\042', '\022', - '\227', '\044', '\154', '\042', '\161', '\113', '\102', '\061', - '\022', '\343', '\044', '\224', '\243', '\060', '\244', '\301', - '\076', '\012', '\241', '\044', '\104', '\244', '\120', '\254', - '\301', '\112', '\165', '\023', '\212', '\222', '\250', '\052', - '\041', '\053', '\205', '\134', '\015', '\352', '\222', '\270', - '\054', '\341', '\065', '\211', '\350', '\022', '\262', '\223', - '\150', '\157', '\344', '\304', '\000', '\035', '\046', '\152', - '\231', '\010', '\100', '\101', '\302', '\060', '\224', '\317', - '\044', '\144', '\103', '\371', '\100', '\302', '\072', '\224', - '\121', '\212', '\004', '\064', '\321', '\310', '\023', '\047', - '\124', '\234', '\004', '\151', '\122', '\344', '\213', '\224', - '\042', '\107', '\222', '\114', '\241', '\042', '\045', '\213', - '\101', '\323', '\125', '\234', '\020', '\251', '\015', '\240', - '\111', '\232', '\071', '\143', '\000', '\030', '\131', '\235', - '\204', '\111', '\226', '\057', '\252', '\131', '\013', '\117', - '\203', '\247', '\114', '\305', '\053', '\105', '\222', '\034', - '\101', '\102', '\005', '\371', '\152', '\260', '\115', '\234', - '\247', '\251', '\323', '\006', '\300', '\024', '\046', '\101', - '\120', '\003', '\220', '\342', '\275', '\010', '\225', '\053', - '\111', '\210', '\120', '\101', '\142', '\135', '\271', '\223', - '\067', '\162', '\332', '\204', '\141', '\003', '\040', '\010', - '\021', '\042', '\137', '\146', '\147', '\141', '\322', '\072', - '\071', '\130', '\000', '\120', '\044', '\201', '\105', '\021', - '\114', '\344', '\227', '\204', '\026', '\140', '\101', '\361', - '\104', '\022', '\250', '\031', '\210', '\340', '\170', '\105', - '\114', '\361', '\004', '\023', '\125', '\120', '\221', '\304', - '\151', '\137', '\140', '\001', '\241', '\204', '\024', '\132', - '\210', '\241', '\155', '\123', '\100', '\021', '\304', '\020', - '\014', '\036', '\001', '\300', '\020', '\365', '\131', '\121', - '\204', '\024', '\101', '\034', '\321', '\032', '\172', '\352', - '\041', '\161', '\042', '\022', '\101', '\110', '\061', '\205', - '\171', '\256', '\301', '\046', '\033', '\155', '\266', '\311', - '\366', '\204', '\015', '\064', '\330', '\340', '\102', '\014', - '\071', '\344', '\020', '\303', '\214', '\065', '\336', '\130', - '\135', '\021', '\116', '\014', '\361', '\004', '\021', '\045', - '\002', '\220', '\204', '\024', '\126', '\234', '\370', '\004', - '\024', '\131', '\110', '\041', '\035', '\165', '\047', '\276', - '\001', '\107', '\036', '\162', '\244', '\161', '\006', '\032', - '\164', '\200', '\100', '\044', '\016', '\071', '\200', '\040', - '\106', '\036', '\040', '\014', '\361', '\306', '\031', '\156', - '\244', '\101', '\107', '\032', '\157', '\270', '\321', '\046', - '\174', '\160', '\270', '\040', '\334', '\151', '\124', '\000', - '\320', '\202', '\157', '\300', '\265', '\140', '\004', '\163', - '\316', '\375', '\251', '\035', '\167', '\055', '\110', '\321', - '\302', '\173', '\361', '\315', '\327', '\102', '\013', '\070', - '\100', '\012', '\103', '\013', '\067', '\324', '\100', '\251', - '\245', '\103', '\264', '\120', '\303', '\244', '\076', '\002', - '\051', '\044', '\221', '\106', '\266', '\060', '\145', '\225', - '\320', '\155', '\331', '\347', '\153', '\034', '\126', '\170', - '\241', '\023', '\000', '\140', '\361', '\005', '\022', '\321', - '\115', '\327', '\147', '\024', '\125', '\330', '\367', '\005', - '\214', '\353', '\035', '\164', '\120', '\000', '\274', '\362', - '\152', '\220', '\147', '\272', '\352', '\004', '\000', '\112', - '\050', '\171', '\106', '\231', '\101', '\304', '\002', '\140', - '\254', '\116', '\242', '\001', '\260', '\317', '\077', '\006', - '\065', '\224', '\354', '\262', '\302', '\126', '\153', '\355', - '\112', '\000', '\004', '\005', '\110', '\041', '\205', '\034', - '\022', '\310', '\266', '\335', '\176', '\313', '\255', '\267', - '\340', '\222', '\073', '\256', '\270', '\341', '\226', '\213', - '\256', '\271', '\351', '\236', '\253', '\356', '\273', '\356', - '\306', '\333', '\356', '\274', '\354', '\326', '\273', '\356', - '\275', '\360', '\322', '\213', '\257', '\274', '\366', '\346', - '\333', '\057', '\277', '\373', '\352', '\353', '\157', '\300', - '\377', '\012', '\014', '\360', '\300', '\010', '\037', '\254', - '\260', '\301', '\014', '\027', '\354', '\060', '\301', '\020', - '\047', '\334', '\160', '\304', '\013', '\077', '\054', '\261', - '\305', '\025', '\123', '\074', '\361', '\305', '\032', '\143', - '\274', '\161', '\306', '\034', '\207', '\014', '\362', '\310', - '\037', '\227', '\354', '\261', '\275', '\063', '\005', '\065', - '\223', '\133', '\000', '\250', '\144', '\020', '\006', '\127', - '\045', '\204', '\102', '\102', '\060', '\044', '\204', '\103', - '\102', '\071', '\031', '\044', '\243', '\101', '\162', '\031', - '\244', '\241', '\101', '\140', '\044', '\204', '\106', '\102', - '\160', '\044', '\204', '\107', '\102', '\052', '\027', '\225', - '\020', '\044', '\011', '\075', '\144', '\020', '\050', '\011', - '\241', '\222', '\020', '\054', '\011', '\341', '\222', '\020', - '\060', '\011', '\041', '\223', '\020', '\064', '\011', '\141', - '\223', '\020', '\070', '\011', '\045', '\146', '\020', '\074', - '\011', '\341', '\203', '\055', '\002', '\023', '\101', '\060', - '\021', '\006', '\023', '\201', '\060', '\021', '\012', '\023', - '\301', '\060', '\021', '\016', '\023', '\001', '\061', '\021', - '\022', '\023', '\101', '\061', '\021', '\026', '\023', '\201', - '\061', '\021', '\032', '\065', '\115', '\204', '\307', '\104', - '\244', '\261', '\064', '\021', '\044', '\023', '\141', '\062', - '\021', '\050', '\023', '\241', '\062', '\021', '\054', '\023', - '\341', '\062', '\021', '\060', '\023', '\041', '\063', '\021', - '\064', '\023', '\141', '\063', '\021', '\070', '\023', '\241', - '\063', '\021', '\074', '\023', '\341', '\103', '\131', '\104', - '\074', '\245', '\024', '\021', '\006', '\021', '\201', '\020', - '\021', '\012', '\021', '\301', '\020', '\021', '\016', '\021', - '\001', '\321', '\121', '\104', '\120', '\104', '\204', '\105', - '\104', '\140', '\104', '\204', '\106', '\104', '\160', '\104', - '\204', '\107', '\117', '\021', '\265', '\004', '\000', '\044', - '\021', '\141', '\022', '\021', '\050', '\021', '\241', '\022', - '\021', '\054', '\021', '\341', '\022', '\021', '\060', '\021', - '\041', '\023', '\021', '\064', '\021', '\141', '\023', '\021', - '\070', '\021', '\241', '\023', '\021', '\074', '\021', '\341', - '\023', '\021', '\000', '\104', '\041', '\100', '\024', '\004', - '\104', '\141', '\100', '\024', '\010', '\104', '\241', '\100', - '\024', '\014', '\104', '\341', '\100', '\024', '\020', '\104', - '\171', '\304', '\063', '\121', '\130', '\020', '\005', '\006', - '\121', '\150', '\020', '\005', '\007', '\121', '\170', '\020', - '\005', '\010', '\121', '\210', '\040', '\012', '\044', '\210', - '\202', '\011', '\242', '\200', '\202', '\050', '\250', '\040', - '\012', '\054', '\210', '\202', '\013', '\242', '\000', '\203', - '\050', '\310', '\040', '\012', '\064', '\210', '\202', '\015', - '\242', '\200', '\203', '\050', '\350', '\040', '\012', '\074', - '\210', '\202', '\017', '\242', '\000', '\040', '\043', '\040', - '\111', '\210', '\313', '\000', '\200', '\225', '\152', '\021', - '\300', '\001', '\037', '\160', '\000', '\010', '\001', '\100', - '\001', '\005', '\264', '\360', '\205', '\012', '\120', '\200', - '\003', '\142', '\310', '\001', '\004', '\040', '\340', '\000', - '\001', '\030', '\100', '\007', '\012', '\300', '\000', '\002', - '\020', '\300', '\000', '\001', '\050', '\011', '\003', '\050', - '\060', '\304', '\136', '\035', '\200', '\003', '\004', '\350', - '\341', '\007', '\025', '\260', '\102', '\203', '\234', '\060', - '\043', '\067', '\001', '\100', '\002', '\026', '\320', '\200', - '\004', '\370', '\220', '\000', '\034', '\050', '\200', '\026', - '\005', '\120', '\103', '\033', '\136', '\021', '\130', '\042', - '\071', '\300', '\025', '\127', '\210', '\304', '\061', '\372', - '\220', '\003', '\012', '\271', '\342', '\007', '\306', '\010', - '\200', '\017', '\010', '\313', '\215', '\072', '\201', '\343', - '\114', '\344', '\050', '\022', '\070', '\136', '\261', '\214', - '\146', '\024', '\243', '\031', '\011', '\100', '\307', '\204', - '\254', '\161', '\217', '\146', '\334', '\011', '\001', '\004', - '\100', '\000', '\004', '\104', '\221', '\220', '\010', '\030', - '\144', '\024', '\077', '\020', '\303', '\030', '\046', '\004', - '\001', '\153', '\374', '\300', '\367', '\030', '\040', '\201', - '\003', '\010', '\100', '\002', '\015', '\110', '\343', '\265', - '\234', '\170', '\305', '\017', '\032', '\244', '\221', '\012', - '\211', '\041', '\043', '\031', '\151', '\231', '\023', '\026', - '\300', '\001', '\024', '\120', '\141', '\264', '\230', '\250', - '\000', '\267', '\020', '\040', '\206', '\257', '\164', '\241', - '\101', '\172', '\370', '\075', '\220', '\134', '\221', '\145', - '\204', '\364', '\341', '\367', '\044', '\300', '\000', '\017', - '\120', '\062', '\041', '\076', '\374', '\343', '\114', '\150', - '\051', '\022', '\017', '\350', '\344', '\211', '\051', '\201', - '\100', '\042', '\005', '\200', '\221', '\106', '\062', '\321', - '\211', '\006', '\270', '\142', '\024', '\051', '\011', '\001', - '\006', '\010', '\300', '\230', '\000', '\240', '\044', '\002', - '\040', '\300', '\113', '\220', '\060', '\100', '\001', '\036', - '\260', '\241', '\101', '\074', '\040', '\000', '\007', '\160', - '\223', '\001', '\263', '\024', '\200', '\002', '\054', '\320', - '\115', '\000', '\170', '\100', '\231', '\211', '\004', '\041', - '\045', '\051', '\331', '\116', '\112', '\152', '\200', '\002', - '\325', '\234', '\045', '\072', '\031', '\200', '\116', '\175', - '\146', '\163', '\220', '\266', '\144', '\146', '\041', '\023', - '\162', '\223', '\050', '\106', '\253', '\220', '\313', '\164', - '\142', '\053', '\063', '\222', '\021', '\112', '\146', '\240', - '\002', '\025', '\110', '\200', '\000', '\366', '\051', '\001', - '\011', '\170', '\240', '\242', '\006', '\161', '\200', '\004', - '\064', '\272', '\321', '\131', '\112', '\200', '\231', '\355', - '\344', '\150', '\105', '\243', '\110', '\116', '\007', '\060', - '\023', '\233', '\045', '\145', '\146', '\104', '\050', '\051', - '\000', '\015', '\264', '\263', '\242', '\027', '\305', '\050', - '\000', '\124', '\050', '\115', '\203', '\160', '\000', '\002', - '\070', '\175', '\251', '\002', '\014', '\020', '\103', '\251', - '\000', '\100', '\245', '\314', '\214', '\242', '\105', '\143', - '\352', '\123', '\011', '\130', '\300', '\003', '\032', '\160', - '\251', '\107', '\053', '\032', '\322', '\221', '\062', '\163', - '\251', '\026', '\320', '\000', '\003', '\124', '\302', '\121', - '\007', '\050', '\065', '\233', '\022', '\050', '\144', '\073', - '\377', '\330', '\111', '\000', '\060', '\265', '\242', '\375', - '\374', '\052', '\077', '\015', '\302', '\124', '\017', '\134', - '\224', '\254', '\274', '\244', '\247', '\101', '\042', '\020', - '\001', '\046', '\372', '\160', '\234', '\312', '\034', '\044', - '\066', '\115', '\252', '\322', '\103', '\042', '\022', '\247', - '\031', '\265', '\241', '\015', '\243', '\030', '\313', '\153', - '\031', '\323', '\000', '\204', '\324', '\011', '\005', '\222', - '\332', '\224', '\237', '\226', '\163', '\244', '\012', '\261', - '\346', '\104', '\223', '\071', '\330', '\173', '\046', '\226', - '\234', '\375', '\104', '\000', '\005', '\236', '\330', '\104', - '\112', '\336', '\024', '\235', '\101', '\145', '\252', '\023', - '\001', '\020', '\315', '\023', '\206', '\120', '\257', '\317', - '\004', '\051', '\107', '\015', '\322', '\131', '\037', '\032', - '\264', '\062', '\020', '\075', '\012', '\101', '\065', '\233', - '\020', '\172', '\366', '\063', '\243', '\033', '\175', '\252', - '\115', '\045', '\160', '\323', '\021', '\256', '\123', '\266', - '\031', '\065', '\200', '\041', '\071', '\251', '\102', '\012', - '\260', '\314', '\253', '\025', '\105', '\143', '\102', '\032', - '\331', '\304', '\010', '\100', '\364', '\264', '\151', '\365', - '\051', '\132', '\071', '\320', '\116', '\167', '\046', '\322', - '\230', '\030', '\050', '\244', '\156', '\011', '\000', '\263', - '\017', '\006', '\162', '\272', '\321', '\105', '\100', '\111', - '\130', '\150', '\231', '\115', '\002', '\200', '\160', '\331', - '\332', '\026', '\040', '\306', '\313', '\055', '\103', '\374', - '\041', '\020', '\345', '\015', '\004', '\172', '\115', '\246', - '\136', '\102', '\024', '\302', '\020', '\175', '\010', '\204', - '\173', '\315', '\213', '\260', '\101', '\164', '\253', '\017', - '\200', '\260', '\057', '\041', '\002', '\041', '\010', '\156', - '\355', '\267', '\277', '\367', '\315', '\227', '\041', '\366', - '\000', '\256', '\102', '\360', '\001', '\134', '\204', '\300', - '\057', '\267', '\006', '\341', '\007', '\160', '\011', '\342', - '\017', '\000', '\046', '\227', '\175', '\353', '\245', '\340', - '\102', '\374', '\167', '\302', '\355', '\175', '\057', '\040', - '\344', '\253', '\141', '\160', '\321', '\267', '\274', '\177', - '\360', '\060', '\040', '\004', '\241', '\137', '\374', '\212', - '\167', '\304', '\366', '\065', '\304', '\206', '\347', '\133', - '\341', '\103', '\220', '\267', '\133', '\053', '\176', '\357', - '\171', '\307', '\025', '\143', '\370', '\012', '\142', '\276', - '\347', '\115', '\361', '\214', '\145', '\354', '\341', '\363', - '\272', '\167', '\020', '\033', '\136', '\260', '\037', '\070', - '\014', '\344', '\365', '\252', '\230', '\303', '\107', '\236', - '\157', '\220', '\065', '\154', '\344', '\045', '\037', '\271', - '\274', '\116', '\216', '\162', '\223', '\233', '\174', '\143', - '\031', '\043', '\271', '\306', '\061', '\056', '\304', '\220', - '\225', '\174', '\145', '\165', '\115', '\031', '\312', '\137', - '\146', '\062', '\230', '\307', '\054', '\146', '\046', '\163', - '\231', '\314', '\111', '\056', '\363', '\223', '\325', '\054', - '\345', '\364', '\206', '\131', '\305', '\042', '\176', '\163', - '\233', '\073', '\214', '\146', '\054', '\117', '\231', '\313', - '\054', '\136', '\357', '\206', '\003', '\221', '\342', '\370', - '\372', '\127', '\312', '\356', '\045', '\304', '\234', '\005', - '\035', '\346', '\375', '\336', '\331', '\314', '\357', '\125', - '\057', '\230', '\225', '\214', '\340', '\045', '\023', '\372', - '\317', '\353', '\065', '\264', '\177', '\025', '\155', '\341', - '\030', '\077', '\272', '\314', '\204', '\016', '\364', '\213', - '\057', '\315', '\151', '\112', '\137', '\332', '\305', '\044', - '\056', '\263', '\213', '\215', '\174', '\340', '\023', '\013', - '\353', '\017', '\325', '\102', '\110', '\103', '\076', '\222', - '\021', '\224', '\224', '\304', '\063', '\041', '\051', '\210', - '\145', '\140', '\202', '\316', '\114', '\336', '\344', '\047', - '\052', '\071', '\212', '\124', '\250', '\322', '\224', '\247', - '\130', '\000', '\000', '\027', '\000', '\000', '\314', '\062', - '\000', '\000', '\015', '\000', '\300', '\052', '\150', '\354', - '\200', '\073', '\333', '\110', '\102', '\000', '\204', '\000', - '\000', '\042', '\000', '\300', '\010', '\000', '\100', '\002', - '\000', '\224', '\000', '\000', '\046', '\000', '\300', '\011', - '\000', '\060', '\263', '\024', '\000', '\100', '\005', '\000', - '\130', '\001', '\000', '\264', '\322', '\002', '\000', '\350', - '\351', '\005', '\000', '\250', '\331', '\221', '\270', '\062', - '\003', '\000', '\320', '\000', '\000', '\065', '\000', '\200', - '\015', '\000', '\160', '\003', '\000', '\334', '\054', '\007', - '\000', '\320', '\001', '\000', '\166', '\000', '\000', '\036', - '\000', '\240', '\007', '\000', '\360', '\312', '\017', '\000', - '\220', '\223', '\040', '\000', '\100', '\010', '\047', '\002', - '\000', '\021', '\000', '\000', '\026', '\043', '\000', '\300', - '\104', '\062', '\112', '\002', '\000', '\224', '\000', '\000', - '\261', '\060', '\241', '\067', '\000', '\140', '\325', '\023', - '\000', '\004', '\200', '\050', '\214', '\307', '\073', '\000', - '\350', '\123', '\025', '\000', '\100', '\252', '\126', '\001', - '\300', '\066', '\132', '\000', '\200', '\131', '\270', '\000', - '\200', '\056', '\000', '\300', '\013', '\000', '\370', '\002', - '\000', '\202', '\026', '\006', '\000', '\240', '\045', '\070', - '\025', '\051', '\003', '\000', '\314', '\000', '\000', '\315', - '\014', '\055', '\015', '\000', '\120', '\003', '\000', '\326', - '\000', '\000', '\372', '\164', '\307', '\015', '\000', '\170', - '\003', '\000', '\212', '\246', '\026', '\266', '\314', '\001', - '\000', '\164', '\000', '\100', '\035', '\000', '\140', '\007', - '\000', '\334', '\001', '\000', '\107', '\313', '\003', '\000', - '\364', '\000', '\200', '\075', '\000', '\200', '\017', '\000', - '\200', '\213', '\037', '\000', '\200', '\352', '\224', '\045', - '\345', '\273', '\147', '\247', '\214', '\332', '\323', '\316', - '\366', '\140', '\241', '\335', '\355', '\153', '\207', '\173', - '\333', '\337', '\116', '\367', '\270', '\327', '\175', '\356', - '\166', '\317', '\073', '\336', '\367', '\056', '\367', '\276', - '\337', '\335', '\357', '\172', '\007', '\074', '\337', '\377', - '\116', '\370', '\300', '\027', '\176', '\360', '\206', '\117', - '\074', '\342', '\027', '\057', '\370', '\306', '\037', '\336', - '\361', '\212', '\207', '\074', '\343', '\037', '\117', '\371', - '\310', '\127', '\176', '\362', '\206', '\127', '\110', '\322', - '\024', '\322', '\254', '\356', '\002', '\340', '\047', '\006', - '\051', '\054', '\000', '\210', '\075', '\316', '\204', '\114', - '\333', '\040', '\063', '\063', '\110', '\271', '\015', '\022', - '\030', '\172', '\047', '\304', '\337', '\006', '\061', '\370', - '\155', '\022', '\142', '\027', '\216', '\033', '\144', '\344', - '\006', '\111', '\271', '\101', '\144', '\156', '\220', '\212', - '\030', '\004', '\350', '\006', '\101', '\272', '\101', '\236', - '\156', '\220', '\243', '\275', '\045', '\041', '\202', '\110', - '\310', '\041', '\022', '\302', '\210', '\204', '\104', '\042', - '\041', '\226', '\110', '\310', '\046', '\022', '\002', '\065', - '\203', '\224', '\042', '\041', '\247', '\110', '\110', '\052', - '\022', '\262', '\212', '\204', '\264', '\042', '\041', '\257', - '\110', '\110', '\054', '\022', '\062', '\213', '\204', '\324', - '\042', '\041', '\267', '\110', '\110', '\056', '\022', '\262', - '\213', '\204', '\364', '\042', '\041', '\277', '\110', '\110', - '\060', '\022', '\062', '\214', '\204', '\024', '\043', '\041', - '\307', '\110', '\110', '\062', '\022', '\122', '\030', '\203', - '\064', '\043', '\041', '\317', '\220', '\020', '\321', '\220', - '\020', '\323', '\220', '\020', '\325', '\140', '\030', '\011', - '\221', '\015', '\011', '\261', '\015', '\011', '\321', '\015', - '\011', '\361', '\015', '\011', '\021', '\016', '\011', '\061', - '\016', '\011', '\121', '\016', '\011', '\161', '\016', '\011', - '\221', '\016', '\011', '\261', '\016', '\011', '\321', '\016', - '\011', '\361', '\016', '\011', '\021', '\017', '\011', '\061', - '\017', '\011', '\121', '\017', '\011', '\161', '\017', '\011', - '\221', '\017', '\011', '\261', '\017', '\011', '\321', '\017', - '\011', '\001', '\055', '\273', '\142', '\020', '\003', '\060', - '\021', '\005', '\060', '\021', '\070', '\144', '\020', '\011', - '\060', '\021', '\013', '\060', '\021', '\015', '\060', '\021', - '\017', '\060', '\021', '\021', '\060', '\021', '\023', '\060', - '\021', '\025', '\060', '\021', '\027', '\060', '\021', '\031', - '\060', '\021', '\033', '\060', '\021', '\221', '\141', '\020', - '\037', '\060', '\021', '\041', '\060', '\021', '\043', '\060', - '\021', '\045', '\060', '\021', '\047', '\060', '\021', '\051', - '\060', '\021', '\053', '\060', '\021', '\055', '\060', '\021', - '\057', '\060', '\021', '\061', '\060', '\021', '\063', '\060', - '\021', '\065', '\060', '\021', '\067', '\060', '\021', '\071', - '\060', '\021', '\073', '\060', '\021', '\075', '\060', '\021', - '\077', '\060', '\021', '\101', '\060', '\021', '\103', '\060', - '\021', '\105', '\060', '\021', '\107', '\060', '\021', '\111', - '\060', '\021', '\113', '\060', '\021', '\115', '\060', '\021', - '\117', '\060', '\021', '\121', '\060', '\021', '\123', '\060', - '\021', '\125', '\060', '\021', '\127', '\060', '\021', '\131', - '\060', '\021', '\133', '\060', '\021', '\135', '\060', '\021', - '\137', '\060', '\021', '\230', '\141', '\020', '\146', '\040', - '\207', '\060', '\120', '\211', '\047', '\122', '\211', '\107', - '\062', '\004', '\225', '\310', '\025', '\232', '\010', '\003', - '\355', '\326', '\211', '\357', '\326', '\211', '\361', '\326', - '\211', '\363', '\326', '\211', '\365', '\246', '\211', '\061', - '\120', '\063', '\250', '\230', '\211', '\060', '\020', '\003', - '\234', '\330', '\212', '\237', '\330', '\212', '\241', '\330', - '\212', '\243', '\330', '\212', '\245', '\330', '\212', '\247', - '\010', '\003', '\062', '\240', '\212', '\272', '\310', '\212', - '\062', '\360', '\212', '\062', '\020', '\213', '\062', '\060', - '\213', '\062', '\120', '\213', '\062', '\160', '\213', '\062', - '\220', '\213', '\063', '\300', '\213', '\063', '\300', '\212', - '\063', '\360', '\212', '\063', '\020', '\213', '\063', '\060', - '\213', '\063', '\120', '\213', '\063', '\160', '\213', '\063', - '\220', '\213', '\064', '\120', '\063', '\317', '\026', '\155', - '\323', '\126', '\155', '\327', '\226', '\155', '\333', '\326', - '\155', '\337', '\026', '\156', '\343', '\346', '\047', '\346', - '\006', '\000', '\350', '\246', '\156', '\000', '\300', '\156', - '\356', '\006', '\157', '\362', '\346', '\172', '\367', '\226', - '\157', '\373', '\326', '\157', '\377', '\026', '\160', '\000', - '\060', '\160', '\005', '\167', '\160', '\011', '\267', '\160', - '\015', '\367', '\160', '\000', '\020', '\161', '\023', '\127', - '\161', '\000', '\160', '\161', '\144', '\241', '\161', '\034', - '\347', '\161', '\344', '\061', '\005', '\041', '\007', '\000', - '\043', '\127', '\162', '\032', '\202', '\162', '\052', '\007', - '\000', '\054', '\347', '\162', '\060', '\047', '\163', '\064', - '\147', '\163', '\000', '\200', '\163', '\000', '\240', '\163', - '\074', '\347', '\163', '\000', '\000', '\164', '\102', '\107', - '\164', '\106', '\007', '\000', '\110', '\247', '\164', '\114', - '\007', '\000', '\116', '\007', '\165', '\122', '\107', '\165', - '\126', '\207', '\165', '\000', '\240', '\165', '\134', '\347', - '\165', '\140', '\047', '\166', '\047', '\022', '\003', '\067', - '\120', '\157', '\111', '\321', '\053', '\275', '\362', '\053', - '\147', '\067', '\023', '\323', '\102', '\167', '\310', '\062', - '\054', '\312', '\042', '\224', '\011', '\321', '\054', '\317', - '\022', '\055', '\104', '\131', '\054', '\164', '\007', - -}; - -static char name_6x13[] = "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1"; -static char name_cursor[] = "cursor"; -static char name_5x7[] = "-misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-1"; -static char name_5x8[] = "-misc-fixed-medium-r-normal--8-80-75-75-c-50-iso646.1991-irv"; - -const BuiltinFileRec builtin_files[] = { -"6x13.builtin", sizeof file_6x13, file_6x13, -"cursor.builtin", sizeof file_cursor, file_cursor, -"5x7.builtin", sizeof file_5x7, file_5x7, -"5x8.builtin", sizeof file_5x8, file_5x8, -}; - -const int builtin_files_count = sizeof (builtin_files) / sizeof (builtin_files[0]); - -const BuiltinDirRec builtin_dir[] = { -"6x13.builtin", name_6x13, -"cursor.builtin", name_cursor, -"5x7.builtin", name_5x7, -"5x8.builtin", name_5x8, -}; - -const int builtin_dir_count = sizeof (builtin_dir) / sizeof (builtin_dir[0]); - -static char alias_fixed[] = "fixed"; -static char alias_6x13[] = "6x13"; -static char alias_6x13_100[] = "-misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1"; -static char alias_5x7[] = "5x7"; -static char alias_5x7_100[] = "-misc-fixed-medium-r-normal--7-50-100-100-c-50-iso8859-1"; -static char alias_5x8[] = "5x8"; -static char alias_5x8_75[] = "-misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-1"; -static char alias_5x8_100[] = "-misc-fixed-medium-r-normal--8-60-100-100-c-50-iso8859-1"; - -const BuiltinAliasRec builtin_alias[] = { -alias_fixed, name_6x13, -alias_6x13, name_6x13, -alias_6x13_100, name_6x13, -alias_5x7, name_5x7, -alias_5x7_100, name_5x7, -alias_5x8, name_5x8, -alias_5x8_75, name_5x8, -alias_5x8_100, name_5x8, -}; - -const int builtin_alias_count = sizeof (builtin_alias) / sizeof (builtin_alias[0]); diff --git a/nx-X11/lib/font/builtins/fpe.c b/nx-X11/lib/font/builtins/fpe.c deleted file mode 100644 index 7f78fabbd..000000000 --- a/nx-X11/lib/font/builtins/fpe.c +++ /dev/null @@ -1,98 +0,0 @@ -/* $XdotOrg: xc/lib/font/builtins/fpe.c,v 1.5 2005/07/30 18:56:32 alanc Exp $ */ -/* - * Id: fpe.c,v 1.2 1999/11/02 06:16:48 keithp Exp $ - * - * Copyright 1999 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ -/* $XFree86: xc/lib/font/builtins/fpe.c,v 1.3 1999/12/30 02:29:51 robin Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include - -static int font_file_type; - -const char builtin_fonts[] = "built-ins"; - -int -BuiltinNameCheck (name) - char *name; -{ - return (strcmp (name, builtin_fonts) == 0); -} - -int -BuiltinInitFPE (fpe) - FontPathElementPtr fpe; -{ - int status; - FontDirectoryPtr dir; - - status = BuiltinReadDirectory (fpe->name, &dir); - - if (status == Successful) - fpe->private = (pointer) dir; - return status; -} - -/* ARGSUSED */ -int -BuiltinResetFPE (fpe) - FontPathElementPtr fpe; -{ - FontDirectoryPtr dir; - - dir = (FontDirectoryPtr) fpe->private; - /* builtins can't change! */ - return Successful; -} - -int -BuiltinFreeFPE (fpe) - FontPathElementPtr fpe; -{ - FontFileFreeDir ((FontDirectoryPtr) fpe->private); - return Successful; -} - -void -BuiltinRegisterFpeFunctions(void) -{ - BuiltinRegisterFontFileFunctions (); - - font_file_type = RegisterFPEFunctions(BuiltinNameCheck, - BuiltinInitFPE, - BuiltinFreeFPE, - BuiltinResetFPE, - FontFileOpenFont, - FontFileCloseFont, - FontFileListFonts, - FontFileStartListFontsWithInfo, - FontFileListNextFontWithInfo, - (WakeupFpeFunc) 0, - (ClientDiedFunc) 0, - (LoadGlyphsFunc) 0, - (StartLaFunc) 0, - (NextLaFunc) 0, - (SetPathFunc) 0); -} diff --git a/nx-X11/lib/font/builtins/render.c b/nx-X11/lib/font/builtins/render.c deleted file mode 100644 index 520d873f4..000000000 --- a/nx-X11/lib/font/builtins/render.c +++ /dev/null @@ -1,114 +0,0 @@ -/* $XdotOrg: xc/lib/font/builtins/render.c,v 1.5 2005/07/30 18:56:32 alanc Exp $ */ -/* - * Id: render.c,v 1.2 1999/11/02 06:16:48 keithp Exp $ - * - * Copyright 1999 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ -/* $XFree86: xc/lib/font/builtins/render.c,v 1.3 1999/12/30 02:29:51 robin Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include "builtin.h" - -BuiltinOpenBitmap (fpe, ppFont, flags, entry, fileName, format, fmask) - FontPathElementPtr fpe; - FontPtr *ppFont; - int flags; - FontEntryPtr entry; - char *fileName; - fsBitmapFormat format; - fsBitmapFormatMask fmask; -{ - FontFilePtr file; - FontPtr pFont; - int i; - int ret; - int bit, - byte, - glyph, - scan, - image; - - file = BuiltinFileOpen (fileName); - if (!file) - return BadFontName; - pFont = (FontPtr) xalloc(sizeof(FontRec)); - if (!pFont) { - BuiltinFileClose (file); - return AllocError; - } - /* set up default values */ - FontDefaultFormat(&bit, &byte, &glyph, &scan); - /* get any changes made from above */ - ret = CheckFSFormat(format, fmask, &bit, &byte, &scan, &glyph, &image); - - /* Fill in font record. Data format filled in by reader. */ - pFont->refcnt = 0; - pFont->maxPrivate = -1; - pFont->devPrivates = (pointer *) 0; - - ret = pcfReadFont (pFont, file, bit, byte, glyph, scan); - - BuiltinFileClose (file); - if (ret != Successful) - xfree(pFont); - else - *ppFont = pFont; - return ret; -} - -BuiltinGetInfoBitmap (fpe, pFontInfo, entry, fileName) - FontPathElementPtr fpe; - FontInfoPtr pFontInfo; - FontEntryPtr entry; - char *fileName; -{ - FontFilePtr file; - int i; - int ret; - FontRendererPtr renderer; - - file = BuiltinFileOpen (fileName); - if (!file) - return BadFontName; - ret = pcfReadFontInfo (pFontInfo, file); - BuiltinFileClose (file); - return ret; -} - -static FontRendererRec renderers[] = { - ".builtin", 8, - BuiltinOpenBitmap, 0, BuiltinGetInfoBitmap, 0, 0 -}; - -#define numRenderers (sizeof renderers / sizeof renderers[0]) - -void -BuiltinRegisterFontFileFunctions(void) -{ - int i; - for (i = 0; i < numRenderers; i++) - FontFileRegisterRenderer ((FontRendererRec *) &renderers[i]); -} - diff --git a/nx-X11/lib/font/fc/Imakefile b/nx-X11/lib/font/fc/Imakefile deleted file mode 100644 index d51151348..000000000 --- a/nx-X11/lib/font/fc/Imakefile +++ /dev/null @@ -1,31 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:36 cpqbld Exp $ -XCOMM -XCOMM Make file for font handling routines -XCOMM -XCOMM $XFree86: xc/lib/font/fc/Imakefile,v 1.4 1999/12/13 02:52:50 robin Exp $ -#include - - INCLUDES = -I$(FONTINCSRC) -I../include $(TRANS_INCLUDES) - HEADERS = - SRCS = fsconvert.c fserve.c fsio.c transport.c - OBJS = fsconvert.o fserve.o fsio.o transport.o - CONN_DEFINES = $(CONNECTION_FLAGS) -DFONT_t -DTRANS_CLIENT -DTRANS_SERVER -DTRANS_REOPEN -#if HasBSD44Sockets - SOCK_DEFINES = -DBSD44SOCKETS -#endif - DEFINES = $(SIGNAL_DEFINES) $(CONN_DEFINES) $(SOCK_DEFINES) - - -#define DoNormalLib NormalLibFont -#define DoSharedLib SharedLibFont -#define DoDebugLib DebugLibFont -#define DoProfileLib ProfileLibFont -#include -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -LinkSourceFile(transport.c,$(TRANSCOMMSRC)) - -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/font/fc/fsconvert.c b/nx-X11/lib/font/fc/fsconvert.c deleted file mode 100644 index afa2c3284..000000000 --- a/nx-X11/lib/font/fc/fsconvert.c +++ /dev/null @@ -1,774 +0,0 @@ -/* $Xorg: fsconvert.c,v 1.3 2000/08/17 19:46:36 cpqbld Exp $ */ -/* - * Copyright 1990 Network Computing Devices - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Network Computing Devices not be used - * in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. Network Computing Devices - * makes no representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, - * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE - * OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - */ -/* $XFree86: xc/lib/font/fc/fsconvert.c,v 1.14 2003/08/30 18:06:29 dawes Exp $ */ -/* - * FS data conversion - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include "fservestr.h" -#include -#include "fslibos.h" - -extern char _fs_glyph_undefined; -extern char _fs_glyph_requested; -extern char _fs_glyph_zero_length; - - -/* - * converts data from font server form to X server form - */ - -void -_fs_convert_char_info(fsXCharInfo *src, xCharInfo *dst) -{ - dst->ascent = src->ascent; - dst->descent = src->descent; - dst->leftSideBearing = src->left; - dst->rightSideBearing = src->right; - dst->characterWidth = src->width; - dst->attributes = src->attributes; -} - -void -_fs_init_fontinfo(FSFpePtr conn, FontInfoPtr pfi) -{ - if (conn->fsMajorVersion == 1) { - unsigned short n; - n = pfi->firstCol; - pfi->firstCol = pfi->firstRow; - pfi->firstRow = n; - n = pfi->lastCol; - pfi->lastCol = pfi->lastRow; - pfi->lastRow = n; - pfi->defaultCh = ((pfi->defaultCh >> 8) & 0xff) - + ((pfi->defaultCh & 0xff) << 8); - } - - if (FontCouldBeTerminal (pfi)) - { - pfi->terminalFont = TRUE; - pfi->minbounds.ascent = pfi->fontAscent; - pfi->minbounds.descent = pfi->fontDescent; - pfi->minbounds.leftSideBearing = 0; - pfi->minbounds.rightSideBearing = pfi->minbounds.characterWidth; - pfi->maxbounds = pfi->minbounds; - } - - FontComputeInfoAccelerators (pfi); -} - -int -_fs_convert_props(fsPropInfo *pi, fsPropOffset *po, pointer pd, - FontInfoPtr pfi) -{ - FontPropPtr dprop; - int i, - nprops; - char *is_str; - fsPropOffset local_off; - char *off_adr; - char *pdc = pd; - -/* stolen from server/include/resource.h */ -#define BAD_RESOURCE 0xe0000000 - - nprops = pfi->nprops = pi->num_offsets; - - if (nprops < 0 - || nprops > SIZE_MAX/(sizeof(FontPropRec) + sizeof(char))) - return -1; - - dprop = (FontPropPtr) xalloc(sizeof(FontPropRec) * nprops + - sizeof (char) * nprops); - if (!dprop) - return -1; - - is_str = (char *) (dprop + nprops); - pfi->props = dprop; - pfi->isStringProp = is_str; - - off_adr = (char *)po; - for (i = 0; i < nprops; i++, dprop++, is_str++) - { - memcpy(&local_off, off_adr, SIZEOF(fsPropOffset)); - if ((local_off.name.position >= pi->data_len) || - (local_off.name.length > - (pi->data_len - local_off.name.position))) - goto bail; - dprop->name = MakeAtom(&pdc[local_off.name.position], - local_off.name.length, 1); - if (local_off.type != PropTypeString) { - *is_str = FALSE; - dprop->value = local_off.value.position; - } else { - *is_str = TRUE; - if ((local_off.value.position >= pi->data_len) || - (local_off.value.length > - (pi->data_len - local_off.value.position))) - goto bail; - dprop->value = (INT32) MakeAtom(&pdc[local_off.value.position], - local_off.value.length, 1); - if (dprop->value == BAD_RESOURCE) - { - bail: - xfree (pfi->props); - pfi->nprops = 0; - pfi->props = 0; - pfi->isStringProp = 0; - return -1; - } - } - off_adr += SIZEOF(fsPropOffset); - } - - return nprops; -} - -void -_fs_free_props (FontInfoPtr pfi) -{ - if (pfi->props) - { - xfree (pfi->props); - pfi->nprops = 0; - pfi->props = 0; - } -} - -int -_fs_convert_lfwi_reply(FSFpePtr conn, FontInfoPtr pfi, - fsListFontsWithXInfoReply *fsrep, - fsPropInfo *pi, fsPropOffset *po, pointer pd) -{ - fsUnpack_XFontInfoHeader(fsrep, pfi); - _fs_init_fontinfo(conn, pfi); - - if (_fs_convert_props(pi, po, pd, pfi) == -1) - return AllocError; - - return Successful; -} - - -#define ENCODING_UNDEFINED(enc) \ - ((enc)->bits == &_fs_glyph_undefined ? \ - TRUE : \ - (access_done = access_done && (enc)->bits != &_fs_glyph_requested, \ - FALSE)) - -#define GLYPH_UNDEFINED(loc) ENCODING_UNDEFINED(encoding + (loc)) - -/* - * figures out what glyphs to request - * - * Includes logic to attempt to reduce number of round trips to the font - * server: when a glyph is requested, fs_build_range() requests a - * 16-glyph range of glyphs that contains the requested glyph. This is - * predicated on the belief that using a glyph increases the chances - * that nearby glyphs will be used: a good assumption for phonetic - * alphabets, but a questionable one for ideographic/pictographic ones. - */ -/* ARGSUSED */ -int -fs_build_range(FontPtr pfont, Bool range_flag, unsigned int count, - int item_size, unsigned char *data, int *nranges, - fsRange **ranges) -{ - FSFontDataPtr fsd = (FSFontDataPtr) (pfont->fpePrivate); - FSFontPtr fsfont = (FSFontPtr) (pfont->fontPrivate); - register CharInfoPtr encoding = fsfont->encoding; - FontInfoPtr pfi = &(pfont->info); - fsRange range; - int access_done = TRUE; - int err; - register unsigned long firstrow, lastrow, firstcol, lastcol; - register unsigned long row; - register unsigned long col; - register unsigned long loc; - - if (!fsd->glyphs_to_get) - return AccessDone; - - firstrow = pfi->firstRow; - lastrow = pfi->lastRow; - firstcol = pfi->firstCol; - lastcol = pfi->lastCol; - - /* Make sure we have default char */ - if (fsfont->pDefault && ENCODING_UNDEFINED(fsfont->pDefault)) - { - loc = fsfont->pDefault - encoding; - row = loc / (lastcol - firstcol + 1) + firstrow; - col = loc % (lastcol - firstcol + 1) + firstcol; - - range.min_char_low = range.max_char_low = col; - range.min_char_high = range.max_char_high = row; - - if ((err = add_range(&range, nranges, ranges, FALSE)) != - Successful) return err; - encoding[loc].bits = &_fs_glyph_requested; - access_done = FALSE; - } - - if (!range_flag && item_size == 1) - { - if (firstrow != 0) return AccessDone; - while (count--) - { - col = *data++; - if (col >= firstcol && col <= lastcol && - GLYPH_UNDEFINED(col - firstcol)) - { - int col1, col2; - col1 = col & 0xf0; - col2 = col1 + 15; - if (col1 < firstcol) col1 = firstcol; - if (col2 > lastcol) col2 = lastcol; - /* Collect a 16-glyph neighborhood containing the requested - glyph... should in most cases reduce the number of round - trips to the font server. */ - for (col = col1; col <= col2; col++) - { - if (!GLYPH_UNDEFINED(col - firstcol)) continue; - range.min_char_low = range.max_char_low = col; - range.min_char_high = range.max_char_high = 0; - if ((err = add_range(&range, nranges, ranges, FALSE)) != - Successful) return err; - encoding[col - firstcol].bits = &_fs_glyph_requested; - access_done = FALSE; - } - } - } - } - else - { - fsRange fullrange[1]; - - if (range_flag && count == 0) - { - count = 2; - data = (unsigned char *)fullrange; - fullrange[0].min_char_high = firstrow; - fullrange[0].min_char_low = firstcol; - fullrange[0].max_char_high = lastrow; - fullrange[0].max_char_low = lastcol; - } - - while (count--) - { - int row1, col1, row2, col2; - row1 = row2 = *data++; - col1 = col2 = *data++; - if (range_flag) - { - if (count) - { - row2 = *data++; - col2 = *data++; - count--; - } - else - { - row2 = lastrow; - col2 = lastcol; - } - if (row1 < firstrow) row1 = firstrow; - if (row2 > lastrow) row2 = lastrow; - if (col1 < firstcol) col1 = firstcol; - if (col2 > lastcol) col2 = lastcol; - } - else - { - if (row1 < firstrow || row1 > lastrow || - col1 < firstcol || col1 > lastcol) - continue; - } - for (row = row1; row <= row2; row++) - { - expand_glyph_range: ; - loc = (row - firstrow) * (lastcol + 1 - firstcol) + - (col1 - firstcol); - for (col = col1; col <= col2; col++, loc++) - { - if (GLYPH_UNDEFINED(loc)) - { - if (row1 == row2 && - (((col1 & 0xf) && col1 > firstcol) || - (col2 & 0xf) != 0xf) && (col2 < lastcol)) - { - /* If we're loading from a single row, expand - range of glyphs loaded to a multiple of - a 16-glyph range -- attempt to reduce number - of round trips to the font server. */ - col1 &= 0xf0; - col2 = (col2 & 0xf0) + 15; - if (col1 < firstcol) col1 = firstcol; - if (col2 > lastcol) col2 = lastcol; - goto expand_glyph_range; - } - range.min_char_low = range.max_char_low = col; - range.min_char_high = range.max_char_high = row; - if ((err = add_range(&range, nranges, ranges, FALSE)) != - Successful) return err; - encoding[loc].bits = &_fs_glyph_requested; - access_done = FALSE; - } - } - } - } - } - - return access_done ? - AccessDone : - Successful; -} - -#undef GLYPH_UNDEFINED -#undef ENCODING_UNDEFINED - - -/* _fs_clean_aborted_loadglyphs(): Undoes the changes to the encoding array - performed by fs_build_range(); for use if the associated LoadGlyphs - requests needs to be cancelled. */ - -void -_fs_clean_aborted_loadglyphs(FontPtr pfont, int num_expected_ranges, - fsRange *expected_ranges) -{ - register FSFontPtr fsfont; - register int i; - - fsfont = (FSFontPtr) pfont->fontPrivate; - if (fsfont->encoding) - { - fsRange full_range[1]; - if (!num_expected_ranges) - { - full_range[0].min_char_low = pfont->info.firstCol; - full_range[0].min_char_high = pfont->info.firstRow; - full_range[0].max_char_low = pfont->info.lastCol; - full_range[0].max_char_high = pfont->info.lastRow; - num_expected_ranges = 1; - expected_ranges = full_range; - } - - for (i = 0; i < num_expected_ranges; i++) - { - int row, col; - for (row = expected_ranges[i].min_char_high; - row <= expected_ranges[i].max_char_high; - row++) - { - register CharInfoPtr encoding = fsfont->encoding + - ((row - pfont->info.firstRow) * - (pfont->info.lastCol - - pfont->info.firstCol + 1) + - expected_ranges[i].min_char_low - - pfont->info.firstCol); - for (col = expected_ranges[i].min_char_low; - col <= expected_ranges[i].max_char_low; - encoding++, col++) - { - if (encoding->bits == &_fs_glyph_requested) - encoding->bits = &_fs_glyph_undefined; - } - } - } - } -} - - -/* - * figures out what extents to request - * this is where lots of extra - * smarts wants to live - */ -/* ARGSUSED */ -int -_fs_check_extents(FontPtr pfont, Mask flags, int nranges, fsRange *range, - FSBlockDataPtr blockrec) -{ -/* XXX -- either fill in the requested info if we have it somewhere - * and return AccessDone, or else return Successful - */ - return Successful; -} - -/* - * figures out what glyphs to request - * this is where lots of extra - * smarts wants to live - */ -/* ARGSUSED */ -int -_fs_check_bitmaps(FontPtr pfont, fsBitmapFormat format, - Mask flags, int nranges, fsRange *range, - FSBlockDataPtr blockrec) -{ -/* XXX -- either fill in the requested info if we have it somewhere - * and return AccessDone, or else return Successful - */ - return Successful; -} - -int -_fs_get_glyphs(FontPtr pFont, unsigned long count, unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - CharInfoPtr *glyphs) /* RETURN */ -{ - FSFontPtr fsdata; - unsigned int firstCol; - register unsigned int numCols; - unsigned int firstRow; - unsigned int numRows; - CharInfoPtr *glyphsBase; - register unsigned int c; - register CharInfoPtr pci; - unsigned int r; - CharInfoPtr encoding; - CharInfoPtr pDefault; - FSFontDataPtr fsd = (FSFontDataPtr) pFont->fpePrivate; - int err = Successful; - - fsdata = (FSFontPtr) pFont->fontPrivate; - encoding = fsdata->encoding; - pDefault = fsdata->pDefault; - firstCol = pFont->info.firstCol; - numCols = pFont->info.lastCol - firstCol + 1; - glyphsBase = glyphs; - - /* In this age of glyph caching, any glyphs gotten through this - procedure should already be loaded. If they are not, we are - dealing with someone (perhaps a ddx driver optimizing a font) - that doesn't understand the finer points of glyph caching. The - CHECK_ENCODING macro checks for this condition... if found, it - calls fs_load_all_glyphs(), which corrects it. Since the caller - of this code will not know how to handle a return value of - Suspended, the fs_load_all_glyphs() procedure will block and - freeze the server until the load operation is done. Moral: the - glyphCachingMode flag really must indicate the capabilities of - the ddx drivers. */ - -#define CHECK_ENCODING(cnum) \ - ( pci = encoding + (cnum), \ - fsd->glyphs_to_get ? \ - ( pci->bits == &_fs_glyph_undefined || pci->bits == &_fs_glyph_requested ? \ - ((err = fs_load_all_glyphs(pFont)), pci) : \ - pci ) : \ - pci ) - - switch (charEncoding) { - - case Linear8Bit: - case TwoD8Bit: - if (pFont->info.firstRow > 0) - break; - if (pFont->info.allExist && pDefault) { - while (err == Successful && count--) { - c = (*chars++) - firstCol; - if (c < numCols) - *glyphs++ = CHECK_ENCODING(c); - else - *glyphs++ = pDefault; - } - } else { - while (err == Successful && count--) { - c = (*chars++) - firstCol; - if (c < numCols && CHECK_ENCODING(c)->bits) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - } - break; - case Linear16Bit: - if (pFont->info.allExist && pDefault) { - while (err == Successful && count--) { - c = *chars++ << 8; - c = (c | *chars++) - firstCol; - if (c < numCols) - *glyphs++ = CHECK_ENCODING(c); - else - *glyphs++ = pDefault; - } - } else { - while (err == Successful && count--) { - c = *chars++ << 8; - c = (c | *chars++) - firstCol; - if (c < numCols && CHECK_ENCODING(c)->bits) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - } - break; - - case TwoD16Bit: - firstRow = pFont->info.firstRow; - numRows = pFont->info.lastRow - firstRow + 1; - while (err == Successful && count--) { - r = (*chars++) - firstRow; - c = (*chars++) - firstCol; - if (r < numRows && c < numCols && - CHECK_ENCODING(r * numCols + c)->bits) - *glyphs++ = pci; - else if (pDefault) - *glyphs++ = pDefault; - } - break; - } - *glyphCount = glyphs - glyphsBase; - return err; -} - - -static int -_fs_get_metrics(FontPtr pFont, unsigned long count, unsigned char *chars, - FontEncoding charEncoding, - unsigned long *glyphCount, /* RETURN */ - xCharInfo **glyphs) /* RETURN */ -{ - FSFontPtr fsdata; - unsigned int firstCol; - register unsigned int numCols; - unsigned int firstRow; - unsigned int numRows; - xCharInfo **glyphsBase; - register unsigned int c; - unsigned int r; - CharInfoPtr encoding; - CharInfoPtr pDefault; - - fsdata = (FSFontPtr) pFont->fontPrivate; - encoding = fsdata->inkMetrics; - pDefault = fsdata->pDefault; - /* convert default bitmap metric to default ink metric */ - if (pDefault) - pDefault = encoding + (pDefault - fsdata->encoding); - firstCol = pFont->info.firstCol; - numCols = pFont->info.lastCol - firstCol + 1; - glyphsBase = glyphs; - - - /* XXX - this should be much smarter */ - /* make sure the glyphs are there */ - switch (charEncoding) { - - case Linear8Bit: - case TwoD8Bit: - if (pFont->info.firstRow > 0) - break; - if (pFont->info.allExist && pDefault) { - while (count--) { - c = (*chars++) - firstCol; - if (c < numCols) - *glyphs++ = (xCharInfo *)&encoding[c]; - else - *glyphs++ = (xCharInfo *)pDefault; - } - } else { - while (count--) { - c = (*chars++) - firstCol; - if (c < numCols) - *glyphs++ = (xCharInfo *)(encoding + c); - else if (pDefault) - *glyphs++ = (xCharInfo *)pDefault; - } - } - break; - case Linear16Bit: - if (pFont->info.allExist && pDefault) { - while (count--) { - c = *chars++ << 8; - c = (c | *chars++) - firstCol; - if (c < numCols) - *glyphs++ = (xCharInfo *)(encoding + c); - else - *glyphs++ = (xCharInfo *)pDefault; - } - } else { - while (count--) { - c = *chars++ << 8; - c = (c | *chars++) - firstCol; - if (c < numCols) - *glyphs++ = (xCharInfo *)(encoding + c); - else if (pDefault) - *glyphs++ = (xCharInfo *)pDefault; - } - } - break; - - case TwoD16Bit: - firstRow = pFont->info.firstRow; - numRows = pFont->info.lastRow - firstRow + 1; - while (count--) { - r = (*chars++) - firstRow; - c = (*chars++) - firstCol; - if (r < numRows && c < numCols) - *glyphs++ = (xCharInfo *)(encoding + (r * numCols + c)); - else if (pDefault) - *glyphs++ = (xCharInfo *)pDefault; - } - break; - } - *glyphCount = glyphs - glyphsBase; - return Successful; -} - - -void -_fs_unload_font(FontPtr pfont) -{ - FSFontPtr fsdata = (FSFontPtr) pfont->fontPrivate; - FSFontDataPtr fsd = (FSFontDataPtr) pfont->fpePrivate; - CharInfoPtr encoding = fsdata->encoding; - FSGlyphPtr glyphs; - - /* - * fsdata points at FSFontRec, FSFontDataRec and name - */ - if (encoding) - xfree(encoding); - - while ((glyphs = fsdata->glyphs)) - { - fsdata->glyphs = glyphs->next; - xfree (glyphs); - } - - /* XXX we may get called after the resource DB has been cleaned out */ - if (find_old_font(fsd->fontid)) - DeleteFontClientID (fsd->fontid); - - _fs_free_props (&pfont->info); - - xfree(fsdata); - - DestroyFontRec(pfont); -} - -FontPtr -fs_create_font (FontPathElementPtr fpe, - char *name, - int namelen, - fsBitmapFormat format, - fsBitmapFormatMask fmask) -{ - FontPtr pfont; - FSFontPtr fsfont; - FSFontDataPtr fsd; - int bit, byte, scan, glyph; - - pfont = CreateFontRec (); - if (!pfont) - return 0; - fsfont = (FSFontPtr) xalloc (sizeof (FSFontRec) + - sizeof (FSFontDataRec) + - namelen + 1); - if (!fsfont) - { - DestroyFontRec (pfont); - return 0; - } - fsd = (FSFontDataPtr) (fsfont + 1); - bzero((char *) fsfont, sizeof(FSFontRec)); - bzero((char *) fsd, sizeof(FSFontDataRec)); - - pfont->fpe = fpe; - pfont->fontPrivate = (pointer) fsfont; - pfont->fpePrivate = (pointer) fsd; - - /* These font components will be needed in packGlyphs */ - CheckFSFormat(format, BitmapFormatMaskBit | - BitmapFormatMaskByte | - BitmapFormatMaskScanLineUnit | - BitmapFormatMaskScanLinePad, - &bit, - &byte, - &scan, - &glyph, - NULL); - pfont->format = format; - pfont->bit = bit; - pfont->byte = byte; - pfont->scan = scan; - pfont->glyph = glyph; - - pfont->info.nprops = 0; - pfont->info.props = 0; - pfont->info.isStringProp = 0; - - /* set font function pointers */ - pfont->get_glyphs = _fs_get_glyphs; - pfont->get_metrics = _fs_get_metrics; - pfont->unload_font = _fs_unload_font; - pfont->unload_glyphs = NULL; - - /* set the FPE private information */ - fsd->format = format; - fsd->fmask = fmask; - fsd->name = (char *) (fsd + 1); - memcpy (fsd->name, name, namelen); - fsd->name[namelen] = '\0'; - fsd->fontid = GetNewFontClientID (); - - /* save the ID */ - if (!StoreFontClientFont(pfont, fsd->fontid)) - { - xfree (fsfont); - DestroyFontRec (pfont); - return 0; - } - - return pfont; -} - -pointer -fs_alloc_glyphs (FontPtr pFont, int size) -{ - FSGlyphPtr glyphs; - FSFontPtr fsfont = (FSFontPtr) pFont->fontPrivate; - - if (size < (INT_MAX - sizeof (FSGlyphRec))) - glyphs = xalloc (sizeof (FSGlyphRec) + size); - else - glyphs = NULL; - if (glyphs == NULL) - return NULL; - glyphs->next = fsfont->glyphs; - fsfont->glyphs = glyphs; - return (pointer) (glyphs + 1); -} diff --git a/nx-X11/lib/font/fc/fserve.c b/nx-X11/lib/font/fc/fserve.c deleted file mode 100644 index 6bbb8c2a0..000000000 --- a/nx-X11/lib/font/fc/fserve.c +++ /dev/null @@ -1,3480 +0,0 @@ -/* $XdotOrg: xc/lib/font/fc/fserve.c,v 1.8 2005/07/09 06:36:12 keithp Exp $ */ -/* $Xorg: fserve.c,v 1.4 2001/02/09 02:04:02 xorgcvs Exp $ */ -/* - -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fc/fserve.c,v 3.26tsi Exp $ */ - -/* - * Copyright 1990 Network Computing Devices - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices, or Digital - * not be used in advertising or publicity pertaining to distribution - * of the software without specific, written prior permission. - * - * NETWORK COMPUTING DEVICES, AND DIGITAL AND DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, - * OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - */ -/* - * font server specific font access - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#define _WILLWINSOCK_ -#endif -#define FONT_t -#define TRANS_CLIENT -#include "X11/Xtrans/Xtrans.h" -#include "X11/Xpoll.h" -#include -#include -#include -#include -#include -#include -#include "fservestr.h" -#include -#include -#include - -#include -#define Time_t time_t - -#ifdef NCD -#include -#endif - -#include - -#ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) -#endif -#define TimeCmp(a,c,b) ((int) ((a) - (b)) c 0) - -#define NONZEROMETRICS(pci) ((pci)->leftSideBearing || \ - (pci)->rightSideBearing || \ - (pci)->ascent || \ - (pci)->descent || \ - (pci)->characterWidth) - -/* - * SIZEOF(r) is in bytes, length fields in the protocol are in 32-bit words, - * so this converts for doing size comparisons. - */ -#define LENGTHOF(r) (SIZEOF(r) >> 2) - -/* Somewhat arbitrary limit on maximum reply size we'll try to read. */ -#define MAX_REPLY_LENGTH ((64 * 1024 * 1024) >> 2) - -extern void ErrorF(const char *f, ...); - -static int fs_read_glyphs ( FontPathElementPtr fpe, FSBlockDataPtr blockrec ); -static int fs_read_list ( FontPathElementPtr fpe, FSBlockDataPtr blockrec ); -static int fs_read_list_info ( FontPathElementPtr fpe, - FSBlockDataPtr blockrec ); - -extern fd_set _fs_fd_mask; - -static void fs_block_handler ( pointer data, OSTimePtr wt, - pointer LastSelectMask ); -static int fs_wakeup ( FontPathElementPtr fpe, unsigned long *mask ); - -/* - * List of all FPEs - */ -static FSFpePtr fs_fpes; -/* - * Union of all FPE blockStates - */ -static CARD32 fs_blockState; - -static int _fs_restart_connection ( FSFpePtr conn ); -static void fs_send_query_bitmaps ( FontPathElementPtr fpe, - FSBlockDataPtr blockrec ); -static int fs_send_close_font ( FontPathElementPtr fpe, Font id ); -static void fs_client_died ( pointer client, FontPathElementPtr fpe ); -static void _fs_client_access ( FSFpePtr conn, pointer client, Bool sync ); -static void _fs_client_resolution ( FSFpePtr conn ); -static fsGenericReply *fs_get_reply (FSFpePtr conn, int *error); -static int fs_await_reply (FSFpePtr conn); -static void _fs_do_blocked (FSFpePtr conn); -static void fs_cleanup_bfont (FSBlockedFontPtr bfont); - -char _fs_glyph_undefined; -char _fs_glyph_requested; -char _fs_glyph_zero_length; - -static int generationCount; - -int FontServerRequestTimeout = 30 * 1000; - -static void -_fs_close_server (FSFpePtr conn); - -static FSFpePtr -_fs_init_conn (char *servername); - -static int -_fs_wait_connect (FSFpePtr conn); - -static int -_fs_send_init_packets (FSFpePtr conn); - -static void -_fs_check_reconnect (FSFpePtr conn); - -static void -_fs_start_reconnect (FSFpePtr conn); - -static void -_fs_free_conn (FSFpePtr conn); - -static int -fs_free_fpe(FontPathElementPtr fpe); - -/* - * Font server access - * - * the basic idea for the non-blocking access is to have the function - * called multiple times until the actual data is returned, instead - * of ClientBlocked. - * - * the first call to the function will cause the request to be sent to - * the font server, and a block record to be stored in the fpe's list - * of outstanding requests. the FS block handler also sticks the - * proper set of fd's into the select mask. when data is ready to be - * read in, the FS wakup handler will be hit. this will read the - * data off the wire into the proper block record, and then signal the - * client that caused the block so that it can restart. it will then - * call the access function again, which will realize that the data has - * arrived and return it. - */ - - -#ifdef DEBUG -static void -_fs_add_req_log(FSFpePtr conn, int opcode) -{ - conn->current_seq++; - fprintf (stderr, "\t\tRequest: %5d Opcode: %2d\n", - conn->current_seq, opcode); - conn->reqbuffer[conn->reqindex].opcode = opcode; - conn->reqbuffer[conn->reqindex].sequence = conn->current_seq; - conn->reqindex++; - if (conn->reqindex == REQUEST_LOG_SIZE) - conn->reqindex = 0; -} - -static void -_fs_add_rep_log (FSFpePtr conn, fsGenericReply *rep) -{ - int i; - - for (i = 0; i < REQUEST_LOG_SIZE; i++) - if (conn->reqbuffer[i].sequence == rep->sequenceNumber) - break; - if (i == REQUEST_LOG_SIZE) - fprintf (stderr, "\t\t\t\t\tReply: %5d Opcode: unknown\n", - rep->sequenceNumber); - else - fprintf (stderr, "\t\t\t\t\tReply: %5d Opcode: %d\n", - rep->sequenceNumber, - conn->reqbuffer[i].opcode); -} - -#define _fs_reply_failed(rep, name, op) do { \ - if (rep) { \ - if (rep->type == FS_Error) \ - fprintf (stderr, "Error: %d Request: %s\n", \ - ((fsError *)rep)->request, #name); \ - else \ - fprintf (stderr, "Bad Length for %s Reply: %d %s %d\n", \ - #name, rep->length, op, LENGTHOF(name)); \ - } \ -} while (0) - -#else -#define _fs_add_req_log(conn,op) ((conn)->current_seq++) -#define _fs_add_rep_log(conn,rep) -#define _fs_reply_failed(rep,name,op) -#endif - -static Bool -fs_name_check(char *name) -{ -#ifdef __UNIXOS2__ - /* OS/2 uses D:/usr/X11R6/.... as fontfile pathnames, so check that - * there is not only a protocol/ prefix, but also that the first chars - * are not a drive letter - */ - if (name && isalpha(*name) && name[1] == ':') - return FALSE; -#endif - /* Just make sure there is a protocol/ prefix */ - return (name && *name != '/' && strchr(name, '/')); -} - -static void -_fs_client_resolution(FSFpePtr conn) -{ - fsSetResolutionReq srreq; - int num_res; - FontResolutionPtr res; - - res = GetClientResolutions(&num_res); - - if (num_res) { - srreq.reqType = FS_SetResolution; - srreq.num_resolutions = num_res; - srreq.length = (SIZEOF(fsSetResolutionReq) + - (num_res * SIZEOF(fsResolution)) + 3) >> 2; - - _fs_add_req_log(conn, FS_SetResolution); - if (_fs_write(conn, (char *) &srreq, SIZEOF(fsSetResolutionReq)) != -1) - (void)_fs_write_pad(conn, (char *) res, - (num_res * SIZEOF(fsResolution))); - } -} - -/* - * close font server and remove any state associated with - * this connection - this includes any client records. - */ - -static void -fs_close_conn(FSFpePtr conn) -{ - FSClientPtr client, nclient; - - _fs_close_server (conn); - - for (client = conn->clients; client; client = nclient) - { - nclient = client->next; - xfree (client); - } - conn->clients = NULL; -} - -/* - * the wakeup handlers have to be set when the FPE is open, and not - * removed until it is freed, in order to handle unexpected data, like - * events - */ -/* ARGSUSED */ -static int -fs_init_fpe(FontPathElementPtr fpe) -{ - FSFpePtr conn; - char *name; - int err; - int ret; - - /* open font server */ - /* create FS specific fpe info */ - name = fpe->name; - - /* hack for old style names */ - if (*name == ':') - name++; /* skip ':' */ - - conn = _fs_init_conn (name); - if (!conn) - err = AllocError; - else - { - err = init_fs_handlers (fpe, fs_block_handler); - if (err != Successful) - { - _fs_free_conn (conn); - err = AllocError; - } - else - { - fpe->private = conn; - conn->next = fs_fpes; - fs_fpes = conn; - ret = _fs_wait_connect (conn); - if (ret != FSIO_READY) - { - fs_free_fpe (fpe); - err = BadFontPath; - } - else - err = Successful; - } - } - - if (err == Successful) - { -#ifdef NCD - if (configData.ExtendedFontDiags) - printf("Connected to font server \"%s\"\n", name); -#endif -#ifdef DEBUG - fprintf (stderr, "connected to FS \"%s\"\n", name); -#endif - } - else - { -#ifdef DEBUG - fprintf(stderr, "failed to connect to FS \"%s\" %d\n", name, err); -#endif -#ifdef NCD - if (configData.ExtendedFontDiags) - printf("Failed to connect to font server \"%s\"\n", name); -#endif - ; - } - return err; -} - -static int -fs_reset_fpe(FontPathElementPtr fpe) -{ - (void) _fs_send_init_packets((FSFpePtr) fpe->private); - return Successful; -} - -/* - * this shouldn't be called till all refs to the FPE are gone - */ - -static int -fs_free_fpe(FontPathElementPtr fpe) -{ - FSFpePtr conn = (FSFpePtr) fpe->private, *prev; - - /* unhook from chain of all font servers */ - for (prev = &fs_fpes; *prev; prev = &(*prev)->next) - { - if (*prev == conn) - { - *prev = conn->next; - break; - } - } - _fs_unmark_block (conn, conn->blockState); - fs_close_conn(conn); - remove_fs_handlers(fpe, fs_block_handler, fs_fpes == 0); - _fs_free_conn (conn); - fpe->private = (pointer) 0; - -#ifdef NCD - if (configData.ExtendedFontDiags) - printf("Disconnected from font server \"%s\"\n", fpe->name); -#endif -#ifdef DEBUG - fprintf (stderr, "disconnect from FS \"%s\"\n", fpe->name); -#endif - - return Successful; -} - -static FSBlockDataPtr -fs_new_block_rec(FontPathElementPtr fpe, pointer client, int type) -{ - FSBlockDataPtr blockrec, - *prev; - FSFpePtr conn = (FSFpePtr) fpe->private; - int size; - - switch (type) { - case FS_OPEN_FONT: - size = sizeof(FSBlockedFontRec); - break; - case FS_LOAD_GLYPHS: - size = sizeof(FSBlockedGlyphRec); - break; - case FS_LIST_FONTS: - size = sizeof(FSBlockedListRec); - break; - case FS_LIST_WITH_INFO: - size = sizeof(FSBlockedListInfoRec); - break; - default: - size = 0; - break; - } - blockrec = (FSBlockDataPtr) xalloc(sizeof(FSBlockDataRec) + size); - if (!blockrec) - return (FSBlockDataPtr) 0; - blockrec->data = (pointer) (blockrec + 1); - blockrec->client = client; - blockrec->sequenceNumber = -1; - blockrec->errcode = StillWorking; - blockrec->type = type; - blockrec->depending = 0; - blockrec->next = (FSBlockDataPtr) 0; - - /* stick it on the end of the list (since its expected last) */ - for (prev = &conn->blockedRequests; *prev; prev = &(*prev)->next) - ; - *prev = blockrec; - - return blockrec; -} - -static void -_fs_set_pending_reply (FSFpePtr conn) -{ - FSBlockDataPtr blockrec; - - for (blockrec = conn->blockedRequests; blockrec; blockrec = blockrec->next) - if (blockrec->errcode == StillWorking) - break; - if (blockrec) - { - conn->blockedReplyTime = GetTimeInMillis () + FontServerRequestTimeout; - _fs_mark_block (conn, FS_PENDING_REPLY); - } - else - _fs_unmark_block (conn, FS_PENDING_REPLY); -} - -static void -_fs_remove_block_rec(FSFpePtr conn, FSBlockDataPtr blockrec) -{ - FSBlockDataPtr *prev; - - for (prev = &conn->blockedRequests; *prev; prev = &(*prev)->next) - if (*prev == blockrec) - { - *prev = blockrec->next; - break; - } - if (blockrec->type == FS_LOAD_GLYPHS) - { - FSBlockedGlyphPtr bglyph = (FSBlockedGlyphPtr)blockrec->data; - if (bglyph->num_expected_ranges) - xfree(bglyph->expected_ranges); - } - xfree(blockrec); - _fs_set_pending_reply (conn); -} - -static void -_fs_signal_clients_depending(FSClientsDependingPtr *clients_depending) -{ - FSClientsDependingPtr p; - - while ((p = *clients_depending)) - { - *clients_depending = p->next; - ClientSignal(p->client); - xfree(p); - } -} - -static int -_fs_add_clients_depending(FSClientsDependingPtr *clients_depending, pointer client) -{ - FSClientsDependingPtr new, cd; - - for (; (cd = *clients_depending); - clients_depending = &(*clients_depending)->next) - { - if (cd->client == client) - return Suspended; - } - - new = (FSClientsDependingPtr)xalloc (sizeof (FSClientsDependingRec)); - if (!new) - return BadAlloc; - - new->client = client; - new->next = 0; - *clients_depending = new; - return Suspended; -} - -/* - * When a request is aborted due to a font server failure, - * signal any depending clients to restart their dependant - * requests - */ -static void -_fs_clean_aborted_blockrec(FSFpePtr conn, FSBlockDataPtr blockrec) -{ - switch(blockrec->type) { - case FS_OPEN_FONT: { - FSBlockedFontPtr bfont = (FSBlockedFontPtr)blockrec->data; - - fs_cleanup_bfont (bfont); - _fs_signal_clients_depending(&bfont->clients_depending); - break; - } - case FS_LOAD_GLYPHS: { - FSBlockedGlyphPtr bglyph = (FSBlockedGlyphPtr)blockrec->data; - - _fs_clean_aborted_loadglyphs(bglyph->pfont, - bglyph->num_expected_ranges, - bglyph->expected_ranges); - _fs_signal_clients_depending(&bglyph->clients_depending); - break; - } - case FS_LIST_FONTS: - break; - case FS_LIST_WITH_INFO: { - FSBlockedListInfoPtr binfo; - binfo = (FSBlockedListInfoPtr) blockrec->data; - if (binfo->status == FS_LFWI_REPLY) - FD_SET(conn->fs_fd, &_fs_fd_mask); - _fs_free_props (&binfo->info); - } - default: - break; - } -} - -static void -fs_abort_blockrec(FSFpePtr conn, FSBlockDataPtr blockrec) -{ - _fs_clean_aborted_blockrec (conn, blockrec); - _fs_remove_block_rec (conn, blockrec); -} - -/* - * Tell the font server we've failed to complete an open and - * then unload the partially created font - */ -static void -fs_cleanup_bfont (FSBlockedFontPtr bfont) -{ - FSFontDataRec *fsd; - - if (bfont->pfont) - { - fsd = (FSFontDataRec *) bfont->pfont->fpePrivate; - - /* make sure the FS knows we choked on it */ - fs_send_close_font(bfont->pfont->fpe, bfont->fontid); - - /* - * Either unload the font if it's being opened for - * the first time, or smash the generation field to - * mark this font as an orphan - */ - if (!(bfont->flags & FontReopen)) - { - if (bfont->freeFont) - (*bfont->pfont->unload_font) (bfont->pfont); -#ifdef DEBUG - else - fprintf (stderr, "Not freeing other font in cleanup_bfont\n"); -#endif - bfont->pfont = 0; - } - else - fsd->generation = -1; - } -} - -/* - * Check to see if a complete reply is waiting - */ -static fsGenericReply * -fs_get_reply (FSFpePtr conn, int *error) -{ - char *buf; - fsGenericReply *rep; - int ret; - - /* block if the connection is down or paused in lfwi */ - if (conn->fs_fd == -1 || !FD_ISSET (conn->fs_fd, &_fs_fd_mask)) - { - *error = FSIO_BLOCK; - return 0; - } - - ret = _fs_start_read (conn, sizeof (fsGenericReply), &buf); - if (ret != FSIO_READY) - { - *error = FSIO_BLOCK; - return 0; - } - - rep = (fsGenericReply *) buf; - - /* - * Refuse to accept replies longer than a maximum reasonable length, - * before we pass to _fs_start_read, since it will try to resize the - * incoming connection buffer to this size. Also avoids integer overflow - * on 32-bit systems. - */ - if (rep->length > MAX_REPLY_LENGTH) - { - ErrorF("fserve: reply length %d > MAX_REPLY_LENGTH, disconnecting" - " from font server\n", rep->length); - _fs_connection_died (conn); - *error = FSIO_ERROR; - return 0; - } - - ret = _fs_start_read (conn, rep->length << 2, &buf); - if (ret != FSIO_READY) - { - *error = FSIO_BLOCK; - return 0; - } - - *error = FSIO_READY; - - return (fsGenericReply *) buf; -} - -static Bool -fs_reply_ready (FSFpePtr conn) -{ - fsGenericReply *rep; - - if (conn->fs_fd == -1 || !FD_ISSET (conn->fs_fd, &_fs_fd_mask)) - return FALSE; - if (fs_data_read (conn) < sizeof (fsGenericReply)) - return FALSE; - rep = (fsGenericReply *) (conn->inBuf.buf + conn->inBuf.remove); - if (fs_data_read (conn) < rep->length << 2) - return FALSE; - return TRUE; -} - -static void -_fs_pending_reply (FSFpePtr conn) -{ - if (!(conn->blockState & FS_PENDING_REPLY)) - { - _fs_mark_block (conn, FS_PENDING_REPLY); - conn->blockedReplyTime = GetTimeInMillis () + FontServerRequestTimeout; - } -} - -static void -_fs_prepare_for_reply (FSFpePtr conn) -{ - _fs_pending_reply (conn); - _fs_flush (conn); -} - -/* - * Block (for a while) awaiting a complete reply - */ -static int -fs_await_reply (FSFpePtr conn) -{ - int ret; - - if (conn->blockState & FS_COMPLETE_REPLY) - return FSIO_READY; - - while (!fs_get_reply (conn, &ret)) - { - if (ret != FSIO_BLOCK) - return ret; - if (_fs_wait_for_readable (conn, FontServerRequestTimeout) != FSIO_READY) - { - _fs_connection_died (conn); - return FSIO_ERROR; - } - } - return FSIO_READY; -} - -/* - * Process the reply to an OpenBitmapFont request - */ -static int -fs_read_open_font(FontPathElementPtr fpe, FSBlockDataPtr blockrec) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockedFontPtr bfont = (FSBlockedFontPtr) blockrec->data; - fsOpenBitmapFontReply *rep; - FSBlockDataPtr blockOrig; - FSBlockedFontPtr origBfont; - int ret; - - rep = (fsOpenBitmapFontReply *) fs_get_reply (conn, &ret); - if (!rep || rep->type == FS_Error || - (rep->length != LENGTHOF(fsOpenBitmapFontReply))) - { - if (ret == FSIO_BLOCK) - return StillWorking; - if (rep) - _fs_done_read (conn, rep->length << 2); - fs_cleanup_bfont (bfont); - _fs_reply_failed (rep, fsOpenBitmapFontReply, "!="); - return BadFontName; - } - - /* If we're not reopening a font and FS detected a duplicate font - open request, replace our reference to the new font with a - reference to an existing font (possibly one not finished - opening). If this is a reopen, keep the new font reference... - it's got the metrics and extents we read when the font was opened - before. This also gives us the freedom to easily close the font - if we we decide (in fs_read_query_info()) that we don't like what - we got. */ - - if (rep->otherid && !(bfont->flags & FontReopen)) - { - fs_cleanup_bfont (bfont); - - /* Find old font if we're completely done getting it from server. */ - bfont->pfont = find_old_font(rep->otherid); - bfont->freeFont = FALSE; - bfont->fontid = rep->otherid; - bfont->state = FS_DONE_REPLY; - /* - * look for a blocked request to open the same font - */ - for (blockOrig = conn->blockedRequests; - blockOrig; - blockOrig = blockOrig->next) - { - if (blockOrig != blockrec && blockOrig->type == FS_OPEN_FONT) - { - origBfont = (FSBlockedFontPtr) blockOrig->data; - if (origBfont->fontid == rep->otherid) - { - blockrec->depending = blockOrig->depending; - blockOrig->depending = blockrec; - bfont->state = FS_DEPENDING; - bfont->pfont = origBfont->pfont; - break; - } - } - } - if (bfont->pfont == NULL) - { - /* XXX - something nasty happened */ - ret = BadFontName; - } - else - ret = AccessDone; - } - else - { - bfont->pfont->info.cachable = rep->cachable != 0; - bfont->state = FS_INFO_REPLY; - /* - * Reset the blockrec for the next reply - */ - blockrec->sequenceNumber = bfont->queryInfoSequence; - conn->blockedReplyTime = GetTimeInMillis () + FontServerRequestTimeout; - ret = StillWorking; - } - _fs_done_read (conn, rep->length << 2); - return ret; -} - -static Bool -fs_fonts_match (FontInfoPtr pInfo1, FontInfoPtr pInfo2) -{ - int i; - - if (pInfo1->firstCol != pInfo2->firstCol || - pInfo1->lastCol != pInfo2->lastCol || - pInfo1->firstRow != pInfo2->firstRow || - pInfo1->lastRow != pInfo2->lastRow || - pInfo1->defaultCh != pInfo2->defaultCh || - pInfo1->noOverlap != pInfo2->noOverlap || - pInfo1->terminalFont != pInfo2->terminalFont || - pInfo1->constantMetrics != pInfo2->constantMetrics || - pInfo1->constantWidth != pInfo2->constantWidth || - pInfo1->inkInside != pInfo2->inkInside || - pInfo1->inkMetrics != pInfo2->inkMetrics || - pInfo1->allExist != pInfo2->allExist || - pInfo1->drawDirection != pInfo2->drawDirection || - pInfo1->cachable != pInfo2->cachable || - pInfo1->anamorphic != pInfo2->anamorphic || - pInfo1->maxOverlap != pInfo2->maxOverlap || - pInfo1->fontAscent != pInfo2->fontAscent || - pInfo1->fontDescent != pInfo2->fontDescent || - pInfo1->nprops != pInfo2->nprops) - return FALSE; - -#define MATCH(xci1, xci2) \ - (((xci1).leftSideBearing == (xci2).leftSideBearing) && \ - ((xci1).rightSideBearing == (xci2).rightSideBearing) && \ - ((xci1).characterWidth == (xci2).characterWidth) && \ - ((xci1).ascent == (xci2).ascent) && \ - ((xci1).descent == (xci2).descent) && \ - ((xci1).attributes == (xci2).attributes)) - - if (!MATCH(pInfo1->maxbounds, pInfo2->maxbounds) || - !MATCH(pInfo1->minbounds, pInfo2->minbounds) || - !MATCH(pInfo1->ink_maxbounds, pInfo2->ink_maxbounds) || - !MATCH(pInfo1->ink_minbounds, pInfo2->ink_minbounds)) - return FALSE; - -#undef MATCH - - for (i = 0; i < pInfo1->nprops; i++) - if (pInfo1->isStringProp[i] != - pInfo2->isStringProp[i] || - pInfo1->props[i].name != - pInfo2->props[i].name || - pInfo1->props[i].value != - pInfo2->props[i].value) - { - return FALSE; - } - return TRUE; -} - -static int -fs_read_query_info(FontPathElementPtr fpe, FSBlockDataPtr blockrec) -{ - FSBlockedFontPtr bfont = (FSBlockedFontPtr) blockrec->data; - FSFpePtr conn = (FSFpePtr) fpe->private; - fsQueryXInfoReply *rep; - char *buf; - long bufleft = 0; /* length of reply left to use */ - fsPropInfo *pi; - fsPropOffset *po; - pointer pd; - FontInfoPtr pInfo; - FontInfoRec tempInfo; - int err; - int ret; - - rep = (fsQueryXInfoReply *) fs_get_reply (conn, &ret); - if (!rep || rep->type == FS_Error || - (rep->length < LENGTHOF(fsQueryXInfoReply))) - { - if (ret == FSIO_BLOCK) - return StillWorking; - if (rep) - _fs_done_read (conn, rep->length << 2); - fs_cleanup_bfont (bfont); - _fs_reply_failed (rep, fsQueryXInfoReply, "<"); - return BadFontName; - } - - /* If this is a reopen, accumulate the query info into a dummy - font and compare to our original data. */ - if (bfont->flags & FontReopen) - pInfo = &tempInfo; - else - pInfo = &bfont->pfont->info; - - buf = (char *) rep; - buf += SIZEOF(fsQueryXInfoReply); - - bufleft = rep->length << 2; - bufleft -= SIZEOF(fsQueryXInfoReply); - - /* move the data over */ - fsUnpack_XFontInfoHeader(rep, pInfo); - - /* compute accelerators */ - _fs_init_fontinfo(conn, pInfo); - - /* Compute offsets into the reply */ - if (bufleft < SIZEOF(fsPropInfo)) - { - ret = -1; -#ifdef DEBUG - fprintf(stderr, "fsQueryXInfo: bufleft (%ld) < SIZEOF(fsPropInfo)\n", - bufleft); -#endif - goto bail; - } - pi = (fsPropInfo *) buf; - buf += SIZEOF (fsPropInfo); - bufleft -= SIZEOF (fsPropInfo); - - if ((bufleft / SIZEOF (fsPropOffset)) < pi->num_offsets) - { - ret = -1; -#ifdef DEBUG - fprintf(stderr, - "fsQueryXInfo: (bufleft / SIZEOF (fsPropOffset)) (%ld) < pi->num_offsets (%d)\n", - bufleft / SIZEOF (fsPropOffset), pi->num_offsets); -#endif - goto bail; - } - po = (fsPropOffset *) buf; - buf += pi->num_offsets * SIZEOF(fsPropOffset); - bufleft -= pi->num_offsets * SIZEOF(fsPropOffset); - - if (bufleft < pi->data_len) - { - ret = -1; -#ifdef DEBUG - fprintf(stderr, - "fsQueryXInfo: bufleft (%ld) < data_len (%d)\n", - bufleft, pi->data_len); -#endif - goto bail; - } - pd = (pointer) buf; - buf += pi->data_len; - bufleft -= pi->data_len; - - /* convert the properties and step over the reply */ - ret = _fs_convert_props(pi, po, pd, pInfo); - bail: - _fs_done_read (conn, rep->length << 2); - - if (ret == -1) - { - fs_cleanup_bfont (bfont); - return AllocError; - } - - if (bfont->flags & FontReopen) - { - /* We're reopening a font that we lost because of a downed - connection. In the interest of avoiding corruption from - opening a different font than the old one (we already have - its metrics, extents, and probably some of its glyphs), - verify that the metrics and properties all match. */ - - if (fs_fonts_match (pInfo, &bfont->pfont->info)) - { - err = Successful; - bfont->state = FS_DONE_REPLY; - } - else - { - fs_cleanup_bfont (bfont); - err = BadFontName; - } - _fs_free_props (pInfo); - - return err; - } - - /* - * Ask for terminal format fonts if possible - */ - if (bfont->pfont->info.terminalFont) - bfont->format = ((bfont->format & ~ (BitmapFormatImageRectMask)) | - BitmapFormatImageRectMax); - - /* - * Figure out if the whole font should get loaded right now. - */ - if (glyphCachingMode == CACHING_OFF || - (glyphCachingMode == CACHE_16_BIT_GLYPHS - && !bfont->pfont->info.lastRow)) - { - bfont->flags |= FontLoadAll; - } - - /* - * Ready to send the query bitmaps; the terminal font bit has - * been computed and glyphCaching has been considered - */ - if (bfont->flags & FontLoadBitmaps) - { - fs_send_query_bitmaps (fpe, blockrec); - _fs_flush (conn); - } - - bfont->state = FS_EXTENT_REPLY; - - /* - * Reset the blockrec for the next reply - */ - blockrec->sequenceNumber = bfont->queryExtentsSequence; - conn->blockedReplyTime = GetTimeInMillis () + FontServerRequestTimeout; - - return StillWorking; -} - -static int -fs_read_extent_info(FontPathElementPtr fpe, FSBlockDataPtr blockrec) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockedFontPtr bfont = (FSBlockedFontPtr) blockrec->data; - FSFontDataPtr fsd = (FSFontDataPtr) bfont->pfont->fpePrivate; - FSFontPtr fsfont = (FSFontPtr) bfont->pfont->fontPrivate; - fsQueryXExtents16Reply *rep; - char *buf; - int i; - int numExtents; - int numInfos; - int ret; - Bool haveInk = FALSE; /* need separate ink metrics? */ - CharInfoPtr ci, pCI; - char *fsci; - fsXCharInfo fscilocal; - FontInfoRec *fi = &bfont->pfont->info; - - rep = (fsQueryXExtents16Reply *) fs_get_reply (conn, &ret); - if (!rep || rep->type == FS_Error || - (rep->length < LENGTHOF(fsQueryXExtents16Reply))) - { - if (ret == FSIO_BLOCK) - return StillWorking; - if (rep) - _fs_done_read (conn, rep->length << 2); - fs_cleanup_bfont (bfont); - _fs_reply_failed (rep, fsQueryXExtents16Reply, "<"); - return BadFontName; - } - - /* move the data over */ - /* need separate inkMetrics for fixed font server protocol version */ - numExtents = rep->num_extents; - numInfos = numExtents; - if (bfont->pfont->info.terminalFont && conn->fsMajorVersion > 1) - { - numInfos *= 2; - haveInk = TRUE; - } - if (numInfos >= (INT_MAX / sizeof(CharInfoRec))) { -#ifdef DEBUG - fprintf(stderr, - "fsQueryXExtents16: numInfos (%d) >= %ld\n", - numInfos, (INT_MAX / sizeof(CharInfoRec))); -#endif - pCI = NULL; - } - else if (numExtents > ((rep->length - LENGTHOF(fsQueryXExtents16Reply)) - / LENGTHOF(fsXCharInfo))) { -#ifdef DEBUG - fprintf(stderr, - "fsQueryXExtents16: numExtents (%d) > (%d - %d) / %d\n", - numExtents, rep->length, - LENGTHOF(fsQueryXExtents16Reply), LENGTHOF(fsXCharInfo)); -#endif - pCI = NULL; - } - else - pCI = malloc(sizeof(CharInfoRec) * numInfos); - - if (!pCI) - { - _fs_done_read (conn, rep->length << 2); - fs_cleanup_bfont(bfont); - return AllocError; - } - fsfont->encoding = pCI; - if (haveInk) - fsfont->inkMetrics = pCI + numExtents; - else - fsfont->inkMetrics = pCI; - - buf = (char *) rep; - buf += SIZEOF (fsQueryXExtents16Reply); - fsci = buf; - - fsd->glyphs_to_get = 0; - ci = fsfont->inkMetrics; - for (i = 0; i < numExtents; i++) - { - memcpy(&fscilocal, fsci, SIZEOF(fsXCharInfo)); /* align it */ - _fs_convert_char_info(&fscilocal, &ci->metrics); - /* Bounds check. */ - if (ci->metrics.ascent > fi->maxbounds.ascent) - { - ErrorF("fserve: warning: %s %s ascent (%d) > maxascent (%d)\n", - fpe->name, fsd->name, - ci->metrics.ascent, fi->maxbounds.ascent); - ci->metrics.ascent = fi->maxbounds.ascent; - } - if (ci->metrics.descent > fi->maxbounds.descent) - { - ErrorF("fserve: warning: %s %s descent (%d) > maxdescent (%d)\n", - fpe->name, fsd->name, - ci->metrics.descent, fi->maxbounds.descent); - ci->metrics.descent = fi->maxbounds.descent; - } - fsci = fsci + SIZEOF(fsXCharInfo); - /* Initialize the bits field for later glyph-caching use */ - if (NONZEROMETRICS(&ci->metrics)) - { - if (!haveInk && - (ci->metrics.leftSideBearing == ci->metrics.rightSideBearing || - ci->metrics.ascent == -ci->metrics.descent)) - pCI[i].bits = &_fs_glyph_zero_length; - else - { - pCI[i].bits = &_fs_glyph_undefined; - fsd->glyphs_to_get++; - } - } - else - pCI[i].bits = (char *)0; - ci++; - } - - /* Done with reply */ - _fs_done_read (conn, rep->length << 2); - - /* build bitmap metrics, ImageRectMax style */ - if (haveInk) - { - CharInfoPtr ii; - - ci = fsfont->encoding; - ii = fsfont->inkMetrics; - for (i = 0; i < numExtents; i++, ci++, ii++) - { - if (NONZEROMETRICS(&ii->metrics)) - { - ci->metrics.leftSideBearing = FONT_MIN_LEFT(fi); - ci->metrics.rightSideBearing = FONT_MAX_RIGHT(fi); - ci->metrics.ascent = FONT_MAX_ASCENT(fi); - ci->metrics.descent = FONT_MAX_DESCENT(fi); - ci->metrics.characterWidth = FONT_MAX_WIDTH(fi); - ci->metrics.attributes = ii->metrics.attributes; - } - else - { - ci->metrics = ii->metrics; - } - /* Bounds check. */ - if (ci->metrics.ascent > fi->maxbounds.ascent) - { - ErrorF("fserve: warning: %s %s ascent (%d) " - "> maxascent (%d)\n", - fpe->name, fsd->name, - ci->metrics.ascent, fi->maxbounds.ascent); - ci->metrics.ascent = fi->maxbounds.ascent; - } - if (ci->metrics.descent > fi->maxbounds.descent) - { - ErrorF("fserve: warning: %s %s descent (%d) " - "> maxdescent (%d)\n", - fpe->name, fsd->name, - ci->metrics.descent, fi->maxbounds.descent); - ci->metrics.descent = fi->maxbounds.descent; - } - } - } - { - unsigned int r, c, numCols, firstCol; - - firstCol = bfont->pfont->info.firstCol; - numCols = bfont->pfont->info.lastCol - firstCol + 1; - c = bfont->pfont->info.defaultCh; - fsfont->pDefault = 0; - if (bfont->pfont->info.lastRow) - { - r = c >> 8; - r -= bfont->pfont->info.firstRow; - c &= 0xff; - c -= firstCol; - if (r < bfont->pfont->info.lastRow-bfont->pfont->info.firstRow+1 && - c < numCols) - fsfont->pDefault = &pCI[r * numCols + c]; - } - else - { - c -= firstCol; - if (c < numCols) - fsfont->pDefault = &pCI[c]; - } - } - bfont->state = FS_GLYPHS_REPLY; - - if (bfont->flags & FontLoadBitmaps) - { - /* - * Reset the blockrec for the next reply - */ - blockrec->sequenceNumber = bfont->queryBitmapsSequence; - conn->blockedReplyTime = GetTimeInMillis () + FontServerRequestTimeout; - return StillWorking; - } - return Successful; -} - -#ifdef DEBUG -static char *fs_open_states[] = { - "OPEN_REPLY ", - "INFO_REPLY ", - "EXTENT_REPLY", - "GLYPHS_REPLY", - "DONE_REPLY ", - "DEPENDING ", -}; -#endif - -static int -fs_do_open_font(FontPathElementPtr fpe, FSBlockDataPtr blockrec) -{ - FSBlockedFontPtr bfont = (FSBlockedFontPtr) blockrec->data; - int err; - -#ifdef DEBUG - fprintf (stderr, "fs_do_open_font state %s %s\n", - fs_open_states[bfont->state], - ((FSFontDataPtr) (bfont->pfont->fpePrivate))->name); -#endif - err = BadFontName; - switch (bfont->state) { - case FS_OPEN_REPLY: - err = fs_read_open_font(fpe, blockrec); - if (err != StillWorking) { /* already loaded, or error */ - /* if font's already loaded, massage error code */ - switch (bfont->state) { - case FS_DONE_REPLY: - err = Successful; - break; - case FS_DEPENDING: - err = StillWorking; - break; - } - } - break; - case FS_INFO_REPLY: - err = fs_read_query_info(fpe, blockrec); - break; - case FS_EXTENT_REPLY: - err = fs_read_extent_info(fpe, blockrec); - break; - case FS_GLYPHS_REPLY: - if (bfont->flags & FontLoadBitmaps) - err = fs_read_glyphs(fpe, blockrec); - break; - case FS_DEPENDING: /* can't happen */ - default: - break; - } -#ifdef DEBUG - fprintf (stderr, "fs_do_open_font err %d\n", err); -#endif - if (err != StillWorking) - { - bfont->state = FS_DONE_REPLY; /* for _fs_load_glyphs() */ - while ((blockrec = blockrec->depending)) - { - bfont = (FSBlockedFontPtr) blockrec->data; - bfont->state = FS_DONE_REPLY; /* for _fs_load_glyphs() */ - } - } - return err; -} - -void -_fs_mark_block (FSFpePtr conn, CARD32 mask) -{ - conn->blockState |= mask; - fs_blockState |= mask; -} - -void -_fs_unmark_block (FSFpePtr conn, CARD32 mask) -{ - FSFpePtr c; - - if (conn->blockState & mask) - { - conn->blockState &= ~mask; - fs_blockState = 0; - for (c = fs_fpes; c; c = c->next) - fs_blockState |= c->blockState; - } -} - -/* ARGSUSED */ -static void -fs_block_handler(pointer data, OSTimePtr wt, pointer LastSelectMask) -{ - static struct timeval block_timeout; - CARD32 now, earliest, wakeup; - int soonest; - FSFpePtr conn; - - XFD_ORSET((fd_set *)LastSelectMask, (fd_set *)LastSelectMask, - &_fs_fd_mask); - /* - * Flush all pending output - */ - if (fs_blockState & FS_PENDING_WRITE) - for (conn = fs_fpes; conn; conn = conn->next) - if (conn->blockState & FS_PENDING_WRITE) - _fs_flush (conn); - /* - * Check for any fpe with a complete reply, set sleep time to zero - */ - if (fs_blockState & FS_COMPLETE_REPLY) - { - block_timeout.tv_sec = 0; - block_timeout.tv_usec = 0; - if (*wt == NULL) - *wt = &block_timeout; - else - **wt = block_timeout; - } - /* - * Walk through fpe list computing sleep time - */ - else if (fs_blockState & (FS_BROKEN_WRITE| - FS_BROKEN_CONNECTION| - FS_PENDING_REPLY| - FS_RECONNECTING)) - { - now = GetTimeInMillis (); - earliest = now + 10000000; - for (conn = fs_fpes; conn; conn = conn->next) - { - if (conn->blockState & FS_RECONNECTING) - { - wakeup = conn->blockedConnectTime; - if (TimeCmp (wakeup, <, earliest)) - earliest = wakeup; - } - if (conn->blockState & FS_BROKEN_CONNECTION) - { - wakeup = conn->brokenConnectionTime; - if (TimeCmp (wakeup, <, earliest)) - earliest = wakeup; - } - if (conn->blockState & FS_BROKEN_WRITE) - { - wakeup = conn->brokenWriteTime; - if (TimeCmp (wakeup, <, earliest)) - earliest = wakeup; - } - if (conn->blockState & FS_PENDING_REPLY) - { - wakeup = conn->blockedReplyTime; - if (TimeCmp (wakeup, <, earliest)) - earliest = wakeup; - } - } - soonest = earliest - now; - if (soonest < 0) - soonest = 0; - block_timeout.tv_sec = soonest / 1000; - block_timeout.tv_usec = (soonest % 1000) * 1000; - if (*wt == NULL) - *wt = &block_timeout; - else if (soonest < (*wt)->tv_sec * 1000 + (*wt)->tv_usec / 1000) - **wt = block_timeout; - } -} - -static void -fs_handle_unexpected(FSFpePtr conn, fsGenericReply *rep) -{ - if (rep->type == FS_Event && rep->data1 == KeepAlive) - { - fsNoopReq req; - - /* ping it back */ - req.reqType = FS_Noop; - req.length = SIZEOF(fsNoopReq) >> 2; - _fs_add_req_log(conn, FS_Noop); - _fs_write(conn, (char *) &req, SIZEOF(fsNoopReq)); - } - /* this should suck up unexpected replies and events */ - _fs_done_read (conn, rep->length << 2); -} - -static void -fs_read_reply (FontPathElementPtr fpe, pointer client) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockDataPtr blockrec; - int ret; - int err; - fsGenericReply *rep; - - if ((rep = fs_get_reply (conn, &ret))) - { - _fs_add_rep_log (conn, rep); - for (blockrec = conn->blockedRequests; - blockrec; - blockrec = blockrec->next) - { - if (blockrec->sequenceNumber == rep->sequenceNumber) - break; - } - err = Successful; - if (!blockrec) - { - fs_handle_unexpected(conn, rep); - } - else - { - /* - * go read it, and if we're done, - * wake up the appropriate client - */ - switch (blockrec->type) { - case FS_OPEN_FONT: - blockrec->errcode = fs_do_open_font(fpe, blockrec); - break; - case FS_LOAD_GLYPHS: - blockrec->errcode = fs_read_glyphs(fpe, blockrec); - break; - case FS_LIST_FONTS: - blockrec->errcode = fs_read_list(fpe, blockrec); - break; - case FS_LIST_WITH_INFO: - blockrec->errcode = fs_read_list_info(fpe, blockrec); - break; - default: - break; - } - err = blockrec->errcode; - if (err != StillWorking) - { - while (blockrec) - { - blockrec->errcode = err; - if (client != blockrec->client) - ClientSignal(blockrec->client); - blockrec = blockrec->depending; - } - _fs_unmark_block (conn, FS_PENDING_REPLY); - } - } - if (fs_reply_ready (conn)) - _fs_mark_block (conn, FS_COMPLETE_REPLY); - else - _fs_unmark_block (conn, FS_COMPLETE_REPLY); - } -} - -static int -fs_wakeup(FontPathElementPtr fpe, unsigned long *mask) -{ - fd_set *LastSelectMask = (fd_set *) mask; - FSFpePtr conn = (FSFpePtr) fpe->private; - - /* - * Don't continue if the fd is -1 (which will be true when the - * font server terminates - */ - if ((conn->blockState & FS_RECONNECTING)) - _fs_check_reconnect (conn); - else if ((conn->blockState & FS_COMPLETE_REPLY) || - (conn->fs_fd != -1 && FD_ISSET(conn->fs_fd, LastSelectMask))) - fs_read_reply (fpe, 0); - if (conn->blockState & (FS_PENDING_REPLY|FS_BROKEN_CONNECTION|FS_BROKEN_WRITE)) - _fs_do_blocked (conn); -#ifdef DEBUG - { - FSBlockDataPtr blockrec; - FSBlockedFontPtr bfont; - FSBlockedListPtr blist; - static CARD32 lastState; - static FSBlockDataPtr lastBlock; - - if (conn->blockState || conn->blockedRequests || lastState || lastBlock) - { - fprintf (stderr, " Block State 0x%x\n", (int) conn->blockState); - lastState = conn->blockState; - lastBlock = conn->blockedRequests; - } - for (blockrec = conn->blockedRequests; blockrec; blockrec = blockrec->next) - { - switch (blockrec->type) { - case FS_OPEN_FONT: - bfont = (FSBlockedFontPtr) blockrec->data; - fprintf (stderr, " Blocked font errcode %d sequence %d state %s %s\n", - blockrec->errcode, - blockrec->sequenceNumber, - fs_open_states[bfont->state], - bfont->pfont ? - ((FSFontDataPtr) (bfont->pfont->fpePrivate))->name : - ""); - break; - case FS_LIST_FONTS: - blist = (FSBlockedListPtr) blockrec->data; - fprintf (stderr, " Blocked list errcode %d sequence %d\n", - blockrec->errcode, blockrec->sequenceNumber); - break; - default: - fprintf (stderr, " Blocked type %d errcode %d sequence %d\n", - blockrec->type, - blockrec->errcode, - blockrec->sequenceNumber); - break; - } - } - } -#endif - return FALSE; -} - -/* - * Notice a dead connection and prepare for reconnect - */ - -void -_fs_connection_died(FSFpePtr conn) -{ - if (conn->blockState & FS_BROKEN_CONNECTION) - return; - fs_close_conn(conn); - conn->brokenConnectionTime = GetTimeInMillis (); - _fs_mark_block (conn, FS_BROKEN_CONNECTION); - _fs_unmark_block (conn, FS_BROKEN_WRITE|FS_PENDING_WRITE|FS_RECONNECTING); -} - -/* - * Signal clients that the connection has come back up - */ -static int -_fs_restart_connection(FSFpePtr conn) -{ - FSBlockDataPtr block; - - _fs_unmark_block (conn, FS_GIVE_UP); - while ((block = (FSBlockDataPtr) conn->blockedRequests)) - { - if (block->errcode == StillWorking) - { - ClientSignal(block->client); - fs_abort_blockrec(conn, block); - } - } - return TRUE; -} - -/* - * Declare this font server connection useless - */ -static void -_fs_giveup (FSFpePtr conn) -{ - FSBlockDataPtr block; - - if (conn->blockState & FS_GIVE_UP) - return; -#ifdef DEBUG - fprintf (stderr, "give up on FS \"%s\"\n", conn->servername); -#endif - _fs_mark_block (conn, FS_GIVE_UP); - while ((block = (FSBlockDataPtr) conn->blockedRequests)) - { - if (block->errcode == StillWorking) - { - ClientSignal (block->client); - fs_abort_blockrec (conn, block); - } - } - if (conn->fs_fd >= 0) - _fs_connection_died (conn); -} - -static void -_fs_do_blocked (FSFpePtr conn) -{ - CARD32 now; - - now = GetTimeInMillis (); - if ((conn->blockState & FS_PENDING_REPLY) && - TimeCmp (conn->blockedReplyTime, <=, now)) - { - _fs_giveup (conn); - } - else - { - if (conn->blockState & FS_BROKEN_CONNECTION) - { - /* Try to reconnect broken connections */ - if (TimeCmp (conn->brokenConnectionTime, <=, now)) - _fs_start_reconnect (conn); - } - else if (conn->blockState & FS_BROKEN_WRITE) - { - /* Try to flush blocked connections */ - if (TimeCmp (conn->brokenWriteTime, <=, now)) - _fs_flush (conn); - } - } -} - -/* - * sends the actual request out - */ -/* ARGSUSED */ -static int -fs_send_open_font(pointer client, FontPathElementPtr fpe, Mask flags, - char *name, int namelen, - fsBitmapFormat format, fsBitmapFormatMask fmask, - XID id, FontPtr *ppfont) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FontPtr font; - FSBlockDataPtr blockrec = NULL; - FSBlockedFontPtr bfont; - FSFontDataPtr fsd; - fsOpenBitmapFontReq openreq; - fsQueryXInfoReq inforeq; - fsQueryXExtents16Req extreq; - int err; - unsigned char buf[1024]; - - if (conn->blockState & FS_GIVE_UP) - return BadFontName; - - if (namelen <= 0 || namelen > sizeof (buf) - 1) - return BadFontName; - - /* - * Get the font structure put together, either by reusing - * the existing one or creating a new one - */ - if (flags & FontReopen) - { - Atom nameatom, fn = None; - int i; - - font = *ppfont; - fsd = (FSFontDataPtr)font->fpePrivate; - /* This is an attempt to reopen a font. Did the font have a - NAME property? */ - if ((nameatom = MakeAtom("FONT", 4, 0)) != None) - { - for (i = 0; i < font->info.nprops; i++) - if (font->info.props[i].name == nameatom && - font->info.isStringProp[i]) - { - fn = font->info.props[i].value; - break; - } - } - if (fn == None || !(name = NameForAtom(fn))) - { - name = fsd->name; - namelen = fsd->namelen; - } - else - namelen = strlen(name); - } - else - { - font = fs_create_font (fpe, name, namelen, format, fmask); - if (!font) - return AllocError; - - fsd = (FSFontDataPtr)font->fpePrivate; - } - - /* make a new block record, and add it to the end of the list */ - blockrec = fs_new_block_rec(font->fpe, client, FS_OPEN_FONT); - if (!blockrec) - { - if (!(flags & FontReopen)) - (*font->unload_font) (font); - return AllocError; - } - - /* - * Must check this before generating any protocol, otherwise we'll - * mess up a reconnect in progress - */ - if (conn->blockState & (FS_BROKEN_CONNECTION | FS_RECONNECTING)) - { - _fs_pending_reply (conn); - return Suspended; - } - - fsd->generation = conn->generation; - - bfont = (FSBlockedFontPtr) blockrec->data; - bfont->fontid = fsd->fontid; - bfont->pfont = font; - bfont->state = FS_OPEN_REPLY; - bfont->flags = flags; - bfont->format = fsd->format; - bfont->clients_depending = (FSClientsDependingPtr)0; - bfont->freeFont = (flags & FontReopen) == 0; - - _fs_client_access (conn, client, (flags & FontOpenSync) != 0); - _fs_client_resolution(conn); - - /* do an FS_OpenFont, FS_QueryXInfo and FS_QueryXExtents */ - buf[0] = (unsigned char) namelen; - memcpy(&buf[1], name, namelen); - openreq.reqType = FS_OpenBitmapFont; - openreq.fid = fsd->fontid; - openreq.format_hint = fsd->format; - openreq.format_mask = fsd->fmask; - openreq.length = (SIZEOF(fsOpenBitmapFontReq) + namelen + 4) >> 2; - - _fs_add_req_log(conn, FS_OpenBitmapFont); - _fs_write(conn, (char *) &openreq, SIZEOF(fsOpenBitmapFontReq)); - _fs_write_pad(conn, (char *) buf, namelen + 1); - - blockrec->sequenceNumber = conn->current_seq; - - inforeq.reqType = FS_QueryXInfo; - inforeq.id = fsd->fontid; - inforeq.length = SIZEOF(fsQueryXInfoReq) >> 2; - - bfont->queryInfoSequence = conn->current_seq + 1; - - _fs_add_req_log(conn, FS_QueryXInfo); - _fs_write(conn, (char *) &inforeq, SIZEOF(fsQueryXInfoReq)); - - if (!(bfont->flags & FontReopen)) - { - extreq.reqType = FS_QueryXExtents16; - extreq.range = fsTrue; - extreq.fid = fsd->fontid; - extreq.num_ranges = 0; - extreq.length = SIZEOF(fsQueryXExtents16Req) >> 2; - - bfont->queryExtentsSequence = conn->current_seq + 1; - - _fs_add_req_log(conn, FS_QueryXExtents16); - _fs_write(conn, (char *) &extreq, SIZEOF(fsQueryXExtents16Req)); - } - -#ifdef NCD - if (configData.ExtendedFontDiags) - { - memcpy(buf, name, MIN(256, namelen)); - buf[MIN(256, namelen)] = '\0'; - printf("Requesting font \"%s\" from font server \"%s\"\n", - buf, font->fpe->name); - } -#endif - _fs_prepare_for_reply (conn); - - err = blockrec->errcode; - if (bfont->flags & FontOpenSync) - { - while (blockrec->errcode == StillWorking) - { - if (fs_await_reply (conn) != FSIO_READY) - { - blockrec->errcode = BadFontName; - break; - } - fs_read_reply (font->fpe, client); - } - err = blockrec->errcode; - if (err == Successful) - *ppfont = bfont->pfont; - else - fs_cleanup_bfont (bfont); - bfont->freeFont = FALSE; - _fs_remove_block_rec (conn, blockrec); - } - return err == StillWorking ? Suspended : err; -} - -static void -fs_send_query_bitmaps(FontPathElementPtr fpe, FSBlockDataPtr blockrec) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockedFontPtr bfont = (FSBlockedFontPtr) blockrec->data; - fsQueryXBitmaps16Req bitreq; - - /* send the request */ - bitreq.reqType = FS_QueryXBitmaps16; - bitreq.fid = bfont->fontid; - bitreq.format = bfont->format; - bitreq.range = TRUE; - bitreq.length = SIZEOF(fsQueryXBitmaps16Req) >> 2; - bitreq.num_ranges = 0; - - bfont->queryBitmapsSequence = conn->current_seq + 1; - - _fs_add_req_log(conn, FS_QueryXBitmaps16); - _fs_write(conn, (char *) &bitreq, SIZEOF(fsQueryXBitmaps16Req)); -} - -/* ARGSUSED */ -static int -fs_open_font(pointer client, FontPathElementPtr fpe, Mask flags, - char *name, int namelen, - fsBitmapFormat format, fsBitmapFormatMask fmask, - XID id, FontPtr *ppfont, - char **alias, FontPtr non_cachable_font) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockDataPtr blockrec; - FSBlockedFontPtr bfont; - int err; - - /* libfont interface expects ImageRectMin glyphs */ - format = (format & ~BitmapFormatImageRectMask) | BitmapFormatImageRectMin; - - *alias = (char *) 0; - for (blockrec = conn->blockedRequests; blockrec; blockrec = blockrec->next) - { - if (blockrec->type == FS_OPEN_FONT && blockrec->client == client) - { - err = blockrec->errcode; - if (err == StillWorking) - return Suspended; - - bfont = (FSBlockedFontPtr) blockrec->data; - if (err == Successful) - *ppfont = bfont->pfont; - else - fs_cleanup_bfont (bfont); - _fs_remove_block_rec (conn, blockrec); - return err; - } - } - return fs_send_open_font(client, fpe, flags, name, namelen, format, fmask, - id, ppfont); -} - -/* ARGSUSED */ -static int -fs_send_close_font(FontPathElementPtr fpe, Font id) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - fsCloseReq req; - - if (conn->blockState & FS_GIVE_UP) - return Successful; - /* tell the font server to close the font */ - req.reqType = FS_CloseFont; - req.length = SIZEOF(fsCloseReq) >> 2; - req.id = id; - _fs_add_req_log(conn, FS_CloseFont); - _fs_write(conn, (char *) &req, SIZEOF(fsCloseReq)); - - return Successful; -} - -/* ARGSUSED */ -static void -fs_close_font(FontPathElementPtr fpe, FontPtr pfont) -{ - FSFontDataPtr fsd = (FSFontDataPtr) pfont->fpePrivate; - FSFpePtr conn = (FSFpePtr) fpe->private; - - if (conn->generation == fsd->generation) - fs_send_close_font(fpe, fsd->fontid); - -#ifdef DEBUG - { - FSBlockDataPtr blockrec; - FSBlockedFontPtr bfont; - - for (blockrec = conn->blockedRequests; blockrec; blockrec = blockrec->next) - { - if (blockrec->type == FS_OPEN_FONT) - { - bfont = (FSBlockedFontPtr) blockrec->data; - if (bfont->pfont == pfont) - fprintf (stderr, "closing font which hasn't been opened\n"); - } - } - } -#endif - (*pfont->unload_font) (pfont); -} - -static int -fs_read_glyphs(FontPathElementPtr fpe, FSBlockDataPtr blockrec) -{ - FSBlockedGlyphPtr bglyph = (FSBlockedGlyphPtr) blockrec->data; - FSBlockedFontPtr bfont = (FSBlockedFontPtr) blockrec->data; - FSFpePtr conn = (FSFpePtr) fpe->private; - FontPtr pfont = bglyph->pfont; - /* works for either blocked font - or glyph rec... pfont is at - the very beginning of both - blockrec->data structures */ - FSFontDataPtr fsd = (FSFontDataPtr) (pfont->fpePrivate); - FSFontPtr fsdata = (FSFontPtr) pfont->fontPrivate; - FontInfoPtr pfi = &pfont->info; - fsQueryXBitmaps16Reply *rep; - char *buf; - long bufleft = 0; /* length of reply left to use */ - fsOffset32 *ppbits; - fsOffset32 local_off; - char *off_adr; - pointer pbitmaps; - char *bits, *allbits; -#ifdef DEBUG - char *origallbits; -#endif - int i, - err; - int nranges = 0; - int ret; - fsRange *nextrange = 0; - unsigned long minchar, maxchar; - - rep = (fsQueryXBitmaps16Reply *) fs_get_reply (conn, &ret); - if (!rep || rep->type == FS_Error || - (rep->length < LENGTHOF(fsQueryXBitmaps16Reply))) - { - if (ret == FSIO_BLOCK) - return StillWorking; - if (rep) - _fs_done_read (conn, rep->length << 2); - err = AllocError; - _fs_reply_failed (rep, fsQueryXBitmaps16Reply, "<"); - goto bail; - } - - buf = (char *) rep; - buf += SIZEOF (fsQueryXBitmaps16Reply); - - bufleft = rep->length << 2; - bufleft -= SIZEOF (fsQueryXBitmaps16Reply); - - if ((bufleft / SIZEOF (fsOffset32)) < rep->num_chars) - { -#ifdef DEBUG - fprintf(stderr, - "fsQueryXBitmaps16: num_chars (%d) > bufleft (%ld) / %d\n", - rep->num_chars, bufleft, SIZEOF (fsOffset32)); -#endif - err = AllocError; - goto bail; - } - ppbits = (fsOffset32 *) buf; - buf += SIZEOF (fsOffset32) * (rep->num_chars); - bufleft -= SIZEOF (fsOffset32) * (rep->num_chars); - - if (bufleft < rep->nbytes) - { -#ifdef DEBUG - fprintf(stderr, - "fsQueryXBitmaps16: nbytes (%d) > bufleft (%ld)\n", - rep->nbytes, bufleft); -#endif - err = AllocError; - goto bail; - } - pbitmaps = (pointer ) buf; - - if (blockrec->type == FS_LOAD_GLYPHS) - { - nranges = bglyph->num_expected_ranges; - nextrange = bglyph->expected_ranges; - } - - /* place the incoming glyphs */ - if (nranges) - { - /* We're operating under the assumption that the ranges - requested in the LoadGlyphs call were all legal for this - font, and that individual ranges do not cover multiple - rows... fs_build_range() is designed to ensure this. */ - minchar = (nextrange->min_char_high - pfi->firstRow) * - (pfi->lastCol - pfi->firstCol + 1) + - nextrange->min_char_low - pfi->firstCol; - maxchar = (nextrange->max_char_high - pfi->firstRow) * - (pfi->lastCol - pfi->firstCol + 1) + - nextrange->max_char_low - pfi->firstCol; - nextrange++; - } - else - { - minchar = 0; - maxchar = rep->num_chars; - } - - off_adr = (char *)ppbits; - - allbits = fs_alloc_glyphs (pfont, rep->nbytes); - - if (!allbits) - { - err = AllocError; - goto bail; - } - -#ifdef DEBUG - origallbits = allbits; - fprintf (stderr, "Reading %d glyphs in %d bytes for %s\n", - (int) rep->num_chars, (int) rep->nbytes, fsd->name); -#endif - - for (i = 0; i < rep->num_chars; i++) - { - memcpy(&local_off, off_adr, SIZEOF(fsOffset32)); /* align it */ - if (blockrec->type == FS_OPEN_FONT || - fsdata->encoding[minchar].bits == &_fs_glyph_requested) - { - /* - * Broken X font server returns bits for missing characters - * when font is padded - */ - if (NONZEROMETRICS(&fsdata->encoding[minchar].metrics)) - { - if (local_off.length && - (local_off.position < rep->nbytes) && - (local_off.length <= (rep->nbytes - local_off.position))) - { - bits = allbits; - allbits += local_off.length; - memcpy(bits, (char *)pbitmaps + local_off.position, - local_off.length); - } - else - bits = &_fs_glyph_zero_length; - } - else - bits = 0; - if (fsdata->encoding[minchar].bits == &_fs_glyph_requested) - fsd->glyphs_to_get--; - fsdata->encoding[minchar].bits = bits; - } - if (minchar++ == maxchar) - { - if (!--nranges) break; - minchar = (nextrange->min_char_high - pfi->firstRow) * - (pfi->lastCol - pfi->firstCol + 1) + - nextrange->min_char_low - pfi->firstCol; - maxchar = (nextrange->max_char_high - pfi->firstRow) * - (pfi->lastCol - pfi->firstCol + 1) + - nextrange->max_char_low - pfi->firstCol; - nextrange++; - } - off_adr += SIZEOF(fsOffset32); - } -#ifdef DEBUG - fprintf (stderr, "Used %d bytes instead of %d\n", - (int) (allbits - origallbits), (int) rep->nbytes); -#endif - - if (blockrec->type == FS_OPEN_FONT) - { - fsd->glyphs_to_get = 0; - bfont->state = FS_DONE_REPLY; - } - err = Successful; - -bail: - _fs_done_read (conn, rep->length << 2); - return err; -} - -static int -fs_send_load_glyphs(pointer client, FontPtr pfont, - int nranges, fsRange *ranges) -{ - FontPathElementPtr fpe = pfont->fpe; - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockedGlyphPtr blockedglyph; - fsQueryXBitmaps16Req req; - FSBlockDataPtr blockrec; - - if (conn->blockState & FS_GIVE_UP) - return BadCharRange; - - /* make a new block record, and add it to the end of the list */ - blockrec = fs_new_block_rec(fpe, client, FS_LOAD_GLYPHS); - if (!blockrec) - return AllocError; - blockedglyph = (FSBlockedGlyphPtr) blockrec->data; - blockedglyph->pfont = pfont; - blockedglyph->num_expected_ranges = nranges; - /* Assumption: it's our job to free ranges */ - blockedglyph->expected_ranges = ranges; - blockedglyph->clients_depending = (FSClientsDependingPtr)0; - - if (conn->blockState & (FS_BROKEN_CONNECTION|FS_RECONNECTING)) - { - _fs_pending_reply (conn); - return Suspended; - } - - /* send the request */ - req.reqType = FS_QueryXBitmaps16; - req.fid = ((FSFontDataPtr) pfont->fpePrivate)->fontid; - req.format = pfont->format; - if (pfont->info.terminalFont) - req.format = (req.format & ~(BitmapFormatImageRectMask)) | - BitmapFormatImageRectMax; - req.range = TRUE; - /* each range takes up 4 bytes */ - req.length = (SIZEOF(fsQueryXBitmaps16Req) >> 2) + nranges; - req.num_ranges = nranges * 2; /* protocol wants count of fsChar2bs */ - _fs_add_req_log(conn, FS_QueryXBitmaps16); - _fs_write(conn, (char *) &req, SIZEOF(fsQueryXBitmaps16Req)); - - blockrec->sequenceNumber = conn->current_seq; - - /* Send ranges to the server... pack into a char array by hand - to avoid structure-packing portability problems and to - handle swapping for version1 protocol */ - if (nranges) - { -#define RANGE_BUFFER_SIZE 64 -#define RANGE_BUFFER_SIZE_MASK 63 - int i; - char range_buffer[RANGE_BUFFER_SIZE * 4]; - char *range_buffer_p; - - range_buffer_p = range_buffer; - for (i = 0; i < nranges;) - { - if (conn->fsMajorVersion > 1) - { - *range_buffer_p++ = ranges[i].min_char_high; - *range_buffer_p++ = ranges[i].min_char_low; - *range_buffer_p++ = ranges[i].max_char_high; - *range_buffer_p++ = ranges[i].max_char_low; - } - else - { - *range_buffer_p++ = ranges[i].min_char_low; - *range_buffer_p++ = ranges[i].min_char_high; - *range_buffer_p++ = ranges[i].max_char_low; - *range_buffer_p++ = ranges[i].max_char_high; - } - - if (!(++i & RANGE_BUFFER_SIZE_MASK)) - { - _fs_write(conn, range_buffer, RANGE_BUFFER_SIZE * 4); - range_buffer_p = range_buffer; - } - } - if (i &= RANGE_BUFFER_SIZE_MASK) - _fs_write(conn, range_buffer, i * 4); - } - - _fs_prepare_for_reply (conn); - return Suspended; -} - - -extern pointer serverClient; /* This could be any number that - doesn't conflict with existing - client values. */ - -int -fs_load_all_glyphs(FontPtr pfont) -{ - int err; - FSFpePtr conn = (FSFpePtr) pfont->fpe->private; - - /* - * The purpose of this procedure is to load all glyphs in the event - * that we're dealing with someone who doesn't understand the finer - * points of glyph caching... it is called from _fs_get_glyphs() if - * the latter is called to get glyphs that have not yet been loaded. - * We assume that the caller will not know how to handle a return - * value of Suspended (usually the case for a GetGlyphs() caller), - * so this procedure hangs around, freezing the server, for the - * request to complete. This is an unpleasant kluge called to - * perform an unpleasant job that, we hope, will never be required. - */ - - while ((err = _fs_load_glyphs(serverClient, pfont, TRUE, 0, 0, NULL)) == - Suspended) - { - if (fs_await_reply (conn) != FSIO_READY) - { - /* Get rid of blockrec */ - fs_client_died(serverClient, pfont->fpe); - err = BadCharRange; - break; - } - fs_read_reply (pfont->fpe, serverClient); - } - return err; -} - - -int -_fs_load_glyphs(pointer client, FontPtr pfont, Bool range_flag, - unsigned int nchars, int item_size, unsigned char *data) -{ - FSFpePtr conn = (FSFpePtr) pfont->fpe->private; - int nranges = 0; - fsRange *ranges = NULL; - int res; - FSBlockDataPtr blockrec; - FSBlockedGlyphPtr blockedglyph; - FSClientsDependingPtr *clients_depending = NULL; - int err; - - /* see if the result is already there */ - for (blockrec = conn->blockedRequests; blockrec; blockrec = blockrec->next) - { - if (blockrec->type == FS_LOAD_GLYPHS) - { - blockedglyph = (FSBlockedGlyphPtr) blockrec->data; - if (blockedglyph->pfont == pfont) - { - /* Look for this request */ - if (blockrec->client == client) - { - err = blockrec->errcode; - if (err == StillWorking) - return Suspended; - _fs_signal_clients_depending(&blockedglyph->clients_depending); - _fs_remove_block_rec(conn, blockrec); - return err; - } - /* We've found an existing LoadGlyphs blockrec for this - font but for another client. Rather than build a - blockrec for it now (which entails some complex - maintenance), we'll add it to a queue of clients to - be signalled when the existing LoadGlyphs is - completed. */ - clients_depending = &blockedglyph->clients_depending; - break; - } - } - else if (blockrec->type == FS_OPEN_FONT) - { - FSBlockedFontPtr bfont; - bfont = (FSBlockedFontPtr) blockrec->data; - if (bfont->pfont == pfont) - { - /* - * An OpenFont is pending for this font, this must - * be from a reopen attempt, so finish the open - * attempt and retry the LoadGlyphs - */ - if (blockrec->client == client) - { - err = blockrec->errcode; - if (err == StillWorking) - return Suspended; - - _fs_signal_clients_depending(&bfont->clients_depending); - _fs_remove_block_rec(conn, blockrec); - if (err != Successful) - return err; - break; - } - /* We've found an existing OpenFont blockrec for this - font but for another client. Rather than build a - blockrec for it now (which entails some complex - maintenance), we'll add it to a queue of clients to - be signalled when the existing OpenFont is - completed. */ - if (blockrec->errcode == StillWorking) - { - clients_depending = &bfont->clients_depending; - break; - } - } - } - } - - /* - * see if the desired glyphs already exist, and return Successful if they - * do, otherwise build up character range/character string - */ - res = fs_build_range(pfont, range_flag, nchars, item_size, data, - &nranges, &ranges); - - switch (res) - { - case AccessDone: - return Successful; - - case Successful: - break; - - default: - return res; - } - - /* - * If clients_depending is not null, this request must wait for - * some prior request(s) to complete. - */ - if (clients_depending) - { - /* Since we're not ready to send the load_glyphs request yet, - clean up the damage (if any) caused by the fs_build_range() - call. */ - if (nranges) - { - _fs_clean_aborted_loadglyphs(pfont, nranges, ranges); - xfree(ranges); - } - return _fs_add_clients_depending(clients_depending, client); - } - - /* - * If fsd->generation != conn->generation, the font has been closed - * due to a lost connection. We will reopen it, which will result - * in one of three things happening: - * 1) The open will succeed and obtain the same font. Life - * is wonderful. - * 2) The open will fail. There is code above to recognize this - * and flunk the LoadGlyphs request. The client might not be - * thrilled. - * 3) Worst case: the open will succeed but the font we open will - * be different. The fs_read_query_info() procedure attempts - * to detect this by comparing the existing metrics and - * properties against those of the reopened font... if they - * don't match, we flunk the reopen, which eventually results - * in flunking the LoadGlyphs request. We could go a step - * further and compare the extents, but this should be - * sufficient. - */ - if (((FSFontDataPtr)pfont->fpePrivate)->generation != conn->generation) - { - /* Since we're not ready to send the load_glyphs request yet, - clean up the damage caused by the fs_build_range() call. */ - _fs_clean_aborted_loadglyphs(pfont, nranges, ranges); - xfree(ranges); - - /* Now try to reopen the font. */ - return fs_send_open_font(client, pfont->fpe, - (Mask)FontReopen, (char *)0, 0, - (fsBitmapFormat)0, (fsBitmapFormatMask)0, - (XID)0, &pfont); - } - - return fs_send_load_glyphs(client, pfont, nranges, ranges); -} - -static int -fs_read_list(FontPathElementPtr fpe, FSBlockDataPtr blockrec) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockedListPtr blist = (FSBlockedListPtr) blockrec->data; - fsListFontsReply *rep; - char *data; - long dataleft; /* length of reply left to use */ - int length, - i, - ret; - int err; - - rep = (fsListFontsReply *) fs_get_reply (conn, &ret); - if (!rep || rep->type == FS_Error || - (rep->length < LENGTHOF(fsListFontsReply))) - { - if (ret == FSIO_BLOCK) - return StillWorking; - if (rep) - _fs_done_read (conn, rep->length << 2); - _fs_reply_failed (rep, fsListFontsReply, "<"); - return AllocError; - } - data = (char *) rep + SIZEOF (fsListFontsReply); - dataleft = (rep->length << 2) - SIZEOF (fsListFontsReply); - - err = Successful; - /* copy data into FontPathRecord */ - for (i = 0; i < rep->nFonts; i++) - { - if (dataleft < 1) - break; - length = *(unsigned char *)data++; - dataleft--; /* used length byte */ - if (length > dataleft) { -#ifdef DEBUG - fprintf(stderr, - "fsListFonts: name length (%d) > dataleft (%ld)\n", - length, dataleft); -#endif - err = BadFontName; - break; - } - err = AddFontNamesName(blist->names, data, length); - if (err != Successful) - break; - data += length; - dataleft -= length; - } - _fs_done_read (conn, rep->length << 2); - return err; -} - -static int -fs_send_list_fonts(pointer client, FontPathElementPtr fpe, char *pattern, - int patlen, int maxnames, FontNamesPtr newnames) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockDataPtr blockrec; - FSBlockedListPtr blockedlist; - fsListFontsReq req; - - if (conn->blockState & FS_GIVE_UP) - return BadFontName; - - /* make a new block record, and add it to the end of the list */ - blockrec = fs_new_block_rec(fpe, client, FS_LIST_FONTS); - if (!blockrec) - return AllocError; - blockedlist = (FSBlockedListPtr) blockrec->data; - blockedlist->names = newnames; - - if (conn->blockState & (FS_BROKEN_CONNECTION | FS_RECONNECTING)) - { - _fs_pending_reply (conn); - return Suspended; - } - - _fs_client_access (conn, client, FALSE); - _fs_client_resolution(conn); - - /* send the request */ - req.reqType = FS_ListFonts; - req.maxNames = maxnames; - req.nbytes = patlen; - req.length = (SIZEOF(fsListFontsReq) + patlen + 3) >> 2; - _fs_add_req_log(conn, FS_ListFonts); - _fs_write(conn, (char *) &req, SIZEOF(fsListFontsReq)); - _fs_write_pad(conn, (char *) pattern, patlen); - - blockrec->sequenceNumber = conn->current_seq; - -#ifdef NCD - if (configData.ExtendedFontDiags) { - char buf[256]; - - memcpy(buf, pattern, MIN(256, patlen)); - buf[MIN(256, patlen)] = '\0'; - printf("Listing fonts on pattern \"%s\" from font server \"%s\"\n", - buf, fpe->name); - } -#endif - - _fs_prepare_for_reply (conn); - return Suspended; -} - -static int -fs_list_fonts(pointer client, FontPathElementPtr fpe, - char *pattern, int patlen, int maxnames, FontNamesPtr newnames) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockDataPtr blockrec; - int err; - - /* see if the result is already there */ - for (blockrec = conn->blockedRequests; blockrec; blockrec = blockrec->next) - { - if (blockrec->type == FS_LIST_FONTS && blockrec->client == client) - { - err = blockrec->errcode; - if (err == StillWorking) - return Suspended; - _fs_remove_block_rec(conn, blockrec); - return err; - } - } - - /* didn't find waiting record, so send a new one */ - return fs_send_list_fonts(client, fpe, pattern, patlen, maxnames, newnames); -} - -/* - * Read a single list info reply and restart for the next reply - */ -static int -fs_read_list_info(FontPathElementPtr fpe, FSBlockDataPtr blockrec) -{ - FSBlockedListInfoPtr binfo = (FSBlockedListInfoPtr) blockrec->data; - fsListFontsWithXInfoReply *rep; - char *buf; - long bufleft = 0; - FSFpePtr conn = (FSFpePtr) fpe->private; - fsPropInfo *pi; - fsPropOffset *po; - pointer pd; - int ret; - int err; - - /* clean up anything from the last trip */ - _fs_free_props (&binfo->info); - - rep = (fsListFontsWithXInfoReply *) fs_get_reply (conn, &ret); - if (!rep || rep->type == FS_Error || - ((rep->nameLength != 0) && - (rep->length < LENGTHOF(fsListFontsWithXInfoReply)))) - { - if (ret == FSIO_BLOCK) - return StillWorking; - binfo->status = FS_LFWI_FINISHED; - err = AllocError; - _fs_reply_failed (rep, fsListFontsWithXInfoReply, "<"); - goto done; - } - /* - * Normal termination -- the list ends with a name of length 0 - */ - if (rep->nameLength == 0) - { -#ifdef DEBUG - fprintf (stderr, "fs_read_list_info done\n"); -#endif - binfo->status = FS_LFWI_FINISHED; - err = BadFontName; - goto done; - } - - buf = (char *) rep + SIZEOF (fsListFontsWithXInfoReply); - bufleft = (rep->length << 2) - SIZEOF (fsListFontsWithXInfoReply); - - /* - * The original FS implementation didn't match - * the spec, version 1 was respecified to match the FS. - * Version 2 matches the original intent - */ - if (conn->fsMajorVersion <= 1) - { - if (rep->nameLength > bufleft) { -#ifdef DEBUG - fprintf(stderr, - "fsListFontsWithXInfo: name length (%d) > bufleft (%ld)\n", - (int) rep->nameLength, bufleft); -#endif - err = AllocError; - goto done; - } - /* binfo->name is a 256 char array, rep->nameLength is a CARD8 */ - memcpy (binfo->name, buf, rep->nameLength); - buf += _fs_pad_length (rep->nameLength); - bufleft -= _fs_pad_length (rep->nameLength); - } - pi = (fsPropInfo *) buf; - if (SIZEOF (fsPropInfo) > bufleft) { -#ifdef DEBUG - fprintf(stderr, - "fsListFontsWithXInfo: PropInfo length (%d) > bufleft (%ld)\n", - (int) SIZEOF (fsPropInfo), bufleft); -#endif - err = AllocError; - goto done; - } - bufleft -= SIZEOF (fsPropInfo); - buf += SIZEOF (fsPropInfo); - po = (fsPropOffset *) buf; - if (pi->num_offsets > (bufleft / SIZEOF (fsPropOffset))) { -#ifdef DEBUG - fprintf(stderr, - "fsListFontsWithXInfo: offset length (%d * %d) > bufleft (%ld)\n", - pi->num_offsets, (int) SIZEOF (fsPropOffset), bufleft); -#endif - err = AllocError; - goto done; - } - bufleft -= pi->num_offsets * SIZEOF (fsPropOffset); - buf += pi->num_offsets * SIZEOF (fsPropOffset); - pd = (pointer) buf; - if (pi->data_len > bufleft) { -#ifdef DEBUG - fprintf(stderr, - "fsListFontsWithXInfo: data length (%d) > bufleft (%ld)\n", - pi->data_len, bufleft); -#endif - err = AllocError; - goto done; - } - bufleft -= pi->data_len; - buf += pi->data_len; - if (conn->fsMajorVersion > 1) - { - if (rep->nameLength > bufleft) { -#ifdef DEBUG - fprintf(stderr, - "fsListFontsWithXInfo: name length (%d) > bufleft (%ld)\n", - (int) rep->nameLength, bufleft); -#endif - err = AllocError; - goto done; - } - /* binfo->name is a 256 char array, rep->nameLength is a CARD8 */ - memcpy (binfo->name, buf, rep->nameLength); - buf += _fs_pad_length (rep->nameLength); - bufleft -= _fs_pad_length (rep->nameLength); - } - -#ifdef DEBUG - binfo->name[rep->nameLength] = '\0'; - fprintf (stderr, "fs_read_list_info %s\n", binfo->name); -#endif - err = _fs_convert_lfwi_reply(conn, &binfo->info, rep, pi, po, pd); - if (err != Successful) - { - binfo->status = FS_LFWI_FINISHED; - goto done; - } - binfo->namelen = rep->nameLength; - binfo->remaining = rep->nReplies; - - binfo->status = FS_LFWI_REPLY; - - /* disable this font server until we've processed this response */ - _fs_unmark_block (conn, FS_COMPLETE_REPLY); - FD_CLR(conn->fs_fd, &_fs_fd_mask); -done: - _fs_done_read (conn, rep->length << 2); - return err; -} - -/* ARGSUSED */ -static int -fs_start_list_with_info(pointer client, FontPathElementPtr fpe, - char *pattern, int len, int maxnames, pointer *pdata) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockDataPtr blockrec; - FSBlockedListInfoPtr binfo; - fsListFontsWithXInfoReq req; - - if (conn->blockState & FS_GIVE_UP) - return BadFontName; - - /* make a new block record, and add it to the end of the list */ - blockrec = fs_new_block_rec(fpe, client, FS_LIST_WITH_INFO); - if (!blockrec) - return AllocError; - - binfo = (FSBlockedListInfoPtr) blockrec->data; - bzero((char *) binfo, sizeof(FSBlockedListInfoRec)); - binfo->status = FS_LFWI_WAITING; - - if (conn->blockState & (FS_BROKEN_CONNECTION | FS_RECONNECTING)) - { - _fs_pending_reply (conn); - return Suspended; - } - - _fs_client_access (conn, client, FALSE); - _fs_client_resolution(conn); - - /* send the request */ - req.reqType = FS_ListFontsWithXInfo; - req.maxNames = maxnames; - req.nbytes = len; - req.length = (SIZEOF(fsListFontsWithXInfoReq) + len + 3) >> 2; - _fs_add_req_log(conn, FS_ListFontsWithXInfo); - (void) _fs_write(conn, (char *) &req, SIZEOF(fsListFontsWithXInfoReq)); - (void) _fs_write_pad(conn, pattern, len); - - blockrec->sequenceNumber = conn->current_seq; - -#ifdef NCD - if (configData.ExtendedFontDiags) { - char buf[256]; - - memcpy(buf, pattern, MIN(256, len)); - buf[MIN(256, len)] = '\0'; - printf("Listing fonts with info on pattern \"%s\" from font server \"%s\"\n", - buf, fpe->name); - } -#endif - - _fs_prepare_for_reply (conn); - return Successful; -} - -/* ARGSUSED */ -static int -fs_next_list_with_info(pointer client, FontPathElementPtr fpe, - char **namep, int *namelenp, - FontInfoPtr *pFontInfo, int *numFonts, - pointer private) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockDataPtr blockrec; - FSBlockedListInfoPtr binfo; - int err; - - /* see if the result is already there */ - for (blockrec = conn->blockedRequests; blockrec; blockrec = blockrec->next) - if (blockrec->type == FS_LIST_WITH_INFO && blockrec->client == client) - break; - - if (!blockrec) - { - /* The only good reason for not finding a blockrec would be if - disconnect/reconnect to the font server wiped it out and the - code that called us didn't do the right thing to create - another one. Under those circumstances, we need to return an - error to prevent that code from attempting to interpret the - information we don't return. */ - return BadFontName; - } - - binfo = (FSBlockedListInfoPtr) blockrec->data; - - if (binfo->status == FS_LFWI_WAITING) - return Suspended; - - *namep = binfo->name; - *namelenp = binfo->namelen; - *pFontInfo = &binfo->info; - *numFonts = binfo->remaining; - - /* Restart reply processing from this font server */ - FD_SET(conn->fs_fd, &_fs_fd_mask); - if (fs_reply_ready (conn)) - _fs_mark_block (conn, FS_COMPLETE_REPLY); - - err = blockrec->errcode; - switch (binfo->status) { - case FS_LFWI_FINISHED: - _fs_remove_block_rec(conn, blockrec); - break; - case FS_LFWI_REPLY: - binfo->status = FS_LFWI_WAITING; - blockrec->errcode = StillWorking; - conn->blockedReplyTime = GetTimeInMillis () + FontServerRequestTimeout; - _fs_mark_block (conn, FS_PENDING_REPLY); - break; - } - - return err; -} - -/* - * Called when client exits - */ - -static void -fs_client_died(pointer client, FontPathElementPtr fpe) -{ - FSFpePtr conn = (FSFpePtr) fpe->private; - FSBlockDataPtr blockrec, - depending; - FSClientPtr *prev, cur; - fsFreeACReq freeac; - - for (prev = &conn->clients; (cur = *prev); prev = &cur->next) - { - if (cur->client == client) { - freeac.reqType = FS_FreeAC; - freeac.id = cur->acid; - freeac.length = sizeof (fsFreeACReq) >> 2; - _fs_add_req_log(conn, FS_FreeAC); - _fs_write (conn, (char *) &freeac, sizeof (fsFreeACReq)); - *prev = cur->next; - xfree (cur); - break; - } - } - /* find a pending requests */ - for (blockrec = conn->blockedRequests; blockrec; blockrec = blockrec->next) - if (blockrec->client == client) - break; - - if (!blockrec) - return; - - /* replace the client pointers in this block rec with the chained one */ - if ((depending = blockrec->depending)) - { - blockrec->client = depending->client; - blockrec->depending = depending->depending; - blockrec = depending; - } - fs_abort_blockrec(conn, blockrec); -} - -static void -_fs_client_access (FSFpePtr conn, pointer client, Bool sync) -{ - FSClientPtr *prev, cur; - fsCreateACReq crac; - fsSetAuthorizationReq setac; - char *authorizations; - int authlen; - Bool new_cur = FALSE; - -#ifdef DEBUG - if (conn->blockState & (FS_RECONNECTING|FS_BROKEN_CONNECTION)) - { - fprintf (stderr, "Sending requests without a connection\n"); - } -#endif - for (prev = &conn->clients; (cur = *prev); prev = &cur->next) - { - if (cur->client == client) - { - if (prev != &conn->clients) - { - *prev = cur->next; - cur->next = conn->clients; - conn->clients = cur; - } - break; - } - } - if (!cur) - { - cur = (FSClientPtr) xalloc (sizeof (FSClientRec)); - if (!cur) - return; - cur->client = client; - cur->next = conn->clients; - conn->clients = cur; - cur->acid = GetNewFontClientID (); - new_cur = TRUE; - } - if (new_cur || cur->auth_generation != client_auth_generation(client)) - { - if (!new_cur) - { - fsFreeACReq freeac; - freeac.reqType = FS_FreeAC; - freeac.id = cur->acid; - freeac.length = sizeof (fsFreeACReq) >> 2; - _fs_add_req_log(conn, FS_FreeAC); - _fs_write (conn, (char *) &freeac, sizeof (fsFreeACReq)); - } - crac.reqType = FS_CreateAC; - crac.num_auths = set_font_authorizations(&authorizations, &authlen, - client); - authlen = crac.num_auths ? (authlen + 3) & ~0x3 : 0; - crac.length = (sizeof (fsCreateACReq) + authlen) >> 2; - crac.acid = cur->acid; - _fs_add_req_log(conn, FS_CreateAC); - _fs_write(conn, (char *) &crac, sizeof (fsCreateACReq)); - _fs_write(conn, authorizations, authlen); - /* ignore reply; we don't even care about it */ - conn->curacid = 0; - cur->auth_generation = client_auth_generation(client); - } - if (conn->curacid != cur->acid) - { - setac.reqType = FS_SetAuthorization; - setac.length = sizeof (fsSetAuthorizationReq) >> 2; - setac.id = cur->acid; - _fs_add_req_log(conn, FS_SetAuthorization); - _fs_write(conn, (char *) &setac, sizeof (fsSetAuthorizationReq)); - conn->curacid = cur->acid; - } -} - -/* - * Poll a pending connect - */ - -static int -_fs_check_connect (FSFpePtr conn) -{ - int ret; - - ret = _fs_poll_connect (conn->trans_conn, 0); - switch (ret) { - case FSIO_READY: - conn->fs_fd = _FontTransGetConnectionNumber (conn->trans_conn); - FD_SET (conn->fs_fd, &_fs_fd_mask); - break; - case FSIO_BLOCK: - break; - } - return ret; -} - -/* - * Return an FSIO status while waiting for the completed connection - * reply to arrive - */ - -static fsConnSetup * -_fs_get_conn_setup (FSFpePtr conn, int *error, int *setup_len) -{ - int ret; - char *data; - int headlen; - int len; - fsConnSetup *setup; - fsConnSetupAccept *accept; - - ret = _fs_start_read (conn, SIZEOF (fsConnSetup), &data); - if (ret != FSIO_READY) - { - *error = ret; - return 0; - } - - setup = (fsConnSetup *) data; - if (setup->major_version > FS_PROTOCOL) - { - *error = FSIO_ERROR; - return 0; - } - - headlen = (SIZEOF (fsConnSetup) + - (setup->alternate_len << 2) + - (setup->auth_len << 2)); - /* On anything but Success, no extra data is sent */ - if (setup->status != AuthSuccess) - { - len = headlen; - } - else - { - ret = _fs_start_read (conn, headlen + SIZEOF (fsConnSetupAccept), &data); - if (ret != FSIO_READY) - { - *error = ret; - return 0; - } - setup = (fsConnSetup *) data; - accept = (fsConnSetupAccept *) (data + headlen); - len = headlen + (accept->length << 2); - } - ret = _fs_start_read (conn, len, &data); - if (ret != FSIO_READY) - { - *error = ret; - return 0; - } - *setup_len = len; - return (fsConnSetup *) data; -} - -static int -_fs_send_conn_client_prefix (FSFpePtr conn) -{ - fsConnClientPrefix req; - int endian; - int ret; - - /* send setup prefix */ - endian = 1; - if (*(char *) &endian) - req.byteOrder = 'l'; - else - req.byteOrder = 'B'; - - req.major_version = FS_PROTOCOL; - req.minor_version = FS_PROTOCOL_MINOR; - -/* XXX add some auth info here */ - req.num_auths = 0; - req.auth_len = 0; - ret = _fs_write (conn, (char *) &req, SIZEOF (fsConnClientPrefix)); - if (ret != FSIO_READY) - return FSIO_ERROR; - conn->blockedConnectTime = GetTimeInMillis () + FontServerRequestTimeout; - return ret; -} - -static int -_fs_recv_conn_setup (FSFpePtr conn) -{ - int ret; - fsConnSetup *setup; - FSFpeAltPtr alts; - unsigned int i, alt_len; - int setup_len; - char *alt_save, *alt_names; - - setup = _fs_get_conn_setup (conn, &ret, &setup_len); - if (!setup) - return ret; - conn->current_seq = 0; - conn->fsMajorVersion = setup->major_version; - /* - * Create an alternate list from the initial server, but - * don't chain looking for alternates. - */ - if (conn->alternate == 0) - { - /* - * free any existing alternates list, allowing the list to - * be updated - */ - if (conn->alts) - { - xfree (conn->alts); - conn->alts = 0; - conn->numAlts = 0; - } - if (setup->num_alternates) - { - size_t alt_name_len = setup->alternate_len << 2; - alts = (FSFpeAltPtr) xalloc (setup->num_alternates * - sizeof (FSFpeAltRec) + alt_name_len); - if (alts) - { - alt_names = (char *) (setup + 1); - alt_save = (char *) (alts + setup->num_alternates); - for (i = 0; i < setup->num_alternates; i++) - { - alts[i].subset = alt_names[0]; - alt_len = alt_names[1]; - if (alt_len >= alt_name_len) { - /* - * Length is longer than setup->alternate_len - * told us to allocate room for, assume entire - * alternate list is corrupted. - */ -#ifdef DEBUG - fprintf (stderr, - "invalid alt list (length %lx >= %lx)\n", - (long) alt_len, (long) alt_name_len); -#endif - xfree(alts); - return FSIO_ERROR; - } - alts[i].name = alt_save; - memcpy (alt_save, alt_names + 2, alt_len); - alt_save[alt_len] = '\0'; - alt_save += alt_len + 1; - alt_name_len -= alt_len + 1; - alt_names += _fs_pad_length (alt_len + 2); - } - conn->numAlts = setup->num_alternates; - conn->alts = alts; - } - } - } - _fs_done_read (conn, setup_len); - if (setup->status != AuthSuccess) - return FSIO_ERROR; - return FSIO_READY; -} - -static int -_fs_open_server (FSFpePtr conn) -{ - int ret; - char *servername; - - if (conn->alternate == 0) - servername = conn->servername; - else - servername = conn->alts[conn->alternate-1].name; - conn->trans_conn = _fs_connect (servername, &ret); - conn->blockedConnectTime = GetTimeInMillis () + FS_RECONNECT_WAIT; - return ret; -} - -static char * -_fs_catalog_name (char *servername) -{ - char *sp; - - sp = strchr (servername, '/'); - if (!sp) - return 0; - return strrchr (sp + 1, '/'); -} - -static int -_fs_send_init_packets (FSFpePtr conn) -{ - fsSetResolutionReq srreq; - fsSetCataloguesReq screq; - int num_cats, - clen; - char *catalogues; - char *cat; - char len; - char *end; - int num_res; - FontResolutionPtr res; - -#define CATALOGUE_SEP '+' - - res = GetClientResolutions(&num_res); - if (num_res) - { - srreq.reqType = FS_SetResolution; - srreq.num_resolutions = num_res; - srreq.length = (SIZEOF(fsSetResolutionReq) + - (num_res * SIZEOF(fsResolution)) + 3) >> 2; - - _fs_add_req_log(conn, FS_SetResolution); - if (_fs_write(conn, (char *) &srreq, SIZEOF(fsSetResolutionReq)) != FSIO_READY) - return FSIO_ERROR; - if (_fs_write_pad(conn, (char *) res, (num_res * SIZEOF(fsResolution))) != FSIO_READY) - return FSIO_ERROR; - } - - catalogues = 0; - if (conn->alternate != 0) - catalogues = _fs_catalog_name (conn->alts[conn->alternate-1].name); - if (!catalogues) - catalogues = _fs_catalog_name (conn->servername); - - if (!catalogues) - { - conn->has_catalogues = FALSE; - return FSIO_READY; - } - conn->has_catalogues = TRUE; - - /* turn cats into counted list */ - catalogues++; - - cat = catalogues; - num_cats = 0; - clen = 0; - while (*cat) - { - num_cats++; - end = strchr(cat, CATALOGUE_SEP); - if (!end) - end = cat + strlen (cat); - clen += (end - cat) + 1; /* length byte + string */ - cat = end; - } - - screq.reqType = FS_SetCatalogues; - screq.num_catalogues = num_cats; - screq.length = (SIZEOF(fsSetCataloguesReq) + clen + 3) >> 2; - - _fs_add_req_log(conn, FS_SetCatalogues); - if (_fs_write(conn, (char *) &screq, SIZEOF(fsSetCataloguesReq)) != FSIO_READY) - return FSIO_ERROR; - - while (*cat) - { - num_cats++; - end = strchr(cat, CATALOGUE_SEP); - if (!end) - end = cat + strlen (cat); - len = end - cat; - if (_fs_write (conn, &len, 1) != FSIO_READY) - return FSIO_ERROR; - if (_fs_write (conn, cat, (int) len) != FSIO_READY) - return FSIO_ERROR; - cat = end; - } - - if (_fs_write (conn, "....", _fs_pad_length (clen) - clen) != FSIO_READY) - return FSIO_ERROR; - - return FSIO_READY; -} - -static int -_fs_send_cat_sync (FSFpePtr conn) -{ - fsListCataloguesReq lcreq; - - /* - * now sync up with the font server, to see if an error was generated - * by a bogus catalogue - */ - lcreq.reqType = FS_ListCatalogues; - lcreq.length = (SIZEOF(fsListCataloguesReq)) >> 2; - lcreq.maxNames = 0; - lcreq.nbytes = 0; - _fs_add_req_log(conn, FS_SetCatalogues); - if (_fs_write(conn, (char *) &lcreq, SIZEOF(fsListCataloguesReq)) != FSIO_READY) - return FSIO_ERROR; - conn->blockedConnectTime = GetTimeInMillis () + FontServerRequestTimeout; - return FSIO_READY; -} - -static int -_fs_recv_cat_sync (FSFpePtr conn) -{ - fsGenericReply *reply; - fsError *error; - int err; - int ret; - - reply = fs_get_reply (conn, &err); - if (!reply) - return err; - - ret = FSIO_READY; - if (reply->type == FS_Error) - { - error = (fsError *) reply; - if (error->major_opcode == FS_SetCatalogues) - ret = FSIO_ERROR; - } - _fs_done_read (conn, reply->length << 2); - return ret; -} - -static void -_fs_close_server (FSFpePtr conn) -{ - _fs_unmark_block (conn, FS_PENDING_WRITE|FS_BROKEN_WRITE|FS_COMPLETE_REPLY|FS_BROKEN_CONNECTION); - if (conn->trans_conn) - { - _FontTransClose (conn->trans_conn); - conn->trans_conn = 0; - _fs_io_reinit (conn); - } - if (conn->fs_fd >= 0) - { - FD_CLR (conn->fs_fd, &_fs_fd_mask); - conn->fs_fd = -1; - } - conn->fs_conn_state = FS_CONN_UNCONNECTED; -} - -static int -_fs_do_setup_connection (FSFpePtr conn) -{ - int ret; - - do - { -#ifdef DEBUG - fprintf (stderr, "fs_do_setup_connection state %d\n", conn->fs_conn_state); -#endif - switch (conn->fs_conn_state) { - case FS_CONN_UNCONNECTED: - ret = _fs_open_server (conn); - if (ret == FSIO_BLOCK) - conn->fs_conn_state = FS_CONN_CONNECTING; - break; - case FS_CONN_CONNECTING: - ret = _fs_check_connect (conn); - break; - case FS_CONN_CONNECTED: - ret = _fs_send_conn_client_prefix (conn); - break; - case FS_CONN_SENT_PREFIX: - ret = _fs_recv_conn_setup (conn); - break; - case FS_CONN_RECV_INIT: - ret = _fs_send_init_packets (conn); - if (conn->has_catalogues) - ret = _fs_send_cat_sync (conn); - break; - case FS_CONN_SENT_CAT: - if (conn->has_catalogues) - ret = _fs_recv_cat_sync (conn); - else - ret = FSIO_READY; - break; - default: - ret = FSIO_READY; - break; - } - switch (ret) { - case FSIO_READY: - if (conn->fs_conn_state < FS_CONN_RUNNING) - conn->fs_conn_state++; - break; - case FSIO_BLOCK: - if (TimeCmp (GetTimeInMillis (), <, conn->blockedConnectTime)) - break; - ret = FSIO_ERROR; - /* fall through... */ - case FSIO_ERROR: - _fs_close_server (conn); - /* - * Try the next alternate - */ - if (conn->alternate < conn->numAlts) - { - conn->alternate++; - ret = FSIO_READY; - } - else - conn->alternate = 0; - break; - } - } while (conn->fs_conn_state != FS_CONN_RUNNING && ret == FSIO_READY); - if (ret == FSIO_READY) - conn->generation = ++generationCount; - return ret; -} - -static int -_fs_wait_connect (FSFpePtr conn) -{ - int ret; - - for (;;) - { - ret = _fs_do_setup_connection (conn); - if (ret != FSIO_BLOCK) - break; - if (conn->fs_conn_state <= FS_CONN_CONNECTING) - ret = _fs_poll_connect (conn->trans_conn, 1000); - else - ret = _fs_wait_for_readable (conn, 1000); - if (ret == FSIO_ERROR) - break; - } - return ret; -} - -/* - * Poll a connection in the process of reconnecting - */ -static void -_fs_check_reconnect (FSFpePtr conn) -{ - int ret; - - ret = _fs_do_setup_connection (conn); - switch (ret) { - case FSIO_READY: - _fs_unmark_block (conn, FS_RECONNECTING|FS_GIVE_UP); - _fs_restart_connection (conn); - break; - case FSIO_BLOCK: - break; - case FSIO_ERROR: - conn->brokenConnectionTime = GetTimeInMillis () + FS_RECONNECT_POLL; - break; - } -} - -/* - * Start the reconnection process - */ -static void -_fs_start_reconnect (FSFpePtr conn) -{ - if (conn->blockState & FS_RECONNECTING) - return; - conn->alternate = 0; - _fs_mark_block (conn, FS_RECONNECTING); - _fs_unmark_block (conn, FS_BROKEN_CONNECTION); - _fs_check_reconnect (conn); -} - - -static FSFpePtr -_fs_init_conn (char *servername) -{ - FSFpePtr conn; - - conn = xalloc (sizeof (FSFpeRec) + strlen (servername) + 1); - if (!conn) - return 0; - memset (conn, '\0', sizeof (FSFpeRec)); - if (!_fs_io_init (conn)) - { - xfree (conn); - return 0; - } - conn->servername = (char *) (conn + 1); - conn->fs_conn_state = FS_CONN_UNCONNECTED; - conn->fs_fd = -1; - strcpy (conn->servername, servername); - return conn; -} - -static void -_fs_free_conn (FSFpePtr conn) -{ - _fs_close_server (conn); - _fs_io_fini (conn); - if (conn->alts) - xfree (conn->alts); - xfree (conn); -} - -/* - * called at server init time - */ - -void -fs_register_fpe_functions(void) -{ - RegisterFPEFunctions(fs_name_check, - fs_init_fpe, - fs_free_fpe, - fs_reset_fpe, - fs_open_font, - fs_close_font, - fs_list_fonts, - fs_start_list_with_info, - fs_next_list_with_info, - fs_wakeup, - fs_client_died, - _fs_load_glyphs, - NULL, - NULL, - NULL); -} - -static int -check_fs_open_font(pointer client, FontPathElementPtr fpe, Mask flags, - char *name, int namelen, - fsBitmapFormat format, fsBitmapFormatMask fmask, - XID id, FontPtr *ppfont, - char **alias, FontPtr non_cachable_font) -{ - if (XpClientIsBitmapClient(client)) - return (fs_open_font(client, fpe, flags, name, namelen, format, - fmask, id, ppfont, alias, non_cachable_font) ); - return BadFontName; -} - -static int -check_fs_list_fonts(pointer client, FontPathElementPtr fpe, - char *pattern, int patlen, int maxnames, - FontNamesPtr newnames) -{ - if (XpClientIsBitmapClient(client)) - return (fs_list_fonts(client, fpe, pattern, patlen, maxnames, - newnames)); - return BadFontName; -} - -static int -check_fs_start_list_with_info(pointer client, FontPathElementPtr fpe, - char *pattern, int len, int maxnames, - pointer *pdata) -{ - if (XpClientIsBitmapClient(client)) - return (fs_start_list_with_info(client, fpe, pattern, len, maxnames, - pdata)); - return BadFontName; -} - -static int -check_fs_next_list_with_info(pointer client, FontPathElementPtr fpe, - char **namep, int *namelenp, - FontInfoPtr *pFontInfo, int *numFonts, - pointer private) -{ - if (XpClientIsBitmapClient(client)) - return (fs_next_list_with_info(client, fpe, namep, namelenp, pFontInfo, - numFonts,private)); - return BadFontName; -} - -void -check_fs_register_fpe_functions(void) -{ - RegisterFPEFunctions(fs_name_check, - fs_init_fpe, - fs_free_fpe, - fs_reset_fpe, - check_fs_open_font, - fs_close_font, - check_fs_list_fonts, - check_fs_start_list_with_info, - check_fs_next_list_with_info, - fs_wakeup, - fs_client_died, - _fs_load_glyphs, - NULL, - NULL, - NULL); -} diff --git a/nx-X11/lib/font/fc/fserve.h b/nx-X11/lib/font/fc/fserve.h deleted file mode 100644 index 3254f40fa..000000000 --- a/nx-X11/lib/font/fc/fserve.h +++ /dev/null @@ -1,96 +0,0 @@ -/* $Xorg: fserve.h,v 1.3 2000/08/17 19:46:36 cpqbld Exp $ */ -/* - * Copyright 1990 Network Computing Devices - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Network Computing Devices not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. Network Computing - * Devices makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - * - * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, - * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE - * OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - * - */ -/* $XFree86: xc/lib/font/fc/fserve.h,v 1.4 2001/01/17 19:43:29 dawes Exp $ */ - -#ifndef _FSERVE_H_ -#define _FSERVE_H_ -/* - * font server data structures - */ - -/* types of block records */ -#define FS_OPEN_FONT 1 -#define FS_LOAD_GLYPHS 2 -#define FS_LIST_FONTS 3 -#define FS_LIST_WITH_INFO 4 - -/* states of OpenFont */ -#define FS_OPEN_REPLY 0 -#define FS_INFO_REPLY 1 -#define FS_EXTENT_REPLY 2 -#define FS_GLYPHS_REPLY 3 -#define FS_DONE_REPLY 4 -#define FS_DEPENDING 5 - -/* status of ListFontsWithInfo */ -#define FS_LFWI_WAITING 0 -#define FS_LFWI_REPLY 1 -#define FS_LFWI_FINISHED 2 - -/* states of connection */ -#define FS_CONN_CLOSED 0 -#define FS_CONN_CONNECTING 1 -#define FS_CONN_READ_HEADER 2 -#define FS_CONN_READ_DATA 3 - -#define AccessDone 0x400 - -typedef struct _fs_font_data *FSFontDataPtr; -typedef struct _fs_blocked_font *FSBlockedFontPtr; -typedef struct _fs_blocked_glyphs *FSBlockedGlyphPtr; -typedef struct _fs_blocked_list *FSBlockedListPtr; -typedef struct _fs_blocked_list_info *FSBlockedListInfoPtr; -typedef struct _fs_block_data *FSBlockDataPtr; -typedef struct _fs_font_table *FSFontTablePtr; -typedef struct _fs_fpe_data *FSFpePtr; - -typedef struct _fs_blocked_bitmaps *FSBlockedBitmapPtr; -typedef struct _fs_blocked_extents *FSBlockedExtentPtr; - -extern void _fs_convert_char_info ( fsXCharInfo *src, xCharInfo *dst ); -extern void _fs_free_props (FontInfoPtr pfi); -extern FontPtr fs_create_font (FontPathElementPtr fpe, - char *name, - int namelen, - fsBitmapFormat format, - fsBitmapFormatMask fmask); - -extern int fs_load_all_glyphs ( FontPtr pfont ); -extern int _fs_load_glyphs ( pointer client, FontPtr pfont, Bool range_flag, - unsigned int nchars, int item_size, - unsigned char *data ); - -/* - * These should be declared elsewhere, but I'm concerned that moving them - * would cause problems building other pieces - */ -extern FontPtr find_old_font (Font id); -extern int set_font_authorizations (char **a, int *len, pointer client); -extern long GetTimeInMillis (void); - - -#endif /* _FSERVE_H_ */ diff --git a/nx-X11/lib/font/fc/fservestr.h b/nx-X11/lib/font/fc/fservestr.h deleted file mode 100644 index 0e4166642..000000000 --- a/nx-X11/lib/font/fc/fservestr.h +++ /dev/null @@ -1,211 +0,0 @@ -/* $Xorg: fservestr.h,v 1.3 2000/08/17 19:46:36 cpqbld Exp $ */ -/* - * Copyright 1990 Network Computing Devices - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Network Computing Devices not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. Network Computing - * Devices makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - * - * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, - * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE - * OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - */ -/* $XFree86: xc/lib/font/fc/fservestr.h,v 3.3 2001/01/17 19:43:29 dawes Exp $ */ - -#ifndef _FSERVESTR_H_ -#define _FSERVESTR_H_ - -#include "fserve.h" -#include "fsio.h" - -/* - * font server data structures - */ -/* - * font server private storage - */ - -typedef struct _fs_glyph { - struct _fs_glyph *next; -} FSGlyphRec, *FSGlyphPtr; - -typedef struct _fs_font { - CharInfoPtr pDefault; - CharInfoPtr encoding; - CharInfoPtr inkMetrics; - FSGlyphPtr glyphs; -} FSFontRec, *FSFontPtr; - -/* FS special data for the font */ -typedef struct _fs_font_data { - long fontid; - int generation; /* FS generation when opened */ - unsigned long glyphs_to_get; /* # glyphs remaining to be gotten */ - - /* Following data needed in case font needs to be reopened. */ - int namelen; - char *name; - fsBitmapFormat format; - fsBitmapFormatMask fmask; -} FSFontDataRec; - -typedef struct fs_clients_depending { - pointer client; - struct fs_clients_depending *next; -} FSClientsDependingRec, *FSClientsDependingPtr; - -/* OpenFont specific data for blocked request */ -typedef struct _fs_blocked_font { - FontPtr pfont; /* must be first for fs_read_glyphs */ - long fontid; - int state; /* how many of the replies have landed */ - int flags; - Bool freeFont; /* free this font on failure */ - CARD16 queryInfoSequence; - CARD16 queryExtentsSequence; - CARD16 queryBitmapsSequence; - fsBitmapFormat format; - FSClientsDependingPtr clients_depending; -} FSBlockedFontRec; - -/* LoadGlyphs data for blocked request */ -typedef struct _fs_blocked_glyphs { - FontPtr pfont; /* must be first for fs_read_glyphs */ - int num_expected_ranges; - fsRange *expected_ranges; - FSClientsDependingPtr clients_depending; -} FSBlockedGlyphRec; - -/* LoadExtents data for blocked request */ -typedef struct _fs_blocked_extents { - FontPtr pfont; - fsRange *expected_ranges; - int nranges; - unsigned long nextents; - fsXCharInfo *extents; -} FSBlockedExtentRec; - -/* LoadBitmaps data for blocked request */ -typedef struct _fs_blocked_bitmaps { - FontPtr pfont; - fsRange *expected_ranges; - int nranges; - unsigned long size; - unsigned long nglyphs; - fsOffset32 *offsets; - pointer gdata; -} FSBlockedBitmapRec; - -/* state for blocked ListFonts */ -typedef struct _fs_blocked_list { - FontNamesPtr names; -} FSBlockedListRec; - -/* state for blocked ListFontsWithInfo */ -typedef struct _fs_blocked_list_info { - int status; - int namelen; - FontInfoRec info; - char name[256]; - int remaining; -} FSBlockedListInfoRec; - -/* state for blocked request */ -typedef struct _fs_block_data { - int type; /* Open Font, LoadGlyphs, ListFonts, - * ListWithInfo */ - pointer client; /* who wants it */ - CARD16 sequenceNumber; /* expected */ - pointer data; /* type specific data */ - int errcode; /* Suspended, et al. */ - struct _fs_block_data *depending; /* clients depending on this one */ - struct _fs_block_data *next; -} FSBlockDataRec; - -/* state for reconnected to dead font server */ -typedef struct _fs_reconnect { - int i; -} FSReconnectRec, *FSReconnectPtr; - - -#if !defined(UNIXCPP) || defined(ANSICPP) -#define fsCat(x,y) x##_##y -#else -#define fsCat(x,y) x/**/_/**/y -#endif - - -/* copy XCharInfo parts of a protocol reply into a xCharInfo */ - -#define fsUnpack_XCharInfo(packet, structure) \ - (structure)->leftSideBearing = fsCat(packet,left); \ - (structure)->rightSideBearing = fsCat(packet,right); \ - (structure)->characterWidth = fsCat(packet,width); \ - (structure)->ascent = fsCat(packet,ascent); \ - (structure)->descent = fsCat(packet,descent); \ - (structure)->attributes = fsCat(packet,attributes) - - -/* copy XFontInfoHeader parts of a protocol reply into a FontInfoRec */ - -#define fsUnpack_XFontInfoHeader(packet, structure) \ - (structure)->allExist = ((packet)->font_header_flags & FontInfoAllCharsExist) != 0; \ - (structure)->drawDirection = \ - ((packet)->font_header_draw_direction == LeftToRightDrawDirection) ? \ - LeftToRight : RightToLeft; \ - (structure)->inkInside = ((packet)->font_header_flags & FontInfoInkInside) != 0; \ - \ - (structure)->firstRow = (packet)->font_hdr_char_range_min_char_high; \ - (structure)->firstCol = (packet)->font_hdr_char_range_min_char_low; \ - (structure)->lastRow = (packet)->font_hdr_char_range_max_char_high; \ - (structure)->lastCol = (packet)->font_hdr_char_range_max_char_low; \ - (structure)->defaultCh = (packet)->font_header_default_char_low \ - + ((packet)->font_header_default_char_high << 8); \ - \ - (structure)->fontDescent = (packet)->font_header_font_descent; \ - (structure)->fontAscent = (packet)->font_header_font_ascent; \ - \ - fsUnpack_XCharInfo((packet)->font_header_min_bounds, &(structure)->minbounds); \ - fsUnpack_XCharInfo((packet)->font_header_min_bounds, &(structure)->ink_minbounds); \ - fsUnpack_XCharInfo((packet)->font_header_max_bounds, &(structure)->maxbounds); \ - fsUnpack_XCharInfo((packet)->font_header_max_bounds, &(structure)->ink_maxbounds) - -extern void _fs_init_fontinfo ( FSFpePtr conn, FontInfoPtr pfi ); -extern int _fs_convert_props ( fsPropInfo *pi, fsPropOffset *po, pointer pd, - FontInfoPtr pfi ); -extern int _fs_convert_lfwi_reply ( FSFpePtr conn, FontInfoPtr pfi, - fsListFontsWithXInfoReply *fsrep, - fsPropInfo *pi, fsPropOffset *po, - pointer pd ); -extern int fs_build_range ( FontPtr pfont, Bool range_flag, - unsigned int count, int item_size, - unsigned char *data, int *nranges, - fsRange **ranges ); -extern void _fs_clean_aborted_loadglyphs ( FontPtr pfont, - int num_expected_ranges, - fsRange *expected_ranges ); -extern int _fs_check_extents ( FontPtr pfont, Mask flags, int nranges, - fsRange *range, FSBlockDataPtr blockrec ); -extern int _fs_check_bitmaps ( FontPtr pfont, fsBitmapFormat format, - Mask flags, int nranges, fsRange *range, - FSBlockDataPtr blockrec ); -extern int _fs_get_glyphs ( FontPtr pFont, unsigned long count, - unsigned char *chars, FontEncoding charEncoding, - unsigned long *glyphCount, CharInfoPtr *glyphs ); -extern void _fs_unload_font ( FontPtr pfont ); -extern void _fs_init_font ( FontPtr pfont ); -extern pointer fs_alloc_glyphs (FontPtr pFont, int size); -#endif /* _FSERVESTR_H_ */ diff --git a/nx-X11/lib/font/fc/fsio.c b/nx-X11/lib/font/fc/fsio.c deleted file mode 100644 index fbfb9dfed..000000000 --- a/nx-X11/lib/font/fc/fsio.c +++ /dev/null @@ -1,516 +0,0 @@ -/* $Xorg: fsio.c,v 1.3 2000/08/17 19:46:36 cpqbld Exp $ */ -/* - * Copyright 1990 Network Computing Devices - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Network Computing Devices not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. Network Computing - * Devices makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - * - * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, - * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE - * OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - */ -/* $XFree86: xc/lib/font/fc/fsio.c,v 3.16tsi Exp $ */ -/* - * font server i/o routines - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#define _WILLWINSOCK_ -#include "X11/Xwindows.h" -#endif - -#define FONT_t -#define TRANS_CLIENT -#include "X11/Xtrans/Xtrans.h" -#include "X11/Xpoll.h" -#include -#include -#include -#include -#include "fservestr.h" - -#include -#include -#include -#if !defined(WIN32) -#ifndef Lynx -#include -#else -#include -#endif -#endif -#include -#ifdef WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK -#undef EINTR -#define EINTR WSAEINTR -#endif - -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -#endif - - -static int padlength[4] = {0, 3, 2, 1}; -fd_set _fs_fd_mask; - -static int -_fs_resize (FSBufPtr buf, long size); - -static void -_fs_downsize (FSBufPtr buf, long size); - -int -_fs_poll_connect (XtransConnInfo trans_conn, int timeout) -{ - fd_set w_mask; - struct timeval tv; - int fs_fd = _FontTransGetConnectionNumber (trans_conn); - int ret; - - do - { - tv.tv_usec = 0; - tv.tv_sec = timeout; - FD_ZERO (&w_mask); - FD_SET (fs_fd, &w_mask); - ret = Select (fs_fd + 1, NULL, &w_mask, NULL, &tv); - } while (ret < 0 && ECHECK(EINTR)); - if (ret == 0) - return FSIO_BLOCK; - if (ret < 0) - return FSIO_ERROR; - return FSIO_READY; -} - -XtransConnInfo -_fs_connect(char *servername, int *err) -{ - XtransConnInfo trans_conn; /* transport connection object */ - int ret; - int i = 0; - int retries = 5; - - /* - * Open the network connection. - */ - if( (trans_conn=_FontTransOpenCOTSClient(servername)) == NULL ) - { - *err = FSIO_ERROR; - return 0; - } - - /* - * Set the connection non-blocking since we use select() to block. - */ - - _FontTransSetOption(trans_conn, TRANS_NONBLOCKING, 1); - - do { - if (i == TRANS_TRY_CONNECT_AGAIN) - sleep(1); - i = _FontTransConnect(trans_conn,servername); - } while ((i == TRANS_TRY_CONNECT_AGAIN) && (retries-- > 0)); - - if (i < 0) - { - if (i == TRANS_IN_PROGRESS) - ret = FSIO_BLOCK; - else - ret = FSIO_ERROR; - } - else - ret = FSIO_READY; - - if (ret == FSIO_ERROR) - { - _FontTransClose(trans_conn); - trans_conn = 0; - } - - *err = ret; - return trans_conn; -} - -int -_fs_fill (FSFpePtr conn) -{ - long avail; - long bytes_read; - Bool waited = FALSE; - - if (_fs_flush (conn) < 0) - return FSIO_ERROR; - /* - * Don't go overboard here; stop reading when we've - * got enough to satisfy the pending request - */ - while ((conn->inNeed - (conn->inBuf.insert - conn->inBuf.remove)) > 0) - { - avail = conn->inBuf.size - conn->inBuf.insert; - /* - * For SVR4 with a unix-domain connection, ETEST() after selecting - * readable means the server has died. To do this here, we look for - * two consecutive reads returning ETEST(). - */ - ESET (0); - bytes_read =_FontTransRead(conn->trans_conn, - conn->inBuf.buf + conn->inBuf.insert, - avail); - if (bytes_read > 0) { - conn->inBuf.insert += bytes_read; - waited = FALSE; - } - else - { - if (bytes_read == 0 || ETEST ()) - { - if (!waited) - { - waited = TRUE; - if (_fs_wait_for_readable (conn, 0) == FSIO_BLOCK) - return FSIO_BLOCK; - continue; - } - } - _fs_connection_died (conn); - return FSIO_ERROR; - } - } - return FSIO_READY; -} - -/* - * Make space and return whether data have already arrived - */ - -int -_fs_start_read (FSFpePtr conn, long size, char **buf) -{ - int ret; - - conn->inNeed = size; - if (fs_inqueued(conn) < size) - { - if (_fs_resize (&conn->inBuf, size) != FSIO_READY) - { - _fs_connection_died (conn); - return FSIO_ERROR; - } - ret = _fs_fill (conn); - if (ret == FSIO_ERROR) - return ret; - if (ret == FSIO_BLOCK || fs_inqueued(conn) < size) - return FSIO_BLOCK; - } - if (buf) - *buf = conn->inBuf.buf + conn->inBuf.remove; - return FSIO_READY; -} - -void -_fs_done_read (FSFpePtr conn, long size) -{ - if (conn->inBuf.insert - conn->inBuf.remove < size) - { -#ifdef DEBUG - fprintf (stderr, "_fs_done_read skipping to many bytes\n"); -#endif - return; - } - conn->inBuf.remove += size; - conn->inNeed -= size; - _fs_downsize (&conn->inBuf, FS_BUF_MAX); -} - -long -_fs_pad_length (long len) -{ - return len + padlength[len&3]; -} - -int -_fs_flush (FSFpePtr conn) -{ - long bytes_written; - long remain; - - /* XXX - hack. The right fix is to remember that the font server - has gone away when we first discovered it. */ - if (conn->fs_fd < 0) - return FSIO_ERROR; - - while ((remain = conn->outBuf.insert - conn->outBuf.remove) > 0) - { - bytes_written = _FontTransWrite(conn->trans_conn, - conn->outBuf.buf + conn->outBuf.remove, - (int) remain); - if (bytes_written > 0) - { - conn->outBuf.remove += bytes_written; - } - else - { - if (bytes_written == 0 || ETEST ()) - { - conn->brokenWriteTime = GetTimeInMillis () + FS_FLUSH_POLL; - _fs_mark_block (conn, FS_BROKEN_WRITE); - break; - } - if (!ECHECK (EINTR)) - { - _fs_connection_died (conn); - return FSIO_ERROR; - } - } - } - if (conn->outBuf.remove == conn->outBuf.insert) - { - _fs_unmark_block (conn, FS_BROKEN_WRITE|FS_PENDING_WRITE); - if (conn->outBuf.size > FS_BUF_INC) - conn->outBuf.buf = xrealloc (conn->outBuf.buf, FS_BUF_INC); - conn->outBuf.remove = conn->outBuf.insert = 0; - } - return FSIO_READY; -} - -static int -_fs_resize (FSBufPtr buf, long size) -{ - char *new; - long new_size; - - if (buf->remove) - { - if (buf->remove != buf->insert) - { - memmove (buf->buf, - buf->buf + buf->remove, - buf->insert - buf->remove); - } - buf->insert -= buf->remove; - buf->remove = 0; - } - if (buf->size - buf->remove < size) - { - new_size = ((buf->remove + size + FS_BUF_INC) / FS_BUF_INC) * FS_BUF_INC; - new = xrealloc (buf->buf, new_size); - if (!new) - return FSIO_ERROR; - buf->buf = new; - buf->size = new_size; - } - return FSIO_READY; -} - -static void -_fs_downsize (FSBufPtr buf, long size) -{ - if (buf->insert == buf->remove) - { - buf->insert = buf->remove = 0; - if (buf->size > size) - { - buf->buf = xrealloc (buf->buf, size); - buf->size = size; - } - } -} - -void -_fs_io_reinit (FSFpePtr conn) -{ - conn->outBuf.insert = conn->outBuf.remove = 0; - _fs_downsize (&conn->outBuf, FS_BUF_INC); - conn->inBuf.insert = conn->inBuf.remove = 0; - _fs_downsize (&conn->inBuf, FS_BUF_MAX); -} - -Bool -_fs_io_init (FSFpePtr conn) -{ - conn->outBuf.insert = conn->outBuf.remove = 0; - conn->outBuf.buf = xalloc (FS_BUF_INC); - if (!conn->outBuf.buf) - return FALSE; - conn->outBuf.size = FS_BUF_INC; - - conn->inBuf.insert = conn->inBuf.remove = 0; - conn->inBuf.buf = xalloc (FS_BUF_INC); - if (!conn->inBuf.buf) - { - xfree (conn->outBuf.buf); - conn->outBuf.buf = 0; - return FALSE; - } - conn->inBuf.size = FS_BUF_INC; - - return TRUE; -} - -void -_fs_io_fini (FSFpePtr conn) -{ - if (conn->outBuf.buf) - xfree (conn->outBuf.buf); - if (conn->inBuf.buf) - xfree (conn->inBuf.buf); -} - -static int -_fs_do_write(FSFpePtr conn, char *data, long len, long size) -{ - if (size == 0) { -#ifdef DEBUG - fprintf(stderr, "tried to write 0 bytes \n"); -#endif - return FSIO_READY; - } - - if (conn->fs_fd == -1) - return FSIO_ERROR; - - while (conn->outBuf.insert + size > conn->outBuf.size) - { - if (_fs_flush (conn) < 0) - return FSIO_ERROR; - if (_fs_resize (&conn->outBuf, size) < 0) - { - _fs_connection_died (conn); - return FSIO_ERROR; - } - } - memcpy (conn->outBuf.buf + conn->outBuf.insert, data, len); - conn->outBuf.insert += size; - _fs_mark_block (conn, FS_PENDING_WRITE); - return FSIO_READY; -} - -/* - * Write the indicated bytes - */ -int -_fs_write (FSFpePtr conn, char *data, long len) -{ - return _fs_do_write (conn, data, len, len); -} - -/* - * Write the indicated bytes adding any appropriate pad - */ -int -_fs_write_pad(FSFpePtr conn, char *data, long len) -{ - return _fs_do_write (conn, data, len, len + padlength[len & 3]); -} - -/* - * returns the amount of data waiting to be read - */ -int -_fs_data_ready(FSFpePtr conn) -{ - BytesReadable_t readable; - - if (_FontTransBytesReadable(conn->trans_conn, &readable) < 0) - return -1; - return readable; -} - -int -_fs_wait_for_readable(FSFpePtr conn, int ms) -{ - fd_set r_mask; - fd_set e_mask; - int result; - struct timeval tv; - - for (;;) { - if (conn->fs_fd < 0) - return FSIO_ERROR; - FD_ZERO(&r_mask); - FD_ZERO(&e_mask); - tv.tv_sec = ms / 1000; - tv.tv_usec = (ms % 1000) * 1000; - FD_SET(conn->fs_fd, &r_mask); - FD_SET(conn->fs_fd, &e_mask); - result = Select(conn->fs_fd + 1, &r_mask, NULL, &e_mask, &tv); - if (result < 0) - { - if (ECHECK(EINTR) || ECHECK(EAGAIN)) - continue; - else - return FSIO_ERROR; - } - if (result == 0) - return FSIO_BLOCK; - if (FD_ISSET(conn->fs_fd, &r_mask)) - return FSIO_READY; - return FSIO_ERROR; - } -} - -int -_fs_set_bit(fd_set *mask, int fd) -{ - FD_SET(fd, mask); - return fd; -} - -int -_fs_is_bit_set(fd_set *mask, int fd) -{ - return FD_ISSET(fd, mask); -} - -void -_fs_bit_clear(fd_set *mask, int fd) -{ - FD_CLR(fd, mask); -} - -int -_fs_any_bit_set(fd_set *mask) -{ - return XFD_ANYSET(mask); -} - -void -_fs_or_bits(fd_set *dst, fd_set *m1, fd_set *m2) -{ -#ifdef WIN32 - int i; - if (dst != m1) { - for (i = m1->fd_count; --i >= 0; ) { - if (!FD_ISSET(m1->fd_array[i], dst)) - FD_SET(m1->fd_array[i], dst); - } - } - if (dst != m2) { - for (i = m2->fd_count; --i >= 0; ) { - if (!FD_ISSET(m2->fd_array[i], dst)) - FD_SET(m2->fd_array[i], dst); - } - } -#else - XFD_ORSET(dst, m1, m2); -#endif -} diff --git a/nx-X11/lib/font/fc/fsio.h b/nx-X11/lib/font/fc/fsio.h deleted file mode 100644 index 224143601..000000000 --- a/nx-X11/lib/font/fc/fsio.h +++ /dev/null @@ -1,187 +0,0 @@ -/* $Xorg: fsio.h,v 1.3 2000/08/17 19:46:36 cpqbld Exp $ */ -/* - * Copyright 1990 Network Computing Devices - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Network Computing Devices not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. Network Computing - * Devices makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - * - * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, - * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE - * OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - */ -/* $XFree86: xc/lib/font/fc/fsio.h,v 1.5 1999/12/30 02:39:06 robin Exp $ */ - -#ifndef _FSIO_H_ -#define _FSIO_H_ - -#undef DEBUG -#define REQUEST_LOG_SIZE 100 - -typedef struct _fs_fpe_alternate { - char *name; - Bool subset; -} FSFpeAltRec, *FSFpeAltPtr; - - -/* Per client access contexts */ -typedef struct _fs_client_data { - pointer client; - struct _fs_client_data *next; - XID acid; - int auth_generation; -} FSClientRec, *FSClientPtr; - -#define FS_RECONNECT_POLL 1000 -#define FS_RECONNECT_WAIT 5000 -#define FS_GIVEUP_WAIT 20000 -#define FS_REQUEST_TIMEOUT 20000 -#define FS_OPEN_TIMEOUT 30000 -#define FS_REOPEN_TIMEOUT 10000 -#define FS_FLUSH_POLL 1000 - -typedef struct _fs_buf { - char *buf; /* data */ - long size; /* sizeof data */ - long insert; /* where to insert new data */ - long remove; /* where to remove old data */ -} FSBufRec, *FSBufPtr; - -#define FS_BUF_INC 1024 -#define FS_BUF_MAX 32768 - -#define FS_PENDING_WRITE 0x01 /* some write data is queued */ -#define FS_BROKEN_WRITE 0x02 /* writes are broken */ -#define FS_BROKEN_CONNECTION 0x04 /* connection is broken */ -#define FS_PENDING_REPLY 0x08 /* waiting for a reply */ -#define FS_GIVE_UP 0x10 /* font server declared useless */ -#define FS_COMPLETE_REPLY 0x20 /* complete reply ready */ -#define FS_RECONNECTING 0x40 - -#define FS_CONN_UNCONNECTED 0 -#define FS_CONN_CONNECTING 1 -#define FS_CONN_CONNECTED 2 -#define FS_CONN_SENT_PREFIX 3 -#define FS_CONN_RECV_INIT 4 -#define FS_CONN_SENT_CAT 5 -#define FS_CONN_RUNNING 6 - -/* FS specific font FontPathElement data */ -typedef struct _fs_fpe_data { - FSFpePtr next; /* list of all active fs fpes */ - int fs_fd; /* < 0 when not running */ - int fs_conn_state; /* connection state */ - int current_seq; - char *servername; - Bool has_catalogues; - - int generation; - int numAlts; - int alternate; /* which alternate is in use +1 */ - int fsMajorVersion; /* font server major version number */ - FSFpeAltPtr alts; - - FSClientPtr clients; - XID curacid; -#ifdef DEBUG - int reqindex; - struct { - int opcode; - int sequence; - } reqbuffer[REQUEST_LOG_SIZE]; -#endif - FSBufRec outBuf; /* request queue */ - FSBufRec inBuf; /* reply queue */ - long inNeed; /* amount needed for reply */ - - CARD32 blockState; - CARD32 blockedReplyTime; /* time to abort blocked read */ - CARD32 brokenWriteTime; /* time to retry broken write */ - CARD32 blockedConnectTime; /* time to abort blocked connect */ - CARD32 brokenConnectionTime; /* time to retry broken connection */ - - FSBlockDataPtr blockedRequests; - - struct _XtransConnInfo *trans_conn; /* transport connection object */ -} FSFpeRec; - -#define fs_outspace(conn) ((conn)->outBuf.size - (conn)->outBuf.insert) -#define fs_outqueued(conn) ((conn)->outBuf.insert - (conn)->outBuf.remove) -#define fs_inqueued(conn) ((conn)->inBuf.insert - (conn)->inBuf.remove) -#define fs_needsflush(conn) (fs_outqueued(conn) != 0) -#define fs_needsfill(conn) (fs_inqueued(conn) < (conn)->inNeed) -#define fs_needsconnect(conn) ((conn)->fs_fd < 0) -#define fs_data_read(conn) ((conn)->inBuf.insert - (conn)->inBuf.remove) - -#define FSIO_READY 1 -#define FSIO_BLOCK 0 -#define FSIO_ERROR -1 - -extern Bool _fs_reopen_server ( FSFpePtr conn ); -extern int _fs_write ( FSFpePtr conn, char *data, long size ); -extern int _fs_write_pad ( FSFpePtr conn, char *data, long len ); -extern int _fs_data_ready ( FSFpePtr conn ); -extern int _fs_wait_for_readable ( FSFpePtr conn, int ms ); -extern int _fs_set_bit ( fd_set * mask, int fd ); -extern int _fs_is_bit_set ( fd_set * mask, int fd ); -extern void _fs_bit_clear ( fd_set * mask, int fd ); -extern int _fs_any_bit_set ( fd_set * mask ); -extern void _fs_or_bits ( fd_set * dst, fd_set * m1, fd_set * m2 ); -extern long _fs_pad_length (long len); - -extern void _fs_connection_died ( FSFpePtr conn ); - -extern int _fs_fill (FSFpePtr conn); -extern int _fs_flush (FSFpePtr conn); -extern void _fs_mark_block (FSFpePtr conn, CARD32 mask); -extern void _fs_unmark_block (FSFpePtr conn, CARD32 mask); -extern void _fs_done_read (FSFpePtr conn, long size); -extern void _fs_io_reinit (FSFpePtr conn); -extern int _fs_start_read (FSFpePtr conn, long size, char **buf); -extern Bool _fs_io_init (FSFpePtr conn); -extern void _fs_io_fini (FSFpePtr conn); -extern int _fs_poll_connect (XtransConnInfo trans_conn, int timeout); -extern XtransConnInfo _fs_connect(char *servername, int *ret); - -/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX - * systems are broken and return EWOULDBLOCK when they should return EAGAIN - */ -#ifdef WIN32 -#define ETEST() (WSAGetLastError() == WSAEWOULDBLOCK) -#else -#if defined(EAGAIN) && defined(EWOULDBLOCK) -#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK) -#else -#ifdef EAGAIN -#define ETEST() (errno == EAGAIN) -#else -#define ETEST() (errno == EWOULDBLOCK) -#endif -#endif -#endif -#ifdef WIN32 -#define ECHECK(err) (WSAGetLastError() == err) -#define ESET(val) WSASetLastError(val) -#else -#ifdef ISC -#define ECHECK(err) ((errno == err) || ETEST()) -#else -#define ECHECK(err) (errno == err) -#endif -#define ESET(val) errno = val -#endif - -#endif /* _FSIO_H_ */ diff --git a/nx-X11/lib/font/fc/fsio.h.NX.reference b/nx-X11/lib/font/fc/fsio.h.NX.reference deleted file mode 100644 index f79a17b90..000000000 --- a/nx-X11/lib/font/fc/fsio.h.NX.reference +++ /dev/null @@ -1,191 +0,0 @@ -/* $Xorg: fsio.h,v 1.3 2000/08/17 19:46:36 cpqbld Exp $ */ -/* - * Copyright 1990 Network Computing Devices - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Network Computing Devices not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. Network Computing - * Devices makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - * - * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, - * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE - * OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - */ -/* $XFree86: xc/lib/font/fc/fsio.h,v 1.6 2001/01/17 19:43:29 dawes Exp $ */ - -#ifndef _FSIO_H_ -#define _FSIO_H_ - -#undef DEBUG -#define REQUEST_LOG_SIZE 100 - -typedef struct _fs_fpe_alternate { - char *name; - Bool subset; -} FSFpeAltRec, *FSFpeAltPtr; - - -/* Per client access contexts */ -typedef struct _fs_client_data { - pointer client; - struct _fs_client_data *next; - XID acid; - int auth_generation; -} FSClientRec, *FSClientPtr; - -#define FS_RECONNECT_POLL 1000 -#ifdef __CYGWIN__ -#define FS_RECONNECT_WAIT 800 -#else -#define FS_RECONNECT_WAIT 5000 -#endif -#define FS_GIVEUP_WAIT 20000 -#define FS_REQUEST_TIMEOUT 20000 -#define FS_OPEN_TIMEOUT 30000 -#define FS_REOPEN_TIMEOUT 10000 -#define FS_FLUSH_POLL 1000 - -typedef struct _fs_buf { - char *buf; /* data */ - long size; /* sizeof data */ - long insert; /* where to insert new data */ - long remove; /* where to remove old data */ -} FSBufRec, *FSBufPtr; - -#define FS_BUF_INC 1024 -#define FS_BUF_MAX 32768 - -#define FS_PENDING_WRITE 0x01 /* some write data is queued */ -#define FS_BROKEN_WRITE 0x02 /* writes are broken */ -#define FS_BROKEN_CONNECTION 0x04 /* connection is broken */ -#define FS_PENDING_REPLY 0x08 /* waiting for a reply */ -#define FS_GIVE_UP 0x10 /* font server declared useless */ -#define FS_COMPLETE_REPLY 0x20 /* complete reply ready */ -#define FS_RECONNECTING 0x40 - -#define FS_CONN_UNCONNECTED 0 -#define FS_CONN_CONNECTING 1 -#define FS_CONN_CONNECTED 2 -#define FS_CONN_SENT_PREFIX 3 -#define FS_CONN_RECV_INIT 4 -#define FS_CONN_SENT_CAT 5 -#define FS_CONN_RUNNING 6 - -/* FS specific font FontPathElement data */ -typedef struct _fs_fpe_data { - FSFpePtr next; /* list of all active fs fpes */ - int fs_fd; /* < 0 when not running */ - int fs_conn_state; /* connection state */ - int current_seq; - char *servername; - Bool has_catalogues; - - int generation; - int numAlts; - int alternate; /* which alternate is in use +1 */ - int fsMajorVersion; /* font server major version number */ - FSFpeAltPtr alts; - - FSClientPtr clients; - XID curacid; -#ifdef DEBUG - int reqindex; - struct { - int opcode; - int sequence; - } reqbuffer[REQUEST_LOG_SIZE]; -#endif - FSBufRec outBuf; /* request queue */ - FSBufRec inBuf; /* reply queue */ - long inNeed; /* amount needed for reply */ - - CARD32 blockState; - CARD32 blockedReplyTime; /* time to abort blocked read */ - CARD32 brokenWriteTime; /* time to retry broken write */ - CARD32 blockedConnectTime; /* time to abort blocked connect */ - CARD32 brokenConnectionTime; /* time to retry broken connection */ - - FSBlockDataPtr blockedRequests; - - struct _XtransConnInfo *trans_conn; /* transport connection object */ -} FSFpeRec; - -#define fs_outspace(conn) ((conn)->outBuf.size - (conn)->outBuf.insert) -#define fs_outqueued(conn) ((conn)->outBuf.insert - (conn)->outBuf.remove) -#define fs_inqueued(conn) ((conn)->inBuf.insert - (conn)->inBuf.remove) -#define fs_needsflush(conn) (fs_outqueued(conn) != 0) -#define fs_needsfill(conn) (fs_inqueued(conn) < (conn)->inNeed) -#define fs_needsconnect(conn) ((conn)->fs_fd < 0) -#define fs_data_read(conn) ((conn)->inBuf.insert - (conn)->inBuf.remove) - -#define FSIO_READY 1 -#define FSIO_BLOCK 0 -#define FSIO_ERROR -1 - -extern Bool _fs_reopen_server ( FSFpePtr conn ); -extern int _fs_write ( FSFpePtr conn, char *data, long size ); -extern int _fs_write_pad ( FSFpePtr conn, char *data, long len ); -extern int _fs_data_ready ( FSFpePtr conn ); -extern int _fs_wait_for_readable ( FSFpePtr conn, int ms ); -extern int _fs_set_bit ( fd_set * mask, int fd ); -extern int _fs_is_bit_set ( fd_set * mask, int fd ); -extern void _fs_bit_clear ( fd_set * mask, int fd ); -extern int _fs_any_bit_set ( fd_set * mask ); -extern void _fs_or_bits ( fd_set * dst, fd_set * m1, fd_set * m2 ); -extern long _fs_pad_length (long len); - -extern void _fs_connection_died ( FSFpePtr conn ); - -extern int _fs_fill (FSFpePtr conn); -extern int _fs_flush (FSFpePtr conn); -extern void _fs_mark_block (FSFpePtr conn, CARD32 mask); -extern void _fs_unmark_block (FSFpePtr conn, CARD32 mask); -extern void _fs_done_read (FSFpePtr conn, long size); -extern void _fs_io_reinit (FSFpePtr conn); -extern int _fs_start_read (FSFpePtr conn, long size, char **buf); -extern Bool _fs_io_init (FSFpePtr conn); -extern void _fs_io_fini (FSFpePtr conn); -extern int _fs_poll_connect (XtransConnInfo trans_conn, int timeout); -extern XtransConnInfo _fs_connect(char *servername, int *ret); - -/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX - * systems are broken and return EWOULDBLOCK when they should return EAGAIN - */ -#ifdef WIN32 -#define ETEST() (WSAGetLastError() == WSAEWOULDBLOCK) -#else -#if defined(EAGAIN) && defined(EWOULDBLOCK) -#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK) -#else -#ifdef EAGAIN -#define ETEST() (errno == EAGAIN) -#else -#define ETEST() (errno == EWOULDBLOCK) -#endif -#endif -#endif -#ifdef WIN32 -#define ECHECK(err) (WSAGetLastError() == err) -#define ESET(val) WSASetLastError(val) -#else -#ifdef ISC -#define ECHECK(err) ((errno == err) || ETEST()) -#else -#define ECHECK(err) (errno == err) -#endif -#define ESET(val) errno = val -#endif - -#endif /* _FSIO_H_ */ diff --git a/nx-X11/lib/font/fc/fsio.h.XF86.reference b/nx-X11/lib/font/fc/fsio.h.XF86.reference deleted file mode 100644 index 974ef4a91..000000000 --- a/nx-X11/lib/font/fc/fsio.h.XF86.reference +++ /dev/null @@ -1,187 +0,0 @@ -/* $Xorg: fsio.h,v 1.3 2000/08/17 19:46:36 cpqbld Exp $ */ -/* - * Copyright 1990 Network Computing Devices - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Network Computing Devices not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. Network Computing - * Devices makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - * - * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, - * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE - * OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Dave Lemke, Network Computing Devices, Inc - */ -/* $XFree86: xc/lib/font/fc/fsio.h,v 1.6 2001/01/17 19:43:29 dawes Exp $ */ - -#ifndef _FSIO_H_ -#define _FSIO_H_ - -#undef DEBUG -#define REQUEST_LOG_SIZE 100 - -typedef struct _fs_fpe_alternate { - char *name; - Bool subset; -} FSFpeAltRec, *FSFpeAltPtr; - - -/* Per client access contexts */ -typedef struct _fs_client_data { - pointer client; - struct _fs_client_data *next; - XID acid; - int auth_generation; -} FSClientRec, *FSClientPtr; - -#define FS_RECONNECT_POLL 1000 -#define FS_RECONNECT_WAIT 5000 -#define FS_GIVEUP_WAIT 20000 -#define FS_REQUEST_TIMEOUT 20000 -#define FS_OPEN_TIMEOUT 30000 -#define FS_REOPEN_TIMEOUT 10000 -#define FS_FLUSH_POLL 1000 - -typedef struct _fs_buf { - char *buf; /* data */ - long size; /* sizeof data */ - long insert; /* where to insert new data */ - long remove; /* where to remove old data */ -} FSBufRec, *FSBufPtr; - -#define FS_BUF_INC 1024 -#define FS_BUF_MAX 32768 - -#define FS_PENDING_WRITE 0x01 /* some write data is queued */ -#define FS_BROKEN_WRITE 0x02 /* writes are broken */ -#define FS_BROKEN_CONNECTION 0x04 /* connection is broken */ -#define FS_PENDING_REPLY 0x08 /* waiting for a reply */ -#define FS_GIVE_UP 0x10 /* font server declared useless */ -#define FS_COMPLETE_REPLY 0x20 /* complete reply ready */ -#define FS_RECONNECTING 0x40 - -#define FS_CONN_UNCONNECTED 0 -#define FS_CONN_CONNECTING 1 -#define FS_CONN_CONNECTED 2 -#define FS_CONN_SENT_PREFIX 3 -#define FS_CONN_RECV_INIT 4 -#define FS_CONN_SENT_CAT 5 -#define FS_CONN_RUNNING 6 - -/* FS specific font FontPathElement data */ -typedef struct _fs_fpe_data { - FSFpePtr next; /* list of all active fs fpes */ - int fs_fd; /* < 0 when not running */ - int fs_conn_state; /* connection state */ - int current_seq; - char *servername; - Bool has_catalogues; - - int generation; - int numAlts; - int alternate; /* which alternate is in use +1 */ - int fsMajorVersion; /* font server major version number */ - FSFpeAltPtr alts; - - FSClientPtr clients; - XID curacid; -#ifdef DEBUG - int reqindex; - struct { - int opcode; - int sequence; - } reqbuffer[REQUEST_LOG_SIZE]; -#endif - FSBufRec outBuf; /* request queue */ - FSBufRec inBuf; /* reply queue */ - long inNeed; /* amount needed for reply */ - - CARD32 blockState; - CARD32 blockedReplyTime; /* time to abort blocked read */ - CARD32 brokenWriteTime; /* time to retry broken write */ - CARD32 blockedConnectTime; /* time to abort blocked connect */ - CARD32 brokenConnectionTime; /* time to retry broken connection */ - - FSBlockDataPtr blockedRequests; - - struct _XtransConnInfo *trans_conn; /* transport connection object */ -} FSFpeRec; - -#define fs_outspace(conn) ((conn)->outBuf.size - (conn)->outBuf.insert) -#define fs_outqueued(conn) ((conn)->outBuf.insert - (conn)->outBuf.remove) -#define fs_inqueued(conn) ((conn)->inBuf.insert - (conn)->inBuf.remove) -#define fs_needsflush(conn) (fs_outqueued(conn) != 0) -#define fs_needsfill(conn) (fs_inqueued(conn) < (conn)->inNeed) -#define fs_needsconnect(conn) ((conn)->fs_fd < 0) -#define fs_data_read(conn) ((conn)->inBuf.insert - (conn)->inBuf.remove) - -#define FSIO_READY 1 -#define FSIO_BLOCK 0 -#define FSIO_ERROR -1 - -extern Bool _fs_reopen_server ( FSFpePtr conn ); -extern int _fs_write ( FSFpePtr conn, char *data, long size ); -extern int _fs_write_pad ( FSFpePtr conn, char *data, long len ); -extern int _fs_data_ready ( FSFpePtr conn ); -extern int _fs_wait_for_readable ( FSFpePtr conn, int ms ); -extern int _fs_set_bit ( fd_set * mask, int fd ); -extern int _fs_is_bit_set ( fd_set * mask, int fd ); -extern void _fs_bit_clear ( fd_set * mask, int fd ); -extern int _fs_any_bit_set ( fd_set * mask ); -extern void _fs_or_bits ( fd_set * dst, fd_set * m1, fd_set * m2 ); -extern long _fs_pad_length (long len); - -extern void _fs_connection_died ( FSFpePtr conn ); - -extern int _fs_fill (FSFpePtr conn); -extern int _fs_flush (FSFpePtr conn); -extern void _fs_mark_block (FSFpePtr conn, CARD32 mask); -extern void _fs_unmark_block (FSFpePtr conn, CARD32 mask); -extern void _fs_done_read (FSFpePtr conn, long size); -extern void _fs_io_reinit (FSFpePtr conn); -extern int _fs_start_read (FSFpePtr conn, long size, char **buf); -extern Bool _fs_io_init (FSFpePtr conn); -extern void _fs_io_fini (FSFpePtr conn); -extern int _fs_poll_connect (XtransConnInfo trans_conn, int timeout); -extern XtransConnInfo _fs_connect(char *servername, int *ret); - -/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX - * systems are broken and return EWOULDBLOCK when they should return EAGAIN - */ -#ifdef WIN32 -#define ETEST() (WSAGetLastError() == WSAEWOULDBLOCK) -#else -#if defined(EAGAIN) && defined(EWOULDBLOCK) -#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK) -#else -#ifdef EAGAIN -#define ETEST() (errno == EAGAIN) -#else -#define ETEST() (errno == EWOULDBLOCK) -#endif -#endif -#endif -#ifdef WIN32 -#define ECHECK(err) (WSAGetLastError() == err) -#define ESET(val) WSASetLastError(val) -#else -#ifdef ISC -#define ECHECK(err) ((errno == err) || ETEST()) -#else -#define ECHECK(err) (errno == err) -#endif -#define ESET(val) errno = val -#endif - -#endif /* _FSIO_H_ */ diff --git a/nx-X11/lib/font/fc/fslibos.h b/nx-X11/lib/font/fc/fslibos.h deleted file mode 100644 index dd266bdc4..000000000 --- a/nx-X11/lib/font/fc/fslibos.h +++ /dev/null @@ -1,216 +0,0 @@ -/* $Xorg: fslibos.h,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ -/* - * Copyright 1990 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - */ - -/* - -Copyright 1987, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fc/fslibos.h,v 3.8 2003/08/29 18:01:14 herrb Exp $ */ - -/* - * FSlib networking & os include file - */ - -#include - -#ifndef WIN32 - -/* - * makedepend screws up on #undef OPEN_MAX, so we define a new symbol - */ - -#ifndef FONT_OPEN_MAX - -#ifndef X_NOT_POSIX -# ifdef _POSIX_SOURCE -# include -# else -# define _POSIX_SOURCE -# include -# undef _POSIX_SOURCE -# endif -#endif -#ifndef SIZE_MAX -# ifdef ULONG_MAX -# define SIZE_MAX ULONG_MAX -# else -# define SIZE_MAX UINT_MAX -# endif -#endif -#ifndef OPEN_MAX -#if defined(SVR4) || defined(__UNIXOS2__) -#define OPEN_MAX 256 -#else -#include -#ifndef OPEN_MAX -#ifdef __OSF1__ -#define OPEN_MAX 256 -#else -#ifdef NOFILE -#define OPEN_MAX NOFILE -#else -#define OPEN_MAX NOFILES_MAX -#endif -#endif -#endif -#endif -#endif - -#if OPEN_MAX > 256 -#define FONT_OPEN_MAX 256 -#else -#define FONT_OPEN_MAX OPEN_MAX -#endif - -#endif /* FONT_OPEN_MAX */ - -#define NMSKBITS 32 - -#define MSKCNT ((FONT_OPEN_MAX + NMSKBITS - 1) / NMSKBITS) - -typedef unsigned long FdSet[MSKCNT]; -typedef FdSet FdSetPtr; - -#if (MSKCNT==1) -#define BITMASK(i) (1 << (i)) -#define MASKIDX(i) 0 -#endif - -#if (MSKCNT>1) -#define BITMASK(i) (1 << ((i) & (NMSKBITS - 1))) -#define MASKIDX(i) ((i) / NMSKBITS) -#endif - -#define MASKWORD(buf, i) buf[MASKIDX(i)] -#define BITSET(buf, i) MASKWORD(buf, i) |= BITMASK(i) -#define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i) -#define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i)) - -#if (MSKCNT==1) -#define COPYBITS(src, dst) dst[0] = src[0] -#define CLEARBITS(buf) buf[0] = 0 -#define MASKANDSETBITS(dst, b1, b2) dst[0] = (b1[0] & b2[0]) -#define ORBITS(dst, b1, b2) dst[0] = (b1[0] | b2[0]) -#define UNSETBITS(dst, b1) (dst[0] &= ~b1[0]) -#define ANYSET(src) (src[0]) -#endif - -#if (MSKCNT==2) -#define COPYBITS(src, dst) { dst[0] = src[0]; dst[1] = src[1]; } -#define CLEARBITS(buf) { buf[0] = 0; buf[1] = 0; } -#define MASKANDSETBITS(dst, b1, b2) {\ - dst[0] = (b1[0] & b2[0]);\ - dst[1] = (b1[1] & b2[1]); } -#define ORBITS(dst, b1, b2) {\ - dst[0] = (b1[0] | b2[0]);\ - dst[1] = (b1[1] | b2[1]); } -#define UNSETBITS(dst, b1) {\ - dst[0] &= ~b1[0]; \ - dst[1] &= ~b1[1]; } -#define ANYSET(src) (src[0] || src[1]) -#endif - -#if (MSKCNT==3) -#define COPYBITS(src, dst) { dst[0] = src[0]; dst[1] = src[1]; \ - dst[2] = src[2]; } -#define CLEARBITS(buf) { buf[0] = 0; buf[1] = 0; buf[2] = 0; } -#define MASKANDSETBITS(dst, b1, b2) {\ - dst[0] = (b1[0] & b2[0]);\ - dst[1] = (b1[1] & b2[1]);\ - dst[2] = (b1[2] & b2[2]); } -#define ORBITS(dst, b1, b2) {\ - dst[0] = (b1[0] | b2[0]);\ - dst[1] = (b1[1] | b2[1]);\ - dst[2] = (b1[2] | b2[2]); } -#define UNSETBITS(dst, b1) {\ - dst[0] &= ~b1[0]; \ - dst[1] &= ~b1[1]; \ - dst[2] &= ~b1[2]; } -#define ANYSET(src) (src[0] || src[1] || src[2]) -#endif - -#if (MSKCNT==4) -#define COPYBITS(src, dst) dst[0] = src[0]; dst[1] = src[1]; \ - dst[2] = src[2]; dst[3] = src[3] -#define CLEARBITS(buf) buf[0] = 0; buf[1] = 0; buf[2] = 0; buf[3] = 0 -#define MASKANDSETBITS(dst, b1, b2) \ - dst[0] = (b1[0] & b2[0]);\ - dst[1] = (b1[1] & b2[1]);\ - dst[2] = (b1[2] & b2[2]);\ - dst[3] = (b1[3] & b2[3]) -#define ORBITS(dst, b1, b2) \ - dst[0] = (b1[0] | b2[0]);\ - dst[1] = (b1[1] | b2[1]);\ - dst[2] = (b1[2] | b2[2]);\ - dst[3] = (b1[3] | b2[3]) -#define UNSETBITS(dst, b1) \ - dst[0] &= ~b1[0]; \ - dst[1] &= ~b1[1]; \ - dst[2] &= ~b1[2]; \ - dst[3] &= ~b1[3] -#define ANYSET(src) (src[0] || src[1] || src[2] || src[3]) -#endif - -#if (MSKCNT>4) -#define COPYBITS(src, dst) memmove((caddr_t) dst, (caddr_t) src,\ - MSKCNT*sizeof(long)) -#define CLEARBITS(buf) bzero((caddr_t) buf, MSKCNT*sizeof(long)) -#define MASKANDSETBITS(dst, b1, b2) \ - { int cri; \ - for (cri=MSKCNT; --cri>=0; ) \ - dst[cri] = (b1[cri] & b2[cri]); } -#define ORBITS(dst, b1, b2) \ - { int cri; \ - for (cri=MSKCNT; --cri>=0; ) \ - dst[cri] = (b1[cri] | b2[cri]); } -#define UNSETBITS(dst, b1) \ - { int cri; \ - for (cri=MSKCNT; --cri>=0; ) \ - dst[cri] &= ~b1[cri]; } -#if (MSKCNT==8) -#define ANYSET(src) (src[0] || src[1] || src[2] || src[3] || \ - src[4] || src[5] || src[6] || src[7]) -#endif -#endif - -#else /* not WIN32 */ - -#include -#include - -typedef fd_set FdSet; -typedef FdSet *FdSetPtr; - -#define CLEARBITS(set) FD_ZERO(&set) -#define BITSET(set,s) FD_SET(s,&set) -#define BITCLEAR(set,s) FD_CLR(s,&set) -#define GETBIT(set,s) FD_ISSET(s,&set) -#define ANYSET(set) set->fd_count - -#endif diff --git a/nx-X11/lib/font/fontcache/Imakefile b/nx-X11/lib/font/fontcache/Imakefile deleted file mode 100644 index 1c8526d6c..000000000 --- a/nx-X11/lib/font/fontcache/Imakefile +++ /dev/null @@ -1,29 +0,0 @@ -XCOMM Id: Imakefile,v 1.2 1999/01/31 13:02:46 akiyama Exp $ - - - -XCOMM $XFree86$ - -#include - -#if BuildFontCache -FONTCACHE_DEFINES = FontCacheExtensionDefines -#endif - INCLUDES = -I. -I$(FONTINCSRC) -I../include - HEADERS = - SRCS = fontcache.c - OBJS = fontcache.o - -#define DoNormalLib NormalLibFont -#define DoSharedLib SharedLibFont -#define DoDebugLib DebugLibFont -#define DoProfileLib ProfileLibFont -#include -LibraryObjectRule() - -SpecialCLibObjectRule(fontcache,$(ICONFIGFILES),$(FONTCACHE_DEFINES)) - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/font/fontcache/fcqueue.h b/nx-X11/lib/font/fontcache/fcqueue.h deleted file mode 100644 index 58ba6dfa1..000000000 --- a/nx-X11/lib/font/fontcache/fcqueue.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)queue.h 8.5 (Berkeley) 8/20/94 - * $_Id_: queue.h,v 1.10.2.4 1998/05/12 16:35:25 bde Exp $ - * - * ---------------------------------------------------------------------- - * - * Note: - * This header file derived from FreeBSD-2.2.7 - * /usr/include/sys/queue.h, modified for X-TrueType Server by - * Shunsuke Akiyama . - * - * Id: fcqueue.h,v 1.1 1999/01/06 13:36:42 akiyama Exp $ - */ - -#ifndef _FCQUEUE_H_ -#define _FCQUEUE_H_ - -/* - * Tail queue definitions. - */ -#define TAILQ_HEAD(name, type) \ -struct name { \ - struct type *tqh_first; /* first element */ \ - struct type **tqh_last; /* addr of last next element */ \ -} - -#define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first } - -#define TAILQ_ENTRY(type) \ -struct { \ - struct type *tqe_next; /* next element */ \ - struct type **tqe_prev; /* address of previous next element */ \ -} - -/* - * Tail queue functions. - */ -#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) - -#define TAILQ_FOREACH(var, head, field) \ - for (var = TAILQ_FIRST(head); var; var = TAILQ_NEXT(var, field)) - -#define TAILQ_FIRST(head) ((head)->tqh_first) - -#define TAILQ_LAST(head, headname) \ - (*(((struct headname *)((head)->tqh_last))->tqh_last)) - -#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) - -#define TAILQ_PREV(elm, headname, field) \ - (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) - -#define TAILQ_INIT(head) do { \ - (head)->tqh_first = NULL; \ - (head)->tqh_last = &(head)->tqh_first; \ -} while (0) - -#define TAILQ_INSERT_HEAD(head, elm, field) do { \ - if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ - (head)->tqh_first->field.tqe_prev = \ - &(elm)->field.tqe_next; \ - else \ - (head)->tqh_last = &(elm)->field.tqe_next; \ - (head)->tqh_first = (elm); \ - (elm)->field.tqe_prev = &(head)->tqh_first; \ -} while (0) - -#define TAILQ_INSERT_TAIL(head, elm, field) do { \ - (elm)->field.tqe_next = NULL; \ - (elm)->field.tqe_prev = (head)->tqh_last; \ - *(head)->tqh_last = (elm); \ - (head)->tqh_last = &(elm)->field.tqe_next; \ -} while (0) - -#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ - (elm)->field.tqe_next->field.tqe_prev = \ - &(elm)->field.tqe_next; \ - else \ - (head)->tqh_last = &(elm)->field.tqe_next; \ - (listelm)->field.tqe_next = (elm); \ - (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ -} while (0) - -#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ - (elm)->field.tqe_next = (listelm); \ - *(listelm)->field.tqe_prev = (elm); \ - (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ -} while (0) - -#define TAILQ_REMOVE(head, elm, field) do { \ - if (((elm)->field.tqe_next) != NULL) \ - (elm)->field.tqe_next->field.tqe_prev = \ - (elm)->field.tqe_prev; \ - else \ - (head)->tqh_last = (elm)->field.tqe_prev; \ - *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ -} while (0) - -#endif /* _FCQUEUE_H_ */ diff --git a/nx-X11/lib/font/fontcache/fontcache.c b/nx-X11/lib/font/fontcache/fontcache.c deleted file mode 100644 index 40cfd63c2..000000000 --- a/nx-X11/lib/font/fontcache/fontcache.c +++ /dev/null @@ -1,1022 +0,0 @@ -/*- - * Copyright (c) 1998-1999 Shunsuke Akiyama . - * All rights reserved. - * Copyright (c) 1998-1999 X-TrueType Server Project, All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Id: fontcache.c,v 1.19 1999/01/31 13:06:00 akiyama Exp $ - */ -/* $XFree86: xc/lib/font/fontcache/fontcache.c,v 1.4 2001/04/05 17:42:28 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include - -#include "fontcache.h" - -#define LOW_MARK 0 -#define HI_MARK 1 - -#define PURGE_ENTRY 1 -#define PURGE_BITMAP 2 - -typedef struct { - long hiMark; /* Cache hi water mark */ - long lowMark; /* Cache low water mark */ - long allocated; /* Cache allocated size */ - long used; /* Cache used size */ -} FontCacheSize_t; - -static int CacheInitialized = 0; - -static TAILQ_HEAD(FcInUseQueue, cache_entry) InUseQueueHead, *InUseQueue; -static TAILQ_HEAD(FcFreeQueue, cache_entry) FreeQueueHead, *FreeQueue; -static FCBCB FreeBitmapHead, *FreeBitmap; - -static long CacheHiMark; -static long CacheLowMark; -static int CacheBalance; -static FontCacheSize_t HashSize; -static FontCacheSize_t AllocSize; -static int NeedPurgeCache; -static FontCacheStatistics CacheStatistics; - -static void fc_assign_cache(void); -static int fc_assign_entry(void); -static void fc_flush_cache(void); -static int fc_get_bitmap_area(FontCacheEntryPtr, int); -static void fc_free_bitmap_area(FontCacheBitmapPtr); -static int fc_check_size(int); -static void fc_purge_cache(void); -static void fc_purge_bitmap(void); -static void fc_flush_cache_bitmap(void); -static void fc_flush_cache_inuse(void); -static void fc_flush_cache_free(void); -static void fc_purge_cache_entry(void); -static void fc_purge_cache_entry_pool(void); -static void fc_purge_bitmap_pool(void); - - -/* - * FontCacheInitialize() - * - * Initialize cache work area. - */ - -int -FontCacheInitialize() -{ -#ifdef FONTCACHE - int i; - - if (!CacheInitialized) { - /* - * first time initialization - */ -#if defined(HASH_DEBUG) || defined(DEBUG) - fprintf(stderr, "FontCacheInitialize: initializing cache\n"); -#endif - InUseQueue = &InUseQueueHead; - TAILQ_INIT(InUseQueue); - - FreeQueue = &FreeQueueHead; - TAILQ_INIT(FreeQueue); - - FreeBitmap = &FreeBitmapHead; - FreeBitmap->index = 0; - for (i = 0; i < FC_MEM_HASH_SIZE; i++) { - TAILQ_INIT(&FreeBitmap->head[i]); - } - - CacheHiMark = FC_DEFAULT_CACHE_SIZE * 1024; /* temporary */ - CacheLowMark = (CacheHiMark / 4) * 3; - CacheBalance = FC_CACHE_BALANCE; - - NeedPurgeCache = 0; - - HashSize.allocated = HashSize.used = 0; - AllocSize.allocated = AllocSize.used = 0; - fc_assign_cache(); - fc_assign_entry(); -#if defined(DEBUG) - fprintf(stderr, "FontCacheInitialize: hi=%ld, lo=%ld, bal=%d\n", - CacheHiMark, CacheLowMark, CacheBalance); -#endif - - CacheInitialized = 1; - } else { - /* - * second time or later case. - * flush and reassign cache. - */ -#if defined(HASH_DEBUG) || defined(DEBUG) - fprintf(stderr, "FontCacheInitialize: initializing cache, again\n"); -#endif - } - - memset(&CacheStatistics, 0, sizeof (CacheStatistics)); -#endif /* FONTCACHE */ - - return 0; /* make lint happy */ -} - -/* - * FontCacheChangeSettings() - * - * Change cache size and reinitialize work areas. - * - * Returns 0, if memory allocation failed. Otherwise 1. - */ - -int -FontCacheChangeSettings(FontCacheSettingsPtr cs) -{ - int result; - - if (!CacheInitialized) { - FontCacheInitialize(); - if (!CacheInitialized) - return 0; - } - -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, - "FontCahceChangeSettings: hi-mark=%ld, low-mark=%ld, balance=%ld\n", - cs->himark, cs->lowmark, cs->balance); -#endif - - fc_flush_cache(); - - CacheHiMark = cs->himark; - CacheLowMark = cs->lowmark; - CacheBalance = cs->balance; - - fc_assign_cache(); - result = fc_assign_entry(); - - return result; -} - -/* - * FontCacheGetSettings() - * - * Get current cache control parameters. - */ - -void -FontCacheGetSettings(FontCacheSettingsPtr cs) -{ - if (!CacheInitialized) { - FontCacheInitialize(); - if (!CacheInitialized) - return; - } - - cs->himark = CacheHiMark; - cs->lowmark = CacheLowMark; - cs->balance = CacheBalance; -} - -/* - * FontCacheGetStatistics() - * - * Get current cache statistics. - */ - -void -FontCacheGetStatistics(FontCacheStatisticsPtr cs) -{ - if (!CacheInitialized) { - FontCacheInitialize(); - if (!CacheInitialized) - return; - } - - CacheStatistics.purge_stat = NeedPurgeCache; - CacheStatistics.balance = CacheBalance; - CacheStatistics.f.usage = HashSize.used; - CacheStatistics.v.usage = AllocSize.used; - - memcpy(cs, &CacheStatistics, sizeof (CacheStatistics)); -} - -/* - * FontCacheOpenCache() - * - * Allocate font cache control block and initialize it. - * - * Returns pointer to font cache control block. Or returns NULL when - * detected illegal parameter or memory allocation failed. - */ - -FCCBPtr -FontCacheOpenCache(void *arg) -{ - int linesize; - FCCBPtr this; - int size = 0, mask = 0; - int i; - - static int sizes[] = { 16, 32, 64, 128, 0 }; - - if (!CacheInitialized) { - FontCacheInitialize(); - if (!CacheInitialized) - return NULL; - } - - linesize = (long)arg; -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "FontCacheOpenCache: line size=%d\n", linesize); -#endif - - for (i = 0; sizes[i] != 0; i++) { - if (sizes[i] == linesize) { - size = linesize; - mask = linesize - 1; - break; - } - } - if (sizes[i] == 0) { - return NULL; - } - - this = (FCCBPtr) malloc(sizeof (FCCB)); - if (this != NULL) { - memset(this, 0, sizeof (FCCB)); - this->head = (FontCacheHeadPtr) malloc(sizeof (FontCacheHead) * size); - if (this->head == NULL) { - free(this); - this = NULL; - } else { - this->size = size; - this->mask = mask; - for (i = 0; i < size; i++) { - TAILQ_INIT(&this->head[i]); - } - } - } - - return this; -} - -/* - * FontCacheCloseCache() - * - * Release font cache control block and all it's related entries. - */ - -void -FontCacheCloseCache(FCCBPtr this) -{ - FontCacheEntryPtr entry, next; - int i; - int size; - - if (!CacheInitialized) { - return; - } - - size = this->size; - for (i = 0; i < size; i++) { - entry = TAILQ_FIRST(&this->head[i]); - while (entry != NULL) { - /* remove entry from in-use queue, here */ - TAILQ_REMOVE(InUseQueue, entry, c_lru); - - /* remove entry from the hash */ - if (entry->bitmapsize > FC_SMALL_BITMAP_SIZE - && entry->charInfo.bits != NULL) { - fc_free_bitmap_area(entry->bmp); - } - entry->charInfo.bits = NULL; - entry->bitmapsize = 0; - - next = TAILQ_NEXT(entry, c_hash); - TAILQ_INSERT_HEAD(FreeQueue, entry, c_lru); - HashSize.used -= sizeof (FontCacheEntry); - entry = next; - } - } - - free(this->head); - free(this); -} - -/* - * FontCacheGetEntry() - * - * Allocate font cache entry and initialize it. - */ - -FontCacheEntryPtr -FontCacheGetEntry() -{ - FontCacheEntryPtr entry; - FontCacheEntryPtr p; - long size; - - /* scan in-use queue and purge if required */ - fc_purge_cache(); - - /* allocate hash entry */ - if (TAILQ_EMPTY(FreeQueue)) { - size = sizeof (FontCacheEntry); - p = (FontCacheEntryPtr) malloc(size); - if (p != NULL) { - TAILQ_INSERT_HEAD(FreeQueue, p, c_lru); - HashSize.allocated += size; -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "FontCachegetEntry: allocated new entry\n"); -#endif - } - } - - if (!TAILQ_EMPTY(FreeQueue)) { - entry = TAILQ_FIRST(FreeQueue); - TAILQ_REMOVE(FreeQueue, entry, c_lru); - memset(entry, 0, sizeof (FontCacheEntry)); - } else { - entry = NULL; - } - - return entry; -} - -/* - * FontCacheGetBitmap() - * - * Allocate font glyph bitmap area. - * - * Note: - * Allocated area should be cleared. - */ - -int -FontCacheGetBitmap(FontCacheEntryPtr entry, int size) -{ - int oldsize; - int result; - - /* XXX */ - if ((AllocSize.used > AllocSize.hiMark - size) && - (size > FC_SMALL_BITMAP_SIZE)) { - fc_purge_bitmap(); - } - - if (size < 0) /* wrong size */ - return 0; - - result = 0; - oldsize = entry->bitmapsize; - if (size <= FC_SMALL_BITMAP_SIZE) { - /* use coresponding bitmap area */ - if (oldsize > FC_SMALL_BITMAP_SIZE) { - /* We don't need allocated area anymore */ - fc_free_bitmap_area(entry->bmp); - } - entry->bitmapsize = size; - if (size > 0) { - entry->charInfo.bits = entry->bitmap; - memset(entry->charInfo.bits, 0, size); - } else - entry->charInfo.bits = NULL; - - result = 1; - } else { - /* need extra bitmap area */ - if (entry->charInfo.bits == NULL) { - /* no any extra bitmap area */ - if (fc_get_bitmap_area(entry, size)) { - entry->bitmapsize = size; - memset(entry->charInfo.bits, 0, size); - if (fc_check_size(HI_MARK)) { - fc_purge_cache(); - } - result = 1; - } - } else { - /* we already have extra bitmap area */ - if (oldsize == size) { - /* same size, reuse it */ - memset(entry->charInfo.bits, 0, size); - result = 1; - } else { - /* different size */ - fc_free_bitmap_area(entry->bmp); - if (fc_get_bitmap_area(entry, size)) { - entry->bitmapsize = size; - memset(entry->charInfo.bits, 0, size); - if (fc_check_size(HI_MARK)) { - fc_purge_cache(); - } - result = 1; - } - } - } - } - - return result; -} - -/* - * FontCacheSearchEntry() - * - * Search an entry matched with the key from the hash. - */ - -int -FontCacheSearchEntry(FCCBPtr this, int key, FontCacheEntryPtr *value) -{ - FontCacheHeadPtr head; - FontCacheEntryPtr entry; - int index; - - index = key & this->mask; - head = &this->head[index]; - - TAILQ_FOREACH(entry, head, c_hash) { - if (entry->key == key) { - /* found, change position */ - CacheStatistics.f.hits++; - - TAILQ_REMOVE(InUseQueue, entry, c_lru); - TAILQ_INSERT_HEAD(InUseQueue, entry, c_lru); - - TAILQ_REMOVE(head, entry, c_hash); - TAILQ_INSERT_HEAD(head, entry, c_hash); - - /* purge least recentrly used cache entirs */ - fc_purge_cache(); - - *value = entry; - return 1; - } - } - - /* purge least recentrly used cache entirs */ - fc_purge_cache(); - - /* not found */ - CacheStatistics.f.misshits++; - *value = NULL; - return 0; -} - -/* - * FontCacheInsertEntry() - * - * Insert an entry into the cache pool. - */ - -int -FontCacheInsertEntry(FCCBPtr this, int key, FontCacheEntryPtr entry) -{ - FontCacheHeadPtr head; - int index; - - index = key & this->mask; - head = &this->head[index]; - - entry->key = key; - entry->c_head = head; - TAILQ_INSERT_HEAD(head, entry, c_hash); - - /* insert entry into in-use queue */ - TAILQ_INSERT_HEAD(InUseQueue, entry, c_lru); - - /* adjust cache in-use size */ - HashSize.used += sizeof (FontCacheEntry); - if (fc_check_size(HI_MARK)) { - fc_purge_cache(); - } - - return 1; -} - -/* - * fc_assign_cache() - * - * Assign cache size considered with cache balance rate. - */ - -static void -fc_assign_cache() -{ - HashSize.hiMark = (CacheHiMark * CacheBalance) / 100; - HashSize.lowMark = (CacheLowMark * CacheBalance) / 100; - - AllocSize.hiMark = (CacheHiMark * (100 - CacheBalance)) / 100; - AllocSize.lowMark = (CacheLowMark * (100 - CacheBalance)) / 100; -} - -/* - * fc_assign_entry() - * - * Assign cache entry into free queue. - * - * Returns 0, when memory allocation failed. Otherwise 1. - */ - -static int -fc_assign_entry() -{ - FontCacheEntryPtr entry; - long used; - int result = 1; - - used = 0; - while ((used + sizeof (FontCacheEntry)) < HashSize.hiMark) { - entry = (FontCacheEntryPtr) malloc(sizeof (FontCacheEntry)); - if (entry == NULL) { - fprintf(stderr, "fc_assign_entry: can't allocate memory.\n"); - result = 0; - break; - } - TAILQ_INSERT_HEAD(FreeQueue, entry, c_lru); - used += sizeof (FontCacheEntry); - HashSize.allocated += sizeof (FontCacheEntry); - } - - return result; -} - -/* - * fc_get_bitmap_area() - * - * Search allocated memory area from free bitmap hash pool. If there - * is no entry, then allocate new bitmap area. - * - * Returns 0, when memory allocation failed, otherwise 1. And some - * sort of cache entry structure members were updated. - */ - -static int -fc_get_bitmap_area(FontCacheEntryPtr this, int size) -{ - FontCacheBitmapHeadPtr head; - FontCacheBitmapPtr bitmap; - int index; - int result = 0; - - index = size & FC_MEM_HASH_MASK; - head = &FreeBitmap->head[index]; - TAILQ_FOREACH(bitmap, head, b_hash) { - if (bitmap->key == size) { - TAILQ_REMOVE(head, bitmap, b_hash); - this->bmp = bitmap; - this->charInfo.bits = (char *) (bitmap + 1); - bitmap->b_entry = this; - result = 1; - CacheStatistics.v.hits++; - AllocSize.used += (size + sizeof (FontCacheBitmap)); -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "fc_get_bitmap_area: bitmap entry found in pool\n"); -#endif - break; - } - } - - if (result == 0) { - CacheStatistics.v.misshits++; - bitmap = (FontCacheBitmapPtr) malloc(size + sizeof (FontCacheBitmap)); - if (bitmap != NULL) { - bitmap->b_entry = this; - bitmap->size = size + sizeof (FontCacheBitmap); - bitmap->key = size; - this->bmp = bitmap; - this->charInfo.bits = (char *) (bitmap + 1); - AllocSize.allocated += (size + sizeof (FontCacheBitmap)); - AllocSize.used += (size + sizeof (FontCacheBitmap)); - result = 1; -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "fc_get_bitmap_area: bitmap entry allocated\n"); -#endif - } else { - this->bmp = NULL; - this->charInfo.bits = NULL; - } - } - - return result; -} - -/* - * fc_free_bitmap_area() - * - * Release allocated bitmap area into free hash pool. - */ - -static void -fc_free_bitmap_area(FontCacheBitmapPtr this) -{ - FontCacheBitmapHeadPtr head; - FontCacheEntryPtr entry; - int index; - -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "fc_free_bitmap_area: bitmap entry returns into pool\n"); -#endif - - index = this->key & FC_MEM_HASH_MASK; - head = &FreeBitmap->head[index]; - TAILQ_INSERT_HEAD(head, this, b_hash); - - AllocSize.used -= this->size; - - entry = this->b_entry; - entry->bmp = NULL; - entry->bitmapsize = 0; -} - -/* - * fc_flush_cache_bitmap() - * - * Flush all allocated bitmap area from the free hash pool. - */ - -static void -fc_flush_cache_bitmap() -{ - FontCacheBitmapHeadPtr head; - FontCacheBitmapPtr bitmap; - int i; - - for (i = 0; i < FC_MEM_HASH_SIZE; i++) { - head = &FreeBitmap->head[i]; - while (!TAILQ_EMPTY(head)) { - bitmap = TAILQ_FIRST(head); - TAILQ_REMOVE(head, bitmap, b_hash); - - AllocSize.allocated -= bitmap->size; - free(bitmap); - } - } -} - -/* - * fc_flush_cache_inuse() - * - * Release all in-use cache entries. - */ - -static void -fc_flush_cache_inuse() -{ - FontCacheEntryPtr entry; - FontCacheHeadPtr head; - - while (!TAILQ_EMPTY(InUseQueue)) { - /* remove this entry from in-use queue */ - entry = TAILQ_FIRST(InUseQueue); - TAILQ_REMOVE(InUseQueue, entry, c_lru); - - /* remove this entry from hash */ - head = entry->c_head; - TAILQ_REMOVE(head, entry, c_hash); - - /* release bitmap area */ - if (entry->bitmapsize > FC_SMALL_BITMAP_SIZE - && entry->charInfo.bits != NULL) { - fc_free_bitmap_area(entry->bmp); - } - entry->charInfo.bits = NULL; - entry->bitmapsize = 0; - - /* release font-specific private area */ - if ( entry->vfuncs && entry->vfuncs->f_private_dispose ) - (*entry->vfuncs->f_private_dispose)(entry->f_private); - entry->f_private = NULL; - entry->vfuncs = NULL; - - /* add this entry to free queue */ - TAILQ_INSERT_HEAD(FreeQueue, entry, c_lru); - - /* adjust size */ - HashSize.used -= sizeof (FontCacheEntry); - } -} - -/* - * fc_flush_cache_free() - * - * Flush all free cache entries from the free cache queue. - */ - -static void -fc_flush_cache_free() -{ - FontCacheEntryPtr entry; - - /* release entire entries of the free queue */ - while (!TAILQ_EMPTY(FreeQueue)) { - entry = TAILQ_FIRST(FreeQueue); - TAILQ_REMOVE(FreeQueue, entry, c_lru); - free(entry); - HashSize.allocated -= sizeof (FontCacheEntry); - } -} - -/* - * fc_flush_cache() - * - * Flush all cache entries and allocated bitmap area from the pool. - */ - -static void -fc_flush_cache() -{ - fc_flush_cache_inuse(); - fc_flush_cache_bitmap(); - fc_flush_cache_free(); - - memset(&CacheStatistics, 0, sizeof (CacheStatistics)); -} - -/* - * fc_check_size() - * - * Check cache size, then return it's result. - */ - -static int -fc_check_size(int mark) -{ - int result = 0; - - if (mark == LOW_MARK) { - if (HashSize.used > HashSize.lowMark) { - result |= PURGE_ENTRY; - } - if (AllocSize.used > AllocSize.lowMark) { - result |= PURGE_BITMAP; - } - } else { - if (HashSize.used > HashSize.hiMark) { - result |= PURGE_ENTRY; - } - if (AllocSize.used > AllocSize.hiMark) { - result |= PURGE_BITMAP; - } - } - - return result; -} - -/* - * fc_purge_cache_entry() - * - * Purge least recently used cache entry. - */ - -static void -fc_purge_cache_entry() -{ - FontCacheHeadPtr head; - FontCacheEntryPtr entry; - int i; - - for (i = 0; i < FC_PURGE_PER_SCAN; i++) { - /* get least recently used entry */ - entry = TAILQ_LAST(InUseQueue, FcInUseQueue); - -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "fc_purge_cache_entry: purged: %p, %d\n", - entry, entry->key); -#endif - - /* remove this entry from in-use queue */ - TAILQ_REMOVE(InUseQueue, entry, c_lru); - - /* remove this entry from the hash */ - head = entry->c_head; - TAILQ_REMOVE(head, entry, c_hash); - - /* release bitmap area */ - if (entry->bitmapsize > FC_SMALL_BITMAP_SIZE - && entry->charInfo.bits != NULL) { - fc_free_bitmap_area(entry->bmp); - CacheStatistics.v.purged++; - } - entry->charInfo.bits = NULL; - entry->bitmapsize = 0; - - /* release font-specific private area */ - if ( entry->vfuncs && entry->vfuncs->f_private_dispose ) - (*entry->vfuncs->f_private_dispose)(entry->f_private); - entry->f_private = NULL; - entry->vfuncs = NULL; - - /* add this entry to free queue */ - TAILQ_INSERT_HEAD(FreeQueue, entry, c_lru); - - HashSize.used -= sizeof (FontCacheEntry); - CacheStatistics.f.purged++; - } -} - -/* - * fc_purge_cache_entry_pool() - * - * Purge free cache entries, to adjust cache size. - */ - -static void -fc_purge_cache_entry_pool() -{ - FontCacheEntryPtr entry; - - while (!TAILQ_EMPTY(FreeQueue)) { - entry = TAILQ_LAST(FreeQueue, FcFreeQueue); - TAILQ_REMOVE(FreeQueue, entry, c_lru); -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "fc_purge_cache_entry_pool: purged from free queue: %p\n", - entry); -#endif - HashSize.allocated -= sizeof (FontCacheEntry); - free(entry); - if (HashSize.allocated <= HashSize.hiMark) { - break; - } - } -} - -/* - * fc_purge_bitmap() - * - * Purge least recently used allocated bitmap area. - */ - -static void -fc_purge_bitmap() -{ - FontCacheEntryPtr entry, first; - int purged = 0; - - /* release used entry, if required */ - first = TAILQ_FIRST(InUseQueue); - if (first != NULL) { - entry = TAILQ_LAST(InUseQueue, FcInUseQueue); - while (purged < FC_PURGE_PER_SCAN) { - if (entry->bmp != NULL) { -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "fc_purge_bitmap: purged from live queue: %p, %d(%d)\n", - entry->bmp, entry->bmp->key, entry->bmp->size); -#endif - fc_free_bitmap_area(entry->bmp); - entry->charInfo.bits = NULL; - CacheStatistics.v.purged++; - purged++; - } - if (entry == first) { - break; - } - entry = TAILQ_PREV(entry, FcInUseQueue, c_lru); - } - } -} - -/* - * fc_purge_bitmap_pool() - * - * Purge free bitmap area from pool, to adjust cache size. - */ - -static void -fc_purge_bitmap_pool() -{ - int this, stop, quit; - FontCacheBitmapHeadPtr head; - FontCacheBitmapPtr bitmap; - - /* release free bitmap entry */ - this = FreeBitmap->index; - stop = this; - quit = 0; - - do { - head = &FreeBitmap->head[this]; - while (!TAILQ_EMPTY(head)) { - bitmap = TAILQ_LAST(head, fcmem_head); - TAILQ_REMOVE(head, bitmap, b_hash); -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "fc_purge_bitmap_pool: purged from pool: %p, %d(%d)\n", - bitmap, bitmap->key, bitmap->size); -#endif - AllocSize.allocated -= bitmap->size; - free(bitmap); - if (AllocSize.allocated <= AllocSize.hiMark) { - quit = 1; - break; - } - } - this++; - this &= FC_MEM_HASH_MASK; - } while (this != stop && quit == 0); - - FreeBitmap->index++; - FreeBitmap->index &= FC_MEM_HASH_MASK; -} - -/* - * fc_purge_cache() - * - * Purge font cache, if required. - */ - -static void -fc_purge_cache() -{ - int strategy; - - if (NeedPurgeCache) { - strategy = fc_check_size(LOW_MARK); - switch (strategy) { - case PURGE_ENTRY : - CacheStatistics.purge_runs++; - fc_purge_cache_entry(); - break; - case PURGE_BITMAP : - CacheStatistics.purge_runs++; - fc_purge_bitmap(); - break; - case (PURGE_ENTRY | PURGE_BITMAP) : - CacheStatistics.purge_runs++; - fc_purge_cache_entry(); - fc_purge_bitmap(); - break; - default : - NeedPurgeCache = 0; - break; - } - } else { - strategy = fc_check_size(HI_MARK); - switch (strategy) { - case PURGE_ENTRY : - if ((CacheBalance + FC_BALANCE_DIFFS) <= FC_BALANCE_HI) { - CacheBalance += FC_BALANCE_DIFFS; -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "fc_purge_cache: cache balance changed to %d\n", CacheBalance); -#endif - fc_assign_cache(); - fc_purge_bitmap_pool(); - } else { - CacheStatistics.purge_runs++; - NeedPurgeCache = 1; - while (fc_check_size(HI_MARK) & PURGE_ENTRY) { - fc_purge_cache_entry(); - } - } - break; - case PURGE_BITMAP : - if ((CacheBalance - FC_BALANCE_DIFFS) >= FC_BALANCE_LOW) { - CacheBalance -= FC_BALANCE_DIFFS; -#if defined(HASH_DEBUG) || defined(DEBUG) -fprintf(stderr, "fc_purge_cache: cache balance changed to %d\n", CacheBalance); -#endif - fc_assign_cache(); - fc_purge_cache_entry_pool(); - } else { - CacheStatistics.purge_runs++; - NeedPurgeCache = 1; - while (fc_check_size(HI_MARK) & PURGE_BITMAP) { - fc_purge_bitmap(); - } - } - break; - case (PURGE_ENTRY | PURGE_BITMAP) : - CacheStatistics.purge_runs++; - NeedPurgeCache = 1; - while (fc_check_size(HI_MARK)) { - fc_purge_cache_entry(); - fc_purge_bitmap(); - } - break; - default : - break; - } - } -} diff --git a/nx-X11/lib/font/fontcache/fontcache.h b/nx-X11/lib/font/fontcache/fontcache.h deleted file mode 100644 index c95de25eb..000000000 --- a/nx-X11/lib/font/fontcache/fontcache.h +++ /dev/null @@ -1,121 +0,0 @@ -/*- - * Copyright (c) 1998-1999 Shunsuke Akiyama . - * All rights reserved. - * Copyright (c) 1998-1999 X-TrueType Server Project, All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Id: fontcache.h,v 1.12 1999/01/09 06:24:30 akiyama Exp $ - */ -/* $XFree86: xc/lib/font/fontcache/fontcache.h,v 1.6 2002/11/08 00:46:27 alanh Exp $ */ - -#ifndef _FONTCACHE_H_ -#define _FONTCACHE_H_ - -#include -#include -#include "fcqueue.h" -#define _FONTCACHE_SERVER_ -#include - -/* constant declarations */ - -#ifndef FC_DEFAULT_CACHE_SIZE -#define FC_DEFAULT_CACHE_SIZE 5120 /* in KB */ -#endif - -#define FC_CACHE_BALANCE 70 /* in percentage */ -#define FC_BALANCE_LOW 10 /* in percentage */ -#define FC_BALANCE_HI 90 /* in percentage */ -#define FC_BALANCE_DIFFS 5 /* in percentage */ - -#define FC_SMALL_BITMAP_SIZE 128 - -#define FC_MEM_HASH_SIZE 256 -#define FC_MEM_HASH_MASK (FC_MEM_HASH_SIZE - 1) - -#define FC_PURGE_PER_SCAN 2 - -/* data type declarations */ - -struct cache_entry; -struct fcbitmap; - -TAILQ_HEAD(fchash_head, cache_entry); -TAILQ_HEAD(fcmem_head, fcbitmap); - -struct fcbitmap { - TAILQ_ENTRY(fcbitmap) b_hash; - struct cache_entry *b_entry; - int size; - int key; -}; - -struct fc_entry_vfuncs { - void (*f_private_dispose)(void *f_private); -}; - -struct cache_entry { - TAILQ_ENTRY(cache_entry) c_hash; /* Hash chain. */ - TAILQ_ENTRY(cache_entry) c_lru; /* Font cache LRU list chain. */ - struct fchash_head *c_head; /* Pointer to head. */ - int key; /* hash key */ - CharInfoRec charInfo; /* CharInfo record */ - struct fcbitmap *bmp; - void *f_private; /* Font-specific private data */ - struct fc_entry_vfuncs *vfuncs; /* virtual function table */ - int bitmapsize; /* Bitmap size */ - char bitmap[FC_SMALL_BITMAP_SIZE]; /* Small bitmap data area */ -}; - -struct fchash { - int size; - int mask; - struct fchash_head *head; -}; - -struct fcmemhash { - int index; - struct fcmem_head head[FC_MEM_HASH_SIZE]; -}; - -typedef struct fcbitmap FontCacheBitmap, *FontCacheBitmapPtr; -typedef struct cache_entry FontCacheEntry, *FontCacheEntryPtr; -typedef struct fchash_head FontCacheHead, *FontCacheHeadPtr; -typedef struct fcmem_head FontCacheBitmapHead, *FontCacheBitmapHeadPtr; -typedef struct fchash FCCB, *FCCBPtr; -typedef struct fcmemhash FCBCB, *FCBCBPtr; - -/* Function prototypes */ - -int FontCacheInitialize(void); -FCCBPtr FontCacheOpenCache(void * /* arg */); -void FontCacheCloseCache(FCCBPtr /* this */); -FontCacheEntryPtr FontCacheGetEntry(void); -int FontCacheSearchEntry(FCCBPtr /* this */, int /* key */, - FontCacheEntryPtr * /* value */); -int FontCacheInsertEntry(FCCBPtr /* this */, int /* key */, - FontCacheEntryPtr /* entry */); -int FontCacheGetBitmap(FontCacheEntryPtr /* entry */, - int /* size */); - -#endif /* _FONTCACHE_H_ */ diff --git a/nx-X11/lib/font/fontfile/Imakefile b/nx-X11/lib/font/fontfile/Imakefile deleted file mode 100644 index fa075a951..000000000 --- a/nx-X11/lib/font/fontfile/Imakefile +++ /dev/null @@ -1,81 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:36 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/lib/font/fontfile/Imakefile,v 3.20 2001/11/03 23:03:00 dawes Exp $ - -#include - -#if BuildServer && DoLoadableServer -#define IHaveSubdirs -#define NoLibSubdirs -SUBDIRS = module -#endif - - INCLUDES = -I$(FONTINCSRC) -I../include -I$(SERVERSRC)/include \ - -I$(INCLUDESRC) - HEADERS = -#ifdef FontFormatDefines -FORMAT_DEFS = FontFormatDefines -#endif - -#if BuildSpeedo -SPEEDO_DEFINES = -DBUILD_SPEEDO -#endif -#if BuildType1 -TYPE1_DEFINES = -DBUILD_TYPE1 -#endif -#if BuildCID -CID_DEFINES = -DBUILD_CID -#endif -#if BuildFreeType -FREETYPE_DEFINES = -DBUILD_FREETYPE -#endif - -#if FontencCompatibility - COMPAT_SRC = fontencc.c - COMPAT_OBJ = fontencc.o -#endif - -#if GzipFontCompression - GUNZIP_SRC = gunzip.c - GUNZIP_OBJ = gunzip.o - GZIP_DEFS = -DX_GZIP_FONT_COMPRESSION -#endif - -FONTENCDEFS = -DFONT_ENCODINGS_DIRECTORY=\"$(ENCODINGSDIR)/encodings.dir\" - - DEFINES = StrcasecmpDefines \ - $(SPEEDO_DEFINES) $(TYPE1_DEFINES) $(CID_DEFINES) \ - $(FREETYPE_DEFINES) $(FONTENCDEFS) \ - $(GZIP_DEFS) - - SRCS = dirfile.c fontdir.c fontfile.c fileio.c fontscale.c \ - defaults.c bitsource.c register.c renderers.c bufio.c \ - decompress.c filewr.c printerfont.c ffcheck.c \ - fontenc.c encparse.c $(COMPAT_SRC) $(GUNZIP_SRC) - OBJS = dirfile.o fontdir.o fontfile.o fileio.o fontscale.o \ - defaults.o bitsource.o register.o renderers.o bufio.o \ - decompress.o filewr.o printerfont.o ffcheck.o \ - fontenc.o encparse.o $(COMPAT_OBJ) $(GUNZIP_OBJ) - -#define DoNormalLib NormalLibFont -#define DoSharedLib SharedLibFont -#define DoDebugLib DebugLibFont -#define DoProfileLib ProfileLibFont -#include -LibraryObjectRule() - -SpecialCLibObjectRule(fileio,$(ICONFIGFILES),$(GZIP_DEFS)) - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -#if BuildServer && DoLoadableServer -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - -DependTarget() - diff --git a/nx-X11/lib/font/fontfile/bitsource.c b/nx-X11/lib/font/fontfile/bitsource.c deleted file mode 100644 index ae27de8fe..000000000 --- a/nx-X11/lib/font/fontfile/bitsource.c +++ /dev/null @@ -1,174 +0,0 @@ -/* $Xorg: bitsource.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/bitsource.c,v 1.3 2001/01/17 19:43:29 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include - -BitmapSourcesRec FontFileBitmapSources; - -Bool -FontFileRegisterBitmapSource (FontPathElementPtr fpe) -{ - FontPathElementPtr *new; - int i; - int newsize; - - for (i = 0; i < FontFileBitmapSources.count; i++) - if (FontFileBitmapSources.fpe[i] == fpe) - return TRUE; - if (FontFileBitmapSources.count == FontFileBitmapSources.size) - { - newsize = FontFileBitmapSources.size + 4; - new = (FontPathElementPtr *) xrealloc (FontFileBitmapSources.fpe, newsize * sizeof *new); - if (!new) - return FALSE; - FontFileBitmapSources.size = newsize; - FontFileBitmapSources.fpe = new; - } - FontFileBitmapSources.fpe[FontFileBitmapSources.count++] = fpe; - return TRUE; -} - -void -FontFileUnregisterBitmapSource (FontPathElementPtr fpe) -{ - int i; - - for (i = 0; i < FontFileBitmapSources.count; i++) - if (FontFileBitmapSources.fpe[i] == fpe) - { - FontFileBitmapSources.count--; - if (FontFileBitmapSources.count == 0) - { - FontFileBitmapSources.size = 0; - xfree (FontFileBitmapSources.fpe); - FontFileBitmapSources.fpe = 0; - } - else - { - for (; i < FontFileBitmapSources.count; i++) - FontFileBitmapSources.fpe[i] = FontFileBitmapSources.fpe[i+1]; - } - break; - } -} - -/* - * Our set_path_hook: unregister all bitmap sources. - * This is necessary because already open fonts will keep their FPEs - * allocated, but they may not be on the new font path. - * The bitmap sources in the new path will be registered by the init_func. - */ -void -FontFileEmptyBitmapSource(void) -{ - if (FontFileBitmapSources.count == 0) - return; - - FontFileBitmapSources.count = 0; - FontFileBitmapSources.size = 0; - xfree (FontFileBitmapSources.fpe); - FontFileBitmapSources.fpe = 0; -} - -int -FontFileMatchBitmapSource (FontPathElementPtr fpe, - FontPtr *pFont, - int flags, - FontEntryPtr entry, - FontNamePtr zeroPat, - FontScalablePtr vals, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - Bool noSpecificSize) -{ - int source; - FontEntryPtr zero; - FontBitmapEntryPtr bitmap; - int ret; - FontDirectoryPtr dir; - FontScaledPtr scaled; - - /* - * Look through all the registered bitmap sources for - * the same zero name as ours; entries along that one - * can be scaled as desired. - */ - ret = BadFontName; - for (source = 0; source < FontFileBitmapSources.count; source++) - { - if (FontFileBitmapSources.fpe[source] == fpe) - continue; - dir = (FontDirectoryPtr) FontFileBitmapSources.fpe[source]->private; - zero = FontFileFindNameInDir (&dir->scalable, zeroPat); - if (!zero) - continue; - scaled = FontFileFindScaledInstance (zero, vals, noSpecificSize); - if (scaled) - { - if (scaled->pFont) - { - *pFont = scaled->pFont; - (*pFont)->fpe = FontFileBitmapSources.fpe[source]; - ret = Successful; - } - else if (scaled->bitmap) - { - entry = scaled->bitmap; - bitmap = &entry->u.bitmap; - if (bitmap->pFont) - { - *pFont = bitmap->pFont; - (*pFont)->fpe = FontFileBitmapSources.fpe[source]; - ret = Successful; - } - else - { - ret = FontFileOpenBitmap ( - FontFileBitmapSources.fpe[source], - pFont, flags, entry, format, fmask); - if (ret == Successful && *pFont) - (*pFont)->fpe = FontFileBitmapSources.fpe[source]; - } - } - else /* "cannot" happen */ - { - ret = BadFontName; - } - break; - } - } - return ret; -} diff --git a/nx-X11/lib/font/fontfile/bufio.c b/nx-X11/lib/font/fontfile/bufio.c deleted file mode 100644 index 43c6a13a7..000000000 --- a/nx-X11/lib/font/fontfile/bufio.c +++ /dev/null @@ -1,212 +0,0 @@ -/* $Xorg: bufio.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/bufio.c,v 3.9 2001/12/14 19:56:50 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -BufFilePtr -BufFileCreate (char *private, - int (*input)(BufFilePtr), - int (*output)(int, BufFilePtr), - int (*skip)(BufFilePtr, int), - int (*close)(BufFilePtr, int)) -{ - BufFilePtr f; - - f = (BufFilePtr) xalloc (sizeof *f); - if (!f) - return 0; - f->private = private; - f->bufp = f->buffer; - f->left = 0; - f->input = input; - f->output = output; - f->skip = skip; - f->eof = 0; - f->close = close; - return f; -} - -#define FileDes(f) ((int)(long) (f)->private) - -static int -BufFileRawFill (BufFilePtr f) -{ - int left; - - left = read (FileDes(f), (char *)f->buffer, BUFFILESIZE); - if (left <= 0) { - f->left = 0; - return BUFFILEEOF; - } - f->left = left - 1; - f->bufp = f->buffer + 1; - return f->buffer[0]; -} - -static int -BufFileRawSkip (BufFilePtr f, int count) -{ - int curoff; - int fileoff; - int todo; - - curoff = f->bufp - f->buffer; - fileoff = curoff + f->left; - if (curoff + count <= fileoff) { - f->bufp += count; - f->left -= count; - } else { - todo = count - (fileoff - curoff); - if (lseek (FileDes(f), todo, 1) == -1) { - if (errno != ESPIPE) - return BUFFILEEOF; - while (todo) { - curoff = BUFFILESIZE; - if (curoff > todo) - curoff = todo; - fileoff = read (FileDes(f), (char *)f->buffer, curoff); - if (fileoff <= 0) - return BUFFILEEOF; - todo -= fileoff; - } - } - f->left = 0; - } - return count; -} - -static int -BufFileRawClose (BufFilePtr f, int doClose) -{ - if (doClose) - close (FileDes (f)); - return 1; -} - -BufFilePtr -BufFileOpenRead (int fd) -{ -#if defined(__UNIXOS2__) || defined (WIN32) - /* hv: I'd bet WIN32 has the same effect here */ - setmode(fd,O_BINARY); -#endif - return BufFileCreate ((char *)(long) fd, BufFileRawFill, 0, BufFileRawSkip, BufFileRawClose); -} - -static int -BufFileRawFlush (int c, BufFilePtr f) -{ - int cnt; - - if (c != BUFFILEEOF) - *f->bufp++ = c; - cnt = f->bufp - f->buffer; - f->bufp = f->buffer; - f->left = BUFFILESIZE; - if (write (FileDes(f), (char *)f->buffer, cnt) != cnt) - return BUFFILEEOF; - return c; -} - -BufFilePtr -BufFileOpenWrite (int fd) -{ - BufFilePtr f; - -#if defined(__UNIXOS2__) || defined(WIN32) - /* hv: I'd bet WIN32 has the same effect here */ - setmode(fd,O_BINARY); -#endif - f = BufFileCreate ((char *)(long) fd, 0, BufFileRawFlush, 0, BufFileFlush); - f->bufp = f->buffer; - f->left = BUFFILESIZE; - return f; -} - -int -BufFileRead (BufFilePtr f, char *b, int n) -{ - int c, cnt; - cnt = n; - while (cnt--) { - c = BufFileGet (f); - if (c == BUFFILEEOF) - break; - *b++ = c; - } - return n - cnt - 1; -} - -int -BufFileWrite (BufFilePtr f, char *b, int n) -{ - int cnt; - cnt = n; - while (cnt--) { - if (BufFilePut (*b++, f) == BUFFILEEOF) - return BUFFILEEOF; - } - return n; -} - -int -BufFileFlush (BufFilePtr f, int doClose) -{ - if (f->bufp != f->buffer) - return (*f->output) (BUFFILEEOF, f); - return 0; -} - -int -BufFileClose (BufFilePtr f, int doClose) -{ - int ret; - ret = (*f->close) (f, doClose); - xfree (f); - return ret; -} - -void -BufFileFree (BufFilePtr f) -{ - xfree (f); -} diff --git a/nx-X11/lib/font/fontfile/decompress.c b/nx-X11/lib/font/fontfile/decompress.c deleted file mode 100644 index c7e649f91..000000000 --- a/nx-X11/lib/font/fontfile/decompress.c +++ /dev/null @@ -1,415 +0,0 @@ -/* $Xorg: decompress.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ -/* - * Copyright 1985, 1986 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * James A. Woods, derived from original work by Spencer Thomas - * and Joseph Orost. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* - -Copyright 1993, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/decompress.c,v 1.4 2001/01/17 19:43:29 dawes Exp $ */ -/* - * decompress - cat a compressed file - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -#define BITS 16 - -/* - * a code_int must be able to hold 2**BITS values of type int, and also -1 - */ -#if BITS > 15 -typedef long int code_int; -#else -typedef int code_int; -#endif - -typedef long int count_int; - -#ifdef NO_UCHAR - typedef char char_type; -#else - typedef unsigned char char_type; -#endif /* UCHAR */ - -static char_type magic_header[] = { "\037\235" }; /* 1F 9D */ - -/* Defines for third byte of header */ -#define BIT_MASK 0x1f -#define BLOCK_MASK 0x80 -/* Masks 0x40 and 0x20 are free. I think 0x20 should mean that there is - a fourth header byte (for expansion). -*/ - -#define INIT_BITS 9 /* initial number of bits/code */ - -#ifdef COMPATIBLE /* But wrong! */ -# define MAXCODE(n_bits) (1 << (n_bits) - 1) -#else -# define MAXCODE(n_bits) ((1 << (n_bits)) - 1) -#endif /* COMPATIBLE */ - -/* - * the next two codes should not be changed lightly, as they must not - * lie within the contiguous general code space. - */ -#define FIRST 257 /* first free entry */ -#define CLEAR 256 /* table clear output code */ - -#define STACK_SIZE 65300 - -typedef struct _compressedFILE { - BufFilePtr file; - - char_type *stackp; - code_int oldcode; - char_type finchar; - - int block_compress; - int maxbits; - code_int maxcode, maxmaxcode; - - code_int free_ent; - int clear_flg; - int n_bits; - - /* bit buffer */ - int offset, size; - char_type buf[BITS]; - - char_type de_stack[STACK_SIZE]; - char_type *tab_suffix; - unsigned short *tab_prefix; -} CompressedFile; - - -static int hsize_table[] = { - 5003, /* 12 bits - 80% occupancy */ - 9001, /* 13 bits - 91% occupancy */ - 18013, /* 14 bits - 91% occupancy */ - 35023, /* 15 bits - 94% occupancy */ - 69001 /* 16 bits - 95% occupancy */ -}; - -static int BufCompressedClose ( BufFilePtr f, int doClose ); -static int BufCompressedFill ( BufFilePtr f ); -static code_int getcode ( CompressedFile *file ); -static int BufCompressedSkip ( BufFilePtr f, int bytes ); - -BufFilePtr -BufFilePushCompressed (BufFilePtr f) -{ - int code; - int maxbits; - int hsize; - CompressedFile *file; - int extra; - - if ((BufFileGet(f) != (magic_header[0] & 0xFF)) || - (BufFileGet(f) != (magic_header[1] & 0xFF))) - { - return 0; - } - code = BufFileGet (f); - if (code == BUFFILEEOF) return 0; - - maxbits = code & BIT_MASK; - if (maxbits > BITS || maxbits < 12) - return 0; - hsize = hsize_table[maxbits - 12]; - extra = (1 << maxbits) * sizeof (char_type) + - hsize * sizeof (unsigned short); - file = (CompressedFile *) xalloc (sizeof (CompressedFile) + extra); - if (!file) - return 0; - file->file = f; - file->maxbits = maxbits; - file->block_compress = code & BLOCK_MASK; - file->maxmaxcode = 1 << file->maxbits; - file->tab_suffix = (char_type *) &file[1]; - file->tab_prefix = (unsigned short *) (file->tab_suffix + file->maxmaxcode); - /* - * As above, initialize the first 256 entries in the table. - */ - file->maxcode = MAXCODE(file->n_bits = INIT_BITS); - for ( code = 255; code >= 0; code-- ) { - file->tab_prefix[code] = 0; - file->tab_suffix[code] = (char_type) code; - } - file->free_ent = ((file->block_compress) ? FIRST : 256 ); - file->oldcode = -1; - file->clear_flg = 0; - file->offset = 0; - file->size = 0; - file->stackp = file->de_stack; - bzero(file->buf, BITS); - return BufFileCreate ((char *) file, - BufCompressedFill, - 0, - BufCompressedSkip, - BufCompressedClose); -} - -static int -BufCompressedClose (BufFilePtr f, int doClose) -{ - CompressedFile *file; - BufFilePtr raw; - - file = (CompressedFile *) f->private; - raw = file->file; - xfree (file); - BufFileClose (raw, doClose); - return 1; -} - -static int -BufCompressedFill (BufFilePtr f) -{ - CompressedFile *file; - register char_type *stackp, *de_stack; - register char_type finchar; - register code_int code, oldcode, incode; - BufChar *buf, *bufend; - - file = (CompressedFile *) f->private; - - buf = f->buffer; - bufend = buf + BUFFILESIZE; - stackp = file->stackp; - de_stack = file->de_stack; - finchar = file->finchar; - oldcode = file->oldcode; - while (buf < bufend) { - while (stackp > de_stack && buf < bufend) - *buf++ = *--stackp; - - if (buf == bufend) - break; - - code = getcode (file); - if (code == -1) - break; - - if ( (code == CLEAR) && file->block_compress ) { - for ( code = 255; code >= 0; code-- ) - file->tab_prefix[code] = 0; - file->clear_flg = 1; - file->free_ent = FIRST; - oldcode = -1; - continue; - } - incode = code; - /* - * Special case for KwKwK string. - */ - if ( code >= file->free_ent ) { - if ( code > file->free_ent || oldcode == -1 ) { - /* Bad stream. */ - return BUFFILEEOF; - } - *stackp++ = finchar; - code = oldcode; - } - /* - * The above condition ensures that code < free_ent. - * The construction of tab_prefixof in turn guarantees that - * each iteration decreases code and therefore stack usage is - * bound by 1 << BITS - 256. - */ - - /* - * Generate output characters in reverse order - */ - while ( code >= 256 ) - { - *stackp++ = file->tab_suffix[code]; - code = file->tab_prefix[code]; - } - finchar = file->tab_suffix[code]; - *stackp++ = finchar; - - /* - * Generate the new entry. - */ - if ( (code=file->free_ent) < file->maxmaxcode && oldcode != -1) { - file->tab_prefix[code] = (unsigned short)oldcode; - file->tab_suffix[code] = finchar; - file->free_ent = code+1; - } - /* - * Remember previous code. - */ - oldcode = incode; - } - file->oldcode = oldcode; - file->stackp = stackp; - file->finchar = finchar; - if (buf == f->buffer) { - f->left = 0; - return BUFFILEEOF; - } - f->bufp = f->buffer + 1; - f->left = (buf - f->buffer) - 1; - return f->buffer[0]; -} - -/***************************************************************** - * TAG( getcode ) - * - * Read one code from the standard input. If BUFFILEEOF, return -1. - * Inputs: - * stdin - * Outputs: - * code or -1 is returned. - */ - -static char_type rmask[9] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; - -static code_int -getcode(CompressedFile *file) -{ - register code_int code; - register int r_off, bits; - register char_type *bp = file->buf; - register BufFilePtr raw; - - if ( file->clear_flg > 0 || file->offset >= file->size || - file->free_ent > file->maxcode ) - { - /* - * If the next entry will be too big for the current code - * size, then we must increase the size. This implies reading - * a new buffer full, too. - */ - if ( file->free_ent > file->maxcode ) { - file->n_bits++; - if ( file->n_bits == file->maxbits ) - file->maxcode = file->maxmaxcode; /* won't get any bigger now */ - else - file->maxcode = MAXCODE(file->n_bits); - } - if ( file->clear_flg > 0) { - file->maxcode = MAXCODE (file->n_bits = INIT_BITS); - file->clear_flg = 0; - } - bits = file->n_bits; - raw = file->file; - while (bits > 0 && (code = BufFileGet (raw)) != BUFFILEEOF) - { - *bp++ = code; - --bits; - } - bp = file->buf; - if (bits == file->n_bits) - return -1; /* end of file */ - file->size = file->n_bits - bits; - file->offset = 0; - /* Round size down to integral number of codes */ - file->size = (file->size << 3) - (file->n_bits - 1); - } - r_off = file->offset; - bits = file->n_bits; - /* - * Get to the first byte. - */ - bp += (r_off >> 3); - r_off &= 7; - /* Get first part (low order bits) */ -#ifdef NO_UCHAR - code = ((*bp++ >> r_off) & rmask[8 - r_off]) & 0xff; -#else - code = (*bp++ >> r_off); -#endif /* NO_UCHAR */ - bits -= (8 - r_off); - r_off = 8 - r_off; /* now, offset into code word */ - /* Get any 8 bit parts in the middle (<=1 for up to 16 bits). */ - if ( bits >= 8 ) { -#ifdef NO_UCHAR - code |= (*bp++ & 0xff) << r_off; -#else - code |= *bp++ << r_off; -#endif /* NO_UCHAR */ - r_off += 8; - bits -= 8; - } - /* high order bits. */ - code |= (*bp & rmask[bits]) << r_off; - file->offset += file->n_bits; - - return code; -} - -static int -BufCompressedSkip (BufFilePtr f, int bytes) -{ - int c; - while (bytes--) - { - c = BufFileGet(f); - if (c == BUFFILEEOF) - return BUFFILEEOF; - } - return 0; -} - -#ifdef TEST -int -main (int argc, char *argv[]) -{ - BufFilePtr inputraw, input, output; - int c; - - inputraw = BufFileOpenRead (0); - input = BufFilePushCompressed (inputraw); - output = BufFileOpenWrite (1); - while ((c = BufFileGet (input)) != BUFFILEEOF) - BufFilePut (c, output); - BufFileClose (input, FALSE); - BufFileClose (output, FALSE); - return 0; -} -#endif diff --git a/nx-X11/lib/font/fontfile/defaults.c b/nx-X11/lib/font/fontfile/defaults.c deleted file mode 100644 index 7f20cab67..000000000 --- a/nx-X11/lib/font/fontfile/defaults.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $Xorg: defaults.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/defaults.c,v 1.7 2001/01/17 19:43:29 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -#ifndef DEFAULT_BIT_ORDER -#ifdef BITMAP_BIT_ORDER -#define DEFAULT_BIT_ORDER BITMAP_BIT_ORDER -#else -#define DEFAULT_BIT_ORDER MSBFirst -#endif -#endif - -#ifndef DEFAULT_BYTE_ORDER -#ifdef IMAGE_BYTE_ORDER -#define DEFAULT_BYTE_ORDER IMAGE_BYTE_ORDER -#else -#define DEFAULT_BYTE_ORDER MSBFirst -#endif -#endif - -#ifndef DEFAULT_GLYPH_PAD -#ifdef GLYPHPADBYTES -#define DEFAULT_GLYPH_PAD GLYPHPADBYTES -#else -#define DEFAULT_GLYPH_PAD 4 -#endif -#endif - -#ifndef DEFAULT_SCAN_UNIT -#define DEFAULT_SCAN_UNIT 1 -#endif - -#include - -void -FontDefaultFormat (int *bit, int *byte, int *glyph, int *scan) -{ - *bit = DEFAULT_BIT_ORDER; - *byte = DEFAULT_BYTE_ORDER; - *glyph = DEFAULT_GLYPH_PAD; - *scan = DEFAULT_SCAN_UNIT; -} diff --git a/nx-X11/lib/font/fontfile/dirfile.c b/nx-X11/lib/font/fontfile/dirfile.c deleted file mode 100644 index 3a2fead81..000000000 --- a/nx-X11/lib/font/fontfile/dirfile.c +++ /dev/null @@ -1,495 +0,0 @@ -/* $Xorg: dirfile.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/dirfile.c,v 3.17 2004/02/08 01:52:27 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -/* - * dirfile.c - * - * Read fonts.dir and fonts.alias files - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include - -static Bool AddFileNameAliases ( FontDirectoryPtr dir ); -static int ReadFontAlias ( char *directory, Bool isFile, - FontDirectoryPtr *pdir ); -static int lexAlias ( FILE *file, char **lexToken ); -static int lexc ( FILE *file ); - -int -FontFileReadDirectory (char *directory, FontDirectoryPtr *pdir) -{ - char file_name[MAXFONTFILENAMELEN]; - char font_name[MAXFONTNAMELEN]; - char dir_file[MAXFONTFILENAMELEN]; - char dir_path[MAXFONTFILENAMELEN]; - char *ptr; - FILE *file; - int count, - i, - status; - struct stat statb; - static char format[24] = ""; - - FontDirectoryPtr dir = NullFontDirectory; - - if (strlen(directory) + 1 + sizeof(FontDirFile) > sizeof(dir_file)) - return BadFontPath; - - /* Check for font directory attributes */ -#if !defined(__UNIXOS2__) && !defined(WIN32) - if ((ptr = strchr(directory, ':'))) { -#else - /* OS/2 and WIN32 path might start with a drive letter, don't clip this */ - if ((ptr = strchr(directory+2, ':'))) { -#endif - strncpy(dir_path, directory, ptr - directory); - dir_path[ptr - directory] = '\0'; - } else { - strcpy(dir_path, directory); - } - strcpy(dir_file, dir_path); - if (dir_file[strlen(dir_file) - 1] != '/') - strcat(dir_file, "/"); - strcat(dir_file, FontDirFile); - file = fopen(dir_file, "rt"); - if (file) { - Bool found_font = FALSE; - -#ifndef WIN32 - if (fstat (fileno(file), &statb) == -1) -#else - if (stat (dir_file, &statb) == -1) -#endif - { - fclose(file); - return BadFontPath; - } - count = fscanf(file, "%d\n", &i); - if ((count == EOF) || (count != 1)) { - fclose(file); - return BadFontPath; - } - dir = FontFileMakeDir(directory, i); - if (dir == NULL) { - fclose(file); - return BadFontPath; - } - dir->dir_mtime = statb.st_mtime; - if (format[0] == '\0') - sprintf(format, "%%%ds %%%d[^\n]\n", - MAXFONTFILENAMELEN-1, MAXFONTNAMELEN-1); - - while ((count = fscanf(file, format, file_name, font_name)) != EOF) { -#if defined(__UNIXOS2__) || defined(WIN32) - /* strip any existing trailing CR */ - for (i=0; idirectory) + sizeof(FontDirFile) > sizeof(dir_file)) - return FALSE; - - strcpy (dir_file, dir->directory); - strcat (dir_file, FontDirFile); - if (stat (dir_file, &statb) == -1) - { - if (errno != ENOENT || dir->dir_mtime != 0) - return TRUE; - return FALSE; /* doesn't exist and never did: no change */ - } - if (dir->dir_mtime != statb.st_mtime) - return TRUE; - strcpy (dir_file, dir->directory); - strcat (dir_file, FontAliasFile); - if (stat (dir_file, &statb) == -1) - { - if (errno != ENOENT || dir->alias_mtime != 0) - return TRUE; - return FALSE; /* doesn't exist and never did: no change */ - } - if (dir->alias_mtime != statb.st_mtime) - return TRUE; - return FALSE; -} - -/* - * Make each of the file names an automatic alias for each of the files. - */ - -static Bool -AddFileNameAliases(FontDirectoryPtr dir) -{ - int i; - char copy[MAXFONTFILENAMELEN]; - char *fileName; - FontTablePtr table; - FontRendererPtr renderer; - int len; - FontNameRec name; - - table = &dir->nonScalable; - for (i = 0; i < table->used; i++) { - if (table->entries[i].type != FONT_ENTRY_BITMAP) - continue; - fileName = table->entries[i].u.bitmap.fileName; - renderer = FontFileMatchRenderer (fileName); - if (!renderer) - continue; - - len = strlen (fileName) - renderer->fileSuffixLen; - if (len >= sizeof(copy)) - continue; - CopyISOLatin1Lowered (copy, fileName, len); - copy[len] = '\0'; - name.name = copy; - name.length = len; - name.ndashes = FontFileCountDashes (copy, len); - - if (!FontFileFindNameInDir(table, &name)) { - if (!FontFileAddFontAlias (dir, copy, table->entries[i].name.name)) - return FALSE; - } - } - return TRUE; -} - -/* - * parse the font.alias file. Format is: - * - * alias font-name - * - * To imbed white-space in an alias name, enclose it like "font name" - * in double quotes. \ escapes and character, so - * "font name \"With Double Quotes\" \\ and \\ back-slashes" - * works just fine. - * - * A line beginning with a ! denotes a newline-terminated comment. - */ - -/* - * token types - */ - -#define NAME 0 -#define NEWLINE 1 -#define DONE 2 -#define EALLOC 3 - -static int -ReadFontAlias(char *directory, Bool isFile, FontDirectoryPtr *pdir) -{ - char alias[MAXFONTNAMELEN]; - char font_name[MAXFONTNAMELEN]; - char alias_file[MAXFONTFILENAMELEN]; - FILE *file; - FontDirectoryPtr dir; - int token; - char *lexToken; - int status = Successful; - struct stat statb; - - if (strlen(directory) >= sizeof(alias_file)) - return BadFontPath; - dir = *pdir; - strcpy(alias_file, directory); - if (!isFile) { - if (strlen(directory) + 1 + sizeof(FontAliasFile) > sizeof(alias_file)) - return BadFontPath; - if (directory[strlen(directory) - 1] != '/') - strcat(alias_file, "/"); - strcat(alias_file, FontAliasFile); - } - file = fopen(alias_file, "rt"); - if (!file) - return ((errno == ENOENT) ? Successful : BadFontPath); - if (!dir) - *pdir = dir = FontFileMakeDir(directory, 10); - if (!dir) - { - fclose (file); - return AllocError; - } -#ifndef WIN32 - if (fstat (fileno (file), &statb) == -1) -#else - if (stat (alias_file, &statb) == -1) -#endif - { - fclose (file); - return BadFontPath; - } - dir->alias_mtime = statb.st_mtime; - while (status == Successful) { - token = lexAlias(file, &lexToken); - switch (token) { - case NEWLINE: - break; - case DONE: - fclose(file); - return Successful; - case EALLOC: - status = AllocError; - break; - case NAME: - if (strlen(lexToken) >= sizeof(alias)) { - status = BadFontPath; - break; - } - strcpy(alias, lexToken); - token = lexAlias(file, &lexToken); - switch (token) { - case NEWLINE: - if (strcmp(alias, "FILE_NAMES_ALIASES")) - status = BadFontPath; - else if (!AddFileNameAliases(dir)) - status = AllocError; - break; - case DONE: - status = BadFontPath; - break; - case EALLOC: - status = AllocError; - break; - case NAME: - if (strlen(lexToken) >= sizeof(font_name)) { - status = BadFontPath; - break; - } - CopyISOLatin1Lowered(alias, alias, strlen(alias)); - CopyISOLatin1Lowered(font_name, lexToken, strlen(lexToken)); - if (!FontFileAddFontAlias (dir, alias, font_name)) - status = AllocError; - break; - } - } - } - fclose(file); - return status; -} - -#define QUOTE 0 -#define WHITE 1 -#define NORMAL 2 -#define END 3 -#define NL 4 -#define BANG 5 - -static int charClass; - -static int -lexAlias(FILE *file, char **lexToken) -{ - int c; - char *t; - enum state { - Begin, Normal, Quoted, Comment - } state; - int count; - - static char *tokenBuf = (char *) NULL; - static int tokenSize = 0; - - t = tokenBuf; - count = 0; - state = Begin; - for (;;) { - if (count == tokenSize) { - int nsize; - char *nbuf; - - if (tokenSize >= (INT_MAX >> 2)) - /* Stop before we overflow */ - return EALLOC; - nsize = tokenSize ? (tokenSize << 1) : 64; - nbuf = (char *) xrealloc(tokenBuf, nsize); - if (!nbuf) - return EALLOC; - tokenBuf = nbuf; - tokenSize = nsize; - t = tokenBuf + count; - } - c = lexc(file); - switch (charClass) { - case QUOTE: - switch (state) { - case Begin: - case Normal: - state = Quoted; - break; - case Quoted: - state = Normal; - break; - case Comment: - break; - } - break; - case WHITE: - switch (state) { - case Begin: - case Comment: - continue; - case Normal: - *t = '\0'; - *lexToken = tokenBuf; - return NAME; - case Quoted: - break; - } - /* fall through */ - case NORMAL: - switch (state) { - case Begin: - state = Normal; - break; - case Comment: - continue; - default: - break; - } - *t++ = c; - ++count; - break; - case END: - case NL: - switch (state) { - case Begin: - case Comment: - *lexToken = (char *) NULL; - return charClass == END ? DONE : NEWLINE; - default: - *t = '\0'; - *lexToken = tokenBuf; - ungetc(c, file); - return NAME; - } - break; - case BANG: - switch (state) { - case Begin: - state = Comment; - break; - case Comment: - break; - default: - *t++ = c; - ++count; - } - break; - } - } -} - -static int -lexc(FILE *file) -{ - int c; - - c = getc(file); - switch (c) { - case EOF: - charClass = END; - break; - case '\\': - c = getc(file); - if (c == EOF) - charClass = END; - else - charClass = NORMAL; - break; - case '"': - charClass = QUOTE; - break; - case ' ': - case '\t': - charClass = WHITE; - break; - case '\r': - case '\n': - charClass = NL; - break; - case '!': - charClass = BANG; - break; - default: - charClass = NORMAL; - break; - } - return c; -} diff --git a/nx-X11/lib/font/fontfile/encparse.c b/nx-X11/lib/font/fontfile/encparse.c deleted file mode 100644 index 6262aff07..000000000 --- a/nx-X11/lib/font/fontfile/encparse.c +++ /dev/null @@ -1,966 +0,0 @@ -/* -Copyright (c) 1998-2001 by Juliusz Chroboczek - -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. -*/ - -/* $XFree86: xc/lib/font/fontfile/encparse.c,v 1.20tsi Exp $ */ - -/* Parser for encoding files */ - -/* This code assumes that we are using ASCII. We don't use the ctype - functions, as they depend on the current locale. On the other - hand, we do use strcasecmp, but only on strings that we've checked - to be pure ASCII. Bloody ``Code Set Independence''. */ - -#include -#include - -#if defined(__SCO__) || defined(__UNIXWARE__) -#include -#endif - -#ifndef FONTENC_NO_LIBFONT - -#include -#include - -#else - -#include -#define xalloc(n) malloc(n) -#define xrealloc(p, n) realloc(p, n) -#define xfree(p) free(p) - -#include "zlib.h" -typedef gzFile FontFilePtr; -#define FontFileGetc(f) gzgetc(f) -#define FontFileOpen(filename) gzopen(filename, "rb") -#define FontFileClose(f) gzclose(f) - -#define MAXFONTFILENAMELEN 1024 -#define MAXFONTNAMELEN 1024 - -#endif - -#include -#include "fontencI.h" - -#define MAXALIASES 20 - -#define EOF_TOKEN -1 -#define ERROR_TOKEN -2 -#define EOL_TOKEN 0 -#define NUMBER_TOKEN 1 -#define KEYWORD_TOKEN 2 - -#define EOF_LINE -1 -#define ERROR_LINE -2 -#define STARTENCODING_LINE 1 -#define STARTMAPPING_LINE 2 -#define ENDMAPPING_LINE 3 -#define CODE_LINE 4 -#define CODE_RANGE_LINE 5 -#define CODE_UNDEFINE_LINE 6 -#define NAME_LINE 7 -#define SIZE_LINE 8 -#define ALIAS_LINE 9 -#define FIRSTINDEX_LINE 10 - -/* Return from lexer */ -#define MAXKEYWORDLEN 100 - -static long number_value; -static char keyword_value[MAXKEYWORDLEN+1]; - -static long value1, value2, value3; - -/* Lexer code */ - -/* Skip to the beginning of new line */ -static void -skipEndOfLine(FontFilePtr f, int c) -{ - if(c == 0) - c = FontFileGetc(f); - - for(;;) - if(c <= 0 || c == '\n') - return; - else - c = FontFileGetc(f); -} - -/* Get a number; we're at the first digit. */ -static unsigned -getnum(FontFilePtr f, int c, int *cp) -{ - unsigned n = 0; - int base = 10; - - /* look for `0' or `0x' prefix */ - if(c == '0') { - c = FontFileGetc(f); - base = 8; - if(c == 'x' || c == 'X') { - base = 16; - c = FontFileGetc(f); - } - } - - /* accumulate digits */ - for(;;) { - if ('0' <= c && c <= '9') { - n *= base; n += c - '0'; - } else if('a' <= c && c <= 'f') { - n *= base; n += c - 'a' + 10; - } else if('A' <=c && c <= 'F') { - n *= base; n += c - 'A' + 10; - } else - break; - c = FontFileGetc(f); - } - - *cp = c; return n; -} - -/* Skip to beginning of new line; return 1 if only whitespace was found. */ -static int -endOfLine(FontFilePtr f, int c) -{ - if(c == 0) - c = FontFileGetc(f); - - for(;;) { - if(c <= 0 || c == '\n') - return 1; - else if(c == '#') { - skipEndOfLine(f,c); - return 1; - } - else if(c == ' ' || c == '\t') { - skipEndOfLine(f,c); - return 0; - } - c = FontFileGetc(f); - } -} - -/* Get a token; we're at first char */ -static int -gettoken(FontFilePtr f, int c, int *cp) -{ - char *p; - - if(c <= 0) - c = FontFileGetc(f); - - if(c <= 0) { - return EOF_TOKEN; - } - - while(c == ' ' || c == '\t') - c = FontFileGetc(f); - - if(c=='\n') { - return EOL_TOKEN; - } else if(c == '#') { - skipEndOfLine(f,c); - return EOL_TOKEN; - } else if(c >= '0' && c <= '9') { - number_value = getnum(f,c,cp); - return NUMBER_TOKEN; - } else if((c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z') || - c == '/' || c == '_' || c == '-' || c == '.') { - p = keyword_value; - *p++ = c; - while(p-keyword_value < MAXKEYWORDLEN) { - c = FontFileGetc(f); - if(c <= ' ' || c > '~' || c == '#') - break; - *p++ = c; - } - *cp = c; - *p = '\0'; - return KEYWORD_TOKEN; - } else { - *cp = c; - return ERROR_TOKEN; - } -} - -/* Parse a line. - * Always skips to the beginning of a new line, even if an error occurs */ -static int -getnextline(FontFilePtr f) -{ - int c, token; - c = FontFileGetc(f); - if(c <= 0) - return EOF_LINE; - - again: - token=gettoken(f,c,&c); - - switch(token) { - case EOF_TOKEN: - return EOF_LINE; - case EOL_TOKEN: - /* empty line */ - c = FontFileGetc(f); - goto again; - case NUMBER_TOKEN: - value1 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value2 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value3 = number_value; - return CODE_RANGE_LINE; - case EOL_TOKEN: - return CODE_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - case KEYWORD_TOKEN: - if(!endOfLine(f,c)) - return ERROR_LINE; - else - return NAME_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - case KEYWORD_TOKEN: - if(!strcasecmp(keyword_value, "STARTENCODING")) { - token = gettoken(f,c,&c); - if(token == KEYWORD_TOKEN) { - if(endOfLine(f,c)) - return STARTENCODING_LINE; - else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "ALIAS")) { - token = gettoken(f,c,&c); - if(token == KEYWORD_TOKEN) { - if(endOfLine(f,c)) - return ALIAS_LINE; - else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "SIZE")) { - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value1 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value2 = number_value; - return SIZE_LINE; - case EOL_TOKEN: - value2=0; - return SIZE_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "FIRSTINDEX")) { - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value1 = number_value; - token = gettoken(f,c,&c); - switch(token) { - case NUMBER_TOKEN: - value2 = number_value; - return FIRSTINDEX_LINE; - case EOL_TOKEN: - value2 = 0; - return FIRSTINDEX_LINE; - default: - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "STARTMAPPING")) { - keyword_value[0] = 0; - value1 = 0; value1 = 0; - /* first a keyword */ - token = gettoken(f,c,&c); - if(token != KEYWORD_TOKEN) { - skipEndOfLine(f, c); - return ERROR_LINE; - } - - /* optional first integer */ - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value1 = number_value; - } else if(token == EOL_TOKEN) { - return STARTMAPPING_LINE; - } else { - skipEndOfLine(f, c); - return ERROR_LINE; - } - - /* optional second integer */ - token = gettoken(f,c,&c); - if(token == NUMBER_TOKEN) { - value2 = number_value; - } else if(token == EOL_TOKEN) { - return STARTMAPPING_LINE; - } else { - skipEndOfLine(f, c); - return ERROR_LINE; - } - - if(!endOfLine(f,c)) - return ERROR_LINE; - else { - return STARTMAPPING_LINE; - } - } else if(!strcasecmp(keyword_value, "UNDEFINE")) { - /* first integer */ - token = gettoken(f,c,&c); - if(token != NUMBER_TOKEN) { - skipEndOfLine(f,c); - return ERROR_LINE; - } - value1 = number_value; - /* optional second integer */ - token = gettoken(f,c,&c); - if(token == EOL_TOKEN) { - value2 = value1; - return CODE_UNDEFINE_LINE; - } else if(token == NUMBER_TOKEN) { - value2 = number_value; - if(endOfLine(f,c)) { - return CODE_UNDEFINE_LINE; - } else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - } else if(!strcasecmp(keyword_value, "ENDENCODING")) { - if(endOfLine(f,c)) - return EOF_LINE; - else - return ERROR_LINE; - } else if(!strcasecmp(keyword_value, "ENDMAPPING")) { - if(endOfLine(f,c)) - return ENDMAPPING_LINE; - else - return ERROR_LINE; - } else { - skipEndOfLine(f,c); - return ERROR_LINE; - } - default: - return ERROR_LINE; - } -} - -static void -install_mapping(FontEncPtr encoding, FontMapPtr mapping) -{ - FontMapPtr m; - - if(encoding->mappings == NULL) - encoding->mappings = mapping; - else { - m = encoding->mappings; - while(m->next != NULL) - m = m->next; - m->next = mapping; - } - mapping->next = NULL; - mapping->encoding = encoding; -} - -static int -setCode(unsigned from, unsigned to, unsigned row_size, - unsigned *first, unsigned *last, - unsigned *encsize, unsigned short **enc) -{ - unsigned index, i; - unsigned short *newenc; - - if(from>0xFFFF) - return 0; /* success */ - - if(row_size==0) - index=from; - else { - if((value1 & 0xFF) >= row_size) - return 0; /* ignore out of range mappings */ - index = (from>>8) * row_size + (from&0xFF); - } - - /* Optimize away useless identity mappings. This is only expected - to be useful with linear encodings. */ - if(index == to && (index < *first || index > *last)) - return 0; - if(*encsize == 0) { - *encsize = (index < 256) ? 256 : 0x10000; - *enc = (unsigned short*)xalloc((*encsize) * sizeof(unsigned short)); - if(*enc == NULL) { - *encsize = 0; - return 1; - } - } else if(*encsize <= index) { - *encsize = 0x10000; - if((newenc = (unsigned short*)xrealloc(enc, *encsize))==NULL) - return 1; - *enc = newenc; - } - if(*first > *last) { - *first = *last = index; - } - if(index < *first) { - for(i = index; i < *first; i++) - (*enc)[i] = i; - *first = index; - } - if(index > *last) { - for(i = *last + 1; i <= index; i++) - (*enc)[i] = i; - *last = index; - } - (*enc)[index] = to; - return 0; -} - -/* Parser. If headerOnly is true, we're only interested in the - data contained in the encoding file's header. */ - -/* As font encodings are currently never freed, the allocations done - by this function are mostly its private business. Note, however, - that FontEncIdentify needs to free the header fields -- so if you - change this function, you may need to change FontEncIdentify. */ - -/* I want a garbage collector. */ - -static FontEncPtr -parseEncodingFile(FontFilePtr f, int headerOnly) -{ - int line; - - unsigned short *enc=NULL; - char **nam = NULL, **newnam; - unsigned i, first = 0xFFFF, last=0, encsize=0, namsize=0; - FontEncPtr encoding = NULL; - FontMapPtr mapping = NULL; - FontEncSimpleMapPtr sm; - FontEncSimpleNamePtr sn; - char *aliases[MAXALIASES]; - int numaliases=0; - -#if 0 - /* GCC complains about unused labels. Please fix GCC rather than - obfuscating my code. */ - no_encoding: -#endif - line = getnextline(f); - switch(line) { - case EOF_LINE: - goto error; - case STARTENCODING_LINE: - encoding = (FontEncPtr)xalloc(sizeof(FontEncRec)); - if(encoding == NULL) - goto error; - encoding->name = (char*)xalloc(strlen(keyword_value)+1); - if(encoding->name == NULL) - goto error; - strcpy(encoding->name, keyword_value); - encoding->size = 256; - encoding->row_size = 0; - encoding->mappings = NULL; - encoding->next = NULL; - encoding->first = encoding->first_col=0; - goto no_mapping; - default: - goto error; - } - - no_mapping: - line = getnextline(f); - switch(line) { - case EOF_LINE: goto done; - case ALIAS_LINE: - if(numaliases < MAXALIASES) { - aliases[numaliases] = (char*)xalloc(strlen(keyword_value)+1); - if(aliases[numaliases] == NULL) - goto error; - strcpy(aliases[numaliases], keyword_value); - numaliases++; - } - goto no_mapping; - case SIZE_LINE: - encoding->size = value1; - encoding->row_size = value2; - goto no_mapping; - case FIRSTINDEX_LINE: - encoding->first = value1; - encoding->first_col = value2; - goto no_mapping; - case STARTMAPPING_LINE: - if(headerOnly) - goto done; - if(!strcasecmp(keyword_value, "unicode")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); - if(mapping == NULL) - goto error; - mapping->type = FONT_ENCODING_UNICODE; - mapping->pid = 0; - mapping->eid = 0; - mapping->recode = 0; - mapping->name = 0; - mapping->client_data = 0; - mapping->next = 0; - goto mapping; - } else if(!strcasecmp(keyword_value, "cmap")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); - if(mapping == NULL) - goto error; - mapping->type = FONT_ENCODING_TRUETYPE; - mapping->pid = value1; - mapping->eid = value2; - mapping->recode = 0; - mapping->name = 0; - mapping->client_data = 0; - mapping->next = 0; - goto mapping; - } else if(!strcasecmp(keyword_value, "postscript")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); - if(mapping == NULL) - goto error; - mapping->type = FONT_ENCODING_POSTSCRIPT; - mapping->pid = 0; - mapping->eid = 0; - mapping->recode = 0; - mapping->name = 0; - mapping->client_data = 0; - mapping->next = 0; - goto string_mapping; - } else { /* unknown mapping type -- ignore */ - goto skipmapping; - } - /* NOTREACHED */ - goto error; - default: goto no_mapping; /* ignore unknown lines */ - } - - skipmapping: - line = getnextline(f); - switch(line) { - case ENDMAPPING_LINE: - goto no_mapping; - case EOF_LINE: - goto error; - default: - goto skipmapping; - } - - mapping: - line = getnextline(f); - switch(line) { - case EOF_LINE: goto error; - case ENDMAPPING_LINE: - mapping->recode = FontEncSimpleRecode; - mapping->name = FontEncUndefinedName; - mapping->client_data = sm = - (FontEncSimpleMapPtr)xalloc(sizeof(FontEncSimpleMapRec)); - if(sm == NULL) - goto error; - sm->row_size = encoding->row_size; - if(first <= last) { - sm->first = first; - sm->len=last-first+1; - sm->map = - (unsigned short*)xalloc(sm->len * sizeof(unsigned short)); - if(sm->map == NULL) { - xfree(sm); - mapping->client_data = sm = NULL; - goto error; - } - } else { - sm->first = 0; - sm->len = 0; - sm->map = 0; - } - for(i=0; i < sm->len; i++) - sm -> map[i] = enc[first+i]; - install_mapping(encoding, mapping); - mapping = 0; - first = 0xFFFF; last=0; - goto no_mapping; - - case CODE_LINE: - if(setCode(value1, value2, encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - goto mapping; - - case CODE_RANGE_LINE: - if(value1 > 0x10000) - value1 = 0x10000; - if(value2 > 0x10000) - value2 = 0x10000; - if(value2 < value1) - goto mapping; - /* Do the last value first to avoid having to realloc() */ - if(setCode(value2, value3+(value2-value1), encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - for(i=value1; irow_size, - &first, &last, &encsize, &enc)) - goto error; - } - goto mapping; - - case CODE_UNDEFINE_LINE: - if(value1 > 0x10000) - value1 = 0x10000; - if(value2 > 0x10000) - value2 = 0x10000; - if(value2 < value1) - goto mapping; - /* Do the last value first to avoid having to realloc() */ - if(setCode(value2, 0, encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - for(i = value1; i < value2; i++) { - if(setCode(i, 0, encoding->row_size, - &first, &last, &encsize, &enc)) - goto error; - } - goto mapping; - - default: goto mapping; /* ignore unknown lines */ - } - - string_mapping: - line = getnextline(f); - switch(line) { - case EOF_LINE: goto error; - case ENDMAPPING_LINE: - mapping->recode = FontEncUndefinedRecode; - mapping->name = FontEncSimpleName; - mapping->client_data = sn = - (FontEncSimpleNamePtr)xalloc(sizeof(FontEncSimpleNameRec)); - if(sn == NULL) - goto error; - if(first > last) { - xfree(sn); - mapping->client_data = sn = NULL; - goto error; - } - sn->first = first; - sn->len = last - first + 1; - sn->map = (char**)xalloc(sn->len*sizeof(char*)); - if(sn->map == NULL) { - xfree(sn); - mapping->client_data = sn = NULL; - goto error; - } - for(i = 0; i < sn->len; i++) - sn->map[i] = nam[first+i]; - install_mapping(encoding,mapping); - mapping = 0; - first = 0xFFFF; last=0; - goto no_mapping; - case NAME_LINE: - if(value1 >= 0x10000) goto string_mapping; - if(namsize == 0) { - namsize = (value1) < 256 ? 256 : 0x10000; - nam = (char**)xalloc(namsize * sizeof(char*)); - if(nam == NULL) { - namsize=0; - goto error; - } - } else if(namsize <= value1) { - namsize = 0x10000; - if((newnam = (char**)xrealloc(nam, namsize)) == NULL) - goto error; - nam = newnam; - } - if(first > last) { - first = last = value1; - } - if(value1 < first) { - for(i = value1; i < first; i++) - nam[i] = NULL; - first = value1; - } - if(value1 > last) { - for(i=last+1; i <= value1; i++) - nam[i]=NULL; - last = value1; - } - nam[value1] = (char*)xalloc(strlen(keyword_value)+1); - if(nam[value1] == NULL) { - goto error; - } - strcpy(nam[value1], keyword_value); - goto string_mapping; - - default: goto string_mapping; /* ignore unknown lines */ - } - - done: - if(encsize) xfree(enc); encsize=0; enc = NULL; - if(namsize) xfree(nam); namsize=0; nam = NULL; /* don't free entries! */ - - encoding->aliases=NULL; - if(numaliases) { - encoding->aliases = (char**)xalloc((numaliases+1)*sizeof(char*)); - if(encoding->aliases == NULL) - goto error; - for(i=0; ialiases[i] = aliases[i]; - encoding->aliases[numaliases]=NULL; - } - - return encoding; - -error: - if(encsize) xfree(enc); encsize=0; - if(namsize) { - for(i = first; i <= last; i++) - if(nam[i]) - xfree(nam[i]); - xfree(nam); - namsize = 0; - } - if(mapping) { - if(mapping->client_data) xfree(mapping->client_data); - xfree(mapping); - } - if(encoding) { - if(encoding->name) xfree(encoding->name); - for(mapping = encoding->mappings; mapping; mapping = mapping->next) { - if(mapping->client_data) xfree(mapping->client_data); - xfree(mapping); - } - xfree(encoding); - } - for(i = 0; i < numaliases; i++) - xfree(aliases[i]); - /* We don't need to free sn and sm as they handled locally in the body.*/ - return 0; -} - -char* -FontEncDirectory() -{ - static char* dir = NULL; - - if(dir == NULL) { - char *c = getenv("FONT_ENCODINGS_DIRECTORY"); - if(c) { - dir = malloc(strlen(c) + 1); - if(!dir) - return NULL; - strcpy(dir, c); - } else { - dir = FONT_ENCODINGS_DIRECTORY; - } - } - return dir; -} - -static void -parseFontFileName(const char *fontFileName, char *buf, char *dir) -{ - const char *p; - char *q, *lastslash; - - for(p = fontFileName, q = dir, lastslash = NULL; *p; p++, q++) { - *q = *p; - if(*p == '/') - lastslash = q+1; - } - - if(!lastslash) - lastslash = dir; - - *lastslash = '\0'; - - if(buf && strlen(dir) + 14 < MAXFONTFILENAMELEN) { - strcpy(buf, dir); - strcat(buf, "encodings.dir"); - } -} - -static FontEncPtr -FontEncReallyReallyLoad(const char *charset, - const char *dirname, const char *dir) -{ - FontFilePtr f; - FILE *file; - FontEncPtr encoding; - char file_name[MAXFONTFILENAMELEN], encoding_name[MAXFONTNAMELEN], - buf[MAXFONTFILENAMELEN]; - int count, n; - static char format[24] = ""; - - /* As we don't really expect to open encodings that often, we don't - take the trouble of caching encodings directories. */ - - if((file = fopen(dirname, "r")) == NULL) { - return NULL; - } - - count = fscanf(file, "%d\n", &n); - if(count == EOF || count != 1) { - fclose(file); - return NULL; - } - - encoding = NULL; - if (!format[0]) { - sprintf(format, "%%%ds %%%d[^\n]\n", (int)sizeof(encoding_name) - 1, - (int)sizeof(file_name) - 1); - } - for(;;) { - count = fscanf(file, format, encoding_name, file_name); - if(count == EOF) - break; - if(count != 2) - break; - - if(!strcasecmp(encoding_name, charset)) { - /* Found it */ - if(file_name[0] != '/') { - if(strlen(dir) + strlen(file_name) >= MAXFONTFILENAMELEN) { - fclose(file); - return NULL; - } - strcpy(buf, dir); - strcat(buf, file_name); - } else { - strcpy(buf , file_name); - } - - f = FontFileOpen(buf); - if(f == NULL) { - fclose(file); - return NULL; - } - encoding = parseEncodingFile(f, 0); - FontFileClose(f); - break; - } - } - - fclose(file); - - return encoding; -} - -/* Parser ntrypoint -- used by FontEncLoad */ -FontEncPtr -FontEncReallyLoad(const char *charset, const char *fontFileName) -{ - FontEncPtr encoding; - char dir[MAXFONTFILENAMELEN], dirname[MAXFONTFILENAMELEN]; - char *d; - - if(fontFileName) { - parseFontFileName(fontFileName, dirname, dir); - encoding = FontEncReallyReallyLoad(charset, dirname, dir); - if(encoding) - return(encoding); - } - - d = FontEncDirectory(); - if(d) { - parseFontFileName(d, NULL, dir); - encoding = FontEncReallyReallyLoad(charset, d, dir); - return encoding; - } - - return NULL; -} - -/* Return a NULL-terminated array of encoding names. Note that this - * function has incestuous knowledge of the allocations done by - * parseEncodingFile. */ - -char ** -FontEncIdentify(const char *fileName) -{ - FontFilePtr f; - FontEncPtr encoding; - char **names, **name, **alias; - int numaliases; - - if((f = FontFileOpen(fileName))==NULL) { - return NULL; - } - encoding = parseEncodingFile(f, 1); - FontFileClose(f); - - if(!encoding) - return NULL; - - numaliases = 0; - if(encoding->aliases) - for(alias = encoding->aliases; *alias; alias++) - numaliases++; - - names = (char**)xalloc((numaliases+2)*sizeof(char*)); - if(names == NULL) { - if(encoding->aliases) - xfree(encoding->aliases); - xfree(encoding); - return NULL; - } - - name = names; - *(name++) = encoding->name; - if(numaliases > 0) - for(alias = encoding->aliases; *alias; alias++, name++) - *name = *alias; - - *name = 0; - xfree(encoding->aliases); - xfree(encoding); - - return names; -} diff --git a/nx-X11/lib/font/fontfile/ffcheck.c b/nx-X11/lib/font/fontfile/ffcheck.c deleted file mode 100644 index d3d121700..000000000 --- a/nx-X11/lib/font/fontfile/ffcheck.c +++ /dev/null @@ -1,171 +0,0 @@ -/* $Xorg: ffcheck.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/ffcheck.c,v 1.15tsi Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ -/* $NCDXorg: @(#)fontfile.c,v 1.6 1991/07/02 17:00:46 lemke Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#ifdef LOADABLEFONTS -#include -#endif - -/* - * Map FPE functions to renderer functions - */ - - -/* Here we must check the client to see if it has a context attached to - * it that allows us to access the printer fonts - */ - -static int -FontFileCheckOpenFont (pointer client, FontPathElementPtr fpe, Mask flags, - char *name, int namelen, - fsBitmapFormat format, fsBitmapFormatMask fmask, - XID id, FontPtr *pFont, char **aliasName, - FontPtr non_cachable_font) -{ - if (XpClientIsBitmapClient(client)) - return (FontFileOpenFont (client, fpe, flags, name, namelen, format, - fmask, id, pFont, aliasName, non_cachable_font)); - return BadFontName; -} - -static int -FontFileCheckListFonts (pointer client, FontPathElementPtr fpe, - char *pat, int len, int max, FontNamesPtr names) -{ - if (XpClientIsBitmapClient(client)) - return FontFileListFonts (client, fpe, pat, len, max, names); - return BadFontName; -} - -static int -FontFileCheckStartListFontsWithInfo(pointer client, FontPathElementPtr fpe, - char *pat, int len, int max, - pointer *privatep) -{ - if (XpClientIsBitmapClient(client)) - return FontFileStartListFontsWithInfo(client, fpe, pat, len, - max, privatep); - return BadFontName; -} - -static int -FontFileCheckListNextFontWithInfo(pointer client, FontPathElementPtr fpe, - char **namep, int *namelenp, - FontInfoPtr *pFontInfo, - int *numFonts, pointer private) -{ - if (XpClientIsBitmapClient(client)) - return FontFileListNextFontWithInfo(client, fpe, namep, namelenp, - pFontInfo, numFonts, private); - return BadFontName; -} - -static int -FontFileCheckStartListFontsAndAliases(pointer client, FontPathElementPtr fpe, - char *pat, int len, int max, - pointer *privatep) -{ - if (XpClientIsBitmapClient(client)) - return FontFileStartListFontsAndAliases(client, fpe, pat, len, - max, privatep); - return BadFontName; -} - -static int -FontFileCheckListNextFontOrAlias(pointer client, FontPathElementPtr fpe, - char **namep, int *namelenp, - char **resolvedp, int *resolvedlenp, - pointer private) -{ - if (XpClientIsBitmapClient(client)) - return FontFileListNextFontOrAlias(client, fpe, namep, namelenp, - resolvedp, resolvedlenp, private); - return BadFontName; -} - -void -FontFileCheckRegisterFpeFunctions (void) -{ -#ifndef LOADABLEFONTS - BitmapRegisterFontFileFunctions (); - - -#ifdef BUILD_SPEEDO - SpeedoRegisterFontFileFunctions (); -#endif -#ifdef BUILD_TYPE1 - Type1RegisterFontFileFunctions(); -#endif -#ifdef BUILD_CID - CIDRegisterFontFileFunctions(); -#endif -#ifdef BUILD_FREETYPE - FreeTypeRegisterFontFileFunctions(); -#endif - - -#else - - { - int i; - - if (FontModuleList) { - for (i = 0; FontModuleList[i].name; i++) { - if (FontModuleList[i].initFunc) - FontModuleList[i].initFunc(); - } - } - } -#endif - - RegisterFPEFunctions(FontFileNameCheck, - FontFileInitFPE, - FontFileFreeFPE, - FontFileResetFPE, - FontFileCheckOpenFont, - FontFileCloseFont, - FontFileCheckListFonts, - FontFileCheckStartListFontsWithInfo, - FontFileCheckListNextFontWithInfo, - NULL, - NULL, - NULL, - FontFileCheckStartListFontsAndAliases, - FontFileCheckListNextFontOrAlias, - FontFileEmptyBitmapSource); -} diff --git a/nx-X11/lib/font/fontfile/fileio.c b/nx-X11/lib/font/fontfile/fileio.c deleted file mode 100644 index a3f94640b..000000000 --- a/nx-X11/lib/font/fontfile/fileio.c +++ /dev/null @@ -1,90 +0,0 @@ -/* $Xorg: fileio.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/fileio.c,v 3.9 2001/12/14 19:56:51 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#ifndef O_BINARY -#define O_BINARY O_RDONLY -#endif - -FontFilePtr -FontFileOpen (const char *name) -{ - int fd; - int len; - BufFilePtr raw, cooked; - - fd = open (name, O_BINARY); - if (fd < 0) - return 0; - raw = BufFileOpenRead (fd); - if (!raw) - { - close (fd); - return 0; - } - len = strlen (name); -#ifndef __UNIXOS2__ - if (len > 2 && !strcmp (name + len - 2, ".Z")) { -#else - if (len > 2 && (!strcmp (name + len - 4, ".pcz") || - !strcmp (name + len - 2, ".Z"))) { -#endif - cooked = BufFilePushCompressed (raw); - if (!cooked) { - BufFileClose (raw, TRUE); - return 0; - } - raw = cooked; -#ifdef X_GZIP_FONT_COMPRESSION - } else if (len > 3 && !strcmp (name + len - 3, ".gz")) { - cooked = BufFilePushZIP (raw); - if (!cooked) { - BufFileClose (raw, TRUE); - return 0; - } - raw = cooked; -#endif - } - return (FontFilePtr) raw; -} - -int -FontFileClose (FontFilePtr f) -{ - return BufFileClose ((BufFilePtr) f, TRUE); -} - diff --git a/nx-X11/lib/font/fontfile/filewr.c b/nx-X11/lib/font/fontfile/filewr.c deleted file mode 100644 index d076f166a..000000000 --- a/nx-X11/lib/font/fontfile/filewr.c +++ /dev/null @@ -1,65 +0,0 @@ -/* $Xorg: filewr.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/filewr.c,v 3.6 2001/12/14 19:56:51 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -FontFilePtr -FontFileOpenWrite (const char *name) -{ - int fd; - -#if defined(WIN32) || defined(__UNIXOS2__) || defined(__CYGWIN__) - fd = open (name, O_CREAT|O_TRUNC|O_RDWR|O_BINARY, 0666); -#else - fd = creat (name, 0666); -#endif - if (fd < 0) - return 0; - return (FontFilePtr) BufFileOpenWrite (fd); -} - -FontFilePtr -FontFileOpenWriteFd (int fd) -{ - return (FontFilePtr) BufFileOpenWrite (fd); -} - -FontFilePtr -FontFileOpenFd (int fd) -{ - return (FontFilePtr) BufFileOpenRead (fd); -} diff --git a/nx-X11/lib/font/fontfile/fontdir.c b/nx-X11/lib/font/fontfile/fontdir.c deleted file mode 100644 index 899ff05ef..000000000 --- a/nx-X11/lib/font/fontfile/fontdir.c +++ /dev/null @@ -1,832 +0,0 @@ -/* $XdotOrg: xc/lib/font/fontfile/fontdir.c,v 1.6 2005/11/14 20:40:42 ajax Exp $ */ -/* $Xorg: fontdir.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/fontdir.c,v 3.22 2003/07/07 16:40:11 eich Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -#if HAVE_STDINT_H -#include -#elif !defined(INT32_MAX) -#define INT32_MAX 0x7fffffff -#endif - -Bool -FontFileInitTable (FontTablePtr table, int size) -{ - if (size < 0 || (size > INT32_MAX/sizeof(FontEntryRec))) - return FALSE; - if (size) - { - table->entries = (FontEntryPtr) xalloc(sizeof(FontEntryRec) * size); - if (!table->entries) - return FALSE; - } - else - table->entries = 0; - table->used = 0; - table->size = size; - table->sorted = FALSE; - return TRUE; -} - -void -FontFileFreeEntry (FontEntryPtr entry) -{ - FontScalableExtraPtr extra; - int i; - - if (entry->name.name) - xfree(entry->name.name); - entry->name.name = NULL; - - switch (entry->type) - { - case FONT_ENTRY_SCALABLE: - xfree (entry->u.scalable.fileName); - extra = entry->u.scalable.extra; - for (i = 0; i < extra->numScaled; i++) - if (extra->scaled[i].vals.ranges) - xfree (extra->scaled[i].vals.ranges); - xfree (extra->scaled); - xfree (extra); - break; - case FONT_ENTRY_BITMAP: - xfree (entry->u.bitmap.fileName); - entry->u.bitmap.fileName = NULL; - break; - case FONT_ENTRY_ALIAS: - xfree (entry->u.alias.resolved); - entry->u.alias.resolved = NULL; - break; -#ifdef NOTYET - case FONT_ENTRY_BC: - break; -#endif - } -} - -void -FontFileFreeTable (FontTablePtr table) -{ - int i; - - for (i = 0; i < table->used; i++) - FontFileFreeEntry (&table->entries[i]); - xfree (table->entries); -} - -FontDirectoryPtr -FontFileMakeDir(char *dirName, int size) -{ - FontDirectoryPtr dir; - int dirlen; - int needslash = 0; - char *attrib; - int attriblen; - -#if !defined(__UNIXOS2__) && !defined(WIN32) - attrib = strchr(dirName, ':'); -#else - /* OS/2 uses the colon in the drive letter descriptor, skip this */ - attrib = strchr(dirName+2, ':'); -#endif - if (attrib) { - dirlen = attrib - dirName; - attriblen = strlen(attrib); - } else { - dirlen = strlen(dirName); - attriblen = 0; - } - if (dirName[dirlen - 1] != '/') -#ifdef NCD - if (dirlen) /* leave out slash for builtins */ -#endif - needslash = 1; - dir = (FontDirectoryPtr) xalloc(sizeof *dir + dirlen + needslash + 1 + - (attriblen ? attriblen + 1 : 0)); - if (!dir) - return (FontDirectoryPtr)0; - if (!FontFileInitTable (&dir->scalable, 0)) - { - xfree (dir); - return (FontDirectoryPtr)0; - } - if (!FontFileInitTable (&dir->nonScalable, size)) - { - FontFileFreeTable (&dir->scalable); - xfree (dir); - return (FontDirectoryPtr)0; - } - dir->directory = (char *) (dir + 1); - dir->dir_mtime = 0; - dir->alias_mtime = 0; - if (attriblen) - dir->attributes = dir->directory + dirlen + needslash + 1; - else - dir->attributes = NULL; - strncpy(dir->directory, dirName, dirlen); - dir->directory[dirlen] = '\0'; - if (dir->attributes) - strcpy(dir->attributes, attrib); - if (needslash) - strcat(dir->directory, "/"); - return dir; -} - -void -FontFileFreeDir (FontDirectoryPtr dir) -{ - FontFileFreeTable (&dir->scalable); - FontFileFreeTable (&dir->nonScalable); - xfree(dir); -} - -FontEntryPtr -FontFileAddEntry(FontTablePtr table, FontEntryPtr prototype) -{ - FontEntryPtr entry; - int newsize; - - /* can't add entries to a sorted table, pointers get broken! */ - if (table->sorted) - return (FontEntryPtr) 0; /* "cannot" happen */ - if (table->used == table->size) { - if (table->size >= ((INT32_MAX / sizeof(FontEntryRec)) - 100)) - /* If we've read so many entries we're going to ask for 2gb - or more of memory, something is so wrong with this font - directory that we should just give up before we overflow. */ - return NULL; - newsize = table->size + 100; - entry = (FontEntryPtr) xrealloc(table->entries, - newsize * sizeof(FontEntryRec)); - if (!entry) - return (FontEntryPtr)0; - table->size = newsize; - table->entries = entry; - } - entry = &table->entries[table->used]; - *entry = *prototype; - entry->name.name = (char *) xalloc(prototype->name.length + 1); - if (!entry->name.name) - return (FontEntryPtr)0; - memcpy (entry->name.name, prototype->name.name, prototype->name.length); - entry->name.name[entry->name.length] = '\0'; - table->used++; - return entry; -} - -/* - * Compare two strings just like strcmp, but preserve decimal integer - * sorting order, i.e. "2" < "10" or "iso8859-2" < "iso8859-10" < - * "iso10646-1". Strings are sorted as if sequences of digits were - * prefixed by a length indicator (i.e., does not ignore leading zeroes). - * - * Markus Kuhn - */ -#define Xisdigit(c) ('\060' <= (c) && (c) <= '\071') - -static int strcmpn(const char *s1, const char *s2) -{ - int digits, predigits = 0; - const char *ss1, *ss2; - - while (1) { - if (*s1 == 0 && *s2 == 0) - return 0; - digits = Xisdigit(*s1) && Xisdigit(*s2); - if (digits && !predigits) { - ss1 = s1; - ss2 = s2; - while (Xisdigit(*ss1) && Xisdigit(*ss2)) - ss1++, ss2++; - if (!Xisdigit(*ss1) && Xisdigit(*ss2)) - return -1; - if (Xisdigit(*ss1) && !Xisdigit(*ss2)) - return 1; - } - if ((unsigned char)*s1 < (unsigned char)*s2) - return -1; - if ((unsigned char)*s1 > (unsigned char)*s2) - return 1; - predigits = digits; - s1++, s2++; - } -} - - -static int -FontFileNameCompare(const void* a, const void* b) -{ - FontEntryPtr a_name = (FontEntryPtr) a, - b_name = (FontEntryPtr) b; - - return strcmpn(a_name->name.name, b_name->name.name); -} - -void -FontFileSortTable (FontTablePtr table) -{ - if (!table->sorted) { - qsort((char *) table->entries, table->used, sizeof(FontEntryRec), - FontFileNameCompare); - table->sorted = TRUE; - } -} - -void -FontFileSortDir(FontDirectoryPtr dir) -{ - FontFileSortTable (&dir->scalable); - FontFileSortTable (&dir->nonScalable); - /* now that the table is fixed in size, swizzle the pointers */ - FontFileSwitchStringsToBitmapPointers (dir); -} - -/* - Given a Font Table, SetupWildMatch() sets up various pointers and state - information so the table can be searched for name(s) that match a given - fontname pattern -- which may contain wildcards. Under certain - circumstances, SetupWildMatch() will find the one table entry that - matches the pattern. If those circumstances do not pertain, - SetupWildMatch() returns a range within the the table that should be - searched for matching name(s). With the information established by - SetupWildMatch(), including state information in "private", the - PatternMatch() procedure is then used to test names in the range for a - match. -*/ - -#define isWild(c) ((c) == XK_asterisk || (c) == XK_question) -#define isDigit(c) (XK_0 <= (c) && (c) <= XK_9) - -static int -SetupWildMatch(FontTablePtr table, FontNamePtr pat, - int *leftp, int *rightp, int *privatep) -{ - int nDashes; - char c; - char *t; - char *firstWild; - char *firstDigit; - int first; - int center, - left, - right; - int result; - char *name; - - name = pat->name; - nDashes = pat->ndashes; - firstWild = 0; - firstDigit = 0; - t = name; - while ((c = *t++)) { - if (isWild(c)) { - if (!firstWild) - firstWild = t - 1; - } - if (isDigit(c)) { - if (!firstDigit) - firstDigit = t - 1; - } - } - left = 0; - right = table->used; - if (firstWild) - *privatep = nDashes; - else - *privatep = -1; - if (!table->sorted) { - *leftp = left; - *rightp = right; - return -1; - } else if (firstWild) { - if (firstDigit && firstDigit < firstWild) - first = firstDigit - name; - else - first = firstWild - name; - while (left < right) { - center = (left + right) / 2; - result = strncmp(name, table->entries[center].name.name, first); - if (result == 0) - break; - if (result < 0) - right = center; - else - left = center + 1; - } - *leftp = left; - *rightp = right; - return -1; - } else { - while (left < right) { - center = (left + right) / 2; - result = strcmpn(name, table->entries[center].name.name); - if (result == 0) - return center; - if (result < 0) - right = center; - else - left = center + 1; - } - *leftp = 1; - *rightp = 0; - return -1; - } -} - -static int -PatternMatch(char *pat, int patdashes, char *string, int stringdashes) -{ - char c, - t; - - if (stringdashes < patdashes) - return 0; - for (;;) { - switch (c = *pat++) { - case '*': - if (!(c = *pat++)) - return 1; - if (c == XK_minus) { - patdashes--; - for (;;) { - while ((t = *string++) != XK_minus) - if (!t) - return 0; - stringdashes--; - if (PatternMatch(pat, patdashes, string, stringdashes)) - return 1; - if (stringdashes == patdashes) - return 0; - } - } else { - for (;;) { - while ((t = *string++) != c) { - if (!t) - return 0; - if (t == XK_minus) { - if (stringdashes-- < patdashes) - return 0; - } - } - if (PatternMatch(pat, patdashes, string, stringdashes)) - return 1; - } - } - case '?': - if (*string++ == XK_minus) - stringdashes--; - break; - case '\0': - return (*string == '\0'); - case XK_minus: - if (*string++ == XK_minus) { - patdashes--; - stringdashes--; - break; - } - return 0; - default: - if (c == *string++) - break; - return 0; - } - } -} - -int -FontFileCountDashes (char *name, int namelen) -{ - int ndashes = 0; - - while (namelen--) - if (*name++ == '\055') /* avoid non ascii systems */ - ++ndashes; - return ndashes; -} - -char * -FontFileSaveString (char *s) -{ - char *n; - - n = (char *) xalloc (strlen (s) + 1); - if (!n) - return 0; - strcpy (n, s); - return n; -} - -FontEntryPtr -FontFileFindNameInScalableDir(FontTablePtr table, FontNamePtr pat, - FontScalablePtr vals) -{ - int i, - start, - stop, - res, - private; - FontNamePtr name; - - if ((i = SetupWildMatch(table, pat, &start, &stop, &private)) >= 0) - return &table->entries[i]; - for (i = start; i < stop; i++) { - name = &table->entries[i].name; - res = PatternMatch(pat->name, private, name->name, name->ndashes); - if (res > 0) - { - /* Check to see if enhancements requested are available */ - if (vals) - { - int vs = vals->values_supplied; - int cap; - - if (table->entries[i].type == FONT_ENTRY_SCALABLE) - cap = table->entries[i].u.scalable.renderer->capabilities; - else if (table->entries[i].type == FONT_ENTRY_ALIAS) - cap = ~0; /* Calling code will have to see if true */ - else - cap = 0; - if ((((vs & PIXELSIZE_MASK) == PIXELSIZE_ARRAY || - (vs & POINTSIZE_MASK) == POINTSIZE_ARRAY) && - !(cap & CAP_MATRIX)) || - ((vs & CHARSUBSET_SPECIFIED) && - !(cap & CAP_CHARSUBSETTING))) - continue; - } - return &table->entries[i]; - } - if (res < 0) - break; - } - return (FontEntryPtr)0; -} - -FontEntryPtr -FontFileFindNameInDir(FontTablePtr table, FontNamePtr pat) -{ - return FontFileFindNameInScalableDir(table, pat, (FontScalablePtr)0); -} - -int -FontFileFindNamesInScalableDir(FontTablePtr table, FontNamePtr pat, int max, - FontNamesPtr names, FontScalablePtr vals, - int alias_behavior, int *newmax) -{ - int i, - start, - stop, - res, - private; - int ret = Successful; - FontEntryPtr fname; - FontNamePtr name; - - if (max <= 0) - return Successful; - if ((i = SetupWildMatch(table, pat, &start, &stop, &private)) >= 0) { - if (alias_behavior == NORMAL_ALIAS_BEHAVIOR || - table->entries[i].type != FONT_ENTRY_ALIAS) - { - name = &table->entries[i].name; - if (newmax) *newmax = max - 1; - return AddFontNamesName(names, name->name, name->length); - } - start = i; - stop = i + 1; - } - for (i = start, fname = &table->entries[start]; i < stop; i++, fname++) { - res = PatternMatch(pat->name, private, fname->name.name, fname->name.ndashes); - if (res > 0) { - if (vals) - { - int vs = vals->values_supplied; - int cap; - - if (fname->type == FONT_ENTRY_SCALABLE) - cap = fname->u.scalable.renderer->capabilities; - else if (fname->type == FONT_ENTRY_ALIAS) - cap = ~0; /* Calling code will have to see if true */ - else - cap = 0; - if ((((vs & PIXELSIZE_MASK) == PIXELSIZE_ARRAY || - (vs & POINTSIZE_MASK) == POINTSIZE_ARRAY) && - !(cap & CAP_MATRIX)) || - ((vs & CHARSUBSET_SPECIFIED) && - !(cap & CAP_CHARSUBSETTING))) - continue; - } - - if ((alias_behavior & IGNORE_SCALABLE_ALIASES) && - fname->type == FONT_ENTRY_ALIAS) - { - FontScalableRec tmpvals; - if (FontParseXLFDName (fname->name.name, &tmpvals, - FONT_XLFD_REPLACE_NONE) && - !(tmpvals.values_supplied & SIZE_SPECIFY_MASK)) - continue; - } - - ret = AddFontNamesName(names, fname->name.name, fname->name.length); - if (ret != Successful) - goto bail; - - /* If alias_behavior is LIST_ALIASES_AND_TARGET_NAMES, mark - this entry as an alias by negating its length and follow - it by the resolved name */ - if ((alias_behavior & LIST_ALIASES_AND_TARGET_NAMES) && - fname->type == FONT_ENTRY_ALIAS) - { - names->length[names->nnames - 1] = - -names->length[names->nnames - 1]; - ret = AddFontNamesName(names, fname->u.alias.resolved, - strlen(fname->u.alias.resolved)); - if (ret != Successful) - goto bail; - } - - if (--max <= 0) - break; - } else if (res < 0) - break; - } - bail: ; - if (newmax) *newmax = max; - return ret; -} - -int -FontFileFindNamesInDir(FontTablePtr table, FontNamePtr pat, - int max, FontNamesPtr names) -{ - return FontFileFindNamesInScalableDir(table, pat, max, names, - (FontScalablePtr)0, - NORMAL_ALIAS_BEHAVIOR, (int *)0); -} - -Bool -FontFileMatchName(char *name, int length, FontNamePtr pat) -{ - /* Perform a fontfile-type name match on a single name */ - FontTableRec table; - FontEntryRec entries[1]; - - /* Dummy up a table */ - table.used = 1; - table.size = 1; - table.sorted = TRUE; - table.entries = entries; - entries[0].name.name = name; - entries[0].name.length = length; - entries[0].name.ndashes = FontFileCountDashes(name, length); - - return FontFileFindNameInDir(&table, pat) != (FontEntryPtr)0; -} - -/* - * Add a font file to a directory. This handles bitmap and - * scalable names both - */ - -Bool -FontFileAddFontFile (FontDirectoryPtr dir, char *fontName, char *fileName) -{ - FontEntryRec entry; - FontScalableRec vals, zeroVals; - FontRendererPtr renderer; - FontEntryPtr existing; - FontScalableExtraPtr extra; - FontEntryPtr bitmap = 0, scalable; - Bool isscale; - Bool scalable_xlfd; - - renderer = FontFileMatchRenderer (fileName); - if (!renderer) - return FALSE; - entry.name.length = strlen (fontName); - if (entry.name.length > MAXFONTNAMELEN) - entry.name.length = MAXFONTNAMELEN; - entry.name.name = fontName; - CopyISOLatin1Lowered (entry.name.name, fontName, entry.name.length); - entry.name.ndashes = FontFileCountDashes (entry.name.name, entry.name.length); - entry.name.name[entry.name.length] = '\0'; - /* - * Add a bitmap name if the incoming name isn't an XLFD name, or - * if it isn't a scalable name (i.e. non-zero scalable fields) - * - * If name of bitmapped font contains XLFD enhancements, do not add - * a scalable version of the name... this can lead to confusion and - * ambiguity between the font name and the field enhancements. - */ - isscale = entry.name.ndashes == 14 && - FontParseXLFDName(entry.name.name, - &vals, FONT_XLFD_REPLACE_NONE) && - (vals.values_supplied & PIXELSIZE_MASK) != PIXELSIZE_ARRAY && - (vals.values_supplied & POINTSIZE_MASK) != POINTSIZE_ARRAY && - !(vals.values_supplied & ENHANCEMENT_SPECIFY_MASK); -#define UNSCALED_ATTRIB "unscaled" - scalable_xlfd = (isscale && - (((vals.values_supplied & PIXELSIZE_MASK) == 0) || - ((vals.values_supplied & POINTSIZE_MASK) == 0))); - /* - * For scalable fonts without a scalable XFLD, check if the "unscaled" - * attribute is present. - */ - if (isscale && !scalable_xlfd && - dir->attributes && dir->attributes[0] == ':') { - char *ptr1 = dir->attributes + 1; - char *ptr2; - int length; - int uslength = strlen(UNSCALED_ATTRIB); - - do { - ptr2 = strchr(ptr1, ':'); - if (ptr2) - length = ptr2 - ptr1; - else - length = dir->attributes + strlen(dir->attributes) - ptr1; - if (length == uslength && !strncmp(ptr1, UNSCALED_ATTRIB, uslength)) - isscale = FALSE; - if (ptr2) - ptr1 = ptr2 + 1; - } while (ptr2); - } - if (!isscale || (vals.values_supplied & SIZE_SPECIFY_MASK)) - { - /* - * If the renderer doesn't support OpenBitmap, FontFileOpenFont - * will still do the right thing. - */ - entry.type = FONT_ENTRY_BITMAP; - entry.u.bitmap.renderer = renderer; - entry.u.bitmap.pFont = NullFont; - if (!(entry.u.bitmap.fileName = FontFileSaveString (fileName))) - return FALSE; - if (!(bitmap = FontFileAddEntry (&dir->nonScalable, &entry))) - { - xfree (entry.u.bitmap.fileName); - return FALSE; - } - } - /* - * Parse out scalable fields from XLFD names - a scalable name - * just gets inserted, a scaled name has more things to do. - */ - if (isscale) - { - if (vals.values_supplied & SIZE_SPECIFY_MASK) - { - bzero((char *)&zeroVals, sizeof(zeroVals)); - zeroVals.x = vals.x; - zeroVals.y = vals.y; - zeroVals.values_supplied = PIXELSIZE_SCALAR | POINTSIZE_SCALAR; - FontParseXLFDName (entry.name.name, &zeroVals, - FONT_XLFD_REPLACE_VALUE); - entry.name.length = strlen (entry.name.name); - existing = FontFileFindNameInDir (&dir->scalable, &entry.name); - if (existing) - { - if ((vals.values_supplied & POINTSIZE_MASK) == - POINTSIZE_SCALAR && - (int)(vals.point_matrix[3] * 10) == GetDefaultPointSize()) - { - existing->u.scalable.extra->defaults = vals; - - xfree (existing->u.scalable.fileName); - if (!(existing->u.scalable.fileName = FontFileSaveString (fileName))) - return FALSE; - } - if(bitmap) - { - FontFileCompleteXLFD(&vals, &vals); - FontFileAddScaledInstance (existing, &vals, NullFont, - bitmap->name.name); - return TRUE; - } - } - } - if (!(entry.u.scalable.fileName = FontFileSaveString (fileName))) - return FALSE; - extra = (FontScalableExtraPtr) xalloc (sizeof (FontScalableExtraRec)); - if (!extra) - { - xfree (entry.u.scalable.fileName); - return FALSE; - } - bzero((char *)&extra->defaults, sizeof(extra->defaults)); - if ((vals.values_supplied & POINTSIZE_MASK) == POINTSIZE_SCALAR && - (int)(vals.point_matrix[3] * 10) == GetDefaultPointSize()) - extra->defaults = vals; - else - { - FontResolutionPtr resolution; - int num; - - extra->defaults.point_matrix[0] = - extra->defaults.point_matrix[3] = - (double)GetDefaultPointSize() / 10.0; - extra->defaults.point_matrix[1] = - extra->defaults.point_matrix[2] = 0.0; - extra->defaults.values_supplied = - POINTSIZE_SCALAR | PIXELSIZE_UNDEFINED; - extra->defaults.width = -1; - if (vals.x <= 0 || vals.y <= 0) - { - resolution = GetClientResolutions (&num); - if (resolution && num > 0) - { - extra->defaults.x = resolution->x_resolution; - extra->defaults.y = resolution->y_resolution; - } - else - { - extra->defaults.x = 75; - extra->defaults.y = 75; - } - } - else - { - extra->defaults.x = vals.x; - extra->defaults.y = vals.y; - } - FontFileCompleteXLFD (&extra->defaults, &extra->defaults); - } - extra->numScaled = 0; - extra->sizeScaled = 0; - extra->scaled = 0; - extra->private = 0; - entry.type = FONT_ENTRY_SCALABLE; - entry.u.scalable.renderer = renderer; - entry.u.scalable.extra = extra; - if (!(scalable = FontFileAddEntry (&dir->scalable, &entry))) - { - xfree (extra); - xfree (entry.u.scalable.fileName); - return FALSE; - } - if (vals.values_supplied & SIZE_SPECIFY_MASK) - { - if(bitmap) - { - FontFileCompleteXLFD(&vals, &vals); - FontFileAddScaledInstance (scalable, &vals, NullFont, - bitmap->name.name); - } - } - } - return TRUE; -} - -Bool -FontFileAddFontAlias (FontDirectoryPtr dir, char *aliasName, char *fontName) -{ - FontEntryRec entry; - - entry.name.length = strlen (aliasName); - CopyISOLatin1Lowered (aliasName, aliasName, entry.name.length); - entry.name.name = aliasName; - entry.name.ndashes = FontFileCountDashes (entry.name.name, entry.name.length); - entry.type = FONT_ENTRY_ALIAS; - if (!(entry.u.alias.resolved = FontFileSaveString (fontName))) - return FALSE; - if (!FontFileAddEntry (&dir->nonScalable, &entry)) - { - xfree (entry.u.alias.resolved); - return FALSE; - } - return TRUE; -} diff --git a/nx-X11/lib/font/fontfile/fontenc.c b/nx-X11/lib/font/fontfile/fontenc.c deleted file mode 100644 index e96cdde26..000000000 --- a/nx-X11/lib/font/fontfile/fontenc.c +++ /dev/null @@ -1,952 +0,0 @@ -/* -Copyright (c) 1998-2001 by Juliusz Chroboczek - -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. -*/ - -/* $XdotOrg: xc/lib/font/fontfile/fontenc.c,v 1.5 2005/11/08 06:33:26 jkj Exp $ */ -/* $XFree86: xc/lib/font/fontfile/fontenc.c,v 1.15 2003/02/20 03:25:19 dawes Exp $ */ - -/* Backend-independent encoding code */ - -#include - -#if defined(__SCO__) || defined(__UNIXWARE__) -#include -#endif - -#ifndef FONTENC_NO_LIBFONT - -#include /* defines xalloc and friends */ -#include - -#else - -#include -#define xalloc(n) malloc(n) -#define xrealloc(p, n) realloc(p, n) -#define xfree(p) free(p) -#define FALSE 0 -#define TRUE 1 -#define MAXFONTNAMELEN 1024 -#define MAXFONTFILENAMELEN 1024 - -#endif /* FONTENC_NO_FONTFILE */ - -#include -#include "fontencI.h" - -/* Functions local to this file */ - -static FontEncPtr FontEncLoad(const char*, const char*); - -/* Early versions of this code only knew about hardwired encodings, - hence the following data. Now that the code knows how to load an - encoding from a file, most of these tables could go away. */ - -/* At any rate, no new hardcoded encodings will be added. */ - -static FontMapRec iso10646[]= -{ - {FONT_ENCODING_UNICODE,0,0,0,0,0,0}, - {0,0,0,0,0,0,0} -}; - -/* Notice that the Apple encodings do not have all the characters in - the corresponding ISO 8859, and therefore the table has some holes. - There's not much more we can do with fonts without a Unicode cmap - unless we are willing to combine cmaps (which we are not). */ - -static unsigned short -iso8859_1_apple_roman[]= -{ 0xCA, 0xC1, 0xA2, 0xA3, 0xDB, 0xB4, 0x00, 0xA4, - 0xAC, 0xA9, 0xBB, 0xC7, 0xC2, 0x00, 0xA8, 0xF8, - 0xA1, 0xB1, 0x00, 0x00, 0xAB, 0xB5, 0xA6, 0xE1, - 0xFC, 0x00, 0xBC, 0xC8, 0x00, 0x00, 0x00, 0xC0, - 0xCB, 0xE7, 0xE5, 0xCC, 0x80, 0x81, 0xAE, 0x82, - 0xE9, 0x83, 0xE6, 0xE8, 0xED, 0xEA, 0xEB, 0xEC, - 0x00, 0x84, 0xF1, 0xEE, 0xEF, 0xCD, 0x85, 0x00, - 0xAF, 0xF4, 0xF2, 0xF3, 0x86, 0x00, 0x00, 0xA7, - 0x88, 0x87, 0x89, 0x8B, 0x8A, 0x8C, 0xBE, 0x8D, - 0x8F, 0x8E, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, - 0x00, 0x96, 0x98, 0x97, 0x99, 0x9B, 0x9A, 0xD6, - 0xBF, 0x9D, 0x9C, 0x9E, 0x9F, 0x00, 0x00, 0xD8 }; - -/* Cannot use simple_recode because need to eliminate 0x80<=code<0xA0 */ -static unsigned -iso8859_1_to_apple_roman(unsigned isocode, void *client_data) -{ - if(isocode<=0x80) - return isocode; - else if(isocode>=0xA0) - return iso8859_1_apple_roman[isocode-0xA0]; - else - return 0; -} - -static FontMapRec iso8859_1[]= -{ - {FONT_ENCODING_TRUETYPE,2,2,0,0,0,0}, /* ISO 8859-1 */ - {FONT_ENCODING_UNICODE,0,0,0,0,0,0}, /* ISO 8859-1 coincides with Unicode*/ - {FONT_ENCODING_TRUETYPE,1,0,iso8859_1_to_apple_roman,0,0,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned short iso8859_2_tophalf[]= -{ 0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, - 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, - 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, - 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C, - 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, - 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, - 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, - 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, - 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, - 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, - 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, - 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9 }; - -static FontEncSimpleMapRec iso8859_2_to_unicode_map= -{0x60, 0, 0xA0, iso8859_2_tophalf }; - -static unsigned short iso8859_2_apple_centeuro[]= -{ 0xCA, 0x84, 0x00, 0xFC, 0x00, 0xBB, 0xE5, 0xA4, - 0xAC, 0xE1, 0x00, 0xE8, 0x8F, 0x00, 0xEB, 0xFB, - 0xA1, 0x88, 0x00, 0xB8, 0x00, 0xBC, 0xE6, 0xFF, - 0x00, 0xE4, 0x00, 0xE9, 0x90, 0x00, 0xEC, 0xFD, - 0xD9, 0xE7, 0x00, 0x00, 0x80, 0xBD, 0x8C, 0x00, - 0x89, 0x83, 0xA2, 0x00, 0x9D, 0xEA, 0x00, 0x91, - 0x00, 0xC1, 0xC5, 0xEE, 0xEF, 0xCC, 0x85, 0x00, - 0xDB, 0xF1, 0xF2, 0xF4, 0x86, 0xF8, 0x00, 0xA7, - 0xDA, 0x87, 0x00, 0x00, 0x8A, 0xBE, 0x8D, 0x00, - 0x8B, 0x8E, 0xAB, 0x00, 0x9E, 0x92, 0x00, 0x93, - 0x00, 0xC4, 0xCB, 0x97, 0x99, 0xCE, 0x9A, 0xD6, - 0xDE, 0xF3, 0x9C, 0xF5, 0x9F, 0xF9, 0x00, 0x00 }; - -static unsigned -iso8859_2_to_apple_centeuro(unsigned isocode, void *client_data) -{ - if(isocode<=0x80) - return isocode; - else if(isocode>=0xA0) - return iso8859_2_apple_centeuro[isocode-0xA0]; - else - return 0; -} - - -static FontMapRec iso8859_2[]= -{ - {FONT_ENCODING_UNICODE,0,0, - FontEncSimpleRecode,0,&iso8859_2_to_unicode_map,0}, - {FONT_ENCODING_TRUETYPE,1,29,iso8859_2_to_apple_centeuro,0,0,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned short iso8859_3_tophalf[]= -{ 0x00A0, 0x0126, 0x02D8, 0x00A3, 0x00A4, 0x0000, 0x0124, 0x00A7, - 0x00A8, 0x0130, 0x015E, 0x011E, 0x0134, 0x00AD, 0x0000, 0x017B, - 0x00B0, 0x0127, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0125, 0x00B7, - 0x00B8, 0x0131, 0x015F, 0x011F, 0x0135, 0x00BD, 0x0000, 0x017C, - 0x00C0, 0x00C1, 0x00C2, 0x0000, 0x00C4, 0x010A, 0x0108, 0x00C7, - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, - 0x0000, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x0120, 0x00D6, 0x00D7, - 0x011C, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x016C, 0x015C, 0x00DF, - 0x00E0, 0x00E1, 0x00E2, 0x0000, 0x00E4, 0x010B, 0x0109, 0x00E7, - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x0000, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x0121, 0x00F6, 0x00F7, - 0x011D, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x016D, 0x015D, 0x02D9}; - -static FontEncSimpleMapRec iso8859_3_to_unicode_map= -{ 0x60, 0, 0xA0, iso8859_3_tophalf }; - -static FontMapRec iso8859_3[]= -{ - {FONT_ENCODING_UNICODE,0,0, - FontEncSimpleRecode,0,&iso8859_3_to_unicode_map,0}, - {0,0,0,0,0,0,0} -}; - - -static unsigned short iso8859_4_tophalf[]= -{ 0x00A0, 0x0104, 0x0138, 0x0156, 0x00A4, 0x0128, 0x013B, 0x00A7, - 0x00A8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00AD, 0x017D, 0x00AF, - 0x00B0, 0x0105, 0x02DB, 0x0157, 0x00B4, 0x0129, 0x013C, 0x02C7, - 0x00B8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014A, 0x017E, 0x014B, - 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, - 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x012A, - 0x0110, 0x0145, 0x014C, 0x0136, 0x00D4, 0x00D5, 0x00D6, 0x00D7, - 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x0168, 0x016A, 0x00DF, - 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, - 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x012B, - 0x0111, 0x0146, 0x014D, 0x0137, 0x00F4, 0x00F5, 0x00F6, 0x00F7, - 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x0169, 0x016B, 0x02D9, -}; - -static FontEncSimpleMapRec iso8859_4_to_unicode_map= -{ 0x60, 0, 0xA0, iso8859_4_tophalf }; - -static FontMapRec iso8859_4[]= -{ - {FONT_ENCODING_UNICODE,0,0,FontEncSimpleRecode,0, - &iso8859_4_to_unicode_map,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned short iso8859_5_tophalf[]= -{ 0x00A0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, - 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, - 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, - 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x00A7, 0x045E, 0x045F}; - -static FontEncSimpleMapRec iso8859_5_to_unicode_map= -{ 0x60, 0, 0xA0, iso8859_5_tophalf }; - -static unsigned short -iso8859_5_apple_cyrillic[]= -{ 0xCA, 0xDD, 0xAB, 0xAE, 0xB8, 0xC1, 0xA7, 0xBA, - 0xB7, 0xBC, 0xBE, 0xCB, 0xCD, 0x00, 0xD8, 0xDA, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, - 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, - 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xDF, - 0xDC, 0xDE, 0xAC, 0xAF, 0xB9, 0xCF, 0xB4, 0xBB, - 0xC0, 0xBD, 0xBF, 0xCC, 0xCE, 0xA4, 0xD9, 0xDB }; - -static unsigned -iso8859_5_to_apple_cyrillic(unsigned isocode, void *client_data) -{ - if(isocode<=0x80) - return isocode; - else if(isocode>=0xA0) - return iso8859_5_apple_cyrillic[isocode-0x80]; - else return 0; -} - -static FontMapRec iso8859_5[]= -{ - {FONT_ENCODING_UNICODE,0,0,FontEncSimpleRecode,0, - &iso8859_5_to_unicode_map,0}, - {FONT_ENCODING_TRUETYPE,1,7,iso8859_5_to_apple_cyrillic,0,0,0}, - {0,0,0,0,0,0,0} -}; - -/* ISO 8859-6 seems useless for serving fonts (not enough presentation - * forms). What do Arabic-speakers use? */ - -static unsigned -iso8859_6_to_unicode(unsigned isocode, void *client_data) -{ - if(isocode<=0xA0 || isocode==0xA4 || isocode==0xAD) - return isocode; - else if(isocode==0xAC || isocode==0xBB || - (isocode>=0xBF && isocode<=0xDA) || - (isocode>=0xE0 && isocode<=0xEF) || - (isocode>=0xF0 && isocode<=0xF2)) - return isocode-0xA0+0x0600; - else - return 0; -} - -static FontMapRec iso8859_6[]= -{ - {FONT_ENCODING_UNICODE,0,0,iso8859_6_to_unicode,0,0,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned -iso8859_7_to_unicode(unsigned isocode, void *client_data) -{ - if(isocode<=0xA0 || - (isocode>=0xA3 && isocode<=0xAD) || - (isocode>=0xB0 && isocode<=0xB3) || - isocode==0xB7 || isocode==0xBB || isocode==0xBD) - return isocode; - else if(isocode==0xA1) - return 0x02BD; - else if(isocode==0xA2) - return 0x02BC; - else if(isocode==0xAF) - return 0x2015; - else if(isocode>=0xB4) - return isocode-0xA0+0x0370; - else - return 0; -} - -static FontMapRec iso8859_7[]= -{ - {FONT_ENCODING_UNICODE,0,0,iso8859_7_to_unicode,0,0,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned -iso8859_8_to_unicode(unsigned isocode, void *client_data) -{ - if(isocode==0xA1) - return 0; - else if(isocode<0xBF) - return isocode; - else if(isocode==0xDF) - return 0x2017; - else if(isocode>=0xE0 && isocode<=0xFA) - return isocode+0x04F0; - else - return 0; -} - -static FontMapRec iso8859_8[]= -{ - {FONT_ENCODING_UNICODE,0,0,iso8859_8_to_unicode,0,0,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned -iso8859_9_to_unicode(unsigned isocode, void *client_data) -{ - switch(isocode) { - case 0xD0: return 0x011E; - case 0xDD: return 0x0130; - case 0xDE: return 0x015E; - case 0xF0: return 0x011F; - case 0xFD: return 0x0131; - case 0xFE: return 0x015F; - default: return isocode; - } -} - -static FontMapRec iso8859_9[]= -{ - {FONT_ENCODING_UNICODE,0,0,iso8859_9_to_unicode,0,0,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned short iso8859_10_tophalf[]= -{ 0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7, - 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A, - 0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7, - 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2014, 0x016B, 0x014B, - 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, - 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF, - 0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168, - 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, - 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, - 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF, - 0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169, - 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138}; - -static FontEncSimpleMapRec iso8859_10_to_unicode_map= -{ 0x60, 0, 0xA0, iso8859_10_tophalf }; - -static FontMapRec iso8859_10[]= -{ - {FONT_ENCODING_UNICODE,0,0,FontEncSimpleRecode,0, - &iso8859_10_to_unicode_map,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned -iso8859_15_to_unicode(unsigned isocode, void *client_data) -{ - switch(isocode) { - case 0xA4: return 0x20AC; - case 0xA6: return 0x0160; - case 0xA8: return 0x0161; - case 0xB4: return 0x017D; - case 0xB8: return 0x017E; - case 0xBC: return 0x0152; - case 0xBD: return 0x0153; - case 0xBE: return 0x0178; - default: return isocode; - } -} - -static FontMapRec iso8859_15[]= -{ - {FONT_ENCODING_UNICODE,0,0,iso8859_15_to_unicode,0,0,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned short koi8_r_tophalf[]= -{ 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, - 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, - 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2022, 0x221A, 0x2248, - 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7, - 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, - 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x255C, 0x255D, 0x255E, - 0x255F, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565, - 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x256B, 0x256C, 0x00A9, - 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, - 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, - 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, - 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A, - 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, - 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, - 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, - 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A}; - -static FontEncSimpleMapRec koi8_r_to_unicode_map= -{ 0x80, 0, 0x80, koi8_r_tophalf }; - - -static FontMapRec koi8_r[]= -{ - {FONT_ENCODING_UNICODE,0,0,FontEncSimpleRecode,0, - &koi8_r_to_unicode_map,0}, - {0,0,0,0,0,0,0} -}; - -static unsigned -koi8_ru_to_unicode(unsigned koicode, void *client_data) -{ - switch(koicode) { - case 0x93: return 0x201C; - case 0x96: return 0x201D; - case 0x97: return 0x2014; - case 0x98: return 0x2116; - case 0x99: return 0x2122; - case 0x9B: return 0x00BB; - case 0x9C: return 0x00AE; - case 0x9D: return 0x00AB; - case 0x9F: return 0x00A4; - case 0xA4: return 0x0454; - case 0xA6: return 0x0456; - case 0xA7: return 0x0457; - case 0xAD: return 0x0491; - case 0xAE: return 0x045E; - case 0xB4: return 0x0404; - case 0xB6: return 0x0406; - case 0xB7: return 0x0407; - case 0xBD: return 0x0490; - case 0xBE: return 0x040E; - default: return FontEncSimpleRecode(koicode, &koi8_r_to_unicode_map); - } -} - -static FontMapRec koi8_ru[]= -{ - {FONT_ENCODING_UNICODE,0,0,koi8_ru_to_unicode,0,0,0}, - {0,0,0,0,0,0,0} -}; - -/* koi8-e, ISO-IR-111 or ECMA-Cyrillic */ - -static unsigned short koi8_e_A0_BF[]= -{ 0x00A0, 0x0452, 0x0453, 0x0451, 0x0454, 0x0455, 0x0456, 0x0457, - 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x00AD, 0x045E, 0x045F, - 0x2116, 0x0402, 0x0403, 0x0401, 0x0404, 0x0405, 0x0406, 0x0407, - 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00A4, 0x040E, 0x040F }; - -static unsigned -koi8_e_to_unicode(unsigned koicode, void *client_data) -{ - if(koicode<0xA0) - return koicode; - else if(koicode<0xC0) - return koi8_e_A0_BF[koicode-0xA0]; - else - return FontEncSimpleRecode(koicode, &koi8_r_to_unicode_map); -} - -static FontMapRec koi8_e[]= -{ - {FONT_ENCODING_UNICODE,0,0,koi8_e_to_unicode,0,0,0}, - {0,0,0,0,0,0,0} -}; - -/* Koi8 unified */ - -static unsigned short koi8_uni_80_BF[]= -{ 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, - 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, - 0x2591, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x00A9, 0x2122, 0x00A0, 0x00BB, 0x00AE, 0x00AB, 0x00B7, 0x00A4, - 0x00A0, 0x0452, 0x0453, 0x0451, 0x0454, 0x0455, 0x0456, 0x0457, - 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x0491, 0x045E, 0x045F, - 0x2116, 0x0402, 0x0403, 0x0401, 0x0404, 0x0405, 0x0406, 0x0407, - 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x0490, 0x040E, 0x040F }; - -static unsigned -koi8_uni_to_unicode(unsigned koicode, void *client_data) -{ - if(koicode<0x80) - return koicode; - else if(koicode<0xC0) - return koi8_uni_80_BF[koicode-0x80]; - else - return FontEncSimpleRecode(koicode, &koi8_r_to_unicode_map); -} - -static FontMapRec koi8_uni[]= -{ - {FONT_ENCODING_UNICODE,0,0,koi8_uni_to_unicode,0,0,0}, - {0,0,0,0,0,0,0} -}; - -/* Ukrainian variant of Koi8-R; see RFC 2319 */ - -static unsigned -koi8_u_to_unicode(unsigned koicode, void *client_data) -{ - switch(koicode) { - case 0xA4: return 0x0454; - case 0xA6: return 0x0456; - case 0xA7: return 0x0457; - case 0xAD: return 0x0491; - case 0xB4: return 0x0404; - case 0xB6: return 0x0406; - case 0xB7: return 0x0407; - case 0xBD: return 0x0490; - default: return FontEncSimpleRecode(koicode, &koi8_r_to_unicode_map); - } -} - -static FontMapRec koi8_u[]= -{ - {FONT_ENCODING_UNICODE,0,0,koi8_u_to_unicode,0,0,0}, - {0,0,0,0,0,0,0} -}; - -/* Microsoft Symbol, which is only meaningful for TrueType fonts, is - treated specially in ftenc.c, where we add usFirstCharIndex-0x20 to - the glyph index before applying the cmap. Lovely design. */ - -static FontMapRec microsoft_symbol[]= -{{FONT_ENCODING_TRUETYPE,3,0,0,0,0,0}, - /* You never know */ - {FONT_ENCODING_TRUETYPE,3,1,0,0,0,0}, - {0,0,0,0,0,0,0}}; - -static FontMapRec apple_roman[]= -{{FONT_ENCODING_TRUETYPE,1,0,0,0,0,0}, {0,0,0,0,0,0,0}}; - -/* The data for recodings */ - -/* For compatibility with X11R6.4. Losers. */ -static char *iso8859_15_aliases[2]={"fcd8859-15",0}; - -static FontEncRec initial_encodings[]= -{ - {"iso10646-1",0,256*256,0,iso10646,0,0,0}, /* Unicode */ - {"iso8859-1",0,256,0,iso8859_1,0,0,0}, /* Latin 1 (West European) */ - {"iso8859-2",0,256,0,iso8859_2,0,0,0}, /* Latin 2 (East European) */ - {"iso8859-3",0,256,0,iso8859_3,0,0,0}, /* Latin 3 (South European) */ - {"iso8859-4",0,256,0,iso8859_4,0,0,0}, /* Latin 4 (North European) */ - {"iso8859-5",0,256,0,iso8859_5,0,0,0}, /* Cyrillic */ - {"iso8859-6",0,256,0,iso8859_6,0,0,0}, /* Arabic */ - {"iso8859-7",0,256,0,iso8859_7,0,0,0}, /* Greek */ - {"iso8859-8",0,256,0,iso8859_8,0,0,0}, /* Hebrew */ - {"iso8859-9",0,256,0,iso8859_9,0,0,0}, /* Latin 5 (Turkish) */ - {"iso8859-10",0,256,0,iso8859_10,0,0,0}, /* Latin 6 (Nordic) */ - {"iso8859-15",iso8859_15_aliases,256,0,iso8859_15,0,0,0}, /* Latin 9 */ - {"koi8-r",0,256,0,koi8_r,0,0,0}, /* Russian */ - {"koi8-ru",0,256,0,koi8_ru,0,0,0}, /* Ukrainian */ - {"koi8-uni",0,256,0,koi8_uni,0,0,0}, /* Russian/Ukrainian/Bielorussian */ - {"koi8-e",0,256,0,koi8_e,0,0,0}, /* ``European'' */ - {"koi8-u",0,256,0,koi8_u,0,0,0}, /* Ukrainian too */ - {"microsoft-symbol",0,256,0,microsoft_symbol,0,0,0}, - {"apple-roman",0,256,0,apple_roman,0,0,0}, - {0,0,0,0,0,0,0} -}; - -static FontEncPtr font_encodings=NULL; - -static void -define_initial_encoding_info(void) -{ - FontEncPtr encoding; - FontMapPtr mapping; - - font_encodings = initial_encodings; - for(encoding = font_encodings; ; encoding++) { - encoding->next = encoding + 1; - for(mapping = encoding->mappings; ; mapping++) { - mapping->next = mapping+1; - mapping->encoding = encoding; - if(mapping->next->type == 0) { - mapping->next = NULL; - break; - } - } - if(!encoding->next->name) { - encoding->next = NULL; - break; - } - } -} - - -char* -FontEncFromXLFD(const char *name, int length) -{ - const char *p; - char *q; - static char charset[MAXFONTNAMELEN]; - int len; - - if(length > MAXFONTNAMELEN - 1) - return 0; - - if(name == NULL) - p = NULL; - else { - p = name + length - 1; - while(p > name && *p != '-') - p--; - p--; - while(p >= name && *p != '-') - p--; - if(p <= name) - p = 0; - } - - /* now p either is null or points at the '-' before the charset registry */ - - if(p == 0) - return 0; - - len = length - (p - name) - 1; - memcpy(charset, p+1, len); - charset[len] = 0; - - /* check for a subset specification */ - if((q = strchr(charset, (int)'['))) - *q = 0; - - return charset; -} - -unsigned -FontEncRecode(unsigned code, FontMapPtr mapping) -{ - FontEncPtr encoding = mapping->encoding; - if(encoding && mapping->recode) { - if(encoding->row_size == 0) { - /* linear encoding */ - if(code < encoding->first || code>=encoding->size) - return 0; - } else { - /* matrix encoding */ - int row = code/0x100, col = code&0xFF; - if(row < encoding->first || row >= encoding->size || - col < encoding->first_col || col >= encoding->row_size) - return 0; - } - return (*mapping->recode)(code, mapping->client_data); - } else - return code; -} - -char* -FontEncName(unsigned code, FontMapPtr mapping) -{ - FontEncPtr encoding = mapping->encoding; - if(encoding && mapping->name) { - if((encoding->row_size == 0 && code >= encoding->size) || - (encoding->row_size != 0 && - (code/0x100 >= encoding->size || - (code&0xFF) >= encoding->row_size))) - return 0; - return (*mapping->name)(code, mapping->client_data); - } else - return 0; -} - -FontEncPtr -FontEncFind(const char *encoding_name, const char *filename) -{ - FontEncPtr encoding; - char **alias; - - if(font_encodings == NULL) define_initial_encoding_info(); - - for(encoding = font_encodings; encoding; encoding = encoding->next) { - if(!strcasecmp(encoding->name, encoding_name)) - return encoding; - if(encoding->aliases) - for(alias=encoding->aliases; *alias; alias++) - if(!strcasecmp(*alias, encoding_name)) - return encoding; - } - - /* Unknown charset, try to load a definition file */ - return FontEncLoad(encoding_name, filename); -} - -FontMapPtr -FontMapFind(FontEncPtr encoding, int type, int pid, int eid) -{ - FontMapPtr mapping; - if(encoding == NULL) - return NULL; - - for(mapping = encoding->mappings; mapping; mapping = mapping->next) { - if(mapping->type != type) - continue; - if(pid > 0 && mapping->pid != pid) - continue; - if(eid > 0 && mapping->eid != eid) - continue; - return mapping; - } - return NULL; -} - -FontMapPtr -FontEncMapFind(const char *encoding_name, int type, int pid, int eid, - const char *filename) -{ - FontEncPtr encoding; - FontMapPtr mapping; - - encoding = FontEncFind(encoding_name, filename); - if(encoding == NULL) - return NULL; - mapping = FontMapFind(encoding, type, pid, eid); - return mapping; -} - -static FontEncPtr -FontEncLoad(const char *encoding_name, const char *filename) -{ - FontEncPtr encoding; - - encoding = FontEncReallyLoad(encoding_name, filename); - if (encoding == NULL) { - return 0; - } else { - char **alias; - int found = 0; - - /* Check whether the name is already known for this encoding */ - if(strcasecmp(encoding->name, encoding_name) == 0) { - found = 1; - } else { - if(encoding->aliases) { - for(alias=encoding->aliases; *alias; alias++) - if(!strcasecmp(*alias, encoding_name)) { - found = 1; - break; - } - } - } - - if(!found) { - /* Add a new alias. This works because we know that this - particular encoding has been allocated dynamically */ - char **new_aliases; - char *new_name; - int numaliases = 0; - - new_name = xalloc(strlen(encoding_name) + 1); - if(new_name == NULL) - return NULL; - strcpy(new_name, encoding_name); - if(encoding->aliases) { - for(alias = encoding->aliases; *alias; alias++) - numaliases++; - } - new_aliases = (char**)xalloc((numaliases+2)*sizeof(char*)); - if(new_aliases == NULL) { - xfree(new_name); - return NULL; - } - if(encoding->aliases) { - memcpy(new_aliases, encoding->aliases, numaliases*sizeof(char*)); - xfree(encoding->aliases); - } - new_aliases[numaliases] = new_name; - new_aliases[numaliases+1] = NULL; - encoding->aliases = new_aliases; - } - - /* register the new encoding */ - encoding->next=font_encodings; - font_encodings=encoding; - - return encoding; - } -} - -unsigned -FontEncSimpleRecode(unsigned code, void *client_data) -{ - FontEncSimpleMapPtr map; - unsigned index; - - map = client_data; - - if(code > 0xFFFF || (map->row_size && (code&0xFF) >= map->row_size)) - return 0; - - if(map->row_size) - index = (code&0xFF)+(code>>8)*map->row_size; - else - index = code; - - if(map->map && index>=map->first && indexfirst+map->len) - return map->map[index-map->first]; - else - return code; -} - -char * -FontEncSimpleName(unsigned code, void *client_data) -{ - FontEncSimpleNamePtr map; - - map = client_data; - if(map && code >= map->first && codefirst+map->len) - return map->map[code-map->first]; - else - return NULL; -} - -unsigned -FontEncUndefinedRecode(unsigned code, void *client_data) -{ - return code; -} - -char * -FontEncUndefinedName(unsigned code, void *client_data) -{ - return NULL; -} - -#define FONTENC_SEGMENT_SIZE 256 -#define FONTENC_SEGMENTS 256 -#define FONTENC_INVERSE_CODES (FONTENC_SEGMENT_SIZE * FONTENC_SEGMENTS) - -static unsigned int -reverse_reverse(unsigned i, void* data) -{ - int s, j; - unsigned **map = (unsigned**)data; - - if(i >= FONTENC_INVERSE_CODES) - return 0; - - if(map == NULL) - return 0; - - s = i / FONTENC_SEGMENT_SIZE; - j = i % FONTENC_SEGMENT_SIZE; - - if(map[s] == NULL) - return 0; - else - return map[s][j]; -} - -static int -tree_set(unsigned int **map, unsigned int i, unsigned int j) -{ - int s, c; - - if(i >= FONTENC_INVERSE_CODES) - return FALSE; - - s = i / FONTENC_SEGMENT_SIZE; - c = i % FONTENC_SEGMENT_SIZE; - - if(map[s] == NULL) { - map[s] = calloc(FONTENC_SEGMENT_SIZE, sizeof(int)); - if(map[s] == NULL) - return FALSE; - } - - map[s][c] = j; - return TRUE; -} - -FontMapReversePtr -FontMapReverse(FontMapPtr mapping) -{ - FontEncPtr encoding = mapping->encoding; - FontMapReversePtr reverse = NULL; - unsigned int **map = NULL; - int i, j, k; - - if(encoding == NULL) goto bail; - - map = calloc(FONTENC_SEGMENTS, sizeof(int*)); - if(map == NULL) goto bail; - - if(encoding->row_size == 0) { - for(i = encoding->first; i < encoding->size; i++) { - k = FontEncRecode(i, mapping); - if(k != 0) - if(!tree_set(map, k, i)) - goto bail; - } - } else { - for(i = encoding->first; i < encoding->size; i++) { - for(j = encoding->first_col; j < encoding->row_size; j++) { - k = FontEncRecode(i*256 + j, mapping); - if(k != 0) - if(!tree_set(map, k, i*256+j)) - goto bail; - } - } - } - - reverse = malloc(sizeof(FontMapReverseRec)); - if(!reverse) goto bail; - - reverse->reverse = reverse_reverse; - reverse->data = map; - return reverse; - - bail: - if(map) - xfree(map); - if(reverse) - xfree(reverse); - return NULL; -} - -void -FontMapReverseFree(FontMapReversePtr delendum) -{ - unsigned int **map = (unsigned int**)delendum; - int i; - - if(map == NULL) - return; - - for(i = 0; i < FONTENC_SEGMENTS; i++) - if(map[i] != NULL) - xfree(map[i]); - - xfree(map); - return; -} diff --git a/nx-X11/lib/font/fontfile/fontencI.h b/nx-X11/lib/font/fontfile/fontencI.h deleted file mode 100644 index bd35a1fbb..000000000 --- a/nx-X11/lib/font/fontfile/fontencI.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright (c) 1998-2001 by Juliusz Chroboczek - -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. -*/ - -/* $XFree86: xc/lib/font/fontfile/fontencI.h,v 1.3 1999/04/25 10:01:43 dawes Exp $ */ - -/* Private types and functions for the encoding code. */ -/* Used by the files `fontenc.h' and `encparse.h' */ - -typedef struct _FontEncSimpleMap { - unsigned len; /* might be 0x10000 */ - unsigned short row_size; - unsigned short first; - unsigned short *map; -} FontEncSimpleMapRec, *FontEncSimpleMapPtr; - -typedef struct _FontEncSimpleName { - unsigned len; - unsigned short first; - char **map; -} FontEncSimpleNameRec, *FontEncSimpleNamePtr; - -unsigned FontEncSimpleRecode(unsigned, void*); -unsigned FontEncUndefinedRecode(unsigned, void*); -char *FontEncSimpleName(unsigned, void*); -char *FontEncUndefinedName(unsigned, void*); - -FontEncPtr FontEncReallyLoad(const char*, const char*); diff --git a/nx-X11/lib/font/fontfile/fontencc.c b/nx-X11/lib/font/fontfile/fontencc.c deleted file mode 100644 index b54079acf..000000000 --- a/nx-X11/lib/font/fontfile/fontencc.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright (c) 1998-2001 by Juliusz Chroboczek - -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. -*/ -/* $XFree86: xc/lib/font/fontfile/fontencc.c,v 1.1 2001/08/13 21:46:47 dawes Exp $ */ - -/* Binary compatibility code. */ - -/* This file includes code to make modules compiled for earlier - versions of the fontenc interfaces link with this one. It does - *not* provide source compatibility, as many of the data structures - now have different names. */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -extern void ErrorF(const char *f, ...); - -char * -font_encoding_from_xlfd(const char * name, int length) -{ - return FontEncFromXLFD(name, length); -} - -FontEncPtr -font_encoding_find(const char *encoding_name, const char *filename) -{ - return FontEncFind(encoding_name, filename); -} - -unsigned -font_encoding_recode(unsigned code, - FontEncPtr encoding, FontMapPtr mapping) -{ - if(encoding != mapping->encoding) { - ErrorF("Inconsistent mapping/encoding\n"); - return 0; - } - return FontEncRecode(code, mapping); -} - -char * -font_encoding_name(unsigned code, - FontEncPtr encoding, FontMapPtr mapping) -{ - if(encoding != mapping->encoding) { - ErrorF("Inconsistent mapping/encoding\n"); - return 0; - } - return FontEncName(code, mapping); -} - -char ** -identifyEncodingFile(const char *filename) -{ - return FontEncIdentify(filename); -} diff --git a/nx-X11/lib/font/fontfile/fontfile.c b/nx-X11/lib/font/fontfile/fontfile.c deleted file mode 100644 index 2356c0595..000000000 --- a/nx-X11/lib/font/fontfile/fontfile.c +++ /dev/null @@ -1,1147 +0,0 @@ -/* $XdotOrg: xc/lib/font/fontfile/fontfile.c,v 1.5 2005/07/09 06:36:13 keithp Exp $ */ -/* $Xorg: fontfile.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/fontfile.c,v 3.21 2003/12/02 19:50:40 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ -/* $NCDXorg: @(#)fontfile.c,v 1.6 1991/07/02 17:00:46 lemke Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#ifdef WIN32 -#include -#endif - -/* - * Map FPE functions to renderer functions - */ - -static int FontFileOpenBitmapNCF (FontPathElementPtr fpe, FontPtr *pFont, - int flags, FontEntryPtr entry, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - FontPtr non_cachable_font); - -int -FontFileNameCheck (char *name) -{ -#ifndef NCD -#if defined(__UNIXOS2__) || defined(WIN32) - /* OS/2 uses D:/... as a path name for fonts, so accept this as a valid - * path if it starts with a letter and a colon. Same applies for WIN32 - */ - if (isalpha(*name) && name[1]==':') - return TRUE; -#endif - return *name == '/'; -#else - return ((strcmp(name, "built-ins") == 0) || (*name == '/')); -#endif -} - -int -FontFileInitFPE (FontPathElementPtr fpe) -{ - int status; - FontDirectoryPtr dir; - - status = FontFileReadDirectory (fpe->name, &dir); - if (status == Successful) - { - if (dir->nonScalable.used > 0) - if (!FontFileRegisterBitmapSource (fpe)) - { - FontFileFreeFPE (fpe); - return AllocError; - } - fpe->private = (pointer) dir; - } - return status; -} - -/* ARGSUSED */ -int -FontFileResetFPE (FontPathElementPtr fpe) -{ - FontDirectoryPtr dir; - - dir = (FontDirectoryPtr) fpe->private; - /* - * The reset must fail for bitmap fonts because they get cleared when - * the path is set. - */ - if (FontFileDirectoryChanged (dir)) - { - /* can't do it, so tell the caller to close and re-open */ - return FPEResetFailed; - } - else - { - if (dir->nonScalable.used > 0) - if (!FontFileRegisterBitmapSource (fpe)) - { - return FPEResetFailed; - } - return Successful; - } -} - -int -FontFileFreeFPE (FontPathElementPtr fpe) -{ - FontFileUnregisterBitmapSource (fpe); - FontFileFreeDir ((FontDirectoryPtr) fpe->private); - return Successful; -} - -static int -transfer_values_to_alias(char *entryname, int entrynamelength, - char *resolvedname, - char **aliasName, FontScalablePtr vals) -{ - static char aliasname[MAXFONTNAMELEN]; - int nameok = 1, len; - char lowerName[MAXFONTNAMELEN]; - - *aliasName = resolvedname; - if ((len = strlen(*aliasName)) <= MAXFONTNAMELEN && - (entrynamelength < MAXFONTNAMELEN) && - FontFileCountDashes (*aliasName, len) == 14) - { - FontScalableRec tmpVals; - FontScalableRec tmpVals2; - - tmpVals2 = *vals; - - /* If we're aliasing a scalable name, transfer values - from the name into the destination alias, multiplying - by matrices that appear in the alias. */ - - CopyISOLatin1Lowered (lowerName, entryname, - entrynamelength); - lowerName[entrynamelength] = '\0'; - - if (FontParseXLFDName(lowerName, &tmpVals, - FONT_XLFD_REPLACE_NONE) && - !tmpVals.values_supplied && - FontParseXLFDName(*aliasName, &tmpVals, - FONT_XLFD_REPLACE_NONE)) - { - double *matrix = 0, tempmatrix[4]; - - /* Use a matrix iff exactly one is defined */ - if ((tmpVals.values_supplied & PIXELSIZE_MASK) == - PIXELSIZE_ARRAY && - !(tmpVals.values_supplied & POINTSIZE_MASK)) - matrix = tmpVals.pixel_matrix; - else if ((tmpVals.values_supplied & POINTSIZE_MASK) == - POINTSIZE_ARRAY && - !(tmpVals.values_supplied & PIXELSIZE_MASK)) - matrix = tmpVals.point_matrix; - - /* If matrix given in the alias, compute new point - and/or pixel matrices */ - if (matrix) - { - /* Complete the XLFD name to avoid potential - gotchas */ - if (FontFileCompleteXLFD(&tmpVals2, &tmpVals2)) - { - tempmatrix[0] = - matrix[0] * tmpVals2.point_matrix[0] + - matrix[1] * tmpVals2.point_matrix[2]; - tempmatrix[1] = - matrix[0] * tmpVals2.point_matrix[1] + - matrix[1] * tmpVals2.point_matrix[3]; - tempmatrix[2] = - matrix[2] * tmpVals2.point_matrix[0] + - matrix[3] * tmpVals2.point_matrix[2]; - tempmatrix[3] = - matrix[2] * tmpVals2.point_matrix[1] + - matrix[3] * tmpVals2.point_matrix[3]; - tmpVals2.point_matrix[0] = tempmatrix[0]; - tmpVals2.point_matrix[1] = tempmatrix[1]; - tmpVals2.point_matrix[2] = tempmatrix[2]; - tmpVals2.point_matrix[3] = tempmatrix[3]; - - tempmatrix[0] = - matrix[0] * tmpVals2.pixel_matrix[0] + - matrix[1] * tmpVals2.pixel_matrix[2]; - tempmatrix[1] = - matrix[0] * tmpVals2.pixel_matrix[1] + - matrix[1] * tmpVals2.pixel_matrix[3]; - tempmatrix[2] = - matrix[2] * tmpVals2.pixel_matrix[0] + - matrix[3] * tmpVals2.pixel_matrix[2]; - tempmatrix[3] = - matrix[2] * tmpVals2.pixel_matrix[1] + - matrix[3] * tmpVals2.pixel_matrix[3]; - tmpVals2.pixel_matrix[0] = tempmatrix[0]; - tmpVals2.pixel_matrix[1] = tempmatrix[1]; - tmpVals2.pixel_matrix[2] = tempmatrix[2]; - tmpVals2.pixel_matrix[3] = tempmatrix[3]; - - tmpVals2.values_supplied = - (tmpVals2.values_supplied & - ~(PIXELSIZE_MASK | POINTSIZE_MASK)) | - PIXELSIZE_ARRAY | POINTSIZE_ARRAY; - } - else - nameok = 0; - } - - CopyISOLatin1Lowered (aliasname, *aliasName, len + 1); - if (nameok && FontParseXLFDName(aliasname, &tmpVals2, - FONT_XLFD_REPLACE_VALUE)) - /* Return a version of the aliasname that has - had the vals stuffed into it. To avoid - memory leak, this alias name lives in a - static buffer. The caller needs to be done - with this buffer before this procedure is - called again to avoid reentrancy problems. */ - *aliasName = aliasname; - } - } - return nameok; -} - -/* ARGSUSED */ -int -FontFileOpenFont (pointer client, FontPathElementPtr fpe, Mask flags, - char *name, int namelen, - fsBitmapFormat format, fsBitmapFormatMask fmask, - XID id, FontPtr *pFont, char **aliasName, - FontPtr non_cachable_font) -{ - FontDirectoryPtr dir; - char lowerName[MAXFONTNAMELEN]; - char fileName[MAXFONTFILENAMELEN*2 + 1]; - FontNameRec tmpName; - FontEntryPtr entry; - FontScalableRec vals; - FontScalableEntryPtr scalable; - FontScaledPtr scaled; - FontBitmapEntryPtr bitmap; - int ret; - Bool noSpecificSize; - int nranges; - fsRange *ranges; - - if (namelen >= MAXFONTNAMELEN) - return AllocError; - dir = (FontDirectoryPtr) fpe->private; - - /* Match non-scalable pattern */ - CopyISOLatin1Lowered (lowerName, name, namelen); - lowerName[namelen] = '\0'; - ranges = FontParseRanges(lowerName, &nranges); - tmpName.name = lowerName; - tmpName.length = namelen; - tmpName.ndashes = FontFileCountDashes (lowerName, namelen); - if (!FontParseXLFDName(lowerName, &vals, FONT_XLFD_REPLACE_NONE)) - bzero(&vals, sizeof(vals)); - if (!(entry = FontFileFindNameInDir (&dir->nonScalable, &tmpName)) && - tmpName.ndashes == 14 && - FontParseXLFDName (lowerName, &vals, FONT_XLFD_REPLACE_ZERO)) - { - tmpName.length = strlen(lowerName); - entry = FontFileFindNameInDir (&dir->nonScalable, &tmpName); - } - - if (entry) - { - switch (entry->type) { - case FONT_ENTRY_BITMAP: - bitmap = &entry->u.bitmap; - if (bitmap->pFont) - { - *pFont = bitmap->pFont; - (*pFont)->fpe = fpe; - ret = Successful; - } - else - { - ret = FontFileOpenBitmapNCF (fpe, pFont, flags, entry, format, - fmask, non_cachable_font); - if (ret == Successful && *pFont) - (*pFont)->fpe = fpe; - } - break; - case FONT_ENTRY_ALIAS: - vals.nranges = nranges; - vals.ranges = ranges; - transfer_values_to_alias(entry->name.name, entry->name.length, - entry->u.alias.resolved, aliasName, &vals); - ret = FontNameAlias; - break; -#ifdef NOTYET - case FONT_ENTRY_BC: - bc = &entry->u.bc; - entry = bc->entry; - ret = (*scalable->renderer->OpenScalable) - (fpe, pFont, flags, entry, &bc->vals, format, fmask, - non_cachable_font); - if (ret == Successful && *pFont) - (*pFont)->fpe = fpe; - break; -#endif - default: - ret = BadFontName; - } - } - else - { - ret = BadFontName; - } - - if (ret != BadFontName) - { - if (ranges) xfree(ranges); - return ret; - } - - /* Match XLFD patterns */ - CopyISOLatin1Lowered (lowerName, name, namelen); - lowerName[namelen] = '\0'; - tmpName.name = lowerName; - tmpName.length = namelen; - tmpName.ndashes = FontFileCountDashes (lowerName, namelen); - if (!FontParseXLFDName (lowerName, &vals, FONT_XLFD_REPLACE_ZERO) || - !(tmpName.length = strlen (lowerName), - entry = FontFileFindNameInScalableDir (&dir->scalable, &tmpName, - &vals))) { - CopyISOLatin1Lowered (lowerName, name, namelen); - lowerName[namelen] = '\0'; - tmpName.name = lowerName; - tmpName.length = namelen; - tmpName.ndashes = FontFileCountDashes (lowerName, namelen); - entry = FontFileFindNameInScalableDir (&dir->scalable, &tmpName, &vals); - if (entry) - { - strcpy(lowerName, entry->name.name); - tmpName.name = lowerName; - tmpName.length = entry->name.length; - tmpName.ndashes = entry->name.ndashes; - } - } - if (entry) - { - noSpecificSize = FALSE; /* TRUE breaks XLFD enhancements */ - if (entry->type == FONT_ENTRY_SCALABLE && - FontFileCompleteXLFD (&vals, &entry->u.scalable.extra->defaults)) - { - scalable = &entry->u.scalable; - if ((vals.values_supplied & PIXELSIZE_MASK) == PIXELSIZE_ARRAY || - (vals.values_supplied & POINTSIZE_MASK) == POINTSIZE_ARRAY || - (vals.values_supplied & - ~SIZE_SPECIFY_MASK & ~CHARSUBSET_SPECIFIED)) - scaled = 0; - else - scaled = FontFileFindScaledInstance (entry, &vals, - noSpecificSize); - /* - * A scaled instance can occur one of two ways: - * - * Either the font has been scaled to this - * size already, in which case scaled->pFont - * will point at that font. - * - * Or a bitmap instance in this size exists, - * which is handled as if we got a pattern - * matching the bitmap font name. - */ - if (scaled) - { - if (scaled->pFont) - { - *pFont = scaled->pFont; - (*pFont)->fpe = fpe; - ret = Successful; - } - else if (scaled->bitmap) - { - entry = scaled->bitmap; - bitmap = &entry->u.bitmap; - if (bitmap->pFont) - { - *pFont = bitmap->pFont; - (*pFont)->fpe = fpe; - ret = Successful; - } - else - { - ret = FontFileOpenBitmapNCF (fpe, pFont, flags, entry, - format, fmask, - non_cachable_font); - if (ret == Successful && *pFont) - (*pFont)->fpe = fpe; - } - } - else /* "cannot" happen */ - { - ret = BadFontName; - } - } - else - { - ret = FontFileMatchBitmapSource (fpe, pFont, flags, entry, &tmpName, &vals, format, fmask, noSpecificSize); - if (ret != Successful) - { - char origName[MAXFONTNAMELEN]; - - CopyISOLatin1Lowered (origName, name, namelen); - origName[namelen] = '\0'; - - /* Pass the original XLFD name in the vals - structure; the rasterizer is free to examine it - for hidden meanings. This information will not - be saved in the scaled-instances table. */ - - vals.xlfdName = origName; - vals.ranges = ranges; - vals.nranges = nranges; - - if (strlen(dir->directory) + strlen(scalable->fileName) >= - sizeof(fileName)) { - ret = BadFontName; - } else { - strcpy (fileName, dir->directory); - strcat (fileName, scalable->fileName); - ret = (*scalable->renderer->OpenScalable) (fpe, pFont, - flags, entry, fileName, &vals, format, fmask, - non_cachable_font); - } - - /* In case rasterizer does something bad because of - charset subsetting... */ - if (ret == Successful && - ((*pFont)->info.firstCol > (*pFont)->info.lastCol || - (*pFont)->info.firstRow > (*pFont)->info.lastRow)) - { - (*(*pFont)->unload_font)(*pFont); - ret = BadFontName; - } - /* Save the instance */ - if (ret == Successful) - { - if (FontFileAddScaledInstance (entry, &vals, - *pFont, (char *) 0)) - ranges = 0; - else - (*pFont)->fpePrivate = (pointer) 0; - (*pFont)->fpe = fpe; - } - } - } - } - } - else - ret = BadFontName; - - if (ranges) - xfree(ranges); - return ret; -} - -/* ARGSUSED */ -void -FontFileCloseFont (FontPathElementPtr fpe, FontPtr pFont) -{ - FontEntryPtr entry; - - if ((entry = (FontEntryPtr) pFont->fpePrivate)) { - switch (entry->type) { - case FONT_ENTRY_SCALABLE: - FontFileRemoveScaledInstance (entry, pFont); - break; - case FONT_ENTRY_BITMAP: - entry->u.bitmap.pFont = 0; - break; - default: - /* "cannot" happen */ - break; - } - pFont->fpePrivate = 0; - } - (*pFont->unload_font) (pFont); -} - -static int -FontFileOpenBitmapNCF (FontPathElementPtr fpe, FontPtr *pFont, - int flags, FontEntryPtr entry, - fsBitmapFormat format, fsBitmapFormatMask fmask, - FontPtr non_cachable_font) -{ - FontBitmapEntryPtr bitmap; - char fileName[MAXFONTFILENAMELEN*2+1]; - int ret; - FontDirectoryPtr dir; - - dir = (FontDirectoryPtr) fpe->private; - bitmap = &entry->u.bitmap; - if(!bitmap || !bitmap->renderer->OpenBitmap) - return BadFontName; - if (strlen(dir->directory) + strlen(bitmap->fileName) >= sizeof(fileName)) - return BadFontName; - strcpy (fileName, dir->directory); - strcat (fileName, bitmap->fileName); - ret = (*bitmap->renderer->OpenBitmap) - (fpe, pFont, flags, entry, fileName, format, fmask, - non_cachable_font); - if (ret == Successful) - { - bitmap->pFont = *pFont; - (*pFont)->fpePrivate = (pointer) entry; - } - return ret; -} - -int -FontFileOpenBitmap (FontPathElementPtr fpe, FontPtr *pFont, - int flags, FontEntryPtr entry, - fsBitmapFormat format, fsBitmapFormatMask fmask) -{ - return FontFileOpenBitmapNCF (fpe, pFont, flags, entry, format, fmask, - (FontPtr)0); -} - -static int -FontFileGetInfoBitmap (FontPathElementPtr fpe, FontInfoPtr pFontInfo, - FontEntryPtr entry) -{ - FontBitmapEntryPtr bitmap; - char fileName[MAXFONTFILENAMELEN*2+1]; - int ret; - FontDirectoryPtr dir; - - dir = (FontDirectoryPtr) fpe->private; - bitmap = &entry->u.bitmap; - if (!bitmap || !bitmap->renderer->GetInfoBitmap) - return BadFontName; - if (strlen(dir->directory) + strlen(bitmap->fileName) >= sizeof(fileName)) - return BadFontName; - strcpy (fileName, dir->directory); - strcat (fileName, bitmap->fileName); - ret = (*bitmap->renderer->GetInfoBitmap) (fpe, pFontInfo, entry, fileName); - return ret; -} - -static void -_FontFileAddScalableNames(FontNamesPtr names, FontNamesPtr scaleNames, - FontNamePtr nameptr, char *zeroChars, - FontScalablePtr vals, fsRange *ranges, - int nranges, int *max) -{ - int i; - FontScalableRec zeroVals, tmpVals; - for (i = 0; i < scaleNames->nnames; i++) - { - char nameChars[MAXFONTNAMELEN]; - if (!*max) - return; - FontParseXLFDName (scaleNames->names[i], &zeroVals, - FONT_XLFD_REPLACE_NONE); - tmpVals = *vals; - if (FontFileCompleteXLFD (&tmpVals, &zeroVals)) - { - --*max; - - strcpy (nameChars, scaleNames->names[i]); - if ((vals->values_supplied & PIXELSIZE_MASK) || - !(vals->values_supplied & PIXELSIZE_WILDCARD) || - vals->y == 0) - { - tmpVals.values_supplied = - (tmpVals.values_supplied & ~PIXELSIZE_MASK) | - (vals->values_supplied & PIXELSIZE_MASK); - tmpVals.pixel_matrix[0] = vals->pixel_matrix[0]; - tmpVals.pixel_matrix[1] = vals->pixel_matrix[1]; - tmpVals.pixel_matrix[2] = vals->pixel_matrix[2]; - tmpVals.pixel_matrix[3] = vals->pixel_matrix[3]; - } - if ((vals->values_supplied & POINTSIZE_MASK) || - !(vals->values_supplied & POINTSIZE_WILDCARD) || - vals->y == 0) - { - tmpVals.values_supplied = - (tmpVals.values_supplied & ~POINTSIZE_MASK) | - (vals->values_supplied & POINTSIZE_MASK); - tmpVals.point_matrix[0] = vals->point_matrix[0]; - tmpVals.point_matrix[1] = vals->point_matrix[1]; - tmpVals.point_matrix[2] = vals->point_matrix[2]; - tmpVals.point_matrix[3] = vals->point_matrix[3]; - } - if (vals->width <= 0) - tmpVals.width = 0; - if (vals->x == 0) - tmpVals.x = 0; - if (vals->y == 0) - tmpVals.y = 0; - tmpVals.ranges = ranges; - tmpVals.nranges = nranges; - FontParseXLFDName (nameChars, &tmpVals, - FONT_XLFD_REPLACE_VALUE); - /* If we're marking aliases with negative lengths, we - need to concoct a valid target name to follow it. - Otherwise we're done. */ - if (scaleNames->length[i] >= 0) - { - (void) AddFontNamesName (names, nameChars, - strlen (nameChars)); - /* If our original pattern matches the name from - the table and that name doesn't duplicate what - we just added, add the name from the table */ - if (strcmp(nameChars, scaleNames->names[i]) && - FontFileMatchName(scaleNames->names[i], - scaleNames->length[i], - nameptr) && - *max) - { - --*max; - (void) AddFontNamesName (names, scaleNames->names[i], - scaleNames->length[i]); - } - } - else - { - char *aliasName; - vals->ranges = ranges; - vals->nranges = nranges; - if (transfer_values_to_alias(zeroChars, - strlen(zeroChars), - scaleNames->names[++i], - &aliasName, vals)) - { - (void) AddFontNamesName (names, nameChars, - strlen (nameChars)); - names->length[names->nnames - 1] = - -names->length[names->nnames - 1]; - (void) AddFontNamesName (names, aliasName, - strlen (aliasName)); - /* If our original pattern matches the name from - the table and that name doesn't duplicate what - we just added, add the name from the table */ - if (strcmp(nameChars, scaleNames->names[i - 1]) && - FontFileMatchName(scaleNames->names[i - 1], - -scaleNames->length[i - 1], - nameptr) && - *max) - { - --*max; - (void) AddFontNamesName (names, - scaleNames->names[i - 1], - -scaleNames->length[i - 1]); - names->length[names->nnames - 1] = - -names->length[names->nnames - 1]; - (void) AddFontNamesName (names, aliasName, - strlen (aliasName)); - } - } - } - } - } -} - -/* ARGSUSED */ -static int -_FontFileListFonts (pointer client, FontPathElementPtr fpe, - char *pat, int len, int max, FontNamesPtr names, - int mark_aliases) -{ - FontDirectoryPtr dir; - char lowerChars[MAXFONTNAMELEN], zeroChars[MAXFONTNAMELEN]; - FontNameRec lowerName; - FontNameRec zeroName; - FontNamesPtr scaleNames; - FontScalableRec vals; - fsRange *ranges; - int nranges; - int result = BadFontName; - - if (len >= MAXFONTNAMELEN) - return AllocError; - dir = (FontDirectoryPtr) fpe->private; - CopyISOLatin1Lowered (lowerChars, pat, len); - lowerChars[len] = '\0'; - lowerName.name = lowerChars; - lowerName.length = len; - lowerName.ndashes = FontFileCountDashes (lowerChars, len); - - /* Match XLFD patterns */ - - strcpy (zeroChars, lowerChars); - if (lowerName.ndashes == 14 && - FontParseXLFDName (zeroChars, &vals, FONT_XLFD_REPLACE_ZERO)) - { - ranges = FontParseRanges(lowerChars, &nranges); - result = FontFileFindNamesInScalableDir (&dir->nonScalable, - &lowerName, max, names, - (FontScalablePtr)0, - (mark_aliases ? - LIST_ALIASES_AND_TARGET_NAMES : - NORMAL_ALIAS_BEHAVIOR) | - IGNORE_SCALABLE_ALIASES, - &max); - zeroName.name = zeroChars; - zeroName.length = strlen (zeroChars); - zeroName.ndashes = lowerName.ndashes; - - /* Look for scalable names and aliases, adding scaled instances of - them to the output */ - - /* Scalable names... */ - scaleNames = MakeFontNamesRecord (0); - if (!scaleNames) - { - if (ranges) xfree(ranges); - return AllocError; - } - FontFileFindNamesInScalableDir (&dir->scalable, &zeroName, max, - scaleNames, &vals, - mark_aliases ? - LIST_ALIASES_AND_TARGET_NAMES : - NORMAL_ALIAS_BEHAVIOR, (int *)0); - _FontFileAddScalableNames(names, scaleNames, &lowerName, - zeroChars, &vals, ranges, nranges, - &max); - FreeFontNames (scaleNames); - - /* Scalable aliases... */ - scaleNames = MakeFontNamesRecord (0); - if (!scaleNames) - { - if (ranges) xfree(ranges); - return AllocError; - } - FontFileFindNamesInScalableDir (&dir->nonScalable, &zeroName, - max, scaleNames, &vals, - mark_aliases ? - LIST_ALIASES_AND_TARGET_NAMES : - NORMAL_ALIAS_BEHAVIOR, (int *)0); - _FontFileAddScalableNames(names, scaleNames, &lowerName, - zeroChars, &vals, ranges, nranges, - &max); - FreeFontNames (scaleNames); - - if (ranges) xfree(ranges); - } - else - { - result = FontFileFindNamesInScalableDir (&dir->nonScalable, - &lowerName, max, names, - (FontScalablePtr)0, - mark_aliases ? - LIST_ALIASES_AND_TARGET_NAMES : - NORMAL_ALIAS_BEHAVIOR, - &max); - if (result == Successful) - result = FontFileFindNamesInScalableDir (&dir->scalable, - &lowerName, max, names, - (FontScalablePtr)0, - mark_aliases ? - LIST_ALIASES_AND_TARGET_NAMES : - NORMAL_ALIAS_BEHAVIOR, (int *)0); - } - return result; -} - -typedef struct _LFWIData { - FontNamesPtr names; - int current; -} LFWIDataRec, *LFWIDataPtr; - -int -FontFileListFonts (pointer client, FontPathElementPtr fpe, char *pat, - int len, int max, FontNamesPtr names) -{ - return _FontFileListFonts (client, fpe, pat, len, max, names, 0); -} - -int -FontFileStartListFontsWithInfo(pointer client, FontPathElementPtr fpe, - char *pat, int len, int max, - pointer *privatep) -{ - LFWIDataPtr data; - int ret; - - data = (LFWIDataPtr) xalloc (sizeof *data); - if (!data) - return AllocError; - data->names = MakeFontNamesRecord (0); - if (!data->names) - { - xfree (data); - return AllocError; - } - ret = FontFileListFonts (client, fpe, pat, len, max, data->names); - if (ret != Successful) - { - FreeFontNames (data->names); - xfree (data); - return ret; - } - data->current = 0; - *privatep = (pointer) data; - return Successful; -} - -/* ARGSUSED */ -static int -FontFileListOneFontWithInfo (pointer client, FontPathElementPtr fpe, - char **namep, int *namelenp, - FontInfoPtr *pFontInfo) -{ - FontDirectoryPtr dir; - char lowerName[MAXFONTNAMELEN]; - char fileName[MAXFONTFILENAMELEN*2 + 1]; - FontNameRec tmpName; - FontEntryPtr entry; - FontScalableRec vals; - FontScalableEntryPtr scalable; - FontScaledPtr scaled; - FontBitmapEntryPtr bitmap; - int ret; - Bool noSpecificSize; - int nranges; - fsRange *ranges; - - char *name = *namep; - int namelen = *namelenp; - - if (namelen >= MAXFONTNAMELEN) - return AllocError; - dir = (FontDirectoryPtr) fpe->private; - - /* Match non-scalable pattern */ - CopyISOLatin1Lowered (lowerName, name, namelen); - lowerName[namelen] = '\0'; - ranges = FontParseRanges(lowerName, &nranges); - tmpName.name = lowerName; - tmpName.length = namelen; - tmpName.ndashes = FontFileCountDashes (lowerName, namelen); - if (!FontParseXLFDName(lowerName, &vals, FONT_XLFD_REPLACE_NONE)) - bzero(&vals, sizeof(vals)); - if (!(entry = FontFileFindNameInDir (&dir->nonScalable, &tmpName)) && - tmpName.ndashes == 14 && - FontParseXLFDName (lowerName, &vals, FONT_XLFD_REPLACE_ZERO)) - { - tmpName.length = strlen(lowerName); - entry = FontFileFindNameInDir (&dir->nonScalable, &tmpName); - } - - if (entry) - { - switch (entry->type) { - case FONT_ENTRY_BITMAP: - bitmap = &entry->u.bitmap; - if (bitmap->pFont) - { - *pFontInfo = &bitmap->pFont->info; - ret = Successful; - } - else - { - ret = FontFileGetInfoBitmap (fpe, *pFontInfo, entry); - } - break; - case FONT_ENTRY_ALIAS: - vals.nranges = nranges; - vals.ranges = ranges; - transfer_values_to_alias(entry->name.name, entry->name.length, - entry->u.alias.resolved, namep, &vals); - *namelenp = strlen (*namep); - ret = FontNameAlias; - break; -#ifdef NOTYET - case FONT_ENTRY_BC: - /* no LFWI for this yet */ - bc = &entry->u.bc; - entry = bc->entry; - /* Make a new scaled instance */ - if (strlen(dir->directory) + strlen(scalable->fileName) >= - sizeof(fileName)) { - ret = BadFontName; - } else { - strcpy (fileName, dir->directory); - strcat (fileName, scalable->fileName); - ret = (*scalable->renderer->GetInfoScalable) - (fpe, *pFontInfo, entry, tmpName, fileName, &bc->vals); - } - break; -#endif - default: - ret = BadFontName; - } - } - else - { - ret = BadFontName; - } - - if (ret != BadFontName) - { - if (ranges) xfree(ranges); - return ret; - } - - /* Match XLFD patterns */ - CopyISOLatin1Lowered (lowerName, name, namelen); - lowerName[namelen] = '\0'; - tmpName.name = lowerName; - tmpName.length = namelen; - tmpName.ndashes = FontFileCountDashes (lowerName, namelen); - if (!FontParseXLFDName (lowerName, &vals, FONT_XLFD_REPLACE_ZERO) || - !(tmpName.length = strlen (lowerName), - entry = FontFileFindNameInScalableDir (&dir->scalable, &tmpName, - &vals))) { - CopyISOLatin1Lowered (lowerName, name, namelen); - lowerName[namelen] = '\0'; - tmpName.name = lowerName; - tmpName.length = namelen; - tmpName.ndashes = FontFileCountDashes (lowerName, namelen); - entry = FontFileFindNameInScalableDir (&dir->scalable, &tmpName, &vals); - if (entry) - { - strcpy(lowerName, entry->name.name); - tmpName.name = lowerName; - tmpName.length = entry->name.length; - tmpName.ndashes = entry->name.ndashes; - } - } - - if (entry) - { - noSpecificSize = FALSE; /* TRUE breaks XLFD enhancements */ - if (entry && entry->type == FONT_ENTRY_SCALABLE && - FontFileCompleteXLFD (&vals, &entry->u.scalable.extra->defaults)) - { - scalable = &entry->u.scalable; - scaled = FontFileFindScaledInstance (entry, &vals, noSpecificSize); - /* - * A scaled instance can occur one of two ways: - * - * Either the font has been scaled to this - * size already, in which case scaled->pFont - * will point at that font. - * - * Or a bitmap instance in this size exists, - * which is handled as if we got a pattern - * matching the bitmap font name. - */ - if (scaled) - { - if (scaled->pFont) - { - *pFontInfo = &scaled->pFont->info; - ret = Successful; - } - else if (scaled->bitmap) - { - entry = scaled->bitmap; - bitmap = &entry->u.bitmap; - if (bitmap->pFont) - { - *pFontInfo = &bitmap->pFont->info; - ret = Successful; - } - else - { - ret = FontFileGetInfoBitmap (fpe, *pFontInfo, entry); - } - } - else /* "cannot" happen */ - { - ret = BadFontName; - } - } - else - { -#ifdef NOTDEF - /* no special case yet */ - ret = FontFileMatchBitmapSource (fpe, pFont, flags, entry, &vals, format, fmask, noSpecificSize); - if (ret != Successful) -#endif - { - char origName[MAXFONTNAMELEN]; - - CopyISOLatin1Lowered (origName, name, namelen); - origName[namelen] = '\0'; - vals.xlfdName = origName; - vals.ranges = ranges; - vals.nranges = nranges; - - /* Make a new scaled instance */ - if (strlen(dir->directory) + strlen(scalable->fileName) >= - sizeof(fileName)) { - ret = BadFontName; - } else { - strcpy (fileName, dir->directory); - strcat (fileName, scalable->fileName); - ret = (*scalable->renderer->GetInfoScalable) - (fpe, *pFontInfo, entry, &tmpName, fileName, &vals); - } - if (ranges) xfree(ranges); - } - } - if (ret == Successful) return ret; - } - CopyISOLatin1Lowered (lowerName, name, namelen); - tmpName.length = namelen; - } - else - ret = BadFontName; - - if (ranges) - xfree(ranges); - return ret; -} - -int -FontFileListNextFontWithInfo(pointer client, FontPathElementPtr fpe, - char **namep, int *namelenp, - FontInfoPtr *pFontInfo, - int *numFonts, pointer private) -{ - LFWIDataPtr data = (LFWIDataPtr) private; - int ret; - char *name; - int namelen; - - if (data->current == data->names->nnames) - { - FreeFontNames (data->names); - xfree (data); - return BadFontName; - } - name = data->names->names[data->current]; - namelen = data->names->length[data->current]; - ret = FontFileListOneFontWithInfo (client, fpe, &name, &namelen, pFontInfo); - if (ret == BadFontName) - ret = AllocError; - *namep = name; - *namelenp = namelen; - ++data->current; - *numFonts = data->names->nnames - data->current; - return ret; -} - -int -FontFileStartListFontsAndAliases(pointer client, FontPathElementPtr fpe, - char *pat, int len, int max, - pointer *privatep) -{ - LFWIDataPtr data; - int ret; - - data = (LFWIDataPtr) xalloc (sizeof *data); - if (!data) - return AllocError; - data->names = MakeFontNamesRecord (0); - if (!data->names) - { - xfree (data); - return AllocError; - } - ret = _FontFileListFonts (client, fpe, pat, len, max, data->names, 1); - if (ret != Successful) - { - FreeFontNames (data->names); - xfree (data); - return ret; - } - data->current = 0; - *privatep = (pointer) data; - return Successful; -} - -int -FontFileListNextFontOrAlias(pointer client, FontPathElementPtr fpe, - char **namep, int *namelenp, char **resolvedp, - int *resolvedlenp, pointer private) -{ - LFWIDataPtr data = (LFWIDataPtr) private; - int ret; - char *name; - int namelen; - - if (data->current == data->names->nnames) - { - FreeFontNames (data->names); - xfree (data); - return BadFontName; - } - name = data->names->names[data->current]; - namelen = data->names->length[data->current]; - - /* If this is a real font name... */ - if (namelen >= 0) - { - *namep = name; - *namelenp = namelen; - ret = Successful; - } - /* Else if an alias */ - else - { - /* Tell the caller that this is an alias... let him resolve it to - see if it's valid */ - *namep = name; - *namelenp = -namelen; - *resolvedp = data->names->names[++data->current]; - *resolvedlenp = data->names->length[data->current]; - ret = FontNameAlias; - } - - ++data->current; - return ret; -} - -void -FontFileRegisterLocalFpeFunctions (void) -{ - RegisterFPEFunctions(FontFileNameCheck, - FontFileInitFPE, - FontFileFreeFPE, - FontFileResetFPE, - FontFileOpenFont, - FontFileCloseFont, - FontFileListFonts, - FontFileStartListFontsWithInfo, - FontFileListNextFontWithInfo, - NULL, - NULL, - NULL, - FontFileStartListFontsAndAliases, - FontFileListNextFontOrAlias, - FontFileEmptyBitmapSource); -} diff --git a/nx-X11/lib/font/fontfile/fontscale.c b/nx-X11/lib/font/fontfile/fontscale.c deleted file mode 100644 index 8e9de513d..000000000 --- a/nx-X11/lib/font/fontfile/fontscale.c +++ /dev/null @@ -1,447 +0,0 @@ -/* $Xorg: fontscale.c,v 1.5 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/fontscale.c,v 3.9 2001/08/27 19:49:54 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#ifdef _XOPEN_SOURCE -#include -#else -#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */ -#include -#undef _XOPEN_SOURCE -#endif - -Bool -FontFileAddScaledInstance (FontEntryPtr entry, FontScalablePtr vals, - FontPtr pFont, char *bitmapName) -{ - FontScalableEntryPtr scalable; - FontScalableExtraPtr extra; - FontScaledPtr new; - int newsize; - - scalable = &entry->u.scalable; - extra = scalable->extra; - if (extra->numScaled == extra->sizeScaled) - { - newsize = extra->sizeScaled + 4; - new = (FontScaledPtr) xrealloc (extra->scaled, - newsize * sizeof (FontScaledRec)); - if (!new) - return FALSE; - extra->sizeScaled = newsize; - extra->scaled = new; - } - new = &extra->scaled[extra->numScaled++]; - new->vals = *vals; - new->pFont = pFont; - new->bitmap = (FontEntryPtr) bitmapName; - if (pFont) - pFont->fpePrivate = (pointer) entry; - return TRUE; -} - -/* Must call this after the directory is sorted */ - -void -FontFileSwitchStringsToBitmapPointers (FontDirectoryPtr dir) -{ - int s; - int b; - int i; - FontEntryPtr scalable; - FontEntryPtr nonScalable; - FontScaledPtr scaled; - FontScalableExtraPtr extra; - - scalable = dir->scalable.entries; - nonScalable = dir->nonScalable.entries; - for (s = 0; s < dir->scalable.used; s++) - { - extra = scalable[s].u.scalable.extra; - scaled = extra->scaled; - for (i = 0; i < extra->numScaled; i++) - for (b = 0; b < dir->nonScalable.used; b++) - if (nonScalable[b].name.name == (char *) scaled[i].bitmap) - scaled[i].bitmap = &nonScalable[b]; - } -} - -void -FontFileRemoveScaledInstance (FontEntryPtr entry, FontPtr pFont) -{ - FontScalableEntryPtr scalable; - FontScalableExtraPtr extra; - int i; - - scalable = &entry->u.scalable; - extra = scalable->extra; - for (i = 0; i < extra->numScaled; i++) - { - if (extra->scaled[i].pFont == pFont) - { - if (extra->scaled[i].vals.ranges) - xfree (extra->scaled[i].vals.ranges); - extra->numScaled--; - for (; i < extra->numScaled; i++) - extra->scaled[i] = extra->scaled[i+1]; - } - } -} - -Bool -FontFileCompleteXLFD (FontScalablePtr vals, FontScalablePtr def) -{ - FontResolutionPtr res; - int num_res; - double sx, sy, temp_matrix[4]; - double pixel_setsize_adjustment = 1.0; - /* - * If two of the three vertical scale values are specified, compute the - * third. If all three are specified, make sure they are consistent - * (within a pixel) - * - * One purpose of this procedure is to complete XLFD names in a - * repeatable manner. That is, if the user partially specifies - * a name (say, pixelsize but not pointsize), the results generated - * here result in a fully specified name that will result in the - * same font. - */ - - res = GetClientResolutions(&num_res); - - if (!(vals->values_supplied & PIXELSIZE_MASK) || - !(vals->values_supplied & POINTSIZE_MASK)) - { - /* If resolution(s) unspecified and cannot be computed from - pixelsize and pointsize, get appropriate defaults. */ - - if (num_res) - { - if (vals->x <= 0) - vals->x = res->x_resolution; - if (vals->y <= 0) - vals->y = res->y_resolution; - } - - if (vals->x <= 0) - vals->x = def->x; - if (vals->y <= 0) - vals->y = def->y; - } - else - { - /* If needed, compute resolution values from the pixel and - pointsize information we were given. This problem is - overdetermined (four equations, two unknowns), but we don't - check for inconsistencies here. If they exist, they will - show up in later tests for the point and pixel sizes. */ - - if (vals->y <= 0) - { - double x = hypot(vals->pixel_matrix[1], vals->pixel_matrix[3]); - double y = hypot(vals->point_matrix[1], vals->point_matrix[3]); - if (y < EPS) return FALSE; - vals->y = (int)(x * 72.27 / y + .5); - } - if (vals->x <= 0) - { - /* If the pixelsize was given as an array, or as a scalar that - has been normalized for the pixel shape, we have enough - information to compute a separate horizontal resolution */ - - if ((vals->values_supplied & PIXELSIZE_MASK) == PIXELSIZE_ARRAY || - (vals->values_supplied & PIXELSIZE_MASK) == - PIXELSIZE_SCALAR_NORMALIZED) - { - double x = hypot(vals->pixel_matrix[0], vals->pixel_matrix[2]); - double y = hypot(vals->point_matrix[0], vals->point_matrix[2]); - if (y < EPS) return FALSE; - vals->x = (int)(x * 72.27 / y + .5); - } - else - { - /* Not enough information in the pixelsize array. Just - assume the pixels are square. */ - vals->x = vals->y; - } - } - } - - if (vals->x <= 0 || vals->y <= 0) return FALSE; - - /* If neither pixelsize nor pointsize is defined, take the pointsize - from the defaults structure we've been passed. */ - if (!(vals->values_supplied & PIXELSIZE_MASK) && - !(vals->values_supplied & POINTSIZE_MASK)) - { - if (num_res) - { - vals->point_matrix[0] = - vals->point_matrix[3] = (double)res->point_size / 10.0; - vals->point_matrix[1] = - vals->point_matrix[2] = 0; - vals->values_supplied = (vals->values_supplied & ~POINTSIZE_MASK) | - POINTSIZE_SCALAR; - } - else if (def->values_supplied & POINTSIZE_MASK) - { - vals->point_matrix[0] = def->point_matrix[0]; - vals->point_matrix[1] = def->point_matrix[1]; - vals->point_matrix[2] = def->point_matrix[2]; - vals->point_matrix[3] = def->point_matrix[3]; - vals->values_supplied = (vals->values_supplied & ~POINTSIZE_MASK) | - (def->values_supplied & POINTSIZE_MASK); - } - else return FALSE; - } - - /* At this point, at least two of the three vertical scale values - should be specified. Our job now is to compute the missing ones - and check for agreement between overspecified values */ - - /* If pixelsize was specified by a scalar, we need to fix the matrix - now that we know the resolutions. */ - if ((vals->values_supplied & PIXELSIZE_MASK) == PIXELSIZE_SCALAR) - { - /* pixel_setsize_adjustment used below to modify permissible - error in pixel/pointsize matching, since multiplying a - number rounded to integer changes the amount of the error - caused by the rounding */ - - pixel_setsize_adjustment = (double)vals->x / (double)vals->y; - vals->pixel_matrix[0] *= pixel_setsize_adjustment; - vals->values_supplied = (vals->values_supplied & ~PIXELSIZE_MASK) | - PIXELSIZE_SCALAR_NORMALIZED; - } - - sx = (double)vals->x / 72.27; - sy = (double)vals->y / 72.27; - - /* If a pointsize was specified, make sure pixelsize is consistent - to within 1 pixel, then replace pixelsize with a consistent - floating-point value. */ - - if (vals->values_supplied & POINTSIZE_MASK) - { - recompute_pixelsize: ; - temp_matrix[0] = vals->point_matrix[0] * sx; - temp_matrix[1] = vals->point_matrix[1] * sy; - temp_matrix[2] = vals->point_matrix[2] * sx; - temp_matrix[3] = vals->point_matrix[3] * sy; - if (vals->values_supplied & PIXELSIZE_MASK) - { - if (fabs(vals->pixel_matrix[0] - temp_matrix[0]) > - pixel_setsize_adjustment || - fabs(vals->pixel_matrix[1] - temp_matrix[1]) > 1 || - fabs(vals->pixel_matrix[2] - temp_matrix[2]) > 1 || - fabs(vals->pixel_matrix[3] - temp_matrix[3]) > 1) - return FALSE; - } - if ((vals->values_supplied & PIXELSIZE_MASK) == PIXELSIZE_ARRAY && - (vals->values_supplied & POINTSIZE_MASK) == POINTSIZE_SCALAR) - { - /* In the special case that pixelsize came as an array and - pointsize as a scalar, recompute the pointsize matrix - from the pixelsize matrix. */ - goto recompute_pointsize; - } - - /* Refresh pixel matrix with precise values computed from - pointsize and resolution. */ - vals->pixel_matrix[0] = temp_matrix[0]; - vals->pixel_matrix[1] = temp_matrix[1]; - vals->pixel_matrix[2] = temp_matrix[2]; - vals->pixel_matrix[3] = temp_matrix[3]; - - /* Set values_supplied for pixel to match that for point */ - vals->values_supplied = - (vals->values_supplied & ~PIXELSIZE_MASK) | - (((vals->values_supplied & POINTSIZE_MASK) == POINTSIZE_ARRAY) ? - PIXELSIZE_ARRAY : PIXELSIZE_SCALAR_NORMALIZED); - } - else - { - /* Pointsize unspecified... compute from pixel size and - resolutions */ - recompute_pointsize: ; - if (fabs(sx) < EPS || fabs(sy) < EPS) return FALSE; - vals->point_matrix[0] = vals->pixel_matrix[0] / sx; - vals->point_matrix[1] = vals->pixel_matrix[1] / sy; - vals->point_matrix[2] = vals->pixel_matrix[2] / sx; - vals->point_matrix[3] = vals->pixel_matrix[3] / sy; - - /* Set values_supplied for pixel to match that for point */ - vals->values_supplied = - (vals->values_supplied & ~POINTSIZE_MASK) | - (((vals->values_supplied & PIXELSIZE_MASK) == PIXELSIZE_ARRAY) ? - POINTSIZE_ARRAY : POINTSIZE_SCALAR); - - /* If we computed scalar pointsize from scalar pixelsize, round - pointsize to decipoints and recompute pixelsize so we end up - with a repeatable name */ - if ((vals->values_supplied & POINTSIZE_MASK) == POINTSIZE_SCALAR) - { - /* Off-diagonal elements should be zero since no matrix was - specified. */ - vals->point_matrix[0] = - (double)(int)(vals->point_matrix[0] * 10.0 + .5) / 10.0; - vals->point_matrix[3] = - (double)(int)(vals->point_matrix[3] * 10.0 + .5) / 10.0; - goto recompute_pixelsize; - } - } - - /* We've succeeded. Round everything to a few decimal places - for repeatability. */ - - vals->pixel_matrix[0] = xlfd_round_double(vals->pixel_matrix[0]); - vals->pixel_matrix[1] = xlfd_round_double(vals->pixel_matrix[1]); - vals->pixel_matrix[2] = xlfd_round_double(vals->pixel_matrix[2]); - vals->pixel_matrix[3] = xlfd_round_double(vals->pixel_matrix[3]); - vals->point_matrix[0] = xlfd_round_double(vals->point_matrix[0]); - vals->point_matrix[1] = xlfd_round_double(vals->point_matrix[1]); - vals->point_matrix[2] = xlfd_round_double(vals->point_matrix[2]); - vals->point_matrix[3] = xlfd_round_double(vals->point_matrix[3]); - - /* Fill in the deprecated fields for the benefit of rasterizers - that do not handle the matrices. */ - vals->point = vals->point_matrix[3] * 10; - vals->pixel = vals->pixel_matrix[3]; - - return TRUE; -} - -static Bool -MatchScalable (FontScalablePtr a, FontScalablePtr b) -{ - int i; - - /* Some asymmetry here: we assume that the first argument (a) is - the table entry and the second (b) the item we're trying to match - (the key). We'll consider the fonts matched if the relevant - metrics match *and* if a) the table entry doesn't have charset - subsetting or b) the table entry has identical charset subsetting - to that in the key. We could add logic to check if the table - entry has a superset of the charset required by the key, but - we'll resist the urge for now. */ - -#define EQUAL(a,b) ((a)[0] == (b)[0] && \ - (a)[1] == (b)[1] && \ - (a)[2] == (b)[2] && \ - (a)[3] == (b)[3]) - - if (!(a->x == b->x && - a->y == b->y && - (a->width == b->width || a->width == 0 || b->width == 0 || b->width == -1) && - (!(b->values_supplied & PIXELSIZE_MASK) || - ((a->values_supplied & PIXELSIZE_MASK) == - (b->values_supplied & PIXELSIZE_MASK) && - EQUAL(a->pixel_matrix, b->pixel_matrix))) && - (!(b->values_supplied & POINTSIZE_MASK) || - ((a->values_supplied & POINTSIZE_MASK) == - (b->values_supplied & POINTSIZE_MASK) && - EQUAL(a->point_matrix, b->point_matrix))) && - (a->nranges == 0 || a->nranges == b->nranges))) - return FALSE; - - for (i = 0; i < a->nranges; i++) - if (a->ranges[i].min_char_low != b->ranges[i].min_char_low || - a->ranges[i].min_char_high != b->ranges[i].min_char_high || - a->ranges[i].max_char_low != b->ranges[i].max_char_low || - a->ranges[i].max_char_high != b->ranges[i].max_char_high) - return FALSE; - - return TRUE; -} - -FontScaledPtr -FontFileFindScaledInstance (FontEntryPtr entry, FontScalablePtr vals, - int noSpecificSize) -{ - FontScalableEntryPtr scalable; - FontScalableExtraPtr extra; - FontScalablePtr mvals; - int dist, i; - int mini; - double mindist; - register double temp, sum=0.0; - -#define NORMDIFF(a, b) ( \ - temp = (a)[0] - (b)[0], \ - sum = temp * temp, \ - temp = (a)[1] - (b)[1], \ - sum += temp * temp, \ - temp = (a)[2] - (b)[2], \ - sum += temp * temp, \ - temp = (a)[3] - (b)[3], \ - sum + temp * temp ) - - scalable = &entry->u.scalable; - extra = scalable->extra; - if (noSpecificSize && extra->numScaled) - { - mini = 0; - mindist = NORMDIFF(extra->scaled[0].vals.point_matrix, - vals->point_matrix); - for (i = 1; i < extra->numScaled; i++) - { - if (extra->scaled[i].pFont && - !extra->scaled[i].pFont->info.cachable) continue; - mvals = &extra->scaled[i].vals; - dist = NORMDIFF(mvals->point_matrix, vals->point_matrix); - if (dist < mindist) - { - mindist = dist; - mini = i; - } - } - if (extra->scaled[mini].pFont && - !extra->scaled[mini].pFont->info.cachable) return 0; - return &extra->scaled[mini]; - } - else - { - /* See if we've scaled to this value yet */ - for (i = 0; i < extra->numScaled; i++) - { - if (extra->scaled[i].pFont && - !extra->scaled[i].pFont->info.cachable) continue; - if (MatchScalable (&extra->scaled[i].vals, vals)) - return &extra->scaled[i]; - } - } - return 0; -} diff --git a/nx-X11/lib/font/fontfile/gunzip.c b/nx-X11/lib/font/fontfile/gunzip.c deleted file mode 100644 index 8c9c317aa..000000000 --- a/nx-X11/lib/font/fontfile/gunzip.c +++ /dev/null @@ -1,227 +0,0 @@ -/* $Xorg: gunzip.c,v 1.3 2000/08/17 19:46:37 cpqbld Exp $ */ -/* lib/font/fontfile/gunzip.c - written by Mark Eichin September 1996. - intended for inclusion in X11 public releases. */ -/* $XFree86: xc/lib/font/fontfile/gunzip.c,v 1.4 2000/09/19 12:46:08 eich Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include - -typedef struct _xzip_buf { - z_stream z; - int zstat; - BufChar b[BUFFILESIZE]; - BufChar b_in[BUFFILESIZE]; - BufFilePtr f; -} xzip_buf; - -static int BufZipFileClose ( BufFilePtr f, int flag ); -static int BufZipFileFill ( BufFilePtr f ); -static int BufZipFileSkip ( BufFilePtr f, int c ); -static int BufCheckZipHeader ( BufFilePtr f ); - -BufFilePtr -BufFilePushZIP (BufFilePtr f) -{ - xzip_buf *x; - - x = (xzip_buf *) xalloc (sizeof (xzip_buf)); - if (!x) return 0; - /* these are just for raw calloc/free */ - x->z.zalloc = Z_NULL; - x->z.zfree = Z_NULL; - x->z.opaque = Z_NULL; - x->f = f; - - /* force inflateInit to allocate it's own history buffer */ - x->z.next_in = Z_NULL; - x->z.next_out = Z_NULL; - x->z.avail_in = x->z.avail_out = 0; - - /* using negative windowBits sets "nowrap" mode, which turns off - zlib header checking [undocumented, for gzip compatibility only?] */ - x->zstat = inflateInit2(&(x->z), -MAX_WBITS); - if (x->zstat != Z_OK) { - xfree(x); - return 0; - } - - /* now that the history buffer is allocated, we provide the data buffer */ - x->z.next_out = x->b; - x->z.avail_out = BUFFILESIZE; - x->z.next_out = x->b_in; - x->z.avail_in = 0; - - if (BufCheckZipHeader(x->f)) { - xfree(x); - return 0; - } - - return BufFileCreate((char *)x, - BufZipFileFill, - 0, - BufZipFileSkip, - BufZipFileClose); -} - -static int -BufZipFileClose(BufFilePtr f, int flag) -{ - xzip_buf *x = (xzip_buf *)f->private; - inflateEnd (&(x->z)); - BufFileClose (x->f, flag); - xfree (x); - return 1; -} - -/* here's the real work. - -- we need to put stuff in f.buffer, update f.left and f.bufp, - then return the first byte (or BUFFILEEOF). - -- to do this, we need to get stuff into avail_in, and next_in, - and call inflate appropriately. - -- we may also need to add CRC maintenance - if inflate tells us - Z_STREAM_END, we then have 4bytes CRC and 4bytes length... - gzio.c:gzread shows most of the mechanism. - */ -static int -BufZipFileFill (BufFilePtr f) -{ - xzip_buf *x = (xzip_buf *)f->private; - - /* we only get called when left == 0... */ - /* but just in case, deal */ - if (f->left >= 0) { - f->left--; - return *(f->bufp++); - } - /* did we run out last time? */ - switch (x->zstat) { - case Z_OK: - break; - case Z_STREAM_END: - case Z_DATA_ERROR: - case Z_ERRNO: - f->left = 0; - return BUFFILEEOF; - default: - return BUFFILEEOF; - } - /* now we work to consume what we can */ - /* let zlib know what we can handle */ - x->z.next_out = x->b; - x->z.avail_out = BUFFILESIZE; - - /* and try to consume all of it */ - while (x->z.avail_out > 0) { - /* if we don't have anything to work from... */ - if (x->z.avail_in == 0) { - /* ... fill the z buf from underlying file */ - int i, c; - for (i = 0; i < sizeof(x->b_in); i++) { - c = BufFileGet(x->f); - if (c == BUFFILEEOF) break; - x->b_in[i] = c; - } - x->z.avail_in += i; - x->z.next_in = x->b_in; - } - /* so now we have some output space and some input data */ - x->zstat = inflate(&(x->z), Z_NO_FLUSH); - /* the inflation output happens in the f buffer directly... */ - if (x->zstat == Z_STREAM_END) { - /* deal with EOF, crc */ - break; - } - if (x->zstat != Z_OK) { - break; - } - } - f->bufp = x->b; - f->left = BUFFILESIZE - x->z.avail_out; - - if (f->left >= 0) { - f->left--; - return *(f->bufp++); - } else { - return BUFFILEEOF; - } -} - -/* there should be a BufCommonSkip... */ -static int -BufZipFileSkip (BufFilePtr f, int c) -{ - /* BufFileRawSkip returns the count unchanged. - BufCompressedSkip returns 0. - That means it probably never gets called... */ - int retval = c; - while(c--) { - int get = BufFileGet(f); - if (get == BUFFILEEOF) return get; - } - return retval; -} - -/* now we need to duplicate check_header */ -/* contents: - 0x1f, 0x8b -- magic number - 1 byte -- method (Z_DEFLATED) - 1 byte -- flags (mask with RESERVED -> fail) - 4 byte -- time (discard) - 1 byte -- xflags (discard) - 1 byte -- "os" code (discard) - [if flags & EXTRA_FIELD: - 2 bytes -- LSBfirst length n - n bytes -- extra data (discard)] - [if flags & ORIG_NAME: - n bytes -- null terminated name (discard)] - [if flags & COMMENT: - n bytes -- null terminated comment (discard)] - [if flags & HEAD_CRC: - 2 bytes -- crc of headers? (discard)] - */ - -/* gzip flag byte -- from gzio.c */ -#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ -#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ -#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ -#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ -#define COMMENT 0x10 /* bit 4 set: file comment present */ -#define RESERVED 0xE0 /* bits 5..7: reserved */ - -#define GET(f) do {c = BufFileGet(f); if (c == BUFFILEEOF) return c;} while(0) -static int -BufCheckZipHeader(BufFilePtr f) -{ - int c, flags; - GET(f); if (c != 0x1f) return 1; /* magic 1 */ - GET(f); if (c != 0x8b) return 2; /* magic 2 */ - GET(f); if (c != Z_DEFLATED) return 3; /* method */ - GET(f); if (c & RESERVED) return 4; /* reserved flags */ - flags = c; - GET(f); GET(f); GET(f); GET(f); /* time */ - GET(f); /* xflags */ - GET(f); /* os code */ - if (flags & EXTRA_FIELD) { - int len; - GET(f); len = c; - GET(f); len += (c<<8); - while (len-- >= 0) { - GET(f); - } - } - if (flags & ORIG_NAME) { - do { GET(f); } while (c != 0); - } - if (flags & COMMENT) { - do { GET(f); } while (c != 0); - } - if (flags & HEAD_CRC) { - GET(f); GET(f); /* header crc */ - } - return 0; -} diff --git a/nx-X11/lib/font/fontfile/module/Imakefile b/nx-X11/lib/font/fontfile/module/Imakefile deleted file mode 100644 index 0eebe085e..000000000 --- a/nx-X11/lib/font/fontfile/module/Imakefile +++ /dev/null @@ -1,21 +0,0 @@ -XCOMM $XFree86: xc/lib/font/fontfile/module/Imakefile,v 1.3 1999/06/13 13:47:35 dawes Exp $ -#include - - INCLUDES = -I$(FONTINCSRC) -I../../include -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) - - DEFINES = -DLOADABLEFONTS - - SRCS = ffcheck.c register.c - OBJS = ffcheck.o register.o - -SubdirLibraryRule($(OBJS)) - -NormalLibraryObjectRule() -NormalLintTarget($(SRCS)) - -LinkSourceFile(ffcheck.c,..) -LinkSourceFile(register.c,..) - -DependTarget() - diff --git a/nx-X11/lib/font/fontfile/printerfont.c b/nx-X11/lib/font/fontfile/printerfont.c deleted file mode 100644 index 0b6c19c62..000000000 --- a/nx-X11/lib/font/fontfile/printerfont.c +++ /dev/null @@ -1,178 +0,0 @@ -/* $Xorg: printerfont.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/printerfont.c,v 1.5tsi Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ -/* $NCDXorg: @(#)fontfile.c,v 1.6 1991/07/02 17:00:46 lemke Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include - -/* - * Map FPE functions to renderer functions - */ - -#define PRINTERPATHPREFIX "PRINTER:" - -/* STUB -int XpClientIsPrintClient(client,fpe) -pointer client; -FontPathElementPtr fpe; -{ return 1; } - */ - -static int -PrinterFontNameCheck (char *name) -{ - if (strncmp(name,PRINTERPATHPREFIX,strlen(PRINTERPATHPREFIX)) != 0) - return 0; - name += strlen(PRINTERPATHPREFIX); -#ifndef NCD - return *name == '/'; -#else - return ((strcmp(name, "built-ins") == 0) || (*name == '/')); -#endif -} - -static int -PrinterFontInitFPE (FontPathElementPtr fpe) -{ - int status; - FontDirectoryPtr dir; - char * name; - - name = fpe->name + strlen(PRINTERPATHPREFIX); - status = FontFileReadDirectory (name, &dir); - if (status == Successful) - { - if (dir->nonScalable.used > 0) - if (!FontFileRegisterBitmapSource (fpe)) - { - FontFileFreeFPE (fpe); - return AllocError; - } - fpe->private = (pointer) dir; - } - return status; -} - -/* Here we must check the client to see if it has a context attached to - * it that allows us to access the printer fonts - */ - -static int -PrinterFontOpenFont (pointer client, FontPathElementPtr fpe, Mask flags, - char *name, int namelen, - fsBitmapFormat format, fsBitmapFormatMask fmask, - XID id, FontPtr *pFont, char **aliasName, - FontPtr non_cachable_font) -{ - if (XpClientIsPrintClient(client,fpe)) - return (FontFileOpenFont (client, fpe, flags, name, namelen, format, - fmask, id, pFont, aliasName, non_cachable_font)); - return BadFontName; -} - -static int -PrinterFontListFonts (pointer client, FontPathElementPtr fpe, char *pat, - int len, int max, FontNamesPtr names) -{ - if (XpClientIsPrintClient(client,fpe)) - return FontFileListFonts (client, fpe, pat, len, max, names); - return BadFontName; -} - -static int -PrinterFontStartListFontsWithInfo(pointer client, FontPathElementPtr fpe, - char *pat, int len, int max, - pointer *privatep) -{ - if (XpClientIsPrintClient(client,fpe)) - return FontFileStartListFontsWithInfo(client, fpe, pat, len, - max, privatep); - return BadFontName; -} - -static int -PrinterFontListNextFontWithInfo(pointer client, FontPathElementPtr fpe, - char **namep, int *namelenp, - FontInfoPtr *pFontInfo, - int *numFonts, pointer private) -{ - if (XpClientIsPrintClient(client,fpe)) - return FontFileListNextFontWithInfo(client, fpe, namep, namelenp, - pFontInfo, numFonts, private); - return BadFontName; -} - -static int -PrinterFontStartListFontsAndAliases(pointer client, FontPathElementPtr fpe, - char *pat, int len, int max, - pointer *privatep) -{ - if (XpClientIsPrintClient(client,fpe)) - return FontFileStartListFontsAndAliases(client, fpe, pat, len, - max, privatep); - return BadFontName; -} - -static int -PrinterFontListNextFontOrAlias(pointer client, FontPathElementPtr fpe, - char **namep, int *namelenp, - char **resolvedp, int *resolvedlenp, - pointer private) -{ - if (XpClientIsPrintClient(client,fpe)) - return FontFileListNextFontOrAlias(client, fpe, namep, namelenp, - resolvedp, resolvedlenp, private); - return BadFontName; -} - -void -PrinterFontRegisterFpeFunctions (void) -{ - RegisterFPEFunctions(PrinterFontNameCheck, - PrinterFontInitFPE, - FontFileFreeFPE, - FontFileResetFPE, - PrinterFontOpenFont, - FontFileCloseFont, - PrinterFontListFonts, - PrinterFontStartListFontsWithInfo, - PrinterFontListNextFontWithInfo, - NULL, - NULL, - NULL, - PrinterFontStartListFontsAndAliases, - PrinterFontListNextFontOrAlias, - FontFileEmptyBitmapSource); -} diff --git a/nx-X11/lib/font/fontfile/register.c b/nx-X11/lib/font/fontfile/register.c deleted file mode 100644 index 5ddab0386..000000000 --- a/nx-X11/lib/font/fontfile/register.c +++ /dev/null @@ -1,107 +0,0 @@ -/* $Xorg: register.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/register.c,v 1.14 2001/01/17 19:43:30 dawes Exp $ */ - -/* - * This is in a separate source file so that small programs - * such as mkfontdir that want to use the fontfile utilities don't - * end up dragging in code from all the renderers, which is not small. - */ - -#ifdef HAVE_CONFIG_H -#include -#else -#define XFONT_BITMAP 1 -#endif - -#include -#include -#include - -#ifdef LOADABLEFONTS -#include -#endif - -/* - * Translate monolithic build symbols to modular build symbols. - * I chose to make the modular symbols 'canonical' because they - * are prefixed with XFONT_, neatly avoiding name collisions - * with other packages. - */ - -#ifdef BUILD_SPEEDO -# define XFONT_SPEEDO 1 -#endif -#ifdef BUILD_TYPE1 -# define XFONT_TYPE1 1 -#endif - -#ifdef BUILD_CID -# define XFONT_CID 1 -#endif -#ifdef BUILD_FREETYPE -# define XFONT_FREETYPE 1 -#endif - -void -FontFileRegisterFpeFunctions(void) -{ -#ifndef LOADABLEFONTS - -#ifdef XFONT_BITMAP - BitmapRegisterFontFileFunctions (); -#endif -#ifdef XFONT_SPEEDO - SpeedoRegisterFontFileFunctions (); -#endif -#ifdef XFONT_TYPE1 - Type1RegisterFontFileFunctions(); -#endif -#ifdef XFONT_CID - CIDRegisterFontFileFunctions(); -#endif -#ifdef XFONT_FREETYPE - FreeTypeRegisterFontFileFunctions(); -#endif - -#else - { - int i; - - if (FontModuleList) { - for (i = 0; FontModuleList[i].name; i++) { - if (FontModuleList[i].initFunc) - FontModuleList[i].initFunc(); - } - } - } -#endif - - FontFileRegisterLocalFpeFunctions (); -} - diff --git a/nx-X11/lib/font/fontfile/renderers.c b/nx-X11/lib/font/fontfile/renderers.c deleted file mode 100644 index f110ba817..000000000 --- a/nx-X11/lib/font/fontfile/renderers.c +++ /dev/null @@ -1,117 +0,0 @@ -/* $Xorg: renderers.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/fontfile/renderers.c,v 1.7 2002/12/09 17:30:00 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -extern void ErrorF(const char *f, ...); - -static FontRenderersRec renderers; - -/* - * XXX Maybe should allow unregistering renders. For now, just clear the - * list at each new generation. - */ -extern unsigned long serverGeneration; -static unsigned long rendererGeneration = 0; - -Bool -FontFileRegisterRenderer (FontRendererPtr renderer) -{ - return FontFilePriorityRegisterRenderer(renderer, 0); -} - -Bool -FontFilePriorityRegisterRenderer (FontRendererPtr renderer, int priority) -{ - int i; - struct _FontRenderersElement *new; - - if (rendererGeneration != serverGeneration) { - rendererGeneration = serverGeneration; - renderers.number = 0; - if (renderers.renderers) - xfree(renderers.renderers); - renderers.renderers = NULL; - } - - for (i = 0; i < renderers.number; i++) { - if (!strcmp (renderers.renderers[i].renderer->fileSuffix, - renderer->fileSuffix)) { - if(renderers.renderers[i].priority >= priority) { - if(renderers.renderers[i].priority == priority) { - if (rendererGeneration == 1) - ErrorF("Warning: font renderer for \"%s\" " - "already registered at priority %d\n", - renderer->fileSuffix, priority); - } - return TRUE; - } else { - break; - } - } - } - - if(i >= renderers.number) { - new = xrealloc (renderers.renderers, sizeof(*new) * (i + 1)); - if (!new) - return FALSE; - renderers.renderers = new; - renderers.number = i + 1; - } - renderer->number = i; - renderers.renderers[i].renderer = renderer; - renderers.renderers[i].priority = priority; - return TRUE; -} - -FontRendererPtr -FontFileMatchRenderer (char *fileName) -{ - int i; - int fileLen; - FontRendererPtr r; - - fileLen = strlen (fileName); - for (i = 0; i < renderers.number; i++) - { - r = renderers.renderers[i].renderer; - if (fileLen >= r->fileSuffixLen && - !strcmp (fileName + fileLen - r->fileSuffixLen, r->fileSuffix)) - { - return r; - } - } - return 0; -} diff --git a/nx-X11/lib/font/include/Imakefile b/nx-X11/lib/font/include/Imakefile deleted file mode 100644 index 73e65a41c..000000000 --- a/nx-X11/lib/font/include/Imakefile +++ /dev/null @@ -1,11 +0,0 @@ -XCOMM $Xorg$ - HEADERS = bitmap.h bufio.h fntfil.h fntfilio.h fntfilst.h \ - fontencc.h fontmisc.h fontmod.h fontshow.h fontutil.h \ - fontxlfd.h -all:: - -BuildIncludes($(HEADERS),X11/fonts,../..) - -#if BuildLibraries -InstallMultipleFlags($(HEADERS),$(INCDIR)/X11/fonts,$(INSTINCFLAGS)) -#endif diff --git a/nx-X11/lib/font/include/bitmap.h b/nx-X11/lib/font/include/bitmap.h deleted file mode 100644 index e60fda8eb..000000000 --- a/nx-X11/lib/font/include/bitmap.h +++ /dev/null @@ -1,116 +0,0 @@ -/* $Xorg: bitmap.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/include/bitmap.h,v 1.9 2001/01/17 19:43:31 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifndef _BITMAP_H_ -#define _BITMAP_H_ - -#include -#ifndef FONTMODULE -#include /* just for NULL */ -#else -#include "xf86_ansic.h" -#endif - -/* - * Internal format used to store bitmap fonts - */ - -/* number of encoding entries in one segment */ -#define BITMAP_FONT_SEGMENT_SIZE 128 - -typedef struct _BitmapExtra { - Atom *glyphNames; - int *sWidths; - CARD32 bitmapsSizes[GLYPHPADOPTIONS]; - FontInfoRec info; -} BitmapExtraRec, *BitmapExtraPtr; - -typedef struct _BitmapFont { - unsigned version_num; - int num_chars; - int num_tables; - CharInfoPtr metrics; /* font metrics, including glyph pointers */ - xCharInfo *ink_metrics; /* ink metrics */ - char *bitmaps; /* base of bitmaps, useful only to free */ - CharInfoPtr **encoding; /* array of arrays of char info pointers */ - CharInfoPtr pDefault; /* default character */ - BitmapExtraPtr bitmapExtra; /* stuff not used by X server */ -} BitmapFontRec, *BitmapFontPtr; - -#define ACCESSENCODING(enc,i) \ -(enc[(i)/BITMAP_FONT_SEGMENT_SIZE]?\ -(enc[(i)/BITMAP_FONT_SEGMENT_SIZE][(i)%BITMAP_FONT_SEGMENT_SIZE]):\ -0) -#define ACCESSENCODINGL(enc,i) \ -(enc[(i)/BITMAP_FONT_SEGMENT_SIZE][(i)%BITMAP_FONT_SEGMENT_SIZE]) - -#define SEGMENT_MAJOR(n) ((n)/BITMAP_FONT_SEGMENT_SIZE) -#define SEGMENT_MINOR(n) ((n)%BITMAP_FONT_SEGMENT_SIZE) -#define NUM_SEGMENTS(n) \ - (((n)+BITMAP_FONT_SEGMENT_SIZE-1)/BITMAP_FONT_SEGMENT_SIZE) - -extern int bitmapGetGlyphs ( FontPtr pFont, unsigned long count, - unsigned char *chars, FontEncoding charEncoding, - unsigned long *glyphCount, CharInfoPtr *glyphs ); -extern int bitmapGetMetrics ( FontPtr pFont, unsigned long count, - unsigned char *chars, FontEncoding charEncoding, - unsigned long *glyphCount, xCharInfo **glyphs ); - -extern void bitmapComputeFontBounds ( FontPtr pFont ); -extern void bitmapComputeFontInkBounds ( FontPtr pFont ); -extern Bool bitmapAddInkMetrics ( FontPtr pFont ); -extern int bitmapComputeWeight ( FontPtr pFont ); - -extern int BitmapOpenBitmap ( FontPathElementPtr fpe, FontPtr *ppFont, - int flags, FontEntryPtr entry, char *fileName, - fsBitmapFormat format, fsBitmapFormatMask fmask, - FontPtr non_cachable_font ); -extern int BitmapGetInfoBitmap ( FontPathElementPtr fpe, - FontInfoPtr pFontInfo, FontEntryPtr entry, - char *fileName ); -extern void BitmapRegisterFontFileFunctions ( void ); -extern int BitmapGetRenderIndex ( FontRendererPtr renderer ); - -extern int BitmapOpenScalable ( FontPathElementPtr fpe, FontPtr *pFont, - int flags, FontEntryPtr entry, char *fileName, - FontScalablePtr vals, fsBitmapFormat format, - fsBitmapFormatMask fmask, - FontPtr non_cachable_font ); -extern int BitmapGetInfoScalable ( FontPathElementPtr fpe, - FontInfoPtr pFontInfo, FontEntryPtr entry, - FontNamePtr fontName, char *fileName, - FontScalablePtr vals ); - -#endif /* _BITMAP_H_ */ diff --git a/nx-X11/lib/font/include/bufio.h b/nx-X11/lib/font/include/bufio.h deleted file mode 100644 index da90064a2..000000000 --- a/nx-X11/lib/font/include/bufio.h +++ /dev/null @@ -1,92 +0,0 @@ -/* $Xorg: bufio.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1993, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/include/bufio.h,v 1.6 2001/07/31 16:44:55 alanh Exp $ */ - -#ifndef ___BUFIO_H___ -#define ___BUFIO_H___ 1 - -#include - -#ifdef TEST - -#define xalloc(s) malloc(s) -#define xfree(s) free(s) - -#endif - -#define BUFFILESIZE 8192 -#define BUFFILEEOF -1 - -typedef unsigned char BufChar; -typedef struct _buffile *BufFilePtr; - -typedef struct _buffile { - BufChar *bufp; - int left; - int eof; - BufChar buffer[BUFFILESIZE]; - int (*input)( BufFilePtr /* f */); - int (*output)( int /* c */, BufFilePtr /* f */); - int (*skip)( BufFilePtr /* f */, int /* count */); - int (*close)( BufFilePtr /* f */, int /* doClose */); - char *private; -} BufFileRec; - -extern BufFilePtr BufFileCreate ( - char*, - int (*)(BufFilePtr), - int (*)(int, BufFilePtr), - int (*)(BufFilePtr, int), - int (*)(BufFilePtr, int)); -extern BufFilePtr BufFileOpenRead ( int ); -extern BufFilePtr BufFileOpenWrite ( int ); -extern BufFilePtr BufFilePushCompressed ( BufFilePtr ); -#ifdef X_GZIP_FONT_COMPRESSION -extern BufFilePtr BufFilePushZIP ( BufFilePtr ); -#endif -extern int BufFileClose ( BufFilePtr, int ); -extern int BufFileFlush ( BufFilePtr, int ); -extern int BufFileRead ( BufFilePtr, char*, int ); -extern int BufFileWrite ( BufFilePtr, char*, int ); -extern void BufFileFree ( BufFilePtr ); - -#define BufFileGet(f) ((f)->left-- ? *(f)->bufp++ : ((f)->eof = (*(f)->input) (f))) -#define BufFilePut(c,f) (--(f)->left ? *(f)->bufp++ = ((unsigned char)(c)) : (*(f)->output) ((unsigned char)(c),f)) -#define BufFileSkip(f,c) ((f)->eof = (*(f)->skip) (f, c)) - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -#endif /* ___BUFIO_H___ */ - diff --git a/nx-X11/lib/font/include/fntfil.h b/nx-X11/lib/font/include/fntfil.h deleted file mode 100644 index 81d2cbc3d..000000000 --- a/nx-X11/lib/font/include/fntfil.h +++ /dev/null @@ -1,178 +0,0 @@ -/* $Xorg: fntfil.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/include/fntfil.h,v 1.9 2001/12/14 19:56:54 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifndef _FONTFILE_H_ -#define _FONTFILE_H_ - -#include - -typedef struct _FontEntry *FontEntryPtr; -typedef struct _FontTable *FontTablePtr; -typedef struct _FontName *FontNamePtr; -typedef struct _FontScaled *FontScaledPtr; -typedef struct _FontScalableExtra *FontScalableExtraPtr; -typedef struct _FontScalableEntry *FontScalableEntryPtr; -typedef struct _FontScaleAliasEntry *FontScaleAliasEntryPtr; -typedef struct _FontBitmapEntry *FontBitmapEntryPtr; -typedef struct _FontAliasEntry *FontAliasEntryPtr; -typedef struct _FontBCEntry *FontBCEntryPtr; -typedef struct _FontDirectory *FontDirectoryPtr; -typedef struct _FontRenderer *FontRendererPtr; - -#define NullFontEntry ((FontEntryPtr) 0) -#define NullFontTable ((FontTablePtr) 0) -#define NullFontName ((FontNamePtr) 0) -#define NullFontScaled ((FontScaled) 0) -#define NullFontScalableExtra ((FontScalableExtra) 0) -#define NullFontscalableEntry ((FontScalableEntry) 0) -#define NullFontScaleAliasEntry ((FontScaleAliasEntry) 0) -#define NullFontBitmapEntry ((FontBitmapEntry) 0) -#define NullFontAliasEntry ((FontAliasEntry) 0) -#define NullFontBCEntry ((FontBCEntry) 0) -#define NullFontDirectory ((FontDirectoryPtr) 0) -#define NullFontRenderer ((FontRendererPtr) 0) - -#define FONT_ENTRY_SCALABLE 0 -#define FONT_ENTRY_SCALE_ALIAS 1 -#define FONT_ENTRY_BITMAP 2 -#define FONT_ENTRY_ALIAS 3 -#define FONT_ENTRY_BC 4 - -#define MAXFONTNAMELEN 1024 -#define MAXFONTFILENAMELEN 1024 - -#define FontDirFile "fonts.dir" -#define FontAliasFile "fonts.alias" -#define FontScalableFile "fonts.scale" - -extern int FontFileNameCheck ( char *name ); -extern int FontFileInitFPE ( FontPathElementPtr fpe ); -extern int FontFileResetFPE ( FontPathElementPtr fpe ); -extern int FontFileFreeFPE ( FontPathElementPtr fpe ); -extern int FontFileOpenFont ( pointer client, FontPathElementPtr fpe, - Mask flags, char *name, int namelen, - fsBitmapFormat format, fsBitmapFormatMask fmask, - XID id, FontPtr *pFont, char **aliasName, - FontPtr non_cachable_font ); -extern void FontFileCloseFont ( FontPathElementPtr fpe, FontPtr pFont ); -extern int FontFileOpenBitmap ( FontPathElementPtr fpe, FontPtr *pFont, - int flags, FontEntryPtr entry, - fsBitmapFormat format, - fsBitmapFormatMask fmask ); -extern int FontFileListFonts ( pointer client, FontPathElementPtr fpe, - char *pat, int len, int max, - FontNamesPtr names ); -extern int FontFileStartListFontsWithInfo ( pointer client, - FontPathElementPtr fpe, - char *pat, int len, int max, - pointer *privatep ); -extern int FontFileListNextFontWithInfo ( pointer client, - FontPathElementPtr fpe, - char **namep, int *namelenp, - FontInfoPtr *pFontInfo, - int *numFonts, pointer private ); -extern int FontFileStartListFontsAndAliases ( pointer client, - FontPathElementPtr fpe, - char *pat, int len, int max, - pointer *privatep ); -extern int FontFileListNextFontOrAlias ( pointer client, - FontPathElementPtr fpe, - char **namep, int *namelenp, - char **resolvedp, int *resolvedlenp, - pointer private ); -extern void FontFileRegisterLocalFpeFunctions ( void ); - - -extern FontEntryPtr FontFileAddEntry ( FontTablePtr table, - FontEntryPtr prototype ); -extern Bool FontFileAddFontAlias ( FontDirectoryPtr dir, char *aliasName, - char *fontName ); -extern Bool FontFileAddFontFile ( FontDirectoryPtr dir, char *fontName, - char *fileName ); -extern int FontFileCountDashes ( char *name, int namelen ); -extern FontEntryPtr FontFileFindNameInDir ( FontTablePtr table, - FontNamePtr pat ); -extern FontEntryPtr FontFileFindNameInScalableDir ( FontTablePtr table, - FontNamePtr pat, - FontScalablePtr vals ); -extern int FontFileFindNamesInDir ( FontTablePtr table, FontNamePtr pat, - int max, FontNamesPtr names ); -extern int FontFileFindNamesInScalableDir ( FontTablePtr table, - FontNamePtr pat, int max, - FontNamesPtr names, - FontScalablePtr vals, - int alias_behavior, int *newmax ); - -extern void FontFileFreeDir ( FontDirectoryPtr dir ); -extern void FontFileFreeEntry ( FontEntryPtr entry ); -extern void FontFileFreeTable ( FontTablePtr table ); -extern Bool FontFileInitTable ( FontTablePtr table, int size ); -extern FontDirectoryPtr FontFileMakeDir ( char *dirName, int size ); -extern Bool FontFileMatchName ( char *name, int length, FontNamePtr pat ); -extern char * FontFileSaveString ( char *s ); -extern void FontFileSortDir ( FontDirectoryPtr dir ); -extern void FontFileSortTable ( FontTablePtr table ); - -extern void FontDefaultFormat ( int *bit, int *byte, int *glyph, int *scan ); - -extern Bool FontFileRegisterRenderer ( FontRendererPtr renderer ); -extern Bool FontFilePriorityRegisterRenderer ( FontRendererPtr renderer, - int priority ); -extern FontRendererPtr FontFileMatchRenderer ( char *fileName ); - -extern Bool FontFileAddScaledInstance ( FontEntryPtr entry, - FontScalablePtr vals, FontPtr pFont, - char *bitmapName ); -extern void FontFileSwitchStringsToBitmapPointers ( FontDirectoryPtr dir ); -extern void FontFileRemoveScaledInstance ( FontEntryPtr entry, FontPtr pFont ); -extern Bool FontFileCompleteXLFD ( FontScalablePtr vals, FontScalablePtr def ); -extern FontScaledPtr FontFileFindScaledInstance ( FontEntryPtr entry, - FontScalablePtr vals, - int noSpecificSize ); - -extern Bool FontFileRegisterBitmapSource ( FontPathElementPtr fpe ); -extern void FontFileUnregisterBitmapSource ( FontPathElementPtr fpe ); -extern void FontFileEmptyBitmapSource ( void ); -extern int FontFileMatchBitmapSource ( FontPathElementPtr fpe, - FontPtr *pFont, int flags, - FontEntryPtr entry, - FontNamePtr zeroPat, - FontScalablePtr vals, - fsBitmapFormat format, - fsBitmapFormatMask fmask, - Bool noSpecificSize ); - -extern int FontFileReadDirectory ( char *directory, FontDirectoryPtr *pdir ); -extern Bool FontFileDirectoryChanged ( FontDirectoryPtr dir ); - -#endif /* _FONTFILE_H_ */ diff --git a/nx-X11/lib/font/include/fntfilio.h b/nx-X11/lib/font/include/fntfilio.h deleted file mode 100644 index f8e24f390..000000000 --- a/nx-X11/lib/font/include/fntfilio.h +++ /dev/null @@ -1,56 +0,0 @@ -/* $Xorg: fntfilio.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/include/fntfilio.h,v 1.6 2001/10/31 22:50:26 tsi Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifndef _FNTFILIO_H_ -#define _FNTFILIO_H_ - -#include - -typedef BufFilePtr FontFilePtr; - -#define FontFileGetc(f) BufFileGet(f) -#define FontFilePutc(c,f) BufFilePut(c,f) -#define FontFileRead(f,b,n) BufFileRead(f,b,n) -#define FontFileWrite(f,b,n) BufFileWrite(f,b,n) -#define FontFileSkip(f,n) (BufFileSkip (f, n) != BUFFILEEOF) -#define FontFileSeek(f,n) (BufFileSeek (f,n,0) != BUFFILEEOF) - -#define FontFileEOF BUFFILEEOF - -extern FontFilePtr FontFileOpen ( const char *name ); -extern int FontFileClose ( FontFilePtr f ); -extern FontFilePtr FontFileOpenWrite ( const char *name ); -extern FontFilePtr FontFileOpenWriteFd ( int fd ); -extern FontFilePtr FontFileOpenFd ( int fd ); - -#endif /* _FNTFILIO_H_ */ diff --git a/nx-X11/lib/font/include/fntfilst.h b/nx-X11/lib/font/include/fntfilst.h deleted file mode 100644 index 1a71eae7a..000000000 --- a/nx-X11/lib/font/include/fntfilst.h +++ /dev/null @@ -1,198 +0,0 @@ -/* $Xorg: fntfilst.h,v 1.5 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/include/fntfilst.h,v 3.8 2002/12/09 17:30:00 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifndef _FONTFILEST_H_ -#define _FONTFILEST_H_ - -#ifndef FONTMODULE -#include -#endif -#ifndef XP_PSTEXT -#include -#endif -#include -#include -#include - -typedef struct _FontName { - char *name; - short length; - short ndashes; -} FontNameRec; - -typedef struct _FontScaled { - FontScalableRec vals; - FontEntryPtr bitmap; - FontPtr pFont; -} FontScaledRec; - -typedef struct _FontScalableExtra { - FontScalableRec defaults; - int numScaled; - int sizeScaled; - FontScaledPtr scaled; - pointer private; -} FontScalableExtraRec; - -typedef struct _FontScalableEntry { - FontRendererPtr renderer; - char *fileName; - FontScalableExtraPtr extra; -} FontScalableEntryRec; - -/* - * This "can't" work yet - the returned alias string must be permanent, - * but this layer would need to generate the appropriate name from the - * resolved scalable + the XLFD values passed in. XXX - */ - -typedef struct _FontScaleAliasEntry { - char *resolved; -} FontScaleAliasEntryRec; - -typedef struct _FontBitmapEntry { - FontRendererPtr renderer; - char *fileName; - FontPtr pFont; -} FontBitmapEntryRec; - -typedef struct _FontAliasEntry { - char *resolved; -} FontAliasEntryRec; - -typedef struct _FontBCEntry { - FontScalableRec vals; - FontEntryPtr entry; -} FontBCEntryRec; - -typedef struct _FontEntry { - FontNameRec name; - int type; - union _FontEntryParts { - FontScalableEntryRec scalable; - FontBitmapEntryRec bitmap; - FontAliasEntryRec alias; - FontBCEntryRec bc; - } u; -} FontEntryRec; - -typedef struct _FontTable { - int used; - int size; - FontEntryPtr entries; - Bool sorted; -} FontTableRec; - -typedef struct _FontDirectory { - char *directory; - unsigned long dir_mtime; - unsigned long alias_mtime; - FontTableRec scalable; - FontTableRec nonScalable; - char *attributes; -} FontDirectoryRec; - -/* Capability bits: for definition of capabilities bitmap in the - FontRendererRec to indicate support of XLFD enhancements */ - -#define CAP_MATRIX 0x1 -#define CAP_CHARSUBSETTING 0x2 - -typedef struct _FontRenderer { - char *fileSuffix; - int fileSuffixLen; - int (*OpenBitmap)(FontPathElementPtr /* fpe */, - FontPtr * /* pFont */, - int /* flags */, - FontEntryPtr /* entry */, - char * /* fileName */, - fsBitmapFormat /* format */, - fsBitmapFormatMask /* mask */, - FontPtr /* non_cachable_font */); - int (*OpenScalable)(FontPathElementPtr /* fpe */, - FontPtr * /* pFont */, - int /* flags */, - FontEntryPtr /* entry */, - char * /* fileName */, - FontScalablePtr /* vals */, - fsBitmapFormat /* format */, - fsBitmapFormatMask /* fmask */, - FontPtr /* non_cachable_font */); - int (*GetInfoBitmap)(FontPathElementPtr /* fpe */, - FontInfoPtr /* pFontInfo */, - FontEntryPtr /* entry */, - char * /*fileName */); - int (*GetInfoScalable)(FontPathElementPtr /* fpe */, - FontInfoPtr /* pFontInfo */, - FontEntryPtr /* entry */, - FontNamePtr /* fontName */, - char * /* fileName */, - FontScalablePtr /* vals */); - int number; - int capabilities; /* Bitmap components defined above */ -} FontRendererRec; - -typedef struct _FontRenders { - int number; - struct _FontRenderersElement { - /* In order to preserve backward compatibility, the - priority field is made invisible to renderers */ - FontRendererPtr renderer; - int priority; - } *renderers; -} FontRenderersRec, *FontRenderersPtr; - -typedef struct _BitmapInstance { - FontScalableRec vals; - FontBitmapEntryPtr bitmap; -} BitmapInstanceRec, *BitmapInstancePtr; - -typedef struct _BitmapScalablePrivate { - int numInstances; - BitmapInstancePtr instances; -} BitmapScalablePrivateRec, *BitmapScalablePrivatePtr; - -typedef struct _BitmapSources { - FontPathElementPtr *fpe; - int size; - int count; -} BitmapSourcesRec, *BitmapSourcesPtr; - -extern BitmapSourcesRec FontFileBitmapSources; - -/* Defines for FontFileFindNamesInScalableDir() behavior */ -#define NORMAL_ALIAS_BEHAVIOR 0 -#define LIST_ALIASES_AND_TARGET_NAMES (1<<0) -#define IGNORE_SCALABLE_ALIASES (1<<1) - -#endif /* _FONTFILEST_H_ */ diff --git a/nx-X11/lib/font/include/fontencc.h b/nx-X11/lib/font/include/fontencc.h deleted file mode 100644 index 51e0e1440..000000000 --- a/nx-X11/lib/font/include/fontencc.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright (c) 1998-2001 by Juliusz Chroboczek - -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. -*/ -/* $XFree86$ */ - -/* Binary compatibility entry points. */ - -/* This file includes code to make modules compiled for earlier - versions of the fontenc interfaces link with this one. It does - *not* provide source compatibility, as many of the data structures - now have different names. */ - -extern char *font_encoding_from_xlfd(const char*, int); -extern unsigned font_encoding_recode(unsigned, FontEncPtr, FontMapPtr); -extern FontEncPtr font_encoding_find(const char*, const char*); -extern char *font_encoding_name(unsigned, FontEncPtr, FontMapPtr); -extern char **identifyEncodingFile(const char *fileName); - diff --git a/nx-X11/lib/font/include/fontmisc.h b/nx-X11/lib/font/include/fontmisc.h deleted file mode 100644 index b7e359068..000000000 --- a/nx-X11/lib/font/include/fontmisc.h +++ /dev/null @@ -1,133 +0,0 @@ -/* $Xorg: fontmisc.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/include/fontmisc.h,v 3.16 2001/12/14 19:56:54 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifndef _FONTMISC_H_ -#define _FONTMISC_H_ - -#ifndef FONTMODULE -#include -#include -#include - -#ifndef X_NOT_POSIX -#include -#else -extern int close(); -#endif - -#endif /* FONTMODULE */ - -#include "X11/Xdefs.h" - - -#ifndef LSBFirst -#define LSBFirst 0 -#define MSBFirst 1 -#endif - -#ifndef None -#define None 0l -#endif - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -extern Atom MakeAtom ( char *string, unsigned len, int makeit ); -extern int ValidAtom ( Atom atom ); -extern char *NameForAtom (Atom atom); - -#ifndef _HAVE_XALLOC_DECLS -#define _HAVE_XALLOC_DECLS -extern pointer Xalloc(unsigned long); -extern pointer Xrealloc(pointer, unsigned long); -extern void Xfree(pointer); -extern pointer Xcalloc(unsigned long); -#endif -extern int f_strcasecmp(const char *s1, const char *s2); - -#ifndef xalloc -#define xalloc(n) Xalloc ((unsigned) n) -#define xfree(p) Xfree ((pointer) p) -#define xrealloc(p,n) Xrealloc ((pointer)p,n) -#define xcalloc(n,s) Xcalloc((unsigned) n * (unsigned) s) -#endif -#define lowbit(x) ((x) & (~(x) + 1)) - -#undef assert -#define assert(x) ((void)0) - -#ifndef strcasecmp -#if defined(NEED_STRCASECMP) && !defined(FONTMODULE) -#define strcasecmp(s1,s2) f_strcasecmp(s1,s2) -#endif -#endif - -extern void -BitOrderInvert( - register unsigned char *, - register int -); - -extern void -TwoByteSwap( - register unsigned char *, - register int -); - -extern void -FourByteSwap( - register unsigned char *, - register int -); - -extern int -RepadBitmap ( - char*, - char*, - unsigned, - unsigned, - int, - int -); - -extern void CopyISOLatin1Lowered( - char * /*dest*/, - char * /*source*/, - int /*length*/ -); - -extern void register_fpe_functions(void); - -#endif /* _FONTMISC_H_ */ diff --git a/nx-X11/lib/font/include/fontmod.h b/nx-X11/lib/font/include/fontmod.h deleted file mode 100644 index 42d277fd4..000000000 --- a/nx-X11/lib/font/include/fontmod.h +++ /dev/null @@ -1,16 +0,0 @@ -/* $XFree86: xc/lib/font/include/fontmod.h,v 1.2 1998/07/25 06:57:09 dawes Exp $ */ - -#ifndef _FONTMOD_H_ -#define _FONTMOD_H_ - -typedef void (*InitFont)(void); - -typedef struct { - InitFont initFunc; - char * name; - pointer module; -} FontModule; - -extern FontModule *FontModuleList; - -#endif /* _FONTMOD_H_ */ diff --git a/nx-X11/lib/font/include/fontshow.h b/nx-X11/lib/font/include/fontshow.h deleted file mode 100644 index 5bb48fe18..000000000 --- a/nx-X11/lib/font/include/fontshow.h +++ /dev/null @@ -1,37 +0,0 @@ -/* $Xorg: fontshow.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#define FONT_SHOW_INFO (1<<0) -#define FONT_SHOW_PROPS (1<<1) -#define FONT_SHOW_METRICS (1<<2) -#define FONT_SHOW_GLYPHS (1<<3) -#define FONT_SHOW_ALL (FONT_SHOW_INFO|FONT_SHOW_PROPS|FONT_SHOW_GLYPHS) diff --git a/nx-X11/lib/font/include/fontutil.h b/nx-X11/lib/font/include/fontutil.h deleted file mode 100644 index 9a73eaa47..000000000 --- a/nx-X11/lib/font/include/fontutil.h +++ /dev/null @@ -1,26 +0,0 @@ -/* $XFree86: xc/lib/font/include/fontutil.h,v 1.1 1999/03/14 11:17:49 dawes Exp $ */ - -#ifndef _FONTUTIL_H_ -#define _FONTUTIL_H_ - -#include - -extern int FontCouldBeTerminal(FontInfoPtr); -extern int CheckFSFormat(fsBitmapFormat, fsBitmapFormatMask, int *, int *, - int *, int *, int *); -extern void FontComputeInfoAccelerators(FontInfoPtr); - -extern void GetGlyphs ( FontPtr font, unsigned long count, - unsigned char *chars, FontEncoding fontEncoding, - unsigned long *glyphcount, CharInfoPtr *glyphs ); -extern void QueryGlyphExtents ( FontPtr pFont, CharInfoPtr *charinfo, - unsigned long count, ExtentInfoRec *info ); -extern Bool QueryTextExtents ( FontPtr pFont, unsigned long count, - unsigned char *chars, ExtentInfoRec *info ); -extern Bool ParseGlyphCachingMode ( char *str ); -extern void InitGlyphCaching ( void ); -extern void SetGlyphCachingMode ( int newmode ); -extern int add_range ( fsRange *newrange, int *nranges, fsRange **range, - Bool charset_subset ); - -#endif /* _FONTUTIL_H_ */ diff --git a/nx-X11/lib/font/include/fontxlfd.h b/nx-X11/lib/font/include/fontxlfd.h deleted file mode 100644 index e87b93143..000000000 --- a/nx-X11/lib/font/include/fontxlfd.h +++ /dev/null @@ -1,100 +0,0 @@ -/* $Xorg: fontxlfd.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/include/fontxlfd.h,v 1.5 2001/01/17 19:43:32 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifndef _FONTXLFD_H_ -#define _FONTXLFD_H_ - -#include - -/* Constants for values_supplied bitmap */ - -#define SIZE_SPECIFY_MASK 0xf - -#define PIXELSIZE_MASK 0x3 -#define PIXELSIZE_UNDEFINED 0 -#define PIXELSIZE_SCALAR 0x1 -#define PIXELSIZE_ARRAY 0x2 -#define PIXELSIZE_SCALAR_NORMALIZED 0x3 /* Adjusted for resolution */ - -#define POINTSIZE_MASK 0xc -#define POINTSIZE_UNDEFINED 0 -#define POINTSIZE_SCALAR 0x4 -#define POINTSIZE_ARRAY 0x8 - -#define PIXELSIZE_WILDCARD 0x10 -#define POINTSIZE_WILDCARD 0x20 - -#define ENHANCEMENT_SPECIFY_MASK 0x40 - -#define CHARSUBSET_SPECIFIED 0x40 - -#define EPS 1.0e-20 -#define XLFD_NDIGITS 3 /* Round numbers in pixel and - point arrays to this many - digits for repeatability */ - -typedef struct _FontScalable { - int values_supplied; /* Bitmap identifying what advanced - capabilities or enhancements - were specified in the font name */ - double pixel_matrix[4]; - double point_matrix[4]; - - /* Pixel and point fields are deprecated in favor of the - transformation matrices. They are provided and filled in for the - benefit of rasterizers that do not handle the matrices. */ - - int pixel, - point; - - int x, - y, - width; - char *xlfdName; - int nranges; - fsRange *ranges; -} FontScalableRec, *FontScalablePtr; - - -extern double xlfd_round_double ( double x ); -extern Bool FontParseXLFDName ( char *fname, FontScalablePtr vals, int subst ); -extern fsRange *FontParseRanges ( char *name, int *nranges ); - -#define FONT_XLFD_REPLACE_NONE 0 -#define FONT_XLFD_REPLACE_STAR 1 -#define FONT_XLFD_REPLACE_ZERO 2 -#define FONT_XLFD_REPLACE_VALUE 3 - -#endif /* _FONTXLFD_H_ */ diff --git a/nx-X11/lib/font/stubs/Imakefile b/nx-X11/lib/font/stubs/Imakefile deleted file mode 100644 index 555bbf614..000000000 --- a/nx-X11/lib/font/stubs/Imakefile +++ /dev/null @@ -1,25 +0,0 @@ -XCOMM $XFree86: xc/lib/font/stubs/Imakefile,v 1.3 1999/12/15 01:14:35 robin Exp $ - -#include - -INCLUDES = -I$(FONTINCSRC) -I../include -I$(XINCLUDESRC) -SRCS = cauthgen.c csignal.c delfntcid.c errorf.c fatalerror.c \ - findoldfnt.c getcres.c getdefptsize.c getnewfntcid.c gettime.c \ - initfshdl.c regfpefunc.c rmfshdl.c servclient.c setfntauth.c \ - stfntcfnt.c xpstubs.c -OBJS = cauthgen.o csignal.o delfntcid.o errorf.o fatalerror.o \ - findoldfnt.o getcres.o getdefptsize.o getnewfntcid.o gettime.o \ - initfshdl.o regfpefunc.o rmfshdl.o servclient.o setfntauth.o \ - stfntcfnt.o xpstubs.o - -#undef _LinkBuildLibrary -#define _LinkBuildLibrary(lib) LinkBuildLibrary(lib) - -NormalLibraryObjectRule() -NormalLibraryTarget(fntstubs,$(OBJS)) -LintLibraryTarget(fntstubs,$(SRCS)) -InstallLibrary(fntstubs,$(USRLIBDIR)) -NormalLintTarget($(SRCS)) -DependTarget() - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/cauthgen.c b/nx-X11/lib/font/stubs/cauthgen.c deleted file mode 100644 index dec438d08..000000000 --- a/nx-X11/lib/font/stubs/cauthgen.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -int -client_auth_generation(ClientPtr client) -{ - return 0; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/csignal.c b/nx-X11/lib/font/stubs/csignal.c deleted file mode 100644 index c957eb837..000000000 --- a/nx-X11/lib/font/stubs/csignal.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -Bool -ClientSignal(ClientPtr client) -{ - return True; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/delfntcid.c b/nx-X11/lib/font/stubs/delfntcid.c deleted file mode 100644 index af5c0a881..000000000 --- a/nx-X11/lib/font/stubs/delfntcid.c +++ /dev/null @@ -1,13 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -void -DeleteFontClientID(Font id) -{ -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/errorf.c b/nx-X11/lib/font/stubs/errorf.c deleted file mode 100644 index 52c6042a6..000000000 --- a/nx-X11/lib/font/stubs/errorf.c +++ /dev/null @@ -1,13 +0,0 @@ -/* $XFree86: xc/lib/font/stubs/errorf.c,v 1.1 1999/01/11 05:13:19 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -void -ErrorF(const char *f, ...) -{ -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/fatalerror.c b/nx-X11/lib/font/stubs/fatalerror.c deleted file mode 100644 index 7dff1704d..000000000 --- a/nx-X11/lib/font/stubs/fatalerror.c +++ /dev/null @@ -1,13 +0,0 @@ -/* $XFree86: xc/lib/font/stubs/fatalerror.c,v 1.1 1999/01/11 05:13:19 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -void -FatalError(const char *f, ...) -{ -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/findoldfnt.c b/nx-X11/lib/font/stubs/findoldfnt.c deleted file mode 100644 index 218ecd479..000000000 --- a/nx-X11/lib/font/stubs/findoldfnt.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -FontPtr -find_old_font(FSID id) -{ - return (FontPtr)NULL; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/getcres.c b/nx-X11/lib/font/stubs/getcres.c deleted file mode 100644 index da0de9174..000000000 --- a/nx-X11/lib/font/stubs/getcres.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -FontResolutionPtr -GetClientResolutions(int *num) -{ - return (FontResolutionPtr) 0; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/getdefptsize.c b/nx-X11/lib/font/stubs/getdefptsize.c deleted file mode 100644 index 10a46c86e..000000000 --- a/nx-X11/lib/font/stubs/getdefptsize.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -int -GetDefaultPointSize(void) -{ - return 0; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/getnewfntcid.c b/nx-X11/lib/font/stubs/getnewfntcid.c deleted file mode 100644 index 5a1e9270a..000000000 --- a/nx-X11/lib/font/stubs/getnewfntcid.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -Font -GetNewFontClientID(void) -{ - return (Font)0; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/gettime.c b/nx-X11/lib/font/stubs/gettime.c deleted file mode 100644 index 60a4e3951..000000000 --- a/nx-X11/lib/font/stubs/gettime.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -unsigned long -GetTimeInMillis (void) -{ - return 0; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/initfshdl.c b/nx-X11/lib/font/stubs/initfshdl.c deleted file mode 100644 index 15a337a29..000000000 --- a/nx-X11/lib/font/stubs/initfshdl.c +++ /dev/null @@ -1,15 +0,0 @@ -/* $XFree86: xc/lib/font/stubs/initfshdl.c,v 1.1 1999/01/11 05:13:20 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -int -init_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr block_handler) -{ - return Successful; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/regfpefunc.c b/nx-X11/lib/font/stubs/regfpefunc.c deleted file mode 100644 index d6fcf3be3..000000000 --- a/nx-X11/lib/font/stubs/regfpefunc.c +++ /dev/null @@ -1,28 +0,0 @@ -/* $XFree86: xc/lib/font/stubs/regfpefunc.c,v 1.1 1999/01/11 05:13:20 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -int -RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func) -{ - return 0; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/rmfshdl.c b/nx-X11/lib/font/stubs/rmfshdl.c deleted file mode 100644 index ae0ab7863..000000000 --- a/nx-X11/lib/font/stubs/rmfshdl.c +++ /dev/null @@ -1,15 +0,0 @@ -/* $XFree86: xc/lib/font/stubs/rmfshdl.c,v 1.1 1999/01/11 05:13:21 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -void -remove_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr blockHandler, - Bool all) -{ -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/servclient.c b/nx-X11/lib/font/stubs/servclient.c deleted file mode 100644 index 25c853f87..000000000 --- a/nx-X11/lib/font/stubs/servclient.c +++ /dev/null @@ -1,3 +0,0 @@ -/* $XFree86$ */ - -void *serverClient = 0; diff --git a/nx-X11/lib/font/stubs/setfntauth.c b/nx-X11/lib/font/stubs/setfntauth.c deleted file mode 100644 index 843f155e5..000000000 --- a/nx-X11/lib/font/stubs/setfntauth.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -int -set_font_authorizations(char **authorizations, int *authlen, ClientPtr client) -{ - return 0; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/stfntcfnt.c b/nx-X11/lib/font/stubs/stfntcfnt.c deleted file mode 100644 index c062677f6..000000000 --- a/nx-X11/lib/font/stubs/stfntcfnt.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $XFree86$ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -int -StoreFontClientFont(FontPtr pfont, Font id) -{ - return 0; -} - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/stubs.h b/nx-X11/lib/font/stubs/stubs.h deleted file mode 100644 index d687a77e3..000000000 --- a/nx-X11/lib/font/stubs/stubs.h +++ /dev/null @@ -1,27 +0,0 @@ -/* $XFree86: xc/lib/font/stubs/stubs.h,v 1.3 1999/12/15 01:14:36 robin Exp $ */ - -/* This directory includes dummy entry for bdftopcf and mkfontdir */ - -#include -#include -#include - - -#ifndef True -#define True (-1) -#endif -#ifndef False -#define False (0) -#endif - -extern FontPtr find_old_font ( FSID id ); -extern int set_font_authorizations ( char **authorizations, - int *authlen, - ClientPtr client ); - -extern unsigned long GetTimeInMillis (void); - -extern void ErrorF(const char *format, ...); -extern void FatalError(const char *format, ...); - -/* end of file */ diff --git a/nx-X11/lib/font/stubs/xpstubs.c b/nx-X11/lib/font/stubs/xpstubs.c deleted file mode 100644 index 444915367..000000000 --- a/nx-X11/lib/font/stubs/xpstubs.c +++ /dev/null @@ -1,24 +0,0 @@ -/* $XFree86$ */ - -/* - stub for XpClient* functions. -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "stubs.h" - -Bool -XpClientIsBitmapClient(ClientPtr client) -{ - return True; -} - -Bool -XpClientIsPrintClient(ClientPtr client, FontPathElementPtr fpe) -{ - return False; -} - -/* end of file */ diff --git a/nx-X11/lib/font/util/Imakefile b/nx-X11/lib/font/util/Imakefile deleted file mode 100644 index 6c318ba7f..000000000 --- a/nx-X11/lib/font/util/Imakefile +++ /dev/null @@ -1,43 +0,0 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:39 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/lib/font/util/Imakefile,v 1.6 2000/12/07 16:40:30 dawes Exp $ - -#include - - INCLUDES = -I$(FONTINCSRC) -I../include - HEADERS = -#ifdef FontFormatDefines - FORMAT_DEFS = FontFormatDefines -#endif - -#if defined(SunArchitecture) && (OSMajorVersion == 5) && (OSMinorVersion <= 6) - /* Work around a problem with __ctype being a "relocation against - allocatable but non-writable section" on Solaris 2.6. Hopefully - it doesn't break anything. */ - SYS_DEFINES = -D__XPG4_CHAR_CLASS__ -#endif - - - DEFINES = StrcasecmpDefines $(SYS_DEFINES) $(INTERNALDEFINES) - - SRCS = utilbitmap.c fontnames.c fontutil.c fontxlfd.c format.c \ - fontaccel.c atom.c miscutil.c private.c patcache.c - - OBJS = utilbitmap.o fontnames.o fontutil.o fontxlfd.o format.o \ - fontaccel.o atom.o miscutil.o private.o patcache.o - -#define DoNormalLib NormalLibFont -#define DoSharedLib SharedLibFont -#define DoDebugLib DebugLibFont -#define DoProfileLib ProfileLibFont -#include -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() - diff --git a/nx-X11/lib/font/util/atom.c b/nx-X11/lib/font/util/atom.c deleted file mode 100644 index 942ea0d46..000000000 --- a/nx-X11/lib/font/util/atom.c +++ /dev/null @@ -1,233 +0,0 @@ -/* $Xorg: atom.c,v 1.5 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/atom.c,v 1.9 2002/09/19 13:22:00 tsi Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -/* lame atom replacement routines for font applications */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include - -typedef struct _AtomList { - char *name; - int len; - int hash; - Atom atom; -} AtomListRec, *AtomListPtr; - -static AtomListPtr *hashTable; - -static int hashSize, hashUsed; -static int hashMask; -static int rehash; - -static AtomListPtr *reverseMap; -static int reverseMapSize; -static Atom lastAtom; - -static int -Hash(char *string, int len) -{ - int h; - - h = 0; - while (len--) - h = (h << 3) ^ *string++; - if (h < 0) - return -h; - return h; -} - -static int -ResizeHashTable (void) -{ - int newHashSize; - int newHashMask; - AtomListPtr *newHashTable; - int i; - int h; - int newRehash; - int r; - - if (hashSize == 0) - newHashSize = 1024; - else - newHashSize = hashSize * 2; - newHashTable = (AtomListPtr *) xalloc (newHashSize * sizeof (AtomListPtr)); - if (!newHashTable) { - fprintf(stderr, "ResizeHashTable(): Error: Couldn't allocate" - " newHashTable (%ld)\n", - newHashSize * (unsigned long)sizeof (AtomListPtr)); - return FALSE; - } - bzero ((char *) newHashTable, newHashSize * sizeof (AtomListPtr)); - newHashMask = newHashSize - 1; - newRehash = (newHashMask - 2); - for (i = 0; i < hashSize; i++) - { - if (hashTable[i]) - { - h = (hashTable[i]->hash) & newHashMask; - if (newHashTable[h]) - { - r = hashTable[i]->hash % newRehash | 1; - do { - h += r; - if (h >= newHashSize) - h -= newHashSize; - } while (newHashTable[h]); - } - newHashTable[h] = hashTable[i]; - } - } - xfree (hashTable); - hashTable = newHashTable; - hashSize = newHashSize; - hashMask = newHashMask; - rehash = newRehash; - return TRUE; -} - -static int -ResizeReverseMap (void) -{ - int ret = TRUE; - if (reverseMapSize == 0) - reverseMapSize = 1000; - else - reverseMapSize *= 2; - reverseMap = (AtomListPtr *) xrealloc (reverseMap, reverseMapSize * sizeof (AtomListPtr)); - if (!reverseMap) { - fprintf(stderr, "ResizeReverseMap(): Error: Couldn't reallocate" - " reverseMap (%ld)\n", - reverseMapSize * (unsigned long)sizeof(AtomListPtr)); - ret = FALSE; - } - return ret; -} - -static int -NameEqual (const char *a, const char *b, int l) -{ - while (l--) - if (*a++ != *b++) - return FALSE; - return TRUE; -} - -Atom -MakeAtom(char *string, unsigned len, int makeit) -{ - AtomListPtr a; - int hash; - int h = 0; - int r; - - hash = Hash (string, len); - if (hashTable) - { - h = hash & hashMask; - if (hashTable[h]) - { - if (hashTable[h]->hash == hash && hashTable[h]->len == len && - NameEqual (hashTable[h]->name, string, len)) - { - return hashTable[h]->atom; - } - r = (hash % rehash) | 1; - for (;;) - { - h += r; - if (h >= hashSize) - h -= hashSize; - if (!hashTable[h]) - break; - if (hashTable[h]->hash == hash && hashTable[h]->len == len && - NameEqual (hashTable[h]->name, string, len)) - { - return hashTable[h]->atom; - } - } - } - } - if (!makeit) - return None; - a = (AtomListPtr) xalloc (sizeof (AtomListRec) + len + 1); - if (a == NULL) { - fprintf(stderr, "MakeAtom(): Error: Couldn't allocate AtomListRec" - " (%ld)\n", (unsigned long)sizeof (AtomListRec) + len + 1); - return None; - } - a->name = (char *) (a + 1); - a->len = len; - strncpy (a->name, string, len); - a->name[len] = '\0'; - a->atom = ++lastAtom; - a->hash = hash; - if (hashUsed >= hashSize / 2) - { - ResizeHashTable (); - h = hash & hashMask; - if (hashTable[h]) - { - r = (hash % rehash) | 1; - do { - h += r; - if (h >= hashSize) - h -= hashSize; - } while (hashTable[h]); - } - } - hashTable[h] = a; - hashUsed++; - if (reverseMapSize <= a->atom) { - if (!ResizeReverseMap()) - return None; - } - reverseMap[a->atom] = a; - return a->atom; -} - -int -ValidAtom(Atom atom) -{ - return (atom != None) && (atom <= lastAtom); -} - -char * -NameForAtom(Atom atom) -{ - if (atom != None && atom <= lastAtom) - return reverseMap[atom]->name; - return NULL; -} diff --git a/nx-X11/lib/font/util/fontaccel.c b/nx-X11/lib/font/util/fontaccel.c deleted file mode 100644 index c37f69a39..000000000 --- a/nx-X11/lib/font/util/fontaccel.c +++ /dev/null @@ -1,107 +0,0 @@ -/* $Xorg: fontaccel.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/fontaccel.c,v 1.6 2001/01/17 19:43:33 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include - -void -FontComputeInfoAccelerators(FontInfoPtr pFontInfo) -{ - pFontInfo->noOverlap = FALSE; - if (pFontInfo->maxOverlap <= pFontInfo->minbounds.leftSideBearing) - pFontInfo->noOverlap = TRUE; - - if ((pFontInfo->minbounds.ascent == pFontInfo->maxbounds.ascent) && - (pFontInfo->minbounds.descent == pFontInfo->maxbounds.descent) && - (pFontInfo->minbounds.leftSideBearing == - pFontInfo->maxbounds.leftSideBearing) && - (pFontInfo->minbounds.rightSideBearing == - pFontInfo->maxbounds.rightSideBearing) && - (pFontInfo->minbounds.characterWidth == - pFontInfo->maxbounds.characterWidth) && - (pFontInfo->minbounds.attributes == pFontInfo->maxbounds.attributes)) { - pFontInfo->constantMetrics = TRUE; - if ((pFontInfo->maxbounds.leftSideBearing == 0) && - (pFontInfo->maxbounds.rightSideBearing == - pFontInfo->maxbounds.characterWidth) && - (pFontInfo->maxbounds.ascent == pFontInfo->fontAscent) && - (pFontInfo->maxbounds.descent == pFontInfo->fontDescent)) - pFontInfo->terminalFont = TRUE; - else - pFontInfo->terminalFont = FALSE; - } else { - pFontInfo->constantMetrics = FALSE; - pFontInfo->terminalFont = FALSE; - } - if (pFontInfo->minbounds.characterWidth == pFontInfo->maxbounds.characterWidth) - pFontInfo->constantWidth = TRUE; - else - pFontInfo->constantWidth = FALSE; - - if ((pFontInfo->minbounds.leftSideBearing >= 0) && - (pFontInfo->maxOverlap <= 0) && - (pFontInfo->minbounds.ascent >= -pFontInfo->fontDescent) && - (pFontInfo->maxbounds.ascent <= pFontInfo->fontAscent) && - (-pFontInfo->minbounds.descent <= pFontInfo->fontAscent) && - (pFontInfo->maxbounds.descent <= pFontInfo->fontDescent)) - pFontInfo->inkInside = TRUE; - else - pFontInfo->inkInside = FALSE; -} - -int -FontCouldBeTerminal(FontInfoPtr pFontInfo) -{ - if ((pFontInfo->minbounds.leftSideBearing >= 0) && - (pFontInfo->maxbounds.rightSideBearing <= pFontInfo->maxbounds.characterWidth) && - (pFontInfo->minbounds.characterWidth == pFontInfo->maxbounds.characterWidth) && - (pFontInfo->maxbounds.ascent <= pFontInfo->fontAscent) && - (pFontInfo->maxbounds.descent <= pFontInfo->fontDescent) && - (pFontInfo->maxbounds.leftSideBearing != 0 || - pFontInfo->minbounds.rightSideBearing != pFontInfo->minbounds.characterWidth || - pFontInfo->minbounds.ascent != pFontInfo->fontAscent || - pFontInfo->minbounds.descent != pFontInfo->fontDescent)) { - /* blow off font with nothing but a SPACE */ - if (pFontInfo->maxbounds.ascent == 0 && - pFontInfo->maxbounds.descent == 0) - return FALSE; - return TRUE; - } - return FALSE; -} diff --git a/nx-X11/lib/font/util/fontnames.c b/nx-X11/lib/font/util/fontnames.c deleted file mode 100644 index 2d3a51752..000000000 --- a/nx-X11/lib/font/util/fontnames.c +++ /dev/null @@ -1,123 +0,0 @@ -/* $Xorg: fontnames.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/fontnames.c,v 1.4 2001/01/17 19:43:33 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - * - * @(#)fontnames.c 3.1 91/04/10 - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -void -FreeFontNames(FontNamesPtr pFN) -{ - int i; - - if (!pFN) - return; - for (i = 0; i < pFN->nnames; i++) { - xfree(pFN->names[i]); - } - xfree(pFN->names); - xfree(pFN->length); - xfree(pFN); -} - -FontNamesPtr -MakeFontNamesRecord(unsigned int size) -{ - FontNamesPtr pFN; - - pFN = (FontNamesPtr) xalloc(sizeof(FontNamesRec)); - if (pFN) { - pFN->nnames = 0; - pFN->size = size; - if (size) - { - pFN->length = (int *) xalloc(size * sizeof(int)); - pFN->names = (char **) xalloc(size * sizeof(char *)); - if (!pFN->length || !pFN->names) { - xfree(pFN->length); - xfree(pFN->names); - xfree(pFN); - pFN = (FontNamesPtr) 0; - } - } - else - { - pFN->length = 0; - pFN->names = 0; - } - } - return pFN; -} - -int -AddFontNamesName(FontNamesPtr names, char *name, int length) -{ - int index = names->nnames; - char *nelt; - - nelt = (char *) xalloc(length + 1); - if (!nelt) - return AllocError; - if (index >= names->size) { - int size = names->size << 1; - int *nlength; - char **nnames; - - if (size == 0) - size = 8; - nlength = (int *) xrealloc(names->length, size * sizeof(int)); - nnames = (char **) xrealloc(names->names, size * sizeof(char *)); - if (nlength && nnames) { - names->size = size; - names->length = nlength; - names->names = nnames; - } else { - xfree(nelt); - xfree(nlength); - xfree(nnames); - return AllocError; - } - } - names->length[index] = length; - names->names[index] = nelt; - strncpy(nelt, name, length); - nelt[length] = '\0'; - names->nnames++; - return Successful; -} diff --git a/nx-X11/lib/font/util/fontutil.c b/nx-X11/lib/font/util/fontutil.c deleted file mode 100644 index 05fe5c2f2..000000000 --- a/nx-X11/lib/font/util/fontutil.c +++ /dev/null @@ -1,443 +0,0 @@ -/* $Xorg: fontutil.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/fontutil.c,v 3.6 2001/10/28 03:32:46 tsi Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -/* Define global here... doesn't hurt the servers, and avoids - unresolved references in font clients. */ - -static int defaultGlyphCachingMode = DEFAULT_GLYPH_CACHING_MODE; -int glyphCachingMode = DEFAULT_GLYPH_CACHING_MODE; - -void -GetGlyphs(FontPtr font, - unsigned long count, - unsigned char *chars, - FontEncoding fontEncoding, - unsigned long *glyphcount, /* RETURN */ - CharInfoPtr *glyphs) /* RETURN */ -{ - (*font->get_glyphs) (font, count, chars, fontEncoding, glyphcount, glyphs); -} - -#define MIN(a,b) ((a)<(b)?(a):(b)) -#define MAX(a,b) ((a)>(b)?(a):(b)) - -void -QueryGlyphExtents(FontPtr pFont, - CharInfoPtr *charinfo, - unsigned long count, - ExtentInfoRec *info) -{ - register unsigned long i; - xCharInfo *pCI; - - info->drawDirection = pFont->info.drawDirection; - - info->fontAscent = pFont->info.fontAscent; - info->fontDescent = pFont->info.fontDescent; - - if (count != 0) { - - pCI = &((*charinfo)->metrics); charinfo++; - /* ignore nonexisting characters when calculating text extents */ - if ( !((pCI->characterWidth == 0) - && (pCI->rightSideBearing == 0) - && (pCI->leftSideBearing == 0) - && (pCI->ascent == 0) - && (pCI->descent == 0)) ) { - info->overallAscent = pCI->ascent; - info->overallDescent = pCI->descent; - info->overallLeft = pCI->leftSideBearing; - info->overallRight = pCI->rightSideBearing; - info->overallWidth = pCI->characterWidth; - } - - if (pFont->info.constantMetrics && pFont->info.noOverlap) { - info->overallWidth *= count; - info->overallRight += (info->overallWidth - - pCI->characterWidth); - } else { - for (i = 1; i < count; i++) { - pCI = &((*charinfo)->metrics); charinfo++; - /* ignore nonexisting characters when calculating extents */ - if ( !((pCI->characterWidth == 0) - && (pCI->rightSideBearing == 0) - && (pCI->leftSideBearing == 0) - && (pCI->ascent == 0) - && (pCI->descent == 0)) ) { - info->overallAscent = MAX( - info->overallAscent, - pCI->ascent); - info->overallDescent = MAX( - info->overallDescent, - pCI->descent); - info->overallLeft = MIN( - info->overallLeft, - info->overallWidth + pCI->leftSideBearing); - info->overallRight = MAX( - info->overallRight, - info->overallWidth + pCI->rightSideBearing); - /* - * yes, this order is correct; overallWidth IS incremented - * last - */ - info->overallWidth += pCI->characterWidth; - } - } - } - } else { - info->overallAscent = 0; - info->overallDescent = 0; - info->overallWidth = 0; - info->overallLeft = 0; - info->overallRight = 0; - } -} - -Bool -QueryTextExtents(FontPtr pFont, - unsigned long count, - unsigned char *chars, - ExtentInfoRec *info) -{ - xCharInfo **charinfo; - unsigned long n; - FontEncoding encoding; - int cm; - int i; - unsigned long t; - xCharInfo *defaultChar = 0; - unsigned char defc[2]; - int firstReal; - - charinfo = (xCharInfo **) xalloc(count * sizeof(xCharInfo *)); - if (!charinfo) - return FALSE; - encoding = TwoD16Bit; - if (pFont->info.lastRow == 0) - encoding = Linear16Bit; - (*pFont->get_metrics) (pFont, count, chars, encoding, &n, charinfo); - - /* Do default character substitution as get_metrics doesn't */ - -#define IsNonExistentChar(ci) (!(ci) || \ - ((ci)->ascent == 0 && \ - (ci)->descent == 0 && \ - (ci)->leftSideBearing == 0 && \ - (ci)->rightSideBearing == 0 && \ - (ci)->characterWidth == 0)) - - firstReal = n; - defc[0] = pFont->info.defaultCh >> 8; - defc[1] = pFont->info.defaultCh; - (*pFont->get_metrics) (pFont, 1, defc, encoding, &t, &defaultChar); - if ((IsNonExistentChar (defaultChar))) - defaultChar = 0; - for (i = 0; i < n; i++) - { - if ((IsNonExistentChar (charinfo[i]))) - { - if (!defaultChar) - continue; - charinfo[i] = defaultChar; - } - if (firstReal == n) - firstReal = i; - } - cm = pFont->info.constantMetrics; - pFont->info.constantMetrics = FALSE; - QueryGlyphExtents(pFont, (CharInfoPtr*) charinfo + firstReal, - n - firstReal, info); - pFont->info.constantMetrics = cm; - xfree(charinfo); - return TRUE; -} - -Bool -ParseGlyphCachingMode(char *str) -{ - if (!strcmp(str, "none")) defaultGlyphCachingMode = CACHING_OFF; - else if (!strcmp(str, "all")) defaultGlyphCachingMode = CACHE_ALL_GLYPHS; - else if (!strcmp(str, "16")) defaultGlyphCachingMode = CACHE_16_BIT_GLYPHS; - else return FALSE; - return TRUE; -} - -void -InitGlyphCaching(void) -{ - /* Set glyphCachingMode to the mode the server hopes to - support. DDX drivers that do not support the requested level - of glyph caching can call SetGlyphCachingMode to lower the - level of support. - */ - - glyphCachingMode = defaultGlyphCachingMode; -} - -/* ddxen can call SetGlyphCachingMode to inform us of what level of glyph - * caching they can support. - */ -void -SetGlyphCachingMode(int newmode) -{ - if ( (glyphCachingMode > newmode) && (newmode >= 0) ) - glyphCachingMode = newmode; -} - -#define range_alloc_granularity 16 -#define mincharp(p) ((p)->min_char_low + ((p)->min_char_high << 8)) -#define maxcharp(p) ((p)->max_char_low + ((p)->max_char_high << 8)) - -/* add_range(): Add range to a list of ranges, with coalescence */ -int -add_range(fsRange *newrange, - int *nranges, - fsRange **range, - Bool charset_subset) -{ - int first, last, middle; - unsigned long keymin, keymax; - unsigned long ptrmin = 0, ptrmax = 0; - fsRange *ptr = NULL, *ptr1, *ptr2, *endptr; - - /* There are two different ways to treat ranges: - - 1) Charset subsetting (support of the HP XLFD enhancements), in - which a range of 0x1234,0x3456 means all numbers between - 0x1234 and 0x3456, and in which min and max might be swapped. - - 2) Row/column ranges, in which a range of 0x1234,0x3456 means the - ranges 0x1234-0x1256, 0x1334-0x1356, ... , 0x3434-0x3456. - This is for support of glyph caching. - - The choice of treatment is selected with the "charset_subset" - flag */ - - /* If newrange covers multiple rows; break up the rows */ - if (!charset_subset && newrange->min_char_high != newrange->max_char_high) - { - int i, err = 0; - fsRange temprange; - for (i = newrange->min_char_high; - i <= newrange->max_char_high; - i++) - { - temprange.min_char_low = newrange->min_char_low; - temprange.max_char_low = newrange->max_char_low; - temprange.min_char_high = temprange.max_char_high = i; - err = add_range(&temprange, nranges, range, charset_subset); - if (err != Successful) break; - } - return err; - } - - keymin = mincharp(newrange); - keymax = maxcharp(newrange); - - if (charset_subset && keymin > keymax) - { - unsigned long temp = keymin; - keymin = keymax; - keymax = temp; - } - - /* add_range() maintains a sorted list; this makes possible coalescence - and binary searches */ - - /* Binary search for a range with which the new range can merge */ - - first = middle = 0; - last = *nranges - 1; - while (last >= first) - { - middle = (first + last) / 2; - ptr = (*range) + middle; - ptrmin = mincharp(ptr); - ptrmax = maxcharp(ptr); - - if (ptrmin > 0 && keymax < ptrmin - 1) last = middle - 1; - else if (keymin > ptrmax + 1) first = middle + 1; - else if (!charset_subset) - { - /* We might have a range with which to merge... IF the - result doesn't cross rows */ - if (newrange->min_char_high != ptr->min_char_high) - last = first - 1; /* Force adding a new range */ - break; - } - else break; /* We have at least one range with which we can merge */ - } - - if (last < first) - { - /* Search failed; we need to add a new range to the list. */ - - /* Grow the list if necessary */ - if (*nranges == 0 || *range == (fsRange *)0) - { - *range = (fsRange *)xalloc(range_alloc_granularity * - SIZEOF(fsRange)); - *nranges = 0; - } - else if (!(*nranges % range_alloc_granularity)) - { - *range = (fsRange *)xrealloc((char *)*range, - (*nranges + range_alloc_granularity) * - SIZEOF(fsRange)); - } - - /* If alloc failed, just return a null list */ - if (*range == (fsRange *)0) - { - *nranges = 0; - return AllocError; - } - - /* Should new entry go *at* or *after* ptr? */ - ptr = (*range) + middle; - if (middle < *nranges && keymin > ptrmin) ptr++; /* after */ - - /* Open up a space for our new range */ - memmove((char *)(ptr + 1), - (char *)ptr, - (char *)(*range + *nranges) - (char *)ptr); - - /* Insert the new range */ - ptr->min_char_low = keymin & 0xff; - ptr->min_char_high = keymin >> 8; - ptr->max_char_low = keymax & 0xff; - ptr->max_char_high = keymax >> 8; - - /* Update range count */ - (*nranges)++; - - /* Done */ - return Successful; - } - - /* Join our new range to that pointed to by "ptr" */ - if (keymin < ptrmin) - { - ptr->min_char_low = keymin & 0xff; - ptr->min_char_high = keymin >> 8; - } - if (keymax > ptrmax) - { - ptr->max_char_low = keymax & 0xff; - ptr->max_char_high = keymax >> 8; - } - - ptrmin = mincharp(ptr); - ptrmax = maxcharp(ptr); - - endptr = *range + *nranges; - - for (ptr1 = ptr; ptr1 >= *range; ptr1--) - { - if (ptrmin <= maxcharp(ptr1) + 1) - { - if (!charset_subset && ptr->min_char_high != ptr1->min_char_high) - break; - if (ptrmin >= mincharp(ptr1)) - ptrmin = mincharp(ptr1); - } - else break; - } - for (ptr2 = ptr; ptr2 < endptr; ptr2++) - { - if ((ptr2->min_char_low == 0 && ptr2->min_char_high == 0) || - ptrmax >= mincharp(ptr2) - 1) - { - if (!charset_subset && ptr->min_char_high != ptr2->min_char_high) - break; - if (ptrmax <= maxcharp(ptr2)) - ptrmax = maxcharp(ptr2); - } - else break; - } - - /* We need to coalesce ranges between ptr1 and ptr2 exclusive */ - ptr1++; - ptr2--; - if (ptr1 != ptr2) - { - memmove(ptr1, ptr2, (char *)endptr - (char *)ptr2); - *nranges -= (ptr2 - ptr1); - } - - /* Write the new range into the range list */ - ptr1->min_char_low = ptrmin & 0xff; - ptr1->min_char_high = ptrmin >> 8; - ptr1->max_char_low = ptrmax & 0xff; - ptr1->max_char_high = ptrmax >> 8; - - return Successful; -} - -/* It is difficult to find a good place for this. */ -#ifdef NEED_STRCASECMP -int -f_strcasecmp(const char *s1, const char *s2) -{ - char c1, c2; - - if (*s1 == 0) - if (*s2 == 0) - return 0; - else - return 1; - - c1 = (isupper (*s1) ? tolower (*s1) : *s1); - c2 = (isupper (*s2) ? tolower (*s2) : *s2); - while (c1 == c2) { - if (c1 == '\0') - return 0; - s1++; - s2++; - c1 = (isupper (*s1) ? tolower (*s1) : *s1); - c2 = (isupper (*s2) ? tolower (*s2) : *s2); - } - return c1 - c2; -} -#endif - diff --git a/nx-X11/lib/font/util/fontxlfd.c b/nx-X11/lib/font/util/fontxlfd.c deleted file mode 100644 index 7adf74f4c..000000000 --- a/nx-X11/lib/font/util/fontxlfd.c +++ /dev/null @@ -1,637 +0,0 @@ -/* $Xorg: fontxlfd.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/fontxlfd.c,v 3.16tsi Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#if defined(sony) && !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) -#define NO_LOCALE -#endif -#ifndef NO_LOCALE -#include -#endif -#include -#include /* for sprintf() */ - -static char * -GetInt(char *ptr, int *val) -{ - if (*ptr == '*') { - *val = -1; - ptr++; - } else - for (*val = 0; *ptr >= '0' && *ptr <= '9';) - *val = *val * 10 + *ptr++ - '0'; - if (*ptr == '-') - return ptr; - return (char *) 0; -} - -#define minchar(p) ((p).min_char_low + ((p).min_char_high << 8)) -#define maxchar(p) ((p).max_char_low + ((p).max_char_high << 8)) - - -#ifndef NO_LOCALE -static struct lconv *locale = 0; -#endif -static char *radix = ".", *plus = "+", *minus = "-"; - -static char * -readreal(char *ptr, double *result) -{ - char buffer[80], *p1, *p2; - -#ifndef NO_LOCALE - /* Figure out what symbols apply in this locale */ - - if (!locale) - { - locale = localeconv(); - if (locale->decimal_point && *locale->decimal_point) - radix = locale->decimal_point; - if (locale->positive_sign && *locale->positive_sign) - plus = locale->positive_sign; - if (locale->negative_sign && *locale->negative_sign) - minus = locale->negative_sign; - } -#endif - /* Copy the first 80 chars of ptr into our local buffer, changing - symbols as needed. */ - for (p1 = ptr, p2 = buffer; - *p1 && (p2 - buffer) < sizeof(buffer) - 1; - p1++, p2++) - { - switch(*p1) - { - case '~': *p2 = *minus; break; - case '+': *p2 = *plus; break; - case '.': *p2 = *radix; break; - default: *p2 = *p1; - } - } - *p2 = 0; - - /* Now we have something that strtod() can interpret... do it. */ - *result = strtod(buffer, &p1); - /* Return NULL if failure, pointer past number if success */ - return (p1 == buffer) ? (char *)0 : (ptr + (p1 - buffer)); -} - -static char * -xlfd_double_to_text(double value, char *buffer, int space_required) -{ - char formatbuf[40]; - register char *p1; - int ndigits, exponent; - -#ifndef NO_LOCALE - if (!locale) - { - locale = localeconv(); - if (locale->decimal_point && *locale->decimal_point) - radix = locale->decimal_point; - if (locale->positive_sign && *locale->positive_sign) - plus = locale->positive_sign; - if (locale->negative_sign && *locale->negative_sign) - minus = locale->negative_sign; - } -#endif - /* Compute a format to use to render the number */ - sprintf(formatbuf, "%%.%dle", XLFD_NDIGITS); - - if (space_required) - *buffer++ = ' '; - - /* Render the number using printf's idea of formatting */ - sprintf(buffer, formatbuf, value); - - /* Find and read the exponent value */ - for (p1 = buffer + strlen(buffer); - *p1-- != 'e' && p1[1] != 'E';); - exponent = atoi(p1 + 2); - if (value == 0.0) exponent = 0; - - /* Figure out how many digits are significant */ - while (p1 >= buffer && (!isdigit(*p1) || *p1 == '0')) p1--; - ndigits = 0; - while (p1 >= buffer) if (isdigit(*p1--)) ndigits++; - - /* Figure out notation to use */ - if (exponent >= XLFD_NDIGITS || ndigits - exponent > XLFD_NDIGITS + 1) - { - /* Scientific */ - sprintf(formatbuf, "%%.%dle", ndigits - 1); - sprintf(buffer, formatbuf, value); - } - else - { - /* Fixed */ - ndigits -= exponent + 1; - if (ndigits < 0) ndigits = 0; - sprintf(formatbuf, "%%.%dlf", ndigits); - sprintf(buffer, formatbuf, value); - if (exponent < 0) - { - p1 = buffer; - while (*p1 && *p1 != '0') p1++; - while (*p1++) p1[-1] = *p1; - } - } - - /* Last step, convert the locale-specific sign and radix characters - to our own. */ - for (p1 = buffer; *p1; p1++) - { - if (*p1 == *minus) *p1 = '~'; - else if (*p1 == *plus) *p1 = '+'; - else if (*p1 == *radix) *p1 = '.'; - } - - return buffer - space_required; -} - -double -xlfd_round_double(double x) -{ - /* Utility for XLFD users to round numbers to XLFD_NDIGITS - significant digits. How do you round to n significant digits on - a binary machine? */ - -#if defined(i386) || defined(__i386__) || \ - defined(ia64) || defined(__ia64__) || \ - defined(__alpha__) || defined(__alpha) || \ - defined(__hppa__) || \ - defined(__amd64__) || defined(__amd64) || \ - defined(sgi) -#if !defined(__UNIXOS2__) -#include - -/* if we have IEEE 754 fp, we can round to binary digits... */ - -#if (FLT_RADIX == 2) && (DBL_DIG == 15) && (DBL_MANT_DIG == 53) - -#ifndef M_LN2 -#define M_LN2 0.69314718055994530942 -#endif -#ifndef M_LN10 -#define M_LN10 2.30258509299404568402 -#endif - -/* convert # of decimal digits to # of binary digits */ -#define XLFD_NDIGITS_2 ((int)(XLFD_NDIGITS * M_LN10 / M_LN2 + 0.5)) - - union conv_d { - double d; - unsigned char b[8]; - } d; - int i,j,k,d_exp; - - if (x == 0) - return x; - - /* do minor sanity check for IEEE 754 fp and correct byte order */ - d.d = 1.0; - if (sizeof(double) == 8 && d.b[7] == 0x3f && d.b[6] == 0xf0) { - - /* - * this code will round IEEE 754 double to XLFD_NDIGITS_2 binary digits - */ - - d.d = x; - d_exp = (d.b[7] << 4) | (d.b[6] >> 4); - - i = (DBL_MANT_DIG-XLFD_NDIGITS_2) >> 3; - j = 1 << ((DBL_MANT_DIG-XLFD_NDIGITS_2) & 0x07); - for (; i<7; i++) { - k = d.b[i] + j; - d.b[i] = k; - if (k & 0x100) j = 1; - else break; - } - if ((i==7) && ((d.b[6] & 0xf0) != ((d_exp<<4) & 0xf0))) { - /* mantissa overflow: increment exponent */ - d_exp = (d_exp & 0x800 ) | ((d_exp & 0x7ff) + 1); - d.b[7] = d_exp >> 4; - d.b[6] = (d.b[6] & 0x0f) | (d_exp << 4); - } - - i = (DBL_MANT_DIG-XLFD_NDIGITS_2) >> 3; - j = 1 << ((DBL_MANT_DIG-XLFD_NDIGITS_2) & 0x07); - d.b[i] &= ~(j-1); - for (;--i>=0;) d.b[i] = 0; - - return d.d; - } - else -#endif -#endif /* !__UNIXOS2__ */ -#endif /* i386 || __i386__ */ - { - /* - * If not IEEE 754: Let printf() do it for you. - */ - - char formatbuf[40], buffer[40]; - - sprintf(formatbuf, "%%.%dlg", XLFD_NDIGITS); - sprintf(buffer, formatbuf, x); - return atof(buffer); - } -} - -static char * -GetMatrix(char *ptr, FontScalablePtr vals, int which) -{ - double *matrix; - - if (which == PIXELSIZE_MASK) - matrix = vals->pixel_matrix; - else if (which == POINTSIZE_MASK) - matrix = vals->point_matrix; - else return (char *)0; - - while (isspace(*ptr)) ptr++; - if (*ptr == '[') - { - /* This is a matrix containing real numbers. It would be nice - to use strtod() or sscanf() to read the numbers, but those - don't handle '~' for minus and we cannot force them to use a - "." for the radix. We'll have to do the hard work ourselves - (in readreal()). */ - - if ((ptr = readreal(++ptr, matrix + 0)) && - (ptr = readreal(ptr, matrix + 1)) && - (ptr = readreal(ptr, matrix + 2)) && - (ptr = readreal(ptr, matrix + 3))) - { - while (isspace(*ptr)) ptr++; - if (*ptr != ']') - ptr = (char *)0; - else - { - ptr++; - while (isspace(*ptr)) ptr++; - if (*ptr == '-') - { - if (which == POINTSIZE_MASK) - vals->values_supplied |= POINTSIZE_ARRAY; - else - vals->values_supplied |= PIXELSIZE_ARRAY; - } - else ptr = (char *)0; - } - } - } - else - { - int value; - if ((ptr = GetInt(ptr, &value))) - { - vals->values_supplied &= ~which; - if (value > 0) - { - matrix[3] = (double)value; - if (which == POINTSIZE_MASK) - { - matrix[3] /= 10.0; - vals->values_supplied |= POINTSIZE_SCALAR; - } - else - vals->values_supplied |= PIXELSIZE_SCALAR; - /* If we're concocting the pixelsize array from a scalar, - we will need to normalize element 0 for the pixel shape. - This is done in FontFileCompleteXLFD(). */ - matrix[0] = matrix[3]; - matrix[1] = matrix[2] = 0.0; - } - else if (value < 0) - { - if (which == POINTSIZE_MASK) - vals->values_supplied |= POINTSIZE_WILDCARD; - else - vals->values_supplied |= PIXELSIZE_WILDCARD; - } - } - } - return ptr; -} - - -static void -append_ranges(char *fname, int nranges, fsRange *ranges) -{ - if (nranges) - { - int i; - - strcat(fname, "["); - for (i = 0; i < nranges && strlen(fname) < 1010; i++) - { - if (i) strcat(fname, " "); - sprintf(fname + strlen(fname), "%d", - minchar(ranges[i])); - if (ranges[i].min_char_low == - ranges[i].max_char_low && - ranges[i].min_char_high == - ranges[i].max_char_high) continue; - sprintf(fname + strlen(fname), "_%d", - maxchar(ranges[i])); - } - strcat(fname, "]"); - } -} - -Bool -FontParseXLFDName(char *fname, FontScalablePtr vals, int subst) -{ - register char *ptr; - register char *ptr1, - *ptr2, - *ptr3, - *ptr4; - register char *ptr5; - FontScalableRec tmpvals; - char replaceChar = '0'; - char tmpBuf[1024]; - int spacingLen; - int l; - char *p; - - bzero(&tmpvals, sizeof(tmpvals)); - if (subst != FONT_XLFD_REPLACE_VALUE) - *vals = tmpvals; - - if (!(*(ptr = fname) == '-' || (*ptr++ == '*' && *ptr == '-')) || /* fndry */ - !(ptr = strchr(ptr + 1, '-')) || /* family_name */ - !(ptr1 = ptr = strchr(ptr + 1, '-')) || /* weight_name */ - !(ptr = strchr(ptr + 1, '-')) || /* slant */ - !(ptr = strchr(ptr + 1, '-')) || /* setwidth_name */ - !(ptr = strchr(ptr + 1, '-')) || /* add_style_name */ - !(ptr = strchr(ptr + 1, '-')) || /* pixel_size */ - !(ptr = GetMatrix(ptr + 1, &tmpvals, PIXELSIZE_MASK)) || - !(ptr2 = ptr = GetMatrix(ptr + 1, &tmpvals, POINTSIZE_MASK)) || - !(ptr = GetInt(ptr + 1, &tmpvals.x)) || /* resolution_x */ - !(ptr3 = ptr = GetInt(ptr + 1, &tmpvals.y)) || /* resolution_y */ - !(ptr4 = ptr = strchr(ptr + 1, '-')) || /* spacing */ - !(ptr5 = ptr = GetInt(ptr + 1, &tmpvals.width)) || /* average_width */ - !(ptr = strchr(ptr + 1, '-')) || /* charset_registry */ - strchr(ptr + 1, '-'))/* charset_encoding */ - return FALSE; - - /* Lop off HP charset subsetting enhancement. Interpreting this - field requires allocating some space in which to return the - results. So, to prevent memory leaks, this procedure will simply - lop off and ignore charset subsetting, and initialize the - relevant vals fields to zero. It's up to the caller to make its - own call to FontParseRanges() if it's interested in the charset - subsetting. */ - - if (subst != FONT_XLFD_REPLACE_NONE && - (p = strchr(strrchr(fname, '-'), '['))) - { - tmpvals.values_supplied |= CHARSUBSET_SPECIFIED; - *p = '\0'; - } - - /* Fill in deprecated fields for the benefit of rasterizers that care - about them. */ - tmpvals.pixel = (tmpvals.pixel_matrix[3] >= 0) ? - (int)(tmpvals.pixel_matrix[3] + .5) : - (int)(tmpvals.pixel_matrix[3] - .5); - tmpvals.point = (tmpvals.point_matrix[3] >= 0) ? - (int)(tmpvals.point_matrix[3] * 10 + .5) : - (int)(tmpvals.point_matrix[3] * 10 - .5); - - spacingLen = ptr4 - ptr3 + 1; - - switch (subst) { - case FONT_XLFD_REPLACE_NONE: - *vals = tmpvals; - break; - case FONT_XLFD_REPLACE_STAR: - replaceChar = '*'; - case FONT_XLFD_REPLACE_ZERO: - strcpy(tmpBuf, ptr2); - ptr5 = tmpBuf + (ptr5 - ptr2); - ptr3 = tmpBuf + (ptr3 - ptr2); - ptr2 = tmpBuf; - ptr = ptr1 + 1; - - ptr = strchr(ptr, '-') + 1; /* skip weight */ - ptr = strchr(ptr, '-') + 1; /* skip slant */ - ptr = strchr(ptr, '-') + 1; /* skip setwidth_name */ - ptr = strchr(ptr, '-') + 1; /* skip add_style_name */ - - if ((ptr - fname) + spacingLen + strlen(ptr5) + 10 >= (unsigned)1024) - return FALSE; - *ptr++ = replaceChar; - *ptr++ = '-'; - *ptr++ = replaceChar; - *ptr++ = '-'; - *ptr++ = '*'; - *ptr++ = '-'; - *ptr++ = '*'; - if (spacingLen > 2) - { - memmove(ptr, ptr3, spacingLen); - ptr += spacingLen; - } - else - { - *ptr++ = '-'; - *ptr++ = '*'; - *ptr++ = '-'; - } - *ptr++ = replaceChar; - strcpy(ptr, ptr5); - *vals = tmpvals; - break; - case FONT_XLFD_REPLACE_VALUE: - if (vals->values_supplied & PIXELSIZE_MASK) - { - tmpvals.values_supplied = - (tmpvals.values_supplied & ~PIXELSIZE_MASK) | - (vals->values_supplied & PIXELSIZE_MASK); - tmpvals.pixel_matrix[0] = vals->pixel_matrix[0]; - tmpvals.pixel_matrix[1] = vals->pixel_matrix[1]; - tmpvals.pixel_matrix[2] = vals->pixel_matrix[2]; - tmpvals.pixel_matrix[3] = vals->pixel_matrix[3]; - } - if (vals->values_supplied & POINTSIZE_MASK) - { - tmpvals.values_supplied = - (tmpvals.values_supplied & ~POINTSIZE_MASK) | - (vals->values_supplied & POINTSIZE_MASK); - tmpvals.point_matrix[0] = vals->point_matrix[0]; - tmpvals.point_matrix[1] = vals->point_matrix[1]; - tmpvals.point_matrix[2] = vals->point_matrix[2]; - tmpvals.point_matrix[3] = vals->point_matrix[3]; - } - if (vals->x >= 0) - tmpvals.x = vals->x; - if (vals->y >= 0) - tmpvals.y = vals->y; - if (vals->width >= 0) - tmpvals.width = vals->width; - else if (vals->width < -1) /* overload: -1 means wildcard */ - tmpvals.width = -vals->width; - - - p = ptr1 + 1; /* weight field */ - l = strchr(p, '-') - p; - sprintf(tmpBuf, "%*.*s", l, l, p); - - p += l + 1; /* slant field */ - l = strchr(p, '-') - p; - sprintf(tmpBuf + strlen(tmpBuf), "-%*.*s", l, l, p); - - p += l + 1; /* setwidth_name */ - l = strchr(p, '-') - p; - sprintf(tmpBuf + strlen(tmpBuf), "-%*.*s", l, l, p); - - p += l + 1; /* add_style_name field */ - l = strchr(p, '-') - p; - sprintf(tmpBuf + strlen(tmpBuf), "-%*.*s", l, l, p); - - strcat(tmpBuf, "-"); - if ((tmpvals.values_supplied & PIXELSIZE_MASK) == PIXELSIZE_ARRAY) - { - char buffer[80]; - strcat(tmpBuf, "["); - strcat(tmpBuf, xlfd_double_to_text(tmpvals.pixel_matrix[0], - buffer, 0)); - strcat(tmpBuf, xlfd_double_to_text(tmpvals.pixel_matrix[1], - buffer, 1)); - strcat(tmpBuf, xlfd_double_to_text(tmpvals.pixel_matrix[2], - buffer, 1)); - strcat(tmpBuf, xlfd_double_to_text(tmpvals.pixel_matrix[3], - buffer, 1)); - strcat(tmpBuf, "]"); - } - else - { - sprintf(tmpBuf + strlen(tmpBuf), "%d", - (int)(tmpvals.pixel_matrix[3] + .5)); - } - strcat(tmpBuf, "-"); - if ((tmpvals.values_supplied & POINTSIZE_MASK) == POINTSIZE_ARRAY) - { - char buffer[80]; - strcat(tmpBuf, "["); - strcat(tmpBuf, xlfd_double_to_text(tmpvals.point_matrix[0], - buffer, 0)); - strcat(tmpBuf, xlfd_double_to_text(tmpvals.point_matrix[1], - buffer, 1)); - strcat(tmpBuf, xlfd_double_to_text(tmpvals.point_matrix[2], - buffer, 1)); - strcat(tmpBuf, xlfd_double_to_text(tmpvals.point_matrix[3], - buffer, 1)); - strcat(tmpBuf, "]"); - } - else - { - sprintf(tmpBuf + strlen(tmpBuf), "%d", - (int)(tmpvals.point_matrix[3] * 10.0 + .5)); - } - sprintf(tmpBuf + strlen(tmpBuf), "-%d-%d%*.*s%d%s", - tmpvals.x, tmpvals.y, - spacingLen, spacingLen, ptr3, tmpvals.width, ptr5); - strcpy(ptr1 + 1, tmpBuf); - if ((vals->values_supplied & CHARSUBSET_SPECIFIED) && !vals->nranges) - strcat(fname, "[]"); - else - append_ranges(fname, vals->nranges, vals->ranges); - break; - } - return TRUE; -} - -fsRange *FontParseRanges(char *name, int *nranges) -{ - int n; - unsigned long l; - char *p1, *p2; - fsRange *result = (fsRange *)0; - - name = strchr(name, '-'); - for (n = 1; name && n < 14; n++) - name = strchr(name + 1, '-'); - - *nranges = 0; - if (!name || !(p1 = strchr(name, '['))) return (fsRange *)0; - p1++; - - while (*p1 && *p1 != ']') - { - fsRange thisrange; - - l = strtol(p1, &p2, 0); - if (p2 == p1 || l > 0xffff) break; - thisrange.max_char_low = thisrange.min_char_low = l & 0xff; - thisrange.max_char_high = thisrange.min_char_high = l >> 8; - - p1 = p2; - if (*p1 == ']' || *p1 == ' ') - { - while (*p1 == ' ') p1++; - if (add_range(&thisrange, nranges, &result, TRUE) != Successful) - break; - } - else if (*p1 == '_') - { - l = strtol(++p1, &p2, 0); - if (p2 == p1 || l > 0xffff) break; - thisrange.max_char_low = l & 0xff; - thisrange.max_char_high = l >> 8; - p1 = p2; - if (*p1 == ']' || *p1 == ' ') - { - while (*p1 == ' ') p1++; - if (add_range(&thisrange, nranges, &result, TRUE) != Successful) - break; - } - } - else break; - } - - return result; -} diff --git a/nx-X11/lib/font/util/format.c b/nx-X11/lib/font/util/format.c deleted file mode 100644 index 6700721f9..000000000 --- a/nx-X11/lib/font/util/format.c +++ /dev/null @@ -1,126 +0,0 @@ -/* $Xorg: format.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ -/* - * Copyright 1990, 1991 Network Computing Devices; - * Portions Copyright 1987 by Digital Equipment Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Network Computing Devices or Digital - * not be used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. Network Computing - * Devices and Digital make no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/format.c,v 1.4 2001/01/17 19:43:33 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -int -CheckFSFormat(fsBitmapFormat format, - fsBitmapFormatMask fmask, - int *bit_order, - int *byte_order, - int *scan, - int *glyph, - int *image) -{ - /* convert format to what the low levels want */ - if (fmask & BitmapFormatMaskBit) { - *bit_order = format & BitmapFormatBitOrderMask; - *bit_order = (*bit_order == BitmapFormatBitOrderMSB) - ? MSBFirst : LSBFirst; - } - if (fmask & BitmapFormatMaskByte) { - *byte_order = format & BitmapFormatByteOrderMask; - *byte_order = (*byte_order == BitmapFormatByteOrderMSB) - ? MSBFirst : LSBFirst; - } - if (fmask & BitmapFormatMaskScanLineUnit) { - *scan = format & BitmapFormatScanlineUnitMask; - /* convert byte paddings into byte counts */ - switch (*scan) { - case BitmapFormatScanlineUnit8: - *scan = 1; - break; - case BitmapFormatScanlineUnit16: - *scan = 2; - break; - case BitmapFormatScanlineUnit32: - *scan = 4; - break; - default: - return BadFontFormat; - } - } - if (fmask & BitmapFormatMaskScanLinePad) { - *glyph = format & BitmapFormatScanlinePadMask; - /* convert byte paddings into byte counts */ - switch (*glyph) { - case BitmapFormatScanlinePad8: - *glyph = 1; - break; - case BitmapFormatScanlinePad16: - *glyph = 2; - break; - case BitmapFormatScanlinePad32: - *glyph = 4; - break; - default: - return BadFontFormat; - } - } - if (fmask & BitmapFormatMaskImageRectangle) { - *image = format & BitmapFormatImageRectMask; - - if (*image != BitmapFormatImageRectMin && - *image != BitmapFormatImageRectMaxWidth && - *image != BitmapFormatImageRectMax) - return BadFontFormat; - } - return Successful; -} diff --git a/nx-X11/lib/font/util/miscutil.c b/nx-X11/lib/font/util/miscutil.c deleted file mode 100644 index 03b4d061d..000000000 --- a/nx-X11/lib/font/util/miscutil.c +++ /dev/null @@ -1,99 +0,0 @@ -/* $Xorg: miscutil.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/miscutil.c,v 1.7 2001/07/25 15:04:57 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include - -#define XK_LATIN1 -#include -/* #include */ - -/* make sure everything initializes themselves at least once */ - -long serverGeneration = 1; - -void * -Xalloc (unsigned long m) -{ - return malloc (m); -} - -void * -Xrealloc (void *n, unsigned long m) -{ - if (!n) - return malloc (m); - else - return realloc (n, m); -} - -void -Xfree (void *n) -{ - if (n) - free (n); -} - -void * -Xcalloc (unsigned long n) -{ - return calloc (n, 1); -} - -void -CopyISOLatin1Lowered (char *dst, char *src, int len) -{ - register unsigned char *dest, *source; - - for (dest = (unsigned char *)dst, source = (unsigned char *)src; - *source && len > 0; - source++, dest++, len--) - { - if ((*source >= XK_A) && (*source <= XK_Z)) - *dest = *source + (XK_a - XK_A); - else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis)) - *dest = *source + (XK_agrave - XK_Agrave); - else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn)) - *dest = *source + (XK_oslash - XK_Ooblique); - else - *dest = *source; - } - *dest = '\0'; -} - -void -register_fpe_functions () -{ -} diff --git a/nx-X11/lib/font/util/patcache.c b/nx-X11/lib/font/util/patcache.c deleted file mode 100644 index 0351b1ac2..000000000 --- a/nx-X11/lib/font/util/patcache.c +++ /dev/null @@ -1,221 +0,0 @@ -/* $Xorg: patcache.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/patcache.c,v 3.4 2001/01/17 19:43:33 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -/* - * Static sized hash table for looking up font name patterns - * - * LRU entries, reusing old entries - */ - -#define NBUCKETS 16 -#define NENTRIES 64 - -#define UNSET (NENTRIES+1) - -typedef unsigned char EntryPtr; - -typedef struct _FontPatternCacheEntry { - struct _FontPatternCacheEntry *next, **prev; - short patlen; - char *pattern; - int hash; - FontPtr pFont; /* associated font */ -} FontPatternCacheEntryRec, *FontPatternCacheEntryPtr; - -typedef struct _FontPatternCache { - FontPatternCacheEntryPtr buckets[NBUCKETS]; - FontPatternCacheEntryRec entries[NENTRIES]; - FontPatternCacheEntryPtr free; -} FontPatternCacheRec; - -/* Empty cache (for rehash) */ -void -EmptyFontPatternCache (FontPatternCachePtr cache) -{ - int i; - - for (i = 0; i < NBUCKETS; i++) - cache->buckets[i] = 0; - for (i = 0; i < NENTRIES; i++) - { - cache->entries[i].next = &cache->entries[i+1]; - cache->entries[i].prev = 0; - cache->entries[i].pFont = 0; - xfree (cache->entries[i].pattern); - cache->entries[i].pattern = 0; - cache->entries[i].patlen = 0; - } - cache->free = &cache->entries[0]; - cache->entries[NENTRIES - 1].next = 0; -} - -/* Create and initialize cache */ -FontPatternCachePtr -MakeFontPatternCache (void) -{ - FontPatternCachePtr cache; - int i; - cache = (FontPatternCachePtr) xalloc (sizeof *cache); - if (!cache) - return 0; - for (i = 0; i < NENTRIES; i++) { - cache->entries[i].patlen = 0; - cache->entries[i].pattern = 0; - cache->entries[i].pFont = 0; - } - EmptyFontPatternCache (cache); - return cache; -} - -/* toss cache */ -void -FreeFontPatternCache (FontPatternCachePtr cache) -{ - int i; - - for (i = 0; i < NENTRIES; i++) - xfree (cache->entries[i].pattern); - xfree (cache); -} - -/* compute id for string */ -static int -Hash (const char *string, int len) -{ - int hash; - - hash = 0; - while (len--) - hash = (hash << 1) ^ *string++; - if (hash < 0) - hash = -hash; - return hash; -} - -/* add entry */ -void -CacheFontPattern (FontPatternCachePtr cache, - char *pattern, - int patlen, - FontPtr pFont) -{ - FontPatternCacheEntryPtr e; - char *newpat; - int i; - - newpat = (char *) xalloc (patlen); - if (!newpat) - return; - if (cache->free) - { - e = cache->free; - cache->free = e->next; - } - else - { - i = rand (); - if (i < 0) - i = -i; - i %= NENTRIES; - e = &cache->entries[i]; - if (e->next) - e->next->prev = e->prev; - *e->prev = e->next; - xfree (e->pattern); - } - /* set pattern */ - memcpy (newpat, pattern, patlen); - e->pattern = newpat; - e->patlen = patlen; - /* link to new hash chain */ - e->hash = Hash (pattern, patlen); - i = e->hash % NBUCKETS; - e->next = cache->buckets[i]; - if (e->next) - e->next->prev = &(e->next); - cache->buckets[i] = e; - e->prev = &(cache->buckets[i]); - e->pFont = pFont; -} - -/* find matching entry */ -FontPtr -FindCachedFontPattern (FontPatternCachePtr cache, - char *pattern, - int patlen) -{ - int hash; - int i; - FontPatternCacheEntryPtr e; - - hash = Hash (pattern, patlen); - i = hash % NBUCKETS; - for (e = cache->buckets[i]; e; e = e->next) - { - if (e->patlen == patlen && e->hash == hash && - !memcmp (e->pattern, pattern, patlen)) - { - return e->pFont; - } - } - return 0; -} - -void -RemoveCachedFontPattern (FontPatternCachePtr cache, - FontPtr pFont) -{ - FontPatternCacheEntryPtr e; - int i; - - for (i = 0; i < NENTRIES; i++) - { - if ((e = &cache->entries[i])->pFont == pFont) - { - e->pFont = 0; - if (e->next) - e->next->prev = e->prev; - *e->prev = e->next; - e->next = cache->free; - cache->free = e; - xfree (e->pattern); - e->pattern = 0; - } - } -} diff --git a/nx-X11/lib/font/util/private.c b/nx-X11/lib/font/util/private.c deleted file mode 100644 index 85e90e57b..000000000 --- a/nx-X11/lib/font/util/private.c +++ /dev/null @@ -1,107 +0,0 @@ -/* $Xorg: private.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1991, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/private.c,v 1.8tsi Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -static int _FontPrivateAllocateIndex = 0; - -int -AllocateFontPrivateIndex (void) -{ - return _FontPrivateAllocateIndex++; -} - -FontPtr -CreateFontRec (void) -{ - FontPtr pFont; - int size; - - size = sizeof(FontRec) + (sizeof(pointer) * _FontPrivateAllocateIndex); - - pFont = (FontPtr)xalloc(size); - - if(pFont) { - bzero((char*)pFont, size); - pFont->maxPrivate = _FontPrivateAllocateIndex - 1; - if(_FontPrivateAllocateIndex) - pFont->devPrivates = (pointer)(&pFont[1]); - } - - return pFont; -} - -void -DestroyFontRec (FontPtr pFont) -{ - if (pFont->devPrivates && pFont->devPrivates != (pointer)(&pFont[1])) - xfree(pFont->devPrivates); - xfree(pFont); -} - -void -ResetFontPrivateIndex (void) -{ - _FontPrivateAllocateIndex = 0; -} - -Bool -_FontSetNewPrivate (FontPtr pFont, int n, pointer ptr) -{ - pointer *new; - - if (n > pFont->maxPrivate) { - if (pFont->devPrivates && pFont->devPrivates != (pointer)(&pFont[1])) { - new = (pointer *) xrealloc (pFont->devPrivates, (n + 1) * sizeof (pointer)); - if (!new) - return FALSE; - } else { - new = (pointer *) xalloc ((n + 1) * sizeof (pointer)); - if (!new) - return FALSE; - if (pFont->devPrivates) - memcpy (new, pFont->devPrivates, (pFont->maxPrivate + 1) * sizeof (pointer)); - } - pFont->devPrivates = new; - /* zero out new, uninitialized privates */ - while(++pFont->maxPrivate < n) - pFont->devPrivates[pFont->maxPrivate] = (pointer)0; - } - pFont->devPrivates[n] = ptr; - return TRUE; -} - diff --git a/nx-X11/lib/font/util/utilbitmap.c b/nx-X11/lib/font/util/utilbitmap.c deleted file mode 100644 index a817a4ec6..000000000 --- a/nx-X11/lib/font/util/utilbitmap.c +++ /dev/null @@ -1,188 +0,0 @@ -/* $Xorg: utilbitmap.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ - -/* - -Copyright 1990, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/utilbitmap.c,v 1.4 2001/01/17 19:43:34 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include - -/* Utility functions for reformating font bitmaps */ - -static unsigned char _reverse_byte[0x100] = { - 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, - 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, - 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, - 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, - 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, - 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, - 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, - 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, - 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, - 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, - 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, - 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, - 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, - 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, - 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, - 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, - 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, - 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, - 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, - 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, - 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, - 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, - 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, - 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, - 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, - 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, - 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, - 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, - 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, - 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, - 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, - 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff -}; - -/* - * Invert bit order within each BYTE of an array. - */ -void -BitOrderInvert(unsigned char *buf, int nbytes) -{ - unsigned char *rev = _reverse_byte; - - for (; --nbytes >= 0; buf++) - *buf = rev[*buf]; -} - -/* - * Invert byte order within each 16-bits of an array. - */ -void -TwoByteSwap(unsigned char *buf, int nbytes) -{ - unsigned char c; - - for (; nbytes > 0; nbytes -= 2, buf += 2) - { - c = buf[0]; - buf[0] = buf[1]; - buf[1] = c; - } -} - -/* - * Invert byte order within each 32-bits of an array. - */ -void -FourByteSwap(unsigned char *buf, int nbytes) -{ - unsigned char c; - - for (; nbytes > 0; nbytes -= 4, buf += 4) - { - c = buf[0]; - buf[0] = buf[3]; - buf[3] = c; - c = buf[1]; - buf[1] = buf[2]; - buf[2] = c; - } -} - -/* - * Repad a bitmap - */ - -int -RepadBitmap (char *pSrc, char *pDst, - unsigned int srcPad, unsigned int dstPad, - int width, int height) -{ - int srcWidthBytes,dstWidthBytes; - int row,col; - char *pTmpSrc,*pTmpDst; - - switch (srcPad) { - case 1: - srcWidthBytes = (width+7)>>3; - break; - case 2: - srcWidthBytes = ((width+15)>>4)<<1; - break; - case 4: - srcWidthBytes = ((width+31)>>5)<<2; - break; - case 8: - srcWidthBytes = ((width+63)>>6)<<3; - break; - default: - return 0; - } - switch (dstPad) { - case 1: - dstWidthBytes = (width+7)>>3; - break; - case 2: - dstWidthBytes = ((width+15)>>4)<<1; - break; - case 4: - dstWidthBytes = ((width+31)>>5)<<2; - break; - case 8: - dstWidthBytes = ((width+63)>>6)<<3; - break; - default: - return 0; - } - - width = srcWidthBytes; - if (width > dstWidthBytes) - width = dstWidthBytes; - pTmpSrc= pSrc; - pTmpDst= pDst; - for (row = 0; row < height; row++) - { - for (col = 0; col < width; col++) - *pTmpDst++ = *pTmpSrc++; - while (col < dstWidthBytes) - { - *pTmpDst++ = '\0'; - col++; - } - pTmpSrc += srcWidthBytes - width; - } - return dstWidthBytes * height; -} - - diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile index 5283e2286..506ef5539 100644 --- a/nx-X11/programs/Xserver/GL/glx/Imakefile +++ b/nx-X11/programs/Xserver/GL/glx/Imakefile @@ -42,7 +42,7 @@ LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11) INCLUDES = -I$(SERVERSRC)/GL/glx -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(MESASRCDIR)/include \ -I$(XINCLUDESRC) -I$(SERVERSRC)/mi \ - -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(LIBSRC)/GL/include \ + -I$(EXTINCSRC) -I$(LIBSRC)/GL/include \ -I$(XF86SRC) #if defined(DarwinArchitecture) && ((OSMajorVersion == 6 && OSMinorVersion < 3) || OSMajorVersion < 6) diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index 1419531a4..fd0a55311 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -201,7 +201,7 @@ INSTPGMFLAGS = $(LBXDIRS) $(DBEDIR) $(RECORDDIR) $(SITEEXTDIRS) \ $(RANDRDIR) $(RENDERDIR) $(XTRAPDIR) $(XPCONFIGDIR) \ $(FIXESDIR) $(DAMAGEDIR) $(CWDIR) $(COMPOSITEDIR) -#if BuildLBX || GzipFontCompression +#if BuildLBX ZLIB = GzipLibrary #endif OS = os/LibraryTargetName(os) $(DEPXAUTHLIB) $(DEPXDMCPLIB) @@ -267,14 +267,6 @@ INSTPGMFLAGS = #endif MIINITEXTOBJ = mi/miinitext.o DIX = dix/LibraryTargetName(dix) - FONTBASE = $(FONTLIBSRC)/fontbase.o \ - $(FONTLIBSRC)/LibraryTargetName(fontbase) -#if XserverStaticFontLib - FONT = $(FONTLIBSRC)/LibraryTargetName(NX_Xfont) $(FREETYPE2LIB) -#else - FONT = $(LDPRELIB) $(XFONTLIB) $(FREETYPE2LIB) -#endif - FONTLIBS = $(FONT) $(XPFBLIBS) #if UsbMouseSupport #if !HasLibUsb USB = $(XF86OSSRC)/bsd/libusb/LibraryTargetName(usb) @@ -432,7 +424,7 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \ XPMLIB = -lXpm NXAGENT = hw/nxagent/LibraryTargetName(nxagent) NXAGENTLIBS = PreFbLibs $(NXAGENT) FbPostFbLibs $(NXAGENT) $(MI) -NXAGENTSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XLIB) $(SYSLIBS) $(XPMLIB) +NXAGENTSYSLIBS = $(LDPRELIBS) $(XLIB) $(SYSLIBS) $(XPMLIB) #if HasParallelMake MakeMutex($(NXAGENTDIRS) $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS)) #endif @@ -447,17 +439,17 @@ $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS):: $(NXAGENTDIRS) #if defined(SunArchitecture) NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ - -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lNX_Xrender -lNX_Xfixes \ + -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lNX_Xrender -lNX_Xfixes -lXfont \ -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xdmcp \ `pkg-config --libs libxml-2.0` #elif defined(cygwinArchitecture) NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ - -lXcomp -lXcompext -lNX_Xrender -lX11 -lNX_Xext -lNX_Xcomposite -lNX_Xfixes \ + -lXcomp -lXcompext -lNX_Xrender -lX11 -lNX_Xext -lNX_Xcomposite -lNX_Xfixes -lXfont \ -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdmcp \ `pkg-config --libs libxml-2.0` #else NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ - -lXcomp -lXcompext -lXcompshad -lNX_Xrender -lNX_X11 -lNX_Xext -lNX_Xfixes \ + -lXcomp -lXcompext -lXcompshad -lNX_Xrender -lNX_X11 -lNX_Xext -lNX_Xfixes -lXfont \ -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xinerama -lNX_Xdmcp \ `pkg-config --libs libxml-2.0` #endif @@ -512,7 +504,7 @@ nxagent_static_nolibs: nxagent $(MV) nxagent__static_nolibs nxagent_static_nolibs.bak; \ else exit 0; fi $(CCLINK) -o nxagent_static_nolibs -Wl,-Bstatic $(LDOPTIONS) $(NXAGENTOBJS) \ - $(NXAGENTLIBS) $(LOADABLEEXTS) $(LIBCWRAPPER) $(LDLIBS) $(FONTLIBS) \ + $(NXAGENTLIBS) $(LOADABLEEXTS) $(LIBCWRAPPER) $(LDLIBS) \ $(LDPRELIBS) $(SYSLIBS) -Wl,-Bdynamic -lNX_Xext -lNX_X11 $(EXTRA_LOAD_FLAGS) #endif /* NXAgentServer */ @@ -573,7 +565,7 @@ XWINW32 = -lgdi32 -lwsock32 $(XWINGL32) $(PTHREADLIB) #else XWINW32 = -lgdi32 #endif -NXWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XWINX11) $(SYSLIBS) $(XWINW32) +NXWINSYSLIBS = $(LDPRELIBS) $(XWINX11) $(SYSLIBS) $(XWINW32) NXWINNXLIBS = -L../../../nxcomp -lXcomp @@ -638,7 +630,7 @@ NXWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(LAYERDIR) $(NXWINDDXDIR) \ NXWINOBJS = $(NXWINDDXDIR)/stubs.o $(NXWINDDXDIR)/NX.res NXWINLIBS = PreFbLibs $(NXWINLIB) FbPostFbLibs $(LAYER) $(SHADOW) \ $(XWINPARSERLIB) -NXWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XLIB) $(SYSLIBS) -lgdi32 -lddraw +NXWINSYSLIBS = $(LDPRELIBS) $(XLIB) $(SYSLIBS) -lgdi32 -lddraw NXWINNXLIBS = -L../../../nxcomp -lXcomp /* @@ -704,7 +696,7 @@ XCOMM Hackery for building dlopen-able .so modules on Solaris AllTarget(linker-deps) -LINKER_DEPS_DIRS = $(SUBDIRS) $(FONTLIBSRC) +LINKER_DEPS_DIRS = $(SUBDIRS) XCOMM After everything is built, run through and generate linker dependencies linker-deps: diff --git a/nx-X11/programs/Xserver/Xext/Imakefile b/nx-X11/programs/Xserver/Xext/Imakefile index 6c2c060f8..f44edb172 100644 --- a/nx-X11/programs/Xserver/Xext/Imakefile +++ b/nx-X11/programs/Xserver/Xext/Imakefile @@ -111,7 +111,7 @@ XF86BIGFOBJS = xf86bigfont.o #if BuildXinerama PNRXSRCS = panoramiX.c panoramiXSwap.c panoramiXprocs.c PNRXOBJS = panoramiX.o panoramiXSwap.o panoramiXprocs.o - PNRXINCLUDES = -I$(FONTINCSRC) -I../mi -I../render + PNRXINCLUDES = -I../mi -I../render #endif #if BuildDPMS DPMSSRCS = dpms.c @@ -162,7 +162,7 @@ NX_DEFINES = -DNXAGENT_SERVER XF86INCLUDES = -I$(XF86COMSRC) #endif INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - $(PNRXINCLUDES) $(XF86INCLUDES) -I$(FONTINCSRC) \ + $(PNRXINCLUDES) $(XF86INCLUDES) \ $(FONTCACHEINCLUDES) $(DMXINCLUDES) LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln diff --git a/nx-X11/programs/Xserver/Xext/extmod/Imakefile b/nx-X11/programs/Xserver/Xext/extmod/Imakefile index 450a318b4..45f3f39d7 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/Imakefile +++ b/nx-X11/programs/Xserver/Xext/extmod/Imakefile @@ -98,7 +98,7 @@ LinkSourceFile(cup.c,..) XF86INCLUDES = -I$(XF86COMSRC) INCLUDES = -I.. -I../../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - $(XF86INCLUDES) $(FONTCACHEINCLUDES) -I$(FONTINCSRC) + $(XF86INCLUDES) $(FONTCACHEINCLUDES) LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln LinkSourceFile(shape.c,..) diff --git a/nx-X11/programs/Xserver/composite/Imakefile b/nx-X11/programs/Xserver/composite/Imakefile index 9d3edcf8c..c45aa7f6a 100644 --- a/nx-X11/programs/Xserver/composite/Imakefile +++ b/nx-X11/programs/Xserver/composite/Imakefile @@ -6,7 +6,7 @@ INCLUDES = -I../include -I../mi -I../Xext -I../render -I../xfixes \ -I../damageext -I../miext/damage -I$(EXTINCSRC) \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) + -I$(XINCLUDESRC) LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln diff --git a/nx-X11/programs/Xserver/dix/Imakefile b/nx-X11/programs/Xserver/dix/Imakefile index a0d420851..47e617718 100644 --- a/nx-X11/programs/Xserver/dix/Imakefile +++ b/nx-X11/programs/Xserver/dix/Imakefile @@ -24,7 +24,7 @@ OBJS = atom.o colormap.o cursor.o devices.o dispatch.o dixutils.o events.o \ main.o property.o resource.o swaprep.o swapreq.o \ tables.o window.o initatoms.o dixfonts.o privates.o pixmap.o $(FFS_OBJ) - INCLUDES = -I../include -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(EXTINCSRC) \ + INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/lbx LINTLIBS = ../os/llib-los.ln diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index 42fd647a4..9a8b09993 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -1973,22 +1973,7 @@ InitFonts () { patternCache = MakeFontPatternCache(); -#ifndef KDRIVESERVER - if (screenInfo.numScreens > screenInfo.numVideoScreens) { - PrinterFontRegisterFpeFunctions(); - FontFileCheckRegisterFpeFunctions(); - check_fs_register_fpe_functions(); - } else -#endif - { -#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); -#endif - FontFileRegisterFpeFunctions(); -#ifndef NOFONTSERVERACCESS - fs_register_fpe_functions(); -#endif - } + register_fpe_functions(); } int diff --git a/nx-X11/programs/Xserver/fb/Imakefile b/nx-X11/programs/Xserver/fb/Imakefile index cb560e7a0..489d6a201 100644 --- a/nx-X11/programs/Xserver/fb/Imakefile +++ b/nx-X11/programs/Xserver/fb/Imakefile @@ -122,7 +122,7 @@ OBJS = $(XFMODOBJ) \ INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I$(XF86SRC)/common $(EXTRAINCLUDES) \ + -I$(XF86SRC)/common $(EXTRAINCLUDES) \ -I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ $(SERVERSRC)/mi/llib-lmi.ln diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 178ed3cf7..5becb2cff 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -31,8 +31,8 @@ is" without express or implied warranty. #include "scrnintstr.h" #include "dixstruct.h" -#include "../../../../include/fonts/font.h" -#include "fontstruct.h" +#include +#include #include "misc.h" #include "miscstruct.h" #include "opaque.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.h b/nx-X11/programs/Xserver/hw/nxagent/Font.h index 63cb6aa24..d3ee2b0da 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.h @@ -32,7 +32,7 @@ is" without express or implied warranty. #ifndef __Font_H__ #define __Font_H__ -#include "fontstruct.h" +#include #include "resource.h" extern RESTYPE RT_NX_FONT; diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 71562d999..ec51bbedc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -36,7 +36,7 @@ is" without express or implied warranty. #include "pixmapstr.h" #include "scrnintstr.h" #include "dixstruct.h" -#include "fontstruct.h" +#include #include "mistruct.h" #include "region.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 3d4331c78..4d409dc41 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -134,39 +134,38 @@ OBJS = NXwindow.o \ $(OBJS1) VFBINCLUDES = -I../../fb -I../../mfb -I../../render -NXFONTINCLUDES = -I../../../../lib/font/include LIBXRANDRINCLUDES= -I../../../../lib/Xrandr INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ -I../../../../extras/Mesa/include \ - -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ + -I$(XBUILDINCDIR) \ -I../../mi -I../../include -I../../os \ -I../../miext/damage -I../../miext/cw \ -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \ + $(VFBINCLUDES) $(LIBXRANDRINCLUDES) \ `pkg-config --cflags-only-I libxml-2.0` #ifdef SunArchitecture INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ -I../../../../extras/Mesa/include \ - -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ + -I$(XBUILDINCDIR) \ -I/usr/sfw/include \ -I../../mi -I../../include -I../../os \ -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ -I../../miext/damage -I../../miext/cw \ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \ + $(VFBINCLUDES) $(LIBXRANDRINCLUDES) \ `pkg-config --cflags-only-I libxml-2.0` #else #ifdef cygwinArchitecture -INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ +INCLUDES = -I. -I$(XBUILDINCDIR) \ -I../../mi -I../../include -I../../os \ -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ -I../../miext/damage -I../../miext/cw \ -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ -I../../../../extras/Mesa/include \ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \ + $(VFBINCLUDES) $(LIBXRANDRINCLUDES) \ `pkg-config --cflags-only-I libxml-2.0` #endif #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index d0e3e57b8..3722800ff 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -42,7 +42,7 @@ is" without express or implied warranty. #include "windowstr.h" #include "servermd.h" #include "mi.h" -#include "fontstruct.h" +#include #include "Agent.h" #include "Display.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 2b642692f..922443633 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -82,6 +82,7 @@ Equipment Corporation. #include "cursorstr.h" #include "misc.h" #include "opaque.h" +#include #include "dixfontstr.h" #include "closestr.h" @@ -2116,22 +2117,7 @@ InitFonts () { patternCache = MakeFontPatternCache(); -#ifndef KDRIVESERVER - if (screenInfo.numScreens > screenInfo.numVideoScreens) { - PrinterFontRegisterFpeFunctions(); - FontFileCheckRegisterFpeFunctions(); - check_fs_register_fpe_functions(); - } else -#endif - { -#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); -#endif - FontFileRegisterFpeFunctions(); -#ifndef NOFONTSERVERACCESS - fs_register_fpe_functions(); -#endif - } + register_fpe_functions(); } int diff --git a/nx-X11/programs/Xserver/mi/Imakefile b/nx-X11/programs/Xserver/mi/Imakefile index b85a9f98b..24caa0299 100644 --- a/nx-X11/programs/Xserver/mi/Imakefile +++ b/nx-X11/programs/Xserver/mi/Imakefile @@ -88,9 +88,9 @@ EXT_DEFINES = ExtensionDefines -UXINPUT -UXF86VIDMODE -UXFreeXDGA -UXF86MISC \ #endif -INCLUDES = -I. -I../include -I../../../include/fonts -I../render \ +INCLUDES = -I. -I../include -I../render \ -I../xfixes -I../damageext -I../miext/damage \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext + -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln DEFINES = $(FFS_DEFINES) diff --git a/nx-X11/programs/Xserver/miext/damage/Imakefile b/nx-X11/programs/Xserver/miext/damage/Imakefile index 1fa5cf126..7fa745b65 100755 --- a/nx-X11/programs/Xserver/miext/damage/Imakefile +++ b/nx-X11/programs/Xserver/miext/damage/Imakefile @@ -10,7 +10,7 @@ SRCS = damage.c OBJS = damage.o INCLUDES = -I. -I../shadow -I../../mi -I../../fb -I../../include -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I$(XF86SRC)/common $(EXTRAINCLUDES) \ + -I$(XF86SRC)/common $(EXTRAINCLUDES) \ -I../../render -I../cw -I$(EXTINCSRC) LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln \ ../../mi/llib-lmi.ln diff --git a/nx-X11/programs/Xserver/os/Imakefile b/nx-X11/programs/Xserver/os/Imakefile index 55f8e41fb..aa3f568b5 100644 --- a/nx-X11/programs/Xserver/os/Imakefile +++ b/nx-X11/programs/Xserver/os/Imakefile @@ -165,7 +165,7 @@ BOOTSTRAPCFLAGS = $(KRB5_DEFINES) $(RGB_DEFINES) $(GETPEER_DEFINES) \ $(RANDOM_DEFINES) $(BUGMSG) $(XTRANS_FAILDEFINES) $(NX_DEFINES) INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(SERVERSRC)/Xext -I$(FONTINCSRC) -I$(SERVERSRC)/render \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ -I$(TOP)/lib/Xau -I../lbx Krb5Includes $(NX_INCLUDES) DEPEND_DEFINES = $(DBM_DEFINES) $(XDMCP_DEFINES) $(EXT_DEFINES) \ $(TRANS_INCLUDES) $(CONNECTION_FLAGS) $(GETPEER_DEFINES) \ diff --git a/nx-X11/programs/Xserver/randr/Imakefile b/nx-X11/programs/Xserver/randr/Imakefile index 2eff07fee..19f8143e4 100644 --- a/nx-X11/programs/Xserver/randr/Imakefile +++ b/nx-X11/programs/Xserver/randr/Imakefile @@ -21,9 +21,9 @@ XCOMM $XFree86: xc/programs/Xserver/randr/Imakefile,v 1.1 2001/05/23 03:29:44 ke OBJS = mirandr.o randr.o rrcrtc.o rrdispatch.o rrinfo.o rrmode.o rroutput.o rrpointer.o rrproperty.o rrscreen.o rrsdispatch.o rrxinerama.o - INCLUDES = -I../include -I../mi -I../../../include/fonts \ + INCLUDES = -I../include -I../mi \ -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I../render + -I../render LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln DEFINES = -DNXAGENT_SERVER diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 0d7ad152f..1331b1fb4 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -27,9 +27,9 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 render.o \ renderedge.o - INCLUDES = -I. -I../include -I../mi -I../../../include/fonts \ + INCLUDES = -I. -I../include -I../mi \ -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I../Xext + -I../Xext LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln NormalLibraryTarget(render,$(OBJS)) diff --git a/nx-libs.spec b/nx-libs.spec index 2e6c5da4c..3e38173c3 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -27,35 +27,29 @@ BuildRequires: gpg-offline BuildRequires: fdupes %if 0%{?suse_version} >= 1130 BuildRequires: pkgconfig(expat) -BuildRequires: pkgconfig(fontconfig) -BuildRequires: pkgconfig(fontenc) -BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xpm) +BuildRequires: pkgconfig(xfont) %else BuildRequires: libexpat-devel -BuildRequires: fontconfig-devel -BuildRequires: freetype2-devel BuildRequires: libpng-devel BuildRequires: libxml2-devel BuildRequires: xorg-x11-libX11-devel BuildRequires: xorg-x11-libXext-devel -BuildRequires: xorg-x11-libfontenc-devel BuildRequires: xorg-x11-libXpm-devel +BuildRequires: xorg-x11-libXfont-devel %endif BuildRequires: xorg-x11-util-devel %endif %if 0%{?fedora} || 0%{?rhel} BuildRequires: expat-devel -BuildRequires: fontconfig-devel -BuildRequires: freetype-devel -BuildRequires: libfontenc-devel BuildRequires: libpng-devel BuildRequires: libxml2-devel +BuildRequires: libXfont-devel %endif # For imake @@ -680,7 +674,6 @@ find -type f -name '*.[hc]' | xargs chmod -x # Mesa - Used by the X server # Xcursor - Other code still references files in it -# Xfont - Statically linked to nxarget, others? # Xpm @@ -962,20 +955,6 @@ ln -s -f ../../../../%{_lib}/libXext.so.6 %{buildroot}%{_libdir}/nx/X11/Xinerama %{_includedir}/nx/X11/extensions/record.h %{_includedir}/nx/X11/extensions/xf86dga1.h %{_includedir}/nx/X11/extensions/xf86vmode.h -%dir %{_includedir}/nx/X11/fonts -%{_includedir}/nx/X11/fonts/bdfint.h -%{_includedir}/nx/X11/fonts/bitmap.h -%{_includedir}/nx/X11/fonts/bufio.h -%{_includedir}/nx/X11/fonts/fntfil.h -%{_includedir}/nx/X11/fonts/fntfilio.h -%{_includedir}/nx/X11/fonts/fntfilst.h -%{_includedir}/nx/X11/fonts/fontencc.h -%{_includedir}/nx/X11/fonts/fontmisc.h -%{_includedir}/nx/X11/fonts/fontmod.h -%{_includedir}/nx/X11/fonts/fontshow.h -%{_includedir}/nx/X11/fonts/fontutil.h -%{_includedir}/nx/X11/fonts/fontxlfd.h -%{_includedir}/nx/X11/fonts/pcf.h %{_includedir}/nx/X11/misc.h %{_includedir}/nx/X11/os.h @@ -1041,12 +1020,6 @@ ln -s -f ../../../../%{_lib}/libXext.so.6 %{buildroot}%{_libdir}/nx/X11/Xinerama %{_includedir}/nx/X11/extensions/xtraplib.h %{_includedir}/nx/X11/extensions/xtraplibp.h %{_includedir}/nx/X11/extensions/xtrapproto.h -%dir %{_includedir}/nx/X11/fonts -%{_includedir}/nx/X11/fonts/FS.h -%{_includedir}/nx/X11/fonts/FSproto.h -%{_includedir}/nx/X11/fonts/font.h -%{_includedir}/nx/X11/fonts/fontstruct.h -%{_includedir}/nx/X11/fonts/fsmasks.h %files -n nxagent %defattr(-,root,root) -- cgit v1.2.3 From cb4a2d732001d32fa1e95bb15e047da12b6c9754 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 26 May 2015 16:22:40 +0200 Subject: Drop nx-X11/lib/GL and move Imakefile.inc include files into Xserver code tree. The client-side library libNX_GL.{a,so} is not built when building nx-libs. However, nx-X11/lib/GL/** ships several imake include files (Imakefile.inc) that are also used in nx-X11/programs/Xserver/GL/**. These files have been moved from the nx-X11/lib/GL/ code subtree to the nx-X11/programs/Xserver/GL/. Furthermore, we don't provide module builds of the GL extension anymore, as that feature is neither used in nx-libs. --- nx-X11/config/cf/X11.tmpl | 62 --- nx-X11/config/cf/xfree86.cf | 11 - nx-X11/config/cf/xorg.cf | 11 - nx-X11/include/Imakefile | 2 +- nx-X11/lib/GL/GL/GL-def.cpp | 493 --------------------- nx-X11/lib/GL/GL/Imakefile | 244 ---------- nx-X11/lib/GL/Imakefile | 133 ------ nx-X11/lib/GL/glx/Imakefile | 233 ---------- nx-X11/lib/GL/mesa/Imakefile | 84 ---- nx-X11/lib/GL/mesa/Imakefile.inc | 57 --- nx-X11/lib/GL/mesa/array_cache/Imakefile | 91 ---- nx-X11/lib/GL/mesa/array_cache/Imakefile.inc | 34 -- nx-X11/lib/GL/mesa/drivers/dri/common/Imakefile | 44 -- .../lib/GL/mesa/drivers/dri/common/Imakefile.inc | 105 ----- nx-X11/lib/GL/mesa/drivers/osmesa/Imakefile | 111 ----- nx-X11/lib/GL/mesa/drivers/osmesa/OSMesa-def.cpp | 0 nx-X11/lib/GL/mesa/drivers/x11/Imakefile | 70 --- nx-X11/lib/GL/mesa/drivers/x11/Imakefile.inc | 104 ----- nx-X11/lib/GL/mesa/main/Imakefile | 66 --- nx-X11/lib/GL/mesa/main/Imakefile.inc | 487 -------------------- nx-X11/lib/GL/mesa/math/Imakefile | 98 ---- nx-X11/lib/GL/mesa/math/Imakefile.inc | 82 ---- nx-X11/lib/GL/mesa/shader/Imakefile | 107 ----- nx-X11/lib/GL/mesa/shader/Imakefile.inc | 106 ----- nx-X11/lib/GL/mesa/shader/grammar/Imakefile | 98 ---- nx-X11/lib/GL/mesa/shader/grammar/Imakefile.inc | 29 -- nx-X11/lib/GL/mesa/shader/slang/Imakefile | 108 ----- nx-X11/lib/GL/mesa/shader/slang/Imakefile.inc | 90 ---- nx-X11/lib/GL/mesa/shader/slang/library/Imakefile | 97 ---- .../lib/GL/mesa/shader/slang/library/Imakefile.inc | 14 - nx-X11/lib/GL/mesa/sparc/Imakefile | 68 --- nx-X11/lib/GL/mesa/sparc/Imakefile.inc | 58 --- nx-X11/lib/GL/mesa/swrast/Imakefile | 100 ----- nx-X11/lib/GL/mesa/swrast/Imakefile.inc | 218 --------- nx-X11/lib/GL/mesa/swrast_setup/Imakefile | 99 ----- nx-X11/lib/GL/mesa/swrast_setup/Imakefile.inc | 36 -- nx-X11/lib/GL/mesa/tnl/Imakefile | 101 ----- nx-X11/lib/GL/mesa/tnl/Imakefile.inc | 225 ---------- nx-X11/lib/GL/mesa/tnl_dd/Imakefile | 63 --- nx-X11/lib/GL/mesa/tnl_dd/Imakefile.inc | 40 -- nx-X11/lib/GL/mesa/x86/Imakefile | 108 ----- nx-X11/lib/GL/mesa/x86/Imakefile.inc | 217 --------- nx-X11/lib/Imakefile | 5 - nx-X11/lib/X11/Imakefile | 2 +- nx-X11/programs/Xserver/GL/glx/module/Imakefile | 4 - nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile | 28 +- .../Xserver/GL/mesa/GLcore/module/Imakefile | 53 --- nx-X11/programs/Xserver/GL/mesa/Imakefile | 13 +- nx-X11/programs/Xserver/GL/mesa/Imakefile.inc | 57 +++ nx-X11/programs/Xserver/GL/mesa/X/Imakefile | 11 +- nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc | 104 +++++ nx-X11/programs/Xserver/GL/mesa/X/module/Imakefile | 6 - .../programs/Xserver/GL/mesa/array_cache/Imakefile | 11 +- .../Xserver/GL/mesa/array_cache/Imakefile.inc | 34 ++ .../Xserver/GL/mesa/array_cache/module/Imakefile | 6 - nx-X11/programs/Xserver/GL/mesa/main/Imakefile | 11 +- nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc | 487 ++++++++++++++++++++ .../programs/Xserver/GL/mesa/main/module/Imakefile | 6 - nx-X11/programs/Xserver/GL/mesa/math/Imakefile | 11 +- nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc | 82 ++++ .../programs/Xserver/GL/mesa/math/module/Imakefile | 6 - nx-X11/programs/Xserver/GL/mesa/shader/Imakefile | 13 +- .../programs/Xserver/GL/mesa/shader/Imakefile.inc | 106 +++++ .../Xserver/GL/mesa/shader/grammar/Imakefile | 11 +- .../Xserver/GL/mesa/shader/grammar/Imakefile.inc | 29 ++ .../Xserver/GL/mesa/shader/slang/Imakefile | 13 +- .../Xserver/GL/mesa/shader/slang/Imakefile.inc | 90 ++++ .../Xserver/GL/mesa/shader/slang/library/Imakefile | 11 +- .../GL/mesa/shader/slang/library/Imakefile.inc | 14 + nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile | 12 +- .../programs/Xserver/GL/mesa/swrast/Imakefile.inc | 218 +++++++++ .../Xserver/GL/mesa/swrast/module/Imakefile | 6 - .../Xserver/GL/mesa/swrast_setup/Imakefile | 12 +- .../Xserver/GL/mesa/swrast_setup/Imakefile.inc | 36 ++ .../Xserver/GL/mesa/swrast_setup/module/Imakefile | 6 - nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile | 11 +- nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc | 225 ++++++++++ .../programs/Xserver/GL/mesa/tnl/module/Imakefile | 6 - 78 files changed, 1507 insertions(+), 4853 deletions(-) delete mode 100644 nx-X11/lib/GL/GL/GL-def.cpp delete mode 100644 nx-X11/lib/GL/GL/Imakefile delete mode 100644 nx-X11/lib/GL/Imakefile delete mode 100644 nx-X11/lib/GL/glx/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/array_cache/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/array_cache/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/drivers/dri/common/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/drivers/dri/common/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/drivers/osmesa/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/drivers/osmesa/OSMesa-def.cpp delete mode 100644 nx-X11/lib/GL/mesa/drivers/x11/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/drivers/x11/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/main/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/main/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/math/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/math/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/shader/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/shader/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/shader/grammar/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/shader/grammar/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/shader/slang/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/shader/slang/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/shader/slang/library/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/shader/slang/library/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/sparc/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/sparc/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/swrast/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/swrast/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/swrast_setup/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/swrast_setup/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/tnl/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/tnl/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/tnl_dd/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/tnl_dd/Imakefile.inc delete mode 100644 nx-X11/lib/GL/mesa/x86/Imakefile delete mode 100644 nx-X11/lib/GL/mesa/x86/Imakefile.inc delete mode 100644 nx-X11/programs/Xserver/GL/glx/module/Imakefile delete mode 100644 nx-X11/programs/Xserver/GL/mesa/GLcore/module/Imakefile create mode 100644 nx-X11/programs/Xserver/GL/mesa/Imakefile.inc create mode 100644 nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc delete mode 100644 nx-X11/programs/Xserver/GL/mesa/X/module/Imakefile create mode 100644 nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc delete mode 100644 nx-X11/programs/Xserver/GL/mesa/array_cache/module/Imakefile create mode 100644 nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc delete mode 100644 nx-X11/programs/Xserver/GL/mesa/main/module/Imakefile create mode 100644 nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc delete mode 100644 nx-X11/programs/Xserver/GL/mesa/math/module/Imakefile create mode 100644 nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc create mode 100644 nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc create mode 100644 nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc create mode 100644 nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile.inc create mode 100644 nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc delete mode 100644 nx-X11/programs/Xserver/GL/mesa/swrast/module/Imakefile create mode 100644 nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc delete mode 100644 nx-X11/programs/Xserver/GL/mesa/swrast_setup/module/Imakefile create mode 100644 nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc delete mode 100644 nx-X11/programs/Xserver/GL/mesa/tnl/module/Imakefile (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/config/cf/X11.tmpl b/nx-X11/config/cf/X11.tmpl index c1b278e67..91a9aa6a6 100644 --- a/nx-X11/config/cf/X11.tmpl +++ b/nx-X11/config/cf/X11.tmpl @@ -297,15 +297,9 @@ XORGRELSTRING = XorgManVersionString #define BuildXF86DRIDriverSupport NO #endif #endif -#ifndef BuildGLXLibrary -#define BuildGLXLibrary (BuildGlxExt && !BuildServersOnly) -#endif #ifndef BuildOSMesaLib #define BuildOSMesaLib BuildGlxExt #endif -#ifndef BuildXDriInfo -#define BuildXDriInfo (BuildGLXLibrary && !BuildServersOnly) -#endif #ifndef BuildXF86RushExt #define BuildXF86RushExt NO #endif @@ -1547,52 +1541,6 @@ ProjectUnsharedLibReferences(XONLY,NX_X11,$(XLIBSRC),XBuildLibDir) #define ProfileLibXcomposite NO #endif -#if BuildGLXLibrary -#ifndef SharedLibGlx -#define SharedLibGlx HasSharedLibraries -#endif -#ifndef NormalLibGlx -#define NormalLibGlx (!SharedLibX11 | ForceNormalLib) -#endif -#ifndef DebugLibGlx -#define DebugLibGlx NO -#endif -#ifndef ProfileLibGlx -#define ProfileLibGlx NO -#endif -#ifndef BuildLibGlxWithoutPIC -#define BuildLibGlxWithoutPIC NO -#endif -#if BuildLibGlxWithoutPIC && SharedLibGlx -#define SharedLibGlxWithoutPIC YES -#else -#define SharedLibGlxWithoutPIC NO -#endif -#ifndef LinkGLToUsrLib -#define LinkGLToUsrLib NO -#endif -#if NothingOutsideProjectRoot -#undef LinkGLToUsrLib -#define LinkGLToUsrLib NO -#endif -#ifndef LinkGLToUsrInclude -#define LinkGLToUsrInclude NO -#endif -#if NothingOutsideProjectRoot -#undef LinkGLToUsrInclude -#define LinkGLToUsrInclude NO -#endif -#else -#undef SharedLibGlx -#define SharedLibGlx NO -#undef NormalLibGlx -#define NormalLibGlx NO -#undef DebugLibGlx -#define DebugLibGlx NO -#undef ProfileLibGlx -#define ProfileLibGlx NO -#endif - #ifndef SharedLibXext #define SharedLibXext HasSharedLibraries #endif @@ -1667,16 +1615,6 @@ ProjectUnsharedLibReferences(XXF86RUSH,NX_Xxf86rush,$(XXF86RUSHLIBSRC),XBuildLib SharedLibReferences(XINERAMA,NX_Xinerama,$(XINERAMALIBSRC),SOXINERAMAREV,SharedXineramaRev) #else ProjectUnsharedLibReferences(XINERAMA,NX_Xinerama,$(XINERAMALIBSRC),XBuildLibDir) -#endif - - GLXLIBSRC = $(LIBSRC)/GL -#if SharedLibGlx -#ifndef SharedGlxRev -#define SharedGlxRev 1.2 -#endif -SharedLibReferences(GLX,NX_GL,$(GLXLIBSRC),SOGLREV,SharedGlxRev) -#else -ProjectUnsharedLibReferences(GLX,NX_GL,$(GLXLIBSRC),XBuildLibDir) #endif XRENDERLIBSRC = $(LIBSRC)/Xrender diff --git a/nx-X11/config/cf/xfree86.cf b/nx-X11/config/cf/xfree86.cf index 673902129..11c6a95c9 100644 --- a/nx-X11/config/cf/xfree86.cf +++ b/nx-X11/config/cf/xfree86.cf @@ -1282,14 +1282,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 #if BuildXF86DRI -#ifndef BuildGLXLibrary -# if defined (BuildServersOnly) && BuildServersOnly -# define BuildGLXLibrary NO -# else -# define BuildGLXLibrary YES -# endif -#endif - /* * One and ONLY one of the GlxBuiltIn* drivers can be defined to be YES. * If more than one are defined, the compilation will fail with multiply @@ -1538,9 +1530,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 #ifndef BuildXF86VidModeLibrary # define BuildXF86VidModeLibrary YES #endif -#ifndef BuildGLXLibrary -# define BuildGLXLibrary YES -#endif #endif /* diff --git a/nx-X11/config/cf/xorg.cf b/nx-X11/config/cf/xorg.cf index 1ef1260b4..8210cb049 100644 --- a/nx-X11/config/cf/xorg.cf +++ b/nx-X11/config/cf/xorg.cf @@ -846,14 +846,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 #define DevelDRIDrivers /**/ #endif -#ifndef BuildGLXLibrary -# if defined (BuildServersOnly) && BuildServersOnly -# define BuildGLXLibrary NO -# else -# define BuildGLXLibrary YES -# endif -#endif - /* * One and ONLY one of the GlxBuiltIn* drivers can be defined to be YES. * If more than one are defined, the compilation will fail with multiply @@ -1102,9 +1094,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 #ifndef BuildXF86VidModeLibrary # define BuildXF86VidModeLibrary YES #endif -#ifndef BuildGLXLibrary -# define BuildGLXLibrary YES -#endif #endif /* diff --git a/nx-X11/include/Imakefile b/nx-X11/include/Imakefile index e46abbdfd..2355d214e 100644 --- a/nx-X11/include/Imakefile +++ b/nx-X11/include/Imakefile @@ -10,7 +10,7 @@ NULL = #define IHaveSubdirs #define PassCDebugFlags /**/ -#if BuildGlxExt || BuildGLXLibrary +#if BuildGlxExt GLXDIR = GL #endif diff --git a/nx-X11/lib/GL/GL/GL-def.cpp b/nx-X11/lib/GL/GL/GL-def.cpp deleted file mode 100644 index 74549ebed..000000000 --- a/nx-X11/lib/GL/GL/GL-def.cpp +++ /dev/null @@ -1,493 +0,0 @@ -LIBRARY libGL -VERSION LIBRARY_VERSION -EXPORTS - glClearIndex @ 1 - glClearColor @ 2 - glClear @ 3 - glIndexMask @ 4 - glColorMask @ 5 - glAlphaFunc @ 6 - glBlendFunc @ 7 - glLogicOp @ 8 - glCullFace @ 9 - glFrontFace @ 10 - glPointSize @ 11 - glLineWidth @ 12 - glLineStipple @ 13 - glPolygonMode @ 14 - glPolygonStipple @ 15 - glGetPolygonStipple @ 16 - glEdgeFlag @ 17 - glEdgeFlagv @ 18 - glScissor @ 19 - glClipPlane @ 20 - glGetClipPlane @ 21 - glDrawBuffer @ 22 - glReadBuffer @ 23 - glEnable @ 24 - glDisable @ 25 - glIsEnabled @ 26 - glGetBooleanv @ 27 - glGetDoublev @ 28 - glGetFloatv @ 29 - glGetIntegerv @ 30 - glPushAttrib @ 31 - glPopAttrib @ 32 - glRenderMode @ 33 - glGetError @ 34 - glGetString @ 35 - glFinish @ 36 - glFlush @ 37 - glHint @ 38 - glClearDepth @ 39 - glDepthFunc @ 40 - glDepthMask @ 41 - glDepthRange @ 42 - glClearAccum @ 43 - glAccum @ 44 - glMatrixMode @ 45 - glOrtho @ 46 - glFrustum @ 47 - glViewport @ 48 - glPushMatrix @ 49 - glPopMatrix @ 50 - glLoadIdentity @ 51 - glLoadMatrixd @ 52 - glLoadMatrixf @ 53 - glMultMatrixd @ 54 - glMultMatrixf @ 55 - glRotated @ 56 - glRotatef @ 57 - glScaled @ 58 - glScalef @ 59 - glTranslated @ 60 - glTranslatef @ 61 - glIsList @ 62 - glDeleteLists @ 63 - glGenLists @ 64 - glNewList @ 65 - glEndList @ 66 - glCallList @ 67 - glCallLists @ 68 - glListBase @ 69 - glBegin @ 70 - glEnd @ 71 - glVertex2d @ 72 - glVertex2f @ 73 - glVertex2i @ 74 - glVertex2s @ 75 - glVertex3d @ 76 - glVertex3f @ 77 - glVertex3i @ 78 - glVertex3s @ 79 - glVertex4d @ 80 - glVertex4f @ 81 - glVertex4i @ 82 - glVertex4s @ 83 - glVertex2dv @ 84 - glVertex2fv @ 85 - glVertex2iv @ 86 - glVertex2sv @ 87 - glVertex3dv @ 88 - glVertex3fv @ 89 - glVertex3iv @ 90 - glVertex3sv @ 91 - glVertex4dv @ 92 - glVertex4fv @ 93 - glVertex4iv @ 94 - glVertex4sv @ 95 - glNormal3b @ 96 - glNormal3d @ 97 - glNormal3f @ 98 - glNormal3i @ 99 - glNormal3s @ 100 - glNormal3bv @ 101 - glNormal3dv @ 102 - glNormal3fv @ 103 - glNormal3iv @ 104 - glNormal3sv @ 105 - glIndexd @ 106 - glIndexf @ 107 - glIndexi @ 108 - glIndexs @ 109 - glIndexdv @ 110 - glIndexfv @ 111 - glIndexiv @ 112 - glIndexsv @ 113 - glColor3b @ 114 - glColor3d @ 115 - glColor3f @ 116 - glColor3i @ 117 - glColor3s @ 118 - glColor3ub @ 119 - glColor3ui @ 120 - glColor3us @ 121 - glColor4b @ 122 - glColor4d @ 123 - glColor4f @ 124 - glColor4i @ 125 - glColor4s @ 126 - glColor4ub @ 127 - glColor4ui @ 128 - glColor4us @ 129 - glColor3bv @ 130 - glColor3dv @ 131 - glColor3fv @ 132 - glColor3iv @ 133 - glColor3sv @ 134 - glColor3ubv @ 135 - glColor3uiv @ 136 - glColor3usv @ 137 - glColor4bv @ 138 - glColor4dv @ 139 - glColor4fv @ 140 - glColor4iv @ 141 - glColor4sv @ 142 - glColor4ubv @ 143 - glColor4uiv @ 144 - glColor4usv @ 145 - glTexCoord1d @ 146 - glTexCoord1f @ 147 - glTexCoord1i @ 148 - glTexCoord1s @ 149 - glTexCoord2d @ 150 - glTexCoord2f @ 151 - glTexCoord2i @ 152 - glTexCoord2s @ 153 - glTexCoord3d @ 154 - glTexCoord3f @ 155 - glTexCoord3i @ 156 - glTexCoord3s @ 157 - glTexCoord4d @ 158 - glTexCoord4f @ 159 - glTexCoord4i @ 160 - glTexCoord4s @ 161 - glTexCoord1dv @ 162 - glTexCoord1fv @ 163 - glTexCoord1iv @ 164 - glTexCoord1sv @ 165 - glTexCoord2dv @ 166 - glTexCoord2fv @ 167 - glTexCoord2iv @ 168 - glTexCoord2sv @ 169 - glTexCoord3dv @ 170 - glTexCoord3fv @ 171 - glTexCoord3iv @ 172 - glTexCoord3sv @ 173 - glTexCoord4dv @ 174 - glTexCoord4fv @ 175 - glTexCoord4iv @ 176 - glTexCoord4sv @ 177 - glRasterPos2d @ 178 - glRasterPos2f @ 179 - glRasterPos2i @ 180 - glRasterPos2s @ 181 - glRasterPos3d @ 182 - glRasterPos3f @ 183 - glRasterPos3i @ 184 - glRasterPos3s @ 185 - glRasterPos4d @ 186 - glRasterPos4f @ 187 - glRasterPos4i @ 188 - glRasterPos4s @ 189 - glRasterPos2dv @ 190 - glRasterPos2fv @ 191 - glRasterPos2iv @ 192 - glRasterPos2sv @ 193 - glRasterPos3dv @ 194 - glRasterPos3fv @ 195 - glRasterPos3iv @ 196 - glRasterPos3sv @ 197 - glRasterPos4dv @ 198 - glRasterPos4fv @ 199 - glRasterPos4iv @ 200 - glRasterPos4sv @ 201 - glRectd @ 202 - glRectf @ 203 - glRecti @ 204 - glRects @ 205 - glRectdv @ 206 - glRectfv @ 207 - glRectiv @ 208 - glRectsv @ 209 - glShadeModel @ 210 - glLightf @ 211 - glLighti @ 212 - glLightfv @ 213 - glLightiv @ 214 - glGetLightfv @ 215 - glGetLightiv @ 216 - glLightModelf @ 217 - glLightModeli @ 218 - glLightModelfv @ 219 - glLightModeliv @ 220 - glMaterialf @ 221 - glMateriali @ 222 - glMaterialfv @ 223 - glMaterialiv @ 224 - glGetMaterialfv @ 225 - glGetMaterialiv @ 226 - glColorMaterial @ 227 - glPixelZoom @ 228 - glPixelStoref @ 229 - glPixelStorei @ 230 - glPixelTransferf @ 231 - glPixelTransferi @ 232 - glPixelMapfv @ 233 - glPixelMapuiv @ 234 - glPixelMapusv @ 235 - glGetPixelMapfv @ 236 - glGetPixelMapuiv @ 237 - glGetPixelMapusv @ 238 - glBitmap @ 239 - glReadPixels @ 240 - glDrawPixels @ 241 - glCopyPixels @ 242 - glStencilFunc @ 243 - glStencilMask @ 244 - glStencilOp @ 245 - glClearStencil @ 246 - glTexGend @ 247 - glTexGenf @ 248 - glTexGeni @ 249 - glTexGendv @ 250 - glTexGenfv @ 251 - glTexGeniv @ 252 - glGetTexGendv @ 253 - glGetTexGenfv @ 254 - glGetTexGeniv @ 255 - glTexEnvf @ 256 - glTexEnvi @ 257 - glTexEnvfv @ 258 - glTexEnviv @ 259 - glGetTexEnvfv @ 260 - glGetTexEnviv @ 261 - glTexParameterf @ 262 - glTexParameteri @ 263 - glTexParameterfv @ 264 - glTexParameteriv @ 265 - glGetTexParameterfv @ 266 - glGetTexParameteriv @ 267 - glGetTexLevelParameterfv @ 268 - glGetTexLevelParameteriv @ 269 - glTexImage1D @ 270 - glTexImage2D @ 271 - glGetTexImage @ 272 - glMap1d @ 273 - glMap1f @ 274 - glMap2d @ 275 - glMap2f @ 276 - glGetMapdv @ 277 - glGetMapfv @ 278 - glGetMapiv @ 279 - glEvalCoord1d @ 280 - glEvalCoord1f @ 281 - glEvalCoord1dv @ 282 - glEvalCoord1fv @ 283 - glEvalCoord2d @ 284 - glEvalCoord2f @ 285 - glEvalCoord2dv @ 286 - glEvalCoord2fv @ 287 - glMapGrid1d @ 288 - glMapGrid1f @ 289 - glMapGrid2d @ 290 - glMapGrid2f @ 291 - glEvalPoint1 @ 292 - glEvalPoint2 @ 293 - glEvalMesh1 @ 294 - glEvalMesh2 @ 295 - glFogf @ 296 - glFogi @ 297 - glFogfv @ 298 - glFogiv @ 299 - glFeedbackBuffer @ 300 - glPassThrough @ 301 - glSelectBuffer @ 302 - glInitNames @ 303 - glLoadName @ 304 - glPushName @ 305 - glPopName @ 306 -; glBlendEquationEXT @ 307 -; glBlendColorEXT @ 308 - glPolygonOffset @ 309 -#ifndef __UNIXOS2__ -; glVertexPointerEXT @ 310 -; glNormalPointerEXT @ 311 -#else - glVertexPointerEXT @ 310 - glNormalPointerEXT @ 311 -#endif -; glColorPointerEXT @ 312 -; glIndexPointerEXT @ 313 -; glTexCoordPointerEXT @ 314 -; glEdgeFlagPointerEXT @ 315 -; glGetPointervEXT @ 316 -; glArrayElementEXT @ 317 -#ifndef __UNIXOS2__ -; glDrawArraysEXT @ 318 -#else - glDrawArraysEXT @ 318 -#endif -; OSMesaCreateContext @ 319 -; OSMesaDestroyContext @ 320 -; OSMesaMakeCurrent @ 321 -; XMesaCreateContext @ 322 -; XMesaDestroyContext @ 323 -; XMesaMakeCurrent @ 326 -; XMesaGetCurrentContext @ 327 -; XMesaSwapBuffers @ 328 -; XMesaGetBackBuffer @ 329 - glXChooseVisual @ 330 - glXCreateContext @ 331 - glXDestroyContext @ 332 - glXMakeCurrent @ 333 - glXCopyContext @ 334 - glXSwapBuffers @ 335 - glXCreateGLXPixmap @ 336 - glXDestroyGLXPixmap @ 337 - glXQueryExtension @ 338 - glXQueryVersion @ 339 - glXIsDirect @ 340 - glXGetConfig @ 341 - glXGetCurrentContext @ 342 - glXGetCurrentDrawable @ 343 - glXWaitGL @ 344 - glXWaitX @ 345 - glXUseXFont @ 346 - glXQueryExtensionsString @ 347 - glXQueryServerString @ 348 - glXGetClientString @ 349 - glPushClientAttrib @ 350 - glPopClientAttrib @ 351 - glIndexub @ 352 - glIndexubv @ 353 - glVertexPointer @ 354 - glNormalPointer @ 355 - glColorPointer @ 356 - glIndexPointer @ 357 - glTexCoordPointer @ 358 - glEdgeFlagPointer @ 359 - glGetPointerv @ 360 - glArrayElement @ 361 - glDrawArrays @ 362 - glDrawElements @ 363 - glInterleavedArrays @ 364 - glGenTextures @ 365 - glDeleteTextures @ 366 - glBindTexture @ 367 - glPrioritizeTextures @ 368 - glAreTexturesResident @ 369 - glIsTexture @ 370 - glTexSubImage1D @ 371 - glTexSubImage2D @ 372 - glCopyTexImage1D @ 373 - glCopyTexImage2D @ 374 - glCopyTexSubImage1D @ 375 - glCopyTexSubImage2D @ 376 -; glWindowPos2iMESA @ 377 -; glWindowPos2sMESA @ 378 -#ifndef __UNIXOS2__ -; glWindowPos2fMESA @ 379 -#else - glWindowPos2fMESA @ 379 -#endif -; glWindowPos2dMESA @ 380 -; glWindowPos2ivMESA @ 381 -; glWindowPos2svMESA @ 382 -; glWindowPos2fvMESA @ 383 -; glWindowPos2dvMESA @ 384 -; glWindowPos3iMESA @ 385 -; glWindowPos3sMESA @ 386 -; glWindowPos3fMESA @ 387 -; glWindowPos3dMESA @ 388 -; glWindowPos3ivMESA @ 389 -; glWindowPos3svMESA @ 390 -; glWindowPos3fvMESA @ 391 -; glWindowPos3dvMESA @ 392 -; glWindowPos4iMESA @ 393 -; glWindowPos4sMESA @ 394 -; glWindowPos4fMESA @ 395 -; glWindowPos4dMESA @ 396 -; glWindowPos4ivMESA @ 397 -; glWindowPos4svMESA @ 398 -; glWindowPos4fvMESA @ 399 -; glWindowPos4dvMESA @ 400 -#ifndef __UNIXOS2__ -; glXCreateGLXPixmapMESA @ 401 -#else - glXCreateGLXPixmapMESA @ 401 -#endif -; glXReleaseBuffersMESA @ 402 -; OSMesaGetCurrentContext @ 403 -; OSMesaPixelStore @ 404 -; OSMesaGetIntegerv @ 405 -; XMesaCreateVisual @ 406 -; XMesaDestroyVisual @ 407 -; XMesaCreateWindowBuffer @ 408 -; XMesaCreatePixmapBuffer @ 409 -; XMesaDestroyBuffer @ 410 -; XMesaGetCurrentBuffer @ 411 -; XMesaFlush @ 412 -; XMesaGetString @ 413 -; glPolygonOffsetEXT @ 414 - glDisableClientState @ 450 - glEnableClientState @ 451 - glXFreeContextEXT @ 452 - glXGetContextIDEXT @ 453 - glXGetCurrentDisplay @ 454 - glXImportContextEXT @ 455 - glXQueryContextInfoEXT @ 456 -#ifndef __UNIXOS2__ - glXGetCurrentDrawableEXT @ 457 -#endif - glCopyTexSubImage3D @ 458 - glDrawRangeElements @ 459 - glTexSubImage3D @ 460 - glBlendColorEXT @ 461 - glBlendEquationEXT @ 462 - glTexImage3D @ 463 -#ifdef __UNIXOS2__ - _glapi_Context @ 500 - _glapi_Dispatch @ 501 - glMultiTexCoord1svARB @ 502 - glMultiTexCoord1ivARB @ 503 - glMultiTexCoord1fvARB @ 504 - glMultiTexCoord1dvARB @ 505 - glMultiTexCoord2svARB @ 506 - glMultiTexCoord2ivARB @ 507 - glMultiTexCoord2fvARB @ 508 - glMultiTexCoord2dvARB @ 509 - glMultiTexCoord3svARB @ 510 - glMultiTexCoord3ivARB @ 511 - glMultiTexCoord3fvARB @ 512 - glMultiTexCoord3dvARB @ 513 - glMultiTexCoord4svARB @ 514 - glMultiTexCoord4ivARB @ 515 - glMultiTexCoord4fvARB @ 516 - glMultiTexCoord4dvARB @ 517 - glMultiTexCoord1fARB @ 518 - glMultiTexCoord2fARB @ 519 - glMultiTexCoord3fARB @ 520 - glMultiTexCoord4fARB @ 521 - _glapi_set_dispatch @ 522 - _glapi_noop_enable_warnings @ 523 - _glapi_add_entrypoint @ 524 - _glapi_get_dispatch_table_size @ 525 - _glapi_check_multithread @ 526 - _glapi_set_context @ 527 - _glapi_get_context @ 528 - glColorTable @ 529 - glColorSubTable @ 530 - glConvolutionFilter1D @ 531 - glConvolutionFilter2D @ 532 - glXGetProcAddressARB @ 533 - glLockArraysEXT @ 534 - glUnlockArraysEXT @ 535 - glActiveTextureARB @ 536 - glColorTableEXT @ 537 - glPointParameterfEXT @ 538 - glPointParameterfvEXT @ 539 - glXMakeContextCurrent @ 540 -#endif - -/* $XFree86: xc/lib/GL/GL/GL-def.cpp,v 1.2 2003/03/25 04:18:07 dawes Exp $ */ diff --git a/nx-X11/lib/GL/GL/Imakefile b/nx-X11/lib/GL/GL/Imakefile deleted file mode 100644 index 8c3ac0af4..000000000 --- a/nx-X11/lib/GL/GL/Imakefile +++ /dev/null @@ -1,244 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/GL/Imakefile,v 1.23 2003/11/17 03:10:41 dawes Exp $ - -#include - -#define DoNormalLib NormalLibGlx -#define DoSharedLib SharedLibGlx -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx - -#ifndef ShLibBindGlobals -#if !HasGcc2 || (GccMajorVersion > 2) || (GccMinorVersion > 7) -#define ShlibBindGlobals YES -#endif -#endif - - LIBNAME = GL - SOREV = $(SOGLREV) - -#ifdef SharedGLReqs -BASEREQUIREDLIBS = SharedGLReqs -#endif - -#include "../mesa/array_cache/Imakefile.inc" -#include "../mesa/math/Imakefile.inc" -#include "../mesa/swrast/Imakefile.inc" -#include "../mesa/swrast_setup/Imakefile.inc" -#include "../mesa/tnl/Imakefile.inc" -#include "../mesa/tnl_dd/Imakefile.inc" -#include "../mesa/Imakefile.inc" -#ifdef i386Architecture -#include "../mesa/x86/Imakefile.inc" -#endif -#ifdef SparcArchitecture -#include "../mesa/sparc/Imakefile.inc" -#endif - - -#if BuildXF86DRI && defined(i386Architecture) && MesaUseX86Asm - GLAPI_OBJ = $(GLXLIBSRC)/glx/glapi_x86.o -#endif - - GLXOBJS = $(GLXLIBSRC)/glx/?*.o - GLXUOBJS = $(GLXLIBSRC)/glx/unshared/?*.o $(GLAPI_OBJ) - GLXDOBJS = $(GLXLIBSRC)/glx/debugger/?*.o $(GLAPI_OBJ) - GLXPOBJS = $(GLXLIBSRC)/glx/profiled/?*.o $(GLAPI_OBJ) - -#if BuildXF86DRI - DRMOBJS = $(GLXLIBSRC)/dri/drm/?*.o - DRMUOBJS = $(GLXLIBSRC)/dri/drm/unshared/?*.o - DRMDOBJS = $(GLXLIBSRC)/dri/drm/debugger/?*.o - DRMPOBJS = $(GLXLIBSRC)/dri/drm/profiled/?*.o - - MESAOBJS = $(COREMESAOBJS) $(MESA_ASM_OBJS) - MESAUOBJS = $(COREMESAUOBJS) $(MESA_ASM_UOBJS) - MESADOBJS = $(COREMESADOBJS) $(MESA_ASM_DOBJS) - MESAPOBJS = $(COREMESAPOBJS) $(MESA_ASM_POBJS) - -#if GlxUseBuiltInDRIDriver -#include "../mesa/drivers/dri/common/Imakefile.inc" -#endif - - -#if GlxUseSGISI - -XCOMM nothing - -#elif GlxBuiltInGamma - -#define MesaDrvGammaBuildDir $(GLXLIBSRC)/mesa/drivers/dri/gamma/ -#include "../mesa/drivers/dri/gamma/Imakefile.inc" - - DRVOBJS = $(GAMMAOBJS) $(MESAOBJS) - DRVUOBJS = $(GAMMAUOBJS) $(MESAUOBJS) - DRVDOBJS = $(GAMMADOBJS) $(MESADOBJS) - DRVPOBJS = $(GAMMAPOBJS) $(MESAPOBJS) - -#elif GlxBuiltInTdfx - -#define MesaDrvTdfxBuildDir $(GLXLIBSRC)/mesa/drivers/dri/tdfx/ -#include "../mesa/drivers/dri/tdfx/Imakefile.inc" - - DRVOBJS = $(TDFXOBJS) $(MESAOBJS) - DRVUOBJS = $(TDFXUOBJS) $(MESAUOBJS) - DRVDOBJS = $(TDFXDOBJS) $(MESADOBJS) - DRVPOBJS = $(TDFXPOBJS) $(MESAPOBJS) - -OTHERREQUIREDLIBS = -lglide3 -ldl - -#elif GlxBuiltInI810 - -#define MesaDrvI810BuildDir $(GLXLIBSRC)/mesa/drivers/dri/i810/ -#include "../mesa/drivers/dri/i810/Imakefile.inc" - - DRVOBJS = $(I810OBJS) $(COMMONOBJS) $(MESAOBJS) - DRVUOBJS = $(I810UOBJS) $(COMMONUOBJS) $(MESAUOBJS) - DRVDOBJS = $(I810DOBJS) $(COMMONDOBJS) $(MESADOBJS) - DRVPOBJS = $(I810POBJS) $(COMMONPOBJS) $(MESAPOBJS) - -#elif GlxBuiltInI915 -#define MesaDrvI915BuildDir $(GLXLIBSRC)/mesa/drivers/dri/i915/ -#include "../mesa/drivers/dri/i915/Imakefile.inc" - - DRVOBJS = $(I915OBJS) $(COMMONOBJS) $(MESAOBJS) - DRVUOBJS = $(I915UOBJS) $(COMMONUOBJS) $(MESAUOBJS) - DRVDOBJS = $(I915DOBJS) $(COMMONDOBJS) $(MESADOBJS) - DRVPOBJS = $(I915POBJS) $(COMMONPOBJS) $(MESAPOBJS) - -#elif GlxBuiltInMga - -#define MesaDrvMgaBuildDir $(GLXLIBSRC)/mesa/drivers/dri/mga/ -#include "../mesa/drivers/dri/mga/Imakefile.inc" - - DRVOBJS = $(MGAOBJS) $(COMMONOBJS) $(MESAOBJS) - DRVUOBJS = $(MGAUOBJS) $(COMMONUOBJS) $(MESAUOBJS) - DRVDOBJS = $(MGADOBJS) $(COMMONDOBJS) $(MESADOBJS) - DRVPOBJS = $(MGAPOBJS) $(COMMONPOBJS) $(MESAPOBJS) - -#elif GlxBuiltInR128 - -#define MesaDrvR128BuildDir $(GLXLIBSRC)/mesa/drivers/dri/r128/ -#include "../mesa/drivers/dri/r128/Imakefile.inc" - - DRVOBJS = $(R128OBJS) $(COMMONOBJS) $(MESAOBJS) - DRVUOBJS = $(R128UOBJS) $(COMMONUOBJS) $(MESAUOBJS) - DRVDOBJS = $(R128DOBJS) $(COMMONDOBJS) $(MESADOBJS) - DRVPOBJS = $(R128POBJS) $(COMMONPOBJS) $(MESAPOBJS) - -#elif GlxBuiltInRadeon - -#define MesaDrvRadeonBuildDir $(GLXLIBSRC)/mesa/drivers/dri/radeon/ -#include "../mesa/drivers/dri/radeon/Imakefile.inc" - - DRVOBJS = $(RADEONOBJS) $(COMMONOBJS) $(MESAOBJS) - DRVUOBJS = $(RADEONUOBJS) $(COMMONUOBJS) $(MESAUOBJS) - DRVDOBJS = $(RADEONDOBJS) $(COMMONDOBJS) $(MESADOBJS) - DRVPOBJS = $(RADEONPOBJS) $(COMMONPOBJS) $(MESAPOBJS) - -#elif GlxBuiltInFfb - -#define MesaDrvFfbBuildDir $(GLXLIBSRC)/mesa/drivers/dri/ffb/ -#include "../mesa/drivers/dri/ffb/Imakefile.inc" - - DRVOBJS = $(FFBOBJS) $(MESAOBJS) - DRVUOBJS = $(FFBUOBJS) $(MESAUOBJS) - DRVDOBJS = $(FFBDOBJS) $(MESADOBJS) - DRVPOBJS = $(FFBPOBJS) $(MESAPOBJS) - -#elif GlxBuiltInSIS - -#define MesaDrvSisBuildDir $(GLXLIBSRC)/mesa/drivers/dri/sis/ -#include "../mesa/drivers/dri/sis/Imakefile.inc" - - DRVOBJS = $(SISOBJS) $(MESAOBJS) - DRVUOBJS = $(SISUOBJS) $(MESAUOBJS) - DRVDOBJS = $(SISDOBJS) $(MESADOBJS) - DRVPOBJS = $(SISPOBJS) $(MESAPOBJS) - -#elif GlxBuiltInXMesa - -#include "../mesa/drivers/x11/Imakefile.inc" - - DRVOBJS = $(MESAOBJS) $(XMESA_OBJS) - DRVUOBJS = $(MESAUOBJS) $(XMESA_UOBJS) - DRVDOBJS = $(MESADOBJS) $(XMESA_DOBJS) - DRVPOBJS = $(MESAPOBJS) $(XMESA_POBJS) - -#else - -XCOMM No built-in drivers. This is the usual case. - -#endif - -#endif /* BuildXF86DRI */ - -#if defined(DarwinArchitecture) && BuildAppleDRI - APPLEOBJS = appledri.o dri_dispatch.o dri_driver.o dri_glx.o x-list.o x-hash.o - DRIOBJS = $(APPLEOBJS:%.o=$(GLXLIBSRC)/apple/%.o) - DRIUOBJS = $(APPLEOBJS:%.o=$(GLXLIBSRC)/apple/unshared/%.o) - DRIDOBJS = $(APPLEOBJS:%.o=$(GLXLIBSRC)/apple/debugger/%.o) - DRIPOBJS = $(APPLEOBJS:%.o=$(GLXLIBSRC)/apple/profiled/%.o) - -NATIVE_GL = /System/Library/Frameworks/OpenGL.framework - -OTHERREQUIREDLIBS = \ - XpluginLibrary $(NATIVE_GL)/Libraries/libGL.dylib -sub_library libGL \ - -framework ApplicationServices -framework CoreFoundation \ - -framework OpenGL -#endif - -#if BuildXF86DRI && BuildXF86VidModeExt -VMODEREQUIREDLIBS = $(LDPRELIBS) $(XXF86VMLIB) -#endif - -/* - * Note: DRIDIRS is empty for !BuildXF86DRI, and DRVSUBDIRS is empty - * for no built-in drivers. - */ - -REQUIREDLIBS = $(OTHERREQUIREDLIBS) $(VMODEREQUIREDLIBS) $(BASEREQUIREDLIBS) - - OBJS = $(GLXOBJS) $(DRIOBJS) $(DRVOBJS) $(DRMOBJS) -#if HasSharedLibraries && !SharedLibGlxWithoutPIC - UOBJS = $(GLXUOBJS) $(DRIUOBJS) $(DRVUOBJS) $(DRMUOBJS) -#else - UOBJS = $(OBJS) -#endif - DOBJS = $(GLXDOBJS) $(DRIDOBJS) $(DRVDOBJS) $(DRMDOBJS) - POBJS = $(GLXPOBJS) $(DRIPOBJS) $(DRVPOBJS) $(DRMPOBJS) - -#if LocalThreads - THREADOBJS = $(THREADS_LIBS) -#endif - -#include - -#undef _LinkBuildLibrary -#define _LinkBuildLibrary(lib) LinkBuildLibrary(lib) - - -#if NormalLibGlx -NormalLibraryTarget($(LIBNAME),$(UOBJS)) -InstallLibrary($(LIBNAME),$(USRLIBDIR)) -#endif -#if SharedLibGlx -SharedDepLibraryTarget($(LIBNAME),$(SOREV),$(OBJS),$(OBJS) $(THREADOBJS),.,.) -InstallSharedLibrary($(LIBNAME),$(SOREV),$(SHLIBDIR)) -#if LinkGLToUsrLib && AlternateUsrLibDir -install:: - MakeDir($(DESTDIR)$(SYSTEMUSRLIBDIR)) - $(RM) $(DESTDIR)$(SYSTEMUSRLIBDIR)/lib$(LIBNAME).so - $(LN) $(SHLIBDIR)/lib$(LIBNAME).so $(DESTDIR)$(SYSTEMUSRLIBDIR)/lib$(LIBNAME).so || true - $(RM) $(DESTDIR)$(SYSTEMUSRLIBDIR)/lib$(LIBNAME).so.1 - $(LN) $(SHLIBDIR)/lib$(LIBNAME).so.1 $(DESTDIR)$(SYSTEMUSRLIBDIR)/lib$(LIBNAME).so.1 || true -#endif -#endif -#if DebugLibGlx -DebuggedLibraryTarget($(LIBNAME),$(DOBJS)) -InstallLibrary($(LIBNAME)_d,$(USRLIBDIR)) -#endif -#if ProfileLibGlx -ProfiledLibraryTarget($(LIBNAME),$(POBJS)) -InstallLibrary($(LIBNAME)_p,$(USRLIBDIR)) -#endif diff --git a/nx-X11/lib/GL/Imakefile b/nx-X11/lib/GL/Imakefile deleted file mode 100644 index 6b350203c..000000000 --- a/nx-X11/lib/GL/Imakefile +++ /dev/null @@ -1,133 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/Imakefile,v 1.43 2003/06/30 01:45:10 torrey Exp $ - -XCOMM -XCOMM Imake tokens which are significant to building libGL: -XCOMM -XCOMM BuildGLXLibrary - if defined, build libs in xc/lib/GL and xc/lib/GLw -XCOMM -XCOMM BuildXF86DRI - if defined, build libGL with DRI capability -XCOMM -XCOMM Only zero or one of the following can be defined at once: -XCOMM GlxBuiltInGamma - if defined, build gamma_dri.so driver into libGL -XCOMM GlxBuiltInTdfx - if defined, build tdfx_dri.so driver into libGL -XCOMM GlxBuiltInMga - if defined, build mga_dri.so driver into libGL -XCOMM GlxBuiltInI810 - if defined, build i810_dri.so driver into libGL -XCOMM GlxBuiltInR128 - if defined, build r128_dri.so driver into libGL -XCOMM GlxBuiltInRadeon - if defined, build radeon_dri.so driver into libGL -XCOMM GlxBuiltInR200 - if defined, build r200_dri.so driver into libGL -XCOMM GlxBuiltInFfb - if defined, build ffb_dri.so driver into libGL -XCOMM GlxBuiltInSIS - if defined, build sis_dri.so driver into libGL -XCOMM -XCOMM GlxUseBuiltInDRIDriver - automatically defined if any of the -XCOMM GlxBuiltIn[Gamma,Tdfx,Mga,I810,R128,Radeon,R200,Ffb,SIS] tokens is -XCOMM defined -XCOMM -XCOMM GlxBuiltInXMesa - if defined, build XMesa (Xlib Mesa driver) into libGL -XCOMM to enable rendering to displays that lack the GLX extension. -XCOMM -XCOMM GlxDriverUsesMesa - will be defined if building a DRI driver into -XCOMM libGL and it uses Mesa. -XCOMM -XCOMM GlxUseSGISI - if defined, use the SGI OpenGL Sample Implementation -XCOMM to build the GLX server extension (not fully implemented yet). -XCOMM -XCOMM NormalLibGlx - if defined, build static libGL.a library -XCOMM -XCOMM SharedLibGlx - if defined, build dynamic libGL.so library -XCOMM -XCOMM DebugLibGlx - if defined, build libGL with debug info -XCOMM -XCOMM ProfileLibGlx - if defined, build libGL with profiling info -XCOMM -XCOMM SharedGlxRev - dynamic library version, currently defined to be "1.2" -XCOMM -XCOMM GlxSoProf - if defined, build dynamic libGL for profiling with soprof -XCOMM -XCOMM GlxStubLib - purpose??? -XCOMM -XCOMM -XCOMM Server-side tokens: -XCOMM BuildGlxExt -XCOMM GlxUseSGISI - -NULL = - -#include - -#define IHaveSubdirs - -#define PassCDebugFlags - -LIBGLBUILDDIR = GL - GLXDIRS = glx - -/* - * Need to build the Mesa + XMesa source in the following cases: - * BuildXF86DRI && defined(DriDrivers) - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - */ -#if BuildOSMesaLib || \ - (BuildXF86DRI && \ - (defined(DriDrivers) || GlxDriverUsesMesa || GlxBuiltInXMesa)) - MESADIRS = mesa -#endif - -/* - * Only need the OSmesa code in the following case: - * BuildOSMesaLib - */ -#if BuildOSMesaLib - OSMESADIRS = mesa/drivers/osmesa -#endif - -/* - * Need to build the DRI code in the following cases: - * BuildXF86DRI - */ -#if BuildXF86DRI - DRIDIRS = dri/drm -#endif - -/* - * Need to build the DRI drivers in the following cases: - * BuildXF86DRI && defined(DriDrivers) - */ -#if BuildXF86DRI && defined(DriDrivers) - DRIVERDIRS = mesa/drivers/dri -#endif - -#if defined(DarwinArchitecture) && BuildAppleDRI - DRIDIRS = apple -#endif - -/* - * The build order depends on whether the drivers are loaded into libGL or - * built-in to libGL. In the former case, libGL needs to be built before - * the drivers, and in the latter case, it needs to be built after the driver. - */ -#if BuildXF86DRI && GlxUseBuiltInDRIDriver -SUBDIRS = \ - $(MESADIRS) \ - $(DRIDIRS) \ - $(DRIVERDIRS) \ - $(GLXDIRS) \ - $(LIBGLBUILDDIR) \ - $(OSMESADIRS) \ - $(NULL) -#else -SUBDIRS = \ - $(MESADIRS) \ - $(GLXDIRS) \ - $(DRIDIRS) \ - $(LIBGLBUILDDIR) \ - $(OSMESADIRS) \ - $(DRIVERDIRS) \ - $(NULL) -#endif - -MakeSubdirs($(SUBDIRS)) - -DependSubdirs($(SUBDIRS)) - diff --git a/nx-X11/lib/GL/glx/Imakefile b/nx-X11/lib/GL/glx/Imakefile deleted file mode 100644 index 97d3b3224..000000000 --- a/nx-X11/lib/GL/glx/Imakefile +++ /dev/null @@ -1,233 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/glx/Imakefile,v 1.22 2003/11/12 00:10:24 dawes Exp $ -XCOMM The contents of this file are subject to the GLX Public License Version 1.0 -XCOMM (the "License"). You may not use this file except in compliance with the -XCOMM License. You may obtain a copy of the License at Silicon Graphics, Inc., -XCOMM attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 -XCOMM or at http://www.sgi.com/software/opensource/glx/license.html. -XCOMM -XCOMM Software distributed under the License is distributed on an "AS IS" -XCOMM basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY -XCOMM IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR -XCOMM PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific -XCOMM language governing rights and limitations under the License. -XCOMM -XCOMM The Original Software is GLX version 1.2 source code, released February, -XCOMM 1999. The developer of the Original Software is Silicon Graphics, Inc. -XCOMM Those portions of the Subject Software created by Silicon Graphics, Inc. -XCOMM are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. - -XCOMM $XdotOrg: xc/lib/GL/glx/Imakefile,v 1.12 2005/08/23 04:03:51 airlied Exp $ - -#include - -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -XCOMM #define IHaveSubdirs -XCOMM #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' -XCOMM -XCOMM SUBDIRS = \ -XCOMM glu \ -XCOMM glw - -/* Files from Mesa */ - -LinkSourceFile(glapi.c, $(MESASRCDIR)/src/mesa/glapi) -LinkSourceFile(glthread.c, $(MESASRCDIR)/src/mesa/glapi) -LinkSourceFile(glcontextmodes.c, $(MESASRCDIR)/src/mesa/drivers/dri/common) -LinkSourceFile(glcontextmodes.h, $(MESASRCDIR)/src/mesa/drivers/dri/common) -LinkSourceFile(dispatch.c, $(MESASRCDIR)/src/mesa/main) - -#ifdef i386Architecture -LinkSourceFile(glapi_x86.S, $(MESASRCDIR)/src/mesa/x86) -#endif -#ifdef SparcArchitecture -LinkSourceFile(glapi_sparc.S, $(MESASRCDIR)/src/mesa/sparc) -#endif - -LinkSourceFile(XF86dri.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(clientattrib.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(compsize.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(dri_glx.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(dri_glx.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(eval.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(glx_pbuffer.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(glx_query.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(glx_texture_compression.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(glxclient.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(glxcmds.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(glxext.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(glxextensions.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(glxextensions.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_init.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_init.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_size.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_transpose_matrix.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_va_private.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_vertex_array.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_vertex_array.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_vertex_program.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(indirect_window_pos.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(packrender.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(packsingle.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(pixel.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(pixelstore.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(render2.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(renderpix.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(single2.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(singlepix.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(vertarr.c, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(xf86dri.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(xf86dristr.h, $(MESASRCDIR)/src/glx/x11) -LinkSourceFile(xfont.c, $(MESASRCDIR)/src/glx/x11) - -/* - * Maybe some of these could come from - * xc/extras/ogl-sample/main/glx/lib at some point. - */ - GLX_SRCS = \ - clientattrib.c \ - compsize.c \ - dispatch.c \ - eval.c \ - glapi.c \ - glthread.c \ - glx_pbuffer.c \ - glx_query.c \ - glx_texture_compression.c \ - glxcmds.c \ - glxext.c \ - glxextensions.c \ - glcontextmodes.c \ - indirect.c \ - indirect_init.c \ - indirect_size.c \ - indirect_transpose_matrix.c \ - indirect_vertex_array.c \ - indirect_vertex_program.c \ - indirect_window_pos.c \ - pixel.c \ - pixelstore.c \ - render2.c \ - renderpix.c \ - single2.c \ - singlepix.c \ - vertarr.c \ - xfont.c - - GLX_OBJS = \ - clientattrib.o \ - compsize.o \ - eval.o \ - dispatch.o \ - glapi.o \ - glthread.o \ - glx_pbuffer.o \ - glx_query.o \ - glx_texture_compression.o \ - glxcmds.o \ - glxext.o \ - glxextensions.o \ - glcontextmodes.o \ - indirect.o \ - indirect_init.o \ - indirect_size.o \ - indirect_transpose_matrix.o \ - indirect_vertex_array.o \ - indirect_vertex_program.o \ - indirect_window_pos.o \ - pixel.o \ - pixelstore.o \ - render2.o \ - renderpix.o \ - single2.o \ - singlepix.o \ - vertarr.o \ - xfont.o - - GLX_DEFS = GlxDefines VidModeExtensionDefines \ - -DDEFAULT_DRIVER_DIR=\"$(MODULEDIR)/dri\" - -#ifdef i386Architecture - ASM_DIR = x86 -#endif -#ifdef SparcArchitecture - ASM_DIR = sparc -#endif - -#if BuildXF86DRI - DRI_SRCS = dri_glx.c XF86dri.c - DRI_OBJS = dri_glx.o XF86dri.o - - DRI_INCS = -I$(SERVERSRC)/GL/dri -#if defined(i386Architecture) && MesaUseX86Asm - ASM_SRCS = glapi_x86.S - ASM_OBJS = glapi_x86.o - ASM_DEFS = -DUSE_X86_ASM -#endif -#if defined(SparcArchitecture) - ASM_SRCS = glapi_sparc.S - ASM_OBJS = glapi_sparc.o - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#if GlxBuiltInXMesa - XMESA_DEFINES = -DGLX_BUILT_IN_XMESA -#endif -#endif - -#if defined(DarwinArchitecture) || defined(OS2Architecture) || \ -defined(LynxOSArchitecture) -ALIAS_DEFINES = -DGLX_ALIAS_UNSUPPORTED -#endif -#if defined(DarwinArchitecture) && BuildAppleDRI - DRI_SRCS = XF86dri.c - DRI_OBJS = XF86dri.o - - DRI_INCS = -I$(SERVERSRC)/GL/dri -#endif - - SRCS = $(GLX_SRCS) $(ASM_SRCS) $(DRI_SRCS) - OBJS = $(GLX_OBJS) $(ASM_OBJS) $(DRI_OBJS) - DEFINES = $(GLX_DEFS) $(ASM_DEFS) $(XMESA_DEFINES) $(ALIAS_DEFINES) \ - $(THREADS_DEFINES) - - INCLUDES = -I$(XINCLUDESRC) \ - -I$(MESASRCDIR)/include \ - -I$(EXTINCSRC) \ - -I$(GLXLIBSRC)/glx \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/drivers/x11 \ - -I$(MESASRCDIR)/src/mesa/$(ASM_DIR) \ - -I$(XF86OSSRC) \ - -I$(DRMSRCDIR)/shared-core \ - $(DRI_INCS) - -#include - -LibraryObjectRule() - -#if BuildXF86DRI && defined(i386Architecture) && MesaUseX86Asm -ObjectFromAsmSource(glapi_x86, NullParameter) -#endif -#if BuildXF86DRI && defined(SparcArchitecture) -STD_CPP_DEFINES = StandardDefines $(PROJECT_DEFINES) -ObjectFromAsmSource(glapi_sparc, NullParameter) -#endif - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/Imakefile b/nx-X11/lib/GL/mesa/Imakefile deleted file mode 100644 index 9e1db00a0..000000000 --- a/nx-X11/lib/GL/mesa/Imakefile +++ /dev/null @@ -1,84 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile,v 1.30tsi Exp $ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -NULL = - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if defined(i386Architecture) && MesaUseX86Asm -#define MesaX86BuildDir /**/ -ASM_SUBDIRS = x86 -#endif -#ifdef SparcArchitecture -#define MesaSparcBuildDir /**/ -ASM_SUBDIRS = sparc -#endif -#define MesaBuildDir /**/ -#define NeedToLinkMesaSrc - -#ifdef UseCompaqMathLibrary - MATH_DEFINES = -DCCPML -#endif - - DEFINES = $(ALLOC_DEFINES) GlxDefines \ - $(MESA_ASM_DEFINES) $(MATH_DEFINES) - INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(GLXLIBSRC)/dri \ - -I$(MESASRCDIR)/include -I$(GLXLIBSRC)/include - -#include - -LibraryObjectRule() - -#define IHaveSubdirs -#define PassCDebugFlags - -SUBDIRS = \ - $(ASM_SUBDIRS) \ - array_cache \ - main \ - math \ - swrast \ - swrast_setup \ - tnl \ - tnl_dd \ - shader \ - $(NULL) - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/Imakefile.inc b/nx-X11/lib/GL/mesa/Imakefile.inc deleted file mode 100644 index 03a7971f8..000000000 --- a/nx-X11/lib/GL/mesa/Imakefile.inc +++ /dev/null @@ -1,57 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ - -#ifndef MesaBuildDir -#define MesaBuildDir $(GLXLIBSRC)/mesa/ -#endif - -MESABUILDDIR = MesaBuildDir - -COREMESASRCS = $(COREMESABASESRCS) \ - $(MESA_AC_SRCS) \ - $(MESA_MATH_SRCS) \ - $(MESA_SWRAST_SRCS) \ - $(MESA_SWR_SETUP_SRCS) \ - $(MESA_TNL_SRCS) \ - $(MESA_SHADER_SRCS) \ - $(MESA_GRAMMAR_SRCS) \ - $(MESA_SLANG_SRCS) - -COREMESAOBJS = $(COREMESABASEOBJS) \ - $(MESA_AC_OBJS) \ - $(MESA_MATH_OBJS) \ - $(MESA_SWRAST_OBJS) \ - $(MESA_SWR_SETUP_OBJS) \ - $(MESA_TNL_OBJS) \ - $(MESA_SHADER_OBJS) \ - $(MESA_GRAMMAR_OBJS) \ - $(MESA_SLANG_OBJS) - -COREMESAUOBJS = $(COREMESABASEUOBJS) \ - $(MESA_AC_UOBJS) \ - $(MESA_MATH_UOBJS) \ - $(MESA_SWRAST_UOBJS) \ - $(MESA_SWR_SETUP_UOBJS) \ - $(MESA_TNL_UOBJS) \ - $(MESA_SHADER_UOBJS) \ - $(MESA_GRAMMAR_UOBJS) \ - $(MESA_SLANG_UOBJS) - -COREMESADOBJS = $(COREMESABASEDOBJS) \ - $(MESA_AC_DOBJS) \ - $(MESA_MATH_DOBJS) \ - $(MESA_SWRAST_DOBJS) \ - $(MESA_SWR_SETUP_DOBJS) \ - $(MESA_TNL_DOBJS) \ - $(MESA_SHADER_DOBJS) \ - $(MESA_GRAMMAR_DOBJS) \ - $(MESA_SLANG_DOBJS) - -COREMESAPOBJS = $(COREMESABASEPOBJS) \ - $(MESA_AC_POBJS) \ - $(MESA_MATH_POBJS) \ - $(MESA_SWRAST_POBJS) \ - $(MESA_SWR_SETUP_POBJS) \ - $(MESA_TNL_POBJS) \ - $(MESA_SHADER_POBJS) \ - $(MESA_GRAMMAR_POBJS) \ - $(MESA_SLANG_POBJS) diff --git a/nx-X11/lib/GL/mesa/array_cache/Imakefile b/nx-X11/lib/GL/mesa/array_cache/Imakefile deleted file mode 100644 index 40c9c6b52..000000000 --- a/nx-X11/lib/GL/mesa/array_cache/Imakefile +++ /dev/null @@ -1,91 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/array_cache/Imakefile,v 1.8 2002/11/25 12:58:55 tsi Exp $ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - - -#define MesaACBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I../../../include \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/array_cache \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - SRCS = $(MESA_AC_SRCS) - OBJS = $(MESA_AC_OBJS) - - -#if defined(i386Architecture) && MesaUseX86Asm - ASM_SRCS = - ASM_OBJS = -#if MesaUseMMX - MMX_DEFS = -DUSE_MMX_ASM -#endif -#if MesaUse3DNow - 3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif -#if MesaUseSSE - SSE_DEFS = -DUSE_SSE_ASM -#endif - ASM_DEFS = -DUSE_X86_ASM $(MMX_DEFS) $(3DNOW_DEFS) $(SSE_DEFS) -#endif - -#ifdef SparcArchitecture - ASM_SRCS = - ASM_OBJS = - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/array_cache/Imakefile.inc b/nx-X11/lib/GL/mesa/array_cache/Imakefile.inc deleted file mode 100644 index 9a5044791..000000000 --- a/nx-X11/lib/GL/mesa/array_cache/Imakefile.inc +++ /dev/null @@ -1,34 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/array_cache/Imakefile.inc,v 1.1tsi Exp $ - -#ifndef MesaACBuildDir -#define MesaACBuildDir $(GLXLIBSRC)/mesa/array_cache/ -#endif - -MESAACBUILDDIR = MesaACBuildDir - - MESA_AC_SRCS = $(MESAACBUILDDIR)ac_context.c \ - $(MESAACBUILDDIR)ac_import.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(acache.h, $(MESASRCDIR)/src/mesa/array_cache) -LinkSourceFile(ac_context.c, $(MESASRCDIR)/src/mesa/array_cache) -LinkSourceFile(ac_context.h, $(MESASRCDIR)/src/mesa/array_cache) -LinkSourceFile(ac_import.c, $(MESASRCDIR)/src/mesa/array_cache) -#endif - - MESA_AC_OBJS = $(MESAACBUILDDIR)ac_context.o \ - $(MESAACBUILDDIR)ac_import.o - -#if defined(DoSharedLib) && DoSharedLib - MESA_AC_UOBJS = $(MESAACBUILDDIR)unshared/ac_context.o \ - $(MESAACBUILDDIR)unshared/ac_import.o -#else - MESA_AC_UOBJS = $(MESA_AC_OBJS) -#endif - - MESA_AC_DOBJS = $(MESAACBUILDDIR)debugger/ac_context.o \ - $(MESAACBUILDDIR)debugger/ac_import.o - - MESA_AC_POBJS = $(MESAACBUILDDIR)profiled/ac_context.o \ - $(MESAACBUILDDIR)profiled/ac_import.o - diff --git a/nx-X11/lib/GL/mesa/drivers/dri/common/Imakefile b/nx-X11/lib/GL/mesa/drivers/dri/common/Imakefile deleted file mode 100644 index 5c910489f..000000000 --- a/nx-X11/lib/GL/mesa/drivers/dri/common/Imakefile +++ /dev/null @@ -1,44 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/common/Imakefile,v 1.6 2001/04/03 02:29:34 dawes Exp $ - -#include - -#if GlxUseBuiltInDRIDriver -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtrasLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -#if defined(i386Architecture) && MesaUseX86Asm -#include "../../../x86/Imakefile.inc" -#endif -#ifdef SparcArchitecture -#include "../../../sparc/Imakefile.inc" -#endif - -#define NeedToLinkMesaSrc -#define MesaDrvCommonBuildDir /**/ -#include "Imakefile.inc" - - DEFINES = $(ALLOC_DEFINES) $(COMMON_DRI_DEFINES) $(MESA_ASM_DEFINES) - INCLUDES = $(COMMON_X_INCLUDES) $(COMMON_MESA_INCLUDES) \ - $(COMMON_DRI_INCLUDES) - - SRCS = $(COMMONSRCS) - OBJS = $(COMMONOBJS) - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/drivers/dri/common/Imakefile.inc b/nx-X11/lib/GL/mesa/drivers/dri/common/Imakefile.inc deleted file mode 100644 index 388b724b2..000000000 --- a/nx-X11/lib/GL/mesa/drivers/dri/common/Imakefile.inc +++ /dev/null @@ -1,105 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/common/Imakefile.inc,v 1.3 2003/05/27 16:34:32 tsi Exp $ - -#ifndef MesaDrvSrcDir -#define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri -#endif - -MESADRVSRCDIR = MesaDrvSrcDir - -#ifndef MesaDrvCommonBuildDir -#define MesaDrvCommonBuildDir $(MESADRVSRCDIR)/common/ -#endif - -MESADRVCOMMONBUILDDIR = MesaDrvCommonBuildDir - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - COMMON_DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=$(X_BYTE_ORDER) -DIN_DRI_DRIVER - COMMON_DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ - -I$(XINCLUDESRC) \ - -I$(GLXLIBSRC)/glx \ - -I$(GLXLIBSRC)/include \ - -I$(SERVERSRC)/GL/dri \ - -I$(XF86OSSRC) \ - -I$(XF86COMSRC) \ - -I$(GLXLIBSRC)/dri/drm \ - -I$(GLXLIBSRC)/include \ - -I$(DRMSRCDIR)/shared-core \ - -I$(MESASRCDIR)/include/GL/internal -#endif - -COMMON_MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/shader \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESADRVSRCDIR)/common \ - -I$(MESADRVSRCDIR)/../common \ - -I$(MESASRCDIR)/include - COMMON_X_INCLUDES = -I$(XINCLUDESRC) -I$(EXTINCSRC) - - COMMONSRCS = $(MESADRVCOMMONBUILDDIR)utils.c \ - $(MESADRVCOMMONBUILDDIR)vblank.c \ - $(MESADRVCOMMONBUILDDIR)texmem.c \ - $(MESADRVCOMMONBUILDDIR)xmlconfig.c \ - $(MESADRVCOMMONBUILDDIR)driverfuncs.c \ - $(MESADRVCOMMONBUILDDIR)dri_util.c \ - $(MESADRVCOMMONBUILDDIR)glcontextmodes.c \ - $(MESADRVCOMMONBUILDDIR)drirenderbuffer.c - - COMMONOBJS = $(MESADRVCOMMONBUILDDIR)utils.o \ - $(MESADRVCOMMONBUILDDIR)vblank.o \ - $(MESADRVCOMMONBUILDDIR)texmem.o \ - $(MESADRVCOMMONBUILDDIR)xmlconfig.o \ - $(MESADRVCOMMONBUILDDIR)driverfuncs.o \ - $(MESADRVCOMMONBUILDDIR)dri_util.o \ - $(MESADRVCOMMONBUILDDIR)glcontextmodes.o \ - $(MESADRVCOMMONBUILDDIR)drirenderbuffer.o - - COMMONUOBJS = $(MESADRVCOMMONBUILDDIR)unshared/utils.o \ - $(MESADRVCOMMONBUILDDIR)unshared/vblank.o \ - $(MESADRVCOMMONBUILDDIR)unshared/texmem.o \ - $(MESADRVCOMMONBUILDDIR)unshared/xmlconfig.o \ - $(MESADRVCOMMONBUILDDIR)unshared/driverfuncs.o \ - $(MESADRVCOMMONBUILDDIR)unshared/dri_util.o \ - $(MESADRVCOMMONBUILDDIR)unshared/glcontextmodes.o \ - $(MESADRVCOMMONBUILDDIR)unshared/drirenderbuffer.o - - COMMONDOBJS = $(MESADRVCOMMONBUILDDIR)debugger/utils.o \ - $(MESADRVCOMMONBUILDDIR)debugger/vblank.o \ - $(MESADRVCOMMONBUILDDIR)debugger/texmem.o \ - $(MESADRVCOMMONBUILDDIR)debugger/xmlconfig.o \ - $(MESADRVCOMMONBUILDDIR)debugger/driverfuncs.o \ - $(MESADRVCOMMONBUILDDIR)debugger/dri_util.o \ - $(MESADRVCOMMONBUILDDIR)debugger/glcontextmodes.o \ - $(MESADRVCOMMONBUILDDIR)debugger/drirenderbuffer.o - - COMMONPOBJS = $(MESADRVCOMMONBUILDDIR)profiled/utils.o \ - $(MESADRVCOMMONBUILDDIR)profiled/vblank.o \ - $(MESADRVCOMMONBUILDDIR)profiled/texmem.o \ - $(MESADRVCOMMONBUILDDIR)profiled/xmlconfig.o \ - $(MESADRVCOMMONBUILDDIR)profiled/driverfuncs.o \ - $(MESADRVCOMMONBUILDDIR)profiled/dri_util.o \ - $(MESADRVCOMMONBUILDDIR)profiled/glcontextmodes.o \ - $(MESADRVCOMMONBUILDDIR)profiled/drirenderbuffer.o - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(texmem.c, $(MESADRVSRCDIR)/common) -LinkSourceFile(texmem.h, $(MESADRVSRCDIR)/common) -LinkSourceFile(utils.c, $(MESADRVSRCDIR)/common) -LinkSourceFile(utils.h, $(MESADRVSRCDIR)/common) -LinkSourceFile(vblank.c, $(MESADRVSRCDIR)/common) -LinkSourceFile(vblank.h, $(MESADRVSRCDIR)/common) -LinkSourceFile(xmlconfig.c, $(MESADRVSRCDIR)/common) -LinkSourceFile(xmlconfig.h, $(MESADRVSRCDIR)/common) -LinkSourceFile(driverfuncs.c, $(MESADRVSRCDIR)/../common) -LinkSourceFile(driverfuncs.h, $(MESADRVSRCDIR)/../common) -LinkSourceFile(dri_util.c, $(MESADRVSRCDIR)/common) -LinkSourceFile(dri_util.h, $(MESADRVSRCDIR)/common) -LinkSourceFile(glcontextmodes.c, $(MESADRVSRCDIR)/common) -LinkSourceFile(glcontextmodes.h, $(MESADRVSRCDIR)/common) -LinkSourceFile(drirenderbuffer.c, $(MESADRVSRCDIR)/common) -LinkSourceFile(drirenderbuffer.h, $(MESADRVSRCDIR)/common) -#endif diff --git a/nx-X11/lib/GL/mesa/drivers/osmesa/Imakefile b/nx-X11/lib/GL/mesa/drivers/osmesa/Imakefile deleted file mode 100644 index 014945699..000000000 --- a/nx-X11/lib/GL/mesa/drivers/osmesa/Imakefile +++ /dev/null @@ -1,111 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/OSmesa/Imakefile,v 1.16 2002/11/25 14:04:50 eich Exp $ - -#include - -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#include "../../array_cache/Imakefile.inc" -#include "../../math/Imakefile.inc" -#include "../../main/Imakefile.inc" -#include "../../shader/Imakefile.inc" -#include "../../shader/grammar/Imakefile.inc" -#include "../../shader/slang/Imakefile.inc" -#include "../../swrast/Imakefile.inc" -#include "../../swrast_setup/Imakefile.inc" -#include "../../tnl/Imakefile.inc" -#include "../../tnl_dd/Imakefile.inc" -#include "../../Imakefile.inc" -#if defined(i386Architecture) && !SystemV4 && MesaUseX86Asm -#include "../../x86/Imakefile.inc" -#endif -#ifdef SparcArchitecture -#include "../../sparc/Imakefile.inc" -#endif - -LinkSourceFile(osmesa.c, $(MESASRCDIR)/src/mesa/drivers/osmesa) -LinkSourceFile(driverfuncs.c, $(MESASRCDIR)/src/mesa/drivers/common) -LinkSourceFile(driverfuncs.h, $(MESASRCDIR)/src/mesa/drivers/common) - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/shader \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/include - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) - INCLUDES = -I$(XINCLUDESRC) -I$(EXTINCSRC) $(MESA_INCLUDES) \ - $(DRI_INCLUDES) -I$(GLXLIBSRC)/include - - MESAOBJS = $(COREMESAOBJS) $(MESA_ASM_OBJS) - MESAUOBJS = $(COREMESAUOBJS) $(MESA_ASM_UOBJS) - MESADOBJS = $(COREMESADOBJS) $(MESA_ASM_DOBJS) - MESAPOBJS = $(COREMESAPOBJS) $(MESA_ASM_POBJS) - - SRCS = osmesa.c driverfuncs.c - OBJS = osmesa.o driverfuncs.o $(MESAOBJS) -#if DoSharedLib - UOBJS = unshared/osmesa.o unshared/driverfuncs.o $(MESAUOBJS) -#else - UOBJS = $(OBJS) -#endif - DOBJS = debugger/osmesa.o debugger/driverfuncs.o $(MESADOBJS) - POBJS = profiled/osmesa.o profiled/driverfuncs.o $(MESAPOBJS) - -#if LocalThreads - THREADOBJS = $(THREADS_LIBS) -#endif - -#if !GlxUseBuiltInDRIDriver -# ifdef SharedOSMesaReqs - REQUIREDLIBS = SharedOSMesaReqs -# else - REQUIREDLIBS = MathLibrary $(LDPRELIB) $(XLIB) $(GLXLIB) -# endif -#endif - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -LIBNAME = OSMesa -SOREV = 4.0 - - -#if DoNormalLib -NormalLibraryTarget($(LIBNAME), $(UOBJS)) -InstallLibrary($(LIBNAME),$(USRLIBDIR)) -#endif - -#if SharedLibGlx -SharedLibraryTarget($(LIBNAME),$(SOREV), $(OBJS), ., .) -InstallSharedLibrary($(LIBNAME),$(SOREV),$(SHLIBDIR)) -#endif - -#if DoDebugLib -DebuggedLibraryTarget($(LIBNAME),$(DOBJS)) -InstallLibrary($(LIBNAME_d,$(USRLIBDIR)) -#endif - -#if DoProfileLib -ProfiledLibraryTarget($(LIBNAME), $(POBJS)) -InstallLibrary($(LIBNAME)_p,$(USRLIBDIR)) -#endif - -DependTarget() - diff --git a/nx-X11/lib/GL/mesa/drivers/osmesa/OSMesa-def.cpp b/nx-X11/lib/GL/mesa/drivers/osmesa/OSMesa-def.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/nx-X11/lib/GL/mesa/drivers/x11/Imakefile b/nx-X11/lib/GL/mesa/drivers/x11/Imakefile deleted file mode 100644 index ab9a91970..000000000 --- a/nx-X11/lib/GL/mesa/drivers/x11/Imakefile +++ /dev/null @@ -1,70 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/X/Imakefile,v 1.12tsi Exp $ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - - -#define MesaXBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I.. \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src \ - -I$(MESASRCDIR)/src/X \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - -#if BuildXF86DRI && GlxBuiltInXMesa - XMESA_DEFINES = -DGLX_BUILT_IN_XMESA -#endif - - SRCS = $(XMESA_SRCS) - OBJS = $(XMESA_OBJS) - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(MATHDEF) $(XMESA_DEFINES) - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(XMESA_OBJS)) -NormalLintTarget($(XMESA_SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/drivers/x11/Imakefile.inc b/nx-X11/lib/GL/mesa/drivers/x11/Imakefile.inc deleted file mode 100644 index d62800e7d..000000000 --- a/nx-X11/lib/GL/mesa/drivers/x11/Imakefile.inc +++ /dev/null @@ -1,104 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/X/Imakefile.inc,v 1.3tsi Exp $ - -#ifndef MesaXBuildDir -#define MesaXBuildDir $(GLXLIBSRC)/src/mesa/drivers/x11/ -#endif - -MESAXBUILDDIR = MesaXBuildDir - -#ifndef MesaInXServer -XMESA_GLX_SRCS = $(MESAXBUILDDIR)fakeglx.c \ - $(MESAXBUILDDIR)glxapi.c \ - $(MESAXBUILDDIR)realglx.c \ - $(MESAXBUILDDIR)xfonts.c -#endif - - XMESA_SRCS = $(XMESA_GLX_SRCS) \ - $(MESAXBUILDDIR)xm_api.c \ - $(MESAXBUILDDIR)xm_buffer.c \ - $(MESAXBUILDDIR)xm_dd.c \ - $(MESAXBUILDDIR)xm_line.c \ - $(MESAXBUILDDIR)xm_span.c \ - $(MESAXBUILDDIR)xm_tri.c - -#ifdef NeedToLinkMesaSrc -#ifndef MesaInXServer -LinkSourceFile(fakeglx.c, $(MESASRCDIR)/src/mesa/drivers/x11) -LinkSourceFile(glxapi.c, $(MESASRCDIR)/src/mesa/drivers/x11) -LinkSourceFile(glxapi.h, $(MESASRCDIR)/src/mesa/drivers/x11) -LinkSourceFile(realglx.c, $(MESASRCDIR)/src/mesa/drivers/x11) -LinkSourceFile(xfonts.c, $(MESASRCDIR)/src/mesa/drivers/x11) -#endif -LinkSourceFile(xm_api.c, $(MESASRCDIR)/src/mesa/drivers/x11) -LinkSourceFile(xm_buffer.c, $(MESASRCDIR)/src/mesa/drivers/x11) -LinkSourceFile(xm_dd.c, $(MESASRCDIR)/src/mesa/drivers/x11) -LinkSourceFile(xm_line.c, $(MESASRCDIR)/src/mesa/drivers/x11) -LinkSourceFile(xm_span.c, $(MESASRCDIR)/src/mesa/drivers/x11) -LinkSourceFile(xm_tri.c, $(MESASRCDIR)/src/mesa/drivers/x11) -#endif - -#ifndef MesaInXServer -XMESA_GLX_OBJS = $(MESAXBUILDDIR)fakeglx.o \ - $(MESAXBUILDDIR)glxapi.o \ - $(MESAXBUILDDIR)realglx.o \ - $(MESAXBUILDDIR)xfonts.o -#endif - - XMESA_OBJS = $(XMESA_GLX_OBJS) \ - $(MESAXBUILDDIR)xm_api.o \ - $(MESAXBUILDDIR)xm_buffer.o \ - $(MESAXBUILDDIR)xm_dd.o \ - $(MESAXBUILDDIR)xm_line.o \ - $(MESAXBUILDDIR)xm_span.o \ - $(MESAXBUILDDIR)xm_tri.o - -#if defined(DoSharedLib) && DoSharedLib -#ifndef MesaInXServer -XMESA_GLX_UOBJS = $(MESAXBUILDDIR)unshared/fakeglx.o \ - $(MESAXBUILDDIR)unshared/glxapi.o \ - $(MESAXBUILDDIR)unshared/realglx.o \ - $(MESAXBUILDDIR)unshared/xfonts.o -#endif - - XMESA_UOBJS = $(XMESA_GLX_UOBJS) \ - $(MESAXBUILDDIR)unshared/xm_api.o \ - $(MESAXBUILDDIR)unshared/xm_buffer.o \ - $(MESAXBUILDDIR)unshared/xm_dd.o \ - $(MESAXBUILDDIR)unshared/xm_line.o \ - $(MESAXBUILDDIR)unshared/xm_span.o \ - $(MESAXBUILDDIR)unshared/xm_tri.o -#else -XMESA_GLX_UOBJS = $(XMESA_GLX_OBJS) - XMESA_UOBJS = $(XMESA_OBJS) -#endif - -#ifndef MesaInXServer -XMESA_GLX_DOBJS = $(MESAXBUILDDIR)debugger/fakeglx.o \ - $(MESAXBUILDDIR)debugger/glxapi.o \ - $(MESAXBUILDDIR)debugger/realglx.o \ - $(MESAXBUILDDIR)debugger/xfonts.o -#endif - - XMESA_DOBJS = $(XMESA_GLX_DOBJS) \ - $(MESAXBUILDDIR)debugger/xm_api.o \ - $(MESAXBUILDDIR)debugger/xm_buffer.o \ - $(MESAXBUILDDIR)debugger/xm_dd.o \ - $(MESAXBUILDDIR)debugger/xm_line.o \ - $(MESAXBUILDDIR)debugger/xm_span.o \ - $(MESAXBUILDDIR)debugger/xm_tri.o - -#ifndef MesaInXServer -XMESA_GLX_POBJS = $(MESAXBUILDDIR)profiled/fakeglx.o \ - $(MESAXBUILDDIR)profiled/glxapi.o \ - $(MESAXBUILDDIR)profiled/realglx.o \ - $(MESAXBUILDDIR)profiled/xfonts.o -#endif - - XMESA_POBJS = $(XMESA_GLX_POBJS) \ - $(MESAXBUILDDIR)profiled/xm_api.o \ - $(MESAXBUILDDIR)profiled/xm_buffer.o \ - $(MESAXBUILDDIR)profiled/xm_dd.o \ - $(MESAXBUILDDIR)profiled/xm_line.o \ - $(MESAXBUILDDIR)profiled/xm_span.o \ - $(MESAXBUILDDIR)profiled/xm_tri.o - diff --git a/nx-X11/lib/GL/mesa/main/Imakefile b/nx-X11/lib/GL/mesa/main/Imakefile deleted file mode 100644 index 3093cedd1..000000000 --- a/nx-X11/lib/GL/mesa/main/Imakefile +++ /dev/null @@ -1,66 +0,0 @@ -XCOMM $XdotOrg: xc/lib/GL/mesa/main/Imakefile,v 1.3 2005/12/20 22:30:49 alanc Exp $ -XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile,v 1.30tsi Exp $ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris/SPARC builds */ -#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags) -# define LargePICTable YES -#endif - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#define MesaBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - -#ifdef UseCompaqMathLibrary - MATH_DEFINES = -DCCPML -#endif - - DEFINES = $(ALLOC_DEFINES) GlxDefines -DIN_DRI_DRIVER \ - $(MESA_ASM_DEFINES) $(MATH_DEFINES) - INCLUDES = /*-I$(INCLUDESRC) -I$(EXTINCSRC) */ -I$(XINCLUDESRC) \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa/shader \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa -I$(GLXLIBSRC)/dri \ - -I$(MESASRCDIR)/include -I$(GLXLIBSRC)/include - SRCS = $(COREMESABASESRCS) - OBJS = $(COREMESABASEOBJS) - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/main/Imakefile.inc b/nx-X11/lib/GL/mesa/main/Imakefile.inc deleted file mode 100644 index 80b3aef07..000000000 --- a/nx-X11/lib/GL/mesa/main/Imakefile.inc +++ /dev/null @@ -1,487 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ - -/* gcc on ppc64 defines this, causes macro recursion with pixel below */ -#undef pixel - -#ifndef MesaBuildDir -#define MesaBuildDir $(GLXLIBSRC)/mesa/main/ -#endif - -MESABUILDDIR = MesaBuildDir - -#ifdef NeedAllMesaSrc - DISPATCHSRCS = $(MESABUILDDIR)dispatch.c - GLAPISRCS = $(MESABUILDDIR)glapi.c - GLTHREADSRCS = $(MESABUILDDIR)glthread.c -#endif - -MESA_CORE_INCLUDES = -I$(MESASRCDIR)/src/array_cache \ - -I$(MESASRCDIR)/src/math -I$(MESASRCDIR)/src/shader \ - -I$(MESASRCDIR)/src/swrast -I$(MESASRCDIR)/src/swrast_setup \ - -I$(MESASRCDIR)/src/tnl -I$(MESASRCDIR)/src/tnl_dd - -COREMESABASESRCS = \ - $(MESABUILDDIR)api_arrayelt.c \ - $(MESABUILDDIR)api_loopback.c \ - $(MESABUILDDIR)api_noop.c \ - $(MESABUILDDIR)api_validate.c \ - $(MESABUILDDIR)accum.c \ - $(MESABUILDDIR)attrib.c \ - $(MESABUILDDIR)blend.c \ - $(MESABUILDDIR)bufferobj.c \ - $(MESABUILDDIR)buffers.c \ - $(MESABUILDDIR)clip.c \ - $(MESABUILDDIR)colortab.c \ - $(MESABUILDDIR)context.c \ - $(MESABUILDDIR)convolve.c \ - $(MESABUILDDIR)debug.c \ - $(MESABUILDDIR)depth.c \ - $(MESABUILDDIR)dlist.c \ - $(MESABUILDDIR)drawpix.c \ - $(MESABUILDDIR)enable.c \ - $(MESABUILDDIR)enums.c \ - $(MESABUILDDIR)eval.c \ - $(MESABUILDDIR)execmem.c \ - $(MESABUILDDIR)extensions.c \ - $(MESABUILDDIR)feedback.c \ - $(MESABUILDDIR)fbobject.c \ - $(MESABUILDDIR)fog.c \ - $(MESABUILDDIR)framebuffer.c \ - $(MESABUILDDIR)get.c \ - $(MESABUILDDIR)getstring.c \ - $(MESABUILDDIR)hash.c \ - $(MESABUILDDIR)hint.c \ - $(MESABUILDDIR)histogram.c \ - $(MESABUILDDIR)image.c \ - $(MESABUILDDIR)imports.c \ - $(MESABUILDDIR)light.c \ - $(MESABUILDDIR)lines.c \ - $(MESABUILDDIR)matrix.c \ - $(MESABUILDDIR)mm.c \ - $(MESABUILDDIR)occlude.c \ - $(MESABUILDDIR)pixel.c \ - $(MESABUILDDIR)points.c \ - $(MESABUILDDIR)polygon.c \ - $(MESABUILDDIR)rastpos.c \ - $(MESABUILDDIR)renderbuffer.c \ - $(MESABUILDDIR)state.c \ - $(MESABUILDDIR)stencil.c \ - $(MESABUILDDIR)texcompress.c \ - $(MESABUILDDIR)texcompress_fxt1.c \ - $(MESABUILDDIR)texcompress_s3tc.c \ - $(MESABUILDDIR)texenvprogram.c \ - $(MESABUILDDIR)texformat.c \ - $(MESABUILDDIR)teximage.c \ - $(MESABUILDDIR)texobj.c \ - $(MESABUILDDIR)texrender.c \ - $(MESABUILDDIR)texstate.c \ - $(MESABUILDDIR)texstore.c \ - $(MESABUILDDIR)varray.c \ - $(MESABUILDDIR)vtxfmt.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(api_arrayelt.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(api_arrayelt.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(api_eval.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(api_loopback.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(api_loopback.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(api_noop.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(api_noop.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(api_validate.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(api_validate.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(accum.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(accum.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(attrib.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(attrib.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(blend.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(blend.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(bufferobj.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(bufferobj.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(buffers.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(buffers.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(clip.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(clip.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(colormac.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(colortab.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(colortab.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(config.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(context.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(context.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(convolve.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(convolve.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(dd.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(debug.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(debug.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(depth.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(depth.h, $(MESASRCDIR)/src/mesa/main) -#ifdef NeedAllMesaSrc -LinkSourceFile(dispatch.c, $(MESASRCDIR)/src/mesa/main) -#endif -LinkSourceFile(dlist.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(dlist.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(drawpix.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(drawpix.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(enable.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(enable.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(enums.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(enums.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(eval.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(eval.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(execmem.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(extensions.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(extensions.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(fbobject.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(fbobject.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(feedback.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(feedback.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(fog.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(fog.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(framebuffer.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(framebuffer.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(get.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(get.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(getstring.c, $(MESASRCDIR)/src/mesa/main) -#ifdef NeedAllMesaSrc -LinkSourceFile(glapi.c, $(MESASRCDIR)/src/mesa/glapi) -LinkSourceFile(glthread.c, $(MESASRCDIR)/src/mesa/glapi) -#endif -LinkSourceFile(glheader.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(hash.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(hash.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(hint.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(hint.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(histogram.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(histogram.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(image.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(image.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(imports.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(imports.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(light.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(light.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(lines.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(lines.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(macros.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(matrix.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(matrix.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(mm.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(mm.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(mtypes.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(occlude.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(occlude.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(pixel.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(pixel.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(points.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(points.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(polygon.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(polygon.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(rastpos.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(rastpos.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(renderbuffer.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(renderbuffer.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(simple_list.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(state.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(state.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(stencil.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(stencil.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texcompress.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texcompress_fxt1.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texcompress_s3tc.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texcompress.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texenvprogram.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texenvprogram.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texformat.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texformat.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texformat_tmp.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(teximage.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(teximage.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texobj.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texobj.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texrender.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texrender.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texstate.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texstate.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texstore.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(texstore.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(varray.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(varray.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(version.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(vtxfmt.c, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(vtxfmt.h, $(MESASRCDIR)/src/mesa/main) -LinkSourceFile(vtxfmt_tmp.h, $(MESASRCDIR)/src/mesa/main) -#endif - -#ifdef NeedAllMesaSrc - DISPATCHOBJS = $(MESABUILDDIR)dispatch.o - GLAPIOBJS = $(MESABUILDDIR)glapi.o - GLTHREADOBJS = $(MESABUILDDIR)glthread.o -#endif - -COREMESABASEOBJS = \ - $(DISPATCHOBJS) \ - $(GLAPIOBJS) \ - $(GLTHREADOBJS) \ - $(MESABUILDDIR)api_arrayelt.o \ - $(MESABUILDDIR)api_loopback.o \ - $(MESABUILDDIR)api_noop.o \ - $(MESABUILDDIR)api_validate.o \ - $(MESABUILDDIR)accum.o \ - $(MESABUILDDIR)attrib.o \ - $(MESABUILDDIR)blend.o \ - $(MESABUILDDIR)bufferobj.o \ - $(MESABUILDDIR)buffers.o \ - $(MESABUILDDIR)clip.o \ - $(MESABUILDDIR)colortab.o \ - $(MESABUILDDIR)context.o \ - $(MESABUILDDIR)convolve.o \ - $(MESABUILDDIR)debug.o \ - $(MESABUILDDIR)depth.o \ - $(MESABUILDDIR)dlist.o \ - $(MESABUILDDIR)drawpix.o \ - $(MESABUILDDIR)enable.o \ - $(MESABUILDDIR)enums.o \ - $(MESABUILDDIR)eval.o \ - $(MESABUILDDIR)execmem.o \ - $(MESABUILDDIR)extensions.o \ - $(MESABUILDDIR)fbobject.o \ - $(MESABUILDDIR)feedback.o \ - $(MESABUILDDIR)fog.o \ - $(MESABUILDDIR)framebuffer.o \ - $(MESABUILDDIR)get.o \ - $(MESABUILDDIR)getstring.o \ - $(MESABUILDDIR)hash.o \ - $(MESABUILDDIR)hint.o \ - $(MESABUILDDIR)histogram.o \ - $(MESABUILDDIR)image.o \ - $(MESABUILDDIR)imports.o \ - $(MESABUILDDIR)light.o \ - $(MESABUILDDIR)lines.o \ - $(MESABUILDDIR)matrix.o \ - $(MESABUILDDIR)mm.o \ - $(MESABUILDDIR)occlude.o \ - $(MESABUILDDIR)pixel.o \ - $(MESABUILDDIR)points.o \ - $(MESABUILDDIR)polygon.o \ - $(MESABUILDDIR)rastpos.o \ - $(MESABUILDDIR)renderbuffer.o \ - $(MESABUILDDIR)state.o \ - $(MESABUILDDIR)stencil.o \ - $(MESABUILDDIR)texcompress.o \ - $(MESABUILDDIR)texcompress_fxt1.o \ - $(MESABUILDDIR)texcompress_s3tc.o \ - $(MESABUILDDIR)texenvprogram.o \ - $(MESABUILDDIR)texformat.o \ - $(MESABUILDDIR)teximage.o \ - $(MESABUILDDIR)texrender.o \ - $(MESABUILDDIR)texobj.o \ - $(MESABUILDDIR)texstate.o \ - $(MESABUILDDIR)texstore.o \ - $(MESABUILDDIR)varray.o \ - $(MESABUILDDIR)vtxfmt.o - -#ifdef NeedAllMesaSrc - DISPATCHUOBJS = $(MESABUILDDIR)unshared/dispatch.o - GLAPIUOBJS = $(MESABUILDDIR)unshared/glapi.o - GLTHREADUOBJS = $(MESABUILDDIR)unshared/glthread.o -#endif - -#if defined(DoSharedLib) && DoSharedLib -COREMESABASEUOBJS = \ - $(DISPATCHUOBJS) \ - $(GLAPIUOBJS) \ - $(GLTHREADUOBJS) \ - $(MESABUILDDIR)unshared/api_arrayelt.o \ - $(MESABUILDDIR)unshared/api_loopback.o \ - $(MESABUILDDIR)unshared/api_noop.o \ - $(MESABUILDDIR)unshared/api_validate.o \ - $(MESABUILDDIR)unshared/accum.o \ - $(MESABUILDDIR)unshared/attrib.o \ - $(MESABUILDDIR)unshared/blend.o \ - $(MESABUILDDIR)unshared/bufferobj.o \ - $(MESABUILDDIR)unshared/buffers.o \ - $(MESABUILDDIR)unshared/clip.o \ - $(MESABUILDDIR)unshared/colortab.o \ - $(MESABUILDDIR)unshared/context.o \ - $(MESABUILDDIR)unshared/convolve.o \ - $(MESABUILDDIR)unshared/debug.o \ - $(MESABUILDDIR)unshared/depth.o \ - $(MESABUILDDIR)unshared/dlist.o \ - $(MESABUILDDIR)unshared/drawpix.o \ - $(MESABUILDDIR)unshared/enable.o \ - $(MESABUILDDIR)unshared/enums.o \ - $(MESABUILDDIR)unshared/eval.o \ - $(MESABUILDDIR)unshared/execmem.o \ - $(MESABUILDDIR)unshared/extensions.o \ - $(MESABUILDDIR)unshared/fbobject.o \ - $(MESABUILDDIR)unshared/feedback.o \ - $(MESABUILDDIR)unshared/fog.o \ - $(MESABUILDDIR)unshared/framebuffer.o \ - $(MESABUILDDIR)unshared/get.o \ - $(MESABUILDDIR)unshared/getstring.o \ - $(MESABUILDDIR)unshared/hash.o \ - $(MESABUILDDIR)unshared/hint.o \ - $(MESABUILDDIR)unshared/histogram.o \ - $(MESABUILDDIR)unshared/image.o \ - $(MESABUILDDIR)unshared/imports.o \ - $(MESABUILDDIR)unshared/light.o \ - $(MESABUILDDIR)unshared/lines.o \ - $(MESABUILDDIR)unshared/matrix.o \ - $(MESABUILDDIR)unshared/mm.o \ - $(MESABUILDDIR)unshared/occlude.o \ - $(MESABUILDDIR)unshared/pixel.o \ - $(MESABUILDDIR)unshared/points.o \ - $(MESABUILDDIR)unshared/polygon.o \ - $(MESABUILDDIR)unshared/rastpos.o \ - $(MESABUILDDIR)unshared/renderbuffer.o \ - $(MESABUILDDIR)unshared/state.o \ - $(MESABUILDDIR)unshared/stencil.o \ - $(MESABUILDDIR)unshared/texcompress.o \ - $(MESABUILDDIR)unshared/texcompress_fxt1.o \ - $(MESABUILDDIR)unshared/texcompress_s3tc.o \ - $(MESABUILDDIR)unshared/texenvprogram.o \ - $(MESABUILDDIR)unshared/texformat.o \ - $(MESABUILDDIR)unshared/teximage.o \ - $(MESABUILDDIR)unshared/texobj.o \ - $(MESABUILDDIR)unshared/texrender.o \ - $(MESABUILDDIR)unshared/texstate.o \ - $(MESABUILDDIR)unshared/texstore.o \ - $(MESABUILDDIR)unshared/varray.o \ - $(MESABUILDDIR)unshared/vtxfmt.o -#else -COREMESABASEUOBJS = $(COREMESABASEOBJS) -#endif - -#ifdef NeedAllMesaSrc - DISPATCHDOBJS = $(MESABUILDDIR)debugger/dispatch.o - GLAPIDOBJS = $(MESABUILDDIR)debugger/glapi.o - GLTHREADDOBJS = $(MESABUILDDIR)debugger/glthread.o -#endif - -COREMESABASEDOBJS = \ - $(DISPATCHDOBJS) \ - $(GLAPIDOBJS) \ - $(GLTHREADDOBJS) \ - $(MESABUILDDIR)debugger/api_arrayelt.o \ - $(MESABUILDDIR)debugger/api_loopback.o \ - $(MESABUILDDIR)debugger/api_noop.o \ - $(MESABUILDDIR)debugger/api_validate.o \ - $(MESABUILDDIR)debugger/accum.o \ - $(MESABUILDDIR)debugger/attrib.o \ - $(MESABUILDDIR)debugger/blend.o \ - $(MESABUILDDIR)debugger/bufferobj.o \ - $(MESABUILDDIR)debugger/buffers.o \ - $(MESABUILDDIR)debugger/clip.o \ - $(MESABUILDDIR)debugger/colortab.o \ - $(MESABUILDDIR)debugger/context.o \ - $(MESABUILDDIR)debugger/convolve.o \ - $(MESABUILDDIR)debugger/debug.o \ - $(MESABUILDDIR)debugger/depth.o \ - $(MESABUILDDIR)debugger/dlist.o \ - $(MESABUILDDIR)debugger/drawpix.o \ - $(MESABUILDDIR)debugger/enable.o \ - $(MESABUILDDIR)debugger/enums.o \ - $(MESABUILDDIR)debugger/eval.o \ - $(MESABUILDDIR)debugger/execmem.o \ - $(MESABUILDDIR)debugger/extensions.o \ - $(MESABUILDDIR)debugger/fbobject.o \ - $(MESABUILDDIR)debugger/feedback.o \ - $(MESABUILDDIR)debugger/fog.o \ - $(MESABUILDDIR)debugger/framebuffer.o \ - $(MESABUILDDIR)debugger/get.o \ - $(MESABUILDDIR)debugger/getstring.o \ - $(MESABUILDDIR)debugger/hash.o \ - $(MESABUILDDIR)debugger/hint.o \ - $(MESABUILDDIR)debugger/histogram.o \ - $(MESABUILDDIR)debugger/image.o \ - $(MESABUILDDIR)debugger/imports.o \ - $(MESABUILDDIR)debugger/light.o \ - $(MESABUILDDIR)debugger/lines.o \ - $(MESABUILDDIR)debugger/matrix.o \ - $(MESABUILDDIR)debugger/mm.o \ - $(MESABUILDDIR)debugger/occlude.o \ - $(MESABUILDDIR)debugger/pixel.o \ - $(MESABUILDDIR)debugger/points.o \ - $(MESABUILDDIR)debugger/polygon.o \ - $(MESABUILDDIR)debugger/rastpos.o \ - $(MESABUILDDIR)debugger/renderbuffer.o \ - $(MESABUILDDIR)debugger/state.o \ - $(MESABUILDDIR)debugger/stencil.o \ - $(MESABUILDDIR)debugger/texcompress.o \ - $(MESABUILDDIR)debugger/texcompress_fxt1.o \ - $(MESABUILDDIR)debugger/texcompress_s3tc.o \ - $(MESABUILDDIR)debugger/texenvprogram.o \ - $(MESABUILDDIR)debugger/texformat.o \ - $(MESABUILDDIR)debugger/teximage.o \ - $(MESABUILDDIR)debugger/texobj.o \ - $(MESABUILDDIR)debugger/texrender.o \ - $(MESABUILDDIR)debugger/texstate.o \ - $(MESABUILDDIR)debugger/texstore.o \ - $(MESABUILDDIR)debugger/varray.o \ - $(MESABUILDDIR)debugger/vtxfmt.o - -#ifdef NeedAllMesaSrc - DISPATCHPOBJS = $(MESABUILDDIR)profiled/dispatch.o - GLAPIPOBJS = $(MESABUILDDIR)profiled/glapi.o - GLTHREADPOBJS = $(MESABUILDDIR)profiled/glthread.o -#endif - -COREMESABASEPOBJS = \ - $(DISPATCHPOBJS) \ - $(GLAPIPOBJS) \ - $(GLTHREADPOBJS) \ - $(MESABUILDDIR)profiled/api_arrayelt.o \ - $(MESABUILDDIR)profiled/api_loopback.o \ - $(MESABUILDDIR)profiled/api_noop.o \ - $(MESABUILDDIR)profiled/api_validate.o \ - $(MESABUILDDIR)profiled/accum.o \ - $(MESABUILDDIR)profiled/attrib.o \ - $(MESABUILDDIR)profiled/blend.o \ - $(MESABUILDDIR)profiled/bufferobj.o \ - $(MESABUILDDIR)profiled/buffers.o \ - $(MESABUILDDIR)profiled/clip.o \ - $(MESABUILDDIR)profiled/colortab.o \ - $(MESABUILDDIR)profiled/context.o \ - $(MESABUILDDIR)profiled/convolve.o \ - $(MESABUILDDIR)profiled/debug.o \ - $(MESABUILDDIR)profiled/depth.o \ - $(MESABUILDDIR)profiled/dlist.o \ - $(MESABUILDDIR)profiled/drawpix.o \ - $(MESABUILDDIR)profiled/enable.o \ - $(MESABUILDDIR)profiled/enums.o \ - $(MESABUILDDIR)profiled/eval.o \ - $(MESABUILDDIR)profiled/execmem.o \ - $(MESABUILDDIR)profiled/extensions.o \ - $(MESABUILDDIR)profiled/fbobject.o \ - $(MESABUILDDIR)profiled/feedback.o \ - $(MESABUILDDIR)profiled/fog.o \ - $(MESABUILDDIR)profiled/framebuffer.o \ - $(MESABUILDDIR)profiled/get.o \ - $(MESABUILDDIR)profiled/getstring.o \ - $(MESABUILDDIR)profiled/hash.o \ - $(MESABUILDDIR)profiled/hint.o \ - $(MESABUILDDIR)profiled/histogram.o \ - $(MESABUILDDIR)profiled/image.o \ - $(MESABUILDDIR)profiled/imports.o \ - $(MESABUILDDIR)profiled/light.o \ - $(MESABUILDDIR)profiled/lines.o \ - $(MESABUILDDIR)profiled/matrix.o \ - $(MESABUILDDIR)profiled/mm.o \ - $(MESABUILDDIR)profiled/occlude.o \ - $(MESABUILDDIR)profiled/pixel.o \ - $(MESABUILDDIR)profiled/points.o \ - $(MESABUILDDIR)profiled/polygon.o \ - $(MESABUILDDIR)profiled/rastpos.o \ - $(MESABUILDDIR)profiled/renderbuffer.o \ - $(MESABUILDDIR)profiled/state.o \ - $(MESABUILDDIR)profiled/stencil.o \ - $(MESABUILDDIR)profiled/texcompress.o \ - $(MESABUILDDIR)profiled/texcompress_fxt1.o \ - $(MESABUILDDIR)profiled/texcompress_s3tc.o \ - $(MESABUILDDIR)profiled/texenvprogram.o \ - $(MESABUILDDIR)profiled/texformat.o \ - $(MESABUILDDIR)profiled/teximage.o \ - $(MESABUILDDIR)profiled/texobj.o \ - $(MESABUILDDIR)profiled/texrender.o \ - $(MESABUILDDIR)profiled/texstate.o \ - $(MESABUILDDIR)profiled/texstore.o \ - $(MESABUILDDIR)profiled/varray.o \ - $(MESABUILDDIR)profiled/vtxfmt.o diff --git a/nx-X11/lib/GL/mesa/math/Imakefile b/nx-X11/lib/GL/mesa/math/Imakefile deleted file mode 100644 index ab00ae76f..000000000 --- a/nx-X11/lib/GL/mesa/math/Imakefile +++ /dev/null @@ -1,98 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/math/Imakefile,v 1.8 2002/11/25 12:58:55 tsi Exp $ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - - -#define MesaMathBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I.. \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -#if defined(i386Architecture) && MesaUseX86Asm - ASM_DIR = x86 - ASM_SRCS = - ASM_OBJS = -#if MesaUseMMX - MMX_DEFS = -DUSE_MMX_ASM -#endif -#if MesaUse3DNow - 3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif -#if MesaUseSSE - SSE_DEFS = -DUSE_SSE_ASM -#endif - ASM_DEFS = -DUSE_X86_ASM $(MMX_DEFS) $(3DNOW_DEFS) $(SSE_DEFS) -#endif - -#ifdef SparcArchitecture - ASM_DIR = sparc - ASM_SRCS = - ASM_OBJS = - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/$(ASM_DIR) \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - SRCS = $(MESA_MATH_SRCS) - OBJS = $(MESA_MATH_OBJS) - - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/math/Imakefile.inc b/nx-X11/lib/GL/mesa/math/Imakefile.inc deleted file mode 100644 index cd1dcc427..000000000 --- a/nx-X11/lib/GL/mesa/math/Imakefile.inc +++ /dev/null @@ -1,82 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/math/Imakefile.inc,v 1.1tsi Exp $ - -#ifndef MesaMathBuildDir -#define MesaMathBuildDir $(GLXLIBSRC)/mesa/math/ -#endif - -MESAMATHBUILDDIR = MesaMathBuildDir - - MESA_MATH_SRCS = $(MESAMATHBUILDDIR)m_debug_clip.c \ - $(MESAMATHBUILDDIR)m_debug_norm.c \ - $(MESAMATHBUILDDIR)m_debug_xform.c \ - $(MESAMATHBUILDDIR)m_eval.c \ - $(MESAMATHBUILDDIR)m_matrix.c \ - $(MESAMATHBUILDDIR)m_translate.c \ - $(MESAMATHBUILDDIR)m_vector.c \ - $(MESAMATHBUILDDIR)m_xform.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(mathmod.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_clip_tmp.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_copy_tmp.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_debug_clip.c, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_debug.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_debug_util.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_debug_norm.c, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_debug_xform.c, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_dotprod_tmp.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_eval.c, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_eval.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_matrix.c, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_matrix.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_norm_tmp.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_translate.c, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_translate.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_trans_tmp.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_vector.c, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_vector.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_xform.c, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_xform.h, $(MESASRCDIR)/src/mesa/math) -LinkSourceFile(m_xform_tmp.h, $(MESASRCDIR)/src/mesa/math) -#endif - - MESA_MATH_OBJS = $(MESAMATHBUILDDIR)m_debug_clip.o \ - $(MESAMATHBUILDDIR)m_debug_norm.o \ - $(MESAMATHBUILDDIR)m_debug_xform.o \ - $(MESAMATHBUILDDIR)m_eval.o \ - $(MESAMATHBUILDDIR)m_matrix.o \ - $(MESAMATHBUILDDIR)m_translate.o \ - $(MESAMATHBUILDDIR)m_vector.o \ - $(MESAMATHBUILDDIR)m_xform.o - -#if defined(DoSharedLib) && DoSharedLib - MESA_MATH_UOBJS = $(MESAMATHBUILDDIR)unshared/m_debug_clip.o \ - $(MESAMATHBUILDDIR)unshared/m_debug_norm.o \ - $(MESAMATHBUILDDIR)unshared/m_debug_xform.o \ - $(MESAMATHBUILDDIR)unshared/m_eval.o \ - $(MESAMATHBUILDDIR)unshared/m_matrix.o \ - $(MESAMATHBUILDDIR)unshared/m_translate.o \ - $(MESAMATHBUILDDIR)unshared/m_vector.o \ - $(MESAMATHBUILDDIR)unshared/m_xform.o -#else - MATH_MESA_UOBJS = $(MESA_MATH_OBJS) -#endif - - MESA_MATH_DOBJS = $(MESAMATHBUILDDIR)debugger/m_debug_clip.o \ - $(MESAMATHBUILDDIR)debugger/m_debug_norm.o \ - $(MESAMATHBUILDDIR)debugger/m_debug_xform.o \ - $(MESAMATHBUILDDIR)debugger/m_eval.o \ - $(MESAMATHBUILDDIR)debugger/m_matrix.o \ - $(MESAMATHBUILDDIR)debugger/m_translate.o \ - $(MESAMATHBUILDDIR)debugger/m_vector.o \ - $(MESAMATHBUILDDIR)debugger/m_xform.o - - MESA_MATH_POBJS = $(MESAMATHBUILDDIR)profiled/m_debug_clip.o \ - $(MESAMATHBUILDDIR)profiled/m_debug_norm.o \ - $(MESAMATHBUILDDIR)profiled/m_debug_xform.o \ - $(MESAMATHBUILDDIR)profiled/m_eval.o \ - $(MESAMATHBUILDDIR)profiled/m_matrix.o \ - $(MESAMATHBUILDDIR)profiled/m_translate.o \ - $(MESAMATHBUILDDIR)profiled/m_vector.o \ - $(MESAMATHBUILDDIR)profiled/m_xform.o - diff --git a/nx-X11/lib/GL/mesa/shader/Imakefile b/nx-X11/lib/GL/mesa/shader/Imakefile deleted file mode 100644 index d46834740..000000000 --- a/nx-X11/lib/GL/mesa/shader/Imakefile +++ /dev/null @@ -1,107 +0,0 @@ -XCOMM $XFree86$ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#define MesaShaderBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I.. \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -#if defined(i386Architecture) && MesaUseX86Asm - ASM_DIR = x86 - ASM_SRCS = - ASM_OBJS = -#if MesaUseMMX - MMX_DEFS = -DUSE_MMX_ASM -#endif -#if MesaUse3DNow - 3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif -#if MesaUseSSE - SSE_DEFS = -DUSE_SSE_ASM -#endif - ASM_DEFS = -DUSE_X86_ASM $(MMX_DEFS) $(3DNOW_DEFS) $(SSE_DEFS) -#endif - -#ifdef SparcArchitecture - ASM_DIR = sparc - ASM_SRCS = - ASM_OBJS = - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/shader/grammar \ - -I$(MESASRCDIR)/src/mesa/shader/slang \ - -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/$(ASM_DIR) \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - SRCS = $(MESA_SHADER_SRCS) - OBJS = $(MESA_SHADER_OBJS) - - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -#define IHaveSubdirs -#define PassCDebugFlags - -SUBDIRS = grammar slang - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/shader/Imakefile.inc b/nx-X11/lib/GL/mesa/shader/Imakefile.inc deleted file mode 100644 index 7d0032e56..000000000 --- a/nx-X11/lib/GL/mesa/shader/Imakefile.inc +++ /dev/null @@ -1,106 +0,0 @@ -XCOMM $XFree86:$ - -#ifndef MesaShaderBuildDir -#define MesaShaderBuildDir $(GLXLIBSRC)/mesa/shader/ -#endif - -MESASHADERBUILDDIR = MesaShaderBuildDir - - MESA_SHADER_SRCS = $(MESASHADERBUILDDIR)arbprogparse.c \ - $(MESASHADERBUILDDIR)arbprogram.c \ - $(MESASHADERBUILDDIR)arbfragparse.c \ - $(MESASHADERBUILDDIR)arbvertparse.c \ - $(MESASHADERBUILDDIR)atifragshader.c \ - $(MESASHADERBUILDDIR)nvprogram.c \ - $(MESASHADERBUILDDIR)nvfragparse.c \ - $(MESASHADERBUILDDIR)nvvertexec.c \ - $(MESASHADERBUILDDIR)nvvertparse.c \ - $(MESASHADERBUILDDIR)program.c \ - $(MESASHADERBUILDDIR)shaderobjects.c \ - $(MESASHADERBUILDDIR)shaderobjects_3dlabs.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(arbprogparse.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(arbprogram.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(arbfragparse.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(arbvertparse.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(arbfragparse.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(arbprogparse.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(arbprogram.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(arbprogram_syn.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(arbvertparse.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(atifragshader.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(atifragshader.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvfragparse.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvfragprog.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvprogram.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvprogram.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvfragparse.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvvertexec.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvvertexec.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvvertparse.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvvertparse.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(nvvertprog.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(program.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(program.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(shaderobjects.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(shaderobjects.h, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(shaderobjects_3dlabs.c, $(MESASRCDIR)/src/mesa/shader) -LinkSourceFile(shaderobjects_3dlabs.h, $(MESASRCDIR)/src/mesa/shader) -#endif - - MESA_SHADER_OBJS = $(MESASHADERBUILDDIR)arbprogparse.o \ - $(MESASHADERBUILDDIR)arbprogram.o \ - $(MESASHADERBUILDDIR)arbfragparse.o \ - $(MESASHADERBUILDDIR)arbvertparse.o \ - $(MESASHADERBUILDDIR)atifragshader.o \ - $(MESASHADERBUILDDIR)nvprogram.o \ - $(MESASHADERBUILDDIR)nvfragparse.o \ - $(MESASHADERBUILDDIR)nvvertexec.o \ - $(MESASHADERBUILDDIR)nvvertparse.o \ - $(MESASHADERBUILDDIR)program.o \ - $(MESASHADERBUILDDIR)shaderobjects.o \ - $(MESASHADERBUILDDIR)shaderobjects_3dlabs.o - -#if defined(DoSharedLib) && DoSharedLib - MESA_SHADER_UOBJS = $(MESASHADERBUILDDIR)unshared/arbprogparse.o \ - $(MESASHADERBUILDDIR)unshared/arbprogram.o \ - $(MESASHADERBUILDDIR)unshared/arbfragparse.o \ - $(MESASHADERBUILDDIR)unshared/arbvertparse.o \ - $(MESASHADERBUILDDIR)unshared/atifragshader.o \ - $(MESASHADERBUILDDIR)unshared/nvprogram.o \ - $(MESASHADERBUILDDIR)unshared/nvfragparse.o \ - $(MESASHADERBUILDDIR)unshared/nvvertexec.o \ - $(MESASHADERBUILDDIR)unshared/nvvertparse.o \ - $(MESASHADERBUILDDIR)unshared/program.o \ - $(MESASHADERBUILDDIR)unshared/shaderobjects.o \ - $(MESASHADERBUILDDIR)unshared/shaderobjects_3dlabs.o -#else - MESA_SHADER_UOBJS = $(MESA_SHADER_OBJS) -#endif - - MESA_SHADER_DOBJS = $(MESASHADERBUILDDIR)debugger/arbprogparse.o \ - $(MESASHADERBUILDDIR)debugger/arbprogram.o \ - $(MESASHADERBUILDDIR)debugger/arbfragparse.o \ - $(MESASHADERBUILDDIR)debugger/arbvertparse.o \ - $(MESASHADERBUILDDIR)debugger/atifragshader.o \ - $(MESASHADERBUILDDIR)debugger/nvprogram.o \ - $(MESASHADERBUILDDIR)debugger/nvfragparse.o \ - $(MESASHADERBUILDDIR)debugger/nvvertexec.o \ - $(MESASHADERBUILDDIR)debugger/nvvertparse.o \ - $(MESASHADERBUILDDIR)debugger/program.o \ - $(MESASHADERBUILDDIR)debugger/shaderobjects.o \ - $(MESASHADERBUILDDIR)debugger/shaderobjects_3dlabs.o - - MESA_SHADER_POBJS = $(MESASHADERBUILDDIR)profiled/arbprogparse.o \ - $(MESASHADERBUILDDIR)profiled/arbprogram.o \ - $(MESASHADERBUILDDIR)profiled/arbfragparse.o \ - $(MESASHADERBUILDDIR)profiled/arbvertparse.o \ - $(MESASHADERBUILDDIR)profiled/atifragshader.o \ - $(MESASHADERBUILDDIR)profiled/nvprogram.o \ - $(MESASHADERBUILDDIR)profiled/nvfragparse.o \ - $(MESASHADERBUILDDIR)profiled/nvvertexec.o \ - $(MESASHADERBUILDDIR)profiled/nvvertparse.o \ - $(MESASHADERBUILDDIR)profiled/program.o \ - $(MESASHADERBUILDDIR)profiled/shaderobjects.o \ - $(MESASHADERBUILDDIR)profiled/shaderobjects_3dlabs.o diff --git a/nx-X11/lib/GL/mesa/shader/grammar/Imakefile b/nx-X11/lib/GL/mesa/shader/grammar/Imakefile deleted file mode 100644 index bbdec9764..000000000 --- a/nx-X11/lib/GL/mesa/shader/grammar/Imakefile +++ /dev/null @@ -1,98 +0,0 @@ -XCOMM $XFree86$ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#define MesaGrammarBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I.. \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -#if defined(i386Architecture) && MesaUseX86Asm - ASM_DIR = x86 - ASM_SRCS = - ASM_OBJS = -#if MesaUseMMX - MMX_DEFS = -DUSE_MMX_ASM -#endif -#if MesaUse3DNow - 3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif -#if MesaUseSSE - SSE_DEFS = -DUSE_SSE_ASM -#endif - ASM_DEFS = -DUSE_X86_ASM $(MMX_DEFS) $(3DNOW_DEFS) $(SSE_DEFS) -#endif - -#ifdef SparcArchitecture - ASM_DIR = sparc - ASM_SRCS = - ASM_OBJS = - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/shader/grammar \ - -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/$(ASM_DIR) \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - SRCS = $(MESA_GRAMMAR_SRCS) - OBJS = $(MESA_GRAMMAR_OBJS) - - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/shader/grammar/Imakefile.inc b/nx-X11/lib/GL/mesa/shader/grammar/Imakefile.inc deleted file mode 100644 index b2e885f89..000000000 --- a/nx-X11/lib/GL/mesa/shader/grammar/Imakefile.inc +++ /dev/null @@ -1,29 +0,0 @@ -XCOMM $XFree86$ - -#ifndef MesaGrammarBuildDir -#define MesaGrammarBuildDir $(GLXLIBSRC)/mesa/shader/grammar/ -#endif - -MESAGRAMMARBUILDDIR=MesaGrammarBuildDir - - MESA_GRAMMAR_SRCS = $(MESAGRAMMARBUILDDIR)grammar_mesa.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(grammar.c, $(MESASRCDIR)/src/mesa/shader/grammar) -LinkSourceFile(grammar.h, $(MESASRCDIR)/src/mesa/shader/grammar) -LinkSourceFile(grammar_syn.h, $(MESASRCDIR)/src/mesa/shader/grammar) -LinkSourceFile(grammar_mesa.c, $(MESASRCDIR)/src/mesa/shader/grammar) -LinkSourceFile(grammar_mesa.h, $(MESASRCDIR)/src/mesa/shader/grammar) -#endif - - MESA_GRAMMAR_OBJS = $(MESAGRAMMARBUILDDIR)grammar_mesa.o - -#if defined(DoSharedLib) && DoSharedLib - MESA_GRAMMAR_UOBJS = $(MESAGRAMMARBUILDDIR)unshared/grammar_mesa.o -#else - MESA_GRAMMAR_UOBJS = $(MESA_GRAMMAR_OBJS) -#endif - - MESA_GRAMMAR_DOBJS = $(MESAGRAMMARBUILDDIR)debugger/grammar_mesa.o - - MESA_GRAMMAR_POBJS = $(MESAGRAMMARBUILDDIR)profiled/grammar_mesa.o diff --git a/nx-X11/lib/GL/mesa/shader/slang/Imakefile b/nx-X11/lib/GL/mesa/shader/slang/Imakefile deleted file mode 100644 index 096a8ea63..000000000 --- a/nx-X11/lib/GL/mesa/shader/slang/Imakefile +++ /dev/null @@ -1,108 +0,0 @@ -XCOMM $XFree86$ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#define MesaSlangBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I.. \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -#if defined(i386Architecture) && MesaUseX86Asm - ASM_DIR = x86 - ASM_SRCS = - ASM_OBJS = -#if MesaUseMMX - MMX_DEFS = -DUSE_MMX_ASM -#endif -#if MesaUse3DNow - 3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif -#if MesaUseSSE - SSE_DEFS = -DUSE_SSE_ASM -#endif - ASM_DEFS = -DUSE_X86_ASM $(MMX_DEFS) $(3DNOW_DEFS) $(SSE_DEFS) -#endif - -#ifdef SparcArchitecture - ASM_DIR = sparc - ASM_SRCS = - ASM_OBJS = - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/shader/grammar \ - -I$(MESASRCDIR)/src/mesa/shader/slang \ - -I$(MESASRCDIR)/src/mesa/shader/slang/library \ - -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/$(ASM_DIR) \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - SRCS = $(MESA_SLANG_SRCS) - OBJS = $(MESA_SLANG_OBJS) - - -#include - -#define IHaveSubdirs -#define PassCDebugFlags - -SUBDIRS = library - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/shader/slang/Imakefile.inc b/nx-X11/lib/GL/mesa/shader/slang/Imakefile.inc deleted file mode 100644 index d824ca797..000000000 --- a/nx-X11/lib/GL/mesa/shader/slang/Imakefile.inc +++ /dev/null @@ -1,90 +0,0 @@ -XCOMM $XFree86$ - -#ifndef MesaSlangBuildDir -#define MesaSlangBuildDir $(GLXLIBSRC)/mesa/shader/slang/ -#endif - -MESASLANGBUILDDIR=MesaSlangBuildDir - - MESA_SLANG_SRCS = $(MESASLANGBUILDDIR)slang_assemble_assignment.c \ - $(MESASLANGBUILDDIR)slang_assemble.c \ - $(MESASLANGBUILDDIR)slang_assemble_conditional.c \ - $(MESASLANGBUILDDIR)slang_assemble_constructor.c \ - $(MESASLANGBUILDDIR)slang_assemble_typeinfo.c \ - $(MESASLANGBUILDDIR)slang_compile.c \ - $(MESASLANGBUILDDIR)slang_execute.c \ - $(MESASLANGBUILDDIR)slang_preprocess.c \ - $(MESASLANGBUILDDIR)slang_storage.c \ - $(MESASLANGBUILDDIR)slang_utility.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(slang_assemble_assignment.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_assemble_assignment.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_assemble.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_assemble.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_assemble_conditional.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_assemble_conditional.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_assemble_constructor.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_assemble_constructor.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_assemble_typeinfo.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_assemble_typeinfo.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_compile.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_compile.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_execute.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_execute.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_preprocess.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_preprocess.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_storage.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_storage.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_utility.c, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(slang_utility.h, $(MESASRCDIR)/src/mesa/shader/slang) -LinkSourceFile(traverse_wrap.h, $(MESASRCDIR)/src/mesa/shader/slang) -#endif - - MESA_SLANG_OBJS = $(MESASLANGBUILDDIR)slang_assemble_assignment.o \ - $(MESASLANGBUILDDIR)slang_assemble.o \ - $(MESASLANGBUILDDIR)slang_assemble_conditional.o \ - $(MESASLANGBUILDDIR)slang_assemble_constructor.o \ - $(MESASLANGBUILDDIR)slang_assemble_typeinfo.o \ - $(MESASLANGBUILDDIR)slang_compile.o \ - $(MESASLANGBUILDDIR)slang_execute.o \ - $(MESASLANGBUILDDIR)slang_preprocess.o \ - $(MESASLANGBUILDDIR)slang_storage.o \ - $(MESASLANGBUILDDIR)slang_utility.o - -#if defined(DoSharedLib) && DoSharedLib - MESA_SLANG_UOBJS = $(MESASLANGBUILDDIR)unshared/slang_assemble_assignment.o \ - $(MESASLANGBUILDDIR)unshared/slang_assemble.o \ - $(MESASLANGBUILDDIR)unshared/slang_assemble_conditional.o \ - $(MESASLANGBUILDDIR)unshared/slang_assemble_constructor.o \ - $(MESASLANGBUILDDIR)unshared/slang_assemble_typeinfo.o \ - $(MESASLANGBUILDDIR)unshared/slang_compile.o \ - $(MESASLANGBUILDDIR)unshared/slang_execute.o \ - $(MESASLANGBUILDDIR)unshared/slang_preprocess.o \ - $(MESASLANGBUILDDIR)unshared/slang_storage.o \ - $(MESASLANGBUILDDIR)unshared/slang_utility.o -#else - MESA_SLANG_UOBJS = $(MESA_SLANG_OBJS) -#endif - - MESA_SLANG_DOBJS = $(MESASLANGBUILDDIR)debuggerslang_assemble_assignment.o \ - $(MESASLANGBUILDDIR)debuggerslang_assemble.o \ - $(MESASLANGBUILDDIR)debuggerslang_assemble_conditional.o \ - $(MESASLANGBUILDDIR)debuggerslang_assemble_constructor.o \ - $(MESASLANGBUILDDIR)debuggerslang_assemble_typeinfo.o \ - $(MESASLANGBUILDDIR)debuggerslang_compile.o \ - $(MESASLANGBUILDDIR)debuggerslang_execute.o \ - $(MESASLANGBUILDDIR)debuggerslang_preprocess.o \ - $(MESASLANGBUILDDIR)debuggerslang_storage.o \ - $(MESASLANGBUILDDIR)debuggerslang_utility.o - - MESA_SLANG_POBJS = $(MESASLANGBUILDDIR)profiled/slang_assemble_assignment.o \ - $(MESASLANGBUILDDIR)profiled/slang_assemble.o \ - $(MESASLANGBUILDDIR)profiled/slang_assemble_conditional.o \ - $(MESASLANGBUILDDIR)profiled/slang_assemble_constructor.o \ - $(MESASLANGBUILDDIR)profiled/slang_assemble_typeinfo.o \ - $(MESASLANGBUILDDIR)profiled/slang_compile.o \ - $(MESASLANGBUILDDIR)profiled/slang_execute.o \ - $(MESASLANGBUILDDIR)profiled/slang_preprocess.o \ - $(MESASLANGBUILDDIR)profiled/slang_storage.o \ - $(MESASLANGBUILDDIR)profiled/slang_utility.o diff --git a/nx-X11/lib/GL/mesa/shader/slang/library/Imakefile b/nx-X11/lib/GL/mesa/shader/slang/library/Imakefile deleted file mode 100644 index de32171ae..000000000 --- a/nx-X11/lib/GL/mesa/shader/slang/library/Imakefile +++ /dev/null @@ -1,97 +0,0 @@ -XCOMM $XFree86$ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#define MesaShaderBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I.. \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -#if defined(i386Architecture) && MesaUseX86Asm - ASM_DIR = x86 - ASM_SRCS = - ASM_OBJS = -#if MesaUseMMX - MMX_DEFS = -DUSE_MMX_ASM -#endif -#if MesaUse3DNow - 3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif -#if MesaUseSSE - SSE_DEFS = -DUSE_SSE_ASM -#endif - ASM_DEFS = -DUSE_X86_ASM $(MMX_DEFS) $(3DNOW_DEFS) $(SSE_DEFS) -#endif - -#ifdef SparcArchitecture - ASM_DIR = sparc - ASM_SRCS = - ASM_OBJS = - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/shader/slang \ - -I$(MESASRCDIR)/src/mesa/shader/slang/library \ - -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/$(ASM_DIR) \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - SRCS = $(MESA_SLANG_SRCS) - OBJS = $(MESA_SLANG_OBJS) - - -#include - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/shader/slang/library/Imakefile.inc b/nx-X11/lib/GL/mesa/shader/slang/library/Imakefile.inc deleted file mode 100644 index 3489b7a28..000000000 --- a/nx-X11/lib/GL/mesa/shader/slang/library/Imakefile.inc +++ /dev/null @@ -1,14 +0,0 @@ -XCOMM $XFree86:$ - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(slang_common_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -LinkSourceFile(slang_common_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -LinkSourceFile(slang_core_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -LinkSourceFile(slang_core_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -LinkSourceFile(slang_fragment_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -LinkSourceFile(slang_fragment_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -LinkSourceFile(slang_shader_syn.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -LinkSourceFile(slang_version_syn.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -LinkSourceFile(slang_vertex_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -LinkSourceFile(slang_vertex_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library) -#endif diff --git a/nx-X11/lib/GL/mesa/sparc/Imakefile b/nx-X11/lib/GL/mesa/sparc/Imakefile deleted file mode 100644 index 8cd9c9f8b..000000000 --- a/nx-X11/lib/GL/mesa/sparc/Imakefile +++ /dev/null @@ -1,68 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/SPARC/Imakefile,v 1.3 2002/11/22 22:55:58 tsi Exp $ -XCOMM $XdotOrg: xc/lib/GL/mesa/sparc/Imakefile,v 1.3 2004/11/13 04:39:16 gisburn Exp $ - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#define MesaSPARCBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - - DEFINES = $(ALLOC_DEFINES) GlxDefines $(MESA_ASM_DEFINES) - INCLUDES = -I$(INCLUDESRC) -I$(EXTINCSRC) -I$(MESASRCDIR)/src \ - -I$(MESASRCDIR)/src/SPARC \ - -I../../../include \ - -I$(MESASRCDIR)/include \ - -I$(GLXLIBSRC)/include \ - -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/sparc \ - -I$(MESASRCDIR)/src/mesa/glapi - - SRCS = $(MESA_ASM_SRCS) - OBJS = $(MESA_ASM_OBJS) - -#include - -LibraryObjectRule() - -STD_CPP_DEFINES = StandardDefines $(PROJECT_DEFINES) - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -ObjectFromAsmSource(xform, NullParameter) -ObjectFromAsmSource(clip, NullParameter) -ObjectFromAsmSource(norm, NullParameter) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/sparc/Imakefile.inc b/nx-X11/lib/GL/mesa/sparc/Imakefile.inc deleted file mode 100644 index 6bd006749..000000000 --- a/nx-X11/lib/GL/mesa/sparc/Imakefile.inc +++ /dev/null @@ -1,58 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/SPARC/Imakefile.inc,v 1.2 2002/11/14 21:01:16 tsi Exp $ - -#ifndef MesaSPARCBuildDir -#define MesaSPARCBuildDir $(GLXLIBSRC)/mesa/sparc/ -#endif - -MESASPARCBUILDDIR = MesaSPARCBuildDir - -MESA_SPARC_SRCS = $(MESASPARCBUILDDIR)sparc.c \ - $(MESASPARCBUILDDIR)xform.S \ - $(MESASPARCBUILDDIR)clip.S - -#ifdef NeedToLinkMesaSrc -/* If $(MESASRCDIR)/src/mesa/sparc isn't in the INCLUDES, it should be. */ -LinkSourceFile(sparc.c, $(MESASRCDIR)/src/mesa/sparc) -LinkSourceFile(xform.S, $(MESASRCDIR)/src/mesa/sparc) -LinkSourceFile(clip.S, $(MESASRCDIR)/src/mesa/sparc) -LinkSourceFile(norm.S, $(MESASRCDIR)/src/mesa/sparc) -#endif - -MESA_SPARC_OBJS = $(MESASPARCBUILDDIR)sparc.o \ - $(MESASPARCBUILDDIR)xform.o \ - $(MESASPARCBUILDDIR)clip.o \ - $(MESASPARCBUILDDIR)norm.o - -#if defined(DoSharedLib) && DoSharedLib -MESA_SPARC_UOBJS = $(MESASPARCBUILDDIR)unshared/sparc.o \ - $(MESASPARCBUILDDIR)xform.o \ - $(MESASPARCBUILDDIR)clip.o \ - $(MESASPARCBUILDDIR)norm.o -#else -MESA_SPARC_UOBJS = $(MESA_SPARC_OBJS) -#endif - -MESA_SPARC_DOBJS = $(MESASPARCBUILDDIR)debugger/sparc.o \ - $(MESASPARCBUILDDIR)xform.o \ - $(MESASPARCBUILDDIR)clip.o \ - $(MESASPARCBUILDDIR)norm.o - -MESA_SPARC_POBJS = $(MESAX86BUILDDIR)profiled/sparc.o \ - $(MESAX86BUILDDIR)xform.o \ - $(MESAX86BUILDDIR)clip.o \ - $(MESAX86BUILDDIR)norm.o - -MESA_SPARC_DEFS = -DUSE_SPARC_ASM - -MESA_ASM_SRCS = $(MESA_SPARC_SRCS) - -MESA_ASM_OBJS = $(MESA_SPARC_OBJS) - -MESA_ASM_UOBJS = $(MESA_SPARC_UOBJS) - -MESA_ASM_DOBJS = $(MESA_SPARC_DOBJS) - -MESA_ASM_POBJS = $(MESA_SPARC_POBJS) - -MESA_ASM_DEFINES = $(MESA_SPARC_DEFS) - diff --git a/nx-X11/lib/GL/mesa/swrast/Imakefile b/nx-X11/lib/GL/mesa/swrast/Imakefile deleted file mode 100644 index 105615b82..000000000 --- a/nx-X11/lib/GL/mesa/swrast/Imakefile +++ /dev/null @@ -1,100 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/swrast/Imakefile,v 1.8 2002/11/25 12:58:55 tsi Exp $ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#define MesaSwrastBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I../../../include \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -#if defined(i386Architecture) && MesaUseX86Asm - ASM_DIR = x86 - ASM_SRCS = - ASM_OBJS = -#if MesaUseMMX - MMX_DEFS = -DUSE_MMX_ASM -#endif -#if MesaUse3DNow - 3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif -#if MesaUseSSE - SSE_DEFS = -DUSE_SSE_ASM -#endif - ASM_DEFS = -DUSE_X86_ASM $(MMX_DEFS) $(3DNOW_DEFS) $(SSE_DEFS) -#endif - -#ifdef SparcArchitecture - ASM_DIR = sparc - ASM_SRCS = - ASM_OBJS = - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/array_cache \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/swrast \ - -I$(MESASRCDIR)/src/mesa/shader \ - -I$(MESASRCDIR)/src/mesa/$(ASM_DIR) \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - SRCS = $(MESA_SWRAST_SRCS) - OBJS = $(MESA_SWRAST_OBJS) - - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/swrast/Imakefile.inc b/nx-X11/lib/GL/mesa/swrast/Imakefile.inc deleted file mode 100644 index 683b8f0a7..000000000 --- a/nx-X11/lib/GL/mesa/swrast/Imakefile.inc +++ /dev/null @@ -1,218 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/swrast/Imakefile.inc,v 1.1tsi Exp $ - -#ifndef MesaSwrastBuildDir -#define MesaSwrastBuildDir $(GLXLIBSRC)/mesa/swrast/ -#endif - -MESASWRASTBUILDDIR = MesaSwrastBuildDir - - MESA_SWRAST_SRCS = $(MESASWRASTBUILDDIR)s_aaline.c \ - $(MESASWRASTBUILDDIR)s_aatriangle.c \ - $(MESASWRASTBUILDDIR)s_accum.c \ - $(MESASWRASTBUILDDIR)s_alpha.c \ - $(MESASWRASTBUILDDIR)s_atifragshader.c \ - $(MESASWRASTBUILDDIR)s_bitmap.c \ - $(MESASWRASTBUILDDIR)s_blend.c \ - $(MESASWRASTBUILDDIR)s_buffers.c \ - $(MESASWRASTBUILDDIR)s_context.c \ - $(MESASWRASTBUILDDIR)s_copypix.c \ - $(MESASWRASTBUILDDIR)s_depth.c \ - $(MESASWRASTBUILDDIR)s_drawpix.c \ - $(MESASWRASTBUILDDIR)s_feedback.c \ - $(MESASWRASTBUILDDIR)s_fog.c \ - $(MESASWRASTBUILDDIR)s_imaging.c \ - $(MESASWRASTBUILDDIR)s_lines.c \ - $(MESASWRASTBUILDDIR)s_logic.c \ - $(MESASWRASTBUILDDIR)s_masking.c \ - $(MESASWRASTBUILDDIR)s_nvfragprog.c \ - $(MESASWRASTBUILDDIR)s_pixeltex.c \ - $(MESASWRASTBUILDDIR)s_points.c \ - $(MESASWRASTBUILDDIR)s_readpix.c \ - $(MESASWRASTBUILDDIR)s_span.c \ - $(MESASWRASTBUILDDIR)s_stencil.c \ - $(MESASWRASTBUILDDIR)s_texstore.c \ - $(MESASWRASTBUILDDIR)s_texture.c \ - $(MESASWRASTBUILDDIR)s_triangle.c \ - $(MESASWRASTBUILDDIR)s_zoom.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(s_aaline.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_aaline.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_aalinetemp.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_aatriangle.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_aatriangle.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_aatritemp.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_accum.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_accum.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_alpha.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_alpha.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_atifragshader.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_atifragshader.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_bitmap.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_blend.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_blend.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_buffers.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_context.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_context.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_copypix.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_depth.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_depth.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_drawpix.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_drawpix.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_feedback.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_feedback.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_fog.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_fog.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_imaging.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_lines.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_lines.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_linetemp.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_logic.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_logic.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_masking.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_masking.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_nvfragprog.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_nvfragprog.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_pixeltex.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_pixeltex.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_points.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_points.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_pointtemp.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_readpix.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_span.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_span.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_spantemp.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_stencil.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_stencil.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_texstore.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_texture.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_texture.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_triangle.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_triangle.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_trispan.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_tritemp.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_zoom.c, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(s_zoom.h, $(MESASRCDIR)/src/mesa/swrast) -LinkSourceFile(swrast.h, $(MESASRCDIR)/src/mesa/swrast) -#endif - - MESA_SWRAST_OBJS = $(MESASWRASTBUILDDIR)s_aaline.o \ - $(MESASWRASTBUILDDIR)s_aatriangle.o \ - $(MESASWRASTBUILDDIR)s_accum.o \ - $(MESASWRASTBUILDDIR)s_alpha.o \ - $(MESASWRASTBUILDDIR)s_atifragshader.o \ - $(MESASWRASTBUILDDIR)s_bitmap.o \ - $(MESASWRASTBUILDDIR)s_blend.o \ - $(MESASWRASTBUILDDIR)s_buffers.o \ - $(MESASWRASTBUILDDIR)s_context.o \ - $(MESASWRASTBUILDDIR)s_copypix.o \ - $(MESASWRASTBUILDDIR)s_depth.o \ - $(MESASWRASTBUILDDIR)s_drawpix.o \ - $(MESASWRASTBUILDDIR)s_feedback.o \ - $(MESASWRASTBUILDDIR)s_fog.o \ - $(MESASWRASTBUILDDIR)s_imaging.o \ - $(MESASWRASTBUILDDIR)s_lines.o \ - $(MESASWRASTBUILDDIR)s_logic.o \ - $(MESASWRASTBUILDDIR)s_masking.o \ - $(MESASWRASTBUILDDIR)s_nvfragprog.o \ - $(MESASWRASTBUILDDIR)s_pixeltex.o \ - $(MESASWRASTBUILDDIR)s_points.o \ - $(MESASWRASTBUILDDIR)s_readpix.o \ - $(MESASWRASTBUILDDIR)s_span.o \ - $(MESASWRASTBUILDDIR)s_stencil.o \ - $(MESASWRASTBUILDDIR)s_texstore.o \ - $(MESASWRASTBUILDDIR)s_texture.o \ - $(MESASWRASTBUILDDIR)s_triangle.o \ - $(MESASWRASTBUILDDIR)s_zoom.o - -#if defined(DoSharedLib) && DoSharedLib - MESA_SWRAST_UOBJS = $(MESASWRASTBUILDDIR)unshared/s_aaline.o \ - $(MESASWRASTBUILDDIR)unshared/s_aatriangle.o \ - $(MESASWRASTBUILDDIR)unshared/s_accum.o \ - $(MESASWRASTBUILDDIR)unshared/s_alpha.o \ - $(MESASWRASTBUILDDIR)unshared/s_atifragshader.o \ - $(MESASWRASTBUILDDIR)unshared/s_bitmap.o \ - $(MESASWRASTBUILDDIR)unshared/s_blend.o \ - $(MESASWRASTBUILDDIR)unshared/s_buffers.o \ - $(MESASWRASTBUILDDIR)unshared/s_context.o \ - $(MESASWRASTBUILDDIR)unshared/s_copypix.o \ - $(MESASWRASTBUILDDIR)unshared/s_depth.o \ - $(MESASWRASTBUILDDIR)unshared/s_drawpix.o \ - $(MESASWRASTBUILDDIR)unshared/s_feedback.o \ - $(MESASWRASTBUILDDIR)unshared/s_fog.o \ - $(MESASWRASTBUILDDIR)unshared/s_imaging.o \ - $(MESASWRASTBUILDDIR)unshared/s_lines.o \ - $(MESASWRASTBUILDDIR)unshared/s_logic.o \ - $(MESASWRASTBUILDDIR)unshared/s_masking.o \ - $(MESASWRASTBUILDDIR)unshared/s_nvfragprog.o \ - $(MESASWRASTBUILDDIR)unshared/s_pixeltex.o \ - $(MESASWRASTBUILDDIR)unshared/s_points.o \ - $(MESASWRASTBUILDDIR)unshared/s_readpix.o \ - $(MESASWRASTBUILDDIR)unshared/s_span.o \ - $(MESASWRASTBUILDDIR)unshared/s_stencil.o \ - $(MESASWRASTBUILDDIR)unshared/s_texstore.o \ - $(MESASWRASTBUILDDIR)unshared/s_texture.o \ - $(MESASWRASTBUILDDIR)unshared/s_triangle.o \ - $(MESASWRASTBUILDDIR)unshared/s_zoom.o -#else - MESA_SWRAST_UOBJS = $(MESA_SWRAST_OBJS) -#endif - - MESA_SWRAST_DOBJS = $(MESASWRASTBUILDDIR)debugger/s_aaline.o \ - $(MESASWRASTBUILDDIR)debugger/s_aatriangle.o \ - $(MESASWRASTBUILDDIR)debugger/s_accum.o \ - $(MESASWRASTBUILDDIR)debugger/s_alpha.o \ - $(MESASWRASTBUILDDIR)debugger/s_atifragshader.o \ - $(MESASWRASTBUILDDIR)debugger/s_bitmap.o \ - $(MESASWRASTBUILDDIR)debugger/s_blend.o \ - $(MESASWRASTBUILDDIR)debugger/s_buffers.o \ - $(MESASWRASTBUILDDIR)debugger/s_context.o \ - $(MESASWRASTBUILDDIR)debugger/s_copypix.o \ - $(MESASWRASTBUILDDIR)debugger/s_depth.o \ - $(MESASWRASTBUILDDIR)debugger/s_drawpix.o \ - $(MESASWRASTBUILDDIR)debugger/s_feedback.o \ - $(MESASWRASTBUILDDIR)debugger/s_fog.o \ - $(MESASWRASTBUILDDIR)debugger/s_imaging.o \ - $(MESASWRASTBUILDDIR)debugger/s_lines.o \ - $(MESASWRASTBUILDDIR)debugger/s_logic.o \ - $(MESASWRASTBUILDDIR)debugger/s_masking.o \ - $(MESASWRASTBUILDDIR)debugger/s_nvfragprog.o \ - $(MESASWRASTBUILDDIR)debugger/s_pixeltex.o \ - $(MESASWRASTBUILDDIR)debugger/s_points.o \ - $(MESASWRASTBUILDDIR)debugger/s_readpix.o \ - $(MESASWRASTBUILDDIR)debugger/s_span.o \ - $(MESASWRASTBUILDDIR)debugger/s_stencil.o \ - $(MESASWRASTBUILDDIR)debugger/s_texstore.o \ - $(MESASWRASTBUILDDIR)debugger/s_texture.o \ - $(MESASWRASTBUILDDIR)debugger/s_triangle.o \ - $(MESASWRASTBUILDDIR)debugger/s_zoom.o - - MESA_SWRAST_POBJS = $(MESASWRASTBUILDDIR)profiled/s_aaline.o \ - $(MESASWRASTBUILDDIR)profiled/s_aatriangle.o \ - $(MESASWRASTBUILDDIR)profiled/s_accum.o \ - $(MESASWRASTBUILDDIR)profiled/s_alpha.o \ - $(MESASWRASTBUILDDIR)profiled/s_atifragshader.o \ - $(MESASWRASTBUILDDIR)profiled/s_bitmap.o \ - $(MESASWRASTBUILDDIR)profiled/s_blend.o \ - $(MESASWRASTBUILDDIR)profiled/s_buffers.o \ - $(MESASWRASTBUILDDIR)profiled/s_context.o \ - $(MESASWRASTBUILDDIR)profiled/s_copypix.o \ - $(MESASWRASTBUILDDIR)profiled/s_depth.o \ - $(MESASWRASTBUILDDIR)profiled/s_drawpix.o \ - $(MESASWRASTBUILDDIR)profiled/s_feedback.o \ - $(MESASWRASTBUILDDIR)profiled/s_fog.o \ - $(MESASWRASTBUILDDIR)profiled/s_imaging.o \ - $(MESASWRASTBUILDDIR)profiled/s_lines.o \ - $(MESASWRASTBUILDDIR)profiled/s_logic.o \ - $(MESASWRASTBUILDDIR)profiled/s_masking.o \ - $(MESASWRASTBUILDDIR)profiled/s_nvfragprog.o \ - $(MESASWRASTBUILDDIR)profiled/s_pixeltex.o \ - $(MESASWRASTBUILDDIR)profiled/s_points.o \ - $(MESASWRASTBUILDDIR)profiled/s_readpix.o \ - $(MESASWRASTBUILDDIR)profiled/s_span.o \ - $(MESASWRASTBUILDDIR)profiled/s_stencil.o \ - $(MESASWRASTBUILDDIR)profiled/s_texstore.o \ - $(MESASWRASTBUILDDIR)profiled/s_texture.o \ - $(MESASWRASTBUILDDIR)profiled/s_triangle.o \ - $(MESASWRASTBUILDDIR)profiled/s_zoom.o - diff --git a/nx-X11/lib/GL/mesa/swrast_setup/Imakefile b/nx-X11/lib/GL/mesa/swrast_setup/Imakefile deleted file mode 100644 index 58766149d..000000000 --- a/nx-X11/lib/GL/mesa/swrast_setup/Imakefile +++ /dev/null @@ -1,99 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/swrast_setup/Imakefile,v 1.8 2002/11/25 12:58:55 tsi Exp $ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - - -#define MesaSwrastSetupBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I../../../include \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -#if defined(i386Architecture) && MesaUseX86Asm - ASM_DIR = x86 - ASM_SRCS = - ASM_OBJS = -#if MesaUseMMX - MMX_DEFS = -DUSE_MMX_ASM -#endif -#if MesaUse3DNow - 3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif -#if MesaUseSSE - SSE_DEFS = -DUSE_SSE_ASM -#endif - ASM_DEFS = -DUSE_X86_ASM $(MMX_DEFS) $(3DNOW_DEFS) $(SSE_DEFS) -#endif - -#ifdef SparcArchitecture - ASM_DIR = sparc - ASM_SRCS = - ASM_OBJS = - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/$(ASM_DIR) \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/swrast_setup \ - -I$(MESASRCDIR)/src/mesa/tnl \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - SRCS = $(MESA_SWR_SETUP_SRCS) - OBJS = $(MESA_SWR_SETUP_OBJS) - - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/swrast_setup/Imakefile.inc b/nx-X11/lib/GL/mesa/swrast_setup/Imakefile.inc deleted file mode 100644 index 8d32aedb3..000000000 --- a/nx-X11/lib/GL/mesa/swrast_setup/Imakefile.inc +++ /dev/null @@ -1,36 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/swrast_setup/Imakefile.inc,v 1.1tsi Exp $ - -#ifndef MesaSwrastSetupBuildDir -#define MesaSwrastSetupBuildDir $(GLXLIBSRC)/mesa/swrast_setup/ -#endif - -MESASWRSETUPDIR = MesaSwrastSetupBuildDir - - MESA_SWR_SETUP_SRCS = $(MESASWRSETUPDIR)ss_context.c \ - $(MESASWRSETUPDIR)ss_triangle.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(ss_context.c, $(MESASRCDIR)/src/mesa/swrast_setup) -LinkSourceFile(ss_context.h, $(MESASRCDIR)/src/mesa/swrast_setup) -LinkSourceFile(ss_triangle.c, $(MESASRCDIR)/src/mesa/swrast_setup) -LinkSourceFile(ss_triangle.h, $(MESASRCDIR)/src/mesa/swrast_setup) -LinkSourceFile(ss_tritmp.h, $(MESASRCDIR)/src/mesa/swrast_setup) -LinkSourceFile(swrast_setup.h, $(MESASRCDIR)/src/mesa/swrast_setup) -#endif - - MESA_SWR_SETUP_OBJS = $(MESASWRSETUPDIR)ss_context.o \ - $(MESASWRSETUPDIR)ss_triangle.o - -#if defined(DoSharedLib) && DoSharedLib -MESA_SWR_SETUP_UOBJS = $(MESASWRSETUPDIR)unshared/ss_context.o \ - $(MESASWRSETUPDIR)unshared/ss_triangle.o -#else -MESA_SWR_SETUP_UOBJS = $(MESA_SWR_SETUP_OBJS) -#endif - -MESA_SWR_SETUP_DOBJS = $(MESASWRSETUPDIR)debugger/ss_context.o \ - $(MESASWRSETUPDIR)debugger/ss_triangle.o - -MESA_SWR_SETUP_POBJS = $(MESASWRSETUPDIR)profiled/ss_context.o \ - $(MESASWRSETUPDIR)profiled/ss_triangle.o - diff --git a/nx-X11/lib/GL/mesa/tnl/Imakefile b/nx-X11/lib/GL/mesa/tnl/Imakefile deleted file mode 100644 index 99ec7525c..000000000 --- a/nx-X11/lib/GL/mesa/tnl/Imakefile +++ /dev/null @@ -1,101 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/tnl/Imakefile,v 1.8 2002/11/25 12:58:55 tsi Exp $ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if BuildOSMesaLib || (BuildXF86DRI && (GlxDriverUsesMesa || GlxBuiltInXMesa)) -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#define MesaTnlBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I../../../include \ - -I$(INCLUDESRC)/GL -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -#if defined(i386Architecture) && MesaUseX86Asm - ASM_DIR = x86 - ASM_SRCS = - ASM_OBJS = -#if MesaUseMMX - MMX_DEFS = -DUSE_MMX_ASM -#endif -#if MesaUse3DNow - 3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif -#if MesaUseSSE - SSE_DEFS = -DUSE_SSE_ASM -#endif - ASM_DEFS = -DUSE_X86_ASM $(MMX_DEFS) $(3DNOW_DEFS) $(SSE_DEFS) -#endif - -#ifdef SparcArchitecture - ASM_DIR = sparc - ASM_SRCS = - ASM_OBJS = - ASM_DEFS = -DUSE_SPARC_ASM -#endif - -#ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/src/mesa/$(ASM_DIR) \ - -I$(MESASRCDIR)/src/mesa/array_cache \ - -I$(MESASRCDIR)/src/mesa/math \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/glapi \ - -I$(MESASRCDIR)/src/mesa/swrast_setup \ - -I$(MESASRCDIR)/src/mesa/shader \ - -I$(MESASRCDIR)/src/mesa/tnl \ - -I$(MESASRCDIR)/include \ - -I../../../include -I$(XINCLUDESRC) - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - SRCS = $(MESA_TNL_SRCS) - OBJS = $(MESA_TNL_OBJS) - - -#include - -LibraryObjectRule() - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/tnl/Imakefile.inc b/nx-X11/lib/GL/mesa/tnl/Imakefile.inc deleted file mode 100644 index a294a6fbf..000000000 --- a/nx-X11/lib/GL/mesa/tnl/Imakefile.inc +++ /dev/null @@ -1,225 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/tnl/Imakefile.inc,v 1.1tsi Exp $ - -#ifndef MesaTnlBuildDir -#define MesaTnlBuildDir $(GLXLIBSRC)/mesa/tnl/ -#endif - -MESATNLBUILDDIR = MesaTnlBuildDir - - MESA_TNL_SRCS = $(MESATNLBUILDDIR)t_array_api.c \ - $(MESATNLBUILDDIR)t_array_import.c \ - $(MESATNLBUILDDIR)t_context.c \ - $(MESATNLBUILDDIR)t_pipeline.c \ - $(MESATNLBUILDDIR)t_save_api.c \ - $(MESATNLBUILDDIR)t_save_loopback.c \ - $(MESATNLBUILDDIR)t_save_playback.c \ - $(MESATNLBUILDDIR)t_vb_arbprogram.c \ - $(MESATNLBUILDDIR)t_vb_arbprogram_sse.c \ - $(MESATNLBUILDDIR)t_vb_fog.c \ - $(MESATNLBUILDDIR)t_vb_cull.c \ - $(MESATNLBUILDDIR)t_vb_light.c \ - $(MESATNLBUILDDIR)t_vb_normals.c \ - $(MESATNLBUILDDIR)t_vb_points.c \ - $(MESATNLBUILDDIR)t_vb_program.c \ - $(MESATNLBUILDDIR)t_vb_render.c \ - $(MESATNLBUILDDIR)t_vb_texgen.c \ - $(MESATNLBUILDDIR)t_vb_texmat.c \ - $(MESATNLBUILDDIR)t_vb_vertex.c \ - $(MESATNLBUILDDIR)t_vertex.c \ - $(MESATNLBUILDDIR)t_vertex_generic.c \ - $(MESATNLBUILDDIR)t_vertex_sse.c \ - $(MESATNLBUILDDIR)t_vp_build.c \ - $(MESATNLBUILDDIR)t_vtx_api.c \ - $(MESATNLBUILDDIR)t_vtx_eval.c \ - $(MESATNLBUILDDIR)t_vtx_exec.c \ - $(MESATNLBUILDDIR)t_vtx_generic.c - -#if defined(i386Architecture) && MesaUseX86Asm - MESA_TNL_SRCS += MesaTnlAsmSrcs $(MESATNLBUILDDIR)t_vtx_x86.c \ - $(MESATNLBUILDDIR)t_vtx_x86_gcc.S -#endif - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(t_array_api.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_array_api.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_array_import.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_array_import.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_context.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_context.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(tnl.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_pipeline.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_pipeline.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_save_api.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_save_api.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_save_loopback.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_save_playback.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_arbprogram.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_arbprogram.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_arbprogram_sse.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_cliptmp.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_fog.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_cull.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_light.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_lighttmp.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_normals.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_points.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_program.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_render.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_rendertmp.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_texgen.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_texmat.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vb_vertex.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vertex.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vertex.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vertex_generic.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vertex_sse.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vp_build.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vp_build.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vtx_api.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vtx_api.h, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vtx_eval.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vtx_exec.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vtx_generic.c, $(MESASRCDIR)/src/mesa/tnl) -#if defined(i386Architecture) && MesaUseX86Asm -LinkSourceFile(t_vtx_x86.c, $(MESASRCDIR)/src/mesa/tnl) -LinkSourceFile(t_vtx_x86_gcc.S, $(MESASRCDIR)/src/mesa/tnl) -#endif -#endif - - MESA_TNL_OBJS = $(MESATNLBUILDDIR)t_array_api.o \ - $(MESATNLBUILDDIR)t_array_import.o \ - $(MESATNLBUILDDIR)t_context.o \ - $(MESATNLBUILDDIR)t_pipeline.o \ - $(MESATNLBUILDDIR)t_save_api.o \ - $(MESATNLBUILDDIR)t_save_loopback.o \ - $(MESATNLBUILDDIR)t_save_playback.o \ - $(MESATNLBUILDDIR)t_vb_arbprogram.o \ - $(MESATNLBUILDDIR)t_vb_arbprogram_sse.o \ - $(MESATNLBUILDDIR)t_vb_fog.o \ - $(MESATNLBUILDDIR)t_vb_cull.o \ - $(MESATNLBUILDDIR)t_vb_light.o \ - $(MESATNLBUILDDIR)t_vb_normals.o \ - $(MESATNLBUILDDIR)t_vb_points.o \ - $(MESATNLBUILDDIR)t_vb_program.o \ - $(MESATNLBUILDDIR)t_vb_render.o \ - $(MESATNLBUILDDIR)t_vb_texgen.o \ - $(MESATNLBUILDDIR)t_vb_texmat.o \ - $(MESATNLBUILDDIR)t_vb_vertex.o \ - $(MESATNLBUILDDIR)t_vertex.o \ - $(MESATNLBUILDDIR)t_vertex_generic.o \ - $(MESATNLBUILDDIR)t_vertex_sse.o \ - $(MESATNLBUILDDIR)t_vp_build.o \ - $(MESATNLBUILDDIR)t_vtx_api.o \ - $(MESATNLBUILDDIR)t_vtx_eval.o \ - $(MESATNLBUILDDIR)t_vtx_exec.o \ - $(MESATNLBUILDDIR)t_vtx_generic.o - -#if defined(i386Architecture) && MesaUseX86Asm - MESA_TNL_OBJS += $(MESATNLBUILDDIR)t_vtx_x86.o \ - $(MESATNLBUILDDIR)t_vtx_x86_gcc.o -#endif - -#if defined(DoSharedLib) && DoSharedLib - MESA_TNL_UOBJS = $(MESATNLBUILDDIR)unshared/t_array_api.o \ - $(MESATNLBUILDDIR)unshared/t_array_import.o \ - $(MESATNLBUILDDIR)unshared/t_context.o \ - $(MESATNLBUILDDIR)unshared/t_pipeline.o \ - $(MESATNLBUILDDIR)unshared/t_save_api.o \ - $(MESATNLBUILDDIR)unshared/t_save_loopback.o \ - $(MESATNLBUILDDIR)unshared/t_save_playback.o \ - $(MESATNLBUILDDIR)unshared/t_vb_arbprogram.o \ - $(MESATNLBUILDDIR)unshared/t_vb_arbprogram_sse.o \ - $(MESATNLBUILDDIR)unshared/t_vb_fog.o \ - $(MESATNLBUILDDIR)unshared/t_vb_cull.o \ - $(MESATNLBUILDDIR)unshared/t_vb_light.o \ - $(MESATNLBUILDDIR)unshared/t_vb_normals.o \ - $(MESATNLBUILDDIR)unshared/t_vb_points.o \ - $(MESATNLBUILDDIR)unshared/t_vb_program.o \ - $(MESATNLBUILDDIR)unshared/t_vb_render.o \ - $(MESATNLBUILDDIR)unshared/t_vb_texgen.o \ - $(MESATNLBUILDDIR)unshared/t_vb_texmat.o \ - $(MESATNLBUILDDIR)unshared/t_vb_vertex.o \ - $(MESATNLBUILDDIR)unshared/t_vertex.o \ - $(MESATNLBUILDDIR)unshared/t_vertex_generic.o \ - $(MESATNLBUILDDIR)unshared/t_vertex_sse.o \ - $(MESATNLBUILDDIR)unshared/t_vp_build.o \ - $(MESATNLBUILDDIR)unshared/t_vtx_api.o \ - $(MESATNLBUILDDIR)unshared/t_vtx_eval.o \ - $(MESATNLBUILDDIR)unshared/t_vtx_exec.o \ - $(MESATNLBUILDDIR)unshared/t_vtx_generic.o - -#if defined(i386Architecture) && MesaUseX86Asm - MESA_TNL_UOBJS += $(MESATNLBUILDDIR)unshared/t_vtx_x86.o \ - $(MESATNLBUILDDIR)t_vtx_x86_gcc.o -#endif - -#else - MESA_TNL_UOBJS = $(MESA_TNL_OBJS) -#endif - - MESA_TNL_DOBJS = $(MESATNLBUILDDIR)debugger/t_array_api.o \ - $(MESATNLBUILDDIR)debugger/t_array_import.o \ - $(MESATNLBUILDDIR)debugger/t_context.o \ - $(MESATNLBUILDDIR)debugger/t_pipeline.o \ - $(MESATNLBUILDDIR)debugger/t_save_api.o \ - $(MESATNLBUILDDIR)debugger/t_save_loopback.o \ - $(MESATNLBUILDDIR)debugger/t_save_playback.o \ - $(MESATNLBUILDDIR)debugger/t_vb_arbprogram.o \ - $(MESATNLBUILDDIR)debugger/t_vb_arbprogram_sse.o \ - $(MESATNLBUILDDIR)debugger/t_vb_fog.o \ - $(MESATNLBUILDDIR)debugger/t_vb_cull.o \ - $(MESATNLBUILDDIR)debugger/t_vb_light.o \ - $(MESATNLBUILDDIR)debugger/t_vb_normals.o \ - $(MESATNLBUILDDIR)debugger/t_vb_points.o \ - $(MESATNLBUILDDIR)debugger/t_vb_program.o \ - $(MESATNLBUILDDIR)debugger/t_vb_render.o \ - $(MESATNLBUILDDIR)debugger/t_vb_texgen.o \ - $(MESATNLBUILDDIR)debugger/t_vb_texmat.o \ - $(MESATNLBUILDDIR)debugger/t_vb_vertex.o \ - $(MESATNLBUILDDIR)debugger/t_vertex.o \ - $(MESATNLBUILDDIR)debugger/t_vertex_generic.o \ - $(MESATNLBUILDDIR)debugger/t_vertex_sse.o \ - $(MESATNLBUILDDIR)debugger/t_vp_build.o \ - $(MESATNLBUILDDIR)debugger/t_vtx_api.o \ - $(MESATNLBUILDDIR)debugger/t_vtx_eval.o \ - $(MESATNLBUILDDIR)debugger/t_vtx_exec.o \ - $(MESATNLBUILDDIR)debugger/t_vtx_generic.o - -#if defined(i386Architecture) && MesaUseX86Asm - MESA_TNL_DOBJS += $(MESATNLBUILDDIR)debugger/t_vtx_x86.o \ - $(MESATNLBUILDDIR)debugger/t_vtx_x86_gcc.o -#endif - - MESA_TNL_POBJS = $(MESATNLBUILDDIR)profiled/t_array_api.o \ - $(MESATNLBUILDDIR)profiled/t_array_import.o \ - $(MESATNLBUILDDIR)profiled/t_context.o \ - $(MESATNLBUILDDIR)profiled/t_pipeline.o \ - $(MESATNLBUILDDIR)profiled/t_save_api.o \ - $(MESATNLBUILDDIR)profiled/t_save_loopback.o \ - $(MESATNLBUILDDIR)profiled/t_save_playback.o \ - $(MESATNLBUILDDIR)profiled/t_vb_arbprogram.o \ - $(MESATNLBUILDDIR)profiled/t_vb_arbprogram_sse.o \ - $(MESATNLBUILDDIR)profiled/t_vb_fog.o \ - $(MESATNLBUILDDIR)profiled/t_vb_cull.o \ - $(MESATNLBUILDDIR)profiled/t_vb_light.o \ - $(MESATNLBUILDDIR)profiled/t_vb_normals.o \ - $(MESATNLBUILDDIR)profiled/t_vb_points.o \ - $(MESATNLBUILDDIR)profiled/t_vb_program.o \ - $(MESATNLBUILDDIR)profiled/t_vb_render.o \ - $(MESATNLBUILDDIR)profiled/t_vb_texgen.o \ - $(MESATNLBUILDDIR)profiled/t_vb_texmat.o \ - $(MESATNLBUILDDIR)profiled/t_vb_vertex.o \ - $(MESATNLBUILDDIR)profiled/t_vertex.o \ - $(MESATNLBUILDDIR)profiled/t_vertex_generic.o \ - $(MESATNLBUILDDIR)profiled/t_vertex_sse.o \ - $(MESATNLBUILDDIR)profiled/t_vp_build.o \ - $(MESATNLBUILDDIR)profiled/t_vtx_api.o \ - $(MESATNLBUILDDIR)profiled/t_vtx_eval.o \ - $(MESATNLBUILDDIR)profiled/t_vtx_exec.o \ - $(MESATNLBUILDDIR)profiled/t_vtx_generic.o - -#if defined(i386Architecture) && MesaUseX86Asm - MESA_TNL_POBJS += $(MESATNLBUILDDIR)profiled/t_vtx_x86.o \ - $(MESATNLBUILDDIR)profiled/t_vtx_x86_gcc.o -#endif - diff --git a/nx-X11/lib/GL/mesa/tnl_dd/Imakefile b/nx-X11/lib/GL/mesa/tnl_dd/Imakefile deleted file mode 100644 index 93b8c8877..000000000 --- a/nx-X11/lib/GL/mesa/tnl_dd/Imakefile +++ /dev/null @@ -1,63 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/tnl_dd/Imakefile,v 1.6 2002/11/25 12:58:55 tsi Exp $ - -#include - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if GlxDriverUsesMesa || GlxBuiltInXMesa || BuildOSMesaLib -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - -/* Large PIC tables needed for Solaris SPARC builds */ -#if (defined(SunArchitecture) && defined(SparcArchitecture)) -# define LargePICTable YES -#endif - -#define MesaTnlDdBuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#if BuildXF86DRI - DRI_DEFINES = GlxDefines -DIN_DRI_DRIVER - DRI_INCLUDES = -I../../../dri -I../../../glx -I../../dri -I../../../include \ - -I$(XINCLUDESRC) -I$(INCLUDESRC)/GL \ - -I$(XF86OSSRC) -I$(SERVERSRC)/GL/dri -#endif - -MESA_INCLUDES = -I$(MESASRCDIR)/src \ - -I$(MESASRCDIR)/src/math \ - -I$(MESASRCDIR)/src/tnl_dd \ - -I$(MESASRCDIR)/include \ - -I../../../include - - INCLUDES = $(MESA_INCLUDES) $(DRI_INCLUDES) - - DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(ASM_DEFS) $(MATHDEF) - -#include - -LibraryObjectRule() - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/tnl_dd/Imakefile.inc b/nx-X11/lib/GL/mesa/tnl_dd/Imakefile.inc deleted file mode 100644 index 8d5d3da2d..000000000 --- a/nx-X11/lib/GL/mesa/tnl_dd/Imakefile.inc +++ /dev/null @@ -1,40 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/tnl_dd/Imakefile.inc,v 1.1tsi Exp $ - -#ifndef MesaTnlDdBuildDir -#define MesaTnlDdBuildDir $(GLXLIBSRC)/mesa/tnl_dd/ -#endif - -MESATNLDDBUILDDIR = MesaTnlDdBuildDir - - MESA_TNL_DD_SRCS = $(MESATNLDDBUILDDIR)t_dd.c \ - $(MESATNLDDBUILDDIR)t_dd_vb.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(t_dd.c, $(MESASRCDIR)/src/mesa/tnl_dd) -LinkSourceFile(t_dd_vb.c, $(MESASRCDIR)/src/mesa/tnl_dd) -LinkSourceFile(t_dd_dmatmp2.h, $(MESASRCDIR)/src/mesa/tnl_dd) -LinkSourceFile(t_dd_dmatmp.h, $(MESASRCDIR)/src/mesa/tnl_dd) -LinkSourceFile(t_dd_rendertmp.h, $(MESASRCDIR)/src/mesa/tnl_dd) -LinkSourceFile(t_dd_triemit.h, $(MESASRCDIR)/src/mesa/tnl_dd) -LinkSourceFile(t_dd_tritmp.h, $(MESASRCDIR)/src/mesa/tnl_dd) -LinkSourceFile(t_dd_unfilled.h, $(MESASRCDIR)/src/mesa/tnl_dd) -LinkSourceFile(t_dd_vbtmp.h, $(MESASRCDIR)/src/mesa/tnl_dd) -LinkSourceFile(t_dd_vertex.h, $(MESASRCDIR)/src/mesa/tnl_dd) -#endif - - MESA_TNL_DD_OBJS = $(MESATNLDDBUILDDIR)t_dd.o \ - $(MESATNLDDBUILDDIR)t_dd_vb.o - -#if defined(DoSharedLib) && DoSharedLib -MESA_TNL_DD_UOBJS = $(MESATNLDDBUILDDIR)unshared/t_dd.o \ - $(MESATNLDDBUILDDIR)unshared/t_dd_vb.o -#else -MESA_TNL_DD_UOBJS = $(MESA_TNL_DD_OBJS) -#endif - -MESA_TNL_DD_DOBJS = $(MESATNLDDBUILDDIR)debugger/t_dd.o \ - $(MESATNLDDBUILDDIR)debugger/t_dd_vb.o - -MESA_TNL_DD_POBJS = $(MESATNLDDBUILDDIR)profiled/t_dd.o \ - $(MESATNLDDBUILDDIR)profiled/t_dd_vb.o - diff --git a/nx-X11/lib/GL/mesa/x86/Imakefile b/nx-X11/lib/GL/mesa/x86/Imakefile deleted file mode 100644 index 543c05143..000000000 --- a/nx-X11/lib/GL/mesa/x86/Imakefile +++ /dev/null @@ -1,108 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile,v 1.23 2002/07/14 17:08:16 alanh Exp $ - -/* - * Need both shared and unshared Mesa objects in the following cases: - * GlxDriverUsesMesa - * GlxBuiltInXMesa - * BuildOSMesaLib - * - * In other cases, only the shared version is needed to link in to loadable - * driver modules. - */ - -#if GlxDriverUsesMesa || GlxBuiltInXMesa || BuildOSMesaLib -#define DoNormalLib (NormalLibGlx || SharedLibGlxWithoutPIC) -#define DoSharedLib (SharedLibGlx && !SharedLibGlxWithoutPIC) -#define DoExtraLib SharedLibGlx -#define DoDebugLib DebugLibGlx -#define DoProfileLib ProfileLibGlx -#else -#define DoNormalLib SharedLibGlxWithoutPIC -#define DoSharedLib !SharedLibGlxWithoutPIC -#define DoExtraLib NO -#define DoDebugLib NO -#define DoProfileLib NO -#endif - - -#if Malloc0ReturnsNull -ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL -#endif - -#define MesaX86BuildDir /**/ -#define NeedToLinkMesaSrc -#include "Imakefile.inc" - - DEFINES = $(ALLOC_DEFINES) GlxDefines -DIN_DRI_DRIVER $(MESA_ASM_DEFINES) - INCLUDES = /*-I$(INCLUDESRC) -I$(EXTINCSRC)*/ -I$(MESASRCDIR)/src/mesa \ - -I$(MESASRCDIR)/include \ - -I$(GLXLIBSRC)/include \ - -I$(MESASRCDIR)/src/mesa/main \ - -I$(MESASRCDIR)/src/mesa/x86 \ - -I$(MESASRCDIR)/src/mesa/glapi - - SRCS = $(MESA_ASM_SRCS) gen_matypes.c - OBJS = $(MESA_ASM_OBJS) - -#include - -LibraryObjectRule() - -STD_CPP_DEFINES = StandardDefines $(PROJECT_DEFINES) - -SubdirLibraryRule($(OBJS)) -NormalLintTarget($(SRCS)) - -ObjectFromAsmSource(common_x86_asm, NullParameter) -ObjectFromAsmSource(read_rgba_span_x86, NullParameter) -ObjectFromAsmSource(x86_cliptest, NullParameter) -ObjectFromAsmSource(x86_xform2, NullParameter) -ObjectFromAsmSource(x86_xform3, NullParameter) -ObjectFromAsmSource(x86_xform4, NullParameter) - -#if MesaUseMMX -ObjectFromAsmSource(mmx_blend, NullParameter) -#endif - -#if MesaUse3DNow -ObjectFromAsmSource(3dnow_normal, NullParameter) -ObjectFromAsmSource(3dnow_xform1, NullParameter) -ObjectFromAsmSource(3dnow_xform2, NullParameter) -ObjectFromAsmSource(3dnow_xform3, NullParameter) -ObjectFromAsmSource(3dnow_xform4, NullParameter) -#endif - -#if MesaUseSSE -ObjectFromAsmSource(sse_normal, NullParameter) -ObjectFromAsmSource(sse_xform1, NullParameter) -ObjectFromAsmSource(sse_xform2, NullParameter) -ObjectFromAsmSource(sse_xform3, NullParameter) -ObjectFromAsmSource(sse_xform4, NullParameter) -#endif - -LinkSourceFile(gen_matypes.c, $(MESASRCDIR)/src/mesa/x86) - -#if CrossCompiling -HOST_CFLAGS=$(TOP_INCLUDES) $(INCLUDES) $(BOOTSTRAPCFLAGS) \ - $(CROSSCOMPILEDEFINES) $(CROSSCOMPILEBOOTSTRAPDEFINES) -#else -HOST_CFLAGS=$(CFLAGS) -#endif - -MATYPES = ./gen_matypes - -matypes.h: gen_matypes.c - RemoveFiles($@ HostProgramTargetName(gen_matypes)) - -HostLinkRule(HostProgramTargetName(gen_matypes),$(HOST_CFLAGS) $(LOCAL_LDFLAGS),gen_matypes.c,$(LDLIBS)) - RunProgram(MATYPES,> matypes_h) - $(MV) matypes_h $@ - RemoveFiles(HostProgramTargetName(gen_matypes)) - -includes:: matypes.h - -depend:: matypes.h - -clean:: - RemoveFiles(matypes.h HostProgramTargetName(gen_matypes)) - -DependTarget() diff --git a/nx-X11/lib/GL/mesa/x86/Imakefile.inc b/nx-X11/lib/GL/mesa/x86/Imakefile.inc deleted file mode 100644 index b21c6f659..000000000 --- a/nx-X11/lib/GL/mesa/x86/Imakefile.inc +++ /dev/null @@ -1,217 +0,0 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile.inc,v 1.5 2002/11/14 21:01:16 tsi Exp $ - -#ifndef MesaX86BuildDir -#define MesaX86BuildDir $(GLXLIBSRC)/mesa/x86/ -#endif - -MESAX86BUILDDIR = MesaX86BuildDir - -MESA_X86_SRCS = $(MESAX86BUILDDIR)common_x86.c \ - $(MESAX86BUILDDIR)common_x86_asm.S \ - $(MESAX86BUILDDIR)glapi_x86.S \ - $(MESAX86BUILDDIR)read_rgba_span_x86.S \ - $(MESAX86BUILDDIR)x86.c \ - $(MESAX86BUILDDIR)x86_cliptest.S \ - $(MESAX86BUILDDIR)x86_xform2.S \ - $(MESAX86BUILDDIR)x86_xform3.S \ - $(MESAX86BUILDDIR)x86_xform4.S \ - $(MESAX86BUILDDIR)x86sse.c - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(common_x86.c, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(common_x86_asm.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(glapi_x86.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(read_rgba_span_x86.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(read_rgba_span_x86.h, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(x86.c, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(x86_cliptest.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(x86_xform2.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(x86_xform3.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(x86_xform4.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(x86sse.c, $(MESASRCDIR)/src/mesa/x86/rtasm) -LinkSourceFile(x86sse.h, $(MESASRCDIR)/src/mesa/x86/rtasm) -#endif - -MESA_X86_OBJS = $(MESAX86BUILDDIR)common_x86.o \ - $(MESAX86BUILDDIR)common_x86_asm.o \ - $(MESAX86BUILDDIR)read_rgba_span_x86.o \ - $(MESAX86BUILDDIR)x86.o \ - $(MESAX86BUILDDIR)x86_cliptest.o \ - $(MESAX86BUILDDIR)x86_xform2.o \ - $(MESAX86BUILDDIR)x86_xform3.o \ - $(MESAX86BUILDDIR)x86_xform4.o \ - $(MESAX86BUILDDIR)x86sse.o - -#if defined(DoSharedLib) && DoSharedLib -MESA_X86_UOBJS = $(MESAX86BUILDDIR)unshared/common_x86.o \ - $(MESAX86BUILDDIR)common_x86_asm.o \ - $(MESAX86BUILDDIR)read_rgba_span_x86.o \ - $(MESAX86BUILDDIR)unshared/x86.o \ - $(MESAX86BUILDDIR)x86_cliptest.o \ - $(MESAX86BUILDDIR)x86_xform2.o \ - $(MESAX86BUILDDIR)x86_xform3.o \ - $(MESAX86BUILDDIR)x86_xform4.o \ - $(MESAX86BUILDDIR)x86sse.o -#else -MESA_X86_UOBJS = $(MESA_X86_OBJS) -#endif - -MESA_X86_DOBJS = $(MESAX86BUILDDIR)debugger/common_x86.o \ - $(MESAX86BUILDDIR)common_x86_asm.o \ - $(MESAX86BUILDDIR)read_rgba_span_x86.o \ - $(MESAX86BUILDDIR)debugger/x86.o \ - $(MESAX86BUILDDIR)x86_cliptest.o \ - $(MESAX86BUILDDIR)x86_xform2.o \ - $(MESAX86BUILDDIR)x86_xform3.o \ - $(MESAX86BUILDDIR)x86_xform4.o \ - $(MESAX86BUILDDIR)x86sse.o - -MESA_X86_POBJS = $(MESAX86BUILDDIR)profiled/common_x86.o \ - $(MESAX86BUILDDIR)common_x86_asm.o \ - $(MESAX86BUILDDIR)read_rgba_span_x86.o \ - $(MESAX86BUILDDIR)profiled/x86.o \ - $(MESAX86BUILDDIR)x86_cliptest.o \ - $(MESAX86BUILDDIR)x86_xform2.o \ - $(MESAX86BUILDDIR)x86_xform3.o \ - $(MESAX86BUILDDIR)x86_xform4.o \ - $(MESAX86BUILDDIR)x86sse.o - -MESA_X86_DEFS = -DUSE_X86_ASM - - -#if MesaUseMMX -MESA_MMX_SRCS = $(MESAX86BUILDDIR)mmx_blend.S - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(mmx_blend.S, $(MESASRCDIR)/src/mesa/x86) -#endif - -MESA_MMX_OBJS = $(MESAX86BUILDDIR)mmx_blend.o - -MESA_MMX_UOBJS = $(MESA_MMX_OBJS) -MESA_MMX_DOBJS = $(MESA_MMX_OBJS) -MESA_MMX_POBJS = $(MESA_MMX_OBJS) - -MESA_MMX_DEFS = -DUSE_MMX_ASM -#endif - -#if MesaUse3DNow -MESA_3DNOW_SRCS = $(MESAX86BUILDDIR)3dnow.c \ - $(MESAX86BUILDDIR)3dnow_normal.S \ - $(MESAX86BUILDDIR)3dnow_xform1.S \ - $(MESAX86BUILDDIR)3dnow_xform2.S \ - $(MESAX86BUILDDIR)3dnow_xform3.S \ - $(MESAX86BUILDDIR)3dnow_xform4.S - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(3dnow.c, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(3dnow_normal.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(3dnow_xform1.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(3dnow_xform2.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(3dnow_xform3.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(3dnow_xform4.S, $(MESASRCDIR)/src/mesa/x86) -#endif -MESA_3DNOW_OBJS = $(MESAX86BUILDDIR)3dnow.o \ - $(MESAX86BUILDDIR)3dnow_normal.o \ - $(MESAX86BUILDDIR)3dnow_xform1.o \ - $(MESAX86BUILDDIR)3dnow_xform2.o \ - $(MESAX86BUILDDIR)3dnow_xform3.o \ - $(MESAX86BUILDDIR)3dnow_xform4.o - -#if defined(DoSharedLib) && DoSharedLib -MESA_3DNOW_UOBJS = $(MESAX86BUILDDIR)unshared/3dnow.o \ - $(MESAX86BUILDDIR)3dnow_normal.o \ - $(MESAX86BUILDDIR)3dnow_xform1.o \ - $(MESAX86BUILDDIR)3dnow_xform2.o \ - $(MESAX86BUILDDIR)3dnow_xform3.o \ - $(MESAX86BUILDDIR)3dnow_xform4.o -#else -MESA_3DNOW_UOBJS = $(MESA_3DNOW_OBJS) -#endif - -MESA_3DNOW_DOBJS = $(MESAX86BUILDDIR)debugger/3dnow.o \ - $(MESAX86BUILDDIR)3dnow_normal.o \ - $(MESAX86BUILDDIR)3dnow_xform1.o \ - $(MESAX86BUILDDIR)3dnow_xform2.o \ - $(MESAX86BUILDDIR)3dnow_xform3.o \ - $(MESAX86BUILDDIR)3dnow_xform4.o - -MESA_3DNOW_POBJS = $(MESAX86BUILDDIR)profiled/3dnow.o \ - $(MESAX86BUILDDIR)3dnow_normal.o \ - $(MESAX86BUILDDIR)3dnow_xform1.o \ - $(MESAX86BUILDDIR)3dnow_xform2.o \ - $(MESAX86BUILDDIR)3dnow_xform3.o \ - $(MESAX86BUILDDIR)3dnow_xform4.o - -MESA_3DNOW_DEFS = -DUSE_3DNOW_ASM -#endif - -#if MesaUseSSE -MESA_SSE_SRCS = $(MESAX86BUILDDIR)sse.c \ - $(MESAX86BUILDDIR)sse_normal.S \ - $(MESAX86BUILDDIR)sse_xform1.S \ - $(MESAX86BUILDDIR)sse_xform2.S \ - $(MESAX86BUILDDIR)sse_xform3.S \ - $(MESAX86BUILDDIR)sse_xform4.S - -#ifdef NeedToLinkMesaSrc -LinkSourceFile(sse.c, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(sse_normal.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(sse_xform1.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(sse_xform2.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(sse_xform3.S, $(MESASRCDIR)/src/mesa/x86) -LinkSourceFile(sse_xform4.S, $(MESASRCDIR)/src/mesa/x86) -#endif - -MESA_SSE_OBJS = $(MESAX86BUILDDIR)sse.o \ - $(MESAX86BUILDDIR)sse_normal.o \ - $(MESAX86BUILDDIR)sse_xform1.o \ - $(MESAX86BUILDDIR)sse_xform2.o \ - $(MESAX86BUILDDIR)sse_xform3.o \ - $(MESAX86BUILDDIR)sse_xform4.o - -#if defined(DoSharedLib) && DoSharedLib -MESA_SSE_UOBJS = $(MESAX86BUILDDIR)unshared/sse.o \ - $(MESAX86BUILDDIR)sse_normal.o \ - $(MESAX86BUILDDIR)sse_xform1.o \ - $(MESAX86BUILDDIR)sse_xform2.o \ - $(MESAX86BUILDDIR)sse_xform3.o \ - $(MESAX86BUILDDIR)sse_xform4.o -#else -MESA_SSE_UOBJS = $(MESA_SSE_OBJS) -#endif - -MESA_SSE_DOBJS = $(MESAX86BUILDDIR)debugger/sse.o \ - $(MESAX86BUILDDIR)sse_normal.o \ - $(MESAX86BUILDDIR)sse_xform1.o \ - $(MESAX86BUILDDIR)sse_xform2.o \ - $(MESAX86BUILDDIR)sse_xform3.o \ - $(MESAX86BUILDDIR)sse_xform4.o - -MESA_SSE_POBJS = $(MESAX86BUILDDIR)profiled/sse.o \ - $(MESAX86BUILDDIR)sse_normal.o \ - $(MESAX86BUILDDIR)sse_xform1.o \ - $(MESAX86BUILDDIR)sse_xform2.o \ - $(MESAX86BUILDDIR)sse_xform3.o \ - $(MESAX86BUILDDIR)sse_xform4.o - -MESA_SSE_DEFS = -DUSE_SSE_ASM -#endif - -MESA_ASM_SRCS = $(MESA_X86_SRCS) $(MESA_MMX_SRCS) $(MESA_3DNOW_SRCS) \ - $(MESA_SSE_SRCS) - -MESA_ASM_OBJS = $(MESA_X86_OBJS) $(MESA_MMX_OBJS) $(MESA_3DNOW_OBJS) \ - $(MESA_SSE_OBJS) - -MESA_ASM_UOBJS = $(MESA_X86_UOBJS) $(MESA_MMX_UOBJS) $(MESA_3DNOW_UOBJS) \ - $(MESA_SSE_UOBJS) - -MESA_ASM_DOBJS = $(MESA_X86_DOBJS) $(MESA_MMX_DOBJS) $(MESA_3DNOW_DOBJS) \ - $(MESA_SSE_DOBJS) - -MESA_ASM_POBJS = $(MESA_X86_POBJS) $(MESA_MMX_POBJS) $(MESA_3DNOW_POBJS) \ - $(MESA_SSE_POBJS) - -MESA_ASM_DEFINES = $(MESA_X86_DEFS) $(MESA_MMX_DEFS) $(MESA_3DNOW_DEFS) $(MESA_SSE_DEFS) - diff --git a/nx-X11/lib/Imakefile b/nx-X11/lib/Imakefile index 76dfb8359..79f1ac128 100644 --- a/nx-X11/lib/Imakefile +++ b/nx-X11/lib/Imakefile @@ -39,10 +39,6 @@ XF86RUSHLIBDIR = Xxf86rush XINERAMADIR=Xinerama #endif -#if BuildGLXLibrary -GLXLIBDIR = GL -#endif - #if BuildRenderLibrary RENDERLIBDIR = Xrender #endif @@ -92,7 +88,6 @@ LINTSUBDIRS = \ $(XTSTLIBDIR) \ $(XKBLIBDIR) \ $(XKBUILIBDIR) \ - $(GLXLIBDIR) \ $(XINERAMADIR) \ $(RENDERLIBDIR) \ $(XFIXESLIBDIR) \ diff --git a/nx-X11/lib/X11/Imakefile b/nx-X11/lib/X11/Imakefile index e00351169..212216f46 100644 --- a/nx-X11/lib/X11/Imakefile +++ b/nx-X11/lib/X11/Imakefile @@ -27,7 +27,7 @@ XCOMM $XFree86: xc/lib/X11/Imakefile,v 3.52 2003/05/27 16:53:15 tsi Exp $ HEADERS = Xlib.h Xresource.h Xutil.h cursorfont.h Xlibint.h \ Xcms.h Xlocale.h XKBlib.h XlibConf.h Xregion.h ImUtil.h -#if BuildServersOnly && !BuildGLXLibrary && !BuildClients && !NXAgentServer +#if BuildServersOnly && !BuildClients && !NXAgentServer all:: BuildIncludes($(HEADERS),IncSubdir,..) diff --git a/nx-X11/programs/Xserver/GL/glx/module/Imakefile b/nx-X11/programs/Xserver/GL/glx/module/Imakefile deleted file mode 100644 index d063bc28d..000000000 --- a/nx-X11/programs/Xserver/GL/glx/module/Imakefile +++ /dev/null @@ -1,4 +0,0 @@ -#define IHaveModules -#define LinkDirectory .. - -#include "../Imakefile" diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile index 154a5c1a0..8e3b77eda 100644 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile @@ -1,12 +1,7 @@ XCOMM $XFree86: xc/programs/Xserver/GL/mesa/GLcore/Imakefile,v 1.3 2002/05/31 18:12:36 dawes Exp $ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif #include @@ -24,17 +19,17 @@ SUBDIRS = module #define MesaSlangBuildDir ../shader/slang/ #define MesaXBuildDir ../X/ -#include "../../../../../lib/GL/mesa/array_cache/Imakefile.inc" -#include "../../../../../lib/GL/mesa/swrast/Imakefile.inc" -#include "../../../../../lib/GL/mesa/swrast_setup/Imakefile.inc" -#include "../../../../../lib/GL/mesa/tnl/Imakefile.inc" -#include "../../../../../lib/GL/mesa/main/Imakefile.inc" -#include "../../../../../lib/GL/mesa/math/Imakefile.inc" -#include "../../../../../lib/GL/mesa/shader/Imakefile.inc" -#include "../../../../../lib/GL/mesa/shader/grammar/Imakefile.inc" -#include "../../../../../lib/GL/mesa/shader/slang/Imakefile.inc" -#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc" -#include "../../../../../lib/GL/mesa/Imakefile.inc" +#include "../array_cache/Imakefile.inc" +#include "../swrast/Imakefile.inc" +#include "../swrast_setup/Imakefile.inc" +#include "../tnl/Imakefile.inc" +#include "../main/Imakefile.inc" +#include "../math/Imakefile.inc" +#include "../shader/Imakefile.inc" +#include "../shader/grammar/Imakefile.inc" +#include "../shader/slang/Imakefile.inc" +#include "../X/Imakefile.inc" +#include "../Imakefile.inc" #ifdef IHaveModules MSRCS = GLcoremodule.c @@ -74,4 +69,3 @@ InstallDriverSDKLibraryModule(GLcore,$(DRIVERSDKMODULEDIR),extensions) MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) #endif - diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/GLcore/module/Imakefile deleted file mode 100644 index 18dcdf0a1..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/module/Imakefile +++ /dev/null @@ -1,53 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/GLcore/Imakefile,v 1.2 2002/02/25 18:00:38 dawes Exp $ - -#define IHaveModules -#include - -#define NeedAllMesaSrc -#define MesaInXServer -#define MesaBuildDir ../../main/module/ -#define MesaACBuildDir ../../array_cache/module/ -#define MesaMathBuildDir ../../math/module/ -#define MesaSwrastBuildDir ../../swrast/module/ -#define MesaSwrastSetupBuildDir ../../swrast_setup/module/ -#define MesaTnlBuildDir ../../tnl/module/ -#define MesaXBuildDir ../../X/module/ - -#include "../../../../../../lib/GL/mesa/array_cache/Imakefile.inc" -#include "../../../../../../lib/GL/mesa/swrast/Imakefile.inc" -#include "../../../../../../lib/GL/mesa/swrast_setup/Imakefile.inc" -#include "../../../../../../lib/GL/mesa/tnl/Imakefile.inc" -#include "../../../../../../lib/GL/mesa/math/Imakefile.inc" -#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc" -#include "../../../../../../lib/GL/mesa/Imakefile.inc" - -#if DoLoadableServer - MSRCS = GLcoremodule.c - MOBJS = GLcoremodule.o -#endif - - XOBJS = ../../X/module/?*.o - - OBJS = $(COREMESAOBJS) $(MOBJS) - - DONES = ../../module/DONE ../../X/module/DONE \ - ../../array_cache/module/DONE ../../math/module/DONE \ - ../../swrast/module/DONE \ - ../../swrast_setup/module/DONE ../../tnl/module/DONE - - INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(MESASRCDIR)/include -I$(GLXLIBSRC)/include \ - -I$(MESASRCDIR)/src/mesa \ - -I$(SERVERSRC)/include - - DEFINES = $(GLX_DEFINES) - -ModuleObjectRule() - -DepLibraryModuleTarget(GLcore, $(DONES) $(OBJS),$(OBJS) $(XOBJS)) -InstallLibraryModule(GLcore,$(MODULEDIR),extensions) - -InstallDriverSDKLibraryModule(GLcore,$(DRIVERSDKMODULEDIR),extensions) - -LinkSourceFile(GLcoremodule.c,..) - diff --git a/nx-X11/programs/Xserver/GL/mesa/Imakefile b/nx-X11/programs/Xserver/GL/mesa/Imakefile index ea7d18aa2..41acce9f4 100644 --- a/nx-X11/programs/Xserver/GL/mesa/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/Imakefile @@ -1,17 +1,11 @@ XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/Imakefile,v 1.23 2002/11/22 22:56:00 tsi Exp $ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) - MODSUBDIR = module -#endif #endif -#if !defined(IHaveModules) || !BuildModuleInSubdir #define IHaveSubdirs SUBDIRS = main math array_cache swrast swrast_setup tnl shader X GLcore $(MODSUBDIR) -#endif #include @@ -19,11 +13,7 @@ XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/Imakefile,v 1.23 2002/11/22 22:5 #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../lib/GL/mesa/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/Imakefile.inc" -#endif +#include "Imakefile.inc" INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \ -I$(MESASRCDIR)/include -I$(GLXLIBSRC)/include \ @@ -44,4 +34,3 @@ DependSubdirs($(SUBDIRS)) #endif DependTarget() - diff --git a/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc new file mode 100644 index 000000000..03a7971f8 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc @@ -0,0 +1,57 @@ +XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ + +#ifndef MesaBuildDir +#define MesaBuildDir $(GLXLIBSRC)/mesa/ +#endif + +MESABUILDDIR = MesaBuildDir + +COREMESASRCS = $(COREMESABASESRCS) \ + $(MESA_AC_SRCS) \ + $(MESA_MATH_SRCS) \ + $(MESA_SWRAST_SRCS) \ + $(MESA_SWR_SETUP_SRCS) \ + $(MESA_TNL_SRCS) \ + $(MESA_SHADER_SRCS) \ + $(MESA_GRAMMAR_SRCS) \ + $(MESA_SLANG_SRCS) + +COREMESAOBJS = $(COREMESABASEOBJS) \ + $(MESA_AC_OBJS) \ + $(MESA_MATH_OBJS) \ + $(MESA_SWRAST_OBJS) \ + $(MESA_SWR_SETUP_OBJS) \ + $(MESA_TNL_OBJS) \ + $(MESA_SHADER_OBJS) \ + $(MESA_GRAMMAR_OBJS) \ + $(MESA_SLANG_OBJS) + +COREMESAUOBJS = $(COREMESABASEUOBJS) \ + $(MESA_AC_UOBJS) \ + $(MESA_MATH_UOBJS) \ + $(MESA_SWRAST_UOBJS) \ + $(MESA_SWR_SETUP_UOBJS) \ + $(MESA_TNL_UOBJS) \ + $(MESA_SHADER_UOBJS) \ + $(MESA_GRAMMAR_UOBJS) \ + $(MESA_SLANG_UOBJS) + +COREMESADOBJS = $(COREMESABASEDOBJS) \ + $(MESA_AC_DOBJS) \ + $(MESA_MATH_DOBJS) \ + $(MESA_SWRAST_DOBJS) \ + $(MESA_SWR_SETUP_DOBJS) \ + $(MESA_TNL_DOBJS) \ + $(MESA_SHADER_DOBJS) \ + $(MESA_GRAMMAR_DOBJS) \ + $(MESA_SLANG_DOBJS) + +COREMESAPOBJS = $(COREMESABASEPOBJS) \ + $(MESA_AC_POBJS) \ + $(MESA_MATH_POBJS) \ + $(MESA_SWRAST_POBJS) \ + $(MESA_SWR_SETUP_POBJS) \ + $(MESA_TNL_POBJS) \ + $(MESA_SHADER_POBJS) \ + $(MESA_GRAMMAR_POBJS) \ + $(MESA_SLANG_POBJS) diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile index f0e722f00..fbdd755fa 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile @@ -1,12 +1,7 @@ XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/Imakefile,v 1.16 2002/11/22 22:56:01 tsi Exp $ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif #include @@ -15,11 +10,7 @@ SUBDIRS = module #define NeedToLinkMesaSrc #define MesaXBuildDir /**/ #define MesaInXServer -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc" -#endif +#include "Imakefile.inc" LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc new file mode 100644 index 000000000..d62800e7d --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc @@ -0,0 +1,104 @@ +XCOMM $XFree86: xc/lib/GL/mesa/src/X/Imakefile.inc,v 1.3tsi Exp $ + +#ifndef MesaXBuildDir +#define MesaXBuildDir $(GLXLIBSRC)/src/mesa/drivers/x11/ +#endif + +MESAXBUILDDIR = MesaXBuildDir + +#ifndef MesaInXServer +XMESA_GLX_SRCS = $(MESAXBUILDDIR)fakeglx.c \ + $(MESAXBUILDDIR)glxapi.c \ + $(MESAXBUILDDIR)realglx.c \ + $(MESAXBUILDDIR)xfonts.c +#endif + + XMESA_SRCS = $(XMESA_GLX_SRCS) \ + $(MESAXBUILDDIR)xm_api.c \ + $(MESAXBUILDDIR)xm_buffer.c \ + $(MESAXBUILDDIR)xm_dd.c \ + $(MESAXBUILDDIR)xm_line.c \ + $(MESAXBUILDDIR)xm_span.c \ + $(MESAXBUILDDIR)xm_tri.c + +#ifdef NeedToLinkMesaSrc +#ifndef MesaInXServer +LinkSourceFile(fakeglx.c, $(MESASRCDIR)/src/mesa/drivers/x11) +LinkSourceFile(glxapi.c, $(MESASRCDIR)/src/mesa/drivers/x11) +LinkSourceFile(glxapi.h, $(MESASRCDIR)/src/mesa/drivers/x11) +LinkSourceFile(realglx.c, $(MESASRCDIR)/src/mesa/drivers/x11) +LinkSourceFile(xfonts.c, $(MESASRCDIR)/src/mesa/drivers/x11) +#endif +LinkSourceFile(xm_api.c, $(MESASRCDIR)/src/mesa/drivers/x11) +LinkSourceFile(xm_buffer.c, $(MESASRCDIR)/src/mesa/drivers/x11) +LinkSourceFile(xm_dd.c, $(MESASRCDIR)/src/mesa/drivers/x11) +LinkSourceFile(xm_line.c, $(MESASRCDIR)/src/mesa/drivers/x11) +LinkSourceFile(xm_span.c, $(MESASRCDIR)/src/mesa/drivers/x11) +LinkSourceFile(xm_tri.c, $(MESASRCDIR)/src/mesa/drivers/x11) +#endif + +#ifndef MesaInXServer +XMESA_GLX_OBJS = $(MESAXBUILDDIR)fakeglx.o \ + $(MESAXBUILDDIR)glxapi.o \ + $(MESAXBUILDDIR)realglx.o \ + $(MESAXBUILDDIR)xfonts.o +#endif + + XMESA_OBJS = $(XMESA_GLX_OBJS) \ + $(MESAXBUILDDIR)xm_api.o \ + $(MESAXBUILDDIR)xm_buffer.o \ + $(MESAXBUILDDIR)xm_dd.o \ + $(MESAXBUILDDIR)xm_line.o \ + $(MESAXBUILDDIR)xm_span.o \ + $(MESAXBUILDDIR)xm_tri.o + +#if defined(DoSharedLib) && DoSharedLib +#ifndef MesaInXServer +XMESA_GLX_UOBJS = $(MESAXBUILDDIR)unshared/fakeglx.o \ + $(MESAXBUILDDIR)unshared/glxapi.o \ + $(MESAXBUILDDIR)unshared/realglx.o \ + $(MESAXBUILDDIR)unshared/xfonts.o +#endif + + XMESA_UOBJS = $(XMESA_GLX_UOBJS) \ + $(MESAXBUILDDIR)unshared/xm_api.o \ + $(MESAXBUILDDIR)unshared/xm_buffer.o \ + $(MESAXBUILDDIR)unshared/xm_dd.o \ + $(MESAXBUILDDIR)unshared/xm_line.o \ + $(MESAXBUILDDIR)unshared/xm_span.o \ + $(MESAXBUILDDIR)unshared/xm_tri.o +#else +XMESA_GLX_UOBJS = $(XMESA_GLX_OBJS) + XMESA_UOBJS = $(XMESA_OBJS) +#endif + +#ifndef MesaInXServer +XMESA_GLX_DOBJS = $(MESAXBUILDDIR)debugger/fakeglx.o \ + $(MESAXBUILDDIR)debugger/glxapi.o \ + $(MESAXBUILDDIR)debugger/realglx.o \ + $(MESAXBUILDDIR)debugger/xfonts.o +#endif + + XMESA_DOBJS = $(XMESA_GLX_DOBJS) \ + $(MESAXBUILDDIR)debugger/xm_api.o \ + $(MESAXBUILDDIR)debugger/xm_buffer.o \ + $(MESAXBUILDDIR)debugger/xm_dd.o \ + $(MESAXBUILDDIR)debugger/xm_line.o \ + $(MESAXBUILDDIR)debugger/xm_span.o \ + $(MESAXBUILDDIR)debugger/xm_tri.o + +#ifndef MesaInXServer +XMESA_GLX_POBJS = $(MESAXBUILDDIR)profiled/fakeglx.o \ + $(MESAXBUILDDIR)profiled/glxapi.o \ + $(MESAXBUILDDIR)profiled/realglx.o \ + $(MESAXBUILDDIR)profiled/xfonts.o +#endif + + XMESA_POBJS = $(XMESA_GLX_POBJS) \ + $(MESAXBUILDDIR)profiled/xm_api.o \ + $(MESAXBUILDDIR)profiled/xm_buffer.o \ + $(MESAXBUILDDIR)profiled/xm_dd.o \ + $(MESAXBUILDDIR)profiled/xm_line.o \ + $(MESAXBUILDDIR)profiled/xm_span.o \ + $(MESAXBUILDDIR)profiled/xm_tri.o + diff --git a/nx-X11/programs/Xserver/GL/mesa/X/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/module/Imakefile deleted file mode 100644 index eee4c7556..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/X/module/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/module/Imakefile,v 1.1 2002/05/31 18:12:38 dawes Exp $ - -#define IHaveModules - -#include "../Imakefile" - diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile index 8126c3f30..21c6689ed 100644 --- a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile @@ -1,12 +1,7 @@ XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/array_cache/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif #include @@ -14,11 +9,7 @@ SUBDIRS = module #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaACBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/array_cache/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/array_cache/Imakefile.inc" -#endif +#include "Imakefile.inc" SRCS = $(MESA_AC_SRCS) OBJS = $(MESA_AC_OBJS) diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc new file mode 100644 index 000000000..9a5044791 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc @@ -0,0 +1,34 @@ +XCOMM $XFree86: xc/lib/GL/mesa/src/array_cache/Imakefile.inc,v 1.1tsi Exp $ + +#ifndef MesaACBuildDir +#define MesaACBuildDir $(GLXLIBSRC)/mesa/array_cache/ +#endif + +MESAACBUILDDIR = MesaACBuildDir + + MESA_AC_SRCS = $(MESAACBUILDDIR)ac_context.c \ + $(MESAACBUILDDIR)ac_import.c + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(acache.h, $(MESASRCDIR)/src/mesa/array_cache) +LinkSourceFile(ac_context.c, $(MESASRCDIR)/src/mesa/array_cache) +LinkSourceFile(ac_context.h, $(MESASRCDIR)/src/mesa/array_cache) +LinkSourceFile(ac_import.c, $(MESASRCDIR)/src/mesa/array_cache) +#endif + + MESA_AC_OBJS = $(MESAACBUILDDIR)ac_context.o \ + $(MESAACBUILDDIR)ac_import.o + +#if defined(DoSharedLib) && DoSharedLib + MESA_AC_UOBJS = $(MESAACBUILDDIR)unshared/ac_context.o \ + $(MESAACBUILDDIR)unshared/ac_import.o +#else + MESA_AC_UOBJS = $(MESA_AC_OBJS) +#endif + + MESA_AC_DOBJS = $(MESAACBUILDDIR)debugger/ac_context.o \ + $(MESAACBUILDDIR)debugger/ac_import.o + + MESA_AC_POBJS = $(MESAACBUILDDIR)profiled/ac_context.o \ + $(MESAACBUILDDIR)profiled/ac_import.o + diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/array_cache/module/Imakefile deleted file mode 100644 index 86c585012..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/array_cache/module/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/array_cache/module/Imakefile,v 1.1 2002/05/31 18:12:39 dawes Exp $ - -#define IHaveModules - -#include "../Imakefile" - diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile index 6287b92de..d6713cada 100644 --- a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile @@ -2,12 +2,7 @@ XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/main/Imakefile,v 1.2 2004/08/19 07:3 XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif /* Large PIC tables needed for Solaris/SPARC builds */ @@ -20,11 +15,7 @@ SUBDIRS = module #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/main/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/main/Imakefile.inc" -#endif +#include "Imakefile.inc" SRCS = $(COREMESABASESRCS) OBJS = $(COREMESABASEOBJS) diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc new file mode 100644 index 000000000..80b3aef07 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc @@ -0,0 +1,487 @@ +XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ + +/* gcc on ppc64 defines this, causes macro recursion with pixel below */ +#undef pixel + +#ifndef MesaBuildDir +#define MesaBuildDir $(GLXLIBSRC)/mesa/main/ +#endif + +MESABUILDDIR = MesaBuildDir + +#ifdef NeedAllMesaSrc + DISPATCHSRCS = $(MESABUILDDIR)dispatch.c + GLAPISRCS = $(MESABUILDDIR)glapi.c + GLTHREADSRCS = $(MESABUILDDIR)glthread.c +#endif + +MESA_CORE_INCLUDES = -I$(MESASRCDIR)/src/array_cache \ + -I$(MESASRCDIR)/src/math -I$(MESASRCDIR)/src/shader \ + -I$(MESASRCDIR)/src/swrast -I$(MESASRCDIR)/src/swrast_setup \ + -I$(MESASRCDIR)/src/tnl -I$(MESASRCDIR)/src/tnl_dd + +COREMESABASESRCS = \ + $(MESABUILDDIR)api_arrayelt.c \ + $(MESABUILDDIR)api_loopback.c \ + $(MESABUILDDIR)api_noop.c \ + $(MESABUILDDIR)api_validate.c \ + $(MESABUILDDIR)accum.c \ + $(MESABUILDDIR)attrib.c \ + $(MESABUILDDIR)blend.c \ + $(MESABUILDDIR)bufferobj.c \ + $(MESABUILDDIR)buffers.c \ + $(MESABUILDDIR)clip.c \ + $(MESABUILDDIR)colortab.c \ + $(MESABUILDDIR)context.c \ + $(MESABUILDDIR)convolve.c \ + $(MESABUILDDIR)debug.c \ + $(MESABUILDDIR)depth.c \ + $(MESABUILDDIR)dlist.c \ + $(MESABUILDDIR)drawpix.c \ + $(MESABUILDDIR)enable.c \ + $(MESABUILDDIR)enums.c \ + $(MESABUILDDIR)eval.c \ + $(MESABUILDDIR)execmem.c \ + $(MESABUILDDIR)extensions.c \ + $(MESABUILDDIR)feedback.c \ + $(MESABUILDDIR)fbobject.c \ + $(MESABUILDDIR)fog.c \ + $(MESABUILDDIR)framebuffer.c \ + $(MESABUILDDIR)get.c \ + $(MESABUILDDIR)getstring.c \ + $(MESABUILDDIR)hash.c \ + $(MESABUILDDIR)hint.c \ + $(MESABUILDDIR)histogram.c \ + $(MESABUILDDIR)image.c \ + $(MESABUILDDIR)imports.c \ + $(MESABUILDDIR)light.c \ + $(MESABUILDDIR)lines.c \ + $(MESABUILDDIR)matrix.c \ + $(MESABUILDDIR)mm.c \ + $(MESABUILDDIR)occlude.c \ + $(MESABUILDDIR)pixel.c \ + $(MESABUILDDIR)points.c \ + $(MESABUILDDIR)polygon.c \ + $(MESABUILDDIR)rastpos.c \ + $(MESABUILDDIR)renderbuffer.c \ + $(MESABUILDDIR)state.c \ + $(MESABUILDDIR)stencil.c \ + $(MESABUILDDIR)texcompress.c \ + $(MESABUILDDIR)texcompress_fxt1.c \ + $(MESABUILDDIR)texcompress_s3tc.c \ + $(MESABUILDDIR)texenvprogram.c \ + $(MESABUILDDIR)texformat.c \ + $(MESABUILDDIR)teximage.c \ + $(MESABUILDDIR)texobj.c \ + $(MESABUILDDIR)texrender.c \ + $(MESABUILDDIR)texstate.c \ + $(MESABUILDDIR)texstore.c \ + $(MESABUILDDIR)varray.c \ + $(MESABUILDDIR)vtxfmt.c + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(api_arrayelt.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(api_arrayelt.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(api_eval.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(api_loopback.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(api_loopback.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(api_noop.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(api_noop.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(api_validate.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(api_validate.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(accum.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(accum.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(attrib.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(attrib.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(blend.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(blend.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(bufferobj.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(bufferobj.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(buffers.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(buffers.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(clip.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(clip.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(colormac.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(colortab.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(colortab.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(config.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(context.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(context.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(convolve.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(convolve.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(dd.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(debug.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(debug.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(depth.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(depth.h, $(MESASRCDIR)/src/mesa/main) +#ifdef NeedAllMesaSrc +LinkSourceFile(dispatch.c, $(MESASRCDIR)/src/mesa/main) +#endif +LinkSourceFile(dlist.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(dlist.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(drawpix.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(drawpix.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(enable.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(enable.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(enums.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(enums.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(eval.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(eval.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(execmem.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(extensions.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(extensions.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(fbobject.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(fbobject.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(feedback.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(feedback.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(fog.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(fog.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(framebuffer.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(framebuffer.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(get.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(get.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(getstring.c, $(MESASRCDIR)/src/mesa/main) +#ifdef NeedAllMesaSrc +LinkSourceFile(glapi.c, $(MESASRCDIR)/src/mesa/glapi) +LinkSourceFile(glthread.c, $(MESASRCDIR)/src/mesa/glapi) +#endif +LinkSourceFile(glheader.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(hash.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(hash.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(hint.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(hint.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(histogram.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(histogram.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(image.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(image.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(imports.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(imports.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(light.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(light.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(lines.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(lines.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(macros.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(matrix.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(matrix.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(mm.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(mm.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(mtypes.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(occlude.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(occlude.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(pixel.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(pixel.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(points.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(points.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(polygon.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(polygon.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(rastpos.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(rastpos.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(renderbuffer.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(renderbuffer.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(simple_list.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(state.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(state.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(stencil.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(stencil.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texcompress.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texcompress_fxt1.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texcompress_s3tc.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texcompress.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texenvprogram.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texenvprogram.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texformat.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texformat.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texformat_tmp.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(teximage.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(teximage.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texobj.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texobj.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texrender.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texrender.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texstate.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texstate.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texstore.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(texstore.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(varray.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(varray.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(version.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(vtxfmt.c, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(vtxfmt.h, $(MESASRCDIR)/src/mesa/main) +LinkSourceFile(vtxfmt_tmp.h, $(MESASRCDIR)/src/mesa/main) +#endif + +#ifdef NeedAllMesaSrc + DISPATCHOBJS = $(MESABUILDDIR)dispatch.o + GLAPIOBJS = $(MESABUILDDIR)glapi.o + GLTHREADOBJS = $(MESABUILDDIR)glthread.o +#endif + +COREMESABASEOBJS = \ + $(DISPATCHOBJS) \ + $(GLAPIOBJS) \ + $(GLTHREADOBJS) \ + $(MESABUILDDIR)api_arrayelt.o \ + $(MESABUILDDIR)api_loopback.o \ + $(MESABUILDDIR)api_noop.o \ + $(MESABUILDDIR)api_validate.o \ + $(MESABUILDDIR)accum.o \ + $(MESABUILDDIR)attrib.o \ + $(MESABUILDDIR)blend.o \ + $(MESABUILDDIR)bufferobj.o \ + $(MESABUILDDIR)buffers.o \ + $(MESABUILDDIR)clip.o \ + $(MESABUILDDIR)colortab.o \ + $(MESABUILDDIR)context.o \ + $(MESABUILDDIR)convolve.o \ + $(MESABUILDDIR)debug.o \ + $(MESABUILDDIR)depth.o \ + $(MESABUILDDIR)dlist.o \ + $(MESABUILDDIR)drawpix.o \ + $(MESABUILDDIR)enable.o \ + $(MESABUILDDIR)enums.o \ + $(MESABUILDDIR)eval.o \ + $(MESABUILDDIR)execmem.o \ + $(MESABUILDDIR)extensions.o \ + $(MESABUILDDIR)fbobject.o \ + $(MESABUILDDIR)feedback.o \ + $(MESABUILDDIR)fog.o \ + $(MESABUILDDIR)framebuffer.o \ + $(MESABUILDDIR)get.o \ + $(MESABUILDDIR)getstring.o \ + $(MESABUILDDIR)hash.o \ + $(MESABUILDDIR)hint.o \ + $(MESABUILDDIR)histogram.o \ + $(MESABUILDDIR)image.o \ + $(MESABUILDDIR)imports.o \ + $(MESABUILDDIR)light.o \ + $(MESABUILDDIR)lines.o \ + $(MESABUILDDIR)matrix.o \ + $(MESABUILDDIR)mm.o \ + $(MESABUILDDIR)occlude.o \ + $(MESABUILDDIR)pixel.o \ + $(MESABUILDDIR)points.o \ + $(MESABUILDDIR)polygon.o \ + $(MESABUILDDIR)rastpos.o \ + $(MESABUILDDIR)renderbuffer.o \ + $(MESABUILDDIR)state.o \ + $(MESABUILDDIR)stencil.o \ + $(MESABUILDDIR)texcompress.o \ + $(MESABUILDDIR)texcompress_fxt1.o \ + $(MESABUILDDIR)texcompress_s3tc.o \ + $(MESABUILDDIR)texenvprogram.o \ + $(MESABUILDDIR)texformat.o \ + $(MESABUILDDIR)teximage.o \ + $(MESABUILDDIR)texrender.o \ + $(MESABUILDDIR)texobj.o \ + $(MESABUILDDIR)texstate.o \ + $(MESABUILDDIR)texstore.o \ + $(MESABUILDDIR)varray.o \ + $(MESABUILDDIR)vtxfmt.o + +#ifdef NeedAllMesaSrc + DISPATCHUOBJS = $(MESABUILDDIR)unshared/dispatch.o + GLAPIUOBJS = $(MESABUILDDIR)unshared/glapi.o + GLTHREADUOBJS = $(MESABUILDDIR)unshared/glthread.o +#endif + +#if defined(DoSharedLib) && DoSharedLib +COREMESABASEUOBJS = \ + $(DISPATCHUOBJS) \ + $(GLAPIUOBJS) \ + $(GLTHREADUOBJS) \ + $(MESABUILDDIR)unshared/api_arrayelt.o \ + $(MESABUILDDIR)unshared/api_loopback.o \ + $(MESABUILDDIR)unshared/api_noop.o \ + $(MESABUILDDIR)unshared/api_validate.o \ + $(MESABUILDDIR)unshared/accum.o \ + $(MESABUILDDIR)unshared/attrib.o \ + $(MESABUILDDIR)unshared/blend.o \ + $(MESABUILDDIR)unshared/bufferobj.o \ + $(MESABUILDDIR)unshared/buffers.o \ + $(MESABUILDDIR)unshared/clip.o \ + $(MESABUILDDIR)unshared/colortab.o \ + $(MESABUILDDIR)unshared/context.o \ + $(MESABUILDDIR)unshared/convolve.o \ + $(MESABUILDDIR)unshared/debug.o \ + $(MESABUILDDIR)unshared/depth.o \ + $(MESABUILDDIR)unshared/dlist.o \ + $(MESABUILDDIR)unshared/drawpix.o \ + $(MESABUILDDIR)unshared/enable.o \ + $(MESABUILDDIR)unshared/enums.o \ + $(MESABUILDDIR)unshared/eval.o \ + $(MESABUILDDIR)unshared/execmem.o \ + $(MESABUILDDIR)unshared/extensions.o \ + $(MESABUILDDIR)unshared/fbobject.o \ + $(MESABUILDDIR)unshared/feedback.o \ + $(MESABUILDDIR)unshared/fog.o \ + $(MESABUILDDIR)unshared/framebuffer.o \ + $(MESABUILDDIR)unshared/get.o \ + $(MESABUILDDIR)unshared/getstring.o \ + $(MESABUILDDIR)unshared/hash.o \ + $(MESABUILDDIR)unshared/hint.o \ + $(MESABUILDDIR)unshared/histogram.o \ + $(MESABUILDDIR)unshared/image.o \ + $(MESABUILDDIR)unshared/imports.o \ + $(MESABUILDDIR)unshared/light.o \ + $(MESABUILDDIR)unshared/lines.o \ + $(MESABUILDDIR)unshared/matrix.o \ + $(MESABUILDDIR)unshared/mm.o \ + $(MESABUILDDIR)unshared/occlude.o \ + $(MESABUILDDIR)unshared/pixel.o \ + $(MESABUILDDIR)unshared/points.o \ + $(MESABUILDDIR)unshared/polygon.o \ + $(MESABUILDDIR)unshared/rastpos.o \ + $(MESABUILDDIR)unshared/renderbuffer.o \ + $(MESABUILDDIR)unshared/state.o \ + $(MESABUILDDIR)unshared/stencil.o \ + $(MESABUILDDIR)unshared/texcompress.o \ + $(MESABUILDDIR)unshared/texcompress_fxt1.o \ + $(MESABUILDDIR)unshared/texcompress_s3tc.o \ + $(MESABUILDDIR)unshared/texenvprogram.o \ + $(MESABUILDDIR)unshared/texformat.o \ + $(MESABUILDDIR)unshared/teximage.o \ + $(MESABUILDDIR)unshared/texobj.o \ + $(MESABUILDDIR)unshared/texrender.o \ + $(MESABUILDDIR)unshared/texstate.o \ + $(MESABUILDDIR)unshared/texstore.o \ + $(MESABUILDDIR)unshared/varray.o \ + $(MESABUILDDIR)unshared/vtxfmt.o +#else +COREMESABASEUOBJS = $(COREMESABASEOBJS) +#endif + +#ifdef NeedAllMesaSrc + DISPATCHDOBJS = $(MESABUILDDIR)debugger/dispatch.o + GLAPIDOBJS = $(MESABUILDDIR)debugger/glapi.o + GLTHREADDOBJS = $(MESABUILDDIR)debugger/glthread.o +#endif + +COREMESABASEDOBJS = \ + $(DISPATCHDOBJS) \ + $(GLAPIDOBJS) \ + $(GLTHREADDOBJS) \ + $(MESABUILDDIR)debugger/api_arrayelt.o \ + $(MESABUILDDIR)debugger/api_loopback.o \ + $(MESABUILDDIR)debugger/api_noop.o \ + $(MESABUILDDIR)debugger/api_validate.o \ + $(MESABUILDDIR)debugger/accum.o \ + $(MESABUILDDIR)debugger/attrib.o \ + $(MESABUILDDIR)debugger/blend.o \ + $(MESABUILDDIR)debugger/bufferobj.o \ + $(MESABUILDDIR)debugger/buffers.o \ + $(MESABUILDDIR)debugger/clip.o \ + $(MESABUILDDIR)debugger/colortab.o \ + $(MESABUILDDIR)debugger/context.o \ + $(MESABUILDDIR)debugger/convolve.o \ + $(MESABUILDDIR)debugger/debug.o \ + $(MESABUILDDIR)debugger/depth.o \ + $(MESABUILDDIR)debugger/dlist.o \ + $(MESABUILDDIR)debugger/drawpix.o \ + $(MESABUILDDIR)debugger/enable.o \ + $(MESABUILDDIR)debugger/enums.o \ + $(MESABUILDDIR)debugger/eval.o \ + $(MESABUILDDIR)debugger/execmem.o \ + $(MESABUILDDIR)debugger/extensions.o \ + $(MESABUILDDIR)debugger/fbobject.o \ + $(MESABUILDDIR)debugger/feedback.o \ + $(MESABUILDDIR)debugger/fog.o \ + $(MESABUILDDIR)debugger/framebuffer.o \ + $(MESABUILDDIR)debugger/get.o \ + $(MESABUILDDIR)debugger/getstring.o \ + $(MESABUILDDIR)debugger/hash.o \ + $(MESABUILDDIR)debugger/hint.o \ + $(MESABUILDDIR)debugger/histogram.o \ + $(MESABUILDDIR)debugger/image.o \ + $(MESABUILDDIR)debugger/imports.o \ + $(MESABUILDDIR)debugger/light.o \ + $(MESABUILDDIR)debugger/lines.o \ + $(MESABUILDDIR)debugger/matrix.o \ + $(MESABUILDDIR)debugger/mm.o \ + $(MESABUILDDIR)debugger/occlude.o \ + $(MESABUILDDIR)debugger/pixel.o \ + $(MESABUILDDIR)debugger/points.o \ + $(MESABUILDDIR)debugger/polygon.o \ + $(MESABUILDDIR)debugger/rastpos.o \ + $(MESABUILDDIR)debugger/renderbuffer.o \ + $(MESABUILDDIR)debugger/state.o \ + $(MESABUILDDIR)debugger/stencil.o \ + $(MESABUILDDIR)debugger/texcompress.o \ + $(MESABUILDDIR)debugger/texcompress_fxt1.o \ + $(MESABUILDDIR)debugger/texcompress_s3tc.o \ + $(MESABUILDDIR)debugger/texenvprogram.o \ + $(MESABUILDDIR)debugger/texformat.o \ + $(MESABUILDDIR)debugger/teximage.o \ + $(MESABUILDDIR)debugger/texobj.o \ + $(MESABUILDDIR)debugger/texrender.o \ + $(MESABUILDDIR)debugger/texstate.o \ + $(MESABUILDDIR)debugger/texstore.o \ + $(MESABUILDDIR)debugger/varray.o \ + $(MESABUILDDIR)debugger/vtxfmt.o + +#ifdef NeedAllMesaSrc + DISPATCHPOBJS = $(MESABUILDDIR)profiled/dispatch.o + GLAPIPOBJS = $(MESABUILDDIR)profiled/glapi.o + GLTHREADPOBJS = $(MESABUILDDIR)profiled/glthread.o +#endif + +COREMESABASEPOBJS = \ + $(DISPATCHPOBJS) \ + $(GLAPIPOBJS) \ + $(GLTHREADPOBJS) \ + $(MESABUILDDIR)profiled/api_arrayelt.o \ + $(MESABUILDDIR)profiled/api_loopback.o \ + $(MESABUILDDIR)profiled/api_noop.o \ + $(MESABUILDDIR)profiled/api_validate.o \ + $(MESABUILDDIR)profiled/accum.o \ + $(MESABUILDDIR)profiled/attrib.o \ + $(MESABUILDDIR)profiled/blend.o \ + $(MESABUILDDIR)profiled/bufferobj.o \ + $(MESABUILDDIR)profiled/buffers.o \ + $(MESABUILDDIR)profiled/clip.o \ + $(MESABUILDDIR)profiled/colortab.o \ + $(MESABUILDDIR)profiled/context.o \ + $(MESABUILDDIR)profiled/convolve.o \ + $(MESABUILDDIR)profiled/debug.o \ + $(MESABUILDDIR)profiled/depth.o \ + $(MESABUILDDIR)profiled/dlist.o \ + $(MESABUILDDIR)profiled/drawpix.o \ + $(MESABUILDDIR)profiled/enable.o \ + $(MESABUILDDIR)profiled/enums.o \ + $(MESABUILDDIR)profiled/eval.o \ + $(MESABUILDDIR)profiled/execmem.o \ + $(MESABUILDDIR)profiled/extensions.o \ + $(MESABUILDDIR)profiled/fbobject.o \ + $(MESABUILDDIR)profiled/feedback.o \ + $(MESABUILDDIR)profiled/fog.o \ + $(MESABUILDDIR)profiled/framebuffer.o \ + $(MESABUILDDIR)profiled/get.o \ + $(MESABUILDDIR)profiled/getstring.o \ + $(MESABUILDDIR)profiled/hash.o \ + $(MESABUILDDIR)profiled/hint.o \ + $(MESABUILDDIR)profiled/histogram.o \ + $(MESABUILDDIR)profiled/image.o \ + $(MESABUILDDIR)profiled/imports.o \ + $(MESABUILDDIR)profiled/light.o \ + $(MESABUILDDIR)profiled/lines.o \ + $(MESABUILDDIR)profiled/matrix.o \ + $(MESABUILDDIR)profiled/mm.o \ + $(MESABUILDDIR)profiled/occlude.o \ + $(MESABUILDDIR)profiled/pixel.o \ + $(MESABUILDDIR)profiled/points.o \ + $(MESABUILDDIR)profiled/polygon.o \ + $(MESABUILDDIR)profiled/rastpos.o \ + $(MESABUILDDIR)profiled/renderbuffer.o \ + $(MESABUILDDIR)profiled/state.o \ + $(MESABUILDDIR)profiled/stencil.o \ + $(MESABUILDDIR)profiled/texcompress.o \ + $(MESABUILDDIR)profiled/texcompress_fxt1.o \ + $(MESABUILDDIR)profiled/texcompress_s3tc.o \ + $(MESABUILDDIR)profiled/texenvprogram.o \ + $(MESABUILDDIR)profiled/texformat.o \ + $(MESABUILDDIR)profiled/teximage.o \ + $(MESABUILDDIR)profiled/texobj.o \ + $(MESABUILDDIR)profiled/texrender.o \ + $(MESABUILDDIR)profiled/texstate.o \ + $(MESABUILDDIR)profiled/texstore.o \ + $(MESABUILDDIR)profiled/varray.o \ + $(MESABUILDDIR)profiled/vtxfmt.o diff --git a/nx-X11/programs/Xserver/GL/mesa/main/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/main/module/Imakefile deleted file mode 100644 index e21afd5e5..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/main/module/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/module/Imakefile,v 1.1 2002/05/31 18:12:40 dawes Exp $ - -#define IHaveModules - -#include "../Imakefile" - diff --git a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile index 49720974c..9f1ab6b44 100644 --- a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile @@ -1,12 +1,7 @@ XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif #include @@ -14,11 +9,7 @@ SUBDIRS = module #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaMathBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/math/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/math/Imakefile.inc" -#endif +#include "Imakefile.inc" SRCS = $(MESA_MATH_SRCS) OBJS = $(MESA_MATH_OBJS) diff --git a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc new file mode 100644 index 000000000..cd1dcc427 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc @@ -0,0 +1,82 @@ +XCOMM $XFree86: xc/lib/GL/mesa/src/math/Imakefile.inc,v 1.1tsi Exp $ + +#ifndef MesaMathBuildDir +#define MesaMathBuildDir $(GLXLIBSRC)/mesa/math/ +#endif + +MESAMATHBUILDDIR = MesaMathBuildDir + + MESA_MATH_SRCS = $(MESAMATHBUILDDIR)m_debug_clip.c \ + $(MESAMATHBUILDDIR)m_debug_norm.c \ + $(MESAMATHBUILDDIR)m_debug_xform.c \ + $(MESAMATHBUILDDIR)m_eval.c \ + $(MESAMATHBUILDDIR)m_matrix.c \ + $(MESAMATHBUILDDIR)m_translate.c \ + $(MESAMATHBUILDDIR)m_vector.c \ + $(MESAMATHBUILDDIR)m_xform.c + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(mathmod.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_clip_tmp.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_copy_tmp.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_debug_clip.c, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_debug.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_debug_util.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_debug_norm.c, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_debug_xform.c, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_dotprod_tmp.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_eval.c, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_eval.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_matrix.c, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_matrix.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_norm_tmp.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_translate.c, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_translate.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_trans_tmp.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_vector.c, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_vector.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_xform.c, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_xform.h, $(MESASRCDIR)/src/mesa/math) +LinkSourceFile(m_xform_tmp.h, $(MESASRCDIR)/src/mesa/math) +#endif + + MESA_MATH_OBJS = $(MESAMATHBUILDDIR)m_debug_clip.o \ + $(MESAMATHBUILDDIR)m_debug_norm.o \ + $(MESAMATHBUILDDIR)m_debug_xform.o \ + $(MESAMATHBUILDDIR)m_eval.o \ + $(MESAMATHBUILDDIR)m_matrix.o \ + $(MESAMATHBUILDDIR)m_translate.o \ + $(MESAMATHBUILDDIR)m_vector.o \ + $(MESAMATHBUILDDIR)m_xform.o + +#if defined(DoSharedLib) && DoSharedLib + MESA_MATH_UOBJS = $(MESAMATHBUILDDIR)unshared/m_debug_clip.o \ + $(MESAMATHBUILDDIR)unshared/m_debug_norm.o \ + $(MESAMATHBUILDDIR)unshared/m_debug_xform.o \ + $(MESAMATHBUILDDIR)unshared/m_eval.o \ + $(MESAMATHBUILDDIR)unshared/m_matrix.o \ + $(MESAMATHBUILDDIR)unshared/m_translate.o \ + $(MESAMATHBUILDDIR)unshared/m_vector.o \ + $(MESAMATHBUILDDIR)unshared/m_xform.o +#else + MATH_MESA_UOBJS = $(MESA_MATH_OBJS) +#endif + + MESA_MATH_DOBJS = $(MESAMATHBUILDDIR)debugger/m_debug_clip.o \ + $(MESAMATHBUILDDIR)debugger/m_debug_norm.o \ + $(MESAMATHBUILDDIR)debugger/m_debug_xform.o \ + $(MESAMATHBUILDDIR)debugger/m_eval.o \ + $(MESAMATHBUILDDIR)debugger/m_matrix.o \ + $(MESAMATHBUILDDIR)debugger/m_translate.o \ + $(MESAMATHBUILDDIR)debugger/m_vector.o \ + $(MESAMATHBUILDDIR)debugger/m_xform.o + + MESA_MATH_POBJS = $(MESAMATHBUILDDIR)profiled/m_debug_clip.o \ + $(MESAMATHBUILDDIR)profiled/m_debug_norm.o \ + $(MESAMATHBUILDDIR)profiled/m_debug_xform.o \ + $(MESAMATHBUILDDIR)profiled/m_eval.o \ + $(MESAMATHBUILDDIR)profiled/m_matrix.o \ + $(MESAMATHBUILDDIR)profiled/m_translate.o \ + $(MESAMATHBUILDDIR)profiled/m_vector.o \ + $(MESAMATHBUILDDIR)profiled/m_xform.o + diff --git a/nx-X11/programs/Xserver/GL/mesa/math/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/math/module/Imakefile deleted file mode 100644 index e21afd5e5..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/math/module/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/module/Imakefile,v 1.1 2002/05/31 18:12:40 dawes Exp $ - -#define IHaveModules - -#include "../Imakefile" - diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile index 7b14ab7b9..6129d71b9 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile @@ -1,27 +1,16 @@ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif -#if !defined(IHaveModules) || !BuildModuleInSubdir #define IHaveSubdirs SUBDIRS = grammar slang -#endif #include #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaShaderBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/shader/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/shader/Imakefile.inc" -#endif +#include "Imakefile.inc" SRCS = $(MESA_SHADER_SRCS) OBJS = $(MESA_SHADER_OBJS) diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc new file mode 100644 index 000000000..7d0032e56 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc @@ -0,0 +1,106 @@ +XCOMM $XFree86:$ + +#ifndef MesaShaderBuildDir +#define MesaShaderBuildDir $(GLXLIBSRC)/mesa/shader/ +#endif + +MESASHADERBUILDDIR = MesaShaderBuildDir + + MESA_SHADER_SRCS = $(MESASHADERBUILDDIR)arbprogparse.c \ + $(MESASHADERBUILDDIR)arbprogram.c \ + $(MESASHADERBUILDDIR)arbfragparse.c \ + $(MESASHADERBUILDDIR)arbvertparse.c \ + $(MESASHADERBUILDDIR)atifragshader.c \ + $(MESASHADERBUILDDIR)nvprogram.c \ + $(MESASHADERBUILDDIR)nvfragparse.c \ + $(MESASHADERBUILDDIR)nvvertexec.c \ + $(MESASHADERBUILDDIR)nvvertparse.c \ + $(MESASHADERBUILDDIR)program.c \ + $(MESASHADERBUILDDIR)shaderobjects.c \ + $(MESASHADERBUILDDIR)shaderobjects_3dlabs.c + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(arbprogparse.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(arbprogram.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(arbfragparse.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(arbvertparse.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(arbfragparse.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(arbprogparse.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(arbprogram.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(arbprogram_syn.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(arbvertparse.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(atifragshader.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(atifragshader.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvfragparse.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvfragprog.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvprogram.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvprogram.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvfragparse.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvvertexec.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvvertexec.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvvertparse.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvvertparse.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(nvvertprog.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(program.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(program.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(shaderobjects.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(shaderobjects.h, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(shaderobjects_3dlabs.c, $(MESASRCDIR)/src/mesa/shader) +LinkSourceFile(shaderobjects_3dlabs.h, $(MESASRCDIR)/src/mesa/shader) +#endif + + MESA_SHADER_OBJS = $(MESASHADERBUILDDIR)arbprogparse.o \ + $(MESASHADERBUILDDIR)arbprogram.o \ + $(MESASHADERBUILDDIR)arbfragparse.o \ + $(MESASHADERBUILDDIR)arbvertparse.o \ + $(MESASHADERBUILDDIR)atifragshader.o \ + $(MESASHADERBUILDDIR)nvprogram.o \ + $(MESASHADERBUILDDIR)nvfragparse.o \ + $(MESASHADERBUILDDIR)nvvertexec.o \ + $(MESASHADERBUILDDIR)nvvertparse.o \ + $(MESASHADERBUILDDIR)program.o \ + $(MESASHADERBUILDDIR)shaderobjects.o \ + $(MESASHADERBUILDDIR)shaderobjects_3dlabs.o + +#if defined(DoSharedLib) && DoSharedLib + MESA_SHADER_UOBJS = $(MESASHADERBUILDDIR)unshared/arbprogparse.o \ + $(MESASHADERBUILDDIR)unshared/arbprogram.o \ + $(MESASHADERBUILDDIR)unshared/arbfragparse.o \ + $(MESASHADERBUILDDIR)unshared/arbvertparse.o \ + $(MESASHADERBUILDDIR)unshared/atifragshader.o \ + $(MESASHADERBUILDDIR)unshared/nvprogram.o \ + $(MESASHADERBUILDDIR)unshared/nvfragparse.o \ + $(MESASHADERBUILDDIR)unshared/nvvertexec.o \ + $(MESASHADERBUILDDIR)unshared/nvvertparse.o \ + $(MESASHADERBUILDDIR)unshared/program.o \ + $(MESASHADERBUILDDIR)unshared/shaderobjects.o \ + $(MESASHADERBUILDDIR)unshared/shaderobjects_3dlabs.o +#else + MESA_SHADER_UOBJS = $(MESA_SHADER_OBJS) +#endif + + MESA_SHADER_DOBJS = $(MESASHADERBUILDDIR)debugger/arbprogparse.o \ + $(MESASHADERBUILDDIR)debugger/arbprogram.o \ + $(MESASHADERBUILDDIR)debugger/arbfragparse.o \ + $(MESASHADERBUILDDIR)debugger/arbvertparse.o \ + $(MESASHADERBUILDDIR)debugger/atifragshader.o \ + $(MESASHADERBUILDDIR)debugger/nvprogram.o \ + $(MESASHADERBUILDDIR)debugger/nvfragparse.o \ + $(MESASHADERBUILDDIR)debugger/nvvertexec.o \ + $(MESASHADERBUILDDIR)debugger/nvvertparse.o \ + $(MESASHADERBUILDDIR)debugger/program.o \ + $(MESASHADERBUILDDIR)debugger/shaderobjects.o \ + $(MESASHADERBUILDDIR)debugger/shaderobjects_3dlabs.o + + MESA_SHADER_POBJS = $(MESASHADERBUILDDIR)profiled/arbprogparse.o \ + $(MESASHADERBUILDDIR)profiled/arbprogram.o \ + $(MESASHADERBUILDDIR)profiled/arbfragparse.o \ + $(MESASHADERBUILDDIR)profiled/arbvertparse.o \ + $(MESASHADERBUILDDIR)profiled/atifragshader.o \ + $(MESASHADERBUILDDIR)profiled/nvprogram.o \ + $(MESASHADERBUILDDIR)profiled/nvfragparse.o \ + $(MESASHADERBUILDDIR)profiled/nvvertexec.o \ + $(MESASHADERBUILDDIR)profiled/nvvertparse.o \ + $(MESASHADERBUILDDIR)profiled/program.o \ + $(MESASHADERBUILDDIR)profiled/shaderobjects.o \ + $(MESASHADERBUILDDIR)profiled/shaderobjects_3dlabs.o diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile index c16b3ddad..d975ec73c 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile @@ -1,10 +1,5 @@ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif #include @@ -12,11 +7,7 @@ SUBDIRS = module #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaGrammarBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../../lib/GL/mesa/shader/grammar/Imakefile.inc" -#else -#include "../../../../../../../lib/GL/mesa/shader/grammar/Imakefile.inc" -#endif +#include "Imakefile.inc" SRCS = $(MESA_GRAMMAR_SRCS) OBJS = $(MESA_GRAMMAR_OBJS) diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc new file mode 100644 index 000000000..b2e885f89 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc @@ -0,0 +1,29 @@ +XCOMM $XFree86$ + +#ifndef MesaGrammarBuildDir +#define MesaGrammarBuildDir $(GLXLIBSRC)/mesa/shader/grammar/ +#endif + +MESAGRAMMARBUILDDIR=MesaGrammarBuildDir + + MESA_GRAMMAR_SRCS = $(MESAGRAMMARBUILDDIR)grammar_mesa.c + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(grammar.c, $(MESASRCDIR)/src/mesa/shader/grammar) +LinkSourceFile(grammar.h, $(MESASRCDIR)/src/mesa/shader/grammar) +LinkSourceFile(grammar_syn.h, $(MESASRCDIR)/src/mesa/shader/grammar) +LinkSourceFile(grammar_mesa.c, $(MESASRCDIR)/src/mesa/shader/grammar) +LinkSourceFile(grammar_mesa.h, $(MESASRCDIR)/src/mesa/shader/grammar) +#endif + + MESA_GRAMMAR_OBJS = $(MESAGRAMMARBUILDDIR)grammar_mesa.o + +#if defined(DoSharedLib) && DoSharedLib + MESA_GRAMMAR_UOBJS = $(MESAGRAMMARBUILDDIR)unshared/grammar_mesa.o +#else + MESA_GRAMMAR_UOBJS = $(MESA_GRAMMAR_OBJS) +#endif + + MESA_GRAMMAR_DOBJS = $(MESAGRAMMARBUILDDIR)debugger/grammar_mesa.o + + MESA_GRAMMAR_POBJS = $(MESAGRAMMARBUILDDIR)profiled/grammar_mesa.o diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile index 0bee2b774..da3fbc703 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile @@ -1,27 +1,16 @@ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif -#if !defined(IHaveModules) || !BuildModuleInSubdir #define IHaveSubdirs SUBDIRS = library -#endif #include #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaSlangBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../../lib/GL/mesa/shader/slang/Imakefile.inc" -#else -#include "../../../../../../../lib/GL/mesa/shader/slang/Imakefile.inc" -#endif +#include "Imakefile.inc" SRCS = $(MESA_SLANG_SRCS) OBJS = $(MESA_SLANG_OBJS) diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc new file mode 100644 index 000000000..d824ca797 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc @@ -0,0 +1,90 @@ +XCOMM $XFree86$ + +#ifndef MesaSlangBuildDir +#define MesaSlangBuildDir $(GLXLIBSRC)/mesa/shader/slang/ +#endif + +MESASLANGBUILDDIR=MesaSlangBuildDir + + MESA_SLANG_SRCS = $(MESASLANGBUILDDIR)slang_assemble_assignment.c \ + $(MESASLANGBUILDDIR)slang_assemble.c \ + $(MESASLANGBUILDDIR)slang_assemble_conditional.c \ + $(MESASLANGBUILDDIR)slang_assemble_constructor.c \ + $(MESASLANGBUILDDIR)slang_assemble_typeinfo.c \ + $(MESASLANGBUILDDIR)slang_compile.c \ + $(MESASLANGBUILDDIR)slang_execute.c \ + $(MESASLANGBUILDDIR)slang_preprocess.c \ + $(MESASLANGBUILDDIR)slang_storage.c \ + $(MESASLANGBUILDDIR)slang_utility.c + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(slang_assemble_assignment.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_assemble_assignment.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_assemble.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_assemble.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_assemble_conditional.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_assemble_conditional.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_assemble_constructor.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_assemble_constructor.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_assemble_typeinfo.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_assemble_typeinfo.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_compile.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_compile.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_execute.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_execute.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_preprocess.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_preprocess.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_storage.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_storage.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_utility.c, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(slang_utility.h, $(MESASRCDIR)/src/mesa/shader/slang) +LinkSourceFile(traverse_wrap.h, $(MESASRCDIR)/src/mesa/shader/slang) +#endif + + MESA_SLANG_OBJS = $(MESASLANGBUILDDIR)slang_assemble_assignment.o \ + $(MESASLANGBUILDDIR)slang_assemble.o \ + $(MESASLANGBUILDDIR)slang_assemble_conditional.o \ + $(MESASLANGBUILDDIR)slang_assemble_constructor.o \ + $(MESASLANGBUILDDIR)slang_assemble_typeinfo.o \ + $(MESASLANGBUILDDIR)slang_compile.o \ + $(MESASLANGBUILDDIR)slang_execute.o \ + $(MESASLANGBUILDDIR)slang_preprocess.o \ + $(MESASLANGBUILDDIR)slang_storage.o \ + $(MESASLANGBUILDDIR)slang_utility.o + +#if defined(DoSharedLib) && DoSharedLib + MESA_SLANG_UOBJS = $(MESASLANGBUILDDIR)unshared/slang_assemble_assignment.o \ + $(MESASLANGBUILDDIR)unshared/slang_assemble.o \ + $(MESASLANGBUILDDIR)unshared/slang_assemble_conditional.o \ + $(MESASLANGBUILDDIR)unshared/slang_assemble_constructor.o \ + $(MESASLANGBUILDDIR)unshared/slang_assemble_typeinfo.o \ + $(MESASLANGBUILDDIR)unshared/slang_compile.o \ + $(MESASLANGBUILDDIR)unshared/slang_execute.o \ + $(MESASLANGBUILDDIR)unshared/slang_preprocess.o \ + $(MESASLANGBUILDDIR)unshared/slang_storage.o \ + $(MESASLANGBUILDDIR)unshared/slang_utility.o +#else + MESA_SLANG_UOBJS = $(MESA_SLANG_OBJS) +#endif + + MESA_SLANG_DOBJS = $(MESASLANGBUILDDIR)debuggerslang_assemble_assignment.o \ + $(MESASLANGBUILDDIR)debuggerslang_assemble.o \ + $(MESASLANGBUILDDIR)debuggerslang_assemble_conditional.o \ + $(MESASLANGBUILDDIR)debuggerslang_assemble_constructor.o \ + $(MESASLANGBUILDDIR)debuggerslang_assemble_typeinfo.o \ + $(MESASLANGBUILDDIR)debuggerslang_compile.o \ + $(MESASLANGBUILDDIR)debuggerslang_execute.o \ + $(MESASLANGBUILDDIR)debuggerslang_preprocess.o \ + $(MESASLANGBUILDDIR)debuggerslang_storage.o \ + $(MESASLANGBUILDDIR)debuggerslang_utility.o + + MESA_SLANG_POBJS = $(MESASLANGBUILDDIR)profiled/slang_assemble_assignment.o \ + $(MESASLANGBUILDDIR)profiled/slang_assemble.o \ + $(MESASLANGBUILDDIR)profiled/slang_assemble_conditional.o \ + $(MESASLANGBUILDDIR)profiled/slang_assemble_constructor.o \ + $(MESASLANGBUILDDIR)profiled/slang_assemble_typeinfo.o \ + $(MESASLANGBUILDDIR)profiled/slang_compile.o \ + $(MESASLANGBUILDDIR)profiled/slang_execute.o \ + $(MESASLANGBUILDDIR)profiled/slang_preprocess.o \ + $(MESASLANGBUILDDIR)profiled/slang_storage.o \ + $(MESASLANGBUILDDIR)profiled/slang_utility.o diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile index e332121c9..d6de08e1b 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile @@ -1,10 +1,5 @@ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif #include @@ -12,11 +7,7 @@ SUBDIRS = module #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaLibraryBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../../../lib/GL/mesa/shader/slang/library/Imakefile.inc" -#else -#include "../../../../../../../../lib/GL/mesa/shader/slang/library/Imakefile.inc" -#endif +#include "Imakefile.inc" INCLUDES = -I$(MESASRCDIR)/src/mesa \ -I$(MESASRCDIR)/src/mesa/shader \ diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile.inc new file mode 100644 index 000000000..3489b7a28 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile.inc @@ -0,0 +1,14 @@ +XCOMM $XFree86:$ + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(slang_common_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +LinkSourceFile(slang_common_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +LinkSourceFile(slang_core_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +LinkSourceFile(slang_core_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +LinkSourceFile(slang_fragment_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +LinkSourceFile(slang_fragment_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +LinkSourceFile(slang_shader_syn.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +LinkSourceFile(slang_version_syn.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +LinkSourceFile(slang_vertex_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +LinkSourceFile(slang_vertex_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library) +#endif diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile index 817fead69..46b22b6a1 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile @@ -1,12 +1,7 @@ XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif /* Large PIC tables needed for Solaris/SPARC builds */ @@ -19,11 +14,7 @@ SUBDIRS = module #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaSwrastBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/swrast/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/swrast/Imakefile.inc" -#endif +#include "Imakefile.inc" SRCS = $(MESA_SWRAST_SRCS) @@ -60,4 +51,3 @@ DependTarget() MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) #endif - diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc new file mode 100644 index 000000000..683b8f0a7 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc @@ -0,0 +1,218 @@ +XCOMM $XFree86: xc/lib/GL/mesa/src/swrast/Imakefile.inc,v 1.1tsi Exp $ + +#ifndef MesaSwrastBuildDir +#define MesaSwrastBuildDir $(GLXLIBSRC)/mesa/swrast/ +#endif + +MESASWRASTBUILDDIR = MesaSwrastBuildDir + + MESA_SWRAST_SRCS = $(MESASWRASTBUILDDIR)s_aaline.c \ + $(MESASWRASTBUILDDIR)s_aatriangle.c \ + $(MESASWRASTBUILDDIR)s_accum.c \ + $(MESASWRASTBUILDDIR)s_alpha.c \ + $(MESASWRASTBUILDDIR)s_atifragshader.c \ + $(MESASWRASTBUILDDIR)s_bitmap.c \ + $(MESASWRASTBUILDDIR)s_blend.c \ + $(MESASWRASTBUILDDIR)s_buffers.c \ + $(MESASWRASTBUILDDIR)s_context.c \ + $(MESASWRASTBUILDDIR)s_copypix.c \ + $(MESASWRASTBUILDDIR)s_depth.c \ + $(MESASWRASTBUILDDIR)s_drawpix.c \ + $(MESASWRASTBUILDDIR)s_feedback.c \ + $(MESASWRASTBUILDDIR)s_fog.c \ + $(MESASWRASTBUILDDIR)s_imaging.c \ + $(MESASWRASTBUILDDIR)s_lines.c \ + $(MESASWRASTBUILDDIR)s_logic.c \ + $(MESASWRASTBUILDDIR)s_masking.c \ + $(MESASWRASTBUILDDIR)s_nvfragprog.c \ + $(MESASWRASTBUILDDIR)s_pixeltex.c \ + $(MESASWRASTBUILDDIR)s_points.c \ + $(MESASWRASTBUILDDIR)s_readpix.c \ + $(MESASWRASTBUILDDIR)s_span.c \ + $(MESASWRASTBUILDDIR)s_stencil.c \ + $(MESASWRASTBUILDDIR)s_texstore.c \ + $(MESASWRASTBUILDDIR)s_texture.c \ + $(MESASWRASTBUILDDIR)s_triangle.c \ + $(MESASWRASTBUILDDIR)s_zoom.c + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(s_aaline.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_aaline.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_aalinetemp.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_aatriangle.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_aatriangle.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_aatritemp.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_accum.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_accum.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_alpha.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_alpha.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_atifragshader.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_atifragshader.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_bitmap.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_blend.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_blend.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_buffers.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_context.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_context.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_copypix.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_depth.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_depth.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_drawpix.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_drawpix.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_feedback.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_feedback.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_fog.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_fog.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_imaging.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_lines.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_lines.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_linetemp.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_logic.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_logic.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_masking.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_masking.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_nvfragprog.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_nvfragprog.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_pixeltex.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_pixeltex.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_points.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_points.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_pointtemp.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_readpix.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_span.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_span.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_spantemp.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_stencil.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_stencil.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_texstore.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_texture.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_texture.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_triangle.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_triangle.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_trispan.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_tritemp.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_zoom.c, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(s_zoom.h, $(MESASRCDIR)/src/mesa/swrast) +LinkSourceFile(swrast.h, $(MESASRCDIR)/src/mesa/swrast) +#endif + + MESA_SWRAST_OBJS = $(MESASWRASTBUILDDIR)s_aaline.o \ + $(MESASWRASTBUILDDIR)s_aatriangle.o \ + $(MESASWRASTBUILDDIR)s_accum.o \ + $(MESASWRASTBUILDDIR)s_alpha.o \ + $(MESASWRASTBUILDDIR)s_atifragshader.o \ + $(MESASWRASTBUILDDIR)s_bitmap.o \ + $(MESASWRASTBUILDDIR)s_blend.o \ + $(MESASWRASTBUILDDIR)s_buffers.o \ + $(MESASWRASTBUILDDIR)s_context.o \ + $(MESASWRASTBUILDDIR)s_copypix.o \ + $(MESASWRASTBUILDDIR)s_depth.o \ + $(MESASWRASTBUILDDIR)s_drawpix.o \ + $(MESASWRASTBUILDDIR)s_feedback.o \ + $(MESASWRASTBUILDDIR)s_fog.o \ + $(MESASWRASTBUILDDIR)s_imaging.o \ + $(MESASWRASTBUILDDIR)s_lines.o \ + $(MESASWRASTBUILDDIR)s_logic.o \ + $(MESASWRASTBUILDDIR)s_masking.o \ + $(MESASWRASTBUILDDIR)s_nvfragprog.o \ + $(MESASWRASTBUILDDIR)s_pixeltex.o \ + $(MESASWRASTBUILDDIR)s_points.o \ + $(MESASWRASTBUILDDIR)s_readpix.o \ + $(MESASWRASTBUILDDIR)s_span.o \ + $(MESASWRASTBUILDDIR)s_stencil.o \ + $(MESASWRASTBUILDDIR)s_texstore.o \ + $(MESASWRASTBUILDDIR)s_texture.o \ + $(MESASWRASTBUILDDIR)s_triangle.o \ + $(MESASWRASTBUILDDIR)s_zoom.o + +#if defined(DoSharedLib) && DoSharedLib + MESA_SWRAST_UOBJS = $(MESASWRASTBUILDDIR)unshared/s_aaline.o \ + $(MESASWRASTBUILDDIR)unshared/s_aatriangle.o \ + $(MESASWRASTBUILDDIR)unshared/s_accum.o \ + $(MESASWRASTBUILDDIR)unshared/s_alpha.o \ + $(MESASWRASTBUILDDIR)unshared/s_atifragshader.o \ + $(MESASWRASTBUILDDIR)unshared/s_bitmap.o \ + $(MESASWRASTBUILDDIR)unshared/s_blend.o \ + $(MESASWRASTBUILDDIR)unshared/s_buffers.o \ + $(MESASWRASTBUILDDIR)unshared/s_context.o \ + $(MESASWRASTBUILDDIR)unshared/s_copypix.o \ + $(MESASWRASTBUILDDIR)unshared/s_depth.o \ + $(MESASWRASTBUILDDIR)unshared/s_drawpix.o \ + $(MESASWRASTBUILDDIR)unshared/s_feedback.o \ + $(MESASWRASTBUILDDIR)unshared/s_fog.o \ + $(MESASWRASTBUILDDIR)unshared/s_imaging.o \ + $(MESASWRASTBUILDDIR)unshared/s_lines.o \ + $(MESASWRASTBUILDDIR)unshared/s_logic.o \ + $(MESASWRASTBUILDDIR)unshared/s_masking.o \ + $(MESASWRASTBUILDDIR)unshared/s_nvfragprog.o \ + $(MESASWRASTBUILDDIR)unshared/s_pixeltex.o \ + $(MESASWRASTBUILDDIR)unshared/s_points.o \ + $(MESASWRASTBUILDDIR)unshared/s_readpix.o \ + $(MESASWRASTBUILDDIR)unshared/s_span.o \ + $(MESASWRASTBUILDDIR)unshared/s_stencil.o \ + $(MESASWRASTBUILDDIR)unshared/s_texstore.o \ + $(MESASWRASTBUILDDIR)unshared/s_texture.o \ + $(MESASWRASTBUILDDIR)unshared/s_triangle.o \ + $(MESASWRASTBUILDDIR)unshared/s_zoom.o +#else + MESA_SWRAST_UOBJS = $(MESA_SWRAST_OBJS) +#endif + + MESA_SWRAST_DOBJS = $(MESASWRASTBUILDDIR)debugger/s_aaline.o \ + $(MESASWRASTBUILDDIR)debugger/s_aatriangle.o \ + $(MESASWRASTBUILDDIR)debugger/s_accum.o \ + $(MESASWRASTBUILDDIR)debugger/s_alpha.o \ + $(MESASWRASTBUILDDIR)debugger/s_atifragshader.o \ + $(MESASWRASTBUILDDIR)debugger/s_bitmap.o \ + $(MESASWRASTBUILDDIR)debugger/s_blend.o \ + $(MESASWRASTBUILDDIR)debugger/s_buffers.o \ + $(MESASWRASTBUILDDIR)debugger/s_context.o \ + $(MESASWRASTBUILDDIR)debugger/s_copypix.o \ + $(MESASWRASTBUILDDIR)debugger/s_depth.o \ + $(MESASWRASTBUILDDIR)debugger/s_drawpix.o \ + $(MESASWRASTBUILDDIR)debugger/s_feedback.o \ + $(MESASWRASTBUILDDIR)debugger/s_fog.o \ + $(MESASWRASTBUILDDIR)debugger/s_imaging.o \ + $(MESASWRASTBUILDDIR)debugger/s_lines.o \ + $(MESASWRASTBUILDDIR)debugger/s_logic.o \ + $(MESASWRASTBUILDDIR)debugger/s_masking.o \ + $(MESASWRASTBUILDDIR)debugger/s_nvfragprog.o \ + $(MESASWRASTBUILDDIR)debugger/s_pixeltex.o \ + $(MESASWRASTBUILDDIR)debugger/s_points.o \ + $(MESASWRASTBUILDDIR)debugger/s_readpix.o \ + $(MESASWRASTBUILDDIR)debugger/s_span.o \ + $(MESASWRASTBUILDDIR)debugger/s_stencil.o \ + $(MESASWRASTBUILDDIR)debugger/s_texstore.o \ + $(MESASWRASTBUILDDIR)debugger/s_texture.o \ + $(MESASWRASTBUILDDIR)debugger/s_triangle.o \ + $(MESASWRASTBUILDDIR)debugger/s_zoom.o + + MESA_SWRAST_POBJS = $(MESASWRASTBUILDDIR)profiled/s_aaline.o \ + $(MESASWRASTBUILDDIR)profiled/s_aatriangle.o \ + $(MESASWRASTBUILDDIR)profiled/s_accum.o \ + $(MESASWRASTBUILDDIR)profiled/s_alpha.o \ + $(MESASWRASTBUILDDIR)profiled/s_atifragshader.o \ + $(MESASWRASTBUILDDIR)profiled/s_bitmap.o \ + $(MESASWRASTBUILDDIR)profiled/s_blend.o \ + $(MESASWRASTBUILDDIR)profiled/s_buffers.o \ + $(MESASWRASTBUILDDIR)profiled/s_context.o \ + $(MESASWRASTBUILDDIR)profiled/s_copypix.o \ + $(MESASWRASTBUILDDIR)profiled/s_depth.o \ + $(MESASWRASTBUILDDIR)profiled/s_drawpix.o \ + $(MESASWRASTBUILDDIR)profiled/s_feedback.o \ + $(MESASWRASTBUILDDIR)profiled/s_fog.o \ + $(MESASWRASTBUILDDIR)profiled/s_imaging.o \ + $(MESASWRASTBUILDDIR)profiled/s_lines.o \ + $(MESASWRASTBUILDDIR)profiled/s_logic.o \ + $(MESASWRASTBUILDDIR)profiled/s_masking.o \ + $(MESASWRASTBUILDDIR)profiled/s_nvfragprog.o \ + $(MESASWRASTBUILDDIR)profiled/s_pixeltex.o \ + $(MESASWRASTBUILDDIR)profiled/s_points.o \ + $(MESASWRASTBUILDDIR)profiled/s_readpix.o \ + $(MESASWRASTBUILDDIR)profiled/s_span.o \ + $(MESASWRASTBUILDDIR)profiled/s_stencil.o \ + $(MESASWRASTBUILDDIR)profiled/s_texstore.o \ + $(MESASWRASTBUILDDIR)profiled/s_texture.o \ + $(MESASWRASTBUILDDIR)profiled/s_triangle.o \ + $(MESASWRASTBUILDDIR)profiled/s_zoom.o + diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast/module/Imakefile deleted file mode 100644 index 7d9974ed0..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/swrast/module/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast/module/Imakefile,v 1.1 2002/05/31 18:12:40 dawes Exp $ - -#define IHaveModules - -#include "../Imakefile" - diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile index b530457e9..992c4925c 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile @@ -1,12 +1,7 @@ XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast_setup/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif #include @@ -14,11 +9,7 @@ SUBDIRS = module #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaSwrastSetupBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/swrast_setup/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/swrast_setup/Imakefile.inc" -#endif +#include "Imakefile.inc" SRCS = $(MESA_SWR_SETUP_SRCS) OBJS = $(MESA_SWR_SETUP_OBJS) @@ -52,4 +43,3 @@ DependTarget() MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) #endif - diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc new file mode 100644 index 000000000..8d32aedb3 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc @@ -0,0 +1,36 @@ +XCOMM $XFree86: xc/lib/GL/mesa/src/swrast_setup/Imakefile.inc,v 1.1tsi Exp $ + +#ifndef MesaSwrastSetupBuildDir +#define MesaSwrastSetupBuildDir $(GLXLIBSRC)/mesa/swrast_setup/ +#endif + +MESASWRSETUPDIR = MesaSwrastSetupBuildDir + + MESA_SWR_SETUP_SRCS = $(MESASWRSETUPDIR)ss_context.c \ + $(MESASWRSETUPDIR)ss_triangle.c + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(ss_context.c, $(MESASRCDIR)/src/mesa/swrast_setup) +LinkSourceFile(ss_context.h, $(MESASRCDIR)/src/mesa/swrast_setup) +LinkSourceFile(ss_triangle.c, $(MESASRCDIR)/src/mesa/swrast_setup) +LinkSourceFile(ss_triangle.h, $(MESASRCDIR)/src/mesa/swrast_setup) +LinkSourceFile(ss_tritmp.h, $(MESASRCDIR)/src/mesa/swrast_setup) +LinkSourceFile(swrast_setup.h, $(MESASRCDIR)/src/mesa/swrast_setup) +#endif + + MESA_SWR_SETUP_OBJS = $(MESASWRSETUPDIR)ss_context.o \ + $(MESASWRSETUPDIR)ss_triangle.o + +#if defined(DoSharedLib) && DoSharedLib +MESA_SWR_SETUP_UOBJS = $(MESASWRSETUPDIR)unshared/ss_context.o \ + $(MESASWRSETUPDIR)unshared/ss_triangle.o +#else +MESA_SWR_SETUP_UOBJS = $(MESA_SWR_SETUP_OBJS) +#endif + +MESA_SWR_SETUP_DOBJS = $(MESASWRSETUPDIR)debugger/ss_context.o \ + $(MESASWRSETUPDIR)debugger/ss_triangle.o + +MESA_SWR_SETUP_POBJS = $(MESASWRSETUPDIR)profiled/ss_context.o \ + $(MESASWRSETUPDIR)profiled/ss_triangle.o + diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/module/Imakefile deleted file mode 100644 index 5221debc0..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/module/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast_setup/module/Imakefile,v 1.1 2002/05/31 18:12:41 dawes Exp $ - -#define IHaveModules - -#include "../Imakefile" - diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile index c52696e4f..5c87d1e97 100644 --- a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile @@ -2,12 +2,7 @@ XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/tnl/Imakefile,v 1.2 2004/08/19 07:34 XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/tnl/Imakefile,v 1.8 2002/11/22 22:56:02 tsi Exp $ #if DoLoadableServer -#if !BuildModuleInSubdir #define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif #endif /* Large PIC tables needed for Solaris/SPARC builds */ @@ -21,11 +16,7 @@ SUBDIRS = module #define NeedAllMesaSrc #define NeedToLinkMesaSrc #define MesaTnlBuildDir /**/ -#if !defined(IHaveModules) || !BuildModuleInSubdir -#include "../../../../../lib/GL/mesa/tnl/Imakefile.inc" -#else -#include "../../../../../../lib/GL/mesa/tnl/Imakefile.inc" -#endif +#include "Imakefile.inc" SRCS = $(MESA_TNL_SRCS) diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc new file mode 100644 index 000000000..a294a6fbf --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc @@ -0,0 +1,225 @@ +XCOMM $XFree86: xc/lib/GL/mesa/src/tnl/Imakefile.inc,v 1.1tsi Exp $ + +#ifndef MesaTnlBuildDir +#define MesaTnlBuildDir $(GLXLIBSRC)/mesa/tnl/ +#endif + +MESATNLBUILDDIR = MesaTnlBuildDir + + MESA_TNL_SRCS = $(MESATNLBUILDDIR)t_array_api.c \ + $(MESATNLBUILDDIR)t_array_import.c \ + $(MESATNLBUILDDIR)t_context.c \ + $(MESATNLBUILDDIR)t_pipeline.c \ + $(MESATNLBUILDDIR)t_save_api.c \ + $(MESATNLBUILDDIR)t_save_loopback.c \ + $(MESATNLBUILDDIR)t_save_playback.c \ + $(MESATNLBUILDDIR)t_vb_arbprogram.c \ + $(MESATNLBUILDDIR)t_vb_arbprogram_sse.c \ + $(MESATNLBUILDDIR)t_vb_fog.c \ + $(MESATNLBUILDDIR)t_vb_cull.c \ + $(MESATNLBUILDDIR)t_vb_light.c \ + $(MESATNLBUILDDIR)t_vb_normals.c \ + $(MESATNLBUILDDIR)t_vb_points.c \ + $(MESATNLBUILDDIR)t_vb_program.c \ + $(MESATNLBUILDDIR)t_vb_render.c \ + $(MESATNLBUILDDIR)t_vb_texgen.c \ + $(MESATNLBUILDDIR)t_vb_texmat.c \ + $(MESATNLBUILDDIR)t_vb_vertex.c \ + $(MESATNLBUILDDIR)t_vertex.c \ + $(MESATNLBUILDDIR)t_vertex_generic.c \ + $(MESATNLBUILDDIR)t_vertex_sse.c \ + $(MESATNLBUILDDIR)t_vp_build.c \ + $(MESATNLBUILDDIR)t_vtx_api.c \ + $(MESATNLBUILDDIR)t_vtx_eval.c \ + $(MESATNLBUILDDIR)t_vtx_exec.c \ + $(MESATNLBUILDDIR)t_vtx_generic.c + +#if defined(i386Architecture) && MesaUseX86Asm + MESA_TNL_SRCS += MesaTnlAsmSrcs $(MESATNLBUILDDIR)t_vtx_x86.c \ + $(MESATNLBUILDDIR)t_vtx_x86_gcc.S +#endif + +#ifdef NeedToLinkMesaSrc +LinkSourceFile(t_array_api.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_array_api.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_array_import.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_array_import.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_context.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_context.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(tnl.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_pipeline.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_pipeline.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_save_api.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_save_api.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_save_loopback.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_save_playback.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_arbprogram.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_arbprogram.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_arbprogram_sse.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_cliptmp.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_fog.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_cull.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_light.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_lighttmp.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_normals.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_points.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_program.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_render.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_rendertmp.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_texgen.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_texmat.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vb_vertex.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vertex.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vertex.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vertex_generic.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vertex_sse.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vp_build.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vp_build.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vtx_api.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vtx_api.h, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vtx_eval.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vtx_exec.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vtx_generic.c, $(MESASRCDIR)/src/mesa/tnl) +#if defined(i386Architecture) && MesaUseX86Asm +LinkSourceFile(t_vtx_x86.c, $(MESASRCDIR)/src/mesa/tnl) +LinkSourceFile(t_vtx_x86_gcc.S, $(MESASRCDIR)/src/mesa/tnl) +#endif +#endif + + MESA_TNL_OBJS = $(MESATNLBUILDDIR)t_array_api.o \ + $(MESATNLBUILDDIR)t_array_import.o \ + $(MESATNLBUILDDIR)t_context.o \ + $(MESATNLBUILDDIR)t_pipeline.o \ + $(MESATNLBUILDDIR)t_save_api.o \ + $(MESATNLBUILDDIR)t_save_loopback.o \ + $(MESATNLBUILDDIR)t_save_playback.o \ + $(MESATNLBUILDDIR)t_vb_arbprogram.o \ + $(MESATNLBUILDDIR)t_vb_arbprogram_sse.o \ + $(MESATNLBUILDDIR)t_vb_fog.o \ + $(MESATNLBUILDDIR)t_vb_cull.o \ + $(MESATNLBUILDDIR)t_vb_light.o \ + $(MESATNLBUILDDIR)t_vb_normals.o \ + $(MESATNLBUILDDIR)t_vb_points.o \ + $(MESATNLBUILDDIR)t_vb_program.o \ + $(MESATNLBUILDDIR)t_vb_render.o \ + $(MESATNLBUILDDIR)t_vb_texgen.o \ + $(MESATNLBUILDDIR)t_vb_texmat.o \ + $(MESATNLBUILDDIR)t_vb_vertex.o \ + $(MESATNLBUILDDIR)t_vertex.o \ + $(MESATNLBUILDDIR)t_vertex_generic.o \ + $(MESATNLBUILDDIR)t_vertex_sse.o \ + $(MESATNLBUILDDIR)t_vp_build.o \ + $(MESATNLBUILDDIR)t_vtx_api.o \ + $(MESATNLBUILDDIR)t_vtx_eval.o \ + $(MESATNLBUILDDIR)t_vtx_exec.o \ + $(MESATNLBUILDDIR)t_vtx_generic.o + +#if defined(i386Architecture) && MesaUseX86Asm + MESA_TNL_OBJS += $(MESATNLBUILDDIR)t_vtx_x86.o \ + $(MESATNLBUILDDIR)t_vtx_x86_gcc.o +#endif + +#if defined(DoSharedLib) && DoSharedLib + MESA_TNL_UOBJS = $(MESATNLBUILDDIR)unshared/t_array_api.o \ + $(MESATNLBUILDDIR)unshared/t_array_import.o \ + $(MESATNLBUILDDIR)unshared/t_context.o \ + $(MESATNLBUILDDIR)unshared/t_pipeline.o \ + $(MESATNLBUILDDIR)unshared/t_save_api.o \ + $(MESATNLBUILDDIR)unshared/t_save_loopback.o \ + $(MESATNLBUILDDIR)unshared/t_save_playback.o \ + $(MESATNLBUILDDIR)unshared/t_vb_arbprogram.o \ + $(MESATNLBUILDDIR)unshared/t_vb_arbprogram_sse.o \ + $(MESATNLBUILDDIR)unshared/t_vb_fog.o \ + $(MESATNLBUILDDIR)unshared/t_vb_cull.o \ + $(MESATNLBUILDDIR)unshared/t_vb_light.o \ + $(MESATNLBUILDDIR)unshared/t_vb_normals.o \ + $(MESATNLBUILDDIR)unshared/t_vb_points.o \ + $(MESATNLBUILDDIR)unshared/t_vb_program.o \ + $(MESATNLBUILDDIR)unshared/t_vb_render.o \ + $(MESATNLBUILDDIR)unshared/t_vb_texgen.o \ + $(MESATNLBUILDDIR)unshared/t_vb_texmat.o \ + $(MESATNLBUILDDIR)unshared/t_vb_vertex.o \ + $(MESATNLBUILDDIR)unshared/t_vertex.o \ + $(MESATNLBUILDDIR)unshared/t_vertex_generic.o \ + $(MESATNLBUILDDIR)unshared/t_vertex_sse.o \ + $(MESATNLBUILDDIR)unshared/t_vp_build.o \ + $(MESATNLBUILDDIR)unshared/t_vtx_api.o \ + $(MESATNLBUILDDIR)unshared/t_vtx_eval.o \ + $(MESATNLBUILDDIR)unshared/t_vtx_exec.o \ + $(MESATNLBUILDDIR)unshared/t_vtx_generic.o + +#if defined(i386Architecture) && MesaUseX86Asm + MESA_TNL_UOBJS += $(MESATNLBUILDDIR)unshared/t_vtx_x86.o \ + $(MESATNLBUILDDIR)t_vtx_x86_gcc.o +#endif + +#else + MESA_TNL_UOBJS = $(MESA_TNL_OBJS) +#endif + + MESA_TNL_DOBJS = $(MESATNLBUILDDIR)debugger/t_array_api.o \ + $(MESATNLBUILDDIR)debugger/t_array_import.o \ + $(MESATNLBUILDDIR)debugger/t_context.o \ + $(MESATNLBUILDDIR)debugger/t_pipeline.o \ + $(MESATNLBUILDDIR)debugger/t_save_api.o \ + $(MESATNLBUILDDIR)debugger/t_save_loopback.o \ + $(MESATNLBUILDDIR)debugger/t_save_playback.o \ + $(MESATNLBUILDDIR)debugger/t_vb_arbprogram.o \ + $(MESATNLBUILDDIR)debugger/t_vb_arbprogram_sse.o \ + $(MESATNLBUILDDIR)debugger/t_vb_fog.o \ + $(MESATNLBUILDDIR)debugger/t_vb_cull.o \ + $(MESATNLBUILDDIR)debugger/t_vb_light.o \ + $(MESATNLBUILDDIR)debugger/t_vb_normals.o \ + $(MESATNLBUILDDIR)debugger/t_vb_points.o \ + $(MESATNLBUILDDIR)debugger/t_vb_program.o \ + $(MESATNLBUILDDIR)debugger/t_vb_render.o \ + $(MESATNLBUILDDIR)debugger/t_vb_texgen.o \ + $(MESATNLBUILDDIR)debugger/t_vb_texmat.o \ + $(MESATNLBUILDDIR)debugger/t_vb_vertex.o \ + $(MESATNLBUILDDIR)debugger/t_vertex.o \ + $(MESATNLBUILDDIR)debugger/t_vertex_generic.o \ + $(MESATNLBUILDDIR)debugger/t_vertex_sse.o \ + $(MESATNLBUILDDIR)debugger/t_vp_build.o \ + $(MESATNLBUILDDIR)debugger/t_vtx_api.o \ + $(MESATNLBUILDDIR)debugger/t_vtx_eval.o \ + $(MESATNLBUILDDIR)debugger/t_vtx_exec.o \ + $(MESATNLBUILDDIR)debugger/t_vtx_generic.o + +#if defined(i386Architecture) && MesaUseX86Asm + MESA_TNL_DOBJS += $(MESATNLBUILDDIR)debugger/t_vtx_x86.o \ + $(MESATNLBUILDDIR)debugger/t_vtx_x86_gcc.o +#endif + + MESA_TNL_POBJS = $(MESATNLBUILDDIR)profiled/t_array_api.o \ + $(MESATNLBUILDDIR)profiled/t_array_import.o \ + $(MESATNLBUILDDIR)profiled/t_context.o \ + $(MESATNLBUILDDIR)profiled/t_pipeline.o \ + $(MESATNLBUILDDIR)profiled/t_save_api.o \ + $(MESATNLBUILDDIR)profiled/t_save_loopback.o \ + $(MESATNLBUILDDIR)profiled/t_save_playback.o \ + $(MESATNLBUILDDIR)profiled/t_vb_arbprogram.o \ + $(MESATNLBUILDDIR)profiled/t_vb_arbprogram_sse.o \ + $(MESATNLBUILDDIR)profiled/t_vb_fog.o \ + $(MESATNLBUILDDIR)profiled/t_vb_cull.o \ + $(MESATNLBUILDDIR)profiled/t_vb_light.o \ + $(MESATNLBUILDDIR)profiled/t_vb_normals.o \ + $(MESATNLBUILDDIR)profiled/t_vb_points.o \ + $(MESATNLBUILDDIR)profiled/t_vb_program.o \ + $(MESATNLBUILDDIR)profiled/t_vb_render.o \ + $(MESATNLBUILDDIR)profiled/t_vb_texgen.o \ + $(MESATNLBUILDDIR)profiled/t_vb_texmat.o \ + $(MESATNLBUILDDIR)profiled/t_vb_vertex.o \ + $(MESATNLBUILDDIR)profiled/t_vertex.o \ + $(MESATNLBUILDDIR)profiled/t_vertex_generic.o \ + $(MESATNLBUILDDIR)profiled/t_vertex_sse.o \ + $(MESATNLBUILDDIR)profiled/t_vp_build.o \ + $(MESATNLBUILDDIR)profiled/t_vtx_api.o \ + $(MESATNLBUILDDIR)profiled/t_vtx_eval.o \ + $(MESATNLBUILDDIR)profiled/t_vtx_exec.o \ + $(MESATNLBUILDDIR)profiled/t_vtx_generic.o + +#if defined(i386Architecture) && MesaUseX86Asm + MESA_TNL_POBJS += $(MESATNLBUILDDIR)profiled/t_vtx_x86.o \ + $(MESATNLBUILDDIR)profiled/t_vtx_x86_gcc.o +#endif + diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/module/Imakefile b/nx-X11/programs/Xserver/GL/mesa/tnl/module/Imakefile deleted file mode 100644 index 5d2a4489d..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/tnl/module/Imakefile +++ /dev/null @@ -1,6 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/tnl/module/Imakefile,v 1.1 2002/05/31 18:12:42 dawes Exp $ - -#define IHaveModules - -#include "../Imakefile" - -- cgit v1.2.3 From 73fa8999135be4f036d50d647102835a01be0e0e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 26 May 2015 16:44:49 +0200 Subject: Drop unused / untested Xserver GLX extension support / build logic. * MS Windows (non-tested) * Mac OS X (not provided) * SGISI / opengl (not provided) * DRI support (nxagent uses Mesa software emulation only) --- nx-X11/programs/Xserver/GL/Imakefile | 19 +-- nx-X11/programs/Xserver/GL/mesa/X/Imakefile | 1 - .../programs/Xserver/GL/mesa/array_cache/Imakefile | 1 - nx-X11/programs/Xserver/GL/mesa/main/Imakefile | 1 - nx-X11/programs/Xserver/GL/mesa/math/Imakefile | 1 - nx-X11/programs/Xserver/GL/mesa/shader/Imakefile | 1 - .../Xserver/GL/mesa/shader/grammar/Imakefile | 1 - .../Xserver/GL/mesa/shader/slang/Imakefile | 1 - nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile | 1 - .../Xserver/GL/mesa/swrast_setup/Imakefile | 1 - nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile | 1 - nx-X11/programs/Xserver/GL/opengl/Imakefile | 140 --------------------- nx-X11/programs/Xserver/Imakefile | 44 +------ 13 files changed, 5 insertions(+), 208 deletions(-) delete mode 100644 nx-X11/programs/Xserver/GL/opengl/Imakefile (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/Imakefile b/nx-X11/programs/Xserver/GL/Imakefile index 47134e0a1..c681d23e0 100644 --- a/nx-X11/programs/Xserver/GL/Imakefile +++ b/nx-X11/programs/Xserver/GL/Imakefile @@ -5,24 +5,9 @@ XCOMM $XFree86: xc/programs/Xserver/GL/Imakefile,v 1.12 2003/08/06 14:04:01 eich #define IHaveSubdirs -#if GlxUseSGISI - CORE_SUBDIR = /* opengl */ -#elif defined(DarwinArchitecture) && DarwinQuartzSupport - CORE_SUBDIR = apple mesa -#elif defined(cygwinArchitecture) && GlxUseWindows - CORE_SUBDIR = windows mesa -#elif defined(Win32Architecture) && GlxUseWindows - CORE_SUBDIR = windows -#else CORE_SUBDIR = mesa -#endif - -#if BuildXF86DRI && ((defined(XF86Server) && XF86Server) \ - || (defined(XorgServer) && XorgServer)) -DRI_SUBDIR = dri -#endif -SUBDIRS = glx $(DRI_SUBDIR) $(CORE_SUBDIR) +SUBDIRS = glx $(CORE_SUBDIR) #if DoLoadableServer MSRCS = glxmodule.c @@ -39,7 +24,7 @@ OBJS = glx/?*.o $(MOBJS) DONES = glx/DONE -INCLUDES = -Iinclude -Idri -I$(SERVERSRC)/include -I$(SERVERSRC)/mi \ +INCLUDES = -Iinclude -I$(SERVERSRC)/include -I$(SERVERSRC)/mi \ -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(XF86OSSRC) DEPEND_DEFINES = $(EXT_DEFINES) DependDefines DEFINES = $(GLX_DEFINES) diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile index fbdd755fa..deae53bb3 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile @@ -58,7 +58,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile index 21c6689ed..188972b3b 100644 --- a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile @@ -35,7 +35,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile index d6713cada..2dd59ea8f 100644 --- a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile @@ -40,7 +40,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile index 9f1ab6b44..df30ab909 100644 --- a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile @@ -34,7 +34,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile index 6129d71b9..b52d193d3 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile @@ -37,7 +37,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile index d975ec73c..56cfb4bc9 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile @@ -33,7 +33,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile index da3fbc703..572000f26 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile @@ -36,7 +36,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile index 46b22b6a1..c4c55a86f 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile @@ -42,7 +42,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile index 992c4925c..52be70141 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile @@ -34,7 +34,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile index 5c87d1e97..3f1c4bbc5 100644 --- a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile @@ -45,7 +45,6 @@ NormalLibraryObjectRule() SubdirLibraryRule($(OBJS)) -LintLibraryTarget(dri,$(SRCS)) NormalLintTarget($(SRCS)) DependTarget() diff --git a/nx-X11/programs/Xserver/GL/opengl/Imakefile b/nx-X11/programs/Xserver/GL/opengl/Imakefile deleted file mode 100644 index 420405d9c..000000000 --- a/nx-X11/programs/Xserver/GL/opengl/Imakefile +++ /dev/null @@ -1,140 +0,0 @@ -XCOMM $XFree86$ - -XCOMM The contents of this file are subject to the GLX Public License Version 1.0 -XCOMM (the "License"). You may not use this file except in compliance with the -XCOMM License. You may obtain a copy of the License at Silicon Graphics, Inc., -XCOMM attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 -XCOMM or at http://www.sgi.com/software/opensource/glx/license.html. -XCOMM -XCOMM Software distributed under the License is distributed on an "AS IS" -XCOMM basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY -XCOMM IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR -XCOMM PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific -XCOMM language governing rights and limitations under the License. -XCOMM -XCOMM The Original Software is GLX version 1.2 source code, released February, -XCOMM 1999. The developer of the Original Software is Silicon Graphics, Inc. -XCOMM Those portions of the Subject Software created by Silicon Graphics, Inc. -XCOMM are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. - -#include - -OBJS = \ - ddxci.o \ - ddxcx.o \ - ddxrgb.o \ - ddxscreens.o \ - dl_block.o \ - dl_heap.o \ - dl_init.o \ - dl_list.o \ - dl_mopt.o \ - dl_opt.o \ - dl_pplst.o \ - dl_splc.o \ - dl_splst.o \ - dl_table.o \ - g_api.o \ - g_disp.o \ - g_lcmpex.o \ - g_lcomp.o \ - g_lexec.o \ - g_ltab.o \ - g_noptab.o \ - g_splcmp.o \ - px_api.o \ - px_mod.o \ - px_pack.o \ - px_paths.o \ - px_read.o \ - px_rend.o \ - px_upack.o \ - s_accum.o \ - s_atest.o \ - s_attrib.o \ - s_bitmap.o \ - s_blend.o \ - s_btdraw.o \ - s_buffer.o \ - s_capi.o \ - s_ci.o \ - s_clear.o \ - s_clip.o \ - s_contxt.o \ - s_cpydsp.o \ - s_ctable.o \ - s_depth.o \ - s_dlist.o \ - s_eval.o \ - s_export.o \ - s_feed.o \ - s_finish.o \ - s_fog.o \ - s_get.o \ - s_global.o \ - s_image.o \ - s_lcache.o \ - s_lcomp.o \ - s_light.o \ - s_lnclip.o \ - s_lndraw.o \ - s_lnfast.o \ - s_lnfin.o \ - s_lnspan.o \ - s_math.o \ - s_memmgr.o \ - s_names.o \ - s_napi.o \ - s_pgaa.o \ - s_pgclip.o \ - s_pgdraw.o \ - s_pgfin.o \ - s_pgmode.o \ - s_pgspan.o \ - s_pick.o \ - s_prim.o \ - s_ptaa.o \ - s_ptdraw.o \ - s_ptfin.o \ - s_rapi.o \ - s_rect.o \ - s_rgb.o \ - s_rpos.o \ - s_select.o \ - s_size.o \ - s_span.o \ - s_sten.o \ - s_store.o \ - s_tapi.o \ - s_tex.o \ - s_texel.o \ - s_texmgr.o \ - s_trap.o \ - s_vapi.o \ - s_varray.o \ - s_vertex.o \ - s_xform.o \ - s_zfuncs.o \ - vc_cache.o \ - vc_line.o \ - vc_point.o \ - vc_poly.o - -INCLUDES = \ - -I. \ - -I.. \ - -Iinclude \ - -I$(TOP)/server/include \ - -I$(TOP)/programs/Xserver/include \ - -I$(TOP)/include \ - -I$(TOP)/include/GL \ - -I$(INCLUDESRC) - -DEFINES = \ - -D_LANGUAGE_C \ - -Dunix - -NormalLibraryTarget(GL, $(OBJS)) -NormalLibraryObjectRule() - -DependTarget() diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index 9f730cb97..5ddfb9b5e 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -71,39 +71,15 @@ INSTPGMFLAGS = #define AllFBLibs PreFbLibs $(FB) $(CFB) PostFbLibs #if BuildGlxExt -# if BuildXF86DRI && ((defined(XF86Server) && XF86Server) \ - || (defined(XorgServer) && XorgServer)) - DRILIB = GL/dri/ModuleLibraryTargetName(dri) -# else - DRILIB = -# endif -# if GlxUseSGISI +# if DoLoadableServer GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ - GL/sgi-si/ModuleLibraryTargetName(GLcore) \ - $(DRILIB) + GL/mesa/GLcore/ModuleLibraryTargetName(GLcore) # else -# if defined(GlxUseWindows) && GlxUseWindows - XWin_GL.exe.GLXLIB = GL/glx/ModuleLibraryTargetName(glx_stdcall) \ - GL/windows/ModuleLibraryTargetName(GLcore) -# endif /* GlxUseWindows */ -# if defined(Win32Architecture) && defined(GlxUseWindows) && GlxUseWindows - GLXLIB = GL/glx/ModuleLibraryTargetName(glx_stdcall) \ - GL/windows/ModuleLibraryTargetName(GLcore) -# elif DoLoadableServer GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ GL/mesa/GLcore/ModuleLibraryTargetName(GLcore) -# else - GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ - GL/mesa/GLcore/ModuleLibraryTargetName(GLcore) \ - $(DRILIB) -# endif # endif GLXDIR = GL -# if defined(cygwinArchitecture) && defined(GlxUseWindows) && GlxUseWindows - GLXEXT = $(if $($@.GLXLIB),$($@.GLXLIB), $(GLXLIB)) -# else GLXEXT = $(GLXLIB) -# endif #endif #if BuildXInputExt @@ -526,11 +502,7 @@ XWINPARSERLIB = $(XWINPARSERDIR)/LibraryTargetName(xf86config) XWINPARSERDIR = XWINPARSERLIB = #endif -#if defined(GlxUseWindows) && GlxUseWindows -XWINOPENGLLIB = -lopengl32 -#else XWINOPENGLLIB = -#endif NXWINLIB = $(NXWINDDXDIR)/LibraryTargetName(NXWin) NXWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(LAYERDIR) $(NXWINDDXDIR) \ @@ -545,10 +517,7 @@ PTHREADLIB = -lpthreadGC # endif #endif #if defined(Win32Architecture) -# if defined(GlxUseWindows) && GlxUseWindows -XWINGL32 = -lopengl32 -# endif -XWINW32 = -lgdi32 -lwsock32 $(XWINGL32) $(PTHREADLIB) +XWINW32 = -lgdi32 -lwsock32 $(PTHREADLIB) #else XWINW32 = -lgdi32 #endif @@ -577,18 +546,11 @@ $(NXWINOBJS) $(NXWINLIB) $(NXWINLIBS) $(NXWINSYSLIBS) $(NXWINNXLIBS):: $(NXWINDI #ifdef mingwArchitecture NXWINSERVERNAME=NXming -NXWINGLSERVERNAME=NXmingGL #else NXWINSERVERNAME=NXWin -NXWINGLSERVERNAME=NXWin_GL #endif ServerTarget($(NXWINSERVERNAME),$(NXWINDIRS),$(NXWINOBJS), \ $(LIBCWRAPPER) $(NXWINLIBS) $(LOADABLEEXTS),$(NXWINSYSLIBS) $(NXWINNXLIBS)) -#if defined(cygwinArchitecture) && defined(GlxUseWindows) && GlxUseWindows -ServerTarget($(NXWINGLSERVERNAME),$(NXWINDIRS),$(NXWINOBJS), \ - $(LIBCWRAPPER) $(NXWINLIBS) $(LOADABLEEXTS),$(NXWINSYSLIBS) $(NXWINNXLIBS)\ - $(XWINOPENGLLIB)) -#endif #ifndef ServerToInstall # define ServerToInstall $(NXWINSERVERNAME) -- cgit v1.2.3 From 5cd80d272ba366686a3b28c5915cb5bf3ada8985 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 27 May 2015 08:10:38 +0200 Subject: imake clean-up: Enforce build of Mesa GLX extension. Drop all other GLX build methods (built-in DRI drivers, etc.). --- nx-X11/config/cf/X11.tmpl | 7 - nx-X11/config/cf/host.def | 5 - nx-X11/config/cf/linux.cf | 64 ------ nx-X11/config/cf/lnxLib.tmpl | 7 +- nx-X11/config/cf/xfree86.cf | 242 ++------------------- nx-X11/config/cf/xorg.cf | 242 ++------------------- nx-X11/config/cf/xorgsite.def | 5 - nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile | 2 +- nx-X11/programs/Xserver/GL/mesa/Imakefile.inc | 4 - nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc | 4 - .../Xserver/GL/mesa/array_cache/Imakefile.inc | 4 - nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc | 4 - nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc | 4 - .../programs/Xserver/GL/mesa/shader/Imakefile.inc | 4 - .../Xserver/GL/mesa/shader/grammar/Imakefile.inc | 4 - .../Xserver/GL/mesa/shader/slang/Imakefile.inc | 4 - .../programs/Xserver/GL/mesa/swrast/Imakefile.inc | 4 - .../Xserver/GL/mesa/swrast_setup/Imakefile.inc | 4 - nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc | 4 - 19 files changed, 29 insertions(+), 589 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/config/cf/X11.tmpl b/nx-X11/config/cf/X11.tmpl index 91a9aa6a6..8b3cf33a1 100644 --- a/nx-X11/config/cf/X11.tmpl +++ b/nx-X11/config/cf/X11.tmpl @@ -289,13 +289,6 @@ XORGRELSTRING = XorgManVersionString #endif #ifndef BuildGlxExt #define BuildGlxExt NO -#else -#if BuildGlxExt && !defined(XFree86Version) && !defined(XorgVersion) -#undef BuildXF86DRI -#undef BuildXF86DRIDriverSupport -#define BuildXF86DRI NO -#define BuildXF86DRIDriverSupport NO -#endif #endif #ifndef BuildOSMesaLib #define BuildOSMesaLib BuildGlxExt diff --git a/nx-X11/config/cf/host.def b/nx-X11/config/cf/host.def index 02eabbb9f..6b9faf72c 100644 --- a/nx-X11/config/cf/host.def +++ b/nx-X11/config/cf/host.def @@ -165,11 +165,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ wacom void magictouch aiptek */ -/* To enable building of development DRI drivers (insecure, or not - * useful on the chosen architecture, uncomment this define. -#define BuildDevelDRIDrivers YES - */ - /* * To use the deprecated, old keyboard driver, uncomment this. But * even better, make the new keyboard driver (hw/xfree86/input/keyboard) diff --git a/nx-X11/config/cf/linux.cf b/nx-X11/config/cf/linux.cf index aa28c5c55..c8b3e12cd 100644 --- a/nx-X11/config/cf/linux.cf +++ b/nx-X11/config/cf/linux.cf @@ -107,12 +107,8 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion) /* the relative symlink created by this rule causes problems for us */ # endif /* !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot */ # define SharedLibXdmGreet NO -# define LinkGLToUsrInclude NO -# define LinkGLToUsrLib NO # define FSUseSyslog YES -# define BuildLibGlxWithoutPIC NO - # define DriverManSuffix 4x # define DriverManDir $(MANSOURCEPATH)4 @@ -325,58 +321,6 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion) # endif #endif -/* The DRM module requires kernel services that appeared in late 2.1.x - kernels and are known to be present in 2.2.x kernels. */ -#ifndef BuildXF86DRI -# if defined(AlphaArchitecture) -# define BuildXF86DRI YES -# elif defined(Arm32Architecture) -# define BuildXF86DRI NO -# elif defined(HPArchitecture) -# define BuildXF86DRI YES -# elif defined(i386Architecture) -# if (defined(__linux__) && (OSMajorVersion > 2 || (OSMajorVersion == 2 && \ - OSMinorVersion >= 2))) || \ - defined(__FreeBSD_kernel__) -# define BuildXF86DRI YES -# else -# define BuildXF86DRI NO -# endif -# elif defined(ia64Architecture) -# define BuildXF86DRI YES -# elif defined(Mc68020Architecture) -# define BuildXF86DRI NO -# elif defined(MipsArchitecture) -# define BuildXF86DRI NO -# elif defined(PpcArchitecture) -# define BuildXF86DRI YES -# elif defined(Ppc64Architecture) -# define BuildXF86DRI NO -# elif defined(s390Architecture) || defined(s390xArchitecture) -# define BuildXF86DRI NO -# elif defined(SparcArchitecture) -# define BuildXF86DRI YES -# elif defined(SuperHArchitecture) -# define BuildXF86DRI NO -# elif defined(AMD64Architecture) -# define BuildXF86DRI YES -# else -# define BuildXF86DRI NO -# endif -#endif - -/* - * Build shared libGL and the DRI modules without -fPIC on some architectures. - * This improves performance. - */ -#ifndef BuildLibGlxWithoutPIC -# if BuildXF86DRI -# if defined(i386Architecture) -# define BuildLibGlxWithoutPIC YES -# endif -# endif -#endif - #ifndef HasAgpGart # if defined(i386Architecture) || defined(ia64Architecture) || defined(AMD64Architecture) /* The AGPGART header file is included in os-support/linux, which @@ -1006,14 +950,6 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion) # define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic #endif -#ifndef LinkGLToUsrLib -# define LinkGLToUsrLib YES -#endif -# ifndef LinkGLToUsrInclude -# define LinkGLToUsrInclude YES -#endif - - #define HasGnuMake YES #define MakeNamedTargetSubdir(dir,flags,subname)\ diff --git a/nx-X11/config/cf/lnxLib.tmpl b/nx-X11/config/cf/lnxLib.tmpl index ee372709a..7096ee150 100644 --- a/nx-X11/config/cf/lnxLib.tmpl +++ b/nx-X11/config/cf/lnxLib.tmpl @@ -12,12 +12,7 @@ XCOMM $XFree86: xc/config/cf/lnxLib.tmpl,v 3.19 2003/10/15 22:47:48 herrb Exp $ #define SharedXrenderReqs $(LDPRELIB) $(XLIB) #define SharedXtstReqs $(LDPRELIB) $(XLIB) -#if GlxUseBuiltInDRIDriver -#define ExtraSharedGLReqs /**/ -#else -#define ExtraSharedGLReqs -ldl -#endif -#define SharedGLReqs $(LDPRELIB) $(XLIB) ExtraSharedGLReqs +#define SharedGLReqs $(LDPRELIB) $(XLIB) -ldl #define SharedXineramaReqs $(LDPRELIB) $(XLIB) #define SharedXxf86dgaReqs $(LDPRELIB) $(XLIB) diff --git a/nx-X11/config/cf/xfree86.cf b/nx-X11/config/cf/xfree86.cf index 11c6a95c9..367835170 100644 --- a/nx-X11/config/cf/xfree86.cf +++ b/nx-X11/config/cf/xfree86.cf @@ -346,24 +346,6 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ dummy XF86OSCardDrivers XF86ExtraCardDrivers # endif -/* - * DRI drivers under development, or drivers included on this platform - * only for build testing. - */ -# ifndef DevelDRIDrivers -# if XFree86Devel -# define DevelDRIDrivers ffb -# else -# define DevelDRIDrivers /**/ -# endif -# endif - -# ifndef DriDrivers -# define DriDrivers gamma i810 i830 mga r128 radeon r200 \ - sis tdfx DevelDRIDrivers -# endif -#endif - #if defined(AMD64Architecture) # ifndef XF86Server # define XF86Server YES @@ -446,13 +428,6 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ vga dummy fbdev vesa # endif -/* DRI tdfx driver needs Glide, which is not available for AMD64 */ -# define TdfxDriDriver /**/ - -# define DevelDRIDrivers /**/ - -# define DriDrivers gamma i810 mga r128 radeon r200 \ - TdfxDriDriver DevelDRIDrivers #endif /*AMD64Arcitecture*/ /* SPARC and UltraSPARC drivers */ @@ -555,10 +530,6 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ XF86OSCardDrivers XF86ExtraCardDrivers \ DevelDrivers # endif -# ifndef DriDrivers -# define DriDrivers ffb -# endif - #endif /* Sparc64 Drivers */ @@ -653,10 +624,6 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ DevelDrivers \ XF86OSCardDrivers XF86ExtraCardDrivers # endif -# define TdfxDriDriver /**/ -# ifndef DriDrivers -# define DriDrivers /**/ -# endif #endif /* MIPS drivers */ @@ -833,9 +800,6 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ savage nv cirrus DevelDrivers siliconmotion \ vga XF86OSCardDrivers XF86ExtraCardDrivers # endif -# ifndef DriDrivers -# define DriDrivers gamma tdfx mga r128 radeon r200 /*sis*/ -# endif #endif /* @@ -929,9 +893,6 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ DevelDrivers vga \ XF86OSCardDrivers XF86ExtraCardDrivers # endif -# ifndef DriDrivers -# define DriDrivers gamma tdfx mga r128 radeon r200 -# endif #endif /* @@ -1021,14 +982,6 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ DevelDrivers vga \ XF86OSCardDrivers XF86ExtraCardDrivers # endif -# if HasGlide3 -# define TdfxDriDriver tdfx -# else -# define TdfxDriDriver /**/ -# endif -# ifndef DriDrivers -# define DriDrivers gamma tdfx mga r128 radeon r200 -# endif #endif /* SuperH drivers */ @@ -1191,14 +1144,6 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ DevelDrivers \ XF86OSCardDrivers XF86ExtraCardDrivers # endif -# if HasGlide3 -# define TdfxDriDriver -# else -# define TdfxDriDriver /**/ -# endif -# ifndef DriDrivers -# define DriDrivers gamma r128 -# endif #endif /* @@ -1272,190 +1217,29 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 # define BuildGlxExt YES #endif -#ifndef BuildXF86DRI -#define BuildXF86DRI NO -#endif - -#ifndef GlxUseSGISI -#define GlxUseSGISI NO -#endif - -#if BuildXF86DRI - -/* - * One and ONLY one of the GlxBuiltIn* drivers can be defined to be YES. - * If more than one are defined, the compilation will fail with multiply - * defined references of GLX and OpenGL functions. - */ - -/* - * The first is a built-in driver that does software rendering client-side - * and renders to the X server via Xlib. - */ - -# ifndef GlxBuiltInXMesa -# define GlxBuiltInXMesa NO -# endif - -/* - * The rest are hardware-specific DRI drivers. - */ -# ifndef GlxBuiltInGamma -# define GlxBuiltInGamma NO -# endif -# ifndef GlxBuiltInTdfx -# define GlxBuiltInTdfx NO -# endif -# ifndef GlxBuiltInMga -# define GlxBuiltInMga NO -# endif -# ifndef GlxBuiltInI810 -# define GlxBuiltInI810 NO -# endif -# ifndef GlxBuiltInI830 -# define GlxBuiltInI830 NO -# endif -# ifndef GlxBuiltInR128 -# define GlxBuiltInR128 NO -# endif -# ifndef GlxBuiltInRadeon -# define GlxBuiltInRadeon NO -# endif -# ifndef GlxBuiltInR200 -# define GlxBuiltInR200 NO -# endif -# ifndef GlxBuiltInFfb -# define GlxBuiltInFfb NO -# endif -# ifndef GlxBuiltInSIS -# define GlxBuiltInSIS NO -# endif - -# if GlxBuiltInTdfx || \ - GlxBuiltInMga || \ - GlxBuiltInI810 || \ - GlxBuiltInI830 || \ - GlxBuiltInR128 || \ - GlxBuiltInRadeon || \ - GlxBuiltInR200 || \ - GlxBuiltInFfb || \ - GlxBuiltInSIS -# define GlxDriverUsesMesa YES -# else -# define GlxDriverUsesMesa NO -# endif - -# if GlxBuiltInGamma || \ - GlxBuiltInTdfx || \ - GlxBuiltInMga || \ - GlxBuiltInI810 || \ - GlxBuiltInI830 || \ - GlxBuiltInR128 || \ - GlxBuiltInRadeon || \ - GlxBuiltInR200 || \ - GlxBuiltInFfb || \ - GlxBuiltInSIS -# define GlxUseBuiltInDRIDriver YES -# define DRIDynLoadDefines /**/ -# else -# define GlxUseBuiltInDRIDriver NO -# define DRIDynLoadDefines -DGLX_USE_DLOPEN -# endif - -# if GlxUseBuiltInDRIDriver -# undef DriDrivers -# if GlxBuiltInGamma -# define DriDrivers gamma -# endif -# if GlxBuiltInTdfx -# define DriDrivers tdfx -# endif -# if GlxBuiltInMga -# define DriDrivers mga -# endif -# if GlxBuiltInI810 -# define DriDrivers i810 -# endif -# if GlxBuiltInI830 -# define DriDrivers i830 -# endif -# if GlxBuiltInR128 -# define DriDrivers r128 -# endif -# if GlxBuiltInRadeon -# define DriDrivers radeon -# endif -# if GlxBuiltInR200 -# define DriDrivers r200 -# endif -# if GlxBuiltInSIS -# define DriDrivers sis -# endif -# if GlxBuiltInFfb -# define DriDrivers ffb -# endif -# endif - -#endif - -/* - * This enables building DRI support into video drivers, which can be done - * even on platforms that don't have functional DRI support. - * - * Defining BuildXF86DRIDriverSupport to YES will not work until we have a - * separate set of defines set up for building driver-only support for the - * DRI. - */ -#ifndef BuildXF86DRIDriverSupport -# define BuildXF86DRIDriverSupport NO -#endif - #if BuildGlxExt -# if BuildXF86DRI -# define DRIDefines -DXF86DRI -DGLX_DIRECT_RENDERING DRIDynLoadDefines -# else -# define DRIDefines /**/ -# endif -# if defined(GlxUseSGISI) && GlxUseSGISI -# define GlxCoreLibDefines -DGLX_USE_SGI_SI -# else -# define GlxCoreLibDefines -DGLX_USE_MESA -# endif +# define GlxCoreLibDefines -DGLX_USE_MESA -# if defined(SparcArchitecture) \ +# if defined(SparcArchitecture) \ || defined (Sparc64Architecture) \ || defined(ia64Architecture) \ || defined(s390xArchitecture) \ || defined(AMD64Architecture) -# define GlxArchDefines -D__GLX_ALIGN64 -# elif defined(AlphaArchitecture) +# define GlxArchDefines -D__GLX_ALIGN64 +# elif defined(AlphaArchitecture) /* On the Alpha we need to ensure floating point accuracy for 3D */ -# define GlxArchDefines -D__GLX_ALIGN64 -mieee -# elif defined(DarwinArchitecture) +# define GlxArchDefines -D__GLX_ALIGN64 -mieee +# elif defined(DarwinArchitecture) /* GLX contains lots of uninitialized globals, which can upset Darwin */ -# define GlxArchDefines -fno-common -# else -# define GlxArchDefines /**/ -# endif - -# ifndef GlxExtraDefines -# define GlxExtraDefines DRIDefines GlxCoreLibDefines GlxArchDefines -# endif - -#else - -/* If we are not building GLX, then make sure the DRI is not built */ -# undef BuildXF86DRI -# define BuildXF86DRI NO -# undef BuildXF86DRIDriverSupport -# define BuildXF86DRIDriverSupport NO - -#endif +# define GlxArchDefines -fno-common +# else +# define GlxArchDefines /**/ +# endif -#if !BuildXF86DRI -# define GlxUseBuiltInDRIDriver NO /* For libOSmesa */ -#endif +# ifndef GlxExtraDefines +# define GlxExtraDefines GlxCoreLibDefines GlxArchDefines +# endif # ifndef UseX86Emu # define UseX86Emu YES diff --git a/nx-X11/config/cf/xorg.cf b/nx-X11/config/cf/xorg.cf index 8210cb049..c92162ef0 100644 --- a/nx-X11/config/cf/xorg.cf +++ b/nx-X11/config/cf/xorg.cf @@ -270,13 +270,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString #define HasAgpGart NO #endif -/* Some DRI drivers are disabled because they are either insecure or unusable on - * this architecture. This switch allows you to enable building these drivers. - */ -#ifndef BuildDevelDRIDrivers -#define BuildDevelDRIDrivers NO -#endif - /* The glide driver only works for the loadable server at the moment */ #ifndef HasGlide2 #define HasGlide2 NO @@ -399,20 +392,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString vesa vga \ dummy XF86OSCardDrivers XF86ExtraCardDrivers # endif - -# ifndef DevelDRIDrivers -# define DevelDRIDrivers ffb mach64 unichrome -# endif - -# ifndef DriDrivers -# ifndef ia64Architecture -# define i386DRIDrivers i810 i915 sis -# else - /* SiS is 64-bit unclean as of this writing. */ -# define i386DRIDrivers /**/ -# endif -# define DriDrivers i386DRIDrivers mga r128 radeon r200 tdfx -# endif #endif /* i386Architecture || ia64Architecture */ #if defined(AMD64Architecture) @@ -445,11 +424,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString vga dummy vesa i810 vmware \ XF86OSCardDrivers XF86ExtraCardDrivers DevelDrivers # endif - -/* SiS is 64-bit unclean as of this writing. */ -# ifndef DriDrivers -# define DriDrivers i915 mga r128 radeon r200 tdfx -# endif #endif /*AMD64Arcitecture*/ /* SPARC and UltraSPARC drivers */ @@ -500,10 +474,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString DevelDrivers # endif # endif -# ifndef DriDrivers -# define DriDrivers ffb -# endif - #endif /* Sparc64 Drivers */ @@ -584,13 +554,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString vga dummy XF86OSCardDrivers \ XF86ExtraCardDrivers # endif -/* - * Glide is available for Alpha, therefore build tdfx DRM module. - * SiS is 64-bit unclean as of this writing. - */ -# ifndef DriDrivers -# define DriDrivers tdfx mga r128 radeon r200 -# endif #endif /* AlphaArchitecture */ /* @@ -621,10 +584,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString DevelDrivers vga dummy \ XF86OSCardDrivers XF86ExtraCardDrivers # endif -/* The tdfx driver needs Glide, which is not available for PPC. */ -# ifndef DriDrivers -# define DriDrivers mga r128 radeon r200 -# endif #endif /* PpcArchitecture || Mc68020Architecture */ /* @@ -651,9 +610,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString DevelDrivers vga dummy \ XF86OSCardDrivers XF86ExtraCardDrivers # endif -# ifndef DriDrivers -# define DriDrivers mga r128 radeon r200 -# endif #endif /* SuperH drivers */ @@ -751,10 +707,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString DevelDrivers \ XF86OSCardDrivers XF86ExtraCardDrivers # endif -# define TdfxDriDriver /**/ -# ifndef DriDrivers -# define DriDrivers r128 -# endif #endif /* Ppc64Architecture */ /* @@ -828,197 +780,30 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 # define BuildGlxExt YES #endif -#ifndef BuildXF86DRI -#define BuildXF86DRI NO -#endif - -#ifndef GlxUseSGISI -#define GlxUseSGISI NO -#endif - -#if BuildXF86DRI - -#ifndef DriDrivers -#define DriDrivers /**/ -#endif - -#ifndef DevelDRIDrivers -#define DevelDRIDrivers /**/ -#endif - -/* - * One and ONLY one of the GlxBuiltIn* drivers can be defined to be YES. - * If more than one are defined, the compilation will fail with multiply - * defined references of GLX and OpenGL functions. - */ - -/* - * The first is a built-in driver that does software rendering client-side - * and renders to the X server via Xlib. - */ - -# ifndef GlxBuiltInXMesa -# define GlxBuiltInXMesa NO -# endif - -/* - * The rest are hardware-specific DRI drivers. - */ -# ifndef GlxBuiltInGamma -# define GlxBuiltInGamma NO -# endif -# ifndef GlxBuiltInTdfx -# define GlxBuiltInTdfx NO -# endif -# ifndef GlxBuiltInMga -# define GlxBuiltInMga NO -# endif -# ifndef GlxBuiltInI810 -# define GlxBuiltInI810 NO -# endif -# ifndef GlxBuiltInI915 -# define GlxBuiltInI915 NO -# endif -# ifndef GlxBuiltInR128 -# define GlxBuiltInR128 NO -# endif -# ifndef GlxBuiltInRadeon -# define GlxBuiltInRadeon NO -# endif -# ifndef GlxBuiltInR200 -# define GlxBuiltInR200 NO -# endif -# ifndef GlxBuiltInFfb -# define GlxBuiltInFfb NO -# endif -# ifndef GlxBuiltInSIS -# define GlxBuiltInSIS NO -# endif - -# if GlxBuiltInTdfx || \ - GlxBuiltInMga || \ - GlxBuiltInI810 || \ - GlxBuiltInI915 || \ - GlxBuiltInR128 || \ - GlxBuiltInRadeon || \ - GlxBuiltInR200 || \ - GlxBuiltInFfb || \ - GlxBuiltInSIS -# define GlxDriverUsesMesa YES -# else -# define GlxDriverUsesMesa NO -# endif - -# if GlxBuiltInGamma || \ - GlxBuiltInTdfx || \ - GlxBuiltInMga || \ - GlxBuiltInI810 || \ - GlxBuiltInI915 || \ - GlxBuiltInR128 || \ - GlxBuiltInRadeon || \ - GlxBuiltInR200 || \ - GlxBuiltInFfb || \ - GlxBuiltInSIS -# define GlxUseBuiltInDRIDriver YES -# define DRIDynLoadDefines /**/ -# else -# define GlxUseBuiltInDRIDriver NO -# define DRIDynLoadDefines -DGLX_USE_DLOPEN -# endif - -# if GlxUseBuiltInDRIDriver -# undef DriDrivers -# if GlxBuiltInGamma -# define DriDrivers gamma -# endif -# if GlxBuiltInTdfx -# define DriDrivers tdfx -# endif -# if GlxBuiltInMga -# define DriDrivers mga -# endif -# if GlxBuiltInI810 -# define DriDrivers i810 -# endif -# if GlxBuiltInI915 -# define DriDrivers i915 -# endif -# if GlxBuiltInR128 -# define DriDrivers r128 -# endif -# if GlxBuiltInRadeon -# define DriDrivers radeon -# endif -# if GlxBuiltInR200 -# define DriDrivers r200 -# endif -# if GlxBuiltInSIS -# define DriDrivers sis -# endif -# if GlxBuiltInFfb -# define DriDrivers ffb -# endif -# endif - -#endif - -/* - * This enables building DRI support into video drivers, which can be done - * even on platforms that don't have functional DRI support. - * - * Defining BuildXF86DRIDriverSupport to YES will not work until we have a - * separate set of defines set up for building driver-only support for the - * DRI. - */ -#ifndef BuildXF86DRIDriverSupport -# define BuildXF86DRIDriverSupport NO -#endif - #if BuildGlxExt -# if BuildXF86DRI -# define DRIDefines -DXF86DRI -DGLX_DIRECT_RENDERING DRIDynLoadDefines -# else -# define DRIDefines /**/ -# endif -# if defined(GlxUseSGISI) && GlxUseSGISI -# define GlxCoreLibDefines -DGLX_USE_SGI_SI -# else -# define GlxCoreLibDefines -DGLX_USE_MESA -# endif +# define GlxCoreLibDefines -DGLX_USE_MESA -# if defined(SparcArchitecture) \ +# if defined(SparcArchitecture) \ || defined (Sparc64Architecture) \ || defined(ia64Architecture) \ || defined(s390xArchitecture) \ || defined(AMD64Architecture) -# define GlxArchDefines -D__GLX_ALIGN64 -# elif defined(AlphaArchitecture) +# define GlxArchDefines -D__GLX_ALIGN64 +# elif defined(AlphaArchitecture) /* On the Alpha we need to ensure floating point accuracy for 3D */ -# define GlxArchDefines -D__GLX_ALIGN64 -mieee -# elif defined(DarwinArchitecture) +# define GlxArchDefines -D__GLX_ALIGN64 -mieee +# elif defined(DarwinArchitecture) /* GLX contains lots of uninitialized globals, which can upset Darwin */ -# define GlxArchDefines -fno-common -# else -# define GlxArchDefines /**/ -# endif - -# ifndef GlxExtraDefines -# define GlxExtraDefines DRIDefines GlxCoreLibDefines GlxArchDefines -# endif - -#else - -/* If we are not building GLX, then make sure the DRI is not built */ -# undef BuildXF86DRI -# define BuildXF86DRI NO -# undef BuildXF86DRIDriverSupport -# define BuildXF86DRIDriverSupport NO +# define GlxArchDefines -fno-common +# else +# define GlxArchDefines /**/ +# endif -#endif +# ifndef GlxExtraDefines +# define GlxExtraDefines GlxCoreLibDefines GlxArchDefines +# endif -#if !BuildXF86DRI -# define GlxUseBuiltInDRIDriver NO /* For libOSmesa */ #endif # ifndef UseX86Emu @@ -1561,6 +1346,7 @@ XFREE86JAPANESEDOCDIR = $(DOCDIR)/Japanese # define LargePositionIndependentCFlags -fPIC #endif + #ifndef XF8_32Wid # define XF8_32Wid NO #endif diff --git a/nx-X11/config/cf/xorgsite.def b/nx-X11/config/cf/xorgsite.def index a4d22b4b8..c05e53e17 100644 --- a/nx-X11/config/cf/xorgsite.def +++ b/nx-X11/config/cf/xorgsite.def @@ -84,11 +84,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ wacom void magictouch aiptek */ -/* To enable building of development DRI drivers (insecure, or not - * useful on the chosen architecture, uncomment this define. -#define BuildDevelDRIDrivers YES - */ - /* * To use the deprecated, old keyboard driver, uncomment this. But * even better, make the new keyboard driver (hw/xfree86/input/keyboard) diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile index 8e3b77eda..e3e91cdb5 100644 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile @@ -46,7 +46,7 @@ XCOMM $XFree86: xc/programs/Xserver/GL/mesa/GLcore/Imakefile,v 1.3 2002/05/31 18 ../shader/slang/DONE INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(MESASRCDIR)/include -I$(GLXLIBSRC)/include \ + -I$(MESASRCDIR)/include \ -I$(MESASRCDIR)/src/mesa \ -I$(SERVERSRC)/include diff --git a/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc index 03a7971f8..99e9c71c2 100644 --- a/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ -#ifndef MesaBuildDir -#define MesaBuildDir $(GLXLIBSRC)/mesa/ -#endif - MESABUILDDIR = MesaBuildDir COREMESASRCS = $(COREMESABASESRCS) \ diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc index d62800e7d..8e589c69a 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/X/Imakefile.inc,v 1.3tsi Exp $ -#ifndef MesaXBuildDir -#define MesaXBuildDir $(GLXLIBSRC)/src/mesa/drivers/x11/ -#endif - MESAXBUILDDIR = MesaXBuildDir #ifndef MesaInXServer diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc index 9a5044791..3964bdc48 100644 --- a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/array_cache/Imakefile.inc,v 1.1tsi Exp $ -#ifndef MesaACBuildDir -#define MesaACBuildDir $(GLXLIBSRC)/mesa/array_cache/ -#endif - MESAACBUILDDIR = MesaACBuildDir MESA_AC_SRCS = $(MESAACBUILDDIR)ac_context.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc index 80b3aef07..8927152aa 100644 --- a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc @@ -3,10 +3,6 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ /* gcc on ppc64 defines this, causes macro recursion with pixel below */ #undef pixel -#ifndef MesaBuildDir -#define MesaBuildDir $(GLXLIBSRC)/mesa/main/ -#endif - MESABUILDDIR = MesaBuildDir #ifdef NeedAllMesaSrc diff --git a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc index cd1dcc427..7356a4617 100644 --- a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/math/Imakefile.inc,v 1.1tsi Exp $ -#ifndef MesaMathBuildDir -#define MesaMathBuildDir $(GLXLIBSRC)/mesa/math/ -#endif - MESAMATHBUILDDIR = MesaMathBuildDir MESA_MATH_SRCS = $(MESAMATHBUILDDIR)m_debug_clip.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc index 7d0032e56..383bdc008 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86:$ -#ifndef MesaShaderBuildDir -#define MesaShaderBuildDir $(GLXLIBSRC)/mesa/shader/ -#endif - MESASHADERBUILDDIR = MesaShaderBuildDir MESA_SHADER_SRCS = $(MESASHADERBUILDDIR)arbprogparse.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc index b2e885f89..e1196201d 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86$ -#ifndef MesaGrammarBuildDir -#define MesaGrammarBuildDir $(GLXLIBSRC)/mesa/shader/grammar/ -#endif - MESAGRAMMARBUILDDIR=MesaGrammarBuildDir MESA_GRAMMAR_SRCS = $(MESAGRAMMARBUILDDIR)grammar_mesa.c diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc index d824ca797..4358b8975 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86$ -#ifndef MesaSlangBuildDir -#define MesaSlangBuildDir $(GLXLIBSRC)/mesa/shader/slang/ -#endif - MESASLANGBUILDDIR=MesaSlangBuildDir MESA_SLANG_SRCS = $(MESASLANGBUILDDIR)slang_assemble_assignment.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc index 683b8f0a7..c57416d85 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/swrast/Imakefile.inc,v 1.1tsi Exp $ -#ifndef MesaSwrastBuildDir -#define MesaSwrastBuildDir $(GLXLIBSRC)/mesa/swrast/ -#endif - MESASWRASTBUILDDIR = MesaSwrastBuildDir MESA_SWRAST_SRCS = $(MESASWRASTBUILDDIR)s_aaline.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc index 8d32aedb3..4fb10763a 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/swrast_setup/Imakefile.inc,v 1.1tsi Exp $ -#ifndef MesaSwrastSetupBuildDir -#define MesaSwrastSetupBuildDir $(GLXLIBSRC)/mesa/swrast_setup/ -#endif - MESASWRSETUPDIR = MesaSwrastSetupBuildDir MESA_SWR_SETUP_SRCS = $(MESASWRSETUPDIR)ss_context.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc index a294a6fbf..3a124c195 100644 --- a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc @@ -1,9 +1,5 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/tnl/Imakefile.inc,v 1.1tsi Exp $ -#ifndef MesaTnlBuildDir -#define MesaTnlBuildDir $(GLXLIBSRC)/mesa/tnl/ -#endif - MESATNLBUILDDIR = MesaTnlBuildDir MESA_TNL_SRCS = $(MESATNLBUILDDIR)t_array_api.c \ -- cgit v1.2.3 From ae443bd5b68d24f031d96b1a028eefae52da96ee Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 27 May 2015 08:38:11 +0200 Subject: nx-X11/config/cf: Drop unnecessary xf86site.def, xf86.tmpl, xfree86.cf. --- nx-X11/config/Imakefile | 6 +- nx-X11/config/cf/Imakefile | 7 +- nx-X11/config/cf/Server.tmpl | 4 - nx-X11/config/cf/xf86.tmpl | 128 -- nx-X11/config/cf/xf86site.def | 479 -------- nx-X11/config/cf/xfree86.cf | 1770 --------------------------- nx-X11/config/cf/xorg.cf | 2 +- nx-X11/programs/Xserver/GL/mesa/X/Imakefile | 7 - nx-X11/programs/Xserver/Imakefile | 4 +- nx-X11/programs/Xserver/Xext/Imakefile | 8 +- nx-X11/programs/Xserver/include/Imakefile | 2 +- nx-X11/programs/Xserver/mi/Imakefile | 2 +- nx-X11/programs/Xserver/xkb/Imakefile | 4 +- 13 files changed, 14 insertions(+), 2409 deletions(-) delete mode 100644 nx-X11/config/cf/xf86.tmpl delete mode 100644 nx-X11/config/cf/xf86site.def delete mode 100644 nx-X11/config/cf/xfree86.cf (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/config/Imakefile b/nx-X11/config/Imakefile index 5c95a5d80..03b9f5b94 100644 --- a/nx-X11/config/Imakefile +++ b/nx-X11/config/Imakefile @@ -15,16 +15,14 @@ BOOTSTRAPSUBDIRS = \ SUBDIRS = cf $(BOOTSTRAPSUBDIRS) -#if (defined(XFree86VersionString) || defined(XorgVersionString)) \ +#if defined(XorgVersionString) \ && defined(ProjectRoot) && \ defined(BuildBindist) all:: version version: cf/version.def RemoveFile(version) -#if defined (XFree86VersionString) - echo XFree86VersionString > version -#elif defined (XorgVersionString) +#if defined (XorgVersionString) echo XorgVersionString > version #endif diff --git a/nx-X11/config/cf/Imakefile b/nx-X11/config/cf/Imakefile index 20374d6db..b7626590d 100644 --- a/nx-X11/config/cf/Imakefile +++ b/nx-X11/config/cf/Imakefile @@ -15,14 +15,13 @@ HOSTDEFFILES = \ host.def #endif -#if defined(XFree86Version) || defined(XorgVersion) +#if defined(XorgVersion) VERSIONDEFFILES = \ date.def \ version.def #endif DEFFILES = \ -xf86site.def \ xorgsite.def \ $(VERSIONDEFFILES) \ $(HOSTDEFFILES) \ @@ -45,13 +44,11 @@ ServerLib.tmpl \ Threads.tmpl \ X11.tmpl \ lnxLib.tmpl \ -xf86.tmpl \ xorg.tmpl CFFILES = \ Imake.cf \ linux.cf \ -xfree86.cf \ xorg.cf INSTFILES = $(RULEFILES) $(TMPLFILES) $(DEFFILES) $(CFFILES) $(LOCALFILES) @@ -73,7 +70,7 @@ install:: $(DESTDIR)$(CONFIGDIR)/host.def; \ RemoveFile($${TMP})) -#if defined(XFree86Version) || defined(XorgVersion) +#if defined(XorgVersion) install.sdk:: @(TMP=/tmp/tmp.$$$$; \ RemoveFile($${TMP}); \ diff --git a/nx-X11/config/cf/Server.tmpl b/nx-X11/config/cf/Server.tmpl index bb769c5be..3ada3087b 100644 --- a/nx-X11/config/cf/Server.tmpl +++ b/nx-X11/config/cf/Server.tmpl @@ -70,10 +70,6 @@ GLX_DEFINES = GlxDefines #define GlxUseSGISI NO #endif -#ifdef XFree86Version -#include -#endif - #ifdef XorgVersion #include #endif diff --git a/nx-X11/config/cf/xf86.tmpl b/nx-X11/config/cf/xf86.tmpl deleted file mode 100644 index ba352445e..000000000 --- a/nx-X11/config/cf/xf86.tmpl +++ /dev/null @@ -1,128 +0,0 @@ -XCOMM $Xorg: xf86.tmpl,v 1.3 2000/08/17 19:41:48 cpqbld Exp $ - - - -XCOMM $XFree86: xc/config/cf/xf86.tmpl,v 3.32 2002/11/14 21:01:14 tsi Exp $ - -#ifdef BuilderEMailAddr -BUILDERADDR = BuilderEMailAddr -#else -BUILDERADDR = "xorg@freedesktop.org" -#endif -BUGMSG = -DBUILDERADDR='$(BUILDERADDR)' - -#if defined(XF86DriverSDK) - BUILDMODULEDIR = $(DRIVERSDKMODULEDIR) - BUILDMODULETOP = .. - TOP_INCLUDES = TopIncludes - IMAKE_DEFINES = -DXF86DriverSDK=1 -#ifdef UseInstalled - IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(TOP) -I$(IRULESRC) \ - $(IMAKE_DEFINES) $(IMAKE_WARNINGS) -#else - IMAKE_CMD = $(IMAKE) -I$(TOP) -I$(IRULESRC) \ - $(IMAKE_DEFINES) $(IMAKE_WARNINGS) -#endif - -#undef ImakeSubCmdHelper -#ifdef UseInstalled -#define ImakeSubCmdHelper $(IMAKE) -DUseInstalled -I$(IMAKETOP) \ - -I$(IRULESRC) $(IMAKE_DEFINES) $(IMAKE_WARNINGS) -#else -#define ImakeSubCmdHelper $(IMAKEPREFIX)$(IMAKE) -I$(IMAKETOP) \ - $(IMAKE_DEFINES) $(IMAKE_WARNINGS) \ - -I$(IMAKEPREFIX)$(IRULESRC) -#endif -#endif - -#ifndef JoystickSupport -#define JoystickSupport NO -#endif - -/* - * Module support: These overrides must be here, not in xf86.rules, - * because they will replace rules after having seen the first lines - * of Imakefile (include ) - */ - - -#ifndef HasGccMergeConstants -#define HasGccMergeConstants NO -#endif - -#if HasGccMergeConstants && DoLoadableServer && !MakeDllModules -MODULE_GCC_FLAGS = -fno-merge-constants -#endif - -#if defined(IHaveModules) && MakeDllModules -MODULE_PIC_FLAGS = $(PICFLAGS) -#endif - -MODULE_CFLAGS = $(MODULE_PIC_FLAGS) $(MODULE_GCC_FLAGS) - -#if defined(IHaveModules) -# if DoLoadableServer -MODULE_DEFINES = -DIN_MODULE -DXFree86Module -# else -MODULE_DEFINES = -DXFree86Module -# endif -#endif - -#if defined(IHaveModules) && DoLoadableServer - -/* This overrides the ObjCompile in Imake.rules! */ -#undef ObjectCompile -#define ObjectCompile(options) RemoveFile($@) @@\ - ClearmakeOSName\ - $(MODCC) $(MODCFLAGS) options -c $*.c - -/* This overrides an AssembleObject in xf86.rules or in an os-dependent - * rules file (currently only minix.cf and os2.rules (uncritical)) - */ -#define ModCPPOnlyAsm(basename,options) RemoveFile(basename.i) @@\ - $(MODCPP) AsmDefines $(DEFINES) $(INCLUDES) options basename.S | \ @@\ - grep -v '^\#' > basename.i - -#undef AssembleObject -#define AssembleObject(basename,flags) ModCPPOnlyAsm(basename,flags) @@\ - RemoveFile(basename.o) @@\ - $(MODAS) $(MODASFLAGS) -o basename.o basename.i @@\ - RemoveFile(basename.i) - -/* This overrides the NormalRelocatableTarget in Imake.rules */ -#undef NormalRelocatableTarget -#define NormalRelocatableTarget(objname,objlist) @@\ -AllTarget(objname.Osuf) @@\ - @@\ -objname.Osuf: objlist $(EXTRALIBRARYDEPS) @@\ - RemoveFile($@) @@\ - $(MODLD) $(MODLDCOMBINEFLAGS) objlist -o $@ - -/* This overrides the NormalDepRelocatableTarget in Imake.rules */ -#undef NormalDepRelocatableTarget -#define NormalDepRelocatableTarget(objname,deplist,objlist) @@\ -AllTarget(objname.Osuf) @@\ - @@\ -objname.Osuf: deplist $(EXTRALIBRARYDEPS) @@\ - RemoveFile($@) @@\ - $(MODLD) $(MODLDCOMBINEFLAGS) objlist -o $@ - -/* This overrides the RanLibrary in Imake.rules */ -#if DoRanlibCmd || NeedModuleRanlib -#undef RanLibrary -#define RanLibrary(args) $(MODRANLIB) args -#endif - -/* This overrides the MakeLibrary rule in Imake.rules */ -#undef MakeLibrary -#define MakeLibrary(libname,objlist) $(MODAR) libname objlist - -/* This overrides the LibraryTargetName rule in Imake.rules */ -#undef LibraryTargetName -#define LibraryTargetName(libname)Concat(lib,libname.a) - -/* This disables an OS/2 rule */ -#undef BuildLibSupportLibs -#define BuildLibSupportLibs(dummy) - -#endif /* IHaveModules */ diff --git a/nx-X11/config/cf/xf86site.def b/nx-X11/config/cf/xf86site.def deleted file mode 100644 index 6f0961252..000000000 --- a/nx-X11/config/cf/xf86site.def +++ /dev/null @@ -1,479 +0,0 @@ -XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ -/******************************************************************************/ -/* - * This file is to provide a quick method for most people to change the - * behaviour of their XFree86 installation without having to fully - * understand the workings of site.def and all the various '.cf' files. - * - * In the vast majority of cases, it should not be necessary to use this - * file at all or change it in any way. - * - * This file is divided into two sections. The first contains settings - * that end-users might reasonably change. The second contains settings - * that developers might want to change. - * - * IMPORTANT NOTE: In all cases changing the defaults may cause problems - * and/or unexpected side-effects. If you don't understand what a setting - * does, then it's best to not change it. If you make changes and have - * problems, verify that those problems are also present when using an - * empty host.def file and unchanged version of this file before reporting - * them. - * - * A good way to use this file is to copy it to host.def, and make the - * changes there. That way, future patches to this file won't fail. - * The host.def file will never be patched. - * - * The distributed version of this file MUST contain no uncommented - * definitions. Default definitions belong in xfree86.cf, or .cf - * files. - */ -/******************************************************************************/ - -/* - * If you have build-specific modifications in your host.def file, but - * want an empty host.def file installed when doing 'make install', - * uncomment the following - * -#define InstallEmptyHostDef - */ - -/* - * Which servers to build. There is now only one XFree86 server. - * It can be disabled by the following. - * -#define XF86Server NO - */ - -/* - * Set the default server (ie the one that gets the sym-link to "X") - * -#define ServerToInstall XFree86 - */ - -/* - * Server configuration parameters. The defaults are shown here: - */ - -/* - * Which drivers to build. When building a static server, each of these - * will be included in it. When building the loadable server each of these - * modules will be built. - * -#define XF86CardDrivers mga glint nv tga s3virge sis rendition \ - neomagic i740 tdfx savage \ - cirrus vmware tseng trident chips apm \ - GlideDriver fbdev i128 \ - ati AgpGartDrivers DevelDrivers ark cyrix \ - siliconmotion \ - vesa vga XF86OSCardDrivers XF86ExtraCardDrivers - */ - -/* - * To add third party drivers to the standard driver list, set the - * following. - * -#define XF86ExtraCardDrivers extradriver1 extradriver2 ... - */ - -/* - * Select the XInput devices you want by uncommenting this. - * -#define XInputDrivers mouse keyboard acecad calcomp citron \ - digitaledge dmc dynapro elographics \ - microtouch mutouch penmount spaceorb summa \ - wacom void magictouch aiptek - */ - -/* - * To build only the servers with a cut-down source tree, uncomment - * this. - * -#define BuildServersOnly YES - */ - -/* - * Undefine the following if you don't want to have config files and - * app-defaults installed in a separate directory (i.e. /etc/X11). - * -#define UseSeparateConfDir NO - */ - -/* - * To enable building the glide driver, you need to define - * HasGlide2 to YES and set the Glide2IncDir variable. - * HasGlide2 is per default NO. - * -#define HasGlide2 YES - */ - -/* - * Set the path to your Glide include files. - * -#define Glide2IncDir /usr/include/glide - */ - -/* - * Have glide 3? - * -#define HasGlide3 YES - */ - -/* - * Set the path to your Glide 3 include files. - * -#define Glide3IncDir /usr/include/glide3 - */ - - - -/* - * Unless you're a developer you shouldn't need to change anything - * beyond this point. - */ - -/* - * If you want to enable some developer settings, like more verbose - * compiler warnings, uncomment this. - * -#define XFree86Devel YES -*/ - -/* - * The default optimisation flags for GCC 2.x. -fno-strength-reduce is - * here to work around a bug in -O2 for GCC 2.x on i386 platforms. - * If you are using a version that doesn't have this bug, you can - * uncomment the following line, and remove '-fno-strength-reduce' - * If you are building binaries for a 486, it may be beneficial to add - * -m486 - * -#define DefaultGcc2i386Opt -O2 -fno-strength-reduce - */ - -/* - * This allows the GCC warning flags to be set. The default is shown here. - * -#define GccWarningOptions -Wall -Wpointer-arith -Wstrict-prototypes \ - -Wmissing-prototypes -Wmissing-declarations \ - -Wredundant-decls -Wnested-externs - */ - -/* - * Sun Compiler stuff.. - * -#define HasSunC YES -#define HasSunCplusplus YES -#define CplusplusCompilerMajorVersion 5 -#define CplusplusCompilerMinorVersion 0 -#define CCompilerMajorVersion 5 -#define CCompilerMinorVersion 0 - */ - -/* - * Optimized Sun Compiler Build. - * -#define DefaultCDebugFlags -xO4 -xtarget=pentium_pro -#define OptimizedCDebugFlags -xO4 -xtarget=pentium_pro - */ - -/* - * Debuggable Sun Compiler Build. - * Note: This builds _EVERYTHING_ as debuggable - * -#define DefaultCDebugFlags -g -xs -#define OptimizedCDebugFlags -g -xs - */ - -/* - * For Linux, this should match the Binutils version you have. This example - * is for 2.6.0.7. See linux.cf for the default setting. - * - * This should automatically get set correctly by imake. - * -#define LinuxBinUtilsMajorVersion 26 - */ - -/* - * For Linux, these should match the libc version you have. This example - * is for libc.5.4.x. See linux.cf for the default setting. - * - * This should automatically get set correctly by imake. - * -#define LinuxCLibMajorVersion 5 -#define LinuxClibMinorVersion 4 - */ - -/* - * If you want to use the GNU malloc library, uncomment this - * -#define UseGnuMalloc YES - */ - -/* - * Set this to whatever is required to access the GNU malloc library. - * The default is '-lgmalloc' unless is specified in the OS's .cf file. - * -#define GnuMallocLibrary -L/usr/local/lib -lgmalloc - */ - -/* - * To enable the internal Xserver malloc, uncomment this - * -#define UseInternalMalloc YES - */ - -/* - * Some Linux releases don't have a libtermcap. In this case you may need - * to uncomment the following - * -#define TermcapLibrary -lncurses - */ - -/* - * Build a server that dynamically loads the modules by setting - * this to YES. This defaults to YES on most platforms. A static server - * can be built by setting this to NO. - * -#define DoLoadableServer NO - */ - -/* - * Build dlopen() style modules instead of the standard loader modules. - * Don't enable this unless you have specific development reasons for - * doing so and understand how to deal with the problems you'll run in to. - * - * Enabling this for regular use is NOT supported, and will almost - * certainly cause you problems. - * -#define MakeDllModules YES - */ - -/* - * Build XAA. This can be disabled with: - * -#define XF86XAA NO - */ - -/* - * Build vgahw. This can be disabled with: - * -#define XF86VgaHw NO - */ - -/* - * Build xf1bpp. This can be disabled with: - * -#define XF1Bpp NO - */ - -/* - * Build xf4bpp. This can be disabled with: - * -#define XF4Bpp NO - */ - - -/* - * BSD Console driver support (for FreeBSD and NetBSD). - * - * By default, support is included for pccons and pcvt for NetBSD, and - * pccons, syscons and pcvt for FreeBSD. - * - * To change the list of supported drivers, set the following parameter. - * Possible values are -DPCCONS_SUPPORT, -DSYSCONS_SUPPORT, -DPCVT_SUPPORT. - * The following example includes support for syscons and pcvt only. - * -#define XFree86ConsoleDefines -DSYSCONS_SUPPORT -DPCVT_SUPPORT - */ - -/* - * To disable building XInput support, uncomment this - * -#define BuildXInputExt NO - */ - -/* - * Uncomment this for joystick support. - * - * Note: Joystick support is broken, so don't enable this. - * -#define JoystickSupport YES - */ - -/* - * To disable the ScreenSaver Extension, uncomment this line. - * -#define BuildScreenSaverExt NO - */ - -/* - * If you don't want to build Xinerama support, uncomment this. - * -#define BuildXinerama NO - */ - -/* - * If you don't want to build support for the GLX extension, uncomment this. - * -#define BuildGlxExt NO - */ - -/* - * If you want to build the xf86rush extension, uncomment this line. - * This isn't recommended. - * -#define BuildXF86RushExt YES - */ - -/* - * If you want to build the client library for the xf86rush extension, - * uncomment this line. This isn't recommended. - * -#define BuildXF86RushLibrary NO - */ - -/* - * If you are running NetBSD 0.9C or later, and have the aperture driver - * installed, uncomment this. - * -#define HasNetBSDApertureDriver YES - */ - -/* - * If you are running SVR3 and have the mmap driver installed (for linear - * framebuffer access) uncomment this. - * -#define HasSVR3mmapDrv YES - */ - -/* - * If you are using an SVR3 (like ISC 4.x) which supports long file names, - * you can * uncomment this to have manual pages installed under their - * full names - * -#define ExpandManNames YES - */ - -/* - * For a POSIXized build on Interactive uncomment this - * Could be used with gcc 'till Version 2.6.3 - * Should be used with gcc 2.7.2. - * -#define UsePosix YES - */ - -/* - * If you want XDMAUTH support (if you have Wraphelp.c), uncomment this. - * -#define HasXdmAuth YES - */ - -/* - * If you have Linux DECnet support, and want to build XFree86 with support - * for connections over DECnet, uncomment this. - * -#define HasDECnet YES - */ - -/* - * To build static and shared libraries with debugging information, uncomment - * this. Assumes you have Gcc2. - * (If you don't have Gcc2, you can use the DebugLib{X11,...} variables - * to build debugging versions of the libraries separately.) - * -#define DebuggableLibraries YES -*/ - -/* - * To forceably build static libraries in addition to shared libraries, - * uncomment this. - * -#define ForceNormalLib YES - */ - -/* - * Uncomment this if your default tools (eg, gcc, ld, as, etc) are - * not the Linux ELF versions. - * -#define LinuxElfDefault NO - */ - -/* - * To use ELF format shared libraries for supported OSs, uncomment this. - * - * For Linux the default setting of this is the same as the setting of - * LinuxElfDefault. - * - * For FreeBSD this should automatically be set correctly by imake. Only - * change it here if you need to override the automatic setting. - * -#define UseElfFormat YES - */ - -/* - * For FreeBSD/ELF (FreeBSD 3.0) it is possible to also build and install - * a.out compatibility libraries. To enable that, uncomment this. - * -#define BuildAoutLibraries YES - */ - -/* - * If you have trouble with make bombing out in Xlib, try uncommenting this. - * You will not get dependencies as a result, but better than nothing. - * -#define MakeHashTableBug YES - */ - -/* - * If you do not want your man pages compress under SVR3 systems that - * support it, uncomment this. - * -#define CompressManPages NO - */ - -/* - * If you have sgmlfmt (the XFree86 doctools package) and want to build - * formatted docs from the SGML source, uncomment this. - * -#define HasSgmlFmt YES - */ - -/* - * To disable building some document formats, uncomment some of these. - * -#define BuildLinuxDocText NO -#define BuildLinuxDocHtml NO -#define BuildLinuxDocPS NO - */ - -/* - * To install Japanese versions of the documentation uncomment this. - * Note: The Japanese documentation consists of a subset of the - * XFree86 3.1 docs. - * -#define InstallJapaneseDocs YES - */ - -/* - * To build/install X specs docs, uncomment the following. - * The SpecsDocDirs setting here is recommended because it covers - * the docs that XFree86 has changed or added. - * -#define BuildSpecsDocs YES -#define SpecsDocDirs CTEXT GL ICCCM X11 Xext Xmu Xv XvMC i18n - */ - -/* - * To build all specs docs, not just those listed in SpecsDocDirs, uncomment - * the following. - * -#define BuildAllSpecsDocs YES - */ - -/* - * If your system doesn't support vm86() mode and you have - * libx86emu set library path here - * -#define X86EMU_LIBPATH /usr/local/lib - */ - - diff --git a/nx-X11/config/cf/xfree86.cf b/nx-X11/config/cf/xfree86.cf deleted file mode 100644 index 9065ce68c..000000000 --- a/nx-X11/config/cf/xfree86.cf +++ /dev/null @@ -1,1770 +0,0 @@ -XCOMM $XFree86: xc/config/cf/xfree86.cf,v 3.466 2004/01/11 18:48:11 dawes Exp $ -/* - * This configuration file contains all of the configuration - * information for the XFree86 based X Servers. - * - * Most of these settings can be overridden in a vendor.cf or the - * BeforeVendor part of the site.def file. - */ -XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ - - -/* Get and set version information. */ - -#include "version.def" -#include "date.def" -/* - * As of the development trunk after 4.0.2, XFree86 versions are - * M.m.P.s, and XFree86Version is: - * - * M * 10000000 + m * 100000 + P * 1000 + s - * - * See xc/programs/Xserver/hw/xfree86/doc/Versions for further details. - * - * From 3.9.15 to 4.0.x, XFree86 release versions are X.Y.Z, and - * XFree86Version is: - * - * X * 1000 + Y * 100 + Z - * - * For the 3.3.x branch, the versions are X.Y.Z.W, with XFree86Version - * calculated as: - * - * X * 1000 + Y * 100 + Z * 10 + W - * - */ -#ifndef XFree86Version -# ifdef XF86_VERSION_CURRENT -# define XFree86Version XF86_VERSION_CURRENT -# else /* Must be defined for bootstrapping purposes */ -# define XFree86Version 0 -# endif -#endif - -#if !defined(XFree86VersionString) && \ - defined(XF86_VERSION_MAJOR) && defined(XF86_VERSION_MINOR) && \ - defined(XF86_VERSION_PATCH) && defined(XF86_VERSION_SNAP) -# if XF86_VERSION_SNAP == 0 -#define XFree86VersionString `echo XF86_VERSION_MAJOR XF86_VERSION_MINOR XF86_VERSION_PATCH | sed 's/ /./g'` -#else -#define XFree86VersionString `echo XF86_VERSION_MAJOR XF86_VERSION_MINOR XF86_VERSION_PATCH XF86_VERSION_SNAP | sed 's/ /./g'` -# endif -#endif - -#if !defined(XFree86ManVersionString) && \ - defined(XF86_VERSION_MAJOR) && defined(XF86_VERSION_MINOR) && \ - defined(XF86_VERSION_PATCH) && defined(XF86_VERSION_SNAP) -# if XF86_VERSION_SNAP == 0 -#define XFree86ManVersionString `echo XF86_VERSION_MAJOR XF86_VERSION_MINOR XF86_VERSION_PATCH | sed -e 's/ /./g' -e 's/^/Version\\\ /'` -#else -#define XFree86ManVersionString `echo XF86_VERSION_MAJOR XF86_VERSION_MINOR XF86_VERSION_PATCH XF86_VERSION_SNAP | sed -e 's/ /./g' -e 's/^/Version\\\ /'` -# endif -#endif - -#if !defined(XFree86DateString) && defined(XF86_DATE) -# define XFree86DateString XF86_DATE -#endif - -#ifndef BuildDateCmd -# define BuildDateCmd date +%Y%m%d -#endif - -#if !defined(BuildDate) -# define BuildDate `BuildDateCmd` -#endif - -#ifndef ChangelogDateCmd -# define ChangelogDateCmd if tail $(CHANGELOGFILE) | \ @@\ - fgrep '$$XFree86:' >/dev/null 2>&1; then \ @@\ - tail $(CHANGELOGFILE) | fgrep '$$XFree86:' | \ @@\ - sed s,'.* \([0-9][0-9]*\)/\([0-9][0-9]*\)/\([0-9][0-9]*\).*,\1\2\3,'; \ @@\ - else echo 0; fi -#endif - -#if !defined(ChangelogDate) -# define ChangelogDate `ChangelogDateCmd` -#endif - -#ifndef XVendorString -# define XVendorString "The X.Org Foundation, Inc" -#endif - -#ifndef XVendorRelease -# define XVendorRelease XFree86Version -#endif - -#ifndef XVendorManVersionString -#define XVendorManVersionString XFree86ManVersionString -#endif - -#ifndef XVendorManNameString -#define XVendorManNameString XFree86 -#endif - -/* - * This enables some settings for developers. - */ - -#ifndef XFree86Devel -# if !defined(PatheticCpp) || !PatheticCpp -# if (XFree86Version % 1000) -# define XFree86Devel YES -# else -# define XFree86Devel NO -# endif -# else -# define XFree86Devel NO /* Assume the worst */ -# endif -#endif - -#ifndef BuildDebug -# define BuildDebug YES -#endif - -/* - * settings for the config file parser - */ - -#ifndef XConfigFile -#define XConfigFile XF86Config -#endif -#ifndef XConfigDir -#define XConfigDir $(LIBDIR) -#endif -#ifndef XLogFile -#define XLogFile XFree86 -#endif - -/* - * BuildXFree86ConfigTools: - * - * Turning this on allows the XFree86 config tools to build when - * BuildServersOnly is YES. This requires more than the servonly CVS - * module. This cannot be used to disable building the config tools with - * a full build. - */ -#ifndef BuildXFree86ConfigTools -#ifdef BuildServersOnly -#define BuildXFree86ConfigTools !BuildServersOnly -#else -#define BuildXFree86ConfigTools YES -#endif -#endif - -#ifndef BuildLibrariesForConfigTools -#define BuildLibrariesForConfigTools BuildXFree86ConfigTools -#endif - -#if BuildXFree86ConfigTools && BuildLibrariesForConfigTools -#define BuildLibraries YES -#define BuildXF86MiscLibrary YES -#define BuildXF86VidModeLibrary YES -#define BuildXKBlib YES -#define BuildXKBfilelib YES -#endif - -/* - * When this is set, modules are always built separately from the libraries - * that statically link into an Xserver. This is for platforms where the - * module and native object formats are different (e.g., OS/2). - */ -#ifndef BuildModuleInSubdir -#define BuildModuleInSubdir NO -#endif - -#ifndef MakeDllModules -#define MakeDllModules NO -#endif -#ifndef DoLoadableServer -#define DoLoadableServer NO -#endif - -/* - * Default settings for which X Servers to build. - */ - -/* OS.cf files may set this for OS-specific input drivers */ -#ifndef OSXInputDrivers -#define OSXInputDrivers /**/ -#endif - -/* This may be set in host.def for 3rd party input drivers */ -#ifndef ExtraXInputDrivers -#define ExtraXInputDrivers /**/ -#endif - -/* XInput drivers */ -#ifndef XInputDrivers -#define XInputDrivers mouse keyboard acecad calcomp citron \ - digitaledge dmc dynapro elographics tek4957 \ - microtouch mutouch penmount spaceorb summa \ - wacom void magellan /* magictouch */ hyperpen \ - jamstudio fpit \ - palmax OSXInputDrivers ExtraXInputDrivers -#endif - -/* support mainly for USB support */ -#ifndef HasLinuxInput -# define HasLinuxInput NO -#endif - -/* OS.cf files may set this for OS-specific drivers */ -#ifndef XF86OSCardDrivers -#define XF86OSCardDrivers /**/ -#endif - -/* This may be set in host.def for 3rd party drivers */ -#ifndef XF86ExtraCardDrivers -#define XF86ExtraCardDrivers /**/ -#endif - -/* OS.cf files may set this for OS-specific drivers */ -#ifndef HasAgpGart -#define HasAgpGart NO -#endif - -/* The glide driver only works for the loadable server at the moment */ -#ifndef HasGlide2 -#define HasGlide2 NO -#endif -#if HasGlide2 && DoLoadableServer -#define GlideDriver glide -#else -#define GlideDriver /**/ -#endif - -/* - * For Intel platforms, the default is to build all modules which - * are supported on this platform. - */ -#if defined(i386Architecture) || defined(ia64Architecture) -# ifndef XF86Server -# define XF86Server YES -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp YES -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp YES -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* vgahw module */ -# ifndef XF86VgaHw -# define XF86VgaHw YES -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* EXA module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif -/* vbe module */ -# ifndef XF86VBE -# define XF86VBE YES -# endif - -/* - * Amiga framebuffer module. - * This is mostly for build testing, but the vesa driver references it. - */ -# ifndef XF86AFB -# define XF86AFB YES -# endif - -# define AgpGartDrivers /**/ - -/* - * Drivers under development, but not ready for binary releases, or - * drivers included on this platform only for build testing. - */ -# ifndef DevelDrivers -# if XFree86Devel -# define DevelDrivers imstt newport -# else -# define DevelDrivers /**/ -# endif -# endif - -/* Pure PCI drivers should go first */ -# ifndef XF86CardDrivers -# /* Don't build the nsc driver on IA64 */ -# ifndef ia64Architecture -# define NscDriver nsc -# else -# define NscDriver /**/ -# endif -# define XF86CardDrivers mga glint nv tga s3 s3virge sis rendition \ - neomagic i740 tdfx savage \ - cirrus vmware tseng trident chips apm \ - GlideDriver i128 NscDriver \ - ati i810 AgpGartDrivers DevelDrivers ark \ - cyrix siliconmotion via \ - fbdev vesa vga \ - dummy XF86OSCardDrivers XF86ExtraCardDrivers -# endif - -#if defined(AMD64Architecture) -# ifndef XF86Server -# define XF86Server YES -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp YES -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp YES -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* vgahw module */ -# ifndef XF86VgaHw -# define XF86VgaHw YES -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* EXA module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif - -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif -/* vbe module */ -# ifndef XF86VBE -# define XF86VBE YES -# endif - -# define AgpGartDrivers /**/ - -# define DevelDrivers /**/ - -/* Pure PCI drivers should go first */ -# ifndef XF86CardDrivers -# define XF86CardDrivers mga glint nv tga s3 s3virge sis rendition \ - neomagic tdfx savage cirrus tseng trident \ - chips apm i128 ati ark cyrix siliconmotion \ - vga dummy fbdev vesa -# endif - -#endif /*AMD64Arcitecture*/ - -/* SPARC and UltraSPARC drivers */ - -#if (defined(SparcArchitecture) || defined(Sparc64Architecture)) && \ - !defined(LynxOSArchitecture) && \ - !defined(NetBSDArchitecture) && \ - !defined(OpenBSDArchitecture) -# ifndef XF86Server -# define XF86Server YES -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp YES -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp YES -# endif -/* 8/32wid fb module */ -# ifndef XF8_32Wid -# define XF8_32Wid YES -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* vgahw module */ -# ifndef XF86VgaHw -# define XF86VgaHw YES -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* EXA module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif -/* vbe module */ -# ifndef XF86VBE -# define XF86VBE YES -# endif - -# ifndef DevelDrivers -# if XFree86Devel - /* - * Some of these are compiled just for the fun of it. Undoubtedly some - * require changes (or even removal) for things like endianness, etc. Move - * those known to work into the main XF86CardDrivers #define. - */ -# define DevelDrivers apm ark chips cirrus i128 i740 i810 imstt \ - neomagic newport nv rendition s3virge savage \ - siliconmotion tga trident vmware dummy -# else -# define DevelDrivers /* */ -# endif -# endif - -/* Pure SBUS and PCI drivers should go first */ -# ifndef XF86CardDrivers -# define XF86CardDrivers sunffb sunleo suncg6 suncg3 suncg14 suntcx \ - sunbw2 glint mga tdfx ati vesa vga fbdev \ - XF86OSCardDrivers XF86ExtraCardDrivers \ - DevelDrivers -# endif -#endif - -/* Sparc64 Drivers */ -#if defined(OpenBSDArchitecture) && defined(Sparc64Architecture) -# ifndef XF86Server -# define XF86Server YES -# endif -/* Amiga framebuffer module */ -# ifndef XF86AFB -# define XF86AFB NO -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp YES -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp YES -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* vgahw module */ -# ifndef XF86VgaHw -# define XF86VgaHw YES -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* EXA module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif - -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif -# ifndef UseX86Emu -# define UseX86Emu NO -# endif -/* vbe module */ -# ifndef XF86VBE -# define XF86VBE YES -# endif - -# ifndef DevelDrivers -# if XFree86Devel -# define DevelDrivers /* */ -# else -# define DevelDrivers /* */ -# endif -# endif - -/* Pure PCI drivers should go first */ -# ifndef XF86CardDrivers -# define XF86CardDrivers ati \ - DevelDrivers \ - XF86OSCardDrivers XF86ExtraCardDrivers -# endif -#endif - -/* MIPS drivers */ - -#ifdef MipsArchitecture -# ifndef XF86Server -# define XF86Server YES -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp YES -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp YES -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* vgahw module */ -# ifndef XF86VgaHw -# define XF86VgaHw YES -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* Exa module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif - -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif -/* vbe module */ -# ifndef XF86VBE -# define XF86VBE YES -# endif - -# ifndef DevelDrivers -# if XFree86Devel -# define DevelDrivers /* */ -# else -# define DevelDrivers /* */ -# endif -# endif - -# ifndef XF86CardDrivers -# define XF86CardDrivers mga glint nv s3 s3virge sis savage \ - trident chips tdfx fbdev ati \ - DevelDrivers newport \ - XF86OSCardDrivers XF86ExtraCardDrivers -# endif -#endif - -/* - * DEC Alpha drivers - */ -#ifdef AlphaArchitecture -# ifndef XF86Server -# define XF86Server YES -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp YES -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp YES -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* vgahw module */ -# ifndef XF86VgaHw -# define XF86VgaHw YES -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* Exa module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif -/* vbe module */ -# ifndef XF86VBE -# define XF86VBE YES -# endif - -# ifndef DevelDrivers -# if XFree86Devel -# define DevelDrivers /* */ -# else -# define DevelDrivers /* */ -# endif -# endif - -/* Pure PCI drivers should go first */ -# ifndef XF86CardDrivers -# define XF86CardDrivers mga tdfx glint s3 s3virge rendition tga ati \ - savage nv cirrus DevelDrivers siliconmotion \ - vga XF86OSCardDrivers XF86ExtraCardDrivers -# endif -#endif - -/* - * Motorola 68k and PowerPC drivers - */ -#if defined(PpcArchitecture) || defined(Mc68020Architecture) -# ifndef XF86Server -# define XF86Server YES -# endif -/* Amiga framebuffer module */ -# ifndef XF86AFB -# define XF86AFB YES -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp YES -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp YES -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* vgahw module */ -# ifndef XF86VgaHw -# define XF86VgaHw YES -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* Exa module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif -/* vbe module */ -# ifndef XF86VBE -# define XF86VBE YES -# endif - -# ifndef DevelDrivers -# if XFree86Devel -# define DevelDrivers imstt -# else -# define DevelDrivers /* */ -# endif -# endif - -/* Pure PCI drivers should go first */ -# ifndef XF86CardDrivers -# define XF86CardDrivers ati mga glint nv s3 s3virge sis savage\ - trident chips tdfx fbdev \ - DevelDrivers vga \ - XF86OSCardDrivers XF86ExtraCardDrivers -# endif -#endif - -/* - * Intel StrongARM and Hewlett-Packard PA-RISC - */ -#if defined(Arm32Architecture) || defined(HPArchitecture) -# ifndef XF86Server -# define XF86Server YES -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp YES -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp YES -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* vgahw module */ -# ifndef XF86VgaHw -# define XF86VgaHw YES -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* Exa module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif -/* vbe module */ -# ifndef XF86VBE -# define XF86VBE YES -# endif - -# ifndef DevelDrivers -# if XFree86Devel -# define DevelDrivers /* */ -# else -# define DevelDrivers /* */ -# endif -# endif - -/* Pure PCI drivers should go first */ -# ifndef XF86CardDrivers -# define XF86CardDrivers ati mga glint nv s3 s3virge sis savage\ - trident chips tdfx fbdev \ - DevelDrivers vga \ - XF86OSCardDrivers XF86ExtraCardDrivers -# endif -#endif - -/* SuperH drivers */ - -#if defined(SuperHArchitecture) -# ifndef XF86Server -# define XF86Server YES -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp YES -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp YES -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* Exa module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif -/* vbe module */ -# ifndef XF86VBE -# define XF86VBE YES -# endif - -# ifndef XF86CardDrivers -# define XF86CardDrivers fbdev XF86OSCardDrivers XF86ExtraCardDrivers -# endif -#endif - -/* - * For PowerPC 64bit systems - * only libraries are strictly needed - */ -#if defined(Ppc64Architecture) -# ifndef XF86Server -# define XF86Server YES -# endif -/* Amiga framebuffer module */ -# ifndef XF86AFB -# define XF86AFB NO -# endif -/* 1bpp module */ -# ifndef XF1Bpp -# define XF1Bpp NO -# endif -/* 4bpp module */ -# ifndef XF4Bpp -# define XF4Bpp NO -# endif -/* 8/32bpp overlay module */ -# ifndef XF8_32Bpp -# define XF8_32Bpp YES -# endif -/* 8/16bpp dual fb module */ -# ifndef XF8_16Bpp -# define XF8_16Bpp YES -# endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif -/* shadow fb module */ -# ifndef XFShadowFB -# define XFShadowFB YES -# endif -/* vgahw module */ -# ifndef XF86VgaHw -# define XF86VgaHw NO -# endif -/* fbdevhw module */ -# ifndef XF86FBDevHw -# define XF86FBDevHw YES -# endif -/* XAA module */ -# ifndef XF86XAA -# define XF86XAA YES -# endif -/* Exa module */ -# ifndef XF86EXA -# define XF86EXA YES -# endif -/* ramdac module */ -# ifndef XF86Ramdac -# define XF86Ramdac YES -# endif -/* I2C module */ -# ifndef XF86I2C -# define XF86I2C YES -# endif -/* DDC module */ -# ifndef XF86DDC -# define XF86DDC YES -# endif -/* RAC (Resource Access Control) module */ -# ifndef XF86RAC -# define XF86RAC YES -# endif - -/* int10 module */ -# ifndef XF86Int10 -# define XF86Int10 YES -# endif - -# ifndef DevelDrivers -# if XFree86Devel -# define DevelDrivers -# else -# define DevelDrivers /* */ -# endif -# endif - -/* Pure PCI drivers should go first */ -# ifndef XF86CardDrivers -# define XF86CardDrivers ati mga \ - DevelDrivers \ - XF86OSCardDrivers XF86ExtraCardDrivers -# endif -#endif - -/* - * For Mips/Arc platforms, the default is to build all modules which - * are supported on this platform. - */ -#ifdef ArcArchitecture -# ifndef XF86Server -# define XF86Server YES -# endif -#endif - -#if BuildDebug -# define DebugDefines -DBUILDDEBUG -#else -# define DebugDefines /**/ -#endif - -#ifndef XF86Server -# define XF86Server NO -#endif -#if !XF86Server -# undef DoLoadableServer -# define DoLoadableServer NO -#endif - -/* - * Fbdev module defines. They are set to indicate the fb types supported - * on different architectures. - */ -#ifndef XF86AFB -# define XF86AFB NO -#endif -#ifndef XF86ILBM -# define XF86ILBM NO -#endif -#ifndef XF86IPLAN2P2 -# define XF86IPLAN2P2 NO -#endif -#ifndef XF86IPLAN2P4 -# define XF86IPLAN2P4 NO -#endif -#ifndef XF86IPLAN2P8 -# define XF86IPLAN2P8 NO -#endif -#if XF86AFB -AFB_DEFS = -DUSE_AFB -#endif -#if XF86ILBM -ILBM_DEFS = -DUSE_ILBM -#endif -#if XF86IPLAN2P2 -IPLAN2P2_DEFS = -DUSE_IPLAN2P2 -#endif -#if XF86IPLAN2P4 -IPLAN2P4_DEFS = -DUSE_IPLAN2P4 -#endif -#if XF86IPLAN2P8 -IPLAN2P8_DEFS = -DUSE_IPLAN2P8 -#endif -#ifndef FbdevDefines -# define FbdevDefines $(AFB_DEFS) $(ILBM_DEFS) $(IPLAN2P2_DEFS) \ - $(IPLAN2P4_DEFS) $(IPLAN2P8_DEFS) -#endif - -/* - * Build GLX server interface - * --- Doesn't work for 1-bit and 4-bit servers - */ -#ifndef BuildGlxExt -# define BuildGlxExt YES -#endif - -#if BuildGlxExt - -# define GlxCoreLibDefines -DGLX_USE_MESA - -# if defined(SparcArchitecture) \ - || defined (Sparc64Architecture) \ - || defined(ia64Architecture) \ - || defined(s390xArchitecture) \ - || defined(AMD64Architecture) -# define GlxArchDefines -D__GLX_ALIGN64 -# elif defined(AlphaArchitecture) -/* On the Alpha we need to ensure floating point accuracy for 3D */ -# define GlxArchDefines -D__GLX_ALIGN64 -mieee -# elif defined(DarwinArchitecture) -/* GLX contains lots of uninitialized globals, which can upset Darwin */ -# define GlxArchDefines -fno-common -# else -# define GlxArchDefines /**/ -# endif - -# ifndef GlxExtraDefines -# define GlxExtraDefines GlxCoreLibDefines GlxArchDefines -# endif - -# ifndef UseX86Emu -# define UseX86Emu YES -# endif - -#define X86INT10_STUB 0 -#define X86EMU_GENERIC 1 -#define X86VM 2 -#define X86EMU_OS 3 - -#ifndef XF86INT10_BUILD -# if UseX86Emu -# define XF86INT10_BUILD X86EMU_GENERIC -# else -# define XF86INT10_BUILD X86INT10_STUB -# endif -#endif -/* - * Build the Rush extension library (non standard extension for cooperation - * between glide library and X server). Enabled by default only for Linux. - */ -#ifndef BuildXF86RushExt -# define BuildXF86RushExt NO -#endif - -#ifndef BuildRECORDlib -# define BuildRECORDlib YES -#endif - -#ifndef BuildXKBlib -# define BuildXKBlib YES -#endif - -#ifndef BuildScreenSaverExt -# define BuildScreenSaverExt YES -#endif - -/* - * Build XInput support - */ -#ifndef BuildXInputExt -# define BuildXInputExt YES -#endif - -/* Build Xinerama (aka panoramiX) extension */ -#ifndef BuildXinerama -# define BuildXinerama YES -#endif - -/* Build Render extension */ -#ifndef BuildRender -# define BuildRender YES -#endif - -#if 0 -#ifndef JoystickSupport -# define JoystickSupport NO -#endif -#endif - -#if 0 -/* - * Build the extra extension libs even when not including the extra extensions - * in the servers - */ -#ifndef BuildXF86MiscLibrary -# define BuildXF86MiscLibrary YES -#endif -#ifndef BuildXF86DGALibrary -# define BuildXF86DGALibrary YES -#endif -#ifndef BuildXF86VidModeLibrary -# define BuildXF86VidModeLibrary YES -#endif -#endif - -/* - * Build the XFree86-VidMode extension - */ -#ifndef BuildXF86VidModeExt -# define BuildXF86VidModeExt YES -#endif - -/* Don't build this now because the interface hasn't been done yet */ -/* - * Build the XFree86-Misc extension - */ -#ifndef BuildXF86MiscExt -# define BuildXF86MiscExt YES -#endif - -/* - * Build the XFree86-Bigfont extension - */ -#ifndef BuildXF86BigfontExt -# define BuildXF86BigfontExt YES -#endif - -/* - * Build the XFree86 DGA support - */ -#ifndef BuildXF86DGA -# define BuildXF86DGA YES -#endif - -/* - * Build the DPMS extension support - */ -#ifndef BuildDPMSExt -# define BuildDPMSExt YES -#endif - -/* - * Build the X Video Extension - */ -#ifndef BuildXvExt -# define BuildXvExt YES -#endif - -/* - * Build the X Video Motion Compensation Extension - */ -#ifndef BuildXvMCExt -# define BuildXvMCExt YES -#endif - -/* - * Build the X-Resource Extension - */ -#ifndef BuildXResExt -# define BuildXResExt YES -#endif - -#if Malloc0ReturnsNull -# ifndef XtMalloc0ReturnsNullDefines -# define XtMalloc0ReturnsNullDefines Malloc0ReturnsNullDefines -DXTMALLOC_BC -# endif -#endif - -#ifndef UseInternalMalloc -# define UseInternalMalloc NO -#endif - -#ifndef HasDlsymBug -# define HasDlsymBug NO -#endif - -#ifndef HasMTRRSupport -# define HasMTRRSupport NO -#endif - -/* - * Build scanpci? - */ -#ifndef SystemV -#define SystemV NO -#endif -#ifndef SystemV4 -#define SystemV4 NO -#endif -#ifndef BuildScanpci -# if SystemV || SystemV4 || \ - (defined(LinuxArchitecture) && !defined(Mc68020Architecture)) || \ - defined(i386BsdArchitecture) || defined(LynxOSArchitecture) || \ - defined(OS2Architecture) || defined(GNUMachArchitecture) || \ - (defined(KFreeBSDArchitecture) && defined(i386Architecture)) -# define BuildScanpci YES -# else -# define BuildScanpci NO -# endif -#endif - -/* Disable stripping installed programs for this release. */ -#ifndef StripInstalledPrograms -# define StripInstalledPrograms NO -#endif - -#ifndef InstallJapaneseDocs -#define InstallJapaneseDocs NO -#endif - -#if BuildXF86DGA -# define XFree86DGADefines -DXFreeXDGA -#else -# define XFree86DGADefines /**/ -#endif - -#if BuildXvExt -# define XFree86XvDefines -DXvExtension -#else -# define XFree86XvDefines /**/ -#endif - -#if BuildXvMCExt -# define XFree86XvMCDefines -DXvMCExtension -#else -# define XFree86XvMCDefines /**/ -#endif - -#if BuildXResExt -# define XFree86XResDefines -DXResExtension -#else -# define XFree86XResDefines /**/ -#endif - -#ifndef DlopenHack -# define DlopenHack -DDLOPEN_HACK -#endif - -#ifndef ExtraLoaderDefines -# if MakeDllModules -# define ExtraLoaderDefines DlopenHack -# else -# define ExtraLoaderDefines /**/ -# endif -#endif - -#if DoLoadableServer -# define XFree86LoaderDefines -DXFree86LOADER ExtraLoaderDefines -#else -# define XFree86LoaderDefines /**/ -#endif - -#ifndef HasBsdMake -#define HasBsdMake NO -#endif - -#ifndef MakeHasPosixVariableSubstitutions -# if !HasBsdMake && !defined(SunArchitecture) -# define MakeHasPosixVariableSubstitutions NO -# else -# define MakeHasPosixVariableSubstitutions YES -# endif -#endif - -#ifndef UseSmartScheduler -#define UseSmartScheduler YES -#endif - -#if UseSmartScheduler -#define SmartScheduleDefines -DSMART_SCHEDULE -#else -#define SmartScheduleDefines /**/ -#endif - -/* Server defines required for all OSs */ -#ifndef XFree86ServerDefines -# define XFree86ServerDefines -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH \ - XFree86DGADefines XFree86XvDefines \ - XFree86LoaderDefines -DXFree86Server \ - VidModeExtensionDefines \ - XFree86XvMCDefines \ - SmartScheduleDefines \ - DebugDefines XFree86XResDefines \ - -DX_BYTE_ORDER=$(X_BYTE_ORDER) -#endif - -#ifndef XFree86ServerOSDefines -# define XFree86ServerOSDefines -DDDXOSINIT -DSERVER_LOCK -DDDXOSFATALERROR \ - -DDDXOSVERRORF -#endif - -#ifndef XFree86ConsoleDefines -# if defined(i386BsdArchitecture) || defined(AlphaBsdArchitecture) || (defined(KFreeBSDArchitecture) && defined(i386Architecture)) -# define XFree86ConsoleDefines -DPCCONS_SUPPORT -DSYSCONS_SUPPORT -DPCVT_SUPPORT -# elif defined(KFreeBSDArchitecture) -# define XFree86ConsoleDefines -DSYSCONS_SUPPORT -# else -# define XFree86ConsoleDefines /**/ -# endif -#endif - -/* Support for USB mouse */ -#ifndef UsbMouseSupport -# define UsbMouseSupport NO -#endif -/* Does this OS have libusb ? */ -#ifndef HasLibUsb -# define HasLibUsb NO -#endif - -#ifndef UseServerLock -# define UseServerLock YES -#endif - -#ifndef ServerExtraDefines -# define ServerExtraDefines XFree86ServerDefines -#endif - -#ifndef ServerOSDefines -# define ServerOSDefines XFree86ServerOSDefines -#endif - -#ifndef DriverSDKDir -# define DriverSDKDir $(USRLIBDIR)/Server -#endif - -#ifndef DriverSDKModuleDir -# define DriverSDKModuleDir $(USRLIBDIR)/Server/modules -#endif - -#ifndef DriverSDKIncludeDir -# define DriverSDKIncludeDir $(USRLIBDIR)/Server/include -#endif - -DRIVERSDKDIR = DriverSDKDir -DRIVERSDKMODULEDIR = DriverSDKModuleDir -DRIVERSDKINCLUDEDIR = DriverSDKIncludeDir - -/* - * Some commonly refered to directories are defined here. - */ - - XF86SRC = $(SERVERSRC)/hw/xfree86 - XF86COMSRC = $(XF86SRC)/common - XF86PARSERSRC = $(XF86SRC)/parser - XF86OSSRC = $(XF86SRC)/os-support - XF86DRIVERSRC = $(XF86SRC)/drivers - DRIVERSRC = $(XF86DRIVERSRC) - -/* - * Installed location of the XFree86 documentation - */ - - XFREE86DOCDIR = $(DOCDIR) - XFREE86PSDOCDIR = $(DOCPSDIR) - XFREE86PDFDOCDIR = $(DOCPDFDIR) - XFREE86HTMLDOCDIR = $(DOCHTMLDIR) -XFREE86JAPANESEDOCDIR = $(DOCDIR)/Japanese - -/* - * Other stuff used in the X Server source. - */ - -#ifndef OtherIConfigFiles -# define OtherIConfigFiles $(IRULESRC)/xfree86.cf $(IRULESRC)/xf86.rules -#endif - -#ifndef UseRgbTxt -# define UseRgbTxt YES -#endif - -#ifndef ManSuffix -# define ManSuffix 1 -#endif - -/* - * GNU Compiler stuff - */ -#ifndef HasGcc3 -# define HasGcc3 NO -#endif -#ifndef HasGcc2 -# define HasGcc2 HasGcc3 -#endif -#ifndef HasGcc -# define HasGcc HasGcc2 -#endif -#ifndef HasGcc2ForCplusplus -# define HasGcc2ForCplusplus HasGcc2 -#endif - -#if HasGcc -# ifndef Gcc28Warnings -# if (GccMajorVersion > 2) || \ - ((GccMajorVersion == 2) && (GccMinorVersion >= 8)) -# define Gcc28Warnings -Wundef -# else -# define Gcc28Warnings /* */ -# endif -# endif -# ifndef GccWarningOptions -# if XFree86Devel -# define GccWarningOptions -Wall -Wpointer-arith -Wstrict-prototypes \ - -Wmissing-prototypes -Wmissing-declarations \ - -Wredundant-decls -Wnested-externs Gcc28Warnings -# else -# define GccWarningOptions -Wall -Wpointer-arith Gcc28Warnings -# endif -# endif -# ifndef DefaultCCOptions -# if defined(UseInstalled) -# define DefaultCCOptions /* -ansi */ -# else -# define DefaultCCOptions -ansi GccWarningOptions -# endif -# endif -# if defined(UseInstalled) -# ifndef UseGccMakeDepend -# define UseGccMakeDepend YES -# endif -# endif -#endif - -/* Make imake noisier. Note that this is ineffective for 3.0 <= GCC <= 3.2 */ -#ifndef ImakeWarningFlags -# ifdef Gcc28Warnings -# define ImakeWarningFlags Gcc28Warnings -# else -# define ImakeWarningFlags /* */ -# endif -#endif - -#if (GccMajorVersion == 3) && (GccMinorVersion >= 1) -# define GccAliasingArgs -fno-strict-aliasing -#else -# define GccAliasingArgs /* */ -#endif - -#if HasGcc2 && defined(i386Architecture) -# ifndef DefaultGcc2i386Opt -# define DefaultGcc2i386Opt -O2 -fno-strength-reduce GccAliasingArgs -# endif -#endif - -#if HasGcc2 && defined(AMD64Architecture) -# ifndef DefaultGcc2AMD64Opt -# define DefaultGcc2AMD64Opt -O2 -fno-strength-reduce GccAliasingArgs -# endif -#endif - -#if HasGcc2 && defined(AlphaArchitecture) -# ifndef DefaultGcc2AxpOpt -# define DefaultGcc2AxpOpt -O2 GccAliasingArgs -# endif -#endif - -#if HasGcc2 && defined(Ppc64Architecture) -# ifndef DefaultGcc2Ppc64Opt -# define DefaultGcc2Ppc64Opt -O2 GccAliasingArgs -# endif -#endif - -#if HasGcc2 && defined(PpcArchitecture) -# ifndef DefaultGcc2PpcOpt -# define DefaultGcc2PpcOpt -O2 GccAliasingArgs -# endif -#endif - -#ifndef DefaultGcc2DebugOpt -# define DefaultGcc2DebugOpt -g -#endif - -#ifndef DebuggableLibraries -# define DebuggableLibraries NO -#endif - -#if HasGcc2 && DebuggableLibraries -# define LibraryDebugOpt DefaultGcc2DebugOpt -#endif - -/* - * Some versions of gcc have optimisation bugs that cause problems building - * some files. The definitions here cover those. - */ - -#ifndef Egcs112Bug - /* Not exactly precise, but it'll do for now... */ -# if HasGcc2 && defined(i386Architecture) && \ - (GccMajorVersion == 2) && (GccMinorVersion > 8) -# define Egcs112Bug YES -# else -# define Egcs112Bug NO -# endif -#endif - -#ifdef i386Architecture -# ifndef HasX86Support -# define HasX86Support YES -# endif -# ifndef HasMMXSupport -# define HasMMXSupport YES -# endif -# ifndef HasSSESupport -# define HasSSESupport NO -# endif -# ifndef Has3DNowSupport -# define Has3DNowSupport NO -# endif -#elif defined (AMD64Architecture) -# ifndef HasX86Support -# define HasX86Support NO -# endif -# ifndef HasMMXSupport -# define HasMMXSupport NO -# endif -# ifndef HasSSESupport -# define HasSSESupport NO -# endif -# ifndef Has3DNowSupport -# define Has3DNowSupport NO -# endif -#else -# ifndef HasX86Support -# define HasX86Support NO -# endif -# ifndef HasMMXSupport -# define HasMMXSupport NO -# endif -# ifndef HasSSESupport -# define HasSSESupport NO -# endif -# ifndef Has3DNowSupport -# define Has3DNowSupport NO -# endif -#endif - -#ifndef StaticNeedsPicForShared -# if defined (AMD64Architecture)\ - || defined (AlphaArchitecture) \ - || defined (ia64Architecture) \ - || defined (PpcArchitecture) \ - || defined (SparcArchitecture) \ - || defined (s390xArchitecture) -# define StaticNeedsPicForShared YES -# else -# define StaticNeedsPicForShared NO -# endif -#endif - -#ifndef XF8_32Wid -# define XF8_32Wid NO -#endif - -#if CrossCompiling -#include -#endif -#include - diff --git a/nx-X11/config/cf/xorg.cf b/nx-X11/config/cf/xorg.cf index 05b82f885..43a925d7a 100644 --- a/nx-X11/config/cf/xorg.cf +++ b/nx-X11/config/cf/xorg.cf @@ -1140,7 +1140,7 @@ XFREE86JAPANESEDOCDIR = $(DOCDIR)/Japanese */ #ifndef OtherIConfigFiles -# define OtherIConfigFiles $(IRULESRC)/xfree86.cf $(IRULESRC)/xf86.rules +# define OtherIConfigFiles $(IRULESRC)/xf86.rules #endif #ifndef UseRgbTxt diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile index deae53bb3..ee728b556 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile @@ -21,13 +21,6 @@ LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) COMMON_SRCS = driverfuncs.c COMMON_OBJS = driverfuncs.o -#ifndef XFree86Version - -/* This appears to be the quickest way to build a non-XFree86 server */ -GLXSRV_DEFINES = -DXFree86Server - -#endif - GLX_SRCS = xf86glx.c xf86glx_util.c compsize.c GLX_OBJS = xf86glx.o xf86glx_util.o compsize.o diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index 5ddfb9b5e..43d49d085 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -34,7 +34,7 @@ XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.296 2003/11/23 06:47:00 torrey #define dependLib(x) #endif -#if (defined (XFree86Version) || defined(XorgVersion)) +#if defined(XorgVersion) /* Do not strip server binaries */ INSTPGMFLAGS = #endif @@ -89,7 +89,7 @@ INSTPGMFLAGS = #if BuildXKB XKBEXT = xkb/LibraryTargetName(xkb) dependLib($(OS)) XKBDIR = xkb -#if (defined(XFree86Version) || defined(XorgVersion)) +#if defined(XorgVersion) XF86XKBOBJS = xkb/xf86KillSrv.o xkb/xf86VT.o xkb/xf86Private.o #endif #endif diff --git a/nx-X11/programs/Xserver/Xext/Imakefile b/nx-X11/programs/Xserver/Xext/Imakefile index f44edb172..eb4588e37 100644 --- a/nx-X11/programs/Xserver/Xext/Imakefile +++ b/nx-X11/programs/Xserver/Xext/Imakefile @@ -55,15 +55,13 @@ SUBDIRS = extmod #endif #if BuildXF86VidModeExt && \ - ((defined(XF86Server) && XF86Server) || \ - (defined(XorgServer) && XorgServer)) + (defined(XorgServer) && XorgServer) VIDMODESRCS = xf86vmode.c VIDMODEOBJS = xf86vmode.o #endif #if BuildXF86MiscExt && \ - ((defined(XF86Server) && XF86Server) || \ - (defined(XorgServer) && XorgServer)) + (defined(XorgServer) && XorgServer) XF86MISCSRCS = xf86misc.c XF86MISCOBJS = xf86misc.o #endif @@ -157,7 +155,7 @@ NX_DEFINES = -DNXAGENT_SERVER #endif -#if (defined(XFree86Version) || defined(XorgVersion)) +#if defined(XorgVersion) /* XXX Check if this can be eliminated */ XF86INCLUDES = -I$(XF86COMSRC) #endif diff --git a/nx-X11/programs/Xserver/include/Imakefile b/nx-X11/programs/Xserver/include/Imakefile index 210067635..d68ef940c 100644 --- a/nx-X11/programs/Xserver/include/Imakefile +++ b/nx-X11/programs/Xserver/include/Imakefile @@ -7,7 +7,7 @@ XCOMM $XFree86: xc/programs/Xserver/include/Imakefile,v 3.21 2001/01/17 22:36:56 HEADERS = os.h misc.h -#if defined(XorgVersion) || defined(XFree86Version) \ +#if defined(XorgVersion) \ || defined(BSDOSArchitecture) #if DoLoadableServer LinkSourceFile(xf86Module.h,$(XF86COMSRC)) diff --git a/nx-X11/programs/Xserver/mi/Imakefile b/nx-X11/programs/Xserver/mi/Imakefile index 24caa0299..e62fb0005 100644 --- a/nx-X11/programs/Xserver/mi/Imakefile +++ b/nx-X11/programs/Xserver/mi/Imakefile @@ -62,7 +62,7 @@ OBJS = $(CBRT_OBJ) mivaltree.o mipolyseg.o mipolyrect.o \ mipointer.o misprite.o midispcur.o miscrinit.o miclipn.o migc.o \ micmap.o mioverlay.o -#if (defined (XFree86Version) || defined(XorgVersion)) +#if defined(XorgVersion) /* * Make sure XINPUT, XF86VidTune, etc aren't defined for the miinitext.o * used by Xnest, Xvfb diff --git a/nx-X11/programs/Xserver/xkb/Imakefile b/nx-X11/programs/Xserver/xkb/Imakefile index a718545b1..2ac6fe32d 100644 --- a/nx-X11/programs/Xserver/xkb/Imakefile +++ b/nx-X11/programs/Xserver/xkb/Imakefile @@ -29,7 +29,7 @@ XKB_DDXDEFS = XkbServerDefines NX_DEFINES = -DNXAGENT_SERVER #endif -#if (defined(XF86Server) && XF86Server) || (defined(XorgServer) && XorgServer) +#if (defined(XorgServer) && XorgServer) XF86INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) XF86_OBJS = xf86KillSrv.o xf86VT.o xf86Private.o #endif @@ -62,7 +62,7 @@ NormalLibraryTarget(xkb,$(OBJS)) LintLibraryTarget(xkb,$(SRCS)) NormalLintTarget($(SRCS)) -#if (defined(XF86Server) && XF86Server) || (defined(XorgServer) && XorgServer) +#if (defined(XorgServer) && XorgServer) ObjectFromSpecialSource(xf86KillSrv,ddxKillSrv,-DXF86DDXACTIONS) ObjectFromSpecialSource(xf86VT,ddxVT,-DXF86DDXACTIONS) ObjectFromSpecialSource(xf86Private,ddxPrivate,-DXF86DDXACTIONS) -- cgit v1.2.3 From 68dd0b52e13c844d662192654fb10cb993257a59 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 22 Jun 2015 09:36:08 +0200 Subject: Replace 'pointer' type with 'void *' This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt Rebased against NX: Mike Gabriel --- nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c | 6 +- nx-X11/include/Xdefs.h | 4 +- nx-X11/include/extensions/XKBsrv.h | 6 +- nx-X11/include/extensions/lbxopts.h | 4 +- nx-X11/include/extensions/syncstr.h | 12 +-- nx-X11/include/extensions/xtrapproto.h | 2 +- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 4 +- nx-X11/programs/Xserver/GL/glx/glxext.c | 4 +- nx-X11/programs/Xserver/GL/glxmodule.c | 6 +- .../programs/Xserver/GL/mesa/GLcore/GLcoremodule.c | 6 +- nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c | 6 +- nx-X11/programs/Xserver/XTrap/xtrapdi.c | 6 +- nx-X11/programs/Xserver/Xext/appgroup.c | 14 ++-- nx-X11/programs/Xserver/Xext/appgroup.h | 4 +- nx-X11/programs/Xserver/Xext/extmod/modinit.c | 8 +- nx-X11/programs/Xserver/Xext/mbuf.c | 58 +++++++------- nx-X11/programs/Xserver/Xext/mbufbf.c | 6 +- nx-X11/programs/Xserver/Xext/mbufpx.c | 6 +- nx-X11/programs/Xserver/Xext/panoramiX.c | 18 ++--- nx-X11/programs/Xserver/Xext/panoramiXsrv.h | 2 +- nx-X11/programs/Xserver/Xext/saver.c | 14 ++-- nx-X11/programs/Xserver/Xext/security.c | 22 +++--- nx-X11/programs/Xserver/Xext/shape.c | 18 ++--- nx-X11/programs/Xserver/Xext/shm.c | 22 +++--- nx-X11/programs/Xserver/Xext/sleepuntil.c | 38 ++++----- nx-X11/programs/Xserver/Xext/sleepuntil.h | 4 +- nx-X11/programs/Xserver/Xext/sync.c | 68 ++++++++-------- nx-X11/programs/Xserver/Xext/vidmodeproc.h | 32 ++++---- nx-X11/programs/Xserver/Xext/xevie.c | 26 +++--- nx-X11/programs/Xserver/Xext/xf86dga2.c | 8 +- nx-X11/programs/Xserver/Xext/xf86misc.c | 12 +-- nx-X11/programs/Xserver/Xext/xf86miscproc.h | 20 ++--- nx-X11/programs/Xserver/Xext/xf86vmode.c | 20 ++--- nx-X11/programs/Xserver/Xext/xres.c | 6 +- nx-X11/programs/Xserver/Xext/xtest1dd.c | 2 +- nx-X11/programs/Xserver/Xext/xtest1di.c | 4 +- nx-X11/programs/Xserver/Xext/xvmain.c | 28 +++---- nx-X11/programs/Xserver/Xext/xvmc.c | 12 +-- nx-X11/programs/Xserver/Xext/xvmcext.h | 8 +- nx-X11/programs/Xserver/Xi/devbell.c | 6 +- nx-X11/programs/Xserver/Xi/exevents.c | 6 +- nx-X11/programs/Xserver/Xi/stubs.c | 2 +- nx-X11/programs/Xserver/composite/compext.c | 12 +-- nx-X11/programs/Xserver/composite/compinit.c | 8 +- nx-X11/programs/Xserver/composite/compwindow.c | 10 +-- nx-X11/programs/Xserver/damageext/damageext.c | 10 +-- nx-X11/programs/Xserver/dbe/dbe.c | 32 ++++---- nx-X11/programs/Xserver/dbe/dbemodule.c | 6 +- nx-X11/programs/Xserver/dbe/midbe.c | 8 +- nx-X11/programs/Xserver/dix/colormap.c | 18 ++--- nx-X11/programs/Xserver/dix/cursor.c | 4 +- nx-X11/programs/Xserver/dix/devices.c | 2 +- nx-X11/programs/Xserver/dix/dispatch.c | 46 +++++------ nx-X11/programs/Xserver/dix/dixfonts.c | 56 ++++++------- nx-X11/programs/Xserver/dix/dixutils.c | 56 ++++++------- nx-X11/programs/Xserver/dix/events.c | 14 ++-- nx-X11/programs/Xserver/dix/gc.c | 14 ++-- nx-X11/programs/Xserver/dix/glyphcurs.c | 2 +- nx-X11/programs/Xserver/dix/grabs.c | 6 +- nx-X11/programs/Xserver/dix/main.c | 2 +- nx-X11/programs/Xserver/dix/pixmap.c | 6 +- nx-X11/programs/Xserver/dix/property.c | 16 ++-- nx-X11/programs/Xserver/dix/resource.c | 34 ++++---- nx-X11/programs/Xserver/dix/window.c | 22 +++--- nx-X11/programs/Xserver/fb/fb.h | 12 +-- nx-X11/programs/Xserver/fb/fb24_32.c | 4 +- nx-X11/programs/Xserver/fb/fb24_32.h | 4 +- nx-X11/programs/Xserver/fb/fballpriv.c | 2 +- nx-X11/programs/Xserver/fb/fbglyph.c | 4 +- nx-X11/programs/Xserver/fb/fboverlay.c | 16 ++-- nx-X11/programs/Xserver/fb/fboverlay.h | 10 +-- nx-X11/programs/Xserver/fb/fbpixmap.c | 2 +- nx-X11/programs/Xserver/fb/fbpseudocolor.c | 60 +++++++------- nx-X11/programs/Xserver/fb/fbscreen.c | 8 +- nx-X11/programs/Xserver/fb/fbwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 16 ++-- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 16 ++-- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 6 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Font.c | 14 ++-- nx-X11/programs/Xserver/hw/nxagent/Font.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/GC.c | 22 +++--- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/GCs.h | 6 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.h | 8 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 10 +-- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 10 +-- nx-X11/programs/Xserver/hw/nxagent/Keyboard.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdamage.c | 10 +-- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 48 +++++------ nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 76 +++++++++--------- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 14 ++-- nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 24 +++--- nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 26 +++--- nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h | 12 +-- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 30 +++---- nx-X11/programs/Xserver/hw/nxagent/NXresource.c | 38 ++++----- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 22 +++--- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 22 +++--- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 12 +-- nx-X11/programs/Xserver/hw/nxagent/Render.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 22 +++--- nx-X11/programs/Xserver/hw/nxagent/Window.c | 38 ++++----- .../Xserver/hw/xfree86/os-support/xf86_ansic.h | 4 +- nx-X11/programs/Xserver/include/closestr.h | 2 +- nx-X11/programs/Xserver/include/colormap.h | 8 +- nx-X11/programs/Xserver/include/colormapst.h | 2 +- nx-X11/programs/Xserver/include/cursor.h | 2 +- nx-X11/programs/Xserver/include/cursorstr.h | 4 +- nx-X11/programs/Xserver/include/dix.h | 50 ++++++------ nx-X11/programs/Xserver/include/dixfont.h | 6 +- nx-X11/programs/Xserver/include/dixgrabs.h | 2 +- nx-X11/programs/Xserver/include/dixstruct.h | 16 ++-- nx-X11/programs/Xserver/include/extnsionst.h | 2 +- nx-X11/programs/Xserver/include/gc.h | 10 ++- nx-X11/programs/Xserver/include/gcstruct.h | 8 +- nx-X11/programs/Xserver/include/input.h | 4 +- nx-X11/programs/Xserver/include/misc.h | 5 ++ nx-X11/programs/Xserver/include/miscstruct.h | 2 +- nx-X11/programs/Xserver/include/os.h | 56 ++++++------- nx-X11/programs/Xserver/include/pixmap.h | 2 +- nx-X11/programs/Xserver/include/property.h | 2 +- nx-X11/programs/Xserver/include/propertyst.h | 2 +- nx-X11/programs/Xserver/include/resource.h | 34 ++++---- nx-X11/programs/Xserver/include/scrnintstr.h | 22 +++--- nx-X11/programs/Xserver/include/window.h | 8 +- nx-X11/programs/Xserver/include/windowstr.h | 2 +- nx-X11/programs/Xserver/mfb/maskbits.h | 2 +- nx-X11/programs/Xserver/mi/mi.h | 10 +-- nx-X11/programs/Xserver/mi/miarc.c | 4 +- nx-X11/programs/Xserver/mi/mibank.c | 24 +++--- nx-X11/programs/Xserver/mi/mibank.h | 4 +- nx-X11/programs/Xserver/mi/mibstore.c | 62 +++++++-------- nx-X11/programs/Xserver/mi/midispcur.c | 28 +++---- nx-X11/programs/Xserver/mi/miexpose.c | 8 +- nx-X11/programs/Xserver/mi/mifillarc.h | 2 +- nx-X11/programs/Xserver/mi/migc.c | 8 +- nx-X11/programs/Xserver/mi/migc.h | 2 +- nx-X11/programs/Xserver/mi/miglblt.c | 4 +- nx-X11/programs/Xserver/mi/mioverlay.c | 6 +- nx-X11/programs/Xserver/mi/mipointer.c | 10 +-- nx-X11/programs/Xserver/mi/mipolyrect.c | 2 +- nx-X11/programs/Xserver/mi/miscrinit.c | 20 ++--- nx-X11/programs/Xserver/mi/misprite.c | 20 ++--- nx-X11/programs/Xserver/mi/miwindow.c | 4 +- nx-X11/programs/Xserver/miext/cw/cw.c | 12 +-- nx-X11/programs/Xserver/miext/cw/cw.h | 6 +- nx-X11/programs/Xserver/miext/cw/cw_ops.c | 8 +- nx-X11/programs/Xserver/miext/damage/damage.c | 10 +-- nx-X11/programs/Xserver/miext/damage/damagestr.h | 2 +- nx-X11/programs/Xserver/os/WaitFor.c | 18 ++--- nx-X11/programs/Xserver/os/access.c | 92 +++++++++++----------- nx-X11/programs/Xserver/os/connection.c | 8 +- nx-X11/programs/Xserver/os/io.c | 6 +- nx-X11/programs/Xserver/os/k5auth.c | 10 +-- nx-X11/programs/Xserver/os/log.c | 2 +- nx-X11/programs/Xserver/os/osdep.h | 8 +- nx-X11/programs/Xserver/os/rpcauth.c | 4 +- nx-X11/programs/Xserver/os/utils.c | 32 ++++---- nx-X11/programs/Xserver/os/xalloc.c | 18 ++--- nx-X11/programs/Xserver/os/xdmcp.c | 20 ++--- nx-X11/programs/Xserver/randr/randr.c | 18 ++--- nx-X11/programs/Xserver/randr/randrstr.h | 6 +- nx-X11/programs/Xserver/randr/rrcrtc.c | 4 +- nx-X11/programs/Xserver/randr/rrdispatch.c | 4 +- nx-X11/programs/Xserver/randr/rrmode.c | 4 +- nx-X11/programs/Xserver/randr/rroutput.c | 4 +- nx-X11/programs/Xserver/randr/rrproperty.c | 12 +-- nx-X11/programs/Xserver/record/record.c | 66 ++++++++-------- nx-X11/programs/Xserver/record/recordmod.c | 6 +- nx-X11/programs/Xserver/render/animcur.c | 8 +- nx-X11/programs/Xserver/render/glyph.c | 24 +++--- nx-X11/programs/Xserver/render/glyphstr.h | 8 +- nx-X11/programs/Xserver/render/miglyph.c | 8 +- nx-X11/programs/Xserver/render/mipict.c | 8 +- nx-X11/programs/Xserver/render/mipict.h | 2 +- nx-X11/programs/Xserver/render/mirect.c | 2 +- nx-X11/programs/Xserver/render/picture.c | 24 +++--- nx-X11/programs/Xserver/render/picturestr.h | 12 +-- nx-X11/programs/Xserver/render/render.c | 26 +++--- nx-X11/programs/Xserver/xfixes/cursor.c | 28 +++---- nx-X11/programs/Xserver/xfixes/region.c | 14 ++-- nx-X11/programs/Xserver/xfixes/select.c | 10 +-- nx-X11/programs/Xserver/xfixes/xfixes.c | 4 +- nx-X11/programs/Xserver/xkb/ddxBeep.c | 10 +-- nx-X11/programs/Xserver/xkb/xkb.c | 8 +- nx-X11/programs/Xserver/xkb/xkb.h | 2 +- nx-X11/programs/Xserver/xkb/xkbAccessX.c | 28 +++---- nx-X11/programs/Xserver/xkb/xkbActions.c | 6 +- nx-X11/programs/Xserver/xkb/xkbEvents.c | 8 +- nx-X11/programs/Xserver/xkb/xkbInit.c | 6 +- nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c | 4 +- 206 files changed, 1395 insertions(+), 1384 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c index 664f365df..6ec65faa9 100644 --- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c +++ b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c @@ -115,7 +115,7 @@ static unsigned long read_pixel( XMesaDisplay *dpy, XMesaDestroyImage( pixel ); } #else - (*dpy->GetImage)(d, x, y, 1, 1, ZPixmap, ~0L, (pointer)&p); + (*dpy->GetImage)(d, x, y, 1, 1, ZPixmap, ~0L, (void *)&p); #endif return p; } @@ -3834,7 +3834,7 @@ get_row_ci(GLcontext *ctx, struct gl_renderbuffer *rb, #else (*xmesa->display->GetImage)(xrb->drawable, x, y, n, 1, ZPixmap, - ~0L, (pointer)index); + ~0L, (void *)index); #endif } else if (xrb->ximage) { @@ -3869,7 +3869,7 @@ get_row_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, error = (!span->data); (*xmesa->display->GetImage)(xrb->drawable, x, YFLIP(xrb, y), n, 1, ZPixmap, - ~0L, (pointer)span->data); + ~0L, (void *)span->data); #else int k; y = YFLIP(xrb, y); diff --git a/nx-X11/include/Xdefs.h b/nx-X11/include/Xdefs.h index 9e77e30b8..f32149db5 100644 --- a/nx-X11/include/Xdefs.h +++ b/nx-X11/include/Xdefs.h @@ -103,8 +103,8 @@ typedef FSID AccContext; typedef struct timeval **OSTimePtr; -typedef void (* BlockHandlerProcPtr)(pointer /* blockData */, +typedef void (* BlockHandlerProcPtr)(void * /* blockData */, OSTimePtr /* pTimeout */, - pointer /* pReadmask */); + void * /* pReadmask */); #endif diff --git a/nx-X11/include/extensions/XKBsrv.h b/nx-X11/include/extensions/XKBsrv.h index 4a9d8edcb..0d262e979 100644 --- a/nx-X11/include/extensions/XKBsrv.h +++ b/nx-X11/include/extensions/XKBsrv.h @@ -294,7 +294,7 @@ extern char * XkbModelUsed,*XkbLayoutUsed,*XkbVariantUsed,*XkbOptionsUsed; extern Bool noXkbExtension; extern Bool XkbWantRulesProp; -extern pointer XkbLastRepeatEvent; +extern void * XkbLastRepeatEvent; extern CARD32 xkbDebugFlags; extern CARD32 xkbDebugCtrls; @@ -336,7 +336,7 @@ extern int DeviceButtonPress,DeviceButtonRelease; #define IsKeypadKey(s) XkbKSIsKeypad(s) #define Status int -#define XPointer pointer +#define XPointer void * #define Display struct _XDisplay #ifndef True @@ -715,7 +715,7 @@ extern void XkbHandleBell( BOOL /* eventOnly */, DeviceIntPtr /* kbd */, CARD8 /* percent */, - pointer /* ctrl */, + void * /* ctrl */, CARD8 /* class */, Atom /* name */, WindowPtr /* pWin */, diff --git a/nx-X11/include/extensions/lbxopts.h b/nx-X11/include/extensions/lbxopts.h index ac1e12121..3ec81fcb2 100644 --- a/nx-X11/include/extensions/lbxopts.h +++ b/nx-X11/include/extensions/lbxopts.h @@ -96,8 +96,8 @@ struct iovec { typedef void *LbxStreamCompHandle; typedef struct _LbxStreamOpts { - LbxStreamCompHandle (*streamCompInit)(int fd, pointer arg); - pointer streamCompArg; + LbxStreamCompHandle (*streamCompInit)(int fd, void * arg); + void * streamCompArg; int (*streamCompStuffInput)( int fd, unsigned char *buf, diff --git a/nx-X11/include/extensions/syncstr.h b/nx-X11/include/extensions/syncstr.h index 4e384f22e..10ca9188a 100644 --- a/nx-X11/include/extensions/syncstr.h +++ b/nx-X11/include/extensions/syncstr.h @@ -396,11 +396,11 @@ typedef struct _SysCounterInfo { CARD64 bracket_less; SyncCounterType counterType; /* how can this counter change */ void (*QueryValue)( - pointer /*pCounter*/, + void * /*pCounter*/, CARD64 * /*freshvalue*/ ); void (*BracketValues)( - pointer /*pCounter*/, + void * /*pCounter*/, CARD64 * /*lessthan*/, CARD64 * /*greaterthan*/ ); @@ -465,16 +465,16 @@ typedef union { } SyncAwaitUnion; -extern pointer SyncCreateSystemCounter( +extern void * SyncCreateSystemCounter( char * /* name */, CARD64 /* inital_value */, CARD64 /* resolution */, SyncCounterType /* change characterization */, void (* /*QueryValue*/ ) ( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pValue_return */), /* XXX prototype */ void (* /*BracketValues*/) ( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pbracket_less */, CARD64 * /* pbracket_greater */) ); @@ -485,7 +485,7 @@ extern void SyncChangeCounter( ); extern void SyncDestroySystemCounter( - pointer pCounter + void * pCounter ); extern void InitServertime(void); diff --git a/nx-X11/include/extensions/xtrapproto.h b/nx-X11/include/extensions/xtrapproto.h index b3e29cfaa..7eb8f9d47 100644 --- a/nx-X11/include/extensions/xtrapproto.h +++ b/nx-X11/include/extensions/xtrapproto.h @@ -44,7 +44,7 @@ SOFTWARE. # define Bool int #endif /* xtrapdi.c */ -int XETrapDestroyEnv (pointer value , XID id ); +int XETrapDestroyEnv (void * value , XID id ); void XETrapCloseDown ( ExtensionEntry *extEntry ); Bool XETrapRedirectDevices (void ); void DEC_XTRAPInit (void ); diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index a1bb25975..c62585507 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -229,7 +229,7 @@ int DoCreateContext(__GLXclientState *cl, GLXContextID gcId, /* ** Register this context as a resource. */ - if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) { + if (!AddResource(gcId, __glXContextRes, (void *)glxc)) { if (!isDirect) { (*glxc->gc->exports.destroyContext)((__GLcontext *)glxc->gc); } @@ -1760,7 +1760,7 @@ static int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc) if (ret == Success) { if (barrier) /* add source for cleanup when drawable is gone */ - AddResource(drawable, __glXSwapBarrierRes, (pointer)screen); + AddResource(drawable, __glXSwapBarrierRes, (void *)screen); else /* delete source */ FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE); diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.c b/nx-X11/programs/Xserver/GL/glx/glxext.c index fa1382983..e7ed3975c 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxext.c +++ b/nx-X11/programs/Xserver/GL/glx/glxext.c @@ -417,7 +417,7 @@ static int __glXDispatch(ClientPtr client) ** with the client so we will be notified when the client dies. */ XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { + if (!AddResource( xid, __glXClientRes, (void *)(long)client->index)) { return BadAlloc; } ResetClientState(client->index); @@ -471,7 +471,7 @@ static int __glXSwapDispatch(ClientPtr client) ** with the client so we will be notified when the client dies. */ XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { + if (!AddResource( xid, __glXClientRes, (void *)(long)client->index)) { return BadAlloc; } ResetClientState(client->index); diff --git a/nx-X11/programs/Xserver/GL/glxmodule.c b/nx-X11/programs/Xserver/GL/glxmodule.c index f8c03913e..b97b7ef8a 100644 --- a/nx-X11/programs/Xserver/GL/glxmodule.c +++ b/nx-X11/programs/Xserver/GL/glxmodule.c @@ -1236,11 +1236,11 @@ static XF86ModuleVersionInfo VersRec = XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL }; -static pointer -glxSetup(pointer module, pointer opts, int *errmaj, int *errmin) +static void * +glxSetup(void * module, void * opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; - pointer GLcore = NULL; + void * GLcore = NULL; #ifdef GLX_USE_SGI_SI char GLcoreName[] = "GL"; #else diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c index 4e03b59fe..e0bbd193d 100644 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c +++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c @@ -56,9 +56,9 @@ static XF86ModuleVersionInfo VersRec = XF86ModuleData GLcoreModuleData = { &VersRec, GLcoreSetup, NULL }; -static pointer -GLcoreSetup(pointer module, pointer opts, int *errmaj, int *errmin) +static void * +GLcoreSetup(void * module, void * opts, int *errmaj, int *errmin) { /* Need a non-NULL return value to indicate success */ - return (pointer)1; + return (void *)1; } diff --git a/nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c b/nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c index 1783d577a..3b9955eba 100644 --- a/nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c +++ b/nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c @@ -41,11 +41,11 @@ static XF86ModuleVersionInfo xtrapVersRec = XF86ModuleData xtrapModuleData = { &xtrapVersRec, xtrapSetup, NULL }; -static pointer -xtrapSetup(pointer module, pointer opts, int *errmaj, int *errmin) { +static void * +xtrapSetup(void * module, void * opts, int *errmaj, int *errmin) { LoadExtension(&xtrapExt, FALSE); /* Need a non-NULL return value to indicate success */ - return (pointer)1; + return (void *)1; } #endif /* XFree86LOADER */ diff --git a/nx-X11/programs/Xserver/XTrap/xtrapdi.c b/nx-X11/programs/Xserver/XTrap/xtrapdi.c index 1055429d4..bdddb6310 100644 --- a/nx-X11/programs/Xserver/XTrap/xtrapdi.c +++ b/nx-X11/programs/Xserver/XTrap/xtrapdi.c @@ -195,7 +195,7 @@ static void GetSendColorPlanesRep (ClientPtr client , xResourceReq *req ); * client would be reset here. * */ -int XETrapDestroyEnv(pointer value, XID id) +int XETrapDestroyEnv(void * value, XID id) { xXTrapReq request; XETrapEnv *penv = XETenv[(long)value]; @@ -251,7 +251,7 @@ void XETrapCloseDown(ExtensionEntry *extEntry) { if (XETenv[i] != NULL) { - XETrapDestroyEnv((pointer)i,0L); + XETrapDestroyEnv((void *)i,0L); } } ignore_grabs = False; @@ -508,7 +508,7 @@ int XETrapCreateEnv(ClientPtr client) penv->protocol = 31; /* default to backwards compatibility */ /* prep for client's departure (for memory dealloc, cleanup) */ AddResource(FakeClientID(client->index),XETrapType, - (pointer)(long)(client->index)); + (void *)(long)(client->index)); if (XETrapRedirectDevices() == False) { status = XETrapErrorBase + BadDevices; diff --git a/nx-X11/programs/Xserver/Xext/appgroup.c b/nx-X11/programs/Xserver/Xext/appgroup.c index ad4afa9e4..e23ceca59 100644 --- a/nx-X11/programs/Xserver/Xext/appgroup.c +++ b/nx-X11/programs/Xserver/Xext/appgroup.c @@ -92,7 +92,7 @@ extern int connBlockScreenStart; static int XagAppGroupFree( - pointer what, + void * what, XID id) /* unused */ { int i; @@ -126,8 +126,8 @@ int XagAppGroupFree( /* static */ void XagClientStateChange( CallbackListPtr* pcbl, - pointer nulldata, - pointer calldata) + void * nulldata, + void * calldata) { SecurityAuthorizationPtr pAuth; NewClientInfoRec* pci = (NewClientInfoRec*) calldata; @@ -262,7 +262,7 @@ void XagResetProc( { DeleteCallback (&ClientStateCallback, XagClientStateChange, NULL); XagCallbackRefCount = 0; - while (appGrpList) XagAppGroupFree ((pointer) appGrpList, 0); + while (appGrpList) XagAppGroupFree ((void *) appGrpList, 0); } static @@ -476,7 +476,7 @@ int ProcXagCreate ( return BadAlloc; ret = AttrValidate (client, stuff->attrib_mask, pAppGrp); if (ret != Success) { - XagAppGroupFree ((pointer)pAppGrp, (XID)0); + XagAppGroupFree ((void *)pAppGrp, (XID)0); return ret; } if (pAppGrp->single_screen) { @@ -484,7 +484,7 @@ int ProcXagCreate ( if (!pAppGrp->ConnectionInfo) return BadAlloc; } - if (!AddResource (stuff->app_group, RT_APPGROUP, (pointer)pAppGrp)) + if (!AddResource (stuff->app_group, RT_APPGROUP, (void *)pAppGrp)) return BadAlloc; if (XagCallbackRefCount++ == 0) (void) AddCallback (&ClientStateCallback, XagClientStateChange, NULL); @@ -824,6 +824,6 @@ void XagCallClientStateChange( NewClientInfoRec clientinfo; clientinfo.client = client; - XagClientStateChange (NULL, NULL, (pointer)&clientinfo); + XagClientStateChange (NULL, NULL, (void *)&clientinfo); } } diff --git a/nx-X11/programs/Xserver/Xext/appgroup.h b/nx-X11/programs/Xserver/Xext/appgroup.h index 05c9ef124..2a8feb585 100644 --- a/nx-X11/programs/Xserver/Xext/appgroup.h +++ b/nx-X11/programs/Xserver/Xext/appgroup.h @@ -2,8 +2,8 @@ void XagClientStateChange( CallbackListPtr* pcbl, - pointer nulldata, - pointer calldata); + void * nulldata, + void * calldata); int ProcXagCreate ( register ClientPtr client); int ProcXagDestroy( diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.c b/nx-X11/programs/Xserver/Xext/extmod/modinit.c index 3c2044f78..f79204281 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/modinit.c +++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.c @@ -232,8 +232,8 @@ static XF86ModuleVersionInfo VersRec = */ XF86ModuleData extmodModuleData = { &VersRec, extmodSetup, NULL }; -static pointer -extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin) +static void * +extmodSetup(void * module, void * opts, int *errmaj, int *errmin) { int i; @@ -244,7 +244,7 @@ extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin) char *s; s = (char *)xalloc(strlen(extensionModules[i].name) + 5); if (s) { - pointer o; + void * o; strcpy(s, "omit"); strcat(s, extensionModules[i].name); o = xf86FindOption(opts, s); @@ -258,7 +258,7 @@ extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin) LoadExtension(&extensionModules[i], FALSE); } /* Need a non-NULL return */ - return (pointer)1; + return (void *)1; } #endif /* XFree86LOADER */ diff --git a/nx-X11/programs/Xserver/Xext/mbuf.c b/nx-X11/programs/Xserver/Xext/mbuf.c index 3129edd87..37024da19 100644 --- a/nx-X11/programs/Xserver/Xext/mbuf.c +++ b/nx-X11/programs/Xserver/Xext/mbuf.c @@ -107,7 +107,7 @@ static int EventSelectForMultibuffer( */ RESTYPE MultibufferDrawableResType; static int MultibufferDrawableDelete ( - pointer /* value */, + void * /* value */, XID /* id */ ); /* @@ -117,7 +117,7 @@ static int MultibufferDrawableDelete ( */ static RESTYPE MultibufferResType; static int MultibufferDelete ( - pointer /* value */, + void * /* value */, XID /* id */ ); @@ -127,7 +127,7 @@ static int MultibufferDelete ( */ static RESTYPE MultibuffersResType; static int MultibuffersDelete ( - pointer /* value */, + void * /* value */, XID /* id */ ); @@ -137,7 +137,7 @@ static int MultibuffersDelete ( */ static RESTYPE OtherClientResType; static int OtherClientDelete ( - pointer /* value */, + void * /* value */, XID /* id */ ); @@ -229,7 +229,7 @@ MultibufferExtensionInit() xfree (screenInfo.screens[j]->devPrivates[MultibufferScreenIndex].ptr); return; } - pScreen->devPrivates[MultibufferScreenIndex].ptr = (pointer) pMultibufferScreen; + pScreen->devPrivates[MultibufferScreenIndex].ptr = (void *) pMultibufferScreen; /* * wrap PositionWindow to resize the pixmap when the window * changes size @@ -312,7 +312,7 @@ SetupBackgroundPainter (pWin, pGC) WindowPtr pWin; GCPtr pGC; { - pointer gcvalues[4]; + void *gcvalues[4]; int ts_x_origin, ts_y_origin; PixUnion background; int backgroundState; @@ -337,21 +337,21 @@ SetupBackgroundPainter (pWin, pGC) switch (backgroundState) { case BackgroundPixel: - gcvalues[0] = (pointer) background.pixel; - gcvalues[1] = (pointer) FillSolid; + gcvalues[0] = (void *) background.pixel; + gcvalues[1] = (void *) FillSolid; gcmask = GCForeground|GCFillStyle; break; case BackgroundPixmap: - gcvalues[0] = (pointer) FillTiled; - gcvalues[1] = (pointer) background.pixmap; - gcvalues[2] = (pointer)(long) ts_x_origin; - gcvalues[3] = (pointer)(long) ts_y_origin; + gcvalues[0] = (void *) FillTiled; + gcvalues[1] = (void *) background.pixmap; + gcvalues[2] = (void *)(long) ts_x_origin; + gcvalues[3] = (void *)(long) ts_y_origin; gcmask = GCFillStyle|GCTile|GCTileStipXOrigin|GCTileStipYOrigin; break; default: - gcvalues[0] = (pointer) GXnoop; + gcvalues[0] = (void *) GXnoop; gcmask = GCFunction; } DoChangeGC(pGC, gcmask, (XID *)gcvalues, TRUE); @@ -381,7 +381,7 @@ CreateImageBuffers (pWin, nbuf, ids, action, hint) pMultibuffers->pWindow = pWin; pMultibuffers->buffers = (MultibufferPtr) (pMultibuffers + 1); pMultibuffers->refcnt = pMultibuffers->numMultibuffer = 0; - if (!AddResource (pWin->drawable.id, MultibuffersResType, (pointer) pMultibuffers)) + if (!AddResource (pWin->drawable.id, MultibuffersResType, (void *) pMultibuffers)) return BadAlloc; width = pWin->drawable.width; height = pWin->drawable.height; @@ -407,12 +407,12 @@ CreateImageBuffers (pWin, nbuf, ids, action, hint) pMultibuffer->side = MultibufferSideMono; pMultibuffer->clobber = MultibufferUnclobbered; pMultibuffer->pMultibuffers = pMultibuffers; - if (!AddResource (ids[i], MultibufferResType, (pointer) pMultibuffer)) + if (!AddResource (ids[i], MultibufferResType, (void *) pMultibuffer)) break; pMultibuffer->pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, depth); if (!pMultibuffer->pPixmap) break; - if (!AddResource (ids[i], MultibufferDrawableResType, (pointer) pMultibuffer->pPixmap)) + if (!AddResource (ids[i], MultibufferDrawableResType, (void *) pMultibuffer->pPixmap)) { FreeResource (ids[i], MultibufferResType); (*pScreen->DestroyPixmap) (pMultibuffer->pPixmap); @@ -439,7 +439,7 @@ CreateImageBuffers (pWin, nbuf, ids, action, hint) pMultibuffers->lastUpdate.milliseconds = 0; pMultibuffers->width = width; pMultibuffers->height = height; - pWin->devPrivates[MultibufferWindowIndex].ptr = (pointer) pMultibuffers; + pWin->devPrivates[MultibufferWindowIndex].ptr = (void *) pMultibuffers; if (pClearGC) FreeScratchGC(pClearGC); return Success; } @@ -693,7 +693,7 @@ ProcGetMBufferAttributes (client) (char *)&rep); WriteToClient (client, (int)(pMultibuffers->numMultibuffer * sizeof (XID)), (char *)ids); - DEALLOCATE_LOCAL((pointer) ids); + DEALLOCATE_LOCAL((void *) ids); return client->noClientException; } @@ -842,9 +842,9 @@ ProcGetBufferInfo (client) k++; } } - WriteToClient (client, sizeof (xMbufGetBufferInfoReply), (pointer) &rep); - WriteToClient (client, (int) nInfo * sizeof (xMbufBufferInfo), (pointer) pInfo); - DEALLOCATE_LOCAL ((pointer) pInfo); + WriteToClient (client, sizeof (xMbufGetBufferInfoReply), (void *) &rep); + WriteToClient (client, (int) nInfo * sizeof (xMbufBufferInfo), (void *) pInfo); + DEALLOCATE_LOCAL ((void *) pInfo); return client->noClientException; } @@ -1463,7 +1463,7 @@ AliasMultibuffer (pMultibuffers, i) pMultibuffer = &pMultibuffers->buffers[pMultibuffers->displayedMultibuffer]; ChangeResourceValue (pMultibuffer->pPixmap->drawable.id, MultibufferDrawableResType, - (pointer) pMultibuffer->pPixmap); + (void *) pMultibuffer->pPixmap); } /* * make the new association @@ -1471,7 +1471,7 @@ AliasMultibuffer (pMultibuffers, i) pMultibuffer = &pMultibuffers->buffers[i]; ChangeResourceValue (pMultibuffer->pPixmap->drawable.id, MultibufferDrawableResType, - (pointer) pMultibuffers->pWindow); + (void *) pMultibuffers->pWindow); pMultibuffers->displayedMultibuffer = i; } @@ -1608,7 +1608,7 @@ MultibufferPositionWindow (pWin, x, y) { ChangeResourceValue (pPixmap->drawable.id, MultibufferDrawableResType, - (pointer) pPixmap); + (void *) pPixmap); } } FreeScratchGC (pGC); @@ -1619,7 +1619,7 @@ MultibufferPositionWindow (pWin, x, y) /*ARGSUSED*/ static int MultibufferDrawableDelete (value, id) - pointer value; + void *value; XID id; { DrawablePtr pDrawable = (DrawablePtr)value; @@ -1645,7 +1645,7 @@ MultibufferDrawableDelete (value, id) /*ARGSUSED*/ static int MultibufferDelete (value, id) - pointer value; + void *value; XID id; { MultibufferPtr pMultibuffer = (MultibufferPtr)value; @@ -1665,7 +1665,7 @@ MultibufferDelete (value, id) /*ARGSUSED*/ static int MultibuffersDelete (value, id) - pointer value; + void *value; XID id; { MultibuffersPtr pMultibuffers = (MultibuffersPtr)value; @@ -1682,7 +1682,7 @@ MultibuffersDelete (value, id) /* Resource delete func for OtherClientResType */ static int OtherClientDelete (value, id) - pointer value; + void *value; XID id; { MultibufferPtr pMultibuffer = (MultibufferPtr)value; @@ -1745,7 +1745,7 @@ EventSelectForMultibuffer (pMultibuffer, client, mask) return BadAlloc; other->mask = mask; other->resource = FakeClientID (client->index); - if (!AddResource (other->resource, OtherClientResType, (pointer) pMultibuffer)) + if (!AddResource (other->resource, OtherClientResType, (void *) pMultibuffer)) { xfree (other); return BadAlloc; diff --git a/nx-X11/programs/Xserver/Xext/mbufbf.c b/nx-X11/programs/Xserver/Xext/mbufbf.c index 8585c52d2..84e7ee839 100644 --- a/nx-X11/programs/Xserver/Xext/mbufbf.c +++ b/nx-X11/programs/Xserver/Xext/mbufbf.c @@ -230,7 +230,7 @@ bufMultibufferInit(pScreen, pMBScreen) if (!pMBPriv) return (FALSE); - pMBScreen->devPrivate.ptr = (pointer) pMBPriv; + pMBScreen->devPrivate.ptr = (void *) pMBPriv; pMBPriv->frameBuffer = bufFrameBuffer[pScreen->myNum]; pMBPriv->selectPlane = bufselectPlane[pScreen->myNum]; @@ -374,7 +374,7 @@ bufCreateImageBuffers (pWin, nbuf, ids, action, hint) pMBScreen = MB_SCREEN_PRIV(pScreen); pMBWindow = MB_WINDOW_PRIV(pWin); - pMBWindow->devPrivate.ptr = (pointer) REGION_CREATE(pScreen, 0,0); + pMBWindow->devPrivate.ptr = (void *) REGION_CREATE(pScreen, 0,0); if (!pMBWindow->devPrivate.ptr) return(0); REGION_COPY(pScreen, (RegionPtr) pMBWindow->devPrivate.ptr, @@ -389,7 +389,7 @@ bufCreateImageBuffers (pWin, nbuf, ids, action, hint) break; if (!AddResource (ids[i], MultibufferDrawableResType, - (pointer) pMBBuffer->pDrawable)) + (void *) pMBBuffer->pDrawable)) { bufDestroyBuffer((BufferPtr) pMBBuffer->pDrawable); break; diff --git a/nx-X11/programs/Xserver/Xext/mbufpx.c b/nx-X11/programs/Xserver/Xext/mbufpx.c index c986217ee..0973fc324 100644 --- a/nx-X11/programs/Xserver/Xext/mbufpx.c +++ b/nx-X11/programs/Xserver/Xext/mbufpx.c @@ -124,7 +124,7 @@ pixMultibufferInit(pScreen, pMBScreen) xfree(pInfo); return (FALSE); } - pMBScreen->devPrivate.ptr = (pointer) pMBPriv; + pMBScreen->devPrivate.ptr = (void *) pMBPriv; pMBPriv->PositionWindow = NULL; pMBPriv->funcsWrapped = 0; @@ -162,7 +162,7 @@ pixCreateImageBuffers (pWin, nbuf, ids, action, hint) break; if (!AddResource (ids[i], MultibufferDrawableResType, - (pointer) pMBBuffer->pDrawable)) + (void *) pMBBuffer->pDrawable)) { (*pScreen->DestroyPixmap) ((PixmapPtr) pMBBuffer->pDrawable); break; @@ -570,7 +570,7 @@ pixPositionWindow (pWin, x, y) { ChangeResourceValue (pPixmap->drawable.id, MultibufferDrawableResType, - (pointer) pPixmap); + (void *) pPixmap); } } FreeScratchGC (pGC); diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index a1a5b9f1f..2dc011e70 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -133,7 +133,7 @@ static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr); static void XineramaChangeGC(GCPtr, unsigned long); static void XineramaCopyGC(GCPtr, unsigned long, GCPtr); static void XineramaDestroyGC(GCPtr); -static void XineramaChangeClip(GCPtr, int, pointer, int); +static void XineramaChangeClip(GCPtr, int, void *, int); static void XineramaDestroyClip(GCPtr); static void XineramaCopyClip(GCPtr, GCPtr); @@ -165,7 +165,7 @@ XineramaCloseScreen (int i, ScreenPtr pScreen) if (pScreen->myNum == 0) REGION_UNINIT(pScreen, &PanoramiXScreenRegion); - xfree ((pointer) pScreenPriv); + xfree ((void *) pScreenPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -308,7 +308,7 @@ static void XineramaChangeClip ( GCPtr pGC, int type, - pointer pvalue, + void *pvalue, int nrects ){ Xinerama_GC_FUNC_PROLOGUE (pGC); @@ -335,7 +335,7 @@ XineramaDestroyClip(GCPtr pGC) int -XineramaDeleteResource(pointer data, XID id) +XineramaDeleteResource(void * data, XID id) { xfree(data); return 1; @@ -343,7 +343,7 @@ XineramaDeleteResource(pointer data, XID id) static Bool -XineramaFindIDOnAnyScreen(pointer resource, XID id, pointer privdata) +XineramaFindIDOnAnyScreen(void * resource, XID id, void * privdata) { PanoramiXRes *res = (PanoramiXRes*)resource; int j; @@ -368,7 +368,7 @@ typedef struct { static Bool -XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata) +XineramaFindIDByScrnum(void * resource, XID id, void * privdata) { PanoramiXRes *res = (PanoramiXRes*)resource; PanoramiXSearchData *data = (PanoramiXSearchData*)privdata; @@ -541,7 +541,7 @@ void PanoramiXExtensionInit(int argc, char *argv[]) pScreenPriv = xalloc(sizeof(PanoramiXScreenRec)); pScreen->devPrivates[PanoramiXScreenIndex].ptr = - (pointer)pScreenPriv; + (void *)pScreenPriv; if(!pScreenPriv) { noPanoramiXExtension = TRUE; return; @@ -747,9 +747,9 @@ Bool PanoramiXCreateConnectionBlock(void) root->mmHeight *= height_mult; while(ConnectionCallbackList) { - pointer tmp; + void *tmp; - tmp = (pointer)ConnectionCallbackList; + tmp = (void *)ConnectionCallbackList; (*ConnectionCallbackList->func)(); ConnectionCallbackList = ConnectionCallbackList->next; xfree(tmp); diff --git a/nx-X11/programs/Xserver/Xext/panoramiXsrv.h b/nx-X11/programs/Xserver/Xext/panoramiXsrv.h index dc3b3d805..8fa2d3d05 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXsrv.h +++ b/nx-X11/programs/Xserver/Xext/panoramiXsrv.h @@ -22,7 +22,7 @@ extern PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int); extern PanoramiXRes * PanoramiXFindIDOnAnyScreen(RESTYPE, XID); extern WindowPtr PanoramiXChangeWindow(int, WindowPtr); extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void)); -extern int XineramaDeleteResource(pointer, XID); +extern int XineramaDeleteResource(void *, XID); extern void XineramaReinitData(ScreenPtr); diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 14b0d2751..4a7fc054c 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -139,7 +139,7 @@ typedef struct _ScreenSaverEvent { } ScreenSaverEventRec; static int ScreenSaverFreeEvents( - pointer /* value */, + void * /* value */, XID /* id */ ); @@ -179,7 +179,7 @@ typedef struct _ScreenSaverAttr { } ScreenSaverAttrRec, *ScreenSaverAttrPtr; static int ScreenSaverFreeAttr ( - pointer /* value */, + void * /* value */, XID /* id */ ); @@ -213,7 +213,7 @@ MakeScreenPrivate ( static int ScreenPrivateIndex; #define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr)(s)->devPrivates[ScreenPrivateIndex].ptr) -#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (pointer) v); +#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (void *) v); #define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL) #define New(t) ((t *) xalloc (sizeof (t))) @@ -356,7 +356,7 @@ setEventMask (pScreen, client, mask) pEv->client = client; pEv->screen = pScreen; pEv->resource = FakeClientID (client->index); - if (!AddResource (pEv->resource, EventType, (pointer) pEv)) + if (!AddResource (pEv->resource, EventType, (void *) pEv)) return FALSE; } pEv->mask = mask; @@ -390,7 +390,7 @@ FreeScreenAttr (pAttr) static int ScreenSaverFreeEvents (value, id) - pointer value; + void * value; XID id; { ScreenSaverEventPtr pOld = (ScreenSaverEventPtr)value; @@ -413,7 +413,7 @@ ScreenSaverFreeEvents (value, id) static int ScreenSaverFreeAttr (value, id) - pointer value; + void * value; XID id; { ScreenSaverAttrPtr pOldAttr = (ScreenSaverAttrPtr)value; @@ -1163,7 +1163,7 @@ ScreenSaverSetAttributes (ClientPtr client) FreeScreenAttr (pPriv->attr); pPriv->attr = pAttr; pAttr->resource = FakeClientID (client->index); - if (!AddResource (pAttr->resource, AttrType, (pointer) pAttr)) + if (!AddResource (pAttr->resource, AttrType, (void *) pAttr)) return BadAlloc; return Success; PatchUp: diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 8e97a7e54..4bc49f408 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -288,7 +288,7 @@ SecurityAudit(char *format, ...) static int SecurityDeleteAuthorization( - pointer value, + void * value, XID id) { SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value; @@ -347,7 +347,7 @@ SecurityDeleteAuthorization( /* resource delete function for RTEventClient */ static int SecurityDeleteAuthorizationEventClient( - pointer value, + void * value, XID id) { OtherClientsPtr pEventClient, prev = NULL; @@ -432,7 +432,7 @@ static CARD32 SecurityAuthorizationExpired( OsTimerPtr timer, CARD32 time, - pointer pval) + void * pval) { SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval; @@ -538,7 +538,7 @@ SecurityEventSelectForAuthorization( pEventClient->resource = FakeClientID(client->index); pEventClient->next = pAuth->eventClients; if (!AddResource(pEventClient->resource, RTEventClient, - (pointer)pAuth)) + (void *)pAuth)) { xfree(pEventClient); return BadAlloc; @@ -624,7 +624,7 @@ ProcSecurityGenerateAuthorization( SecurityValidateGroupInfoRec vgi; vgi.group = group; vgi.valid = FALSE; - CallCallbacks(&SecurityValidateGroupCallback, (pointer)&vgi); + CallCallbacks(&SecurityValidateGroupCallback, (void *)&vgi); /* if nobody said they recognized it, it's an error */ @@ -1065,7 +1065,7 @@ SecurityCheckDeviceAccess(client, dev, fromRequest) * resource access. */ -static pointer +static void * SecurityAuditResourceIDAccess( ClientPtr client, XID id) @@ -1119,13 +1119,13 @@ SecurityAuditResourceIDAccess( * Disallowed resource accesses are audited. */ -static pointer +static void * SecurityCheckResourceIDAccess( ClientPtr client, XID id, RESTYPE rtype, Mask access_mode, - pointer rval) + void * rval) { int cid = CLIENT_ID(id); int reqtype = ((xReq *)client->requestBuffer)->reqType; @@ -1288,8 +1288,8 @@ SecurityCheckResourceIDAccess( static void SecurityClientStateCallback( CallbackListPtr *pcbl, - pointer nulldata, - pointer calldata) + void * nulldata, + void * calldata) { NewClientInfoRec *pci = (NewClientInfoRec *)calldata; ClientPtr client = pci->client; @@ -1445,7 +1445,7 @@ SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h, pPix = GetScratchPixmapHeader(pDraw->pScreen, w, h, depth, bitsPerPixel, - widthBytesLine, (pointer)pBuf); + widthBytesLine, (void *)pBuf); if (!pPix) { failed = TRUE; diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index 86b4b5603..02182398a 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -58,11 +58,11 @@ typedef RegionPtr (*CreateDftPtr)( ); static int ShapeFreeClient( - pointer /* data */, + void * /* data */, XID /* id */ ); static int ShapeFreeEvents( - pointer /* data */, + void * /* data */, XID /* id */ ); static void ShapeResetProc( @@ -774,7 +774,7 @@ ProcShapeQueryExtents (client) /*ARGSUSED*/ static int ShapeFreeClient (data, id) - pointer data; + void *data; XID id; { ShapeEventPtr pShapeEvent; @@ -796,14 +796,14 @@ ShapeFreeClient (data, id) *pHead = pShapeEvent->next; } } - xfree ((pointer) pShapeEvent); + xfree ((void *) pShapeEvent); return 1; } /*ARGSUSED*/ static int ShapeFreeEvents (data, id) - pointer data; + void *data; XID id; { ShapeEventPtr *pHead, pCur, pNext; @@ -812,9 +812,9 @@ ShapeFreeEvents (data, id) for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); + xfree ((void *) pCur); } - xfree ((pointer) pHead); + xfree ((void *) pHead); return 1; } @@ -861,7 +861,7 @@ ProcShapeSelectInput (client) */ clientResource = FakeClientID (client->index); pNewShapeEvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewShapeEvent)) + if (!AddResource (clientResource, ClientType, (void *)pNewShapeEvent)) return BadAlloc; /* * create a resource to contain a pointer to the list @@ -873,7 +873,7 @@ ProcShapeSelectInput (client) { pHead = (ShapeEventPtr *) xalloc (sizeof (ShapeEventPtr)); if (!pHead || - !AddResource (pWin->drawable.id, EventType, (pointer)pHead)) + !AddResource (pWin->drawable.id, EventType, (void *)pHead)) { FreeResource (clientResource, RT_NONE); return BadAlloc; diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index dfb85c3ec..d500e551c 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -86,7 +86,7 @@ static void miShmPutImage(XSHM_PUT_IMAGE_ARGS); static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS); static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); static int ShmDetachSegment( - pointer /* value */, + void * /* value */, XID /* shmseg */ ); static void ShmResetProc( @@ -309,7 +309,7 @@ ShmDestroyPixmap (PixmapPtr pPixmap) #else char *base = (char *) pPixmap->devPrivate.ptr; - if (base != (pointer) (pPixmap + 1)) + if (base != (void *) (pPixmap + 1)) { for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next) { @@ -321,7 +321,7 @@ ShmDestroyPixmap (PixmapPtr pPixmap) shmdesc = 0; #endif if (shmdesc) - ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id); + ShmDetachSegment ((void *) shmdesc, pPixmap->drawable.id); } pScreen->DestroyPixmap = destroyPixmap[pScreen->myNum]; @@ -465,7 +465,7 @@ ProcShmAttach(client) shmdesc->next = Shmsegs; Shmsegs = shmdesc; } - if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc)) + if (!AddResource(stuff->shmseg, ShmSegType, (void *)shmdesc)) return BadAlloc; return(client->noClientException); } @@ -473,7 +473,7 @@ ProcShmAttach(client) /*ARGSUSED*/ static int ShmDetachSegment(value, shmseg) - pointer value; /* must conform to DeleteType */ + void * value; /* must conform to DeleteType */ XID shmseg; { ShmDescPtr shmdesc = (ShmDescPtr)value; @@ -548,7 +548,7 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) PixmapPtr pPixmap; pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, - BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data); + BitsPerPixel(depth), PixmapBytePad(w, depth), (void *)data); if (!pPixmap) return; if (format == XYBitmap) @@ -794,12 +794,12 @@ CreatePmap: if (pMap) { #ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; + pMap->devPrivates[shmPixmapPrivate].ptr = (void *) shmdesc; #endif shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = newPix->info[j].id; - if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) { + if (!AddResource(newPix->info[j].id, RT_PIXMAP, (void *)pMap)) { (*pScreen->DestroyPixmap)(pMap); result = BadAlloc; break; @@ -1062,7 +1062,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) return NullPixmap; if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, - BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) { + BitsPerPixel(depth), PixmapBytePad(width, depth), (void *)addr)) { (*pScreen->DestroyPixmap)(pPixmap); return NullPixmap; } @@ -1129,12 +1129,12 @@ CreatePmap: if (pMap) { #ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; + pMap->devPrivates[shmPixmapPrivate].ptr = (void *) shmdesc; #endif shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) + if (AddResource(stuff->pid, RT_PIXMAP, (void *)pMap)) { return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.c b/nx-X11/programs/Xserver/Xext/sleepuntil.c index 8e0008cab..da93806f5 100644 --- a/nx-X11/programs/Xserver/Xext/sleepuntil.c +++ b/nx-X11/programs/Xserver/Xext/sleepuntil.c @@ -49,10 +49,10 @@ typedef struct _Sertafied { XID id; void (*notifyFunc)( ClientPtr /* client */, - pointer /* closure */ + void * /* closure */ ); - pointer closure; + void *closure; } SertafiedRec, *SertafiedPtr; static SertafiedPtr pPending; @@ -62,21 +62,21 @@ static int SertafiedGeneration; static void ClientAwaken( ClientPtr /* client */, - pointer /* closure */ + void * /* closure */ ); static int SertafiedDelete( - pointer /* value */, + void * /* value */, XID /* id */ ); static void SertafiedBlockHandler( - pointer /* data */, + void * /* data */, OSTimePtr /* wt */, - pointer /* LastSelectMask */ + void * /* LastSelectMask */ ); static void SertafiedWakeupHandler( - pointer /* data */, + void * /* data */, int /* i */, - pointer /* LastSelectMask */ + void * /* LastSelectMask */ ); int @@ -85,8 +85,8 @@ ClientSleepUntil (client, revive, notifyFunc, closure) TimeStamp *revive; void (*notifyFunc)( ClientPtr /* client */, - pointer /* closure */); - pointer closure; + void * /* closure */); + void *closure; { SertafiedPtr pRequest, pReq, pPrev; @@ -109,7 +109,7 @@ ClientSleepUntil (client, revive, notifyFunc, closure) { if (!RegisterBlockAndWakeupHandlers (SertafiedBlockHandler, SertafiedWakeupHandler, - (pointer) 0)) + (void *) 0)) { xfree (pRequest); return FALSE; @@ -117,7 +117,7 @@ ClientSleepUntil (client, revive, notifyFunc, closure) BlockHandlerRegistered = TRUE; } pRequest->notifyFunc = 0; - if (!AddResource (pRequest->id, SertafiedResType, (pointer) pRequest)) + if (!AddResource (pRequest->id, SertafiedResType, (void *) pRequest)) return FALSE; if (!notifyFunc) notifyFunc = ClientAwaken; @@ -142,7 +142,7 @@ ClientSleepUntil (client, revive, notifyFunc, closure) static void ClientAwaken (client, closure) ClientPtr client; - pointer closure; + void *closure; { if (!client->clientGone) AttendClient (client); @@ -151,7 +151,7 @@ ClientAwaken (client, closure) static int SertafiedDelete (value, id) - pointer value; + void * value; XID id; { SertafiedPtr pRequest = (SertafiedPtr)value; @@ -175,9 +175,9 @@ SertafiedDelete (value, id) static void SertafiedBlockHandler (data, wt, LastSelectMask) - pointer data; /* unused */ + void *data; /* unused */ OSTimePtr wt; /* wait time */ - pointer LastSelectMask; + void *LastSelectMask; { SertafiedPtr pReq, pNext; unsigned long delay; @@ -211,9 +211,9 @@ SertafiedBlockHandler (data, wt, LastSelectMask) static void SertafiedWakeupHandler (data, i, LastSelectMask) - pointer data; + void * data; int i; - pointer LastSelectMask; + void * LastSelectMask; { SertafiedPtr pReq, pNext; TimeStamp now; @@ -233,7 +233,7 @@ SertafiedWakeupHandler (data, i, LastSelectMask) { RemoveBlockAndWakeupHandlers (SertafiedBlockHandler, SertafiedWakeupHandler, - (pointer) 0); + (void *) 0); BlockHandlerRegistered = FALSE; } } diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.h b/nx-X11/programs/Xserver/Xext/sleepuntil.h index 0b99148a4..e828a7c8f 100644 --- a/nx-X11/programs/Xserver/Xext/sleepuntil.h +++ b/nx-X11/programs/Xserver/Xext/sleepuntil.h @@ -39,9 +39,9 @@ extern int ClientSleepUntil( TimeStamp *revive, void (*notifyFunc)( ClientPtr /* client */, - pointer /* closure */ + void * /* closure */ ), - pointer Closure + void * Closure ); #endif diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index e5b8ef946..006cefa86 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -103,40 +103,40 @@ static SyncCounter **SysCounterList = NULL; static int FreeAlarm( - pointer /* addr */, + void * /* addr */, XID /* id */ ); static int FreeAlarmClient( - pointer /* value */, + void * /* value */, XID /* id */ ); static int FreeAwait( - pointer /* addr */, + void * /* addr */, XID /* id */ ); static void ServertimeBracketValues( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pbracket_less */, CARD64 * /* pbracket_greater */ ); static void ServertimeQueryValue( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pValue_return */ ); static void ServertimeWakeupHandler( - pointer /* env */, + void * /* env */, int /* rc */, - pointer /* LastSelectMask */ + void * /* LastSelectMask */ ); static int @@ -161,9 +161,9 @@ SCounterNotifyEvent( static void ServertimeBlockHandler( - pointer /* env */, + void * /* env */, struct timeval ** /* wt */, - pointer /* LastSelectMask */ + void * /* LastSelectMask */ ); static int @@ -449,7 +449,7 @@ SyncInitTrigger(client, pTrigger, counter, changes) if (IsSystemCounter(pCounter)) { - (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter, + (*pCounter->pSysCounterInfo->QueryValue) ((void *) pCounter, &pCounter->value); } @@ -1016,9 +1016,9 @@ SyncCreateCounter(client, id, initialvalue) if (!(pCounter = (SyncCounter *) xalloc(sizeof(SyncCounter)))) return (SyncCounter *)NULL; - if (!AddResource(id, RTCounter, (pointer) pCounter)) + if (!AddResource(id, RTCounter, (void *) pCounter)) { - xfree((pointer) pCounter); + xfree((void *) pCounter); return (SyncCounter *)NULL; } @@ -1032,7 +1032,7 @@ SyncCreateCounter(client, id, initialvalue) } static int FreeCounter( - pointer /*env*/, + void * /*env*/, XID /*id*/ ); @@ -1040,7 +1040,7 @@ static int FreeCounter( * ***** System Counter utilities */ -pointer +void * SyncCreateSystemCounter(name, initial, resolution, counterType, QueryValue, BracketValues) char *name; @@ -1048,10 +1048,10 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, CARD64 resolution; SyncCounterType counterType; void (*QueryValue) ( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pValue_return */); void (*BracketValues) ( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pbracket_less */, CARD64 * /* pbracket_greater */); { @@ -1060,7 +1060,7 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, SysCounterList = (SyncCounter **)xrealloc(SysCounterList, (SyncNumSystemCounters+1)*sizeof(SyncCounter *)); if (!SysCounterList) - return (pointer)NULL; + return (void *)NULL; /* this function may be called before SYNC has been initialized, so we * have to make sure RTCounter is created. @@ -1070,7 +1070,7 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, RTCounter = CreateNewResourceType(FreeCounter); if (RTCounter == 0) { - return (pointer)NULL; + return (void *)NULL; } } @@ -1084,7 +1084,7 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, if (!psci) { FreeResource(pCounter->id, RT_NONE); - return (pointer) pCounter; + return (void *) pCounter; } pCounter->pSysCounterInfo = psci; psci->name = name; @@ -1096,12 +1096,12 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, XSyncMinValue(&psci->bracket_less); SysCounterList[SyncNumSystemCounters++] = pCounter; } - return (pointer) pCounter; + return (void *) pCounter; } void SyncDestroySystemCounter(pSysCounter) - pointer pSysCounter; + void * pSysCounter; { SyncCounter *pCounter = (SyncCounter *)pSysCounter; FreeResource(pCounter->id, RT_NONE); @@ -1186,7 +1186,7 @@ SyncComputeBracketValues(pCounter, startOver) if (pnewgtval || pnewltval) { - (*psci->BracketValues)((pointer)pCounter, pnewltval, pnewgtval); + (*psci->BracketValues)((void *)pCounter, pnewltval, pnewgtval); } } @@ -1197,7 +1197,7 @@ SyncComputeBracketValues(pCounter, startOver) /* ARGSUSED */ static int FreeAlarm(addr, id) - pointer addr; + void *addr; XID id; { SyncAlarm *pAlarm = (SyncAlarm *) addr; @@ -1224,7 +1224,7 @@ FreeAlarm(addr, id) /* ARGSUSED */ static int FreeCounter(env, id) - pointer env; + void *env; XID id; { SyncCounter *pCounter = (SyncCounter *) env; @@ -1276,7 +1276,7 @@ FreeCounter(env, id) /* ARGSUSED */ static int FreeAwait(addr, id) - pointer addr; + void *addr; XID id; { SyncAwaitUnion *pAwaitUnion = (SyncAwaitUnion *) addr; @@ -1304,7 +1304,7 @@ FreeAwait(addr, id) /* loosely based on dix/events.c/OtherClientGone */ static int FreeAlarmClient(value, id) - pointer value; /* must conform to DeleteType */ + void * value; /* must conform to DeleteType */ XID id; { SyncAlarm *pAlarm = (SyncAlarm *)value; @@ -1778,7 +1778,7 @@ ProcSyncQueryCounter(client) if (IsSystemCounter(pCounter)) { - (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter, + (*pCounter->pSysCounterInfo->QueryValue) ((void *) pCounter, &pCounter->value); } @@ -2406,7 +2406,7 @@ SyncExtensionInit(INITARGS) -static pointer ServertimeCounter; +static void * ServertimeCounter; static XSyncValue Now; static XSyncValue *pnext_time; @@ -2424,9 +2424,9 @@ static XSyncValue *pnext_time; */ /*ARGSUSED*/ static void ServertimeBlockHandler(env, wt, LastSelectMask) -pointer env; +void * env; struct timeval **wt; -pointer LastSelectMask; +void * LastSelectMask; { XSyncValue delay; unsigned long timeout; @@ -2455,9 +2455,9 @@ pointer LastSelectMask; */ /*ARGSUSED*/ static void ServertimeWakeupHandler(env, rc, LastSelectMask) -pointer env; +void * env; int rc; -pointer LastSelectMask; +void * LastSelectMask; { if (pnext_time) { @@ -2472,7 +2472,7 @@ pointer LastSelectMask; static void ServertimeQueryValue(pCounter, pValue_return) - pointer pCounter; + void * pCounter; CARD64 *pValue_return; { GetTime(); @@ -2481,7 +2481,7 @@ ServertimeQueryValue(pCounter, pValue_return) static void ServertimeBracketValues(pCounter, pbracket_less, pbracket_greater) - pointer pCounter; + void * pCounter; CARD64 *pbracket_less; CARD64 *pbracket_greater; { diff --git a/nx-X11/programs/Xserver/Xext/vidmodeproc.h b/nx-X11/programs/Xserver/Xext/vidmodeproc.h index 918d1e4df..1f7c6cd04 100644 --- a/nx-X11/programs/Xserver/Xext/vidmodeproc.h +++ b/nx-X11/programs/Xserver/Xext/vidmodeproc.h @@ -36,7 +36,7 @@ typedef enum { } VidModeSelectMonitor; typedef union { - pointer ptr; + void * ptr; int i; float f; } vidMonitorValue; @@ -44,31 +44,31 @@ typedef union { void XFree86VidModeExtensionInit(void); Bool VidModeAvailable(int scrnIndex); -Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock); -Bool VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock); -Bool VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock); -Bool VidModeDeleteModeline(int scrnIndex, pointer mode); +Bool VidModeGetCurrentModeline(int scrnIndex, void **mode, int *dotClock); +Bool VidModeGetFirstModeline(int scrnIndex, void **mode, int *dotClock); +Bool VidModeGetNextModeline(int scrnIndex, void **mode, int *dotClock); +Bool VidModeDeleteModeline(int scrnIndex, void * mode); Bool VidModeZoomViewport(int scrnIndex, int zoom); Bool VidModeGetViewPort(int scrnIndex, int *x, int *y); Bool VidModeSetViewPort(int scrnIndex, int x, int y); -Bool VidModeSwitchMode(int scrnIndex, pointer mode); +Bool VidModeSwitchMode(int scrnIndex, void * mode); Bool VidModeLockZoom(int scrnIndex, Bool lock); -Bool VidModeGetMonitor(int scrnIndex, pointer *monitor); +Bool VidModeGetMonitor(int scrnIndex, void **monitor); int VidModeGetNumOfClocks(int scrnIndex, Bool *progClock); Bool VidModeGetClocks(int scrnIndex, int *Clocks); -ModeStatus VidModeCheckModeForMonitor(int scrnIndex, pointer mode); -ModeStatus VidModeCheckModeForDriver(int scrnIndex, pointer mode); -void VidModeSetCrtcForMode(int scrnIndex, pointer mode); -Bool VidModeAddModeline(int scrnIndex, pointer mode); +ModeStatus VidModeCheckModeForMonitor(int scrnIndex, void * mode); +ModeStatus VidModeCheckModeForDriver(int scrnIndex, void * mode); +void VidModeSetCrtcForMode(int scrnIndex, void * mode); +Bool VidModeAddModeline(int scrnIndex, void * mode); int VidModeGetDotClock(int scrnIndex, int Clock); int VidModeGetNumOfModes(int scrnIndex); Bool VidModeSetGamma(int scrnIndex, float red, float green, float blue); Bool VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue); -pointer VidModeCreateMode(void); -void VidModeCopyMode(pointer modefrom, pointer modeto); -int VidModeGetModeValue(pointer mode, int valtyp); -void VidModeSetModeValue(pointer mode, int valtyp, int val); -vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx); +void * VidModeCreateMode(void); +void VidModeCopyMode(void * modefrom, void * modeto); +int VidModeGetModeValue(void * mode, int valtyp); +void VidModeSetModeValue(void * mode, int valtyp, int val); +vidMonitorValue VidModeGetMonitorValue(void * monitor, int valtyp, int indx); Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); Bool VidModeGetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); int VidModeGetGammaRampSize(int scrnIndex); diff --git a/nx-X11/programs/Xserver/Xext/xevie.c b/nx-X11/programs/Xserver/Xext/xevie.c index 3ec6cc4f0..354be121f 100644 --- a/nx-X11/programs/Xserver/Xext/xevie.c +++ b/nx-X11/programs/Xserver/Xext/xevie.c @@ -114,15 +114,15 @@ static int ErrorBase; static Bool XevieStart(void); static void XevieEnd(int clientIndex); -static void XevieClientStateCallback(CallbackListPtr *pcbl, pointer nulldata, - pointer calldata); +static void XevieClientStateCallback(CallbackListPtr *pcbl, void * nulldata, + void * calldata); static void XevieServerGrabStateCallback(CallbackListPtr *pcbl, - pointer nulldata, - pointer calldata); + void * nulldata, + void * calldata); -static Bool XevieAdd(DeviceIntPtr device, pointer data); +static Bool XevieAdd(DeviceIntPtr device, void * data); static void XevieWrap(DeviceIntPtr device, ProcessInputProc proc); -static Bool XevieRemove(DeviceIntPtr device, pointer data); +static Bool XevieRemove(DeviceIntPtr device, void * data); static void doSendEvent(xEvent *xE, DeviceIntPtr device); static void XeviePointerProcessInputProc(xEvent *xE, DeviceIntPtr dev, int count); @@ -570,8 +570,8 @@ XevieEnd(int clientIndex) } static void -XevieClientStateCallback(CallbackListPtr *pcbl, pointer nulldata, - pointer calldata) +XevieClientStateCallback(CallbackListPtr *pcbl, void * nulldata, + void * calldata) { NewClientInfoRec *pci = (NewClientInfoRec *)calldata; ClientPtr client = pci->client; @@ -581,8 +581,8 @@ XevieClientStateCallback(CallbackListPtr *pcbl, pointer nulldata, } static void -XevieServerGrabStateCallback(CallbackListPtr *pcbl, pointer nulldata, - pointer calldata) +XevieServerGrabStateCallback(CallbackListPtr *pcbl, void * nulldata, + void * calldata) { ServerGrabInfoRec *grbinfo = (ServerGrabInfoRec *)calldata; if (grbinfo->grabstate == SERVER_GRABBED) @@ -599,7 +599,7 @@ XevieServerGrabStateCallback(CallbackListPtr *pcbl, pointer nulldata, device->unwrapProc = proc; static void -xevieUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, pointer data) +xevieUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, void * data) { xevieDeviceInfoPtr xeviep = XEVIEINFO(device); ProcessInputProc tmp = device->public.processInputProc; @@ -643,7 +643,7 @@ XevieAdd(DeviceIntPtr device, void* data) } static Bool -XevieRemove(DeviceIntPtr device,pointer data) +XevieRemove(DeviceIntPtr device,void * data) { xevieDeviceInfoPtr xeviep = XEVIEINFO(device); @@ -697,7 +697,7 @@ doSendEvent(xEvent *xE, DeviceIntPtr dev) dev->key->modifierMap[xE->u.u.detail] = 0; if(dev->key->xkbInfo->repeatKey != 0 && xE->u.u.type != KeyPress) - XkbLastRepeatEvent= (pointer)xE; + XkbLastRepeatEvent= (void *)xE; UNWRAP_INPUTPROC(dev,xeviep); dev->public.processInputProc(xE,dev,1); COND_WRAP_INPUTPROC(dev,xeviep,tmp); diff --git a/nx-X11/programs/Xserver/Xext/xf86dga2.c b/nx-X11/programs/Xserver/Xext/xf86dga2.c index a5cab0f11..490554d9a 100644 --- a/nx-X11/programs/Xserver/Xext/xf86dga2.c +++ b/nx-X11/programs/Xserver/Xext/xf86dga2.c @@ -59,7 +59,7 @@ static DISPATCH_PROC(ProcXDGACreateColormap); static void XDGAResetProc(ExtensionEntry *extEntry); -static void DGAClientStateChange (CallbackListPtr*, pointer, pointer); +static void DGAClientStateChange (CallbackListPtr*, void *, void *); static ClientPtr DGAClients[MAXSCREENS]; @@ -291,8 +291,8 @@ ProcXDGAQueryModes(ClientPtr client) static void DGAClientStateChange ( CallbackListPtr* pcbl, - pointer nulldata, - pointer calldata + void * nulldata, + void * calldata ){ NewClientInfoRec* pci = (NewClientInfoRec*) calldata; ClientPtr client = NULL; @@ -370,7 +370,7 @@ ProcXDGASetMode(ClientPtr client) DGAClients[stuff->screen] = client; if(pPix) { - if(AddResource(stuff->pid, RT_PIXMAP, (pointer)(pPix))) { + if(AddResource(stuff->pid, RT_PIXMAP, (void *)(pPix))) { pPix->drawable.id = (int)stuff->pid; rep.flags = DGA_PIXMAP_AVAILABLE; } diff --git a/nx-X11/programs/Xserver/Xext/xf86misc.c b/nx-X11/programs/Xserver/Xext/xf86misc.c index a5dc2e212..6de794e1f 100644 --- a/nx-X11/programs/Xserver/Xext/xf86misc.c +++ b/nx-X11/programs/Xserver/Xext/xf86misc.c @@ -265,7 +265,7 @@ ProcXF86MiscGetMouseSettings(client) { xXF86MiscGetMouseSettingsReply rep; char *devname; - pointer mouse; + void * mouse; register int n; DEBUG_P("XF86MiscGetMouseSettings"); @@ -316,7 +316,7 @@ ProcXF86MiscGetKbdSettings(client) register ClientPtr client; { xXF86MiscGetKbdSettingsReply rep; - pointer kbd; + void * kbd; register int n; DEBUG_P("XF86MiscGetKbdSettings"); @@ -348,7 +348,7 @@ ProcXF86MiscSetMouseSettings(client) register ClientPtr client; { MiscExtReturn ret; - pointer mouse; + void * mouse; char *devname = NULL; int major, minor; @@ -369,7 +369,7 @@ ProcXF86MiscSetMouseSettings(client) (int)stuff->resolution, (unsigned long)stuff->flags); } - if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0) + if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (void *) 0) return BadAlloc; MiscExtSetMouseValue(mouse, MISC_MSE_PROTO, stuff->mousetype); @@ -425,7 +425,7 @@ ProcXF86MiscSetKbdSettings(client) register ClientPtr client; { MiscExtReturn ret; - pointer kbd; + void * kbd; REQUEST(xXF86MiscSetKbdSettingsReq); DEBUG_P("XF86MiscSetKbdSettings"); @@ -437,7 +437,7 @@ ProcXF86MiscSetKbdSettings(client) (int)stuff->kbdtype, (int)stuff->rate, (int)stuff->delay, stuff->servnumlock); - if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0) + if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (void *) 0) return BadAlloc; MiscExtSetKbdValue(kbd, MISC_KBD_TYPE, stuff->kbdtype); diff --git a/nx-X11/programs/Xserver/Xext/xf86miscproc.h b/nx-X11/programs/Xserver/Xext/xf86miscproc.h index 87a251767..5eefa02a3 100644 --- a/nx-X11/programs/Xserver/Xext/xf86miscproc.h +++ b/nx-X11/programs/Xserver/Xext/xf86miscproc.h @@ -50,17 +50,17 @@ typedef enum { void XFree86MiscExtensionInit(void); -Bool MiscExtGetMouseSettings(pointer *mouse, char **devname); -int MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype); -Bool MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value); -Bool MiscExtGetKbdSettings(pointer *kbd); -int MiscExtGetKbdValue(pointer kbd, MiscExtKbdValType valtype); -Bool MiscExtSetKbdValue(pointer kbd, MiscExtKbdValType valtype, int value); +Bool MiscExtGetMouseSettings(void **mouse, char **devname); +int MiscExtGetMouseValue(void * mouse, MiscExtMseValType valtype); +Bool MiscExtSetMouseValue(void * mouse, MiscExtMseValType valtype, int value); +Bool MiscExtGetKbdSettings(void **kbd); +int MiscExtGetKbdValue(void * kbd, MiscExtKbdValType valtype); +Bool MiscExtSetKbdValue(void * kbd, MiscExtKbdValType valtype, int value); int MiscExtSetGrabKeysState(ClientPtr client, int enable); -pointer MiscExtCreateStruct(MiscExtStructType mse_or_kbd); -void MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd); -MiscExtReturn MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd); -Bool MiscExtSetMouseDevice(pointer mouse, char* device); +void * MiscExtCreateStruct(MiscExtStructType mse_or_kbd); +void MiscExtDestroyStruct(void * structure, MiscExtStructType mse_or_kbd); +MiscExtReturn MiscExtApply(void * structure, MiscExtStructType mse_or_kbd); +Bool MiscExtSetMouseDevice(void * mouse, char* device); Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath, const char **logfile); int MiscExtPassMessage(int scrn, const char *msgtype, const char *msgval, diff --git a/nx-X11/programs/Xserver/Xext/xf86vmode.c b/nx-X11/programs/Xserver/Xext/xf86vmode.c index fa49fcd75..979f55c00 100644 --- a/nx-X11/programs/Xserver/Xext/xf86vmode.c +++ b/nx-X11/programs/Xserver/Xext/xf86vmode.c @@ -155,7 +155,7 @@ typedef struct _XF86VidModeScreenPrivate { static int ScreenPrivateIndex; #define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr)(s)->devPrivates[ScreenPrivateIndex].ptr) -#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (pointer) v); +#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (void *) v); #define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s) #define New(t) (xalloc (sizeof (t))) @@ -338,7 +338,7 @@ setEventMask (ScreenPtr pScreen, ClientPtr client, unsigned long mask) } static int -XF86VidModeFreeEvents(pointer value, XID id) +XF86VidModeFreeEvents(void * value, XID id) { XF86VidModeEventPtr pOld = (XF86VidModeEventPtr)value; ScreenPtr pScreen = pOld->screen; @@ -437,7 +437,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client) REQUEST(xXF86VidModeGetModeLineReq); xXF86VidModeGetModeLineReply rep; xXF86OldVidModeGetModeLineReply oldrep; - pointer mode; + void * mode; register int n; int dotClock; int ver; @@ -539,7 +539,7 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) xXF86VidModeGetAllModeLinesReply rep; xXF86VidModeModeInfo mdinf; xXF86OldVidModeModeInfo oldmdinf; - pointer mode; + void * mode; int modecount, dotClock; register int n; int ver; @@ -645,7 +645,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client) xXF86OldVidModeAddModeLineReq *oldstuff = (xXF86OldVidModeAddModeLineReq *)client->requestBuffer; xXF86VidModeAddModeLineReq newstuff; - pointer mode; + void * mode; int len; int dotClock; int ver; @@ -805,7 +805,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) xXF86OldVidModeDeleteModeLineReq *oldstuff = (xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer; xXF86VidModeDeleteModeLineReq newstuff; - pointer mode; + void * mode; int len, dotClock; int ver; @@ -922,7 +922,7 @@ ProcXF86VidModeModModeLine(ClientPtr client) xXF86OldVidModeModModeLineReq *oldstuff = (xXF86OldVidModeModModeLineReq *)client->requestBuffer; xXF86VidModeModModeLineReq newstuff; - pointer mode, modetmp; + void * mode, modetmp; int len, dotClock; int ver; @@ -1047,7 +1047,7 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer; xXF86VidModeValidateModeLineReq newstuff; xXF86VidModeValidateModeLineReply rep; - pointer mode, modetmp = NULL; + void * mode, modetmp = NULL; int len, status, dotClock; int ver; @@ -1181,7 +1181,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) xXF86OldVidModeSwitchToModeReq *oldstuff = (xXF86OldVidModeSwitchToModeReq *)client->requestBuffer; xXF86VidModeSwitchToModeReq newstuff; - pointer mode; + void * mode; int len, dotClock; int ver; @@ -1297,7 +1297,7 @@ ProcXF86VidModeGetMonitor(ClientPtr client) register int n; CARD32 *hsyncdata, *vsyncdata; int i, nHsync, nVrefresh; - pointer monitor; + void * monitor; DEBUG_P("XF86VidModeGetMonitor"); diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c index d13d3368b..dc4018dd7 100644 --- a/nx-X11/programs/Xserver/Xext/xres.c +++ b/nx-X11/programs/Xserver/Xext/xres.c @@ -106,7 +106,7 @@ ProcXResQueryClients (ClientPtr client) static void -ResFindAllRes (pointer value, XID id, RESTYPE type, pointer cdata) +ResFindAllRes (void * value, XID id, RESTYPE type, void * cdata) { int *counts = (int *)cdata; @@ -186,7 +186,7 @@ ProcXResQueryClientResources (ClientPtr client) } static void -ResFindPixmaps (pointer value, XID id, pointer cdata) +ResFindPixmaps (void * value, XID id, void * cdata) { unsigned long *bytes = (unsigned long *)cdata; PixmapPtr pix = (PixmapPtr)value; @@ -216,7 +216,7 @@ ProcXResQueryClientPixmapBytes (ClientPtr client) bytes = 0; FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps, - (pointer)(&bytes)); + (void *)(&bytes)); rep.type = X_Reply; rep.sequenceNumber = client->sequence; diff --git a/nx-X11/programs/Xserver/Xext/xtest1dd.c b/nx-X11/programs/Xserver/Xext/xtest1dd.c index 81d283c36..c78cceed0 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1dd.c +++ b/nx-X11/programs/Xserver/Xext/xtest1dd.c @@ -1613,5 +1613,5 @@ ClientPtr client; rep.size_return = ACTION_ARRAY_SIZE; WriteReplyToClient(client, sizeof(xTestQueryInputSizeReply), - (pointer) &rep); + (void *) &rep); } diff --git a/nx-X11/programs/Xserver/Xext/xtest1di.c b/nx-X11/programs/Xserver/Xext/xtest1di.c index d95b30612..985193a89 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1di.c +++ b/nx-X11/programs/Xserver/Xext/xtest1di.c @@ -152,7 +152,7 @@ static void SEventXTestDispatch( ); static int XTestCurrentClientGone( - pointer /* value */, + void * /* value */, XID /* id */ ); @@ -752,7 +752,7 @@ XTestResetProc(unused) /*ARGSUSED*/ static int XTestCurrentClientGone(value, id) - pointer value; + void * value; XID id; { /* diff --git a/nx-X11/programs/Xserver/Xext/xvmain.c b/nx-X11/programs/Xserver/Xext/xvmain.c index 8934f77f2..bbbb34dcf 100644 --- a/nx-X11/programs/Xserver/Xext/xvmain.c +++ b/nx-X11/programs/Xserver/Xext/xvmain.c @@ -139,12 +139,12 @@ static Bool XvCloseScreen(int, ScreenPtr); static Bool XvDestroyPixmap(PixmapPtr); static Bool XvDestroyWindow(WindowPtr); static void XvResetProc(ExtensionEntry*); -static int XvdiDestroyGrab(pointer, XID); -static int XvdiDestroyEncoding(pointer, XID); -static int XvdiDestroyVideoNotify(pointer, XID); -static int XvdiDestroyPortNotify(pointer, XID); -static int XvdiDestroyVideoNotifyList(pointer, XID); -static int XvdiDestroyPort(pointer, XID); +static int XvdiDestroyGrab(void *, XID); +static int XvdiDestroyEncoding(void *, XID); +static int XvdiDestroyVideoNotify(void *, XID); +static int XvdiDestroyPortNotify(void *, XID); +static int XvdiDestroyVideoNotifyList(void *, XID); +static int XvdiDestroyPort(void *, XID); static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int); @@ -295,7 +295,7 @@ XvScreenInit(ScreenPtr pScreen) return BadAlloc; } - pScreen->devPrivates[XvScreenIndex].ptr = (pointer)pxvs; + pScreen->devPrivates[XvScreenIndex].ptr = (void *)pxvs; pxvs->DestroyPixmap = pScreen->DestroyPixmap; @@ -327,7 +327,7 @@ XvCloseScreen( xfree(pxvs); - pScreen->devPrivates[XvScreenIndex].ptr = (pointer)NULL; + pScreen->devPrivates[XvScreenIndex].ptr = (void *)NULL; return (*pScreen->CloseScreen)(ii, pScreen); @@ -479,20 +479,20 @@ XvdiVideoStopped(XvPortPtr pPort, int reason) } static int -XvdiDestroyPort(pointer pPort, XID id) +XvdiDestroyPort(void * pPort, XID id) { return (* ((XvPortPtr)pPort)->pAdaptor->ddFreePort)(pPort); } static int -XvdiDestroyGrab(pointer pGrab, XID id) +XvdiDestroyGrab(void * pGrab, XID id) { ((XvGrabPtr)pGrab)->client = (ClientPtr)NULL; return Success; } static int -XvdiDestroyVideoNotify(pointer pn, XID id) +XvdiDestroyVideoNotify(void * pn, XID id) { /* JUST CLEAR OUT THE client POINTER FIELD */ @@ -501,7 +501,7 @@ XvdiDestroyVideoNotify(pointer pn, XID id) } static int -XvdiDestroyPortNotify(pointer pn, XID id) +XvdiDestroyPortNotify(void * pn, XID id) { /* JUST CLEAR OUT THE client POINTER FIELD */ @@ -510,7 +510,7 @@ XvdiDestroyPortNotify(pointer pn, XID id) } static int -XvdiDestroyVideoNotifyList(pointer pn, XID id) +XvdiDestroyVideoNotifyList(void * pn, XID id) { XvVideoNotifyPtr npn,cpn; @@ -529,7 +529,7 @@ XvdiDestroyVideoNotifyList(pointer pn, XID id) } static int -XvdiDestroyEncoding(pointer value, XID id) +XvdiDestroyEncoding(void * value, XID id) { return Success; } diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c index 37fb153ab..30de35a2b 100644 --- a/nx-X11/programs/Xserver/Xext/xvmc.c +++ b/nx-X11/programs/Xserver/Xext/xvmc.c @@ -66,7 +66,7 @@ typedef struct { static int -XvMCDestroyContextRes(pointer data, XID id) +XvMCDestroyContextRes(void * data, XID id) { XvMCContextPtr pContext = (XvMCContextPtr)data; @@ -82,7 +82,7 @@ XvMCDestroyContextRes(pointer data, XID id) } static int -XvMCDestroySurfaceRes(pointer data, XID id) +XvMCDestroySurfaceRes(void * data, XID id) { XvMCSurfacePtr pSurface = (XvMCSurfacePtr)data; XvMCContextPtr pContext = pSurface->context; @@ -91,14 +91,14 @@ XvMCDestroySurfaceRes(pointer data, XID id) (*pScreenPriv->adaptors[pContext->adapt_num].DestroySurface)(pSurface); xfree(pSurface); - XvMCDestroyContextRes((pointer)pContext, pContext->context_id); + XvMCDestroyContextRes((void *)pContext, pContext->context_id); return Success; } static int -XvMCDestroySubpictureRes(pointer data, XID id) +XvMCDestroySubpictureRes(void * data, XID id) { XvMCSubpicturePtr pSubpict = (XvMCSubpicturePtr)data; XvMCContextPtr pContext = pSubpict->context; @@ -107,7 +107,7 @@ XvMCDestroySubpictureRes(pointer data, XID id) (*pScreenPriv->adaptors[pContext->adapt_num].DestroySubpicture)(pSubpict); xfree(pSubpict); - XvMCDestroyContextRes((pointer)pContext, pContext->context_id); + XvMCDestroyContextRes((void *)pContext, pContext->context_id); return Success; } @@ -729,7 +729,7 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt) if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec)))) return BadAlloc; - pScreen->devPrivates[XvMCScreenIndex].ptr = (pointer)pScreenPriv; + pScreen->devPrivates[XvMCScreenIndex].ptr = (void *)pScreenPriv; pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = XvMCCloseScreen; diff --git a/nx-X11/programs/Xserver/Xext/xvmcext.h b/nx-X11/programs/Xserver/Xext/xvmcext.h index c7eba30ad..7cb8af24d 100644 --- a/nx-X11/programs/Xserver/Xext/xvmcext.h +++ b/nx-X11/programs/Xserver/Xext/xvmcext.h @@ -32,15 +32,15 @@ typedef struct { unsigned short height; CARD32 flags; int refcnt; - pointer port_priv; - pointer driver_priv; + void * port_priv; + void * driver_priv; } XvMCContextRec, *XvMCContextPtr; typedef struct { XID surface_id; int surface_type_id; XvMCContextPtr context; - pointer driver_priv; + void * driver_priv; } XvMCSurfaceRec, *XvMCSurfacePtr; @@ -53,7 +53,7 @@ typedef struct { int entry_bytes; char component_order[4]; XvMCContextPtr context; - pointer driver_priv; + void * driver_priv; } XvMCSubpictureRec, *XvMCSubpicturePtr; typedef int (*XvMCCreateContextProcPtr) ( diff --git a/nx-X11/programs/Xserver/Xi/devbell.c b/nx-X11/programs/Xserver/Xi/devbell.c index bdc941c1c..190e32086 100644 --- a/nx-X11/programs/Xserver/Xi/devbell.c +++ b/nx-X11/programs/Xserver/Xi/devbell.c @@ -104,7 +104,7 @@ ProcXDeviceBell (client) int base; int newpercent; CARD8 class; - pointer ctrl; + void * ctrl; BellProcPtr proc; REQUEST(xDeviceBellReq); @@ -137,7 +137,7 @@ ProcXDeviceBell (client) } base = k->ctrl.bell; proc = k->BellProc; - ctrl = (pointer) &(k->ctrl); + ctrl = (void *) &(k->ctrl); class = KbdFeedbackClass; } else if (stuff->feedbackclass == BellFeedbackClass) @@ -153,7 +153,7 @@ ProcXDeviceBell (client) } base = b->ctrl.percent; proc = b->BellProc; - ctrl = (pointer) &(b->ctrl); + ctrl = (void *) &(b->ctrl); class = BellFeedbackClass; } else diff --git a/nx-X11/programs/Xserver/Xi/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c index 99fbb129a..f0c9aea3d 100644 --- a/nx-X11/programs/Xserver/Xi/exevents.c +++ b/nx-X11/programs/Xserver/Xi/exevents.c @@ -143,7 +143,7 @@ ProcessOtherEvent (xE, other, count) DeviceEventInfoRec eventinfo; eventinfo.events = (xEventPtr) xE; eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); + CallCallbacks(&DeviceEventCallback, (void *)&eventinfo); } for (i=1; itype == DeviceValuator) @@ -751,7 +751,7 @@ AddExtensionClient (pWin, client, mask, mskidx) others->resource = FakeClientID(client->index); others->next = pWin->optional->inputMasks->inputClients; pWin->optional->inputMasks->inputClients = others; - if (!AddResource(others->resource, RT_INPUTCLIENT, (pointer)pWin)) + if (!AddResource(others->resource, RT_INPUTCLIENT, (void *)pWin)) return BadAlloc; return Success; } @@ -846,7 +846,7 @@ InputClientGone(pWin, id) { other->resource = FakeClientID(0); if (!AddResource(other->resource, RT_INPUTCLIENT, - (pointer)pWin)) + (void *)pWin)) return BadAlloc; } } diff --git a/nx-X11/programs/Xserver/Xi/stubs.c b/nx-X11/programs/Xserver/Xi/stubs.c index 7ad6d903e..2d9aad08b 100644 --- a/nx-X11/programs/Xserver/Xi/stubs.c +++ b/nx-X11/programs/Xserver/Xi/stubs.c @@ -209,7 +209,7 @@ AddOtherInputDevices () DeviceIntPtr dev; DeviceProc deviceProc; - pointer private; + void * private; dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE); dev->public.devicePrivate = private; diff --git a/nx-X11/programs/Xserver/composite/compext.c b/nx-X11/programs/Xserver/composite/compext.c index 657ed9bdc..d182da1fd 100644 --- a/nx-X11/programs/Xserver/composite/compext.c +++ b/nx-X11/programs/Xserver/composite/compext.c @@ -42,8 +42,8 @@ typedef struct _CompositeClient { static void CompositeClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) + void *closure, + void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -59,7 +59,7 @@ CompositeResetProc (ExtensionEntry *extEntry) } static int -FreeCompositeClientWindow (pointer value, XID ccwid) +FreeCompositeClientWindow (void * value, XID ccwid) { WindowPtr pWin = value; @@ -68,7 +68,7 @@ FreeCompositeClientWindow (pointer value, XID ccwid) } static int -FreeCompositeClientSubwindows (pointer value, XID ccwid) +FreeCompositeClientSubwindows (void * value, XID ccwid) { WindowPtr pWin = value; @@ -203,7 +203,7 @@ ProcCompositeCreateRegionFromBorderClip (ClientPtr client) return BadAlloc; REGION_TRANSLATE (pScreen, pRegion, -pWin->drawable.x, -pWin->drawable.y); - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -237,7 +237,7 @@ ProcCompositeNameWindowPixmap (ClientPtr client) ++pPixmap->refcnt; - if (!AddResource (stuff->pixmap, RT_PIXMAP, (pointer) pPixmap)) + if (!AddResource (stuff->pixmap, RT_PIXMAP, (void *) pPixmap)) return BadAlloc; return(client->noClientException); diff --git a/nx-X11/programs/Xserver/composite/compinit.c b/nx-X11/programs/Xserver/composite/compinit.c index d76885c43..13a6d6c01 100644 --- a/nx-X11/programs/Xserver/composite/compinit.c +++ b/nx-X11/programs/Xserver/composite/compinit.c @@ -93,9 +93,9 @@ compScreenUpdate (ScreenPtr pScreen) static void compBlockHandler (int i, - pointer blockData, - pointer pTimeout, - pointer pReadmask) + void *blockData, + void *pTimeout, + void *pReadmask) { ScreenPtr pScreen = screenInfo.screens[i]; CompScreenPtr cs = GetCompScreen (pScreen); @@ -385,6 +385,6 @@ compScreenInit (ScreenPtr pScreen) cs->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = compCloseScreen; - pScreen->devPrivates[CompScreenPrivateIndex].ptr = (pointer) cs; + pScreen->devPrivates[CompScreenPrivateIndex].ptr = (void *) cs; return TRUE; } diff --git a/nx-X11/programs/Xserver/composite/compwindow.c b/nx-X11/programs/Xserver/composite/compwindow.c index 2093095f0..2bb581329 100644 --- a/nx-X11/programs/Xserver/composite/compwindow.c +++ b/nx-X11/programs/Xserver/composite/compwindow.c @@ -30,7 +30,7 @@ #ifdef COMPOSITE_DEBUG static int -compCheckWindow (WindowPtr pWin, pointer data) +compCheckWindow (WindowPtr pWin, void * data) { ScreenPtr pScreen = pWin->drawable.pScreen; PixmapPtr pWinPixmap = (*pScreen->GetWindowPixmap) (pWin); @@ -71,7 +71,7 @@ typedef struct _compPixmapVisit { } CompPixmapVisitRec, *CompPixmapVisitPtr; static Bool -compRepaintBorder (ClientPtr pClient, pointer closure) +compRepaintBorder (ClientPtr pClient, void * closure) { WindowPtr pWindow = LookupWindow ((XID) closure, pClient); @@ -88,7 +88,7 @@ compRepaintBorder (ClientPtr pClient, pointer closure) } static int -compSetPixmapVisitWindow (WindowPtr pWindow, pointer data) +compSetPixmapVisitWindow (WindowPtr pWindow, void * data) { CompPixmapVisitPtr pVisit = (CompPixmapVisitPtr) data; ScreenPtr pScreen = pWindow->drawable.pScreen; @@ -105,7 +105,7 @@ compSetPixmapVisitWindow (WindowPtr pWindow, pointer data) SetBorderSize (pWindow); if (HasBorder (pWindow)) QueueWorkProc (compRepaintBorder, serverClient, - (pointer) pWindow->drawable.id); + (void *) pWindow->drawable.id); return WT_WALKCHILDREN; } @@ -116,7 +116,7 @@ compSetPixmap (WindowPtr pWindow, PixmapPtr pPixmap) visitRec.pWindow = pWindow; visitRec.pPixmap = pPixmap; - TraverseTree (pWindow, compSetPixmapVisitWindow, (pointer) &visitRec); + TraverseTree (pWindow, compSetPixmapVisitWindow, (void *) &visitRec); compCheckTree (pWindow->drawable.pScreen); } diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index 24809347a..33cbb5f7b 100755 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -216,7 +216,7 @@ ProcDamageCreate (ClientPtr client) xfree (pDamageExt); return BadAlloc; } - if (!AddResource (stuff->damage, DamageExtType, (pointer) pDamageExt)) + if (!AddResource (stuff->damage, DamageExtType, (void *) pDamageExt)) return BadAlloc; DamageRegister (pDamageExt->pDrawable, pDamageExt->pDamage); @@ -376,8 +376,8 @@ SProcDamageDispatch (ClientPtr client) static void DamageClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) + void * closure, + void * data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -396,7 +396,7 @@ DamageResetProc (ExtensionEntry *extEntry) } static int -FreeDamageExt (pointer value, XID did) +FreeDamageExt (void * value, XID did) { DamageExtPtr pDamageExt = (DamageExtPtr) value; @@ -416,7 +416,7 @@ FreeDamageExt (pointer value, XID did) } static int -FreeDamageExtWin (pointer value, XID wid) +FreeDamageExtWin (void * value, XID wid) { DamageExtPtr pDamageExt = (DamageExtPtr) value; diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 5a1e9b00b..ad5294a4c 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -188,11 +188,11 @@ DbeAllocWinPriv(pScreen) { if ((size = *sizes)) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } } @@ -497,7 +497,7 @@ ProcDbeAllocateBackBufferName(client) /* Make the window priv a DBE window priv resource. */ if (!AddResource(stuff->buffer, dbeWindowPrivResType, - (pointer)pDbeWindowPriv)) + (void *)pDbeWindowPriv)) { xfree(pDbeWindowPriv); return(BadAlloc); @@ -524,7 +524,7 @@ ProcDbeAllocateBackBufferName(client) /* Actually connect the window priv to the window. */ - pWin->devPrivates[dbeWindowPrivIndex].ptr = (pointer)pDbeWindowPriv; + pWin->devPrivates[dbeWindowPrivIndex].ptr = (void *)pDbeWindowPriv; } /* if -- There is no buffer associated with the window. */ @@ -592,7 +592,7 @@ ProcDbeAllocateBackBufferName(client) /* Associate the new ID with an existing window priv. */ if (!AddResource(stuff->buffer, dbeWindowPrivResType, - (pointer)pDbeWindowPriv)) + (void *)pDbeWindowPriv)) { pDbeWindowPriv->IDs[i] = DBE_FREE_ID_ELEMENT; return(BadAlloc); @@ -1490,7 +1490,7 @@ DbeSetupBackgroundPainter(pWin, pGC) WindowPtr pWin; GCPtr pGC; { - pointer gcvalues[4]; + void *gcvalues[4]; int ts_x_origin, ts_y_origin; PixUnion background; int backgroundState; @@ -1516,16 +1516,16 @@ DbeSetupBackgroundPainter(pWin, pGC) switch (backgroundState) { case BackgroundPixel: - gcvalues[0] = (pointer)background.pixel; - gcvalues[1] = (pointer)FillSolid; + gcvalues[0] = (void *)background.pixel; + gcvalues[1] = (void *)FillSolid; gcmask = GCForeground|GCFillStyle; break; case BackgroundPixmap: - gcvalues[0] = (pointer)FillTiled; - gcvalues[1] = (pointer)background.pixmap; - gcvalues[2] = (pointer)(long)ts_x_origin; - gcvalues[3] = (pointer)(long)ts_y_origin; + gcvalues[0] = (void *)FillTiled; + gcvalues[1] = (void *)background.pixmap; + gcvalues[2] = (void *)(long)ts_x_origin; + gcvalues[3] = (void *)(long)ts_y_origin; gcmask = GCFillStyle|GCTile|GCTileStipXOrigin|GCTileStipYOrigin; break; @@ -1562,7 +1562,7 @@ DbeSetupBackgroundPainter(pWin, pGC) *****************************************************************************/ static int DbeDrawableDelete(pDrawable, id) - pointer pDrawable; + void *pDrawable; XID id; { return(Success); @@ -1583,7 +1583,7 @@ DbeDrawableDelete(pDrawable, id) *****************************************************************************/ static int DbeWindowPrivDelete(pDbeWinPriv, id) - pointer pDbeWinPriv; + void *pDbeWinPriv; XID id; { DbeScreenPrivPtr pDbeScreenPriv; @@ -1668,7 +1668,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id) { /* Reset the DBE window priv pointer. */ pDbeWindowPriv->pWindow->devPrivates[dbeWindowPrivIndex].ptr = - (pointer)NULL; + (void *)NULL; /* We are done with the window priv. */ xfree(pDbeWindowPriv); @@ -1888,7 +1888,7 @@ DbeExtensionInit() return; } - pScreen->devPrivates[dbeScreenPrivIndex].ptr = (pointer)pDbeScreenPriv; + pScreen->devPrivates[dbeScreenPrivIndex].ptr = (void *)pDbeScreenPriv; /* Store the DBE priv priv size info for later use when allocating * priv privs at the driver level. diff --git a/nx-X11/programs/Xserver/dbe/dbemodule.c b/nx-X11/programs/Xserver/dbe/dbemodule.c index 62fbcfd21..9a05f4071 100644 --- a/nx-X11/programs/Xserver/dbe/dbemodule.c +++ b/nx-X11/programs/Xserver/dbe/dbemodule.c @@ -38,11 +38,11 @@ static XF86ModuleVersionInfo VersRec = */ XF86ModuleData dbeModuleData = { &VersRec, dbeSetup, NULL }; -static pointer -dbeSetup(pointer module, pointer opts, int *errmaj, int *errmin) +static void * +dbeSetup(void * module, void * opts, int *errmaj, int *errmin) { LoadExtension(&dbeExt, FALSE); /* Need a non-NULL return value to indicate success */ - return (pointer)1; + return (void *)1; } diff --git a/nx-X11/programs/Xserver/dbe/midbe.c b/nx-X11/programs/Xserver/dbe/midbe.c index 235693bb2..042f95953 100644 --- a/nx-X11/programs/Xserver/dbe/midbe.c +++ b/nx-X11/programs/Xserver/dbe/midbe.c @@ -214,7 +214,7 @@ miDbeAllocBackBufferName(pWin, bufId, swapAction) /* Make the back pixmap a DBE drawable resource. */ if (!AddResource(bufId, dbeDrawableResType, - (pointer)pDbeWindowPrivPriv->pBackBuffer)) + (void *)pDbeWindowPrivPriv->pBackBuffer)) { /* free the buffer and the drawable resource */ FreeResource(bufId, RT_NONE); @@ -224,7 +224,7 @@ miDbeAllocBackBufferName(pWin, bufId, swapAction) /* Attach the priv priv to the priv. */ pDbeWindowPriv->devPrivates[miDbeWindowPrivPrivIndex].ptr = - (pointer)pDbeWindowPrivPriv; + (void *)pDbeWindowPrivPriv; /* Clear the back buffer. */ @@ -252,7 +252,7 @@ miDbeAllocBackBufferName(pWin, bufId, swapAction) /* Associate the new ID with an existing pixmap. */ pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv); if (!AddResource(bufId, dbeDrawableResType, - (pointer)pDbeWindowPrivPriv->pBackBuffer)) + (void *)pDbeWindowPrivPriv->pBackBuffer)) { return(BadAlloc); } @@ -286,7 +286,7 @@ miDbeAliasBuffers(pDbeWindowPriv) for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++) { ChangeResourceValue(pDbeWindowPriv->IDs[i], dbeDrawableResType, - (pointer)pDbeWindowPrivPriv->pBackBuffer); + (void *)pDbeWindowPrivPriv->pBackBuffer); } } /* miDbeAliasBuffers() */ diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index 210bc2731..32d9bae89 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -382,7 +382,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, pmap->numPixelsBlue[client] = size; } } - if (!AddResource(mid, RT_COLORMAP, (pointer)pmap)) + if (!AddResource(mid, RT_COLORMAP, (void *)pmap)) return (BadAlloc); /* If the device wants a chance to initialize the colormap in any way, * this is it. In specific, if this is a Static colormap, this is the @@ -422,7 +422,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, * \param value must conform to DeleteType */ int -FreeColormap (pointer value, XID mid) +FreeColormap (void * value, XID mid) { int i; register EntryPtr pent; @@ -431,7 +431,7 @@ FreeColormap (pointer value, XID mid) if(CLIENT_ID(mid) != SERVER_ID) { (*pmap->pScreen->UninstallColormap) (pmap); - WalkTree(pmap->pScreen, (VisitWindowProcPtr)TellNoMap, (pointer) &mid); + WalkTree(pmap->pScreen, (VisitWindowProcPtr)TellNoMap, (void *) &mid); } /* This is the device's chance to undo anything it needs to, especially @@ -506,7 +506,7 @@ TellNoMap (WindowPtr pwin, Colormap *pmid) /* Tell window that pmid got uninstalled */ int -TellLostMap (WindowPtr pwin, pointer value) +TellLostMap (WindowPtr pwin, void * value) { Colormap *pmid = (Colormap *)value; xEvent xE; @@ -531,7 +531,7 @@ TellLostMap (WindowPtr pwin, pointer value) /* Tell window that pmid got installed */ int -TellGainedMap (WindowPtr pwin, pointer value) +TellGainedMap (WindowPtr pwin, void * value) { Colormap *pmid = (Colormap *)value; xEvent xE; @@ -974,7 +974,7 @@ AllocColor (ColormapPtr pmap, } pcr->mid = pmap->mid; pcr->client = client; - if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer)pcr)) + if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *)pcr)) return (BadAlloc); } return (Success); @@ -1599,7 +1599,7 @@ FreePixels(register ColormapPtr pmap, register int client) * \unused fakeid */ int -FreeClientPixels (pointer value, XID fakeid) +FreeClientPixels (void * value, XID fakeid) { ColormapPtr pmap; colorResource *pcr = (colorResource *)value; @@ -1674,7 +1674,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes, { pcr->mid = pmap->mid; pcr->client = client; - if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer)pcr)) + if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *)pcr)) ok = BadAlloc; } else if (pcr) xfree(pcr); @@ -1765,7 +1765,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors, { pcr->mid = pmap->mid; pcr->client = client; - if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer)pcr)) + if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *)pcr)) ok = BadAlloc; } else if (pcr) xfree(pcr); diff --git a/nx-X11/programs/Xserver/dix/cursor.c b/nx-X11/programs/Xserver/dix/cursor.c index f4d6c6419..187dd62c5 100644 --- a/nx-X11/programs/Xserver/dix/cursor.c +++ b/nx-X11/programs/Xserver/dix/cursor.c @@ -110,7 +110,7 @@ FreeCursorBits(CursorBitsPtr bits) * \param value must conform to DeleteType */ int -FreeCursor(pointer value, XID cid) +FreeCursor(void * value, XID cid) { int nscr; CursorPtr pCurs = (CursorPtr)value; @@ -452,7 +452,7 @@ CreateRootCursor(char *pfilename, unsigned glyph) 0, 0, 0, ~0, ~0, ~0, &curs, serverClient) != Success) return NullCursor; - if (!AddResource(FakeClientID(0), RT_CURSOR, (pointer)curs)) + if (!AddResource(FakeClientID(0), RT_CURSOR, (void *)curs)) return NullCursor; return curs; diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index e29154cfc..917a3849a 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -1449,7 +1449,7 @@ ProcBell(ClientPtr client) else #endif (*keybd->kbdfeed->BellProc)(newpercent, keybd, - (pointer) &keybd->kbdfeed->ctrl, 0); + (void *) &keybd->kbdfeed->ctrl, 0); return Success; } diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 3fd971101..71c22ae0e 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -531,7 +531,7 @@ ProcCreateWindow(ClientPtr client) Mask mask = pWin->eventMask; pWin->eventMask = 0; /* subterfuge in case AddResource fails */ - if (!AddResource(stuff->wid, RT_WINDOW, (pointer)pWin)) + if (!AddResource(stuff->wid, RT_WINDOW, (void *)pWin)) return BadAlloc; pWin->eventMask = mask; } @@ -1171,7 +1171,7 @@ ProcGrabServer(register ClientPtr client) ServerGrabInfoRec grabinfo; grabinfo.client = client; grabinfo.grabstate = SERVER_GRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); + CallCallbacks(&ServerGrabCallback, (void *)&grabinfo); } return(client->noClientException); @@ -1200,7 +1200,7 @@ UngrabServer(ClientPtr client) ServerGrabInfoRec grabinfo; grabinfo.client = client; grabinfo.grabstate = SERVER_UNGRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); + CallCallbacks(&ServerGrabCallback, (void *)&grabinfo); } } @@ -1468,7 +1468,7 @@ ProcListFontsWithInfo(register ClientPtr client) * \param value must conform to DeleteType */ int -dixDestroyPixmap(pointer value, XID pid) +dixDestroyPixmap(void * value, XID pid) { PixmapPtr pPixmap = (PixmapPtr)value; return (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap); @@ -1527,7 +1527,7 @@ CreatePmap: { pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) + if (AddResource(stuff->pid, RT_PIXMAP, (void *)pMap)) return(client->noClientException); } return (BadAlloc); @@ -1576,7 +1576,7 @@ ProcCreateGC(register ClientPtr client) (XID *) &stuff[1], &error); if (error != Success) return error; - if (!AddResource(stuff->gc, RT_GC, (pointer)pGC)) + if (!AddResource(stuff->gc, RT_GC, (void *)pGC)) return (BadAlloc); return(client->noClientException); } @@ -2250,7 +2250,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, nlines, format, planemask, - (pointer) pBuf); + (void *) pBuf); #ifdef XCSECURITY if (pVisibleRegion) SecurityCensorImage(client, pVisibleRegion, widthBytesLine, @@ -2291,7 +2291,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, nlines, format, plane, - (pointer)pBuf); + (void *)pBuf); #ifdef XCSECURITY if (pVisibleRegion) SecurityCensorImage(client, pVisibleRegion, @@ -3122,7 +3122,7 @@ ProcCreateCursor (register ClientPtr client) /* zeroing the (pad) bits helps some ddx cursor handling */ bzero((char *)srcbits, n); (* src->drawable.pScreen->GetImage)( (DrawablePtr)src, 0, 0, width, height, - XYPixmap, 1, (pointer)srcbits); + XYPixmap, 1, (void *)srcbits); if ( msk == (PixmapPtr)NULL) { register unsigned char *bits = mskbits; @@ -3134,7 +3134,7 @@ ProcCreateCursor (register ClientPtr client) /* zeroing the (pad) bits helps some ddx cursor handling */ bzero((char *)mskbits, n); (* msk->drawable.pScreen->GetImage)( (DrawablePtr)msk, 0, 0, width, - height, XYPixmap, 1, (pointer)mskbits); + height, XYPixmap, 1, (void *)mskbits); } cm.width = width; cm.height = height; @@ -3144,7 +3144,7 @@ ProcCreateCursor (register ClientPtr client) stuff->foreRed, stuff->foreGreen, stuff->foreBlue, stuff->backRed, stuff->backGreen, stuff->backBlue); - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (pCursor && AddResource(stuff->cid, RT_CURSOR, (void *)pCursor)) return (client->noClientException); return BadAlloc; } @@ -3167,7 +3167,7 @@ ProcCreateGlyphCursor (register ClientPtr client) &pCursor, client); if (res != Success) return res; - if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (AddResource(stuff->cid, RT_CURSOR, (void *)pCursor)) return client->noClientException; return BadAlloc; } @@ -3311,10 +3311,10 @@ ProcChangeHosts(register ClientPtr client) if(stuff->mode == HostInsert) result = AddHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); + stuff->hostLength, (void *)&stuff[1]); else if (stuff->mode == HostDelete) result = RemoveHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); + stuff->hostLength, (void *)&stuff[1]); else { client->errorValue = stuff->mode; @@ -3330,7 +3330,7 @@ ProcListHosts(register ClientPtr client) { xListHostsReply reply; int len, nHosts, result; - pointer pdata; + void * pdata; /* REQUEST(xListHostsReq); */ REQUEST_SIZE_MATCH(xListHostsReq); @@ -3582,7 +3582,7 @@ CloseDownClient(register ClientPtr client) clientinfo.client = client; clientinfo.prefix = (xConnSetupPrefix *)NULL; clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); + CallCallbacks((&ClientStateCallback), (void *)&clientinfo); } } client->clientGone = TRUE; /* so events aren't sent to client */ @@ -3619,7 +3619,7 @@ CloseDownClient(register ClientPtr client) clientinfo.client = client; clientinfo.prefix = (xConnSetupPrefix *)NULL; clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); + CallCallbacks((&ClientStateCallback), (void *)&clientinfo); } FreeClientResources(client); if (client->index < nextFreeClientID) @@ -3669,7 +3669,7 @@ CloseDownRetainedResources() } } -void InitClient(ClientPtr client, int i, pointer ospriv) +void InitClient(ClientPtr client, int i, void * ospriv) { client->index = i; client->sequence = 0; @@ -3759,11 +3759,11 @@ InitClientPrivates(ClientPtr client) { if ( (size = *sizes) ) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } return 1; } @@ -3775,7 +3775,7 @@ InitClientPrivates(ClientPtr client) * Returns NULL if there are no free clients. *************************/ -ClientPtr NextAvailableClient(pointer ospriv) +ClientPtr NextAvailableClient(void * ospriv) { register int i; register ClientPtr client; @@ -3813,7 +3813,7 @@ ClientPtr NextAvailableClient(pointer ospriv) clientinfo.client = client; clientinfo.prefix = (xConnSetupPrefix *)NULL; clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); + CallCallbacks((&ClientStateCallback), (void *)&clientinfo); } return(client); } @@ -3948,7 +3948,7 @@ SendConnSetup(register ClientPtr client, char *reason) clientinfo.client = client; clientinfo.prefix = lconnSetupPrefix; clientinfo.setup = (xConnSetup *)lConnectionInfo; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); + CallCallbacks((&ClientStateCallback), (void *)&clientinfo); } return (client->noClientException); } diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index c7f00ce47..156bba2d0 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -144,7 +144,7 @@ _NXGetFontPathError: #define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics -extern pointer fosNaturalParams; +extern void * fosNaturalParams; extern FontPtr defaultFont; static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; @@ -258,7 +258,7 @@ RemoveFontWakeup(FontPathElementPtr fpe) } void -FontWakeup(pointer data, int count, pointer LastSelectMask) +FontWakeup(void * data, int count, void * LastSelectMask) { int i; FontPathElementPtr fpe; @@ -338,7 +338,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -346,7 +346,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) while (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; err = (*fpe_functions[fpe->type].open_font) - ((pointer) client, fpe, c->flags, + ((void *) client, fpe, c->flags, c->fontname, c->fnamelen, FontFormat, BitmapFormatMaskByte | BitmapFormatMaskBit | @@ -380,7 +380,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (err == Suspended) { if (!c->slept) { c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (pointer) c); + ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (void *) c); } return TRUE; } @@ -418,7 +418,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) } } } - if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) { + if (!AddResource(c->fontid, RT_FONT, (void *) pfont)) { err = AllocError; goto bail; } @@ -481,7 +481,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna cached = FindCachedFontPattern(patternCache, pfontname, lenfname); if (cached && cached->info.cachable) { - if (!AddResource(fid, RT_FONT, (pointer) cached)) + if (!AddResource(fid, RT_FONT, (void *) cached)) return BadAlloc; cached->refcnt++; return Success; @@ -532,7 +532,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna * \param value must conform to DeleteType */ int -CloseFont(pointer value, XID fid) +CloseFont(void * value, XID fid) { int nscr; ScreenPtr pscr; @@ -660,7 +660,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -678,7 +678,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) /* This FPE doesn't support/require list_fonts_and_aliases */ err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, + ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, c->names); @@ -687,7 +687,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) c->slept = TRUE; ClientSleep(client, (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); + (void *) c); } return TRUE; } @@ -707,14 +707,14 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (!c->current.list_started) { err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, + ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, &c->current.private); if (err == Suspended) { if (!c->slept) { ClientSleep(client, (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); + (void *) c); c->slept = TRUE; } return TRUE; @@ -726,13 +726,13 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) char *tmpname; name = 0; err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, + ((void *) c->client, fpe, &name, &namelen, &tmpname, &resolvedlen, c->current.private); if (err == Suspended) { if (!c->slept) { ClientSleep(client, (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); + (void *) c); c->slept = TRUE; } return TRUE; @@ -780,7 +780,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) tmpname = 0; (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, + ((void *) c->client, fpe, &tmpname, &tmpnamelen, &tmpname, &tmpnamelen, c->current.private); if (--aliascount <= 0) { @@ -968,7 +968,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -1237,7 +1237,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); if (c->slept) { @@ -1265,7 +1265,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) the FPE code to clean up after client and avoid further rendering while we clean up after ourself. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); c->pDraw = (DrawablePtr)0; } @@ -1429,7 +1429,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) c->slept = TRUE; ClientSleep(client, (ClientSleepProcPtr)doPolyText, - (pointer) c); + (void *) c); /* Set up to perform steps 3 and 4 */ client_state = START_SLEEP; @@ -1535,7 +1535,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1549,7 +1549,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1616,7 +1616,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) ValidateGC(c->pDraw, c->pGC); c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doImageText, (pointer) c); + ClientSleep(client, (ClientSleepProcPtr)doImageText, (void *) c); } return TRUE; } @@ -1966,7 +1966,7 @@ DeleteClientFontStuff(ClientPtr client) { fpe = font_path_elements[i]; if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } } @@ -2106,7 +2106,7 @@ GetNewFontClientID() int StoreFontClientFont(FontPtr pfont, Font id) { - return AddResource(id, RT_NONE, (pointer) pfont); + return AddResource(id, RT_NONE, (void *) pfont); } void @@ -2139,7 +2139,7 @@ init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) #endif if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (pointer) 0)) + FontWakeup, (void *) 0)) return AllocError; fs_handlers_installed++; } @@ -2159,7 +2159,7 @@ remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, Bo #endif RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (pointer) 0); + (void *) 0); } } RemoveFontWakeup(fpe); @@ -2190,7 +2190,7 @@ dump_char_ascii(CharInfoPtr cip) bpr = GLYPH_SIZE(cip, 4); for (r = 0; r < (cip->metrics.ascent + cip->metrics.descent); r++) { - pointer row = (pointer) cip->bits + r * bpr; + void * row = (void *) cip->bits + r * bpr; byte = 0; for (l = 0; l <= (cip->metrics.rightSideBearing - diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index e7d4ccd4d..f3b3373d0 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -236,23 +236,23 @@ SecurityLookupWindow(XID rid, ClientPtr client, Mask access_mode) } -pointer +void * SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode) { register DrawablePtr pDraw; if(rid == INVALID) - return (pointer) NULL; + return (void *) NULL; if (client->trustLevel != XSecurityClientTrusted) return (DrawablePtr)SecurityLookupIDByClass(client, rid, RC_DRAWABLE, access_mode); if (client->lastDrawableID == rid) - return ((pointer) client->lastDrawable); + return ((void *) client->lastDrawable); pDraw = (DrawablePtr)SecurityLookupIDByClass(client, rid, RC_DRAWABLE, access_mode); if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW)) - return (pointer)pDraw; - return (pointer)NULL; + return (void *)pDraw; + return (void *)NULL; } /* We can't replace the LookupWindow and LookupDrawable functions with @@ -265,7 +265,7 @@ LookupWindow(XID rid, ClientPtr client) return SecurityLookupWindow(rid, client, SecurityUnknownAccess); } -pointer +void * LookupDrawable(XID rid, ClientPtr client) { return SecurityLookupDrawable(rid, client, SecurityUnknownAccess); @@ -298,19 +298,19 @@ LookupWindow(XID rid, ClientPtr client) } -pointer +void * LookupDrawable(XID rid, ClientPtr client) { register DrawablePtr pDraw; if(rid == INVALID) - return (pointer) NULL; + return (void *) NULL; if (client->lastDrawableID == rid) - return ((pointer) client->lastDrawable); + return ((void *) client->lastDrawable); pDraw = (DrawablePtr)LookupIDByClass(rid, RC_DRAWABLE); if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW)) - return (pointer)pDraw; - return (pointer)NULL; + return (void *)pDraw; + return (void *)NULL; } #endif /* XCSECURITY */ @@ -318,7 +318,7 @@ LookupDrawable(XID rid, ClientPtr client) ClientPtr LookupClient(XID rid, ClientPtr client) { - pointer pRes = (pointer)SecurityLookupIDByClass(client, rid, RC_ANY, + void * pRes = (void *)SecurityLookupIDByClass(client, rid, RC_ANY, SecurityReadAccess); int clientIndex = CLIENT_ID(rid); @@ -343,7 +343,7 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, if (numnow) { pTmp = client->saveSet; - while ((j < numnow) && (SaveSetWindow(pTmp[j]) != (pointer)pWin)) + while ((j < numnow) && (SaveSetWindow(pTmp[j]) != (void *)pWin)) j++; } if (mode == SetModeInsert) @@ -413,7 +413,7 @@ NoopDDA(void) typedef struct _BlockHandler { BlockHandlerProcPtr BlockHandler; WakeupHandlerProcPtr WakeupHandler; - pointer blockData; + void * blockData; Bool deleted; } BlockHandlerRec, *BlockHandlerPtr; @@ -429,7 +429,7 @@ static Bool handlerDeleted; * \param pReadMask nor how it represents the det of descriptors */ void -BlockHandler(pointer pTimeout, pointer pReadmask) +BlockHandler(void * pTimeout, void * pReadmask) { register int i, j; @@ -463,7 +463,7 @@ BlockHandler(pointer pTimeout, pointer pReadmask) * \param pReadmask the resulting descriptor mask */ void -WakeupHandler(int result, pointer pReadmask) +WakeupHandler(int result, void * pReadmask) { register int i, j; @@ -498,7 +498,7 @@ WakeupHandler(int result, pointer pReadmask) Bool RegisterBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler, WakeupHandlerProcPtr wakeupHandler, - pointer blockData) + void * blockData) { BlockHandlerPtr new; @@ -522,7 +522,7 @@ RegisterBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler, void RemoveBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler, WakeupHandlerProcPtr wakeupHandler, - pointer blockData) + void * blockData) { int i; @@ -616,8 +616,8 @@ ProcessWorkQueueZombies(void) Bool QueueWorkProc ( - Bool (*function)(ClientPtr /* pClient */, pointer /* closure */), - ClientPtr client, pointer closure) + Bool (*function)(ClientPtr /* pClient */, void * /* closure */), + ClientPtr client, void * closure) { WorkQueuePtr q; @@ -645,13 +645,13 @@ typedef struct _SleepQueue { struct _SleepQueue *next; ClientPtr client; ClientSleepProcPtr function; - pointer closure; + void * closure; } SleepQueueRec, *SleepQueuePtr; static SleepQueuePtr sleepQueue = NULL; Bool -ClientSleep (ClientPtr client, ClientSleepProcPtr function, pointer closure) +ClientSleep (ClientPtr client, ClientSleepProcPtr function, void * closure) { SleepQueuePtr q; @@ -731,7 +731,7 @@ static Bool _AddCallback( CallbackListPtr *pcbl, CallbackProcPtr callback, - pointer data) + void *data) { CallbackPtr cbr; @@ -750,7 +750,7 @@ static Bool _DeleteCallback( CallbackListPtr *pcbl, CallbackProcPtr callback, - pointer data) + void *data) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; @@ -785,7 +785,7 @@ _DeleteCallback( static void _CallCallbacks( CallbackListPtr *pcbl, - pointer call_data) + void *call_data) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; @@ -914,7 +914,7 @@ CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs) } Bool -AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) +AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void * data) { if (!pcbl) return FALSE; if (!*pcbl) @@ -926,14 +926,14 @@ AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) } Bool -DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) +DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void * data) { if (!pcbl || !*pcbl) return FALSE; return ((*(*pcbl)->funcs.DeleteCallback) (pcbl, callback, data)); } void -CallCallbacks(CallbackListPtr *pcbl, pointer call_data) +CallCallbacks(CallbackListPtr *pcbl, void * call_data) { if (!pcbl || !*pcbl) return; (*(*pcbl)->funcs.CallCallbacks) (pcbl, call_data); diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index 9d1ebe7d0..ab995a772 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -1079,7 +1079,7 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; eventinfo.events = xE; eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); + CallCallbacks(&DeviceEventCallback, (void *)&eventinfo); } if (xE->u.u.type == MotionNotify) { @@ -2587,7 +2587,7 @@ CheckPassiveGrabsOnWindow( a passive grab to be activated. If the event is a keyboard event, the ancestors of the focus window are traced down and tried to see if they have any passive grabs to be activated. If the focus window itself is reached and -it's descendants contain they pointer, the ancestors of the window that the +its descendants contain the pointer, the ancestors of the window that the pointer is in are then traced down starting at the focus window, otherwise no grabs are activated. If the event is a pointer event, the ancestors of the window that the pointer is in are traced down starting at the root until @@ -2812,7 +2812,7 @@ drawable.id:0; DeviceEventInfoRec eventinfo; eventinfo.events = xE; eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); + CallCallbacks(&DeviceEventCallback, (void *)&eventinfo); } } #ifdef XEVIE @@ -2998,7 +2998,7 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; eventinfo.events = xE; eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); + CallCallbacks(&DeviceEventCallback, (void *)&eventinfo); } } if (xE->u.u.type != MotionNotify) @@ -3111,7 +3111,7 @@ RecalculateDeliverableEvents(pWin) * \param value must conform to DeleteType */ int -OtherClientGone(pointer value, XID id) +OtherClientGone(void * value, XID id) { register OtherClientsPtr other, prev; register WindowPtr pWin = (WindowPtr)value; @@ -3206,7 +3206,7 @@ EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask ma others->resource = FakeClientID(client->index); others->next = pWin->optional->otherClients; pWin->optional->otherClients = others; - if (!AddResource(others->resource, RT_OTHERCLIENT, (pointer)pWin)) + if (!AddResource(others->resource, RT_OTHERCLIENT, (void *)pWin)) return BadAlloc; } maskSet: @@ -4653,7 +4653,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) eventinfo.client = pClient; eventinfo.events = events; eventinfo.count = count; - CallCallbacks(&EventCallback, (pointer)&eventinfo); + CallCallbacks(&EventCallback, (void *)&eventinfo); } if(pClient->swapped) { diff --git a/nx-X11/programs/Xserver/dix/gc.c b/nx-X11/programs/Xserver/dix/gc.c index cb21e09fd..834919946 100644 --- a/nx-X11/programs/Xserver/dix/gc.c +++ b/nx-X11/programs/Xserver/dix/gc.c @@ -442,7 +442,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC if(error == Success) { (*pGC->funcs->ChangeClip)(pGC, clipType, - (pointer)pPixmap, 0); + (void *)pPixmap, 0); } break; } @@ -534,7 +534,7 @@ ChangeGC(register GC *pGC, register BITS32 mask, XID *pval) pval contains an appropriate value for each mask. fPointer is true if the values for tiles, stipples, fonts or clipmasks are pointers instead of IDs. Note: if you are passing pointers you - MUST declare the array of values as type pointer! Other data types + MUST declare the array of values as type void*! Other data types may not be large enough to hold pointers on some machines. Yes, this means you have to cast to (XID *) when you pass the array to DoChangeGC. Similarly, if you are not passing pointers (fPointer = 0) you @@ -591,11 +591,11 @@ AllocateGC(ScreenPtr pScreen) { if ( (size = *sizes) ) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } } return pGC; @@ -651,7 +651,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus) pGC->clipOrg.x = 0; pGC->clipOrg.y = 0; pGC->clientClipType = CT_NONE; - pGC->clientClip = (pointer)NULL; + pGC->clientClip = (void *)NULL; pGC->numInDashList = 2; pGC->dash = DefaultDash; pGC->dashOffset = 0; @@ -890,7 +890,7 @@ CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask) * \param value must conform to DeleteType */ int -FreeGC(pointer value, XID gid) +FreeGC(void * value, XID gid) { GCPtr pGC = (GCPtr)value; @@ -1208,7 +1208,7 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects, if (size) memmove((char *)prectsNew, (char *)prects, size); - (*pGC->funcs->ChangeClip)(pGC, newct, (pointer)prectsNew, nrects); + (*pGC->funcs->ChangeClip)(pGC, newct, (void *)prectsNew, nrects); if (pGC->funcs->ChangeGC) (*pGC->funcs->ChangeGC) (pGC, GCClipXOrigin|GCClipYOrigin|GCClipMask); return Success; diff --git a/nx-X11/programs/Xserver/dix/glyphcurs.c b/nx-X11/programs/Xserver/dix/glyphcurs.c index 8f8adf5ce..726297d96 100644 --- a/nx-X11/programs/Xserver/dix/glyphcurs.c +++ b/nx-X11/programs/Xserver/dix/glyphcurs.c @@ -119,7 +119,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns /* fill the pixmap with 0 */ gcval[0].val = GXcopy; gcval[1].val = 0; - gcval[2].ptr = (pointer)pfont; + gcval[2].ptr = (void *)pfont; dixChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont, NULL, gcval); ValidateGC((DrawablePtr)ppix, pGC); diff --git a/nx-X11/programs/Xserver/dix/grabs.c b/nx-X11/programs/Xserver/dix/grabs.c index 1d76f7f07..e133c0dfc 100644 --- a/nx-X11/programs/Xserver/dix/grabs.c +++ b/nx-X11/programs/Xserver/dix/grabs.c @@ -128,7 +128,7 @@ FreeGrab(GrabPtr pGrab) } int -DeletePassiveGrab(pointer value, XID id) +DeletePassiveGrab(void * value, XID id) { register GrabPtr g, prev; GrabPtr pGrab = (GrabPtr)value; @@ -295,7 +295,7 @@ AddPassiveGrabToList(GrabPtr pGrab) } pGrab->next = pGrab->window->optional->passiveGrabs; pGrab->window->optional->passiveGrabs = pGrab; - if (AddResource(pGrab->resource, RT_PASSIVEGRAB, (pointer)pGrab)) + if (AddResource(pGrab->resource, RT_PASSIVEGRAB, (void *)pGrab)) return Success; return BadAlloc; } @@ -389,7 +389,7 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab) ok = FALSE; } else if (!AddResource(pNewGrab->resource, RT_PASSIVEGRAB, - (pointer)pNewGrab)) + (void *)pNewGrab)) ok = FALSE; else adds[nadds++] = pNewGrab; diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c index b7452c5c2..954c260c2 100644 --- a/nx-X11/programs/Xserver/dix/main.c +++ b/nx-X11/programs/Xserver/dix/main.c @@ -319,7 +319,7 @@ main(int argc, char *argv[], char *envp[]) serverClient = (ClientPtr)xalloc(sizeof(ClientRec)); if (!serverClient) FatalError("couldn't create server client"); - InitClient(serverClient, 0, (pointer)NULL); + InitClient(serverClient, 0, (void *)NULL); } else ResetWellKnownSockets (); diff --git a/nx-X11/programs/Xserver/dix/pixmap.c b/nx-X11/programs/Xserver/dix/pixmap.c index 4be7d03ce..7888cf90a 100644 --- a/nx-X11/programs/Xserver/dix/pixmap.c +++ b/nx-X11/programs/Xserver/dix/pixmap.c @@ -53,7 +53,7 @@ from The Open Group. /* callable by ddx */ PixmapPtr GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) + int bitsPerPixel, int devKind, void * pPixData) { PixmapPtr pPixmap = pScreen->pScratchPixmap; @@ -139,11 +139,11 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) { if ((size = *sizes) != 0) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } #else pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize); diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index 72c8c70ef..f462a3ebd 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -263,10 +263,10 @@ ProcChangeProperty(ClientPtr client) #ifdef LBX err = LbxChangeWindowProperty(client, pWin, stuff->property, stuff->type, - (int)format, (int)mode, len, TRUE, (pointer)&stuff[1], TRUE, NULL); + (int)format, (int)mode, len, TRUE, (void *)&stuff[1], TRUE, NULL); #else err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, - (int)mode, len, (pointer)&stuff[1], TRUE); + (int)mode, len, (void *)&stuff[1], TRUE); #endif if (err != Success) return err; @@ -276,7 +276,7 @@ ProcChangeProperty(ClientPtr client) int ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long len, pointer value, + int mode, unsigned long len, void * value, Bool sendevent) { #ifdef LBX @@ -288,7 +288,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, xEvent event; int sizeInBytes; int totalSize; - pointer data; + void * data; sizeInBytes = format>>3; totalSize = len * sizeInBytes; @@ -309,7 +309,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, pProp = (PropertyPtr)xalloc(sizeof(PropertyRec)); if (!pProp) return(BadAlloc); - data = (pointer)xalloc(totalSize); + data = (void *)xalloc(totalSize); if (!data && len) { xfree(pProp); @@ -340,7 +340,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, { if (totalSize != pProp->size * (pProp->format >> 3)) { - data = (pointer)xrealloc(pProp->data, totalSize); + data = (void *)xrealloc(pProp->data, totalSize); if (!data && len) return(BadAlloc); pProp->data = data; @@ -357,7 +357,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, } else if (mode == PropModeAppend) { - data = (pointer)xrealloc(pProp->data, + data = (void *)xrealloc(pProp->data, sizeInBytes * (len + pProp->size)); if (!data) return(BadAlloc); @@ -369,7 +369,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, } else if (mode == PropModePrepend) { - data = (pointer)xalloc(sizeInBytes * (len + pProp->size)); + data = (void *)xalloc(sizeInBytes * (len + pProp->size)); if (!data) return(BadAlloc); memmove(&((char *)data)[totalSize], (char *)pProp->data, diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index e12bc7b67..e0fc2b997 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -139,7 +139,7 @@ typedef struct _Resource { struct _Resource *next; XID id; RESTYPE type; - pointer value; + void * value; } ResourceRec, *ResourcePtr; #define NullResource ((ResourcePtr)NULL) @@ -423,7 +423,7 @@ FakeClientID(register int client) } Bool -AddResource(XID id, RESTYPE type, pointer value) +AddResource(XID id, RESTYPE type, void * value) { int client; register ClientResourceRec *rrec; @@ -595,7 +595,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) */ Bool -ChangeResourceValue (XID id, RESTYPE rtype, pointer value) +ChangeResourceValue (XID id, RESTYPE rtype, void * value) { int cid; register ResourcePtr res; @@ -627,7 +627,7 @@ FindClientResourcesByType( ClientPtr client, RESTYPE type, FindResType func, - pointer cdata + void * cdata ){ register ResourcePtr *resources; register ResourcePtr this, next; @@ -658,7 +658,7 @@ void FindAllClientResources( ClientPtr client, FindAllRes func, - pointer cdata + void * cdata ){ register ResourcePtr *resources; register ResourcePtr this, next; @@ -684,12 +684,12 @@ FindAllClientResources( } -pointer +void * LookupClientResourceComplex( ClientPtr client, RESTYPE type, FindComplexResType func, - pointer cdata + void * cdata ){ ResourcePtr *resources; ResourcePtr this; @@ -831,12 +831,12 @@ LegalNewID(XID id, register ClientPtr client) * else NULL is returned. */ -pointer +void * SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) { int cid; register ResourcePtr res; - pointer retval = NULL; + void * retval = NULL; assert(client == NullClient || (client->index <= currentMaxClients && clients[client->index] == client)); @@ -860,12 +860,12 @@ SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) } -pointer +void * SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) { int cid; register ResourcePtr res = NULL; - pointer retval = NULL; + void * retval = NULL; assert(client == NullClient || (client->index <= currentMaxClients && clients[client->index] == client)); @@ -892,14 +892,14 @@ SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) * macros because of compatibility with loadable servers. */ -pointer +void * LookupIDByType(XID id, RESTYPE rtype) { return SecurityLookupIDByType(NullClient, id, rtype, SecurityUnknownAccess); } -pointer +void * LookupIDByClass(XID id, RESTYPE classes) { return SecurityLookupIDByClass(NullClient, id, classes, @@ -911,7 +911,7 @@ LookupIDByClass(XID id, RESTYPE classes) /* * LookupIDByType returns the object with the given id and type, else NULL. */ -pointer +void * LookupIDByType(XID id, RESTYPE rtype) { int cid; @@ -926,14 +926,14 @@ LookupIDByType(XID id, RESTYPE rtype) if ((res->id == id) && (res->type == rtype)) return res->value; } - return (pointer)NULL; + return (void *)NULL; } /* * LookupIDByClass returns the object with the given id and any one of the * given classes, else NULL. */ -pointer +void * LookupIDByClass(XID id, RESTYPE classes) { int cid; @@ -948,7 +948,7 @@ LookupIDByClass(XID id, RESTYPE classes) if ((res->id == id) && (res->type & classes)) return res->value; } - return (pointer)NULL; + return (void *)NULL; } #endif /* XCSECURITY */ diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index b65bda0e3..340ca50cc 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -203,7 +203,7 @@ PrintWindowTree() #endif int -TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, pointer data) +TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, void * data) { register int result; register WindowPtr pChild; @@ -238,7 +238,7 @@ TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, pointer data) *****/ int -WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, pointer data) +WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, void * data) { return(TraverseTree(WindowTable[pScreen->myNum], func, data)); } @@ -264,7 +264,7 @@ SetWindowToDefaults(register WindowPtr pWin) pWin->backingStore = NotUseful; pWin->DIXsaveUnder = FALSE; - pWin->backStorage = (pointer) NULL; + pWin->backStorage = (void *) NULL; pWin->mapped = FALSE; /* off */ pWin->realized = FALSE; /* off */ @@ -356,11 +356,11 @@ AllocateWindow(ScreenPtr pScreen) { if ( (size = *sizes) ) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } } return pWin; @@ -454,7 +454,7 @@ CreateRootWindow(ScreenPtr pScreen) pWin->border.pixel = pScreen->blackPixel; pWin->borderWidth = 0; - if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin)) + if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *)pWin)) return FALSE; if (disableBackingStore) @@ -879,7 +879,7 @@ CrushTree(WindowPtr pWin) *****/ int -DeleteWindow(pointer value, XID wid) +DeleteWindow(void * value, XID wid) { register WindowPtr pParent; register WindowPtr pWin = (WindowPtr)value; @@ -2525,7 +2525,7 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) static int CompareWIDs( WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ + void * value) /* must conform to VisitWindowProcPtr */ { Window *wid = (Window *)value; @@ -2550,7 +2550,7 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, register ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; - if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING) + if (TraverseTree(pWin, CompareWIDs, (void *)&pParent->drawable.id) == WT_STOPWALKING) return(BadMatch); if (!MakeWindowOptional(pWin)) return(BadAlloc); @@ -3483,7 +3483,7 @@ TileScreenSaver(int i, int kind) if (cursor) { cursorID = FakeClientID(0); - if (AddResource (cursorID, RT_CURSOR, (pointer) cursor)) + if (AddResource (cursorID, RT_CURSOR, (void *) cursor)) { attributes[attri] = cursorID; mask |= CWCursor; @@ -3514,7 +3514,7 @@ TileScreenSaver(int i, int kind) return FALSE; if (!AddResource(pWin->drawable.id, RT_WINDOW, - (pointer)savedScreenInfo[i].pWindow)) + (void *)savedScreenInfo[i].pWindow)) return FALSE; if (mask & CWBackPixmap) diff --git a/nx-X11/programs/Xserver/fb/fb.h b/nx-X11/programs/Xserver/fb/fb.h index 3ee79d4af..202638d32 100644 --- a/nx-X11/programs/Xserver/fb/fb.h +++ b/nx-X11/programs/Xserver/fb/fb.h @@ -795,7 +795,7 @@ fb24_32ModifyPixmapHeader (PixmapPtr pPixmap, int depth, int bitsPerPixel, int devKind, - pointer pPixData); + void *pPixData); /* * fballpriv.c @@ -1486,7 +1486,7 @@ fbPolyGlyphBlt (DrawablePtr pDrawable, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase); + void *pglyphBase); void fbImageGlyphBlt (DrawablePtr pDrawable, @@ -1495,7 +1495,7 @@ fbImageGlyphBlt (DrawablePtr pDrawable, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase); + void *pglyphBase); /* * fbimage.c @@ -1732,7 +1732,7 @@ _fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap); Bool fbSetupScreen(ScreenPtr pScreen, - pointer pbits, /* pointer to screen bitmap */ + void *pbits, /* pointer to screen bitmap */ int xsize, /* in pixels */ int ysize, int dpix, /* dots per inch */ @@ -1742,7 +1742,7 @@ fbSetupScreen(ScreenPtr pScreen, Bool fbFinishScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, @@ -1752,7 +1752,7 @@ fbFinishScreenInit(ScreenPtr pScreen, Bool fbScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, diff --git a/nx-X11/programs/Xserver/fb/fb24_32.c b/nx-X11/programs/Xserver/fb/fb24_32.c index 214e2e6dd..68e0ef84d 100644 --- a/nx-X11/programs/Xserver/fb/fb24_32.c +++ b/nx-X11/programs/Xserver/fb/fb24_32.c @@ -571,7 +571,7 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel) } typedef struct { - pointer pbits; + void * pbits; int width; } miScreenInitParmsRec, *miScreenInitParmsPtr; @@ -603,7 +603,7 @@ fb24_32ModifyPixmapHeader (PixmapPtr pPixmap, int depth, int bitsPerPixel, int devKind, - pointer pPixData) + void *pPixData) { int bpp, w; diff --git a/nx-X11/programs/Xserver/fb/fb24_32.h b/nx-X11/programs/Xserver/fb/fb24_32.h index 3c83f3423..023042025 100644 --- a/nx-X11/programs/Xserver/fb/fb24_32.h +++ b/nx-X11/programs/Xserver/fb/fb24_32.h @@ -32,7 +32,7 @@ Bool fb24_32FinishScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, @@ -42,7 +42,7 @@ fb24_32FinishScreenInit(ScreenPtr pScreen, Bool fb24_32ScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, diff --git a/nx-X11/programs/Xserver/fb/fballpriv.c b/nx-X11/programs/Xserver/fb/fballpriv.c index 75b577049..c1cd834f1 100644 --- a/nx-X11/programs/Xserver/fb/fballpriv.c +++ b/nx-X11/programs/Xserver/fb/fballpriv.c @@ -86,7 +86,7 @@ fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex) pScreenPriv = (FbScreenPrivPtr) xalloc (sizeof (FbScreenPrivRec)); if (!pScreenPriv) return FALSE; - pScreen->devPrivates[fbScreenPrivateIndex].ptr = (pointer) pScreenPriv; + pScreen->devPrivates[fbScreenPrivateIndex].ptr = (void *) pScreenPriv; } #endif return TRUE; diff --git a/nx-X11/programs/Xserver/fb/fbglyph.c b/nx-X11/programs/Xserver/fb/fbglyph.c index 46334db50..bb0dda669 100644 --- a/nx-X11/programs/Xserver/fb/fbglyph.c +++ b/nx-X11/programs/Xserver/fb/fbglyph.c @@ -262,7 +262,7 @@ fbPolyGlyphBlt (DrawablePtr pDrawable, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase) + void * pglyphBase) { FbGCPrivPtr pPriv = fbGetGCPrivate (pGC); CharInfoPtr pci; @@ -350,7 +350,7 @@ fbImageGlyphBlt (DrawablePtr pDrawable, int y, unsigned int nglyph, CharInfoPtr *ppciInit, - pointer pglyphBase) + void * pglyphBase) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); CharInfoPtr *ppci; diff --git a/nx-X11/programs/Xserver/fb/fboverlay.c b/nx-X11/programs/Xserver/fb/fboverlay.c index 87524e27e..81c54316f 100644 --- a/nx-X11/programs/Xserver/fb/fboverlay.c +++ b/nx-X11/programs/Xserver/fb/fboverlay.c @@ -64,7 +64,7 @@ fbOverlayCreateWindow(WindowPtr pWin) pPixmap = pScrPriv->layer[i].u.run.pixmap; if (pWin->drawable.depth == pPixmap->drawable.depth) { - pWin->devPrivates[fbWinPrivateIndex].ptr = (pointer) pPixmap; + pWin->devPrivates[fbWinPrivateIndex].ptr = (void *) pPixmap; /* * Make sure layer keys are written correctly by * having non-root layers set to full while the @@ -108,7 +108,7 @@ fbOverlayWindowLayer(WindowPtr pWin) for (i = 0; i < pScrPriv->nlayers; i++) if (pWin->devPrivates[fbWinPrivateIndex].ptr == - (pointer) pScrPriv->layer[i].u.run.pixmap) + (void *) pScrPriv->layer[i].u.run.pixmap) return i; return 0; } @@ -119,7 +119,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen) int i; FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); PixmapPtr pPixmap; - pointer pbits; + void * pbits; int width; int depth; BoxRec box; @@ -289,8 +289,8 @@ fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) Bool fbOverlaySetupScreen(ScreenPtr pScreen, - pointer pbits1, - pointer pbits2, + void * pbits1, + void * pbits2, int xsize, int ysize, int dpix, @@ -336,8 +336,8 @@ fb24_32OverlayCreateScreenResources(ScreenPtr pScreen) Bool fbOverlayFinishScreenInit(ScreenPtr pScreen, - pointer pbits1, - pointer pbits2, + void * pbits1, + void * pbits2, int xsize, int ysize, int dpix, @@ -436,7 +436,7 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, pScrPriv->layer[1].u.init.width = width2; pScrPriv->layer[1].u.init.depth = depth2; - pScreen->devPrivates[fbOverlayScreenPrivateIndex].ptr = (pointer) pScrPriv; + pScreen->devPrivates[fbOverlayScreenPrivateIndex].ptr = (void *) pScrPriv; /* overwrite miCloseScreen with our own */ pScreen->CloseScreen = fbOverlayCloseScreen; diff --git a/nx-X11/programs/Xserver/fb/fboverlay.h b/nx-X11/programs/Xserver/fb/fboverlay.h index e6a4e033f..d1469f22a 100644 --- a/nx-X11/programs/Xserver/fb/fboverlay.h +++ b/nx-X11/programs/Xserver/fb/fboverlay.h @@ -39,7 +39,7 @@ typedef void (*fbOverlayPaintKeyProc) (DrawablePtr, RegionPtr, CARD32, int); typedef struct _fbOverlayLayer { union { struct { - pointer pbits; + void * pbits; int width; int depth; } init; @@ -100,8 +100,8 @@ fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); Bool fbOverlaySetupScreen(ScreenPtr pScreen, - pointer pbits1, - pointer pbits2, + void * pbits1, + void * pbits2, int xsize, int ysize, int dpix, @@ -113,8 +113,8 @@ fbOverlaySetupScreen(ScreenPtr pScreen, Bool fbOverlayFinishScreenInit(ScreenPtr pScreen, - pointer pbits1, - pointer pbits2, + void * pbits1, + void * pbits2, int xsize, int ysize, int dpix, diff --git a/nx-X11/programs/Xserver/fb/fbpixmap.c b/nx-X11/programs/Xserver/fb/fbpixmap.c index decc07ba6..7ea288cb1 100644 --- a/nx-X11/programs/Xserver/fb/fbpixmap.c +++ b/nx-X11/programs/Xserver/fb/fbpixmap.c @@ -73,7 +73,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp) pPixmap->drawable.height = height; pPixmap->devKind = paddedWidth; pPixmap->refcnt = 1; - pPixmap->devPrivate.ptr = (pointer) ((char *)pPixmap + base + adjust); + pPixmap->devPrivate.ptr = (void *) ((char *)pPixmap + base + adjust); #ifdef FB_DEBUG pPixmap->devPrivate.ptr = (void *) ((char *) pPixmap->devPrivate.ptr + paddedWidth); fbInitializeDrawable (&pPixmap->drawable); diff --git a/nx-X11/programs/Xserver/fb/fbpseudocolor.c b/nx-X11/programs/Xserver/fb/fbpseudocolor.c index ef40b7073..83d556a0e 100644 --- a/nx-X11/programs/Xserver/fb/fbpseudocolor.c +++ b/nx-X11/programs/Xserver/fb/fbpseudocolor.c @@ -20,7 +20,7 @@ static void xxValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); static void xxDestroyGC(GCPtr pGC); static void xxChangeGC (GCPtr pGC, unsigned long mask); static void xxCopyGC (GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); -static void xxChangeClip (GCPtr pGC, int type, pointer pvalue, int nrects); +static void xxChangeClip (GCPtr pGC, int type, void * pvalue, int nrects); static void xxCopyClip(GCPtr pgcDst, GCPtr pgcSrc); static void xxDestroyClip(GCPtr pGC); @@ -63,10 +63,10 @@ static void xxImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars); static void xxImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase); + void * pglyphBase); static void xxPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase); + void * pglyphBase); static void xxPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg); static void @@ -108,7 +108,7 @@ typedef struct { #endif PixmapPtr pPixmap; char * addr; - pointer pBits; + void *pBits; RegionRec region; VisualPtr bVisual; RegionRec bRegion; @@ -200,7 +200,7 @@ xxUpdateWindowImmediately(WindowPtr pWin) pmap = (ColormapPtr)LookupIDByType(wColormap(pWin),RT_COLORMAP); - if (pmap && (pCmapPriv = xxGetCmapPriv(pmap)) != (pointer)-1) { + if (pmap && (pCmapPriv = xxGetCmapPriv(pmap)) != (void *)-1) { xxCopyPseudocolorRegion(pWin->drawable.pScreen, &pScrPriv->region, pCmapPriv); } @@ -259,7 +259,7 @@ xxCreateScreenResources(ScreenPtr pScreen) PixmapPtr pPixmap; BoxRec box; int depth = pScrPriv->myDepth; - pointer pBits; + void *pBits; unwrap (pScrPriv,pScreen, CreateScreenResources); ret = pScreen->CreateScreenResources(pScreen); @@ -364,16 +364,16 @@ xxInitColormapPrivate(ColormapPtr pmap) { xxScrPriv(pmap->pScreen); xxCmapPrivPtr pCmapPriv; - pointer cmap; + void *cmap; - pmap->devPrivates[xxColormapPrivateIndex].ptr = (pointer) -1; + pmap->devPrivates[xxColormapPrivateIndex].ptr = (void *) -1; if (xxMyVisual(pmap->pScreen,pmap->pVisual->vid)) { DBG("CreateColormap\n"); pCmapPriv = (xxCmapPrivPtr) xalloc (sizeof (xxCmapPrivRec)); if (!pCmapPriv) return FALSE; - pmap->devPrivates[xxColormapPrivateIndex].ptr = (pointer) pCmapPriv; + pmap->devPrivates[xxColormapPrivateIndex].ptr = (void *) pCmapPriv; cmap = xalloc(sizeof (CARD32) * (1 << pScrPriv->myDepth)); if (!cmap) return FALSE; @@ -437,7 +437,7 @@ xxDestroyColormap(ColormapPtr pmap) xxScrPriv(pmap->pScreen); xxCmapPriv(pmap); - if (pCmapPriv != (pointer) -1) { + if (pCmapPriv != (void *) -1) { xxCmapPrivPtr tmpCmapPriv = pScrPriv->Cmaps; xxCmapPrivPtr *prevCmapPriv = &pScrPriv->Cmaps; int n; @@ -489,7 +489,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors) xxScrPriv(pmap->pScreen); xxCmapPriv(pmap); - if (pCmapPriv != (pointer) -1) { + if (pCmapPriv != (void *) -1) { xColorItem *expanddefs; int i; @@ -547,7 +547,7 @@ xxInstallColormap(ColormapPtr pmap) xxScrPriv(pmap->pScreen); xxCmapPriv(pmap); - if (pCmapPriv != (pointer) -1) { + if (pCmapPriv != (void *) -1) { Pixel *pixels; xrgb *colors; int i; @@ -619,7 +619,7 @@ xxUninstallColormap(ColormapPtr pmap) xxScrPriv(pmap->pScreen); xxCmapPriv(pmap); - if (pCmapPriv != (pointer) -1) { + if (pCmapPriv != (void *) -1) { int num; if ((num = xxCmapInstalled(pmap)) == -1) @@ -675,7 +675,7 @@ xxCreateWindow(WindowPtr pWin) DBG("CreateWindow\n"); - pWin->devPrivates[fbWinPrivateIndex].ptr = (pointer) pScrPriv->pPixmap; + pWin->devPrivates[fbWinPrivateIndex].ptr = (void *) pScrPriv->pPixmap; PRINT_RECTS(pScrPriv->region); if (!pWin->parent) { REGION_EMPTY (pWin->drawable.pScreen, &pScrPriv->region); @@ -962,15 +962,15 @@ xxGetWindowRegion(WindowPtr pWin,RegionPtr winreg) } static int -xxUpdateRegion(WindowPtr pWin, pointer unused) +xxUpdateRegion(WindowPtr pWin, void * unused) { ScreenPtr pScreen = pWin->drawable.pScreen; xxScrPriv(pScreen); - ColormapPtr pmap = (pointer) -1; + ColormapPtr pmap = (void *) -1; RegionRec winreg, rgni; if (pScrPriv->myDepth == pWin->drawable.depth) { - xxCmapPrivPtr pCmapPriv = (pointer)-1; + xxCmapPrivPtr pCmapPriv = (void *)-1; xxGetWindowRegion(pWin,&winreg); if (pScrPriv->colormapDirty) { @@ -980,7 +980,7 @@ xxUpdateRegion(WindowPtr pWin, pointer unused) goto CONTINUE; /* return ? */ pCmapPriv = xxGetCmapPriv(pmap); - if (pCmapPriv == (pointer) -1) + if (pCmapPriv == (void *) -1) return WT_WALKCHILDREN; if (!pCmapPriv->dirty) goto CONTINUE; @@ -997,7 +997,7 @@ xxUpdateRegion(WindowPtr pWin, pointer unused) REGION_INTERSECT (pScreen, &rgni, &winreg, &pScrPriv->region); if (REGION_NOTEMPTY (pScreen,&rgni)) { - if (pmap == (pointer) -1) { + if (pmap == (void *) -1) { pmap = (ColormapPtr)LookupIDByType(wColormap(pWin),RT_COLORMAP); if (!pmap) /* return ? */ @@ -1006,7 +1006,7 @@ xxUpdateRegion(WindowPtr pWin, pointer unused) pCmapPriv = xxGetCmapPriv(pmap); } - if (pCmapPriv != (pointer)-1) + if (pCmapPriv != (void *)-1) xxCopyPseudocolorRegion(pScreen,&rgni, pCmapPriv); REGION_SUBTRACT(pScreen, &pScrPriv->region, &pScrPriv->region, &rgni); @@ -1034,13 +1034,13 @@ xxUpdateFb(ScreenPtr pScreen) WalkTree(pScreen,xxUpdateRegion,NULL); #if 0 if (REGION_NOTEMPTY (pScreen,&pScrPriv->region)) { - ColormapPtr pmap = (pointer) -1; + ColormapPtr pmap = (void *) -1; xxCmapPrivPtr pCmapPriv; pmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, RT_COLORMAP); pCmapPriv = xxGetCmapPriv(pmap); - if (pCmapPriv != (pointer)-1) + if (pCmapPriv != (void *)-1) xxCopyPseudocolorRegion(pScreen,&pScrPriv->region, pCmapPriv); REGION_SUBTRACT(pScreen, &pScrPriv->region, &pScrPriv->region, &pScrPriv->region); @@ -1064,9 +1064,9 @@ xxUpdateFb(ScreenPtr pScreen) } static void -xxBlockHandler (pointer data, +xxBlockHandler (void * data, OSTimePtr pTimeout, - pointer pRead) + void * pRead) { ScreenPtr pScreen = (ScreenPtr) data; xxScrPriv(pScreen); @@ -1076,7 +1076,7 @@ xxBlockHandler (pointer data, } static void -xxWakeupHandler (pointer data, int i, pointer LastSelectMask) +xxWakeupHandler (void * data, int i, void * LastSelectMask) { } @@ -1158,7 +1158,7 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy if (!RegisterBlockAndWakeupHandlers (xxBlockHandler, xxWakeupHandler, - (pointer) pScreen)) + (void *) pScreen)) return FALSE; wrap (pScrPriv, pScreen, CloseScreen, xxCloseScreen); @@ -1184,7 +1184,7 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy } #endif pScrPriv->addr = addr; - pScreen->devPrivates[xxScrPrivateIndex].ptr = (pointer) pScrPriv; + pScreen->devPrivates[xxScrPrivateIndex].ptr = (void *) pScrPriv; pDefMap = (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP); if (!xxInitColormapPrivate(pDefMap)) @@ -1341,7 +1341,7 @@ static void xxChangeClip ( GCPtr pGC, int type, - pointer pvalue, + void * pvalue, int nrects ){ XX_GC_FUNC_PROLOGUE (pGC); @@ -2114,7 +2114,7 @@ xxImageGlyphBlt( int x, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase + void * pglyphBase ){ XX_GC_OP_PROLOGUE(pGC, pDraw); (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, nglyph, @@ -2162,7 +2162,7 @@ xxPolyGlyphBlt( int x, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase + void * pglyphBase ){ XX_GC_OP_PROLOGUE(pGC, pDraw); (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, x, y, nglyph, diff --git a/nx-X11/programs/Xserver/fb/fbscreen.c b/nx-X11/programs/Xserver/fb/fbscreen.c index 70d3d7a13..342fd5784 100644 --- a/nx-X11/programs/Xserver/fb/fbscreen.c +++ b/nx-X11/programs/Xserver/fb/fbscreen.c @@ -97,14 +97,14 @@ _fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap) #ifdef FB_NO_WINDOW_PIXMAPS FatalError ("Attempted to set window pixmap without fb support\n"); #else - pWindow->devPrivates[fbWinPrivateIndex].ptr = (pointer) pPixmap; + pWindow->devPrivates[fbWinPrivateIndex].ptr = (void *) pPixmap; #endif } #endif Bool fbSetupScreen(ScreenPtr pScreen, - pointer pbits, /* pointer to screen bitmap */ + void * pbits, /* pointer to screen bitmap */ int xsize, /* in pixels */ int ysize, int dpix, /* dots per inch */ @@ -160,7 +160,7 @@ fbSetupScreen(ScreenPtr pScreen, Bool fbFinishScreenInit(ScreenPtr pScreen, - pointer pbits, + void * pbits, int xsize, int ysize, int dpix, @@ -261,7 +261,7 @@ fbFinishScreenInit(ScreenPtr pScreen, /* dts * (inch/dot) * (25.4 mm / inch) = mm */ Bool fbScreenInit(ScreenPtr pScreen, - pointer pbits, + void * pbits, int xsize, int ysize, int dpix, diff --git a/nx-X11/programs/Xserver/fb/fbwindow.c b/nx-X11/programs/Xserver/fb/fbwindow.c index 0cfefa929..1269902b9 100644 --- a/nx-X11/programs/Xserver/fb/fbwindow.c +++ b/nx-X11/programs/Xserver/fb/fbwindow.c @@ -38,7 +38,7 @@ fbCreateWindow(WindowPtr pWin) { #ifndef FB_NO_WINDOW_PIXMAPS pWin->devPrivates[fbWinPrivateIndex].ptr = - (pointer) fbGetScreenPixmap(pWin->drawable.pScreen); + (void *) fbGetScreenPixmap(pWin->drawable.pScreen); #endif #ifdef FB_SCREEN_PRIVATE if (pWin->drawable.bitsPerPixel == 32) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c index fbe52db9c..3a47e270e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c @@ -77,7 +77,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) pVisual = pCmap->pVisual; ncolors = pVisual->ColormapEntries; - pCmap->devPriv = (pointer)xalloc(sizeof(nxagentPrivColormap)); + pCmap->devPriv = (void *)xalloc(sizeof(nxagentPrivColormap)); if (((visual = nxagentVisual(pVisual))) == NULL) { @@ -174,7 +174,7 @@ void nxagentDestroyColormap(ColormapPtr pCmap) #define SEARCH_PREDICATE \ (nxagentWindow(pWin) != None && wColormap(pWin) == icws->cmapIDs[i]) -static int nxagentCountInstalledColormapWindows(WindowPtr pWin, pointer ptr) +static int nxagentCountInstalledColormapWindows(WindowPtr pWin, void * ptr) { nxagentInstalledColormapWindows *icws = (nxagentInstalledColormapWindows *) ptr; @@ -189,7 +189,7 @@ static int nxagentCountInstalledColormapWindows(WindowPtr pWin, pointer ptr) return WT_WALKCHILDREN; } -static int nxagentGetInstalledColormapWindows(WindowPtr pWin, pointer ptr) +static int nxagentGetInstalledColormapWindows(WindowPtr pWin, void * ptr) { nxagentInstalledColormapWindows *icws = (nxagentInstalledColormapWindows *)ptr; int i; @@ -233,11 +233,11 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) sizeof(Colormap)); icws.numCmapIDs = nxagentListInstalledColormaps(pScreen, icws.cmapIDs); icws.numWindows = 0; - WalkTree(pScreen, nxagentCountInstalledColormapWindows, (pointer)&icws); + WalkTree(pScreen, nxagentCountInstalledColormapWindows, (void *)&icws); if (icws.numWindows) { icws.windows = (Window *)xalloc((icws.numWindows + 1) * sizeof(Window)); icws.index = 0; - WalkTree(pScreen, nxagentGetInstalledColormapWindows, (pointer)&icws); + WalkTree(pScreen, nxagentGetInstalledColormapWindows, (void *)&icws); icws.windows[icws.numWindows] = nxagentDefaultWindows[pScreen->myNum]; numWindows = icws.numWindows + 1; } @@ -388,10 +388,10 @@ void nxagentInstallColormap(ColormapPtr pCmap) /* Uninstall pInstalledMap. Notify all interested parties. */ if(pOldCmap != (ColormapPtr)None) - WalkTree(pCmap->pScreen, TellLostMap, (pointer)&pOldCmap->mid); + WalkTree(pCmap->pScreen, TellLostMap, (void *)&pOldCmap->mid); InstalledMaps[index] = pCmap; - WalkTree(pCmap->pScreen, TellGainedMap, (pointer)&pCmap->mid); + WalkTree(pCmap->pScreen, TellGainedMap, (void *)&pCmap->mid); nxagentSetInstalledColormapWindows(pCmap->pScreen); nxagentDirectInstallColormaps(pCmap->pScreen); @@ -542,7 +542,7 @@ Bool nxagentCreateDefaultColormap(ScreenPtr pScreen) return True; } -static void nxagentReconnectColormap(pointer p0, XID x1, pointer p2) +static void nxagentReconnectColormap(void * p0, XID x1, void * p2) { ColormapPtr pCmap = (ColormapPtr)p0; Bool* pBool = (Bool*)p2; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c index 9d48aa134..c0015a831 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -231,7 +231,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) bg_color.green = pCursor->backGreen; bg_color.blue = pCursor->backBlue; - pCursor->devPriv[pScreen->myNum] = (pointer) xalloc(sizeof(nxagentPrivCursor)); + pCursor->devPriv[pScreen->myNum] = (void *) xalloc(sizeof(nxagentPrivCursor)); nxagentCursorPriv(pCursor, pScreen)->cursor = XCreatePixmapCursor(nxagentDisplay, source, mask, &fg_color, @@ -311,7 +311,7 @@ Bool nxagentSetCursorPosition(ScreenPtr pScreen, int x, int y, } } -void nxagentReconnectCursor(pointer p0, XID x1, pointer p2) +void nxagentReconnectCursor(void * p0, XID x1, void * p2) { Bool* pBool = (Bool*)p2; CursorPtr pCursor = (CursorPtr) p0; @@ -433,7 +433,7 @@ Bool nxagentReconnectAllCursor(void *p0) return r; } -void nxagentDisconnectCursor(pointer p0, XID x1, pointer p2) +void nxagentDisconnectCursor(void * p0, XID x1, void * p2) { Bool* pBool = (Bool *) p2; CursorPtr pCursor = (CursorPtr) p0; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.h b/nx-X11/programs/Xserver/hw/nxagent/Cursor.h index 88dea2686..38f09cd9c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.h @@ -100,8 +100,8 @@ Bool nxagentSetCursorPosition(ScreenPtr pScreen, int x, int y, extern Bool (*nxagentSetCursorPositionW)(ScreenPtr pScreen, int x, int y, Bool generateEvent); -void nxagentDisconnectCursor(pointer p0, XID x1, pointer p2); -void nxagentReconnectCursor(pointer p0, XID x1, pointer p2); +void nxagentDisconnectCursor(void * p0, XID x1, void * p2); +void nxagentReconnectCursor(void * p0, XID x1, void * p2); void nxagentReDisplayCurrentCursor(void); Bool nxagentReconnectAllCursor(void *p0); Bool nxagentDisconnectAllCursor(void); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index f2225996b..34781e816 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -106,7 +106,7 @@ void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2); * Imported from NXresource.c */ -extern int nxagentFindClientResource(int, RESTYPE, pointer); +extern int nxagentFindClientResource(int, RESTYPE, void *); unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel); unsigned long nxagentGetDrawableColor(DrawablePtr pDrawable); @@ -2391,7 +2391,7 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion) } } -int nxagentDestroyCorruptedWindowResource(pointer p, XID id) +int nxagentDestroyCorruptedWindowResource(void * p, XID id) { #ifdef TEST fprintf(stderr, "nxagentDestroyCorruptedWindowResource: Removing corrupted window [%p] from resources.\n", @@ -2403,7 +2403,7 @@ int nxagentDestroyCorruptedWindowResource(pointer p, XID id) return 1; } -int nxagentDestroyCorruptedPixmapResource(pointer p, XID id) +int nxagentDestroyCorruptedPixmapResource(void * p, XID id) { #ifdef TEST fprintf(stderr, "nxagentDestroyCorruptedPixmapResource: Removing corrupted pixmap [%p] from resources.\n", @@ -2415,7 +2415,7 @@ int nxagentDestroyCorruptedPixmapResource(pointer p, XID id) return 1; } -int nxagentDestroyCorruptedBackgroundResource(pointer p, XID id) +int nxagentDestroyCorruptedBackgroundResource(void * p, XID id) { #ifdef TEST fprintf(stderr, "nxagentDestroyCorruptedBackgroundResource: Removing corrupted pixmap background [%p] from resources.\n", @@ -2842,7 +2842,7 @@ void nxagentAllocateCorruptedResource(DrawablePtr pDrawable, RESTYPE type) nxagentWindowPriv((WindowPtr) pDrawable) -> corruptedId = FakeClientID(serverClient -> index); AddResource(nxagentWindowPriv((WindowPtr) pDrawable) -> corruptedId, RT_NX_CORR_WINDOW, - (pointer) pDrawable); + (void *) pDrawable); } } else if (type == RT_NX_CORR_BACKGROUND) @@ -2869,7 +2869,7 @@ void nxagentAllocateCorruptedResource(DrawablePtr pDrawable, RESTYPE type) nxagentPixmapPriv(pRealPixmap) -> corruptedBackgroundId = FakeClientID(serverClient -> index); AddResource(nxagentPixmapPriv(pRealPixmap) -> corruptedBackgroundId, RT_NX_CORR_BACKGROUND, - (pointer) pRealPixmap); + (void *) pRealPixmap); } } else if (type == RT_NX_CORR_PIXMAP) @@ -2896,7 +2896,7 @@ void nxagentAllocateCorruptedResource(DrawablePtr pDrawable, RESTYPE type) nxagentPixmapPriv(pRealPixmap) -> corruptedId = FakeClientID(serverClient -> index); AddResource(nxagentPixmapPriv(pRealPixmap) -> corruptedId, RT_NX_CORR_PIXMAP, - (pointer) pRealPixmap); + (void *) pRealPixmap); } } } @@ -3204,7 +3204,7 @@ void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2) * This function is similar to nxagentClipAndSendExpose(). */ -int nxagentClipAndSendClearExpose(WindowPtr pWin, pointer ptr) +int nxagentClipAndSendClearExpose(WindowPtr pWin, void * ptr) { RegionPtr exposeRgn; RegionPtr remoteExposeRgn; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h index c987fa119..4ebbc928e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h @@ -182,9 +182,9 @@ extern void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion); extern void nxagentAllocateCorruptedResource(DrawablePtr pDrawable, RESTYPE type); extern void nxagentDestroyCorruptedResource(DrawablePtr pDrawable, RESTYPE type); -extern int nxagentDestroyCorruptedBackgroundResource(pointer p, XID id); -extern int nxagentDestroyCorruptedWindowResource(pointer p, XID id); -extern int nxagentDestroyCorruptedPixmapResource(pointer p, XID id); +extern int nxagentDestroyCorruptedBackgroundResource(void * p, XID id); +extern int nxagentDestroyCorruptedWindowResource(void * p, XID id); +extern int nxagentDestroyCorruptedPixmapResource(void * p, XID id); extern void nxagentCreateDrawableBitmap(DrawablePtr pDrawable); extern void nxagentDestroyDrawableBitmap(DrawablePtr pDrawable); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index be5dd9032..c33564092 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -218,7 +218,7 @@ RegionPtr nxagentRemoteExposeRegion = NULL; static void nxagentForwardRemoteExpose(void); -static int nxagentClipAndSendExpose(WindowPtr pWin, pointer ptr); +static int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr); /* * This is from NXproperty.c. @@ -778,7 +778,7 @@ void nxagentGetEventMask(WindowPtr pWin, Mask *mask_return) *mask_return = mask; } -static int nxagentChangeMapPrivate(WindowPtr pWin, pointer ptr) +static int nxagentChangeMapPrivate(WindowPtr pWin, void * ptr) { if (pWin && nxagentWindowPriv(pWin)) { @@ -788,7 +788,7 @@ static int nxagentChangeMapPrivate(WindowPtr pWin, pointer ptr) return WT_WALKCHILDREN; } -static int nxagentChangeVisibilityPrivate(WindowPtr pWin, pointer ptr) +static int nxagentChangeVisibilityPrivate(WindowPtr pWin, void * ptr) { if (pWin && nxagentWindowPriv(pWin)) { @@ -4276,7 +4276,7 @@ void nxagentAddRectToRemoteExposeRegion(BoxPtr rect) REGION_UNINIT(nxagentDefaultScreen, &exposeRegion); } -int nxagentClipAndSendExpose(WindowPtr pWin, pointer ptr) +int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr) { RegionPtr exposeRgn; RegionPtr remoteExposeRgn; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 5becb2cff..9123f4bbe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -103,7 +103,7 @@ is" without express or implied warranty. static int reconnectFlexibility; static void nxagentCleanCacheAfterReconnect(void); -static void nxagentFontReconnect(FontPtr, XID, pointer); +static void nxagentFontReconnect(FontPtr, XID, void *); static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontPtr pFont); static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName , FontPtr pFont); int nxagentFreeFont(XFontStruct *fs); @@ -486,7 +486,7 @@ Bool nxagentFontLookUp(const char *name) Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) { - pointer priv; + void * priv; Atom name_atom, value_atom; int nprops; FontPropPtr props; @@ -538,7 +538,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) name = origName; } - priv = (pointer)xalloc(sizeof(nxagentPrivFont)); + priv = (void *)xalloc(sizeof(nxagentPrivFont)); FontSetPrivate(pFont, nxagentFontPrivateIndex, priv); nxagentFontPriv(pFont) -> mirrorID = 0; @@ -693,7 +693,7 @@ Bool nxagentUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) return True; } -int nxagentDestroyNewFontResourceType(pointer p, XID id) +int nxagentDestroyNewFontResourceType(void * p, XID id) { #ifdef TEST fprintf(stderr, "nxagentDestroyNewFontResourceType: Destroying mirror id [%ld] for font at [%p].\n", @@ -858,7 +858,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP return fontStruct; } -static void nxagentFontDisconnect(FontPtr pFont, XID param1, pointer param2) +static void nxagentFontDisconnect(FontPtr pFont, XID param1, void * param2) { nxagentPrivFont *privFont; Bool *pBool = (Bool*)param2; @@ -959,7 +959,7 @@ static void nxagentCollectFailedFont(FontPtr fpt, XID id) nxagentFailedToReconnectFonts.index++; } -static void nxagentFontReconnect(FontPtr pFont, XID param1, pointer param2) +static void nxagentFontReconnect(FontPtr pFont, XID param1, void * param2) { int i; nxagentPrivFont *privFont; @@ -1164,7 +1164,7 @@ Bool nxagentReconnectAllFonts(void *p0) return fontSuccess; } -static void nxagentFailedFontReconnect(FontPtr pFont, XID param1, pointer param2) +static void nxagentFailedFontReconnect(FontPtr pFont, XID param1, void * param2) { int i; nxagentPrivFont *privFont; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.h b/nx-X11/programs/Xserver/hw/nxagent/Font.h index d3ee2b0da..873efba51 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.h @@ -65,7 +65,7 @@ int nxagentFontLookUp(const char *name); Bool nxagentFontFind(const char *name, int *pos); void nxagentListRemoteAddName(const char *name, int status); -int nxagentDestroyNewFontResourceType(pointer p, XID id); +int nxagentDestroyNewFontResourceType(void * p, XID id); Bool nxagentDisconnectAllFonts(void); Bool nxagentReconnectAllFonts(void *p0); diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index ec51bbedc..808220346 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -75,7 +75,7 @@ void nxagentDisconnectGraphicContexts(void); GCPtr nxagentCreateGraphicContext(int depth); static void nxagentReconnectGC(void*, XID, void*); -static void nxagentReconnectClip(GCPtr, int, pointer, int); +static void nxagentReconnectClip(GCPtr, int, void *, int); static int nxagentCompareRegions(RegionPtr, RegionPtr); struct nxagentGCRec @@ -198,7 +198,7 @@ Bool nxagentCreateGC(GCPtr pGC) nxagentGCPriv(pGC) -> pPixmap = NULL; - AddResource(nxagentGCPriv(pGC) -> mid, RT_NX_GC, (pointer) pGC); + AddResource(nxagentGCPriv(pGC) -> mid, RT_NX_GC, (void *) pGC); return True; } @@ -602,7 +602,7 @@ void nxagentDestroyGC(GCPtr pGC) miDestroyGC(pGC); } -void nxagentChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) +void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) { int i, size; BoxPtr pBox; @@ -699,7 +699,7 @@ void nxagentChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) nxagentPixmap((PixmapPtr)pValue)); } - pGC->clientClip = (pointer) (*pGC->pScreen->BitmapToRegion)((PixmapPtr) pValue); + pGC->clientClip = (void *) (*pGC->pScreen->BitmapToRegion)((PixmapPtr) pValue); nxagentGCPriv(pGC)->pPixmap = (PixmapPtr)pValue; @@ -768,7 +768,7 @@ void nxagentChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) * CT_REGION client clips. */ - pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nRects, + pGC->clientClip = (void *) RECTS_TO_REGION(pGC->pScreen, nRects, (xRectangle *)pValue, type); xfree(pValue); @@ -987,7 +987,7 @@ static void nxagentRestoreGCList() } } -int nxagentDestroyNewGCResourceType(pointer p, XID id) +int nxagentDestroyNewGCResourceType(void * p, XID id) { /* * Address of the destructor is set in Init.c. @@ -1003,7 +1003,7 @@ int nxagentDestroyNewGCResourceType(pointer p, XID id) return 1; } -static void nxagentReconnectGC(void *param0, XID param1, pointer param2) +static void nxagentReconnectGC(void *param0, XID param1, void * param2) { XGCValues values; unsigned long valuemask; @@ -1188,7 +1188,7 @@ Bool nxagentReconnectAllGCs(void *p0) return GCSuccess; } -void nxagentDisconnectGC(pointer p0, XID x1, pointer p2) +void nxagentDisconnectGC(void * p0, XID x1, void * p2) { GCPtr pGC = (GCPtr) p0; Bool* pBool = (Bool*) p2; @@ -1255,7 +1255,7 @@ Bool nxagentDisconnectAllGCs() return success; } -static void nxagentReconnectClip(GCPtr pGC, int type, pointer pValue, int nRects) +static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) { int i, size; BoxPtr pBox; @@ -1320,7 +1320,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, pointer pValue, int nRects XSetClipOrigin(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y); - pGC->clientClip = (pointer) (*pGC->pScreen->BitmapToRegion)((PixmapPtr) pValue); + pGC->clientClip = (void *) (*pGC->pScreen->BitmapToRegion)((PixmapPtr) pValue); nxagentGCPriv(pGC)->pPixmap = (PixmapPtr)pValue; @@ -1370,7 +1370,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, pointer pValue, int nRects * CT_PIXMAP and CT_REGION client clips. */ - pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nRects, + pGC->clientClip = (void *) RECTS_TO_REGION(pGC->pScreen, nRects, (xRectangle *)pValue, type); xfree(pValue); pValue = pGC->clientClip; diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index c489d12c4..25f5fa6d7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -2042,7 +2042,7 @@ void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nGlyphs, CharInfoPtr *pCharInfo, - pointer pGlyphBase) + void * pGlyphBase) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -2061,7 +2061,7 @@ void nxagentImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, void nxagentPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nGlyphs, CharInfoPtr *pCharInfo, - pointer pGlyphBase) + void * pGlyphBase) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.h b/nx-X11/programs/Xserver/hw/nxagent/GCOps.h index fa4967aee..725b382c5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.h +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.h @@ -93,10 +93,10 @@ void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *string); void nxagentImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nGlyphs, CharInfoPtr *pCharInfo, pointer pGlyphBase); + unsigned int nGlyphs, CharInfoPtr *pCharInfo, void * pGlyphBase); void nxagentPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nGlyphs, CharInfoPtr *pCharInfo, pointer pGlyphBase); + unsigned int nGlyphs, CharInfoPtr *pCharInfo, void * pGlyphBase); void nxagentPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int width, int height, int x, int y); diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCs.h b/nx-X11/programs/Xserver/hw/nxagent/GCs.h index f7e13477a..bbd090dcc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCs.h +++ b/nx-X11/programs/Xserver/hw/nxagent/GCs.h @@ -87,17 +87,17 @@ void nxagentValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); void nxagentChangeGC(GCPtr pGC, unsigned long mask); void nxagentCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); void nxagentDestroyGC(GCPtr pGC); -void nxagentChangeClip(GCPtr pGC, int type, pointer pValue, int nRects); +void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects); void nxagentDestroyClip(GCPtr pGC); void nxagentDestroyClipHelper(GCPtr pGC); void nxagentCopyClip(GCPtr pGCDst, GCPtr pGCSrc); -void nxagentDisconnectGC(pointer p0, XID x1, pointer p2); +void nxagentDisconnectGC(void * p0, XID x1, void * p2); Bool nxagentDisconnectAllGCs(void); Bool nxagentReconnectAllGCs(void *p0); -int nxagentDestroyNewGCResourceType(pointer p, XID id); +int nxagentDestroyNewGCResourceType(void * p, XID id); void nxagentFreeGCList(void); void nxagentInitGCSafeVector(void); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 1fc6bbf8b..0396a458e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -161,7 +161,7 @@ struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 }; extern int nxagentSkipImage; -void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) +void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) { /* * Zero timeout. @@ -569,7 +569,7 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) #endif } -void nxagentWakeupHandler(pointer data, int count, pointer mask) +void nxagentWakeupHandler(void * data, int count, void * mask) { #ifdef BLOCKS fprintf(stderr, "[Begin wakeup]\n"); @@ -723,7 +723,7 @@ void nxagentWakeupHandler(pointer data, int count, pointer mask) #endif } -void nxagentShadowBlockHandler(pointer data, struct timeval **timeout, pointer mask) +void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mask) { static struct timeval zero; @@ -851,7 +851,7 @@ FIXME: Must queue multiple writes and handle #endif } -void nxagentShadowWakeupHandler(pointer data, int count, pointer mask) +void nxagentShadowWakeupHandler(void * data, int count, void * mask) { #ifdef BLOCKS fprintf(stderr, "[Begin wakeup]\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h index 3d3b335c0..0ef8b9ac2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h @@ -100,8 +100,8 @@ extern struct _TokensRec nxagentTokens; * The agent's block and wakeup handlers. */ -void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask); -void nxagentWakeupHandler(pointer data, int count, pointer mask); +void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask); +void nxagentWakeupHandler(void * data, int count, void * mask); /* * Executed after each request processed. @@ -109,8 +109,8 @@ void nxagentWakeupHandler(pointer data, int count, pointer mask); void nxagentDispatchHandler(ClientPtr client, int in, int out); -void nxagentShadowBlockHandler(pointer data, struct timeval **timeout, pointer mask); -void nxagentShadowWakeupHandler(pointer data, int count, pointer mask); +void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mask); +void nxagentShadowWakeupHandler(void * data, int count, void * mask); extern GCPtr nxagentShadowGCPtr; extern unsigned char nxagentShadowDepth; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 3722800ff..0b25aa57d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -132,8 +132,8 @@ void OsVendorEndRedirectErrorFFunction(); */ -static void nxagentGrabServerCallback(CallbackListPtr *callbacks, pointer data, - pointer args); +static void nxagentGrabServerCallback(CallbackListPtr *callbacks, void *data, + void *args); void ddxInitGlobals(void) { @@ -398,7 +398,7 @@ void InitInput(argc, argv) int argc; char *argv[]; { - pointer ptr, kbd; + void *ptr, *kbd; ptr = AddInputDevice(nxagentPointerProc, True); kbd = AddInputDevice(nxagentKeyboardProc, True); @@ -530,8 +530,8 @@ int SelectWaitTime = 10000; /* usec */ ServerGrabInfoRec nxagentGrabServerInfo; -static void nxagentGrabServerCallback(CallbackListPtr *callbacks, pointer data, - pointer args) +static void nxagentGrabServerCallback(CallbackListPtr *callbacks, void *data, + void *args) { ServerGrabInfoRec *grab = (ServerGrabInfoRec*)args; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 9c89b555f..835aebeb6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -571,7 +571,7 @@ static char *nxagentXkbGetRules() return XKB_DFLT_RULES_FILE; } -void nxagentBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls) +void nxagentBell(int volume, DeviceIntPtr pDev, void * ctrl, int cls) { XBell(nxagentDisplay, volume); } @@ -978,7 +978,7 @@ XkbError: #endif XkbSetRulesDflts(rules, model, layout, variants, options); - XkbInitKeyboardDeviceStruct((pointer)pDev, &names, &keySyms, modmap, + XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap, nxagentBell, nxagentChangeKeyboardControl); if (!nxagentKeyboard || @@ -1068,7 +1068,7 @@ XkbError: #endif XkbSetRulesDflts(rules, model, layout, variants, options); - XkbInitKeyboardDeviceStruct((pointer)pDev, &names, &keySyms, modmap, + XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap, nxagentBell, nxagentChangeKeyboardControl); free(nxagentXkbConfigFilePath); @@ -1087,9 +1087,9 @@ XkbError: #endif XkbSetRulesDflts(rules, model, layout, variants, options); - XkbInitKeyboardDeviceStruct((pointer)pDev, &names, &keySyms, modmap, + XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap, nxagentBell, nxagentChangeKeyboardControl); - XkbDDXChangeControls((pointer)pDev, xkb->ctrls, xkb->ctrls); + XkbDDXChangeControls((void *)pDev, xkb->ctrls, xkb->ctrls); XkbEnd: diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h index 12d953d93..036eec57f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h @@ -89,7 +89,7 @@ extern char *nxagentKeyboard; * and utility functions. */ -void nxagentBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls); +void nxagentBell(int volume, DeviceIntPtr pDev, void * ctrl, int cls); int nxagentKeyboardProc(DeviceIntPtr pDev, int onoff); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c index cf5d48ba2..06f2de57c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c @@ -344,7 +344,7 @@ static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); static void damageChangeGC(GCPtr, unsigned long); static void damageCopyGC(GCPtr, unsigned long, GCPtr); static void damageDestroyGC(GCPtr); -static void damageChangeClip(GCPtr, int, pointer, int); +static void damageChangeClip(GCPtr, int, void *, int); static void damageDestroyClip(GCPtr); static void damageCopyClip(GCPtr, GCPtr); @@ -457,7 +457,7 @@ damageCopyGC (GCPtr pGCSrc, static void damageChangeClip (GCPtr pGC, int type, - pointer pvalue, + void *pvalue, int nrects) { DAMAGE_GC_FUNC_PROLOGUE (pGC); @@ -1560,7 +1560,7 @@ damageImageGlyphBlt(DrawablePtr pDrawable, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase) + void *pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, @@ -1577,7 +1577,7 @@ damagePolyGlyphBlt(DrawablePtr pDrawable, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase) + void *pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, @@ -1908,7 +1908,7 @@ DamageSetup (ScreenPtr pScreen) } #endif - pScreen->devPrivates[damageScrPrivateIndex].ptr = (pointer) pScrPriv; + pScreen->devPrivates[damageScrPrivateIndex].ptr = (void *) pScrPriv; return TRUE; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index ea4f59d19..af76ed4c2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -245,7 +245,7 @@ extern WindowPtr nxagentViewportFrameBelow; extern int nxagentMaxAllowedResets; -extern int nxagentFindClientResource(int, RESTYPE, pointer); +extern int nxagentFindClientResource(int, RESTYPE, void *); static ClientPtr grabClient; #define GrabNone 0 @@ -883,7 +883,7 @@ ProcCreateWindow(ClientPtr client) Mask mask = pWin->eventMask; pWin->eventMask = 0; /* subterfuge in case AddResource fails */ - if (!AddResource(stuff->wid, RT_WINDOW, (pointer)pWin)) + if (!AddResource(stuff->wid, RT_WINDOW, (void *)pWin)) return BadAlloc; pWin->eventMask = mask; } @@ -1573,7 +1573,7 @@ ProcGrabServer(register ClientPtr client) ServerGrabInfoRec grabinfo; grabinfo.client = client; grabinfo.grabstate = SERVER_GRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); + CallCallbacks(&ServerGrabCallback, (void *)&grabinfo); } return(client->noClientException); @@ -1602,7 +1602,7 @@ UngrabServer(ClientPtr client) ServerGrabInfoRec grabinfo; grabinfo.client = client; grabinfo.grabstate = SERVER_UNGRABBED; - CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo); + CallCallbacks(&ServerGrabCallback, (void *)&grabinfo); } } @@ -1966,7 +1966,7 @@ ProcListFontsWithInfo(register ClientPtr client) * \param value must conform to DeleteType */ int -dixDestroyPixmap(pointer value, XID pid) +dixDestroyPixmap(void * value, XID pid) { PixmapPtr pPixmap = (PixmapPtr)value; return (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap); @@ -2025,7 +2025,7 @@ CreatePmap: { pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) + if (AddResource(stuff->pid, RT_PIXMAP, (void *)pMap)) return(client->noClientException); } return (BadAlloc); @@ -2108,7 +2108,7 @@ ProcCreateGC(register ClientPtr client) (XID *) &stuff[1], &error); if (error != Success) return error; - if (!AddResource(stuff->gc, RT_GC, (pointer)pGC)) + if (!AddResource(stuff->gc, RT_GC, (void *)pGC)) return (BadAlloc); return(client->noClientException); } @@ -2798,7 +2798,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, nlines, format, planemask, - (pointer) pBuf); + (void *) pBuf); #ifdef XCSECURITY if (pVisibleRegion) SecurityCensorImage(client, pVisibleRegion, widthBytesLine, @@ -2839,7 +2839,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, nlines, format, plane, - (pointer)pBuf); + (void *)pBuf); #ifdef XCSECURITY if (pVisibleRegion) SecurityCensorImage(client, pVisibleRegion, @@ -3669,7 +3669,7 @@ ProcCreateCursor (register ClientPtr client) /* zeroing the (pad) bits helps some ddx cursor handling */ bzero((char *)srcbits, n); (* src->drawable.pScreen->GetImage)( (DrawablePtr)src, 0, 0, width, height, - XYPixmap, 1, (pointer)srcbits); + XYPixmap, 1, (void *)srcbits); if ( msk == (PixmapPtr)NULL) { register unsigned char *bits = mskbits; @@ -3681,7 +3681,7 @@ ProcCreateCursor (register ClientPtr client) /* zeroing the (pad) bits helps some ddx cursor handling */ bzero((char *)mskbits, n); (* msk->drawable.pScreen->GetImage)( (DrawablePtr)msk, 0, 0, width, - height, XYPixmap, 1, (pointer)mskbits); + height, XYPixmap, 1, (void *)mskbits); } cm.width = width; cm.height = height; @@ -3691,7 +3691,7 @@ ProcCreateCursor (register ClientPtr client) stuff->foreRed, stuff->foreGreen, stuff->foreBlue, stuff->backRed, stuff->backGreen, stuff->backBlue); - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (pCursor && AddResource(stuff->cid, RT_CURSOR, (void *)pCursor)) { #ifdef TEST fprintf(stderr, "ProcCreateCursor: Created cursor at [%p].\n", (void *) pCursor); @@ -3721,7 +3721,7 @@ ProcCreateGlyphCursor (register ClientPtr client) &pCursor, client); if (res != Success) return res; - if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (AddResource(stuff->cid, RT_CURSOR, (void *)pCursor)) return client->noClientException; return BadAlloc; } @@ -3908,10 +3908,10 @@ ProcChangeHosts(register ClientPtr client) if(stuff->mode == HostInsert) result = AddHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); + stuff->hostLength, (void *)&stuff[1]); else if (stuff->mode == HostDelete) result = RemoveHost(client, (int)stuff->hostFamily, - stuff->hostLength, (pointer)&stuff[1]); + stuff->hostLength, (void *)&stuff[1]); else { client->errorValue = stuff->mode; @@ -3927,7 +3927,7 @@ ProcListHosts(register ClientPtr client) { xListHostsReply reply; int len, nHosts, result; - pointer pdata; + void * pdata; /* REQUEST(xListHostsReq); */ REQUEST_SIZE_MATCH(xListHostsReq); @@ -4222,7 +4222,7 @@ CloseDownClient(register ClientPtr client) clientinfo.client = client; clientinfo.prefix = (xConnSetupPrefix *)NULL; clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); + CallCallbacks((&ClientStateCallback), (void *)&clientinfo); } } client->clientGone = TRUE; /* so events aren't sent to client */ @@ -4259,7 +4259,7 @@ CloseDownClient(register ClientPtr client) clientinfo.client = client; clientinfo.prefix = (xConnSetupPrefix *)NULL; clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); + CallCallbacks((&ClientStateCallback), (void *)&clientinfo); } FreeClientResources(client); if (client->index < nextFreeClientID) @@ -4309,7 +4309,7 @@ CloseDownRetainedResources() } } -void InitClient(ClientPtr client, int i, pointer ospriv) +void InitClient(ClientPtr client, int i, void * ospriv) { client->index = i; client->sequence = 0; @@ -4399,11 +4399,11 @@ InitClientPrivates(ClientPtr client) { if ( (size = *sizes) ) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } /* @@ -4422,7 +4422,7 @@ InitClientPrivates(ClientPtr client) * Returns NULL if there are no free clients. *************************/ -ClientPtr NextAvailableClient(pointer ospriv) +ClientPtr NextAvailableClient(void * ospriv) { register int i; register ClientPtr client; @@ -4460,7 +4460,7 @@ ClientPtr NextAvailableClient(pointer ospriv) clientinfo.client = client; clientinfo.prefix = (xConnSetupPrefix *)NULL; clientinfo.setup = (xConnSetup *) NULL; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); + CallCallbacks((&ClientStateCallback), (void *)&clientinfo); } return(client); } @@ -4595,7 +4595,7 @@ SendConnSetup(register ClientPtr client, char *reason) clientinfo.client = client; clientinfo.prefix = lconnSetupPrefix; clientinfo.setup = (xConnSetup *)lConnectionInfo; - CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); + CallCallbacks((&ClientStateCallback), (void *)&clientinfo); } return (client->noClientException); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 828b9bf4c..4f41ee228 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -177,7 +177,7 @@ _NXGetFontPathError: #define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics -extern pointer fosNaturalParams; +extern void * fosNaturalParams; extern FontPtr defaultFont; static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; @@ -291,7 +291,7 @@ RemoveFontWakeup(FontPathElementPtr fpe) } void -FontWakeup(pointer data, int count, pointer LastSelectMask) +FontWakeup(void * data, int count, void * LastSelectMask) { int i; FontPathElementPtr fpe; @@ -381,7 +381,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -389,7 +389,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) while (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; err = (*fpe_functions[fpe->type].open_font) - ((pointer) client, fpe, c->flags, + ((void *) client, fpe, c->flags, c->fontname, c->fnamelen, FontFormat, BitmapFormatMaskByte | BitmapFormatMaskBit | @@ -423,7 +423,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (err == Suspended) { if (!c->slept) { c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (pointer) c); + ClientSleep(client, (ClientSleepProcPtr)doOpenFont, (void *) c); #ifdef NXAGENT_DEBUG fprintf(stderr, " NXdixfonts: doOpenFont: client [%lx] sleeping.\n", client); #endif @@ -469,7 +469,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) } } } - if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) { + if (!AddResource(c->fontid, RT_FONT, (void *) pfont)) { err = AllocError; goto bail; } @@ -478,7 +478,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) extern RESTYPE RT_NX_FONT; nxagentFontPriv(pfont) -> mirrorID = FakeClientID(0); - if (!AddResource(nxagentFontPriv(pfont) -> mirrorID, RT_NX_FONT, (pointer) pfont)) { + if (!AddResource(nxagentFontPriv(pfont) -> mirrorID, RT_NX_FONT, (void *) pfont)) { FreeResource(c->fontid, RT_NONE); err = AllocError; goto bail; @@ -548,7 +548,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna cached = FindCachedFontPattern(patternCache, pfontname, lenfname); if (cached && cached->info.cachable) { - if (!AddResource(fid, RT_FONT, (pointer) cached)) + if (!AddResource(fid, RT_FONT, (void *) cached)) return BadAlloc; cached->refcnt++; return Success; @@ -599,7 +599,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna * \param value must conform to DeleteType */ int -CloseFont(pointer value, XID fid) +CloseFont(void * value, XID fid) { int nscr; ScreenPtr pscr; @@ -730,7 +730,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -748,7 +748,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) /* This FPE doesn't support/require list_fonts_and_aliases */ err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, + ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, c->names); @@ -757,7 +757,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) c->slept = TRUE; ClientSleep(client, (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); + (void *) c); #ifdef NXAGENT_DEBUG fprintf(stderr, " NXdixfonts: doListFont (1): client [%lx] sleeping.\n", client); #endif @@ -780,14 +780,14 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (!c->current.list_started) { err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, + ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, &c->current.private); if (err == Suspended) { if (!c->slept) { ClientSleep(client, (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); + (void *) c); c->slept = TRUE; } return TRUE; @@ -799,13 +799,13 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) char *tmpname; name = 0; err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, + ((void *) c->client, fpe, &name, &namelen, &tmpname, &resolvedlen, c->current.private); if (err == Suspended) { if (!c->slept) { ClientSleep(client, (ClientSleepProcPtr)doListFontsAndAliases, - (pointer) c); + (void *) c); c->slept = TRUE; #ifdef NXAGENT_DEBUG fprintf(stderr, " NXdixfonts: doListFont (2): client [%lx] sleeping.\n", client); @@ -859,7 +859,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) tmpname = 0; (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, + ((void *) c->client, fpe, &tmpname, &tmpnamelen, &tmpname, &tmpnamelen, c->current.private); if (--aliascount <= 0) { @@ -1070,7 +1070,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -1361,7 +1361,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); if (c->slept) { @@ -1389,7 +1389,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) the FPE code to clean up after client and avoid further rendering while we clean up after ourself. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); c->pDraw = (DrawablePtr)0; } @@ -1558,7 +1558,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) c->slept = TRUE; ClientSleep(client, (ClientSleepProcPtr)doPolyText, - (pointer) c); + (void *) c); #ifdef NXAGENT_DEBUG fprintf(stderr, " NXdixfonts: doPolyText (1): client [%lx] sleeping.\n", client); #endif @@ -1670,7 +1670,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1684,7 +1684,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1756,7 +1756,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) ValidateGC(c->pDraw, c->pGC); c->slept = TRUE; - ClientSleep(client, (ClientSleepProcPtr)doImageText, (pointer) c); + ClientSleep(client, (ClientSleepProcPtr)doImageText, (void *) c); #ifdef NXAGENT_DEBUG fprintf(stderr, " NXdixfonts: doImageText (1): client [%lx] sleeping.\n", client); #endif @@ -2115,7 +2115,7 @@ DeleteClientFontStuff(ClientPtr client) { fpe = font_path_elements[i]; if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } } @@ -2255,7 +2255,7 @@ GetNewFontClientID() int StoreFontClientFont(FontPtr pfont, Font id) { - return AddResource(id, RT_NONE, (pointer) pfont); + return AddResource(id, RT_NONE, (void *) pfont); } void @@ -2288,7 +2288,7 @@ init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) #endif if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (pointer) 0)) + FontWakeup, (void *) 0)) return AllocError; fs_handlers_installed++; } @@ -2308,7 +2308,7 @@ remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, Bo #endif RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (pointer) 0); + (void *) 0); } } RemoveFontWakeup(fpe); @@ -2339,7 +2339,7 @@ dump_char_ascii(CharInfoPtr cip) bpr = GLYPH_SIZE(cip, 4); for (r = 0; r < (cip->metrics.ascent + cip->metrics.descent); r++) { - pointer row = (pointer) cip->bits + r * bpr; + void * row = (void *) cip->bits + r * bpr; byte = 0; for (l = 0; l <= (cip->metrics.rightSideBearing - @@ -2386,7 +2386,7 @@ nxdoListFontsAndAliases(client, fss) if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -2404,7 +2404,7 @@ nxdoListFontsAndAliases(client, fss) /* This FPE doesn't support/require list_fonts_and_aliases */ err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, + ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, c->names); @@ -2413,7 +2413,7 @@ nxdoListFontsAndAliases(client, fss) c->slept = TRUE; ClientSleep(client, (ClientSleepProcPtr)nxdoListFontsAndAliases, - (pointer) fss); + (void *) fss); #ifdef NXAGENT_DEBUG fprintf(stderr, " NXdixfonts: nxdoListFont (1): client [%lx] sleeping.\n", client); #endif @@ -2436,14 +2436,14 @@ nxdoListFontsAndAliases(client, fss) if (!c->current.list_started) { err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, + ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, &c->current.private); if (err == Suspended) { if (!c->slept) { ClientSleep(client, (ClientSleepProcPtr)nxdoListFontsAndAliases, - (pointer) fss); + (void *) fss); c->slept = TRUE; #ifdef NXAGENT_DEBUG fprintf(stderr, " NXdixfonts: nxdoListFont (2): client [%lx] sleeping.\n", client); @@ -2458,13 +2458,13 @@ nxdoListFontsAndAliases(client, fss) char *tmpname; name = 0; err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, + ((void *) c->client, fpe, &name, &namelen, &tmpname, &resolvedlen, c->current.private); if (err == Suspended) { if (!c->slept) { ClientSleep(client, (ClientSleepProcPtr)nxdoListFontsAndAliases, - (pointer) fss); + (void *) fss); c->slept = TRUE; #ifdef NXAGENT_DEBUG fprintf(stderr, " NXdixfonts: nxdoListFont (3): client [%lx] sleeping.\n", client); @@ -2529,7 +2529,7 @@ nxdoListFontsAndAliases(client, fss) tmpname = 0; (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, + ((void *) c->client, fpe, &tmpname, &tmpnamelen, &tmpname, &tmpnamelen, c->current.private); if (--aliascount <= 0) { @@ -2694,7 +2694,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) cached = FindCachedFontPattern(patternCache, pfontname, lenfname); if (cached && cached->info.cachable) { - if (!AddResource(fid, RT_FONT, (pointer) cached)) + if (!AddResource(fid, RT_FONT, (void *) cached)) return BadAlloc; cached->refcnt++; return Success; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index 872a02ce5..5940fe7d1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -1112,7 +1112,7 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; eventinfo.events = xE; eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); + CallCallbacks(&DeviceEventCallback, (void *)&eventinfo); } if (xE->u.u.type == MotionNotify) { @@ -2783,7 +2783,7 @@ CheckPassiveGrabsOnWindow( a passive grab to be activated. If the event is a keyboard event, the ancestors of the focus window are traced down and tried to see if they have any passive grabs to be activated. If the focus window itself is reached and -it's descendants contain they pointer, the ancestors of the window that the +its descendants contain the pointer, the ancestors of the window that the pointer is in are then traced down starting at the focus window, otherwise no grabs are activated. If the event is a pointer event, the ancestors of the window that the pointer is in are traced down starting at the root until @@ -3008,7 +3008,7 @@ drawable.id:0; DeviceEventInfoRec eventinfo; eventinfo.events = xE; eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); + CallCallbacks(&DeviceEventCallback, (void *)&eventinfo); } } #ifdef XEVIE @@ -3212,7 +3212,7 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id; eventinfo.events = xE; eventinfo.count = count; - CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo); + CallCallbacks(&DeviceEventCallback, (void *)&eventinfo); } } if (xE->u.u.type != MotionNotify) @@ -3402,7 +3402,7 @@ RecalculateDeliverableEvents(pWin) * \param value must conform to DeleteType */ int -OtherClientGone(pointer value, XID id) +OtherClientGone(void * value, XID id) { register OtherClientsPtr other, prev; register WindowPtr pWin = (WindowPtr)value; @@ -3497,7 +3497,7 @@ EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask ma others->resource = FakeClientID(client->index); others->next = pWin->optional->otherClients; pWin->optional->otherClients = others; - if (!AddResource(others->resource, RT_OTHERCLIENT, (pointer)pWin)) + if (!AddResource(others->resource, RT_OTHERCLIENT, (void *)pWin)) return BadAlloc; } maskSet: @@ -5029,7 +5029,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) eventinfo.client = pClient; eventinfo.events = events; eventinfo.count = count; - CallCallbacks(&EventCallback, (pointer)&eventinfo); + CallCallbacks(&EventCallback, (void *)&eventinfo); } if(pClient->swapped) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c index 51c547984..4b9ac9a67 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c @@ -442,7 +442,7 @@ static int __glXDispatch(ClientPtr client) ** with the client so we will be notified when the client dies. */ XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { + if (!AddResource( xid, __glXClientRes, (void *)(long)client->index)) { return BadAlloc; } ResetClientState(client->index); @@ -520,7 +520,7 @@ static int __glXSwapDispatch(ClientPtr client) ** with the client so we will be notified when the client dies. */ XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) { + if (!AddResource( xid, __glXClientRes, (void *)(long)client->index)) { return BadAlloc; } ResetClientState(client->index); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c index cd65fdc0e..47db919ef 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c @@ -147,30 +147,30 @@ ResetGlyphSetPrivateIndex (void) } Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr) +_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr) { - pointer *new; + void **new; if (n > glyphSet->maxPrivate) { if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) { - new = (pointer *) xrealloc (glyphSet->devPrivates, - (n + 1) * sizeof (pointer)); + glyphSet->devPrivates != (void *)(&glyphSet[1])) { + new = (void **) xrealloc (glyphSet->devPrivates, + (n + 1) * sizeof (void *)); if (!new) return FALSE; } else { - new = (pointer *) xalloc ((n + 1) * sizeof (pointer)); + new = (void **) xalloc ((n + 1) * sizeof (void *)); if (!new) return FALSE; if (glyphSet->devPrivates) memcpy (new, glyphSet->devPrivates, - (glyphSet->maxPrivate + 1) * sizeof (pointer)); + (glyphSet->maxPrivate + 1) * sizeof (void *)); } glyphSet->devPrivates = new; /* Zero out new, uninitialize privates */ while (++glyphSet->maxPrivate < n) - glyphSet->devPrivates[glyphSet->maxPrivate] = (pointer)0; + glyphSet->devPrivates[glyphSet->maxPrivate] = (void *)0; } glyphSet->devPrivates[n] = ptr; return TRUE; @@ -522,14 +522,14 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) } size = (sizeof (GlyphSetRec) + - (sizeof (pointer) * _GlyphSetPrivateAllocateIndex)); + (sizeof (void *) * _GlyphSetPrivateAllocateIndex)); glyphSet = xalloc (size); if (!glyphSet) return FALSE; bzero((char *)glyphSet, size); glyphSet->maxPrivate = _GlyphSetPrivateAllocateIndex - 1; if (_GlyphSetPrivateAllocateIndex) - glyphSet->devPrivates = (pointer)(&glyphSet[1]); + glyphSet->devPrivates = (void *)(&glyphSet[1]); if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) { @@ -543,7 +543,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) } int -FreeGlyphSet (pointer value, +FreeGlyphSet (void * value, XID gid) { GlyphSetPtr glyphSet = (GlyphSetPtr) value; @@ -571,7 +571,7 @@ FreeGlyphSet (pointer value, xfree (table); if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) + glyphSet->devPrivates != (void *)(&glyphSet[1])) xfree(glyphSet->devPrivates); xfree (glyphSet); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h index fa6b5fb02..e7bb2d841 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h @@ -94,13 +94,13 @@ typedef struct _GlyphSet { int fdepth; GlyphHashRec hash; int maxPrivate; - pointer *devPrivates; + void **devPrivates; CARD32 remoteID; } GlyphSetRec, *GlyphSetPtr; #define GlyphSetGetPrivate(pGlyphSet,n) \ ((n) > (pGlyphSet)->maxPrivate ? \ - (pointer) 0 : \ + (void *) 0 : \ (pGlyphSet)->devPrivates[n]) #define GlyphSetSetPrivate(pGlyphSet,n,ptr) \ @@ -127,7 +127,7 @@ void ResetGlyphSetPrivateIndex (void); Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr); +_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr); Bool GlyphInit (ScreenPtr pScreen); @@ -166,7 +166,7 @@ GlyphSetPtr AllocateGlyphSet (int fdepth, PictFormatPtr format); int -FreeGlyphSet (pointer value, +FreeGlyphSet (void *value, XID gid); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c index 125f1b1c4..e1c6b6d8c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c @@ -672,7 +672,7 @@ static GCPtr screenContext[MAXSCREENS]; /*ARGSUSED*/ static int tossGC ( - pointer value, + void * value, XID id) { GCPtr pGC = (GCPtr)value; @@ -757,7 +757,7 @@ int what; gcmask |= GCForeground | GCFillStyle; break; case BackgroundPixmap: - newValues[TILE].ptr = (pointer)pWin->background.pixmap; + newValues[TILE].ptr = (void *)pWin->background.pixmap; newValues[FILLSTYLE].val = FillTiled; gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; break; @@ -773,7 +773,7 @@ int what; } else { - newValues[TILE].ptr = (pointer)pWin->border.pixmap; + newValues[TILE].ptr = (void *)pWin->border.pixmap; newValues[FILLSTYLE].val = FillTiled; gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; } @@ -846,7 +846,7 @@ int what; return; numGCs++; if (!AddResource(FakeClientID(0), ResType, - (pointer)screenContext[i])) + (void *)screenContext[i])) return; } pGC = screenContext[i]; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c index 5f32334ae..f86c81de6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c @@ -225,7 +225,7 @@ miGlyphs (CARD8 op, pPixmap = GetScratchPixmapHeader (pScreen, glyph->info.width, glyph->info.height, list->format->depth, list->format->depth, - 0, (pointer) (glyph + 1)); + 0, (void *) (glyph + 1)); if (!pPixmap) return; component_alpha = NeedsComponent(list->format->format); @@ -240,7 +240,7 @@ miGlyphs (CARD8 op, } (*pScreen->ModifyPixmapHeader) (pPixmap, glyph->info.width, glyph->info.height, - 0, 0, -1, (pointer) (glyph + 1)); + 0, 0, -1, (void *) (glyph + 1)); #ifdef NXAGENT_SERVER @@ -292,7 +292,7 @@ miGlyphs (CARD8 op, if (pPicture) { FreeScratchPixmapHeader (pPixmap); - FreePicture ((pointer) pPicture, 0); + FreePicture ((void *) pPicture, 0); pPicture = 0; pPixmap = 0; } @@ -311,7 +311,7 @@ miGlyphs (CARD8 op, x, y, width, height); - FreePicture ((pointer) pMask, (XID) 0); + FreePicture ((void *) pMask, (XID) 0); (*pScreen->DestroyPixmap) (pMaskPixmap); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c index 190294979..8132e9dd0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c @@ -596,7 +596,7 @@ miMoveWindow(pWin, x, y, pNextSib, kind) static int miRecomputeExposures ( register WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ + void * value) /* must conform to VisitWindowProcPtr */ { register ScreenPtr pScreen; RegionPtr pValid = (RegionPtr)value; @@ -927,7 +927,7 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) continue; REGION_INTERSECT(pScreen, pRegion, &pChild->borderClip, gravitate[g]); - TraverseTree (pChild, miRecomputeExposures, (pointer)pRegion); + TraverseTree (pChild, miRecomputeExposures, (void *)pRegion); } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index 4b342ebcf..9c438394a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -152,7 +152,7 @@ PictureDestroyWindow (WindowPtr pWindow) SetPictureWindow(pWindow, pPicture->pNext); if (pPicture->id) FreeResource (pPicture->id, PictureType); - FreePicture ((pointer) pPicture, pPicture->id); + FreePicture ((void *) pPicture, pPicture->id); } pScreen->DestroyWindow = ps->DestroyWindow; ret = (*pScreen->DestroyWindow) (pWindow); @@ -731,7 +731,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) } for (n = 0; n < nformats; n++) { - if (!AddResource (formats[n].id, PictFormatType, (pointer) (formats+n))) + if (!AddResource (formats[n].id, PictFormatType, (void *) (formats+n))) { xfree (formats); return FALSE; @@ -867,11 +867,11 @@ AllocatePicture (ScreenPtr pScreen) { if ( (size = *sizes) ) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } nxagentPicturePriv(pPicture) -> picture = 0; @@ -1103,7 +1103,7 @@ static PicturePtr createSourcePicture(void) privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; - ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr; + ppriv[nxagentPicturePrivateIndex].ptr = (void *) privPictureRecAddr; pPicture -> devPrivates = ppriv; @@ -1364,7 +1364,7 @@ ChangePicture (PicturePtr pPicture, if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP) pAlpha->refcnt++; if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); + FreePicture ((void *) pPicture->alphaMap, (XID) 0); pPicture->alphaMap = pAlpha; } } @@ -1442,7 +1442,7 @@ ChangePicture (PicturePtr pPicture, #endif error = (*ps->ChangePictureClip)(pPicture, clipType, - (pointer)pPixmap, 0); + (void *)pPixmap, 0); break; } case CPGraphicsExposure: @@ -1542,7 +1542,7 @@ SetPictureClipRects (PicturePtr pPicture, if (!clientClip) return BadAlloc; result =(*ps->ChangePictureClip) (pPicture, CT_REGION, - (pointer) clientClip, 0); + (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; @@ -1586,7 +1586,7 @@ SetPictureClipRegion (PicturePtr pPicture, } result =(*ps->ChangePictureClip) (pPicture, type, - (pointer) clientClip, 0); + (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; @@ -1658,7 +1658,7 @@ CopyPicture (PicturePtr pSrc, if (pSrc->alphaMap && pSrc->alphaMap->pDrawable->type == DRAWABLE_PIXMAP) pSrc->alphaMap->refcnt++; if (pDst->alphaMap) - FreePicture ((pointer) pDst->alphaMap, (XID) 0); + FreePicture ((void *) pDst->alphaMap, (XID) 0); pDst->alphaMap = pSrc->alphaMap; break; case CPAlphaXOrigin: @@ -1740,7 +1740,7 @@ ValidatePicture(PicturePtr pPicture) } int -FreePicture (pointer value, +FreePicture (void * value, XID pid) { PicturePtr pPicture = (PicturePtr) value; @@ -1764,7 +1764,7 @@ FreePicture (pointer value, PictureScreenPtr ps = GetPictureScreen(pScreen); if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); + FreePicture ((void *) pPicture->alphaMap, (XID) 0); (*ps->DestroyPicture) (pPicture); (*ps->DestroyPictureClip) (pPicture); if (pPicture->pDrawable->type == DRAWABLE_WINDOW) @@ -1794,7 +1794,7 @@ FreePicture (pointer value, } int -FreePictFormat (pointer pPictFormat, +FreePictFormat (void * pPictFormat, XID pid) { return Success; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h index b2679257c..9f9c32c35 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h @@ -174,7 +174,7 @@ typedef struct _Picture { DDXPointRec alphaOrigin; DDXPointRec clipOrigin; - pointer clientClip; + void * clientClip; Atom dither; @@ -220,7 +220,7 @@ typedef int (*CreatePictureProcPtr) (PicturePtr pPicture); typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture); typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture, int clipType, - pointer value, + void *value, int n); typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture); @@ -393,9 +393,9 @@ extern RESTYPE GlyphSetType; #define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr)) #define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL) -#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p)) +#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (void *) (p)) #define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr)) -#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p)) +#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (void *) (p)) #define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\ pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\ @@ -535,11 +535,11 @@ void ValidatePicture(PicturePtr pPicture); int -FreePicture (pointer pPicture, +FreePicture (void * pPicture, XID pid); int -FreePictFormat (pointer pPictFormat, +FreePictFormat (void * pPictFormat, XID pid); void diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index ee2d6da94..a2d4a8e52 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -317,10 +317,10 @@ ProcChangeProperty(ClientPtr client) #ifdef LBX err = LbxChangeWindowProperty(client, pWin, stuff->property, stuff->type, - (int)format, (int)mode, len, TRUE, (pointer)&stuff[1], TRUE, NULL); + (int)format, (int)mode, len, TRUE, (void *)&stuff[1], TRUE, NULL); #else err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, - (int)mode, len, (pointer)&stuff[1], TRUE); + (int)mode, len, (void *)&stuff[1], TRUE); #endif if (err != Success) return err; @@ -329,7 +329,7 @@ ProcChangeProperty(ClientPtr client) if (nxagentOption(Rootless) == 1) { nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format, - (int) mode, len, (pointer) &stuff[1]); + (int) mode, len, (void *) &stuff[1]); } nxagentGuessClientHint(client, stuff->property, (char *) &stuff[1]); @@ -346,7 +346,7 @@ ProcChangeProperty(ClientPtr client) int ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long len, pointer value, + int mode, unsigned long len, void * value, Bool sendevent) { #ifdef LBX @@ -358,7 +358,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, xEvent event; int sizeInBytes; int totalSize; - pointer data; + void * data; int copySize; sizeInBytes = format>>3; @@ -392,7 +392,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, pProp = (PropertyPtr)xalloc(sizeof(PropertyRec)); if (!pProp) return(BadAlloc); - data = (pointer)xalloc(totalSize); + data = (void *)xalloc(totalSize); if (!data && len) { xfree(pProp); @@ -423,7 +423,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, { if (totalSize != pProp->size * (pProp->format >> 3)) { - data = (pointer)xrealloc(pProp->data, totalSize); + data = (void *)xrealloc(pProp->data, totalSize); if (!data && len) return(BadAlloc); pProp->data = data; @@ -440,7 +440,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, } else if (mode == PropModeAppend) { - data = (pointer)xrealloc(pProp->data, + data = (void *)xrealloc(pProp->data, sizeInBytes * (len + pProp->size)); if (!data) return(BadAlloc); @@ -452,7 +452,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, } else if (mode == PropModePrepend) { - data = (pointer)xalloc(sizeInBytes * (len + pProp->size)); + data = (void *)xalloc(sizeInBytes * (len + pProp->size)); if (!data) return(BadAlloc); memmove(&((char *)data)[totalSize], (char *)pProp->data, diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index e34689399..260355c6e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -125,9 +125,9 @@ void nxagentCreateGlyphSet(GlyphSetPtr glyphSet); void nxagentReferenceGlyphSet(GlyphSetPtr glyphSet); void nxagentFreeGlyphs(GlyphSetPtr glyphSet, CARD32 *gids, int nglyph); void nxagentFreeGlyphSet(GlyphSetPtr glyphSet); -void nxagentSetPictureTransform(PicturePtr pPicture, pointer transform); +void nxagentSetPictureTransform(PicturePtr pPicture, void * transform); void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, - pointer params, int nparams); + void * params, int nparams); void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); @@ -334,8 +334,8 @@ typedef struct _RenderClient { static void RenderClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) + void * closure, + void * data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -767,7 +767,7 @@ ProcRenderCreatePicture (ClientPtr client) return error; nxagentCreatePicture(pPicture, stuff -> mask); - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -1341,7 +1341,7 @@ ProcRenderCreateGlyphSet (ClientPtr client) glyphSet = AllocateGlyphSet (f, format); if (!glyphSet) return BadAlloc; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) + if (!AddResource (stuff->gsid, GlyphSetType, (void *)glyphSet)) return BadAlloc; nxagentCreateGlyphSet(glyphSet); @@ -1372,7 +1372,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client) nxagentReferenceGlyphSet(glyphSet); - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) + if (!AddResource (stuff->gsid, GlyphSetType, (void *)glyphSet)) return BadAlloc; return client->noClientException; } @@ -1953,7 +1953,7 @@ ProcRenderCreateCursor (ClientPtr client) { (*pScreen->GetImage) (pSrc->pDrawable, 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); + 0xffffffff, (void *) argbbits); } else { @@ -1993,7 +1993,7 @@ ProcRenderCreateCursor (ClientPtr client) 0, 0, 0, 0, 0, 0, width, height); (*pScreen->GetImage) (pPicture->pDrawable, 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); + 0xffffffff, (void *) argbbits); FreePicture (pPicture, 0); } /* @@ -2120,7 +2120,7 @@ ProcRenderCreateCursor (ClientPtr client) nxagentRenderRealizeCursor(pScreen, pCursor); - if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (AddResource(stuff->cid, RT_CURSOR, (void *)pCursor)) return (client->noClientException); return BadAlloc; } @@ -2324,7 +2324,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) pCursor -> devPriv[i] = NULL; } - if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (AddResource (stuff->cid, RT_CURSOR, (void *)pCursor)) return client->noClientException; return BadAlloc; } @@ -2370,7 +2370,7 @@ static int ProcRenderCreateSolidFill(ClientPtr client) nxagentRenderCreateSolidFill(pPicture, &stuff -> color); /* AGENT SERVER */ - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -2407,7 +2407,7 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) stuff->nStops, stops, colors); /* AGENT SERVER */ - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -2445,7 +2445,7 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) stuff->nStops, stops, colors); /* AGENT SERVER */ - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -2481,7 +2481,7 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) colors); /* AGENT SERVER */ - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c index d1c8325f2..833a33fd3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c @@ -170,7 +170,7 @@ typedef struct _Resource { struct _Resource *next; XID id; RESTYPE type; - pointer value; + void * value; } ResourceRec, *ResourcePtr; #define NullResource ((ResourcePtr)NULL) @@ -459,7 +459,7 @@ FakeClientID(register int client) #ifdef NXAGENT_SERVER -int nxagentFindClientResource(int client, RESTYPE type, pointer value) +int nxagentFindClientResource(int client, RESTYPE type, void * value) { ResourcePtr pResource; ResourcePtr *resources; @@ -488,7 +488,7 @@ int nxagentFindClientResource(int client, RESTYPE type, pointer value) return 0; } -int nxagentSwitchResourceType(int client, RESTYPE type, pointer value) +int nxagentSwitchResourceType(int client, RESTYPE type, void * value) { ResourcePtr pResource; ResourcePtr *resources; @@ -552,7 +552,7 @@ int nxagentSwitchResourceType(int client, RESTYPE type, pointer value) #endif Bool -AddResource(XID id, RESTYPE type, pointer value) +AddResource(XID id, RESTYPE type, void * value) { int client; register ClientResourceRec *rrec; @@ -753,7 +753,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) */ Bool -ChangeResourceValue (XID id, RESTYPE rtype, pointer value) +ChangeResourceValue (XID id, RESTYPE rtype, void * value) { int cid; register ResourcePtr res; @@ -785,7 +785,7 @@ FindClientResourcesByType( ClientPtr client, RESTYPE type, FindResType func, - pointer cdata + void * cdata ){ register ResourcePtr *resources; register ResourcePtr this, next; @@ -870,7 +870,7 @@ void FindAllClientResources( ClientPtr client, FindAllRes func, - pointer cdata + void * cdata ){ register ResourcePtr *resources; register ResourcePtr this, next; @@ -950,12 +950,12 @@ RestartLoop: } -pointer +void * LookupClientResourceComplex( ClientPtr client, RESTYPE type, FindComplexResType func, - pointer cdata + void * cdata ){ ResourcePtr *resources; ResourcePtr this; @@ -1126,12 +1126,12 @@ LegalNewID(XID id, register ClientPtr client) * else NULL is returned. */ -pointer +void * SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) { int cid; register ResourcePtr res; - pointer retval = NULL; + void * retval = NULL; assert(client == NullClient || (client->index <= currentMaxClients && clients[client->index] == client)); @@ -1155,12 +1155,12 @@ SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) } -pointer +void * SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) { int cid; register ResourcePtr res = NULL; - pointer retval = NULL; + void * retval = NULL; assert(client == NullClient || (client->index <= currentMaxClients && clients[client->index] == client)); @@ -1187,14 +1187,14 @@ SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) * macros because of compatibility with loadable servers. */ -pointer +void * LookupIDByType(XID id, RESTYPE rtype) { return SecurityLookupIDByType(NullClient, id, rtype, SecurityUnknownAccess); } -pointer +void * LookupIDByClass(XID id, RESTYPE classes) { return SecurityLookupIDByClass(NullClient, id, classes, @@ -1206,7 +1206,7 @@ LookupIDByClass(XID id, RESTYPE classes) /* * LookupIDByType returns the object with the given id and type, else NULL. */ -pointer +void * LookupIDByType(XID id, RESTYPE rtype) { int cid; @@ -1221,14 +1221,14 @@ LookupIDByType(XID id, RESTYPE rtype) if ((res->id == id) && (res->type == rtype)) return res->value; } - return (pointer)NULL; + return (void *)NULL; } /* * LookupIDByClass returns the object with the given id and any one of the * given classes, else NULL. */ -pointer +void * LookupIDByClass(XID id, RESTYPE classes) { int cid; @@ -1243,7 +1243,7 @@ LookupIDByClass(XID id, RESTYPE classes) if ((res->id == id) && (res->type & classes)) return res->value; } - return (pointer)NULL; + return (void *)NULL; } #endif /* XCSECURITY */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index 468dd480d..3b40b82f7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -128,7 +128,7 @@ static void miShmPutImage(XSHM_PUT_IMAGE_ARGS); static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS); static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); static int ShmDetachSegment( - pointer /* value */, + void * /* value */, XID /* shmseg */ ); static void ShmResetProc( @@ -361,7 +361,7 @@ ShmDestroyPixmap (PixmapPtr pPixmap) #else char *base = (char *) pPixmap->devPrivate.ptr; - if (base != (pointer) (pPixmap + 1)) + if (base != (void *) (pPixmap + 1)) { for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next) { @@ -373,7 +373,7 @@ ShmDestroyPixmap (PixmapPtr pPixmap) shmdesc = 0; #endif if (shmdesc) - ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id); + ShmDetachSegment ((void *) shmdesc, pPixmap->drawable.id); } pScreen->DestroyPixmap = destroyPixmap[pScreen->myNum]; @@ -520,7 +520,7 @@ ProcShmAttach(client) shmdesc->next = Shmsegs; Shmsegs = shmdesc; } - if (!AddResource(stuff->shmseg, ShmSegType, (pointer)shmdesc)) + if (!AddResource(stuff->shmseg, ShmSegType, (void *)shmdesc)) return BadAlloc; return(client->noClientException); } @@ -528,7 +528,7 @@ ProcShmAttach(client) /*ARGSUSED*/ static int ShmDetachSegment(value, shmseg) - pointer value; /* must conform to DeleteType */ + void * value; /* must conform to DeleteType */ XID shmseg; { ShmDescPtr shmdesc = (ShmDescPtr)value; @@ -618,7 +618,7 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) PixmapPtr pPixmap; pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, - BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data); + BitsPerPixel(depth), PixmapBytePad(w, depth), (void *)data); if (!pPixmap) return; if (format == XYBitmap) @@ -898,12 +898,12 @@ CreatePmap: if (pMap) { #ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; + pMap->devPrivates[shmPixmapPrivate].ptr = (void *) shmdesc; #endif shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = newPix->info[j].id; - if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) { + if (!AddResource(newPix->info[j].id, RT_PIXMAP, (void *)pMap)) { (*pScreen->DestroyPixmap)(pMap); result = BadAlloc; break; @@ -1173,7 +1173,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) #endif if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, - BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) + BitsPerPixel(depth), PixmapBytePad(width, depth), (void *)addr)) { #ifdef WARNING fprintf(stderr,"fbShmCreatePixmap: Return Null Pixmap.\n"); @@ -1251,12 +1251,12 @@ CreatePmap: if (pMap) { #ifdef PIXPRIV - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; + pMap->devPrivates[shmPixmapPrivate].ptr = (void *) shmdesc; #endif shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) + if (AddResource(stuff->pid, RT_PIXMAP, (void *)pMap)) { return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index bb28961d1..4017099e9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -249,7 +249,7 @@ PrintWindowTree() #endif int -TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, pointer data) +TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, void * data) { register int result; register WindowPtr pChild; @@ -284,7 +284,7 @@ TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, pointer data) *****/ int -WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, pointer data) +WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, void * data) { return(TraverseTree(WindowTable[pScreen->myNum], func, data)); } @@ -310,7 +310,7 @@ SetWindowToDefaults(register WindowPtr pWin) pWin->backingStore = NotUseful; pWin->DIXsaveUnder = FALSE; - pWin->backStorage = (pointer) NULL; + pWin->backStorage = (void *) NULL; pWin->mapped = FALSE; /* off */ pWin->realized = FALSE; /* off */ @@ -430,11 +430,11 @@ AllocateWindow(ScreenPtr pScreen) { if ( (size = *sizes) ) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } } return pWin; @@ -528,7 +528,7 @@ CreateRootWindow(ScreenPtr pScreen) pWin->border.pixel = pScreen->blackPixel; pWin->borderWidth = 0; - if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin)) + if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *)pWin)) return FALSE; if (disableBackingStore) @@ -1065,7 +1065,7 @@ CrushTree(WindowPtr pWin) *****/ int -DeleteWindow(pointer value, XID wid) +DeleteWindow(void * value, XID wid) { register WindowPtr pParent; register WindowPtr pWin = (WindowPtr)value; @@ -2798,7 +2798,7 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) static int CompareWIDs( WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ + void *value) /* must conform to VisitWindowProcPtr */ { Window *wid = (Window *)value; @@ -2823,7 +2823,7 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, register ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; - if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING) + if (TraverseTree(pWin, CompareWIDs, (void *)&pParent->drawable.id) == WT_STOPWALKING) return(BadMatch); if (!MakeWindowOptional(pWin)) return(BadAlloc); @@ -3791,7 +3791,7 @@ TileScreenSaver(int i, int kind) if (cursor) { cursorID = FakeClientID(0); - if (AddResource (cursorID, RT_CURSOR, (pointer) cursor)) + if (AddResource (cursorID, RT_CURSOR, (void *) cursor)) { attributes[attri] = cursorID; mask |= CWCursor; @@ -3822,7 +3822,7 @@ TileScreenSaver(int i, int kind) return FALSE; if (!AddResource(pWin->drawable.id, RT_WINDOW, - (pointer)savedScreenInfo[i].pWindow)) + (void *)savedScreenInfo[i].pWindow)) return FALSE; if (mask & CWBackPixmap) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index ad7e9c313..1dbd059ac 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -534,7 +534,7 @@ RegionPtr nxagentPixmapToRegion(PixmapPtr pPixmap) } Bool nxagentModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) + int bitsPerPixel, int devKind, void * pPixData) { PixmapPtr pVirtualPixmap; @@ -732,7 +732,7 @@ PixmapPtr nxagentPixmapPtr(Pixmap pixmap) * Reconnection stuff. */ -int nxagentDestroyNewPixmapResourceType(pointer p, XID id) +int nxagentDestroyNewPixmapResourceType(void * p, XID id) { /* * Address of the destructor is set in Init.c. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h b/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h index 98d5666d1..b42956fcf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h @@ -115,7 +115,7 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap); RegionPtr nxagentPixmapToRegion(PixmapPtr pPixmap); Bool nxagentModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData); + int bitsPerPixel, int devKind, void * pPixData); RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height); @@ -125,7 +125,7 @@ Bool nxagentReconnectAllPixmaps(void *p0); void nxagentDisconnectPixmap(void *p0, XID x1, void* p2); Bool nxagentDisconnectAllPixmaps(void); -int nxagentDestroyNewPixmapResourceType(pointer p, XID id); +int nxagentDestroyNewPixmapResourceType(void * p, XID id); void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, int wPict, int hPict); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index ca9959e81..c9f589c3b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -188,10 +188,10 @@ void nxagentFreeGlyphs(GlyphSetPtr glyphSet, CARD32 *gids, int nglyph); void nxagentFreeGlyphSet(GlyphSetPtr glyphSet); -void nxagentSetPictureTransform(PicturePtr pPicture, pointer transform); +void nxagentSetPictureTransform(PicturePtr pPicture, void * transform); void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, - pointer params, int nparams); + void * params, int nparams); Bool nxagentReconnectAllGlyphSet(void *p); @@ -2337,7 +2337,7 @@ void nxagentFreeGlyphs(GlyphSetPtr glyphSet, CARD32 *gids, int nglyph) } } -void nxagentSetPictureTransform(PicturePtr pPicture, pointer transform) +void nxagentSetPictureTransform(PicturePtr pPicture, void * transform) { #ifdef TEST fprintf(stderr, "nxagentSetPictureTransform: Going to set transform [%p] to picture at [%p].\n", @@ -2358,7 +2358,7 @@ FIXME: Is this useful or just a waste of bandwidth? } void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, - pointer params, int nparams) + void * params, int nparams) { char *szFilter = Xmalloc(name_size + 1); @@ -2561,7 +2561,7 @@ Bool nxagentReconnectAllGlyphSet(void *p) return success; } -void nxagentReconnectPicture(pointer p0, XID x1, void *p2) +void nxagentReconnectPicture(void * p0, XID x1, void *p2) { PicturePtr pPicture = (PicturePtr) p0; Bool *pBool = (Bool *) p2; @@ -2737,7 +2737,7 @@ Bool nxagentReconnectAllPicture(void *p) return True; } -void nxagentDisconnectPicture(pointer p0, XID x1, void* p2) +void nxagentDisconnectPicture(void * p0, XID x1, void* p2) { PicturePtr pPicture = (PicturePtr) p0; Bool *pBool = (Bool *) p2; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.h b/nx-X11/programs/Xserver/hw/nxagent/Render.h index 6f61ca85f..70f0ef20f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.h @@ -100,8 +100,8 @@ int nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, int nglyphs, CARD8 *images, int sizeImages); -void nxagentReconnectPicture(pointer p0, XID x1, void *p2); -void nxagentDisconnectPicture(pointer p0, XID x1, void* p2); +void nxagentReconnectPicture(void * p0, XID x1, void *p2); +void nxagentDisconnectPicture(void * p0, XID x1, void* p2); void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 74d2d1fe5..53a3b3fb7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -444,7 +444,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) Atom property, type; int format, mode; unsigned long nUnits; - pointer value; + void *value; { char *propertyS, *typeS; Atom propertyX, typeX; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.h b/nx-X11/programs/Xserver/hw/nxagent/Rootless.h index 1ea258db3..f502b54c3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.h @@ -63,7 +63,7 @@ void nxagentRootlessRestack(unsigned long *toplevel, unsigned int ntoplevel); int nxagentExportAllProperty(WindowPtr pWin); int nxagentExportProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long nUnits, pointer value); + int mode, unsigned long nUnits, void * value); #define MAX_RETRIEVED_PROPERTY_SIZE 256 * 1024 diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 37296e80f..095aa7b08 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -211,7 +211,7 @@ RegionRec nxagentShadowUpdateRegion; * but we need it here. */ -int TellChanged(WindowPtr pWin, pointer value); +int TellChanged(WindowPtr pWin, void * value); int nxagentBitsPerPixel(int depth) { @@ -664,7 +664,7 @@ void nxagentInitViewportFrame(ScreenPtr pScreen, WindowPtr pRootWin) pRootWin -> drawable.depth, serverClient, visual, &error); - AddResource(xid, RT_WINDOW, (pointer) nxagentViewportFrameLeft); + AddResource(xid, RT_WINDOW, (void *) nxagentViewportFrameLeft); if (error != Success) { @@ -689,7 +689,7 @@ void nxagentInitViewportFrame(ScreenPtr pScreen, WindowPtr pRootWin) serverClient, visual, &error); - AddResource(xid, RT_WINDOW, (pointer) nxagentViewportFrameRight); + AddResource(xid, RT_WINDOW, (void *) nxagentViewportFrameRight); if (error != Success) { @@ -714,7 +714,7 @@ void nxagentInitViewportFrame(ScreenPtr pScreen, WindowPtr pRootWin) serverClient, visual, &error); - AddResource(xid, RT_WINDOW, (pointer) nxagentViewportFrameAbove); + AddResource(xid, RT_WINDOW, (void *) nxagentViewportFrameAbove); if (error != Success) { @@ -739,7 +739,7 @@ void nxagentInitViewportFrame(ScreenPtr pScreen, WindowPtr pRootWin) pRootWin -> drawable.depth, serverClient, visual, &error); - AddResource(xid, RT_WINDOW, (pointer) nxagentViewportFrameBelow); + AddResource(xid, RT_WINDOW, (void *) nxagentViewportFrameBelow); if (error != Success) { @@ -835,7 +835,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, VisualID defaultVisual; int rootDepth; - pointer pFrameBufferBits; + void * pFrameBufferBits; int bitsPerPixel; int sizeInBytes; @@ -2423,7 +2423,7 @@ FIXME: We should try to restore the previously nxagentMoveViewport(pScreen, 0, 0); /* - * Update pointer bounds. + * Update void * bounds. */ ScreenRestructured(pScreen); @@ -2773,11 +2773,11 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) accessPixmapID = FakeClientID(serverClient -> index); - AddResource(accessPixmapID, RT_PIXMAP, (pointer)nxagentShadowPixmapPtr); + AddResource(accessPixmapID, RT_PIXMAP, (void *)nxagentShadowPixmapPtr); accessWindowID = FakeClientID(serverClient -> index); - AddResource(accessWindowID, RT_WINDOW, (pointer)nxagentShadowWindowPtr); + AddResource(accessWindowID, RT_WINDOW, (void *)nxagentShadowWindowPtr); nxagentResizeScreen(pScreen, nxagentShadowWidth, nxagentShadowHeight, pScreen -> mmWidth, pScreen -> mmHeight); @@ -2847,7 +2847,7 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width, if (nxagentShadowPixmapPtr) { - ChangeResourceValue(accessPixmapID, RT_PIXMAP, (pointer) nxagentShadowPixmapPtr); + ChangeResourceValue(accessPixmapID, RT_PIXMAP, (void *) nxagentShadowPixmapPtr); nxagentShadowPixmapPtr -> drawable.id = accessPixmapID; #ifdef TEST @@ -2933,7 +2933,7 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width, #endif - ChangeResourceValue(accessWindowID, RT_WINDOW, (pointer) nxagentShadowWindowPtr); + ChangeResourceValue(accessWindowID, RT_WINDOW, (void *) nxagentShadowWindowPtr); } else { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index c4aedf482..782ab9c9c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -162,19 +162,19 @@ static Bool nxagentSomeWindowsAreMapped(void); static void nxagentFrameBufferPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); -static void nxagentTraverseWindow(WindowPtr, void(*)(pointer, XID, pointer), pointer); +static void nxagentTraverseWindow(WindowPtr, void(*)(void *, XID, void *), void *); -static void nxagentDisconnectWindow(pointer, XID, pointer); +static void nxagentDisconnectWindow(void *, XID, void *); -static Bool nxagentLoopOverWindows(void(*)(pointer, XID, pointer)); +static Bool nxagentLoopOverWindows(void(*)(void *, XID, void *)); -static void nxagentReconfigureWindowCursor(pointer, XID, pointer); +static void nxagentReconfigureWindowCursor(void *, XID, void *); -static void nxagentReconnectWindow(pointer, XID, pointer); +static void nxagentReconnectWindow(void *, XID, void *); -static void nxagentReconfigureWindow(pointer, XID, pointer); +static void nxagentReconfigureWindow(void *, XID, void *); -static int nxagentForceExposure(WindowPtr pWin, pointer ptr); +static int nxagentForceExposure(WindowPtr pWin, void * ptr); /* by dimbor */ typedef struct @@ -218,7 +218,7 @@ WindowPtr nxagentGetWindowFromID(Window id) return NULL; } -static int nxagentFindWindowMatch(WindowPtr pWin, pointer ptr) +static int nxagentFindWindowMatch(WindowPtr pWin, void * ptr) { WindowMatchRec *match = (WindowMatchRec *) ptr; @@ -245,7 +245,7 @@ WindowPtr nxagentWindowPtr(Window window) for (i = 0; i < nxagentNumScreens; i++) { - WalkTree(screenInfo.screens[i], nxagentFindWindowMatch, (pointer) &match); + WalkTree(screenInfo.screens[i], nxagentFindWindowMatch, (void *) &match); if (match.pWin) break; } @@ -2437,7 +2437,7 @@ void nxagentShapeWindow(WindowPtr pWin) } #endif /* SHAPE */ -static int nxagentForceExposure(WindowPtr pWin, pointer ptr) +static int nxagentForceExposure(WindowPtr pWin, void * ptr) { RegionPtr exposedRgn; BoxRec Box; @@ -2623,12 +2623,12 @@ Bool nxagentDisconnectAllWindows(void) } /* - * FIXME: We are giving up reconnecting those pointer + * FIXME: We are giving up reconnecting those void * * that are not resource, and we are just disconnecting them. * perhaps we could do better and reconnect them. */ -void nxagentDisconnectWindow(pointer p0, XID x1, pointer p2) +void nxagentDisconnectWindow(void * p0, XID x1, void * p2) { WindowPtr pWin = (WindowPtr)p0; Bool* pBool = (Bool*)p2; @@ -2828,8 +2828,8 @@ Bool nxagentSetWindowCursors(void *p0) static void nxagentTraverseWindow( WindowPtr pWin, - void (*pF)(pointer, XID, pointer), - pointer p) + void (*pF)(void *, XID, void *), + void * p) { pF(pWin, 0, p); @@ -2844,7 +2844,7 @@ static void nxagentTraverseWindow( } } -static Bool nxagentLoopOverWindows(void (*pF)(pointer, XID, pointer)) +static Bool nxagentLoopOverWindows(void (*pF)(void *, XID, void *)) { int i; Bool windowSuccess = True; @@ -2859,7 +2859,7 @@ static Bool nxagentLoopOverWindows(void (*pF)(pointer, XID, pointer)) return windowSuccess; } -static void nxagentReconnectWindow(pointer param0, XID param1, pointer data_buffer) +static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer) { WindowPtr pWin = (WindowPtr)param0; Bool *pBool = (Bool*)data_buffer; @@ -3113,7 +3113,7 @@ FIXME: Do we need to set save unders attribute here? } } -static void nxagentReconfigureWindowCursor(pointer param0, XID param1, pointer data_buffer) +static void nxagentReconfigureWindowCursor(void * param0, XID param1, void * data_buffer) { WindowPtr pWin = (WindowPtr)param0; Bool *pBool = (Bool*)data_buffer; @@ -3164,7 +3164,7 @@ static void nxagentReconfigureWindowCursor(pointer param0, XID param1, pointer d } } -static void nxagentReconfigureWindow(pointer param0, XID param1, pointer data_buffer) +static void nxagentReconfigureWindow(void * param0, XID param1, void * data_buffer) { WindowPtr pWin = (WindowPtr)param0; unsigned long mask = 0; @@ -3732,7 +3732,7 @@ StaticResizedWindowStruct *nxagentFindStaticResizedWindow(unsigned long sequence return ret; } -void nxagentEmptyBackingStoreRegion(pointer param0, XID param1, pointer data_buffer) +void nxagentEmptyBackingStoreRegion(void * param0, XID param1, void * data_buffer) { WindowPtr pWin = (WindowPtr) param0; diff --git a/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h b/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h index c4090dc16..1322e72ee 100644 --- a/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h +++ b/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h @@ -268,7 +268,7 @@ extern int xf86vsnprintf(char*,xf86size_t,const char*,va_list); extern int xf86open(const char*, int,...); extern int xf86close(int); extern long xf86lseek(int, long, int); -extern int xf86ioctl(int, unsigned long, pointer); +extern int xf86ioctl(int, unsigned long, void *); extern xf86ssize_t xf86read(int, void *, xf86size_t); extern xf86ssize_t xf86write(int, const void *, xf86size_t); extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */); @@ -306,7 +306,7 @@ unsigned int xf86sleep(unsigned int seconds); extern int xf86shmget(xf86key_t key, int size, int xf86shmflg); extern char * xf86shmat(int id, char *addr, int xf86shmflg); extern int xf86shmdt(char *addr); -extern int xf86shmctl(int id, int xf86cmd, pointer buf); +extern int xf86shmctl(int id, int xf86cmd, void * buf); extern int xf86setjmp(xf86jmp_buf env); extern int xf86setjmp0(xf86jmp_buf env); diff --git a/nx-X11/programs/Xserver/include/closestr.h b/nx-X11/programs/Xserver/include/closestr.h index d70f754b2..c06010113 100644 --- a/nx-X11/programs/Xserver/include/closestr.h +++ b/nx-X11/programs/Xserver/include/closestr.h @@ -69,7 +69,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/colormap.h b/nx-X11/programs/Xserver/include/colormap.h index 1f2c33075..d519bb782 100644 --- a/nx-X11/programs/Xserver/include/colormap.h +++ b/nx-X11/programs/Xserver/include/colormap.h @@ -87,16 +87,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 +140,7 @@ extern int QueryColors( xrgb* /*prgbList*/); extern int FreeClientPixels( - pointer /*pcr*/, + void * /*pcr*/, XID /*fakeid*/); extern int AllocColorCells( diff --git a/nx-X11/programs/Xserver/include/colormapst.h b/nx-X11/programs/Xserver/include/colormapst.h index 5ceee9870..6b52b8350 100644 --- a/nx-X11/programs/Xserver/include/colormapst.h +++ b/nx-X11/programs/Xserver/include/colormapst.h @@ -113,7 +113,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..9e760df02 100644 --- a/nx-X11/programs/Xserver/include/cursor.h +++ b/nx-X11/programs/Xserver/include/cursor.h @@ -68,7 +68,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..894467289 100644 --- a/nx-X11/programs/Xserver/include/cursorstr.h +++ b/nx-X11/programs/Xserver/include/cursorstr.h @@ -65,7 +65,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 +76,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; diff --git a/nx-X11/programs/Xserver/include/dix.h b/nx-X11/programs/Xserver/include/dix.h index 9fe575e53..25260e46c 100644 --- a/nx-X11/programs/Xserver/include/dix.h +++ b/nx-X11/programs/Xserver/include/dix.h @@ -330,7 +330,7 @@ extern void InitSelections(void); extern void FlushClientCaches(XID /*id*/); extern int dixDestroyPixmap( - pointer /*value*/, + void * /*value*/, XID /*pid*/); extern void CloseDownRetainedResources(void); @@ -338,10 +338,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*/, @@ -403,7 +403,7 @@ extern WindowPtr SecurityLookupWindow( ClientPtr /*client*/, Mask /*access_mode*/); -extern pointer SecurityLookupDrawable( +extern void * SecurityLookupDrawable( XID /*rid*/, ClientPtr /*client*/, Mask /*access_mode*/); @@ -412,7 +412,7 @@ extern WindowPtr LookupWindow( XID /*rid*/, ClientPtr /*client*/); -extern pointer LookupDrawable( +extern void * LookupDrawable( XID /*rid*/, ClientPtr /*client*/); @@ -422,7 +422,7 @@ extern WindowPtr LookupWindow( XID /*rid*/, ClientPtr /*client*/); -extern pointer LookupDrawable( +extern void * LookupDrawable( XID /*rid*/, ClientPtr /*client*/); @@ -451,27 +451,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); @@ -482,19 +482,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___ @@ -634,7 +634,7 @@ extern void RecalculateDeliverableEvents( WindowPtr /* pWin */); extern int OtherClientGone( - pointer /* value */, + void * /* value */, XID /* id */); extern void DoFocusEvents( @@ -723,16 +723,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 *); @@ -751,16 +751,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/dixfont.h b/nx-X11/programs/Xserver/include/dixfont.h index c6b8676da..9fcf0d585 100644 --- a/nx-X11/programs/Xserver/include/dixfont.h +++ b/nx-X11/programs/Xserver/include/dixfont.h @@ -45,9 +45,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 +55,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; diff --git a/nx-X11/programs/Xserver/include/dixgrabs.h b/nx-X11/programs/Xserver/include/dixgrabs.h index 042e063db..c05447c71 100644 --- a/nx-X11/programs/Xserver/include/dixgrabs.h +++ b/nx-X11/programs/Xserver/include/dixgrabs.h @@ -43,7 +43,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..53c78d2de 100644 --- a/nx-X11/programs/Xserver/include/dixstruct.h +++ b/nx-X11/programs/Xserver/include/dixstruct.h @@ -93,8 +93,8 @@ 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; ReplySwapPtr pSwapReplyFunc; XID errorValue; @@ -109,7 +109,7 @@ typedef struct _Client { GContext lastGCID; SaveSetElt *saveSet; int numSaved; - pointer screenPrivate[MAXSCREENS]; + void *screenPrivate[MAXSCREENS]; int (**requestVector) ( ClientPtr /* pClient */); CARD32 req_len; /* length of current request */ @@ -136,12 +136,12 @@ typedef struct _Client { #ifdef XCSECURITY XID authId; unsigned int trustLevel; - pointer (* CheckAccess)( + void * (* CheckAccess)( ClientPtr /*pClient*/, XID /*id*/, RESTYPE /*classes*/, Mask /*access_mode*/, - pointer /*resourceval*/); + void * /*resourceval*/); #endif #ifdef XAPPGROUP struct _AppGroupRec* appgroup; @@ -187,10 +187,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 +204,7 @@ extern TimeStamp ClientTimeToServerTime(CARD32 /*c*/); typedef struct _CallbackRec { CallbackProcPtr proc; - pointer data; + void * data; Bool deleted; struct _CallbackRec *next; } CallbackRec, *CallbackPtr; diff --git a/nx-X11/programs/Xserver/include/extnsionst.h b/nx-X11/programs/Xserver/include/extnsionst.h index daf37bf43..218ce8a7a 100644 --- a/nx-X11/programs/Xserver/include/extnsionst.h +++ b/nx-X11/programs/Xserver/include/extnsionst.h @@ -67,7 +67,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..1c0c90d3e 100644 --- a/nx-X11/programs/Xserver/include/gc.h +++ b/nx-X11/programs/Xserver/include/gc.h @@ -51,7 +51,13 @@ SOFTWARE. #define GC_H #include /* for GContext, Mask */ + +#ifndef _XTYPEDEF_POINTER +/* Don't let Xdefs.h define 'pointer' */ +#define _XTYPEDEF_POINTER 1 +#endif /* _XTYPEDEF_POINTER */ #include /* for Bool */ + #include #include "screenint.h" /* for ScreenPtr */ #include "pixmap.h" /* for DrawablePtr */ @@ -103,7 +109,7 @@ extern int DoChangeGC( typedef union { CARD32 val; - pointer ptr; + void * ptr; } ChangeGCVal, *ChangeGCValPtr; extern int dixChangeGC( @@ -125,7 +131,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..16779f692 100644 --- a/nx-X11/programs/Xserver/include/gcstruct.h +++ b/nx-X11/programs/Xserver/include/gcstruct.h @@ -85,7 +85,7 @@ typedef struct _GCFuncs { void (* ChangeClip)( GCPtr /*pGC*/, int /*type*/, - pointer /*pvalue*/, + void * /*pvalue*/, int /*nrects*/); void (* DestroyClip)( @@ -244,7 +244,7 @@ typedef struct _GCOps { int /*y*/, unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/); + void * /*pglyphBase*/); void (* PolyGlyphBlt)( DrawablePtr /*pDrawable*/, @@ -253,7 +253,7 @@ typedef struct _GCOps { int /*y*/, unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/); + void * /*pglyphBase*/); void (* PushPixels)( GCPtr /*pGC*/, @@ -309,7 +309,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_ */ unsigned long serialNumber; GCFuncs *funcs; diff --git a/nx-X11/programs/Xserver/include/input.h b/nx-X11/programs/Xserver/include/input.h index bcaa01e6f..88cc98050 100644 --- a/nx-X11/programs/Xserver/include/input.h +++ b/nx-X11/programs/Xserver/include/input.h @@ -104,7 +104,7 @@ typedef void (*DeviceUnwrapProc)( ); typedef struct _DeviceRec { - pointer devicePrivate; + void * devicePrivate; ProcessInputProc processInputProc; /* current */ ProcessInputProc realInputProc; /* deliver */ ProcessInputProc enqueueInputProc; /* enqueue */ @@ -255,7 +255,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/misc.h b/nx-X11/programs/Xserver/include/misc.h index 849f1b5cc..1576f1433 100644 --- a/nx-X11/programs/Xserver/include/misc.h +++ b/nx-X11/programs/Xserver/include/misc.h @@ -81,6 +81,11 @@ extern unsigned long serverGeneration; #include #include #include + +#ifndef _XTYPEDEF_POINTER +/* Don't let Xdefs.h define 'pointer' */ +#define _XTYPEDEF_POINTER 1 +#endif /* _XTYPEDEF_POINTER */ #include #ifndef IN_MODULE diff --git a/nx-X11/programs/Xserver/include/miscstruct.h b/nx-X11/programs/Xserver/include/miscstruct.h index 6a16007b7..87874aae4 100644 --- a/nx-X11/programs/Xserver/include/miscstruct.h +++ b/nx-X11/programs/Xserver/include/miscstruct.h @@ -61,7 +61,7 @@ typedef struct _Box { } BoxRec; typedef union _DevUnion { - pointer ptr; + void * ptr; long val; unsigned long uval; RegionPtr (*fptr)( diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 0b3354eec..551b35097 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -53,7 +53,7 @@ SOFTWARE. #include "misc.h" #define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size)) -#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((pointer)(_ptr)) +#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((void *)(_ptr)) #include #ifndef IN_MODULE #include @@ -75,19 +75,19 @@ SOFTWARE. #define MAX_BIG_REQUEST_SIZE 4194303 #endif -typedef pointer FID; +typedef void * FID; typedef struct _FontPathRec *FontPathPtr; typedef struct _NewClientRec *NewClientPtr; #ifndef xalloc #define xnfalloc(size) XNFalloc((unsigned long)(size)) #define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size)) -#define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size)) +#define 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 xrealloc(ptr, size) Xrealloc((void *)(ptr), (unsigned long)(size)) +#define xfree(ptr) Xfree((void *)(ptr)) #define xstrdup(s) Xstrdup(s) #define xnfstrdup(s) XNFstrdup(s) #endif @@ -158,7 +158,7 @@ extern char *ClientAuthorized( extern Bool EstablishNewConnections( ClientPtr /*clientUnused*/, - pointer /*closure*/); + void * /*closure*/); extern void CheckConnections(void); @@ -189,7 +189,7 @@ 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 +197,7 @@ typedef struct _OsTimerRec *OsTimerPtr; typedef CARD32 (*OsTimerCallback)( OsTimerPtr /* timer */, CARD32 /* time */, - pointer /* arg */); + void * /* arg */); extern void TimerInit(void); @@ -211,7 +211,7 @@ extern OsTimerPtr TimerSet( int /* flags */, CARD32 /* millis */, OsTimerCallback /* func */, - pointer /* arg */); + void * /* arg */); extern void TimerCheck(void); extern void TimerCancel(OsTimerPtr /* pTimer */); @@ -238,19 +238,19 @@ extern void ProcessCommandLine(int /*argc*/, char* /*argv*/[]); extern int set_font_authorizations( char ** /* authorizations */, int * /*authlen */, - pointer /* client */); + void * /* 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*/); +extern void * Xalloc(unsigned long /*amount*/); +extern void * Xcalloc(unsigned long /*amount*/); +extern void * Xrealloc(void * /*ptr*/, unsigned long /*amount*/); +extern void Xfree(void * /*ptr*/); #endif -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); @@ -296,10 +296,10 @@ void OsReleaseSignals (void); #if !defined(WIN32) && !defined(__UNIXOS2__) 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 +315,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*/); @@ -362,7 +362,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 +467,7 @@ typedef struct { extern CallbackListPtr ReplyCallback; typedef struct { ClientPtr client; - pointer replyData; + void * replyData; unsigned long dataLenBytes; unsigned long bytesRemaining; Bool startOfReply; diff --git a/nx-X11/programs/Xserver/include/pixmap.h b/nx-X11/programs/Xserver/include/pixmap.h index 6cea329ec..3c9f91a00 100644 --- a/nx-X11/programs/Xserver/include/pixmap.h +++ b/nx-X11/programs/Xserver/include/pixmap.h @@ -92,7 +92,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/property.h b/nx-X11/programs/Xserver/include/property.h index 21a38d51c..080d52937 100644 --- a/nx-X11/programs/Xserver/include/property.h +++ b/nx-X11/programs/Xserver/include/property.h @@ -61,7 +61,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..8f9abd5f8 100644 --- a/nx-X11/programs/Xserver/include/propertyst.h +++ b/nx-X11/programs/Xserver/include/propertyst.h @@ -61,7 +61,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 */ + void *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 diff --git a/nx-X11/programs/Xserver/include/resource.h b/nx-X11/programs/Xserver/include/resource.h index 49c189869..3aac8bb00 100644 --- a/nx-X11/programs/Xserver/include/resource.h +++ b/nx-X11/programs/Xserver/include/resource.h @@ -123,24 +123,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 +161,7 @@ extern XID FakeClientID( extern Bool AddResource( XID /*id*/, RESTYPE /*type*/, - pointer /*value*/); + void * /*value*/); extern void FreeResource( XID /*id*/, @@ -175,18 +175,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 +200,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 @@ -229,13 +229,13 @@ extern pointer LookupClientResourceComplex( #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/scrnintstr.h b/nx-X11/programs/Xserver/include/scrnintstr.h index ef9358689..297227493 100644 --- a/nx-X11/programs/Xserver/include/scrnintstr.h +++ b/nx-X11/programs/Xserver/include/scrnintstr.h @@ -85,8 +85,8 @@ 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. */ @@ -431,15 +431,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 +451,7 @@ typedef Bool (* ModifyPixmapHeaderProcPtr)( int /*depth*/, int /*bitsPerPixel*/, int /*devKind*/, - pointer /*pPixData*/); + void * /*pPixData*/); typedef PixmapPtr (* GetWindowPixmapProcPtr)( WindowPtr /*pWin*/); @@ -546,7 +546,7 @@ typedef struct _Screen { a standard one. */ PixmapPtr PixmapPerDepth[1]; - pointer devPrivate; + void * devPrivate; short numVisuals; VisualPtr visuals; int WindowPrivateLen; @@ -668,8 +668,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; diff --git a/nx-X11/programs/Xserver/include/window.h b/nx-X11/programs/Xserver/include/window.h index 7c3fce092..cbfed645f 100644 --- a/nx-X11/programs/Xserver/include/window.h +++ b/nx-X11/programs/Xserver/include/window.h @@ -73,17 +73,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*/); @@ -122,7 +122,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..dab6fcf71 100644 --- a/nx-X11/programs/Xserver/include/windowstr.h +++ b/nx-X11/programs/Xserver/include/windowstr.h @@ -114,7 +114,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; diff --git a/nx-X11/programs/Xserver/mfb/maskbits.h b/nx-X11/programs/Xserver/mfb/maskbits.h index ed5cc2687..7e2b74a18 100644 --- a/nx-X11/programs/Xserver/mfb/maskbits.h +++ b/nx-X11/programs/Xserver/mfb/maskbits.h @@ -534,7 +534,7 @@ extern PixelType mfbGetmask(int); #endif #if GETLEFTBITS_ALIGNMENT == 1 -#define getleftbits(psrc, w, dst) dst = *((CARD32 *)(pointer) psrc) +#define getleftbits(psrc, w, dst) dst = *((CARD32 *)(void *) psrc) #endif /* GETLEFTBITS_ALIGNMENT == 1 */ #if GETLEFTBITS_ALIGNMENT == 2 diff --git a/nx-X11/programs/Xserver/mi/mi.h b/nx-X11/programs/Xserver/mi/mi.h index 3c85693dc..0f3f5778f 100644 --- a/nx-X11/programs/Xserver/mi/mi.h +++ b/nx-X11/programs/Xserver/mi/mi.h @@ -263,7 +263,7 @@ extern void miPolyGlyphBlt( int /*y*/, unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ + void * /*pglyphBase*/ ); extern void miImageGlyphBlt( @@ -273,7 +273,7 @@ extern void miImageGlyphBlt( int /*y*/, unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/ + void * /*pglyphBase*/ ); /* mipoly.c */ @@ -438,7 +438,7 @@ extern Bool miModifyPixmapHeader( int /*depth*/, int /*bitsPerPixel*/, int /*devKind*/, - pointer /*pPixData*/ + void * /*pPixData*/ ); extern Bool miCloseScreen( @@ -453,12 +453,12 @@ extern Bool miCreateScreenResources( extern Bool miScreenDevPrivateInit( ScreenPtr /*pScreen*/, int /*width*/, - pointer /*pbits*/ + void * /*pbits*/ ); extern Bool miScreenInit( ScreenPtr /*pScreen*/, - pointer /*pbits*/, + void * /*pbits*/, int /*xsize*/, int /*ysize*/, int /*dpix*/, diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c index 08f09b628..f06c4b51d 100644 --- a/nx-X11/programs/Xserver/mi/miarc.c +++ b/nx-X11/programs/Xserver/mi/miarc.c @@ -435,7 +435,7 @@ static RESTYPE cacheType; /*ARGSUSED*/ int miFreeArcCache (data, id) - pointer data; + void * data; XID id; { int k; @@ -1691,7 +1691,7 @@ miGetArcPts( count++; cdt = 2 * miDcos(dt); - if (!(poly = (SppPointPtr) xrealloc((pointer)*ppPts, + if (!(poly = (SppPointPtr) xrealloc((void *)*ppPts, (cpt + count) * sizeof(SppPointRec)))) return(0); *ppPts = poly; diff --git a/nx-X11/programs/Xserver/mi/mibank.c b/nx-X11/programs/Xserver/mi/mibank.c index b09f9fd7c..b5da2267f 100644 --- a/nx-X11/programs/Xserver/mi/mibank.c +++ b/nx-X11/programs/Xserver/mi/mibank.c @@ -111,7 +111,7 @@ typedef struct _miBankScreen int nBanks, maxRects; RegionPtr *pBanks; - pointer pbits; + void *pbits; /* * Screen Wrappers @@ -192,11 +192,11 @@ static unsigned long miBankGeneration = 0; #define BANK_GCPRIVATE(pGC) ((miBankGCPtr)(BANK_GCPRIVLVAL(pGC))) #define PIXMAP_STATUS(_pPix) \ - pointer pbits = (_pPix)->devPrivate.ptr + void * pbits = (_pPix)->devPrivate.ptr #define PIXMAP_SAVE(_pPix) \ PIXMAP_STATUS(_pPix); \ - if (pbits == (pointer)pScreenPriv) \ + if (pbits == (void *)pScreenPriv) \ (_pPix)->devPrivate.ptr = pScreenPriv->pbits #define PIXMAP_RESTORE(_pPix) \ @@ -247,7 +247,7 @@ static unsigned long miBankGeneration = 0; (pGC)->funcs = pGCPriv->unwrappedFuncs #define IS_BANKED(pDrawable) \ - ((pbits == (pointer)pScreenPriv) && \ + ((pbits == (void *)pScreenPriv) && \ (((DrawablePtr)(pDrawable))->type == DRAWABLE_WINDOW)) #define CLIP_SAVE \ @@ -1267,7 +1267,7 @@ miBankImageGlyphBlt( int y, unsigned int nArray, CharInfoPtr *ppci, - pointer pglyphBase + void *pglyphBase ) { GCOP_SIMPLE((*pGC->ops->ImageGlyphBlt)(pDrawable, pGC, @@ -1282,7 +1282,7 @@ miBankPolyGlyphBlt( int y, unsigned int nArray, CharInfoPtr *ppci, - pointer pglyphBase + void *pglyphBase ) { GCOP_SIMPLE((*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, @@ -1539,7 +1539,7 @@ static void miBankChangeClip( GCPtr pGC, int type, - pointer pvalue, + void * pvalue, int nrects ) { @@ -1608,7 +1608,7 @@ miBankCreateScreenResources( /* Set screen buffer address to something recognizable */ pScreenPriv->pScreenPixmap = (*pScreen->GetScreenPixmap)(pScreen); pScreenPriv->pbits = pScreenPriv->pScreenPixmap->devPrivate.ptr; - pScreenPriv->pScreenPixmap->devPrivate.ptr = (pointer)pScreenPriv; + pScreenPriv->pScreenPixmap->devPrivate.ptr = (void *)pScreenPriv; /* Get shadow pixmap; width & height of 0 means no pixmap data */ pScreenPriv->pBankPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, @@ -1657,7 +1657,7 @@ miBankModifyPixmapHeader( int depth, int bitsPerPixel, int devKind, - pointer pPixData + void *pPixData ) { Bool retval = FALSE; @@ -1675,7 +1675,7 @@ miBankModifyPixmapHeader( SCREEN_WRAP(ModifyPixmapHeader, miBankModifyPixmapHeader); - if (pbits == (pointer)pScreenPriv) + if (pbits == (void *)pScreenPriv) { pScreenPriv->pbits = pPixmap->devPrivate.ptr; pPixmap->devPrivate.ptr = pbits; @@ -2395,7 +2395,7 @@ miInitializeBanking( pScreen->BackingStoreFuncs.SetClipmaskRgn = miBankSetClipmaskRgn; ?????????????????????????????????????????????????????????????? */ - BANK_SCRPRIVLVAL = (pointer)pScreenPriv; + BANK_SCRPRIVLVAL = (void *)pScreenPriv; return TRUE; } @@ -2405,7 +2405,7 @@ miInitializeBanking( static int miBankNewSerialNumber( WindowPtr pWin, - pointer unused + void *unused ) { pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; diff --git a/nx-X11/programs/Xserver/mi/mibank.h b/nx-X11/programs/Xserver/mi/mibank.h index cf27d1fae..26b33305a 100644 --- a/nx-X11/programs/Xserver/mi/mibank.h +++ b/nx-X11/programs/Xserver/mi/mibank.h @@ -70,8 +70,8 @@ typedef struct _miBankInfo miBankProcPtr SetDestinationBank; /* Set pBankB bank number */ miBankProcPtr SetSourceAndDestinationBanks; /* Set both bank numbers */ - pointer pBankA; /* First aperture location */ - pointer pBankB; /* First or second aperture location */ + void * pBankA; /* First aperture location */ + void * pBankB; /* First or second aperture location */ /* * BankSize is in units of sizeof(char) and is the size of each bank. diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index 98947217c..f18648f66 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -228,7 +228,7 @@ static void miBSValidateGC(GCPtr pGC, unsigned long stateChanges, static void miBSCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); static void miBSDestroyGC(GCPtr pGC); static void miBSChangeGC(GCPtr pGC, unsigned long mask); -static void miBSChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects); +static void miBSChangeClip(GCPtr pGC, int type, void * pvalue, int nrects); static void miBSDestroyClip(GCPtr pGC); static void miBSCopyClip(GCPtr pgcDst, GCPtr pgcSrc); @@ -286,10 +286,10 @@ static void miBSImageText16(DrawablePtr pDrawable, GCPtr pGC, unsigned short *chars); static void miBSImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase); + CharInfoPtr *ppci, void * pglyphBase); static void miBSPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase); + CharInfoPtr *ppci, void * pglyphBase); static void miBSPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, int w, int h, int x, int y); @@ -330,7 +330,7 @@ static void miBSCheapValidateGC(GCPtr pGC, unsigned long stateChanges, static void miBSCheapCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); static void miBSCheapDestroyGC(GCPtr pGC); static void miBSCheapChangeGC(GCPtr pGC, unsigned long mask); -static void miBSCheapChangeClip(GCPtr pGC, int type, pointer pvalue, +static void miBSCheapChangeClip(GCPtr pGC, int type, void * pvalue, int nrects); static void miBSCheapDestroyClip(GCPtr pGC); static void miBSCheapCopyClip(GCPtr pgcDst, GCPtr pgcSrc); @@ -398,7 +398,7 @@ miInitializeBackingStore (pScreen) pScreen->ClearBackingStore = miBSClearBackingStore; pScreen->DrawGuarantee = miBSDrawGuarantee; - pScreen->devPrivates[miBSScreenIndex].ptr = (pointer) pScreenPriv; + pScreen->devPrivates[miBSScreenIndex].ptr = (void *) pScreenPriv; } /* @@ -433,7 +433,7 @@ miBSCloseScreen (i, pScreen) pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes; pScreen->CreateGC = pScreenPriv->CreateGC; - xfree ((pointer) pScreenPriv); + xfree ((void *) pScreenPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -765,7 +765,7 @@ miBSCreateGC (pGC) if ( (ret = (*pScreen->CreateGC) (pGC)) ) { - pGC->devPrivates[miBSGCIndex].ptr = (pointer) pGC->funcs; + pGC->devPrivates[miBSGCIndex].ptr = (void *) pGC->funcs; pGC->funcs = &miBSCheapGCFuncs; } @@ -816,7 +816,7 @@ miBSCheapValidateGC (pGC, stateChanges, pDrawable) (*pGC->funcs->ValidateGC) (pGC, stateChanges, pDrawable); /* rewrap funcs as Validate may have changed them */ - pGC->devPrivates[miBSGCIndex].ptr = (pointer) pGC->funcs; + pGC->devPrivates[miBSGCIndex].ptr = (void *) pGC->funcs; CHEAP_FUNC_EPILOGUE (pGC); } @@ -861,7 +861,7 @@ static void miBSCheapChangeClip (pGC, type, pvalue, nrects) GCPtr pGC; int type; - pointer pvalue; + void * pvalue; int nrects; { CHEAP_FUNC_PROLOGUE (pGC); @@ -914,7 +914,7 @@ miBSCreateGCPrivate (pGC) pPriv->wrapFuncs = pGC->funcs; pGC->funcs = &miBSGCFuncs; pGC->ops = &miBSGCOps; - pGC->devPrivates[miBSGCIndex].ptr = (pointer) pPriv; + pGC->devPrivates[miBSGCIndex].ptr = (void *) pPriv; return TRUE; } @@ -926,12 +926,12 @@ miBSDestroyGCPrivate (GCPtr pGC) pPriv = (miBSGCRec *) pGC->devPrivates[miBSGCIndex].ptr; if (pPriv) { - pGC->devPrivates[miBSGCIndex].ptr = (pointer) pPriv->wrapFuncs; + pGC->devPrivates[miBSGCIndex].ptr = (void *) pPriv->wrapFuncs; pGC->funcs = &miBSCheapGCFuncs; pGC->ops = pPriv->wrapOps; if (pPriv->pBackingGC) FreeGC (pPriv->pBackingGC, (GContext) 0); - xfree ((pointer) pPriv); + xfree ((void *) pPriv); } } @@ -2157,7 +2157,7 @@ miBSImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int x, y; unsigned int nglyph; CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ + void * pglyphBase; /* start of array of glyphs */ { SETUP_BACKING (pDrawable, pGC); PROLOGUE(pGC); @@ -2189,7 +2189,7 @@ miBSPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int x, y; unsigned int nglyph; CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ + void * pglyphBase; /* start of array of glyphs */ { SETUP_BACKING (pDrawable, pGC); PROLOGUE(pGC); @@ -2287,7 +2287,7 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) GCPtr pGC; int ts_x_origin, ts_y_origin; - pointer gcvalues[4]; + void *gcvalues[4]; unsigned long gcmask; xRectangle *rects; BoxPtr pBox; @@ -2373,18 +2373,18 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) if (backgroundState == BackgroundPixel) { - gcvalues[0] = (pointer) background.pixel; - gcvalues[1] = (pointer)FillSolid; + gcvalues[0] = (void *) background.pixel; + gcvalues[1] = (void *)FillSolid; gcmask = GCForeground|GCFillStyle; } else { - gcvalues[0] = (pointer)FillTiled; - gcvalues[1] = (pointer) background.pixmap; + gcvalues[0] = (void *)FillTiled; + gcvalues[1] = (void *) background.pixmap; gcmask = GCFillStyle|GCTile; } - gcvalues[2] = (pointer)(long)(ts_x_origin - pBackingStore->x); - gcvalues[3] = (pointer)(long)(ts_y_origin - pBackingStore->y); + gcvalues[2] = (void *)(long)(ts_x_origin - pBackingStore->x); + gcvalues[3] = (void *)(long)(ts_y_origin - pBackingStore->y); gcmask |= GCTileStipXOrigin|GCTileStipYOrigin; DoChangeGC(pGC, gcmask, (XID *)gcvalues, TRUE); ValidateGC((DrawablePtr)pBackingStore->pBackingPixmap, pGC); @@ -2477,7 +2477,7 @@ miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask) { int i; BITS32 gcmask; - pointer gcval[5]; + void * gcval[5]; xRectangle *pRect; BoxPtr pBox; WindowPtr pWin; @@ -2498,18 +2498,18 @@ miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask) } i = 0; gcmask = 0; - gcval[i++] = (pointer)planeMask; + gcval[i++] = (void *)planeMask; gcmask |= GCPlaneMask; if (state == BackgroundPixel) { if (pGC->fgPixel != pixunion.pixel) { - gcval[i++] = (pointer)pixunion.pixel; + gcval[i++] = (void *)pixunion.pixel; gcmask |= GCForeground; } if (pGC->fillStyle != FillSolid) { - gcval[i++] = (pointer)FillSolid; + gcval[i++] = (void *)FillSolid; gcmask |= GCFillStyle; } } @@ -2517,22 +2517,22 @@ miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask) { if (pGC->fillStyle != FillTiled) { - gcval[i++] = (pointer)FillTiled; + gcval[i++] = (void *)FillTiled; gcmask |= GCFillStyle; } if (pGC->tileIsPixel || pGC->tile.pixmap != pixunion.pixmap) { - gcval[i++] = (pointer)pixunion.pixmap; + gcval[i++] = (void *)pixunion.pixmap; gcmask |= GCTile; } if (pGC->patOrg.x != x) { - gcval[i++] = (pointer)(long)x; + gcval[i++] = (void *)(long)x; gcmask |= GCTileStipXOrigin; } if (pGC->patOrg.y != y) { - gcval[i++] = (pointer)(long)y; + gcval[i++] = (void *)(long)y; gcmask |= GCTileStipYOrigin; } } @@ -2592,7 +2592,7 @@ miBSAllocate(pWin) pBackingStore->viewable = (char)pWin->viewable; pBackingStore->status = StatusNoPixmap; pBackingStore->backgroundState = None; - pWin->backStorage = (pointer) pBackingStore; + pWin->backStorage = (void *) pBackingStore; } /* @@ -3622,7 +3622,7 @@ static void miBSChangeClip(pGC, type, pvalue, nrects) GCPtr pGC; int type; - pointer pvalue; + void * pvalue; int nrects; { miBSGCPtr pPriv = (miBSGCPtr) (pGC)->devPrivates[miBSGCIndex].ptr; diff --git a/nx-X11/programs/Xserver/mi/midispcur.c b/nx-X11/programs/Xserver/mi/midispcur.c index 080ac1c59..d71234ffe 100644 --- a/nx-X11/programs/Xserver/mi/midispcur.c +++ b/nx-X11/programs/Xserver/mi/midispcur.c @@ -151,11 +151,11 @@ miDCInitialize (pScreen, screenFuncs) pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = miDCCloseScreen; - pScreen->devPrivates[miDCScreenIndex].ptr = (pointer) pScreenPriv; + pScreen->devPrivates[miDCScreenIndex].ptr = (void *) pScreenPriv; if (!miSpriteInitialize (pScreen, &miDCFuncs, screenFuncs)) { - xfree ((pointer) pScreenPriv); + xfree ((void *) pScreenPriv); return FALSE; } return TRUE; @@ -187,7 +187,7 @@ miDCCloseScreen (index, pScreen) tossPict (pScreenPriv->pRootPicture); tossPict (pScreenPriv->pTempPicture); #endif - xfree ((pointer) pScreenPriv); + xfree ((void *) pScreenPriv); return (*pScreen->CloseScreen) (index, pScreen); } @@ -197,7 +197,7 @@ miDCRealizeCursor (pScreen, pCursor) CursorPtr pCursor; { if (pCursor->bits->refcnt <= 1) - pCursor->bits->devPriv[pScreen->myNum] = (pointer)NULL; + pCursor->bits->devPriv[pScreen->myNum] = (void *)NULL; return TRUE; } @@ -263,7 +263,7 @@ miDCRealize ( pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); if (!pFormat) { - xfree ((pointer) pPriv); + xfree ((void *) pPriv); return (miDCCursorPtr)NULL; } @@ -273,14 +273,14 @@ miDCRealize ( pCursor->bits->height, 32); if (!pPixmap) { - xfree ((pointer) pPriv); + xfree ((void *) pPriv); return (miDCCursorPtr)NULL; } pGC = GetScratchGC (32, pScreen); if (!pGC) { (*pScreen->DestroyPixmap) (pPixmap); - xfree ((pointer) pPriv); + xfree ((void *) pPriv); return (miDCCursorPtr)NULL; } ValidateGC (&pPixmap->drawable, pGC); @@ -294,10 +294,10 @@ miDCRealize ( (*pScreen->DestroyPixmap) (pPixmap); if (!pPriv->pPicture) { - xfree ((pointer) pPriv); + xfree ((void *) pPriv); return (miDCCursorPtr)NULL; } - pCursor->bits->devPriv[pScreen->myNum] = (pointer) pPriv; + pCursor->bits->devPriv[pScreen->myNum] = (void *) pPriv; return pPriv; } pPriv->pPicture = 0; @@ -305,17 +305,17 @@ miDCRealize ( pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1); if (!pPriv->sourceBits) { - xfree ((pointer) pPriv); + xfree ((void *) pPriv); return (miDCCursorPtr)NULL; } pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1); if (!pPriv->maskBits) { (*pScreen->DestroyPixmap) (pPriv->sourceBits); - xfree ((pointer) pPriv); + xfree ((void *) pPriv); return (miDCCursorPtr)NULL; } - pCursor->bits->devPriv[pScreen->myNum] = (pointer) pPriv; + pCursor->bits->devPriv[pScreen->myNum] = (void *) pPriv; /* create the two sets of bits, clipping as appropriate */ @@ -372,8 +372,8 @@ miDCUnrealizeCursor (pScreen, pCursor) if (pPriv->pPicture) FreePicture (pPriv->pPicture, 0); #endif - xfree ((pointer) pPriv); - pCursor->bits->devPriv[pScreen->myNum] = (pointer)NULL; + xfree ((void *) pPriv); + pCursor->bits->devPriv[pScreen->myNum] = (void *)NULL; } return TRUE; } diff --git a/nx-X11/programs/Xserver/mi/miexpose.c b/nx-X11/programs/Xserver/mi/miexpose.c index 2be6b2264..f3dae5768 100644 --- a/nx-X11/programs/Xserver/mi/miexpose.c +++ b/nx-X11/programs/Xserver/mi/miexpose.c @@ -618,7 +618,7 @@ static GCPtr screenContext[MAXSCREENS]; /*ARGSUSED*/ static int tossGC ( - pointer value, + void * value, XID id) { GCPtr pGC = (GCPtr)value; @@ -684,7 +684,7 @@ int what; gcmask |= GCForeground | GCFillStyle; break; case BackgroundPixmap: - newValues[TILE].ptr = (pointer)pWin->background.pixmap; + newValues[TILE].ptr = (void *)pWin->background.pixmap; newValues[FILLSTYLE].val = FillTiled; gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; break; @@ -700,7 +700,7 @@ int what; } else { - newValues[TILE].ptr = (pointer)pWin->border.pixmap; + newValues[TILE].ptr = (void *)pWin->border.pixmap; newValues[FILLSTYLE].val = FillTiled; gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; } @@ -773,7 +773,7 @@ int what; return; numGCs++; if (!AddResource(FakeClientID(0), ResType, - (pointer)screenContext[i])) + (void *)screenContext[i])) return; } pGC = screenContext[i]; diff --git a/nx-X11/programs/Xserver/mi/mifillarc.h b/nx-X11/programs/Xserver/mi/mifillarc.h index ff39bac1d..2d6904121 100644 --- a/nx-X11/programs/Xserver/mi/mifillarc.h +++ b/nx-X11/programs/Xserver/mi/mifillarc.h @@ -179,7 +179,7 @@ typedef struct _miArcSlice { ((slw > 1) || (ine != inxk))) extern int miFreeArcCache( - pointer /*data*/, + void * /*data*/, XID /*id*/ ); diff --git a/nx-X11/programs/Xserver/mi/migc.c b/nx-X11/programs/Xserver/mi/migc.c index 0cffe98a4..2b38b257d 100644 --- a/nx-X11/programs/Xserver/mi/migc.c +++ b/nx-X11/programs/Xserver/mi/migc.c @@ -114,14 +114,14 @@ void miChangeClip(pGC, type, pvalue, nrects) GCPtr pGC; int type; - pointer pvalue; + void *pvalue; int nrects; { (*pGC->funcs->DestroyClip) (pGC); if (type == CT_PIXMAP) { /* convert the pixmap to a region */ - pGC->clientClip = (pointer) BITMAP_TO_REGION(pGC->pScreen, + pGC->clientClip = (void *) BITMAP_TO_REGION(pGC->pScreen, (PixmapPtr) pvalue); (*pGC->pScreen->DestroyPixmap) (pvalue); } @@ -132,7 +132,7 @@ miChangeClip(pGC, type, pvalue, nrects) } else if (type != CT_NONE) { - pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nrects, + pGC->clientClip = (void *) RECTS_TO_REGION(pGC->pScreen, nrects, (xRectangle *) pvalue, type); xfree(pvalue); @@ -160,7 +160,7 @@ miCopyClip(pgcDst, pgcSrc) prgnNew = REGION_CREATE(pgcSrc->pScreen, NULL, 1); REGION_COPY(pgcDst->pScreen, prgnNew, (RegionPtr) (pgcSrc->clientClip)); - (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (pointer) prgnNew, 0); + (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (void *) prgnNew, 0); break; } } diff --git a/nx-X11/programs/Xserver/mi/migc.h b/nx-X11/programs/Xserver/mi/migc.h index d906c6334..039448b5f 100644 --- a/nx-X11/programs/Xserver/mi/migc.h +++ b/nx-X11/programs/Xserver/mi/migc.h @@ -53,7 +53,7 @@ extern void miDestroyClip( extern void miChangeClip( GCPtr /*pGC*/, int /*type*/, - pointer /*pvalue*/, + void * /*pvalue*/, int /*nrects*/ ); diff --git a/nx-X11/programs/Xserver/mi/miglblt.c b/nx-X11/programs/Xserver/mi/miglblt.c index 12d0aa932..3960fc212 100644 --- a/nx-X11/programs/Xserver/mi/miglblt.c +++ b/nx-X11/programs/Xserver/mi/miglblt.c @@ -90,7 +90,7 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int x, y; unsigned int nglyph; CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ + void *pglyphBase; /* start of array of glyphs */ { int width, height; PixmapPtr pPixmap; @@ -203,7 +203,7 @@ miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int x, y; unsigned int nglyph; CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ + void *pglyphBase; /* start of array of glyphs */ { ExtentInfoRec info; /* used by QueryGlyphExtents() */ XID gcvals[3]; diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c index 545927b53..732e47af0 100644 --- a/nx-X11/programs/Xserver/mi/mioverlay.c +++ b/nx-X11/programs/Xserver/mi/mioverlay.c @@ -128,7 +128,7 @@ miInitOverlay( if(!(pScreenPriv = xalloc(sizeof(miOverlayScreenRec)))) return FALSE; - pScreen->devPrivates[miOverlayScreenIndex].ptr = (pointer)pScreenPriv; + pScreen->devPrivates[miOverlayScreenIndex].ptr = (void *)pScreenPriv; pScreenPriv->InOverlay = inOverlayFunc; pScreenPriv->MakeTransparent = transFunc; @@ -1105,7 +1105,7 @@ typedef struct { static int miOverlayRecomputeExposures ( WindowPtr pWin, - pointer value + void * value ){ register ScreenPtr pScreen; miOverlayTwoRegions *pValid = (miOverlayTwoRegions*)value; @@ -1503,7 +1503,7 @@ miOverlayResizeWindow( TwoRegions.under = gravitate2[g]; TraverseTree (pChild, miOverlayRecomputeExposures, - (pointer)(&TwoRegions)); + (void *)(&TwoRegions)); } /* diff --git a/nx-X11/programs/Xserver/mi/mipointer.c b/nx-X11/programs/Xserver/mi/mipointer.c index 432cc1606..869e74349 100644 --- a/nx-X11/programs/Xserver/mi/mipointer.c +++ b/nx-X11/programs/Xserver/mi/mipointer.c @@ -103,7 +103,7 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate) pScreenPriv->showTransparent = FALSE; pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = miPointerCloseScreen; - pScreen->devPrivates[miPointerScreenIndex].ptr = (pointer) pScreenPriv; + pScreen->devPrivates[miPointerScreenIndex].ptr = (void *) pScreenPriv; /* * set up screen cursor method table */ @@ -145,7 +145,7 @@ miPointerCloseScreen (index, pScreen) if (pScreen == miPointer.pSpriteScreen) miPointer.pSpriteScreen = 0; pScreen->CloseScreen = pScreenPriv->CloseScreen; - xfree ((pointer) pScreenPriv); + xfree ((void *) pScreenPriv); return (*pScreen->CloseScreen) (index, pScreen); } @@ -373,7 +373,7 @@ miPointerUpdate () } /* - * miPointerDeltaCursor. The pointer has moved dx,dy from it's previous + * miPointerDeltaCursor. The void * has moved dx,dy from it's previous * position. */ @@ -406,7 +406,7 @@ miPointerCurrentScreen () } /* - * miPointerAbsoluteCursor. The pointer has moved to x,y + * miPointerAbsoluteCursor. The void * has moved to x,y */ void @@ -465,7 +465,7 @@ miPointerPosition (x, y) } /* - * miPointerMove. The pointer has moved to x,y on current screen + * miPointerMove. The void * has moved to x,y on current screen */ static void diff --git a/nx-X11/programs/Xserver/mi/mipolyrect.c b/nx-X11/programs/Xserver/mi/mipolyrect.c index 6740ea8f6..98e467f9f 100644 --- a/nx-X11/programs/Xserver/mi/mipolyrect.c +++ b/nx-X11/programs/Xserver/mi/mipolyrect.c @@ -164,7 +164,7 @@ miPolyRectangle(pDraw, pGC, nrects, pRects) } } (*pGC->ops->PolyFillRect) (pDraw, pGC, t - tmp, tmp); - DEALLOCATE_LOCAL ((pointer) tmp); + DEALLOCATE_LOCAL ((void *) tmp); } else { diff --git a/nx-X11/programs/Xserver/mi/miscrinit.c b/nx-X11/programs/Xserver/mi/miscrinit.c index ae9b6c2ee..78e2af5a4 100644 --- a/nx-X11/programs/Xserver/mi/miscrinit.c +++ b/nx-X11/programs/Xserver/mi/miscrinit.c @@ -56,7 +56,7 @@ from The Open Group. typedef struct { - pointer pbits; /* pointer to framebuffer */ + void * pbits; /* pointer to framebuffer */ int width; /* delta to add to a framebuffer addr to move one row down */ } miScreenInitParmsRec, *miScreenInitParmsPtr; @@ -71,7 +71,7 @@ miModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, int depth; int bitsPerPixel; int devKind; - pointer pPixData; + void *pPixData; { if (!pPixmap) return FALSE; @@ -150,7 +150,7 @@ miCreateScreenResources(pScreen) ScreenPtr pScreen; { miScreenInitParmsPtr pScrInitParms; - pointer value; + void * value; pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate; @@ -174,7 +174,7 @@ miCreateScreenResources(pScreen) PixmapBytePad(pScrInitParms->width, pScreen->rootDepth), pScrInitParms->pbits)) return FALSE; - value = (pointer)pPixmap; + value = (void *)pPixmap; } else { @@ -189,7 +189,7 @@ Bool miScreenDevPrivateInit(pScreen, width, pbits) register ScreenPtr pScreen; int width; - pointer pbits; + void * pbits; { miScreenInitParmsPtr pScrInitParms; @@ -202,7 +202,7 @@ miScreenDevPrivateInit(pScreen, width, pbits) return FALSE; pScrInitParms->pbits = pbits; pScrInitParms->width = width; - pScreen->devPrivate = (pointer)pScrInitParms; + pScreen->devPrivate = (void *)pScrInitParms; return TRUE; } @@ -210,7 +210,7 @@ Bool miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, rootDepth, numDepths, depths, rootVisual, numVisuals, visuals) register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bits */ + void * pbits; /* pointer to screen bits */ int xsize, ysize; /* in pixels */ int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ @@ -296,8 +296,8 @@ miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, pScreen->SendGraphicsExpose = miSendGraphicsExpose; pScreen->BlockHandler = (ScreenBlockHandlerProcPtr)NoopDDA; pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA; - pScreen->blockData = (pointer)0; - pScreen->wakeupData = (pointer)0; + pScreen->blockData = (void *)0; + pScreen->wakeupData = (void *)0; pScreen->MarkWindow = miMarkWindow; pScreen->MarkOverlappedWindows = miMarkOverlappedWindows; pScreen->ChangeSaveUnder = miChangeSaveUnder; @@ -368,5 +368,5 @@ miSetScreenPixmap(pPix) PixmapPtr pPix; { if (pPix) - pPix->drawable.pScreen->devPrivate = (pointer)pPix; + pPix->drawable.pScreen->devPrivate = (void *)pPix; } diff --git a/nx-X11/programs/Xserver/mi/misprite.c b/nx-X11/programs/Xserver/mi/misprite.c index b76542774..0ff6dacd6 100644 --- a/nx-X11/programs/Xserver/mi/misprite.c +++ b/nx-X11/programs/Xserver/mi/misprite.c @@ -84,9 +84,9 @@ static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, static void miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -static void miSpriteBlockHandler(int i, pointer blockData, - pointer pTimeout, - pointer pReadMask); +static void miSpriteBlockHandler(int i, void * blockData, + void * pTimeout, + void * pReadMask); static void miSpriteInstallColormap(ColormapPtr pMap); static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem *pdef); @@ -104,7 +104,7 @@ static void miSpriteComputeSaved(ScreenPtr pScreen); ((pScreen)->field = wrapper) /* - * pointer-sprite method table + * void *-sprite method table */ static Bool miSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); @@ -182,7 +182,7 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs) if (!miPointerInitialize (pScreen, &miSpritePointerFuncs, screenFuncs,TRUE)) { - xfree ((pointer) pScreenPriv); + xfree ((void *) pScreenPriv); return FALSE; } for (pVisual = pScreen->visuals; @@ -221,7 +221,7 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs) pScreenPriv->colors[MASK_COLOR].red = 0; pScreenPriv->colors[MASK_COLOR].green = 0; pScreenPriv->colors[MASK_COLOR].blue = 0; - pScreen->devPrivates[miSpriteScreenIndex].ptr = (pointer) pScreenPriv; + pScreen->devPrivates[miSpriteScreenIndex].ptr = (void *) pScreenPriv; pScreen->CloseScreen = miSpriteCloseScreen; pScreen->GetImage = miSpriteGetImage; @@ -270,7 +270,7 @@ miSpriteCloseScreen (i, pScreen) miSpriteIsUpFALSE (pScreen, pScreenPriv); DamageDestroy (pScreenPriv->pDamage); - xfree ((pointer) pScreenPriv); + xfree ((void *) pScreenPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -402,9 +402,9 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) static void miSpriteBlockHandler (i, blockData, pTimeout, pReadmask) int i; - pointer blockData; - pointer pTimeout; - pointer pReadmask; + void * blockData; + void * pTimeout; + void * pReadmask; { ScreenPtr pScreen = screenInfo.screens[i]; miSpriteScreenPtr pPriv; diff --git a/nx-X11/programs/Xserver/mi/miwindow.c b/nx-X11/programs/Xserver/mi/miwindow.c index 280d0f8eb..179c6e31e 100644 --- a/nx-X11/programs/Xserver/mi/miwindow.c +++ b/nx-X11/programs/Xserver/mi/miwindow.c @@ -579,7 +579,7 @@ miMoveWindow(pWin, x, y, pNextSib, kind) static int miRecomputeExposures ( register WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ + void * value) /* must conform to VisitWindowProcPtr */ { register ScreenPtr pScreen; RegionPtr pValid = (RegionPtr)value; @@ -910,7 +910,7 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) continue; REGION_INTERSECT(pScreen, pRegion, &pChild->borderClip, gravitate[g]); - TraverseTree (pChild, miRecomputeExposures, (pointer)pRegion); + TraverseTree (pChild, miRecomputeExposures, (void *)pRegion); } /* diff --git a/nx-X11/programs/Xserver/miext/cw/cw.c b/nx-X11/programs/Xserver/miext/cw/cw.c index 0fdd6547e..8079a0009 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw.c +++ b/nx-X11/programs/Xserver/miext/cw/cw.c @@ -64,7 +64,7 @@ cwCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); static void cwDestroyGC(GCPtr pGC); static void -cwChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects); +cwChangeClip(GCPtr pGC, int type, void * pvalue, int nrects); static void cwCopyClip(GCPtr pgcDst, GCPtr pgcSrc); static void @@ -199,7 +199,7 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable) */ (*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION, - (pointer) pCompositeClip, 0); + (void *) pCompositeClip, 0); vals[0] = x_off - pDrawable->x; vals[1] = y_off - pDrawable->y; @@ -273,7 +273,7 @@ cwDestroyGC(GCPtr pGC) } static void -cwChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) +cwChangeClip(GCPtr pGC, int type, void * pvalue, int nrects) { cwGCPtr pPriv = (cwGCPtr)(pGC)->devPrivates[cwGCIndex].ptr; @@ -425,7 +425,7 @@ cwFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, pGC = GetScratchGC(pDrawable->depth, pScreen); v[0].val = GXcopy; v[1].val = FillTiled; - v[2].ptr = (pointer) pTile; + v[2].ptr = (void *) pTile; v[3].val = x_off; v[4].val = y_off; dixChangeGC(NullClient, pGC, (GCFunction | GCFillStyle | GCTile | @@ -645,7 +645,7 @@ miInitializeCompositeWrapper(ScreenPtr pScreen) if (!pScreenPriv) return; - pScreen->devPrivates[cwScreenIndex].ptr = (pointer)pScreenPriv; + pScreen->devPrivates[cwScreenIndex].ptr = (void *)pScreenPriv; SCREEN_EPILOGUE(pScreen, CloseScreen, cwCloseScreen); SCREEN_EPILOGUE(pScreen, GetImage, cwGetImage); @@ -693,7 +693,7 @@ cwCloseScreen (int i, ScreenPtr pScreen) cwFiniRender(pScreen); #endif - xfree((pointer)pScreenPriv); + xfree((void *)pScreenPriv); return (*pScreen->CloseScreen)(i, pScreen); } diff --git a/nx-X11/programs/Xserver/miext/cw/cw.h b/nx-X11/programs/Xserver/miext/cw/cw.h index 2563aed5e..42d8db381 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw.h +++ b/nx-X11/programs/Xserver/miext/cw/cw.h @@ -47,7 +47,7 @@ typedef struct { extern int cwGCIndex; #define getCwGC(pGC) ((cwGCPtr)(pGC)->devPrivates[cwGCIndex].ptr) -#define setCwGC(pGC,p) ((pGC)->devPrivates[cwGCIndex].ptr = (pointer) (p)) +#define setCwGC(pGC,p) ((pGC)->devPrivates[cwGCIndex].ptr = (void *) (p)) /* * One of these structures is allocated per Picture that gets used with a @@ -61,7 +61,7 @@ typedef struct { } cwPictureRec, *cwPicturePtr; #define getCwPicture(pPicture) ((cwPicturePtr)(pPicture)->devPrivates[cwPictureIndex].ptr) -#define setCwPicture(pPicture,p) ((pPicture)->devPrivates[cwPictureIndex].ptr = (pointer) (p)) +#define setCwPicture(pPicture,p) ((pPicture)->devPrivates[cwPictureIndex].ptr = (void *) (p)) extern int cwPictureIndex; @@ -69,7 +69,7 @@ extern int cwWindowIndex; #define cwWindowPrivate(pWindow) ((pWindow)->devPrivates[cwWindowIndex].ptr) #define getCwPixmap(pWindow) ((PixmapPtr) cwWindowPrivate(pWindow)) -#define setCwPixmap(pWindow,pPixmap) (cwWindowPrivate(pWindow) = (pointer) (pPixmap)) +#define setCwPixmap(pWindow,pPixmap) (cwWindowPrivate(pWindow) = (void *) (pPixmap)) #define cwDrawableIsRedirWindow(pDraw) \ ((pDraw)->type == DRAWABLE_WINDOW && \ diff --git a/nx-X11/programs/Xserver/miext/cw/cw_ops.c b/nx-X11/programs/Xserver/miext/cw/cw_ops.c index 567a8c93c..9e09d0532 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw_ops.c +++ b/nx-X11/programs/Xserver/miext/cw/cw_ops.c @@ -96,10 +96,10 @@ static void cwImageText16(DrawablePtr pDst, GCPtr pGC, int x, int y, int count, unsigned short *chars); static void cwImageGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase); + void * pglyphBase); static void cwPolyGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase); + void * pglyphBase); static void cwPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, int w, int h, int x, int y); @@ -422,7 +422,7 @@ cwImageText16(DrawablePtr pDst, GCPtr pGC, int x, int y, int count, static void cwImageGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase) + CharInfoPtr *ppci, void * pglyphBase) { SETUP_BACKING_DST(pDst, pGC); @@ -438,7 +438,7 @@ cwImageGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, unsigned int nglyph, static void cwPolyGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase) + CharInfoPtr *ppci, void * pglyphBase) { SETUP_BACKING_DST(pDst, pGC); diff --git a/nx-X11/programs/Xserver/miext/damage/damage.c b/nx-X11/programs/Xserver/miext/damage/damage.c index 286728cd1..c2a98d422 100755 --- a/nx-X11/programs/Xserver/miext/damage/damage.c +++ b/nx-X11/programs/Xserver/miext/damage/damage.c @@ -327,7 +327,7 @@ static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); static void damageChangeGC(GCPtr, unsigned long); static void damageCopyGC(GCPtr, unsigned long, GCPtr); static void damageDestroyGC(GCPtr); -static void damageChangeClip(GCPtr, int, pointer, int); +static void damageChangeClip(GCPtr, int, void *, int); static void damageDestroyClip(GCPtr); static void damageCopyClip(GCPtr, GCPtr); @@ -440,7 +440,7 @@ damageCopyGC (GCPtr pGCSrc, static void damageChangeClip (GCPtr pGC, int type, - pointer pvalue, + void *pvalue, int nrects) { DAMAGE_GC_FUNC_PROLOGUE (pGC); @@ -1453,7 +1453,7 @@ damageImageGlyphBlt(DrawablePtr pDrawable, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase) + void * pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, @@ -1470,7 +1470,7 @@ damagePolyGlyphBlt(DrawablePtr pDrawable, int y, unsigned int nglyph, CharInfoPtr *ppci, - pointer pglyphBase) + void * pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, @@ -1801,7 +1801,7 @@ DamageSetup (ScreenPtr pScreen) } #endif - pScreen->devPrivates[damageScrPrivateIndex].ptr = (pointer) pScrPriv; + pScreen->devPrivates[damageScrPrivateIndex].ptr = (void *) pScrPriv; return TRUE; } diff --git a/nx-X11/programs/Xserver/miext/damage/damagestr.h b/nx-X11/programs/Xserver/miext/damage/damagestr.h index d7dd11d92..62b384167 100755 --- a/nx-X11/programs/Xserver/miext/damage/damagestr.h +++ b/nx-X11/programs/Xserver/miext/damage/damagestr.h @@ -93,7 +93,7 @@ extern int damageWinPrivateIndex; ((DamagePtr) (pPix)->devPrivates[damagePixPrivateIndex].ptr) #define damgeSetPixPriv(pPix,v) \ - ((pPix)->devPrivates[damagePixPrivateIndex].ptr = (pointer ) (v)) + ((pPix)->devPrivates[damagePixPrivateIndex].ptr = (void * ) (v)) #define damagePixPriv(pPix) \ DamagePtr pDamage = damageGetPixPriv(pPix) diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index 2ef474229..d97d44ab6 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -152,7 +152,7 @@ struct _OsTimerRec { OsTimerPtr next; CARD32 expires; OsTimerCallback callback; - pointer arg; + void * arg; }; static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev); @@ -254,7 +254,7 @@ WaitForSomething(int *pClientsReady) } SmartScheduleIdle = TRUE; #endif - BlockHandler((pointer)&wt, (pointer)&LastSelectMask); + BlockHandler((void *)&wt, (void *)&LastSelectMask); if (NewOutputPending) FlushAllOutput(); #ifdef XTESTEXT1 @@ -386,7 +386,7 @@ WaitForSomething(int *pClientsReady) } #endif selecterr = GetErrno(); - WakeupHandler(i, (pointer)&LastSelectMask); + WakeupHandler(i, (void *)&LastSelectMask); #ifdef XTESTEXT1 if (playback_on) { i = XTestProcessInputAction (i, &waittime); @@ -515,7 +515,7 @@ WaitForSomething(int *pClientsReady) XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections); if (XFD_ANYSET(&tmp_set)) QueueWorkProc(EstablishNewConnections, NULL, - (pointer)&LastSelectMask); + (void *)&LastSelectMask); #ifdef DPMSExtension if (XFD_ANYSET (&devicesReadable) && (DPMSPowerLevel != DPMSModeOn)) DPMSSet(DPMSModeOn); @@ -643,7 +643,7 @@ DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev) OsTimerPtr TimerSet(OsTimerPtr timer, int flags, CARD32 millis, - OsTimerCallback func, pointer arg) + OsTimerCallback func, void * arg) { register OsTimerPtr *prev; CARD32 now = GetTimeInMillis(); @@ -755,7 +755,7 @@ TimerInit(void) } static CARD32 -ScreenSaverTimeoutExpire(OsTimerPtr timer,CARD32 now,pointer arg) +ScreenSaverTimeoutExpire(OsTimerPtr timer,CARD32 now,void * arg) { INT32 timeout = now - lastDeviceEventTime.milliseconds; @@ -805,7 +805,7 @@ static OsTimerPtr DPMSSuspendTimer = NULL; static OsTimerPtr DPMSOffTimer = NULL; static CARD32 -DPMSStandbyTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) +DPMSStandbyTimerExpire(OsTimerPtr timer,CARD32 now,void * arg) { INT32 timeout = now - lastDeviceEventTime.milliseconds; @@ -820,7 +820,7 @@ DPMSStandbyTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) } static CARD32 -DPMSSuspendTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) +DPMSSuspendTimerExpire(OsTimerPtr timer,CARD32 now,void * arg) { INT32 timeout = now - lastDeviceEventTime.milliseconds; @@ -835,7 +835,7 @@ DPMSSuspendTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) } static CARD32 -DPMSOffTimerExpire(OsTimerPtr timer,CARD32 now,pointer arg) +DPMSOffTimerExpire(OsTimerPtr timer,CARD32 now,void * arg) { INT32 timeout = now - lastDeviceEventTime.milliseconds; diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index 532a2f82e..07b460f40 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -226,14 +226,14 @@ Bool defeatAccessControl = FALSE; static int ConvertAddr(struct sockaddr * /*saddr*/, int * /*len*/, - pointer * /*addr*/); + void ** /*addr*/); static int CheckAddr(int /*family*/, - pointer /*pAddr*/, + void * /*pAddr*/, unsigned /*length*/); static Bool NewHost(int /*family*/, - pointer /*addr*/, + void * /*addr*/, int /*len*/, int /* addingLocalHosts */); @@ -270,7 +270,7 @@ static int LocalHostRequested = FALSE; static int UsingXdmcp = FALSE; /* FamilyServerInterpreted implementation */ -static Bool siAddrMatch(int family, pointer addr, int len, HOST *host, +static Bool siAddrMatch(int family, void * addr, int len, HOST *host, ClientPtr client); static int siCheckAddr(const char *addrString, int length); static void siTypesInitialize(void); @@ -302,7 +302,7 @@ DisableLocalHost (void) LocalHostEnabled = FALSE; for (self = selfhosts; self; self = self->next) { if (!self->requested) /* Fix for XFree86 bug #156 */ - (void) RemoveHost ((ClientPtr)NULL, self->family, self->len, (pointer)self->addr); + (void) RemoveHost ((ClientPtr)NULL, self->family, self->len, (void *)self->addr); } } @@ -441,7 +441,7 @@ DefineSelf (int fd) } len = sizeof(struct sockaddr_in); - family = ConvertAddr (IA_SIN(&ifaddr), &len, (pointer *)&addr); + family = ConvertAddr (IA_SIN(&ifaddr), &len, (void **)&addr); if (family == -1 || family == FamilyLocal) continue; for (host = selfhosts; @@ -602,7 +602,7 @@ DefineSelf (int fd) default: goto DefineLocalHost; } - family = ConvertAddr ( &(saddr.sa), &len, (pointer *)&addr); + family = ConvertAddr ( &(saddr.sa), &len, (void **)&addr); if ( family != -1 && family != FamilyLocal ) { for (host = selfhosts; @@ -812,7 +812,7 @@ DefineSelf (int fd) #define IFR_IFR_NAME ifr->ifr_name #endif - if (ifioctl (fd, IFC_IOCTL_REQ, (pointer) &ifc) < 0) + if (ifioctl (fd, IFC_IOCTL_REQ, (void *) &ifc) < 0) Error ("Getting interface configuration (4)"); cplim = (char *) IFC_IFC_REQ + IFC_IFC_LEN; @@ -822,7 +822,7 @@ DefineSelf (int fd) ifr = (ifr_type *) cp; len = ifraddr_size (IFR_IFR_ADDR); family = ConvertAddr ((struct sockaddr *) &IFR_IFR_ADDR, - &len, (pointer *)&addr); + &len, (void **)&addr); #ifdef DNETCONN /* * DECnet was handled up above. @@ -943,13 +943,13 @@ DefineSelf (int fd) struct ifreq broad_req; broad_req = *ifr; - if (ifioctl (fd, SIOCGIFFLAGS, (pointer) &broad_req) != -1 && + if (ifioctl (fd, SIOCGIFFLAGS, (void *) &broad_req) != -1 && (broad_req.ifr_flags & IFF_BROADCAST) && (broad_req.ifr_flags & IFF_UP) ) { broad_req = *ifr; - if (ifioctl (fd, SIOCGIFBRDADDR, (pointer) &broad_req) != -1) + if (ifioctl (fd, SIOCGIFBRDADDR, (void *) &broad_req) != -1) broad_addr = broad_req.ifr_addr; else continue; @@ -980,7 +980,7 @@ DefineSelf (int fd) continue; #endif /* DNETCONN */ len = sizeof(*(ifr->ifa_addr)); - family = ConvertAddr(ifr->ifa_addr, &len, (pointer *)&addr); + family = ConvertAddr(ifr->ifa_addr, &len, (void **)&addr); if (family == -1 || family == FamilyLocal) continue; #if defined(IPv6) && defined(AF_INET6) @@ -1104,13 +1104,13 @@ DefineSelf (int fd) #ifdef XDMCP void -AugmentSelf(pointer from, int len) +AugmentSelf(void * from, int len) { int family; - pointer addr; + void * addr; register HOST *host; - family = ConvertAddr(from, &len, (pointer *)&addr); + family = ConvertAddr(from, &len, (void **)&addr); if (family == -1 || family == FamilyLocal) return; for (host = selfhosts; host; host = host->next) @@ -1175,7 +1175,7 @@ ResetHosts (char *display) krb5_data kbuf; #endif int family = 0; - pointer addr; + void *addr; int len; siTypesInitialize(); @@ -1284,7 +1284,7 @@ ResetHosts (char *display) /* node was specified by name */ saddr.sa.sa_family = np->n_addrtype; len = sizeof(saddr.sa); - if (ConvertAddr (&saddr.sa, &len, (pointer *)&addr) == FamilyDECnet) + if (ConvertAddr (&saddr.sa, &len, (void **)&addr) == FamilyDECnet) { bzero ((char *) &dnaddr, sizeof (dnaddr)); dnaddr.a_len = np->n_length; @@ -1293,7 +1293,7 @@ ResetHosts (char *display) } } if (dnaddrp) - (void) NewHost(FamilyDECnet, (pointer)dnaddrp, + (void) NewHost(FamilyDECnet, (void *)dnaddrp, (int)(dnaddrp->a_len + sizeof(dnaddrp->a_len)), FALSE); } else @@ -1329,7 +1329,7 @@ ResetHosts (char *display) if (getaddrinfo(hostname, NULL, NULL, &addresses) == 0) { for (a = addresses ; a != NULL ; a = a->ai_next) { len = a->ai_addrlen; - f = ConvertAddr(a->ai_addr,&len,(pointer *)&addr); + f = ConvertAddr(a->ai_addr,&len,(void **)&addr); if ( (family == f) || ((family == FamilyWild) && (f != -1)) ) { NewHost(f, addr, len, FALSE); @@ -1351,16 +1351,16 @@ ResetHosts (char *display) { saddr.sa.sa_family = hp->h_addrtype; len = sizeof(saddr.sa); - if ((family = ConvertAddr (&saddr.sa, &len, (pointer *)&addr)) != -1) + if ((family = ConvertAddr (&saddr.sa, &len, (void **)&addr)) != -1) { #ifdef h_addr /* new 4.3bsd version of gethostent */ char **list; /* iterate over the addresses */ for (list = hp->h_addr_list; *list; list++) - (void) NewHost (family, (pointer)*list, len, FALSE); + (void) NewHost (family, (void *)*list, len, FALSE); #else - (void) NewHost (family, (pointer)hp->h_addr, len, FALSE); + (void) NewHost (family, (void *)hp->h_addr, len, FALSE); #endif } } @@ -1378,7 +1378,7 @@ Bool LocalClient(ClientPtr client) { int alen, family, notused; Xtransaddr *from = NULL; - pointer addr; + void *addr; register HOST *host; #ifdef XCSECURITY @@ -1398,7 +1398,7 @@ Bool LocalClient(ClientPtr client) ¬used, &alen, &from)) { family = ConvertAddr ((struct sockaddr *) from, - &alen, (pointer *)&addr); + &alen, (void **)&addr); if (family == -1) { xfree ((char *) from); @@ -1546,7 +1546,7 @@ int AddHost (ClientPtr client, int family, unsigned length, /* of bytes in pAddr */ - pointer pAddr) + void *pAddr) { int len; @@ -1596,8 +1596,8 @@ ForEachHostInFamily (int family, Bool (*func)( unsigned char * /* addr */, short /* len */, - pointer /* closure */), - pointer closure) + void * /* closure */), + void * closure) { HOST *host; @@ -1611,7 +1611,7 @@ ForEachHostInFamily (int family, * called when starting or resetting the server */ static Bool NewHost (int family, - pointer addr, + void *addr, int len, int addingLocalHosts) { @@ -1648,7 +1648,7 @@ RemoveHost ( ClientPtr client, int family, unsigned length, /* of bytes in pAddr */ - pointer pAddr) + void *pAddr) { int len; register HOST *host, **prev; @@ -1703,7 +1703,7 @@ RemoveHost ( /* Get all hosts in the access control list */ int GetHosts ( - pointer *data, + void * *data, int *pnHosts, int *pLen, BOOL *pEnabled) @@ -1726,7 +1726,7 @@ GetHosts ( } if (n) { - *data = ptr = (pointer) xalloc (n); + *data = ptr = (void *) xalloc (n); if (!ptr) { return(BadAlloc); @@ -1756,7 +1756,7 @@ GetHosts ( static int CheckAddr ( int family, - pointer pAddr, + void * pAddr, unsigned length) { int len; @@ -1813,12 +1813,12 @@ InvalidHost ( ClientPtr client) { int family; - pointer addr; + void *addr; register HOST *selfhost, *host; if (!AccessEnabled) /* just let them in */ return(0); - family = ConvertAddr (saddr, &len, (pointer *)&addr); + family = ConvertAddr (saddr, &len, (void **)&addr); if (family == -1) return 1; if (family == FamilyLocal) @@ -1860,7 +1860,7 @@ static int ConvertAddr ( register struct sockaddr *saddr, int *len, - pointer *addr) + void **addr) { if (*len == 0) return (FamilyLocal); @@ -1878,7 +1878,7 @@ ConvertAddr ( return FamilyLocal; #endif *len = sizeof (struct in_addr); - *addr = (pointer) &(((struct sockaddr_in *) saddr)->sin_addr); + *addr = (void *) &(((struct sockaddr_in *) saddr)->sin_addr); return FamilyInternet; #if defined(IPv6) && defined(AF_INET6) case AF_INET6: @@ -1886,11 +1886,11 @@ ConvertAddr ( struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *) saddr; if (IN6_IS_ADDR_V4MAPPED(&(saddr6->sin6_addr))) { *len = sizeof (struct in_addr); - *addr = (pointer) &(saddr6->sin6_addr.s6_addr[12]); + *addr = (void *) &(saddr6->sin6_addr.s6_addr[12]); return FamilyInternet; } else { *len = sizeof (struct in6_addr); - *addr = (pointer) &(saddr6->sin6_addr); + *addr = (void *) &(saddr6->sin6_addr); return FamilyInternet6; } } @@ -1901,7 +1901,7 @@ ConvertAddr ( { struct sockaddr_dn *sdn = (struct sockaddr_dn *) saddr; *len = sdn->sdn_nodeaddrl + sizeof(sdn->sdn_nodeaddrl); - *addr = (pointer) &(sdn->sdn_add); + *addr = (void *) &(sdn->sdn_add); } return FamilyDECnet; #endif @@ -1953,7 +1953,7 @@ GetAccessControl(void) * future to enable loading additional host types, but that was not done for * the initial implementation. */ -typedef Bool (*siAddrMatchFunc)(int family, pointer addr, int len, +typedef Bool (*siAddrMatchFunc)(int family, void * addr, int len, const char *siAddr, int siAddrlen, ClientPtr client, void *siTypePriv); typedef int (*siCheckAddrFunc)(const char *addrString, int length, void *siTypePriv); @@ -2005,7 +2005,7 @@ siTypeAdd(const char *typeName, siAddrMatchFunc addrMatch, /* Checks to see if a host matches a server-interpreted host entry */ static Bool -siAddrMatch(int family, pointer addr, int len, HOST *host, ClientPtr client) +siAddrMatch(int family, void * addr, int len, HOST *host, ClientPtr client) { Bool matches = FALSE; struct siType *s; @@ -2105,7 +2105,7 @@ siCheckAddr(const char *addrString, int length) #endif static Bool -siHostnameAddrMatch(int family, pointer addr, int len, +siHostnameAddrMatch(int family, void * addr, int len, const char *siAddr, int siAddrLen, ClientPtr client, void *typePriv) { Bool res = FALSE; @@ -2120,7 +2120,7 @@ siHostnameAddrMatch(int family, pointer addr, int len, struct addrinfo *addresses; struct addrinfo *a; int f, hostaddrlen; - pointer hostaddr; + void * hostaddr; if (siAddrLen >= sizeof(hostname)) return FALSE; @@ -2149,7 +2149,7 @@ siHostnameAddrMatch(int family, pointer addr, int len, #endif char hostname[SI_HOSTNAME_MAXLEN]; int f, hostaddrlen; - pointer hostaddr; + void * hostaddr; const char **addrlist; if (siAddrLen >= sizeof(hostname)) @@ -2249,7 +2249,7 @@ siHostnameCheckAddr(const char *valueString, int length, void *typePriv) #define SI_IPv6_MAXLEN INET6_ADDRSTRLEN static Bool -siIPv6AddrMatch(int family, pointer addr, int len, +siIPv6AddrMatch(int family, void * addr, int len, const char *siAddr, int siAddrlen, ClientPtr client, void *typePriv) { struct in6_addr addr6; @@ -2367,7 +2367,7 @@ siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id) } static Bool -siLocalCredAddrMatch(int family, pointer addr, int len, +siLocalCredAddrMatch(int family, void * addr, int len, const char *siAddr, int siAddrlen, ClientPtr client, void *typePriv) { int connUid, connGid, *connSuppGids, connNumSuppGids, siAddrId; diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index e3319b338..0f846d084 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -142,7 +142,7 @@ extern __const__ int _nfiles; #endif #endif #endif /* WIN32 */ -#include "misc.h" /* for typedef of pointer */ +#include "misc.h" #include "osdep.h" #include #include "opaque.h" @@ -874,7 +874,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) oc->Close = Close; oc->largereq = (ConnectionInputPtr) NULL; #endif - if (!(client = NextAvailableClient((pointer)oc))) + if (!(client = NextAvailableClient((void *)oc))) { xfree (oc); return NullClient; @@ -950,7 +950,7 @@ LbxProxyConnection (ClientPtr client, LbxProxyPtr proxy) /*ARGSUSED*/ Bool -EstablishNewConnections(ClientPtr clientUnused, pointer closure) +EstablishNewConnections(ClientPtr clientUnused, void * closure) { fd_set readyconnections; /* set of listeners that are ready */ int curconn; /* fd of listener that's ready */ @@ -1215,7 +1215,7 @@ CloseDownConnection(ClientPtr client) FreeOsBuffers(oc); xfree(oc); #endif - client->osPrivate = (pointer)NULL; + client->osPrivate = (void *)NULL; if (auditTrailLevel > 1) AuditF("client %d disconnected\n", client->index); } diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index 76edbaeee..b92e7c4ae 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -511,7 +511,7 @@ ReadRequestFromClient(ClientPtr client) client->req_len -= (sizeof(xBigReq) - sizeof(xReq)) >> 2; } #endif - client->requestBuffer = (pointer)oci->bufptr; + client->requestBuffer = (void *)oci->bufptr; #ifdef DEBUG_COMMUNICATION { xReq *req = client->requestBuffer; @@ -998,7 +998,7 @@ WriteToClient (ClientPtr who, int count, char *buf) who->replyBytesRemaining -= count + padBytes; replyinfo.startOfReply = FALSE; replyinfo.bytesRemaining = who->replyBytesRemaining; - CallCallbacks((&ReplyCallback), (pointer)&replyinfo); + CallCallbacks((&ReplyCallback), (void *)&replyinfo); } else if (who->clientState == ClientStateRunning && buf[0] == X_Reply) @@ -1013,7 +1013,7 @@ WriteToClient (ClientPtr who, int count, char *buf) bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes; replyinfo.startOfReply = TRUE; replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft; - CallCallbacks((&ReplyCallback), (pointer)&replyinfo); + CallCallbacks((&ReplyCallback), (void *)&replyinfo); } } #ifdef DEBUG_COMMUNICATION diff --git a/nx-X11/programs/Xserver/os/k5auth.c b/nx-X11/programs/Xserver/os/k5auth.c index 78301ad10..3c50de032 100644 --- a/nx-X11/programs/Xserver/os/k5auth.c +++ b/nx-X11/programs/Xserver/os/k5auth.c @@ -79,7 +79,7 @@ static char kerror[256]; * extract session key from a credentials struct */ krb5_error_code tgt_keyproc(keyprocarg, principal, vno, key) - krb5_pointer keyprocarg; + krb5_void * keyprocarg; krb5_principal principal; krb5_kvno vno; krb5_keyblock **key; @@ -237,15 +237,15 @@ XID K5Check(data_length, data, client, reason) client->clientState = ClientStateAuthenticating; if (ccname) { - ((OsCommPtr)client->osPrivate)->authstate.srvcreds = (pointer)creds; /* save tgt creds */ + ((OsCommPtr)client->osPrivate)->authstate.srvcreds = (void *)creds; /* save tgt creds */ ((OsCommPtr)client->osPrivate)->authstate.ktname = NULL; ((OsCommPtr)client->osPrivate)->authstate.srvname = NULL; } if (srvname) { ((OsCommPtr)client->osPrivate)->authstate.srvcreds = NULL; - ((OsCommPtr)client->osPrivate)->authstate.ktname = (pointer)ktname; - ((OsCommPtr)client->osPrivate)->authstate.srvname = (pointer)srvname; + ((OsCommPtr)client->osPrivate)->authstate.ktname = (void *)ktname; + ((OsCommPtr)client->osPrivate)->authstate.srvname = (void *)srvname; } ((OsCommPtr)client->osPrivate)->authstate.stageno = 1; /* next stage is 1 */ return krb5_id; @@ -476,7 +476,7 @@ int k5_stage1(client) /* * Now check to see if the principal we got is one that we want to let in */ - if (ForEachHostInFamily(FamilyKrb5Principal, k5_cmpenc, (pointer)&buf)) + if (ForEachHostInFamily(FamilyKrb5Principal, k5_cmpenc, (void *)&buf)) { free(buf.data); /* diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c index 1b28bb141..9af39800f 100644 --- a/nx-X11/programs/Xserver/os/log.c +++ b/nx-X11/programs/Xserver/os/log.c @@ -531,7 +531,7 @@ AuditF(const char * f, ...) } static CARD32 -AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg) +AuditFlush(OsTimerPtr timer, CARD32 now, void * arg) { char *prefix; diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h index b837d7605..e8c2d5959 100644 --- a/nx-X11/programs/Xserver/os/osdep.h +++ b/nx-X11/programs/Xserver/os/osdep.h @@ -151,10 +151,10 @@ typedef struct _connectionOutput { #ifdef K5AUTH typedef struct _k5_state { int stageno; /* current stage of auth protocol */ - pointer srvcreds; /* server credentials */ - pointer srvname; /* server principal name */ - pointer ktname; /* key table: principal-key pairs */ - pointer skey; /* session key */ + void *srvcreds; /* server credentials */ + void *srvname; /* server principal name */ + void *ktname; /* key table: principal-key pairs */ + void *skey; /* session key */ } k5_state; #endif diff --git a/nx-X11/programs/Xserver/os/rpcauth.c b/nx-X11/programs/Xserver/os/rpcauth.c index a12931eb0..896291e59 100644 --- a/nx-X11/programs/Xserver/os/rpcauth.c +++ b/nx-X11/programs/Xserver/os/rpcauth.c @@ -132,7 +132,7 @@ static Bool CheckNetName ( unsigned char *addr, short len, - pointer closure + void * closure ) { return (len == strlen ((char *) closure) && @@ -176,7 +176,7 @@ int SecureRPCAdd (unsigned short data_length, char *data, XID id) { if (data_length) - AddHost ((pointer) 0, FamilyNetname, data_length, data); + AddHost ((void *) 0, FamilyNetname, data_length, data); rpc_id = id; return 1; } diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 5f189c949..b09190c4e 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -598,7 +598,7 @@ GetTimeInMillis(void) #endif void -AdjustWaitForDelay (pointer waitTime, unsigned long newdelay) +AdjustWaitForDelay (void * waitTime, unsigned long newdelay) { static struct timeval delay_val; struct timeval **wt = (struct timeval **) waitTime; @@ -1299,7 +1299,7 @@ ExpandCommandLine(int *pargc, char ***pargv) /* Implement a simple-minded font authorization scheme. The authorization name is "hp-hostname-1", the contents are simply the host name. */ int -set_font_authorizations(char **authorizations, int *authlen, pointer client) +set_font_authorizations(char **authorizations, int *authlen, void * client) { #define AUTHORIZATION_NAME "hp-hostname-1" #if defined(TCPCONN) || defined(STREAMSCONN) @@ -1380,7 +1380,7 @@ set_font_authorizations(char **authorizations, int *authlen, pointer client) void * Xalloc(unsigned long amount) { - register pointer ptr; + register void * ptr; if ((long)amount <= 0) { return (unsigned long *)NULL; @@ -1392,7 +1392,7 @@ Xalloc(unsigned long amount) ((random() % MEM_FAIL_SCALE) < Memory_fail)) return (unsigned long *)NULL; #endif - if ((ptr = (pointer)malloc(amount))) { + if ((ptr = (void *)malloc(amount))) { return (unsigned long *)ptr; } if (Must_have_memory) @@ -1408,7 +1408,7 @@ Xalloc(unsigned long amount) void * XNFalloc(unsigned long amount) { - register pointer ptr; + register void * ptr; if ((long)amount <= 0) { @@ -1416,7 +1416,7 @@ XNFalloc(unsigned long amount) } /* aligned extra on long word boundary */ amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); - ptr = (pointer)malloc(amount); + ptr = (void *)malloc(amount); if (!ptr) { FatalError("Out of memory"); @@ -1461,7 +1461,7 @@ XNFcalloc(unsigned long amount) *****************/ void * -Xrealloc(pointer ptr, unsigned long amount) +Xrealloc(void * ptr, unsigned long amount) { #ifdef MEMBUG if (!Must_have_memory && Memory_fail && @@ -1476,9 +1476,9 @@ Xrealloc(pointer ptr, unsigned long amount) } amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); if (ptr) - ptr = (pointer)realloc((char *)ptr, amount); + ptr = (void *)realloc((char *)ptr, amount); else - ptr = (pointer)malloc(amount); + ptr = (void *)malloc(amount); if (ptr) return (unsigned long *)ptr; if (Must_have_memory) @@ -1492,9 +1492,9 @@ Xrealloc(pointer ptr, unsigned long amount) *****************/ void * -XNFrealloc(pointer ptr, unsigned long amount) +XNFrealloc(void * ptr, unsigned long amount) { - if (( ptr = (pointer)Xrealloc( ptr, amount ) ) == NULL) + if (( ptr = (void *)Xrealloc( ptr, amount ) ) == NULL) { if ((long)amount > 0) FatalError( "Out of memory" ); @@ -1508,7 +1508,7 @@ XNFrealloc(pointer ptr, unsigned long amount) *****************/ void -Xfree(pointer ptr) +Xfree(void * ptr) { if (ptr) free((char *)ptr); @@ -1816,7 +1816,7 @@ static struct pid { int pid; } *pidlist; -pointer +void * Popen(char *command, char *type) { struct pid *cur; @@ -1953,7 +1953,7 @@ Popen(char *command, char *type) } /* fopen that drops privileges */ -pointer +void * Fopen(char *file, char *type) { FILE *iop; @@ -2047,7 +2047,7 @@ Fopen(char *file, char *type) } int -Pclose(pointer iop) +Pclose(void * iop) { struct pid *cur, *last; int pstat; @@ -2087,7 +2087,7 @@ Pclose(pointer iop) } int -Fclose(pointer iop) +Fclose(void * iop) { #ifdef HAS_SAVED_IDS_AND_SETEUID return fclose(iop); diff --git a/nx-X11/programs/Xserver/os/xalloc.c b/nx-X11/programs/Xserver/os/xalloc.c index e1cdbfc5b..a2487d4bc 100644 --- a/nx-X11/programs/Xserver/os/xalloc.c +++ b/nx-X11/programs/Xserver/os/xalloc.c @@ -466,10 +466,10 @@ Xalloc (unsigned long amount) * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory *****************/ -pointer +void * XNFalloc (unsigned long amount) { - register pointer ptr; + register void * ptr; /* zero size requested */ if (amount == 0) { @@ -499,10 +499,10 @@ XNFalloc (unsigned long amount) * Xcalloc *****************/ -pointer +void * Xcalloc (unsigned long amount) { - pointer ret; + void * ret; ret = Xalloc (amount); if (ret != 0 @@ -520,7 +520,7 @@ Xcalloc (unsigned long amount) void * XNFcalloc (unsigned long amount) { - pointer ret; + void * ret; ret = XNFalloc (amount); if (ret != 0 @@ -537,7 +537,7 @@ XNFcalloc (unsigned long amount) *****************/ void * -Xrealloc (pointer ptr, unsigned long amount) +Xrealloc (void * ptr, unsigned long amount) { register unsigned long *new_ptr; @@ -614,9 +614,9 @@ Xrealloc (pointer ptr, unsigned long amount) *****************/ void * -XNFrealloc (pointer ptr, unsigned long amount) +XNFrealloc (void * ptr, unsigned long amount) { - if (( ptr = (pointer)Xrealloc( ptr, amount ) ) == NULL) + if (( ptr = (void *)Xrealloc( ptr, amount ) ) == NULL) { FatalError( "Out of memory" ); } @@ -629,7 +629,7 @@ XNFrealloc (pointer ptr, unsigned long amount) *****************/ void -Xfree(pointer ptr) +Xfree(void * ptr) { unsigned long size; unsigned long *pheader; diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c index 032d58f15..675e9c456 100644 --- a/nx-X11/programs/Xserver/os/xdmcp.c +++ b/nx-X11/programs/Xserver/os/xdmcp.c @@ -223,14 +223,14 @@ static void timeout(void); static void restart(void); static void XdmcpBlockHandler( - pointer /*data*/, + void * /*data*/, struct timeval ** /*wt*/, - pointer /*LastSelectMask*/); + void * /*LastSelectMask*/); static void XdmcpWakeupHandler( - pointer /*data*/, + void * /*data*/, int /*i*/, - pointer /*LastSelectMask*/); + void * /*LastSelectMask*/); void XdmcpRegisterManufacturerDisplayID( char * /*name*/, @@ -623,7 +623,7 @@ XdmcpInit(void) XdmcpRegisterDisplayClass (defaultDisplayClass, strlen (defaultDisplayClass)); AccessUsingXdmcp(); RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler, - (pointer) 0); + (void *) 0); timeOutRtx = 0; DisplayNumber = (CARD16) atoi(display); get_xdmcp_sock(); @@ -638,7 +638,7 @@ XdmcpReset (void) if (state != XDM_OFF) { RegisterBlockAndWakeupHandlers (XdmcpBlockHandler, XdmcpWakeupHandler, - (pointer) 0); + (void *) 0); timeOutRtx = 0; send_packet(); } @@ -683,9 +683,9 @@ XdmcpCloseDisplay(int sock) /*ARGSUSED*/ static void XdmcpBlockHandler( - pointer data, /* unused */ + void * data, /* unused */ struct timeval **wt, - pointer pReadmask) + void * pReadmask) { fd_set *LastSelectMask = (fd_set*)pReadmask; CARD32 millisToGo; @@ -714,9 +714,9 @@ XdmcpBlockHandler( /*ARGSUSED*/ static void XdmcpWakeupHandler( - pointer data, /* unused */ + void * data, /* unused */ int i, - pointer pReadmask) + void * pReadmask) { fd_set* LastSelectMask = (fd_set*)pReadmask; fd_set devicesReadable; diff --git a/nx-X11/programs/Xserver/randr/randr.c b/nx-X11/programs/Xserver/randr/randr.c index f565617e6..eb50aeb3d 100644 --- a/nx-X11/programs/Xserver/randr/randr.c +++ b/nx-X11/programs/Xserver/randr/randr.c @@ -84,8 +84,8 @@ int rrPrivIndex = -1; static void RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) + void * closure, + void * data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -304,7 +304,7 @@ Bool RRScreenInit(ScreenPtr pScreen) /*ARGSUSED*/ static int -RRFreeClient (pointer data, XID id) +RRFreeClient (void * data, XID id) { RREventPtr pRREvent; WindowPtr pWin; @@ -325,13 +325,13 @@ RRFreeClient (pointer data, XID id) *pHead = pRREvent->next; } } - xfree ((pointer) pRREvent); + xfree ((void *) pRREvent); return 1; } /*ARGSUSED*/ static int -RRFreeEvents (pointer data, XID id) +RRFreeEvents (void * data, XID id) { RREventPtr *pHead, pCur, pNext; @@ -339,9 +339,9 @@ RRFreeEvents (pointer data, XID id) for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource (pCur->clientResource, RRClientType); - xfree ((pointer) pCur); + xfree ((void *) pCur); } - xfree ((pointer) pHead); + xfree ((void *) pHead); return 1; } @@ -390,7 +390,7 @@ RRExtensionInit (void) } static int -TellChanged (WindowPtr pWin, pointer value) +TellChanged (WindowPtr pWin, void * value) { RREventPtr *pHead, pRREvent; ClientPtr client; @@ -452,7 +452,7 @@ RRTellChanged (ScreenPtr pScreen) pScrPriv->configChanged = FALSE; } pScrPriv->changed = FALSE; - WalkTree (pScreen, TellChanged, (pointer) pScreen); + WalkTree (pScreen, TellChanged, (void *) pScreen); for (i = 0; i < pScrPriv->numOutputs; i++) pScrPriv->outputs[i]->changed = FALSE; for (i = 0; i < pScrPriv->numCrtcs; i++) diff --git a/nx-X11/programs/Xserver/randr/randrstr.h b/nx-X11/programs/Xserver/randr/randrstr.h index 52067b51e..3c3db2c13 100644 --- a/nx-X11/programs/Xserver/randr/randrstr.h +++ b/nx-X11/programs/Xserver/randr/randrstr.h @@ -91,7 +91,7 @@ struct _rrPropertyValue { 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 */ + void *data; /* private to client */ }; struct _rrProperty { @@ -283,7 +283,7 @@ extern int rrPrivIndex; #define rrGetScrPriv(pScr) ((rrScrPrivPtr) (pScr)->devPrivates[rrPrivIndex].ptr) #define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr) -#define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p)) +#define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (void *) (p)) #endif @@ -785,7 +785,7 @@ RRPostPendingProperties (RROutputPtr output); int RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent, Bool pending); + void * value, Bool sendevent, Bool pending); int RRConfigureOutputProperty (RROutputPtr output, Atom property, diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c index bc1040c9f..fdf063901 100644 --- a/nx-X11/programs/Xserver/randr/rrcrtc.c +++ b/nx-X11/programs/Xserver/randr/rrcrtc.c @@ -107,7 +107,7 @@ RRCrtcCreate (ScreenPtr pScreen, void *devPrivate) crtc->changed = FALSE; crtc->devPrivate = devPrivate; - if (!AddResource (crtc->id, RRCrtcType, (pointer) crtc)) + if (!AddResource (crtc->id, RRCrtcType, (void *) crtc)) return NULL; /* attach the screen and crtc together */ @@ -385,7 +385,7 @@ RRCrtcDestroy (RRCrtcPtr crtc) } static int -RRCrtcDestroyResource (pointer value, XID pid) +RRCrtcDestroyResource (void * value, XID pid) { RRCrtcPtr crtc = (RRCrtcPtr) value; ScreenPtr pScreen = crtc->pScreen; diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c index 3d52b3879..4c6a5ff48 100644 --- a/nx-X11/programs/Xserver/randr/rrdispatch.c +++ b/nx-X11/programs/Xserver/randr/rrdispatch.c @@ -120,7 +120,7 @@ ProcRRSelectInput (ClientPtr client) */ clientResource = FakeClientID (client->index); pRREvent->clientResource = clientResource; - if (!AddResource (clientResource, RRClientType, (pointer)pRREvent)) + if (!AddResource (clientResource, RRClientType, (void *)pRREvent)) return BadAlloc; /* * create a resource to contain a pointer to the list @@ -132,7 +132,7 @@ ProcRRSelectInput (ClientPtr client) { pHead = (RREventPtr *) xalloc (sizeof (RREventPtr)); if (!pHead || - !AddResource (pWin->drawable.id, RREventType, (pointer)pHead)) + !AddResource (pWin->drawable.id, RREventType, (void *)pHead)) { FreeResource (clientResource, RT_NONE); return BadAlloc; diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c index de51bec81..cb45bf74a 100644 --- a/nx-X11/programs/Xserver/randr/rrmode.c +++ b/nx-X11/programs/Xserver/randr/rrmode.c @@ -98,7 +98,7 @@ RRModeCreate (xRRModeInfo *modeInfo, } mode->mode.id = FakeClientID(0); - if (!AddResource(mode->mode.id, RRModeType, (pointer) mode)) { + if (!AddResource(mode->mode.id, RRModeType, (void *) mode)) { xfree(newModes); return NULL; } @@ -274,7 +274,7 @@ RRModeDestroy (RRModePtr mode) } static int -RRModeDestroyResource (pointer value, XID pid) +RRModeDestroyResource (void * value, XID pid) { RRModeDestroy ((RRModePtr) value); return 1; diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c index 693f5a5d3..06f8024e4 100644 --- a/nx-X11/programs/Xserver/randr/rroutput.c +++ b/nx-X11/programs/Xserver/randr/rroutput.c @@ -100,7 +100,7 @@ RROutputCreate (ScreenPtr pScreen, output->changed = FALSE; output->devPrivate = devPrivate; - if (!AddResource (output->id, RROutputType, (pointer) output)) + if (!AddResource (output->id, RROutputType, (void *) output)) return NULL; pScrPriv->outputs[pScrPriv->numOutputs++] = output; @@ -369,7 +369,7 @@ RROutputDestroy (RROutputPtr output) } static int -RROutputDestroyResource (pointer value, XID pid) +RROutputDestroyResource (void * value, XID pid) { RROutputPtr output = (RROutputPtr) value; ScreenPtr pScreen = output->pScreen; diff --git a/nx-X11/programs/Xserver/randr/rrproperty.c b/nx-X11/programs/Xserver/randr/rrproperty.c index 429246c68..4b73336e8 100644 --- a/nx-X11/programs/Xserver/randr/rrproperty.c +++ b/nx-X11/programs/Xserver/randr/rrproperty.c @@ -121,7 +121,7 @@ RRDeleteOutputProperty (RROutputPtr output, Atom property) int RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent, Bool pending) + void * value, Bool sendevent, Bool pending) { RRPropertyPtr prop; xRROutputPropertyNotifyEvent event; @@ -167,10 +167,10 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, if (mode == PropModeReplace || len > 0) { - pointer new_data = NULL, old_data = NULL; + void *new_data = NULL, *old_data = NULL; total_size = total_len * size_in_bytes; - new_value.data = (pointer)xalloc (total_size); + new_value.data = (void *)xalloc (total_size); if (!new_value.data && total_size) { if (add) @@ -187,13 +187,13 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, old_data = NULL; break; case PropModeAppend: - new_data = (pointer) (((char *) new_value.data) + + new_data = (void *) (((char *) new_value.data) + (prop_value->size * size_in_bytes)); old_data = new_value.data; break; case PropModePrepend: new_data = new_value.data; - old_data = (pointer) (((char *) new_value.data) + + old_data = (void *) (((char *) new_value.data) + (prop_value->size * size_in_bytes)); break; } @@ -534,7 +534,7 @@ ProcRRChangeOutputProperty (ClientPtr client) err = RRChangeOutputProperty(output, stuff->property, stuff->type, (int)format, - (int)mode, len, (pointer)&stuff[1], TRUE, TRUE); + (int)mode, len, (void *)&stuff[1], TRUE, TRUE); if (err != Success) return err; else diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index fd5e5db1d..aa1cd7543 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -141,7 +141,7 @@ static int numEnabledRCAPs; } static int RecordDeleteContext( - pointer /*value*/, + void * /*value*/, XID /*id*/ ); @@ -242,9 +242,9 @@ RecordFindContextOnAllContexts(pContext) static void RecordFlushReplyBuffer( RecordContextPtr pContext, - pointer data1, + void * data1, int len1, - pointer data2, + void * data2, int len2 ) { @@ -290,7 +290,7 @@ RecordFlushReplyBuffer( */ static void RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, - int category, pointer data, int datalen, int futurelen) + int category, void * data, int datalen, int futurelen) { CARD32 elemHeaderData[2]; int numElemHeaders = 0; @@ -404,8 +404,8 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, } } else - RecordFlushReplyBuffer(pContext, (pointer)elemHeaderData, - numElemHeaders, (pointer)data, datalen); + RecordFlushReplyBuffer(pContext, (void *)elemHeaderData, + numElemHeaders, (void *)data, datalen); } /* RecordAProtocolElement */ @@ -487,19 +487,19 @@ RecordABigRequest(pContext, client, stuff) /* record the request header */ bytesLeft = client->req_len << 2; RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer)stuff, SIZEOF(xReq), bytesLeft); + (void *)stuff, SIZEOF(xReq), bytesLeft); /* reinsert the extended length field that was squished out */ bigLength = client->req_len + (sizeof(bigLength) >> 2); if (client->swapped) swapl(&bigLength, n); RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer)&bigLength, sizeof(bigLength), /* continuation */ -1); + (void *)&bigLength, sizeof(bigLength), /* continuation */ -1); bytesLeft -= sizeof(bigLength); /* record the rest of the request after the length */ RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer)(stuff + 1), bytesLeft, /* continuation */ -1); + (void *)(stuff + 1), bytesLeft, /* continuation */ -1); } /* RecordABigRequest */ @@ -547,7 +547,7 @@ RecordARequest(client) RecordABigRequest(pContext, client, stuff); else RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer)stuff, client->req_len << 2, 0); + (void *)stuff, client->req_len << 2, 0); } else /* extension, check minor opcode */ { @@ -570,7 +570,7 @@ RecordARequest(client) RecordABigRequest(pContext, client, stuff); else RecordAProtocolElement(pContext, client, - XRecordFromClient, (pointer)stuff, + XRecordFromClient, (void *)stuff, client->req_len << 2, 0); break; } @@ -607,8 +607,8 @@ RecordARequest(client) static void RecordASkippedRequest(pcbl , nulldata, calldata) CallbackListPtr *pcbl; - pointer nulldata; - pointer calldata; + void * nulldata; + void * calldata; { SkippedRequestInfoRec *psi = (SkippedRequestInfoRec *)calldata; RecordContextPtr pContext; @@ -639,7 +639,7 @@ RecordASkippedRequest(pcbl , nulldata, calldata) { /* core request */ RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer)stuff, reqlen, 0); + (void *)stuff, reqlen, 0); } else /* extension, check minor opcode */ { @@ -659,7 +659,7 @@ RecordASkippedRequest(pcbl , nulldata, calldata) minorop)) { RecordAProtocolElement(pContext, client, - XRecordFromClient, (pointer)stuff, + XRecordFromClient, (void *)stuff, reqlen, 0); break; } @@ -697,8 +697,8 @@ RecordASkippedRequest(pcbl , nulldata, calldata) static void RecordAReply(pcbl, nulldata, calldata) CallbackListPtr *pcbl; - pointer nulldata; - pointer calldata; + void * nulldata; + void * calldata; { RecordContextPtr pContext; RecordClientsAndProtocolPtr pRCAP; @@ -782,8 +782,8 @@ RecordAReply(pcbl, nulldata, calldata) static void RecordADeliveredEventOrError(pcbl, nulldata, calldata) CallbackListPtr *pcbl; - pointer nulldata; - pointer calldata; + void * nulldata; + void * calldata; { EventInfoRec *pei = (EventInfoRec *)calldata; RecordContextPtr pContext; @@ -851,8 +851,8 @@ RecordADeliveredEventOrError(pcbl, nulldata, calldata) static void RecordADeviceEvent(pcbl, nulldata, calldata) CallbackListPtr *pcbl; - pointer nulldata; - pointer calldata; + void * nulldata; + void * calldata; { DeviceEventInfoRec *pei = (DeviceEventInfoRec *)calldata; RecordContextPtr pContext; @@ -932,8 +932,8 @@ RecordADeviceEvent(pcbl, nulldata, calldata) static void RecordFlushAllContexts( CallbackListPtr *pcbl, - pointer nulldata, - pointer calldata + void * nulldata, + void * calldata ) { int eci; /* enabled context index */ @@ -1008,7 +1008,7 @@ RecordInstallHooks(pRCAP, oneclient) sizeof (pClientPriv->recordVector)); pClientPriv->originalVector = pClient->requestVector; pClient->devPrivates[RecordClientPrivateIndex].ptr = - (pointer)pClientPriv; + (void *)pClientPriv; pClient->requestVector = pClientPriv->recordVector; } while ((pIter = RecordIterateSet(pRCAP->pRequestMajorOpSet, @@ -2061,7 +2061,7 @@ ProcRecordCreateContext(client) } else { - RecordDeleteContext((pointer)pContext, pContext->id); + RecordDeleteContext((void *)pContext, pContext->id); err = BadAlloc; } bailout: @@ -2621,7 +2621,7 @@ ProcRecordDisableContext(client) */ static int RecordDeleteContext(value, id) - pointer value; + void * value; XID id; { int i; @@ -2755,7 +2755,7 @@ SProcRecordCreateContext(client) swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq); - if ((status = SwapCreateRegister((pointer)stuff)) != Success) + if ((status = SwapCreateRegister((void *)stuff)) != Success) return status; return ProcRecordCreateContext(client); } /* SProcRecordCreateContext */ @@ -2771,7 +2771,7 @@ SProcRecordRegisterClients(client) swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq); - if ((status = SwapCreateRegister((pointer)stuff)) != Success) + if ((status = SwapCreateRegister((void *)stuff)) != Success) return status; return ProcRecordRegisterClients(client); } /* SProcRecordRegisterClients */ @@ -2908,7 +2908,7 @@ RecordConnectionSetupInfo(pContext, pci) SwapConnSetupPrefix(pci->prefix, pConnSetup); SwapConnSetupInfo(pci->setup, pConnSetup + prefixsize); RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, - (pointer)pConnSetup, prefixsize + restsize, 0); + (void *)pConnSetup, prefixsize + restsize, 0); DEALLOCATE_LOCAL(pConnSetup); } else @@ -2917,9 +2917,9 @@ RecordConnectionSetupInfo(pContext, pci) * data in two pieces */ RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, - (pointer)pci->prefix, prefixsize, restsize); + (void *)pci->prefix, prefixsize, restsize); RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, - (pointer)pci->setup, restsize, /* continuation */ -1); + (void *)pci->setup, restsize, /* continuation */ -1); } } /* RecordConnectionSetupInfo */ @@ -2950,8 +2950,8 @@ RecordConnectionSetupInfo(pContext, pci) static void RecordAClientStateChange(pcbl, nulldata, calldata) CallbackListPtr *pcbl; - pointer nulldata; - pointer calldata; + void * nulldata; + void * calldata; { NewClientInfoRec *pci = (NewClientInfoRec *)calldata; int i; diff --git a/nx-X11/programs/Xserver/record/recordmod.c b/nx-X11/programs/Xserver/record/recordmod.c index 5afb1d379..5a74f0f1a 100644 --- a/nx-X11/programs/Xserver/record/recordmod.c +++ b/nx-X11/programs/Xserver/record/recordmod.c @@ -35,12 +35,12 @@ static XF86ModuleVersionInfo VersRec = { XF86ModuleData recordModuleData = { &VersRec, recordSetup, NULL }; -static pointer -recordSetup(pointer module, pointer opts, int *errmaj, int *errmin) +static void * +recordSetup(void * module, void * opts, int *errmaj, int *errmin) { LoadExtension(&recordExt, FALSE); /* Need a non-NULL return value to indicate success */ - return (pointer)1; + return (void *)1; } diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index e3915b2b8..15293af64 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -95,7 +95,7 @@ int AnimCurGeneration; #define GetAnimCur(c) ((AnimCurPtr) ((c) + 1)) #define GetAnimCurScreen(s) ((AnimCurScreenPtr) ((s)->devPrivates[AnimCurScreenPrivateIndex].ptr)) #define GetAnimCurScreenIfSet(s) ((AnimCurScreenPrivateIndex != -1) ? GetAnimCurScreen(s) : NULL) -#define SetAnimCurScreen(s,p) ((s)->devPrivates[AnimCurScreenPrivateIndex].ptr = (pointer) (p)) +#define SetAnimCurScreen(s,p) ((s)->devPrivates[AnimCurScreenPrivateIndex].ptr = (void *) (p)) #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) @@ -164,9 +164,9 @@ AnimCurCursorLimits (ScreenPtr pScreen, static void AnimCurScreenBlockHandler (int screenNum, - pointer blockData, - pointer pTimeout, - pointer pReadmask) + void * blockData, + void * pTimeout, + void * pReadmask) { ScreenPtr pScreen = screenInfo.screens[screenNum]; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index 9f4d1c87b..900cf9844 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -114,30 +114,30 @@ ResetGlyphSetPrivateIndex (void) } Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr) +_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr) { - pointer *new; + void **new; if (n > glyphSet->maxPrivate) { if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) { - new = (pointer *) xrealloc (glyphSet->devPrivates, - (n + 1) * sizeof (pointer)); + glyphSet->devPrivates != (void *)(&glyphSet[1])) { + new = (void **) xrealloc (glyphSet->devPrivates, + (n + 1) * sizeof (void *)); if (!new) return FALSE; } else { - new = (pointer *) xalloc ((n + 1) * sizeof (pointer)); + new = (void **) xalloc ((n + 1) * sizeof (void *)); if (!new) return FALSE; if (glyphSet->devPrivates) memcpy (new, glyphSet->devPrivates, - (glyphSet->maxPrivate + 1) * sizeof (pointer)); + (glyphSet->maxPrivate + 1) * sizeof (void *)); } glyphSet->devPrivates = new; /* Zero out new, uninitialize privates */ while (++glyphSet->maxPrivate < n) - glyphSet->devPrivates[glyphSet->maxPrivate] = (pointer)0; + glyphSet->devPrivates[glyphSet->maxPrivate] = (void *)0; } glyphSet->devPrivates[n] = ptr; return TRUE; @@ -430,14 +430,14 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) } size = (sizeof (GlyphSetRec) + - (sizeof (pointer) * _GlyphSetPrivateAllocateIndex)); + (sizeof (void *) * _GlyphSetPrivateAllocateIndex)); glyphSet = xalloc (size); if (!glyphSet) return FALSE; bzero((char *)glyphSet, size); glyphSet->maxPrivate = _GlyphSetPrivateAllocateIndex - 1; if (_GlyphSetPrivateAllocateIndex) - glyphSet->devPrivates = (pointer)(&glyphSet[1]); + glyphSet->devPrivates = (void *)(&glyphSet[1]); if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) { @@ -451,7 +451,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) } int -FreeGlyphSet (pointer value, +FreeGlyphSet (void *value, XID gid) { GlyphSetPtr glyphSet = (GlyphSetPtr) value; @@ -479,7 +479,7 @@ FreeGlyphSet (pointer value, xfree (table); if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) + glyphSet->devPrivates != (void *)(&glyphSet[1])) xfree(glyphSet->devPrivates); xfree (glyphSet); diff --git a/nx-X11/programs/Xserver/render/glyphstr.h b/nx-X11/programs/Xserver/render/glyphstr.h index f4777a248..e9bbd19b0 100644 --- a/nx-X11/programs/Xserver/render/glyphstr.h +++ b/nx-X11/programs/Xserver/render/glyphstr.h @@ -69,12 +69,12 @@ typedef struct _GlyphSet { int fdepth; GlyphHashRec hash; int maxPrivate; - pointer *devPrivates; + void **devPrivates; } GlyphSetRec, *GlyphSetPtr; #define GlyphSetGetPrivate(pGlyphSet,n) \ ((n) > (pGlyphSet)->maxPrivate ? \ - (pointer) 0 : \ + (void *) 0 : \ (pGlyphSet)->devPrivates[n]) #define GlyphSetSetPrivate(pGlyphSet,n,ptr) \ @@ -101,7 +101,7 @@ void ResetGlyphSetPrivateIndex (void); Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr); +_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr); Bool GlyphInit (ScreenPtr pScreen); @@ -140,7 +140,7 @@ GlyphSetPtr AllocateGlyphSet (int fdepth, PictFormatPtr format); int -FreeGlyphSet (pointer value, +FreeGlyphSet (void *value, XID gid); diff --git a/nx-X11/programs/Xserver/render/miglyph.c b/nx-X11/programs/Xserver/render/miglyph.c index 237ec13a4..8b046bd46 100644 --- a/nx-X11/programs/Xserver/render/miglyph.c +++ b/nx-X11/programs/Xserver/render/miglyph.c @@ -168,7 +168,7 @@ miGlyphs (CARD8 op, pPixmap = GetScratchPixmapHeader (pScreen, glyph->info.width, glyph->info.height, list->format->depth, list->format->depth, - 0, (pointer) (glyph + 1)); + 0, (void *) (glyph + 1)); if (!pPixmap) return; component_alpha = NeedsComponent(list->format->format); @@ -183,7 +183,7 @@ miGlyphs (CARD8 op, } (*pScreen->ModifyPixmapHeader) (pPixmap, glyph->info.width, glyph->info.height, - 0, 0, -1, (pointer) (glyph + 1)); + 0, 0, -1, (void *) (glyph + 1)); pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (maskFormat) { @@ -219,7 +219,7 @@ miGlyphs (CARD8 op, if (pPicture) { FreeScratchPixmapHeader (pPixmap); - FreePicture ((pointer) pPicture, 0); + FreePicture ((void *) pPicture, 0); pPicture = 0; pPixmap = 0; } @@ -237,7 +237,7 @@ miGlyphs (CARD8 op, 0, 0, x, y, width, height); - FreePicture ((pointer) pMask, (XID) 0); + FreePicture ((void *) pMask, (XID) 0); (*pScreen->DestroyPixmap) (pMaskPixmap); } } diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index 59707ea70..cf9c27f01 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -75,18 +75,18 @@ miDestroyPictureClip (PicturePtr pPicture) int miChangePictureClip (PicturePtr pPicture, int type, - pointer value, + void * value, int n) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); - pointer clientClip; + void * clientClip; int clientClipType; switch (type) { case CT_PIXMAP: /* convert the pixmap to a region */ - clientClip = (pointer) BITMAP_TO_REGION(pScreen, (PixmapPtr) value); + clientClip = (void *) BITMAP_TO_REGION(pScreen, (PixmapPtr) value); if (!clientClip) return BadAlloc; clientClipType = CT_REGION; @@ -101,7 +101,7 @@ miChangePictureClip (PicturePtr pPicture, clientClipType = CT_NONE; break; default: - clientClip = (pointer) RECTS_TO_REGION(pScreen, n, + clientClip = (void *) RECTS_TO_REGION(pScreen, n, (xRectangle *) value, type); if (!clientClip) diff --git a/nx-X11/programs/Xserver/render/mipict.h b/nx-X11/programs/Xserver/render/mipict.h index 0c2ed04d5..726d8be65 100644 --- a/nx-X11/programs/Xserver/render/mipict.h +++ b/nx-X11/programs/Xserver/render/mipict.h @@ -60,7 +60,7 @@ miDestroyPictureClip (PicturePtr pPicture); int miChangePictureClip (PicturePtr pPicture, int type, - pointer value, + void * value, int n); void diff --git a/nx-X11/programs/Xserver/render/mirect.c b/nx-X11/programs/Xserver/render/mirect.c index 096bb5cb2..c4aeb9aba 100644 --- a/nx-X11/programs/Xserver/render/mirect.c +++ b/nx-X11/programs/Xserver/render/mirect.c @@ -174,7 +174,7 @@ miCompositeRects (CARD8 op, rects++; } - FreePicture ((pointer) pSrc, 0); + FreePicture ((void *) pSrc, 0); bail4: FreeScratchGC (pGC); bail3: diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 3ed60310e..754d468bb 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -114,7 +114,7 @@ PictureDestroyWindow (WindowPtr pWindow) SetPictureWindow(pWindow, pPicture->pNext); if (pPicture->id) FreeResource (pPicture->id, PictureType); - FreePicture ((pointer) pPicture, pPicture->id); + FreePicture ((void *) pPicture, pPicture->id); } pScreen->DestroyWindow = ps->DestroyWindow; ret = (*pScreen->DestroyWindow) (pWindow); @@ -653,7 +653,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) } for (n = 0; n < nformats; n++) { - if (!AddResource (formats[n].id, PictFormatType, (pointer) (formats+n))) + if (!AddResource (formats[n].id, PictFormatType, (void *) (formats+n))) { xfree (formats); return FALSE; @@ -789,11 +789,11 @@ AllocatePicture (ScreenPtr pScreen) { if ( (size = *sizes) ) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } return pPicture; } @@ -1223,7 +1223,7 @@ ChangePicture (PicturePtr pPicture, if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP) pAlpha->refcnt++; if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); + FreePicture ((void *) pPicture->alphaMap, (XID) 0); pPicture->alphaMap = pAlpha; } } @@ -1295,7 +1295,7 @@ ChangePicture (PicturePtr pPicture, } } error = (*ps->ChangePictureClip)(pPicture, clipType, - (pointer)pPixmap, 0); + (void *)pPixmap, 0); break; } case CPGraphicsExposure: @@ -1395,7 +1395,7 @@ SetPictureClipRects (PicturePtr pPicture, if (!clientClip) return BadAlloc; result =(*ps->ChangePictureClip) (pPicture, CT_REGION, - (pointer) clientClip, 0); + (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; @@ -1439,7 +1439,7 @@ SetPictureClipRegion (PicturePtr pPicture, } result =(*ps->ChangePictureClip) (pPicture, type, - (pointer) clientClip, 0); + (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; @@ -1511,7 +1511,7 @@ CopyPicture (PicturePtr pSrc, if (pSrc->alphaMap && pSrc->alphaMap->pDrawable->type == DRAWABLE_PIXMAP) pSrc->alphaMap->refcnt++; if (pDst->alphaMap) - FreePicture ((pointer) pDst->alphaMap, (XID) 0); + FreePicture ((void *) pDst->alphaMap, (XID) 0); pDst->alphaMap = pSrc->alphaMap; break; case CPAlphaXOrigin: @@ -1593,7 +1593,7 @@ ValidatePicture(PicturePtr pPicture) } int -FreePicture (pointer value, +FreePicture (void * value, XID pid) { PicturePtr pPicture = (PicturePtr) value; @@ -1613,7 +1613,7 @@ FreePicture (pointer value, PictureScreenPtr ps = GetPictureScreen(pScreen); if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); + FreePicture ((void *) pPicture->alphaMap, (XID) 0); (*ps->DestroyPicture) (pPicture); (*ps->DestroyPictureClip) (pPicture); if (pPicture->pDrawable->type == DRAWABLE_WINDOW) @@ -1643,7 +1643,7 @@ FreePicture (pointer value, } int -FreePictFormat (pointer pPictFormat, +FreePictFormat (void * pPictFormat, XID pid) { return Success; diff --git a/nx-X11/programs/Xserver/render/picturestr.h b/nx-X11/programs/Xserver/render/picturestr.h index 561625766..96c2b8abc 100644 --- a/nx-X11/programs/Xserver/render/picturestr.h +++ b/nx-X11/programs/Xserver/render/picturestr.h @@ -149,7 +149,7 @@ typedef struct _Picture { DDXPointRec alphaOrigin; DDXPointRec clipOrigin; - pointer clientClip; + void *clientClip; Atom dither; @@ -195,7 +195,7 @@ typedef int (*CreatePictureProcPtr) (PicturePtr pPicture); typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture); typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture, int clipType, - pointer value, + void *value, int n); typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture); @@ -374,9 +374,9 @@ extern RESTYPE GlyphSetType; #define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr)) #define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL) -#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p)) +#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (void *) (p)) #define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr)) -#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p)) +#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (void *) (p)) #define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\ pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\ @@ -516,11 +516,11 @@ void ValidatePicture(PicturePtr pPicture); int -FreePicture (pointer pPicture, +FreePicture (void *pPicture, XID pid); int -FreePictFormat (pointer pPictFormat, +FreePictFormat (void *pPictFormat, XID pid); void diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 6a65631ea..8d644b35e 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -230,8 +230,8 @@ typedef struct _RenderClient { static void RenderClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) + void * closure, + void * data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -660,7 +660,7 @@ ProcRenderCreatePicture (ClientPtr client) &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -1031,7 +1031,7 @@ ProcRenderCreateGlyphSet (ClientPtr client) glyphSet = AllocateGlyphSet (f, format); if (!glyphSet) return BadAlloc; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) + if (!AddResource (stuff->gsid, GlyphSetType, (void *)glyphSet)) return BadAlloc; return Success; } @@ -1056,7 +1056,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client) return RenderErrBase + BadGlyphSet; } glyphSet->refcnt++; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) + if (!AddResource (stuff->gsid, GlyphSetType, (void *)glyphSet)) return BadAlloc; return client->noClientException; } @@ -1540,7 +1540,7 @@ ProcRenderCreateCursor (ClientPtr client) { (*pScreen->GetImage) (pSrc->pDrawable, 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); + 0xffffffff, (void *) argbbits); } else { @@ -1580,7 +1580,7 @@ ProcRenderCreateCursor (ClientPtr client) 0, 0, 0, 0, 0, 0, width, height); (*pScreen->GetImage) (pPicture->pDrawable, 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); + 0xffffffff, (void *) argbbits); FreePicture (pPicture, 0); } /* @@ -1673,7 +1673,7 @@ ProcRenderCreateCursor (ClientPtr client) GetColor(twocolor[1], 16), GetColor(twocolor[1], 8), GetColor(twocolor[1], 0)); - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (pCursor && AddResource(stuff->cid, RT_CURSOR, (void *)pCursor)) return (client->noClientException); return BadAlloc; } @@ -1864,7 +1864,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) if (ret != Success) return ret; - if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (AddResource (stuff->cid, RT_CURSOR, (void *)pCursor)) return client->noClientException; return BadAlloc; } @@ -1905,7 +1905,7 @@ static int ProcRenderCreateSolidFill(ClientPtr client) pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -1936,7 +1936,7 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -1966,7 +1966,7 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -1995,7 +1995,7 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index f6895d193..8bdaca84d 100755 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -76,7 +76,7 @@ typedef struct _CursorScreen { #define GetCursorScreen(s) ((CursorScreenPtr) ((s)->devPrivates[CursorScreenPrivateIndex].ptr)) #define GetCursorScreenIfSet(s) ((CursorScreenPrivateIndex != -1) ? GetCursorScreen(s) : NULL) -#define SetCursorScreen(s,p) ((s)->devPrivates[CursorScreenPrivateIndex].ptr = (pointer) (p)) +#define SetCursorScreen(s,p) ((s)->devPrivates[CursorScreenPrivateIndex].ptr = (void *) (p)) #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) @@ -172,13 +172,13 @@ XFixesSelectCursorInput (ClientPtr pClient, */ if (!LookupIDByType(pWindow->drawable.id, CursorWindowType)) if (!AddResource (pWindow->drawable.id, CursorWindowType, - (pointer) pWindow)) + (void *) pWindow)) { xfree (e); return BadAlloc; } - if (!AddResource (e->clientResource, CursorClientType, (pointer) e)) + if (!AddResource (e->clientResource, CursorClientType, (void *) e)) return BadAlloc; *prev = e; @@ -520,13 +520,13 @@ SProcXFixesGetCursorImageAndName (ClientPtr client) * whether it should be replaced with a reference to pCursor. */ -typedef Bool (*TestCursorFunc) (CursorPtr pOld, pointer closure); +typedef Bool (*TestCursorFunc) (CursorPtr pOld, void * closure); typedef struct { RESTYPE type; TestCursorFunc testCursor; CursorPtr pNew; - pointer closure; + void * closure; } ReplaceCursorLookupRec, *ReplaceCursorLookupPtr; static const RESTYPE CursorRestypes[] = { @@ -536,7 +536,7 @@ static const RESTYPE CursorRestypes[] = { #define NUM_CURSOR_RESTYPES (sizeof (CursorRestypes) / sizeof (CursorRestypes[0])) static Bool -ReplaceCursorLookup (pointer value, XID id, pointer closure) +ReplaceCursorLookup (void * value, XID id, void * closure) { ReplaceCursorLookupPtr rcl = (ReplaceCursorLookupPtr) closure; WindowPtr pWin; @@ -583,7 +583,7 @@ ReplaceCursorLookup (pointer value, XID id, pointer closure) static void ReplaceCursor (CursorPtr pCursor, TestCursorFunc testCursor, - pointer closure) + void * closure) { int clientIndex; int resIndex; @@ -612,7 +612,7 @@ ReplaceCursor (CursorPtr pCursor, LookupClientResourceComplex (clients[clientIndex], rcl.type, ReplaceCursorLookup, - (pointer) &rcl); + (void *) &rcl); } } /* this "knows" that WindowHasNewCursor doesn't depend on it's argument */ @@ -620,7 +620,7 @@ ReplaceCursor (CursorPtr pCursor, } static Bool -TestForCursor (CursorPtr pCursor, pointer closure) +TestForCursor (CursorPtr pCursor, void * closure) { return (pCursor == (CursorPtr) closure); } @@ -635,7 +635,7 @@ ProcXFixesChangeCursor (ClientPtr client) VERIFY_CURSOR (pSource, stuff->source, client, SecurityReadAccess); VERIFY_CURSOR (pDestination, stuff->destination, client, SecurityWriteAccess); - ReplaceCursor (pSource, TestForCursor, (pointer) pDestination); + ReplaceCursor (pSource, TestForCursor, (void *) pDestination); return (client->noClientException); } @@ -653,7 +653,7 @@ SProcXFixesChangeCursor (ClientPtr client) } static Bool -TestForCursorName (CursorPtr pCursor, pointer closure) +TestForCursorName (CursorPtr pCursor, void * closure) { return (pCursor->name == (Atom) closure); } @@ -671,7 +671,7 @@ ProcXFixesChangeCursorByName (ClientPtr client) tchar = (char *) &stuff[1]; name = MakeAtom (tchar, stuff->nbytes, FALSE); if (name) - ReplaceCursor (pSource, TestForCursorName, (pointer) name); + ReplaceCursor (pSource, TestForCursorName, (void *) name); return (client->noClientException); } @@ -689,7 +689,7 @@ SProcXFixesChangeCursorByName (ClientPtr client) } static int -CursorFreeClient (pointer data, XID id) +CursorFreeClient (void * data, XID id) { CursorEventPtr old = (CursorEventPtr) data; CursorEventPtr *prev, e; @@ -707,7 +707,7 @@ CursorFreeClient (pointer data, XID id) } static int -CursorFreeWindow (pointer data, XID id) +CursorFreeWindow (void * data, XID id) { WindowPtr pWindow = (WindowPtr) data; CursorEventPtr e, next; diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 9ceff6d51..cb9e0de9a 100755 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -39,7 +39,7 @@ extern int RenderErrBase; RESTYPE RegionResType; static int -RegionResFree (pointer data, XID id) +RegionResFree (void * data, XID id) { RegionPtr pRegion = (RegionPtr) data; @@ -87,7 +87,7 @@ ProcXFixesCreateRegion (ClientPtr client) pRegion = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED); if (!pRegion) return BadAlloc; - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -132,7 +132,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) if (!pRegion) return BadAlloc; - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -196,7 +196,7 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client) pRegion = XFixesRegionCopy (pRegion); if (!pRegion) return BadAlloc; - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -243,7 +243,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) return BadImplementation; /* assume sane server bits */ } - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -292,7 +292,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) return BadImplementation; /* assume sane server bits */ } - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -646,7 +646,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client) vals[0] = stuff->xOrigin; vals[1] = stuff->yOrigin; DoChangeGC (pGC, GCClipXOrigin|GCClipYOrigin, vals, 0); - (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0); + (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (void *)pRegion, 0); return (client->noClientException); } diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c index ddc776ef7..464979165 100755 --- a/nx-X11/programs/Xserver/xfixes/select.c +++ b/nx-X11/programs/Xserver/xfixes/select.c @@ -52,7 +52,7 @@ typedef struct _SelectionEvent { static SelectionEventPtr selectionEvents; static void -XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args) +XFixesSelectionCallback (CallbackListPtr *callbacks, void * data, void * args) { SelectionEventPtr e; SelectionInfoRec *info = (SelectionInfoRec *) args; @@ -172,13 +172,13 @@ XFixesSelectSelectionInput (ClientPtr pClient, */ if (!LookupIDByType(pWindow->drawable.id, SelectionWindowType)) if (!AddResource (pWindow->drawable.id, SelectionWindowType, - (pointer) pWindow)) + (void *) pWindow)) { xfree (e); return BadAlloc; } - if (!AddResource (e->clientResource, SelectionClientType, (pointer) e)) + if (!AddResource (e->clientResource, SelectionClientType, (void *) e)) return BadAlloc; *prev = e; @@ -240,7 +240,7 @@ SXFixesSelectionNotifyEvent (xXFixesSelectionNotifyEvent *from, } static int -SelectionFreeClient (pointer data, XID id) +SelectionFreeClient (void * data, XID id) { SelectionEventPtr old = (SelectionEventPtr) data; SelectionEventPtr *prev, e; @@ -259,7 +259,7 @@ SelectionFreeClient (pointer data, XID id) } static int -SelectionFreeWindow (pointer data, XID id) +SelectionFreeWindow (void * data, XID id) { WindowPtr pWindow = (WindowPtr) data; SelectionEventPtr e, next; diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c index 1465931cb..3b3a0f305 100755 --- a/nx-X11/programs/Xserver/xfixes/xfixes.c +++ b/nx-X11/programs/Xserver/xfixes/xfixes.c @@ -185,8 +185,8 @@ SProcXFixesDispatch (ClientPtr client) static void XFixesClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) + void *closure, + void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; diff --git a/nx-X11/programs/Xserver/xkb/ddxBeep.c b/nx-X11/programs/Xserver/xkb/ddxBeep.c index 429d1e778..22d62a502 100644 --- a/nx-X11/programs/Xserver/xkb/ddxBeep.c +++ b/nx-X11/programs/Xserver/xkb/ddxBeep.c @@ -148,7 +148,7 @@ _XkbDDXBeepInitAtoms(void) } static CARD32 -_XkbDDXBeepExpire(OsTimerPtr timer,CARD32 now,pointer arg) +_XkbDDXBeepExpire(OsTimerPtr timer,CARD32 now,void * arg) { DeviceIntPtr dev= (DeviceIntPtr)arg; KbdFeedbackPtr feed; @@ -322,11 +322,11 @@ Atom name; ctrl->bell_duration= duration; ctrl->bell_pitch= pitch; if (xkbInfo->beepCount==0) { - XkbHandleBell(0,0,dev,ctrl->bell,(pointer)ctrl,KbdFeedbackClass,name,None, + XkbHandleBell(0,0,dev,ctrl->bell,(void *)ctrl,KbdFeedbackClass,name,None, NULL); } else if (xkbInfo->desc->ctrls->enabled_ctrls&XkbAudibleBellMask) { - (*dev->kbdfeed->BellProc)(ctrl->bell,dev,(pointer)ctrl,KbdFeedbackClass); + (*dev->kbdfeed->BellProc)(ctrl->bell,dev,(void *)ctrl,KbdFeedbackClass); } ctrl->bell_duration= oldDuration; ctrl->bell_pitch= oldPitch; @@ -360,11 +360,11 @@ CARD32 next; xkbInfo->beepType= what; xkbInfo->beepCount= 0; - next= _XkbDDXBeepExpire(NULL,0,(pointer)dev); + next= _XkbDDXBeepExpire(NULL,0,(void *)dev); if (next>0) { xkbInfo->beepTimer= TimerSet(xkbInfo->beepTimer, 0, next, - _XkbDDXBeepExpire, (pointer)dev); + _XkbDDXBeepExpire, (void *)dev); } return 1; } diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 1e4052914..441d88a5c 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -369,7 +369,7 @@ ProcXkbBell(ClientPtr client) WindowPtr pWin; int base; int newPercent,oldPitch,oldDuration; - pointer ctrl; + void * ctrl; REQUEST_SIZE_MATCH(xkbBellReq); @@ -416,7 +416,7 @@ ProcXkbBell(ClientPtr client) return BadValue; } base = k->ctrl.bell; - ctrl = (pointer) &(k->ctrl); + ctrl = (void *) &(k->ctrl); oldPitch= k->ctrl.bell_pitch; oldDuration= k->ctrl.bell_duration; if (stuff->pitch!=0) { @@ -445,7 +445,7 @@ ProcXkbBell(ClientPtr client) return BadValue; } base = b->ctrl.percent; - ctrl = (pointer) &(b->ctrl); + ctrl = (void *) &(b->ctrl); oldPitch= b->ctrl.pitch; oldDuration= b->ctrl.duration; if (stuff->pitch!=0) { @@ -6241,7 +6241,7 @@ ProcXkbDispatch (ClientPtr client) } static int -XkbClientGone(pointer data,XID id) +XkbClientGone(void * data,XID id) { DevicePtr pXDev = (DevicePtr)data; diff --git a/nx-X11/programs/Xserver/xkb/xkb.h b/nx-X11/programs/Xserver/xkb/xkb.h index 704cd49c0..3a8a49541 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.h +++ b/nx-X11/programs/Xserver/xkb/xkb.h @@ -51,7 +51,7 @@ extern Bool XkbApplyLEDChangeToKeyboard( Bool on, XkbChangesPtr change); -extern Bool XkbWriteRulesProp(ClientPtr client, pointer closure); +extern Bool XkbWriteRulesProp(ClientPtr client, void * closure); extern XkbAction XkbGetButtonAction(DeviceIntPtr kbd, DeviceIntPtr dev, int button); diff --git a/nx-X11/programs/Xserver/xkb/xkbAccessX.c b/nx-X11/programs/Xserver/xkb/xkbAccessX.c index b31ca7ed5..75e46dc32 100644 --- a/nx-X11/programs/Xserver/xkb/xkbAccessX.c +++ b/nx-X11/programs/Xserver/xkb/xkbAccessX.c @@ -47,7 +47,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. int XkbDfltRepeatDelay= 660; int XkbDfltRepeatInterval= 40; -pointer XkbLastRepeatEvent= NULL; +void * XkbLastRepeatEvent= NULL; #define DFLT_TIMEOUT_CTRLS (XkbAX_KRGMask|XkbStickyKeysMask|XkbMouseKeysMask) #define DFLT_TIMEOUT_OPTS (XkbAX_IndicatorFBMask) @@ -141,7 +141,7 @@ xEvent xE; if (_XkbIsPressEvent(type)) XkbDDXKeyClick(keybd,keyCode,TRUE); else if (isRepeat) - XkbLastRepeatEvent= (pointer)&xE; + XkbLastRepeatEvent= (void *)&xE; XkbProcessKeyboardEvent(&xE,keybd,1L); XkbLastRepeatEvent= NULL; return; @@ -286,7 +286,7 @@ XkbSrvLedInfoPtr sli; } /* AccessXStickyKeysTurnOff */ static CARD32 -AccessXKRGExpire(OsTimerPtr timer,CARD32 now,pointer arg) +AccessXKRGExpire(OsTimerPtr timer,CARD32 now,void * arg) { XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo; xkbControlsNotify cn; @@ -308,7 +308,7 @@ xkbControlsNotify cn; } static CARD32 -AccessXRepeatKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg) +AccessXRepeatKeyExpire(OsTimerPtr timer,CARD32 now,void * arg) { XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo; KeyCode key; @@ -330,7 +330,7 @@ AccessXCancelRepeatKey(XkbSrvInfoPtr xkbi,KeyCode key) } static CARD32 -AccessXSlowKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg) +AccessXSlowKeyExpire(OsTimerPtr timer,CARD32 now,void * arg) { DeviceIntPtr keybd; XkbSrvInfoPtr xkbi; @@ -370,7 +370,7 @@ XkbControlsPtr ctrls; xkbi->repeatKey = xkbi->slowKey; xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer, 0, ctrls->repeat_delay, - AccessXRepeatKeyExpire, (pointer)keybd); + AccessXRepeatKeyExpire, (void *)keybd); } } } @@ -378,7 +378,7 @@ XkbControlsPtr ctrls; } static CARD32 -AccessXBounceKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg) +AccessXBounceKeyExpire(OsTimerPtr timer,CARD32 now,void * arg) { XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo; @@ -387,7 +387,7 @@ XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo; } static CARD32 -AccessXTimeoutExpire(OsTimerPtr timer,CARD32 now,pointer arg) +AccessXTimeoutExpire(OsTimerPtr timer,CARD32 now,void * arg) { DeviceIntPtr dev = (DeviceIntPtr)arg; XkbSrvInfoPtr xkbi= dev->key->xkbInfo; @@ -466,12 +466,12 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key); if (XkbAX_NeedFeedback(ctrls,XkbAX_SlowWarnFBMask)) { xkbi->krgTimerActive = _KRG_WARN_TIMER; xkbi->krgTimer= TimerSet(xkbi->krgTimer, 0, 4000, - AccessXKRGExpire, (pointer)keybd); + AccessXKRGExpire, (void *)keybd); } else { xkbi->krgTimerActive = _KRG_TIMER; xkbi->krgTimer= TimerSet(xkbi->krgTimer, 0, 8000, - AccessXKRGExpire, (pointer)keybd); + AccessXKRGExpire, (void *)keybd); } if (!(ctrls->enabled_ctrls & XkbSlowKeysMask)) { CARD32 now= GetTimeInMillis(); @@ -510,7 +510,7 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key); xkbi->slowKey= key; xkbi->slowKeysTimer = TimerSet(xkbi->slowKeysTimer, 0, ctrls->slow_keys_delay, - AccessXSlowKeyExpire, (pointer)keybd); + AccessXSlowKeyExpire, (void *)keybd); ignoreKeyEvent = TRUE; } @@ -543,7 +543,7 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key); xkbi->repeatKey = key; xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer, 0, ctrls->repeat_delay, - AccessXRepeatKeyExpire, (pointer)keybd); + AccessXRepeatKeyExpire, (void *)keybd); } } } @@ -604,7 +604,7 @@ Bool ignoreKeyEvent = FALSE; xkbi->inactiveKey= key; xkbi->bounceKeysTimer= TimerSet(xkbi->bounceKeysTimer, 0, ctrls->debounce_delay, - AccessXBounceKeyExpire, (pointer)keybd); + AccessXBounceKeyExpire, (void *)keybd); } /* Don't transmit the KeyRelease if SlowKeys is turned on and @@ -645,7 +645,7 @@ Bool ignoreKeyEvent = FALSE; xkbi->lastPtrEventTime= 0; xkbi->krgTimer= TimerSet(xkbi->krgTimer, 0, ctrls->ax_timeout*1000, - AccessXTimeoutExpire, (pointer)keybd); + AccessXTimeoutExpire, (void *)keybd); xkbi->krgTimerActive= _ALL_TIMEOUT_TIMER; } else if (xkbi->krgTimerActive!=_OFF_TIMER) { diff --git a/nx-X11/programs/Xserver/xkb/xkbActions.c b/nx-X11/programs/Xserver/xkb/xkbActions.c index b767658f3..b7f3e13a5 100644 --- a/nx-X11/programs/Xserver/xkb/xkbActions.c +++ b/nx-X11/programs/Xserver/xkb/xkbActions.c @@ -48,7 +48,7 @@ int xkbDevicePrivateIndex = -1; void xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, - pointer data) + void * data) { xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device); ProcessInputProc tmp = device->public.processInputProc; @@ -533,7 +533,7 @@ _XkbFilterISOLock( XkbSrvInfoPtr xkbi, static CARD32 -_XkbPtrAccelExpire(OsTimerPtr timer,CARD32 now,pointer arg) +_XkbPtrAccelExpire(OsTimerPtr timer,CARD32 now,void * arg) { XkbSrvInfoPtr xkbi= (XkbSrvInfoPtr)arg; XkbControlsPtr ctrls= xkbi->desc->ctrls; @@ -602,7 +602,7 @@ Bool accel; xkbi->mouseKeysDY= XkbPtrActionY(&pAction->ptr); xkbi->mouseKeyTimer= TimerSet(xkbi->mouseKeyTimer, 0, xkbi->desc->ctrls->mk_delay, - _XkbPtrAccelExpire,(pointer)xkbi); + _XkbPtrAccelExpire,(void *)xkbi); } else if (filter->keycode==keycode) { filter->active = 0; diff --git a/nx-X11/programs/Xserver/xkb/xkbEvents.c b/nx-X11/programs/Xserver/xkb/xkbEvents.c index 914e3e782..ca201c6f0 100644 --- a/nx-X11/programs/Xserver/xkb/xkbEvents.c +++ b/nx-X11/programs/Xserver/xkb/xkbEvents.c @@ -383,7 +383,7 @@ XkbHandleBell( BOOL force, BOOL eventOnly, DeviceIntPtr kbd, CARD8 percent, - pointer pCtrl, + void * pCtrl, CARD8 class, Atom name, WindowPtr pWin, @@ -402,7 +402,7 @@ XID winID = 0; if ((force||(xkbi->desc->ctrls->enabled_ctrls&XkbAudibleBellMask))&& (!eventOnly)) { - (*kbd->kbdfeed->BellProc)(percent,kbd,(pointer)pCtrl,class); + (*kbd->kbdfeed->BellProc)(percent,kbd,(void *)pCtrl,class); } interest = kbd->xkb_interest; if ((!interest)||(force)) @@ -822,7 +822,7 @@ XkbSrvInfoPtr xkbi; ErrorF(" Event state= 0x%04x\n",xE[0].u.keyButtonPointer.state); ErrorF(" XkbLastRepeatEvent!=xE (0x%x!=0x%x) %s\n", XkbLastRepeatEvent,xE, - ((XkbLastRepeatEvent!=(pointer)xE)?"True":"False")); + ((XkbLastRepeatEvent!=(void *)xE)?"True":"False")); ErrorF(" (xkbClientEventsFlags&XWDA)==0 (0x%x) %s\n", pClient->xkbClientFlags, (_XkbWantsDetectableAutoRepeat(pClient)?"True":"False")); @@ -830,7 +830,7 @@ XkbSrvInfoPtr xkbi; (!_XkbIsReleaseEvent(xE[0].u.u.type))?"True":"False"); } #endif /* DEBUG */ - if ( (XkbLastRepeatEvent==(pointer)xE) && + if ( (XkbLastRepeatEvent==(void *)xE) && (_XkbWantsDetectableAutoRepeat(pClient)) && (_XkbIsReleaseEvent(xE[0].u.u.type)) ) { return False; diff --git a/nx-X11/programs/Xserver/xkb/xkbInit.c b/nx-X11/programs/Xserver/xkb/xkbInit.c index a338de8ad..ef7e6a4f7 100644 --- a/nx-X11/programs/Xserver/xkb/xkbInit.c +++ b/nx-X11/programs/Xserver/xkb/xkbInit.c @@ -168,7 +168,7 @@ XkbGetRulesDflts(XkbRF_VarDefsPtr defs) } Bool -XkbWriteRulesProp(ClientPtr client, pointer closure) +XkbWriteRulesProp(ClientPtr client, void * closure) { int len,out; Atom name; @@ -296,7 +296,7 @@ XkbSetRulesDflts(char *rulesFile,char *model,char *layout, #include "xkbDflts.h" /* A dummy to keep the compiler quiet */ -pointer xkbBogus = &indicators; +void * xkbBogus = &indicators; static Bool XkbInitKeyTypes(XkbDescPtr xkb,SrvXkmInfo *file) @@ -619,7 +619,7 @@ XkbInitKeyboardDeviceStruct( void (*bellProc)( int /*percent*/, DeviceIntPtr /*device*/, - pointer /*ctrl*/, + void * /*ctrl*/, int), void (*ctrlProc)( DeviceIntPtr /*device*/, diff --git a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c index ee521be69..713995d16 100644 --- a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c +++ b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c @@ -76,7 +76,7 @@ unsigned ndx; case XkbKB_Default: if (( xE->u.u.type == KeyPress ) && (keyc->down[key>>3] & (1<<(key&7)))) { - XkbLastRepeatEvent= (pointer)xE; + XkbLastRepeatEvent= (void *)xE; xE->u.u.type = KeyRelease; XkbHandleActions(keybd,keybd,xE,count); xE->u.u.type = KeyPress; @@ -86,7 +86,7 @@ unsigned ndx; } else if ((xE->u.u.type==KeyRelease) && (!(keyc->down[key>>3]&(1<<(key&7))))) { - XkbLastRepeatEvent= (pointer)&xE; + XkbLastRepeatEvent= (void *)&xE; xE->u.u.type = KeyPress; XkbHandleActions(keybd,keybd,xE,count); xE->u.u.type = KeyRelease; -- cgit v1.2.3 From 433d8186588698ce6a435fbff5e9d40a37b78be9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 8 Jul 2015 16:16:40 +0200 Subject: Clear header file namespace separation ( vs. ). In the process of building nxagent against more and more system-wide installed X.org libraries, we come to the limit of including structs from this (bundled nx-X11) and that (system-wide X.Org) library. This commit introduces a clear namespace separation of headers provided by nx-X11 and headers provided by X.Org. This approach is only temporary as we want to drop all nx-X11 bundled libraries from nx-libs. However, for a while we need to make this separation clear and also ship some reduced fake X.Org headers that avoid pulling in libX* and libNX_X* symbols at the same time. This patch has been tested on Debian jessie and unstable and requires no overall testing on various distros and distro versions, as we finally will drop all libNX_X* libraries and build against X.org's client libs. For now, this hack eases our development / cleanup process. --- Makefile | 4 +- debian/libnx-x11-dev.install.in | 28 +-- debian/libnx-xau-dev.install.in | 2 +- debian/libnx-xcomposite-dev.install.in | 2 +- debian/libnx-xext-dev.install.in | 66 +++--- debian/libnx-xfixes-dev.install.in | 2 +- debian/libnx-xinerama-dev.install.in | 4 +- debian/libnx-xrender-dev.install.in | 2 +- debian/libnx-xtst-dev.install.in | 2 +- debian/nx-x11proto-composite-dev.install.in | 4 +- debian/nx-x11proto-core-dev.install.in | 46 ++-- debian/nx-x11proto-render-dev.install.in | 4 +- debian/nx-x11proto-xext-dev.install.in | 8 +- debian/nx-x11proto-xfixes-dev.install.in | 4 +- debian/nx-x11proto-xinerama-dev.install.in | 2 +- debian/rules | 44 ++-- nx-X11/config/cf/X11.tmpl | 2 +- nx-X11/include/GL/glx.h | 4 +- nx-X11/include/GL/glxint.h | 4 +- nx-X11/include/Imakefile | 4 +- nx-X11/include/XWDFile.h | 2 +- nx-X11/include/Xdefs.h | 2 +- nx-X11/include/Xfuncs.h | 2 +- nx-X11/include/Xos.h | 6 +- nx-X11/include/Xos_r.h | 14 +- nx-X11/include/Xpoll.h.in | 6 +- nx-X11/include/Xproto.h | 4 +- nx-X11/include/Xprotostr.h | 2 +- nx-X11/include/Xthreads.h | 2 +- nx-X11/include/extensions/Imakefile | 4 +- nx-X11/include/extensions/MITMisc.h | 2 +- nx-X11/include/extensions/XEVI.h | 2 +- nx-X11/include/extensions/XEVIstr.h | 2 +- nx-X11/include/extensions/XInput.h | 4 +- nx-X11/include/extensions/XIproto.h | 4 +- nx-X11/include/extensions/XKBgeom.h | 2 +- nx-X11/include/extensions/XKBproto.h | 4 +- nx-X11/include/extensions/XKBsrv.h | 10 +- nx-X11/include/extensions/XKBstr.h | 2 +- nx-X11/include/extensions/XLbx.h | 6 +- nx-X11/include/extensions/XShm.h | 2 +- nx-X11/include/extensions/XTest.h | 4 +- nx-X11/include/extensions/Xag.h | 2 +- nx-X11/include/extensions/Xagsrv.h | 2 +- nx-X11/include/extensions/Xagstr.h | 2 +- nx-X11/include/extensions/Xcup.h | 2 +- nx-X11/include/extensions/Xcupstr.h | 2 +- nx-X11/include/extensions/Xdbe.h | 4 +- nx-X11/include/extensions/Xevie.h | 2 +- nx-X11/include/extensions/Xext.h | 2 +- nx-X11/include/extensions/Xinerama.h | 2 +- nx-X11/include/extensions/Xv.h | 2 +- nx-X11/include/extensions/XvMC.h | 4 +- nx-X11/include/extensions/XvMClib.h | 6 +- nx-X11/include/extensions/Xvlib.h | 4 +- nx-X11/include/extensions/Xvproto.h | 2 +- nx-X11/include/extensions/composite.h | 2 +- nx-X11/include/extensions/compositeproto.h | 4 +- nx-X11/include/extensions/dpms.h | 4 +- nx-X11/include/extensions/extutil.h | 2 +- nx-X11/include/extensions/fontcache.h | 2 +- nx-X11/include/extensions/fontcacheP.h | 2 +- nx-X11/include/extensions/fontcachstr.h | 2 +- nx-X11/include/extensions/lbxbuf.h | 2 +- nx-X11/include/extensions/lbxbufstr.h | 2 +- nx-X11/include/extensions/lbximage.h | 2 +- nx-X11/include/extensions/lbxstr.h | 2 +- nx-X11/include/extensions/multibuf.h | 2 +- nx-X11/include/extensions/recordstr.h | 2 +- nx-X11/include/extensions/renderproto.h | 4 +- nx-X11/include/extensions/saverproto.h | 2 +- nx-X11/include/extensions/scrnsaver.h | 6 +- nx-X11/include/extensions/security.h | 2 +- nx-X11/include/extensions/securstr.h | 2 +- nx-X11/include/extensions/shape.h | 4 +- nx-X11/include/extensions/sync.h | 2 +- nx-X11/include/extensions/vldXvMC.h | 6 +- nx-X11/include/extensions/xf86bigfont.h | 2 +- nx-X11/include/extensions/xf86bigfstr.h | 2 +- nx-X11/include/extensions/xf86dga.h | 4 +- nx-X11/include/extensions/xf86dga1.h | 2 +- nx-X11/include/extensions/xf86dgastr.h | 2 +- nx-X11/include/extensions/xf86misc.h | 2 +- nx-X11/include/extensions/xf86mscstr.h | 2 +- nx-X11/include/extensions/xf86vmode.h | 4 +- nx-X11/include/extensions/xf86vmstr.h | 2 +- nx-X11/include/extensions/xfixesproto.h | 6 +- nx-X11/include/extensions/xtrapddmi.h | 4 +- nx-X11/include/extensions/xtrapdi.h | 8 +- nx-X11/include/extensions/xtrapemacros.h | 2 +- nx-X11/include/extensions/xtraplib.h | 8 +- nx-X11/include/keysym.h | 2 +- nx-X11/lib/X11/ClDisplay.c | 2 +- nx-X11/lib/X11/ConnDis.c | 8 +- nx-X11/lib/X11/ErrDes.c | 2 +- nx-X11/lib/X11/FSWrap.c | 2 +- nx-X11/lib/X11/FetchName.c | 6 +- nx-X11/lib/X11/Font.c | 2 +- nx-X11/lib/X11/GetDflt.c | 8 +- nx-X11/lib/X11/GetHints.c | 8 +- nx-X11/lib/X11/GetImage.c | 2 +- nx-X11/lib/X11/GetNrmHint.c | 6 +- nx-X11/lib/X11/GetRGBCMap.c | 6 +- nx-X11/lib/X11/GetStCmap.c | 6 +- nx-X11/lib/X11/GetTxtProp.c | 8 +- nx-X11/lib/X11/GetWMCMapW.c | 2 +- nx-X11/lib/X11/GetWMProto.c | 2 +- nx-X11/lib/X11/HVC.c | 2 +- nx-X11/lib/X11/Iconify.c | 8 +- nx-X11/lib/X11/ImUtil.c | 4 +- nx-X11/lib/X11/Imakefile | 2 +- nx-X11/lib/X11/InitExt.c | 4 +- nx-X11/lib/X11/KeyBind.c | 6 +- nx-X11/lib/X11/KeysymStr.c | 4 +- nx-X11/lib/X11/LRGB.c | 4 +- nx-X11/lib/X11/Lab.c | 2 +- nx-X11/lib/X11/Luv.c | 2 +- nx-X11/lib/X11/OpenDis.c | 8 +- nx-X11/lib/X11/ParseCmd.c | 2 +- nx-X11/lib/X11/PolyReg.c | 2 +- nx-X11/lib/X11/Quarks.c | 2 +- nx-X11/lib/X11/RdBitF.c | 2 +- nx-X11/lib/X11/Region.c | 2 +- nx-X11/lib/X11/ScrResStr.c | 2 +- nx-X11/lib/X11/SetHints.c | 8 +- nx-X11/lib/X11/SetLocale.c | 4 +- nx-X11/lib/X11/SetNrmHint.c | 8 +- nx-X11/lib/X11/SetRGBCMap.c | 6 +- nx-X11/lib/X11/SetStCmap.c | 6 +- nx-X11/lib/X11/SetTxtProp.c | 8 +- nx-X11/lib/X11/SetWMCMapW.c | 2 +- nx-X11/lib/X11/SetWMProto.c | 2 +- nx-X11/lib/X11/StBytes.c | 4 +- nx-X11/lib/X11/StName.c | 4 +- nx-X11/lib/X11/StrKeysym.c | 4 +- nx-X11/lib/X11/StrToText.c | 6 +- nx-X11/lib/X11/TextToStr.c | 6 +- nx-X11/lib/X11/WMProps.c | 10 +- nx-X11/lib/X11/Withdraw.c | 8 +- nx-X11/lib/X11/WrBitF.c | 2 +- nx-X11/lib/X11/XDefaultOMIF.c | 4 +- nx-X11/lib/X11/XKB.c | 2 +- nx-X11/lib/X11/XKBAlloc.c | 12 +- nx-X11/lib/X11/XKBBell.c | 2 +- nx-X11/lib/X11/XKBBind.c | 8 +- nx-X11/lib/X11/XKBCompat.c | 2 +- nx-X11/lib/X11/XKBCtrls.c | 2 +- nx-X11/lib/X11/XKBCvt.c | 16 +- nx-X11/lib/X11/XKBExtDev.c | 4 +- nx-X11/lib/X11/XKBGAlloc.c | 12 +- nx-X11/lib/X11/XKBGeom.c | 4 +- nx-X11/lib/X11/XKBGetByName.c | 2 +- nx-X11/lib/X11/XKBGetMap.c | 2 +- nx-X11/lib/X11/XKBList.c | 2 +- nx-X11/lib/X11/XKBMAlloc.c | 12 +- nx-X11/lib/X11/XKBMisc.c | 12 +- nx-X11/lib/X11/XKBNames.c | 2 +- nx-X11/lib/X11/XKBRdBuf.c | 2 +- nx-X11/lib/X11/XKBSetGeom.c | 4 +- nx-X11/lib/X11/XKBSetMap.c | 2 +- nx-X11/lib/X11/XKBUse.c | 2 +- nx-X11/lib/X11/XKBleds.c | 2 +- nx-X11/lib/X11/XKBlib.h | 4 +- nx-X11/lib/X11/XKBlibint.h | 4 +- nx-X11/lib/X11/XYZ.c | 2 +- nx-X11/lib/X11/Xcms.h | 2 +- nx-X11/lib/X11/Xcmsint.h | 2 +- nx-X11/lib/X11/XimThai.h | 2 +- nx-X11/lib/X11/Ximint.h | 2 +- nx-X11/lib/X11/Xintatom.h | 2 +- nx-X11/lib/X11/Xintconn.h | 2 +- nx-X11/lib/X11/Xlcint.h | 4 +- nx-X11/lib/X11/Xlib.h | 6 +- nx-X11/lib/X11/XlibAsync.c | 4 +- nx-X11/lib/X11/XlibInt.c | 6 +- nx-X11/lib/X11/Xlibint.h | 14 +- nx-X11/lib/X11/Xlocale.h | 4 +- nx-X11/lib/X11/Xresource.h | 2 +- nx-X11/lib/X11/Xrm.c | 4 +- nx-X11/lib/X11/Xutil.h | 2 +- nx-X11/lib/X11/cmsColNm.c | 4 +- nx-X11/lib/X11/cmsProp.c | 2 +- nx-X11/lib/X11/evtomask.c | 2 +- nx-X11/lib/X11/globals.c | 2 +- nx-X11/lib/X11/imDefFlt.c | 2 +- nx-X11/lib/X11/imDefIm.c | 2 +- nx-X11/lib/X11/imDefLkup.c | 2 +- nx-X11/lib/X11/imDispch.c | 2 +- nx-X11/lib/X11/imEvToWire.c | 4 +- nx-X11/lib/X11/imExten.c | 2 +- nx-X11/lib/X11/imInt.c | 6 +- nx-X11/lib/X11/imLcFlt.c | 2 +- nx-X11/lib/X11/imLcIc.c | 4 +- nx-X11/lib/X11/imLcIm.c | 8 +- nx-X11/lib/X11/imLcLkup.c | 10 +- nx-X11/lib/X11/imLcPrs.c | 6 +- nx-X11/lib/X11/imLcSIc.c | 6 +- nx-X11/lib/X11/imRm.c | 2 +- nx-X11/lib/X11/imThaiFlt.c | 8 +- nx-X11/lib/X11/imThaiIc.c | 4 +- nx-X11/lib/X11/imThaiIm.c | 8 +- nx-X11/lib/X11/imTrX.c | 2 +- nx-X11/lib/X11/imTrans.c | 8 +- nx-X11/lib/X11/lcCT.c | 2 +- nx-X11/lib/X11/lcDB.c | 4 +- nx-X11/lib/X11/lcFile.c | 2 +- nx-X11/lib/X11/lcPrTxt.c | 4 +- nx-X11/lib/X11/lcTxtPr.c | 4 +- nx-X11/lib/X11/lcUtil.c | 2 +- nx-X11/lib/X11/lcWrap.c | 6 +- nx-X11/lib/X11/locking.h | 2 +- nx-X11/lib/X11/mbWMProps.c | 8 +- nx-X11/lib/X11/omDefault.c | 4 +- nx-X11/lib/X11/omGeneric.c | 4 +- nx-X11/lib/X11/os2Stubs.c | 2 +- nx-X11/lib/X11/utf8WMProps.c | 8 +- nx-X11/lib/X11/util/makekeys.c | 6 +- nx-X11/lib/X11/uvY.c | 2 +- nx-X11/lib/X11/xyY.c | 2 +- nx-X11/lib/Xau/AuDispose.c | 2 +- nx-X11/lib/Xau/AuFileName.c | 4 +- nx-X11/lib/Xau/AuGetAddr.c | 4 +- nx-X11/lib/Xau/AuGetBest.c | 8 +- nx-X11/lib/Xau/AuLock.c | 6 +- nx-X11/lib/Xau/AuRead.c | 2 +- nx-X11/lib/Xau/AuUnlock.c | 4 +- nx-X11/lib/Xau/AuWrite.c | 2 +- nx-X11/lib/Xau/Autest.c | 2 +- nx-X11/lib/Xau/Imakefile | 2 +- nx-X11/lib/Xau/k5encode.c | 8 +- nx-X11/lib/Xcomposite/Imakefile | 2 +- nx-X11/lib/Xcomposite/Xcomposite.h | 6 +- nx-X11/lib/Xcomposite/xcompositeint.h | 10 +- nx-X11/lib/Xext/DPMS.c | 10 +- nx-X11/lib/Xext/MITMisc.c | 10 +- nx-X11/lib/Xext/XAppgroup.c | 10 +- nx-X11/lib/Xext/XEVI.c | 12 +- nx-X11/lib/Xext/XLbx.c | 10 +- nx-X11/lib/Xext/XMultibuf.c | 8 +- nx-X11/lib/Xext/XSecurity.c | 8 +- nx-X11/lib/Xext/XShape.c | 12 +- nx-X11/lib/Xext/XShm.c | 12 +- nx-X11/lib/Xext/XSync.c | 8 +- nx-X11/lib/Xext/XTestExt1.c | 6 +- nx-X11/lib/Xext/Xcup.c | 10 +- nx-X11/lib/Xext/Xdbe.c | 8 +- nx-X11/lib/Xext/extutil.c | 6 +- nx-X11/lib/Xext/globals.c | 4 +- nx-X11/lib/Xfixes/Imakefile | 2 +- nx-X11/lib/Xfixes/Xfixes.h | 4 +- nx-X11/lib/Xfixes/Xfixes.man | 2 +- nx-X11/lib/Xfixes/Xfixesint.h | 8 +- nx-X11/lib/Xinerama/Xinerama.c | 14 +- nx-X11/lib/Xrender/Imakefile | 2 +- nx-X11/lib/Xrender/Picture.c | 2 +- nx-X11/lib/Xrender/Xrender.h | 10 +- nx-X11/lib/Xrender/Xrenderint.h | 6 +- nx-X11/lib/Xtst/XRecord.c | 8 +- nx-X11/lib/Xtst/XTest.c | 14 +- nx-X11/lib/oldX/Imakefile | 2 +- nx-X11/lib/xkbfile/Imakefile | 2 +- nx-X11/lib/xkbfile/XKMformat.h | 6 +- nx-X11/lib/xkbfile/cout.c | 8 +- nx-X11/lib/xkbfile/maprules.c | 34 +-- nx-X11/lib/xkbfile/srvmisc.c | 6 +- nx-X11/lib/xkbfile/xkbatom.c | 6 +- nx-X11/lib/xkbfile/xkbbells.c | 4 +- nx-X11/lib/xkbfile/xkbconfig.c | 22 +- nx-X11/lib/xkbfile/xkbdraw.c | 12 +- nx-X11/lib/xkbfile/xkbmisc.c | 24 +- nx-X11/lib/xkbfile/xkbout.c | 22 +- nx-X11/lib/xkbfile/xkbtext.c | 18 +- nx-X11/lib/xkbfile/xkmout.c | 8 +- nx-X11/lib/xkbfile/xkmread.c | 24 +- nx-X11/lib/xtrans/Imakefile | 2 +- nx-X11/programs/Xserver/GL/glx/glxserver.h | 6 +- nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c | 2 +- nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c | 2 +- nx-X11/programs/Xserver/XTrap/xtrapddmi.c | 10 +- nx-X11/programs/Xserver/XTrap/xtrapdi.c | 12 +- nx-X11/programs/Xserver/XTrap/xtrapdiswp.c | 12 +- nx-X11/programs/Xserver/XTrap/xtrapditbl.c | 12 +- nx-X11/programs/Xserver/Xext/EVI.c | 6 +- nx-X11/programs/Xserver/Xext/appgroup.c | 14 +- nx-X11/programs/Xserver/Xext/bigreq.c | 6 +- nx-X11/programs/Xserver/Xext/cup.c | 8 +- nx-X11/programs/Xserver/Xext/dgaproc.h | 2 +- nx-X11/programs/Xserver/Xext/dpms.c | 8 +- nx-X11/programs/Xserver/Xext/extmod/modinit.c | 2 +- nx-X11/programs/Xserver/Xext/extmod/modinit.h | 40 ++-- nx-X11/programs/Xserver/Xext/fontcache.c | 6 +- nx-X11/programs/Xserver/Xext/mbuf.c | 6 +- nx-X11/programs/Xserver/Xext/mbufbf.c | 6 +- nx-X11/programs/Xserver/Xext/mbufpx.c | 6 +- nx-X11/programs/Xserver/Xext/mitmisc.c | 6 +- nx-X11/programs/Xserver/Xext/panoramiX.c | 8 +- nx-X11/programs/Xserver/Xext/panoramiX.h | 2 +- nx-X11/programs/Xserver/Xext/panoramiXSwap.c | 8 +- nx-X11/programs/Xserver/Xext/panoramiXprocs.c | 4 +- nx-X11/programs/Xserver/Xext/sampleEVI.c | 6 +- nx-X11/programs/Xserver/Xext/saver.c | 6 +- nx-X11/programs/Xserver/Xext/security.c | 10 +- nx-X11/programs/Xserver/Xext/shape.c | 6 +- nx-X11/programs/Xserver/Xext/shm.c | 8 +- nx-X11/programs/Xserver/Xext/sleepuntil.c | 4 +- nx-X11/programs/Xserver/Xext/sync.c | 10 +- nx-X11/programs/Xserver/Xext/xcmisc.c | 6 +- nx-X11/programs/Xserver/Xext/xevie.c | 10 +- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 6 +- nx-X11/programs/Xserver/Xext/xf86dga.c | 8 +- nx-X11/programs/Xserver/Xext/xf86dga2.c | 8 +- nx-X11/programs/Xserver/Xext/xf86misc.c | 12 +- nx-X11/programs/Xserver/Xext/xf86vmode.c | 6 +- nx-X11/programs/Xserver/Xext/xres.c | 6 +- nx-X11/programs/Xserver/Xext/xtest.c | 12 +- nx-X11/programs/Xserver/Xext/xtest1dd.c | 10 +- nx-X11/programs/Xserver/Xext/xtest1di.c | 6 +- nx-X11/programs/Xserver/Xext/xvdisp.c | 10 +- nx-X11/programs/Xserver/Xext/xvdix.h | 2 +- nx-X11/programs/Xserver/Xext/xvmain.c | 8 +- nx-X11/programs/Xserver/Xext/xvmc.c | 12 +- nx-X11/programs/Xserver/Xext/xvmcext.h | 2 +- nx-X11/programs/Xserver/Xext/xvmod.c | 6 +- nx-X11/programs/Xserver/Xi/allowev.c | 8 +- nx-X11/programs/Xserver/Xi/chgdctl.c | 8 +- nx-X11/programs/Xserver/Xi/chgfctl.c | 8 +- nx-X11/programs/Xserver/Xi/chgkbd.c | 8 +- nx-X11/programs/Xserver/Xi/chgkmap.c | 8 +- nx-X11/programs/Xserver/Xi/chgprop.c | 8 +- nx-X11/programs/Xserver/Xi/chgptr.c | 8 +- nx-X11/programs/Xserver/Xi/closedev.c | 8 +- nx-X11/programs/Xserver/Xi/devbell.c | 8 +- nx-X11/programs/Xserver/Xi/exevents.c | 8 +- nx-X11/programs/Xserver/Xi/extinit.c | 8 +- nx-X11/programs/Xserver/Xi/getbmap.c | 8 +- nx-X11/programs/Xserver/Xi/getdctl.c | 8 +- nx-X11/programs/Xserver/Xi/getfctl.c | 8 +- nx-X11/programs/Xserver/Xi/getfocus.c | 8 +- nx-X11/programs/Xserver/Xi/getkmap.c | 8 +- nx-X11/programs/Xserver/Xi/getmmap.c | 8 +- nx-X11/programs/Xserver/Xi/getprop.c | 8 +- nx-X11/programs/Xserver/Xi/getselev.c | 8 +- nx-X11/programs/Xserver/Xi/getvers.c | 8 +- nx-X11/programs/Xserver/Xi/grabdev.c | 8 +- nx-X11/programs/Xserver/Xi/grabdevb.c | 8 +- nx-X11/programs/Xserver/Xi/grabdevk.c | 8 +- nx-X11/programs/Xserver/Xi/gtmotion.c | 8 +- nx-X11/programs/Xserver/Xi/listdev.c | 8 +- nx-X11/programs/Xserver/Xi/opendev.c | 8 +- nx-X11/programs/Xserver/Xi/queryst.c | 8 +- nx-X11/programs/Xserver/Xi/selectev.c | 8 +- nx-X11/programs/Xserver/Xi/sendexev.c | 8 +- nx-X11/programs/Xserver/Xi/setbmap.c | 8 +- nx-X11/programs/Xserver/Xi/setdval.c | 8 +- nx-X11/programs/Xserver/Xi/setfocus.c | 8 +- nx-X11/programs/Xserver/Xi/setmmap.c | 8 +- nx-X11/programs/Xserver/Xi/setmode.c | 8 +- nx-X11/programs/Xserver/Xi/stubs.c | 8 +- nx-X11/programs/Xserver/Xi/ungrdev.c | 6 +- nx-X11/programs/Xserver/Xi/ungrdevb.c | 8 +- nx-X11/programs/Xserver/Xi/ungrdevk.c | 8 +- nx-X11/programs/Xserver/composite/compint.h | 2 +- nx-X11/programs/Xserver/damageext/damageextint.h | 4 +- nx-X11/programs/Xserver/dbe/dbe.c | 4 +- nx-X11/programs/Xserver/dbe/dbestruct.h | 2 +- nx-X11/programs/Xserver/dbe/midbe.c | 4 +- nx-X11/programs/Xserver/dix/atom.c | 4 +- nx-X11/programs/Xserver/dix/colormap.c | 4 +- nx-X11/programs/Xserver/dix/cursor.c | 4 +- nx-X11/programs/Xserver/dix/devices.c | 8 +- nx-X11/programs/Xserver/dix/dispatch.c | 6 +- nx-X11/programs/Xserver/dix/dixfonts.c | 8 +- nx-X11/programs/Xserver/dix/dixutils.c | 8 +- nx-X11/programs/Xserver/dix/events.c | 10 +- nx-X11/programs/Xserver/dix/extension.c | 6 +- nx-X11/programs/Xserver/dix/gc.c | 6 +- nx-X11/programs/Xserver/dix/globals.c | 4 +- nx-X11/programs/Xserver/dix/grabs.c | 4 +- nx-X11/programs/Xserver/dix/initatoms.c | 4 +- nx-X11/programs/Xserver/dix/main.c | 8 +- nx-X11/programs/Xserver/dix/pixmap.c | 2 +- nx-X11/programs/Xserver/dix/privates.c | 2 +- nx-X11/programs/Xserver/dix/property.c | 6 +- nx-X11/programs/Xserver/dix/resource.c | 2 +- nx-X11/programs/Xserver/dix/swaprep.c | 4 +- nx-X11/programs/Xserver/dix/swapreq.c | 6 +- nx-X11/programs/Xserver/dix/tables.c | 4 +- nx-X11/programs/Xserver/dix/window.c | 4 +- nx-X11/programs/Xserver/fb/fb.h | 2 +- nx-X11/programs/Xserver/fb/fbcmap.c | 4 +- nx-X11/programs/Xserver/fb/fbpseudocolor.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Agent.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Dialog.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Events.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Holder.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Icons.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXcomposite.h | 6 +- .../programs/Xserver/hw/nxagent/NXcompositeext.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 11 +- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/NXextension.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/NXresource.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/TestExt.c | 6 +- .../hw/nxagent/X11/include/Xrandr_nxagent.h | 105 +++++++++ .../Xserver/hw/nxagent/X11/include/xpm_nxagent.h | 259 +++++++++++++++++++++ .../Xserver/hw/xfree86/os-support/xf86_libc.h | 2 +- nx-X11/programs/Xserver/include/Imakefile | 4 +- nx-X11/programs/Xserver/include/closestr.h | 2 +- nx-X11/programs/Xserver/include/colormap.h | 2 +- nx-X11/programs/Xserver/include/dixfontstr.h | 2 +- nx-X11/programs/Xserver/include/dixstruct.h | 2 +- nx-X11/programs/Xserver/include/gc.h | 6 +- nx-X11/programs/Xserver/include/gcstruct.h | 2 +- nx-X11/programs/Xserver/include/input.h | 4 +- nx-X11/programs/Xserver/include/misc.h | 12 +- nx-X11/programs/Xserver/include/miscstruct.h | 2 +- nx-X11/programs/Xserver/include/opaque.h | 2 +- nx-X11/programs/Xserver/include/os.h | 2 +- nx-X11/programs/Xserver/include/scrnintstr.h | 2 +- nx-X11/programs/Xserver/include/window.h | 2 +- nx-X11/programs/Xserver/include/windowstr.h | 2 +- nx-X11/programs/Xserver/mfb/maskbits.h | 4 +- nx-X11/programs/Xserver/mi/mi.h | 2 +- nx-X11/programs/Xserver/mi/miarc.c | 6 +- nx-X11/programs/Xserver/mi/mibitblt.c | 6 +- nx-X11/programs/Xserver/mi/mibstore.c | 6 +- nx-X11/programs/Xserver/mi/miclipn.c | 2 +- nx-X11/programs/Xserver/mi/micmap.c | 4 +- nx-X11/programs/Xserver/mi/miexpose.c | 8 +- nx-X11/programs/Xserver/mi/mifillarc.c | 4 +- nx-X11/programs/Xserver/mi/mifillrct.c | 4 +- nx-X11/programs/Xserver/mi/mifpolycon.c | 2 +- nx-X11/programs/Xserver/mi/miinitext.c | 18 +- nx-X11/programs/Xserver/mi/mioverlay.c | 2 +- nx-X11/programs/Xserver/mi/mipoly.c | 2 +- nx-X11/programs/Xserver/mi/mipolygen.c | 2 +- nx-X11/programs/Xserver/mi/mipolypnt.c | 4 +- nx-X11/programs/Xserver/mi/mipolyrect.c | 4 +- nx-X11/programs/Xserver/mi/mipolyseg.c | 4 +- nx-X11/programs/Xserver/mi/mipushpxl.c | 2 +- nx-X11/programs/Xserver/mi/miregion.c | 2 +- nx-X11/programs/Xserver/mi/miscrinit.c | 4 +- nx-X11/programs/Xserver/mi/miwideline.c | 2 +- nx-X11/programs/Xserver/mi/miwindow.c | 2 +- nx-X11/programs/Xserver/mi/mizerarc.c | 4 +- nx-X11/programs/Xserver/mi/mizerclip.c | 2 +- nx-X11/programs/Xserver/mi/mizerline.c | 2 +- nx-X11/programs/Xserver/os/WaitFor.c | 10 +- nx-X11/programs/Xserver/os/access.c | 14 +- nx-X11/programs/Xserver/os/auth.c | 8 +- nx-X11/programs/Xserver/os/connection.c | 14 +- nx-X11/programs/Xserver/os/io.c | 14 +- nx-X11/programs/Xserver/os/k5auth.c | 6 +- nx-X11/programs/Xserver/os/log.c | 2 +- nx-X11/programs/Xserver/os/mitauth.c | 2 +- nx-X11/programs/Xserver/os/osdep.h | 2 +- nx-X11/programs/Xserver/os/osinit.c | 4 +- nx-X11/programs/Xserver/os/rpcauth.c | 2 +- nx-X11/programs/Xserver/os/secauth.c | 4 +- nx-X11/programs/Xserver/os/utils.c | 14 +- nx-X11/programs/Xserver/os/xalloc.c | 4 +- nx-X11/programs/Xserver/os/xdmauth.c | 6 +- nx-X11/programs/Xserver/os/xdmcp.c | 12 +- nx-X11/programs/Xserver/os/xprintf.c | 2 +- nx-X11/programs/Xserver/randr/randrproto.h | 2 +- nx-X11/programs/Xserver/randr/randrstr.h | 12 +- nx-X11/programs/Xserver/randr/rrxinerama.c | 2 +- nx-X11/programs/Xserver/record/record.c | 2 +- nx-X11/programs/Xserver/render/animcur.c | 4 +- nx-X11/programs/Xserver/render/glyphstr.h | 2 +- nx-X11/programs/Xserver/render/render.c | 10 +- nx-X11/programs/Xserver/xfixes/xfixesint.h | 6 +- nx-X11/programs/Xserver/xkb/ddxBeep.c | 10 +- nx-X11/programs/Xserver/xkb/ddxConfig.c | 10 +- nx-X11/programs/Xserver/xkb/ddxCtrls.c | 10 +- nx-X11/programs/Xserver/xkb/ddxDevBtn.c | 12 +- nx-X11/programs/Xserver/xkb/ddxFakeBtn.c | 10 +- nx-X11/programs/Xserver/xkb/ddxFakeMtn.c | 10 +- nx-X11/programs/Xserver/xkb/ddxInit.c | 10 +- nx-X11/programs/Xserver/xkb/ddxKeyClick.c | 10 +- nx-X11/programs/Xserver/xkb/ddxKillSrv.c | 10 +- nx-X11/programs/Xserver/xkb/ddxLEDs.c | 10 +- nx-X11/programs/Xserver/xkb/ddxList.c | 14 +- nx-X11/programs/Xserver/xkb/ddxLoad.c | 16 +- nx-X11/programs/Xserver/xkb/ddxPrivate.c | 4 +- nx-X11/programs/Xserver/xkb/ddxVT.c | 10 +- nx-X11/programs/Xserver/xkb/xkb.c | 10 +- nx-X11/programs/Xserver/xkb/xkbAccessX.c | 8 +- nx-X11/programs/Xserver/xkb/xkbActions.c | 8 +- nx-X11/programs/Xserver/xkb/xkbEvents.c | 10 +- nx-X11/programs/Xserver/xkb/xkbInit.c | 16 +- nx-X11/programs/Xserver/xkb/xkbLEDs.c | 8 +- nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c | 8 +- nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c | 12 +- nx-X11/programs/Xserver/xkb/xkbSwap.c | 8 +- nx-X11/programs/Xserver/xkb/xkbUtils.c | 10 +- nx-X11/programs/nxauth/gethost.c | 4 +- nx-X11/programs/nxauth/parsedpy.c | 6 +- nx-X11/programs/nxauth/process.c | 6 +- nx-X11/programs/nxauth/xauth.h | 6 +- nx-libs.spec | 240 +++++++++---------- nxcompext/Jpeg.c | 6 +- nxcompext/NXlib.h | 4 +- nxcompext/Pgn.h | 6 +- nxcompshad/Input.h | 2 +- nxcompshad/Manager.cpp | 6 +- nxcompshad/Manager.h | 2 +- nxcompshad/Regions.h | 4 +- nxcompshad/Shadow.h | 2 +- nxcompshad/Updater.cpp | 6 +- nxcompshad/Updater.h | 2 +- nxcompshad/Win.cpp | 2 +- nxcompshad/Win.h | 2 +- nxcompshad/X11.cpp | 8 +- nxcompshad/X11.h | 8 +- nxcompshad/X11/include/Xdamage_nxcompshad.h | 92 ++++++++ nxcompshad/X11/include/Xrandr_nxcompshad.h | 80 +++++++ 531 files changed, 2203 insertions(+), 1666 deletions(-) create mode 100644 nx-X11/programs/Xserver/hw/nxagent/X11/include/Xrandr_nxagent.h create mode 100644 nx-X11/programs/Xserver/hw/nxagent/X11/include/xpm_nxagent.h create mode 100644 nxcompshad/X11/include/Xdamage_nxcompshad.h create mode 100644 nxcompshad/X11/include/Xrandr_nxcompshad.h (limited to 'nx-X11/programs/Xserver/GL') diff --git a/Makefile b/Makefile index 9b89669df..2b5b4946a 100644 --- a/Makefile +++ b/Makefile @@ -149,9 +149,9 @@ install-full: . replace.sh; set -x; find nx-X11/.build-exports/include/ -type d | \ while read dirname; do \ - $(INSTALL_DIR) "$$(string_rep "$$dirname" nx-X11/.build-exports/include "$(DESTDIR)$(INCLUDEDIR)/nx")"; \ + $(INSTALL_DIR) "$$(string_rep "$$dirname" nx-X11/.build-exports/include "$(DESTDIR)$(INCLUDEDIR)/")"; \ $(INSTALL_FILE) $${dirname}/*.h \ - "$$(string_rep "$$dirname" nx-X11/.build-exports/include "$(DESTDIR)$(INCLUDEDIR)/nx")"/ || true; \ + "$$(string_rep "$$dirname" nx-X11/.build-exports/include "$(DESTDIR)$(INCLUDEDIR)/")"/ || true; \ done; \ # Provide means for Xinerama support in NX/X2Go sessions. This diff --git a/debian/libnx-x11-dev.install.in b/debian/libnx-x11-dev.install.in index 331ec104f..13af54672 100644 --- a/debian/libnx-x11-dev.install.in +++ b/debian/libnx-x11-dev.install.in @@ -1,15 +1,15 @@ usr/lib/*/libNX_X11.so -usr/include/*/nx/X11/ImUtil.h -usr/include/*/nx/X11/XKBlib.h -usr/include/*/nx/X11/Xcms.h -usr/include/*/nx/X11/Xlib.h -usr/include/*/nx/X11/XlibConf.h -usr/include/*/nx/X11/Xlibint.h -usr/include/*/nx/X11/Xlocale.h -usr/include/*/nx/X11/Xregion.h -usr/include/*/nx/X11/Xresource.h -usr/include/*/nx/X11/Xutil.h -usr/include/*/nx/X11/cursorfont.h -usr/include/*/nx/X11/misc.h -usr/include/*/nx/X11/os.h -usr/include/*/nx/X11/X10.h +usr/include/*/nx-X11/ImUtil.h +usr/include/*/nx-X11/XKBlib.h +usr/include/*/nx-X11/Xcms.h +usr/include/*/nx-X11/Xlib.h +usr/include/*/nx-X11/XlibConf.h +usr/include/*/nx-X11/Xlibint.h +usr/include/*/nx-X11/Xlocale.h +usr/include/*/nx-X11/Xregion.h +usr/include/*/nx-X11/Xresource.h +usr/include/*/nx-X11/Xutil.h +usr/include/*/nx-X11/cursorfont.h +usr/include/*/nx-X11/misc.h +usr/include/*/nx-X11/os.h +usr/include/*/nx-X11/X10.h diff --git a/debian/libnx-xau-dev.install.in b/debian/libnx-xau-dev.install.in index dd17a6054..1bf954c00 100644 --- a/debian/libnx-xau-dev.install.in +++ b/debian/libnx-xau-dev.install.in @@ -1,2 +1,2 @@ usr/lib/*/libNX_Xau.so -usr/include/*/nx/X11/Xauth.h +usr/include/*/nx-X11/Xauth.h diff --git a/debian/libnx-xcomposite-dev.install.in b/debian/libnx-xcomposite-dev.install.in index e7e3a33db..71451dbcc 100644 --- a/debian/libnx-xcomposite-dev.install.in +++ b/debian/libnx-xcomposite-dev.install.in @@ -1,2 +1,2 @@ usr/lib/*/libNX_Xcomposite.so -usr/include/*/nx/X11/extensions/Xcomposite.h +usr/include/*/nx-X11/extensions/Xcomposite.h diff --git a/debian/libnx-xext-dev.install.in b/debian/libnx-xext-dev.install.in index 9f4f60551..0d1df8c08 100644 --- a/debian/libnx-xext-dev.install.in +++ b/debian/libnx-xext-dev.install.in @@ -1,34 +1,34 @@ usr/lib/*/libNX_Xext.so -usr/include/*/nx/X11/extensions/MITMisc.h -usr/include/*/nx/X11/extensions/XEVI.h -usr/include/*/nx/X11/extensions/XEVIstr.h -usr/include/*/nx/X11/extensions/Xevie.h -usr/include/*/nx/X11/extensions/Xeviestr.h -usr/include/*/nx/X11/extensions/XLbx.h -usr/include/*/nx/X11/extensions/XShm.h -usr/include/*/nx/X11/extensions/Xag.h -usr/include/*/nx/X11/extensions/Xagsrv.h -usr/include/*/nx/X11/extensions/Xagstr.h -usr/include/*/nx/X11/extensions/Xcup.h -usr/include/*/nx/X11/extensions/Xcupstr.h -usr/include/*/nx/X11/extensions/Xdbe.h -usr/include/*/nx/X11/extensions/Xdbeproto.h -usr/include/*/nx/X11/extensions/Xext.h -usr/include/*/nx/X11/extensions/dpms.h -usr/include/*/nx/X11/extensions/dpmsstr.h -usr/include/*/nx/X11/extensions/extutil.h -usr/include/*/nx/X11/extensions/lbxstr.h -usr/include/*/nx/X11/extensions/lbxbuf.h -usr/include/*/nx/X11/extensions/lbxdeltastr.h -usr/include/*/nx/X11/extensions/lbximage.h -usr/include/*/nx/X11/extensions/lbxbufstr.h -usr/include/*/nx/X11/extensions/lbxopts.h -usr/include/*/nx/X11/extensions/lbxzlib.h -usr/include/*/nx/X11/extensions/mitmiscstr.h -usr/include/*/nx/X11/extensions/multibuf.h -usr/include/*/nx/X11/extensions/multibufst.h -usr/include/*/nx/X11/extensions/security.h -usr/include/*/nx/X11/extensions/securstr.h -usr/include/*/nx/X11/extensions/shape.h -usr/include/*/nx/X11/extensions/sync.h -usr/include/*/nx/X11/extensions/xtestext1.h +usr/include/*/nx-X11/extensions/MITMisc.h +usr/include/*/nx-X11/extensions/XEVI.h +usr/include/*/nx-X11/extensions/XEVIstr.h +usr/include/*/nx-X11/extensions/Xevie.h +usr/include/*/nx-X11/extensions/Xeviestr.h +usr/include/*/nx-X11/extensions/XLbx.h +usr/include/*/nx-X11/extensions/XShm.h +usr/include/*/nx-X11/extensions/Xag.h +usr/include/*/nx-X11/extensions/Xagsrv.h +usr/include/*/nx-X11/extensions/Xagstr.h +usr/include/*/nx-X11/extensions/Xcup.h +usr/include/*/nx-X11/extensions/Xcupstr.h +usr/include/*/nx-X11/extensions/Xdbe.h +usr/include/*/nx-X11/extensions/Xdbeproto.h +usr/include/*/nx-X11/extensions/Xext.h +usr/include/*/nx-X11/extensions/dpms.h +usr/include/*/nx-X11/extensions/dpmsstr.h +usr/include/*/nx-X11/extensions/extutil.h +usr/include/*/nx-X11/extensions/lbxstr.h +usr/include/*/nx-X11/extensions/lbxbuf.h +usr/include/*/nx-X11/extensions/lbxdeltastr.h +usr/include/*/nx-X11/extensions/lbximage.h +usr/include/*/nx-X11/extensions/lbxbufstr.h +usr/include/*/nx-X11/extensions/lbxopts.h +usr/include/*/nx-X11/extensions/lbxzlib.h +usr/include/*/nx-X11/extensions/mitmiscstr.h +usr/include/*/nx-X11/extensions/multibuf.h +usr/include/*/nx-X11/extensions/multibufst.h +usr/include/*/nx-X11/extensions/security.h +usr/include/*/nx-X11/extensions/securstr.h +usr/include/*/nx-X11/extensions/shape.h +usr/include/*/nx-X11/extensions/sync.h +usr/include/*/nx-X11/extensions/xtestext1.h diff --git a/debian/libnx-xfixes-dev.install.in b/debian/libnx-xfixes-dev.install.in index 96b6cf61c..475c78d0a 100644 --- a/debian/libnx-xfixes-dev.install.in +++ b/debian/libnx-xfixes-dev.install.in @@ -1,2 +1,2 @@ usr/lib/*/libNX_Xfixes.so -usr/include/*/nx/X11/extensions/Xfixes.h +usr/include/*/nx-X11/extensions/Xfixes.h diff --git a/debian/libnx-xinerama-dev.install.in b/debian/libnx-xinerama-dev.install.in index 983784460..59c0456aa 100644 --- a/debian/libnx-xinerama-dev.install.in +++ b/debian/libnx-xinerama-dev.install.in @@ -1,3 +1,3 @@ usr/lib/*/libNX_Xinerama.so -usr/include/*/nx/X11/extensions/Xinerama.h -usr/include/*/nx/X11/extensions/panoramiXext.h +usr/include/*/nx-X11/extensions/Xinerama.h +usr/include/*/nx-X11/extensions/panoramiXext.h diff --git a/debian/libnx-xrender-dev.install.in b/debian/libnx-xrender-dev.install.in index 392e20025..2aede35da 100644 --- a/debian/libnx-xrender-dev.install.in +++ b/debian/libnx-xrender-dev.install.in @@ -1,2 +1,2 @@ usr/lib/*/libNX_Xrender.so -usr/include/*/nx/X11/extensions/Xrender.h +usr/include/*/nx-X11/extensions/Xrender.h diff --git a/debian/libnx-xtst-dev.install.in b/debian/libnx-xtst-dev.install.in index 9dd16a1db..5acca96cf 100644 --- a/debian/libnx-xtst-dev.install.in +++ b/debian/libnx-xtst-dev.install.in @@ -1,2 +1,2 @@ usr/lib/*/libNX_Xtst.so -usr/include/*/nx/X11/extensions/XTest.h +usr/include/*/nx-X11/extensions/XTest.h diff --git a/debian/nx-x11proto-composite-dev.install.in b/debian/nx-x11proto-composite-dev.install.in index 609454a5e..cf2c77e36 100644 --- a/debian/nx-x11proto-composite-dev.install.in +++ b/debian/nx-x11proto-composite-dev.install.in @@ -1,2 +1,2 @@ -usr/include/*/nx/X11/extensions/composite.h -usr/include/*/nx/X11/extensions/compositeproto.h \ No newline at end of file +usr/include/*/nx-X11/extensions/composite.h +usr/include/*/nx-X11/extensions/compositeproto.h \ No newline at end of file diff --git a/debian/nx-x11proto-core-dev.install.in b/debian/nx-x11proto-core-dev.install.in index 92c529f41..2e99909a8 100644 --- a/debian/nx-x11proto-core-dev.install.in +++ b/debian/nx-x11proto-core-dev.install.in @@ -1,23 +1,23 @@ -usr/include/*/nx/X11/DECkeysym.h -usr/include/*/nx/X11/HPkeysym.h -usr/include/*/nx/X11/Sunkeysym.h -usr/include/*/nx/X11/X.h -usr/include/*/nx/X11/XF86keysym.h -usr/include/*/nx/X11/XWDFile.h -usr/include/*/nx/X11/Xalloca.h -usr/include/*/nx/X11/Xarch.h -usr/include/*/nx/X11/Xatom.h -usr/include/*/nx/X11/Xdefs.h -usr/include/*/nx/X11/Xfuncproto.h -usr/include/*/nx/X11/Xfuncs.h -usr/include/*/nx/X11/Xmd.h -usr/include/*/nx/X11/Xos.h -usr/include/*/nx/X11/Xos_r.h -usr/include/*/nx/X11/Xosdefs.h -usr/include/*/nx/X11/Xpoll.h -usr/include/*/nx/X11/Xproto.h -usr/include/*/nx/X11/Xprotostr.h -usr/include/*/nx/X11/Xthreads.h -usr/include/*/nx/X11/ap_keysym.h -usr/include/*/nx/X11/keysym.h -usr/include/*/nx/X11/keysymdef.h +usr/include/*/nx-X11/DECkeysym.h +usr/include/*/nx-X11/HPkeysym.h +usr/include/*/nx-X11/Sunkeysym.h +usr/include/*/nx-X11/X.h +usr/include/*/nx-X11/XF86keysym.h +usr/include/*/nx-X11/XWDFile.h +usr/include/*/nx-X11/Xalloca.h +usr/include/*/nx-X11/Xarch.h +usr/include/*/nx-X11/Xatom.h +usr/include/*/nx-X11/Xdefs.h +usr/include/*/nx-X11/Xfuncproto.h +usr/include/*/nx-X11/Xfuncs.h +usr/include/*/nx-X11/Xmd.h +usr/include/*/nx-X11/Xos.h +usr/include/*/nx-X11/Xos_r.h +usr/include/*/nx-X11/Xosdefs.h +usr/include/*/nx-X11/Xpoll.h +usr/include/*/nx-X11/Xproto.h +usr/include/*/nx-X11/Xprotostr.h +usr/include/*/nx-X11/Xthreads.h +usr/include/*/nx-X11/ap_keysym.h +usr/include/*/nx-X11/keysym.h +usr/include/*/nx-X11/keysymdef.h diff --git a/debian/nx-x11proto-render-dev.install.in b/debian/nx-x11proto-render-dev.install.in index bf778716f..f2222d234 100644 --- a/debian/nx-x11proto-render-dev.install.in +++ b/debian/nx-x11proto-render-dev.install.in @@ -1,3 +1,3 @@ -usr/include/*/nx/X11/extensions/render.h -usr/include/*/nx/X11/extensions/renderproto.h +usr/include/*/nx-X11/extensions/render.h +usr/include/*/nx-X11/extensions/renderproto.h diff --git a/debian/nx-x11proto-xext-dev.install.in b/debian/nx-x11proto-xext-dev.install.in index 7e0ca507f..0d1f8699b 100644 --- a/debian/nx-x11proto-xext-dev.install.in +++ b/debian/nx-x11proto-xext-dev.install.in @@ -1,4 +1,4 @@ -usr/include/*/nx/X11/extensions/xteststr.h -usr/include/*/nx/X11/extensions/shapestr.h -usr/include/*/nx/X11/extensions/shmstr.h -usr/include/*/nx/X11/extensions/syncstr.h +usr/include/*/nx-X11/extensions/xteststr.h +usr/include/*/nx-X11/extensions/shapestr.h +usr/include/*/nx-X11/extensions/shmstr.h +usr/include/*/nx-X11/extensions/syncstr.h diff --git a/debian/nx-x11proto-xfixes-dev.install.in b/debian/nx-x11proto-xfixes-dev.install.in index 4b614d6c1..91eae0306 100644 --- a/debian/nx-x11proto-xfixes-dev.install.in +++ b/debian/nx-x11proto-xfixes-dev.install.in @@ -1,3 +1,3 @@ -usr/include/*/nx/X11/extensions/xfixeswire.h -usr/include/*/nx/X11/extensions/xfixesproto.h +usr/include/*/nx-X11/extensions/xfixeswire.h +usr/include/*/nx-X11/extensions/xfixesproto.h diff --git a/debian/nx-x11proto-xinerama-dev.install.in b/debian/nx-x11proto-xinerama-dev.install.in index 36717e1f5..dca06ddee 100644 --- a/debian/nx-x11proto-xinerama-dev.install.in +++ b/debian/nx-x11proto-xinerama-dev.install.in @@ -1 +1 @@ -usr/include/*/nx/X11/extensions/panoramiXproto.h \ No newline at end of file +usr/include/*/nx-X11/extensions/panoramiXproto.h \ No newline at end of file diff --git a/debian/rules b/debian/rules index b3060b36f..b78855033 100755 --- a/debian/rules +++ b/debian/rules @@ -42,28 +42,28 @@ override_dh_install: rm debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libXcompshad.a # remove extras, GL, and other unneeded headers - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/GL/ - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/XInput.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/XK*.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/*Xv*.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xtrap*.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/XRes*.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/record*.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86vmode.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86vmstr.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86misc.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86dga1.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86dgastr.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86dga.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86dga1str.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86mscstr.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/bigreqstr.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xcmiscstr.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/XIproto.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86bigfstr.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/xf86bigfont.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/extensions/XI.h - rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx/X11/Xtrans/ + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/GL/ + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/XInput.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/XK*.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/*Xv*.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xtrap*.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/XRes*.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/record*.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86vmode.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86vmstr.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86misc.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86dga1.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86dgastr.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86dga.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86dga1str.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86mscstr.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/bigreqstr.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xcmiscstr.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/XIproto.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86bigfstr.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/xf86bigfont.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/XI.h + rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/Xtrans/ dh_install --fail-missing diff --git a/nx-X11/config/cf/X11.tmpl b/nx-X11/config/cf/X11.tmpl index 241bc267f..f54ff84cc 100644 --- a/nx-X11/config/cf/X11.tmpl +++ b/nx-X11/config/cf/X11.tmpl @@ -1223,7 +1223,7 @@ XCOMM X Window System make variables; these need to be coordinated with rules PROGRAMSRC = $(TOP)/programs LIBSRC = $(XTOP)/lib INCLUDESRC = BuildIncDir - XINCLUDESRC = $(INCLUDESRC)/X11 + XINCLUDESRC = $(INCLUDESRC)/nx-X11 SERVERSRC = $(XTOP)/programs/Xserver CONTRIBSRC = ContribDir UNSUPPORTEDSRC = UnsupportedDir diff --git a/nx-X11/include/GL/glx.h b/nx-X11/include/GL/glx.h index 910504a1d..3a9e942c7 100644 --- a/nx-X11/include/GL/glx.h +++ b/nx-X11/include/GL/glx.h @@ -36,8 +36,8 @@ ** compliant with the OpenGL(R) version 1.2.1 Specification. */ -#include -#include +#include +#include #include #include diff --git a/nx-X11/include/GL/glxint.h b/nx-X11/include/GL/glxint.h index d9e2581bb..50f4a0eaa 100644 --- a/nx-X11/include/GL/glxint.h +++ b/nx-X11/include/GL/glxint.h @@ -23,8 +23,8 @@ ** $SGI$ */ -#include -#include +#include +#include #include "GL/gl.h" typedef struct __GLXvisualConfigRec __GLXvisualConfig; diff --git a/nx-X11/include/Imakefile b/nx-X11/include/Imakefile index 26520eab0..76a4daf6d 100644 --- a/nx-X11/include/Imakefile +++ b/nx-X11/include/Imakefile @@ -51,10 +51,10 @@ HEADERS = \ all:: -BuildIncludes($(HEADERS),X11,..) +BuildIncludes($(HEADERS),nx-X11,..) #if BuildLibraries -InstallMultipleFlags($(HEADERS),$(INCDIR)/X11,$(INSTINCFLAGS)) +InstallMultipleFlags($(HEADERS),$(INCDIR)/nx-X11,$(INSTINCFLAGS)) #endif MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) diff --git a/nx-X11/include/XWDFile.h b/nx-X11/include/XWDFile.h index 0ce22e1a8..19a26ea33 100644 --- a/nx-X11/include/XWDFile.h +++ b/nx-X11/include/XWDFile.h @@ -39,7 +39,7 @@ in this Software without prior written authorization from The Open Group. #ifndef XWDFILE_H #define XWDFILE_H -#include +#include #define XWD_FILE_VERSION 7 #define sz_XWDheader 100 diff --git a/nx-X11/include/Xdefs.h b/nx-X11/include/Xdefs.h index f32149db5..c06202af3 100644 --- a/nx-X11/include/Xdefs.h +++ b/nx-X11/include/Xdefs.h @@ -31,7 +31,7 @@ authorization from The XFree86 Project Inc.. #define _XDEFS_H #ifdef _XSERVER64 -#include +#include #endif #ifndef _XTYPEDEF_ATOM diff --git a/nx-X11/include/Xfuncs.h b/nx-X11/include/Xfuncs.h index a059bc710..7582198bb 100644 --- a/nx-X11/include/Xfuncs.h +++ b/nx-X11/include/Xfuncs.h @@ -31,7 +31,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _XFUNCS_H_ #define _XFUNCS_H_ -#include +#include /* the old Xfuncs.h, for pre-R6 */ #if !(defined(XFree86LOADER) && defined(IN_MODULE)) diff --git a/nx-X11/include/Xos.h b/nx-X11/include/Xos.h index 04b14b6fc..a2abf156f 100644 --- a/nx-X11/include/Xos.h +++ b/nx-X11/include/Xos.h @@ -37,7 +37,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _XOS_H_ #define _XOS_H_ -#include +#include /* * Get major data types (esp. caddr_t) @@ -150,7 +150,7 @@ extern int sys_nerr; #include #endif #ifdef WIN32 -#include +#include #else #include #endif @@ -285,6 +285,6 @@ struct sockaddr_un { }; #endif -#include +#include #endif /* _XOS_H_ */ diff --git a/nx-X11/include/Xos_r.h b/nx-X11/include/Xos_r.h index e539aee2a..44b1eaacf 100644 --- a/nx-X11/include/Xos_r.h +++ b/nx-X11/include/Xos_r.h @@ -216,7 +216,7 @@ extern void XtProcessUnlock( * * #define X_INCLUDE_PWD_H * #define XOS_USE_..._LOCKING - * #include + * #include * * typedef ... _Xgetpwparams; * @@ -394,7 +394,7 @@ typedef int _Xgetpwret; * * #define X_INCLUDE_NETDB_H * #define XOS_USE_..._LOCKING - * #include + * #include * * typedef ... _Xgethostbynameparams; * typedef ... _Xgetservbynameparams; @@ -556,7 +556,7 @@ typedef int _Xgetservbynameparams; /* dummy */ * * #define X_INCLUDE_DIRENT_H * #define XOS_USE_..._LOCKING - * #include + * #include * * typedef ... _Xreaddirparams; * @@ -680,7 +680,7 @@ extern int _Preaddir_r(DIR *, struct dirent *, struct dirent **); * * #define X_INCLUDE_UNISTD_H * #define XOS_USE_..._LOCKING - * #include + * #include * * typedef ... _Xgetloginparams; * typedef ... _Xttynameparams; @@ -822,7 +822,7 @@ typedef struct { * * #define X_INCLUDE_STRING_H * #define XOS_USE_..._LOCKING - * #include + * #include * * typedef ... _Xstrtokparams; * @@ -868,7 +868,7 @@ typedef char * _Xstrtokparams; * * #define X_INCLUDE_TIME_H * #define XOS_USE_..._LOCKING - * #include + * #include * * typedef ... _Xatimeparams; * typedef ... _Xctimeparams; @@ -1036,7 +1036,7 @@ typedef struct tm _Xltimeparams; * * #define X_INCLUDE_GRP_H * #define XOS_USE_..._LOCKING - * #include + * #include * * typedef ... _Xgetgrparams; * diff --git a/nx-X11/include/Xpoll.h.in b/nx-X11/include/Xpoll.h.in index 3200c3711..77a0aea3d 100644 --- a/nx-X11/include/Xpoll.h.in +++ b/nx-X11/include/Xpoll.h.in @@ -75,7 +75,7 @@ from The Open Group. #ifndef USE_POLL -#include +#include /* Below is the monster branch from hell. Basically, most systems will drop to * 'the branch below is the fallthrough for halfway modern systems', and include @@ -104,7 +104,7 @@ from The Open Group. # include #endif -#include +#include #ifdef CSRG_BASED #include @@ -241,7 +241,7 @@ extern int _XSelect(int maxfds, fd_set *readfds, fd_set *writefds, #ifndef FD_SETSIZE #define FD_SETSIZE XFD_SETSIZE #endif -#include +#include #define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) diff --git a/nx-X11/include/Xproto.h b/nx-X11/include/Xproto.h index 877aab442..0f7d1f557 100644 --- a/nx-X11/include/Xproto.h +++ b/nx-X11/include/Xproto.h @@ -73,8 +73,8 @@ SOFTWARE. ******************************************************************/ -#include -#include +#include +#include /* * Define constants for the sizes of the network packets. The sz_ prefix is diff --git a/nx-X11/include/Xprotostr.h b/nx-X11/include/Xprotostr.h index f343d9849..a0f849874 100644 --- a/nx-X11/include/Xprotostr.h +++ b/nx-X11/include/Xprotostr.h @@ -48,7 +48,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -#include +#include /* Used by PolySegment */ diff --git a/nx-X11/include/Xthreads.h b/nx-X11/include/Xthreads.h index 54b5440ad..41440a2fb 100644 --- a/nx-X11/include/Xthreads.h +++ b/nx-X11/include/Xthreads.h @@ -98,7 +98,7 @@ extern xthread_t (*_x11_thr_self)(); #define xcondition_broadcast(cv) cond_broadcast(cv) #else /* !SVR4 */ #ifdef WIN32 -#include +#include typedef DWORD xthread_t; typedef DWORD xthread_key_t; struct _xthread_waiter { diff --git a/nx-X11/include/extensions/Imakefile b/nx-X11/include/extensions/Imakefile index ec6c10b98..b7ed23120 100644 --- a/nx-X11/include/extensions/Imakefile +++ b/nx-X11/include/extensions/Imakefile @@ -101,10 +101,10 @@ HEADERS = Xext.h \ all:: -BuildIncludes($(HEADERS),X11/extensions,../..) +BuildIncludes($(HEADERS),nx-X11/extensions,../..) #if BuildLibraries -InstallMultipleFlags($(HEADERS),$(INCDIR)/X11/extensions,$(INSTINCFLAGS)) +InstallMultipleFlags($(HEADERS),$(INCDIR)/nx-X11/extensions,$(INSTINCFLAGS)) #endif InstallDriverSDKNonExecFile(XI.h,$(DRIVERSDKINCLUDEDIR)/extensions) diff --git a/nx-X11/include/extensions/MITMisc.h b/nx-X11/include/extensions/MITMisc.h index 975700e01..d66b8242d 100644 --- a/nx-X11/include/extensions/MITMisc.h +++ b/nx-X11/include/extensions/MITMisc.h @@ -31,7 +31,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _XMITMISC_H_ #define _XMITMISC_H_ -#include +#include #define X_MITSetBugMode 0 #define X_MITGetBugMode 1 diff --git a/nx-X11/include/extensions/XEVI.h b/nx-X11/include/extensions/XEVI.h index d8e37ff4f..30b2412d9 100644 --- a/nx-X11/include/extensions/XEVI.h +++ b/nx-X11/include/extensions/XEVI.h @@ -25,7 +25,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef _XEVI_H_ #define _XEVI_H_ -#include +#include #define X_EVIQueryVersion 0 #define X_EVIGetVisualInfo 1 #define XEVI_TRANSPARENCY_NONE 0 diff --git a/nx-X11/include/extensions/XEVIstr.h b/nx-X11/include/extensions/XEVIstr.h index 388ef4bcf..4deb6c113 100644 --- a/nx-X11/include/extensions/XEVIstr.h +++ b/nx-X11/include/extensions/XEVIstr.h @@ -26,7 +26,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef _EVISTR_H_ #define _EVISTR_H_ -#include +#include #define VisualID CARD32 #define EVINAME "Extended-Visual-Information" diff --git a/nx-X11/include/extensions/XInput.h b/nx-X11/include/extensions/XInput.h index ee4410531..cf4b72ca0 100644 --- a/nx-X11/include/extensions/XInput.h +++ b/nx-X11/include/extensions/XInput.h @@ -52,8 +52,8 @@ SOFTWARE. #ifndef _XINPUT_H_ #define _XINPUT_H_ -#include -#include +#include +#include #define _deviceKeyPress 0 #define _deviceKeyRelease 1 diff --git a/nx-X11/include/extensions/XIproto.h b/nx-X11/include/extensions/XIproto.h index 1da0248f8..cccb11a2c 100644 --- a/nx-X11/include/extensions/XIproto.h +++ b/nx-X11/include/extensions/XIproto.h @@ -50,8 +50,8 @@ SOFTWARE. #ifndef _XIPROTO_H #define _XIPROTO_H -#include -#include +#include +#include /* make sure types have right sizes for protocol structures. */ #define Window CARD32 diff --git a/nx-X11/include/extensions/XKBgeom.h b/nx-X11/include/extensions/XKBgeom.h index 89f902fba..6ef114bfe 100644 --- a/nx-X11/include/extensions/XKBgeom.h +++ b/nx-X11/include/extensions/XKBgeom.h @@ -29,7 +29,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef _XKBGEOM_H_ #define _XKBGEOM_H_ -#include +#include #ifdef XKB_IN_SERVER #define XkbAddGeomKeyAlias SrvXkbAddGeomKeyAlias diff --git a/nx-X11/include/extensions/XKBproto.h b/nx-X11/include/extensions/XKBproto.h index 97dd4d262..2dc3b141e 100644 --- a/nx-X11/include/extensions/XKBproto.h +++ b/nx-X11/include/extensions/XKBproto.h @@ -28,8 +28,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef _XKBPROTO_H_ #define _XKBPROTO_H_ -#include -#include +#include +#include #define Window CARD32 #define Atom CARD32 diff --git a/nx-X11/include/extensions/XKBsrv.h b/nx-X11/include/extensions/XKBsrv.h index 0d262e979..3d335bc88 100644 --- a/nx-X11/include/extensions/XKBsrv.h +++ b/nx-X11/include/extensions/XKBsrv.h @@ -69,8 +69,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define XkbUpdateKeyTypeVirtualMods SrvXkbUpdateKeyTypeVirtualMods #endif -#include -#include +#include +#include #include "inputstr.h" #ifdef NXAGENT_SERVER @@ -1100,9 +1100,9 @@ extern void XkbSendNewKeyboardNotify( #ifdef XKBSRV_NEED_FILE_FUNCS -#include -#include -#include +#include +#include +#include #define _XkbListKeymaps 0 #define _XkbListKeycodes 1 diff --git a/nx-X11/include/extensions/XKBstr.h b/nx-X11/include/extensions/XKBstr.h index 6131c931c..77666f6aa 100644 --- a/nx-X11/include/extensions/XKBstr.h +++ b/nx-X11/include/extensions/XKBstr.h @@ -28,7 +28,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef _XKBSTR_H_ #define _XKBSTR_H_ -#include +#include #define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f)) #define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff))) diff --git a/nx-X11/include/extensions/XLbx.h b/nx-X11/include/extensions/XLbx.h index 01d44f090..6cd867944 100644 --- a/nx-X11/include/extensions/XLbx.h +++ b/nx-X11/include/extensions/XLbx.h @@ -25,7 +25,7 @@ #ifndef _XLBX_H_ #define _XLBX_H_ -#include +#include /* * NOTE: any changes or additions to the opcodes needs to be reflected @@ -128,8 +128,8 @@ #ifndef _XLBX_SERVER_ -#include -#include +#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/XShm.h b/nx-X11/include/extensions/XShm.h index 4ae14ca8b..4b0d01bef 100644 --- a/nx-X11/include/extensions/XShm.h +++ b/nx-X11/include/extensions/XShm.h @@ -32,7 +32,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _XSHM_H_ #define _XSHM_H_ -#include +#include #define X_ShmQueryVersion 0 #define X_ShmAttach 1 diff --git a/nx-X11/include/extensions/XTest.h b/nx-X11/include/extensions/XTest.h index afb1849c3..4817ef132 100644 --- a/nx-X11/include/extensions/XTest.h +++ b/nx-X11/include/extensions/XTest.h @@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _XTEST_H_ #define _XTEST_H_ -#include +#include #define X_XTestGetVersion 0 #define X_XTestCompareCursor 1 @@ -47,7 +47,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _XTEST_SERVER_ -#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/Xag.h b/nx-X11/include/extensions/Xag.h index 815f2b9f9..4c1193e3d 100644 --- a/nx-X11/include/extensions/Xag.h +++ b/nx-X11/include/extensions/Xag.h @@ -29,7 +29,7 @@ from The Open Group. #ifndef _XAG_H_ #define _XAG_H_ -#include +#include #define X_XagQueryVersion 0 #define X_XagCreate 1 diff --git a/nx-X11/include/extensions/Xagsrv.h b/nx-X11/include/extensions/Xagsrv.h index b9c50aaa9..daf1af04d 100644 --- a/nx-X11/include/extensions/Xagsrv.h +++ b/nx-X11/include/extensions/Xagsrv.h @@ -29,7 +29,7 @@ from The Open Group. #ifndef _XAGSRV_H_ #define _XAGSRV_H_ -#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/Xagstr.h b/nx-X11/include/extensions/Xagstr.h index ffb5527a2..4f12027e0 100644 --- a/nx-X11/include/extensions/Xagstr.h +++ b/nx-X11/include/extensions/Xagstr.h @@ -29,7 +29,7 @@ from The Open Group. #ifndef _XAGSTR_H_ /* { */ #define _XAGSTR_H_ -#include +#include #define XAppGroup CARD32 diff --git a/nx-X11/include/extensions/Xcup.h b/nx-X11/include/extensions/Xcup.h index b1df039e6..fb5fd0887 100644 --- a/nx-X11/include/extensions/Xcup.h +++ b/nx-X11/include/extensions/Xcup.h @@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _XCUP_H_ #define _XCUP_H_ -#include +#include #define X_XcupQueryVersion 0 #define X_XcupGetReservedColormapEntries 1 diff --git a/nx-X11/include/extensions/Xcupstr.h b/nx-X11/include/extensions/Xcupstr.h index f521c333c..fa77b5aea 100644 --- a/nx-X11/include/extensions/Xcupstr.h +++ b/nx-X11/include/extensions/Xcupstr.h @@ -30,7 +30,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _XCUPSTR_H_ /* { */ #define _XCUPSTR_H_ -#include +#include #define XCUPNAME "TOG-CUP" diff --git a/nx-X11/include/extensions/Xdbe.h b/nx-X11/include/extensions/Xdbe.h index f9205a228..bc43007c6 100644 --- a/nx-X11/include/extensions/Xdbe.h +++ b/nx-X11/include/extensions/Xdbe.h @@ -38,8 +38,8 @@ /* INCLUDES */ -#include -#include +#include +#include /* DEFINES */ diff --git a/nx-X11/include/extensions/Xevie.h b/nx-X11/include/extensions/Xevie.h index d6d4fab84..5dc48bbfd 100644 --- a/nx-X11/include/extensions/Xevie.h +++ b/nx-X11/include/extensions/Xevie.h @@ -35,7 +35,7 @@ of the copyright holder. #ifndef _XEVIE_H_ #define _XEVIE_H_ -#include +#include #define XEVIE_UNMODIFIED 0 #define XEVIE_MODIFIED 1 diff --git a/nx-X11/include/extensions/Xext.h b/nx-X11/include/extensions/Xext.h index 5b62c8b2d..b0ce292fc 100644 --- a/nx-X11/include/extensions/Xext.h +++ b/nx-X11/include/extensions/Xext.h @@ -28,7 +28,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _XEXT_H_ #define _XEXT_H_ -#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/Xinerama.h b/nx-X11/include/extensions/Xinerama.h index e1c9445c3..77e7e7444 100644 --- a/nx-X11/include/extensions/Xinerama.h +++ b/nx-X11/include/extensions/Xinerama.h @@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _Xinerama_h #define _Xinerama_h -#include +#include typedef struct { int screen_number; diff --git a/nx-X11/include/extensions/Xv.h b/nx-X11/include/extensions/Xv.h index 4e85fa719..f07f9d75f 100644 --- a/nx-X11/include/extensions/Xv.h +++ b/nx-X11/include/extensions/Xv.h @@ -44,7 +44,7 @@ SOFTWARE. ** */ -#include +#include #define XvName "XVideo" #define XvVersion 2 diff --git a/nx-X11/include/extensions/XvMC.h b/nx-X11/include/extensions/XvMC.h index 3e621f05a..1709692a1 100644 --- a/nx-X11/include/extensions/XvMC.h +++ b/nx-X11/include/extensions/XvMC.h @@ -3,8 +3,8 @@ #ifndef _XVMC_H_ #define _XVMC_H_ -#include -#include +#include +#include #define XvMCName "XVideo-MotionCompensation" #define XvMCNumEvents 0 diff --git a/nx-X11/include/extensions/XvMClib.h b/nx-X11/include/extensions/XvMClib.h index 1b30a669a..c1e94119e 100644 --- a/nx-X11/include/extensions/XvMClib.h +++ b/nx-X11/include/extensions/XvMClib.h @@ -4,9 +4,9 @@ #ifndef _XVMCLIB_H_ #define _XVMCLIB_H_ -#include -#include -#include +#include +#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/Xvlib.h b/nx-X11/include/extensions/Xvlib.h index 2fd26e55b..98c407e31 100644 --- a/nx-X11/include/extensions/Xvlib.h +++ b/nx-X11/include/extensions/Xvlib.h @@ -53,8 +53,8 @@ SOFTWARE. ** */ -#include -#include +#include +#include typedef struct { int numerator; diff --git a/nx-X11/include/extensions/Xvproto.h b/nx-X11/include/extensions/Xvproto.h index 9112f510e..81e1656a8 100644 --- a/nx-X11/include/extensions/Xvproto.h +++ b/nx-X11/include/extensions/Xvproto.h @@ -49,7 +49,7 @@ SOFTWARE. ** */ -#include +#include /* Symbols: These are undefined at the end of this file to restore the values they have in Xv.h */ diff --git a/nx-X11/include/extensions/composite.h b/nx-X11/include/extensions/composite.h index bfdfbee97..d1901750a 100644 --- a/nx-X11/include/extensions/composite.h +++ b/nx-X11/include/extensions/composite.h @@ -25,7 +25,7 @@ #ifndef _COMPOSITE_H_ #define _COMPOSITE_H_ -#include +#include #define COMPOSITE_NAME "Composite" #define COMPOSITE_MAJOR 0 diff --git a/nx-X11/include/extensions/compositeproto.h b/nx-X11/include/extensions/compositeproto.h index 2304e961d..a851c727e 100644 --- a/nx-X11/include/extensions/compositeproto.h +++ b/nx-X11/include/extensions/compositeproto.h @@ -25,8 +25,8 @@ #ifndef _COMPOSITEPROTO_H_ #define _COMPOSITEPROTO_H_ -#include -#include +#include +#include #define Window CARD32 #define Region CARD32 diff --git a/nx-X11/include/extensions/dpms.h b/nx-X11/include/extensions/dpms.h index 7555f4ab6..87d7c9c81 100644 --- a/nx-X11/include/extensions/dpms.h +++ b/nx-X11/include/extensions/dpms.h @@ -46,8 +46,8 @@ Equipment Corporation. #ifndef DPMS_SERVER -#include -#include +#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/extutil.h b/nx-X11/include/extensions/extutil.h index 825d81e93..de6becfd2 100644 --- a/nx-X11/include/extensions/extutil.h +++ b/nx-X11/include/extensions/extutil.h @@ -36,7 +36,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _EXTUTIL_H_ #define _EXTUTIL_H_ -#include +#include /* * We need to keep a list of open displays since the Xlib display list isn't diff --git a/nx-X11/include/extensions/fontcache.h b/nx-X11/include/extensions/fontcache.h index b767db19b..2a3cf619b 100644 --- a/nx-X11/include/extensions/fontcache.h +++ b/nx-X11/include/extensions/fontcache.h @@ -68,7 +68,7 @@ typedef struct { #ifndef _FONTCACHE_SERVER_ -#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/fontcacheP.h b/nx-X11/include/extensions/fontcacheP.h index 75677f300..5363ef149 100644 --- a/nx-X11/include/extensions/fontcacheP.h +++ b/nx-X11/include/extensions/fontcacheP.h @@ -31,7 +31,7 @@ #ifndef _FONTCACHEP_H_ #define _FONTCACHEP_H_ -#include +#include int FontCacheChangeSettings(FontCacheSettingsPtr /* cinfo */); void FontCacheGetSettings(FontCacheSettingsPtr /* cinfo */); diff --git a/nx-X11/include/extensions/fontcachstr.h b/nx-X11/include/extensions/fontcachstr.h index eab704e23..abead0f2b 100644 --- a/nx-X11/include/extensions/fontcachstr.h +++ b/nx-X11/include/extensions/fontcachstr.h @@ -34,7 +34,7 @@ #ifndef _FONTCACHESTR_H_ #define _FONTCACHESTR_H_ -#include +#include #define FONTCACHENAME "FontCache" diff --git a/nx-X11/include/extensions/lbxbuf.h b/nx-X11/include/extensions/lbxbuf.h index 63983df16..1a5a7475a 100644 --- a/nx-X11/include/extensions/lbxbuf.h +++ b/nx-X11/include/extensions/lbxbuf.h @@ -38,7 +38,7 @@ typedef struct _zlibbuffer *ZlibBufferPtr; -#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/lbxbufstr.h b/nx-X11/include/extensions/lbxbufstr.h index e1a06f633..d99730e7e 100644 --- a/nx-X11/include/extensions/lbxbufstr.h +++ b/nx-X11/include/extensions/lbxbufstr.h @@ -27,7 +27,7 @@ #ifndef _BUFFERSTR_H_ #define _BUFFERSTR_H_ -#include +#include /* * ZLIB Input/Output buffer diff --git a/nx-X11/include/extensions/lbximage.h b/nx-X11/include/extensions/lbximage.h index 10627cf29..fff181a69 100644 --- a/nx-X11/include/extensions/lbximage.h +++ b/nx-X11/include/extensions/lbximage.h @@ -30,7 +30,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _LBX_IMAGE_H_ #define _LBX_IMAGE_H_ -#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/lbxstr.h b/nx-X11/include/extensions/lbxstr.h index a7521b1be..7bde5a766 100644 --- a/nx-X11/include/extensions/lbxstr.h +++ b/nx-X11/include/extensions/lbxstr.h @@ -25,7 +25,7 @@ #ifndef _LBXSTR_H_ #define _LBXSTR_H_ -#include +#include #define LBXNAME "LBX" diff --git a/nx-X11/include/extensions/multibuf.h b/nx-X11/include/extensions/multibuf.h index 96b4c3b14..c35399b01 100644 --- a/nx-X11/include/extensions/multibuf.h +++ b/nx-X11/include/extensions/multibuf.h @@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _MULTIBUF_H_ #define _MULTIBUF_H_ -#include +#include #define MULTIBUFFER_PROTOCOL_NAME "Multi-Buffering" diff --git a/nx-X11/include/extensions/recordstr.h b/nx-X11/include/extensions/recordstr.h index 246d34f1a..88ff8b66b 100644 --- a/nx-X11/include/extensions/recordstr.h +++ b/nx-X11/include/extensions/recordstr.h @@ -29,7 +29,7 @@ static char sccsid[ ] = "@(#) recordstr.h 1.5 6/5/95 12:37:44"; #ifndef _RECORDSTR_H_ #define _RECORDSTR_H_ -#include +#include #define RECORD_NAME "RECORD" #define RECORD_MAJOR_VERSION 1 diff --git a/nx-X11/include/extensions/renderproto.h b/nx-X11/include/extensions/renderproto.h index bdd4c746f..25c510cd1 100644 --- a/nx-X11/include/extensions/renderproto.h +++ b/nx-X11/include/extensions/renderproto.h @@ -26,8 +26,8 @@ #ifndef _XRENDERP_H_ #define _XRENDERP_H_ -#include -#include +#include +#include #define Window CARD32 #define Drawable CARD32 diff --git a/nx-X11/include/extensions/saverproto.h b/nx-X11/include/extensions/saverproto.h index 1a671af91..17f740f4d 100644 --- a/nx-X11/include/extensions/saverproto.h +++ b/nx-X11/include/extensions/saverproto.h @@ -31,7 +31,7 @@ in this Software without prior written authorization from the X Consortium. #ifndef _SAVERPROTO_H_ #define _SAVERPROTO_H_ -#include +#include #define Window CARD32 #define Drawable CARD32 diff --git a/nx-X11/include/extensions/scrnsaver.h b/nx-X11/include/extensions/scrnsaver.h index 2659edd73..38e5e24df 100644 --- a/nx-X11/include/extensions/scrnsaver.h +++ b/nx-X11/include/extensions/scrnsaver.h @@ -31,9 +31,9 @@ in this Software without prior written authorization from the X Consortium. #ifndef _SCRNSAVER_H_ #define _SCRNSAVER_H_ -#include -#include -#include +#include +#include +#include typedef struct { int type; /* of event */ diff --git a/nx-X11/include/extensions/security.h b/nx-X11/include/extensions/security.h index 188ad55bc..a0aabaf8e 100644 --- a/nx-X11/include/extensions/security.h +++ b/nx-X11/include/extensions/security.h @@ -30,7 +30,7 @@ from The Open Group. #define _SECURITY_H #define _XAUTH_STRUCT_ONLY -#include +#include /* constants that server, library, and application all need */ diff --git a/nx-X11/include/extensions/securstr.h b/nx-X11/include/extensions/securstr.h index 50c764441..3e93fe10e 100644 --- a/nx-X11/include/extensions/securstr.h +++ b/nx-X11/include/extensions/securstr.h @@ -29,7 +29,7 @@ from The Open Group. #ifndef _SECURSTR_H #define _SECURSTR_H -#include +#include #define SECURITY_EXTENSION_NAME "SECURITY" #define SECURITY_MAJOR_VERSION 1 diff --git a/nx-X11/include/extensions/shape.h b/nx-X11/include/extensions/shape.h index d173efef8..5e85ffc04 100644 --- a/nx-X11/include/extensions/shape.h +++ b/nx-X11/include/extensions/shape.h @@ -30,7 +30,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _SHAPE_H_ #define _SHAPE_H_ -#include +#include #define X_ShapeQueryVersion 0 #define X_ShapeRectangles 1 @@ -59,7 +59,7 @@ in this Software without prior written authorization from The Open Group. #ifndef _SHAPE_SERVER_ -#include +#include typedef struct { int type; /* of event */ diff --git a/nx-X11/include/extensions/sync.h b/nx-X11/include/extensions/sync.h index 9fbe6d72f..8d2861663 100644 --- a/nx-X11/include/extensions/sync.h +++ b/nx-X11/include/extensions/sync.h @@ -53,7 +53,7 @@ PERFORMANCE OF THIS SOFTWARE. #ifndef _SYNC_H_ #define _SYNC_H_ -#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/include/extensions/vldXvMC.h b/nx-X11/include/extensions/vldXvMC.h index 91fb3b76a..355c662e6 100644 --- a/nx-X11/include/extensions/vldXvMC.h +++ b/nx-X11/include/extensions/vldXvMC.h @@ -28,9 +28,9 @@ #ifndef _VLDXVMC_H #define _VLDXVMC_H -#include -#include -#include +#include +#include +#include /* * New "Motion compensation type". diff --git a/nx-X11/include/extensions/xf86bigfont.h b/nx-X11/include/extensions/xf86bigfont.h index 654cc401b..d6be21b6f 100644 --- a/nx-X11/include/extensions/xf86bigfont.h +++ b/nx-X11/include/extensions/xf86bigfont.h @@ -11,7 +11,7 @@ #ifndef _XF86BIGFONT_H_ #define _XF86BIGFONT_H_ -#include +#include #define X_XF86BigfontQueryVersion 0 #define X_XF86BigfontQueryFont 1 diff --git a/nx-X11/include/extensions/xf86bigfstr.h b/nx-X11/include/extensions/xf86bigfstr.h index 95f107a2a..6f66e58d9 100644 --- a/nx-X11/include/extensions/xf86bigfstr.h +++ b/nx-X11/include/extensions/xf86bigfstr.h @@ -11,7 +11,7 @@ #ifndef _XF86BIGFSTR_H_ #define _XF86BIGFSTR_H_ -#include +#include #define XF86BIGFONTNAME "XFree86-Bigfont" diff --git a/nx-X11/include/extensions/xf86dga.h b/nx-X11/include/extensions/xf86dga.h index 720118842..d6e494158 100644 --- a/nx-X11/include/extensions/xf86dga.h +++ b/nx-X11/include/extensions/xf86dga.h @@ -6,8 +6,8 @@ #ifndef _XF86DGA_H_ #define _XF86DGA_H_ -#include -#include +#include +#include #define X_XDGAQueryVersion 0 diff --git a/nx-X11/include/extensions/xf86dga1.h b/nx-X11/include/extensions/xf86dga1.h index 4f45e74b3..972b18e9e 100644 --- a/nx-X11/include/extensions/xf86dga1.h +++ b/nx-X11/include/extensions/xf86dga1.h @@ -15,7 +15,7 @@ Copyright (c) 1995 XFree86 Inc #ifndef _XF86DGA1_H_ #define _XF86DGA1_H_ -#include +#include #define X_XF86DGAQueryVersion 0 #define X_XF86DGAGetVideoLL 1 diff --git a/nx-X11/include/extensions/xf86dgastr.h b/nx-X11/include/extensions/xf86dgastr.h index 66dd354c8..30e4ff722 100644 --- a/nx-X11/include/extensions/xf86dgastr.h +++ b/nx-X11/include/extensions/xf86dgastr.h @@ -9,7 +9,7 @@ Copyright (c) 1995 XFree86 Inc. #ifndef _XF86DGASTR_H_ #define _XF86DGASTR_H_ -#include +#include #define XF86DGANAME "XFree86-DGA" diff --git a/nx-X11/include/extensions/xf86misc.h b/nx-X11/include/extensions/xf86misc.h index f5d7a5664..fb01a6357 100644 --- a/nx-X11/include/extensions/xf86misc.h +++ b/nx-X11/include/extensions/xf86misc.h @@ -9,7 +9,7 @@ #ifndef _XF86MISC_H_ #define _XF86MISC_H_ -#include +#include #define X_XF86MiscQueryVersion 0 #ifdef _XF86MISC_SAVER_COMPAT_ diff --git a/nx-X11/include/extensions/xf86mscstr.h b/nx-X11/include/extensions/xf86mscstr.h index 637d3a5a0..2b8c0d07e 100644 --- a/nx-X11/include/extensions/xf86mscstr.h +++ b/nx-X11/include/extensions/xf86mscstr.h @@ -9,7 +9,7 @@ #ifndef _XF86MISCSTR_H_ #define _XF86MISCSTR_H_ -#include +#include #define XF86MISCNAME "XFree86-Misc" diff --git a/nx-X11/include/extensions/xf86vmode.h b/nx-X11/include/extensions/xf86vmode.h index 3420ae4c8..624820dea 100644 --- a/nx-X11/include/extensions/xf86vmode.h +++ b/nx-X11/include/extensions/xf86vmode.h @@ -35,8 +35,8 @@ from Kaleb S. KEITHLEY #ifndef _XF86VIDMODE_H_ #define _XF86VIDMODE_H_ -#include -#include +#include +#include #define X_XF86VidModeQueryVersion 0 #define X_XF86VidModeGetModeLine 1 diff --git a/nx-X11/include/extensions/xf86vmstr.h b/nx-X11/include/extensions/xf86vmstr.h index a80eb8eb6..43c67980f 100644 --- a/nx-X11/include/extensions/xf86vmstr.h +++ b/nx-X11/include/extensions/xf86vmstr.h @@ -35,7 +35,7 @@ from Kaleb S. KEITHLEY #ifndef _XF86VIDMODESTR_H_ #define _XF86VIDMODESTR_H_ -#include +#include #define XF86VIDMODENAME "XFree86-VidModeExtension" diff --git a/nx-X11/include/extensions/xfixesproto.h b/nx-X11/include/extensions/xfixesproto.h index 773bc65d1..0ef6a2fd6 100644 --- a/nx-X11/include/extensions/xfixesproto.h +++ b/nx-X11/include/extensions/xfixesproto.h @@ -25,10 +25,10 @@ #ifndef _XFIXESPROTO_H_ #define _XFIXESPROTO_H_ -#include -#include +#include +#include #define _SHAPE_SERVER_ -#include +#include #undef _SHAPE_SERVER_ #define Window CARD32 diff --git a/nx-X11/include/extensions/xtrapddmi.h b/nx-X11/include/extensions/xtrapddmi.h index c187a3a0b..71df0712d 100644 --- a/nx-X11/include/extensions/xtrapddmi.h +++ b/nx-X11/include/extensions/xtrapddmi.h @@ -42,8 +42,8 @@ SOFTWARE. * contained herein should *not* be visible to clients (xtrapdi.h * is used for this). The name is historical. */ -#include -#include +#include +#include #include "dix.h" #ifndef MIN diff --git a/nx-X11/include/extensions/xtrapdi.h b/nx-X11/include/extensions/xtrapdi.h index 9db13bb20..34696113d 100644 --- a/nx-X11/include/extensions/xtrapdi.h +++ b/nx-X11/include/extensions/xtrapdi.h @@ -48,14 +48,14 @@ SOFTWARE. #ifndef IN_MODULE #include #endif -#include -#include +#include +#include #ifdef SMT #define NEED_EVENTS #define NEED_REPLIES #endif -#include -#include +#include +#include #define XTrapExtName "DEC-XTRAP" /* Current Release, Version, and Revision of the XTrap Extension */ #define XETrapRelease 3L diff --git a/nx-X11/include/extensions/xtrapemacros.h b/nx-X11/include/extensions/xtrapemacros.h index f59ea3391..f5dc2be31 100644 --- a/nx-X11/include/extensions/xtrapemacros.h +++ b/nx-X11/include/extensions/xtrapemacros.h @@ -43,7 +43,7 @@ SOFTWARE. * specified; however, use of Trap Context convenience * routines is strongly encouraged (XETrapContext.c) */ -#include +#include #include /* msleep macro to replace msleep() for portability reasons */ diff --git a/nx-X11/include/extensions/xtraplib.h b/nx-X11/include/extensions/xtraplib.h index f3f273aab..b733dac7f 100644 --- a/nx-X11/include/extensions/xtraplib.h +++ b/nx-X11/include/extensions/xtraplib.h @@ -47,10 +47,10 @@ SOFTWARE. #define NEED_EVENTS #define NEED_REPLIES #endif -#include -#include -#include -#include +#include +#include +#include +#include typedef struct /* Callback structure */ { diff --git a/nx-X11/include/keysym.h b/nx-X11/include/keysym.h index 785fed32e..cd518a792 100644 --- a/nx-X11/include/keysym.h +++ b/nx-X11/include/keysym.h @@ -71,5 +71,5 @@ SOFTWARE. #define XK_CURRENCY #define XK_MATHEMATICAL -#include +#include diff --git a/nx-X11/lib/X11/ClDisplay.c b/nx-X11/lib/X11/ClDisplay.c index b7a58751e..dfbc2f518 100644 --- a/nx-X11/lib/X11/ClDisplay.c +++ b/nx-X11/lib/X11/ClDisplay.c @@ -32,7 +32,7 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "Xlib.h" #include "Xlibint.h" #include "Xintconn.h" diff --git a/nx-X11/lib/X11/ConnDis.c b/nx-X11/lib/X11/ConnDis.c index 30146a9f1..177ff2c59 100644 --- a/nx-X11/lib/X11/ConnDis.c +++ b/nx-X11/lib/X11/ConnDis.c @@ -54,9 +54,9 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include +#include +#include +#include #include #include #include @@ -68,7 +68,7 @@ in this Software without prior written authorization from The Open Group. #include #endif #else -#include +#include #endif #ifndef X_CONNECTION_RETRIES /* number retries on ECONNREFUSED */ diff --git a/nx-X11/lib/X11/ErrDes.c b/nx-X11/lib/X11/ErrDes.c index 16183e85e..64373ffd0 100644 --- a/nx-X11/lib/X11/ErrDes.c +++ b/nx-X11/lib/X11/ErrDes.c @@ -55,7 +55,7 @@ SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include "Xresource.h" #include diff --git a/nx-X11/lib/X11/FSWrap.c b/nx-X11/lib/X11/FSWrap.c index d40f3b035..77dd3b59c 100644 --- a/nx-X11/lib/X11/FSWrap.c +++ b/nx-X11/lib/X11/FSWrap.c @@ -64,7 +64,7 @@ from The Open Group. #include "Xlibint.h" #include "Xlcint.h" #include -#include +#include #define XMAXLIST 256 diff --git a/nx-X11/lib/X11/FetchName.c b/nx-X11/lib/X11/FetchName.c index 3d41472f3..216c7453d 100644 --- a/nx-X11/lib/X11/FetchName.c +++ b/nx-X11/lib/X11/FetchName.c @@ -28,9 +28,9 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include +#include +#include +#include #include diff --git a/nx-X11/lib/X11/Font.c b/nx-X11/lib/X11/Font.c index 92a6a8f4a..8c8d1e443 100644 --- a/nx-X11/lib/X11/Font.c +++ b/nx-X11/lib/X11/Font.c @@ -47,7 +47,7 @@ authorization from the X Consortium and the XFree86 Project. #include #include -#include +#include #endif #include "Xlcint.h" diff --git a/nx-X11/lib/X11/GetDflt.c b/nx-X11/lib/X11/GetDflt.c index 8a8563379..a881f1c28 100644 --- a/nx-X11/lib/X11/GetDflt.c +++ b/nx-X11/lib/X11/GetDflt.c @@ -52,8 +52,8 @@ SOFTWARE. #include #endif #include "Xlibint.h" -#include -#include +#include +#include #ifndef X_NOT_POSIX #ifdef _POSIX_SOURCE @@ -80,12 +80,12 @@ SOFTWARE. #endif #ifdef XTHREADS -#include +#include #endif #ifndef WIN32 #define X_INCLUDE_PWD_H #define XOS_USE_XLIB_LOCKING -#include +#include #endif #include #include diff --git a/nx-X11/lib/X11/GetHints.c b/nx-X11/lib/X11/GetHints.c index 4faccb624..2c4d49d61 100644 --- a/nx-X11/lib/X11/GetHints.c +++ b/nx-X11/lib/X11/GetHints.c @@ -51,11 +51,11 @@ SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include +#include +#include +#include #include "Xatomtype.h" -#include +#include #include Status XGetSizeHints (dpy, w, hints, property) diff --git a/nx-X11/lib/X11/GetImage.c b/nx-X11/lib/X11/GetImage.c index ffe9d226f..634910d79 100644 --- a/nx-X11/lib/X11/GetImage.c +++ b/nx-X11/lib/X11/GetImage.c @@ -31,7 +31,7 @@ in this Software without prior written authorization from The Open Group. #include #endif #include "Xlibint.h" -#include /* for XDestroyImage */ +#include /* for XDestroyImage */ #include "ImUtil.h" #define ROUNDUP(nbytes, pad) (((((nbytes) - 1) + (pad)) / (pad)) * (pad)) diff --git a/nx-X11/lib/X11/GetNrmHint.c b/nx-X11/lib/X11/GetNrmHint.c index 9dcb7c403..c770df43d 100644 --- a/nx-X11/lib/X11/GetNrmHint.c +++ b/nx-X11/lib/X11/GetNrmHint.c @@ -55,10 +55,10 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include "Xatomtype.h" -#include +#include #include Status XGetWMSizeHints (dpy, w, hints, supplied, property) diff --git a/nx-X11/lib/X11/GetRGBCMap.c b/nx-X11/lib/X11/GetRGBCMap.c index 6657c539a..4df3ccced 100644 --- a/nx-X11/lib/X11/GetRGBCMap.c +++ b/nx-X11/lib/X11/GetRGBCMap.c @@ -31,10 +31,10 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include "Xatomtype.h" -#include +#include Status XGetRGBColormaps (dpy, w, stdcmap, count, property) Display *dpy; diff --git a/nx-X11/lib/X11/GetStCmap.c b/nx-X11/lib/X11/GetStCmap.c index 5c8c37e78..ae085aa87 100644 --- a/nx-X11/lib/X11/GetStCmap.c +++ b/nx-X11/lib/X11/GetStCmap.c @@ -50,10 +50,10 @@ SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include "Xatomtype.h" -#include +#include /* * WARNING diff --git a/nx-X11/lib/X11/GetTxtProp.c b/nx-X11/lib/X11/GetTxtProp.c index 0d4474253..dbff8abc8 100644 --- a/nx-X11/lib/X11/GetTxtProp.c +++ b/nx-X11/lib/X11/GetTxtProp.c @@ -52,10 +52,10 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include +#include +#include +#include +#include #include Status XGetTextProperty (display, window, tp, property) diff --git a/nx-X11/lib/X11/GetWMCMapW.c b/nx-X11/lib/X11/GetWMCMapW.c index 6d5c73c85..496efd208 100644 --- a/nx-X11/lib/X11/GetWMCMapW.c +++ b/nx-X11/lib/X11/GetWMCMapW.c @@ -51,7 +51,7 @@ SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include Status XGetWMColormapWindows (dpy, w, colormapWindows, countReturn) diff --git a/nx-X11/lib/X11/GetWMProto.c b/nx-X11/lib/X11/GetWMProto.c index 9b244ce6a..8584a4214 100644 --- a/nx-X11/lib/X11/GetWMProto.c +++ b/nx-X11/lib/X11/GetWMProto.c @@ -51,7 +51,7 @@ SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include Status XGetWMProtocols (dpy, w, protocols, countReturn) diff --git a/nx-X11/lib/X11/HVC.c b/nx-X11/lib/X11/HVC.c index 79241fb7a..84fac58b9 100644 --- a/nx-X11/lib/X11/HVC.c +++ b/nx-X11/lib/X11/HVC.c @@ -55,7 +55,7 @@ #endif #include "Xlibint.h" #include "Xcmsint.h" -#include +#include #include #include "Cv.h" diff --git a/nx-X11/lib/X11/Iconify.c b/nx-X11/lib/X11/Iconify.c index 62e57b84e..e68508666 100644 --- a/nx-X11/lib/X11/Iconify.c +++ b/nx-X11/lib/X11/Iconify.c @@ -54,10 +54,10 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include +#include +#include +#include +#include #include /* diff --git a/nx-X11/lib/X11/ImUtil.c b/nx-X11/lib/X11/ImUtil.c index 85f4183f4..2be839928 100644 --- a/nx-X11/lib/X11/ImUtil.c +++ b/nx-X11/lib/X11/ImUtil.c @@ -29,8 +29,8 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include #include "ImUtil.h" diff --git a/nx-X11/lib/X11/Imakefile b/nx-X11/lib/X11/Imakefile index 212216f46..81a1cfd3d 100644 --- a/nx-X11/lib/X11/Imakefile +++ b/nx-X11/lib/X11/Imakefile @@ -85,7 +85,7 @@ NX_XCOMPEXTCONFIGTARGET = $(NX_XCOMPEXTLIBDIR)/config.status #define LibName NX_X11 #define SoRev SOXLIBREV #define HugeLibrary YES -#define IncSubdir X11 +#define IncSubdir nx-X11 #if BuildLoadableXlibI18n SUBDIRS = xlibi18n diff --git a/nx-X11/lib/X11/InitExt.c b/nx-X11/lib/X11/InitExt.c index 67c865787..5aab682c7 100644 --- a/nx-X11/lib/X11/InitExt.c +++ b/nx-X11/lib/X11/InitExt.c @@ -31,8 +31,8 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include /* diff --git a/nx-X11/lib/X11/KeyBind.c b/nx-X11/lib/X11/KeyBind.c index fab9eeacd..d99cfdf2f 100644 --- a/nx-X11/lib/X11/KeyBind.c +++ b/nx-X11/lib/X11/KeyBind.c @@ -32,8 +32,8 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #define XK_MISCELLANY #define XK_LATIN1 #define XK_LATIN2 @@ -47,7 +47,7 @@ in this Software without prior written authorization from The Open Group. #define XK_CAUCASUS #define XK_VIETNAMESE #define XK_XKB_KEYS -#include +#include #include #ifdef USE_OWN_COMPOSE diff --git a/nx-X11/lib/X11/KeysymStr.c b/nx-X11/lib/X11/KeysymStr.c index 59aa3f32c..b43e2735a 100644 --- a/nx-X11/lib/X11/KeysymStr.c +++ b/nx-X11/lib/X11/KeysymStr.c @@ -31,8 +31,8 @@ in this Software without prior written authorization from The Open Group. #include #endif #include "Xlibint.h" -#include -#include +#include +#include #include /* sprintf */ diff --git a/nx-X11/lib/X11/LRGB.c b/nx-X11/lib/X11/LRGB.c index e4bc0b500..392c59579 100644 --- a/nx-X11/lib/X11/LRGB.c +++ b/nx-X11/lib/X11/LRGB.c @@ -41,8 +41,8 @@ #include #endif #include -#include -#include +#include +#include #include "Xlibint.h" #include "Xcmsint.h" #include "Cv.h" diff --git a/nx-X11/lib/X11/Lab.c b/nx-X11/lib/X11/Lab.c index 596c137f8..19b3e3a1d 100644 --- a/nx-X11/lib/X11/Lab.c +++ b/nx-X11/lib/X11/Lab.c @@ -42,7 +42,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include /* sscanf */ #include "Xlibint.h" #include "Xcmsint.h" diff --git a/nx-X11/lib/X11/Luv.c b/nx-X11/lib/X11/Luv.c index ec94c9e56..206ae1017 100644 --- a/nx-X11/lib/X11/Luv.c +++ b/nx-X11/lib/X11/Luv.c @@ -43,7 +43,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "Xlibint.h" #include "Xcmsint.h" #include "Cv.h" diff --git a/nx-X11/lib/X11/OpenDis.c b/nx-X11/lib/X11/OpenDis.c index e9d019723..67f7ccbd1 100644 --- a/nx-X11/lib/X11/OpenDis.c +++ b/nx-X11/lib/X11/OpenDis.c @@ -50,10 +50,10 @@ in this Software without prior written authorization from The Open Group. #include #endif #include "Xlibint.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include "Xintconn.h" diff --git a/nx-X11/lib/X11/ParseCmd.c b/nx-X11/lib/X11/ParseCmd.c index ddcbf7846..fe20f6eff 100644 --- a/nx-X11/lib/X11/ParseCmd.c +++ b/nx-X11/lib/X11/ParseCmd.c @@ -61,7 +61,7 @@ SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include diff --git a/nx-X11/lib/X11/PolyReg.c b/nx-X11/lib/X11/PolyReg.c index 4b17ec5c5..6e1f7ead8 100644 --- a/nx-X11/lib/X11/PolyReg.c +++ b/nx-X11/lib/X11/PolyReg.c @@ -55,7 +55,7 @@ SOFTWARE. #endif #include "Xlibint.h" #include "Xutil.h" -#include +#include #include "poly.h" /* diff --git a/nx-X11/lib/X11/Quarks.c b/nx-X11/lib/X11/Quarks.c index d47bce314..a49562aac 100644 --- a/nx-X11/lib/X11/Quarks.c +++ b/nx-X11/lib/X11/Quarks.c @@ -55,7 +55,7 @@ from The Open Group. #include #endif #include "Xlibint.h" -#include +#include #include "Xresinternal.h" /* Not cost effective, at least for vanilla MIT clients */ diff --git a/nx-X11/lib/X11/RdBitF.c b/nx-X11/lib/X11/RdBitF.c index 198e0e4a5..97afcc493 100644 --- a/nx-X11/lib/X11/RdBitF.c +++ b/nx-X11/lib/X11/RdBitF.c @@ -47,7 +47,7 @@ from The Open Group. #include #endif #include "Xlibint.h" -#include +#include #include "Xutil.h" #include #include diff --git a/nx-X11/lib/X11/Region.c b/nx-X11/lib/X11/Region.c index cdd223b25..bef46def0 100644 --- a/nx-X11/lib/X11/Region.c +++ b/nx-X11/lib/X11/Region.c @@ -77,7 +77,7 @@ SOFTWARE. #endif #include "Xlibint.h" #include "Xutil.h" -#include +#include #include "poly.h" #ifdef DEBUG diff --git a/nx-X11/lib/X11/ScrResStr.c b/nx-X11/lib/X11/ScrResStr.c index 89f771784..7feb3b388 100644 --- a/nx-X11/lib/X11/ScrResStr.c +++ b/nx-X11/lib/X11/ScrResStr.c @@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group. #include #endif #include "Xlibint.h" -#include +#include char *XScreenResourceString(screen) Screen *screen; diff --git a/nx-X11/lib/X11/SetHints.c b/nx-X11/lib/X11/SetHints.c index 5ee34435d..27b1bedbc 100644 --- a/nx-X11/lib/X11/SetHints.c +++ b/nx-X11/lib/X11/SetHints.c @@ -51,11 +51,11 @@ SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include "Xatomtype.h" -#include -#include +#include +#include #define safestrlen(s) ((s) ? strlen(s) : 0) diff --git a/nx-X11/lib/X11/SetLocale.c b/nx-X11/lib/X11/SetLocale.c index bb4f850e3..875718dca 100644 --- a/nx-X11/lib/X11/SetLocale.c +++ b/nx-X11/lib/X11/SetLocale.c @@ -63,8 +63,8 @@ from The Open Group. #endif #include "Xlibint.h" #include "Xlcint.h" -#include -#include +#include +#include #include "XlcPubI.h" #define MAXLOCALE 64 /* buffer size of locale name */ diff --git a/nx-X11/lib/X11/SetNrmHint.c b/nx-X11/lib/X11/SetNrmHint.c index 64b0ef7f3..e8e6daf31 100644 --- a/nx-X11/lib/X11/SetNrmHint.c +++ b/nx-X11/lib/X11/SetNrmHint.c @@ -54,11 +54,11 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include "Xatomtype.h" -#include -#include +#include +#include void XSetWMSizeHints (dpy, w, hints, prop) Display *dpy; diff --git a/nx-X11/lib/X11/SetRGBCMap.c b/nx-X11/lib/X11/SetRGBCMap.c index 4be840b75..03aa9392c 100644 --- a/nx-X11/lib/X11/SetRGBCMap.c +++ b/nx-X11/lib/X11/SetRGBCMap.c @@ -31,10 +31,10 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include "Xatomtype.h" -#include +#include void XSetRGBColormaps (dpy, w, cmaps, count, property) Display *dpy; diff --git a/nx-X11/lib/X11/SetStCmap.c b/nx-X11/lib/X11/SetStCmap.c index b5a93e36e..521b9480d 100644 --- a/nx-X11/lib/X11/SetStCmap.c +++ b/nx-X11/lib/X11/SetStCmap.c @@ -50,10 +50,10 @@ SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include "Xatomtype.h" -#include +#include /* * WARNING diff --git a/nx-X11/lib/X11/SetTxtProp.c b/nx-X11/lib/X11/SetTxtProp.c index a82d9b3e3..ae8b81e29 100644 --- a/nx-X11/lib/X11/SetTxtProp.c +++ b/nx-X11/lib/X11/SetTxtProp.c @@ -52,10 +52,10 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include +#include +#include +#include +#include #include void XSetTextProperty (dpy, w, tp, property) diff --git a/nx-X11/lib/X11/SetWMCMapW.c b/nx-X11/lib/X11/SetWMCMapW.c index dd88061da..6774d7326 100644 --- a/nx-X11/lib/X11/SetWMCMapW.c +++ b/nx-X11/lib/X11/SetWMCMapW.c @@ -51,7 +51,7 @@ SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include /* * XSetWMProtocols sets the property diff --git a/nx-X11/lib/X11/SetWMProto.c b/nx-X11/lib/X11/SetWMProto.c index 8640e5060..bc7dcf63c 100644 --- a/nx-X11/lib/X11/SetWMProto.c +++ b/nx-X11/lib/X11/SetWMProto.c @@ -51,7 +51,7 @@ SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include /* * XSetWMProtocols sets the property diff --git a/nx-X11/lib/X11/StBytes.c b/nx-X11/lib/X11/StBytes.c index b23902581..676652678 100644 --- a/nx-X11/lib/X11/StBytes.c +++ b/nx-X11/lib/X11/StBytes.c @@ -29,8 +29,8 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include /* insulate predefined atom numbers from cut routines */ static Atom n_to_atom[8] = { diff --git a/nx-X11/lib/X11/StName.c b/nx-X11/lib/X11/StName.c index ba01ffb0c..d3053346c 100644 --- a/nx-X11/lib/X11/StName.c +++ b/nx-X11/lib/X11/StName.c @@ -29,8 +29,8 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include int XStoreName ( diff --git a/nx-X11/lib/X11/StrKeysym.c b/nx-X11/lib/X11/StrKeysym.c index 74ccecbcd..fc1e7a34d 100644 --- a/nx-X11/lib/X11/StrKeysym.c +++ b/nx-X11/lib/X11/StrKeysym.c @@ -30,8 +30,8 @@ in this Software without prior written authorization from The Open Group. #include #endif #include "Xlibint.h" -#include -#include +#include +#include #include "Xresinternal.h" #define NEEDKTABLE diff --git a/nx-X11/lib/X11/StrToText.c b/nx-X11/lib/X11/StrToText.c index ba894e16f..5fd9c6ec6 100644 --- a/nx-X11/lib/X11/StrToText.c +++ b/nx-X11/lib/X11/StrToText.c @@ -28,9 +28,9 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include +#include +#include +#include /* * XStringListToTextProperty - fill in TextProperty structure with diff --git a/nx-X11/lib/X11/TextToStr.c b/nx-X11/lib/X11/TextToStr.c index 0bea8096d..f4c00adcf 100644 --- a/nx-X11/lib/X11/TextToStr.c +++ b/nx-X11/lib/X11/TextToStr.c @@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include +#include +#include +#include /* diff --git a/nx-X11/lib/X11/WMProps.c b/nx-X11/lib/X11/WMProps.c index 62c6a8d12..7a390a9d7 100644 --- a/nx-X11/lib/X11/WMProps.c +++ b/nx-X11/lib/X11/WMProps.c @@ -55,11 +55,11 @@ SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* diff --git a/nx-X11/lib/X11/Withdraw.c b/nx-X11/lib/X11/Withdraw.c index 1b771c286..2037b8e46 100644 --- a/nx-X11/lib/X11/Withdraw.c +++ b/nx-X11/lib/X11/Withdraw.c @@ -54,10 +54,10 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include +#include +#include +#include +#include #include /* diff --git a/nx-X11/lib/X11/WrBitF.c b/nx-X11/lib/X11/WrBitF.c index d8c9f18fa..d48295f0b 100644 --- a/nx-X11/lib/X11/WrBitF.c +++ b/nx-X11/lib/X11/WrBitF.c @@ -32,7 +32,7 @@ from The Open Group. #include #endif #include "Xlibint.h" -#include +#include #include "Xutil.h" #include diff --git a/nx-X11/lib/X11/XDefaultOMIF.c b/nx-X11/lib/X11/XDefaultOMIF.c index 13f0d9cff..b4e63091b 100644 --- a/nx-X11/lib/X11/XDefaultOMIF.c +++ b/nx-X11/lib/X11/XDefaultOMIF.c @@ -49,8 +49,8 @@ Sun Microsystems, Inc. or its licensors is granted. #include "Xlibint.h" #include "Xlcint.h" #include "XlcPublic.h" -#include -#include +#include +#include #include #define MAXFONTS 100 diff --git a/nx-X11/lib/X11/XKB.c b/nx-X11/lib/X11/XKB.c index ecc5ddf0a..413a51eb6 100644 --- a/nx-X11/lib/X11/XKB.c +++ b/nx-X11/lib/X11/XKB.c @@ -33,7 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_REPLIES #define NEED_EVENTS #include "Xlibint.h" -#include +#include #include "XKBlibint.h" XkbInternAtomFunc _XkbInternAtomFunc= XInternAtom; diff --git a/nx-X11/lib/X11/XKBAlloc.c b/nx-X11/lib/X11/XKBAlloc.c index 9430ac0ed..131985444 100644 --- a/nx-X11/lib/X11/XKBAlloc.c +++ b/nx-X11/lib/X11/XKBAlloc.c @@ -39,21 +39,21 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_EVENTS #include "Xlibint.h" #include "XKBlibint.h" -#include -#include +#include +#include #include "XKBlibint.h" #else #include -#include +#include #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "misc.h" #include "inputstr.h" -#include -#include +#include +#include #endif /* XKB_IN_SERVER */ diff --git a/nx-X11/lib/X11/XKBBell.c b/nx-X11/lib/X11/XKBBell.c index 6ea30855e..51869097e 100644 --- a/nx-X11/lib/X11/XKBBell.c +++ b/nx-X11/lib/X11/XKBBell.c @@ -33,7 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_REPLIES #define NEED_EVENTS #include "Xlibint.h" -#include +#include #include "XKBlibint.h" diff --git a/nx-X11/lib/X11/XKBBind.c b/nx-X11/lib/X11/XKBBind.c index e190d0052..6c1864d41 100644 --- a/nx-X11/lib/X11/XKBBind.c +++ b/nx-X11/lib/X11/XKBBind.c @@ -35,13 +35,13 @@ from The Open Group. #include #endif #include "XKBlib.h" -#include -#include -#include +#include +#include +#include #include #include -#include +#include #include "XKBlibint.h" #ifdef USE_OWN_COMPOSE diff --git a/nx-X11/lib/X11/XKBCompat.c b/nx-X11/lib/X11/XKBCompat.c index 5886e4d26..b16e6b083 100644 --- a/nx-X11/lib/X11/XKBCompat.c +++ b/nx-X11/lib/X11/XKBCompat.c @@ -34,7 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_EVENTS #define NEED_MAP_READERS #include "Xlibint.h" -#include +#include #include "XKBlibint.h" Status diff --git a/nx-X11/lib/X11/XKBCtrls.c b/nx-X11/lib/X11/XKBCtrls.c index 0ea131aa0..f3a09a124 100644 --- a/nx-X11/lib/X11/XKBCtrls.c +++ b/nx-X11/lib/X11/XKBCtrls.c @@ -33,7 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_REPLIES #define NEED_EVENTS #include "Xlibint.h" -#include +#include #include "XKBlibint.h" diff --git a/nx-X11/lib/X11/XKBCvt.c b/nx-X11/lib/X11/XKBCvt.c index 1bdf81cd4..2d58ca990 100644 --- a/nx-X11/lib/X11/XKBCvt.c +++ b/nx-X11/lib/X11/XKBCvt.c @@ -35,23 +35,23 @@ from The Open Group. #include #include -#include -#include +#include +#include #define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" #include "XlcPubI.h" #include "Ximint.h" -#include -#include +#include +#include #define XK_LATIN1 #define XK_PUBLISHING -#include -#include +#include +#include #include "XKBlibint.h" -#include +#include #include -#include +#include #ifdef __sgi_not_xconsortium #define XKB_EXTEND_LOOKUP_STRING diff --git a/nx-X11/lib/X11/XKBExtDev.c b/nx-X11/lib/X11/XKBExtDev.c index 34558e476..0510b7f55 100644 --- a/nx-X11/lib/X11/XKBExtDev.c +++ b/nx-X11/lib/X11/XKBExtDev.c @@ -34,9 +34,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_EVENTS #define NEED_MAP_READERS #include "Xlibint.h" -#include +#include #include "XKBlibint.h" -#include +#include /***====================================================================***/ diff --git a/nx-X11/lib/X11/XKBGAlloc.c b/nx-X11/lib/X11/XKBGAlloc.c index fddb770b6..eb74cbfd0 100644 --- a/nx-X11/lib/X11/XKBGAlloc.c +++ b/nx-X11/lib/X11/XKBGAlloc.c @@ -40,18 +40,18 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "Xlibint.h" #include "XKBlibint.h" -#include -#include +#include +#include #else #include -#include -#include +#include +#include #include "misc.h" #include "inputstr.h" -#include -#include +#include +#include #endif /* XKB_IN_SERVER */ diff --git a/nx-X11/lib/X11/XKBGeom.c b/nx-X11/lib/X11/XKBGeom.c index 061175489..d225342a7 100644 --- a/nx-X11/lib/X11/XKBGeom.c +++ b/nx-X11/lib/X11/XKBGeom.c @@ -37,8 +37,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_REPLIES #define NEED_MAP_READERS #include "Xlibint.h" -#include -#include +#include +#include #include "XKBlibint.h" #ifndef MINSHORT diff --git a/nx-X11/lib/X11/XKBGetByName.c b/nx-X11/lib/X11/XKBGetByName.c index 2c6ff0849..87f405e50 100644 --- a/nx-X11/lib/X11/XKBGetByName.c +++ b/nx-X11/lib/X11/XKBGetByName.c @@ -33,7 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include "XKBlibint.h" /***====================================================================***/ diff --git a/nx-X11/lib/X11/XKBGetMap.c b/nx-X11/lib/X11/XKBGetMap.c index 2b9fb97f4..5f37f9571 100644 --- a/nx-X11/lib/X11/XKBGetMap.c +++ b/nx-X11/lib/X11/XKBGetMap.c @@ -34,7 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include "XKBlibint.h" static Status diff --git a/nx-X11/lib/X11/XKBList.c b/nx-X11/lib/X11/XKBList.c index 2f4a53490..ef265fdde 100644 --- a/nx-X11/lib/X11/XKBList.c +++ b/nx-X11/lib/X11/XKBList.c @@ -33,7 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include "XKBlibint.h" /***====================================================================***/ diff --git a/nx-X11/lib/X11/XKBMAlloc.c b/nx-X11/lib/X11/XKBMAlloc.c index d57d9a58d..31255091f 100644 --- a/nx-X11/lib/X11/XKBMAlloc.c +++ b/nx-X11/lib/X11/XKBMAlloc.c @@ -38,22 +38,22 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_REPLIES #define NEED_EVENTS #include "Xlibint.h" -#include -#include +#include +#include #include "XKBlibint.h" #else #include -#include +#include #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "misc.h" #include "inputstr.h" -#include +#include #define XKBSRV_NEED_FILE_FUNCS -#include +#include #endif /* XKB_IN_SERVER */ diff --git a/nx-X11/lib/X11/XKBMisc.c b/nx-X11/lib/X11/XKBMisc.c index 09f361c19..04ac0c7ea 100644 --- a/nx-X11/lib/X11/XKBMisc.c +++ b/nx-X11/lib/X11/XKBMisc.c @@ -38,22 +38,22 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_REPLIES #define NEED_EVENTS #include "Xlibint.h" -#include -#include +#include +#include #include "XKBlibint.h" #else #include -#include +#include #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "misc.h" #include "inputstr.h" -#include +#include #define XKBSRV_NEED_FILE_FUNCS -#include +#include #endif /* XKB_IN_SERVER */ diff --git a/nx-X11/lib/X11/XKBNames.c b/nx-X11/lib/X11/XKBNames.c index 8483187c3..0bcd42b3d 100644 --- a/nx-X11/lib/X11/XKBNames.c +++ b/nx-X11/lib/X11/XKBNames.c @@ -33,7 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include "XKBlibint.h" diff --git a/nx-X11/lib/X11/XKBRdBuf.c b/nx-X11/lib/X11/XKBRdBuf.c index d0b7045d6..109618dd2 100644 --- a/nx-X11/lib/X11/XKBRdBuf.c +++ b/nx-X11/lib/X11/XKBRdBuf.c @@ -34,7 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_EVENTS #include "Xlibint.h" #include "XKBlibint.h" -#include +#include /***====================================================================***/ diff --git a/nx-X11/lib/X11/XKBSetGeom.c b/nx-X11/lib/X11/XKBSetGeom.c index e27297c11..f13be8097 100644 --- a/nx-X11/lib/X11/XKBSetGeom.c +++ b/nx-X11/lib/X11/XKBSetGeom.c @@ -38,8 +38,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_REPLIES #include "Xlibint.h" #include "XKBlibint.h" -#include -#include +#include +#include #ifndef MINSHORT #define MINSHORT -32768 diff --git a/nx-X11/lib/X11/XKBSetMap.c b/nx-X11/lib/X11/XKBSetMap.c index 4a3b15c70..784a241c2 100644 --- a/nx-X11/lib/X11/XKBSetMap.c +++ b/nx-X11/lib/X11/XKBSetMap.c @@ -33,7 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_REPLIES #define NEED_EVENTS #include "Xlibint.h" -#include +#include #include "XKBlibint.h" static int diff --git a/nx-X11/lib/X11/XKBUse.c b/nx-X11/lib/X11/XKBUse.c index ad18bb6fc..95fba49ac 100644 --- a/nx-X11/lib/X11/XKBUse.c +++ b/nx-X11/lib/X11/XKBUse.c @@ -34,7 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define NEED_REPLIES #define NEED_EVENTS #include "Xlibint.h" -#include +#include #include "XKBlibint.h" static Bool _XkbIgnoreExtension = False; diff --git a/nx-X11/lib/X11/XKBleds.c b/nx-X11/lib/X11/XKBleds.c index 89ab2e9ec..d026d84be 100644 --- a/nx-X11/lib/X11/XKBleds.c +++ b/nx-X11/lib/X11/XKBleds.c @@ -33,7 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include "XKBlibint.h" Status diff --git a/nx-X11/lib/X11/XKBlib.h b/nx-X11/lib/X11/XKBlib.h index 6a5dc8a7c..a1ad7ccea 100644 --- a/nx-X11/lib/X11/XKBlib.h +++ b/nx-X11/lib/X11/XKBlib.h @@ -29,8 +29,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef _XKBLIB_H_ #define _XKBLIB_H_ -#include -#include +#include +#include typedef struct _XkbAnyEvent { int type; /* XkbAnyEvent */ diff --git a/nx-X11/lib/X11/XKBlibint.h b/nx-X11/lib/X11/XKBlibint.h index 0244e2ef3..9c6352769 100644 --- a/nx-X11/lib/X11/XKBlibint.h +++ b/nx-X11/lib/X11/XKBlibint.h @@ -29,8 +29,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef _XKBLIBINT_H_ #define _XKBLIBINT_H_ -#include -#include +#include +#include #define XkbMapPending (1<<0) #define XkbXlibNewKeyboard (1<<1) diff --git a/nx-X11/lib/X11/XYZ.c b/nx-X11/lib/X11/XYZ.c index f5f17f356..5408c4fbc 100644 --- a/nx-X11/lib/X11/XYZ.c +++ b/nx-X11/lib/X11/XYZ.c @@ -38,7 +38,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "Xlibint.h" #include "Xcmsint.h" #include "Cv.h" diff --git a/nx-X11/lib/X11/Xcms.h b/nx-X11/lib/X11/Xcms.h index 779bc52ff..8ce81556d 100644 --- a/nx-X11/lib/X11/Xcms.h +++ b/nx-X11/lib/X11/Xcms.h @@ -31,7 +31,7 @@ #ifndef _XCMS_H_ #define _XCMS_H_ -#include +#include /* * XCMS Status Values diff --git a/nx-X11/lib/X11/Xcmsint.h b/nx-X11/lib/X11/Xcmsint.h index 1bf02ba2f..6bb44bbcf 100644 --- a/nx-X11/lib/X11/Xcmsint.h +++ b/nx-X11/lib/X11/Xcmsint.h @@ -34,7 +34,7 @@ #ifndef _XCMSINT_H_ #define _XCMSINT_H_ -#include +#include /* * DEFINES diff --git a/nx-X11/lib/X11/XimThai.h b/nx-X11/lib/X11/XimThai.h index 5b2666ebf..8d08eca6b 100644 --- a/nx-X11/lib/X11/XimThai.h +++ b/nx-X11/lib/X11/XimThai.h @@ -64,7 +64,7 @@ SOFTWARE. #ifndef _XIMTHAI_H_ #define _XIMTHAI_H_ -#include +#include /* Classification of characters in TIS620 according to WTT */ diff --git a/nx-X11/lib/X11/Ximint.h b/nx-X11/lib/X11/Ximint.h index e9bdda247..afd821c68 100644 --- a/nx-X11/lib/X11/Ximint.h +++ b/nx-X11/lib/X11/Ximint.h @@ -36,7 +36,7 @@ PERFORMANCE OF THIS SOFTWARE. #define _XIMINT_H #include -#include +#include #define Public /**/ #define Private static diff --git a/nx-X11/lib/X11/Xintatom.h b/nx-X11/lib/X11/Xintatom.h index f1e13568b..756d3445b 100644 --- a/nx-X11/lib/X11/Xintatom.h +++ b/nx-X11/lib/X11/Xintatom.h @@ -3,7 +3,7 @@ #ifndef _XINTATOM_H_ #define _XINTATOM_H_ 1 -#include +#include /* IntAtom.c */ diff --git a/nx-X11/lib/X11/Xintconn.h b/nx-X11/lib/X11/Xintconn.h index edea98302..ea272833a 100644 --- a/nx-X11/lib/X11/Xintconn.h +++ b/nx-X11/lib/X11/Xintconn.h @@ -3,7 +3,7 @@ #ifndef _XINTCONN_H_ #define _XINTCONN_H_ 1 -#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/lib/X11/Xlcint.h b/nx-X11/lib/X11/Xlcint.h index fcc3a65f2..5a52cd36c 100644 --- a/nx-X11/lib/X11/Xlcint.h +++ b/nx-X11/lib/X11/Xlcint.h @@ -74,8 +74,8 @@ from The Open Group. #ifndef _XP_PRINT_SERVER_ -#include -#include +#include +#include #include typedef Bool (*XFilterEventProc)( diff --git a/nx-X11/lib/X11/Xlib.h b/nx-X11/lib/X11/Xlib.h index 8ce7fb577..d4cecc7b5 100644 --- a/nx-X11/lib/X11/Xlib.h +++ b/nx-X11/lib/X11/Xlib.h @@ -57,11 +57,11 @@ in this Software without prior written authorization from The Open Group. #include #endif -#include +#include /* applications should not depend on these two headers being included! */ -#include -#include +#include +#include #ifndef X_WCHAR #ifdef X_NOT_STDC_ENV diff --git a/nx-X11/lib/X11/XlibAsync.c b/nx-X11/lib/X11/XlibAsync.c index 81403ebc9..832371782 100644 --- a/nx-X11/lib/X11/XlibAsync.c +++ b/nx-X11/lib/X11/XlibAsync.c @@ -48,8 +48,8 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include /*ARGSUSED*/ Bool diff --git a/nx-X11/lib/X11/XlibInt.c b/nx-X11/lib/X11/XlibInt.c index 0514470dd..0aa890bbb 100644 --- a/nx-X11/lib/X11/XlibInt.c +++ b/nx-X11/lib/X11/XlibInt.c @@ -60,9 +60,9 @@ from The Open Group. #include #endif #include "Xlibint.h" -#include -#include -#include +#include +#include +#include #include #ifdef WIN32 #include diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index bcd42b52b..854b64b22 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -58,9 +58,9 @@ from The Open Group. * Warning, there be dragons here.... */ -#include -#include /* to declare xEvent */ -#include /* for configured options like XTHREADS */ +#include +#include /* to declare xEvent */ +#include /* for configured options like XTHREADS */ #ifdef NX_TRANS_SOCKET @@ -233,14 +233,14 @@ typedef struct _XSQEvent #define NEED_EVENTS #define NEED_REPLIES -#include +#include #ifdef __sgi #define _SGI_MP_SOURCE /* turn this on to get MP safe errno */ #endif #include #define _XBCOPYFUNC _Xbcopy -#include -#include +#include +#include /* Utek leaves kernel macros around in include files (bleah) */ #ifdef dirty @@ -250,7 +250,7 @@ typedef struct _XSQEvent #include #include -#include +#include _XFUNCPROTOBEGIN diff --git a/nx-X11/lib/X11/Xlocale.h b/nx-X11/lib/X11/Xlocale.h index 61d2f7a84..4370d969e 100644 --- a/nx-X11/lib/X11/Xlocale.h +++ b/nx-X11/lib/X11/Xlocale.h @@ -31,8 +31,8 @@ from The Open Group. #ifndef _XLOCALE_H_ #define _XLOCALE_H_ -#include -#include +#include +#include #ifndef X_LOCALE #include diff --git a/nx-X11/lib/X11/Xresource.h b/nx-X11/lib/X11/Xresource.h index ce1213748..e46a5f467 100644 --- a/nx-X11/lib/X11/Xresource.h +++ b/nx-X11/lib/X11/Xresource.h @@ -52,7 +52,7 @@ SOFTWARE. #define _XRESOURCE_H_ #ifndef _XP_PRINT_SERVER_ -#include +#include #endif /**************************************************************** diff --git a/nx-X11/lib/X11/Xrm.c b/nx-X11/lib/X11/Xrm.c index a932a5ce2..f27f9d2e8 100644 --- a/nx-X11/lib/X11/Xrm.c +++ b/nx-X11/lib/X11/Xrm.c @@ -57,13 +57,13 @@ from The Open Group. #include #include #include "Xlibint.h" -#include +#include #include "Xlcint.h" #ifdef XTHREADS #include "locking.h" #endif #include "XrmI.h" -#include +#include #include "Xresinternal.h" #include "Xresource.h" diff --git a/nx-X11/lib/X11/Xutil.h b/nx-X11/lib/X11/Xutil.h index 82dab7d56..8c877e697 100644 --- a/nx-X11/lib/X11/Xutil.h +++ b/nx-X11/lib/X11/Xutil.h @@ -52,7 +52,7 @@ SOFTWARE. #define _XUTIL_H_ /* You must include before including this file */ -#include +#include /* * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding diff --git a/nx-X11/lib/X11/cmsColNm.c b/nx-X11/lib/X11/cmsColNm.c index d8c24cdff..63f166efe 100644 --- a/nx-X11/lib/X11/cmsColNm.c +++ b/nx-X11/lib/X11/cmsColNm.c @@ -39,12 +39,12 @@ #endif #include "Xlibint.h" #include "Xcmsint.h" -#include +#include #include #include #include #define XK_LATIN1 -#include +#include #include "Cv.h" /* forwards/locals */ diff --git a/nx-X11/lib/X11/cmsProp.c b/nx-X11/lib/X11/cmsProp.c index 81ea58ce9..e9158479e 100644 --- a/nx-X11/lib/X11/cmsProp.c +++ b/nx-X11/lib/X11/cmsProp.c @@ -36,7 +36,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "Xlibint.h" #include "Xcmsint.h" #include "Cv.h" diff --git a/nx-X11/lib/X11/evtomask.c b/nx-X11/lib/X11/evtomask.c index fbbb998d3..c852c4608 100644 --- a/nx-X11/lib/X11/evtomask.c +++ b/nx-X11/lib/X11/evtomask.c @@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include /* * This array can be used given an event type to determine the mask bits diff --git a/nx-X11/lib/X11/globals.c b/nx-X11/lib/X11/globals.c index 11965cb5f..cf270dc22 100644 --- a/nx-X11/lib/X11/globals.c +++ b/nx-X11/lib/X11/globals.c @@ -38,7 +38,7 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include /* diff --git a/nx-X11/lib/X11/imDefFlt.c b/nx-X11/lib/X11/imDefFlt.c index ccf3ba348..b5b107221 100644 --- a/nx-X11/lib/X11/imDefFlt.c +++ b/nx-X11/lib/X11/imDefFlt.c @@ -31,7 +31,7 @@ PERFORMANCE OF THIS SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #define NEED_EVENTS #include "Xlibint.h" #include "Xutil.h" diff --git a/nx-X11/lib/X11/imDefIm.c b/nx-X11/lib/X11/imDefIm.c index 7581548e7..e963f3560 100644 --- a/nx-X11/lib/X11/imDefIm.c +++ b/nx-X11/lib/X11/imDefIm.c @@ -36,7 +36,7 @@ OF THIS SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" diff --git a/nx-X11/lib/X11/imDefLkup.c b/nx-X11/lib/X11/imDefLkup.c index aa1aaaf06..5bdcb77c3 100644 --- a/nx-X11/lib/X11/imDefLkup.c +++ b/nx-X11/lib/X11/imDefLkup.c @@ -31,7 +31,7 @@ PERFORMANCE OF THIS SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" diff --git a/nx-X11/lib/X11/imDispch.c b/nx-X11/lib/X11/imDispch.c index c0c4bc726..1e3287529 100644 --- a/nx-X11/lib/X11/imDispch.c +++ b/nx-X11/lib/X11/imDispch.c @@ -31,7 +31,7 @@ PERFORMANCE OF THIS SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "Xlibint.h" #include "Xutil.h" #include "Xlcint.h" diff --git a/nx-X11/lib/X11/imEvToWire.c b/nx-X11/lib/X11/imEvToWire.c index f407296df..211252a50 100644 --- a/nx-X11/lib/X11/imEvToWire.c +++ b/nx-X11/lib/X11/imEvToWire.c @@ -27,8 +27,8 @@ SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #undef NEED_EVENTS #include "Ximint.h" diff --git a/nx-X11/lib/X11/imExten.c b/nx-X11/lib/X11/imExten.c index 782d1c356..6cb663f66 100644 --- a/nx-X11/lib/X11/imExten.c +++ b/nx-X11/lib/X11/imExten.c @@ -31,7 +31,7 @@ PERFORMANCE OF THIS SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" diff --git a/nx-X11/lib/X11/imInt.c b/nx-X11/lib/X11/imInt.c index 5a047e4aa..9658eef58 100644 --- a/nx-X11/lib/X11/imInt.c +++ b/nx-X11/lib/X11/imInt.c @@ -31,9 +31,9 @@ PERFORMANCE OF THIS SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include +#include +#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imLcFlt.c b/nx-X11/lib/X11/imLcFlt.c index c3c64bf46..7ff642fae 100644 --- a/nx-X11/lib/X11/imLcFlt.c +++ b/nx-X11/lib/X11/imLcFlt.c @@ -35,7 +35,7 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif #include "Xlibint.h" -#include +#include #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imLcIc.c b/nx-X11/lib/X11/imLcIc.c index 760e24c5f..475bbbef8 100644 --- a/nx-X11/lib/X11/imLcIc.c +++ b/nx-X11/lib/X11/imLcIc.c @@ -32,8 +32,8 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#include -#include +#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imLcIm.c b/nx-X11/lib/X11/imLcIm.c index 675b48224..0a9027e6f 100644 --- a/nx-X11/lib/X11/imLcIm.c +++ b/nx-X11/lib/X11/imLcIm.c @@ -39,11 +39,11 @@ THIS SOFTWARE. #endif #include /* -#include +#include */ -#include -#include -#include +#include +#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "XlcPublic.h" diff --git a/nx-X11/lib/X11/imLcLkup.c b/nx-X11/lib/X11/imLcLkup.c index 59025a529..b1db9f8f7 100644 --- a/nx-X11/lib/X11/imLcLkup.c +++ b/nx-X11/lib/X11/imLcLkup.c @@ -35,11 +35,11 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imLcPrs.c b/nx-X11/lib/X11/imLcPrs.c index 9736e135c..616d45186 100644 --- a/nx-X11/lib/X11/imLcPrs.c +++ b/nx-X11/lib/X11/imLcPrs.c @@ -35,9 +35,9 @@ OR PERFORMANCE OF THIS SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include +#include +#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imLcSIc.c b/nx-X11/lib/X11/imLcSIc.c index a32211ce2..e36c52269 100644 --- a/nx-X11/lib/X11/imLcSIc.c +++ b/nx-X11/lib/X11/imLcSIc.c @@ -31,9 +31,9 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#include -#include -#include +#include +#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imRm.c b/nx-X11/lib/X11/imRm.c index 7dbc385cb..1da1b2967 100644 --- a/nx-X11/lib/X11/imRm.c +++ b/nx-X11/lib/X11/imRm.c @@ -36,7 +36,7 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imThaiFlt.c b/nx-X11/lib/X11/imThaiFlt.c index 18df0e1ff..41ab992b0 100644 --- a/nx-X11/lib/X11/imThaiFlt.c +++ b/nx-X11/lib/X11/imThaiFlt.c @@ -68,10 +68,10 @@ SOFTWARE. #include #endif #include -#include -#include -#include -#include +#include +#include +#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imThaiIc.c b/nx-X11/lib/X11/imThaiIc.c index 67d7cc268..97a72ac81 100644 --- a/nx-X11/lib/X11/imThaiIc.c +++ b/nx-X11/lib/X11/imThaiIc.c @@ -38,8 +38,8 @@ THIS SOFTWARE. #include #endif #include -#include -#include +#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imThaiIm.c b/nx-X11/lib/X11/imThaiIm.c index e24715022..85e9df6d3 100644 --- a/nx-X11/lib/X11/imThaiIm.c +++ b/nx-X11/lib/X11/imThaiIm.c @@ -38,10 +38,10 @@ THIS SOFTWARE. #include #endif #include -#include -#include -#include -#include +#include +#include +#include +#include #include "Xlibint.h" #include "Xlcint.h" #include "XlcPublic.h" diff --git a/nx-X11/lib/X11/imTrX.c b/nx-X11/lib/X11/imTrX.c index e2de05f28..7d00bb3f7 100644 --- a/nx-X11/lib/X11/imTrX.c +++ b/nx-X11/lib/X11/imTrX.c @@ -34,7 +34,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#include +#include #define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" diff --git a/nx-X11/lib/X11/imTrans.c b/nx-X11/lib/X11/imTrans.c index a239219b7..e9715927b 100644 --- a/nx-X11/lib/X11/imTrans.c +++ b/nx-X11/lib/X11/imTrans.c @@ -34,18 +34,18 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#include -#include +#include +#include #define NEED_EVENTS #include "Xlibint.h" -#include +#include #include "Xlcint.h" #include "Ximint.h" #include "XimTrans.h" #include "XimTrInt.h" #ifdef WIN32 -#include +#include #endif diff --git a/nx-X11/lib/X11/lcCT.c b/nx-X11/lib/X11/lcCT.c index 63608a3cd..41c7cf418 100644 --- a/nx-X11/lib/X11/lcCT.c +++ b/nx-X11/lib/X11/lcCT.c @@ -43,7 +43,7 @@ #endif #include "Xlibint.h" #include "XlcPubI.h" -#include +#include #include diff --git a/nx-X11/lib/X11/lcDB.c b/nx-X11/lib/X11/lcDB.c index ffa8f49ae..7a14d3d4f 100644 --- a/nx-X11/lib/X11/lcDB.c +++ b/nx-X11/lib/X11/lcDB.c @@ -37,8 +37,8 @@ #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include "Xlibint.h" #include "XlcPubI.h" diff --git a/nx-X11/lib/X11/lcFile.c b/nx-X11/lib/X11/lcFile.c index 691daeb9e..2e0a49db4 100644 --- a/nx-X11/lib/X11/lcFile.c +++ b/nx-X11/lib/X11/lcFile.c @@ -33,7 +33,7 @@ #include #include "Xlibint.h" #include "XlcPubI.h" -#include +#include #if 0 #include /* in theory delivers getresuid/gid prototypes, * in practice only the Linux syscall wrapper is there. */ diff --git a/nx-X11/lib/X11/lcPrTxt.c b/nx-X11/lib/X11/lcPrTxt.c index 5a781280e..1a55d1cab 100644 --- a/nx-X11/lib/X11/lcPrTxt.c +++ b/nx-X11/lib/X11/lcPrTxt.c @@ -30,8 +30,8 @@ #endif #include "Xlibint.h" #include "XlcPubI.h" -#include -#include +#include +#include static XPointer * alloc_list( diff --git a/nx-X11/lib/X11/lcTxtPr.c b/nx-X11/lib/X11/lcTxtPr.c index 1f9765f6e..e214ac4e9 100644 --- a/nx-X11/lib/X11/lcTxtPr.c +++ b/nx-X11/lib/X11/lcTxtPr.c @@ -30,8 +30,8 @@ #endif #include "Xlibint.h" #include "XlcPubI.h" -#include -#include +#include +#include #include static int diff --git a/nx-X11/lib/X11/lcUtil.c b/nx-X11/lib/X11/lcUtil.c index ab1db0083..3e49fd08f 100644 --- a/nx-X11/lib/X11/lcUtil.c +++ b/nx-X11/lib/X11/lcUtil.c @@ -29,7 +29,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "XlcPublic.h" /* Don't use here because it is locale dependent. */ diff --git a/nx-X11/lib/X11/lcWrap.c b/nx-X11/lib/X11/lcWrap.c index ea2623191..b694425fe 100644 --- a/nx-X11/lib/X11/lcWrap.c +++ b/nx-X11/lib/X11/lcWrap.c @@ -61,12 +61,12 @@ from The Open Group. #include #include "Xlibint.h" #include "Xlcint.h" -#include -#include +#include +#include #ifdef WIN32 #undef close #endif -#include +#include #include "XlcPubI.h" #ifdef XTHREADS diff --git a/nx-X11/lib/X11/locking.h b/nx-X11/lib/X11/locking.h index 96c99b972..4b847ded6 100644 --- a/nx-X11/lib/X11/locking.h +++ b/nx-X11/lib/X11/locking.h @@ -38,7 +38,7 @@ in this Software without prior written authorization from The Open Group. #define xmalloc(s) Xmalloc(s) #define xfree(s) Xfree(s) -#include +#include struct _XCVList { xcondition_t cv; diff --git a/nx-X11/lib/X11/mbWMProps.c b/nx-X11/lib/X11/mbWMProps.c index a5f7732e4..8b16bc990 100644 --- a/nx-X11/lib/X11/mbWMProps.c +++ b/nx-X11/lib/X11/mbWMProps.c @@ -31,10 +31,10 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include +#include +#include +#include +#include void XmbSetWMProperties ( diff --git a/nx-X11/lib/X11/omDefault.c b/nx-X11/lib/X11/omDefault.c index 57dd975ad..eaa75ff84 100644 --- a/nx-X11/lib/X11/omDefault.c +++ b/nx-X11/lib/X11/omDefault.c @@ -35,8 +35,8 @@ #endif #include "Xlibint.h" #include "XomGeneric.h" -#include -#include +#include +#include #include #define DefineLocalBuf char local_buf[BUFSIZ] diff --git a/nx-X11/lib/X11/omGeneric.c b/nx-X11/lib/X11/omGeneric.c index e6c23f4e2..8f4942873 100644 --- a/nx-X11/lib/X11/omGeneric.c +++ b/nx-X11/lib/X11/omGeneric.c @@ -55,8 +55,8 @@ #include "Xlibint.h" #include "XomGeneric.h" #include "XlcGeneric.h" -#include -#include +#include +#include #include #include #include diff --git a/nx-X11/lib/X11/os2Stubs.c b/nx-X11/lib/X11/os2Stubs.c index 9d109025c..804d2e14e 100644 --- a/nx-X11/lib/X11/os2Stubs.c +++ b/nx-X11/lib/X11/os2Stubs.c @@ -37,7 +37,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include #include #define INCL_DOSSEMAPHORES diff --git a/nx-X11/lib/X11/utf8WMProps.c b/nx-X11/lib/X11/utf8WMProps.c index e3a329ac8..69366b6cb 100644 --- a/nx-X11/lib/X11/utf8WMProps.c +++ b/nx-X11/lib/X11/utf8WMProps.c @@ -53,10 +53,10 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include +#include +#include +#include +#include void Xutf8SetWMProperties ( diff --git a/nx-X11/lib/X11/util/makekeys.c b/nx-X11/lib/X11/util/makekeys.c index 0b0ad9e2c..d2a7b4aef 100644 --- a/nx-X11/lib/X11/util/makekeys.c +++ b/nx-X11/lib/X11/util/makekeys.c @@ -31,9 +31,9 @@ from The Open Group. /* Constructs hash tables for XStringToKeysym and XKeysymToString. */ -#include -#include -#include +#include +#include +#include #include #include #if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */ diff --git a/nx-X11/lib/X11/uvY.c b/nx-X11/lib/X11/uvY.c index d7c3e6ab2..c07fcfc39 100644 --- a/nx-X11/lib/X11/uvY.c +++ b/nx-X11/lib/X11/uvY.c @@ -40,7 +40,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "Xlibint.h" #include "Xcmsint.h" #include "Cv.h" diff --git a/nx-X11/lib/X11/xyY.c b/nx-X11/lib/X11/xyY.c index 63e80bc59..ba0b06137 100644 --- a/nx-X11/lib/X11/xyY.c +++ b/nx-X11/lib/X11/xyY.c @@ -40,7 +40,7 @@ #include #endif #include -#include +#include #include "Xlibint.h" #include "Xcmsint.h" #include "Cv.h" diff --git a/nx-X11/lib/Xau/AuDispose.c b/nx-X11/lib/Xau/AuDispose.c index 58ffd61e7..dc2080f40 100644 --- a/nx-X11/lib/Xau/AuDispose.c +++ b/nx-X11/lib/Xau/AuDispose.c @@ -30,7 +30,7 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include void diff --git a/nx-X11/lib/Xau/AuFileName.c b/nx-X11/lib/Xau/AuFileName.c index a51fc3bff..6ab0138b8 100644 --- a/nx-X11/lib/Xau/AuFileName.c +++ b/nx-X11/lib/Xau/AuFileName.c @@ -30,8 +30,8 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include char * diff --git a/nx-X11/lib/Xau/AuGetAddr.c b/nx-X11/lib/Xau/AuGetAddr.c index ab13cb630..d68ceadc2 100644 --- a/nx-X11/lib/Xau/AuGetAddr.c +++ b/nx-X11/lib/Xau/AuGetAddr.c @@ -30,8 +30,8 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include static int binaryEqual (_Xconst char *a, _Xconst char *b, int len) diff --git a/nx-X11/lib/Xau/AuGetBest.c b/nx-X11/lib/Xau/AuGetBest.c index 5ff1c7cd3..eb27f24c1 100644 --- a/nx-X11/lib/Xau/AuGetBest.c +++ b/nx-X11/lib/Xau/AuGetBest.c @@ -30,15 +30,15 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #ifdef XTHREADS -#include +#include #endif #ifdef hpux #define X_INCLUDE_NETDB_H #define XOS_USE_NO_LOCKING -#include +#include #endif static int diff --git a/nx-X11/lib/Xau/AuLock.c b/nx-X11/lib/Xau/AuLock.c index 001235607..1813dc368 100644 --- a/nx-X11/lib/Xau/AuLock.c +++ b/nx-X11/lib/Xau/AuLock.c @@ -30,8 +30,8 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include #include #include @@ -42,7 +42,7 @@ in this Software without prior written authorization from The Open Group. #ifndef WIN32 extern unsigned sleep (); #else -#include +#include #define link rename #endif #endif diff --git a/nx-X11/lib/Xau/AuRead.c b/nx-X11/lib/Xau/AuRead.c index 60a0d747f..2e2509633 100644 --- a/nx-X11/lib/Xau/AuRead.c +++ b/nx-X11/lib/Xau/AuRead.c @@ -30,7 +30,7 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include #include diff --git a/nx-X11/lib/Xau/AuUnlock.c b/nx-X11/lib/Xau/AuUnlock.c index 460effe86..e40042104 100644 --- a/nx-X11/lib/Xau/AuUnlock.c +++ b/nx-X11/lib/Xau/AuUnlock.c @@ -30,8 +30,8 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include int XauUnlockAuth ( diff --git a/nx-X11/lib/Xau/AuWrite.c b/nx-X11/lib/Xau/AuWrite.c index f25abc9e6..5a9b44eb2 100644 --- a/nx-X11/lib/Xau/AuWrite.c +++ b/nx-X11/lib/Xau/AuWrite.c @@ -30,7 +30,7 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include static int write_short (unsigned short s, FILE *file) diff --git a/nx-X11/lib/Xau/Autest.c b/nx-X11/lib/Xau/Autest.c index 298464908..2352cf170 100644 --- a/nx-X11/lib/Xau/Autest.c +++ b/nx-X11/lib/Xau/Autest.c @@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include main (argc, argv) char **argv; diff --git a/nx-X11/lib/Xau/Imakefile b/nx-X11/lib/Xau/Imakefile index 331d29c09..df80d28d4 100644 --- a/nx-X11/lib/Xau/Imakefile +++ b/nx-X11/lib/Xau/Imakefile @@ -12,7 +12,7 @@ XCOMM $XFree86: xc/lib/Xau/Imakefile,v 3.5 1999/04/17 09:08:11 dawes Exp $ #define DoProfileLib ProfileLibXau #define LibName NX_Xau #define SoRev SOXAUTHREV -#define IncSubdir X11 +#define IncSubdir nx-X11 #include diff --git a/nx-X11/lib/Xau/k5encode.c b/nx-X11/lib/Xau/k5encode.c index a3c6c09b1..c71222e1c 100644 --- a/nx-X11/lib/Xau/k5encode.c +++ b/nx-X11/lib/Xau/k5encode.c @@ -45,10 +45,10 @@ in this Software without prior written authorization from The Open Group. #undef BITS32 #undef xfree -#include -#include -#include -#include +#include +#include +#include +#include /* * XauKrb5Encode diff --git a/nx-X11/lib/Xcomposite/Imakefile b/nx-X11/lib/Xcomposite/Imakefile index a8e4077fa..24820c146 100644 --- a/nx-X11/lib/Xcomposite/Imakefile +++ b/nx-X11/lib/Xcomposite/Imakefile @@ -16,7 +16,7 @@ SOXCOMPOSITEREV=1.0.0 #define LibName NX_Xcomposite #define SoRev SOXCOMPOSITEREV -#define IncSubdir X11 +#define IncSubdir nx-X11 #define IncSubSubdir extensions #include diff --git a/nx-X11/lib/Xcomposite/Xcomposite.h b/nx-X11/lib/Xcomposite/Xcomposite.h index 3604141bb..c28cc6857 100644 --- a/nx-X11/lib/Xcomposite/Xcomposite.h +++ b/nx-X11/lib/Xcomposite/Xcomposite.h @@ -25,9 +25,9 @@ #ifndef _XCOMPOSITE_H_ #define _XCOMPOSITE_H_ -#include -#include -#include +#include +#include +#include /* * This revision number also appears in configure.ac, they have diff --git a/nx-X11/lib/Xcomposite/xcompositeint.h b/nx-X11/lib/Xcomposite/xcompositeint.h index af5f57500..7b12e8d55 100644 --- a/nx-X11/lib/Xcomposite/xcompositeint.h +++ b/nx-X11/lib/Xcomposite/xcompositeint.h @@ -28,11 +28,11 @@ #define NEED_EVENTS #define NEED_REPLIES #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include typedef struct _XCompositeExtDisplayInfo { struct _XCompositeExtDisplayInfo *next; /* keep a linked list */ diff --git a/nx-X11/lib/Xext/DPMS.c b/nx-X11/lib/Xext/DPMS.c index 35b21b4ad..a2c0dc3c5 100644 --- a/nx-X11/lib/Xext/DPMS.c +++ b/nx-X11/lib/Xext/DPMS.c @@ -36,11 +36,11 @@ Equipment Corporation. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include static XExtensionInfo _dpms_info_data; diff --git a/nx-X11/lib/Xext/MITMisc.c b/nx-X11/lib/Xext/MITMisc.c index c0fa87209..8ba35dce1 100644 --- a/nx-X11/lib/Xext/MITMisc.c +++ b/nx-X11/lib/Xext/MITMisc.c @@ -32,11 +32,11 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include static XExtensionInfo _mit_info_data; static XExtensionInfo *mit_info = &_mit_info_data; diff --git a/nx-X11/lib/Xext/XAppgroup.c b/nx-X11/lib/Xext/XAppgroup.c index 2ca3e4d21..abbf1c1b9 100644 --- a/nx-X11/lib/Xext/XAppgroup.c +++ b/nx-X11/lib/Xext/XAppgroup.c @@ -30,15 +30,15 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #endif #define NEED_EVENTS #define NEED_REPLIES -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/nx-X11/lib/Xext/XEVI.c b/nx-X11/lib/Xext/XEVI.c index a64b9c1ba..e5a811bdf 100644 --- a/nx-X11/lib/Xext/XEVI.c +++ b/nx-X11/lib/Xext/XEVI.c @@ -27,12 +27,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static XExtensionInfo *xevi_info;/* needs to move to globals.c */ static /* const */ char *xevi_extension_name = EVINAME; #define XeviCheckExtension(dpy,i,val) \ diff --git a/nx-X11/lib/Xext/XLbx.c b/nx-X11/lib/Xext/XLbx.c index 8c0cfad0b..450bd5bc5 100644 --- a/nx-X11/lib/Xext/XLbx.c +++ b/nx-X11/lib/Xext/XLbx.c @@ -30,11 +30,11 @@ #include #endif #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include static XExtensionInfo _lbx_info_data; static XExtensionInfo *lbx_info = &_lbx_info_data; diff --git a/nx-X11/lib/Xext/XMultibuf.c b/nx-X11/lib/Xext/XMultibuf.c index 3e0049e92..570676def 100644 --- a/nx-X11/lib/Xext/XMultibuf.c +++ b/nx-X11/lib/Xext/XMultibuf.c @@ -32,11 +32,11 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include -#include -#include -#include +#include +#include +#include static XExtensionInfo _multibuf_info_data; static XExtensionInfo *multibuf_info = &_multibuf_info_data; diff --git a/nx-X11/lib/Xext/XSecurity.c b/nx-X11/lib/Xext/XSecurity.c index 161ade3b7..a9899916f 100644 --- a/nx-X11/lib/Xext/XSecurity.c +++ b/nx-X11/lib/Xext/XSecurity.c @@ -29,11 +29,11 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include -#include -#include -#include +#include +#include +#include static XExtensionInfo _Security_info_data; static XExtensionInfo *Security_info = &_Security_info_data; diff --git a/nx-X11/lib/Xext/XShape.c b/nx-X11/lib/Xext/XShape.c index 29a7f83f9..79b4b78f6 100644 --- a/nx-X11/lib/Xext/XShape.c +++ b/nx-X11/lib/Xext/XShape.c @@ -31,12 +31,12 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static XExtensionInfo _shape_info_data; static XExtensionInfo *shape_info = &_shape_info_data; diff --git a/nx-X11/lib/Xext/XShm.c b/nx-X11/lib/Xext/XShm.c index f4e29a42b..ec3720732 100644 --- a/nx-X11/lib/Xext/XShm.c +++ b/nx-X11/lib/Xext/XShm.c @@ -36,12 +36,12 @@ in this Software without prior written authorization from The Open Group. #include #endif #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static XExtensionInfo _shm_info_data; static XExtensionInfo *shm_info = &_shm_info_data; diff --git a/nx-X11/lib/Xext/XSync.c b/nx-X11/lib/Xext/XSync.c index 61f8600ce..39eb97cdd 100644 --- a/nx-X11/lib/Xext/XSync.c +++ b/nx-X11/lib/Xext/XSync.c @@ -58,10 +58,10 @@ PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS #define NEED_REPLIES -#include -#include -#include -#include +#include +#include +#include +#include static XExtensionInfo _sync_info_data; static XExtensionInfo *sync_info = &_sync_info_data; diff --git a/nx-X11/lib/Xext/XTestExt1.c b/nx-X11/lib/Xext/XTestExt1.c index ee4a0bde0..00da036bd 100644 --- a/nx-X11/lib/Xext/XTestExt1.c +++ b/nx-X11/lib/Xext/XTestExt1.c @@ -64,9 +64,9 @@ University of California. #include #endif #include -#include -#include -#include +#include +#include +#include /****************************************************************************** * variables diff --git a/nx-X11/lib/Xext/Xcup.c b/nx-X11/lib/Xext/Xcup.c index 6315d32a4..8bf2bb29e 100644 --- a/nx-X11/lib/Xext/Xcup.c +++ b/nx-X11/lib/Xext/Xcup.c @@ -30,15 +30,15 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include #endif #define NEED_EVENTS #define NEED_REPLIES -#include -#include -#include -#include +#include +#include +#include +#include static XExtensionInfo _xcup_info_data; static XExtensionInfo *xcup_info = &_xcup_info_data; diff --git a/nx-X11/lib/Xext/Xdbe.c b/nx-X11/lib/Xext/Xdbe.c index 954c8f01d..05df171f6 100644 --- a/nx-X11/lib/Xext/Xdbe.c +++ b/nx-X11/lib/Xext/Xdbe.c @@ -38,11 +38,11 @@ #include #endif #include -#include -#include -#include +#include +#include +#include #define NEED_DBE_PROTOCOL -#include +#include static XExtensionInfo _dbe_info_data; static XExtensionInfo *dbe_info = &_dbe_info_data; diff --git a/nx-X11/lib/Xext/extutil.c b/nx-X11/lib/Xext/extutil.c index d96b17f3f..bd79dbdb2 100644 --- a/nx-X11/lib/Xext/extutil.c +++ b/nx-X11/lib/Xext/extutil.c @@ -51,9 +51,9 @@ in this Software without prior written authorization from The Open Group. #include #endif #include -#include -#include -#include +#include +#include +#include /* diff --git a/nx-X11/lib/Xext/globals.c b/nx-X11/lib/Xext/globals.c index 0cd5d2690..53a18690d 100644 --- a/nx-X11/lib/Xext/globals.c +++ b/nx-X11/lib/Xext/globals.c @@ -34,8 +34,8 @@ from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include /* for definition of NULL */ /* diff --git a/nx-X11/lib/Xfixes/Imakefile b/nx-X11/lib/Xfixes/Imakefile index ca1fe046b..cc3e1631d 100644 --- a/nx-X11/lib/Xfixes/Imakefile +++ b/nx-X11/lib/Xfixes/Imakefile @@ -16,7 +16,7 @@ SOXFIXESREV=3.0.0 #define LibName NX_Xfixes #define SoRev SOXFIXESREV -#define IncSubdir X11 +#define IncSubdir nx-X11 #define IncSubSubdir extensions #include diff --git a/nx-X11/lib/Xfixes/Xfixes.h b/nx-X11/lib/Xfixes/Xfixes.h index 28ca28f1a..4cba47ca4 100644 --- a/nx-X11/lib/Xfixes/Xfixes.h +++ b/nx-X11/lib/Xfixes/Xfixes.h @@ -25,9 +25,9 @@ #ifndef _XFIXES_H_ #define _XFIXES_H_ -#include +#include -#include +#include /* * This revision number also appears in configure.ac, they have diff --git a/nx-X11/lib/Xfixes/Xfixes.man b/nx-X11/lib/Xfixes/Xfixes.man index f081cc54e..563db15b5 100644 --- a/nx-X11/lib/Xfixes/Xfixes.man +++ b/nx-X11/lib/Xfixes/Xfixes.man @@ -31,7 +31,7 @@ .SH NAME XFixes \- Augmented versions of core protocol requests .SH SYNTAX -\&#include +\&#include .nf .sp Bool XFixesQueryExtension \^(\^Display *\fIdpy\fP, diff --git a/nx-X11/lib/Xfixes/Xfixesint.h b/nx-X11/lib/Xfixes/Xfixesint.h index e227571be..353dcae77 100644 --- a/nx-X11/lib/Xfixes/Xfixesint.h +++ b/nx-X11/lib/Xfixes/Xfixesint.h @@ -28,11 +28,11 @@ #define NEED_EVENTS #define NEED_REPLIES #include -#include -#include -#include +#include +#include +#include #include "Xfixes.h" -#include +#include extern char XFixesExtensionName[]; diff --git a/nx-X11/lib/Xinerama/Xinerama.c b/nx-X11/lib/Xinerama/Xinerama.c index fd717dd22..0256336be 100644 --- a/nx-X11/lib/Xinerama/Xinerama.c +++ b/nx-X11/lib/Xinerama/Xinerama.c @@ -27,13 +27,13 @@ Equipment Corporation. #define NEED_EVENTS #define NEED_REPLIES -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include static XExtensionInfo _panoramiX_ext_info_data; diff --git a/nx-X11/lib/Xrender/Imakefile b/nx-X11/lib/Xrender/Imakefile index 35d826b22..c5a0f89fc 100644 --- a/nx-X11/lib/Xrender/Imakefile +++ b/nx-X11/lib/Xrender/Imakefile @@ -71,7 +71,7 @@ clean:: #define SoRev SOXRENDERREV #ifdef XBuildIncDir -#define IncSubdir X11 +#define IncSubdir nx-X11 #define IncSubSubdir extensions RENDERINCDIR = $(BUILDINCDIR) #else diff --git a/nx-X11/lib/Xrender/Picture.c b/nx-X11/lib/Xrender/Picture.c index 0b18f5c57..260eda05e 100644 --- a/nx-X11/lib/Xrender/Picture.c +++ b/nx-X11/lib/Xrender/Picture.c @@ -26,7 +26,7 @@ #include #endif #include "Xrenderint.h" -#include +#include static void _XRenderProcessPictureAttributes (Display *dpy, diff --git a/nx-X11/lib/Xrender/Xrender.h b/nx-X11/lib/Xrender/Xrender.h index 4d125cd81..a38f4cc3d 100644 --- a/nx-X11/lib/Xrender/Xrender.h +++ b/nx-X11/lib/Xrender/Xrender.h @@ -27,12 +27,12 @@ #define NX_CLEANUP -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #ifdef NX_CLEANUP #include "renderproto.h" diff --git a/nx-X11/lib/Xrender/Xrenderint.h b/nx-X11/lib/Xrender/Xrenderint.h index a90fe65d8..9744b0da4 100644 --- a/nx-X11/lib/Xrender/Xrenderint.h +++ b/nx-X11/lib/Xrender/Xrenderint.h @@ -28,9 +28,9 @@ #include "config.h" #define NEED_EVENTS #define NEED_REPLIES -#include -#include -#include +#include +#include +#include #include "Xrender.h" typedef struct { diff --git a/nx-X11/lib/Xtst/XRecord.c b/nx-X11/lib/Xtst/XRecord.c index 05cbda889..8e1823ef9 100644 --- a/nx-X11/lib/Xtst/XRecord.c +++ b/nx-X11/lib/Xtst/XRecord.c @@ -56,10 +56,10 @@ from The Open Group. #include #define NEED_EVENTS #define NEED_REPLIES -#include -#include -#include -#include +#include +#include +#include +#include static XExtensionInfo _xrecord_info_data; static XExtensionInfo *xrecord_info = &_xrecord_info_data; diff --git a/nx-X11/lib/Xtst/XTest.c b/nx-X11/lib/Xtst/XTest.c index 2c3ae2b41..6b814aab4 100644 --- a/nx-X11/lib/Xtst/XTest.c +++ b/nx-X11/lib/Xtst/XTest.c @@ -33,13 +33,13 @@ from The Open Group. /* $XFree86: xc/lib/Xtst/XTest.c,v 1.5 2001/12/14 19:56:40 dawes Exp $ */ #define NEED_REPLIES -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include static XExtensionInfo _xtest_info_data; static XExtensionInfo *xtest_info = &_xtest_info_data; diff --git a/nx-X11/lib/oldX/Imakefile b/nx-X11/lib/oldX/Imakefile index 663d11019..e2ee75eb0 100644 --- a/nx-X11/lib/oldX/Imakefile +++ b/nx-X11/lib/oldX/Imakefile @@ -12,7 +12,7 @@ XCOMM $XFree86: xc/lib/oldX/Imakefile,v 1.2 1998/12/20 11:57:19 dawes Exp $ #define DoProfileLib ProfileOldX #define LibName NX_oldX #define SoRev SOOLDXREV -#define IncSubdir X11 +#define IncSubdir nx-X11 #ifdef SharedOldXReqs REQUIREDLIBS = SharedOldXReqs diff --git a/nx-X11/lib/xkbfile/Imakefile b/nx-X11/lib/xkbfile/Imakefile index d7693819e..6a675dc9a 100644 --- a/nx-X11/lib/xkbfile/Imakefile +++ b/nx-X11/lib/xkbfile/Imakefile @@ -13,7 +13,7 @@ XCOMM $XFree86: xc/lib/xkbfile/Imakefile,v 3.5 2003/10/15 21:23:38 herrb Exp $ #define HasSharedData NO #define LibName NX_xkbfile #define SoRev SOXKBFILEREV -#define IncSubdir X11 +#define IncSubdir nx-X11 #define IncSubSubdir extensions #ifdef SharedxkbfileReqs diff --git a/nx-X11/lib/xkbfile/XKMformat.h b/nx-X11/lib/xkbfile/XKMformat.h index 154da5694..ced5ea21d 100644 --- a/nx-X11/lib/xkbfile/XKMformat.h +++ b/nx-X11/lib/xkbfile/XKMformat.h @@ -29,9 +29,9 @@ #ifndef _XKMFORMAT_H_ #define _XKMFORMAT_H_ 1 -#include -#include -#include +#include +#include +#include typedef struct _xkmFileInfo { CARD8 type; diff --git a/nx-X11/lib/xkbfile/cout.c b/nx-X11/lib/xkbfile/cout.c index 161bd0f89..96b3ba411 100644 --- a/nx-X11/lib/xkbfile/cout.c +++ b/nx-X11/lib/xkbfile/cout.c @@ -32,10 +32,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "XKMformat.h" #include "XKBfileInt.h" diff --git a/nx-X11/lib/xkbfile/maprules.c b/nx-X11/lib/xkbfile/maprules.c index 53decdcad..75baf07ea 100644 --- a/nx-X11/lib/xkbfile/maprules.c +++ b/nx-X11/lib/xkbfile/maprules.c @@ -38,18 +38,18 @@ #define X_INCLUDE_STRING_H #define XOS_USE_NO_LOCKING -#include +#include #ifndef XKB_IN_SERVER -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "XKMformat.h" #include "XKBfileInt.h" #include "XKBrules.h" @@ -57,18 +57,18 @@ #else #define NEED_EVENTS -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "misc.h" #include "inputstr.h" #include "dix.h" -#include +#include #define XKBSRV_NEED_FILE_FUNCS -#include +#include #endif diff --git a/nx-X11/lib/xkbfile/srvmisc.c b/nx-X11/lib/xkbfile/srvmisc.c index 3e4c73c98..d228389d9 100644 --- a/nx-X11/lib/xkbfile/srvmisc.c +++ b/nx-X11/lib/xkbfile/srvmisc.c @@ -32,9 +32,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "XKMformat.h" #include "XKBfileInt.h" diff --git a/nx-X11/lib/xkbfile/xkbatom.c b/nx-X11/lib/xkbfile/xkbatom.c index 1a5dea0f8..d023d5410 100644 --- a/nx-X11/lib/xkbfile/xkbatom.c +++ b/nx-X11/lib/xkbfile/xkbatom.c @@ -79,9 +79,9 @@ SOFTWARE. #include #include #include -#include -#include -#include +#include +#include +#include #include "XKMformat.h" #include "XKBfileInt.h" diff --git a/nx-X11/lib/xkbfile/xkbbells.c b/nx-X11/lib/xkbfile/xkbbells.c index 30b918fb4..8bf0885fe 100644 --- a/nx-X11/lib/xkbfile/xkbbells.c +++ b/nx-X11/lib/xkbfile/xkbbells.c @@ -29,8 +29,8 @@ #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include +#include #include "XKBbells.h" static char *_xkbStdBellNames[XkbBI_NumBells] = { diff --git a/nx-X11/lib/xkbfile/xkbconfig.c b/nx-X11/lib/xkbfile/xkbconfig.c index 7930979eb..8c31213a5 100644 --- a/nx-X11/lib/xkbfile/xkbconfig.c +++ b/nx-X11/lib/xkbfile/xkbconfig.c @@ -36,32 +36,32 @@ #include #include -#include +#include -#include +#include #ifndef XKB_IN_SERVER -#include -#include -#include -#include +#include +#include +#include +#include #include "XKBfileInt.h" #else -#include +#include #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "inputstr.h" #include "dix.h" #define XKBSRV_NEED_FILE_FUNCS -#include +#include #endif -#include +#include /***====================================================================***/ diff --git a/nx-X11/lib/xkbfile/xkbdraw.c b/nx-X11/lib/xkbfile/xkbdraw.c index c955f0321..865b2952e 100644 --- a/nx-X11/lib/xkbfile/xkbdraw.c +++ b/nx-X11/lib/xkbfile/xkbdraw.c @@ -33,12 +33,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "XKMformat.h" #include "XKBfileInt.h" diff --git a/nx-X11/lib/xkbfile/xkbmisc.c b/nx-X11/lib/xkbfile/xkbmisc.c index cca31f778..52fca3d10 100644 --- a/nx-X11/lib/xkbfile/xkbmisc.c +++ b/nx-X11/lib/xkbfile/xkbmisc.c @@ -36,31 +36,31 @@ #include #include -#include -#include +#include +#include #ifndef XKB_IN_SERVER -#include -#include -#include -#include +#include +#include +#include +#include #include "XKMformat.h" #include "XKBfileInt.h" #else -#include +#include #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "inputstr.h" #include "dix.h" -#include +#include #define XKBSRV_NEED_FILE_FUNCS 1 -#include -#include +#include +#include #include "xkb.h" #endif diff --git a/nx-X11/lib/xkbfile/xkbout.c b/nx-X11/lib/xkbfile/xkbout.c index b69fdfbb4..8baf34b78 100644 --- a/nx-X11/lib/xkbfile/xkbout.c +++ b/nx-X11/lib/xkbfile/xkbout.c @@ -35,32 +35,32 @@ #include #include #include -#include +#include #ifndef XKB_IN_SERVER -#include -#include -#include +#include +#include +#include #include "XKMformat.h" #include "XKBfileInt.h" #else -#include +#include #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "inputstr.h" #include "dix.h" -#include +#include #define XKBSRV_NEED_FILE_FUNCS 1 -#include +#include -#include -#include +#include +#include #endif diff --git a/nx-X11/lib/xkbfile/xkbtext.c b/nx-X11/lib/xkbfile/xkbtext.c index 28592d242..41f2a8ff3 100644 --- a/nx-X11/lib/xkbfile/xkbtext.c +++ b/nx-X11/lib/xkbfile/xkbtext.c @@ -36,29 +36,29 @@ #include #include -#include +#include #ifndef XKB_IN_SERVER -#include -#include -#include +#include +#include +#include #include "XKMformat.h" #include "XKBfileInt.h" #else -#include +#include #define NEED_EVENTS -#include +#include #include "misc.h" #include "inputstr.h" #include "dix.h" -#include +#include #define XKBSRV_NEED_FILE_FUNCS 1 -#include -#include +#include +#include #endif diff --git a/nx-X11/lib/xkbfile/xkmout.c b/nx-X11/lib/xkbfile/xkmout.c index 403e48810..7de4081af 100644 --- a/nx-X11/lib/xkbfile/xkmout.c +++ b/nx-X11/lib/xkbfile/xkmout.c @@ -32,10 +32,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "XKMformat.h" #include "XKBfileInt.h" diff --git a/nx-X11/lib/xkbfile/xkmread.c b/nx-X11/lib/xkbfile/xkmread.c index f22941f67..92ef05b86 100644 --- a/nx-X11/lib/xkbfile/xkmread.c +++ b/nx-X11/lib/xkbfile/xkmread.c @@ -34,33 +34,33 @@ #include -#include -#include +#include +#include #ifndef XKB_IN_SERVER #include -#include -#include +#include +#include -#include +#include -#include +#include #include "XKMformat.h" #include "XKBfileInt.h" #else -#include +#include #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "inputstr.h" -#include +#include #define XKBSRV_NEED_FILE_FUNCS -#include -#include +#include +#include Atom XkbInternAtom(Display *dpy,char *str,Bool only_if_exists) diff --git a/nx-X11/lib/xtrans/Imakefile b/nx-X11/lib/xtrans/Imakefile index e29a38591..2cc880c39 100644 --- a/nx-X11/lib/xtrans/Imakefile +++ b/nx-X11/lib/xtrans/Imakefile @@ -1,6 +1,6 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ -#define IncSubdir X11 +#define IncSubdir nx-X11 all:: diff --git a/nx-X11/programs/Xserver/GL/glx/glxserver.h b/nx-X11/programs/Xserver/GL/glx/glxserver.h index 193ebcb6f..4238de537 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxserver.h +++ b/nx-X11/programs/Xserver/GL/glx/glxserver.h @@ -41,9 +41,9 @@ ** */ -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c index 6441a4b4f..1889bdabd 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c @@ -39,7 +39,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include "pixmapstr.h" #include "xf86glx_util.h" -#include +#include #include "GL/xf86glx.h" #ifdef ROUNDUP diff --git a/nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c b/nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c index 3b9955eba..a3e1d08c6 100644 --- a/nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c +++ b/nx-X11/programs/Xserver/XTrap/xf86XTrapModule.c @@ -8,7 +8,7 @@ #include "xf86Module.h" -#include +#include extern void DEC_XTRAPInit(INITARGS); diff --git a/nx-X11/programs/Xserver/XTrap/xtrapddmi.c b/nx-X11/programs/Xserver/XTrap/xtrapddmi.c index 2dba356b7..1b4be39cd 100644 --- a/nx-X11/programs/Xserver/XTrap/xtrapddmi.c +++ b/nx-X11/programs/Xserver/XTrap/xtrapddmi.c @@ -44,7 +44,7 @@ SOFTWARE. #ifndef EXTMODULE #include -#include +#include #ifdef PC # include "fcntl.h" # include "io.h" @@ -56,7 +56,7 @@ SOFTWARE. #define NEED_REPLIES #define NEED_EVENTS -#include /* From library include environment */ +#include /* From library include environment */ #include "input.h" /* From server include env. (must be before Xlib.h!) */ #ifdef PC # include "scrintst.h" /* Screen struct */ @@ -66,9 +66,9 @@ SOFTWARE. # include "scrnintstr.h" /* Screen struct */ #endif -#include -#include -#include +#include +#include +#include extern int XETrapErrorBase; extern xXTrapGetAvailReply XETrap_avail; diff --git a/nx-X11/programs/Xserver/XTrap/xtrapdi.c b/nx-X11/programs/Xserver/XTrap/xtrapdi.c index bdddb6310..987d54e4f 100644 --- a/nx-X11/programs/Xserver/XTrap/xtrapdi.c +++ b/nx-X11/programs/Xserver/XTrap/xtrapdi.c @@ -58,12 +58,12 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef EXTMODULE #include #include -#include +#include #else #include "xf86_ansic.h" #endif -#include -#include +#include +#include #include "input.h" /* Server DevicePtr definitions */ #include "misc.h" /* Server swapping macros */ #include "dixstruct.h" /* Server ClientRec definitions */ @@ -77,9 +77,9 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include "pixmapstr.h" /* DrawableRec */ #include "windowstr.h" /* Drawable Lookup structures */ -#include -#include -#include +#include +#include +#include #include "colormapst.h" #ifdef PANORAMIX #include "panoramiX.h" diff --git a/nx-X11/programs/Xserver/XTrap/xtrapdiswp.c b/nx-X11/programs/Xserver/XTrap/xtrapdiswp.c index c43f6e332..ba8249c35 100644 --- a/nx-X11/programs/Xserver/XTrap/xtrapdiswp.c +++ b/nx-X11/programs/Xserver/XTrap/xtrapdiswp.c @@ -49,12 +49,12 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#include +#include #define NEED_REPLIES #define NEED_EVENTS -#include -#include -#include +#include +#include +#include #include "input.h" /* Server DevicePtr definitions */ #include "misc.h" #include "dixstruct.h" @@ -64,8 +64,8 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # include "extnsionst.h" /* Server ExtensionEntry definitions */ #endif # include "swapreq.h" /* Server SwapColorItem definition */ -#include -#include +#include +#include /* In-coming XTrap requests needing to be swapped to native format */ diff --git a/nx-X11/programs/Xserver/XTrap/xtrapditbl.c b/nx-X11/programs/Xserver/XTrap/xtrapditbl.c index a9ceddb3d..10a070e9e 100644 --- a/nx-X11/programs/Xserver/XTrap/xtrapditbl.c +++ b/nx-X11/programs/Xserver/XTrap/xtrapditbl.c @@ -39,12 +39,12 @@ SOFTWARE. #include #endif -#include +#include #define NEED_REPLIES #define NEED_EVENTS -#include -#include -#include +#include +#include +#include #include "input.h" /* Server DevicePtr definitions */ #include "misc.h" #include "dixstruct.h" @@ -53,8 +53,8 @@ SOFTWARE. #else # include "extnsionst.h" /* Server ExtensionEntry definitions */ #endif -#include -#include +#include +#include globaldef void_function XETSwProcVector[256L] = { diff --git a/nx-X11/programs/Xserver/Xext/EVI.c b/nx-X11/programs/Xserver/Xext/EVI.c index 93ed19fa6..1eca62693 100644 --- a/nx-X11/programs/Xserver/Xext/EVI.c +++ b/nx-X11/programs/Xserver/Xext/EVI.c @@ -27,13 +27,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#include -#include +#include +#include #include "dixstruct.h" #include "extnsionst.h" #include "dix.h" #define _XEVI_SERVER_ -#include +#include #include "EVIstruct.h" #include "modinit.h" #include "scrnintstr.h" diff --git a/nx-X11/programs/Xserver/Xext/appgroup.c b/nx-X11/programs/Xserver/Xext/appgroup.c index e23ceca59..1dd4f1ae5 100644 --- a/nx-X11/programs/Xserver/Xext/appgroup.c +++ b/nx-X11/programs/Xserver/Xext/appgroup.c @@ -32,8 +32,8 @@ from The Open Group. #include #endif -#include -#include +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -42,14 +42,14 @@ from The Open Group. #include "colormapst.h" #include "servermd.h" #define _XAG_SERVER_ -#include -#include +#include +#include #define _SECURITY_SERVER -#include -#include +#include +#include #define XSERV_t -#include +#include #include "../os/osdep.h" #include diff --git a/nx-X11/programs/Xserver/Xext/bigreq.c b/nx-X11/programs/Xserver/Xext/bigreq.c index 3d6d49ca7..eba552cfe 100644 --- a/nx-X11/programs/Xserver/Xext/bigreq.c +++ b/nx-X11/programs/Xserver/Xext/bigreq.c @@ -33,13 +33,13 @@ from The Open Group. #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" -#include +#include #include "opaque.h" #include "modinit.h" diff --git a/nx-X11/programs/Xserver/Xext/cup.c b/nx-X11/programs/Xserver/Xext/cup.c index 198aa801f..9b6d25c21 100644 --- a/nx-X11/programs/Xserver/Xext/cup.c +++ b/nx-X11/programs/Xserver/Xext/cup.c @@ -32,8 +32,8 @@ in this Software without prior written authorization from The Open Group. #include #endif -#include -#include +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -42,8 +42,8 @@ in this Software without prior written authorization from The Open Group. #include "servermd.h" #include "swapreq.h" #define _XCUP_SERVER_ -#include -#include +#include +#include #ifndef EXTMODULE #include "../os/osdep.h" diff --git a/nx-X11/programs/Xserver/Xext/dgaproc.h b/nx-X11/programs/Xserver/Xext/dgaproc.h index eb9791098..4d3f224e6 100644 --- a/nx-X11/programs/Xserver/Xext/dgaproc.h +++ b/nx-X11/programs/Xserver/Xext/dgaproc.h @@ -3,7 +3,7 @@ #ifndef __DGAPROC_H #define __DGAPROC_H -#include +#include #include "pixmap.h" #define DGA_CONCURRENT_ACCESS 0x00000001 diff --git a/nx-X11/programs/Xserver/Xext/dpms.c b/nx-X11/programs/Xserver/Xext/dpms.c index 3e79602d1..fc40193e4 100644 --- a/nx-X11/programs/Xserver/Xext/dpms.c +++ b/nx-X11/programs/Xserver/Xext/dpms.c @@ -39,16 +39,16 @@ Equipment Corporation. #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include "opaque.h" #define DPMS_SERVER -#include -#include +#include +#include #include "dpmsproc.h" #include "modinit.h" diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.c b/nx-X11/programs/Xserver/Xext/extmod/modinit.c index f79204281..162f76ad8 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/modinit.c +++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.c @@ -33,7 +33,7 @@ #include "xf86Module.h" #include "xf86Opt.h" -#include +#include #include "modinit.h" #include "globals.h" diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.h b/nx-X11/programs/Xserver/Xext/extmod/modinit.h index 2bafdb2b0..40e1828bb 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/modinit.h +++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.h @@ -12,26 +12,26 @@ #ifdef SHAPE extern void ShapeExtensionInit(INITARGS); #define _SHAPE_SERVER_ /* don't want Xlib structures */ -#include +#include #endif #ifdef MULTIBUFFER extern void MultibufferExtensionInit(INITARGS); #define _MULTIBUF_SERVER_ /* don't want Xlib structures */ -#include +#include #endif #ifdef MITMISC extern void MITMiscExtensionInit(INITARGS); #define _MITMISC_SERVER_ -#include +#include #endif #ifdef XTEST extern void XTestExtensionInit(INITARGS); #define _XTEST_SERVER_ -#include -#include +#include +#include #endif #if 1 @@ -40,49 +40,49 @@ extern void XTestExtension1Init(INITARGS); #ifdef BIGREQS extern void BigReqExtensionInit(INITARGS); -#include +#include #endif #ifdef XSYNC extern void SyncExtensionInit(INITARGS); #define _SYNC_SERVER -#include -#include +#include +#include #endif #ifdef SCREENSAVER extern void ScreenSaverExtensionInit (INITARGS); -#include +#include #endif #ifdef XCMISC extern void XCMiscExtensionInit(INITARGS); -#include +#include #endif #ifdef XF86VIDMODE extern void XFree86VidModeExtensionInit(INITARGS); #define _XF86VIDMODE_SERVER_ -#include +#include #endif #ifdef XF86MISC extern void XFree86MiscExtensionInit(INITARGS); #define _XF86MISC_SERVER_ #define _XF86MISC_SAVER_COMPAT_ -#include +#include #endif #ifdef XFreeXDGA extern void XFree86DGAExtensionInit(INITARGS); extern void XFree86DGARegister(INITARGS); #define _XF86DGA_SERVER_ -#include +#include #endif #ifdef DPMSExtension extern void DPMSExtensionInit(INITARGS); -#include +#include #endif #ifdef FONTCACHE @@ -95,31 +95,31 @@ extern void FontCacheExtensionInit(INITARGS); #ifdef TOGCUP extern void XcupExtensionInit(INITARGS); #define _XCUP_SERVER_ -#include +#include #endif #ifdef EVI extern void EVIExtensionInit(INITARGS); #define _XEVI_SERVER_ -#include +#include #endif #ifdef XV extern void XvExtensionInit(INITARGS); extern void XvMCExtensionInit(INITARGS); extern void XvRegister(INITARGS); -#include -#include +#include +#include #endif #ifdef RES extern void ResExtensionInit(INITARGS); -#include +#include #endif #ifdef SHM extern void ShmExtensionInit(INITARGS); -#include +#include extern void ShmSetPixmapFormat( ScreenPtr pScreen, int format); diff --git a/nx-X11/programs/Xserver/Xext/fontcache.c b/nx-X11/programs/Xserver/Xext/fontcache.c index 9ab23a122..0956f9be9 100644 --- a/nx-X11/programs/Xserver/Xext/fontcache.c +++ b/nx-X11/programs/Xserver/Xext/fontcache.c @@ -37,8 +37,8 @@ #include #endif -#include -#include +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -48,7 +48,7 @@ #define _FONTCACHE_SERVER_ #include "fontcacheP.h" #include "fontcachstr.h" -#include +#include #include "swaprep.h" #include "modinit.h" diff --git a/nx-X11/programs/Xserver/Xext/mbuf.c b/nx-X11/programs/Xserver/Xext/mbuf.c index 37024da19..e6dec8f6f 100644 --- a/nx-X11/programs/Xserver/Xext/mbuf.c +++ b/nx-X11/programs/Xserver/Xext/mbuf.c @@ -32,8 +32,8 @@ in this Software without prior written authorization from The Open Group. #include #endif -#include -#include +#include +#include #include "window.h" #include "os.h" #include "windowstr.h" @@ -46,7 +46,7 @@ in this Software without prior written authorization from The Open Group. #include "opaque.h" #include "sleepuntil.h" #define _MULTIBUF_SERVER_ /* don't want Xlib structures */ -#include +#include #ifdef EXTMODULE #include "xf86_ansic.h" diff --git a/nx-X11/programs/Xserver/Xext/mbufbf.c b/nx-X11/programs/Xserver/Xext/mbufbf.c index 84e7ee839..318fa6756 100644 --- a/nx-X11/programs/Xserver/Xext/mbufbf.c +++ b/nx-X11/programs/Xserver/Xext/mbufbf.c @@ -34,8 +34,8 @@ in this Software without prior written authorization from The Open Group. #endif #include -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "windowstr.h" @@ -53,7 +53,7 @@ in this Software without prior written authorization from The Open Group. #define _MULTIBUF_SERVER_ /* don't want Xlib structures */ #define _MULTIBUF_BUFFER_ -#include +#include /* Support for doublebuffer hardare diff --git a/nx-X11/programs/Xserver/Xext/mbufpx.c b/nx-X11/programs/Xserver/Xext/mbufpx.c index 0973fc324..0e9ae1628 100644 --- a/nx-X11/programs/Xserver/Xext/mbufpx.c +++ b/nx-X11/programs/Xserver/Xext/mbufpx.c @@ -33,8 +33,8 @@ in this Software without prior written authorization from The Open Group. #endif #include -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "windowstr.h" @@ -51,7 +51,7 @@ in this Software without prior written authorization from The Open Group. #define _MULTIBUF_SERVER_ /* don't want Xlib structures */ #define _MULTIBUF_PIXMAP_ -#include +#include static Bool NoopDDA_True() { return TRUE; } diff --git a/nx-X11/programs/Xserver/Xext/mitmisc.c b/nx-X11/programs/Xserver/Xext/mitmisc.c index f7b0ee55c..5c5183e69 100644 --- a/nx-X11/programs/Xserver/Xext/mitmisc.c +++ b/nx-X11/programs/Xserver/Xext/mitmisc.c @@ -34,14 +34,14 @@ in this Software without prior written authorization from The Open Group. #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #define _MITMISC_SERVER_ -#include +#include #include "modinit.h" extern Bool permitOldBugs; diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index 2dc011e70..000c4bf04 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -35,9 +35,9 @@ Equipment Corporation. #define NEED_REPLIES #include -#include -#include -#include +#include +#include +#include #include "misc.h" #include "cursor.h" #include "cursorstr.h" @@ -50,7 +50,7 @@ Equipment Corporation. #include "windowstr.h" #include "pixmapstr.h" #include "panoramiX.h" -#include +#include #include "panoramiXsrv.h" #include "globals.h" #include "servermd.h" diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.h b/nx-X11/programs/Xserver/Xext/panoramiX.h index 4178b985f..3f70b6473 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.h +++ b/nx-X11/programs/Xserver/Xext/panoramiX.h @@ -43,7 +43,7 @@ Equipment Corporation. #ifndef _PANORAMIX_H_ #define _PANORAMIX_H_ -#include +#include /*#include "gcstruct.h"*/ diff --git a/nx-X11/programs/Xserver/Xext/panoramiXSwap.c b/nx-X11/programs/Xserver/Xext/panoramiXSwap.c index e0548df7b..955b81ed1 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXSwap.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXSwap.c @@ -30,8 +30,8 @@ Equipment Corporation. #endif #include -#include -#include +#include +#include #include "misc.h" #include "cursor.h" #include "cursorstr.h" @@ -45,10 +45,10 @@ Equipment Corporation. #include "pixmapstr.h" #if 0 #include -#include +#include #endif #include "panoramiX.h" -#include +#include #include "panoramiXsrv.h" #include "globals.h" #include "panoramiXh.h" diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c index 79a5a3290..2f2b2c63e 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c @@ -33,10 +33,10 @@ Equipment Corporation. #endif #include -#include +#include #define NEED_REPLIES #define NEED_EVENTS -#include +#include #include "windowstr.h" #include "dixfontstr.h" #include "gcstruct.h" diff --git a/nx-X11/programs/Xserver/Xext/sampleEVI.c b/nx-X11/programs/Xserver/Xext/sampleEVI.c index 500a585c9..598992742 100644 --- a/nx-X11/programs/Xserver/Xext/sampleEVI.c +++ b/nx-X11/programs/Xserver/Xext/sampleEVI.c @@ -27,13 +27,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#include -#include +#include +#include #include "dixstruct.h" #include "extnsionst.h" #include "dix.h" #define _XEVI_SERVER_ -#include +#include #include "EVIstruct.h" #include "scrnintstr.h" diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 4a7fc054c..ec91d080a 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -36,8 +36,8 @@ in this Software without prior written authorization from the X Consortium. #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "windowstr.h" @@ -47,7 +47,7 @@ in this Software without prior written authorization from the X Consortium. #include "dixstruct.h" #include "resource.h" #include "opaque.h" -#include +#include #include "gcstruct.h" #include "cursorstr.h" #include "colormapst.h" diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 4bc49f408..bcc8574cb 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -57,19 +57,19 @@ in this Software without prior written authorization from The Open Group. #include "colormapst.h" #include "propertyst.h" #define _SECURITY_SERVER -#include +#include #include #include #ifdef LBX #define _XLBX_SERVER_ -#include +#include extern unsigned char LbxReqCode; #endif #ifdef XAPPGROUP -#include +#include #endif #include /* for file reading operations */ -#include /* for XA_STRING */ +#include /* for XA_STRING */ #ifdef NXAGENT_SERVER @@ -91,7 +91,7 @@ extern unsigned char LbxReqCode; #endif #if defined(WIN32) || defined(__CYGWIN__) -#include +#include #undef index #endif diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index 02182398a..78d3be319 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -33,8 +33,8 @@ in this Software without prior written authorization from The Open Group. #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "windowstr.h" @@ -45,7 +45,7 @@ in this Software without prior written authorization from The Open Group. #include "resource.h" #include "opaque.h" #define _SHAPE_SERVER_ /* don't want Xlib structures */ -#include +#include #include "regionstr.h" #include "gcstruct.h" #ifdef EXTMODULE diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index d500e551c..6378a55a4 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -47,8 +47,8 @@ in this Software without prior written authorization from The Open Group. #include #define NEED_REPLIES #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -60,8 +60,8 @@ in this Software without prior written authorization from The Open Group. #include "extnsionst.h" #include "servermd.h" #define _XSHM_SERVER_ -#include -#include +#include +#include #ifdef EXTMODULE #include "xf86_ansic.h" #endif diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.c b/nx-X11/programs/Xserver/Xext/sleepuntil.c index da93806f5..62f946cf8 100644 --- a/nx-X11/programs/Xserver/Xext/sleepuntil.c +++ b/nx-X11/programs/Xserver/Xext/sleepuntil.c @@ -34,8 +34,8 @@ in this Software without prior written authorization from The Open Group. #endif #include "sleepuntil.h" -#include -#include +#include +#include #include "misc.h" #include "windowstr.h" #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 006cefa86..c122e2860 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -58,9 +58,9 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif -#include -#include -#include +#include +#include +#include #include "misc.h" #include "os.h" #include "extnsionst.h" @@ -68,8 +68,8 @@ PERFORMANCE OF THIS SOFTWARE. #include "resource.h" #include "opaque.h" #define _SYNC_SERVER -#include -#include +#include +#include #ifdef EXTMODULE #include "xf86_ansic.h" diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c index 0a9a09069..1d7ad0e09 100644 --- a/nx-X11/programs/Xserver/Xext/xcmisc.c +++ b/nx-X11/programs/Xserver/Xext/xcmisc.c @@ -34,14 +34,14 @@ from The Open Group. #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include "swaprep.h" -#include +#include #include "modinit.h" #if HAVE_STDINT_H diff --git a/nx-X11/programs/Xserver/Xext/xevie.c b/nx-X11/programs/Xserver/Xext/xevie.c index 354be121f..eb38d9223 100644 --- a/nx-X11/programs/Xserver/Xext/xevie.c +++ b/nx-X11/programs/Xserver/Xext/xevie.c @@ -38,8 +38,8 @@ of the copyright holder. #include #endif -#include -#include +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -47,13 +47,13 @@ of the copyright holder. #include "scrnintstr.h" #include "servermd.h" #define _XEVIE_SERVER_ -#include -#include +#include +#include #include "input.h" #include "inputstr.h" #include "windowstr.h" #include "cursorstr.h" -#include +#include #include "../os/osdep.h" diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index 36af17622..c0cc7f938 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -64,8 +64,8 @@ #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -74,7 +74,7 @@ #include "extnsionst.h" #define _XF86BIGFONT_SERVER_ -#include +#include static void XF86BigfontResetProc( ExtensionEntry * /* extEntry */ diff --git a/nx-X11/programs/Xserver/Xext/xf86dga.c b/nx-X11/programs/Xserver/Xext/xf86dga.c index 9979bfb30..074118c18 100644 --- a/nx-X11/programs/Xserver/Xext/xf86dga.c +++ b/nx-X11/programs/Xserver/Xext/xf86dga.c @@ -13,8 +13,8 @@ Copyright (c) 1995, 1996, 1999 XFree86 Inc #define NEED_REPLIES #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -23,8 +23,8 @@ Copyright (c) 1995, 1996, 1999 XFree86 Inc #include "scrnintstr.h" #include "servermd.h" #define _XF86DGA_SERVER_ -#include -#include +#include +#include #include "swaprep.h" #include "dgaproc.h" diff --git a/nx-X11/programs/Xserver/Xext/xf86dga2.c b/nx-X11/programs/Xserver/Xext/xf86dga2.c index 490554d9a..c2b64b048 100644 --- a/nx-X11/programs/Xserver/Xext/xf86dga2.c +++ b/nx-X11/programs/Xserver/Xext/xf86dga2.c @@ -12,8 +12,8 @@ #define NEED_REPLIES #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "dixstruct.h" #include "dixevents.h" @@ -24,8 +24,8 @@ #include "scrnintstr.h" #include "servermd.h" #define _XF86DGA_SERVER_ -#include -#include +#include +#include #include "swaprep.h" #include "dgaproc.h" #include "xf86dgaext.h" diff --git a/nx-X11/programs/Xserver/Xext/xf86misc.c b/nx-X11/programs/Xserver/Xext/xf86misc.c index 6de794e1f..ccf983fae 100644 --- a/nx-X11/programs/Xserver/Xext/xf86misc.c +++ b/nx-X11/programs/Xserver/Xext/xf86misc.c @@ -12,8 +12,8 @@ #define NEED_REPLIES #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -22,16 +22,16 @@ #include "servermd.h" #define _XF86MISC_SERVER_ #undef _XF86MISC_SAVER_COMPAT_ -#include +#include #include "swaprep.h" #include "xf86.h" -#include +#include #include "xf86miscproc.h" #if 0 -#include +#include #include "../os/osdep.h" -#include +#include #ifndef USL #ifndef Lynx #include diff --git a/nx-X11/programs/Xserver/Xext/xf86vmode.c b/nx-X11/programs/Xserver/Xext/xf86vmode.c index 979f55c00..0595343c9 100644 --- a/nx-X11/programs/Xserver/Xext/xf86vmode.c +++ b/nx-X11/programs/Xserver/Xext/xf86vmode.c @@ -39,15 +39,15 @@ from Kaleb S. KEITHLEY #define NEED_REPLIES #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" #include "scrnintstr.h" #include "servermd.h" #define _XF86VIDMODE_SERVER_ -#include +#include #include "swaprep.h" #include "xf86.h" #include "vidmodeproc.h" diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c index dc4018dd7..7b3555452 100644 --- a/nx-X11/programs/Xserver/Xext/xres.c +++ b/nx-X11/programs/Xserver/Xext/xres.c @@ -10,14 +10,14 @@ #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" #include "swaprep.h" -#include +#include #include "pixmapstr.h" #include "modinit.h" diff --git a/nx-X11/programs/Xserver/Xext/xtest.c b/nx-X11/programs/Xserver/Xext/xtest.c index 994b0c502..d9adc03c0 100644 --- a/nx-X11/programs/Xserver/Xext/xtest.c +++ b/nx-X11/programs/Xserver/Xext/xtest.c @@ -33,9 +33,9 @@ from The Open Group. #include #endif -#include +#include #define NEED_EVENTS -#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -46,11 +46,11 @@ from The Open Group. #include "dixevents.h" #include "sleepuntil.h" #define _XTEST_SERVER_ -#include -#include +#include +#include #ifdef XINPUT -#include -#include +#include +#include #define EXTENSION_EVENT_BASE 64 #include "extinit.h" /* LookupDeviceIntRec */ #endif /* XINPUT */ diff --git a/nx-X11/programs/Xserver/Xext/xtest1dd.c b/nx-X11/programs/Xserver/Xext/xtest1dd.c index c78cceed0..c945fd6bd 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1dd.c +++ b/nx-X11/programs/Xserver/Xext/xtest1dd.c @@ -66,14 +66,14 @@ University of California. #endif #include -#include -#include -#include -#include +#include +#include +#include +#include #include "misc.h" #include "dixstruct.h" #define XTestSERVER_SIDE -#include +#include #include "xtest1dd.h" diff --git a/nx-X11/programs/Xserver/Xext/xtest1di.c b/nx-X11/programs/Xserver/Xext/xtest1di.c index 985193a89..e7c3522ba 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1di.c +++ b/nx-X11/programs/Xserver/Xext/xtest1di.c @@ -67,8 +67,8 @@ University of California. #endif #include -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "gcstruct.h" @@ -76,7 +76,7 @@ University of California. #include "dixstruct.h" #include "opaque.h" #define XTestSERVER_SIDE -#include +#include #include "modinit.h" #include "xtest1dd.h" diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c index b361c0ff3..8037e6c45 100644 --- a/nx-X11/programs/Xserver/Xext/xvdisp.c +++ b/nx-X11/programs/Xserver/Xext/xvdisp.c @@ -52,8 +52,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "misc.h" #include "scrnintstr.h" #include "windowstr.h" @@ -63,12 +63,12 @@ SOFTWARE. #include "resource.h" #include "opaque.h" -#include -#include +#include +#include #include "xvdix.h" #ifdef MITSHM #define _XSHM_SERVER_ -#include +#include #endif #ifdef EXTMODULE diff --git a/nx-X11/programs/Xserver/Xext/xvdix.h b/nx-X11/programs/Xserver/Xext/xvdix.h index 99d918406..6e6e07302 100644 --- a/nx-X11/programs/Xserver/Xext/xvdix.h +++ b/nx-X11/programs/Xserver/Xext/xvdix.h @@ -54,7 +54,7 @@ SOFTWARE. */ #include "scrnintstr.h" -#include +#include extern int XvScreenIndex; extern unsigned long XvExtensionGeneration; diff --git a/nx-X11/programs/Xserver/Xext/xvmain.c b/nx-X11/programs/Xserver/Xext/xvmain.c index bbbb34dcf..571bb9c46 100644 --- a/nx-X11/programs/Xserver/Xext/xvmain.c +++ b/nx-X11/programs/Xserver/Xext/xvmain.c @@ -79,8 +79,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "scrnintstr.h" @@ -95,8 +95,8 @@ SOFTWARE. #define GLOBAL -#include -#include +#include +#include #include "xvdix.h" #ifdef EXTMODULE diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c index 30de35a2b..b1441fa1d 100644 --- a/nx-X11/programs/Xserver/Xext/xvmc.c +++ b/nx-X11/programs/Xserver/Xext/xvmc.c @@ -6,8 +6,8 @@ #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -15,11 +15,11 @@ #include "scrnintstr.h" #include "extnsionst.h" #include "servermd.h" -#include +#include #include "xvdix.h" -#include -#include -#include +#include +#include +#include #include "xvmcext.h" #ifdef HAS_XVMCSHM diff --git a/nx-X11/programs/Xserver/Xext/xvmcext.h b/nx-X11/programs/Xserver/Xext/xvmcext.h index 7cb8af24d..b92a53225 100644 --- a/nx-X11/programs/Xserver/Xext/xvmcext.h +++ b/nx-X11/programs/Xserver/Xext/xvmcext.h @@ -2,7 +2,7 @@ #ifndef _XVMC_H #define _XVMC_H -#include +#include #include "xvdix.h" typedef struct { diff --git a/nx-X11/programs/Xserver/Xext/xvmod.c b/nx-X11/programs/Xserver/Xext/xvmod.c index 7899f3a75..258023f65 100644 --- a/nx-X11/programs/Xserver/Xext/xvmod.c +++ b/nx-X11/programs/Xserver/Xext/xvmod.c @@ -4,12 +4,12 @@ #include #endif -#include +#include #include "misc.h" #include "scrnintstr.h" #include "gc.h" -#include -#include +#include +#include #include "xvdix.h" #include "xvmodproc.h" diff --git a/nx-X11/programs/Xserver/Xi/allowev.c b/nx-X11/programs/Xserver/Xi/allowev.c index c1df7eb73..8073649f1 100644 --- a/nx-X11/programs/Xserver/Xi/allowev.c +++ b/nx-X11/programs/Xserver/Xi/allowev.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/chgdctl.c b/nx-X11/programs/Xserver/Xi/chgdctl.c index 144a51ed4..c4fa46ba7 100644 --- a/nx-X11/programs/Xserver/Xi/chgdctl.c +++ b/nx-X11/programs/Xserver/Xi/chgdctl.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include /* control constants */ +#include +#include /* control constants */ #include "XIstubs.h" #include "extnsionst.h" diff --git a/nx-X11/programs/Xserver/Xi/chgfctl.c b/nx-X11/programs/Xserver/Xi/chgfctl.c index 3ffac39b3..d78b32a17 100644 --- a/nx-X11/programs/Xserver/Xi/chgfctl.c +++ b/nx-X11/programs/Xserver/Xi/chgfctl.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include /* control constants */ +#include +#include /* control constants */ #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/chgkbd.c b/nx-X11/programs/Xserver/Xi/chgkbd.c index a8a6024d8..136d257c6 100644 --- a/nx-X11/programs/Xserver/Xi/chgkbd.c +++ b/nx-X11/programs/Xserver/Xi/chgkbd.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "XIstubs.h" #include "globals.h" #include "extnsionst.h" diff --git a/nx-X11/programs/Xserver/Xi/chgkmap.c b/nx-X11/programs/Xserver/Xi/chgkmap.c index 3df376d9a..88afd9df7 100644 --- a/nx-X11/programs/Xserver/Xi/chgkmap.c +++ b/nx-X11/programs/Xserver/Xi/chgkmap.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exevents.h" diff --git a/nx-X11/programs/Xserver/Xi/chgprop.c b/nx-X11/programs/Xserver/Xi/chgprop.c index 6e345d554..47db87293 100644 --- a/nx-X11/programs/Xserver/Xi/chgprop.c +++ b/nx-X11/programs/Xserver/Xi/chgprop.c @@ -59,12 +59,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/chgptr.c b/nx-X11/programs/Xserver/Xi/chgptr.c index bf2abd6b6..925d43c07 100644 --- a/nx-X11/programs/Xserver/Xi/chgptr.c +++ b/nx-X11/programs/Xserver/Xi/chgptr.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "XIstubs.h" #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ diff --git a/nx-X11/programs/Xserver/Xi/closedev.c b/nx-X11/programs/Xserver/Xi/closedev.c index 8a57aeeee..ae46f50c6 100644 --- a/nx-X11/programs/Xserver/Xi/closedev.c +++ b/nx-X11/programs/Xserver/Xi/closedev.c @@ -59,13 +59,13 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ -#include -#include +#include +#include #include "XIstubs.h" #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/devbell.c b/nx-X11/programs/Xserver/Xi/devbell.c index 190e32086..12c444137 100644 --- a/nx-X11/programs/Xserver/Xi/devbell.c +++ b/nx-X11/programs/Xserver/Xi/devbell.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c index f0c9aea3d..ce5fe9ec9 100644 --- a/nx-X11/programs/Xserver/Xi/exevents.c +++ b/nx-X11/programs/Xserver/Xi/exevents.c @@ -59,10 +59,10 @@ SOFTWARE. #include #endif -#include -#include -#include -#include +#include +#include +#include +#include #include "inputstr.h" #include "windowstr.h" #include "miscstruct.h" diff --git a/nx-X11/programs/Xserver/Xi/extinit.c b/nx-X11/programs/Xserver/Xi/extinit.c index 0b27b5cf7..750fa46cb 100644 --- a/nx-X11/programs/Xserver/Xi/extinit.c +++ b/nx-X11/programs/Xserver/Xi/extinit.c @@ -61,13 +61,13 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "inputstr.h" #include "gcstruct.h" /* pointer for extnsionst.h*/ #include "extnsionst.h" /* extension entry */ -#include -#include +#include +#include #include "dixevents.h" #include "exevents.h" diff --git a/nx-X11/programs/Xserver/Xi/getbmap.c b/nx-X11/programs/Xserver/Xi/getbmap.c index a944d4cc8..ac2b69749 100644 --- a/nx-X11/programs/Xserver/Xi/getbmap.c +++ b/nx-X11/programs/Xserver/Xi/getbmap.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/getdctl.c b/nx-X11/programs/Xserver/Xi/getdctl.c index 527273ac4..d8c310d92 100644 --- a/nx-X11/programs/Xserver/Xi/getdctl.c +++ b/nx-X11/programs/Xserver/Xi/getdctl.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/getfctl.c b/nx-X11/programs/Xserver/Xi/getfctl.c index 5652ad303..c6cb8457c 100644 --- a/nx-X11/programs/Xserver/Xi/getfctl.c +++ b/nx-X11/programs/Xserver/Xi/getfctl.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/getfocus.c b/nx-X11/programs/Xserver/Xi/getfocus.c index 3c1597cc9..61a98f1bf 100644 --- a/nx-X11/programs/Xserver/Xi/getfocus.c +++ b/nx-X11/programs/Xserver/Xi/getfocus.c @@ -59,12 +59,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "windowstr.h" /* focus struct */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/getkmap.c b/nx-X11/programs/Xserver/Xi/getkmap.c index 4e67d9c71..fe8fd9b22 100644 --- a/nx-X11/programs/Xserver/Xi/getkmap.c +++ b/nx-X11/programs/Xserver/Xi/getkmap.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/getmmap.c b/nx-X11/programs/Xserver/Xi/getmmap.c index 6b2e38d0b..203799103 100644 --- a/nx-X11/programs/Xserver/Xi/getmmap.c +++ b/nx-X11/programs/Xserver/Xi/getmmap.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include /* Request macro */ +#include +#include /* Request macro */ #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/getprop.c b/nx-X11/programs/Xserver/Xi/getprop.c index 2b4de1f3e..ac37617ec 100644 --- a/nx-X11/programs/Xserver/Xi/getprop.c +++ b/nx-X11/programs/Xserver/Xi/getprop.c @@ -59,12 +59,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structs */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/getselev.c b/nx-X11/programs/Xserver/Xi/getselev.c index c2ec2b9d5..7cd97b5ef 100644 --- a/nx-X11/programs/Xserver/Xi/getselev.c +++ b/nx-X11/programs/Xserver/Xi/getselev.c @@ -59,10 +59,10 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ -#include -#include +#include /* for inputstr.h */ +#include /* Request macro */ +#include +#include #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window struct */ #include "extnsionst.h" diff --git a/nx-X11/programs/Xserver/Xi/getvers.c b/nx-X11/programs/Xserver/Xi/getvers.c index 3a335dd31..7743e797f 100644 --- a/nx-X11/programs/Xserver/Xi/getvers.c +++ b/nx-X11/programs/Xserver/Xi/getvers.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/grabdev.c b/nx-X11/programs/Xserver/Xi/grabdev.c index 21e920a35..865263688 100644 --- a/nx-X11/programs/Xserver/Xi/grabdev.c +++ b/nx-X11/programs/Xserver/Xi/grabdev.c @@ -60,12 +60,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/grabdevb.c b/nx-X11/programs/Xserver/Xi/grabdevb.c index ad43c29a0..9a20345be 100644 --- a/nx-X11/programs/Xserver/Xi/grabdevb.c +++ b/nx-X11/programs/Xserver/Xi/grabdevb.c @@ -59,12 +59,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ -#include -#include +#include +#include #include "exevents.h" #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/grabdevk.c b/nx-X11/programs/Xserver/Xi/grabdevk.c index 952c5d89a..73b8690b9 100644 --- a/nx-X11/programs/Xserver/Xi/grabdevk.c +++ b/nx-X11/programs/Xserver/Xi/grabdevk.c @@ -59,12 +59,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ -#include -#include +#include +#include #include "exevents.h" #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/gtmotion.c b/nx-X11/programs/Xserver/Xi/gtmotion.c index 02b1fee32..ec26ae407 100644 --- a/nx-X11/programs/Xserver/Xi/gtmotion.c +++ b/nx-X11/programs/Xserver/Xi/gtmotion.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exevents.h" diff --git a/nx-X11/programs/Xserver/Xi/listdev.c b/nx-X11/programs/Xserver/Xi/listdev.c index 6228352f5..e99584d0e 100644 --- a/nx-X11/programs/Xserver/Xi/listdev.c +++ b/nx-X11/programs/Xserver/Xi/listdev.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "XIstubs.h" #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/opendev.c b/nx-X11/programs/Xserver/Xi/opendev.c index 520c6832a..054dae159 100644 --- a/nx-X11/programs/Xserver/Xi/opendev.c +++ b/nx-X11/programs/Xserver/Xi/opendev.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "XIstubs.h" #include "windowstr.h" /* window structure */ #include "extnsionst.h" diff --git a/nx-X11/programs/Xserver/Xi/queryst.c b/nx-X11/programs/Xserver/Xi/queryst.c index 34b140c8e..af2b4301d 100644 --- a/nx-X11/programs/Xserver/Xi/queryst.c +++ b/nx-X11/programs/Xserver/Xi/queryst.c @@ -40,12 +40,12 @@ from The Open Group. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exevents.h" diff --git a/nx-X11/programs/Xserver/Xi/selectev.c b/nx-X11/programs/Xserver/Xi/selectev.c index a9b731864..de29fcf59 100644 --- a/nx-X11/programs/Xserver/Xi/selectev.c +++ b/nx-X11/programs/Xserver/Xi/selectev.c @@ -60,12 +60,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exevents.h" diff --git a/nx-X11/programs/Xserver/Xi/sendexev.c b/nx-X11/programs/Xserver/Xi/sendexev.c index 0b2a701bb..9decfadab 100644 --- a/nx-X11/programs/Xserver/Xi/sendexev.c +++ b/nx-X11/programs/Xserver/Xi/sendexev.c @@ -60,12 +60,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* Window */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exevents.h" diff --git a/nx-X11/programs/Xserver/Xi/setbmap.c b/nx-X11/programs/Xserver/Xi/setbmap.c index 37db5110d..74b8e3c05 100644 --- a/nx-X11/programs/Xserver/Xi/setbmap.c +++ b/nx-X11/programs/Xserver/Xi/setbmap.c @@ -62,11 +62,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "exevents.h" #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/setdval.c b/nx-X11/programs/Xserver/Xi/setdval.c index 9b5b1e20d..04f55d4fc 100644 --- a/nx-X11/programs/Xserver/Xi/setdval.c +++ b/nx-X11/programs/Xserver/Xi/setdval.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "XIstubs.h" #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/setfocus.c b/nx-X11/programs/Xserver/Xi/setfocus.c index a1dd09d71..b9a495612 100644 --- a/nx-X11/programs/Xserver/Xi/setfocus.c +++ b/nx-X11/programs/Xserver/Xi/setfocus.c @@ -59,12 +59,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "windowstr.h" /* focus struct */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "dixevents.h" diff --git a/nx-X11/programs/Xserver/Xi/setmmap.c b/nx-X11/programs/Xserver/Xi/setmmap.c index 3fa2c7e7e..9fd8e7244 100644 --- a/nx-X11/programs/Xserver/Xi/setmmap.c +++ b/nx-X11/programs/Xserver/Xi/setmmap.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "exevents.h" #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/setmode.c b/nx-X11/programs/Xserver/Xi/setmode.c index f95ef5514..17c46515d 100644 --- a/nx-X11/programs/Xserver/Xi/setmode.c +++ b/nx-X11/programs/Xserver/Xi/setmode.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ -#include -#include +#include +#include #include "XIstubs.h" #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ diff --git a/nx-X11/programs/Xserver/Xi/stubs.c b/nx-X11/programs/Xserver/Xi/stubs.c index 2d9aad08b..33c55d3b7 100644 --- a/nx-X11/programs/Xserver/Xi/stubs.c +++ b/nx-X11/programs/Xserver/Xi/stubs.c @@ -62,11 +62,11 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "inputstr.h" -#include -#include +#include +#include #include "XIstubs.h" /*********************************************************************** diff --git a/nx-X11/programs/Xserver/Xi/ungrdev.c b/nx-X11/programs/Xserver/Xi/ungrdev.c index 8de4cd225..b318fa044 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdev.c +++ b/nx-X11/programs/Xserver/Xi/ungrdev.c @@ -59,11 +59,11 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ -#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/ungrdevb.c b/nx-X11/programs/Xserver/Xi/ungrdevb.c index 8927a5c6e..a76f9692c 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdevb.c +++ b/nx-X11/programs/Xserver/Xi/ungrdevb.c @@ -59,12 +59,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/Xi/ungrdevk.c b/nx-X11/programs/Xserver/Xi/ungrdevk.c index 38cfa1b71..928b602f1 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdevk.c +++ b/nx-X11/programs/Xserver/Xi/ungrdevk.c @@ -59,12 +59,12 @@ SOFTWARE. #include #endif -#include /* for inputstr.h */ -#include /* Request macro */ +#include /* for inputstr.h */ +#include /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ -#include -#include +#include +#include #include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" diff --git a/nx-X11/programs/Xserver/composite/compint.h b/nx-X11/programs/Xserver/composite/compint.h index 9a6a22f48..262d95108 100644 --- a/nx-X11/programs/Xserver/composite/compint.h +++ b/nx-X11/programs/Xserver/composite/compint.h @@ -50,7 +50,7 @@ #include "damage.h" #include "damageextint.h" #include "xfixes.h" -#include +#include #include /* diff --git a/nx-X11/programs/Xserver/damageext/damageextint.h b/nx-X11/programs/Xserver/damageext/damageextint.h index ab00effe3..d2f9d71ac 100644 --- a/nx-X11/programs/Xserver/damageext/damageextint.h +++ b/nx-X11/programs/Xserver/damageext/damageextint.h @@ -30,8 +30,8 @@ #define _DAMAGEEXTINT_H_ #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index ad5294a4c..064987dec 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -41,8 +41,8 @@ #include #endif -#include -#include +#include +#include #include "scrnintstr.h" #include "extnsionst.h" #include "gcstruct.h" diff --git a/nx-X11/programs/Xserver/dbe/dbestruct.h b/nx-X11/programs/Xserver/dbe/dbestruct.h index 69135a837..43c4c525b 100644 --- a/nx-X11/programs/Xserver/dbe/dbestruct.h +++ b/nx-X11/programs/Xserver/dbe/dbestruct.h @@ -39,7 +39,7 @@ /* INCLUDES */ #define NEED_DBE_PROTOCOL -#include +#include #include "windowstr.h" diff --git a/nx-X11/programs/Xserver/dbe/midbe.c b/nx-X11/programs/Xserver/dbe/midbe.c index 042f95953..b8383e11a 100644 --- a/nx-X11/programs/Xserver/dbe/midbe.c +++ b/nx-X11/programs/Xserver/dbe/midbe.c @@ -41,8 +41,8 @@ #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "windowstr.h" diff --git a/nx-X11/programs/Xserver/dix/atom.c b/nx-X11/programs/Xserver/dix/atom.c index 207174280..583f2dafc 100644 --- a/nx-X11/programs/Xserver/dix/atom.c +++ b/nx-X11/programs/Xserver/dix/atom.c @@ -52,8 +52,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "misc.h" #include "resource.h" #include "dix.h" diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index 32d9bae89..11a353f84 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -53,9 +53,9 @@ SOFTWARE. #include #endif -#include +#include #define NEED_EVENTS -#include +#include #include "misc.h" #include "dix.h" #include "colormapst.h" diff --git a/nx-X11/programs/Xserver/dix/cursor.c b/nx-X11/programs/Xserver/dix/cursor.c index 187dd62c5..1e1dba36b 100644 --- a/nx-X11/programs/Xserver/dix/cursor.c +++ b/nx-X11/programs/Xserver/dix/cursor.c @@ -53,8 +53,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "servermd.h" #include "scrnintstr.h" #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index 917a3849a..91a92644c 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -54,12 +54,12 @@ SOFTWARE. #include #endif -#include +#include #include "misc.h" #include "resource.h" #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "windowstr.h" #include "inputstr.h" #include "scrnintstr.h" @@ -68,11 +68,11 @@ SOFTWARE. #include "site.h" #define XKB_IN_SERVER #ifdef XKB -#include +#include #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef LBX #include "lbxserve.h" diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 71c22ae0e..b6010e627 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -109,15 +109,15 @@ int ProcInitialConnection(); #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef XAPPGROUP -#include +#include #endif #ifdef XKB #define XKB_IN_SERVER #include "inputstr.h" -#include +#include #endif #ifdef LBX #include "lbxserve.h" diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index fac918963..6e515300d 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -56,9 +56,9 @@ Equipment Corporation. #include #endif -#include -#include -#include +#include +#include +#include #include "scrnintstr.h" #include "resource.h" #include "dixstruct.h" @@ -139,7 +139,7 @@ _NXGetFontPathError: #ifdef XF86BIGFONT #define _XF86BIGFONT_SERVER_ -#include +#include #endif #define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index f3b3373d0..8bcfce619 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -88,18 +88,18 @@ Author: Adobe Systems Incorporated #include #endif -#include -#include +#include +#include #include "misc.h" #include "windowstr.h" #include "dixstruct.h" #include "pixmapstr.h" #include "scrnintstr.h" #define XK_LATIN1 -#include +#include #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif /* diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index ab995a772..1166bf84b 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -115,12 +115,12 @@ of the copyright holder. #include #endif -#include +#include #include "misc.h" #include "resource.h" #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "windowstr.h" #include "inputstr.h" #include "scrnintstr.h" @@ -134,13 +134,13 @@ of the copyright holder. #include "globals.h" #ifdef XKB -#include +#include extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef XEVIE @@ -157,7 +157,7 @@ int xeviegrabState = 0; xEvent *xeviexE; #endif -#include +#include #include "exevents.h" #include "extnsionst.h" diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c index 19333c151..dd6de9c63 100644 --- a/nx-X11/programs/Xserver/dix/extension.c +++ b/nx-X11/programs/Xserver/dix/extension.c @@ -51,10 +51,10 @@ SOFTWARE. #include #endif -#include +#include #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -63,7 +63,7 @@ SOFTWARE. #include "dispatch.h" #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef LBX #include "lbxserve.h" diff --git a/nx-X11/programs/Xserver/dix/gc.c b/nx-X11/programs/Xserver/dix/gc.c index 834919946..2c17de3d6 100644 --- a/nx-X11/programs/Xserver/dix/gc.c +++ b/nx-X11/programs/Xserver/dix/gc.c @@ -52,9 +52,9 @@ SOFTWARE. #include #endif -#include -#include -#include +#include +#include +#include #include "misc.h" #include "resource.h" #include "gcstruct.h" diff --git a/nx-X11/programs/Xserver/dix/globals.c b/nx-X11/programs/Xserver/dix/globals.c index 15eedf602..e4f43fd01 100644 --- a/nx-X11/programs/Xserver/dix/globals.c +++ b/nx-X11/programs/Xserver/dix/globals.c @@ -53,8 +53,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "misc.h" #include "windowstr.h" #include "scrnintstr.h" diff --git a/nx-X11/programs/Xserver/dix/grabs.c b/nx-X11/programs/Xserver/dix/grabs.c index e133c0dfc..839e930b1 100644 --- a/nx-X11/programs/Xserver/dix/grabs.c +++ b/nx-X11/programs/Xserver/dix/grabs.c @@ -52,10 +52,10 @@ SOFTWARE. #include #endif -#include +#include #include "misc.h" #define NEED_EVENTS -#include +#include #include "windowstr.h" #include "inputstr.h" #include "cursorstr.h" diff --git a/nx-X11/programs/Xserver/dix/initatoms.c b/nx-X11/programs/Xserver/dix/initatoms.c index a5972afd6..5f6244a76 100644 --- a/nx-X11/programs/Xserver/dix/initatoms.c +++ b/nx-X11/programs/Xserver/dix/initatoms.c @@ -7,8 +7,8 @@ #include #endif -#include -#include +#include +#include #include "misc.h" #include "dix.h" void MakePredeclaredAtoms() diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c index 954c260c2..6a5b0021d 100644 --- a/nx-X11/programs/Xserver/dix/main.c +++ b/nx-X11/programs/Xserver/dix/main.c @@ -84,9 +84,9 @@ Equipment Corporation. #include #endif -#include -#include /* for unistd.h */ -#include +#include +#include /* for unistd.h */ +#include #include "scrnintstr.h" #include "misc.h" #include "os.h" @@ -113,7 +113,7 @@ Equipment Corporation. #ifdef DPMSExtension #define DPMS_SERVER -#include +#include #include "dpmsproc.h" #endif diff --git a/nx-X11/programs/Xserver/dix/pixmap.c b/nx-X11/programs/Xserver/dix/pixmap.c index 7888cf90a..463e31598 100644 --- a/nx-X11/programs/Xserver/dix/pixmap.c +++ b/nx-X11/programs/Xserver/dix/pixmap.c @@ -32,7 +32,7 @@ from The Open Group. #include #endif -#include +#include #include "scrnintstr.h" #include "misc.h" #include "os.h" diff --git a/nx-X11/programs/Xserver/dix/privates.c b/nx-X11/programs/Xserver/dix/privates.c index 36bbc65d1..d08883d1d 100644 --- a/nx-X11/programs/Xserver/dix/privates.c +++ b/nx-X11/programs/Xserver/dix/privates.c @@ -33,7 +33,7 @@ from The Open Group. #include #endif -#include +#include #include "scrnintstr.h" #include "misc.h" #include "os.h" diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index f462a3ebd..51cbc1a0d 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -51,10 +51,10 @@ SOFTWARE. #include #endif -#include +#include #define NEED_REPLIES #define NEED_EVENTS -#include +#include #include "windowstr.h" #include "propertyst.h" #include "dixstruct.h" @@ -62,7 +62,7 @@ SOFTWARE. #include "swaprep.h" #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef LBX #include "lbxserve.h" diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index e0fc2b997..ed8a255f5 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -106,7 +106,7 @@ Equipment Corporation. #include #endif -#include +#include #include "misc.h" #include "os.h" #include "resource.h" diff --git a/nx-X11/programs/Xserver/dix/swaprep.c b/nx-X11/programs/Xserver/dix/swaprep.c index 9776cd437..b8f245408 100644 --- a/nx-X11/programs/Xserver/dix/swaprep.c +++ b/nx-X11/programs/Xserver/dix/swaprep.c @@ -52,10 +52,10 @@ SOFTWARE. #include #endif -#include +#include #define NEED_REPLIES #define NEED_EVENTS -#include +#include #include "misc.h" #include "dixstruct.h" #include diff --git a/nx-X11/programs/Xserver/dix/swapreq.c b/nx-X11/programs/Xserver/dix/swapreq.c index 7d57d551f..35a7e7527 100644 --- a/nx-X11/programs/Xserver/dix/swapreq.c +++ b/nx-X11/programs/Xserver/dix/swapreq.c @@ -52,10 +52,10 @@ SOFTWARE. #include #endif -#include +#include #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" /* for SendEvent */ diff --git a/nx-X11/programs/Xserver/dix/tables.c b/nx-X11/programs/Xserver/dix/tables.c index 5196f0e85..eb4f4c8d2 100644 --- a/nx-X11/programs/Xserver/dix/tables.c +++ b/nx-X11/programs/Xserver/dix/tables.c @@ -51,10 +51,10 @@ SOFTWARE. #include #endif -#include +#include #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "windowstr.h" #include "extnsionst.h" #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index 340ca50cc..5854f2e95 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -105,11 +105,11 @@ Equipment Corporation. #include "globals.h" #ifdef XAPPGROUP -#include +#include #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif /****** diff --git a/nx-X11/programs/Xserver/fb/fb.h b/nx-X11/programs/Xserver/fb/fb.h index 202638d32..b64f3a227 100644 --- a/nx-X11/programs/Xserver/fb/fb.h +++ b/nx-X11/programs/Xserver/fb/fb.h @@ -27,7 +27,7 @@ #ifndef _FB_H_ #define _FB_H_ -#include +#include #include "scrnintstr.h" #include "pixmap.h" #include "pixmapstr.h" diff --git a/nx-X11/programs/Xserver/fb/fbcmap.c b/nx-X11/programs/Xserver/fb/fbcmap.c index 762c51c9d..a7c8ca638 100644 --- a/nx-X11/programs/Xserver/fb/fbcmap.c +++ b/nx-X11/programs/Xserver/fb/fbcmap.c @@ -34,8 +34,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#include -#include +#include +#include #include "scrnintstr.h" #include "colormapst.h" #include "resource.h" diff --git a/nx-X11/programs/Xserver/fb/fbpseudocolor.c b/nx-X11/programs/Xserver/fb/fbpseudocolor.c index 83d556a0e..469f3ea08 100644 --- a/nx-X11/programs/Xserver/fb/fbpseudocolor.c +++ b/nx-X11/programs/Xserver/fb/fbpseudocolor.c @@ -2,8 +2,8 @@ #include #endif -#include -#include +#include +#include #include "scrnintstr.h" #include "colormapst.h" #include "glyphstr.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Agent.h b/nx-X11/programs/Xserver/hw/nxagent/Agent.h index dbed1e0d8..ec312bad2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Agent.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Agent.h @@ -103,8 +103,8 @@ typedef XID KeySym64; #define NX_TRANS_SOCKET #define GC XlibGC -#include "Xlib.h" -#include "X11/extensions/shape.h" +#include +#include #undef GC #ifdef _XSERVER64_tmp diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 557798e7f..21bcc60e5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -33,7 +33,7 @@ #include "gcstruct.h" #include "xfixeswire.h" -#include +#include /* * Use asyncronous get property replies. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c index 0fb9491a4..63c3b73c1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c @@ -25,7 +25,7 @@ #include "scrnintstr.h" #include "Agent.h" -#include +#include #include "opaque.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 862ce57d0..abc6a9380 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -38,8 +38,8 @@ is" without express or implied warranty. #include #include -#include -#include +#include +#include #include "screenint.h" #include "input.h" #include "misc.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index c33564092..d965d574c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -66,7 +66,7 @@ #define Window XlibWindow #define Atom XlibAtom #define Time XlibXID -#include +#include #undef Window #undef Atom #undef Time @@ -90,10 +90,10 @@ #undef KeySym #undef XID -#include +#include #include "Shadow.h" -#include +#include "X11/include/Xrandr_nxagent.h" #include "NXlib.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.h b/nx-X11/programs/Xserver/hw/nxagent/Events.h index c74fa151f..02b2b8cbe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.h @@ -18,7 +18,7 @@ #ifndef __Events_H__ #define __Events_H__ -#include +#include #define ProcessedExpose (LASTEvent + 1) #define ProcessedNotify (LASTEvent + 2) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Holder.c b/nx-X11/programs/Xserver/hw/nxagent/Holder.c index 4aca1ecdb..64ffb24a4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Holder.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Holder.c @@ -33,7 +33,7 @@ #include "../../include/gc.h" #include "../../include/window.h" -#include +#include "X11/include/xpm_nxagent.h" #include "Agent.h" #include "Pixmaps.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Icons.h b/nx-X11/programs/Xserver/hw/nxagent/Icons.h index 98e879662..b307f42e6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Icons.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Icons.h @@ -19,7 +19,7 @@ #define __Icons_H__ #define Pixel XpmPixel -#include +#include "X11/include/xpm_nxagent.h" #undef Pixel #define NXAGENT_ICON_NAME "nxagent.xpm" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 835aebeb6..9ead48de1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -64,13 +64,13 @@ is" without express or implied warranty. #include "property.h" #include "Init.h" -#include +#include #define XKBSRV_NEED_FILE_FUNCS -#include -#include +#include +#include -#include "X11/extensions/XKBrules.h" +#include #include "Xatom.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXcomposite.h b/nx-X11/programs/Xserver/hw/nxagent/NXcomposite.h index d11561e18..a274b8a39 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXcomposite.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXcomposite.h @@ -33,12 +33,12 @@ #else -#include -#include +#include +#include #endif -#include +#include /* * This revision number also appears in configure.ac, they have diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXcompositeext.h b/nx-X11/programs/Xserver/hw/nxagent/NXcompositeext.h index 8667ded16..b4433d6c1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXcompositeext.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXcompositeext.h @@ -27,7 +27,7 @@ #ifndef NXAGENT_SERVER -#include +#include #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index af76ed4c2..704bfcc0d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -109,12 +109,13 @@ int ProcInitialConnection(); #define True 1 #endif +#include + #define GC XlibGC -#include +#include #undef GC #include "windowstr.h" -#include #include "dixfontstr.h" #include "gcstruct.h" #include "selection.h" @@ -135,15 +136,15 @@ int ProcInitialConnection(); #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef XAPPGROUP -#include +#include #endif #ifdef XKB #define XKB_IN_SERVER #include "inputstr.h" -#include +#include #endif #include "Atoms.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 4f41ee228..2f3a75147 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -73,16 +73,16 @@ Equipment Corporation. #include #endif -#include -#include -#include +#include +#include +#include +#include #include "scrnintstr.h" #include "resource.h" #include "dixstruct.h" #include "cursorstr.h" #include "misc.h" #include "opaque.h" -#include #include "dixfontstr.h" #include "closestr.h" @@ -172,7 +172,7 @@ _NXGetFontPathError: #ifdef XF86BIGFONT #define _XF86BIGFONT_SERVER_ -#include +#include #endif #define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index 5940fe7d1..11ff62947 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -132,13 +132,13 @@ of the copyright holder. #include #endif -#include +#include #include "Xlib.h" #include "misc.h" #include "resource.h" #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "windowstr.h" #include "inputstr.h" #include "scrnintstr.h" @@ -152,13 +152,13 @@ of the copyright holder. #include "globals.h" #ifdef XKB -#include +#include extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef XEVIE @@ -175,7 +175,7 @@ int xeviegrabState = 0; xEvent *xeviexE; #endif -#include +#include #include "exevents.h" #include "extnsionst.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c index f964e2fd8..962367bf2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c @@ -68,10 +68,10 @@ SOFTWARE. #include #endif -#include +#include #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -80,7 +80,7 @@ SOFTWARE. #include "../../dix/dispatch.h" #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef LBX #include "lbxserve.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h index e7bb2d841..5d7fcf640 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h @@ -50,7 +50,7 @@ #ifndef _GLYPHSTR_H_ #define _GLYPHSTR_H_ -#include +#include #include "../../render/picture.h" #include "screenint.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c index e1c6b6d8c..aa3c606f8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c @@ -97,10 +97,10 @@ Equipment Corporation. #include #endif -#include +#include #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "regionstr.h" @@ -112,7 +112,7 @@ Equipment Corporation. #include "dixstruct.h" #include "mi.h" -#include +#include #include "globals.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c index 8132e9dd0..a720cafbf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c @@ -67,7 +67,7 @@ SOFTWARE. #include #endif -#include +#include #include "regionstr.h" #include "region.h" #include "mi.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index a2d4a8e52..d6c5aa4dd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -68,10 +68,10 @@ SOFTWARE. #include #endif -#include +#include #define NEED_REPLIES #define NEED_EVENTS -#include +#include #include "windowstr.h" #include "propertyst.h" #include "dixstruct.h" @@ -79,7 +79,7 @@ SOFTWARE. #include "swaprep.h" #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef LBX #include "lbxserve.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index 260355c6e..dc1d2387e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -47,8 +47,8 @@ #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -59,9 +59,9 @@ #include "colormapst.h" #include "extnsionst.h" #include "servermd.h" -#include -#include -#include +#include +#include +#include #include "cursorstr.h" #ifdef EXTMODULE #include "xf86_ansic.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c index 833a33fd3..39a1992de 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c @@ -123,7 +123,7 @@ Equipment Corporation. #include #endif -#include +#include #include "misc.h" #include "os.h" #include "resource.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index 3b40b82f7..95905fde7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -64,8 +64,8 @@ in this Software without prior written authorization from The Open Group. #include #define NEED_REPLIES #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -77,8 +77,8 @@ in this Software without prior written authorization from The Open Group. #include "extnsionst.h" #include "servermd.h" #define _XSHM_SERVER_ -#include -#include +#include +#include #ifdef EXTMODULE #include "xf86_ansic.h" #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 4017099e9..4552ad563 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -123,11 +123,11 @@ Equipment Corporation. #include "globals.h" #ifdef XAPPGROUP -#include +#include #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #include "Screen.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c index cfce34463..1724374a0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c @@ -71,8 +71,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "misc.h" #include "scrnintstr.h" #include "windowstr.h" @@ -82,12 +82,12 @@ SOFTWARE. #include "resource.h" #include "opaque.h" -#include -#include +#include +#include #include "xvdix.h" #ifdef MITSHM #define _XSHM_SERVER_ -#include +#include #endif #include "Trap.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 095aa7b08..491a92c2f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -77,13 +77,13 @@ is" without express or implied warranty. #include "Shadow.h" #include "Utils.h" -#include +#include "X11/include/Xrandr_nxagent.h" #define GC XlibGC #define Font XlibFont #define KeySym XlibKeySym #define XID XlibXID -#include +#include #undef GC #undef Font #undef KeySym diff --git a/nx-X11/programs/Xserver/hw/nxagent/TestExt.c b/nx-X11/programs/Xserver/hw/nxagent/TestExt.c index 6bce2eaeb..30fe1968e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/TestExt.c +++ b/nx-X11/programs/Xserver/hw/nxagent/TestExt.c @@ -29,9 +29,9 @@ is" without express or implied warranty. */ -#include -#include -#include +#include +#include +#include #undef Bool #include "screenint.h" #include "input.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/X11/include/Xrandr_nxagent.h b/nx-X11/programs/Xserver/hw/nxagent/X11/include/Xrandr_nxagent.h new file mode 100644 index 000000000..acfc5834e --- /dev/null +++ b/nx-X11/programs/Xserver/hw/nxagent/X11/include/Xrandr_nxagent.h @@ -0,0 +1,105 @@ +/* + * Copyright © 2000 Compaq Computer Corporation, Inc. + * Copyright © 2002 Hewlett-Packard Company, Inc. + * Copyright © 2006 Intel Corporation + * Copyright © 2008 Red Hat, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + * + * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. + * Keith Packard, Intel Corporation + */ + +/* + * This file is a reduced version of the header file of + * + * + * This copy of code has been introduced to allow a clear namespace + * separation between and header files. + * + * This version of the Xrandr library header file only contains symbols + * required by nxagent and strictly avoids indirectly including + * from an X11 library that is also shipped in nx-X11/lib/. + * + * When using instead for inclusion in + * nxagent, it will attempt pulling in the + * header which in turn will include . However, the headers of + * the same name from should be used instead. + * + * FIXME: Once the nxagent Xserver starts using libXrender from X.Org, this + * hack can be removed. + * + * 2015/06/26, Mike Gabriel + */ + +#ifndef _XRANDR_H_ +#define _XRANDR_H_ + +#include +#include + +_XFUNCPROTOBEGIN + +typedef XID RRProvider; +typedef XID RRMode; + +/* + * Events. + */ + +typedef struct { + int type; /* event base */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* window which selected for this event */ + Window root; /* Root window for changed screen */ + Time timestamp; /* when the screen change occurred */ + Time config_timestamp; /* when the last configuration change */ + SizeID size_index; + SubpixelOrder subpixel_order; + Rotation rotation; + int width; + int height; + int mwidth; + int mheight; +} XRRScreenChangeNotifyEvent; + +typedef unsigned long XRRModeFlags; + +typedef struct _XRRModeInfo { + RRMode id; + unsigned int width; + unsigned int height; + unsigned long dotClock; + unsigned int hSyncStart; + unsigned int hSyncEnd; + unsigned int hTotal; + unsigned int hSkew; + unsigned int vSyncStart; + unsigned int vSyncEnd; + unsigned int vTotal; + char *name; + unsigned int nameLength; + XRRModeFlags modeFlags; +} XRRModeInfo; + +_XFUNCPROTOEND + +#endif /* _XRANDR_H_ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X11/include/xpm_nxagent.h b/nx-X11/programs/Xserver/hw/nxagent/X11/include/xpm_nxagent.h new file mode 100644 index 000000000..b02e5a913 --- /dev/null +++ b/nx-X11/programs/Xserver/hw/nxagent/X11/include/xpm_nxagent.h @@ -0,0 +1,259 @@ +/* + * Copyright (C) 1989-95 GROUPE BULL + * + * 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 + * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of GROUPE BULL shall not be + * used in advertising or otherwise to promote the sale, use or other dealings + * in this Software without prior written authorization from GROUPE BULL. + */ + +/*****************************************************************************\ +* xpm.h: * +* * +* XPM library * +* Include file * +* * +* Developed by Arnaud Le Hors * +\*****************************************************************************/ + +/* + * This file is a reduced version of the header file of + * + * + * This copy of code has been introduced to allow a clear namespace + * separation between and header files. + * + * This version of the Xpm library header file only contains symbols + * required by nxagent and strictly avoids indirectly including + * from an X11 library that is also shipped in nx-X11/lib/. + * + * When using instead for inclusion in nxagent, it will + * attempt pulling in the header file. + * However, the headers of the same name from should be + * used instead. + * + * FIXME: Once the nxagent Xserver starts using libX11 from X.Org, this + * hack can be removed. + * + * 2015/06/26, Mike Gabriel + */ + +#ifndef XPM_h +#define XPM_h + +/* + * first some identification numbers: + * the version and revision numbers are determined with the following rule: + * SO Major number = LIB minor version number. + * SO Minor number = LIB sub-minor version number. + * e.g: Xpm version 3.2f + * we forget the 3 which is the format number, 2 gives 2, and f gives 6. + * thus we have XpmVersion = 2 and XpmRevision = 6 + * which gives SOXPMLIBREV = 2.6 + * + * Then the XpmIncludeVersion number is built from these numbers. + */ +#define XpmFormat 3 +#define XpmVersion 4 +#define XpmRevision 11 +#define XpmIncludeVersion ((XpmFormat * 100 + XpmVersion) * 100 + XpmRevision) + +#ifndef XPM_NUMBERS + +/* let's define Pixel if it is not done yet */ +#if ! defined(_XtIntrinsic_h) && ! defined(PIXEL_ALREADY_TYPEDEFED) +typedef unsigned long Pixel; /* Index into colormap */ +# define PIXEL_ALREADY_TYPEDEFED +#endif + +/* include headers from instead of */ +#include +#include + +/* Return ErrorStatus codes: + * null if full success + * positive if partial success + * negative if failure + */ + +#define XpmColorError 1 +#define XpmSuccess 0 +#define XpmOpenFailed -1 +#define XpmFileInvalid -2 +#define XpmNoMemory -3 +#define XpmColorFailed -4 + +typedef struct { + char *name; /* Symbolic color name */ + char *value; /* Color value */ + Pixel pixel; /* Color pixel */ +} XpmColorSymbol; + +typedef struct { + char *name; /* name of the extension */ + unsigned int nlines; /* number of lines in this extension */ + char **lines; /* pointer to the extension array of strings */ +} XpmExtension; + +typedef struct { + char *string; /* characters string */ + char *symbolic; /* symbolic name */ + char *m_color; /* monochrom default */ + char *g4_color; /* 4 level grayscale default */ + char *g_color; /* other level grayscale default */ + char *c_color; /* color default */ +} XpmColor; + +typedef struct { + unsigned int width; /* image width */ + unsigned int height; /* image height */ + unsigned int cpp; /* number of characters per pixel */ + unsigned int ncolors; /* number of colors */ + XpmColor *colorTable; /* list of related colors */ + unsigned int *data; /* image data */ +} XpmImage; + +typedef struct { + unsigned long valuemask; /* Specifies which attributes are defined */ + char *hints_cmt; /* Comment of the hints section */ + char *colors_cmt; /* Comment of the colors section */ + char *pixels_cmt; /* Comment of the pixels section */ + unsigned int x_hotspot; /* Returns the x hotspot's coordinate */ + unsigned int y_hotspot; /* Returns the y hotspot's coordinate */ + unsigned int nextensions; /* number of extensions */ + XpmExtension *extensions; /* pointer to array of extensions */ +} XpmInfo; + +typedef int (*XpmAllocColorFunc)( + Display* /* display */, + Colormap /* colormap */, + char* /* colorname */, + XColor* /* xcolor */, + void* /* closure */ +); + +typedef int (*XpmFreeColorsFunc)( + Display* /* display */, + Colormap /* colormap */, + Pixel* /* pixels */, + int /* npixels */, + void* /* closure */ +); + + +/* required struct for hw/nxagent/Holder.c */ +typedef struct { + unsigned long valuemask; /* Specifies which attributes are + defined */ + + Visual *visual; /* Specifies the visual to use */ + Colormap colormap; /* Specifies the colormap to use */ + unsigned int depth; /* Specifies the depth */ + unsigned int width; /* Returns the width of the created + pixmap */ + unsigned int height; /* Returns the height of the created + pixmap */ + unsigned int x_hotspot; /* Returns the x hotspot's + coordinate */ + unsigned int y_hotspot; /* Returns the y hotspot's + coordinate */ + unsigned int cpp; /* Specifies the number of char per + pixel */ + Pixel *pixels; /* List of used color pixels */ + unsigned int npixels; /* Number of used pixels */ + XpmColorSymbol *colorsymbols; /* List of color symbols to override */ + unsigned int numsymbols; /* Number of symbols */ + char *rgb_fname; /* RGB text file name */ + unsigned int nextensions; /* Number of extensions */ + XpmExtension *extensions; /* List of extensions */ + + unsigned int ncolors; /* Number of colors */ + XpmColor *colorTable; /* List of colors */ +/* 3.2 backward compatibility code */ + char *hints_cmt; /* Comment of the hints section */ + char *colors_cmt; /* Comment of the colors section */ + char *pixels_cmt; /* Comment of the pixels section */ +/* end 3.2 bc */ + unsigned int mask_pixel; /* Color table index of transparent + color */ + + /* Color Allocation Directives */ + Bool exactColors; /* Only use exact colors for visual */ + unsigned int closeness; /* Allowable RGB deviation */ + unsigned int red_closeness; /* Allowable red deviation */ + unsigned int green_closeness; /* Allowable green deviation */ + unsigned int blue_closeness; /* Allowable blue deviation */ + int color_key; /* Use colors from this color set */ + + Pixel *alloc_pixels; /* Returns the list of alloc'ed color + pixels */ + int nalloc_pixels; /* Returns the number of alloc'ed + color pixels */ + + Bool alloc_close_colors; /* Specify whether close colors should + be allocated using XAllocColor + or not */ + int bitmap_format; /* Specify the format of 1bit depth + images: ZPixmap or XYBitmap */ + + /* Color functions */ + XpmAllocColorFunc alloc_color; /* Application color allocator */ + XpmFreeColorsFunc free_colors; /* Application color de-allocator */ + void *color_closure; /* Application private data to pass to + alloc_color and free_colors */ + +} XpmAttributes; + +/* XpmAttributes value masks bits */ + +/* required masks bits for hw/nxagent/Holder.c */ +#define XpmDepth (1L<<2) +#define XpmSize (1L<<3) /* width & height */ + +/* macros for forward declarations of functions with prototypes */ +#define FUNC(f, t, p) extern t f p +#define LFUNC(f, t, p) static t f p + + +/* + * functions declarations (for building nxagent against system wide libXpm4, + * but also against libNX_X11 (as opposed to system-wide libX11). + */ + +_XFUNCPROTOBEGIN + +/* Keep for hw/nxagent/Holder.c */ +FUNC(XpmCreatePixmapFromData, int, (Display *display, + Drawable d, + char **data, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes)); +/* Keep for hw/nxagent/Display.c */ +FUNC(XpmReadFileToPixmap, int, (Display *display, + Drawable d, + const char *filename, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes)); + +_XFUNCPROTOEND + +#endif /* XPM_NUMBERS */ +#endif diff --git a/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_libc.h b/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_libc.h index c51e0ee14..ca68c1b63 100644 --- a/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_libc.h +++ b/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_libc.h @@ -45,7 +45,7 @@ #ifndef XF86_LIBC_H #define XF86_LIBC_H 1 -#include +#include #include /* diff --git a/nx-X11/programs/Xserver/include/Imakefile b/nx-X11/programs/Xserver/include/Imakefile index d68ef940c..4c9b169a4 100644 --- a/nx-X11/programs/Xserver/include/Imakefile +++ b/nx-X11/programs/Xserver/include/Imakefile @@ -63,5 +63,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/closestr.h b/nx-X11/programs/Xserver/include/closestr.h index c06010113..31b5693f5 100644 --- a/nx-X11/programs/Xserver/include/closestr.h +++ b/nx-X11/programs/Xserver/include/closestr.h @@ -33,7 +33,7 @@ from The Open Group. #define CLOSESTR_H #define NEED_REPLIES -#include +#include #include "closure.h" #include "dix.h" #include "misc.h" diff --git a/nx-X11/programs/Xserver/include/colormap.h b/nx-X11/programs/Xserver/include/colormap.h index d519bb782..67f44193d 100644 --- a/nx-X11/programs/Xserver/include/colormap.h +++ b/nx-X11/programs/Xserver/include/colormap.h @@ -50,7 +50,7 @@ SOFTWARE. #ifndef CMAP_H #define CMAP_H 1 -#include +#include #include "screenint.h" #include "window.h" diff --git a/nx-X11/programs/Xserver/include/dixfontstr.h b/nx-X11/programs/Xserver/include/dixfontstr.h index 948bf1adb..09a162451 100644 --- a/nx-X11/programs/Xserver/include/dixfontstr.h +++ b/nx-X11/programs/Xserver/include/dixfontstr.h @@ -30,7 +30,7 @@ SOFTWARE. #include #include "closure.h" #define NEED_REPLIES -#include /* for xQueryFontReply */ +#include /* for xQueryFontReply */ #define FONTCHARSET(font) (font) #define FONTMAXBOUNDS(font,field) (font)->info.maxbounds.field diff --git a/nx-X11/programs/Xserver/include/dixstruct.h b/nx-X11/programs/Xserver/include/dixstruct.h index 53c78d2de..e4b5e9fe8 100644 --- a/nx-X11/programs/Xserver/include/dixstruct.h +++ b/nx-X11/programs/Xserver/include/dixstruct.h @@ -31,7 +31,7 @@ SOFTWARE. #include "cursor.h" #include "gc.h" #include "pixmap.h" -#include +#include /* * direct-mapped hash table, used by resource manager to store diff --git a/nx-X11/programs/Xserver/include/gc.h b/nx-X11/programs/Xserver/include/gc.h index 1c0c90d3e..1969e5cd7 100644 --- a/nx-X11/programs/Xserver/include/gc.h +++ b/nx-X11/programs/Xserver/include/gc.h @@ -50,15 +50,15 @@ SOFTWARE. #ifndef GC_H #define GC_H -#include /* for GContext, Mask */ +#include /* for GContext, Mask */ #ifndef _XTYPEDEF_POINTER /* Don't let Xdefs.h define 'pointer' */ #define _XTYPEDEF_POINTER 1 #endif /* _XTYPEDEF_POINTER */ -#include /* for Bool */ +#include /* for Bool */ -#include +#include #include "screenint.h" /* for ScreenPtr */ #include "pixmap.h" /* for DrawablePtr */ diff --git a/nx-X11/programs/Xserver/include/gcstruct.h b/nx-X11/programs/Xserver/include/gcstruct.h index 16779f692..71d3ace47 100644 --- a/nx-X11/programs/Xserver/include/gcstruct.h +++ b/nx-X11/programs/Xserver/include/gcstruct.h @@ -58,7 +58,7 @@ SOFTWARE. #include "region.h" #include "pixmap.h" #include "screenint.h" -#include +#include /* * functions which modify the state of the GC diff --git a/nx-X11/programs/Xserver/include/input.h b/nx-X11/programs/Xserver/include/input.h index 88cc98050..a7c8d0dfe 100644 --- a/nx-X11/programs/Xserver/include/input.h +++ b/nx-X11/programs/Xserver/include/input.h @@ -52,8 +52,8 @@ SOFTWARE. #include "misc.h" #include "screenint.h" -#include -#include +#include +#include #include "window.h" /* for WindowPtr */ #define DEVICE_INIT 0 diff --git a/nx-X11/programs/Xserver/include/misc.h b/nx-X11/programs/Xserver/include/misc.h index 1576f1433..cb3051c94 100644 --- a/nx-X11/programs/Xserver/include/misc.h +++ b/nx-X11/programs/Xserver/include/misc.h @@ -77,16 +77,16 @@ OF THIS SOFTWARE. extern unsigned long globalSerialNumber; extern unsigned long serverGeneration; -#include -#include -#include -#include +#include +#include +#include +#include #ifndef _XTYPEDEF_POINTER /* Don't let Xdefs.h define 'pointer' */ #define _XTYPEDEF_POINTER 1 #endif /* _XTYPEDEF_POINTER */ -#include +#include #ifndef IN_MODULE #ifndef NULL @@ -121,7 +121,7 @@ typedef struct _xReq *xReqPtr; #include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */ #ifndef IN_MODULE -#include /* for bcopy, bzero, and bcmp */ +#include /* for bcopy, bzero, and bcmp */ #endif #define NullBox ((BoxPtr)0) diff --git a/nx-X11/programs/Xserver/include/miscstruct.h b/nx-X11/programs/Xserver/include/miscstruct.h index 87874aae4..7df9240c9 100644 --- a/nx-X11/programs/Xserver/include/miscstruct.h +++ b/nx-X11/programs/Xserver/include/miscstruct.h @@ -51,7 +51,7 @@ SOFTWARE. #define MISCSTRUCT_H 1 #include "misc.h" -#include +#include #include "gc.h" typedef xPoint DDXPointRec; diff --git a/nx-X11/programs/Xserver/include/opaque.h b/nx-X11/programs/Xserver/include/opaque.h index ca29afdc0..749b6f5b9 100644 --- a/nx-X11/programs/Xserver/include/opaque.h +++ b/nx-X11/programs/Xserver/include/opaque.h @@ -31,7 +31,7 @@ from The Open Group. #ifndef OPAQUE_H #define OPAQUE_H -#include +#include #include "globals.h" diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 551b35097..e150e1e0b 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -54,7 +54,7 @@ SOFTWARE. #include "misc.h" #define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size)) #define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((void *)(_ptr)) -#include +#include #ifndef IN_MODULE #include #else diff --git a/nx-X11/programs/Xserver/include/scrnintstr.h b/nx-X11/programs/Xserver/include/scrnintstr.h index 297227493..0539ca516 100644 --- a/nx-X11/programs/Xserver/include/scrnintstr.h +++ b/nx-X11/programs/Xserver/include/scrnintstr.h @@ -56,7 +56,7 @@ SOFTWARE. #include "colormap.h" #include "cursor.h" #include "validate.h" -#include +#include #include "dix.h" typedef struct _PixmapFormat { diff --git a/nx-X11/programs/Xserver/include/window.h b/nx-X11/programs/Xserver/include/window.h index cbfed645f..571115365 100644 --- a/nx-X11/programs/Xserver/include/window.h +++ b/nx-X11/programs/Xserver/include/window.h @@ -53,7 +53,7 @@ SOFTWARE. #include "misc.h" #include "region.h" #include "screenint.h" -#include +#include #define TOTALLY_OBSCURED 0 #define UNOBSCURED 1 diff --git a/nx-X11/programs/Xserver/include/windowstr.h b/nx-X11/programs/Xserver/include/windowstr.h index dab6fcf71..5c181bc51 100644 --- a/nx-X11/programs/Xserver/include/windowstr.h +++ b/nx-X11/programs/Xserver/include/windowstr.h @@ -58,7 +58,7 @@ SOFTWARE. #include "resource.h" /* for ROOT_WINDOW_ID_BASE */ #include "dix.h" #include "miscstruct.h" -#include +#include #include "opaque.h" #define GuaranteeNothing 0 diff --git a/nx-X11/programs/Xserver/mfb/maskbits.h b/nx-X11/programs/Xserver/mfb/maskbits.h index 7e2b74a18..94a7e8955 100644 --- a/nx-X11/programs/Xserver/mfb/maskbits.h +++ b/nx-X11/programs/Xserver/mfb/maskbits.h @@ -28,8 +28,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "servermd.h" diff --git a/nx-X11/programs/Xserver/mi/mi.h b/nx-X11/programs/Xserver/mi/mi.h index 0f3f5778f..6eea34b6c 100644 --- a/nx-X11/programs/Xserver/mi/mi.h +++ b/nx-X11/programs/Xserver/mi/mi.h @@ -49,7 +49,7 @@ SOFTWARE. #ifndef MI_H #define MI_H -#include +#include #include "region.h" #include "validate.h" #include "window.h" diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c index f06c4b51d..8db188a6e 100644 --- a/nx-X11/programs/Xserver/mi/miarc.c +++ b/nx-X11/programs/Xserver/mi/miarc.c @@ -62,8 +62,8 @@ SOFTWARE. #include #undef _XOPEN_SOURCE #endif -#include -#include +#include +#include #include "misc.h" #include "gcstruct.h" #include "scrnintstr.h" @@ -72,7 +72,7 @@ SOFTWARE. #include "mifpoly.h" #include "mi.h" #include "mifillarc.h" -#include +#include static double miDsin(double a); static double miDcos(double a); diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c index 0caad083f..60318a046 100644 --- a/nx-X11/programs/Xserver/mi/mibitblt.c +++ b/nx-X11/programs/Xserver/mi/mibitblt.c @@ -52,8 +52,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "misc.h" #include "gcstruct.h" @@ -62,7 +62,7 @@ SOFTWARE. #include "scrnintstr.h" #include "mi.h" #include "regionstr.h" -#include +#include #include "servermd.h" #ifndef HAS_FFS diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index f18648f66..875ec87f3 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -49,9 +49,9 @@ implied warranty. #include #endif -#include -#include -#include +#include +#include +#include #include "misc.h" #include "regionstr.h" #include "scrnintstr.h" diff --git a/nx-X11/programs/Xserver/mi/miclipn.c b/nx-X11/programs/Xserver/mi/miclipn.c index 14ff0d69a..913b0e47a 100644 --- a/nx-X11/programs/Xserver/mi/miclipn.c +++ b/nx-X11/programs/Xserver/mi/miclipn.c @@ -32,7 +32,7 @@ from The Open Group. #include #endif -#include +#include #include "windowstr.h" #include "scrnintstr.h" #include "mi.h" diff --git a/nx-X11/programs/Xserver/mi/micmap.c b/nx-X11/programs/Xserver/mi/micmap.c index 98f3e521d..15d3f7f46 100644 --- a/nx-X11/programs/Xserver/mi/micmap.c +++ b/nx-X11/programs/Xserver/mi/micmap.c @@ -40,8 +40,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#include -#include +#include +#include #include "scrnintstr.h" #include "colormapst.h" #include "resource.h" diff --git a/nx-X11/programs/Xserver/mi/miexpose.c b/nx-X11/programs/Xserver/mi/miexpose.c index f3dae5768..782ddad49 100644 --- a/nx-X11/programs/Xserver/mi/miexpose.c +++ b/nx-X11/programs/Xserver/mi/miexpose.c @@ -80,10 +80,10 @@ Equipment Corporation. #include #endif -#include +#include #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "regionstr.h" @@ -95,7 +95,7 @@ Equipment Corporation. #include "dixstruct.h" #include "mi.h" -#include +#include #include "globals.h" diff --git a/nx-X11/programs/Xserver/mi/mifillarc.c b/nx-X11/programs/Xserver/mi/mifillarc.c index 0dcf25d05..533bfe996 100644 --- a/nx-X11/programs/Xserver/mi/mifillarc.c +++ b/nx-X11/programs/Xserver/mi/mifillarc.c @@ -34,8 +34,8 @@ Author: Bob Scheifler, MIT X Consortium #endif #include -#include -#include +#include +#include #include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" diff --git a/nx-X11/programs/Xserver/mi/mifillrct.c b/nx-X11/programs/Xserver/mi/mifillrct.c index 9f68db720..8a8f2b4f3 100644 --- a/nx-X11/programs/Xserver/mi/mifillrct.c +++ b/nx-X11/programs/Xserver/mi/mifillrct.c @@ -51,8 +51,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "gcstruct.h" #include "windowstr.h" #include "pixmap.h" diff --git a/nx-X11/programs/Xserver/mi/mifpolycon.c b/nx-X11/programs/Xserver/mi/mifpolycon.c index 40b83586f..95b81bbb6 100644 --- a/nx-X11/programs/Xserver/mi/mifpolycon.c +++ b/nx-X11/programs/Xserver/mi/mifpolycon.c @@ -51,7 +51,7 @@ SOFTWARE. #endif #include -#include +#include #include "gcstruct.h" #include "windowstr.h" #include "pixmapstr.h" diff --git a/nx-X11/programs/Xserver/mi/miinitext.c b/nx-X11/programs/Xserver/mi/miinitext.c index b70a6a67e..f4ff4c243 100644 --- a/nx-X11/programs/Xserver/mi/miinitext.c +++ b/nx-X11/programs/Xserver/mi/miinitext.c @@ -191,35 +191,35 @@ typedef void (*InitExtension)(INITARGS); #ifdef MITSHM #define _XSHM_SERVER_ -#include +#include #endif #ifdef XTEST #define _XTEST_SERVER_ -#include +#include #endif #ifdef XKB -#include +#include #endif #ifdef LBX #define _XLBX_SERVER_ -#include +#include #endif #ifdef XAPPGROUP #define _XAG_SERVER_ -#include +#include #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef PANORAMIX -#include +#include #endif #ifdef XF86BIGFONT -#include +#include #endif #ifdef RES -#include +#include #endif /* FIXME: this whole block of externs should be from the appropriate headers */ diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c index 732e47af0..f67704e11 100644 --- a/nx-X11/programs/Xserver/mi/mioverlay.c +++ b/nx-X11/programs/Xserver/mi/mioverlay.c @@ -4,7 +4,7 @@ #include #endif -#include +#include #include "scrnintstr.h" #include "validate.h" #include "windowstr.h" diff --git a/nx-X11/programs/Xserver/mi/mipoly.c b/nx-X11/programs/Xserver/mi/mipoly.c index 403d3da56..11214a732 100644 --- a/nx-X11/programs/Xserver/mi/mipoly.c +++ b/nx-X11/programs/Xserver/mi/mipoly.c @@ -60,7 +60,7 @@ SOFTWARE. #include #endif -#include +#include #include "windowstr.h" #include "gcstruct.h" #include "pixmapstr.h" diff --git a/nx-X11/programs/Xserver/mi/mipolygen.c b/nx-X11/programs/Xserver/mi/mipolygen.c index c3d9ef397..98fe21d50 100644 --- a/nx-X11/programs/Xserver/mi/mipolygen.c +++ b/nx-X11/programs/Xserver/mi/mipolygen.c @@ -50,7 +50,7 @@ SOFTWARE. #include #endif -#include +#include #include "gcstruct.h" #include "miscanfill.h" #include "mipoly.h" diff --git a/nx-X11/programs/Xserver/mi/mipolypnt.c b/nx-X11/programs/Xserver/mi/mipolypnt.c index 5d615c28d..dcbdf85d0 100644 --- a/nx-X11/programs/Xserver/mi/mipolypnt.c +++ b/nx-X11/programs/Xserver/mi/mipolypnt.c @@ -50,8 +50,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "pixmapstr.h" #include "gcstruct.h" #include "windowstr.h" diff --git a/nx-X11/programs/Xserver/mi/mipolyrect.c b/nx-X11/programs/Xserver/mi/mipolyrect.c index 98e467f9f..9b21bb032 100644 --- a/nx-X11/programs/Xserver/mi/mipolyrect.c +++ b/nx-X11/programs/Xserver/mi/mipolyrect.c @@ -50,8 +50,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "regionstr.h" #include "gcstruct.h" #include "pixmap.h" diff --git a/nx-X11/programs/Xserver/mi/mipolyseg.c b/nx-X11/programs/Xserver/mi/mipolyseg.c index dcf3d815a..bd3c93ed6 100644 --- a/nx-X11/programs/Xserver/mi/mipolyseg.c +++ b/nx-X11/programs/Xserver/mi/mipolyseg.c @@ -50,8 +50,8 @@ SOFTWARE. #include #endif -#include -#include +#include +#include #include "regionstr.h" #include "gcstruct.h" #include "pixmap.h" diff --git a/nx-X11/programs/Xserver/mi/mipushpxl.c b/nx-X11/programs/Xserver/mi/mipushpxl.c index 5fce1cae7..44834db50 100644 --- a/nx-X11/programs/Xserver/mi/mipushpxl.c +++ b/nx-X11/programs/Xserver/mi/mipushpxl.c @@ -50,7 +50,7 @@ SOFTWARE. #include #endif -#include +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" diff --git a/nx-X11/programs/Xserver/mi/miregion.c b/nx-X11/programs/Xserver/mi/miregion.c index 5ec4ec55a..1df0dcc46 100644 --- a/nx-X11/programs/Xserver/mi/miregion.c +++ b/nx-X11/programs/Xserver/mi/miregion.c @@ -82,7 +82,7 @@ Equipment Corporation. #endif #include "regionstr.h" -#include +#include #include "gc.h" #include "mi.h" #include "mispans.h" diff --git a/nx-X11/programs/Xserver/mi/miscrinit.c b/nx-X11/programs/Xserver/mi/miscrinit.c index 78e2af5a4..4950eaa93 100644 --- a/nx-X11/programs/Xserver/mi/miscrinit.c +++ b/nx-X11/programs/Xserver/mi/miscrinit.c @@ -32,7 +32,7 @@ from The Open Group. #include #endif -#include +#include #include "servermd.h" #include "misc.h" #include "mi.h" @@ -42,7 +42,7 @@ from The Open Group. #include "miline.h" #ifdef MITSHM #define _XSHM_SERVER_ -#include +#include #endif /* We use this structure to propogate some information from miScreenInit to diff --git a/nx-X11/programs/Xserver/mi/miwideline.c b/nx-X11/programs/Xserver/mi/miwideline.c index 44cf18f2e..fa9ef4591 100644 --- a/nx-X11/programs/Xserver/mi/miwideline.c +++ b/nx-X11/programs/Xserver/mi/miwideline.c @@ -47,7 +47,7 @@ from The Open Group. #include #undef _XOPEN_SOURCE #endif -#include +#include #include "windowstr.h" #include "gcstruct.h" #include "regionstr.h" diff --git a/nx-X11/programs/Xserver/mi/miwindow.c b/nx-X11/programs/Xserver/mi/miwindow.c index 179c6e31e..44b7ada60 100644 --- a/nx-X11/programs/Xserver/mi/miwindow.c +++ b/nx-X11/programs/Xserver/mi/miwindow.c @@ -50,7 +50,7 @@ SOFTWARE. #include #endif -#include +#include #include "regionstr.h" #include "region.h" #include "mi.h" diff --git a/nx-X11/programs/Xserver/mi/mizerarc.c b/nx-X11/programs/Xserver/mi/mizerarc.c index 62402f41b..4b4d724a6 100644 --- a/nx-X11/programs/Xserver/mi/mizerarc.c +++ b/nx-X11/programs/Xserver/mi/mizerarc.c @@ -40,8 +40,8 @@ Author: Bob Scheifler, MIT X Consortium #endif #include -#include -#include +#include +#include #include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" diff --git a/nx-X11/programs/Xserver/mi/mizerclip.c b/nx-X11/programs/Xserver/mi/mizerclip.c index e648b21d4..6acfc7fe0 100644 --- a/nx-X11/programs/Xserver/mi/mizerclip.c +++ b/nx-X11/programs/Xserver/mi/mizerclip.c @@ -49,7 +49,7 @@ SOFTWARE. #include #endif -#include +#include #include "misc.h" #include "scrnintstr.h" diff --git a/nx-X11/programs/Xserver/mi/mizerline.c b/nx-X11/programs/Xserver/mi/mizerline.c index 8e62a8c94..5a61ff5d6 100644 --- a/nx-X11/programs/Xserver/mi/mizerline.c +++ b/nx-X11/programs/Xserver/mi/mizerline.c @@ -50,7 +50,7 @@ SOFTWARE. #include #endif -#include +#include #include "misc.h" #include "scrnintstr.h" diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index d97d44ab6..0a18c28c8 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -78,19 +78,19 @@ SOFTWARE. #endif #ifdef WIN32 -#include +#include #endif -#include /* for strings, fcntl, time */ +#include /* for strings, fcntl, time */ #include #include -#include +#include #include "misc.h" #ifdef __UNIXOS2__ #define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) #endif #include "osdep.h" -#include +#include #include "dixstruct.h" #include "opaque.h" #ifdef DPMSExtension @@ -138,7 +138,7 @@ mffs(fd_mask mask) #ifdef DPMSExtension #define DPMS_SERVER -#include +#include #endif #ifdef XTESTEXT1 diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index 07b460f40..05dfaf38a 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -62,15 +62,15 @@ SOFTWARE. #endif #ifdef WIN32 -#include +#include #endif #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "misc.h" #include "site.h" #include @@ -197,14 +197,14 @@ SOFTWARE. #endif #define X_INCLUDE_NETDB_H -#include +#include #include "dixstruct.h" #include "osdep.h" #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifndef PATH_MAX diff --git a/nx-X11/programs/Xserver/os/auth.c b/nx-X11/programs/Xserver/os/auth.c index dfb6f8899..c14c1e874 100644 --- a/nx-X11/programs/Xserver/os/auth.c +++ b/nx-X11/programs/Xserver/os/auth.c @@ -57,8 +57,8 @@ from The Open Group. #ifdef K5AUTH # include #endif -# include -# include +# include +# include # include "misc.h" # include "osdep.h" # include "dixstruct.h" @@ -66,10 +66,10 @@ from The Open Group. # include #ifdef XCSECURITY #define _SECURITY_SERVER -# include +# include #endif #ifdef WIN32 -#include +#include #endif struct protocol { diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 0f846d084..ef71cd540 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -68,14 +68,14 @@ SOFTWARE. #endif #ifdef WIN32 -#include +#include #endif -#include -#include +#include +#include #define XSERV_t #define TRANS_SERVER #define TRANS_REOPEN -#include +#include #include #include #include @@ -144,15 +144,15 @@ extern __const__ int _nfiles; #endif /* WIN32 */ #include "misc.h" #include "osdep.h" -#include +#include #include "opaque.h" #include "dixstruct.h" #ifdef XAPPGROUP -#include +#include #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef LBX #include "colormapst.h" diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index b92e7c4ae..ccfc01dfe 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -63,11 +63,11 @@ SOFTWARE. #define DEBUG_COMMUNICATION #endif #ifdef WIN32 -#include +#include #endif #include -#include -#include +#include +#include #include #if !defined(__UNIXOS2__) && !defined(WIN32) #ifndef Lynx @@ -76,12 +76,12 @@ SOFTWARE. #include #endif #endif -#include +#include #define NEED_REPLIES -#include +#include #include "os.h" #include "osdep.h" -#include +#include #include "opaque.h" #include "dixstruct.h" #include "misc.h" @@ -125,7 +125,7 @@ OsCommPtr AvailableInput = (OsCommPtr)NULL; lswaps((req)->length) : (req)->length) #ifdef BIGREQS -#include +#include #define get_big_req_len(req,cli) ((cli)->swapped ? \ lswapl(((xBigReq *)(req))->length) : \ diff --git a/nx-X11/programs/Xserver/os/k5auth.c b/nx-X11/programs/Xserver/os/k5auth.c index 3c50de032..f2ed5369d 100644 --- a/nx-X11/programs/Xserver/os/k5auth.c +++ b/nx-X11/programs/Xserver/os/k5auth.c @@ -54,11 +54,11 @@ from The Open Group. #undef BITS32 #undef xfree #include -#include +#include #include "os.h" #include "osdep.h" -#include -#include +#include +#include #include "dixstruct.h" #include #include "Xauth.h" diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c index 9af39800f..2444cd333 100644 --- a/nx-X11/programs/Xserver/os/log.c +++ b/nx-X11/programs/Xserver/os/log.c @@ -99,7 +99,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#include +#include #include #include #include diff --git a/nx-X11/programs/Xserver/os/mitauth.c b/nx-X11/programs/Xserver/os/mitauth.c index 2f42fd41f..abf7976af 100644 --- a/nx-X11/programs/Xserver/os/mitauth.c +++ b/nx-X11/programs/Xserver/os/mitauth.c @@ -37,7 +37,7 @@ from The Open Group. #include #endif -#include +#include #include "os.h" #include "osdep.h" #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h index e8c2d5959..e0c5de3a8 100644 --- a/nx-X11/programs/Xserver/os/osdep.h +++ b/nx-X11/programs/Xserver/os/osdep.h @@ -103,7 +103,7 @@ SOFTWARE. #endif #endif -#include +#include /* * MAXSOCKS is used only for initialising MaxClients when no other method diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index ea99ace21..ca707d4b2 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -52,10 +52,10 @@ SOFTWARE. #endif #include -#include +#include #include "os.h" #include "osdep.h" -#include +#include #ifdef SMART_SCHEDULE #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/os/rpcauth.c b/nx-X11/programs/Xserver/os/rpcauth.c index 896291e59..94c26651b 100644 --- a/nx-X11/programs/Xserver/os/rpcauth.c +++ b/nx-X11/programs/Xserver/os/rpcauth.c @@ -40,7 +40,7 @@ from The Open Group. #ifdef SECURE_RPC -#include +#include #include "Xauth.h" #include "misc.h" #include "os.h" diff --git a/nx-X11/programs/Xserver/os/secauth.c b/nx-X11/programs/Xserver/os/secauth.c index 1000b4e79..eadb17b40 100644 --- a/nx-X11/programs/Xserver/os/secauth.c +++ b/nx-X11/programs/Xserver/os/secauth.c @@ -30,7 +30,7 @@ from The Open Group. #include #endif -#include +#include #include "os.h" #include "osdep.h" #include "dixstruct.h" @@ -38,7 +38,7 @@ from The Open Group. #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif static char InvalidPolicyReason[] = "invalid policy specification"; diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index b09190c4e..3ab08897a 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -79,13 +79,13 @@ OR PERFORMANCE OF THIS SOFTWARE. #endif #if defined(WIN32) && !defined(__CYGWIN__) -#include +#include #endif -#include +#include #include #include "misc.h" -#include -#include +#include +#include #include "input.h" #include "dixfont.h" #include "osdep.h" @@ -136,11 +136,11 @@ OR PERFORMANCE OF THIS SOFTWARE. #endif #ifdef XKB -#include +#include #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include +#include #endif #ifdef RENDER @@ -258,7 +258,7 @@ Bool noXvExtension = FALSE; #endif #define X_INCLUDE_NETDB_H -#include +#include #include diff --git a/nx-X11/programs/Xserver/os/xalloc.c b/nx-X11/programs/Xserver/os/xalloc.c index a2487d4bc..4d2d3f1ee 100644 --- a/nx-X11/programs/Xserver/os/xalloc.c +++ b/nx-X11/programs/Xserver/os/xalloc.c @@ -39,9 +39,9 @@ Pascal Haible. #include /* for malloc() etc. */ -#include +#include #include "misc.h" -#include +#include #ifdef XALLOC_LOG #include diff --git a/nx-X11/programs/Xserver/os/xdmauth.c b/nx-X11/programs/Xserver/os/xdmauth.c index e02ca349c..92fbde478 100644 --- a/nx-X11/programs/Xserver/os/xdmauth.c +++ b/nx-X11/programs/Xserver/os/xdmauth.c @@ -40,8 +40,8 @@ from The Open Group. #endif #include -#include -#include +#include +#include #include "os.h" #include "osdep.h" #include "dixstruct.h" @@ -51,7 +51,7 @@ from The Open Group. static Bool authFromXDMCP; #ifdef XDMCP -#include +#include #undef REQUEST #include diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c index 675e9c456..4181e52ce 100644 --- a/nx-X11/programs/Xserver/os/xdmcp.c +++ b/nx-X11/programs/Xserver/os/xdmcp.c @@ -21,10 +21,10 @@ #endif #ifdef WIN32 -#include +#include #endif -#include +#include #if !defined(WIN32) #ifndef Lynx @@ -39,10 +39,10 @@ #include #include -#include -#include +#include +#include #include "misc.h" -#include +#include #include "osdep.h" #include "input.h" #include "dixstruct.h" @@ -76,7 +76,7 @@ #include #define X_INCLUDE_NETDB_H -#include +#include #ifdef NX_TRANS_SOCKET diff --git a/nx-X11/programs/Xserver/os/xprintf.c b/nx-X11/programs/Xserver/os/xprintf.c index 54bbeefe2..4423208ff 100644 --- a/nx-X11/programs/Xserver/os/xprintf.c +++ b/nx-X11/programs/Xserver/os/xprintf.c @@ -30,7 +30,7 @@ #include #endif -#include +#include #include "os.h" #include #include diff --git a/nx-X11/programs/Xserver/randr/randrproto.h b/nx-X11/programs/Xserver/randr/randrproto.h index 7d5c139e9..bded957fa 100644 --- a/nx-X11/programs/Xserver/randr/randrproto.h +++ b/nx-X11/programs/Xserver/randr/randrproto.h @@ -30,7 +30,7 @@ #ifndef _XRANDRP_H_ #define _XRANDRP_H_ -/*#include */ +/*#include */ #include "randr.h" #define Window CARD32 diff --git a/nx-X11/programs/Xserver/randr/randrstr.h b/nx-X11/programs/Xserver/randr/randrstr.h index 3c3db2c13..bab784b8f 100644 --- a/nx-X11/programs/Xserver/randr/randrstr.h +++ b/nx-X11/programs/Xserver/randr/randrstr.h @@ -32,8 +32,8 @@ #ifndef _RANDRSTR_H_ #define _RANDRSTR_H_ -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -44,17 +44,17 @@ #include "extnsionst.h" #include "servermd.h" #ifndef NXAGENT_SERVER -#include -#include +#include +#include #else #include "randr.h" #include "randrproto.h" #endif #ifdef RENDER -#include /* we share subpixel order information */ +#include /* we share subpixel order information */ #include "picturestr.h" #endif -#include +#include /* required for ABI compatibility for now */ #define RANDR_10_INTERFACE 1 diff --git a/nx-X11/programs/Xserver/randr/rrxinerama.c b/nx-X11/programs/Xserver/randr/rrxinerama.c index 5441f8abc..2bc17cf21 100644 --- a/nx-X11/programs/Xserver/randr/rrxinerama.c +++ b/nx-X11/programs/Xserver/randr/rrxinerama.c @@ -88,7 +88,7 @@ #include "randrstr.h" #include "swaprep.h" #ifndef NXAGENT_SERVER -#include +#include #else #include "panoramiXproto.h" #endif diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index aa1cd7543..2c5b867b4 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -43,7 +43,7 @@ and Jim Haggerty of Metheus. #include "dixstruct.h" #include "extnsionst.h" #define _XRECORD_SERVER_ -#include +#include #include "set.h" #ifndef XFree86LOADER diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index 15293af64..27e5ab949 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -36,8 +36,8 @@ #include #endif -#include -#include +#include +#include #include "servermd.h" #include "scrnintstr.h" #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/render/glyphstr.h b/nx-X11/programs/Xserver/render/glyphstr.h index e9bbd19b0..f27a73fbb 100644 --- a/nx-X11/programs/Xserver/render/glyphstr.h +++ b/nx-X11/programs/Xserver/render/glyphstr.h @@ -26,7 +26,7 @@ #ifndef _GLYPHSTR_H_ #define _GLYPHSTR_H_ -#include +#include #include "picture.h" #include "screenint.h" diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 8d644b35e..2dedbc9c4 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -30,8 +30,8 @@ #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -42,11 +42,11 @@ #include "colormapst.h" #include "extnsionst.h" #include "servermd.h" -#include -#include +#include +#include #include "picturestr.h" #include "glyphstr.h" -#include +#include #include "cursorstr.h" #ifdef EXTMODULE #include "xf86_ansic.h" diff --git a/nx-X11/programs/Xserver/xfixes/xfixesint.h b/nx-X11/programs/Xserver/xfixes/xfixesint.h index 4892654be..a883acaec 100755 --- a/nx-X11/programs/Xserver/xfixes/xfixesint.h +++ b/nx-X11/programs/Xserver/xfixes/xfixesint.h @@ -30,13 +30,13 @@ #define _XFIXESINT_H_ #define NEED_EVENTS -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" #include "extnsionst.h" -#include +#include #include "windowstr.h" #include "selection.h" #include "xfixes.h" diff --git a/nx-X11/programs/Xserver/xkb/ddxBeep.c b/nx-X11/programs/Xserver/xkb/ddxBeep.c index 22d62a502..e99e4c2dd 100644 --- a/nx-X11/programs/Xserver/xkb/ddxBeep.c +++ b/nx-X11/programs/Xserver/xkb/ddxBeep.c @@ -32,14 +32,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include +#include +#include #if (defined(__osf__) && defined(__alpha)) #include diff --git a/nx-X11/programs/Xserver/xkb/ddxConfig.c b/nx-X11/programs/Xserver/xkb/ddxConfig.c index b023531dc..8ffd344ca 100644 --- a/nx-X11/programs/Xserver/xkb/ddxConfig.c +++ b/nx-X11/programs/Xserver/xkb/ddxConfig.c @@ -32,16 +32,16 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #include "os.h" #define XKBSRV_NEED_FILE_FUNCS -#include -#include +#include +#include Bool XkbDDXApplyConfig(XPointer cfg_in,XkbSrvInfoPtr info) diff --git a/nx-X11/programs/Xserver/xkb/ddxCtrls.c b/nx-X11/programs/Xserver/xkb/ddxCtrls.c index 2e4e106ce..9fee8aa30 100644 --- a/nx-X11/programs/Xserver/xkb/ddxCtrls.c +++ b/nx-X11/programs/Xserver/xkb/ddxCtrls.c @@ -32,14 +32,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include +#include +#include void XkbDDXKeybdCtrlProc(DeviceIntPtr dev,KeybdCtrl *ctrl) diff --git a/nx-X11/programs/Xserver/xkb/ddxDevBtn.c b/nx-X11/programs/Xserver/xkb/ddxDevBtn.c index d0e37f263..04094e787 100644 --- a/nx-X11/programs/Xserver/xkb/ddxDevBtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxDevBtn.c @@ -32,15 +32,15 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include -#include +#include +#include +#include extern int DeviceValuator; diff --git a/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c b/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c index 73c8a2415..b77d040ff 100644 --- a/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c @@ -32,14 +32,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include +#include +#include void XkbDDXFakePointerButton(int event,int button) diff --git a/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c b/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c index ffd6f5d79..33fa49ae7 100644 --- a/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c @@ -33,14 +33,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include +#include +#include #ifdef PANORAMIX #include "panoramiX.h" diff --git a/nx-X11/programs/Xserver/xkb/ddxInit.c b/nx-X11/programs/Xserver/xkb/ddxInit.c index 8b76b7cb1..00ffea14e 100644 --- a/nx-X11/programs/Xserver/xkb/ddxInit.c +++ b/nx-X11/programs/Xserver/xkb/ddxInit.c @@ -32,14 +32,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include +#include +#include int XkbDDXInitDevice(DeviceIntPtr dev) diff --git a/nx-X11/programs/Xserver/xkb/ddxKeyClick.c b/nx-X11/programs/Xserver/xkb/ddxKeyClick.c index c940e5321..e56377ca5 100644 --- a/nx-X11/programs/Xserver/xkb/ddxKeyClick.c +++ b/nx-X11/programs/Xserver/xkb/ddxKeyClick.c @@ -32,14 +32,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include +#include +#include void XkbDDXKeyClick(DeviceIntPtr pXDev,int keycode,int synthetic) diff --git a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c b/nx-X11/programs/Xserver/xkb/ddxKillSrv.c index b78dc420d..44fad85ca 100644 --- a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c +++ b/nx-X11/programs/Xserver/xkb/ddxKillSrv.c @@ -36,14 +36,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include +#include +#include #ifdef XF86DDXACTIONS #include "xf86.h" diff --git a/nx-X11/programs/Xserver/xkb/ddxLEDs.c b/nx-X11/programs/Xserver/xkb/ddxLEDs.c index fb5f72bf8..92ab12ee8 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLEDs.c +++ b/nx-X11/programs/Xserver/xkb/ddxLEDs.c @@ -32,14 +32,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include +#include +#include void XkbDDXUpdateIndicators(DeviceIntPtr dev,CARD32 new) diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c index 9c961e934..3dfb85644 100644 --- a/nx-X11/programs/Xserver/xkb/ddxList.c +++ b/nx-X11/programs/Xserver/xkb/ddxList.c @@ -33,17 +33,17 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #define NEED_EVENTS 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #define XKBSRV_NEED_FILE_FUNCS -#include -#include +#include +#include #ifndef PATH_MAX #ifdef MAXPATHLEN diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c index 7caf9b1cb..16343fc9c 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c +++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c @@ -44,17 +44,17 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" #define XKBSRV_NEED_FILE_FUNCS -#include -#include +#include +#include #include "xkb.h" #if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(AIXV3) || defined(__osf__) || defined(__GNU__) @@ -94,7 +94,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifdef WIN32 -#include +#include const char* Win32TempDir() { diff --git a/nx-X11/programs/Xserver/xkb/ddxPrivate.c b/nx-X11/programs/Xserver/xkb/ddxPrivate.c index 5c0bca4cd..c71216d70 100644 --- a/nx-X11/programs/Xserver/xkb/ddxPrivate.c +++ b/nx-X11/programs/Xserver/xkb/ddxPrivate.c @@ -10,10 +10,10 @@ #include #define NEED_EVENTS 1 -#include +#include #include "windowstr.h" #define XKBSRV_NEED_FILE_FUNCS -#include +#include #ifdef XF86DDXACTIONS #include "xf86.h" diff --git a/nx-X11/programs/Xserver/xkb/ddxVT.c b/nx-X11/programs/Xserver/xkb/ddxVT.c index 1b7853fa0..1806ed257 100644 --- a/nx-X11/programs/Xserver/xkb/ddxVT.c +++ b/nx-X11/programs/Xserver/xkb/ddxVT.c @@ -36,14 +36,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include -#include +#include +#include #ifdef XF86DDXACTIONS #include "xf86.h" diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 441d88a5c..4a1561db3 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -31,18 +31,18 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#include +#include #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "misc.h" #include "inputstr.h" #define XKBSRV_NEED_FILE_FUNCS -#include +#include #include "extnsionst.h" #include "xkb.h" -#include +#include int XkbEventBase; int XkbErrorBase; @@ -3916,7 +3916,7 @@ ProcXkbSetNames(ClientPtr client) /***====================================================================***/ -#include +#include #define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4) diff --git a/nx-X11/programs/Xserver/xkb/xkbAccessX.c b/nx-X11/programs/Xserver/xkb/xkbAccessX.c index 75e46dc32..ac5713d05 100644 --- a/nx-X11/programs/Xserver/xkb/xkbAccessX.c +++ b/nx-X11/programs/Xserver/xkb/xkbAccessX.c @@ -36,11 +36,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "inputstr.h" -#include +#include #if !defined(WIN32) && !defined(Lynx) #include #endif diff --git a/nx-X11/programs/Xserver/xkb/xkbActions.c b/nx-X11/programs/Xserver/xkb/xkbActions.c index b7f3e13a5..eb1c80448 100644 --- a/nx-X11/programs/Xserver/xkb/xkbActions.c +++ b/nx-X11/programs/Xserver/xkb/xkbActions.c @@ -34,12 +34,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "misc.h" #include "inputstr.h" -#include +#include #include "xkb.h" #include diff --git a/nx-X11/programs/Xserver/xkb/xkbEvents.c b/nx-X11/programs/Xserver/xkb/xkbEvents.c index ca201c6f0..6c0aa0761 100644 --- a/nx-X11/programs/Xserver/xkb/xkbEvents.c +++ b/nx-X11/programs/Xserver/xkb/xkbEvents.c @@ -32,13 +32,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #define NEED_EVENTS 1 -#include -#include -#include -#include +#include +#include +#include +#include #include "inputstr.h" #include "windowstr.h" -#include +#include #include "xkb.h" /***====================================================================***/ diff --git a/nx-X11/programs/Xserver/xkb/xkbInit.c b/nx-X11/programs/Xserver/xkb/xkbInit.c index ef7e6a4f7..9afe0dacc 100644 --- a/nx-X11/programs/Xserver/xkb/xkbInit.c +++ b/nx-X11/programs/Xserver/xkb/xkbInit.c @@ -41,19 +41,19 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #define NEED_EVENTS 1 -#include -#include -#include -#include +#include +#include +#include +#include #include "misc.h" #include "inputstr.h" #include "opaque.h" #include "property.h" #define XKBSRV_NEED_FILE_FUNCS -#include -#include -#include -#include +#include +#include +#include +#include #include "xkb.h" #define CREATE_ATOM(s) MakeAtom(s,sizeof(s)-1,1) diff --git a/nx-X11/programs/Xserver/xkb/xkbLEDs.c b/nx-X11/programs/Xserver/xkb/xkbLEDs.c index e04c05f14..20203ef2c 100644 --- a/nx-X11/programs/Xserver/xkb/xkbLEDs.c +++ b/nx-X11/programs/Xserver/xkb/xkbLEDs.c @@ -34,13 +34,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #define NEED_EVENTS 1 -#include -#include +#include +#include #include "misc.h" #include "inputstr.h" -#include -#include +#include +#include #include "xkb.h" /***====================================================================***/ diff --git a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c index 713995d16..330fd2800 100644 --- a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c +++ b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c @@ -33,12 +33,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "misc.h" #include "inputstr.h" -#include +#include #include diff --git a/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c b/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c index 82f476790..ac601c525 100644 --- a/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c +++ b/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c @@ -33,15 +33,15 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #define NEED_EVENTS 1 -#include -#include -#include +#include +#include +#include #include "misc.h" #include "inputstr.h" -#include +#include -#include -#include +#include +#include extern void ProcessOtherEvent( xEvent * /* xE */, diff --git a/nx-X11/programs/Xserver/xkb/xkbSwap.c b/nx-X11/programs/Xserver/xkb/xkbSwap.c index be1cd94fc..c16209153 100644 --- a/nx-X11/programs/Xserver/xkb/xkbSwap.c +++ b/nx-X11/programs/Xserver/xkb/xkbSwap.c @@ -31,14 +31,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include "stdio.h" -#include +#include #define NEED_EVENTS #define NEED_REPLIES -#include +#include #include "misc.h" #include "inputstr.h" -#include -#include +#include +#include #include "extnsionst.h" #include "xkb.h" diff --git a/nx-X11/programs/Xserver/xkb/xkbUtils.c b/nx-X11/programs/Xserver/xkb/xkbUtils.c index f3c3ff8ca..465644f16 100644 --- a/nx-X11/programs/Xserver/xkb/xkbUtils.c +++ b/nx-X11/programs/Xserver/xkb/xkbUtils.c @@ -34,16 +34,16 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #define NEED_EVENTS 1 -#include -#include +#include +#include #define XK_CYRILLIC -#include +#include #include "misc.h" #include "inputstr.h" #define XKBSRV_NEED_FILE_FUNCS -#include -#include +#include +#include #include "xkb.h" #ifdef MODE_SWITCH diff --git a/nx-X11/programs/nxauth/gethost.c b/nx-X11/programs/nxauth/gethost.c index cab2aea9f..fa889f29b 100644 --- a/nx-X11/programs/nxauth/gethost.c +++ b/nx-X11/programs/nxauth/gethost.c @@ -36,10 +36,10 @@ in this Software without prior written authorization from The Open Group. #endif #ifdef WIN32 -#include +#include #define EPROTOTYPE WSAEPROTOTYPE #endif -#include +#include #include #include #include diff --git a/nx-X11/programs/nxauth/parsedpy.c b/nx-X11/programs/nxauth/parsedpy.c index 8ce46815c..d0f022574 100644 --- a/nx-X11/programs/nxauth/parsedpy.c +++ b/nx-X11/programs/nxauth/parsedpy.c @@ -49,12 +49,12 @@ in this Software without prior written authorization from The Open Group. #include /* for NULL */ #include /* for isascii() and isdigit() */ -#include /* for strchr() and string routines */ -#include /* for Family contants */ +#include /* for strchr() and string routines */ +#include /* for Family contants */ #ifdef hpux #include /* for struct utsname */ #endif -#include /* for FamilyLocal */ +#include /* for FamilyLocal */ #if defined(UNIXCONN) || defined(LOCALCONN) #define UNIX_CONNECTION "unix" diff --git a/nx-X11/programs/nxauth/process.c b/nx-X11/programs/nxauth/process.c index 76259d76a..86aba2b2a 100644 --- a/nx-X11/programs/nxauth/process.c +++ b/nx-X11/programs/nxauth/process.c @@ -55,10 +55,10 @@ from The Open Group. #include #include -/*#include */ /* for Family constants */ +/*#include */ /* for Family constants */ /* -#include -#include +#include +#include */ /*FIXME*/ diff --git a/nx-X11/programs/nxauth/xauth.h b/nx-X11/programs/nxauth/xauth.h index 33a6c4e3b..4f8490070 100644 --- a/nx-X11/programs/nxauth/xauth.h +++ b/nx-X11/programs/nxauth/xauth.h @@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group. /* $XFree86: xc/programs/xauth/xauth.h,v 1.6 2001/12/14 20:01:15 dawes Exp $ */ #include -#include -#include -#include +#include +#include +#include #ifndef True typedef int Bool; diff --git a/nx-libs.spec b/nx-libs.spec index 6eed3691a..a9afb7ec8 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -616,11 +616,11 @@ ln -sf ../../nx/bin/nxagent %{buildroot}%{_libdir}/x2go/bin/x2goagent chmod 755 %{buildroot}%{_libdir}/lib*.so* #Remove extras, GL, and other unneeded headers -rm -r %{buildroot}%{_includedir}/nx/GL -rm -r %{buildroot}%{_includedir}/nx/X11/extensions/XInput.h -rm -r %{buildroot}%{_includedir}/nx/X11/extensions/XK*.h -rm -r %{buildroot}%{_includedir}/nx/X11/extensions/*Xv*.h -rm -r %{buildroot}%{_includedir}/nx/X11/Xtrans +rm -r %{buildroot}%{_includedir}/GL +rm -r %{buildroot}%{_includedir}/nx-X11/extensions/XInput.h +rm -r %{buildroot}%{_includedir}/nx-X11/extensions/XK*.h +rm -r %{buildroot}%{_includedir}/nx-X11/extensions/*Xv*.h +rm -r %{buildroot}%{_includedir}/nx-X11/Xtrans # Needed for Xinerama support ln -s -f ../../../../%{_lib}/libX11.so.6 %{buildroot}%{_libdir}/nx/X11/Xinerama/libNX_X11.so.6 @@ -673,23 +673,23 @@ ln -s -f ../../../../%{_lib}/libNX_Xinerama.so.1 %{buildroot}%{_libdir}/nx/X11/X %defattr(-,root,root) %{_libdir}/libNX_X11.so %dir %{_includedir}/nx -%dir %{_includedir}/nx/X11 -%{_includedir}/nx/X11/ImUtil.h -%{_includedir}/nx/X11/XKBlib.h -%{_includedir}/nx/X11/Xcms.h -%{_includedir}/nx/X11/Xlib.h -%{_includedir}/nx/X11/XlibConf.h -%{_includedir}/nx/X11/Xlibint.h -%{_includedir}/nx/X11/Xlocale.h -%{_includedir}/nx/X11/Xregion.h -%{_includedir}/nx/X11/Xresource.h -%{_includedir}/nx/X11/Xutil.h -%{_includedir}/nx/X11/cursorfont.h +%dir %{_includedir}/nx-X11 +%{_includedir}/nx-X11/ImUtil.h +%{_includedir}/nx-X11/XKBlib.h +%{_includedir}/nx-X11/Xcms.h +%{_includedir}/nx-X11/Xlib.h +%{_includedir}/nx-X11/XlibConf.h +%{_includedir}/nx-X11/Xlibint.h +%{_includedir}/nx-X11/Xlocale.h +%{_includedir}/nx-X11/Xregion.h +%{_includedir}/nx-X11/Xresource.h +%{_includedir}/nx-X11/Xutil.h +%{_includedir}/nx-X11/cursorfont.h %files -n libNX_Xau-devel %defattr(-,root,root) %{_libdir}/libNX_Xau.so -%{_includedir}/nx/X11/Xauth.h +%{_includedir}/nx-X11/Xauth.h %files -n libNX_Xau6 %defattr(-,root,root) @@ -702,33 +702,33 @@ ln -s -f ../../../../%{_lib}/libNX_Xinerama.so.1 %{buildroot}%{_libdir}/nx/X11/X %files -n libNX_Xext-devel %defattr(-,root,root) %{_libdir}/libNX_Xext.so -%dir %{_includedir}/nx/X11/extensions -%{_includedir}/nx/X11/extensions/MITMisc.h -%{_includedir}/nx/X11/extensions/XEVI.h -%{_includedir}/nx/X11/extensions/XEVIstr.h -%{_includedir}/nx/X11/extensions/XLbx.h -%{_includedir}/nx/X11/extensions/XShm.h -%{_includedir}/nx/X11/extensions/Xag.h -%{_includedir}/nx/X11/extensions/Xagsrv.h -%{_includedir}/nx/X11/extensions/Xagstr.h -%{_includedir}/nx/X11/extensions/Xcup.h -%{_includedir}/nx/X11/extensions/Xcupstr.h -%{_includedir}/nx/X11/extensions/Xdbe.h -%{_includedir}/nx/X11/extensions/Xdbeproto.h -%{_includedir}/nx/X11/extensions/Xext.h -%{_includedir}/nx/X11/extensions/dpms.h -%{_includedir}/nx/X11/extensions/dpmsstr.h -%{_includedir}/nx/X11/extensions/extutil.h -%{_includedir}/nx/X11/extensions/lbxstr.h -%{_includedir}/nx/X11/extensions/mitmiscstr.h -%{_includedir}/nx/X11/extensions/multibuf.h -%{_includedir}/nx/X11/extensions/multibufst.h -%{_includedir}/nx/X11/extensions/security.h -%{_includedir}/nx/X11/extensions/securstr.h -%{_includedir}/nx/X11/extensions/shape.h -%{_includedir}/nx/X11/extensions/sync.h -%{_includedir}/nx/X11/extensions/xtestext1.h -%{_includedir}/nx/X11/extensions/xteststr.h +%dir %{_includedir}/nx-X11/extensions +%{_includedir}/nx-X11/extensions/MITMisc.h +%{_includedir}/nx-X11/extensions/XEVI.h +%{_includedir}/nx-X11/extensions/XEVIstr.h +%{_includedir}/nx-X11/extensions/XLbx.h +%{_includedir}/nx-X11/extensions/XShm.h +%{_includedir}/nx-X11/extensions/Xag.h +%{_includedir}/nx-X11/extensions/Xagsrv.h +%{_includedir}/nx-X11/extensions/Xagstr.h +%{_includedir}/nx-X11/extensions/Xcup.h +%{_includedir}/nx-X11/extensions/Xcupstr.h +%{_includedir}/nx-X11/extensions/Xdbe.h +%{_includedir}/nx-X11/extensions/Xdbeproto.h +%{_includedir}/nx-X11/extensions/Xext.h +%{_includedir}/nx-X11/extensions/dpms.h +%{_includedir}/nx-X11/extensions/dpmsstr.h +%{_includedir}/nx-X11/extensions/extutil.h +%{_includedir}/nx-X11/extensions/lbxstr.h +%{_includedir}/nx-X11/extensions/mitmiscstr.h +%{_includedir}/nx-X11/extensions/multibuf.h +%{_includedir}/nx-X11/extensions/multibufst.h +%{_includedir}/nx-X11/extensions/security.h +%{_includedir}/nx-X11/extensions/securstr.h +%{_includedir}/nx-X11/extensions/shape.h +%{_includedir}/nx-X11/extensions/sync.h +%{_includedir}/nx-X11/extensions/xtestext1.h +%{_includedir}/nx-X11/extensions/xteststr.h %files -n libNX_Xext6 %defattr(-,root,root) @@ -737,7 +737,7 @@ ln -s -f ../../../../%{_lib}/libNX_Xinerama.so.1 %{buildroot}%{_libdir}/nx/X11/X %files -n libNX_Xfixes-devel %defattr(-,root,root) %{_libdir}/libNX_Xfixes.so -%{_includedir}/nx/X11/extensions/Xfixes.h +%{_includedir}/nx-X11/extensions/Xfixes.h %files -n libNX_Xfixes3 %defattr(-,root,root) @@ -818,83 +818,83 @@ ln -s -f ../../../../%{_lib}/libNX_Xinerama.so.1 %{buildroot}%{_libdir}/nx/X11/X %{_libdir}/libNX_Xcomposite.so %{_libdir}/libNX_Xinerama.so %{_libdir}/libNX_Xtst.so -%{_includedir}/nx/X11/X10.h -%dir %{_includedir}/nx/X11/extensions -%{_includedir}/nx/X11/extensions/XTest.h -%{_includedir}/nx/X11/extensions/Xcomposite.h -%{_includedir}/nx/X11/extensions/Xevie.h -%{_includedir}/nx/X11/extensions/Xinerama.h -%{_includedir}/nx/X11/extensions/lbxbuf.h -%{_includedir}/nx/X11/extensions/lbxbufstr.h -%{_includedir}/nx/X11/extensions/lbxdeltastr.h -%{_includedir}/nx/X11/extensions/lbximage.h -%{_includedir}/nx/X11/extensions/lbxopts.h -%{_includedir}/nx/X11/extensions/lbxzlib.h -%{_includedir}/nx/X11/extensions/panoramiXext.h -%{_includedir}/nx/X11/extensions/record.h -%{_includedir}/nx/X11/extensions/xf86dga1.h -%{_includedir}/nx/X11/extensions/xf86vmode.h -%{_includedir}/nx/X11/misc.h -%{_includedir}/nx/X11/os.h +%{_includedir}/nx-X11/X10.h +%dir %{_includedir}/nx-X11/extensions +%{_includedir}/nx-X11/extensions/XTest.h +%{_includedir}/nx-X11/extensions/Xcomposite.h +%{_includedir}/nx-X11/extensions/Xevie.h +%{_includedir}/nx-X11/extensions/Xinerama.h +%{_includedir}/nx-X11/extensions/lbxbuf.h +%{_includedir}/nx-X11/extensions/lbxbufstr.h +%{_includedir}/nx-X11/extensions/lbxdeltastr.h +%{_includedir}/nx-X11/extensions/lbximage.h +%{_includedir}/nx-X11/extensions/lbxopts.h +%{_includedir}/nx-X11/extensions/lbxzlib.h +%{_includedir}/nx-X11/extensions/panoramiXext.h +%{_includedir}/nx-X11/extensions/record.h +%{_includedir}/nx-X11/extensions/xf86dga1.h +%{_includedir}/nx-X11/extensions/xf86vmode.h +%{_includedir}/nx-X11/misc.h +%{_includedir}/nx-X11/os.h %files -n nx-proto-devel %defattr(-,root,root) -%dir %{_includedir}/nx/X11 -%{_includedir}/nx/X11/DECkeysym.h -%{_includedir}/nx/X11/HPkeysym.h -%{_includedir}/nx/X11/Sunkeysym.h -%{_includedir}/nx/X11/X.h -%{_includedir}/nx/X11/XF86keysym.h -%{_includedir}/nx/X11/XWDFile.h -%{_includedir}/nx/X11/Xalloca.h -%{_includedir}/nx/X11/Xarch.h -%{_includedir}/nx/X11/Xatom.h -%{_includedir}/nx/X11/Xdefs.h -%{_includedir}/nx/X11/Xfuncproto.h -%{_includedir}/nx/X11/Xfuncs.h -%{_includedir}/nx/X11/Xmd.h -%{_includedir}/nx/X11/Xos.h -%{_includedir}/nx/X11/Xos_r.h -%{_includedir}/nx/X11/Xosdefs.h -%{_includedir}/nx/X11/Xpoll.h -%{_includedir}/nx/X11/Xproto.h -%{_includedir}/nx/X11/Xprotostr.h -%{_includedir}/nx/X11/Xthreads.h -%{_includedir}/nx/X11/ap_keysym.h -%{_includedir}/nx/X11/keysym.h -%{_includedir}/nx/X11/keysymdef.h -%{_includedir}/nx/X11/extensions/XI.h -%{_includedir}/nx/X11/extensions/XIproto.h -%{_includedir}/nx/X11/extensions/XResproto.h -%{_includedir}/nx/X11/extensions/Xeviestr.h -%{_includedir}/nx/X11/extensions/bigreqstr.h -%{_includedir}/nx/X11/extensions/composite.h -%{_includedir}/nx/X11/extensions/compositeproto.h -%{_includedir}/nx/X11/extensions/panoramiXproto.h -%{_includedir}/nx/X11/extensions/recordstr.h -%{_includedir}/nx/X11/extensions/render.h -%{_includedir}/nx/X11/extensions/renderproto.h -%{_includedir}/nx/X11/extensions/shapestr.h -%{_includedir}/nx/X11/extensions/shmstr.h -%{_includedir}/nx/X11/extensions/syncstr.h -%{_includedir}/nx/X11/extensions/xcmiscstr.h -%{_includedir}/nx/X11/extensions/xf86bigfont.h -%{_includedir}/nx/X11/extensions/xf86bigfstr.h -%{_includedir}/nx/X11/extensions/xf86dga.h -%{_includedir}/nx/X11/extensions/xf86dga1str.h -%{_includedir}/nx/X11/extensions/xf86dgastr.h -%{_includedir}/nx/X11/extensions/xf86misc.h -%{_includedir}/nx/X11/extensions/xf86mscstr.h -%{_includedir}/nx/X11/extensions/xf86vmstr.h -%{_includedir}/nx/X11/extensions/xfixesproto.h -%{_includedir}/nx/X11/extensions/xfixeswire.h -%{_includedir}/nx/X11/extensions/xtrapbits.h -%{_includedir}/nx/X11/extensions/xtrapddmi.h -%{_includedir}/nx/X11/extensions/xtrapdi.h -%{_includedir}/nx/X11/extensions/xtrapemacros.h -%{_includedir}/nx/X11/extensions/xtraplib.h -%{_includedir}/nx/X11/extensions/xtraplibp.h -%{_includedir}/nx/X11/extensions/xtrapproto.h +%dir %{_includedir}/nx-X11 +%{_includedir}/nx-X11/DECkeysym.h +%{_includedir}/nx-X11/HPkeysym.h +%{_includedir}/nx-X11/Sunkeysym.h +%{_includedir}/nx-X11/X.h +%{_includedir}/nx-X11/XF86keysym.h +%{_includedir}/nx-X11/XWDFile.h +%{_includedir}/nx-X11/Xalloca.h +%{_includedir}/nx-X11/Xarch.h +%{_includedir}/nx-X11/Xatom.h +%{_includedir}/nx-X11/Xdefs.h +%{_includedir}/nx-X11/Xfuncproto.h +%{_includedir}/nx-X11/Xfuncs.h +%{_includedir}/nx-X11/Xmd.h +%{_includedir}/nx-X11/Xos.h +%{_includedir}/nx-X11/Xos_r.h +%{_includedir}/nx-X11/Xosdefs.h +%{_includedir}/nx-X11/Xpoll.h +%{_includedir}/nx-X11/Xproto.h +%{_includedir}/nx-X11/Xprotostr.h +%{_includedir}/nx-X11/Xthreads.h +%{_includedir}/nx-X11/ap_keysym.h +%{_includedir}/nx-X11/keysym.h +%{_includedir}/nx-X11/keysymdef.h +%{_includedir}/nx-X11/extensions/XI.h +%{_includedir}/nx-X11/extensions/XIproto.h +%{_includedir}/nx-X11/extensions/XResproto.h +%{_includedir}/nx-X11/extensions/Xeviestr.h +%{_includedir}/nx-X11/extensions/bigreqstr.h +%{_includedir}/nx-X11/extensions/composite.h +%{_includedir}/nx-X11/extensions/compositeproto.h +%{_includedir}/nx-X11/extensions/panoramiXproto.h +%{_includedir}/nx-X11/extensions/recordstr.h +%{_includedir}/nx-X11/extensions/render.h +%{_includedir}/nx-X11/extensions/renderproto.h +%{_includedir}/nx-X11/extensions/shapestr.h +%{_includedir}/nx-X11/extensions/shmstr.h +%{_includedir}/nx-X11/extensions/syncstr.h +%{_includedir}/nx-X11/extensions/xcmiscstr.h +%{_includedir}/nx-X11/extensions/xf86bigfont.h +%{_includedir}/nx-X11/extensions/xf86bigfstr.h +%{_includedir}/nx-X11/extensions/xf86dga.h +%{_includedir}/nx-X11/extensions/xf86dga1str.h +%{_includedir}/nx-X11/extensions/xf86dgastr.h +%{_includedir}/nx-X11/extensions/xf86misc.h +%{_includedir}/nx-X11/extensions/xf86mscstr.h +%{_includedir}/nx-X11/extensions/xf86vmstr.h +%{_includedir}/nx-X11/extensions/xfixesproto.h +%{_includedir}/nx-X11/extensions/xfixeswire.h +%{_includedir}/nx-X11/extensions/xtrapbits.h +%{_includedir}/nx-X11/extensions/xtrapddmi.h +%{_includedir}/nx-X11/extensions/xtrapdi.h +%{_includedir}/nx-X11/extensions/xtrapemacros.h +%{_includedir}/nx-X11/extensions/xtraplib.h +%{_includedir}/nx-X11/extensions/xtraplibp.h +%{_includedir}/nx-X11/extensions/xtrapproto.h %files -n nxagent %defattr(-,root,root) diff --git a/nxcompext/Jpeg.c b/nxcompext/Jpeg.c index cb854bc6c..d6a94cc80 100644 --- a/nxcompext/Jpeg.c +++ b/nxcompext/Jpeg.c @@ -19,9 +19,9 @@ #include #include -#include "X11/X.h" -#include "X11/Xlib.h" -#include "X11/Xmd.h" +#include +#include +#include #include diff --git a/nxcompext/NXlib.h b/nxcompext/NXlib.h index d77ff6046..15661b439 100644 --- a/nxcompext/NXlib.h +++ b/nxcompext/NXlib.h @@ -22,8 +22,8 @@ extern "C" { #endif -#include -#include +#include +#include #include "NX.h" #include "NXpack.h" diff --git a/nxcompext/Pgn.h b/nxcompext/Pgn.h index 999e8ea01..075d2bc1e 100644 --- a/nxcompext/Pgn.h +++ b/nxcompext/Pgn.h @@ -22,9 +22,9 @@ extern "C" { #endif -#include "X11/X.h" -#include "X11/Xlib.h" -#include "X11/Xmd.h" +#include +#include +#include #include diff --git a/nxcompshad/Input.h b/nxcompshad/Input.h index 6250e790b..88217c9b1 100644 --- a/nxcompshad/Input.h +++ b/nxcompshad/Input.h @@ -18,7 +18,7 @@ #ifndef Input_H #define Input_H -#include +#include typedef struct Event { diff --git a/nxcompshad/Manager.cpp b/nxcompshad/Manager.cpp index ba9260a13..3b5504a1f 100644 --- a/nxcompshad/Manager.cpp +++ b/nxcompshad/Manager.cpp @@ -15,9 +15,9 @@ /* */ /**************************************************************************/ -#include -#include -#include +#include +#include +#include #include #define PANIC diff --git a/nxcompshad/Manager.h b/nxcompshad/Manager.h index 267754906..56b7e0aa5 100644 --- a/nxcompshad/Manager.h +++ b/nxcompshad/Manager.h @@ -18,7 +18,7 @@ #ifndef UpdateManager_H #define UpdateManager_H -#include +#include #include "Updater.h" #include "Regions.h" diff --git a/nxcompshad/Regions.h b/nxcompshad/Regions.h index b9303dcb7..d46d11a72 100644 --- a/nxcompshad/Regions.h +++ b/nxcompshad/Regions.h @@ -18,8 +18,8 @@ #ifndef Region_H #define Region_H -#include -#include +#include +#include typedef struct { short x1, x2, y1, y2; diff --git a/nxcompshad/Shadow.h b/nxcompshad/Shadow.h index e1eddb95c..99824b0aa 100644 --- a/nxcompshad/Shadow.h +++ b/nxcompshad/Shadow.h @@ -18,7 +18,7 @@ #ifndef Shadow_H #define Shadow_H -#include +#include #define NXShadowCorrectColor(length, buffer) \ \ diff --git a/nxcompshad/Updater.cpp b/nxcompshad/Updater.cpp index 245c6ce31..eee81bf16 100644 --- a/nxcompshad/Updater.cpp +++ b/nxcompshad/Updater.cpp @@ -15,9 +15,9 @@ /* */ /**************************************************************************/ -#include -#include -#include +#include +#include +#include #include #define PANIC diff --git a/nxcompshad/Updater.h b/nxcompshad/Updater.h index daa26c10b..cb8b15aa6 100644 --- a/nxcompshad/Updater.h +++ b/nxcompshad/Updater.h @@ -18,7 +18,7 @@ #ifndef Updater_H #define Updater_H -#include +#include #include "Regions.h" #include "Input.h" diff --git a/nxcompshad/Win.cpp b/nxcompshad/Win.cpp index 481cbcac0..77a9694bd 100644 --- a/nxcompshad/Win.cpp +++ b/nxcompshad/Win.cpp @@ -17,7 +17,7 @@ #if defined(__CYGWIN32__) || defined(WIN32) -#include +#include #define PANIC #define WARNING diff --git a/nxcompshad/Win.h b/nxcompshad/Win.h index fe591ff02..1069fa9ee 100644 --- a/nxcompshad/Win.h +++ b/nxcompshad/Win.h @@ -20,7 +20,7 @@ #ifndef Win32Poller_H #define Win32Poller_H -//#include +//#include #include #include diff --git a/nxcompshad/X11.cpp b/nxcompshad/X11.cpp index 2d1140f11..5a18e0a69 100644 --- a/nxcompshad/X11.cpp +++ b/nxcompshad/X11.cpp @@ -22,10 +22,10 @@ #undef TEST #undef DEBUG -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/nxcompshad/X11.h b/nxcompshad/X11.h index 21275420c..d7b858100 100644 --- a/nxcompshad/X11.h +++ b/nxcompshad/X11.h @@ -18,10 +18,10 @@ #ifndef X11Poller_H #define X11Poller_H -#include -#include -#include -#include +#include +#include +#include "X11/include/Xdamage_nxcompshad.h" +#include "X11/include/Xrandr_nxcompshad.h" #include "Core.h" diff --git a/nxcompshad/X11/include/Xdamage_nxcompshad.h b/nxcompshad/X11/include/Xdamage_nxcompshad.h new file mode 100644 index 000000000..8e5e0fbbd --- /dev/null +++ b/nxcompshad/X11/include/Xdamage_nxcompshad.h @@ -0,0 +1,92 @@ +/* + * Copyright © 2003 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file is a reduced version of the header file of + * + * + * This copy of code has been introduced to allow a clear namespace + * separation between and header files. + * + * This version of the Xdamage library header file only contains symbols + * required by nxcompshad and strictly avoids indirectly including + * from an X11 library that is also shipped in nx-X11/lib/. + * + * When using instead for inclusion in + * nxcompshad, it will attempt pulling in the + * header which in turn will include . However, the headers of + * the same name from should be used instead. + * + * FIXME: Once the nxagent Xserver starts using libXfixes from X.Org, this + * hack can be removed. + * + * 2015/06/26, Mike Gabriel + */ + + +#ifndef _XDAMAGE_H_ +#define _XDAMAGE_H_ + +#include +#include + +/* from */ +typedef XID XserverRegion; + +#define XDAMAGE_1_1_INTERFACE + +typedef XID Damage; + +typedef struct { + int type; /* event base */ + unsigned long serial; + Bool send_event; + Display *display; + Drawable drawable; + Damage damage; + int level; + Bool more; /* more events will be delivered immediately */ + Time timestamp; + XRectangle area; + XRectangle geometry; +} XDamageNotifyEvent; + +_XFUNCPROTOBEGIN + +Bool XDamageQueryExtension (Display *dpy, + int *event_base_return, + int *error_base_return); + +Status XDamageQueryVersion (Display *dpy, + int *major_version_return, + int *minor_version_return); + +Damage +XDamageCreate (Display *dpy, Drawable drawable, int level); + +void +XDamageSubtract (Display *dpy, Damage damage, + XserverRegion repair, XserverRegion parts); + +_XFUNCPROTOEND + +#endif /* _XDAMAGE_H_ */ diff --git a/nxcompshad/X11/include/Xrandr_nxcompshad.h b/nxcompshad/X11/include/Xrandr_nxcompshad.h new file mode 100644 index 000000000..4feb01685 --- /dev/null +++ b/nxcompshad/X11/include/Xrandr_nxcompshad.h @@ -0,0 +1,80 @@ +/* + * Copyright © 2000 Compaq Computer Corporation, Inc. + * Copyright © 2002 Hewlett-Packard Company, Inc. + * Copyright © 2006 Intel Corporation + * Copyright © 2008 Red Hat, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + * + * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. + * Keith Packard, Intel Corporation + */ + +/* + * This file is a reduced version of the header file of + * + * + * This copy of code has been introduced to allow a clear namespace + * separation between and header files. + * + * This version of the Xrandr library header file only contains symbols + * required by nxcompshad and strictly avoids indirectly including + * from an X11 library that is also shipped in nx-X11/lib/. + * + * When using instead for inclusion in + * nxcompshad, it will attempt pulling in the + * header which in turn will include . However, the headers of + * the same name from should be used instead. + * + * FIXME: Once the nxagent Xserver starts using libXrender from X.Org, this + * hack can be removed. + * + * 2015/06/26, Mike Gabriel + */ + +#ifndef _XRANDR_H_ +#define _XRANDR_H_ + +/* from */ +#define RRScreenChangeNotify 0 +#define RRScreenChangeNotifyMask (1L << 0) + +#include + +_XFUNCPROTOBEGIN + +/* internal representation is private to the library */ +typedef struct _XRRScreenConfiguration XRRScreenConfiguration; + +Bool XRRQueryExtension (Display *dpy, + int *event_base_return, + int *error_base_return); + +void XRRSelectInput(Display *dpy, Window window, int mask); + + +/* + * intended to take RRScreenChangeNotify, or + * ConfigureNotify (on the root window) + * returns 1 if it is an event type it understands, 0 if not + */ +int XRRUpdateConfiguration(XEvent *event); +_XFUNCPROTOEND + +#endif /* _XRANDR_H_ */ -- cgit v1.2.3 From d9e7f6ae42b30e32619e1d0979598c2ba2288a3e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 18 Mar 2016 05:13:43 +0100 Subject: pixman-devel: Build against shared library pkg-config(pixman-1). --- debian/control | 1 + nx-X11/programs/Xserver/GL/glx/Imakefile | 3 ++- nx-X11/programs/Xserver/GL/mesa/X/Imakefile | 3 ++- nx-X11/programs/Xserver/Imakefile | 15 +++++++-------- nx-X11/programs/Xserver/XTrap/Imakefile | 2 +- nx-X11/programs/Xserver/Xext/Imakefile | 3 ++- nx-X11/programs/Xserver/Xi/Imakefile | 2 +- nx-X11/programs/Xserver/composite/Imakefile | 3 ++- nx-X11/programs/Xserver/damageext/Imakefile | 3 ++- nx-X11/programs/Xserver/dbe/Imakefile | 2 +- nx-X11/programs/Xserver/dix/Imakefile | 3 ++- nx-X11/programs/Xserver/fb/Imakefile | 3 ++- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 5 ++++- nx-X11/programs/Xserver/include/scrnintstr.h | 4 ++++ nx-X11/programs/Xserver/mi/Imakefile | 3 ++- nx-X11/programs/Xserver/miext/cw/Imakefile | 3 ++- nx-X11/programs/Xserver/miext/damage/Imakefile | 3 ++- nx-X11/programs/Xserver/os/Imakefile | 3 ++- nx-X11/programs/Xserver/randr/Imakefile | 4 +++- nx-X11/programs/Xserver/record/Imakefile | 2 +- nx-X11/programs/Xserver/render/Imakefile | 3 ++- nx-X11/programs/Xserver/xfixes/Imakefile | 3 ++- nx-X11/programs/Xserver/xkb/Imakefile | 3 ++- nx-libs.spec | 3 +++ nxcompext/configure.in | 2 ++ 25 files changed, 56 insertions(+), 28 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/debian/control b/debian/control index 83aee8e58..3e1f45e5d 100644 --- a/debian/control +++ b/debian/control @@ -28,6 +28,7 @@ Build-Depends: pkg-config, x11proto-core-dev, expat, + libpixman-1-dev, Standards-Version: 3.9.6 Homepage: http://code.x2go.org/gitweb?p=nx-libs.git;a=summary Vcs-Git: git://code.x2go.org/nx-libs.git diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile index 506ef5539..bf2d760a0 100644 --- a/nx-X11/programs/Xserver/GL/glx/Imakefile +++ b/nx-X11/programs/Xserver/GL/glx/Imakefile @@ -43,7 +43,8 @@ LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11) INCLUDES = -I$(SERVERSRC)/GL/glx -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(MESASRCDIR)/include \ -I$(XINCLUDESRC) -I$(SERVERSRC)/mi \ -I$(EXTINCSRC) -I$(LIBSRC)/GL/include \ - -I$(XF86SRC) + -I$(XF86SRC) \ + `pkg-config --cflags-only-I pixman-1` #if defined(DarwinArchitecture) && ((OSMajorVersion == 6 && OSMinorVersion < 3) || OSMajorVersion < 6) NO_EXT_DEFS = -DMISSING_GL_EXTS diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile index ee728b556..9fb00ef73 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile @@ -39,7 +39,8 @@ LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) -I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \ -I$(SERVERSRC)/GL/glx \ -I$(XF86OSSRC) \ - -I$(DRMSRCDIR)/shared-core + -I$(DRMSRCDIR)/shared-core \ + `pkg-config --cflags-only-I pixman-1` DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index c7e1af550..a2a3f7ced 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -384,10 +384,12 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \ dix/main.o #endif -XPMLIB = -lXpm +XPMLIB = -lXpm +XMLLIB = `pkg-config --libs libxml-2.0` +PIXMANLIB = `pkg-config --libs pixman-1` NXAGENT = hw/nxagent/LibraryTargetName(nxagent) NXAGENTLIBS = PreFbLibs $(NXAGENT) FbPostFbLibs $(NXAGENT) $(MI) -NXAGENTSYSLIBS = $(LDPRELIBS) $(XLIB) $(SYSLIBS) $(XPMLIB) +NXAGENTSYSLIBS = $(LDPRELIBS) $(XLIB) $(SYSLIBS) $(XPMLIB) $(XMLLIB) $(PIXMANLIB) #if HasParallelMake MakeMutex($(NXAGENTDIRS) $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS)) #endif @@ -403,18 +405,15 @@ $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS):: $(NXAGENTDIRS) #if defined(SunArchitecture) NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lXrender -lXfixes -lXfont \ - -L../../../nx-X11/exports/lib -lXtst -lXrandr -lXcomposite -lXdmcp \ -`pkg-config --libs libxml-2.0` + -L../../../nx-X11/exports/lib -lXtst -lXrandr -lXcomposite -lXdmcp #elif defined(cygwinArchitecture) NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ -lXcomp -lXcompext -lXrender -lX11 -lNX_Xext -lXcomposite -lXfixes -lXfont \ - -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp \ -`pkg-config --libs libxml-2.0` + -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp #else NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ -lXcomp -lXcompext -lXcompshad -lXrender -lNX_X11 -lNX_Xext -lXfixes -lXfont \ - -L../../../nx-X11/exports/lib -lXtst -lXrandr -lXcomposite -lXinerama -lXdmcp \ -`pkg-config --libs libxml-2.0` + -L../../../nx-X11/exports/lib -lXtst -lXrandr -lXcomposite -lXinerama -lXdmcp #endif #endif diff --git a/nx-X11/programs/Xserver/XTrap/Imakefile b/nx-X11/programs/Xserver/XTrap/Imakefile index 2362634c7..c61712f1d 100644 --- a/nx-X11/programs/Xserver/XTrap/Imakefile +++ b/nx-X11/programs/Xserver/XTrap/Imakefile @@ -11,7 +11,7 @@ XCOMM $XFree86: xc/programs/Xserver/XTrap/Imakefile,v 1.1 2001/11/02 23:29:29 da #endif SRCS = xtrapddmi.c xtrapdi.c xtrapdiswp.c xtrapditbl.c OBJS = xtrapddmi.o xtrapdi.o xtrapdiswp.o xtrapditbl.o - INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(SERVERSRC)/Xext + INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(SERVERSRC)/Xext `pkg-config --cflags-only-I pixman-1` NormalLibraryTarget(xtrap,$(OBJS)) LintLibraryTarget(xtrap,$(SRCS)) diff --git a/nx-X11/programs/Xserver/Xext/Imakefile b/nx-X11/programs/Xserver/Xext/Imakefile index eb4588e37..199e59f1d 100644 --- a/nx-X11/programs/Xserver/Xext/Imakefile +++ b/nx-X11/programs/Xserver/Xext/Imakefile @@ -161,7 +161,8 @@ XF86INCLUDES = -I$(XF86COMSRC) #endif INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ $(PNRXINCLUDES) $(XF86INCLUDES) \ - $(FONTCACHEINCLUDES) $(DMXINCLUDES) + $(FONTCACHEINCLUDES) $(DMXINCLUDES) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln #if defined(NXAgentServer) && NXAgentServer diff --git a/nx-X11/programs/Xserver/Xi/Imakefile b/nx-X11/programs/Xserver/Xi/Imakefile index 27e1f5df0..29190b711 100644 --- a/nx-X11/programs/Xserver/Xi/Imakefile +++ b/nx-X11/programs/Xserver/Xi/Imakefile @@ -83,7 +83,7 @@ XCOMM $XFree86: xc/programs/Xserver/Xi/Imakefile,v 3.2 1999/04/17 09:08:22 dawes ungrdev.o \ ungrdevb.o \ ungrdevk.o - INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) + INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln NormalLibraryTarget(xinput,$(OBJS)) diff --git a/nx-X11/programs/Xserver/composite/Imakefile b/nx-X11/programs/Xserver/composite/Imakefile index c45aa7f6a..f121e0bbe 100644 --- a/nx-X11/programs/Xserver/composite/Imakefile +++ b/nx-X11/programs/Xserver/composite/Imakefile @@ -6,7 +6,8 @@ INCLUDES = -I../include -I../mi -I../Xext -I../render -I../xfixes \ -I../damageext -I../miext/damage -I$(EXTINCSRC) \ - -I$(XINCLUDESRC) + -I$(XINCLUDESRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln diff --git a/nx-X11/programs/Xserver/damageext/Imakefile b/nx-X11/programs/Xserver/damageext/Imakefile index f7ce4573b..24dcee85c 100644 --- a/nx-X11/programs/Xserver/damageext/Imakefile +++ b/nx-X11/programs/Xserver/damageext/Imakefile @@ -5,7 +5,8 @@ OBJS = damageext.o INCLUDES = -I../include -I../Xext -I../render -I../xfixes -I../miext/damage \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln diff --git a/nx-X11/programs/Xserver/dbe/Imakefile b/nx-X11/programs/Xserver/dbe/Imakefile index 9d9c3fd67..5e5eac4a1 100644 --- a/nx-X11/programs/Xserver/dbe/Imakefile +++ b/nx-X11/programs/Xserver/dbe/Imakefile @@ -17,7 +17,7 @@ XCOMM $XFree86: xc/programs/Xserver/dbe/Imakefile,v 3.10 2001/01/17 22:36:41 daw SRCS = dbe.c midbe.c OBJS = dbe.o midbe.o - INCLUDES = -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) $(EXTRAINCLUDES) + INCLUDES = -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) $(EXTRAINCLUDES) `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln NormalLibraryObjectRule() diff --git a/nx-X11/programs/Xserver/dix/Imakefile b/nx-X11/programs/Xserver/dix/Imakefile index 47e617718..22b21eb95 100644 --- a/nx-X11/programs/Xserver/dix/Imakefile +++ b/nx-X11/programs/Xserver/dix/Imakefile @@ -25,7 +25,8 @@ OBJS = atom.o colormap.o cursor.o devices.o dispatch.o dixutils.o events.o \ tables.o window.o initatoms.o dixfonts.o privates.o pixmap.o $(FFS_OBJ) INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(SERVERSRC)/Xext -I$(SERVERSRC)/lbx + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/lbx \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../os/llib-los.ln /* diff --git a/nx-X11/programs/Xserver/fb/Imakefile b/nx-X11/programs/Xserver/fb/Imakefile index 489d6a201..662a70717 100644 --- a/nx-X11/programs/Xserver/fb/Imakefile +++ b/nx-X11/programs/Xserver/fb/Imakefile @@ -123,7 +123,8 @@ OBJS = $(XFMODOBJ) \ INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ -I$(XINCLUDESRC) \ -I$(XF86SRC)/common $(EXTRAINCLUDES) \ - -I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext + -I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ $(SERVERSRC)/mi/llib-lmi.ln diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 160d01e60..b0aff4b07 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -141,7 +141,8 @@ INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../ -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ $(VFBINCLUDES) \ - `pkg-config --cflags-only-I libxml-2.0` + `pkg-config --cflags-only-I libxml-2.0` \ + `pkg-config --cflags-only-I pixman-1` #ifdef SunArchitecture INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ -I../../../../extras/Mesa/include \ @@ -153,6 +154,7 @@ INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ $(VFBINCLUDES) \ `pkg-config --cflags-only-I libxml-2.0` + `pkg-config --cflags-only-I pixman-1` #else #ifdef cygwinArchitecture INCLUDES = -I. -I$(XBUILDINCDIR) \ @@ -164,6 +166,7 @@ INCLUDES = -I. -I$(XBUILDINCDIR) \ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ $(VFBINCLUDES) \ `pkg-config --cflags-only-I libxml-2.0` + `pkg-config --cflags-only-I pixman-1` #endif #endif diff --git a/nx-X11/programs/Xserver/include/scrnintstr.h b/nx-X11/programs/Xserver/include/scrnintstr.h index 0539ca516..2597d6b67 100644 --- a/nx-X11/programs/Xserver/include/scrnintstr.h +++ b/nx-X11/programs/Xserver/include/scrnintstr.h @@ -709,6 +709,10 @@ typedef struct _Screen { } 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/mi/Imakefile b/nx-X11/programs/Xserver/mi/Imakefile index e62fb0005..290f85790 100644 --- a/nx-X11/programs/Xserver/mi/Imakefile +++ b/nx-X11/programs/Xserver/mi/Imakefile @@ -90,7 +90,8 @@ EXT_DEFINES = ExtensionDefines -UXINPUT -UXF86VIDMODE -UXFreeXDGA -UXF86MISC \ INCLUDES = -I. -I../include -I../render \ -I../xfixes -I../damageext -I../miext/damage \ - -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext + -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln DEFINES = $(FFS_DEFINES) diff --git a/nx-X11/programs/Xserver/miext/cw/Imakefile b/nx-X11/programs/Xserver/miext/cw/Imakefile index 39106ac13..795ed1987 100755 --- a/nx-X11/programs/Xserver/miext/cw/Imakefile +++ b/nx-X11/programs/Xserver/miext/cw/Imakefile @@ -7,7 +7,8 @@ OBJS = cw.o cw_ops.o cw_render.o INCLUDES = -I../../mi -I../../fb -I../../render -I../../composite \ -I../../include -I$(XINCLUDESRC) $(EXTRAINCLUDES) \ - -I$(EXTINCSRC) + -I$(EXTINCSRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln \ ../../mi/llib-lmi.ln diff --git a/nx-X11/programs/Xserver/miext/damage/Imakefile b/nx-X11/programs/Xserver/miext/damage/Imakefile index 7fa745b65..a28786203 100755 --- a/nx-X11/programs/Xserver/miext/damage/Imakefile +++ b/nx-X11/programs/Xserver/miext/damage/Imakefile @@ -11,7 +11,8 @@ OBJS = damage.o INCLUDES = -I. -I../shadow -I../../mi -I../../fb -I../../include -I$(XINCLUDESRC) \ -I$(XF86SRC)/common $(EXTRAINCLUDES) \ - -I../../render -I../cw -I$(EXTINCSRC) + -I../../render -I../cw -I$(EXTINCSRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln \ ../../mi/llib-lmi.ln diff --git a/nx-X11/programs/Xserver/os/Imakefile b/nx-X11/programs/Xserver/os/Imakefile index 18bb9804d..5245b7841 100644 --- a/nx-X11/programs/Xserver/os/Imakefile +++ b/nx-X11/programs/Xserver/os/Imakefile @@ -158,7 +158,8 @@ BOOTSTRAPCFLAGS = $(RANDOM_DEFINES) $(BUGMSG) $(XTRANS_FAILDEFINES) $(NX_DEFINES) INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ - -I$(TOP)/lib/Xau Krb5Includes $(NX_INCLUDES) + -I$(TOP)/lib/Xau Krb5Includes $(NX_INCLUDES) \ + `pkg-config --cflags-only-I pixman-1` DEPEND_DEFINES = $(DBM_DEFINES) $(XDMCP_DEFINES) $(EXT_DEFINES) \ $(TRANS_INCLUDES) $(CONNECTION_FLAGS) $(GETPEER_DEFINES) \ DependDefines diff --git a/nx-X11/programs/Xserver/randr/Imakefile b/nx-X11/programs/Xserver/randr/Imakefile index 19f8143e4..7f920aece 100644 --- a/nx-X11/programs/Xserver/randr/Imakefile +++ b/nx-X11/programs/Xserver/randr/Imakefile @@ -23,7 +23,9 @@ XCOMM $XFree86: xc/programs/Xserver/randr/Imakefile,v 1.1 2001/05/23 03:29:44 ke INCLUDES = -I../include -I../mi \ -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I../render + -I../render \ + `pkg-config --cflags-only-I pixman-1` + LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln DEFINES = -DNXAGENT_SERVER diff --git a/nx-X11/programs/Xserver/record/Imakefile b/nx-X11/programs/Xserver/record/Imakefile index 4d4bf6a73..c24cbb0d9 100644 --- a/nx-X11/programs/Xserver/record/Imakefile +++ b/nx-X11/programs/Xserver/record/Imakefile @@ -16,7 +16,7 @@ XCOMM $XFree86: xc/programs/Xserver/record/Imakefile,v 1.12 2001/11/02 23:29:34 #endif SRCS = record.c set.c OBJS = record.o set.o - INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext + INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln DEFINES = -DNDEBUG diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 1331b1fb4..23f9476ea 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -29,7 +29,8 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 INCLUDES = -I. -I../include -I../mi \ -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I../Xext + -I../Xext \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln NormalLibraryTarget(render,$(OBJS)) diff --git a/nx-X11/programs/Xserver/xfixes/Imakefile b/nx-X11/programs/Xserver/xfixes/Imakefile index e467ed149..84f7c6f16 100755 --- a/nx-X11/programs/Xserver/xfixes/Imakefile +++ b/nx-X11/programs/Xserver/xfixes/Imakefile @@ -5,7 +5,8 @@ OBJS = cursor.o region.o saveset.o select.o xfixes.o INCLUDES = -I. -I../include -I../Xext -I../fixes -I../render \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln diff --git a/nx-X11/programs/Xserver/xkb/Imakefile b/nx-X11/programs/Xserver/xkb/Imakefile index 2ac6fe32d..e63ca4462 100644 --- a/nx-X11/programs/Xserver/xkb/Imakefile +++ b/nx-X11/programs/Xserver/xkb/Imakefile @@ -51,7 +51,8 @@ XF86INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) XKBMisc.o XKBMAlloc.o XKBAlloc.o XKBGAlloc.o \ $(XKBXI_OBJS) $(DDX_OBJS) INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/mi $(XF86INCLUDES) + -I$(SERVERSRC)/mi $(XF86INCLUDES) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln DEFINES = -DXKB_IN_SERVER $(EXTRA_ALLOC_DEFINES) $(XKB_DDXDEFS) $(NX_DEFINES) diff --git a/nx-libs.spec b/nx-libs.spec index 24287f178..98cee6926 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -29,6 +29,7 @@ BuildRequires: fdupes BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(pixman-1) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xpm) @@ -44,6 +45,7 @@ BuildRequires: pkgconfig(xinerama) BuildRequires: libexpat-devel BuildRequires: libpng-devel BuildRequires: libxml2-devel +BuildRequires: pixman-devel BuildRequires: xorg-x11-libX11-devel BuildRequires: xorg-x11-libXext-devel BuildRequires: xorg-x11-libXpm-devel @@ -63,6 +65,7 @@ BuildRequires: xorg-x11-util-devel BuildRequires: expat-devel BuildRequires: libpng-devel BuildRequires: libxml2-devel +BuildRequires: pixman-devel BuildRequires: libX11-devel BuildRequires: libXext-devel BuildRequires: libXpm-devel diff --git a/nxcompext/configure.in b/nxcompext/configure.in index eb6604dba..5b9ccc4da 100644 --- a/nxcompext/configure.in +++ b/nxcompext/configure.in @@ -28,6 +28,8 @@ if test -d "../nx-X11/include" ; then LDFLAGS="$LDFLAGS -L../nx-X11/exports/lib" fi +X_CFLAGS=`pkg-config --cflags-only-I pixman-1` + dnl Check for programs. AC_PROG_CXX -- cgit v1.2.3 From b4e2ec70982358cfc0ad939367dcbfc1bc3b519b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 10 Apr 2016 02:37:19 +0200 Subject: Xserver/GL/glx/Imakefile: Serialize parameters and make Imakefile changes more trackable. --- nx-X11/programs/Xserver/GL/glx/Imakefile | 105 ++++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 23 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile index bf2d760a0..5683cf51c 100644 --- a/nx-X11/programs/Xserver/GL/glx/Imakefile +++ b/nx-X11/programs/Xserver/GL/glx/Imakefile @@ -1,5 +1,7 @@ XCOMM $XFree86: xc/programs/Xserver/GL/glx/Imakefile,v 1.11 2004/01/28 18:11:50 alanh Exp $ +NULL = + #if DoLoadableServer # if !BuildModuleInSubdir # define IHaveModules @@ -22,29 +24,86 @@ LinkSourceFile(glcontextmodes.h, $(MESASRCDIR)/src/mesa/drivers/dri/common) LinkSourceFile(indirect_size.c, $(MESASRCDIR)/src/glx/x11) LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11) - SRCS = global.c glxbuf.c glxcmds.c glxcmdsswap.c glxext.c \ - glxfb.c glximports.c glxmem.c glxpix.c glxscreens.c \ - glxutil.c render2.c render2swap.c renderpix.c \ - renderpixswap.c rensize.c rensizetab.c single2.c \ - single2swap.c singlepix.c singlepixswap.c \ - singlesize.c xfont.c g_disptab.c g_disptab_EXT.c \ - g_render.c g_renderswap.c g_single.c g_singleswap.c \ - glcontextmodes.c indirect_size.c $(MSRCS) - - OBJS = global.o glxbuf.o glxcmds.o glxcmdsswap.o glxext.o \ - glxfb.o glximports.o glxmem.o glxpix.o glxscreens.o \ - glxutil.o render2.o render2swap.o renderpix.o \ - renderpixswap.o rensize.o rensizetab.o single2.o \ - single2swap.o singlepix.o singlepixswap.o \ - singlesize.o xfont.o g_disptab.o g_disptab_EXT.o \ - g_render.o g_renderswap.o g_single.o g_singleswap.o \ - glcontextmodes.o indirect_size.o $(MOBJS) - - INCLUDES = -I$(SERVERSRC)/GL/glx -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(MESASRCDIR)/include \ - -I$(XINCLUDESRC) -I$(SERVERSRC)/mi \ - -I$(EXTINCSRC) -I$(LIBSRC)/GL/include \ - -I$(XF86SRC) \ - `pkg-config --cflags-only-I pixman-1` + SRCS = global.c \ + glxbuf.c \ + glxcmds.c \ + glxcmdsswap.c \ + glxext.c \ + glxfb.c \ + glximports.c \ + glxmem.c \ + glxpix.c \ + glxscreens.c \ + glxutil.c \ + render2.c \ + render2swap.c \ + renderpix.c \ + renderpixswap.c \ + rensize.c \ + rensizetab.c \ + single2.c \ + single2swap.c \ + singlepix.c \ + singlepixswap.c \ + singlesize.c \ + xfont.c \ + g_disptab.c \ + g_disptab_EXT.c \ + g_render.c \ + g_renderswap.c \ + g_single.c \ + g_singleswap.c \ + glcontextmodes. c \ + indirect_size.c \ + $(MSRCS) \ + $(NULL) + + OBJS = global.o \ + glxbuf.o \ + glxcmds.o \ + glxcmdsswap.o \ + glxext.o \ + glxfb.o \ + glximports.o \ + glxmem.o \ + glxpix.o \ + glxscreens.o \ + glxutil.o \ + render2.o \ + render2swap.o \ + renderpix.o \ + renderpixswap.o \ + rensize.o \ + rensizetab.o \ + single2.o \ + single2swap.o \ + singlepix.o \ + singlepixswap.o \ + singlesize.o \ + xfont.o \ + g_disptab.o \ + g_disptab_EXT.o \ + g_render.o \ + g_renderswap.o \ + g_single.o \ + g_singleswap.o \ + glcontextmodes.o \ + indirect_size.o \ + $(MOBJS) \ + $(NULL) + + INCLUDES = -I$(SERVERSRC)/GL/glx \ + -I$(SERVERSRC)/GL/include \ + -I$(SERVERSRC)/include \ + -I$(INCLUDESRC) \ + -I$(MESASRCDIR)/include \ + -I$(XINCLUDESRC) \ + -I$(SERVERSRC)/mi \ + -I$(EXTINCSRC) \ + -I$(LIBSRC)/GL/include \ + -I$(XF86SRC) \ + `pkg-config --cflags-only-I pixman-1` \ + $(NULL) #if defined(DarwinArchitecture) && ((OSMajorVersion == 6 && OSMinorVersion < 3) || OSMajorVersion < 6) NO_EXT_DEFS = -DMISSING_GL_EXTS -- cgit v1.2.3 From e60f281aa5bed47b117f4c001d93da7fa1e1e40d Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 10 Apr 2016 02:45:24 +0200 Subject: hw/nxagent/NXglxext.c: Shrink file, drop duplicate code that can identically be found in GL/glx/glxext.c. --- nx-X11/programs/Xserver/GL/glx/Imakefile | 13 +- nx-X11/programs/Xserver/GL/glx/glxext.c | 5 + nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 381 +------------------------- 3 files changed, 17 insertions(+), 382 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile index 5683cf51c..05dfed738 100644 --- a/nx-X11/programs/Xserver/GL/glx/Imakefile +++ b/nx-X11/programs/Xserver/GL/glx/Imakefile @@ -24,11 +24,19 @@ LinkSourceFile(glcontextmodes.h, $(MESASRCDIR)/src/mesa/drivers/dri/common) LinkSourceFile(indirect_size.c, $(MESASRCDIR)/src/glx/x11) LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11) +#if (!(defined(NXAgentServer) && NXAgentServer)) +NXAGENT_SKIP_SRCS = \ + glxext.c \ + $(NULL) +NXAGENT_SKIP_OBJS = \ + glxext.o \ + $(NULL) +#endif + SRCS = global.c \ glxbuf.c \ glxcmds.c \ glxcmdsswap.c \ - glxext.c \ glxfb.c \ glximports.c \ glxmem.c \ @@ -56,13 +64,13 @@ LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11) glcontextmodes. c \ indirect_size.c \ $(MSRCS) \ + $(NXAGENT_SKIP_SRCS) \ $(NULL) OBJS = global.o \ glxbuf.o \ glxcmds.o \ glxcmdsswap.o \ - glxext.o \ glxfb.o \ glximports.o \ glxmem.o \ @@ -90,6 +98,7 @@ LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11) glcontextmodes.o \ indirect_size.o \ $(MOBJS) \ + $(NXAGENT_SKIP_OBJS) \ $(NULL) INCLUDES = -I$(SERVERSRC)/GL/glx \ diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.c b/nx-X11/programs/Xserver/GL/glx/glxext.c index e7ed3975c..8b4ae4252 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxext.c +++ b/nx-X11/programs/Xserver/GL/glx/glxext.c @@ -390,6 +390,8 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, /************************************************************************/ +#ifndef NXAGENT_SERVER + /* ** Top level dispatcher; all commands are executed from here down. */ @@ -493,6 +495,9 @@ static int __glXSwapDispatch(ClientPtr client) return (*proc)(cl, (GLbyte *) stuff); } +#endif /* NXAGENT_SERVER */ + + int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc) { return BadRequest; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c index 4b9ac9a67..2c3383dd5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c @@ -35,20 +35,7 @@ ** */ -#define NEED_REPLIES -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "glxserver.h" -#include -#include -#include -#include "g_disptab.h" -#include "unpack.h" -#include "glxutil.h" -#include "glxext.h" -#include "micmap.h" +#include "../../GL/glx/glxext.c" #include "Trap.h" @@ -57,362 +44,6 @@ #undef TEST #undef DEBUG -void GlxWrapInitVisuals(miInitVisualsProcPtr *); -void GlxSetVisualConfigs(int nconfigs, - __GLXvisualConfig *configs, void **privates); - -static __GLXextensionInfo *__glXExt /* = &__glDDXExtensionInfo */; - -/* -** Forward declarations. -*/ -static int __glXSwapDispatch(ClientPtr); -static int __glXDispatch(ClientPtr); - -/* -** Called when the extension is reset. -*/ -static void ResetExtension(ExtensionEntry* extEntry) -{ - __glXFlushContextCache(); - (*__glXExt->resetExtension)(); - __glXScreenReset(); -} - -/* -** Initialize the per-client context storage. -*/ -static void ResetClientState(int clientIndex) -{ - __GLXclientState *cl = __glXClients[clientIndex]; - - if (cl->returnBuf) __glXFree(cl->returnBuf); - if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf); - if (cl->currentContexts) __glXFree(cl->currentContexts); - __glXMemset(cl, 0, sizeof(__GLXclientState)); - /* - ** By default, assume that the client supports - ** GLX major version 1 minor version 0 protocol. - */ - cl->GLClientmajorVersion = 1; - cl->GLClientminorVersion = 0; - if (cl->GLClientextensions) __glXFree(cl->GLClientextensions); - -} - -/* -** Reset state used to keep track of large (multi-request) commands. -*/ -void __glXResetLargeCommandStatus(__GLXclientState *cl) -{ - cl->largeCmdBytesSoFar = 0; - cl->largeCmdBytesTotal = 0; - cl->largeCmdRequestsSoFar = 0; - cl->largeCmdRequestsTotal = 0; -} - -/* -** This procedure is called when the client who created the context goes -** away OR when glXDestroyContext is called. In either case, all we do is -** flag that the ID is no longer valid, and (maybe) free the context. -** use. -*/ -static int ContextGone(__GLXcontext* cx, XID id) -{ - cx->idExists = GL_FALSE; - if (!cx->isCurrent) { - __glXFreeContext(cx); - } - - return True; -} - -/* -** Free a client's state. -*/ -static int ClientGone(int clientIndex, XID id) -{ - __GLXcontext *cx; - __GLXclientState *cl = __glXClients[clientIndex]; - int i; - - if (cl) { - /* - ** Free all the contexts that are current for this client. - */ - for (i=0; i < cl->numCurrentContexts; i++) { - cx = cl->currentContexts[i]; - if (cx) { - __glXDeassociateContext(cx); - cx->isCurrent = GL_FALSE; - if (!cx->idExists) { - __glXFreeContext(cx); - } - } - } - /* - ** Re-initialize the client state structure. Don't free it because - ** we'll probably get another client with this index and use the struct - ** again. There is a maximum of MAXCLIENTS of these structures. - */ - ResetClientState(clientIndex); - } - - return True; -} - -/* -** Free a GLX Pixmap. -*/ -static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id) -{ - PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw; - - pGlxPixmap->idExists = False; - if (!pGlxPixmap->refcnt) { - /* - ** The DestroyPixmap routine should decrement the refcount and free - ** only if it's zero. - */ - (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap); - __glXFree(pGlxPixmap); - } - - return True; -} - -/* -** Free a context. -*/ -GLboolean __glXFreeContext(__GLXcontext *cx) -{ - if (cx->idExists || cx->isCurrent) return GL_FALSE; - - if (!cx->isDirect) { - if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) { - return GL_FALSE; - } - } - if (cx->feedbackBuf) __glXFree(cx->feedbackBuf); - if (cx->selectBuf) __glXFree(cx->selectBuf); - __glXFree(cx); - if (cx == __glXLastContext) { - __glXFlushContextCache(); - } - - return GL_TRUE; -} - -extern RESTYPE __glXSwapBarrierRes; - -static int SwapBarrierGone(int screen, XID drawable) -{ - if (__glXSwapBarrierFuncs && - __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc != NULL) { - __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc(screen, drawable, 0); - } - FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE); - return True; -} - -/************************************************************************/ - -/* -** These routines can be used to check whether a particular GL command -** has caused an error. Specifically, we use them to check whether a -** given query has caused an error, in which case a zero-length data -** reply is sent to the client. -*/ - -static GLboolean errorOccured = GL_FALSE; - -/* -** The GL was will call this routine if an error occurs. -*/ -void __glXErrorCallBack(__GLinterface *gc, GLenum code) -{ - errorOccured = GL_TRUE; -} - -/* -** Clear the error flag before calling the GL command. -*/ -void __glXClearErrorOccured(void) -{ - errorOccured = GL_FALSE; -} - -/* -** Check if the GL command caused an error. -*/ -GLboolean __glXErrorOccured(void) -{ - return errorOccured; -} - -/************************************************************************/ - -/* -** Initialize the GLX extension. -*/ -void GlxExtensionInit(void) -{ - ExtensionEntry *extEntry; - int i; - - __glXContextRes = CreateNewResourceType((DeleteType)ContextGone); - __glXClientRes = CreateNewResourceType((DeleteType)ClientGone); - __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone); - - /* - ** Add extension to server extensions. - */ - extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, - __GLX_NUMBER_ERRORS, __glXDispatch, - __glXSwapDispatch, ResetExtension, - StandardMinorOpcode); - if (!extEntry) { - FatalError("__glXExtensionInit: AddExtensions failed\n"); - return; - } - if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) { - ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); - return; - } - - __glXBadContext = extEntry->errorBase + GLXBadContext; - __glXBadContextState = extEntry->errorBase + GLXBadContextState; - __glXBadDrawable = extEntry->errorBase + GLXBadDrawable; - __glXBadPixmap = extEntry->errorBase + GLXBadPixmap; - __glXBadContextTag = extEntry->errorBase + GLXBadContextTag; - __glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow; - __glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest; - __glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest; - __glXUnsupportedPrivateRequest = extEntry->errorBase + - GLXUnsupportedPrivateRequest; - - __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone); - - /* - ** Initialize table of client state. There is never a client 0. - */ - for (i=1; i <= MAXCLIENTS; i++) { - __glXClients[i] = 0; - } - - /* - ** Initialize screen specific data. - */ - __glXScreenInit(screenInfo.numScreens); -} - -/************************************************************************/ - -Bool __glXCoreType(void) -{ - return __glXExt->type; -} - -/************************************************************************/ - -void GlxSetVisualConfigs(int nconfigs, - __GLXvisualConfig *configs, void **privates) -{ - (*__glXExt->setVisualConfigs)(nconfigs, configs, privates); -} - -static miInitVisualsProcPtr saveInitVisualsProc; - -Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB, - int preferredVis) -{ - Bool ret; - - if (saveInitVisualsProc) { - ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp, - rootDepthp, defaultVisp, sizes, bitsPerRGB, - preferredVis); - if (!ret) - return False; - } - (*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp, - defaultVisp, sizes, bitsPerRGB); - return True; -} - -void -GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc) -{ - saveInitVisualsProc = *initVisProc; - *initVisProc = GlxInitVisuals; - /* HACK: this shouldn't be done here but it's the earliest time */ - __glXExt = __glXglDDXExtensionInfo(); /* from GLcore */ -} - -/************************************************************************/ - -void __glXFlushContextCache(void) -{ - __glXLastContext = 0; -} - -/* -** Make a context the current one for the GL (in this implementation, there -** is only one instance of the GL, and we use it to serve all GL clients by -** switching it between different contexts). While we are at it, look up -** a context by its tag and return its (__GLXcontext *). -*/ -__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, - int *error) -{ - __GLXcontext *cx; - - /* - ** See if the context tag is legal; it is managed by the extension, - ** so if it's invalid, we have an implementation error. - */ - cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag); - if (!cx) { - cl->client->errorValue = tag; - *error = __glXBadContextTag; - return 0; - } - - if (!cx->isDirect) { - if (cx->drawPriv == NULL) { - /* - ** The drawable has vanished. It must be a window, because only - ** windows can be destroyed from under us; GLX pixmaps are - ** refcounted and don't go away until no one is using them. - */ - *error = __glXBadCurrentWindow; - return 0; - } - } - - if (cx == __glXLastContext) { - /* No need to re-bind */ - return cx; - } - - /* Make this context the current one for the GL. */ - if (!cx->isDirect) { - if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) { - /* Bind failed, and set the error code. Bummer */ - cl->client->errorValue = cx->id; - *error = __glXBadContextState; - return 0; - } - } - __glXLastContext = cx; - return cx; -} - -/************************************************************************/ - /* ** Top level dispatcher; all commands are executed from here down. */ @@ -563,13 +194,3 @@ static int __glXSwapDispatch(ClientPtr client) return result; } - -int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc) -{ - return BadRequest; -} - -void __glXNoSuchRenderOpcode(GLbyte *pc) -{ - return; -} -- cgit v1.2.3 From a08e2323e838099cc2079287c5b3fd1e9b7f20f7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 28 Jun 2016 12:06:50 +0200 Subject: Xserver Imakefiles: Make sure NXAGENT_SERVER is defined for all extensions. --- nx-X11/programs/Xserver/GL/glx/Imakefile | 10 ++++++++-- nx-X11/programs/Xserver/Xi/Imakefile | 6 ++++++ nx-X11/programs/Xserver/composite/Imakefile | 10 +++++++++- nx-X11/programs/Xserver/damageext/Imakefile | 10 ++++++++++ nx-X11/programs/Xserver/randr/Imakefile | 2 +- nx-X11/programs/Xserver/record/Imakefile | 16 +++++++++++----- nx-X11/programs/Xserver/render/Imakefile | 8 ++++++-- nx-X11/programs/Xserver/xfixes/Imakefile | 10 ++++++++++ nx-X11/programs/Xserver/xkb/Imakefile | 2 +- 9 files changed, 62 insertions(+), 12 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile index 05dfed738..24a35d22e 100644 --- a/nx-X11/programs/Xserver/GL/glx/Imakefile +++ b/nx-X11/programs/Xserver/GL/glx/Imakefile @@ -31,6 +31,8 @@ NXAGENT_SKIP_SRCS = \ NXAGENT_SKIP_OBJS = \ glxext.o \ $(NULL) +#else + NX_DEFINES = -DNXAGENT_SERVER #endif SRCS = global.c \ @@ -124,8 +126,12 @@ NXAGENT_SKIP_OBJS = \ XCOMM If you add "-DDEBUG" in DEFINES, then make sure you also XCOMM add DEBUG to the define in ../mesa/src/X/xf86glx.c - DEFINES = $(GLX_DEFINES) $(NO_EXT_DEFS) $(APIENTRY_DEFS) - + DEFINES = \ + $(GLX_DEFINES) \ + $(NO_EXT_DEFS) \ + $(APIENTRY_DEFS) \ + $(NX_DEFINES) \ + $(NULL) #ifdef IHaveModules ModuleObjectRule() diff --git a/nx-X11/programs/Xserver/Xi/Imakefile b/nx-X11/programs/Xserver/Xi/Imakefile index 29190b711..b40f0d06b 100644 --- a/nx-X11/programs/Xserver/Xi/Imakefile +++ b/nx-X11/programs/Xserver/Xi/Imakefile @@ -86,6 +86,12 @@ XCOMM $XFree86: xc/programs/Xserver/Xi/Imakefile,v 3.2 1999/04/17 09:08:22 dawes INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln +#if defined(NXAgentServer) && NXAgentServer + NX_DEFINES = -DNXAGENT_SERVER +#endif + + DEFINES = $(NX_DEFINES) + NormalLibraryTarget(xinput,$(OBJS)) NormalLibraryObjectRule() LintLibraryTarget(xinput,$(SRCS)) diff --git a/nx-X11/programs/Xserver/composite/Imakefile b/nx-X11/programs/Xserver/composite/Imakefile index 911950182..cf44ded4a 100644 --- a/nx-X11/programs/Xserver/composite/Imakefile +++ b/nx-X11/programs/Xserver/composite/Imakefile @@ -1,5 +1,7 @@ #include + NULL = + SRCS = compalloc.c compext.c compinit.c compoverlay.c compwindow.c OBJS = compalloc.o compext.o compinit.o compoverlay.o compwindow.o @@ -11,7 +13,13 @@ LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln - DEFINES = -DNXAGENT_SERVER +#if defined(NXAgentServer) && NXAgentServer + NX_DEFINES = -DNXAGENT_SERVER +#endif + + DEFINES = \ + $(NX_DEFINES) \ + $(NULL) NormalLibraryTarget(composite,$(OBJS)) NormalLibraryObjectRule() diff --git a/nx-X11/programs/Xserver/damageext/Imakefile b/nx-X11/programs/Xserver/damageext/Imakefile index 24dcee85c..d8cc1bfa4 100644 --- a/nx-X11/programs/Xserver/damageext/Imakefile +++ b/nx-X11/programs/Xserver/damageext/Imakefile @@ -1,5 +1,7 @@ #include + NULL = + SRCS = damageext.c OBJS = damageext.o @@ -10,6 +12,14 @@ LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln +#if defined(NXAgentServer) && NXAgentServer + NX_DEFINES = -DNXAGENT_SERVER +#endif + + DEFINES = \ + $(NX_DEFINES) \ + $(NULL) + NormalLibraryTarget(damage,$(OBJS)) NormalLibraryObjectRule() LintLibraryTarget(damage,$(SRCS)) diff --git a/nx-X11/programs/Xserver/randr/Imakefile b/nx-X11/programs/Xserver/randr/Imakefile index 8dc8de1b7..2959e05ab 100644 --- a/nx-X11/programs/Xserver/randr/Imakefile +++ b/nx-X11/programs/Xserver/randr/Imakefile @@ -62,7 +62,7 @@ XCOMM $XFree86: xc/programs/Xserver/randr/Imakefile,v 1.1 2001/05/23 03:29:44 ke PNRX_DEFINES = -DXINERAMA -DPANORAMIX #endif -#if defined(NXAgentServer) +#if defined(NXAgentServer) && NXAgentServer NX_DEFINES = -DNXAGENT_SERVER #endif diff --git a/nx-X11/programs/Xserver/record/Imakefile b/nx-X11/programs/Xserver/record/Imakefile index c24cbb0d9..cabcd558d 100644 --- a/nx-X11/programs/Xserver/record/Imakefile +++ b/nx-X11/programs/Xserver/record/Imakefile @@ -1,10 +1,8 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ - - - - XCOMM $XFree86: xc/programs/Xserver/record/Imakefile,v 1.12 2001/11/02 23:29:34 dawes Exp $ + NULL = + #if DoLoadableServer #define IHaveSubdirs #endif @@ -18,7 +16,15 @@ XCOMM $XFree86: xc/programs/Xserver/record/Imakefile,v 1.12 2001/11/02 23:29:34 OBJS = record.o set.o INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln - DEFINES = -DNDEBUG + +#if defined(NXAgentServer) && NXAgentServer + NX_DEFINES = -DNXAGENT_SERVER +#endif + + DEFINES = \ + -DNDEBUG \ + $(NX_DEFINES) \ + $(NULL) NormalLibraryObjectRule() NormalLibraryTarget(record,$(OBJS)) diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 2d918458b..6c3a7880c 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -1,6 +1,6 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 keithp Exp $ -NULL = + NULL = #include @@ -20,7 +20,7 @@ NXAGENT_SKIP_OBJS = \ render.o \ $(NULL) #else - DEFINES = -DNXAGENT_SERVER + NX_DEFINES = -DNXAGENT_SERVER #endif SRCS = animcur.c \ @@ -53,6 +53,10 @@ NXAGENT_SKIP_OBJS = \ `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln + DEFINES = \ + $(NX_DEFINES) \ + $(NULL) + NormalLibraryTarget(render,$(OBJS)) NormalLibraryObjectRule() LintLibraryTarget(render,$(SRCS)) diff --git a/nx-X11/programs/Xserver/xfixes/Imakefile b/nx-X11/programs/Xserver/xfixes/Imakefile index 84f7c6f16..83e368488 100755 --- a/nx-X11/programs/Xserver/xfixes/Imakefile +++ b/nx-X11/programs/Xserver/xfixes/Imakefile @@ -1,5 +1,7 @@ #include + NULL = + SRCS = cursor.c region.c saveset.c select.c xfixes.c OBJS = cursor.o region.o saveset.o select.o xfixes.o @@ -10,6 +12,14 @@ LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln +#if defined(NXAgentServer) && NXAgentServer + NX_DEFINES = -DNXAGENT_SERVER +#endif + + DEFINES = \ + $(NX_DEFINES) \ + $(NULL) + NormalLibraryTarget(xfixes,$(OBJS)) NormalLibraryObjectRule() LintLibraryTarget(xfixes,$(SRCS)) diff --git a/nx-X11/programs/Xserver/xkb/Imakefile b/nx-X11/programs/Xserver/xkb/Imakefile index e63ca4462..3581324fc 100644 --- a/nx-X11/programs/Xserver/xkb/Imakefile +++ b/nx-X11/programs/Xserver/xkb/Imakefile @@ -26,7 +26,7 @@ XKB_DISABLE = -DXKB_DFLT_DISABLED=0 XKB_DDXDEFS = XkbServerDefines #if defined(NXAgentServer) && NXAgentServer -NX_DEFINES = -DNXAGENT_SERVER + NX_DEFINES = -DNXAGENT_SERVER #endif #if (defined(XorgServer) && XorgServer) -- cgit v1.2.3 From 487870fff5cd1bc3db5ade4f5721f483f96119c7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 28 Jun 2016 12:07:10 +0200 Subject: Xserver/include/protocol-versions.h: Switch to having an Xserver-specific header file containing all use protocol versions. --- nx-X11/programs/Xserver/GL/glx/glxserver.h | 6 +- nx-X11/programs/Xserver/Xext/panoramiX.c | 6 +- nx-X11/programs/Xserver/Xext/saver.c | 6 +- nx-X11/programs/Xserver/Xext/security.c | 5 +- nx-X11/programs/Xserver/Xext/shape.c | 5 +- nx-X11/programs/Xserver/Xext/shm.c | 5 +- nx-X11/programs/Xserver/Xext/sync.c | 5 +- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 5 +- nx-X11/programs/Xserver/Xext/xres.c | 5 +- nx-X11/programs/Xserver/Xi/extinit.c | 6 +- nx-X11/programs/Xserver/composite/compext.c | 9 +- nx-X11/programs/Xserver/damageext/damageext.c | 11 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 1 - nx-X11/programs/Xserver/hw/nxagent/Render.c | 23 +-- .../programs/Xserver/include/protocol-versions.h | 182 +++++++++++++++++++++ nx-X11/programs/Xserver/randr/rrdispatch.c | 5 - nx-X11/programs/Xserver/randr/rrxinerama.c | 5 - nx-X11/programs/Xserver/record/record.c | 6 +- nx-X11/programs/Xserver/render/render.c | 6 +- nx-X11/programs/Xserver/xfixes/xfixes.c | 19 ++- nx-X11/programs/Xserver/xkb/xkb.c | 11 +- 21 files changed, 257 insertions(+), 75 deletions(-) create mode 100644 nx-X11/programs/Xserver/include/protocol-versions.h (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxserver.h b/nx-X11/programs/Xserver/GL/glx/glxserver.h index 4238de537..a04d361fd 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxserver.h +++ b/nx-X11/programs/Xserver/GL/glx/glxserver.h @@ -52,7 +52,7 @@ #include #include #include "GL/glx_ansic.h" - +#include "protocol-versions.h" #include /* @@ -75,8 +75,8 @@ typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate; #include "glxerror.h" -#define GLX_SERVER_MAJOR_VERSION 1 -#define GLX_SERVER_MINOR_VERSION 2 +#define GLX_SERVER_MAJOR_VERSION SERVER_GLX_MAJOR_VERSION +#define GLX_SERVER_MINOR_VERSION SERVER_GLX_MINOR_VERSION #ifndef True #define True 1 diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index 9c5eefe4a..a1bfa91d6 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -59,7 +59,7 @@ Equipment Corporation. #include "picturestr.h" #endif #include "modinit.h" - +#include "protocol-versions.h" #ifdef GLXPROXY extern VisualPtr glxMatchVisual(ScreenPtr pScreen, @@ -942,8 +942,8 @@ ProcPanoramiXQueryVersion (ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.majorVersion = PANORAMIX_MAJOR_VERSION; - rep.minorVersion = PANORAMIX_MINOR_VERSION; + rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION; + rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index a871be9b7..81f502189 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -65,6 +65,8 @@ in this Software without prior written authorization from the X Consortium. #include "modinit.h" +#include "protocol-versions.h" + #if 0 static unsigned char ScreenSaverReqCode = 0; #endif @@ -699,8 +701,8 @@ ProcScreenSaverQueryVersion (client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.majorVersion = ScreenSaverMajorVersion; - rep.minorVersion = ScreenSaverMinorVersion; + rep.majorVersion = SERVER_SAVER_MAJOR_VERSION; + rep.minorVersion = SERVER_SAVER_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 13da54386..096b88d20 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -56,6 +56,7 @@ in this Software without prior written authorization from The Open Group. #include "gcstruct.h" #include "colormapst.h" #include "propertyst.h" +#include "protocol-versions.h" #define _SECURITY_SERVER #include #include @@ -486,8 +487,8 @@ ProcSecurityQueryVersion( rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.length = 0; - rep.majorVersion = SECURITY_MAJOR_VERSION; - rep.minorVersion = SECURITY_MINOR_VERSION; + rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION; + rep.minorVersion = SERVER_SECURITY_MINOR_VERSION; if(client->swapped) { register char n; diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index 51fcd7d9f..b272f1bbe 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -45,6 +45,7 @@ in this Software without prior written authorization from The Open Group. #include "resource.h" #include "opaque.h" #include +#include "protocol-versions.h" #include "regionstr.h" #include "gcstruct.h" #ifdef EXTMODULE @@ -295,8 +296,8 @@ ProcShapeQueryVersion (client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.majorVersion = SHAPE_MAJOR_VERSION; - rep.minorVersion = SHAPE_MINOR_VERSION; + rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION; + rep.minorVersion = SERVER_SHAPE_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index bca8c2e0e..83d6eaaab 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -65,6 +65,7 @@ in this Software without prior written authorization from The Open Group. #ifdef EXTMODULE #include "xf86_ansic.h" #endif +#include "protocol-versions.h" #ifdef PANORAMIX #include "panoramiX.h" @@ -354,8 +355,8 @@ ProcShmQueryVersion(client) rep.sequenceNumber = client->sequence; rep.sharedPixmaps = sharedPixmaps; rep.pixmapFormat = pixmapFormat; - rep.majorVersion = SHM_MAJOR_VERSION; - rep.minorVersion = SHM_MINOR_VERSION; + rep.majorVersion = SERVER_SHM_MAJOR_VERSION; + rep.minorVersion = SERVER_SHM_MINOR_VERSION; rep.uid = geteuid(); rep.gid = getegid(); if (client->swapped) { diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index c122e2860..f79cc1b23 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -70,6 +70,7 @@ PERFORMANCE OF THIS SOFTWARE. #define _SYNC_SERVER #include #include +#include "protocol-versions.h" #ifdef EXTMODULE #include "xf86_ansic.h" @@ -1349,8 +1350,8 @@ ProcSyncInitialize(client) memset(&rep, 0, sizeof(xSyncInitializeReply)); rep.type = X_Reply; rep.sequenceNumber = client->sequence; - rep.majorVersion = SYNC_MAJOR_VERSION; - rep.minorVersion = SYNC_MINOR_VERSION; + rep.majorVersion = SERVER_SYNC_MAJOR_VERSION; + rep.minorVersion = SERVER_SYNC_MINOR_VERSION; rep.length = 0; if (client->swapped) diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index c0cc7f938..848f0114b 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -72,6 +72,7 @@ #include "gcstruct.h" #include "dixfontstr.h" #include "extnsionst.h" +#include "protocol-versions.h" #define _XF86BIGFONT_SERVER_ #include @@ -357,8 +358,8 @@ ProcXF86BigfontQueryVersion( reply.type = X_Reply; reply.length = 0; reply.sequenceNumber = client->sequence; - reply.majorVersion = XF86BIGFONT_MAJOR_VERSION; - reply.minorVersion = XF86BIGFONT_MINOR_VERSION; + reply.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION; + reply.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION; reply.uid = geteuid(); reply.gid = getegid(); #ifdef HAS_SHM diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c index 7b3555452..3d5ae162c 100644 --- a/nx-X11/programs/Xserver/Xext/xres.c +++ b/nx-X11/programs/Xserver/Xext/xres.c @@ -20,6 +20,7 @@ #include #include "pixmapstr.h" #include "modinit.h" +#include "protocol-versions.h" static int ProcXResQueryVersion (ClientPtr client) @@ -38,8 +39,8 @@ ProcXResQueryVersion (ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.server_major = XRES_MAJOR_VERSION; - rep.server_minor = XRES_MINOR_VERSION; + rep.server_major = SERVER_XRES_MAJOR_VERSION; + rep.server_minor = SERVER_XRES_MINOR_VERSION; if (client->swapped) { int n; swaps(&rep.sequenceNumber, n); diff --git a/nx-X11/programs/Xserver/Xi/extinit.c b/nx-X11/programs/Xserver/Xi/extinit.c index 750fa46cb..81f5ca551 100644 --- a/nx-X11/programs/Xserver/Xi/extinit.c +++ b/nx-X11/programs/Xserver/Xi/extinit.c @@ -74,6 +74,7 @@ SOFTWARE. #include "extinit.h" #include "exglobals.h" #include "swaprep.h" +#include "protocol-versions.h" /* modules local to Xi */ #include "allowev.h" @@ -204,8 +205,9 @@ Mask PropagateMask[MAX_DEVICES]; static XExtensionVersion thisversion = {XI_Present, - XI_Add_XChangeDeviceControl_Major, - XI_Add_XChangeDeviceControl_Minor}; + SERVER_XI_MAJOR_VERSION, + SERVER_XI_MINOR_VERSION, + }; /********************************************************************** * diff --git a/nx-X11/programs/Xserver/composite/compext.c b/nx-X11/programs/Xserver/composite/compext.c index d5f8fd6d4..dbde88625 100644 --- a/nx-X11/programs/Xserver/composite/compext.c +++ b/nx-X11/programs/Xserver/composite/compext.c @@ -29,16 +29,9 @@ #include "compint.h" #include "XI.h" #include "XIproto.h" +#include "protocol-versions.h" #include "extinit.h" -#ifndef SERVER_COMPOSITE_MAJOR_VERSION -#define SERVER_COMPOSITE_MAJOR_VERSION 0 -#endif - -#ifndef SERVER_COMPOSITE_MINOR_VERSION -#define SERVER_COMPOSITE_MINOR_VERSION 4 -#endif - static CARD8 CompositeReqCode; #ifndef NXAGENT_SERVER diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index 8d03dfed5..d14f14985 100755 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -27,6 +27,7 @@ #endif #include "damageextint.h" +#include "protocol-versions.h" unsigned char DamageReqCode; int DamageEventBase; @@ -143,16 +144,16 @@ ProcDamageQueryVersion(ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - if (stuff->majorVersion < DAMAGE_MAJOR) { + if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; } else { - rep.majorVersion = DAMAGE_MAJOR; - if (stuff->majorVersion == DAMAGE_MAJOR && - stuff->minorVersion < DAMAGE_MINOR) + rep.majorVersion = SERVER_DAMAGE_MAJOR_VERSION; + if (stuff->majorVersion == SERVER_DAMAGE_MAJOR_VERSION && + stuff->minorVersion < SERVER_DAMAGE_MINOR_VERSION) rep.minorVersion = stuff->minorVersion; else - rep.minorVersion = DAMAGE_MINOR; + rep.minorVersion = SERVER_DAMAGE_MINOR_VERSION; } pDamageClient->major_version = rep.majorVersion; pDamageClient->minor_version = rep.minorVersion; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index d2ff7fd8f..1ce72cbbe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -47,7 +47,6 @@ in this Software without prior written authorization from The Open Group. /* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ #include - #include "Trap.h" #include "Agent.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 866ab581c..8c822319d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -31,6 +31,7 @@ #include "mipict.h" #include "fbpict.h" #include "dixstruct.h" +#include "protocol-versions.h" #include "Agent.h" #include "Drawable.h" @@ -217,26 +218,26 @@ void nxagentRenderExtensionInit() + two versions. */ - if (major_version > RENDER_MAJOR || - (major_version == RENDER_MAJOR && - minor_version > RENDER_MINOR)) + if (major_version > SERVER_RENDER_MAJOR_VERSION || + (major_version == SERVER_RENDER_MAJOR_VERSION && + minor_version > SERVER_RENDER_MINOR_VERSION)) { #ifdef TEST fprintf(stderr, "nxagentRenderExtensionInit: Using render version [%d.%d] with " - "remote version [%d.%d].\n", RENDER_MAJOR, RENDER_MINOR, + "remote version [%d.%d].\n", SERVER_RENDER_MAJOR_VERSION, SERVER_RENDER_MINOR_VERSION, major_version, minor_version); #endif - nxagentRenderVersionMajor = RENDER_MAJOR; - nxagentRenderVersionMinor = RENDER_MINOR; + nxagentRenderVersionMajor = SERVER_RENDER_MAJOR_VERSION; + nxagentRenderVersionMinor = SERVER_RENDER_MINOR_VERSION; } - else if (major_version < RENDER_MAJOR || - (major_version == RENDER_MAJOR && - minor_version < RENDER_MINOR)) + else if (major_version < SERVER_RENDER_MAJOR_VERSION || + (major_version == SERVER_RENDER_MAJOR_VERSION && + minor_version < SERVER_RENDER_MINOR_VERSION)) { #ifdef TEST fprintf(stderr, "Info: Local render version %d.%d is higher " - "than remote version %d.%d.\n", RENDER_MAJOR, RENDER_MINOR, + "than remote version %d.%d.\n", SERVER_RENDER_MAJOR_VERSION, SERVER_RENDER_MINOR_VERSION, major_version, minor_version); fprintf(stderr, "Info: Lowering the render version reported to clients.\n"); @@ -249,7 +250,7 @@ void nxagentRenderExtensionInit() { #ifdef TEST fprintf(stderr, "nxagentRenderExtensionInit: Local render version %d.%d " - "matches remote version %d.%d.\n", RENDER_MAJOR, RENDER_MINOR, + "matches remote version %d.%d.\n", SERVER_RENDER_MAJOR_VERSION, SERVER_RENDER_MINOR_VERSION, major_version, minor_version); #endif 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/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c index a8ca35d16..b15d1ad20 100644 --- a/nx-X11/programs/Xserver/randr/rrdispatch.c +++ b/nx-X11/programs/Xserver/randr/rrdispatch.c @@ -21,12 +21,7 @@ */ #include "randrstr.h" -#ifndef NXAGENT_SERVER #include "protocol-versions.h" -#else -#define SERVER_RANDR_MAJOR_VERSION 1 -#define SERVER_RANDR_MINOR_VERSION 5 -#endif Bool RRClientKnowsRates(ClientPtr pClient) diff --git a/nx-X11/programs/Xserver/randr/rrxinerama.c b/nx-X11/programs/Xserver/randr/rrxinerama.c index 9a164578f..5332ac01b 100644 --- a/nx-X11/programs/Xserver/randr/rrxinerama.c +++ b/nx-X11/programs/Xserver/randr/rrxinerama.c @@ -88,12 +88,7 @@ #include "randrstr.h" #include "swaprep.h" #include "panoramiXproto.h" -#ifndef NXAGENT_SERVER #include "protocol-versions.h" -#else -#define SERVER_RRXINERAMA_MAJOR_VERSION 1 -#define SERVER_RRXINERAMA_MINOR_VERSION 1 -#endif /* Xinerama is not multi-screen capable; just report about screen 0 */ #define RR_XINERAMA_SCREEN 0 diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index 2c5b867b4..590a343a0 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -60,6 +60,8 @@ and Jim Haggerty of Metheus. #include "cursor.h" #endif +#include "protocol-versions.h" + static RESTYPE RTContext; /* internal resource type for Record contexts */ static int RecordErrorBase; /* first Record error number */ @@ -2002,8 +2004,8 @@ ProcRecordQueryVersion(client) rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.length = 0; - rep.majorVersion = RECORD_MAJOR_VERSION; - rep.minorVersion = RECORD_MINOR_VERSION; + rep.majorVersion = SERVER_RECORD_MAJOR_VERSION; + rep.minorVersion = SERVER_RECORD_MINOR_VERSION; if(client->swapped) { swaps(&rep.sequenceNumber, n); diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index c73ff8305..5a4114adc 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -52,6 +52,8 @@ #include "xf86_ansic.h" #endif +#include "protocol-versions.h" + #if !defined(UINT32_MAX) #define UINT32_MAX 0xffffffffU #endif @@ -293,8 +295,8 @@ ProcRenderQueryVersion (ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.majorVersion = RENDER_MAJOR; - rep.minorVersion = RENDER_MINOR; + rep.majorVersion = SERVER_RENDER_MAJOR_VERSION; + rep.minorVersion = SERVER_RENDER_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c index 3b3a0f305..f97a0632d 100755 --- a/nx-X11/programs/Xserver/xfixes/xfixes.c +++ b/nx-X11/programs/Xserver/xfixes/xfixes.c @@ -27,6 +27,7 @@ #endif #include "xfixesint.h" +#include "protocol-versions.h" unsigned char XFixesReqCode; int XFixesEventBase; @@ -46,16 +47,16 @@ ProcXFixesQueryVersion(ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - if (stuff->majorVersion < XFIXES_MAJOR) { - rep.majorVersion = stuff->majorVersion; - rep.minorVersion = stuff->minorVersion; + if (stuff->majorVersion < SERVER_XFIXES_MAJOR_VERSION) { + rep.majorVersion = stuff->majorVersion; + rep.minorVersion = stuff->minorVersion; } else { - rep.majorVersion = XFIXES_MAJOR; - if (stuff->majorVersion == XFIXES_MAJOR && - stuff->minorVersion < XFIXES_MINOR) - rep.minorVersion = stuff->minorVersion; - else - rep.minorVersion = XFIXES_MINOR; + rep.majorVersion = SERVER_XFIXES_MAJOR_VERSION; + if (stuff->majorVersion == SERVER_XFIXES_MAJOR_VERSION && + stuff->minorVersion < SERVER_XFIXES_MINOR_VERSION) + rep.minorVersion = stuff->minorVersion; + else + rep.minorVersion = SERVER_XFIXES_MINOR_VERSION; } pXFixesClient->major_version = rep.majorVersion; pXFixesClient->minor_version = rep.minorVersion; diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 4a1561db3..20aab8ef0 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -41,6 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "extnsionst.h" #include "xkb.h" +#include "protocol-versions.h" #include @@ -168,9 +169,9 @@ ProcXkbUseExtension(ClientPtr client) int supported; REQUEST_SIZE_MATCH(xkbUseExtensionReq); - if (stuff->wantedMajor != XkbMajorVersion) { + if (stuff->wantedMajor != SERVER_XKB_MAJOR_VERSION) { /* pre-release version 0.65 is compatible with 1.00 */ - supported= ((XkbMajorVersion==1)&& + supported= ((SERVER_XKB_MAJOR_VERSION==1)&& (stuff->wantedMajor==0)&&(stuff->wantedMinor==65)); } else supported = 1; @@ -190,15 +191,15 @@ ProcXkbUseExtension(ClientPtr client) client->index, (long)client->clientAsMask, stuff->wantedMajor,stuff->wantedMinor, - XkbMajorVersion,XkbMinorVersion); + SERVER_XKB_MAJOR_VERSION,SERVER_XKB_MINOR_VERSION); } memset(&rep, 0, sizeof(xkbUseExtensionReply)); rep.type = X_Reply; rep.supported = supported; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.serverMajor = XkbMajorVersion; - rep.serverMinor = XkbMinorVersion; + rep.serverMajor = SERVER_XKB_MAJOR_VERSION; + rep.serverMinor = SERVER_XKB_MINOR_VERSION; if ( client->swapped ) { swaps(&rep.sequenceNumber, n); swaps(&rep.serverMajor, n); -- cgit v1.2.3 From acf87144d019f18e646501657d9082c6eba77f54 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 01:38:22 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}free() macros, use free() instead. Fixes ArcticaProject/nx-libs#105 --- nx-X11/include/Xthreads.h | 7 +- nx-X11/lib/xtrans/Xtrans.c | 52 ++++++------ nx-X11/lib/xtrans/Xtransdnet.c | 10 +-- nx-X11/lib/xtrans/Xtranslcl.c | 20 ++--- nx-X11/lib/xtrans/Xtransos2.c | 76 +++++++++--------- nx-X11/lib/xtrans/Xtranssock.c | 30 +++---- nx-X11/lib/xtrans/Xtranstli.c | 28 +++---- nx-X11/lib/xtrans/Xtransutil.c | 4 +- nx-X11/lib/xtrans/transport.c | 1 - nx-X11/programs/Xserver/GL/glx/glximports.c | 4 +- nx-X11/programs/Xserver/GL/glx/glxscreens.c | 6 +- nx-X11/programs/Xserver/GL/glx/glxutil.c | 4 +- nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c | 2 +- nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c | 2 +- nx-X11/programs/Xserver/Xext/extmod/modinit.c | 2 +- nx-X11/programs/Xserver/Xext/panoramiX.c | 16 ++-- nx-X11/programs/Xserver/Xext/panoramiXprocs.c | 16 ++-- nx-X11/programs/Xserver/Xext/saver.c | 14 ++-- nx-X11/programs/Xserver/Xext/security.c | 20 ++--- nx-X11/programs/Xserver/Xext/shape.c | 8 +- nx-X11/programs/Xserver/Xext/shm.c | 8 +- nx-X11/programs/Xserver/Xext/sleepuntil.c | 4 +- nx-X11/programs/Xserver/Xext/sync.c | 28 +++---- nx-X11/programs/Xserver/Xext/xcmisc.c | 2 +- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 6 +- nx-X11/programs/Xserver/Xext/xvdisp.c | 2 +- nx-X11/programs/Xserver/Xext/xvmain.c | 6 +- nx-X11/programs/Xserver/Xext/xvmc.c | 20 ++--- nx-X11/programs/Xserver/Xi/chgptr.c | 4 +- nx-X11/programs/Xserver/Xi/exevents.c | 12 +-- nx-X11/programs/Xserver/Xi/getdctl.c | 2 +- nx-X11/programs/Xserver/Xi/getfctl.c | 2 +- nx-X11/programs/Xserver/Xi/getprop.c | 2 +- nx-X11/programs/Xserver/Xi/getselev.c | 2 +- nx-X11/programs/Xserver/Xi/listdev.c | 2 +- nx-X11/programs/Xserver/Xi/queryst.c | 2 +- nx-X11/programs/Xserver/composite/compalloc.c | 20 ++--- nx-X11/programs/Xserver/composite/compinit.c | 4 +- nx-X11/programs/Xserver/damageext/damageext.c | 4 +- nx-X11/programs/Xserver/dbe/dbe.c | 44 +++++------ nx-X11/programs/Xserver/dix/atom.c | 12 +-- nx-X11/programs/Xserver/dix/colormap.c | 50 ++++++------ nx-X11/programs/Xserver/dix/cursor.c | 28 +++---- nx-X11/programs/Xserver/dix/devices.c | 56 ++++++------- nx-X11/programs/Xserver/dix/dispatch.c | 12 +-- nx-X11/programs/Xserver/dix/dixfonts.c | 92 +++++++++++----------- nx-X11/programs/Xserver/dix/dixutils.c | 22 +++--- nx-X11/programs/Xserver/dix/events.c | 8 +- nx-X11/programs/Xserver/dix/extension.c | 22 +++--- nx-X11/programs/Xserver/dix/gc.c | 14 ++-- nx-X11/programs/Xserver/dix/glyphcurs.c | 2 +- nx-X11/programs/Xserver/dix/grabs.c | 10 +-- nx-X11/programs/Xserver/dix/main.c | 18 ++--- nx-X11/programs/Xserver/dix/privates.c | 2 +- nx-X11/programs/Xserver/dix/property.c | 16 ++-- nx-X11/programs/Xserver/dix/region.c | 12 +-- nx-X11/programs/Xserver/dix/resource.c | 16 ++-- nx-X11/programs/Xserver/dix/window.c | 18 ++--- nx-X11/programs/Xserver/fb/fbcmap.c | 6 +- nx-X11/programs/Xserver/fb/fbcopy.c | 2 +- nx-X11/programs/Xserver/fb/fbpixmap.c | 4 +- nx-X11/programs/Xserver/fb/fbpseudocolor.c | 16 ++-- nx-X11/programs/Xserver/fb/fbscreen.c | 10 +-- nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 20 ++--- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 14 ++-- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 10 +-- nx-X11/programs/Xserver/hw/nxagent/Font.c | 20 ++--- nx-X11/programs/Xserver/hw/nxagent/GC.c | 12 +-- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 24 +++--- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 14 ++-- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 90 ++++++++++----------- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 12 +-- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 12 +-- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 38 ++++----- nx-X11/programs/Xserver/hw/nxagent/NXresource.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 38 ++++----- nx-X11/programs/Xserver/include/os.h | 2 +- nx-X11/programs/Xserver/mi/miarc.c | 26 +++--- nx-X11/programs/Xserver/mi/mibank.c | 10 +-- nx-X11/programs/Xserver/mi/mibitblt.c | 4 +- nx-X11/programs/Xserver/mi/mibstore.c | 8 +- nx-X11/programs/Xserver/mi/micmap.c | 12 +-- nx-X11/programs/Xserver/mi/midash.c | 2 +- nx-X11/programs/Xserver/mi/midispcur.c | 18 ++--- nx-X11/programs/Xserver/mi/migc.c | 4 +- nx-X11/programs/Xserver/mi/mioverlay.c | 10 +-- nx-X11/programs/Xserver/mi/mipointer.c | 2 +- nx-X11/programs/Xserver/mi/mipolyutil.c | 2 +- nx-X11/programs/Xserver/mi/mipushpxl.c | 2 +- nx-X11/programs/Xserver/mi/miscrinit.c | 2 +- nx-X11/programs/Xserver/mi/mispans.c | 58 +++++++------- nx-X11/programs/Xserver/mi/misprite.c | 4 +- nx-X11/programs/Xserver/mi/miwideline.c | 6 +- nx-X11/programs/Xserver/mi/miwindow.c | 2 +- nx-X11/programs/Xserver/miext/cw/cw.c | 2 +- nx-X11/programs/Xserver/miext/cw/cw_render.c | 4 +- nx-X11/programs/Xserver/miext/damage/damage.c | 4 +- nx-X11/programs/Xserver/os/WaitFor.c | 4 +- nx-X11/programs/Xserver/os/access.c | 14 ++-- nx-X11/programs/Xserver/os/connection.c | 10 +-- nx-X11/programs/Xserver/os/io.c | 32 ++++---- nx-X11/programs/Xserver/os/log.c | 2 +- nx-X11/programs/Xserver/os/mitauth.c | 10 +-- nx-X11/programs/Xserver/os/oscolor.c | 2 +- nx-X11/programs/Xserver/os/rpcauth.c | 2 +- nx-X11/programs/Xserver/os/utils.c | 10 +-- nx-X11/programs/Xserver/os/xdmauth.c | 32 ++++---- nx-X11/programs/Xserver/os/xdmcp.c | 8 +- nx-X11/programs/Xserver/randr/randr.c | 12 +-- nx-X11/programs/Xserver/randr/rrcrtc.c | 38 ++++----- nx-X11/programs/Xserver/randr/rrdispatch.c | 2 +- nx-X11/programs/Xserver/randr/rrinfo.c | 4 +- nx-X11/programs/Xserver/randr/rrmode.c | 8 +- nx-X11/programs/Xserver/randr/rrmonitor.c | 10 +-- nx-X11/programs/Xserver/randr/rroutput.c | 18 ++--- nx-X11/programs/Xserver/randr/rrproperty.c | 22 +++--- nx-X11/programs/Xserver/randr/rrprovider.c | 6 +- nx-X11/programs/Xserver/randr/rrproviderproperty.c | 22 +++--- nx-X11/programs/Xserver/randr/rrscreen.c | 34 ++++---- nx-X11/programs/Xserver/randr/rrtransform.c | 4 +- nx-X11/programs/Xserver/record/record.c | 20 ++--- nx-X11/programs/Xserver/record/set.c | 7 +- nx-X11/programs/Xserver/render/animcur.c | 2 +- nx-X11/programs/Xserver/render/filter.c | 12 +-- nx-X11/programs/Xserver/render/glyph.c | 16 ++-- nx-X11/programs/Xserver/render/miindex.c | 6 +- nx-X11/programs/Xserver/render/mipict.c | 2 +- nx-X11/programs/Xserver/render/picture.c | 42 +++++----- nx-X11/programs/Xserver/render/render.c | 44 +++++------ nx-X11/programs/Xserver/xfixes/cursor.c | 10 +-- nx-X11/programs/Xserver/xfixes/region.c | 2 +- nx-X11/programs/Xserver/xfixes/select.c | 4 +- nx-X11/programs/Xserver/xkb/ddxList.c | 8 +- nx-X11/programs/Xserver/xkb/ddxLoad.c | 12 +-- nx-X11/programs/Xserver/xkb/xkb.c | 14 ++-- 148 files changed, 1001 insertions(+), 1006 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/include/Xthreads.h b/nx-X11/include/Xthreads.h index 41440a2fb..97fda5948 100644 --- a/nx-X11/include/Xthreads.h +++ b/nx-X11/include/Xthreads.h @@ -36,9 +36,6 @@ in this Software without prior written authorization from The Open Group. #ifndef xmalloc #define xmalloc malloc #endif -#ifndef xfree -#define xfree free -#endif #ifdef CTHREADS #include @@ -285,13 +282,13 @@ typedef xmutex_rec *xmutex_t; #define xcondition_malloc() (xcondition_t)xmalloc(sizeof(xcondition_rec)) #endif #ifndef xcondition_free -#define xcondition_free(c) xfree((char *)c) +#define xcondition_free(c) free((char *)c) #endif #ifndef xmutex_malloc #define xmutex_malloc() (xmutex_t)xmalloc(sizeof(xmutex_rec)) #endif #ifndef xmutex_free -#define xmutex_free(m) xfree((char *)m) +#define xmutex_free(m) free((char *)m) #endif #ifndef xthread_have_id #define xthread_have_id(id) id diff --git a/nx-X11/lib/xtrans/Xtrans.c b/nx-X11/lib/xtrans/Xtrans.c index ef4d64aed..f1e5ff966 100644 --- a/nx-X11/lib/xtrans/Xtrans.c +++ b/nx-X11/lib/xtrans/Xtrans.c @@ -145,15 +145,15 @@ TRANS(FreeConnInfo) (XtransConnInfo ciptr) PRMSG (3,"FreeConnInfo(%p)\n", ciptr, 0, 0); if (ciptr->addr) - xfree (ciptr->addr); + free (ciptr->addr); if (ciptr->peeraddr) - xfree (ciptr->peeraddr); + free (ciptr->peeraddr); if (ciptr->port) - xfree (ciptr->port); + free (ciptr->port); - xfree ((char *) ciptr); + free ((char *) ciptr); } @@ -238,7 +238,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) *protocol = NULL; *host = NULL; *port = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } @@ -288,7 +288,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) *protocol = NULL; *host = NULL; *port = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } @@ -368,7 +368,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) *port = NULL; *host = NULL; *protocol = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } else @@ -379,9 +379,9 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) /* Malloc failed */ *port = NULL; *host = NULL; - xfree (*protocol); + free (*protocol); *protocol = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } else @@ -391,17 +391,17 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) { /* Malloc failed */ *port = NULL; - xfree (*host); + free (*host); *host = NULL; - xfree (*protocol); + free (*protocol); *protocol = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } else strcpy (*port, _port); - xfree (tmpptr); + free (tmpptr); return 1; } @@ -446,9 +446,9 @@ TRANS(Open) (int type, char *address) PRMSG (1,"Open: Unable to find transport for %s\n", protocol, 0, 0); - xfree (protocol); - xfree (host); - xfree (port); + free (protocol); + free (host); + free (port); return NULL; } @@ -487,17 +487,17 @@ TRANS(Open) (int type, char *address) PRMSG (1,"Open: transport open failed for %s/%s:%s\n", protocol, host, port); } - xfree (protocol); - xfree (host); - xfree (port); + free (protocol); + free (host); + free (port); return NULL; } ciptr->transptr = thistrans; ciptr->port = port; /* We need this for TRANS(Reopen) */ - xfree (protocol); - xfree (host); + free (protocol); + free (host); return ciptr; } @@ -859,16 +859,16 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address) { PRMSG (1,"Connect: Missing port specification in %s\n", address, 0, 0); - if (protocol) xfree (protocol); - if (host) xfree (host); + if (protocol) free (protocol); + if (host) free (host); return -1; } ret = ciptr->transptr->Connect (ciptr, host, port); - if (protocol) xfree (protocol); - if (host) xfree (host); - if (port) xfree (port); + if (protocol) free (protocol); + if (host) free (host); + if (port) free (port); return ret; } diff --git a/nx-X11/lib/xtrans/Xtransdnet.c b/nx-X11/lib/xtrans/Xtransdnet.c index a1728f187..34e191260 100644 --- a/nx-X11/lib/xtrans/Xtransdnet.c +++ b/nx-X11/lib/xtrans/Xtransdnet.c @@ -224,7 +224,7 @@ TRANS(DNETOpenCOTSServer) (Xtransport *thistrans, char *protocol, if ((ciptr->fd = socket (AF_DECnet, SOCK_STREAM, 0)) < 0) { - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } @@ -406,7 +406,7 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status) { PRMSG (1, "DNETAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_FAILED; return NULL; } @@ -421,7 +421,7 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status) PRMSG(1, "DNETAccept: ...DNETGetAddr() failed:\n", 0, 0, 0); close (newciptr->fd); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -432,8 +432,8 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status) "DNETAccept: ...DNETGetPeerAddr() failed:\n", 0, 0, 0); close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); + if (newciptr->addr) free (newciptr->addr); + free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } diff --git a/nx-X11/lib/xtrans/Xtranslcl.c b/nx-X11/lib/xtrans/Xtranslcl.c index 6165d3658..c1689c654 100644 --- a/nx-X11/lib/xtrans/Xtranslcl.c +++ b/nx-X11/lib/xtrans/Xtranslcl.c @@ -171,7 +171,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path) PRMSG(1, "FillAddrInfo: failed to allocate memory for peer addr\n", 0,0,0); - xfree ((char *) sunaddr); + free ((char *) sunaddr); ciptr->addr = NULL; return 0; @@ -610,7 +610,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) if( (sunaddr=(struct sockaddr_un *)xalloc(newciptr->peeraddrlen)) == NULL ) { PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n", 0,0,0); - xfree(newciptr->addr); + free(newciptr->addr); close(newfd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; @@ -834,7 +834,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) PRMSG(1, "NAMEDAccept: failed to allocate memory for peer addr\n", 0,0,0); - xfree(newciptr->addr); + free(newciptr->addr); close(str.fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; @@ -1178,7 +1178,7 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) PRMSG(1, "ISCAccept: failed to allocate memory for peer addr\n", 0,0,0); - xfree(newciptr->addr); + free(newciptr->addr); close(str.fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; @@ -1455,7 +1455,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) PRMSG(1, "SCOAccept: failed to allocate memory for peer addr\n", 0,0,0); - xfree(newciptr->addr); + free(newciptr->addr); close(fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; @@ -1913,7 +1913,7 @@ TRANS(LocalEndTransports)(void) { PRMSG(3,"LocalEndTransports()\n", 0,0,0 ); - xfree(freeXLOCAL); + free(freeXLOCAL); } #define TYPEBUFSIZE 32 @@ -2080,7 +2080,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port) if( ciptr->fd < 0 ) { - xfree(ciptr); + free(ciptr); return NULL; } @@ -2150,7 +2150,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port) } } - xfree(ciptr); + free(ciptr); return NULL; } @@ -2197,7 +2197,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port) return ciptr; } - xfree(ciptr); + free(ciptr); return NULL; } @@ -2396,7 +2396,7 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status) if( newciptr->fd < 0 ) { - xfree(newciptr); + free(newciptr); return NULL; } diff --git a/nx-X11/lib/xtrans/Xtransos2.c b/nx-X11/lib/xtrans/Xtransos2.c index f4a6b036b..807a6029d 100644 --- a/nx-X11/lib/xtrans/Xtransos2.c +++ b/nx-X11/lib/xtrans/Xtransos2.c @@ -111,7 +111,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, 0,0,0 ); PRMSG(1,"\tor the DISPLAY variable is set incorrectly.\n", 0,0,0 ); - xfree(ciptr); + free(ciptr); return NULL; } try ++; @@ -133,7 +133,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, pipe_len=0; DosWrite(hServer,&pipe_len,1,&byteWritten); DosClose(hServer); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -145,7 +145,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenClient: Unable to connect to pipe %s\n", pipename,0,0 ); DosClose (hfd); DosClose(hServer); - xfree(ciptr); + free(ciptr); return (NULL); } @@ -158,7 +158,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, hServer,rc,byteWritten ); DosClose(hServer); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -182,7 +182,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG(1, "\tor the XServer is too busy to respond.\n",0,0,0 ); DosClose(hServer); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -197,7 +197,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenClient: Client pipe does not appear connected. rc=%d, h=%d\n",rc,hfd,0 ); PRMSG(1, "\tProbable cause: the XServer has just exited.\n",0,0,0 ); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -207,7 +207,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG (1, "Os2OpenClient: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } ciptr->addrlen = namelen; @@ -219,8 +219,8 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG (1, "Os2OpenCLient: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hfd); - xfree(ciptr->addr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr); return(NULL); } ciptr->peeraddrlen = namelen; @@ -237,9 +237,9 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenClient: Could not import the pipe handle into EMX\n",0,0,0 ); PRMSG(1, "\tProbable cause: EMX has run out of free file handles.\n",0,0,0 ); DosClose(hfd); - xfree(ciptr->addr); - xfree(ciptr->peeraddr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr->peeraddr); + free(ciptr); return(NULL); } PRMSG(5, "Os2OpenClient: pipe handle %d EMX handle %d\n",ciptr->index,ciptr->fd,0 ); @@ -296,7 +296,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenServer: Unable to create pipe %s, rc=%d\n", pipename,rc,0 ); PRMSG(1, "\tProbable cause: there is already another XServer running on display :%s\n",port,0,0 ); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -307,7 +307,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, { PRMSG(1, "Os2OpenServer: Unable to connect to pipe %s\n", pipename,0,0 ); DosClose (hfd); - xfree(ciptr); + free(ciptr); return (NULL); } @@ -321,7 +321,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } ciptr->addrlen = namelen; @@ -333,8 +333,8 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hfd); - xfree(ciptr->addr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr); return(NULL); } @@ -351,9 +351,9 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, if((ciptr->fd=_imphandle(hfd))<0){ DosClose(hfd); - xfree(ciptr->addr); - xfree(ciptr->peeraddr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr->peeraddr); + free(ciptr); return(NULL); } PRMSG(5, "Os2OpenServer: Pipe handle %d EMX handle %d",ciptr->index,ciptr->fd,0 ); @@ -365,9 +365,9 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenCOTSServer: Could not attach sem %d to pipe %d, rc=%d\n", hPipeSem,ciptr->fd,rc); DosClose(ciptr->fd); - xfree(ciptr->addr); - xfree(ciptr->peeraddr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr->peeraddr); + free(ciptr); return(NULL); } #endif @@ -445,7 +445,7 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port) { PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n", 0, 0, 0); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -455,7 +455,7 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port) { PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n", 0, 0, 0); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -521,7 +521,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG(2,"Os2Accept: Error reading incoming connection, in=%d, error=%d\n", in,errno,0 ); *status = TRANS_ACCEPT_MISC_ERROR; - xfree(newciptr); + free(newciptr); rc = DosDisConnectNPipe(ciptr->fd); rc = DosConnectNPipe (ciptr->fd); if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED) @@ -540,7 +540,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG(2,"Os2Accept: Error reading incoming connection, in=%d, error=%d\n", in,errno,0 ); *status = TRANS_ACCEPT_MISC_ERROR; - xfree(newciptr); + free(newciptr); rc = DosDisConnectNPipe(ciptr->fd); rc = DosConnectNPipe (ciptr->fd); if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED) @@ -566,7 +566,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG(1,"Os2Accept: Open pipe %s to client failed, rc=%d\n", clientname,rc,0 ); PRMSG(1, "\tProbable cause: the client has exited or timed-out.\n",0,0,0 ); - xfree(newciptr); + free(newciptr); rc = DosDisConnectNPipe(ciptr->fd); rc = DosConnectNPipe (ciptr->fd); if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED) @@ -581,7 +581,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) { PRMSG(1,"Os2Accept: Could not set pipe %s to non-blocking mode, rc=%d\n", hClient,rc,0 ); - xfree(newciptr); + free(newciptr); rc = DosDisConnectNPipe(ciptr->fd); rc = DosConnectNPipe (ciptr->fd); if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED) @@ -610,7 +610,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG (1, "Os2Accept: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hClient); - xfree(newciptr); + free(newciptr); return(NULL); } @@ -623,8 +623,8 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG (1, "Os2Accept: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hClient); - xfree(ciptr->addr); - xfree(newciptr); + free(ciptr->addr); + free(newciptr); return(NULL); } @@ -643,9 +643,9 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) hClient,errno,0 ); PRMSG(1, "\tProbable cause: EMX has run out of file handles.\n",0,0,0 ); DosClose(hClient); - xfree(newciptr->addr); - xfree(newciptr->peeraddr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr->peeraddr); + free(newciptr); return(NULL); } PRMSG(5, "Os2Accept: Pipe handle %d EMX handle %d",newciptr->index,newciptr->fd,0 ); @@ -657,9 +657,9 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG(1, "Os2OpenCOTSServer: Could not attach sem %d to pipe %d, rc=%d\n", hPipeSem,newciptr->fd,rc); DosClose(newciptr->fd); - xfree(newciptr->addr); - xfree(newciptr->peeraddr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr->peeraddr); + free(newciptr); return(NULL); } #endif diff --git a/nx-X11/lib/xtrans/Xtranssock.c b/nx-X11/lib/xtrans/Xtranssock.c index 5c57fc5ba..6a6600435 100644 --- a/nx-X11/lib/xtrans/Xtranssock.c +++ b/nx-X11/lib/xtrans/Xtranssock.c @@ -619,7 +619,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) () if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fds) < 0) { PRMSG (1, "SocketCreateConnInfo: socketpair() failed.\n", 0, 0, 0); - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } @@ -643,7 +643,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) () { PRMSG (1, "SocketCreateConnInfo: No space for a new _NXProxyConnInfo for [%d].\n", ciptr->fd, 0, 0); - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } else if (_NXProxyConnInfoTab[ciptr->fd] != NULL) @@ -658,7 +658,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) () if (_NXProxyConnInfoTab[ciptr->fd] == NULL) { PRMSG (1, "SocketCreateConnInfo: Alloc of _NXProxyConnInfo failed.\n", 0, 0, 0); - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } @@ -812,7 +812,7 @@ static void TRANS(SocketCloseConnInfo) (XtransConnInfo ciptr) ciptr->fd); #endif - xfree((char *) _NXProxyConnInfoTab[ciptr->fd]); + free((char *) _NXProxyConnInfoTab[ciptr->fd]); _NXProxyConnInfoTab[ciptr->fd] = NULL; @@ -1084,7 +1084,7 @@ TRANS(SocketOpen) (int i, int type) PRMSG (2, "SocketOpen: socket() failed for %s\n", Sockettrans2devtab[i].transname, 0, 0); - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } @@ -1968,7 +1968,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) errno = WSAGetLastError(); #endif PRMSG (1, "SocketINETAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_FAILED; return NULL; } @@ -1996,7 +1996,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) "SocketINETAccept: ...SocketINETGetAddr() failed:\n", 0, 0, 0); close (newciptr->fd); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -2007,8 +2007,8 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n", 0, 0, 0); close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); + if (newciptr->addr) free (newciptr->addr); + free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -2048,7 +2048,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) (struct sockaddr *) &sockname, (void *)&namelen)) < 0) { PRMSG (1, "SocketUNIXAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_FAILED; return NULL; } @@ -2064,7 +2064,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) "SocketUNIXAccept: Can't allocate space for the addr\n", 0, 0, 0); close (newciptr->fd); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; } @@ -2084,8 +2084,8 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) "SocketUNIXAccept: Can't allocate space for the addr\n", 0, 0, 0); close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); + if (newciptr->addr) free (newciptr->addr); + free (newciptr); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; } @@ -2263,7 +2263,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) " socketfor IPv4 address\n", 0,0,0); } if (newciptr) - xfree(newciptr); + free(newciptr); } else { socketaddr = NULL; PRMSG (4,"SocketINETConnect Skipping IPv4 address\n", @@ -2301,7 +2301,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) "socket for IPv6 address\n", 0,0,0); } if (newciptr) - xfree(newciptr); + free(newciptr); } else { diff --git a/nx-X11/lib/xtrans/Xtranstli.c b/nx-X11/lib/xtrans/Xtranstli.c index d8b5db83b..ab37275dd 100644 --- a/nx-X11/lib/xtrans/Xtranstli.c +++ b/nx-X11/lib/xtrans/Xtranstli.c @@ -171,7 +171,7 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr) */ if( ciptr->addr ) - xfree(ciptr->addr); + free(ciptr->addr); if( (ciptr->addr=(char *)xalloc(netbuf.len)) == NULL ) { @@ -221,7 +221,7 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr) */ if( ciptr->peeraddr ) - xfree(ciptr->peeraddr); + free(ciptr->peeraddr); if( (ciptr->peeraddr=(char *)xalloc(netbuf.len)) == NULL ) { @@ -457,7 +457,7 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol, "TLIOpenCOTSClient: ...TLITLIBindLocal() failed: %d\n", errno, 0,0 ); t_close(ciptr->fd); - xfree(ciptr); + free(ciptr); return NULL; } @@ -467,7 +467,7 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol, "TLIOpenCOTSClient: ...TLIGetAddr() failed: %d\n", errno, 0,0 ); t_close(ciptr->fd); - xfree(ciptr); + free(ciptr); return NULL; } @@ -557,7 +557,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol, "TLIOpenCLTSClient: ...TLITLIBindLocal() failed: %d\n", errno, 0,0 ); t_close(ciptr->fd); - xfree(ciptr); + free(ciptr); return NULL; } @@ -567,7 +567,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol, "TLIOpenCLTSClient: ...TLIGetPeerAddr() failed: %d\n", errno, 0,0 ); t_close(ciptr->fd); - xfree(ciptr); + free(ciptr); return NULL; } @@ -917,7 +917,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) errno, 0,0 ); t_free((char *)call,T_CALL); t_close(newciptr->fd); - xfree(newciptr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -961,7 +961,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n", errno, 0,0 ); t_close(newciptr->fd); - xfree(newciptr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -972,8 +972,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n", errno, 0,0 ); t_close(newciptr->fd); - xfree(newciptr->addr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -983,8 +983,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) PRMSG(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n", errno,0,0 ); t_close(newciptr->fd); - xfree(newciptr->addr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -994,8 +994,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) PRMSG(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n", errno,0,0 ); t_close(newciptr->fd); - xfree(newciptr->addr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } diff --git a/nx-X11/lib/xtrans/Xtransutil.c b/nx-X11/lib/xtrans/Xtransutil.c index 20e431ac8..7dc91b16c 100644 --- a/nx-X11/lib/xtrans/Xtransutil.c +++ b/nx-X11/lib/xtrans/Xtransutil.c @@ -211,7 +211,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) if (len > 0) { if (*addrp && *addrlenp < (len + 1)) { - xfree ((char *) *addrp); + free ((char *) *addrp); *addrp = NULL; } if (!*addrp) @@ -226,7 +226,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) else { if (*addrp) - xfree ((char *) *addrp); + free ((char *) *addrp); *addrp = NULL; *addrlenp = 0; } diff --git a/nx-X11/lib/xtrans/transport.c b/nx-X11/lib/xtrans/transport.c index ff460c257..49441d76e 100644 --- a/nx-X11/lib/xtrans/transport.c +++ b/nx-X11/lib/xtrans/transport.c @@ -62,7 +62,6 @@ from The Open Group. #define xalloc(_size) malloc(_size) #define xcalloc(_num,_size) calloc(_num,_size) #define xrealloc(_ptr,_size) realloc(_ptr,_size) -#define xfree(_ptr) free(_ptr) #endif #include "Xtransint.h" diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.c b/nx-X11/programs/Xserver/GL/glx/glximports.c index 435caca58..5b6c545fc 100644 --- a/nx-X11/programs/Xserver/GL/glx/glximports.c +++ b/nx-X11/programs/Xserver/GL/glx/glximports.c @@ -81,7 +81,7 @@ void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize) void __glXImpFree(__GLcontext *gc, void *addr) { if (addr) { - xfree(addr); + free(addr); } } @@ -91,7 +91,7 @@ void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize) if (addr) { if (newSize == 0) { - xfree(addr); + free(addr); return NULL; } newAddr = xrealloc(addr, newSize); diff --git a/nx-X11/programs/Xserver/GL/glx/glxscreens.c b/nx-X11/programs/Xserver/GL/glx/glxscreens.c index 58b38b1a2..1cbc0baf7 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxscreens.c +++ b/nx-X11/programs/Xserver/GL/glx/glxscreens.c @@ -366,9 +366,9 @@ void __glXScreenReset(void) __glXFree(__glXActiveScreens[i].GLXextensions); __glXFree(__glXActiveScreens[i].GLextensions); } - xfree(__glXActiveScreens); - xfree(__glXHyperpipeFuncs); - xfree(__glXSwapBarrierFuncs); + free(__glXActiveScreens); + free(__glXHyperpipeFuncs); + free(__glXSwapBarrierFuncs); __glXNumHyperpipeFuncs = 0; __glXNumSwapBarrierFuncs = 0; __glXHyperpipeFuncs = NULL; diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c index 03bc19f63..cf0aae011 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxutil.c +++ b/nx-X11/programs/Xserver/GL/glx/glxutil.c @@ -102,7 +102,7 @@ __glXRealloc(void *addr, size_t newSize) if (addr) { if (newSize == 0) { - xfree(addr); + free(addr); return NULL; } else { newAddr = xrealloc(addr, newSize); @@ -125,7 +125,7 @@ void __glXFree(void *addr) { if (addr) { - xfree(addr); + free(addr); } } diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c index 19b5be637..6ec2164ba 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c @@ -516,7 +516,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, /* Free the private list created by DDX HW driver */ if (visualPrivates) - xfree(visualPrivates); + free(visualPrivates); visualPrivates = NULL; return TRUE; diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c index 1889bdabd..0a86bf208 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c @@ -70,7 +70,7 @@ void XMesaDestroyImage(XMesaImage *image) { if (image->data) free(image->data); - xfree(image); + free(image); } unsigned long XMesaGetPixel(XMesaImage *image, int x, int y) diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.c b/nx-X11/programs/Xserver/Xext/extmod/modinit.c index 6969148a3..5bfd15719 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/modinit.c +++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.c @@ -167,7 +167,7 @@ extmodSetup(void * module, void * opts, int *errmaj, int *errmin) strcpy(s, "omit"); strcat(s, extensionModules[i].name); o = xf86FindOption(opts, s); - xfree(s); + free(s); if (o) { xf86MarkOptionUsed(o); continue; diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index a1bfa91d6..c3b47cf2c 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -165,7 +165,7 @@ XineramaCloseScreen (int i, ScreenPtr pScreen) if (pScreen->myNum == 0) RegionUninit(&PanoramiXScreenRegion); - xfree ((void *) pScreenPriv); + free ((void *) pScreenPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -337,7 +337,7 @@ XineramaDestroyClip(GCPtr pGC) int XineramaDeleteResource(void * data, XID id) { - xfree(data); + free(data); return 1; } @@ -727,10 +727,10 @@ Bool PanoramiXCreateConnectionBlock(void) connSetupPrefix.length = length >> 2; - xfree(PanoramiXVisuals); + free(PanoramiXVisuals); for (i = 0; i < PanoramiXNumDepths; i++) - xfree(PanoramiXDepths[i].vids); - xfree(PanoramiXDepths); + free(PanoramiXDepths[i].vids); + free(PanoramiXDepths); /* * OK, change some dimensions so it looks as if it were one big screen @@ -752,7 +752,7 @@ Bool PanoramiXCreateConnectionBlock(void) tmp = (void *)ConnectionCallbackList; (*ConnectionCallbackList->func)(); ConnectionCallbackList = ConnectionCallbackList->next; - xfree(tmp); + free(tmp); } return TRUE; @@ -927,7 +927,7 @@ static void PanoramiXResetProc(ExtensionEntry* extEntry) for (i = 256; i--; ) ProcVector[i] = SavedProcVector[i]; - Xfree(panoramiXdataPtr); + free(panoramiXdataPtr); } @@ -1292,7 +1292,7 @@ XineramaGetImageData( } if(ScratchMem) - xfree(ScratchMem); + free(ScratchMem); RegionUninit(&SrcRegion); RegionUninit(&GrabRegion); diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c index b4719d76f..28c0eb8b0 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c @@ -170,7 +170,7 @@ int PanoramiXCreateWindow(ClientPtr client) if (result == Success) AddResource(newWin->info[0].id, XRT_WINDOW, newWin); else - xfree(newWin); + free(newWin); return (result); } @@ -679,7 +679,7 @@ int PanoramiXCreatePixmap(ClientPtr client) if (result == Success) AddResource(newPix->info[0].id, XRT_PIXMAP, newPix); else - xfree(newPix); + free(newPix); return (result); } @@ -784,7 +784,7 @@ int PanoramiXCreateGC(ClientPtr client) if (result == Success) AddResource(newGC->info[0].id, XRT_GC, newGC); else - xfree(newGC); + free(newGC); return (result); } @@ -1049,7 +1049,7 @@ int PanoramiXCopyArea(ClientPtr client) if(drawables[0]->depth != pDst->depth) { client->errorValue = stuff->dstDrawable; - xfree(data); + free(data); return (BadMatch); } @@ -1060,7 +1060,7 @@ int PanoramiXCopyArea(ClientPtr client) if(dstShared) break; } - xfree(data); + free(data); result = Success; } else { @@ -1890,7 +1890,7 @@ int PanoramiXGetImage(ClientPtr client) } } } - xfree(pBuf); + free(pBuf); return (client->noClientException); } @@ -2092,7 +2092,7 @@ int PanoramiXCreateColormap(ClientPtr client) if (result == Success) AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap); else - xfree(newCmap); + free(newCmap); return (result); } @@ -2159,7 +2159,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client) if (result == Success) AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap); else - xfree(newCmap); + free(newCmap); return (result); } diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 81f502189..68dbe2fe8 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -274,7 +274,7 @@ CheckScreenPrivate (pScreen) if (!pPriv->attr && !pPriv->events && !pPriv->hasWindow && pPriv->installedMap == None) { - xfree (pPriv); + free (pPriv); SetScreenPrivate (pScreen, NULL); savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL; } @@ -340,7 +340,7 @@ setEventMask (pScreen, client, mask) { FreeResource (pEv->resource, EventType); *pPrev = pEv->next; - xfree (pEv); + free (pEv); CheckScreenPrivate (pScreen); } else @@ -386,8 +386,8 @@ FreeScreenAttr (pAttr) ScreenSaverAttrPtr pAttr; { FreeAttrs (pAttr); - xfree (pAttr->values); - xfree (pAttr); + free (pAttr->values); + free (pAttr); } static int @@ -408,7 +408,7 @@ ScreenSaverFreeEvents (value, id) if (!pEv) return TRUE; *pPrev = pEv->next; - xfree (pEv); + free (pEv); CheckScreenPrivate (pScreen); return TRUE; } @@ -1172,8 +1172,8 @@ PatchUp: FreeAttrs (pAttr); bail: CheckScreenPrivate (pScreen); - if (pAttr) xfree (pAttr->values); - xfree (pAttr); + if (pAttr) free (pAttr->values); + free (pAttr); return ret; } diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 096b88d20..ceadd8f6a 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -331,7 +331,7 @@ SecurityDeleteAuthorization( } SecurityAudit("revoked authorization ID %d\n", pAuth->id); - xfree(pAuth); + free(pAuth); return Success; } /* SecurityDeleteAuthorization */ @@ -356,7 +356,7 @@ SecurityDeleteAuthorizationEventClient( prev->next = pEventClient->next; else pAuth->eventClients = pEventClient->next; - xfree(pEventClient); + free(pEventClient); return(Success); } prev = pEventClient; @@ -533,7 +533,7 @@ SecurityEventSelectForAuthorization( if (!AddResource(pEventClient->resource, RTEventClient, (void *)pAuth)) { - xfree(pEventClient); + free(pEventClient); return BadAlloc; } pAuth->eventClients = pEventClient; @@ -734,7 +734,7 @@ bailout: if (removeAuth) RemoveAuthorization(stuff->nbytesAuthProto, protoname, authdata_len, pAuthdata); - if (pAuth) xfree(pAuth); + if (pAuth) free(pAuth); return err; } /* ProcSecurityGenerateAuthorization */ @@ -1486,7 +1486,7 @@ SecurityFreePropertyAccessList(void) { PropertyAccessPtr freeit = PropertyAccessList; PropertyAccessList = PropertyAccessList->next; - xfree(freeit); + free(freeit); } } /* SecurityFreePropertyAccessList */ @@ -1650,7 +1650,7 @@ SecurityParsePropertyAccessRule( pacl->name = MakeAtom(propname, strlen(propname), TRUE); if (pacl->name == BAD_RESOURCE) { - Xfree(pacl); + free(pacl); return FALSE; } if (mustHaveProperty) @@ -1659,7 +1659,7 @@ SecurityParsePropertyAccessRule( strlen(mustHaveProperty), TRUE); if (pacl->mustHaveProperty == BAD_RESOURCE) { - Xfree(pacl); + free(pacl); return FALSE; } } @@ -1724,7 +1724,7 @@ SecurityParseSitePolicy( sizeof (char *) * (nSecurityPolicyStrings + 1)); if (!newStrings) { - Xfree(copyPolicyStr); + free(copyPolicyStr); return TRUE; } @@ -1752,9 +1752,9 @@ SecurityFreeSitePolicyStrings(void) assert(nSecurityPolicyStrings); while (nSecurityPolicyStrings--) { - Xfree(SecurityPolicyStrings[nSecurityPolicyStrings]); + free(SecurityPolicyStrings[nSecurityPolicyStrings]); } - Xfree(SecurityPolicyStrings); + free(SecurityPolicyStrings); SecurityPolicyStrings = NULL; nSecurityPolicyStrings = 0; } diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index b272f1bbe..a55dd4553 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -796,7 +796,7 @@ ShapeFreeClient (data, id) *pHead = pShapeEvent->next; } } - xfree ((void *) pShapeEvent); + free ((void *) pShapeEvent); return 1; } @@ -812,9 +812,9 @@ ShapeFreeEvents (data, id) for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource (pCur->clientResource, ClientType); - xfree ((void *) pCur); + free ((void *) pCur); } - xfree ((void *) pHead); + free ((void *) pHead); return 1; } @@ -898,7 +898,7 @@ ProcShapeSelectInput (client) pNewShapeEvent->next = pShapeEvent->next; else *pHead = pShapeEvent->next; - xfree (pShapeEvent); + free (pShapeEvent); } } break; diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index 83d6eaaab..4e36a6bb4 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -447,7 +447,7 @@ ProcShmAttach(client) if ((shmdesc->addr == ((char *)-1)) || shmctl(stuff->shmid, IPC_STAT, &buf)) { - xfree(shmdesc); + free(shmdesc); return BadAccess; } @@ -457,7 +457,7 @@ ProcShmAttach(client) if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) { shmdt(shmdesc->addr); - xfree(shmdesc); + free(shmdesc); return BadAccess; } @@ -488,7 +488,7 @@ ShmDetachSegment(value, shmseg) for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next) ; *prev = shmdesc->next; - xfree(shmdesc); + free(shmdesc); return Success; } @@ -820,7 +820,7 @@ CreatePmap: (*pScreen->DestroyPixmap)(pMap); FreeResource(newPix->info[j].id, RT_NONE); } - xfree(newPix); + free(newPix); } else AddResource(stuff->pid, XRT_PIXMAP, newPix); diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.c b/nx-X11/programs/Xserver/Xext/sleepuntil.c index 62f946cf8..368dc6b48 100644 --- a/nx-X11/programs/Xserver/Xext/sleepuntil.c +++ b/nx-X11/programs/Xserver/Xext/sleepuntil.c @@ -111,7 +111,7 @@ ClientSleepUntil (client, revive, notifyFunc, closure) SertafiedWakeupHandler, (void *) 0)) { - xfree (pRequest); + free (pRequest); return FALSE; } BlockHandlerRegistered = TRUE; @@ -169,7 +169,7 @@ SertafiedDelete (value, id) } if (pRequest->notifyFunc) (*pRequest->notifyFunc) (pRequest->pClient, pRequest->closure); - xfree (pRequest); + free (pRequest); return TRUE; } diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index f79cc1b23..8fe510497 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -319,7 +319,7 @@ SyncDeleteTriggerFromCounter(pTrigger) pPrev->next = pCur->next; else pTrigger->pCounter->pTriglist = pCur->next; - xfree(pCur); + free(pCur); break; } } @@ -890,7 +890,7 @@ SyncEventSelectForAlarm(pAlarm, client, wantevents) pClients->delete_id = FakeClientID(client->index); if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm)) { - xfree(pClients); + free(pClients); return BadAlloc; } @@ -1019,7 +1019,7 @@ SyncCreateCounter(client, id, initialvalue) if (!AddResource(id, RTCounter, (void *) pCounter)) { - xfree((void *) pCounter); + free((void *) pCounter); return (SyncCounter *)NULL; } @@ -1214,7 +1214,7 @@ FreeAlarm(addr, id) SyncDeleteTriggerFromCounter(&pAlarm->trigger); - xfree(pAlarm); + free(pAlarm); return Success; } @@ -1237,13 +1237,13 @@ FreeCounter(env, id) { (*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger); pnext = ptl->next; - xfree(ptl); /* destroy the trigger list as we go */ + free(ptl); /* destroy the trigger list as we go */ } if (IsSystemCounter(pCounter)) { int i, found = 0; - xfree(pCounter->pSysCounterInfo); + free(pCounter->pSysCounterInfo); /* find the counter in the list of system counters and remove it */ @@ -1267,7 +1267,7 @@ FreeCounter(env, id) } SyncNumSystemCounters--; } - xfree(pCounter); + free(pCounter); return Success; } @@ -1298,7 +1298,7 @@ FreeAwait(addr, id) if (pCounter && !pCounter->beingDestroyed) SyncDeleteTriggerFromCounter(&pAwait->trigger); } - xfree(pAwaitUnion); + free(pAwaitUnion); return Success; } @@ -1321,7 +1321,7 @@ FreeAlarmClient(value, id) pPrev->next = pCur->next; else pAlarm->pEventClients = pCur->next; - xfree(pCur); + free(pCur); return(Success); } } @@ -1679,7 +1679,7 @@ ProcSyncAwait(client) pAwaitUnion->header.delete_id = FakeClientID(client->index); if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion)) { - xfree(pAwaitUnion); + free(pAwaitUnion); return BadAlloc; } @@ -1838,7 +1838,7 @@ ProcSyncCreateAlarm(client) status = SyncInitTrigger(client, pTrigger, None, XSyncCAAllTrigger); if (status != Success) { - xfree(pAlarm); + free(pAlarm); return status; } @@ -1852,13 +1852,13 @@ ProcSyncCreateAlarm(client) (CARD32 *)&stuff[1]); if (status != Success) { - xfree(pAlarm); + free(pAlarm); return status; } if (!AddResource(stuff->id, RTAlarm, pAlarm)) { - xfree(pAlarm); + free(pAlarm); return BadAlloc; } @@ -2346,7 +2346,7 @@ static void SyncResetProc(extEntry) ExtensionEntry *extEntry; { - xfree(SysCounterList); + free(SysCounterList); SysCounterList = NULL; RTCounter = 0; } diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c index ee7d69fc3..8f381cee5 100644 --- a/nx-X11/programs/Xserver/Xext/xcmisc.c +++ b/nx-X11/programs/Xserver/Xext/xcmisc.c @@ -175,7 +175,7 @@ ProcXCMiscGetXIDList(client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, count * sizeof(XID), pids); } - Xfree(pids); + free(pids); return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index 848f0114b..7bdda72b4 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -257,7 +257,7 @@ shmalloc( if (shmid == -1) { ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, errno = %d\n", size, errno); - xfree(pDesc); + free(pDesc); return (ShmDescPtr) NULL; } @@ -265,7 +265,7 @@ shmalloc( ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, errno = %d\n", size, errno); shmctl(shmid, IPC_RMID, (void *) 0); - xfree(pDesc); + free(pDesc); return (ShmDescPtr) NULL; } @@ -294,7 +294,7 @@ shmdealloc( if (pDesc->next) pDesc->next->prev = pDesc->prev; *pDesc->prev = pDesc->next; - xfree(pDesc); + free(pDesc); } #endif diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c index 3bcb130c7..b300a32d5 100644 --- a/nx-X11/programs/Xserver/Xext/xvdisp.c +++ b/nx-X11/programs/Xserver/Xext/xvdisp.c @@ -1281,7 +1281,7 @@ ProcXvQueryImageAttributes(ClientPtr client) SwapLongs((CARD32*)offsets, rep.length); WriteToClient(client, rep.length << 2, (char*)offsets); - xfree(offsets); + free(offsets); return Success; } diff --git a/nx-X11/programs/Xserver/Xext/xvmain.c b/nx-X11/programs/Xserver/Xext/xvmain.c index 571bb9c46..d2c21b13f 100644 --- a/nx-X11/programs/Xserver/Xext/xvmain.c +++ b/nx-X11/programs/Xserver/Xext/xvmain.c @@ -325,7 +325,7 @@ XvCloseScreen( (* pxvs->ddCloseScreen)(ii, pScreen); - xfree(pxvs); + free(pxvs); pScreen->devPrivates[XvScreenIndex].ptr = (void *)NULL; @@ -522,7 +522,7 @@ XvdiDestroyVideoNotifyList(void * pn, XID id) { npn = cpn->next; if (cpn->client) FreeResource(cpn->id, XvRTVideoNotify); - xfree(cpn); + free(cpn); cpn = npn; } return Success; @@ -946,7 +946,7 @@ XvdiSelectVideoNotify( tpn->next = (XvVideoNotifyPtr)NULL; if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn)) { - xfree(tpn); + free(tpn); return BadAlloc; } } diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c index b1441fa1d..0ec04f3e3 100644 --- a/nx-X11/programs/Xserver/Xext/xvmc.c +++ b/nx-X11/programs/Xserver/Xext/xvmc.c @@ -75,7 +75,7 @@ XvMCDestroyContextRes(void * data, XID id) if(!pContext->refcnt) { XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num].DestroyContext)(pContext); - xfree(pContext); + free(pContext); } return Success; @@ -89,7 +89,7 @@ XvMCDestroySurfaceRes(void * data, XID id) XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num].DestroySurface)(pSurface); - xfree(pSurface); + free(pSurface); XvMCDestroyContextRes((void *)pContext, pContext->context_id); @@ -105,7 +105,7 @@ XvMCDestroySubpictureRes(void * data, XID id) XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num].DestroySubpicture)(pSubpict); - xfree(pSubpict); + free(pSubpict); XvMCDestroyContextRes((void *)pContext, pContext->context_id); @@ -259,7 +259,7 @@ ProcXvMCCreateContext(ClientPtr client) result = (*adaptor->CreateContext)(pPort, pContext, &dwords, &data); if(result != Success) { - xfree(pContext); + free(pContext); return result; } @@ -276,7 +276,7 @@ ProcXvMCCreateContext(ClientPtr client) AddResource(pContext->context_id, XvMCRTContext, pContext); if(data) - xfree(data); + free(data); return Success; } @@ -324,7 +324,7 @@ ProcXvMCCreateSurface(ClientPtr client) pSurface, &dwords, &data); if(result != Success) { - xfree(pSurface); + free(pSurface); return result; } @@ -338,7 +338,7 @@ ProcXvMCCreateSurface(ClientPtr client) AddResource(pSurface->surface_id, XvMCRTSurface, pSurface); if(data) - xfree(data); + free(data); pContext->refcnt++; @@ -427,7 +427,7 @@ ProcXvMCCreateSubpicture(ClientPtr client) pSubpicture, &dwords, &data); if(result != Success) { - xfree(pSubpicture); + free(pSubpicture); return result; } @@ -449,7 +449,7 @@ ProcXvMCCreateSubpicture(ClientPtr client) AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture); if(data) - xfree(data); + free(data); pContext->refcnt++; @@ -708,7 +708,7 @@ XvMCCloseScreen (int i, ScreenPtr pScreen) pScreen->CloseScreen = pScreenPriv->CloseScreen; - xfree(pScreenPriv); + free(pScreenPriv); return (*pScreen->CloseScreen)(i, pScreen); } diff --git a/nx-X11/programs/Xserver/Xi/chgptr.c b/nx-X11/programs/Xserver/Xi/chgptr.c index 4877fcc84..2bbd7bc37 100644 --- a/nx-X11/programs/Xserver/Xi/chgptr.c +++ b/nx-X11/programs/Xserver/Xi/chgptr.c @@ -185,8 +185,8 @@ void DeleteFocusClassDeviceStruct(dev) DeviceIntPtr dev; { - xfree(dev->focus->trace); - xfree(dev->focus); + free(dev->focus->trace); + free(dev->focus); dev->focus = NULL; } diff --git a/nx-X11/programs/Xserver/Xi/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c index ce5fe9ec9..1612047bb 100644 --- a/nx-X11/programs/Xserver/Xi/exevents.c +++ b/nx-X11/programs/Xserver/Xi/exevents.c @@ -515,7 +515,7 @@ DeviceFocusEvent(dev, type, mode, detail, pWin) (void) DeliverEventsToWindow(pWin, (xEvent *)sev, evcount, DeviceStateNotifyMask, NullGrab, dev->id); - xfree (sev); + free (sev); } } @@ -830,17 +830,17 @@ InputClientGone(pWin, id) if (prev) { prev->next = other->next; - xfree(other); + free(other); } else if (!(other->next)) { if (ShouldFreeInputMasks(pWin, TRUE)) { wOtherInputMasks(pWin)->inputClients = other->next; - xfree(wOtherInputMasks(pWin)); + free(wOtherInputMasks(pWin)); pWin->optional->inputMasks = (OtherInputMasks *) NULL; CheckWindowOptionalNeed (pWin); - xfree(other); + free(other); } else { @@ -853,7 +853,7 @@ InputClientGone(pWin, id) else { wOtherInputMasks(pWin)->inputClients = other->next; - xfree(other); + free(other); } RecalculateDeviceDeliverableEvents(pWin); return(Success); @@ -1032,7 +1032,7 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k) return BadAlloc; } if ((*k)->modifierKeyMap) - xfree((*k)->modifierKeyMap); + free((*k)->modifierKeyMap); if (inputMapLen) { (*k)->modifierKeyMap = map; memmove((char *)(*k)->modifierKeyMap, (char *)inputMap, inputMapLen); diff --git a/nx-X11/programs/Xserver/Xi/getdctl.c b/nx-X11/programs/Xserver/Xi/getdctl.c index d8c310d92..440c1eeb4 100644 --- a/nx-X11/programs/Xserver/Xi/getdctl.c +++ b/nx-X11/programs/Xserver/Xi/getdctl.c @@ -161,7 +161,7 @@ ProcXGetDeviceControl(client) rep.length = (total_length+3) >> 2; WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep); WriteToClient(client, total_length, savbuf); - xfree (savbuf); + free (savbuf); return Success; } diff --git a/nx-X11/programs/Xserver/Xi/getfctl.c b/nx-X11/programs/Xserver/Xi/getfctl.c index c6cb8457c..e2f243430 100644 --- a/nx-X11/programs/Xserver/Xi/getfctl.c +++ b/nx-X11/programs/Xserver/Xi/getfctl.c @@ -190,7 +190,7 @@ ProcXGetFeedbackControl(client) rep.length = (total_length+3) >> 2; WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep); WriteToClient(client, total_length, savbuf); - xfree (savbuf); + free (savbuf); return Success; } diff --git a/nx-X11/programs/Xserver/Xi/getprop.c b/nx-X11/programs/Xserver/Xi/getprop.c index ac37617ec..33d49fb95 100644 --- a/nx-X11/programs/Xserver/Xi/getprop.c +++ b/nx-X11/programs/Xserver/Xi/getprop.c @@ -154,7 +154,7 @@ ProcXGetDeviceDontPropagateList (client) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient( client, count * sizeof(XEventClass), buf); - xfree (buf); + free (buf); } return Success; } diff --git a/nx-X11/programs/Xserver/Xi/getselev.c b/nx-X11/programs/Xserver/Xi/getselev.c index 7cd97b5ef..05d9d987c 100644 --- a/nx-X11/programs/Xserver/Xi/getselev.c +++ b/nx-X11/programs/Xserver/Xi/getselev.c @@ -168,7 +168,7 @@ ProcXGetSelectedExtensionEvents(client) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient( client, total_length, buf); - xfree (buf); + free (buf); } return Success; } diff --git a/nx-X11/programs/Xserver/Xi/listdev.c b/nx-X11/programs/Xserver/Xi/listdev.c index e99584d0e..2e78aa339 100644 --- a/nx-X11/programs/Xserver/Xi/listdev.c +++ b/nx-X11/programs/Xserver/Xi/listdev.c @@ -144,7 +144,7 @@ ProcXListInputDevices (client) rep.length = (total_length + 3) >> 2; WriteReplyToClient (client, sizeof (xListInputDevicesReply), &rep); WriteToClient(client, total_length, savbuf); - xfree (savbuf); + free (savbuf); return Success; } diff --git a/nx-X11/programs/Xserver/Xi/queryst.c b/nx-X11/programs/Xserver/Xi/queryst.c index af2b4301d..975643e0e 100644 --- a/nx-X11/programs/Xserver/Xi/queryst.c +++ b/nx-X11/programs/Xserver/Xi/queryst.c @@ -190,7 +190,7 @@ ProcXQueryDeviceState(client) WriteReplyToClient (client, sizeof(xQueryDeviceStateReply), &rep); if (total_length > 0) WriteToClient (client, total_length, savbuf); - xfree (savbuf); + free (savbuf); return Success; } diff --git a/nx-X11/programs/Xserver/composite/compalloc.c b/nx-X11/programs/Xserver/composite/compalloc.c index 017459b6b..a5d0998eb 100644 --- a/nx-X11/programs/Xserver/composite/compalloc.c +++ b/nx-X11/programs/Xserver/composite/compalloc.c @@ -159,7 +159,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update) cw = xalloc (sizeof (CompWindowRec)); if (!cw) { - xfree (ccw); + free (ccw); return BadAlloc; } cw->damage = DamageCreate (compReportDamage, @@ -170,8 +170,8 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update) pWin); if (!cw->damage) { - xfree (ccw); - xfree (cw); + free (ccw); + free (cw); return BadAlloc; } @@ -269,7 +269,7 @@ compFreeClientWindow (WindowPtr pWin, XID id) *prev = ccw->next; if (ccw->update == CompositeRedirectManual) cw->update = CompositeRedirectAutomatic; - xfree (ccw); + free (ccw); break; } } @@ -288,7 +288,7 @@ compFreeClientWindow (WindowPtr pWin, XID id) RegionUninit(&cw->borderClip); FAKE_DIX_SET_WINDOW_PRIVATE(pWin, NULL); - xfree (cw); + free (cw); } else if (cw->update == CompositeRedirectAutomatic && !cw->damageRegistered && pWin->redirectDraw != RedirectDrawNone) @@ -368,7 +368,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update) csw = xalloc (sizeof (CompSubwindowsRec)); if (!csw) { - xfree (ccw); + free (ccw); return BadAlloc; } csw->update = CompositeRedirectAutomatic; @@ -387,10 +387,10 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update) (void) compUnredirectWindow (pClient, pChild, update); if (!csw->clients) { - xfree (csw); + free (csw); FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, NULL); } - xfree (ccw); + free (ccw); return ret; } } @@ -451,7 +451,7 @@ compFreeClientSubwindows (WindowPtr pWin, XID id) for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib) (void) compUnredirectWindow (pClient, pChild, ccw->update); - xfree (ccw); + free (ccw); break; } } @@ -462,7 +462,7 @@ compFreeClientSubwindows (WindowPtr pWin, XID id) if (!csw->clients) { FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, NULL); - xfree (csw); + free (csw); } } diff --git a/nx-X11/programs/Xserver/composite/compinit.c b/nx-X11/programs/Xserver/composite/compinit.c index c86aaed5a..930787195 100644 --- a/nx-X11/programs/Xserver/composite/compinit.c +++ b/nx-X11/programs/Xserver/composite/compinit.c @@ -76,7 +76,7 @@ compCloseScreen (int index, ScreenPtr pScreen) pScreen->GetSpans = cs->GetSpans; pScreen->SourceValidate = cs->SourceValidate; - xfree (cs); + free (cs); FAKE_DIX_SET_SCREEN_PRIVATE(pScreen, NULL); ret = (*pScreen->CloseScreen) (index, pScreen); return ret; @@ -422,7 +422,7 @@ compScreenInit (ScreenPtr pScreen) if (!compAddAlternateVisuals (pScreen, cs)) { - xfree (cs); + free (cs); return FALSE; } diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index d14f14985..aedbecb7b 100755 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -214,7 +214,7 @@ ProcDamageCreate (ClientPtr client) pDamageExt); if (!pDamageExt->pDamage) { - xfree (pDamageExt); + free (pDamageExt); return BadAlloc; } if (!AddResource (stuff->damage, DamageExtType, (void *) pDamageExt)) @@ -412,7 +412,7 @@ FreeDamageExt (void * value, XID did) DamageUnregister (pDamageExt->pDrawable, pDamageExt->pDamage); DamageDestroy (pDamageExt->pDamage); } - xfree (pDamageExt); + free (pDamageExt); return Success; } diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 064987dec..e64b6bd22 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -476,7 +476,7 @@ ProcDbeAllocateBackBufferName(client) } /* Free what was allocated by the GetVisualInfo() call above. */ - xfree(scrVisInfo.visinfo); + free(scrVisInfo.visinfo); if (!visualMatched) { @@ -499,7 +499,7 @@ ProcDbeAllocateBackBufferName(client) if (!AddResource(stuff->buffer, dbeWindowPrivResType, (void *)pDbeWindowPriv)) { - xfree(pDbeWindowPriv); + free(pDbeWindowPriv); return(BadAlloc); } @@ -610,7 +610,7 @@ ProcDbeAllocateBackBufferName(client) /* The DDX buffer allocation routine failed for the first buffer of * this window. */ - xfree(pDbeWindowPriv); + free(pDbeWindowPriv); return(status); } @@ -761,14 +761,14 @@ ProcDbeSwapBuffers(client) if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client, SecurityWriteAccess))) { - Xfree(swapInfo); + free(swapInfo); return(BadWindow); } /* Each window must be double-buffered - BadMatch. */ if (DBE_WINDOW_PRIV(pWin) == NULL) { - Xfree(swapInfo); + free(swapInfo); return(BadMatch); } @@ -777,7 +777,7 @@ ProcDbeSwapBuffers(client) { if (dbeSwapInfo[i].window == dbeSwapInfo[j].window) { - Xfree(swapInfo); + free(swapInfo); return(BadMatch); } } @@ -788,7 +788,7 @@ ProcDbeSwapBuffers(client) (dbeSwapInfo[i].swapAction != XdbeUntouched ) && (dbeSwapInfo[i].swapAction != XdbeCopied )) { - Xfree(swapInfo); + free(swapInfo); return(BadValue); } @@ -818,12 +818,12 @@ ProcDbeSwapBuffers(client) error = (*pDbeScreenPriv->SwapBuffers)(client, &nStuff, swapInfo); if (error != Success) { - Xfree(swapInfo); + free(swapInfo); return(error); } } - Xfree(swapInfo); + free(swapInfo); return(Success); } /* ProcDbeSwapBuffers() */ @@ -925,7 +925,7 @@ ProcDbeGetVisualInfo(client) if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable( drawables[i], client, SecurityReadAccess))) { - Xfree(pDrawables); + free(pDrawables); return(BadDrawable); } } @@ -937,7 +937,7 @@ ProcDbeGetVisualInfo(client) { if (pDrawables) { - Xfree(pDrawables); + free(pDrawables); } return(BadAlloc); @@ -958,13 +958,13 @@ ProcDbeGetVisualInfo(client) /* Free visinfos that we allocated for previous screen infos.*/ for (j = 0; j < i; j++) { - xfree(pScrVisInfo[j].visinfo); + free(pScrVisInfo[j].visinfo); } /* Free pDrawables if we needed to allocate it above. */ if (pDrawables) { - Xfree(pDrawables); + free(pDrawables); } return(BadAlloc); @@ -1039,13 +1039,13 @@ ProcDbeGetVisualInfo(client) /* Clean up memory. */ for (i = 0; i < count; i++) { - xfree(pScrVisInfo[i].visinfo); + free(pScrVisInfo[i].visinfo); } - xfree(pScrVisInfo); + free(pScrVisInfo); if (pDrawables) { - Xfree(pDrawables); + free(pDrawables); } return(client->noClientException); @@ -1640,7 +1640,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id) DBE_INIT_MAX_IDS * sizeof(XID)); /* Free the extended array; use the static array. */ - xfree(pDbeWindowPriv->IDs); + free(pDbeWindowPriv->IDs); pDbeWindowPriv->IDs = pDbeWindowPriv->initIDs; pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS; } @@ -1671,7 +1671,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id) (void *)NULL; /* We are done with the window priv. */ - xfree(pDbeWindowPriv); + free(pDbeWindowPriv); } return(Success); @@ -1719,10 +1719,10 @@ DbeResetProc(extEntry) if (pDbeScreenPriv->winPrivPrivSizes) { - xfree(pDbeScreenPriv->winPrivPrivSizes); + free(pDbeScreenPriv->winPrivPrivSizes); } - xfree(pDbeScreenPriv); + free(pDbeScreenPriv); } } @@ -1882,7 +1882,7 @@ DbeExtensionInit() for (j = 0; j < i; j++) { - xfree(screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr); + free(screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr); screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr = NULL; } return; @@ -1986,7 +1986,7 @@ DbeExtensionInit() for (i = 0; i < screenInfo.numScreens; i++) { - xfree(screenInfo.screens[i]->devPrivates[dbeScreenPrivIndex].ptr); + free(screenInfo.screens[i]->devPrivates[dbeScreenPrivIndex].ptr); pScreen->devPrivates[dbeScreenPrivIndex].ptr = NULL; } return; diff --git a/nx-X11/programs/Xserver/dix/atom.c b/nx-X11/programs/Xserver/dix/atom.c index 29e60be03..fdb1c18a2 100644 --- a/nx-X11/programs/Xserver/dix/atom.c +++ b/nx-X11/programs/Xserver/dix/atom.c @@ -120,7 +120,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit) { nd->string = (char *) xalloc(len + 1); if (!nd->string) { - xfree(nd); + free(nd); return BAD_RESOURCE; } strncpy(nd->string, string, (int)len); @@ -133,8 +133,8 @@ MakeAtom(const char *string, unsigned len, Bool makeit) tableLength * (2 * sizeof(NodePtr))); if (!table) { if (nd->string != string) - xfree(nd->string); - xfree(nd); + free(nd->string); + free(nd); return BAD_RESOURCE; } tableLength <<= 1; @@ -180,8 +180,8 @@ FreeAtom(NodePtr patom) if(patom->right) FreeAtom(patom->right); if (patom->a > XA_LAST_PREDEFINED) - xfree(patom->string); - xfree(patom); + free(patom->string); + free(patom); } void @@ -191,7 +191,7 @@ FreeAllAtoms() return; FreeAtom(atomRoot); atomRoot = (NodePtr)NULL; - xfree(nodeTable); + free(nodeTable); nodeTable = (NodePtr *)NULL; lastAtom = None; } diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index 4acfdc1bb..39da0abd4 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -306,7 +306,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, ppix = (Pixel *)xalloc(size * sizeof(Pixel)); if (!ppix) { - xfree(pmap); + free(pmap); return (BadAlloc); } pmap->clientPixelsRed[client] = ppix; @@ -352,8 +352,8 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, ppix = (Pixel *) xalloc(size * sizeof(Pixel)); if (!ppix) { - xfree(pmap->clientPixelsRed[client]); - xfree(pmap); + free(pmap->clientPixelsRed[client]); + free(pmap); return(BadAlloc); } pmap->clientPixelsGreen[client] = ppix; @@ -368,9 +368,9 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, ppix = (Pixel *) xalloc(size * sizeof(Pixel)); if (!ppix) { - xfree(pmap->clientPixelsGreen[client]); - xfree(pmap->clientPixelsRed[client]); - xfree(pmap); + free(pmap->clientPixelsGreen[client]); + free(pmap->clientPixelsRed[client]); + free(pmap); return(BadAlloc); } pmap->clientPixelsBlue[client] = ppix; @@ -438,7 +438,7 @@ FreeColormap (void * value, XID mid) if(pmap->clientPixelsRed) { for(i = 0; i < MAXCLIENTS; i++) - xfree(pmap->clientPixelsRed[i]); + free(pmap->clientPixelsRed[i]); } if ((pmap->class == PseudoColor) || (pmap->class == GrayScale)) @@ -450,11 +450,11 @@ FreeColormap (void * value, XID mid) if(pent->fShared) { if (--pent->co.shco.red->refcnt == 0) - xfree(pent->co.shco.red); + free(pent->co.shco.red); if (--pent->co.shco.green->refcnt == 0) - xfree(pent->co.shco.green); + free(pent->co.shco.green); if (--pent->co.shco.blue->refcnt == 0) - xfree(pent->co.shco.blue); + free(pent->co.shco.blue); } } } @@ -462,15 +462,15 @@ FreeColormap (void * value, XID mid) { for(i = 0; i < MAXCLIENTS; i++) { - xfree(pmap->clientPixelsGreen[i]); - xfree(pmap->clientPixelsBlue[i]); + free(pmap->clientPixelsGreen[i]); + free(pmap->clientPixelsBlue[i]); } } if (pmap->devPrivates) - xfree(pmap->devPrivates); + free(pmap->devPrivates); - xfree(pmap); + free(pmap); return(Success); } @@ -721,11 +721,11 @@ FreeCell (ColormapPtr pmap, Pixel i, int channel) if (pent->fShared) { if(--pent->co.shco.red->refcnt == 0) - xfree(pent->co.shco.red); + free(pent->co.shco.red); if(--pent->co.shco.green->refcnt == 0) - xfree(pent->co.shco.green); + free(pent->co.shco.green); if(--pent->co.shco.blue->refcnt == 0) - xfree(pent->co.shco.blue); + free(pent->co.shco.blue); pent->fShared = FALSE; } pent->refcnt = 0; @@ -1518,7 +1518,7 @@ FreePixels(register ColormapPtr pmap, register int client) } } - xfree(ppixStart); + free(ppixStart); pmap->clientPixelsRed[client] = (Pixel *) NULL; pmap->numPixelsRed[client] = 0; if ((class | DynamicClass) == DirectColor) @@ -1527,7 +1527,7 @@ FreePixels(register ColormapPtr pmap, register int client) if (class & DynamicClass) for (ppix = ppixStart, n = pmap->numPixelsGreen[client]; --n >= 0;) FreeCell(pmap, *ppix++, GREENMAP); - xfree(ppixStart); + free(ppixStart); pmap->clientPixelsGreen[client] = (Pixel *) NULL; pmap->numPixelsGreen[client] = 0; @@ -1535,7 +1535,7 @@ FreePixels(register ColormapPtr pmap, register int client) if (class & DynamicClass) for (ppix = ppixStart, n = pmap->numPixelsBlue[client]; --n >= 0; ) FreeCell(pmap, *ppix++, BLUEMAP); - xfree(ppixStart); + free(ppixStart); pmap->clientPixelsBlue[client] = (Pixel *) NULL; pmap->numPixelsBlue[client] = 0; } @@ -1556,7 +1556,7 @@ FreeClientPixels (void * value, XID fakeid) pmap = (ColormapPtr) LookupIDByType(pcr->mid, RT_COLORMAP); if (pmap) FreePixels(pmap, pcr->client); - xfree(pcr); + free(pcr); return Success; } @@ -1626,7 +1626,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes, if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *)pcr)) ok = BadAlloc; } else if (pcr) - xfree(pcr); + free(pcr); return (ok); } @@ -1717,7 +1717,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors, if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *)pcr)) ok = BadAlloc; } else if (pcr) - xfree(pcr); + free(pcr); return (ok); } @@ -2092,7 +2092,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b, if (!(ppshared[z] = (SHAREDCOLOR *)xalloc(sizeof(SHAREDCOLOR)))) { for (z++ ; z < npixShared; z++) - xfree(ppshared[z]); + free(ppshared[z]); return FALSE; } } @@ -2372,7 +2372,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe else { npixClient = 0; - xfree(ppixClient); + free(ppixClient); ppixClient = (Pixel *)NULL; } switch(color) diff --git a/nx-X11/programs/Xserver/dix/cursor.c b/nx-X11/programs/Xserver/dix/cursor.c index 1e1dba36b..575ff1eb4 100644 --- a/nx-X11/programs/Xserver/dix/cursor.c +++ b/nx-X11/programs/Xserver/dix/cursor.c @@ -81,10 +81,10 @@ FreeCursorBits(CursorBitsPtr bits) { if (--bits->refcnt > 0) return; - xfree(bits->source); - xfree(bits->mask); + free(bits->source); + free(bits->mask); #ifdef ARGB_CURSOR - xfree(bits->argb); + free(bits->argb); #endif if (bits->refcnt == 0) { @@ -98,9 +98,9 @@ FreeCursorBits(CursorBitsPtr bits) { *prev = this->next; CloseFont(this->font, (Font)0); - xfree(this); + free(this); } - xfree(bits); + free(bits); } } @@ -126,7 +126,7 @@ FreeCursor(void * value, XID cid) (void)( *pscr->UnrealizeCursor)( pscr, pCurs); } FreeCursorBits(pCurs->bits); - xfree( pCurs); + free( pCurs); return(Success); } @@ -177,8 +177,8 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb, pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits)); if (!pCurs) { - xfree(psrcbits); - xfree(pmaskbits); + free(psrcbits); + free(pmaskbits); return (CursorPtr)NULL; } bits = (CursorBitsPtr)((char *)pCurs + sizeof(CursorRec)); @@ -223,7 +223,7 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb, ( *pscr->UnrealizeCursor)( pscr, pCurs); } FreeCursorBits(bits); - xfree(pCurs); + free(pCurs); return (CursorPtr)NULL; } } @@ -329,7 +329,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, } if ((res = ServerBitsFromGlyph(sourcefont, sourceChar, &cm, &srcbits)) != 0) { - xfree(mskbits); + free(mskbits); return res; } if (sourcefont != maskfont) @@ -350,9 +350,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, } if (!bits) { - xfree(pCurs); - xfree(mskbits); - xfree(srcbits); + free(pCurs); + free(mskbits); + free(srcbits); return BadAlloc; } bits->source = srcbits; @@ -414,7 +414,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, ( *pscr->UnrealizeCursor)( pscr, pCurs); } FreeCursorBits(pCurs->bits); - xfree(pCurs); + free(pCurs); return BadAlloc; } } diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index 49ab80529..314714152 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -208,29 +208,29 @@ CloseDevice(register DeviceIntPtr dev) if (dev->inited) (void)(*dev->deviceProc)(dev, DEVICE_CLOSE); - xfree(dev->name); + free(dev->name); if (dev->key) { #ifdef XKB if (dev->key->xkbInfo) XkbFreeInfo(dev->key->xkbInfo); #endif - xfree(dev->key->curKeySyms.map); - xfree(dev->key->modifierKeyMap); - xfree(dev->key); + free(dev->key->curKeySyms.map); + free(dev->key->modifierKeyMap); + free(dev->key); } - xfree(dev->valuator); + free(dev->valuator); #ifdef XKB if ((dev->button)&&(dev->button->xkb_acts)) - xfree(dev->button->xkb_acts); + free(dev->button->xkb_acts); #endif - xfree(dev->button); + free(dev->button); if (dev->focus) { - xfree(dev->focus->trace); - xfree(dev->focus); + free(dev->focus->trace); + free(dev->focus); } - xfree(dev->proximity); + free(dev->proximity); for (k=dev->kbdfeed; k; k=knext) { knext = k->next; @@ -238,29 +238,29 @@ CloseDevice(register DeviceIntPtr dev) if (k->xkb_sli) XkbFreeSrvLedInfo(k->xkb_sli); #endif - xfree(k); + free(k); } for (p=dev->ptrfeed; p; p=pnext) { pnext = p->next; - xfree(p); + free(p); } for (i=dev->intfeed; i; i=inext) { inext = i->next; - xfree(i); + free(i); } for (s=dev->stringfeed; s; s=snext) { snext = s->next; - xfree(s->ctrl.symbols_supported); - xfree(s->ctrl.symbols_displayed); - xfree(s); + free(s->ctrl.symbols_supported); + free(s->ctrl.symbols_displayed); + free(s); } for (b=dev->bell; b; b=bnext) { bnext = b->next; - xfree(b); + free(b); } for (l=dev->leds; l; l=lnext) { @@ -269,15 +269,15 @@ CloseDevice(register DeviceIntPtr dev) if (l->xkb_sli) XkbFreeSrvLedInfo(l->xkb_sli); #endif - xfree(l); + free(l); } #ifdef XKB while (dev->xkb_interest) { XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource); } #endif - xfree(dev->sync.event); - xfree(dev); + free(dev->sync.event); + free(dev); } void @@ -471,7 +471,7 @@ SetKeySymsMap(register KeySymsPtr dst, register KeySymsPtr src) memmove((char *)&map[i*src->mapWidth], (char *)&dst->map[i*dst->mapWidth], dst->mapWidth * sizeof(KeySym)); - xfree(dst->map); + free(dst->map); } dst->mapWidth = src->mapWidth; dst->map = map; @@ -550,9 +550,9 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers keyc->modifierKeyCount[i] = 0; if (!SetKeySymsMap(&keyc->curKeySyms, pKeySyms) || !InitModMap(keyc)) { - xfree(keyc->curKeySyms.map); - xfree(keyc->modifierKeyMap); - xfree(keyc); + free(keyc->curKeySyms.map); + free(keyc->modifierKeyMap); + free(keyc); return FALSE; } dev->key = keyc; @@ -722,10 +722,10 @@ InitStringFeedbackClassDeviceStruct ( if (!feedc->ctrl.symbols_supported || !feedc->ctrl.symbols_displayed) { if (feedc->ctrl.symbols_supported) - xfree(feedc->ctrl.symbols_supported); + free(feedc->ctrl.symbols_supported); if (feedc->ctrl.symbols_displayed) - xfree(feedc->ctrl.symbols_displayed); - xfree(feedc); + free(feedc->ctrl.symbols_displayed); + free(feedc); return FALSE; } for (i=0; imodifierKeyMap) - xfree(keyc->modifierKeyMap); + free(keyc->modifierKeyMap); keyc->modifierKeyMap = map; memmove((char *)map, (char *)inputMap, inputMapLen); diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 803870369..9b9021d62 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -214,7 +214,7 @@ void InitSelections() { if (CurrentSelections) - xfree(CurrentSelections); + free(CurrentSelections); CurrentSelections = (Selection *)NULL; NumCurrentSelections = 0; } @@ -3090,7 +3090,7 @@ ProcCreateCursor (register ClientPtr client) mskbits = (unsigned char *)xalloc(n); if (!mskbits) { - xfree(srcbits); + free(srcbits); return (BadAlloc); } @@ -3332,7 +3332,7 @@ ProcListHosts(register ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend; WriteSwappedDataToClient(client, len, pdata); } - xfree(pdata); + free(pdata); return (client->noClientException); } @@ -3600,7 +3600,7 @@ CloseDownClient(register ClientPtr client) #ifdef SMART_SCHEDULE SmartLastClient = NullClient; #endif - xfree(client); + free(client); while (!clients[currentMaxClients-1]) currentMaxClients--; @@ -3760,7 +3760,7 @@ ClientPtr NextAvailableClient(void * ospriv) InitClientPrivates(client); if (!InitClientResources(client)) { - xfree(client); + free(client); return (ClientPtr)NULL; } data.reqType = 1; @@ -3768,7 +3768,7 @@ ClientPtr NextAvailableClient(void * ospriv) if (!InsertFakeRequest(client, (char *)&data, sz_xReq)) { FreeClientResources(client); - xfree(client); + free(client); return (ClientPtr)NULL; } if (i == currentMaxClients) diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index 58e562411..1a0352387 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -226,8 +226,8 @@ FreeFPE (FontPathElementPtr fpe) fpe->refcount--; if (fpe->refcount == 0) { (*fpe_functions[fpe->type].free_fpe) (fpe); - xfree(fpe->name); - xfree(fpe); + free(fpe->name); + free(fpe); } } @@ -377,9 +377,9 @@ bail: for (i = 0; i < c->num_fpes; i++) { FreeFPE(c->fpe_list[i]); } - xfree(c->fpe_list); - xfree(c->fontname); - xfree(c); + free(c->fpe_list); + free(c->fontname); + free(c); return TRUE; } #endif /* NXAGENT_SERVER */ @@ -397,7 +397,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna memmove(f, pfontname, lenfname); f[lenfname] = '\0'; ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); + free(f); #endif if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) return BadName; @@ -437,7 +437,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna c->origFontName = pfontname; c->origFontNameLen = lenfname; if (!c->fontname) { - xfree(c); + free(c); return BadAlloc; } /* @@ -447,8 +447,8 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna c->fpe_list = (FontPathElementPtr *) xalloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { - xfree(c->fontname); - xfree(c); + free(c->fontname); + free(c); return BadAlloc; } memmove(c->fontname, pfontname, lenfname); @@ -679,7 +679,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) return TRUE; } if (err == FontNameAlias) { - if (resolved) xfree(resolved); + if (resolved) free(resolved); resolved = (char *) xalloc(resolvedlen + 1); if (resolved) memmove(resolved, tmpname, resolvedlen + 1); @@ -734,7 +734,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) c->saved = c->current; c->haveSaved = TRUE; if (c->savedName) - xfree(c->savedName); + free(c->savedName); c->savedName = (char *)xalloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); @@ -829,11 +829,11 @@ bail: ClientWakeup(client); for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); + free(c->fpe_list); + if (c->savedName) free(c->savedName); FreeFontNames(names); - xfree(c); - if (resolved) xfree(resolved); + free(c); + if (resolved) free(resolved); return TRUE; } @@ -858,14 +858,14 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, c->fpe_list = (FontPathElementPtr *) xalloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { - xfree(c); + free(c); return BadAlloc; } c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100); if (!c->names) { - xfree(c->fpe_list); - xfree(c); + free(c->fpe_list); + free(c); return BadAlloc; } memmove( c->current.pattern, pattern, length); @@ -994,7 +994,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) c->haveSaved = TRUE; c->savedNumFonts = numFonts; if (c->savedName) - xfree(c->savedName); + free(c->savedName); c->savedName = (char *)xalloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); @@ -1084,8 +1084,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) (void) WriteToClient(client, namelen, name); if (pFontInfo == &fontInfo) { - xfree(fontInfo.props); - xfree(fontInfo.isStringProp); + free(fontInfo.props); + free(fontInfo.isStringProp); } --c->current.max_names; } @@ -1103,10 +1103,10 @@ bail: ClientWakeup(client); for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->reply); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - xfree(c); + free(c->reply); + free(c->fpe_list); + if (c->savedName) free(c->savedName); + free(c); return TRUE; } #endif /* NXAGENT_SERVER */ @@ -1133,7 +1133,7 @@ StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, xalloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { - xfree(c); + free(c); goto badAlloc; } memmove(c->current.pattern, pattern, length); @@ -1330,7 +1330,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) c->data = (unsigned char *)xalloc(len); if (!c->data) { - xfree(c); + free(c); err = BadAlloc; goto bail; } @@ -1343,8 +1343,8 @@ doPolyText(ClientPtr client, register PTclosurePtr c) pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); if (!pGC) { - xfree(c->data); - xfree(c); + free(c->data); + free(c); err = BadAlloc; goto bail; } @@ -1366,8 +1366,8 @@ doPolyText(ClientPtr client, register PTclosurePtr c) Success) { FreeScratchGC(pGC); - xfree(c->data); - xfree(c); + free(c->data); + free(c); err = BadAlloc; goto bail; } @@ -1434,8 +1434,8 @@ bail: c->pGC->font = NullFont; FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); + free(c->data); + free(c); } return TRUE; } @@ -1530,7 +1530,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) data = (unsigned char *)xalloc(c->nChars * c->itemSize); if (!data) { - xfree(c); + free(c); c = old_closure; err = BadAlloc; goto bail; @@ -1541,8 +1541,8 @@ doImageText(ClientPtr client, register ITclosurePtr c) pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); if (!pGC) { - xfree(c->data); - xfree(c); + free(c->data); + free(c); c = old_closure; err = BadAlloc; goto bail; @@ -1562,8 +1562,8 @@ doImageText(ClientPtr client, register ITclosurePtr c) GCClipYOrigin | GCClipMask)) != Success) { FreeScratchGC(pGC); - xfree(c->data); - xfree(c); + free(c->data); + free(c); c = old_closure; err = BadAlloc; goto bail; @@ -1602,8 +1602,8 @@ bail: c->pGC->font = NullFont; FreeScratchGC(c->pGC); - xfree(c->data); - xfree(c); + free(c->data); + free(c); } return TRUE; } @@ -1677,7 +1677,7 @@ FreeFontPath(FontPathElementPtr *list, int n, Bool force) } FreeFPE(list[i]); } - xfree((char *) list); + free((char *) list); } static FontPathElementPtr @@ -1754,7 +1754,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) fpe->name = (char *) xalloc(len + 1); if (!fpe->name) { - xfree(fpe); + free(fpe); err = BadAlloc; goto bail; } @@ -1777,8 +1777,8 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) fpe->name); } #endif /* NXAGENT_SERVER */ - xfree (fpe->name); - xfree (fpe); + free (fpe->name); + free (fpe); } } } @@ -1805,7 +1805,7 @@ bail: *bad = i; while (--valid_paths >= 0) FreeFPE(fplist[valid_paths]); - xfree(fplist); + free(fplist); return FontToXError(err); } @@ -2037,7 +2037,7 @@ FreeFonts() FreeFontPath(font_path_elements, num_fpes, TRUE); font_path_elements = 0; num_fpes = 0; - xfree(fpe_functions); + free(fpe_functions); num_fpe_types = 0; fpe_functions = (FPEFunctions *) 0; } diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index e91303851..1c6305684 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -377,7 +377,7 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, } else { - xfree(client->saveSet); + free(client->saveSet); client->saveSet = (SaveSetElt *)NULL; } client->numSaved = numnow; @@ -549,7 +549,7 @@ RemoveBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler, void InitBlockAndWakeupHandlers () { - xfree (handlers); + free (handlers); handlers = (BlockHandlerPtr) 0; numHandlers = 0; sizeHandlers = 0; @@ -581,7 +581,7 @@ ProcessWorkQueue(void) { /* remove q from the list */ *p = q->next; /* don't fetch until after func called */ - xfree (q); + free (q); } else { @@ -604,7 +604,7 @@ ProcessWorkQueueZombies(void) (void) (*q->function) (q->client, q->closure); /* remove q from the list */ *p = q->next; /* don't fetch until after func called */ - xfree (q); + free (q); } else { @@ -692,7 +692,7 @@ ClientWakeup (ClientPtr client) if (q->client == client) { *prev = q->next; - xfree (q); + free (q); if (client->clientGone) /* Oops -- new zombie cleanup code ensures this only * happens from inside CloseDownClient; don't want to @@ -775,7 +775,7 @@ _DeleteCallback( cbl->list = cbr->next; else pcbr->next = cbr->next; - xfree(cbr); + free(cbr); } return TRUE; } @@ -820,12 +820,12 @@ _CallCallbacks( if (pcbr) { cbr = cbr->next; - xfree(pcbr->next); + free(pcbr->next); pcbr->next = cbr; } else { cbr = cbr->next; - xfree(cbl->list); + free(cbl->list); cbl->list = cbr; } cbl->numDeleted--; @@ -865,9 +865,9 @@ _DeleteCallbackList( for (cbr = cbl->list; cbr != NULL; cbr = nextcbr) { nextcbr = cbr->next; - xfree(cbr); + free(cbr); } - xfree(cbl); + free(cbl); *pcbl = NULL; } @@ -955,7 +955,7 @@ InitCallbackManager() { DeleteCallbackList(listsToCleanup[i]); } - if (listsToCleanup) xfree(listsToCleanup); + if (listsToCleanup) free(listsToCleanup); numCallbackListsToCleanup = 0; listsToCleanup = NULL; diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index 31b76e38f..ba0c5d847 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -1076,7 +1076,7 @@ PlayReleasedEvents(void) #endif (*qe->device->public.processInputProc)(qe->event, qe->device, qe->evcount); - xfree(qe); + free(qe); for (dev = inputInfo.devices; dev && dev->sync.frozen; dev = dev->next) ; if (!dev) @@ -2959,7 +2959,7 @@ OtherClientGone(void * value, XID id) if (!(pWin->optional->otherClients = other->next)) CheckWindowOptionalNeed (pWin); } - xfree(other); + free(other); RecalculateDeliverableEvents(pWin); return(Success); } @@ -3948,7 +3948,7 @@ InitEvents() while (syncEvents.pending) { QdEventPtr next = syncEvents.pending->next; - xfree(syncEvents.pending); + free(syncEvents.pending); syncEvents.pending = next; } syncEvents.pendtail = &syncEvents.pending; @@ -3968,7 +3968,7 @@ InitEvents() void CloseDownEvents(void) { - xfree(spriteTrace); + free(spriteTrace); spriteTrace = NULL; spriteTraceSize = 0; } diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c index fe51f8916..4f06c0af4 100644 --- a/nx-X11/programs/Xserver/dix/extension.c +++ b/nx-X11/programs/Xserver/dix/extension.c @@ -103,7 +103,7 @@ AddExtension(char *name, int NumEvents, int NumErrors, ext->aliases = (char **)NULL; if (!ext->name) { - xfree(ext); + free(ext); return((ExtensionEntry *) NULL); } strcpy(ext->name, name); @@ -112,8 +112,8 @@ AddExtension(char *name, int NumEvents, int NumErrors, (i + 1) * sizeof(ExtensionEntry *)); if (!newexts) { - xfree(ext->name); - xfree(ext); + free(ext->name); + free(ext); return((ExtensionEntry *) NULL); } NumExtensions++; @@ -263,13 +263,13 @@ CloseDownExtensions() if (extensions[i]->CloseDown) (* extensions[i]->CloseDown)(extensions[i]); NumExtensions = i; - xfree(extensions[i]->name); + free(extensions[i]->name); for (j = extensions[i]->num_aliases; --j >= 0;) - xfree(extensions[i]->aliases[j]); - xfree(extensions[i]->aliases); - xfree(extensions[i]); + free(extensions[i]->aliases[j]); + free(extensions[i]->aliases); + free(extensions[i]); } - xfree(extensions); + free(extensions); extensions = (ExtensionEntry **)NULL; lastEvent = EXTENSION_EVENT_BASE; lastError = FirstExtensionError; @@ -280,9 +280,9 @@ CloseDownExtensions() while (spentry->num) { spentry->num--; - xfree(spentry->procList[spentry->num].name); + free(spentry->procList[spentry->num].name); } - xfree(spentry->procList); + free(spentry->procList); spentry->procList = (ProcEntryPtr)NULL; } } @@ -446,7 +446,7 @@ RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc) sizeof(ProcEntryRec) * (spentry->num+1)); if (!procEntry) { - xfree(newname); + free(newname); return FALSE; } spentry->procList = procEntry; diff --git a/nx-X11/programs/Xserver/dix/gc.c b/nx-X11/programs/Xserver/dix/gc.c index 2c17de3d6..595d8ab74 100644 --- a/nx-X11/programs/Xserver/dix/gc.c +++ b/nx-X11/programs/Xserver/dix/gc.c @@ -457,7 +457,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC { if (pGC->dash != DefaultDash) { - xfree(pGC->dash); + free(pGC->dash); pGC->numInDashList = 2; pGC->dash = DefaultDash; } @@ -470,7 +470,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC if (dash) { if (pGC->dash != DefaultDash) - xfree(pGC->dash); + free(pGC->dash); pGC->numInDashList = 2; pGC->dash = dash; dash[0] = newdash; @@ -838,7 +838,7 @@ CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask) { if (pgcDst->dash != DefaultDash) { - xfree(pgcDst->dash); + free(pgcDst->dash); pgcDst->numInDashList = pgcSrc->numInDashList; pgcDst->dash = pgcSrc->dash; } @@ -853,7 +853,7 @@ CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask) if (dash) { if (pgcDst->dash != DefaultDash) - xfree(pgcDst->dash); + free(pgcDst->dash); pgcDst->numInDashList = pgcSrc->numInDashList; pgcDst->dash = dash; for (i=0; inumInDashList; i++) @@ -904,8 +904,8 @@ FreeGC(void * value, XID gid) (*pGC->funcs->DestroyGC) (pGC); if (pGC->dash != DefaultDash) - xfree(pGC->dash); - xfree(pGC); + free(pGC->dash); + free(pGC); return(Success); } @@ -1113,7 +1113,7 @@ SetDashes(register GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pd } if (pGC->dash != DefaultDash) - xfree(pGC->dash); + free(pGC->dash); pGC->numInDashList = ndash; pGC->dash = p; if (ndash & 1) diff --git a/nx-X11/programs/Xserver/dix/glyphcurs.c b/nx-X11/programs/Xserver/dix/glyphcurs.c index f715a327f..c8b71db4e 100644 --- a/nx-X11/programs/Xserver/dix/glyphcurs.c +++ b/nx-X11/programs/Xserver/dix/glyphcurs.c @@ -108,7 +108,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns (*pScreen->DestroyPixmap)(ppix); if (pGC) FreeScratchGC(pGC); - xfree(pbits); + free(pbits); return BadAlloc; } diff --git a/nx-X11/programs/Xserver/dix/grabs.c b/nx-X11/programs/Xserver/dix/grabs.c index 839e930b1..7fd9ad096 100644 --- a/nx-X11/programs/Xserver/dix/grabs.c +++ b/nx-X11/programs/Xserver/dix/grabs.c @@ -116,15 +116,15 @@ static void FreeGrab(GrabPtr pGrab) { if (pGrab->modifiersDetail.pMask != NULL) - xfree(pGrab->modifiersDetail.pMask); + free(pGrab->modifiersDetail.pMask); if (pGrab->detail.pMask != NULL) - xfree(pGrab->detail.pMask); + free(pGrab->detail.pMask); if (pGrab->cursor) FreeCursor(pGrab->cursor, (Cursor)0); - xfree(pGrab); + free(pGrab); } int @@ -410,7 +410,7 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab) for (i = 0; i < nadds; i++) FreeResource(adds[i]->resource, RT_NONE); for (i = 0; i < nups; i++) - xfree(details[i]); + free(details[i]); } else { @@ -424,7 +424,7 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab) } for (i = 0; i < nups; i++) { - xfree(*updates[i]); + free(*updates[i]); *updates[i] = details[i]; } } diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c index 25fbb8b65..9d0197e3d 100644 --- a/nx-X11/programs/Xserver/dix/main.c +++ b/nx-X11/programs/Xserver/dix/main.c @@ -474,7 +474,7 @@ main(int argc, char *argv[], char *envp[]) #endif FreeAuditTimer(); - xfree(serverClient->devPrivates); + free(serverClient->devPrivates); serverClient->devPrivates = NULL; if (dispatchException & DE_TERMINATE) @@ -490,7 +490,7 @@ main(int argc, char *argv[], char *envp[]) break; } - xfree(ConnectionInfo); + free(ConnectionInfo); ConnectionInfo = NULL; } return(0); @@ -621,7 +621,7 @@ CreateConnectionBlock() pBuf = (char *)xrealloc(ConnectionInfo, lenofblock); if (!pBuf) { - xfree(ConnectionInfo); + free(ConnectionInfo); return FALSE; } ConnectionInfo = pBuf; @@ -697,7 +697,7 @@ AddScreen( screenPrivateCount); if (!pScreen->devPrivates && screenPrivateCount) { - xfree(pScreen); + free(pScreen); return -1; } pScreen->myNum = i; @@ -782,11 +782,11 @@ static void FreeScreen(ScreenPtr pScreen) { pScreen->root = NullWindow; - xfree(pScreen->WindowPrivateSizes); - xfree(pScreen->GCPrivateSizes); + free(pScreen->WindowPrivateSizes); + free(pScreen->GCPrivateSizes); #ifdef PIXPRIV - xfree(pScreen->PixmapPrivateSizes); + free(pScreen->PixmapPrivateSizes); #endif - xfree(pScreen->devPrivates); - xfree(pScreen); + free(pScreen->devPrivates); + free(pScreen); } diff --git a/nx-X11/programs/Xserver/dix/privates.c b/nx-X11/programs/Xserver/dix/privates.c index d08883d1d..3455fb21c 100644 --- a/nx-X11/programs/Xserver/dix/privates.c +++ b/nx-X11/programs/Xserver/dix/privates.c @@ -66,7 +66,7 @@ ResetClientPrivates() { clientPrivateCount = 0; clientPrivateLen = 0; - xfree(clientPrivateSizes); + free(clientPrivateSizes); clientPrivateSizes = (unsigned *)NULL; totalClientSize = ((sizeof(ClientRec) + sizeof(long) - 1) / sizeof(long)) * sizeof(long); diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index b3b650dda..4476141e5 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -290,7 +290,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, data = (void *)xalloc(totalSize); if (!data && len) { - xfree(pProp); + free(pProp); return(BadAlloc); } pProp->propertyName = property; @@ -353,7 +353,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, memmove(&((char *)data)[totalSize], (char *)pProp->data, (int)(pProp->size * sizeInBytes)); memmove((char *)data, (char *)value, totalSize); - xfree(pProp->data); + free(pProp->data); pProp->data = data; pProp->size += len; } @@ -404,8 +404,8 @@ DeleteProperty(WindowPtr pWin, Atom propName) event.u.property.atom = pProp->propertyName; event.u.property.time = currentTime.milliseconds; DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); - xfree(pProp->data); - xfree(pProp); + free(pProp->data); + free(pProp); } return(Success); } @@ -426,8 +426,8 @@ DeleteAllWindowProperties(WindowPtr pWin) event.u.property.time = currentTime.milliseconds; DeliverEvents(pWin, &event, 1, (WindowPtr)NULL); pNextProp = pProp->next; - xfree(pProp->data); - xfree(pProp); + free(pProp->data); + free(pProp); pProp = pNextProp; } } @@ -599,8 +599,8 @@ ProcGetProperty(ClientPtr client) } else prevProp->next = pProp->next; - xfree(pProp->data); - xfree(pProp); + free(pProp->data); + free(pProp); } return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/dix/region.c b/nx-X11/programs/Xserver/dix/region.c index e927b9fde..4c2bc4695 100644 --- a/nx-X11/programs/Xserver/dix/region.c +++ b/nx-X11/programs/Xserver/dix/region.c @@ -172,7 +172,7 @@ Equipment Corporation. ((r1)->y1 <= (r2)->y1) && \ ((r1)->y2 >= (r2)->y2) ) -#define xfreeData(reg) if ((reg)->data && (reg)->data->size) xfree((reg)->data) +#define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data) #define RECTALLOC_BAIL(pReg,n,bail) \ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ @@ -342,7 +342,7 @@ RegionDestroy(pReg) good(pReg); xfreeData(pReg); if (pReg != &RegionBrokenRegion) - xfree(pReg); + free(pReg); } Bool @@ -795,7 +795,7 @@ RegionOp( } if (oldData) - xfree(oldData); + free(oldData); if (!(numRects = newReg->data->numRects)) { @@ -1355,13 +1355,13 @@ NextRect: ; numRI -= half; } *badreg = ri[0].reg; - xfree(ri); + free(ri); good(badreg); return ret; bail: for (i = 0; i < numRI; i++) xfreeData(&ri[i].reg); - xfree (ri); + free (ri); return RegionBreak (badreg); } @@ -1443,7 +1443,7 @@ RegionFromRects(nrects, prect, ctype) } else { - xfree (pData); + free (pData); } return pRgn; } diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index b0edbb2aa..0c5b6dd29 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -231,7 +231,7 @@ InitClientResources(ClientPtr client) lastResourceClass = RC_LASTPREDEF; TypeMask = RC_LASTPREDEF - 1; if (DeleteFuncs) - xfree(DeleteFuncs); + free(DeleteFuncs); DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) * sizeof(DeleteType)); if (!DeleteFuncs) @@ -249,7 +249,7 @@ InitClientResources(ClientPtr client) #ifdef XResExtension if(ResourceNames) - xfree(ResourceNames); + free(ResourceNames); ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom)); if(!ResourceNames) return FALSE; @@ -505,7 +505,7 @@ RebuildTable(int client) } DEALLOCATE_LOCAL(tails); clientTable[client].buckets *= 2; - xfree(clientTable[client].resources); + free(clientTable[client].resources); clientTable[client].resources = resources; } @@ -535,7 +535,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) elements = --*eltptr; if (rtype != skipDeleteFuncType) (*DeleteFuncs[rtype & TypeMask])(res->value, res->id); - xfree(res); + free(res); if (*eltptr != elements) prev = head; /* prev may no longer be valid */ gotOne = TRUE; @@ -568,7 +568,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) *prev = res->next; if (!skipFree) (*DeleteFuncs[type & TypeMask])(res->value, res->id); - xfree(res); + free(res); break; } else @@ -723,7 +723,7 @@ FreeClientNeverRetainResources(ClientPtr client) { *prev = this->next; (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); + free(this); } else prev = &this->next; @@ -767,10 +767,10 @@ FreeClientResources(ClientPtr client) RESTYPE rtype = this->type; *head = this->next; (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); - xfree(this); + free(this); } } - xfree(clientTable[client->index].resources); + free(clientTable[client->index].resources); clientTable[client->index].resources = NULL; clientTable[client->index].buckets = 0; } diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index 708b67aa1..945dde7cf 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -682,7 +682,7 @@ CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w, { if (!MakeWindowOptional (pWin)) { - xfree (pWin); + free (pWin); *error = BadAlloc; return NullWindow; } @@ -864,7 +864,7 @@ CrushTree(WindowPtr pWin) (*UnrealizeWindow)(pChild); } FreeWindowResources(pChild); - xfree(pChild); + free(pChild); if ( (pChild = pSib) ) break; pChild = pParent; @@ -916,7 +916,7 @@ DeleteWindow(void * value, XID wid) if (pWin->prevSib) pWin->prevSib->nextSib = pWin->nextSib; } - xfree(pWin); + free(pWin); return Success; } #endif /* NXAGENT_SERVER */ @@ -3147,7 +3147,7 @@ HandleSaveSet(register ClientPtr client) MapWindow(pWin, client); } } - xfree(client->saveSet); + free(client->saveSet); client->numSaved = 0; client->saveSet = (SaveSetElt *)NULL; } @@ -3449,8 +3449,8 @@ TileScreenSaver(int i, int kind) mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); if (!srcbits || !mskbits) { - xfree(srcbits); - xfree(mskbits); + free(srcbits); + free(mskbits); cursor = 0; } else @@ -3471,8 +3471,8 @@ TileScreenSaver(int i, int kind) } else { - xfree (srcbits); - xfree (mskbits); + free (srcbits); + free (mskbits); } } @@ -3660,7 +3660,7 @@ DisposeWindowOptional (register WindowPtr pWin) } else pWin->cursorIsNone = TRUE; - xfree (pWin->optional); + free (pWin->optional); pWin->optional = NULL; } diff --git a/nx-X11/programs/Xserver/fb/fbcmap.c b/nx-X11/programs/Xserver/fb/fbcmap.c index a7c8ca638..9fdffdeff 100644 --- a/nx-X11/programs/Xserver/fb/fbcmap.c +++ b/nx-X11/programs/Xserver/fb/fbcmap.c @@ -491,8 +491,8 @@ fbInitVisuals (VisualPtr *visualp, visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec)); if (!depth || !visual) { - xfree (depth); - xfree (visual); + free (depth); + free (visual); return FALSE; } *depthp = depth; @@ -549,7 +549,7 @@ fbInitVisuals (VisualPtr *visualp, vid++; visual++; } - xfree (visuals); + free (visuals); } fbVisuals = NULL; visual = *visualp; diff --git a/nx-X11/programs/Xserver/fb/fbcopy.c b/nx-X11/programs/Xserver/fb/fbcopy.c index f68811ebb..d1fb63828 100644 --- a/nx-X11/programs/Xserver/fb/fbcopy.c +++ b/nx-X11/programs/Xserver/fb/fbcopy.c @@ -282,7 +282,7 @@ fbCopyNto1 (DrawablePtr pSrcDrawable, pPriv->and, pPriv->xor, pPriv->bgand, pPriv->bgxor); - xfree (tmp); + free (tmp); } pbox++; } diff --git a/nx-X11/programs/Xserver/fb/fbpixmap.c b/nx-X11/programs/Xserver/fb/fbpixmap.c index 99c03862b..c562da221 100644 --- a/nx-X11/programs/Xserver/fb/fbpixmap.c +++ b/nx-X11/programs/Xserver/fb/fbpixmap.c @@ -104,7 +104,7 @@ fbDestroyPixmap (PixmapPtr pPixmap) { if(--pPixmap->refcnt) return TRUE; - xfree(pPixmap); + free(pPixmap); return TRUE; } @@ -309,7 +309,7 @@ fbPixmapToRegion(PixmapPtr pPix) pReg->extents.y2 = RegionEnd(pReg)->y2; if (pReg->data->numRects == 1) { - xfree(pReg->data); + free(pReg->data); pReg->data = (RegDataPtr)NULL; } } diff --git a/nx-X11/programs/Xserver/fb/fbpseudocolor.c b/nx-X11/programs/Xserver/fb/fbpseudocolor.c index 51f21ed21..bc1c091ed 100644 --- a/nx-X11/programs/Xserver/fb/fbpseudocolor.c +++ b/nx-X11/programs/Xserver/fb/fbpseudocolor.c @@ -277,7 +277,7 @@ xxCreateScreenResources(ScreenPtr pScreen) pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); if (!pPixmap) { - xfree(pBits); + free(pBits); return FALSE; } if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width, @@ -285,7 +285,7 @@ xxCreateScreenResources(ScreenPtr pScreen) BitsPerPixel(depth), PixmapBytePad(pScreen->width, depth), pBits)) { - xfree(pBits); + free(pBits); return FALSE; } if (pScreen->rootDepth == pScrPriv->myDepth) { @@ -295,7 +295,7 @@ xxCreateScreenResources(ScreenPtr pScreen) PixmapBytePad(pScreen->width, pScrPriv->depth), 0)) { - xfree(pBits); + free(pBits); return FALSE; } } @@ -328,9 +328,9 @@ xxCloseScreen (int iScreen, ScreenPtr pScreen) unwrap (pScrPriv,pScreen, CloseScreen); ret = pScreen->CloseScreen(iScreen,pScreen); - xfree(pScrPriv->pBits); - xfree(pScrPriv->InstalledCmaps); - xfree(pScrPriv); + free(pScrPriv->pBits); + free(pScrPriv->InstalledCmaps); + free(pScrPriv); return TRUE; } @@ -456,8 +456,8 @@ xxDestroyColormap(ColormapPtr pmap) tmpCmapPriv = tmpCmapPriv->next; } - xfree(pCmapPriv->cmap); - xfree(pCmapPriv); + free(pCmapPriv->cmap); + free(pCmapPriv); } unwrap(pScrPriv,pmap->pScreen, DestroyColormap); diff --git a/nx-X11/programs/Xserver/fb/fbscreen.c b/nx-X11/programs/Xserver/fb/fbscreen.c index 342fd5784..0600cebfe 100644 --- a/nx-X11/programs/Xserver/fb/fbscreen.c +++ b/nx-X11/programs/Xserver/fb/fbscreen.c @@ -36,12 +36,12 @@ fbCloseScreen (int index, ScreenPtr pScreen) DepthPtr depths = pScreen->allowedDepths; for (d = 0; d < pScreen->numDepths; d++) - xfree (depths[d].vids); - xfree (depths); - xfree (pScreen->visuals); - xfree (pScreen->devPrivate); + free (depths[d].vids); + free (depths); + free (pScreen->visuals); + free (pScreen->devPrivate); #ifdef FB_SCREEN_PRIVATE - xfree (pScreen->devPrivates[fbScreenPrivateIndex].ptr); + free (pScreen->devPrivates[fbScreenPrivateIndex].ptr); #endif return TRUE; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 6e6d61772..4f0173db0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -355,7 +355,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (nxagentOptionFile != NULL) { - xfree(nxagentOptionFile); + free(nxagentOptionFile); nxagentOptionFile = NULL; } @@ -719,7 +719,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (nxagentKeyboard != NULL) { - xfree(nxagentKeyboard); + free(nxagentKeyboard); nxagentKeyboard = NULL; } @@ -1591,7 +1591,7 @@ nxagentProcessOptionsFileFree: if (data != NULL) { - Xfree(data); + free(data); } nxagentProcessOptionsFileClose: diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index a0dfbf602..5249d8550 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -745,7 +745,7 @@ void nxagentCollectPropertyEvent(int resource) if (pszReturnData != NULL) { - Xfree(pszReturnData); + free(pszReturnData); } return; @@ -787,7 +787,7 @@ void nxagentCollectPropertyEvent(int resource) if (pszReturnData != NULL) { - Xfree(pszReturnData); + free(pszReturnData); } return; @@ -1487,7 +1487,7 @@ int nxagentInitClipboard(WindowPtr pWin) if (lastSelectionOwner != NULL) { - xfree(lastSelectionOwner); + free(lastSelectionOwner); lastSelectionOwner = NULL; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c index fe3b6ce1d..18c4c67a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c @@ -112,7 +112,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) pCmap->red[i].co.local.green = colors[i].red; pCmap->red[i].co.local.blue = colors[i].red; } - xfree(colors); + free(colors); break; case StaticColor: /* read only */ @@ -125,7 +125,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) pCmap->red[i].co.local.green = colors[i].green; pCmap->red[i].co.local.blue = colors[i].blue; } - xfree(colors); + free(colors); break; case TrueColor: /* read only */ @@ -149,7 +149,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) pCmap->green[i].co.local.green = colors[i].green; pCmap->blue[i].co.local.blue = colors[i].blue; } - xfree(colors); + free(colors); break; case GrayScale: /* read and write */ @@ -168,7 +168,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) void nxagentDestroyColormap(ColormapPtr pCmap) { XFreeColormap(nxagentDisplay, nxagentColormap(pCmap)); - xfree(pCmap->devPriv); + free(pCmap->devPriv); } #define SEARCH_PREDICATE \ @@ -246,11 +246,11 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) numWindows = 0; } - xfree(icws.cmapIDs); + free(icws.cmapIDs); if (!nxagentSameInstalledColormapWindows(icws.windows, icws.numWindows)) { if (nxagentOldInstalledColormapWindows) - xfree(nxagentOldInstalledColormapWindows); + free(nxagentOldInstalledColormapWindows); #ifdef _XSERVER64 { @@ -261,7 +261,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) windows[i] = icws.windows[i]; XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], windows, numWindows); - xfree(windows); + free(windows); } #else XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], @@ -310,13 +310,13 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) #endif /* DUMB_WINDOW_MANAGERS */ } else - if (icws.windows) xfree(icws.windows); + if (icws.windows) free(icws.windows); } void nxagentSetScreenSaverColormapWindow(ScreenPtr pScreen) { if (nxagentOldInstalledColormapWindows) - xfree(nxagentOldInstalledColormapWindows); + free(nxagentOldInstalledColormapWindows); #ifdef _XSERVER64 { @@ -448,7 +448,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors) pColors64[i].flags = pColors[i].flags; } XStoreColors(nxagentDisplay, nxagentColormap(pCmap), pColors64, nColors); - xfree(pColors64); + free(pColors64); } #else XStoreColors(nxagentDisplay, nxagentColormap(pCmap), diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c index 62095d5b3..b1449bf13 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -267,7 +267,7 @@ Bool nxagentUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) nxagentCursor(pCursor, pScreen) = None; } - xfree(nxagentCursorPriv(pCursor, pScreen)); + free(nxagentCursorPriv(pCursor, pScreen)); return True; } @@ -366,7 +366,7 @@ void nxagentReconnectCursor(void * p0, XID x1, void * p2) } else { - xfree(nxagentCursorPriv(pCursor, nxagentDefaultScreen)); + free(nxagentCursorPriv(pCursor, nxagentDefaultScreen)); if (!nxagentRealizeCursor(nxagentDefaultScreen, pCursor)) { fprintf(stderr, "nxagentReconnectCursor: nxagentRealizeCursor failed\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 31ea7c2a0..27cd0859a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1814,13 +1814,13 @@ void nxagentCloseDisplay() * traffic */ - xfree(nxagentDefaultColormaps); + free(nxagentDefaultColormaps); nxagentDefaultColormaps = NULL; XFree(nxagentVisuals); nxagentVisuals = NULL; - xfree(nxagentDepths); + free(nxagentDepths); nxagentDepths = NULL; XFree(nxagentPixmapFormats); @@ -2060,7 +2060,7 @@ void nxagentBackupDisplayInfo(void) nxagentNumVisualsRecBackup = nxagentNumVisuals; if (nxagentVisualHasBeenIgnored) { - xfree(nxagentVisualHasBeenIgnored); + free(nxagentVisualHasBeenIgnored); nxagentVisualHasBeenIgnored = NULL; } nxagentVisualHasBeenIgnored = xalloc(nxagentNumVisuals * sizeof(Bool)); @@ -2074,17 +2074,17 @@ void nxagentBackupDisplayInfo(void) void nxagentCleanupBackupDisplayInfo(void) { - xfree(nxagentDepthsRecBackup); + free(nxagentDepthsRecBackup); nxagentNumDepthsRecBackup = 0; nxagentNumDefaultColormapsRecBackup = 0; - xfree(nxagentVisualsRecBackup); + free(nxagentVisualsRecBackup); nxagentNumVisualsRecBackup = 0; if (nxagentVisualHasBeenIgnored) { - xfree(nxagentVisualHasBeenIgnored); + free(nxagentVisualHasBeenIgnored); nxagentVisualHasBeenIgnored = NULL; } @@ -2107,7 +2107,7 @@ void nxagentCleanupBackupDisplayInfo(void) } else { - xfree(nxagentBitmapGCBackup); + free(nxagentBitmapGCBackup); } nxagentBitmapGCBackup = NULL; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 377e119ab..a73040eeb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -359,7 +359,7 @@ nxagentSynchronizeDrawableDataFree: if (data != NULL) { - xfree(data); + free(data); } nxagentSynchronizeDrawableDataEnd: @@ -860,7 +860,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (cmpData != NULL) { - xfree(cmpData); + free(cmpData); } } } @@ -1060,7 +1060,7 @@ nxagentSynchronizeRegionFree: if (data != NULL) { - xfree(data); + free(data); } RegionUninit(&exposeRegion); @@ -2161,7 +2161,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel) fprintf(stderr, "nxagentGetColor: WARNING! Failed to create the XImage.\n"); #endif - xfree(data); + free(data); return -1; } @@ -2387,7 +2387,7 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion) XFillRectangles(nxagentDisplay, nxagentDrawable(pDrawable), nxagentGC(pGC), pRects, nrects); - xfree(pRects); + free(pRects); } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 8f692eb85..22b3e6c88 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -196,11 +196,11 @@ void nxagentFreeFontCache(void) nxagentFreeFont(CACHE_FSTRUCT(i)); } - xfree(CACHE_NAME(i)); - xfree(CACHE_ENTRY(i)); + free(CACHE_NAME(i)); + free(CACHE_ENTRY(i)); } - xfree(CACHE_ENTRY_PTR); + free(CACHE_ENTRY_PTR); CACHE_ENTRY_PTR = NULL; CACHE_INDEX = 0; CACHE_SIZE = 0; @@ -364,10 +364,10 @@ static void nxagentFreeRemoteFontList(nxagentFontList *listRec) { if (listRec -> list[l]) { - xfree(listRec -> list[l] -> name); + free(listRec -> list[l] -> name); listRec -> list[l] -> name = NULL; - xfree(listRec -> list[l]); + free(listRec -> list[l]); listRec -> list[l] = NULL; } } @@ -686,7 +686,7 @@ Bool nxagentUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) if (nxagentFontPriv(pFont) -> mirrorID) FreeResource(nxagentFontPriv(pFont) -> mirrorID, RT_NONE); - xfree(nxagentFontPriv(pFont)); + free(nxagentFontPriv(pFont)); FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL); } @@ -1640,7 +1640,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name); #endif - Xfree(fs); + free(fs); return (XFontStruct *) NULL; } @@ -1674,7 +1674,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo fprintf(stderr, "nxagentLoadQueryFont: WARNING! Failed allocation of XFontProp."); #endif - Xfree((char *) fs); + free((char *) fs); return (XFontStruct *) NULL; } @@ -1714,13 +1714,13 @@ int nxagentFreeFont(XFontStruct *fs) #ifdef USE_XF86BIGFONT _XF86BigfontFreeFontMetrics(fs); #else - Xfree ((char *) fs->per_char); + free ((char *) fs->per_char); #endif } if (fs -> properties) { - Xfree (fs->properties); + free (fs->properties); } XFree(fs); diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 7450c1e6c..21e828769 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -686,7 +686,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y, pRects, nRects, Unsorted); - xfree((char *) pRects); + free((char *) pRects); } break; @@ -770,7 +770,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) pGC->clientClip = (void *) RegionFromRects(nRects, (xRectangle *)pValue, type); - xfree(pValue); + free(pValue); pValue = pGC->clientClip; @@ -904,7 +904,7 @@ static void nxagentFreeGCRec(struct nxagentGCRec *t) (void *) t, (void *) t -> gc); #endif - xfree(t -> gc); + free(t -> gc); free(t); } @@ -918,7 +918,7 @@ static void nxagentRestoreGCRec(struct nxagentGCRec *t) if (nxagentGC(t -> pGC)) { - xfree(nxagentGC(t -> pGC)); + free(nxagentGC(t -> pGC)); } nxagentGC(t -> pGC) = t -> gc; @@ -1298,7 +1298,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y, pRects, nRects, Unsorted); - xfree((char *) pRects); + free((char *) pRects); } else { @@ -1369,7 +1369,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) pGC->clientClip = (void *) RegionFromRects(nRects, (xRectangle *)pValue, type); - xfree(pValue); + free(pValue); pValue = pGC->clientClip; type = CT_REGION; diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 634bbf2ce..01a3f6a93 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -779,7 +779,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, srcx, srcy, width, height); #endif - xfree(data); + free(data); /* * If the source is a shared memory pixmap, the @@ -999,7 +999,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, srcx, srcy, width, height); #endif - xfree(data); + free(data); /* * If the source is a shared memory pixmap, the @@ -1539,7 +1539,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, if (newPoints != NULL) { - xfree(newPoints); + free(newPoints); } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index a158a11db..b7c3135d0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -447,7 +447,7 @@ FIXME: Here the split trap is always set and so the caching of if (nxagentUnpackAlpha[resource] != NULL) { - Xfree(nxagentUnpackAlpha[resource] -> data); + free(nxagentUnpackAlpha[resource] -> data); } else if ((nxagentUnpackAlpha[resource] = Xmalloc(sizeof(UnpackAlphaRec))) == NULL) { @@ -455,7 +455,7 @@ FIXME: Here the split trap is always set and so the caching of fprintf(stderr, "nxagentSetUnpackAlpha: PANIC! Can't allocate data for the alpha structure.\n"); #endif - Xfree(data); + free(data); return; } @@ -475,7 +475,7 @@ FIXME: Here the split trap is always set and so the caching of resource, size); #endif - Xfree(data); + free(data); } } @@ -1561,7 +1561,7 @@ nxagentPutSubImageEnd: if (packedChecksum != NULL) { - Xfree(packedChecksum); + free(packedChecksum); } if (packedImage != NULL) @@ -1569,13 +1569,13 @@ nxagentPutSubImageEnd: if (packedImage -> data != NULL && packedImage -> data != plainImage -> data) { - Xfree(packedImage -> data); + free(packedImage -> data); } - Xfree(packedImage); + free(packedImage); } - Xfree(plainImage); + free(plainImage); } void nxagentGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, @@ -1629,9 +1629,9 @@ void nxagentResetAlphaCache() { if (nxagentUnpackAlpha[i]) { - Xfree(nxagentUnpackAlpha[i] -> data); + free(nxagentUnpackAlpha[i] -> data); - Xfree(nxagentUnpackAlpha[i]); + free(nxagentUnpackAlpha[i]); nxagentUnpackAlpha[i] = NULL; } @@ -1711,7 +1711,7 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio, if (newImage -> data == NULL) { - Xfree(newImage); + free(newImage); #ifdef PANIC fprintf(stderr, "nxagentScaleImage: PANIC! Failed to create the target image data.\n"); @@ -1781,10 +1781,10 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio, if (image -> obdata != NULL) { - Xfree((char *) image -> obdata); + free((char *) image -> obdata); } - Xfree((char *) image); + free((char *) image); *pImage = newImage; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 852771492..6bd201d70 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -1138,7 +1138,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio #endif #ifdef _XSERVER64 - xfree(keymap); + free(keymap); #else XFree(keymap); #endif @@ -1473,17 +1473,17 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev) } #endif - xfree(dev->key->curKeySyms.map); - xfree(dev->key->modifierKeyMap); - xfree(dev->key); + free(dev->key->curKeySyms.map); + free(dev->key->modifierKeyMap); + free(dev->key); dev->key=NULL; } if (dev->focus) { - xfree(dev->focus->trace); - xfree(dev->focus); + free(dev->focus->trace); + free(dev->focus); dev->focus=NULL; } @@ -1494,7 +1494,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev) if (k->xkb_sli) XkbFreeSrvLedInfo(k->xkb_sli); #endif - xfree(k); + free(k); } #ifdef DEBUG diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index b68f01b8d..d1923106d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -197,7 +197,7 @@ void InitSelections() { if (CurrentSelections) - xfree(CurrentSelections); + free(CurrentSelections); CurrentSelections = (Selection *)NULL; NumCurrentSelections = 0; @@ -1316,7 +1316,7 @@ CloseDownClient(register ClientPtr client) #ifdef SMART_SCHEDULE SmartLastClient = NullClient; #endif - xfree(client); + free(client); while (!clients[currentMaxClients-1]) currentMaxClients--; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 77f21e495..d15df9513 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -326,9 +326,9 @@ bail: for (i = 0; i < c->num_fpes; i++) { FreeFPE(c->fpe_list[i]); } - xfree(c->fpe_list); - xfree(c->fontname); - xfree(c); + free(c->fpe_list); + free(c->fontname); + free(c); return TRUE; } @@ -441,7 +441,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) return TRUE; } if (err == FontNameAlias) { - if (resolved) xfree(resolved); + if (resolved) free(resolved); resolved = (char *) xalloc(resolvedlen + 1); if (resolved) memmove(resolved, tmpname, resolvedlen + 1); @@ -496,7 +496,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) c->saved = c->current; c->haveSaved = TRUE; if (c->savedName) - xfree(c->savedName); + free(c->savedName); c->savedName = (char *)xalloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); @@ -614,11 +614,11 @@ bail: } for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); + free(c->fpe_list); + if (c->savedName) free(c->savedName); FreeFontNames(names); - xfree(c); - if (resolved) xfree(resolved); + free(c); + if (resolved) free(resolved); return TRUE; } @@ -643,14 +643,14 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, c->fpe_list = (FontPathElementPtr *) xalloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { - xfree(c); + free(c); return BadAlloc; } c->names = MakeFontNamesRecord(max_names < nxagentMaxFontNames ? max_names : nxagentMaxFontNames); if (!c->names) { - xfree(c->fpe_list); - xfree(c); + free(c->fpe_list); + free(c); return BadAlloc; } memmove( c->current.pattern, pattern, length); @@ -785,7 +785,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) c->haveSaved = TRUE; c->savedNumFonts = numFonts; if (c->savedName) - xfree(c->savedName); + free(c->savedName); c->savedName = (char *)xalloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); @@ -886,8 +886,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) (void) WriteToClient(client, namelen, name); if (pFontInfo == &fontInfo) { - xfree(fontInfo.props); - xfree(fontInfo.isStringProp); + free(fontInfo.props); + free(fontInfo.isStringProp); } --c->current.max_names; } @@ -910,10 +910,10 @@ bail: } for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->reply); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - xfree(c); + free(c->reply); + free(c->fpe_list); + if (c->savedName) free(c->savedName); + free(c); return TRUE; } @@ -1085,7 +1085,7 @@ nxdoListFontsAndAliases(client, fss) return TRUE; } if (err == FontNameAlias) { - if (resolved) xfree(resolved); + if (resolved) free(resolved); resolved = (char *) xalloc(resolvedlen + 1); if (resolved) { @@ -1154,7 +1154,7 @@ nxdoListFontsAndAliases(client, fss) c->saved = c->current; c->haveSaved = TRUE; if (c->savedName) - xfree(c->savedName); + free(c->savedName); c->savedName = (char *)xalloc(namelen + 1); if (c->savedName) { @@ -1249,12 +1249,12 @@ finish: } for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); + free(c->fpe_list); + if (c->savedName) free(c->savedName); FreeFontNames(c->names); - xfree(c); - xfree(fss); - if (resolved) xfree(resolved); + free(c); + free(fss); + if (resolved) free(resolved); return doOpenFont(client, oc); } @@ -1279,7 +1279,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) memmove(f, pfontname, lenfname); f[lenfname] = '\0'; ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); + free(f); #endif if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) return BadName; @@ -1317,22 +1317,22 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) if (!(c = (LFclosurePtr) xalloc(sizeof *c))) { - xfree(fss); + free(fss); return BadAlloc; } c->fpe_list = (FontPathElementPtr *) xalloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { - xfree(c); - xfree(fss); + free(c); + free(fss); return BadAlloc; } c->names = MakeFontNamesRecord(100); if (!c->names) { - xfree(c->fpe_list); - xfree(c); - xfree(fss); + free(c->fpe_list); + free(c); + free(fss); return BadAlloc; } memmove( c->current.pattern, pfontname, lenfname); @@ -1356,9 +1356,9 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) { for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(fss); + free(c->fpe_list); + free(c); + free(fss); return BadAlloc; } oc->fontname = (char *) xalloc(256);/* I don't want to deal with future reallocs errors */ @@ -1367,10 +1367,10 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) if (!oc->fontname) { for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(oc); - xfree(fss); + free(c->fpe_list); + free(c); + free(oc); + free(fss); return BadAlloc; } /* @@ -1380,13 +1380,13 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) oc->fpe_list = (FontPathElementPtr *) xalloc(sizeof(FontPathElementPtr) * num_fpes); if (!oc->fpe_list) { - xfree(oc->fontname); - xfree(oc); + free(oc->fontname); + free(oc); for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(fss); + free(c->fpe_list); + free(c); + free(fss); return BadAlloc; } memmove(oc->fontname, pfontname, lenfname); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c index 4359a552b..f2885d39c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c @@ -65,7 +65,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph); if (gr->glyph && gr->glyph != DeletedGlyph) { - xfree (glyph); + free (glyph); glyph = gr->glyph; } else @@ -175,7 +175,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) ++newHash.tableEntries; } } - xfree (hash->table); + free (hash->table); } *hash = newHash; if (global) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c index 33492a6d6..53a5a8d68 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c @@ -115,7 +115,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns fbDestroyPixmap(ppix); if (pGC) FreeScratchGC(pGC); - xfree(pbits); + free(pbits); return BadAlloc; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index a47e158df..44248bc1b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -284,7 +284,7 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill)); if (!pPicture->pSourcePict) { *error = BadAlloc; - xfree(pPicture); + free(pPicture); return 0; } pPicture->pSourcePict->type = SourcePictTypeSolidFill; @@ -361,12 +361,12 @@ FreePicture (void * value, nxagentDestroyPicture(pPicture); if (pPicture->transform) - xfree (pPicture->transform); + free (pPicture->transform); if (!pPicture->pDrawable) { if (pPicture->pSourcePict) { if (pPicture->pSourcePict->type != SourcePictTypeSolidFill) - xfree(pPicture->pSourcePict->linear.stops); - xfree(pPicture->pSourcePict); + free(pPicture->pSourcePict->linear.stops); + free(pPicture->pSourcePict); } } else { ScreenPtr pScreen = pPicture->pDrawable->pScreen; @@ -397,7 +397,7 @@ FreePicture (void * value, (*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable); } } - xfree (pPicture); + free (pPicture); } return Success; } @@ -502,7 +502,7 @@ Bool nxagentReconnectAllPictFormat(void *p) } } - xfree(formats); + free(formats); /* TODO: Perhaps do i have to do PictureFinishInit ?. */ /* TODO: We have to check for new Render protocol version. */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 2458c12d0..0ace2fbd2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -233,7 +233,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, data = (void *)xalloc(totalSize); if (!data && len) { - xfree(pProp); + free(pProp); return(BadAlloc); } pProp->propertyName = property; @@ -296,7 +296,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, memmove(&((char *)data)[totalSize], (char *)pProp->data, (int)(pProp->size * sizeInBytes)); memmove((char *)data, (char *)value, totalSize); - xfree(pProp->data); + free(pProp->data); pProp->data = data; pProp->size += len; } @@ -521,8 +521,8 @@ ProcGetProperty(ClientPtr client) } else prevProp->next = pProp->next; - xfree(pProp->data); - xfree(pProp); + free(pProp->data); + free(pProp); } return(client->noClientException); } @@ -636,8 +636,8 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, } else prevProp->next = pProp->next; - xfree(pProp->data); - xfree(pProp); + free(pProp->data); + free(pProp); } return(Success); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index 93760f482..b89b835db 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -362,7 +362,7 @@ ProcRenderQueryPictFormats (ClientPtr client) swapl (&reply->numSubpixel, n); } WriteToClient(client, rlength, (char *) reply); - xfree (reply); + free (reply); return client->noClientException; } @@ -730,7 +730,7 @@ ProcRenderTrapezoids (ClientPtr client) if (nxagentTrapezoidExtents != NullBox) { - xfree(nxagentTrapezoidExtents); + free(nxagentTrapezoidExtents); nxagentTrapezoidExtents = NullBox; } @@ -1132,7 +1132,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphsBase); } - xfree(nxagentGlyphsExtents); + free(nxagentGlyphsExtents); nxagentGlyphsExtents = NullBox; if (glyphsBase != glyphsLocal) @@ -1140,7 +1140,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) if (listsBase != listsLocal) DEALLOCATE_LOCAL (listsBase); - xfree(elementsBase); + free(elementsBase); return client->noClientException; } @@ -1228,14 +1228,14 @@ ProcRenderCreateCursor (ClientPtr client) srcbits = (unsigned char *)xalloc(nbytes_mono); if (!srcbits) { - xfree (argbbits); + free (argbbits); return (BadAlloc); } mskbits = (unsigned char *)xalloc(nbytes_mono); if (!mskbits) { - xfree(argbbits); - xfree(srcbits); + free(argbbits); + free(srcbits); return (BadAlloc); } bzero ((char *) mskbits, nbytes_mono); @@ -1257,26 +1257,26 @@ ProcRenderCreateCursor (ClientPtr client) pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); if (!pFormat) { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); + free (argbbits); + free (srcbits); + free (mskbits); return (BadImplementation); } pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); if (!pPixmap) { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); + free (argbbits); + free (srcbits); + free (mskbits); return (BadAlloc); } pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0, client, &error); if (!pPicture) { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); + free (argbbits); + free (srcbits); + free (mskbits); return error; } (*pScreen->DestroyPixmap) (pPixmap); @@ -1360,7 +1360,7 @@ ProcRenderCreateCursor (ClientPtr client) } else { - xfree (argbbits); + free (argbbits); argbbits = 0; } @@ -1488,7 +1488,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) RT_CURSOR, SecurityReadAccess); if (!cursors[i]) { - xfree (cursors); + free (cursors); client->errorValue = elt->cursor; return BadCursor; } @@ -1496,7 +1496,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) elt++; } ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor); - xfree (cursors); + free (cursors); if (ret != Success) return ret; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c index 38bc05e51..4226a4435 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c @@ -313,7 +313,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) #endif if (rtype != skipDeleteFuncType) (*DeleteFuncs[rtype & TypeMask])(res->value, res->id); - xfree(res); + free(res); if (*eltptr != elements) prev = head; /* prev may no longer be valid */ gotOne = TRUE; @@ -349,7 +349,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) #endif if (!skipFree) (*DeleteFuncs[type & TypeMask])(res->value, res->id); - xfree(res); + free(res); break; } else diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index 1ce72cbbe..08237440f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -239,7 +239,7 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) fbGetImage((DrawablePtr) pPixmap, sx, sy, sw, sh, format, AllPlanes, newdata); (*pGC->ops->PutImage)(dst, pGC, depth, dx, dy, sw, sh, 0, format, newdata); - xfree(newdata); + free(newdata); } else { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 28aafd644..0071a15d0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -336,7 +336,7 @@ DeleteWindow(void * value, XID wid) nxagentSetInstalledColormapWindows(pWin -> drawable.pScreen); } - xfree(pWin); + free(pWin); return Success; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index f429f1499..0eabf1262 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -487,7 +487,7 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap) FreeResource(pPixmapPriv -> mid, RT_NONE); } - xfree(pPixmap); + free(pPixmap); return True; } @@ -1259,7 +1259,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, nxagentPutImage(pDrawable, pGC, depth, xPict, yPict, width, height, 0, format, data); - xfree(data); + free(data); } #ifdef WARNING else @@ -1409,7 +1409,7 @@ FIXME: If the pixmap has a different depth from the window, the if (data != NULL) { - xfree(data); + free(data); } return False; @@ -1571,7 +1571,7 @@ Bool nxagentFbOnShadowDisplay() if (data) { - xfree(data); + free(data); } return False; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 00d434bf4..587e9a564 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -444,7 +444,7 @@ Bool nxagentReconnectSession(void) if (nxagentKeyboard) { - xfree(nxagentKeyboard); + free(nxagentKeyboard); nxagentKeyboard = NULL; } @@ -609,7 +609,7 @@ Bool nxagentReconnectSession(void) if (nxagentOldKeyboard != NULL) { - xfree(nxagentOldKeyboard); + free(nxagentOldKeyboard); nxagentOldKeyboard = NULL; } @@ -734,7 +734,7 @@ nxagentReconnectError: if (nxagentOldKeyboard != NULL) { - xfree(nxagentOldKeyboard); + free(nxagentOldKeyboard); nxagentOldKeyboard = NULL; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 8c822319d..36ce6a74f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -2284,7 +2284,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, if (normalizedImages != images) { - xfree(normalizedImages); + free(normalizedImages); } #ifdef DEBUG @@ -2392,7 +2392,7 @@ FIXME: Is this useful or just a waste of bandwidth? nparams); #endif - Xfree(szFilter); + free(szFilter); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 49877f9d7..6947371ff 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -389,7 +389,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) #endif - xfree(toplevel); + free(toplevel); return; } @@ -797,7 +797,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if (freeMem) { - xfree(output); + free(output); } return export; @@ -1104,7 +1104,7 @@ void nxagentImportProperty(Window window, if (freeMem) { - xfree(output); + free(output); } return; @@ -1156,7 +1156,7 @@ void nxagentRemovePropertyFromList() nxagentPropertyList.last = NULL; } - xfree(tmp); + free(tmp); } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index de8c97532..a4c6fc2db 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1358,8 +1358,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, * by fbScreenInit with our own. */ - xfree(pScreen -> visuals); - xfree(pScreen -> allowedDepths); + free(pScreen -> visuals); + free(pScreen -> allowedDepths); pScreen -> visuals = visuals; pScreen -> allowedDepths = depths; @@ -2079,18 +2079,18 @@ Bool nxagentCloseScreen(int index, ScreenPtr pScreen) for (i = 0; i < pScreen->numDepths; i++) { - xfree(pScreen->allowedDepths[i].vids); + free(pScreen->allowedDepths[i].vids); } /* * Free the frame buffer. */ - xfree(((PixmapPtr)pScreen -> devPrivate) -> devPrivate.ptr); + free(((PixmapPtr)pScreen -> devPrivate) -> devPrivate.ptr); - xfree(pScreen->allowedDepths); - xfree(pScreen->visuals); - xfree(pScreen->devPrivate); + free(pScreen->allowedDepths); + free(pScreen->visuals); + free(pScreen->devPrivate); /* * Reset the geometry and alpha information @@ -3065,7 +3065,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr if (tBuffer) { - xfree(tBuffer); + free(tBuffer); } tBuffer = xalloc(length); @@ -3125,7 +3125,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr if (tBuffer) { - xfree(tBuffer); + free(tBuffer); } RegionUninit(&updateRegion); @@ -3346,7 +3346,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height, if (cBuffer != NULL) { - xfree(cBuffer); + free(cBuffer); } } @@ -3529,7 +3529,7 @@ FIXME: The port information is not used at the moment and produces a strlen(local_buf), local_buf, 1); } - xfree(local_buf); + free(local_buf); } } } @@ -3769,7 +3769,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) number = 1; if (screeninfo) { - xfree(screeninfo); + free(screeninfo); } if (!(screeninfo = xalloc(sizeof(XineramaScreenInfo)))) { return FALSE; @@ -4061,7 +4061,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) /* release allocated memory */ if (screeninfo) { - xfree(screeninfo); + free(screeninfo); screeninfo = NULL; } @@ -4170,7 +4170,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, XSetClipRectangles(nxagentDisplay, gc, 0, 0, pRects, nRects, Unsorted); - xfree((char *) pRects); + free((char *) pRects); extents = *RegionExtents(&cleanRegion); @@ -4316,7 +4316,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, XSetClipRectangles(nxagentDisplay, gc, 0, 0, pRects, nRects, Unsorted); - xfree(pRects); + free(pRects); extents = *RegionExtents(clipRegion); @@ -4537,7 +4537,7 @@ FIXME if (data) { - xfree(data); + free(data); } return; @@ -4573,7 +4573,7 @@ FIXME if (data != NULL) { - xfree(data); + free(data); } /* @@ -4628,7 +4628,7 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc, if (data) { - xfree(data); + free(data); } return; @@ -4691,7 +4691,7 @@ FIXME FIXME if (data) { - xfree(data); + free(data); } */ } diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index aff2952fa..3b6a40b46 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -53,7 +53,7 @@ SOFTWARE. #include "misc.h" #define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size)) -#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((void *)(_ptr)) +#define DEALLOCATE_LOCAL_FALLBACK(_ptr) free((void *)(_ptr)) #include #ifndef IN_MODULE #include diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c index 8db188a6e..b268c1140 100644 --- a/nx-X11/programs/Xserver/mi/miarc.c +++ b/nx-X11/programs/Xserver/mi/miarc.c @@ -450,7 +450,7 @@ miFreeArcCache (data, id) { cent->lrustamp = 0; cent->lw = 0; - xfree(cent->spdata); + free(cent->spdata); cent->spdata = NULL; } } @@ -911,7 +911,7 @@ miComputeWideEllipse( if (!spdata || spdata->k != k) { if (spdata) - xfree(spdata); + free(spdata); spdata = (miArcSpanData *)xalloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2)); lruent->spdata = spdata; @@ -1054,7 +1054,7 @@ miFillWideEllipse( } } if (mustFree) - xfree(spdata); + free(spdata); (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); DEALLOCATE_LOCAL(widths); @@ -1412,7 +1412,7 @@ miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft, * rest of the line */ miFillSppPoly(pDraw, pGC, cpt, pArcPts, xOrg, yOrg, xFtrans, yFtrans); } - xfree(pArcPts); + free(pArcPts); return; case JoinMiter: /* @@ -1543,7 +1543,7 @@ miRoundCap( * rest of the line */ miFillSppPoly(pDraw, pGC, cpt, pArcPts, -xOrg, -yOrg, xFtrans, yFtrans); } - xfree(pArcPts); + free(pArcPts); } /* @@ -1840,13 +1840,13 @@ miFreeArcs( iphase--) { if (arcs[iphase].narcs > 0) - xfree(arcs[iphase].arcs); + free(arcs[iphase].arcs); if (arcs[iphase].njoins > 0) - xfree(arcs[iphase].joins); + free(arcs[iphase].joins); if (arcs[iphase].ncaps > 0) - xfree(arcs[iphase].caps); + free(arcs[iphase].caps); } - xfree(arcs); + free(arcs); } /* @@ -3169,11 +3169,11 @@ disposeFinalSpans (void) for (chunk = chunks; chunk; chunk = next) { next = chunk->next; - xfree (chunk); + free (chunk); } chunks = 0; freeFinalSpans = 0; - xfree(finalSpans); + free(finalSpans); finalSpans = 0; } @@ -3265,7 +3265,7 @@ realFindSpan (int y) memmove(((char *) newSpans) + (finalMiny-newMiny) * sizeof (struct finalSpan *), (char *) finalSpans, finalSize * sizeof (struct finalSpan *)); - xfree (finalSpans); + free (finalSpans); } if ((i = finalMiny - newMiny) > 0) bzero ((char *)newSpans, i * sizeof (struct finalSpan *)); @@ -3610,7 +3610,7 @@ drawArc ( } } if (mustFree) - xfree(spdata); + free(spdata); } static void diff --git a/nx-X11/programs/Xserver/mi/mibank.c b/nx-X11/programs/Xserver/mi/mibank.c index b607af1c1..754b0916f 100644 --- a/nx-X11/programs/Xserver/mi/mibank.c +++ b/nx-X11/programs/Xserver/mi/mibank.c @@ -1709,7 +1709,7 @@ miBankCloseScreen( if (pScreenPriv->pBanks[i]) RegionDestroy(pScreenPriv->pBanks[i]); - Xfree(pScreenPriv->pBanks); + free(pScreenPriv->pBanks); SCREEN_UNWRAP(CreateScreenResources); SCREEN_UNWRAP(ModifyPixmapHeader); @@ -1722,7 +1722,7 @@ miBankCloseScreen( SCREEN_UNWRAP(CopyWindow); SCREEN_UNWRAP(BackingStoreFuncs); - Xfree(pScreenPriv); + free(pScreenPriv); return (*pScreen->CloseScreen)(nIndex, pScreen); } @@ -2249,7 +2249,7 @@ miInitializeBanking( if (!(pScreenPriv->pBanks = /* Allocate and clear */ (RegionPtr *)Xcalloc(nBanks * sizeof(RegionPtr)))) { - Xfree(pScreenPriv); + free(pScreenPriv); return FALSE; } @@ -2360,8 +2360,8 @@ miInitializeBanking( if (pScreenPriv->pBanks[i]) RegionDestroy(pScreenPriv->pBanks[i]); - Xfree(pScreenPriv->pBanks); - Xfree(pScreenPriv); + free(pScreenPriv->pBanks); + free(pScreenPriv); return FALSE; } diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c index b19a15900..ae30d5238 100644 --- a/nx-X11/programs/Xserver/mi/mibitblt.c +++ b/nx-X11/programs/Xserver/mi/mibitblt.c @@ -258,7 +258,7 @@ miCopyArea(pSrcDrawable, pDstDrawable, (*pGC->ops->SetSpans)(pDstDrawable, pGC, (char *)pbits, pptFirst, (int *)pwidthFirst, height, TRUE); - xfree(pbits); + free(pbits); } } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, @@ -622,7 +622,7 @@ miCopyPlane(pSrcDrawable, pDstDrawable, miOpqStipDrawable(pDstDrawable, pGC, prgnSrc, ptile, 0, box.x2 - box.x1, box.y2 - box.y1, dstx + box.x1 - srcx, dsty + box.y1 - srcy); - xfree(ptile); + free(ptile); } } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index a24e2cbcd..d3dc11603 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -433,7 +433,7 @@ miBSCloseScreen (i, pScreen) pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes; pScreen->CreateGC = pScreenPriv->CreateGC; - xfree ((void *) pScreenPriv); + free ((void *) pScreenPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -931,7 +931,7 @@ miBSDestroyGCPrivate (GCPtr pGC) pGC->ops = pPriv->wrapOps; if (pPriv->pBackingGC) FreeGC (pPriv->pBackingGC, (GContext) 0); - xfree ((void *) pPriv); + free ((void *) pPriv); } } @@ -2685,7 +2685,7 @@ miBSFree(pWin) RegionUninit(&pBackingStore->SavedRegion); - xfree(pBackingStore); + free(pBackingStore); pWin->backStorage = NULL; } } @@ -3615,7 +3615,7 @@ miBSDestroyGC (pGC) FUNC_EPILOGUE (pGC, pPriv); - xfree(pPriv); + free(pPriv); } static void diff --git a/nx-X11/programs/Xserver/mi/micmap.c b/nx-X11/programs/Xserver/mi/micmap.c index 15d3f7f46..607ecec3b 100644 --- a/nx-X11/programs/Xserver/mi/micmap.c +++ b/nx-X11/programs/Xserver/mi/micmap.c @@ -393,7 +393,7 @@ miClearVisualTypes() while ((v = miVisuals)) { miVisuals = v->next; - xfree(v); + free(v); } } @@ -565,9 +565,9 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, preferredCVCs = (int *)xalloc(ndepth * sizeof(int)); if (!depth || !visual || !preferredCVCs) { - xfree (depth); - xfree (visual); - xfree (preferredCVCs); + free (depth); + free (visual); + free (preferredCVCs); return FALSE; } *depthp = depth; @@ -628,7 +628,7 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, vid++; visual++; } - xfree (visuals); + free (visuals); } miVisuals = NULL; visual = *visualp; @@ -684,7 +684,7 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, } *rootDepthp = depth[i].depth; *defaultVisp = depth[i].vids[j]; - xfree(preferredCVCs); + free(preferredCVCs); return TRUE; } diff --git a/nx-X11/programs/Xserver/mi/midash.c b/nx-X11/programs/Xserver/mi/midash.c index 5def4d9c8..2cf2704ea 100644 --- a/nx-X11/programs/Xserver/mi/midash.c +++ b/nx-X11/programs/Xserver/mi/midash.c @@ -269,7 +269,7 @@ CheckDashStorage( (*pnsegMax)*sizeof(miDashRec)); if (!newppseg) { - xfree(*ppseg); + free(*ppseg); return (miDashPtr)NULL; } *ppseg = newppseg; diff --git a/nx-X11/programs/Xserver/mi/midispcur.c b/nx-X11/programs/Xserver/mi/midispcur.c index 6ffb9efea..5d4b3023a 100644 --- a/nx-X11/programs/Xserver/mi/midispcur.c +++ b/nx-X11/programs/Xserver/mi/midispcur.c @@ -155,7 +155,7 @@ miDCInitialize (pScreen, screenFuncs) if (!miSpriteInitialize (pScreen, &miDCFuncs, screenFuncs)) { - xfree ((void *) pScreenPriv); + free ((void *) pScreenPriv); return FALSE; } return TRUE; @@ -187,7 +187,7 @@ miDCCloseScreen (index, pScreen) tossPict (pScreenPriv->pRootPicture); tossPict (pScreenPriv->pTempPicture); #endif - xfree ((void *) pScreenPriv); + free ((void *) pScreenPriv); return (*pScreen->CloseScreen) (index, pScreen); } @@ -263,7 +263,7 @@ miDCRealize ( pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); if (!pFormat) { - xfree ((void *) pPriv); + free ((void *) pPriv); return (miDCCursorPtr)NULL; } @@ -273,14 +273,14 @@ miDCRealize ( pCursor->bits->height, 32); if (!pPixmap) { - xfree ((void *) pPriv); + free ((void *) pPriv); return (miDCCursorPtr)NULL; } pGC = GetScratchGC (32, pScreen); if (!pGC) { (*pScreen->DestroyPixmap) (pPixmap); - xfree ((void *) pPriv); + free ((void *) pPriv); return (miDCCursorPtr)NULL; } ValidateGC (&pPixmap->drawable, pGC); @@ -294,7 +294,7 @@ miDCRealize ( (*pScreen->DestroyPixmap) (pPixmap); if (!pPriv->pPicture) { - xfree ((void *) pPriv); + free ((void *) pPriv); return (miDCCursorPtr)NULL; } pCursor->bits->devPriv[pScreen->myNum] = (void *) pPriv; @@ -305,14 +305,14 @@ miDCRealize ( pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1); if (!pPriv->sourceBits) { - xfree ((void *) pPriv); + free ((void *) pPriv); return (miDCCursorPtr)NULL; } pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1); if (!pPriv->maskBits) { (*pScreen->DestroyPixmap) (pPriv->sourceBits); - xfree ((void *) pPriv); + free ((void *) pPriv); return (miDCCursorPtr)NULL; } pCursor->bits->devPriv[pScreen->myNum] = (void *) pPriv; @@ -372,7 +372,7 @@ miDCUnrealizeCursor (pScreen, pCursor) if (pPriv->pPicture) FreePicture (pPriv->pPicture, 0); #endif - xfree ((void *) pPriv); + free ((void *) pPriv); pCursor->bits->devPriv[pScreen->myNum] = (void *)NULL; } return TRUE; diff --git a/nx-X11/programs/Xserver/mi/migc.c b/nx-X11/programs/Xserver/mi/migc.c index 167163686..0ca7872a3 100644 --- a/nx-X11/programs/Xserver/mi/migc.c +++ b/nx-X11/programs/Xserver/mi/migc.c @@ -85,7 +85,7 @@ miDestroyGCOps(ops) GCOpsPtr ops; { if (ops->devPrivate.val) - xfree(ops); + free(ops); } @@ -136,7 +136,7 @@ miChangeClip(pGC, type, pvalue, nrects) pGC->clientClip = (void *) RegionFromRects(nrects, (xRectangle *) pvalue, type); - xfree(pvalue); + free(pvalue); } pGC->clientClipType = (type != CT_NONE && pGC->clientClip) ? CT_REGION : CT_NONE; pGC->stateChanges |= GCClipMask; diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c index e89ce8fa0..1c0402892 100644 --- a/nx-X11/programs/Xserver/mi/mioverlay.c +++ b/nx-X11/programs/Xserver/mi/mioverlay.c @@ -178,7 +178,7 @@ miOverlayCloseScreen(int i, ScreenPtr pScreen) pScreen->UnrealizeWindow = pScreenPriv->UnrealizeWindow; pScreen->RealizeWindow = pScreenPriv->RealizeWindow; - xfree(pScreenPriv); + free(pScreenPriv); return (*pScreen->CloseScreen)(i, pScreen); } @@ -224,7 +224,7 @@ miOverlayCreateWindow(WindowPtr pWin) RegionInit(&(pTree->borderClip), &fullBox, 1); RegionInit(&(pTree->clipList), &fullBox, 1); } - } else xfree(pTree); + } else free(pTree); } return TRUE; @@ -252,7 +252,7 @@ miOverlayDestroyWindow(WindowPtr pWin) RegionUninit(&(pTree->borderClip)); RegionUninit(&(pTree->clipList)); - xfree(pTree); + free(pTree); } if(pScreenPriv->DestroyWindow) { @@ -874,7 +874,7 @@ miOverlayHandleExposures(WindowPtr pWin) (*WindowExposures)(pTree->pWin,&mival->exposed,NullRegion); RegionUninit(&mival->exposed); } - xfree(mival); + free(mival); pTree->valdata = NULL; if (pTree->firstChild) { pTree = pTree->firstChild; @@ -912,7 +912,7 @@ miOverlayHandleExposures(WindowPtr pWin) } RegionUninit(&val->after.borderExposed); RegionUninit(&val->after.exposed); - xfree(val); + free(val); pChild->valdata = (ValidatePtr)NULL; if (pChild->firstChild) { diff --git a/nx-X11/programs/Xserver/mi/mipointer.c b/nx-X11/programs/Xserver/mi/mipointer.c index 0320a5930..48da4b6c3 100644 --- a/nx-X11/programs/Xserver/mi/mipointer.c +++ b/nx-X11/programs/Xserver/mi/mipointer.c @@ -146,7 +146,7 @@ miPointerCloseScreen (index, pScreen) if (pScreen == miPointer.pSpriteScreen) miPointer.pSpriteScreen = 0; pScreen->CloseScreen = pScreenPriv->CloseScreen; - xfree ((void *) pScreenPriv); + free ((void *) pScreenPriv); return (*pScreen->CloseScreen) (index, pScreen); } diff --git a/nx-X11/programs/Xserver/mi/mipolyutil.c b/nx-X11/programs/Xserver/mi/mipolyutil.c index be62250ee..7a9794fe3 100644 --- a/nx-X11/programs/Xserver/mi/mipolyutil.c +++ b/nx-X11/programs/Xserver/mi/mipolyutil.c @@ -395,7 +395,7 @@ miFreeStorage(pSLLBlock) while (pSLLBlock) { tmpSLLBlock = pSLLBlock->next; - xfree(pSLLBlock); + free(pSLLBlock); pSLLBlock = tmpSLLBlock; } } diff --git a/nx-X11/programs/Xserver/mi/mipushpxl.c b/nx-X11/programs/Xserver/mi/mipushpxl.c index 44834db50..83821b266 100644 --- a/nx-X11/programs/Xserver/mi/mipushpxl.c +++ b/nx-X11/programs/Xserver/mi/mipushpxl.c @@ -252,7 +252,7 @@ miPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) } } } - xfree(pwLineStart); + free(pwLineStart); /* Flush any remaining spans */ if (ipt) { diff --git a/nx-X11/programs/Xserver/mi/miscrinit.c b/nx-X11/programs/Xserver/mi/miscrinit.c index da80932ad..c0df4a072 100644 --- a/nx-X11/programs/Xserver/mi/miscrinit.c +++ b/nx-X11/programs/Xserver/mi/miscrinit.c @@ -180,7 +180,7 @@ miCreateScreenResources(pScreen) { value = pScrInitParms->pbits; } - xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */ + free(pScreen->devPrivate); /* freeing miScreenInitParmsRec */ pScreen->devPrivate = value; /* pPixmap or pbits */ return TRUE; } diff --git a/nx-X11/programs/Xserver/mi/mispans.c b/nx-X11/programs/Xserver/mi/mispans.c index 48252f323..107476df3 100644 --- a/nx-X11/programs/Xserver/mi/mispans.c +++ b/nx-X11/programs/Xserver/mi/mispans.c @@ -216,15 +216,15 @@ void miAppendSpans(spanGroup, otherGroup, spans) } else { - xfree (spans->points); - xfree (spans->widths); + free (spans->points); + free (spans->widths); } } /* AppendSpans */ void miFreeSpanGroup(spanGroup) SpanGroup *spanGroup; { - if (spanGroup->group != NULL) xfree(spanGroup->group); + if (spanGroup->group != NULL) free(spanGroup->group); } static void QuickSortSpansX( @@ -376,8 +376,8 @@ miDisposeSpanGroup (spanGroup) for (i = 0; i < spanGroup->count; i++) { spans = spanGroup->group + i; - xfree (spans->points); - xfree (spans->widths); + free (spans->points); + free (spans->widths); } } @@ -404,8 +404,8 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) spans = spanGroup->group; (*pGC->ops->FillSpans) (pDraw, pGC, spans->count, spans->points, spans->widths, TRUE); - xfree(spans->points); - xfree(spans->widths); + free(spans->points); + free(spans->widths); } else { @@ -424,9 +424,9 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) if (!yspans || !ysizes) { if (yspans) - xfree (yspans); + free (yspans); if (ysizes) - xfree (ysizes); + free (ysizes); miDisposeSpanGroup (spanGroup); return; } @@ -468,11 +468,11 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) for (i = 0; i < ylength; i++) { - xfree (yspans[i].points); - xfree (yspans[i].widths); + free (yspans[i].points); + free (yspans[i].widths); } - xfree (yspans); - xfree (ysizes); + free (yspans); + free (ysizes); miDisposeSpanGroup (spanGroup); return; } @@ -485,9 +485,9 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) } /* if y value of span in range */ } /* for j through spans */ count += spans->count; - xfree(spans->points); + free(spans->points); spans->points = NULL; - xfree(spans->widths); + free(spans->widths); spans->widths = NULL; } /* for i thorough Spans */ @@ -500,15 +500,15 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) for (i = 0; i < ylength; i++) { - xfree (yspans[i].points); - xfree (yspans[i].widths); + free (yspans[i].points); + free (yspans[i].widths); } - xfree (yspans); - xfree (ysizes); + free (yspans); + free (ysizes); if (points) - xfree (points); + free (points); if (widths) - xfree (widths); + free (widths); return; } count = 0; @@ -524,16 +524,16 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) widths[count] = yspans[i].widths[0]; count++; } - xfree(yspans[i].points); - xfree(yspans[i].widths); + free(yspans[i].points); + free(yspans[i].widths); } } (*pGC->ops->FillSpans) (pDraw, pGC, count, points, widths, TRUE); - xfree(points); - xfree(widths); - xfree(yspans); - xfree(ysizes); /* use (DE)ALLOCATE_LOCAL for these? */ + free(points); + free(widths); + free(yspans); + free(ysizes); /* use (DE)ALLOCATE_LOCAL for these? */ } spanGroup->count = 0; @@ -553,8 +553,8 @@ void miFillSpanGroup(pDraw, pGC, spanGroup) for (i = 0, spans = spanGroup->group; i != spanGroup->count; i++, spans++) { (*pGC->ops->FillSpans) (pDraw, pGC, spans->count, spans->points, spans->widths, TRUE); - xfree(spans->points); - xfree(spans->widths); + free(spans->points); + free(spans->widths); } spanGroup->count = 0; diff --git a/nx-X11/programs/Xserver/mi/misprite.c b/nx-X11/programs/Xserver/mi/misprite.c index c854984fc..2b68ad76a 100644 --- a/nx-X11/programs/Xserver/mi/misprite.c +++ b/nx-X11/programs/Xserver/mi/misprite.c @@ -182,7 +182,7 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs) if (!miPointerInitialize (pScreen, &miSpritePointerFuncs, screenFuncs,TRUE)) { - xfree ((void *) pScreenPriv); + free ((void *) pScreenPriv); return FALSE; } for (pVisual = pScreen->visuals; @@ -270,7 +270,7 @@ miSpriteCloseScreen (i, pScreen) miSpriteIsUpFALSE (pScreen, pScreenPriv); DamageDestroy (pScreenPriv->pDamage); - xfree ((void *) pScreenPriv); + free ((void *) pScreenPriv); return (*pScreen->CloseScreen) (i, pScreen); } diff --git a/nx-X11/programs/Xserver/mi/miwideline.c b/nx-X11/programs/Xserver/mi/miwideline.c index fa9ef4591..f3e8c691a 100644 --- a/nx-X11/programs/Xserver/mi/miwideline.c +++ b/nx-X11/programs/Xserver/mi/miwideline.c @@ -133,7 +133,7 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height, spanRec.widths = (int *) xalloc (overall_height * sizeof (int)); if (!spanRec.widths) { - xfree (spanRec.points); + free (spanRec.points); return; } ppt = spanRec.points; @@ -237,7 +237,7 @@ miFillRectPolyHelper ( spanRec.widths = (int *) xalloc (h * sizeof (int)); if (!spanRec.widths) { - xfree (spanRec.points); + free (spanRec.points); return; } ppt = spanRec.points; @@ -1082,7 +1082,7 @@ miLineArc ( widths = (int *) xalloc (pGC->lineWidth * sizeof (int)); if (!widths) { - xfree (points); + free (points); return; } spanRec.points = points; diff --git a/nx-X11/programs/Xserver/mi/miwindow.c b/nx-X11/programs/Xserver/mi/miwindow.c index aff7128c3..9e87e7095 100644 --- a/nx-X11/programs/Xserver/mi/miwindow.c +++ b/nx-X11/programs/Xserver/mi/miwindow.c @@ -471,7 +471,7 @@ miHandleValidateExposures(pWin) RegionUninit(&val->after.borderExposed); (*WindowExposures)(pChild, &val->after.exposed, NullRegion); RegionUninit(&val->after.exposed); - xfree(val); + free(val); pChild->valdata = (ValidatePtr)NULL; if (pChild->firstChild) { diff --git a/nx-X11/programs/Xserver/miext/cw/cw.c b/nx-X11/programs/Xserver/miext/cw/cw.c index 9f39b9650..5b2c65927 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw.c +++ b/nx-X11/programs/Xserver/miext/cw/cw.c @@ -693,7 +693,7 @@ cwCloseScreen (int i, ScreenPtr pScreen) cwFiniRender(pScreen); #endif - xfree((void *)pScreenPriv); + free((void *)pScreenPriv); return (*pScreen->CloseScreen)(i, pScreen); } diff --git a/nx-X11/programs/Xserver/miext/cw/cw_render.c b/nx-X11/programs/Xserver/miext/cw/cw_render.c index 74c52afb0..2710bf60f 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw_render.c +++ b/nx-X11/programs/Xserver/miext/cw/cw_render.c @@ -84,7 +84,7 @@ cwCreatePicturePrivate (PicturePtr pPicture) &error); if (!pPicturePrivate->pBackingPicture) { - xfree (pPicturePrivate); + free (pPicturePrivate); return NULL; } @@ -108,7 +108,7 @@ cwDestroyPicturePrivate (PicturePtr pPicture) { if (pPicturePrivate->pBackingPicture) FreePicture (pPicturePrivate->pBackingPicture, 0); - xfree (pPicturePrivate); + free (pPicturePrivate); setCwPicture(pPicture, NULL); } } diff --git a/nx-X11/programs/Xserver/miext/damage/damage.c b/nx-X11/programs/Xserver/miext/damage/damage.c index f28d95820..2d6783204 100755 --- a/nx-X11/programs/Xserver/miext/damage/damage.c +++ b/nx-X11/programs/Xserver/miext/damage/damage.c @@ -1726,7 +1726,7 @@ damageCloseScreen (int i, ScreenPtr pScreen) unwrap (pScrPriv, pScreen, CopyWindow); unwrap (pScrPriv, pScreen, CloseScreen); unwrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas); - xfree (pScrPriv); + free (pScrPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -1913,7 +1913,7 @@ DamageDestroy (DamagePtr pDamage) if (pDamage->damageDestroy) (*pDamage->damageDestroy) (pDamage, pDamage->closure); RegionUninit(&pDamage->damage); - xfree (pDamage); + free (pDamage); } Bool diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index 0a18c28c8..f9037ed3b 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -730,7 +730,7 @@ TimerFree(OsTimerPtr timer) if (!timer) return; TimerCancel(timer); - xfree(timer); + free(timer); } void @@ -750,7 +750,7 @@ TimerInit(void) while ((timer = timers)) { timers = timer->next; - xfree(timer); + free(timer); } } diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index 7f45e5ec9..dcd2b52af 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -261,7 +261,7 @@ typedef struct _host { (h)->addr=(unsigned char *) ((h) + 1);\ (h)->requested = FALSE; \ } -#define FreeHost(h) xfree(h) +#define FreeHost(h) free(h) static HOST *selfhosts = NULL; static HOST *validhosts = NULL; static int AccessEnabled = DEFAULT_ACCESS_CONTROL; @@ -1376,12 +1376,12 @@ Bool LocalClient(ClientPtr client) &alen, (void **)&addr); if (family == -1) { - xfree ((char *) from); + free ((char *) from); return FALSE; } if (family == FamilyLocal) { - xfree ((char *) from); + free ((char *) from); return TRUE; } for (host = selfhosts; host; host = host->next) @@ -1389,7 +1389,7 @@ Bool LocalClient(ClientPtr client) if (addrEqual (family, addr, alen, host)) return TRUE; } - xfree ((char *) from); + free ((char *) from); } return FALSE; } @@ -2327,7 +2327,7 @@ siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id) } } - xfree(addrbuf); + free(addrbuf); return parsedOK; } @@ -2360,11 +2360,11 @@ siLocalCredAddrMatch(int family, void * addr, int len, for (i = 0 ; i < connNumSuppGids; i++) { if (connSuppGids[i] == siAddrId) { - xfree(connSuppGids); + free(connSuppGids); return TRUE; } } - xfree(connSuppGids); + free(connSuppGids); } } return FALSE; diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 2df92bf91..4d5826888 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -279,7 +279,7 @@ void ClearConnectionTranslation(void) { struct _ct_node *temp = node; node = node->next; - xfree(temp); + free(temp); } } } @@ -713,7 +713,7 @@ ClientAuthorized(ClientPtr client, proto_n, auth_proto, auth_id); } - xfree ((char *) from); + free ((char *) from); } if (auth_id == (XID) ~0L) { @@ -731,7 +731,7 @@ ClientAuthorized(ClientPtr client, AuthAudit(client, TRUE, (struct sockaddr *) from, fromlen, proto_n, auth_proto, auth_id); - xfree ((char *) from); + free ((char *) from); } } priv->auth_id = auth_id; @@ -775,7 +775,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) oc->conn_time = conn_time; if (!(client = NextAvailableClient((void *)oc))) { - xfree (oc); + free (oc); return NullClient; } { @@ -962,7 +962,7 @@ CloseDownFileDescriptor(OsCommPtr oc) _XSERVTransClose(oc->trans_conn); } FreeOsBuffers(oc); - xfree(oc); + free(oc); #ifndef WIN32 ConnectionTranslation[connection] = 0; #else diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index fefe3007f..b8f05d939 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -222,8 +222,8 @@ ReadRequestFromClient(ClientPtr client) register ConnectionInputPtr aci = AvailableInput->input; if (aci->size > BUFWATERMARK) { - xfree(aci->buffer); - xfree(aci); + free(aci->buffer); + free(aci); } else { @@ -504,8 +504,8 @@ InsertFakeRequest(ClientPtr client, char *data, int count) ConnectionInputPtr aci = AvailableInput->input; if (aci->size > BUFWATERMARK) { - xfree(aci->buffer); - xfree(aci); + free(aci->buffer); + free(aci); } else { @@ -1154,8 +1154,8 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount) } if (oco->size > BUFWATERMARK) { - xfree(oco->buf); - xfree(oco); + free(oco->buf); + free(oco); } else { @@ -1177,7 +1177,7 @@ AllocateInputBuffer(void) oci->buffer = (char *)xalloc(BUFSIZE); if (!oci->buffer) { - xfree(oci); + free(oci); return (ConnectionInputPtr)NULL; } oci->size = BUFSIZE; @@ -1198,7 +1198,7 @@ AllocateOutputBuffer(void) oco->buf = (unsigned char *) xalloc(BUFSIZE); if (!oco->buf) { - xfree(oco); + free(oco); return (ConnectionOutputPtr)NULL; } oco->size = BUFSIZE; @@ -1218,8 +1218,8 @@ FreeOsBuffers(OsCommPtr oc) { if (FreeInputs) { - xfree(oci->buffer); - xfree(oci); + free(oci->buffer); + free(oci); } else { @@ -1234,8 +1234,8 @@ FreeOsBuffers(OsCommPtr oc) { if (FreeOutputs) { - xfree(oco->buf); - xfree(oco); + free(oco->buf); + free(oco); } else { @@ -1255,13 +1255,13 @@ ResetOsBuffers(void) while ((oci = FreeInputs)) { FreeInputs = oci->next; - xfree(oci->buffer); - xfree(oci); + free(oci->buffer); + free(oci); } while ((oco = FreeOutputs)) { FreeOutputs = oco->next; - xfree(oco->buf); - xfree(oco); + free(oco->buf); + free(oco); } } diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c index 84381dbf2..12827cbe0 100644 --- a/nx-X11/programs/Xserver/os/log.c +++ b/nx-X11/programs/Xserver/os/log.c @@ -236,7 +236,7 @@ LogInit(const char *fname, const char *backup) * needed. */ if (saveBuffer && bufferSize > 0) { - free(saveBuffer); /* Must be free(), not xfree() */ + free(saveBuffer); /* Must be free(), not free() */ saveBuffer = NULL; bufferSize = 0; } diff --git a/nx-X11/programs/Xserver/os/mitauth.c b/nx-X11/programs/Xserver/os/mitauth.c index abf7976af..4c1ae9cf6 100644 --- a/nx-X11/programs/Xserver/os/mitauth.c +++ b/nx-X11/programs/Xserver/os/mitauth.c @@ -62,7 +62,7 @@ MitAddCookie ( return 0; new->data = (char *) xalloc ((unsigned) data_length); if (!new->data) { - xfree(new); + free(new); return 0; } new->next = mit_auth; @@ -98,8 +98,8 @@ MitResetCookie (void) for (auth = mit_auth; auth; auth=next) { next = auth->next; - xfree (auth->data); - xfree (auth); + free (auth->data); + free (auth); } mit_auth = 0; return 0; @@ -154,8 +154,8 @@ MitRemoveCookie ( prev->next = auth->next; else mit_auth = auth->next; - xfree (auth->data); - xfree (auth); + free (auth->data); + free (auth); return 1; } } diff --git a/nx-X11/programs/Xserver/os/oscolor.c b/nx-X11/programs/Xserver/os/oscolor.c index a8b01b4b9..8f737eaba 100644 --- a/nx-X11/programs/Xserver/os/oscolor.c +++ b/nx-X11/programs/Xserver/os/oscolor.c @@ -152,7 +152,7 @@ OsLookupColor(int screen, char *name, unsigned int len, #endif if (len >= sizeof(buf)) - xfree(lowername); + free(lowername); if(dbent.dptr) { diff --git a/nx-X11/programs/Xserver/os/rpcauth.c b/nx-X11/programs/Xserver/os/rpcauth.c index 91823553c..1b3db1e0e 100644 --- a/nx-X11/programs/Xserver/os/rpcauth.c +++ b/nx-X11/programs/Xserver/os/rpcauth.c @@ -121,7 +121,7 @@ authdes_ezdecode(char *inmsg, int len) return (((struct authdes_cred *) r.rq_clntcred)->adc_fullname.name); bad2: - xfree(r.rq_clntcred); + free(r.rq_clntcred); bad1: return ((char *)0); /* ((struct authdes_cred *) NULL); */ } diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 90cf55d1a..03deb811a 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -1812,7 +1812,7 @@ Popen(char *command, char *type) return NULL; if (pipe(pdes) < 0) { - xfree(cur); + free(cur); return NULL; } @@ -1826,7 +1826,7 @@ Popen(char *command, char *type) case -1: /* error */ close(pdes[0]); close(pdes[1]); - xfree(cur); + free(cur); #ifdef NX_TRANS_EXIT if (OsVendorEndRedirectErrorFProc != NULL) { OsVendorEndRedirectErrorFProc(); @@ -1950,7 +1950,7 @@ Fopen(char *file, char *type) return NULL; if (pipe(pdes) < 0) { - xfree(cur); + free(cur); return NULL; } @@ -1958,7 +1958,7 @@ Fopen(char *file, char *type) case -1: /* error */ close(pdes[0]); close(pdes[1]); - xfree(cur); + free(cur); return NULL; case 0: /* child */ if (setgid(getgid()) == -1) @@ -2052,7 +2052,7 @@ Pclose(void * iop) pidlist = cur->next; else last->next = cur->next; - xfree(cur); + free(cur); /* allow EINTR again */ OsReleaseSignals (); diff --git a/nx-X11/programs/Xserver/os/xdmauth.c b/nx-X11/programs/Xserver/os/xdmauth.c index 92fbde478..b55f75a36 100644 --- a/nx-X11/programs/Xserver/os/xdmauth.c +++ b/nx-X11/programs/Xserver/os/xdmauth.c @@ -240,7 +240,7 @@ XdmClientAuthTimeout (long now) prev->next = next; else xdmClients = next; - xfree (client); + free (client); } else prev = client; @@ -266,14 +266,14 @@ XdmAuthorizationValidate (unsigned char *plain, int length, XdmClientAuthDecode (plain, client); if (!XdmcpCompareKeys (&client->rho, rho)) { - xfree (client); + free (client); if (reason) *reason = "Invalid XDM-AUTHORIZATION-1 key (failed key comparison)"; return NULL; } for (i = 18; i < 24; i++) if (plain[i] != 0) { - xfree (client); + free (client); if (reason) *reason = "Invalid XDM-AUTHORIZATION-1 key (failed NULL check)"; return NULL; @@ -288,15 +288,15 @@ XdmAuthorizationValidate (unsigned char *plain, int length, #if defined(TCPCONN) || defined(STREAMSCONN) if (family == FamilyInternet && memcmp((char *)addr, client->client, 4) != 0) { - xfree (client); - xfree (addr); + free (client); + free (addr); if (reason) *reason = "Invalid XDM-AUTHORIZATION-1 key (failed address comparison)"; return NULL; } #endif - xfree (addr); + free (addr); } } now = time(0); @@ -309,7 +309,7 @@ XdmAuthorizationValidate (unsigned char *plain, int length, XdmClientAuthTimeout (now); if (abs (client->time - now) > TwentyMinutes) { - xfree (client); + free (client); if (reason) *reason = "Excessive XDM-AUTHORIZATION-1 time offset"; return NULL; @@ -318,7 +318,7 @@ XdmAuthorizationValidate (unsigned char *plain, int length, { if (XdmClientAuthCompare (existing, client)) { - xfree (client); + free (client); if (reason) *reason = "XDM authorization key matches an existing client!"; return NULL; @@ -395,11 +395,11 @@ XdmCheckCookie (unsigned short cookie_length, char *cookie, { client->next = xdmClients; xdmClients = client; - xfree (plain); + free (plain); return auth->id; } } - xfree (plain); + free (plain); return (XID) -1; } @@ -412,13 +412,13 @@ XdmResetCookie (void) for (auth = xdmAuth; auth; auth=next_auth) { next_auth = auth->next; - xfree (auth); + free (auth); } xdmAuth = 0; for (client = xdmClients; client; client=next_client) { next_client = client->next; - xfree (client); + free (client); } xdmClients = (XdmClientAuthPtr) 0; return 1; @@ -438,12 +438,12 @@ XdmToID (unsigned short cookie_length, char *cookie) XdmcpUnwrap (cookie, (unsigned char *)&auth->key, plain, cookie_length); if ((client = XdmAuthorizationValidate (plain, cookie_length, &auth->rho, NULL, NULL)) != NULL) { - xfree (client); - xfree (cookie); + free (client); + free (cookie); return auth->id; } } - xfree (cookie); + free (cookie); return (XID) -1; } @@ -492,7 +492,7 @@ XdmRemoveCookie (unsigned short data_length, char *data) prev->next = auth->next; else xdmAuth = auth->next; - xfree (auth); + free (auth); return 1; } } diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c index 4181e52ce..29785f48e 100644 --- a/nx-X11/programs/Xserver/os/xdmcp.c +++ b/nx-X11/programs/Xserver/os/xdmcp.c @@ -419,7 +419,7 @@ XdmcpRegisterAuthentication ( newFuncs[AuthenticationNames.length-1].Validator = Validator; newFuncs[AuthenticationNames.length-1].Generator = Generator; newFuncs[AuthenticationNames.length-1].AddAuth = AddAuth; - xfree (AuthenticationFuncsList); + free (AuthenticationFuncsList); AuthenticationFuncsList = newFuncs; AuthenticationNames.data[AuthenticationNames.length-1] = AuthenticationName; AuthenticationDatas.data[AuthenticationDatas.length-1] = AuthenticationData; @@ -512,13 +512,13 @@ XdmcpRegisterConnection ( return; if (!XdmcpReallocARRAY16 (&ConnectionTypes, ConnectionTypes.length + 1)) { - xfree (newAddress); + free (newAddress); return; } if (!XdmcpReallocARRAYofARRAY8 (&ConnectionAddresses, ConnectionAddresses.length + 1)) { - xfree (newAddress); + free (newAddress); return; } ConnectionTypes.data[ConnectionTypes.length - 1] = (CARD16) type; @@ -553,7 +553,7 @@ XdmcpRegisterAuthorization (char *name, int namelen) return; if (!XdmcpReallocARRAYofARRAY8 (&AuthorizationNames, AuthorizationNames.length +1)) { - xfree (authName.data); + free (authName.data); return; } for (i = 0; i < namelen; i++) diff --git a/nx-X11/programs/Xserver/randr/randr.c b/nx-X11/programs/Xserver/randr/randr.c index b78a947c8..afce35d7d 100644 --- a/nx-X11/programs/Xserver/randr/randr.c +++ b/nx-X11/programs/Xserver/randr/randr.c @@ -131,9 +131,9 @@ RRCloseScreen( RRMonitorClose(pScreen); - xfree(pScrPriv->crtcs); - xfree(pScrPriv->outputs); - xfree(pScrPriv); + free(pScrPriv->crtcs); + free(pScrPriv->outputs); + free(pScrPriv); RRNScreens -= 1; /* ok, one fewer screen with RandR running */ return (*pScreen->CloseScreen) (i, pScreen); } @@ -405,7 +405,7 @@ RRFreeClient(void *data, XID id) *pHead = pRREvent->next; } } - xfree((void *) pRREvent); + free((void *) pRREvent); return 1; } @@ -418,9 +418,9 @@ RRFreeEvents(void *data, XID id) for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource(pCur->clientResource, RRClientType); - xfree((void *) pCur); + free((void *) pCur); } - xfree((void *) pHead); + free((void *) pHead); return 1; } diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c index d69b5ec08..6fb6e02e6 100644 --- a/nx-X11/programs/Xserver/randr/rrcrtc.c +++ b/nx-X11/programs/Xserver/randr/rrcrtc.c @@ -215,7 +215,7 @@ RRCrtcNotify(RRCrtcPtr crtc, return FALSE; } else { - xfree(crtc->outputs); + free(crtc->outputs); newoutputs = NULL; } crtc->outputs = newoutputs; @@ -391,7 +391,7 @@ RRComputeContiguity(ScreenPtr pScreen) discontiguous = FALSE; out: - xfree(reachable); + free(reachable); pScrPriv->discontiguous = discontiguous; } @@ -778,10 +778,10 @@ RRCrtcDestroyResource(void *value, XID pid) if (crtc->scanout_pixmap) RRCrtcDetachScanoutPixmap(crtc); - xfree(crtc->gammaRed); + free(crtc->gammaRed); if (crtc->mode) RRModeDestroy(crtc->mode); - xfree(crtc); + free(crtc); return 1; } @@ -899,7 +899,7 @@ RRCrtcGammaSetSize(RRCrtcPtr crtc, int size) } else gamma = NULL; - xfree(crtc->gammaRed); + free(crtc->gammaRed); crtc->gammaRed = gamma; crtc->gammaGreen = gamma + size; crtc->gammaBlue = gamma + size * 2; @@ -1089,7 +1089,7 @@ ProcRRGetCrtcInfo(ClientPtr client) WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *) &rep); if (extraLen) { WriteToClient(client, extraLen, (char *) extra); - xfree(extra); + free(extra); } return Success; @@ -1151,7 +1151,7 @@ ProcRRSetCrtcConfig(ClientPtr client) RROutputType, client, DixSetAttrAccess); if (ret != Success) { - xfree(outputs); + free(outputs); return ret; } #else /* !defined(NXAGENT_SERVER) */ @@ -1159,7 +1159,7 @@ ProcRRSetCrtcConfig(ClientPtr client) if (!outputs[i]) { client->errorValue = outputIds[i]; if (outputs) - xfree(outputs); + free(outputs); return RRErrorBase + BadRROutput; } #endif /* !defined(NXAGENT_SERVER) */ @@ -1168,7 +1168,7 @@ ProcRRSetCrtcConfig(ClientPtr client) if (outputs[i]->crtcs[j] == crtc) break; if (j == outputs[i]->numCrtcs) { - xfree(outputs); + free(outputs); return BadMatch; } /* validate mode for this output */ @@ -1180,7 +1180,7 @@ ProcRRSetCrtcConfig(ClientPtr client) break; } if (j == outputs[i]->numModes + outputs[i]->numUserModes) { - xfree(outputs); + free(outputs); return BadMatch; } } @@ -1196,7 +1196,7 @@ ProcRRSetCrtcConfig(ClientPtr client) break; } if (k == outputs[i]->numClones) { - xfree(outputs); + free(outputs); return BadMatch; } } @@ -1230,7 +1230,7 @@ ProcRRSetCrtcConfig(ClientPtr client) * Invalid rotation */ client->errorValue = stuff->rotation; - xfree(outputs); + free(outputs); return BadValue; } @@ -1240,7 +1240,7 @@ ProcRRSetCrtcConfig(ClientPtr client) * requested rotation or reflection not supported by screen */ client->errorValue = stuff->rotation; - xfree(outputs); + free(outputs); return BadMatch; } @@ -1282,13 +1282,13 @@ ProcRRSetCrtcConfig(ClientPtr client) &source_height); if (stuff->x + source_width > width) { client->errorValue = stuff->x; - xfree(outputs); + free(outputs); return BadValue; } if (stuff->y + source_height > height) { client->errorValue = stuff->y; - xfree(outputs); + free(outputs); return BadValue; } } @@ -1304,7 +1304,7 @@ ProcRRSetCrtcConfig(ClientPtr client) pScrPriv->lastSetTime = time; sendReply: - xfree(outputs); + free(outputs); rep = (xRRSetCrtcConfigReply) { .type = X_Reply, @@ -1535,7 +1535,7 @@ ProcRRGetCrtcGamma(ClientPtr client) memcpy(extra, crtc->gammaRed, len); client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write; WriteSwappedDataToClient(client, len, extra); - xfree(extra); + free(extra); } return Success; } @@ -1700,7 +1700,7 @@ ProcRRGetCrtcTransform(ClientPtr client) } WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra, (char *) reply); - xfree(reply); + free(reply); return Success; } @@ -1894,7 +1894,7 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) else crtc->scanout_pixmap = saved_scanout_pixmap[i]; } - xfree(saved_scanout_pixmap); + free(saved_scanout_pixmap); return ret; } diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c index b15d1ad20..271d5d939 100644 --- a/nx-X11/programs/Xserver/randr/rrdispatch.c +++ b/nx-X11/programs/Xserver/randr/rrdispatch.c @@ -212,7 +212,7 @@ ProcRRSelectInput(ClientPtr client) pNewRREvent->next = pRREvent->next; else *pHead = pRREvent->next; - xfree(pRREvent); + free(pRREvent); } } } diff --git a/nx-X11/programs/Xserver/randr/rrinfo.c b/nx-X11/programs/Xserver/randr/rrinfo.c index df9b79986..4c47fb903 100644 --- a/nx-X11/programs/Xserver/randr/rrinfo.c +++ b/nx-X11/programs/Xserver/randr/rrinfo.c @@ -132,7 +132,7 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations) newMode = mode; } } - xfree(size->pRates); + free(size->pRates); } else { mode = RROldModeAdd(output, size, 0); @@ -141,7 +141,7 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations) } } if (pScrPriv->nSizes) - xfree(pScrPriv->pSizes); + free(pScrPriv->pSizes); pScrPriv->pSizes = NULL; pScrPriv->nSizes = 0; diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c index 918e0f221..3d84a0516 100644 --- a/nx-X11/programs/Xserver/randr/rrmode.c +++ b/nx-X11/programs/Xserver/randr/rrmode.c @@ -106,13 +106,13 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen) newModes = xalloc(sizeof(RRModePtr)); if (!newModes) { - xfree(mode); + free(mode); return NULL; } mode->mode.id = FakeClientID(0); if (!AddResource(mode->mode.id, RRModeType, (void *) mode)) { - xfree(newModes); + free(newModes); return NULL; } modes = newModes; @@ -285,14 +285,14 @@ RRModeDestroy(RRModePtr mode) (num_modes - m - 1) * sizeof(RRModePtr)); num_modes--; if (!num_modes) { - xfree(modes); + free(modes); modes = NULL; } break; } } - xfree(mode); + free(mode); } static int diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c index fc9b9295b..36543cb4c 100644 --- a/nx-X11/programs/Xserver/randr/rrmonitor.c +++ b/nx-X11/programs/Xserver/randr/rrmonitor.c @@ -298,7 +298,7 @@ RRMonitorInitList(ScreenPtr screen, RRMonitorListPtr mon_list, Bool get_active) static void RRMonitorFiniList(RRMonitorListPtr list) { - xfree(list->server_crtc); + free(list->server_crtc); } /* Construct a complete list of protocol-visible monitors, including @@ -401,7 +401,7 @@ RRMonitorCountList(ScreenPtr screen) void RRMonitorFree(RRMonitorPtr monitor) { - xfree(monitor); + free(monitor); } RRMonitorPtr @@ -573,8 +573,8 @@ RRMonitorFreeList(RRMonitorPtr monitors, int nmon) int m; for (m = 0; m < nmon; m++) - xfree(monitors[m].outputs); - xfree(monitors); + free(monitors[m].outputs); + free(monitors); } void @@ -600,7 +600,7 @@ RRMonitorClose(ScreenPtr screen) for (m = 0; m < pScrPriv->numMonitors; m++) RRMonitorFree(pScrPriv->monitors[m]); - xfree(pScrPriv->monitors); + free(pScrPriv->monitors); pScrPriv->monitors = NULL; pScrPriv->numMonitors = 0; } diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c index 2628fabb0..46948c577 100644 --- a/nx-X11/programs/Xserver/randr/rroutput.c +++ b/nx-X11/programs/Xserver/randr/rroutput.c @@ -154,7 +154,7 @@ RROutputSetClones(RROutputPtr output, RROutputPtr * clones, int numClones) } else newClones = NULL; - xfree(output->clones); + free(output->clones); memcpy(newClones, clones, numClones * sizeof(RROutputPtr)); output->clones = newClones; output->numClones = numClones; @@ -194,7 +194,7 @@ RROutputSetModes(RROutputPtr output, if (output->modes) { for (i = 0; i < output->numModes; i++) RRModeDestroy(output->modes[i]); - xfree(output->modes); + free(output->modes); } memcpy(newModes, modes, numModes * sizeof(RRModePtr)); output->modes = newModes; @@ -299,7 +299,7 @@ RROutputSetCrtcs(RROutputPtr output, RRCrtcPtr * crtcs, int numCrtcs) } else newCrtcs = NULL; - xfree(output->crtcs); + free(output->crtcs); memcpy(newCrtcs, crtcs, numCrtcs * sizeof(RRCrtcPtr)); output->crtcs = newCrtcs; output->numCrtcs = numCrtcs; @@ -404,17 +404,17 @@ RROutputDestroyResource(void *value, XID pid) if (output->modes) { for (m = 0; m < output->numModes; m++) RRModeDestroy(output->modes[m]); - xfree(output->modes); + free(output->modes); } for (m = 0; m < output->numUserModes; m++) RRModeDestroy(output->userModes[m]); - xfree(output->userModes); + free(output->userModes); - xfree(output->crtcs); - xfree(output->clones); + free(output->crtcs); + free(output->clones); RRDeleteAllOutputProperties(output); - xfree(output); + free(output); return 1; } @@ -541,7 +541,7 @@ ProcRRGetOutputInfo(ClientPtr client) WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *) &rep); if (extraLen) { WriteToClient(client, extraLen, (char *) extra); - xfree(extra); + free(extra); } return Success; diff --git a/nx-X11/programs/Xserver/randr/rrproperty.c b/nx-X11/programs/Xserver/randr/rrproperty.c index 741d0310e..7275cd34f 100644 --- a/nx-X11/programs/Xserver/randr/rrproperty.c +++ b/nx-X11/programs/Xserver/randr/rrproperty.c @@ -63,10 +63,10 @@ RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event) static void RRDestroyOutputProperty(RRPropertyPtr prop) { - xfree(prop->valid_values); - xfree(prop->current.data); - xfree(prop->pending.data); - xfree(prop); + free(prop->valid_values); + free(prop->current.data); + free(prop->pending.data); + free(prop); } static void @@ -225,12 +225,12 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, if (pending && pScrPriv->rrOutputSetProperty && !pScrPriv->rrOutputSetProperty(output->pScreen, output, prop->propertyName, &new_value)) { - xfree(new_value.data); + free(new_value.data); if (add) RRDestroyOutputProperty(prop); return BadValue; } - xfree(prop_value->data); + free(prop_value->data); *prop_value = new_value; } @@ -377,7 +377,7 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property, * loses any pending values */ if (prop->is_pending && !pending) { - xfree(prop->pending.data); + free(prop->pending.data); RRInitOutputPropertyValue(&prop->pending); } @@ -385,7 +385,7 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property, prop->range = range; prop->immutable = immutable; prop->num_valid = num_values; - xfree(prop->valid_values); + free(prop->valid_values); prop->valid_values = new_values; if (add) { @@ -442,7 +442,7 @@ ProcRRListOutputProperties(ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - xfree(pAtoms); + free(pAtoms); } return Success; } @@ -493,7 +493,7 @@ ProcRRQueryOutputProperty(ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32), extra); - xfree(extra); + free(extra); } return Success; } @@ -749,7 +749,7 @@ ProcRRGetOutputProperty(ClientPtr client) break; } WriteSwappedDataToClient(client, len, extra); - xfree(extra); + free(extra); } if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */ diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c index b2251b682..4911f8fd8 100644 --- a/nx-X11/programs/Xserver/randr/rrprovider.c +++ b/nx-X11/programs/Xserver/randr/rrprovider.c @@ -152,7 +152,7 @@ ProcRRGetProviders(ClientPtr client) if (extraLen) { WriteToClient(client, extraLen, (char *) extra); - xfree(extra); + free(extra); } return Success; } @@ -295,7 +295,7 @@ ProcRRGetProviderInfo(ClientPtr client) if (extraLen) { WriteToClient(client, extraLen, (char *) extra); - xfree(extra); + free(extra); } return Success; } @@ -427,7 +427,7 @@ RRProviderDestroyResource(void *value, XID pid) (*pScrPriv->rrProviderDestroy) (pScreen, provider); pScrPriv->provider = NULL; } - xfree(provider); + free(provider); return 1; } diff --git a/nx-X11/programs/Xserver/randr/rrproviderproperty.c b/nx-X11/programs/Xserver/randr/rrproviderproperty.c index a68a94ff2..9aa2135df 100644 --- a/nx-X11/programs/Xserver/randr/rrproviderproperty.c +++ b/nx-X11/programs/Xserver/randr/rrproviderproperty.c @@ -60,10 +60,10 @@ RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event) static void RRDestroyProviderProperty(RRPropertyPtr prop) { - xfree(prop->valid_values); - xfree(prop->current.data); - xfree(prop->pending.data); - xfree(prop); + free(prop->valid_values); + free(prop->current.data); + free(prop->pending.data); + free(prop); } static void @@ -222,10 +222,10 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, prop->propertyName, &new_value)) { if (add) RRDestroyProviderProperty(prop); - xfree(new_value.data); + free(new_value.data); return BadValue; } - xfree(prop_value->data); + free(prop_value->data); *prop_value = new_value; } @@ -373,7 +373,7 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property, * loses any pending values */ if (prop->is_pending && !pending) { - xfree(prop->pending.data); + free(prop->pending.data); RRInitProviderPropertyValue(&prop->pending); } @@ -381,7 +381,7 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property, prop->range = range; prop->immutable = immutable; prop->num_valid = num_values; - xfree(prop->valid_values); + free(prop->valid_values); prop->valid_values = new_values; if (add) { @@ -437,7 +437,7 @@ ProcRRListProviderProperties(ClientPtr client) if (numProps) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - xfree(pAtoms); + free(pAtoms); } return Success; } @@ -487,7 +487,7 @@ ProcRRQueryProviderProperty(ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32), extra); - xfree(extra); + free(extra); } return Success; } @@ -741,7 +741,7 @@ ProcRRGetProviderProperty(ClientPtr client) break; } WriteSwappedDataToClient(client, len, extra); - xfree(extra); + free(extra); } if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */ diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c index af54d66f5..7047d80a5 100644 --- a/nx-X11/programs/Xserver/randr/rrscreen.c +++ b/nx-X11/programs/Xserver/randr/rrscreen.c @@ -334,7 +334,7 @@ ProcRRSetScreenSize(ClientPtr client) for (j = 0; j < num_modes; j++) \ total_name_len += modes[j]->mode.nameLength; \ total_modes += num_modes; \ - xfree(modes); \ + free(modes); \ } while(0) static inline void @@ -388,7 +388,7 @@ swap_modeinfos(xRRModeInfo * modeinfos, int i) names += mode->mode.nameLength; \ mode_count++; \ } \ - xfree(modes); \ + free(modes); \ } \ } while (0) @@ -504,7 +504,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *) &rep); if (extraLen) { WriteToClient(client, extraLen, (char *) extra); - xfree(extra); + free(extra); } return Success; } @@ -597,7 +597,7 @@ rrGetScreenResources(ClientPtr client, Bool query) if (extraLen) { extra = xalloc(extraLen); if (!extra) { - xfree(modes); + free(modes); return BadAlloc; } } @@ -655,7 +655,7 @@ rrGetScreenResources(ClientPtr client, Bool query) memcpy(names, mode->name, mode->mode.nameLength); names += mode->mode.nameLength; } - xfree(modes); + free(modes); assert(bytes_to_int32((char *) names - (char *) extra) == rep.length); } @@ -673,7 +673,7 @@ rrGetScreenResources(ClientPtr client, Bool query) (char *) (char *) &rep); if (extraLen) { WriteToClient(client, extraLen, (char *) (char *) extra); - xfree(extra); + free(extra); } return Success; } @@ -876,7 +876,7 @@ ProcRRGetScreenInfo(ClientPtr client) if (extraLen) { extra = (CARD8 *) xalloc(extraLen); if (!extra) { - xfree(pData); + free(pData); return BadAlloc; } } @@ -916,7 +916,7 @@ ProcRRGetScreenInfo(ClientPtr client) } } } - xfree(pData); + free(pData); data8 = (CARD8 *) rates; @@ -939,7 +939,7 @@ ProcRRGetScreenInfo(ClientPtr client) WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *) &rep); if (extraLen) { WriteToClient(client, extraLen, (char *) extra); - xfree(extra); + free(extra); } return Success; } @@ -1035,7 +1035,7 @@ ProcRRSetScreenConfig(ClientPtr client) * Invalid size ID */ client->errorValue = stuff->sizeID; - xfree(pData); + free(pData); return BadValue; } pSize = &pData->sizes[stuff->sizeID]; @@ -1057,7 +1057,7 @@ ProcRRSetScreenConfig(ClientPtr client) * Invalid rotation */ client->errorValue = stuff->rotation; - xfree(pData); + free(pData); return BadValue; } @@ -1066,7 +1066,7 @@ ProcRRSetScreenConfig(ClientPtr client) * requested rotation or reflection not supported by screen */ client->errorValue = stuff->rotation; - xfree(pData); + free(pData); return BadMatch; } @@ -1088,7 +1088,7 @@ ProcRRSetScreenConfig(ClientPtr client) * Invalid rate */ client->errorValue = rate; - xfree(pData); + free(pData); return BadValue; } mode = pSize->pRates[i].mode; @@ -1113,12 +1113,12 @@ ProcRRSetScreenConfig(ClientPtr client) height = mode->mode.height; if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) { client->errorValue = width; - xfree(pData); + free(pData); return BadValue; } if (height < pScrPriv->minHeight || pScrPriv->maxHeight < height) { client->errorValue = height; - xfree(pData); + free(pData); return BadValue; } @@ -1159,7 +1159,7 @@ ProcRRSetScreenConfig(ClientPtr client) sendReply: - xfree(pData); + free(pData); rep = (xRRSetScreenConfigReply) { .type = X_Reply, @@ -1202,7 +1202,7 @@ RR10CurrentSizeID(ScreenPtr pScreen) sizeID = (CARD16) i; break; } - xfree(data); + free(data); } } return sizeID; diff --git a/nx-X11/programs/Xserver/randr/rrtransform.c b/nx-X11/programs/Xserver/randr/rrtransform.c index 4377d09aa..743e227ea 100644 --- a/nx-X11/programs/Xserver/randr/rrtransform.c +++ b/nx-X11/programs/Xserver/randr/rrtransform.c @@ -37,7 +37,7 @@ RRTransformInit(RRTransformPtr transform) void RRTransformFini(RRTransformPtr transform) { - xfree(transform->params); + free(transform->params); } Bool @@ -81,7 +81,7 @@ RRTransformSetFilter(RRTransformPtr dst, } else new_params = NULL; - xfree(dst->params); + free(dst->params); dst->filter = filter; dst->params = new_params; dst->nparams = nparams; diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index 590a343a0..7fabf79c6 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -1126,7 +1126,7 @@ RecordUninstallHooks(pRCAP, oneclient) { /* nobody needs it, so free it */ pClient->requestVector = pClientPriv->originalVector; pClient->devPrivates[RecordClientPrivateIndex].ptr = NULL; - xfree(pClientPriv); + free(pClientPriv); } } /* end if this RCAP specifies any requests */ } /* end if not future clients */ @@ -1197,8 +1197,8 @@ RecordDeleteClientFromRCAP(pRCAP, position) } /* free the RCAP */ if (pRCAP->clientIDsSeparatelyAllocated) - xfree(pRCAP->pClientIDs); - xfree(pRCAP); + free(pRCAP->pClientIDs); + free(pRCAP); } } /* RecordDeleteClientFromRCAP */ @@ -1979,11 +1979,11 @@ bailout: { for (i = 0; i < maxSets; i++) if (si[i].intervals) - xfree(si[i].intervals); + free(si[i].intervals); DEALLOCATE_LOCAL(si); } if (pCanonClients && pCanonClients != (XID *)&stuff[1]) - xfree(pCanonClients); + free(pCanonClients); return err; } /* RecordRegisterClients */ @@ -2068,7 +2068,7 @@ ProcRecordCreateContext(client) } bailout: if (pContext) - xfree(pContext); + free(pContext); return err; } /* ProcRecordCreateContext */ @@ -2119,7 +2119,7 @@ ProcRecordUnregisterClients(client) RecordDeleteClientFromContext(pContext, pCanonClients[i]); } if (pCanonClients != (XID *)&stuff[1]) - xfree(pCanonClients); + free(pCanonClients); return Success; } /* ProcRecordUnregisterClients */ @@ -2471,7 +2471,7 @@ ProcRecordGetContext(client) bailout: for (i = 0; i < nRCAPs; i++) { - if (pRangeInfo[i].pRanges) xfree(pRangeInfo[i].pRanges); + if (pRangeInfo[i].pRanges) free(pRangeInfo[i].pRanges); } DEALLOCATE_LOCAL(pRangeInfo); return err; @@ -2646,7 +2646,7 @@ RecordDeleteContext(value, id) } } - xfree(pContext); + free(pContext); /* remove context from AllContexts list */ @@ -2655,7 +2655,7 @@ RecordDeleteContext(value, id) ppAllContexts[i] = ppAllContexts[numContexts - 1]; if (--numContexts == 0) { - xfree(ppAllContexts); + free(ppAllContexts); ppAllContexts = NULL; } } diff --git a/nx-X11/programs/Xserver/record/set.c b/nx-X11/programs/Xserver/record/set.c index 83fb0e7d7..28547f3d0 100644 --- a/nx-X11/programs/Xserver/record/set.c +++ b/nx-X11/programs/Xserver/record/set.c @@ -73,7 +73,6 @@ typedef int Bool; typedef unsigned short CARD16; #define xalloc malloc -#define xfree free #define ALLOCATE_LOCAL malloc #define DEALLOCATE_LOCAL free @@ -135,7 +134,7 @@ static void BitVectorDestroySet(pSet) RecordSetPtr pSet; { - xfree(pSet); + free(pSet); } static unsigned long @@ -295,7 +294,7 @@ static void IntervalListDestroySet(pSet) RecordSetPtr pSet; { - xfree(pSet); + free(pSet); } static unsigned long @@ -702,7 +701,7 @@ int main(argc, argv) if (testcount & 1) { - xfree(bs); + free(bs); } } } diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index 27e5ab949..993800c7e 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -128,7 +128,7 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen) Unwrap(as, pScreen, RecolorCursor); SetAnimCurScreen(pScreen,0); ret = (*pScreen->CloseScreen) (index, pScreen); - xfree (as); + free (as); if (index == 0) AnimCurScreenPrivateIndex = -1; return ret; diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 57a21a8c0..31d5481c9 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -73,7 +73,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit) names = xalloc (sizeof (char *)); if (!names) { - xfree (name); + free (name); return -1; } filterNames = names; @@ -119,8 +119,8 @@ PictureFreeFilterIds (void) int i; for (i = 0; i < nfilterNames; i++) - xfree (filterNames[i]); - xfree (filterNames); + free (filterNames[i]); + free (filterNames); nfilterNames = 0; filterNames = 0; } @@ -272,8 +272,8 @@ PictureResetFilters (ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreen(pScreen); - xfree (ps->filters); - xfree (ps->filterAliases); + free (ps->filters); + free (ps->filterAliases); PictureFreeFilterIds (); } @@ -340,7 +340,7 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, if (!new_params && nparams) return BadAlloc; - xfree (pPicture->filter_params); + free (pPicture->filter_params); pPicture->filter_params = new_params; pPicture->filter_nparams = nparams; } diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index 854a9069d..f956c44b2 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -264,7 +264,7 @@ FreeGlyph (GlyphPtr glyph, int format) gr->signature = 0; globalGlyphs[format].tableEntries--; } - xfree (glyph); + free (glyph); } } @@ -281,7 +281,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph); if (gr->glyph && gr->glyph != DeletedGlyph) { - xfree (glyph); + free (glyph); glyph = gr->glyph; } else @@ -404,7 +404,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) ++newHash.tableEntries; } } - xfree (hash->table); + free (hash->table); } *hash = newHash; if (global) @@ -444,7 +444,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) { - xfree (glyphSet); + free (glyphSet); return FALSE; } glyphSet->refcnt = 1; @@ -473,19 +473,19 @@ FreeGlyphSet (void *value, } if (!globalGlyphs[glyphSet->fdepth].tableEntries) { - xfree (globalGlyphs[glyphSet->fdepth].table); + free (globalGlyphs[glyphSet->fdepth].table); globalGlyphs[glyphSet->fdepth].table = 0; globalGlyphs[glyphSet->fdepth].hashSet = 0; } else ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE); - xfree (table); + free (table); if (glyphSet->devPrivates && glyphSet->devPrivates != (void *)(&glyphSet[1])) - xfree(glyphSet->devPrivates); + free(glyphSet->devPrivates); - xfree (glyphSet); + free (glyphSet); } return Success; } diff --git a/nx-X11/programs/Xserver/render/miindex.c b/nx-X11/programs/Xserver/render/miindex.c index 03e2857a2..ad2653c14 100644 --- a/nx-X11/programs/Xserver/render/miindex.c +++ b/nx-X11/programs/Xserver/render/miindex.c @@ -267,7 +267,7 @@ miInitIndexed (ScreenPtr pScreen, pFormat->index.pValues = xalloc (num * sizeof (xIndexValue)); if (!pFormat->index.pValues) { - xfree (pIndexed); + free (pIndexed); return FALSE; } @@ -323,12 +323,12 @@ miCloseIndexed (ScreenPtr pScreen, { if (pFormat->index.devPrivate) { - xfree (pFormat->index.devPrivate); + free (pFormat->index.devPrivate); pFormat->index.devPrivate = 0; } if (pFormat->index.pValues) { - xfree (pFormat->index.pValues); + free (pFormat->index.pValues); pFormat->index.pValues = 0; } } diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index ae7cf5a6d..5bd449d44 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -107,7 +107,7 @@ miChangePictureClip (PicturePtr pPicture, if (!clientClip) return BadAlloc; clientClipType = CT_REGION; - xfree(value); + free(value); break; } (*ps->DestroyPictureClip) (pPicture); diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index a29a9568c..1e653b0c3 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -141,9 +141,9 @@ PictureCloseScreen (int index, ScreenPtr pScreen) (*ps->CloseIndexed) (pScreen, &ps->formats[n]); SetPictureScreen(pScreen, 0); if (ps->PicturePrivateSizes) - xfree (ps->PicturePrivateSizes); - xfree (ps->formats); - xfree (ps); + free (ps->PicturePrivateSizes); + free (ps->formats); + free (ps); return ret; } @@ -660,7 +660,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) { if (!AddResource (formats[n].id, PictFormatType, (void *) (formats+n))) { - xfree (formats); + free (formats); return FALSE; } if (formats[n].type == PictTypeIndexed) @@ -692,15 +692,15 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec)); if (!ps) { - xfree (formats); + free (formats); return FALSE; } SetPictureScreen(pScreen, ps); if (!GlyphInit (pScreen)) { SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); + free (formats); + free (ps); return FALSE; } @@ -730,8 +730,8 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) { PictureResetFilters (pScreen); SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); + free (formats); + free (ps); return FALSE; } @@ -1003,7 +1003,7 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill)); if (!pPicture->pSourcePict) { *error = BadAlloc; - xfree(pPicture); + free(pPicture); return 0; } pPicture->pSourcePict->type = SourcePictTypeSolidFill; @@ -1037,7 +1037,7 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; - xfree(pPicture); + free(pPicture); return 0; } @@ -1047,7 +1047,7 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { - xfree(pPicture); + free(pPicture); return 0; } return pPicture; @@ -1086,7 +1086,7 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; - xfree(pPicture); + free(pPicture); return 0; } radial = &pPicture->pSourcePict->radial; @@ -1110,7 +1110,7 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { - xfree(pPicture); + free(pPicture); return 0; } return pPicture; @@ -1137,7 +1137,7 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle, pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictConicalGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; - xfree(pPicture); + free(pPicture); return 0; } @@ -1147,7 +1147,7 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle, initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { - xfree(pPicture); + free(pPicture); return 0; } return pPicture; @@ -1487,7 +1487,7 @@ SetPictureTransform (PicturePtr pPicture, { if (pPicture->transform) { - xfree (pPicture->transform); + free (pPicture->transform); pPicture->transform = 0; } } @@ -1611,12 +1611,12 @@ FreePicture (void * value, if (--pPicture->refcnt == 0) { if (pPicture->transform) - xfree (pPicture->transform); + free (pPicture->transform); if (!pPicture->pDrawable) { if (pPicture->pSourcePict) { if (pPicture->pSourcePict->type != SourcePictTypeSolidFill) - xfree(pPicture->pSourcePict->linear.stops); - xfree(pPicture->pSourcePict); + free(pPicture->pSourcePict->linear.stops); + free(pPicture->pSourcePict); } } else { ScreenPtr pScreen = pPicture->pDrawable->pScreen; @@ -1647,7 +1647,7 @@ FreePicture (void * value, (*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable); } } - xfree (pPicture); + free (pPicture); } return Success; } diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 5a4114adc..58b3dbc88 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -552,7 +552,7 @@ ProcRenderQueryPictFormats (ClientPtr client) swapl (&reply->numSubpixel, n); } WriteToClient(client, rlength, (char *) reply); - xfree (reply); + free (reply); return client->noClientException; } #endif /* NXAGENT_SERVER */ @@ -617,7 +617,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) } WriteToClient(client, rlength, (char *) reply); - xfree(reply); + free(reply); return (client->noClientException); } @@ -1196,16 +1196,16 @@ ProcRenderAddGlyphs (ClientPtr client) } if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); + free (glyphsBase); return client->noClientException; bail: while (glyphs != glyphsBase) { --glyphs; - xfree (glyphs->glyph); + free (glyphs->glyph); } if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); + free (glyphsBase); return err; } @@ -1542,14 +1542,14 @@ ProcRenderCreateCursor (ClientPtr client) srcbits = (unsigned char *)xalloc(nbytes_mono); if (!srcbits) { - xfree (argbbits); + free (argbbits); return (BadAlloc); } mskbits = (unsigned char *)xalloc(nbytes_mono); if (!mskbits) { - xfree(argbbits); - xfree(srcbits); + free(argbbits); + free(srcbits); return (BadAlloc); } bzero ((char *) mskbits, nbytes_mono); @@ -1571,26 +1571,26 @@ ProcRenderCreateCursor (ClientPtr client) pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); if (!pFormat) { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); + free (argbbits); + free (srcbits); + free (mskbits); return (BadImplementation); } pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); if (!pPixmap) { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); + free (argbbits); + free (srcbits); + free (mskbits); return (BadAlloc); } pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0, client, &error); if (!pPicture) { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); + free (argbbits); + free (srcbits); + free (mskbits); return error; } (*pScreen->DestroyPixmap) (pPixmap); @@ -1674,7 +1674,7 @@ ProcRenderCreateCursor (ClientPtr client) } else { - xfree (argbbits); + free (argbbits); argbbits = 0; } @@ -1819,7 +1819,7 @@ ProcRenderQueryFilters (ClientPtr client) swapl(&reply->numFilters, n); } WriteToClient(client, total_bytes, (char *) reply); - xfree (reply); + free (reply); return(client->noClientException); } @@ -1873,7 +1873,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) RT_CURSOR, SecurityReadAccess); if (!cursors[i]) { - xfree (cursors); + free (cursors); client->errorValue = elt->cursor; return BadCursor; } @@ -1881,7 +1881,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) elt++; } ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor); - xfree (cursors); + free (cursors); if (ret != Success) return ret; @@ -2707,7 +2707,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) if (result == Success) AddResource(newPict->info[0].id, XRT_PICTURE, newPict); else - xfree(newPict); + free(newPict); return (result); } diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index acdd9cf2e..6618dd45a 100755 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -124,7 +124,7 @@ CursorCloseScreen (int index, ScreenPtr pScreen) Unwrap (cs, pScreen, CloseScreen); Unwrap (cs, pScreen, DisplayCursor); ret = (*pScreen->CloseScreen) (index, pScreen); - xfree (cs); + free (cs); if (index == 0) CursorScreenPrivateIndex = -1; return ret; @@ -174,7 +174,7 @@ XFixesSelectCursorInput (ClientPtr pClient, if (!AddResource (pWindow->drawable.id, CursorWindowType, (void *) pWindow)) { - xfree (e); + free (e); return BadAlloc; } @@ -346,7 +346,7 @@ ProcXFixesGetCursorImage (ClientPtr client) } (void) WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + (npixels << 2), (char *) rep); - xfree (rep); + free (rep); return client->noClientException; } @@ -502,7 +502,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) } (void) WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + (npixels << 2) + nbytesRound, (char *) rep); - xfree (rep); + free (rep); return client->noClientException; } @@ -699,7 +699,7 @@ CursorFreeClient (void * data, XID id) if (e == old) { *prev = e->next; - xfree (e); + free (e); break; } } diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 0b1865cf0..ba840f4b3 100755 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -608,7 +608,7 @@ ProcXFixesFetchRegion (ClientPtr client) } (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) + nBox * sizeof (xRectangle), (char *) reply); - xfree (reply); + free (reply); return (client->noClientException); } diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c index 464979165..4abad3f19 100755 --- a/nx-X11/programs/Xserver/xfixes/select.c +++ b/nx-X11/programs/Xserver/xfixes/select.c @@ -174,7 +174,7 @@ XFixesSelectSelectionInput (ClientPtr pClient, if (!AddResource (pWindow->drawable.id, SelectionWindowType, (void *) pWindow)) { - xfree (e); + free (e); return BadAlloc; } @@ -250,7 +250,7 @@ SelectionFreeClient (void * data, XID id) if (e == old) { *prev = e->next; - xfree (e); + free (e); CheckSelectionCallback (); break; } diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c index 3dfb85644..2b8f90bad 100644 --- a/nx-X11/programs/Xserver/xkb/ddxList.c +++ b/nx-X11/programs/Xserver/xkb/ddxList.c @@ -169,7 +169,7 @@ char tmpname[PATH_MAX]; if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) { buf = Xprintf("%s/%s.dir",XkbBaseDirectory,componentDirs[what]); in= fopen(buf,"r"); - xfree (buf); + free (buf); buf = NULL; } if (!in) { @@ -186,7 +186,7 @@ char tmpname[PATH_MAX]; if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) { buf = Xprintf("%s.dir",componentDirs[what]); in= fopen(buf,"r"); - xfree (buf); + free (buf); buf = NULL; } if (!in) { @@ -217,7 +217,7 @@ char tmpname[PATH_MAX]; if (!in) { if (buf != NULL) - xfree (buf); + free (buf); #ifdef WIN32 unlink(tmpname); #endif @@ -277,7 +277,7 @@ char tmpname[PATH_MAX]; unlink(tmpname); #endif if (buf != NULL) - xfree (buf); + free (buf); return status; } diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c index b3ef60f22..9134e4754 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c +++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c @@ -151,7 +151,7 @@ Win32System(const char *cmdline) LocalFree(buffer); } - xfree(cmd); + free(cmd); return -1; } /* Wait until child process exits. */ @@ -162,7 +162,7 @@ Win32System(const char *cmdline) /* Close process and thread handles. */ CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); - xfree(cmd); + free(cmd); return dwExitCode; } @@ -620,7 +620,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; if (outFile!=NULL) _XkbFree(outFile); if (cmd!=NULL) - xfree(cmd); + free(cmd); return True; } #ifdef DEBUG @@ -629,7 +629,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; if (outFile!=NULL) _XkbFree(outFile); if (cmd!=NULL) - xfree(cmd); + free(cmd); return False; } @@ -802,7 +802,7 @@ char tmpname[PATH_MAX]; } #endif if (buf != NULL) - xfree (buf); + free (buf); return True; } #ifdef DEBUG @@ -826,7 +826,7 @@ char tmpname[PATH_MAX]; if (nameRtrn) nameRtrn[0]= '\0'; if (buf != NULL) - xfree (buf); + free (buf); return False; } diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 20aab8ef0..7085fbfe4 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -4823,16 +4823,16 @@ char * wire; return status; status = _GetCountedString(&wire, client, &val); if (status != Success) { - xfree(name); + free(name); return status; } if (XkbAddGeomProperty(geom,name,val)==NULL) { - xfree(name); - xfree(val); + free(name); + free(val); return BadAlloc; } - xfree(name); - xfree(val); + free(name); + free(val); } if (req->nColors<2) { @@ -4860,10 +4860,10 @@ char * wire; if (status != Success) return status; if (!XkbAddGeomColor(geom,name,geom->num_colors)) { - xfree(name); + free(name); return BadAlloc; } - xfree(name); + free(name); } if (req->nColors!=geom->num_colors) { client->errorValue= _XkbErrCode3(0x05,req->nColors,geom->num_colors); -- cgit v1.2.3 From 2646fc254e75c4a7fc10d03d1139d0bd708ceae9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 01:51:18 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}alloc() macros, use malloc() instead. --- nx-X11/config/cf/X11.tmpl | 9 - nx-X11/config/cf/host.def | 6 - nx-X11/config/cf/lnxLib.rules | 11 - nx-X11/config/cf/xorg.cf | 4 - nx-X11/config/cf/xorgsite.def | 19 - nx-X11/include/Xthreads.h | 7 +- nx-X11/lib/xtrans/Xtrans.c | 20 +- nx-X11/lib/xtrans/Xtransdnet.c | 4 +- nx-X11/lib/xtrans/Xtranslcl.c | 24 +- nx-X11/lib/xtrans/Xtransos2.c | 16 +- nx-X11/lib/xtrans/Xtranssock.c | 14 +- nx-X11/lib/xtrans/Xtranstli.c | 6 +- nx-X11/lib/xtrans/Xtransutil.c | 10 +- nx-X11/lib/xtrans/transport.c | 1 - nx-X11/programs/Xserver/GL/glx/glxcmds.c | 2 +- nx-X11/programs/Xserver/GL/glx/glximports.c | 6 +- nx-X11/programs/Xserver/GL/glx/glxutil.c | 6 +- nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c | 2 +- nx-X11/programs/Xserver/Xext/extmod/modinit.c | 2 +- nx-X11/programs/Xserver/Xext/panoramiX.c | 12 +- nx-X11/programs/Xserver/Xext/panoramiXprocs.c | 12 +- nx-X11/programs/Xserver/Xext/saver.c | 4 +- nx-X11/programs/Xserver/Xext/security.c | 8 +- nx-X11/programs/Xserver/Xext/shape.c | 4 +- nx-X11/programs/Xserver/Xext/shm.c | 4 +- nx-X11/programs/Xserver/Xext/sleepuntil.c | 2 +- nx-X11/programs/Xserver/Xext/sync.c | 12 +- nx-X11/programs/Xserver/Xext/xcmisc.c | 2 +- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 2 +- nx-X11/programs/Xserver/Xext/xvdisp.c | 4 +- nx-X11/programs/Xserver/Xext/xvmain.c | 8 +- nx-X11/programs/Xserver/Xext/xvmc.c | 8 +- nx-X11/programs/Xserver/Xi/exevents.c | 10 +- nx-X11/programs/Xserver/Xi/extinit.c | 2 +- nx-X11/programs/Xserver/Xi/getdctl.c | 2 +- nx-X11/programs/Xserver/Xi/getfctl.c | 2 +- nx-X11/programs/Xserver/Xi/getprop.c | 2 +- nx-X11/programs/Xserver/Xi/getselev.c | 2 +- nx-X11/programs/Xserver/Xi/queryst.c | 2 +- nx-X11/programs/Xserver/composite/compalloc.c | 8 +- nx-X11/programs/Xserver/composite/compinit.c | 2 +- nx-X11/programs/Xserver/damageext/damageext.c | 2 +- nx-X11/programs/Xserver/dbe/dbe.c | 8 +- nx-X11/programs/Xserver/dbe/midbe.c | 2 +- nx-X11/programs/Xserver/dix/atom.c | 6 +- nx-X11/programs/Xserver/dix/colormap.c | 16 +- nx-X11/programs/Xserver/dix/cursor.c | 14 +- nx-X11/programs/Xserver/dix/devices.c | 36 +- nx-X11/programs/Xserver/dix/dispatch.c | 10 +- nx-X11/programs/Xserver/dix/dixfonts.c | 36 +- nx-X11/programs/Xserver/dix/dixutils.c | 8 +- nx-X11/programs/Xserver/dix/events.c | 6 +- nx-X11/programs/Xserver/dix/extension.c | 8 +- nx-X11/programs/Xserver/dix/gc.c | 12 +- nx-X11/programs/Xserver/dix/glyphcurs.c | 2 +- nx-X11/programs/Xserver/dix/grabs.c | 4 +- nx-X11/programs/Xserver/dix/main.c | 6 +- nx-X11/programs/Xserver/dix/pixmap.c | 4 +- nx-X11/programs/Xserver/dix/property.c | 6 +- nx-X11/programs/Xserver/dix/region.c | 14 +- nx-X11/programs/Xserver/dix/resource.c | 10 +- nx-X11/programs/Xserver/dix/window.c | 10 +- nx-X11/programs/Xserver/fb/fballpriv.c | 2 +- nx-X11/programs/Xserver/fb/fbcmap.c | 8 +- nx-X11/programs/Xserver/fb/fbcopy.c | 2 +- nx-X11/programs/Xserver/fb/fboverlay.c | 2 +- nx-X11/programs/Xserver/fb/fbpseudocolor.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 16 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Font.c | 14 +- nx-X11/programs/Xserver/hw/nxagent/GC.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 28 +- nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 16 +- nx-X11/programs/Xserver/hw/nxagent/NXresource.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 24 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 32 +- nx-X11/programs/Xserver/include/os.h | 2 +- nx-X11/programs/Xserver/mi/miarc.c | 16 +- nx-X11/programs/Xserver/mi/mibitblt.c | 4 +- nx-X11/programs/Xserver/mi/mibstore.c | 6 +- nx-X11/programs/Xserver/mi/micmap.c | 10 +- nx-X11/programs/Xserver/mi/midispcur.c | 4 +- nx-X11/programs/Xserver/mi/migc.c | 2 +- nx-X11/programs/Xserver/mi/mioverlay.c | 2 +- nx-X11/programs/Xserver/mi/mipointer.c | 2 +- nx-X11/programs/Xserver/mi/mipolyutil.c | 2 +- nx-X11/programs/Xserver/mi/mipushpxl.c | 2 +- nx-X11/programs/Xserver/mi/miscrinit.c | 2 +- nx-X11/programs/Xserver/mi/mispans.c | 8 +- nx-X11/programs/Xserver/mi/misprite.c | 2 +- nx-X11/programs/Xserver/mi/miwideline.c | 12 +- nx-X11/programs/Xserver/miext/cw/cw.c | 2 +- nx-X11/programs/Xserver/miext/cw/cw_render.c | 2 +- nx-X11/programs/Xserver/miext/damage/damage.c | 4 +- nx-X11/programs/Xserver/os/Imakefile | 17 +- nx-X11/programs/Xserver/os/WaitFor.c | 2 +- nx-X11/programs/Xserver/os/access.c | 12 +- nx-X11/programs/Xserver/os/connection.c | 6 +- nx-X11/programs/Xserver/os/io.c | 8 +- nx-X11/programs/Xserver/os/log.c | 4 +- nx-X11/programs/Xserver/os/mitauth.c | 4 +- nx-X11/programs/Xserver/os/oscolor.c | 6 +- nx-X11/programs/Xserver/os/rpcauth.c | 4 +- nx-X11/programs/Xserver/os/utils.c | 18 +- nx-X11/programs/Xserver/os/xalloc.c | 817 --------------------- nx-X11/programs/Xserver/os/xdmauth.c | 8 +- nx-X11/programs/Xserver/os/xdmcp.c | 6 +- nx-X11/programs/Xserver/os/xprintf.c | 4 +- nx-X11/programs/Xserver/randr/rrcrtc.c | 14 +- nx-X11/programs/Xserver/randr/rrdispatch.c | 4 +- nx-X11/programs/Xserver/randr/rrinfo.c | 2 +- nx-X11/programs/Xserver/randr/rrmode.c | 6 +- nx-X11/programs/Xserver/randr/rrmonitor.c | 2 +- nx-X11/programs/Xserver/randr/rroutput.c | 14 +- nx-X11/programs/Xserver/randr/rrproperty.c | 12 +- nx-X11/programs/Xserver/randr/rrprovider.c | 4 +- nx-X11/programs/Xserver/randr/rrproviderproperty.c | 12 +- nx-X11/programs/Xserver/randr/rrscreen.c | 8 +- nx-X11/programs/Xserver/randr/rrtransform.c | 2 +- nx-X11/programs/Xserver/record/record.c | 14 +- nx-X11/programs/Xserver/record/set.c | 5 +- nx-X11/programs/Xserver/render/animcur.c | 4 +- nx-X11/programs/Xserver/render/filter.c | 10 +- nx-X11/programs/Xserver/render/glyph.c | 8 +- nx-X11/programs/Xserver/render/miindex.c | 4 +- nx-X11/programs/Xserver/render/picture.c | 20 +- nx-X11/programs/Xserver/render/render.c | 18 +- nx-X11/programs/Xserver/xfixes/cursor.c | 8 +- nx-X11/programs/Xserver/xfixes/region.c | 4 +- nx-X11/programs/Xserver/xfixes/select.c | 2 +- nx-X11/programs/Xserver/xkb/xkbActions.c | 2 +- 148 files changed, 513 insertions(+), 1403 deletions(-) delete mode 100644 nx-X11/programs/Xserver/os/xalloc.c (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/config/cf/X11.tmpl b/nx-X11/config/cf/X11.tmpl index a6c410512..2b43ca562 100644 --- a/nx-X11/config/cf/X11.tmpl +++ b/nx-X11/config/cf/X11.tmpl @@ -336,15 +336,6 @@ XORGRELSTRING = XorgManVersionString #ifndef UseMemLeak #define UseMemLeak NO #endif -#ifndef SpecialMalloc -#define SpecialMalloc NO -#endif -#ifndef UseInternalMalloc -#define UseInternalMalloc NO -#endif -#ifndef XallocDefines -#define XallocDefines /**/ -#endif #ifndef ServerErrorDefines #define ServerErrorDefines /**/ #endif diff --git a/nx-X11/config/cf/host.def b/nx-X11/config/cf/host.def index 76f2f6e8b..bc25ca9ff 100644 --- a/nx-X11/config/cf/host.def +++ b/nx-X11/config/cf/host.def @@ -290,12 +290,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define GnuMallocLibrary -L/usr/local/lib -lgmalloc */ -/* - * To enable the internal Xserver malloc, uncomment this - * -#define UseInternalMalloc YES - */ - /* * Some Linux releases don't have a libtermcap. In this case you may need * to uncomment the following diff --git a/nx-X11/config/cf/lnxLib.rules b/nx-X11/config/cf/lnxLib.rules index f6f5f8d0b..b8a67e2b7 100644 --- a/nx-X11/config/cf/lnxLib.rules +++ b/nx-X11/config/cf/lnxLib.rules @@ -17,17 +17,6 @@ XCOMM $XFree86: xc/config/cf/lnxLib.rules,v 3.52 2003/10/31 20:49:03 herrb Exp $ #if UseElfFormat -# if (LinuxCLibMajorVersion >= 5 && LinuxCLibMinorVersion >= 4) || LinuxCLibMajorVersion >= 6 -# ifndef SpecialMalloc -# define SpecialMalloc NO -# endif -#if 0 -# ifndef UseInternalMalloc -# define UseInternalMalloc NO -# endif -#endif -# endif - # if LinuxCLibMajorVersion <= 5 /* * #define BaseShLibReqs -lc diff --git a/nx-X11/config/cf/xorg.cf b/nx-X11/config/cf/xorg.cf index 54ca00bc5..3a391b152 100644 --- a/nx-X11/config/cf/xorg.cf +++ b/nx-X11/config/cf/xorg.cf @@ -512,10 +512,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 # endif #endif -#ifndef UseInternalMalloc -# define UseInternalMalloc NO -#endif - #ifndef HasDlsymBug # define HasDlsymBug NO #endif diff --git a/nx-X11/config/cf/xorgsite.def b/nx-X11/config/cf/xorgsite.def index 8a0c805c2..86b6abdbc 100644 --- a/nx-X11/config/cf/xorgsite.def +++ b/nx-X11/config/cf/xorgsite.def @@ -162,25 +162,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ #define LinuxClibMinorVersion 4 */ -/* - * If you want to use the GNU malloc library, uncomment this - * -#define UseGnuMalloc YES - */ - -/* - * Set this to whatever is required to access the GNU malloc library. - * The default is '-lgmalloc' unless is specified in the OS's .cf file. - * -#define GnuMallocLibrary -L/usr/local/lib -lgmalloc - */ - -/* - * To enable the internal Xserver malloc, uncomment this - * -#define UseInternalMalloc YES - */ - /* * Some Linux releases don't have a libtermcap. In this case you may need * to uncomment the following diff --git a/nx-X11/include/Xthreads.h b/nx-X11/include/Xthreads.h index 97fda5948..b0ec7df32 100644 --- a/nx-X11/include/Xthreads.h +++ b/nx-X11/include/Xthreads.h @@ -33,9 +33,6 @@ in this Software without prior written authorization from The Open Group. /* Redefine these to XtMalloc/XtFree or whatever you want before including * this header file. */ -#ifndef xmalloc -#define xmalloc malloc -#endif #ifdef CTHREADS #include @@ -279,13 +276,13 @@ static xthread_t _X_no_thread_id; typedef xcondition_rec *xcondition_t; typedef xmutex_rec *xmutex_t; #ifndef xcondition_malloc -#define xcondition_malloc() (xcondition_t)xmalloc(sizeof(xcondition_rec)) +#define xcondition_malloc() (xcondition_t)malloc(sizeof(xcondition_rec)) #endif #ifndef xcondition_free #define xcondition_free(c) free((char *)c) #endif #ifndef xmutex_malloc -#define xmutex_malloc() (xmutex_t)xmalloc(sizeof(xmutex_rec)) +#define xmutex_malloc() (xmutex_t)malloc(sizeof(xmutex_rec)) #endif #ifndef xmutex_free #define xmutex_free(m) free((char *)m) diff --git a/nx-X11/lib/xtrans/Xtrans.c b/nx-X11/lib/xtrans/Xtrans.c index f1e5ff966..934335269 100644 --- a/nx-X11/lib/xtrans/Xtrans.c +++ b/nx-X11/lib/xtrans/Xtrans.c @@ -221,7 +221,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) /* Copy the string so it can be changed */ - tmpptr = mybuf = (char *) xalloc (strlen (address) + 1); + tmpptr = mybuf = (char *) malloc (strlen (address) + 1); strcpy (mybuf, address); /* Parse the string to get each component */ @@ -362,7 +362,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) * string space for them. */ - if ((*protocol = (char *) xalloc(strlen (_protocol) + 1)) == NULL) + if ((*protocol = (char *) malloc(strlen (_protocol) + 1)) == NULL) { /* Malloc failed */ *port = NULL; @@ -374,7 +374,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) else strcpy (*protocol, _protocol); - if ((*host = (char *) xalloc (strlen (_host) + 1)) == NULL) + if ((*host = (char *) malloc (strlen (_host) + 1)) == NULL) { /* Malloc failed */ *port = NULL; @@ -387,7 +387,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) else strcpy (*host, _host); - if ((*port = (char *) xalloc (strlen (_port) + 1)) == NULL) + if ((*port = (char *) malloc (strlen (_port) + 1)) == NULL) { /* Malloc failed */ *port = NULL; @@ -539,7 +539,7 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port) return NULL; } - if ((save_port = (char *) xalloc (strlen (port) + 1)) == NULL) + if ((save_port = (char *) malloc (strlen (port) + 1)) == NULL) { PRMSG (1,"Reopen: Unable to malloc port string\n", 0, 0, 0); @@ -668,7 +668,7 @@ TRANS(GetReopenInfo) (XtransConnInfo ciptr, *trans_id = Xtransports[i].transport_id; *fd = ciptr->fd; - if ((*port = (char *) xalloc (strlen (ciptr->port) + 1)) == NULL) + if ((*port = (char *) malloc (strlen (ciptr->port) + 1)) == NULL) return 0; else { @@ -966,7 +966,7 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, *familyp = ciptr->family; *addrlenp = ciptr->addrlen; - if ((*addrp = (Xtransaddr *) xalloc (ciptr->addrlen)) == NULL) + if ((*addrp = (Xtransaddr *) malloc (ciptr->addrlen)) == NULL) { PRMSG (1,"GetMyAddr: malloc failed\n", 0, 0, 0); return -1; @@ -986,7 +986,7 @@ TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, *familyp = ciptr->family; *addrlenp = ciptr->peeraddrlen; - if ((*addrp = (Xtransaddr *) xalloc (ciptr->peeraddrlen)) == NULL) + if ((*addrp = (Xtransaddr *) malloc (ciptr->peeraddrlen)) == NULL) { PRMSG (1,"GetPeerAddr: malloc failed\n", 0, 0, 0); return -1; @@ -1141,7 +1141,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret, if (*count_ret > 0) { - if ((*ciptrs_ret = (XtransConnInfo *) xalloc ( + if ((*ciptrs_ret = (XtransConnInfo *) malloc ( *count_ret * sizeof (XtransConnInfo))) == NULL) { return -1; @@ -1239,7 +1239,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret, if (*count_ret > 0) { - if ((*ciptrs_ret = (XtransConnInfo *) xalloc ( + if ((*ciptrs_ret = (XtransConnInfo *) malloc ( *count_ret * sizeof (XtransConnInfo))) == NULL) { return -1; diff --git a/nx-X11/lib/xtrans/Xtransdnet.c b/nx-X11/lib/xtrans/Xtransdnet.c index 34e191260..161d48099 100644 --- a/nx-X11/lib/xtrans/Xtransdnet.c +++ b/nx-X11/lib/xtrans/Xtransdnet.c @@ -121,7 +121,7 @@ TRANS(DNETGetAddr) (XtransConnInfo ciptr) * Everything looks good: fill in the XtransConnInfo structure. */ - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "DNETGetAddr: Can't allocate space for the addr\n", 0, 0, 0); @@ -161,7 +161,7 @@ TRANS(DNETGetPeerAddr) (XtransConnInfo ciptr) * Everything looks good: fill in the XtransConnInfo structure. */ - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "DNETGetPeerAddr: Can't allocate space for the addr\n", diff --git a/nx-X11/lib/xtrans/Xtranslcl.c b/nx-X11/lib/xtrans/Xtranslcl.c index c1689c654..ebc8518ee 100644 --- a/nx-X11/lib/xtrans/Xtranslcl.c +++ b/nx-X11/lib/xtrans/Xtranslcl.c @@ -144,7 +144,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path) ciptr->family = AF_UNIX; ciptr->addrlen = sizeof (struct sockaddr_un); - if ((sunaddr = (struct sockaddr_un *) xalloc (ciptr->addrlen)) == NULL) + if ((sunaddr = (struct sockaddr_un *) malloc (ciptr->addrlen)) == NULL) { PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n", 0, 0, 0); return 0; @@ -165,7 +165,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path) ciptr->peeraddrlen = sizeof (struct sockaddr_un); - if ((p_sunaddr = (struct sockaddr_un *) xalloc ( + if ((p_sunaddr = (struct sockaddr_un *) malloc ( ciptr->peeraddrlen)) == NULL) { PRMSG(1, @@ -596,7 +596,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) */ newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) { + if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) { PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n", 0,0,0); close(newfd); @@ -607,7 +607,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); newciptr->peeraddrlen=sizeof(struct sockaddr_un); - if( (sunaddr=(struct sockaddr_un *)xalloc(newciptr->peeraddrlen)) == NULL ) { + if( (sunaddr=(struct sockaddr_un *)malloc(newciptr->peeraddrlen)) == NULL ) { PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n", 0,0,0); free(newciptr->addr); @@ -818,7 +818,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) */ newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) { + if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) { PRMSG(1, "NAMEDAccept: failed to allocate memory for peer addr\n", 0,0,0); @@ -830,7 +830,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); newciptr->peeraddrlen=newciptr->addrlen; - if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) { + if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) { PRMSG(1, "NAMEDAccept: failed to allocate memory for peer addr\n", 0,0,0); @@ -1162,7 +1162,7 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) */ newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) { + if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) { PRMSG(1, "ISCAccept: failed to allocate memory for peer addr\n", 0,0,0); @@ -1174,7 +1174,7 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); newciptr->peeraddrlen=newciptr->addrlen; - if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) { + if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) { PRMSG(1, "ISCAccept: failed to allocate memory for peer addr\n", 0,0,0); @@ -1436,7 +1436,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) */ newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) { + if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) { PRMSG(1, "SCOAccept: failed to allocate memory for peer addr\n", 0,0,0); @@ -1451,7 +1451,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) #endif newciptr->peeraddrlen=newciptr->addrlen; - if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) { + if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) { PRMSG(1, "SCOAccept: failed to allocate memory for peer addr\n", 0,0,0); @@ -1894,7 +1894,7 @@ TRANS(LocalInitTransports)(char *protocol) if( strcmp(protocol,"local") && strcmp(protocol,"LOCAL") ) { - workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (protocol) + 1); + workingXLOCAL=freeXLOCAL=(char *)malloc (strlen (protocol) + 1); if (workingXLOCAL) strcpy (workingXLOCAL, protocol); } @@ -1902,7 +1902,7 @@ TRANS(LocalInitTransports)(char *protocol) XLOCAL=(char *)getenv("XLOCAL"); if(XLOCAL==NULL) XLOCAL=DEF_XLOCAL; - workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (XLOCAL) + 1); + workingXLOCAL=freeXLOCAL=(char *)malloc (strlen (XLOCAL) + 1); if (workingXLOCAL) strcpy (workingXLOCAL, XLOCAL); } diff --git a/nx-X11/lib/xtrans/Xtransos2.c b/nx-X11/lib/xtrans/Xtransos2.c index 807a6029d..9fd5049a0 100644 --- a/nx-X11/lib/xtrans/Xtransos2.c +++ b/nx-X11/lib/xtrans/Xtransos2.c @@ -202,7 +202,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, } namelen=sizeof(struct sockaddr); - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2OpenClient: Can't allocate space for the addr\n", 0, 0, 0); @@ -214,7 +214,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, ((struct sockaddr *)ciptr->addr)->sa_family = AF_UNIX; strcpy(((struct sockaddr *)ciptr->addr)->sa_data, "local"); - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2OpenCLient: Can't allocate space for the addr\n", 0, 0, 0); @@ -316,7 +316,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, /*** Put in info ***/ namelen=sizeof(struct sockaddr); - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n", 0, 0, 0); @@ -328,7 +328,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, ((struct sockaddr *)ciptr->addr)->sa_family = AF_UNIX; strcpy (((struct sockaddr *)ciptr->addr)->sa_data, "local"); - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n", 0, 0, 0); @@ -441,7 +441,7 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port) strcpy(addr_name,"local"); namelen=sizeof(addr_name); - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n", 0, 0, 0); @@ -451,7 +451,7 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port) ciptr->addrlen = namelen; memcpy (ciptr->addr, addr_name, ciptr->addrlen); - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n", 0, 0, 0); @@ -605,7 +605,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) /* And finally fill-in info in newciptr */ namelen=sizeof(struct sockaddr); - if ((newciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((newciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2Accept: Can't allocate space for the addr\n", 0, 0, 0); @@ -618,7 +618,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) ((struct sockaddr *)newciptr->addr)->sa_family = AF_UNIX; strcpy (((struct sockaddr *)newciptr->addr)->sa_data, "local"); - if ((newciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((newciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2Accept: Can't allocate space for the addr\n", 0, 0, 0); diff --git a/nx-X11/lib/xtrans/Xtranssock.c b/nx-X11/lib/xtrans/Xtranssock.c index 6a6600435..79b95efdc 100644 --- a/nx-X11/lib/xtrans/Xtranssock.c +++ b/nx-X11/lib/xtrans/Xtranssock.c @@ -957,7 +957,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr) * Everything looks good: fill in the XtransConnInfo structure. */ - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "SocketINETGetAddr: Can't allocate space for the addr\n", @@ -1032,7 +1032,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr) * Everything looks good: fill in the XtransConnInfo structure. */ - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "SocketINETGetPeerAddr: Can't allocate space for the addr\n", @@ -1834,7 +1834,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port, namelen = sizeof (sockname); /* this will always make it the same size */ - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "SocketUNIXCreateListener: Can't allocate space for the addr\n", @@ -2058,7 +2058,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) * since this is unix domain. */ - if ((newciptr->addr = (char *) xalloc (ciptr->addrlen)) == NULL) + if ((newciptr->addr = (char *) malloc (ciptr->addrlen)) == NULL) { PRMSG (1, "SocketUNIXAccept: Can't allocate space for the addr\n", @@ -2078,7 +2078,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) newciptr->addrlen = ciptr->addrlen; memcpy (newciptr->addr, ciptr->addr, newciptr->addrlen); - if ((newciptr->peeraddr = (char *) xalloc (ciptr->addrlen)) == NULL) + if ((newciptr->peeraddr = (char *) malloc (ciptr->addrlen)) == NULL) { PRMSG (1, "SocketUNIXAccept: Can't allocate space for the addr\n", @@ -2827,8 +2827,8 @@ SocketUNIXConnectPost: * since this is unix domain. */ - if ((ciptr->addr = (char *) xalloc(namelen)) == NULL || - (ciptr->peeraddr = (char *) xalloc(namelen)) == NULL) + if ((ciptr->addr = (char *) malloc(namelen)) == NULL || + (ciptr->peeraddr = (char *) malloc(namelen)) == NULL) { PRMSG (1, "SocketUNIXCreateListener: Can't allocate space for the addr\n", diff --git a/nx-X11/lib/xtrans/Xtranstli.c b/nx-X11/lib/xtrans/Xtranstli.c index ab37275dd..521f6a48c 100644 --- a/nx-X11/lib/xtrans/Xtranstli.c +++ b/nx-X11/lib/xtrans/Xtranstli.c @@ -173,7 +173,7 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr) if( ciptr->addr ) free(ciptr->addr); - if( (ciptr->addr=(char *)xalloc(netbuf.len)) == NULL ) + if( (ciptr->addr=(char *)malloc(netbuf.len)) == NULL ) { PRMSG(1, "TLIGetAddr: Can't allocate space for the addr\n", 0,0,0); @@ -223,7 +223,7 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr) if( ciptr->peeraddr ) free(ciptr->peeraddr); - if( (ciptr->peeraddr=(char *)xalloc(netbuf.len)) == NULL ) + if( (ciptr->peeraddr=(char *)malloc(netbuf.len)) == NULL ) { PRMSG(1, "TLIGetPeerAddr: Can't allocate space for the addr\n", @@ -730,7 +730,7 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req) * Everything looks good: fill in the XtransConnInfo structure. */ - if( (ciptr->addr=(char *)xalloc(ret->addr.len)) == NULL ) + if( (ciptr->addr=(char *)malloc(ret->addr.len)) == NULL ) { PRMSG(1, "TLICreateListener: Unable to allocate space for the address\n", diff --git a/nx-X11/lib/xtrans/Xtransutil.c b/nx-X11/lib/xtrans/Xtransutil.c index 7dc91b16c..cfe925edf 100644 --- a/nx-X11/lib/xtrans/Xtransutil.c +++ b/nx-X11/lib/xtrans/Xtransutil.c @@ -215,7 +215,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) *addrp = NULL; } if (!*addrp) - *addrp = (Xtransaddr *) xalloc (len + 1); + *addrp = (Xtransaddr *) malloc (len + 1); if (*addrp) { strcpy ((char *) *addrp, hostnamebuf); *addrlenp = len; @@ -262,7 +262,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) case AF_UNIX: { struct sockaddr_un *saddr = (struct sockaddr_un *) addr; - networkId = (char *) xalloc (3 + strlen (transName) + + networkId = (char *) malloc (3 + strlen (transName) + strlen (hostnamebuf) + strlen (saddr->sun_path)); sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, saddr->sun_path); @@ -292,7 +292,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) portnum = ntohs (saddr->sin_port); sprintf (portnumbuf, "%d", portnum); - networkId = (char *) xalloc (3 + strlen (transName) + + networkId = (char *) malloc (3 + strlen (transName) + strlen (hostnamebuf) + strlen (portnumbuf)); sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, portnumbuf); break; @@ -304,7 +304,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) { struct sockaddr_dn *saddr = (struct sockaddr_dn *) addr; - networkId = (char *) xalloc ( + networkId = (char *) malloc ( 13 + strlen (hostnamebuf) + saddr->sdn_objnamel); sprintf (networkId, "dnet/%s::%s", hostnamebuf, saddr->sdn_objname); @@ -453,7 +453,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr) } - hostname = (char *) xalloc ( + hostname = (char *) malloc ( strlen (ciptr->transptr->TransName) + strlen (addr) + 2); strcpy (hostname, ciptr->transptr->TransName); strcat (hostname, "/"); diff --git a/nx-X11/lib/xtrans/transport.c b/nx-X11/lib/xtrans/transport.c index 49441d76e..8d3516dba 100644 --- a/nx-X11/lib/xtrans/transport.c +++ b/nx-X11/lib/xtrans/transport.c @@ -59,7 +59,6 @@ from The Open Group. #include "os.h" #else #include -#define xalloc(_size) malloc(_size) #define xcalloc(_num,_size) calloc(_num,_size) #define xrealloc(_ptr,_size) realloc(_ptr,_size) #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index c62585507..7d8fbe81f 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -2138,7 +2138,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc) reply.length = length; reply.n = n; - if ((buf = (char *) Xalloc(length << 2)) == NULL) { + if ((buf = (char *) malloc(length << 2)) == NULL) { return BadAlloc; } __glXStrncpy(buf, ptr, n); diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.c b/nx-X11/programs/Xserver/GL/glx/glximports.c index 5b6c545fc..b1245f900 100644 --- a/nx-X11/programs/Xserver/GL/glx/glximports.c +++ b/nx-X11/programs/Xserver/GL/glx/glximports.c @@ -50,7 +50,7 @@ void *__glXImpMalloc(__GLcontext *gc, size_t size) if (size == 0) { return NULL; } - addr = xalloc(size); + addr = malloc(size); if (addr == NULL) { /* XXX: handle out of memory error */ return NULL; @@ -67,7 +67,7 @@ void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize) return NULL; } size = numElements * elementSize; - addr = xalloc(size); + addr = malloc(size); if (addr == NULL) { /* XXX: handle out of memory error */ return NULL; @@ -99,7 +99,7 @@ void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize) if (newSize == 0) { return NULL; } - newAddr = xalloc(newSize); + newAddr = malloc(newSize); } if (newAddr == NULL) { return NULL; /* XXX: out of memory error */ diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c index cf0aae011..715bb5c99 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxutil.c +++ b/nx-X11/programs/Xserver/GL/glx/glxutil.c @@ -68,7 +68,7 @@ __glXMalloc(size_t size) if (size == 0) { return NULL; } - addr = (void *) xalloc(size); + addr = (void *) malloc(size); if (addr == NULL) { /* XXX: handle out of memory error */ return NULL; @@ -86,7 +86,7 @@ __glXCalloc(size_t numElements, size_t elementSize) return NULL; } size = numElements * elementSize; - addr = (void *) xalloc(size); + addr = (void *) malloc(size); if (addr == NULL) { /* XXX: handle out of memory error */ return NULL; @@ -111,7 +111,7 @@ __glXRealloc(void *addr, size_t newSize) if (newSize == 0) { return NULL; } else { - newAddr = xalloc(newSize); + newAddr = malloc(newSize); } } if (newAddr == NULL) { diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c index 0a86bf208..057acb6d3 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c @@ -52,7 +52,7 @@ XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data { XMesaImage *image; - image = (XMesaImage *)xalloc(sizeof(XMesaImage)); + image = (XMesaImage *)malloc(sizeof(XMesaImage)); if (image) { image->width = width; diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.c b/nx-X11/programs/Xserver/Xext/extmod/modinit.c index 5bfd15719..5224a8ad9 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/modinit.c +++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.c @@ -161,7 +161,7 @@ extmodSetup(void * module, void * opts, int *errmaj, int *errmin) for (i = 0; extensionModules[i].name != NULL; i++) { if (opts) { char *s; - s = (char *)xalloc(strlen(extensionModules[i].name) + 5); + s = (char *)malloc(strlen(extensionModules[i].name) + 5); if (s) { void * o; strcpy(s, "omit"); diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index c3b47cf2c..ecf3453bb 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -420,7 +420,7 @@ XineramaRegisterConnectionBlockCallback(void (*func)(void)) { XineramaConnectionCallbackList *newlist; - if(!(newlist = xalloc(sizeof(XineramaConnectionCallbackList)))) + if(!(newlist = malloc(sizeof(XineramaConnectionCallbackList)))) return FALSE; newlist->next = ConnectionCallbackList; @@ -539,7 +539,7 @@ void PanoramiXExtensionInit(int argc, char *argv[]) return; } - pScreenPriv = xalloc(sizeof(PanoramiXScreenRec)); + pScreenPriv = malloc(sizeof(PanoramiXScreenRec)); pScreen->devPrivates[PanoramiXScreenIndex].ptr = (void *)pScreenPriv; if(!pScreenPriv) { @@ -805,7 +805,7 @@ void PanoramiXConsolidate(void) PanoramiXDepths[PanoramiXNumDepths].numVids = 0; if(pDepth->numVids) PanoramiXDepths[PanoramiXNumDepths].vids = - xalloc(sizeof(VisualID) * pDepth->numVids); + malloc(sizeof(VisualID) * pDepth->numVids); else PanoramiXDepths[PanoramiXNumDepths].vids = NULL; PanoramiXNumDepths++; @@ -887,11 +887,11 @@ void PanoramiXConsolidate(void) } - root = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)); + root = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)); root->type = XRT_WINDOW; - defmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)); + defmap = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)); defmap->type = XRT_COLORMAP; - saver = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)); + saver = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)); saver->type = XRT_WINDOW; diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c index 28c0eb8b0..9682f2427 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c @@ -130,7 +130,7 @@ int PanoramiXCreateWindow(ClientPtr client) } } - if(!(newWin = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) + if(!(newWin = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newWin->type = XRT_WINDOW; @@ -660,7 +660,7 @@ int PanoramiXCreatePixmap(ClientPtr client) client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess))) return BadDrawable; - if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) + if(!(newPix = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPix->type = XRT_PIXMAP; @@ -760,7 +760,7 @@ int PanoramiXCreateGC(ClientPtr client) } } - if(!(newGC = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) + if(!(newGC = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newGC->type = XRT_GC; @@ -1844,7 +1844,7 @@ int PanoramiXGetImage(ClientPtr client) linesPerBuf = h; } length = linesPerBuf * widthBytesLine; - if(!(pBuf = xalloc(length))) + if(!(pBuf = malloc(length))) return (BadAlloc); WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); @@ -2072,7 +2072,7 @@ int PanoramiXCreateColormap(ClientPtr client) if(!stuff->visual || (stuff->visual > 255)) return BadValue; - if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) + if(!(newCmap = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newCmap->type = XRT_COLORMAP; @@ -2141,7 +2141,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client) SecurityReadAccess | SecurityWriteAccess))) return BadColor; - if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) + if(!(newCmap = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newCmap->type = XRT_COLORMAP; diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 68dbe2fe8..f9a86899f 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -218,7 +218,7 @@ static int ScreenPrivateIndex; #define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (void *) v); #define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL) -#define New(t) ((t *) xalloc (sizeof (t))) +#define New(t) ((t *) malloc (sizeof (t))) /**************** * ScreenSaverExtensionInit @@ -939,7 +939,7 @@ ScreenSaverSetAttributes (ClientPtr client) goto bail; } /* over allocate for override redirect */ - values = (unsigned long *) xalloc ((len + 1) * sizeof (unsigned long)); + values = (unsigned long *) malloc ((len + 1) * sizeof (unsigned long)); if (!values) { ret = BadAlloc; diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index ceadd8f6a..ec5f371db 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -524,7 +524,7 @@ SecurityEventSelectForAuthorization( } } - pEventClient = (OtherClients *) xalloc(sizeof(OtherClients)); + pEventClient = (OtherClients *) malloc(sizeof(OtherClients)); if (!pEventClient) return BadAlloc; pEventClient->mask = mask; @@ -662,7 +662,7 @@ ProcSecurityGenerateAuthorization( /* associate additional information with this auth ID */ - pAuth = (SecurityAuthorizationPtr)xalloc(sizeof(SecurityAuthorizationRec)); + pAuth = (SecurityAuthorizationPtr)malloc(sizeof(SecurityAuthorizationRec)); if (!pAuth) { err = BadAlloc; @@ -1643,7 +1643,7 @@ SecurityParsePropertyAccessRule( */ if (mustHaveValue) size += strlen(mustHaveValue) + 1; - pacl = (PropertyAccessPtr)Xalloc(size); + pacl = (PropertyAccessPtr)malloc(size); if (!pacl) return FALSE; @@ -1716,7 +1716,7 @@ SecurityParseSitePolicy( if (!policyStr) return FALSE; - copyPolicyStr = (char *)Xalloc(strlen(policyStr) + 1); + copyPolicyStr = (char *)malloc(strlen(policyStr) + 1); if (!copyPolicyStr) return TRUE; strcpy(copyPolicyStr, policyStr); diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index a55dd4553..b929dded0 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -849,7 +849,7 @@ ProcShapeSelectInput (client) /* build the entry */ pNewShapeEvent = (ShapeEventPtr) - xalloc (sizeof (ShapeEventRec)); + malloc (sizeof (ShapeEventRec)); if (!pNewShapeEvent) return BadAlloc; pNewShapeEvent->next = 0; @@ -871,7 +871,7 @@ ProcShapeSelectInput (client) */ if (!pHead) { - pHead = (ShapeEventPtr *) xalloc (sizeof (ShapeEventPtr)); + pHead = (ShapeEventPtr *) malloc (sizeof (ShapeEventPtr)); if (!pHead || !AddResource (pWin->drawable.id, EventType, (void *)pHead)) { diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index 4e36a6bb4..af529e46f 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -439,7 +439,7 @@ ProcShmAttach(client) } else { - shmdesc = (ShmDescPtr) xalloc(sizeof(ShmDescRec)); + shmdesc = (ShmDescPtr) malloc(sizeof(ShmDescRec)); if (!shmdesc) return BadAlloc; shmdesc->addr = shmat(stuff->shmid, 0, @@ -779,7 +779,7 @@ CreatePmap: VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); - if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) + if(!(newPix = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPix->type = XRT_PIXMAP; diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.c b/nx-X11/programs/Xserver/Xext/sleepuntil.c index 368dc6b48..93d75a862 100644 --- a/nx-X11/programs/Xserver/Xext/sleepuntil.c +++ b/nx-X11/programs/Xserver/Xext/sleepuntil.c @@ -98,7 +98,7 @@ ClientSleepUntil (client, revive, notifyFunc, closure) SertafiedGeneration = serverGeneration; BlockHandlerRegistered = FALSE; } - pRequest = (SertafiedPtr) xalloc (sizeof (SertafiedRec)); + pRequest = (SertafiedPtr) malloc (sizeof (SertafiedRec)); if (!pRequest) return FALSE; pRequest->pClient = client; diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 8fe510497..88170169e 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -345,7 +345,7 @@ SyncAddTriggerToCounter(pTrigger) return Success; } - if (!(pCur = (SyncTriggerList *)xalloc(sizeof(SyncTriggerList)))) + if (!(pCur = (SyncTriggerList *)malloc(sizeof(SyncTriggerList)))) return BadAlloc; pCur->pTrigger = pTrigger; @@ -879,7 +879,7 @@ SyncEventSelectForAlarm(pAlarm, client, wantevents) /* add new client to pAlarm->pEventClients */ - pClients = (SyncAlarmClientList *) xalloc(sizeof(SyncAlarmClientList)); + pClients = (SyncAlarmClientList *) malloc(sizeof(SyncAlarmClientList)); if (!pClients) return BadAlloc; @@ -1014,7 +1014,7 @@ SyncCreateCounter(client, id, initialvalue) { SyncCounter *pCounter; - if (!(pCounter = (SyncCounter *) xalloc(sizeof(SyncCounter)))) + if (!(pCounter = (SyncCounter *) malloc(sizeof(SyncCounter)))) return (SyncCounter *)NULL; if (!AddResource(id, RTCounter, (void *) pCounter)) @@ -1081,7 +1081,7 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, { SysCounterInfo *psci; - psci = (SysCounterInfo *)xalloc(sizeof(SysCounterInfo)); + psci = (SysCounterInfo *)malloc(sizeof(SysCounterInfo)); if (!psci) { FreeResource(pCounter->id, RT_NONE); @@ -1670,7 +1670,7 @@ ProcSyncAwait(client) /* all the memory for the entire await list is allocated * here in one chunk */ - pAwaitUnion = (SyncAwaitUnion *)xalloc((items+1) * sizeof(SyncAwaitUnion)); + pAwaitUnion = (SyncAwaitUnion *)malloc((items+1) * sizeof(SyncAwaitUnion)); if (!pAwaitUnion) return BadAlloc; @@ -1821,7 +1821,7 @@ ProcSyncCreateAlarm(client) if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta)))) return BadLength; - if (!(pAlarm = (SyncAlarm *) xalloc(sizeof(SyncAlarm)))) + if (!(pAlarm = (SyncAlarm *) malloc(sizeof(SyncAlarm)))) { return BadAlloc; } diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c index 8f381cee5..7021ed47e 100644 --- a/nx-X11/programs/Xserver/Xext/xcmisc.c +++ b/nx-X11/programs/Xserver/Xext/xcmisc.c @@ -154,7 +154,7 @@ ProcXCMiscGetXIDList(client) if (stuff->count > UINT32_MAX / sizeof(XID)) return BadAlloc; - pids = (XID *)Xalloc(stuff->count * sizeof(XID)); + pids = (XID *)malloc(stuff->count * sizeof(XID)); if (!pids) { return BadAlloc; diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index 7bdda72b4..a89005cde 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -248,7 +248,7 @@ shmalloc( if (size < 3500) return (ShmDescPtr) NULL; - pDesc = (ShmDescRec *) xalloc(sizeof(ShmDescRec)); + pDesc = (ShmDescRec *) malloc(sizeof(ShmDescRec)); if (!pDesc) return (ShmDescPtr) NULL; diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c index b300a32d5..e9250427d 100644 --- a/nx-X11/programs/Xserver/Xext/xvdisp.c +++ b/nx-X11/programs/Xserver/Xext/xvdisp.c @@ -1258,7 +1258,7 @@ ProcXvQueryImageAttributes(ClientPtr client) num_planes = pImage->num_planes; - if(!(offsets = xalloc(num_planes << 3))) + if(!(offsets = malloc(num_planes << 3))) return BadAlloc; pitches = offsets + num_planes; @@ -2223,7 +2223,7 @@ void XineramifyXv(void) /* now create a resource for each port */ for(j = 0; j < refAdapt->nPorts; j++) { - if(!(port = xalloc(sizeof(PanoramiXRes)))) + if(!(port = malloc(sizeof(PanoramiXRes)))) break; port->info[0].id = MatchingAdaptors[0]->base_id + j; AddResource(port->info[0].id, XvXRTPort, port); diff --git a/nx-X11/programs/Xserver/Xext/xvmain.c b/nx-X11/programs/Xserver/Xext/xvmain.c index d2c21b13f..8a279ac1e 100644 --- a/nx-X11/programs/Xserver/Xext/xvmain.c +++ b/nx-X11/programs/Xserver/Xext/xvmain.c @@ -288,7 +288,7 @@ XvScreenInit(ScreenPtr pScreen) /* ALLOCATE SCREEN PRIVATE RECORD */ - pxvs = (XvScreenPtr) xalloc (sizeof (XvScreenRec)); + pxvs = (XvScreenPtr) malloc (sizeof (XvScreenRec)); if (!pxvs) { ErrorF("XvScreenInit: Unable to allocate screen private structure\n"); @@ -941,7 +941,7 @@ XvdiSelectVideoNotify( if (!pn) { - if (!(tpn = (XvVideoNotifyPtr)xalloc(sizeof(XvVideoNotifyRec)))) + if (!(tpn = (XvVideoNotifyPtr)malloc(sizeof(XvVideoNotifyRec)))) return BadAlloc; tpn->next = (XvVideoNotifyPtr)NULL; if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn)) @@ -979,7 +979,7 @@ XvdiSelectVideoNotify( } else { - if (!(tpn = (XvVideoNotifyPtr)xalloc(sizeof(XvVideoNotifyRec)))) + if (!(tpn = (XvVideoNotifyPtr)malloc(sizeof(XvVideoNotifyRec)))) return BadAlloc; tpn->next = pn->next; pn->next = tpn; @@ -1037,7 +1037,7 @@ XvdiSelectPortNotify( if (!tpn) { - if (!(tpn = (XvPortNotifyPtr)xalloc(sizeof(XvPortNotifyRec)))) + if (!(tpn = (XvPortNotifyPtr)malloc(sizeof(XvPortNotifyRec)))) return BadAlloc; tpn->next = pPort->pNotify; pPort->pNotify = tpn; diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c index 0ec04f3e3..bce7fbf7a 100644 --- a/nx-X11/programs/Xserver/Xext/xvmc.c +++ b/nx-X11/programs/Xserver/Xext/xvmc.c @@ -242,7 +242,7 @@ ProcXvMCCreateContext(ClientPtr client) (stuff->height > surface->max_height)) return BadValue; - if(!(pContext = xalloc(sizeof(XvMCContextRec)))) { + if(!(pContext = malloc(sizeof(XvMCContextRec)))) { return BadAlloc; } @@ -313,7 +313,7 @@ ProcXvMCCreateSurface(ClientPtr client) pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); - if(!(pSurface = xalloc(sizeof(XvMCSurfaceRec)))) + if(!(pSurface = malloc(sizeof(XvMCSurfaceRec)))) return BadAlloc; pSurface->surface_id = stuff->surface_id; @@ -408,7 +408,7 @@ ProcXvMCCreateSubpicture(ClientPtr client) (stuff->height > surface->subpicture_max_height)) return BadValue; - if(!(pSubpicture = xalloc(sizeof(XvMCSubpictureRec)))) + if(!(pSubpicture = malloc(sizeof(XvMCSubpictureRec)))) return BadAlloc; pSubpicture->subpicture_id = stuff->subpicture_id; @@ -726,7 +726,7 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt) XvMCGeneration = serverGeneration; } - if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec)))) + if(!(pScreenPriv = (XvMCScreenPtr)malloc(sizeof(XvMCScreenRec)))) return BadAlloc; pScreen->devPrivates[XvMCScreenIndex].ptr = (void *)pScreenPriv; diff --git a/nx-X11/programs/Xserver/Xi/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c index 1612047bb..85abd4fee 100644 --- a/nx-X11/programs/Xserver/Xi/exevents.c +++ b/nx-X11/programs/Xserver/Xi/exevents.c @@ -302,7 +302,7 @@ InitProximityClassDeviceStruct( DeviceIntPtr dev) { register ProximityClassPtr proxc; - proxc = (ProximityClassPtr)xalloc(sizeof(ProximityClassRec)); + proxc = (ProximityClassPtr)malloc(sizeof(ProximityClassRec)); if (!proxc) return FALSE; dev->proximity = proxc; @@ -460,7 +460,7 @@ DeviceFocusEvent(dev, type, mode, detail, pWin) } } - sev = ev = (deviceStateNotify *) xalloc(evcount * sizeof(xEvent)); + sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent)); FixDeviceStateNotify (dev, ev, NULL, NULL, NULL, first); if (b != NULL) { @@ -741,7 +741,7 @@ AddExtensionClient (pWin, client, mask, mskidx) if (!pWin->optional && !MakeWindowOptional (pWin)) return BadAlloc; - others = (InputClients *) xalloc(sizeof(InputClients)); + others = (InputClients *) malloc(sizeof(InputClients)); if (!others) return BadAlloc; if (!pWin->optional->inputMasks && !MakeInputMasks (pWin)) @@ -763,7 +763,7 @@ MakeInputMasks (pWin) struct _OtherInputMasks *imasks; imasks = (struct _OtherInputMasks *) - xalloc (sizeof (struct _OtherInputMasks)); + malloc (sizeof (struct _OtherInputMasks)); if (!imasks) return FALSE; bzero((char *) imasks, sizeof (struct _OtherInputMasks)); @@ -1027,7 +1027,7 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k) * list of keycodes. */ if (inputMapLen) { - map = (KeyCode *)xalloc(inputMapLen); + map = (KeyCode *)malloc(inputMapLen); if (!map) return BadAlloc; } diff --git a/nx-X11/programs/Xserver/Xi/extinit.c b/nx-X11/programs/Xserver/Xi/extinit.c index 81f5ca551..d74ac5dc7 100644 --- a/nx-X11/programs/Xserver/Xi/extinit.c +++ b/nx-X11/programs/Xserver/Xi/extinit.c @@ -872,7 +872,7 @@ AssignTypeAndName (dev, type, name) char *name; { dev->type = type; - dev->name = (char *) xalloc(strlen(name)+1); + dev->name = (char *) malloc(strlen(name)+1); strcpy (dev->name, name); } diff --git a/nx-X11/programs/Xserver/Xi/getdctl.c b/nx-X11/programs/Xserver/Xi/getdctl.c index 440c1eeb4..1161e5aef 100644 --- a/nx-X11/programs/Xserver/Xi/getdctl.c +++ b/nx-X11/programs/Xserver/Xi/getdctl.c @@ -139,7 +139,7 @@ ProcXGetDeviceControl(client) return Success; } - buf = (char *) xalloc (total_length); + buf = (char *) malloc (total_length); if (!buf) { SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, diff --git a/nx-X11/programs/Xserver/Xi/getfctl.c b/nx-X11/programs/Xserver/Xi/getfctl.c index e2f243430..bc92784d3 100644 --- a/nx-X11/programs/Xserver/Xi/getfctl.c +++ b/nx-X11/programs/Xserver/Xi/getfctl.c @@ -165,7 +165,7 @@ ProcXGetFeedbackControl(client) return Success; } - buf = (char *) xalloc (total_length); + buf = (char *) malloc (total_length); if (!buf) { SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, diff --git a/nx-X11/programs/Xserver/Xi/getprop.c b/nx-X11/programs/Xserver/Xi/getprop.c index 33d49fb95..42403b0e5 100644 --- a/nx-X11/programs/Xserver/Xi/getprop.c +++ b/nx-X11/programs/Xserver/Xi/getprop.c @@ -137,7 +137,7 @@ ProcXGetDeviceDontPropagateList (client) if (count) { rep.count = count; - buf = (XEventClass *) xalloc (rep.count * sizeof(XEventClass)); + buf = (XEventClass *) malloc (rep.count * sizeof(XEventClass)); rep.length = (rep.count * sizeof (XEventClass) + 3) >> 2; tbuf = buf; diff --git a/nx-X11/programs/Xserver/Xi/getselev.c b/nx-X11/programs/Xserver/Xi/getselev.c index 05d9d987c..8abea78d4 100644 --- a/nx-X11/programs/Xserver/Xi/getselev.c +++ b/nx-X11/programs/Xserver/Xi/getselev.c @@ -149,7 +149,7 @@ ProcXGetSelectedExtensionEvents(client) total_length = (rep.all_clients_count + rep.this_client_count) * sizeof (XEventClass); rep.length = (total_length + 3) >> 2; - buf = (XEventClass *) xalloc (total_length); + buf = (XEventClass *) malloc (total_length); tclient = buf; aclient = buf + rep.this_client_count; diff --git a/nx-X11/programs/Xserver/Xi/queryst.c b/nx-X11/programs/Xserver/Xi/queryst.c index 975643e0e..a590aa0e1 100644 --- a/nx-X11/programs/Xserver/Xi/queryst.c +++ b/nx-X11/programs/Xserver/Xi/queryst.c @@ -135,7 +135,7 @@ ProcXQueryDeviceState(client) (v->numAxes * sizeof(int))); num_classes++; } - buf = (char *) xalloc (total_length); + buf = (char *) malloc (total_length); if (!buf) { SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, diff --git a/nx-X11/programs/Xserver/composite/compalloc.c b/nx-X11/programs/Xserver/composite/compalloc.c index a5d0998eb..e24c490d2 100644 --- a/nx-X11/programs/Xserver/composite/compalloc.c +++ b/nx-X11/programs/Xserver/composite/compalloc.c @@ -146,7 +146,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update) * The client *could* allocate multiple, but while supported, * it is not expected to be common */ - ccw = xalloc (sizeof (CompClientWindowRec)); + ccw = malloc (sizeof (CompClientWindowRec)); if (!ccw) return BadAlloc; ccw->id = FakeClientID (pClient->index); @@ -156,7 +156,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update) */ if (!cw) { - cw = xalloc (sizeof (CompWindowRec)); + cw = malloc (sizeof (CompWindowRec)); if (!cw) { free (ccw); @@ -355,7 +355,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update) * The client *could* allocate multiple, but while supported, * it is not expected to be common */ - ccw = xalloc (sizeof (CompClientWindowRec)); + ccw = malloc (sizeof (CompClientWindowRec)); if (!ccw) return BadAlloc; ccw->id = FakeClientID (pClient->index); @@ -365,7 +365,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update) */ if (!csw) { - csw = xalloc (sizeof (CompSubwindowsRec)); + csw = malloc (sizeof (CompSubwindowsRec)); if (!csw) { free (ccw); diff --git a/nx-X11/programs/Xserver/composite/compinit.c b/nx-X11/programs/Xserver/composite/compinit.c index 930787195..e33bd3a3f 100644 --- a/nx-X11/programs/Xserver/composite/compinit.c +++ b/nx-X11/programs/Xserver/composite/compinit.c @@ -405,7 +405,7 @@ compScreenInit (ScreenPtr pScreen) if (GetCompScreen (pScreen)) return TRUE; - cs = (CompScreenPtr) xalloc (sizeof (CompScreenRec)); + cs = (CompScreenPtr) malloc (sizeof (CompScreenRec)); if (!cs) return FALSE; diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index aedbecb7b..88858f621 100755 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -199,7 +199,7 @@ ProcDamageCreate (ClientPtr client) return BadValue; } - pDamageExt = xalloc (sizeof (DamageExtRec)); + pDamageExt = malloc (sizeof (DamageExtRec)); if (!pDamageExt) return BadAlloc; pDamageExt->id = stuff->damage; diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index e64b6bd22..658e61abe 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -176,7 +176,7 @@ DbeAllocWinPriv(pScreen) register int i; pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); - pDbeWindowPriv = (DbeWindowPrivPtr)xalloc(pDbeScreenPriv->totalWinPrivSize); + pDbeWindowPriv = (DbeWindowPrivPtr)malloc(pDbeScreenPriv->totalWinPrivSize); if (pDbeWindowPriv) { @@ -746,7 +746,7 @@ ProcDbeSwapBuffers(client) dbeSwapInfo = (xDbeSwapInfo *)&stuff[1]; /* Allocate array to record swap information. */ - swapInfo = (DbeSwapInfoPtr)Xalloc(nStuff * sizeof(DbeSwapInfoRec)); + swapInfo = (DbeSwapInfoPtr)malloc(nStuff * sizeof(DbeSwapInfoRec)); if (swapInfo == NULL) { return(BadAlloc); @@ -912,7 +912,7 @@ ProcDbeGetVisualInfo(client) /* Make sure any specified drawables are valid. */ if (stuff->n != 0) { - if (!(pDrawables = (DrawablePtr *)Xalloc(stuff->n * + if (!(pDrawables = (DrawablePtr *)malloc(stuff->n * sizeof(DrawablePtr)))) { return(BadAlloc); @@ -932,7 +932,7 @@ ProcDbeGetVisualInfo(client) } count = (stuff->n == 0) ? screenInfo.numScreens : stuff->n; - if (!(pScrVisInfo = (XdbeScreenVisualInfo *)xalloc(count * + if (!(pScrVisInfo = (XdbeScreenVisualInfo *)malloc(count * sizeof(XdbeScreenVisualInfo)))) { if (pDrawables) diff --git a/nx-X11/programs/Xserver/dbe/midbe.c b/nx-X11/programs/Xserver/dbe/midbe.c index b8383e11a..c83b42771 100644 --- a/nx-X11/programs/Xserver/dbe/midbe.c +++ b/nx-X11/programs/Xserver/dbe/midbe.c @@ -115,7 +115,7 @@ miDbeGetVisualInfo(pScreen, pScrVisInfo) } /* Allocate an array of XdbeVisualInfo items. */ - if (!(visInfo = (XdbeVisualInfo *)xalloc(count * sizeof(XdbeVisualInfo)))) + if (!(visInfo = (XdbeVisualInfo *)malloc(count * sizeof(XdbeVisualInfo)))) { return(FALSE); /* memory alloc failure */ } diff --git a/nx-X11/programs/Xserver/dix/atom.c b/nx-X11/programs/Xserver/dix/atom.c index fdb1c18a2..227069bab 100644 --- a/nx-X11/programs/Xserver/dix/atom.c +++ b/nx-X11/programs/Xserver/dix/atom.c @@ -109,7 +109,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit) { register NodePtr nd; - nd = (NodePtr) xalloc(sizeof(NodeRec)); + nd = (NodePtr) malloc(sizeof(NodeRec)); if (!nd) return BAD_RESOURCE; if (lastAtom < XA_LAST_PREDEFINED) @@ -118,7 +118,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit) } else { - nd->string = (char *) xalloc(len + 1); + nd->string = (char *) malloc(len + 1); if (!nd->string) { free(nd); return BAD_RESOURCE; @@ -201,7 +201,7 @@ InitAtoms() { FreeAllAtoms(); tableLength = InitialTableSize; - nodeTable = (NodePtr *)xalloc(InitialTableSize*sizeof(NodePtr)); + nodeTable = (NodePtr *)malloc(InitialTableSize*sizeof(NodePtr)); if (!nodeTable) AtomError(); nodeTable[None] = (NodePtr)NULL; diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index 39da0abd4..121877461 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -274,7 +274,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, if ((class | DynamicClass) == DirectColor) sizebytes *= 3; sizebytes += sizeof(ColormapRec); - pmap = (ColormapPtr) xalloc(sizebytes); + pmap = (ColormapPtr) malloc(sizebytes); if (!pmap) return (BadAlloc); pmap->red = (EntryPtr)((char *)pmap + sizeof(ColormapRec)); @@ -303,7 +303,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, for (pent = &pmap->red[size - 1]; pent >= pmap->red; pent--) pent->refcnt = AllocPrivate; pmap->freeRed = 0; - ppix = (Pixel *)xalloc(size * sizeof(Pixel)); + ppix = (Pixel *)malloc(size * sizeof(Pixel)); if (!ppix) { free(pmap); @@ -349,7 +349,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, for(pent = &pmap->green[size-1]; pent >= pmap->green; pent--) pent->refcnt = AllocPrivate; pmap->freeGreen = 0; - ppix = (Pixel *) xalloc(size * sizeof(Pixel)); + ppix = (Pixel *) malloc(size * sizeof(Pixel)); if (!ppix) { free(pmap->clientPixelsRed[client]); @@ -365,7 +365,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, for(pent = &pmap->blue[size-1]; pent >= pmap->blue; pent--) pent->refcnt = AllocPrivate; pmap->freeBlue = 0; - ppix = (Pixel *) xalloc(size * sizeof(Pixel)); + ppix = (Pixel *) malloc(size * sizeof(Pixel)); if (!ppix) { free(pmap->clientPixelsGreen[client]); @@ -963,7 +963,7 @@ AllocColor (ColormapPtr pmap, { colorResource *pcr; - pcr = (colorResource *) xalloc(sizeof(colorResource)); + pcr = (colorResource *) malloc(sizeof(colorResource)); if (!pcr) { (void)FreeColors(pmap, client, 1, pPix, (Pixel)0); @@ -1578,7 +1578,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes, oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client]; if (!oldcount && (CLIENT_ID(pmap->mid) != client)) { - pcr = (colorResource *) xalloc(sizeof(colorResource)); + pcr = (colorResource *) malloc(sizeof(colorResource)); if (!pcr) return (BadAlloc); } @@ -1653,7 +1653,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors, oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client]; if (!oldcount && (CLIENT_ID(pmap->mid) != client)) { - pcr = (colorResource *) xalloc(sizeof(colorResource)); + pcr = (colorResource *) malloc(sizeof(colorResource)); if (!pcr) return (BadAlloc); } @@ -2089,7 +2089,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b, ppshared = psharedList; for (z = npixShared; --z >= 0; ) { - if (!(ppshared[z] = (SHAREDCOLOR *)xalloc(sizeof(SHAREDCOLOR)))) + if (!(ppshared[z] = (SHAREDCOLOR *)malloc(sizeof(SHAREDCOLOR)))) { for (z++ ; z < npixShared; z++) free(ppshared[z]); diff --git a/nx-X11/programs/Xserver/dix/cursor.c b/nx-X11/programs/Xserver/dix/cursor.c index 575ff1eb4..875e19480 100644 --- a/nx-X11/programs/Xserver/dix/cursor.c +++ b/nx-X11/programs/Xserver/dix/cursor.c @@ -174,7 +174,7 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb, int nscr; ScreenPtr pscr; - pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits)); + pCurs = (CursorPtr)malloc(sizeof(CursorRec) + sizeof(CursorBits)); if (!pCurs) { free(psrcbits); @@ -292,7 +292,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, } if (pShare) { - pCurs = (CursorPtr)xalloc(sizeof(CursorRec)); + pCurs = (CursorPtr)malloc(sizeof(CursorRec)); if (!pCurs) return BadAlloc; bits = pShare->bits; @@ -311,7 +311,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, register unsigned char *mskptr; n = BitmapBytePad(cm.width)*(long)cm.height; - mskptr = mskbits = (unsigned char *)xalloc(n); + mskptr = mskbits = (unsigned char *)malloc(n); if (!mskptr) return BadAlloc; while (--n >= 0) @@ -334,7 +334,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, } if (sourcefont != maskfont) { - pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits)); + pCurs = (CursorPtr)malloc(sizeof(CursorRec) + sizeof(CursorBits)); if (pCurs) bits = (CursorBitsPtr)((char *)pCurs + sizeof(CursorRec)); else @@ -342,9 +342,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, } else { - pCurs = (CursorPtr)xalloc(sizeof(CursorRec)); + pCurs = (CursorPtr)malloc(sizeof(CursorRec)); if (pCurs) - bits = (CursorBitsPtr)xalloc(sizeof(CursorBits)); + bits = (CursorBitsPtr)malloc(sizeof(CursorBits)); else bits = (CursorBitsPtr)NULL; } @@ -369,7 +369,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, else { bits->refcnt = 1; - pShare = (GlyphSharePtr)xalloc(sizeof(GlyphShare)); + pShare = (GlyphSharePtr)malloc(sizeof(GlyphShare)); if (!pShare) { FreeCursorBits(bits); diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index 314714152..69a72fbad 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -86,7 +86,7 @@ _AddInputDevice(DeviceProc deviceProc, Bool autoStart) if (inputInfo.numDevices >= MAX_DEVICES) return (DeviceIntPtr)NULL; - dev = (DeviceIntPtr) xalloc(sizeof(DeviceIntRec)); + dev = (DeviceIntPtr) malloc(sizeof(DeviceIntRec)); if (!dev) return (DeviceIntPtr)NULL; dev->name = (char *)NULL; @@ -369,7 +369,7 @@ _RegisterPointerDevice(DeviceIntPtr device) if (!device->name) { char *p = "pointer"; - device->name = (char *)xalloc(strlen(p) + 1); + device->name = (char *)malloc(strlen(p) + 1); strcpy(device->name, p); } } @@ -392,7 +392,7 @@ _RegisterKeyboardDevice(DeviceIntPtr device) if (!device->name) { char *k = "keyboard"; - device->name = (char *)xalloc(strlen(k) + 1); + device->name = (char *)malloc(strlen(k) + 1); strcpy(device->name, k); } } @@ -461,7 +461,7 @@ SetKeySymsMap(register KeySymsPtr dst, register KeySymsPtr src) KeySym *map; int bytes = sizeof(KeySym) * src->mapWidth * (dst->maxKeyCode - dst->minKeyCode + 1); - map = (KeySym *)xalloc(bytes); + map = (KeySym *)malloc(bytes); if (!map) return FALSE; bzero((char *)map, bytes); @@ -504,7 +504,7 @@ InitModMap(register KeyClassPtr keyc) } } } - keyc->modifierKeyMap = (KeyCode *)xalloc(8*keyc->maxKeysPerModifier); + keyc->modifierKeyMap = (KeyCode *)malloc(8*keyc->maxKeysPerModifier); if (!keyc->modifierKeyMap && keyc->maxKeysPerModifier) return (FALSE); bzero((char *)keyc->modifierKeyMap, 8*(int)keyc->maxKeysPerModifier); @@ -531,7 +531,7 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers int i; register KeyClassPtr keyc; - keyc = (KeyClassPtr)xalloc(sizeof(KeyClassRec)); + keyc = (KeyClassPtr)malloc(sizeof(KeyClassRec)); if (!keyc) return FALSE; keyc->curKeySyms.map = (KeySym *)NULL; @@ -570,7 +570,7 @@ InitButtonClassDeviceStruct(register DeviceIntPtr dev, int numButtons, register ButtonClassPtr butc; int i; - butc = (ButtonClassPtr)xalloc(sizeof(ButtonClassRec)); + butc = (ButtonClassPtr)malloc(sizeof(ButtonClassRec)); if (!butc) return FALSE; butc->numButtons = numButtons; @@ -595,7 +595,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, int i; register ValuatorClassPtr valc; - valc = (ValuatorClassPtr)xalloc(sizeof(ValuatorClassRec) + + valc = (ValuatorClassPtr)malloc(sizeof(ValuatorClassRec) + numAxes * sizeof(AxisInfo) + numAxes * sizeof(unsigned int)); if (!valc) @@ -618,7 +618,7 @@ InitFocusClassDeviceStruct(DeviceIntPtr dev) { register FocusClassPtr focc; - focc = (FocusClassPtr)xalloc(sizeof(FocusClassRec)); + focc = (FocusClassPtr)malloc(sizeof(FocusClassRec)); if (!focc) return FALSE; focc->win = PointerRootWin; @@ -637,7 +637,7 @@ InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc, { register KbdFeedbackPtr feedc; - feedc = (KbdFeedbackPtr)xalloc(sizeof(KbdFeedbackClassRec)); + feedc = (KbdFeedbackPtr)malloc(sizeof(KbdFeedbackClassRec)); if (!feedc) return FALSE; feedc->BellProc = bellProc; @@ -664,7 +664,7 @@ InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc) { register PtrFeedbackPtr feedc; - feedc = (PtrFeedbackPtr)xalloc(sizeof(PtrFeedbackClassRec)); + feedc = (PtrFeedbackPtr)malloc(sizeof(PtrFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; @@ -708,7 +708,7 @@ InitStringFeedbackClassDeviceStruct ( int i; register StringFeedbackPtr feedc; - feedc = (StringFeedbackPtr)xalloc(sizeof(StringFeedbackClassRec)); + feedc = (StringFeedbackPtr)malloc(sizeof(StringFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; @@ -716,9 +716,9 @@ InitStringFeedbackClassDeviceStruct ( feedc->ctrl.num_symbols_displayed = 0; feedc->ctrl.max_symbols = max_symbols; feedc->ctrl.symbols_supported = (KeySym *) - xalloc (sizeof (KeySym) * num_symbols_supported); + malloc (sizeof (KeySym) * num_symbols_supported); feedc->ctrl.symbols_displayed = (KeySym *) - xalloc (sizeof (KeySym) * max_symbols); + malloc (sizeof (KeySym) * max_symbols); if (!feedc->ctrl.symbols_supported || !feedc->ctrl.symbols_displayed) { if (feedc->ctrl.symbols_supported) @@ -746,7 +746,7 @@ InitBellFeedbackClassDeviceStruct (DeviceIntPtr dev, BellProcPtr bellProc, { register BellFeedbackPtr feedc; - feedc = (BellFeedbackPtr)xalloc(sizeof(BellFeedbackClassRec)); + feedc = (BellFeedbackPtr)malloc(sizeof(BellFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; @@ -765,7 +765,7 @@ InitLedFeedbackClassDeviceStruct (DeviceIntPtr dev, LedCtrlProcPtr controlProc) { register LedFeedbackPtr feedc; - feedc = (LedFeedbackPtr)xalloc(sizeof(LedFeedbackClassRec)); + feedc = (LedFeedbackPtr)malloc(sizeof(LedFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; @@ -786,7 +786,7 @@ InitIntegerFeedbackClassDeviceStruct (DeviceIntPtr dev, IntegerCtrlProcPtr contr { register IntegerFeedbackPtr feedc; - feedc = (IntegerFeedbackPtr)xalloc(sizeof(IntegerFeedbackClassRec)); + feedc = (IntegerFeedbackPtr)malloc(sizeof(IntegerFeedbackClassRec)); if (!feedc) return FALSE; feedc->CtrlProc = controlProc; @@ -997,7 +997,7 @@ ProcSetModifierMapping(ClientPtr client) * Now build the keyboard's modifier bitmap from the * list of keycodes. */ - map = (KeyCode *)xalloc(inputMapLen); + map = (KeyCode *)malloc(inputMapLen); if (!map && inputMapLen) return BadAlloc; if (keyc->modifierKeyMap) diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 9b9021d62..807fecd90 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -1021,7 +1021,7 @@ ProcSetSelectionOwner(register ClientPtr client) Selection *newsels; if (i == 0) - newsels = (Selection *)xalloc(sizeof(Selection)); + newsels = (Selection *)malloc(sizeof(Selection)); else newsels = (Selection *)xrealloc(CurrentSelections, (NumCurrentSelections + 1) * sizeof(Selection)); @@ -3084,10 +3084,10 @@ ProcCreateCursor (register ClientPtr client) return (BadMatch); n = BitmapBytePad(width)*height; - srcbits = (unsigned char *)xalloc(n); + srcbits = (unsigned char *)malloc(n); if (!srcbits) return (BadAlloc); - mskbits = (unsigned char *)xalloc(n); + mskbits = (unsigned char *)malloc(n); if (!mskbits) { free(srcbits); @@ -3716,7 +3716,7 @@ InitClientPrivates(ClientPtr client) ppriv = (DevUnion *)(client + 1); else { - ppriv = (DevUnion *)xalloc(totalClientSize - sizeof(ClientRec)); + ppriv = (DevUnion *)malloc(totalClientSize - sizeof(ClientRec)); if (!ppriv) return 0; } @@ -3753,7 +3753,7 @@ ClientPtr NextAvailableClient(void * ospriv) i = nextFreeClientID; if (i == MAXCLIENTS) return (ClientPtr)NULL; - clients[i] = client = (ClientPtr)xalloc(totalClientSize); + clients[i] = client = (ClientPtr)malloc(totalClientSize); if (!client) return (ClientPtr)NULL; InitClient(client, i, ospriv); diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index 1a0352387..ef40c66f7 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -393,7 +393,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna #ifdef FONTDEBUG char *f; - f = (char *)xalloc(lenfname + 1); + f = (char *)malloc(lenfname + 1); memmove(f, pfontname, lenfname); f[lenfname] = '\0'; ErrorF("OpenFont: fontname is \"%s\"\n", f); @@ -430,10 +430,10 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna return Success; } } - c = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); + c = (OFclosurePtr) malloc(sizeof(OFclosureRec)); if (!c) return BadAlloc; - c->fontname = (char *) xalloc(lenfname); + c->fontname = (char *) malloc(lenfname); c->origFontName = pfontname; c->origFontNameLen = lenfname; if (!c->fontname) { @@ -445,7 +445,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna * while we're blocking, the request still appears atomic */ c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); + malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free(c->fontname); free(c); @@ -680,7 +680,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) } if (err == FontNameAlias) { if (resolved) free(resolved); - resolved = (char *) xalloc(resolvedlen + 1); + resolved = (char *) malloc(resolvedlen + 1); if (resolved) memmove(resolved, tmpname, resolvedlen + 1); } @@ -735,7 +735,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) c->haveSaved = TRUE; if (c->savedName) free(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); + c->savedName = (char *)malloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); c->savedNameLen = namelen; @@ -853,10 +853,10 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, if (length > XLFDMAXFONTNAMELEN) return BadAlloc; - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) + if (!(c = (LFclosurePtr) malloc(sizeof *c))) return BadAlloc; c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); + malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free(c); return BadAlloc; @@ -995,7 +995,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) c->savedNumFonts = numFonts; if (c->savedName) free(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); + c->savedName = (char *)malloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); aliascount = 20; @@ -1127,10 +1127,10 @@ StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, if (length > XLFDMAXFONTNAMELEN) return BadAlloc; - if (!(c = (LFWIclosurePtr) xalloc(sizeof *c))) + if (!(c = (LFWIclosurePtr) malloc(sizeof *c))) goto badAlloc; c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); + malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free(c); @@ -1317,7 +1317,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) /* Step 1 */ /* Allocate a malloc'd closure structure to replace the local one we were passed */ - new_closure = (PTclosurePtr) xalloc(sizeof(PTclosureRec)); + new_closure = (PTclosurePtr) malloc(sizeof(PTclosureRec)); if (!new_closure) { err = BadAlloc; @@ -1327,7 +1327,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) c = new_closure; len = c->endReq - c->pElt; - c->data = (unsigned char *)xalloc(len); + c->data = (unsigned char *)malloc(len); if (!c->data) { free(c); @@ -1517,7 +1517,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) in doPolyText, but much simpler because the request structure is much simpler. */ - new_closure = (ITclosurePtr) xalloc(sizeof(ITclosureRec)); + new_closure = (ITclosurePtr) malloc(sizeof(ITclosureRec)); if (!new_closure) { err = BadAlloc; @@ -1527,7 +1527,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) *new_closure = *c; c = new_closure; - data = (unsigned char *)xalloc(c->nChars * c->itemSize); + data = (unsigned char *)malloc(c->nChars * c->itemSize); if (!data) { free(c); @@ -1704,7 +1704,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) FontPathElementPtr fpe = NULL, *fplist; fplist = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * npaths); + malloc(sizeof(FontPathElementPtr) * npaths); if (!fplist) { *bad = 0; return BadAlloc; @@ -1745,13 +1745,13 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) /* if error or can't do it, act like it's a new one */ if (!fpe) { - fpe = (FontPathElementPtr) xalloc(sizeof(FontPathElementRec)); + fpe = (FontPathElementPtr) malloc(sizeof(FontPathElementRec)); if (!fpe) { err = BadAlloc; goto bail; } - fpe->name = (char *) xalloc(len + 1); + fpe->name = (char *) malloc(len + 1); if (!fpe->name) { free(fpe); diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index 1c6305684..84eb63f14 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -621,7 +621,7 @@ QueueWorkProc ( { WorkQueuePtr q; - q = (WorkQueuePtr) xalloc (sizeof *q); + q = (WorkQueuePtr) malloc (sizeof *q); if (!q) return FALSE; q->function = function; @@ -655,7 +655,7 @@ ClientSleep (ClientPtr client, ClientSleepProcPtr function, void * closure) { SleepQueuePtr q; - q = (SleepQueuePtr) xalloc (sizeof *q); + q = (SleepQueuePtr) malloc (sizeof *q); if (!q) return FALSE; @@ -735,7 +735,7 @@ _AddCallback( { CallbackPtr cbr; - cbr = (CallbackPtr) xalloc(sizeof(CallbackRec)); + cbr = (CallbackPtr) malloc(sizeof(CallbackRec)); if (!cbr) return FALSE; cbr->proc = callback; @@ -888,7 +888,7 @@ CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs) int i; if (!pcbl) return FALSE; - cbl = (CallbackListPtr) xalloc(sizeof(CallbackListRec)); + cbl = (CallbackListPtr) malloc(sizeof(CallbackListRec)); if (!cbl) return FALSE; cbl->funcs = cbfuncs ? *cbfuncs : default_cbfuncs; cbl->inCallback = 0; diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index ba0c5d847..97cd13b5e 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -1027,7 +1027,7 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) return; } } - qe = (QdEventPtr)xalloc(sizeof(QdEventRec) + (count * sizeof(xEvent))); + qe = (QdEventPtr)malloc(sizeof(QdEventRec) + (count * sizeof(xEvent))); if (!qe) return; qe->next = (QdEventPtr)NULL; @@ -3030,7 +3030,7 @@ EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask ma check = 0; if (!pWin->optional && !MakeWindowOptional (pWin)) return BadAlloc; - others = (OtherClients *) xalloc(sizeof(OtherClients)); + others = (OtherClients *) malloc(sizeof(OtherClients)); if (!others) return BadAlloc; others->mask = mask; @@ -3929,7 +3929,7 @@ InitEvents() if (spriteTraceSize == 0) { spriteTraceSize = 32; - spriteTrace = (WindowPtr *)xalloc(32*sizeof(WindowPtr)); + spriteTrace = (WindowPtr *)malloc(32*sizeof(WindowPtr)); if (!spriteTrace) FatalError("failed to allocate spriteTrace"); } diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c index 4f06c0af4..9c25c3db8 100644 --- a/nx-X11/programs/Xserver/dix/extension.c +++ b/nx-X11/programs/Xserver/dix/extension.c @@ -95,10 +95,10 @@ AddExtension(char *name, int NumEvents, int NumErrors, (unsigned)(lastError + NumErrors > LAST_ERROR)) return((ExtensionEntry *) NULL); - ext = (ExtensionEntry *) xalloc(sizeof(ExtensionEntry)); + ext = (ExtensionEntry *) malloc(sizeof(ExtensionEntry)); if (!ext) return((ExtensionEntry *) NULL); - ext->name = (char *)xalloc(strlen(name) + 1); + ext->name = (char *)malloc(strlen(name) + 1); ext->num_aliases = 0; ext->aliases = (char **)NULL; if (!ext->name) @@ -164,7 +164,7 @@ Bool AddExtensionAlias(char *alias, ExtensionEntry *ext) if (!aliases) return FALSE; ext->aliases = aliases; - name = (char *)xalloc(strlen(alias) + 1); + name = (char *)malloc(strlen(alias) + 1); if (!name) return FALSE; strcpy(name, alias); @@ -438,7 +438,7 @@ RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc) procEntry->proc = proc; else { - newname = (char *)xalloc(strlen(name)+1); + newname = (char *)malloc(strlen(name)+1); if (!newname) return FALSE; procEntry = (ProcEntryPtr) diff --git a/nx-X11/programs/Xserver/dix/gc.c b/nx-X11/programs/Xserver/dix/gc.c index 595d8ab74..9566bb8f7 100644 --- a/nx-X11/programs/Xserver/dix/gc.c +++ b/nx-X11/programs/Xserver/dix/gc.c @@ -466,7 +466,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC { unsigned char *dash; - dash = (unsigned char *)xalloc(2 * sizeof(unsigned char)); + dash = (unsigned char *)malloc(2 * sizeof(unsigned char)); if (dash) { if (pGC->dash != DefaultDash) @@ -580,7 +580,7 @@ AllocateGC(ScreenPtr pScreen) register unsigned size; register int i; - pGC = (GCPtr)xalloc(pScreen->totalGCSize); + pGC = (GCPtr)malloc(pScreen->totalGCSize); if (pGC) { ppriv = (DevUnion *)(pGC + 1); @@ -848,7 +848,7 @@ CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask) unsigned char *dash; unsigned int i; - dash = (unsigned char *)xalloc(pgcSrc->numInDashList * + dash = (unsigned char *)malloc(pgcSrc->numInDashList * sizeof(unsigned char)); if (dash) { @@ -1098,9 +1098,9 @@ SetDashes(register GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pd } if (ndash & 1) - p = (unsigned char *)xalloc(2 * ndash * sizeof(unsigned char)); + p = (unsigned char *)malloc(2 * ndash * sizeof(unsigned char)); else - p = (unsigned char *)xalloc(ndash * sizeof(unsigned char)); + p = (unsigned char *)malloc(ndash * sizeof(unsigned char)); if (!p) return BadAlloc; @@ -1195,7 +1195,7 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects, if (newct < 0) return(BadMatch); size = nrects * sizeof(xRectangle); - prectsNew = (xRectangle *) xalloc(size); + prectsNew = (xRectangle *) malloc(size); if (!prectsNew && size) return BadAlloc; diff --git a/nx-X11/programs/Xserver/dix/glyphcurs.c b/nx-X11/programs/Xserver/dix/glyphcurs.c index c8b71db4e..a1da68443 100644 --- a/nx-X11/programs/Xserver/dix/glyphcurs.c +++ b/nx-X11/programs/Xserver/dix/glyphcurs.c @@ -93,7 +93,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns pScreen = screenInfo.screens[0]; nby = BitmapBytePad(cm->width) * (long)cm->height; - pbits = (char *)xalloc(nby); + pbits = (char *)malloc(nby); if (!pbits) return BadAlloc; /* zeroing the (pad) bits seems to help some ddx cursor handling */ diff --git a/nx-X11/programs/Xserver/dix/grabs.c b/nx-X11/programs/Xserver/dix/grabs.c index 7fd9ad096..d72ef3f6a 100644 --- a/nx-X11/programs/Xserver/dix/grabs.c +++ b/nx-X11/programs/Xserver/dix/grabs.c @@ -84,7 +84,7 @@ CreateGrab( { GrabPtr grab; - grab = (GrabPtr)xalloc(sizeof(GrabRec)); + grab = (GrabPtr)malloc(sizeof(GrabRec)); if (!grab) return (GrabPtr)NULL; grab->resource = FakeClientID(client); @@ -158,7 +158,7 @@ DeleteDetailFromMask(Mask *pDetailMask, unsigned short detail) register Mask *mask; register int i; - mask = (Mask *)xalloc(sizeof(Mask) * MasksPerDetailMask); + mask = (Mask *)malloc(sizeof(Mask) * MasksPerDetailMask); if (mask) { if (pDetailMask) diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c index 9d0197e3d..05f6dd19b 100644 --- a/nx-X11/programs/Xserver/dix/main.c +++ b/nx-X11/programs/Xserver/dix/main.c @@ -310,12 +310,12 @@ main(int argc, char *argv[], char *envp[]) { CreateWellKnownSockets(); InitProcVectors(); - clients = (ClientPtr *)xalloc(MAXCLIENTS * sizeof(ClientPtr)); + clients = (ClientPtr *)malloc(MAXCLIENTS * sizeof(ClientPtr)); if (!clients) FatalError("couldn't create client array"); for (i=1; itotalPixmapSize + pixDataSize + 4); + pPixmap = (PixmapPtr)malloc(pScreen->totalPixmapSize + pixDataSize + 4); if (!pPixmap) return NullPixmap; ppriv = (DevUnion *)(pPixmap + 1); @@ -146,7 +146,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) ppriv->ptr = (void *)NULL; } #else - pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize); + pPixmap = (PixmapPtr)malloc(sizeof(PixmapRec) + pixDataSize); #endif return pPixmap; } diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index 4476141e5..28ce1355c 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -284,10 +284,10 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, { if (!pWin->optional && !MakeWindowOptional (pWin)) return(BadAlloc); - pProp = (PropertyPtr)xalloc(sizeof(PropertyRec)); + pProp = (PropertyPtr)malloc(sizeof(PropertyRec)); if (!pProp) return(BadAlloc); - data = (void *)xalloc(totalSize); + data = (void *)malloc(totalSize); if (!data && len) { free(pProp); @@ -347,7 +347,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, } else if (mode == PropModePrepend) { - data = (void *)xalloc(sizeInBytes * (len + pProp->size)); + data = (void *)malloc(sizeInBytes * (len + pProp->size)); if (!data) return(BadAlloc); memmove(&((char *)data)[totalSize], (char *)pProp->data, diff --git a/nx-X11/programs/Xserver/dix/region.c b/nx-X11/programs/Xserver/dix/region.c index 4c2bc4695..df7c1fc16 100644 --- a/nx-X11/programs/Xserver/dix/region.c +++ b/nx-X11/programs/Xserver/dix/region.c @@ -311,7 +311,7 @@ RegionCreate(rect, size) { register RegionPtr pReg; size_t newSize; - pReg = (RegionPtr)xalloc(sizeof(RegionRec)); + pReg = (RegionPtr)malloc(sizeof(RegionRec)); if (!pReg) return &RegionBrokenRegion; if (rect) @@ -324,7 +324,7 @@ RegionCreate(rect, size) pReg->extents = RegionEmptyBox; newSize = RegionSizeof(size); if ((size > 1) && (newSize > 0) && - (pReg->data = xalloc(newSize))) + (pReg->data = malloc(newSize))) { pReg->data->size = size; pReg->data->numRects = 0; @@ -367,7 +367,7 @@ RegionRectAlloc( { n++; rgnSize = RegionSizeof(n); - pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL; + pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL; if (!pRgn->data) return RegionBreak (pRgn); pRgn->data->numRects = 1; @@ -376,7 +376,7 @@ RegionRectAlloc( else if (!pRgn->data->size) { rgnSize = RegionSizeof(n); - pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL; + pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL; if (!pRgn->data) return RegionBreak (pRgn); pRgn->data->numRects = 0; @@ -1235,7 +1235,7 @@ RegionValidate(badreg, pOverlap) /* Set up the first region to be the first rectangle in badreg */ /* Note that step 2 code will never overflow the ri[0].reg rects array */ - ri = (RegionInfo *) xalloc(4 * sizeof(RegionInfo)); + ri = (RegionInfo *) malloc(4 * sizeof(RegionInfo)); if (!ri) return RegionBreak (badreg); sizeRI = 4; @@ -1402,7 +1402,7 @@ RegionFromRects(nrects, prect, ctype) return pRgn; } newSize = RegionSizeof(nrects); - pData = newSize > 0 ? xalloc(newSize) : NULL; + pData = newSize > 0 ? malloc(newSize) : NULL; if (!pData) { RegionBreak (pRgn); @@ -1469,7 +1469,7 @@ miRegionDataCopy( { size_t newSize = RegionSizeof(src->data->numRects); xfreeData(dst); - dst->data = newSize > 0 ? xalloc(newSize) : NULL; + dst->data = newSize > 0 ? malloc(newSize) : NULL; if (!dst->data) return RegionBreak (dst); } diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index 0c5b6dd29..905dafc24 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -232,7 +232,7 @@ InitClientResources(ClientPtr client) TypeMask = RC_LASTPREDEF - 1; if (DeleteFuncs) free(DeleteFuncs); - DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) * + DeleteFuncs = (DeleteType *)malloc((lastResourceType + 1) * sizeof(DeleteType)); if (!DeleteFuncs) return FALSE; @@ -250,13 +250,13 @@ InitClientResources(ClientPtr client) #ifdef XResExtension if(ResourceNames) free(ResourceNames); - ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom)); + ResourceNames = malloc((lastResourceType + 1) * sizeof(Atom)); if(!ResourceNames) return FALSE; #endif } clientTable[i = client->index].resources = - (ResourcePtr *)xalloc(INITBUCKETS*sizeof(ResourcePtr)); + (ResourcePtr *)malloc(INITBUCKETS*sizeof(ResourcePtr)); if (!clientTable[i].resources) return FALSE; clientTable[i].buckets = INITBUCKETS; @@ -442,7 +442,7 @@ AddResource(XID id, RESTYPE type, void * value) (rrec->hashsize < MAXHASHSIZE)) RebuildTable(client); head = &rrec->resources[Hash(client, id)]; - res = (ResourcePtr)xalloc(sizeof(ResourceRec)); + res = (ResourcePtr)malloc(sizeof(ResourceRec)); if (!res) { (*DeleteFuncs[type & TypeMask])(value, id); @@ -477,7 +477,7 @@ RebuildTable(int client) tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); if (!tails) return; - resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr)); + resources = (ResourcePtr *)malloc(j * sizeof(ResourcePtr)); if (!resources) { DEALLOCATE_LOCAL(tails); diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index 945dde7cf..f4c10f11d 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -344,7 +344,7 @@ AllocateWindow(ScreenPtr pScreen) register unsigned size; register int i; - pWin = (WindowPtr)xalloc(pScreen->totalWindowSize); + pWin = (WindowPtr)malloc(pScreen->totalWindowSize); if (pWin) { ppriv = (DevUnion *)(pWin + 1); @@ -403,7 +403,7 @@ CreateRootWindow(ScreenPtr pScreen) pWin->parent = NullWindow; SetWindowToDefaults(pWin); - pWin->optional = (WindowOptRec *) xalloc (sizeof (WindowOptRec)); + pWin->optional = (WindowOptRec *) malloc (sizeof (WindowOptRec)); if (!pWin->optional) return FALSE; @@ -3445,8 +3445,8 @@ TileScreenSaver(int i, int kind) cm.height=16; cm.xhot=8; cm.yhot=8; - srcbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); - mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16); + srcbits = (unsigned char *)malloc( BitmapBytePad(32)*16); + mskbits = (unsigned char *)malloc( BitmapBytePad(32)*16); if (!srcbits || !mskbits) { free(srcbits); @@ -3595,7 +3595,7 @@ MakeWindowOptional (register WindowPtr pWin) if (pWin->optional) return TRUE; - optional = (WindowOptPtr) xalloc (sizeof (WindowOptRec)); + optional = (WindowOptPtr) malloc (sizeof (WindowOptRec)); if (!optional) return FALSE; optional->dontPropagateMask = DontPropagateMasks[pWin->dontPropagate]; diff --git a/nx-X11/programs/Xserver/fb/fballpriv.c b/nx-X11/programs/Xserver/fb/fballpriv.c index c1cd834f1..638e71621 100644 --- a/nx-X11/programs/Xserver/fb/fballpriv.c +++ b/nx-X11/programs/Xserver/fb/fballpriv.c @@ -83,7 +83,7 @@ fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex) { FbScreenPrivPtr pScreenPriv; - pScreenPriv = (FbScreenPrivPtr) xalloc (sizeof (FbScreenPrivRec)); + pScreenPriv = (FbScreenPrivPtr) malloc (sizeof (FbScreenPrivRec)); if (!pScreenPriv) return FALSE; pScreen->devPrivates[fbScreenPrivateIndex].ptr = (void *) pScreenPriv; diff --git a/nx-X11/programs/Xserver/fb/fbcmap.c b/nx-X11/programs/Xserver/fb/fbcmap.c index 9fdffdeff..656cafbb8 100644 --- a/nx-X11/programs/Xserver/fb/fbcmap.c +++ b/nx-X11/programs/Xserver/fb/fbcmap.c @@ -390,7 +390,7 @@ fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB, { fbVisualsPtr new, *prev, v; - new = (fbVisualsPtr) xalloc (sizeof *new); + new = (fbVisualsPtr) malloc (sizeof *new); if (!new) return FALSE; if (!redMask || !greenMask || !blueMask) @@ -487,8 +487,8 @@ fbInitVisuals (VisualPtr *visualp, ndepth++; nvisual += visuals->count; } - depth = (DepthPtr) xalloc (ndepth * sizeof (DepthRec)); - visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec)); + depth = (DepthPtr) malloc (ndepth * sizeof (DepthRec)); + visual = (VisualPtr) malloc (nvisual * sizeof (VisualRec)); if (!depth || !visual) { free (depth); @@ -508,7 +508,7 @@ fbInitVisuals (VisualPtr *visualp, vid = NULL; if (nvtype) { - vid = (VisualID *) xalloc (nvtype * sizeof (VisualID)); + vid = (VisualID *) malloc (nvtype * sizeof (VisualID)); if (!vid) return FALSE; } diff --git a/nx-X11/programs/Xserver/fb/fbcopy.c b/nx-X11/programs/Xserver/fb/fbcopy.c index d1fb63828..e936fcc9a 100644 --- a/nx-X11/programs/Xserver/fb/fbcopy.c +++ b/nx-X11/programs/Xserver/fb/fbcopy.c @@ -244,7 +244,7 @@ fbCopyNto1 (DrawablePtr pSrcDrawable, height = pbox->y2 - pbox->y1; tmpStride = ((width + FB_STIP_MASK) >> FB_STIP_SHIFT); - tmp = xalloc (tmpStride * height * sizeof (FbStip)); + tmp = malloc (tmpStride * height * sizeof (FbStip)); if (!tmp) return; diff --git a/nx-X11/programs/Xserver/fb/fboverlay.c b/nx-X11/programs/Xserver/fb/fboverlay.c index 49623ba4f..a98a131c9 100644 --- a/nx-X11/programs/Xserver/fb/fboverlay.c +++ b/nx-X11/programs/Xserver/fb/fboverlay.c @@ -363,7 +363,7 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, fbOverlayGeneration = serverGeneration; } - pScrPriv = xalloc (sizeof (FbOverlayScrPrivRec)); + pScrPriv = malloc (sizeof (FbOverlayScrPrivRec)); if (!pScrPriv) return FALSE; diff --git a/nx-X11/programs/Xserver/fb/fbpseudocolor.c b/nx-X11/programs/Xserver/fb/fbpseudocolor.c index bc1c091ed..71f39b52f 100644 --- a/nx-X11/programs/Xserver/fb/fbpseudocolor.c +++ b/nx-X11/programs/Xserver/fb/fbpseudocolor.c @@ -271,7 +271,7 @@ xxCreateScreenResources(ScreenPtr pScreen) if (pScrPriv->addr) pBits = pScrPriv->addr; else - pBits = xalloc(pScreen->width * pScreen->height + pBits = malloc(pScreen->width * pScreen->height * (BitsPerPixel(depth) >> 3)); if (!pBits) return FALSE; @@ -370,11 +370,11 @@ xxInitColormapPrivate(ColormapPtr pmap) if (xxMyVisual(pmap->pScreen,pmap->pVisual->vid)) { DBG("CreateColormap\n"); - pCmapPriv = (xxCmapPrivPtr) xalloc (sizeof (xxCmapPrivRec)); + pCmapPriv = (xxCmapPrivPtr) malloc (sizeof (xxCmapPrivRec)); if (!pCmapPriv) return FALSE; pmap->devPrivates[xxColormapPrivateIndex].ptr = (void *) pCmapPriv; - cmap = xalloc(sizeof (CARD32) * (1 << pScrPriv->myDepth)); + cmap = malloc(sizeof (CARD32) * (1 << pScrPriv->myDepth)); if (!cmap) return FALSE; @@ -1109,7 +1109,7 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy if (!AllocateGCPrivate (pScreen, xxGCPrivateIndex, sizeof (xxGCPrivRec))) return FALSE; - pScrPriv = (xxScrPrivPtr) xalloc (sizeof (xxScrPrivRec)); + pScrPriv = (xxScrPrivPtr) malloc (sizeof (xxScrPrivRec)); if (!pScrPriv) return FALSE; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 4f0173db0..895de1ef8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -362,7 +362,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if ((size = strlen(argv[i])) < 1024) { - if ((nxagentOptionFile = xalloc(size + 1)) == NULL) + if ((nxagentOptionFile = malloc(size + 1)) == NULL) { FatalError("malloc failed"); } @@ -726,7 +726,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if ((size = strlen(argv[i])) < 256) { - if ((nxagentKeyboard = xalloc(size + 1)) == NULL) + if ((nxagentKeyboard = malloc(size + 1)) == NULL) { FatalError("malloc failed"); } @@ -1537,7 +1537,7 @@ void nxagentProcessOptionsFile() goto nxagentProcessOptionsFileClose; } - if ((data = xalloc(sizeOfFile + 1)) == NULL) + if ((data = malloc(sizeOfFile + 1)) == NULL) { fprintf(stderr, "Warning: Memory allocation failed processing file '%s'.\n", validateString(nxagentOptionFile)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 5249d8550..2fb53d440 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1491,7 +1491,7 @@ int nxagentInitClipboard(WindowPtr pWin) lastSelectionOwner = NULL; } - lastSelectionOwner = (SelectionOwner *) xalloc(2 * sizeof(SelectionOwner)); + lastSelectionOwner = (SelectionOwner *) malloc(2 * sizeof(SelectionOwner)); if (lastSelectionOwner == NULL) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c index 18c4c67a6..3905e289b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c @@ -77,7 +77,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) pVisual = pCmap->pVisual; ncolors = pVisual->ColormapEntries; - pCmap->devPriv = (void *)xalloc(sizeof(nxagentPrivColormap)); + pCmap->devPriv = (void *)malloc(sizeof(nxagentPrivColormap)); if (((visual = nxagentVisual(pVisual))) == NULL) { @@ -103,7 +103,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) switch (class) { case StaticGray: /* read only */ - colors = (XColor *)xalloc(ncolors * sizeof(XColor)); + colors = (XColor *)malloc(ncolors * sizeof(XColor)); for (i = 0; i < ncolors; i++) colors[i].pixel = i; XQueryColors(nxagentDisplay, nxagentColormap(pCmap), colors, ncolors); @@ -116,7 +116,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) break; case StaticColor: /* read only */ - colors = (XColor *)xalloc(ncolors * sizeof(XColor)); + colors = (XColor *)malloc(ncolors * sizeof(XColor)); for (i = 0; i < ncolors; i++) colors[i].pixel = i; XQueryColors(nxagentDisplay, nxagentColormap(pCmap), colors, ncolors); @@ -129,7 +129,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap) break; case TrueColor: /* read only */ - colors = (XColor *)xalloc(ncolors * sizeof(XColor)); + colors = (XColor *)malloc(ncolors * sizeof(XColor)); red = green = blue = 0L; redInc = lowbit(pVisual->redMask); greenInc = lowbit(pVisual->greenMask); @@ -229,13 +229,13 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) nxagentInstalledColormapWindows icws; int numWindows; - icws.cmapIDs = (Colormap *)xalloc(pScreen->maxInstalledCmaps * + icws.cmapIDs = (Colormap *)malloc(pScreen->maxInstalledCmaps * sizeof(Colormap)); icws.numCmapIDs = nxagentListInstalledColormaps(pScreen, icws.cmapIDs); icws.numWindows = 0; WalkTree(pScreen, nxagentCountInstalledColormapWindows, (void *)&icws); if (icws.numWindows) { - icws.windows = (Window *)xalloc((icws.numWindows + 1) * sizeof(Window)); + icws.windows = (Window *)malloc((icws.numWindows + 1) * sizeof(Window)); icws.index = 0; WalkTree(pScreen, nxagentGetInstalledColormapWindows, (void *)&icws); icws.windows[icws.numWindows] = nxagentDefaultWindows[pScreen->myNum]; @@ -255,7 +255,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) #ifdef _XSERVER64 { int i; - Window64 *windows = (Window64 *)xalloc(numWindows * sizeof(Window64)); + Window64 *windows = (Window64 *)malloc(numWindows * sizeof(Window64)); for(i = 0; i < numWindows; ++i) windows[i] = icws.windows[i]; @@ -437,7 +437,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors) #ifdef _XSERVER64 { int i; - XColor *pColors64 = (XColor *)xalloc(nColors * sizeof(XColor) ); + XColor *pColors64 = (XColor *)malloc(nColors * sizeof(XColor) ); for(i = 0; i < nColors; ++i) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c index b1449bf13..932f7495f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -231,7 +231,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) bg_color.green = pCursor->backGreen; bg_color.blue = pCursor->backBlue; - pCursor->devPriv[pScreen->myNum] = (void *) xalloc(sizeof(nxagentPrivCursor)); + pCursor->devPriv[pScreen->myNum] = (void *) malloc(sizeof(nxagentPrivCursor)); nxagentCursorPriv(pCursor, pScreen)->cursor = XCreatePixmapCursor(nxagentDisplay, source, mask, &fg_color, diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 27cd0859a..86a338b3d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1272,7 +1272,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio nxagentInitVisuals(); nxagentNumDefaultColormaps = nxagentNumVisuals; - nxagentDefaultColormaps = (Colormap *)xalloc(nxagentNumDefaultColormaps * + nxagentDefaultColormaps = (Colormap *)malloc(nxagentNumDefaultColormaps * sizeof(Colormap)); for (i = 0; i < nxagentNumDefaultColormaps; i++) @@ -1651,7 +1651,7 @@ void nxagentInitPixmapFormats() XXX: Some X server doesn't list 1 among available depths... */ - nxagentPixmapFormats = xalloc((nxagentNumDepths + 1) * sizeof(XPixmapFormatValues)); + nxagentPixmapFormats = malloc((nxagentNumDepths + 1) * sizeof(XPixmapFormatValues)); for (i = 1; i <= MAXDEPTH; i++) { @@ -2063,7 +2063,7 @@ void nxagentBackupDisplayInfo(void) free(nxagentVisualHasBeenIgnored); nxagentVisualHasBeenIgnored = NULL; } - nxagentVisualHasBeenIgnored = xalloc(nxagentNumVisuals * sizeof(Bool)); + nxagentVisualHasBeenIgnored = malloc(nxagentNumVisuals * sizeof(Bool)); nxagentDefaultDepthRecBackup = DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay)); nxagentDisplayWidthRecBackup = DisplayWidth(nxagentDisplay, DefaultScreen(nxagentDisplay)); nxagentDisplayHeightRecBackup = DisplayHeight(nxagentDisplay, DefaultScreen(nxagentDisplay)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index a73040eeb..bf88db38c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -223,7 +223,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask length = nxagentImageLength(width, height, format, leftPad, depth); - if ((data = xalloc(length)) == NULL) + if ((data = malloc(length)) == NULL) { #ifdef WARNING fprintf(stderr, "nxagentSynchronizeDrawableData: WARNING! Failed to allocate memory for the operation.\n"); @@ -2129,7 +2129,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel) format = (depth == 1) ? XYPixmap : ZPixmap; length = nxagentImageLength(1, 1, format, leftPad, depth); - if ((data = xalloc(length)) == NULL) + if ((data = malloc(length)) == NULL) { #ifdef WARNING fprintf(stderr, "nxagentGetColor: WARNING! Failed to allocate memory for the operation.\n"); @@ -2374,7 +2374,7 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion) { pBox = RegionRects(pRegion); - pRects = xalloc(nrects * sizeof(XRectangle)); + pRects = malloc(nrects * sizeof(XRectangle)); for (i = 0; i < nrects; i++) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 22b3e6c88..90f545027 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -330,9 +330,9 @@ void nxagentListRemoteAddName(const char *name, int status) (nxagentRemoteFontList.length - pos) * sizeof(nxagentFontRecPtr)); } - if ((nxagentRemoteFontList.list[pos] = xalloc(sizeof(nxagentFontRec)))) + if ((nxagentRemoteFontList.list[pos] = malloc(sizeof(nxagentFontRec)))) { - nxagentRemoteFontList.list[pos]->name = xalloc(strlen(name) +1); + nxagentRemoteFontList.list[pos]->name = malloc(strlen(name) +1); if (nxagentRemoteFontList.list[pos]->name == NULL) { fprintf(stderr, "Font: remote list name memory allocation failed!.\n"); @@ -538,7 +538,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) name = origName; } - priv = (void *)xalloc(sizeof(nxagentPrivFont)); + priv = (void *)malloc(sizeof(nxagentPrivFont)); FontSetPrivate(pFont, nxagentFontPrivateIndex, priv); nxagentFontPriv(pFont) -> mirrorID = 0; @@ -579,14 +579,14 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) CACHE_SIZE += 100; } - CACHE_ENTRY(CACHE_INDEX) = xalloc(sizeof(nxCacheFontEntryRec)); + CACHE_ENTRY(CACHE_INDEX) = malloc(sizeof(nxCacheFontEntryRec)); if (CACHE_ENTRY(CACHE_INDEX) == NULL) { return False; } - CACHE_NAME(CACHE_INDEX) = xalloc(strlen(name) + 1); + CACHE_NAME(CACHE_INDEX) = malloc(strlen(name) + 1); if (CACHE_NAME(CACHE_INDEX) == NULL) { @@ -753,7 +753,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP fprintf(stderr, "nxagentLoadBestQueryFont: Searching font '%s' .\n", fontName); #endif - substFontBuf = (char *) xalloc(sizeof(char) * 512); + substFontBuf = (char *) malloc(sizeof(char) * 512); numFontFields = nxagentSplitString(fontName, fontNameFields, FIELDS + 1, "-"); @@ -1666,7 +1666,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo register long nbytes; nbytes = pFont -> info.nprops * sizeof(XFontProp); - fs -> properties = (XFontProp *) Xalloc((unsigned) nbytes); + fs -> properties = (XFontProp *) malloc((unsigned) nbytes); if (fs -> properties == NULL) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 21e828769..ef83b871a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -673,7 +673,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) { nRects = RegionNumRects((RegionPtr)pValue); size = nRects * sizeof(*pRects); - pRects = (XRectangle *) xalloc(size); + pRects = (XRectangle *) malloc(size); pBox = RegionRects((RegionPtr)pValue); for (i = nRects; i-- > 0;) @@ -1280,7 +1280,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) { nRects = RegionNumRects((RegionPtr)pValue); size = nRects * sizeof(*pRects); - pRects = (XRectangle *) xalloc(size); + pRects = (XRectangle *) malloc(size); pBox = RegionRects((RegionPtr)pValue); for (i = nRects; i-- > 0;) { pRects[i].x = pBox[i].x1; diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 01a3f6a93..a50a830f9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -754,7 +754,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, length = nxagentImageLength(width, height, format, leftPad, depth); - if ((data = xalloc(length)) == NULL) + if ((data = malloc(length)) == NULL) { #ifdef WARNING fprintf(stderr, "nxagentCopyArea: WARNING! Failed to allocate memory for the operation.\n"); @@ -974,7 +974,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, length = nxagentImageLength(width, height, format, leftPad, depth); - if ((data = xalloc(length)) == NULL) + if ((data = malloc(length)) == NULL) { #ifdef DEBUG fprintf(stderr, "nxagentCopyPlane: WARNING! Failed to allocate memory for the operation.\n"); @@ -1467,7 +1467,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, mode = CoordModePrevious; - newPoints = xalloc(nPoints * sizeof(xPoint)); + newPoints = malloc(nPoints * sizeof(xPoint)); /* * The first point is always relative diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index b7c3135d0..8cc8962cc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -1808,7 +1808,7 @@ char *nxagentAllocateImageData(int width, int height, int depth, int *length, in data = NULL; - if ((data = xalloc(*length)) == NULL) + if ((data = malloc(*length)) == NULL) { #ifdef WARNING fprintf(stderr, "nxagentAllocateImageData: WARNING! Failed to allocate [%d] bytes of memory.\n", *length); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 6bd201d70..e85cdfdb6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -757,7 +757,7 @@ N/A } len = (max_keycode - min_keycode + 1) * mapWidth; - keymap = (KeySym *)xalloc(len * sizeof(KeySym)); + keymap = (KeySym *)malloc(len * sizeof(KeySym)); for(i = 0; i < len; ++i) keymap[i] = keymap64[i]; XFree(keymap64); @@ -1296,7 +1296,7 @@ int nxagentResetKeyboard(void) savedBellPercent, savedBellPitch, savedBellDuration); #endif - devBackup = xalloc(sizeof(DeviceIntRec)); + devBackup = malloc(sizeof(DeviceIntRec)); if (devBackup == NULL) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index d1923106d..b27a92102 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -204,7 +204,7 @@ InitSelections() #ifdef NXAGENT_CLIPBOARD { Selection *newsels; - newsels = (Selection *)xalloc(2 * sizeof(Selection)); + newsels = (Selection *)malloc(2 * sizeof(Selection)); if (!newsels) return; NumCurrentSelections += 2; @@ -750,7 +750,7 @@ ProcSetSelectionOwner(register ClientPtr client) Selection *newsels; if (i == 0) - newsels = (Selection *)xalloc(sizeof(Selection)); + newsels = (Selection *)malloc(sizeof(Selection)); else newsels = (Selection *)xrealloc(CurrentSelections, (NumCurrentSelections + 1) * sizeof(Selection)); @@ -1338,7 +1338,7 @@ InitClientPrivates(ClientPtr client) ppriv = (DevUnion *)(client + 1); else { - ppriv = (DevUnion *)xalloc(totalClientSize - sizeof(ClientRec)); + ppriv = (DevUnion *)malloc(totalClientSize - sizeof(ClientRec)); if (!ppriv) return 0; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index d15df9513..4b0af0867 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -442,7 +442,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) } if (err == FontNameAlias) { if (resolved) free(resolved); - resolved = (char *) xalloc(resolvedlen + 1); + resolved = (char *) malloc(resolvedlen + 1); if (resolved) memmove(resolved, tmpname, resolvedlen + 1); } @@ -497,7 +497,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) c->haveSaved = TRUE; if (c->savedName) free(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); + c->savedName = (char *)malloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); c->savedNameLen = namelen; @@ -638,10 +638,10 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, if (length > XLFDMAXFONTNAMELEN) return BadAlloc; - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) + if (!(c = (LFclosurePtr) malloc(sizeof *c))) return BadAlloc; c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); + malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free(c); return BadAlloc; @@ -786,7 +786,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) c->savedNumFonts = numFonts; if (c->savedName) free(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); + c->savedName = (char *)malloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); aliascount = 20; @@ -1086,7 +1086,7 @@ nxdoListFontsAndAliases(client, fss) } if (err == FontNameAlias) { if (resolved) free(resolved); - resolved = (char *) xalloc(resolvedlen + 1); + resolved = (char *) malloc(resolvedlen + 1); if (resolved) { memmove(resolved, tmpname, resolvedlen); @@ -1155,7 +1155,7 @@ nxdoListFontsAndAliases(client, fss) c->haveSaved = TRUE; if (c->savedName) free(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); + c->savedName = (char *)malloc(namelen + 1); if (c->savedName) { memmove(c->savedName, name, namelen); @@ -1275,7 +1275,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) #ifdef FONTDEBUG char *f; - f = (char *)xalloc(lenfname + 1); + f = (char *)malloc(lenfname + 1); memmove(f, pfontname, lenfname); f[lenfname] = '\0'; ErrorF("OpenFont: fontname is \"%s\"\n", f); @@ -1312,16 +1312,16 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) return Success; } } - if (!(fss = (nxFsPtr) xalloc(sizeof(nxFs)))) + if (!(fss = (nxFsPtr) malloc(sizeof(nxFs)))) return BadAlloc; - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) + if (!(c = (LFclosurePtr) malloc(sizeof *c))) { free(fss); return BadAlloc; } c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); + malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free(c); free(fss); @@ -1351,7 +1351,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) c->slept = FALSE; c->savedName = 0; - oc = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); + oc = (OFclosurePtr) malloc(sizeof(OFclosureRec)); if (!oc) { for (i = 0; i < c->num_fpes; i++) @@ -1361,7 +1361,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) free(fss); return BadAlloc; } - oc->fontname = (char *) xalloc(256);/* I don't want to deal with future reallocs errors */ + oc->fontname = (char *) malloc(256);/* I don't want to deal with future reallocs errors */ oc->origFontName = pfontname; oc->origFontNameLen = lenfname; if (!oc->fontname) { @@ -1378,7 +1378,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) * while we're blocking, the request still appears atomic */ oc->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); + malloc(sizeof(FontPathElementPtr) * num_fpes); if (!oc->fpe_list) { free(oc->fontname); free(oc); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c index 53a5a8d68..430fb6baf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c @@ -101,7 +101,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns pScreen = screenInfo.screens[0]; nby = BitmapBytePad(cm->width) * (long)cm->height; - pbits = (char *)xalloc(nby); + pbits = (char *)malloc(nby); if (!pbits) return BadAlloc; /* zeroing the (pad) bits seems to help some ddx cursor handling */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c index bdc0bc316..15798bc77 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c @@ -87,7 +87,7 @@ miGlyphs (CARD8 op, } else { - nxagentGlyphsExtents = (BoxPtr) xalloc(sizeof(BoxRec)); + nxagentGlyphsExtents = (BoxPtr) malloc(sizeof(BoxRec)); miGlyphExtents (nlist, list, glyphs, &extents); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c index 1ef445af5..8db856d0a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c @@ -80,7 +80,7 @@ miTrapezoids (CARD8 op, } else { - nxagentTrapezoidExtents = (BoxPtr) xalloc(sizeof(BoxRec)); + nxagentTrapezoidExtents = (BoxPtr) malloc(sizeof(BoxRec)); miTrapezoidBounds (ntrap, traps, &bounds); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index 44248bc1b..83133cb36 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -87,7 +87,7 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) nxagentPictureCreateDefaultFormats(pScreen, formats, &nformats); - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); + pFormats = (PictFormatPtr) malloc (nformats * sizeof (PictFormatRec)); if (!pFormats) return 0; memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); @@ -190,7 +190,7 @@ AllocatePicture (ScreenPtr pScreen) unsigned int size; int i; - pPicture = (PicturePtr) xalloc (ps->totalPictureSize); + pPicture = (PicturePtr) malloc (ps->totalPictureSize); if (!pPicture) return 0; ppriv = (DevUnion *)(pPicture + 1); @@ -281,7 +281,7 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill)); + pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -318,7 +318,7 @@ static PicturePtr createSourcePicture(void) picturePrivateCount * sizeof(DevUnion) + sizeof(nxagentPrivPictureRec); - pPicture = (PicturePtr) xalloc(totalPictureSize); + pPicture = (PicturePtr) malloc(totalPictureSize); if (pPicture != NULL) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 0ace2fbd2..4b4e059bd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -227,10 +227,10 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, { if (!pWin->optional && !MakeWindowOptional (pWin)) return(BadAlloc); - pProp = (PropertyPtr)xalloc(sizeof(PropertyRec)); + pProp = (PropertyPtr)malloc(sizeof(PropertyRec)); if (!pProp) return(BadAlloc); - data = (void *)xalloc(totalSize); + data = (void *)malloc(totalSize); if (!data && len) { free(pProp); @@ -290,7 +290,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, } else if (mode == PropModePrepend) { - data = (void *)xalloc(sizeInBytes * (len + pProp->size)); + data = (void *)malloc(sizeInBytes * (len + pProp->size)); if (!data) return(BadAlloc); memmove(&((char *)data)[totalSize], (char *)pProp->data, diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index b89b835db..d14b47866 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -224,7 +224,7 @@ ProcRenderQueryPictFormats (ClientPtr client) ndepth * sizeof (xPictDepth) + nvisual * sizeof (xPictVisual) + numSubpixel * sizeof (CARD32)); - reply = (xRenderQueryPictFormatsReply *) xalloc (rlength); + reply = (xRenderQueryPictFormatsReply *) malloc (rlength); if (!reply) return BadAlloc; memset(reply, 0, rlength); @@ -712,7 +712,7 @@ ProcRenderTrapezoids (ClientPtr client) { if (pFormat != NULL) { - nxagentTrapezoidExtents = (BoxPtr) xalloc(sizeof(BoxRec)); + nxagentTrapezoidExtents = (BoxPtr) malloc(sizeof(BoxRec)); miTrapezoidBounds (ntraps, (xTrapezoid *) &stuff[1], nxagentTrapezoidExtents); } @@ -996,7 +996,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) return BadAlloc; } - elementsBase = xalloc(nlist * sizeof(XGlyphElt8)); + elementsBase = malloc(nlist * sizeof(XGlyphElt8)); if (!elementsBase) return BadAlloc; @@ -1098,7 +1098,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) * after the X requests. */ - nxagentGlyphsExtents = (BoxPtr) xalloc(sizeof(BoxRec)); + nxagentGlyphsExtents = (BoxPtr) malloc(sizeof(BoxRec)); miGlyphExtents(nlist, listsBase, glyphsBase, nxagentGlyphsExtents); @@ -1219,19 +1219,19 @@ ProcRenderCreateCursor (ClientPtr client) if ( stuff->x > width || stuff->y > height ) return (BadMatch); - argbbits = xalloc (width * height * sizeof (CARD32)); + argbbits = malloc (width * height * sizeof (CARD32)); if (!argbbits) return (BadAlloc); stride = BitmapBytePad(width); nbytes_mono = stride*height; - srcbits = (unsigned char *)xalloc(nbytes_mono); + srcbits = (unsigned char *)malloc(nbytes_mono); if (!srcbits) { free (argbbits); return (BadAlloc); } - mskbits = (unsigned char *)xalloc(nbytes_mono); + mskbits = (unsigned char *)malloc(nbytes_mono); if (!mskbits) { free(argbbits); @@ -1477,7 +1477,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) if (client->req_len & 1) return BadLength; ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1; - cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); + cursors = malloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); if (!cursors) return BadAlloc; deltas = (CARD32 *) (cursors + ncursor); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c index 4226a4435..eb48c5094 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c @@ -257,7 +257,7 @@ AddResource(XID id, RESTYPE type, void * value) (rrec->hashsize < MAXHASHSIZE)) RebuildTable(client); head = &rrec->resources[Hash(client, id)]; - res = (ResourcePtr)xalloc(sizeof(ResourceRec)); + res = (ResourcePtr)malloc(sizeof(ResourceRec)); if (!res) { (*DeleteFuncs[type & TypeMask])(value, id); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index 08237440f..86b9e0d24 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -234,7 +234,7 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) length = nxagentImageLength(sw, sh, format, 0, depth); - if ((newdata = xalloc(length)) != NULL) + if ((newdata = malloc(length)) != NULL) { fbGetImage((DrawablePtr) pPixmap, sx, sy, sw, sh, format, AllPlanes, newdata); (*pGC->ops->PutImage)(dst, pGC, depth, dx, dy, sw, sh, 0, format, newdata); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index 0eabf1262..931c564dc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -1251,7 +1251,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, nxagentFBTrap = 1; - if ((data = xalloc(length)) != NULL) + if ((data = malloc(length)) != NULL) { fbGetImage(nxagentVirtualDrawable(pDrawable), xPict, yPict, width, height, format, 0xffffffff, data); @@ -1373,7 +1373,7 @@ FIXME: If the pixmap has a different depth from the window, the length = nxagentImageLength(width, height, format, 0, depth); - if ((data = xalloc(length)) == NULL) + if ((data = malloc(length)) == NULL) { #ifdef WARNING fprintf(stderr, "nxagentPixmapOnShadowDisplay: WARNING! Failed to allocate memory for the operation.\n"); @@ -1535,7 +1535,7 @@ Bool nxagentFbOnShadowDisplay() length = nxagentImageLength(width, height, format, 0, depth); - if ((data = xalloc(length)) == NULL) + if ((data = malloc(length)) == NULL) { #ifdef WARNING fprintf(stderr, "nxagentFbOnShadowDisplay: WARNING! Failed to allocate memory for the operation.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 587e9a564..74c7587c7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -329,17 +329,17 @@ void nxagentInitReconnector(void) { nxagentReconnectTrap = 0; - reconnectLossyLevel[DISPLAY_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[SCREEN_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[FONT_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[PIXMAP_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[GC_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[CURSOR_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[COLORMAP_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[WINDOW_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[GLYPHSET_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[PICTFORMAT_STEP] = xalloc(sizeof(int)); - reconnectLossyLevel[PICTURE_STEP] = xalloc(sizeof(int)); + reconnectLossyLevel[DISPLAY_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[SCREEN_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[FONT_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[PIXMAP_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[GC_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[CURSOR_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[COLORMAP_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[WINDOW_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[GLYPHSET_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[PICTFORMAT_STEP] = malloc(sizeof(int)); + reconnectLossyLevel[PICTURE_STEP] = malloc(sizeof(int)); } void nxagentDisconnectSession(void) @@ -434,7 +434,7 @@ Bool nxagentReconnectSession(void) size = strlen(nxagentKeyboard); - if ((nxagentOldKeyboard = xalloc(size + 1)) != NULL) + if ((nxagentOldKeyboard = malloc(size + 1)) != NULL) { strncpy(nxagentOldKeyboard, nxagentKeyboard, size); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 36ce6a74f..4c9edb849 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -270,11 +270,11 @@ void nxagentRenderExtensionInit() int nxagentCursorSaveRenderInfo(ScreenPtr pScreen, CursorPtr pCursor) { - pCursor -> devPriv[pScreen -> myNum] = xalloc(sizeof(nxagentPrivCursor)); + pCursor -> devPriv[pScreen -> myNum] = malloc(sizeof(nxagentPrivCursor)); if (nxagentCursorPriv(pCursor, pScreen) == NULL) { - FatalError("xalloc failed"); + FatalError("malloc failed"); } nxagentCursorUsesRender(pCursor, pScreen) = 1; @@ -2249,7 +2249,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, if (sizeImages > 0) { - normalizedImages = xalloc(sizeImages); + normalizedImages = malloc(sizeImages); if (normalizedImages != NULL) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 6947371ff..d5c6e71c9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -305,7 +305,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) XID values[2]; Mask mask; - toplevel = xalloc(sizeof(WindowPtr) * nchildren); + toplevel = malloc(sizeof(WindowPtr) * nchildren); ntoplevel = 0; for(i = 0; i < nchildren; i++) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index a4c6fc2db..152040fbd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1149,13 +1149,13 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, * Initialize the depths. */ - depths = (DepthPtr) xalloc(nxagentNumDepths * sizeof(DepthRec)); + depths = (DepthPtr) malloc(nxagentNumDepths * sizeof(DepthRec)); for (i = 0; i < nxagentNumDepths; i++) { depths[i].depth = nxagentDepths[i]; depths[i].numVids = 0; - depths[i].vids = (VisualID *) xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); + depths[i].vids = (VisualID *) malloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); } /* @@ -1170,7 +1170,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, numVisuals = 0; numDepths = nxagentNumDepths; - visuals = (VisualPtr) xalloc(nxagentNumVisuals * sizeof(VisualRec)); + visuals = (VisualPtr) malloc(nxagentNumVisuals * sizeof(VisualRec)); for (i = 0; i < nxagentNumVisuals; i++) { @@ -1250,7 +1250,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, depths[depthIndex].depth = nxagentVisuals[i].depth; depths[depthIndex].numVids = 0; - depths[depthIndex].vids = (VisualID *) xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); + depths[depthIndex].vids = (VisualID *) malloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); numDepths++; } @@ -1302,7 +1302,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, "[%d] bitsPerPixel [%d] sizeInBytes [%d]\n", rootDepth, bitsPerPixel, sizeInBytes); #endif - pFrameBufferBits = (char *) Xalloc(sizeInBytes); + pFrameBufferBits = (char *) malloc(sizeInBytes); if (!pFrameBufferBits) { @@ -3068,12 +3068,12 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr free(tBuffer); } - tBuffer = xalloc(length); + tBuffer = malloc(length); if (tBuffer == NULL) { #ifdef PANIC - fprintf(stderr, "nxagentShadowPoll: xalloc failed.\n"); + fprintf(stderr, "nxagentShadowPoll: malloc failed.\n"); #endif return -1; @@ -3166,7 +3166,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height, length = nxagentImageLength(width, height, ZPixmap, 0, nxagentShadowDepth); - cBuffer = xalloc(length); + cBuffer = malloc(length); icBuffer = cBuffer; pVisual = nxagentImageVisual((DrawablePtr) nxagentShadowPixmapPtr, nxagentShadowDepth); @@ -3423,7 +3423,7 @@ FIXME: The port information is not used at the moment and produces a #endif - local_buf = (char *) xalloc(strlen((char*)pszReturnData) + 100); + local_buf = (char *) malloc(strlen((char*)pszReturnData) + 100); if (local_buf) { @@ -3771,7 +3771,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) if (screeninfo) { free(screeninfo); } - if (!(screeninfo = xalloc(sizeof(XineramaScreenInfo)))) { + if (!(screeninfo = malloc(sizeof(XineramaScreenInfo)))) { return FALSE; } @@ -4157,7 +4157,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, nRects = RegionNumRects(&cleanRegion); size = nRects * sizeof(*pRects); - pRects = (XRectangle *) xalloc(size); + pRects = (XRectangle *) malloc(size); pBox = RegionRects(&cleanRegion); for (i = nRects; i-- > 0;) @@ -4303,7 +4303,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, nRects = RegionNumRects(clipRegion); size = nRects * sizeof(*pRects); - pRects = (XRectangle *) xalloc(size); + pRects = (XRectangle *) malloc(size); pBox = RegionRects(clipRegion); for (i = nRects; i-- > 0;) @@ -4511,10 +4511,10 @@ void nxagentShowPixmap(PixmapPtr pPixmap, int x, int y, int width, int height) length = nxagentImageLength(width, height, format, 0, depth); - if ((data = xalloc(length)) == NULL) + if ((data = malloc(length)) == NULL) { #ifdef WARNING - fprintf(stderr, "nxagentShowPixmap: xalloc failed.\n"); + fprintf(stderr, "nxagentShowPixmap: malloc failed.\n"); #endif return; @@ -4607,10 +4607,10 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc, length = nxagentImageLength(width, height, format, 0, depth); - if ((data = xalloc(length)) == NULL) + if ((data = malloc(length)) == NULL) { #ifdef WARNING - fprintf(stderr, "nxagentFbRestoreArea: xalloc failed.\n"); + fprintf(stderr, "nxagentFbRestoreArea: malloc failed.\n"); #endif return; diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 3b6a40b46..342913b4a 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -52,7 +52,7 @@ SOFTWARE. #define OS_H #include "misc.h" -#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size)) +#define ALLOCATE_LOCAL_FALLBACK(_size) malloc((unsigned long)(_size)) #define DEALLOCATE_LOCAL_FALLBACK(_ptr) free((void *)(_ptr)) #include #ifndef IN_MODULE diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c index b268c1140..c1e07f175 100644 --- a/nx-X11/programs/Xserver/mi/miarc.c +++ b/nx-X11/programs/Xserver/mi/miarc.c @@ -912,7 +912,7 @@ miComputeWideEllipse( { if (spdata) free(spdata); - spdata = (miArcSpanData *)xalloc(sizeof(miArcSpanData) + + spdata = (miArcSpanData *)malloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2)); lruent->spdata = spdata; if (!spdata) @@ -1396,7 +1396,7 @@ miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft, arc.height = width; arc.angle1 = -miDatan2 (corner.y - center.y, corner.x - center.x); arc.angle2 = a; - pArcPts = (SppPointPtr) xalloc (3 * sizeof (SppPointRec)); + pArcPts = (SppPointPtr) malloc (3 * sizeof (SppPointRec)); if (!pArcPts) return; pArcPts[0].x = otherCorner.x; @@ -1641,10 +1641,10 @@ miDatan2 (double dy, double dx) * This procedure allocates the space necessary to fit the arc points. * Sometimes it's convenient for those points to be at the end of an existing * array. (For example, if we want to leave a spare point to make sectors - * instead of segments.) So we pass in the xalloc()ed chunk that contains the + * instead of segments.) So we pass in the malloc()ed chunk that contains the * array and an index saying where we should start stashing the points. * If there isn't an array already, we just pass in a null pointer and - * count on xrealloc() to handle the null pointer correctly. + * count on realloc() to handle the null pointer correctly. */ static int miGetArcPts( @@ -1691,7 +1691,7 @@ miGetArcPts( count++; cdt = 2 * miDcos(dt); - if (!(poly = (SppPointPtr) xrealloc((void *)*ppPts, + if (!(poly = (SppPointPtr) realloc((void *)*ppPts, (cpt + count) * sizeof(SppPointRec)))) return(0); *ppPts = poly; @@ -1933,7 +1933,7 @@ miComputeArcs ( data = (struct arcData *) ALLOCATE_LOCAL (narcs * sizeof (struct arcData)); if (!data) return (miPolyArcPtr)NULL; - arcs = (miPolyArcPtr) xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1)); + arcs = (miPolyArcPtr) malloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1)); if (!arcs) { DEALLOCATE_LOCAL(data); @@ -3146,7 +3146,7 @@ realAllocSpan () register struct finalSpan *span; register int i; - newChunk = (struct finalSpanChunk *) xalloc (sizeof (struct finalSpanChunk)); + newChunk = (struct finalSpanChunk *) malloc (sizeof (struct finalSpanChunk)); if (!newChunk) return (struct finalSpan *) NULL; newChunk->next = chunks; @@ -3251,7 +3251,7 @@ realFindSpan (int y) else change = SPAN_REALLOC; newSize = finalSize + change; - newSpans = (struct finalSpan **) xalloc + newSpans = (struct finalSpan **) malloc (newSize * sizeof (struct finalSpan *)); if (!newSpans) return (struct finalSpan **)NULL; diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c index ae30d5238..bded0850a 100644 --- a/nx-X11/programs/Xserver/mi/mibitblt.c +++ b/nx-X11/programs/Xserver/mi/mibitblt.c @@ -239,7 +239,7 @@ miCopyArea(pSrcDrawable, pDstDrawable, ppt++->y = y++; *pwidth++ = width; } - pbits = (unsigned int *)xalloc(height * PixmapBytePad(width, + pbits = (unsigned int *)malloc(height * PixmapBytePad(width, pSrcDrawable->depth)); if (pbits) { @@ -318,7 +318,7 @@ miGetPlane( sy += pDraw->y; widthInBytes = BitmapBytePad(w); if(!result) - result = (MiBits *)xalloc(h * widthInBytes); + result = (MiBits *)malloc(h * widthInBytes); if (!result) return (MiBits *)NULL; bitsPerPixel = pDraw->bitsPerPixel; diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index d3dc11603..5001eae6f 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -373,7 +373,7 @@ miInitializeBackingStore (pScreen) } if (!AllocateGCPrivate(pScreen, miBSGCIndex, 0)) return; - pScreenPriv = (miBSScreenPtr) xalloc (sizeof (miBSScreenRec)); + pScreenPriv = (miBSScreenPtr) malloc (sizeof (miBSScreenRec)); if (!pScreenPriv) return; @@ -903,7 +903,7 @@ miBSCreateGCPrivate (pGC) { miBSGCRec *pPriv; - pPriv = (miBSGCRec *) xalloc (sizeof (miBSGCRec)); + pPriv = (miBSGCRec *) malloc (sizeof (miBSGCRec)); if (!pPriv) return FALSE; pPriv->pBackingGC = NULL; @@ -2581,7 +2581,7 @@ miBSAllocate(pWin) if (!(pBackingStore = (miBSWindowPtr)pWin->backStorage)) { - pBackingStore = (miBSWindowPtr)xalloc(sizeof(miBSWindowRec)); + pBackingStore = (miBSWindowPtr)malloc(sizeof(miBSWindowRec)); if (!pBackingStore) return; diff --git a/nx-X11/programs/Xserver/mi/micmap.c b/nx-X11/programs/Xserver/mi/micmap.c index 607ecec3b..1d79ade9b 100644 --- a/nx-X11/programs/Xserver/mi/micmap.c +++ b/nx-X11/programs/Xserver/mi/micmap.c @@ -406,7 +406,7 @@ miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, miVisualsPtr new, *prev, v; int count; - new = (miVisualsPtr) xalloc (sizeof *new); + new = (miVisualsPtr) malloc (sizeof *new); if (!new) return FALSE; if (!redMask || !greenMask || !blueMask) @@ -560,9 +560,9 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, ndepth++; nvisual += visuals->count; } - depth = (DepthPtr) xalloc (ndepth * sizeof (DepthRec)); - visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec)); - preferredCVCs = (int *)xalloc(ndepth * sizeof(int)); + depth = (DepthPtr) malloc (ndepth * sizeof (DepthRec)); + visual = (VisualPtr) malloc (nvisual * sizeof (VisualRec)); + preferredCVCs = (int *)malloc(ndepth * sizeof(int)); if (!depth || !visual || !preferredCVCs) { free (depth); @@ -586,7 +586,7 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, vid = NULL; if (nvtype) { - vid = (VisualID *) xalloc (nvtype * sizeof (VisualID)); + vid = (VisualID *) malloc (nvtype * sizeof (VisualID)); if (!vid) return FALSE; } diff --git a/nx-X11/programs/Xserver/mi/midispcur.c b/nx-X11/programs/Xserver/mi/midispcur.c index 5d4b3023a..4d5e055eb 100644 --- a/nx-X11/programs/Xserver/mi/midispcur.c +++ b/nx-X11/programs/Xserver/mi/midispcur.c @@ -126,7 +126,7 @@ miDCInitialize (pScreen, screenFuncs) return FALSE; miDCGeneration = serverGeneration; } - pScreenPriv = (miDCScreenPtr) xalloc (sizeof (miDCScreenRec)); + pScreenPriv = (miDCScreenPtr) malloc (sizeof (miDCScreenRec)); if (!pScreenPriv) return FALSE; @@ -250,7 +250,7 @@ miDCRealize ( GCPtr pGC; XID gcvals[3]; - pPriv = (miDCCursorPtr) xalloc (sizeof (miDCCursorRec)); + pPriv = (miDCCursorPtr) malloc (sizeof (miDCCursorRec)); if (!pPriv) return (miDCCursorPtr)NULL; #ifdef ARGB_CURSOR diff --git a/nx-X11/programs/Xserver/mi/migc.c b/nx-X11/programs/Xserver/mi/migc.c index 0ca7872a3..58a00ddd1 100644 --- a/nx-X11/programs/Xserver/mi/migc.c +++ b/nx-X11/programs/Xserver/mi/migc.c @@ -71,7 +71,7 @@ miCreateGCOps(prototype) GCOpsPtr ret; /* XXX */ Must_have_memory = TRUE; - ret = (GCOpsPtr) xalloc(sizeof(GCOps)); + ret = (GCOpsPtr) malloc(sizeof(GCOps)); /* XXX */ Must_have_memory = FALSE; if (!ret) return 0; diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c index 1c0402892..cff29ee2a 100644 --- a/nx-X11/programs/Xserver/mi/mioverlay.c +++ b/nx-X11/programs/Xserver/mi/mioverlay.c @@ -125,7 +125,7 @@ miInitOverlay( sizeof(miOverlayWindowRec))) return FALSE; - if(!(pScreenPriv = xalloc(sizeof(miOverlayScreenRec)))) + if(!(pScreenPriv = malloc(sizeof(miOverlayScreenRec)))) return FALSE; pScreen->devPrivates[miOverlayScreenIndex].ptr = (void *)pScreenPriv; diff --git a/nx-X11/programs/Xserver/mi/mipointer.c b/nx-X11/programs/Xserver/mi/mipointer.c index 48da4b6c3..3e9fd0760 100644 --- a/nx-X11/programs/Xserver/mi/mipointer.c +++ b/nx-X11/programs/Xserver/mi/mipointer.c @@ -88,7 +88,7 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate) return FALSE; miPointerGeneration = serverGeneration; } - pScreenPriv = (miPointerScreenPtr) xalloc (sizeof (miPointerScreenRec)); + pScreenPriv = (miPointerScreenPtr) malloc (sizeof (miPointerScreenRec)); if (!pScreenPriv) return FALSE; pScreenPriv->spriteFuncs = spriteFuncs; diff --git a/nx-X11/programs/Xserver/mi/mipolyutil.c b/nx-X11/programs/Xserver/mi/mipolyutil.c index 7a9794fe3..f88d03d54 100644 --- a/nx-X11/programs/Xserver/mi/mipolyutil.c +++ b/nx-X11/programs/Xserver/mi/mipolyutil.c @@ -106,7 +106,7 @@ miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock) if (*iSLLBlock > SLLSPERBLOCK-1) { tmpSLLBlock = - (ScanLineListBlock *)xalloc(sizeof(ScanLineListBlock)); + (ScanLineListBlock *)malloc(sizeof(ScanLineListBlock)); if (!tmpSLLBlock) return FALSE; (*SLLBlock)->next = tmpSLLBlock; diff --git a/nx-X11/programs/Xserver/mi/mipushpxl.c b/nx-X11/programs/Xserver/mi/mipushpxl.c index 83821b266..084597392 100644 --- a/nx-X11/programs/Xserver/mi/mipushpxl.c +++ b/nx-X11/programs/Xserver/mi/mipushpxl.c @@ -113,7 +113,7 @@ miPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) LONG2CHARSDIFFORDER((MiBits)(-1) >> 1); #endif - pwLineStart = (MiBits *)xalloc(BitmapBytePad(dx)); + pwLineStart = (MiBits *)malloc(BitmapBytePad(dx)); if (!pwLineStart) return; ipt = 0; diff --git a/nx-X11/programs/Xserver/mi/miscrinit.c b/nx-X11/programs/Xserver/mi/miscrinit.c index c0df4a072..f2b009fcd 100644 --- a/nx-X11/programs/Xserver/mi/miscrinit.c +++ b/nx-X11/programs/Xserver/mi/miscrinit.c @@ -197,7 +197,7 @@ miScreenDevPrivateInit(pScreen, width, pbits) * to the screen, until CreateScreenResources can put them in the * screen pixmap. */ - pScrInitParms = (miScreenInitParmsPtr)xalloc(sizeof(miScreenInitParmsRec)); + pScrInitParms = (miScreenInitParmsPtr)malloc(sizeof(miScreenInitParmsRec)); if (!pScrInitParms) return FALSE; pScrInitParms->pbits = pbits; diff --git a/nx-X11/programs/Xserver/mi/mispans.c b/nx-X11/programs/Xserver/mi/mispans.c index 107476df3..38398f86b 100644 --- a/nx-X11/programs/Xserver/mi/mispans.c +++ b/nx-X11/programs/Xserver/mi/mispans.c @@ -418,8 +418,8 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) ylength = spanGroup->ymax - ymin + 1; /* Allocate Spans for y buckets */ - yspans = (Spans *) xalloc(ylength * sizeof(Spans)); - ysizes = (int *) xalloc(ylength * sizeof (int)); + yspans = (Spans *) malloc(ylength * sizeof(Spans)); + ysizes = (int *) malloc(ylength * sizeof (int)); if (!yspans || !ysizes) { @@ -492,8 +492,8 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) } /* for i thorough Spans */ /* Now sort by x and uniquify each bucket into the final array */ - points = (DDXPointPtr) xalloc(count * sizeof(DDXPointRec)); - widths = (int *) xalloc(count * sizeof(int)); + points = (DDXPointPtr) malloc(count * sizeof(DDXPointRec)); + widths = (int *) malloc(count * sizeof(int)); if (!points || !widths) { int i; diff --git a/nx-X11/programs/Xserver/mi/misprite.c b/nx-X11/programs/Xserver/mi/misprite.c index 2b68ad76a..b1555ec1b 100644 --- a/nx-X11/programs/Xserver/mi/misprite.c +++ b/nx-X11/programs/Xserver/mi/misprite.c @@ -169,7 +169,7 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs) miSpriteGeneration = serverGeneration; } - pScreenPriv = (miSpriteScreenPtr) xalloc (sizeof (miSpriteScreenRec)); + pScreenPriv = (miSpriteScreenPtr) malloc (sizeof (miSpriteScreenRec)); if (!pScreenPriv) return FALSE; diff --git a/nx-X11/programs/Xserver/mi/miwideline.c b/nx-X11/programs/Xserver/mi/miwideline.c index f3e8c691a..b96db7cfa 100644 --- a/nx-X11/programs/Xserver/mi/miwideline.c +++ b/nx-X11/programs/Xserver/mi/miwideline.c @@ -127,10 +127,10 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height, } else { - spanRec.points = (DDXPointPtr) xalloc (overall_height * sizeof (*ppt)); + spanRec.points = (DDXPointPtr) malloc (overall_height * sizeof (*ppt)); if (!spanRec.points) return; - spanRec.widths = (int *) xalloc (overall_height * sizeof (int)); + spanRec.widths = (int *) malloc (overall_height * sizeof (int)); if (!spanRec.widths) { free (spanRec.points); @@ -231,10 +231,10 @@ miFillRectPolyHelper ( } else { - spanRec.points = (DDXPointPtr) xalloc (h * sizeof (*ppt)); + spanRec.points = (DDXPointPtr) malloc (h * sizeof (*ppt)); if (!spanRec.points) return; - spanRec.widths = (int *) xalloc (h * sizeof (int)); + spanRec.widths = (int *) malloc (h * sizeof (int)); if (!spanRec.widths) { free (spanRec.points); @@ -1076,10 +1076,10 @@ miLineArc ( } else { - points = (DDXPointPtr) xalloc (pGC->lineWidth * sizeof (DDXPointRec)); + points = (DDXPointPtr) malloc (pGC->lineWidth * sizeof (DDXPointRec)); if (!points) return; - widths = (int *) xalloc (pGC->lineWidth * sizeof (int)); + widths = (int *) malloc (pGC->lineWidth * sizeof (int)); if (!widths) { free (points); diff --git a/nx-X11/programs/Xserver/miext/cw/cw.c b/nx-X11/programs/Xserver/miext/cw/cw.c index 5b2c65927..8aca3edf7 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw.c +++ b/nx-X11/programs/Xserver/miext/cw/cw.c @@ -641,7 +641,7 @@ miInitializeCompositeWrapper(ScreenPtr pScreen) if (!AllocatePicturePrivate(pScreen, cwPictureIndex, 0)) return; #endif - pScreenPriv = (cwScreenPtr)xalloc(sizeof(cwScreenRec)); + pScreenPriv = (cwScreenPtr)malloc(sizeof(cwScreenRec)); if (!pScreenPriv) return; diff --git a/nx-X11/programs/Xserver/miext/cw/cw_render.c b/nx-X11/programs/Xserver/miext/cw/cw_render.c index 2710bf60f..ac4230a03 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw_render.c +++ b/nx-X11/programs/Xserver/miext/cw/cw_render.c @@ -74,7 +74,7 @@ cwCreatePicturePrivate (PicturePtr pPicture) int error; cwPicturePtr pPicturePrivate; - pPicturePrivate = xalloc (sizeof (cwPictureRec)); + pPicturePrivate = malloc (sizeof (cwPictureRec)); if (!pPicturePrivate) return NULL; diff --git a/nx-X11/programs/Xserver/miext/damage/damage.c b/nx-X11/programs/Xserver/miext/damage/damage.c index 2d6783204..669f08ff5 100755 --- a/nx-X11/programs/Xserver/miext/damage/damage.c +++ b/nx-X11/programs/Xserver/miext/damage/damage.c @@ -1770,7 +1770,7 @@ DamageSetup (ScreenPtr pScreen) if (!AllocateWindowPrivate (pScreen, damageWinPrivateIndex, 0)) return FALSE; - pScrPriv = (DamageScrPrivPtr) xalloc (sizeof (DamageScrPrivRec)); + pScrPriv = (DamageScrPrivPtr) malloc (sizeof (DamageScrPrivRec)); if (!pScrPriv) return FALSE; @@ -1818,7 +1818,7 @@ DamageCreate (DamageReportFunc damageReport, { DamagePtr pDamage; - pDamage = xalloc (sizeof (DamageRec)); + pDamage = malloc (sizeof (DamageRec)); if (!pDamage) return 0; pDamage->pNext = 0; diff --git a/nx-X11/programs/Xserver/os/Imakefile b/nx-X11/programs/Xserver/os/Imakefile index 00d28deb1..802725306 100644 --- a/nx-X11/programs/Xserver/os/Imakefile +++ b/nx-X11/programs/Xserver/os/Imakefile @@ -91,11 +91,6 @@ COLOR_SRCS=oscolor.c COLOR_OBJS=oscolor.o #endif -#if UseInternalMalloc -MALLOC_SRCS=xalloc.c -MALLOC_OBJS=xalloc.o -#endif - #if !HasSnprintf SNPRINTF_SRCS = snprintf.c SNPRINTF_OBJS = snprintf.o @@ -119,19 +114,13 @@ BOOTSTRAPCFLAGS = osinit.c utils.c log.c auth.c mitauth.c secauth.c \ $(XDMAUTHSRCS) $(RPCSRCS) xdmcp.c OtherSources \ transport.c $(SNPRINTF_SRCS) $(STRLCAT_SRCS) \ - $(MALLOC_SRCS) xprintf.c + xprintf.c OBJS = WaitFor.o access.o connection.o io.o $(COLOR_OBJS) \ osinit.o utils.o log.o auth.o mitauth.o secauth.o \ $(XDMAUTHOBJS) $(RPCOBJS) xdmcp.o OtherObjects \ transport.o $(SNPRINTF_OBJS) $(STRLCAT_OBJS) \ - $(MALLOC_OBJS) xprintf.o + xprintf.o -#if SpecialMalloc - MEM_DEFINES = -DSPECIAL_MALLOC -#endif /* SpecialMalloc */ -#if UseInternalMalloc - MEM_DEFINES = -DINTERNAL_MALLOC -#endif #if UseMemLeak MEM_DEFINES = -DMEMBUG #endif @@ -141,7 +130,6 @@ BOOTSTRAPCFLAGS = DBM_DEFINES = NdbmDefines ADM_DEFINES = -DADMPATH=\"$(ADMDIR)/X\%smsgs\" XDMCP_DEFINES = ServerXdmcpDefines - XALLOC_DEFINES = XallocDefines ERROR_DEFINES = ServerErrorDefines #if HasPam && HasPamMisc PAM_DEFINES = -DUSE_PAM @@ -189,7 +177,6 @@ SpecialCObjectRule(osinit,$(ICONFIGFILES),$(ADM_DEFINES)) SpecialCObjectRule(WaitFor,$(ICONFIGFILES),$(EXT_DEFINES)) SpecialCObjectRule(io,$(ICONFIGFILES),$(EXT_DEFINES)) SpecialCObjectRule(utils,$(ICONFIGFILES),$(XDMCP_DEFINES) $(EXT_DEFINES) $(ERROR_DEFINES) $(PAM_DEFINES)) -SpecialCObjectRule(xalloc,$(ICONFIGFILES),$(XALLOC_DEFINES)) #if defined(SparcArchitecture) && HasGcc && !HasGcc2 oscolor.o: oscolor.c $(ICONFIGFILES) $(RM) $@ diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index f9037ed3b..0f23c9d4a 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -650,7 +650,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis, if (!timer) { - timer = (OsTimerPtr)xalloc(sizeof(struct _OsTimerRec)); + timer = (OsTimerPtr)malloc(sizeof(struct _OsTimerRec)); if (!timer) return NULL; } diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index dcd2b52af..4090a9589 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -256,7 +256,7 @@ typedef struct _host { int requested; } HOST; -#define MakeHost(h,l) (h)=(HOST *) xalloc(sizeof *(h)+(l));\ +#define MakeHost(h,l) (h)=(HOST *) malloc(sizeof *(h)+(l));\ if (h) { \ (h)->addr=(unsigned char *) ((h) + 1);\ (h)->requested = FALSE; \ @@ -782,7 +782,7 @@ DefineSelf (int fd) Error ("Getting interface count"); if (len < (ifn.lifn_count * sizeof(struct lifreq))) { len = ifn.lifn_count * sizeof(struct lifreq); - bufptr = xalloc(len); + bufptr = malloc(len); } #endif @@ -1477,7 +1477,7 @@ LocalClientCredAndGroups(ClientPtr client, int *pUid, int *pGid, const gid_t *gids; *nSuppGids = ucred_getgroups(peercred, &gids); if (*nSuppGids > 0) { - *pSuppGids = xalloc(sizeof(int) * (*nSuppGids)); + *pSuppGids = malloc(sizeof(int) * (*nSuppGids)); if (*pSuppGids == NULL) { *nSuppGids = 0; } else { @@ -1691,7 +1691,7 @@ GetHosts ( } if (n) { - *data = ptr = (void *) xalloc (n); + *data = ptr = (void *) malloc (n); if (!ptr) { return(BadAlloc); @@ -1951,7 +1951,7 @@ siTypeAdd(const char *typeName, siAddrMatchFunc addrMatch, } } - s = (struct siType *) xalloc(sizeof(struct siType)); + s = (struct siType *) malloc(sizeof(struct siType)); if (s == NULL) return BadAlloc; @@ -2293,7 +2293,7 @@ static Bool siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id) { Bool parsedOK = FALSE; - char *addrbuf = xalloc(len + 1); + char *addrbuf = malloc(len + 1); if (addrbuf == NULL) { return FALSE; diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 4d5826888..15321458e 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -261,7 +261,7 @@ void SetConnectionTranslation(int conn, int client) } node = &((*node)->next); } - *node = (struct _ct_node*)xalloc(sizeof(struct _ct_node)); + *node = (struct _ct_node*)malloc(sizeof(struct _ct_node)); (*node)->next = NULL; (*node)->key = conn; (*node)->value = client; @@ -407,7 +407,7 @@ CreateWellKnownSockets(void) } else { - ListenTransFds = (int *) xalloc (ListenTransCount * sizeof (int)); + ListenTransFds = (int *) malloc (ListenTransCount * sizeof (int)); for (i = 0; i < ListenTransCount; i++) { @@ -764,7 +764,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) #endif ) return NullClient; - oc = (OsCommPtr)xalloc(sizeof(OsCommRec)); + oc = (OsCommPtr)malloc(sizeof(OsCommRec)); if (!oc) return NullClient; oc->trans_conn = trans_conn; diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index b8f05d939..3e9abb35c 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -1171,10 +1171,10 @@ AllocateInputBuffer(void) { ConnectionInputPtr oci; - oci = (ConnectionInputPtr)xalloc(sizeof(ConnectionInput)); + oci = (ConnectionInputPtr)malloc(sizeof(ConnectionInput)); if (!oci) return (ConnectionInputPtr)NULL; - oci->buffer = (char *)xalloc(BUFSIZE); + oci->buffer = (char *)malloc(BUFSIZE); if (!oci->buffer) { free(oci); @@ -1192,10 +1192,10 @@ AllocateOutputBuffer(void) { ConnectionOutputPtr oco; - oco = (ConnectionOutputPtr)xalloc(sizeof(ConnectionOutput)); + oco = (ConnectionOutputPtr)malloc(sizeof(ConnectionOutput)); if (!oco) return (ConnectionOutputPtr)NULL; - oco->buf = (unsigned char *) xalloc(BUFSIZE); + oco->buf = (unsigned char *) malloc(BUFSIZE); if (!oco->buf) { free(oco); diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c index 12827cbe0..d97317819 100644 --- a/nx-X11/programs/Xserver/os/log.c +++ b/nx-X11/programs/Xserver/os/log.c @@ -186,7 +186,7 @@ LogInit(const char *fname, const char *backup) char *logFileName = NULL; if (fname && *fname) { - /* xalloc() can't be used yet. */ + /* malloc() can't be used yet. */ logFileName = malloc(strlen(fname) + strlen(display) + 1); if (!logFileName) FatalError("Cannot allocate space for the log file name\n"); @@ -333,7 +333,7 @@ LogVWrite(int verb, const char *f, va_list args) } else if (needBuffer) { /* * Note, this code is used before OsInit() has been called, so - * xalloc() and friends can't be used. + * malloc() and friends can't be used. */ if (len > bufferUnused) { bufferSize += 1024; diff --git a/nx-X11/programs/Xserver/os/mitauth.c b/nx-X11/programs/Xserver/os/mitauth.c index 4c1ae9cf6..2630a81ae 100644 --- a/nx-X11/programs/Xserver/os/mitauth.c +++ b/nx-X11/programs/Xserver/os/mitauth.c @@ -57,10 +57,10 @@ MitAddCookie ( { struct auth *new; - new = (struct auth *) xalloc (sizeof (struct auth)); + new = (struct auth *) malloc (sizeof (struct auth)); if (!new) return 0; - new->data = (char *) xalloc ((unsigned) data_length); + new->data = (char *) malloc ((unsigned) data_length); if (!new->data) { free(new); return 0; diff --git a/nx-X11/programs/Xserver/os/oscolor.c b/nx-X11/programs/Xserver/os/oscolor.c index 8f737eaba..2ea81060d 100644 --- a/nx-X11/programs/Xserver/os/oscolor.c +++ b/nx-X11/programs/Xserver/os/oscolor.c @@ -134,11 +134,11 @@ OsLookupColor(int screen, char *name, unsigned int len, if(!rgb_dbm) return(0); - /* we use xalloc here so that we can compile with cc without alloca + /* we use malloc here so that we can compile with cc without alloca * when otherwise using gcc */ if (len < sizeof(buf)) lowername = buf; - else if (!(lowername = (char *)xalloc(len + 1))) + else if (!(lowername = (char *)malloc(len + 1))) return(0); CopyISOLatin1Lowered ((unsigned char *) lowername, (unsigned char *) name, (int)len); @@ -372,7 +372,7 @@ lookup(char *name, int len, Bool create) else prev = &(hashTab[h]); - if (!entry && create && (entry = (dbEntryPtr)xalloc(sizeof(dbEntry) +len))) + if (!entry && create && (entry = (dbEntryPtr)malloc(sizeof(dbEntry) +len))) { *prev = entry; entry->link = NULL; diff --git a/nx-X11/programs/Xserver/os/rpcauth.c b/nx-X11/programs/Xserver/os/rpcauth.c index 1b3db1e0e..40ea7ad97 100644 --- a/nx-X11/programs/Xserver/os/rpcauth.c +++ b/nx-X11/programs/Xserver/os/rpcauth.c @@ -77,7 +77,7 @@ authdes_ezdecode(char *inmsg, int len) XDR xdr; SVCXPRT xprt; - temp_inmsg = (char *) xalloc(len); + temp_inmsg = (char *) malloc(len); if (temp_inmsg == NULL) { why = AUTH_FAILED; /* generic error, since there is no AUTH_BADALLOC */ return NULL; @@ -94,7 +94,7 @@ authdes_ezdecode(char *inmsg, int len) why = AUTH_FAILED; xdrmem_create(&xdr, temp_inmsg, len, XDR_DECODE); - if ((r.rq_clntcred = (caddr_t) xalloc(MAX_AUTH_BYTES)) == NULL) + if ((r.rq_clntcred = (caddr_t) malloc(MAX_AUTH_BYTES)) == NULL) goto bad1; r.rq_xprt = &xprt; diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 03deb811a..98e3cab8b 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -261,12 +261,6 @@ int SyncOn = 0; extern int SelectWaitTime; #endif -#ifdef DEBUG -#ifndef SPECIAL_MALLOC -#define MEMBUG -#endif -#endif - #if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED) #define HAS_SAVED_IDS_AND_SETEUID #endif @@ -1186,7 +1180,7 @@ InsertFileIntoCommandLine( fstat(fileno(f), &st); - buf = (char *) xalloc((unsigned) st.st_size + 1); + buf = (char *) malloc((unsigned) st.st_size + 1); if (!buf) FatalError("Out of Memory\n"); @@ -1231,7 +1225,7 @@ InsertFileIntoCommandLine( FatalError("Out of memory reallocing option buf\n"); *resargc = prefix_argc + insert_argc + suffix_argc; - *resargv = (char **) xalloc((*resargc + 1) * sizeof(char *)); + *resargv = (char **) malloc((*resargc + 1) * sizeof(char *)); if (!*resargv) FatalError("Out of Memory\n"); @@ -1316,7 +1310,7 @@ set_font_authorizations(char **authorizations, int *authlen, void * client) #endif len = strlen(hnameptr) + 1; - result = xalloc(len + sizeof(AUTHORIZATION_NAME) + 4); + result = malloc(len + sizeof(AUTHORIZATION_NAME) + 4); p = result; *p++ = sizeof(AUTHORIZATION_NAME) >> 8; @@ -1517,7 +1511,7 @@ Xstrdup(const char *s) if (s == NULL) return NULL; - sd = (char *)Xalloc(strlen(s) + 1); + sd = (char *)malloc(strlen(s) + 1); if (sd != NULL) strcpy(sd, s); return sd; @@ -1808,7 +1802,7 @@ Popen(char *command, char *type) if ((*type != 'r' && *type != 'w') || type[1]) return NULL; - if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL) + if ((cur = (struct pid *)malloc(sizeof(struct pid))) == NULL) return NULL; if (pipe(pdes) < 0) { @@ -1946,7 +1940,7 @@ Fopen(char *file, char *type) if ((*type != 'r' && *type != 'w') || type[1]) return NULL; - if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL) + if ((cur = (struct pid *)malloc(sizeof(struct pid))) == NULL) return NULL; if (pipe(pdes) < 0) { diff --git a/nx-X11/programs/Xserver/os/xalloc.c b/nx-X11/programs/Xserver/os/xalloc.c deleted file mode 100644 index 4d2d3f1ee..000000000 --- a/nx-X11/programs/Xserver/os/xalloc.c +++ /dev/null @@ -1,817 +0,0 @@ -#define FATALERRORS 1 -/* -Copyright (C) 1995 Pascal Haible. 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 -PASCAL HAIBLE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Except as contained in this notice, the name of Pascal Haible shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from -Pascal Haible. -*/ - -/* $XFree86: xc/programs/Xserver/os/xalloc.c,v 3.35tsi Exp $ */ - -/* Only used if INTERNAL_MALLOC is defined - * - otherwise xalloc() in utils.c is used - */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifdef INTERNAL_MALLOC - -#include /* for malloc() etc. */ - -#include -#include "misc.h" -#include - -#ifdef XALLOC_LOG -#include -#endif - -extern Bool Must_have_memory; - -/* - ***** New malloc approach for the X server ***** - * Pascal Haible 1995 - * - * Some statistics about memory allocation of the X server - * The test session included several clients of different size, including - * xv, emacs and xpaint with a new canvas of 3000x2000, zoom 5. - * All clients were running together. - * A protocolling version of Xalloc recorded 318917 allocating actions - * (191573 Xalloc, 85942 XNFalloc, 41438 Xrealloc, 279727 Xfree). - * Results grouped by size, excluding the next lower size - * (i.e. size=32 means 16=11k) are mmapped on xalloc, and unmapped on xfree, - * so we don't need any free lists etc. - * As this needs 2 system calls, we only do this for the quite - * infrequent large (>=11k) blocks. - * - instead of reinventing the wheel, we use system malloc for medium - * sized blocks (>256, <11k). - * - for small blocks (<=256) we use an other approach: - * As we need many small blocks, and most ones for a short time, - * we don't go through the system malloc: - * for each fixed sizes a seperate list of free blocks is kept. - * to KISS (Keep it Small and Simple), we don't free them - * (not freeing a block of 32 bytes won't be worse than having fragmented - * a larger area on allocation). - * This way, we (almost) allways have a fitting free block right at hand, - * and don't have to walk any lists. - */ - -/* - * structure layout of a allocated block - * unsigned long size: - * rounded up netto size for small and medium blocks - * brutto size == mmap'ed area for large blocks - * unsigned long DEBUG ? MAGIC : unused - * .... data - * ( unsigned long MAGIC2 ) only if SIZE_TAIL defined - * - */ - -/* use otherwise unused long in the header to store a magic */ -/* shouldn't this be removed for production release ? */ -#define XALLOC_DEBUG - -#ifdef XALLOC_DEBUG -/* Xfree fills the memory with a certain pattern (currently 0xF0) */ -/* this should really be removed for production release! */ -#define XFREE_ERASES -#endif - -/* this must be a multiple of SIZE_STEPS below */ -#define MAX_SMALL 264 /* quite many blocks of 264 */ - -#define MIN_LARGE (11*1024) -/* worst case is 25% loss with a page size of 4k */ - -/* SIZE_STEPS defines the granularity of size of small blocks - - * this makes blocks align to that, too! */ -#define SIZE_STEPS (sizeof(double)) -#define SIZE_HEADER (2*sizeof(long)) /* = sizeof(double) for 32bit */ -#ifdef XALLOC_DEBUG -#if defined(__sparc__) -#define SIZE_TAIL (2*sizeof(long)) /* = sizeof(double) for 32bit */ -#else -#define SIZE_TAIL (sizeof(long)) -#endif -#endif - -#undef TAIL_SIZE -#ifdef SIZE_TAIL -#define TAIL_SIZE SIZE_TAIL -#else -#define TAIL_SIZE 0 -#endif - -#if defined (_LP64) || \ - defined(__alpha__) || defined(__alpha) || \ - defined(__ia64__) || defined(ia64) || \ - defined(__sparc64__) || \ - defined(__s390x__) || \ - defined(__amd64__) || defined(amd64) || \ - defined(__powerpc64__) || \ - (defined(sgi) && _MIPS_SZLONG == 64)) -#define MAGIC 0x1404196414071968 -#define MAGIC_FREE 0x1506196615061966 -#define MAGIC2 0x2515207525182079 -#else -#define MAGIC 0x14071968 -#define MAGIC_FREE 0x15061966 -#define MAGIC2 0x25182079 -#endif - -/* To get some statistics about memory allocation */ - -#ifdef XALLOC_LOG -#define XALLOC_LOG_FILE "/tmp/Xalloc.log" /* unsecure... */ -#define LOG_BODY(_body) \ - { FILE *f; \ - f = fopen(XALLOC_LOG_FILE, "a"); \ - if (NULL!=f) { \ - _body; \ - fclose(f); \ - } \ - } -#if defined(linux) && defined(i386) -#define LOG_ALLOC(_fun, _size, _ret) \ - { unsigned long *from; \ - __asm__("movl %%ebp,%0" : /*OUT*/ "=r" (from) : /*IN*/ ); \ - LOG_BODY(fprintf(f, "%s\t%i\t%p\t[%lu]\n", _fun, _size, _ret, *(from+1))) \ - } -#else -#define LOG_ALLOC(_fun, _size, _ret) \ - LOG_BODY(fprintf(f, "%s\t%i\t%p\n", _fun, _size, _ret)) -#endif -#define LOG_REALLOC(_fun, _ptr, _size, _ret) \ - LOG_BODY(fprintf(f, "%s\t%p\t%i\t%p\n", _fun, _ptr, _size, _ret)) -#define LOG_FREE(_fun, _ptr) \ - LOG_BODY(fprintf(f, "%s\t%p\n", _fun, _ptr)) -#else -#define LOG_ALLOC(_fun, _size, _ret) -#define LOG_REALLOC(_fun, _ptr, _size, _ret) -#define LOG_FREE(_fun, _ptr) -#endif /* XALLOC_LOG */ - -static unsigned long *free_lists[MAX_SMALL/SIZE_STEPS]; - -/* - * systems that support it should define HAS_MMAP_ANON or MMAP_DEV_ZERO - * and include the appropriate header files for - * mmap(), munmap(), PROT_READ, PROT_WRITE, MAP_PRIVATE, - * PAGE_SIZE or _SC_PAGESIZE (and MAP_ANON for HAS_MMAP_ANON). - * - * systems that don't support MAP_ANON fall through to the 2 fold behaviour - */ - -#if defined(linux) -#define HAS_MMAP_ANON -#include -#include -#include /* PAGE_SIZE */ -#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */ -#define HAS_GETPAGESIZE -#endif /* linux */ - -#if defined(__GNU__) -#define HAS_MMAP_ANON -#include -#include -#include /* PAGE_SIZE */ -#define HAS_SC_PAGESIZE -#define HAS_GETPAGESIZE -#endif /* __GNU__ */ - -#if defined(CSRG_BASED) -#define HAS_MMAP_ANON -#define HAS_GETPAGESIZE -#include -#include -#endif /* CSRG_BASED */ - -#if defined(DGUX) -#define HAS_GETPAGESIZE -#define MMAP_DEV_ZERO -#include -#include -#include -#endif /* DGUX */ - -#if defined(SVR4) && !defined(DGUX) -#define MMAP_DEV_ZERO -#include -#include -#include -#endif /* SVR4 && !DGUX */ - -#if defined(sun) && !defined(SVR4) /* SunOS */ -#define MMAP_DEV_ZERO /* doesn't SunOS have MAP_ANON ?? */ -#define HAS_GETPAGESIZE -#include -#include -#endif /* sun && !SVR4 */ - -#ifdef XNO_SYSCONF -#undef _SC_PAGESIZE -#endif - -#if defined(HAS_MMAP_ANON) || defined (MMAP_DEV_ZERO) -static int pagesize; -#endif - -#ifdef MMAP_DEV_ZERO -static int devzerofd = -1; -#include -#endif - -/* - * empty trap function for gdb. Breakpoint here - * to find who tries to free a free area - */ -void XfreeTrap(void) -{ -} - -void * -Xalloc (unsigned long amount) -{ - register unsigned long *ptr; - int indx; - - /* sanity checks */ - - /* zero size requested */ - if (amount == 0) { - LOG_ALLOC("Xalloc=0", amount, 0); - return NULL; - } - /* negative size (or size > 2GB) - what do we do? */ - if ((long)amount < 0) { - /* Diagnostic */ -#ifdef FATALERRORS - FatalError("Xalloc: Xalloc(<0)\n"); -#else - ErrorF("Xalloc warning: Xalloc(<0) ignored..\n"); -#endif - LOG_ALLOC("Xalloc<0", amount, 0); - return NULL; - } - - /* alignment check */ -#if defined(__alpha__) || defined(__alpha) || \ - defined(__sparc__) || \ - defined(__mips__) || \ - defined(__powerpc__) || \ - defined(__arm32__) || \ - defined(__ia64__) || defined(ia64) || \ - defined(__s390x__) || defined(__s390__) - amount = (amount + (sizeof(long)-1)) & ~(sizeof(long)-1); -#endif - - if (amount <= MAX_SMALL) { - /* - * small block - */ - /* pick a ready to use small chunk */ - indx = (amount-1) / SIZE_STEPS; - ptr = free_lists[indx]; - if (NULL == ptr) { - /* list empty - get 20 or 40 more */ - /* amount = size rounded up */ - amount = (indx+1) * SIZE_STEPS; - ptr = (unsigned long *)calloc(1,(amount+SIZE_HEADER+TAIL_SIZE) - * (amount<100 ? 40 : 20)); - if (NULL!=ptr) { - int i; - unsigned long *p1, *p2; - p1 = 0; - p2 = (unsigned long *)((char *)ptr + SIZE_HEADER); - for (i=0; i<(amount<100 ? 40 : 20); i++) { - p1 = p2; - p1[-2] = amount; -#ifdef XALLOC_DEBUG - p1[-1] = MAGIC_FREE; -#endif /* XALLOC_DEBUG */ -#ifdef SIZE_TAIL - *(unsigned long *)((unsigned char *)p1 + amount) = MAGIC2; -#endif /* SIZE_TAIL */ - p2 = (unsigned long *)((char *)p1 + SIZE_HEADER + amount + TAIL_SIZE); - *(unsigned long **)p1 = p2; - } - /* last one has no next one */ - *(unsigned long **)p1 = NULL; - /* put the second in the list */ - free_lists[indx] = (unsigned long *)((char *)ptr + SIZE_HEADER + amount + TAIL_SIZE + SIZE_HEADER); - /* take the fist one */ - ptr = (unsigned long *)((char *)ptr + SIZE_HEADER); - LOG_ALLOC("Xalloc-S", amount, ptr); - ptr[-1] = MAGIC; - return (void *)ptr; - } /* else fall through to 'Out of memory' */ - } else { - /* take that piece of mem out of the list */ - free_lists[indx] = *((unsigned long **)ptr); - /* already has size (and evtl. magic) filled in */ -#ifdef XALLOC_DEBUG - ptr[-1] = MAGIC; -#endif /* XALLOC_DEBUG */ - LOG_ALLOC("Xalloc-S", amount, ptr); - return (void *)ptr; - } - -#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO) - } else if (amount >= MIN_LARGE) { - /* - * large block - */ - /* mmapped malloc */ - /* round up amount */ - amount += SIZE_HEADER + TAIL_SIZE; - /* round up brutto amount to a multiple of the page size */ - amount = (amount + pagesize-1) & ~(pagesize-1); -#ifdef MMAP_DEV_ZERO - ptr = (unsigned long *)mmap((caddr_t)0, - (size_t)amount, - PROT_READ | PROT_WRITE, - MAP_PRIVATE, - devzerofd, - (off_t)0); -#else - ptr = (unsigned long *)mmap((caddr_t)0, - (size_t)amount, - PROT_READ | PROT_WRITE, - MAP_ANON | MAP_PRIVATE, - -1, - (off_t)0); -#endif - if (-1!=(long)ptr) { - ptr[0] = amount - SIZE_HEADER - TAIL_SIZE; -#ifdef XALLOC_DEBUG - ptr[1] = MAGIC; -#endif /* XALLOC_DEBUG */ -#ifdef SIZE_TAIL - ((unsigned long *)((char *)ptr + amount - TAIL_SIZE))[0] = MAGIC2; -#endif /* SIZE_TAIL */ - ptr = (unsigned long *)((char *)ptr + SIZE_HEADER); - LOG_ALLOC("Xalloc-L", amount, ptr); - return (void *)ptr; - } /* else fall through to 'Out of memory' */ -#endif /* HAS_MMAP_ANON || MMAP_DEV_ZERO */ - } else { - /* - * medium sized block - */ - /* 'normal' malloc() */ - ptr=(unsigned long *)calloc(1,amount+SIZE_HEADER+TAIL_SIZE); - if (ptr != (unsigned long *)NULL) { - ptr[0] = amount; -#ifdef XALLOC_DEBUG - ptr[1] = MAGIC; -#endif /* XALLOC_DEBUG */ -#ifdef SIZE_TAIL - *(unsigned long *)((char *)ptr + amount + SIZE_HEADER) = MAGIC2; -#endif /* SIZE_TAIL */ - ptr = (unsigned long *)((char *)ptr + SIZE_HEADER); - LOG_ALLOC("Xalloc-M", amount, ptr); - return (void *)ptr; - } - } - if (Must_have_memory) - FatalError("Out of memory"); - LOG_ALLOC("Xalloc-oom", amount, 0); - return NULL; -} - -/***************** - * XNFalloc - * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory - *****************/ - -void * -XNFalloc (unsigned long amount) -{ - register void * ptr; - - /* zero size requested */ - if (amount == 0) { - LOG_ALLOC("XNFalloc=0", amount, 0); - return NULL; - } - /* negative size (or size > 2GB) - what do we do? */ - if ((long)amount < 0) { - /* Diagnostic */ -#ifdef FATALERRORS - FatalError("Xalloc: XNFalloc(<0)\n"); -#else - ErrorF("Xalloc warning: XNFalloc(<0) ignored..\n"); -#endif - LOG_ALLOC("XNFalloc<0", amount, 0); - return (unsigned long *)NULL; - } - ptr = Xalloc(amount); - if (!ptr) - { - FatalError("Out of memory"); - } - return ptr; -} - -/***************** - * Xcalloc - *****************/ - -void * -Xcalloc (unsigned long amount) -{ - void * ret; - - ret = Xalloc (amount); - if (ret != 0 -#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO) - && (amount < MIN_LARGE) /* mmaped anonymous mem is already cleared */ -#endif - ) - bzero ((char *) ret, (int) amount); - return ret; -} - -/***************** - * XNFcalloc - *****************/ -void * -XNFcalloc (unsigned long amount) -{ - void * ret; - - ret = XNFalloc (amount); - if (ret != 0 -#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO) - && (amount < MIN_LARGE) /* mmaped anonymous mem is already cleared */ -#endif - ) - bzero ((char *) ret, (int) amount); - return ret; -} - -/***************** - * Xrealloc - *****************/ - -void * -Xrealloc (void * ptr, unsigned long amount) -{ - register unsigned long *new_ptr; - - /* zero size requested */ - if (amount == 0) { - if (ptr) - Xfree(ptr); - LOG_REALLOC("Xrealloc=0", ptr, amount, 0); - return NULL; - } - /* negative size (or size > 2GB) - what do we do? */ - if ((long)amount < 0) { - /* Diagnostic */ -#ifdef FATALERRORS - FatalError("Xalloc: Xrealloc(<0)\n"); -#else - ErrorF("Xalloc warning: Xrealloc(<0) ignored..\n"); -#endif - if (ptr) - Xfree(ptr); /* ?? */ - LOG_REALLOC("Xrealloc<0", ptr, amount, 0); - return NULL; - } - - new_ptr = Xalloc(amount); - if ( (new_ptr) && (ptr) ) { - unsigned long old_size; - old_size = ((unsigned long *)ptr)[-2]; -#ifdef XALLOC_DEBUG - if (MAGIC != ((unsigned long *)ptr)[-1]) { - if (MAGIC_FREE == ((unsigned long *)ptr)[-1]) { -#ifdef FATALERRORS - XfreeTrap(); - FatalError("Xalloc error: range already freed in Xrealloc() :-(\n"); -#else - ErrorF("Xalloc error: range already freed in Xrealloc() :-(\a\n"); - sleep(5); - XfreeTrap(); -#endif - LOG_REALLOC("Xalloc error: ranged already freed in Xrealloc() :-(", - ptr, amount, 0); - return NULL; - } -#ifdef FATALERRORS - XfreeTrap(); - FatalError("Xalloc error: header corrupt in Xrealloc() :-(\n"); -#else - ErrorF("Xalloc error: header corrupt in Xrealloc() :-(\n"); - XfreeTrap(); -#endif - LOG_REALLOC("Xalloc error: header corrupt in Xrealloc() :-(", - ptr, amount, 0); - return NULL; - } -#endif /* XALLOC_DEBUG */ - /* copy min(old size, new size) */ - memcpy((char *)new_ptr, (char *)ptr, (amount < old_size ? amount : old_size)); - } - if (ptr) - Xfree(ptr); - if (new_ptr) { - LOG_REALLOC("Xrealloc", ptr, amount, new_ptr); - return (void *)new_ptr; - } - if (Must_have_memory) - FatalError("Out of memory"); - LOG_REALLOC("Xrealloc", ptr, amount, 0); - return NULL; -} - -/***************** - * XNFrealloc - * "no failure" realloc, alternate interface to Xrealloc w/o Must_have_memory - *****************/ - -void * -XNFrealloc (void * ptr, unsigned long amount) -{ - if (( ptr = (void *)Xrealloc( ptr, amount ) ) == NULL) - { - FatalError( "Out of memory" ); - } - return ptr; -} - -/***************** - * Xfree - * calls free - *****************/ - -void -Xfree(void * ptr) -{ - unsigned long size; - unsigned long *pheader; - - /* free(NULL) IS valid :-( - and widely used throughout the server.. */ - if (!ptr) - return; - - pheader = (unsigned long *)((char *)ptr - SIZE_HEADER); -#ifdef XALLOC_DEBUG - if (MAGIC != pheader[1]) { - /* Diagnostic */ - if (MAGIC_FREE == pheader[1]) { -#ifdef FATALERRORS - XfreeTrap(); - FatalError("Xalloc error: range already freed in Xrealloc() :-(\n"); -#else - ErrorF("Xalloc error: range already freed in Xrealloc() :-(\a\n"); - sleep(5); - XfreeTrap(); -#endif - LOG_FREE("Xalloc error: ranged already freed in Xrealloc() :-(", ptr); - return; - } -#ifdef FATALERRORS - XfreeTrap(); - FatalError("Xalloc error: Header corrupt in Xfree() :-(\n"); -#else - ErrorF("Xalloc error: Header corrupt in Xfree() :-(\n"); - XfreeTrap(); -#endif - LOG_FREE("Xalloc error: Header corrupt in Xfree() :-(", ptr); - return; - } -#endif /* XALLOC_DEBUG */ - - size = pheader[0]; - if (size <= MAX_SMALL) { - int indx; - /* - * small block - */ -#ifdef SIZE_TAIL - if (MAGIC2 != *(unsigned long *)((char *)ptr + size)) { - /* Diagnostic */ -#ifdef FATALERRORS - XfreeTrap(); - FatalError("Xalloc error: Tail corrupt in Xfree() for small block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size)); -#else - ErrorF("Xalloc error: Tail corrupt in Xfree() for small block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size)); - XfreeTrap(); -#endif - LOG_FREE("Xalloc error: Tail corrupt in Xfree() for small block", ptr); - return; - } -#endif /* SIZE_TAIL */ - -#ifdef XFREE_ERASES - memset(ptr,0xF0,size); -#endif /* XFREE_ERASES */ -#ifdef XALLOC_DEBUG - pheader[1] = MAGIC_FREE; -#endif - /* put this small block at the head of the list */ - indx = (size-1) / SIZE_STEPS; - *(unsigned long **)(ptr) = free_lists[indx]; - free_lists[indx] = (unsigned long *)ptr; - LOG_FREE("Xfree", ptr); - return; - -#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO) - } else if (size >= MIN_LARGE) { - /* - * large block - */ -#ifdef SIZE_TAIL - if (MAGIC2 != ((unsigned long *)((char *)ptr + size))[0]) { - /* Diagnostic */ -#ifdef FATALERRORS - XfreeTrap(); - FatalError("Xalloc error: Tail corrupt in Xfree() for big block (adr=0x%x, val=0x%x)\n",(char *)ptr+size,((unsigned long *)((char *)ptr + size))[0]); -#else - ErrorF("Xalloc error: Tail corrupt in Xfree() for big block (adr=0x%x, val=0x%x)\n",(char *)ptr+size,((unsigned long *)((char *)ptr + size))[0]); - XfreeTrap(); -#endif - LOG_FREE("Xalloc error: Tail corrupt in Xfree() for big block", ptr); - return; - } - size += SIZE_TAIL; -#endif /* SIZE_TAIL */ - - LOG_FREE("Xfree", ptr); - size += SIZE_HEADER; - munmap((caddr_t)pheader, (size_t)size); - /* no need to clear - mem is inaccessible after munmap.. */ -#endif /* HAS_MMAP_ANON */ - - } else { - /* - * medium sized block - */ -#ifdef SIZE_TAIL - if (MAGIC2 != *(unsigned long *)((char *)ptr + size)) { - /* Diagnostic */ -#ifdef FATALERRORS - XfreeTrap(); - FatalError("Xalloc error: Tail corrupt in Xfree() for medium block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size)); -#else - ErrorF("Xalloc error: Tail corrupt in Xfree() for medium block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size)); - XfreeTrap(); -#endif - LOG_FREE("Xalloc error: Tail corrupt in Xfree() for medium block", ptr); - return; - } -#endif /* SIZE_TAIL */ - -#ifdef XFREE_ERASES - memset(pheader,0xF0,size+SIZE_HEADER); -#endif /* XFREE_ERASES */ -#ifdef XALLOC_DEBUG - pheader[1] = MAGIC_FREE; -#endif - - LOG_FREE("Xfree", ptr); - free((char *)pheader); - } -} - -void -OsInitAllocator (void) -{ - static Bool beenhere = FALSE; - - if (beenhere) - return; - beenhere = TRUE; - -#if defined(HAS_MMAP_ANON) || defined (MMAP_DEV_ZERO) - pagesize = -1; -#if defined(_SC_PAGESIZE) || defined(HAS_SC_PAGESIZE) - pagesize = sysconf(_SC_PAGESIZE); -#endif -#ifdef _SC_PAGE_SIZE - if (pagesize == -1) - pagesize = sysconf(_SC_PAGE_SIZE); -#endif -#ifdef HAS_GETPAGESIZE - if (pagesize == -1) - pagesize = getpagesize(); -#endif -#ifdef PAGE_SIZE - if (pagesize == -1) - pagesize = PAGE_SIZE; -#endif - if (pagesize == -1) - FatalError("OsInitAllocator: Cannot determine page size\n"); -#endif - - /* set up linked lists of free blocks */ - bzero ((char *) free_lists, MAX_SMALL/SIZE_STEPS*sizeof(unsigned long *)); - -#ifdef MMAP_DEV_ZERO - /* open /dev/zero on systems that have mmap, but not MAP_ANON */ - if (devzerofd < 0) { - if ((devzerofd = open("/dev/zero", O_RDWR, 0)) < 0) - FatalError("OsInitAllocator: Cannot open /dev/zero (errno=%d)\n", - errno); - } -#endif - -#ifdef XALLOC_LOG - /* reset the log file to zero length */ - { - FILE *f; - f = fopen(XALLOC_LOG_FILE, "w"); - if (NULL!=f) - fclose(f); - } -#endif -} - -#else /* !INTERNAL_MALLOC */ -/* This is to avoid an empty .o */ -static int no_internal_xalloc; -#endif /* INTERNAL_MALLOC */ diff --git a/nx-X11/programs/Xserver/os/xdmauth.c b/nx-X11/programs/Xserver/os/xdmauth.c index b55f75a36..a89c5b0c0 100644 --- a/nx-X11/programs/Xserver/os/xdmauth.c +++ b/nx-X11/programs/Xserver/os/xdmauth.c @@ -260,7 +260,7 @@ XdmAuthorizationValidate (unsigned char *plain, int length, *reason = "Bad XDM authorization key length"; return NULL; } - client = (XdmClientAuthPtr) xalloc (sizeof (XdmClientAuthRec)); + client = (XdmClientAuthPtr) malloc (sizeof (XdmClientAuthRec)); if (!client) return NULL; XdmClientAuthDecode (plain, client); @@ -364,7 +364,7 @@ XdmAddCookie (unsigned short data_length, char *data, XID id) /* the first octet of the key must be zero */ if (key_bits[0] != '\0') return 0; - new = (XdmAuthorizationPtr) xalloc (sizeof (XdmAuthorizationRec)); + new = (XdmAuthorizationPtr) malloc (sizeof (XdmAuthorizationRec)); if (!new) return 0; new->next = xdmAuth; @@ -386,7 +386,7 @@ XdmCheckCookie (unsigned short cookie_length, char *cookie, /* Auth packets must be a multiple of 8 bytes long */ if (cookie_length & 7) return (XID) -1; - plain = (unsigned char *) xalloc (cookie_length); + plain = (unsigned char *) malloc (cookie_length); if (!plain) return (XID) -1; for (auth = xdmAuth; auth; auth=auth->next) { @@ -431,7 +431,7 @@ XdmToID (unsigned short cookie_length, char *cookie) XdmClientAuthPtr client; unsigned char *plain; - plain = (unsigned char *) xalloc (cookie_length); + plain = (unsigned char *) malloc (cookie_length); if (!plain) return (XID) -1; for (auth = xdmAuth; auth; auth=auth->next) { diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c index 29785f48e..d48012759 100644 --- a/nx-X11/programs/Xserver/os/xdmcp.c +++ b/nx-X11/programs/Xserver/os/xdmcp.c @@ -407,7 +407,7 @@ XdmcpRegisterAuthentication ( AuthenticationNames.length + 1) && XdmcpReallocARRAYofARRAY8 (&AuthenticationDatas, AuthenticationDatas.length + 1) && - (newFuncs = (AuthenticationFuncsPtr) xalloc ( + (newFuncs = (AuthenticationFuncsPtr) malloc ( (AuthenticationNames.length + 1) * sizeof (AuthenticationFuncsRec))))) { XdmcpDisposeARRAY8 (&AuthenticationName); @@ -507,7 +507,7 @@ XdmcpRegisterConnection ( return; } } - newAddress = (CARD8 *) xalloc (addrlen * sizeof (CARD8)); + newAddress = (CARD8 *) malloc (addrlen * sizeof (CARD8)); if (!newAddress) return; if (!XdmcpReallocARRAY16 (&ConnectionTypes, ConnectionTypes.length + 1)) @@ -548,7 +548,7 @@ XdmcpRegisterAuthorization (char *name, int namelen) ARRAY8 authName; int i; - authName.data = (CARD8 *) xalloc (namelen * sizeof (CARD8)); + authName.data = (CARD8 *) malloc (namelen * sizeof (CARD8)); if (!authName.data) return; if (!XdmcpReallocARRAYofARRAY8 (&AuthorizationNames, AuthorizationNames.length +1)) diff --git a/nx-X11/programs/Xserver/os/xprintf.c b/nx-X11/programs/Xserver/os/xprintf.c index 4423208ff..1bcb36d3c 100644 --- a/nx-X11/programs/Xserver/os/xprintf.c +++ b/nx-X11/programs/Xserver/os/xprintf.c @@ -1,5 +1,5 @@ /* - * printf routines which xalloc their buffer + * printf routines which malloc their buffer */ /* * Copyright (c) 2004 Alexander Gottwald @@ -111,7 +111,7 @@ Xvprintf(const char *format, va_list va) size = vsnprintf(NULL, 0, format, va2); va_end(va2); - ret = (char *)Xalloc(size + 1); + ret = (char *)malloc(size + 1); if (ret == NULL) return NULL; diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c index 6fb6e02e6..e7add9d60 100644 --- a/nx-X11/programs/Xserver/randr/rrcrtc.c +++ b/nx-X11/programs/Xserver/randr/rrcrtc.c @@ -90,7 +90,7 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate) (pScrPriv->numCrtcs + 1) * sizeof(RRCrtcPtr)); #endif /* !defined(NXAGENT_SERVER) */ else - crtcs = xalloc(sizeof(RRCrtcPtr)); + crtcs = malloc(sizeof(RRCrtcPtr)); if (!crtcs) return FALSE; pScrPriv->crtcs = crtcs; @@ -209,7 +209,7 @@ RRCrtcNotify(RRCrtcPtr crtc, #ifndef NXAGENT_SERVER newoutputs = xallocarray(numOutputs, sizeof(RROutputPtr)); #else /* !defined(NXAGENT_SERVER) */ - newoutputs = xalloc(numOutputs * sizeof(RROutputPtr)); + newoutputs = malloc(numOutputs * sizeof(RROutputPtr)); #endif /* !defined(NXAGENT_SERVER) */ if (!newoutputs) return FALSE; @@ -892,7 +892,7 @@ RRCrtcGammaSetSize(RRCrtcPtr crtc, int size) #ifndef NXAGENT_SERVER gamma = xallocarray(size, 3 * sizeof(CARD16)); #else /* !defined(NXAGENT_SERVER) */ - gamma = xalloc(size * 3 * sizeof(CARD16)); + gamma = malloc(size * 3 * sizeof(CARD16)); #endif /* !defined(NXAGENT_SERVER) */ if (!gamma) return FALSE; @@ -1047,7 +1047,7 @@ ProcRRGetCrtcInfo(ClientPtr client) extraLen = rep.length << 2; if (extraLen) { - extra = xalloc(extraLen); + extra = malloc(extraLen); if (!extra) return BadAlloc; } @@ -1136,7 +1136,7 @@ ProcRRSetCrtcConfig(ClientPtr client) #ifndef NXAGENT_SERVER outputs = xallocarray(numOutputs, sizeof(RROutputPtr)); #else /* !defined(NXAGENT_SERVER) */ - outputs = xalloc(numOutputs * sizeof(RROutputPtr)); + outputs = malloc(numOutputs * sizeof(RROutputPtr)); #endif /* !defined(NXAGENT_SERVER) */ if (!outputs) return BadAlloc; @@ -1514,7 +1514,7 @@ ProcRRGetCrtcGamma(ClientPtr client) len = crtc->gammaSize * 3 * 2; if (crtc->gammaSize) { - extra = xalloc(len); + extra = malloc(len); if (!extra) return BadAlloc; } @@ -1825,7 +1825,7 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) PixmapPtr *saved_scanout_pixmap; int i; - saved_scanout_pixmap = xalloc(sizeof(PixmapPtr) * pScrPriv->numCrtcs); + saved_scanout_pixmap = malloc(sizeof(PixmapPtr) * pScrPriv->numCrtcs); if (saved_scanout_pixmap == NULL) return FALSE; diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c index 271d5d939..50f2011c6 100644 --- a/nx-X11/programs/Xserver/randr/rrdispatch.c +++ b/nx-X11/programs/Xserver/randr/rrdispatch.c @@ -125,7 +125,7 @@ ProcRRSelectInput(ClientPtr client) if (!pRREvent) { /* build the entry */ - pRREvent = (RREventPtr) xalloc(sizeof(RREventRec)); + pRREvent = (RREventPtr) malloc(sizeof(RREventRec)); if (!pRREvent) return BadAlloc; pRREvent->next = 0; @@ -147,7 +147,7 @@ ProcRRSelectInput(ClientPtr client) * done through the resource database. */ if (!pHead) { - pHead = (RREventPtr *) xalloc(sizeof(RREventPtr)); + pHead = (RREventPtr *) malloc(sizeof(RREventPtr)); if (!pHead || !AddResource(pWin->drawable.id, RREventType, (void *) pHead)) { diff --git a/nx-X11/programs/Xserver/randr/rrinfo.c b/nx-X11/programs/Xserver/randr/rrinfo.c index 4c47fb903..c5075572f 100644 --- a/nx-X11/programs/Xserver/randr/rrinfo.c +++ b/nx-X11/programs/Xserver/randr/rrinfo.c @@ -63,7 +63,7 @@ RROldModeAdd(RROutputPtr output, RRScreenSizePtr size, int refresh) (output->numModes + 1) * sizeof(RRModePtr)); #endif /* !defined(NXAGENT_SERVER) */ else - modes = xalloc(sizeof(RRModePtr)); + modes = malloc(sizeof(RRModePtr)); if (!modes) { RRModeDestroy(mode); FreeResource(mode->mode.id, 0); diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c index 3d84a0516..e8dd208a1 100644 --- a/nx-X11/programs/Xserver/randr/rrmode.c +++ b/nx-X11/programs/Xserver/randr/rrmode.c @@ -85,7 +85,7 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen) if (!RRInit()) return NULL; - mode = xalloc(sizeof(RRModeRec) + modeInfo->nameLength + 1); + mode = malloc(sizeof(RRModeRec) + modeInfo->nameLength + 1); if (!mode) return NULL; mode->refcnt = 1; @@ -103,7 +103,7 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen) #endif /* !defined(NXAGENT_SERVER) */ else - newModes = xalloc(sizeof(RRModePtr)); + newModes = malloc(sizeof(RRModePtr)); if (!newModes) { free(mode); @@ -211,7 +211,7 @@ RRModesForScreen(ScreenPtr pScreen, int *num_ret) #ifndef NXAGENT_SERVER screen_modes = xallocarray((num_modes ? num_modes : 1), sizeof(RRModePtr)); #else /* !defined(NXAGENT_SERVER) */ - screen_modes = xalloc((num_modes ? num_modes : 1) * sizeof(RRModePtr)); + screen_modes = malloc((num_modes ? num_modes : 1) * sizeof(RRModePtr)); #endif /* !defined(NXAGENT_SERVER) */ if (!screen_modes) return NULL; diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c index 36543cb4c..0e5514415 100644 --- a/nx-X11/programs/Xserver/randr/rrmonitor.c +++ b/nx-X11/programs/Xserver/randr/rrmonitor.c @@ -516,7 +516,7 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor) (pScrPriv->numMonitors + 1) * sizeof(RRMonitorPtr)); #endif /* !defined(NXAGENT_SERVER) */ else - monitors = xalloc(sizeof(RRMonitorPtr)); + monitors = malloc(sizeof(RRMonitorPtr)); if (!monitors) return BadAlloc; diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c index 46948c577..7be00ab5e 100644 --- a/nx-X11/programs/Xserver/randr/rroutput.c +++ b/nx-X11/programs/Xserver/randr/rroutput.c @@ -83,13 +83,13 @@ RROutputCreate(ScreenPtr pScreen, (pScrPriv->numOutputs + 1) * sizeof(RROutputPtr)); #endif /* !defined(NXAGENT_SERVER) */ else - outputs = xalloc(sizeof(RROutputPtr)); + outputs = malloc(sizeof(RROutputPtr)); if (!outputs) return FALSE; pScrPriv->outputs = outputs; - output = xalloc(sizeof(RROutputRec) + nameLength + 1); + output = malloc(sizeof(RROutputRec) + nameLength + 1); if (!output) return NULL; output->id = FakeClientID(0); @@ -147,7 +147,7 @@ RROutputSetClones(RROutputPtr output, RROutputPtr * clones, int numClones) #ifndef NXAGENT_SERVER newClones = xallocarray(numClones, sizeof(RROutputPtr)); #else /* !defined(NXAGENT_SERVER) */ - newClones = xalloc(numClones * sizeof(RROutputPtr)); + newClones = malloc(numClones * sizeof(RROutputPtr)); #endif /* !defined(NXAGENT_SERVER) */ if (!newClones) return FALSE; @@ -184,7 +184,7 @@ RROutputSetModes(RROutputPtr output, #ifndef NXAGENT_SERVER newModes = xallocarray(numModes, sizeof(RRModePtr)); #else /* !defined(NXAGENT_SERVER) */ - newModes = xalloc(numModes * sizeof(RRModePtr)); + newModes = malloc(numModes * sizeof(RRModePtr)); #endif /* !defined(NXAGENT_SERVER) */ if (!newModes) return FALSE; @@ -236,7 +236,7 @@ RROutputAddUserMode(RROutputPtr output, RRModePtr mode) (output->numUserModes + 1) * sizeof(RRModePtr)); #endif /* !defined(NXAGENT_SERVER) */ else - newModes = xalloc(sizeof(RRModePtr)); + newModes = malloc(sizeof(RRModePtr)); if (!newModes) return BadAlloc; @@ -292,7 +292,7 @@ RROutputSetCrtcs(RROutputPtr output, RRCrtcPtr * crtcs, int numCrtcs) #ifndef NXAGENT_SERVER newCrtcs = xallocarray(numCrtcs, sizeof(RRCrtcPtr)); #else /* !defined(NXAGENT_SERVER) */ - newCrtcs = xalloc(numCrtcs * sizeof(RRCrtcPtr)); + newCrtcs = malloc(numCrtcs * sizeof(RRCrtcPtr)); #endif /* !defined(NXAGENT_SERVER) */ if (!newCrtcs) return FALSE; @@ -494,7 +494,7 @@ ProcRRGetOutputInfo(ClientPtr client) if (extraLen) { rep.length += bytes_to_int32(extraLen); - extra = xalloc(extraLen); + extra = malloc(extraLen); if (!extra) return BadAlloc; } diff --git a/nx-X11/programs/Xserver/randr/rrproperty.c b/nx-X11/programs/Xserver/randr/rrproperty.c index 7275cd34f..cf13ca23e 100644 --- a/nx-X11/programs/Xserver/randr/rrproperty.c +++ b/nx-X11/programs/Xserver/randr/rrproperty.c @@ -111,7 +111,7 @@ RRCreateOutputProperty(Atom property) { RRPropertyPtr prop; - prop = (RRPropertyPtr) xalloc(sizeof(RRPropertyRec)); + prop = (RRPropertyPtr) malloc(sizeof(RRPropertyRec)); if (!prop) return NULL; prop->next = NULL; @@ -189,7 +189,7 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, #ifndef NXAGENT_SERVER new_value.data = xallocarray(total_len, size_in_bytes); #else /* !defined(NXAGENT_SERVER) */ - new_value.data = xalloc(total_len * size_in_bytes); + new_value.data = malloc(total_len * size_in_bytes); #endif /* !defined(NXAGENT_SERVER) */ if (!new_value.data && total_len && size_in_bytes) { if (add) @@ -362,7 +362,7 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property, #ifndef NXAGENT_SERVER new_values = xallocarray(num_values, sizeof(INT32)); #else /* !defined(NXAGENT_SERVER) */ - new_values = xalloc(num_values * sizeof(INT32)); + new_values = malloc(num_values * sizeof(INT32)); #endif /* !defined(NXAGENT_SERVER) */ if (!new_values && num_values) { if (add) @@ -417,7 +417,7 @@ ProcRRListOutputProperties(ClientPtr client) #ifndef NXAGENT_SERVER if (!(pAtoms = xallocarray(numProps, sizeof(Atom)))) #else /* !defined(NXAGENT_SERVER) */ - if (!(pAtoms = xalloc(numProps * sizeof(Atom)))) + if (!(pAtoms = malloc(numProps * sizeof(Atom)))) #endif /* !defined(NXAGENT_SERVER) */ return BadAlloc; @@ -469,7 +469,7 @@ ProcRRQueryOutputProperty(ClientPtr client) #ifndef NXAGENT_SERVER extra = xallocarray(prop->num_valid, sizeof(INT32)); #else /* !defined(NXAGENT_SERVER) */ - extra = xalloc(prop->num_valid * sizeof(INT32)); + extra = malloc(prop->num_valid * sizeof(INT32)); #endif /* !defined(NXAGENT_SERVER) */ if (!extra) return BadAlloc; @@ -702,7 +702,7 @@ ProcRRGetOutputProperty(ClientPtr client) len = min(n - ind, 4 * stuff->longLength); if (len) { - extra = xalloc(len); + extra = malloc(len); if (!extra) return BadAlloc; } diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c index 4911f8fd8..1c292b05e 100644 --- a/nx-X11/programs/Xserver/randr/rrprovider.c +++ b/nx-X11/programs/Xserver/randr/rrprovider.c @@ -121,7 +121,7 @@ ProcRRGetProviders(ClientPtr client) }; extraLen = rep.length << 2; if (extraLen) { - extra = xalloc(extraLen); + extra = malloc(extraLen); if (!extra) return BadAlloc; } else @@ -217,7 +217,7 @@ ProcRRGetProviderInfo(ClientPtr client) extraLen = rep.length << 2; if (extraLen) { - extra = xalloc(extraLen); + extra = malloc(extraLen); if (!extra) return BadAlloc; } diff --git a/nx-X11/programs/Xserver/randr/rrproviderproperty.c b/nx-X11/programs/Xserver/randr/rrproviderproperty.c index 9aa2135df..b7ba8ab53 100644 --- a/nx-X11/programs/Xserver/randr/rrproviderproperty.c +++ b/nx-X11/programs/Xserver/randr/rrproviderproperty.c @@ -108,7 +108,7 @@ RRCreateProviderProperty(Atom property) { RRPropertyPtr prop; - prop = (RRPropertyPtr) xalloc(sizeof(RRPropertyRec)); + prop = (RRPropertyPtr) malloc(sizeof(RRPropertyRec)); if (!prop) return NULL; prop->next = NULL; @@ -185,7 +185,7 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, void *new_data = NULL, *old_data = NULL; total_size = total_len * size_in_bytes; - new_value.data = (void *) xalloc(total_size); + new_value.data = (void *) malloc(total_size); if (!new_value.data && total_size) { if (add) RRDestroyProviderProperty(prop); @@ -357,7 +357,7 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property, #ifndef NXAGENT_SERVER new_values = xallocarray(num_values, sizeof(INT32)); #else /* !defined(NXAGENT_SERVER) */ - new_values = xalloc(num_values * sizeof(INT32)); + new_values = malloc(num_values * sizeof(INT32)); #endif /* !defined(NXAGENT_SERVER) */ if (!new_values && num_values) { @@ -413,7 +413,7 @@ ProcRRListProviderProperties(ClientPtr client) #ifndef NXAGENT_SERVER if (!(pAtoms = xallocarray(numProps, sizeof(Atom)))) #else /* !defined(NXAGENT_SERVER) */ - if (!(pAtoms = xalloc(numProps * sizeof(Atom)))) + if (!(pAtoms = malloc(numProps * sizeof(Atom)))) #endif /* !defined(NXAGENT_SERVER) */ return BadAlloc; @@ -464,7 +464,7 @@ ProcRRQueryProviderProperty(ClientPtr client) #ifndef NXAGENT_SERVER extra = xallocarray(prop->num_valid, sizeof(INT32)); #else /* !defined(NXAGENT_SERVER) */ - extra = xalloc(prop->num_valid * sizeof(INT32)); + extra = malloc(prop->num_valid * sizeof(INT32)); #endif /* !defined(NXAGENT_SERVER) */ if (!extra) return BadAlloc; @@ -694,7 +694,7 @@ ProcRRGetProviderProperty(ClientPtr client) len = min(n - ind, 4 * stuff->longLength); if (len) { - extra = xalloc(len); + extra = malloc(len); if (!extra) return BadAlloc; } diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c index 7047d80a5..017ff0143 100644 --- a/nx-X11/programs/Xserver/randr/rrscreen.c +++ b/nx-X11/programs/Xserver/randr/rrscreen.c @@ -456,7 +456,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) extraLen = rep.length << 2; if (extraLen) { - extra = xalloc(extraLen); + extra = malloc(extraLen); if (!extra) { return BadAlloc; } @@ -595,7 +595,7 @@ rrGetScreenResources(ClientPtr client, Bool query) extraLen = rep.length << 2; if (extraLen) { - extra = xalloc(extraLen); + extra = malloc(extraLen); if (!extra) { free(modes); return BadAlloc; @@ -714,7 +714,7 @@ RR10GetData(ScreenPtr pScreen, RROutputPtr output) Bool *used; /* Make sure there is plenty of space for any combination */ - data = xalloc(sizeof(RR10DataRec) + + data = malloc(sizeof(RR10DataRec) + sizeof(RRScreenSize) * nmode + sizeof(RRScreenRate) * nmode + sizeof(Bool) * nmode); if (!data) @@ -874,7 +874,7 @@ ProcRRGetScreenInfo(ClientPtr client) extraLen += rep.nrateEnts * sizeof(CARD16); if (extraLen) { - extra = (CARD8 *) xalloc(extraLen); + extra = (CARD8 *) malloc(extraLen); if (!extra) { free(pData); return BadAlloc; diff --git a/nx-X11/programs/Xserver/randr/rrtransform.c b/nx-X11/programs/Xserver/randr/rrtransform.c index 743e227ea..f0c5dd8c7 100644 --- a/nx-X11/programs/Xserver/randr/rrtransform.c +++ b/nx-X11/programs/Xserver/randr/rrtransform.c @@ -73,7 +73,7 @@ RRTransformSetFilter(RRTransformPtr dst, #ifndef NXAGENT_SERVER new_params = xallocarray(nparams, sizeof(xFixed)); #else /* !defined(NXAGENT_SERVER) */ - new_params = xalloc(nparams * sizeof(xFixed)); + new_params = malloc(nparams * sizeof(xFixed)); #endif /* !defined(NXAGENT_SERVER) */ if (!new_params) return FALSE; diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index 7fabf79c6..1718c2810 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -1002,7 +1002,7 @@ RecordInstallHooks(pRCAP, oneclient) RecordClientPrivatePtr pClientPriv; /* no Record proc vector; allocate one */ pClientPriv = (RecordClientPrivatePtr) - xalloc(sizeof(RecordClientPrivateRec)); + malloc(sizeof(RecordClientPrivateRec)); if (!pClientPriv) return BadAlloc; /* copy old proc vector to new */ @@ -1238,7 +1238,7 @@ RecordAddClientToRCAP(pRCAP, clientspec) } else { - XID *pNewIDs = (XID *)xalloc((pRCAP->sizeClients + + XID *pNewIDs = (XID *)malloc((pRCAP->sizeClients + CLIENT_ARRAY_GROWTH_INCREMENT) * sizeof(XID)); if (!pNewIDs) return; @@ -1345,7 +1345,7 @@ RecordSanityCheckClientSpecifiers(clientspecs, nspecs, errorspec) * - XRecordCurrentClients expanded to a list of all currently * connected clients - excludespec (if non-zero) * The returned array may be the passed array modified in place, or - * it may be an Xalloc'ed array. The caller should keep a pointer to the + * it may be an malloc'ed array. The caller should keep a pointer to the * original array and free the returned array if it is different. * * *pNumClientspecs is set to the number of elements in the returned @@ -1380,7 +1380,7 @@ RecordCanonicalizeClientSpecifiers(pClientspecs, pNumClientspecs, excludespec) pClientspecs[i] == XRecordCurrentClients) { /* expand All/Current */ int j, nc; - XID *pCanon = (XID *)xalloc(sizeof(XID) * (currentMaxClients + 1)); + XID *pCanon = (XID *)malloc(sizeof(XID) * (currentMaxClients + 1)); if (!pCanon) return NULL; for (nc = 0, j = 1; j < currentMaxClients; j++) { @@ -1599,7 +1599,7 @@ RecordAllocIntervals(psi, nIntervals) { assert(!psi->intervals); psi->intervals = (RecordSetInterval *) - xalloc(nIntervals * sizeof(RecordSetInterval)); + malloc(nIntervals * sizeof(RecordSetInterval)); if (!psi->intervals) return BadAlloc; bzero(psi->intervals, nIntervals * sizeof(RecordSetInterval)); @@ -1865,7 +1865,7 @@ RecordRegisterClients(pContext, client, stuff) /* allocate memory for the whole RCAP */ - pRCAP = (RecordClientsAndProtocolPtr)xalloc(totRCAPsize); + pRCAP = (RecordClientsAndProtocolPtr)malloc(totRCAPsize); if (!pRCAP) { err = BadAlloc; @@ -2030,7 +2030,7 @@ ProcRecordCreateContext(client) REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq); LEGAL_NEW_RESOURCE(stuff->context, client); - pContext = (RecordContextPtr)xalloc(sizeof(RecordContextRec)); + pContext = (RecordContextPtr)malloc(sizeof(RecordContextRec)); if (!pContext) goto bailout; diff --git a/nx-X11/programs/Xserver/record/set.c b/nx-X11/programs/Xserver/record/set.c index 28547f3d0..b8e4cc44c 100644 --- a/nx-X11/programs/Xserver/record/set.c +++ b/nx-X11/programs/Xserver/record/set.c @@ -72,7 +72,6 @@ typedef int Bool; typedef unsigned short CARD16; -#define xalloc malloc #define ALLOCATE_LOCAL malloc #define DEALLOCATE_LOCAL free @@ -424,7 +423,7 @@ IntervalListCreateSet(pIntervals, nIntervals, pMem, memsize) else { prls = (IntervalListSetPtr) - xalloc(sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval)); + malloc(sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval)); if (!prls) goto bailout; prls->baseSet.ops = &IntervalListSetOperations; } @@ -611,7 +610,7 @@ int main(argc, argv) _RecordForceSetImplementation(IntervalListImplementation); rsize = RecordSetMemoryRequirements(intervals, nIntervals, &ralign); pad = (ralign - (bsize & (ralign - 1))) & (ralign - 1); - bs = (RecordSetPtr)xalloc(bsize + pad + rsize ); + bs = (RecordSetPtr)malloc(bsize + pad + rsize ); if (!bs) { fprintf(stderr, "%d: failed to alloc memory for sets\n", diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index 993800c7e..c5535050e 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -334,7 +334,7 @@ AnimCurInit (ScreenPtr pScreen) animCurState.elt = 0; animCurState.time = 0; } - as = (AnimCurScreenPtr) xalloc (sizeof (AnimCurScreenRec)); + as = (AnimCurScreenPtr) malloc (sizeof (AnimCurScreenRec)); if (!as) return FALSE; Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); @@ -366,7 +366,7 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp if (IsAnimCur (cursors[i])) return BadMatch; - pCursor = (CursorPtr) xalloc (sizeof (CursorRec) + + pCursor = (CursorPtr) malloc (sizeof (CursorRec) + sizeof (AnimCurRec) + ncursor * sizeof (AnimCurElt)); if (!pCursor) diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 31d5481c9..065ffa682 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -62,7 +62,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit) return i; if (!makeit) return -1; - name = xalloc (len + 1); + name = malloc (len + 1); if (!name) return -1; memcpy (name, filter, len); @@ -70,7 +70,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit) if (filterNames) names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *)); else - names = xalloc (sizeof (char *)); + names = malloc (sizeof (char *)); if (!names) { free (name); @@ -146,7 +146,7 @@ PictureAddFilter (ScreenPtr pScreen, if (ps->filters) filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec)); else - filters = xalloc (sizeof (PictFilterRec)); + filters = malloc (sizeof (PictFilterRec)); if (!filters) return -1; ps->filters = filters; @@ -179,7 +179,7 @@ PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias) (ps->nfilterAliases + 1) * sizeof (PictFilterAliasRec)); else - aliases = xalloc (sizeof (PictFilterAliasRec)); + aliases = malloc (sizeof (PictFilterAliasRec)); if (!aliases) return FALSE; ps->filterAliases = aliases; @@ -336,7 +336,7 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, } if (nparams != pPicture->filter_nparams) { - xFixed *new_params = xalloc (nparams * sizeof (xFixed)); + xFixed *new_params = malloc (nparams * sizeof (xFixed)); if (!new_params && nparams) return BadAlloc; diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index f956c44b2..4cba50d0f 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -122,7 +122,7 @@ _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr) if (!new) return FALSE; } else { - new = (void **) xalloc ((n + 1) * sizeof (void *)); + new = (void **) malloc ((n + 1) * sizeof (void *)); if (!new) return FALSE; if (glyphSet->devPrivates) @@ -346,7 +346,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth) if (gi->height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi->height) return 0; size = gi->height * padded_width; - glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec)); + glyph = (GlyphPtr) malloc (size + sizeof (GlyphRec)); if (!glyph) return 0; glyph->refcnt = 0; @@ -358,7 +358,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth) Bool AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) { - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); + hash->table = (GlyphRefPtr) malloc (hashSet->size * sizeof (GlyphRefRec)); if (!hash->table) return FALSE; memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); @@ -434,7 +434,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) size = (sizeof (GlyphSetRec) + (sizeof (void *) * _GlyphSetPrivateAllocateIndex)); - glyphSet = xalloc (size); + glyphSet = malloc (size); if (!glyphSet) return FALSE; bzero((char *)glyphSet, size); diff --git a/nx-X11/programs/Xserver/render/miindex.c b/nx-X11/programs/Xserver/render/miindex.c index ad2653c14..ce31c00fb 100644 --- a/nx-X11/programs/Xserver/render/miindex.c +++ b/nx-X11/programs/Xserver/render/miindex.c @@ -259,12 +259,12 @@ miInitIndexed (ScreenPtr pScreen, pixels[p] = p; } - pIndexed = xalloc (sizeof (miIndexedRec)); + pIndexed = malloc (sizeof (miIndexedRec)); if (!pIndexed) return FALSE; pFormat->index.nvalues = num; - pFormat->index.pValues = xalloc (num * sizeof (xIndexValue)); + pFormat->index.pValues = malloc (num * sizeof (xIndexValue)); if (!pFormat->index.pValues) { free (pIndexed); diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 1e653b0c3..1131696d5 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -365,7 +365,7 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) } - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); + pFormats = (PictFormatPtr) malloc (nformats * sizeof (PictFormatRec)); if (!pFormats) return 0; memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); @@ -689,7 +689,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) } formats[n].format = PICT_FORMAT(0,type,a,r,g,b); } - ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec)); + ps = (PictureScreenPtr) malloc (sizeof (PictureScreenRec)); if (!ps) { free (formats); @@ -784,7 +784,7 @@ AllocatePicture (ScreenPtr pScreen) unsigned int size; int i; - pPicture = (PicturePtr) xalloc (ps->totalPictureSize); + pPicture = (PicturePtr) malloc (ps->totalPictureSize); if (!pPicture) return 0; ppriv = (DevUnion *)(pPicture + 1); @@ -961,7 +961,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, dpos = stopPoints[i]; } - pGradient->linear.stops = xalloc(stopCount*sizeof(PictGradientStop)); + pGradient->linear.stops = malloc(stopCount*sizeof(PictGradientStop)); if (!pGradient->linear.stops) { *error = BadAlloc; return; @@ -980,7 +980,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, static PicturePtr createSourcePicture(void) { PicturePtr pPicture; - pPicture = (PicturePtr) xalloc(sizeof(PictureRec)); + pPicture = (PicturePtr) malloc(sizeof(PictureRec)); pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; @@ -1000,7 +1000,7 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill)); + pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -1034,7 +1034,7 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient)); + pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -1083,7 +1083,7 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient)); + pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -1134,7 +1134,7 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle, } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictConicalGradient)); + pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -1477,7 +1477,7 @@ SetPictureTransform (PicturePtr pPicture, { if (!pPicture->transform) { - pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform)); + pPicture->transform = (PictTransform *) malloc (sizeof (PictTransform)); if (!pPicture->transform) return BadAlloc; } diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 58b3dbc88..c6cb7bce7 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -413,7 +413,7 @@ ProcRenderQueryPictFormats (ClientPtr client) ndepth * sizeof (xPictDepth) + nvisual * sizeof (xPictVisual) + numSubpixel * sizeof (CARD32)); - reply = (xRenderQueryPictFormatsReply *) xalloc (rlength); + reply = (xRenderQueryPictFormatsReply *) malloc (rlength); if (!reply) return BadAlloc; memset(reply, 0, rlength); @@ -588,7 +588,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) num = pFormat->index.nvalues; rlength = (sizeof (xRenderQueryPictIndexValuesReply) + num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength); + reply = (xRenderQueryPictIndexValuesReply *) malloc (rlength); if (!reply) return BadAlloc; @@ -1139,7 +1139,7 @@ ProcRenderAddGlyphs (ClientPtr client) glyphsBase = glyphsLocal; else { - glyphsBase = (GlyphNewPtr) Xalloc (nglyphs * sizeof (GlyphNewRec)); + glyphsBase = (GlyphNewPtr) malloc (nglyphs * sizeof (GlyphNewRec)); if (!glyphsBase) return BadAlloc; } @@ -1533,19 +1533,19 @@ ProcRenderCreateCursor (ClientPtr client) if ( stuff->x > width || stuff->y > height ) return (BadMatch); - argbbits = xalloc (width * height * sizeof (CARD32)); + argbbits = malloc (width * height * sizeof (CARD32)); if (!argbbits) return (BadAlloc); stride = BitmapBytePad(width); nbytes_mono = stride*height; - srcbits = (unsigned char *)xalloc(nbytes_mono); + srcbits = (unsigned char *)malloc(nbytes_mono); if (!srcbits) { free (argbbits); return (BadAlloc); } - mskbits = (unsigned char *)xalloc(nbytes_mono); + mskbits = (unsigned char *)malloc(nbytes_mono); if (!mskbits) { free(argbbits); @@ -1748,7 +1748,7 @@ ProcRenderQueryFilters (ClientPtr client) } len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2); total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) xalloc (total_bytes); + reply = (xRenderQueryFiltersReply *) malloc (total_bytes); if (!reply) return BadAlloc; aliases = (INT16 *) (reply + 1); @@ -1862,7 +1862,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) if (client->req_len & 1) return BadLength; ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1; - cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); + cursors = malloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); if (!cursors) return BadAlloc; deltas = (CARD32 *) (cursors + ncursor); @@ -2681,7 +2681,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) return BadDrawable; - if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) + if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; newPict->info[0].id = stuff->pid; diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 6618dd45a..c60d4b37c 100755 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -157,7 +157,7 @@ XFixesSelectCursorInput (ClientPtr pClient, } if (!e) { - e = (CursorEventPtr) xalloc (sizeof (CursorEventRec)); + e = (CursorEventPtr) malloc (sizeof (CursorEventRec)); if (!e) return BadAlloc; @@ -312,7 +312,7 @@ ProcXFixesGetCursorImage (ClientPtr client) width = pCursor->bits->width; height = pCursor->bits->height; npixels = width * height; - rep = xalloc (sizeof (xXFixesGetCursorImageReply) + + rep = malloc (sizeof (xXFixesGetCursorImageReply) + npixels * sizeof (CARD32)); if (!rep) return BadAlloc; @@ -463,7 +463,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) name = pCursor->name ? NameForAtom (pCursor->name) : ""; nbytes = strlen (name); nbytesRound = (nbytes + 3) & ~3; - rep = xalloc (sizeof (xXFixesGetCursorImageAndNameReply) + + rep = malloc (sizeof (xXFixesGetCursorImageAndNameReply) + npixels * sizeof (CARD32) + nbytesRound); if (!rep) return BadAlloc; @@ -740,7 +740,7 @@ XFixesCursorInit (void) ScreenPtr pScreen = screenInfo.screens[i]; CursorScreenPtr cs; - cs = (CursorScreenPtr) xalloc (sizeof (CursorScreenRec)); + cs = (CursorScreenPtr) malloc (sizeof (CursorScreenRec)); if (!cs) return FALSE; Wrap (cs, pScreen, CloseScreen, CursorCloseScreen); diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index ba840f4b3..09f33d0ac 100755 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -575,7 +575,7 @@ ProcXFixesFetchRegion (ClientPtr client) pBox = RegionRects (pRegion); nBox = RegionNumRects (pRegion); - reply = xalloc (sizeof (xXFixesFetchRegionReply) + + reply = malloc (sizeof (xXFixesFetchRegionReply) + nBox * sizeof (xRectangle)); if (!reply) return BadAlloc; @@ -822,7 +822,7 @@ ProcXFixesExpandRegion (ClientPtr client) pSrc = RegionRects(pSource); if (nBoxes) { - pTmp = xalloc (nBoxes * sizeof (BoxRec)); + pTmp = malloc (nBoxes * sizeof (BoxRec)); if (!pTmp) return BadAlloc; for (i = 0; i < nBoxes; i++) diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c index 4abad3f19..6fe632c0d 100755 --- a/nx-X11/programs/Xserver/xfixes/select.c +++ b/nx-X11/programs/Xserver/xfixes/select.c @@ -156,7 +156,7 @@ XFixesSelectSelectionInput (ClientPtr pClient, } if (!e) { - e = (SelectionEventPtr) xalloc (sizeof (SelectionEventRec)); + e = (SelectionEventPtr) malloc (sizeof (SelectionEventRec)); if (!e) return BadAlloc; diff --git a/nx-X11/programs/Xserver/xkb/xkbActions.c b/nx-X11/programs/Xserver/xkb/xkbActions.c index eb1c80448..7bc6b3476 100644 --- a/nx-X11/programs/Xserver/xkb/xkbActions.c +++ b/nx-X11/programs/Xserver/xkb/xkbActions.c @@ -75,7 +75,7 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc) if (!AllocateDevicePrivate(device, xkbDevicePrivateIndex)) return; - xkbPrivPtr = (xkbDeviceInfoPtr) xalloc(sizeof(xkbDeviceInfoRec)); + xkbPrivPtr = (xkbDeviceInfoPtr) malloc(sizeof(xkbDeviceInfoRec)); if (!xkbPrivPtr) return; xkbPrivPtr->unwrapProc = NULL; -- cgit v1.2.3 From 74a5450bc058354e55c1589e64ef8e73775cebc4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 02:08:32 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}realloc() macros, use realloc() instead. --- nx-X11/lib/xtrans/transport.c | 1 - nx-X11/programs/Xserver/GL/glx/glximports.c | 2 +- nx-X11/programs/Xserver/GL/glx/glxutil.c | 2 +- nx-X11/programs/Xserver/GL/glx/unpack.h | 2 +- nx-X11/programs/Xserver/Xext/panoramiX.c | 2 +- nx-X11/programs/Xserver/Xext/security.c | 2 +- nx-X11/programs/Xserver/Xext/sync.c | 2 +- nx-X11/programs/Xserver/Xi/chgkbd.c | 2 +- nx-X11/programs/Xserver/composite/compinit.c | 4 ++-- nx-X11/programs/Xserver/dbe/dbe.c | 4 ++-- nx-X11/programs/Xserver/dix/atom.c | 2 +- nx-X11/programs/Xserver/dix/colormap.c | 24 ++++++++++++------------ nx-X11/programs/Xserver/dix/dispatch.c | 2 +- nx-X11/programs/Xserver/dix/dixfonts.c | 8 ++++---- nx-X11/programs/Xserver/dix/dixutils.c | 6 +++--- nx-X11/programs/Xserver/dix/events.c | 8 ++++---- nx-X11/programs/Xserver/dix/extension.c | 6 +++--- nx-X11/programs/Xserver/dix/main.c | 2 +- nx-X11/programs/Xserver/dix/privates.c | 14 +++++++------- nx-X11/programs/Xserver/dix/property.c | 4 ++-- nx-X11/programs/Xserver/dix/region.c | 6 +++--- nx-X11/programs/Xserver/dix/resource.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Font.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/GC.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 4 ++-- nx-X11/programs/Xserver/mi/miarc.c | 6 +++--- nx-X11/programs/Xserver/mi/midash.c | 2 +- nx-X11/programs/Xserver/mi/mispans.c | 10 +++++----- nx-X11/programs/Xserver/os/io.c | 8 ++++---- nx-X11/programs/Xserver/os/utils.c | 2 +- nx-X11/programs/Xserver/randr/rrcrtc.c | 4 ++-- nx-X11/programs/Xserver/randr/rrinfo.c | 6 +++--- nx-X11/programs/Xserver/randr/rrmode.c | 2 +- nx-X11/programs/Xserver/randr/rrmonitor.c | 2 +- nx-X11/programs/Xserver/randr/rroutput.c | 4 ++-- nx-X11/programs/Xserver/record/record.c | 6 +++--- nx-X11/programs/Xserver/render/filter.c | 6 +++--- nx-X11/programs/Xserver/render/glyph.c | 2 +- nx-X11/programs/Xserver/render/picture.c | 2 +- 43 files changed, 95 insertions(+), 96 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/lib/xtrans/transport.c b/nx-X11/lib/xtrans/transport.c index 8d3516dba..b7b1ef496 100644 --- a/nx-X11/lib/xtrans/transport.c +++ b/nx-X11/lib/xtrans/transport.c @@ -60,7 +60,6 @@ from The Open Group. #else #include #define xcalloc(_num,_size) calloc(_num,_size) -#define xrealloc(_ptr,_size) realloc(_ptr,_size) #endif #include "Xtransint.h" diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.c b/nx-X11/programs/Xserver/GL/glx/glximports.c index b1245f900..f966ca4df 100644 --- a/nx-X11/programs/Xserver/GL/glx/glximports.c +++ b/nx-X11/programs/Xserver/GL/glx/glximports.c @@ -94,7 +94,7 @@ void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize) free(addr); return NULL; } - newAddr = xrealloc(addr, newSize); + newAddr = realloc(addr, newSize); } else { if (newSize == 0) { return NULL; diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c index 715bb5c99..b95a21f89 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxutil.c +++ b/nx-X11/programs/Xserver/GL/glx/glxutil.c @@ -105,7 +105,7 @@ __glXRealloc(void *addr, size_t newSize) free(addr); return NULL; } else { - newAddr = xrealloc(addr, newSize); + newAddr = realloc(addr, newSize); } } else { if (newSize == 0) { diff --git a/nx-X11/programs/Xserver/GL/glx/unpack.h b/nx-X11/programs/Xserver/GL/glx/unpack.h index 94bdae8f9..d1150c32b 100644 --- a/nx-X11/programs/Xserver/GL/glx/unpack.h +++ b/nx-X11/programs/Xserver/GL/glx/unpack.h @@ -93,7 +93,7 @@ extern xGLXSingleReply __glXReply; else if ((size) > sizeof(answerBuffer)) { \ int bump; \ if ((cl)->returnBufSize < (size)+(align)) { \ - (cl)->returnBuf = (GLbyte*)Xrealloc((cl)->returnBuf, \ + (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \ (size)+(align)); \ if (!(cl)->returnBuf) { \ return BadAlloc; \ diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index ecf3453bb..3c72cec22 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -1217,7 +1217,7 @@ XineramaGetImageData( if(sizeNeeded > size) { char *tmpdata = ScratchMem; - ScratchMem = xrealloc(ScratchMem, sizeNeeded); + ScratchMem = realloc(ScratchMem, sizeNeeded); if(ScratchMem) size = sizeNeeded; else { diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index ec5f371db..a68cbf998 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -1720,7 +1720,7 @@ SecurityParseSitePolicy( if (!copyPolicyStr) return TRUE; strcpy(copyPolicyStr, policyStr); - newStrings = (char **)Xrealloc(SecurityPolicyStrings, + newStrings = (char **)realloc(SecurityPolicyStrings, sizeof (char *) * (nSecurityPolicyStrings + 1)); if (!newStrings) { diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 88170169e..aab85666e 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -1058,7 +1058,7 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, { SyncCounter *pCounter; - SysCounterList = (SyncCounter **)xrealloc(SysCounterList, + SysCounterList = (SyncCounter **)realloc(SysCounterList, (SyncNumSystemCounters+1)*sizeof(SyncCounter *)); if (!SysCounterList) return (void *)NULL; diff --git a/nx-X11/programs/Xserver/Xi/chgkbd.c b/nx-X11/programs/Xserver/Xi/chgkbd.c index 136d257c6..0cf8a1c87 100644 --- a/nx-X11/programs/Xserver/Xi/chgkbd.c +++ b/nx-X11/programs/Xserver/Xi/chgkbd.c @@ -168,7 +168,7 @@ ProcXChangeKeyboardDevice (client) if (df->traceSize != xf->traceSize) { Must_have_memory = TRUE; /* XXX */ - df->trace = (WindowPtr *) xrealloc(df->trace, + df->trace = (WindowPtr *) realloc(df->trace, xf->traceSize * sizeof(WindowPtr)); Must_have_memory = FALSE; /* XXX */ } diff --git a/nx-X11/programs/Xserver/composite/compinit.c b/nx-X11/programs/Xserver/composite/compinit.c index e33bd3a3f..27b54468f 100644 --- a/nx-X11/programs/Xserver/composite/compinit.c +++ b/nx-X11/programs/Xserver/composite/compinit.c @@ -230,7 +230,7 @@ compRegisterAlternateVisuals(CompScreenPtr cs, VisualID * vids, int nVisuals) p = reallocarray(cs->alternateVisuals, cs->numAlternateVisuals + nVisuals, sizeof(VisualID)); #else - p = xrealloc(cs->alternateVisuals, + p = realloc(cs->alternateVisuals, sizeof(VisualID) * (cs->numAlternateVisuals + nVisuals)); #endif if (p == NULL) @@ -265,7 +265,7 @@ CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen, p = reallocarray(cs->implicitRedirectExceptions, cs->numImplicitRedirectExceptions + 1, sizeof(p[0])); #else - p = xrealloc(cs->implicitRedirectExceptions, + p = realloc(cs->implicitRedirectExceptions, sizeof(p[0]) * (cs->numImplicitRedirectExceptions + 1)); #endif if (p == NULL) diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 658e61abe..743099763 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -268,7 +268,7 @@ DbeAllocWinPrivPriv(pScreen, index, amount) if (index >= pDbeScreenPriv->winPrivPrivLen) { unsigned *nsizes; - nsizes = (unsigned *)xrealloc(pDbeScreenPriv->winPrivPrivSizes, + nsizes = (unsigned *)realloc(pDbeScreenPriv->winPrivPrivSizes, (index + 1) * sizeof(unsigned)); if (!nsizes) { @@ -564,7 +564,7 @@ ProcDbeAllocateBackBufferName(client) } /* malloc/realloc a new array and initialize all elements to 0. */ - pDbeWindowPriv->IDs = (XID *)xrealloc(pIDs, + pDbeWindowPriv->IDs = (XID *)realloc(pIDs, (pDbeWindowPriv->maxAvailableIDs+DBE_INCR_MAX_IDS)*sizeof(XID)); if (!pDbeWindowPriv->IDs) { diff --git a/nx-X11/programs/Xserver/dix/atom.c b/nx-X11/programs/Xserver/dix/atom.c index 227069bab..6a1f17854 100644 --- a/nx-X11/programs/Xserver/dix/atom.c +++ b/nx-X11/programs/Xserver/dix/atom.c @@ -129,7 +129,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit) if ((lastAtom + 1) >= tableLength) { NodePtr *table; - table = (NodePtr *) xrealloc(nodeTable, + table = (NodePtr *) realloc(nodeTable, tableLength * (2 * sizeof(NodePtr))); if (!table) { if (nd->string != string) diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index 121877461..8129e9c3d 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -841,7 +841,7 @@ AllocColor (ColormapPtr pmap, *pgreen = pmap->red[pixR].co.local.green; *pblue = pmap->red[pixR].co.local.blue; npix = pmap->numPixelsRed[client]; - ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client], + ppix = (Pixel *) realloc(pmap->clientPixelsRed[client], (npix + 1) * sizeof(Pixel)); if (!ppix) return (BadAlloc); @@ -864,21 +864,21 @@ AllocColor (ColormapPtr pmap, *pgreen = pmap->green[pixG].co.local.green; *pblue = pmap->blue[pixB].co.local.blue; npix = pmap->numPixelsRed[client]; - ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client], + ppix = (Pixel *) realloc(pmap->clientPixelsRed[client], (npix + 1) * sizeof(Pixel)); if (!ppix) return (BadAlloc); ppix[npix] = pixR; pmap->clientPixelsRed[client] = ppix; npix = pmap->numPixelsGreen[client]; - ppix = (Pixel *) xrealloc(pmap->clientPixelsGreen[client], + ppix = (Pixel *) realloc(pmap->clientPixelsGreen[client], (npix + 1) * sizeof(Pixel)); if (!ppix) return (BadAlloc); ppix[npix] = pixG; pmap->clientPixelsGreen[client] = ppix; npix = pmap->numPixelsBlue[client]; - ppix = (Pixel *) xrealloc(pmap->clientPixelsBlue[client], + ppix = (Pixel *) realloc(pmap->clientPixelsBlue[client], (npix + 1) * sizeof(Pixel)); if (!ppix) return (BadAlloc); @@ -1348,7 +1348,7 @@ gotit: break; } npix = nump[client]; - ppix = (Pixel *) xrealloc (pixp[client], (npix + 1) * sizeof(Pixel)); + ppix = (Pixel *) realloc (pixp[client], (npix + 1) * sizeof(Pixel)); if (!ppix) { pent->refcnt--; @@ -1762,17 +1762,17 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont if (okR && okG && okB) { - rpix = (Pixel *) xrealloc(pmap->clientPixelsRed[client], + rpix = (Pixel *) realloc(pmap->clientPixelsRed[client], (pmap->numPixelsRed[client] + (c << r)) * sizeof(Pixel)); if (rpix) pmap->clientPixelsRed[client] = rpix; - gpix = (Pixel *) xrealloc(pmap->clientPixelsGreen[client], + gpix = (Pixel *) realloc(pmap->clientPixelsGreen[client], (pmap->numPixelsGreen[client] + (c << g)) * sizeof(Pixel)); if (gpix) pmap->clientPixelsGreen[client] = gpix; - bpix = (Pixel *) xrealloc(pmap->clientPixelsBlue[client], + bpix = (Pixel *) realloc(pmap->clientPixelsBlue[client], (pmap->numPixelsBlue[client] + (c << b)) * sizeof(Pixel)); if (bpix) @@ -1861,7 +1861,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, /* all the allocated pixels are added to the client pixel list, * but only the unique ones are returned to the client */ - ppix = (Pixel *)xrealloc(pmap->clientPixelsRed[client], + ppix = (Pixel *)realloc(pmap->clientPixelsRed[client], (pmap->numPixelsRed[client] + npix) * sizeof(Pixel)); if (!ppix) { @@ -2364,7 +2364,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe npix++; } } - pptr = (Pixel *)xrealloc(ppixClient, npixNew * sizeof(Pixel)); + pptr = (Pixel *)realloc(ppixClient, npixNew * sizeof(Pixel)); if (pptr) ppixClient = pptr; npixClient = npixNew; @@ -2729,7 +2729,7 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth) vids = reallocarray(depth->vids, depth->numVids + new_visual_count, sizeof(XID)); #else - vids = xrealloc(depth->vids, sizeof(XID) * + vids = realloc(depth->vids, sizeof(XID) * (depth->numVids + new_visual_count)); #endif if (!vids) @@ -2742,7 +2742,7 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth) #if 0 /* !defined(NXAGENT_SERVER) */ visuals = reallocarray(pScreen->visuals, numVisuals, sizeof(VisualRec)); #else - visuals = xrealloc(pScreen->visuals, sizeof(VisualRec) * numVisuals); + visuals = realloc(pScreen->visuals, sizeof(VisualRec) * numVisuals); #endif if (!visuals) { return FALSE; diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 807fecd90..ed908d03f 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -1023,7 +1023,7 @@ ProcSetSelectionOwner(register ClientPtr client) if (i == 0) newsels = (Selection *)malloc(sizeof(Selection)); else - newsels = (Selection *)xrealloc(CurrentSelections, + newsels = (Selection *)realloc(CurrentSelections, (NumCurrentSelections + 1) * sizeof(Selection)); if (!newsels) return BadAlloc; diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index ef40c66f7..0ebb4e68d 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -170,7 +170,7 @@ QueueFontWakeup(FontPathElementPtr fpe) } if (num_slept_fpes == size_slept_fpes) { new = (FontPathElementPtr *) - xrealloc(slept_fpes, + realloc(slept_fpes, sizeof(FontPathElementPtr) * (size_slept_fpes + 4)); if (!new) return; @@ -302,7 +302,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (err == FontNameAlias && alias) { newlen = strlen(alias); - newname = (char *) xrealloc(c->fontname, newlen); + newname = (char *) realloc(c->fontname, newlen); if (!newname) { err = AllocError; break; @@ -1038,7 +1038,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) reply = c->reply; if (c->length < length) { - reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length); + reply = (xListFontsWithInfoReply *) realloc(c->reply, length); if (!reply) { err = AllocError; @@ -1998,7 +1998,7 @@ RegisterFPEFunctions(NameCheckFunc name_func, FPEFunctions *new; /* grow the list */ - new = (FPEFunctions *) xrealloc(fpe_functions, + new = (FPEFunctions *) realloc(fpe_functions, (num_fpe_types + 1) * sizeof(FPEFunctions)); if (!new) return -1; diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index 84eb63f14..d43b57a2c 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -351,7 +351,7 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, if (j < numnow) /* duplicate */ return(Success); numnow++; - pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(*pTmp) * numnow); + pTmp = (SaveSetElt *)realloc(client->saveSet, sizeof(*pTmp) * numnow); if (!pTmp) return(BadAlloc); client->saveSet = pTmp; @@ -371,7 +371,7 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, numnow--; if (numnow) { - pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(*pTmp) * numnow); + pTmp = (SaveSetElt *)realloc(client->saveSet, sizeof(*pTmp) * numnow); if (pTmp) client->saveSet = pTmp; } @@ -504,7 +504,7 @@ RegisterBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler, if (numHandlers >= sizeHandlers) { - new = (BlockHandlerPtr) xrealloc (handlers, (numHandlers + 1) * + new = (BlockHandlerPtr) realloc (handlers, (numHandlers + 1) * sizeof (BlockHandlerRec)); if (!new) return FALSE; diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index 97cd13b5e..676640f01 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -1952,7 +1952,7 @@ XYToWindow(int x, int y) { spriteTraceSize += 10; Must_have_memory = TRUE; /* XXX */ - spriteTrace = (WindowPtr *)xrealloc( + spriteTrace = (WindowPtr *)realloc( spriteTrace, spriteTraceSize*sizeof(WindowPtr)); Must_have_memory = FALSE; /* XXX */ } @@ -2467,7 +2467,7 @@ CheckPassiveGrabsOnWindow( if (device->sync.evcount < count) { Must_have_memory = TRUE; /* XXX */ - device->sync.event = (xEvent *)xrealloc(device->sync.event, + device->sync.event = (xEvent *)realloc(device->sync.event, count* sizeof(xEvent)); Must_have_memory = FALSE; /* XXX */ @@ -2639,7 +2639,7 @@ DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev, if (thisDev->sync.evcount < count) { Must_have_memory = TRUE; /* XXX */ - thisDev->sync.event = (xEvent *)xrealloc(thisDev->sync.event, + thisDev->sync.event = (xEvent *)realloc(thisDev->sync.event, count*sizeof(xEvent)); Must_have_memory = FALSE; /* XXX */ } @@ -3530,7 +3530,7 @@ SetInputFocus( { focus->traceSize = depth+1; Must_have_memory = TRUE; /* XXX */ - focus->trace = (WindowPtr *)xrealloc(focus->trace, + focus->trace = (WindowPtr *)realloc(focus->trace, focus->traceSize * sizeof(WindowPtr)); Must_have_memory = FALSE; /* XXX */ diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c index 9c25c3db8..b0859757b 100644 --- a/nx-X11/programs/Xserver/dix/extension.c +++ b/nx-X11/programs/Xserver/dix/extension.c @@ -108,7 +108,7 @@ AddExtension(char *name, int NumEvents, int NumErrors, } strcpy(ext->name, name); i = NumExtensions; - newexts = (ExtensionEntry **) xrealloc(extensions, + newexts = (ExtensionEntry **) realloc(extensions, (i + 1) * sizeof(ExtensionEntry *)); if (!newexts) { @@ -159,7 +159,7 @@ Bool AddExtensionAlias(char *alias, ExtensionEntry *ext) char *name; char **aliases; - aliases = (char **)xrealloc(ext->aliases, + aliases = (char **)realloc(ext->aliases, (ext->num_aliases + 1) * sizeof(char *)); if (!aliases) return FALSE; @@ -442,7 +442,7 @@ RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc) if (!newname) return FALSE; procEntry = (ProcEntryPtr) - xrealloc(spentry->procList, + realloc(spentry->procList, sizeof(ProcEntryRec) * (spentry->num+1)); if (!procEntry) { diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c index 05f6dd19b..a95b8b4a9 100644 --- a/nx-X11/programs/Xserver/dix/main.c +++ b/nx-X11/programs/Xserver/dix/main.c @@ -618,7 +618,7 @@ CreateConnectionBlock() { lenofblock += sizeof(xDepth) + (pDepth->numVids * sizeof(xVisualType)); - pBuf = (char *)xrealloc(ConnectionInfo, lenofblock); + pBuf = (char *)realloc(ConnectionInfo, lenofblock); if (!pBuf) { free(ConnectionInfo); diff --git a/nx-X11/programs/Xserver/dix/privates.c b/nx-X11/programs/Xserver/dix/privates.c index 3455fb21c..15a9dff4d 100644 --- a/nx-X11/programs/Xserver/dix/privates.c +++ b/nx-X11/programs/Xserver/dix/privates.c @@ -89,7 +89,7 @@ AllocateClientPrivate(int index2, unsigned amount) if (index2 >= clientPrivateLen) { unsigned *nsizes; - nsizes = (unsigned *)xrealloc(clientPrivateSizes, + nsizes = (unsigned *)realloc(clientPrivateSizes, (index2 + 1) * sizeof(unsigned)); if (!nsizes) return FALSE; @@ -136,7 +136,7 @@ AllocateScreenPrivateIndex() for (i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; - nprivs = (DevUnion *)xrealloc(pScreen->devPrivates, + nprivs = (DevUnion *)realloc(pScreen->devPrivates, screenPrivateCount * sizeof(DevUnion)); if (!nprivs) { @@ -180,7 +180,7 @@ AllocateWindowPrivate(register ScreenPtr pScreen, int index2, unsigned amount) if (index2 >= pScreen->WindowPrivateLen) { unsigned *nsizes; - nsizes = (unsigned *)xrealloc(pScreen->WindowPrivateSizes, + nsizes = (unsigned *)realloc(pScreen->WindowPrivateSizes, (index2 + 1) * sizeof(unsigned)); if (!nsizes) return FALSE; @@ -230,7 +230,7 @@ AllocateGCPrivate(register ScreenPtr pScreen, int index2, unsigned amount) if (index2 >= pScreen->GCPrivateLen) { unsigned *nsizes; - nsizes = (unsigned *)xrealloc(pScreen->GCPrivateSizes, + nsizes = (unsigned *)realloc(pScreen->GCPrivateSizes, (index2 + 1) * sizeof(unsigned)); if (!nsizes) return FALSE; @@ -280,7 +280,7 @@ AllocatePixmapPrivate(register ScreenPtr pScreen, int index2, unsigned amount) if (index2 >= pScreen->PixmapPrivateLen) { unsigned *nsizes; - nsizes = (unsigned *)xrealloc(pScreen->PixmapPrivateSizes, + nsizes = (unsigned *)realloc(pScreen->PixmapPrivateSizes, (index2 + 1) * sizeof(unsigned)); if (!nsizes) return FALSE; @@ -345,7 +345,7 @@ AllocateColormapPrivateIndex (InitCmapPrivFunc initPrivFunc) if (pColormap) { - privs = (DevUnion *) xrealloc (pColormap->devPrivates, + privs = (DevUnion *) realloc (pColormap->devPrivates, colormapPrivateCount * sizeof(DevUnion)); if (!privs) { colormapPrivateCount--; @@ -380,7 +380,7 @@ Bool AllocateDevicePrivate(DeviceIntPtr device, int index) { if (device->nPrivates < ++index) { - DevUnion *nprivs = (DevUnion *) xrealloc(device->devPrivates, + DevUnion *nprivs = (DevUnion *) realloc(device->devPrivates, index * sizeof(DevUnion)); if (!nprivs) return FALSE; diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index 28ce1355c..7ed66b60a 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -318,7 +318,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, { if (totalSize != pProp->size * (pProp->format >> 3)) { - data = (void *)xrealloc(pProp->data, totalSize); + data = (void *)realloc(pProp->data, totalSize); if (!data && len) return(BadAlloc); pProp->data = data; @@ -335,7 +335,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, } else if (mode == PropModeAppend) { - data = (void *)xrealloc(pProp->data, + data = (void *)realloc(pProp->data, sizeInBytes * (len + pProp->size)); if (!data) return(BadAlloc); diff --git a/nx-X11/programs/Xserver/dix/region.c b/nx-X11/programs/Xserver/dix/region.c index df7c1fc16..f2b7224f8 100644 --- a/nx-X11/programs/Xserver/dix/region.c +++ b/nx-X11/programs/Xserver/dix/region.c @@ -210,7 +210,7 @@ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ { \ size_t NewSize = RegionSizeof(numRects); \ RegDataPtr NewData = \ - (NewSize > 0) ? (RegDataPtr)xrealloc((reg)->data, NewSize) : NULL; \ + (NewSize > 0) ? (RegDataPtr)realloc((reg)->data, NewSize) : NULL; \ if (NewData) \ { \ NewData->size = (numRects); \ @@ -391,7 +391,7 @@ RegionRectAlloc( } n += pRgn->data->numRects; rgnSize = RegionSizeof(n); - data = (rgnSize > 0) ? xrealloc(pRgn->data, rgnSize) : NULL; + data = (rgnSize > 0) ? realloc(pRgn->data, rgnSize) : NULL; if (!data) return RegionBreak (pRgn); pRgn->data = data; @@ -1299,7 +1299,7 @@ RegionValidate(badreg, pOverlap) { /* Oops, allocate space for new region information */ sizeRI <<= 1; - rit = (RegionInfo *) xrealloc(ri, sizeRI * sizeof(RegionInfo)); + rit = (RegionInfo *) realloc(ri, sizeRI * sizeof(RegionInfo)); if (!rit) goto bail; ri = rit; diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index 905dafc24..40a063891 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -178,7 +178,7 @@ CreateNewResourceType(DeleteType deleteFunc) if (next & lastResourceClass) return 0; - funcs = (DeleteType *)xrealloc(DeleteFuncs, + funcs = (DeleteType *)realloc(DeleteFuncs, (next + 1) * sizeof(DeleteType)); if (!funcs) return 0; @@ -186,7 +186,7 @@ CreateNewResourceType(DeleteType deleteFunc) #ifdef XResExtension { Atom *newnames; - newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom)); + newnames = realloc(ResourceNames, (next + 1) * sizeof(Atom)); if(!newnames) return 0; ResourceNames = newnames; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 86a338b3d..15d1d2206 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -2549,7 +2549,7 @@ Bool nxagentReconnectDisplay(void *p0) nxagentNumDefaultColormaps = nxagentNumVisuals; - nxagentDefaultColormaps = (Colormap *) xrealloc(nxagentDefaultColormaps, + nxagentDefaultColormaps = (Colormap *) realloc(nxagentDefaultColormaps, nxagentNumDefaultColormaps * sizeof(Colormap)); if (nxagentDefaultColormaps == NULL) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 90f545027..2ef471ab1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -306,7 +306,7 @@ void nxagentListRemoteAddName(const char *name, int status) if (nxagentRemoteFontList.length == nxagentRemoteFontList.listSize) { - nxagentRemoteFontList.list = xrealloc(nxagentRemoteFontList.list, sizeof(nxagentFontRecPtr) + nxagentRemoteFontList.list = realloc(nxagentRemoteFontList.list, sizeof(nxagentFontRecPtr) * (nxagentRemoteFontList.listSize + 1000)); if (nxagentRemoteFontList.list == NULL) @@ -569,7 +569,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) if (CACHE_INDEX == CACHE_SIZE) { - CACHE_ENTRY_PTR = xrealloc(CACHE_ENTRY_PTR, sizeof(nxCacheFontEntryRecPtr) * (CACHE_SIZE + 100)); + CACHE_ENTRY_PTR = realloc(CACHE_ENTRY_PTR, sizeof(nxCacheFontEntryRecPtr) * (CACHE_SIZE + 100)); if (CACHE_ENTRY_PTR == NULL) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index ef83b871a..1c1a77f37 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -1613,7 +1613,7 @@ GCPtr nxagentCreateGraphicContext(int depth) * to spread the list and add a new GC. */ - nxagentGCs = xrealloc(nxagentGraphicContexts, (nxagentGraphicContextsSize + 1) * sizeof(nxagentGraphicContextsRec)); + nxagentGCs = realloc(nxagentGraphicContexts, (nxagentGraphicContextsSize + 1) * sizeof(nxagentGraphicContextsRec)); if (nxagentGCs == NULL) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index b27a92102..215d06b53 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -752,7 +752,7 @@ ProcSetSelectionOwner(register ClientPtr client) if (i == 0) newsels = (Selection *)malloc(sizeof(Selection)); else - newsels = (Selection *)xrealloc(CurrentSelections, + newsels = (Selection *)realloc(CurrentSelections, (NumCurrentSelections + 1) * sizeof(Selection)); if (!newsels) return BadAlloc; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 4b0af0867..2603988b2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -227,7 +227,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (err == FontNameAlias && alias) { newlen = strlen(alias); - newname = (char *) xrealloc(c->fontname, newlen); + newname = (char *) realloc(c->fontname, newlen); if (!newname) { err = AllocError; break; @@ -846,7 +846,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) reply = c->reply; if (c->length < length) { - reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length); + reply = (xListFontsWithInfoReply *) realloc(c->reply, length); if (!reply) { err = AllocError; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index be42ea110..d19e161ac 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -363,7 +363,7 @@ XYToWindow(int x, int y) { spriteTraceSize += 10; Must_have_memory = TRUE; /* XXX */ - spriteTrace = (WindowPtr *)xrealloc( + spriteTrace = (WindowPtr *)realloc( spriteTrace, spriteTraceSize*sizeof(WindowPtr)); Must_have_memory = FALSE; /* XXX */ } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 4b4e059bd..154d85b41 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -261,7 +261,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, { if (totalSize != pProp->size * (pProp->format >> 3)) { - data = (void *)xrealloc(pProp->data, totalSize); + data = (void *)realloc(pProp->data, totalSize); if (!data && len) return(BadAlloc); pProp->data = data; @@ -278,7 +278,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, } else if (mode == PropModeAppend) { - data = (void *)xrealloc(pProp->data, + data = (void *)realloc(pProp->data, sizeInBytes * (len + pProp->size)); if (!data) return(BadAlloc); diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c index c1e07f175..9c3bcb7ad 100644 --- a/nx-X11/programs/Xserver/mi/miarc.c +++ b/nx-X11/programs/Xserver/mi/miarc.c @@ -1754,7 +1754,7 @@ addCap ( if (*ncapsp == *sizep) { newsize = *sizep + ADD_REALLOC_STEP; - cap = (miArcCapPtr) xrealloc (*capsp, + cap = (miArcCapPtr) realloc (*capsp, newsize * sizeof (**capsp)); if (!cap) return; @@ -1785,7 +1785,7 @@ addJoin ( if (*njoinsp == *sizep) { newsize = *sizep + ADD_REALLOC_STEP; - join = (miArcJoinPtr) xrealloc (*joinsp, + join = (miArcJoinPtr) realloc (*joinsp, newsize * sizeof (**joinsp)); if (!join) return; @@ -1815,7 +1815,7 @@ addArc ( if (*narcsp == *sizep) { newsize = *sizep + ADD_REALLOC_STEP; - arc = (miArcDataPtr) xrealloc (*arcsp, + arc = (miArcDataPtr) realloc (*arcsp, newsize * sizeof (**arcsp)); if (!arc) return (miArcDataPtr)NULL; diff --git a/nx-X11/programs/Xserver/mi/midash.c b/nx-X11/programs/Xserver/mi/midash.c index 2cf2704ea..59c6afdce 100644 --- a/nx-X11/programs/Xserver/mi/midash.c +++ b/nx-X11/programs/Xserver/mi/midash.c @@ -265,7 +265,7 @@ CheckDashStorage( miDashPtr newppseg; *pnsegMax += NSEGDELTA; - newppseg = (miDashPtr)xrealloc(*ppseg, + newppseg = (miDashPtr)realloc(*ppseg, (*pnsegMax)*sizeof(miDashRec)); if (!newppseg) { diff --git a/nx-X11/programs/Xserver/mi/mispans.c b/nx-X11/programs/Xserver/mi/mispans.c index 38398f86b..ef2dc269f 100644 --- a/nx-X11/programs/Xserver/mi/mispans.c +++ b/nx-X11/programs/Xserver/mi/mispans.c @@ -155,12 +155,12 @@ void miSubtractSpans (spanGroup, sub) int *newwid; #define EXTRA 8 - newPt = (DDXPointPtr) xrealloc (spans->points, (spans->count + EXTRA) * sizeof (DDXPointRec)); + newPt = (DDXPointPtr) realloc (spans->points, (spans->count + EXTRA) * sizeof (DDXPointRec)); if (!newPt) break; spansPt = newPt + (spansPt - spans->points); spans->points = newPt; - newwid = (int *) xrealloc (spans->widths, (spans->count + EXTRA) * sizeof (int)); + newwid = (int *) realloc (spans->widths, (spans->count + EXTRA) * sizeof (int)); if (!newwid) break; spansWid = newwid + (spansWid - spans->widths); @@ -198,7 +198,7 @@ void miAppendSpans(spanGroup, otherGroup, spans) if (spanGroup->size == spanGroup->count) { spanGroup->size = (spanGroup->size + 8) * 2; spanGroup->group = (Spans *) - xrealloc(spanGroup->group, sizeof(Spans) * spanGroup->size); + realloc(spanGroup->group, sizeof(Spans) * spanGroup->size); } spanGroup->group[spanGroup->count] = *spans; @@ -456,10 +456,10 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) DDXPointPtr newpoints; int *newwidths; ysizes[index] = (ysizes[index] + 8) * 2; - newpoints = (DDXPointPtr) xrealloc( + newpoints = (DDXPointPtr) realloc( newspans->points, ysizes[index] * sizeof(DDXPointRec)); - newwidths = (int *) xrealloc( + newwidths = (int *) realloc( newspans->widths, ysizes[index] * sizeof(int)); if (!newpoints || !newwidths) diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index 3e9abb35c..d0862ddd4 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -321,7 +321,7 @@ ReadRequestFromClient(ClientPtr client) /* make buffer bigger to accomodate request */ char *ibuf; - ibuf = (char *)xrealloc(oci->buffer, needed); + ibuf = (char *)realloc(oci->buffer, needed); if (!ibuf) { YieldControlDeath(); @@ -371,7 +371,7 @@ ReadRequestFromClient(ClientPtr client) { char *ibuf; - ibuf = (char *)xrealloc(oci->buffer, BUFSIZE); + ibuf = (char *)realloc(oci->buffer, BUFSIZE); if (ibuf) { oci->size = BUFSIZE; @@ -531,7 +531,7 @@ InsertFakeRequest(ClientPtr client, char *data, int count) { char *ibuf; - ibuf = (char *)xrealloc(oci->buffer, gotnow + count); + ibuf = (char *)realloc(oci->buffer, gotnow + count); if (!ibuf) return(FALSE); oci->size = gotnow + count; @@ -1097,7 +1097,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount) { unsigned char *obuf; - obuf = (unsigned char *)xrealloc(oco->buf, + obuf = (unsigned char *)realloc(oco->buf, notWritten + BUFSIZE); if (!obuf) { diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 98e3cab8b..63dd920b3 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -1220,7 +1220,7 @@ InsertFileIntoCommandLine( } } - buf = (char *) xrealloc(buf, q - buf); + buf = (char *) realloc(buf, q - buf); if (!buf) FatalError("Out of memory reallocing option buf\n"); diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c index e7add9d60..95f02b8cd 100644 --- a/nx-X11/programs/Xserver/randr/rrcrtc.c +++ b/nx-X11/programs/Xserver/randr/rrcrtc.c @@ -86,7 +86,7 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate) crtcs = reallocarray(pScrPriv->crtcs, pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr)); #else /* !defined(NXAGENT_SERVER) */ - crtcs = xrealloc(pScrPriv->crtcs, + crtcs = realloc(pScrPriv->crtcs, (pScrPriv->numCrtcs + 1) * sizeof(RRCrtcPtr)); #endif /* !defined(NXAGENT_SERVER) */ else @@ -202,7 +202,7 @@ RRCrtcNotify(RRCrtcPtr crtc, newoutputs = reallocarray(crtc->outputs, numOutputs, sizeof(RROutputPtr)); #else /* !defined(NXAGENT_SERVER) */ - newoutputs = xrealloc(crtc->outputs, + newoutputs = realloc(crtc->outputs, numOutputs * sizeof(RROutputPtr)); #endif /* !defined(NXAGENT_SERVER) */ else diff --git a/nx-X11/programs/Xserver/randr/rrinfo.c b/nx-X11/programs/Xserver/randr/rrinfo.c index c5075572f..bea921436 100644 --- a/nx-X11/programs/Xserver/randr/rrinfo.c +++ b/nx-X11/programs/Xserver/randr/rrinfo.c @@ -59,7 +59,7 @@ RROldModeAdd(RROutputPtr output, RRScreenSizePtr size, int refresh) modes = reallocarray(output->modes, output->numModes + 1, sizeof(RRModePtr)); #else /* !defined(NXAGENT_SERVER) */ - modes = xrealloc(output->modes, + modes = realloc(output->modes, (output->numModes + 1) * sizeof(RRModePtr)); #endif /* !defined(NXAGENT_SERVER) */ else @@ -275,7 +275,7 @@ RRRegisterSize(ScreenPtr pScreen, pNew = reallocarray(pScrPriv->pSizes, pScrPriv->nSizes + 1, sizeof(RRScreenSize)); #else /* !defined(NXAGENT_SERVER) */ - pNew = xrealloc(pScrPriv->pSizes, + pNew = realloc(pScrPriv->pSizes, (pScrPriv->nSizes + 1) * sizeof(RRScreenSize)); #endif /* !defined(NXAGENT_SERVER) */ if (!pNew) @@ -302,7 +302,7 @@ RRRegisterRate(ScreenPtr pScreen, RRScreenSizePtr pSize, int rate) #ifndef NXAGENT_SERVER pNew = reallocarray(pSize->pRates, pSize->nRates + 1, sizeof(RRScreenRate)); #else /* !defined(NXAGENT_SERVER) */ - pNew = xrealloc(pSize->pRates, (pSize->nRates + 1) * sizeof(RRScreenRate)); + pNew = realloc(pSize->pRates, (pSize->nRates + 1) * sizeof(RRScreenRate)); #endif /* !defined(NXAGENT_SERVER) */ if (!pNew) return FALSE; diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c index e8dd208a1..c4718c1b4 100644 --- a/nx-X11/programs/Xserver/randr/rrmode.c +++ b/nx-X11/programs/Xserver/randr/rrmode.c @@ -99,7 +99,7 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen) #ifndef NXAGENT_SERVER newModes = reallocarray(modes, num_modes + 1, sizeof(RRModePtr)); #else /* !defined(NXAGENT_SERVER) */ - newModes = xrealloc(modes, (num_modes + 1) * sizeof(RRModePtr)); + newModes = realloc(modes, (num_modes + 1) * sizeof(RRModePtr)); #endif /* !defined(NXAGENT_SERVER) */ else diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c index 0e5514415..651dd47f8 100644 --- a/nx-X11/programs/Xserver/randr/rrmonitor.c +++ b/nx-X11/programs/Xserver/randr/rrmonitor.c @@ -512,7 +512,7 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor) pScrPriv->numMonitors + 1, sizeof(RRMonitorPtr)); #else /* !defined(NXAGENT_SERVER) */ - monitors = xrealloc(pScrPriv->monitors, + monitors = realloc(pScrPriv->monitors, (pScrPriv->numMonitors + 1) * sizeof(RRMonitorPtr)); #endif /* !defined(NXAGENT_SERVER) */ else diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c index 7be00ab5e..4a3d32a12 100644 --- a/nx-X11/programs/Xserver/randr/rroutput.c +++ b/nx-X11/programs/Xserver/randr/rroutput.c @@ -79,7 +79,7 @@ RROutputCreate(ScreenPtr pScreen, outputs = reallocarray(pScrPriv->outputs, pScrPriv->numOutputs + 1, sizeof(RROutputPtr)); #else /* !defined(NXAGENT_SERVER) */ - outputs = xrealloc(pScrPriv->outputs, + outputs = realloc(pScrPriv->outputs, (pScrPriv->numOutputs + 1) * sizeof(RROutputPtr)); #endif /* !defined(NXAGENT_SERVER) */ else @@ -232,7 +232,7 @@ RROutputAddUserMode(RROutputPtr output, RRModePtr mode) newModes = reallocarray(output->userModes, output->numUserModes + 1, sizeof(RRModePtr)); #else /* !defined(NXAGENT_SERVER) */ - newModes = xrealloc(output->userModes, + newModes = realloc(output->userModes, (output->numUserModes + 1) * sizeof(RRModePtr)); #endif /* !defined(NXAGENT_SERVER) */ else diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index 1718c2810..410920d02 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -1228,7 +1228,7 @@ RecordAddClientToRCAP(pRCAP, clientspec) { if (pRCAP->clientIDsSeparatelyAllocated) { - XID *pNewIDs = (XID *)xrealloc(pRCAP->pClientIDs, + XID *pNewIDs = (XID *)realloc(pRCAP->pClientIDs, (pRCAP->sizeClients + CLIENT_ARRAY_GROWTH_INCREMENT) * sizeof(XID)); if (!pNewIDs) @@ -2037,7 +2037,7 @@ ProcRecordCreateContext(client) /* make sure there is room in ppAllContexts to store the new context */ ppNewAllContexts = (RecordContextPtr *) - xrealloc(ppAllContexts, sizeof(RecordContextPtr) * (numContexts + 1)); + realloc(ppAllContexts, sizeof(RecordContextPtr) * (numContexts + 1)); if (!ppNewAllContexts) goto bailout; ppAllContexts = ppNewAllContexts; @@ -2162,7 +2162,7 @@ RecordAllocRanges(pri, nRanges) #define SZINCR 8 newsize = max(pri->size + SZINCR, nRanges); - pNewRange = (xRecordRange *)xrealloc(pri->pRanges, + pNewRange = (xRecordRange *)realloc(pri->pRanges, newsize * sizeof(xRecordRange)); if (!pNewRange) return BadAlloc; diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 065ffa682..10e732997 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -68,7 +68,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit) memcpy (name, filter, len); name[len] = '\0'; if (filterNames) - names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *)); + names = realloc (filterNames, (nfilterNames + 1) * sizeof (char *)); else names = malloc (sizeof (char *)); if (!names) @@ -144,7 +144,7 @@ PictureAddFilter (ScreenPtr pScreen, if (ps->filters[i].id == id) return -1; if (ps->filters) - filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec)); + filters = realloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec)); else filters = malloc (sizeof (PictFilterRec)); if (!filters) @@ -175,7 +175,7 @@ PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias) PictFilterAliasPtr aliases; if (ps->filterAliases) - aliases = xrealloc (ps->filterAliases, + aliases = realloc (ps->filterAliases, (ps->nfilterAliases + 1) * sizeof (PictFilterAliasRec)); else diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index 4cba50d0f..2ef1087e7 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -117,7 +117,7 @@ _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr) if (n > glyphSet->maxPrivate) { if (glyphSet->devPrivates && glyphSet->devPrivates != (void *)(&glyphSet[1])) { - new = (void **) xrealloc (glyphSet->devPrivates, + new = (void **) realloc (glyphSet->devPrivates, (n + 1) * sizeof (void *)); if (!new) return FALSE; diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 1131696d5..4a1cd98f5 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -82,7 +82,7 @@ AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount) { unsigned int *nsizes; - nsizes = (unsigned int *)xrealloc(ps->PicturePrivateSizes, + nsizes = (unsigned int *)realloc(ps->PicturePrivateSizes, (index2 + 1) * sizeof(unsigned int)); if (!nsizes) return FALSE; -- cgit v1.2.3 From b15fc63f4c0c4c741af1255d17907ba3b98b5cf9 Mon Sep 17 00:00:00 2001 From: Tomas Carnecky Date: Tue, 5 Jul 2016 08:16:09 +0200 Subject: Replace INITARGS with void INITARGS was a hardcoded define to void. Since knowing the function signature for your extensions is kinda useful, just replace it with a hardcoded void, but leave the define there for API compatibility. Signed-off-by: Tomas Carnecky Reviewed-by: Daniel Stone Reviewed-by: Cyril Brulebois Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer Signed-off-by: Keith Packard Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/GL/glxmodule.c | 2 +- nx-X11/programs/Xserver/Xext/bigreq.c | 2 +- nx-X11/programs/Xserver/Xext/dpms.c | 2 +- nx-X11/programs/Xserver/Xext/extmod/modinit.h | 38 ++++++++-------- nx-X11/programs/Xserver/Xext/saver.c | 2 +- nx-X11/programs/Xserver/Xext/security.c | 2 +- nx-X11/programs/Xserver/Xext/shape.c | 2 +- nx-X11/programs/Xserver/Xext/shm.c | 2 +- nx-X11/programs/Xserver/Xext/sync.c | 2 +- nx-X11/programs/Xserver/Xext/xcmisc.c | 2 +- nx-X11/programs/Xserver/Xext/xres.c | 2 +- nx-X11/programs/Xserver/Xext/xtest.c | 2 +- nx-X11/programs/Xserver/Xext/xtest1di.c | 2 +- nx-X11/programs/Xserver/dbe/dbemodule.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 2 +- nx-X11/programs/Xserver/mi/miinitext.c | 62 +++++++++++++-------------- nx-X11/programs/Xserver/record/recordmod.c | 2 +- 17 files changed, 63 insertions(+), 67 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glxmodule.c b/nx-X11/programs/Xserver/GL/glxmodule.c index b97b7ef8a..f0cce1a3f 100644 --- a/nx-X11/programs/Xserver/GL/glxmodule.c +++ b/nx-X11/programs/Xserver/GL/glxmodule.c @@ -43,7 +43,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static MODULESETUPPROTO(glxSetup); -extern void GlxExtensionInit(INITARGS); +extern void GlxExtensionInit(void); extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); extern void InitGlxWrapInitVisuals(void (*f)(miInitVisualsProcPtr *)); diff --git a/nx-X11/programs/Xserver/Xext/bigreq.c b/nx-X11/programs/Xserver/Xext/bigreq.c index a43031d7e..ec1ece91a 100644 --- a/nx-X11/programs/Xserver/Xext/bigreq.c +++ b/nx-X11/programs/Xserver/Xext/bigreq.c @@ -54,7 +54,7 @@ static void BigReqResetProc( static DISPATCH_PROC(ProcBigReqDispatch); void -BigReqExtensionInit(INITARGS) +BigReqExtensionInit(void) { #if 0 ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/dpms.c b/nx-X11/programs/Xserver/Xext/dpms.c index f88e1656e..eab73ebed 100644 --- a/nx-X11/programs/Xserver/Xext/dpms.c +++ b/nx-X11/programs/Xserver/Xext/dpms.c @@ -76,7 +76,7 @@ static DISPATCH_PROC(SProcDPMSCapable); static void DPMSResetProc(ExtensionEntry* extEntry); void -DPMSExtensionInit(INITARGS) +DPMSExtensionInit(void) { #if 0 ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.h b/nx-X11/programs/Xserver/Xext/extmod/modinit.h index 094837d34..5242a3f1b 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/modinit.h +++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.h @@ -5,68 +5,64 @@ #include #endif -#ifndef INITARGS -#define INITARGS void -#endif - #ifdef SHAPE -extern void ShapeExtensionInit(INITARGS); +extern void ShapeExtensionInit(void); #include #endif #ifdef XTEST -extern void XTestExtensionInit(INITARGS); +extern void XTestExtensionInit(void); #define _XTEST_SERVER_ #include #include #endif #if 1 -extern void XTestExtension1Init(INITARGS); +extern void XTestExtension1Init(void); #endif #ifdef BIGREQS -extern void BigReqExtensionInit(INITARGS); +extern void BigReqExtensionInit(void); #include #endif #ifdef XSYNC -extern void SyncExtensionInit(INITARGS); +extern void SyncExtensionInit(void); #define _SYNC_SERVER #include #include #endif #ifdef SCREENSAVER -extern void ScreenSaverExtensionInit (INITARGS); +extern void ScreenSaverExtensionInit (void); #include #endif #ifdef XCMISC -extern void XCMiscExtensionInit(INITARGS); +extern void XCMiscExtensionInit(void); #include #endif #ifdef DPMSExtension -extern void DPMSExtensionInit(INITARGS); +extern void DPMSExtensionInit(void); #include #endif #ifdef XV -extern void XvExtensionInit(INITARGS); -extern void XvMCExtensionInit(INITARGS); -extern void XvRegister(INITARGS); +extern void XvExtensionInit(void); +extern void XvMCExtensionInit(void); +extern void XvRegister(void); #include #include #endif #ifdef RES -extern void ResExtensionInit(INITARGS); +extern void ResExtensionInit(void); #include #endif #ifdef SHM -extern void ShmExtensionInit(INITARGS); +extern void ShmExtensionInit(void); #include extern void ShmSetPixmapFormat( ScreenPtr pScreen, @@ -77,15 +73,15 @@ extern void ShmRegisterFuncs( #endif #if 1 -extern void SecurityExtensionInit(INITARGS); +extern void SecurityExtensionInit(void); #endif #if 1 -extern void XagExtensionInit(INITARGS); +extern void XagExtensionInit(void); #endif #if 1 -extern void XpExtensionInit(INITARGS); +extern void XpExtensionInit(void); #endif #if 1 @@ -93,5 +89,5 @@ extern void PanoramiXExtensionInit(int argc, char *argv[]); #endif #if 1 -extern void XkbExtensionInit(INITARGS); +extern void XkbExtensionInit(void); #endif diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 1f78be9c8..10bb2dc2f 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -229,7 +229,7 @@ static int ScreenPrivateIndex; ****************/ void -ScreenSaverExtensionInit(INITARGS) +ScreenSaverExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 14fa1ce0e..fe741128e 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -2147,7 +2147,7 @@ XSecurityOptions(argc, argv, i) */ void -SecurityExtensionInit(INITARGS) +SecurityExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index e48fab0f2..76d1fdd77 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -147,7 +147,7 @@ typedef struct _ShapeEvent { ****************/ void -ShapeExtensionInit(INITARGS) +ShapeExtensionInit(void) { ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index 902bee7a1..b6e61de36 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -205,7 +205,7 @@ static Bool CheckForShmSyscall() #ifndef NXAGENT_SERVER void -ShmExtensionInit(INITARGS) +ShmExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 8899b7c17..222ef0353 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -2336,7 +2336,7 @@ SyncResetProc(extEntry) * ** Initialise the extension. */ void -SyncExtensionInit(INITARGS) +SyncExtensionInit(void) { ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c index bca5bca34..447f1699c 100644 --- a/nx-X11/programs/Xserver/Xext/xcmisc.c +++ b/nx-X11/programs/Xserver/Xext/xcmisc.c @@ -68,7 +68,7 @@ static DISPATCH_PROC(SProcXCMiscGetXIDList); static DISPATCH_PROC(SProcXCMiscGetXIDRange); void -XCMiscExtensionInit(INITARGS) +XCMiscExtensionInit(void) { #if 0 ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c index bca7b0a18..82632a031 100644 --- a/nx-X11/programs/Xserver/Xext/xres.c +++ b/nx-X11/programs/Xserver/Xext/xres.c @@ -300,7 +300,7 @@ SProcResDispatch (ClientPtr client) } void -ResExtensionInit(INITARGS) +ResExtensionInit(void) { (void) AddExtension(XRES_NAME, 0, 0, ProcResDispatch, SProcResDispatch, diff --git a/nx-X11/programs/Xserver/Xext/xtest.c b/nx-X11/programs/Xserver/Xext/xtest.c index 7dd668fdb..4d82f403d 100644 --- a/nx-X11/programs/Xserver/Xext/xtest.c +++ b/nx-X11/programs/Xserver/Xext/xtest.c @@ -93,7 +93,7 @@ static DISPATCH_PROC(SProcXTestGetVersion); static DISPATCH_PROC(SProcXTestGrabControl); void -XTestExtensionInit(INITARGS) +XTestExtensionInit(void) { #if 0 ExtensionEntry *extEntry; diff --git a/nx-X11/programs/Xserver/Xext/xtest1di.c b/nx-X11/programs/Xserver/Xext/xtest1di.c index 554f336b2..4aac1824b 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1di.c +++ b/nx-X11/programs/Xserver/Xext/xtest1di.c @@ -167,7 +167,7 @@ static int XTestCurrentClientGone( * (other than the core errors). */ void -XTestExtension1Init(INITARGS) +XTestExtension1Init(void) { /* * holds the pointer to the extension entry structure diff --git a/nx-X11/programs/Xserver/dbe/dbemodule.c b/nx-X11/programs/Xserver/dbe/dbemodule.c index 9a05f4071..bdb7f3345 100644 --- a/nx-X11/programs/Xserver/dbe/dbemodule.c +++ b/nx-X11/programs/Xserver/dbe/dbemodule.c @@ -9,7 +9,7 @@ static MODULESETUPPROTO(dbeSetup); -extern void DbeExtensionInit(INITARGS); +extern void DbeExtensionInit(void); ExtensionModule dbeExt = { DbeExtensionInit, diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index 86b9e0d24..28b42d676 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -76,7 +76,7 @@ extern void fbPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, char *pImage); void -ShmExtensionInit(INITARGS) +ShmExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/nx-X11/programs/Xserver/mi/miinitext.c b/nx-X11/programs/Xserver/mi/miinitext.c index dcd91c5e0..1b947a784 100644 --- a/nx-X11/programs/Xserver/mi/miinitext.c +++ b/nx-X11/programs/Xserver/mi/miinitext.c @@ -151,7 +151,7 @@ extern Bool noXvExtension; #ifndef XFree86LOADER #define INITARGS void -typedef void (*InitExtension)(INITARGS); +typedef void (*InitExtension)(void); #else /* XFree86Loader */ #include "loaderProcs.h" #endif @@ -183,95 +183,95 @@ typedef void (*InitExtension)(INITARGS); /* FIXME: this whole block of externs should be from the appropriate headers */ #ifdef XTESTEXT1 -extern void XTestExtension1Init(INITARGS); +extern void XTestExtension1Init(void); #endif #ifdef SHAPE -extern void ShapeExtensionInit(INITARGS); +extern void ShapeExtensionInit(void); #endif #ifdef MITSHM -extern void ShmExtensionInit(INITARGS); +extern void ShmExtensionInit(void); #endif #ifdef PANORAMIX -extern void PanoramiXExtensionInit(INITARGS); +extern void PanoramiXExtensionInit(void); #endif #ifdef XINPUT -extern void XInputExtensionInit(INITARGS); +extern void XInputExtensionInit(void); #endif #ifdef XTEST -extern void XTestExtensionInit(INITARGS); +extern void XTestExtensionInit(void); #endif #ifdef BIGREQS -extern void BigReqExtensionInit(INITARGS); +extern void BigReqExtensionInit(void); #endif #ifdef XIDLE -extern void XIdleExtensionInit(INITARGS); +extern void XIdleExtensionInit(void); #endif #ifdef SCREENSAVER -extern void ScreenSaverExtensionInit (INITARGS); +extern void ScreenSaverExtensionInit (void); #endif #ifdef XV -extern void XvExtensionInit(INITARGS); -extern void XvMCExtensionInit(INITARGS); +extern void XvExtensionInit(void); +extern void XvMCExtensionInit(void); #endif #ifdef XSYNC -extern void SyncExtensionInit(INITARGS); +extern void SyncExtensionInit(void); #endif #ifdef XKB -extern void XkbExtensionInit(INITARGS); +extern void XkbExtensionInit(void); #endif #ifdef XCMISC -extern void XCMiscExtensionInit(INITARGS); +extern void XCMiscExtensionInit(void); #endif #ifdef XRECORD -extern void RecordExtensionInit(INITARGS); +extern void RecordExtensionInit(void); #endif #ifdef DBE -extern void DbeExtensionInit(INITARGS); +extern void DbeExtensionInit(void); #endif #ifdef XCSECURITY -extern void SecurityExtensionInit(INITARGS); +extern void SecurityExtensionInit(void); #endif #ifdef XF86BIGFONT -extern void XFree86BigfontExtensionInit(INITARGS); +extern void XFree86BigfontExtensionInit(void); #endif #ifdef GLXEXT #ifndef __DARWIN__ -extern void GlxExtensionInit(INITARGS); +extern void GlxExtensionInit(void); extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); #else -extern void DarwinGlxExtensionInit(INITARGS); +extern void DarwinGlxExtensionInit(void); extern void DarwinGlxWrapInitVisuals(miInitVisualsProcPtr *); #endif #endif #ifdef XF86DRI -extern void XFree86DRIExtensionInit(INITARGS); +extern void XFree86DRIExtensionInit(void); #endif #ifdef DPMSExtension -extern void DPMSExtensionInit(INITARGS); +extern void DPMSExtensionInit(void); #endif #ifdef DPSEXT -extern void DPSExtensionInit(INITARGS); +extern void DPSExtensionInit(void); #endif #ifdef RENDER -extern void RenderExtensionInit(INITARGS); +extern void RenderExtensionInit(void); #endif #ifdef RANDR -extern void RRExtensionInit(INITARGS); +extern void RRExtensionInit(void); #endif #ifdef RES -extern void ResExtensionInit(INITARGS); +extern void ResExtensionInit(void); #endif #ifdef DMXEXT -extern void DMXExtensionInit(INITARGS); +extern void DMXExtensionInit(void); #endif #ifdef XFIXES -extern void XFixesExtensionInit(INITARGS); +extern void XFixesExtensionInit(void); #endif #ifdef DAMAGE -extern void DamageExtensionInit(INITARGS); +extern void DamageExtensionInit(void); #endif #ifdef COMPOSITE -extern void CompositeExtensionInit(INITARGS); +extern void CompositeExtensionInit(void); #endif /* The following is only a small first step towards run-time diff --git a/nx-X11/programs/Xserver/record/recordmod.c b/nx-X11/programs/Xserver/record/recordmod.c index 5a74f0f1a..b216d7f52 100644 --- a/nx-X11/programs/Xserver/record/recordmod.c +++ b/nx-X11/programs/Xserver/record/recordmod.c @@ -10,7 +10,7 @@ extern Bool noTestExtensions; static MODULESETUPPROTO(recordSetup); -extern void RecordExtensionInit(INITARGS); +extern void RecordExtensionInit(void); ExtensionModule recordExt = { RecordExtensionInit, -- cgit v1.2.3 From f6a1bda2dff0c70aa13f3cb763a9b08c4c037c53 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 4 Jul 2016 00:28:47 +0200 Subject: Remove unneccesary casts from WriteToClient calls Casting return to (void) was used to tell lint that you intended to ignore the return value, so it didn't warn you about it. Casting the third argument to (char *) was used as the most generic pointer type in the days before compilers supported C89 (void *) (except for a couple places it's used for byte-sized pointer math). Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 38 +++++----- nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c | 14 ++-- nx-X11/programs/Xserver/GL/glx/glxfb.c | 2 +- nx-X11/programs/Xserver/GL/glx/single2.c | 6 +- nx-X11/programs/Xserver/GL/glx/single2swap.c | 4 +- nx-X11/programs/Xserver/GL/glx/unpack.h | 12 +-- nx-X11/programs/Xserver/Xext/bigreq.c | 2 +- nx-X11/programs/Xserver/Xext/dpms.c | 8 +- nx-X11/programs/Xserver/Xext/panoramiX.c | 14 ++-- nx-X11/programs/Xserver/Xext/panoramiXprocs.c | 4 +- nx-X11/programs/Xserver/Xext/saver.c | 4 +- nx-X11/programs/Xserver/Xext/security.c | 6 +- nx-X11/programs/Xserver/Xext/shape.c | 10 +-- nx-X11/programs/Xserver/Xext/shm.c | 6 +- nx-X11/programs/Xserver/Xext/sync.c | 12 +-- nx-X11/programs/Xserver/Xext/xcmisc.c | 6 +- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 4 +- nx-X11/programs/Xserver/Xext/xres.c | 12 +-- nx-X11/programs/Xserver/Xext/xtest.c | 4 +- nx-X11/programs/Xserver/Xext/xvdisp.c | 58 +++++++------- nx-X11/programs/Xserver/Xext/xvmc.c | 24 +++--- nx-X11/programs/Xserver/Xi/chgdctl.c | 2 +- nx-X11/programs/Xserver/Xi/chgkbd.c | 2 +- nx-X11/programs/Xserver/Xi/chgptr.c | 2 +- nx-X11/programs/Xserver/Xi/getbmap.c | 4 +- nx-X11/programs/Xserver/Xi/getdctl.c | 2 +- nx-X11/programs/Xserver/Xi/getfctl.c | 2 +- nx-X11/programs/Xserver/Xi/getfocus.c | 2 +- nx-X11/programs/Xserver/Xi/getkmap.c | 2 +- nx-X11/programs/Xserver/Xi/getmmap.c | 4 +- nx-X11/programs/Xserver/Xi/getprop.c | 2 +- nx-X11/programs/Xserver/Xi/getselev.c | 2 +- nx-X11/programs/Xserver/Xi/getvers.c | 2 +- nx-X11/programs/Xserver/Xi/grabdev.c | 2 +- nx-X11/programs/Xserver/Xi/gtmotion.c | 4 +- nx-X11/programs/Xserver/Xi/listdev.c | 2 +- nx-X11/programs/Xserver/Xi/opendev.c | 4 +- nx-X11/programs/Xserver/Xi/queryst.c | 2 +- nx-X11/programs/Xserver/Xi/setbmap.c | 2 +- nx-X11/programs/Xserver/Xi/setdval.c | 2 +- nx-X11/programs/Xserver/Xi/setmmap.c | 2 +- nx-X11/programs/Xserver/Xi/setmode.c | 2 +- nx-X11/programs/Xserver/composite/compext.c | 4 +- nx-X11/programs/Xserver/damageext/damageext.c | 2 +- nx-X11/programs/Xserver/dbe/dbe.c | 10 +-- nx-X11/programs/Xserver/dix/devices.c | 4 +- nx-X11/programs/Xserver/dix/dispatch.c | 16 ++-- nx-X11/programs/Xserver/dix/dixfonts.c | 4 +- nx-X11/programs/Xserver/dix/events.c | 4 +- nx-X11/programs/Xserver/dix/swaprep.c | 88 +++++++++++----------- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 4 +- nx-X11/programs/Xserver/include/dix.h | 4 +- nx-X11/programs/Xserver/os/secauth.c | 2 +- nx-X11/programs/Xserver/randr/rrcrtc.c | 16 ++-- nx-X11/programs/Xserver/randr/rrdispatch.c | 2 +- nx-X11/programs/Xserver/randr/rrmode.c | 2 +- nx-X11/programs/Xserver/randr/rrmonitor.c | 4 +- nx-X11/programs/Xserver/randr/rroutput.c | 6 +- nx-X11/programs/Xserver/randr/rrproperty.c | 10 +-- nx-X11/programs/Xserver/randr/rrprovider.c | 8 +- nx-X11/programs/Xserver/randr/rrproviderproperty.c | 10 +-- nx-X11/programs/Xserver/randr/rrscreen.c | 16 ++-- nx-X11/programs/Xserver/randr/rrxinerama.c | 14 ++-- nx-X11/programs/Xserver/record/record.c | 14 ++-- nx-X11/programs/Xserver/render/render.c | 8 +- nx-X11/programs/Xserver/xfixes/cursor.c | 6 +- nx-X11/programs/Xserver/xfixes/region.c | 4 +- nx-X11/programs/Xserver/xfixes/xfixes.c | 2 +- nx-X11/programs/Xserver/xkb/xkb.c | 40 +++++----- nx-X11/programs/Xserver/xkb/xkbEvents.c | 26 +++---- 71 files changed, 317 insertions(+), 317 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index 7d8fbe81f..a92d83062 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -736,7 +736,7 @@ int DoMakeCurrent( __GLXclientState *cl, if (client->swapped) { __glXSwapMakeCurrentReply(client, &reply); } else { - WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)&reply); + WriteToClient(client, sz_xGLXMakeCurrentReply, &reply); } return Success; } @@ -765,7 +765,7 @@ int __glXIsDirect(__GLXclientState *cl, GLbyte *pc) if (client->swapped) { __glXSwapIsDirectReply(client, &reply); } else { - WriteToClient(client, sz_xGLXIsDirectReply, (char *)&reply); + WriteToClient(client, sz_xGLXIsDirectReply, &reply); } return Success; @@ -797,7 +797,7 @@ int __glXQueryVersion(__GLXclientState *cl, GLbyte *pc) if (client->swapped) { __glXSwapQueryVersionReply(client, &reply); } else { - WriteToClient(client, sz_xGLXQueryVersionReply, (char *)&reply); + WriteToClient(client, sz_xGLXQueryVersionReply, &reply); } return Success; } @@ -948,7 +948,7 @@ int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen, __GLX_SWAP_INT(&reply.numProps); } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply); + WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); for ( modes = pGlxScreen->modes ; modes != NULL ; modes = modes->next ) { if (modes->visualID == 0) { @@ -999,7 +999,7 @@ int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen, __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG); } WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, - (char *)buf); + buf); } return Success; } @@ -1056,7 +1056,7 @@ int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap) __GLX_SWAP_INT(&reply.numAttribs); } - WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *)&reply); + WriteToClient(client, sz_xGLXGetFBConfigsReply, &reply); for ( modes = pGlxScreen->modes ; modes != NULL ; modes = modes->next ) { if (modes->visualID == 0) { @@ -1108,7 +1108,7 @@ int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap) __GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH); } WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_FBCONFIG_ATTRIBS_LENGTH, - (char *)buf); + buf); } return Success; } @@ -1397,8 +1397,8 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) if (client->swapped) { __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); } else { - WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply); - WriteToClient(client, nReplyBytes, (char *)sendBuf); + WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply); + WriteToClient(client, nReplyBytes, sendBuf); } __glXFree((char *)sendBuf); @@ -1798,7 +1798,7 @@ static int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc) } WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, - (char *) &reply); + &reply); return Success; } @@ -1837,9 +1837,9 @@ static int __glxQueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc) __GLX_SWAP_INT(&reply.npipes); } WriteToClient(client, sz_xGLXQueryHyperpipeNetworkSGIXReply, - (char *) &reply); + &reply); - WriteToClient(client, length << 2, (char *)rdata); + WriteToClient(client, length << 2, rdata); return Success; } @@ -1875,7 +1875,7 @@ static int __glxDestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc) } WriteToClient(client, sz_xGLXDestroyHyperpipeConfigSGIXReply, - (char *) &reply); + &reply); return Success; } @@ -1916,9 +1916,9 @@ static int __glxQueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc) } WriteToClient(client, sz_xGLXQueryHyperpipeConfigSGIXReply, - (char *) &reply); + &reply); - WriteToClient(client, length << 2, (char *)rdata); + WriteToClient(client, length << 2, rdata); return Success; } @@ -1961,7 +1961,7 @@ static int __glxHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc) } WriteToClient(client, sz_xGLXHyperpipeConfigSGIXReply, - (char *) &reply); + &reply); return Success; } @@ -2089,8 +2089,8 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc) if (client->swapped) { glxSwapQueryExtensionsStringReply(client, &reply, buf); } else { - WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply); - WriteToClient(client, (int)(length << 2), (char *)buf); + WriteToClient(client, sz_xGLXQueryExtensionsStringReply,&reply); + WriteToClient(client, (int)(length << 2), buf); } __glXFree(buf); @@ -2146,7 +2146,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc) if (client->swapped) { glxSwapQueryServerStringReply(client, &reply, buf); } else { - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)&reply); + WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); WriteToClient(client, (int)(length << 2), buf); } diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c index 33a748a24..afe681167 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c @@ -397,7 +397,7 @@ void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply) __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->contextTag); - WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)reply); + WriteToClient(client, sz_xGLXMakeCurrentReply, reply); } void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply) @@ -405,7 +405,7 @@ void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply) __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); - WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply); + WriteToClient(client, sz_xGLXIsDirectReply, reply); } void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply) @@ -415,7 +415,7 @@ void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply) __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->majorVersion); __GLX_SWAP_INT(&reply->minorVersion); - WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply); + WriteToClient(client, sz_xGLXQueryVersionReply, reply); } void glxSwapQueryExtensionsStringReply(ClientPtr client, @@ -427,7 +427,7 @@ void glxSwapQueryExtensionsStringReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply); + WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply); __GLX_SWAP_INT_ARRAY((int *)buf, length); WriteToClient(client, length << 2, buf); } @@ -440,7 +440,7 @@ void glxSwapQueryServerStringReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply); + WriteToClient(client, sz_xGLXQueryServerStringReply, reply); /** no swap is needed for an array of chars **/ /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */ WriteToClient(client, length << 2, buf); @@ -454,9 +454,9 @@ void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXT __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply); + WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply); __GLX_SWAP_INT_ARRAY((int *)buf, length); - WriteToClient(client, length << 2, (char *)buf); + WriteToClient(client, length << 2, buf); } diff --git a/nx-X11/programs/Xserver/GL/glx/glxfb.c b/nx-X11/programs/Xserver/GL/glx/glxfb.c index 0d433d25d..9573d97b9 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxfb.c +++ b/nx-X11/programs/Xserver/GL/glx/glxfb.c @@ -114,7 +114,7 @@ __glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv) depth, 0, 0, width, height, pad, ZPixmap, - (char *)buf); + buf); return GL_TRUE; } diff --git a/nx-X11/programs/Xserver/GL/glx/single2.c b/nx-X11/programs/Xserver/GL/glx/single2.c index 10152c37c..cd9c0eeb3 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2.c +++ b/nx-X11/programs/Xserver/GL/glx/single2.c @@ -201,9 +201,9 @@ int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc) reply.retval = retval; reply.size = nitems; reply.newMode = newMode; - WriteToClient(client, sz_xGLXRenderModeReply, (char *)&reply); + WriteToClient(client, sz_xGLXRenderModeReply, &reply); if (retBytes) { - WriteToClient(client, retBytes, (char *)retBuffer); + WriteToClient(client, retBytes, retBuffer); } return Success; } @@ -380,7 +380,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) } __GLX_SEND_HEADER(); - WriteToClient(client, length, (char *) string); + WriteToClient(client, length, string); if (buf != NULL) { __glXFree(buf); } diff --git a/nx-X11/programs/Xserver/GL/glx/single2swap.c b/nx-X11/programs/Xserver/GL/glx/single2swap.c index 4b8541bf2..7e6c30fea 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2swap.c +++ b/nx-X11/programs/Xserver/GL/glx/single2swap.c @@ -218,9 +218,9 @@ int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc) __GLX_SWAP_INT(&reply.retval); __GLX_SWAP_INT(&reply.size); __GLX_SWAP_INT(&reply.newMode); - WriteToClient(client, sz_xGLXRenderModeReply, (char *)&reply); + WriteToClient(client, sz_xGLXRenderModeReply, &reply); if (retBytes) { - WriteToClient(client, retBytes, (char *)retBuffer); + WriteToClient(client, retBytes, retBuffer); } return Success; } diff --git a/nx-X11/programs/Xserver/GL/glx/unpack.h b/nx-X11/programs/Xserver/GL/glx/unpack.h index d1150c32b..154b4d286 100644 --- a/nx-X11/programs/Xserver/GL/glx/unpack.h +++ b/nx-X11/programs/Xserver/GL/glx/unpack.h @@ -69,7 +69,7 @@ extern xGLXSingleReply __glXReply; __glXReply.sequenceNumber = client->sequence; #define __GLX_SEND_HEADER() \ - WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply); + WriteToClient( client, sz_xGLXSingleReply, &__glXReply); #define __GLX_PUT_RETVAL(a) \ __glXReply.retval = (a); @@ -123,19 +123,19 @@ extern xGLXSingleReply __glXReply; *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer #define __GLX_SEND_BYTE_ARRAY(len) \ - WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer) + WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer) #define __GLX_SEND_SHORT_ARRAY(len) \ - WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer) + WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer) #define __GLX_SEND_INT_ARRAY(len) \ - WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer) + WriteToClient(client, (len)*__GLX_SIZE_INT32, answer) #define __GLX_SEND_FLOAT_ARRAY(len) \ - WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer) + WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer) #define __GLX_SEND_DOUBLE_ARRAY(len) \ - WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer) + WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, answer) #define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len) diff --git a/nx-X11/programs/Xserver/Xext/bigreq.c b/nx-X11/programs/Xserver/Xext/bigreq.c index ec1ece91a..29f638fe1 100644 --- a/nx-X11/programs/Xserver/Xext/bigreq.c +++ b/nx-X11/programs/Xserver/Xext/bigreq.c @@ -102,6 +102,6 @@ ProcBigReqDispatch (client) swaps(&rep.sequenceNumber); swapl(&rep.max_request_size); } - WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep); + WriteToClient(client, sizeof(xBigReqEnableReply), &rep); return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/Xext/dpms.c b/nx-X11/programs/Xserver/Xext/dpms.c index eab73ebed..4d3acf03a 100644 --- a/nx-X11/programs/Xserver/Xext/dpms.c +++ b/nx-X11/programs/Xserver/Xext/dpms.c @@ -118,7 +118,7 @@ ProcDPMSGetVersion(client) swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xDPMSGetVersionReply), &rep); return(client->noClientException); } @@ -138,7 +138,7 @@ ProcDPMSCapable(register ClientPtr client) if (client->swapped) { swaps(&rep.sequenceNumber); } - WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep); + WriteToClient(client, sizeof(xDPMSCapableReply), &rep); return(client->noClientException); } @@ -164,7 +164,7 @@ ProcDPMSGetTimeouts(client) swaps(&rep.suspend); swaps(&rep.off); } - WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep); + WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), &rep); return(client->noClientException); } @@ -275,7 +275,7 @@ ProcDPMSInfo(register ClientPtr client) swaps(&rep.sequenceNumber); swaps(&rep.power_level); } - WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep); + WriteToClient(client, sizeof(xDPMSInfoReply), &rep); return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index 34d56c3bf..d83f34c2e 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -949,7 +949,7 @@ ProcPanoramiXQueryVersion (ClientPtr client) swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), &rep); return (client->noClientException); } @@ -973,7 +973,7 @@ ProcPanoramiXGetState(ClientPtr client) swapl (&rep.length); swapl ((int* )&rep.state); } - WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); + WriteToClient (client, sizeof (xPanoramiXGetStateReply), &rep); return client->noClientException; } @@ -998,7 +998,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client) swapl (&rep.length); swapl ((int* )&rep.ScreenCount); } - WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep); + WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), &rep); return client->noClientException; } @@ -1025,7 +1025,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client) swapl (&rep.width); swapl (&rep.height); } - WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep); + WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), &rep); return client->noClientException; } @@ -1047,7 +1047,7 @@ ProcXineramaIsActive(ClientPtr client) swapl (&rep.length); swapl (&rep.state); } - WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep); + WriteToClient (client, sizeof (xXineramaIsActiveReply), &rep); return client->noClientException; } @@ -1069,7 +1069,7 @@ ProcXineramaQueryScreens(ClientPtr client) swapl (&rep.length); swapl (&rep.number); } - WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep); + WriteToClient (client, sizeof (xXineramaQueryScreensReply), &rep); if(!noPanoramiXExtension) { xXineramaScreenInfo scratch; @@ -1087,7 +1087,7 @@ ProcXineramaQueryScreens(ClientPtr client) swaps (&scratch.width); swaps (&scratch.height); } - WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch); + WriteToClient (client, sz_XineramaScreenInfo, &scratch); } } diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c index 36ebfac21..5cc088c98 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c @@ -1863,7 +1863,7 @@ int PanoramiXGetImage(ClientPtr client) XineramaGetImageData(drawables, x, y + linesDone, w, nlines, format, planemask, pBuf, widthBytesLine, isRoot); - (void)WriteToClient(client, + WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); linesDone += nlines; @@ -1881,7 +1881,7 @@ int PanoramiXGetImage(ClientPtr client) nlines, format, plane, pBuf, widthBytesLine, isRoot); - (void)WriteToClient(client, + WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index ab1096351..7cc186591 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -702,7 +702,7 @@ ProcScreenSaverQueryVersion (client) swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), &rep); return (client->noClientException); } @@ -774,7 +774,7 @@ ProcScreenSaverQueryInfo (client) swapl (&rep.idle); swapl (&rep.eventMask); } - WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep); + WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), &rep); return (client->noClientException); } diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index c7cd3f1fd..c346f8deb 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -489,8 +489,8 @@ ProcSecurityQueryVersion( swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), - (char *)&rep); + WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), + &rep); return (client->noClientException); } /* ProcSecurityQueryVersion */ @@ -709,7 +709,7 @@ ProcSecurityGenerateAuthorization( } WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), - (char *)&rep); + &rep); WriteToClient(client, authdata_len, pAuthdata); SecurityAudit("client %d generated authorization %d trust %d timeout %d group %d events %d\n", diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index a4aa5bece..c90fd8ecd 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -303,7 +303,7 @@ ProcShapeQueryVersion (client) swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof (xShapeQueryVersionReply), &rep); return (client->noClientException); } @@ -763,7 +763,7 @@ ProcShapeQueryExtents (client) swaps(&rep.widthClipShape); swaps(&rep.heightClipShape); } - WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep); + WriteToClient(client, sizeof (xShapeQueryExtentsReply), &rep); return (client->noClientException); } @@ -1016,7 +1016,7 @@ ProcShapeInputSelected (client) swaps (&rep.sequenceNumber); swapl (&rep.length); } - WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep); + WriteToClient (client, sizeof (xShapeInputSelectedReply), &rep); return (client->noClientException); } @@ -1099,8 +1099,8 @@ ProcShapeGetRectangles (client) swapl (&rep.nrects); SwapShorts ((short *)rects, (unsigned long)nrects * 4); } - WriteToClient (client, sizeof (rep), (char *) &rep); - WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects); + WriteToClient (client, sizeof (rep), &rep); + WriteToClient (client, nrects * sizeof (xRectangle), rects); DEALLOCATE_LOCAL (rects); return client->noClientException; } diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index 2f82ebcf6..a39aef630 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -366,7 +366,7 @@ ProcShmQueryVersion(client) swaps(&rep.uid); swaps(&rep.gid); } - WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xShmQueryVersionReply), &rep); return (client->noClientException); } @@ -716,7 +716,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) swapl(&xgi.visual); swapl(&xgi.size); } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); + WriteToClient(client, sizeof(xShmGetImageReply), &xgi); return(client->noClientException); } @@ -1044,7 +1044,7 @@ ProcShmGetImage(client) swapl(&xgi.visual); swapl(&xgi.size); } - WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); + WriteToClient(client, sizeof(xShmGetImageReply), &xgi); return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index a137afedd..3dff56d93 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -1349,7 +1349,7 @@ ProcSyncInitialize(client) { swaps(&rep.sequenceNumber); } - WriteToClient(client, sizeof(rep), (char *) &rep); + WriteToClient(client, sizeof(rep), &rep); return (client->noClientException); } @@ -1419,10 +1419,10 @@ ProcSyncListSystemCounters(client) ((sz_xSyncSystemCounter + namelen + 3) & ~3)); } - WriteToClient(client, sizeof(rep), (char *) &rep); + WriteToClient(client, sizeof(rep), &rep); if (len) { - WriteToClient(client, len, (char *) list); + WriteToClient(client, len, list); DEALLOCATE_LOCAL(list); } @@ -1495,7 +1495,7 @@ ProcSyncGetPriority(client) swapl(&rep.priority); } - WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncGetPriorityReply), &rep); return (client->noClientException); } @@ -1780,7 +1780,7 @@ ProcSyncQueryCounter(client) swapl(&rep.value_hi); swapl(&rep.value_lo); } - WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncQueryCounterReply), &rep); return (client->noClientException); } @@ -1966,7 +1966,7 @@ ProcSyncQueryAlarm(client) swapl(&rep.delta_lo); } - WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncQueryAlarmReply), &rep); return (client->noClientException); } diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c index 447f1699c..534c9ad2f 100644 --- a/nx-X11/programs/Xserver/Xext/xcmisc.c +++ b/nx-X11/programs/Xserver/Xext/xcmisc.c @@ -110,7 +110,7 @@ ProcXCMiscGetVersion(client) swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xXCMiscGetVersionReply), &rep); return(client->noClientException); } @@ -133,7 +133,7 @@ ProcXCMiscGetXIDRange(client) swapl(&rep.start_id); swapl(&rep.count); } - WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep); + WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), &rep); return(client->noClientException); } @@ -166,7 +166,7 @@ ProcXCMiscGetXIDList(client) swapl(&rep.length); swapl(&rep.count); } - WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep); + WriteToClient(client, sizeof(xXCMiscGetXIDListReply), &rep); if (count) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index 18c96db13..023b3e6a5 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -384,7 +384,7 @@ ProcXF86BigfontQueryVersion( swapl(&reply.signature); } WriteToClient(client, - sizeof(xXF86BigfontQueryVersionReply), (char *)&reply); + sizeof(xXF86BigfontQueryVersionReply), &reply); return client->noClientException; } @@ -718,7 +718,7 @@ ProcXF86BigfontQueryFont( } } } - WriteToClient(client, rlength, (char *)reply); + WriteToClient(client, rlength, reply); DEALLOCATE_LOCAL(reply); if (nCharInfos > 0) { if (shmid == -1) DEALLOCATE_LOCAL(pIndex2UniqIndex); diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c index 82632a031..8605e4c7e 100644 --- a/nx-X11/programs/Xserver/Xext/xres.c +++ b/nx-X11/programs/Xserver/Xext/xres.c @@ -40,7 +40,7 @@ ProcXResQueryVersion (ClientPtr client) swaps(&rep.server_major); swaps(&rep.server_minor); } - WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof (xXResQueryVersionReply), &rep); return (client->noClientException); } @@ -73,7 +73,7 @@ ProcXResQueryClients (ClientPtr client) swapl (&rep.length); swapl (&rep.num_clients); } - WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep); + WriteToClient (client, sizeof (xXResQueryClientsReply), &rep); if(num_clients) { xXResClient scratch; @@ -86,7 +86,7 @@ ProcXResQueryClients (ClientPtr client) swapl (&scratch.resource_base); swapl (&scratch.resource_mask); } - WriteToClient (client, sz_xXResClient, (char *) &scratch); + WriteToClient (client, sz_xXResClient, &scratch); } } @@ -144,7 +144,7 @@ ProcXResQueryClientResources (ClientPtr client) swapl (&rep.length); swapl (&rep.num_types); } - WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep); + WriteToClient (client,sizeof(xXResQueryClientResourcesReply),&rep); if(num_types) { xXResType scratch; @@ -165,7 +165,7 @@ ProcXResQueryClientResources (ClientPtr client) swapl (&scratch.resource_type); swapl (&scratch.count); } - WriteToClient (client, sz_xXResType, (char *) &scratch); + WriteToClient (client, sz_xXResType, &scratch); } } @@ -222,7 +222,7 @@ ProcXResQueryClientPixmapBytes (ClientPtr client) swapl (&rep.bytes); swapl (&rep.bytes_overflow); } - WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep); + WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),&rep); return (client->noClientException); } diff --git a/nx-X11/programs/Xserver/Xext/xtest.c b/nx-X11/programs/Xserver/Xext/xtest.c index 4d82f403d..c5aef9220 100644 --- a/nx-X11/programs/Xserver/Xext/xtest.c +++ b/nx-X11/programs/Xserver/Xext/xtest.c @@ -132,7 +132,7 @@ ProcXTestGetVersion(client) swaps(&rep.sequenceNumber); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xXTestGetVersionReply), &rep); return(client->noClientException); } @@ -168,7 +168,7 @@ ProcXTestCompareCursor(client) if (client->swapped) { swaps(&rep.sequenceNumber); } - WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep); + WriteToClient(client, sizeof(xXTestCompareCursorReply), &rep); return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c index 923202701..66dcc791a 100644 --- a/nx-X11/programs/Xserver/Xext/xvdisp.c +++ b/nx-X11/programs/Xserver/Xext/xvdisp.c @@ -160,59 +160,59 @@ static int SWriteImageFormatInfo(ClientPtr, xvImageFormatInfo*); #define _WriteQueryAdaptorsReply(_c,_d) \ if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryAdaptorsReply, (char*)_d) + else WriteToClient(_c, sz_xvQueryAdaptorsReply, _d) #define _WriteQueryExtensionReply(_c,_d) \ if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryExtensionReply, (char*)_d) + else WriteToClient(_c, sz_xvQueryExtensionReply, _d) #define _WriteQueryEncodingsReply(_c,_d) \ if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryEncodingsReply, (char*)_d) + else WriteToClient(_c, sz_xvQueryEncodingsReply, _d) #define _WriteAdaptorInfo(_c,_d) \ if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAdaptorInfo, (char*)_d) + else WriteToClient(_c, sz_xvAdaptorInfo, _d) #define _WriteAttributeInfo(_c,_d) \ if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAttributeInfo, (char*)_d) + else WriteToClient(_c, sz_xvAttributeInfo, _d) #define _WriteEncodingInfo(_c,_d) \ if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \ - else WriteToClient(_c, sz_xvEncodingInfo, (char*)_d) + else WriteToClient(_c, sz_xvEncodingInfo, _d) #define _WriteFormat(_c,_d) \ if ((_c)->swapped) SWriteFormat(_c, _d); \ - else WriteToClient(_c, sz_xvFormat, (char*)_d) + else WriteToClient(_c, sz_xvFormat, _d) #define _WriteGrabPortReply(_c,_d) \ if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \ - else WriteToClient(_c, sz_xvGrabPortReply, (char*)_d) + else WriteToClient(_c, sz_xvGrabPortReply, _d) #define _WriteGetPortAttributeReply(_c,_d) \ if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \ - else WriteToClient(_c, sz_xvGetPortAttributeReply, (char*)_d) + else WriteToClient(_c, sz_xvGetPortAttributeReply, _d) #define _WriteQueryBestSizeReply(_c,_d) \ if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryBestSizeReply,(char*) _d) + else WriteToClient(_c, sz_xvQueryBestSizeReply, _d) #define _WriteQueryPortAttributesReply(_c,_d) \ if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryPortAttributesReply,(char*) _d) + else WriteToClient(_c, sz_xvQueryPortAttributesReply, _d) #define _WriteQueryImageAttributesReply(_c,_d) \ if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryImageAttributesReply,(char*) _d) + else WriteToClient(_c, sz_xvQueryImageAttributesReply, _d) #define _WriteListImageFormatsReply(_c,_d) \ if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \ - else WriteToClient(_c, sz_xvListImageFormatsReply,(char*) _d) + else WriteToClient(_c, sz_xvListImageFormatsReply, _d) #define _WriteImageFormatInfo(_c,_d) \ if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \ - else WriteToClient(_c, sz_xvImageFormatInfo, (char*)_d) + else WriteToClient(_c, sz_xvImageFormatInfo, _d) #define _AllocatePort(_i,_p) \ ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success @@ -1278,7 +1278,7 @@ ProcXvQueryImageAttributes(ClientPtr client) _WriteQueryImageAttributesReply(client, &rep); if(client->swapped) SwapLongs((CARD32*)offsets, rep.length); - WriteToClient(client, rep.length << 2, (char*)offsets); + WriteToClient(client, rep.length << 2, offsets); free(offsets); @@ -1639,7 +1639,7 @@ SWriteQueryExtensionReply( swaps(&rep->version); swaps(&rep->revision); - (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep); + WriteToClient(client, sz_xvQueryExtensionReply, &rep); return Success; } @@ -1653,7 +1653,7 @@ SWriteQueryAdaptorsReply( swapl(&rep->length); swaps(&rep->num_adaptors); - (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep); + WriteToClient(client, sz_xvQueryAdaptorsReply, &rep); return Success; } @@ -1667,7 +1667,7 @@ SWriteQueryEncodingsReply( swapl(&rep->length); swaps(&rep->num_encodings); - (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep); + WriteToClient(client, sz_xvQueryEncodingsReply, &rep); return Success; } @@ -1682,7 +1682,7 @@ SWriteAdaptorInfo( swaps(&pAdaptor->num_ports); swaps(&pAdaptor->num_formats); - (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor); + WriteToClient(client, sz_xvAdaptorInfo, pAdaptor); return Success; } @@ -1698,7 +1698,7 @@ SWriteEncodingInfo( swaps(&pEncoding->height); swapl(&pEncoding->rate.numerator); swapl(&pEncoding->rate.denominator); - (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding); + WriteToClient(client, sz_xvEncodingInfo, pEncoding); return Success; } @@ -1709,7 +1709,7 @@ SWriteFormat( xvFormat *pFormat ){ swapl(&pFormat->visual); - (void)WriteToClient(client, sz_xvFormat, (char *)pFormat); + WriteToClient(client, sz_xvFormat, pFormat); return Success; } @@ -1723,7 +1723,7 @@ SWriteAttributeInfo( swapl(&pAtt->size); swapl(&pAtt->min); swapl(&pAtt->max); - (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt); + WriteToClient(client, sz_xvAttributeInfo, pAtt); return Success; } @@ -1747,7 +1747,7 @@ SWriteImageFormatInfo( swapl(&pImage->vert_u_period); swapl(&pImage->vert_v_period); - (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage); + WriteToClient(client, sz_xvImageFormatInfo, pImage); return Success; } @@ -1762,7 +1762,7 @@ SWriteGrabPortReply( swaps(&rep->sequenceNumber); swapl(&rep->length); - (void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep); + WriteToClient(client, sz_xvGrabPortReply, &rep); return Success; } @@ -1776,7 +1776,7 @@ SWriteGetPortAttributeReply( swapl(&rep->length); swapl(&rep->value); - (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep); + WriteToClient(client, sz_xvGetPortAttributeReply, &rep); return Success; } @@ -1791,7 +1791,7 @@ SWriteQueryBestSizeReply( swaps(&rep->actual_width); swaps(&rep->actual_height); - (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep); + WriteToClient(client, sz_xvQueryBestSizeReply, &rep); return Success; } @@ -1806,7 +1806,7 @@ SWriteQueryPortAttributesReply( swapl(&rep->num_attributes); swapl(&rep->text_size); - (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep); + WriteToClient(client, sz_xvQueryPortAttributesReply, &rep); return Success; } @@ -1823,7 +1823,7 @@ SWriteQueryImageAttributesReply( swaps(&rep->width); swaps(&rep->height); - (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep); + WriteToClient(client, sz_xvQueryImageAttributesReply, &rep); return Success; } @@ -1838,7 +1838,7 @@ SWriteListImageFormatsReply( swapl(&rep->length); swapl(&rep->num_formats); - (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep); + WriteToClient(client, sz_xvListImageFormatsReply, &rep); return Success; } diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c index bce7fbf7a..fa3d1540a 100644 --- a/nx-X11/programs/Xserver/Xext/xvmc.c +++ b/nx-X11/programs/Xserver/Xext/xvmc.c @@ -129,7 +129,7 @@ ProcXvMCQueryVersion(ClientPtr client) rep.length = 0; rep.major = XvMCVersion; rep.minor = XvMCRevision; - WriteToClient(client, sizeof(xvmcQueryVersionReply), (char*)&rep); + WriteToClient(client, sizeof(xvmcQueryVersionReply), &rep); return Success; } @@ -169,7 +169,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client) rep.num = (adaptor) ? adaptor->num_surfaces : 0; rep.length = rep.num * sizeof(xvmcSurfaceInfo) >> 2; - WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), (char*)&rep); + WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep); for(i = 0; i < rep.num; i++) { surface = adaptor->surfaces[i]; @@ -181,7 +181,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client) info.subpicture_max_height = surface->subpicture_max_height; info.mc_type = surface->mc_type; info.flags = surface->flags; - WriteToClient(client, sizeof(xvmcSurfaceInfo), (char*)&info); + WriteToClient(client, sizeof(xvmcSurfaceInfo), &info); } return Success; @@ -270,9 +270,9 @@ ProcXvMCCreateContext(ClientPtr client) rep.flags_return = pContext->flags; rep.length = dwords; - WriteToClient(client, sizeof(xvmcCreateContextReply), (char*)&rep); + WriteToClient(client, sizeof(xvmcCreateContextReply), &rep); if(dwords) - WriteToClient(client, dwords << 2, (char*)data); + WriteToClient(client, dwords << 2, data); AddResource(pContext->context_id, XvMCRTContext, pContext); if(data) @@ -332,9 +332,9 @@ ProcXvMCCreateSurface(ClientPtr client) rep.sequenceNumber = client->sequence; rep.length = dwords; - WriteToClient(client, sizeof(xvmcCreateSurfaceReply), (char*)&rep); + WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep); if(dwords) - WriteToClient(client, dwords << 2, (char*)data); + WriteToClient(client, dwords << 2, data); AddResource(pSurface->surface_id, XvMCRTSurface, pSurface); if(data) @@ -443,9 +443,9 @@ ProcXvMCCreateSubpicture(ClientPtr client) rep.component_order[3] = pSubpicture->component_order[3]; rep.length = dwords; - WriteToClient(client, sizeof(xvmcCreateSubpictureReply), (char*)&rep); + WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep); if(dwords) - WriteToClient(client, dwords << 2, (char*)data); + WriteToClient(client, dwords << 2, data); AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture); if(data) @@ -525,7 +525,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client) rep.length = rep.num * sizeof(xvImageFormatInfo) >> 2; - WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), (char*)&rep); + WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), &rep); for(i = 0; i < rep.num; i++) { pImage = NULL; @@ -561,7 +561,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client) info.vert_v_period = pImage->vert_v_period; memcpy(&info.comp_order, pImage->component_order, 32); info.scanline_order = pImage->scanline_order; - WriteToClient(client, sizeof(xvImageFormatInfo), (char*)&info); + WriteToClient(client, sizeof(xvImageFormatInfo), &info); } return Success; @@ -631,7 +631,7 @@ ProcXvMCGetDRInfo(ClientPtr client) #endif /* HAS_XVMCSHM */ WriteToClient(client, sizeof(xvmcGetDRInfoReply), - (char*)&rep); + &rep); if (rep.length) { WriteToClient(client, rep.nameLen, pScreenPriv->clientDriverName); diff --git a/nx-X11/programs/Xserver/Xi/chgdctl.c b/nx-X11/programs/Xserver/Xi/chgdctl.c index c2412df67..b462583fd 100644 --- a/nx-X11/programs/Xserver/Xi/chgdctl.c +++ b/nx-X11/programs/Xserver/Xi/chgdctl.c @@ -210,6 +210,6 @@ SRepXChangeDeviceControl (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/chgkbd.c b/nx-X11/programs/Xserver/Xi/chgkbd.c index f29c86e0d..e9466ba8f 100644 --- a/nx-X11/programs/Xserver/Xi/chgkbd.c +++ b/nx-X11/programs/Xserver/Xi/chgkbd.c @@ -208,5 +208,5 @@ SRepXChangeKeyboardDevice (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/chgptr.c b/nx-X11/programs/Xserver/Xi/chgptr.c index 6d87df415..31b3bbd8e 100644 --- a/nx-X11/programs/Xserver/Xi/chgptr.c +++ b/nx-X11/programs/Xserver/Xi/chgptr.c @@ -254,5 +254,5 @@ SRepXChangePointerDevice (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/getbmap.c b/nx-X11/programs/Xserver/Xi/getbmap.c index e571bc7dd..8421e3e5c 100644 --- a/nx-X11/programs/Xserver/Xi/getbmap.c +++ b/nx-X11/programs/Xserver/Xi/getbmap.c @@ -126,7 +126,7 @@ ProcXGetDeviceButtonMapping (client) rep.nElts = b->numButtons; rep.length = (rep.nElts + (4-1))/4; WriteReplyToClient (client, sizeof (xGetDeviceButtonMappingReply), &rep); - (void)WriteToClient(client, rep.nElts, + WriteToClient(client, rep.nElts, (char *)&b->map[1]); return Success; } @@ -146,5 +146,5 @@ SRepXGetDeviceButtonMapping (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/getdctl.c b/nx-X11/programs/Xserver/Xi/getdctl.c index 2af8db5ea..0205d5fe4 100644 --- a/nx-X11/programs/Xserver/Xi/getdctl.c +++ b/nx-X11/programs/Xserver/Xi/getdctl.c @@ -220,6 +220,6 @@ SRepXGetDeviceControl (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/getfctl.c b/nx-X11/programs/Xserver/Xi/getfctl.c index d5fd88b0a..6640e8481 100644 --- a/nx-X11/programs/Xserver/Xi/getfctl.c +++ b/nx-X11/programs/Xserver/Xi/getfctl.c @@ -408,5 +408,5 @@ SRepXGetFeedbackControl (client, size, rep) swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_feedbacks); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/getfocus.c b/nx-X11/programs/Xserver/Xi/getfocus.c index 6e2136d65..41c2a6e25 100644 --- a/nx-X11/programs/Xserver/Xi/getfocus.c +++ b/nx-X11/programs/Xserver/Xi/getfocus.c @@ -149,5 +149,5 @@ SRepXGetDeviceFocus (client, size, rep) swapl(&rep->length); swapl(&rep->focus); swapl(&rep->time); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/getkmap.c b/nx-X11/programs/Xserver/Xi/getkmap.c index 29d4eb677..44f91868f 100644 --- a/nx-X11/programs/Xserver/Xi/getkmap.c +++ b/nx-X11/programs/Xserver/Xi/getkmap.c @@ -169,6 +169,6 @@ SRepXGetDeviceKeyMapping (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/getmmap.c b/nx-X11/programs/Xserver/Xi/getmmap.c index 773a65614..375f6f2e3 100644 --- a/nx-X11/programs/Xserver/Xi/getmmap.c +++ b/nx-X11/programs/Xserver/Xi/getmmap.c @@ -131,7 +131,7 @@ ProcXGetDeviceModifierMapping(client) WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep); /* Reply with the (modified by DDX) map that SetModifierMapping passed in */ - WriteToClient(client, 8*maxkeys, (char *)kp->modifierKeyMap); + WriteToClient(client, 8*maxkeys, kp->modifierKeyMap); return Success; } @@ -150,5 +150,5 @@ SRepXGetDeviceModifierMapping (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/getprop.c b/nx-X11/programs/Xserver/Xi/getprop.c index 824fae921..a19824155 100644 --- a/nx-X11/programs/Xserver/Xi/getprop.c +++ b/nx-X11/programs/Xserver/Xi/getprop.c @@ -207,5 +207,5 @@ SRepXGetDeviceDontPropagateList (client, size, rep) swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->count); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/getselev.c b/nx-X11/programs/Xserver/Xi/getselev.c index 4fafef982..7e1f42af2 100644 --- a/nx-X11/programs/Xserver/Xi/getselev.c +++ b/nx-X11/programs/Xserver/Xi/getselev.c @@ -188,5 +188,5 @@ SRepXGetSelectedExtensionEvents (client, size, rep) swapl(&rep->length); swaps(&rep->this_client_count); swaps(&rep->all_clients_count); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/getvers.c b/nx-X11/programs/Xserver/Xi/getvers.c index 34f4b0948..3a33d207b 100644 --- a/nx-X11/programs/Xserver/Xi/getvers.c +++ b/nx-X11/programs/Xserver/Xi/getvers.c @@ -150,5 +150,5 @@ SRepXGetExtensionVersion (client, size, rep) swapl(&rep->length); swaps(&rep->major_version); swaps(&rep->minor_version); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/grabdev.c b/nx-X11/programs/Xserver/Xi/grabdev.c index bd085a660..07099bc63 100644 --- a/nx-X11/programs/Xserver/Xi/grabdev.c +++ b/nx-X11/programs/Xserver/Xi/grabdev.c @@ -221,5 +221,5 @@ SRepXGrabDevice (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/gtmotion.c b/nx-X11/programs/Xserver/Xi/gtmotion.c index 9f1ce2fc0..3cc72c7ea 100644 --- a/nx-X11/programs/Xserver/Xi/gtmotion.c +++ b/nx-X11/programs/Xserver/Xi/gtmotion.c @@ -180,7 +180,7 @@ ProcXGetDeviceMotionEvents(client) bufptr++; } } - WriteToClient(client, length * 4, (char *)coords); + WriteToClient(client, length * 4, coords); } if (coords) DEALLOCATE_LOCAL(coords); @@ -203,5 +203,5 @@ SRepXGetDeviceMotionEvents (client, size, rep) swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->nEvents); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/listdev.c b/nx-X11/programs/Xserver/Xi/listdev.c index ad11652b9..0bf09c7c3 100644 --- a/nx-X11/programs/Xserver/Xi/listdev.c +++ b/nx-X11/programs/Xserver/Xi/listdev.c @@ -396,5 +396,5 @@ SRepXListInputDevices (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/opendev.c b/nx-X11/programs/Xserver/Xi/opendev.c index 73eba526c..0be0b36c5 100644 --- a/nx-X11/programs/Xserver/Xi/opendev.c +++ b/nx-X11/programs/Xserver/Xi/opendev.c @@ -179,7 +179,7 @@ ProcXOpenDevice(client) rep.length = (j * sizeof (xInputClassInfo) + 3) >> 2; rep.num_classes = j; WriteReplyToClient (client, sizeof (xOpenDeviceReply), &rep); - WriteToClient(client, j * sizeof (xInputClassInfo), (char *)evbase); + WriteToClient(client, j * sizeof (xInputClassInfo), evbase); return (Success); } @@ -198,5 +198,5 @@ SRepXOpenDevice (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/queryst.c b/nx-X11/programs/Xserver/Xi/queryst.c index 237c263dc..d26b25be9 100644 --- a/nx-X11/programs/Xserver/Xi/queryst.c +++ b/nx-X11/programs/Xserver/Xi/queryst.c @@ -206,5 +206,5 @@ SRepXQueryDeviceState (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/setbmap.c b/nx-X11/programs/Xserver/Xi/setbmap.c index 2919f48f1..050a14ad3 100644 --- a/nx-X11/programs/Xserver/Xi/setbmap.c +++ b/nx-X11/programs/Xserver/Xi/setbmap.c @@ -162,5 +162,5 @@ SRepXSetDeviceButtonMapping (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/setdval.c b/nx-X11/programs/Xserver/Xi/setdval.c index c4613dd37..f59577ac3 100644 --- a/nx-X11/programs/Xserver/Xi/setdval.c +++ b/nx-X11/programs/Xserver/Xi/setdval.c @@ -166,5 +166,5 @@ SRepXSetDeviceValuators (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/setmmap.c b/nx-X11/programs/Xserver/Xi/setmmap.c index c2e7beb4a..7fa5d25f9 100644 --- a/nx-X11/programs/Xserver/Xi/setmmap.c +++ b/nx-X11/programs/Xserver/Xi/setmmap.c @@ -155,6 +155,6 @@ SRepXSetDeviceModifierMapping (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/Xi/setmode.c b/nx-X11/programs/Xserver/Xi/setmode.c index 4314d6465..ea6e0826f 100644 --- a/nx-X11/programs/Xserver/Xi/setmode.c +++ b/nx-X11/programs/Xserver/Xi/setmode.c @@ -150,5 +150,5 @@ SRepXSetDeviceMode (client, size, rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, rep); } diff --git a/nx-X11/programs/Xserver/composite/compext.c b/nx-X11/programs/Xserver/composite/compext.c index 7c629fc54..8513c6d73 100644 --- a/nx-X11/programs/Xserver/composite/compext.c +++ b/nx-X11/programs/Xserver/composite/compext.c @@ -132,7 +132,7 @@ ProcCompositeQueryVersion (ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xCompositeQueryVersionReply), &rep); return Success; } @@ -405,7 +405,7 @@ ProcCompositeGetOverlayWindow(ClientPtr client) swapl(&rep.length); swapl(&rep.overlayWin); } - WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep); + WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep); return Success; } diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index 9ab5b6ad6..602825449 100644 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -160,7 +160,7 @@ ProcDamageQueryVersion(ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xDamageQueryVersionReply), &rep); return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 0525546a0..b35a19969 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -376,7 +376,7 @@ ProcDbeGetVersion(client) swaps(&rep.sequenceNumber); } - WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xDbeGetVersionReply), &rep); return(client->noClientException); @@ -988,7 +988,7 @@ ProcDbeGetVisualInfo(client) } /* Send off reply. */ - WriteToClient(client, sizeof(xDbeGetVisualInfoReply), (char *)&rep); + WriteToClient(client, sizeof(xDbeGetVisualInfoReply), &rep); for (i = 0; i < count; i++) { @@ -1004,7 +1004,7 @@ ProcDbeGetVisualInfo(client) swapl(&data32); } - WriteToClient(client, sizeof(CARD32), (char *)&data32); + WriteToClient(client, sizeof(CARD32), &data32); /* Now send off visual info items. */ for (j = 0; j < pScrVisInfo[i].count; j++) @@ -1030,7 +1030,7 @@ ProcDbeGetVisualInfo(client) } /* Write visualID(32), depth(8), perfLevel(8), and pad(16). */ - WriteToClient(client, 2*sizeof(CARD32), (char *)&visInfo.visualID); + WriteToClient(client, 2*sizeof(CARD32), &visInfo.visualID); } } @@ -1098,7 +1098,7 @@ ProcDbeGetBackBufferAttributes(client) } WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply), - (char *)&rep); + &rep); return(client->noClientException); } /* ProcDbeGetbackBufferAttributes() */ diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index 69a72fbad..ccce2324b 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -1041,7 +1041,7 @@ ProcGetModifierMapping(ClientPtr client) WriteReplyToClient(client, sizeof(xGetModifierMappingReply), &rep); /* Use the (modified by DDX) map that SetModifierMapping passed in */ - (void)WriteToClient(client, (int)(keyc->maxKeysPerModifier << 3), + WriteToClient(client, (int)(keyc->maxKeysPerModifier << 3), (char *)keyc->modifierKeyMap); return client->noClientException; } @@ -1178,7 +1178,7 @@ ProcGetPointerMapping(ClientPtr client) rep.nElts = butc->numButtons; rep.length = ((unsigned)rep.nElts + (4-1))/4; WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep); - (void)WriteToClient(client, (int)rep.nElts, (char *)&butc->map[1]); + WriteToClient(client, (int)rep.nElts, &butc->map[1]); return Success; } diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 826adfb5c..63ea0ab87 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -945,7 +945,7 @@ ProcGetAtomName(register ClientPtr client) reply.sequenceNumber = client->sequence; reply.nameLength = len; WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); - (void)WriteToClient(client, len, str); + WriteToClient(client, len, str); return(client->noClientException); } else @@ -2278,7 +2278,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, ClientOrder(client)); /* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, + WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); } @@ -2322,7 +2322,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, ClientOrder (client)); /* Don't split me, gcc pukes when you do */ - (void)WriteToClient(client, + WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); } @@ -3441,7 +3441,7 @@ ProcGetFontPath(register ClientPtr client) WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); if (stringLens || numpaths) - (void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart); + WriteToClient(client, stringLens + numpaths, bufferStart); return(client->noClientException); } @@ -3835,8 +3835,8 @@ SendConnSetup(register ClientPtr client, char *reason) if (client->swapped) WriteSConnSetupPrefix(client, &csp); else - (void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp); - (void)WriteToClient(client, (int)csp.lengthReason, reason); + WriteToClient(client, sz_xConnSetupPrefix, &csp); + WriteToClient(client, (int)csp.lengthReason, reason); return (client->noClientException = -1); } @@ -3893,9 +3893,9 @@ SendConnSetup(register ClientPtr client, char *reason) } else { - (void)WriteToClient(client, sizeof(xConnSetupPrefix), + WriteToClient(client, sizeof(xConnSetupPrefix), (char *) lconnSetupPrefix); - (void)WriteToClient(client, (int)(lconnSetupPrefix->length << 2), + WriteToClient(client, (int)(lconnSetupPrefix->length << 2), lConnectionInfo); } client->clientState = ClientStateRunning; diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index 0ebb4e68d..421345ef6 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -821,7 +821,7 @@ finish: reply.length = (stringLens + nnames + 3) >> 2; client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); - (void) WriteToClient(client, stringLens + nnames, bufferStart); + WriteToClient(client, stringLens + nnames, bufferStart); DEALLOCATE_LOCAL(bufferStart); bail: @@ -1081,7 +1081,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) pFP++; } WriteSwappedDataToClient(client, length, reply); - (void) WriteToClient(client, namelen, name); + WriteToClient(client, namelen, name); if (pFontInfo == &fontInfo) { free(fontInfo.props); diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index 6fefa512a..d06d9b823 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -4494,11 +4494,11 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) this event was sent with "SendEvent." */ (*EventSwapVector[eventFrom->u.u.type & 0177]) (eventFrom, &eventTo); - (void)WriteToClient(pClient, sizeof(xEvent), (char *)&eventTo); + WriteToClient(pClient, sizeof(xEvent), &eventTo); } } else { - (void)WriteToClient(pClient, count * sizeof(xEvent), (char *) events); + WriteToClient(pClient, count * sizeof(xEvent), events); } } diff --git a/nx-X11/programs/Xserver/dix/swaprep.c b/nx-X11/programs/Xserver/dix/swaprep.c index e5c722f31..cd6663333 100644 --- a/nx-X11/programs/Xserver/dix/swaprep.c +++ b/nx-X11/programs/Xserver/dix/swaprep.c @@ -86,7 +86,7 @@ Swap32Write(ClientPtr pClient, int size, register CARD32 *pbuf) { swapl(&pbuf[i]); } - (void)WriteToClient(pClient, size << 2, (char *) pbuf); + WriteToClient(pClient, size << 2, pbuf); } /** @@ -130,7 +130,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) from++; to++; } - (void)WriteToClient (pClient, nbytes, (char *) pbufT); + WriteToClient (pClient, nbytes, pbufT); } if (pbufT != tmpbuf) @@ -178,7 +178,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) from++; to++; } - (void)WriteToClient (pClient, nbytes, (char *) pbufT); + WriteToClient (pClient, nbytes, pbufT); } if (pbufT != tmpbuf) @@ -191,7 +191,7 @@ void SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep) { swaps(&pRep->sequenceNumber); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } /* Extra-large reply */ @@ -209,7 +209,7 @@ SGetWindowAttributesReply(ClientPtr pClient, int size, swapl(&pRep->allEventMasks); swapl(&pRep->yourEventMask); swaps(&pRep->doNotPropagateMask); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -222,7 +222,7 @@ SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep) swaps(&pRep->width); swaps(&pRep->height); swaps(&pRep->borderWidth); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -233,7 +233,7 @@ SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep) swapl(&pRep->root); swapl(&pRep->parent); swaps(&pRep->nChildren); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -241,7 +241,7 @@ SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->atom); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -250,7 +250,7 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nameLength); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } @@ -262,7 +262,7 @@ SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep) swapl(&pRep->propertyType); swapl(&pRep->bytesAfter); swapl(&pRep->nItems); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -271,7 +271,7 @@ SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nProperties); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -280,7 +280,7 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size, { swaps(&pRep->sequenceNumber); swapl(&pRep->owner); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } @@ -295,7 +295,7 @@ SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep) swaps(&pRep->winX); swaps(&pRep->winY); swaps(&pRep->mask); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -319,7 +319,7 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep) SwapTimecoord(pRepT); pRepT++; } - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -328,7 +328,7 @@ SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->nEvents); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -338,7 +338,7 @@ STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep) swapl(&pRep->child); swaps(&pRep->dstX); swaps(&pRep->dstY); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -346,7 +346,7 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->focus); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } /* extra long reply */ @@ -355,7 +355,7 @@ SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } static @@ -420,7 +420,7 @@ void SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep) { SwapFont(pRep, TRUE); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -434,7 +434,7 @@ SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep swapl(&pRep->overallWidth); swapl(&pRep->overallLeft); swapl(&pRep->overallRight); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -443,7 +443,7 @@ SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nFonts); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -451,7 +451,7 @@ SListFontsWithInfoReply(ClientPtr pClient, int size, xListFontsWithInfoReply *pRep) { SwapFont((xQueryFontReply *)pRep, FALSE); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -460,7 +460,7 @@ SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nPaths); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -469,7 +469,7 @@ SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->visual); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); /* Fortunately, image doesn't need swapping */ } @@ -480,7 +480,7 @@ SListInstalledColormapsReply(ClientPtr pClient, int size, swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nColormaps); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -494,7 +494,7 @@ SAllocColorReply(pClient, size, pRep) swaps(&pRep->green); swaps(&pRep->blue); swapl(&pRep->pixel); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -508,7 +508,7 @@ SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep) swaps(&pRep->screenRed); swaps(&pRep->screenGreen); swaps(&pRep->screenBlue); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -518,7 +518,7 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep) swapl(&pRep->length); swaps(&pRep->nPixels); swaps(&pRep->nMasks); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } @@ -531,7 +531,7 @@ SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep swapl(&pRep->redMask); swapl(&pRep->greenMask); swapl(&pRep->blueMask); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -555,7 +555,7 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb) SwapRGB(prgbT); prgbT++; } - (void)WriteToClient(pClient, size, (char *) prgb); + WriteToClient(pClient, size, prgb); } void @@ -564,7 +564,7 @@ SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nColors); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -577,7 +577,7 @@ SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep) swaps(&pRep->screenRed); swaps(&pRep->screenGreen); swaps(&pRep->screenBlue); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -586,7 +586,7 @@ SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep) swaps(&pRep->sequenceNumber); swaps(&pRep->width); swaps(&pRep->height); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -594,7 +594,7 @@ SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -603,7 +603,7 @@ SGetKeyboardMappingReply(ClientPtr pClient, int size, { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -612,7 +612,7 @@ SGetPointerMappingReply(ClientPtr pClient, int size, { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -621,7 +621,7 @@ SGetModifierMappingReply(ClientPtr pClient, int size, { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -632,7 +632,7 @@ SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply * swapl(&pRep->ledMask); swaps(&pRep->bellPitch); swaps(&pRep->bellDuration); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -642,7 +642,7 @@ SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pR swaps(&pRep->accelNumerator); swaps(&pRep->accelDenominator); swaps(&pRep->threshold); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -651,7 +651,7 @@ SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep) swaps(&pRep->sequenceNumber); swaps(&pRep->timeout); swaps(&pRep->interval); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -665,7 +665,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf) swaps (&host->length); bufT += sizeof (xHostEntry) + (((len + 3) >> 2) << 2); } - (void)WriteToClient (pClient, size, buf); + WriteToClient (pClient, size, buf); } void @@ -674,7 +674,7 @@ SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nHosts); - (void)WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } @@ -1148,7 +1148,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) return; } SwapConnSetupInfo(pInfo, pInfoTBase); - (void)WriteToClient(pClient, (int)size, (char *) pInfoTBase); + WriteToClient(pClient, (int)size, pInfoTBase); DEALLOCATE_LOCAL(pInfoTBase); } @@ -1220,5 +1220,5 @@ WriteSConnSetupPrefix(ClientPtr pClient, xConnSetupPrefix *pcsp) xConnSetupPrefix cspT; SwapConnSetupPrefix(pcsp, &cspT); - (void)WriteToClient(pClient, sizeof(cspT), (char *) &cspT); + WriteToClient(pClient, sizeof(cspT), &cspT); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 2603988b2..21a0cb0a8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -601,7 +601,7 @@ finish: reply.length = (stringLens + nnames + 3) >> 2; client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); - (void) WriteToClient(client, stringLens + nnames, bufferStart); + WriteToClient(client, stringLens + nnames, bufferStart); DEALLOCATE_LOCAL(bufferStart); bail: @@ -883,7 +883,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) pFP++; } WriteSwappedDataToClient(client, length, reply); - (void) WriteToClient(client, namelen, name); + WriteToClient(client, namelen, name); if (pFontInfo == &fontInfo) { free(fontInfo.props); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index 9aaef3d87..61cf7e9e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -150,7 +150,7 @@ ProcRenderQueryVersion (ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xRenderQueryVersionReply), &rep); return (client->noClientException); } @@ -359,7 +359,7 @@ ProcRenderQueryPictFormats (ClientPtr client) swapl (&reply->numVisuals); swapl (&reply->numSubpixel); } - WriteToClient(client, rlength, (char *) reply); + WriteToClient(client, rlength, reply); free (reply); return client->noClientException; } diff --git a/nx-X11/programs/Xserver/include/dix.h b/nx-X11/programs/Xserver/include/dix.h index b7f91b6da..e68c71623 100644 --- a/nx-X11/programs/Xserver/include/dix.h +++ b/nx-X11/programs/Xserver/include/dix.h @@ -281,12 +281,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; diff --git a/nx-X11/programs/Xserver/os/secauth.c b/nx-X11/programs/Xserver/os/secauth.c index eadb17b40..735afd6e5 100644 --- a/nx-X11/programs/Xserver/os/secauth.c +++ b/nx-X11/programs/Xserver/os/secauth.c @@ -181,7 +181,7 @@ AuthSecurityCheck ( if (client->swapped) WriteSConnSetupPrefix(client, &csp); else - (void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp); + WriteToClient(client, sz_xConnSetupPrefix, &csp); /* * Next time the client sends the real auth data, we want diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c index f1cc8c5e9..9bc504e66 100644 --- a/nx-X11/programs/Xserver/randr/rrcrtc.c +++ b/nx-X11/programs/Xserver/randr/rrcrtc.c @@ -1082,9 +1082,9 @@ ProcRRGetCrtcInfo(ClientPtr client) swaps(&rep.nOutput); swaps(&rep.nPossibleOutput); } - WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetCrtcInfoReply), &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } @@ -1313,7 +1313,7 @@ ProcRRSetCrtcConfig(ClientPtr client) swapl(&rep.length); swapl(&rep.newTimestamp); } - WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *) &rep); + WriteToClient(client, sizeof(xRRSetCrtcConfigReply), &rep); return Success; } @@ -1382,7 +1382,7 @@ ProcRRGetPanning(ClientPtr client) swaps(&rep.border_right); swaps(&rep.border_bottom); } - WriteToClient(client, sizeof(xRRGetPanningReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetPanningReply), &rep); return Success; } @@ -1453,7 +1453,7 @@ ProcRRSetPanning(ClientPtr client) swapl(&rep.length); swapl(&rep.newTimestamp); } - WriteToClient(client, sizeof(xRRSetPanningReply), (char *) &rep); + WriteToClient(client, sizeof(xRRSetPanningReply), &rep); return Success; } @@ -1482,7 +1482,7 @@ ProcRRGetCrtcGammaSize(ClientPtr client) swapl(&reply.length); swaps(&reply.size); } - WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), (char *) &reply); + WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), &reply); return Success; } @@ -1521,7 +1521,7 @@ ProcRRGetCrtcGamma(ClientPtr client) swapl(&reply.length); swaps(&reply.size); } - WriteToClient(client, sizeof(xRRGetCrtcGammaReply), (char *) &reply); + WriteToClient(client, sizeof(xRRGetCrtcGammaReply), &reply); if (crtc->gammaSize) { memcpy(extra, crtc->gammaRed, len); client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write; @@ -1688,7 +1688,7 @@ ProcRRGetCrtcTransform(ClientPtr client) swapl(&reply->length); } WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra, - (char *) reply); + reply); free(reply); return Success; } diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c index eae774636..14f74d771 100644 --- a/nx-X11/programs/Xserver/randr/rrdispatch.c +++ b/nx-X11/programs/Xserver/randr/rrdispatch.c @@ -67,7 +67,7 @@ ProcRRQueryVersion(ClientPtr client) #ifndef NXAGENT_SERVER WriteToClient(client, sizeof(xRRQueryVersionReply), &rep); #else - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xRRQueryVersionReply), &rep); #endif return Success; } diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c index c3e60c0bd..db832d8f5 100644 --- a/nx-X11/programs/Xserver/randr/rrmode.c +++ b/nx-X11/programs/Xserver/randr/rrmode.c @@ -380,7 +380,7 @@ ProcRRCreateMode(ClientPtr client) swapl(&rep.length); swapl(&rep.mode); } - WriteToClient(client, sizeof(xRRCreateModeReply), (char *) &rep); + WriteToClient(client, sizeof(xRRCreateModeReply), &rep); /* Drop out reference to this mode */ RRModeDestroy(mode); return Success; diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c index d648625c1..8829caf2f 100644 --- a/nx-X11/programs/Xserver/randr/rrmonitor.c +++ b/nx-X11/programs/Xserver/randr/rrmonitor.c @@ -667,7 +667,7 @@ ProcRRGetMonitors(ClientPtr client) swapl(&rep.nmonitors); swapl(&rep.noutputs); } - WriteToClient(client, sizeof(xRRGetMonitorsReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetMonitorsReply), &rep); client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; @@ -696,7 +696,7 @@ ProcRRGetMonitors(ClientPtr client) swapl(&info.heightInMillimeters); } - WriteToClient(client, sizeof(xRRMonitorInfo), (char *) &info); + WriteToClient(client, sizeof(xRRMonitorInfo), &info); WriteSwappedDataToClient(client, monitor->numOutputs * sizeof(RROutput), monitor->outputs); } diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c index 3a276e34a..07fda36b5 100644 --- a/nx-X11/programs/Xserver/randr/rroutput.c +++ b/nx-X11/programs/Xserver/randr/rroutput.c @@ -534,9 +534,9 @@ ProcRRGetOutputInfo(ClientPtr client) swaps(&rep.nClones); swaps(&rep.nameLength); } - WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetOutputInfoReply), &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } @@ -662,7 +662,7 @@ ProcRRGetOutputPrimary(ClientPtr client) swapl(&rep.output); } - WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep); return Success; } diff --git a/nx-X11/programs/Xserver/randr/rrproperty.c b/nx-X11/programs/Xserver/randr/rrproperty.c index b97f85b38..dab9e10cc 100644 --- a/nx-X11/programs/Xserver/randr/rrproperty.c +++ b/nx-X11/programs/Xserver/randr/rrproperty.c @@ -428,7 +428,7 @@ ProcRRListOutputProperties(ClientPtr client) swapl(&rep.length); swaps(&rep.nAtoms); } - WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char *) &rep); + WriteToClient(client, sizeof(xRRListOutputPropertiesReply), &rep); if (numProps) { /* Copy property name atoms to reply buffer */ @@ -482,7 +482,7 @@ ProcRRQueryOutputProperty(ClientPtr client) swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), (char *) &rep); + WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), &rep); if (prop->num_valid) { memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32)); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; @@ -646,7 +646,7 @@ ProcRRGetOutputProperty(ClientPtr client) swapl(&reply.nItems); } WriteToClient(client, sizeof(xRRGetOutputPropertyReply), - (char *) &reply); + &reply); return Success; } @@ -675,7 +675,7 @@ ProcRRGetOutputProperty(ClientPtr client) swapl(&reply.nItems); } WriteToClient(client, sizeof(xRRGetOutputPropertyReply), - (char *) &reply); + &reply); return Success; } @@ -728,7 +728,7 @@ ProcRRGetOutputProperty(ClientPtr client) swapl(&reply.bytesAfter); swapl(&reply.nItems); } - WriteToClient(client, sizeof(xGenericReply), (char *) &reply); + WriteToClient(client, sizeof(xGenericReply), &reply); if (len) { memcpy(extra, (char *) prop_value->data + ind, len); switch (reply.format) { diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c index 9ffb404c5..fe99fa04d 100644 --- a/nx-X11/programs/Xserver/randr/rrprovider.c +++ b/nx-X11/programs/Xserver/randr/rrprovider.c @@ -147,10 +147,10 @@ ProcRRGetProviders(ClientPtr client) swapl(&rep.timestamp); swaps(&rep.nProviders); } - WriteToClient(client, sizeof(xRRGetProvidersReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetProvidersReply), &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } return Success; @@ -289,10 +289,10 @@ ProcRRGetProviderInfo(ClientPtr client) swaps(&rep.nOutputs); swaps(&rep.nameLength); } - WriteToClient(client, sizeof(xRRGetProviderInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetProviderInfoReply), &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } return Success; diff --git a/nx-X11/programs/Xserver/randr/rrproviderproperty.c b/nx-X11/programs/Xserver/randr/rrproviderproperty.c index 303719909..9ac4eb09d 100644 --- a/nx-X11/programs/Xserver/randr/rrproviderproperty.c +++ b/nx-X11/programs/Xserver/randr/rrproviderproperty.c @@ -432,7 +432,7 @@ ProcRRListProviderProperties(ClientPtr client) *temppAtoms++ = prop->propertyName; WriteToClient(client, sizeof(xRRListProviderPropertiesReply), - (char *) &rep); + &rep); if (numProps) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); @@ -479,7 +479,7 @@ ProcRRQueryProviderProperty(ClientPtr client) swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), (char *) &rep); + WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), &rep); if (prop->num_valid) { memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32)); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; @@ -642,7 +642,7 @@ ProcRRGetProviderProperty(ClientPtr client) swapl(&reply.nItems); } WriteToClient(client, sizeof(xRRGetProviderPropertyReply), - (char *) &reply); + &reply); return Success; } @@ -671,7 +671,7 @@ ProcRRGetProviderProperty(ClientPtr client) swapl(&reply.nItems); } WriteToClient(client, sizeof(xRRGetProviderPropertyReply), - (char *) &reply); + &reply); return Success; } @@ -724,7 +724,7 @@ ProcRRGetProviderProperty(ClientPtr client) swapl(&reply.bytesAfter); swapl(&reply.nItems); } - WriteToClient(client, sizeof(xGenericReply), (char *) &reply); + WriteToClient(client, sizeof(xGenericReply), &reply); if (len) { memcpy(extra, (char *) prop_value->data + ind, len); switch (reply.format) { diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c index 9a6af7f39..9f0476815 100644 --- a/nx-X11/programs/Xserver/randr/rrscreen.c +++ b/nx-X11/programs/Xserver/randr/rrscreen.c @@ -251,7 +251,7 @@ ProcRRGetScreenSizeRange(ClientPtr client) swaps(&rep.maxWidth); swaps(&rep.maxHeight); } - WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), &rep); return Success; } @@ -494,9 +494,9 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) swaps(&rep.nModes); swaps(&rep.nbytesNames); } - WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetScreenResourcesReply), &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } return Success; @@ -662,9 +662,9 @@ rrGetScreenResources(ClientPtr client, Bool query) swaps(&rep.nbytesNames); } WriteToClient(client, sizeof(xRRGetScreenResourcesReply), - (char *) (char *) &rep); + (char *) &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } return Success; @@ -927,9 +927,9 @@ ProcRRGetScreenInfo(ClientPtr client) swaps(&rep.rate); swaps(&rep.nrateEnts); } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetScreenInfoReply), &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } return Success; @@ -1169,7 +1169,7 @@ ProcRRSetScreenConfig(ClientPtr client) swapl(&rep.newConfigTimestamp); swapl(&rep.root); } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *) &rep); + WriteToClient(client, sizeof(xRRSetScreenConfigReply), &rep); return Success; } diff --git a/nx-X11/programs/Xserver/randr/rrxinerama.c b/nx-X11/programs/Xserver/randr/rrxinerama.c index bd6340296..be1c0abce 100644 --- a/nx-X11/programs/Xserver/randr/rrxinerama.c +++ b/nx-X11/programs/Xserver/randr/rrxinerama.c @@ -123,7 +123,7 @@ ProcRRXineramaQueryVersion(ClientPtr client) swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep); return Success; } @@ -168,7 +168,7 @@ ProcRRXineramaGetState(ClientPtr client) swapl(&rep.length); swapl(&rep.window); } - WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep); return Success; } @@ -215,7 +215,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client) swapl(&rep.length); swapl(&rep.window); } - WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep); return Success; } @@ -259,7 +259,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client) swapl(&rep.window); swapl(&rep.screen); } - WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep); return Success; } @@ -281,7 +281,7 @@ ProcRRXineramaIsActive(ClientPtr client) swapl(&rep.length); swapl(&rep.state); } - WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); + WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep); return Success; } @@ -295,7 +295,7 @@ RRXineramaWriteMonitor(ClientPtr client, RRMonitorPtr monitor) scratch.width = monitor->geometry.box.x2 - monitor->geometry.box.x1; scratch.height = monitor->geometry.box.y2 - monitor->geometry.box.y1; - WriteToClient(client, sz_XineramaScreenInfo, (char *) &scratch); + WriteToClient(client, sz_XineramaScreenInfo, &scratch); } int @@ -326,7 +326,7 @@ ProcRRXineramaQueryScreens(ClientPtr client) swapl(&rep.length); swapl(&rep.number); } - WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep); + WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep); for (m = 0; m < nmonitors; m++) RRXineramaWriteMonitor(client, &monitors[m]); diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index 9d549bb5c..7417f79b9 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -257,9 +257,9 @@ RecordFlushReplyBuffer( (char *)pContext->replyBuffer); pContext->numBufBytes = 0; if (len1) - WriteToClient(pContext->pRecordingClient, len1, (char *)data1); + WriteToClient(pContext->pRecordingClient, len1, data1); if (len2) - WriteToClient(pContext->pRecordingClient, len2, (char *)data2); + WriteToClient(pContext->pRecordingClient, len2, data2); } /* RecordFlushReplyBuffer */ @@ -2009,8 +2009,8 @@ ProcRecordQueryVersion(client) swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - (void)WriteToClient(client, sizeof(xRecordQueryVersionReply), - (char *)&rep); + WriteToClient(client, sizeof(xRecordQueryVersionReply), + &rep); return (client->noClientException); } /* ProcRecordQueryVersion */ @@ -2436,8 +2436,8 @@ ProcRecordGetContext(client) swapl(&rep.length); swapl(&rep.nClients); } - (void)WriteToClient(client, sizeof(xRecordGetContextReply), - (char *)&rep); + WriteToClient(client, sizeof(xRecordGetContextReply), + &rep); /* write all the CLIENT_INFOs */ @@ -2456,7 +2456,7 @@ ProcRecordGetContext(client) { rci.clientResource = pRCAP->pClientIDs[i]; if (client->swapped) swapl(&rci.clientResource); - WriteToClient(client, sizeof(xRecordClientInfo), (char *)&rci); + WriteToClient(client, sizeof(xRecordClientInfo), &rci); WriteToClient(client, sizeof(xRecordRange) * pri->nRanges, (char *)pri->pRanges); } diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index b97c63775..764874507 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -303,7 +303,7 @@ ProcRenderQueryVersion (ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xRenderQueryVersionReply), &rep); return (client->noClientException); } #endif /* NXAGENT_SERVER */ @@ -551,7 +551,7 @@ ProcRenderQueryPictFormats (ClientPtr client) swapl (&reply->numVisuals); swapl (&reply->numSubpixel); } - WriteToClient(client, rlength, (char *) reply); + WriteToClient(client, rlength, reply); free (reply); return client->noClientException; } @@ -616,7 +616,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) swapl (&reply->numIndexValues); } - WriteToClient(client, rlength, (char *) reply); + WriteToClient(client, rlength, reply); free(reply); return (client->noClientException); } @@ -1816,7 +1816,7 @@ ProcRenderQueryFilters (ClientPtr client) swapl(&reply->numAliases); swapl(&reply->numFilters); } - WriteToClient(client, total_bytes, (char *) reply); + WriteToClient(client, total_bytes, reply); free (reply); return(client->noClientException); diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index c053a5aa3..61822aab7 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -339,7 +339,7 @@ ProcXFixesGetCursorImage (ClientPtr client) swapl(&rep->cursorSerial); SwapLongs(image, npixels); } - (void) WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + + WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + (npixels << 2), (char *) rep); free (rep); return client->noClientException; @@ -413,7 +413,7 @@ ProcXFixesGetCursorName (ClientPtr client) swaps(&reply.nbytes); } WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply); - (void)WriteToClient(client, len, str); + WriteToClient(client, len, str); return(client->noClientException); } @@ -488,7 +488,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) swaps(&rep->nbytes); SwapLongs(image, npixels); } - (void) WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + + WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + (npixels << 2) + nbytesRound, (char *) rep); free (rep); return client->noClientException; diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index f0044735a..0b502c7f9 100644 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -592,8 +592,8 @@ ProcXFixesFetchRegion (ClientPtr client) swaps(&reply->height); SwapShorts((INT16 *) pRect, nBox * 4); } - (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) + - nBox * sizeof (xRectangle), (char *) reply); + WriteToClient(client, sizeof (xXFixesFetchRegionReply) + + nBox * sizeof (xRectangle), reply); free (reply); return (client->noClientException); } diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c index fdee46d90..add8d1b0e 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixes.c +++ b/nx-X11/programs/Xserver/xfixes/xfixes.c @@ -65,7 +65,7 @@ ProcXFixesQueryVersion(ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xXFixesQueryVersionReply), &rep); return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 65a4c3747..52c5d36bf 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -204,7 +204,7 @@ ProcXkbUseExtension(ClientPtr client) swaps(&rep.serverMajor); swaps(&rep.serverMinor); } - WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep); + WriteToClient(client,SIZEOF(xkbUseExtensionReply), &rep); return client->noClientException; } @@ -537,7 +537,7 @@ ProcXkbGetState(ClientPtr client) swaps(&rep.sequenceNumber); swaps(&rep.ptrBtnState); } - WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep); + WriteToClient(client, SIZEOF(xkbGetStateReply), &rep); return client->noClientException; } @@ -671,7 +671,7 @@ ProcXkbGetControls(ClientPtr client) swaps(&rep.axtOptsValues); swaps(&rep.axOptions); } - WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep); + WriteToClient(client, SIZEOF(xkbGetControlsReply), &rep); return(client->noClientException); } @@ -1345,7 +1345,7 @@ char *desc,*start; swaps(&rep->totalSyms); swaps(&rep->totalActs); } - WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep); + WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), rep); WriteToClient(client, len, start); DEALLOCATE_LOCAL((char *)start); return client->noClientException; @@ -2536,7 +2536,7 @@ int size; swaps(&rep->nTotalSI); } - WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep); + WriteToClient(client, SIZEOF(xkbGetCompatMapReply), rep); if (data) { WriteToClient(client, size, data); DEALLOCATE_LOCAL((char *)data); @@ -2750,7 +2750,7 @@ ProcXkbGetIndicatorState(ClientPtr client) swaps(&rep.sequenceNumber); swapl(&rep.state); } - WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep); + WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), &rep); return client->noClientException; } @@ -2821,9 +2821,9 @@ register unsigned bit; swapl(&rep->which); swapl(&rep->realIndicators); } - WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *)rep); + WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), rep); if (map) { - WriteToClient(client, length, (char *)map); + WriteToClient(client, length, map); DEALLOCATE_LOCAL((char *)map); } return client->noClientException; @@ -3025,7 +3025,7 @@ ProcXkbGetNamedIndicator(ClientPtr client) swapl(&rep.ctrls); } - WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep); + WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), &rep); if (!supported) { xkbExtensionDeviceNotify edev; @@ -3432,7 +3432,7 @@ char * desc; ErrorF("BOGUS LENGTH in write names, expected %d, got %ld\n", length, (unsigned long)(desc-start)); } - WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep); + WriteToClient(client, SIZEOF(xkbGetNamesReply), rep); WriteToClient(client, length, start); DEALLOCATE_LOCAL((char *)start); return client->noClientException; @@ -4359,7 +4359,7 @@ XkbSendGeometry( ClientPtr client, swaps(&rep->nDoodads); swaps(&rep->nKeyAliases); } - WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *)rep); + WriteToClient(client, SIZEOF(xkbGetGeometryReply), rep); if (len>0) WriteToClient(client, len, start); if (start!=NULL) @@ -4977,7 +4977,7 @@ ProcXkbPerClientFlags(ClientPtr client) swapl(&rep.autoCtrls); swapl(&rep.autoCtrlValues); } - WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep); + WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), &rep); return client->noClientException; } @@ -5106,9 +5106,9 @@ ProcXkbListComponents(ClientPtr client) swaps(&rep.nGeometries); swaps(&rep.extra); } - WriteToClient(client,SIZEOF(xkbListComponentsReply),(char *)&rep); + WriteToClient(client,SIZEOF(xkbListComponentsReply),&rep); if (list.nPool && list.pool) { - WriteToClient(client,XkbPaddedSize(list.nPool), (char *)list.pool); + WriteToClient(client,XkbPaddedSize(list.nPool), list.pool); _XkbFree(list.pool); list.pool= NULL; } @@ -5368,7 +5368,7 @@ ProcXkbGetKbdByName(ClientPtr client) swaps(&rep.found); swaps(&rep.reported); } - WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), (char *)&rep); + WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), &rep); if (reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask)) XkbSendMap(client,finfo.xkb,&mrep); if (reported&XkbGBN_CompatMapMask) @@ -5559,7 +5559,7 @@ int length; swapl(&wire.physIndicators); swapl(&wire.state); } - WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc),(char *)&wire); + WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc), &wire); length+= SIZEOF(xkbDeviceLedsWireDesc); if (sli->namesPresent|sli->mapsPresent) { register unsigned i,bit; @@ -5571,7 +5571,7 @@ int length; if (client->swapped) { swapl(&awire); } - WriteToClient(client,4,(char *)&awire); + WriteToClient(client,4, &awire); length+= 4; } } @@ -5756,7 +5756,7 @@ char * str; swapl((int *)&rep.type); } - WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep); + WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), &rep); str= (char*) ALLOCATE_LOCAL(nameLen); if (!str) @@ -5771,7 +5771,7 @@ char * str; xkbActionWireDesc * awire; sz= rep.nBtnsRtrn*SIZEOF(xkbActionWireDesc); awire= (xkbActionWireDesc *)&dev->button->xkb_acts[rep.firstBtnRtrn]; - WriteToClient(client,sz,(char *)awire); + WriteToClient(client,sz, awire); length-= sz; } if (nDeviceLedFBs>0) { @@ -6113,7 +6113,7 @@ xkbSetDebuggingFlagsReply rep; swapl(&rep.supportedFlags); swapl(&rep.supportedCtrls); } - WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep); + WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), &rep); return client->noClientException; } diff --git a/nx-X11/programs/Xserver/xkb/xkbEvents.c b/nx-X11/programs/Xserver/xkb/xkbEvents.c index c36653f2e..7c392abe5 100644 --- a/nx-X11/programs/Xserver/xkb/xkbEvents.c +++ b/nx-X11/programs/Xserver/xkb/xkbEvents.c @@ -71,7 +71,7 @@ CARD16 changed; swapl(&pNKN->time); swaps(&pNKN->changed); } - WriteToClient(clients[i],sizeof(xEvent),(char *)pNKN); + WriteToClient(clients[i],sizeof(xEvent), pNKN); if (changed&XkbNKN_KeycodesMask) { clients[i]->minKC= pNKN->minKeyCode; clients[i]->maxKC= pNKN->maxKeyCode; @@ -88,9 +88,9 @@ CARD16 changed; if (clients[i]->swapped) { swaps(&event.u.u.sequenceNumber); } - WriteToClient(clients[i],SIZEOF(xEvent), (char *)&event); + WriteToClient(clients[i],SIZEOF(xEvent), &event); event.u.mappingNotify.request= MappingModifier; - WriteToClient(clients[i],SIZEOF(xEvent), (char *)&event); + WriteToClient(clients[i],SIZEOF(xEvent), &event); } } return; @@ -149,7 +149,7 @@ register CARD16 changed,bState; swaps(&pSN->changed); swaps(&pSN->ptrBtnState); } - WriteToClient(interest->client, sizeof(xEvent), (char *)pSN); + WriteToClient(interest->client, sizeof(xEvent), pSN); } interest= interest->next; } @@ -193,7 +193,7 @@ CARD16 changed; swapl(&pMN->time); swaps(&pMN->changed); } - WriteToClient(clients[i],sizeof(xEvent),(char *)pMN); + WriteToClient(clients[i],sizeof(xEvent), pMN); } } return; @@ -317,7 +317,7 @@ Time time = 0; swapl(&pCN->enabledControlChanges); swapl(&pCN->time); } - WriteToClient(interest->client, sizeof(xEvent), (char *)pCN); + WriteToClient(interest->client, sizeof(xEvent), pCN); } interest= interest->next; } @@ -364,7 +364,7 @@ CARD32 state,changed; swapl(&pEv->changed); swapl(&pEv->state); } - WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest= interest->next; } @@ -448,7 +448,7 @@ XID winID = 0; swapl(&bn.name); swapl(&bn.window); } - WriteToClient(interest->client, sizeof(xEvent), (char *)&bn); + WriteToClient(interest->client, sizeof(xEvent), &bn); } interest= interest->next; } @@ -492,7 +492,7 @@ CARD16 sk_delay,db_delay; swaps(&pEv->slowKeysDelay); swaps(&pEv->debounceDelay); } - WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest= interest->next; } @@ -540,7 +540,7 @@ CARD32 changedIndicators; swapl(&pEv->changedIndicators); swaps(&pEv->changedVirtualMods); } - WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest= interest->next; } @@ -587,7 +587,7 @@ CARD16 firstSI = 0, nSI = 0, nTotalSI = 0; swaps(&pEv->nSI); swaps(&pEv->nTotalSI); } - WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest= interest->next; } @@ -629,7 +629,7 @@ Time time = 0; swaps(&pEv->sequenceNumber); swapl(&pEv->time); } - WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest= interest->next; } @@ -692,7 +692,7 @@ CARD16 reason, supported = 0; swaps(&pEv->reason); swaps(&pEv->supported); } - WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest= interest->next; } -- cgit v1.2.3 From fa651994740d4381d8a8ab72e2ac3ef38fba3dde Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 4 Jul 2016 21:11:21 +0200 Subject: remove unreferenced NEED_EVENTS/NEED_REPLIES Remove defines of NEED_EVENTS and NEED_REPLIES because they are never used anywhere. Basically these three commits, but as they are newer and to not match the code structure the patches have not been applied but replaced by sed + manual intervention: From cb95642dc8edebb2935dd471f8b339cb98aa8481 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 28 Nov 2008 22:28:32 +1000 Subject: Remove #define NEED_EVENTS and NEED_REPLIES A grep on xorg/* revealed there's no consumer of this define. Quote Alan Coopersmith: "The consumer was in past versions of the headers now located in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h, all the event definitions were only available if NEED_EVENTS were defined, and all the reply definitions required NEED_REPLIES. Looks like Xproto.h dropped them by X11R6.3, which didn't have the #ifdef's anymore, so these are truly ancient now." Signed-off-by: Peter Hutterer Signed-off-by: Adam Jackson -- From 6de368c9aa7ccd2fcd62fca5a2b278913db4d03d Mon Sep 17 00:00:00 2001 From: Fernando Carrijo Date: Thu, 1 Jul 2010 06:50:47 -0300 Subject: Purge macros NEED_EVENTS and NEED_REPLIES Signed-off-by: Fernando Carrijo Acked-by: Tiago Vignatti Reviewed-by: Alan Coopersmith -- From 57c03e52e6b4e3ed54df5fdd778865467d08e119 Mon Sep 17 00:00:00 2001 From: Fernando Carrijo Date: Thu, 1 Jul 2010 06:59:48 -0300 Subject: Purge macro NEED_EVENTS Signed-off-by: Fernando Carrijo Acked-by: Tiago Vignatti Reviewed-by: Alan Coopersmith --- nx-X11/lib/X11/AllCells.c | 2 -- nx-X11/lib/X11/AllPlanes.c | 1 - nx-X11/lib/X11/ChkIfEv.c | 1 - nx-X11/lib/X11/ChkMaskEv.c | 1 - nx-X11/lib/X11/ChkTypEv.c | 1 - nx-X11/lib/X11/ChkTypWEv.c | 1 - nx-X11/lib/X11/ChkWinEv.c | 1 - nx-X11/lib/X11/ConnDis.c | 2 -- nx-X11/lib/X11/EvToWire.c | 2 -- nx-X11/lib/X11/FilterEv.c | 1 - nx-X11/lib/X11/Font.c | 1 - nx-X11/lib/X11/FontInfo.c | 1 - nx-X11/lib/X11/FontNames.c | 1 - nx-X11/lib/X11/GetAtomNm.c | 1 - nx-X11/lib/X11/GetColor.c | 1 - nx-X11/lib/X11/GetFPath.c | 1 - nx-X11/lib/X11/GetGeom.c | 1 - nx-X11/lib/X11/GetHColor.c | 1 - nx-X11/lib/X11/GetIFocus.c | 1 - nx-X11/lib/X11/GetImage.c | 1 - nx-X11/lib/X11/GetKCnt.c | 1 - nx-X11/lib/X11/GetMoEv.c | 1 - nx-X11/lib/X11/GetPCnt.c | 1 - nx-X11/lib/X11/GetPntMap.c | 1 - nx-X11/lib/X11/GetProp.c | 1 - nx-X11/lib/X11/GetSOwner.c | 1 - nx-X11/lib/X11/GetSSaver.c | 1 - nx-X11/lib/X11/GetWAttrs.c | 1 - nx-X11/lib/X11/GrKeybd.c | 1 - nx-X11/lib/X11/GrPointer.c | 1 - nx-X11/lib/X11/ICWrap.c | 1 - nx-X11/lib/X11/Iconify.c | 1 - nx-X11/lib/X11/IfEvent.c | 1 - nx-X11/lib/X11/ImText.c | 1 - nx-X11/lib/X11/ImText16.c | 1 - nx-X11/lib/X11/IntAtom.c | 1 - nx-X11/lib/X11/KeyBind.c | 1 - nx-X11/lib/X11/LiHosts.c | 1 - nx-X11/lib/X11/LiICmaps.c | 1 - nx-X11/lib/X11/LiProps.c | 1 - nx-X11/lib/X11/ListExt.c | 1 - nx-X11/lib/X11/LookupCol.c | 1 - nx-X11/lib/X11/MaskEvent.c | 1 - nx-X11/lib/X11/ModMap.c | 1 - nx-X11/lib/X11/NextEvent.c | 1 - nx-X11/lib/X11/OpenDis.c | 2 -- nx-X11/lib/X11/ParseCol.c | 1 - nx-X11/lib/X11/PeekEvent.c | 1 - nx-X11/lib/X11/PeekIfEv.c | 1 - nx-X11/lib/X11/PutBEvent.c | 1 - nx-X11/lib/X11/QuBest.c | 1 - nx-X11/lib/X11/QuColor.c | 1 - nx-X11/lib/X11/QuColors.c | 1 - nx-X11/lib/X11/QuCurShp.c | 1 - nx-X11/lib/X11/QuExt.c | 1 - nx-X11/lib/X11/QuKeybd.c | 1 - nx-X11/lib/X11/QuPntr.c | 1 - nx-X11/lib/X11/QuStipShp.c | 1 - nx-X11/lib/X11/QuTextE16.c | 1 - nx-X11/lib/X11/QuTextExt.c | 1 - nx-X11/lib/X11/QuTileShp.c | 1 - nx-X11/lib/X11/QuTree.c | 1 - nx-X11/lib/X11/ReconfWM.c | 2 -- nx-X11/lib/X11/SendEvent.c | 1 - nx-X11/lib/X11/SetPntMap.c | 2 -- nx-X11/lib/X11/Sync.c | 2 -- nx-X11/lib/X11/TrCoords.c | 1 - nx-X11/lib/X11/WinEvent.c | 1 - nx-X11/lib/X11/Withdraw.c | 1 - nx-X11/lib/X11/XDefaultIMIF.c | 1 - nx-X11/lib/X11/XKB.c | 2 -- nx-X11/lib/X11/XKBAlloc.c | 4 ---- nx-X11/lib/X11/XKBBell.c | 2 -- nx-X11/lib/X11/XKBBind.c | 1 - nx-X11/lib/X11/XKBCompat.c | 2 -- nx-X11/lib/X11/XKBCtrls.c | 2 -- nx-X11/lib/X11/XKBCvt.c | 1 - nx-X11/lib/X11/XKBExtDev.c | 2 -- nx-X11/lib/X11/XKBGAlloc.c | 3 --- nx-X11/lib/X11/XKBGeom.c | 2 -- nx-X11/lib/X11/XKBGetByName.c | 2 -- nx-X11/lib/X11/XKBGetMap.c | 2 -- nx-X11/lib/X11/XKBList.c | 2 -- nx-X11/lib/X11/XKBMAlloc.c | 4 ---- nx-X11/lib/X11/XKBMisc.c | 4 ---- nx-X11/lib/X11/XKBNames.c | 2 -- nx-X11/lib/X11/XKBRdBuf.c | 2 -- nx-X11/lib/X11/XKBSetGeom.c | 2 -- nx-X11/lib/X11/XKBSetMap.c | 2 -- nx-X11/lib/X11/XKBUse.c | 2 -- nx-X11/lib/X11/XKBleds.c | 2 -- nx-X11/lib/X11/XlibAsync.c | 1 - nx-X11/lib/X11/XlibInt.c | 2 -- nx-X11/lib/X11/Xlibint.h | 3 --- nx-X11/lib/X11/cmsAllNCol.c | 1 - nx-X11/lib/X11/cmsCmap.c | 2 -- nx-X11/lib/X11/cmsInt.c | 1 - nx-X11/lib/X11/cmsLkCol.c | 1 - nx-X11/lib/X11/globals.c | 1 - nx-X11/lib/X11/imConv.c | 1 - nx-X11/lib/X11/imDefFlt.c | 1 - nx-X11/lib/X11/imDefIm.c | 1 - nx-X11/lib/X11/imDefLkup.c | 1 - nx-X11/lib/X11/imEvToWire.c | 2 -- nx-X11/lib/X11/imExten.c | 1 - nx-X11/lib/X11/imInsClbk.c | 1 - nx-X11/lib/X11/imLcFlt.c | 1 - nx-X11/lib/X11/imLcGIc.c | 1 - nx-X11/lib/X11/imTrX.c | 1 - nx-X11/lib/X11/imTrans.c | 1 - nx-X11/lib/xkbfile/maprules.c | 1 - nx-X11/lib/xkbfile/xkbconfig.c | 1 - nx-X11/lib/xkbfile/xkbmisc.c | 1 - nx-X11/lib/xkbfile/xkbout.c | 1 - nx-X11/lib/xkbfile/xkbtext.c | 1 - nx-X11/lib/xkbfile/xkmread.c | 1 - nx-X11/programs/Xserver/GL/glx/g_render.c | 1 - nx-X11/programs/Xserver/GL/glx/g_renderswap.c | 1 - nx-X11/programs/Xserver/GL/glx/g_single.c | 1 - nx-X11/programs/Xserver/GL/glx/g_singleswap.c | 1 - nx-X11/programs/Xserver/GL/glx/global.c | 1 - nx-X11/programs/Xserver/GL/glx/glxcmds.c | 1 - nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c | 1 - nx-X11/programs/Xserver/GL/glx/glxext.c | 1 - nx-X11/programs/Xserver/GL/glx/glxutil.c | 1 - nx-X11/programs/Xserver/GL/glx/render2.c | 1 - nx-X11/programs/Xserver/GL/glx/render2swap.c | 1 - nx-X11/programs/Xserver/GL/glx/renderpix.c | 1 - nx-X11/programs/Xserver/GL/glx/renderpixswap.c | 1 - nx-X11/programs/Xserver/GL/glx/single2.c | 1 - nx-X11/programs/Xserver/GL/glx/single2swap.c | 1 - nx-X11/programs/Xserver/GL/glx/singlepix.c | 1 - nx-X11/programs/Xserver/GL/glx/singlepixswap.c | 1 - nx-X11/programs/Xserver/GL/glx/xfont.c | 1 - nx-X11/programs/Xserver/Xext/bigreq.c | 1 - nx-X11/programs/Xserver/Xext/panoramiX.c | 1 - nx-X11/programs/Xserver/Xext/panoramiXprocs.c | 2 -- nx-X11/programs/Xserver/Xext/saver.c | 2 -- nx-X11/programs/Xserver/Xext/shape.c | 2 -- nx-X11/programs/Xserver/Xext/shm.c | 2 -- nx-X11/programs/Xserver/Xext/sync.c | 2 -- nx-X11/programs/Xserver/Xext/xcmisc.c | 2 -- nx-X11/programs/Xserver/Xext/xres.c | 2 -- nx-X11/programs/Xserver/Xext/xtest.c | 1 - nx-X11/programs/Xserver/Xext/xtest1dd.c | 3 --- nx-X11/programs/Xserver/Xext/xtest1di.c | 3 --- nx-X11/programs/Xserver/Xext/xvmc.c | 2 -- nx-X11/programs/Xserver/Xi/allowev.c | 2 -- nx-X11/programs/Xserver/Xi/chgdctl.c | 2 -- nx-X11/programs/Xserver/Xi/chgfctl.c | 2 -- nx-X11/programs/Xserver/Xi/chgkbd.c | 2 -- nx-X11/programs/Xserver/Xi/chgkmap.c | 2 -- nx-X11/programs/Xserver/Xi/chgprop.c | 2 -- nx-X11/programs/Xserver/Xi/chgptr.c | 2 -- nx-X11/programs/Xserver/Xi/closedev.c | 2 -- nx-X11/programs/Xserver/Xi/devbell.c | 2 -- nx-X11/programs/Xserver/Xi/exevents.c | 1 - nx-X11/programs/Xserver/Xi/extinit.c | 2 -- nx-X11/programs/Xserver/Xi/getbmap.c | 2 -- nx-X11/programs/Xserver/Xi/getdctl.c | 2 -- nx-X11/programs/Xserver/Xi/getfctl.c | 2 -- nx-X11/programs/Xserver/Xi/getfocus.c | 2 -- nx-X11/programs/Xserver/Xi/getkmap.c | 2 -- nx-X11/programs/Xserver/Xi/getmmap.c | 2 -- nx-X11/programs/Xserver/Xi/getprop.c | 2 -- nx-X11/programs/Xserver/Xi/getselev.c | 2 -- nx-X11/programs/Xserver/Xi/getvers.c | 2 -- nx-X11/programs/Xserver/Xi/grabdev.c | 2 -- nx-X11/programs/Xserver/Xi/grabdevb.c | 2 -- nx-X11/programs/Xserver/Xi/grabdevk.c | 2 -- nx-X11/programs/Xserver/Xi/gtmotion.c | 2 -- nx-X11/programs/Xserver/Xi/listdev.c | 2 -- nx-X11/programs/Xserver/Xi/opendev.c | 2 -- nx-X11/programs/Xserver/Xi/queryst.c | 2 -- nx-X11/programs/Xserver/Xi/selectev.c | 3 --- nx-X11/programs/Xserver/Xi/sendexev.c | 2 -- nx-X11/programs/Xserver/Xi/setbmap.c | 2 -- nx-X11/programs/Xserver/Xi/setdval.c | 2 -- nx-X11/programs/Xserver/Xi/setfocus.c | 2 -- nx-X11/programs/Xserver/Xi/setmmap.c | 2 -- nx-X11/programs/Xserver/Xi/setmode.c | 2 -- nx-X11/programs/Xserver/Xi/stubs.c | 1 - nx-X11/programs/Xserver/Xi/ungrdev.c | 2 -- nx-X11/programs/Xserver/Xi/ungrdevb.c | 2 -- nx-X11/programs/Xserver/Xi/ungrdevk.c | 2 -- nx-X11/programs/Xserver/damageext/damageextint.h | 1 - nx-X11/programs/Xserver/dbe/dbe.c | 1 - nx-X11/programs/Xserver/dbe/midbe.c | 2 -- nx-X11/programs/Xserver/dix/colormap.c | 1 - nx-X11/programs/Xserver/dix/devices.c | 2 -- nx-X11/programs/Xserver/dix/dixfonts.c | 1 - nx-X11/programs/Xserver/dix/events.c | 2 -- nx-X11/programs/Xserver/dix/extension.c | 2 -- nx-X11/programs/Xserver/dix/grabs.c | 1 - nx-X11/programs/Xserver/dix/main.c | 1 - nx-X11/programs/Xserver/dix/property.c | 2 -- nx-X11/programs/Xserver/dix/resource.c | 1 - nx-X11/programs/Xserver/dix/swaprep.c | 2 -- nx-X11/programs/Xserver/dix/swapreq.c | 1 - nx-X11/programs/Xserver/dix/tables.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/Events.c | 1 - nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 1 - nx-X11/programs/Xserver/include/closestr.h | 1 - nx-X11/programs/Xserver/include/dixfontstr.h | 1 - nx-X11/programs/Xserver/mi/mibstore.c | 1 - nx-X11/programs/Xserver/mi/midispcur.c | 1 - nx-X11/programs/Xserver/mi/mieq.c | 1 - nx-X11/programs/Xserver/mi/miexpose.c | 1 - nx-X11/programs/Xserver/mi/mipointer.c | 1 - nx-X11/programs/Xserver/os/io.c | 1 - nx-X11/programs/Xserver/randr/randr.c | 2 -- nx-X11/programs/Xserver/record/record.c | 1 - nx-X11/programs/Xserver/render/render.c | 2 -- nx-X11/programs/Xserver/xfixes/xfixesint.h | 1 - nx-X11/programs/Xserver/xkb/ddxBeep.c | 1 - nx-X11/programs/Xserver/xkb/ddxConfig.c | 1 - nx-X11/programs/Xserver/xkb/ddxCtrls.c | 1 - nx-X11/programs/Xserver/xkb/ddxDevBtn.c | 1 - nx-X11/programs/Xserver/xkb/ddxFakeBtn.c | 1 - nx-X11/programs/Xserver/xkb/ddxFakeMtn.c | 1 - nx-X11/programs/Xserver/xkb/ddxInit.c | 1 - nx-X11/programs/Xserver/xkb/ddxKeyClick.c | 1 - nx-X11/programs/Xserver/xkb/ddxKillSrv.c | 1 - nx-X11/programs/Xserver/xkb/ddxLEDs.c | 1 - nx-X11/programs/Xserver/xkb/ddxList.c | 1 - nx-X11/programs/Xserver/xkb/ddxLoad.c | 1 - nx-X11/programs/Xserver/xkb/ddxPrivate.c | 1 - nx-X11/programs/Xserver/xkb/ddxVT.c | 1 - nx-X11/programs/Xserver/xkb/xkb.c | 2 -- nx-X11/programs/Xserver/xkb/xkbAccessX.c | 1 - nx-X11/programs/Xserver/xkb/xkbActions.c | 1 - nx-X11/programs/Xserver/xkb/xkbEvents.c | 1 - nx-X11/programs/Xserver/xkb/xkbInit.c | 1 - nx-X11/programs/Xserver/xkb/xkbLEDs.c | 1 - nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c | 1 - nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c | 1 - nx-X11/programs/Xserver/xkb/xkbSwap.c | 2 -- nx-X11/programs/Xserver/xkb/xkbUtils.c | 1 - nxcompext/NXlib.c | 2 -- 240 files changed, 340 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/lib/X11/AllCells.c b/nx-X11/lib/X11/AllCells.c index ed7bc8453..9fbf87c8d 100644 --- a/nx-X11/lib/X11/AllCells.c +++ b/nx-X11/lib/X11/AllCells.c @@ -25,8 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES - #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/AllPlanes.c b/nx-X11/lib/X11/AllPlanes.c index 079422bee..12ab36fab 100644 --- a/nx-X11/lib/X11/AllPlanes.c +++ b/nx-X11/lib/X11/AllPlanes.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/AllPlanes.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ChkIfEv.c b/nx-X11/lib/X11/ChkIfEv.c index 0217af830..d0f9d6272 100644 --- a/nx-X11/lib/X11/ChkIfEv.c +++ b/nx-X11/lib/X11/ChkIfEv.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86$ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ChkMaskEv.c b/nx-X11/lib/X11/ChkMaskEv.c index 92b569f72..29f465700 100644 --- a/nx-X11/lib/X11/ChkMaskEv.c +++ b/nx-X11/lib/X11/ChkMaskEv.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/ChkMaskEv.c,v 3.5 2001/10/28 03:32:29 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ChkTypEv.c b/nx-X11/lib/X11/ChkTypEv.c index 8fd879d1a..fd40afb94 100644 --- a/nx-X11/lib/X11/ChkTypEv.c +++ b/nx-X11/lib/X11/ChkTypEv.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/ChkTypEv.c,v 1.2 2001/10/28 03:32:29 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ChkTypWEv.c b/nx-X11/lib/X11/ChkTypWEv.c index 83b6244df..1be4d2a17 100644 --- a/nx-X11/lib/X11/ChkTypWEv.c +++ b/nx-X11/lib/X11/ChkTypWEv.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/ChkTypWEv.c,v 1.2 2001/10/28 03:32:29 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ChkWinEv.c b/nx-X11/lib/X11/ChkWinEv.c index 91d9b30ed..9b60ab43b 100644 --- a/nx-X11/lib/X11/ChkWinEv.c +++ b/nx-X11/lib/X11/ChkWinEv.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/ChkWinEv.c,v 3.5 2001/10/28 03:32:30 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ConnDis.c b/nx-X11/lib/X11/ConnDis.c index 177ff2c59..0989292ec 100644 --- a/nx-X11/lib/X11/ConnDis.c +++ b/nx-X11/lib/X11/ConnDis.c @@ -49,8 +49,6 @@ in this Software without prior written authorization from The Open Group. * This file contains operating system dependencies. */ -#define NEED_EVENTS - #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/EvToWire.c b/nx-X11/lib/X11/EvToWire.c index 143352791..0fb3068c0 100644 --- a/nx-X11/lib/X11/EvToWire.c +++ b/nx-X11/lib/X11/EvToWire.c @@ -33,8 +33,6 @@ from The Open Group. * XEvToWire.c - Internal support routines for the C subroutine * interface library (Xlib) to the X Window System Protocol V11.0. */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FilterEv.c b/nx-X11/lib/X11/FilterEv.c index 0117291b2..469207793 100644 --- a/nx-X11/lib/X11/FilterEv.c +++ b/nx-X11/lib/X11/FilterEv.c @@ -55,7 +55,6 @@ from The Open Group. */ /* $XFree86: xc/lib/X11/FilterEv.c,v 3.4 2001/07/29 05:01:11 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #else diff --git a/nx-X11/lib/X11/Font.c b/nx-X11/lib/X11/Font.c index 8c8d1e443..bb56c96a3 100644 --- a/nx-X11/lib/X11/Font.c +++ b/nx-X11/lib/X11/Font.c @@ -29,7 +29,6 @@ authorization from the X Consortium and the XFree86 Project. */ /* $XFree86: xc/lib/X11/Font.c,v 1.17 2003/04/13 19:22:16 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/FontInfo.c b/nx-X11/lib/X11/FontInfo.c index bc096fef7..815045d01 100644 --- a/nx-X11/lib/X11/FontInfo.c +++ b/nx-X11/lib/X11/FontInfo.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/FontInfo.c,v 1.6 2001/12/14 19:54:00 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/FontNames.c b/nx-X11/lib/X11/FontNames.c index 0db27a222..03785b5a6 100644 --- a/nx-X11/lib/X11/FontNames.c +++ b/nx-X11/lib/X11/FontNames.c @@ -27,7 +27,6 @@ in this Software without prior written authorization from The Open Group. /* $XFree86: xc/lib/X11/FontNames.c,v 1.6 2001/12/14 19:54:00 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetAtomNm.c b/nx-X11/lib/X11/GetAtomNm.c index 1bba975d3..fab3eea28 100644 --- a/nx-X11/lib/X11/GetAtomNm.c +++ b/nx-X11/lib/X11/GetAtomNm.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/GetAtomNm.c,v 3.4 2001/08/18 02:41:28 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetColor.c b/nx-X11/lib/X11/GetColor.c index 530f479db..6bd9a4220 100644 --- a/nx-X11/lib/X11/GetColor.c +++ b/nx-X11/lib/X11/GetColor.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/GetColor.c,v 1.6 2003/04/13 19:22:16 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetFPath.c b/nx-X11/lib/X11/GetFPath.c index 03ad5daf9..55d36b1df 100644 --- a/nx-X11/lib/X11/GetFPath.c +++ b/nx-X11/lib/X11/GetFPath.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/GetFPath.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetGeom.c b/nx-X11/lib/X11/GetGeom.c index 842df3350..cbe956f87 100644 --- a/nx-X11/lib/X11/GetGeom.c +++ b/nx-X11/lib/X11/GetGeom.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetHColor.c b/nx-X11/lib/X11/GetHColor.c index 647cc11c9..61ab11e9c 100644 --- a/nx-X11/lib/X11/GetHColor.c +++ b/nx-X11/lib/X11/GetHColor.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetIFocus.c b/nx-X11/lib/X11/GetIFocus.c index 13cab18a9..5618196a9 100644 --- a/nx-X11/lib/X11/GetIFocus.c +++ b/nx-X11/lib/X11/GetIFocus.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/GetIFocus.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetImage.c b/nx-X11/lib/X11/GetImage.c index 634910d79..822455e59 100644 --- a/nx-X11/lib/X11/GetImage.c +++ b/nx-X11/lib/X11/GetImage.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/GetImage.c,v 1.4 2001/12/14 19:54:00 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetKCnt.c b/nx-X11/lib/X11/GetKCnt.c index 47f806472..05d597af8 100644 --- a/nx-X11/lib/X11/GetKCnt.c +++ b/nx-X11/lib/X11/GetKCnt.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/GetKCnt.c,v 1.5 2001/01/17 19:41:36 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetMoEv.c b/nx-X11/lib/X11/GetMoEv.c index e332ecfeb..45a9cee3d 100644 --- a/nx-X11/lib/X11/GetMoEv.c +++ b/nx-X11/lib/X11/GetMoEv.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetPCnt.c b/nx-X11/lib/X11/GetPCnt.c index 0883abada..e96e5b1f1 100644 --- a/nx-X11/lib/X11/GetPCnt.c +++ b/nx-X11/lib/X11/GetPCnt.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/GetPCnt.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetPntMap.c b/nx-X11/lib/X11/GetPntMap.c index 7a93ad794..8a873c416 100644 --- a/nx-X11/lib/X11/GetPntMap.c +++ b/nx-X11/lib/X11/GetPntMap.c @@ -27,7 +27,6 @@ in this Software without prior written authorization from The Open Group. /* $XFree86: xc/lib/X11/GetPntMap.c,v 1.6 2001/12/14 19:54:01 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetProp.c b/nx-X11/lib/X11/GetProp.c index af5525702..e1caab934 100644 --- a/nx-X11/lib/X11/GetProp.c +++ b/nx-X11/lib/X11/GetProp.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/GetProp.c,v 1.5 2001/10/28 03:32:30 tsi Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetSOwner.c b/nx-X11/lib/X11/GetSOwner.c index 30d57023d..2d35ca195 100644 --- a/nx-X11/lib/X11/GetSOwner.c +++ b/nx-X11/lib/X11/GetSOwner.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetSSaver.c b/nx-X11/lib/X11/GetSSaver.c index fc124eb55..f99d54f2e 100644 --- a/nx-X11/lib/X11/GetSSaver.c +++ b/nx-X11/lib/X11/GetSSaver.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/GetSSaver.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GetWAttrs.c b/nx-X11/lib/X11/GetWAttrs.c index 05f1c1124..6dcdaef22 100644 --- a/nx-X11/lib/X11/GetWAttrs.c +++ b/nx-X11/lib/X11/GetWAttrs.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GrKeybd.c b/nx-X11/lib/X11/GrKeybd.c index af587926a..a4f2cafae 100644 --- a/nx-X11/lib/X11/GrKeybd.c +++ b/nx-X11/lib/X11/GrKeybd.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/GrPointer.c b/nx-X11/lib/X11/GrPointer.c index 39351f424..7c140804e 100644 --- a/nx-X11/lib/X11/GrPointer.c +++ b/nx-X11/lib/X11/GrPointer.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ICWrap.c b/nx-X11/lib/X11/ICWrap.c index b51da6f41..765457c32 100644 --- a/nx-X11/lib/X11/ICWrap.c +++ b/nx-X11/lib/X11/ICWrap.c @@ -66,7 +66,6 @@ from The Open Group. */ /* $XFree86: xc/lib/X11/ICWrap.c,v 1.10 2003/04/25 14:12:38 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/Iconify.c b/nx-X11/lib/X11/Iconify.c index e68508666..1077d9585 100644 --- a/nx-X11/lib/X11/Iconify.c +++ b/nx-X11/lib/X11/Iconify.c @@ -50,7 +50,6 @@ from The Open Group. */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/IfEvent.c b/nx-X11/lib/X11/IfEvent.c index 9cf07f56d..e3c27b301 100644 --- a/nx-X11/lib/X11/IfEvent.c +++ b/nx-X11/lib/X11/IfEvent.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/IfEvent.c,v 1.4 2001/12/14 19:54:01 dawes Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ImText.c b/nx-X11/lib/X11/ImText.c index 4d2f147dc..dad5bc92a 100644 --- a/nx-X11/lib/X11/ImText.c +++ b/nx-X11/lib/X11/ImText.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/ImText.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ImText16.c b/nx-X11/lib/X11/ImText16.c index d0b5e9bca..ef2752ba2 100644 --- a/nx-X11/lib/X11/ImText16.c +++ b/nx-X11/lib/X11/ImText16.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/ImText16.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/IntAtom.c b/nx-X11/lib/X11/IntAtom.c index 8161c7f73..714337c39 100644 --- a/nx-X11/lib/X11/IntAtom.c +++ b/nx-X11/lib/X11/IntAtom.c @@ -28,7 +28,6 @@ from The Open Group. */ /* $XFree86: xc/lib/X11/IntAtom.c,v 1.6 2001/12/14 19:54:02 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/KeyBind.c b/nx-X11/lib/X11/KeyBind.c index d99cfdf2f..4fc490972 100644 --- a/nx-X11/lib/X11/KeyBind.c +++ b/nx-X11/lib/X11/KeyBind.c @@ -28,7 +28,6 @@ in this Software without prior written authorization from The Open Group. /* Beware, here be monsters (still under construction... - JG */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/LiHosts.c b/nx-X11/lib/X11/LiHosts.c index 59e2ae318..4dce4a0e8 100644 --- a/nx-X11/lib/X11/LiHosts.c +++ b/nx-X11/lib/X11/LiHosts.c @@ -38,7 +38,6 @@ X Window System is a trademark of The Open Group. /* This can really be considered an os dependent routine */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/LiICmaps.c b/nx-X11/lib/X11/LiICmaps.c index c36fe55a6..72ebc4c54 100644 --- a/nx-X11/lib/X11/LiICmaps.c +++ b/nx-X11/lib/X11/LiICmaps.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/LiICmaps.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/LiProps.c b/nx-X11/lib/X11/LiProps.c index 5e3aba8c0..90021bab8 100644 --- a/nx-X11/lib/X11/LiProps.c +++ b/nx-X11/lib/X11/LiProps.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/LiProps.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ListExt.c b/nx-X11/lib/X11/ListExt.c index 1140082e5..9c01a8ee9 100644 --- a/nx-X11/lib/X11/ListExt.c +++ b/nx-X11/lib/X11/ListExt.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/ListExt.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/LookupCol.c b/nx-X11/lib/X11/LookupCol.c index 02f831a6c..08285c18a 100644 --- a/nx-X11/lib/X11/LookupCol.c +++ b/nx-X11/lib/X11/LookupCol.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/LookupCol.c,v 1.6 2003/04/13 19:22:16 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/MaskEvent.c b/nx-X11/lib/X11/MaskEvent.c index a46766685..f7b69e346 100644 --- a/nx-X11/lib/X11/MaskEvent.c +++ b/nx-X11/lib/X11/MaskEvent.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/MaskEvent.c,v 3.5 2001/10/28 03:32:30 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ModMap.c b/nx-X11/lib/X11/ModMap.c index f321c81bb..3c2b2ddef 100644 --- a/nx-X11/lib/X11/ModMap.c +++ b/nx-X11/lib/X11/ModMap.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/ModMap.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/NextEvent.c b/nx-X11/lib/X11/NextEvent.c index 71d84223e..2efef6f13 100644 --- a/nx-X11/lib/X11/NextEvent.c +++ b/nx-X11/lib/X11/NextEvent.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/NextEvent.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/OpenDis.c b/nx-X11/lib/X11/OpenDis.c index 67f7ccbd1..691fa95e9 100644 --- a/nx-X11/lib/X11/OpenDis.c +++ b/nx-X11/lib/X11/OpenDis.c @@ -44,8 +44,6 @@ in this Software without prior written authorization from The Open Group. /* $XFree86: xc/lib/X11/OpenDis.c,v 3.16 2003/07/04 16:24:23 eich Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ParseCol.c b/nx-X11/lib/X11/ParseCol.c index 3736fada2..116ad0021 100644 --- a/nx-X11/lib/X11/ParseCol.c +++ b/nx-X11/lib/X11/ParseCol.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/ParseCol.c,v 1.6 2003/04/13 19:22:17 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/PeekEvent.c b/nx-X11/lib/X11/PeekEvent.c index b8d755f0a..8017feca7 100644 --- a/nx-X11/lib/X11/PeekEvent.c +++ b/nx-X11/lib/X11/PeekEvent.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/PeekEvent.c,v 1.3 2001/01/17 19:41:41 dawes Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/PeekIfEv.c b/nx-X11/lib/X11/PeekIfEv.c index 93a725b49..47d3dca63 100644 --- a/nx-X11/lib/X11/PeekIfEv.c +++ b/nx-X11/lib/X11/PeekIfEv.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/PeekIfEv.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/PutBEvent.c b/nx-X11/lib/X11/PutBEvent.c index 8c1db72a7..6e6974f0b 100644 --- a/nx-X11/lib/X11/PutBEvent.c +++ b/nx-X11/lib/X11/PutBEvent.c @@ -29,7 +29,6 @@ from The Open Group. /* $XFree86: xc/lib/X11/PutBEvent.c,v 1.3 2001/01/17 19:41:41 dawes Exp $ */ /* XPutBackEvent puts an event back at the head of the queue. */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuBest.c b/nx-X11/lib/X11/QuBest.c index 7fe218147..e4aed4c74 100644 --- a/nx-X11/lib/X11/QuBest.c +++ b/nx-X11/lib/X11/QuBest.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuColor.c b/nx-X11/lib/X11/QuColor.c index 9b6901e8d..026678a30 100644 --- a/nx-X11/lib/X11/QuColor.c +++ b/nx-X11/lib/X11/QuColor.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/QuColor.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuColors.c b/nx-X11/lib/X11/QuColors.c index 74a1de85d..e351bb013 100644 --- a/nx-X11/lib/X11/QuColors.c +++ b/nx-X11/lib/X11/QuColors.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/QuColors.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuCurShp.c b/nx-X11/lib/X11/QuCurShp.c index b2667231d..51a2a66a5 100644 --- a/nx-X11/lib/X11/QuCurShp.c +++ b/nx-X11/lib/X11/QuCurShp.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuExt.c b/nx-X11/lib/X11/QuExt.c index 19d8be5d5..5267402c9 100644 --- a/nx-X11/lib/X11/QuExt.c +++ b/nx-X11/lib/X11/QuExt.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86$ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuKeybd.c b/nx-X11/lib/X11/QuKeybd.c index 62691c043..c2465987e 100644 --- a/nx-X11/lib/X11/QuKeybd.c +++ b/nx-X11/lib/X11/QuKeybd.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/QuKeybd.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuPntr.c b/nx-X11/lib/X11/QuPntr.c index 006553d71..34c7d69b2 100644 --- a/nx-X11/lib/X11/QuPntr.c +++ b/nx-X11/lib/X11/QuPntr.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuStipShp.c b/nx-X11/lib/X11/QuStipShp.c index 0d7c00d78..25e022eb0 100644 --- a/nx-X11/lib/X11/QuStipShp.c +++ b/nx-X11/lib/X11/QuStipShp.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuTextE16.c b/nx-X11/lib/X11/QuTextE16.c index ee3817272..a6d0504fa 100644 --- a/nx-X11/lib/X11/QuTextE16.c +++ b/nx-X11/lib/X11/QuTextE16.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/QuTextE16.c,v 1.4 2001/12/14 19:54:04 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuTextExt.c b/nx-X11/lib/X11/QuTextExt.c index a144865c3..b1181be02 100644 --- a/nx-X11/lib/X11/QuTextExt.c +++ b/nx-X11/lib/X11/QuTextExt.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/QuTextExt.c,v 1.4 2001/12/14 19:54:04 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuTileShp.c b/nx-X11/lib/X11/QuTileShp.c index 5e23ae2ff..324a78004 100644 --- a/nx-X11/lib/X11/QuTileShp.c +++ b/nx-X11/lib/X11/QuTileShp.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/QuTree.c b/nx-X11/lib/X11/QuTree.c index 1a743284d..ee34a6303 100644 --- a/nx-X11/lib/X11/QuTree.c +++ b/nx-X11/lib/X11/QuTree.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/QuTree.c,v 1.5 2001/01/17 19:41:42 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/ReconfWM.c b/nx-X11/lib/X11/ReconfWM.c index ecb5f6a89..d4d3e058c 100644 --- a/nx-X11/lib/X11/ReconfWM.c +++ b/nx-X11/lib/X11/ReconfWM.c @@ -27,8 +27,6 @@ from The Open Group. */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/SendEvent.c b/nx-X11/lib/X11/SendEvent.c index a1b8d6620..1512f1467 100644 --- a/nx-X11/lib/X11/SendEvent.c +++ b/nx-X11/lib/X11/SendEvent.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/SendEvent.c,v 1.4 2001/12/14 19:54:05 dawes Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/SetPntMap.c b/nx-X11/lib/X11/SetPntMap.c index 4a98ad48c..b400452d1 100644 --- a/nx-X11/lib/X11/SetPntMap.c +++ b/nx-X11/lib/X11/SetPntMap.c @@ -26,8 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/SetPntMap.c,v 1.4 2001/12/14 19:54:06 dawes Exp $ */ -#define NEED_REPLIES - #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/Sync.c b/nx-X11/lib/X11/Sync.c index 6e9f300d8..efca51ba7 100644 --- a/nx-X11/lib/X11/Sync.c +++ b/nx-X11/lib/X11/Sync.c @@ -26,8 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/Sync.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/TrCoords.c b/nx-X11/lib/X11/TrCoords.c index 87ae4ae4a..79ca834b9 100644 --- a/nx-X11/lib/X11/TrCoords.c +++ b/nx-X11/lib/X11/TrCoords.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/WinEvent.c b/nx-X11/lib/X11/WinEvent.c index 961fcf74b..94d32ef34 100644 --- a/nx-X11/lib/X11/WinEvent.c +++ b/nx-X11/lib/X11/WinEvent.c @@ -26,7 +26,6 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/lib/X11/WinEvent.c,v 3.5 2001/10/28 03:32:32 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/Withdraw.c b/nx-X11/lib/X11/Withdraw.c index 2037b8e46..ddae2424a 100644 --- a/nx-X11/lib/X11/Withdraw.c +++ b/nx-X11/lib/X11/Withdraw.c @@ -50,7 +50,6 @@ from The Open Group. */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/XDefaultIMIF.c b/nx-X11/lib/X11/XDefaultIMIF.c index 41bd43c15..3ece58601 100644 --- a/nx-X11/lib/X11/XDefaultIMIF.c +++ b/nx-X11/lib/X11/XDefaultIMIF.c @@ -47,7 +47,6 @@ Sun Microsystems, Inc. or its licensors is granted. #include #endif #include -#define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" #include "XlcGeneric.h" diff --git a/nx-X11/lib/X11/XKB.c b/nx-X11/lib/X11/XKB.c index 413a51eb6..f03976d3b 100644 --- a/nx-X11/lib/X11/XKB.c +++ b/nx-X11/lib/X11/XKB.c @@ -30,8 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_REPLIES -#define NEED_EVENTS #include "Xlibint.h" #include #include "XKBlibint.h" diff --git a/nx-X11/lib/X11/XKBAlloc.c b/nx-X11/lib/X11/XKBAlloc.c index 131985444..9b4fbd38d 100644 --- a/nx-X11/lib/X11/XKBAlloc.c +++ b/nx-X11/lib/X11/XKBAlloc.c @@ -35,8 +35,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef XKB_IN_SERVER #include -#define NEED_REPLIES -#define NEED_EVENTS #include "Xlibint.h" #include "XKBlibint.h" #include @@ -47,8 +45,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS -#define NEED_REPLIES #include #include "misc.h" #include "inputstr.h" diff --git a/nx-X11/lib/X11/XKBBell.c b/nx-X11/lib/X11/XKBBell.c index 51869097e..44f863a5f 100644 --- a/nx-X11/lib/X11/XKBBell.c +++ b/nx-X11/lib/X11/XKBBell.c @@ -30,8 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_REPLIES -#define NEED_EVENTS #include "Xlibint.h" #include #include "XKBlibint.h" diff --git a/nx-X11/lib/X11/XKBBind.c b/nx-X11/lib/X11/XKBBind.c index 6c1864d41..82d06f35e 100644 --- a/nx-X11/lib/X11/XKBBind.c +++ b/nx-X11/lib/X11/XKBBind.c @@ -30,7 +30,6 @@ from The Open Group. /* the new monsters ate the old ones */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/XKBCompat.c b/nx-X11/lib/X11/XKBCompat.c index b16e6b083..04b0a3a8b 100644 --- a/nx-X11/lib/X11/XKBCompat.c +++ b/nx-X11/lib/X11/XKBCompat.c @@ -30,8 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_REPLIES -#define NEED_EVENTS #define NEED_MAP_READERS #include "Xlibint.h" #include diff --git a/nx-X11/lib/X11/XKBCtrls.c b/nx-X11/lib/X11/XKBCtrls.c index f3a09a124..8f2876e12 100644 --- a/nx-X11/lib/X11/XKBCtrls.c +++ b/nx-X11/lib/X11/XKBCtrls.c @@ -30,8 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_REPLIES -#define NEED_EVENTS #include "Xlibint.h" #include #include "XKBlibint.h" diff --git a/nx-X11/lib/X11/XKBCvt.c b/nx-X11/lib/X11/XKBCvt.c index 2d58ca990..391bbf499 100644 --- a/nx-X11/lib/X11/XKBCvt.c +++ b/nx-X11/lib/X11/XKBCvt.c @@ -37,7 +37,6 @@ from The Open Group. #include #include -#define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" #include "XlcPubI.h" diff --git a/nx-X11/lib/X11/XKBExtDev.c b/nx-X11/lib/X11/XKBExtDev.c index 0510b7f55..1f5bbb7db 100644 --- a/nx-X11/lib/X11/XKBExtDev.c +++ b/nx-X11/lib/X11/XKBExtDev.c @@ -30,8 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_REPLIES -#define NEED_EVENTS #define NEED_MAP_READERS #include "Xlibint.h" #include diff --git a/nx-X11/lib/X11/XKBGAlloc.c b/nx-X11/lib/X11/XKBGAlloc.c index eb74cbfd0..00168f413 100644 --- a/nx-X11/lib/X11/XKBGAlloc.c +++ b/nx-X11/lib/X11/XKBGAlloc.c @@ -32,9 +32,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#define NEED_EVENTS -#define NEED_REPLIES - #ifndef XKB_IN_SERVER #include diff --git a/nx-X11/lib/X11/XKBGeom.c b/nx-X11/lib/X11/XKBGeom.c index d225342a7..5dabf12a1 100644 --- a/nx-X11/lib/X11/XKBGeom.c +++ b/nx-X11/lib/X11/XKBGeom.c @@ -33,8 +33,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#define NEED_EVENTS -#define NEED_REPLIES #define NEED_MAP_READERS #include "Xlibint.h" #include diff --git a/nx-X11/lib/X11/XKBGetByName.c b/nx-X11/lib/X11/XKBGetByName.c index 87f405e50..535d793ae 100644 --- a/nx-X11/lib/X11/XKBGetByName.c +++ b/nx-X11/lib/X11/XKBGetByName.c @@ -26,8 +26,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /* $XFree86$ */ -#define NEED_REPLIES -#define NEED_EVENTS #define NEED_MAP_READERS #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBGetMap.c b/nx-X11/lib/X11/XKBGetMap.c index 5f37f9571..5fd3d7af9 100644 --- a/nx-X11/lib/X11/XKBGetMap.c +++ b/nx-X11/lib/X11/XKBGetMap.c @@ -27,8 +27,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. /* $XFree86: xc/lib/X11/XKBGetMap.c,v 1.9 2003/04/17 02:06:31 dawes Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #define NEED_MAP_READERS #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBList.c b/nx-X11/lib/X11/XKBList.c index ef265fdde..707fafbc8 100644 --- a/nx-X11/lib/X11/XKBList.c +++ b/nx-X11/lib/X11/XKBList.c @@ -26,8 +26,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /* $XFree86$ */ -#define NEED_REPLIES -#define NEED_EVENTS #define NEED_MAP_READERS #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBMAlloc.c b/nx-X11/lib/X11/XKBMAlloc.c index 31255091f..1db98c0a0 100644 --- a/nx-X11/lib/X11/XKBMAlloc.c +++ b/nx-X11/lib/X11/XKBMAlloc.c @@ -35,8 +35,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef XKB_IN_SERVER #include -#define NEED_REPLIES -#define NEED_EVENTS #include "Xlibint.h" #include #include @@ -46,8 +44,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS -#define NEED_REPLIES #include #include "misc.h" #include "inputstr.h" diff --git a/nx-X11/lib/X11/XKBMisc.c b/nx-X11/lib/X11/XKBMisc.c index 7f0e59e7a..30250cc17 100644 --- a/nx-X11/lib/X11/XKBMisc.c +++ b/nx-X11/lib/X11/XKBMisc.c @@ -35,8 +35,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef XKB_IN_SERVER #include -#define NEED_REPLIES -#define NEED_EVENTS #include "Xlibint.h" #include #include @@ -46,8 +44,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS -#define NEED_REPLIES #include #include "misc.h" #include "inputstr.h" diff --git a/nx-X11/lib/X11/XKBNames.c b/nx-X11/lib/X11/XKBNames.c index 0bcd42b3d..1b2a3cb0a 100644 --- a/nx-X11/lib/X11/XKBNames.c +++ b/nx-X11/lib/X11/XKBNames.c @@ -26,8 +26,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /* $XFree86: xc/lib/X11/XKBNames.c,v 1.5 2003/04/13 19:22:18 dawes Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #define NEED_MAP_READERS #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBRdBuf.c b/nx-X11/lib/X11/XKBRdBuf.c index 109618dd2..1d5459691 100644 --- a/nx-X11/lib/X11/XKBRdBuf.c +++ b/nx-X11/lib/X11/XKBRdBuf.c @@ -30,8 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_REPLIES -#define NEED_EVENTS #include "Xlibint.h" #include "XKBlibint.h" #include diff --git a/nx-X11/lib/X11/XKBSetGeom.c b/nx-X11/lib/X11/XKBSetGeom.c index f13be8097..2a6ce7442 100644 --- a/nx-X11/lib/X11/XKBSetGeom.c +++ b/nx-X11/lib/X11/XKBSetGeom.c @@ -34,8 +34,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -#define NEED_EVENTS -#define NEED_REPLIES #include "Xlibint.h" #include "XKBlibint.h" #include diff --git a/nx-X11/lib/X11/XKBSetMap.c b/nx-X11/lib/X11/XKBSetMap.c index 784a241c2..439d0dcea 100644 --- a/nx-X11/lib/X11/XKBSetMap.c +++ b/nx-X11/lib/X11/XKBSetMap.c @@ -30,8 +30,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_REPLIES -#define NEED_EVENTS #include "Xlibint.h" #include #include "XKBlibint.h" diff --git a/nx-X11/lib/X11/XKBUse.c b/nx-X11/lib/X11/XKBUse.c index 95fba49ac..fe6d316ef 100644 --- a/nx-X11/lib/X11/XKBUse.c +++ b/nx-X11/lib/X11/XKBUse.c @@ -31,8 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include #include -#define NEED_REPLIES -#define NEED_EVENTS #include "Xlibint.h" #include #include "XKBlibint.h" diff --git a/nx-X11/lib/X11/XKBleds.c b/nx-X11/lib/X11/XKBleds.c index d026d84be..adb87baa3 100644 --- a/nx-X11/lib/X11/XKBleds.c +++ b/nx-X11/lib/X11/XKBleds.c @@ -26,8 +26,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /* $XFree86: xc/lib/X11/XKBleds.c,v 1.4 2003/04/13 19:22:18 dawes Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #define NEED_MAP_READERS #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XlibAsync.c b/nx-X11/lib/X11/XlibAsync.c index 832371782..1fc64e5d6 100644 --- a/nx-X11/lib/X11/XlibAsync.c +++ b/nx-X11/lib/X11/XlibAsync.c @@ -44,7 +44,6 @@ from The Open Group. /* */ /**************************************************************************/ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/XlibInt.c b/nx-X11/lib/X11/XlibInt.c index 175f5b92f..5e9cb4a19 100644 --- a/nx-X11/lib/X11/XlibInt.c +++ b/nx-X11/lib/X11/XlibInt.c @@ -50,8 +50,6 @@ from The Open Group. * XlibInt.c - Internal support routines for the C subroutine * interface library (Xlib) to the X Window System Protocol V11.0. */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef WIN32 #define _XLIBINT_ diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index ca3d28004..6e5b2bcea 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -228,11 +228,8 @@ typedef struct _XSQEvent #endif #ifdef XTHREADS /* for xReply */ -#define NEED_REPLIES #endif -#define NEED_EVENTS -#define NEED_REPLIES #include #ifdef __sgi #define _SGI_MP_SOURCE /* turn this on to get MP safe errno */ diff --git a/nx-X11/lib/X11/cmsAllNCol.c b/nx-X11/lib/X11/cmsAllNCol.c index efee0f6b3..8453a31c2 100644 --- a/nx-X11/lib/X11/cmsAllNCol.c +++ b/nx-X11/lib/X11/cmsAllNCol.c @@ -34,7 +34,6 @@ */ /* $XFree86: xc/lib/X11/cmsAllNCol.c,v 1.4 2003/04/13 19:22:20 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/cmsCmap.c b/nx-X11/lib/X11/cmsCmap.c index bc26638c1..7ad5c7471 100644 --- a/nx-X11/lib/X11/cmsCmap.c +++ b/nx-X11/lib/X11/cmsCmap.c @@ -35,8 +35,6 @@ */ /* $XFree86$ */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/cmsInt.c b/nx-X11/lib/X11/cmsInt.c index 68cfebd74..aa67a3aed 100644 --- a/nx-X11/lib/X11/cmsInt.c +++ b/nx-X11/lib/X11/cmsInt.c @@ -36,7 +36,6 @@ */ /* $XFree86: xc/lib/X11/cmsInt.c,v 1.4 2003/04/13 19:22:20 dawes Exp $ */ -/* #define NEED_EVENTS */ #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/cmsLkCol.c b/nx-X11/lib/X11/cmsLkCol.c index f19f21d03..b8211b2c6 100644 --- a/nx-X11/lib/X11/cmsLkCol.c +++ b/nx-X11/lib/X11/cmsLkCol.c @@ -34,7 +34,6 @@ */ /* $XFree86: xc/lib/X11/cmsLkCol.c,v 1.5 2003/04/13 19:22:20 dawes Exp $ */ -#define NEED_REPLIES #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/globals.c b/nx-X11/lib/X11/globals.c index cf270dc22..99054493d 100644 --- a/nx-X11/lib/X11/globals.c +++ b/nx-X11/lib/X11/globals.c @@ -34,7 +34,6 @@ from The Open Group. * * This file should contain only those objects which must be predefined. */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/imConv.c b/nx-X11/lib/X11/imConv.c index f519401e4..6837ac042 100644 --- a/nx-X11/lib/X11/imConv.c +++ b/nx-X11/lib/X11/imConv.c @@ -35,7 +35,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* $XFree86: xc/lib/X11/imConv.c,v 1.32 2003/04/13 19:22:20 dawes Exp $ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/imDefFlt.c b/nx-X11/lib/X11/imDefFlt.c index b5b107221..c6ba5478b 100644 --- a/nx-X11/lib/X11/imDefFlt.c +++ b/nx-X11/lib/X11/imDefFlt.c @@ -32,7 +32,6 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_EVENTS #include "Xlibint.h" #include "Xutil.h" #include "Xlcint.h" diff --git a/nx-X11/lib/X11/imDefIm.c b/nx-X11/lib/X11/imDefIm.c index e963f3560..3d5c6fe88 100644 --- a/nx-X11/lib/X11/imDefIm.c +++ b/nx-X11/lib/X11/imDefIm.c @@ -37,7 +37,6 @@ OF THIS SOFTWARE. #include #endif #include -#define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" #include "XlcPublic.h" diff --git a/nx-X11/lib/X11/imDefLkup.c b/nx-X11/lib/X11/imDefLkup.c index 5bdcb77c3..13c538bff 100644 --- a/nx-X11/lib/X11/imDefLkup.c +++ b/nx-X11/lib/X11/imDefLkup.c @@ -32,7 +32,6 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imEvToWire.c b/nx-X11/lib/X11/imEvToWire.c index 211252a50..29fd0418b 100644 --- a/nx-X11/lib/X11/imEvToWire.c +++ b/nx-X11/lib/X11/imEvToWire.c @@ -23,13 +23,11 @@ SOFTWARE. ******************************************************************/ /* $XFree86$ */ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif #include #include -#undef NEED_EVENTS #include "Ximint.h" diff --git a/nx-X11/lib/X11/imExten.c b/nx-X11/lib/X11/imExten.c index 6cb663f66..1b18961e3 100644 --- a/nx-X11/lib/X11/imExten.c +++ b/nx-X11/lib/X11/imExten.c @@ -32,7 +32,6 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imInsClbk.c b/nx-X11/lib/X11/imInsClbk.c index 744ee824c..43e3d60bb 100644 --- a/nx-X11/lib/X11/imInsClbk.c +++ b/nx-X11/lib/X11/imInsClbk.c @@ -32,7 +32,6 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif #include -#define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" #include "XlcPublic.h" diff --git a/nx-X11/lib/X11/imLcFlt.c b/nx-X11/lib/X11/imLcFlt.c index 7ff642fae..5aa5c28a4 100644 --- a/nx-X11/lib/X11/imLcFlt.c +++ b/nx-X11/lib/X11/imLcFlt.c @@ -30,7 +30,6 @@ PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/imLcGIc.c b/nx-X11/lib/X11/imLcGIc.c index e4f89a0f5..c057b9262 100644 --- a/nx-X11/lib/X11/imLcGIc.c +++ b/nx-X11/lib/X11/imLcGIc.c @@ -27,7 +27,6 @@ PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -#define NEED_EVENTS #ifdef HAVE_CONFIG_H #include #endif diff --git a/nx-X11/lib/X11/imTrX.c b/nx-X11/lib/X11/imTrX.c index 4aa587662..59c766b85 100644 --- a/nx-X11/lib/X11/imTrX.c +++ b/nx-X11/lib/X11/imTrX.c @@ -35,7 +35,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include #include -#define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" #include "Ximint.h" diff --git a/nx-X11/lib/X11/imTrans.c b/nx-X11/lib/X11/imTrans.c index e9715927b..b69e0c06c 100644 --- a/nx-X11/lib/X11/imTrans.c +++ b/nx-X11/lib/X11/imTrans.c @@ -36,7 +36,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#define NEED_EVENTS #include "Xlibint.h" #include #include "Xlcint.h" diff --git a/nx-X11/lib/xkbfile/maprules.c b/nx-X11/lib/xkbfile/maprules.c index 75baf07ea..dd2f5bfb3 100644 --- a/nx-X11/lib/xkbfile/maprules.c +++ b/nx-X11/lib/xkbfile/maprules.c @@ -56,7 +56,6 @@ #else -#define NEED_EVENTS #include #include #include diff --git a/nx-X11/lib/xkbfile/xkbconfig.c b/nx-X11/lib/xkbfile/xkbconfig.c index 8c31213a5..5ab067ae5 100644 --- a/nx-X11/lib/xkbfile/xkbconfig.c +++ b/nx-X11/lib/xkbfile/xkbconfig.c @@ -51,7 +51,6 @@ #else #include -#define NEED_EVENTS #include #include #include "misc.h" diff --git a/nx-X11/lib/xkbfile/xkbmisc.c b/nx-X11/lib/xkbfile/xkbmisc.c index 52fca3d10..0bb129f7f 100644 --- a/nx-X11/lib/xkbfile/xkbmisc.c +++ b/nx-X11/lib/xkbfile/xkbmisc.c @@ -51,7 +51,6 @@ #else #include -#define NEED_EVENTS #include #include #include "misc.h" diff --git a/nx-X11/lib/xkbfile/xkbout.c b/nx-X11/lib/xkbfile/xkbout.c index 8baf34b78..467b47631 100644 --- a/nx-X11/lib/xkbfile/xkbout.c +++ b/nx-X11/lib/xkbfile/xkbout.c @@ -49,7 +49,6 @@ #else #include -#define NEED_EVENTS #include #include #include "misc.h" diff --git a/nx-X11/lib/xkbfile/xkbtext.c b/nx-X11/lib/xkbfile/xkbtext.c index 41f2a8ff3..2d5d0bdad 100644 --- a/nx-X11/lib/xkbfile/xkbtext.c +++ b/nx-X11/lib/xkbfile/xkbtext.c @@ -50,7 +50,6 @@ #else #include -#define NEED_EVENTS #include #include "misc.h" #include "inputstr.h" diff --git a/nx-X11/lib/xkbfile/xkmread.c b/nx-X11/lib/xkbfile/xkmread.c index 92ef05b86..9518bc90f 100644 --- a/nx-X11/lib/xkbfile/xkmread.c +++ b/nx-X11/lib/xkbfile/xkmread.c @@ -52,7 +52,6 @@ #else #include -#define NEED_EVENTS #include #include #include "misc.h" diff --git a/nx-X11/programs/Xserver/GL/glx/g_render.c b/nx-X11/programs/Xserver/GL/glx/g_render.c index 24c64897e..8ef9f693c 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_render.c +++ b/nx-X11/programs/Xserver/GL/glx/g_render.c @@ -29,7 +29,6 @@ ** version 1.2.1 Specification. */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/g_renderswap.c b/nx-X11/programs/Xserver/GL/glx/g_renderswap.c index f485a2690..6964ecd55 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_renderswap.c +++ b/nx-X11/programs/Xserver/GL/glx/g_renderswap.c @@ -28,7 +28,6 @@ ** version 1.2.1 Specification. */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/g_single.c b/nx-X11/programs/Xserver/GL/glx/g_single.c index a60bf44c1..65d79a9bc 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_single.c +++ b/nx-X11/programs/Xserver/GL/glx/g_single.c @@ -28,7 +28,6 @@ ** version 1.2.1 Specification. */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/g_singleswap.c b/nx-X11/programs/Xserver/GL/glx/g_singleswap.c index 026530374..48a5fc9f6 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_singleswap.c +++ b/nx-X11/programs/Xserver/GL/glx/g_singleswap.c @@ -28,7 +28,6 @@ ** version 1.2.1 Specification. */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/global.c b/nx-X11/programs/Xserver/GL/glx/global.c index 18cd5edc2..207e7b4cc 100644 --- a/nx-X11/programs/Xserver/GL/glx/global.c +++ b/nx-X11/programs/Xserver/GL/glx/global.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index a92d83062..3def7b333 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #define FONT_PCF #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c index afe681167..dbdbb667e 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #define FONT_PCF #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.c b/nx-X11/programs/Xserver/GL/glx/glxext.c index 8b4ae4252..f908c08cf 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxext.c +++ b/nx-X11/programs/Xserver/GL/glx/glxext.c @@ -18,7 +18,6 @@ ** */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c index b95a21f89..f7564a0ff 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxutil.c +++ b/nx-X11/programs/Xserver/GL/glx/glxutil.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #define FONT_PCF #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/GL/glx/render2.c b/nx-X11/programs/Xserver/GL/glx/render2.c index f4491b276..95b1a9ab7 100644 --- a/nx-X11/programs/Xserver/GL/glx/render2.c +++ b/nx-X11/programs/Xserver/GL/glx/render2.c @@ -34,7 +34,6 @@ ** */ -/* #define NEED_REPLIES */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/render2swap.c b/nx-X11/programs/Xserver/GL/glx/render2swap.c index 0225970cb..605ffd0c6 100644 --- a/nx-X11/programs/Xserver/GL/glx/render2swap.c +++ b/nx-X11/programs/Xserver/GL/glx/render2swap.c @@ -34,7 +34,6 @@ ** */ -/* #define NEED_REPLIES */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/renderpix.c b/nx-X11/programs/Xserver/GL/glx/renderpix.c index fe508e299..2a929ea7c 100644 --- a/nx-X11/programs/Xserver/GL/glx/renderpix.c +++ b/nx-X11/programs/Xserver/GL/glx/renderpix.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/renderpixswap.c b/nx-X11/programs/Xserver/GL/glx/renderpixswap.c index 9c3100fb3..4eef7a546 100644 --- a/nx-X11/programs/Xserver/GL/glx/renderpixswap.c +++ b/nx-X11/programs/Xserver/GL/glx/renderpixswap.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/single2.c b/nx-X11/programs/Xserver/GL/glx/single2.c index cd9c0eeb3..bd7283a95 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2.c +++ b/nx-X11/programs/Xserver/GL/glx/single2.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/single2swap.c b/nx-X11/programs/Xserver/GL/glx/single2swap.c index 7e6c30fea..7d33dd63d 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2swap.c +++ b/nx-X11/programs/Xserver/GL/glx/single2swap.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/singlepix.c b/nx-X11/programs/Xserver/GL/glx/singlepix.c index a156db5d3..157ce3f64 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlepix.c +++ b/nx-X11/programs/Xserver/GL/glx/singlepix.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/singlepixswap.c b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c index 24f2e76e8..c5d53c06e 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlepixswap.c +++ b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/xfont.c b/nx-X11/programs/Xserver/GL/glx/xfont.c index c4995e272..b5869cf44 100644 --- a/nx-X11/programs/Xserver/GL/glx/xfont.c +++ b/nx-X11/programs/Xserver/GL/glx/xfont.c @@ -34,7 +34,6 @@ ** */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/bigreq.c b/nx-X11/programs/Xserver/Xext/bigreq.c index 29f638fe1..67973ab20 100644 --- a/nx-X11/programs/Xserver/Xext/bigreq.c +++ b/nx-X11/programs/Xserver/Xext/bigreq.c @@ -28,7 +28,6 @@ from The Open Group. */ /* $XFree86: xc/programs/Xserver/Xext/bigreq.c,v 3.8 2003/10/28 23:08:43 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index d83f34c2e..3b89f36d6 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -33,7 +33,6 @@ Equipment Corporation. #include #endif -#define NEED_REPLIES #include #include #include diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c index 5cc088c98..563c97a0d 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c @@ -34,8 +34,6 @@ Equipment Corporation. #include #include -#define NEED_REPLIES -#define NEED_EVENTS #include #include "windowstr.h" #include "dixfontstr.h" diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 7cc186591..0b4a467db 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -30,8 +30,6 @@ in this Software without prior written authorization from the X Consortium. /* $XFree86: xc/programs/Xserver/Xext/saver.c,v 3.7 2003/10/28 23:08:43 tsi Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index c90fd8ecd..61a9eb9bf 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -27,8 +27,6 @@ in this Software without prior written authorization from The Open Group. ********************************************************/ /* $Xorg: shape.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index a39aef630..323d3dbfb 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -45,8 +45,6 @@ in this Software without prior written authorization from The Open Group. #endif #include #include -#define NEED_REPLIES -#define NEED_EVENTS #include #include #include "misc.h" diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 3dff56d93..12cb0a6ab 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -52,8 +52,6 @@ PERFORMANCE OF THIS SOFTWARE. */ /* $XFree86: xc/programs/Xserver/Xext/sync.c,v 3.13 2003/09/02 18:19:01 tsi Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c index 534c9ad2f..48117aaf8 100644 --- a/nx-X11/programs/Xserver/Xext/xcmisc.c +++ b/nx-X11/programs/Xserver/Xext/xcmisc.c @@ -28,8 +28,6 @@ from The Open Group. */ /* $XFree86: xc/programs/Xserver/Xext/xcmisc.c,v 3.7 2003/10/28 23:08:43 tsi Exp $ */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c index 8605e4c7e..c4b3a1818 100644 --- a/nx-X11/programs/Xserver/Xext/xres.c +++ b/nx-X11/programs/Xserver/Xext/xres.c @@ -4,8 +4,6 @@ /* $XFree86: xc/programs/Xserver/Xext/xres.c,v 1.7tsi Exp $ */ /* $XdotOrg: xc/programs/Xserver/Xext/xres.c,v 1.7 2005/07/03 08:53:36 daniels Exp $ */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/xtest.c b/nx-X11/programs/Xserver/Xext/xtest.c index c5aef9220..ed3d8ef8d 100644 --- a/nx-X11/programs/Xserver/Xext/xtest.c +++ b/nx-X11/programs/Xserver/Xext/xtest.c @@ -34,7 +34,6 @@ from The Open Group. #endif #include -#define NEED_EVENTS #include #include "misc.h" #include "os.h" diff --git a/nx-X11/programs/Xserver/Xext/xtest1dd.c b/nx-X11/programs/Xserver/Xext/xtest1dd.c index c945fd6bd..35cffeb07 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1dd.c +++ b/nx-X11/programs/Xserver/Xext/xtest1dd.c @@ -58,9 +58,6 @@ University of California. * include files ***************************************************************/ -#define NEED_EVENTS -#define NEED_REPLIES - #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/xtest1di.c b/nx-X11/programs/Xserver/Xext/xtest1di.c index 4aac1824b..e97c7da69 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1di.c +++ b/nx-X11/programs/Xserver/Xext/xtest1di.c @@ -59,9 +59,6 @@ University of California. * include files ****************************************************************************/ -#define NEED_EVENTS -#define NEED_REPLIES - #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c index fa3d1540a..219359331 100644 --- a/nx-X11/programs/Xserver/Xext/xvmc.c +++ b/nx-X11/programs/Xserver/Xext/xvmc.c @@ -1,7 +1,5 @@ /* $XFree86: xc/programs/Xserver/Xext/xvmc.c,v 1.8 2003/07/16 01:38:31 dawes Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/allowev.c b/nx-X11/programs/Xserver/Xi/allowev.c index 06a402b6d..86e813eee 100644 --- a/nx-X11/programs/Xserver/Xi/allowev.c +++ b/nx-X11/programs/Xserver/Xi/allowev.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/chgdctl.c b/nx-X11/programs/Xserver/Xi/chgdctl.c index b462583fd..136e3f700 100644 --- a/nx-X11/programs/Xserver/Xi/chgdctl.c +++ b/nx-X11/programs/Xserver/Xi/chgdctl.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS /* for inputstr.h */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/chgfctl.c b/nx-X11/programs/Xserver/Xi/chgfctl.c index 9483cd295..103e7912c 100644 --- a/nx-X11/programs/Xserver/Xi/chgfctl.c +++ b/nx-X11/programs/Xserver/Xi/chgfctl.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS /* for inputstr.h */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/chgkbd.c b/nx-X11/programs/Xserver/Xi/chgkbd.c index e9466ba8f..94b19122d 100644 --- a/nx-X11/programs/Xserver/Xi/chgkbd.c +++ b/nx-X11/programs/Xserver/Xi/chgkbd.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/chgkmap.c b/nx-X11/programs/Xserver/Xi/chgkmap.c index 52fd9f5eb..20e7f09e1 100644 --- a/nx-X11/programs/Xserver/Xi/chgkmap.c +++ b/nx-X11/programs/Xserver/Xi/chgkmap.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS /* for inputstr.h */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/chgprop.c b/nx-X11/programs/Xserver/Xi/chgprop.c index fead6327c..413149cf1 100644 --- a/nx-X11/programs/Xserver/Xi/chgprop.c +++ b/nx-X11/programs/Xserver/Xi/chgprop.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/chgptr.c b/nx-X11/programs/Xserver/Xi/chgptr.c index 31b3bbd8e..76b0a1193 100644 --- a/nx-X11/programs/Xserver/Xi/chgptr.c +++ b/nx-X11/programs/Xserver/Xi/chgptr.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/closedev.c b/nx-X11/programs/Xserver/Xi/closedev.c index 9452b220b..7ab9ed3c9 100644 --- a/nx-X11/programs/Xserver/Xi/closedev.c +++ b/nx-X11/programs/Xserver/Xi/closedev.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/devbell.c b/nx-X11/programs/Xserver/Xi/devbell.c index c7de6cf10..27a4efca8 100644 --- a/nx-X11/programs/Xserver/Xi/devbell.c +++ b/nx-X11/programs/Xserver/Xi/devbell.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c index 85abd4fee..f3038f0af 100644 --- a/nx-X11/programs/Xserver/Xi/exevents.c +++ b/nx-X11/programs/Xserver/Xi/exevents.c @@ -54,7 +54,6 @@ SOFTWARE. * */ -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/extinit.c b/nx-X11/programs/Xserver/Xi/extinit.c index b3cd029f4..8f371f71b 100644 --- a/nx-X11/programs/Xserver/Xi/extinit.c +++ b/nx-X11/programs/Xserver/Xi/extinit.c @@ -55,8 +55,6 @@ SOFTWARE. #define NUMTYPES 15 -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/getbmap.c b/nx-X11/programs/Xserver/Xi/getbmap.c index 8421e3e5c..59b4c46a8 100644 --- a/nx-X11/programs/Xserver/Xi/getbmap.c +++ b/nx-X11/programs/Xserver/Xi/getbmap.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/getdctl.c b/nx-X11/programs/Xserver/Xi/getdctl.c index 0205d5fe4..cb16fb678 100644 --- a/nx-X11/programs/Xserver/Xi/getdctl.c +++ b/nx-X11/programs/Xserver/Xi/getdctl.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS /* for inputstr.h */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/getfctl.c b/nx-X11/programs/Xserver/Xi/getfctl.c index 6640e8481..d5a3b069d 100644 --- a/nx-X11/programs/Xserver/Xi/getfctl.c +++ b/nx-X11/programs/Xserver/Xi/getfctl.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS /* for inputstr.h */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/getfocus.c b/nx-X11/programs/Xserver/Xi/getfocus.c index 41c2a6e25..356c84efd 100644 --- a/nx-X11/programs/Xserver/Xi/getfocus.c +++ b/nx-X11/programs/Xserver/Xi/getfocus.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/getkmap.c b/nx-X11/programs/Xserver/Xi/getkmap.c index 44f91868f..7850218a6 100644 --- a/nx-X11/programs/Xserver/Xi/getkmap.c +++ b/nx-X11/programs/Xserver/Xi/getkmap.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS /* for inputstr.h */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/getmmap.c b/nx-X11/programs/Xserver/Xi/getmmap.c index 375f6f2e3..4aba7a32e 100644 --- a/nx-X11/programs/Xserver/Xi/getmmap.c +++ b/nx-X11/programs/Xserver/Xi/getmmap.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS /* for inputstr.h */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/getprop.c b/nx-X11/programs/Xserver/Xi/getprop.c index a19824155..17b35deb5 100644 --- a/nx-X11/programs/Xserver/Xi/getprop.c +++ b/nx-X11/programs/Xserver/Xi/getprop.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/getselev.c b/nx-X11/programs/Xserver/Xi/getselev.c index 7e1f42af2..da3b11040 100644 --- a/nx-X11/programs/Xserver/Xi/getselev.c +++ b/nx-X11/programs/Xserver/Xi/getselev.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/getvers.c b/nx-X11/programs/Xserver/Xi/getvers.c index 3a33d207b..684f3f18d 100644 --- a/nx-X11/programs/Xserver/Xi/getvers.c +++ b/nx-X11/programs/Xserver/Xi/getvers.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/grabdev.c b/nx-X11/programs/Xserver/Xi/grabdev.c index 07099bc63..1f9c12063 100644 --- a/nx-X11/programs/Xserver/Xi/grabdev.c +++ b/nx-X11/programs/Xserver/Xi/grabdev.c @@ -54,8 +54,6 @@ SOFTWARE. */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/grabdevb.c b/nx-X11/programs/Xserver/Xi/grabdevb.c index c74c65fc4..6e722006b 100644 --- a/nx-X11/programs/Xserver/Xi/grabdevb.c +++ b/nx-X11/programs/Xserver/Xi/grabdevb.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/grabdevk.c b/nx-X11/programs/Xserver/Xi/grabdevk.c index 1dff73f40..b6233c6c8 100644 --- a/nx-X11/programs/Xserver/Xi/grabdevk.c +++ b/nx-X11/programs/Xserver/Xi/grabdevk.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/gtmotion.c b/nx-X11/programs/Xserver/Xi/gtmotion.c index 3cc72c7ea..834484508 100644 --- a/nx-X11/programs/Xserver/Xi/gtmotion.c +++ b/nx-X11/programs/Xserver/Xi/gtmotion.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/listdev.c b/nx-X11/programs/Xserver/Xi/listdev.c index 0bf09c7c3..e6e1ce1ad 100644 --- a/nx-X11/programs/Xserver/Xi/listdev.c +++ b/nx-X11/programs/Xserver/Xi/listdev.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/opendev.c b/nx-X11/programs/Xserver/Xi/opendev.c index 0be0b36c5..5a6ec1242 100644 --- a/nx-X11/programs/Xserver/Xi/opendev.c +++ b/nx-X11/programs/Xserver/Xi/opendev.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/queryst.c b/nx-X11/programs/Xserver/Xi/queryst.c index d26b25be9..ac0328fad 100644 --- a/nx-X11/programs/Xserver/Xi/queryst.c +++ b/nx-X11/programs/Xserver/Xi/queryst.c @@ -34,8 +34,6 @@ from The Open Group. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/selectev.c b/nx-X11/programs/Xserver/Xi/selectev.c index 1a1000f61..0fa464bab 100644 --- a/nx-X11/programs/Xserver/Xi/selectev.c +++ b/nx-X11/programs/Xserver/Xi/selectev.c @@ -53,9 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES - #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/sendexev.c b/nx-X11/programs/Xserver/Xi/sendexev.c index 64191001f..56431fa42 100644 --- a/nx-X11/programs/Xserver/Xi/sendexev.c +++ b/nx-X11/programs/Xserver/Xi/sendexev.c @@ -54,8 +54,6 @@ SOFTWARE. */ #define EXTENSION_EVENT_BASE 64 -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/setbmap.c b/nx-X11/programs/Xserver/Xi/setbmap.c index 050a14ad3..bbd4fbc46 100644 --- a/nx-X11/programs/Xserver/Xi/setbmap.c +++ b/nx-X11/programs/Xserver/Xi/setbmap.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #define IsOn(ptr, bit) \ (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))) diff --git a/nx-X11/programs/Xserver/Xi/setdval.c b/nx-X11/programs/Xserver/Xi/setdval.c index f59577ac3..3da1ca38e 100644 --- a/nx-X11/programs/Xserver/Xi/setdval.c +++ b/nx-X11/programs/Xserver/Xi/setdval.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/setfocus.c b/nx-X11/programs/Xserver/Xi/setfocus.c index 180fb835e..09008ab88 100644 --- a/nx-X11/programs/Xserver/Xi/setfocus.c +++ b/nx-X11/programs/Xserver/Xi/setfocus.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/setmmap.c b/nx-X11/programs/Xserver/Xi/setmmap.c index 7fa5d25f9..8bedb2050 100644 --- a/nx-X11/programs/Xserver/Xi/setmmap.c +++ b/nx-X11/programs/Xserver/Xi/setmmap.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS /* for inputstr.h */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/setmode.c b/nx-X11/programs/Xserver/Xi/setmode.c index ea6e0826f..20985850f 100644 --- a/nx-X11/programs/Xserver/Xi/setmode.c +++ b/nx-X11/programs/Xserver/Xi/setmode.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/stubs.c b/nx-X11/programs/Xserver/Xi/stubs.c index 33c55d3b7..8e0d75f3e 100644 --- a/nx-X11/programs/Xserver/Xi/stubs.c +++ b/nx-X11/programs/Xserver/Xi/stubs.c @@ -57,7 +57,6 @@ SOFTWARE. * Xnest could do the same thing. */ -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/ungrdev.c b/nx-X11/programs/Xserver/Xi/ungrdev.c index a0611d53b..6cc6511d7 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdev.c +++ b/nx-X11/programs/Xserver/Xi/ungrdev.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/ungrdevb.c b/nx-X11/programs/Xserver/Xi/ungrdevb.c index dd770064d..cc3986931 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdevb.c +++ b/nx-X11/programs/Xserver/Xi/ungrdevb.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xi/ungrdevk.c b/nx-X11/programs/Xserver/Xi/ungrdevk.c index fcb470eaa..ac47d505e 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdevk.c +++ b/nx-X11/programs/Xserver/Xi/ungrdevk.c @@ -53,8 +53,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/damageext/damageextint.h b/nx-X11/programs/Xserver/damageext/damageextint.h index 0021dda9d..ba9212eba 100644 --- a/nx-X11/programs/Xserver/damageext/damageextint.h +++ b/nx-X11/programs/Xserver/damageext/damageextint.h @@ -29,7 +29,6 @@ #ifndef _DAMAGEEXTINT_H_ #define _DAMAGEEXTINT_H_ -#define NEED_EVENTS #include #include #include "misc.h" diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index b35a19969..3dff2cf06 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -36,7 +36,6 @@ /* INCLUDES */ -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/dbe/midbe.c b/nx-X11/programs/Xserver/dbe/midbe.c index c83b42771..c01500cdc 100644 --- a/nx-X11/programs/Xserver/dbe/midbe.c +++ b/nx-X11/programs/Xserver/dbe/midbe.c @@ -35,8 +35,6 @@ /* INCLUDES */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index 44095b729..7e586a0db 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -54,7 +54,6 @@ SOFTWARE. #endif #include -#define NEED_EVENTS #include #include "misc.h" #include "dix.h" diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index ccce2324b..1eccae567 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -57,8 +57,6 @@ SOFTWARE. #include #include "misc.h" #include "resource.h" -#define NEED_EVENTS -#define NEED_REPLIES #include #include "windowstr.h" #include "inputstr.h" diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index 421345ef6..b6c363798 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -51,7 +51,6 @@ Equipment Corporation. ******************************************************************/ /* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index d06d9b823..ed2e331dc 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -118,8 +118,6 @@ of the copyright holder. #include #include "misc.h" #include "resource.h" -#define NEED_EVENTS -#define NEED_REPLIES #include #include "windowstr.h" #include "inputstr.h" diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c index b0859757b..fc52b4c65 100644 --- a/nx-X11/programs/Xserver/dix/extension.c +++ b/nx-X11/programs/Xserver/dix/extension.c @@ -52,8 +52,6 @@ SOFTWARE. #endif #include -#define NEED_EVENTS -#define NEED_REPLIES #include #include "misc.h" #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/dix/grabs.c b/nx-X11/programs/Xserver/dix/grabs.c index d72ef3f6a..50e060e7e 100644 --- a/nx-X11/programs/Xserver/dix/grabs.c +++ b/nx-X11/programs/Xserver/dix/grabs.c @@ -54,7 +54,6 @@ SOFTWARE. #include #include "misc.h" -#define NEED_EVENTS #include #include "windowstr.h" #include "inputstr.h" diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c index de53a6593..20b635c19 100644 --- a/nx-X11/programs/Xserver/dix/main.c +++ b/nx-X11/programs/Xserver/dix/main.c @@ -79,7 +79,6 @@ Equipment Corporation. /* $TOG: main.c /main/86 1998/02/09 14:20:03 kaleb $ */ -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index 7ed66b60a..527a2e91a 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -52,8 +52,6 @@ SOFTWARE. #endif #include -#define NEED_REPLIES -#define NEED_EVENTS #include #include "windowstr.h" #include "propertyst.h" diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index 40a063891..7cf5a470e 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -101,7 +101,6 @@ Equipment Corporation. */ /* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.13 2003/09/24 02:43:13 dawes Exp $ */ -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/dix/swaprep.c b/nx-X11/programs/Xserver/dix/swaprep.c index cd6663333..5f538e6bd 100644 --- a/nx-X11/programs/Xserver/dix/swaprep.c +++ b/nx-X11/programs/Xserver/dix/swaprep.c @@ -53,8 +53,6 @@ SOFTWARE. #endif #include -#define NEED_REPLIES -#define NEED_EVENTS #include #include "misc.h" #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/dix/swapreq.c b/nx-X11/programs/Xserver/dix/swapreq.c index e5ac71710..16ff026a2 100644 --- a/nx-X11/programs/Xserver/dix/swapreq.c +++ b/nx-X11/programs/Xserver/dix/swapreq.c @@ -53,7 +53,6 @@ SOFTWARE. #endif #include -#define NEED_EVENTS #include #include #include "misc.h" diff --git a/nx-X11/programs/Xserver/dix/tables.c b/nx-X11/programs/Xserver/dix/tables.c index df15de7d1..2a2146ce9 100644 --- a/nx-X11/programs/Xserver/dix/tables.c +++ b/nx-X11/programs/Xserver/dix/tables.c @@ -52,8 +52,6 @@ SOFTWARE. #endif #include -#define NEED_EVENTS -#define NEED_REPLIES #include #include "windowstr.h" #include "extnsionst.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 2fb53d440..2fe9dfbc9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -15,8 +15,6 @@ /* */ /**************************************************************************/ -#define NEED_EVENTS - #include "X.h" #include "Xproto.h" #include "Xatom.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 52b869f71..d94a76a21 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -18,7 +18,6 @@ #include "X.h" #include "signal.h" #include "unistd.h" -#define NEED_EVENTS #include "Xproto.h" #include "screenint.h" #include "input.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index e85cdfdb6..921aa73a0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -34,7 +34,6 @@ is" without express or implied warranty. #include #include -#define NEED_EVENTS #include "X.h" #include "Xproto.h" #include "keysym.h" diff --git a/nx-X11/programs/Xserver/include/closestr.h b/nx-X11/programs/Xserver/include/closestr.h index 31b5693f5..89660a1dc 100644 --- a/nx-X11/programs/Xserver/include/closestr.h +++ b/nx-X11/programs/Xserver/include/closestr.h @@ -32,7 +32,6 @@ from The Open Group. #ifndef CLOSESTR_H #define CLOSESTR_H -#define NEED_REPLIES #include #include "closure.h" #include "dix.h" diff --git a/nx-X11/programs/Xserver/include/dixfontstr.h b/nx-X11/programs/Xserver/include/dixfontstr.h index 09a162451..99b020df5 100644 --- a/nx-X11/programs/Xserver/include/dixfontstr.h +++ b/nx-X11/programs/Xserver/include/dixfontstr.h @@ -29,7 +29,6 @@ SOFTWARE. #include "dixfont.h" #include #include "closure.h" -#define NEED_REPLIES #include /* for xQueryFontReply */ #define FONTCHARSET(font) (font) diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index 13415177c..16771615c 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -44,7 +44,6 @@ implied warranty. /* $XFree86: xc/programs/Xserver/mi/mibstore.c,v 1.10tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/midispcur.c b/nx-X11/programs/Xserver/mi/midispcur.c index 4d5e055eb..24d964080 100644 --- a/nx-X11/programs/Xserver/mi/midispcur.c +++ b/nx-X11/programs/Xserver/mi/midispcur.c @@ -36,7 +36,6 @@ in this Software without prior written authorization from The Open Group. #include #endif -#define NEED_EVENTS # include # include "misc.h" # include "input.h" diff --git a/nx-X11/programs/Xserver/mi/mieq.c b/nx-X11/programs/Xserver/mi/mieq.c index 14784433d..d41da1c09 100644 --- a/nx-X11/programs/Xserver/mi/mieq.c +++ b/nx-X11/programs/Xserver/mi/mieq.c @@ -34,7 +34,6 @@ in this Software without prior written authorization from The Open Group. * */ -# define NEED_EVENTS # include # include # include diff --git a/nx-X11/programs/Xserver/mi/miexpose.c b/nx-X11/programs/Xserver/mi/miexpose.c index d256c293f..e55e712d6 100644 --- a/nx-X11/programs/Xserver/mi/miexpose.c +++ b/nx-X11/programs/Xserver/mi/miexpose.c @@ -81,7 +81,6 @@ Equipment Corporation. #endif #include -#define NEED_EVENTS #include #include diff --git a/nx-X11/programs/Xserver/mi/mipointer.c b/nx-X11/programs/Xserver/mi/mipointer.c index 3e9fd0760..d86c27e75 100644 --- a/nx-X11/programs/Xserver/mi/mipointer.c +++ b/nx-X11/programs/Xserver/mi/mipointer.c @@ -34,7 +34,6 @@ in this Software without prior written authorization from The Open Group. #include #endif -# define NEED_EVENTS # include # include # include diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index 470d1bec2..557138a7a 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -77,7 +77,6 @@ SOFTWARE. #endif #endif #include -#define NEED_REPLIES #include #include "os.h" #include "osdep.h" diff --git a/nx-X11/programs/Xserver/randr/randr.c b/nx-X11/programs/Xserver/randr/randr.c index 8ff3f9c75..4c8576633 100644 --- a/nx-X11/programs/Xserver/randr/randr.c +++ b/nx-X11/programs/Xserver/randr/randr.c @@ -42,8 +42,6 @@ /* */ /**************************************************************************/ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index 7417f79b9..024cad2d5 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -35,7 +35,6 @@ and Jim Haggerty of Metheus. */ /* $XFree86: xc/programs/Xserver/record/record.c,v 1.11 2003/11/03 05:12:01 tsi Exp $ */ -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 764874507..d2312aaef 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -24,8 +24,6 @@ * Author: Keith Packard, SuSE, Inc. */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/xfixes/xfixesint.h b/nx-X11/programs/Xserver/xfixes/xfixesint.h index a883acaec..70550f5f1 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixesint.h +++ b/nx-X11/programs/Xserver/xfixes/xfixesint.h @@ -29,7 +29,6 @@ #ifndef _XFIXESINT_H_ #define _XFIXESINT_H_ -#define NEED_EVENTS #include #include #include "misc.h" diff --git a/nx-X11/programs/Xserver/xkb/ddxBeep.c b/nx-X11/programs/Xserver/xkb/ddxBeep.c index e99e4c2dd..d2bd0c90e 100644 --- a/nx-X11/programs/Xserver/xkb/ddxBeep.c +++ b/nx-X11/programs/Xserver/xkb/ddxBeep.c @@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxConfig.c b/nx-X11/programs/Xserver/xkb/ddxConfig.c index 8ffd344ca..81797839e 100644 --- a/nx-X11/programs/Xserver/xkb/ddxConfig.c +++ b/nx-X11/programs/Xserver/xkb/ddxConfig.c @@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxCtrls.c b/nx-X11/programs/Xserver/xkb/ddxCtrls.c index 9fee8aa30..a6c0878cb 100644 --- a/nx-X11/programs/Xserver/xkb/ddxCtrls.c +++ b/nx-X11/programs/Xserver/xkb/ddxCtrls.c @@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxDevBtn.c b/nx-X11/programs/Xserver/xkb/ddxDevBtn.c index 04094e787..4d5d4f0ac 100644 --- a/nx-X11/programs/Xserver/xkb/ddxDevBtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxDevBtn.c @@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c b/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c index b77d040ff..a599b44f6 100644 --- a/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c @@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c b/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c index 7f096683b..894633c3c 100644 --- a/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c @@ -32,7 +32,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxInit.c b/nx-X11/programs/Xserver/xkb/ddxInit.c index 00ffea14e..675ca0d01 100644 --- a/nx-X11/programs/Xserver/xkb/ddxInit.c +++ b/nx-X11/programs/Xserver/xkb/ddxInit.c @@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxKeyClick.c b/nx-X11/programs/Xserver/xkb/ddxKeyClick.c index e56377ca5..882534bb7 100644 --- a/nx-X11/programs/Xserver/xkb/ddxKeyClick.c +++ b/nx-X11/programs/Xserver/xkb/ddxKeyClick.c @@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c b/nx-X11/programs/Xserver/xkb/ddxKillSrv.c index 44fad85ca..91c7fe064 100644 --- a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c +++ b/nx-X11/programs/Xserver/xkb/ddxKillSrv.c @@ -35,7 +35,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxLEDs.c b/nx-X11/programs/Xserver/xkb/ddxLEDs.c index 92ab12ee8..269b9c05b 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLEDs.c +++ b/nx-X11/programs/Xserver/xkb/ddxLEDs.c @@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c index 90ac3d892..b14ad308f 100644 --- a/nx-X11/programs/Xserver/xkb/ddxList.c +++ b/nx-X11/programs/Xserver/xkb/ddxList.c @@ -32,7 +32,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c index 9134e4754..45140dfea 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c +++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c @@ -43,7 +43,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/ddxPrivate.c b/nx-X11/programs/Xserver/xkb/ddxPrivate.c index c71216d70..ce09038a0 100644 --- a/nx-X11/programs/Xserver/xkb/ddxPrivate.c +++ b/nx-X11/programs/Xserver/xkb/ddxPrivate.c @@ -9,7 +9,6 @@ #endif #include -#define NEED_EVENTS 1 #include #include "windowstr.h" #define XKBSRV_NEED_FILE_FUNCS diff --git a/nx-X11/programs/Xserver/xkb/ddxVT.c b/nx-X11/programs/Xserver/xkb/ddxVT.c index 1806ed257..4b95aa625 100644 --- a/nx-X11/programs/Xserver/xkb/ddxVT.c +++ b/nx-X11/programs/Xserver/xkb/ddxVT.c @@ -35,7 +35,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 52c5d36bf..a58b02e00 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -32,8 +32,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS -#define NEED_REPLIES #include #include "misc.h" #include "inputstr.h" diff --git a/nx-X11/programs/Xserver/xkb/xkbAccessX.c b/nx-X11/programs/Xserver/xkb/xkbAccessX.c index ac5713d05..2fc5eae81 100644 --- a/nx-X11/programs/Xserver/xkb/xkbAccessX.c +++ b/nx-X11/programs/Xserver/xkb/xkbAccessX.c @@ -35,7 +35,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifdef __QNX__ #include #endif -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/xkbActions.c b/nx-X11/programs/Xserver/xkb/xkbActions.c index 7bc6b3476..c6714ef9f 100644 --- a/nx-X11/programs/Xserver/xkb/xkbActions.c +++ b/nx-X11/programs/Xserver/xkb/xkbActions.c @@ -33,7 +33,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/xkbEvents.c b/nx-X11/programs/Xserver/xkb/xkbEvents.c index 7c392abe5..f1089f313 100644 --- a/nx-X11/programs/Xserver/xkb/xkbEvents.c +++ b/nx-X11/programs/Xserver/xkb/xkbEvents.c @@ -31,7 +31,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/xkbInit.c b/nx-X11/programs/Xserver/xkb/xkbInit.c index bd65c4d97..bb599984a 100644 --- a/nx-X11/programs/Xserver/xkb/xkbInit.c +++ b/nx-X11/programs/Xserver/xkb/xkbInit.c @@ -40,7 +40,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/xkbLEDs.c b/nx-X11/programs/Xserver/xkb/xkbLEDs.c index 20203ef2c..a9e43d87c 100644 --- a/nx-X11/programs/Xserver/xkb/xkbLEDs.c +++ b/nx-X11/programs/Xserver/xkb/xkbLEDs.c @@ -33,7 +33,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#define NEED_EVENTS 1 #include #include #include "misc.h" diff --git a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c index 330fd2800..34bc65f8a 100644 --- a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c +++ b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c @@ -32,7 +32,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c b/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c index ac601c525..e2709113a 100644 --- a/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c +++ b/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c @@ -32,7 +32,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS 1 #include #include #include diff --git a/nx-X11/programs/Xserver/xkb/xkbSwap.c b/nx-X11/programs/Xserver/xkb/xkbSwap.c index 1aaff519e..1482c028e 100644 --- a/nx-X11/programs/Xserver/xkb/xkbSwap.c +++ b/nx-X11/programs/Xserver/xkb/xkbSwap.c @@ -32,8 +32,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "stdio.h" #include -#define NEED_EVENTS -#define NEED_REPLIES #include #include "misc.h" #include "inputstr.h" diff --git a/nx-X11/programs/Xserver/xkb/xkbUtils.c b/nx-X11/programs/Xserver/xkb/xkbUtils.c index 465644f16..1f1c8cf72 100644 --- a/nx-X11/programs/Xserver/xkb/xkbUtils.c +++ b/nx-X11/programs/Xserver/xkb/xkbUtils.c @@ -33,7 +33,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#define NEED_EVENTS 1 #include #include #define XK_CYRILLIC diff --git a/nxcompext/NXlib.c b/nxcompext/NXlib.c index 452213bf1..c705d977d 100644 --- a/nxcompext/NXlib.c +++ b/nxcompext/NXlib.c @@ -26,8 +26,6 @@ #include "dix.h" #include "os.h" -#define NEED_REPLIES - /* * Needed to enable definition of the callback * functions. -- cgit v1.2.3 From 6144b615dd7ae2acd786aaa08f66c9743870b709 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 5 Jul 2016 16:32:57 +0200 Subject: VCS info lines: Remove ancient X.org / XFree86 VCS info line from code files. This has already been started while replacing copyright info in file headers and has now been completed with this commit. --- nx-X11/config/cf/cross.def | 1 - nx-X11/extras/Mesa/include/GL/internal/glcore.h | 1 - nx-X11/extras/Mesa/src/glx/x11/compsize.c | 1 - nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c | 1 - nx-X11/extras/Mesa/src/mesa/main/enums.h | 1 - nx-X11/include/DECkeysym.h | 1 - nx-X11/include/GL/glu.h | 1 - nx-X11/include/GL/glx.h | 1 - nx-X11/include/GL/glxint.h | 1 - nx-X11/include/GL/glxmd.h | 1 - nx-X11/include/GL/glxproto.h | 1 - nx-X11/include/GL/glxtokens.h | 1 - nx-X11/include/HPkeysym.h | 1 - nx-X11/include/Sunkeysym.h | 1 - nx-X11/include/X.h | 1 - nx-X11/include/XF86keysym.h | 1 - nx-X11/include/XWDFile.h | 1 - nx-X11/include/Xalloca.h | 2 -- nx-X11/include/Xarch.h | 1 - nx-X11/include/Xauth.h | 2 -- nx-X11/include/Xdefs.h | 1 - nx-X11/include/Xfuncproto.h | 2 -- nx-X11/include/Xfuncs.h | 1 - nx-X11/include/Xmd.h | 2 -- nx-X11/include/Xos.h | 1 - nx-X11/include/Xos_r.h | 3 --- nx-X11/include/Xosdefs.h | 1 - nx-X11/include/Xprotostr.h | 1 - nx-X11/include/Xthreads.h | 1 - nx-X11/include/Xw32defs.h | 1 - nx-X11/include/Xwinsock.h | 1 - nx-X11/include/extensions/XI.h | 2 -- nx-X11/include/extensions/XInput.h | 2 -- nx-X11/include/extensions/XIproto.h | 2 -- nx-X11/include/extensions/XKB.h | 2 -- nx-X11/include/extensions/XKBgeom.h | 2 -- nx-X11/include/extensions/XKBproto.h | 1 - nx-X11/include/extensions/XKBsrv.h | 3 --- nx-X11/include/extensions/XKBstr.h | 1 - nx-X11/include/extensions/XResproto.h | 1 - nx-X11/include/extensions/Xdbeproto.h | 1 - nx-X11/include/extensions/Xv.h | 1 - nx-X11/include/extensions/XvMC.h | 1 - nx-X11/include/extensions/XvMClib.h | 2 -- nx-X11/include/extensions/XvMCproto.h | 1 - nx-X11/include/extensions/Xvlib.h | 1 - nx-X11/include/extensions/Xvproto.h | 1 - nx-X11/include/extensions/bigreqstr.h | 1 - nx-X11/include/extensions/dpms.h | 2 -- nx-X11/include/extensions/dpmsstr.h | 1 - nx-X11/include/extensions/panoramiXext.h | 2 -- nx-X11/include/extensions/panoramiXproto.h | 2 -- nx-X11/include/extensions/security.h | 2 -- nx-X11/include/extensions/securstr.h | 2 -- nx-X11/include/extensions/sync.h | 2 -- nx-X11/include/extensions/syncstr.h | 2 -- nx-X11/include/extensions/xcmiscstr.h | 1 - nx-X11/include/extensions/xf86bigfont.h | 1 - nx-X11/include/extensions/xf86bigfstr.h | 1 - nx-X11/include/extensions/xtestext1.h | 1 - nx-X11/include/extensions/xteststr.h | 1 - nx-X11/include/keysym.h | 2 -- nx-X11/include/keysymdef.h | 2 -- nx-X11/lib/X11/AddDIC.c | 1 - nx-X11/lib/X11/AddSF.c | 1 - nx-X11/lib/X11/AllCells.c | 1 - nx-X11/lib/X11/AllPlanes.c | 2 -- nx-X11/lib/X11/AllowEv.c | 2 -- nx-X11/lib/X11/AuDispose.c | 2 -- nx-X11/lib/X11/AuFileName.c | 2 -- nx-X11/lib/X11/AuGetBest.c | 2 -- nx-X11/lib/X11/AuRead.c | 2 -- nx-X11/lib/X11/AutoRep.c | 2 -- nx-X11/lib/X11/Backgnd.c | 2 -- nx-X11/lib/X11/BdrWidth.c | 2 -- nx-X11/lib/X11/Bell.c | 2 -- nx-X11/lib/X11/Border.c | 2 -- nx-X11/lib/X11/CCC.c | 2 -- nx-X11/lib/X11/ChAccCon.c | 2 -- nx-X11/lib/X11/ChActPGb.c | 2 -- nx-X11/lib/X11/ChClMode.c | 2 -- nx-X11/lib/X11/ChCmap.c | 2 -- nx-X11/lib/X11/ChGC.c | 2 -- nx-X11/lib/X11/ChKeyCon.c | 2 -- nx-X11/lib/X11/ChPntCon.c | 2 -- nx-X11/lib/X11/ChProp.c | 2 -- nx-X11/lib/X11/ChSaveSet.c | 2 -- nx-X11/lib/X11/ChWAttrs.c | 2 -- nx-X11/lib/X11/ChWindow.c | 2 -- nx-X11/lib/X11/ChkIfEv.c | 1 - nx-X11/lib/X11/ChkMaskEv.c | 2 -- nx-X11/lib/X11/ChkTypEv.c | 2 -- nx-X11/lib/X11/ChkTypWEv.c | 2 -- nx-X11/lib/X11/ChkWinEv.c | 2 -- nx-X11/lib/X11/CirWin.c | 2 -- nx-X11/lib/X11/CirWinDn.c | 2 -- nx-X11/lib/X11/CirWinUp.c | 2 -- nx-X11/lib/X11/ClDisplay.c | 2 -- nx-X11/lib/X11/Clear.c | 2 -- nx-X11/lib/X11/ClearArea.c | 2 -- nx-X11/lib/X11/ConfWind.c | 2 -- nx-X11/lib/X11/Context.c | 2 -- nx-X11/lib/X11/ConvSel.c | 2 -- nx-X11/lib/X11/CopyArea.c | 2 -- nx-X11/lib/X11/CopyCmap.c | 2 -- nx-X11/lib/X11/CopyGC.c | 2 -- nx-X11/lib/X11/CopyPlane.c | 2 -- nx-X11/lib/X11/CrBFData.c | 1 - nx-X11/lib/X11/CrCmap.c | 2 -- nx-X11/lib/X11/CrCursor.c | 1 - nx-X11/lib/X11/CrGC.c | 2 -- nx-X11/lib/X11/CrGlCur.c | 2 -- nx-X11/lib/X11/CrPFBData.c | 1 - nx-X11/lib/X11/CrPixmap.c | 1 - nx-X11/lib/X11/CrWindow.c | 1 - nx-X11/lib/X11/Cursor.c | 2 -- nx-X11/lib/X11/Cv.h | 1 - nx-X11/lib/X11/CvColW.c | 2 -- nx-X11/lib/X11/CvCols.c | 2 -- nx-X11/lib/X11/DefCursor.c | 2 -- nx-X11/lib/X11/DelProp.c | 2 -- nx-X11/lib/X11/Depths.c | 1 - nx-X11/lib/X11/DestSubs.c | 2 -- nx-X11/lib/X11/DestWind.c | 2 -- nx-X11/lib/X11/DisName.c | 1 - nx-X11/lib/X11/DrArc.c | 2 -- nx-X11/lib/X11/DrArcs.c | 2 -- nx-X11/lib/X11/DrLine.c | 2 -- nx-X11/lib/X11/DrLines.c | 2 -- nx-X11/lib/X11/DrPoint.c | 2 -- nx-X11/lib/X11/DrPoints.c | 2 -- nx-X11/lib/X11/DrRect.c | 2 -- nx-X11/lib/X11/DrRects.c | 2 -- nx-X11/lib/X11/DrSegs.c | 2 -- nx-X11/lib/X11/ErrDes.c | 1 - nx-X11/lib/X11/ErrHndlr.c | 2 -- nx-X11/lib/X11/EvToWire.c | 2 -- nx-X11/lib/X11/FSSaver.c | 2 -- nx-X11/lib/X11/FSWrap.c | 2 -- nx-X11/lib/X11/FetchName.c | 1 - nx-X11/lib/X11/FillArc.c | 2 -- nx-X11/lib/X11/FillArcs.c | 2 -- nx-X11/lib/X11/FillPoly.c | 2 -- nx-X11/lib/X11/FillRct.c | 2 -- nx-X11/lib/X11/FillRcts.c | 2 -- nx-X11/lib/X11/FilterEv.c | 2 -- nx-X11/lib/X11/Flush.c | 2 -- nx-X11/lib/X11/Font.c | 2 -- nx-X11/lib/X11/FontInfo.c | 2 -- nx-X11/lib/X11/FontNames.c | 2 -- nx-X11/lib/X11/FreeCmap.c | 2 -- nx-X11/lib/X11/FreeCols.c | 2 -- nx-X11/lib/X11/FreeCurs.c | 2 -- nx-X11/lib/X11/FreeEData.c | 2 -- nx-X11/lib/X11/FreeGC.c | 2 -- nx-X11/lib/X11/FreePix.c | 2 -- nx-X11/lib/X11/GCMisc.c | 2 -- nx-X11/lib/X11/Geom.c | 1 - nx-X11/lib/X11/GetAtomNm.c | 2 -- nx-X11/lib/X11/GetColor.c | 2 -- nx-X11/lib/X11/GetDflt.c | 2 -- nx-X11/lib/X11/GetFPath.c | 2 -- nx-X11/lib/X11/GetFProp.c | 1 - nx-X11/lib/X11/GetGCVals.c | 1 - nx-X11/lib/X11/GetGeom.c | 1 - nx-X11/lib/X11/GetHColor.c | 1 - nx-X11/lib/X11/GetHints.c | 2 -- nx-X11/lib/X11/GetIFocus.c | 2 -- nx-X11/lib/X11/GetImage.c | 2 -- nx-X11/lib/X11/GetKCnt.c | 2 -- nx-X11/lib/X11/GetMoEv.c | 1 - nx-X11/lib/X11/GetNrmHint.c | 1 - nx-X11/lib/X11/GetPCnt.c | 2 -- nx-X11/lib/X11/GetPntMap.c | 2 -- nx-X11/lib/X11/GetProp.c | 2 -- nx-X11/lib/X11/GetRGBCMap.c | 1 - nx-X11/lib/X11/GetSOwner.c | 1 - nx-X11/lib/X11/GetSSaver.c | 2 -- nx-X11/lib/X11/GetStCmap.c | 1 - nx-X11/lib/X11/GetTxtProp.c | 1 - nx-X11/lib/X11/GetWAttrs.c | 1 - nx-X11/lib/X11/GetWMCMapW.c | 1 - nx-X11/lib/X11/GetWMProto.c | 1 - nx-X11/lib/X11/GrButton.c | 2 -- nx-X11/lib/X11/GrKey.c | 2 -- nx-X11/lib/X11/GrKeybd.c | 1 - nx-X11/lib/X11/GrPointer.c | 1 - nx-X11/lib/X11/GrServer.c | 2 -- nx-X11/lib/X11/HVC.c | 3 --- nx-X11/lib/X11/HVCGcC.c | 2 -- nx-X11/lib/X11/HVCGcV.c | 2 -- nx-X11/lib/X11/HVCGcVC.c | 2 -- nx-X11/lib/X11/HVCMnV.c | 1 - nx-X11/lib/X11/HVCMxC.c | 2 -- nx-X11/lib/X11/HVCMxV.c | 2 -- nx-X11/lib/X11/HVCMxVC.c | 1 - nx-X11/lib/X11/HVCMxVs.c | 2 -- nx-X11/lib/X11/HVCWpAj.c | 1 - nx-X11/lib/X11/Host.c | 3 --- nx-X11/lib/X11/ICWrap.c | 1 - nx-X11/lib/X11/IMWrap.c | 1 - nx-X11/lib/X11/Iconify.c | 1 - nx-X11/lib/X11/IdOfPr.c | 1 - nx-X11/lib/X11/IfEvent.c | 2 -- nx-X11/lib/X11/ImText.c | 2 -- nx-X11/lib/X11/ImText16.c | 2 -- nx-X11/lib/X11/ImUtil.c | 2 -- nx-X11/lib/X11/ImUtil.h | 1 - nx-X11/lib/X11/InitExt.c | 2 -- nx-X11/lib/X11/InsCmap.c | 2 -- nx-X11/lib/X11/IntAtom.c | 2 -- nx-X11/lib/X11/KeyBind.c | 2 -- nx-X11/lib/X11/KeysymStr.c | 2 -- nx-X11/lib/X11/KillCl.c | 2 -- nx-X11/lib/X11/LRGB.c | 2 -- nx-X11/lib/X11/Lab.c | 2 -- nx-X11/lib/X11/LabGcC.c | 2 -- nx-X11/lib/X11/LabGcL.c | 2 -- nx-X11/lib/X11/LabGcLC.c | 2 -- nx-X11/lib/X11/LabMnL.c | 2 -- nx-X11/lib/X11/LabMxC.c | 2 -- nx-X11/lib/X11/LabMxL.c | 2 -- nx-X11/lib/X11/LabMxLC.c | 1 - nx-X11/lib/X11/LabWpAj.c | 1 - nx-X11/lib/X11/LiHosts.c | 2 -- nx-X11/lib/X11/LiICmaps.c | 2 -- nx-X11/lib/X11/LiProps.c | 2 -- nx-X11/lib/X11/ListExt.c | 2 -- nx-X11/lib/X11/LoadFont.c | 2 -- nx-X11/lib/X11/LockDis.c | 1 - nx-X11/lib/X11/LookupCol.c | 2 -- nx-X11/lib/X11/LowerWin.c | 2 -- nx-X11/lib/X11/Luv.c | 2 -- nx-X11/lib/X11/LuvGcC.c | 2 -- nx-X11/lib/X11/LuvGcL.c | 2 -- nx-X11/lib/X11/LuvGcLC.c | 2 -- nx-X11/lib/X11/LuvMnL.c | 2 -- nx-X11/lib/X11/LuvMxC.c | 2 -- nx-X11/lib/X11/LuvMxL.c | 2 -- nx-X11/lib/X11/LuvMxLC.c | 1 - nx-X11/lib/X11/LuvWpAj.c | 1 - nx-X11/lib/X11/Macros.c | 2 -- nx-X11/lib/X11/MapRaised.c | 2 -- nx-X11/lib/X11/MapSubs.c | 2 -- nx-X11/lib/X11/MapWindow.c | 2 -- nx-X11/lib/X11/MaskEvent.c | 2 -- nx-X11/lib/X11/Misc.c | 2 -- nx-X11/lib/X11/ModMap.c | 2 -- nx-X11/lib/X11/MoveWin.c | 2 -- nx-X11/lib/X11/NextEvent.c | 2 -- nx-X11/lib/X11/OCWrap.c | 2 -- nx-X11/lib/X11/OMWrap.c | 2 -- nx-X11/lib/X11/OfCCC.c | 1 - nx-X11/lib/X11/ParseCmd.c | 2 -- nx-X11/lib/X11/ParseCol.c | 2 -- nx-X11/lib/X11/ParseGeom.c | 2 -- nx-X11/lib/X11/PeekEvent.c | 2 -- nx-X11/lib/X11/PeekIfEv.c | 2 -- nx-X11/lib/X11/Pending.c | 1 - nx-X11/lib/X11/PixFormats.c | 1 - nx-X11/lib/X11/PmapBgnd.c | 2 -- nx-X11/lib/X11/PmapBord.c | 2 -- nx-X11/lib/X11/PolyReg.c | 2 -- nx-X11/lib/X11/PolyTxt.c | 2 -- nx-X11/lib/X11/PolyTxt16.c | 2 -- nx-X11/lib/X11/PrOfId.c | 1 - nx-X11/lib/X11/PropAlloc.c | 2 -- nx-X11/lib/X11/PutBEvent.c | 2 -- nx-X11/lib/X11/PutImage.c | 2 -- nx-X11/lib/X11/QBlack.c | 1 - nx-X11/lib/X11/QBlue.c | 1 - nx-X11/lib/X11/QGreen.c | 1 - nx-X11/lib/X11/QRed.c | 1 - nx-X11/lib/X11/QWhite.c | 1 - nx-X11/lib/X11/QuBest.c | 1 - nx-X11/lib/X11/QuCol.c | 2 -- nx-X11/lib/X11/QuColor.c | 2 -- nx-X11/lib/X11/QuColors.c | 2 -- nx-X11/lib/X11/QuCols.c | 2 -- nx-X11/lib/X11/QuCurShp.c | 1 - nx-X11/lib/X11/QuExt.c | 1 - nx-X11/lib/X11/QuKeybd.c | 2 -- nx-X11/lib/X11/QuPntr.c | 1 - nx-X11/lib/X11/QuStipShp.c | 1 - nx-X11/lib/X11/QuTextE16.c | 2 -- nx-X11/lib/X11/QuTextExt.c | 2 -- nx-X11/lib/X11/QuTileShp.c | 1 - nx-X11/lib/X11/QuTree.c | 2 -- nx-X11/lib/X11/Quarks.c | 2 -- nx-X11/lib/X11/RaiseWin.c | 2 -- nx-X11/lib/X11/RdBitF.c | 2 -- nx-X11/lib/X11/RecolorC.c | 2 -- nx-X11/lib/X11/ReconfWM.c | 1 - nx-X11/lib/X11/ReconfWin.c | 2 -- nx-X11/lib/X11/Region.c | 2 -- nx-X11/lib/X11/RegstFlt.c | 2 -- nx-X11/lib/X11/RepWindow.c | 2 -- nx-X11/lib/X11/RestackWs.c | 2 -- nx-X11/lib/X11/RotProp.c | 2 -- nx-X11/lib/X11/ScrResStr.c | 1 - nx-X11/lib/X11/SelInput.c | 2 -- nx-X11/lib/X11/SendEvent.c | 2 -- nx-X11/lib/X11/SetBack.c | 2 -- nx-X11/lib/X11/SetCCC.c | 1 - nx-X11/lib/X11/SetCRects.c | 2 -- nx-X11/lib/X11/SetClMask.c | 2 -- nx-X11/lib/X11/SetClOrig.c | 2 -- nx-X11/lib/X11/SetDashes.c | 2 -- nx-X11/lib/X11/SetFPath.c | 2 -- nx-X11/lib/X11/SetFont.c | 2 -- nx-X11/lib/X11/SetFore.c | 2 -- nx-X11/lib/X11/SetFunc.c | 2 -- nx-X11/lib/X11/SetGetCols.c | 1 - nx-X11/lib/X11/SetHints.c | 2 -- nx-X11/lib/X11/SetIFocus.c | 2 -- nx-X11/lib/X11/SetLStyle.c | 2 -- nx-X11/lib/X11/SetLocale.c | 3 --- nx-X11/lib/X11/SetNrmHint.c | 1 - nx-X11/lib/X11/SetPMask.c | 2 -- nx-X11/lib/X11/SetPntMap.c | 2 -- nx-X11/lib/X11/SetRGBCMap.c | 1 - nx-X11/lib/X11/SetSOwner.c | 2 -- nx-X11/lib/X11/SetSSaver.c | 2 -- nx-X11/lib/X11/SetStCmap.c | 1 - nx-X11/lib/X11/SetState.c | 2 -- nx-X11/lib/X11/SetStip.c | 2 -- nx-X11/lib/X11/SetTSOrig.c | 2 -- nx-X11/lib/X11/SetTile.c | 2 -- nx-X11/lib/X11/SetTxtProp.c | 1 - nx-X11/lib/X11/SetWMCMapW.c | 1 - nx-X11/lib/X11/SetWMProto.c | 1 - nx-X11/lib/X11/StBytes.c | 2 -- nx-X11/lib/X11/StCol.c | 2 -- nx-X11/lib/X11/StColor.c | 2 -- nx-X11/lib/X11/StColors.c | 2 -- nx-X11/lib/X11/StCols.c | 2 -- nx-X11/lib/X11/StNColor.c | 2 -- nx-X11/lib/X11/StName.c | 2 -- nx-X11/lib/X11/StrKeysym.c | 2 -- nx-X11/lib/X11/StrToText.c | 1 - nx-X11/lib/X11/Sync.c | 2 -- nx-X11/lib/X11/Synchro.c | 2 -- nx-X11/lib/X11/Text.c | 2 -- nx-X11/lib/X11/Text16.c | 2 -- nx-X11/lib/X11/TextExt.c | 2 -- nx-X11/lib/X11/TextExt16.c | 2 -- nx-X11/lib/X11/TextToStr.c | 2 -- nx-X11/lib/X11/TrCoords.c | 1 - nx-X11/lib/X11/UNDEFINED.c | 1 - nx-X11/lib/X11/UndefCurs.c | 2 -- nx-X11/lib/X11/UngrabBut.c | 2 -- nx-X11/lib/X11/UngrabKbd.c | 2 -- nx-X11/lib/X11/UngrabKey.c | 2 -- nx-X11/lib/X11/UngrabPtr.c | 2 -- nx-X11/lib/X11/UngrabSvr.c | 2 -- nx-X11/lib/X11/UninsCmap.c | 2 -- nx-X11/lib/X11/UnldFont.c | 2 -- nx-X11/lib/X11/UnmapSubs.c | 2 -- nx-X11/lib/X11/UnmapWin.c | 2 -- nx-X11/lib/X11/VisUtil.c | 1 - nx-X11/lib/X11/WMGeom.c | 2 -- nx-X11/lib/X11/WMProps.c | 2 -- nx-X11/lib/X11/WarpPtr.c | 2 -- nx-X11/lib/X11/WinEvent.c | 2 -- nx-X11/lib/X11/Window.c | 2 -- nx-X11/lib/X11/Withdraw.c | 1 - nx-X11/lib/X11/WrBitF.c | 2 -- nx-X11/lib/X11/X11-def.cpp | 2 -- nx-X11/lib/X11/XDefaultIMIF.c | 1 - nx-X11/lib/X11/XDefaultOMIF.c | 1 - nx-X11/lib/X11/XKB.c | 2 -- nx-X11/lib/X11/XKBAlloc.c | 2 -- nx-X11/lib/X11/XKBBell.c | 1 - nx-X11/lib/X11/XKBBind.c | 2 -- nx-X11/lib/X11/XKBCompat.c | 1 - nx-X11/lib/X11/XKBCtrls.c | 2 -- nx-X11/lib/X11/XKBCvt.c | 2 -- nx-X11/lib/X11/XKBExtDev.c | 2 -- nx-X11/lib/X11/XKBGAlloc.c | 2 -- nx-X11/lib/X11/XKBGeom.c | 2 -- nx-X11/lib/X11/XKBGetByName.c | 1 - nx-X11/lib/X11/XKBGetMap.c | 2 -- nx-X11/lib/X11/XKBList.c | 1 - nx-X11/lib/X11/XKBMAlloc.c | 2 -- nx-X11/lib/X11/XKBMisc.c | 2 -- nx-X11/lib/X11/XKBNames.c | 2 -- nx-X11/lib/X11/XKBRdBuf.c | 2 -- nx-X11/lib/X11/XKBSetGeom.c | 3 --- nx-X11/lib/X11/XKBSetMap.c | 2 -- nx-X11/lib/X11/XKBUse.c | 2 -- nx-X11/lib/X11/XKBleds.c | 2 -- nx-X11/lib/X11/XKBlib.h | 2 -- nx-X11/lib/X11/XKBlibint.h | 2 -- nx-X11/lib/X11/XRGB.c | 2 -- nx-X11/lib/X11/XYZ.c | 2 -- nx-X11/lib/X11/Xaixlcint.h | 1 - nx-X11/lib/X11/Xatomtype.h | 1 - nx-X11/lib/X11/Xcms.h | 2 -- nx-X11/lib/X11/Xcmsint.h | 2 -- nx-X11/lib/X11/XimImSw.h | 1 - nx-X11/lib/X11/XimProto.h | 1 - nx-X11/lib/X11/XimThai.h | 2 -- nx-X11/lib/X11/XimTrInt.h | 1 - nx-X11/lib/X11/XimTrX.h | 1 - nx-X11/lib/X11/XimTrans.h | 2 -- nx-X11/lib/X11/Ximint.h | 2 -- nx-X11/lib/X11/XimintL.h | 2 -- nx-X11/lib/X11/XimintP.h | 2 -- nx-X11/lib/X11/Xintconn.h | 1 - nx-X11/lib/X11/XlcDL.c | 2 -- nx-X11/lib/X11/XlcGeneric.h | 2 -- nx-X11/lib/X11/XlcPubI.h | 2 -- nx-X11/lib/X11/XlcPublic.h | 2 -- nx-X11/lib/X11/Xlcint.h | 2 -- nx-X11/lib/X11/Xlib.h | 3 --- nx-X11/lib/X11/Xlocale.h | 2 -- nx-X11/lib/X11/XomGeneric.h | 2 -- nx-X11/lib/X11/Xregion.h | 1 - nx-X11/lib/X11/Xresource.h | 2 -- nx-X11/lib/X11/Xrm.c | 2 -- nx-X11/lib/X11/XrmI.h | 1 - nx-X11/lib/X11/Xutil.h | 2 -- nx-X11/lib/X11/cmsAllCol.c | 2 -- nx-X11/lib/X11/cmsAllNCol.c | 2 -- nx-X11/lib/X11/cmsCmap.c | 1 - nx-X11/lib/X11/cmsColNm.c | 3 --- nx-X11/lib/X11/cmsGlobls.c | 1 - nx-X11/lib/X11/cmsInt.c | 2 -- nx-X11/lib/X11/cmsLkCol.c | 2 -- nx-X11/lib/X11/cmsMath.c | 2 -- nx-X11/lib/X11/cmsProp.c | 1 - nx-X11/lib/X11/cmsTrig.c | 2 -- nx-X11/lib/X11/cursorfont.h | 1 - nx-X11/lib/X11/evtomask.c | 2 -- nx-X11/lib/X11/globals.c | 2 -- nx-X11/lib/X11/imCallbk.c | 2 -- nx-X11/lib/X11/imConv.c | 1 - nx-X11/lib/X11/imDefFlt.c | 2 -- nx-X11/lib/X11/imDefIc.c | 2 -- nx-X11/lib/X11/imDefIm.c | 2 -- nx-X11/lib/X11/imDefLkup.c | 2 -- nx-X11/lib/X11/imDispch.c | 2 -- nx-X11/lib/X11/imEvToWire.c | 1 - nx-X11/lib/X11/imExten.c | 2 -- nx-X11/lib/X11/imImSw.c | 2 -- nx-X11/lib/X11/imInsClbk.c | 2 -- nx-X11/lib/X11/imInt.c | 2 -- nx-X11/lib/X11/imKStoUCS.c | 1 - nx-X11/lib/X11/imLcFlt.c | 1 - nx-X11/lib/X11/imLcGIc.c | 1 - nx-X11/lib/X11/imLcIc.c | 2 -- nx-X11/lib/X11/imLcIm.c | 2 -- nx-X11/lib/X11/imLcLkup.c | 2 -- nx-X11/lib/X11/imLcPrs.c | 2 -- nx-X11/lib/X11/imLcSIc.c | 1 - nx-X11/lib/X11/imRm.c | 2 -- nx-X11/lib/X11/imRmAttr.c | 2 -- nx-X11/lib/X11/imThaiFlt.c | 2 -- nx-X11/lib/X11/imThaiIc.c | 2 -- nx-X11/lib/X11/imThaiIm.c | 2 -- nx-X11/lib/X11/imTrX.c | 2 -- nx-X11/lib/X11/imTrans.c | 2 -- nx-X11/lib/X11/imTransR.c | 2 -- nx-X11/lib/X11/lcCT.c | 2 -- nx-X11/lib/X11/lcCharSet.c | 2 -- nx-X11/lib/X11/lcConv.c | 2 -- nx-X11/lib/X11/lcDB.c | 2 -- nx-X11/lib/X11/lcDefConv.c | 2 -- nx-X11/lib/X11/lcDynamic.c | 2 -- nx-X11/lib/X11/lcEuc.c | 2 -- nx-X11/lib/X11/lcFile.c | 2 -- nx-X11/lib/X11/lcGenConv.c | 2 -- nx-X11/lib/X11/lcGeneric.c | 2 -- nx-X11/lib/X11/lcInit.c | 2 -- nx-X11/lib/X11/lcJis.c | 2 -- nx-X11/lib/X11/lcPrTxt.c | 2 -- nx-X11/lib/X11/lcPubWrap.c | 2 -- nx-X11/lib/X11/lcPublic.c | 2 -- nx-X11/lib/X11/lcRM.c | 2 -- nx-X11/lib/X11/lcSjis.c | 2 -- nx-X11/lib/X11/lcStd.c | 2 -- nx-X11/lib/X11/lcTxtPr.c | 2 -- nx-X11/lib/X11/lcUTF8.c | 1 - nx-X11/lib/X11/lcUTF8Load.c | 1 - nx-X11/lib/X11/lcUniConv/8bit_tab_to_h.c | 1 - nx-X11/lib/X11/lcUniConv/armscii_8.h | 1 - nx-X11/lib/X11/lcUniConv/big5.h | 1 - nx-X11/lib/X11/lcUniConv/gb2312.h | 1 - nx-X11/lib/X11/lcUniConv/iso8859_11.h | 1 - nx-X11/lib/X11/lcUniConv/iso8859_13.h | 1 - nx-X11/lib/X11/lcUniConv/iso8859_16.h | 1 - nx-X11/lib/X11/lcUniConv/iso8859_9e.h | 1 - nx-X11/lib/X11/lcUniConv/jisx0208.h | 1 - nx-X11/lib/X11/lcUniConv/jisx0212.h | 1 - nx-X11/lib/X11/lcUniConv/koi8_c.h | 1 - nx-X11/lib/X11/lcUniConv/ksc5601.h | 1 - nx-X11/lib/X11/lcUniConv/tatar_cyr.h | 1 - nx-X11/lib/X11/lcUniConv/tis620.h | 1 - nx-X11/lib/X11/lcUniConv/utf8.h | 1 - nx-X11/lib/X11/lcUtil.c | 2 -- nx-X11/lib/X11/lcWrap.c | 2 -- nx-X11/lib/X11/libX11.elist | 1 - nx-X11/lib/X11/locking.c | 2 -- nx-X11/lib/X11/locking.h | 2 -- nx-X11/lib/X11/mbWMProps.c | 2 -- nx-X11/lib/X11/mbWrap.c | 2 -- nx-X11/lib/X11/omDefault.c | 2 -- nx-X11/lib/X11/omGeneric.c | 2 -- nx-X11/lib/X11/omImText.c | 2 -- nx-X11/lib/X11/omText.c | 2 -- nx-X11/lib/X11/omTextEsc.c | 2 -- nx-X11/lib/X11/omTextExt.c | 2 -- nx-X11/lib/X11/omTextPer.c | 2 -- nx-X11/lib/X11/omXChar.c | 2 -- nx-X11/lib/X11/os2Stubs.c | 1 - nx-X11/lib/X11/poly.h | 1 - nx-X11/lib/X11/udcInf.c | 2 -- nx-X11/lib/X11/utf8WMProps.c | 1 - nx-X11/lib/X11/utf8Wrap.c | 1 - nx-X11/lib/X11/util/makekeys.c | 3 --- nx-X11/lib/X11/uvY.c | 2 -- nx-X11/lib/X11/wcWrap.c | 2 -- nx-X11/lib/X11/xyY.c | 2 -- nx-X11/lib/xkbfile/XKBbells.h | 1 - nx-X11/lib/xkbfile/XKBconfig.h | 2 -- nx-X11/lib/xkbfile/XKBfile.h | 2 -- nx-X11/lib/xkbfile/XKBfileInt.h | 1 - nx-X11/lib/xkbfile/XKBrules.h | 2 -- nx-X11/lib/xkbfile/XKM.h | 1 - nx-X11/lib/xkbfile/XKMformat.h | 1 - nx-X11/lib/xkbfile/cout.c | 2 -- nx-X11/lib/xkbfile/maprules.c | 2 -- nx-X11/lib/xkbfile/srvmisc.c | 2 -- nx-X11/lib/xkbfile/xkbatom.c | 2 -- nx-X11/lib/xkbfile/xkbbells.c | 1 - nx-X11/lib/xkbfile/xkbconfig.c | 2 -- nx-X11/lib/xkbfile/xkbdraw.c | 2 -- nx-X11/lib/xkbfile/xkberrs.c | 2 -- nx-X11/lib/xkbfile/xkbfile-def.cpp | 1 - nx-X11/lib/xkbfile/xkbmisc.c | 2 -- nx-X11/lib/xkbfile/xkbout.c | 2 -- nx-X11/lib/xkbfile/xkbtext.c | 2 -- nx-X11/lib/xkbfile/xkmout.c | 2 -- nx-X11/lib/xkbfile/xkmread.c | 2 -- nx-X11/lib/xtrans/Xtrans.c | 3 --- nx-X11/lib/xtrans/Xtrans.h | 2 -- nx-X11/lib/xtrans/Xtransdnet.c | 2 -- nx-X11/lib/xtrans/Xtransint.h | 3 --- nx-X11/lib/xtrans/Xtranslcl.c | 2 -- nx-X11/lib/xtrans/Xtransos2.c | 1 - nx-X11/lib/xtrans/Xtranstli.c | 2 -- nx-X11/lib/xtrans/Xtransutil.c | 2 -- nx-X11/lib/xtrans/transport.c | 2 -- nx-X11/programs/Xserver/GL/glx/g_disptab.c | 1 - nx-X11/programs/Xserver/GL/glx/g_disptab.h | 1 - nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c | 1 - nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h | 1 - nx-X11/programs/Xserver/GL/glx/g_render.c | 1 - nx-X11/programs/Xserver/GL/glx/g_renderswap.c | 1 - nx-X11/programs/Xserver/GL/glx/g_single.c | 1 - nx-X11/programs/Xserver/GL/glx/g_singleswap.c | 1 - nx-X11/programs/Xserver/GL/glx/glxbuf.c | 1 - nx-X11/programs/Xserver/GL/glx/glxcmds.c | 1 - nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c | 1 - nx-X11/programs/Xserver/GL/glx/glxcontext.h | 1 - nx-X11/programs/Xserver/GL/glx/glxdrawable.h | 1 - nx-X11/programs/Xserver/GL/glx/glxext.h | 1 - nx-X11/programs/Xserver/GL/glx/glximports.c | 1 - nx-X11/programs/Xserver/GL/glx/glximports.h | 1 - nx-X11/programs/Xserver/GL/glx/glxmem.c | 1 - nx-X11/programs/Xserver/GL/glx/glxpix.c | 1 - nx-X11/programs/Xserver/GL/glx/glxscreens.c | 1 - nx-X11/programs/Xserver/GL/glx/glxscreens.h | 1 - nx-X11/programs/Xserver/GL/glx/glxserver.h | 1 - nx-X11/programs/Xserver/GL/glx/glxutil.c | 1 - nx-X11/programs/Xserver/GL/glx/glxutil.h | 1 - nx-X11/programs/Xserver/GL/glx/impsize.h | 1 - nx-X11/programs/Xserver/GL/glx/render2.c | 1 - nx-X11/programs/Xserver/GL/glx/render2swap.c | 1 - nx-X11/programs/Xserver/GL/glx/rensize.c | 1 - nx-X11/programs/Xserver/GL/glx/rensizetab.c | 1 - nx-X11/programs/Xserver/GL/glx/single2.c | 1 - nx-X11/programs/Xserver/GL/glx/single2swap.c | 1 - nx-X11/programs/Xserver/GL/glx/singlepixswap.c | 1 - nx-X11/programs/Xserver/GL/glx/singlesize.c | 1 - nx-X11/programs/Xserver/GL/glx/unpack.h | 1 - nx-X11/programs/Xserver/GL/glxmodule.c | 1 - nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h | 1 - nx-X11/programs/Xserver/GL/include/GL/xf86glx.h | 1 - nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp | 1 - nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c | 1 - nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c | 1 - nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c | 1 - nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h | 1 - nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h | 1 - nx-X11/programs/Xserver/Xext/bigreq.c | 2 -- nx-X11/programs/Xserver/Xext/dpms.c | 2 -- nx-X11/programs/Xserver/Xext/dpmsproc.h | 1 - nx-X11/programs/Xserver/Xext/dpmsstubs.c | 2 -- nx-X11/programs/Xserver/Xext/extmod/modinit.c | 1 - nx-X11/programs/Xserver/Xext/extmod/modinit.h | 2 -- nx-X11/programs/Xserver/Xext/panoramiX.c | 2 -- nx-X11/programs/Xserver/Xext/panoramiX.h | 2 -- nx-X11/programs/Xserver/Xext/panoramiXSwap.c | 2 -- nx-X11/programs/Xserver/Xext/panoramiXh.h | 1 - nx-X11/programs/Xserver/Xext/panoramiXprocs.c | 2 -- nx-X11/programs/Xserver/Xext/panoramiXsrv.h | 1 - nx-X11/programs/Xserver/Xext/saver.c | 2 -- nx-X11/programs/Xserver/Xext/shape.c | 3 --- nx-X11/programs/Xserver/Xext/shm.c | 2 -- nx-X11/programs/Xserver/Xext/sleepuntil.c | 1 - nx-X11/programs/Xserver/Xext/sleepuntil.h | 1 - nx-X11/programs/Xserver/Xext/sync.c | 2 -- nx-X11/programs/Xserver/Xext/xcmisc.c | 2 -- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 1 - nx-X11/programs/Xserver/Xext/xres.c | 2 -- nx-X11/programs/Xserver/Xext/xtest.c | 3 --- nx-X11/programs/Xserver/Xext/xtest1dd.c | 2 -- nx-X11/programs/Xserver/Xext/xtest1dd.h | 1 - nx-X11/programs/Xserver/Xext/xtest1di.c | 3 --- nx-X11/programs/Xserver/Xext/xvdisp.c | 2 -- nx-X11/programs/Xserver/Xext/xvdix.h | 1 - nx-X11/programs/Xserver/Xext/xvmain.c | 2 -- nx-X11/programs/Xserver/Xext/xvmc.c | 1 - nx-X11/programs/Xserver/Xext/xvmcext.h | 1 - nx-X11/programs/Xserver/Xext/xvmod.c | 1 - nx-X11/programs/Xserver/Xext/xvmodproc.h | 1 - nx-X11/programs/Xserver/Xi/allowev.c | 2 -- nx-X11/programs/Xserver/Xi/allowev.h | 1 - nx-X11/programs/Xserver/Xi/chgdctl.c | 2 -- nx-X11/programs/Xserver/Xi/chgdctl.h | 1 - nx-X11/programs/Xserver/Xi/chgfctl.c | 2 -- nx-X11/programs/Xserver/Xi/chgfctl.h | 1 - nx-X11/programs/Xserver/Xi/chgkbd.c | 2 -- nx-X11/programs/Xserver/Xi/chgkbd.h | 1 - nx-X11/programs/Xserver/Xi/chgkmap.c | 2 -- nx-X11/programs/Xserver/Xi/chgkmap.h | 1 - nx-X11/programs/Xserver/Xi/chgprop.c | 2 -- nx-X11/programs/Xserver/Xi/chgprop.h | 1 - nx-X11/programs/Xserver/Xi/chgptr.c | 2 -- nx-X11/programs/Xserver/Xi/chgptr.h | 1 - nx-X11/programs/Xserver/Xi/closedev.c | 2 -- nx-X11/programs/Xserver/Xi/closedev.h | 1 - nx-X11/programs/Xserver/Xi/devbell.c | 2 -- nx-X11/programs/Xserver/Xi/devbell.h | 1 - nx-X11/programs/Xserver/Xi/exevents.c | 2 -- nx-X11/programs/Xserver/Xi/exglobals.h | 1 - nx-X11/programs/Xserver/Xi/extinit.c | 2 -- nx-X11/programs/Xserver/Xi/getbmap.c | 2 -- nx-X11/programs/Xserver/Xi/getbmap.h | 1 - nx-X11/programs/Xserver/Xi/getdctl.c | 2 -- nx-X11/programs/Xserver/Xi/getdctl.h | 1 - nx-X11/programs/Xserver/Xi/getfctl.c | 2 -- nx-X11/programs/Xserver/Xi/getfctl.h | 1 - nx-X11/programs/Xserver/Xi/getfocus.c | 2 -- nx-X11/programs/Xserver/Xi/getfocus.h | 1 - nx-X11/programs/Xserver/Xi/getkmap.c | 2 -- nx-X11/programs/Xserver/Xi/getkmap.h | 1 - nx-X11/programs/Xserver/Xi/getmmap.c | 2 -- nx-X11/programs/Xserver/Xi/getmmap.h | 1 - nx-X11/programs/Xserver/Xi/getprop.c | 2 -- nx-X11/programs/Xserver/Xi/getprop.h | 1 - nx-X11/programs/Xserver/Xi/getselev.c | 2 -- nx-X11/programs/Xserver/Xi/getselev.h | 1 - nx-X11/programs/Xserver/Xi/getvers.c | 2 -- nx-X11/programs/Xserver/Xi/getvers.h | 1 - nx-X11/programs/Xserver/Xi/grabdev.c | 2 -- nx-X11/programs/Xserver/Xi/grabdev.h | 1 - nx-X11/programs/Xserver/Xi/grabdevb.c | 2 -- nx-X11/programs/Xserver/Xi/grabdevb.h | 1 - nx-X11/programs/Xserver/Xi/grabdevk.c | 2 -- nx-X11/programs/Xserver/Xi/grabdevk.h | 1 - nx-X11/programs/Xserver/Xi/gtmotion.c | 2 -- nx-X11/programs/Xserver/Xi/gtmotion.h | 1 - nx-X11/programs/Xserver/Xi/listdev.c | 2 -- nx-X11/programs/Xserver/Xi/listdev.h | 1 - nx-X11/programs/Xserver/Xi/opendev.c | 2 -- nx-X11/programs/Xserver/Xi/opendev.h | 1 - nx-X11/programs/Xserver/Xi/queryst.c | 2 -- nx-X11/programs/Xserver/Xi/queryst.h | 1 - nx-X11/programs/Xserver/Xi/selectev.c | 2 -- nx-X11/programs/Xserver/Xi/selectev.h | 1 - nx-X11/programs/Xserver/Xi/sendexev.c | 2 -- nx-X11/programs/Xserver/Xi/sendexev.h | 1 - nx-X11/programs/Xserver/Xi/setbmap.c | 2 -- nx-X11/programs/Xserver/Xi/setbmap.h | 1 - nx-X11/programs/Xserver/Xi/setdval.c | 2 -- nx-X11/programs/Xserver/Xi/setdval.h | 1 - nx-X11/programs/Xserver/Xi/setfocus.c | 2 -- nx-X11/programs/Xserver/Xi/setfocus.h | 1 - nx-X11/programs/Xserver/Xi/setmmap.c | 2 -- nx-X11/programs/Xserver/Xi/setmmap.h | 1 - nx-X11/programs/Xserver/Xi/setmode.c | 2 -- nx-X11/programs/Xserver/Xi/setmode.h | 1 - nx-X11/programs/Xserver/Xi/stubs.c | 2 -- nx-X11/programs/Xserver/Xi/ungrdev.c | 2 -- nx-X11/programs/Xserver/Xi/ungrdev.h | 1 - nx-X11/programs/Xserver/Xi/ungrdevb.c | 2 -- nx-X11/programs/Xserver/Xi/ungrdevb.h | 1 - nx-X11/programs/Xserver/Xi/ungrdevk.c | 2 -- nx-X11/programs/Xserver/Xi/ungrdevk.h | 1 - nx-X11/programs/Xserver/dbe/dbe.c | 3 --- nx-X11/programs/Xserver/dbe/dbemodule.c | 1 - nx-X11/programs/Xserver/dbe/dbestruct.h | 1 - nx-X11/programs/Xserver/dbe/midbe.c | 2 -- nx-X11/programs/Xserver/dbe/midbe.h | 1 - nx-X11/programs/Xserver/dbe/midbestr.h | 1 - nx-X11/programs/Xserver/dix/atom.c | 2 -- nx-X11/programs/Xserver/dix/colormap.c | 3 --- nx-X11/programs/Xserver/dix/cursor.c | 2 -- nx-X11/programs/Xserver/dix/devices.c | 3 --- nx-X11/programs/Xserver/dix/dispatch.c | 3 --- nx-X11/programs/Xserver/dix/dispatch.h | 1 - nx-X11/programs/Xserver/dix/dixfonts.c | 3 --- nx-X11/programs/Xserver/dix/dixutils.c | 2 -- nx-X11/programs/Xserver/dix/events.c | 3 --- nx-X11/programs/Xserver/dix/extension.c | 2 -- nx-X11/programs/Xserver/dix/ffs.c | 1 - nx-X11/programs/Xserver/dix/gc.c | 2 -- nx-X11/programs/Xserver/dix/globals.c | 3 --- nx-X11/programs/Xserver/dix/glyphcurs.c | 1 - nx-X11/programs/Xserver/dix/grabs.c | 2 -- nx-X11/programs/Xserver/dix/main.c | 3 --- nx-X11/programs/Xserver/dix/pixmap.c | 2 -- nx-X11/programs/Xserver/dix/privates.c | 3 --- nx-X11/programs/Xserver/dix/property.c | 2 -- nx-X11/programs/Xserver/dix/region.c | 2 -- nx-X11/programs/Xserver/dix/resource.c | 3 --- nx-X11/programs/Xserver/dix/swaprep.c | 2 -- nx-X11/programs/Xserver/dix/swapreq.c | 2 -- nx-X11/programs/Xserver/dix/tables.c | 2 -- nx-X11/programs/Xserver/dix/window.c | 3 --- nx-X11/programs/Xserver/dix/xpstubs.c | 1 - nx-X11/programs/Xserver/fb/fb.h | 1 - nx-X11/programs/Xserver/fb/fballpriv.c | 1 - nx-X11/programs/Xserver/fb/fbarc.c | 1 - nx-X11/programs/Xserver/fb/fbbits.c | 1 - nx-X11/programs/Xserver/fb/fbblt.c | 1 - nx-X11/programs/Xserver/fb/fbbltone.c | 1 - nx-X11/programs/Xserver/fb/fbbstore.c | 1 - nx-X11/programs/Xserver/fb/fbcmap.c | 1 - nx-X11/programs/Xserver/fb/fbcopy.c | 1 - nx-X11/programs/Xserver/fb/fbfill.c | 1 - nx-X11/programs/Xserver/fb/fbfillrect.c | 1 - nx-X11/programs/Xserver/fb/fbfillsp.c | 1 - nx-X11/programs/Xserver/fb/fbgc.c | 2 -- nx-X11/programs/Xserver/fb/fbgetsp.c | 1 - nx-X11/programs/Xserver/fb/fbimage.c | 1 - nx-X11/programs/Xserver/fb/fbmodule.c | 1 - nx-X11/programs/Xserver/fb/fboverlay.c | 1 - nx-X11/programs/Xserver/fb/fbpixmap.c | 1 - nx-X11/programs/Xserver/fb/fbpoint.c | 1 - nx-X11/programs/Xserver/fb/fbpush.c | 1 - nx-X11/programs/Xserver/fb/fbrop.h | 1 - nx-X11/programs/Xserver/fb/fbscreen.c | 1 - nx-X11/programs/Xserver/fb/fbseg.c | 1 - nx-X11/programs/Xserver/fb/fbsetsp.c | 1 - nx-X11/programs/Xserver/fb/fbstipple.c | 1 - nx-X11/programs/Xserver/fb/fbtile.c | 1 - nx-X11/programs/Xserver/fb/fbutil.c | 1 - nx-X11/programs/Xserver/fb/fbwindow.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 3 --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 3 --- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 3 --- nx-X11/programs/Xserver/hw/nxagent/NXextension.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c | 1 - nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c | 3 --- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXresource.c | 3 --- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 3 --- nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c | 2 -- nx-X11/programs/Xserver/hw/xfree86/common/compiler.h | 1 - nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h | 1 - nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_libc.h | 2 -- nx-X11/programs/Xserver/hw/xfree86/xf86Version.h | 3 --- nx-X11/programs/Xserver/include/XIstubs.h | 1 - nx-X11/programs/Xserver/include/bstore.h | 1 - nx-X11/programs/Xserver/include/bstorestr.h | 1 - nx-X11/programs/Xserver/include/closestr.h | 2 -- nx-X11/programs/Xserver/include/closure.h | 1 - nx-X11/programs/Xserver/include/colormap.h | 2 -- nx-X11/programs/Xserver/include/colormapst.h | 1 - nx-X11/programs/Xserver/include/cursor.h | 3 --- nx-X11/programs/Xserver/include/cursorstr.h | 2 -- nx-X11/programs/Xserver/include/dix.h | 2 -- nx-X11/programs/Xserver/include/dixevents.h | 1 - nx-X11/programs/Xserver/include/dixfont.h | 2 -- nx-X11/programs/Xserver/include/dixfontstr.h | 1 - nx-X11/programs/Xserver/include/dixgrabs.h | 1 - nx-X11/programs/Xserver/include/dixstruct.h | 2 -- nx-X11/programs/Xserver/include/exevents.h | 1 - nx-X11/programs/Xserver/include/extension.h | 2 -- nx-X11/programs/Xserver/include/extinit.h | 1 - nx-X11/programs/Xserver/include/extnsionst.h | 2 -- nx-X11/programs/Xserver/include/gc.h | 2 -- nx-X11/programs/Xserver/include/gcstruct.h | 2 -- nx-X11/programs/Xserver/include/globals.h | 2 -- nx-X11/programs/Xserver/include/input.h | 2 -- nx-X11/programs/Xserver/include/inputstr.h | 2 -- nx-X11/programs/Xserver/include/misc.h | 2 -- nx-X11/programs/Xserver/include/miscstruct.h | 2 -- nx-X11/programs/Xserver/include/opaque.h | 2 -- nx-X11/programs/Xserver/include/os.h | 2 -- nx-X11/programs/Xserver/include/pixmap.h | 1 - nx-X11/programs/Xserver/include/pixmapstr.h | 1 - nx-X11/programs/Xserver/include/property.h | 2 -- nx-X11/programs/Xserver/include/propertyst.h | 2 -- nx-X11/programs/Xserver/include/region.h | 1 - nx-X11/programs/Xserver/include/regionstr.h | 3 --- nx-X11/programs/Xserver/include/resource.h | 2 -- nx-X11/programs/Xserver/include/rgb.h | 1 - nx-X11/programs/Xserver/include/screenint.h | 2 -- nx-X11/programs/Xserver/include/scrnintstr.h | 2 -- nx-X11/programs/Xserver/include/selection.h | 1 - nx-X11/programs/Xserver/include/servermd.h | 3 --- nx-X11/programs/Xserver/include/site.h | 2 -- nx-X11/programs/Xserver/include/swaprep.h | 1 - nx-X11/programs/Xserver/include/swapreq.h | 1 - nx-X11/programs/Xserver/include/validate.h | 2 -- nx-X11/programs/Xserver/include/window.h | 1 - nx-X11/programs/Xserver/include/windowstr.h | 2 -- nx-X11/programs/Xserver/mfb/maskbits.h | 2 -- nx-X11/programs/Xserver/mi/cbrt.c | 2 -- nx-X11/programs/Xserver/mi/mi.h | 2 -- nx-X11/programs/Xserver/mi/miarc.c | 3 --- nx-X11/programs/Xserver/mi/mibank.c | 1 - nx-X11/programs/Xserver/mi/mibank.h | 1 - nx-X11/programs/Xserver/mi/mibitblt.c | 2 -- nx-X11/programs/Xserver/mi/mibstore.c | 2 -- nx-X11/programs/Xserver/mi/mibstore.h | 1 - nx-X11/programs/Xserver/mi/mibstorest.h | 2 -- nx-X11/programs/Xserver/mi/miclipn.c | 2 -- nx-X11/programs/Xserver/mi/micmap.c | 1 - nx-X11/programs/Xserver/mi/micmap.h | 1 - nx-X11/programs/Xserver/mi/micoord.h | 1 - nx-X11/programs/Xserver/mi/micursor.c | 2 -- nx-X11/programs/Xserver/mi/midash.c | 2 -- nx-X11/programs/Xserver/mi/midispcur.c | 2 -- nx-X11/programs/Xserver/mi/mieq.c | 1 - nx-X11/programs/Xserver/mi/miexpose.c | 3 --- nx-X11/programs/Xserver/mi/mifillarc.c | 2 -- nx-X11/programs/Xserver/mi/mifillarc.h | 2 -- nx-X11/programs/Xserver/mi/mifillrct.c | 2 -- nx-X11/programs/Xserver/mi/mifpoly.h | 2 -- nx-X11/programs/Xserver/mi/mifpolycon.c | 2 -- nx-X11/programs/Xserver/mi/migc.c | 2 -- nx-X11/programs/Xserver/mi/migc.h | 2 -- nx-X11/programs/Xserver/mi/miglblt.c | 2 -- nx-X11/programs/Xserver/mi/miinitext.c | 3 --- nx-X11/programs/Xserver/mi/miline.h | 2 -- nx-X11/programs/Xserver/mi/mioverlay.c | 1 - nx-X11/programs/Xserver/mi/mioverlay.h | 1 - nx-X11/programs/Xserver/mi/mipointer.c | 2 -- nx-X11/programs/Xserver/mi/mipointer.h | 2 -- nx-X11/programs/Xserver/mi/mipointrst.h | 2 -- nx-X11/programs/Xserver/mi/mipoly.c | 1 - nx-X11/programs/Xserver/mi/mipoly.h | 2 -- nx-X11/programs/Xserver/mi/mipolycon.c | 2 -- nx-X11/programs/Xserver/mi/mipolygen.c | 2 -- nx-X11/programs/Xserver/mi/mipolypnt.c | 2 -- nx-X11/programs/Xserver/mi/mipolyrect.c | 2 -- nx-X11/programs/Xserver/mi/mipolyseg.c | 2 -- nx-X11/programs/Xserver/mi/mipolytext.c | 2 -- nx-X11/programs/Xserver/mi/mipolyutil.c | 2 -- nx-X11/programs/Xserver/mi/mipushpxl.c | 2 -- nx-X11/programs/Xserver/mi/miscanfill.h | 1 - nx-X11/programs/Xserver/mi/miscrinit.c | 2 -- nx-X11/programs/Xserver/mi/mispans.c | 2 -- nx-X11/programs/Xserver/mi/mispans.h | 2 -- nx-X11/programs/Xserver/mi/misprite.c | 2 -- nx-X11/programs/Xserver/mi/misprite.h | 2 -- nx-X11/programs/Xserver/mi/mispritest.h | 2 -- nx-X11/programs/Xserver/mi/mistruct.h | 1 - nx-X11/programs/Xserver/mi/mivalidate.h | 1 - nx-X11/programs/Xserver/mi/mivaltree.c | 3 --- nx-X11/programs/Xserver/mi/miwideline.c | 2 -- nx-X11/programs/Xserver/mi/miwideline.h | 2 -- nx-X11/programs/Xserver/mi/miwindow.c | 2 -- nx-X11/programs/Xserver/mi/mizerarc.c | 2 -- nx-X11/programs/Xserver/mi/mizerarc.h | 2 -- nx-X11/programs/Xserver/mi/mizerclip.c | 1 - nx-X11/programs/Xserver/mi/mizerline.c | 2 -- nx-X11/programs/Xserver/os/access.c | 3 --- nx-X11/programs/Xserver/os/connection.c | 2 -- nx-X11/programs/Xserver/os/io.c | 2 -- nx-X11/programs/Xserver/os/mitauth.c | 2 -- nx-X11/programs/Xserver/os/oscolor.c | 2 -- nx-X11/programs/Xserver/os/osdep.h | 2 -- nx-X11/programs/Xserver/os/osinit.c | 2 -- nx-X11/programs/Xserver/os/rpcauth.c | 2 -- nx-X11/programs/Xserver/os/secauth.c | 2 -- nx-X11/programs/Xserver/os/xdmauth.c | 2 -- nx-X11/programs/Xserver/os/xdmcp.c | 3 --- nx-X11/programs/Xserver/randr/panoramiXproto.h | 2 -- nx-X11/programs/Xserver/record/record.c | 3 --- nx-X11/programs/Xserver/record/recordmod.c | 1 - nx-X11/programs/Xserver/record/set.c | 2 -- nx-X11/programs/Xserver/record/set.h | 1 - nx-X11/programs/Xserver/render/render.c | 1 - nx-X11/programs/Xserver/xkb/ddxBeep.c | 2 -- nx-X11/programs/Xserver/xkb/ddxConfig.c | 2 -- nx-X11/programs/Xserver/xkb/ddxCtrls.c | 2 -- nx-X11/programs/Xserver/xkb/ddxDevBtn.c | 2 -- nx-X11/programs/Xserver/xkb/ddxFakeBtn.c | 1 - nx-X11/programs/Xserver/xkb/ddxFakeMtn.c | 3 --- nx-X11/programs/Xserver/xkb/ddxInit.c | 1 - nx-X11/programs/Xserver/xkb/ddxKeyClick.c | 1 - nx-X11/programs/Xserver/xkb/ddxKillSrv.c | 2 -- nx-X11/programs/Xserver/xkb/ddxLEDs.c | 1 - nx-X11/programs/Xserver/xkb/ddxList.c | 2 -- nx-X11/programs/Xserver/xkb/ddxLoad.c | 2 -- nx-X11/programs/Xserver/xkb/ddxPrivate.c | 1 - nx-X11/programs/Xserver/xkb/ddxVT.c | 2 -- nx-X11/programs/Xserver/xkb/xkb.c | 2 -- nx-X11/programs/Xserver/xkb/xkbAccessX.c | 2 -- nx-X11/programs/Xserver/xkb/xkbActions.c | 3 --- nx-X11/programs/Xserver/xkb/xkbDflts.h | 2 -- nx-X11/programs/Xserver/xkb/xkbEvents.c | 2 -- nx-X11/programs/Xserver/xkb/xkbInit.c | 3 --- nx-X11/programs/Xserver/xkb/xkbLEDs.c | 2 -- nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c | 2 -- nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c | 1 - nx-X11/programs/Xserver/xkb/xkbSwap.c | 2 -- nx-X11/programs/Xserver/xkb/xkbUtils.c | 2 -- nx-X11/registry | 3 --- 926 files changed, 1560 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/config/cf/cross.def b/nx-X11/config/cf/cross.def index 74ca2de96..ee3767c4f 100644 --- a/nx-X11/config/cf/cross.def +++ b/nx-X11/config/cf/cross.def @@ -1,4 +1,3 @@ -/* $XFree86: xc/config/cf/cross.def,v 1.1 2000/12/08 22:09:34 keithp Exp $ */ /* * This file contains redefinitions of some symbols to enable * cross compilation: e.g. paths for include files and paths to diff --git a/nx-X11/extras/Mesa/include/GL/internal/glcore.h b/nx-X11/extras/Mesa/include/GL/internal/glcore.h index 9626dc698..e0b06c7ca 100644 --- a/nx-X11/extras/Mesa/include/GL/internal/glcore.h +++ b/nx-X11/extras/Mesa/include/GL/internal/glcore.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */ #ifndef __gl_core_h_ #define __gl_core_h_ diff --git a/nx-X11/extras/Mesa/src/glx/x11/compsize.c b/nx-X11/extras/Mesa/src/glx/x11/compsize.c index 193570c84..34d66774c 100644 --- a/nx-X11/extras/Mesa/src/glx/x11/compsize.c +++ b/nx-X11/extras/Mesa/src/glx/x11/compsize.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/GL/glx/compsize.c,v 1.6 2004/01/28 18:11:38 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c index 6ec65faa9..780ec98d9 100644 --- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c +++ b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c @@ -21,7 +21,6 @@ * 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. */ -/* $XFree86: xc/extras/Mesa/src/X/xm_span.c,v 1.3 2002/02/27 21:07:54 tsi Exp $ */ #include "glxheader.h" #include "colormac.h" diff --git a/nx-X11/extras/Mesa/src/mesa/main/enums.h b/nx-X11/extras/Mesa/src/mesa/main/enums.h index 7e8d4ee94..10ede1fa0 100644 --- a/nx-X11/extras/Mesa/src/mesa/main/enums.h +++ b/nx-X11/extras/Mesa/src/mesa/main/enums.h @@ -31,7 +31,6 @@ * 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. */ -/* $XFree86: xc/extras/Mesa/src/mesa/main/enums.h,v 1.2 2004/06/23 19:40:14 tsi Exp $ */ #ifndef _ENUMS_H_ #define _ENUMS_H_ diff --git a/nx-X11/include/DECkeysym.h b/nx-X11/include/DECkeysym.h index 6ab103e5d..d8b224059 100644 --- a/nx-X11/include/DECkeysym.h +++ b/nx-X11/include/DECkeysym.h @@ -1,4 +1,3 @@ -/* $Xorg: DECkeysym.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */ /*********************************************************** diff --git a/nx-X11/include/GL/glu.h b/nx-X11/include/GL/glu.h index 3320ad10c..e59ad6f99 100644 --- a/nx-X11/include/GL/glu.h +++ b/nx-X11/include/GL/glu.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/include/GL/glu.h,v 1.2 2001/04/03 02:18:39 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are diff --git a/nx-X11/include/GL/glx.h b/nx-X11/include/GL/glx.h index 3a9e942c7..943aaaa4f 100644 --- a/nx-X11/include/GL/glx.h +++ b/nx-X11/include/GL/glx.h @@ -1,7 +1,6 @@ #ifndef __GLX_glx_h__ #define __GLX_glx_h__ -/* $XFree86: xc/include/GL/glx.h,v 1.10 2002/10/30 08:52:36 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/include/GL/glxint.h b/nx-X11/include/GL/glxint.h index 50f4a0eaa..d9239daf2 100644 --- a/nx-X11/include/GL/glxint.h +++ b/nx-X11/include/GL/glxint.h @@ -1,7 +1,6 @@ #ifndef __GLX_glxint_h__ #define __GLX_glxint_h__ -/* $XFree86: xc/include/GL/glxint.h,v 1.3 2000/11/18 19:37:04 tsi Exp $ */ /* ** The contents of this file are subject to the GLX Public License Version 1.0 ** (the "License"). You may not use this file except in compliance with the diff --git a/nx-X11/include/GL/glxmd.h b/nx-X11/include/GL/glxmd.h index ddb03c385..f0456483f 100644 --- a/nx-X11/include/GL/glxmd.h +++ b/nx-X11/include/GL/glxmd.h @@ -1,7 +1,6 @@ #ifndef _GLX_glxmd_h_ #define _GLX_glxmd_h_ -/* $XFree86: xc/include/GL/glxmd.h,v 1.2 1999/06/14 07:23:28 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/include/GL/glxproto.h b/nx-X11/include/GL/glxproto.h index a62491fe5..304016445 100644 --- a/nx-X11/include/GL/glxproto.h +++ b/nx-X11/include/GL/glxproto.h @@ -1,7 +1,6 @@ #ifndef _GLX_glxproto_h_ #define _GLX_glxproto_h_ -/* $XFree86: xc/include/GL/glxproto.h,v 1.6 2003/09/28 20:14:58 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/include/GL/glxtokens.h b/nx-X11/include/GL/glxtokens.h index cc7202094..bde5a66f6 100644 --- a/nx-X11/include/GL/glxtokens.h +++ b/nx-X11/include/GL/glxtokens.h @@ -1,7 +1,6 @@ #ifndef __GLX_glxtokens_h__ #define __GLX_glxtokens_h__ -/* $XFree86: xc/include/GL/glxtokens.h,v 1.5 2001/03/21 15:51:38 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/include/HPkeysym.h b/nx-X11/include/HPkeysym.h index 2d09277d8..ed000b167 100644 --- a/nx-X11/include/HPkeysym.h +++ b/nx-X11/include/HPkeysym.h @@ -1,4 +1,3 @@ -/* $Xorg: HPkeysym.h,v 1.5 2001/02/09 02:03:22 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group diff --git a/nx-X11/include/Sunkeysym.h b/nx-X11/include/Sunkeysym.h index e72344440..dff6bae2c 100644 --- a/nx-X11/include/Sunkeysym.h +++ b/nx-X11/include/Sunkeysym.h @@ -1,4 +1,3 @@ -/* $Xorg: Sunkeysym.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */ /************************************************************ diff --git a/nx-X11/include/X.h b/nx-X11/include/X.h index 2dbebdaea..824398dd4 100644 --- a/nx-X11/include/X.h +++ b/nx-X11/include/X.h @@ -53,7 +53,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/X.h,v 1.6 2003/07/09 15:27:28 tsi Exp $ */ #define X_PROTOCOL 11 /* current protocol version */ #define X_PROTOCOL_REVISION 0 /* current minor version */ diff --git a/nx-X11/include/XF86keysym.h b/nx-X11/include/XF86keysym.h index fdb8fd6d2..327670178 100644 --- a/nx-X11/include/XF86keysym.h +++ b/nx-X11/include/XF86keysym.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/include/XF86keysym.h,v 1.16 2003/02/11 02:51:10 dawes Exp $ */ /* * XFree86 vendor specific keysyms. diff --git a/nx-X11/include/XWDFile.h b/nx-X11/include/XWDFile.h index 19a26ea33..b5c2349c5 100644 --- a/nx-X11/include/XWDFile.h +++ b/nx-X11/include/XWDFile.h @@ -1,4 +1,3 @@ -/* $Xorg: XWDFile.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */ /* Copyright 1985, 1986, 1998 The Open Group diff --git a/nx-X11/include/Xalloca.h b/nx-X11/include/Xalloca.h index 67f2671e9..1ec112619 100644 --- a/nx-X11/include/Xalloca.h +++ b/nx-X11/include/Xalloca.h @@ -1,4 +1,3 @@ -/* $Xorg: Xalloca.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */ /* @@ -27,7 +26,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/Xalloca.h,v 3.10 2001/12/14 19:53:25 dawes Exp $ */ /* * The purpose of this header is to define the macros ALLOCATE_LOCAL and diff --git a/nx-X11/include/Xarch.h b/nx-X11/include/Xarch.h index 6e04e53f6..94a673d1f 100644 --- a/nx-X11/include/Xarch.h +++ b/nx-X11/include/Xarch.h @@ -25,7 +25,6 @@ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/include/Xarch.h,v 1.10tsi Exp $ */ /* diff --git a/nx-X11/include/Xauth.h b/nx-X11/include/Xauth.h index b5870f66f..2bff7bd4c 100644 --- a/nx-X11/include/Xauth.h +++ b/nx-X11/include/Xauth.h @@ -1,4 +1,3 @@ -/* $Xorg: Xauth.h,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */ /* @@ -26,7 +25,6 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/Xau/Xauth.h,v 1.5 2001/12/14 19:54:36 dawes Exp $ */ #ifndef _Xauth_h #define _Xauth_h diff --git a/nx-X11/include/Xdefs.h b/nx-X11/include/Xdefs.h index c06202af3..463cac237 100644 --- a/nx-X11/include/Xdefs.h +++ b/nx-X11/include/Xdefs.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/include/Xdefs.h,v 1.2 1999/08/22 06:21:20 dawes Exp $ */ /*********************************************************** diff --git a/nx-X11/include/Xfuncproto.h b/nx-X11/include/Xfuncproto.h index f6729a0d9..88113c086 100644 --- a/nx-X11/include/Xfuncproto.h +++ b/nx-X11/include/Xfuncproto.h @@ -1,4 +1,3 @@ -/* $Xorg: Xfuncproto.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */ /* * Copyright 1989, 1991, 1998 The Open Group @@ -24,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * */ -/* $XFree86: xc/include/Xfuncproto.h,v 3.4 2001/12/14 19:53:25 dawes Exp $ */ /* Definitions to make function prototypes manageable */ diff --git a/nx-X11/include/Xfuncs.h b/nx-X11/include/Xfuncs.h index 7582198bb..c00e468ec 100644 --- a/nx-X11/include/Xfuncs.h +++ b/nx-X11/include/Xfuncs.h @@ -26,7 +26,6 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * */ -/* $XFree86: xc/include/Xfuncs.h,v 3.10 2002/05/31 18:45:38 dawes Exp $ */ #ifndef _XFUNCS_H_ #define _XFUNCS_H_ diff --git a/nx-X11/include/Xmd.h b/nx-X11/include/Xmd.h index 78dd895c2..83d22a47f 100644 --- a/nx-X11/include/Xmd.h +++ b/nx-X11/include/Xmd.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/include/Xmd.h,v 3.18tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -47,7 +46,6 @@ SOFTWARE. ******************************************************************/ #ifndef XMD_H #define XMD_H 1 -/* $Xorg: Xmd.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */ /* * Xmd.h: MACHINE DEPENDENT DECLARATIONS. */ diff --git a/nx-X11/include/Xos.h b/nx-X11/include/Xos.h index a2abf156f..e79cec662 100644 --- a/nx-X11/include/Xos.h +++ b/nx-X11/include/Xos.h @@ -28,7 +28,6 @@ in this Software without prior written authorization from The Open Group. * The X Window System is a Trademark of The Open Group. * */ -/* $XFree86: xc/include/Xos.h,v 3.41tsi Exp $ */ /* This is a collection of things to try and minimize system dependencies * in a "signficant" number of source files. diff --git a/nx-X11/include/Xos_r.h b/nx-X11/include/Xos_r.h index e7a8fd1af..4147a4473 100644 --- a/nx-X11/include/Xos_r.h +++ b/nx-X11/include/Xos_r.h @@ -1,5 +1,3 @@ -/* $Xorg: Xos_r.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */ -/* $XdotOrg: xc/include/Xos_r.h,v 1.5 2005/07/13 07:23:56 keithp Exp $ */ /* Copyright 1996, 1998 The Open Group @@ -23,7 +21,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/include/Xos_r.h,v 1.18tsi Exp $ */ /* * Various and sundry Thread-Safe functions used by X11, Motif, and CDE. diff --git a/nx-X11/include/Xosdefs.h b/nx-X11/include/Xosdefs.h index 5deba6744..3b151199e 100644 --- a/nx-X11/include/Xosdefs.h +++ b/nx-X11/include/Xosdefs.h @@ -26,7 +26,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/include/Xosdefs.h,v 3.20 2002/05/31 18:45:39 dawes Exp $ */ #ifndef _XOSDEFS_H_ #define _XOSDEFS_H_ diff --git a/nx-X11/include/Xprotostr.h b/nx-X11/include/Xprotostr.h index a0f849874..50bddf512 100644 --- a/nx-X11/include/Xprotostr.h +++ b/nx-X11/include/Xprotostr.h @@ -1,4 +1,3 @@ -/* $Xorg: Xprotostr.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */ #ifndef XPROTOSTRUCTS_H #define XPROTOSTRUCTS_H diff --git a/nx-X11/include/Xthreads.h b/nx-X11/include/Xthreads.h index b0ec7df32..77267bea1 100644 --- a/nx-X11/include/Xthreads.h +++ b/nx-X11/include/Xthreads.h @@ -25,7 +25,6 @@ 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: Xthreads.h,v 3.10 2001/12/14 19:53:26 dawes Exp $ */ #ifndef _XTHREADS_H_ #define _XTHREADS_H_ diff --git a/nx-X11/include/Xw32defs.h b/nx-X11/include/Xw32defs.h index 07624fef6..7b3f15521 100644 --- a/nx-X11/include/Xw32defs.h +++ b/nx-X11/include/Xw32defs.h @@ -1,4 +1,3 @@ -/* $Xorg: Xw32defs.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */ #ifndef _XW32DEFS_H #define _XW32DEFS_H diff --git a/nx-X11/include/Xwinsock.h b/nx-X11/include/Xwinsock.h index 0278c09b7..ae0548628 100644 --- a/nx-X11/include/Xwinsock.h +++ b/nx-X11/include/Xwinsock.h @@ -1,4 +1,3 @@ -/* $Xorg: Xwinsock.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */ /* Copyright 1996, 1998 The Open Group diff --git a/nx-X11/include/extensions/XI.h b/nx-X11/include/extensions/XI.h index c710e0a07..a14c6746f 100644 --- a/nx-X11/include/extensions/XI.h +++ b/nx-X11/include/extensions/XI.h @@ -1,4 +1,3 @@ -/* $Xorg: XI.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XI.h,v 1.4 2001/01/17 17:53:16 dawes Exp $ */ /* Definitions used by the server, library and client */ diff --git a/nx-X11/include/extensions/XInput.h b/nx-X11/include/extensions/XInput.h index cf4b72ca0..4e36a208a 100644 --- a/nx-X11/include/extensions/XInput.h +++ b/nx-X11/include/extensions/XInput.h @@ -1,4 +1,3 @@ -/* $Xorg: XInput.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XInput.h,v 1.3 2001/12/14 19:53:28 dawes Exp $ */ /* Definitions used by the library and client */ diff --git a/nx-X11/include/extensions/XIproto.h b/nx-X11/include/extensions/XIproto.h index cccb11a2c..c51480cd7 100644 --- a/nx-X11/include/extensions/XIproto.h +++ b/nx-X11/include/extensions/XIproto.h @@ -1,4 +1,3 @@ -/* $Xorg: XIproto.h,v 1.5 2001/02/09 02:03:24 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XIproto.h,v 1.4 2001/01/17 17:53:17 dawes Exp $ */ #ifndef _XIPROTO_H #define _XIPROTO_H diff --git a/nx-X11/include/extensions/XKB.h b/nx-X11/include/extensions/XKB.h index d0d13f20e..d684b8549 100644 --- a/nx-X11/include/extensions/XKB.h +++ b/nx-X11/include/extensions/XKB.h @@ -1,4 +1,3 @@ -/* $Xorg: XKB.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XKB.h,v 1.5tsi Exp $ */ #ifndef _XKB_H_ #define _XKB_H_ diff --git a/nx-X11/include/extensions/XKBgeom.h b/nx-X11/include/extensions/XKBgeom.h index 6ef114bfe..9e563f6d2 100644 --- a/nx-X11/include/extensions/XKBgeom.h +++ b/nx-X11/include/extensions/XKBgeom.h @@ -1,4 +1,3 @@ -/* $Xorg: XKBgeom.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XKBgeom.h,v 3.9 2002/09/18 17:11:40 tsi Exp $ */ #ifndef _XKBGEOM_H_ #define _XKBGEOM_H_ diff --git a/nx-X11/include/extensions/XKBproto.h b/nx-X11/include/extensions/XKBproto.h index 2dc3b141e..2f04cd8f8 100644 --- a/nx-X11/include/extensions/XKBproto.h +++ b/nx-X11/include/extensions/XKBproto.h @@ -1,4 +1,3 @@ -/* $Xorg: XKBproto.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/include/extensions/XKBsrv.h b/nx-X11/include/extensions/XKBsrv.h index 18d90f1e3..db9c1d59e 100644 --- a/nx-X11/include/extensions/XKBsrv.h +++ b/nx-X11/include/extensions/XKBsrv.h @@ -1,5 +1,3 @@ -/* $Xorg: XKBsrv.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ -/* $XdotOrg: xc/include/extensions/XKBsrv.h,v 1.5 2005/09/01 19:56:14 krh Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -25,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/include/extensions/XKBsrv.h,v 3.22 2002/11/20 04:49:01 dawes Exp $ */ #ifndef _XKBSRV_H_ #define _XKBSRV_H_ diff --git a/nx-X11/include/extensions/XKBstr.h b/nx-X11/include/extensions/XKBstr.h index 77666f6aa..f3c901805 100644 --- a/nx-X11/include/extensions/XKBstr.h +++ b/nx-X11/include/extensions/XKBstr.h @@ -1,4 +1,3 @@ -/* $Xorg: XKBstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/include/extensions/XResproto.h b/nx-X11/include/extensions/XResproto.h index 2f5563bce..9c2abd42d 100644 --- a/nx-X11/include/extensions/XResproto.h +++ b/nx-X11/include/extensions/XResproto.h @@ -1,7 +1,6 @@ /* Copyright (c) 2002 XFree86 Inc */ -/* $XFree86: xc/include/extensions/XResproto.h,v 1.1 2002/03/04 19:31:35 mvojkovi Exp $ */ #ifndef _XRESPROTO_H #define _XRESPROTO_H diff --git a/nx-X11/include/extensions/Xdbeproto.h b/nx-X11/include/extensions/Xdbeproto.h index 8a8c55522..ed98f8771 100644 --- a/nx-X11/include/extensions/Xdbeproto.h +++ b/nx-X11/include/extensions/Xdbeproto.h @@ -1,4 +1,3 @@ -/* $Xorg: Xdbeproto.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company diff --git a/nx-X11/include/extensions/Xv.h b/nx-X11/include/extensions/Xv.h index f07f9d75f..b54564bbb 100644 --- a/nx-X11/include/extensions/Xv.h +++ b/nx-X11/include/extensions/Xv.h @@ -21,7 +21,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/extensions/Xv.h,v 1.3 1999/05/23 06:33:22 dawes Exp $ */ #ifndef XV_H #define XV_H diff --git a/nx-X11/include/extensions/XvMC.h b/nx-X11/include/extensions/XvMC.h index 1709692a1..f31ffff9e 100644 --- a/nx-X11/include/extensions/XvMC.h +++ b/nx-X11/include/extensions/XvMC.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/include/extensions/XvMC.h,v 1.7 2001/11/14 21:54:37 mvojkovi Exp $ */ #ifndef _XVMC_H_ #define _XVMC_H_ diff --git a/nx-X11/include/extensions/XvMClib.h b/nx-X11/include/extensions/XvMClib.h index c1e94119e..cb5406475 100644 --- a/nx-X11/include/extensions/XvMClib.h +++ b/nx-X11/include/extensions/XvMClib.h @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/include/extensions/XvMClib.h,v 1.3 2004/11/13 11:09:23 unichrome Exp $ */ -/* $XFree86: xc/include/extensions/XvMClib.h,v 1.6 2001/11/14 21:54:37 mvojkovi Exp $ */ #ifndef _XVMCLIB_H_ #define _XVMCLIB_H_ diff --git a/nx-X11/include/extensions/XvMCproto.h b/nx-X11/include/extensions/XvMCproto.h index cce3bb0a7..240d588f0 100644 --- a/nx-X11/include/extensions/XvMCproto.h +++ b/nx-X11/include/extensions/XvMCproto.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/include/extensions/XvMCproto.h,v 1.4 2001/04/10 00:28:24 mvojkovi Exp $ */ #ifndef _XVMCPROTO_H_ #define _XVMCPROTO_H_ diff --git a/nx-X11/include/extensions/Xvlib.h b/nx-X11/include/extensions/Xvlib.h index 98c407e31..eb6ebd825 100644 --- a/nx-X11/include/extensions/Xvlib.h +++ b/nx-X11/include/extensions/Xvlib.h @@ -21,7 +21,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/extensions/Xvlib.h,v 1.3 1999/12/11 19:28:48 mvojkovi Exp $ */ #ifndef XVLIB_H #define XVLIB_H diff --git a/nx-X11/include/extensions/Xvproto.h b/nx-X11/include/extensions/Xvproto.h index 81e1656a8..011ea447d 100644 --- a/nx-X11/include/extensions/Xvproto.h +++ b/nx-X11/include/extensions/Xvproto.h @@ -21,7 +21,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/extensions/Xvproto.h,v 1.5 2000/01/25 00:08:07 mvojkovi Exp $ */ #ifndef XVPROTO_H #define XVPROTO_H diff --git a/nx-X11/include/extensions/bigreqstr.h b/nx-X11/include/extensions/bigreqstr.h index fc31eb8ae..b1a9de028 100644 --- a/nx-X11/include/extensions/bigreqstr.h +++ b/nx-X11/include/extensions/bigreqstr.h @@ -1,4 +1,3 @@ -/* $Xorg: bigreqstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ /* Copyright 1992, 1998 The Open Group diff --git a/nx-X11/include/extensions/dpms.h b/nx-X11/include/extensions/dpms.h index 87d7c9c81..d972f2051 100644 --- a/nx-X11/include/extensions/dpms.h +++ b/nx-X11/include/extensions/dpms.h @@ -1,4 +1,3 @@ -/* $Xorg: dpms.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ /***************************************************************** Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts. @@ -26,7 +25,6 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/include/extensions/dpms.h,v 3.4 2000/03/15 16:51:51 tsi Exp $ */ #ifndef _X11_EXTENSIONS_DPMS_H #define _X11_EXTENSIONS_DPMS_H 1 diff --git a/nx-X11/include/extensions/dpmsstr.h b/nx-X11/include/extensions/dpmsstr.h index 9386d4a2c..31d36a559 100644 --- a/nx-X11/include/extensions/dpmsstr.h +++ b/nx-X11/include/extensions/dpmsstr.h @@ -1,4 +1,3 @@ -/* $Xorg: dpmsstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */ /***************************************************************** Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts. diff --git a/nx-X11/include/extensions/panoramiXext.h b/nx-X11/include/extensions/panoramiXext.h index ad2f7e4b5..280efc599 100644 --- a/nx-X11/include/extensions/panoramiXext.h +++ b/nx-X11/include/extensions/panoramiXext.h @@ -1,4 +1,3 @@ -/* $Xorg: panoramiXext.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. Permission is hereby granted, free of charge, to any person obtaining a copy @@ -26,7 +25,6 @@ Equipment Corporation. /* * PanoramiX definitions */ -/* $XFree86: xc/include/extensions/panoramiXext.h,v 3.6 2001/01/17 17:53:22 dawes Exp $ */ /* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ diff --git a/nx-X11/include/extensions/panoramiXproto.h b/nx-X11/include/extensions/panoramiXproto.h index 6b27c56eb..14aa6c559 100644 --- a/nx-X11/include/extensions/panoramiXproto.h +++ b/nx-X11/include/extensions/panoramiXproto.h @@ -1,4 +1,3 @@ -/* $Xorg: panoramiXproto.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. Permission is hereby granted, free of charge, to any person obtaining a copy @@ -23,7 +22,6 @@ shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/include/extensions/panoramiXproto.h,v 3.5 2000/03/01 01:04:21 dawes Exp $ */ /* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ diff --git a/nx-X11/include/extensions/security.h b/nx-X11/include/extensions/security.h index b37d175bd..8d18230ab 100644 --- a/nx-X11/include/extensions/security.h +++ b/nx-X11/include/extensions/security.h @@ -1,4 +1,3 @@ -/* $Xorg: security.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ /* Copyright 1996, 1998 The Open Group @@ -24,7 +23,6 @@ not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/extensions/security.h,v 1.3 2001/12/14 19:53:29 dawes Exp $ */ #ifndef _SECURITY_H #define _SECURITY_H diff --git a/nx-X11/include/extensions/securstr.h b/nx-X11/include/extensions/securstr.h index 3e93fe10e..371f741cd 100644 --- a/nx-X11/include/extensions/securstr.h +++ b/nx-X11/include/extensions/securstr.h @@ -1,4 +1,3 @@ -/* $Xorg: securstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ /* Copyright 1996, 1998 The Open Group @@ -24,7 +23,6 @@ not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/include/extensions/securstr.h,v 1.2 2001/08/01 00:44:35 tsi Exp $ */ #ifndef _SECURSTR_H #define _SECURSTR_H diff --git a/nx-X11/include/extensions/sync.h b/nx-X11/include/extensions/sync.h index 8d2861663..71e4c0c72 100644 --- a/nx-X11/include/extensions/sync.h +++ b/nx-X11/include/extensions/sync.h @@ -1,4 +1,3 @@ -/* $Xorg: sync.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ /* Copyright 1991, 1993, 1994, 1998 The Open Group @@ -48,7 +47,6 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/extensions/sync.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */ #ifndef _SYNC_H_ #define _SYNC_H_ diff --git a/nx-X11/include/extensions/syncstr.h b/nx-X11/include/extensions/syncstr.h index 10ca9188a..75492b66a 100644 --- a/nx-X11/include/extensions/syncstr.h +++ b/nx-X11/include/extensions/syncstr.h @@ -1,4 +1,3 @@ -/* $Xorg: syncstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ /* Copyright 1991, 1993, 1994, 1998 The Open Group @@ -48,7 +47,6 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/extensions/syncstr.h,v 1.3 2003/07/16 01:38:24 dawes Exp $ */ #ifndef _SYNCSTR_H_ #define _SYNCSTR_H_ diff --git a/nx-X11/include/extensions/xcmiscstr.h b/nx-X11/include/extensions/xcmiscstr.h index 2aa45e617..d99dd7280 100644 --- a/nx-X11/include/extensions/xcmiscstr.h +++ b/nx-X11/include/extensions/xcmiscstr.h @@ -1,4 +1,3 @@ -/* $Xorg: xcmiscstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ /* Copyright 1993, 1994, 1998 The Open Group diff --git a/nx-X11/include/extensions/xf86bigfont.h b/nx-X11/include/extensions/xf86bigfont.h index d6be21b6f..557835024 100644 --- a/nx-X11/include/extensions/xf86bigfont.h +++ b/nx-X11/include/extensions/xf86bigfont.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/include/extensions/xf86bigfont.h,v 1.1 2000/02/08 17:18:25 dawes Exp $ */ /* * Declarations for the BIGFONT extension. * diff --git a/nx-X11/include/extensions/xf86bigfstr.h b/nx-X11/include/extensions/xf86bigfstr.h index 6f66e58d9..4a8eda47a 100644 --- a/nx-X11/include/extensions/xf86bigfstr.h +++ b/nx-X11/include/extensions/xf86bigfstr.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/include/extensions/xf86bigfstr.h,v 1.2 2000/02/29 03:09:00 dawes Exp $ */ /* * Declarations of request structures for the BIGFONT extension. * diff --git a/nx-X11/include/extensions/xtestext1.h b/nx-X11/include/extensions/xtestext1.h index 8f49cad07..5b67d7856 100644 --- a/nx-X11/include/extensions/xtestext1.h +++ b/nx-X11/include/extensions/xtestext1.h @@ -1,4 +1,3 @@ -/* $Xorg: xtestext1.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ /* * xtestext1.h * diff --git a/nx-X11/include/extensions/xteststr.h b/nx-X11/include/extensions/xteststr.h index a196b775d..7ab070031 100644 --- a/nx-X11/include/extensions/xteststr.h +++ b/nx-X11/include/extensions/xteststr.h @@ -1,4 +1,3 @@ -/* $Xorg: xteststr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ /* Copyright 1992, 1998 The Open Group diff --git a/nx-X11/include/keysym.h b/nx-X11/include/keysym.h index cd518a792..275482e53 100644 --- a/nx-X11/include/keysym.h +++ b/nx-X11/include/keysym.h @@ -1,4 +1,3 @@ -/* $Xorg: keysym.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */ /*********************************************************** @@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/keysym.h,v 1.3 2001/01/17 17:53:12 dawes Exp $ */ /* default keysyms */ #define XK_MISCELLANY diff --git a/nx-X11/include/keysymdef.h b/nx-X11/include/keysymdef.h index 648d978c9..0477c8d8b 100644 --- a/nx-X11/include/keysymdef.h +++ b/nx-X11/include/keysymdef.h @@ -1,4 +1,3 @@ -/* $Xorg: keysymdef.h,v 1.4 2001/02/09 02:03:23 $ */ /*********************************************************** Copyright 1987, 1994, 1998 The Open Group @@ -47,7 +46,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: $ */ /* * The "X11 Window System Protocol" standard defines in Appendix A the diff --git a/nx-X11/lib/X11/AddDIC.c b/nx-X11/lib/X11/AddDIC.c index d2638b1f9..b8d2ac361 100644 --- a/nx-X11/lib/X11/AddDIC.c +++ b/nx-X11/lib/X11/AddDIC.c @@ -1,4 +1,3 @@ -/* $Xorg: AddDIC.c,v 1.3 2000/08/17 19:44:29 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/AddSF.c b/nx-X11/lib/X11/AddSF.c index 3ab0514a6..c94601389 100644 --- a/nx-X11/lib/X11/AddSF.c +++ b/nx-X11/lib/X11/AddSF.c @@ -1,4 +1,3 @@ -/* $Xorg: AddSF.c,v 1.3 2000/08/17 19:44:29 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/AllCells.c b/nx-X11/lib/X11/AllCells.c index 9fbf87c8d..902324837 100644 --- a/nx-X11/lib/X11/AllCells.c +++ b/nx-X11/lib/X11/AllCells.c @@ -1,4 +1,3 @@ -/* $Xorg: AllCells.c,v 1.4 2001/02/09 02:03:30 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/AllPlanes.c b/nx-X11/lib/X11/AllPlanes.c index 12ab36fab..6e405f59d 100644 --- a/nx-X11/lib/X11/AllPlanes.c +++ b/nx-X11/lib/X11/AllPlanes.c @@ -1,4 +1,3 @@ -/* $Xorg: AllPlanes.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/AllPlanes.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/AllowEv.c b/nx-X11/lib/X11/AllowEv.c index c5905b99f..d1edddd01 100644 --- a/nx-X11/lib/X11/AllowEv.c +++ b/nx-X11/lib/X11/AllowEv.c @@ -1,4 +1,3 @@ -/* $Xorg: AllowEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/AllowEv.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/AuDispose.c b/nx-X11/lib/X11/AuDispose.c index dc2080f40..bb890201d 100644 --- a/nx-X11/lib/X11/AuDispose.c +++ b/nx-X11/lib/X11/AuDispose.c @@ -1,4 +1,3 @@ -/* $Xorg: AuDispose.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */ /* @@ -25,7 +24,6 @@ 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/lib/Xau/AuDispose.c,v 1.4 2001/07/25 15:04:48 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/AuFileName.c b/nx-X11/lib/X11/AuFileName.c index 6ab0138b8..6c4fb7dc3 100644 --- a/nx-X11/lib/X11/AuFileName.c +++ b/nx-X11/lib/X11/AuFileName.c @@ -1,4 +1,3 @@ -/* $Xorg: AuFileName.c,v 1.5 2001/02/09 02:03:42 xorgcvs Exp $ */ /* @@ -25,7 +24,6 @@ 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/lib/Xau/AuFileName.c,v 3.6 2001/07/25 15:04:48 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/AuGetBest.c b/nx-X11/lib/X11/AuGetBest.c index 03d49ac80..fce9ddead 100644 --- a/nx-X11/lib/X11/AuGetBest.c +++ b/nx-X11/lib/X11/AuGetBest.c @@ -1,4 +1,3 @@ -/* $Xorg: AuGetBest.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */ /* @@ -25,7 +24,6 @@ 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/lib/Xau/AuGetBest.c,v 1.7 2001/12/14 19:54:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/AuRead.c b/nx-X11/lib/X11/AuRead.c index 2e2509633..61814792d 100644 --- a/nx-X11/lib/X11/AuRead.c +++ b/nx-X11/lib/X11/AuRead.c @@ -1,4 +1,3 @@ -/* $Xorg: AuRead.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */ /* @@ -25,7 +24,6 @@ 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/lib/Xau/AuRead.c,v 1.5 2001/07/25 15:04:48 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/AutoRep.c b/nx-X11/lib/X11/AutoRep.c index 404d520b9..857515413 100644 --- a/nx-X11/lib/X11/AutoRep.c +++ b/nx-X11/lib/X11/AutoRep.c @@ -1,4 +1,3 @@ -/* $Xorg: AutoRep.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1985, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/AutoRep.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Backgnd.c b/nx-X11/lib/X11/Backgnd.c index dbb92425c..ee084286b 100644 --- a/nx-X11/lib/X11/Backgnd.c +++ b/nx-X11/lib/X11/Backgnd.c @@ -1,4 +1,3 @@ -/* $Xorg: Backgnd.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Backgnd.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/BdrWidth.c b/nx-X11/lib/X11/BdrWidth.c index db6df0135..66b650458 100644 --- a/nx-X11/lib/X11/BdrWidth.c +++ b/nx-X11/lib/X11/BdrWidth.c @@ -1,4 +1,3 @@ -/* $Xorg: BdrWidth.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* @@ -27,7 +26,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/BdrWidth.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Bell.c b/nx-X11/lib/X11/Bell.c index 8eebc6b08..b791f5739 100644 --- a/nx-X11/lib/X11/Bell.c +++ b/nx-X11/lib/X11/Bell.c @@ -1,4 +1,3 @@ -/* $Xorg: Bell.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Bell.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Border.c b/nx-X11/lib/X11/Border.c index 8f0bdb683..d41f78546 100644 --- a/nx-X11/lib/X11/Border.c +++ b/nx-X11/lib/X11/Border.c @@ -1,4 +1,3 @@ -/* $Xorg: Border.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Border.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CCC.c b/nx-X11/lib/X11/CCC.c index 7d4a9b1a2..021fb14a2 100644 --- a/nx-X11/lib/X11/CCC.c +++ b/nx-X11/lib/X11/CCC.c @@ -1,4 +1,3 @@ -/* $Xorg: CCC.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -33,7 +32,6 @@ * * */ -/* $XFree86: xc/lib/X11/CCC.c,v 1.4 2001/12/14 19:53:56 dawes Exp $ */ /* diff --git a/nx-X11/lib/X11/ChAccCon.c b/nx-X11/lib/X11/ChAccCon.c index eef3bb016..f68714892 100644 --- a/nx-X11/lib/X11/ChAccCon.c +++ b/nx-X11/lib/X11/ChAccCon.c @@ -1,4 +1,3 @@ -/* $Xorg: ChAccCon.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChAccCon.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChActPGb.c b/nx-X11/lib/X11/ChActPGb.c index 42ec3305b..82d404310 100644 --- a/nx-X11/lib/X11/ChActPGb.c +++ b/nx-X11/lib/X11/ChActPGb.c @@ -1,4 +1,3 @@ -/* $Xorg: ChActPGb.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChActPGb.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChClMode.c b/nx-X11/lib/X11/ChClMode.c index 1b22f68b6..29726e337 100644 --- a/nx-X11/lib/X11/ChClMode.c +++ b/nx-X11/lib/X11/ChClMode.c @@ -1,4 +1,3 @@ -/* $Xorg: ChClMode.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChClMode.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChCmap.c b/nx-X11/lib/X11/ChCmap.c index 112c944b2..25e869c8c 100644 --- a/nx-X11/lib/X11/ChCmap.c +++ b/nx-X11/lib/X11/ChCmap.c @@ -1,4 +1,3 @@ -/* $Xorg: ChCmap.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChCmap.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChGC.c b/nx-X11/lib/X11/ChGC.c index bafa1d496..74ba7233f 100644 --- a/nx-X11/lib/X11/ChGC.c +++ b/nx-X11/lib/X11/ChGC.c @@ -1,4 +1,3 @@ -/* $Xorg: ChGC.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChGC.c,v 1.4 2001/12/14 19:53:57 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChKeyCon.c b/nx-X11/lib/X11/ChKeyCon.c index 831f6f0eb..cc38b05dc 100644 --- a/nx-X11/lib/X11/ChKeyCon.c +++ b/nx-X11/lib/X11/ChKeyCon.c @@ -1,4 +1,3 @@ -/* $Xorg: ChKeyCon.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChKeyCon.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChPntCon.c b/nx-X11/lib/X11/ChPntCon.c index 225d031c6..1dba32504 100644 --- a/nx-X11/lib/X11/ChPntCon.c +++ b/nx-X11/lib/X11/ChPntCon.c @@ -1,4 +1,3 @@ -/* $Xorg: ChPntCon.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChPntCon.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChProp.c b/nx-X11/lib/X11/ChProp.c index 8c524cafe..347c3d7a1 100644 --- a/nx-X11/lib/X11/ChProp.c +++ b/nx-X11/lib/X11/ChProp.c @@ -1,4 +1,3 @@ -/* $Xorg: ChProp.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChProp.c,v 1.4 2001/12/14 19:53:57 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChSaveSet.c b/nx-X11/lib/X11/ChSaveSet.c index 9862db72d..6fd341b48 100644 --- a/nx-X11/lib/X11/ChSaveSet.c +++ b/nx-X11/lib/X11/ChSaveSet.c @@ -1,4 +1,3 @@ -/* $Xorg: ChSaveSet.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChSaveSet.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChWAttrs.c b/nx-X11/lib/X11/ChWAttrs.c index 57b81ab15..b766e648c 100644 --- a/nx-X11/lib/X11/ChWAttrs.c +++ b/nx-X11/lib/X11/ChWAttrs.c @@ -1,4 +1,3 @@ -/* $Xorg: ChWAttrs.c,v 1.5 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChWAttrs.c,v 1.4 2001/12/14 19:53:57 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChWindow.c b/nx-X11/lib/X11/ChWindow.c index 615b6d27c..2c395678d 100644 --- a/nx-X11/lib/X11/ChWindow.c +++ b/nx-X11/lib/X11/ChWindow.c @@ -1,4 +1,3 @@ -/* $Xorg: ChWindow.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChWindow.c,v 1.5 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChkIfEv.c b/nx-X11/lib/X11/ChkIfEv.c index d0f9d6272..5de869492 100644 --- a/nx-X11/lib/X11/ChkIfEv.c +++ b/nx-X11/lib/X11/ChkIfEv.c @@ -1,4 +1,3 @@ -/* $Xorg: ChkIfEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1985, 1987, 1998 The Open Group diff --git a/nx-X11/lib/X11/ChkMaskEv.c b/nx-X11/lib/X11/ChkMaskEv.c index 29f465700..d1d48cc4f 100644 --- a/nx-X11/lib/X11/ChkMaskEv.c +++ b/nx-X11/lib/X11/ChkMaskEv.c @@ -1,4 +1,3 @@ -/* $Xorg: ChkMaskEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1985, 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChkMaskEv.c,v 3.5 2001/10/28 03:32:29 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChkTypEv.c b/nx-X11/lib/X11/ChkTypEv.c index fd40afb94..558099c1b 100644 --- a/nx-X11/lib/X11/ChkTypEv.c +++ b/nx-X11/lib/X11/ChkTypEv.c @@ -1,4 +1,3 @@ -/* $Xorg: ChkTypEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1985, 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChkTypEv.c,v 1.2 2001/10/28 03:32:29 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChkTypWEv.c b/nx-X11/lib/X11/ChkTypWEv.c index 1be4d2a17..cbf8355fe 100644 --- a/nx-X11/lib/X11/ChkTypWEv.c +++ b/nx-X11/lib/X11/ChkTypWEv.c @@ -1,4 +1,3 @@ -/* $Xorg: ChkTypWEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1985, 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChkTypWEv.c,v 1.2 2001/10/28 03:32:29 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ChkWinEv.c b/nx-X11/lib/X11/ChkWinEv.c index 9b60ab43b..381c30cdc 100644 --- a/nx-X11/lib/X11/ChkWinEv.c +++ b/nx-X11/lib/X11/ChkWinEv.c @@ -1,4 +1,3 @@ -/* $Xorg: ChkWinEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1985, 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ChkWinEv.c,v 3.5 2001/10/28 03:32:30 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CirWin.c b/nx-X11/lib/X11/CirWin.c index 100cbbe63..d6702f671 100644 --- a/nx-X11/lib/X11/CirWin.c +++ b/nx-X11/lib/X11/CirWin.c @@ -1,4 +1,3 @@ -/* $Xorg: CirWin.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CirWin.c,v 1.3 2001/01/17 19:41:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CirWinDn.c b/nx-X11/lib/X11/CirWinDn.c index 83a5966db..31b9e68c0 100644 --- a/nx-X11/lib/X11/CirWinDn.c +++ b/nx-X11/lib/X11/CirWinDn.c @@ -1,4 +1,3 @@ -/* $Xorg: CirWinDn.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CirWinDn.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CirWinUp.c b/nx-X11/lib/X11/CirWinUp.c index 42a264171..00ad09403 100644 --- a/nx-X11/lib/X11/CirWinUp.c +++ b/nx-X11/lib/X11/CirWinUp.c @@ -1,4 +1,3 @@ -/* $Xorg: CirWinUp.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CirWinUp.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ClDisplay.c b/nx-X11/lib/X11/ClDisplay.c index dfbc2f518..48625d673 100644 --- a/nx-X11/lib/X11/ClDisplay.c +++ b/nx-X11/lib/X11/ClDisplay.c @@ -1,4 +1,3 @@ -/* $Xorg: ClDisplay.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* @@ -27,7 +26,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/ClDisplay.c,v 1.4 2001/12/14 19:53:58 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Clear.c b/nx-X11/lib/X11/Clear.c index 314d25947..170765c0f 100644 --- a/nx-X11/lib/X11/Clear.c +++ b/nx-X11/lib/X11/Clear.c @@ -1,4 +1,3 @@ -/* $Xorg: Clear.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Clear.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ClearArea.c b/nx-X11/lib/X11/ClearArea.c index 194a6a2d4..354c992c8 100644 --- a/nx-X11/lib/X11/ClearArea.c +++ b/nx-X11/lib/X11/ClearArea.c @@ -1,4 +1,3 @@ -/* $Xorg: ClearArea.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ClearArea.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ConfWind.c b/nx-X11/lib/X11/ConfWind.c index adcc7b667..2a7363041 100644 --- a/nx-X11/lib/X11/ConfWind.c +++ b/nx-X11/lib/X11/ConfWind.c @@ -1,4 +1,3 @@ -/* $Xorg: ConfWind.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ConfWind.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Context.c b/nx-X11/lib/X11/Context.c index 747bb6be7..9c9de653f 100644 --- a/nx-X11/lib/X11/Context.c +++ b/nx-X11/lib/X11/Context.c @@ -1,4 +1,3 @@ -/* $Xorg: Context.c,v 1.5 2001/02/09 02:03:31 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1988, 1990 by Digital Equipment Corporation, Maynard, @@ -50,7 +49,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/Context.c,v 1.5 2001/12/14 19:53:58 dawes Exp $ */ /* This module implements a simple sparse array. diff --git a/nx-X11/lib/X11/ConvSel.c b/nx-X11/lib/X11/ConvSel.c index 64739b240..3a3ca3865 100644 --- a/nx-X11/lib/X11/ConvSel.c +++ b/nx-X11/lib/X11/ConvSel.c @@ -1,4 +1,3 @@ -/* $Xorg: ConvSel.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */ /* Copyright 1986,1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ConvSel.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CopyArea.c b/nx-X11/lib/X11/CopyArea.c index f27bfef25..ec4ee1fed 100644 --- a/nx-X11/lib/X11/CopyArea.c +++ b/nx-X11/lib/X11/CopyArea.c @@ -1,4 +1,3 @@ -/* $Xorg: CopyArea.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CopyArea.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CopyCmap.c b/nx-X11/lib/X11/CopyCmap.c index cdfc78c9f..b33c57f5a 100644 --- a/nx-X11/lib/X11/CopyCmap.c +++ b/nx-X11/lib/X11/CopyCmap.c @@ -1,4 +1,3 @@ -/* $Xorg: CopyCmap.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CopyCmap.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CopyGC.c b/nx-X11/lib/X11/CopyGC.c index 7ca5f388c..ab6683261 100644 --- a/nx-X11/lib/X11/CopyGC.c +++ b/nx-X11/lib/X11/CopyGC.c @@ -1,4 +1,3 @@ -/* $Xorg: CopyGC.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CopyGC.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CopyPlane.c b/nx-X11/lib/X11/CopyPlane.c index b81388887..12b4ef2ac 100644 --- a/nx-X11/lib/X11/CopyPlane.c +++ b/nx-X11/lib/X11/CopyPlane.c @@ -1,4 +1,3 @@ -/* $Xorg: CopyPlane.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CopyPlane.c,v 1.3 2001/01/17 19:41:33 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CrBFData.c b/nx-X11/lib/X11/CrBFData.c index 2e665dfe7..c9f2149e5 100644 --- a/nx-X11/lib/X11/CrBFData.c +++ b/nx-X11/lib/X11/CrBFData.c @@ -1,4 +1,3 @@ -/* $Xorg: CrBFData.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group diff --git a/nx-X11/lib/X11/CrCmap.c b/nx-X11/lib/X11/CrCmap.c index c53faeb86..30e1a89c9 100644 --- a/nx-X11/lib/X11/CrCmap.c +++ b/nx-X11/lib/X11/CrCmap.c @@ -1,4 +1,3 @@ -/* $Xorg: CrCmap.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CrCmap.c,v 1.4 2001/12/14 19:53:59 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CrCursor.c b/nx-X11/lib/X11/CrCursor.c index 917349f08..18dfea654 100644 --- a/nx-X11/lib/X11/CrCursor.c +++ b/nx-X11/lib/X11/CrCursor.c @@ -1,4 +1,3 @@ -/* $Xorg: CrCursor.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/CrGC.c b/nx-X11/lib/X11/CrGC.c index 2cc09e24e..3c6fde33e 100644 --- a/nx-X11/lib/X11/CrGC.c +++ b/nx-X11/lib/X11/CrGC.c @@ -1,4 +1,3 @@ -/* $Xorg: CrGC.c,v 1.5 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CrGC.c,v 3.6 2001/12/14 19:53:59 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CrGlCur.c b/nx-X11/lib/X11/CrGlCur.c index 2d34a7549..88a8c30d3 100644 --- a/nx-X11/lib/X11/CrGlCur.c +++ b/nx-X11/lib/X11/CrGlCur.c @@ -1,4 +1,3 @@ -/* $Xorg: CrGlCur.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/CrGlCur.c,v 1.7 2003/04/13 19:22:15 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CrPFBData.c b/nx-X11/lib/X11/CrPFBData.c index b65e32fcb..872dc204e 100644 --- a/nx-X11/lib/X11/CrPFBData.c +++ b/nx-X11/lib/X11/CrPFBData.c @@ -1,4 +1,3 @@ -/* $Xorg: CrPFBData.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group diff --git a/nx-X11/lib/X11/CrPixmap.c b/nx-X11/lib/X11/CrPixmap.c index 72ef6960f..648a3de3d 100644 --- a/nx-X11/lib/X11/CrPixmap.c +++ b/nx-X11/lib/X11/CrPixmap.c @@ -1,4 +1,3 @@ -/* $Xorg: CrPixmap.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/CrWindow.c b/nx-X11/lib/X11/CrWindow.c index f64ca9f64..a5bc59df9 100644 --- a/nx-X11/lib/X11/CrWindow.c +++ b/nx-X11/lib/X11/CrWindow.c @@ -1,4 +1,3 @@ -/* $Xorg: CrWindow.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/Cursor.c b/nx-X11/lib/X11/Cursor.c index 98ac36bbd..5700f707a 100644 --- a/nx-X11/lib/X11/Cursor.c +++ b/nx-X11/lib/X11/Cursor.c @@ -1,4 +1,3 @@ -/* $Xorg: Cursor.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Cursor.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Cv.h b/nx-X11/lib/X11/Cv.h index a887e9d2b..0b662811f 100644 --- a/nx-X11/lib/X11/Cv.h +++ b/nx-X11/lib/X11/Cv.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/Cv.h,v 1.1 2003/04/13 19:22:15 dawes Exp $ */ #ifndef _CV_H_ #define _CV_H_ diff --git a/nx-X11/lib/X11/CvColW.c b/nx-X11/lib/X11/CvColW.c index d57a7666f..cfb2cf056 100644 --- a/nx-X11/lib/X11/CvColW.c +++ b/nx-X11/lib/X11/CvColW.c @@ -1,4 +1,3 @@ -/* $Xorg: CvColW.c,v 1.3 2000/08/17 19:44:32 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -33,7 +32,6 @@ * * */ -/* $XFree86: xc/lib/X11/CvColW.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/CvCols.c b/nx-X11/lib/X11/CvCols.c index fc343cda8..356f97765 100644 --- a/nx-X11/lib/X11/CvCols.c +++ b/nx-X11/lib/X11/CvCols.c @@ -1,4 +1,3 @@ -/* $Xorg: CvCols.c,v 1.3 2000/08/17 19:44:32 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -33,7 +32,6 @@ * * */ -/* $XFree86: xc/lib/X11/CvCols.c,v 1.4 2003/04/13 19:22:15 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DefCursor.c b/nx-X11/lib/X11/DefCursor.c index 053afbada..ebfd4620d 100644 --- a/nx-X11/lib/X11/DefCursor.c +++ b/nx-X11/lib/X11/DefCursor.c @@ -1,4 +1,3 @@ -/* $Xorg: DefCursor.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986,1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DefCursor.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DelProp.c b/nx-X11/lib/X11/DelProp.c index fd40b7542..d598cc551 100644 --- a/nx-X11/lib/X11/DelProp.c +++ b/nx-X11/lib/X11/DelProp.c @@ -1,4 +1,3 @@ -/* $Xorg: DelProp.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DelProp.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Depths.c b/nx-X11/lib/X11/Depths.c index 82ce2c89f..14aebceb6 100644 --- a/nx-X11/lib/X11/Depths.c +++ b/nx-X11/lib/X11/Depths.c @@ -1,4 +1,3 @@ -/* $Xorg: Depths.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group diff --git a/nx-X11/lib/X11/DestSubs.c b/nx-X11/lib/X11/DestSubs.c index 3d5f48d4f..b250d5791 100644 --- a/nx-X11/lib/X11/DestSubs.c +++ b/nx-X11/lib/X11/DestSubs.c @@ -1,4 +1,3 @@ -/* $Xorg: DestSubs.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DestSubs.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DestWind.c b/nx-X11/lib/X11/DestWind.c index a079d448e..099027219 100644 --- a/nx-X11/lib/X11/DestWind.c +++ b/nx-X11/lib/X11/DestWind.c @@ -1,4 +1,3 @@ -/* $Xorg: DestWind.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DestWind.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DisName.c b/nx-X11/lib/X11/DisName.c index 59b5b3e1f..fbadb679d 100644 --- a/nx-X11/lib/X11/DisName.c +++ b/nx-X11/lib/X11/DisName.c @@ -1,4 +1,3 @@ -/* $Xorg: DisName.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* diff --git a/nx-X11/lib/X11/DrArc.c b/nx-X11/lib/X11/DrArc.c index 58e55771e..d68d70f95 100644 --- a/nx-X11/lib/X11/DrArc.c +++ b/nx-X11/lib/X11/DrArc.c @@ -1,4 +1,3 @@ -/* $Xorg: DrArc.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DrArc.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ /* Note to future maintainers: XDrawArc does NOT batch successive PolyArc requests into a single request like XDrawLine, XDrawPoint, etc. diff --git a/nx-X11/lib/X11/DrArcs.c b/nx-X11/lib/X11/DrArcs.c index 8e028633c..283f6f952 100644 --- a/nx-X11/lib/X11/DrArcs.c +++ b/nx-X11/lib/X11/DrArcs.c @@ -1,4 +1,3 @@ -/* $Xorg: DrArcs.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DrArcs.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DrLine.c b/nx-X11/lib/X11/DrLine.c index 4a7c620b5..ddee9777a 100644 --- a/nx-X11/lib/X11/DrLine.c +++ b/nx-X11/lib/X11/DrLine.c @@ -1,4 +1,3 @@ -/* $Xorg: DrLine.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DrLine.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DrLines.c b/nx-X11/lib/X11/DrLines.c index ea8bf82b8..f1ddb884c 100644 --- a/nx-X11/lib/X11/DrLines.c +++ b/nx-X11/lib/X11/DrLines.c @@ -1,4 +1,3 @@ -/* $Xorg: DrLines.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DrLines.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DrPoint.c b/nx-X11/lib/X11/DrPoint.c index 26d17ef88..f5341be0d 100644 --- a/nx-X11/lib/X11/DrPoint.c +++ b/nx-X11/lib/X11/DrPoint.c @@ -1,4 +1,3 @@ -/* $Xorg: DrPoint.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DrPoint.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DrPoints.c b/nx-X11/lib/X11/DrPoints.c index 1637aa896..4f318eb41 100644 --- a/nx-X11/lib/X11/DrPoints.c +++ b/nx-X11/lib/X11/DrPoints.c @@ -1,4 +1,3 @@ -/* $Xorg: DrPoints.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DrPoints.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DrRect.c b/nx-X11/lib/X11/DrRect.c index affbc982d..9dadf063b 100644 --- a/nx-X11/lib/X11/DrRect.c +++ b/nx-X11/lib/X11/DrRect.c @@ -1,4 +1,3 @@ -/* $Xorg: DrRect.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DrRect.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DrRects.c b/nx-X11/lib/X11/DrRects.c index b300f2fe5..1773cb2f3 100644 --- a/nx-X11/lib/X11/DrRects.c +++ b/nx-X11/lib/X11/DrRects.c @@ -1,4 +1,3 @@ -/* $Xorg: DrRects.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DrRects.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/DrSegs.c b/nx-X11/lib/X11/DrSegs.c index e7e61b891..9cd144e06 100644 --- a/nx-X11/lib/X11/DrSegs.c +++ b/nx-X11/lib/X11/DrSegs.c @@ -1,4 +1,3 @@ -/* $Xorg: DrSegs.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/DrSegs.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ErrDes.c b/nx-X11/lib/X11/ErrDes.c index 64373ffd0..fae9deba2 100644 --- a/nx-X11/lib/X11/ErrDes.c +++ b/nx-X11/lib/X11/ErrDes.c @@ -49,7 +49,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/ErrDes.c,v 3.11 2003/08/06 14:03:59 eich Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ErrHndlr.c b/nx-X11/lib/X11/ErrHndlr.c index b3c2ce5a0..4785ca157 100644 --- a/nx-X11/lib/X11/ErrHndlr.c +++ b/nx-X11/lib/X11/ErrHndlr.c @@ -1,4 +1,3 @@ -/* $Xorg: ErrHndlr.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ErrHndlr.c,v 1.6 2003/04/13 19:22:15 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/EvToWire.c b/nx-X11/lib/X11/EvToWire.c index 0fb3068c0..f8a2565dd 100644 --- a/nx-X11/lib/X11/EvToWire.c +++ b/nx-X11/lib/X11/EvToWire.c @@ -1,4 +1,3 @@ -/* $Xorg: EvToWire.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* @@ -27,7 +26,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/EvToWire.c,v 1.4 2001/08/18 02:41:28 dawes Exp $ */ /* * XEvToWire.c - Internal support routines for the C subroutine diff --git a/nx-X11/lib/X11/FSSaver.c b/nx-X11/lib/X11/FSSaver.c index 8ffa9593c..bb4b6a32e 100644 --- a/nx-X11/lib/X11/FSSaver.c +++ b/nx-X11/lib/X11/FSSaver.c @@ -1,4 +1,3 @@ -/* $Xorg: FSSaver.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FSSaver.c,v 1.3 2001/01/17 19:41:35 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FSWrap.c b/nx-X11/lib/X11/FSWrap.c index 77dd3b59c..50fab8ed3 100644 --- a/nx-X11/lib/X11/FSWrap.c +++ b/nx-X11/lib/X11/FSWrap.c @@ -1,4 +1,3 @@ -/* $Xorg: FSWrap.c,v 1.5 2001/02/09 02:03:32 xorgcvs Exp $ */ /* * Copyright 1991 by the Open Software Foundation @@ -56,7 +55,6 @@ from The Open Group. */ -/* $XFree86: xc/lib/X11/FSWrap.c,v 1.8 2003/08/22 19:27:24 eich Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FetchName.c b/nx-X11/lib/X11/FetchName.c index 216c7453d..fc8f64eb8 100644 --- a/nx-X11/lib/X11/FetchName.c +++ b/nx-X11/lib/X11/FetchName.c @@ -1,4 +1,3 @@ -/* $Xorg: FetchName.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/FillArc.c b/nx-X11/lib/X11/FillArc.c index 12d17dba1..6364ff3ae 100644 --- a/nx-X11/lib/X11/FillArc.c +++ b/nx-X11/lib/X11/FillArc.c @@ -1,4 +1,3 @@ -/* $Xorg: FillArc.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FillArc.c,v 1.3 2001/01/17 19:41:35 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FillArcs.c b/nx-X11/lib/X11/FillArcs.c index 27f0b8ffa..44b0f3b97 100644 --- a/nx-X11/lib/X11/FillArcs.c +++ b/nx-X11/lib/X11/FillArcs.c @@ -1,4 +1,3 @@ -/* $Xorg: FillArcs.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FillArcs.c,v 1.3 2001/01/17 19:41:35 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FillPoly.c b/nx-X11/lib/X11/FillPoly.c index 93884d793..8bb6b6f1b 100644 --- a/nx-X11/lib/X11/FillPoly.c +++ b/nx-X11/lib/X11/FillPoly.c @@ -1,4 +1,3 @@ -/* $Xorg: FillPoly.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FillPoly.c,v 1.3 2001/01/17 19:41:35 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FillRct.c b/nx-X11/lib/X11/FillRct.c index e1b7ad091..293baf93a 100644 --- a/nx-X11/lib/X11/FillRct.c +++ b/nx-X11/lib/X11/FillRct.c @@ -1,4 +1,3 @@ -/* $Xorg: FillRct.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FillRct.c,v 1.3 2001/01/17 19:41:35 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FillRcts.c b/nx-X11/lib/X11/FillRcts.c index 0c234f018..949bcd7bf 100644 --- a/nx-X11/lib/X11/FillRcts.c +++ b/nx-X11/lib/X11/FillRcts.c @@ -1,4 +1,3 @@ -/* $Xorg: FillRcts.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FillRcts.c,v 1.3 2001/01/17 19:41:35 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FilterEv.c b/nx-X11/lib/X11/FilterEv.c index 469207793..37a4d79af 100644 --- a/nx-X11/lib/X11/FilterEv.c +++ b/nx-X11/lib/X11/FilterEv.c @@ -1,4 +1,3 @@ -/* $Xorg: FilterEv.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* * Copyright 1990, 1991 by OMRON Corporation @@ -53,7 +52,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/FilterEv.c,v 3.4 2001/07/29 05:01:11 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Flush.c b/nx-X11/lib/X11/Flush.c index 3df8731ba..0328bf8f6 100644 --- a/nx-X11/lib/X11/Flush.c +++ b/nx-X11/lib/X11/Flush.c @@ -1,4 +1,3 @@ -/* $Xorg: Flush.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Flush.c,v 1.3 2001/01/17 19:41:35 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Font.c b/nx-X11/lib/X11/Font.c index bb56c96a3..92ba71a5d 100644 --- a/nx-X11/lib/X11/Font.c +++ b/nx-X11/lib/X11/Font.c @@ -1,4 +1,3 @@ -/* $Xorg: Font.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -27,7 +26,6 @@ sale, use or other dealings in this Software without prior written authorization from the X Consortium and the XFree86 Project. */ -/* $XFree86: xc/lib/X11/Font.c,v 1.17 2003/04/13 19:22:16 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FontInfo.c b/nx-X11/lib/X11/FontInfo.c index 815045d01..c46d34ec1 100644 --- a/nx-X11/lib/X11/FontInfo.c +++ b/nx-X11/lib/X11/FontInfo.c @@ -1,4 +1,3 @@ -/* $Xorg: FontInfo.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FontInfo.c,v 1.6 2001/12/14 19:54:00 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FontNames.c b/nx-X11/lib/X11/FontNames.c index 03785b5a6..f0b72a75e 100644 --- a/nx-X11/lib/X11/FontNames.c +++ b/nx-X11/lib/X11/FontNames.c @@ -1,4 +1,3 @@ -/* $Xorg: FontNames.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -25,7 +24,6 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/FontNames.c,v 1.6 2001/12/14 19:54:00 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FreeCmap.c b/nx-X11/lib/X11/FreeCmap.c index c399c1f27..d43358548 100644 --- a/nx-X11/lib/X11/FreeCmap.c +++ b/nx-X11/lib/X11/FreeCmap.c @@ -1,4 +1,3 @@ -/* $Xorg: FreeCmap.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FreeCmap.c,v 1.4 2001/12/14 19:54:00 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FreeCols.c b/nx-X11/lib/X11/FreeCols.c index 1ae525862..ad2abcfa1 100644 --- a/nx-X11/lib/X11/FreeCols.c +++ b/nx-X11/lib/X11/FreeCols.c @@ -1,4 +1,3 @@ -/* $Xorg: FreeCols.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FreeCols.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FreeCurs.c b/nx-X11/lib/X11/FreeCurs.c index 45f5d0440..8f77de074 100644 --- a/nx-X11/lib/X11/FreeCurs.c +++ b/nx-X11/lib/X11/FreeCurs.c @@ -1,4 +1,3 @@ -/* $Xorg: FreeCurs.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FreeCurs.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FreeEData.c b/nx-X11/lib/X11/FreeEData.c index d8278cbaf..847f71eb9 100644 --- a/nx-X11/lib/X11/FreeEData.c +++ b/nx-X11/lib/X11/FreeEData.c @@ -1,4 +1,3 @@ -/* $Xorg: FreeEData.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FreeEData.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FreeGC.c b/nx-X11/lib/X11/FreeGC.c index ccfbba5d4..ed0a3d00d 100644 --- a/nx-X11/lib/X11/FreeGC.c +++ b/nx-X11/lib/X11/FreeGC.c @@ -1,4 +1,3 @@ -/* $Xorg: FreeGC.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FreeGC.c,v 1.4 2001/08/18 02:41:28 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/FreePix.c b/nx-X11/lib/X11/FreePix.c index 5fe65babb..01bbbb660 100644 --- a/nx-X11/lib/X11/FreePix.c +++ b/nx-X11/lib/X11/FreePix.c @@ -1,4 +1,3 @@ -/* $Xorg: FreePix.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/FreePix.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GCMisc.c b/nx-X11/lib/X11/GCMisc.c index 5a8233bea..912308c40 100644 --- a/nx-X11/lib/X11/GCMisc.c +++ b/nx-X11/lib/X11/GCMisc.c @@ -1,4 +1,3 @@ -/* $Xorg: GCMisc.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GCMisc.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Geom.c b/nx-X11/lib/X11/Geom.c index 498c4455e..6b86be27e 100644 --- a/nx-X11/lib/X11/Geom.c +++ b/nx-X11/lib/X11/Geom.c @@ -1,4 +1,3 @@ -/* $Xorg: Geom.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* diff --git a/nx-X11/lib/X11/GetAtomNm.c b/nx-X11/lib/X11/GetAtomNm.c index fab3eea28..4efe3ddc8 100644 --- a/nx-X11/lib/X11/GetAtomNm.c +++ b/nx-X11/lib/X11/GetAtomNm.c @@ -1,4 +1,3 @@ -/* $Xorg: GetAtomNm.c,v 1.5 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GetAtomNm.c,v 3.4 2001/08/18 02:41:28 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetColor.c b/nx-X11/lib/X11/GetColor.c index 6bd9a4220..6725278e7 100644 --- a/nx-X11/lib/X11/GetColor.c +++ b/nx-X11/lib/X11/GetColor.c @@ -1,4 +1,3 @@ -/* $Xorg: GetColor.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GetColor.c,v 1.6 2003/04/13 19:22:16 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetDflt.c b/nx-X11/lib/X11/GetDflt.c index a881f1c28..7907a2c8f 100644 --- a/nx-X11/lib/X11/GetDflt.c +++ b/nx-X11/lib/X11/GetDflt.c @@ -1,4 +1,3 @@ -/* $Xorg: GetDflt.c,v 1.6 2001/02/09 02:03:33 xorgcvs Exp $ */ /*********************************************************** @@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/GetDflt.c,v 3.22 2003/04/13 19:22:16 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetFPath.c b/nx-X11/lib/X11/GetFPath.c index 55d36b1df..72ab74ed7 100644 --- a/nx-X11/lib/X11/GetFPath.c +++ b/nx-X11/lib/X11/GetFPath.c @@ -1,4 +1,3 @@ -/* $Xorg: GetFPath.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GetFPath.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetFProp.c b/nx-X11/lib/X11/GetFProp.c index 1360ca10d..10b1b5c2e 100644 --- a/nx-X11/lib/X11/GetFProp.c +++ b/nx-X11/lib/X11/GetFProp.c @@ -1,4 +1,3 @@ -/* $Xorg: GetFProp.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/GetGCVals.c b/nx-X11/lib/X11/GetGCVals.c index a7fbd7430..5e7ed2334 100644 --- a/nx-X11/lib/X11/GetGCVals.c +++ b/nx-X11/lib/X11/GetGCVals.c @@ -1,4 +1,3 @@ -/* $Xorg: GetGCVals.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* diff --git a/nx-X11/lib/X11/GetGeom.c b/nx-X11/lib/X11/GetGeom.c index cbe956f87..953deafe8 100644 --- a/nx-X11/lib/X11/GetGeom.c +++ b/nx-X11/lib/X11/GetGeom.c @@ -1,4 +1,3 @@ -/* $Xorg: GetGeom.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/GetHColor.c b/nx-X11/lib/X11/GetHColor.c index 61ab11e9c..d824d021b 100644 --- a/nx-X11/lib/X11/GetHColor.c +++ b/nx-X11/lib/X11/GetHColor.c @@ -1,4 +1,3 @@ -/* $Xorg: GetHColor.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/GetHints.c b/nx-X11/lib/X11/GetHints.c index 2c4d49d61..6469d506d 100644 --- a/nx-X11/lib/X11/GetHints.c +++ b/nx-X11/lib/X11/GetHints.c @@ -1,4 +1,3 @@ -/* $Xorg: GetHints.c,v 1.5 2001/02/09 02:03:33 xorgcvs Exp $ */ /*********************************************************** @@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/GetHints.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetIFocus.c b/nx-X11/lib/X11/GetIFocus.c index 5618196a9..e5f83160c 100644 --- a/nx-X11/lib/X11/GetIFocus.c +++ b/nx-X11/lib/X11/GetIFocus.c @@ -1,4 +1,3 @@ -/* $Xorg: GetIFocus.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GetIFocus.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetImage.c b/nx-X11/lib/X11/GetImage.c index 822455e59..44ca7b05f 100644 --- a/nx-X11/lib/X11/GetImage.c +++ b/nx-X11/lib/X11/GetImage.c @@ -1,4 +1,3 @@ -/* $Xorg: GetImage.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GetImage.c,v 1.4 2001/12/14 19:54:00 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetKCnt.c b/nx-X11/lib/X11/GetKCnt.c index 05d597af8..3a1cee6f9 100644 --- a/nx-X11/lib/X11/GetKCnt.c +++ b/nx-X11/lib/X11/GetKCnt.c @@ -1,4 +1,3 @@ -/* $Xorg: GetKCnt.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GetKCnt.c,v 1.5 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetMoEv.c b/nx-X11/lib/X11/GetMoEv.c index 45a9cee3d..8a9c25449 100644 --- a/nx-X11/lib/X11/GetMoEv.c +++ b/nx-X11/lib/X11/GetMoEv.c @@ -1,4 +1,3 @@ -/* $Xorg: GetMoEv.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/GetNrmHint.c b/nx-X11/lib/X11/GetNrmHint.c index c770df43d..527c7cf3c 100644 --- a/nx-X11/lib/X11/GetNrmHint.c +++ b/nx-X11/lib/X11/GetNrmHint.c @@ -1,4 +1,3 @@ -/* $Xorg: GetNrmHint.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /*********************************************************** Copyright 1988 by Wyse Technology, Inc., San Jose, Ca, Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, diff --git a/nx-X11/lib/X11/GetPCnt.c b/nx-X11/lib/X11/GetPCnt.c index e96e5b1f1..c30515112 100644 --- a/nx-X11/lib/X11/GetPCnt.c +++ b/nx-X11/lib/X11/GetPCnt.c @@ -1,4 +1,3 @@ -/* $Xorg: GetPCnt.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GetPCnt.c,v 1.3 2001/01/17 19:41:36 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetPntMap.c b/nx-X11/lib/X11/GetPntMap.c index 8a873c416..b8bd8cd66 100644 --- a/nx-X11/lib/X11/GetPntMap.c +++ b/nx-X11/lib/X11/GetPntMap.c @@ -1,4 +1,3 @@ -/* $Xorg: GetPntMap.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -25,7 +24,6 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/GetPntMap.c,v 1.6 2001/12/14 19:54:01 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetProp.c b/nx-X11/lib/X11/GetProp.c index e1caab934..80dd57c8e 100644 --- a/nx-X11/lib/X11/GetProp.c +++ b/nx-X11/lib/X11/GetProp.c @@ -1,4 +1,3 @@ -/* $Xorg: GetProp.c,v 1.5 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GetProp.c,v 1.5 2001/10/28 03:32:30 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetRGBCMap.c b/nx-X11/lib/X11/GetRGBCMap.c index 4df3ccced..7d1fb89e8 100644 --- a/nx-X11/lib/X11/GetRGBCMap.c +++ b/nx-X11/lib/X11/GetRGBCMap.c @@ -1,4 +1,3 @@ -/* $Xorg: GetRGBCMap.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* diff --git a/nx-X11/lib/X11/GetSOwner.c b/nx-X11/lib/X11/GetSOwner.c index 2d35ca195..00a4e2d1d 100644 --- a/nx-X11/lib/X11/GetSOwner.c +++ b/nx-X11/lib/X11/GetSOwner.c @@ -1,4 +1,3 @@ -/* $Xorg: GetSOwner.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/GetSSaver.c b/nx-X11/lib/X11/GetSSaver.c index f99d54f2e..bdae436df 100644 --- a/nx-X11/lib/X11/GetSSaver.c +++ b/nx-X11/lib/X11/GetSSaver.c @@ -1,4 +1,3 @@ -/* $Xorg: GetSSaver.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GetSSaver.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GetStCmap.c b/nx-X11/lib/X11/GetStCmap.c index ae085aa87..2a5d9dd92 100644 --- a/nx-X11/lib/X11/GetStCmap.c +++ b/nx-X11/lib/X11/GetStCmap.c @@ -1,4 +1,3 @@ -/* $Xorg: GetStCmap.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /*********************************************************** diff --git a/nx-X11/lib/X11/GetTxtProp.c b/nx-X11/lib/X11/GetTxtProp.c index dbff8abc8..1694107b8 100644 --- a/nx-X11/lib/X11/GetTxtProp.c +++ b/nx-X11/lib/X11/GetTxtProp.c @@ -1,4 +1,3 @@ -/* $Xorg: GetTxtProp.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /*********************************************************** Copyright 1988 by Wyse Technology, Inc., San Jose, Ca., diff --git a/nx-X11/lib/X11/GetWAttrs.c b/nx-X11/lib/X11/GetWAttrs.c index 6dcdaef22..4d51893d6 100644 --- a/nx-X11/lib/X11/GetWAttrs.c +++ b/nx-X11/lib/X11/GetWAttrs.c @@ -1,4 +1,3 @@ -/* $Xorg: GetWAttrs.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/GetWMCMapW.c b/nx-X11/lib/X11/GetWMCMapW.c index 496efd208..5a7d8acd8 100644 --- a/nx-X11/lib/X11/GetWMCMapW.c +++ b/nx-X11/lib/X11/GetWMCMapW.c @@ -1,4 +1,3 @@ -/* $Xorg: GetWMCMapW.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /*********************************************************** diff --git a/nx-X11/lib/X11/GetWMProto.c b/nx-X11/lib/X11/GetWMProto.c index 8584a4214..d0fe0b4f4 100644 --- a/nx-X11/lib/X11/GetWMProto.c +++ b/nx-X11/lib/X11/GetWMProto.c @@ -1,4 +1,3 @@ -/* $Xorg: GetWMProto.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /*********************************************************** diff --git a/nx-X11/lib/X11/GrButton.c b/nx-X11/lib/X11/GrButton.c index 9bb8b853b..6ad7e8ac6 100644 --- a/nx-X11/lib/X11/GrButton.c +++ b/nx-X11/lib/X11/GrButton.c @@ -1,4 +1,3 @@ -/* $Xorg: GrButton.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GrButton.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GrKey.c b/nx-X11/lib/X11/GrKey.c index ea6366199..51c30c977 100644 --- a/nx-X11/lib/X11/GrKey.c +++ b/nx-X11/lib/X11/GrKey.c @@ -1,4 +1,3 @@ -/* $Xorg: GrKey.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GrKey.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/GrKeybd.c b/nx-X11/lib/X11/GrKeybd.c index a4f2cafae..8b9802c58 100644 --- a/nx-X11/lib/X11/GrKeybd.c +++ b/nx-X11/lib/X11/GrKeybd.c @@ -1,4 +1,3 @@ -/* $Xorg: GrKeybd.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/GrPointer.c b/nx-X11/lib/X11/GrPointer.c index 7c140804e..39435da0c 100644 --- a/nx-X11/lib/X11/GrPointer.c +++ b/nx-X11/lib/X11/GrPointer.c @@ -1,4 +1,3 @@ -/* $Xorg: GrPointer.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/GrServer.c b/nx-X11/lib/X11/GrServer.c index bdb505137..7dc177890 100644 --- a/nx-X11/lib/X11/GrServer.c +++ b/nx-X11/lib/X11/GrServer.c @@ -1,4 +1,3 @@ -/* $Xorg: GrServer.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/GrServer.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/HVC.c b/nx-X11/lib/X11/HVC.c index 84fac58b9..d46a73f6f 100644 --- a/nx-X11/lib/X11/HVC.c +++ b/nx-X11/lib/X11/HVC.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/lib/X11/HVC.c,v 1.4 2005/07/03 07:00:55 daniels Exp $ */ -/* $Xorg: HVC.c,v 1.3 2000/08/17 19:44:36 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -48,7 +46,6 @@ * DOCUMENTATION * "TekColor Color Management System, System Implementor's Manual" */ -/* $XFree86: xc/lib/X11/HVC.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/HVCGcC.c b/nx-X11/lib/X11/HVCGcC.c index 10e0d487d..62f612f11 100644 --- a/nx-X11/lib/X11/HVCGcC.c +++ b/nx-X11/lib/X11/HVCGcC.c @@ -1,4 +1,3 @@ -/* $Xorg: HVCGcC.c,v 1.3 2000/08/17 19:44:36 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -43,7 +42,6 @@ * Source for XcmsTekHVCClipC() gamut compression routine. * */ -/* $XFree86: xc/lib/X11/HVCGcC.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/HVCGcV.c b/nx-X11/lib/X11/HVCGcV.c index 4e2c63688..e937cfbe5 100644 --- a/nx-X11/lib/X11/HVCGcV.c +++ b/nx-X11/lib/X11/HVCGcV.c @@ -1,4 +1,3 @@ -/* $Xorg: HVCGcV.c,v 1.3 2000/08/17 19:44:36 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -43,7 +42,6 @@ * Source for XcmsTekHVCClipV() gamut compression routine. * */ -/* $XFree86: xc/lib/X11/HVCGcV.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/HVCGcVC.c b/nx-X11/lib/X11/HVCGcVC.c index eef20ae81..9ef54439e 100644 --- a/nx-X11/lib/X11/HVCGcVC.c +++ b/nx-X11/lib/X11/HVCGcVC.c @@ -1,4 +1,3 @@ -/* $Xorg: HVCGcVC.c,v 1.3 2000/08/17 19:44:36 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -43,7 +42,6 @@ * Source for XcmsTekHVCClipVC() gamut * compression function. */ -/* $XFree86: xc/lib/X11/HVCGcVC.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/HVCMnV.c b/nx-X11/lib/X11/HVCMnV.c index 63a510888..cf4ef64a8 100644 --- a/nx-X11/lib/X11/HVCMnV.c +++ b/nx-X11/lib/X11/HVCMnV.c @@ -1,4 +1,3 @@ -/* $Xorg: HVCMnV.c,v 1.3 2000/08/17 19:44:37 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/HVCMxC.c b/nx-X11/lib/X11/HVCMxC.c index 64e7713e4..83e32ed7f 100644 --- a/nx-X11/lib/X11/HVCMxC.c +++ b/nx-X11/lib/X11/HVCMxC.c @@ -1,4 +1,3 @@ -/* $Xorg: HVCMxC.c,v 1.3 2000/08/17 19:44:37 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -44,7 +43,6 @@ * querying routine. * */ -/* $XFree86: xc/lib/X11/HVCMxC.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/HVCMxV.c b/nx-X11/lib/X11/HVCMxV.c index 34acdade0..7d172aa04 100644 --- a/nx-X11/lib/X11/HVCMxV.c +++ b/nx-X11/lib/X11/HVCMxV.c @@ -1,4 +1,3 @@ -/* $Xorg: HVCMxV.c,v 1.3 2000/08/17 19:44:37 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -44,7 +43,6 @@ * querying routine. * */ -/* $XFree86: xc/lib/X11/HVCMxV.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/HVCMxVC.c b/nx-X11/lib/X11/HVCMxVC.c index 74183fcf5..e9ea1eddf 100644 --- a/nx-X11/lib/X11/HVCMxVC.c +++ b/nx-X11/lib/X11/HVCMxVC.c @@ -1,4 +1,3 @@ -/* $Xorg: HVCMxVC.c,v 1.3 2000/08/17 19:44:37 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/HVCMxVs.c b/nx-X11/lib/X11/HVCMxVs.c index d90afa8be..3069e2a77 100644 --- a/nx-X11/lib/X11/HVCMxVs.c +++ b/nx-X11/lib/X11/HVCMxVs.c @@ -1,4 +1,3 @@ -/* $Xorg: HVCMxVs.c,v 1.3 2000/08/17 19:44:37 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -43,7 +42,6 @@ * Source for the XcmsTekHVCQueryMaxVSamples() gamut boundary * querying routine. */ -/* $XFree86: xc/lib/X11/HVCMxVs.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/HVCWpAj.c b/nx-X11/lib/X11/HVCWpAj.c index 558e90bc3..5e085628c 100644 --- a/nx-X11/lib/X11/HVCWpAj.c +++ b/nx-X11/lib/X11/HVCWpAj.c @@ -1,4 +1,3 @@ -/* $Xorg: HVCWpAj.c,v 1.3 2000/08/17 19:44:37 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/Host.c b/nx-X11/lib/X11/Host.c index 5fcb687cc..b2ce07338 100644 --- a/nx-X11/lib/X11/Host.c +++ b/nx-X11/lib/X11/Host.c @@ -1,5 +1,3 @@ -/* $Xorg: Host.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ -/* $XdotOrg: xc/lib/X11/Host.c,v 1.4 2005/07/03 07:00:55 daniels Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -35,7 +33,6 @@ of the copyright holder. X Window System is a trademark of The Open Group. */ -/* $XFree86: xc/lib/X11/Host.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */ /* this might be rightly regarded an os dependent file */ diff --git a/nx-X11/lib/X11/ICWrap.c b/nx-X11/lib/X11/ICWrap.c index 765457c32..601f1a755 100644 --- a/nx-X11/lib/X11/ICWrap.c +++ b/nx-X11/lib/X11/ICWrap.c @@ -64,7 +64,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/ICWrap.c,v 1.10 2003/04/25 14:12:38 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/IMWrap.c b/nx-X11/lib/X11/IMWrap.c index a90b40675..c64756373 100644 --- a/nx-X11/lib/X11/IMWrap.c +++ b/nx-X11/lib/X11/IMWrap.c @@ -57,7 +57,6 @@ from The Open Group. */ -/* $XFree86: xc/lib/X11/IMWrap.c,v 3.8 2001/12/14 19:54:01 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Iconify.c b/nx-X11/lib/X11/Iconify.c index 1077d9585..fbaef6af5 100644 --- a/nx-X11/lib/X11/Iconify.c +++ b/nx-X11/lib/X11/Iconify.c @@ -1,4 +1,3 @@ -/* $Xorg: Iconify.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */ /*********************************************************** Copyright 1988 by Wyse Technology, Inc., San Jose, Ca. diff --git a/nx-X11/lib/X11/IdOfPr.c b/nx-X11/lib/X11/IdOfPr.c index a8eda895e..4da613ec8 100644 --- a/nx-X11/lib/X11/IdOfPr.c +++ b/nx-X11/lib/X11/IdOfPr.c @@ -1,4 +1,3 @@ -/* $Xorg: IdOfPr.c,v 1.3 2000/08/17 19:44:38 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/IfEvent.c b/nx-X11/lib/X11/IfEvent.c index e3c27b301..434e815f7 100644 --- a/nx-X11/lib/X11/IfEvent.c +++ b/nx-X11/lib/X11/IfEvent.c @@ -1,4 +1,3 @@ -/* $Xorg: IfEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/IfEvent.c,v 1.4 2001/12/14 19:54:01 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ImText.c b/nx-X11/lib/X11/ImText.c index dad5bc92a..87cf22353 100644 --- a/nx-X11/lib/X11/ImText.c +++ b/nx-X11/lib/X11/ImText.c @@ -1,4 +1,3 @@ -/* $Xorg: ImText.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ImText.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ImText16.c b/nx-X11/lib/X11/ImText16.c index ef2752ba2..60bd79f0e 100644 --- a/nx-X11/lib/X11/ImText16.c +++ b/nx-X11/lib/X11/ImText16.c @@ -1,4 +1,3 @@ -/* $Xorg: ImText16.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ImText16.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ImUtil.c b/nx-X11/lib/X11/ImUtil.c index 2be839928..dabe3d5b6 100644 --- a/nx-X11/lib/X11/ImUtil.c +++ b/nx-X11/lib/X11/ImUtil.c @@ -1,4 +1,3 @@ -/* $Xorg: ImUtil.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ImUtil.c,v 3.12 2003/04/15 22:10:06 herrb Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ImUtil.h b/nx-X11/lib/X11/ImUtil.h index 89f038117..5b62571ac 100644 --- a/nx-X11/lib/X11/ImUtil.h +++ b/nx-X11/lib/X11/ImUtil.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/ImUtil.h,v 1.2 2003/04/15 22:10:07 herrb Exp $ */ #ifndef _IMUTIL_H_ #define _IMUTIL_H_ diff --git a/nx-X11/lib/X11/InitExt.c b/nx-X11/lib/X11/InitExt.c index 5aab682c7..51971970a 100644 --- a/nx-X11/lib/X11/InitExt.c +++ b/nx-X11/lib/X11/InitExt.c @@ -1,4 +1,3 @@ -/* $Xorg: InitExt.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/InitExt.c,v 1.7 2001/12/14 19:54:02 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/InsCmap.c b/nx-X11/lib/X11/InsCmap.c index 26a86446f..17e2c125f 100644 --- a/nx-X11/lib/X11/InsCmap.c +++ b/nx-X11/lib/X11/InsCmap.c @@ -1,4 +1,3 @@ -/* $Xorg: InsCmap.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/InsCmap.c,v 1.3 2001/01/17 19:41:38 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/IntAtom.c b/nx-X11/lib/X11/IntAtom.c index 714337c39..a1f9f7f14 100644 --- a/nx-X11/lib/X11/IntAtom.c +++ b/nx-X11/lib/X11/IntAtom.c @@ -1,4 +1,3 @@ -/* $Xorg: IntAtom.c,v 1.5 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1990, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/IntAtom.c,v 1.6 2001/12/14 19:54:02 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/KeyBind.c b/nx-X11/lib/X11/KeyBind.c index 4fc490972..866d296b2 100644 --- a/nx-X11/lib/X11/KeyBind.c +++ b/nx-X11/lib/X11/KeyBind.c @@ -1,4 +1,3 @@ -/* $Xorg: KeyBind.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1985, 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/KeyBind.c,v 1.8 2003/05/27 22:26:25 tsi Exp $ */ /* Beware, here be monsters (still under construction... - JG */ diff --git a/nx-X11/lib/X11/KeysymStr.c b/nx-X11/lib/X11/KeysymStr.c index b43e2735a..8afca1c5b 100644 --- a/nx-X11/lib/X11/KeysymStr.c +++ b/nx-X11/lib/X11/KeysymStr.c @@ -1,4 +1,3 @@ -/* $Xorg: KeysymStr.c,v 1.5 2001/02/09 02:03:34 xorgcvs Exp $ */ /* @@ -25,7 +24,6 @@ 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/lib/X11/KeysymStr.c,v 3.9 2003/04/13 19:22:16 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/KillCl.c b/nx-X11/lib/X11/KillCl.c index 4c2ddcfe6..f78932fbf 100644 --- a/nx-X11/lib/X11/KillCl.c +++ b/nx-X11/lib/X11/KillCl.c @@ -1,4 +1,3 @@ -/* $Xorg: KillCl.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/KillCl.c,v 1.3 2001/01/17 19:41:38 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LRGB.c b/nx-X11/lib/X11/LRGB.c index 392c59579..f57d091c8 100644 --- a/nx-X11/lib/X11/LRGB.c +++ b/nx-X11/lib/X11/LRGB.c @@ -1,4 +1,3 @@ -/* $Xorg: LRGB.c,v 1.3 2000/08/17 19:44:39 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -35,7 +34,6 @@ * 4. RGB intensity to CIE XYZ * */ -/* $XFree86: xc/lib/X11/LRGB.c,v 3.6 2003/04/13 19:22:16 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Lab.c b/nx-X11/lib/X11/Lab.c index 19b3e3a1d..4d426c463 100644 --- a/nx-X11/lib/X11/Lab.c +++ b/nx-X11/lib/X11/Lab.c @@ -1,4 +1,3 @@ -/* $Xorg: Lab.c,v 1.3 2000/08/17 19:44:39 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -36,7 +35,6 @@ * * Note that the range for L* is 0 to 1. */ -/* $XFree86: xc/lib/X11/Lab.c,v 1.3 2001/01/17 19:41:38 dawes Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/nx-X11/lib/X11/LabGcC.c b/nx-X11/lib/X11/LabGcC.c index e210cd235..7a9676c23 100644 --- a/nx-X11/lib/X11/LabGcC.c +++ b/nx-X11/lib/X11/LabGcC.c @@ -1,4 +1,3 @@ -/* $Xorg: LabGcC.c,v 1.3 2000/08/17 19:44:39 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -30,7 +29,6 @@ * Source for XcmsCIELabClipuv() gamut compression routine. * */ -/* $XFree86: xc/lib/X11/LabGcC.c,v 1.3 2001/01/17 19:41:38 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LabGcL.c b/nx-X11/lib/X11/LabGcL.c index 445e4da59..156035eab 100644 --- a/nx-X11/lib/X11/LabGcL.c +++ b/nx-X11/lib/X11/LabGcL.c @@ -1,4 +1,3 @@ -/* $Xorg: LabGcL.c,v 1.3 2000/08/17 19:44:39 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -30,7 +29,6 @@ * Source for XcmsCIELabClipL() gamut compression routine. * */ -/* $XFree86: xc/lib/X11/LabGcL.c,v 1.3 2001/01/17 19:41:38 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LabGcLC.c b/nx-X11/lib/X11/LabGcLC.c index f0726d936..1e9097074 100644 --- a/nx-X11/lib/X11/LabGcLC.c +++ b/nx-X11/lib/X11/LabGcLC.c @@ -1,4 +1,3 @@ -/* $Xorg: LabGcLC.c,v 1.3 2000/08/17 19:44:39 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -30,7 +29,6 @@ * Source for XcmsCIELabClipLab() gamut * compression function. */ -/* $XFree86: xc/lib/X11/LabGcLC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LabMnL.c b/nx-X11/lib/X11/LabMnL.c index 8016c4e6a..3ff15d8fa 100644 --- a/nx-X11/lib/X11/LabMnL.c +++ b/nx-X11/lib/X11/LabMnL.c @@ -1,4 +1,3 @@ -/* $Xorg: LabMnL.c,v 1.3 2000/08/17 19:44:39 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -31,7 +30,6 @@ * querying routine. * */ -/* $XFree86: xc/lib/X11/LabMnL.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LabMxC.c b/nx-X11/lib/X11/LabMxC.c index c57125b33..a22e7cba7 100644 --- a/nx-X11/lib/X11/LabMxC.c +++ b/nx-X11/lib/X11/LabMxC.c @@ -1,4 +1,3 @@ -/* $Xorg: LabMxC.c,v 1.3 2000/08/17 19:44:40 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -33,7 +32,6 @@ * querying routine. * */ -/* $XFree86: xc/lib/X11/LabMxC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LabMxL.c b/nx-X11/lib/X11/LabMxL.c index 91b3f559c..cb7f7c6de 100644 --- a/nx-X11/lib/X11/LabMxL.c +++ b/nx-X11/lib/X11/LabMxL.c @@ -1,4 +1,3 @@ -/* $Xorg: LabMxL.c,v 1.3 2000/08/17 19:44:40 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -31,7 +30,6 @@ * querying routine. * */ -/* $XFree86: xc/lib/X11/LabMxL.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LabMxLC.c b/nx-X11/lib/X11/LabMxLC.c index d4efba34c..3c11cc5e1 100644 --- a/nx-X11/lib/X11/LabMxLC.c +++ b/nx-X11/lib/X11/LabMxLC.c @@ -1,4 +1,3 @@ -/* $Xorg: LabMxLC.c,v 1.3 2000/08/17 19:44:40 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/LabWpAj.c b/nx-X11/lib/X11/LabWpAj.c index 38c57d260..5a61d9656 100644 --- a/nx-X11/lib/X11/LabWpAj.c +++ b/nx-X11/lib/X11/LabWpAj.c @@ -1,4 +1,3 @@ -/* $Xorg: LabWpAj.c,v 1.3 2000/08/17 19:44:40 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/LiHosts.c b/nx-X11/lib/X11/LiHosts.c index 4dce4a0e8..cdc97934a 100644 --- a/nx-X11/lib/X11/LiHosts.c +++ b/nx-X11/lib/X11/LiHosts.c @@ -1,5 +1,3 @@ -/* $Xorg: LiHosts.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ -/* $XdotOrg: xc/lib/X11/LiHosts.c,v 1.4 2005/07/03 07:00:55 daniels Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/LiICmaps.c b/nx-X11/lib/X11/LiICmaps.c index 72ebc4c54..09d82ea02 100644 --- a/nx-X11/lib/X11/LiICmaps.c +++ b/nx-X11/lib/X11/LiICmaps.c @@ -1,4 +1,3 @@ -/* $Xorg: LiICmaps.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/LiICmaps.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LiProps.c b/nx-X11/lib/X11/LiProps.c index 90021bab8..ef5c5e55a 100644 --- a/nx-X11/lib/X11/LiProps.c +++ b/nx-X11/lib/X11/LiProps.c @@ -1,4 +1,3 @@ -/* $Xorg: LiProps.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/LiProps.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ListExt.c b/nx-X11/lib/X11/ListExt.c index 9c01a8ee9..b04c15fea 100644 --- a/nx-X11/lib/X11/ListExt.c +++ b/nx-X11/lib/X11/ListExt.c @@ -1,4 +1,3 @@ -/* $Xorg: ListExt.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ListExt.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LoadFont.c b/nx-X11/lib/X11/LoadFont.c index de5f5cee4..88171a633 100644 --- a/nx-X11/lib/X11/LoadFont.c +++ b/nx-X11/lib/X11/LoadFont.c @@ -1,4 +1,3 @@ -/* $Xorg: LoadFont.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/LoadFont.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LockDis.c b/nx-X11/lib/X11/LockDis.c index d99d3bb68..c4f00e661 100644 --- a/nx-X11/lib/X11/LockDis.c +++ b/nx-X11/lib/X11/LockDis.c @@ -1,4 +1,3 @@ -/* $Xorg: LockDis.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* diff --git a/nx-X11/lib/X11/LookupCol.c b/nx-X11/lib/X11/LookupCol.c index 08285c18a..b2af4bfd6 100644 --- a/nx-X11/lib/X11/LookupCol.c +++ b/nx-X11/lib/X11/LookupCol.c @@ -1,4 +1,3 @@ -/* $Xorg: LookupCol.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1985, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/LookupCol.c,v 1.6 2003/04/13 19:22:16 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LowerWin.c b/nx-X11/lib/X11/LowerWin.c index 2db1e8abd..1ac6bb19b 100644 --- a/nx-X11/lib/X11/LowerWin.c +++ b/nx-X11/lib/X11/LowerWin.c @@ -1,4 +1,3 @@ -/* $Xorg: LowerWin.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/LowerWin.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Luv.c b/nx-X11/lib/X11/Luv.c index 206ae1017..ee62ff32a 100644 --- a/nx-X11/lib/X11/Luv.c +++ b/nx-X11/lib/X11/Luv.c @@ -1,4 +1,3 @@ -/* $Xorg: Luv.c,v 1.3 2000/08/17 19:44:41 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -38,7 +37,6 @@ * Fred W. Billmeyer & Max Saltzman, "Principles of Color * Technology", John Wily & Sons, Inc, 1981. */ -/* $XFree86: xc/lib/X11/Luv.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LuvGcC.c b/nx-X11/lib/X11/LuvGcC.c index ecae0fe6d..e85685a42 100644 --- a/nx-X11/lib/X11/LuvGcC.c +++ b/nx-X11/lib/X11/LuvGcC.c @@ -1,4 +1,3 @@ -/* $Xorg: LuvGcC.c,v 1.3 2000/08/17 19:44:41 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -30,7 +29,6 @@ * Source for XcmsCIELuvClipuv() gamut compression routine. * */ -/* $XFree86: xc/lib/X11/LuvGcC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LuvGcL.c b/nx-X11/lib/X11/LuvGcL.c index 81a553d3f..585f76694 100644 --- a/nx-X11/lib/X11/LuvGcL.c +++ b/nx-X11/lib/X11/LuvGcL.c @@ -1,4 +1,3 @@ -/* $Xorg: LuvGcL.c,v 1.3 2000/08/17 19:44:41 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -30,7 +29,6 @@ * Source for XcmsCIELuvClipL() gamut compression routine. * */ -/* $XFree86: xc/lib/X11/LuvGcL.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LuvGcLC.c b/nx-X11/lib/X11/LuvGcLC.c index a3cc0f68b..daa63a0f8 100644 --- a/nx-X11/lib/X11/LuvGcLC.c +++ b/nx-X11/lib/X11/LuvGcLC.c @@ -1,4 +1,3 @@ -/* $Xorg: LuvGcLC.c,v 1.3 2000/08/17 19:44:41 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -30,7 +29,6 @@ * Source for XcmsCIELuvClipLuv() gamut * compression function. */ -/* $XFree86: xc/lib/X11/LuvGcLC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LuvMnL.c b/nx-X11/lib/X11/LuvMnL.c index 9938ab495..d4e6c2d9e 100644 --- a/nx-X11/lib/X11/LuvMnL.c +++ b/nx-X11/lib/X11/LuvMnL.c @@ -1,4 +1,3 @@ -/* $Xorg: LuvMnL.c,v 1.3 2000/08/17 19:44:41 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -31,7 +30,6 @@ * querying routine. * */ -/* $XFree86: xc/lib/X11/LuvMnL.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LuvMxC.c b/nx-X11/lib/X11/LuvMxC.c index c77319d1f..8454071d3 100644 --- a/nx-X11/lib/X11/LuvMxC.c +++ b/nx-X11/lib/X11/LuvMxC.c @@ -1,4 +1,3 @@ -/* $Xorg: LuvMxC.c,v 1.3 2000/08/17 19:44:41 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -33,7 +32,6 @@ * querying routine. * */ -/* $XFree86: xc/lib/X11/LuvMxC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LuvMxL.c b/nx-X11/lib/X11/LuvMxL.c index d364078ac..d4387d7f9 100644 --- a/nx-X11/lib/X11/LuvMxL.c +++ b/nx-X11/lib/X11/LuvMxL.c @@ -1,4 +1,3 @@ -/* $Xorg: LuvMxL.c,v 1.3 2000/08/17 19:44:45 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -31,7 +30,6 @@ * querying routine. * */ -/* $XFree86: xc/lib/X11/LuvMxL.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/LuvMxLC.c b/nx-X11/lib/X11/LuvMxLC.c index 3f4c22943..54844041a 100644 --- a/nx-X11/lib/X11/LuvMxLC.c +++ b/nx-X11/lib/X11/LuvMxLC.c @@ -1,4 +1,3 @@ -/* $Xorg: LuvMxLC.c,v 1.3 2000/08/17 19:44:45 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/LuvWpAj.c b/nx-X11/lib/X11/LuvWpAj.c index c48531a50..7a45b4298 100644 --- a/nx-X11/lib/X11/LuvWpAj.c +++ b/nx-X11/lib/X11/LuvWpAj.c @@ -1,4 +1,3 @@ -/* $Xorg: LuvWpAj.c,v 1.3 2000/08/17 19:44:45 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/Macros.c b/nx-X11/lib/X11/Macros.c index 505ebc38c..acf44ae7a 100644 --- a/nx-X11/lib/X11/Macros.c +++ b/nx-X11/lib/X11/Macros.c @@ -1,4 +1,3 @@ -/* $Xorg: Macros.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Macros.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/MapRaised.c b/nx-X11/lib/X11/MapRaised.c index 444c99d18..2e59a96dc 100644 --- a/nx-X11/lib/X11/MapRaised.c +++ b/nx-X11/lib/X11/MapRaised.c @@ -1,4 +1,3 @@ -/* $Xorg: MapRaised.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/MapRaised.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/MapSubs.c b/nx-X11/lib/X11/MapSubs.c index f3e11ebd9..6165d2d99 100644 --- a/nx-X11/lib/X11/MapSubs.c +++ b/nx-X11/lib/X11/MapSubs.c @@ -1,4 +1,3 @@ -/* $Xorg: MapSubs.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/MapSubs.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/MapWindow.c b/nx-X11/lib/X11/MapWindow.c index d40bff2b7..810b1558f 100644 --- a/nx-X11/lib/X11/MapWindow.c +++ b/nx-X11/lib/X11/MapWindow.c @@ -1,4 +1,3 @@ -/* $Xorg: MapWindow.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/MapWindow.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/MaskEvent.c b/nx-X11/lib/X11/MaskEvent.c index f7b69e346..1c877cef9 100644 --- a/nx-X11/lib/X11/MaskEvent.c +++ b/nx-X11/lib/X11/MaskEvent.c @@ -1,4 +1,3 @@ -/* $Xorg: MaskEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/MaskEvent.c,v 3.5 2001/10/28 03:32:30 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Misc.c b/nx-X11/lib/X11/Misc.c index 5c3499a50..8a390320d 100644 --- a/nx-X11/lib/X11/Misc.c +++ b/nx-X11/lib/X11/Misc.c @@ -1,4 +1,3 @@ -/* $Xorg: Misc.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1988, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Misc.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ModMap.c b/nx-X11/lib/X11/ModMap.c index 3c2b2ddef..f83b2ef91 100644 --- a/nx-X11/lib/X11/ModMap.c +++ b/nx-X11/lib/X11/ModMap.c @@ -1,4 +1,3 @@ -/* $Xorg: ModMap.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ModMap.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/MoveWin.c b/nx-X11/lib/X11/MoveWin.c index 44097fea5..e2847d381 100644 --- a/nx-X11/lib/X11/MoveWin.c +++ b/nx-X11/lib/X11/MoveWin.c @@ -1,4 +1,3 @@ -/* $Xorg: MoveWin.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/MoveWin.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/NextEvent.c b/nx-X11/lib/X11/NextEvent.c index 2efef6f13..f0d1e56ff 100644 --- a/nx-X11/lib/X11/NextEvent.c +++ b/nx-X11/lib/X11/NextEvent.c @@ -1,4 +1,3 @@ -/* $Xorg: NextEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/NextEvent.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/OCWrap.c b/nx-X11/lib/X11/OCWrap.c index 63ffc421b..dbb9a86a1 100644 --- a/nx-X11/lib/X11/OCWrap.c +++ b/nx-X11/lib/X11/OCWrap.c @@ -1,4 +1,3 @@ -/* $Xorg: OCWrap.c,v 1.4 2000/08/17 19:44:47 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/OCWrap.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/OMWrap.c b/nx-X11/lib/X11/OMWrap.c index 8f8a1fd9b..39d82e476 100644 --- a/nx-X11/lib/X11/OMWrap.c +++ b/nx-X11/lib/X11/OMWrap.c @@ -1,4 +1,3 @@ -/* $Xorg: OMWrap.c,v 1.4 2000/08/17 19:44:47 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/OMWrap.c,v 1.4 2001/07/25 15:04:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/OfCCC.c b/nx-X11/lib/X11/OfCCC.c index 1f9631683..46c477b10 100644 --- a/nx-X11/lib/X11/OfCCC.c +++ b/nx-X11/lib/X11/OfCCC.c @@ -1,4 +1,3 @@ -/* $Xorg: OfCCC.c,v 1.3 2000/08/17 19:44:47 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/ParseCmd.c b/nx-X11/lib/X11/ParseCmd.c index fe20f6eff..fe796d7e5 100644 --- a/nx-X11/lib/X11/ParseCmd.c +++ b/nx-X11/lib/X11/ParseCmd.c @@ -1,4 +1,3 @@ -/* $Xorg: ParseCmd.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /*********************************************************** @@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/ParseCmd.c,v 1.5 2001/12/14 19:54:03 dawes Exp $ */ /* XrmParseCommand() diff --git a/nx-X11/lib/X11/ParseCol.c b/nx-X11/lib/X11/ParseCol.c index 116ad0021..5b7ec9f43 100644 --- a/nx-X11/lib/X11/ParseCol.c +++ b/nx-X11/lib/X11/ParseCol.c @@ -1,4 +1,3 @@ -/* $Xorg: ParseCol.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1985, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ParseCol.c,v 1.6 2003/04/13 19:22:17 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ParseGeom.c b/nx-X11/lib/X11/ParseGeom.c index 6aaaccf07..d77205882 100644 --- a/nx-X11/lib/X11/ParseGeom.c +++ b/nx-X11/lib/X11/ParseGeom.c @@ -1,4 +1,3 @@ -/* $Xorg: ParseGeom.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* @@ -27,7 +26,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/ParseGeom.c,v 1.3 2001/12/14 19:54:03 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/PeekEvent.c b/nx-X11/lib/X11/PeekEvent.c index 8017feca7..218c9a6dd 100644 --- a/nx-X11/lib/X11/PeekEvent.c +++ b/nx-X11/lib/X11/PeekEvent.c @@ -1,4 +1,3 @@ -/* $Xorg: PeekEvent.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/PeekEvent.c,v 1.3 2001/01/17 19:41:41 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/PeekIfEv.c b/nx-X11/lib/X11/PeekIfEv.c index 47d3dca63..593332898 100644 --- a/nx-X11/lib/X11/PeekIfEv.c +++ b/nx-X11/lib/X11/PeekIfEv.c @@ -1,4 +1,3 @@ -/* $Xorg: PeekIfEv.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/PeekIfEv.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Pending.c b/nx-X11/lib/X11/Pending.c index 34e7cf6ca..0f389a0ca 100644 --- a/nx-X11/lib/X11/Pending.c +++ b/nx-X11/lib/X11/Pending.c @@ -1,4 +1,3 @@ -/* $Xorg: Pending.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/PixFormats.c b/nx-X11/lib/X11/PixFormats.c index dc3a23879..df67843bd 100644 --- a/nx-X11/lib/X11/PixFormats.c +++ b/nx-X11/lib/X11/PixFormats.c @@ -1,4 +1,3 @@ -/* $Xorg: PixFormats.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group diff --git a/nx-X11/lib/X11/PmapBgnd.c b/nx-X11/lib/X11/PmapBgnd.c index 3333cd966..3ead3350f 100644 --- a/nx-X11/lib/X11/PmapBgnd.c +++ b/nx-X11/lib/X11/PmapBgnd.c @@ -1,4 +1,3 @@ -/* $Xorg: PmapBgnd.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/PmapBgnd.c,v 1.3 2001/01/17 19:41:41 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/PmapBord.c b/nx-X11/lib/X11/PmapBord.c index a81adc13e..780948468 100644 --- a/nx-X11/lib/X11/PmapBord.c +++ b/nx-X11/lib/X11/PmapBord.c @@ -1,4 +1,3 @@ -/* $Xorg: PmapBord.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/PmapBord.c,v 1.3 2001/01/17 19:41:41 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/PolyReg.c b/nx-X11/lib/X11/PolyReg.c index 6e1f7ead8..6cff945b7 100644 --- a/nx-X11/lib/X11/PolyReg.c +++ b/nx-X11/lib/X11/PolyReg.c @@ -1,4 +1,3 @@ -/* $Xorg: PolyReg.c,v 1.5 2001/02/09 02:03:35 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/lib/X11/PolyReg.c,v 1.6 2001/12/14 19:54:03 dawes Exp $ */ #define LARGE_COORDINATE 1000000 #define SMALL_COORDINATE -LARGE_COORDINATE diff --git a/nx-X11/lib/X11/PolyTxt.c b/nx-X11/lib/X11/PolyTxt.c index f66b10463..39beefe92 100644 --- a/nx-X11/lib/X11/PolyTxt.c +++ b/nx-X11/lib/X11/PolyTxt.c @@ -1,4 +1,3 @@ -/* $Xorg: PolyTxt.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/PolyTxt.c,v 3.5 2001/10/28 03:32:30 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/PolyTxt16.c b/nx-X11/lib/X11/PolyTxt16.c index ded535dc3..28aa9adbd 100644 --- a/nx-X11/lib/X11/PolyTxt16.c +++ b/nx-X11/lib/X11/PolyTxt16.c @@ -1,4 +1,3 @@ -/* $Xorg: PolyTxt16.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/PolyTxt16.c,v 1.4 2001/10/28 03:32:31 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/PrOfId.c b/nx-X11/lib/X11/PrOfId.c index d8fe6e9f3..4bb3bb879 100644 --- a/nx-X11/lib/X11/PrOfId.c +++ b/nx-X11/lib/X11/PrOfId.c @@ -1,4 +1,3 @@ -/* $Xorg: PrOfId.c,v 1.3 2000/08/17 19:44:48 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/PropAlloc.c b/nx-X11/lib/X11/PropAlloc.c index 9005a24ff..ecfb11e2b 100644 --- a/nx-X11/lib/X11/PropAlloc.c +++ b/nx-X11/lib/X11/PropAlloc.c @@ -1,4 +1,3 @@ -/* $Xorg: PropAlloc.c,v 1.5 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/PropAlloc.c,v 1.3 2001/01/17 19:41:41 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/PutBEvent.c b/nx-X11/lib/X11/PutBEvent.c index 6e6974f0b..63c92e627 100644 --- a/nx-X11/lib/X11/PutBEvent.c +++ b/nx-X11/lib/X11/PutBEvent.c @@ -1,4 +1,3 @@ -/* $Xorg: PutBEvent.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/PutBEvent.c,v 1.3 2001/01/17 19:41:41 dawes Exp $ */ /* XPutBackEvent puts an event back at the head of the queue. */ #ifdef HAVE_CONFIG_H diff --git a/nx-X11/lib/X11/PutImage.c b/nx-X11/lib/X11/PutImage.c index b44029409..9e461cb18 100644 --- a/nx-X11/lib/X11/PutImage.c +++ b/nx-X11/lib/X11/PutImage.c @@ -1,4 +1,3 @@ -/* $Xorg: PutImage.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/PutImage.c,v 3.11 2002/12/09 04:10:56 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/QBlack.c b/nx-X11/lib/X11/QBlack.c index ec0449405..8156b3a90 100644 --- a/nx-X11/lib/X11/QBlack.c +++ b/nx-X11/lib/X11/QBlack.c @@ -1,4 +1,3 @@ -/* $Xorg: QBlack.c,v 1.3 2000/08/17 19:44:49 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/QBlue.c b/nx-X11/lib/X11/QBlue.c index 602685190..ffc14171e 100644 --- a/nx-X11/lib/X11/QBlue.c +++ b/nx-X11/lib/X11/QBlue.c @@ -1,4 +1,3 @@ -/* $Xorg: QBlue.c,v 1.3 2000/08/17 19:44:49 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/QGreen.c b/nx-X11/lib/X11/QGreen.c index 59bbbd5f9..f06af4e73 100644 --- a/nx-X11/lib/X11/QGreen.c +++ b/nx-X11/lib/X11/QGreen.c @@ -1,4 +1,3 @@ -/* $Xorg: QGreen.c,v 1.3 2000/08/17 19:44:49 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/QRed.c b/nx-X11/lib/X11/QRed.c index bcd276c24..dd0420b34 100644 --- a/nx-X11/lib/X11/QRed.c +++ b/nx-X11/lib/X11/QRed.c @@ -1,4 +1,3 @@ -/* $Xorg: QRed.c,v 1.3 2000/08/17 19:44:49 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/QWhite.c b/nx-X11/lib/X11/QWhite.c index 7e58db658..4729f86db 100644 --- a/nx-X11/lib/X11/QWhite.c +++ b/nx-X11/lib/X11/QWhite.c @@ -1,4 +1,3 @@ -/* $Xorg: QWhite.c,v 1.3 2000/08/17 19:44:49 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/QuBest.c b/nx-X11/lib/X11/QuBest.c index e4aed4c74..a26ee952a 100644 --- a/nx-X11/lib/X11/QuBest.c +++ b/nx-X11/lib/X11/QuBest.c @@ -1,4 +1,3 @@ -/* $Xorg: QuBest.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/QuCol.c b/nx-X11/lib/X11/QuCol.c index 0864bc8a1..44595f08a 100644 --- a/nx-X11/lib/X11/QuCol.c +++ b/nx-X11/lib/X11/QuCol.c @@ -1,4 +1,3 @@ -/* $Xorg: QuCol.c,v 1.3 2000/08/17 19:44:50 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -32,7 +31,6 @@ * * */ -/* $XFree86: xc/lib/X11/QuCol.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/QuColor.c b/nx-X11/lib/X11/QuColor.c index 026678a30..dceeb9595 100644 --- a/nx-X11/lib/X11/QuColor.c +++ b/nx-X11/lib/X11/QuColor.c @@ -1,4 +1,3 @@ -/* $Xorg: QuColor.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/QuColor.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/QuColors.c b/nx-X11/lib/X11/QuColors.c index e351bb013..cdd58a0e5 100644 --- a/nx-X11/lib/X11/QuColors.c +++ b/nx-X11/lib/X11/QuColors.c @@ -1,4 +1,3 @@ -/* $Xorg: QuColors.c,v 1.5 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/QuColors.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/QuCols.c b/nx-X11/lib/X11/QuCols.c index d6c4890e6..2cdf1c134 100644 --- a/nx-X11/lib/X11/QuCols.c +++ b/nx-X11/lib/X11/QuCols.c @@ -1,4 +1,3 @@ -/* $Xorg: QuCols.c,v 1.3 2000/08/17 19:44:50 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -32,7 +31,6 @@ * * */ -/* $XFree86: xc/lib/X11/QuCols.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/QuCurShp.c b/nx-X11/lib/X11/QuCurShp.c index 51a2a66a5..bfce63486 100644 --- a/nx-X11/lib/X11/QuCurShp.c +++ b/nx-X11/lib/X11/QuCurShp.c @@ -1,4 +1,3 @@ -/* $Xorg: QuCurShp.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/QuExt.c b/nx-X11/lib/X11/QuExt.c index 5267402c9..018d537bb 100644 --- a/nx-X11/lib/X11/QuExt.c +++ b/nx-X11/lib/X11/QuExt.c @@ -1,4 +1,3 @@ -/* $Xorg: QuExt.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/QuKeybd.c b/nx-X11/lib/X11/QuKeybd.c index c2465987e..68e1cbadf 100644 --- a/nx-X11/lib/X11/QuKeybd.c +++ b/nx-X11/lib/X11/QuKeybd.c @@ -1,4 +1,3 @@ -/* $Xorg: QuKeybd.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/QuKeybd.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/QuPntr.c b/nx-X11/lib/X11/QuPntr.c index 34c7d69b2..795106d4d 100644 --- a/nx-X11/lib/X11/QuPntr.c +++ b/nx-X11/lib/X11/QuPntr.c @@ -1,4 +1,3 @@ -/* $Xorg: QuPntr.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/QuStipShp.c b/nx-X11/lib/X11/QuStipShp.c index 25e022eb0..ff5e631ad 100644 --- a/nx-X11/lib/X11/QuStipShp.c +++ b/nx-X11/lib/X11/QuStipShp.c @@ -1,4 +1,3 @@ -/* $Xorg: QuStipShp.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/QuTextE16.c b/nx-X11/lib/X11/QuTextE16.c index a6d0504fa..e458bc52c 100644 --- a/nx-X11/lib/X11/QuTextE16.c +++ b/nx-X11/lib/X11/QuTextE16.c @@ -1,4 +1,3 @@ -/* $Xorg: QuTextE16.c,v 1.5 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/QuTextE16.c,v 1.4 2001/12/14 19:54:04 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/QuTextExt.c b/nx-X11/lib/X11/QuTextExt.c index b1181be02..8a17dbb27 100644 --- a/nx-X11/lib/X11/QuTextExt.c +++ b/nx-X11/lib/X11/QuTextExt.c @@ -1,4 +1,3 @@ -/* $Xorg: QuTextExt.c,v 1.5 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/QuTextExt.c,v 1.4 2001/12/14 19:54:04 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/QuTileShp.c b/nx-X11/lib/X11/QuTileShp.c index 324a78004..b021ad4d7 100644 --- a/nx-X11/lib/X11/QuTileShp.c +++ b/nx-X11/lib/X11/QuTileShp.c @@ -1,4 +1,3 @@ -/* $Xorg: QuTileShp.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/QuTree.c b/nx-X11/lib/X11/QuTree.c index ee34a6303..aaf26bfa6 100644 --- a/nx-X11/lib/X11/QuTree.c +++ b/nx-X11/lib/X11/QuTree.c @@ -1,4 +1,3 @@ -/* $Xorg: QuTree.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/QuTree.c,v 1.5 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Quarks.c b/nx-X11/lib/X11/Quarks.c index a49562aac..58ec5b3f6 100644 --- a/nx-X11/lib/X11/Quarks.c +++ b/nx-X11/lib/X11/Quarks.c @@ -1,4 +1,3 @@ -/* $Xorg: Quarks.c,v 1.5 2001/02/09 02:03:35 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1988, 1990 by Digital Equipment Corporation, Maynard, @@ -49,7 +48,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/Quarks.c,v 1.6 2003/04/13 19:22:17 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/RaiseWin.c b/nx-X11/lib/X11/RaiseWin.c index 15d03facb..2985eb531 100644 --- a/nx-X11/lib/X11/RaiseWin.c +++ b/nx-X11/lib/X11/RaiseWin.c @@ -1,4 +1,3 @@ -/* $Xorg: RaiseWin.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/RaiseWin.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/RdBitF.c b/nx-X11/lib/X11/RdBitF.c index 97afcc493..ffb703ba3 100644 --- a/nx-X11/lib/X11/RdBitF.c +++ b/nx-X11/lib/X11/RdBitF.c @@ -1,4 +1,3 @@ -/* $Xorg: RdBitF.c,v 1.5 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/RdBitF.c,v 3.6 2003/04/13 19:22:17 dawes Exp $ */ /* * Code to read bitmaps from disk files. Interprets diff --git a/nx-X11/lib/X11/RecolorC.c b/nx-X11/lib/X11/RecolorC.c index 0bd46d619..ca1771934 100644 --- a/nx-X11/lib/X11/RecolorC.c +++ b/nx-X11/lib/X11/RecolorC.c @@ -1,4 +1,3 @@ -/* $Xorg: RecolorC.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/RecolorC.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ReconfWM.c b/nx-X11/lib/X11/ReconfWM.c index d4d3e058c..76cf1d46e 100644 --- a/nx-X11/lib/X11/ReconfWM.c +++ b/nx-X11/lib/X11/ReconfWM.c @@ -1,4 +1,3 @@ -/* $Xorg: ReconfWM.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/ReconfWin.c b/nx-X11/lib/X11/ReconfWin.c index 1aaa652d1..63a1fa150 100644 --- a/nx-X11/lib/X11/ReconfWin.c +++ b/nx-X11/lib/X11/ReconfWin.c @@ -1,4 +1,3 @@ -/* $Xorg: ReconfWin.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/ReconfWin.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Region.c b/nx-X11/lib/X11/Region.c index bef46def0..06f7e2547 100644 --- a/nx-X11/lib/X11/Region.c +++ b/nx-X11/lib/X11/Region.c @@ -1,4 +1,3 @@ -/* $Xorg: Region.c,v 1.6 2001/02/09 02:03:35 xorgcvs Exp $ */ /************************************************************************ Copyright 1987, 1988, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ************************************************************************/ -/* $XFree86: xc/lib/X11/Region.c,v 1.9 2002/06/04 22:19:57 dawes Exp $ */ /* * The functions in this file implement the Region abstraction, similar to one * used in the X11 sample server. A Region is simply an area, as the name diff --git a/nx-X11/lib/X11/RegstFlt.c b/nx-X11/lib/X11/RegstFlt.c index 0648a54d1..1dba7e4a0 100644 --- a/nx-X11/lib/X11/RegstFlt.c +++ b/nx-X11/lib/X11/RegstFlt.c @@ -1,4 +1,3 @@ -/* $Xorg: RegstFlt.c,v 1.5 2001/02/09 02:03:35 xorgcvs Exp $ */ /* * Copyright 1990, 1991 by OMRON Corporation @@ -52,7 +51,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/RegstFlt.c,v 1.5 2003/04/13 19:22:17 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/RepWindow.c b/nx-X11/lib/X11/RepWindow.c index b30340e01..51d2c77e9 100644 --- a/nx-X11/lib/X11/RepWindow.c +++ b/nx-X11/lib/X11/RepWindow.c @@ -1,4 +1,3 @@ -/* $Xorg: RepWindow.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/RepWindow.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/RestackWs.c b/nx-X11/lib/X11/RestackWs.c index ab5386251..a3ddd7211 100644 --- a/nx-X11/lib/X11/RestackWs.c +++ b/nx-X11/lib/X11/RestackWs.c @@ -1,4 +1,3 @@ -/* $Xorg: RestackWs.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/RestackWs.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/RotProp.c b/nx-X11/lib/X11/RotProp.c index a8f811957..eb7257a58 100644 --- a/nx-X11/lib/X11/RotProp.c +++ b/nx-X11/lib/X11/RotProp.c @@ -1,4 +1,3 @@ -/* $Xorg: RotProp.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/RotProp.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/ScrResStr.c b/nx-X11/lib/X11/ScrResStr.c index 7feb3b388..2a5553f4a 100644 --- a/nx-X11/lib/X11/ScrResStr.c +++ b/nx-X11/lib/X11/ScrResStr.c @@ -1,4 +1,3 @@ -/* $Xorg: ScrResStr.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1991, 1998 The Open Group diff --git a/nx-X11/lib/X11/SelInput.c b/nx-X11/lib/X11/SelInput.c index e517a5c6b..83c1e4d9d 100644 --- a/nx-X11/lib/X11/SelInput.c +++ b/nx-X11/lib/X11/SelInput.c @@ -1,4 +1,3 @@ -/* $Xorg: SelInput.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SelInput.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SendEvent.c b/nx-X11/lib/X11/SendEvent.c index 1512f1467..34c04f3a9 100644 --- a/nx-X11/lib/X11/SendEvent.c +++ b/nx-X11/lib/X11/SendEvent.c @@ -1,4 +1,3 @@ -/* $Xorg: SendEvent.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SendEvent.c,v 1.4 2001/12/14 19:54:05 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetBack.c b/nx-X11/lib/X11/SetBack.c index 037933f1d..c10d17c1e 100644 --- a/nx-X11/lib/X11/SetBack.c +++ b/nx-X11/lib/X11/SetBack.c @@ -1,4 +1,3 @@ -/* $Xorg: SetBack.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetBack.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetCCC.c b/nx-X11/lib/X11/SetCCC.c index 8ab0464dd..59afeff33 100644 --- a/nx-X11/lib/X11/SetCCC.c +++ b/nx-X11/lib/X11/SetCCC.c @@ -1,4 +1,3 @@ -/* $Xorg: SetCCC.c,v 1.3 2000/08/17 19:44:52 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/SetCRects.c b/nx-X11/lib/X11/SetCRects.c index a8dcf6643..60812e898 100644 --- a/nx-X11/lib/X11/SetCRects.c +++ b/nx-X11/lib/X11/SetCRects.c @@ -1,4 +1,3 @@ -/* $Xorg: SetCRects.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetCRects.c,v 1.4 2001/12/14 19:54:06 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetClMask.c b/nx-X11/lib/X11/SetClMask.c index f9fb051f0..9060a9ab1 100644 --- a/nx-X11/lib/X11/SetClMask.c +++ b/nx-X11/lib/X11/SetClMask.c @@ -1,4 +1,3 @@ -/* $Xorg: SetClMask.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetClMask.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetClOrig.c b/nx-X11/lib/X11/SetClOrig.c index 60f0346eb..533fba8c5 100644 --- a/nx-X11/lib/X11/SetClOrig.c +++ b/nx-X11/lib/X11/SetClOrig.c @@ -1,4 +1,3 @@ -/* $Xorg: SetClOrig.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetClOrig.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetDashes.c b/nx-X11/lib/X11/SetDashes.c index 6ecf955d1..a2d537bc5 100644 --- a/nx-X11/lib/X11/SetDashes.c +++ b/nx-X11/lib/X11/SetDashes.c @@ -1,4 +1,3 @@ -/* $Xorg: SetDashes.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetDashes.c,v 1.4 2001/12/14 19:54:06 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetFPath.c b/nx-X11/lib/X11/SetFPath.c index 086c657df..623605c9b 100644 --- a/nx-X11/lib/X11/SetFPath.c +++ b/nx-X11/lib/X11/SetFPath.c @@ -1,4 +1,3 @@ -/* $Xorg: SetFPath.c,v 1.5 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetFPath.c,v 1.5 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetFont.c b/nx-X11/lib/X11/SetFont.c index 089960d7c..6ab429236 100644 --- a/nx-X11/lib/X11/SetFont.c +++ b/nx-X11/lib/X11/SetFont.c @@ -1,4 +1,3 @@ -/* $Xorg: SetFont.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetFont.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetFore.c b/nx-X11/lib/X11/SetFore.c index 62ffb8fd3..ab73b2d23 100644 --- a/nx-X11/lib/X11/SetFore.c +++ b/nx-X11/lib/X11/SetFore.c @@ -1,4 +1,3 @@ -/* $Xorg: SetFore.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetFore.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetFunc.c b/nx-X11/lib/X11/SetFunc.c index a253266da..624f3bd7a 100644 --- a/nx-X11/lib/X11/SetFunc.c +++ b/nx-X11/lib/X11/SetFunc.c @@ -1,4 +1,3 @@ -/* $Xorg: SetFunc.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetFunc.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetGetCols.c b/nx-X11/lib/X11/SetGetCols.c index 03f7a2f72..8e11e2d25 100644 --- a/nx-X11/lib/X11/SetGetCols.c +++ b/nx-X11/lib/X11/SetGetCols.c @@ -1,4 +1,3 @@ -/* $Xorg: SetGetCols.c,v 1.3 2000/08/17 19:44:54 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/SetHints.c b/nx-X11/lib/X11/SetHints.c index 27b1bedbc..cea5624de 100644 --- a/nx-X11/lib/X11/SetHints.c +++ b/nx-X11/lib/X11/SetHints.c @@ -1,4 +1,3 @@ -/* $Xorg: SetHints.c,v 1.5 2001/02/09 02:03:36 xorgcvs Exp $ */ /*********************************************************** @@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/SetHints.c,v 1.4 2001/12/14 19:54:06 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetIFocus.c b/nx-X11/lib/X11/SetIFocus.c index 4f42908f2..a71bb9455 100644 --- a/nx-X11/lib/X11/SetIFocus.c +++ b/nx-X11/lib/X11/SetIFocus.c @@ -1,4 +1,3 @@ -/* $Xorg: SetIFocus.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetIFocus.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetLStyle.c b/nx-X11/lib/X11/SetLStyle.c index 74233d0b2..596489a06 100644 --- a/nx-X11/lib/X11/SetLStyle.c +++ b/nx-X11/lib/X11/SetLStyle.c @@ -1,4 +1,3 @@ -/* $Xorg: SetLStyle.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetLStyle.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetLocale.c b/nx-X11/lib/X11/SetLocale.c index 875718dca..c8998d8b8 100644 --- a/nx-X11/lib/X11/SetLocale.c +++ b/nx-X11/lib/X11/SetLocale.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/lib/X11/SetLocale.c,v 1.4 2005/07/03 07:00:55 daniels Exp $ */ -/* $Xorg: SetLocale.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* * Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, @@ -56,7 +54,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/SetLocale.c,v 3.20 2003/11/17 22:20:08 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetNrmHint.c b/nx-X11/lib/X11/SetNrmHint.c index e8e6daf31..ec9e7cfb4 100644 --- a/nx-X11/lib/X11/SetNrmHint.c +++ b/nx-X11/lib/X11/SetNrmHint.c @@ -1,4 +1,3 @@ -/* $Xorg: SetNrmHint.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /*********************************************************** Copyright 1988 by Wyse Technology, Inc., San Jose, Ca, diff --git a/nx-X11/lib/X11/SetPMask.c b/nx-X11/lib/X11/SetPMask.c index 268ef4fd0..dc2faf8f3 100644 --- a/nx-X11/lib/X11/SetPMask.c +++ b/nx-X11/lib/X11/SetPMask.c @@ -1,4 +1,3 @@ -/* $Xorg: SetPMask.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetPMask.c,v 1.3 2001/01/17 19:41:43 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetPntMap.c b/nx-X11/lib/X11/SetPntMap.c index b400452d1..138b788a5 100644 --- a/nx-X11/lib/X11/SetPntMap.c +++ b/nx-X11/lib/X11/SetPntMap.c @@ -1,4 +1,3 @@ -/* $Xorg: SetPntMap.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetPntMap.c,v 1.4 2001/12/14 19:54:06 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetRGBCMap.c b/nx-X11/lib/X11/SetRGBCMap.c index 03aa9392c..27d9a1efb 100644 --- a/nx-X11/lib/X11/SetRGBCMap.c +++ b/nx-X11/lib/X11/SetRGBCMap.c @@ -1,4 +1,3 @@ -/* $Xorg: SetRGBCMap.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group diff --git a/nx-X11/lib/X11/SetSOwner.c b/nx-X11/lib/X11/SetSOwner.c index f692cce73..5ed7a56f2 100644 --- a/nx-X11/lib/X11/SetSOwner.c +++ b/nx-X11/lib/X11/SetSOwner.c @@ -1,4 +1,3 @@ -/* $Xorg: SetSOwner.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetSOwner.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetSSaver.c b/nx-X11/lib/X11/SetSSaver.c index 43fd4dfa0..5536b833b 100644 --- a/nx-X11/lib/X11/SetSSaver.c +++ b/nx-X11/lib/X11/SetSSaver.c @@ -1,4 +1,3 @@ -/* $Xorg: SetSSaver.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetSSaver.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetStCmap.c b/nx-X11/lib/X11/SetStCmap.c index 521b9480d..82e01e4d0 100644 --- a/nx-X11/lib/X11/SetStCmap.c +++ b/nx-X11/lib/X11/SetStCmap.c @@ -1,4 +1,3 @@ -/* $Xorg: SetStCmap.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /*********************************************************** diff --git a/nx-X11/lib/X11/SetState.c b/nx-X11/lib/X11/SetState.c index a13f11bfc..c37442bb2 100644 --- a/nx-X11/lib/X11/SetState.c +++ b/nx-X11/lib/X11/SetState.c @@ -1,4 +1,3 @@ -/* $Xorg: SetState.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetState.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetStip.c b/nx-X11/lib/X11/SetStip.c index 41ebdad25..0e6e6a74f 100644 --- a/nx-X11/lib/X11/SetStip.c +++ b/nx-X11/lib/X11/SetStip.c @@ -1,4 +1,3 @@ -/* $Xorg: SetStip.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetStip.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetTSOrig.c b/nx-X11/lib/X11/SetTSOrig.c index c75707ede..53b6eab55 100644 --- a/nx-X11/lib/X11/SetTSOrig.c +++ b/nx-X11/lib/X11/SetTSOrig.c @@ -1,4 +1,3 @@ -/* $Xorg: SetTSOrig.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetTSOrig.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetTile.c b/nx-X11/lib/X11/SetTile.c index d9ca81152..5836cf80d 100644 --- a/nx-X11/lib/X11/SetTile.c +++ b/nx-X11/lib/X11/SetTile.c @@ -1,4 +1,3 @@ -/* $Xorg: SetTile.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/SetTile.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/SetTxtProp.c b/nx-X11/lib/X11/SetTxtProp.c index ae8b81e29..b3161c972 100644 --- a/nx-X11/lib/X11/SetTxtProp.c +++ b/nx-X11/lib/X11/SetTxtProp.c @@ -1,4 +1,3 @@ -/* $Xorg: SetTxtProp.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /*********************************************************** Copyright 1988 by Wyse Technology, Inc., San Jose, Ca. diff --git a/nx-X11/lib/X11/SetWMCMapW.c b/nx-X11/lib/X11/SetWMCMapW.c index 6774d7326..2e1a5c184 100644 --- a/nx-X11/lib/X11/SetWMCMapW.c +++ b/nx-X11/lib/X11/SetWMCMapW.c @@ -1,4 +1,3 @@ -/* $Xorg: SetWMCMapW.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /*********************************************************** diff --git a/nx-X11/lib/X11/SetWMProto.c b/nx-X11/lib/X11/SetWMProto.c index bc7dcf63c..4a8f798af 100644 --- a/nx-X11/lib/X11/SetWMProto.c +++ b/nx-X11/lib/X11/SetWMProto.c @@ -1,4 +1,3 @@ -/* $Xorg: SetWMProto.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /*********************************************************** diff --git a/nx-X11/lib/X11/StBytes.c b/nx-X11/lib/X11/StBytes.c index 676652678..b968d2114 100644 --- a/nx-X11/lib/X11/StBytes.c +++ b/nx-X11/lib/X11/StBytes.c @@ -1,4 +1,3 @@ -/* $Xorg: StBytes.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/StBytes.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/StCol.c b/nx-X11/lib/X11/StCol.c index 80c3f7d96..390d5be2e 100644 --- a/nx-X11/lib/X11/StCol.c +++ b/nx-X11/lib/X11/StCol.c @@ -1,4 +1,3 @@ -/* $Xorg: StCol.c,v 1.3 2000/08/17 19:44:55 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -32,7 +31,6 @@ * * */ -/* $XFree86: xc/lib/X11/StCol.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/StColor.c b/nx-X11/lib/X11/StColor.c index b6784b5e2..9c7685517 100644 --- a/nx-X11/lib/X11/StColor.c +++ b/nx-X11/lib/X11/StColor.c @@ -1,4 +1,3 @@ -/* $Xorg: StColor.c,v 1.4 2001/02/09 02:03:36 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/StColor.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/StColors.c b/nx-X11/lib/X11/StColors.c index 16d634bfe..2eb0c79f8 100644 --- a/nx-X11/lib/X11/StColors.c +++ b/nx-X11/lib/X11/StColors.c @@ -1,4 +1,3 @@ -/* $Xorg: StColors.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/StColors.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/StCols.c b/nx-X11/lib/X11/StCols.c index cff6cc344..e6de18504 100644 --- a/nx-X11/lib/X11/StCols.c +++ b/nx-X11/lib/X11/StCols.c @@ -1,4 +1,3 @@ -/* $Xorg: StCols.c,v 1.3 2000/08/17 19:44:56 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -32,7 +31,6 @@ * * */ -/* $XFree86: xc/lib/X11/StCols.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/StNColor.c b/nx-X11/lib/X11/StNColor.c index f7dbcb065..a557721e0 100644 --- a/nx-X11/lib/X11/StNColor.c +++ b/nx-X11/lib/X11/StNColor.c @@ -1,4 +1,3 @@ -/* $Xorg: StNColor.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/StNColor.c,v 1.5 2003/04/13 19:22:18 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/StName.c b/nx-X11/lib/X11/StName.c index d3053346c..5b1d720dc 100644 --- a/nx-X11/lib/X11/StName.c +++ b/nx-X11/lib/X11/StName.c @@ -1,4 +1,3 @@ -/* $Xorg: StName.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/StName.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/StrKeysym.c b/nx-X11/lib/X11/StrKeysym.c index fc1e7a34d..1ef32e594 100644 --- a/nx-X11/lib/X11/StrKeysym.c +++ b/nx-X11/lib/X11/StrKeysym.c @@ -1,4 +1,3 @@ -/* $Xorg: StrKeysym.c,v 1.5 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1985, 1987, 1990, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/StrKeysym.c,v 3.7 2003/04/13 19:22:18 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/StrToText.c b/nx-X11/lib/X11/StrToText.c index 5fd9c6ec6..22e7708d1 100644 --- a/nx-X11/lib/X11/StrToText.c +++ b/nx-X11/lib/X11/StrToText.c @@ -1,4 +1,3 @@ -/* $Xorg: StrToText.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group diff --git a/nx-X11/lib/X11/Sync.c b/nx-X11/lib/X11/Sync.c index efca51ba7..50fa0c571 100644 --- a/nx-X11/lib/X11/Sync.c +++ b/nx-X11/lib/X11/Sync.c @@ -1,4 +1,3 @@ -/* $Xorg: Sync.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Sync.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Synchro.c b/nx-X11/lib/X11/Synchro.c index 2688e79cc..930448ee9 100644 --- a/nx-X11/lib/X11/Synchro.c +++ b/nx-X11/lib/X11/Synchro.c @@ -1,4 +1,3 @@ -/* $Xorg: Synchro.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Synchro.c,v 1.3 2003/04/13 19:22:18 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Text.c b/nx-X11/lib/X11/Text.c index 95ad0d9df..645aa283f 100644 --- a/nx-X11/lib/X11/Text.c +++ b/nx-X11/lib/X11/Text.c @@ -1,4 +1,3 @@ -/* $Xorg: Text.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Text.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Text16.c b/nx-X11/lib/X11/Text16.c index dbf876326..01dea7d03 100644 --- a/nx-X11/lib/X11/Text16.c +++ b/nx-X11/lib/X11/Text16.c @@ -1,4 +1,3 @@ -/* $Xorg: Text16.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Text16.c,v 1.5 2001/12/14 19:54:07 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/TextExt.c b/nx-X11/lib/X11/TextExt.c index fc703011f..910bb3d7b 100644 --- a/nx-X11/lib/X11/TextExt.c +++ b/nx-X11/lib/X11/TextExt.c @@ -1,4 +1,3 @@ -/* $Xorg: TextExt.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/TextExt.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */ /* * Copyright 1995 by FUJITSU LIMITED * This is source code modified by FUJITSU LIMITED under the Joint diff --git a/nx-X11/lib/X11/TextExt16.c b/nx-X11/lib/X11/TextExt16.c index 763350a10..643aa5e30 100644 --- a/nx-X11/lib/X11/TextExt16.c +++ b/nx-X11/lib/X11/TextExt16.c @@ -1,4 +1,3 @@ -/* $Xorg: TextExt16.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/TextExt16.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */ /* * Copyright 1995 by FUJITSU LIMITED * This is source code modified by FUJITSU LIMITED under the Joint diff --git a/nx-X11/lib/X11/TextToStr.c b/nx-X11/lib/X11/TextToStr.c index f4c00adcf..d8cf80c91 100644 --- a/nx-X11/lib/X11/TextToStr.c +++ b/nx-X11/lib/X11/TextToStr.c @@ -1,4 +1,3 @@ -/* $Xorg: TextToStr.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -25,7 +24,6 @@ in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/TextToStr.c,v 1.4 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/TrCoords.c b/nx-X11/lib/X11/TrCoords.c index 79ca834b9..692eca958 100644 --- a/nx-X11/lib/X11/TrCoords.c +++ b/nx-X11/lib/X11/TrCoords.c @@ -1,4 +1,3 @@ -/* $Xorg: TrCoords.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/UNDEFINED.c b/nx-X11/lib/X11/UNDEFINED.c index 2c0563077..f8a8f86fd 100644 --- a/nx-X11/lib/X11/UNDEFINED.c +++ b/nx-X11/lib/X11/UNDEFINED.c @@ -1,4 +1,3 @@ -/* $Xorg: UNDEFINED.c,v 1.3 2000/08/17 19:44:57 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/UndefCurs.c b/nx-X11/lib/X11/UndefCurs.c index 6382a833a..73a1c2efa 100644 --- a/nx-X11/lib/X11/UndefCurs.c +++ b/nx-X11/lib/X11/UndefCurs.c @@ -1,4 +1,3 @@ -/* $Xorg: UndefCurs.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UndefCurs.c,v 1.3 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/UngrabBut.c b/nx-X11/lib/X11/UngrabBut.c index 82b179106..a586852f6 100644 --- a/nx-X11/lib/X11/UngrabBut.c +++ b/nx-X11/lib/X11/UngrabBut.c @@ -1,4 +1,3 @@ -/* $Xorg: UngrabBut.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UngrabBut.c,v 1.3 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/UngrabKbd.c b/nx-X11/lib/X11/UngrabKbd.c index 03d24b93c..d0db7c9c0 100644 --- a/nx-X11/lib/X11/UngrabKbd.c +++ b/nx-X11/lib/X11/UngrabKbd.c @@ -1,4 +1,3 @@ -/* $Xorg: UngrabKbd.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UngrabKbd.c,v 1.3 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/UngrabKey.c b/nx-X11/lib/X11/UngrabKey.c index 66c691f97..b0b42a731 100644 --- a/nx-X11/lib/X11/UngrabKey.c +++ b/nx-X11/lib/X11/UngrabKey.c @@ -1,4 +1,3 @@ -/* $Xorg: UngrabKey.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UngrabKey.c,v 1.3 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/UngrabPtr.c b/nx-X11/lib/X11/UngrabPtr.c index 42890ff8c..113d6fd8f 100644 --- a/nx-X11/lib/X11/UngrabPtr.c +++ b/nx-X11/lib/X11/UngrabPtr.c @@ -1,4 +1,3 @@ -/* $Xorg: UngrabPtr.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UngrabPtr.c,v 1.3 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/UngrabSvr.c b/nx-X11/lib/X11/UngrabSvr.c index 19764f651..6577603b9 100644 --- a/nx-X11/lib/X11/UngrabSvr.c +++ b/nx-X11/lib/X11/UngrabSvr.c @@ -1,4 +1,3 @@ -/* $Xorg: UngrabSvr.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UngrabSvr.c,v 1.3 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/UninsCmap.c b/nx-X11/lib/X11/UninsCmap.c index 9a3d998b5..5388d9339 100644 --- a/nx-X11/lib/X11/UninsCmap.c +++ b/nx-X11/lib/X11/UninsCmap.c @@ -1,4 +1,3 @@ -/* $Xorg: UninsCmap.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UninsCmap.c,v 1.3 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/UnldFont.c b/nx-X11/lib/X11/UnldFont.c index f90291e6b..aab81b5a9 100644 --- a/nx-X11/lib/X11/UnldFont.c +++ b/nx-X11/lib/X11/UnldFont.c @@ -1,4 +1,3 @@ -/* $Xorg: UnldFont.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UnldFont.c,v 1.5 2001/12/14 19:54:07 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/UnmapSubs.c b/nx-X11/lib/X11/UnmapSubs.c index 503a6c9e9..b097af3d3 100644 --- a/nx-X11/lib/X11/UnmapSubs.c +++ b/nx-X11/lib/X11/UnmapSubs.c @@ -1,4 +1,3 @@ -/* $Xorg: UnmapSubs.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UnmapSubs.c,v 1.3 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/UnmapWin.c b/nx-X11/lib/X11/UnmapWin.c index 1a9cc0c29..108e2dcac 100644 --- a/nx-X11/lib/X11/UnmapWin.c +++ b/nx-X11/lib/X11/UnmapWin.c @@ -1,4 +1,3 @@ -/* $Xorg: UnmapWin.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/UnmapWin.c,v 1.3 2001/01/17 19:41:45 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/VisUtil.c b/nx-X11/lib/X11/VisUtil.c index 304317aee..70f3d999a 100644 --- a/nx-X11/lib/X11/VisUtil.c +++ b/nx-X11/lib/X11/VisUtil.c @@ -1,4 +1,3 @@ -/* $Xorg: VisUtil.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group diff --git a/nx-X11/lib/X11/WMGeom.c b/nx-X11/lib/X11/WMGeom.c index 59041a9fa..68187b583 100644 --- a/nx-X11/lib/X11/WMGeom.c +++ b/nx-X11/lib/X11/WMGeom.c @@ -1,4 +1,3 @@ -/* $Xorg: WMGeom.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/WMGeom.c,v 1.3 2003/04/13 19:22:18 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/WMProps.c b/nx-X11/lib/X11/WMProps.c index 7a390a9d7..b610f70e0 100644 --- a/nx-X11/lib/X11/WMProps.c +++ b/nx-X11/lib/X11/WMProps.c @@ -1,4 +1,3 @@ -/* $Xorg: WMProps.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1987, 1988, 1993, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/WMProps.c,v 3.6 2001/12/14 19:54:07 dawes Exp $ */ /*********************************************************** Copyright 1988 by Wyse Technology, Inc., San Jose, Ca., diff --git a/nx-X11/lib/X11/WarpPtr.c b/nx-X11/lib/X11/WarpPtr.c index 545cc064e..a59482b5a 100644 --- a/nx-X11/lib/X11/WarpPtr.c +++ b/nx-X11/lib/X11/WarpPtr.c @@ -1,4 +1,3 @@ -/* $Xorg: WarpPtr.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/WarpPtr.c,v 1.3 2001/01/17 19:41:47 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/WinEvent.c b/nx-X11/lib/X11/WinEvent.c index 94d32ef34..6adf76bb1 100644 --- a/nx-X11/lib/X11/WinEvent.c +++ b/nx-X11/lib/X11/WinEvent.c @@ -1,4 +1,3 @@ -/* $Xorg: WinEvent.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1985, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/WinEvent.c,v 3.5 2001/10/28 03:32:32 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Window.c b/nx-X11/lib/X11/Window.c index 10d1b95f7..3f2d48528 100644 --- a/nx-X11/lib/X11/Window.c +++ b/nx-X11/lib/X11/Window.c @@ -1,4 +1,3 @@ -/* $Xorg: Window.c,v 1.5 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1986, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/Window.c,v 1.4 2001/12/14 19:54:08 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Withdraw.c b/nx-X11/lib/X11/Withdraw.c index ddae2424a..fae80d67a 100644 --- a/nx-X11/lib/X11/Withdraw.c +++ b/nx-X11/lib/X11/Withdraw.c @@ -1,4 +1,3 @@ -/* $Xorg: Withdraw.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /*********************************************************** Copyright 1988 by Wyse Technology, Inc., San Jose, Ca., diff --git a/nx-X11/lib/X11/WrBitF.c b/nx-X11/lib/X11/WrBitF.c index d48295f0b..dad8d5989 100644 --- a/nx-X11/lib/X11/WrBitF.c +++ b/nx-X11/lib/X11/WrBitF.c @@ -1,4 +1,3 @@ -/* $Xorg: WrBitF.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/WrBitF.c,v 3.6 2003/04/13 19:22:18 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/X11-def.cpp b/nx-X11/lib/X11/X11-def.cpp index ea466ebbe..448b40231 100644 --- a/nx-X11/lib/X11/X11-def.cpp +++ b/nx-X11/lib/X11/X11-def.cpp @@ -2009,5 +2009,3 @@ EXPORTS #endif #endif -/* $Xorg: X11-def.cpp,v 1.3 2000/08/17 19:44:59 cpqbld Exp $ */ -/* $XFree86: xc/lib/X11/X11-def.cpp,v 1.14 2003/03/25 04:18:09 dawes Exp $ */ diff --git a/nx-X11/lib/X11/XDefaultIMIF.c b/nx-X11/lib/X11/XDefaultIMIF.c index 3ece58601..328cb5cad 100644 --- a/nx-X11/lib/X11/XDefaultIMIF.c +++ b/nx-X11/lib/X11/XDefaultIMIF.c @@ -41,7 +41,6 @@ interest in or to any trademark, service mark, logo or trade name of Sun Microsystems, Inc. or its licensors is granted. */ -/* $XFree86: xc/lib/X11/XDefaultIMIF.c,v 1.3 2003/04/13 19:22:18 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XDefaultOMIF.c b/nx-X11/lib/X11/XDefaultOMIF.c index b4e63091b..fcdd8a25c 100644 --- a/nx-X11/lib/X11/XDefaultOMIF.c +++ b/nx-X11/lib/X11/XDefaultOMIF.c @@ -41,7 +41,6 @@ interest in or to any trademark, service mark, logo or trade name of Sun Microsystems, Inc. or its licensors is granted. */ -/* $XFree86: xc/lib/X11/XDefaultOMIF.c,v 1.5 2003/04/17 02:39:56 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKB.c b/nx-X11/lib/X11/XKB.c index f03976d3b..1347fd485 100644 --- a/nx-X11/lib/X11/XKB.c +++ b/nx-X11/lib/X11/XKB.c @@ -1,4 +1,3 @@ -/* $Xorg: XKB.c,v 1.3 2000/08/17 19:44:59 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKB.c,v 1.9 2003/04/17 02:06:31 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBAlloc.c b/nx-X11/lib/X11/XKBAlloc.c index 9b4fbd38d..826bf6ed8 100644 --- a/nx-X11/lib/X11/XKBAlloc.c +++ b/nx-X11/lib/X11/XKBAlloc.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBAlloc.c,v 1.4 2000/08/17 19:44:59 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBAlloc.c,v 3.5 2001/01/17 19:41:48 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBBell.c b/nx-X11/lib/X11/XKBBell.c index 44f863a5f..4ddbe6617 100644 --- a/nx-X11/lib/X11/XKBBell.c +++ b/nx-X11/lib/X11/XKBBell.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBBell.c,v 1.3 2000/08/17 19:45:00 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/X11/XKBBind.c b/nx-X11/lib/X11/XKBBind.c index 82d06f35e..badbd88b7 100644 --- a/nx-X11/lib/X11/XKBBind.c +++ b/nx-X11/lib/X11/XKBBind.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBBind.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */ /* Copyright 1985, 1987, 1994, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/XKBBind.c,v 3.19 2003/05/27 22:26:25 tsi Exp $ */ /* the new monsters ate the old ones */ diff --git a/nx-X11/lib/X11/XKBCompat.c b/nx-X11/lib/X11/XKBCompat.c index 04b0a3a8b..44bf8d30a 100644 --- a/nx-X11/lib/X11/XKBCompat.c +++ b/nx-X11/lib/X11/XKBCompat.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBCompat.c,v 1.3 2000/08/17 19:45:00 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/X11/XKBCtrls.c b/nx-X11/lib/X11/XKBCtrls.c index 8f2876e12..1ab1e7656 100644 --- a/nx-X11/lib/X11/XKBCtrls.c +++ b/nx-X11/lib/X11/XKBCtrls.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBCtrls.c,v 1.3 2000/08/17 19:45:00 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBCtrls.c,v 1.4 2002/12/10 04:33:48 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBCvt.c b/nx-X11/lib/X11/XKBCvt.c index 391bbf499..ea991b74e 100644 --- a/nx-X11/lib/X11/XKBCvt.c +++ b/nx-X11/lib/X11/XKBCvt.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBCvt.c,v 1.5 2001/02/09 02:03:38 xorgcvs Exp $ */ /* Copyright 1988, 1989, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/XKBCvt.c,v 3.34 2002/10/08 23:31:35 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBExtDev.c b/nx-X11/lib/X11/XKBExtDev.c index 1f5bbb7db..5cbf8e538 100644 --- a/nx-X11/lib/X11/XKBExtDev.c +++ b/nx-X11/lib/X11/XKBExtDev.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBExtDev.c,v 1.3 2000/08/17 19:45:01 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBExtDev.c,v 3.4 2001/10/28 03:32:33 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBGAlloc.c b/nx-X11/lib/X11/XKBGAlloc.c index 00168f413..f5e6737af 100644 --- a/nx-X11/lib/X11/XKBGAlloc.c +++ b/nx-X11/lib/X11/XKBGAlloc.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBGAlloc.c,v 1.3 2000/08/17 19:45:01 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBGAlloc.c,v 3.4 2001/01/17 19:41:48 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBGeom.c b/nx-X11/lib/X11/XKBGeom.c index 5dabf12a1..c1fb5addd 100644 --- a/nx-X11/lib/X11/XKBGeom.c +++ b/nx-X11/lib/X11/XKBGeom.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBGeom.c,v 1.4 2000/08/17 19:45:01 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBGeom.c,v 1.5 2003/04/13 19:22:18 dawes Exp $ */ #ifdef DEBUG #ifdef HAVE_CONFIG_H diff --git a/nx-X11/lib/X11/XKBGetByName.c b/nx-X11/lib/X11/XKBGetByName.c index 535d793ae..4c71ec576 100644 --- a/nx-X11/lib/X11/XKBGetByName.c +++ b/nx-X11/lib/X11/XKBGetByName.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBGetByName.c,v 1.3 2000/08/17 19:45:02 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/X11/XKBGetMap.c b/nx-X11/lib/X11/XKBGetMap.c index 5fd3d7af9..2d9a4ea1c 100644 --- a/nx-X11/lib/X11/XKBGetMap.c +++ b/nx-X11/lib/X11/XKBGetMap.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBGetMap.c,v 1.4 2000/08/17 19:45:02 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -25,7 +24,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBGetMap.c,v 1.9 2003/04/17 02:06:31 dawes Exp $ */ #define NEED_MAP_READERS #ifdef HAVE_CONFIG_H diff --git a/nx-X11/lib/X11/XKBList.c b/nx-X11/lib/X11/XKBList.c index 707fafbc8..4080535ba 100644 --- a/nx-X11/lib/X11/XKBList.c +++ b/nx-X11/lib/X11/XKBList.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBList.c,v 1.3 2000/08/17 19:45:02 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/X11/XKBMAlloc.c b/nx-X11/lib/X11/XKBMAlloc.c index 1db98c0a0..ffc822fed 100644 --- a/nx-X11/lib/X11/XKBMAlloc.c +++ b/nx-X11/lib/X11/XKBMAlloc.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBMAlloc.c,v 1.4 2000/08/17 19:45:02 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBMAlloc.c,v 3.11 2001/01/17 19:41:48 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBMisc.c b/nx-X11/lib/X11/XKBMisc.c index 30250cc17..b3012dc4f 100644 --- a/nx-X11/lib/X11/XKBMisc.c +++ b/nx-X11/lib/X11/XKBMisc.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBMisc.c,v 1.4 2000/08/17 19:45:02 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBMisc.c,v 3.5 2001/10/28 03:32:33 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBNames.c b/nx-X11/lib/X11/XKBNames.c index 1b2a3cb0a..ca51b3fd5 100644 --- a/nx-X11/lib/X11/XKBNames.c +++ b/nx-X11/lib/X11/XKBNames.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBNames.c,v 1.3 2000/08/17 19:45:02 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBNames.c,v 1.5 2003/04/13 19:22:18 dawes Exp $ */ #define NEED_MAP_READERS #ifdef HAVE_CONFIG_H diff --git a/nx-X11/lib/X11/XKBRdBuf.c b/nx-X11/lib/X11/XKBRdBuf.c index 1d5459691..43774d4a0 100644 --- a/nx-X11/lib/X11/XKBRdBuf.c +++ b/nx-X11/lib/X11/XKBRdBuf.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBRdBuf.c,v 1.3 2000/08/17 19:45:02 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBRdBuf.c,v 1.2 2001/10/28 03:32:33 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBSetGeom.c b/nx-X11/lib/X11/XKBSetGeom.c index 2a6ce7442..8f7ba67a2 100644 --- a/nx-X11/lib/X11/XKBSetGeom.c +++ b/nx-X11/lib/X11/XKBSetGeom.c @@ -1,5 +1,3 @@ -/* $Xorg: XKBSetGeom.c,v 1.3 2000/08/17 19:45:03 cpqbld Exp $ */ -/* $XdotOrg: xc/lib/X11/XKBSetGeom.c,v 1.5 2005/07/03 07:00:55 daniels Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -25,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBSetGeom.c,v 3.5 2003/05/27 22:26:25 tsi Exp $ */ #ifdef DEBUG #ifdef HAVE_CONFIG_H diff --git a/nx-X11/lib/X11/XKBSetMap.c b/nx-X11/lib/X11/XKBSetMap.c index 439d0dcea..03ec6dde8 100644 --- a/nx-X11/lib/X11/XKBSetMap.c +++ b/nx-X11/lib/X11/XKBSetMap.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBSetMap.c,v 1.4 2000/08/17 19:45:03 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBSetMap.c,v 3.2 2001/01/17 19:41:49 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBUse.c b/nx-X11/lib/X11/XKBUse.c index fe6d316ef..379388747 100644 --- a/nx-X11/lib/X11/XKBUse.c +++ b/nx-X11/lib/X11/XKBUse.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBUse.c,v 1.3 2000/08/17 19:45:03 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBUse.c,v 3.7 2003/07/07 15:34:21 eich Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XKBleds.c b/nx-X11/lib/X11/XKBleds.c index adb87baa3..7585e5bbd 100644 --- a/nx-X11/lib/X11/XKBleds.c +++ b/nx-X11/lib/X11/XKBleds.c @@ -1,4 +1,3 @@ -/* $Xorg: XKBleds.c,v 1.3 2000/08/17 19:45:03 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBleds.c,v 1.4 2003/04/13 19:22:18 dawes Exp $ */ #define NEED_MAP_READERS #ifdef HAVE_CONFIG_H diff --git a/nx-X11/lib/X11/XKBlib.h b/nx-X11/lib/X11/XKBlib.h index a1ad7ccea..95b233e84 100644 --- a/nx-X11/lib/X11/XKBlib.h +++ b/nx-X11/lib/X11/XKBlib.h @@ -1,4 +1,3 @@ -/* $Xorg: XKBlib.h,v 1.6 2000/08/17 19:45:03 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBlib.h,v 3.5 2003/04/17 02:06:31 dawes Exp $ */ #ifndef _XKBLIB_H_ #define _XKBLIB_H_ diff --git a/nx-X11/lib/X11/XKBlibint.h b/nx-X11/lib/X11/XKBlibint.h index 9c6352769..a1f19fd0e 100644 --- a/nx-X11/lib/X11/XKBlibint.h +++ b/nx-X11/lib/X11/XKBlibint.h @@ -1,4 +1,3 @@ -/* $Xorg: XKBlibint.h,v 1.3 2000/08/17 19:45:04 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBlibint.h,v 3.5 2003/04/18 18:21:45 torrey Exp $ */ #ifndef _XKBLIBINT_H_ #define _XKBLIBINT_H_ diff --git a/nx-X11/lib/X11/XRGB.c b/nx-X11/lib/X11/XRGB.c index 0d7e24c7d..c243530ee 100644 --- a/nx-X11/lib/X11/XRGB.c +++ b/nx-X11/lib/X11/XRGB.c @@ -1,4 +1,3 @@ -/* $Xorg: XRGB.c,v 1.3 2000/08/17 19:45:04 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -33,7 +32,6 @@ * * */ -/* $XFree86: xc/lib/X11/XRGB.c,v 3.3 2001/07/29 05:01:11 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XYZ.c b/nx-X11/lib/X11/XYZ.c index 5408c4fbc..706803501 100644 --- a/nx-X11/lib/X11/XYZ.c +++ b/nx-X11/lib/X11/XYZ.c @@ -1,4 +1,3 @@ -/* $Xorg: XYZ.c,v 1.3 2000/08/17 19:45:04 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -33,7 +32,6 @@ * * */ -/* $XFree86: xc/lib/X11/XYZ.c,v 1.3 2001/01/17 19:41:49 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/Xaixlcint.h b/nx-X11/lib/X11/Xaixlcint.h index 2e4f3f521..53553709e 100644 --- a/nx-X11/lib/X11/Xaixlcint.h +++ b/nx-X11/lib/X11/Xaixlcint.h @@ -1,4 +1,3 @@ -/* $Xorg: Xaixlcint.h,v 1.3 2000/08/17 19:45:04 cpqbld Exp $ */ /* * * Copyright IBM Corporation 1993 diff --git a/nx-X11/lib/X11/Xatomtype.h b/nx-X11/lib/X11/Xatomtype.h index 7ab7e5a04..d4b5ff36a 100644 --- a/nx-X11/lib/X11/Xatomtype.h +++ b/nx-X11/lib/X11/Xatomtype.h @@ -1,4 +1,3 @@ -/* $Xorg: Xatomtype.h,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */ /*********************************************************** diff --git a/nx-X11/lib/X11/Xcms.h b/nx-X11/lib/X11/Xcms.h index 8ce81556d..4ec2e4ead 100644 --- a/nx-X11/lib/X11/Xcms.h +++ b/nx-X11/lib/X11/Xcms.h @@ -1,4 +1,3 @@ -/* $Xorg: Xcms.h,v 1.6 2000/08/17 19:45:04 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -27,7 +26,6 @@ * DESCRIPTION * Public include file for X Color Management System */ -/* $XFree86: xc/lib/X11/Xcms.h,v 1.7 2003/11/03 03:46:26 dawes Exp $ */ #ifndef _XCMS_H_ #define _XCMS_H_ diff --git a/nx-X11/lib/X11/Xcmsint.h b/nx-X11/lib/X11/Xcmsint.h index 6bb44bbcf..14b5a2911 100644 --- a/nx-X11/lib/X11/Xcmsint.h +++ b/nx-X11/lib/X11/Xcmsint.h @@ -1,4 +1,3 @@ -/* $Xorg: Xcmsint.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -29,7 +28,6 @@ * (i.e., for API internal use only) * */ -/* $XFree86: xc/lib/X11/Xcmsint.h,v 3.3 2001/07/25 15:04:44 dawes Exp $ */ #ifndef _XCMSINT_H_ #define _XCMSINT_H_ diff --git a/nx-X11/lib/X11/XimImSw.h b/nx-X11/lib/X11/XimImSw.h index 8ad5d2872..10e5c0f98 100644 --- a/nx-X11/lib/X11/XimImSw.h +++ b/nx-X11/lib/X11/XimImSw.h @@ -1,4 +1,3 @@ -/* $Xorg: XimImSw.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993 by FUJITSU LIMITED diff --git a/nx-X11/lib/X11/XimProto.h b/nx-X11/lib/X11/XimProto.h index fe6e5f693..5cb3a6dc9 100644 --- a/nx-X11/lib/X11/XimProto.h +++ b/nx-X11/lib/X11/XimProto.h @@ -1,4 +1,3 @@ -/* $Xorg: XimProto.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993 by FUJITSU LIMITED diff --git a/nx-X11/lib/X11/XimThai.h b/nx-X11/lib/X11/XimThai.h index 8d08eca6b..748a8e9c1 100644 --- a/nx-X11/lib/X11/XimThai.h +++ b/nx-X11/lib/X11/XimThai.h @@ -1,4 +1,3 @@ -/* $Xorg: XimThai.h,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */ /*********************************************************** Copyright 1993, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/XimThai.h,v 1.5 2001/12/14 19:54:08 dawes Exp $ */ /* **++ diff --git a/nx-X11/lib/X11/XimTrInt.h b/nx-X11/lib/X11/XimTrInt.h index cc1cabfac..5b9b875f9 100644 --- a/nx-X11/lib/X11/XimTrInt.h +++ b/nx-X11/lib/X11/XimTrInt.h @@ -1,4 +1,3 @@ -/* $Xorg: XimTrInt.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */ /****************************************************************** Copyright 1992 by Sun Microsystems, Inc. diff --git a/nx-X11/lib/X11/XimTrX.h b/nx-X11/lib/X11/XimTrX.h index a43784397..ceb6e4f87 100644 --- a/nx-X11/lib/X11/XimTrX.h +++ b/nx-X11/lib/X11/XimTrX.h @@ -1,4 +1,3 @@ -/* $Xorg: XimTrX.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */ /****************************************************************** Copyright 1992 by Sun Microsystems, Inc. diff --git a/nx-X11/lib/X11/XimTrans.h b/nx-X11/lib/X11/XimTrans.h index f75270b27..0d2cd395a 100644 --- a/nx-X11/lib/X11/XimTrans.h +++ b/nx-X11/lib/X11/XimTrans.h @@ -1,4 +1,3 @@ -/* $Xorg: XimTrans.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */ /****************************************************************** Copyright 1992 by Sun Microsystems, Inc. @@ -28,7 +27,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/XimTrans.h,v 1.3 2003/10/24 15:34:00 tsi Exp $ */ #ifndef _XIMTRANS_H #define _XIMTRANS_H diff --git a/nx-X11/lib/X11/Ximint.h b/nx-X11/lib/X11/Ximint.h index afd821c68..01a535426 100644 --- a/nx-X11/lib/X11/Ximint.h +++ b/nx-X11/lib/X11/Ximint.h @@ -1,4 +1,3 @@ -/* $Xorg: Ximint.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -30,7 +29,6 @@ PERFORMANCE OF THIS SOFTWARE. makoto@sm.sony.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/Ximint.h,v 3.13 2003/09/06 14:06:32 pascal Exp $ */ #ifndef _XIMINT_H #define _XIMINT_H diff --git a/nx-X11/lib/X11/XimintL.h b/nx-X11/lib/X11/XimintL.h index 2d4f6a9e0..7fc6163cd 100644 --- a/nx-X11/lib/X11/XimintL.h +++ b/nx-X11/lib/X11/XimintL.h @@ -1,4 +1,3 @@ -/* $Xorg: XimintL.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */ /****************************************************************** Copyright 1991, 1992, 1993, 1994 by FUJITSU LIMITED @@ -32,7 +31,6 @@ THIS SOFTWARE. frankyling@hgrd01.enet.dec.com ******************************************************************/ -/* $XFree86: xc/lib/X11/XimintL.h,v 1.6 2000/12/04 18:49:19 dawes Exp $ */ #ifndef _XIMINTL_H #define _XIMINTL_H diff --git a/nx-X11/lib/X11/XimintP.h b/nx-X11/lib/X11/XimintP.h index f10d9baad..809f59e18 100644 --- a/nx-X11/lib/X11/XimintP.h +++ b/nx-X11/lib/X11/XimintP.h @@ -1,4 +1,3 @@ -/* $Xorg: XimintP.h,v 1.3 2000/08/17 19:45:05 cpqbld Exp $ */ /****************************************************************** Copyright 1991, 1992 by Sun Microsystems, Inc. @@ -35,7 +34,6 @@ PERFORMANCE OF THIS SOFTWARE. miyamoto@jrd.dec.com ******************************************************************/ -/* $XFree86: xc/lib/X11/XimintP.h,v 1.7 2001/01/17 19:41:49 dawes Exp $ */ #ifndef _XIMINTP_H #define _XIMINTP_H diff --git a/nx-X11/lib/X11/Xintconn.h b/nx-X11/lib/X11/Xintconn.h index ea272833a..7f7ff485b 100644 --- a/nx-X11/lib/X11/Xintconn.h +++ b/nx-X11/lib/X11/Xintconn.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/Xintconn.h,v 1.1 2001/08/18 02:41:28 dawes Exp $ */ #ifndef _XINTCONN_H_ #define _XINTCONN_H_ 1 diff --git a/nx-X11/lib/X11/XlcDL.c b/nx-X11/lib/X11/XlcDL.c index 679b3c13a..3bacf6894 100644 --- a/nx-X11/lib/X11/XlcDL.c +++ b/nx-X11/lib/X11/XlcDL.c @@ -41,8 +41,6 @@ interest in or to any trademark, service mark, logo or trade name of Sun Microsystems, Inc. or its licensors is granted. */ -/* $XFree86: xc/lib/X11/XlcDL.c,v 1.12 2003/04/13 19:22:19 dawes Exp $ */ -/* $XdotOrg: xc/lib/X11/XlcDL.c,v 1.6 2005/07/11 15:24:32 lars Exp $ */ #ifdef HAVE_CONFIG_H # include diff --git a/nx-X11/lib/X11/XlcGeneric.h b/nx-X11/lib/X11/XlcGeneric.h index f1d14e710..8fa57b9d4 100644 --- a/nx-X11/lib/X11/XlcGeneric.h +++ b/nx-X11/lib/X11/XlcGeneric.h @@ -1,4 +1,3 @@ -/* $Xorg: XlcGeneric.h,v 1.3 2000/08/17 19:45:06 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -31,7 +30,6 @@ * Modifier: Takanori Tateno FUJITSU LIMITED * */ -/* $XFree86: xc/lib/X11/XlcGeneric.h,v 1.4 2001/07/25 15:04:44 dawes Exp $ */ #ifndef _XLCGENERIC_H_ #define _XLCGENERIC_H_ diff --git a/nx-X11/lib/X11/XlcPubI.h b/nx-X11/lib/X11/XlcPubI.h index 8441d7f65..48a1dea20 100644 --- a/nx-X11/lib/X11/XlcPubI.h +++ b/nx-X11/lib/X11/XlcPubI.h @@ -1,4 +1,3 @@ -/* $Xorg: XlcPubI.h,v 1.4 2000/12/12 12:44:05 coskrey Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/XlcPubI.h,v 3.14 2003/11/17 22:20:10 dawes Exp $ */ #ifndef _XLCPUBLICI_H_ #define _XLCPUBLICI_H_ diff --git a/nx-X11/lib/X11/XlcPublic.h b/nx-X11/lib/X11/XlcPublic.h index 27595d8a2..3d94ef37d 100644 --- a/nx-X11/lib/X11/XlcPublic.h +++ b/nx-X11/lib/X11/XlcPublic.h @@ -1,4 +1,3 @@ -/* $Xorg: XlcPublic.h,v 1.3 2000/08/17 19:45:06 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -31,7 +30,6 @@ * Modifier: Takanori Tateno FUJITSU LIMITED * */ -/* $XFree86: xc/lib/X11/XlcPublic.h,v 1.11 2003/04/17 02:06:31 dawes Exp $ */ /* * Most of this API is documented in i18n/Framework.PS */ diff --git a/nx-X11/lib/X11/Xlcint.h b/nx-X11/lib/X11/Xlcint.h index 5a52cd36c..db2f75a7b 100644 --- a/nx-X11/lib/X11/Xlcint.h +++ b/nx-X11/lib/X11/Xlcint.h @@ -1,4 +1,3 @@ -/* $Xorg: Xlcint.h,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */ /* Copyright 1991, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/Xlcint.h,v 3.16 2003/04/17 02:06:31 dawes Exp $ */ /* * Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, diff --git a/nx-X11/lib/X11/Xlib.h b/nx-X11/lib/X11/Xlib.h index 86945a9e7..a7ca57796 100644 --- a/nx-X11/lib/X11/Xlib.h +++ b/nx-X11/lib/X11/Xlib.h @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/lib/X11/Xlib.h,v 1.6 2005/11/08 06:33:25 jkj Exp $ */ -/* $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $ */ /* Copyright 1985, 1986, 1987, 1991, 1998 The Open Group @@ -25,7 +23,6 @@ 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/lib/X11/Xlib.h,v 3.25 2003/11/17 22:20:10 dawes Exp $ */ /* diff --git a/nx-X11/lib/X11/Xlocale.h b/nx-X11/lib/X11/Xlocale.h index 4370d969e..7b0b75bc2 100644 --- a/nx-X11/lib/X11/Xlocale.h +++ b/nx-X11/lib/X11/Xlocale.h @@ -1,4 +1,3 @@ -/* $Xorg: Xlocale.h,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */ /* Copyright 1991, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/Xlocale.h,v 1.4 2001/12/14 19:54:09 dawes Exp $ */ #ifndef _XLOCALE_H_ #define _XLOCALE_H_ diff --git a/nx-X11/lib/X11/XomGeneric.h b/nx-X11/lib/X11/XomGeneric.h index ce61eca34..caf1d86c2 100644 --- a/nx-X11/lib/X11/XomGeneric.h +++ b/nx-X11/lib/X11/XomGeneric.h @@ -1,4 +1,3 @@ -/* $Xorg: XomGeneric.h,v 1.3 2000/08/17 19:45:08 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -31,7 +30,6 @@ * Modifier: Takanori Tateno FUJITSU LIMITED * */ -/* $XFree86: xc/lib/X11/XomGeneric.h,v 1.5 2003/04/13 19:22:19 dawes Exp $ */ #ifndef _XOMGENERIC_H_ #define _XOMGENERIC_H_ diff --git a/nx-X11/lib/X11/Xregion.h b/nx-X11/lib/X11/Xregion.h index 2ddf12cac..f555a8dd9 100644 --- a/nx-X11/lib/X11/Xregion.h +++ b/nx-X11/lib/X11/Xregion.h @@ -1,4 +1,3 @@ -/* $Xorg: region.h,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */ /************************************************************************ Copyright 1987, 1998 The Open Group diff --git a/nx-X11/lib/X11/Xresource.h b/nx-X11/lib/X11/Xresource.h index e46a5f467..c8c92a048 100644 --- a/nx-X11/lib/X11/Xresource.h +++ b/nx-X11/lib/X11/Xresource.h @@ -1,4 +1,3 @@ -/* $Xorg: Xresource.h,v 1.7 2001/02/09 02:03:39 xorgcvs Exp $ */ /*********************************************************** @@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/Xresource.h,v 3.8 2001/12/14 19:54:10 dawes Exp $ */ #ifndef _XRESOURCE_H_ #define _XRESOURCE_H_ diff --git a/nx-X11/lib/X11/Xrm.c b/nx-X11/lib/X11/Xrm.c index f27f9d2e8..1469b745d 100644 --- a/nx-X11/lib/X11/Xrm.c +++ b/nx-X11/lib/X11/Xrm.c @@ -1,4 +1,3 @@ -/* $Xorg: Xrm.c,v 1.7 2001/02/09 02:03:39 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1988, 1990 by Digital Equipment Corporation, Maynard @@ -49,7 +48,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/Xrm.c,v 3.22 2003/07/16 01:38:26 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/XrmI.h b/nx-X11/lib/X11/XrmI.h index 6178a634c..909e06e1e 100644 --- a/nx-X11/lib/X11/XrmI.h +++ b/nx-X11/lib/X11/XrmI.h @@ -1,4 +1,3 @@ -/* $Xorg: XrmI.h,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $ */ /* Copyright 1990, 1998 The Open Group diff --git a/nx-X11/lib/X11/Xutil.h b/nx-X11/lib/X11/Xutil.h index a50f254bb..f42721244 100644 --- a/nx-X11/lib/X11/Xutil.h +++ b/nx-X11/lib/X11/Xutil.h @@ -1,4 +1,3 @@ -/* $Xorg: Xutil.h,v 1.8 2001/02/09 02:03:39 xorgcvs Exp $ */ /*********************************************************** @@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/Xutil.h,v 3.6 2003/04/13 19:22:20 dawes Exp $ */ #if !defined(_XUTIL_H_) && !defined(_X11_XUTIL_H_) #define _XUTIL_H_ diff --git a/nx-X11/lib/X11/cmsAllCol.c b/nx-X11/lib/X11/cmsAllCol.c index 3aca57363..4b0c9b6dd 100644 --- a/nx-X11/lib/X11/cmsAllCol.c +++ b/nx-X11/lib/X11/cmsAllCol.c @@ -1,4 +1,3 @@ -/* $Xorg: cmsAllCol.c,v 1.3 2000/08/17 19:45:08 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -32,7 +31,6 @@ * * */ -/* $XFree86: xc/lib/X11/cmsAllCol.c,v 1.3 2001/01/17 19:41:50 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/cmsAllNCol.c b/nx-X11/lib/X11/cmsAllNCol.c index 8453a31c2..763d13269 100644 --- a/nx-X11/lib/X11/cmsAllNCol.c +++ b/nx-X11/lib/X11/cmsAllNCol.c @@ -1,4 +1,3 @@ -/* $Xorg: cmsAllNCol.c,v 1.3 2000/08/17 19:45:09 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -32,7 +31,6 @@ * * */ -/* $XFree86: xc/lib/X11/cmsAllNCol.c,v 1.4 2003/04/13 19:22:20 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/cmsCmap.c b/nx-X11/lib/X11/cmsCmap.c index 7ad5c7471..e44e46794 100644 --- a/nx-X11/lib/X11/cmsCmap.c +++ b/nx-X11/lib/X11/cmsCmap.c @@ -1,4 +1,3 @@ -/* $Xorg: cmsCmap.c,v 1.3 2000/08/17 19:45:09 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. diff --git a/nx-X11/lib/X11/cmsColNm.c b/nx-X11/lib/X11/cmsColNm.c index 63f166efe..1beaf2b88 100644 --- a/nx-X11/lib/X11/cmsColNm.c +++ b/nx-X11/lib/X11/cmsColNm.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/lib/X11/cmsColNm.c,v 1.4 2005/07/03 07:00:55 daniels Exp $ */ -/* $Xorg: cmsColNm.c,v 1.3 2000/08/17 19:45:09 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -32,7 +30,6 @@ * * */ -/* $XFree86: xc/lib/X11/cmsColNm.c,v 3.11 2003/04/13 19:22:20 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/cmsGlobls.c b/nx-X11/lib/X11/cmsGlobls.c index abe711c6a..3c7afd1ba 100644 --- a/nx-X11/lib/X11/cmsGlobls.c +++ b/nx-X11/lib/X11/cmsGlobls.c @@ -32,7 +32,6 @@ * * */ -/* $XFree86: xc/lib/X11/cmsGlobls.c,v 1.4 2001/01/17 19:41:51 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/cmsInt.c b/nx-X11/lib/X11/cmsInt.c index aa67a3aed..259e06586 100644 --- a/nx-X11/lib/X11/cmsInt.c +++ b/nx-X11/lib/X11/cmsInt.c @@ -1,4 +1,3 @@ -/* $Xorg: cmsInt.c,v 1.4 2000/08/17 19:45:09 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -34,7 +33,6 @@ * * */ -/* $XFree86: xc/lib/X11/cmsInt.c,v 1.4 2003/04/13 19:22:20 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/cmsLkCol.c b/nx-X11/lib/X11/cmsLkCol.c index b8211b2c6..c59a19a91 100644 --- a/nx-X11/lib/X11/cmsLkCol.c +++ b/nx-X11/lib/X11/cmsLkCol.c @@ -1,4 +1,3 @@ -/* $Xorg: cmsLkCol.c,v 1.3 2000/08/17 19:45:09 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -32,7 +31,6 @@ * * */ -/* $XFree86: xc/lib/X11/cmsLkCol.c,v 1.5 2003/04/13 19:22:20 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/cmsMath.c b/nx-X11/lib/X11/cmsMath.c index c97c7a90a..3dbc05f7b 100644 --- a/nx-X11/lib/X11/cmsMath.c +++ b/nx-X11/lib/X11/cmsMath.c @@ -1,4 +1,3 @@ -/* $Xorg: cmsMath.c,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $ */ /* @@ -25,7 +24,6 @@ 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/lib/X11/cmsMath.c,v 3.4 2001/07/29 05:01:11 tsi Exp $ */ /* * Stephen Gildea, MIT X Consortium, January 1991 diff --git a/nx-X11/lib/X11/cmsProp.c b/nx-X11/lib/X11/cmsProp.c index e9158479e..993a45c72 100644 --- a/nx-X11/lib/X11/cmsProp.c +++ b/nx-X11/lib/X11/cmsProp.c @@ -1,4 +1,3 @@ -/* $Xorg: cmsProp.c,v 1.3 2000/08/17 19:45:10 cpqbld Exp $ */ /* * diff --git a/nx-X11/lib/X11/cmsTrig.c b/nx-X11/lib/X11/cmsTrig.c index a2d100c04..6c32bf2e6 100644 --- a/nx-X11/lib/X11/cmsTrig.c +++ b/nx-X11/lib/X11/cmsTrig.c @@ -1,4 +1,3 @@ -/* $Xorg: cmsTrig.c,v 1.3 2000/08/17 19:45:10 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -24,7 +23,6 @@ * CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/lib/X11/cmsTrig.c,v 3.8 2001/10/28 03:32:34 tsi Exp $ */ /* * It should be pointed out that for simplicity's sake, the * environment parameters are defined as floating point constants, diff --git a/nx-X11/lib/X11/cursorfont.h b/nx-X11/lib/X11/cursorfont.h index c6204f1c5..7b4c84dad 100644 --- a/nx-X11/lib/X11/cursorfont.h +++ b/nx-X11/lib/X11/cursorfont.h @@ -1,4 +1,3 @@ -/* $Xorg: cursorfont.h,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group diff --git a/nx-X11/lib/X11/evtomask.c b/nx-X11/lib/X11/evtomask.c index c852c4608..c5dbad262 100644 --- a/nx-X11/lib/X11/evtomask.c +++ b/nx-X11/lib/X11/evtomask.c @@ -1,4 +1,3 @@ -/* $Xorg: evtomask.c,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/evtomask.c,v 3.4 2001/07/29 05:01:11 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/globals.c b/nx-X11/lib/X11/globals.c index 99054493d..d8c79d064 100644 --- a/nx-X11/lib/X11/globals.c +++ b/nx-X11/lib/X11/globals.c @@ -1,4 +1,3 @@ -/* $Xorg: globals.c,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/globals.c,v 3.4 2001/07/29 05:01:11 tsi Exp $ */ /* * diff --git a/nx-X11/lib/X11/imCallbk.c b/nx-X11/lib/X11/imCallbk.c index 867746cbb..b0414ed59 100644 --- a/nx-X11/lib/X11/imCallbk.c +++ b/nx-X11/lib/X11/imCallbk.c @@ -1,4 +1,3 @@ -/* $Xorg: imCallbk.c,v 1.4 2000/08/17 19:45:10 cpqbld Exp $ */ /*********************************************************************** Copyright 1993 by Digital Equipment Corporation, Maynard, Massachusetts, Copyright 1994 by FUJITSU LIMITED @@ -32,7 +31,6 @@ PERFORMANCE OF THIS SOFTWARE. makoto@sm.sony.co.jp ***********************************************************************/ -/* $XFree86: xc/lib/X11/imCallbk.c,v 3.9 2003/08/22 13:29:16 pascal Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imConv.c b/nx-X11/lib/X11/imConv.c index 6837ac042..1f3d6006f 100644 --- a/nx-X11/lib/X11/imConv.c +++ b/nx-X11/lib/X11/imConv.c @@ -33,7 +33,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* 2000 Modifier: Ivan Pascal The XFree86 Project. */ -/* $XFree86: xc/lib/X11/imConv.c,v 1.32 2003/04/13 19:22:20 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imDefFlt.c b/nx-X11/lib/X11/imDefFlt.c index c6ba5478b..b14d16889 100644 --- a/nx-X11/lib/X11/imDefFlt.c +++ b/nx-X11/lib/X11/imDefFlt.c @@ -1,4 +1,3 @@ -/* $Xorg: imDefFlt.c,v 1.4 2000/08/17 19:45:11 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -26,7 +25,6 @@ PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imDefFlt.c,v 1.4 2001/01/17 19:41:51 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imDefIc.c b/nx-X11/lib/X11/imDefIc.c index cb30ac232..42c9a6d10 100644 --- a/nx-X11/lib/X11/imDefIc.c +++ b/nx-X11/lib/X11/imDefIc.c @@ -1,4 +1,3 @@ -/* $Xorg: imDefIc.c,v 1.5 2000/08/17 19:45:11 cpqbld Exp $ */ /****************************************************************** Copyright 1991, 1992 by Sun Microsystems, Inc. @@ -28,7 +27,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imDefIc.c,v 3.9 2003/04/13 19:22:20 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imDefIm.c b/nx-X11/lib/X11/imDefIm.c index 3d5c6fe88..058a516e2 100644 --- a/nx-X11/lib/X11/imDefIm.c +++ b/nx-X11/lib/X11/imDefIm.c @@ -1,4 +1,3 @@ -/* $Xorg: imDefIm.c,v 1.5 2000/08/17 19:45:12 cpqbld Exp $ */ /****************************************************************** Copyright 1990, 1991, 1992 by Sun Microsystems, Inc. Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -31,7 +30,6 @@ OF THIS SOFTWARE. makoto@sm.sony.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imDefIm.c,v 1.15 2003/08/22 19:27:24 eich Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imDefLkup.c b/nx-X11/lib/X11/imDefLkup.c index 13c538bff..3b90fd8d4 100644 --- a/nx-X11/lib/X11/imDefLkup.c +++ b/nx-X11/lib/X11/imDefLkup.c @@ -1,4 +1,3 @@ -/* $Xorg: imDefLkup.c,v 1.3 2000/08/17 19:45:12 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -26,7 +25,6 @@ PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imDefLkup.c,v 3.11 2003/06/23 17:35:43 eich Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imDispch.c b/nx-X11/lib/X11/imDispch.c index 1e3287529..951e75000 100644 --- a/nx-X11/lib/X11/imDispch.c +++ b/nx-X11/lib/X11/imDispch.c @@ -1,4 +1,3 @@ -/* $Xorg: imDispch.c,v 1.3 2000/08/17 19:45:12 cpqbld Exp $ */ /****************************************************************** Copyright 1993, 1994 by FUJITSU LIMITED @@ -26,7 +25,6 @@ PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imDispch.c,v 1.4 2003/04/13 19:22:20 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imEvToWire.c b/nx-X11/lib/X11/imEvToWire.c index 29fd0418b..abf9e50dc 100644 --- a/nx-X11/lib/X11/imEvToWire.c +++ b/nx-X11/lib/X11/imEvToWire.c @@ -1,4 +1,3 @@ -/* $Xorg: imEvToWire.c,v 1.3 2000/08/17 19:45:12 cpqbld Exp $ */ /*********************************************************** Copyright 1993 by Digital Equipment Corporation, Maynard, Massachusetts, diff --git a/nx-X11/lib/X11/imExten.c b/nx-X11/lib/X11/imExten.c index 1b18961e3..9eafdb270 100644 --- a/nx-X11/lib/X11/imExten.c +++ b/nx-X11/lib/X11/imExten.c @@ -1,4 +1,3 @@ -/* $Xorg: imExten.c,v 1.3 2000/08/17 19:45:12 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -26,7 +25,6 @@ PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imExten.c,v 1.4 2003/04/13 19:22:21 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imImSw.c b/nx-X11/lib/X11/imImSw.c index e2c113b23..e8a950417 100644 --- a/nx-X11/lib/X11/imImSw.c +++ b/nx-X11/lib/X11/imImSw.c @@ -1,4 +1,3 @@ -/* $Xorg: imImSw.c,v 1.3 2000/08/17 19:45:12 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993 by FUJITSU LIMITED @@ -32,7 +31,6 @@ THIS SOFTWARE. frankyling@hgrd01.enet.dec.com ******************************************************************/ -/* $XFree86: xc/lib/X11/imImSw.c,v 1.3 2001/01/17 19:41:51 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imInsClbk.c b/nx-X11/lib/X11/imInsClbk.c index 43e3d60bb..5980d3efd 100644 --- a/nx-X11/lib/X11/imInsClbk.c +++ b/nx-X11/lib/X11/imInsClbk.c @@ -1,4 +1,3 @@ -/* $Xorg: imInsClbk.c,v 1.3 2000/08/17 19:45:13 cpqbld Exp $ */ /****************************************************************** Copyright 1993, 1994 by Sony Corporation @@ -26,7 +25,6 @@ PERFORMANCE OF THIS SOFTWARE. makoto@sm.sony.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imInsClbk.c,v 3.3 2003/05/27 22:26:26 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imInt.c b/nx-X11/lib/X11/imInt.c index 9658eef58..e149d8c56 100644 --- a/nx-X11/lib/X11/imInt.c +++ b/nx-X11/lib/X11/imInt.c @@ -1,4 +1,3 @@ -/* $Xorg: imInt.c,v 1.8 2000/08/17 19:45:13 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -26,7 +25,6 @@ PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imInt.c,v 3.12 2003/04/17 02:06:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imKStoUCS.c b/nx-X11/lib/X11/imKStoUCS.c index 7d8d5b92d..7c8d97574 100644 --- a/nx-X11/lib/X11/imKStoUCS.c +++ b/nx-X11/lib/X11/imKStoUCS.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/imKStoUCS.c,v 1.4 2003/04/29 11:29:18 pascal Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imLcFlt.c b/nx-X11/lib/X11/imLcFlt.c index 5aa5c28a4..6e054e34b 100644 --- a/nx-X11/lib/X11/imLcFlt.c +++ b/nx-X11/lib/X11/imLcFlt.c @@ -1,4 +1,3 @@ -/* $Xorg: imLcFlt.c,v 1.3 2000/08/17 19:45:13 cpqbld Exp $ */ /****************************************************************** Copyright 1992 by Fuji Xerox Co., Ltd. diff --git a/nx-X11/lib/X11/imLcGIc.c b/nx-X11/lib/X11/imLcGIc.c index c057b9262..bd5c1eec1 100644 --- a/nx-X11/lib/X11/imLcGIc.c +++ b/nx-X11/lib/X11/imLcGIc.c @@ -1,4 +1,3 @@ -/* $Xorg: imLcGIc.c,v 1.3 2000/08/17 19:45:13 cpqbld Exp $ */ /****************************************************************** Copyright 1992,1993, 1994 by FUJITSU LIMITED diff --git a/nx-X11/lib/X11/imLcIc.c b/nx-X11/lib/X11/imLcIc.c index 475bbbef8..79da511df 100644 --- a/nx-X11/lib/X11/imLcIc.c +++ b/nx-X11/lib/X11/imLcIc.c @@ -1,4 +1,3 @@ -/* $Xorg: imLcIc.c,v 1.3 2000/08/17 19:45:13 cpqbld Exp $ */ /****************************************************************** Copyright 1992,1993, 1994 by FUJITSU LIMITED @@ -26,7 +25,6 @@ PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imLcIc.c,v 1.4 2001/01/17 19:41:52 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imLcIm.c b/nx-X11/lib/X11/imLcIm.c index 0a9027e6f..fa73f43ba 100644 --- a/nx-X11/lib/X11/imLcIm.c +++ b/nx-X11/lib/X11/imLcIm.c @@ -1,4 +1,3 @@ -/* $Xorg: imLcIm.c,v 1.3 2000/08/17 19:45:14 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -32,7 +31,6 @@ THIS SOFTWARE. frankyling@hgrd01.enet.dec.com ******************************************************************/ -/* $XFree86: xc/lib/X11/imLcIm.c,v 1.12 2003/09/06 14:06:32 pascal Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imLcLkup.c b/nx-X11/lib/X11/imLcLkup.c index b1db9f8f7..a23a72c54 100644 --- a/nx-X11/lib/X11/imLcLkup.c +++ b/nx-X11/lib/X11/imLcLkup.c @@ -1,4 +1,3 @@ -/* $Xorg: imLcLkup.c,v 1.3 2000/08/17 19:45:14 cpqbld Exp $ */ /****************************************************************** Copyright 1992 by Fuji Xerox Co., Ltd. @@ -29,7 +28,6 @@ PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imLcLkup.c,v 3.8 2003/06/23 17:35:43 eich Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imLcPrs.c b/nx-X11/lib/X11/imLcPrs.c index 616d45186..85269b1ef 100644 --- a/nx-X11/lib/X11/imLcPrs.c +++ b/nx-X11/lib/X11/imLcPrs.c @@ -1,4 +1,3 @@ -/* $Xorg: imLcPrs.c,v 1.3 2000/08/17 19:45:14 cpqbld Exp $ */ /****************************************************************** Copyright 1992 by Oki Technosystems Laboratory, Inc. @@ -30,7 +29,6 @@ OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/imLcPrs.c,v 1.10 2003/09/06 14:06:32 pascal Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imLcSIc.c b/nx-X11/lib/X11/imLcSIc.c index e36c52269..1dceb3b10 100644 --- a/nx-X11/lib/X11/imLcSIc.c +++ b/nx-X11/lib/X11/imLcSIc.c @@ -1,4 +1,3 @@ -/* $Xorg: imLcSIc.c,v 1.3 2000/08/17 19:45:14 cpqbld Exp $ */ /****************************************************************** Copyright 1990, 1991, 1992, 1993, 1994 by FUJITSU LIMITED diff --git a/nx-X11/lib/X11/imRm.c b/nx-X11/lib/X11/imRm.c index 1da1b2967..fa5a57021 100644 --- a/nx-X11/lib/X11/imRm.c +++ b/nx-X11/lib/X11/imRm.c @@ -1,4 +1,3 @@ -/* $Xorg: imRm.c,v 1.4 2000/08/17 19:45:14 cpqbld Exp $ */ /****************************************************************** Copyright 1990, 1991, 1992,1993, 1994 by FUJITSU LIMITED @@ -30,7 +29,6 @@ PERFORMANCE OF THIS SOFTWARE. makoto@sm.sony.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imRm.c,v 3.12 2003/04/13 19:22:21 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imRmAttr.c b/nx-X11/lib/X11/imRmAttr.c index af4db3db0..a73e0a9b9 100644 --- a/nx-X11/lib/X11/imRmAttr.c +++ b/nx-X11/lib/X11/imRmAttr.c @@ -1,4 +1,3 @@ -/* $Xorg: imRmAttr.c,v 1.4 2000/08/17 19:45:15 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -26,7 +25,6 @@ PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imRmAttr.c,v 1.7 2003/04/13 19:22:21 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imThaiFlt.c b/nx-X11/lib/X11/imThaiFlt.c index 41ab992b0..e62dea091 100644 --- a/nx-X11/lib/X11/imThaiFlt.c +++ b/nx-X11/lib/X11/imThaiFlt.c @@ -1,4 +1,3 @@ -/* $Xorg: imThaiFlt.c,v 1.5 2001/02/09 02:03:39 xorgcvs Exp $ */ /*********************************************************** Copyright 1993, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/imThaiFlt.c,v 3.22tsi Exp $ */ /* **++ diff --git a/nx-X11/lib/X11/imThaiIc.c b/nx-X11/lib/X11/imThaiIc.c index 97a72ac81..5f022f2fd 100644 --- a/nx-X11/lib/X11/imThaiIc.c +++ b/nx-X11/lib/X11/imThaiIc.c @@ -1,4 +1,3 @@ -/* $Xorg: imThaiIc.c,v 1.3 2000/08/17 19:45:15 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -32,7 +31,6 @@ THIS SOFTWARE. frankyling@hgrd01.enet.dec.com ******************************************************************/ -/* $XFree86: xc/lib/X11/imThaiIc.c,v 1.4 2001/01/17 19:41:52 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imThaiIm.c b/nx-X11/lib/X11/imThaiIm.c index 85e9df6d3..00a6d13b1 100644 --- a/nx-X11/lib/X11/imThaiIm.c +++ b/nx-X11/lib/X11/imThaiIm.c @@ -1,4 +1,3 @@ -/* $Xorg: imThaiIm.c,v 1.3 2000/08/17 19:45:15 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993, 1994 by FUJITSU LIMITED @@ -32,7 +31,6 @@ THIS SOFTWARE. frankyling@hgrd01.enet.dec.com ******************************************************************/ -/* $XFree86: xc/lib/X11/imThaiIm.c,v 1.7 2001/01/17 19:41:52 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imTrX.c b/nx-X11/lib/X11/imTrX.c index 59c766b85..723c97021 100644 --- a/nx-X11/lib/X11/imTrX.c +++ b/nx-X11/lib/X11/imTrX.c @@ -1,4 +1,3 @@ -/* $Xorg: imTrX.c,v 1.4 2000/08/17 19:45:15 cpqbld Exp $ */ /****************************************************************** Copyright 1992 by Sun Microsystems, Inc. @@ -28,7 +27,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imTrX.c,v 1.3 2003/04/13 19:22:21 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imTrans.c b/nx-X11/lib/X11/imTrans.c index b69e0c06c..ec2757983 100644 --- a/nx-X11/lib/X11/imTrans.c +++ b/nx-X11/lib/X11/imTrans.c @@ -1,4 +1,3 @@ -/* $Xorg: imTrans.c,v 1.3 2000/08/17 19:45:16 cpqbld Exp $ */ /****************************************************************** Copyright 1992 by Sun Microsystems, Inc. @@ -28,7 +27,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imTrans.c,v 1.3 2003/04/17 02:06:32 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/imTransR.c b/nx-X11/lib/X11/imTransR.c index 5ca4a39c0..532eaf151 100644 --- a/nx-X11/lib/X11/imTransR.c +++ b/nx-X11/lib/X11/imTransR.c @@ -1,4 +1,3 @@ -/* $Xorg: imTransR.c,v 1.4 2000/08/17 19:45:16 cpqbld Exp $ */ /****************************************************************** Copyright 1992 by Sun Microsystems, Inc. @@ -28,7 +27,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/imTransR.c,v 3.6 2003/04/17 02:39:56 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcCT.c b/nx-X11/lib/X11/lcCT.c index 41c7cf418..7e8335f87 100644 --- a/nx-X11/lib/X11/lcCT.c +++ b/nx-X11/lib/X11/lcCT.c @@ -1,4 +1,3 @@ -/* $Xorg: lcCT.c,v 1.4 2000/08/17 19:45:16 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -36,7 +35,6 @@ * Modifier: Ivan Pascal The XFree86 Project * Modifier: Bruno Haible The XFree86 Project */ -/* $XFree86: xc/lib/X11/lcCT.c,v 3.26 2001/10/28 03:32:34 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcCharSet.c b/nx-X11/lib/X11/lcCharSet.c index 006a0be23..7f0ef3666 100644 --- a/nx-X11/lib/X11/lcCharSet.c +++ b/nx-X11/lib/X11/lcCharSet.c @@ -1,4 +1,3 @@ -/* $Xorg: lcCharSet.c,v 1.3 2000/08/17 19:45:16 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcCharSet.c,v 3.8 2001/01/17 19:41:53 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcConv.c b/nx-X11/lib/X11/lcConv.c index 2f65ac7bd..00e0ebb98 100644 --- a/nx-X11/lib/X11/lcConv.c +++ b/nx-X11/lib/X11/lcConv.c @@ -1,4 +1,3 @@ -/* $Xorg: lcConv.c,v 1.4 2000/08/17 19:45:17 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcConv.c,v 1.5 2000/12/04 18:49:26 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcDB.c b/nx-X11/lib/X11/lcDB.c index 7a14d3d4f..229f517e4 100644 --- a/nx-X11/lib/X11/lcDB.c +++ b/nx-X11/lib/X11/lcDB.c @@ -1,4 +1,3 @@ -/* $Xorg: lcDB.c,v 1.6 2000/08/17 19:45:17 cpqbld Exp $ */ /* * * Copyright IBM Corporation 1993 @@ -28,7 +27,6 @@ * This is source code modified by FUJITSU LIMITED under the Joint * Development Agreement for the CDE/Motif PST. */ -/* $XFree86: xc/lib/X11/lcDB.c,v 3.15tsi Exp $ */ diff --git a/nx-X11/lib/X11/lcDefConv.c b/nx-X11/lib/X11/lcDefConv.c index fb504d11d..375d6419d 100644 --- a/nx-X11/lib/X11/lcDefConv.c +++ b/nx-X11/lib/X11/lcDefConv.c @@ -1,4 +1,3 @@ -/* $Xorg: lcDefConv.c,v 1.3 2000/08/17 19:45:17 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -27,7 +26,6 @@ * 2000 * Modifier: Ivan Pascal The XFree86 Project */ -/* $XFree86: xc/lib/X11/lcDefConv.c,v 1.6 2001/01/17 19:41:53 dawes Exp $ */ /* * The default locale loader. diff --git a/nx-X11/lib/X11/lcDynamic.c b/nx-X11/lib/X11/lcDynamic.c index 5d359ed74..f6df94cbb 100644 --- a/nx-X11/lib/X11/lcDynamic.c +++ b/nx-X11/lib/X11/lcDynamic.c @@ -1,4 +1,3 @@ -/* $Xorg: lcDynamic.c,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $ */ /* Copyright 1996, 1998 The Open Group @@ -32,7 +31,6 @@ from The Open Group. * Modifier: Takanori Tateno FUJITSU LIMITED * */ -/* $XFree86: xc/lib/X11/lcDynamic.c,v 1.4 2001/01/17 19:41:53 dawes Exp $ */ /* * A dynamically loaded locale. diff --git a/nx-X11/lib/X11/lcEuc.c b/nx-X11/lib/X11/lcEuc.c index 1b54508be..3e8b77c88 100644 --- a/nx-X11/lib/X11/lcEuc.c +++ b/nx-X11/lib/X11/lcEuc.c @@ -1,4 +1,3 @@ -/* $Xorg: lcEuc.c,v 1.3 2000/08/17 19:45:17 cpqbld Exp $ */ /****************************************************************** Copyright 1992, 1993 by FUJITSU LIMITED @@ -30,7 +29,6 @@ OF THIS SOFTWARE. Yoshiyuki Segawa (segawa@ossi.com) *****************************************************************/ -/* $XFree86: xc/lib/X11/lcEuc.c,v 3.12 2003/01/20 04:05:30 dawes Exp $ */ /* * An EUC locale. diff --git a/nx-X11/lib/X11/lcFile.c b/nx-X11/lib/X11/lcFile.c index e1812ad91..5989a9aae 100644 --- a/nx-X11/lib/X11/lcFile.c +++ b/nx-X11/lib/X11/lcFile.c @@ -1,4 +1,3 @@ -/* $Xorg: lcFile.c,v 1.5 2000/12/12 12:44:05 coskrey Exp $ */ /* * * Copyright IBM Corporation 1993 @@ -23,7 +22,6 @@ * SOFTWARE. * */ -/* $XFree86: xc/lib/X11/lcFile.c,v 3.32 2003/03/25 04:18:09 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcGenConv.c b/nx-X11/lib/X11/lcGenConv.c index 76e7d0f78..0c1af957c 100644 --- a/nx-X11/lib/X11/lcGenConv.c +++ b/nx-X11/lib/X11/lcGenConv.c @@ -1,4 +1,3 @@ -/* $Xorg: lcGenConv.c,v 1.5 2000/08/17 19:45:17 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -35,7 +34,6 @@ * 2000 * Modifier: Ivan Pascal The XFree86 Project */ -/* $XFree86: xc/lib/X11/lcGenConv.c,v 3.27tsi Exp $ */ /* * A generic locale loader for all kinds of ISO-2022 based codesets. diff --git a/nx-X11/lib/X11/lcGeneric.c b/nx-X11/lib/X11/lcGeneric.c index dead30561..67c8ba030 100644 --- a/nx-X11/lib/X11/lcGeneric.c +++ b/nx-X11/lib/X11/lcGeneric.c @@ -1,4 +1,3 @@ -/* $Xorg: lcGeneric.c,v 1.7 2000/12/12 12:44:05 coskrey Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -28,7 +27,6 @@ * This is source code modified by FUJITSU LIMITED under the Joint * Development Agreement for the CDE/Motif PST. */ -/* $XFree86: xc/lib/X11/lcGeneric.c,v 3.19 2003/05/27 16:55:27 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcInit.c b/nx-X11/lib/X11/lcInit.c index 6375de805..fb9fde9f4 100644 --- a/nx-X11/lib/X11/lcInit.c +++ b/nx-X11/lib/X11/lcInit.c @@ -41,7 +41,6 @@ interest in or to any trademark, service mark, logo or trade name of Sun Microsystems, Inc. or its licensors is granted. */ -/* $Xorg: lcInit.c,v 1.4 2000/12/12 12:44:05 coskrey Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -74,7 +73,6 @@ Sun Microsystems, Inc. or its licensors is granted. * Modifier: Masayoshi Shimamura FUJITSU LIMITED * */ -/* $XFree86: xc/lib/X11/lcInit.c,v 3.9 2001/11/16 00:52:27 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcJis.c b/nx-X11/lib/X11/lcJis.c index bdd46e36e..6cb6ce0f8 100644 --- a/nx-X11/lib/X11/lcJis.c +++ b/nx-X11/lib/X11/lcJis.c @@ -1,4 +1,3 @@ -/* $Xorg: lcJis.c,v 1.3 2000/08/17 19:45:18 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcJis.c,v 1.9 2002/04/10 16:20:06 tsi Exp $ */ /* * A Japanese JIS locale. diff --git a/nx-X11/lib/X11/lcPrTxt.c b/nx-X11/lib/X11/lcPrTxt.c index 1a55d1cab..2d68bfb93 100644 --- a/nx-X11/lib/X11/lcPrTxt.c +++ b/nx-X11/lib/X11/lcPrTxt.c @@ -1,4 +1,3 @@ -/* $Xorg: lcPrTxt.c,v 1.3 2000/08/17 19:45:18 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcPrTxt.c,v 1.9 2003/04/03 22:34:02 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcPubWrap.c b/nx-X11/lib/X11/lcPubWrap.c index e30a55c08..70e93d209 100644 --- a/nx-X11/lib/X11/lcPubWrap.c +++ b/nx-X11/lib/X11/lcPubWrap.c @@ -1,4 +1,3 @@ -/* $Xorg: lcPubWrap.c,v 1.3 2000/08/17 19:45:18 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcPubWrap.c,v 1.4 2001/01/17 19:41:55 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcPublic.c b/nx-X11/lib/X11/lcPublic.c index d80451610..8cff046c4 100644 --- a/nx-X11/lib/X11/lcPublic.c +++ b/nx-X11/lib/X11/lcPublic.c @@ -1,4 +1,3 @@ -/* $Xorg: lcPublic.c,v 1.4 2000/12/12 12:44:05 coskrey Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcPublic.c,v 1.11 2001/11/16 00:52:28 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcRM.c b/nx-X11/lib/X11/lcRM.c index 1ffa4ef72..9f72504ee 100644 --- a/nx-X11/lib/X11/lcRM.c +++ b/nx-X11/lib/X11/lcRM.c @@ -1,4 +1,3 @@ -/* $Xorg: lcRM.c,v 1.3 2000/08/17 19:45:19 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -24,7 +23,6 @@ * mopi@osa.ilab.toshiba.co.jp * Bug fixes: Bruno Haible XFree86 Inc. */ -/* $XFree86: xc/lib/X11/lcRM.c,v 1.4 2000/11/28 18:49:48 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcSjis.c b/nx-X11/lib/X11/lcSjis.c index 6adb2945d..459156eb9 100644 --- a/nx-X11/lib/X11/lcSjis.c +++ b/nx-X11/lib/X11/lcSjis.c @@ -1,4 +1,3 @@ -/* $Xorg: lcSjis.c,v 1.3 2000/08/17 19:45:19 cpqbld Exp $ */ /**************************************************************** Copyright 1992, 1993 by FUJITSU LIMITED @@ -35,7 +34,6 @@ OR PERFORMANCE OF THIS SOFTWARE. makoto@sm.sony.co.jp *****************************************************************/ -/* $XFree86: xc/lib/X11/lcSjis.c,v 3.9 2002/04/10 16:20:06 tsi Exp $ */ /* * A Japanese SJIS locale. diff --git a/nx-X11/lib/X11/lcStd.c b/nx-X11/lib/X11/lcStd.c index e112dceac..8faee0151 100644 --- a/nx-X11/lib/X11/lcStd.c +++ b/nx-X11/lib/X11/lcStd.c @@ -1,4 +1,3 @@ -/* $Xorg: lcStd.c,v 1.4 2000/08/17 19:45:20 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcStd.c,v 1.6 2003/04/13 19:22:21 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcTxtPr.c b/nx-X11/lib/X11/lcTxtPr.c index e214ac4e9..482c49999 100644 --- a/nx-X11/lib/X11/lcTxtPr.c +++ b/nx-X11/lib/X11/lcTxtPr.c @@ -1,4 +1,3 @@ -/* $Xorg: lcTxtPr.c,v 1.3 2000/08/17 19:45:20 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcTxtPr.c,v 3.3 2001/01/17 19:41:55 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcUTF8.c b/nx-X11/lib/X11/lcUTF8.c index 405250039..4d28a0d90 100644 --- a/nx-X11/lib/X11/lcUTF8.c +++ b/nx-X11/lib/X11/lcUTF8.c @@ -24,7 +24,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/lcUTF8.c,v 1.15 2002/10/08 23:31:36 dawes Exp $ */ /* * This file contains: diff --git a/nx-X11/lib/X11/lcUTF8Load.c b/nx-X11/lib/X11/lcUTF8Load.c index f4bff2880..15165243b 100644 --- a/nx-X11/lib/X11/lcUTF8Load.c +++ b/nx-X11/lib/X11/lcUTF8Load.c @@ -24,7 +24,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/lcUTF8.c,v 1.12 2001/02/09 00:02:53 dawes Exp $ */ /* * This file contains the UTF-8 locale loader. diff --git a/nx-X11/lib/X11/lcUniConv/8bit_tab_to_h.c b/nx-X11/lib/X11/lcUniConv/8bit_tab_to_h.c index ae5340cf3..1caa28a21 100644 --- a/nx-X11/lib/X11/lcUniConv/8bit_tab_to_h.c +++ b/nx-X11/lib/X11/lcUniConv/8bit_tab_to_h.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/8bit_tab_to_h.c,v 1.2 2000/12/04 18:49:30 dawes Exp $ */ /* * Generates an 8-bit character set table from a .TXT table as found on diff --git a/nx-X11/lib/X11/lcUniConv/armscii_8.h b/nx-X11/lib/X11/lcUniConv/armscii_8.h index 6ca102eaa..567bfeac2 100644 --- a/nx-X11/lib/X11/lcUniConv/armscii_8.h +++ b/nx-X11/lib/X11/lcUniConv/armscii_8.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/armscii_8.h,v 1.3 2000/11/29 17:40:28 dawes Exp $ */ /* * ARMSCII-8 diff --git a/nx-X11/lib/X11/lcUniConv/big5.h b/nx-X11/lib/X11/lcUniConv/big5.h index b356b5ebf..db439088b 100644 --- a/nx-X11/lib/X11/lcUniConv/big5.h +++ b/nx-X11/lib/X11/lcUniConv/big5.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/big5.h,v 1.1tsi Exp $ */ /* * BIG5 diff --git a/nx-X11/lib/X11/lcUniConv/gb2312.h b/nx-X11/lib/X11/lcUniConv/gb2312.h index db900a478..2eec308d2 100644 --- a/nx-X11/lib/X11/lcUniConv/gb2312.h +++ b/nx-X11/lib/X11/lcUniConv/gb2312.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/gb2312.h,v 1.4tsi Exp $ */ /* * GB2312.1980-0 diff --git a/nx-X11/lib/X11/lcUniConv/iso8859_11.h b/nx-X11/lib/X11/lcUniConv/iso8859_11.h index 57eb016a8..5458da514 100644 --- a/nx-X11/lib/X11/lcUniConv/iso8859_11.h +++ b/nx-X11/lib/X11/lcUniConv/iso8859_11.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/iso8859_11.h,v 1.1tsi Exp $ */ /* * ISO8859-11 diff --git a/nx-X11/lib/X11/lcUniConv/iso8859_13.h b/nx-X11/lib/X11/lcUniConv/iso8859_13.h index 7ad1fd2a1..c041b154a 100644 --- a/nx-X11/lib/X11/lcUniConv/iso8859_13.h +++ b/nx-X11/lib/X11/lcUniConv/iso8859_13.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/iso8859_13.h,v 1.1 2000/06/23 19:50:59 dawes Exp $ */ /* * ISO-8859-13 diff --git a/nx-X11/lib/X11/lcUniConv/iso8859_16.h b/nx-X11/lib/X11/lcUniConv/iso8859_16.h index 657e4450d..99a54d98f 100644 --- a/nx-X11/lib/X11/lcUniConv/iso8859_16.h +++ b/nx-X11/lib/X11/lcUniConv/iso8859_16.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/iso8859_16.h,v 1.3 2000/11/29 17:40:31 dawes Exp $ */ /* * ISO-8859-16 diff --git a/nx-X11/lib/X11/lcUniConv/iso8859_9e.h b/nx-X11/lib/X11/lcUniConv/iso8859_9e.h index 17ff75b03..cbab5816c 100644 --- a/nx-X11/lib/X11/lcUniConv/iso8859_9e.h +++ b/nx-X11/lib/X11/lcUniConv/iso8859_9e.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/iso8859_9e.h,v 1.2 2000/11/02 19:10:45 dawes Exp $ */ /* * ISO-8859-9E diff --git a/nx-X11/lib/X11/lcUniConv/jisx0208.h b/nx-X11/lib/X11/lcUniConv/jisx0208.h index 4d8a8918a..5888f6f21 100644 --- a/nx-X11/lib/X11/lcUniConv/jisx0208.h +++ b/nx-X11/lib/X11/lcUniConv/jisx0208.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/jisx0208.h,v 1.5tsi Exp $ */ /* * JISX0208.1990-0 diff --git a/nx-X11/lib/X11/lcUniConv/jisx0212.h b/nx-X11/lib/X11/lcUniConv/jisx0212.h index 6c89ee638..05cca5203 100644 --- a/nx-X11/lib/X11/lcUniConv/jisx0212.h +++ b/nx-X11/lib/X11/lcUniConv/jisx0212.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/jisx0212.h,v 1.4tsi Exp $ */ /* * JISX0212.1990-0 diff --git a/nx-X11/lib/X11/lcUniConv/koi8_c.h b/nx-X11/lib/X11/lcUniConv/koi8_c.h index 504c2589c..d870a01db 100644 --- a/nx-X11/lib/X11/lcUniConv/koi8_c.h +++ b/nx-X11/lib/X11/lcUniConv/koi8_c.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/koi8_c.h,v 1.1 2000/10/27 20:26:08 dawes Exp $ */ /* * KOI8-C diff --git a/nx-X11/lib/X11/lcUniConv/ksc5601.h b/nx-X11/lib/X11/lcUniConv/ksc5601.h index 7e2a4623e..3b93ba2dd 100644 --- a/nx-X11/lib/X11/lcUniConv/ksc5601.h +++ b/nx-X11/lib/X11/lcUniConv/ksc5601.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/ksc5601.h,v 1.4tsi Exp $ */ /* * KSC5601.1987-0 diff --git a/nx-X11/lib/X11/lcUniConv/tatar_cyr.h b/nx-X11/lib/X11/lcUniConv/tatar_cyr.h index 5783fd925..471e5a79a 100644 --- a/nx-X11/lib/X11/lcUniConv/tatar_cyr.h +++ b/nx-X11/lib/X11/lcUniConv/tatar_cyr.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/tatar_cyr.h,v 1.2 2000/11/28 16:10:31 dawes Exp $ */ /* * TATAR-CYR diff --git a/nx-X11/lib/X11/lcUniConv/tis620.h b/nx-X11/lib/X11/lcUniConv/tis620.h index deda9769d..4fa96ec98 100644 --- a/nx-X11/lib/X11/lcUniConv/tis620.h +++ b/nx-X11/lib/X11/lcUniConv/tis620.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/tis620.h,v 1.3 2000/11/29 17:40:35 dawes Exp $ */ /* * TIS620-0 diff --git a/nx-X11/lib/X11/lcUniConv/utf8.h b/nx-X11/lib/X11/lcUniConv/utf8.h index f8c2a7d8a..d00995ca0 100644 --- a/nx-X11/lib/X11/lcUniConv/utf8.h +++ b/nx-X11/lib/X11/lcUniConv/utf8.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/X11/lcUniConv/utf8.h,v 1.2 2000/11/28 16:10:32 dawes Exp $ */ /* * UTF-8 diff --git a/nx-X11/lib/X11/lcUtil.c b/nx-X11/lib/X11/lcUtil.c index 3e49fd08f..f58593009 100644 --- a/nx-X11/lib/X11/lcUtil.c +++ b/nx-X11/lib/X11/lcUtil.c @@ -1,4 +1,3 @@ -/* $Xorg: lcUtil.c,v 1.3 2000/08/17 19:45:20 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -24,7 +23,6 @@ * mopi@osa.ilab.toshiba.co.jp * Bug fixes: Bruno Haible XFree86 Inc. */ -/* $XFree86: xc/lib/X11/lcUtil.c,v 1.3 2000/11/29 17:40:24 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/lcWrap.c b/nx-X11/lib/X11/lcWrap.c index b694425fe..b9f9a99e5 100644 --- a/nx-X11/lib/X11/lcWrap.c +++ b/nx-X11/lib/X11/lcWrap.c @@ -1,4 +1,3 @@ -/* $Xorg: lcWrap.c,v 1.6 2001/02/09 02:03:39 xorgcvs Exp $ */ /* Copyright 1991, 1998 The Open Group @@ -53,7 +52,6 @@ from The Open Group. * * Katsuhisa Yano TOSHIBA Corp. */ -/* $XFree86: xc/lib/X11/lcWrap.c,v 3.15 2003/04/13 19:22:22 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/libX11.elist b/nx-X11/lib/X11/libX11.elist index 511a5edea..03b50111b 100644 --- a/nx-X11/lib/X11/libX11.elist +++ b/nx-X11/lib/X11/libX11.elist @@ -1,4 +1,3 @@ -/* $Xorg: libX11.elist,v 1.3 2000/08/17 19:45:20 cpqbld Exp $ */ /************************************************************************* * Export list for libX11 diff --git a/nx-X11/lib/X11/locking.c b/nx-X11/lib/X11/locking.c index 537ffa3f4..a888be4f2 100644 --- a/nx-X11/lib/X11/locking.c +++ b/nx-X11/lib/X11/locking.c @@ -1,4 +1,3 @@ -/* $Xorg: locking.c,v 1.5 2001/02/09 02:03:40 xorgcvs Exp $ */ /* Copyright 1992, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/locking.c,v 1.5 2003/04/13 19:22:22 dawes Exp $ */ /* * Author: Stephen Gildea, MIT X Consortium diff --git a/nx-X11/lib/X11/locking.h b/nx-X11/lib/X11/locking.h index 4b847ded6..7126e61d8 100644 --- a/nx-X11/lib/X11/locking.h +++ b/nx-X11/lib/X11/locking.h @@ -1,4 +1,3 @@ -/* $Xorg: locking.h,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */ /* Copyright 1992, 1998 The Open Group @@ -24,7 +23,6 @@ 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/lib/X11/locking.h,v 1.4 2001/12/14 19:54:10 dawes Exp $ */ /* * Author: Stephen Gildea, MIT X Consortium diff --git a/nx-X11/lib/X11/mbWMProps.c b/nx-X11/lib/X11/mbWMProps.c index 8b16bc990..123d379fc 100644 --- a/nx-X11/lib/X11/mbWMProps.c +++ b/nx-X11/lib/X11/mbWMProps.c @@ -1,4 +1,3 @@ -/* $Xorg: mbWMProps.c,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */ /* Copyright 1991, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/mbWMProps.c,v 1.5 2001/12/14 19:54:10 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/mbWrap.c b/nx-X11/lib/X11/mbWrap.c index 827c10b1c..812b60d80 100644 --- a/nx-X11/lib/X11/mbWrap.c +++ b/nx-X11/lib/X11/mbWrap.c @@ -1,4 +1,3 @@ -/* $Xorg: mbWrap.c,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */ /* Copyright 1991, 1998 The Open Group @@ -50,7 +49,6 @@ from The Open Group. * * M. Collins OSF */ -/* $XFree86: xc/lib/X11/mbWrap.c,v 1.6 2001/12/14 19:54:10 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/omDefault.c b/nx-X11/lib/X11/omDefault.c index eaa75ff84..134ef461a 100644 --- a/nx-X11/lib/X11/omDefault.c +++ b/nx-X11/lib/X11/omDefault.c @@ -1,4 +1,3 @@ -/* $Xorg: omDefault.c,v 1.3 2000/08/17 19:45:21 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -28,7 +27,6 @@ * This is source code modified by FUJITSU LIMITED under the Joint * Development Agreement for the CDE/Motif PST. */ -/* $XFree86: xc/lib/X11/omDefault.c,v 1.6 2003/04/13 19:22:22 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/omGeneric.c b/nx-X11/lib/X11/omGeneric.c index 8f4942873..1b75a3067 100644 --- a/nx-X11/lib/X11/omGeneric.c +++ b/nx-X11/lib/X11/omGeneric.c @@ -1,4 +1,3 @@ -/* $Xorg: omGeneric.c,v 1.6 2000/08/17 19:45:21 cpqbld Exp $ */ /* #define FONTDEBUG */ /* * Copyright 1992, 1993 by TOSHIBA Corp. @@ -32,7 +31,6 @@ * Modifier: Takanori Tateno FUJITSU LIMITED * */ -/* $XFree86: xc/lib/X11/omGeneric.c,v 3.27 2003/05/27 22:26:27 tsi Exp $ */ /* * Fixed the algorithms in parse_fontname() and parse_fontdata() diff --git a/nx-X11/lib/X11/omImText.c b/nx-X11/lib/X11/omImText.c index 627c45b83..1bc08bc25 100644 --- a/nx-X11/lib/X11/omImText.c +++ b/nx-X11/lib/X11/omImText.c @@ -1,4 +1,3 @@ -/* $Xorg: omImText.c,v 1.3 2000/08/17 19:45:22 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/omImText.c,v 1.5 2003/04/13 19:22:22 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/omText.c b/nx-X11/lib/X11/omText.c index 189aabd1e..676edde6e 100644 --- a/nx-X11/lib/X11/omText.c +++ b/nx-X11/lib/X11/omText.c @@ -1,4 +1,3 @@ -/* $Xorg: omText.c,v 1.3 2000/08/17 19:45:22 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/omText.c,v 1.9 2003/04/22 13:57:45 pascal Exp $ */ /* * Copyright 1995 by FUJITSU LIMITED * This is source code modified by FUJITSU LIMITED under the Joint diff --git a/nx-X11/lib/X11/omTextEsc.c b/nx-X11/lib/X11/omTextEsc.c index 03b76d9f1..a57ffb46a 100644 --- a/nx-X11/lib/X11/omTextEsc.c +++ b/nx-X11/lib/X11/omTextEsc.c @@ -1,4 +1,3 @@ -/* $Xorg: omTextEsc.c,v 1.3 2000/08/17 19:45:22 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/omTextEsc.c,v 1.6 2003/04/13 19:22:22 dawes Exp $ */ /* * Copyright 1995 by FUJITSU LIMITED * This is source code modified by FUJITSU LIMITED under the Joint diff --git a/nx-X11/lib/X11/omTextExt.c b/nx-X11/lib/X11/omTextExt.c index 4117e60f9..baeadf6b0 100644 --- a/nx-X11/lib/X11/omTextExt.c +++ b/nx-X11/lib/X11/omTextExt.c @@ -1,4 +1,3 @@ -/* $Xorg: omTextExt.c,v 1.3 2000/08/17 19:45:22 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/omTextExt.c,v 1.5 2003/04/13 19:22:22 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/omTextPer.c b/nx-X11/lib/X11/omTextPer.c index 17a186571..fb15847fa 100644 --- a/nx-X11/lib/X11/omTextPer.c +++ b/nx-X11/lib/X11/omTextPer.c @@ -1,4 +1,3 @@ -/* $Xorg: omTextPer.c,v 1.3 2000/08/17 19:45:22 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -23,7 +22,6 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/omTextPer.c,v 1.6 2003/04/13 19:22:22 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/omXChar.c b/nx-X11/lib/X11/omXChar.c index 5ddd03584..d25b98bf4 100644 --- a/nx-X11/lib/X11/omXChar.c +++ b/nx-X11/lib/X11/omXChar.c @@ -1,4 +1,3 @@ -/* $Xorg: omXChar.c,v 1.3 2000/08/17 19:45:23 cpqbld Exp $ */ /* * Copyright 1992, 1993 by TOSHIBA Corp. * @@ -34,7 +33,6 @@ /* * Modifiers: Jeff Walls, Paul Anderson (HEWLETT-PACKARD) */ -/* $XFree86: xc/lib/X11/omXChar.c,v 1.6tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/os2Stubs.c b/nx-X11/lib/X11/os2Stubs.c index 804d2e14e..d01b85b46 100644 --- a/nx-X11/lib/X11/os2Stubs.c +++ b/nx-X11/lib/X11/os2Stubs.c @@ -28,7 +28,6 @@ * */ -/* $XFree86: xc/lib/X11/os2Stubs.c,v 3.0 1996/05/13 06:37:17 dawes Exp $ */ /* A few OS/2 functions needed in the X11 lib. Mainly, the file path redirection * functions and the "optimized" select() for the clients */ diff --git a/nx-X11/lib/X11/poly.h b/nx-X11/lib/X11/poly.h index 0d82443c9..c75bb7d3a 100644 --- a/nx-X11/lib/X11/poly.h +++ b/nx-X11/lib/X11/poly.h @@ -1,4 +1,3 @@ -/* $Xorg: poly.h,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */ /************************************************************************ Copyright 1987, 1998 The Open Group diff --git a/nx-X11/lib/X11/udcInf.c b/nx-X11/lib/X11/udcInf.c index 43b1cb024..afe398cc7 100644 --- a/nx-X11/lib/X11/udcInf.c +++ b/nx-X11/lib/X11/udcInf.c @@ -1,4 +1,3 @@ -/* $Xorg: udcInf.c,v 1.7 2001/02/09 02:03:40 xorgcvs Exp $ */ /* Copyright 1996, 1998 The Open Group @@ -33,7 +32,6 @@ from The Open Group. * */ -/* $XFree86: xc/lib/X11/udcInf.c,v 1.6 2001/01/17 19:41:57 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/utf8WMProps.c b/nx-X11/lib/X11/utf8WMProps.c index 69366b6cb..fd2844d1d 100644 --- a/nx-X11/lib/X11/utf8WMProps.c +++ b/nx-X11/lib/X11/utf8WMProps.c @@ -48,7 +48,6 @@ from The Open Group. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/lib/X11/utf8WMProps.c,v 1.2 2001/12/14 19:54:11 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/utf8Wrap.c b/nx-X11/lib/X11/utf8Wrap.c index bde3f041c..679cd993e 100644 --- a/nx-X11/lib/X11/utf8Wrap.c +++ b/nx-X11/lib/X11/utf8Wrap.c @@ -72,7 +72,6 @@ from The Open Group. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/lib/X11/utf8Wrap.c,v 1.3 2001/12/14 19:54:11 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/util/makekeys.c b/nx-X11/lib/X11/util/makekeys.c index d2a7b4aef..6cbce0693 100644 --- a/nx-X11/lib/X11/util/makekeys.c +++ b/nx-X11/lib/X11/util/makekeys.c @@ -1,5 +1,3 @@ -/* $Xorg: makekeys.c,v 1.5 2001/02/09 02:03:40 $ */ -/* $XdotOrg: xc/lib/X11/util/makekeys.c,v 1.5 2005/07/03 07:00:56 daniels Exp $ */ /* Copyright 1990, 1998 The Open Group @@ -27,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: $ */ /* Constructs hash tables for XStringToKeysym and XKeysymToString. */ diff --git a/nx-X11/lib/X11/uvY.c b/nx-X11/lib/X11/uvY.c index c07fcfc39..c2451df65 100644 --- a/nx-X11/lib/X11/uvY.c +++ b/nx-X11/lib/X11/uvY.c @@ -1,4 +1,3 @@ -/* $Xorg: uvY.c,v 1.3 2000/08/17 19:45:23 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -35,7 +34,6 @@ * DOCUMENTATION * "TekColor Color Management System, System Implementor's Manual" */ -/* $XFree86: xc/lib/X11/uvY.c,v 1.3 2001/01/17 19:41:57 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/wcWrap.c b/nx-X11/lib/X11/wcWrap.c index a0314da7f..023a7829b 100644 --- a/nx-X11/lib/X11/wcWrap.c +++ b/nx-X11/lib/X11/wcWrap.c @@ -1,4 +1,3 @@ -/* $Xorg: wcWrap.c,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */ /* Copyright 1991, 1998 The Open Group @@ -51,7 +50,6 @@ from The Open Group. * * M. Collins OSF */ -/* $XFree86: xc/lib/X11/wcWrap.c,v 1.6 2001/12/14 19:54:11 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/X11/xyY.c b/nx-X11/lib/X11/xyY.c index ba0b06137..7a0436e4a 100644 --- a/nx-X11/lib/X11/xyY.c +++ b/nx-X11/lib/X11/xyY.c @@ -1,4 +1,3 @@ -/* $Xorg: xyY.c,v 1.3 2000/08/17 19:45:23 cpqbld Exp $ */ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. @@ -34,7 +33,6 @@ * DOCUMENTATION * "TekColor Color Management System, System Implementor's Manual" */ -/* $XFree86: xc/lib/X11/xyY.c,v 1.3 2001/01/17 19:41:57 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/XKBbells.h b/nx-X11/lib/xkbfile/XKBbells.h index 16a9275ea..a2fc9ede6 100644 --- a/nx-X11/lib/xkbfile/XKBbells.h +++ b/nx-X11/lib/xkbfile/XKBbells.h @@ -1,7 +1,6 @@ #ifndef _XKBBELLS_H_ #define _XKBBELLS_H_ 1 -/* $Xorg: XKBbells.h,v 1.3 2000/08/17 19:46:42 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/xkbfile/XKBconfig.h b/nx-X11/lib/xkbfile/XKBconfig.h index fbc6a600e..4816917c8 100644 --- a/nx-X11/lib/xkbfile/XKBconfig.h +++ b/nx-X11/lib/xkbfile/XKBconfig.h @@ -1,7 +1,6 @@ #ifndef _XKBCONFIG_H_ #define _XKBCONFIG_H_ 1 -/* $Xorg: XKBconfig.h,v 1.3 2000/08/17 19:46:42 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. @@ -27,7 +26,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/XKBconfig.h,v 3.5 2001/01/17 19:43:39 dawes Exp $ */ typedef struct _XkbConfigRtrn *XkbConfigRtrnPtr; diff --git a/nx-X11/lib/xkbfile/XKBfile.h b/nx-X11/lib/xkbfile/XKBfile.h index bbd7e6fcd..045193813 100644 --- a/nx-X11/lib/xkbfile/XKBfile.h +++ b/nx-X11/lib/xkbfile/XKBfile.h @@ -1,9 +1,7 @@ -/* $XFree86: xc/lib/xkbfile/XKBfile.h,v 3.6 2003/10/24 16:33:09 tsi Exp $ */ #ifndef _XKBFILE_H_ #define _XKBFILE_H_ 1 -/* $Xorg: XKBfile.h,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/xkbfile/XKBfileInt.h b/nx-X11/lib/xkbfile/XKBfileInt.h index f11c46a1c..2a58dcdfb 100644 --- a/nx-X11/lib/xkbfile/XKBfileInt.h +++ b/nx-X11/lib/xkbfile/XKBfileInt.h @@ -1,7 +1,6 @@ #ifndef _XKBFILEINT_H_ #define _XKBFILEINT_H_ 1 -/* $Xorg: XKBfileInt.h,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/xkbfile/XKBrules.h b/nx-X11/lib/xkbfile/XKBrules.h index 0d77ca323..59d11cd88 100644 --- a/nx-X11/lib/xkbfile/XKBrules.h +++ b/nx-X11/lib/xkbfile/XKBrules.h @@ -1,7 +1,6 @@ #ifndef _XKBRULES_H_ #define _XKBRULES_H_ 1 -/* $Xorg: XKBrules.h,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. @@ -27,7 +26,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/XKBrules.h,v 3.5 2002/11/26 01:43:25 dawes Exp $ */ /***====================================================================***/ diff --git a/nx-X11/lib/xkbfile/XKM.h b/nx-X11/lib/xkbfile/XKM.h index c6c9f5195..13dbed54c 100644 --- a/nx-X11/lib/xkbfile/XKM.h +++ b/nx-X11/lib/xkbfile/XKM.h @@ -1,4 +1,3 @@ -/* $Xorg: XKM.h,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/xkbfile/XKMformat.h b/nx-X11/lib/xkbfile/XKMformat.h index ced5ea21d..ed414a365 100644 --- a/nx-X11/lib/xkbfile/XKMformat.h +++ b/nx-X11/lib/xkbfile/XKMformat.h @@ -1,4 +1,3 @@ -/* $Xorg: XKMformat.h,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/xkbfile/cout.c b/nx-X11/lib/xkbfile/cout.c index 96b3ba411..eb97d1d73 100644 --- a/nx-X11/lib/xkbfile/cout.c +++ b/nx-X11/lib/xkbfile/cout.c @@ -1,4 +1,3 @@ -/* $Xorg: cout.c,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ - /* $XFree86: xc/lib/xkbfile/cout.c,v 3.8 2003/02/03 20:12:00 paulo Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/maprules.c b/nx-X11/lib/xkbfile/maprules.c index dd2f5bfb3..b5d3bcd8c 100644 --- a/nx-X11/lib/xkbfile/maprules.c +++ b/nx-X11/lib/xkbfile/maprules.c @@ -1,4 +1,3 @@ -/* $Xorg: maprules.c,v 1.4 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/maprules.c,v 3.17 2002/11/26 01:43:25 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/srvmisc.c b/nx-X11/lib/xkbfile/srvmisc.c index d228389d9..8d2e228ed 100644 --- a/nx-X11/lib/xkbfile/srvmisc.c +++ b/nx-X11/lib/xkbfile/srvmisc.c @@ -1,4 +1,3 @@ -/* $Xorg: srvmisc.c,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/srvmisc.c,v 3.4 2001/10/28 03:32:47 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/xkbatom.c b/nx-X11/lib/xkbfile/xkbatom.c index d023d5410..3669f6805 100644 --- a/nx-X11/lib/xkbfile/xkbatom.c +++ b/nx-X11/lib/xkbfile/xkbatom.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbatom.c,v 1.4 2001/02/09 02:04:05 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -71,7 +70,6 @@ SOFTWARE. THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbatom.c,v 3.8 2001/12/14 19:57:03 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/xkbbells.c b/nx-X11/lib/xkbfile/xkbbells.c index 8bf0885fe..944cefd9f 100644 --- a/nx-X11/lib/xkbfile/xkbbells.c +++ b/nx-X11/lib/xkbfile/xkbbells.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbbells.c,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/lib/xkbfile/xkbconfig.c b/nx-X11/lib/xkbfile/xkbconfig.c index 5ab067ae5..dce86bc15 100644 --- a/nx-X11/lib/xkbfile/xkbconfig.c +++ b/nx-X11/lib/xkbfile/xkbconfig.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbconfig.c,v 1.4 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbconfig.c,v 3.7 2001/11/30 12:11:51 eich Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/xkbdraw.c b/nx-X11/lib/xkbfile/xkbdraw.c index 865b2952e..42d8ff6cc 100644 --- a/nx-X11/lib/xkbfile/xkbdraw.c +++ b/nx-X11/lib/xkbfile/xkbdraw.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbdraw.c,v 1.3 2000/08/17 19:46:43 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbdraw.c,v 1.3 2001/07/29 05:01:13 tsi Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/xkberrs.c b/nx-X11/lib/xkbfile/xkberrs.c index 1b856bcaf..b14f36d03 100644 --- a/nx-X11/lib/xkbfile/xkberrs.c +++ b/nx-X11/lib/xkbfile/xkberrs.c @@ -1,4 +1,3 @@ -/* $Xorg: xkberrs.c,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkberrs.c,v 3.4 2001/07/29 05:01:13 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/xkbfile-def.cpp b/nx-X11/lib/xkbfile/xkbfile-def.cpp index 2351d6666..3e680a75e 100644 --- a/nx-X11/lib/xkbfile/xkbfile-def.cpp +++ b/nx-X11/lib/xkbfile/xkbfile-def.cpp @@ -94,4 +94,3 @@ EXPORTS _XkbKSCheckCase #endif -/* $XFree86: xc/lib/xkbfile/xkbfile-def.cpp,v 1.1 2003/10/15 21:18:50 herrb Exp $ */ diff --git a/nx-X11/lib/xkbfile/xkbmisc.c b/nx-X11/lib/xkbfile/xkbmisc.c index 0bb129f7f..38bbb8216 100644 --- a/nx-X11/lib/xkbfile/xkbmisc.c +++ b/nx-X11/lib/xkbfile/xkbmisc.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbmisc.c,v 1.4 2000/08/17 19:46:44 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbmisc.c,v 1.7 2003/07/16 02:31:10 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/xkbout.c b/nx-X11/lib/xkbfile/xkbout.c index 467b47631..3f52c8cf4 100644 --- a/nx-X11/lib/xkbfile/xkbout.c +++ b/nx-X11/lib/xkbfile/xkbout.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbout.c,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbout.c,v 3.9 2001/10/28 03:32:47 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/xkbtext.c b/nx-X11/lib/xkbfile/xkbtext.c index 2d5d0bdad..f3fcdd647 100644 --- a/nx-X11/lib/xkbfile/xkbtext.c +++ b/nx-X11/lib/xkbfile/xkbtext.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbtext.c,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbtext.c,v 3.11 2002/12/21 18:49:02 paulo Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/xkmout.c b/nx-X11/lib/xkbfile/xkmout.c index 7de4081af..10e1ad7a0 100644 --- a/nx-X11/lib/xkbfile/xkmout.c +++ b/nx-X11/lib/xkbfile/xkmout.c @@ -1,4 +1,3 @@ -/* $Xorg: xkmout.c,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkmout.c,v 1.5 2001/07/25 15:04:58 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include diff --git a/nx-X11/lib/xkbfile/xkmread.c b/nx-X11/lib/xkbfile/xkmread.c index 9518bc90f..1ceccc9bb 100644 --- a/nx-X11/lib/xkbfile/xkmread.c +++ b/nx-X11/lib/xkbfile/xkmread.c @@ -1,4 +1,3 @@ -/* $Xorg: xkmread.c,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ */ /************************************************************ Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkmread.c,v 1.6 2002/02/13 22:09:42 herrb Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/lib/xtrans/Xtrans.c b/nx-X11/lib/xtrans/Xtrans.c index 934335269..d665305bb 100644 --- a/nx-X11/lib/xtrans/Xtrans.c +++ b/nx-X11/lib/xtrans/Xtrans.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/lib/xtrans/Xtrans.c,v 1.6 2005/11/08 06:33:26 jkj Exp $ */ -/* $Xorg: Xtrans.c,v 1.4 2001/02/09 02:04:06 xorgcvs Exp $ */ /* Copyright 1993, 1994, 1998 The Open Group @@ -27,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/xtrans/Xtrans.c,v 3.33 2003/08/11 17:41:29 eich Exp $ */ /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * diff --git a/nx-X11/lib/xtrans/Xtrans.h b/nx-X11/lib/xtrans/Xtrans.h index f96e8862e..04f4138dd 100644 --- a/nx-X11/lib/xtrans/Xtrans.h +++ b/nx-X11/lib/xtrans/Xtrans.h @@ -1,4 +1,3 @@ -/* $Xorg: Xtrans.h,v 1.4 2001/02/09 02:04:06 xorgcvs Exp $ */ /* Copyright 1993, 1994, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/xtrans/Xtrans.h,v 3.21 2003/07/20 16:12:15 tsi Exp $ */ /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * diff --git a/nx-X11/lib/xtrans/Xtransdnet.c b/nx-X11/lib/xtrans/Xtransdnet.c index 00a086277..a4abf42a4 100644 --- a/nx-X11/lib/xtrans/Xtransdnet.c +++ b/nx-X11/lib/xtrans/Xtransdnet.c @@ -1,4 +1,3 @@ -/* $Xorg: Xtransdnet.c,v 1.4 2001/02/09 02:04:06 xorgcvs Exp $ */ /* Copyright 1993, 1994, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/xtrans/Xtransdnet.c,v 3.7tsi Exp $ */ /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * diff --git a/nx-X11/lib/xtrans/Xtransint.h b/nx-X11/lib/xtrans/Xtransint.h index 60d3a9e60..196eb6fc6 100644 --- a/nx-X11/lib/xtrans/Xtransint.h +++ b/nx-X11/lib/xtrans/Xtransint.h @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/lib/xtrans/Xtransint.h,v 1.4 2005/11/08 06:33:26 jkj Exp $ */ -/* $Xorg: Xtransint.h,v 1.4 2001/02/09 02:04:06 xorgcvs Exp $ */ /* Copyright 1993, 1994, 1998 The Open Group @@ -27,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/xtrans/Xtransint.h,v 3.41 2003/08/28 00:35:23 tsi Exp $ */ /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * diff --git a/nx-X11/lib/xtrans/Xtranslcl.c b/nx-X11/lib/xtrans/Xtranslcl.c index 52e845124..f504338aa 100644 --- a/nx-X11/lib/xtrans/Xtranslcl.c +++ b/nx-X11/lib/xtrans/Xtranslcl.c @@ -1,4 +1,3 @@ -/* $Xorg: Xtranslcl.c,v 1.6 2001/02/09 02:04:06 xorgcvs Exp $ */ /* Copyright 1993, 1994, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/xtrans/Xtranslcl.c,v 3.40tsi Exp $ */ /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * diff --git a/nx-X11/lib/xtrans/Xtransos2.c b/nx-X11/lib/xtrans/Xtransos2.c index 1380403da..6d9dcb675 100644 --- a/nx-X11/lib/xtrans/Xtransos2.c +++ b/nx-X11/lib/xtrans/Xtransos2.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/lib/xtrans/Xtransos2.c,v 3.9tsi Exp $ */ /* * (c) Copyright 1996 by Sebastien Marineau and Holger Veit diff --git a/nx-X11/lib/xtrans/Xtranstli.c b/nx-X11/lib/xtrans/Xtranstli.c index cab8da79f..839498658 100644 --- a/nx-X11/lib/xtrans/Xtranstli.c +++ b/nx-X11/lib/xtrans/Xtranstli.c @@ -1,4 +1,3 @@ -/* $Xorg: Xtranstli.c,v 1.4 2001/02/09 02:04:07 xorgcvs Exp $ */ /* Copyright 1993, 1994, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/xtrans/Xtranstli.c,v 3.12tsi Exp $ */ /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * diff --git a/nx-X11/lib/xtrans/Xtransutil.c b/nx-X11/lib/xtrans/Xtransutil.c index cfe925edf..03bbce188 100644 --- a/nx-X11/lib/xtrans/Xtransutil.c +++ b/nx-X11/lib/xtrans/Xtransutil.c @@ -1,4 +1,3 @@ -/* $Xorg: Xtransutil.c,v 1.4 2001/02/09 02:04:07 xorgcvs Exp $ */ /* Copyright 1993, 1994, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/xtrans/Xtransutil.c,v 3.26 2003/07/09 15:27:30 tsi Exp $ */ /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * diff --git a/nx-X11/lib/xtrans/transport.c b/nx-X11/lib/xtrans/transport.c index 36de15e34..e1a8b45ec 100644 --- a/nx-X11/lib/xtrans/transport.c +++ b/nx-X11/lib/xtrans/transport.c @@ -1,4 +1,3 @@ -/* $Xorg: transport.c,v 1.4 2001/02/09 02:04:07 xorgcvs Exp $ */ /* Copyright 1993, 1994, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/xtrans/transport.c,v 3.9 2002/05/31 18:45:51 dawes Exp $ */ /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * diff --git a/nx-X11/programs/Xserver/GL/glx/g_disptab.c b/nx-X11/programs/Xserver/GL/glx/g_disptab.c index 93a9d628d..533bc6c9d 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_disptab.c +++ b/nx-X11/programs/Xserver/GL/glx/g_disptab.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.c,v 1.5 2004/01/28 18:11:50 alanh Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ /* ** License Applicability. Except to the extent portions of this file are diff --git a/nx-X11/programs/Xserver/GL/glx/g_disptab.h b/nx-X11/programs/Xserver/GL/glx/g_disptab.h index 0580b5529..85906cb43 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_disptab.h +++ b/nx-X11/programs/Xserver/GL/glx/g_disptab.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab.h,v 1.4 2003/09/28 20:15:42 alanh Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c b/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c index d837c64d9..754e9854d 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c +++ b/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.c,v 1.5 2004/01/28 18:11:50 alanh Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ /* ** License Applicability. Except to the extent portions of this file are diff --git a/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h b/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h index 3def7f1c5..3c1872f09 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h +++ b/nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_disptab_EXT.h,v 1.5 2004/01/28 18:11:50 alanh Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/GL/glx/g_render.c b/nx-X11/programs/Xserver/GL/glx/g_render.c index 8ef9f693c..ae3416bed 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_render.c +++ b/nx-X11/programs/Xserver/GL/glx/g_render.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_render.c,v 1.8 2004/02/03 21:34:36 alanh Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ /* ** License Applicability. Except to the extent portions of this file are diff --git a/nx-X11/programs/Xserver/GL/glx/g_renderswap.c b/nx-X11/programs/Xserver/GL/glx/g_renderswap.c index 6964ecd55..38b1497f1 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_renderswap.c +++ b/nx-X11/programs/Xserver/GL/glx/g_renderswap.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_renderswap.c,v 1.8 2004/01/28 18:11:50 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/g_single.c b/nx-X11/programs/Xserver/GL/glx/g_single.c index 65d79a9bc..486ae7a25 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_single.c +++ b/nx-X11/programs/Xserver/GL/glx/g_single.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_single.c,v 1.5tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/g_singleswap.c b/nx-X11/programs/Xserver/GL/glx/g_singleswap.c index 48a5fc9f6..7ec32dd96 100644 --- a/nx-X11/programs/Xserver/GL/glx/g_singleswap.c +++ b/nx-X11/programs/Xserver/GL/glx/g_singleswap.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/g_singleswap.c,v 1.4tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxbuf.c b/nx-X11/programs/Xserver/GL/glx/glxbuf.c index 44be53614..047bc569e 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxbuf.c +++ b/nx-X11/programs/Xserver/GL/glx/glxbuf.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxbuf.c,v 1.6 2001/03/25 05:32:01 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index 3def7b333..1145186e7 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxcmds.c,v 1.12 2004/01/28 18:11:50 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c index dbdbb667e..092a14e66 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxcmdsswap.c,v 1.10 2004/01/28 18:11:50 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxcontext.h b/nx-X11/programs/Xserver/GL/glx/glxcontext.h index 18d8b44c2..25f8daf44 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcontext.h +++ b/nx-X11/programs/Xserver/GL/glx/glxcontext.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxcontext.h,v 1.4 2002/02/22 21:45:07 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxdrawable.h b/nx-X11/programs/Xserver/GL/glx/glxdrawable.h index 38a05bfeb..a7c975a44 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxdrawable.h +++ b/nx-X11/programs/Xserver/GL/glx/glxdrawable.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxdrawable.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.h b/nx-X11/programs/Xserver/GL/glx/glxext.h index 5d569899f..edb65a5f3 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxext.h +++ b/nx-X11/programs/Xserver/GL/glx/glxext.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxext.h,v 1.7 2003/11/17 22:20:26 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.c b/nx-X11/programs/Xserver/GL/glx/glximports.c index f966ca4df..fa930cf5b 100644 --- a/nx-X11/programs/Xserver/GL/glx/glximports.c +++ b/nx-X11/programs/Xserver/GL/glx/glximports.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glximports.c,v 1.5 2001/03/21 16:29:36 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.h b/nx-X11/programs/Xserver/GL/glx/glximports.h index ef485822e..f57004b34 100644 --- a/nx-X11/programs/Xserver/GL/glx/glximports.h +++ b/nx-X11/programs/Xserver/GL/glx/glximports.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glximports.h,v 1.3 2001/03/21 16:29:36 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxmem.c b/nx-X11/programs/Xserver/GL/glx/glxmem.c index 21a7c7962..e1487da94 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxmem.c +++ b/nx-X11/programs/Xserver/GL/glx/glxmem.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxmem.c,v 1.6 2001/10/31 22:50:27 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxpix.c b/nx-X11/programs/Xserver/GL/glx/glxpix.c index 98c033c98..e1628efc0 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxpix.c +++ b/nx-X11/programs/Xserver/GL/glx/glxpix.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxpix.c,v 1.3 2000/09/26 15:57:02 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxscreens.c b/nx-X11/programs/Xserver/GL/glx/glxscreens.c index 1cbc0baf7..88833e154 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxscreens.c +++ b/nx-X11/programs/Xserver/GL/glx/glxscreens.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.c,v 1.14 2004/02/09 23:46:31 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxscreens.h b/nx-X11/programs/Xserver/GL/glx/glxscreens.h index 2d68c8b60..dae21e9c9 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxscreens.h +++ b/nx-X11/programs/Xserver/GL/glx/glxscreens.h @@ -5,7 +5,6 @@ #ifndef _GLX_screens_h_ #define _GLX_screens_h_ -/* $XFree86: xc/programs/Xserver/GL/glx/glxscreens.h,v 1.4 2001/03/21 16:29:37 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxserver.h b/nx-X11/programs/Xserver/GL/glx/glxserver.h index a04d361fd..a991f907e 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxserver.h +++ b/nx-X11/programs/Xserver/GL/glx/glxserver.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxserver.h,v 1.5 2003/09/28 20:15:43 alanh Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c index f7564a0ff..b8d4874aa 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxutil.c +++ b/nx-X11/programs/Xserver/GL/glx/glxutil.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxutil.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.h b/nx-X11/programs/Xserver/GL/glx/glxutil.h index 2c3090a46..7231c949f 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxutil.h +++ b/nx-X11/programs/Xserver/GL/glx/glxutil.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxutil.h,v 1.3 2001/03/21 16:29:37 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/impsize.h b/nx-X11/programs/Xserver/GL/glx/impsize.h index 0eaebb6d5..53777c6e3 100644 --- a/nx-X11/programs/Xserver/GL/glx/impsize.h +++ b/nx-X11/programs/Xserver/GL/glx/impsize.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/impsize.h,v 1.4 2003/09/28 20:15:43 alanh Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/render2.c b/nx-X11/programs/Xserver/GL/glx/render2.c index 95b1a9ab7..1336e2591 100644 --- a/nx-X11/programs/Xserver/GL/glx/render2.c +++ b/nx-X11/programs/Xserver/GL/glx/render2.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.8 2004/02/03 23:04:08 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/render2swap.c b/nx-X11/programs/Xserver/GL/glx/render2swap.c index 605ffd0c6..ea35d514d 100644 --- a/nx-X11/programs/Xserver/GL/glx/render2swap.c +++ b/nx-X11/programs/Xserver/GL/glx/render2swap.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/render2swap.c,v 1.6 2002/01/14 22:47:08 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/rensize.c b/nx-X11/programs/Xserver/GL/glx/rensize.c index dc3475e7f..d3a819cd5 100644 --- a/nx-X11/programs/Xserver/GL/glx/rensize.c +++ b/nx-X11/programs/Xserver/GL/glx/rensize.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/rensize.c,v 1.6 2003/09/28 20:15:43 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/rensizetab.c b/nx-X11/programs/Xserver/GL/glx/rensizetab.c index 41656890c..9d5abe844 100644 --- a/nx-X11/programs/Xserver/GL/glx/rensizetab.c +++ b/nx-X11/programs/Xserver/GL/glx/rensizetab.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/rensizetab.c,v 1.5 2004/01/28 18:11:53 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/single2.c b/nx-X11/programs/Xserver/GL/glx/single2.c index bd7283a95..d6d689935 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2.c +++ b/nx-X11/programs/Xserver/GL/glx/single2.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/single2.c,v 1.8 2004/02/10 22:54:15 alanh Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/single2swap.c b/nx-X11/programs/Xserver/GL/glx/single2swap.c index 7d33dd63d..ca8ac2a85 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2swap.c +++ b/nx-X11/programs/Xserver/GL/glx/single2swap.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/single2swap.c,v 1.7 2002/01/14 22:47:08 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/singlepixswap.c b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c index c5d53c06e..f029fd602 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlepixswap.c +++ b/nx-X11/programs/Xserver/GL/glx/singlepixswap.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/singlepixswap.c,v 1.5 2001/03/21 16:29:37 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/singlesize.c b/nx-X11/programs/Xserver/GL/glx/singlesize.c index 7ed5fe3ef..6d77f8be9 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlesize.c +++ b/nx-X11/programs/Xserver/GL/glx/singlesize.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/singlesize.c,v 1.7tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/unpack.h b/nx-X11/programs/Xserver/GL/glx/unpack.h index 154b4d286..7d84ff575 100644 --- a/nx-X11/programs/Xserver/GL/glx/unpack.h +++ b/nx-X11/programs/Xserver/GL/glx/unpack.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/unpack.h,v 1.4 2002/01/14 22:47:08 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glxmodule.c b/nx-X11/programs/Xserver/GL/glxmodule.c index f0cce1a3f..8e6e0dfd3 100644 --- a/nx-X11/programs/Xserver/GL/glxmodule.c +++ b/nx-X11/programs/Xserver/GL/glxmodule.c @@ -24,7 +24,6 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/GL/glxmodule.c,v 1.11 2001/06/15 21:22:38 dawes Exp $ */ /* * Authors: diff --git a/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h b/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h index c94393fd1..c4e9c01e9 100644 --- a/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h +++ b/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h @@ -5,7 +5,6 @@ #ifndef _glx_ansic_h_ #define _glx_ansic_h_ -/* $XFree86: xc/programs/Xserver/GL/include/GL/glx_ansic.h,v 1.5 2001/03/21 20:49:08 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h index 66f096a98..8a4472874 100644 --- a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h +++ b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/include/GL/xf86glx.h,v 1.3 1999/06/14 07:31:41 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp index 6fca465cd..206ce85fb 100644 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp +++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp @@ -1459,4 +1459,3 @@ xmesa_get_line_func xmesa_get_points_func xmesa_get_triangle_func -/* $XFree86: xc/programs/Xserver/GL/mesa/src/GLcore-def.cpp,v 1.1 2000/08/10 17:40:29 dawes Exp $ */ diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c index e0bbd193d..34eb4d673 100644 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c +++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/mesa/src/GLcoremodule.c,v 1.5 2000/02/23 04:46:55 martin Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c index 6ec2164ba..0d7496a0e 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v 1.19 2003/07/16 01:38:27 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c index 057acb6d3..976818f07 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx_util.c,v 1.5 2000/03/02 16:07:39 martin Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h index 809c1550f..bb314128d 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx_util.h,v 1.5 2000/08/10 17:40:29 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h b/nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h index 974ff0364..4784566a4 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glxint.h,v 1.4 2002/02/22 21:45:08 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/nx-X11/programs/Xserver/Xext/bigreq.c b/nx-X11/programs/Xserver/Xext/bigreq.c index 67973ab20..00e67c058 100644 --- a/nx-X11/programs/Xserver/Xext/bigreq.c +++ b/nx-X11/programs/Xserver/Xext/bigreq.c @@ -1,4 +1,3 @@ -/* $Xorg: bigreq.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */ /* Copyright 1992, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xext/bigreq.c,v 3.8 2003/10/28 23:08:43 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/dpms.c b/nx-X11/programs/Xserver/Xext/dpms.c index 4d3acf03a..3f75918ad 100644 --- a/nx-X11/programs/Xserver/Xext/dpms.c +++ b/nx-X11/programs/Xserver/Xext/dpms.c @@ -1,4 +1,3 @@ -/* $Xorg: dpms.c,v 1.3 2000/08/17 19:47:56 cpqbld Exp $ */ /***************************************************************** Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts. @@ -33,7 +32,6 @@ Equipment Corporation. * @(#)RCSfile: dpms.c,v Revision: 1.1.4.5 (DEC) Date: 1996/03/04 15:27:00 */ -/* $XFree86: xc/programs/Xserver/Xext/dpms.c,v 3.10tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/dpmsproc.h b/nx-X11/programs/Xserver/Xext/dpmsproc.h index ae1e6e25a..f5485ea79 100644 --- a/nx-X11/programs/Xserver/Xext/dpmsproc.h +++ b/nx-X11/programs/Xserver/Xext/dpmsproc.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/dpmsproc.h,v 1.3 2001/10/28 03:32:50 tsi Exp $ */ /* Prototypes for functions that the DDX must provide */ diff --git a/nx-X11/programs/Xserver/Xext/dpmsstubs.c b/nx-X11/programs/Xserver/Xext/dpmsstubs.c index 128c57bb0..9f99a2d22 100644 --- a/nx-X11/programs/Xserver/Xext/dpmsstubs.c +++ b/nx-X11/programs/Xserver/Xext/dpmsstubs.c @@ -1,4 +1,3 @@ -/* $Xorg: dpmsstubs.c,v 1.3 2000/08/17 19:47:56 cpqbld Exp $ */ /***************************************************************** Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts. @@ -26,7 +25,6 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/dpmsstubs.c,v 3.4 2001/01/17 22:13:15 dawes Exp $ */ typedef int Bool; diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.c b/nx-X11/programs/Xserver/Xext/extmod/modinit.c index 5224a8ad9..7b5530973 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/modinit.c +++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.16 2002/03/06 21:12:33 mvojkovi Exp $ */ /* * diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.h b/nx-X11/programs/Xserver/Xext/extmod/modinit.h index 5242a3f1b..96ba2da48 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/modinit.h +++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.h @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/extmod/modinit.h,v 1.5 2005/07/03 07:01:06 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.h,v 1.1 2003/07/16 01:38:33 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index 3b89f36d6..206fa5406 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -1,4 +1,3 @@ -/* $Xorg: panoramiX.c,v 1.5 2000/08/17 19:47:57 cpqbld Exp $ */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. Permission is hereby granted, free of charge, to any person obtaining a copy @@ -23,7 +22,6 @@ shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/panoramiX.c,v 3.37tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.h b/nx-X11/programs/Xserver/Xext/panoramiX.h index 8113e3072..210ba2751 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.h +++ b/nx-X11/programs/Xserver/Xext/panoramiX.h @@ -1,5 +1,4 @@ /* $TOG: panoramiX.h /main/4 1998/03/17 06:51:02 kaleb $ */ -/* $XdotOrg: xc/programs/Xserver/Xext/panoramiX.h,v 1.5 2005/07/03 07:01:04 daniels Exp $ */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. @@ -28,7 +27,6 @@ Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/panoramiX.h,v 1.5 2001/01/03 02:54:17 keithp Exp $ */ /* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ diff --git a/nx-X11/programs/Xserver/Xext/panoramiXSwap.c b/nx-X11/programs/Xserver/Xext/panoramiXSwap.c index 5ea3bf3a6..218d83d72 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXSwap.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXSwap.c @@ -1,4 +1,3 @@ -/* $Xorg: panoramiXSwap.c,v 1.4 2000/08/17 19:47:57 cpqbld Exp $ */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. Permission is hereby granted, free of charge, to any person obtaining a copy @@ -23,7 +22,6 @@ shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/panoramiXSwap.c,v 3.9 2003/07/16 01:38:29 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/panoramiXh.h b/nx-X11/programs/Xserver/Xext/panoramiXh.h index 9da5876fd..6cee650ac 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXh.h +++ b/nx-X11/programs/Xserver/Xext/panoramiXh.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/panoramiXh.h,v 1.2 2003/09/13 21:33:03 dawes Exp $ */ /* * Server dispatcher function replacements diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c index 563c97a0d..9da3328f8 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c @@ -1,4 +1,3 @@ -/* $Xorg: panoramiXprocs.c,v 1.5 2000/08/17 19:47:57 cpqbld Exp $ */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. Permission is hereby granted, free of charge, to any person obtaining a copy @@ -26,7 +25,6 @@ Equipment Corporation. /* Massively rewritten by Mark Vojkovich */ -/* $XFree86: xc/programs/Xserver/Xext/panoramiXprocs.c,v 3.36tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/panoramiXsrv.h b/nx-X11/programs/Xserver/Xext/panoramiXsrv.h index 8fa2d3d05..91c41b4e3 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXsrv.h +++ b/nx-X11/programs/Xserver/Xext/panoramiXsrv.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/panoramiXsrv.h,v 1.8 2001/08/01 00:44:44 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 0b4a467db..da94847a5 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -1,4 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/saver.c,v 1.10 2005/07/03 08:53:36 daniels Exp $ */ /* * $XConsortium: saver.c,v 1.12 94/04/17 20:59:36 dpw Exp $ * @@ -28,7 +27,6 @@ in this Software without prior written authorization from the X Consortium. * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/Xext/saver.c,v 3.7 2003/10/28 23:08:43 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index 61a9eb9bf..165bee50c 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/shape.c,v 1.9 2005/07/03 08:53:36 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.18 2003/10/28 23:08:43 tsi Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -26,7 +24,6 @@ in this Software without prior written authorization from The Open Group. ********************************************************/ -/* $Xorg: shape.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index 323d3dbfb..a91afdaf0 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.41 2003/12/17 23:28:56 alanh Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -27,7 +26,6 @@ in this Software without prior written authorization from The Open Group. /* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ -/* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ #define SHM diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.c b/nx-X11/programs/Xserver/Xext/sleepuntil.c index 93d75a862..1934828d4 100644 --- a/nx-X11/programs/Xserver/Xext/sleepuntil.c +++ b/nx-X11/programs/Xserver/Xext/sleepuntil.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.c,v 3.6 2003/07/16 01:38:30 dawes Exp $ */ /* dixsleep.c - implement millisecond timeouts for X clients */ diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.h b/nx-X11/programs/Xserver/Xext/sleepuntil.h index e828a7c8f..c9c0f1478 100644 --- a/nx-X11/programs/Xserver/Xext/sleepuntil.h +++ b/nx-X11/programs/Xserver/Xext/sleepuntil.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.h,v 1.2 2003/11/17 22:20:27 dawes Exp $ */ /* * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved. * diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 12cb0a6ab..945dec250 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -1,4 +1,3 @@ -/* $Xorg: sync.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /* Copyright 1991, 1993, 1998 The Open Group @@ -50,7 +49,6 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/Xext/sync.c,v 3.13 2003/09/02 18:19:01 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c index 48117aaf8..68843fd04 100644 --- a/nx-X11/programs/Xserver/Xext/xcmisc.c +++ b/nx-X11/programs/Xserver/Xext/xcmisc.c @@ -1,4 +1,3 @@ -/* $Xorg: xcmisc.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /* Copyright 1993, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xext/xcmisc.c,v 3.7 2003/10/28 23:08:43 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index 023b3e6a5..253706ad2 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.17 2003/10/28 23:08:43 tsi Exp $ */ /* * BIGFONT extension for sharing font metrics between clients (if possible) * and for transmitting font metrics to clients in a compressed form. diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c index c4b3a1818..243de9c39 100644 --- a/nx-X11/programs/Xserver/Xext/xres.c +++ b/nx-X11/programs/Xserver/Xext/xres.c @@ -1,8 +1,6 @@ /* Copyright (c) 2002 XFree86 Inc */ -/* $XFree86: xc/programs/Xserver/Xext/xres.c,v 1.7tsi Exp $ */ -/* $XdotOrg: xc/programs/Xserver/Xext/xres.c,v 1.7 2005/07/03 08:53:36 daniels Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/xtest.c b/nx-X11/programs/Xserver/Xext/xtest.c index ed3d8ef8d..6cd7d1111 100644 --- a/nx-X11/programs/Xserver/Xext/xtest.c +++ b/nx-X11/programs/Xserver/Xext/xtest.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/xtest.c,v 1.6 2005/07/03 08:53:36 daniels Exp $ */ -/* $Xorg: xtest.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /* Copyright 1992, 1998 The Open Group @@ -27,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xext/xtest.c,v 3.10 2003/10/28 23:08:44 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/xtest1dd.c b/nx-X11/programs/Xserver/Xext/xtest1dd.c index 35cffeb07..e3a7aa07e 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1dd.c +++ b/nx-X11/programs/Xserver/Xext/xtest1dd.c @@ -1,4 +1,3 @@ -/* $Xorg: xtest1dd.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /* * File: xtest1dd.c * @@ -52,7 +51,6 @@ Telephone and Telegraph Company or of the Regents of the University of California. */ -/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.c,v 3.6 2003/10/28 23:08:44 tsi Exp $ */ /*************************************************************** * include files diff --git a/nx-X11/programs/Xserver/Xext/xtest1dd.h b/nx-X11/programs/Xserver/Xext/xtest1dd.h index 3130c7075..5a3ee1781 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1dd.h +++ b/nx-X11/programs/Xserver/Xext/xtest1dd.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.h,v 3.2 2001/08/01 00:44:44 tsi Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xext/xtest1di.c b/nx-X11/programs/Xserver/Xext/xtest1di.c index e97c7da69..ac49ba2a3 100644 --- a/nx-X11/programs/Xserver/Xext/xtest1di.c +++ b/nx-X11/programs/Xserver/Xext/xtest1di.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/xtest1di.c,v 1.6 2005/07/03 08:53:36 daniels Exp $ */ -/* $Xorg: xtest1di.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /* * File: xtest1di.c * @@ -53,7 +51,6 @@ Telephone and Telegraph Company or of the Regents of the University of California. */ -/* $XFree86: xc/programs/Xserver/Xext/xtest1di.c,v 3.5 2003/09/13 21:33:03 dawes Exp $ */ /***************************************************************************** * include files diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c index 66dcc791a..88536b70e 100644 --- a/nx-X11/programs/Xserver/Xext/xvdisp.c +++ b/nx-X11/programs/Xserver/Xext/xvdisp.c @@ -1,4 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/xvdisp.c,v 1.6 2005/07/03 08:53:36 daniels Exp $ */ /*********************************************************** Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, and the Massachusetts Institute of Technology, Cambridge, Massachusetts. @@ -22,7 +21,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.27 2003/07/16 01:38:31 dawes Exp $ */ /* ** File: diff --git a/nx-X11/programs/Xserver/Xext/xvdix.h b/nx-X11/programs/Xserver/Xext/xvdix.h index 6e6e07302..4e8fbb507 100644 --- a/nx-X11/programs/Xserver/Xext/xvdix.h +++ b/nx-X11/programs/Xserver/Xext/xvdix.h @@ -21,7 +21,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvdix.h,v 1.7 2001/05/07 21:37:51 tsi Exp $ */ #ifndef XVDIX_H #define XVDIX_H diff --git a/nx-X11/programs/Xserver/Xext/xvmain.c b/nx-X11/programs/Xserver/Xext/xvmain.c index 8a279ac1e..b233299af 100644 --- a/nx-X11/programs/Xserver/Xext/xvmain.c +++ b/nx-X11/programs/Xserver/Xext/xvmain.c @@ -1,4 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/Xext/xvmain.c,v 1.6 2005/07/03 08:53:36 daniels Exp $ */ /*********************************************************** Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, and the Massachusetts Institute of Technology, Cambridge, Massachusetts. @@ -22,7 +21,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvmain.c,v 1.15tsi Exp $ */ /* ** File: diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c index 219359331..0d4849b85 100644 --- a/nx-X11/programs/Xserver/Xext/xvmc.c +++ b/nx-X11/programs/Xserver/Xext/xvmc.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/xvmc.c,v 1.8 2003/07/16 01:38:31 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/xvmcext.h b/nx-X11/programs/Xserver/Xext/xvmcext.h index b92a53225..c1826b44c 100644 --- a/nx-X11/programs/Xserver/Xext/xvmcext.h +++ b/nx-X11/programs/Xserver/Xext/xvmcext.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/xvmcext.h,v 1.1 2001/04/07 11:04:21 alanh Exp $ */ #ifndef _XVMC_H #define _XVMC_H diff --git a/nx-X11/programs/Xserver/Xext/xvmod.c b/nx-X11/programs/Xserver/Xext/xvmod.c index 258023f65..469bd950d 100644 --- a/nx-X11/programs/Xserver/Xext/xvmod.c +++ b/nx-X11/programs/Xserver/Xext/xvmod.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/xvmod.c,v 1.1 1998/08/13 14:45:36 dawes Exp $ */ #ifdef HAVE_XORG_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xext/xvmodproc.h b/nx-X11/programs/Xserver/Xext/xvmodproc.h index b284e3f4e..81356a149 100644 --- a/nx-X11/programs/Xserver/Xext/xvmodproc.h +++ b/nx-X11/programs/Xserver/Xext/xvmodproc.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xext/xvmodproc.h,v 1.2 2001/03/05 04:51:55 mvojkovi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/Xi/allowev.c b/nx-X11/programs/Xserver/Xi/allowev.c index 86e813eee..a814e3c3d 100644 --- a/nx-X11/programs/Xserver/Xi/allowev.c +++ b/nx-X11/programs/Xserver/Xi/allowev.c @@ -1,4 +1,3 @@ -/* $Xorg: allowev.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/allowev.c,v 3.3 2001/01/17 22:13:23 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/allowev.h b/nx-X11/programs/Xserver/Xi/allowev.h index 2d1132d3a..5315667df 100644 --- a/nx-X11/programs/Xserver/Xi/allowev.h +++ b/nx-X11/programs/Xserver/Xi/allowev.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/allowev.h,v 3.1 1996/04/15 11:18:23 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/chgdctl.c b/nx-X11/programs/Xserver/Xi/chgdctl.c index 136e3f700..b07885f9c 100644 --- a/nx-X11/programs/Xserver/Xi/chgdctl.c +++ b/nx-X11/programs/Xserver/Xi/chgdctl.c @@ -1,4 +1,3 @@ -/* $Xorg: chgdctl.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/chgdctl.c,v 3.3 2001/01/17 22:13:23 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/chgdctl.h b/nx-X11/programs/Xserver/Xi/chgdctl.h index a6a530f37..1d1a6214d 100644 --- a/nx-X11/programs/Xserver/Xi/chgdctl.h +++ b/nx-X11/programs/Xserver/Xi/chgdctl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgdctl.h,v 3.1 1996/04/15 11:18:25 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/chgfctl.c b/nx-X11/programs/Xserver/Xi/chgfctl.c index 103e7912c..341c794ce 100644 --- a/nx-X11/programs/Xserver/Xi/chgfctl.c +++ b/nx-X11/programs/Xserver/Xi/chgfctl.c @@ -1,4 +1,3 @@ -/* $Xorg: chgfctl.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/chgfctl.c,v 3.3 2001/01/17 22:13:23 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/chgfctl.h b/nx-X11/programs/Xserver/Xi/chgfctl.h index 94dab2814..ffcb3be8a 100644 --- a/nx-X11/programs/Xserver/Xi/chgfctl.h +++ b/nx-X11/programs/Xserver/Xi/chgfctl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgfctl.h,v 3.1 1996/04/15 11:18:26 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/chgkbd.c b/nx-X11/programs/Xserver/Xi/chgkbd.c index 94b19122d..1d45023cf 100644 --- a/nx-X11/programs/Xserver/Xi/chgkbd.c +++ b/nx-X11/programs/Xserver/Xi/chgkbd.c @@ -1,4 +1,3 @@ -/* $Xorg: chgkbd.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/chgkbd.c,v 3.5 2001/08/23 14:56:19 alanh Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/chgkbd.h b/nx-X11/programs/Xserver/Xi/chgkbd.h index ddb17e3c4..b7ed198f7 100644 --- a/nx-X11/programs/Xserver/Xi/chgkbd.h +++ b/nx-X11/programs/Xserver/Xi/chgkbd.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgkbd.h,v 3.1 1996/04/15 11:18:27 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/chgkmap.c b/nx-X11/programs/Xserver/Xi/chgkmap.c index 20e7f09e1..8d5199848 100644 --- a/nx-X11/programs/Xserver/Xi/chgkmap.c +++ b/nx-X11/programs/Xserver/Xi/chgkmap.c @@ -1,4 +1,3 @@ -/* $Xorg: chgkmap.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/chgkmap.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/chgkmap.h b/nx-X11/programs/Xserver/Xi/chgkmap.h index 5e65a5b36..22cab11ba 100644 --- a/nx-X11/programs/Xserver/Xi/chgkmap.h +++ b/nx-X11/programs/Xserver/Xi/chgkmap.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgkmap.h,v 3.1 1996/04/15 11:18:28 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/chgprop.c b/nx-X11/programs/Xserver/Xi/chgprop.c index 413149cf1..80b8aea5f 100644 --- a/nx-X11/programs/Xserver/Xi/chgprop.c +++ b/nx-X11/programs/Xserver/Xi/chgprop.c @@ -1,4 +1,3 @@ -/* $Xorg: chgprop.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/chgprop.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/chgprop.h b/nx-X11/programs/Xserver/Xi/chgprop.h index 7395bc25c..19d091c10 100644 --- a/nx-X11/programs/Xserver/Xi/chgprop.h +++ b/nx-X11/programs/Xserver/Xi/chgprop.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgprop.h,v 3.1 1996/04/15 11:18:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/chgptr.c b/nx-X11/programs/Xserver/Xi/chgptr.c index 76b0a1193..7fef2a104 100644 --- a/nx-X11/programs/Xserver/Xi/chgptr.c +++ b/nx-X11/programs/Xserver/Xi/chgptr.c @@ -1,4 +1,3 @@ -/* $Xorg: chgptr.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/chgptr.c,v 3.6 2001/08/23 14:56:19 alanh Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/chgptr.h b/nx-X11/programs/Xserver/Xi/chgptr.h index 5b85da13f..f63d96876 100644 --- a/nx-X11/programs/Xserver/Xi/chgptr.h +++ b/nx-X11/programs/Xserver/Xi/chgptr.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/chgptr.h,v 3.1 1996/04/15 11:18:31 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/closedev.c b/nx-X11/programs/Xserver/Xi/closedev.c index 7ab9ed3c9..2ba90d0d1 100644 --- a/nx-X11/programs/Xserver/Xi/closedev.c +++ b/nx-X11/programs/Xserver/Xi/closedev.c @@ -1,4 +1,3 @@ -/* $Xorg: closedev.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/closedev.c,v 3.3 2001/08/23 14:56:19 alanh Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/closedev.h b/nx-X11/programs/Xserver/Xi/closedev.h index e4869c96c..61e42e2f0 100644 --- a/nx-X11/programs/Xserver/Xi/closedev.h +++ b/nx-X11/programs/Xserver/Xi/closedev.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/closedev.h,v 3.1 1996/04/15 11:18:32 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/devbell.c b/nx-X11/programs/Xserver/Xi/devbell.c index 27a4efca8..7fac4f972 100644 --- a/nx-X11/programs/Xserver/Xi/devbell.c +++ b/nx-X11/programs/Xserver/Xi/devbell.c @@ -1,4 +1,3 @@ -/* $Xorg: devbell.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/devbell.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/devbell.h b/nx-X11/programs/Xserver/Xi/devbell.h index 17cac6f7f..d1289bedf 100644 --- a/nx-X11/programs/Xserver/Xi/devbell.h +++ b/nx-X11/programs/Xserver/Xi/devbell.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/devbell.h,v 3.1 1996/04/15 11:18:32 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c index f3038f0af..3b5a070b6 100644 --- a/nx-X11/programs/Xserver/Xi/exevents.c +++ b/nx-X11/programs/Xserver/Xi/exevents.c @@ -1,4 +1,3 @@ -/* $Xorg: exevents.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -44,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/exevents.c,v 3.10 2001/12/14 19:58:55 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/exglobals.h b/nx-X11/programs/Xserver/Xi/exglobals.h index cba6310f4..e8d84e25f 100644 --- a/nx-X11/programs/Xserver/Xi/exglobals.h +++ b/nx-X11/programs/Xserver/Xi/exglobals.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/exglobals.h,v 3.2 1996/05/06 05:56:03 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/extinit.c b/nx-X11/programs/Xserver/Xi/extinit.c index 8f371f71b..d0052b1fb 100644 --- a/nx-X11/programs/Xserver/Xi/extinit.c +++ b/nx-X11/programs/Xserver/Xi/extinit.c @@ -1,4 +1,3 @@ -/* $Xorg: extinit.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/extinit.c,v 3.6 2001/12/14 19:58:55 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getbmap.c b/nx-X11/programs/Xserver/Xi/getbmap.c index 59b4c46a8..af497869c 100644 --- a/nx-X11/programs/Xserver/Xi/getbmap.c +++ b/nx-X11/programs/Xserver/Xi/getbmap.c @@ -1,4 +1,3 @@ -/* $Xorg: getbmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/getbmap.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getbmap.h b/nx-X11/programs/Xserver/Xi/getbmap.h index 01cc3780a..85d2e63e9 100644 --- a/nx-X11/programs/Xserver/Xi/getbmap.h +++ b/nx-X11/programs/Xserver/Xi/getbmap.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getbmap.h,v 3.1 1996/04/15 11:18:37 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/getdctl.c b/nx-X11/programs/Xserver/Xi/getdctl.c index cb16fb678..c315f0bb6 100644 --- a/nx-X11/programs/Xserver/Xi/getdctl.c +++ b/nx-X11/programs/Xserver/Xi/getdctl.c @@ -1,4 +1,3 @@ -/* $Xorg: getdctl.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/getdctl.c,v 3.3 2001/01/17 22:13:24 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getdctl.h b/nx-X11/programs/Xserver/Xi/getdctl.h index 168620eca..0618b4d01 100644 --- a/nx-X11/programs/Xserver/Xi/getdctl.h +++ b/nx-X11/programs/Xserver/Xi/getdctl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getdctl.h,v 3.1 1996/04/15 11:18:38 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/getfctl.c b/nx-X11/programs/Xserver/Xi/getfctl.c index d5a3b069d..a8845c72b 100644 --- a/nx-X11/programs/Xserver/Xi/getfctl.c +++ b/nx-X11/programs/Xserver/Xi/getfctl.c @@ -1,4 +1,3 @@ -/* $Xorg: getfctl.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/getfctl.c,v 3.3 2001/01/17 22:13:24 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getfctl.h b/nx-X11/programs/Xserver/Xi/getfctl.h index 97805d9af..f8441b0b3 100644 --- a/nx-X11/programs/Xserver/Xi/getfctl.h +++ b/nx-X11/programs/Xserver/Xi/getfctl.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getfctl.h,v 3.1 1996/04/15 11:18:39 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/getfocus.c b/nx-X11/programs/Xserver/Xi/getfocus.c index 356c84efd..6f30b011a 100644 --- a/nx-X11/programs/Xserver/Xi/getfocus.c +++ b/nx-X11/programs/Xserver/Xi/getfocus.c @@ -1,4 +1,3 @@ -/* $Xorg: getfocus.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/getfocus.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getfocus.h b/nx-X11/programs/Xserver/Xi/getfocus.h index 5d6438e1d..a404ee422 100644 --- a/nx-X11/programs/Xserver/Xi/getfocus.h +++ b/nx-X11/programs/Xserver/Xi/getfocus.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getfocus.h,v 3.1 1996/04/15 11:18:40 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/getkmap.c b/nx-X11/programs/Xserver/Xi/getkmap.c index 7850218a6..84f8a10a8 100644 --- a/nx-X11/programs/Xserver/Xi/getkmap.c +++ b/nx-X11/programs/Xserver/Xi/getkmap.c @@ -1,4 +1,3 @@ -/* $Xorg: getkmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/getkmap.c,v 3.3 2001/01/17 22:13:24 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getkmap.h b/nx-X11/programs/Xserver/Xi/getkmap.h index 5c2e3b189..4e8b4ba3a 100644 --- a/nx-X11/programs/Xserver/Xi/getkmap.h +++ b/nx-X11/programs/Xserver/Xi/getkmap.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getkmap.h,v 3.1 1996/04/15 11:18:41 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/getmmap.c b/nx-X11/programs/Xserver/Xi/getmmap.c index 4aba7a32e..53f2a6aec 100644 --- a/nx-X11/programs/Xserver/Xi/getmmap.c +++ b/nx-X11/programs/Xserver/Xi/getmmap.c @@ -1,4 +1,3 @@ -/* $Xorg: getmmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/getmmap.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getmmap.h b/nx-X11/programs/Xserver/Xi/getmmap.h index 88e4af427..32d7061e2 100644 --- a/nx-X11/programs/Xserver/Xi/getmmap.h +++ b/nx-X11/programs/Xserver/Xi/getmmap.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getmmap.h,v 3.1 1996/04/15 11:18:42 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/getprop.c b/nx-X11/programs/Xserver/Xi/getprop.c index 17b35deb5..569efcd1f 100644 --- a/nx-X11/programs/Xserver/Xi/getprop.c +++ b/nx-X11/programs/Xserver/Xi/getprop.c @@ -1,4 +1,3 @@ -/* $Xorg: getprop.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/getprop.c,v 3.5 2001/08/23 14:56:19 alanh Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getprop.h b/nx-X11/programs/Xserver/Xi/getprop.h index a8dcc3ab2..fd9011603 100644 --- a/nx-X11/programs/Xserver/Xi/getprop.h +++ b/nx-X11/programs/Xserver/Xi/getprop.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getprop.h,v 3.1 1996/04/15 11:18:44 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/getselev.c b/nx-X11/programs/Xserver/Xi/getselev.c index da3b11040..bac74317b 100644 --- a/nx-X11/programs/Xserver/Xi/getselev.c +++ b/nx-X11/programs/Xserver/Xi/getselev.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getselev.c,v 3.5 2001/10/28 03:32:53 tsi Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -45,7 +44,6 @@ SOFTWARE. ********************************************************/ -/* $Xorg: getselev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getselev.h b/nx-X11/programs/Xserver/Xi/getselev.h index bb0e71a11..ef9e3b606 100644 --- a/nx-X11/programs/Xserver/Xi/getselev.h +++ b/nx-X11/programs/Xserver/Xi/getselev.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getselev.h,v 3.1 1996/04/15 11:18:49 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/getvers.c b/nx-X11/programs/Xserver/Xi/getvers.c index 684f3f18d..00381a91c 100644 --- a/nx-X11/programs/Xserver/Xi/getvers.c +++ b/nx-X11/programs/Xserver/Xi/getvers.c @@ -1,4 +1,3 @@ -/* $Xorg: getvers.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/getvers.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/getvers.h b/nx-X11/programs/Xserver/Xi/getvers.h index 93b7bfbec..a09e2da2d 100644 --- a/nx-X11/programs/Xserver/Xi/getvers.h +++ b/nx-X11/programs/Xserver/Xi/getvers.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/getvers.h,v 3.1 1996/04/15 11:18:50 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/grabdev.c b/nx-X11/programs/Xserver/Xi/grabdev.c index 1f9c12063..8d8a5491e 100644 --- a/nx-X11/programs/Xserver/Xi/grabdev.c +++ b/nx-X11/programs/Xserver/Xi/grabdev.c @@ -1,4 +1,3 @@ -/* $Xorg: grabdev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/grabdev.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/grabdev.h b/nx-X11/programs/Xserver/Xi/grabdev.h index d149da5d9..9e9196c47 100644 --- a/nx-X11/programs/Xserver/Xi/grabdev.h +++ b/nx-X11/programs/Xserver/Xi/grabdev.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/grabdev.h,v 3.1 1996/04/15 11:18:51 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/grabdevb.c b/nx-X11/programs/Xserver/Xi/grabdevb.c index 6e722006b..edf1d763b 100644 --- a/nx-X11/programs/Xserver/Xi/grabdevb.c +++ b/nx-X11/programs/Xserver/Xi/grabdevb.c @@ -1,4 +1,3 @@ -/* $Xorg: grabdevb.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/grabdevb.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/grabdevb.h b/nx-X11/programs/Xserver/Xi/grabdevb.h index 50929a32b..29f0401e1 100644 --- a/nx-X11/programs/Xserver/Xi/grabdevb.h +++ b/nx-X11/programs/Xserver/Xi/grabdevb.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/grabdevb.h,v 3.1 1996/04/15 11:18:52 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/grabdevk.c b/nx-X11/programs/Xserver/Xi/grabdevk.c index b6233c6c8..cc7d2f034 100644 --- a/nx-X11/programs/Xserver/Xi/grabdevk.c +++ b/nx-X11/programs/Xserver/Xi/grabdevk.c @@ -1,4 +1,3 @@ -/* $Xorg: grabdevk.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/grabdevk.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/grabdevk.h b/nx-X11/programs/Xserver/Xi/grabdevk.h index 230461937..baa2d1533 100644 --- a/nx-X11/programs/Xserver/Xi/grabdevk.h +++ b/nx-X11/programs/Xserver/Xi/grabdevk.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/grabdevk.h,v 3.1 1996/04/15 11:18:53 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/gtmotion.c b/nx-X11/programs/Xserver/Xi/gtmotion.c index 834484508..922a5565c 100644 --- a/nx-X11/programs/Xserver/Xi/gtmotion.c +++ b/nx-X11/programs/Xserver/Xi/gtmotion.c @@ -1,4 +1,3 @@ -/* $Xorg: gtmotion.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/gtmotion.c,v 3.6 2001/10/28 03:32:53 tsi Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/gtmotion.h b/nx-X11/programs/Xserver/Xi/gtmotion.h index 205b19958..986eb5bad 100644 --- a/nx-X11/programs/Xserver/Xi/gtmotion.h +++ b/nx-X11/programs/Xserver/Xi/gtmotion.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/gtmotion.h,v 3.1 1996/04/15 11:18:56 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/listdev.c b/nx-X11/programs/Xserver/Xi/listdev.c index e6e1ce1ad..95896d49d 100644 --- a/nx-X11/programs/Xserver/Xi/listdev.c +++ b/nx-X11/programs/Xserver/Xi/listdev.c @@ -1,4 +1,3 @@ -/* $Xorg: listdev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/listdev.c,v 3.3 2001/01/17 22:13:25 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/listdev.h b/nx-X11/programs/Xserver/Xi/listdev.h index 125ea3580..629dca215 100644 --- a/nx-X11/programs/Xserver/Xi/listdev.h +++ b/nx-X11/programs/Xserver/Xi/listdev.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/listdev.h,v 3.1 1996/04/15 11:18:57 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/opendev.c b/nx-X11/programs/Xserver/Xi/opendev.c index 5a6ec1242..1b0a2476b 100644 --- a/nx-X11/programs/Xserver/Xi/opendev.c +++ b/nx-X11/programs/Xserver/Xi/opendev.c @@ -1,4 +1,3 @@ -/* $Xorg: opendev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/opendev.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/opendev.h b/nx-X11/programs/Xserver/Xi/opendev.h index 94ed6f6bd..68b89da4c 100644 --- a/nx-X11/programs/Xserver/Xi/opendev.h +++ b/nx-X11/programs/Xserver/Xi/opendev.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/opendev.h,v 3.1 1996/04/15 11:18:58 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/queryst.c b/nx-X11/programs/Xserver/Xi/queryst.c index ac0328fad..4eeba4c5f 100644 --- a/nx-X11/programs/Xserver/Xi/queryst.c +++ b/nx-X11/programs/Xserver/Xi/queryst.c @@ -1,4 +1,3 @@ -/* $Xorg: queryst.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /* Copyright 1998, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/Xi/queryst.c,v 3.4 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/queryst.h b/nx-X11/programs/Xserver/Xi/queryst.h index bf651b4bd..53378bb6c 100644 --- a/nx-X11/programs/Xserver/Xi/queryst.h +++ b/nx-X11/programs/Xserver/Xi/queryst.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/queryst.h,v 3.1 1996/04/15 11:19:00 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/selectev.c b/nx-X11/programs/Xserver/Xi/selectev.c index 0fa464bab..6887967ac 100644 --- a/nx-X11/programs/Xserver/Xi/selectev.c +++ b/nx-X11/programs/Xserver/Xi/selectev.c @@ -1,4 +1,3 @@ -/* $Xorg: selectev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/selectev.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/selectev.h b/nx-X11/programs/Xserver/Xi/selectev.h index 82bdbc6c0..69f8d65bc 100644 --- a/nx-X11/programs/Xserver/Xi/selectev.h +++ b/nx-X11/programs/Xserver/Xi/selectev.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/selectev.h,v 3.1 1996/04/15 11:19:01 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/sendexev.c b/nx-X11/programs/Xserver/Xi/sendexev.c index 56431fa42..28286d97f 100644 --- a/nx-X11/programs/Xserver/Xi/sendexev.c +++ b/nx-X11/programs/Xserver/Xi/sendexev.c @@ -1,4 +1,3 @@ -/* $Xorg: sendexev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/sendexev.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/sendexev.h b/nx-X11/programs/Xserver/Xi/sendexev.h index e5bc185a8..e52eda6f1 100644 --- a/nx-X11/programs/Xserver/Xi/sendexev.h +++ b/nx-X11/programs/Xserver/Xi/sendexev.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/sendexev.h,v 3.1 1996/04/15 11:19:02 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/setbmap.c b/nx-X11/programs/Xserver/Xi/setbmap.c index bbd4fbc46..edaea78c7 100644 --- a/nx-X11/programs/Xserver/Xi/setbmap.c +++ b/nx-X11/programs/Xserver/Xi/setbmap.c @@ -1,4 +1,3 @@ -/* $Xorg: setbmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/setbmap.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/setbmap.h b/nx-X11/programs/Xserver/Xi/setbmap.h index dab5fcbde..7dd00c416 100644 --- a/nx-X11/programs/Xserver/Xi/setbmap.h +++ b/nx-X11/programs/Xserver/Xi/setbmap.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/setbmap.h,v 3.1 1996/04/15 11:19:03 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/setdval.c b/nx-X11/programs/Xserver/Xi/setdval.c index 3da1ca38e..bb6db7bcb 100644 --- a/nx-X11/programs/Xserver/Xi/setdval.c +++ b/nx-X11/programs/Xserver/Xi/setdval.c @@ -1,4 +1,3 @@ -/* $Xorg: setdval.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/setdval.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/setdval.h b/nx-X11/programs/Xserver/Xi/setdval.h index d475c7cc6..2817b2688 100644 --- a/nx-X11/programs/Xserver/Xi/setdval.h +++ b/nx-X11/programs/Xserver/Xi/setdval.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/setdval.h,v 3.1 1996/04/15 11:19:04 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/setfocus.c b/nx-X11/programs/Xserver/Xi/setfocus.c index 09008ab88..b88a9ba02 100644 --- a/nx-X11/programs/Xserver/Xi/setfocus.c +++ b/nx-X11/programs/Xserver/Xi/setfocus.c @@ -1,4 +1,3 @@ -/* $Xorg: setfocus.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/setfocus.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/setfocus.h b/nx-X11/programs/Xserver/Xi/setfocus.h index 62ff181d2..44f9457d7 100644 --- a/nx-X11/programs/Xserver/Xi/setfocus.h +++ b/nx-X11/programs/Xserver/Xi/setfocus.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/setfocus.h,v 3.1 1996/04/15 11:19:05 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/setmmap.c b/nx-X11/programs/Xserver/Xi/setmmap.c index 8bedb2050..f50447952 100644 --- a/nx-X11/programs/Xserver/Xi/setmmap.c +++ b/nx-X11/programs/Xserver/Xi/setmmap.c @@ -1,4 +1,3 @@ -/* $Xorg: setmmap.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/setmmap.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */ /******************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/setmmap.h b/nx-X11/programs/Xserver/Xi/setmmap.h index c859095f8..7deb8bbf2 100644 --- a/nx-X11/programs/Xserver/Xi/setmmap.h +++ b/nx-X11/programs/Xserver/Xi/setmmap.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/setmmap.h,v 3.1 1996/04/15 11:19:06 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/setmode.c b/nx-X11/programs/Xserver/Xi/setmode.c index 20985850f..91287088d 100644 --- a/nx-X11/programs/Xserver/Xi/setmode.c +++ b/nx-X11/programs/Xserver/Xi/setmode.c @@ -1,4 +1,3 @@ -/* $Xorg: setmode.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/setmode.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/setmode.h b/nx-X11/programs/Xserver/Xi/setmode.h index d570af7bd..95d90b7f4 100644 --- a/nx-X11/programs/Xserver/Xi/setmode.h +++ b/nx-X11/programs/Xserver/Xi/setmode.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/setmode.h,v 3.1 1996/04/15 11:19:07 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/stubs.c b/nx-X11/programs/Xserver/Xi/stubs.c index 8e0d75f3e..e71db6051 100644 --- a/nx-X11/programs/Xserver/Xi/stubs.c +++ b/nx-X11/programs/Xserver/Xi/stubs.c @@ -1,4 +1,3 @@ -/* $Xorg: stubs.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/stubs.c,v 3.4 2001/12/14 19:58:59 dawes Exp $ */ /* * stubs.c -- stub routines for the X server side of the XINPUT diff --git a/nx-X11/programs/Xserver/Xi/ungrdev.c b/nx-X11/programs/Xserver/Xi/ungrdev.c index 6cc6511d7..ea7f0f6f1 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdev.c +++ b/nx-X11/programs/Xserver/Xi/ungrdev.c @@ -1,4 +1,3 @@ -/* $Xorg: ungrdev.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/ungrdev.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/ungrdev.h b/nx-X11/programs/Xserver/Xi/ungrdev.h index e8e866bc9..6ecfa5f67 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdev.h +++ b/nx-X11/programs/Xserver/Xi/ungrdev.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/ungrdev.h,v 3.1 1996/04/15 11:19:08 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/ungrdevb.c b/nx-X11/programs/Xserver/Xi/ungrdevb.c index cc3986931..bbf3575ea 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdevb.c +++ b/nx-X11/programs/Xserver/Xi/ungrdevb.c @@ -1,4 +1,3 @@ -/* $Xorg: ungrdevb.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/ungrdevb.c,v 3.3 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/ungrdevb.h b/nx-X11/programs/Xserver/Xi/ungrdevb.h index 238e56954..29dd761b5 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdevb.h +++ b/nx-X11/programs/Xserver/Xi/ungrdevb.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/ungrdevb.h,v 3.1 1996/04/15 11:19:10 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/Xi/ungrdevk.c b/nx-X11/programs/Xserver/Xi/ungrdevk.c index ac47d505e..af3bb2348 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdevk.c +++ b/nx-X11/programs/Xserver/Xi/ungrdevk.c @@ -1,4 +1,3 @@ -/* $Xorg: ungrdevk.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ /************************************************************ @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/Xi/ungrdevk.c,v 3.3 2001/01/17 22:13:26 dawes Exp $ */ /*********************************************************************** * diff --git a/nx-X11/programs/Xserver/Xi/ungrdevk.h b/nx-X11/programs/Xserver/Xi/ungrdevk.h index ba3455882..be383b519 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdevk.h +++ b/nx-X11/programs/Xserver/Xi/ungrdevk.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/Xi/ungrdevk.h,v 3.1 1996/04/15 11:19:12 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 3dff2cf06..276919e34 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/dbe/dbe.c,v 1.5 2005/07/03 07:01:17 daniels Exp $ */ -/* $Xorg: dbe.c,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company @@ -31,7 +29,6 @@ * DIX DBE code * *****************************************************************************/ -/* $XFree86: xc/programs/Xserver/dbe/dbe.c,v 3.10 2001/08/23 14:19:24 alanh Exp $ */ /* INCLUDES */ diff --git a/nx-X11/programs/Xserver/dbe/dbemodule.c b/nx-X11/programs/Xserver/dbe/dbemodule.c index bdb7f3345..00be6cb49 100644 --- a/nx-X11/programs/Xserver/dbe/dbemodule.c +++ b/nx-X11/programs/Xserver/dbe/dbemodule.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dbe/dbemodule.c,v 1.6 1999/01/26 05:53:50 dawes Exp $ */ #ifdef HAVE_XORG_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dbe/dbestruct.h b/nx-X11/programs/Xserver/dbe/dbestruct.h index 43c4c525b..2f3f25d11 100644 --- a/nx-X11/programs/Xserver/dbe/dbestruct.h +++ b/nx-X11/programs/Xserver/dbe/dbestruct.h @@ -1,4 +1,3 @@ -/* $Xorg: dbestruct.h,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company diff --git a/nx-X11/programs/Xserver/dbe/midbe.c b/nx-X11/programs/Xserver/dbe/midbe.c index c01500cdc..867a11243 100644 --- a/nx-X11/programs/Xserver/dbe/midbe.c +++ b/nx-X11/programs/Xserver/dbe/midbe.c @@ -1,4 +1,3 @@ -/* $Xorg: midbe.c,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company @@ -30,7 +29,6 @@ * Machine-independent DBE code * *****************************************************************************/ -/* $XFree86: xc/programs/Xserver/dbe/midbe.c,v 3.4 2001/03/06 17:31:34 dawes Exp $ */ /* INCLUDES */ diff --git a/nx-X11/programs/Xserver/dbe/midbe.h b/nx-X11/programs/Xserver/dbe/midbe.h index 1110578cd..1780c3fc3 100644 --- a/nx-X11/programs/Xserver/dbe/midbe.h +++ b/nx-X11/programs/Xserver/dbe/midbe.h @@ -1,4 +1,3 @@ -/* $Xorg: midbe.h,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company diff --git a/nx-X11/programs/Xserver/dbe/midbestr.h b/nx-X11/programs/Xserver/dbe/midbestr.h index 248b44857..1ad0104aa 100644 --- a/nx-X11/programs/Xserver/dbe/midbestr.h +++ b/nx-X11/programs/Xserver/dbe/midbestr.h @@ -1,4 +1,3 @@ -/* $Xorg: midbestr.h,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company diff --git a/nx-X11/programs/Xserver/dix/atom.c b/nx-X11/programs/Xserver/dix/atom.c index 6a1f17854..fdacb2a6b 100644 --- a/nx-X11/programs/Xserver/dix/atom.c +++ b/nx-X11/programs/Xserver/dix/atom.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/atom.c,v 3.3 2001/12/14 19:59:29 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,7 +45,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: atom.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index 7e586a0db..b8361a9cf 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/dix/colormap.c,v 1.11 2005/09/05 07:40:50 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.11 2003/11/03 05:10:59 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -47,7 +45,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: colormap.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/cursor.c b/nx-X11/programs/Xserver/dix/cursor.c index 875e19480..093464298 100644 --- a/nx-X11/programs/Xserver/dix/cursor.c +++ b/nx-X11/programs/Xserver/dix/cursor.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/cursor.c,v 3.8 2003/01/12 02:44:26 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -47,7 +46,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: cursor.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index 1eccae567..f02da7d21 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/devices.c,v 3.20 2001/12/14 19:59:30 dawes Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -47,8 +46,6 @@ SOFTWARE. ********************************************************/ -/* $Xorg: devices.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/dix/devices.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 63ea0ab87..3017c68d1 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.13 2005/09/13 01:33:19 daniels Exp $ */ -/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ /************************************************************ Copyright 1987, 1989, 1998 The Open Group @@ -76,7 +74,6 @@ Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.32 2003/11/10 18:21:45 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/dispatch.h b/nx-X11/programs/Xserver/dix/dispatch.h index 89ea2dd7e..dd07096af 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.h +++ b/nx-X11/programs/Xserver/dix/dispatch.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/dispatch.h,v 3.2 2001/08/01 00:44:48 tsi Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index b6c363798..aa90b8769 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/dix/dixfonts.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.28 2003/11/08 02:02:03 dawes Exp $ */ /************************************************************************ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -49,7 +47,6 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index d43b57a2c..bd7439d89 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/dixutils.c,v 3.13 2003/01/12 02:44:26 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -82,7 +81,6 @@ Author: Adobe Systems Incorporated */ -/* $Xorg: dixutils.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index 76a6dbac6..f85bacdd3 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.17 2005/08/25 22:11:04 anholt Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.51 2004/01/12 17:04:52 tsi Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -109,7 +107,6 @@ of the copyright holder. ******************************************************************/ -/* $Xorg: events.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c index fc52b4c65..be4409cf7 100644 --- a/nx-X11/programs/Xserver/dix/extension.c +++ b/nx-X11/programs/Xserver/dix/extension.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.11 2001/12/14 19:59:31 dawes 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. ******************************************************************/ -/* $Xorg: extension.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/ffs.c b/nx-X11/programs/Xserver/dix/ffs.c index 8d0954689..e25d715dd 100644 --- a/nx-X11/programs/Xserver/dix/ffs.c +++ b/nx-X11/programs/Xserver/dix/ffs.c @@ -1,4 +1,3 @@ -/* $Xorg: ffs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ /* Copyright 1996, 1998 The Open Group diff --git a/nx-X11/programs/Xserver/dix/gc.c b/nx-X11/programs/Xserver/dix/gc.c index 9566bb8f7..29f14de43 100644 --- a/nx-X11/programs/Xserver/dix/gc.c +++ b/nx-X11/programs/Xserver/dix/gc.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/gc.c,v 3.9 2001/12/14 19:59:32 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,7 +45,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: gc.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/globals.c b/nx-X11/programs/Xserver/dix/globals.c index 632d0f82b..5a2819e50 100644 --- a/nx-X11/programs/Xserver/dix/globals.c +++ b/nx-X11/programs/Xserver/dix/globals.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/dix/globals.c,v 1.7 2005/07/03 08:53:38 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.12tsi Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -47,7 +45,6 @@ SOFTWARE. ********************************************************/ -/* $Xorg: globals.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/glyphcurs.c b/nx-X11/programs/Xserver/dix/glyphcurs.c index a1da68443..08d67b922 100644 --- a/nx-X11/programs/Xserver/dix/glyphcurs.c +++ b/nx-X11/programs/Xserver/dix/glyphcurs.c @@ -45,7 +45,6 @@ SOFTWARE. ************************************************************************/ -/* $Xorg: glyphcurs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/grabs.c b/nx-X11/programs/Xserver/dix/grabs.c index 50e060e7e..04a571eb8 100644 --- a/nx-X11/programs/Xserver/dix/grabs.c +++ b/nx-X11/programs/Xserver/dix/grabs.c @@ -1,4 +1,3 @@ -/* $Xorg: grabs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/dix/grabs.c,v 3.4 2002/02/19 11:09:22 alanh Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c index 20b635c19..553ad6c03 100644 --- a/nx-X11/programs/Xserver/dix/main.c +++ b/nx-X11/programs/Xserver/dix/main.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/dix/main.c,v 1.14 2005/07/03 08:53:38 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.43 2003/10/30 21:21:02 herrb 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: main.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ /* The panoramix components contained the following notice */ /***************************************************************** diff --git a/nx-X11/programs/Xserver/dix/pixmap.c b/nx-X11/programs/Xserver/dix/pixmap.c index 246d26067..1f2239c12 100644 --- a/nx-X11/programs/Xserver/dix/pixmap.c +++ b/nx-X11/programs/Xserver/dix/pixmap.c @@ -1,4 +1,3 @@ -/* $Xorg: pixmap.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ /* Copyright 1993, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/dix/pixmap.c,v 3.4 2001/01/17 22:36:44 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/privates.c b/nx-X11/programs/Xserver/dix/privates.c index 15a9dff4d..a7009054c 100644 --- a/nx-X11/programs/Xserver/dix/privates.c +++ b/nx-X11/programs/Xserver/dix/privates.c @@ -1,5 +1,3 @@ -/* $Xorg: privates.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/dix/privates.c,v 1.10 2005/09/05 07:40:50 daniels Exp $ */ /* Copyright 1993, 1998 The Open Group @@ -27,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/dix/privates.c,v 3.7 2001/01/17 22:36:44 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index 527a2e91a..2e5569367 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.12 2002/02/19 11:09:22 alanh 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. ******************************************************************/ -/* $Xorg: property.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/region.c b/nx-X11/programs/Xserver/dix/region.c index f2b7224f8..46e8845bf 100644 --- a/nx-X11/programs/Xserver/dix/region.c +++ b/nx-X11/programs/Xserver/dix/region.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/miregion.c,v 1.9 2003/04/23 21:51:53 tsi Exp $ */ /*********************************************************** Copyright 1987, 1988, 1989, 1998 The Open Group @@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $Xorg: miregion.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* The panoramix components contained the following notice */ /***************************************************************** diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index 7cf5a470e..ca7da1601 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -73,8 +73,6 @@ Equipment Corporation. ******************************************************************/ -/* $Xorg: resource.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/dix/resource.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ /* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */ /* Routines to manage various kinds of resources: @@ -99,7 +97,6 @@ Equipment Corporation. * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a * resource "owned" by the client. */ -/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.13 2003/09/24 02:43:13 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/swaprep.c b/nx-X11/programs/Xserver/dix/swaprep.c index 5f538e6bd..62122e3a4 100644 --- a/nx-X11/programs/Xserver/dix/swaprep.c +++ b/nx-X11/programs/Xserver/dix/swaprep.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/swaprep.c,v 3.7 2001/12/14 19:59:33 dawes Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -46,7 +45,6 @@ SOFTWARE. ********************************************************/ -/* $Xorg: swaprep.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/swapreq.c b/nx-X11/programs/Xserver/dix/swapreq.c index 16ff026a2..7ea841e12 100644 --- a/nx-X11/programs/Xserver/dix/swapreq.c +++ b/nx-X11/programs/Xserver/dix/swapreq.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/swapreq.c,v 3.4 2001/12/14 19:59:33 dawes Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -46,7 +45,6 @@ SOFTWARE. ********************************************************/ -/* $Xorg: swapreq.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/tables.c b/nx-X11/programs/Xserver/dix/tables.c index 2a2146ce9..624522daf 100644 --- a/nx-X11/programs/Xserver/dix/tables.c +++ b/nx-X11/programs/Xserver/dix/tables.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/dix/tables.c,v 3.5 2002/02/19 11:09:22 alanh 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. ******************************************************************/ -/* $Xorg: tables.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index f4c10f11d..1239ab9f7 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.12 2005/07/03 08:53:38 daniels Exp $ */ -/* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -78,7 +76,6 @@ Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.36 2003/11/14 23:52:50 torrey Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/xpstubs.c b/nx-X11/programs/Xserver/dix/xpstubs.c index 89481c601..ed9693b89 100644 --- a/nx-X11/programs/Xserver/dix/xpstubs.c +++ b/nx-X11/programs/Xserver/dix/xpstubs.c @@ -25,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $Xorg: xpstubs.c,v 1.5 2001/03/08 17:52:08 pookie Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fb.h b/nx-X11/programs/Xserver/fb/fb.h index 008ab3ec7..317b57c5a 100644 --- a/nx-X11/programs/Xserver/fb/fb.h +++ b/nx-X11/programs/Xserver/fb/fb.h @@ -22,7 +22,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XdotOrg: xc/programs/Xserver/fb/fb.h,v 1.13 2005/10/02 08:28:26 anholt Exp $ */ #ifndef _FB_H_ #define _FB_H_ diff --git a/nx-X11/programs/Xserver/fb/fballpriv.c b/nx-X11/programs/Xserver/fb/fballpriv.c index 638e71621..d2d8866e2 100644 --- a/nx-X11/programs/Xserver/fb/fballpriv.c +++ b/nx-X11/programs/Xserver/fb/fballpriv.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fballpriv.c,v 1.3 2000/02/23 20:29:41 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbarc.c b/nx-X11/programs/Xserver/fb/fbarc.c index 0b386f70e..0193d2b31 100644 --- a/nx-X11/programs/Xserver/fb/fbarc.c +++ b/nx-X11/programs/Xserver/fb/fbarc.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbarc.c,v 1.7tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbbits.c b/nx-X11/programs/Xserver/fb/fbbits.c index ab67b4cf3..56b58df4e 100644 --- a/nx-X11/programs/Xserver/fb/fbbits.c +++ b/nx-X11/programs/Xserver/fb/fbbits.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbbits.c,v 1.5 2000/02/17 14:16:22 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbblt.c b/nx-X11/programs/Xserver/fb/fbblt.c index c2617a718..085a8e639 100644 --- a/nx-X11/programs/Xserver/fb/fbblt.c +++ b/nx-X11/programs/Xserver/fb/fbblt.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbblt.c,v 1.7 2000/09/22 05:58:01 keithp Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbbltone.c b/nx-X11/programs/Xserver/fb/fbbltone.c index b271318d1..f06357a37 100644 --- a/nx-X11/programs/Xserver/fb/fbbltone.c +++ b/nx-X11/programs/Xserver/fb/fbbltone.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbbltone.c,v 1.11 2001/09/07 15:15:31 keithp Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbbstore.c b/nx-X11/programs/Xserver/fb/fbbstore.c index e9eedde5b..75f6084c0 100644 --- a/nx-X11/programs/Xserver/fb/fbbstore.c +++ b/nx-X11/programs/Xserver/fb/fbbstore.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbbstore.c,v 1.1 1999/11/19 13:53:42 hohndel Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbcmap.c b/nx-X11/programs/Xserver/fb/fbcmap.c index 656cafbb8..ec8ddff4f 100644 --- a/nx-X11/programs/Xserver/fb/fbcmap.c +++ b/nx-X11/programs/Xserver/fb/fbcmap.c @@ -1,5 +1,4 @@ /* $XConsortium: fbcmap.c,v 4.19 94/04/17 20:28:46 dpw Exp $ */ -/* $XFree86: xc/programs/Xserver/fb/fbcmap.c,v 1.5 2000/09/20 00:09:13 keithp Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. diff --git a/nx-X11/programs/Xserver/fb/fbcopy.c b/nx-X11/programs/Xserver/fb/fbcopy.c index e936fcc9a..65790e20b 100644 --- a/nx-X11/programs/Xserver/fb/fbcopy.c +++ b/nx-X11/programs/Xserver/fb/fbcopy.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbcopy.c,v 1.13 2003/11/10 18:21:47 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbfill.c b/nx-X11/programs/Xserver/fb/fbfill.c index 72a12baaf..4852918da 100644 --- a/nx-X11/programs/Xserver/fb/fbfill.c +++ b/nx-X11/programs/Xserver/fb/fbfill.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbfill.c,v 1.5 2003/01/29 00:43:33 torrey Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbfillrect.c b/nx-X11/programs/Xserver/fb/fbfillrect.c index 37a7b20f7..2a19fa7d2 100644 --- a/nx-X11/programs/Xserver/fb/fbfillrect.c +++ b/nx-X11/programs/Xserver/fb/fbfillrect.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbfillrect.c,v 1.1 1999/11/19 13:53:43 hohndel Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbfillsp.c b/nx-X11/programs/Xserver/fb/fbfillsp.c index 5d465482f..ca9fdbb0a 100644 --- a/nx-X11/programs/Xserver/fb/fbfillsp.c +++ b/nx-X11/programs/Xserver/fb/fbfillsp.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbfillsp.c,v 1.1 1999/11/19 13:53:43 hohndel Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbgc.c b/nx-X11/programs/Xserver/fb/fbgc.c index 1475aca66..fd7636937 100644 --- a/nx-X11/programs/Xserver/fb/fbgc.c +++ b/nx-X11/programs/Xserver/fb/fbgc.c @@ -21,8 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XdotOrg: xc/programs/Xserver/fb/fbgc.c,v 1.5 2005/07/03 07:01:23 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/fb/fbgc.c,v 1.14 2003/12/18 15:22:32 alanh Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbgetsp.c b/nx-X11/programs/Xserver/fb/fbgetsp.c index 7c58dcb82..f77ea8c52 100644 --- a/nx-X11/programs/Xserver/fb/fbgetsp.c +++ b/nx-X11/programs/Xserver/fb/fbgetsp.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbgetsp.c,v 1.5 2000/05/06 21:09:33 keithp Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbimage.c b/nx-X11/programs/Xserver/fb/fbimage.c index 06b501b41..c3b0fe3fb 100644 --- a/nx-X11/programs/Xserver/fb/fbimage.c +++ b/nx-X11/programs/Xserver/fb/fbimage.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbimage.c,v 1.7 2001/05/29 04:54:09 keithp Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbmodule.c b/nx-X11/programs/Xserver/fb/fbmodule.c index 80d99933a..0e6cd2dba 100644 --- a/nx-X11/programs/Xserver/fb/fbmodule.c +++ b/nx-X11/programs/Xserver/fb/fbmodule.c @@ -23,7 +23,6 @@ * dealings in this Software without prior written authorization from the * XFree86 Project. */ -/* $XFree86: xc/programs/Xserver/fb/fbmodule.c,v 1.3 2000/02/14 19:20:29 dawes Exp $ */ #ifdef HAVE_XORG_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fboverlay.c b/nx-X11/programs/Xserver/fb/fboverlay.c index a98a131c9..ac0875016 100644 --- a/nx-X11/programs/Xserver/fb/fboverlay.c +++ b/nx-X11/programs/Xserver/fb/fboverlay.c @@ -23,7 +23,6 @@ * Author: Keith Packard, SuSE, Inc. */ -/* $XdotOrg: xc/programs/Xserver/fb/fboverlay.c,v 1.7 2005/07/03 07:01:23 daniels Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbpixmap.c b/nx-X11/programs/Xserver/fb/fbpixmap.c index c562da221..599f3b44e 100644 --- a/nx-X11/programs/Xserver/fb/fbpixmap.c +++ b/nx-X11/programs/Xserver/fb/fbpixmap.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbpixmap.c,v 1.9 2001/05/29 04:54:09 keithp Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbpoint.c b/nx-X11/programs/Xserver/fb/fbpoint.c index 06d8662ba..719dcfbb4 100644 --- a/nx-X11/programs/Xserver/fb/fbpoint.c +++ b/nx-X11/programs/Xserver/fb/fbpoint.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbpoint.c,v 1.7 2000/09/22 05:58:01 keithp Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbpush.c b/nx-X11/programs/Xserver/fb/fbpush.c index 5f7459c51..6979b6f1b 100644 --- a/nx-X11/programs/Xserver/fb/fbpush.c +++ b/nx-X11/programs/Xserver/fb/fbpush.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbpush.c,v 1.3 2000/02/14 19:20:30 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbrop.h b/nx-X11/programs/Xserver/fb/fbrop.h index 65f62c393..f3768a265 100644 --- a/nx-X11/programs/Xserver/fb/fbrop.h +++ b/nx-X11/programs/Xserver/fb/fbrop.h @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbrop.h,v 1.3 2000/02/14 19:20:30 dawes Exp $ */ #ifndef _FBROP_H_ #define _FBROP_H_ diff --git a/nx-X11/programs/Xserver/fb/fbscreen.c b/nx-X11/programs/Xserver/fb/fbscreen.c index 0600cebfe..4346e5f7b 100644 --- a/nx-X11/programs/Xserver/fb/fbscreen.c +++ b/nx-X11/programs/Xserver/fb/fbscreen.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbscreen.c,v 1.13 2001/05/29 04:54:09 keithp Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbseg.c b/nx-X11/programs/Xserver/fb/fbseg.c index 2947992a6..8c50829c5 100644 --- a/nx-X11/programs/Xserver/fb/fbseg.c +++ b/nx-X11/programs/Xserver/fb/fbseg.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbseg.c,v 1.7 2001/01/17 07:40:02 keithp Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbsetsp.c b/nx-X11/programs/Xserver/fb/fbsetsp.c index c7074f036..4b3db1eda 100644 --- a/nx-X11/programs/Xserver/fb/fbsetsp.c +++ b/nx-X11/programs/Xserver/fb/fbsetsp.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbsetsp.c,v 1.4 2000/05/06 21:09:34 keithp Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbstipple.c b/nx-X11/programs/Xserver/fb/fbstipple.c index 44aa5f331..486fa2030 100644 --- a/nx-X11/programs/Xserver/fb/fbstipple.c +++ b/nx-X11/programs/Xserver/fb/fbstipple.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbstipple.c,v 1.6 2000/02/23 20:29:47 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbtile.c b/nx-X11/programs/Xserver/fb/fbtile.c index ef3242241..0d0cfe174 100644 --- a/nx-X11/programs/Xserver/fb/fbtile.c +++ b/nx-X11/programs/Xserver/fb/fbtile.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbtile.c,v 1.3 2000/02/12 03:39:43 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbutil.c b/nx-X11/programs/Xserver/fb/fbutil.c index 8153ab364..4be0f233c 100644 --- a/nx-X11/programs/Xserver/fb/fbutil.c +++ b/nx-X11/programs/Xserver/fb/fbutil.c @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbutil.c,v 1.4 2000/02/23 20:29:48 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/fb/fbwindow.c b/nx-X11/programs/Xserver/fb/fbwindow.c index 707403da6..aca49e5b1 100644 --- a/nx-X11/programs/Xserver/fb/fbwindow.c +++ b/nx-X11/programs/Xserver/fb/fbwindow.c @@ -1,4 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/fb/fbwindow.c,v 1.9 2005/10/02 08:28:26 anholt Exp $ */ /* * Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ * @@ -22,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbwindow.c,v 1.10tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index aed923ef1..452fe8c43 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -23,8 +23,6 @@ /* */ /**************************************************************************/ -/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.13 2005/09/13 01:33:19 daniels Exp $ */ -/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ /************************************************************ Copyright 1987, 1989, 1998 The Open Group @@ -101,7 +99,6 @@ Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.32 2003/11/10 18:21:45 tsi Exp $ */ #ifdef __sun #define False 0 diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 1433e3efa..294a5727d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -23,8 +23,6 @@ /* */ /**************************************************************************/ -/* $XdotOrg: xc/programs/Xserver/dix/dixfonts.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.28 2003/11/08 02:02:03 dawes Exp $ */ /************************************************************************ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -74,7 +72,6 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $Xorg: dixfonts.c,v 1.4 2000/08/17 19:48:18 cpqbld Exp $ */ #include "dixstruct.h" #include "dixfontstr.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index e9534eb62..8f79245f8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -23,8 +23,6 @@ /* */ /**************************************************************************/ -/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.17 2005/08/25 22:11:04 anholt Exp $ */ -/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.51 2004/01/12 17:04:52 tsi Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -134,7 +132,6 @@ of the copyright holder. ******************************************************************/ -/* $Xorg: events.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #include diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c index 1b5bcb771..f6c63e699 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c @@ -23,7 +23,6 @@ /* */ /**************************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.11 2001/12/14 19:59:31 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -70,7 +69,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $Xorg: extension.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #include "Trap.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c index 14ead9614..8b875555f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c @@ -70,7 +70,6 @@ SOFTWARE. ************************************************************************/ -/* $Xorg: glyphcurs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #include "../../dix/glyphcurs.c" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c index 4cb1e658e..eb92dd3bb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c @@ -23,8 +23,6 @@ /* */ /**************************************************************************/ -/* $XdotOrg: xc/programs/Xserver/mi/miexpose.c,v 1.6 2005/07/03 08:53:51 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/mi/miexpose.c,v 3.9tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -99,7 +97,6 @@ Equipment Corporation. ******************************************************************/ -/* $Xorg: miexpose.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ #include "Windows.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index ca76a0be8..881d2e2d0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -23,7 +23,6 @@ /* */ /**************************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -70,7 +69,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $Xorg: property.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ #include "../../dix/property.c" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c index d7a5a8ba2..a564d84b9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c @@ -98,8 +98,6 @@ Equipment Corporation. ******************************************************************/ -/* $Xorg: resource.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/dix/resource.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */ /* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */ /* Routines to manage various kinds of resources: @@ -124,7 +122,6 @@ Equipment Corporation. * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a * resource "owned" by the client. */ -/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.13 2003/09/24 02:43:13 dawes Exp $ */ #include "../../dix/resource.c" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index f7efe31ea..fa60917e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -23,7 +23,6 @@ /* */ /**************************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.41 2003/12/17 23:28:56 alanh Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -52,7 +51,6 @@ in this Software without prior written authorization from The Open Group. /* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ -/* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ #include #include "Trap.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 326fe7d75..7cb29bde5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -23,8 +23,6 @@ /* */ /**************************************************************************/ -/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.12 2005/07/03 08:53:38 daniels Exp $ */ -/* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -103,7 +101,6 @@ Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.36 2003/11/14 23:52:50 torrey Exp $ */ #include "selection.h" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c index d1968abc0..ee19c28d0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c @@ -23,7 +23,6 @@ /* */ /**************************************************************************/ -/* $XdotOrg: xc/programs/Xserver/Xext/xvdisp.c,v 1.6 2005/07/03 08:53:36 daniels Exp $ */ /*********************************************************** Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, and the Massachusetts Institute of Technology, Cambridge, Massachusetts. @@ -47,7 +46,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.27 2003/07/16 01:38:31 dawes Exp $ */ #if !defined(__sun) && !defined(__CYGWIN__) diff --git a/nx-X11/programs/Xserver/hw/xfree86/common/compiler.h b/nx-X11/programs/Xserver/hw/xfree86/common/compiler.h index d323f677b..05dbb163d 100644 --- a/nx-X11/programs/Xserver/hw/xfree86/common/compiler.h +++ b/nx-X11/programs/Xserver/hw/xfree86/common/compiler.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.106 2004/02/02 03:55:28 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * diff --git a/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h b/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h index 1322e72ee..d800fe885 100644 --- a/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h +++ b/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.53 2003/10/28 18:36:37 tsi Exp $ */ /* * Copyright 1997-2003 by The XFree86 Project, Inc * diff --git a/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_libc.h b/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_libc.h index ca68c1b63..686060c0d 100644 --- a/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_libc.h +++ b/nx-X11/programs/Xserver/hw/xfree86/os-support/xf86_libc.h @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 1.9 2005/08/24 11:18:31 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.63 2003/12/08 21:46:55 alanh Exp $ */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. * diff --git a/nx-X11/programs/Xserver/hw/xfree86/xf86Version.h b/nx-X11/programs/Xserver/hw/xfree86/xf86Version.h index 3996c3581..f7ac89b1b 100644 --- a/nx-X11/programs/Xserver/hw/xfree86/xf86Version.h +++ b/nx-X11/programs/Xserver/hw/xfree86/xf86Version.h @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 1.5 2005/08/24 11:18:35 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.566 2003/12/19 04:52:11 dawes Exp $ */ /* * Copyright (c) 1994-2003 by The XFree86 Project, Inc. @@ -59,4 +57,3 @@ #endif /* $XConsortium: xf86Version.h /main/78 1996/10/28 05:42:10 kaleb $ */ -/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 1.5 2005/08/24 11:18:35 daniels Exp $ */ 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 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/closestr.h b/nx-X11/programs/Xserver/include/closestr.h index 89660a1dc..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,7 +25,6 @@ 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 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 bfc6667db..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,7 +44,6 @@ 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 diff --git a/nx-X11/programs/Xserver/include/colormapst.h b/nx-X11/programs/Xserver/include/colormapst.h index 6b52b8350..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 diff --git a/nx-X11/programs/Xserver/include/cursor.h b/nx-X11/programs/Xserver/include/cursor.h index 9e760df02..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 diff --git a/nx-X11/programs/Xserver/include/cursorstr.h b/nx-X11/programs/Xserver/include/cursorstr.h index d5d82576b..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 diff --git a/nx-X11/programs/Xserver/include/dix.h b/nx-X11/programs/Xserver/include/dix.h index e68c71623..4b9c7749c 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,7 +44,6 @@ 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 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 diff --git a/nx-X11/programs/Xserver/include/dixfont.h b/nx-X11/programs/Xserver/include/dixfont.h index 9fcf0d585..6582be24c 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 diff --git a/nx-X11/programs/Xserver/include/dixfontstr.h b/nx-X11/programs/Xserver/include/dixfontstr.h index 99b020df5..a2cb3639c 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. diff --git a/nx-X11/programs/Xserver/include/dixgrabs.h b/nx-X11/programs/Xserver/include/dixgrabs.h index c05447c71..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 diff --git a/nx-X11/programs/Xserver/include/dixstruct.h b/nx-X11/programs/Xserver/include/dixstruct.h index 57033a43e..5019dea4a 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,7 +20,6 @@ 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 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 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 diff --git a/nx-X11/programs/Xserver/include/extnsionst.h b/nx-X11/programs/Xserver/include/extnsionst.h index 218ce8a7a..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 diff --git a/nx-X11/programs/Xserver/include/gc.h b/nx-X11/programs/Xserver/include/gc.h index 0465071a3..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,7 +44,6 @@ 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 diff --git a/nx-X11/programs/Xserver/include/gcstruct.h b/nx-X11/programs/Xserver/include/gcstruct.h index 71d3ace47..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 diff --git a/nx-X11/programs/Xserver/include/globals.h b/nx-X11/programs/Xserver/include/globals.h index a8b3a62f6..6bc31d8e7 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_ diff --git a/nx-X11/programs/Xserver/include/input.h b/nx-X11/programs/Xserver/include/input.h index a7c8d0dfe..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,7 +44,6 @@ 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 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/misc.h b/nx-X11/programs/Xserver/include/misc.h index ac19ecc3b..3255e2201 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 /* diff --git a/nx-X11/programs/Xserver/include/miscstruct.h b/nx-X11/programs/Xserver/include/miscstruct.h index 7b1f8047b..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,7 +44,6 @@ 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 diff --git a/nx-X11/programs/Xserver/include/opaque.h b/nx-X11/programs/Xserver/include/opaque.h index 749b6f5b9..bd286ba12 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,7 +25,6 @@ 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 diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 26ce2706c..106132b23 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,7 +45,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: os.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ #ifndef OS_H #define OS_H diff --git a/nx-X11/programs/Xserver/include/pixmap.h b/nx-X11/programs/Xserver/include/pixmap.h index 3c9f91a00..22e1ce7bd 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 diff --git a/nx-X11/programs/Xserver/include/pixmapstr.h b/nx-X11/programs/Xserver/include/pixmapstr.h index 22a1f1025..5189c3e09 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 diff --git a/nx-X11/programs/Xserver/include/property.h b/nx-X11/programs/Xserver/include/property.h index 080d52937..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 diff --git a/nx-X11/programs/Xserver/include/propertyst.h b/nx-X11/programs/Xserver/include/propertyst.h index 2bd0b270c..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 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 ace8031e0..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,7 +44,6 @@ 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 diff --git a/nx-X11/programs/Xserver/include/resource.h b/nx-X11/programs/Xserver/include/resource.h index 3aac8bb00..5e169e093 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 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..e60c2480c 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 diff --git a/nx-X11/programs/Xserver/include/scrnintstr.h b/nx-X11/programs/Xserver/include/scrnintstr.h index a15c288e0..b1b36c5d8 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 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 a04c2aa5e..7652964d0 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,8 +44,6 @@ 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 diff --git a/nx-X11/programs/Xserver/include/site.h b/nx-X11/programs/Xserver/include/site.h index be8c003da..5b9f25815 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 diff --git a/nx-X11/programs/Xserver/include/swaprep.h b/nx-X11/programs/Xserver/include/swaprep.h index d18b39f0c..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 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 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 9e670995d..41b14d562 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 diff --git a/nx-X11/programs/Xserver/include/windowstr.h b/nx-X11/programs/Xserver/include/windowstr.h index dd9bb4653..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 diff --git a/nx-X11/programs/Xserver/mfb/maskbits.h b/nx-X11/programs/Xserver/mfb/maskbits.h index 94a7e8955..997e412ea 100644 --- a/nx-X11/programs/Xserver/mfb/maskbits.h +++ b/nx-X11/programs/Xserver/mfb/maskbits.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mfb/maskbits.h,v 3.8tsi Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.1, 1/24/89 */ /*********************************************************** Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -22,7 +21,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $Xorg: maskbits.h,v 1.3 2000/08/17 19:53:34 cpqbld Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/cbrt.c b/nx-X11/programs/Xserver/mi/cbrt.c index cfc8d84da..c703fd9d2 100644 --- a/nx-X11/programs/Xserver/mi/cbrt.c +++ b/nx-X11/programs/Xserver/mi/cbrt.c @@ -1,4 +1,3 @@ -/* $Xorg: cbrt.c,v 1.4 2001/02/09 02:05:19 xorgcvs Exp $ */ /* Copyright 1990, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/cbrt.c,v 3.3 2001/05/29 22:24:06 dawes Exp $ */ /* simple cbrt, in case your math library doesn't have a good one */ diff --git a/nx-X11/programs/Xserver/mi/mi.h b/nx-X11/programs/Xserver/mi/mi.h index 86db39ad8..0cd4b8bac 100644 --- a/nx-X11/programs/Xserver/mi/mi.h +++ b/nx-X11/programs/Xserver/mi/mi.h @@ -1,4 +1,3 @@ -/* $Xorg: mi.h,v 1.4 2001/02/09 02:05:20 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/mi/mi.h,v 3.9 2001/08/06 20:51:16 dawes Exp $ */ #ifndef MI_H #define MI_H diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c index fadb42bc5..c812673eb 100644 --- a/nx-X11/programs/Xserver/mi/miarc.c +++ b/nx-X11/programs/Xserver/mi/miarc.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/mi/miarc.c,v 1.6 2005/07/03 08:53:51 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/mi/miarc.c,v 3.14 2003/10/29 22:57:48 tsi 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: miarc.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ /* Author: Keith Packard and Bob Scheifler */ /* Warning: this code is toxic, do not dally very long here. */ diff --git a/nx-X11/programs/Xserver/mi/mibank.c b/nx-X11/programs/Xserver/mi/mibank.c index a651c021e..1d841c748 100644 --- a/nx-X11/programs/Xserver/mi/mibank.c +++ b/nx-X11/programs/Xserver/mi/mibank.c @@ -44,7 +44,6 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/mi/mibank.c,v 1.15 2003/11/10 18:39:16 tsi Exp $ */ /* * This thing originated from an idea of Edwin Goei and his bank switching diff --git a/nx-X11/programs/Xserver/mi/mibank.h b/nx-X11/programs/Xserver/mi/mibank.h index 26b33305a..68326d3d6 100644 --- a/nx-X11/programs/Xserver/mi/mibank.h +++ b/nx-X11/programs/Xserver/mi/mibank.h @@ -20,7 +20,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/mi/mibank.h,v 1.10 2003/01/01 19:16:42 tsi Exp $ */ #ifndef __MIBANK_H__ #define __MIBANK_H__ 1 diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c index bded0850a..143f18043 100644 --- a/nx-X11/programs/Xserver/mi/mibitblt.c +++ b/nx-X11/programs/Xserver/mi/mibitblt.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mibitblt.c,v 3.10 2001/08/06 20:51:17 dawes 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. ******************************************************************/ -/* $Xorg: mibitblt.c,v 1.5 2001/02/09 02:05:20 xorgcvs Exp $ */ /* Author: Todd Newman (aided and abetted by Mr. Drewry) */ #ifdef HAVE_DIX_CONFIG_H diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index 16771615c..79791057c 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -1,4 +1,3 @@ -/* $Xorg: mibstore.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -42,7 +41,6 @@ implied warranty. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/mi/mibstore.c,v 1.10tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mibstore.h b/nx-X11/programs/Xserver/mi/mibstore.h index fb58975c6..5f3597074 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.h +++ b/nx-X11/programs/Xserver/mi/mibstore.h @@ -16,7 +16,6 @@ */ -/* $XFree86: xc/programs/Xserver/mi/mibstore.h,v 1.4 2001/01/17 22:37:06 dawes Exp $ */ #ifndef _MIBSTORE_H #define _MIBSTORE_H diff --git a/nx-X11/programs/Xserver/mi/mibstorest.h b/nx-X11/programs/Xserver/mi/mibstorest.h index 787b9d4f4..ccf4fb701 100644 --- a/nx-X11/programs/Xserver/mi/mibstorest.h +++ b/nx-X11/programs/Xserver/mi/mibstorest.h @@ -4,7 +4,6 @@ * internal structure definitions for mi backing store */ -/* $Xorg: mibstorest.h,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ /* @@ -31,7 +30,6 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/mibstorest.h,v 1.4 2001/01/17 22:37:06 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/miclipn.c b/nx-X11/programs/Xserver/mi/miclipn.c index 913b0e47a..8bc7c3f44 100644 --- a/nx-X11/programs/Xserver/mi/miclipn.c +++ b/nx-X11/programs/Xserver/mi/miclipn.c @@ -1,4 +1,3 @@ -/* $Xorg: miclipn.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ /* Copyright 1990, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/miclipn.c,v 1.3 2001/08/06 21:46:04 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/micmap.c b/nx-X11/programs/Xserver/mi/micmap.c index 1d79ade9b..c01d7d333 100644 --- a/nx-X11/programs/Xserver/mi/micmap.c +++ b/nx-X11/programs/Xserver/mi/micmap.c @@ -27,7 +27,6 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/mi/micmap.c,v 1.10 2000/09/20 00:09:14 keithp Exp $ */ /* * This is based on cfbcmap.c. The functions here are useful independently diff --git a/nx-X11/programs/Xserver/mi/micmap.h b/nx-X11/programs/Xserver/mi/micmap.h index ca2a417be..9ee9f4ae4 100644 --- a/nx-X11/programs/Xserver/mi/micmap.h +++ b/nx-X11/programs/Xserver/mi/micmap.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/micmap.h,v 1.5 1999/06/14 07:32:11 dawes Exp $ */ #include "colormapst.h" diff --git a/nx-X11/programs/Xserver/mi/micoord.h b/nx-X11/programs/Xserver/mi/micoord.h index e4b242475..b3d725b73 100644 --- a/nx-X11/programs/Xserver/mi/micoord.h +++ b/nx-X11/programs/Xserver/mi/micoord.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/micoord.h,v 1.7 2003/10/29 22:57:48 tsi Exp $ */ /* * Copyright (C) 2000 The XFree86 Project, Inc. All Rights Reserved. * diff --git a/nx-X11/programs/Xserver/mi/micursor.c b/nx-X11/programs/Xserver/mi/micursor.c index d499e60f5..e95c43b3d 100644 --- a/nx-X11/programs/Xserver/mi/micursor.c +++ b/nx-X11/programs/Xserver/mi/micursor.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/micursor.c,v 1.2 2001/05/29 22:24:06 dawes 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. ******************************************************************/ -/* $Xorg: micursor.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/midash.c b/nx-X11/programs/Xserver/mi/midash.c index 59c6afdce..33fac339b 100644 --- a/nx-X11/programs/Xserver/mi/midash.c +++ b/nx-X11/programs/Xserver/mi/midash.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/midash.c,v 1.4 2001/12/14 20:00:21 dawes 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. ******************************************************************/ -/* $Xorg: midash.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/midispcur.c b/nx-X11/programs/Xserver/mi/midispcur.c index 24d964080..2ed908de4 100644 --- a/nx-X11/programs/Xserver/mi/midispcur.c +++ b/nx-X11/programs/Xserver/mi/midispcur.c @@ -4,7 +4,6 @@ * machine independent cursor display routines */ -/* $Xorg: midispcur.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ /* @@ -30,7 +29,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/mi/midispcur.c,v 1.9 2002/12/09 04:10:57 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mieq.c b/nx-X11/programs/Xserver/mi/mieq.c index d41da1c09..b5d9baa31 100644 --- a/nx-X11/programs/Xserver/mi/mieq.c +++ b/nx-X11/programs/Xserver/mi/mieq.c @@ -25,7 +25,6 @@ in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/mi/mieq.c,v 1.2 2001/05/25 18:41:01 dawes Exp $ */ /* * mieq.c diff --git a/nx-X11/programs/Xserver/mi/miexpose.c b/nx-X11/programs/Xserver/mi/miexpose.c index e55e712d6..e16ebf4f8 100644 --- a/nx-X11/programs/Xserver/mi/miexpose.c +++ b/nx-X11/programs/Xserver/mi/miexpose.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/mi/miexpose.c,v 1.6 2005/07/03 08:53:51 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/mi/miexpose.c,v 3.9tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -74,7 +72,6 @@ Equipment Corporation. ******************************************************************/ -/* $Xorg: miexpose.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mifillarc.c b/nx-X11/programs/Xserver/mi/mifillarc.c index 533bfe996..befed1301 100644 --- a/nx-X11/programs/Xserver/mi/mifillarc.c +++ b/nx-X11/programs/Xserver/mi/mifillarc.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mifillarc.c,v 3.7 2001/12/14 20:00:22 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -27,7 +26,6 @@ Author: Bob Scheifler, MIT X Consortium ********************************************************/ -/* $Xorg: mifillarc.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mifillarc.h b/nx-X11/programs/Xserver/mi/mifillarc.h index 2d6904121..0afee1c5e 100644 --- a/nx-X11/programs/Xserver/mi/mifillarc.h +++ b/nx-X11/programs/Xserver/mi/mifillarc.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mifillarc.h,v 3.6 2001/10/25 12:03:47 alanh Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -25,7 +24,6 @@ in this Software without prior written authorization from The Open Group. ********************************************************/ -/* $Xorg: mifillarc.h,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ #ifndef __MIFILLARC_H__ #define __MIFILLARC_H__ diff --git a/nx-X11/programs/Xserver/mi/mifillrct.c b/nx-X11/programs/Xserver/mi/mifillrct.c index 8a8f2b4f3..197c2bf6a 100644 --- a/nx-X11/programs/Xserver/mi/mifillrct.c +++ b/nx-X11/programs/Xserver/mi/mifillrct.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mifillrct.c,v 1.2 2001/05/29 22:24:06 dawes 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. ******************************************************************/ -/* $Xorg: mifillrct.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mifpoly.h b/nx-X11/programs/Xserver/mi/mifpoly.h index 79f606b4d..8f0507601 100644 --- a/nx-X11/programs/Xserver/mi/mifpoly.h +++ b/nx-X11/programs/Xserver/mi/mifpoly.h @@ -1,4 +1,3 @@ -/* $Xorg: mifpoly.h,v 1.4 2001/02/09 02:05:20 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/mi/mifpoly.h,v 1.3 2001/10/25 12:03:47 alanh Exp $ */ #ifndef __MIFPOLY_H__ #define __MIFPOLY_H__ diff --git a/nx-X11/programs/Xserver/mi/mifpolycon.c b/nx-X11/programs/Xserver/mi/mifpolycon.c index 95b81bbb6..d9f18637a 100644 --- a/nx-X11/programs/Xserver/mi/mifpolycon.c +++ b/nx-X11/programs/Xserver/mi/mifpolycon.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mifpolycon.c,v 1.2 2001/08/06 20:51:18 dawes 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. ******************************************************************/ -/* $Xorg: mifpolycon.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/migc.c b/nx-X11/programs/Xserver/mi/migc.c index 58a00ddd1..4d67cbf5d 100644 --- a/nx-X11/programs/Xserver/mi/migc.c +++ b/nx-X11/programs/Xserver/mi/migc.c @@ -1,4 +1,3 @@ -/* $Xorg: migc.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* Copyright 1993, 1998 The Open Group @@ -27,7 +26,6 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/migc.c,v 1.8 2001/08/06 20:51:18 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/migc.h b/nx-X11/programs/Xserver/mi/migc.h index 039448b5f..9c579961c 100644 --- a/nx-X11/programs/Xserver/mi/migc.h +++ b/nx-X11/programs/Xserver/mi/migc.h @@ -1,4 +1,3 @@ -/* $Xorg: migc.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* Copyright 1993, 1998 The Open Group @@ -27,7 +26,6 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/migc.h,v 1.7 2001/08/06 20:51:18 dawes Exp $ */ extern void miChangeGC( GCPtr /*pGC*/, diff --git a/nx-X11/programs/Xserver/mi/miglblt.c b/nx-X11/programs/Xserver/mi/miglblt.c index 8a9733424..45fa9ea25 100644 --- a/nx-X11/programs/Xserver/mi/miglblt.c +++ b/nx-X11/programs/Xserver/mi/miglblt.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/miglblt.c,v 1.5 2001/05/29 22:24:07 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,7 +45,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: miglblt.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/miinitext.c b/nx-X11/programs/Xserver/mi/miinitext.c index 1b947a784..22f48ffd8 100644 --- a/nx-X11/programs/Xserver/mi/miinitext.c +++ b/nx-X11/programs/Xserver/mi/miinitext.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/mi/miinitext.c,v 1.26 2005/07/16 03:49:59 kem Exp $ */ -/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.67 2003/01/12 02:44:27 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: miinitext.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/miline.h b/nx-X11/programs/Xserver/mi/miline.h index f52a51ebd..7028485f0 100644 --- a/nx-X11/programs/Xserver/mi/miline.h +++ b/nx-X11/programs/Xserver/mi/miline.h @@ -1,4 +1,3 @@ -/* $Xorg: miline.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* @@ -25,7 +24,6 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/miline.h,v 1.6 2001/08/06 20:51:19 dawes Exp $ */ #ifndef MILINE_H diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c index 1250c2b74..796df6ebd 100644 --- a/nx-X11/programs/Xserver/mi/mioverlay.c +++ b/nx-X11/programs/Xserver/mi/mioverlay.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mioverlay.c,v 3.15tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mioverlay.h b/nx-X11/programs/Xserver/mi/mioverlay.h index a1d1e1a18..24b74f51c 100644 --- a/nx-X11/programs/Xserver/mi/mioverlay.h +++ b/nx-X11/programs/Xserver/mi/mioverlay.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mioverlay.h,v 3.3 2000/02/29 00:16:03 mvojkovi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mipointer.c b/nx-X11/programs/Xserver/mi/mipointer.c index d86c27e75..01502c251 100644 --- a/nx-X11/programs/Xserver/mi/mipointer.c +++ b/nx-X11/programs/Xserver/mi/mipointer.c @@ -2,7 +2,6 @@ * mipointer.c */ -/* $Xorg: mipointer.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* @@ -28,7 +27,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/mi/mipointer.c,v 3.9 2001/09/04 14:03:28 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mipointer.h b/nx-X11/programs/Xserver/mi/mipointer.h index f8e7fd084..4fd326fce 100644 --- a/nx-X11/programs/Xserver/mi/mipointer.h +++ b/nx-X11/programs/Xserver/mi/mipointer.h @@ -3,7 +3,6 @@ * */ -/* $Xorg: mipointer.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* @@ -29,7 +28,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/mi/mipointer.h,v 3.8 2001/08/06 20:51:19 dawes Exp $ */ #ifndef MIPOINTER_H #define MIPOINTER_H diff --git a/nx-X11/programs/Xserver/mi/mipointrst.h b/nx-X11/programs/Xserver/mi/mipointrst.h index 682f8ac88..f1fbfe4f9 100644 --- a/nx-X11/programs/Xserver/mi/mipointrst.h +++ b/nx-X11/programs/Xserver/mi/mipointrst.h @@ -3,7 +3,6 @@ * */ -/* $Xorg: mipointrst.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* @@ -29,7 +28,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/mi/mipointrst.h,v 1.3 2001/04/19 14:14:07 tsi Exp $ */ #include "mipointer.h" #include "scrnintstr.h" diff --git a/nx-X11/programs/Xserver/mi/mipoly.c b/nx-X11/programs/Xserver/mi/mipoly.c index 11214a732..b95ee3962 100644 --- a/nx-X11/programs/Xserver/mi/mipoly.c +++ b/nx-X11/programs/Xserver/mi/mipoly.c @@ -45,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $Xorg: mipoly.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* * mipoly.c * diff --git a/nx-X11/programs/Xserver/mi/mipoly.h b/nx-X11/programs/Xserver/mi/mipoly.h index 88a1782de..8e04f6737 100644 --- a/nx-X11/programs/Xserver/mi/mipoly.h +++ b/nx-X11/programs/Xserver/mi/mipoly.h @@ -1,4 +1,3 @@ -/* $Xorg: mipoly.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/mipoly.h,v 1.2 2001/08/06 20:51:19 dawes Exp $ */ /* diff --git a/nx-X11/programs/Xserver/mi/mipolycon.c b/nx-X11/programs/Xserver/mi/mipolycon.c index 10c43a78e..985fceb49 100644 --- a/nx-X11/programs/Xserver/mi/mipolycon.c +++ b/nx-X11/programs/Xserver/mi/mipolycon.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mipolycon.c,v 1.3 2001/08/06 21:46:04 dawes 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. ******************************************************************/ -/* $Xorg: mipolycon.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mipolygen.c b/nx-X11/programs/Xserver/mi/mipolygen.c index 98fe21d50..917791f16 100644 --- a/nx-X11/programs/Xserver/mi/mipolygen.c +++ b/nx-X11/programs/Xserver/mi/mipolygen.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mipolygen.c,v 1.2 2001/05/29 22:24:07 dawes 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. ******************************************************************/ -/* $Xorg: mipolygen.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/mipolypnt.c b/nx-X11/programs/Xserver/mi/mipolypnt.c index dcbdf85d0..41adc7b22 100644 --- a/nx-X11/programs/Xserver/mi/mipolypnt.c +++ b/nx-X11/programs/Xserver/mi/mipolypnt.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mipolypnt.c,v 1.2 2001/05/29 22:24:07 dawes 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. ******************************************************************/ -/* $Xorg: mipolypnt.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/mipolyrect.c b/nx-X11/programs/Xserver/mi/mipolyrect.c index 9b21bb032..2fe70cf4b 100644 --- a/nx-X11/programs/Xserver/mi/mipolyrect.c +++ b/nx-X11/programs/Xserver/mi/mipolyrect.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mipolyrect.c,v 1.3 2001/12/14 20:00:25 dawes 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. ******************************************************************/ -/* $Xorg: mipolyrect.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/mipolyseg.c b/nx-X11/programs/Xserver/mi/mipolyseg.c index bd3c93ed6..13a9e7222 100644 --- a/nx-X11/programs/Xserver/mi/mipolyseg.c +++ b/nx-X11/programs/Xserver/mi/mipolyseg.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mipolyseg.c,v 1.3 2001/12/14 20:00:26 dawes 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. ******************************************************************/ -/* $Xorg: mipolyseg.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/mipolytext.c b/nx-X11/programs/Xserver/mi/mipolytext.c index 92a51ac87..fcc834f60 100644 --- a/nx-X11/programs/Xserver/mi/mipolytext.c +++ b/nx-X11/programs/Xserver/mi/mipolytext.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mipolytext.c,v 1.2 2001/08/06 20:51:19 dawes 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. ************************************************************************/ -/* $Xorg: mipolytext.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* * mipolytext.c - text routines * diff --git a/nx-X11/programs/Xserver/mi/mipolyutil.c b/nx-X11/programs/Xserver/mi/mipolyutil.c index f88d03d54..5e1b0a609 100644 --- a/nx-X11/programs/Xserver/mi/mipolyutil.c +++ b/nx-X11/programs/Xserver/mi/mipolyutil.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mipolyutil.c,v 1.9 2001/12/14 20:00:26 dawes 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. ******************************************************************/ -/* $Xorg: mipolyutil.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/mipushpxl.c b/nx-X11/programs/Xserver/mi/mipushpxl.c index 084597392..19a8a3ed9 100644 --- a/nx-X11/programs/Xserver/mi/mipushpxl.c +++ b/nx-X11/programs/Xserver/mi/mipushpxl.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mipushpxl.c,v 3.12 2001/12/14 20:00:26 dawes 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. ******************************************************************/ -/* $Xorg: mipushpxl.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/miscanfill.h b/nx-X11/programs/Xserver/mi/miscanfill.h index 49058c1c9..e318c45b4 100644 --- a/nx-X11/programs/Xserver/mi/miscanfill.h +++ b/nx-X11/programs/Xserver/mi/miscanfill.h @@ -1,4 +1,3 @@ -/* $Xorg: miscanfill.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group diff --git a/nx-X11/programs/Xserver/mi/miscrinit.c b/nx-X11/programs/Xserver/mi/miscrinit.c index f2b009fcd..ceb51ab4c 100644 --- a/nx-X11/programs/Xserver/mi/miscrinit.c +++ b/nx-X11/programs/Xserver/mi/miscrinit.c @@ -1,4 +1,3 @@ -/* $Xorg: miscrinit.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ /* Copyright 1990, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/miscrinit.c,v 3.15tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mispans.c b/nx-X11/programs/Xserver/mi/mispans.c index ef2dc269f..a0b3d8e3c 100644 --- a/nx-X11/programs/Xserver/mi/mispans.c +++ b/nx-X11/programs/Xserver/mi/mispans.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mispans.c,v 3.3 2001/08/06 20:51:20 dawes Exp $ */ /*********************************************************** Copyright 1989, 1998 The Open Group @@ -46,7 +45,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: mispans.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mispans.h b/nx-X11/programs/Xserver/mi/mispans.h index 0db0afc1c..0f980bff7 100644 --- a/nx-X11/programs/Xserver/mi/mispans.h +++ b/nx-X11/programs/Xserver/mi/mispans.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mispans.h,v 1.2 2001/08/06 20:51:20 dawes Exp $ */ /*********************************************************** Copyright 1989, 1998 The Open Group @@ -46,7 +45,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: mispans.h,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ typedef struct { int count; /* number of spans */ diff --git a/nx-X11/programs/Xserver/mi/misprite.c b/nx-X11/programs/Xserver/mi/misprite.c index b1555ec1b..592013d7f 100644 --- a/nx-X11/programs/Xserver/mi/misprite.c +++ b/nx-X11/programs/Xserver/mi/misprite.c @@ -4,7 +4,6 @@ * machine independent software sprite routines */ -/* $Xorg: misprite.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ /* @@ -30,7 +29,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/mi/misprite.c,v 3.10tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/misprite.h b/nx-X11/programs/Xserver/mi/misprite.h index b4cc84ecf..5173b7736 100644 --- a/nx-X11/programs/Xserver/mi/misprite.h +++ b/nx-X11/programs/Xserver/mi/misprite.h @@ -6,7 +6,6 @@ * mi versions of these routines exist. */ -/* $Xorg: misprite.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ /* @@ -32,7 +31,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/mi/misprite.h,v 1.2 2001/08/06 20:51:20 dawes Exp $ */ typedef struct { Bool (*RealizeCursor)( diff --git a/nx-X11/programs/Xserver/mi/mispritest.h b/nx-X11/programs/Xserver/mi/mispritest.h index dca1fa619..5075f0580 100644 --- a/nx-X11/programs/Xserver/mi/mispritest.h +++ b/nx-X11/programs/Xserver/mi/mispritest.h @@ -4,7 +4,6 @@ * mi sprite structures */ -/* $Xorg: mispritest.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ /* @@ -30,7 +29,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/mi/mispritest.h,v 1.4 2001/01/17 22:37:07 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/mi/mistruct.h b/nx-X11/programs/Xserver/mi/mistruct.h index 98879b72d..9b9de8677 100644 --- a/nx-X11/programs/Xserver/mi/mistruct.h +++ b/nx-X11/programs/Xserver/mi/mistruct.h @@ -1,4 +1,3 @@ -/* $Xorg: mistruct.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group diff --git a/nx-X11/programs/Xserver/mi/mivalidate.h b/nx-X11/programs/Xserver/mi/mivalidate.h index 612b67e1d..91858328a 100644 --- a/nx-X11/programs/Xserver/mi/mivalidate.h +++ b/nx-X11/programs/Xserver/mi/mivalidate.h @@ -1,4 +1,3 @@ -/* $Xorg: mivalidate.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ /* Copyright 1993, 1998 The Open Group diff --git a/nx-X11/programs/Xserver/mi/mivaltree.c b/nx-X11/programs/Xserver/mi/mivaltree.c index 73028a074..0435925ed 100644 --- a/nx-X11/programs/Xserver/mi/mivaltree.c +++ b/nx-X11/programs/Xserver/mi/mivaltree.c @@ -1,5 +1,3 @@ -/* $Xorg: mivaltree.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/mi/mivaltree.c,v 1.6 2005/07/03 07:01:51 daniels Exp $ */ /* * mivaltree.c -- * Functions for recalculating window clip lists. Main function @@ -81,7 +79,6 @@ Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/mi/mivaltree.c,v 1.9tsi Exp $ */ /* * Aug '86: Susan Angebranndt -- original code diff --git a/nx-X11/programs/Xserver/mi/miwideline.c b/nx-X11/programs/Xserver/mi/miwideline.c index b96db7cfa..530d9f87e 100644 --- a/nx-X11/programs/Xserver/mi/miwideline.c +++ b/nx-X11/programs/Xserver/mi/miwideline.c @@ -1,4 +1,3 @@ -/* $Xorg: miwideline.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ /* Copyright 1988, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/miwideline.c,v 1.12 2001/12/14 20:00:28 dawes Exp $ */ /* Author: Keith Packard, MIT X Consortium */ diff --git a/nx-X11/programs/Xserver/mi/miwideline.h b/nx-X11/programs/Xserver/mi/miwideline.h index 96d6aae86..8cfa63008 100644 --- a/nx-X11/programs/Xserver/mi/miwideline.h +++ b/nx-X11/programs/Xserver/mi/miwideline.h @@ -1,4 +1,3 @@ -/* $Xorg: miwideline.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ /* Copyright 1988, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/mi/miwideline.h,v 1.11 2001/10/25 12:03:47 alanh Exp $ */ /* Author: Keith Packard, MIT X Consortium */ diff --git a/nx-X11/programs/Xserver/mi/miwindow.c b/nx-X11/programs/Xserver/mi/miwindow.c index e9e5a39ef..2a583eda7 100644 --- a/nx-X11/programs/Xserver/mi/miwindow.c +++ b/nx-X11/programs/Xserver/mi/miwindow.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/miwindow.c,v 1.9tsi 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. ******************************************************************/ -/* $Xorg: miwindow.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/mi/mizerarc.c b/nx-X11/programs/Xserver/mi/mizerarc.c index f337d605e..4920d4425 100644 --- a/nx-X11/programs/Xserver/mi/mizerarc.c +++ b/nx-X11/programs/Xserver/mi/mizerarc.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mizerarc.c,v 1.6 2001/12/14 20:00:28 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -27,7 +26,6 @@ Author: Bob Scheifler, MIT X Consortium ********************************************************/ -/* $Xorg: mizerarc.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ /* Derived from: * "Algorithm for drawing ellipses or hyperbolae with a digital plotter" diff --git a/nx-X11/programs/Xserver/mi/mizerarc.h b/nx-X11/programs/Xserver/mi/mizerarc.h index 99062d192..8119d885e 100644 --- a/nx-X11/programs/Xserver/mi/mizerarc.h +++ b/nx-X11/programs/Xserver/mi/mizerarc.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mizerarc.h,v 1.2 2001/08/06 20:51:20 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -25,7 +24,6 @@ in this Software without prior written authorization from The Open Group. ********************************************************/ -/* $Xorg: mizerarc.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ typedef struct { int x; diff --git a/nx-X11/programs/Xserver/mi/mizerclip.c b/nx-X11/programs/Xserver/mi/mizerclip.c index 6acfc7fe0..198a72687 100644 --- a/nx-X11/programs/Xserver/mi/mizerclip.c +++ b/nx-X11/programs/Xserver/mi/mizerclip.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mizerclip.c,v 1.2 2001/08/06 20:51:20 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group diff --git a/nx-X11/programs/Xserver/mi/mizerline.c b/nx-X11/programs/Xserver/mi/mizerline.c index 5a61ff5d6..5f7eec32f 100644 --- a/nx-X11/programs/Xserver/mi/mizerline.c +++ b/nx-X11/programs/Xserver/mi/mizerline.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/mi/mizerline.c,v 3.6 2001/08/06 20:51:20 dawes 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. ******************************************************************/ -/* $Xorg: mizerline.c,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index 4090a9589..db1b9b2c8 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -1,5 +1,3 @@ -/* $Xorg: access.c,v 1.5 2001/02/09 02:05:23 xorgcvs Exp $ */ -/* $XdotOrg: xc/programs/Xserver/os/access.c,v 1.13 2005/11/08 06:33:30 jkj Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -55,7 +53,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/os/access.c,v 3.53 2004/01/02 18:23:19 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 78ed47f1d..4f635fa7e 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -1,4 +1,3 @@ -/* $Xorg: connection.c,v 1.6 2001/02/09 02:05:23 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/os/connection.c,v 3.64 2003/10/07 22:50:42 herrb Exp $ */ /***************************************************************** * Stuff to create connections --- OS dependent * diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index 557138a7a..77ed0d44a 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -45,7 +45,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: io.c,v 1.6 2001/02/09 02:05:23 xorgcvs Exp $ */ /***************************************************************** * i/o functions * @@ -53,7 +52,6 @@ SOFTWARE. * InsertFakeRequest, ResetCurrentRequest * *****************************************************************/ -/* $XFree86: xc/programs/Xserver/os/io.c,v 3.34 2002/05/31 18:46:05 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/os/mitauth.c b/nx-X11/programs/Xserver/os/mitauth.c index 2630a81ae..c42cbe30e 100644 --- a/nx-X11/programs/Xserver/os/mitauth.c +++ b/nx-X11/programs/Xserver/os/mitauth.c @@ -1,4 +1,3 @@ -/* $Xorg: mitauth.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */ /* Copyright 1988, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/os/mitauth.c,v 1.4 2001/01/17 22:37:11 dawes Exp $ */ /* * MIT-MAGIC-COOKIE-1 authorization scheme diff --git a/nx-X11/programs/Xserver/os/oscolor.c b/nx-X11/programs/Xserver/os/oscolor.c index 2ea81060d..32f8a4b23 100644 --- a/nx-X11/programs/Xserver/os/oscolor.c +++ b/nx-X11/programs/Xserver/os/oscolor.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/os/oscolor.c,v 3.10 2003/07/16 01:39:03 dawes 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. ******************************************************************/ -/* $Xorg: oscolor.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */ #ifdef NX_TRANS_SOCKET diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h index a13af57d5..9ad267a36 100644 --- a/nx-X11/programs/Xserver/os/osdep.h +++ b/nx-X11/programs/Xserver/os/osdep.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/os/osdep.h,v 3.17 2002/05/31 18:46:06 dawes 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. ******************************************************************/ -/* $Xorg: osdep.h,v 1.5 2001/02/09 02:05:23 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index ca707d4b2..f4b7abae0 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/os/osinit.c,v 3.29 2003/09/09 03:20:41 dawes 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. ******************************************************************/ -/* $Xorg: osinit.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/os/rpcauth.c b/nx-X11/programs/Xserver/os/rpcauth.c index 40ea7ad97..2a6874f4a 100644 --- a/nx-X11/programs/Xserver/os/rpcauth.c +++ b/nx-X11/programs/Xserver/os/rpcauth.c @@ -1,4 +1,3 @@ -/* $Xorg: rpcauth.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */ /* Copyright 1991, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/os/rpcauth.c,v 3.7 2001/12/14 20:00:35 dawes Exp $ */ /* * SUN-DES-1 authentication mechanism diff --git a/nx-X11/programs/Xserver/os/secauth.c b/nx-X11/programs/Xserver/os/secauth.c index 735afd6e5..5219b488a 100644 --- a/nx-X11/programs/Xserver/os/secauth.c +++ b/nx-X11/programs/Xserver/os/secauth.c @@ -1,4 +1,3 @@ -/* $Xorg: secauth.c,v 1.4 2001/02/09 02:05:23 xorgcvs Exp $ */ /* Copyright 1996, 1998 The Open Group @@ -24,7 +23,6 @@ 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/os/secauth.c,v 1.10 2001/08/01 00:44:59 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/os/xdmauth.c b/nx-X11/programs/Xserver/os/xdmauth.c index c2796fba1..75e748bea 100644 --- a/nx-X11/programs/Xserver/os/xdmauth.c +++ b/nx-X11/programs/Xserver/os/xdmauth.c @@ -1,4 +1,3 @@ -/* $Xorg: xdmauth.c,v 1.4 2001/02/09 02:05:24 xorgcvs Exp $ */ /* Copyright 1988, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xdmauth.c,v 1.7 2002/11/05 05:50:34 keithp Exp $ */ /* * XDM-AUTHENTICATION-1 (XDMCP authentication) and diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c index d48012759..19b8753f7 100644 --- a/nx-X11/programs/Xserver/os/xdmcp.c +++ b/nx-X11/programs/Xserver/os/xdmcp.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/os/xdmcp.c,v 1.10 2005/07/03 08:53:52 daniels Exp $ */ -/* $Xorg: xdmcp.c,v 1.4 2001/01/31 13:37:19 pookie Exp $ */ /* * Copyright 1989 Network Computing Devices, Inc., Mountain View, California. * @@ -14,7 +12,6 @@ * without express or implied warranty. * */ -/* $XFree86: xc/programs/Xserver/os/xdmcp.c,v 3.31 2003/12/30 21:24:32 herrb Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/randr/panoramiXproto.h b/nx-X11/programs/Xserver/randr/panoramiXproto.h index 2794b8d03..de3fa7194 100644 --- a/nx-X11/programs/Xserver/randr/panoramiXproto.h +++ b/nx-X11/programs/Xserver/randr/panoramiXproto.h @@ -1,4 +1,3 @@ -/* $Xorg: panoramiXproto.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */ /***************************************************************** Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. Permission is hereby granted, free of charge, to any person obtaining a copy @@ -23,7 +22,6 @@ shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/include/extensions/panoramiXproto.h,v 3.5 2000/03/01 01:04:21 dawes Exp $ */ /* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index 024cad2d5..33bdf56ec 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/record/record.c,v 1.5 2005/07/03 07:02:08 daniels Exp $ */ -/* $Xorg: record.c,v 1.4 2001/02/09 02:05:27 xorgcvs Exp $ */ /* @@ -33,7 +31,6 @@ This work benefited from earlier work done by Martha Zimet of NCD and Jim Haggerty of Metheus. */ -/* $XFree86: xc/programs/Xserver/record/record.c,v 1.11 2003/11/03 05:12:01 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/record/recordmod.c b/nx-X11/programs/Xserver/record/recordmod.c index b216d7f52..bd50bbd5b 100644 --- a/nx-X11/programs/Xserver/record/recordmod.c +++ b/nx-X11/programs/Xserver/record/recordmod.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/record/recordmod.c,v 1.5 1999/01/26 05:54:21 dawes Exp $ */ #ifdef HAVE_XORG_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/record/set.c b/nx-X11/programs/Xserver/record/set.c index b7360a565..07d911c8c 100644 --- a/nx-X11/programs/Xserver/record/set.c +++ b/nx-X11/programs/Xserver/record/set.c @@ -1,4 +1,3 @@ -/* $Xorg: set.c,v 1.4 2001/02/09 02:05:27 xorgcvs Exp $ */ /* @@ -27,7 +26,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/record/set.c,v 1.7 2001/12/14 20:00:37 dawes Exp $ */ /* diff --git a/nx-X11/programs/Xserver/record/set.h b/nx-X11/programs/Xserver/record/set.h index 6f0b872a1..f156bf8dc 100644 --- a/nx-X11/programs/Xserver/record/set.h +++ b/nx-X11/programs/Xserver/record/set.h @@ -1,4 +1,3 @@ -/* $Xorg: set.h,v 1.4 2001/02/09 02:05:27 xorgcvs Exp $ */ /* diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index d2312aaef..2eba16a4e 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -1,4 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/render/render.c,v 1.12 2005/08/28 19:47:39 ajax Exp $ */ /* * $XFree86: xc/programs/Xserver/render/render.c,v 1.27tsi Exp $ * diff --git a/nx-X11/programs/Xserver/xkb/ddxBeep.c b/nx-X11/programs/Xserver/xkb/ddxBeep.c index d2bd0c90e..613d3ba70 100644 --- a/nx-X11/programs/Xserver/xkb/ddxBeep.c +++ b/nx-X11/programs/Xserver/xkb/ddxBeep.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxBeep.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxBeep.c,v 3.9 2002/12/05 21:59:00 paulo Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxConfig.c b/nx-X11/programs/Xserver/xkb/ddxConfig.c index 81797839e..aff14e2c7 100644 --- a/nx-X11/programs/Xserver/xkb/ddxConfig.c +++ b/nx-X11/programs/Xserver/xkb/ddxConfig.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxConfig.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxConfig.c,v 3.8 2002/12/20 20:18:35 paulo Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxCtrls.c b/nx-X11/programs/Xserver/xkb/ddxCtrls.c index a6c0878cb..62da4950f 100644 --- a/nx-X11/programs/Xserver/xkb/ddxCtrls.c +++ b/nx-X11/programs/Xserver/xkb/ddxCtrls.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxCtrls.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxCtrls.c,v 1.3 2001/01/17 22:37:14 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxDevBtn.c b/nx-X11/programs/Xserver/xkb/ddxDevBtn.c index 4d5d4f0ac..3698ccc1e 100644 --- a/nx-X11/programs/Xserver/xkb/ddxDevBtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxDevBtn.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxDevBtn.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxDevBtn.c,v 3.3 2001/08/23 21:49:51 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c b/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c index a599b44f6..fc42691f5 100644 --- a/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxFakeBtn.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c b/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c index 894633c3c..53ceea03b 100644 --- a/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/xkb/ddxFakeMtn.c,v 1.5 2005/07/03 07:02:09 daniels Exp $ */ -/* $Xorg: ddxFakeMtn.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -25,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxFakeMtn.c,v 1.5 2003/09/13 16:39:01 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxInit.c b/nx-X11/programs/Xserver/xkb/ddxInit.c index 675ca0d01..6f2e23001 100644 --- a/nx-X11/programs/Xserver/xkb/ddxInit.c +++ b/nx-X11/programs/Xserver/xkb/ddxInit.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxInit.c,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/programs/Xserver/xkb/ddxKeyClick.c b/nx-X11/programs/Xserver/xkb/ddxKeyClick.c index 882534bb7..c87727a0a 100644 --- a/nx-X11/programs/Xserver/xkb/ddxKeyClick.c +++ b/nx-X11/programs/Xserver/xkb/ddxKeyClick.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxKeyClick.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c b/nx-X11/programs/Xserver/xkb/ddxKillSrv.c index 91c7fe064..97495b806 100644 --- a/nx-X11/programs/Xserver/xkb/ddxKillSrv.c +++ b/nx-X11/programs/Xserver/xkb/ddxKillSrv.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxKillSrv.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxKillSrv.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxLEDs.c b/nx-X11/programs/Xserver/xkb/ddxLEDs.c index 269b9c05b..317cd1a00 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLEDs.c +++ b/nx-X11/programs/Xserver/xkb/ddxLEDs.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxLEDs.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c index b14ad308f..955111925 100644 --- a/nx-X11/programs/Xserver/xkb/ddxList.c +++ b/nx-X11/programs/Xserver/xkb/ddxList.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxList.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxList.c,v 3.8 2003/07/16 01:39:05 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c index 45140dfea..019efc4cd 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c +++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxLoad.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxLoad.c,v 3.35 2003/10/02 13:30:12 eich Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxPrivate.c b/nx-X11/programs/Xserver/xkb/ddxPrivate.c index ce09038a0..2bb082c5b 100644 --- a/nx-X11/programs/Xserver/xkb/ddxPrivate.c +++ b/nx-X11/programs/Xserver/xkb/ddxPrivate.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/xkb/ddxPrivate.c,v 1.2 2003/04/03 16:20:22 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxVT.c b/nx-X11/programs/Xserver/xkb/ddxVT.c index 4b95aa625..98dd5a43d 100644 --- a/nx-X11/programs/Xserver/xkb/ddxVT.c +++ b/nx-X11/programs/Xserver/xkb/ddxVT.c @@ -1,4 +1,3 @@ -/* $Xorg: ddxVT.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxVT.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index a58b02e00..8433aeb23 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -1,4 +1,3 @@ -/* $Xorg: xkb.c,v 1.3 2000/08/17 19:53:46 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkb.c,v 3.22tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkbAccessX.c b/nx-X11/programs/Xserver/xkb/xkbAccessX.c index 2fc5eae81..6195b0d67 100644 --- a/nx-X11/programs/Xserver/xkb/xkbAccessX.c +++ b/nx-X11/programs/Xserver/xkb/xkbAccessX.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbAccessX.c,v 1.4 2001/02/05 18:50:20 coskrey Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbAccessX.c,v 1.9 2001/08/23 14:33:25 alanh Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkbActions.c b/nx-X11/programs/Xserver/xkb/xkbActions.c index c6714ef9f..963cee5c5 100644 --- a/nx-X11/programs/Xserver/xkb/xkbActions.c +++ b/nx-X11/programs/Xserver/xkb/xkbActions.c @@ -1,5 +1,3 @@ -/* $Xorg: xkbActions.c,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */ -/* $XdotOrg: xc/programs/Xserver/xkb/xkbActions.c,v 1.7 2005/07/03 08:53:54 daniels Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -25,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbActions.c,v 3.13 2003/07/16 01:39:08 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkbDflts.h b/nx-X11/programs/Xserver/xkb/xkbDflts.h index e0b54c55b..9c99a4c70 100644 --- a/nx-X11/programs/Xserver/xkb/xkbDflts.h +++ b/nx-X11/programs/Xserver/xkb/xkbDflts.h @@ -1,5 +1,3 @@ -/* $Xorg: xkbDflts.h,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */ -/* $XFree86: xc/programs/Xserver/xkb/xkbDflts.h,v 1.2 2001/10/28 03:34:20 tsi Exp $ */ /* This file generated automatically by xkbcomp */ /* DO NOT EDIT */ #ifdef HAVE_DIX_CONFIG_H diff --git a/nx-X11/programs/Xserver/xkb/xkbEvents.c b/nx-X11/programs/Xserver/xkb/xkbEvents.c index f1089f313..dd41f67cd 100644 --- a/nx-X11/programs/Xserver/xkb/xkbEvents.c +++ b/nx-X11/programs/Xserver/xkb/xkbEvents.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbEvents.c,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbEvents.c,v 3.11 2003/07/16 01:39:10 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkbInit.c b/nx-X11/programs/Xserver/xkb/xkbInit.c index bb599984a..160afda60 100644 --- a/nx-X11/programs/Xserver/xkb/xkbInit.c +++ b/nx-X11/programs/Xserver/xkb/xkbInit.c @@ -1,5 +1,3 @@ -/* $Xorg: xkbInit.c,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */ -/* $XdotOrg: xc/programs/Xserver/xkb/xkbInit.c,v 1.9 2005/10/19 22:45:54 ajax Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -25,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbInit.c,v 3.32tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkbLEDs.c b/nx-X11/programs/Xserver/xkb/xkbLEDs.c index a9e43d87c..c3ec018cb 100644 --- a/nx-X11/programs/Xserver/xkb/xkbLEDs.c +++ b/nx-X11/programs/Xserver/xkb/xkbLEDs.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbLEDs.c,v 1.4 2001/05/10 19:54:01 steve Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbLEDs.c,v 3.7 2003/07/16 01:39:10 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c index 34bc65f8a..773698186 100644 --- a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c +++ b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbPrKeyEv.c,v 1.3 2000/08/17 19:53:48 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbPrKeyEv.c,v 3.8 2001/01/17 22:37:15 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c b/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c index e2709113a..c379c27b1 100644 --- a/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c +++ b/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbPrOtherEv.c,v 1.3 2000/08/17 19:53:48 cpqbld Exp $ */ /************************************************************ Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. diff --git a/nx-X11/programs/Xserver/xkb/xkbSwap.c b/nx-X11/programs/Xserver/xkb/xkbSwap.c index 1482c028e..1670aa80b 100644 --- a/nx-X11/programs/Xserver/xkb/xkbSwap.c +++ b/nx-X11/programs/Xserver/xkb/xkbSwap.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbSwap.c,v 1.3 2000/08/17 19:53:48 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbSwap.c,v 3.4 2003/09/13 16:39:01 dawes Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkbUtils.c b/nx-X11/programs/Xserver/xkb/xkbUtils.c index 1f1c8cf72..148fe1d66 100644 --- a/nx-X11/programs/Xserver/xkb/xkbUtils.c +++ b/nx-X11/programs/Xserver/xkb/xkbUtils.c @@ -1,4 +1,3 @@ -/* $Xorg: xkbUtils.c,v 1.3 2000/08/17 19:53:48 cpqbld Exp $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -24,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbUtils.c,v 3.16 2003/11/03 05:12:02 tsi Exp $ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/registry b/nx-X11/registry index 885d61bca..49177819b 100644 --- a/nx-X11/registry +++ b/nx-X11/registry @@ -1,5 +1,3 @@ -/* $Xorg: registry,v 1.7 2001/06/01 18:55:58 coskrey Exp $ */ -/* $XdotOrg: xc/registry,v 1.3 2005/09/02 23:06:40 alanc Exp $ */ X Registry @@ -1710,5 +1708,4 @@ REFERENCES [135] X.Org Foundation source implementation See Reference [8] -/* $XFree86: xc/registry,v 1.8 2003/07/09 15:27:23 tsi Exp $ */ -- cgit v1.2.3 From 75e0808006bdf80ec9deb8acc1a96fe90e6bdbd9 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan <ïonic@ionic.de> Date: Fri, 14 Oct 2016 02:31:38 +0000 Subject: nx-X11/programs/Xserver/GL/glx/Imakefile: typo fix, leading to glcontextmodes.c not being compiled. The typo didn't cause immediate problems. --- nx-X11/programs/Xserver/GL/glx/Imakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile index 24a35d22e..65a28352a 100644 --- a/nx-X11/programs/Xserver/GL/glx/Imakefile +++ b/nx-X11/programs/Xserver/GL/glx/Imakefile @@ -63,7 +63,7 @@ NXAGENT_SKIP_OBJS = \ g_renderswap.c \ g_single.c \ g_singleswap.c \ - glcontextmodes. c \ + glcontextmodes.c \ indirect_size.c \ $(MSRCS) \ $(NXAGENT_SKIP_SRCS) \ -- cgit v1.2.3 From fcf61d3411bc1868e53305a3777f4bcaab3eb4bd Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 29 Oct 2016 15:30:20 +0200 Subject: Imakefile cleanup: Delete all ancient Vcs comments stemming from SVN times of X.org and XFree86. Fixes ArcticaProject/nx-libs#250. --- nx-X11/config/Imakefile | 2 -- nx-X11/config/cf/Imake.cf | 3 --- nx-X11/config/cf/Imake.rules | 8 +------- nx-X11/config/cf/Imake.tmpl | 7 ------- nx-X11/config/cf/Imakefile | 3 --- nx-X11/config/cf/Library.tmpl | 7 ------- nx-X11/config/cf/README | 7 ------- nx-X11/config/cf/Server.tmpl | 3 --- nx-X11/config/cf/ServerLib.tmpl | 1 - nx-X11/config/cf/Threads.tmpl | 6 ------ nx-X11/config/cf/X11.rules | 5 ----- nx-X11/config/cf/X11.tmpl | 8 +------- nx-X11/config/cf/cross.rules | 2 -- nx-X11/config/cf/linux.cf | 9 --------- nx-X11/config/cf/lnxLib.rules | 3 --- nx-X11/config/cf/lnxLib.tmpl | 3 --- nx-X11/config/cf/site.def | 3 --- nx-X11/config/cf/xf86.rules | 7 ------- nx-X11/config/cf/xorg.cf | 2 -- nx-X11/config/cf/xorg.tmpl | 3 --- nx-X11/config/cf/xorgsite.def | 1 - nx-X11/include/GL/Imakefile | 2 -- nx-X11/include/Imakefile | 3 --- nx-X11/include/extensions/Imakefile | 8 -------- nx-X11/lib/Imakefile | 8 -------- nx-X11/lib/X11/xlibi18n/im/Imakefile | 1 - nx-X11/lib/X11/xlibi18n/im/ximcp/Imakefile | 1 - nx-X11/lib/X11/xlibi18n/lc/Imakefile | 1 - nx-X11/lib/X11/xlibi18n/lc/Utf8/Imakefile | 1 - nx-X11/lib/X11/xlibi18n/lc/def/Imakefile | 1 - nx-X11/lib/X11/xlibi18n/lc/gen/Imakefile | 1 - nx-X11/lib/X11/xlibi18n/om/Imakefile | 1 - nx-X11/lib/xtrans/Imakefile | 2 -- nx-X11/programs/Xserver/GL/Imakefile | 2 -- nx-X11/programs/Xserver/GL/glx/Imakefile | 2 -- nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile | 2 -- nx-X11/programs/Xserver/GL/mesa/Imakefile | 2 -- nx-X11/programs/Xserver/GL/mesa/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/X/Imakefile | 2 -- nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile | 2 -- nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/main/Imakefile | 3 --- nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/math/Imakefile | 2 -- nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc | 2 -- .../programs/Xserver/GL/mesa/shader/slang/library/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile | 2 -- nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile | 2 -- nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc | 2 -- nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile | 3 --- nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc | 2 -- nx-X11/programs/Xserver/Imakefile | 1 - nx-X11/programs/Xserver/Xext/extmod/Imakefile | 3 --- nx-X11/programs/Xserver/Xi/Imakefile | 7 ------- nx-X11/programs/Xserver/dbe/Imakefile | 7 ------- nx-X11/programs/Xserver/dbe/module/Imakefile | 4 ---- nx-X11/programs/Xserver/dix/Imakefile | 3 --- nx-X11/programs/Xserver/fb/Imakefile | 5 ----- nx-X11/programs/Xserver/fb/module/Imakefile | 2 -- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 2 -- nx-X11/programs/Xserver/include/Imakefile | 7 ------- nx-X11/programs/Xserver/record/Imakefile | 3 --- nx-X11/programs/Xserver/record/module/Imakefile | 5 ----- nx-X11/programs/Xserver/render/Imakefile | 2 -- nx-X11/programs/Xserver/xkb/Imakefile | 7 ------- 70 files changed, 2 insertions(+), 227 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/config/Imakefile b/nx-X11/config/Imakefile index 305b87107..1cf85aac8 100644 --- a/nx-X11/config/Imakefile +++ b/nx-X11/config/Imakefile @@ -1,5 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:41:45 cpqbld Exp $ -XCOMM $XFree86: xc/config/Imakefile,v 1.3 2001/01/17 16:22:29 dawes Exp $ #define IHaveSubdirs #define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" diff --git a/nx-X11/config/cf/Imake.cf b/nx-X11/config/cf/Imake.cf index 76e4664aa..8decfdc3c 100644 --- a/nx-X11/config/cf/Imake.cf +++ b/nx-X11/config/cf/Imake.cf @@ -1,5 +1,3 @@ -XCOMM $XdotOrg: xc/config/cf/Imake.cf,v 1.12 2005/11/08 06:33:24 jkj Exp $ -XCOMM $Xorg: Imake.cf,v 1.4 2000/08/17 19:41:45 cpqbld Exp $ /* * To add support for another platform: * @@ -18,7 +16,6 @@ XCOMM $Xorg: Imake.cf,v 1.4 2000/08/17 19:41:45 cpqbld Exp $ * * 4. Create a .cf file with the name given by MacroFile. */ -XCOMM $XFree86: xc/config/cf/Imake.cf,v 3.88 2003/12/16 21:30:21 herrb Exp $ #if defined(__APPLE__) # undef __APPLE__ diff --git a/nx-X11/config/cf/Imake.rules b/nx-X11/config/cf/Imake.rules index 7fffe5e31..fb6df65ce 100644 --- a/nx-X11/config/cf/Imake.rules +++ b/nx-X11/config/cf/Imake.rules @@ -1,12 +1,6 @@ XCOMM --------------------------------------------------------------------- XCOMM Imake rules for building libraries, programs, scripts, and data files -XCOMM rules: $Xorg: Imake.rules,v 1.3 2000/08/17 19:41:46 cpqbld Exp $ -XCOMM rules: $XdotOrg: xc/config/cf/Imake.rules,v 1.11 2005/11/08 06:33:24 jkj Exp $ -XCOMM -XCOMM -XCOMM -XCOMM -XCOMM rules: $XFree86: xc/config/cf/Imake.rules,v 3.128 2003/11/15 03:25:17 dawes Exp $ +XCOMM --------------------------------------------------------------------- /* * MACHINE-INDEPENDENT RULES; DO NOT MODIFY diff --git a/nx-X11/config/cf/Imake.tmpl b/nx-X11/config/cf/Imake.tmpl index 7ddd6d936..0545f1094 100644 --- a/nx-X11/config/cf/Imake.tmpl +++ b/nx-X11/config/cf/Imake.tmpl @@ -1,12 +1,5 @@ XCOMM ---------------------------------------------------------------------- XCOMM Makefile generated from IMAKE_TEMPLATE and INCLUDE_IMAKEFILE -XCOMM $Xorg: Imake.tmpl,v 1.4 2000/08/17 19:41:46 cpqbld Exp $ -XCOMM $XdotOrg: xc/config/cf/Imake.tmpl,v 1.16 2005/11/08 06:33:24 jkj Exp $ -XCOMM -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/config/cf/Imake.tmpl,v 3.155 2003/12/24 18:58:41 dickey Exp $ XCOMM ---------------------------------------------------------------------- /* diff --git a/nx-X11/config/cf/Imakefile b/nx-X11/config/cf/Imakefile index a36adf323..714a865c9 100644 --- a/nx-X11/config/cf/Imakefile +++ b/nx-X11/config/cf/Imakefile @@ -1,6 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:41:46 cpqbld Exp $ -XCOMM $XFree86: xc/config/cf/Imakefile,v 3.29 2002/10/16 14:07:49 tsi Exp $ - XCOMM Some compilers generate fatal errors if an -L directory does XCOMM not exist. Since BUILDLIBDIR may not exist yet suppress its use. LDPRELIB = diff --git a/nx-X11/config/cf/Library.tmpl b/nx-X11/config/cf/Library.tmpl index 95a9207fb..a5c9dc2a3 100644 --- a/nx-X11/config/cf/Library.tmpl +++ b/nx-X11/config/cf/Library.tmpl @@ -14,13 +14,6 @@ * Define LargePICTable YES if large (32-bit) PIC tables are needed. */ -XCOMM $Xorg: Library.tmpl,v 1.3 2000/08/17 19:41:46 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/config/cf/Library.tmpl,v 3.23tsi Exp $ - #ifndef DoNormalLib #define DoNormalLib NO #endif diff --git a/nx-X11/config/cf/README b/nx-X11/config/cf/README index 75fa4767c..27c2386a4 100644 --- a/nx-X11/config/cf/README +++ b/nx-X11/config/cf/README @@ -1,10 +1,3 @@ -$Xorg: README,v 1.4 2000/08/18 04:03:58 coskrey Exp $ - - - - -$XFree86: xc/config/cf/README,v 1.20 2003/04/14 20:35:50 herrb Exp $ - The easiest way to write an Imakefile is to find another one that does something similar and copy/modify it! diff --git a/nx-X11/config/cf/Server.tmpl b/nx-X11/config/cf/Server.tmpl index 3ada3087b..ffdca6811 100644 --- a/nx-X11/config/cf/Server.tmpl +++ b/nx-X11/config/cf/Server.tmpl @@ -1,11 +1,8 @@ -XCOMM $XFree86: xc/config/cf/Server.tmpl,v 3.20 2002/11/20 04:32:55 dawes Exp $ /* * Server imakefile info - this contains any special redefinitions, etc. * that Imakefiles in the server subtree will need. */ -XCOMM $Xorg: Server.tmpl,v 1.3 2000/08/17 19:41:46 cpqbld Exp $ - #define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" LDSTRIPFLAGS="$(LDSTRIPFLAGS)" #ifndef ServerCcCmd diff --git a/nx-X11/config/cf/ServerLib.tmpl b/nx-X11/config/cf/ServerLib.tmpl index 18a76746d..66c83b83d 100644 --- a/nx-X11/config/cf/ServerLib.tmpl +++ b/nx-X11/config/cf/ServerLib.tmpl @@ -1,4 +1,3 @@ -XCOMM $XFree86: xc/config/cf/ServerLib.tmpl,v 3.0tsi Exp $ /* * Server Library imakefile info - this contains any special * redefinitions, etc. that Imakefiles in the various server library diff --git a/nx-X11/config/cf/Threads.tmpl b/nx-X11/config/cf/Threads.tmpl index bb0a7e805..d2d6f6d1c 100644 --- a/nx-X11/config/cf/Threads.tmpl +++ b/nx-X11/config/cf/Threads.tmpl @@ -1,9 +1,3 @@ -XCOMM $Xorg: Threads.tmpl,v 1.3 2000/08/17 19:41:46 cpqbld Exp $ - - - -XCOMM $XFree86: xc/config/cf/Threads.tmpl,v 3.3tsi Exp $ - /* * For a multi-threaded application or library, * Define LocalThreadsDefines in your Imakefile (unless you like the diff --git a/nx-X11/config/cf/X11.rules b/nx-X11/config/cf/X11.rules index 51ae38c7d..0f6a67ed4 100644 --- a/nx-X11/config/cf/X11.rules +++ b/nx-X11/config/cf/X11.rules @@ -1,8 +1,3 @@ -XCOMM $Xorg: X11.rules,v 1.4 2000/08/17 19:41:46 cpqbld Exp $ - - -XCOMM $XFree86: xc/config/cf/X11.rules,v 1.6 2001/01/17 16:22:31 dawes Exp $ - /* Note whether we are the top level project. */ #ifndef SeenTopLevelProject # define SeenTopLevelProject YES diff --git a/nx-X11/config/cf/X11.tmpl b/nx-X11/config/cf/X11.tmpl index 45a383935..33d108d06 100644 --- a/nx-X11/config/cf/X11.tmpl +++ b/nx-X11/config/cf/X11.tmpl @@ -1,12 +1,6 @@ XCOMM ---------------------------------------------------------------------- XCOMM X Window System Build Parameters and Rules -XCOMM $XdotOrg: xc/config/cf/X11.tmpl,v 1.54 2005/12/14 23:41:52 alanc Exp $ -XCOMM $Xorg: X11.tmpl,v 1.6 2000/08/17 19:41:46 cpqbld Exp $ -XCOMM -XCOMM -XCOMM -XCOMM -XCOMM $XFree86: xc/config/cf/X11.tmpl,v 1.248 2004/02/16 04:07:37 dawes Exp $ +XCOMM ---------------------------------------------------------------------- /*************************************************************************** * * diff --git a/nx-X11/config/cf/cross.rules b/nx-X11/config/cf/cross.rules index da02643af..fe8d119ab 100644 --- a/nx-X11/config/cf/cross.rules +++ b/nx-X11/config/cf/cross.rules @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/config/cf/cross.rules,v 1.7 2002/04/04 14:05:33 eich Exp $ - #ifndef HostCcCmd #define HostCcCmd cc #endif diff --git a/nx-X11/config/cf/linux.cf b/nx-X11/config/cf/linux.cf index 37be61534..085984165 100644 --- a/nx-X11/config/cf/linux.cf +++ b/nx-X11/config/cf/linux.cf @@ -1,12 +1,3 @@ -XCOMM $XdotOrg: xc/config/cf/linux.cf,v 1.31 2005/10/21 19:10:27 ajax Exp $ -XCOMM platform: $Xorg: linux.cf,v 1.3 2000/08/17 19:41:47 cpqbld Exp $ - - - - - -XCOMM platform: $XFree86: xc/config/cf/linux.cf,v 3.220 2003/12/30 22:38:33 tsi Exp $ - #ifndef LinuxElfDefault # define LinuxElfDefault YES #endif diff --git a/nx-X11/config/cf/lnxLib.rules b/nx-X11/config/cf/lnxLib.rules index b8a67e2b7..166e896f1 100644 --- a/nx-X11/config/cf/lnxLib.rules +++ b/nx-X11/config/cf/lnxLib.rules @@ -1,6 +1,3 @@ -XCOMM $Xorg: lnxLib.rules,v 1.3 2000/08/17 19:41:47 cpqbld Exp $ -XCOMM $XFree86: xc/config/cf/lnxLib.rules,v 3.52 2003/10/31 20:49:03 herrb Exp $ - /* * Linux shared library rules (DLL & ELF versions) */ diff --git a/nx-X11/config/cf/lnxLib.tmpl b/nx-X11/config/cf/lnxLib.tmpl index a6e7f48d3..6748579cf 100644 --- a/nx-X11/config/cf/lnxLib.tmpl +++ b/nx-X11/config/cf/lnxLib.tmpl @@ -1,6 +1,3 @@ -XCOMM $Xorg: lnxLib.tmpl,v 1.3 2000/08/17 19:41:47 cpqbld Exp $ -XCOMM $XFree86: xc/config/cf/lnxLib.tmpl,v 3.19 2003/10/15 22:47:48 herrb Exp $ - /* * Linux shared library template */ diff --git a/nx-X11/config/cf/site.def b/nx-X11/config/cf/site.def index 7f2053cb2..f5e769278 100644 --- a/nx-X11/config/cf/site.def +++ b/nx-X11/config/cf/site.def @@ -1,5 +1,3 @@ -XCOMM site: $TOG: site.sample /main/r64_final/1 1998/02/05 16:28:49 kaleb $ - /*************************************************************************** * * * SITE-SPECIFIC DEFINITIONS * @@ -21,7 +19,6 @@ XCOMM site: $TOG: site.sample /main/r64_final/1 1998/02/05 16:28:49 kaleb $ * .cf file, not overridden in site.def. * * * ***************************************************************************/ -XCOMM site: $XFree86: xc/config/cf/site.def,v 3.24 2000/06/25 20:17:29 dawes Exp $ /* if you want host-specific customization, this is one way to do it */ /* diff --git a/nx-X11/config/cf/xf86.rules b/nx-X11/config/cf/xf86.rules index 3c69445f4..12125fb9b 100644 --- a/nx-X11/config/cf/xf86.rules +++ b/nx-X11/config/cf/xf86.rules @@ -1,10 +1,3 @@ -XCOMM $Xorg: xf86.rules,v 1.3 2000/08/17 19:41:48 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/config/cf/xf86.rules,v 3.34tsi Exp $ - /* * Rules needed to build the XFree86 X Servers */ diff --git a/nx-X11/config/cf/xorg.cf b/nx-X11/config/cf/xorg.cf index 5ed60e491..f967796f0 100644 --- a/nx-X11/config/cf/xorg.cf +++ b/nx-X11/config/cf/xorg.cf @@ -1,4 +1,3 @@ -XCOMM $XdotOrg: xc/config/cf/xorg.cf,v 1.53 2005/10/03 16:08:44 alanc Exp $ /* * This configuration file contains all of the configuration * information for the Xorg based X Servers. @@ -6,7 +5,6 @@ XCOMM $XdotOrg: xc/config/cf/xorg.cf,v 1.53 2005/10/03 16:08:44 alanc Exp $ * Most of these settings can be overridden in a vendor.cf or the * BeforeVendor part of the site.def file. */ -XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ /* Get and set version information. */ diff --git a/nx-X11/config/cf/xorg.tmpl b/nx-X11/config/cf/xorg.tmpl index a1703b56b..c5f332b3a 100644 --- a/nx-X11/config/cf/xorg.tmpl +++ b/nx-X11/config/cf/xorg.tmpl @@ -1,6 +1,3 @@ -XCOMM $Xorg: xf86.tmpl,v 1.3 2000/08/17 19:41:48 cpqbld Exp $ -XCOMM $XdotOrg: xc/config/cf/xorg.tmpl,v 1.5 2005/11/08 06:33:24 jkj Exp $ - #ifndef ConfigDefines # define ConfigDefines -D__XCONFIGFILE__='"$(XCONFIGFILE)"' \ -D__XCONFIGDIR__='"$(XCONFIGDIR)"' -D__XLOGFILE__='"$(XLOGFILE)"' \ diff --git a/nx-X11/config/cf/xorgsite.def b/nx-X11/config/cf/xorgsite.def index 18fd96dbe..f28bb2b2e 100644 --- a/nx-X11/config/cf/xorgsite.def +++ b/nx-X11/config/cf/xorgsite.def @@ -1,4 +1,3 @@ -XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $ /******************************************************************************/ /* * This file is to provide a quick method for most people to change the diff --git a/nx-X11/include/GL/Imakefile b/nx-X11/include/GL/Imakefile index 4905f7ee6..8719813e2 100644 --- a/nx-X11/include/GL/Imakefile +++ b/nx-X11/include/GL/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/include/GL/Imakefile,v 1.13 2001/04/30 14:58:48 dawes Exp $ - LinkSourceFile(gl.h, $(MESASRCDIR)/include/GL) LinkSourceFile(glext.h, $(MESASRCDIR)/include/GL) LinkSourceFile(glxext.h, $(MESASRCDIR)/include/GL) diff --git a/nx-X11/include/Imakefile b/nx-X11/include/Imakefile index 8b5bd356f..9d43fb53f 100644 --- a/nx-X11/include/Imakefile +++ b/nx-X11/include/Imakefile @@ -1,6 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/18 04:05:43 coskrey Exp $ -XCOMM $XFree86: xc/include/Imakefile,v 3.28 2001/04/28 23:52:31 dawes Exp $ - NULL = #define IHaveSubdirs diff --git a/nx-X11/include/extensions/Imakefile b/nx-X11/include/extensions/Imakefile index 2d8f63494..ad80e5299 100644 --- a/nx-X11/include/extensions/Imakefile +++ b/nx-X11/include/extensions/Imakefile @@ -1,11 +1,3 @@ -XCOMM $XdotOrg: xc/include/extensions/Imakefile,v 1.12 2004/11/24 02:45:33 krh Exp $ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/18 04:05:44 coskrey Exp $ - - - - -XCOMM $XFree86: xc/include/extensions/Imakefile,v 3.55 2003/04/21 12:32:06 sven Exp $ - NULL = #if BuildScreenSaverExt diff --git a/nx-X11/lib/Imakefile b/nx-X11/lib/Imakefile index 4615b8932..1d11c977b 100644 --- a/nx-X11/lib/Imakefile +++ b/nx-X11/lib/Imakefile @@ -1,11 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:44:00 cpqbld Exp $ -XCOMM $XdotOrg: xc/lib/Imakefile,v 1.12 2005/10/10 04:18:08 alanc Exp $ - - - - -XCOMM $XFree86: xc/lib/Imakefile,v 3.74 2003/04/14 20:37:07 herrb Exp $ - #define IHaveSubdirs #define PassCDebugFlags diff --git a/nx-X11/lib/X11/xlibi18n/im/Imakefile b/nx-X11/lib/X11/xlibi18n/im/Imakefile index 3c638b1a8..8e0816cb9 100644 --- a/nx-X11/lib/X11/xlibi18n/im/Imakefile +++ b/nx-X11/lib/X11/xlibi18n/im/Imakefile @@ -1,4 +1,3 @@ -XCOMM $XConsortium: Imakefile,v 1.27 94/04/07 15:01:48 rws Exp $ #define IHaveSubdirs #define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" diff --git a/nx-X11/lib/X11/xlibi18n/im/ximcp/Imakefile b/nx-X11/lib/X11/xlibi18n/im/ximcp/Imakefile index 9919e6df3..881f25f87 100644 --- a/nx-X11/lib/X11/xlibi18n/im/ximcp/Imakefile +++ b/nx-X11/lib/X11/xlibi18n/im/ximcp/Imakefile @@ -1,4 +1,3 @@ - #include "../../Xi18nLib.conf" EXTRA_INCLUDES = -I../../.. diff --git a/nx-X11/lib/X11/xlibi18n/lc/Imakefile b/nx-X11/lib/X11/xlibi18n/lc/Imakefile index 16f7aceb3..d3beed642 100644 --- a/nx-X11/lib/X11/xlibi18n/lc/Imakefile +++ b/nx-X11/lib/X11/xlibi18n/lc/Imakefile @@ -1,4 +1,3 @@ -XCOMM $XConsortium: Imakefile,v 1.27 94/04/07 15:01:48 rws Exp $ #define IHaveSubdirs #define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" diff --git a/nx-X11/lib/X11/xlibi18n/lc/Utf8/Imakefile b/nx-X11/lib/X11/xlibi18n/lc/Utf8/Imakefile index 46e402ba6..416151fda 100644 --- a/nx-X11/lib/X11/xlibi18n/lc/Utf8/Imakefile +++ b/nx-X11/lib/X11/xlibi18n/lc/Utf8/Imakefile @@ -1,4 +1,3 @@ - #include "../../Xi18nLib.conf" EXTRA_INCLUDES = -I../../.. diff --git a/nx-X11/lib/X11/xlibi18n/lc/def/Imakefile b/nx-X11/lib/X11/xlibi18n/lc/def/Imakefile index 614ca582f..1ef2d85c7 100644 --- a/nx-X11/lib/X11/xlibi18n/lc/def/Imakefile +++ b/nx-X11/lib/X11/xlibi18n/lc/def/Imakefile @@ -1,4 +1,3 @@ - #include "../../Xi18nLib.conf" EXTRA_INCLUDES = -I../../.. diff --git a/nx-X11/lib/X11/xlibi18n/lc/gen/Imakefile b/nx-X11/lib/X11/xlibi18n/lc/gen/Imakefile index ffd66ad0b..886832805 100644 --- a/nx-X11/lib/X11/xlibi18n/lc/gen/Imakefile +++ b/nx-X11/lib/X11/xlibi18n/lc/gen/Imakefile @@ -1,4 +1,3 @@ - #include "../../Xi18nLib.conf" EXTRA_INCLUDES = -I../../.. diff --git a/nx-X11/lib/X11/xlibi18n/om/Imakefile b/nx-X11/lib/X11/xlibi18n/om/Imakefile index fc8335e9a..e02f7624e 100644 --- a/nx-X11/lib/X11/xlibi18n/om/Imakefile +++ b/nx-X11/lib/X11/xlibi18n/om/Imakefile @@ -1,4 +1,3 @@ -XCOMM $XConsortium: Imakefile,v 1.27 94/04/07 15:01:48 rws Exp $ #define IHaveSubdirs #define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" diff --git a/nx-X11/lib/xtrans/Imakefile b/nx-X11/lib/xtrans/Imakefile index 2cc880c39..b4b36685d 100644 --- a/nx-X11/lib/xtrans/Imakefile +++ b/nx-X11/lib/xtrans/Imakefile @@ -1,5 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:46:44 cpqbld Exp $ - #define IncSubdir nx-X11 all:: diff --git a/nx-X11/programs/Xserver/GL/Imakefile b/nx-X11/programs/Xserver/GL/Imakefile index c681d23e0..48059b4dd 100644 --- a/nx-X11/programs/Xserver/GL/Imakefile +++ b/nx-X11/programs/Xserver/GL/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/Imakefile,v 1.12 2003/08/06 14:04:01 eich Exp $ - #define IHaveModules #include diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile index 65a28352a..7658ea4cf 100644 --- a/nx-X11/programs/Xserver/GL/glx/Imakefile +++ b/nx-X11/programs/Xserver/GL/glx/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/glx/Imakefile,v 1.11 2004/01/28 18:11:50 alanh Exp $ - NULL = #if DoLoadableServer diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile index e3e91cdb5..698cba2d9 100644 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/GLcore/Imakefile,v 1.3 2002/05/31 18:12:36 dawes Exp $ - #if DoLoadableServer #define IHaveModules #endif diff --git a/nx-X11/programs/Xserver/GL/mesa/Imakefile b/nx-X11/programs/Xserver/GL/mesa/Imakefile index 41acce9f4..7f9b5191c 100644 --- a/nx-X11/programs/Xserver/GL/mesa/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/Imakefile,v 1.23 2002/11/22 22:56:00 tsi Exp $ - #if DoLoadableServer #define IHaveModules #endif diff --git a/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc index 99e9c71c2..1bff5782e 100644 --- a/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ - MESABUILDDIR = MesaBuildDir COREMESASRCS = $(COREMESABASESRCS) \ diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile index 9fb00ef73..c8ea2ab72 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/Imakefile,v 1.16 2002/11/22 22:56:01 tsi Exp $ - #if DoLoadableServer #define IHaveModules #endif diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc index 8e589c69a..67eaf7804 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/X/Imakefile.inc,v 1.3tsi Exp $ - MESAXBUILDDIR = MesaXBuildDir #ifndef MesaInXServer diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile index 188972b3b..548c6adb0 100644 --- a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/array_cache/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ - #if DoLoadableServer #define IHaveModules #endif diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc index 3964bdc48..39f6e2400 100644 --- a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/array_cache/Imakefile.inc,v 1.1tsi Exp $ - MESAACBUILDDIR = MesaACBuildDir MESA_AC_SRCS = $(MESAACBUILDDIR)ac_context.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile index 2dd59ea8f..ff95bd187 100644 --- a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile @@ -1,6 +1,3 @@ -XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/main/Imakefile,v 1.2 2004/08/19 07:34:43 kem Exp $ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ - #if DoLoadableServer #define IHaveModules #endif diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc index 8927152aa..3e98f9149 100644 --- a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile.inc,v 1.7tsi Exp $ - /* gcc on ppc64 defines this, causes macro recursion with pixel below */ #undef pixel diff --git a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile index df30ab909..77e7f7664 100644 --- a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ - #if DoLoadableServer #define IHaveModules #endif diff --git a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc index 7356a4617..bc9a1f326 100644 --- a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/math/Imakefile.inc,v 1.1tsi Exp $ - MESAMATHBUILDDIR = MesaMathBuildDir MESA_MATH_SRCS = $(MESAMATHBUILDDIR)m_debug_clip.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc index 383bdc008..185103996 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86:$ - MESASHADERBUILDDIR = MesaShaderBuildDir MESA_SHADER_SRCS = $(MESASHADERBUILDDIR)arbprogparse.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc index e1196201d..4f91af9c1 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86$ - MESAGRAMMARBUILDDIR=MesaGrammarBuildDir MESA_GRAMMAR_SRCS = $(MESAGRAMMARBUILDDIR)grammar_mesa.c diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc index 4358b8975..4ffa7805f 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86$ - MESASLANGBUILDDIR=MesaSlangBuildDir MESA_SLANG_SRCS = $(MESASLANGBUILDDIR)slang_assemble_assignment.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile.inc index 3489b7a28..06b530063 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86:$ - #ifdef NeedToLinkMesaSrc LinkSourceFile(slang_common_builtin_gc_bin.h, $(MESASRCDIR)/src/mesa/shader/slang/library) LinkSourceFile(slang_common_builtin_gc.h, $(MESASRCDIR)/src/mesa/shader/slang/library) diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile index c4c55a86f..bf4df7b4a 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ - #if DoLoadableServer #define IHaveModules #endif diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc index c57416d85..f573098c1 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/swrast/Imakefile.inc,v 1.1tsi Exp $ - MESASWRASTBUILDDIR = MesaSwrastBuildDir MESA_SWRAST_SRCS = $(MESASWRASTBUILDDIR)s_aaline.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile index 52be70141..ca29177a0 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/swrast_setup/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $ - #if DoLoadableServer #define IHaveModules #endif diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc index 4fb10763a..567ad65b8 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/swrast_setup/Imakefile.inc,v 1.1tsi Exp $ - MESASWRSETUPDIR = MesaSwrastSetupBuildDir MESA_SWR_SETUP_SRCS = $(MESASWRSETUPDIR)ss_context.c \ diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile index 3f1c4bbc5..2fec2d03f 100644 --- a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile @@ -1,6 +1,3 @@ -XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/tnl/Imakefile,v 1.2 2004/08/19 07:34:44 kem Exp $ -XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/tnl/Imakefile,v 1.8 2002/11/22 22:56:02 tsi Exp $ - #if DoLoadableServer #define IHaveModules #endif diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc index 3a124c195..a6c8f923e 100644 --- a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile.inc @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/tnl/Imakefile.inc,v 1.1tsi Exp $ - MESATNLBUILDDIR = MesaTnlBuildDir MESA_TNL_SRCS = $(MESATNLBUILDDIR)t_array_api.c \ diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index 20324dd13..ae11a18c2 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -26,7 +26,6 @@ /* * Server Master Makefile */ -XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.296 2003/11/23 06:47:00 torrey Exp $ #include diff --git a/nx-X11/programs/Xserver/Xext/extmod/Imakefile b/nx-X11/programs/Xserver/Xext/extmod/Imakefile index f5aceb507..0105cf775 100644 --- a/nx-X11/programs/Xserver/Xext/extmod/Imakefile +++ b/nx-X11/programs/Xserver/Xext/extmod/Imakefile @@ -1,6 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/Xext/extmod/Imakefile,v 1.21 2001/03/05 04:51:56 mvojkovi Exp $ -XCOMM This directory is only entered if DoLoadableServer is set - #define IHaveModules #include diff --git a/nx-X11/programs/Xserver/Xi/Imakefile b/nx-X11/programs/Xserver/Xi/Imakefile index b40f0d06b..746e57eaa 100644 --- a/nx-X11/programs/Xserver/Xi/Imakefile +++ b/nx-X11/programs/Xserver/Xi/Imakefile @@ -1,10 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:59 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/Xi/Imakefile,v 3.2 1999/04/17 09:08:22 dawes Exp $ - #include SRCS = allowev.c \ diff --git a/nx-X11/programs/Xserver/dbe/Imakefile b/nx-X11/programs/Xserver/dbe/Imakefile index 5e5eac4a1..4e03a03ad 100644 --- a/nx-X11/programs/Xserver/dbe/Imakefile +++ b/nx-X11/programs/Xserver/dbe/Imakefile @@ -1,10 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/dbe/Imakefile,v 3.10 2001/01/17 22:36:41 dawes Exp $ - #if DoLoadableServer #define IHaveSubdirs #endif diff --git a/nx-X11/programs/Xserver/dbe/module/Imakefile b/nx-X11/programs/Xserver/dbe/module/Imakefile index a2a4c6144..8b099e844 100644 --- a/nx-X11/programs/Xserver/dbe/module/Imakefile +++ b/nx-X11/programs/Xserver/dbe/module/Imakefile @@ -1,7 +1,3 @@ -XCOMM $XConsortium: Imakefile /main/2 1996/09/28 17:06:40 rws $ - -XCOMM $XFree86: xc/programs/Xserver/dbe/module/Imakefile,v 1.1 2000/04/06 15:35:03 dawes Exp $ - #define IHaveModules #include diff --git a/nx-X11/programs/Xserver/dix/Imakefile b/nx-X11/programs/Xserver/dix/Imakefile index fb67cb65b..7acd1b45c 100644 --- a/nx-X11/programs/Xserver/dix/Imakefile +++ b/nx-X11/programs/Xserver/dix/Imakefile @@ -1,6 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ -XCOMM $XFree86: xc/programs/Xserver/dix/Imakefile,v 3.17 2003/04/15 18:30:43 alanh Exp $ - NULL = #include diff --git a/nx-X11/programs/Xserver/fb/Imakefile b/nx-X11/programs/Xserver/fb/Imakefile index b5e8d590f..43960fc98 100644 --- a/nx-X11/programs/Xserver/fb/Imakefile +++ b/nx-X11/programs/Xserver/fb/Imakefile @@ -1,8 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/fb/Imakefile,v 1.16 2002/05/31 16:12:17 dawes Exp $ -XCOMM -XCOMM -XCOMM Id: Imakefile,v 1.1 1999/11/02 03:54:44 keithp Exp $ - /* * The X.org 6.8.99.16 snapshot fails to compile with GCC 4. * Temporarily disable the MMX features until the bug is diff --git a/nx-X11/programs/Xserver/fb/module/Imakefile b/nx-X11/programs/Xserver/fb/module/Imakefile index bea44f4e8..d063bc28d 100644 --- a/nx-X11/programs/Xserver/fb/module/Imakefile +++ b/nx-X11/programs/Xserver/fb/module/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/cfb/module/Imakefile,v 1.1 2002/05/31 15:12:56 dawes Exp $ - #define IHaveModules #define LinkDirectory .. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 905bfa92f..d4404356b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -1,5 +1,3 @@ -# XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ - #include #ifdef OS2Architecture diff --git a/nx-X11/programs/Xserver/include/Imakefile b/nx-X11/programs/Xserver/include/Imakefile index 0a64fff0c..03c389989 100644 --- a/nx-X11/programs/Xserver/include/Imakefile +++ b/nx-X11/programs/Xserver/include/Imakefile @@ -1,10 +1,3 @@ -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) \ diff --git a/nx-X11/programs/Xserver/record/Imakefile b/nx-X11/programs/Xserver/record/Imakefile index cabcd558d..fc74ec4da 100644 --- a/nx-X11/programs/Xserver/record/Imakefile +++ b/nx-X11/programs/Xserver/record/Imakefile @@ -1,6 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ -XCOMM $XFree86: xc/programs/Xserver/record/Imakefile,v 1.12 2001/11/02 23:29:34 dawes Exp $ - NULL = #if DoLoadableServer diff --git a/nx-X11/programs/Xserver/record/module/Imakefile b/nx-X11/programs/Xserver/record/module/Imakefile index 1a9aa1fee..fd78192fb 100644 --- a/nx-X11/programs/Xserver/record/module/Imakefile +++ b/nx-X11/programs/Xserver/record/module/Imakefile @@ -1,8 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/record/module/Imakefile,v 1.1 2000/04/05 18:14:03 dawes Exp $ -XCOMM -XCOMM -XCOMM $XConsortium: Imakefile /main/3 1996/09/28 17:15:43 rws $ - #define IHaveModules #include diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 6c3a7880c..0fe78340d 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 keithp Exp $ - NULL = #include diff --git a/nx-X11/programs/Xserver/xkb/Imakefile b/nx-X11/programs/Xserver/xkb/Imakefile index 4b5280f80..1417cbc3f 100644 --- a/nx-X11/programs/Xserver/xkb/Imakefile +++ b/nx-X11/programs/Xserver/xkb/Imakefile @@ -1,10 +1,3 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:45 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/xkb/Imakefile,v 3.21 2002/12/09 23:00:42 dawes Exp $ - #define SGIHyperOpt #include -- cgit v1.2.3 From 96c9aafd6bf6d09ce2e98a77685f5e25b9009e35 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 29 Oct 2016 22:52:53 +0200 Subject: Imake: drop DoLoadableServer, MakeDllModules and IHaveModules We do not build loadable modules, so we do not need them anywhere. Also remove the extra files requires for module builds. --- nx-X11/config/cf/Imake.rules | 37 - nx-X11/config/cf/Imake.tmpl | 6 - nx-X11/config/cf/host.def | 17 - nx-X11/config/cf/linux.cf | 17 - nx-X11/config/cf/xf86.rules | 95 -- nx-X11/config/cf/xorg.cf | 24 - nx-X11/config/cf/xorg.tmpl | 75 -- nx-X11/config/cf/xorgsite.def | 17 - nx-X11/programs/Xserver/GL/Imakefile | 4 - nx-X11/programs/Xserver/GL/glx/Imakefile | 13 - nx-X11/programs/Xserver/GL/glxmodule.c | 1269 -------------------- .../programs/Xserver/GL/mesa/GLcore/GLcoremodule.c | 63 - nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile | 17 - nx-X11/programs/Xserver/GL/mesa/Imakefile | 8 - nx-X11/programs/Xserver/GL/mesa/X/Imakefile | 12 - .../programs/Xserver/GL/mesa/array_cache/Imakefile | 8 - nx-X11/programs/Xserver/GL/mesa/main/Imakefile | 8 - nx-X11/programs/Xserver/GL/mesa/math/Imakefile | 8 - nx-X11/programs/Xserver/GL/mesa/shader/Imakefile | 7 - .../Xserver/GL/mesa/shader/grammar/Imakefile | 7 - .../Xserver/GL/mesa/shader/slang/Imakefile | 7 - .../Xserver/GL/mesa/shader/slang/library/Imakefile | 7 - nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile | 8 - .../Xserver/GL/mesa/swrast_setup/Imakefile | 8 - nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile | 8 - nx-X11/programs/Xserver/Imakefile | 54 +- nx-X11/programs/Xserver/Xext/Imakefile | 9 - nx-X11/programs/Xserver/Xext/xvmod.c | 23 - nx-X11/programs/Xserver/Xext/xvmodproc.h | 13 - nx-X11/programs/Xserver/dbe/Imakefile | 11 - nx-X11/programs/Xserver/dbe/dbemodule.c | 47 - nx-X11/programs/Xserver/dbe/module/Imakefile | 30 - nx-X11/programs/Xserver/fb/Imakefile | 20 - nx-X11/programs/Xserver/fb/fbmodule.c | 52 - nx-X11/programs/Xserver/fb/module/Imakefile | 4 - nx-X11/programs/Xserver/include/Imakefile | 4 - nx-X11/programs/Xserver/mi/Imakefile | 4 - nx-X11/programs/Xserver/miext/cw/Imakefile | 1 - nx-X11/programs/Xserver/os/Imakefile | 5 - nx-X11/programs/Xserver/record/Imakefile | 10 - nx-X11/programs/Xserver/record/module/Imakefile | 29 - nx-X11/programs/Xserver/record/recordmod.c | 45 - 42 files changed, 2 insertions(+), 2109 deletions(-) delete mode 100644 nx-X11/programs/Xserver/GL/glxmodule.c delete mode 100644 nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c delete mode 100644 nx-X11/programs/Xserver/Xext/xvmod.c delete mode 100644 nx-X11/programs/Xserver/Xext/xvmodproc.h delete mode 100644 nx-X11/programs/Xserver/dbe/dbemodule.c delete mode 100644 nx-X11/programs/Xserver/dbe/module/Imakefile delete mode 100644 nx-X11/programs/Xserver/fb/fbmodule.c delete mode 100644 nx-X11/programs/Xserver/fb/module/Imakefile delete mode 100644 nx-X11/programs/Xserver/record/module/Imakefile delete mode 100644 nx-X11/programs/Xserver/record/recordmod.c (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/config/cf/Imake.rules b/nx-X11/config/cf/Imake.rules index fb6df65ce..06b78993b 100644 --- a/nx-X11/config/cf/Imake.rules +++ b/nx-X11/config/cf/Imake.rules @@ -3419,42 +3419,25 @@ MutexDirective: targets * ObjectModuleTarget - build a module as a single object file */ #ifndef ObjectModuleTarget -#if MakeDllModules && DoLoadableServer -#define ObjectModuleTarget(module,objects) @@\ -DynamicModuleTarget(Concat(module,_drv.so), objects) -#else #define ObjectModuleTarget(module,objects) @@\ NormalRelocatableTarget(Concat(module,_drv), objects) #endif -#endif /* * LibraryModuleTarget */ #ifndef LibraryModuleTarget -#if MakeDllModules && DoLoadableServer -#define LibraryModuleTarget(module,objects) @@\ -NormalLibraryTarget(module, objects) @@\ -DynamicModuleTarget(Concat3(lib,module,.so), objects) -#else #define LibraryModuleTarget(module, objects) @@\ NormalLibraryTarget(module, objects) #endif -#endif /* * DepLibraryModuleTarget */ #ifndef DepLibraryModuleTarget -#if MakeDllModules && DoLoadableServer -#define DepLibraryModuleTarget(module,deplist,objects) @@\ -NormalDepLibraryTarget(module, deplist, objects) @@\ -DepDynamicModuleTarget(Concat3(lib,module,.so), deplist, objects) -#else #define DepLibraryModuleTarget(module,deplist,objects) @@\ NormalDepLibraryTarget(module, deplist, objects) #endif -#endif /* * DynamicModuleTarget - build a module to be dynamically loaded @@ -3532,31 +3515,11 @@ InstallObjectModule(module,dest,multimedia) #endif #ifndef InstallObjectModule -#if !DoLoadableServer #define InstallObjectModule(module,dest,subdir) /**/ -#else -#if MakeDllModules -#define InstallObjectModule(module,dest,subdir) @@\ -InstallDynamicModule(Concat(module,_drv.so),dest,subdir) -#else -#define InstallObjectModule(module,dest,subdir) @@\ -InstallDynamicModule(Concat(module,_drv.o),dest,subdir) -#endif -#endif #endif #ifndef InstallLibraryModule -#if !DoLoadableServer #define InstallLibraryModule(module,dest,subdir) /**/ -#else -#if MakeDllModules -#define InstallLibraryModule(module,dest,subdir) @@\ -InstallDynamicModule(Concat3(lib,module,.so),dest,subdir) -#else -#define InstallLibraryModule(module,dest,subdir) @@\ -InstallDynamicModule(ModuleLibraryTargetName(module),dest,subdir) -#endif -#endif #endif #ifndef InstallModuleManPage diff --git a/nx-X11/config/cf/Imake.tmpl b/nx-X11/config/cf/Imake.tmpl index 0545f1094..6406fca33 100644 --- a/nx-X11/config/cf/Imake.tmpl +++ b/nx-X11/config/cf/Imake.tmpl @@ -293,12 +293,6 @@ XCOMM the platform-specific parameters - edit site.def to change #define HasCookieMaker NO #endif -#ifndef DoLoadableServer -#define DoLoadableServer NO -#endif -#ifndef MakeDllModules -#define MakeDllModules NO -#endif #ifndef StripInstalledPrograms #define StripInstalledPrograms NO /* leave symbol table just in case */ #endif diff --git a/nx-X11/config/cf/host.def b/nx-X11/config/cf/host.def index bdf440fbc..0dccfad8b 100644 --- a/nx-X11/config/cf/host.def +++ b/nx-X11/config/cf/host.def @@ -299,23 +299,6 @@ #define TermcapLibrary -lncurses */ -/* - * Build a server that dynamically loads the modules by setting - * this to YES. This defaults to YES on most platforms. A static server - * can be built by setting this to NO. - * -#define DoLoadableServer NO - */ - -/* - * This release defaults to building dlopen() style modules instead of the - * previously standard loader modules. - * - * Uncomment the following to return to the XFree86 custom loader modules. - * -#define MakeDllModules NO - */ - /* * Build XAA. This can be disabled with: * diff --git a/nx-X11/config/cf/linux.cf b/nx-X11/config/cf/linux.cf index 085984165..9238b9e6f 100644 --- a/nx-X11/config/cf/linux.cf +++ b/nx-X11/config/cf/linux.cf @@ -462,26 +462,12 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion) # endif #endif -#if UseElfFormat -# ifndef DoLoadableServer -# if defined(MipsArchitecture) || defined(SuperHArchitecture) -# define DoLoadableServer NO -# else -# define DoLoadableServer YES -# endif -# endif -#endif - - #if LinuxElfDefault # if UseElfFormat # ifdef MipsArchitecture # ifndef AsCmd # define AsCmd gcc -c -x assembler-with-cpp # endif -# ifndef MakeDllModules -# define MakeDllModules YES -# endif # endif /* MipsArchitecure */ # if defined (i386Architecture) && ((GccMajorVersion >3) \ || ((GccMajorVersion == 3) && (GccMinorVersion >= 1))) @@ -840,9 +826,6 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion) # define LinuxMachineDefines -D__sh__ # define ServerOSDefines XFree86ServerOSDefines -DDDXTIME # define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -# ifndef DoLoadableServer -# define DoLoadableServer NO -# endif #endif #ifdef AMD64Architecture diff --git a/nx-X11/config/cf/xf86.rules b/nx-X11/config/cf/xf86.rules index 12125fb9b..879bd3c90 100644 --- a/nx-X11/config/cf/xf86.rules +++ b/nx-X11/config/cf/xf86.rules @@ -74,149 +74,54 @@ clean:: @@\ */ #ifndef InstallDriverSDKNonExecFile -#if !DoLoadableServer #define InstallDriverSDKNonExecFile(file,dest) /**/ -#else -#define InstallDriverSDKNonExecFile(file,dest) @@\ -install.sdk:: file @@\ - MakeDir($(DESTDIR)dest) @@\ - $(INSTALL) -c $(INSTDATFLAGS) file $(DESTDIR)dest -#endif #endif #ifndef InstallDriverSDKLibrary -#if !DoLoadableServer #define InstallDriverSDKLibrary(libname,dest) /**/ -#else -#define InstallDriverSDKLibrary(libname,dest) @@\ -install.sdk:: Concat(lib,libname.a) @@\ - MakeDir($(DESTDIR)dest) @@\ - $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.a) $(DESTDIR)dest @@\ - RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,libname.a)) -#endif #endif #ifndef InstallDriverSDKNamedLibrary -#if !DoLoadableServer #define InstallDriverSDKNamedLibrary(libname,dlibname,dest) /**/ -#else -#define InstallDriverSDKNamedLibrary(libname,dlibname,dest) @@\ -install.sdk:: Concat(lib,libname.a) @@\ - MakeDir($(DESTDIR)dest) @@\ - $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.a) \ @@\ - Concat($(DESTDIR)dest/lib,dlibname.a) @@\ - RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,dlibname.a)) -#endif #endif #ifndef InstallDriverSDKNamedNonExec -#if !DoLoadableServer #define InstallDriverSDKNamedNonExec(srcname,dstname,dest) /**/ -#else -#define InstallDriverSDKNamedNonExec(srcname,dstname,dest) @@\ -install.sdk:: srcname @@\ - MakeDir($(DESTDIR)dest) @@\ - $(INSTALL) -c $(INSTDATFLAGS) srcname $(DESTDIR)dest/dstname -#endif #endif #ifndef InstallDriverSDKNamedProg -#if !DoLoadableServer #define InstallDriverSDKNamedProg(srcname,dstname,dest) /**/ -#else -#define InstallDriverSDKNamedProg(srcname,dstname,dest) @@\ -install.sdk:: srcname @@\ - MakeDir($(DESTDIR)dest) @@\ - $(INSTALL) -c $(INSTBINFLAGS) srcname $(DESTDIR)dest/dstname -#endif #endif #ifndef InstallDriverSDKSubdirs -#if !DoLoadableServer #define InstallDriverSDKSubdirs(dirs) /**/ -#else -#define InstallDriverSDKSubdirs(dirs) \ -NamedTargetSubdirs(install.sdk,dirs,"installing driver SDK",DESTDIR='$(DESTDIR)',install.sdk) -#endif #endif #ifndef InstallDriverSDKMultipleDestFlags -#if !DoLoadableServer #define InstallDriverSDKMultipleDestFlags(list,dest,flags) /**/ -#else -#define InstallDriverSDKMultipleDestFlags(list,dest,flags) \ -InstallMultipleDestFlags(install.sdk,list,dest,flags) -#endif #endif #ifndef InstallDriverSDKDynamicModule -#if !DoLoadableServer #define InstallDriverSDKDynamicModule(module,dest,subdir) /**/ -#else -#define InstallDriverSDKDynamicModule(module,dest,subdir) @@\ -install.sdk:: module @@\ - MakeDir($(DESTDIR)dest/subdir) @@\ - $(INSTALL) -c module $(DESTDIR)dest/subdir -#endif #endif #ifndef InstallDriverSDKObjectModule -#if !DoLoadableServer #define InstallDriverSDKObjectModule(module,dest,subdir) /**/ -#else -#if MakeDllModules -#define InstallDriverSDKObjectModule(module,dest,subdir) @@\ -InstallDriverSDKDynamicModule(Concat(module,_drv.so),dest,subdir) -#else -#define InstallDriverSDKObjectModule(module,dest,subdir) @@\ -InstallDriverSDKDynamicModule(Concat(module,_drv.o),dest,subdir) -#endif -#endif #endif #ifndef InstallDriverSDKObjectSubModule -#if !DoLoadableServer #define InstallDriverSDKObjectSubModule(module,dest,subdir) /**/ -#else -#if MakeDllModules -#define InstallDriverSDKObjectSubModule(module,dest,subdir) @@\ -InstallDriverSDKDynamicModule(Concat(module,.so),dest,subdir) -#else -#define InstallDriverSDKObjectSubModule(module,dest,subdir) @@\ -InstallDriverSDKDynamicModule(Concat(module,.o),dest,subdir) -#endif -#endif #endif #ifndef InstallDriverSDKLibraryModule -#if !DoLoadableServer #define InstallDriverSDKLibraryModule(module,dest,subdir) /**/ -#else -#if MakeDllModules -#define InstallDriverSDKLibraryModule(module,dest,subdir) @@\ -InstallDriverSDKDynamicModule(Concat3(lib,module,.so),dest,subdir) -#else -#define InstallDriverSDKLibraryModule(module,dest,subdir) @@\ -InstallDriverSDKDynamicModule(ModuleLibraryTargetName(module),dest,subdir) -#endif -#endif #endif #ifndef ServerDriverSDKTarget -#if !DoLoadableServer #define ServerDriverSDKTarget(program) /**/ -#else -#define ServerDriverSDKTarget(program) @@\ -InstallDriverSDKProgramWithFlags(program,$(DRIVERSDKDIR),$(_NOOP_)) -#endif #endif #ifndef InstallDriverSDKProgramWithFlags -#if !DoLoadableServer #define InstallDriverSDKProgramWithFlags(program,dest,flags) /**/ -#else -#define InstallDriverSDKProgramWithFlags(program,dest,flags) @@\ -InstallTarget(install.sdk,ProgramTargetName(program),$(INSTPGMFLAGS) flags,dest) -#endif #endif diff --git a/nx-X11/config/cf/xorg.cf b/nx-X11/config/cf/xorg.cf index f967796f0..470c9adb8 100644 --- a/nx-X11/config/cf/xorg.cf +++ b/nx-X11/config/cf/xorg.cf @@ -201,18 +201,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString #define BuildModuleInSubdir NO #endif -#ifndef DoLoadableServer -#define DoLoadableServer NO -#endif - -#ifndef MakeDllModules -#if DoLoadableServer -#define MakeDllModules YES -#else -#define MakeDllModules NO -#endif -#endif - /* * Default settings for which X Servers to build. */ @@ -337,10 +325,6 @@ NX_VERSION_CURRENT_STRING = nxVersionString #ifndef XorgServer # define XorgServer NO #endif -#if !XorgServer -# undef DoLoadableServer -# define DoLoadableServer NO -#endif /* * Fbdev module defines. They are set to indicate the fb types supported @@ -569,18 +553,10 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 #endif #ifndef ExtraLoaderDefines -# if MakeDllModules -# define ExtraLoaderDefines DlopenHack -# else # define ExtraLoaderDefines /**/ -# endif #endif -#if DoLoadableServer -# define XFree86LoaderDefines -DXFree86LOADER ExtraLoaderDefines -#else # define XFree86LoaderDefines /**/ -#endif #ifndef HasBsdMake #define HasBsdMake NO diff --git a/nx-X11/config/cf/xorg.tmpl b/nx-X11/config/cf/xorg.tmpl index c5f332b3a..2737ebdf9 100644 --- a/nx-X11/config/cf/xorg.tmpl +++ b/nx-X11/config/cf/xorg.tmpl @@ -64,79 +64,4 @@ BUILDERADDR = "xorg@lists.freedesktop.org" #define HasGccMergeConstants NO #endif -#if HasGccMergeConstants && DoLoadableServer && !MakeDllModules -MODULE_GCC_FLAGS = -fno-merge-constants -#endif - -#if defined(IHaveModules) && MakeDllModules -MODULE_PIC_FLAGS = $(PICFLAGS) -#endif - MODULE_CFLAGS = $(MODULE_PIC_FLAGS) $(MODULE_GCC_FLAGS) - -#if defined(IHaveModules) -# if DoLoadableServer -MODULE_DEFINES = -DIN_MODULE -DXFree86Module -# else -MODULE_DEFINES = -DXFree86Module -# endif -#endif - -#if defined(IHaveModules) && DoLoadableServer - -/* This overrides the ObjCompile in Imake.rules! */ -#undef ObjectCompile -#define ObjectCompile(options) RemoveFile($@) @@\ - ClearmakeOSName\ - $(MODCC) $(MODCFLAGS) options -c $*.c - -/* This overrides an AssembleObject in xf86.rules or in an os-dependent - * rules file (currently only minix.cf and os2.rules (uncritical)) - */ -#define ModCPPOnlyAsm(basename,options) RemoveFile(basename.i) @@\ - $(MODCPP) AsmDefines $(DEFINES) $(INCLUDES) options basename.S | \ @@\ - grep -v '^\#' > basename.i - -#undef AssembleObject -#define AssembleObject(basename,flags) ModCPPOnlyAsm(basename,flags) @@\ - RemoveFile(basename.o) @@\ - $(MODAS) $(MODASFLAGS) -o basename.o basename.i @@\ - RemoveFile(basename.i) - -/* This overrides the NormalRelocatableTarget in Imake.rules */ -#undef NormalRelocatableTarget -#define NormalRelocatableTarget(objname,objlist) @@\ -AllTarget(objname.Osuf) @@\ - @@\ -objname.Osuf: objlist $(EXTRALIBRARYDEPS) @@\ - RemoveFile($@) @@\ - $(MODLD) $(MODLDCOMBINEFLAGS) objlist -o $@ - -/* This overrides the NormalDepRelocatableTarget in Imake.rules */ -#undef NormalDepRelocatableTarget -#define NormalDepRelocatableTarget(objname,deplist,objlist) @@\ -AllTarget(objname.Osuf) @@\ - @@\ -objname.Osuf: deplist $(EXTRALIBRARYDEPS) @@\ - RemoveFile($@) @@\ - $(MODLD) $(MODLDCOMBINEFLAGS) objlist -o $@ - -/* This overrides the RanLibrary in Imake.rules */ -#if DoRanlibCmd || NeedModuleRanlib -#undef RanLibrary -#define RanLibrary(args) $(MODRANLIB) args -#endif - -/* This overrides the MakeLibrary rule in Imake.rules */ -#undef MakeLibrary -#define MakeLibrary(libname,objlist) $(MODAR) libname objlist - -/* This overrides the LibraryTargetName rule in Imake.rules */ -#undef LibraryTargetName -#define LibraryTargetName(libname)Concat(lib,libname.a) - -/* This disables an OS/2 rule */ -#undef BuildLibSupportLibs -#define BuildLibSupportLibs(dummy) - -#endif /* IHaveModules */ diff --git a/nx-X11/config/cf/xorgsite.def b/nx-X11/config/cf/xorgsite.def index f28bb2b2e..1614fce5e 100644 --- a/nx-X11/config/cf/xorgsite.def +++ b/nx-X11/config/cf/xorgsite.def @@ -168,23 +168,6 @@ #define TermcapLibrary -lncurses */ -/* - * Build a server that dynamically loads the modules by setting - * this to YES. This defaults to YES on most platforms. A static server - * can be built by setting this to NO. - * -#define DoLoadableServer NO - */ - -/* - * This release defaults to building dlopen() style modules instead of the - * previously standard loader modules. - * - * Uncomment the following to return to the XFree86 custom loader modules. - * -#define MakeDllModules NO - */ - /* * Build XAA. This can be disabled with: * diff --git a/nx-X11/programs/Xserver/GL/Imakefile b/nx-X11/programs/Xserver/GL/Imakefile index 48059b4dd..19b5902a5 100644 --- a/nx-X11/programs/Xserver/GL/Imakefile +++ b/nx-X11/programs/Xserver/GL/Imakefile @@ -7,10 +7,6 @@ SUBDIRS = glx $(CORE_SUBDIR) -#if DoLoadableServer -MSRCS = glxmodule.c -MOBJS = glxmodule.o -#endif #if BuildModuleInSubdir SRCS = glx/module/?*.c $(MSRCS) diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile index 7658ea4cf..2ee2d17e6 100644 --- a/nx-X11/programs/Xserver/GL/glx/Imakefile +++ b/nx-X11/programs/Xserver/GL/glx/Imakefile @@ -1,13 +1,5 @@ NULL = -#if DoLoadableServer -# if !BuildModuleInSubdir -# define IHaveModules -# elif !defined(IHaveModules) -# define IHaveSubdirs -SUBDIRS = module -# endif -#endif /* Large PIC tables needed for SPARC builds */ #if defined(sparc) || defined(SparcArchitecture) @@ -131,10 +123,6 @@ XCOMM add DEBUG to the define in ../mesa/src/X/xf86glx.c $(NX_DEFINES) \ $(NULL) -#ifdef IHaveModules -ModuleObjectRule() -LibraryModuleTarget(glx,$(OBJS)) -#else NormalLibraryObjectRule() NormalLibraryTarget(glx,$(OBJS)) #if defined(GlxUseWindows) && GlxUseWindows @@ -145,7 +133,6 @@ includes:: SpecialObjectRule(stdcall/%.o,%.c,-DUSE_OPENGL32 -o $@) NormalLibraryTarget(glx_stdcall,$(foreach obj,$(OBJS), stdcall/$(obj))) #endif -#endif SubdirLibraryRule($(OBJS)) LintLibraryTarget(glx,$(SRCS)) diff --git a/nx-X11/programs/Xserver/GL/glxmodule.c b/nx-X11/programs/Xserver/GL/glxmodule.c deleted file mode 100644 index 8e6e0dfd3..000000000 --- a/nx-X11/programs/Xserver/GL/glxmodule.c +++ /dev/null @@ -1,1269 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" -#include "colormap.h" -#include "micmap.h" -#include "globals.h" - -static MODULESETUPPROTO(glxSetup); - -extern void GlxExtensionInit(void); -extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); -extern void InitGlxWrapInitVisuals(void (*f)(miInitVisualsProcPtr *)); - -static const char *initdeps[] = { "DOUBLE-BUFFER", NULL }; - -ExtensionModule GLXExt = -{ - GlxExtensionInit, - "GLX", - &noGlxExtension, - NULL, - initdeps -}; - -static const char *glcoreSymbols[] = { - "__glCallLists_size", - "__glColorTableParameterfv_size", - "__glColorTableParameteriv_size", - "__glConvolutionParameterfv_size", - "__glConvolutionParameteriv_size", - "__glDDXExtensionInfo", - "__glDDXScreenInfo", - "__glFloorLog2", - "__glFogfv_size", - "__glFogiv_size", - "__glGetBooleanv_size", - "__glGetColorTableParameterfv_size", - "__glGetColorTableParameteriv_size", - "__glGetConvolutionParameterfv_size", - "__glGetConvolutionParameteriv_size", - "__glGetDoublev_size", - "__glGetFloatv_size", - "__glGetHistogramParameterfv_size", - "__glGetHistogramParameteriv_size", - "__glGetIntegerv_size", - "__glGetLightfv_size", - "__glGetLightiv_size", - "__glGetMapdv_size", - "__glGetMapfv_size", - "__glGetMapiv_size", - "__glGetMaterialfv_size", - "__glGetMaterialiv_size", - "__glGetMinmaxParameterfv_size", - "__glGetMinmaxParameteriv_size", - "__glGetPixelMapfv_size", - "__glGetPixelMapuiv_size", - "__glGetPixelMapusv_size", - "__glGetTexEnvfv_size", - "__glGetTexEnviv_size", - "__glGetTexGendv_size", - "__glGetTexGenfv_size", - "__glGetTexGeniv_size", - "__glGetTexImage_size", - "__glGetTexLevelParameterfv_size", - "__glGetTexLevelParameteriv_size", - "__glGetTexParameterfv_size", - "__glGetTexParameteriv_size", - "__glLightModelfv_size", - "__glLightModeliv_size", - "__glLightfv_size", - "__glLightiv_size", - "__glMaterialfv_size", - "__glMaterialiv_size", - "__glPointParameterfvARB_size", - "__glReadPixels_size", - "__glTexEnvfv_size", - "__glTexEnviv_size", - "__glTexGendv_size", - "__glTexGenfv_size", - "__glTexGeniv_size", - "__glTexParameterfv_size", - "__glTexParameteriv_size", - "__glXglDDXExtensionInfo", - "__glXglDDXScreenInfo", - "__glXActiveScreens", - "__glXAssociateContext", - "__glXBadContext", - "__glXBadContextState", - "__glXBadContextTag", - "__glXBadCurrentWindow", - "__glXBadDrawable", - "__glXBadLargeRequest", - "__glXBadPixmap", - "__glXBadRenderRequest", - "__glXBitmapReqSize", - "__glXCacheDrawableSize", - "__glXCallListsReqSize", - "__glXClearErrorOccured", - "__glXClientInfo", - "__glXClientRes", - "__glXClients", - "__glXColorSubTableReqSize", - "__glXColorTableParameterfvReqSize", - "__glXColorTableParameterivReqSize", - "__glXColorTableReqSize", - "__glXContextRes", - "__glXConvolutionFilter1DReqSize", - "__glXConvolutionFilter2DReqSize", - "__glXConvolutionParameterfvReqSize", - "__glXConvolutionParameterivReqSize", - "__glXCopyContext", - "__glXCoreType", - "__glXCreateContext", - "__glXCreateGLXPixmap", - "__glXDeassociateContext", - "__glXDestroyContext", - "__glXDestroyGLXPixmap", - "__glXDispSwap_Accum", - "__glXDispSwap_ActiveStencilFaceEXT", - "__glXDispSwap_ActiveTextureARB", - "__glXDispSwap_AlphaFunc", - "__glXDispSwap_AreTexturesResident", - "__glXDispSwap_AreTexturesResidentEXT", - "__glXDispSwap_Begin", - "__glXDispSwap_BindTexture", - "__glXDispSwap_Bitmap", - "__glXDispSwap_BlendColor", - "__glXDispSwap_BlendEquation", - "__glXDispSwap_BlendFunc", - "__glXDispSwap_CallList", - "__glXDispSwap_CallLists", - "__glXDispSwap_Clear", - "__glXDispSwap_ClearAccum", - "__glXDispSwap_ClearColor", - "__glXDispSwap_ClearDepth", - "__glXDispSwap_ClearIndex", - "__glXDispSwap_ClearStencil", - "__glXDispSwap_ClipPlane", - "__glXDispSwap_Color3bv", - "__glXDispSwap_Color3dv", - "__glXDispSwap_Color3fv", - "__glXDispSwap_Color3iv", - "__glXDispSwap_Color3sv", - "__glXDispSwap_Color3ubv", - "__glXDispSwap_Color3uiv", - "__glXDispSwap_Color3usv", - "__glXDispSwap_Color4bv", - "__glXDispSwap_Color4dv", - "__glXDispSwap_Color4fv", - "__glXDispSwap_Color4iv", - "__glXDispSwap_Color4sv", - "__glXDispSwap_Color4ubv", - "__glXDispSwap_Color4uiv", - "__glXDispSwap_Color4usv", - "__glXDispSwap_ColorMask", - "__glXDispSwap_ColorMaterial", - "__glXDispSwap_ColorSubTable", - "__glXDispSwap_ColorTable", - "__glXDispSwap_ColorTableParameterfv", - "__glXDispSwap_ColorTableParameteriv", - "__glXDispSwap_ConvolutionFilter1D", - "__glXDispSwap_ConvolutionFilter2D", - "__glXDispSwap_ConvolutionParameterf", - "__glXDispSwap_ConvolutionParameterfv", - "__glXDispSwap_ConvolutionParameteri", - "__glXDispSwap_ConvolutionParameteriv", - "__glXDispSwap_CopyColorSubTable", - "__glXDispSwap_CopyColorTable", - "__glXDispSwap_CopyConvolutionFilter1D", - "__glXDispSwap_CopyConvolutionFilter2D", - "__glXDispSwap_CopyPixels", - "__glXDispSwap_CopyTexImage1D", - "__glXDispSwap_CopyTexImage2D", - "__glXDispSwap_CopyTexSubImage1D", - "__glXDispSwap_CopyTexSubImage2D", - "__glXDispSwap_CopyTexSubImage3D", - "__glXDispSwap_CullFace", - "__glXDispSwap_DeleteLists", - "__glXDispSwap_DeleteTextures", - "__glXDispSwap_DeleteTexturesEXT", - "__glXDispSwap_DepthFunc", - "__glXDispSwap_DepthMask", - "__glXDispSwap_DepthRange", - "__glXDispSwap_Disable", - "__glXDispSwap_DrawArrays", - "__glXDispSwap_DrawArraysEXT", - "__glXDispSwap_DrawBuffer", - "__glXDispSwap_DrawPixels", - "__glXDispSwap_EdgeFlagv", - "__glXDispSwap_Enable", - "__glXDispSwap_End", - "__glXDispSwap_EndList", - "__glXDispSwap_EvalCoord1dv", - "__glXDispSwap_EvalCoord1fv", - "__glXDispSwap_EvalCoord2dv", - "__glXDispSwap_EvalCoord2fv", - "__glXDispSwap_EvalMesh1", - "__glXDispSwap_EvalMesh2", - "__glXDispSwap_EvalPoint1", - "__glXDispSwap_EvalPoint2", - "__glXDispSwap_FeedbackBuffer", - "__glXDispSwap_Finish", - "__glXDispSwap_Flush", - "__glXDispSwap_Fogf", - "__glXDispSwap_Fogfv", - "__glXDispSwap_Fogi", - "__glXDispSwap_Fogiv", - "__glXDispSwap_FrontFace", - "__glXDispSwap_Frustum", - "__glXDispSwap_GenLists", - "__glXDispSwap_GenTextures", - "__glXDispSwap_GenTexturesEXT", - "__glXDispSwap_GetBooleanv", - "__glXDispSwap_GetClipPlane", - "__glXDispSwap_GetColorTable", - "__glXDispSwap_GetColorTableParameterfv", - "__glXDispSwap_GetColorTableParameteriv", - "__glXDispSwap_GetConvolutionFilter", - "__glXDispSwap_GetConvolutionParameterfv", - "__glXDispSwap_GetConvolutionParameteriv", - "__glXDispSwap_GetDoublev", - "__glXDispSwap_GetError", - "__glXDispSwap_GetFloatv", - "__glXDispSwap_GetHistogram", - "__glXDispSwap_GetHistogramParameterfv", - "__glXDispSwap_GetHistogramParameteriv", - "__glXDispSwap_GetIntegerv", - "__glXDispSwap_GetLightfv", - "__glXDispSwap_GetLightiv", - "__glXDispSwap_GetMapdv", - "__glXDispSwap_GetMapfv", - "__glXDispSwap_GetMapiv", - "__glXDispSwap_GetMaterialfv", - "__glXDispSwap_GetMaterialiv", - "__glXDispSwap_GetMinmax", - "__glXDispSwap_GetMinmaxParameterfv", - "__glXDispSwap_GetMinmaxParameteriv", - "__glXDispSwap_GetPixelMapfv", - "__glXDispSwap_GetPixelMapuiv", - "__glXDispSwap_GetPixelMapusv", - "__glXDispSwap_GetPolygonStipple", - "__glXDispSwap_GetSeparableFilter", - "__glXDispSwap_GetString", - "__glXDispSwap_GetTexEnvfv", - "__glXDispSwap_GetTexEnviv", - "__glXDispSwap_GetTexGendv", - "__glXDispSwap_GetTexGenfv", - "__glXDispSwap_GetTexGeniv", - "__glXDispSwap_GetTexImage", - "__glXDispSwap_GetTexLevelParameterfv", - "__glXDispSwap_GetTexLevelParameteriv", - "__glXDispSwap_GetTexParameterfv", - "__glXDispSwap_GetTexParameteriv", - "__glXDispSwap_Hint", - "__glXDispSwap_Histogram", - "__glXDispSwap_IndexMask", - "__glXDispSwap_Indexdv", - "__glXDispSwap_Indexfv", - "__glXDispSwap_Indexiv", - "__glXDispSwap_Indexsv", - "__glXDispSwap_Indexubv", - "__glXDispSwap_InitNames", - "__glXDispSwap_IsEnabled", - "__glXDispSwap_IsList", - "__glXDispSwap_IsTexture", - "__glXDispSwap_IsTextureEXT", - "__glXDispSwap_LightModelf", - "__glXDispSwap_LightModelfv", - "__glXDispSwap_LightModeli", - "__glXDispSwap_LightModeliv", - "__glXDispSwap_Lightf", - "__glXDispSwap_Lightfv", - "__glXDispSwap_Lighti", - "__glXDispSwap_Lightiv", - "__glXDispSwap_LineStipple", - "__glXDispSwap_LineWidth", - "__glXDispSwap_ListBase", - "__glXDispSwap_LoadIdentity", - "__glXDispSwap_LoadMatrixd", - "__glXDispSwap_LoadMatrixf", - "__glXDispSwap_LoadName", - "__glXDispSwap_LogicOp", - "__glXDispSwap_Map1d", - "__glXDispSwap_Map1f", - "__glXDispSwap_Map2d", - "__glXDispSwap_Map2f", - "__glXDispSwap_MapGrid1d", - "__glXDispSwap_MapGrid1f", - "__glXDispSwap_MapGrid2d", - "__glXDispSwap_MapGrid2f", - "__glXDispSwap_Materialf", - "__glXDispSwap_Materialfv", - "__glXDispSwap_Materiali", - "__glXDispSwap_Materialiv", - "__glXDispSwap_MatrixMode", - "__glXDispSwap_Minmax", - "__glXDispSwap_MultMatrixd", - "__glXDispSwap_MultMatrixf", - "__glXDispSwap_MultiTexCoord1dvARB", - "__glXDispSwap_MultiTexCoord1fvARB", - "__glXDispSwap_MultiTexCoord1ivARB", - "__glXDispSwap_MultiTexCoord1svARB", - "__glXDispSwap_MultiTexCoord2dvARB", - "__glXDispSwap_MultiTexCoord2fvARB", - "__glXDispSwap_MultiTexCoord2ivARB", - "__glXDispSwap_MultiTexCoord2svARB", - "__glXDispSwap_MultiTexCoord3dvARB", - "__glXDispSwap_MultiTexCoord3fvARB", - "__glXDispSwap_MultiTexCoord3ivARB", - "__glXDispSwap_MultiTexCoord3svARB", - "__glXDispSwap_MultiTexCoord4dvARB", - "__glXDispSwap_MultiTexCoord4fvARB", - "__glXDispSwap_MultiTexCoord4ivARB", - "__glXDispSwap_MultiTexCoord4svARB", - "__glXDispSwap_NewList", - "__glXDispSwap_Normal3bv", - "__glXDispSwap_Normal3dv", - "__glXDispSwap_Normal3fv", - "__glXDispSwap_Normal3iv", - "__glXDispSwap_Normal3sv", - "__glXDispSwap_Ortho", - "__glXDispSwap_PassThrough", - "__glXDispSwap_PixelMapfv", - "__glXDispSwap_PixelMapuiv", - "__glXDispSwap_PixelMapusv", - "__glXDispSwap_PixelStoref", - "__glXDispSwap_PixelStorei", - "__glXDispSwap_PixelTransferf", - "__glXDispSwap_PixelTransferi", - "__glXDispSwap_PixelZoom", - "__glXDispSwap_PointParameterfARB", - "__glXDispSwap_PointParameterfvARB", - "__glXDispSwap_PointSize", - "__glXDispSwap_PolygonMode", - "__glXDispSwap_PolygonOffset", - "__glXDispSwap_PolygonStipple", - "__glXDispSwap_PopAttrib", - "__glXDispSwap_PopMatrix", - "__glXDispSwap_PopName", - "__glXDispSwap_PrioritizeTextures", - "__glXDispSwap_PushAttrib", - "__glXDispSwap_PushMatrix", - "__glXDispSwap_PushName", - "__glXDispSwap_RasterPos2dv", - "__glXDispSwap_RasterPos2fv", - "__glXDispSwap_RasterPos2iv", - "__glXDispSwap_RasterPos2sv", - "__glXDispSwap_RasterPos3dv", - "__glXDispSwap_RasterPos3fv", - "__glXDispSwap_RasterPos3iv", - "__glXDispSwap_RasterPos3sv", - "__glXDispSwap_RasterPos4dv", - "__glXDispSwap_RasterPos4fv", - "__glXDispSwap_RasterPos4iv", - "__glXDispSwap_RasterPos4sv", - "__glXDispSwap_ReadBuffer", - "__glXDispSwap_ReadPixels", - "__glXDispSwap_Rectdv", - "__glXDispSwap_Rectfv", - "__glXDispSwap_Rectiv", - "__glXDispSwap_Rectsv", - "__glXDispSwap_RenderMode", - "__glXDispSwap_ResetHistogram", - "__glXDispSwap_ResetMinmax", - "__glXDispSwap_Rotated", - "__glXDispSwap_Rotatef", - "__glXDispSwap_Scaled", - "__glXDispSwap_Scalef", - "__glXDispSwap_Scissor", - "__glXDispSwap_SelectBuffer", - "__glXDispSwap_SeparableFilter2D", - "__glXDispSwap_ShadeModel", - "__glXDispSwap_StencilFunc", - "__glXDispSwap_StencilMask", - "__glXDispSwap_StencilOp", - "__glXDispSwap_TexCoord1dv", - "__glXDispSwap_TexCoord1fv", - "__glXDispSwap_TexCoord1iv", - "__glXDispSwap_TexCoord1sv", - "__glXDispSwap_TexCoord2dv", - "__glXDispSwap_TexCoord2fv", - "__glXDispSwap_TexCoord2iv", - "__glXDispSwap_TexCoord2sv", - "__glXDispSwap_TexCoord3dv", - "__glXDispSwap_TexCoord3fv", - "__glXDispSwap_TexCoord3iv", - "__glXDispSwap_TexCoord3sv", - "__glXDispSwap_TexCoord4dv", - "__glXDispSwap_TexCoord4fv", - "__glXDispSwap_TexCoord4iv", - "__glXDispSwap_TexCoord4sv", - "__glXDispSwap_TexEnvf", - "__glXDispSwap_TexEnvfv", - "__glXDispSwap_TexEnvi", - "__glXDispSwap_TexEnviv", - "__glXDispSwap_TexGend", - "__glXDispSwap_TexGendv", - "__glXDispSwap_TexGenf", - "__glXDispSwap_TexGenfv", - "__glXDispSwap_TexGeni", - "__glXDispSwap_TexGeniv", - "__glXDispSwap_TexImage1D", - "__glXDispSwap_TexImage2D", - "__glXDispSwap_TexImage3D", - "__glXDispSwap_TexParameterf", - "__glXDispSwap_TexParameterfv", - "__glXDispSwap_TexParameteri", - "__glXDispSwap_TexParameteriv", - "__glXDispSwap_TexSubImage1D", - "__glXDispSwap_TexSubImage2D", - "__glXDispSwap_TexSubImage3D", - "__glXDispSwap_Translated", - "__glXDispSwap_Translatef", - "__glXDispSwap_Vertex2dv", - "__glXDispSwap_Vertex2fv", - "__glXDispSwap_Vertex2iv", - "__glXDispSwap_Vertex2sv", - "__glXDispSwap_Vertex3dv", - "__glXDispSwap_Vertex3fv", - "__glXDispSwap_Vertex3iv", - "__glXDispSwap_Vertex3sv", - "__glXDispSwap_Vertex4dv", - "__glXDispSwap_Vertex4fv", - "__glXDispSwap_Vertex4iv", - "__glXDispSwap_Vertex4sv", - "__glXDispSwap_Viewport", - "__glXDispSwap_WindowPos3fARB", - "__glXDisp_Accum", - "__glXDisp_ActiveStencilFaceEXT", - "__glXDisp_ActiveTextureARB", - "__glXDisp_AlphaFunc", - "__glXDisp_AreTexturesResident", - "__glXDisp_AreTexturesResidentEXT", - "__glXDisp_Begin", - "__glXDisp_BindTexture", - "__glXDisp_Bitmap", - "__glXDisp_BlendColor", - "__glXDisp_BlendEquation", - "__glXDisp_BlendFunc", - "__glXDisp_CallList", - "__glXDisp_CallLists", - "__glXDisp_Clear", - "__glXDisp_ClearAccum", - "__glXDisp_ClearColor", - "__glXDisp_ClearDepth", - "__glXDisp_ClearIndex", - "__glXDisp_ClearStencil", - "__glXDisp_ClipPlane", - "__glXDisp_Color3bv", - "__glXDisp_Color3dv", - "__glXDisp_Color3fv", - "__glXDisp_Color3iv", - "__glXDisp_Color3sv", - "__glXDisp_Color3ubv", - "__glXDisp_Color3uiv", - "__glXDisp_Color3usv", - "__glXDisp_Color4bv", - "__glXDisp_Color4dv", - "__glXDisp_Color4fv", - "__glXDisp_Color4iv", - "__glXDisp_Color4sv", - "__glXDisp_Color4ubv", - "__glXDisp_Color4uiv", - "__glXDisp_Color4usv", - "__glXDisp_ColorMask", - "__glXDisp_ColorMaterial", - "__glXDisp_ColorSubTable", - "__glXDisp_ColorTable", - "__glXDisp_ColorTableParameterfv", - "__glXDisp_ColorTableParameteriv", - "__glXDisp_ConvolutionFilter1D", - "__glXDisp_ConvolutionFilter2D", - "__glXDisp_ConvolutionParameterf", - "__glXDisp_ConvolutionParameterfv", - "__glXDisp_ConvolutionParameteri", - "__glXDisp_ConvolutionParameteriv", - "__glXDisp_CopyColorSubTable", - "__glXDisp_CopyColorTable", - "__glXDisp_CopyConvolutionFilter1D", - "__glXDisp_CopyConvolutionFilter2D", - "__glXDisp_CopyPixels", - "__glXDisp_CopyTexImage1D", - "__glXDisp_CopyTexImage2D", - "__glXDisp_CopyTexSubImage1D", - "__glXDisp_CopyTexSubImage2D", - "__glXDisp_CopyTexSubImage3D", - "__glXDisp_CullFace", - "__glXDisp_DeleteLists", - "__glXDisp_DeleteTextures", - "__glXDisp_DeleteTexturesEXT", - "__glXDisp_DepthFunc", - "__glXDisp_DepthMask", - "__glXDisp_DepthRange", - "__glXDisp_Disable", - "__glXDisp_DrawArrays", - "__glXDisp_DrawArraysEXT", - "__glXDisp_DrawBuffer", - "__glXDisp_DrawPixels", - "__glXDisp_EdgeFlagv", - "__glXDisp_Enable", - "__glXDisp_End", - "__glXDisp_EndList", - "__glXDisp_EvalCoord1dv", - "__glXDisp_EvalCoord1fv", - "__glXDisp_EvalCoord2dv", - "__glXDisp_EvalCoord2fv", - "__glXDisp_EvalMesh1", - "__glXDisp_EvalMesh2", - "__glXDisp_EvalPoint1", - "__glXDisp_EvalPoint2", - "__glXDisp_FeedbackBuffer", - "__glXDisp_Finish", - "__glXDisp_Flush", - "__glXDisp_Fogf", - "__glXDisp_Fogfv", - "__glXDisp_Fogi", - "__glXDisp_Fogiv", - "__glXDisp_FrontFace", - "__glXDisp_Frustum", - "__glXDisp_GenLists", - "__glXDisp_GenTextures", - "__glXDisp_GenTexturesEXT", - "__glXDisp_GetBooleanv", - "__glXDisp_GetClipPlane", - "__glXDisp_GetColorTable", - "__glXDisp_GetColorTableParameterfv", - "__glXDisp_GetColorTableParameteriv", - "__glXDisp_GetConvolutionFilter", - "__glXDisp_GetConvolutionParameterfv", - "__glXDisp_GetConvolutionParameteriv", - "__glXDisp_GetDoublev", - "__glXDisp_GetError", - "__glXDisp_GetFloatv", - "__glXDisp_GetHistogram", - "__glXDisp_GetHistogramParameterfv", - "__glXDisp_GetHistogramParameteriv", - "__glXDisp_GetIntegerv", - "__glXDisp_GetLightfv", - "__glXDisp_GetLightiv", - "__glXDisp_GetMapdv", - "__glXDisp_GetMapfv", - "__glXDisp_GetMapiv", - "__glXDisp_GetMaterialfv", - "__glXDisp_GetMaterialiv", - "__glXDisp_GetMinmax", - "__glXDisp_GetMinmaxParameterfv", - "__glXDisp_GetMinmaxParameteriv", - "__glXDisp_GetPixelMapfv", - "__glXDisp_GetPixelMapuiv", - "__glXDisp_GetPixelMapusv", - "__glXDisp_GetPolygonStipple", - "__glXDisp_GetSeparableFilter", - "__glXDisp_GetString", - "__glXDisp_GetTexEnvfv", - "__glXDisp_GetTexEnviv", - "__glXDisp_GetTexGendv", - "__glXDisp_GetTexGenfv", - "__glXDisp_GetTexGeniv", - "__glXDisp_GetTexImage", - "__glXDisp_GetTexLevelParameterfv", - "__glXDisp_GetTexLevelParameteriv", - "__glXDisp_GetTexParameterfv", - "__glXDisp_GetTexParameteriv", - "__glXDisp_Hint", - "__glXDisp_Histogram", - "__glXDisp_IndexMask", - "__glXDisp_Indexdv", - "__glXDisp_Indexfv", - "__glXDisp_Indexiv", - "__glXDisp_Indexsv", - "__glXDisp_Indexubv", - "__glXDisp_InitNames", - "__glXDisp_IsEnabled", - "__glXDisp_IsList", - "__glXDisp_IsTexture", - "__glXDisp_IsTextureEXT", - "__glXDisp_LightModelf", - "__glXDisp_LightModelfv", - "__glXDisp_LightModeli", - "__glXDisp_LightModeliv", - "__glXDisp_Lightf", - "__glXDisp_Lightfv", - "__glXDisp_Lighti", - "__glXDisp_Lightiv", - "__glXDisp_LineStipple", - "__glXDisp_LineWidth", - "__glXDisp_ListBase", - "__glXDisp_LoadIdentity", - "__glXDisp_LoadMatrixd", - "__glXDisp_LoadMatrixf", - "__glXDisp_LoadName", - "__glXDisp_LogicOp", - "__glXDisp_Map1d", - "__glXDisp_Map1f", - "__glXDisp_Map2d", - "__glXDisp_Map2f", - "__glXDisp_MapGrid1d", - "__glXDisp_MapGrid1f", - "__glXDisp_MapGrid2d", - "__glXDisp_MapGrid2f", - "__glXDisp_Materialf", - "__glXDisp_Materialfv", - "__glXDisp_Materiali", - "__glXDisp_Materialiv", - "__glXDisp_MatrixMode", - "__glXDisp_Minmax", - "__glXDisp_MultMatrixd", - "__glXDisp_MultMatrixf", - "__glXDisp_MultiTexCoord1dvARB", - "__glXDisp_MultiTexCoord1fvARB", - "__glXDisp_MultiTexCoord1ivARB", - "__glXDisp_MultiTexCoord1svARB", - "__glXDisp_MultiTexCoord2dvARB", - "__glXDisp_MultiTexCoord2fvARB", - "__glXDisp_MultiTexCoord2ivARB", - "__glXDisp_MultiTexCoord2svARB", - "__glXDisp_MultiTexCoord3dvARB", - "__glXDisp_MultiTexCoord3fvARB", - "__glXDisp_MultiTexCoord3ivARB", - "__glXDisp_MultiTexCoord3svARB", - "__glXDisp_MultiTexCoord4dvARB", - "__glXDisp_MultiTexCoord4fvARB", - "__glXDisp_MultiTexCoord4ivARB", - "__glXDisp_MultiTexCoord4svARB", - "__glXDisp_NewList", - "__glXDisp_Normal3bv", - "__glXDisp_Normal3dv", - "__glXDisp_Normal3fv", - "__glXDisp_Normal3iv", - "__glXDisp_Normal3sv", - "__glXDisp_Ortho", - "__glXDisp_PassThrough", - "__glXDisp_PixelMapfv", - "__glXDisp_PixelMapuiv", - "__glXDisp_PixelMapusv", - "__glXDisp_PixelStoref", - "__glXDisp_PixelStorei", - "__glXDisp_PixelTransferf", - "__glXDisp_PixelTransferi", - "__glXDisp_PixelZoom", - "__glXDisp_PointParameterfARB", - "__glXDisp_PointParameterfvARB", - "__glXDisp_PointSize", - "__glXDisp_PolygonMode", - "__glXDisp_PolygonOffset", - "__glXDisp_PolygonStipple", - "__glXDisp_PopAttrib", - "__glXDisp_PopMatrix", - "__glXDisp_PopName", - "__glXDisp_PrioritizeTextures", - "__glXDisp_PushAttrib", - "__glXDisp_PushMatrix", - "__glXDisp_PushName", - "__glXDisp_RasterPos2dv", - "__glXDisp_RasterPos2fv", - "__glXDisp_RasterPos2iv", - "__glXDisp_RasterPos2sv", - "__glXDisp_RasterPos3dv", - "__glXDisp_RasterPos3fv", - "__glXDisp_RasterPos3iv", - "__glXDisp_RasterPos3sv", - "__glXDisp_RasterPos4dv", - "__glXDisp_RasterPos4fv", - "__glXDisp_RasterPos4iv", - "__glXDisp_RasterPos4sv", - "__glXDisp_ReadBuffer", - "__glXDisp_ReadPixels", - "__glXDisp_Rectdv", - "__glXDisp_Rectfv", - "__glXDisp_Rectiv", - "__glXDisp_Rectsv", - "__glXDisp_RenderMode", - "__glXDisp_ResetHistogram", - "__glXDisp_ResetMinmax", - "__glXDisp_Rotated", - "__glXDisp_Rotatef", - "__glXDisp_Scaled", - "__glXDisp_Scalef", - "__glXDisp_Scissor", - "__glXDisp_SelectBuffer", - "__glXDisp_SeparableFilter2D", - "__glXDisp_ShadeModel", - "__glXDisp_StencilFunc", - "__glXDisp_StencilMask", - "__glXDisp_StencilOp", - "__glXDisp_TexCoord1dv", - "__glXDisp_TexCoord1fv", - "__glXDisp_TexCoord1iv", - "__glXDisp_TexCoord1sv", - "__glXDisp_TexCoord2dv", - "__glXDisp_TexCoord2fv", - "__glXDisp_TexCoord2iv", - "__glXDisp_TexCoord2sv", - "__glXDisp_TexCoord3dv", - "__glXDisp_TexCoord3fv", - "__glXDisp_TexCoord3iv", - "__glXDisp_TexCoord3sv", - "__glXDisp_TexCoord4dv", - "__glXDisp_TexCoord4fv", - "__glXDisp_TexCoord4iv", - "__glXDisp_TexCoord4sv", - "__glXDisp_TexEnvf", - "__glXDisp_TexEnvfv", - "__glXDisp_TexEnvi", - "__glXDisp_TexEnviv", - "__glXDisp_TexGend", - "__glXDisp_TexGendv", - "__glXDisp_TexGenf", - "__glXDisp_TexGenfv", - "__glXDisp_TexGeni", - "__glXDisp_TexGeniv", - "__glXDisp_TexImage1D", - "__glXDisp_TexImage2D", - "__glXDisp_TexImage3D", - "__glXDisp_TexParameterf", - "__glXDisp_TexParameterfv", - "__glXDisp_TexParameteri", - "__glXDisp_TexParameteriv", - "__glXDisp_TexSubImage1D", - "__glXDisp_TexSubImage2D", - "__glXDisp_TexSubImage3D", - "__glXDisp_Translated", - "__glXDisp_Translatef", - "__glXDisp_Vertex2dv", - "__glXDisp_Vertex2fv", - "__glXDisp_Vertex2iv", - "__glXDisp_Vertex2sv", - "__glXDisp_Vertex3dv", - "__glXDisp_Vertex3fv", - "__glXDisp_Vertex3iv", - "__glXDisp_Vertex3sv", - "__glXDisp_Vertex4dv", - "__glXDisp_Vertex4fv", - "__glXDisp_Vertex4iv", - "__glXDisp_Vertex4sv", - "__glXDisp_Viewport", - "__glXDisp_WindowPos3fARB", - "__glXDrawArraysSize", - "__glXDrawPixelsReqSize", - "__glXDrawableRes", - "__glXErrorOccured", - "__glXFBInitDrawable", - "__glXFBMemSwapBuffers", - "__glXFindDrawablePrivate", - "__glXFogfvReqSize", - "__glXFogivReqSize", - "__glXForceCurrent", - "__glXFree", - "__glXFreeBuffers", - "__glXFreeContext", - "__glXGetDrawablePrivate", - "__glXGetVisualConfigs", - "__glXImageSize", - "__glXImpAtoi", - "__glXImpCalloc", - "__glXImpFatal", - "__glXImpFclose", - "__glXImpFopen", - "__glXImpFprintf", - "__glXImpFree", - "__glXImpGetDrawablePrivate", - "__glXImpGetenv", - "__glXImpMalloc", - "__glXImpRealloc", - "__glXImpSprintf", - "__glXImpWarning", - "__glXInitFB", - "__glXInitMem", - "__glXInitPix", - "__glXIsDirect", - "__glXLastContext", - "__glXLightModelfvReqSize", - "__glXLightModelivReqSize", - "__glXLightfvReqSize", - "__glXLightivReqSize", - "__glXLookupContextByTag", - "__glXMakeCurrent", - "__glXMalloc", - "__glXMap1dReqSize", - "__glXMap1fReqSize", - "__glXMap2dReqSize", - "__glXMap2fReqSize", - "__glXMaterialfvReqSize", - "__glXMaterialivReqSize", - "__glXNoSuchRenderOpcode", - "__glXNoSuchSingleOpcode", - "__glXNop", - "__glXPixInitDrawable", - "__glXPixelMapfvReqSize", - "__glXPixelMapuivReqSize", - "__glXPixelMapusvReqSize", - "__glXPixmapRes", - "__glXPrioritizeTexturesReqSize", - "__glXQueryContextInfoEXT", - "__glXQueryExtensionsString", - "__glXQueryServerString", - "__glXQueryVersion", - "__glXRealloc", - "__glXRender", - "__glXRenderLarge", - "__glXRenderSizeTable", - "__glXRenderSizeTable_EXT", - "__glXRenderTable", - "__glXRenderTable_EXT", - "__glXReply", - "__glXResetLargeCommandStatus", - "__glXResizeBuffers", - "__glXResizeDrawableBuffers", - "__glXScreenInit", - "__glXScreenReset", - "__glXSeparableFilter2DReqSize", - "__glXSingleTable", - "__glXSwapBuffers", - "__glXSwapClientInfo", - "__glXSwapCopyContext", - "__glXSwapCreateContext", - "__glXSwapCreateGLXPixmap", - "__glXSwapDestroyContext", - "__glXSwapDestroyGLXPixmap", - "__glXSwapGetVisualConfigs", - "__glXSwapIsDirect", - "__glXSwapIsDirectReply", - "__glXSwapMakeCurrent", - "__glXSwapMakeCurrentReply", - "__glXSwapQueryContextInfoEXTReply", - "__glXSwapQueryExtensionsString", - "__glXSwapQueryServerString", - "__glXSwapQueryVersion", - "__glXSwapQueryVersionReply", - "__glXSwapRender", - "__glXSwapRenderLarge", - "__glXSwapRenderTable", - "__glXSwapRenderTable_EXT", - "__glXSwapSingleTable", - "__glXSwapSwapBuffers", - "__glXSwapUseXFont", - "__glXSwapVendorPrivTable_EXT", - "__glXSwapVendorPrivate", - "__glXSwapVendorPrivateWithReply", - "__glXSwapWaitGL", - "__glXSwapWaitX", - "__glXTexEnvfvReqSize", - "__glXTexEnvivReqSize", - "__glXTexGendvReqSize", - "__glXTexGenfvReqSize", - "__glXTexGenivReqSize", - "__glXTexImage1DReqSize", - "__glXTexImage2DReqSize", - "__glXTexImage3DReqSize", - "__glXTexParameterfvReqSize", - "__glXTexParameterivReqSize", - "__glXTexSubImage1DReqSize", - "__glXTexSubImage2DReqSize", - "__glXTexSubImage3DReqSize", - "__glXTypeSize", - "__glXUnrefDrawablePrivate", - "__glXUnsupportedPrivateRequest", - "__glXUseXFont", - "__glXVendorPrivTable_EXT", - "__glXVendorPrivate", - "__glXVendorPrivateWithReply", - "__glXWaitGL", - "__glXWaitX", - "__glXcombine_strings", - "glAccum", - "glActiveStencilFaceEXT", - "glActiveTextureARB", - "glAlphaFunc", - "glAreTexturesResident", - "glAreTexturesResidentEXT", - "glBegin", - "glBindTexture", - "glBitmap", - "glBlendColor", - "glBlendEquation", - "glBlendFunc", - "glCallList", - "glCallLists", - "glClear", - "glClearAccum", - "glClearColor", - "glClearDepth", - "glClearIndex", - "glClearStencil", - "glClipPlane", - "glColor3bv", - "glColor3dv", - "glColor3fv", - "glColor3iv", - "glColor3sv", - "glColor3ubv", - "glColor3uiv", - "glColor3usv", - "glColor4bv", - "glColor4dv", - "glColor4fv", - "glColor4iv", - "glColor4sv", - "glColor4ubv", - "glColor4uiv", - "glColor4usv", - "glColorMask", - "glColorMaterial", - "glColorPointer", - "glColorSubTable", - "glColorTable", - "glColorTableParameterfv", - "glColorTableParameteriv", - "glConvolutionFilter1D", - "glConvolutionFilter2D", - "glConvolutionParameterf", - "glConvolutionParameterfv", - "glConvolutionParameteri", - "glConvolutionParameteriv", - "glCopyColorSubTable", - "glCopyColorTable", - "glCopyConvolutionFilter1D", - "glCopyConvolutionFilter2D", - "glCopyPixels", - "glCopyTexImage1D", - "glCopyTexImage2D", - "glCopyTexSubImage1D", - "glCopyTexSubImage2D", - "glCopyTexSubImage3D", - "glCullFace", - "glDeleteLists", - "glDeleteTextures", - "glDeleteTexturesEXT", - "glDepthFunc", - "glDepthMask", - "glDepthRange", - "glDisable", - "glDisableClientState", - "glDrawArrays", - "glDrawBuffer", - "glDrawPixels", - "glEdgeFlagPointer", - "glEdgeFlagv", - "glEnable", - "glEnableClientState", - "glEnd", - "glEndList", - "glEvalCoord1dv", - "glEvalCoord1fv", - "glEvalCoord2dv", - "glEvalCoord2fv", - "glEvalMesh1", - "glEvalMesh2", - "glEvalPoint1", - "glEvalPoint2", - "glFeedbackBuffer", - "glFinish", - "glFlush", - "glFogf", - "glFogfv", - "glFogi", - "glFogiv", - "glFrontFace", - "glFrustum", - "glGenLists", - "glGenTextures", - "glGenTexturesEXT", - "glGetBooleanv", - "glGetClipPlane", - "glGetColorTable", - "glGetColorTableParameterfv", - "glGetColorTableParameteriv", - "glGetConvolutionFilter", - "glGetConvolutionParameterfv", - "glGetConvolutionParameteriv", - "glGetDoublev", - "glGetError", - "glGetFloatv", - "glGetHistogram", - "glGetHistogramParameterfv", - "glGetHistogramParameteriv", - "glGetIntegerv", - "glGetLightfv", - "glGetLightiv", - "glGetMapdv", - "glGetMapfv", - "glGetMapiv", - "glGetMaterialfv", - "glGetMaterialiv", - "glGetMinmax", - "glGetMinmaxParameterfv", - "glGetMinmaxParameteriv", - "glGetPixelMapfv", - "glGetPixelMapuiv", - "glGetPixelMapusv", - "glGetPolygonStipple", - "glGetSeparableFilter", - "glGetString", - "glGetTexEnvfv", - "glGetTexEnviv", - "glGetTexGendv", - "glGetTexGenfv", - "glGetTexGeniv", - "glGetTexImage", - "glGetTexLevelParameterfv", - "glGetTexLevelParameteriv", - "glGetTexParameterfv", - "glGetTexParameteriv", - "glHint", - "glHistogram", - "glIndexMask", - "glIndexPointer", - "glIndexdv", - "glIndexfv", - "glIndexiv", - "glIndexsv", - "glIndexubv", - "glInitNames", - "glIsEnabled", - "glIsList", - "glIsTexture", - "glIsTextureEXT", - "glLightModelf", - "glLightModelfv", - "glLightModeli", - "glLightModeliv", - "glLightf", - "glLightfv", - "glLighti", - "glLightiv", - "glLineStipple", - "glLineWidth", - "glListBase", - "glLoadIdentity", - "glLoadMatrixd", - "glLoadMatrixf", - "glLoadName", - "glLogicOp", - "glMap1d", - "glMap1f", - "glMap2d", - "glMap2f", - "glMapGrid1d", - "glMapGrid1f", - "glMapGrid2d", - "glMapGrid2f", - "glMaterialf", - "glMaterialfv", - "glMateriali", - "glMaterialiv", - "glMatrixMode", - "glMinmax", - "glMultMatrixd", - "glMultMatrixf", - "glMultiTexCoord1dvARB", - "glMultiTexCoord1fvARB", - "glMultiTexCoord1ivARB", - "glMultiTexCoord1svARB", - "glMultiTexCoord2dvARB", - "glMultiTexCoord2fvARB", - "glMultiTexCoord2ivARB", - "glMultiTexCoord2svARB", - "glMultiTexCoord3dvARB", - "glMultiTexCoord3fvARB", - "glMultiTexCoord3ivARB", - "glMultiTexCoord3svARB", - "glMultiTexCoord4dvARB", - "glMultiTexCoord4fvARB", - "glMultiTexCoord4ivARB", - "glMultiTexCoord4svARB", - "glNewList", - "glNormal3bv", - "glNormal3dv", - "glNormal3fv", - "glNormal3iv", - "glNormal3sv", - "glNormalPointer", - "glOrtho", - "glPassThrough", - "glPixelMapfv", - "glPixelMapuiv", - "glPixelMapusv", - "glPixelStoref", - "glPixelStorei", - "glPixelTransferf", - "glPixelTransferi", - "glPixelZoom", - "glPointParameterfARB", - "glPointParameterfvARB", - "glPointSize", - "glPolygonMode", - "glPolygonOffset", - "glPolygonStipple", - "glPopAttrib", - "glPopMatrix", - "glPopName", - "glPrioritizeTextures", - "glPushAttrib", - "glPushMatrix", - "glPushName", - "glRasterPos2dv", - "glRasterPos2fv", - "glRasterPos2iv", - "glRasterPos2sv", - "glRasterPos3dv", - "glRasterPos3fv", - "glRasterPos3iv", - "glRasterPos3sv", - "glRasterPos4dv", - "glRasterPos4fv", - "glRasterPos4iv", - "glRasterPos4sv", - "glReadBuffer", - "glReadPixels", - "glRectdv", - "glRectfv", - "glRectiv", - "glRectsv", - "glRenderMode", - "glResetHistogram", - "glResetMinmax", - "glRotated", - "glRotatef", - "glScaled", - "glScalef", - "glScissor", - "glSelectBuffer", - "glSeparableFilter2D", - "glShadeModel", - "glStencilFunc", - "glStencilMask", - "glStencilOp", - "glTexCoord1dv", - "glTexCoord1fv", - "glTexCoord1iv", - "glTexCoord1sv", - "glTexCoord2dv", - "glTexCoord2fv", - "glTexCoord2iv", - "glTexCoord2sv", - "glTexCoord3dv", - "glTexCoord3fv", - "glTexCoord3iv", - "glTexCoord3sv", - "glTexCoord4dv", - "glTexCoord4fv", - "glTexCoord4iv", - "glTexCoord4sv", - "glTexCoordPointer", - "glTexEnvf", - "glTexEnvfv", - "glTexEnvi", - "glTexEnviv", - "glTexGend", - "glTexGendv", - "glTexGenf", - "glTexGenfv", - "glTexGeni", - "glTexGeniv", - "glTexImage1D", - "glTexImage2D", - "glTexImage3D", - "glTexParameterf", - "glTexParameterfv", - "glTexParameteri", - "glTexParameteriv", - "glTexSubImage1D", - "glTexSubImage2D", - "glTexSubImage3D", - "glTranslated", - "glTranslatef", - "glVertex2dv", - "glVertex2fv", - "glVertex2iv", - "glVertex2sv", - "glVertex3dv", - "glVertex3fv", - "glVertex3iv", - "glVertex3sv", - "glVertex4dv", - "glVertex4fv", - "glVertex4iv", - "glVertex4sv", - "glVertexPointer", - "glViewport", - "glWindowPos3fARB", - "glxSwapQueryExtensionsStringReply", - "glxSwapQueryServerStringReply", - NULL -}; - -static XF86ModuleVersionInfo VersRec = -{ - "glx", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} -}; - -XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL }; - -static void * -glxSetup(void * module, void * opts, int *errmaj, int *errmin) -{ - static Bool setupDone = FALSE; - void * GLcore = NULL; -#ifdef GLX_USE_SGI_SI - char GLcoreName[] = "GL"; -#else - char GLcoreName[] = "GLcore"; -#endif - - if (!setupDone) { - setupDone = TRUE; - - GLcore = LoadSubModule(module, GLcoreName, NULL, NULL, NULL, NULL, - errmaj, errmin); - if (!GLcore) { - if (errmaj) *errmaj = LDR_NOSUBENT; - } else { - LoaderReqSymLists(glcoreSymbols, NULL); - LoadExtension(&GLXExt, FALSE); - /* Wrap the init visuals routine in micmap.c */ - GlxWrapInitVisuals(&miInitVisualsProc); - /* Make sure this gets wrapped each time InitVisualWrap is called */ - miHookInitVisuals(NULL, GlxWrapInitVisuals); - } - } else { - if (errmaj) *errmaj = LDR_ONCEONLY; - } - /* Need a non-NULL return value to indicate success */ - return GLcore; -} diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c deleted file mode 100644 index 34eb4d673..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c +++ /dev/null @@ -1,63 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -static MODULESETUPPROTO(GLcoreSetup); - -static XF86ModuleVersionInfo VersRec = -{ - "GLcore", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} -}; - -XF86ModuleData GLcoreModuleData = { &VersRec, GLcoreSetup, NULL }; - -static void * -GLcoreSetup(void * module, void * opts, int *errmaj, int *errmin) -{ - /* Need a non-NULL return value to indicate success */ - return (void *)1; -} diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile index 698cba2d9..5fb93b364 100644 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile @@ -1,7 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif - #include #define NeedAllMesaSrc @@ -29,11 +25,6 @@ #include "../X/Imakefile.inc" #include "../Imakefile.inc" -#ifdef IHaveModules - MSRCS = GLcoremodule.c - MOBJS = GLcoremodule.o -#endif - XOBJS = ../X/?*.o OBJS = $(COREMESAOBJS) $(MOBJS) @@ -50,16 +41,8 @@ DEFINES = $(GLX_DEFINES) -#ifdef IHaveModules -ModuleObjectRule() - -DepLibraryModuleTarget(GLcore, $(DONES) $(OBJS),$(OBJS) $(XOBJS)) -InstallLibraryModule(GLcore,$(MODULEDIR),extensions) - -#else NormalDepLibraryTarget(GLcore, $(DONES) $(OBJS), $(OBJS) $(XOBJS)) NormalLibraryObjectRule() -#endif InstallDriverSDKLibraryModule(GLcore,$(DRIVERSDKMODULEDIR),extensions) diff --git a/nx-X11/programs/Xserver/GL/mesa/Imakefile b/nx-X11/programs/Xserver/GL/mesa/Imakefile index 7f9b5191c..f1dbbe101 100644 --- a/nx-X11/programs/Xserver/GL/mesa/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/Imakefile @@ -1,7 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif - #define IHaveSubdirs SUBDIRS = main math array_cache swrast swrast_setup tnl shader X GLcore $(MODSUBDIR) @@ -20,11 +16,7 @@ DEFINES = $(GLX_DEFINES) -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif #ifdef IHaveSubdirs MakeSubdirs($(SUBDIRS)) diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile index c8ea2ab72..f8812e096 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile @@ -1,7 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif - #include #define NeedAllMesaSrc @@ -42,11 +38,7 @@ LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) @@ -59,10 +51,6 @@ MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) #endif -#if defined(IHaveModules) && BuildModuleInSubdir -LinkSourceFile(xf86glx.c,..) -LinkSourceFile(xf86glx_util.c,..) -#endif #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri diff --git a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile index 548c6adb0..474710747 100644 --- a/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/array_cache/Imakefile @@ -1,7 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif - #include #define NeedAllMesaSrc @@ -25,11 +21,7 @@ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) diff --git a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile index ff95bd187..d6e914b89 100644 --- a/nx-X11/programs/Xserver/GL/mesa/main/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/main/Imakefile @@ -1,7 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif - /* Large PIC tables needed for Solaris/SPARC builds */ #if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags) PICFLAGS = LargePositionIndependentCFlags @@ -29,11 +25,7 @@ DEFINES = $(GLX_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) diff --git a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile index 77e7f7664..6af3a0a0c 100644 --- a/nx-X11/programs/Xserver/GL/mesa/math/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/math/Imakefile @@ -1,7 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif - #include #define NeedAllMesaSrc @@ -24,11 +20,7 @@ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile index b52d193d3..bf3acd4f6 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/Imakefile @@ -1,6 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif #define IHaveSubdirs SUBDIRS = grammar slang @@ -29,11 +26,7 @@ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile index 56cfb4bc9..3fe604f2e 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/grammar/Imakefile @@ -1,6 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif #include @@ -25,11 +22,7 @@ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile index 572000f26..d5ec4d6cf 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile @@ -1,6 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif #define IHaveSubdirs SUBDIRS = library @@ -28,11 +25,7 @@ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile index d6de08e1b..8c216804d 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Imakefile @@ -1,6 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif #include @@ -22,11 +19,7 @@ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif DependTarget() diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile index bf4df7b4a..df47a1caa 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/swrast/Imakefile @@ -1,7 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif - /* Large PIC tables needed for Solaris/SPARC builds */ #if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags) PICFLAGS = LargePositionIndependentCFlags @@ -32,11 +28,7 @@ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) diff --git a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile index ca29177a0..be2ce62a4 100644 --- a/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/swrast_setup/Imakefile @@ -1,7 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif - #include #define NeedAllMesaSrc @@ -24,11 +20,7 @@ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) diff --git a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile index 2fec2d03f..b36454259 100644 --- a/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/tnl/Imakefile @@ -1,7 +1,3 @@ -#if DoLoadableServer -#define IHaveModules -#endif - /* Large PIC tables needed for Solaris/SPARC builds */ #if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags) PICFLAGS = LargePositionIndependentCFlags @@ -34,11 +30,7 @@ DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ -#ifdef IHaveModules -ModuleObjectRule() -#else NormalLibraryObjectRule() -#endif SubdirLibraryRule($(OBJS)) diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index ae11a18c2..7bb8132da 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -61,13 +61,8 @@ INSTPGMFLAGS = #define AllFBLibs PreFbLibs $(FB) PostFbLibs #if BuildGlxExt -# if DoLoadableServer GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ GL/mesa/GLcore/ModuleLibraryTargetName(GLcore) -# else - GLXLIB = GL/glx/ModuleLibraryTargetName(glx) \ - GL/mesa/GLcore/ModuleLibraryTargetName(GLcore) -# endif GLXDIR = GL GLXEXT = $(GLXLIB) #endif @@ -100,15 +95,9 @@ INSTPGMFLAGS = #endif #ifdef SiteExtensionDirs SITEEXTDIRS = SiteExtensionDirs -#endif -#if DoLoadableServer && HasDlopen - LIBDL = DlLibrary #endif LIBREGEX = RegexLibrary -#if DoLoadableServer - LIBCWRAPPER = os/libcwrapper.o -#endif #if BuildRender RENDERDIR = render @@ -130,46 +119,24 @@ INSTPGMFLAGS = CWDIR = miext/cw COMPOSITEDIR = composite COMPOSITELIB = $(COMPOSITEDIR)/libcomposite.a -#if DoLoadableServer - CW = miext/cw/ModuleLibraryTargetName(cw) -#else CW = miext/cw/LibraryTargetName(cw) #endif -#endif -#if DoLoadableServer - EXTENSIONS = $(COMPOSITELIB) $(DAMAGELIB) $(DAMAGE) $(FIXESLIB) $(CW) \ - $(OTHEREXTS) $(RANDRLIB) $(RENDERLIB) - LOADABLEEXTS = $(MISCEXT) $(DBEEXT) $(RECORDEXT) $(GLXEXT) - MISCEXT = Xext/LibraryTargetName(ext) - OTHEREXTS = Xext/LibraryTargetName(exts) $(XKBEXT) $(XINPUTEXT) \ - $(SITEEXTS) -#else EXTENSIONS = $(COMPOSITELIB) $(DAMAGELIB) $(DAMAGE) $(FIXESLIB) $(CW) \ $(OTHEREXTS) $(GLXEXT) $(RANDRLIB) $(RENDERLIB) OTHEREXTS = Xext/LibraryTargetName(ext) $(XKBEXT) $(XINPUTEXT) \ $(DBEEXT) $(RECORDEXT) $(SITEEXTS) -#endif EXTDIRS = Xext $(XKBDIR) $(XIDIR) $(GLXDIR) \ $(DBEDIR) $(RECORDDIR) $(SITEEXTDIRS) \ $(RANDRDIR) $(RENDERDIR) $(XPCONFIGDIR) \ $(FIXESDIR) $(DAMAGEDIR) $(CWDIR) $(COMPOSITEDIR) OS = os/LibraryTargetName(os) BSDEMUL = $(DEPXBSDLIB) -#if DoLoadableServer - FB = fb/ModuleLibraryTargetName(fb) -#if (!(defined(NXAgentServer) && NXAgentServer)) - DAMAGE = miext/damage/ModuleLibraryTargetName(damage) -#endif - SHADOW = miext/shadow/ModuleLibraryTargetName(shadow) - LAYER = miext/layer/ModuleLibraryTargetName(layer) -#else FB = fb/LibraryTargetName(fb) #if (!(defined(NXAgentServer) && NXAgentServer)) DAMAGE = miext/damage/LibraryTargetName(damage) #endif SHADOW = miext/shadow/LibraryTargetName(shadow) LAYER = miext/layer/LibraryTargetName(layer) -#endif #if !HasFfs && (defined(mingwArchitecture) || defined(cygwinArchitecture)) /* Order of libraries is important when linking in mingw or * cygwin. libmi.a requires ffs from libdix.a. So it is added @@ -220,11 +187,11 @@ XCOMM #if defined(NXAgentServer) && NXAgentServer NXAGENT = nxagent #endif -#if defined(NXWinServer) && NXWinServer && !MakeDllModules +#if defined(NXWinServer) && NXWinServer NXWIN = NXWin #endif #if (defined(NXAgentServer) && NXAgentServer) || \ - (!MakeDllModules && defined(NXWinServer) && NXWinServer) + (defined(NXWinServer) && NXWinServer) MakeMutex($(NXAGENT) $(NXWIN)) #endif MakeMutex($(STDDIRS) fb) @@ -568,20 +535,3 @@ ForceSubdirs($(DEPDIRS) $(SUBDIRS)) DEFAULTFONTPATH = DefaultFontPath EXTRAMANDEFS = -D__default_font_path__="`echo $(DEFAULTFONTPATH) | sed -e 's/,/, /g'`" - -#if MakeDllModules && DoLoadableServer && \ - (defined(SunArchitecture) && defined(SVR4Architecture)) -XCOMM Hackery for building dlopen-able .so modules on Solaris - -AllTarget(linker-deps) - -LINKER_DEPS_DIRS = $(SUBDIRS) - -XCOMM After everything is built, run through and generate linker dependencies -linker-deps: - RunPerlScript($(XF86SRC)/os-support/sunos/find_deps.pl,-R ProjectRoot $(LINKER_DEPS_DIRS)) - for i in $(LINKER_DEPS_DIRS) ; do \ - echo "relinking with dependency flags in $(CURRENT_DIR)/$$i..."; \ - MakeNamedTargetSubdir($$i,NullParameter,all) ; \ - done -#endif diff --git a/nx-X11/programs/Xserver/Xext/Imakefile b/nx-X11/programs/Xserver/Xext/Imakefile index cf62aa228..becc7b66e 100644 --- a/nx-X11/programs/Xserver/Xext/Imakefile +++ b/nx-X11/programs/Xserver/Xext/Imakefile @@ -118,10 +118,6 @@ NormalLibraryTarget(ext,$(OBJS)) LintLibraryTarget(ext,$(SRCS)) NormalLintTarget($(SRCS)) -#if DoLoadableServer -NormalLibraryTarget(exts,$(SOBJS)) -#endif - #if BuildXF86BigfontExt SpecialCObjectRule(xf86bigfont,$(ICONFIGFILES),$(SHM_DEFINES)) #endif @@ -137,10 +133,5 @@ InstallNonExecFile(SecurityPolicy,$(SERVERCONFIGDIR)) DependTarget() -#if DoLoadableServer -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - InstallDriverSDKNonExecFile(xvdix.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(xvmcext.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/nx-X11/programs/Xserver/Xext/xvmod.c b/nx-X11/programs/Xserver/Xext/xvmod.c deleted file mode 100644 index 469bd950d..000000000 --- a/nx-X11/programs/Xserver/Xext/xvmod.c +++ /dev/null @@ -1,23 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "scrnintstr.h" -#include "gc.h" -#include -#include -#include "xvdix.h" -#include "xvmodproc.h" - -void -XvRegister() -{ - XvScreenInitProc = XvScreenInit; - XvGetScreenIndexProc = XvGetScreenIndex; - XvGetRTPortProc = XvGetRTPort; - XvMCScreenInitProc = XvMCScreenInit; -} - diff --git a/nx-X11/programs/Xserver/Xext/xvmodproc.h b/nx-X11/programs/Xserver/Xext/xvmodproc.h deleted file mode 100644 index 81356a149..000000000 --- a/nx-X11/programs/Xserver/Xext/xvmodproc.h +++ /dev/null @@ -1,13 +0,0 @@ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "xvmcext.h" - -extern int (*XvGetScreenIndexProc)(void); -extern unsigned long (*XvGetRTPortProc)(void); -extern int (*XvScreenInitProc)(ScreenPtr); -extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr); - -extern void XvRegister(void); diff --git a/nx-X11/programs/Xserver/dbe/Imakefile b/nx-X11/programs/Xserver/dbe/Imakefile index 4e03a03ad..54ce471c5 100644 --- a/nx-X11/programs/Xserver/dbe/Imakefile +++ b/nx-X11/programs/Xserver/dbe/Imakefile @@ -1,12 +1,5 @@ -#if DoLoadableServer -#define IHaveSubdirs -#endif - #include -#if DoLoadableServer - SUBDIRS = module -#endif SRCS = dbe.c midbe.c OBJS = dbe.o midbe.o @@ -20,10 +13,6 @@ NormalLibraryTarget(dbe,$(OBJS)) LintLibraryTarget(dbe,$(SRCS)) NormalLintTarget($(SRCS)) -#if DoLoadableServer -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif DependTarget() diff --git a/nx-X11/programs/Xserver/dbe/dbemodule.c b/nx-X11/programs/Xserver/dbe/dbemodule.c deleted file mode 100644 index 00be6cb49..000000000 --- a/nx-X11/programs/Xserver/dbe/dbemodule.c +++ /dev/null @@ -1,47 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" -#include "globals.h" - -static MODULESETUPPROTO(dbeSetup); - -extern void DbeExtensionInit(void); - -ExtensionModule dbeExt = { - DbeExtensionInit, - "DOUBLE-BUFFER", - &noDbeExtension, - NULL, - NULL -}; - -static XF86ModuleVersionInfo VersRec = -{ - "dbe", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_EXTENSION, - {0,0,0,0} -}; - -/* - * Data for the loader - */ -XF86ModuleData dbeModuleData = { &VersRec, dbeSetup, NULL }; - -static void * -dbeSetup(void * module, void * opts, int *errmaj, int *errmin) -{ - LoadExtension(&dbeExt, FALSE); - - /* Need a non-NULL return value to indicate success */ - return (void *)1; -} diff --git a/nx-X11/programs/Xserver/dbe/module/Imakefile b/nx-X11/programs/Xserver/dbe/module/Imakefile deleted file mode 100644 index 8b099e844..000000000 --- a/nx-X11/programs/Xserver/dbe/module/Imakefile +++ /dev/null @@ -1,30 +0,0 @@ -#define IHaveModules -#include - -#if DoLoadableServer - MSRCS = dbemodule.c - MOBJS = dbemodule.o -#endif - - SRCS = dbe.c midbe.c $(MSRCS) - OBJS = dbe.o midbe.o $(MOBJS) - INCLUDES = -I.. -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) $(EXTRAINCLUDES) - LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln - DEFINES = $(EXT_DEFINES) - -LinkSourceFile(dbemodule.c,..) -LinkSourceFile(midbe.c,..) -LinkSourceFile(dbe.c,..) - -ModuleObjectRule() - -LibraryModuleTarget(dbe,$(OBJS)) - -LintLibraryTarget(dbe,$(SRCS)) -NormalLintTarget($(SRCS)) - -InstallLibraryModule(dbe,$(MODULEDIR),extensions) - -DependTarget() - -InstallDriverSDKLibraryModule(dbe,$(DRIVERSDKMODULEDIR),extensions) diff --git a/nx-X11/programs/Xserver/fb/Imakefile b/nx-X11/programs/Xserver/fb/Imakefile index 43960fc98..eb61db95a 100644 --- a/nx-X11/programs/Xserver/fb/Imakefile +++ b/nx-X11/programs/Xserver/fb/Imakefile @@ -17,14 +17,6 @@ SpecialCObjectRule(fbcopy,fbcopy.c,$(USEMMXOPTIONS)) #endif */ -#if DoLoadableServer -#if !BuildModuleInSubdir -#define IHaveModules -#elif !defined(IHaveModules) -#define IHaveSubdirs -SUBDIRS = module -#endif -#endif #include @@ -32,10 +24,6 @@ SUBDIRS = module FB_DEFINES=-DFBNOPIXADDR -DFBNO24BIT #endif -#if defined(IHaveModules) -XFMODSRC = fbmodule.c -XFMODOBJ = fbmodule.o -#endif #if BuildRender RENDERSRC = fbcompose.c @@ -131,21 +119,13 @@ OBJS = $(XFMODOBJ) \ LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ $(SERVERSRC)/mi/llib-lmi.ln -#ifdef IHaveModules -ModuleObjectRule() -LibraryModuleTarget(fb,$(OBJS)) -#else NormalLibraryObjectRule() NormalLibraryTarget(fb,$(OBJS)) -#endif LintLibraryTarget(fb,$(SRCS)) NormalLintTarget($(SRCS)) -#ifdef IHaveModules -InstallLibraryModule(fb,$(MODULEDIR),.) -#endif DependTarget() diff --git a/nx-X11/programs/Xserver/fb/fbmodule.c b/nx-X11/programs/Xserver/fb/fbmodule.c deleted file mode 100644 index 0e6cd2dba..000000000 --- a/nx-X11/programs/Xserver/fb/fbmodule.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice 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 - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#ifdef XFree86LOADER - -#include "xf86Module.h" -#include "fb.h" - -static XF86ModuleVersionInfo VersRec = -{ - "fb", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_ANSIC, /* Only need the ansic layer */ - ABI_ANSIC_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData fbModuleData = { &VersRec, NULL, NULL }; - -#endif diff --git a/nx-X11/programs/Xserver/fb/module/Imakefile b/nx-X11/programs/Xserver/fb/module/Imakefile deleted file mode 100644 index d063bc28d..000000000 --- a/nx-X11/programs/Xserver/fb/module/Imakefile +++ /dev/null @@ -1,4 +0,0 @@ -#define IHaveModules -#define LinkDirectory .. - -#include "../Imakefile" diff --git a/nx-X11/programs/Xserver/include/Imakefile b/nx-X11/programs/Xserver/include/Imakefile index 03c389989..8c89fbc2b 100644 --- a/nx-X11/programs/Xserver/include/Imakefile +++ b/nx-X11/programs/Xserver/include/Imakefile @@ -2,10 +2,6 @@ HEADERS = os.h misc.h #if defined(XorgVersion) \ || defined(BSDOSArchitecture) -#if DoLoadableServer -LinkSourceFile(xf86Module.h,$(XF86COMSRC)) -LinkSourceFile(xf86Opt.h,$(XF86COMSRC)) -#endif #endif LinkSourceFile(osdep.h,../os) diff --git a/nx-X11/programs/Xserver/mi/Imakefile b/nx-X11/programs/Xserver/mi/Imakefile index 9f7b062df..fda19aa59 100644 --- a/nx-X11/programs/Xserver/mi/Imakefile +++ b/nx-X11/programs/Xserver/mi/Imakefile @@ -36,12 +36,8 @@ CBRT_OBJ = cbrt.o FFS_DEFINES = -DHAS_FFS #endif -#if DoLoadableServer -EXTRAMIINITEXTOBJ = miinitext.o -#else MIINITEXTSRC = miinitext.c MIINITEXTOBJ = miinitext.o -#endif #if (!(defined(NXAgentServer) && NXAgentServer)) NXAGENT_SKIP_SRCS = \ diff --git a/nx-X11/programs/Xserver/miext/cw/Imakefile b/nx-X11/programs/Xserver/miext/cw/Imakefile index 795ed1987..395e60a48 100644 --- a/nx-X11/programs/Xserver/miext/cw/Imakefile +++ b/nx-X11/programs/Xserver/miext/cw/Imakefile @@ -1,4 +1,3 @@ -#define IHaveModules #include SRCS = cw.c cw_ops.c cw_render.c diff --git a/nx-X11/programs/Xserver/os/Imakefile b/nx-X11/programs/Xserver/os/Imakefile index 047ad6615..e78b422ab 100644 --- a/nx-X11/programs/Xserver/os/Imakefile +++ b/nx-X11/programs/Xserver/os/Imakefile @@ -188,9 +188,4 @@ SpecialCObjectRule(oscolor,$(ICONFIGFILES),$(DBM_DEFINES)) LinkSourceFile(snprintf.c,$(LIBSRC)/misc) #endif -#if DoLoadableServer -AllTarget(libcwrapper.o) -ObjectFromSpecialSource(libcwrapper,$(XF86OSSRC)/shared/libc_wrapper,-DSELF_CONTAINED_WRAPPER) -#endif - DependTarget() diff --git a/nx-X11/programs/Xserver/record/Imakefile b/nx-X11/programs/Xserver/record/Imakefile index fc74ec4da..40c29fe6f 100644 --- a/nx-X11/programs/Xserver/record/Imakefile +++ b/nx-X11/programs/Xserver/record/Imakefile @@ -1,14 +1,8 @@ NULL = -#if DoLoadableServer -#define IHaveSubdirs -#endif #include -#if DoLoadableServer - SUBDIRS = module -#endif SRCS = record.c set.c OBJS = record.o set.o INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext `pkg-config --cflags-only-I pixman-1` @@ -28,9 +22,5 @@ NormalLibraryTarget(record,$(OBJS)) LintLibraryTarget(record,$(SRCS)) NormalLintTarget($(SRCS)) -#if DoLoadableServer -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif DependTarget() diff --git a/nx-X11/programs/Xserver/record/module/Imakefile b/nx-X11/programs/Xserver/record/module/Imakefile deleted file mode 100644 index fd78192fb..000000000 --- a/nx-X11/programs/Xserver/record/module/Imakefile +++ /dev/null @@ -1,29 +0,0 @@ -#define IHaveModules -#include - -#if DoLoadableServer - MSRCS = recordmod.c - MOBJS = recordmod.o -#endif - - SRCS = record.c set.c $(MSRCS) - OBJS = record.o set.o $(MOBJS) - INCLUDES = -I.. -I../../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(SERVERSRC)/Xext - LINTLIBS = ../../dix/llib-ldix.ln - DEFINES = -DNDEBUG - -LinkSourceFile(recordmod.c,..) -LinkSourceFile(record.c,..) -LinkSourceFile(set.c,..) - -ModuleObjectRule() -LibraryModuleTarget(record,$(OBJS)) -LintLibraryTarget(record,$(SRCS)) -NormalLintTarget($(SRCS)) - -InstallLibraryModule(record,$(MODULEDIR),extensions) - -DependTarget() - -InstallDriverSDKLibraryModule(record,$(DRIVERSDKMODULEDIR),extensions) diff --git a/nx-X11/programs/Xserver/record/recordmod.c b/nx-X11/programs/Xserver/record/recordmod.c deleted file mode 100644 index bd50bbd5b..000000000 --- a/nx-X11/programs/Xserver/record/recordmod.c +++ /dev/null @@ -1,45 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -extern Bool noTestExtensions; - -static MODULESETUPPROTO(recordSetup); - -extern void RecordExtensionInit(void); - -ExtensionModule recordExt = { - RecordExtensionInit, - "RECORD", - &noTestExtensions, - NULL, - NULL -}; - -static XF86ModuleVersionInfo VersRec = { - "record", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 13, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_EXTENSION, - {0,0,0,0} -}; - -XF86ModuleData recordModuleData = { &VersRec, recordSetup, NULL }; - -static void * -recordSetup(void * module, void * opts, int *errmaj, int *errmin) -{ - LoadExtension(&recordExt, FALSE); - - /* Need a non-NULL return value to indicate success */ - return (void *)1; -} - -- cgit v1.2.3 From b7daac27299c09d838104a7dbede2d7a17b75289 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sun, 30 Oct 2016 17:54:46 +0100 Subject: remove *-def.cpp never used --- nx-X11/lib/X11/X11-def.cpp | 2011 -------------------- nx-X11/programs/Xserver/GL/glx/glx-def.cpp | 662 ------- .../programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp | 1461 -------------- 3 files changed, 4134 deletions(-) delete mode 100644 nx-X11/lib/X11/X11-def.cpp delete mode 100644 nx-X11/programs/Xserver/GL/glx/glx-def.cpp delete mode 100644 nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/lib/X11/X11-def.cpp b/nx-X11/lib/X11/X11-def.cpp deleted file mode 100644 index 448b40231..000000000 --- a/nx-X11/lib/X11/X11-def.cpp +++ /dev/null @@ -1,2011 +0,0 @@ -#ifndef __CYGWIN__ -LIBRARY X11 -#else -LIBRARY libX11 -#endif -VERSION LIBRARY_VERSION -EXPORTS -#if !defined(__CYGWIN__) && !defined(__UNIXOS2__) - _Xdebug_p=_Xdebug CONSTANT - _XCreateMutex_fn_p=_XCreateMutex_fn CONSTANT - _XFreeMutex_fn_p=_XFreeMutex_fn CONSTANT - _XLockMutex_fn_p=_XLockMutex_fn CONSTANT - _XUnlockMutex_fn_p=_XUnlockMutex_fn CONSTANT - _Xglobal_lock_p=_Xglobal_lock CONSTANT - _XFlushIt - XActivateScreenSaver - XAddConnectionWatch - XAddExtension - XAddHost - XAddHosts - XAddPixel - XAddToExtensionList - XAddToSaveSet - XAllPlanes - XAllocClassHint - XAllocColor - XAllocColorCells - XAllocColorPlanes - XAllocIconSize - XAllocNamedColor - XAllocSizeHints - XAllocStandardColormap - XAllocWMHints - XAllowEvents - XAutoRepeatOff - XAutoRepeatOn - XBaseFontNameListOfFontSet - XBell - XBitmapBitOrder - XBitmapPad - XBitmapUnit - XBlackPixel - XBlackPixelOfScreen - XCellsOfScreen - XChangeActivePointerGrab - XChangeGC - XChangeKeyboardControl - XChangeKeyboardMapping - XChangePointerControl - XChangeProperty - XChangeSaveSet - XChangeWindowAttributes - XCheckIfEvent - XCheckMaskEvent - XCheckTypedEvent - XCheckTypedWindowEvent - XCheckWindowEvent - XCirculateSubwindows - XCirculateSubwindowsDown - XCirculateSubwindowsUp - XClearArea - XClearWindow - XClipBox - XCloseDisplay - XCloseIM - XCloseOM - XConfigureWindow - XConnectionNumber - XContextDependentDrawing - XContextualDrawing - XConvertCase - XConvertSelection - XCopyArea - XCopyColormapAndFree - XCopyGC - XCopyPlane - XCreateBitmapFromData - XCreateColormap - XCreateFontCursor - XCreateFontSet - XCreateGC - XCreateGlyphCursor - XCreateIC - XCreateImage - XCreateOC - XCreatePixmap - XCreatePixmapCursor - XCreatePixmapFromBitmapData - XCreateRegion - XCreateSimpleWindow - XCreateWindow - XDefaultColormap - XDefaultColormapOfScreen - XDefaultDepth - XDefaultDepthOfScreen - XDefaultGC - XDefaultGCOfScreen - XDefaultRootWindow - XDefaultScreen - XDefaultScreenOfDisplay - XDefaultString - XDefaultVisual - XDefaultVisualOfScreen - XDefineCursor - XDeleteContext - XDeleteModifiermapEntry - XDeleteProperty - XDestroyIC - XDestroyImage - XDestroyOC - XDestroyRegion - XDestroySubwindows - XDestroyWindow - XDirectionalDependentDrawing - XDisableAccessControl - XDisplayCells - XDisplayHeight - XDisplayHeightMM - XDisplayKeycodes - XDisplayMotionBufferSize - XDisplayName - XDisplayOfIM - XDisplayOfOM - XDisplayOfScreen - XDisplayPlanes - XDisplayString - XDisplayWidth - XDisplayWidthMM - XDoesBackingStore - XDoesSaveUnders - XDrawArc - XDrawArcs - XDrawImageString - XDrawImageString16 - XDrawLine - XDrawLines - XDrawPoint - XDrawPoints - XDrawRectangle - XDrawRectangles - XDrawSegments - XDrawString - XDrawString16 - XDrawText - XDrawText16 - XEHeadOfExtensionList - XESetBeforeFlush - XESetCloseDisplay - XESetCopyGC - XESetCreateFont - XESetCreateGC - XESetError - XESetErrorString - XESetEventToWire - XESetFlushGC - XESetFreeFont - XESetFreeGC - XESetPrintErrorValues - XESetWireToError - XESetWireToEvent - XEmptyRegion - XEnableAccessControl - XEqualRegion - XEventMaskOfScreen - XEventsQueued - XExtendedMaxRequestSize - XExtentsOfFontSet - XFetchBuffer - XFetchBytes - XFetchName - XFillArc - XFillArcs - XFillPolygon - XFillRectangle - XFillRectangles - XFilterEvent - XFindContext - XFindOnExtensionList - XFlush - XFlushGC - XFontsOfFontSet - XForceScreenSaver - XFree - XFreeColormap - XFreeColors - XFreeCursor - XFreeExtensionList - XFreeFont - XFreeFontInfo - XFreeFontNames - XFreeFontPath - XFreeFontSet - XFreeGC - XFreeModifiermap - XFreePixmap - XFreeStringList - XGContextFromGC - XGeometry - XGetAtomName - XGetAtomNames - XGetClassHint - XGetCommand - XGetDefault - XGetErrorDatabaseText - XGetErrorText - XGetFontPath - XGetFontProperty - XGetGCValues - XGetGeometry - XGetICValues - XGetIMValues - XGetIconName - XGetIconSizes - XGetImage - XGetInputFocus - XGetKeyboardControl - XGetKeyboardMapping - XGetModifierMapping - XGetMotionEvents - XGetNormalHints - XGetOCValues - XGetOMValues - XGetPixel - XGetPointerControl - XGetPointerMapping - XGetRGBColormaps - XGetScreenSaver - XGetSelectionOwner - XGetSizeHints - XGetStandardColormap - XGetSubImage - XGetTextProperty - XGetTransientForHint - XGetVisualInfo - XGetWMClientMachine - XGetWMColormapWindows - XGetWMHints - XGetWMIconName - XGetWMName - XGetWMNormalHints - XGetWMProtocols - XGetWMSizeHints - XGetWindowAttributes - XGetWindowProperty - XGetZoomHints - XGrabButton - XGrabKey - XGrabKeyboard - XGrabPointer - XGrabServer - XHeightMMOfScreen - XHeightOfScreen - XIMOfIC - XIconifyWindow - XIfEvent - XImageByteOrder - XInitExtension - XInitImage - XInitThreads - XInsertModifiermapEntry - XInstallColormap - XInternAtom - XInternAtoms - XInternalConnectionNumbers - XIntersectRegion - XKeycodeToKeysym - XKeysymToKeycode - XKeysymToString - XKillClient - XLastKnownRequestProcessed - XListDepths - XListExtensions - XListFonts - XListFontsWithInfo - XListHosts - XListInstalledColormaps - XListPixmapFormats - XListProperties - XLoadFont - XLoadQueryFont - XLocaleOfFontSet - XLocaleOfIM - XLocaleOfOM - XLockDisplay - XLookupColor - XLookupKeysym - XLookupString - XLowerWindow - XMapRaised - XMapSubwindows - XMapWindow - XMaskEvent - XMatchVisualInfo - XMaxCmapsOfScreen - XMaxRequestSize - XMinCmapsOfScreen - XMoveResizeWindow - XMoveWindow - XNewModifiermap - XNextEvent - XNextRequest - XNoOp - XOMOfOC - XOffsetRegion - XOpenDisplay - XOpenIM - XOpenOM - XParseColor - XParseGeometry - XPeekEvent - XPeekIfEvent - XPending - XPlanesOfScreen - XPointInRegion - XPolygonRegion - XProcessInternalConnection - XProtocolRevision - XProtocolVersion - XPutBackEvent - XPutImage - XPutPixel - XQLength - XQueryBestCursor - XQueryBestSize - XQueryBestStipple - XQueryBestTile - XQueryColor - XQueryColors - XQueryExtension - XQueryFont - XQueryKeymap - XQueryPointer - XQueryTextExtents - XQueryTextExtents16 - XQueryTree - XRaiseWindow - XReadBitmapFile - XReadBitmapFileData - XRebindKeysym - XRecolorCursor - XReconfigureWMWindow - XRectInRegion - XRefreshKeyboardMapping - XRegisterIMInstantiateCallback - XRemoveConnectionWatch - XRemoveFromSaveSet - XRemoveHost - XRemoveHosts - XReparentWindow - XResetScreenSaver - XResizeWindow - XResourceManagerString - XRestackWindows - XRootWindow - XRootWindowOfScreen - XRotateBuffers - XRotateWindowProperties - XSaveContext - XScreenCount - XScreenNumberOfScreen - XScreenOfDisplay - XScreenResourceString - XSelectInput - XSendEvent - XServerVendor - XSetAccessControl - XSetAfterFunction - XSetArcMode - XSetAuthorization - XSetBackground - XSetClassHint - XSetClipMask - XSetClipOrigin - XSetClipRectangles - XSetCloseDownMode - XSetCommand - XSetDashes - XSetErrorHandler - XSetFillRule - XSetFillStyle - XSetFont - XSetFontPath - XSetForeground - XSetFunction - XSetGraphicsExposures - XSetICFocus - XSetICValues - XSetIMValues - XSetIOErrorHandler - XSetIconName - XSetIconSizes - XSetInputFocus - XSetLineAttributes - XSetLocaleModifiers - XSetModifierMapping - XSetNormalHints - XSetOCValues - XSetOMValues - XSetPlaneMask - XSetPointerMapping - XSetRGBColormaps - XSetRegion - XSetScreenSaver - XSetSelectionOwner - XSetSizeHints - XSetStandardColormap - XSetStandardProperties - XSetState - XSetStipple - XSetSubwindowMode - XSetTSOrigin - XSetTextProperty - XSetTile - XSetTransientForHint - XSetWMClientMachine - XSetWMColormapWindows - XSetWMHints - XSetWMIconName - XSetWMName - XSetWMNormalHints - XSetWMProperties - XSetWMProtocols - XSetWMSizeHints - XSetWindowBackground - XSetWindowBackgroundPixmap - XSetWindowBorder - XSetWindowBorderPixmap - XSetWindowBorderWidth - XSetWindowColormap - XSetZoomHints - XShrinkRegion - XStoreBuffer - XStoreBytes - XStoreColor - XStoreColors - XStoreName - XStoreNamedColor - XStringListToTextProperty - XStringToKeysym - XSubImage - XSubtractRegion - XSupportsLocale - XSync - XSynchronize - XTextExtents - XTextExtents16 - XTextPropertyToStringList - XTextWidth - XTextWidth16 - XTranslateCoordinates - XUndefineCursor - XUngrabButton - XUngrabKey - XUngrabKeyboard - XUngrabPointer - XUngrabServer - XUninstallColormap - XUnionRectWithRegion - XUnionRegion - XUnloadFont - XUnlockDisplay - XUnmapSubwindows - XUnmapWindow - XUnregisterIMInstantiateCallback - XUnsetICFocus - XVaCreateNestedList - XVendorRelease - XVisualIDFromVisual - XWMGeometry - XWarpPointer - XWhitePixel - XWhitePixelOfScreen - XWidthMMOfScreen - XWidthOfScreen - XWindowEvent - XWithdrawWindow - XWriteBitmapFile - XXorRegion - XcmsAddColorSpace - XcmsAddFunctionSet - XcmsAllocColor - XcmsAllocNamedColor - XcmsCCCOfColormap - XcmsCIELabClipL - XcmsCIELabClipLab - XcmsCIELabClipab - XcmsCIELabQueryMaxC - XcmsCIELabQueryMaxL - XcmsCIELabQueryMaxLC - XcmsCIELabQueryMinL - XcmsCIELabToCIEXYZ - XcmsCIELabWhiteShiftColors - XcmsCIELuvClipL - XcmsCIELuvClipLuv - XcmsCIELuvClipuv - XcmsCIELuvQueryMaxC - XcmsCIELuvQueryMaxL - XcmsCIELuvQueryMaxLC - XcmsCIELuvQueryMinL - XcmsCIELuvToCIEuvY - XcmsCIELuvWhiteShiftColors - XcmsCIEXYZToCIELab - XcmsCIEXYZToCIEuvY - XcmsCIEXYZToCIExyY - XcmsCIEXYZToRGBi - XcmsCIEuvYToCIELuv - XcmsCIEuvYToCIEXYZ - XcmsCIEuvYToTekHVC - XcmsCIExyYToCIEXYZ - XcmsClientWhitePointOfCCC - XcmsConvertColors - XcmsCreateCCC - XcmsDefaultCCC - XcmsDisplayOfCCC - XcmsFormatOfPrefix - XcmsFreeCCC - XcmsLookupColor - XcmsPrefixOfFormat - XcmsQueryBlack - XcmsQueryBlue - XcmsQueryColor - XcmsQueryColors - XcmsQueryGreen - XcmsQueryRed - XcmsQueryWhite - XcmsRGBToRGBi - XcmsRGBiToCIEXYZ - XcmsRGBiToRGB - XcmsScreenNumberOfCCC - XcmsScreenWhitePointOfCCC - XcmsSetCCCOfColormap - XcmsSetCompressionProc - XcmsSetWhiteAdjustProc - XcmsSetWhitePoint - XcmsStoreColor - XcmsStoreColors - XcmsTekHVCClipC - XcmsTekHVCClipV - XcmsTekHVCClipVC - XcmsTekHVCQueryMaxC - XcmsTekHVCQueryMaxV - XcmsTekHVCQueryMaxVC - XcmsTekHVCQueryMaxVSamples - XcmsTekHVCQueryMinV - XcmsTekHVCToCIEuvY - XcmsTekHVCWhiteShiftColors - XcmsVisualOfCCC - XmbDrawImageString - XmbDrawString - XmbDrawText - XmbLookupString - XmbResetIC - XmbSetWMProperties - XmbTextEscapement - XmbTextExtents - XmbTextListToTextProperty - XmbTextPerCharExtents - XmbTextPropertyToTextList - Xpermalloc - XrmCombineDatabase - XrmCombineFileDatabase - XrmDestroyDatabase - XrmEnumerateDatabase - XrmGetDatabase - XrmGetFileDatabase - XrmGetResource - XrmGetStringDatabase - XrmInitialize - XrmLocaleOfDatabase - XrmMergeDatabases - XrmParseCommand - XrmPermStringToQuark - XrmPutFileDatabase - XrmPutLineResource - XrmPutResource - XrmPutStringResource - XrmQGetResource - XrmQGetSearchList - XrmQGetSearchResource - XrmQPutResource - XrmQPutStringResource - XrmQuarkToString - XrmSetDatabase - XrmStringToBindingQuarkList - XrmStringToQuark - XrmStringToQuarkList - XrmUniqueQuark - XwcDrawImageString - XwcDrawString - XwcDrawText - XwcFreeStringList - XwcLookupString - XwcResetIC - XwcTextEscapement - XwcTextExtents - XwcTextListToTextProperty - XwcTextPerCharExtents - XwcTextPropertyToTextList - _XAllocID - _XAllocIDs - _XAllocScratch - _XAllocTemp - _XAsyncErrorHandler - _XConnectDisplay - _XDeqAsyncHandler - _XEatData - _XError -#ifndef __UNIXOS2__ - _XFlushIt -#endif - _XFlushGCCache - _XFreeTemp - _XGetAsyncData - _XGetAsyncReply - _XIOError - _XInitImageFuncPtrs - _XRead -;_XReadEvents - _XReadPad - _XRegisterFilterByMask - _XRegisterFilterByType - _XRegisterInternalConnection - _XReply - _XSend - _XSetLastRequestRead - _XUnknownNativeEvent - _XUnregisterFilter - _XUnregisterInternalConnection - _XVIDtoVisual -#ifndef __UNIXOS2__ - _Xthread_init - _Xthread_waiter -#endif - XkbIgnoreExtension - XkbOpenDisplay - XkbQueryExtension - XkbUseExtension - XkbLibraryVersion - XkbSetXlibControls - XkbGetXlibControls - XkbSetAtomFuncs - XkbKeycodeToKeysym - XkbKeysymToModifiers - XkbLookupKeySym - XkbLookupKeyBinding - XkbTranslateKeyCode - XkbTranslateKeySym - XkbSetAutoRepeatRate - XkbGetAutoRepeatRate - XkbChangeEnabledControls - XkbDeviceBell - XkbForceDeviceBell - XkbDeviceBellEvent - XkbBell - XkbForceBell - XkbBellEvent - XkbSelectEvents - XkbSelectEventDetails - XkbNoteMapChanges - XkbNoteNameChanges - XkbGetIndicatorState - XkbGetIndicatorMap - XkbSetIndicatorMap - XkbGetNamedIndicator - XkbGetNamedDeviceIndicator - XkbSetNamedIndicator - XkbSetNamedDeviceIndicator - XkbLockModifiers - XkbLatchModifiers - XkbLockGroup - XkbLatchGroup - XkbSetServerInternalMods - XkbSetIgnoreLockMods - XkbVirtualModsToReal - XkbComputeEffectiveMap - XkbInitCanonicalKeyTypes - XkbAllocKeyboard - XkbFreeKeyboard - XkbAllocClientMap - XkbAllocServerMap - XkbFreeClientMap - XkbFreeServerMap - XkbAddKeyType - XkbAllocIndicatorMaps - XkbFreeIndicatorMaps - XkbGetMap - XkbGetUpdatedMap - XkbGetMapChanges - XkbRefreshKeyboardMapping - XkbGetKeyTypes - XkbGetKeySyms - XkbGetKeyActions - XkbGetKeyBehaviors - XkbGetVirtualMods - XkbGetKeyExplicitComponents - XkbGetKeyModifierMap - XkbAllocControls - XkbFreeControls - XkbGetControls - XkbSetControls - XkbAllocCompatMap - XkbFreeCompatMap - XkbGetCompatMap - XkbSetCompatMap - XkbAllocNames - XkbGetNames - XkbSetNames - XkbChangeNames - XkbFreeNames - XkbGetState - XkbSetMap - XkbChangeMap - XkbSetDetectableAutoRepeat - XkbGetDetectableAutoRepeat - XkbSetAutoResetControls - XkbGetAutoResetControls - XkbCopyKeyType - XkbCopyKeyTypes - XkbResizeKeyType - XkbResizeKeySyms - XkbResizeKeyActions - XkbChangeTypesOfKey - XkbListComponents - XkbFreeComponentList - XkbGetKeyboard - XkbGetKeyboardByName - XkbAddDeviceLedInfo - XkbResizeDeviceButtonActions - XkbAllocDeviceInfo - XkbFreeDeviceInfo - XkbNoteDeviceChanges - XkbGetDeviceInfo - XkbGetDeviceInfoChanges - XkbGetDeviceButtonActions - XkbGetDeviceLedInfo - XkbSetDeviceInfo - XkbChangeDeviceInfo - XkbSetDeviceLedInfo - XkbSetDeviceButtonActions - XkbToControl - XkbSetDebuggingFlags - XkbGetPerClientControls - XkbSetPerClientControls - XauDisposeAuth - XauFileName - XauGetBestAuthByAddr - XauReadAuth - XcmsCIELabColorSpace - XcmsCIELuvColorSpace - XcmsCIEuvYColorSpace - XcmsCIExyYColorSpace - XcmsCIEXYZColorSpace - XcmsLinearRGBFunctionSet - XcmsRGBColorSpace - XcmsRGBiColorSpace - XcmsTekHVCColorSpace - XcmsUNDEFINEDColorSpace - _XimParseStringFile /* unspecified, retain slot for binary compat */ - XkbAddGeomColor - XkbAddGeomDoodad - XkbAddGeomKey - XkbAddGeomKeyAlias - XkbAddGeomOutline - XkbAddGeomOverlay - XkbAddGeomOverlayKey - XkbAddGeomOverlayRow - XkbAddGeomProperty - XkbAddGeomRow - XkbAddGeomSection - XkbAddGeomShape - XkbAllocGeomColors - XkbAllocGeomDoodads - XkbAllocGeometry - XkbAllocGeomKeyAliases - XkbAllocGeomKeys - XkbAllocGeomOutlines - XkbAllocGeomOverlayKeys - XkbAllocGeomOverlayRows - XkbAllocGeomOverlays - XkbAllocGeomPoints - XkbAllocGeomProps - XkbAllocGeomRows - XkbAllocGeomSectionDoodads - XkbAllocGeomSections - XkbAllocGeomShapes - XkbApplyCompatMapToKey - XkbApplyVirtualModChanges - XkbComputeRowBounds - XkbComputeSectionBounds - XkbComputeShapeBounds - XkbComputeShapeTop - XkbFindOverlayForKey - XkbFreeGeomColors - XkbFreeGeomDoodads - XkbFreeGeometry - XkbFreeGeomKeyAliases - XkbFreeGeomKeys - XkbFreeGeomOutlines - XkbFreeGeomOverlayKeys - XkbFreeGeomOverlayRows - XkbFreeGeomOverlays - XkbFreeGeomPoints - XkbFreeGeomProperties - XkbFreeGeomRows - XkbFreeGeomSections - XkbFreeGeomShapes - XkbGetGeometry - XkbGetKeyVirtualModMap - XkbGetNamedGeometry - XkbKeyTypesForCoreSymbols - XkbNoteControlsChanges - XkbSetGeometry - XkbTranslateKey - XkbUpdateActionVirtualMods - XkbUpdateKeyTypeVirtualMods - XkbUpdateMapFromCore - XkbXlibControlsImplemented - Xutf8TextPropertyToTextList - Xutf8TextListToTextProperty -#else - XSaveContext - XFindContext - XDeleteContext - XListDepths - XrmParseCommand - Xpermalloc - _XrmInternalStringToQuark - XrmStringToQuark - XrmPermStringToQuark - XrmUniqueQuark - XrmQuarkToString - XAllocColorCells - XAllocColorPlanes - XAllowEvents - XAutoRepeatOn - XAutoRepeatOff - XSetWindowBackground - XSetWindowBorderWidth - XBell - XSetWindowBorder - XEnableAccessControl - XDisableAccessControl - XSetAccessControl - XSetCloseDownMode - XChangeActivePointerGrab - XSetWindowColormap - XChangeGC - XChangeKeyboardControl - XChangePointerControl - XChangeProperty - XChangeSaveSet - XAddToSaveSet - XRemoveFromSaveSet - XChangeWindowAttributes - XResizeWindow - XCheckIfEvent - XCheckMaskEvent - XCheckWindowEvent - XCheckTypedEvent - XCheckTypedWindowEvent - XCirculateSubwindows - XCirculateSubwindowsDown - XCirculateSubwindowsUp - XCloseDisplay - XClearWindow - XClearArea - XMoveResizeWindow - _XConnectDisplay - _XDisconnectDisplay - _XSendClientPrefix - XSetAuthorization - XConvertSelection - XCopyArea - XCopyColormapAndFree - XCopyGC - XCopyPlane - XCreateBitmapFromData - XCreateColormap - XCreatePixmapCursor - XCreateGC - _XUpdateGCCache - _XFlushGCCache - XFlushGC - XGContextFromGC - XCreateGlyphCursor - XCreatePixmapFromBitmapData - XCreatePixmap - XCreateSimpleWindow - XCreateFontCursor - XDefineCursor - XDeleteProperty - XDestroySubwindows - XDestroyWindow - XDisplayName - XDrawArc - XDrawArcs - XDrawLine - XDrawLines - XDrawPoint - XDrawPoints - XDrawRectangle - XDrawRectangles - XDrawSegments - XGetErrorText - XGetErrorDatabaseText - XSetErrorHandler - XSetIOErrorHandler - _XEventToWire - XFetchName - XGetIconName - XFillArc - XFillArcs - XFillPolygon - XFillRectangle - XFillRectangles - XFlush - XLoadQueryFont - XFreeFont - XQueryFont - XListFonts - XFreeFontNames - XListFontsWithInfo - XFreeFontInfo - XFreeColormap - XFreeColors - XFreeCursor - _XFreeExtData - XFreeGC - XFreePixmap - XActivateScreenSaver - XResetScreenSaver - XForceScreenSaver - XSetArcMode - XSetFillRule - XSetFillStyle - XSetGraphicsExposures - XSetSubwindowMode - XGeometry - XGetAtomName - XAllocNamedColor - XGetDefault - XGetFontPath - XFreeFontPath - XGetFontProperty - XGetGeometry - XAllocColor - XGetSizeHints - XGetWMHints - XGetZoomHints - XGetNormalHints - XGetIconSizes - XGetCommand - XGetTransientForHint - XGetClassHint - XGetInputFocus - XGetImage - XGetSubImage - XGetKeyboardControl - XGetMotionEvents - XGetPointerControl - XGetPointerMapping - XGetKeyboardMapping - XGetWindowProperty - XGetSelectionOwner - XGetScreenSaver - XGetStandardColormap - XGetWindowAttributes - XGrabButton - XGrabKey - XGrabKeyboard - XGrabPointer - XGrabServer - XAddHost - XRemoveHost - XAddHosts - XRemoveHosts - XIfEvent - XCreateImage - _XSetImage - _XInitImageFuncPtrs - XDrawImageString - XDrawImageString16 - XInitExtension - XAddExtension - XEHeadOfExtensionList - XAddToExtensionList - XFindOnExtensionList - XESetCreateGC - XESetCopyGC - XESetFlushGC - XESetFreeGC - XESetCreateFont - XESetFreeFont - XESetCloseDisplay - XESetWireToEvent - XESetEventToWire - XESetWireToError - XESetError - XESetErrorString - XESetPrintErrorValues - XInstallColormap - XInternAtom - XKeycodeToKeysym - XKeysymToKeycode - XLookupKeysym - XRefreshKeyboardMapping - XLookupString - XRebindKeysym - XKeysymToString - XKillClient - XListHosts - XListInstalledColormaps - XListProperties - XListExtensions - XFreeExtensionList - XLoadFont - XLookupColor - XLowerWindow - XConnectionNumber - XRootWindow - XDefaultScreen - XDefaultRootWindow - XDefaultVisual - XDefaultGC - XBlackPixel - XWhitePixel - XAllPlanes - XQLength - XDisplayWidth - XDisplayHeight - XDisplayWidthMM - XDisplayHeightMM - XDisplayPlanes - XDisplayCells - XScreenCount - XServerVendor - XProtocolVersion - XProtocolRevision - XVendorRelease - XDisplayString - XDefaultDepth - XDefaultColormap - XBitmapUnit - XBitmapBitOrder - XBitmapPad - XImageByteOrder - XNextRequest - XLastKnownRequestProcessed - XScreenOfDisplay - XDefaultScreenOfDisplay - XDisplayOfScreen - XRootWindowOfScreen - XBlackPixelOfScreen - XWhitePixelOfScreen - XDefaultColormapOfScreen - XDefaultDepthOfScreen - XDefaultGCOfScreen - XDefaultVisualOfScreen - XWidthOfScreen - XHeightOfScreen - XWidthMMOfScreen - XHeightMMOfScreen - XPlanesOfScreen - XCellsOfScreen - XMinCmapsOfScreen - XMaxCmapsOfScreen - XDoesSaveUnders - XDoesBackingStore - XEventMaskOfScreen - XScreenNumberOfScreen - XDestroyImage - XGetPixel - XPutPixel - XSubImage - XAddPixel - XNoOp - XMapRaised - XMapSubwindows - XMapWindow - XMaskEvent - XMaxRequestSize - XResourceManagerString - XDisplayMotionBufferSize - XDisplayKeycodes - XVisualIDFromVisual - XGetModifierMapping - XSetModifierMapping - XNewModifiermap - XFreeModifiermap - XInsertModifiermapEntry - XDeleteModifiermapEntry - XMoveWindow - XNextEvent - XOpenDisplay - _XFreeDisplayStructure - XParseColor - XParseGeometry - XPeekEvent - XPeekIfEvent - XEventsQueued - XPending - XSetWindowBackgroundPixmap - XSetWindowBorderPixmap - XPolygonRegion - XDrawText - XDrawText16 - XPutBackEvent - _XReverse_Bytes - XPutImage - XQueryBestSize - XQueryColor - XQueryColors - XQueryBestCursor - XQueryExtension - XQueryKeymap - XQueryPointer - XQueryBestStipple - XQueryTextExtents16 - XQueryTextExtents - XQueryBestTile - XQueryTree - XRaiseWindow - XReadBitmapFile - XRecolorCursor - XConfigureWindow - XCreateRegion - XClipBox - XUnionRectWithRegion - XSetRegion - XDestroyRegion - XOffsetRegion - XShrinkRegion - XIntersectRegion - XUnionRegion - XSubtractRegion - XXorRegion - XEmptyRegion - XEqualRegion - XPointInRegion - XRectInRegion - XReparentWindow - XRestackWindows - XRotateWindowProperties - XScreenResourceString - XSelectInput - XSendEvent - XSetBackground - XSetClipRectangles - _XSetClipRectangles - XSetClipMask - XSetClipOrigin - XSetDashes - XSetFontPath - XSetFont - XSetForeground - XSetFunction - XSetSizeHints - XSetWMHints - XSetZoomHints - XSetNormalHints - XSetIconSizes - XSetCommand - XSetStandardProperties - XSetTransientForHint - XSetClassHint - XSetInputFocus - XSetLineAttributes - XSetPlaneMask - XSetPointerMapping - XChangeKeyboardMapping - XSetSelectionOwner - XSetScreenSaver - XSetState - XSetStipple - XSetStandardColormap - XSetTile - XSetTSOrigin - XRotateBuffers - XFetchBuffer - XFetchBytes - XStoreBuffer - XStoreBytes - XStoreColor - XStoreColors - XStoreNamedColor - XStoreName - XSetIconName - _XInitKeysymDB - XStringToKeysym - XSync - _XSyncFunction - XSynchronize - XSetAfterFunction - XDrawString - XDrawString16 - XTextExtents - XTextWidth - XTextExtents16 - XTextWidth16 - XTranslateCoordinates - XUndefineCursor - XUngrabButton - XUngrabKeyboard - XUngrabKey - XUngrabPointer - XUngrabServer - XUninstallColormap - XUnloadFont - XUnmapSubwindows - XUnmapWindow - XGetVisualInfo - XMatchVisualInfo - XWarpPointer - XWindowEvent - XCreateWindow - _XProcessWindowAttributes - XWriteBitmapFile - _XFlush - _XEventsQueued - _XReadEvents - _XRead - _XReadPad - _XSend - _XAllocID - _XSetLastRequestRead - _XReply - _XEatData - _XEnq - _XUnknownWireEvent - _XUnknownNativeEvent - _XWireToEvent - _XDefaultIOError - _XDefaultError - _XDefaultWireError - _XError - _XIOError - _XAllocScratch - _XVIDtoVisual - XFree - _XGetHostname - _XScreenOfWindow - _XAllocIDs - _XAllocTemp - _XFreeTemp - XrmInitialize - XrmGetDatabase - XrmSetDatabase - XrmStringToQuarkList - XrmStringToBindingQuarkList - XrmCombineDatabase - XrmMergeDatabases - XrmQPutResource - XrmPutResource - XrmQPutStringResource - XrmPutStringResource - XrmPutLineResource - XrmGetStringDatabase - XrmGetFileDatabase - XrmCombineFileDatabase - XrmEnumerateDatabase - XrmPutFileDatabase - XrmQGetSearchList - XrmQGetSearchResource - XrmQGetResource - XrmGetResource - XrmLocaleOfDatabase - XrmDestroyDatabase - XGetGCValues - XGetWMSizeHints - XGetWMNormalHints - XGetRGBColormaps - XGetTextProperty - XGetWMName - XGetWMIconName - XGetWMClientMachine - XGetWMColormapWindows - XGetWMProtocols - XIconifyWindow - XListPixmapFormats - XAllocSizeHints - XAllocStandardColormap - XAllocWMHints - XAllocClassHint - XAllocIconSize - XReconfigureWMWindow - XSetWMSizeHints - XSetWMNormalHints - XSetRGBColormaps - XSetTextProperty - XSetWMName - XSetWMIconName - XSetWMClientMachine - XSetWMColormapWindows - XSetWMProperties - XSetWMProtocols - XStringListToTextProperty - XTextPropertyToStringList - XFreeStringList - XWMGeometry - XWithdrawWindow - XauDisposeAuth - XauGetBestAuthByAddr - XauFileName - XauReadAuth - XcmsCIELabToCIEXYZ - XcmsCIEXYZToCIELab - XcmsCIELabClipab - XcmsCIELabClipL - XcmsCIELabClipLab - XcmsCIELabQueryMinL - XcmsCIELabQueryMaxC - XcmsCIELabQueryMaxL - _XcmsCIELabQueryMaxLCRGB - XcmsCIELabQueryMaxLC - XcmsCIELabWhiteShiftColors - XcmsCIELuvToCIEuvY - XcmsCIEuvYToCIELuv - XcmsCIELuvClipuv - XcmsCIELuvClipL - XcmsCIELuvClipLuv - XcmsCIELuvQueryMinL - XcmsCIELuvQueryMaxC - XcmsCIELuvQueryMaxL - _XcmsCIELuvQueryMaxLCRGB - XcmsCIELuvQueryMaxLC - XcmsCIELuvWhiteShiftColors - XcmsCIEuvYToCIEXYZ - XcmsCIEXYZToCIEuvY - XcmsCIExyYToCIEXYZ - XcmsCIEXYZToCIExyY - XcmsTekHVCToCIEuvY - XcmsCIEuvYToTekHVC - _XcmsTekHVC_CheckModify - XcmsTekHVCClipC - XcmsTekHVCClipV - XcmsTekHVCClipVC - XcmsTekHVCQueryMinV - XcmsTekHVCQueryMaxC - XcmsTekHVCQueryMaxV - _XcmsTekHVCQueryMaxVCRGB - XcmsTekHVCQueryMaxVC - XcmsTekHVCQueryMaxVSamples - XcmsTekHVCWhiteShiftColors - XcmsAddColorSpace - XcmsAddFunctionSet - XcmsAllocNamedColor - XcmsAllocColor - XcmsCreateCCC - XcmsDefaultCCC - XcmsFreeCCC - _XcmsAddCmapRec - _XcmsCopyCmapRecAndFree - _XcmsDeleteCmapRec - XcmsCCCOfColormap - _XcmsCopyISOLatin1Lowered - _XcmsResolveColorString - _XcmsConvertColorsWithWhitePt - _XcmsEqualWhitePts - _XcmsDIConvertColors - _XcmsDDConvertColors - XcmsConvertColors - _XcmsRegFormatOfPrefix - XcmsFormatOfPrefix - _XcmsCopyPointerArray - _XcmsFreePointerArray - _XcmsPushPointerArray - _XcmsInitDefaultCCCs - _XcmsInitScrnInfo - _XcmsFreeIntensityMaps - _XcmsGetIntensityMap - _XcmsGetTableType0 - _XcmsGetTableType1 - _XcmsValueCmp - _XcmsIntensityCmp - _XcmsValueInterpolation - _XcmsIntensityInterpolation - _XcmsTableSearch - _XcmsMatVec - XcmsCIEXYZToRGBi - XcmsRGBiToCIEXYZ - XcmsRGBiToRGB - XcmsRGBToRGBi - _XcmsLRGB_InitScrnDefault - XcmsLookupColor - _XcmsCubeRoot - _XcmsSquareRoot - XcmsDisplayOfCCC - XcmsVisualOfCCC - XcmsScreenNumberOfCCC - XcmsScreenWhitePointOfCCC - XcmsClientWhitePointOfCCC - XcmsPrefixOfFormat - _XcmsGetElement - _XcmsGetProperty - XcmsQueryBlack - XcmsQueryBlue - XcmsQueryGreen - XcmsQueryRed - XcmsQueryWhite - XcmsQueryColor - XcmsQueryColors - XcmsSetWhitePoint - XcmsSetCompressionProc - XcmsSetWhiteAdjustProc - _XcmsSetGetColors - XcmsStoreColor - XcmsStoreColors - _XcmsCosine - _XcmsSine - _XcmsArcTangent - _XcmsRGB_to_XColor - _XColor_to_XcmsRGB - _XcmsResolveColor - _XcmsUnresolveColor - _XUnresolveColor - _XParseBaseFontNameList - XCreateFontSet - XFontsOfFontSet - XBaseFontNameListOfFontSet - XLocaleOfFontSet - XContextDependentDrawing - XExtentsOfFontSet - XFreeFontSet - XVaCreateNestedList - XGetIMValues - XCreateIC - XDestroyIC - XGetICValues - XSetICValues - XSetICFocus - XUnsetICFocus - XIMOfIC - XmbResetIC - XwcResetIC - XmbLookupString - XwcLookupString - _XIMCompileResourceList - _XCopyToArg - XOpenIM - XCloseIM - XDisplayOfIM - XLocaleOfIM - XSetLocaleModifiers - XSupportsLocale - _XlcValidModSyntax - _XlcDefaultMapModifiers - _XlcAddLoader - _XlcCurrentLC - XmbSetWMProperties - XmbDrawText - XmbDrawString - XmbDrawImageString - XmbTextEscapement - XmbTextExtents - XmbTextPerCharExtents - XwcDrawText - XwcDrawString - XwcDrawImageString - XwcTextEscapement - XwcTextExtents - XwcTextPerCharExtents - XFilterEvent - _XRegisterFilterByMask - _XRegisterFilterByType - _XUnregisterFilter - XDefaultString - _XlcDefaultLoader - _XrmInitParseInfo - XmbTextPropertyToTextList - XmbTextListToTextProperty - XwcTextPropertyToTextList - XwcFreeStringList - XwcTextListToTextProperty - _X11TransConnectDisplay - XGetAtomNames - XInitImage - XESetBeforeFlush - _XFreeAtomTable - _XUpdateAtomCache - XInternAtoms - _XKeyInitialize - XConvertCase - _XTranslateKey - _XTranslateKeySym - _XKeysymToModifiers - XExtendedMaxRequestSize - XReadBitmapFileData - _XAsyncErrorHandler - _XDeqAsyncHandler - _XGetAsyncReply - _XGetAsyncData - _XPollfdCacheInit - _XPollfdCacheAdd - _XPollfdCacheDel - _XRegisterInternalConnection - _XUnregisterInternalConnection - XInternalConnectionNumbers - XProcessInternalConnection - XAddConnectionWatch - XRemoveConnectionWatch - _XDeq - _XcmsCIEXYZ_ValidSpec - _XcmsCIEuvY_ValidSpec - XcmsSetCCCOfColormap - XDirectionalDependentDrawing - XContextualDrawing - XSetIMValues - XRegisterIMInstantiateCallback - XUnregisterIMInstantiateCallback - XCreateOC - XDestroyOC - XOMOfOC - XSetOCValues - XGetOCValues - XOpenOM - XCloseOM - XSetOMValues - XGetOMValues - XDisplayOfOM - XLocaleOfOM - _XlcRemoveLoader - _XOpenLC - _XCloseLC - _XlcCopyFromArg - _XlcCopyToArg - _XlcCountVaList - _XlcVaToArgList - _XlcCompileResourceList - _XlcGetValues - _XlcSetValues - XInitThreads - XLockDisplay - XUnlockDisplay - _X11TransFreeConnInfo - _X11TransOpenCOTSClient - _X11TransOpenCLTSClient - _X11TransSetOption - _X11TransConnect - _X11TransBytesReadable - _X11TransRead - _X11TransWrite - _X11TransReadv - _X11TransWritev - _X11TransDisconnect - _X11TransClose - _X11TransCloseForCloning - _X11TransIsLocal - _X11TransGetMyAddr - _X11TransGetPeerAddr - _X11TransGetConnectionNumber - _X11TransGetHostname - _X11TransConvertAddress - _XimCbDispatch - _XimLookupMBText - _XimLookupWCText - _XimRegisterFilter - _XimUnregisterFilter - _XimReregisterFilter - _XimRegisterServerFilter - _XimUnregisterServerFilter - _XimProtoCreateIC - _XimCheckDataSize - _XimSetHeader - _XimProtoIMFree - _XimProtoOpenIM - _XimICOfXICID - _XimSetEventMaskCallback - _XimSync - _XimProcSyncReply - _XimRespSyncReply - _XimSyncCallback - _XimForwardEvent - _XimForwardEventCallback - _XimRegisterTriggerKeysCallback - _XimGetWindowEventmask - _XimTriggerNotify - _XimFreeCommitInfo - _XimCommitCallback - _XimProcError - _XimErrorCallback - _XimError - _Ximctstombs - _Ximctstowcs - _XimProtoMbLookupString - _XimProtoWcLookupString - _XimRegProtoIntrCallback - _XimFreeProtoIntrCallback - _XimDispatchInit - _XimProtoEventToWire - _XimProtoWireToEvent - _XimExtension - _XimRegisterIMInstantiateCallback - _XimUnRegisterIMInstantiateCallback - _XimResetIMInstantiateCallback - _XimDestroyIMStructureList - _XimServerDestroy - _XInitIM - _XimLocalFilter - _XimLocalGetICValues - _XimLocalCreateIC - _XimCheckIfLocalProcessing - _XimLocalIMFree - _XimLocalGetIMValues - _XimLocalSetIMValues - _XimLocalOpenIM - _XimLocalMbLookupString - _XimLocalWcLookupString - _XimParseStringFile - _XimSetICValueData - _XimLocalSetICValues - _XimSetIMResourceList - _XimSetICResourceList - _XimSetInnerIMResourceList - _XimSetInnerICResourceList - _XimCheckCreateICValues - _XimGetResourceListRec - _XimSetIMMode - _XimCheckIMMode - _XimSetICMode - _XimCheckICMode - _XimSetLocalIMDefaults - _XimSetICDefaults - _XimDecodeLocalIMAttr - _XimDecodeLocalICAttr - _XimCheckLocalInputStyle - _XimEncodeLocalIMAttr - _XimEncodeLocalICAttr - _XimGetCurrentIMValues - _XimSetCurrentIMValues - _XimGetCurrentICValues - _XimSetCurrentICValues - _XimInitialResourceInfo - _XimDecodeIMATTRIBUTE - _XimDecodeICATTRIBUTE - _XimEncodeIMATTRIBUTE - _XimEncodeICATTRIBUTE - _XimGetAttributeID - _XimThaiFilter - _XimThaiCreateIC - _XimCheckIfThaiProcessing - _XimThaiOpenIM - _XimThaiIMFree - _XimThaiCloseIM - _XimXConf - _XimConnect - _XimShutdown - _XimFlush - _XimFilterWaitEvent - _XimFreeTransIntrCallback - _XimTransFilterWaitEvent - _XimTransInternalConnection - _XimTransFlush - _XimTransConf - _XlcParseCharSet - _XlcInitCTInfo - _XlcGetCSValues - _XlcGetCharSet - _XlcAddCharSet - _XlcCreateDefaultCharSet - _XlcSetConverter - _XlcOpenConverter - _XlcCloseConverter - _XlcConvert - _XlcResetConverter - _XlcGetResource - _XlcGetLocaleDataBase - _XlcDestroyLocaleDataBase - _XlcCreateLocaleDataBase - _XlcEucLoader - _XlcFileName - _XlcResolveLocaleName -;REMOVED _XlcResolveDBName - _XlcResolveI18NPath - _XlcGenericLoader - _XlcInitLoader - _XmbTextPropertyToTextList - _XwcTextPropertyToTextList - _XwcFreeStringList - _XGetLCValues - _XlcDestroyLC - _XlcCreateLC - _XrmDefaultInitParseInfo - _XlcSjisLoader - _Xlcmbtowc - _Xlcwctomb - _Xlcmbstowcs - _Xlcwcstombs - _Xmbtowc - _Xwctomb - _Xmbstowcs - _Xwcstombs - _Xwcscpy - _Xwcsncpy - _Xwcslen - _Xwcscmp - _Xwcsncmp - _XmbTextListToTextProperty - _XwcTextListToTextProperty -; _XlcUtfLoader - _XlcCompareISOLatin1 - _XlcNCompareISOLatin1 - _XmbDefaultTextEscapement - _XwcDefaultTextEscapement - _XmbDefaultTextExtents - _XwcDefaultTextExtents - _XmbDefaultTextPerCharExtents - _XwcDefaultTextPerCharExtents - _XmbDefaultDrawString - _XwcDefaultDrawString - _XmbDefaultDrawImageString - _XwcDefaultDrawImageString - _XomGenericOpenOM - _XInitOM - _XmbGenericDrawImageString - _XwcGenericDrawImageString - _XomGenericDrawString - _XmbGenericDrawString - _XwcGenericDrawString - _XmbGenericTextEscapement - _XwcGenericTextEscapement - _XomGenericTextExtents - _XmbGenericTextExtents - _XwcGenericTextExtents - _XmbGenericTextPerCharExtents - _XwcGenericTextPerCharExtents - _XomConvert - _XomInitConverter - _Xmblen - _XimGetResourceListRecByQuark - _XimSetIMValueData - _XimGetIMValueData - _XimGetICValueData - _XimMakeIMAttrIDList - _XimMakeICAttrIDList - _XimWrite - _XimRead - _XimRegisterDispatcher - _XimTransRegisterDispatcher - _XimTransCallDispatcher - _XimTransWrite - _XimTransRead - _XimXTransFreeConnInfo - _XimXTransOpenCOTSClient - _XimXTransOpenCLTSClient - _XimXTransSetOption - _XimXTransConnect - _XimXTransBytesReadable - _XimXTransRead - _XimXTransWrite - _XimXTransReadv - _XimXTransWritev - _XimXTransDisconnect - _XimXTransClose - _XimXTransCloseForCloning - _XimXTransIsLocal - _XimXTransGetMyAddr - _XimXTransGetPeerAddr - _XimXTransGetConnectionNumber - _XimXTransGetHostname - _Xdebug DATA - Xutf8TextPropertyToTextList - Xutf8TextListToTextProperty - Xutf8LookupString - XkbIgnoreExtension - XkbOpenDisplay - XkbQueryExtension - XkbUseExtension - XkbLibraryVersion - XkbSetXlibControls - XkbGetXlibControls - XkbSetAtomFuncs - XkbKeycodeToKeysym - XkbKeysymToModifiers - XkbLookupKeySym - XkbLookupKeyBinding - XkbTranslateKeyCode - XkbTranslateKeySym - XkbSetAutoRepeatRate - XkbGetAutoRepeatRate - XkbChangeEnabledControls - XkbDeviceBell - XkbForceDeviceBell - XkbDeviceBellEvent - XkbBell - XkbForceBell - XkbBellEvent - XkbSelectEvents - XkbSelectEventDetails - XkbNoteMapChanges - XkbNoteNameChanges - XkbGetIndicatorState - XkbGetIndicatorMap - XkbSetIndicatorMap - XkbGetNamedIndicator - XkbGetNamedDeviceIndicator - XkbSetNamedIndicator - XkbSetNamedDeviceIndicator - XkbLockModifiers - XkbLatchModifiers - XkbLockGroup - XkbLatchGroup - XkbSetServerInternalMods - XkbSetIgnoreLockMods - XkbVirtualModsToReal - XkbComputeEffectiveMap - XkbInitCanonicalKeyTypes - XkbAllocKeyboard - XkbFreeKeyboard - XkbAllocClientMap - XkbAllocServerMap - XkbFreeClientMap - XkbFreeServerMap - XkbAddKeyType - XkbAllocIndicatorMaps - XkbFreeIndicatorMaps - XkbGetMap - XkbGetUpdatedMap - XkbGetMapChanges - XkbRefreshKeyboardMapping - XkbGetKeyTypes - XkbGetKeySyms - XkbGetKeyActions - XkbGetKeyBehaviors - XkbGetVirtualMods - XkbGetKeyExplicitComponents - XkbGetKeyModifierMap - XkbAllocControls - XkbFreeControls - XkbGetControls - XkbSetControls - XkbAllocCompatMap - XkbFreeCompatMap - XkbGetCompatMap - XkbSetCompatMap - XkbAllocNames - XkbGetNames - XkbSetNames - XkbChangeNames - XkbFreeNames - XkbGetState - XkbSetMap - XkbChangeMap - XkbSetDetectableAutoRepeat - XkbGetDetectableAutoRepeat - XkbSetAutoResetControls - XkbGetAutoResetControls - XkbCopyKeyType - XkbCopyKeyTypes - XkbResizeKeyType - XkbResizeKeySyms - XkbResizeKeyActions - XkbChangeTypesOfKey - XkbListComponents - XkbFreeComponentList - XkbGetKeyboard - XkbGetKeyboardByName - XkbAddDeviceLedInfo - XkbResizeDeviceButtonActions - XkbAllocDeviceInfo - XkbFreeDeviceInfo - XkbNoteDeviceChanges - XkbGetDeviceInfo - XkbGetDeviceInfoChanges - XkbGetDeviceButtonActions - XkbGetDeviceLedInfo - XkbSetDeviceInfo - XkbChangeDeviceInfo - XkbSetDeviceLedInfo - XkbSetDeviceButtonActions - XkbToControl - XkbSetDebuggingFlags - _XkbInternAtomFunc - _XkbGetAtomNameFunc - _XkbReloadDpy - _XKeycodeToKeysym - _XKeysymToKeycode - _XLookupKeysym - _XRefreshKeyboardMapping - _XLookupString - _XkbNoteCoreMapChanges - _XkbInitReadBuffer - _XkbSkipReadBufferData - _XkbCopyFromReadBuffer - _XkbReadCopyKeySyms - _XkbWriteCopyKeySyms - _XkbReadBufferCopyKeySyms - _XkbPeekAtReadBuffer - _XkbGetReadBufferPtr - _XkbFreeReadBuffer - _XkbGetReadBufferCountedString - _XkbGetCharset - _XkbGetConverters - XkbGetGeometry - XkbAddGeomShape - XkbAddGeomOutline - XkbComputeShapeBounds - XkbAddGeomDoodad - XkbAddGeomColor - XkbAddGeomOverlayRow - XkbAddGeomSection - XkbAddGeomRow - XkbAddGeomKey - XkbComputeSectionBounds - XkbAllocGeometry - XkbAddGeomProperty - XkbAddGeomOverlay - XkbComputeShapeTop - XkbFindOverlayForKey - XkbAllocGeomKeyAliases - XkbSetGeometry - XkbXlibControlsImplemented - XkbTranslateKey - XkbAddGeomOverlayKey - XkbNoteControlsChanges - XkbGetKeyVirtualModMap - XkbComputeRowBounds - XkbGetNamedGeometry - XkbKeyTypesForCoreSymbols - XkbApplyCompatMapToKey - XkbUpdateMapFromCore - XkbUpdateActionVirtualMods - XkbUpdateKeyTypeVirtualMods - XkbApplyVirtualModChanges - XkbFreeGeomProperties - XkbFreeGeomKeyAliases - XkbFreeGeomColors - XkbFreeGeomPoints - XkbFreeGeomOutlines - XkbFreeGeomShapes - XkbFreeGeomOverlayKeys - XkbFreeGeomOverlayRows - XkbFreeGeomOverlays - XkbFreeGeomKeys - XkbFreeGeomRows - XkbFreeGeomSections - XkbFreeGeomDoodads - XkbFreeGeometry - XkbAllocGeomProps - XkbAllocGeomColors - XkbAllocGeomShapes - XkbAllocGeomSections - XkbAllocGeomOverlays - XkbAllocGeomOverlayRows - XkbAllocGeomOverlayKeys - XkbAllocGeomDoodads - XkbAllocGeomSectionDoodads - XkbAllocGeomOutlines - XkbAllocGeomRows - XkbAllocGeomPoints - XkbAllocGeomKeys - XkbAddGeomKeyAlias - _XkeyTable - _Xevent_to_mask - _qfree - _XIOErrorFunction - _XErrorFunction - _XHeadOfDisplayList - XcmsCIELabColorSpace - XcmsCIELuvColorSpace - XcmsCIEXYZColorSpace - XcmsCIEuvYColorSpace - XcmsCIExyYColorSpace - XcmsTekHVCColorSpace - XcmsUNDEFINEDColorSpace - _XcmsDIColorSpacesInit - _XcmsDIColorSpaces - _XcmsDDColorSpacesInit - _XcmsDDColorSpaces - _XcmsSCCFuncSetsInit - _XcmsSCCFuncSets - _XcmsCIEXYZ_prefix - _XcmsCIEuvY_prefix - _XcmsCIExyY_prefix - _XcmsCIELab_prefix - _XcmsCIELuv_prefix - _XcmsTekHVC_prefix - _XcmsRGBi_prefix - _XcmsRGB_prefix - _XcmsRegColorSpaces - XcmsRGBiColorSpace - XcmsRGBColorSpace - XcmsLinearRGBFunctionSet - _X11TransSocketINETFuncs - _X11TransSocketTCPFuncs - _XimXTransSocketINETFuncs - _XimXTransSocketTCPFuncs - _XimImSportRec - _XimTransportRec - _XlcGenericMethods - _XlcPublicMethods -#ifdef HAS_THREADS - _XCreateMutex_fn DATA - _XFreeMutex_fn DATA - _XLockMutex_fn DATA - _XUnlockMutex_fn DATA - _Xglobal_lock DATA -#endif -#ifdef __UNIXOS2__ -; OS/2 specific exports - __XOS2RedirRoot - __XOS2RedirRoot1 - _XGetScanlinePad - _XGetBitsPerPixel - _Xsetlocale - XkbGetPerClientControls - XkbSetPerClientControls - Xutf8DrawString - Xutf8TextExtents -#endif -#endif - diff --git a/nx-X11/programs/Xserver/GL/glx/glx-def.cpp b/nx-X11/programs/Xserver/GL/glx/glx-def.cpp deleted file mode 100644 index a653f4cb7..000000000 --- a/nx-X11/programs/Xserver/GL/glx/glx-def.cpp +++ /dev/null @@ -1,662 +0,0 @@ -LIBRARY GLX -VERSION LIBRARY_VERSION -EXPORTS -__glXFBInitDrawable -__glXFreeBuffers -__glXPixInitDrawable -__glXResizeBuffers -__glXClientInfo -__glXCopyContext -__glXCreateContext -__glXCreateGLXPixmap -__glXDestroyContext -__glXDestroyGLXPixmap -__glXGetVisualConfigs -__glXIsDirect -__glXLookupContextByTag -__glXMakeCurrent -__glXQueryContextInfoEXT -__glXQueryExtensionsString -__glXQueryServerString -__glXQueryVersion -__glXRender -__glXRenderLarge -__glXSwapBuffers -__glXVendorPrivate -__glXVendorPrivateWithReply -__glXWaitGL -__glXWaitX -__glXSwapClientInfo -__glXSwapCopyContext -__glXSwapCreateContext -__glXSwapCreateGLXPixmap -__glXSwapDestroyContext -__glXSwapDestroyGLXPixmap -__glXSwapGetVisualConfigs -__glXSwapIsDirect -__glXSwapIsDirectReply -__glXSwapMakeCurrent -__glXSwapMakeCurrentReply -__glXSwapQueryContextInfoEXT -__glXSwapQueryContextInfoEXTReply -__glXSwapQueryExtensionsString -__glXSwapQueryServerString -__glXSwapQueryVersion -__glXSwapQueryVersionReply -__glXSwapRender -__glXSwapRenderLarge -__glXSwapSwapBuffers -__glXSwapUseXFont -__glXSwapVendorPrivate -__glXSwapVendorPrivateWithReply -__glXSwapWaitGL -__glXSwapWaitX -glxSwapQueryExtensionsStringReply -glxSwapQueryServerStringReply -GlxExtensionInit -GlxInitVisuals -GlxSetVisualConfigs -GlxWrapInitVisuals -__glXClearErrorOccured -__glXCoreType -__glXErrorCallBack -__glXErrorOccured -__glXFlushContextCache -__glXForceCurrent -__glXFreeContext -__glXNoSuchRenderOpcode -__glXNoSuchSingleOpcode -__glXResetLargeCommandStatus -__glXFBGetGC -__glXFBMemSwapBuffers -__glXInitFB -__glXImpCalloc -__glXImpFatal -__glXImpFclose -__glXImpFopen -__glXImpFprintf -__glXImpFree -__glXImpGetDrawablePrivate -__glXImpGetenv -__glXImpMalloc -__glXImpRealloc -__glXImpSprintf -__glXImpWarning -__glXInitMem -__glXInitPix -__glXScreenInit -__glXAssociateContext -__glXCacheDrawableSize -__glXCalloc -__glXCreateDrawablePrivate -__glXDeassociateContext -__glXDestroyDrawablePrivate -__glXFindDrawablePrivate -__glXFree -__glXGetDrawablePrivate -__glXGetDrawableSize -__glXMalloc -__glXNop -__glXRealloc -__glXRefDrawablePrivate -__glXResizeDrawable -__glXResizeDrawableBuffers -__glXUnrefDrawablePrivate -__glXDisp_CallLists -__glXDisp_DrawArrays -__glXDisp_Map1d -__glXDisp_Map1f -__glXDisp_Map2d -__glXDisp_Map2f -__glXDispSwap_CallLists -__glXDispSwap_DrawArrays -__glXDispSwap_Map1d -__glXDispSwap_Map1f -__glXDispSwap_Map2d -__glXDispSwap_Map2f -__glXDisp_Bitmap -__glXDisp_DrawPixels -__glXDisp_PolygonStipple -__glXDisp_TexImage1D -__glXDisp_TexImage2D -__glXDisp_TexSubImage1D -__glXDisp_TexSubImage2D -__glXDispSwap_Bitmap -__glXDispSwap_DrawPixels -__glXDispSwap_PolygonStipple -__glXDispSwap_TexImage1D -__glXDispSwap_TexImage2D -__glXDispSwap_TexSubImage1D -__glXDispSwap_TexSubImage2D -__glXBitmapReqSize -__glXCallListsReqSize -__glXDrawArraysSize -__glXDrawPixelsReqSize -__glXFogfvReqSize -__glXFogivReqSize -__glXLightModelfvReqSize -__glXLightModelivReqSize -__glXLightfvReqSize -__glXLightivReqSize -__glXMap1dReqSize -__glXMap1fReqSize -__glXMap2dReqSize -__glXMap2fReqSize -__glXMaterialfvReqSize -__glXMaterialivReqSize -__glXPixelMapfvReqSize -__glXPixelMapuivReqSize -__glXPixelMapusvReqSize -__glXPrioritizeTexturesReqSize -__glXTexEnvfvReqSize -__glXTexEnvivReqSize -__glXTexGendvReqSize -__glXTexGenfvReqSize -__glXTexGenivReqSize -__glXTexImage1DReqSize -__glXTexImage2DReqSize -__glXTexParameterfvReqSize -__glXTexParameterivReqSize -__glXTexSubImage1DReqSize -__glXTexSubImage2DReqSize -__glXTypeSize -__glXDisp_FeedbackBuffer -__glXDisp_Finish -__glXDisp_Flush -__glXDisp_GetClipPlane -__glXDisp_GetString -__glXDisp_RenderMode -__glXDisp_SelectBuffer -__glXcombine_strings -__glXDispSwap_FeedbackBuffer -__glXDispSwap_Finish -__glXDispSwap_Flush -__glXDispSwap_GetClipPlane -__glXDispSwap_GetString -__glXDispSwap_RenderMode -__glXDispSwap_SelectBuffer -__glXDisp_GetPolygonStipple -__glXDisp_GetTexImage -__glXDisp_ReadPixels -__glXDispSwap_GetPolygonStipple -__glXDispSwap_GetTexImage -__glXDispSwap_ReadPixels -__glGetBooleanv_size -__glGetDoublev_size -__glGetFloatv_size -__glGetIntegerv_size -__glGetLightfv_size -__glGetLightiv_size -__glGetMap_size -__glGetMapdv_size -__glGetMapfv_size -__glGetMapiv_size -__glGetMaterialfv_size -__glGetMaterialiv_size -__glGetPixelMap_size -__glGetPixelMapfv_size -__glGetPixelMapuiv_size -__glGetPixelMapusv_size -__glGetTexEnvfv_size -__glGetTexEnviv_size -__glGetTexGendv_size -__glGetTexGenfv_size -__glGetTexGeniv_size -__glGetTexImage_size -__glGetTexLevelParameterfv_size -__glGetTexLevelParameteriv_size -__glGetTexParameterfv_size -__glGetTexParameteriv_size -__glGet_size -__glReadPixels_size -__glXUseXFont -__glXDisp_Accum -__glXDisp_AlphaFunc -__glXDisp_Begin -__glXDisp_BindTexture -__glXDisp_BlendFunc -__glXDisp_CallList -__glXDisp_Clear -__glXDisp_ClearAccum -__glXDisp_ClearColor -__glXDisp_ClearDepth -__glXDisp_ClearIndex -__glXDisp_ClearStencil -__glXDisp_ClipPlane -__glXDisp_Color3bv -__glXDisp_Color3dv -__glXDisp_Color3fv -__glXDisp_Color3iv -__glXDisp_Color3sv -__glXDisp_Color3ubv -__glXDisp_Color3uiv -__glXDisp_Color3usv -__glXDisp_Color4bv -__glXDisp_Color4dv -__glXDisp_Color4fv -__glXDisp_Color4iv -__glXDisp_Color4sv -__glXDisp_Color4ubv -__glXDisp_Color4uiv -__glXDisp_Color4usv -__glXDisp_ColorMask -__glXDisp_ColorMaterial -__glXDisp_CopyPixels -__glXDisp_CopyTexImage1D -__glXDisp_CopyTexImage2D -__glXDisp_CopyTexSubImage1D -__glXDisp_CopyTexSubImage2D -__glXDisp_CullFace -__glXDisp_DepthFunc -__glXDisp_DepthMask -__glXDisp_DepthRange -__glXDisp_Disable -__glXDisp_DrawBuffer -__glXDisp_EdgeFlagv -__glXDisp_Enable -__glXDisp_End -__glXDisp_EvalCoord1dv -__glXDisp_EvalCoord1fv -__glXDisp_EvalCoord2dv -__glXDisp_EvalCoord2fv -__glXDisp_EvalMesh1 -__glXDisp_EvalMesh2 -__glXDisp_EvalPoint1 -__glXDisp_EvalPoint2 -__glXDisp_Fogf -__glXDisp_Fogfv -__glXDisp_Fogi -__glXDisp_Fogiv -__glXDisp_FrontFace -__glXDisp_Frustum -__glXDisp_Hint -__glXDisp_IndexMask -__glXDisp_Indexdv -__glXDisp_Indexfv -__glXDisp_Indexiv -__glXDisp_Indexsv -__glXDisp_Indexubv -__glXDisp_InitNames -__glXDisp_LightModelf -__glXDisp_LightModelfv -__glXDisp_LightModeli -__glXDisp_LightModeliv -__glXDisp_Lightf -__glXDisp_Lightfv -__glXDisp_Lighti -__glXDisp_Lightiv -__glXDisp_LineStipple -__glXDisp_LineWidth -__glXDisp_ListBase -__glXDisp_LoadIdentity -__glXDisp_LoadMatrixd -__glXDisp_LoadMatrixf -__glXDisp_LoadName -__glXDisp_LogicOp -__glXDisp_MapGrid1d -__glXDisp_MapGrid1f -__glXDisp_MapGrid2d -__glXDisp_MapGrid2f -__glXDisp_Materialf -__glXDisp_Materialfv -__glXDisp_Materiali -__glXDisp_Materialiv -__glXDisp_MatrixMode -__glXDisp_MultMatrixd -__glXDisp_MultMatrixf -__glXDisp_Normal3bv -__glXDisp_Normal3dv -__glXDisp_Normal3fv -__glXDisp_Normal3iv -__glXDisp_Normal3sv -__glXDisp_Ortho -__glXDisp_PassThrough -__glXDisp_PixelMapfv -__glXDisp_PixelMapuiv -__glXDisp_PixelMapusv -__glXDisp_PixelTransferf -__glXDisp_PixelTransferi -__glXDisp_PixelZoom -__glXDisp_PointSize -__glXDisp_PolygonMode -__glXDisp_PolygonOffset -__glXDisp_PopAttrib -__glXDisp_PopMatrix -__glXDisp_PopName -__glXDisp_PrioritizeTextures -__glXDisp_PushAttrib -__glXDisp_PushMatrix -__glXDisp_PushName -__glXDisp_RasterPos2dv -__glXDisp_RasterPos2fv -__glXDisp_RasterPos2iv -__glXDisp_RasterPos2sv -__glXDisp_RasterPos3dv -__glXDisp_RasterPos3fv -__glXDisp_RasterPos3iv -__glXDisp_RasterPos3sv -__glXDisp_RasterPos4dv -__glXDisp_RasterPos4fv -__glXDisp_RasterPos4iv -__glXDisp_RasterPos4sv -__glXDisp_ReadBuffer -__glXDisp_Rectdv -__glXDisp_Rectfv -__glXDisp_Rectiv -__glXDisp_Rectsv -__glXDisp_Rotated -__glXDisp_Rotatef -__glXDisp_Scaled -__glXDisp_Scalef -__glXDisp_Scissor -__glXDisp_ShadeModel -__glXDisp_StencilFunc -__glXDisp_StencilMask -__glXDisp_StencilOp -__glXDisp_TexCoord1dv -__glXDisp_TexCoord1fv -__glXDisp_TexCoord1iv -__glXDisp_TexCoord1sv -__glXDisp_TexCoord2dv -__glXDisp_TexCoord2fv -__glXDisp_TexCoord2iv -__glXDisp_TexCoord2sv -__glXDisp_TexCoord3dv -__glXDisp_TexCoord3fv -__glXDisp_TexCoord3iv -__glXDisp_TexCoord3sv -__glXDisp_TexCoord4dv -__glXDisp_TexCoord4fv -__glXDisp_TexCoord4iv -__glXDisp_TexCoord4sv -__glXDisp_TexEnvf -__glXDisp_TexEnvfv -__glXDisp_TexEnvi -__glXDisp_TexEnviv -__glXDisp_TexGend -__glXDisp_TexGendv -__glXDisp_TexGenf -__glXDisp_TexGenfv -__glXDisp_TexGeni -__glXDisp_TexGeniv -__glXDisp_TexParameterf -__glXDisp_TexParameterfv -__glXDisp_TexParameteri -__glXDisp_TexParameteriv -__glXDisp_Translated -__glXDisp_Translatef -__glXDisp_Vertex2dv -__glXDisp_Vertex2fv -__glXDisp_Vertex2iv -__glXDisp_Vertex2sv -__glXDisp_Vertex3dv -__glXDisp_Vertex3fv -__glXDisp_Vertex3iv -__glXDisp_Vertex3sv -__glXDisp_Vertex4dv -__glXDisp_Vertex4fv -__glXDisp_Vertex4iv -__glXDisp_Vertex4sv -__glXDisp_Viewport -__glXDispSwap_Accum -__glXDispSwap_AlphaFunc -__glXDispSwap_Begin -__glXDispSwap_BindTexture -__glXDispSwap_BlendFunc -__glXDispSwap_CallList -__glXDispSwap_Clear -__glXDispSwap_ClearAccum -__glXDispSwap_ClearColor -__glXDispSwap_ClearDepth -__glXDispSwap_ClearIndex -__glXDispSwap_ClearStencil -__glXDispSwap_ClipPlane -__glXDispSwap_Color3bv -__glXDispSwap_Color3dv -__glXDispSwap_Color3fv -__glXDispSwap_Color3iv -__glXDispSwap_Color3sv -__glXDispSwap_Color3ubv -__glXDispSwap_Color3uiv -__glXDispSwap_Color3usv -__glXDispSwap_Color4bv -__glXDispSwap_Color4dv -__glXDispSwap_Color4fv -__glXDispSwap_Color4iv -__glXDispSwap_Color4sv -__glXDispSwap_Color4ubv -__glXDispSwap_Color4uiv -__glXDispSwap_Color4usv -__glXDispSwap_ColorMask -__glXDispSwap_ColorMaterial -__glXDispSwap_CopyPixels -__glXDispSwap_CopyTexImage1D -__glXDispSwap_CopyTexImage2D -__glXDispSwap_CopyTexSubImage1D -__glXDispSwap_CopyTexSubImage2D -__glXDispSwap_CullFace -__glXDispSwap_DepthFunc -__glXDispSwap_DepthMask -__glXDispSwap_DepthRange -__glXDispSwap_Disable -__glXDispSwap_DrawBuffer -__glXDispSwap_EdgeFlagv -__glXDispSwap_Enable -__glXDispSwap_End -__glXDispSwap_EvalCoord1dv -__glXDispSwap_EvalCoord1fv -__glXDispSwap_EvalCoord2dv -__glXDispSwap_EvalCoord2fv -__glXDispSwap_EvalMesh1 -__glXDispSwap_EvalMesh2 -__glXDispSwap_EvalPoint1 -__glXDispSwap_EvalPoint2 -__glXDispSwap_Fogf -__glXDispSwap_Fogfv -__glXDispSwap_Fogi -__glXDispSwap_Fogiv -__glXDispSwap_FrontFace -__glXDispSwap_Frustum -__glXDispSwap_Hint -__glXDispSwap_IndexMask -__glXDispSwap_Indexdv -__glXDispSwap_Indexfv -__glXDispSwap_Indexiv -__glXDispSwap_Indexsv -__glXDispSwap_Indexubv -__glXDispSwap_InitNames -__glXDispSwap_LightModelf -__glXDispSwap_LightModelfv -__glXDispSwap_LightModeli -__glXDispSwap_LightModeliv -__glXDispSwap_Lightf -__glXDispSwap_Lightfv -__glXDispSwap_Lighti -__glXDispSwap_Lightiv -__glXDispSwap_LineStipple -__glXDispSwap_LineWidth -__glXDispSwap_ListBase -__glXDispSwap_LoadIdentity -__glXDispSwap_LoadMatrixd -__glXDispSwap_LoadMatrixf -__glXDispSwap_LoadName -__glXDispSwap_LogicOp -__glXDispSwap_MapGrid1d -__glXDispSwap_MapGrid1f -__glXDispSwap_MapGrid2d -__glXDispSwap_MapGrid2f -__glXDispSwap_Materialf -__glXDispSwap_Materialfv -__glXDispSwap_Materiali -__glXDispSwap_Materialiv -__glXDispSwap_MatrixMode -__glXDispSwap_MultMatrixd -__glXDispSwap_MultMatrixf -__glXDispSwap_Normal3bv -__glXDispSwap_Normal3dv -__glXDispSwap_Normal3fv -__glXDispSwap_Normal3iv -__glXDispSwap_Normal3sv -__glXDispSwap_Ortho -__glXDispSwap_PassThrough -__glXDispSwap_PixelMapfv -__glXDispSwap_PixelMapuiv -__glXDispSwap_PixelMapusv -__glXDispSwap_PixelTransferf -__glXDispSwap_PixelTransferi -__glXDispSwap_PixelZoom -__glXDispSwap_PointSize -__glXDispSwap_PolygonMode -__glXDispSwap_PolygonOffset -__glXDispSwap_PopAttrib -__glXDispSwap_PopMatrix -__glXDispSwap_PopName -__glXDispSwap_PrioritizeTextures -__glXDispSwap_PushAttrib -__glXDispSwap_PushMatrix -__glXDispSwap_PushName -__glXDispSwap_RasterPos2dv -__glXDispSwap_RasterPos2fv -__glXDispSwap_RasterPos2iv -__glXDispSwap_RasterPos2sv -__glXDispSwap_RasterPos3dv -__glXDispSwap_RasterPos3fv -__glXDispSwap_RasterPos3iv -__glXDispSwap_RasterPos3sv -__glXDispSwap_RasterPos4dv -__glXDispSwap_RasterPos4fv -__glXDispSwap_RasterPos4iv -__glXDispSwap_RasterPos4sv -__glXDispSwap_ReadBuffer -__glXDispSwap_Rectdv -__glXDispSwap_Rectfv -__glXDispSwap_Rectiv -__glXDispSwap_Rectsv -__glXDispSwap_Rotated -__glXDispSwap_Rotatef -__glXDispSwap_Scaled -__glXDispSwap_Scalef -__glXDispSwap_Scissor -__glXDispSwap_ShadeModel -__glXDispSwap_StencilFunc -__glXDispSwap_StencilMask -__glXDispSwap_StencilOp -__glXDispSwap_TexCoord1dv -__glXDispSwap_TexCoord1fv -__glXDispSwap_TexCoord1iv -__glXDispSwap_TexCoord1sv -__glXDispSwap_TexCoord2dv -__glXDispSwap_TexCoord2fv -__glXDispSwap_TexCoord2iv -__glXDispSwap_TexCoord2sv -__glXDispSwap_TexCoord3dv -__glXDispSwap_TexCoord3fv -__glXDispSwap_TexCoord3iv -__glXDispSwap_TexCoord3sv -__glXDispSwap_TexCoord4dv -__glXDispSwap_TexCoord4fv -__glXDispSwap_TexCoord4iv -__glXDispSwap_TexCoord4sv -__glXDispSwap_TexEnvf -__glXDispSwap_TexEnvfv -__glXDispSwap_TexEnvi -__glXDispSwap_TexEnviv -__glXDispSwap_TexGend -__glXDispSwap_TexGendv -__glXDispSwap_TexGenf -__glXDispSwap_TexGenfv -__glXDispSwap_TexGeni -__glXDispSwap_TexGeniv -__glXDispSwap_TexParameterf -__glXDispSwap_TexParameterfv -__glXDispSwap_TexParameteri -__glXDispSwap_TexParameteriv -__glXDispSwap_Translated -__glXDispSwap_Translatef -__glXDispSwap_Vertex2dv -__glXDispSwap_Vertex2fv -__glXDispSwap_Vertex2iv -__glXDispSwap_Vertex2sv -__glXDispSwap_Vertex3dv -__glXDispSwap_Vertex3fv -__glXDispSwap_Vertex3iv -__glXDispSwap_Vertex3sv -__glXDispSwap_Vertex4dv -__glXDispSwap_Vertex4fv -__glXDispSwap_Vertex4iv -__glXDispSwap_Vertex4sv -__glXDispSwap_Viewport -__glXDisp_AreTexturesResident -__glXDisp_DeleteLists -__glXDisp_DeleteTextures -__glXDisp_EndList -__glXDisp_GenLists -__glXDisp_GenTextures -__glXDisp_GetBooleanv -__glXDisp_GetDoublev -__glXDisp_GetError -__glXDisp_GetFloatv -__glXDisp_GetIntegerv -__glXDisp_GetLightfv -__glXDisp_GetLightiv -__glXDisp_GetMapdv -__glXDisp_GetMapfv -__glXDisp_GetMapiv -__glXDisp_GetMaterialfv -__glXDisp_GetMaterialiv -__glXDisp_GetPixelMapfv -__glXDisp_GetPixelMapuiv -__glXDisp_GetPixelMapusv -__glXDisp_GetTexEnvfv -__glXDisp_GetTexEnviv -__glXDisp_GetTexGendv -__glXDisp_GetTexGenfv -__glXDisp_GetTexGeniv -__glXDisp_GetTexLevelParameterfv -__glXDisp_GetTexLevelParameteriv -__glXDisp_GetTexParameterfv -__glXDisp_GetTexParameteriv -__glXDisp_IsEnabled -__glXDisp_IsList -__glXDisp_IsTexture -__glXDisp_NewList -__glXDisp_PixelStoref -__glXDisp_PixelStorei -__glXDispSwap_AreTexturesResident -__glXDispSwap_DeleteLists -__glXDispSwap_DeleteTextures -__glXDispSwap_EndList -__glXDispSwap_GenLists -__glXDispSwap_GenTextures -__glXDispSwap_GetBooleanv -__glXDispSwap_GetDoublev -__glXDispSwap_GetError -__glXDispSwap_GetFloatv -__glXDispSwap_GetIntegerv -__glXDispSwap_GetLightfv -__glXDispSwap_GetLightiv -__glXDispSwap_GetMapdv -__glXDispSwap_GetMapfv -__glXDispSwap_GetMapiv -__glXDispSwap_GetMaterialfv -__glXDispSwap_GetMaterialiv -__glXDispSwap_GetPixelMapfv -__glXDispSwap_GetPixelMapuiv -__glXDispSwap_GetPixelMapusv -__glXDispSwap_GetTexEnvfv -__glXDispSwap_GetTexEnviv -__glXDispSwap_GetTexGendv -__glXDispSwap_GetTexGenfv -__glXDispSwap_GetTexGeniv -__glXDispSwap_GetTexLevelParameterfv -__glXDispSwap_GetTexLevelParameteriv -__glXDispSwap_GetTexParameterfv -__glXDispSwap_GetTexParameteriv -__glXDispSwap_IsEnabled -__glXDispSwap_IsList -__glXDispSwap_IsTexture -__glXDispSwap_NewList -__glXDispSwap_PixelStoref -__glXDispSwap_PixelStorei - -/* $XFree86$ */ diff --git a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp b/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp deleted file mode 100644 index 206ce85fb..000000000 --- a/nx-X11/programs/Xserver/GL/mesa/GLcore/GLcore-def.cpp +++ /dev/null @@ -1,1461 +0,0 @@ -LIBRARY GLcore -VERSION LIBRARY_VERSION -EXPORTS - -_mesa_set_aa_triangle_function -_mesa_Accum -_mesa_ClearAccum -_mesa_alloc_accum_buffer -_mesa_clear_accum_buffer -_mesa_AlphaFunc -_mesa_alpha_test -_mesa_alloc_alpha_buffers -_mesa_clear_alpha_buffers -_mesa_read_alpha_pixels -_mesa_read_alpha_span -_mesa_write_alpha_pixels -_mesa_write_alpha_span -_mesa_write_mono_alpha_pixels -_mesa_write_mono_alpha_span -_mesa_PopAttrib -_mesa_PopClientAttrib -_mesa_PushAttrib -_mesa_PushClientAttrib -_mesa_Bitmap -_mesa_BlendColor -_mesa_BlendEquation -_mesa_BlendFunc -_mesa_BlendFuncSeparateEXT -_mesa_blend_pixels -_mesa_blend_span -_mesa_Clear -_mesa_ClearColor -_mesa_ClearIndex -_mesa_DrawBuffer -_mesa_ReadBuffer -_mesa_ResizeBuffersMESA -_mesa_ClipPlane -_mesa_GetClipPlane -gl_init_clip -gl_update_clipmask -gl_update_userclip -gl_user_cliptest -gl_userclip_point -gl_viewclip_point -_mesa_ColorSubTable -_mesa_ColorTable -_mesa_ColorTableParameterfv -_mesa_ColorTableParameteriv -_mesa_CopyColorSubTable -_mesa_CopyColorTable -_mesa_GetColorTable -_mesa_GetColorTableParameterfv -_mesa_GetColorTableParameteriv -_mesa_free_colortable_data -_mesa_init_colortable -gl_read_config_file -gl_register_config_var -_mesa_Finish -_mesa_Flush -_mesa_create_visual -_mesa_destroy_visual -_mesa_get_dispatch -_mesa_initialize_context -_mesa_initialize_framebuffer -_mesa_initialize_visual -_mesa_swapbuffers -gl_compile_error -gl_context_initialize -gl_copy_context -gl_create_context -gl_create_framebuffer -gl_create_visual -gl_destroy_context -gl_destroy_framebuffer -gl_destroy_visual -gl_error -gl_free_context_data -gl_get_current_context -gl_make_current -gl_make_current2 -gl_problem -gl_warning -_mesa_CopyPixels -_mesa_LockArraysEXT -_mesa_UnlockArraysEXT -gl_alloc_cva_store -gl_cva_compile_cassette -gl_cva_force_precalc -gl_cva_init -gl_free_cva_store -gl_merge_cva -gl_prepare_arrays_cva -gl_rescue_cva -_mesa_ClearDepth -_mesa_DepthFunc -_mesa_DepthMask -_mesa_alloc_depth_buffer -_mesa_clear_depth_buffer -_mesa_depth_test_pixels -_mesa_depth_test_span -_mesa_read_depth_span -_mesa_read_depth_span_float -_mesa_zbuffer_address -glAccum -glActiveTextureARB -glAlphaFunc -glAreTexturesResident -glAreTexturesResidentEXT -glArrayElement -glArrayElementEXT -glBegin -glBindTexture -glBindTextureEXT -glBitmap -glBlendColor -glBlendColorEXT -glBlendEquation -glBlendEquationEXT -glBlendFunc -glBlendFuncSeparateEXT -glBlendFuncSeparateINGR -glCallList -glCallLists -glClear -glClearAccum -glClearColor -glClearDepth -glClearIndex -glClearStencil -glClientActiveTextureARB -glClipPlane -glColor3b -glColor3bv -glColor3d -glColor3dv -glColor3f -glColor3fv -glColor3i -glColor3iv -glColor3s -glColor3sv -glColor3ub -glColor3ubv -glColor3ui -glColor3uiv -glColor3us -glColor3usv -glColor4b -glColor4bv -glColor4d -glColor4dv -glColor4f -glColor4fv -glColor4i -glColor4iv -glColor4s -glColor4sv -glColor4ub -glColor4ubv -glColor4ui -glColor4uiv -glColor4us -glColor4usv -glColorMask -glColorMaterial -glColorPointer -glColorPointerEXT -glColorSubTable -glColorSubTableEXT -glColorTable -glColorTableEXT -glColorTableParameterfv -glColorTableParameterfvSGI -glColorTableParameteriv -glColorTableParameterivSGI -glColorTableSGI -glCombinerInputNV -glCombinerOutputNV -glCombinerParameterfNV -glCombinerParameterfvNV -glCombinerParameteriNV -glCombinerParameterivNV -glCompressedTexImage1DARB -glCompressedTexImage2DARB -glCompressedTexImage3DARB -glCompressedTexSubImage1DARB -glCompressedTexSubImage2DARB -glCompressedTexSubImage3DARB -glConvolutionFilter1D -glConvolutionFilter1DEXT -glConvolutionFilter2D -glConvolutionFilter2DEXT -glConvolutionParameterf -glConvolutionParameterfEXT -glConvolutionParameterfv -glConvolutionParameterfvEXT -glConvolutionParameteri -glConvolutionParameteriEXT -glConvolutionParameteriv -glConvolutionParameterivEXT -glCopyColorSubTable -glCopyColorSubTableEXT -glCopyColorTable -glCopyColorTableSGI -glCopyConvolutionFilter1D -glCopyConvolutionFilter1DEXT -glCopyConvolutionFilter2D -glCopyConvolutionFilter2DEXT -glCopyPixels -glCopyTexImage1D -glCopyTexImage1DEXT -glCopyTexImage2D -glCopyTexImage2DEXT -glCopyTexSubImage1D -glCopyTexSubImage1DEXT -glCopyTexSubImage2D -glCopyTexSubImage2DEXT -glCopyTexSubImage3D -glCopyTexSubImage3DEXT -glCullFace -glCullParameterdvEXT -glCullParameterfvEXT -glDeleteLists -glDeleteTextures -glDeleteTexturesEXT -glDepthFunc -glDepthMask -glDepthRange -glDetailTexFuncSGIS -glDisable -glDisableClientState -glDrawArrays -glDrawArraysEXT -glDrawBuffer -glDrawElements -glDrawPixels -glDrawRangeElements -glDrawRangeElementsEXT -glEdgeFlag -glEdgeFlagPointer -glEdgeFlagPointerEXT -glEdgeFlagv -glEnable -glEnableClientState -glEnd -glEndList -glEvalCoord1d -glEvalCoord1dv -glEvalCoord1f -glEvalCoord1fv -glEvalCoord2d -glEvalCoord2dv -glEvalCoord2f -glEvalCoord2fv -glEvalMesh1 -glEvalMesh2 -glEvalPoint1 -glEvalPoint2 -glFeedbackBuffer -glFinalCombinerInputNV -glFinish -glFlush -glFlushRasterSGIX -glFlushVertexArrayRangeNV -glFogCoordPointerEXT -glFogCoorddEXT -glFogCoorddvEXT -glFogCoordfEXT -glFogCoordfvEXT -glFogf -glFogfv -glFogi -glFogiv -glFragmentColorMaterialSGIX -glFragmentLightModelfSGIX -glFragmentLightModelfvSGIX -glFragmentLightModeliSGIX -glFragmentLightModelivSGIX -glFragmentLightfSGIX -glFragmentLightfvSGIX -glFragmentLightiSGIX -glFragmentLightivSGIX -glFragmentMaterialfSGIX -glFragmentMaterialfvSGIX -glFragmentMaterialiSGIX -glFragmentMaterialivSGIX -glFrameZoomSGIX -glFrontFace -glFrustum -glGenLists -glGenTextures -glGenTexturesEXT -glGetBooleanv -glGetClipPlane -glGetColorTable -glGetColorTableEXT -glGetColorTableParameterfv -glGetColorTableParameterfvEXT -glGetColorTableParameterfvSGI -glGetColorTableParameteriv -glGetColorTableParameterivEXT -glGetColorTableParameterivSGI -glGetColorTableSGI -glGetCombinerInputParameterfvNV -glGetCombinerInputParameterivNV -glGetCombinerOutputParameterfvNV -glGetCombinerOutputParameterivNV -glGetCompressedTexImageARB -glGetConvolutionFilter -glGetConvolutionFilterEXT -glGetConvolutionParameterfv -glGetConvolutionParameterfvEXT -glGetConvolutionParameteriv -glGetConvolutionParameterivEXT -glGetDetailTexFuncSGIS -glGetDoublev -glGetError -glGetFinalCombinerInputParameterfvNV -glGetFinalCombinerInputParameterivNV -glGetFloatv -glGetFragmentLightfvSGIX -glGetFragmentLightivSGIX -glGetFragmentMaterialfvSGIX -glGetFragmentMaterialivSGIX -glGetHistogram -glGetHistogramEXT -glGetHistogramParameterfv -glGetHistogramParameterfvEXT -glGetHistogramParameteriv -glGetHistogramParameterivEXT -glGetInstrumentsSGIX -glGetIntegerv -glGetLightfv -glGetLightiv -glGetListParameterfvSGIX -glGetListParameterivSGIX -glGetMapdv -glGetMapfv -glGetMapiv -glGetMaterialfv -glGetMaterialiv -glGetMinmax -glGetMinmaxEXT -glGetMinmaxParameterfv -glGetMinmaxParameterfvEXT -glGetMinmaxParameteriv -glGetMinmaxParameterivEXT -glGetPixelMapfv -glGetPixelMapuiv -glGetPixelMapusv -glGetPixelTexGenParameterfvSGIS -glGetPixelTexGenParameterivSGIS -glGetPointerv -glGetPointervEXT -glGetPolygonStipple -glGetSeparableFilter -glGetSeparableFilterEXT -glGetSharpenTexFuncSGIS -glGetString -glGetTexEnvfv -glGetTexEnviv -glGetTexFilterFuncSGIS -glGetTexGendv -glGetTexGenfv -glGetTexGeniv -glGetTexImage -glGetTexLevelParameterfv -glGetTexLevelParameteriv -glGetTexParameterfv -glGetTexParameteriv -glHint -glHintPGI -glHistogram -glHistogramEXT -glIndexFuncEXT -glIndexMask -glIndexMaterialEXT -glIndexPointer -glIndexPointerEXT -glIndexd -glIndexdv -glIndexf -glIndexfv -glIndexi -glIndexiv -glIndexs -glIndexsv -glIndexub -glIndexubv -glInitNames -glInstrumentsBufferSGIX -glInterleavedArrays -glIsEnabled -glIsList -glIsTexture -glIsTextureEXT -glLightEnviSGIX -glLightModelf -glLightModelfv -glLightModeli -glLightModeliv -glLightf -glLightfv -glLighti -glLightiv -glLineStipple -glLineWidth -glListBase -glListParameterfSGIX -glListParameterfvSGIX -glListParameteriSGIX -glListParameterivSGIX -glLoadIdentity -glLoadMatrixd -glLoadMatrixf -glLoadName -glLoadTransposeMatrixdARB -glLoadTransposeMatrixfARB -glLockArraysEXT -glLogicOp -glMap1d -glMap1f -glMap2d -glMap2f -glMapGrid1d -glMapGrid1f -glMapGrid2d -glMapGrid2f -glMaterialf -glMaterialfv -glMateriali -glMaterialiv -glMatrixMode -glMinmax -glMinmaxEXT -glMultMatrixd -glMultMatrixf -glMultTransposeMatrixdARB -glMultTransposeMatrixfARB -glMultiTexCoord1dARB -glMultiTexCoord1dvARB -glMultiTexCoord1fARB -glMultiTexCoord1fvARB -glMultiTexCoord1iARB -glMultiTexCoord1ivARB -glMultiTexCoord1sARB -glMultiTexCoord1svARB -glMultiTexCoord2dARB -glMultiTexCoord2dvARB -glMultiTexCoord2fARB -glMultiTexCoord2fvARB -glMultiTexCoord2iARB -glMultiTexCoord2ivARB -glMultiTexCoord2sARB -glMultiTexCoord2svARB -glMultiTexCoord3dARB -glMultiTexCoord3dvARB -glMultiTexCoord3fARB -glMultiTexCoord3fvARB -glMultiTexCoord3iARB -glMultiTexCoord3ivARB -glMultiTexCoord3sARB -glMultiTexCoord3svARB -glMultiTexCoord4dARB -glMultiTexCoord4dvARB -glMultiTexCoord4fARB -glMultiTexCoord4fvARB -glMultiTexCoord4iARB -glMultiTexCoord4ivARB -glMultiTexCoord4sARB -glMultiTexCoord4svARB -glNewList -glNormal3b -glNormal3bv -glNormal3d -glNormal3dv -glNormal3f -glNormal3fv -glNormal3i -glNormal3iv -glNormal3s -glNormal3sv -glNormalPointer -glNormalPointerEXT -glOrtho -glPassThrough -glPixelMapfv -glPixelMapuiv -glPixelMapusv -glPixelStoref -glPixelStorei -glPixelTexGenParameterfSGIS -glPixelTexGenParameterfvSGIS -glPixelTexGenParameteriSGIS -glPixelTexGenParameterivSGIS -glPixelTexGenSGIX -glPixelTransferf -glPixelTransferi -glPixelZoom -glPointParameterfEXT -glPointParameterfSGIS -glPointParameterfvEXT -glPointParameterfvSGIS -glPointSize -glPollInstrumentsSGIX -glPolygonMode -glPolygonOffset -glPolygonOffsetEXT -glPolygonStipple -glPopAttrib -glPopClientAttrib -glPopMatrix -glPopName -glPrioritizeTextures -glPrioritizeTexturesEXT -glPushAttrib -glPushClientAttrib -glPushMatrix -glPushName -glRasterPos2d -glRasterPos2dv -glRasterPos2f -glRasterPos2fv -glRasterPos2i -glRasterPos2iv -glRasterPos2s -glRasterPos2sv -glRasterPos3d -glRasterPos3dv -glRasterPos3f -glRasterPos3fv -glRasterPos3i -glRasterPos3iv -glRasterPos3s -glRasterPos3sv -glRasterPos4d -glRasterPos4dv -glRasterPos4f -glRasterPos4fv -glRasterPos4i -glRasterPos4iv -glRasterPos4s -glRasterPos4sv -glReadBuffer -glReadInstrumentsSGIX -glReadPixels -glRectd -glRectdv -glRectf -glRectfv -glRecti -glRectiv -glRects -glRectsv -glReferencePlaneSGIX -glRenderMode -glResetHistogram -glResetHistogramEXT -glResetMinmax -glResetMinmaxEXT -glResizeBuffersMESA -glRotated -glRotatef -glSampleCoverageARB -glSampleMaskEXT -glSampleMaskSGIS -glSamplePassARB -glSamplePatternEXT -glSamplePatternSGIS -glScaled -glScalef -glScissor -glSelectBuffer -glSeparableFilter2D -glSeparableFilter2DEXT -glShadeModel -glSharpenTexFuncSGIS -glSpriteParameterfSGIX -glSpriteParameterfvSGIX -glSpriteParameteriSGIX -glSpriteParameterivSGIX -glStartInstrumentsSGIX -glStencilFunc -glStencilMask -glStencilOp -glStopInstrumentsSGIX -glTagSampleBufferSGIX -glTbufferMask3DFX -glTexCoord1d -glTexCoord1dv -glTexCoord1f -glTexCoord1fv -glTexCoord1i -glTexCoord1iv -glTexCoord1s -glTexCoord1sv -glTexCoord2d -glTexCoord2dv -glTexCoord2f -glTexCoord2fv -glTexCoord2i -glTexCoord2iv -glTexCoord2s -glTexCoord2sv -glTexCoord3d -glTexCoord3dv -glTexCoord3f -glTexCoord3fv -glTexCoord3i -glTexCoord3iv -glTexCoord3s -glTexCoord3sv -glTexCoord4d -glTexCoord4dv -glTexCoord4f -glTexCoord4fv -glTexCoord4i -glTexCoord4iv -glTexCoord4s -glTexCoord4sv -glTexCoordPointer -glTexCoordPointerEXT -glTexEnvf -glTexEnvfv -glTexEnvi -glTexEnviv -glTexFilterFuncSGIS -glTexGend -glTexGendv -glTexGenf -glTexGenfv -glTexGeni -glTexGeniv -glTexImage1D -glTexImage2D -glTexImage3D -glTexImage3DEXT -glTexImage4DSGIS -glTexParameterf -glTexParameterfv -glTexParameteri -glTexParameteriv -glTexSubImage1D -glTexSubImage1DEXT -glTexSubImage2D -glTexSubImage2DEXT -glTexSubImage3D -glTexSubImage3DEXT -glTexSubImage4DSGIS -glTranslated -glTranslatef -glUnlockArraysEXT -glVertex2d -glVertex2dv -glVertex2f -glVertex2fv -glVertex2i -glVertex2iv -glVertex2s -glVertex2sv -glVertex3d -glVertex3dv -glVertex3f -glVertex3fv -glVertex3i -glVertex3iv -glVertex3s -glVertex3sv -glVertex4d -glVertex4dv -glVertex4f -glVertex4fv -glVertex4i -glVertex4iv -glVertex4s -glVertex4sv -glVertexArrayRangeNV -glVertexPointer -glVertexPointerEXT -glVertexWeightPointerEXT -glVertexWeightfEXT -glVertexWeightfvEXT -glViewport -glWindowPos2dMESA -glWindowPos2dvMESA -glWindowPos2fMESA -glWindowPos2fvMESA -glWindowPos2iMESA -glWindowPos2ivMESA -glWindowPos2sMESA -glWindowPos2svMESA -glWindowPos3dMESA -glWindowPos3dvMESA -glWindowPos3fMESA -glWindowPos3fvMESA -glWindowPos3iMESA -glWindowPos3ivMESA -glWindowPos3sMESA -glWindowPos3svMESA -glWindowPos4dMESA -glWindowPos4dvMESA -glWindowPos4fMESA -glWindowPos4fvMESA -glWindowPos4iMESA -glWindowPos4ivMESA -glWindowPos4sMESA -glWindowPos4svMESA -_mesa_CallList -_mesa_CallLists -_mesa_DeleteLists -_mesa_EndList -_mesa_GenLists -_mesa_IsList -_mesa_ListBase -_mesa_NewList -_mesa_init_dlist_table -gl_compile_cassette -gl_destroy_list -gl_init_lists -gl_save_error -mesa_print_display_list -_mesa_DrawPixels -_mesa_clip_pixelrect -_mesa_Disable -_mesa_DisableClientState -_mesa_Enable -_mesa_EnableClientState -_mesa_IsEnabled -_mesa_set_enable -gl_lookup_enum_by_name -gl_lookup_enum_by_nr -_mesa_EvalCoord1d -_mesa_EvalCoord1dv -_mesa_EvalCoord1f -_mesa_EvalCoord1fv -_mesa_EvalCoord2d -_mesa_EvalCoord2dv -_mesa_EvalCoord2f -_mesa_EvalCoord2fv -_mesa_EvalMesh1 -_mesa_EvalMesh2 -_mesa_EvalPoint1 -_mesa_EvalPoint2 -_mesa_GetMapdv -_mesa_GetMapfv -_mesa_GetMapiv -_mesa_Map1d -_mesa_Map1f -_mesa_Map2d -_mesa_Map2f -_mesa_MapGrid1d -_mesa_MapGrid1f -_mesa_MapGrid2d -_mesa_MapGrid2f -_mesa_evaluator_components -gl_copy_map_points1d -gl_copy_map_points1f -gl_copy_map_points2d -gl_copy_map_points2f -gl_eval_vb -gl_init_eval -gl_extension_is_enabled -gl_extensions_add -gl_extensions_ctr -gl_extensions_disable -gl_extensions_dtr -gl_extensions_enable -gl_extensions_get_string -_mesa_FeedbackBuffer -_mesa_InitNames -_mesa_LoadName -_mesa_PassThrough -_mesa_PopName -_mesa_PushName -_mesa_RenderMode -_mesa_SelectBuffer -gl_feedback_line -gl_feedback_points -gl_feedback_triangle -gl_feedback_vertex -gl_select_line -gl_select_points -gl_select_triangle -gl_update_hitflag -_mesa_Fogf -_mesa_Fogfv -_mesa_Fogi -_mesa_Fogiv -_mesa_fog_ci_pixels -_mesa_fog_rgba_pixels -_mesa_fog_vertices -_mesa_init_fog -_mesa_GetBooleanv -_mesa_GetDoublev -_mesa_GetError -_mesa_GetFloatv -_mesa_GetIntegerv -_mesa_GetPointerv -_mesa_GetString -_glapi_add_entrypoint -_glapi_check_multithread -_glapi_check_table -_glapi_get_context -_glapi_get_dispatch -_glapi_get_dispatch_table_size -_glapi_get_proc_address -_glapi_get_proc_name -_glapi_get_proc_offset -_glapi_get_version -_glapi_set_context -_glapi_set_dispatch -_glapi_noop_enable_warnings -_glthread_GetID -_glthread_GetTSD -_glthread_InitTSD -_glthread_SetTSD -_mesa_DeleteHashTable -_mesa_HashFindFreeKeyBlock -_mesa_HashFirstEntry -_mesa_HashInsert -_mesa_HashLookup -_mesa_HashPrint -_mesa_HashRemove -_mesa_NewHashTable -_mesa_Hint -_mesa_HintPGI -_mesa_try_Hint -_mesa_bytes_per_pixel -_mesa_components_in_format -_mesa_image_address -_mesa_image_row_stride -_mesa_is_legal_format_and_type -_mesa_native_packing -_mesa_pack_bitmap -_mesa_pack_polygon_stipple -_mesa_pack_rgba_span -_mesa_sizeof_packed_type -_mesa_sizeof_type -_mesa_swap2 -_mesa_swap4 -_mesa_unpack_bitmap -_mesa_unpack_depth_span -_mesa_unpack_float_color_span -_mesa_unpack_image -_mesa_unpack_index_span -_mesa_unpack_polygon_stipple -_mesa_unpack_stencil_span -_mesa_unpack_ubyte_color_span -_mesa_ConvolutionFilter1D -_mesa_ConvolutionFilter2D -_mesa_ConvolutionParameterf -_mesa_ConvolutionParameterfv -_mesa_ConvolutionParameteri -_mesa_ConvolutionParameteriv -_mesa_CopyConvolutionFilter1D -_mesa_CopyConvolutionFilter2D -_mesa_GetConvolutionFilter -_mesa_GetConvolutionParameterfv -_mesa_GetConvolutionParameteriv -_mesa_GetHistogram -_mesa_GetHistogramParameterfv -_mesa_GetHistogramParameteriv -_mesa_GetMinmax -_mesa_GetMinmaxParameterfv -_mesa_GetMinmaxParameteriv -_mesa_GetSeparableFilter -_mesa_Histogram -_mesa_Minmax -_mesa_ResetHistogram -_mesa_ResetMinmax -_mesa_SeparableFilter2D -_mesa_update_histogram -_mesa_update_minmax -_mesa_ColorMaterial -_mesa_GetLightfv -_mesa_GetLightiv -_mesa_GetMaterialfv -_mesa_GetMaterialiv -_mesa_LightModelf -_mesa_LightModelfv -_mesa_LightModeli -_mesa_LightModeliv -_mesa_Lightf -_mesa_Lightfv -_mesa_Lighti -_mesa_Lightiv -_mesa_Materialf -_mesa_Materialfv -_mesa_Materiali -_mesa_Materialiv -_mesa_ShadeModel -gl_compute_light_positions -gl_compute_shine_table -gl_compute_spot_exp_table -gl_material_bitmask -gl_update_color_material -gl_update_lighting -gl_update_material -gl_update_normal_transform -_mesa_LineStipple -_mesa_LineWidth -gl_set_line_function -_mesa_LogicOp -_mesa_logicop_ci_pixels -_mesa_logicop_ci_span -_mesa_logicop_rgba_pixels -_mesa_logicop_rgba_span -_mesa_ColorMask -_mesa_IndexMask -_mesa_mask_index_pixels -_mesa_mask_index_span -_mesa_mask_rgba_pixels -_mesa_mask_rgba_span -_mesa_DepthRange -_mesa_Frustum -_mesa_LoadIdentity -_mesa_LoadMatrixd -_mesa_LoadMatrixf -_mesa_LoadTransposeMatrixdARB -_mesa_LoadTransposeMatrixfARB -_mesa_MatrixMode -_mesa_MultMatrixd -_mesa_MultMatrixf -_mesa_MultTransposeMatrixdARB -_mesa_MultTransposeMatrixfARB -_mesa_Ortho -_mesa_PopMatrix -_mesa_PushMatrix -_mesa_Rotated -_mesa_Rotatef -_mesa_Scaled -_mesa_Scalef -_mesa_Translated -_mesa_Translatef -_mesa_Viewport -gl_Viewport -gl_calculate_model_project_matrix -gl_mat_mul_floats -gl_mat_mul_mat -gl_matrix_alloc_inv -gl_matrix_analyze -gl_matrix_copy -gl_matrix_ctr -gl_matrix_dtr -gl_matrix_invert -gl_matrix_mul -gl_matrix_transposed -gl_matrix_transposef -gl_print_matrix -gl_rotation_matrix -_mesa_calloc -_mesa_free -_mesa_malloc -_mesa_bitcount -_mesa_init_math -gl_sqrt -gl_alloc_pb -gl_flush_pb -gl_build_immediate_pipeline -gl_build_precalc_pipeline -gl_pipeline_init -gl_print_active_pipeline -gl_print_pipe_ops -gl_print_pipeline -gl_print_tri_caps -gl_print_vert_flags -gl_reset_cva_vb -gl_run_pipeline -gl_update_pipelines -_mesa_GetPixelMapfv -_mesa_GetPixelMapuiv -_mesa_GetPixelMapusv -_mesa_PixelMapfv -_mesa_PixelMapuiv -_mesa_PixelMapusv -_mesa_PixelStoref -_mesa_PixelStorei -_mesa_PixelTransferf -_mesa_PixelTransferi -_mesa_PixelZoom -_mesa_lookup_rgba -_mesa_map_ci -_mesa_map_ci8_to_rgba -_mesa_map_ci_to_rgba -_mesa_map_ci_to_rgba_ubyte -_mesa_map_rgba -_mesa_map_stencil -_mesa_scale_and_bias_rgba -_mesa_shift_and_offset_ci -_mesa_shift_and_offset_stencil -_mesa_transform_rgba -_mesa_GetPixelTexGenParameterfvSGIS -_mesa_GetPixelTexGenParameterivSGIS -_mesa_PixelTexGenParameterfSGIS -_mesa_PixelTexGenParameterfvSGIS -_mesa_PixelTexGenParameteriSGIS -_mesa_PixelTexGenParameterivSGIS -_mesa_PixelTexGenSGIX -_mesa_pixeltexgen -_mesa_PointParameterfEXT -_mesa_PointParameterfvEXT -_mesa_PointSize -gl_set_point_function -_mesa_CullFace -_mesa_FrontFace -_mesa_GetPolygonStipple -_mesa_PolygonMode -_mesa_PolygonOffset -_mesa_PolygonOffsetEXT -_mesa_PolygonStipple -gl_set_quad_function -_mesa_RasterPos2d -_mesa_RasterPos2dv -_mesa_RasterPos2f -_mesa_RasterPos2fv -_mesa_RasterPos2i -_mesa_RasterPos2iv -_mesa_RasterPos2s -_mesa_RasterPos2sv -_mesa_RasterPos3d -_mesa_RasterPos3dv -_mesa_RasterPos3f -_mesa_RasterPos3fv -_mesa_RasterPos3i -_mesa_RasterPos3iv -_mesa_RasterPos3s -_mesa_RasterPos3sv -_mesa_RasterPos4d -_mesa_RasterPos4dv -_mesa_RasterPos4f -_mesa_RasterPos4fv -_mesa_RasterPos4i -_mesa_RasterPos4iv -_mesa_RasterPos4s -_mesa_RasterPos4sv -_mesa_ReadPixels -_mesa_Rectd -_mesa_Rectdv -_mesa_Rectf -_mesa_Rectfv -_mesa_Recti -_mesa_Rectiv -_mesa_Rects -_mesa_Rectsv -_mesa_Scissor -gl_scissor_pixels -gl_scissor_span -gl_init_shade -gl_shade_rastpos -gl_update_lighting_function -gl_read_index_span -gl_read_rgba_span -gl_write_index_span -gl_write_monocolor_span -gl_write_monoindex_span -gl_write_multitexture_span -gl_write_rgba_span -gl_write_texture_span -gl_clean_color -gl_default_nr_stages -gl_default_pipeline -gl_import_client_data -gl_init_vbxform -gl_update_materials -_mesa_init_exec_table -_mesa_init_no_op_table -gl_print_enable_flags -gl_print_state -gl_update_state -_mesa_ClearStencil -_mesa_StencilFunc -_mesa_StencilMask -_mesa_StencilOp -_mesa_alloc_stencil_buffer -_mesa_clear_stencil_buffer -_mesa_read_stencil_span -_mesa_stencil_and_ztest_pixels -_mesa_stencil_and_ztest_span -_mesa_write_stencil_span -_mesa_CompressedTexImage1DARB -_mesa_CompressedTexImage2DARB -_mesa_CompressedTexImage3DARB -_mesa_CompressedTexSubImage1DARB -_mesa_CompressedTexSubImage2DARB -_mesa_CompressedTexSubImage3DARB -_mesa_CopyTexImage1D -_mesa_CopyTexImage2D -_mesa_CopyTexSubImage1D -_mesa_CopyTexSubImage2D -_mesa_CopyTexSubImage3D -_mesa_GetCompressedTexImageARB -_mesa_GetTexImage -_mesa_TexImage1D -_mesa_TexImage2D -_mesa_TexImage3D -_mesa_TexImage3DEXT -_mesa_TexSubImage1D -_mesa_TexSubImage2D -_mesa_TexSubImage3D -_mesa_alloc_texture_image -_mesa_base_tex_format -_mesa_compressed_image_size -_mesa_free_texture_image -_mesa_get_teximage_from_driver -_mesa_select_tex_image -_mesa_select_tex_object -_mesa_AreTexturesResident -_mesa_BindTexture -_mesa_DeleteTextures -_mesa_GenTextures -_mesa_IsTexture -_mesa_PrioritizeTextures -_mesa_test_texobj_completeness -gl_alloc_texture_object -gl_free_texture_object -_mesa_ActiveTextureARB -_mesa_ClientActiveTextureARB -_mesa_GetTexEnvfv -_mesa_GetTexEnviv -_mesa_GetTexGendv -_mesa_GetTexGenfv -_mesa_GetTexGeniv -_mesa_GetTexLevelParameterfv -_mesa_GetTexLevelParameteriv -_mesa_GetTexParameterfv -_mesa_GetTexParameteriv -_mesa_TexEnvf -_mesa_TexEnvfv -_mesa_TexEnvi -_mesa_TexEnviv -_mesa_TexGend -_mesa_TexGendv -_mesa_TexGenf -_mesa_TexGenfv -_mesa_TexGeni -_mesa_TexGeniv -_mesa_TexParameterf -_mesa_TexParameterfv -_mesa_TexParameteri -_mesa_TexParameteriv -gl_put_texobj_on_dirty_list -gl_remove_texobj_from_dirty_list -gl_update_dirty_texobjs -_mesa_set_texture_sampler -gl_init_texture -gl_texture_pixels -gl_update_texture_unit -gl_init_translate -gl_cull_triangle -gl_set_triangle_function -_mesa_ArrayElement -_mesa_ColorPointer -_mesa_ColorPointerEXT -_mesa_DrawArrays -_mesa_DrawElements -_mesa_DrawRangeElements -_mesa_EdgeFlagPointer -_mesa_EdgeFlagPointerEXT -_mesa_IndexPointer -_mesa_IndexPointerEXT -_mesa_InterleavedArrays -_mesa_NormalPointer -_mesa_NormalPointerEXT -_mesa_TexCoordPointer -_mesa_TexCoordPointerEXT -_mesa_VertexPointer -_mesa_VertexPointerEXT -gl_exec_array_elements -gl_update_client_state -gl_immediate_alloc -gl_immediate_free -gl_vb_create_for_cva -gl_vb_create_for_immediate -gl_vb_free -gl_cull_vb -gl_dont_cull_vb -gl_fast_copy_vb -gl_make_normal_cullmask -gl_purge_vertices -_mesa_Begin -_mesa_Color3b -_mesa_Color3bv -_mesa_Color3d -_mesa_Color3dv -_mesa_Color3f -_mesa_Color3fv -_mesa_Color3i -_mesa_Color3iv -_mesa_Color3s -_mesa_Color3sv -_mesa_Color3ub -_mesa_Color3ubv -_mesa_Color3ui -_mesa_Color3uiv -_mesa_Color3us -_mesa_Color3usv -_mesa_Color4b -_mesa_Color4bv -_mesa_Color4d -_mesa_Color4dv -_mesa_Color4f -_mesa_Color4fv -_mesa_Color4i -_mesa_Color4iv -_mesa_Color4s -_mesa_Color4sv -_mesa_Color4ub -_mesa_Color4ubv -_mesa_Color4ui -_mesa_Color4uiv -_mesa_Color4us -_mesa_Color4usv -_mesa_EdgeFlag -_mesa_EdgeFlagv -_mesa_End -_mesa_Indexd -_mesa_Indexdv -_mesa_Indexf -_mesa_Indexfv -_mesa_Indexi -_mesa_Indexiv -_mesa_Indexs -_mesa_Indexsv -_mesa_Indexub -_mesa_Indexubv -_mesa_MultiTexCoord1dARB -_mesa_MultiTexCoord1dvARB -_mesa_MultiTexCoord1fARB -_mesa_MultiTexCoord1fvARB -_mesa_MultiTexCoord1iARB -_mesa_MultiTexCoord1ivARB -_mesa_MultiTexCoord1sARB -_mesa_MultiTexCoord1svARB -_mesa_MultiTexCoord2dARB -_mesa_MultiTexCoord2dvARB -_mesa_MultiTexCoord2fARB -_mesa_MultiTexCoord2fvARB -_mesa_MultiTexCoord2iARB -_mesa_MultiTexCoord2ivARB -_mesa_MultiTexCoord2sARB -_mesa_MultiTexCoord2svARB -_mesa_MultiTexCoord3dARB -_mesa_MultiTexCoord3dvARB -_mesa_MultiTexCoord3fARB -_mesa_MultiTexCoord3fvARB -_mesa_MultiTexCoord3iARB -_mesa_MultiTexCoord3ivARB -_mesa_MultiTexCoord3sARB -_mesa_MultiTexCoord3svARB -_mesa_MultiTexCoord4dARB -_mesa_MultiTexCoord4dvARB -_mesa_MultiTexCoord4fARB -_mesa_MultiTexCoord4fvARB -_mesa_MultiTexCoord4iARB -_mesa_MultiTexCoord4ivARB -_mesa_MultiTexCoord4sARB -_mesa_MultiTexCoord4svARB -_mesa_Normal3b -_mesa_Normal3bv -_mesa_Normal3d -_mesa_Normal3dv -_mesa_Normal3f -_mesa_Normal3fv -_mesa_Normal3i -_mesa_Normal3iv -_mesa_Normal3s -_mesa_Normal3sv -_mesa_TexCoord1d -_mesa_TexCoord1dv -_mesa_TexCoord1f -_mesa_TexCoord1fv -_mesa_TexCoord1i -_mesa_TexCoord1iv -_mesa_TexCoord1s -_mesa_TexCoord1sv -_mesa_TexCoord2d -_mesa_TexCoord2dv -_mesa_TexCoord2f -_mesa_TexCoord2fv -_mesa_TexCoord2i -_mesa_TexCoord2iv -_mesa_TexCoord2s -_mesa_TexCoord2sv -_mesa_TexCoord3d -_mesa_TexCoord3dv -_mesa_TexCoord3f -_mesa_TexCoord3fv -_mesa_TexCoord3i -_mesa_TexCoord3iv -_mesa_TexCoord3s -_mesa_TexCoord3sv -_mesa_TexCoord4d -_mesa_TexCoord4dv -_mesa_TexCoord4f -_mesa_TexCoord4fv -_mesa_TexCoord4i -_mesa_TexCoord4iv -_mesa_TexCoord4s -_mesa_TexCoord4sv -_mesa_Vertex2d -_mesa_Vertex2dv -_mesa_Vertex2f -_mesa_Vertex2fv -_mesa_Vertex2i -_mesa_Vertex2iv -_mesa_Vertex2s -_mesa_Vertex2sv -_mesa_Vertex3d -_mesa_Vertex3dv -_mesa_Vertex3f -_mesa_Vertex3fv -_mesa_Vertex3i -_mesa_Vertex3iv -_mesa_Vertex3s -_mesa_Vertex3sv -_mesa_Vertex4d -_mesa_Vertex4dv -_mesa_Vertex4f -_mesa_Vertex4fv -_mesa_Vertex4i -_mesa_Vertex4iv -_mesa_Vertex4s -_mesa_Vertex4sv -gl_Begin -gl_End -gl_Vertex2f -gl_render_elts -gl_render_vb_indirect -gl_init_vbrender -gl_reduced_prim_change -gl_render_clipped_line -gl_render_clipped_triangle -gl_render_vb -gl_set_render_vb_function -RESET_IMMEDIATE -gl_compute_orflag -gl_copy_prev_vertices -gl_copy_to_current -gl_execute_cassette -gl_fixup_cassette -gl_fixup_input -gl_flush_vb -gl_internal_flush -gl_maybe_transform_vb -gl_print_cassette -gl_print_cassette_flags -gl_reset_input -gl_reset_vb -gl_texcoord_size -gl_vector1ub_alloc -gl_vector1ub_free -gl_vector1ub_init -gl_vector1ui_alloc -gl_vector1ui_free -gl_vector1ui_init -gl_vector3f_alloc -gl_vector3f_free -gl_vector3f_init -gl_vector3f_print -gl_vector4f_alloc -gl_vector4f_clean_elem -gl_vector4f_free -gl_vector4f_init -gl_vector4f_print -gl_vector4ub_alloc -gl_vector4ub_free -gl_vector4ub_init -gl_init_vertices -_mesa_WindowPos2dMESA -_mesa_WindowPos2dvMESA -_mesa_WindowPos2fMESA -_mesa_WindowPos2fvMESA -_mesa_WindowPos2iMESA -_mesa_WindowPos2ivMESA -_mesa_WindowPos2sMESA -_mesa_WindowPos2svMESA -_mesa_WindowPos3dMESA -_mesa_WindowPos3dvMESA -_mesa_WindowPos3fMESA -_mesa_WindowPos3fvMESA -_mesa_WindowPos3iMESA -_mesa_WindowPos3ivMESA -_mesa_WindowPos3sMESA -_mesa_WindowPos3svMESA -_mesa_WindowPos4dMESA -_mesa_WindowPos4dvMESA -_mesa_WindowPos4fMESA -_mesa_WindowPos4fvMESA -_mesa_WindowPos4iMESA -_mesa_WindowPos4ivMESA -_mesa_WindowPos4sMESA -_mesa_WindowPos4svMESA -gl_init_transformation -gl_project_points -gl_transform_point_sz -gl_transform_vector -gl_write_zoomed_index_span -gl_write_zoomed_rgb_span -gl_write_zoomed_rgba_span -gl_write_zoomed_stencil_span -__MESA_beginDispatchOverride -__MESA_copyContext -__MESA_createBuffer -__MESA_createContext -__MESA_destroyBuffer -__MESA_destroyContext -__MESA_dispatchExec -__MESA_endDispatchOverride -__MESA_forceCurrent -__MESA_initVisuals -__MESA_loseCurrent -__MESA_makeCurrent -__MESA_notifyDestroy -__MESA_notifyResize -__MESA_notifySwapBuffers -__MESA_resetExtension -__MESA_resizeBuffers -__MESA_screenProbe -__MESA_setVisualConfigs -__MESA_shareContext -__MESA_swapBuffers -__glFloorLog2 -XMesaCreateImage -XMesaDestroyImage -XMesaGetPixel -XMesaPutImageHelper -XMesaCopySubBuffer -XMesaCreateContext -XMesaCreatePixmapBuffer -XMesaCreateVisual -XMesaCreateWindowBuffer -XMesaCreateWindowBuffer2 -XMesaDestroyBuffer -XMesaDestroyContext -XMesaDestroyVisual -XMesaDitherColor -XMesaFindBuffer -XMesaFlush -XMesaForceCurrent -XMesaGarbageCollect -XMesaGetBackBuffer -XMesaGetCurrentBuffer -XMesaGetCurrentContext -XMesaGetCurrentReadBuffer -XMesaGetDepthBuffer -XMesaGetString -XMesaLoseCurrent -XMesaMakeCurrent -XMesaMakeCurrent2 -XMesaReset -XMesaSetFXmode -XMesaSetVisualDisplay -XMesaSwapBuffers -XMesaUnbindContext -xmesa_alloc_back_buffer -xmesa_color_to_pixel -xmesa_update_state -xmesa_get_line_func -xmesa_get_points_func -xmesa_get_triangle_func - -- cgit v1.2.3 From 7993d28f1d4cd835980d81993bf53854441a6705 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 3 Nov 2016 23:53:46 +0100 Subject: add .gitignore files --- .gitignore | 13 + nx-X11/.gitignore | 5 + nx-X11/include/.gitignore | 5 + nx-X11/lib/X11/.gitignore | 1 + nx-X11/programs/Xserver/.gitignore | 2 + nx-X11/programs/Xserver/GL/.gitignore | 341 ++++++++++++++++++++++++++ nx-X11/programs/Xserver/composite/.gitignore | 0 nx-X11/programs/Xserver/hw/nxagent/.gitignore | 3 + nx-X11/programs/Xserver/include/.gitignore | 1 + nxcomp/.gitignore | 2 + nxcompext/.gitignore | 2 + nxcompshad/.gitignore | 2 + nxproxy/.gitignore | 2 + 13 files changed, 379 insertions(+) create mode 100644 .gitignore create mode 100644 nx-X11/.gitignore create mode 100644 nx-X11/include/.gitignore create mode 100644 nx-X11/lib/X11/.gitignore create mode 100644 nx-X11/programs/Xserver/.gitignore create mode 100644 nx-X11/programs/Xserver/GL/.gitignore create mode 100644 nx-X11/programs/Xserver/composite/.gitignore create mode 100644 nx-X11/programs/Xserver/hw/nxagent/.gitignore create mode 100644 nx-X11/programs/Xserver/include/.gitignore create mode 100644 nxcomp/.gitignore create mode 100644 nxcompext/.gitignore create mode 100644 nxcompshad/.gitignore create mode 100644 nxproxy/.gitignore (limited to 'nx-X11/programs/Xserver/GL') diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..325bebed4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +.gitignore +*.o +*.so.* +*.so +*.a +xmakefile +autom4te.cache/ +config.log +config.status +configure +depend.status +*~ +[#]* diff --git a/nx-X11/.gitignore b/nx-X11/.gitignore new file mode 100644 index 000000000..8e0d8bf9d --- /dev/null +++ b/nx-X11/.gitignore @@ -0,0 +1,5 @@ +Makefile +Makefile.bak +xmakefile +exports/ +.build-exports/ diff --git a/nx-X11/include/.gitignore b/nx-X11/include/.gitignore new file mode 100644 index 000000000..16951a0af --- /dev/null +++ b/nx-X11/include/.gitignore @@ -0,0 +1,5 @@ +GL/gl.h +GL/glext.h +GL/glxext.h +GL/osmesa.h +Xpoll.h diff --git a/nx-X11/lib/X11/.gitignore b/nx-X11/lib/X11/.gitignore new file mode 100644 index 000000000..8215e21de --- /dev/null +++ b/nx-X11/lib/X11/.gitignore @@ -0,0 +1 @@ +ks_tables.h \ No newline at end of file diff --git a/nx-X11/programs/Xserver/.gitignore b/nx-X11/programs/Xserver/.gitignore new file mode 100644 index 000000000..ea37aa3ef --- /dev/null +++ b/nx-X11/programs/Xserver/.gitignore @@ -0,0 +1,2 @@ +nxagent +nxagent.bak diff --git a/nx-X11/programs/Xserver/GL/.gitignore b/nx-X11/programs/Xserver/GL/.gitignore new file mode 100644 index 000000000..5231f1978 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/.gitignore @@ -0,0 +1,341 @@ +glx/DONE +glx/glcontextmodes.c +glx/glcontextmodes.h +glx/indirect_size.c +glx/indirect_size.h +mesa/X/DONE +mesa/X/compsize.c +mesa/X/driverfuncs.c +mesa/X/driverfuncs.h +mesa/X/xm_api.c +mesa/X/xm_buffer.c +mesa/X/xm_dd.c +mesa/X/xm_line.c +mesa/X/xm_span.c +mesa/X/xm_tri.c +mesa/array_cache/DONE +mesa/array_cache/ac_context.c +mesa/array_cache/ac_context.h +mesa/array_cache/ac_import.c +mesa/array_cache/acache.h +mesa/main/DONE +mesa/main/accum.c +mesa/main/accum.h +mesa/main/api_arrayelt.c +mesa/main/api_arrayelt.h +mesa/main/api_eval.h +mesa/main/api_loopback.c +mesa/main/api_loopback.h +mesa/main/api_noop.c +mesa/main/api_noop.h +mesa/main/api_validate.c +mesa/main/api_validate.h +mesa/main/attrib.c +mesa/main/attrib.h +mesa/main/blend.c +mesa/main/blend.h +mesa/main/bufferobj.c +mesa/main/bufferobj.h +mesa/main/buffers.c +mesa/main/buffers.h +mesa/main/clip.c +mesa/main/clip.h +mesa/main/colormac.h +mesa/main/colortab.c +mesa/main/colortab.h +mesa/main/config.h +mesa/main/context.c +mesa/main/context.h +mesa/main/convolve.c +mesa/main/convolve.h +mesa/main/dd.h +mesa/main/debug.c +mesa/main/debug.h +mesa/main/depth.c +mesa/main/depth.h +mesa/main/dispatch.c +mesa/main/dlist.c +mesa/main/dlist.h +mesa/main/drawpix.c +mesa/main/drawpix.h +mesa/main/enable.c +mesa/main/enable.h +mesa/main/enums.c +mesa/main/enums.h +mesa/main/eval.c +mesa/main/eval.h +mesa/main/execmem.c +mesa/main/extensions.c +mesa/main/extensions.h +mesa/main/fbobject.c +mesa/main/fbobject.h +mesa/main/feedback.c +mesa/main/feedback.h +mesa/main/fog.c +mesa/main/fog.h +mesa/main/framebuffer.c +mesa/main/framebuffer.h +mesa/main/get.c +mesa/main/get.h +mesa/main/getstring.c +mesa/main/glapi.c +mesa/main/glheader.h +mesa/main/glthread.c +mesa/main/hash.c +mesa/main/hash.h +mesa/main/hint.c +mesa/main/hint.h +mesa/main/histogram.c +mesa/main/histogram.h +mesa/main/image.c +mesa/main/image.h +mesa/main/imports.c +mesa/main/imports.h +mesa/main/light.c +mesa/main/light.h +mesa/main/lines.c +mesa/main/lines.h +mesa/main/macros.h +mesa/main/matrix.c +mesa/main/matrix.h +mesa/main/mm.c +mesa/main/mm.h +mesa/main/mtypes.h +mesa/main/occlude.c +mesa/main/occlude.h +mesa/main/pixel.c +mesa/main/pixel.h +mesa/main/points.c +mesa/main/points.h +mesa/main/polygon.c +mesa/main/polygon.h +mesa/main/rastpos.c +mesa/main/rastpos.h +mesa/main/renderbuffer.c +mesa/main/renderbuffer.h +mesa/main/simple_list.h +mesa/main/state.c +mesa/main/state.h +mesa/main/stencil.c +mesa/main/stencil.h +mesa/main/texcompress.c +mesa/main/texcompress.h +mesa/main/texcompress_fxt1.c +mesa/main/texcompress_s3tc.c +mesa/main/texenvprogram.c +mesa/main/texenvprogram.h +mesa/main/texformat.c +mesa/main/texformat.h +mesa/main/texformat_tmp.h +mesa/main/teximage.c +mesa/main/teximage.h +mesa/main/texobj.c +mesa/main/texobj.h +mesa/main/texrender.c +mesa/main/texrender.h +mesa/main/texstate.c +mesa/main/texstate.h +mesa/main/texstore.c +mesa/main/texstore.h +mesa/main/varray.c +mesa/main/varray.h +mesa/main/version.h +mesa/main/vtxfmt.c +mesa/main/vtxfmt.h +mesa/main/vtxfmt_tmp.h +mesa/math/DONE +mesa/math/m_clip_tmp.h +mesa/math/m_copy_tmp.h +mesa/math/m_debug.h +mesa/math/m_debug_clip.c +mesa/math/m_debug_norm.c +mesa/math/m_debug_util.h +mesa/math/m_debug_xform.c +mesa/math/m_dotprod_tmp.h +mesa/math/m_eval.c +mesa/math/m_eval.h +mesa/math/m_matrix.c +mesa/math/m_matrix.h +mesa/math/m_norm_tmp.h +mesa/math/m_trans_tmp.h +mesa/math/m_translate.c +mesa/math/m_translate.h +mesa/math/m_vector.c +mesa/math/m_vector.h +mesa/math/m_xform.c +mesa/math/m_xform.h +mesa/math/m_xform_tmp.h +mesa/math/mathmod.h +mesa/shader/DONE +mesa/shader/arbfragparse.c +mesa/shader/arbfragparse.h +mesa/shader/arbprogparse.c +mesa/shader/arbprogparse.h +mesa/shader/arbprogram.c +mesa/shader/arbprogram.h +mesa/shader/arbprogram_syn.h +mesa/shader/arbvertparse.c +mesa/shader/arbvertparse.h +mesa/shader/atifragshader.c +mesa/shader/atifragshader.h +mesa/shader/grammar/DONE +mesa/shader/grammar/grammar.c +mesa/shader/grammar/grammar.h +mesa/shader/grammar/grammar_mesa.c +mesa/shader/grammar/grammar_mesa.h +mesa/shader/grammar/grammar_syn.h +mesa/shader/nvfragparse.c +mesa/shader/nvfragparse.h +mesa/shader/nvfragprog.h +mesa/shader/nvprogram.c +mesa/shader/nvprogram.h +mesa/shader/nvvertexec.c +mesa/shader/nvvertexec.h +mesa/shader/nvvertparse.c +mesa/shader/nvvertparse.h +mesa/shader/nvvertprog.h +mesa/shader/program.c +mesa/shader/program.h +mesa/shader/shaderobjects.c +mesa/shader/shaderobjects.h +mesa/shader/shaderobjects_3dlabs.c +mesa/shader/shaderobjects_3dlabs.h +mesa/shader/slang/DONE +mesa/shader/slang/library/slang_common_builtin_gc.h +mesa/shader/slang/library/slang_common_builtin_gc_bin.h +mesa/shader/slang/library/slang_core_gc.h +mesa/shader/slang/library/slang_core_gc_bin.h +mesa/shader/slang/library/slang_fragment_builtin_gc.h +mesa/shader/slang/library/slang_fragment_builtin_gc_bin.h +mesa/shader/slang/library/slang_shader_syn.h +mesa/shader/slang/library/slang_version_syn.h +mesa/shader/slang/library/slang_vertex_builtin_gc.h +mesa/shader/slang/library/slang_vertex_builtin_gc_bin.h +mesa/shader/slang/slang_assemble.c +mesa/shader/slang/slang_assemble.h +mesa/shader/slang/slang_assemble_assignment.c +mesa/shader/slang/slang_assemble_assignment.h +mesa/shader/slang/slang_assemble_conditional.c +mesa/shader/slang/slang_assemble_conditional.h +mesa/shader/slang/slang_assemble_constructor.c +mesa/shader/slang/slang_assemble_constructor.h +mesa/shader/slang/slang_assemble_typeinfo.c +mesa/shader/slang/slang_assemble_typeinfo.h +mesa/shader/slang/slang_compile.c +mesa/shader/slang/slang_compile.h +mesa/shader/slang/slang_execute.c +mesa/shader/slang/slang_execute.h +mesa/shader/slang/slang_preprocess.c +mesa/shader/slang/slang_preprocess.h +mesa/shader/slang/slang_storage.c +mesa/shader/slang/slang_storage.h +mesa/shader/slang/slang_utility.c +mesa/shader/slang/slang_utility.h +mesa/shader/slang/traverse_wrap.h +mesa/swrast/DONE +mesa/swrast/s_aaline.c +mesa/swrast/s_aaline.h +mesa/swrast/s_aalinetemp.h +mesa/swrast/s_aatriangle.c +mesa/swrast/s_aatriangle.h +mesa/swrast/s_aatritemp.h +mesa/swrast/s_accum.c +mesa/swrast/s_accum.h +mesa/swrast/s_alpha.c +mesa/swrast/s_alpha.h +mesa/swrast/s_atifragshader.c +mesa/swrast/s_atifragshader.h +mesa/swrast/s_bitmap.c +mesa/swrast/s_blend.c +mesa/swrast/s_blend.h +mesa/swrast/s_buffers.c +mesa/swrast/s_context.c +mesa/swrast/s_context.h +mesa/swrast/s_copypix.c +mesa/swrast/s_depth.c +mesa/swrast/s_depth.h +mesa/swrast/s_drawpix.c +mesa/swrast/s_drawpix.h +mesa/swrast/s_feedback.c +mesa/swrast/s_feedback.h +mesa/swrast/s_fog.c +mesa/swrast/s_fog.h +mesa/swrast/s_imaging.c +mesa/swrast/s_lines.c +mesa/swrast/s_lines.h +mesa/swrast/s_linetemp.h +mesa/swrast/s_logic.c +mesa/swrast/s_logic.h +mesa/swrast/s_masking.c +mesa/swrast/s_masking.h +mesa/swrast/s_nvfragprog.c +mesa/swrast/s_nvfragprog.h +mesa/swrast/s_pixeltex.c +mesa/swrast/s_pixeltex.h +mesa/swrast/s_points.c +mesa/swrast/s_points.h +mesa/swrast/s_pointtemp.h +mesa/swrast/s_readpix.c +mesa/swrast/s_span.c +mesa/swrast/s_span.h +mesa/swrast/s_spantemp.h +mesa/swrast/s_stencil.c +mesa/swrast/s_stencil.h +mesa/swrast/s_texstore.c +mesa/swrast/s_texture.c +mesa/swrast/s_texture.h +mesa/swrast/s_triangle.c +mesa/swrast/s_triangle.h +mesa/swrast/s_trispan.h +mesa/swrast/s_tritemp.h +mesa/swrast/s_zoom.c +mesa/swrast/s_zoom.h +mesa/swrast/swrast.h +mesa/swrast_setup/DONE +mesa/swrast_setup/ss_context.c +mesa/swrast_setup/ss_context.h +mesa/swrast_setup/ss_triangle.c +mesa/swrast_setup/ss_triangle.h +mesa/swrast_setup/ss_tritmp.h +mesa/swrast_setup/swrast_setup.h +mesa/tnl/DONE +mesa/tnl/t_array_api.c +mesa/tnl/t_array_api.h +mesa/tnl/t_array_import.c +mesa/tnl/t_array_import.h +mesa/tnl/t_context.c +mesa/tnl/t_context.h +mesa/tnl/t_pipeline.c +mesa/tnl/t_pipeline.h +mesa/tnl/t_save_api.c +mesa/tnl/t_save_api.h +mesa/tnl/t_save_loopback.c +mesa/tnl/t_save_playback.c +mesa/tnl/t_vb_arbprogram.c +mesa/tnl/t_vb_arbprogram.h +mesa/tnl/t_vb_arbprogram_sse.c +mesa/tnl/t_vb_cliptmp.h +mesa/tnl/t_vb_cull.c +mesa/tnl/t_vb_fog.c +mesa/tnl/t_vb_light.c +mesa/tnl/t_vb_lighttmp.h +mesa/tnl/t_vb_normals.c +mesa/tnl/t_vb_points.c +mesa/tnl/t_vb_program.c +mesa/tnl/t_vb_render.c +mesa/tnl/t_vb_rendertmp.h +mesa/tnl/t_vb_texgen.c +mesa/tnl/t_vb_texmat.c +mesa/tnl/t_vb_vertex.c +mesa/tnl/t_vertex.c +mesa/tnl/t_vertex.h +mesa/tnl/t_vertex_generic.c +mesa/tnl/t_vertex_sse.c +mesa/tnl/t_vp_build.c +mesa/tnl/t_vp_build.h +mesa/tnl/t_vtx_api.c +mesa/tnl/t_vtx_api.h +mesa/tnl/t_vtx_eval.c +mesa/tnl/t_vtx_exec.c +mesa/tnl/t_vtx_generic.c +mesa/tnl/tnl.h diff --git a/nx-X11/programs/Xserver/composite/.gitignore b/nx-X11/programs/Xserver/composite/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/nx-X11/programs/Xserver/hw/nxagent/.gitignore b/nx-X11/programs/Xserver/hw/nxagent/.gitignore new file mode 100644 index 000000000..256534b63 --- /dev/null +++ b/nx-X11/programs/Xserver/hw/nxagent/.gitignore @@ -0,0 +1,3 @@ +miinitext.c +stubs.c +xpstubs.c 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/nxcomp/.gitignore b/nxcomp/.gitignore new file mode 100644 index 000000000..27a99e5b2 --- /dev/null +++ b/nxcomp/.gitignore @@ -0,0 +1,2 @@ +nxcomp.pc +Makefile diff --git a/nxcompext/.gitignore b/nxcompext/.gitignore new file mode 100644 index 000000000..4dbbba27e --- /dev/null +++ b/nxcompext/.gitignore @@ -0,0 +1,2 @@ +nxcompext.pc +Makefile diff --git a/nxcompshad/.gitignore b/nxcompshad/.gitignore new file mode 100644 index 000000000..f083c6b27 --- /dev/null +++ b/nxcompshad/.gitignore @@ -0,0 +1,2 @@ +nxcompshad.pc +Makefile diff --git a/nxproxy/.gitignore b/nxproxy/.gitignore new file mode 100644 index 000000000..3d98254b2 --- /dev/null +++ b/nxproxy/.gitignore @@ -0,0 +1,2 @@ +Makefile +nxproxy -- cgit v1.2.3 From 508d2deae98846111299a3693033a507010e3c91 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 29 Oct 2016 11:28:02 +0200 Subject: Remove libcwrapper usage from xorg server modules. The libcwrapper is not used in nxagent. From c3d14036729fd186d4ec7ca1de603e1f2d174e2f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 10 Feb 2006 22:00:30 +0000 Subject: Remove libcwrapper usage from xorg server modules. The libcwrapper is only of (marginal) use in the drivers, and that usage remains. Backported-to-NX-by: Mike Gabriel Fixes ArcticaProject/nx-libs#246 (together with merge commit ecd335fa61551d0b86d3f075469a7743ab899d95). --- nx-X11/config/cf/xorg.cf | 4 +- nx-X11/extras/Mesa/include/GL/internal/glcore.h | 2 - nx-X11/extras/Mesa/src/mesa/main/context.c | 4 - nx-X11/extras/Mesa/src/mesa/main/glheader.h | 6 +- nx-X11/extras/Mesa/src/mesa/main/imports.c | 108 +--------------------- nx-X11/extras/Mesa/src/mesa/main/imports.h | 16 +--- nx-X11/include/Xfuncs.h | 5 - nx-X11/programs/Xserver/GL/glx/glxcmds.c | 2 + nx-X11/programs/Xserver/GL/glx/glximports.c | 4 + nx-X11/programs/Xserver/GL/glx/glxscreens.c | 4 - nx-X11/programs/Xserver/GL/glx/glxutil.c | 2 + nx-X11/programs/Xserver/GL/glx/single2.c | 4 + nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h | 4 - nx-X11/programs/Xserver/GL/include/GL/xf86glx.h | 4 - nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c | 2 + nx-X11/programs/Xserver/Xext/saver.c | 4 - nx-X11/programs/Xserver/Xext/shape.c | 5 +- nx-X11/programs/Xserver/Xext/shm.c | 4 +- nx-X11/programs/Xserver/Xext/sync.c | 6 +- nx-X11/programs/Xserver/Xext/xtest.c | 3 - nx-X11/programs/Xserver/Xext/xvdisp.c | 6 +- nx-X11/programs/Xserver/Xext/xvmain.c | 6 +- nx-X11/programs/Xserver/Xext/xvmc.c | 2 + nx-X11/programs/Xserver/dbe/dbe.c | 6 +- nx-X11/programs/Xserver/dbe/midbe.c | 4 - nx-X11/programs/Xserver/fb/fb24_32.c | 6 +- nx-X11/programs/Xserver/fb/fbarc.c | 6 +- nx-X11/programs/Xserver/fb/fbcompose.c | 6 +- nx-X11/programs/Xserver/fb/fbcopy.c | 5 +- nx-X11/programs/Xserver/fb/fbgc.c | 5 +- nx-X11/programs/Xserver/fb/fbimage.c | 7 +- nx-X11/programs/Xserver/fb/fboverlay.c | 3 +- nx-X11/programs/Xserver/fb/fbpict.c | 2 + nx-X11/programs/Xserver/fb/fbpixmap.c | 5 +- nx-X11/programs/Xserver/fb/fbseg.c | 2 + nx-X11/programs/Xserver/fb/fbwindow.c | 5 +- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 2 +- nx-X11/programs/Xserver/include/misc.h | 9 -- nx-X11/programs/Xserver/include/os.h | 8 +- nx-X11/programs/Xserver/mi/Imakefile | 10 +- nx-X11/programs/Xserver/mi/miinitext.c | 104 --------------------- nx-X11/programs/Xserver/miext/cw/cw.c | 2 + nx-X11/programs/Xserver/miext/cw/cw_ops.c | 2 + nx-X11/programs/Xserver/miext/cw/cw_render.c | 2 + nx-X11/programs/Xserver/miext/damage/damage.c | 2 + nx-X11/programs/Xserver/os/osinit.c | 7 -- nx-X11/programs/Xserver/record/record.c | 4 - nx-X11/programs/Xserver/record/set.c | 8 +- nx-X11/programs/Xserver/render/render.c | 3 - 49 files changed, 75 insertions(+), 357 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/config/cf/xorg.cf b/nx-X11/config/cf/xorg.cf index 470c9adb8..fb0dbfd08 100644 --- a/nx-X11/config/cf/xorg.cf +++ b/nx-X11/config/cf/xorg.cf @@ -556,8 +556,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 # define ExtraLoaderDefines /**/ #endif -# define XFree86LoaderDefines /**/ - #ifndef HasBsdMake #define HasBsdMake NO #endif @@ -584,7 +582,7 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8 #ifndef XFree86ServerDefines # define XFree86ServerDefines -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH \ XFree86XvDefines \ - XFree86LoaderDefines -DXFree86Server \ + -DXFree86Server \ XFree86XvMCDefines \ SmartScheduleDefines \ DebugDefines XFree86XResDefines \ diff --git a/nx-X11/extras/Mesa/include/GL/internal/glcore.h b/nx-X11/extras/Mesa/include/GL/internal/glcore.h index e0b06c7ca..9a864e7f2 100644 --- a/nx-X11/extras/Mesa/include/GL/internal/glcore.h +++ b/nx-X11/extras/Mesa/include/GL/internal/glcore.h @@ -36,9 +36,7 @@ ** */ -#ifndef XFree86LOADER #include -#endif #ifdef CAPI #undef CAPI diff --git a/nx-X11/extras/Mesa/src/mesa/main/context.c b/nx-X11/extras/Mesa/src/mesa/main/context.c index eb4b4ce4e..9e98da669 100644 --- a/nx-X11/extras/Mesa/src/mesa/main/context.c +++ b/nx-X11/extras/Mesa/src/mesa/main/context.c @@ -1034,11 +1034,7 @@ _mesa_init_constants( GLcontext *ctx ) /* If we're running in the X server, do bounds checking to prevent * segfaults and server crashes! */ -#if defined(XFree86LOADER) && defined(IN_MODULE) - ctx->Const.CheckArrayBounds = GL_TRUE; -#else ctx->Const.CheckArrayBounds = GL_FALSE; -#endif ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS; diff --git a/nx-X11/extras/Mesa/src/mesa/main/glheader.h b/nx-X11/extras/Mesa/src/mesa/main/glheader.h index 90b3a81a4..31c10e3e2 100644 --- a/nx-X11/extras/Mesa/src/mesa/main/glheader.h +++ b/nx-X11/extras/Mesa/src/mesa/main/glheader.h @@ -47,11 +47,9 @@ #define GLHEADER_H -#if defined(XFree86LOADER) && defined(IN_MODULE) -#include "xf86_ansic.h" -#else #include #include + /* If we can use Compaq's Fast Math Library on Alpha */ #if defined(__alpha__) && defined(CCPML) #include @@ -65,7 +63,7 @@ #if defined(__linux__) && defined(__i386__) #include #endif -#endif + #include #include diff --git a/nx-X11/extras/Mesa/src/mesa/main/imports.c b/nx-X11/extras/Mesa/src/mesa/main/imports.c index 9cdf4e347..1fdfe064a 100644 --- a/nx-X11/extras/Mesa/src/mesa/main/imports.c +++ b/nx-X11/extras/Mesa/src/mesa/main/imports.c @@ -81,33 +81,21 @@ extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); void * _mesa_malloc(size_t bytes) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86malloc(bytes); -#else return malloc(bytes); -#endif } /** Wrapper around either calloc() or xf86calloc() */ void * _mesa_calloc(size_t bytes) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86calloc(1, bytes); -#else return calloc(1, bytes); -#endif } /** Wrapper around either free() or xf86free() */ void _mesa_free(void *ptr) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - xf86free(ptr); -#else free(ptr); -#endif } /** @@ -211,9 +199,7 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) void * _mesa_memcpy(void *dest, const void *src, size_t n) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86memcpy(dest, src, n); -#elif defined(SUNOS4) +#if defined(SUNOS4) return memcpy((char *) dest, (char *) src, (int) n); #else return memcpy(dest, src, n); @@ -224,9 +210,7 @@ _mesa_memcpy(void *dest, const void *src, size_t n) void _mesa_memset( void *dst, int val, size_t n ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - xf86memset( dst, val, n ); -#elif defined(SUNOS4) +#if defined(SUNOS4) memset( (char *) dst, (int) val, (int) n ); #else memset(dst, val, n); @@ -250,9 +234,7 @@ _mesa_memset16( unsigned short *dst, unsigned short val, size_t n ) void _mesa_bzero( void *dst, size_t n ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - xf86memset( dst, 0, n ); -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) bzero( dst, n ); #else memset( dst, 0, n ); @@ -270,33 +252,21 @@ _mesa_bzero( void *dst, size_t n ) double _mesa_sin(double a) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86sin(a); -#else return sin(a); -#endif } /** Wrapper around either cos() or xf86cos() */ double _mesa_cos(double a) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86cos(a); -#else return cos(a); -#endif } /** Wrapper around either sqrt() or xf86sqrt() */ double _mesa_sqrtd(double x) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86sqrt(x); -#else return sqrt(x); -#endif } @@ -494,9 +464,6 @@ _mesa_inv_sqrtf(float n) return x3 * r3; #endif -#elif defined(XFree86LOADER) && defined(IN_MODULE) - return 1.0F / xf86sqrt(n); -#else return (float) (1.0 / sqrt(n)); #endif } @@ -508,11 +475,7 @@ _mesa_inv_sqrtf(float n) double _mesa_pow(double x, double y) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86pow(x, y); -#else return pow(x, y); -#endif } @@ -681,9 +644,7 @@ _mesa_half_to_float(GLhalfARB val) char * _mesa_getenv( const char *var ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86getenv(var); -#elif defined(_XBOX) +#if defined(_XBOX) return NULL; #else return getenv(var); @@ -701,77 +662,49 @@ _mesa_getenv( const char *var ) char * _mesa_strstr( const char *haystack, const char *needle ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86strstr(haystack, needle); -#else return strstr(haystack, needle); -#endif } /** Wrapper around either strncat() or xf86strncat() */ char * _mesa_strncat( char *dest, const char *src, size_t n ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86strncat(dest, src, n); -#else return strncat(dest, src, n); -#endif } /** Wrapper around either strcpy() or xf86strcpy() */ char * _mesa_strcpy( char *dest, const char *src ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86strcpy(dest, src); -#else return strcpy(dest, src); -#endif } /** Wrapper around either strncpy() or xf86strncpy() */ char * _mesa_strncpy( char *dest, const char *src, size_t n ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86strncpy(dest, src, n); -#else return strncpy(dest, src, n); -#endif } /** Wrapper around either strlen() or xf86strlen() */ size_t _mesa_strlen( const char *s ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86strlen(s); -#else return strlen(s); -#endif } /** Wrapper around either strcmp() or xf86strcmp() */ int _mesa_strcmp( const char *s1, const char *s2 ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86strcmp(s1, s2); -#else return strcmp(s1, s2); -#endif } /** Wrapper around either strncmp() or xf86strncmp() */ int _mesa_strncmp( const char *s1, const char *s2, size_t n ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86strncmp(s1, s2, n); -#else return strncmp(s1, s2, n); -#endif } /** Implemented using _mesa_malloc() and _mesa_strcpy */ @@ -789,22 +722,14 @@ _mesa_strdup( const char *s ) int _mesa_atoi(const char *s) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86atoi(s); -#else return atoi(s); -#endif } /** Wrapper around either strtod() or xf86strtod() */ double _mesa_strtod( const char *s, char **end ) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86strtod(s, end); -#else return strtod(s, end); -#endif } /*@}*/ @@ -822,11 +747,7 @@ _mesa_sprintf( char *str, const char *fmt, ... ) va_list args; va_start( args, fmt ); va_end( args ); -#if defined(XFree86LOADER) && defined(IN_MODULE) - r = xf86vsprintf( str, fmt, args ); -#else r = vsprintf( str, fmt, args ); -#endif return r; } @@ -840,11 +761,7 @@ _mesa_printf( const char *fmtString, ... ) va_start( args, fmtString ); vsnprintf(s, MAXSTRING, fmtString, args); va_end( args ); -#if defined(XFree86LOADER) && defined(IN_MODULE) - xf86printf("%s", s); -#else fprintf(stderr,"%s", s); -#endif } /*@}*/ @@ -880,11 +797,7 @@ _mesa_warning( GLcontext *ctx, const char *fmtString, ... ) debug = _mesa_getenv("MESA_DEBUG") ? GL_TRUE : GL_FALSE; #endif if (debug) { -#if defined(XFree86LOADER) && defined(IN_MODULE) - xf86fprintf(stderr, "Mesa warning: %s", str); -#else fprintf(stderr, "Mesa warning: %s", str); -#endif } } @@ -908,13 +821,8 @@ _mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) vsnprintf( str, MAXSTRING, fmtString, args ); va_end( args ); -#if defined(XFree86LOADER) && defined(IN_MODULE) - xf86fprintf(stderr, "Mesa %s implementation error: %s\n", MESA_VERSION_STRING, str); - xf86fprintf(stderr, "Please report at bugzilla.freedesktop.org\n"); -#else fprintf(stderr, "Mesa %s implementation error: %s\n", MESA_VERSION_STRING, str); fprintf(stderr, "Please report at bugzilla.freedesktop.org\n"); -#endif } /** @@ -1015,11 +923,7 @@ _mesa_debug( const GLcontext *ctx, const char *fmtString, ... ) va_start(args, fmtString); vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); -#if defined(XFree86LOADER) && defined(IN_MODULE) - xf86fprintf(stderr, "Mesa: %s", s); -#else fprintf(stderr, "Mesa: %s", s); -#endif } /*@}*/ @@ -1050,11 +954,7 @@ static void * default_realloc(__GLcontext *gc, void *oldAddr, size_t newSize) { (void) gc; -#if defined(XFree86LOADER) && defined(IN_MODULE) - return xf86realloc(oldAddr, newSize); -#else return realloc(oldAddr, newSize); -#endif } /** Wrapper around _mesa_free() */ diff --git a/nx-X11/extras/Mesa/src/mesa/main/imports.h b/nx-X11/extras/Mesa/src/mesa/main/imports.h index 37e808fc4..7c7a90a74 100644 --- a/nx-X11/extras/Mesa/src/mesa/main/imports.h +++ b/nx-X11/extras/Mesa/src/mesa/main/imports.h @@ -217,8 +217,6 @@ typedef union { GLfloat f; GLint i; } fi_type; ***/ #if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */ # define SQRTF(X) _mesa_sqrtf(X) -#elif defined(XFree86LOADER) && defined(IN_MODULE) -# define SQRTF(X) (float) xf86sqrt((float) (X)) #else # define SQRTF(X) (float) sqrt((float) (X)) #endif @@ -265,9 +263,6 @@ static INLINE GLfloat LOG2(GLfloat val) num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3; return num.f + log_2; } -#elif defined(XFree86LOADER) && defined(IN_MODULE) -#define LOG2(x) ((GLfloat) (xf86log(x) * 1.442695)) -#else /* * NOTE: log_base_2(x) = log(x) / log(2) * NOTE: 1.442695 = 1/log(2). @@ -275,7 +270,6 @@ static INLINE GLfloat LOG2(GLfloat val) #define LOG2(x) ((GLfloat) (log(x) * 1.442695F)) #endif - /*** *** IS_INF_OR_NAN: test if float is infinite or NaN ***/ @@ -337,15 +331,7 @@ static INLINE int GET_FLOAT_BITS( float x ) *** LDEXPF: multiply value by an integral power of two *** FREXPF: extract mantissa and exponent from value ***/ -#if defined(XFree86LOADER) && defined(IN_MODULE) -#define CEILF(x) ((GLfloat) xf86ceil(x)) -#define FLOORF(x) ((GLfloat) xf86floor(x)) -#define FABSF(x) ((GLfloat) xf86fabs(x)) -#define LOGF(x) ((GLfloat) xf86log(x)) -#define EXPF(x) ((GLfloat) xf86exp(x)) -#define LDEXPF(x,y) ((GLfloat) xf86ldexp(x,y)) -#define FREXPF(x,y) ((GLfloat) xf86frexp(x,y)) -#elif defined(__gnu_linux__) +#if defined(__gnu_linux__) /* C99 functions */ #define CEILF(x) ceilf(x) #define FLOORF(x) floorf(x) diff --git a/nx-X11/include/Xfuncs.h b/nx-X11/include/Xfuncs.h index c00e468ec..3ea09a8b7 100644 --- a/nx-X11/include/Xfuncs.h +++ b/nx-X11/include/Xfuncs.h @@ -32,9 +32,6 @@ in this Software without prior written authorization from The Open Group. #include -/* the old Xfuncs.h, for pre-R6 */ -#if !(defined(XFree86LOADER) && defined(IN_MODULE)) - #ifdef X_USEBFUNCS void bcopy(); void bzero(); @@ -88,6 +85,4 @@ void bcopy(); #define atexit(f) on_exit(f, 0) #endif -#endif /* !(defined(XFree86LOADER) && defined(IN_MODULE)) */ - #endif /* _XFUNCS_H_ */ diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index 1145186e7..dd5e40ffe 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -38,6 +38,8 @@ #include #endif +#include + #include "glxserver.h" #include #include diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.c b/nx-X11/programs/Xserver/GL/glx/glximports.c index fa930cf5b..a5a5e37ae 100644 --- a/nx-X11/programs/Xserver/GL/glx/glximports.c +++ b/nx-X11/programs/Xserver/GL/glx/glximports.c @@ -37,6 +37,10 @@ #include #endif +#include +#include +#include + #include "glxserver.h" #include "glxcontext.h" #include "glximports.h" diff --git a/nx-X11/programs/Xserver/GL/glx/glxscreens.c b/nx-X11/programs/Xserver/GL/glx/glxscreens.c index 88833e154..6b274a64b 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxscreens.c +++ b/nx-X11/programs/Xserver/GL/glx/glxscreens.c @@ -37,12 +37,8 @@ #include #endif -#ifdef IN_MODULE -#include -#else #include #include -#endif #include diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c index b8d4874aa..5d40bc832 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxutil.c +++ b/nx-X11/programs/Xserver/GL/glx/glxutil.c @@ -38,6 +38,8 @@ #include #endif +#include + #include "glxserver.h" #include #include diff --git a/nx-X11/programs/Xserver/GL/glx/single2.c b/nx-X11/programs/Xserver/GL/glx/single2.c index d6d689935..d36e57739 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2.c +++ b/nx-X11/programs/Xserver/GL/glx/single2.c @@ -37,6 +37,10 @@ #include #endif +#include +#include +#include + #include "glxserver.h" #include "glxutil.h" #include "glxext.h" diff --git a/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h b/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h index c4e9c01e9..f48ecb8bb 100644 --- a/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h +++ b/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h @@ -55,9 +55,6 @@ #ifdef XFree86Server -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#endif #ifndef assert #define assert(a) #endif @@ -111,4 +108,3 @@ #define __glXAtoi(a) atoi(a) #endif /* _glx_ansic_h_ */ - diff --git a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h index 8a4472874..9e69fac65 100644 --- a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h +++ b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h @@ -36,7 +36,3 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif #include "miscstruct.h" - -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#endif diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c index 976818f07..d0d8eb239 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c @@ -35,6 +35,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #endif +#include + #include #include "pixmapstr.h" #include "xf86glx_util.h" diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 0cb71de42..3e4fd8a95 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -53,11 +53,7 @@ in this Software without prior written authorization from the X Consortium. #endif -#ifdef IN_MODULE -#include -#else #include -#endif #include "protocol-versions.h" diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index 50a6db119..de597dead 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -28,6 +28,8 @@ in this Software without prior written authorization from The Open Group. #include #endif +#include + #include #include #include "misc.h" @@ -43,9 +45,6 @@ in this Software without prior written authorization from The Open Group. #include "protocol-versions.h" #include "regionstr.h" #include "gcstruct.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif typedef RegionPtr (*CreateDftPtr)( WindowPtr /* pWin */ diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index f27d70ffe..c70f52b6a 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -58,9 +58,7 @@ in this Software without prior written authorization from The Open Group. #define _XSHM_SERVER_ #include #include -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif + #include "protocol-versions.h" #ifdef PANORAMIX diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 0421cd9f9..4f24d5b54 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -54,6 +54,8 @@ PERFORMANCE OF THIS SOFTWARE. #include #endif +#include + #include #include #include @@ -68,14 +70,10 @@ PERFORMANCE OF THIS SOFTWARE. #include #include "protocol-versions.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#else #include #if !defined(WIN32) && !defined(Lynx) #include #endif -#endif /* * Local Global Variables diff --git a/nx-X11/programs/Xserver/Xext/xtest.c b/nx-X11/programs/Xserver/Xext/xtest.c index c410a4955..d78efd39b 100644 --- a/nx-X11/programs/Xserver/Xext/xtest.c +++ b/nx-X11/programs/Xserver/Xext/xtest.c @@ -50,9 +50,6 @@ from The Open Group. #define EXTENSION_EVENT_BASE 64 #include "extinit.h" /* LookupDeviceIntRec */ #endif /* XINPUT */ -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif #if 0 static unsigned char XTestReqCode; diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c index 88536b70e..34f4537f2 100644 --- a/nx-X11/programs/Xserver/Xext/xvdisp.c +++ b/nx-X11/programs/Xserver/Xext/xvdisp.c @@ -50,6 +50,8 @@ SOFTWARE. #include #endif +#include + #include #include #include "misc.h" @@ -69,10 +71,6 @@ SOFTWARE. #include #endif -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - #include "xvdisp.h" #ifdef PANORAMIX diff --git a/nx-X11/programs/Xserver/Xext/xvmain.c b/nx-X11/programs/Xserver/Xext/xvmain.c index b233299af..3eea84c76 100644 --- a/nx-X11/programs/Xserver/Xext/xvmain.c +++ b/nx-X11/programs/Xserver/Xext/xvmain.c @@ -77,6 +77,8 @@ SOFTWARE. #include #endif +#include + #include #include #include "misc.h" @@ -97,10 +99,6 @@ SOFTWARE. #include #include "xvdix.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c index 0d4849b85..710101d07 100644 --- a/nx-X11/programs/Xserver/Xext/xvmc.c +++ b/nx-X11/programs/Xserver/Xext/xvmc.c @@ -3,6 +3,8 @@ #include #endif +#include + #include #include #include "misc.h" diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 58301e158..d0487ba63 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -37,6 +37,8 @@ #include #endif +#include + #include #include #include "scrnintstr.h" @@ -47,10 +49,6 @@ #include "dbestruct.h" #include "midbe.h" -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#endif - #if !defined(UINT32_MAX) #define UINT32_MAX 0xffffffffU #endif diff --git a/nx-X11/programs/Xserver/dbe/midbe.c b/nx-X11/programs/Xserver/dbe/midbe.c index 867a11243..bc8dd242e 100644 --- a/nx-X11/programs/Xserver/dbe/midbe.c +++ b/nx-X11/programs/Xserver/dbe/midbe.c @@ -54,11 +54,7 @@ #include "gcstruct.h" #include "inputstr.h" -#ifndef IN_MODULE #include -#else -#include "xf86_ansic.h" -#endif /* DEFINES */ diff --git a/nx-X11/programs/Xserver/fb/fb24_32.c b/nx-X11/programs/Xserver/fb/fb24_32.c index 5dc34d7f5..13af3acb2 100644 --- a/nx-X11/programs/Xserver/fb/fb24_32.c +++ b/nx-X11/programs/Xserver/fb/fb24_32.c @@ -27,11 +27,7 @@ #include #endif -#ifdef XFree86LOADER -#include "xf86.h" -#include "xf86_ansic.h" -#endif - +#include #include "fb.h" /* X apps don't like 24bpp images, this code exposes 32bpp images */ diff --git a/nx-X11/programs/Xserver/fb/fbarc.c b/nx-X11/programs/Xserver/fb/fbarc.c index 0193d2b31..ae89e44d8 100644 --- a/nx-X11/programs/Xserver/fb/fbarc.c +++ b/nx-X11/programs/Xserver/fb/fbarc.c @@ -28,9 +28,7 @@ #include "fb.h" #include "mizerarc.h" -#ifdef IN_MODULE -#include "xf86_ansic.h" -#endif +#include typedef void (*FbArc) (FbBits *dst, FbStride dstStride, @@ -99,7 +97,7 @@ fbPolyArc (DrawablePtr pDrawable, box.x2 = x2; y2 = box.y1 + (int)parcs->height + 1; box.y2 = y2; - if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) && + if ( (x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) && (RegionContainsRect(cclip, &box) == rgnIN) ) (*arc) (dst, dstStride, dstBpp, parcs, pDrawable->x + dstXoff, pDrawable->y + dstYoff, diff --git a/nx-X11/programs/Xserver/fb/fbcompose.c b/nx-X11/programs/Xserver/fb/fbcompose.c index 07ae9490f..b0b256e47 100644 --- a/nx-X11/programs/Xserver/fb/fbcompose.c +++ b/nx-X11/programs/Xserver/fb/fbcompose.c @@ -33,10 +33,14 @@ #ifdef RENDER +#include +#include +#include +#include + #include "picturestr.h" #include "mipict.h" #include "fbpict.h" -#include #define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b)) diff --git a/nx-X11/programs/Xserver/fb/fbcopy.c b/nx-X11/programs/Xserver/fb/fbcopy.c index 39c75afc5..a0a67950b 100644 --- a/nx-X11/programs/Xserver/fb/fbcopy.c +++ b/nx-X11/programs/Xserver/fb/fbcopy.c @@ -26,10 +26,9 @@ #include #endif +#include + #include "fb.h" -#ifdef IN_MODULE -#include "xf86_ansic.h" -#endif void fbCopyNtoN (DrawablePtr pSrcDrawable, diff --git a/nx-X11/programs/Xserver/fb/fbgc.c b/nx-X11/programs/Xserver/fb/fbgc.c index fd7636937..437bc5df3 100644 --- a/nx-X11/programs/Xserver/fb/fbgc.c +++ b/nx-X11/programs/Xserver/fb/fbgc.c @@ -26,10 +26,9 @@ #include #endif +#include + #include "fb.h" -#ifdef IN_MODULE -#include "xf86_ansic.h" -#endif const GCFuncs fbGCFuncs = { fbValidateGC, diff --git a/nx-X11/programs/Xserver/fb/fbimage.c b/nx-X11/programs/Xserver/fb/fbimage.c index c3b0fe3fb..9894faf02 100644 --- a/nx-X11/programs/Xserver/fb/fbimage.c +++ b/nx-X11/programs/Xserver/fb/fbimage.c @@ -26,12 +26,9 @@ #include #endif -#include "fb.h" -#ifdef XFree86LOADER -#include "xf86.h" -#include "xf86_ansic.h" -#endif +#include +#include "fb.h" void fbPutImage (DrawablePtr pDrawable, diff --git a/nx-X11/programs/Xserver/fb/fboverlay.c b/nx-X11/programs/Xserver/fb/fboverlay.c index ac0875016..71a7f30d2 100644 --- a/nx-X11/programs/Xserver/fb/fboverlay.c +++ b/nx-X11/programs/Xserver/fb/fboverlay.c @@ -23,11 +23,12 @@ * Author: Keith Packard, SuSE, Inc. */ - #ifdef HAVE_DIX_CONFIG_H #include #endif +#include + #include "fb.h" #include "fboverlay.h" diff --git a/nx-X11/programs/Xserver/fb/fbpict.c b/nx-X11/programs/Xserver/fb/fbpict.c index 32b395808..c513b3621 100644 --- a/nx-X11/programs/Xserver/fb/fbpict.c +++ b/nx-X11/programs/Xserver/fb/fbpict.c @@ -27,6 +27,8 @@ #include #endif +#include + #include "fb.h" #ifdef RENDER diff --git a/nx-X11/programs/Xserver/fb/fbpixmap.c b/nx-X11/programs/Xserver/fb/fbpixmap.c index 599f3b44e..a2b98bc3c 100644 --- a/nx-X11/programs/Xserver/fb/fbpixmap.c +++ b/nx-X11/programs/Xserver/fb/fbpixmap.c @@ -26,10 +26,9 @@ #include #endif +#include + #include "fb.h" -#ifdef IN_MODULE -#include "xf86_ansic.h" -#endif PixmapPtr fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp) diff --git a/nx-X11/programs/Xserver/fb/fbseg.c b/nx-X11/programs/Xserver/fb/fbseg.c index 8c50829c5..db3240e1b 100644 --- a/nx-X11/programs/Xserver/fb/fbseg.c +++ b/nx-X11/programs/Xserver/fb/fbseg.c @@ -26,6 +26,8 @@ #include #endif +#include + #include "fb.h" #include "miline.h" diff --git a/nx-X11/programs/Xserver/fb/fbwindow.c b/nx-X11/programs/Xserver/fb/fbwindow.c index aca49e5b1..c4e28de5b 100644 --- a/nx-X11/programs/Xserver/fb/fbwindow.c +++ b/nx-X11/programs/Xserver/fb/fbwindow.c @@ -26,10 +26,9 @@ #include #endif +#include + #include "fb.h" -#ifdef IN_MODULE -#include "xf86_ansic.h" -#endif Bool fbCreateWindow(WindowPtr pWin) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index ae0a9cf3a..7dbcce896 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -233,7 +233,7 @@ NX_DEFINES = \ DEFINES = \ -g $(OS_DEFINES) $(EXT_DEFINES) $(NX_DEFINES) \ - -UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UXF86DRI -UXFree86LOADER \ + -UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UXF86DRI \ -DNXAGENT_SERVER \ -DNXAGENT_CONSTRAINCURSOR \ -DNXAGENT_FONTCACHE_SIZE=50 \ diff --git a/nx-X11/programs/Xserver/include/misc.h b/nx-X11/programs/Xserver/include/misc.h index 3255e2201..27137cd50 100644 --- a/nx-X11/programs/Xserver/include/misc.h +++ b/nx-X11/programs/Xserver/include/misc.h @@ -96,11 +96,9 @@ extern unsigned long serverGeneration; #include -#ifndef IN_MODULE #ifndef NULL #include #endif -#endif #ifndef MAXSCREENS #define MAXSCREENS 16 @@ -128,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 /* for bcopy, bzero, and bcmp */ -#endif #define NullBox ((BoxPtr)0) #define MILLI_PER_MIN (1000 * 60) @@ -158,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 -#endif /* IN_MODULE */ #ifndef Fabs #define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */ #endif @@ -179,7 +173,6 @@ typedef struct _xReq *xReqPtr; */ #define lowbit(x) ((x) & (~(x) + 1)) -#ifndef IN_MODULE /* XXX Not for modules */ #include #if !defined(MAXSHORT) || !defined(MINSHORT) || \ @@ -204,8 +197,6 @@ typedef struct _xReq *xReqPtr; #include #include /* for fopen, etc... */ -#endif - /** * Calculate the number of bytes needed to hold bits. * @param bits The minimum number of bits needed. diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 106132b23..268513bfd 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -53,11 +53,7 @@ SOFTWARE. #define ALLOCATE_LOCAL_FALLBACK(_size) malloc((unsigned long)(_size)) #define DEALLOCATE_LOCAL_FALLBACK(_ptr) free((void *)(_ptr)) #include -#ifndef IN_MODULE #include -#else -#include "xf86_ansic.h" -#endif #define NullFID ((FID) 0) @@ -86,12 +82,10 @@ typedef struct _NewClientRec *NewClientPtr; #define xnfstrdup(s) XNFstrdup(s) #endif -#ifndef IN_MODULE #ifdef __SCO__ #include #endif #include -#endif /* have to put $(SIGNAL_DEFINES) in DEFINES in Imakefile to get this right */ #ifdef SIGNALRETURNSINT @@ -519,7 +513,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/mi/Imakefile b/nx-X11/programs/Xserver/mi/Imakefile index fda19aa59..1d50c9156 100644 --- a/nx-X11/programs/Xserver/mi/Imakefile +++ b/nx-X11/programs/Xserver/mi/Imakefile @@ -141,14 +141,12 @@ OBJS = $(CBRT_OBJ) \ * in order to build the XInputExtension, since we * don't use the XF86 module loader. */ - EXT_DEFINES = ExtensionDefines \ - -UXFree86LOADER - + $(NULL) #else - -EXT_DEFINES = ExtensionDefines -UXINPUT \ - -UXFree86LOADER +EXT_DEFINES = ExtensionDefines \ + -UXINPUT \ + $(NULL) #endif #endif diff --git a/nx-X11/programs/Xserver/mi/miinitext.c b/nx-X11/programs/Xserver/mi/miinitext.c index b48ed8a1c..fc64937d7 100644 --- a/nx-X11/programs/Xserver/mi/miinitext.c +++ b/nx-X11/programs/Xserver/mi/miinitext.c @@ -146,12 +146,8 @@ extern Bool noXIdleExtension; extern Bool noXvExtension; #endif -#ifndef XFree86LOADER #define INITARGS void typedef void (*InitExtension)(void); -#else /* XFree86Loader */ -#include "loaderProcs.h" -#endif #ifdef MITSHM #define _XSHM_SERVER_ @@ -380,8 +376,6 @@ void EnableDisableExtensionError(char *name, Bool enable) ErrorF(" %s\n", ext->name); } -#ifndef XFree86LOADER - /*ARGSUSED*/ void InitExtensions(argc, argv) @@ -496,101 +490,3 @@ InitVisualWrap() #endif } -#else /* XFree86LOADER */ -/* List of built-in (statically linked) extensions */ -static ExtensionModule staticExtensions[] = { -#ifdef XTESTEXT1 - { XTestExtension1Init, "XTEST1", &noTestExtensions, NULL, NULL }, -#endif -#ifdef MITSHM - { ShmExtensionInit, SHMNAME, &noMITShmExtension, NULL, NULL }, -#endif -#ifdef XINPUT - { XInputExtensionInit, "XInputExtension", &noXInputExtension, NULL, NULL }, -#endif -#ifdef XTEST - { XTestExtensionInit, XTestExtensionName, &noTestExtensions, NULL, NULL }, -#endif -#ifdef XIDLE - { XIdleExtensionInit, "XIDLE", &noXIdleExtension, NULL, NULL }, -#endif -#ifdef XKB - { XkbExtensionInit, XkbName, &noXkbExtension, NULL, NULL }, -#endif -#ifdef XCSECURITY - { SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL }, -#endif -#ifdef PANORAMIX - { PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension, NULL, NULL }, -#endif -#ifdef XFIXES - /* must be before Render to layer DisplayCursor correctly */ - { XFixesExtensionInit, "XFIXES", &noXFixesExtension, NULL, NULL }, -#endif -#ifdef XF86BIGFONT - { XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension, NULL, NULL }, -#endif -#ifdef RENDER - { RenderExtensionInit, "RENDER", &noRenderExtension, NULL, NULL }, -#endif -#ifdef RANDR - { RRExtensionInit, "RANDR", &noRRExtension, NULL, NULL }, -#endif -#ifdef COMPOSITE - { CompositeExtensionInit, "COMPOSITE", &noCompositeExtension, NULL }, -#endif -#ifdef DAMAGE - { DamageExtensionInit, "DAMAGE", &noDamageExtension, NULL }, -#endif - { NULL, NULL, NULL, NULL, NULL } -}; - -/*ARGSUSED*/ -void -InitExtensions(argc, argv) - int argc; - char *argv[]; -{ - int i; - ExtensionModule *ext; - static Bool listInitialised = FALSE; - - if (!listInitialised) { - /* Add built-in extensions to the list. */ - for (i = 0; staticExtensions[i].name; i++) - LoadExtension(&staticExtensions[i], TRUE); - - /* Sort the extensions according the init dependencies. */ - LoaderSortExtensions(); - listInitialised = TRUE; - } - - for (i = 0; ExtensionModuleList[i].name != NULL; i++) { - ext = &ExtensionModuleList[i]; - if (ext->initFunc != NULL && - (ext->disablePtr == NULL || - (ext->disablePtr != NULL && !*ext->disablePtr))) { - (ext->initFunc)(); - } - } -} - -static void (*__miHookInitVisualsFunction)(miInitVisualsProcPtr *); - -void -InitVisualWrap() -{ - miResetInitVisuals(); - if (__miHookInitVisualsFunction) - (*__miHookInitVisualsFunction)(&miInitVisualsProc); -} - -void miHookInitVisuals(void (**old)(miInitVisualsProcPtr *), - void (*new)(miInitVisualsProcPtr *)) -{ - if (old) - *old = __miHookInitVisualsFunction; - __miHookInitVisualsFunction = new; -} - -#endif /* XFree86LOADER */ diff --git a/nx-X11/programs/Xserver/miext/cw/cw.c b/nx-X11/programs/Xserver/miext/cw/cw.c index 8aca3edf7..774f0d056 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw.c +++ b/nx-X11/programs/Xserver/miext/cw/cw.c @@ -25,6 +25,8 @@ #include #endif +#include + #include "gcstruct.h" #include "windowstr.h" #include "cw.h" diff --git a/nx-X11/programs/Xserver/miext/cw/cw_ops.c b/nx-X11/programs/Xserver/miext/cw/cw_ops.c index e4c53b79f..826a0eeca 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw_ops.c +++ b/nx-X11/programs/Xserver/miext/cw/cw_ops.c @@ -25,6 +25,8 @@ #include #endif +#include + #include "gcstruct.h" #include "cw.h" diff --git a/nx-X11/programs/Xserver/miext/cw/cw_render.c b/nx-X11/programs/Xserver/miext/cw/cw_render.c index ac4230a03..504d7bda3 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw_render.c +++ b/nx-X11/programs/Xserver/miext/cw/cw_render.c @@ -25,6 +25,8 @@ #include #endif +#include + #include "gcstruct.h" #include "windowstr.h" #include "cw.h" diff --git a/nx-X11/programs/Xserver/miext/damage/damage.c b/nx-X11/programs/Xserver/miext/damage/damage.c index 669f08ff5..a56b9877e 100644 --- a/nx-X11/programs/Xserver/miext/damage/damage.c +++ b/nx-X11/programs/Xserver/miext/damage/damage.c @@ -26,6 +26,8 @@ #include #endif +#include + #include #include "scrnintstr.h" #include "windowstr.h" diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index f4b7abae0..5f097f89a 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -92,10 +92,6 @@ int limitNoFile = -1; Bool OsDelayInitColors = FALSE; -#ifdef XFree86LOADER -extern void xf86WrapperInit(void); -#endif - void OsInit(void) { @@ -109,9 +105,6 @@ OsInit(void) #endif if (!been_here) { -#ifdef XFree86LOADER - xf86WrapperInit(); -#endif #if !defined(__SCO__) && !defined(__CYGWIN__) && !defined(__UNIXWARE__) fclose(stdin); fclose(stdout); diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index 33bdf56ec..eb9212f40 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -42,12 +42,8 @@ and Jim Haggerty of Metheus. #include #include "set.h" -#ifndef XFree86LOADER #include #include -#else -#include "xf86_ansic.h" -#endif #ifdef PANORAMIX #include "globals.h" diff --git a/nx-X11/programs/Xserver/record/set.c b/nx-X11/programs/Xserver/record/set.c index 07d911c8c..1ea3fea4a 100644 --- a/nx-X11/programs/Xserver/record/set.c +++ b/nx-X11/programs/Xserver/record/set.c @@ -53,12 +53,13 @@ from The Open Group. #include #endif +#include + #ifndef TESTING #include "misc.h" #else #include #include -#include /* stuff that you normally get from the X Server's environment */ @@ -81,11 +82,6 @@ typedef unsigned short CARD16; #include "set.h" -#ifdef XFree86LOADER -#include "xf86_libc.h" -#include "xf86_ansic.h" -#endif - static int maxMemberInInterval(pIntervals, nIntervals) RecordSetInterval *pIntervals; diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 2eba16a4e..774dcc8ec 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -45,9 +45,6 @@ #include "glyphstr.h" #include #include "cursorstr.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif #include "protocol-versions.h" -- cgit v1.2.3 From cee997dacb28aa9378b834b66a33c441145dceb7 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Mon, 31 Oct 2016 15:06:37 +0100 Subject: Drop glx_ansic.h wrapper and call malloc, realloc, free and str-funcs directly. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 2d2d38d17cc2558f8a41166a4a1578bc4c663c37 Author: Kristian Høgsberg Date: Fri Mar 17 01:47:25 2006 +0000 Check for glproto when building GLX and make sure we have at least 1.4.6. Drop glx_ansic.h wrapper and call xalloc, xrealloc, xfree and str-funcs directly. We don't check the glproto version as we know what it is (we have our own proto file). Furthermore, we skip the switch from --glX -> x and directly switch to (e.g. __glXMalloc() -> malloc()). Backported-to-NX-by: Mike Gabriel --- .../src/mesa/drivers/dri/common/glcontextmodes.c | 26 ++--- .../Mesa/src/mesa/shader/slang/slang_execute.c | 8 +- .../Mesa/src/mesa/shader/slang/slang_utility.h | 10 +- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 56 ++++++----- nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c | 9 +- nx-X11/programs/Xserver/GL/glx/glxext.c | 27 ++--- nx-X11/programs/Xserver/GL/glx/glxfb.c | 4 +- nx-X11/programs/Xserver/GL/glx/glximports.c | 17 ++-- nx-X11/programs/Xserver/GL/glx/glxpix.c | 4 +- nx-X11/programs/Xserver/GL/glx/glxscreens.c | 22 ++--- nx-X11/programs/Xserver/GL/glx/glxserver.h | 1 - nx-X11/programs/Xserver/GL/glx/glxutil.c | 98 +++--------------- nx-X11/programs/Xserver/GL/glx/glxutil.h | 6 -- nx-X11/programs/Xserver/GL/glx/single2.c | 53 +++++----- nx-X11/programs/Xserver/GL/glx/single2swap.c | 5 +- nx-X11/programs/Xserver/GL/glx/xfont.c | 4 +- nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h | 110 --------------------- nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c | 68 ++++++------- nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 8 +- 19 files changed, 167 insertions(+), 369 deletions(-) delete mode 100644 nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c index bb1c82794..7d4d06ab8 100644 --- a/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c +++ b/nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c @@ -31,31 +31,17 @@ * \author Ian Romanick */ -#if defined(IN_MINI_GLX) # include # include + +#if defined(IN_MINI_GLX) # include # include "GL/internal/dri_interface.h" # include "imports.h" -# define __glXMemset memset #else # include # include # include "GL/glxint.h" - -# ifdef XFree86Server -void *memset( void * ptr, int val, size_t size); -# include "GL/glx_ansic.h" -extern void * __glXMalloc( size_t size ); -extern void __glXFree( void * ptr ); -# define _mesa_malloc(b) __glXMalloc(b) -# define _mesa_free(m) __glXFree(m) -# else -# include -# define __glXMemset memset -# define _mesa_malloc(b) Xmalloc(b) -# define _mesa_free(m) Xfree(m) -# endif /* XFree86Server */ #endif /* !defined(IN_MINI_GLX) */ #include "glcontextmodes.h" @@ -127,7 +113,7 @@ _gl_copy_visual_to_context_mode( __GLcontextModes * mode, { __GLcontextModes * const next = mode->next; - (void) __glXMemset( mode, 0, sizeof( __GLcontextModes ) ); + (void) memset( mode, 0, sizeof( __GLcontextModes ) ); mode->next = next; mode->visualID = config->vid; @@ -361,14 +347,14 @@ _gl_context_modes_create( unsigned count, size_t minimum_size ) next = & base; for ( i = 0 ; i < count ; i++ ) { - *next = (__GLcontextModes *) _mesa_malloc( size ); + *next = (__GLcontextModes *) malloc( size ); if ( *next == NULL ) { _gl_context_modes_destroy( base ); base = NULL; break; } - (void) __glXMemset( *next, 0, size ); + (void) memset( *next, 0, size ); (*next)->visualID = GLX_DONT_CARE; (*next)->visualType = GLX_DONT_CARE; (*next)->visualRating = GLX_NONE; @@ -402,7 +388,7 @@ _gl_context_modes_destroy( __GLcontextModes * modes ) while ( modes != NULL ) { __GLcontextModes * const next = modes->next; - _mesa_free( modes ); + free( modes ); modes = next; } } diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_execute.c b/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_execute.c index d47f3eaca..6c5cf3daf 100644 --- a/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_execute.c +++ b/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_execute.c @@ -195,10 +195,10 @@ int _slang_execute (const slang_assembly_file *file) /* XXX why???, disabling the pointer size assertions here. * See bug 4021. */ - static_assert(sizeof (GLfloat) == 4); - /*static_assert(sizeof (GLfloat *) == 4);*/ - static_assert(sizeof (GLuint) == 4); - /*static_assert(sizeof (GLuint *) == 4);*/ + _static_assert(sizeof (GLfloat) == 4); + /*_static_assert(sizeof (GLfloat *) == 4);*/ + _static_assert(sizeof (GLuint) == 4); + /*_static_assert(sizeof (GLuint *) == 4);*/ dump (file); diff --git a/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_utility.h b/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_utility.h index 2b040a444..6f2f5d345 100644 --- a/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_utility.h +++ b/nx-X11/extras/Mesa/src/mesa/shader/slang/slang_utility.h @@ -29,11 +29,11 @@ extern "C" { #endif -/* Compile-time assertions. If the expression is zero, try to declare an - * array of size [-1] to cause compilation error. - */ -#define static_assert(expr) do { int _array[(expr) ? 1 : -1]; _array[0]; } while (0) - +/* Compile-time assertions. If the expression is zero, try to declare an + * array of size [-1] to cause compilation error. + */ +#define _static_assert(expr) do { int _array[(expr) ? 1 : -1]; _array[0]; } while (0) + void slang_alloc_free (void *); void *slang_alloc_malloc (unsigned int); void *slang_alloc_realloc (void *, unsigned int, unsigned int); diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index dd5e40ffe..d082e84bf 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -39,6 +39,7 @@ #endif #include +#include #include "glxserver.h" #include @@ -50,7 +51,6 @@ #include "glximports.h" #include "glxutil.h" #include "glxext.h" -#include "GL/glx_ansic.h" #include "glcontextmodes.h" /************************************************************************/ @@ -193,11 +193,11 @@ int DoCreateContext(__GLXclientState *cl, GLXContextID gcId, /* ** Allocate memory for the new context */ - glxc = (__GLXcontext *) __glXMalloc(sizeof(__GLXcontext)); + glxc = (__GLXcontext *) malloc(sizeof(__GLXcontext)); if (!glxc) { return BadAlloc; } - __glXMemset(glxc, 0, sizeof(__GLXcontext)); + memset(glxc, 0, sizeof(__GLXcontext)); /* ** Initially, setup the part of the context that could be used by @@ -216,7 +216,7 @@ int DoCreateContext(__GLXclientState *cl, GLXContextID gcId, imports.other = (void *)glxc; glxc->gc = (*pGlxScreen->createContext)(&imports, glxc->modes, shareGC); if (!glxc->gc) { - __glXFree(glxc); + free(glxc); client->errorValue = gcId; return BadAlloc; } @@ -233,7 +233,7 @@ int DoCreateContext(__GLXclientState *cl, GLXContextID gcId, if (!isDirect) { (*glxc->gc->exports.destroyContext)((__GLcontext *)glxc->gc); } - __glXFree(glxc); + free(glxc); client->errorValue = gcId; return BadAlloc; } @@ -335,9 +335,9 @@ static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc) ** Didn't find a free slot, so we'll have to grow the table. */ if (!num) { - table = (__GLXcontext **) __glXMalloc(sizeof(__GLXcontext *)); + table = (__GLXcontext **) malloc(sizeof(__GLXcontext *)); } else { - table = (__GLXcontext **) __glXRealloc(table, + table = (__GLXcontext **) realloc(table, (num+1)*sizeof(__GLXcontext *)); } table[num] = glxc; @@ -685,7 +685,7 @@ int DoMakeCurrent( __GLXclientState *cl, ** refcount of the X pixmap and free only if it's zero. */ (*prevglxc->readPixmap->pScreen->DestroyPixmap)(pPixmap); - __glXFree(prevglxc->readPixmap); + free(prevglxc->readPixmap); } } @@ -701,7 +701,7 @@ int DoMakeCurrent( __GLXclientState *cl, ** refcount of the X pixmap and free only if it's zero. */ (*prevglxc->drawPixmap->pScreen->DestroyPixmap)(pPixmap); - __glXFree(prevglxc->drawPixmap); + free(prevglxc->drawPixmap); } prevglxc->drawPixmap = NULL; @@ -1192,7 +1192,7 @@ int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual, return BadValue; } - pGlxPixmap = (__GLXpixmap *) __glXMalloc(sizeof(__GLXpixmap)); + pGlxPixmap = (__GLXpixmap *) malloc(sizeof(__GLXpixmap)); if (!pGlxPixmap) { return BadAlloc; } @@ -1382,7 +1382,7 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) reply.n = nProps; nReplyBytes = reply.length << 2; - sendBuf = (int *)__glXMalloc((size_t)nReplyBytes); + sendBuf = (int *)malloc((size_t)nReplyBytes); if (sendBuf == NULL) { return __glXBadContext; /* XXX: Is this correct? */ } @@ -1400,7 +1400,7 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply); WriteToClient(client, nReplyBytes, sendBuf); } - __glXFree((char *)sendBuf); + free((char *)sendBuf); return Success; } @@ -1626,17 +1626,17 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) */ if (cl->largeCmdBufSize < cmdlen) { if (!cl->largeCmdBuf) { - cl->largeCmdBuf = (GLbyte *) __glXMalloc((size_t)cmdlen); + cl->largeCmdBuf = (GLbyte *) malloc((size_t)cmdlen); } else { - cl->largeCmdBuf = (GLbyte *) __glXRealloc(cl->largeCmdBuf, - (size_t)cmdlen); + cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, + (size_t)cmdlen); } if (!cl->largeCmdBuf) { return BadAlloc; } cl->largeCmdBufSize = cmdlen; } - __glXMemcpy(cl->largeCmdBuf, pc, dataBytes); + memcpy(cl->largeCmdBuf, pc, dataBytes); cl->largeCmdBytesSoFar = dataBytes; cl->largeCmdBytesTotal = cmdlen; @@ -1679,7 +1679,7 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc) __glXResetLargeCommandStatus(cl); return __glXBadLargeRequest; } - __glXMemcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes); + memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes); cl->largeCmdBytesSoFar += dataBytes; cl->largeCmdRequestsSoFar++; @@ -2074,17 +2074,18 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc) ptr = __glXActiveScreens[screen].GLXextensions; - n = __glXStrlen(ptr) + 1; + n = strlen(ptr) + 1; length = __GLX_PAD(n) >> 2; reply.type = X_Reply; reply.sequenceNumber = client->sequence; reply.length = length; reply.n = n; - if ((buf = (char *) __glXMalloc(length << 2)) == NULL) { + /* Allocate buffer to make sure it's a multiple of 4 bytes big.*/ + buf = (char *) malloc(length << 2); + if (buf == NULL) return BadAlloc; - } - __glXStrncpy(buf, ptr, n); + memcpy(buf, ptr, n); if (client->swapped) { glxSwapQueryExtensionsStringReply(client, &reply, buf); @@ -2093,7 +2094,7 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc) WriteToClient(client, (int)(length << 2), buf); } - __glXFree(buf); + free(buf); return Success; } @@ -2131,7 +2132,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc) return BadValue; } - n = __glXStrlen(ptr) + 1; + n = strlen(ptr) + 1; length = __GLX_PAD(n) >> 2; reply.type = X_Reply; reply.sequenceNumber = client->sequence; @@ -2141,7 +2142,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc) if ((buf = (char *) malloc(length << 2)) == NULL) { return BadAlloc; } - __glXStrncpy(buf, ptr, n); + memcpy(buf, ptr, n); if (client->swapped) { glxSwapQueryServerStringReply(client, &reply, buf); @@ -2150,7 +2151,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc) WriteToClient(client, (int)(length << 2), buf); } - __glXFree(buf); + free(buf); return Success; } @@ -2161,9 +2162,10 @@ int __glXClientInfo(__GLXclientState *cl, GLbyte *pc) cl->GLClientmajorVersion = req->major; cl->GLClientminorVersion = req->minor; - if (cl->GLClientextensions) __glXFree(cl->GLClientextensions); + if (cl->GLClientextensions) + free(cl->GLClientextensions); buf = (const char *)(req+1); - cl->GLClientextensions = __glXStrdup(buf); + cl->GLClientextensions = xstrdup(buf); return Success; } diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c index 092a14e66..98acfe5af 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c @@ -47,7 +47,6 @@ #include #include #include "glxext.h" -#include "GL/glx_ansic.h" static int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc); static int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc); @@ -683,16 +682,16 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) */ if (cl->largeCmdBufSize < cmdlen) { if (!cl->largeCmdBuf) { - cl->largeCmdBuf = (GLbyte *) __glXMalloc(cmdlen); + cl->largeCmdBuf = (GLbyte *) malloc(cmdlen); } else { - cl->largeCmdBuf = (GLbyte *) __glXRealloc(cl->largeCmdBuf, cmdlen); + cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen); } if (!cl->largeCmdBuf) { return BadAlloc; } cl->largeCmdBufSize = cmdlen; } - __glXMemcpy(cl->largeCmdBuf, pc, dataBytes); + memcpy(cl->largeCmdBuf, pc, dataBytes); cl->largeCmdBytesSoFar = dataBytes; cl->largeCmdBytesTotal = cmdlen; @@ -735,7 +734,7 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc) __glXResetLargeCommandStatus(cl); return __glXBadLargeRequest; } - __glXMemcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes); + memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes); cl->largeCmdBytesSoFar += dataBytes; cl->largeCmdRequestsSoFar++; diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.c b/nx-X11/programs/Xserver/GL/glx/glxext.c index f908c08cf..f6d572d2a 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxext.c +++ b/nx-X11/programs/Xserver/GL/glx/glxext.c @@ -62,17 +62,18 @@ static void ResetClientState(int clientIndex) { __GLXclientState *cl = __glXClients[clientIndex]; - if (cl->returnBuf) __glXFree(cl->returnBuf); - if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf); - if (cl->currentContexts) __glXFree(cl->currentContexts); - __glXMemset(cl, 0, sizeof(__GLXclientState)); + if (cl->returnBuf) free(cl->returnBuf); + if (cl->largeCmdBuf) free(cl->largeCmdBuf); + if (cl->currentContexts) free(cl->currentContexts); + memset(cl, 0, sizeof(__GLXclientState)); /* ** By default, assume that the client supports ** GLX major version 1 minor version 0 protocol. */ cl->GLClientmajorVersion = 1; cl->GLClientminorVersion = 0; - if (cl->GLClientextensions) __glXFree(cl->GLClientextensions); + if (cl->GLClientextensions) + free(cl->GLClientextensions); } @@ -151,7 +152,7 @@ static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id) ** only if it's zero. */ (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap); - __glXFree(pGlxPixmap); + free(pGlxPixmap); } return True; @@ -169,9 +170,9 @@ GLboolean __glXFreeContext(__GLXcontext *cx) return GL_FALSE; } } - if (cx->feedbackBuf) __glXFree(cx->feedbackBuf); - if (cx->selectBuf) __glXFree(cx->selectBuf); - __glXFree(cx); + if (cx->feedbackBuf) free(cx->feedbackBuf); + if (cx->selectBuf) free(cx->selectBuf); + free(cx); if (cx == __glXLastContext) { __glXFlushContextCache(); } @@ -404,12 +405,12 @@ static int __glXDispatch(ClientPtr client) opcode = stuff->glxCode; cl = __glXClients[client->index]; if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); + cl = (__GLXclientState *) malloc(sizeof(__GLXclientState)); __glXClients[client->index] = cl; if (!cl) { return BadAlloc; } - __glXMemset(cl, 0, sizeof(__GLXclientState)); + memset(cl, 0, sizeof(__GLXclientState)); } if (!cl->inUse) { @@ -458,12 +459,12 @@ static int __glXSwapDispatch(ClientPtr client) opcode = stuff->glxCode; cl = __glXClients[client->index]; if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); + cl = (__GLXclientState *) malloc(sizeof(__GLXclientState)); __glXClients[client->index] = cl; if (!cl) { return BadAlloc; } - __glXMemset(cl, 0, sizeof(__GLXclientState)); + memset(cl, 0, sizeof(__GLXclientState)); } if (!cl->inUse) { diff --git a/nx-X11/programs/Xserver/GL/glx/glxfb.c b/nx-X11/programs/Xserver/GL/glx/glxfb.c index 9573d97b9..955c1dd79 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxfb.c +++ b/nx-X11/programs/Xserver/GL/glx/glxfb.c @@ -130,7 +130,7 @@ Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv) FreeScratchGC(bufferInfo->pGC); } - __glXFree(bufferInfo); + free(bufferInfo); buf->other = NULL; } @@ -173,7 +173,7 @@ __glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits) buf->free = Free; /* allocate local information */ - bufferInfo = (__GLFBbufferInfo *) __glXMalloc(sizeof(__GLFBbufferInfo)); + bufferInfo = (__GLFBbufferInfo *) malloc(sizeof(__GLFBbufferInfo)); buf->other = (void *) bufferInfo; pGC = CreateScratchGC(glxPriv->pDraw->pScreen, diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.c b/nx-X11/programs/Xserver/GL/glx/glximports.c index a5a5e37ae..fb4d508a9 100644 --- a/nx-X11/programs/Xserver/GL/glx/glximports.c +++ b/nx-X11/programs/Xserver/GL/glx/glximports.c @@ -44,7 +44,6 @@ #include "glxserver.h" #include "glxcontext.h" #include "glximports.h" -#include "GL/glx_ansic.h" void *__glXImpMalloc(__GLcontext *gc, size_t size) { @@ -76,7 +75,7 @@ void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize) return NULL; } /* zero out memory */ - __glXMemset(addr, 0, size); + memset(addr, 0, size); return addr; } @@ -119,17 +118,17 @@ void __glXImpWarning(__GLcontext *gc, char *msg) void __glXImpFatal(__GLcontext *gc, char *msg) { ErrorF("%s",(char *)msg); - __glXAbort(); + abort(); } char *__glXImpGetenv(__GLcontext *gc, const char *var) { - return __glXGetenv(var); + return getenv(var); } int __glXImpAtoi(__GLcontext *gc, const char *str) { - return __glXAtoi(str); + return atoi(str); } int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...) @@ -139,7 +138,7 @@ int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...) /* have to deal with var args */ va_start(ap, fmt); - ret = __glXVsprintf(str, fmt, ap); + ret = vsprintf(str, fmt, ap); va_end(ap); return ret; @@ -147,12 +146,12 @@ int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...) void *__glXImpFopen(__GLcontext *gc, const char *path, const char *mode) { - return (void *) __glXFopen(path, mode); + return (void *) fopen(path, mode); } int __glXImpFclose(__GLcontext *gc, void *stream) { - return __glXFclose((FILE *)stream); + return fclose((FILE *)stream); } int __glXImpFprintf(__GLcontext *gc, void *stream, const char *fmt, ...) @@ -162,7 +161,7 @@ int __glXImpFprintf(__GLcontext *gc, void *stream, const char *fmt, ...) /* have to deal with var args */ va_start(ap, fmt); - ret = __glXVfprintf((FILE *)stream, fmt, ap); + ret = vfprintf((FILE *)stream, fmt, ap); va_end(ap); return ret; diff --git a/nx-X11/programs/Xserver/GL/glx/glxpix.c b/nx-X11/programs/Xserver/GL/glx/glxpix.c index e1628efc0..81e29a9c5 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxpix.c +++ b/nx-X11/programs/Xserver/GL/glx/glxpix.c @@ -95,7 +95,7 @@ Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv) FreeScratchGC(bufferInfo->pGC); } - __glXFree(bufferInfo); + free(bufferInfo); buf->other = NULL; } @@ -123,7 +123,7 @@ __glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, buf->free = Free; /* allocate local information */ - bufferInfo = (__GLPixBufferInfo *) __glXMalloc(sizeof(__GLPixBufferInfo)); + bufferInfo = (__GLPixBufferInfo *) malloc(sizeof(__GLPixBufferInfo)); buf->other = (void *) bufferInfo; bufferInfo->pGC = CreateScratchGC(pGlxPixmap->pDraw->pScreen, diff --git a/nx-X11/programs/Xserver/GL/glx/glxscreens.c b/nx-X11/programs/Xserver/GL/glx/glxscreens.c index 6b274a64b..1bff4bc3a 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxscreens.c +++ b/nx-X11/programs/Xserver/GL/glx/glxscreens.c @@ -288,7 +288,7 @@ static void wrapPositionWindow(int screen) void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs) { if (__glXNumHyperpipeFuncs < screen + 1) { - __glXHyperpipeFuncs = __glXRealloc(__glXHyperpipeFuncs, + __glXHyperpipeFuncs = realloc(__glXHyperpipeFuncs, (screen+1) * sizeof(__GLXHyperpipeExtensionFuncs)); __glXNumHyperpipeFuncs = screen + 1; } @@ -306,7 +306,7 @@ void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs) void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs) { if (__glXNumSwapBarrierFuncs < screen + 1) { - __glXSwapBarrierFuncs = __glXRealloc(__glXSwapBarrierFuncs, + __glXSwapBarrierFuncs = realloc(__glXSwapBarrierFuncs, (screen+1) * sizeof(__GLXSwapBarrierExtensionFuncs)); __glXNumSwapBarrierFuncs = screen + 1; } @@ -327,7 +327,7 @@ void __glXScreenInit(GLint numscreens) ** This alloc has to work or else the server might as well core dump. */ __glXActiveScreens = - (__GLXscreenInfo *) __glXMalloc(sizeof(__GLXscreenInfo) * numscreens); + (__GLXscreenInfo *) malloc(sizeof(__GLXscreenInfo) * numscreens); for (i=0; i < numscreens; i++) { /* @@ -338,10 +338,10 @@ void __glXScreenInit(GLint numscreens) __glXActiveScreens[i] = *__glXScreens[j]; __glXActiveScreens[i].numUsableVisuals = __glXActiveScreens[i].numVisuals; - __glXActiveScreens[i].GLextensions = __glXStrdup(GLServerExtensions); - __glXActiveScreens[i].GLXvendor = __glXStrdup(GLXServerVendorName); - __glXActiveScreens[i].GLXversion = __glXStrdup(GLXServerVersion); - __glXActiveScreens[i].GLXextensions = __glXStrdup(GLXServerExtensions); + __glXActiveScreens[i].GLextensions = strdup(GLServerExtensions); + __glXActiveScreens[i].GLXvendor = strdup(GLXServerVendorName); + __glXActiveScreens[i].GLXversion = strdup(GLXServerVersion); + __glXActiveScreens[i].GLXextensions = strdup(GLXServerExtensions); __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone); wrapPositionWindow(i); @@ -356,10 +356,10 @@ void __glXScreenReset(void) int i; for (i = 0; i < __glXNumActiveScreens; i++) { - __glXFree(__glXActiveScreens[i].GLXvendor); - __glXFree(__glXActiveScreens[i].GLXversion); - __glXFree(__glXActiveScreens[i].GLXextensions); - __glXFree(__glXActiveScreens[i].GLextensions); + free(__glXActiveScreens[i].GLXvendor); + free(__glXActiveScreens[i].GLXversion); + free(__glXActiveScreens[i].GLXextensions); + free(__glXActiveScreens[i].GLextensions); } free(__glXActiveScreens); free(__glXHyperpipeFuncs); diff --git a/nx-X11/programs/Xserver/GL/glx/glxserver.h b/nx-X11/programs/Xserver/GL/glx/glxserver.h index a991f907e..2debc8435 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxserver.h +++ b/nx-X11/programs/Xserver/GL/glx/glxserver.h @@ -50,7 +50,6 @@ #include #include #include -#include "GL/glx_ansic.h" #include "protocol-versions.h" #include diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c index 5d40bc832..b4cd10a84 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxutil.c +++ b/nx-X11/programs/Xserver/GL/glx/glxutil.c @@ -47,7 +47,6 @@ #include #include "glxutil.h" #include "glxbuf.h" -#include "GL/glx_ansic.h" #include "GL/internal/glcore.h" #include "GL/glxint.h" #include "glcontextmodes.h" @@ -58,81 +57,8 @@ void __glXNop(void) {} /************************************************************************/ -/* Memory Allocation for GLX */ - -void * -__glXMalloc(size_t size) -{ - void *addr; - - if (size == 0) { - return NULL; - } - addr = (void *) malloc(size); - if (addr == NULL) { - /* XXX: handle out of memory error */ - return NULL; - } - return addr; -} - -void * -__glXCalloc(size_t numElements, size_t elementSize) -{ - void *addr; - size_t size; - - if ((numElements == 0) || (elementSize == 0)) { - return NULL; - } - size = numElements * elementSize; - addr = (void *) malloc(size); - if (addr == NULL) { - /* XXX: handle out of memory error */ - return NULL; - } - __glXMemset(addr, 0, size); - return addr; -} - -void * -__glXRealloc(void *addr, size_t newSize) -{ - void *newAddr; - - if (addr) { - if (newSize == 0) { - free(addr); - return NULL; - } else { - newAddr = realloc(addr, newSize); - } - } else { - if (newSize == 0) { - return NULL; - } else { - newAddr = malloc(newSize); - } - } - if (newAddr == NULL) { - return NULL; /* XXX: out of memory */ - } - - return newAddr; -} - -void -__glXFree(void *addr) -{ - if (addr) { - free(addr); - } -} - -/************************************************************************/ /* Context stuff */ - /* ** associate a context with a drawable */ @@ -299,8 +225,8 @@ __glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId, __GLdrawablePrivate *glPriv; __GLXscreenInfo *pGlxScreen; - glxPriv = (__GLXdrawablePrivate *) __glXMalloc(sizeof(*glxPriv)); - __glXMemset(glxPriv, 0, sizeof(__GLXdrawablePrivate)); + glxPriv = (__GLXdrawablePrivate *) malloc(sizeof(*glxPriv)); + memset(glxPriv, 0, sizeof(__GLXdrawablePrivate)); glxPriv->type = pDraw->type; glxPriv->pDraw = pDraw; @@ -312,18 +238,18 @@ __glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId, /* since we are creating the drawablePrivate, drawId should be new */ if (!AddResource(drawId, __glXDrawableRes, glxPriv)) { /* oops! */ - __glXFree(glxPriv); + free(glxPriv); return NULL; } /* fill up glPriv */ glPriv = &glxPriv->glPriv; - glPriv->modes = (__GLcontextModes *) __glXMalloc(sizeof(__GLcontextModes)); + glPriv->modes = (__GLcontextModes *) malloc(sizeof(__GLcontextModes)); *glPriv->modes = *modes; - glPriv->malloc = __glXMalloc; - glPriv->calloc = __glXCalloc; - glPriv->realloc = __glXRealloc; - glPriv->free = __glXFree; + glPriv->malloc = malloc; + glPriv->calloc = calloc; + glPriv->realloc = realloc; + glPriv->free = free; glPriv->addSwapRect = NULL; glPriv->setClipRect = (void (*)(__GLdrawablePrivate *, GLint, GLint, GLsizei, GLsizei)) __glXNop; glPriv->lockDP = LockDP; @@ -334,7 +260,7 @@ __glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId, /* allocate a one-rect ownership region */ glPriv->ownershipRegion.rects = - (__GLregionRect *)__glXCalloc(1, sizeof(__GLregionRect)); + (__GLregionRect *)calloc(1, sizeof(__GLregionRect)); glPriv->ownershipRegion.numRects = 1; glxPriv->freeBuffers = __glXFreeBuffers; @@ -377,9 +303,9 @@ __glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv) } /* Free the drawable Private */ - __glXFree(glxPriv->glPriv.modes); - __glXFree(glxPriv->glPriv.ownershipRegion.rects); - __glXFree(glxPriv); + free(glxPriv->glPriv.modes); + free(glxPriv->glPriv.ownershipRegion.rects); + free(glxPriv); return GL_TRUE; } diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.h b/nx-X11/programs/Xserver/GL/glx/glxutil.h index 7231c949f..a0a2e57b7 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxutil.h +++ b/nx-X11/programs/Xserver/GL/glx/glxutil.h @@ -42,12 +42,6 @@ extern void __glXNop(void); -/* memory management */ -extern void *__glXMalloc(size_t size); -extern void *__glXCalloc(size_t numElements, size_t elementSize); -extern void *__glXRealloc(void *addr, size_t newSize); -extern void __glXFree(void *ptr); - /* relate contexts with drawables */ extern void __glXAssociateContext(__GLXcontext *glxc); extern void __glXDeassociateContext(__GLXcontext *glxc); diff --git a/nx-X11/programs/Xserver/GL/glx/single2.c b/nx-X11/programs/Xserver/GL/glx/single2.c index d36e57739..47ba628af 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2.c +++ b/nx-X11/programs/Xserver/GL/glx/single2.c @@ -46,7 +46,6 @@ #include "glxext.h" #include "unpack.h" #include "g_disptab.h" -#include "GL/glx_ansic.h" int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) { @@ -67,7 +66,7 @@ int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) size = *(GLsizei *)(pc+0); type = *(GLenum *)(pc+4); if (cx->feedbackBufSize < size) { - cx->feedbackBuf = (GLfloat *) __glXRealloc(cx->feedbackBuf, + cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf, (size_t)size * __GLX_SIZE_FLOAT32); if (!cx->feedbackBuf) { @@ -97,7 +96,7 @@ int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc) pc += __GLX_SINGLE_HDR_SIZE; size = *(GLsizei *)(pc+0); if (cx->selectBufSize < size) { - cx->selectBuf = (GLuint *) __glXRealloc(cx->selectBuf, + cx->selectBuf = (GLuint *) realloc(cx->selectBuf, (size_t) size * __GLX_SIZE_CARD32); if (!cx->selectBuf) { @@ -268,24 +267,30 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string) ** pull tokens out of shortest string ** include space in combo_string for final separator and null terminator */ - if ( (clen = __glXStrlen(cext_string)) > (slen = __glXStrlen(sext_string)) ) { - combo_string = (char *) __glXMalloc(slen + 2); - s1 = (char *) __glXMalloc(slen + 2); __glXStrcpy(s1, sext_string); + clen = strlen(cext_string); + slen = strlen(sext_string); + if (clen > slen) { + combo_string = (char *) malloc(slen + 2); + s1 = (char *) malloc(slen + 2); + strcpy(s1, sext_string); s2 = cext_string; } else { - combo_string = (char *) __glXMalloc(clen + 2); - s1 = (char *) __glXMalloc(clen + 2); __glXStrcpy(s1, cext_string); + combo_string = (char *) malloc(clen + 2); + s1 = (char *) malloc(clen + 2); + strcpy(s1, cext_string); s2 = sext_string; } if (!combo_string || !s1) { - if (combo_string) __glXFree(combo_string); - if (s1) __glXFree(s1); + if (combo_string) + free(combo_string); + if (s1) + free(s1); return NULL; } combo_string[0] = '\0'; /* Get first extension token */ - token = __glXStrtok( s1, SEPARATOR); + token = strtok( s1, SEPARATOR); while ( token != NULL ) { /* @@ -293,20 +298,20 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string) ** beware of extension names which are prefixes of other extension names */ const char *p = s2; - end = p + __glXStrlen(p); + end = p + strlen(p); while (p < end) { - size_t n = __glXStrcspn(p, SEPARATOR); - if ((__glXStrlen(token) == n) && (__glXStrncmp(token, p, n) == 0)) { - combo_string = __glXStrcat( combo_string, token); - combo_string = __glXStrcat( combo_string, SEPARATOR); + size_t n = strcspn(p, SEPARATOR); + if ((strlen(token) == n) && (strncmp(token, p, n) == 0)) { + combo_string = strcat(combo_string, token); + combo_string = strcat(combo_string, SEPARATOR); } p += (n + 1); } /* Get next extension token */ - token = __glXStrtok( NULL, SEPARATOR); + token = strtok( NULL, SEPARATOR); } - __glXFree(s1); + free(s1); return combo_string; } @@ -351,26 +356,24 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) buf = __glXcombine_strings(buf1, cx->pGlxScreen->GLextensions); if (buf1 != NULL) { - __glXFree(buf1); + free(buf1); } string = buf; } else if ( name == GL_VERSION ) { if ( atof( string ) > atof( GLServerVersion ) ) { - buf = __glXMalloc( __glXStrlen( string ) - + __glXStrlen( GLServerVersion ) - + 4 ); + buf = malloc( strlen( string ) + strlen( GLServerVersion ) + 4 ); if ( buf == NULL ) { string = GLServerVersion; } else { - __glXSprintf( buf, "%s (%s)", GLServerVersion, string ); + sprintf( buf, "%s (%s)", GLServerVersion, string ); string = buf; } } } if (string) { - length = __glXStrlen((const char *) string) + 1; + length = strlen((const char *) string) + 1; } __GLX_BEGIN_REPLY(length); @@ -384,7 +387,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) __GLX_SEND_HEADER(); WriteToClient(client, length, string); if (buf != NULL) { - __glXFree(buf); + free(buf); } return Success; } diff --git a/nx-X11/programs/Xserver/GL/glx/single2swap.c b/nx-X11/programs/Xserver/GL/glx/single2swap.c index ca8ac2a85..6fdc7e7f2 100644 --- a/nx-X11/programs/Xserver/GL/glx/single2swap.c +++ b/nx-X11/programs/Xserver/GL/glx/single2swap.c @@ -42,7 +42,6 @@ #include "glxext.h" #include "unpack.h" #include "g_disptab.h" -#include "GL/glx_ansic.h" int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) { @@ -66,7 +65,7 @@ int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) size = *(GLsizei *)(pc+0); type = *(GLenum *)(pc+4); if (cx->feedbackBufSize < size) { - cx->feedbackBuf = (GLfloat *) __glXRealloc(cx->feedbackBuf, + cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf, (size_t) size * __GLX_SIZE_FLOAT32); if (!cx->feedbackBuf) { @@ -99,7 +98,7 @@ int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc) __GLX_SWAP_INT(pc+0); size = *(GLsizei *)(pc+0); if (cx->selectBufSize < size) { - cx->selectBuf = (GLuint *) __glXRealloc(cx->selectBuf, + cx->selectBuf = (GLuint *) realloc(cx->selectBuf, (size_t) size * __GLX_SIZE_CARD32); if (!cx->selectBuf) { diff --git a/nx-X11/programs/Xserver/GL/glx/xfont.c b/nx-X11/programs/Xserver/GL/glx/xfont.c index b5869cf44..581a6f22b 100644 --- a/nx-X11/programs/Xserver/GL/glx/xfont.c +++ b/nx-X11/programs/Xserver/GL/glx/xfont.c @@ -77,7 +77,7 @@ static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci) p = buf; allocbuf = 0; } else { - p = (unsigned char *) __glXMalloc(allocBytes); + p = (unsigned char *) malloc(allocBytes); if (!p) return BadAlloc; allocbuf = p; @@ -99,7 +99,7 @@ static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci) pci->metrics.characterWidth, 0, allocbuf ? allocbuf : buf); if (allocbuf) { - __glXFree(allocbuf); + free(allocbuf); } return Success; #undef __GL_CHAR_BUF_SIZE diff --git a/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h b/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h deleted file mode 100644 index f48ecb8bb..000000000 --- a/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h +++ /dev/null @@ -1,110 +0,0 @@ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _glx_ansic_h_ -#define _glx_ansic_h_ - -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ - -/* -** this needs to check whether we're using XFree86 at all, and then -** which version we're using. Use these macros if version is 3.9+, else -** use normal commands below. -*/ - -/* -** turns out this include file only exists for XFree86 3.9+ -** I notice that not having it is not an error and does not stop the build, -** but having it will allow opengl and glx to be built for 3.9+. We no longer -** need an explicit define in the Makefile, just point to the correct X source -** tree and all should be taken care of. -*/ - -#ifdef XFree86Server - -#ifndef assert -#define assert(a) -#endif - -#else - -#if defined(Lynx) && defined(__assert_h) -#undef __assert_h -#endif -#ifdef assert -#undef assert -#endif -#include - -#endif - - -#define GLX_STDOUT stdout -#define GLX_STDERR stderr -#define __glXPrintf printf -#define __glXFprintf fprintf -#define __glXSprintf sprintf -#define __glXVfprintf vfprintf -#define __glXVsprintf vsprintf -#define __glXFopen fopen -#define __glXFclose fclose -#define __glXCos(x) cos(x) -#define __glXSin(x) sin(x) -#define __glXAtan(x) atan(x) -#define __glXAbs(x) abs(x) -#define __glXLog(x) log(x) -#define __glXCeil(x) ceil(x) -#define __glXFloor(x) floor(x) -#define __glXSqrt(x) sqrt(x) -#define __glXPow(x, y) pow(x, y) -#define __glXMemmove(dest, src, n) memmove(dest, src, n) -#define __glXMemcpy(dest, src, n) memcpy(dest, src, n) -#define __glXMemset(s, c, n) memset(s, c, n) -#define __glXStrdup(str) xstrdup(str) -#define __glXStrcpy(dest, src) strcpy(dest, src) -#define __glXStrncpy(dest, src, n) strncpy(dest, src, n) -#define __glXStrcat(dest, src) strcat(dest, src) -#define __glXStrncat(dest, src, n) strncat(dest, src, n) -#define __glXStrcmp(s1, s2) strcmp(s1, s2) -#define __glXStrncmp(s1, s2, n) strncmp(s1, s2, n) -#define __glXStrlen(str) strlen(str) -#define __glXAbort() abort() -#define __glXStrtok(s, delim) strtok(s, delim) -#define __glXStrcspn(s, reject) strcspn(s, reject) -#define __glXGetenv(a) getenv(a) -#define __glXAtoi(a) atoi(a) - -#endif /* _glx_ansic_h_ */ diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c index 0d7496a0e..eae82f663 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c @@ -319,15 +319,15 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, /* Alloc space for the list of new GLX visuals */ pNewVisualConfigs = (__GLXvisualConfig *) - __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); + malloc(numNewConfigs * sizeof(__GLXvisualConfig)); if (!pNewVisualConfigs) { return FALSE; } /* Alloc space for the list of new GLX visual privates */ - pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); + pNewVisualPriv = (void **) malloc(numNewConfigs * sizeof(void *)); if (!pNewVisualPriv) { - __glXFree(pNewVisualConfigs); + free(pNewVisualConfigs); return FALSE; } @@ -371,40 +371,40 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, numConfigs = 0; /* Alloc temp space for the list of orig VisualIDs for each new visual */ - orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); + orig_vid = (VisualID *)malloc(numNewVisuals * sizeof(VisualID)); if (!orig_vid) { - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(pNewVisualPriv); + free(pNewVisualConfigs); return FALSE; } /* Alloc space for the list of glXVisuals */ modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); if (modes == NULL) { - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(orig_vid); + free(pNewVisualPriv); + free(pNewVisualConfigs); return FALSE; } /* Alloc space for the list of glXVisualPrivates */ - glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); + glXVisualPriv = (void **)malloc(numNewVisuals * sizeof(void *)); if (!glXVisualPriv) { _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(orig_vid); + free(pNewVisualPriv); + free(pNewVisualConfigs); return FALSE; } /* Alloc space for the new list of the X server's visuals */ - pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); + pVisualNew = (VisualPtr)malloc(numNewVisuals * sizeof(VisualRec)); if (!pVisualNew) { - __glXFree(glXVisualPriv); + free(glXVisualPriv); _gl_context_modes_destroy( modes ); - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(orig_vid); + free(pNewVisualPriv); + free(pNewVisualConfigs); return FALSE; } @@ -487,7 +487,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, numVids++; /* Allocate a new list of VisualIDs for this depth */ - pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); + pVids = (VisualID *)malloc(numVids * sizeof(VisualID)); /* Initialize the new list of VisualIDs for this depth */ for (j = 0; j < pdepth[i].numVids; j++) @@ -496,7 +496,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, pVids[n++] = pVisualNew[k].vid; /* Update this depth's list of VisualIDs */ - __glXFree(pdepth[i].vids); + free(pdepth[i].vids); pdepth[i].vids = pVids; pdepth[i].numVids = numVids; } @@ -506,12 +506,12 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, *visualp = pVisualNew; /* Free the old list of the X server's visuals */ - __glXFree(pVisual); + free(pVisual); /* Clean up temporary allocations */ - __glXFree(orig_vid); - __glXFree(pNewVisualPriv); - __glXFree(pNewVisualConfigs); + free(orig_vid); + free(pNewVisualPriv); + free(pNewVisualConfigs); /* Free the private list created by DDX HW driver */ if (visualPrivates) @@ -581,19 +581,19 @@ static void init_screen_visuals(int screen) int i, j; /* Alloc space for the list of XMesa visuals */ - pXMesaVisual = (XMesaVisual *)__glXMalloc(MESAScreens[screen].num_vis * + pXMesaVisual = (XMesaVisual *)malloc(MESAScreens[screen].num_vis * sizeof(XMesaVisual)); - __glXMemset(pXMesaVisual, 0, + memset(pXMesaVisual, 0, MESAScreens[screen].num_vis * sizeof(XMesaVisual)); /* FIXME: Change 'used' to be a array of bits (rather than of ints), * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less * FIXME: than 64 or 128 the stack array can be used instead of calling - * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to + * FIXME: malloc / free. If nothing else, convert 'used' to * FIXME: array of bytes instead of ints! */ - used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); - __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); + used = (int *)malloc(pScreen->numVisuals * sizeof(int)); + memset(used, 0, pScreen->numVisuals * sizeof(int)); i = 0; for ( modes = MESAScreens[screen].modes @@ -652,7 +652,7 @@ static void init_screen_visuals(int screen) i++; } - __glXFree(used); + free(used); MESAScreens[screen].xm_vis = pXMesaVisual; } @@ -703,9 +703,9 @@ extern void __MESA_resetExtension(void) } _gl_context_modes_destroy( MESAScreens[i].modes ); MESAScreens[i].modes = NULL; - __glXFree(MESAScreens[i].private); + free(MESAScreens[i].private); MESAScreens[i].private = NULL; - __glXFree(MESAScreens[i].xm_vis); + free(MESAScreens[i].xm_vis); MESAScreens[i].xm_vis = NULL; MESAScreens[i].num_vis = 0; } @@ -725,7 +725,7 @@ void __MESA_createBuffer(__GLXdrawablePrivate *glxPriv) ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", glxPriv->modes->visualID); } - buf = (__MESA_buffer)__glXMalloc(sizeof(struct __MESA_bufferRec)); + buf = (__MESA_buffer)malloc(sizeof(struct __MESA_bufferRec)); /* Create Mesa's buffers */ if (glxPriv->type == DRAWABLE_WINDOW) { @@ -793,7 +793,7 @@ void __MESA_destroyBuffer(__GLdrawablePrivate *glPriv) glxPriv->swapBuffers = buf->fbswap; glPriv->frontBuffer.resize = buf->fbresize; - __glXFree(glPriv->private); + free(glPriv->private); glPriv->private = NULL; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c index e30f69495..c09379c59 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c @@ -67,12 +67,12 @@ static int __glXDispatch(ClientPtr client) opcode = stuff->glxCode; cl = __glXClients[client->index]; if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); + cl = (__GLXclientState *) malloc(sizeof(__GLXclientState)); __glXClients[client->index] = cl; if (!cl) { return BadAlloc; } - __glXMemset(cl, 0, sizeof(__GLXclientState)); + memset(cl, 0, sizeof(__GLXclientState)); } if (!cl->inUse) { @@ -145,12 +145,12 @@ static int __glXSwapDispatch(ClientPtr client) opcode = stuff->glxCode; cl = __glXClients[client->index]; if (!cl) { - cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState)); + cl = (__GLXclientState *) malloc(sizeof(__GLXclientState)); __glXClients[client->index] = cl; if (!cl) { return BadAlloc; } - __glXMemset(cl, 0, sizeof(__GLXclientState)); + memset(cl, 0, sizeof(__GLXclientState)); } if (!cl->inUse) { -- cgit v1.2.3 From 4146d1aa71ba5a2a4951667624844b4d3bff5c0e Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 1 Nov 2016 21:30:22 +0100 Subject: Drop xf86glx.h, so we can finally drop Xserver/GL/include/ entirely. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Derived from X.org commit... commit 28b95fd9d1c2f078aaaac75c310a27b17c74a6fc Author: Kristian Høgsberg Date: Thu Jul 6 03:25:38 2006 -0400 Drop unused GL/include subtree. Woo, less Makefile's to generate. Backported-to-NX-by: Mike Gabriel --- .../extras/Mesa/src/mesa/drivers/x11/glxheader.h | 1 - nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h | 1 - nx-X11/programs/Xserver/GL/include/GL/xf86glx.h | 38 ---------------------- nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c | 1 - nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c | 1 - 5 files changed, 42 deletions(-) delete mode 100644 nx-X11/programs/Xserver/GL/include/GL/xf86glx.h (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxheader.h b/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxheader.h index 33d937f1c..6a1f2ed20 100644 --- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxheader.h +++ b/nx-X11/extras/Mesa/src/mesa/drivers/x11/glxheader.h @@ -38,7 +38,6 @@ # include "resource.h" # include "windowstr.h" # include "gcstruct.h" -# include "GL/xf86glx.h" # include "xf86glx_util.h" #else diff --git a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h index 26255ae56..c5037e619 100644 --- a/nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h +++ b/nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h @@ -28,7 +28,6 @@ #ifdef XFree86Server -# include "GL/xf86glx.h" # include "xf86glx_util.h" #elif defined(USE_XSHM) # include diff --git a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h deleted file mode 100644 index 9e69fac65..000000000 --- a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h +++ /dev/null @@ -1,38 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "miscstruct.h" diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c index eae82f663..da0e77134 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c @@ -52,7 +52,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86glxint.h" #include "context.h" #include "xmesaP.h" -#include #include "context.h" /* diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c index d0d8eb239..fad84ec7e 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c +++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c @@ -41,7 +41,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "pixmapstr.h" #include "xf86glx_util.h" #include -#include "GL/xf86glx.h" #ifdef ROUNDUP #undef ROUNDUP -- cgit v1.2.3 From 6e770378c3ec579b3e25315f0c951e838956199e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 3 Mar 2017 11:06:58 +0100 Subject: Xserver/GL/glx/glxcmd.c: Fix uninitialized xGLXQueryVersionReply. Fixes ArcticaProject/nx-libs#324. --- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index d082e84bf..efe5b25e9 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -783,6 +783,8 @@ int __glXQueryVersion(__GLXclientState *cl, GLbyte *pc) (void)major; (void)minor; + memset(&reply, 0, sizeof(xGLXQueryVersionReply)); + /* ** Server should take into consideration the version numbers sent by the ** client if it wants to work with older clients; however, in this -- cgit v1.2.3 From 4ad88de861f6a513d4d6ae4b4609f7ced1001a6b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 19 Apr 2017 13:08:26 +0200 Subject: Clearing comments from $XFree86$ (et al.) header lines. --- nx-X11/programs/Xserver/GL/glx/global.c | 1 - nx-X11/programs/Xserver/GL/glx/glxbuf.h | 1 - nx-X11/programs/Xserver/GL/glx/glxerror.h | 1 - nx-X11/programs/Xserver/GL/glx/glxext.c | 1 - nx-X11/programs/Xserver/GL/glx/glxfb.c | 1 - nx-X11/programs/Xserver/GL/glx/glxfb.h | 1 - nx-X11/programs/Xserver/GL/glx/glxmem.h | 1 - nx-X11/programs/Xserver/GL/glx/glxpix.h | 1 - nx-X11/programs/Xserver/GL/glx/renderpix.c | 1 - nx-X11/programs/Xserver/GL/glx/renderpixswap.c | 1 - nx-X11/programs/Xserver/GL/glx/singlepix.c | 1 - nx-X11/programs/Xserver/GL/glx/singlesize.h | 1 - nx-X11/programs/Xserver/GL/glx/xfont.c | 1 - nx-X11/programs/Xserver/Xext/xvdisp.h | 2 -- nx-X11/programs/Xserver/dbe/dbestruct.h | 1 - nx-X11/programs/Xserver/dbe/midbe.h | 2 -- nx-X11/programs/Xserver/dix/xpstubs.c | 1 - nx-X11/programs/Xserver/fb/fb.h | 2 -- nx-X11/programs/Xserver/fb/fb24_32.c | 2 -- nx-X11/programs/Xserver/fb/fbbits.h | 2 -- nx-X11/programs/Xserver/fb/fbcompose.c | 3 --- nx-X11/programs/Xserver/fb/fbglyph.c | 3 --- nx-X11/programs/Xserver/fb/fbline.c | 2 -- nx-X11/programs/Xserver/fb/fboverlay.c | 2 -- nx-X11/programs/Xserver/fb/fboverlay.h | 2 -- nx-X11/programs/Xserver/fb/fbpict.c | 2 -- nx-X11/programs/Xserver/fb/fbpict.h | 2 -- nx-X11/programs/Xserver/fb/fbsolid.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphRef.h | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphSet.h | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 2 -- nx-X11/programs/Xserver/include/pixmap.h | 1 - nx-X11/programs/Xserver/include/pixmapstr.h | 1 - nx-X11/programs/Xserver/include/window.h | 1 - nx-X11/programs/Xserver/mi/mipoly.c | 1 - nx-X11/programs/Xserver/mi/mistruct.h | 1 - nx-X11/programs/Xserver/mi/mivalidate.h | 2 -- nx-X11/programs/Xserver/os/strlcat.c | 4 ---- nx-X11/programs/Xserver/os/strlcpy.c | 3 --- nx-X11/programs/Xserver/record/set.h | 2 -- nx-X11/programs/Xserver/render/animcur.c | 2 -- nx-X11/programs/Xserver/render/glyph.c | 2 -- nx-X11/programs/Xserver/render/glyphstr.h | 2 -- nx-X11/programs/Xserver/render/miindex.c | 2 -- nx-X11/programs/Xserver/render/mipict.c | 2 -- nx-X11/programs/Xserver/render/mipict.h | 2 -- nx-X11/programs/Xserver/render/mirect.c | 2 -- nx-X11/programs/Xserver/render/mitrap.c | 2 -- nx-X11/programs/Xserver/render/mitri.c | 2 -- nx-X11/programs/Xserver/render/picture.c | 2 -- nx-X11/programs/Xserver/render/picture.h | 2 -- nx-X11/programs/Xserver/render/render.c | 2 -- nx-X11/programs/Xserver/xkb/ddxFakeBtn.c | 1 - nx-X11/programs/Xserver/xkb/ddxInit.c | 1 - nx-X11/programs/Xserver/xkb/ddxKeyClick.c | 1 - nx-X11/programs/Xserver/xkb/ddxLEDs.c | 1 - nx-X11/programs/Xserver/xkb/xkb.h | 2 -- nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c | 1 - 62 files changed, 1 insertion(+), 103 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/global.c b/nx-X11/programs/Xserver/GL/glx/global.c index 207e7b4cc..2ce275ba3 100644 --- a/nx-X11/programs/Xserver/GL/glx/global.c +++ b/nx-X11/programs/Xserver/GL/glx/global.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxbuf.h b/nx-X11/programs/Xserver/GL/glx/glxbuf.h index 88b04e8bd..9354dc4f8 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxbuf.h +++ b/nx-X11/programs/Xserver/GL/glx/glxbuf.h @@ -1,4 +1,3 @@ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxerror.h b/nx-X11/programs/Xserver/GL/glx/glxerror.h index 2c6d6d863..44973fccb 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxerror.h +++ b/nx-X11/programs/Xserver/GL/glx/glxerror.h @@ -1,4 +1,3 @@ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.c b/nx-X11/programs/Xserver/GL/glx/glxext.c index f6d572d2a..5e5f0316e 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxext.c +++ b/nx-X11/programs/Xserver/GL/glx/glxext.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.9 2003/09/28 20:15:43 alanh Exp $ ** The contents of this file are subject to the GLX Public License Version 1.0 ** (the "License"). You may not use this file except in compliance with the ** License. You may obtain a copy of the License at Silicon Graphics, Inc., diff --git a/nx-X11/programs/Xserver/GL/glx/glxfb.c b/nx-X11/programs/Xserver/GL/glx/glxfb.c index 955c1dd79..7248b6ffb 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxfb.c +++ b/nx-X11/programs/Xserver/GL/glx/glxfb.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/glxfb.h b/nx-X11/programs/Xserver/GL/glx/glxfb.h index 325146d43..f414728f3 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxfb.h +++ b/nx-X11/programs/Xserver/GL/glx/glxfb.h @@ -1,4 +1,3 @@ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxmem.h b/nx-X11/programs/Xserver/GL/glx/glxmem.h index 06720dfdf..b4116dfa9 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxmem.h +++ b/nx-X11/programs/Xserver/GL/glx/glxmem.h @@ -1,4 +1,3 @@ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/glxpix.h b/nx-X11/programs/Xserver/GL/glx/glxpix.h index 4b16352b4..285cf490c 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxpix.h +++ b/nx-X11/programs/Xserver/GL/glx/glxpix.h @@ -1,4 +1,3 @@ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/renderpix.c b/nx-X11/programs/Xserver/GL/glx/renderpix.c index 2a929ea7c..d1997b5ad 100644 --- a/nx-X11/programs/Xserver/GL/glx/renderpix.c +++ b/nx-X11/programs/Xserver/GL/glx/renderpix.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/renderpixswap.c b/nx-X11/programs/Xserver/GL/glx/renderpixswap.c index 4eef7a546..a527a859a 100644 --- a/nx-X11/programs/Xserver/GL/glx/renderpixswap.c +++ b/nx-X11/programs/Xserver/GL/glx/renderpixswap.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/singlepix.c b/nx-X11/programs/Xserver/GL/glx/singlepix.c index 157ce3f64..9e3e36333 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlepix.c +++ b/nx-X11/programs/Xserver/GL/glx/singlepix.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/GL/glx/singlesize.h b/nx-X11/programs/Xserver/GL/glx/singlesize.h index 4804a9982..7cd52eae8 100644 --- a/nx-X11/programs/Xserver/GL/glx/singlesize.h +++ b/nx-X11/programs/Xserver/GL/glx/singlesize.h @@ -1,4 +1,3 @@ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/nx-X11/programs/Xserver/GL/glx/xfont.c b/nx-X11/programs/Xserver/GL/glx/xfont.c index 581a6f22b..780183609 100644 --- a/nx-X11/programs/Xserver/GL/glx/xfont.c +++ b/nx-X11/programs/Xserver/GL/glx/xfont.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.h b/nx-X11/programs/Xserver/Xext/xvdisp.h index 00af9858b..75cacddcc 100644 --- a/nx-X11/programs/Xserver/Xext/xvdisp.h +++ b/nx-X11/programs/Xserver/Xext/xvdisp.h @@ -1,3 +1 @@ -/* $XFree86$ */ - extern void XineramifyXv(void); diff --git a/nx-X11/programs/Xserver/dbe/dbestruct.h b/nx-X11/programs/Xserver/dbe/dbestruct.h index 2f3f25d11..17690d5a3 100644 --- a/nx-X11/programs/Xserver/dbe/dbestruct.h +++ b/nx-X11/programs/Xserver/dbe/dbestruct.h @@ -29,7 +29,6 @@ * Header file for DIX-related DBE * *****************************************************************************/ -/* $XFree86$ */ #ifndef DBE_STRUCT_H #define DBE_STRUCT_H diff --git a/nx-X11/programs/Xserver/dbe/midbe.h b/nx-X11/programs/Xserver/dbe/midbe.h index 1780c3fc3..a21af12bb 100644 --- a/nx-X11/programs/Xserver/dbe/midbe.h +++ b/nx-X11/programs/Xserver/dbe/midbe.h @@ -29,8 +29,6 @@ * Header file for users of machine-independent DBE code * *****************************************************************************/ -/* $XFree86$ */ - #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/dix/xpstubs.c b/nx-X11/programs/Xserver/dix/xpstubs.c index ed9693b89..ade0847d3 100644 --- a/nx-X11/programs/Xserver/dix/xpstubs.c +++ b/nx-X11/programs/Xserver/dix/xpstubs.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /* Copyright 1996, 1998 The Open Group diff --git a/nx-X11/programs/Xserver/fb/fb.h b/nx-X11/programs/Xserver/fb/fb.h index 14738df2e..61bf18caf 100644 --- a/nx-X11/programs/Xserver/fb/fb.h +++ b/nx-X11/programs/Xserver/fb/fb.h @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/fb/fb.h,v 1.36tsi Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/fb/fb24_32.c b/nx-X11/programs/Xserver/fb/fb24_32.c index f80874e2f..7255b5021 100644 --- a/nx-X11/programs/Xserver/fb/fb24_32.c +++ b/nx-X11/programs/Xserver/fb/fb24_32.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/fb/fb24_32.c,v 1.4 2000/08/09 17:50:51 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/fb/fbbits.h b/nx-X11/programs/Xserver/fb/fbbits.h index d915d7b35..30fa21f1e 100644 --- a/nx-X11/programs/Xserver/fb/fbbits.h +++ b/nx-X11/programs/Xserver/fb/fbbits.h @@ -1,6 +1,4 @@ /* - * $XFree86$ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/fb/fbcompose.c b/nx-X11/programs/Xserver/fb/fbcompose.c index b0b256e47..3f4e6ec20 100644 --- a/nx-X11/programs/Xserver/fb/fbcompose.c +++ b/nx-X11/programs/Xserver/fb/fbcompose.c @@ -1,7 +1,4 @@ /* - * $XdotOrg: xc/programs/Xserver/fb/fbcompose.c,v 1.26 2005/12/09 18:35:20 ajax Exp $ - * $XFree86: xc/programs/Xserver/fb/fbcompose.c,v 1.17tsi Exp $ - * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * 2005 Lars Knoll & Zack Rusin, Trolltech * diff --git a/nx-X11/programs/Xserver/fb/fbglyph.c b/nx-X11/programs/Xserver/fb/fbglyph.c index 3c0913cf8..6ff90e54a 100644 --- a/nx-X11/programs/Xserver/fb/fbglyph.c +++ b/nx-X11/programs/Xserver/fb/fbglyph.c @@ -1,7 +1,4 @@ /* - * $XdotOrg: xc/programs/Xserver/fb/fbglyph.c,v 1.5 2005/07/03 07:01:23 daniels Exp $ - * $XFree86: xc/programs/Xserver/fb/fbglyph.c,v 1.12tsi Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/fb/fbline.c b/nx-X11/programs/Xserver/fb/fbline.c index 0a9954998..fa80573e2 100644 --- a/nx-X11/programs/Xserver/fb/fbline.c +++ b/nx-X11/programs/Xserver/fb/fbline.c @@ -1,6 +1,4 @@ /* - * $XFree86$ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/fb/fboverlay.c b/nx-X11/programs/Xserver/fb/fboverlay.c index 392ffc70b..6e0bbf252 100644 --- a/nx-X11/programs/Xserver/fb/fboverlay.c +++ b/nx-X11/programs/Xserver/fb/fboverlay.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/fb/fboverlay.c,v 1.7 2003/11/10 18:21:47 tsi Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/fb/fboverlay.h b/nx-X11/programs/Xserver/fb/fboverlay.h index 478ecb565..2bb8b176a 100644 --- a/nx-X11/programs/Xserver/fb/fboverlay.h +++ b/nx-X11/programs/Xserver/fb/fboverlay.h @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/fb/fboverlay.h,v 1.4tsi Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/fb/fbpict.c b/nx-X11/programs/Xserver/fb/fbpict.c index c513b3621..214ed5a4c 100644 --- a/nx-X11/programs/Xserver/fb/fbpict.c +++ b/nx-X11/programs/Xserver/fb/fbpict.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/fb/fbpict.c,v 1.15 2002/09/26 02:56:48 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/fb/fbpict.h b/nx-X11/programs/Xserver/fb/fbpict.h index 173a96ac4..78d280707 100644 --- a/nx-X11/programs/Xserver/fb/fbpict.h +++ b/nx-X11/programs/Xserver/fb/fbpict.h @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/fb/fbpict.h,v 1.7 2001/07/18 10:15:02 keithp Exp $ - * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/fb/fbsolid.c b/nx-X11/programs/Xserver/fb/fbsolid.c index 89effe63b..99e479f49 100644 --- a/nx-X11/programs/Xserver/fb/fbsolid.c +++ b/nx-X11/programs/Xserver/fb/fbsolid.c @@ -1,6 +1,4 @@ /* - * $XFree86$ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c index c09379c59..5512cae1b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c @@ -23,7 +23,7 @@ /* */ /**************************************************************************/ -/* $XFree86: xc/programs/Xserver/GL/glx/glxext.c,v 1.9 2003/09/28 20:15:43 alanh Exp $ +/* ** The contents of this file are subject to the GLX Public License Version 1.0 ** (the "License"). You may not use this file except in compliance with the ** License. You may obtain a copy of the License at Silicon Graphics, Inc., diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c index 34195808d..35dcbc132 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c @@ -24,8 +24,6 @@ /**************************************************************************/ /* - * $XFree86: xc/programs/Xserver/render/glyph.c,v 1.5 2001/01/30 07:01:22 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphRef.h b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphRef.h index ce2414453..eef2da8dd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphRef.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphRef.h @@ -24,8 +24,6 @@ /**************************************************************************/ /* - * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.3 2000/11/20 07:13:13 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphSet.h b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphSet.h index 44756a28f..98f331dd7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphSet.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphSet.h @@ -24,8 +24,6 @@ /**************************************************************************/ /* - * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.3 2000/11/20 07:13:13 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c index a43a36bf1..1988ca102 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c @@ -24,8 +24,6 @@ /**************************************************************************/ /* - * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.8 2002/09/03 19:28:28 keithp Exp $ - * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index c08af1764..c6cf31389 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -24,8 +24,6 @@ /**************************************************************************/ /* - * $XFree86: xc/programs/Xserver/render/picture.c,v 1.29 2002/11/23 02:38:15 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index c1a4577bd..691b260cf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -24,8 +24,6 @@ /**************************************************************************/ /* - * $XFree86: xc/programs/Xserver/render/render.c,v 1.27tsi Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/include/pixmap.h b/nx-X11/programs/Xserver/include/pixmap.h index 22e1ce7bd..7d893d57c 100644 --- a/nx-X11/programs/Xserver/include/pixmap.h +++ b/nx-X11/programs/Xserver/include/pixmap.h @@ -44,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86$ */ #ifndef PIXMAP_H #define PIXMAP_H diff --git a/nx-X11/programs/Xserver/include/pixmapstr.h b/nx-X11/programs/Xserver/include/pixmapstr.h index 82b96d456..5d38c1c3b 100644 --- a/nx-X11/programs/Xserver/include/pixmapstr.h +++ b/nx-X11/programs/Xserver/include/pixmapstr.h @@ -44,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86$ */ #ifndef PIXMAPSTRUCT_H #define PIXMAPSTRUCT_H diff --git a/nx-X11/programs/Xserver/include/window.h b/nx-X11/programs/Xserver/include/window.h index 41b14d562..a8c78f569 100644 --- a/nx-X11/programs/Xserver/include/window.h +++ b/nx-X11/programs/Xserver/include/window.h @@ -44,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86$ */ #ifndef WINDOW_H #define WINDOW_H diff --git a/nx-X11/programs/Xserver/mi/mipoly.c b/nx-X11/programs/Xserver/mi/mipoly.c index b95ee3962..97fe6669e 100644 --- a/nx-X11/programs/Xserver/mi/mipoly.c +++ b/nx-X11/programs/Xserver/mi/mipoly.c @@ -1,4 +1,3 @@ -/* $XFree86$ */ /*********************************************************** Copyright 1987, 1998 The Open Group diff --git a/nx-X11/programs/Xserver/mi/mistruct.h b/nx-X11/programs/Xserver/mi/mistruct.h index 9b9de8677..e9cfed5a4 100644 --- a/nx-X11/programs/Xserver/mi/mistruct.h +++ b/nx-X11/programs/Xserver/mi/mistruct.h @@ -44,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86$ */ #ifndef MISTRUCT_H #define MISTRUCT_H diff --git a/nx-X11/programs/Xserver/mi/mivalidate.h b/nx-X11/programs/Xserver/mi/mivalidate.h index 91858328a..ef258c0f8 100644 --- a/nx-X11/programs/Xserver/mi/mivalidate.h +++ b/nx-X11/programs/Xserver/mi/mivalidate.h @@ -25,8 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86$ */ - #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/os/strlcat.c b/nx-X11/programs/Xserver/os/strlcat.c index 28e2338f9..fc137cabb 100644 --- a/nx-X11/programs/Xserver/os/strlcat.c +++ b/nx-X11/programs/Xserver/os/strlcat.c @@ -1,5 +1,3 @@ -/* $OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp $ */ - /* * Copyright (c) 1998 Todd C. Miller * @@ -15,8 +13,6 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86$ */ - #ifdef HAVE_XORG_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/os/strlcpy.c b/nx-X11/programs/Xserver/os/strlcpy.c index 42442cc30..989d0385e 100644 --- a/nx-X11/programs/Xserver/os/strlcpy.c +++ b/nx-X11/programs/Xserver/os/strlcpy.c @@ -1,5 +1,3 @@ -/* $OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $ */ - /* * Copyright (c) 1998 Todd C. Miller * @@ -15,7 +13,6 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86$ */ #ifdef HAVE_XORG_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/record/set.h b/nx-X11/programs/Xserver/record/set.h index f156bf8dc..3246a16ed 100644 --- a/nx-X11/programs/Xserver/record/set.h +++ b/nx-X11/programs/Xserver/record/set.h @@ -1,4 +1,3 @@ - /* Copyright 1995, 1998 The Open Group @@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86$ */ /* A Set Abstract Data Type (ADT) for the RECORD Extension diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index 7cd6c8119..7336cdeff 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/animcur.c,v 1.5tsi Exp $ - * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index d3bfae760..9c9a485ea 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/glyph.c,v 1.5 2001/01/30 07:01:22 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/glyphstr.h b/nx-X11/programs/Xserver/render/glyphstr.h index d0c14919c..5c4ed4933 100644 --- a/nx-X11/programs/Xserver/render/glyphstr.h +++ b/nx-X11/programs/Xserver/render/glyphstr.h @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.3 2000/11/20 07:13:13 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/miindex.c b/nx-X11/programs/Xserver/render/miindex.c index ce31c00fb..5b5f35b19 100644 --- a/nx-X11/programs/Xserver/render/miindex.c +++ b/nx-X11/programs/Xserver/render/miindex.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/miindex.c,v 1.7 2002/11/05 06:05:04 keithp Exp $ - * * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index d2420ea87..9b8f0cfda 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mipict.c,v 1.15tsi Exp $ - * * Copyright © 1999 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mipict.h b/nx-X11/programs/Xserver/render/mipict.h index c035a87f8..6a6554033 100644 --- a/nx-X11/programs/Xserver/render/mipict.h +++ b/nx-X11/programs/Xserver/render/mipict.h @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mipict.h,v 1.12 2002/11/05 05:34:40 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mirect.c b/nx-X11/programs/Xserver/render/mirect.c index 888492140..49da8d4f8 100644 --- a/nx-X11/programs/Xserver/render/mirect.c +++ b/nx-X11/programs/Xserver/render/mirect.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mirect.c,v 1.3 2000/12/08 07:52:05 keithp Exp $ - * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mitrap.c b/nx-X11/programs/Xserver/render/mitrap.c index d3d052800..2155641ce 100644 --- a/nx-X11/programs/Xserver/render/mitrap.c +++ b/nx-X11/programs/Xserver/render/mitrap.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.8 2002/09/03 19:28:28 keithp Exp $ - * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mitri.c b/nx-X11/programs/Xserver/render/mitri.c index 9adc7180e..a39e23623 100644 --- a/nx-X11/programs/Xserver/render/mitri.c +++ b/nx-X11/programs/Xserver/render/mitri.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mitri.c,v 1.5 2002/05/31 16:48:52 keithp Exp $ - * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 4e7c02ecb..e82319bc9 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/picture.c,v 1.29 2002/11/23 02:38:15 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/picture.h b/nx-X11/programs/Xserver/render/picture.h index 6f3f2d832..5dde2d0bc 100644 --- a/nx-X11/programs/Xserver/render/picture.h +++ b/nx-X11/programs/Xserver/render/picture.h @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/picture.h,v 1.20tsi Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 24a8675f6..fb9208ad1 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/render.c,v 1.27tsi Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c b/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c index 38e333103..db7de5595 100644 --- a/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxFakeBtn.c @@ -23,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxInit.c b/nx-X11/programs/Xserver/xkb/ddxInit.c index 533182583..18e5e6a45 100644 --- a/nx-X11/programs/Xserver/xkb/ddxInit.c +++ b/nx-X11/programs/Xserver/xkb/ddxInit.c @@ -23,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxKeyClick.c b/nx-X11/programs/Xserver/xkb/ddxKeyClick.c index 3fc5c8fb4..ddc34b0fd 100644 --- a/nx-X11/programs/Xserver/xkb/ddxKeyClick.c +++ b/nx-X11/programs/Xserver/xkb/ddxKeyClick.c @@ -23,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/ddxLEDs.c b/nx-X11/programs/Xserver/xkb/ddxLEDs.c index 33442c863..4fe74bbd6 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLEDs.c +++ b/nx-X11/programs/Xserver/xkb/ddxLEDs.c @@ -23,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include diff --git a/nx-X11/programs/Xserver/xkb/xkb.h b/nx-X11/programs/Xserver/xkb/xkb.h index 7e5bc6488..7bf3a9c61 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.h +++ b/nx-X11/programs/Xserver/xkb/xkb.h @@ -1,5 +1,3 @@ -/* $XFree86$ */ - extern int ProcXkbUseExtension(ClientPtr client); extern int ProcXkbSelectEvents(ClientPtr client); extern int ProcXkbBell(ClientPtr client); diff --git a/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c b/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c index 13d0cde3d..65a1e8a5d 100644 --- a/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c +++ b/nx-X11/programs/Xserver/xkb/xkbPrOtherEv.c @@ -23,7 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include -- cgit v1.2.3 From ab0bc8158910fa6e7cc74a8114b330ea8b26af77 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 19 Apr 2017 13:38:49 +0200 Subject: Xserver/GL/glx/glxext.c: Fix for previous commit, re-adding a comment starter '/*'. --- nx-X11/programs/Xserver/GL/glx/glxext.c | 1 + 1 file changed, 1 insertion(+) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.c b/nx-X11/programs/Xserver/GL/glx/glxext.c index 5e5f0316e..cb82dc609 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxext.c +++ b/nx-X11/programs/Xserver/GL/glx/glxext.c @@ -1,3 +1,4 @@ +/* ** The contents of this file are subject to the GLX Public License Version 1.0 ** (the "License"). You may not use this file except in compliance with the ** License. You may obtain a copy of the License at Silicon Graphics, Inc., -- cgit v1.2.3 From c20b946b4abe2aeccfdb85e54f38e65041948741 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Feb 2017 12:54:14 +0100 Subject: Mesa subtree: Adapt build process for building against Mesa that gets pulled in via git subtree. --- nx-X11/extras/Mesa.patches | 1 + .../4001_CreatePixmap-AllocationHints.patch | 13 ------ ..._define-USE_IEEE-macro-for-more-platforms.patch | 16 ------- nx-X11/extras/Mesa.patches/series | 2 - ...001_Fix-non-working-GLX-in-64bit-Xorg-7.0.patch | 54 ++++++++++++++++++++++ .../4002_no-special-glx-memfunctions.patch | 28 +++++++++++ .../4003_CreatePixmap-AllocationHints.patch | 13 ++++++ ..._define-USE_IEEE-macro-for-more-platforms.patch | 16 +++++++ nx-X11/extras/Mesa.patches_6.4.1/series | 4 ++ nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h | 5 ++ nx-X11/programs/Xserver/GL/include/GL/xf86glx.h | 1 + .../programs/Xserver/GL/mesa/main/WSDrawBuffer.h | 27 +++++++++++ 12 files changed, 149 insertions(+), 31 deletions(-) create mode 120000 nx-X11/extras/Mesa.patches delete mode 100644 nx-X11/extras/Mesa.patches/4001_CreatePixmap-AllocationHints.patch delete mode 100644 nx-X11/extras/Mesa.patches/4002_define-USE_IEEE-macro-for-more-platforms.patch delete mode 100644 nx-X11/extras/Mesa.patches/series create mode 100644 nx-X11/extras/Mesa.patches_6.4.1/4001_Fix-non-working-GLX-in-64bit-Xorg-7.0.patch create mode 100644 nx-X11/extras/Mesa.patches_6.4.1/4002_no-special-glx-memfunctions.patch create mode 100644 nx-X11/extras/Mesa.patches_6.4.1/4003_CreatePixmap-AllocationHints.patch create mode 100644 nx-X11/extras/Mesa.patches_6.4.1/4004_define-USE_IEEE-macro-for-more-platforms.patch create mode 100644 nx-X11/extras/Mesa.patches_6.4.1/series create mode 100644 nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h create mode 100644 nx-X11/programs/Xserver/GL/include/GL/xf86glx.h create mode 100644 nx-X11/programs/Xserver/GL/mesa/main/WSDrawBuffer.h (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/extras/Mesa.patches b/nx-X11/extras/Mesa.patches new file mode 120000 index 000000000..5807689b4 --- /dev/null +++ b/nx-X11/extras/Mesa.patches @@ -0,0 +1 @@ +Mesa.patches_6.4.1 \ No newline at end of file diff --git a/nx-X11/extras/Mesa.patches/4001_CreatePixmap-AllocationHints.patch b/nx-X11/extras/Mesa.patches/4001_CreatePixmap-AllocationHints.patch deleted file mode 100644 index f2caf2812..000000000 --- a/nx-X11/extras/Mesa.patches/4001_CreatePixmap-AllocationHints.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: Mesa/include/GL/xmesa_xf86.h -=================================================================== ---- Mesa.orig/include/GL/xmesa_xf86.h -+++ Mesa/include/GL/xmesa_xf86.h -@@ -130,7 +130,7 @@ do { \ - - /* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */ - #define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \ -- (*__d->CreatePixmap)(__d, __w, __h, __depth) -+ (*__d->CreatePixmap)(__d, __w, __h, __depth, 0) - - #define XMesaFreePixmap(__d,__b) \ - (*__d->DestroyPixmap)(__b) diff --git a/nx-X11/extras/Mesa.patches/4002_define-USE_IEEE-macro-for-more-platforms.patch b/nx-X11/extras/Mesa.patches/4002_define-USE_IEEE-macro-for-more-platforms.patch deleted file mode 100644 index 7db909b91..000000000 --- a/nx-X11/extras/Mesa.patches/4002_define-USE_IEEE-macro-for-more-platforms.patch +++ /dev/null @@ -1,16 +0,0 @@ -Author: Mike Gabriel -Description: define USE_IEEE for __aarch64__ and __mc68000__, as well - -Index: Mesa/src/mesa/main/imports.h -=================================================================== ---- Mesa.orig/src/mesa/main/imports.h -+++ Mesa/src/mesa/main/imports.h -@@ -204,6 +204,8 @@ typedef union { GLfloat f; GLint i; } fi - defined(ia64) || defined(__ia64__) || \ - defined(__mips) || defined(_MIPS_ARCH) || \ - defined(__arm__) || \ -+ defined(__aarch64__) || \ -+ defined(__mc68000__) || \ - defined(__sh__) || \ - (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) - #define USE_IEEE diff --git a/nx-X11/extras/Mesa.patches/series b/nx-X11/extras/Mesa.patches/series deleted file mode 100644 index 8dd25b553..000000000 --- a/nx-X11/extras/Mesa.patches/series +++ /dev/null @@ -1,2 +0,0 @@ -4001_CreatePixmap-AllocationHints.patch -4002_define-USE_IEEE-macro-for-more-platforms.patch diff --git a/nx-X11/extras/Mesa.patches_6.4.1/4001_Fix-non-working-GLX-in-64bit-Xorg-7.0.patch b/nx-X11/extras/Mesa.patches_6.4.1/4001_Fix-non-working-GLX-in-64bit-Xorg-7.0.patch new file mode 100644 index 000000000..c73be3643 --- /dev/null +++ b/nx-X11/extras/Mesa.patches_6.4.1/4001_Fix-non-working-GLX-in-64bit-Xorg-7.0.patch @@ -0,0 +1,54 @@ +From 44518d07398d663448d79e4f546736b40752630c Mon Sep 17 00:00:00 2001 +From: Ulrich Sibiller +Date: Wed, 16 Mar 2016 14:40:08 +0100 +Subject: [PATCH] Fix non-working GLX in 64bit Xorg 7.0 + +Found the needed patch in debian bugtracker at +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=364233 +--- + src/glx/x11/indirect_vertex_array.c | 2 +- + src/mesa/drivers/dri/common/glcontextmodes.c | 3 +++ + src/mesa/main/glheader.h | 3 +++ + 3 files changed, 7 insertions(+), 1 deletion(-) + +Index: Mesa/src/glx/x11/indirect_vertex_array.c +=================================================================== +--- Mesa.orig/src/glx/x11/indirect_vertex_array.c ++++ Mesa/src/glx/x11/indirect_vertex_array.c +@@ -530,7 +530,7 @@ static GLubyte * + emit_DrawArrays_header_old( __GLXcontext * gc, + struct array_state_vector * arrays, + size_t * elements_per_request, +- size_t * total_requests, ++ unsigned int * total_requests, + GLenum mode, GLsizei count ) + { + size_t command_size; +Index: Mesa/src/mesa/main/glheader.h +=================================================================== +--- Mesa.orig/src/mesa/main/glheader.h ++++ Mesa/src/mesa/main/glheader.h +@@ -46,6 +46,9 @@ + #ifndef GLHEADER_H + #define GLHEADER_H + ++#ifdef HAVE_DIX_CONFIG_H ++#include "dix-config.h" ++#endif + + #if defined(XFree86LOADER) && defined(IN_MODULE) + #include "xf86_ansic.h" +Index: Mesa/src/mesa/drivers/dri/common/glcontextmodes.c +=================================================================== +--- Mesa.orig/src/mesa/drivers/dri/common/glcontextmodes.c ++++ Mesa/src/mesa/drivers/dri/common/glcontextmodes.c +@@ -39,6 +39,9 @@ + # include "imports.h" + # define __glXMemset memset + #else ++# if defined (HAVE_DIX_CONFIG_H) ++# include ++# endif + # include + # include + # include "GL/glxint.h" diff --git a/nx-X11/extras/Mesa.patches_6.4.1/4002_no-special-glx-memfunctions.patch b/nx-X11/extras/Mesa.patches_6.4.1/4002_no-special-glx-memfunctions.patch new file mode 100644 index 000000000..4f6803730 --- /dev/null +++ b/nx-X11/extras/Mesa.patches_6.4.1/4002_no-special-glx-memfunctions.patch @@ -0,0 +1,28 @@ +Description: Turn glx_ansic.h into a no-op include. (by using memset, malloc, free directly) +Author: Mike Gabriel + +Index: Mesa/src/mesa/drivers/dri/common/glcontextmodes.c +=================================================================== +--- Mesa.orig/src/mesa/drivers/dri/common/glcontextmodes.c ++++ Mesa/src/mesa/drivers/dri/common/glcontextmodes.c +@@ -48,15 +48,14 @@ + + # ifdef XFree86Server + # include "GL/glx_ansic.h" +-extern void * __glXMalloc( size_t size ); +-extern void __glXFree( void * ptr ); +-# define _mesa_malloc(b) __glXMalloc(b) +-# define _mesa_free(m) __glXFree(m) ++# define __glXMemset memset ++# define _mesa_malloc(b) malloc(b) ++# define _mesa_free(m) free(m) + # else + # include + # define __glXMemset memset +-# define _mesa_malloc(b) Xmalloc(b) +-# define _mesa_free(m) Xfree(m) ++# define _mesa_malloc(b) malloc(b) ++# define _mesa_free(m) free(m) + # endif /* XFree86Server */ + #endif /* !defined(IN_MINI_GLX) */ + diff --git a/nx-X11/extras/Mesa.patches_6.4.1/4003_CreatePixmap-AllocationHints.patch b/nx-X11/extras/Mesa.patches_6.4.1/4003_CreatePixmap-AllocationHints.patch new file mode 100644 index 000000000..f2caf2812 --- /dev/null +++ b/nx-X11/extras/Mesa.patches_6.4.1/4003_CreatePixmap-AllocationHints.patch @@ -0,0 +1,13 @@ +Index: Mesa/include/GL/xmesa_xf86.h +=================================================================== +--- Mesa.orig/include/GL/xmesa_xf86.h ++++ Mesa/include/GL/xmesa_xf86.h +@@ -130,7 +130,7 @@ do { \ + + /* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */ + #define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \ +- (*__d->CreatePixmap)(__d, __w, __h, __depth) ++ (*__d->CreatePixmap)(__d, __w, __h, __depth, 0) + + #define XMesaFreePixmap(__d,__b) \ + (*__d->DestroyPixmap)(__b) diff --git a/nx-X11/extras/Mesa.patches_6.4.1/4004_define-USE_IEEE-macro-for-more-platforms.patch b/nx-X11/extras/Mesa.patches_6.4.1/4004_define-USE_IEEE-macro-for-more-platforms.patch new file mode 100644 index 000000000..7db909b91 --- /dev/null +++ b/nx-X11/extras/Mesa.patches_6.4.1/4004_define-USE_IEEE-macro-for-more-platforms.patch @@ -0,0 +1,16 @@ +Author: Mike Gabriel +Description: define USE_IEEE for __aarch64__ and __mc68000__, as well + +Index: Mesa/src/mesa/main/imports.h +=================================================================== +--- Mesa.orig/src/mesa/main/imports.h ++++ Mesa/src/mesa/main/imports.h +@@ -204,6 +204,8 @@ typedef union { GLfloat f; GLint i; } fi + defined(ia64) || defined(__ia64__) || \ + defined(__mips) || defined(_MIPS_ARCH) || \ + defined(__arm__) || \ ++ defined(__aarch64__) || \ ++ defined(__mc68000__) || \ + defined(__sh__) || \ + (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) + #define USE_IEEE diff --git a/nx-X11/extras/Mesa.patches_6.4.1/series b/nx-X11/extras/Mesa.patches_6.4.1/series new file mode 100644 index 000000000..2d4d626b2 --- /dev/null +++ b/nx-X11/extras/Mesa.patches_6.4.1/series @@ -0,0 +1,4 @@ +4001_Fix-non-working-GLX-in-64bit-Xorg-7.0.patch +4002_no-special-glx-memfunctions.patch +4003_CreatePixmap-AllocationHints.patch +4004_define-USE_IEEE-macro-for-more-platforms.patch \ No newline at end of file diff --git a/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h b/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h new file mode 100644 index 000000000..2f7cff193 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h @@ -0,0 +1,5 @@ +/* no-op file to make current Mesa happy */ + +#ifndef _glx_ansic_h_ +#define _glx_ansic_h_ +#endif diff --git a/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h new file mode 100644 index 000000000..5ddc70a15 --- /dev/null +++ b/nx-X11/programs/Xserver/GL/include/GL/xf86glx.h @@ -0,0 +1 @@ +/* no-op file to make current Mesa happy */ diff --git a/nx-X11/programs/Xserver/GL/mesa/main/WSDrawBuffer.h b/nx-X11/programs/Xserver/GL/mesa/main/WSDrawBuffer.h new file mode 100644 index 000000000..bf6ea040c --- /dev/null +++ b/nx-X11/programs/Xserver/GL/mesa/main/WSDrawBuffer.h @@ -0,0 +1,27 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXAGENT, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/**************************************************************************/ + +typedef struct _WSDrawBufferRec { + GLframebuffer *DrawBuffer; + struct _WSDrawBufferRec *next; +} WSDrawBufferRec, *WSDrawBufferPtr; + +WSDrawBufferPtr pWSDrawBuffer; + -- cgit v1.2.3 From fff0d54733b016f225eb767b3d755c06295ac806 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 18 Oct 2017 00:21:00 +0200 Subject: glxext.c/NXglxext.c: merge two functions into one This has also been done in Xorg 7.1 This also fixes a little flaw for the swapped case: a check for glXRenderLarge was missing. --- nx-X11/programs/Xserver/GL/glx/glxext.c | 54 ++----------------- nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 75 ++------------------------- 2 files changed, 9 insertions(+), 120 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxext.c b/nx-X11/programs/Xserver/GL/glx/glxext.c index cb82dc609..e92e605fa 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxext.c +++ b/nx-X11/programs/Xserver/GL/glx/glxext.c @@ -42,7 +42,6 @@ static __GLXextensionInfo *__glXExt /* = &__glDDXExtensionInfo */; /* ** Forward declarations. */ -static int __glXSwapDispatch(ClientPtr); static int __glXDispatch(ClientPtr); /* @@ -246,7 +245,7 @@ void GlxExtensionInit(void) */ extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, __GLX_NUMBER_ERRORS, __glXDispatch, - __glXSwapDispatch, ResetExtension, + __glXDispatch, ResetExtension, StandardMinorOpcode); if (!extEntry) { FatalError("__glXExtensionInit: AddExtensions failed\n"); @@ -445,53 +444,10 @@ static int __glXDispatch(ClientPtr client) /* ** Use the opcode to index into the procedure table. */ - proc = __glXSingleTable[opcode]; - return (*proc)(cl, (GLbyte *) stuff); -} - -static int __glXSwapDispatch(ClientPtr client) -{ - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) malloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - memset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (void *)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSwapSingleTable[opcode]; + if (client->swapped) + proc = __glXSwapSingleTable[opcode]; + else + proc = __glXSingleTable[opcode]; return (*proc)(cl, (GLbyte *) stuff); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c index 5512cae1b..f94473be0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c @@ -107,77 +107,10 @@ static int __glXDispatch(ClientPtr client) /* ** Use the opcode to index into the procedure table. */ - proc = __glXSingleTable[opcode]; - - /* - * Report upstream that we are - * dispatching a GLX operation. - */ - - nxagentGlxTrap = 1; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - result = (*proc)(cl, (GLbyte *) stuff); - - nxagentGlxTrap = 0; - - #ifdef TEST - fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n", - opcode, client -> index); - #endif - - return result; -} - -static int __glXSwapDispatch(ClientPtr client) -{ - int result; - - REQUEST(xGLXSingleReq); - CARD8 opcode; - int (*proc)(__GLXclientState *cl, GLbyte *pc); - __GLXclientState *cl; - - opcode = stuff->glxCode; - cl = __glXClients[client->index]; - if (!cl) { - cl = (__GLXclientState *) malloc(sizeof(__GLXclientState)); - __glXClients[client->index] = cl; - if (!cl) { - return BadAlloc; - } - memset(cl, 0, sizeof(__GLXclientState)); - } - - if (!cl->inUse) { - /* - ** This is first request from this client. Associate a resource - ** with the client so we will be notified when the client dies. - */ - XID xid = FakeClientID(client->index); - if (!AddResource( xid, __glXClientRes, (void *)(long)client->index)) { - return BadAlloc; - } - ResetClientState(client->index); - cl->inUse = GL_TRUE; - cl->client = client; - } - - /* - ** Check for valid opcode. - */ - if (opcode >= __GLX_SINGLE_TABLE_SIZE) { - return BadRequest; - } - - /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXSwapSingleTable[opcode]; + if (client->swapped) + proc = __glXSwapSingleTable[opcode]; + else + proc = __glXSingleTable[opcode]; /* * Report upstream that we are -- cgit v1.2.3 From 9a16043722f6d60505a8776048b39cc7f1e799d9 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 18 Oct 2017 00:28:23 +0200 Subject: fix broken path due to missing / --- .../Xserver/GL/mesa/shader/slang/Imakefile.inc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc index 4ffa7805f..6757e2e50 100644 --- a/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc +++ b/nx-X11/programs/Xserver/GL/mesa/shader/slang/Imakefile.inc @@ -61,16 +61,16 @@ LinkSourceFile(traverse_wrap.h, $(MESASRCDIR)/src/mesa/shader/slang) MESA_SLANG_UOBJS = $(MESA_SLANG_OBJS) #endif - MESA_SLANG_DOBJS = $(MESASLANGBUILDDIR)debuggerslang_assemble_assignment.o \ - $(MESASLANGBUILDDIR)debuggerslang_assemble.o \ - $(MESASLANGBUILDDIR)debuggerslang_assemble_conditional.o \ - $(MESASLANGBUILDDIR)debuggerslang_assemble_constructor.o \ - $(MESASLANGBUILDDIR)debuggerslang_assemble_typeinfo.o \ - $(MESASLANGBUILDDIR)debuggerslang_compile.o \ - $(MESASLANGBUILDDIR)debuggerslang_execute.o \ - $(MESASLANGBUILDDIR)debuggerslang_preprocess.o \ - $(MESASLANGBUILDDIR)debuggerslang_storage.o \ - $(MESASLANGBUILDDIR)debuggerslang_utility.o + MESA_SLANG_DOBJS = $(MESASLANGBUILDDIR)debugger/slang_assemble_assignment.o \ + $(MESASLANGBUILDDIR)debugger/slang_assemble.o \ + $(MESASLANGBUILDDIR)debugger/slang_assemble_conditional.o \ + $(MESASLANGBUILDDIR)debugger/slang_assemble_constructor.o \ + $(MESASLANGBUILDDIR)debugger/slang_assemble_typeinfo.o \ + $(MESASLANGBUILDDIR)debugger/slang_compile.o \ + $(MESASLANGBUILDDIR)debugger/slang_execute.o \ + $(MESASLANGBUILDDIR)debugger/slang_preprocess.o \ + $(MESASLANGBUILDDIR)debugger/slang_storage.o \ + $(MESASLANGBUILDDIR)debugger/slang_utility.o MESA_SLANG_POBJS = $(MESASLANGBUILDDIR)profiled/slang_assemble_assignment.o \ $(MESASLANGBUILDDIR)profiled/slang_assemble.o \ -- cgit v1.2.3 From 16fbdb2a8d4f8d6c2f3c45829e181109b5991a34 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 17 Feb 2017 13:30:13 +0000 Subject: Xserver/GL/glx/glxfb.c: Fix compiler warning: pointer-sign. glxfb.c: In function '__glXFBMemSwapBuffers': glxfb.c:117:5: warning: pointer targets in passing argument 10 of 'pGC->ops->PutImage' differ in signedness [-Wpointer-sign] buf); ^~~ glxfb.c:117:5: note: expected 'char *' but argument is of type 'GLubyte * {aka unsigned char *}' --- nx-X11/programs/Xserver/GL/glx/glxfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxfb.c b/nx-X11/programs/Xserver/GL/glx/glxfb.c index 7248b6ffb..13f02d448 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxfb.c +++ b/nx-X11/programs/Xserver/GL/glx/glxfb.c @@ -113,7 +113,7 @@ __glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv) depth, 0, 0, width, height, pad, ZPixmap, - buf); + (char *)buf); return GL_TRUE; } -- cgit v1.2.3 From a6ffabda67a703f6ba7091db9ad8eed623bc4347 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 17 Feb 2017 13:35:48 +0000 Subject: glx: warning fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 63ccaec2c39f4b5742383472c951ee2cd35c9e14 Author: Adam Jackson Date: Tue Oct 19 11:59:23 2010 -0400 render2.c: In function ‘__glXDisp_Map2d’: render2.c:127: warning: ‘u1’ may be used uninitialized in this function render2.c: In function ‘__glXDisp_Map1d’: render2.c:90: warning: ‘u1’ may be used uninitialized in this function Remove unnecessary test, and change memcpy to memmove as all users were doing overlapping copies. Signed-off-by: Adam Jackson Reviewed-by: Daniel Stone Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/GL/glx/unpack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/unpack.h b/nx-X11/programs/Xserver/GL/glx/unpack.h index 7d84ff575..9554ba4b9 100644 --- a/nx-X11/programs/Xserver/GL/glx/unpack.h +++ b/nx-X11/programs/Xserver/GL/glx/unpack.h @@ -52,7 +52,7 @@ ** Fetch a double from potentially unaligned memory. */ #ifdef __GLX_ALIGN64 -#define __GLX_MEM_COPY(dst,src,n) if (src && dst) memcpy(dst,src,n) +#define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n) #define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8) #else #define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src)) -- cgit v1.2.3 From 8bb1579f40bb74b9dad302e79c124541694b3265 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 14 Dec 2017 08:05:54 +0100 Subject: Xserver/GL/glx/glxcmds.c: Cast small-int values through intptr_t when passed as pointers Picked from this X.org commit: commit b0dd6be2c8703f7062d45ac9fd646550c7d54e3b Author: Jamey Sharp Date: Thu Oct 8 13:38:44 2009 +1100 Cast small-int values through intptr_t when passed as pointers On 64-bit systems, int and pointers don't have the same size, so GCC gives warnings about casts between int and pointer types. However, in the cases covered by this patch, it's always a value that fits in int being stored temporarily as a pointer and then converted back later, which is safe. Casting through the pointer-sized integer type intptr_t convinces the compiler that this is OK. Signed-off-by: Jamey Sharp Signed-off-by: Daniel Stone Backported-to-NX-by: Mike Gabriel (Only appropriate location for backporting: Xserver/GL/glx/glxcmds.c). --- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/GL') diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index efe5b25e9..602b79099 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -1762,7 +1762,7 @@ static int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc) if (ret == Success) { if (barrier) /* add source for cleanup when drawable is gone */ - AddResource(drawable, __glXSwapBarrierRes, (void *)screen); + AddResource(drawable, __glXSwapBarrierRes, (void *)(intptr_t)screen); else /* delete source */ FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE); -- cgit v1.2.3